@idetik/core 0.27.1 → 0.27.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
@@ -839,7 +839,7 @@ function GQ() {
839
839
  function qE(C, A) {
840
840
  return C[0] = A[0], C[1] = A[1], C[2] = A[2], C[3] = A[4], C[4] = A[5], C[5] = A[6], C[6] = A[8], C[7] = A[9], C[8] = A[10], C;
841
841
  }
842
- function FA() {
842
+ function SA() {
843
843
  var C = new DA(16);
844
844
  return DA != Float32Array && (C[1] = 0, C[2] = 0, C[3] = 0, C[4] = 0, C[6] = 0, C[7] = 0, C[8] = 0, C[9] = 0, C[11] = 0, C[12] = 0, C[13] = 0, C[14] = 0), C[0] = 1, C[5] = 1, C[10] = 1, C[15] = 1, C;
845
845
  }
@@ -848,19 +848,19 @@ function pE(C, A, I, g, B, Q, E, i, o, s, t, a, n, D, F, U) {
848
848
  return S[0] = C, S[1] = A, S[2] = I, S[3] = g, S[4] = B, S[5] = Q, S[6] = E, S[7] = i, S[8] = o, S[9] = s, S[10] = t, S[11] = a, S[12] = n, S[13] = D, S[14] = F, S[15] = U, S;
849
849
  }
850
850
  function kg(C, A) {
851
- var I = A[0], g = A[1], B = A[2], Q = A[3], E = A[4], i = A[5], o = A[6], s = A[7], t = A[8], a = A[9], n = A[10], D = A[11], F = A[12], U = A[13], S = A[14], d = A[15], K = I * i - g * E, k = I * o - B * E, R = I * s - Q * E, L = g * o - B * i, M = g * s - Q * i, W = B * s - Q * o, IA = t * U - a * F, CA = t * S - n * F, $ = t * d - D * F, gA = a * S - n * U, SA = a * d - D * U, NA = n * d - D * S, oA = K * NA - k * SA + R * gA + L * $ - M * CA + W * IA;
852
- return oA ? (oA = 1 / oA, C[0] = (i * NA - o * SA + s * gA) * oA, C[1] = (B * SA - g * NA - Q * gA) * oA, C[2] = (U * W - S * M + d * L) * oA, C[3] = (n * M - a * W - D * L) * oA, C[4] = (o * $ - E * NA - s * CA) * oA, C[5] = (I * NA - B * $ + Q * CA) * oA, C[6] = (S * R - F * W - d * k) * oA, C[7] = (t * W - n * R + D * k) * oA, C[8] = (E * SA - i * $ + s * IA) * oA, C[9] = (g * $ - I * SA - Q * IA) * oA, C[10] = (F * M - U * R + d * K) * oA, C[11] = (a * R - t * M - D * K) * oA, C[12] = (i * CA - E * gA - o * IA) * oA, C[13] = (I * gA - g * CA + B * IA) * oA, C[14] = (U * k - F * L - S * K) * oA, C[15] = (t * L - a * k + n * K) * oA, C) : null;
851
+ var I = A[0], g = A[1], B = A[2], Q = A[3], E = A[4], i = A[5], o = A[6], s = A[7], t = A[8], a = A[9], n = A[10], D = A[11], F = A[12], U = A[13], S = A[14], l = A[15], u = I * i - g * E, k = I * o - B * E, R = I * s - Q * E, L = g * o - B * i, M = g * s - Q * i, W = B * s - Q * o, $ = t * U - a * F, BA = t * S - n * F, IA = t * l - D * F, iA = a * S - n * U, fA = a * l - D * U, uA = n * l - D * S, oA = u * uA - k * fA + R * iA + L * IA - M * BA + W * $;
852
+ return oA ? (oA = 1 / oA, C[0] = (i * uA - o * fA + s * iA) * oA, C[1] = (B * fA - g * uA - Q * iA) * oA, C[2] = (U * W - S * M + l * L) * oA, C[3] = (n * M - a * W - D * L) * oA, C[4] = (o * IA - E * uA - s * BA) * oA, C[5] = (I * uA - B * IA + Q * BA) * oA, C[6] = (S * R - F * W - l * k) * oA, C[7] = (t * W - n * R + D * k) * oA, C[8] = (E * fA - i * IA + s * $) * oA, C[9] = (g * IA - I * fA - Q * $) * oA, C[10] = (F * M - U * R + l * u) * oA, C[11] = (a * R - t * M - D * u) * oA, C[12] = (i * BA - E * iA - o * $) * oA, C[13] = (I * iA - g * BA + B * $) * oA, C[14] = (U * k - F * L - S * u) * oA, C[15] = (t * L - a * k + n * u) * oA, C) : null;
853
853
  }
854
- function _A(C, A, I) {
855
- var g = A[0], B = A[1], Q = A[2], E = A[3], i = A[4], o = A[5], s = A[6], t = A[7], a = A[8], n = A[9], D = A[10], F = A[11], U = A[12], S = A[13], d = A[14], K = A[15], k = I[0], R = I[1], L = I[2], M = I[3];
856
- return C[0] = k * g + R * i + L * a + M * U, C[1] = k * B + R * o + L * n + M * S, C[2] = k * Q + R * s + L * D + M * d, C[3] = k * E + R * t + L * F + M * K, k = I[4], R = I[5], L = I[6], M = I[7], C[4] = k * g + R * i + L * a + M * U, C[5] = k * B + R * o + L * n + M * S, C[6] = k * Q + R * s + L * D + M * d, C[7] = k * E + R * t + L * F + M * K, k = I[8], R = I[9], L = I[10], M = I[11], C[8] = k * g + R * i + L * a + M * U, C[9] = k * B + R * o + L * n + M * S, C[10] = k * Q + R * s + L * D + M * d, C[11] = k * E + R * t + L * F + M * K, k = I[12], R = I[13], L = I[14], M = I[15], C[12] = k * g + R * i + L * a + M * U, C[13] = k * B + R * o + L * n + M * S, C[14] = k * Q + R * s + L * D + M * d, C[15] = k * E + R * t + L * F + M * K, C;
854
+ function eI(C, A, I) {
855
+ var g = A[0], B = A[1], Q = A[2], E = A[3], i = A[4], o = A[5], s = A[6], t = A[7], a = A[8], n = A[9], D = A[10], F = A[11], U = A[12], S = A[13], l = A[14], u = A[15], k = I[0], R = I[1], L = I[2], M = I[3];
856
+ return C[0] = k * g + R * i + L * a + M * U, C[1] = k * B + R * o + L * n + M * S, C[2] = k * Q + R * s + L * D + M * l, C[3] = k * E + R * t + L * F + M * u, k = I[4], R = I[5], L = I[6], M = I[7], C[4] = k * g + R * i + L * a + M * U, C[5] = k * B + R * o + L * n + M * S, C[6] = k * Q + R * s + L * D + M * l, C[7] = k * E + R * t + L * F + M * u, k = I[8], R = I[9], L = I[10], M = I[11], C[8] = k * g + R * i + L * a + M * U, C[9] = k * B + R * o + L * n + M * S, C[10] = k * Q + R * s + L * D + M * l, C[11] = k * E + R * t + L * F + M * u, k = I[12], R = I[13], L = I[14], M = I[15], C[12] = k * g + R * i + L * a + M * U, C[13] = k * B + R * o + L * n + M * S, C[14] = k * Q + R * s + L * D + M * l, C[15] = k * E + R * t + L * F + M * u, C;
857
857
  }
858
858
  function mE(C, A) {
859
859
  return C[0] = A[0], C[1] = 0, C[2] = 0, C[3] = 0, C[4] = 0, C[5] = A[1], C[6] = 0, C[7] = 0, C[8] = 0, C[9] = 0, C[10] = A[2], C[11] = 0, C[12] = 0, C[13] = 0, C[14] = 0, C[15] = 1, C;
860
860
  }
861
861
  function xE(C, A, I, g) {
862
- var B = A[0], Q = A[1], E = A[2], i = A[3], o = B + B, s = Q + Q, t = E + E, a = B * o, n = B * s, D = B * t, F = Q * s, U = Q * t, S = E * t, d = i * o, K = i * s, k = i * t, R = g[0], L = g[1], M = g[2];
863
- return C[0] = (1 - (F + S)) * R, C[1] = (n + k) * R, C[2] = (D - K) * R, C[3] = 0, C[4] = (n - k) * L, C[5] = (1 - (a + S)) * L, C[6] = (U + d) * L, C[7] = 0, C[8] = (D + K) * M, C[9] = (U - d) * M, C[10] = (1 - (a + F)) * M, C[11] = 0, C[12] = I[0], C[13] = I[1], C[14] = I[2], C[15] = 1, C;
862
+ var B = A[0], Q = A[1], E = A[2], i = A[3], o = B + B, s = Q + Q, t = E + E, a = B * o, n = B * s, D = B * t, F = Q * s, U = Q * t, S = E * t, l = i * o, u = i * s, k = i * t, R = g[0], L = g[1], M = g[2];
863
+ return C[0] = (1 - (F + S)) * R, C[1] = (n + k) * R, C[2] = (D - u) * R, C[3] = 0, C[4] = (n - k) * L, C[5] = (1 - (a + S)) * L, C[6] = (U + l) * L, C[7] = 0, C[8] = (D + u) * M, C[9] = (U - l) * M, C[10] = (1 - (a + F)) * M, C[11] = 0, C[12] = I[0], C[13] = I[1], C[14] = I[2], C[15] = 1, C;
864
864
  }
865
865
  function bE(C, A, I, g, B) {
866
866
  var Q = 1 / Math.tan(A / 2);
@@ -884,10 +884,10 @@ function ZE(C, A, I, g) {
884
884
  return D = F * F + U * U + S * S, D > 0 && (D = 1 / Math.sqrt(D), F *= D, U *= D, S *= D), C[0] = F, C[1] = U, C[2] = S, C[3] = 0, C[4] = a * S - n * U, C[5] = n * F - t * S, C[6] = t * U - a * F, C[7] = 0, C[8] = t, C[9] = a, C[10] = n, C[11] = 0, C[12] = B, C[13] = Q, C[14] = E, C[15] = 1, C;
885
885
  }
886
886
  function PE(C, A) {
887
- var I = C[0], g = C[1], B = C[2], Q = C[3], E = C[4], i = C[5], o = C[6], s = C[7], t = C[8], a = C[9], n = C[10], D = C[11], F = C[12], U = C[13], S = C[14], d = C[15], K = A[0], k = A[1], R = A[2], L = A[3], M = A[4], W = A[5], IA = A[6], CA = A[7], $ = A[8], gA = A[9], SA = A[10], NA = A[11], oA = A[12], BC = A[13], CC = A[14], QC = A[15];
888
- return Math.abs(I - K) <= AA * Math.max(1, Math.abs(I), Math.abs(K)) && Math.abs(g - k) <= AA * Math.max(1, Math.abs(g), Math.abs(k)) && Math.abs(B - R) <= AA * Math.max(1, Math.abs(B), Math.abs(R)) && Math.abs(Q - L) <= AA * Math.max(1, Math.abs(Q), Math.abs(L)) && Math.abs(E - M) <= AA * Math.max(1, Math.abs(E), Math.abs(M)) && Math.abs(i - W) <= AA * Math.max(1, Math.abs(i), Math.abs(W)) && Math.abs(o - IA) <= AA * Math.max(1, Math.abs(o), Math.abs(IA)) && Math.abs(s - CA) <= AA * Math.max(1, Math.abs(s), Math.abs(CA)) && Math.abs(t - $) <= AA * Math.max(1, Math.abs(t), Math.abs($)) && Math.abs(a - gA) <= AA * Math.max(1, Math.abs(a), Math.abs(gA)) && Math.abs(n - SA) <= AA * Math.max(1, Math.abs(n), Math.abs(SA)) && Math.abs(D - NA) <= AA * Math.max(1, Math.abs(D), Math.abs(NA)) && Math.abs(F - oA) <= AA * Math.max(1, Math.abs(F), Math.abs(oA)) && Math.abs(U - BC) <= AA * Math.max(1, Math.abs(U), Math.abs(BC)) && Math.abs(S - CC) <= AA * Math.max(1, Math.abs(S), Math.abs(CC)) && Math.abs(d - QC) <= AA * Math.max(1, Math.abs(d), Math.abs(QC));
887
+ var I = C[0], g = C[1], B = C[2], Q = C[3], E = C[4], i = C[5], o = C[6], s = C[7], t = C[8], a = C[9], n = C[10], D = C[11], F = C[12], U = C[13], S = C[14], l = C[15], u = A[0], k = A[1], R = A[2], L = A[3], M = A[4], W = A[5], $ = A[6], BA = A[7], IA = A[8], iA = A[9], fA = A[10], uA = A[11], oA = A[12], BC = A[13], CC = A[14], QC = A[15];
888
+ return Math.abs(I - u) <= AA * Math.max(1, Math.abs(I), Math.abs(u)) && Math.abs(g - k) <= AA * Math.max(1, Math.abs(g), Math.abs(k)) && Math.abs(B - R) <= AA * Math.max(1, Math.abs(B), Math.abs(R)) && Math.abs(Q - L) <= AA * Math.max(1, Math.abs(Q), Math.abs(L)) && Math.abs(E - M) <= AA * Math.max(1, Math.abs(E), Math.abs(M)) && Math.abs(i - W) <= AA * Math.max(1, Math.abs(i), Math.abs(W)) && Math.abs(o - $) <= AA * Math.max(1, Math.abs(o), Math.abs($)) && Math.abs(s - BA) <= AA * Math.max(1, Math.abs(s), Math.abs(BA)) && Math.abs(t - IA) <= AA * Math.max(1, Math.abs(t), Math.abs(IA)) && Math.abs(a - iA) <= AA * Math.max(1, Math.abs(a), Math.abs(iA)) && Math.abs(n - fA) <= AA * Math.max(1, Math.abs(n), Math.abs(fA)) && Math.abs(D - uA) <= AA * Math.max(1, Math.abs(D), Math.abs(uA)) && Math.abs(F - oA) <= AA * Math.max(1, Math.abs(F), Math.abs(oA)) && Math.abs(U - BC) <= AA * Math.max(1, Math.abs(U), Math.abs(BC)) && Math.abs(S - CC) <= AA * Math.max(1, Math.abs(S), Math.abs(CC)) && Math.abs(l - QC) <= AA * Math.max(1, Math.abs(l), Math.abs(QC));
889
889
  }
890
- function EA() {
890
+ function QA() {
891
891
  var C = new DA(3);
892
892
  return DA != Float32Array && (C[0] = 0, C[1] = 0, C[2] = 0), C;
893
893
  }
@@ -906,7 +906,7 @@ function P(C, A, I) {
906
906
  function $g(C, A) {
907
907
  return C[0] = A[0], C[1] = A[1], C[2] = A[2], C;
908
908
  }
909
- function II(C, A, I, g) {
909
+ function AI(C, A, I, g) {
910
910
  return C[0] = A, C[1] = I, C[2] = g, C;
911
911
  }
912
912
  function HI(C, A, I) {
@@ -952,7 +952,7 @@ function NB(C, A) {
952
952
  }
953
953
  var AB = VE, jE = FB;
954
954
  (function() {
955
- var C = EA();
955
+ var C = QA();
956
956
  return function(A, I, g, B, Q, E) {
957
957
  var i, o;
958
958
  for (I || (I = 3), g || (g = 0), B ? o = Math.min(B * I + g, A.length) : o = A.length, i = g; i < o; i += I)
@@ -1026,7 +1026,7 @@ function SQ(C, A) {
1026
1026
  }
1027
1027
  var Ci = zE, Qi = $E, RB = Ii;
1028
1028
  (function() {
1029
- var C = EA(), A = P(1, 0, 0), I = P(0, 1, 0);
1029
+ var C = QA(), A = P(1, 0, 0), I = P(0, 1, 0);
1030
1030
  return function(g, B, Q) {
1031
1031
  var E = FQ(B, Q);
1032
1032
  return E < -0.999999 ? (Kg(C, A, B), jE(C) < 1e-6 && Kg(C, I, B), _E(C, C), gi(g, C, Math.PI), g) : E > 0.999999 ? (g[0] = 0, g[1] = 0, g[2] = 0, g[3] = 1, g) : (Kg(C, B, Q), g[0] = C[0], g[1] = C[1], g[2] = C[2], g[3] = 1 + E, RB(g, g));
@@ -1084,7 +1084,7 @@ function qg(C, A) {
1084
1084
  return A;
1085
1085
  };
1086
1086
  })();
1087
- class gI {
1087
+ class II {
1088
1088
  min;
1089
1089
  max;
1090
1090
  /**
@@ -1097,7 +1097,7 @@ class gI {
1097
1097
  this.min = A ? bA(A) : P(1 / 0, 1 / 0, 1 / 0), this.max = I ? bA(I) : P(-1 / 0, -1 / 0, -1 / 0);
1098
1098
  }
1099
1099
  clone() {
1100
- return new gI(this.min, this.max);
1100
+ return new II(this.min, this.max);
1101
1101
  }
1102
1102
  isEmpty() {
1103
1103
  return this.max[0] <= this.min[0] || this.max[1] <= this.min[1] || this.max[2] <= this.min[2];
@@ -1121,7 +1121,7 @@ class gI {
1121
1121
  P(g[0], g[1], g[2])
1122
1122
  ];
1123
1123
  this.min = P(1 / 0, 1 / 0, 1 / 0), this.max = P(-1 / 0, -1 / 0, -1 / 0);
1124
- const Q = EA();
1124
+ const Q = QA();
1125
1125
  for (const E of B)
1126
1126
  SB(Q, E, A), this.expandWithPoint(Q);
1127
1127
  }
@@ -1175,7 +1175,7 @@ class NI extends GB {
1175
1175
  const A = this.getAttribute("position");
1176
1176
  if (!A || this.vertexCount === 0)
1177
1177
  throw new Error("Failed to generate bounding box");
1178
- const I = (A.offset ?? 0) / Float32Array.BYTES_PER_ELEMENT, g = new gI(), B = EA();
1178
+ const I = (A.offset ?? 0) / Float32Array.BYTES_PER_ELEMENT, g = new II(), B = QA();
1179
1179
  for (let Q = 0; Q < this.vertexData_.length; Q += this.stride)
1180
1180
  B[0] = this.vertexData_[Q + I + 0], B[1] = this.vertexData_[Q + I + 1], B[2] = this.vertexData_[Q + I + 2], g.expandWithPoint(B);
1181
1181
  this.boundingBox_ = g;
@@ -1668,7 +1668,7 @@ class ai {
1668
1668
  A ? this.enable(this.gl_.STENCIL_TEST) : this.disable(this.gl_.STENCIL_TEST);
1669
1669
  }
1670
1670
  }
1671
- const ei = mE(FA(), [1, -1, 1]);
1671
+ const ei = mE(SA(), [1, -1, 1]);
1672
1672
  class eC extends cQ {
1673
1673
  gl_;
1674
1674
  programs_;
@@ -1703,7 +1703,7 @@ class eC extends cQ {
1703
1703
  for (const t of A.layers)
1704
1704
  (t.blendMode === "none" ? I : g).push(t);
1705
1705
  for (const t of [...I, ...g])
1706
- t.update({ viewport: A });
1706
+ t.update(A);
1707
1707
  if (getComputedStyle(A.element).visibility === "hidden") return;
1708
1708
  const B = A.getBoxRelativeTo(this.canvas), Q = new GA(
1709
1709
  eA(0, 0),
@@ -1765,12 +1765,12 @@ class eC extends cQ {
1765
1765
  }
1766
1766
  }
1767
1767
  drawGeometry(A, I, g, B, Q) {
1768
- const E = _A(
1769
- FA(),
1768
+ const E = eI(
1769
+ SA(),
1770
1770
  Q.viewMatrix,
1771
1771
  I.transform.matrix
1772
- ), i = _A(
1773
- FA(),
1772
+ ), i = eI(
1773
+ SA(),
1774
1774
  ei,
1775
1775
  Q.projectionMatrix
1776
1776
  ), o = this.currentViewportSize_, s = I.getUniforms(), a = {
@@ -1795,7 +1795,7 @@ class eC extends cQ {
1795
1795
  );
1796
1796
  break;
1797
1797
  case "CameraPositionModel": {
1798
- const U = kg(FA(), E), S = Bg(0, 0, 0, 1), d = pI(
1798
+ const U = kg(SA(), E), S = Bg(0, 0, 0, 1), l = pI(
1799
1799
  rI(),
1800
1800
  S,
1801
1801
  U
@@ -1803,9 +1803,9 @@ class eC extends cQ {
1803
1803
  B.setUniform(
1804
1804
  F,
1805
1805
  P(
1806
- d[0],
1807
- d[1],
1808
- d[2]
1806
+ l[0],
1807
+ l[1],
1808
+ l[2]
1809
1809
  )
1810
1810
  );
1811
1811
  break;
@@ -2495,7 +2495,7 @@ function UQ(C) {
2495
2495
  align: 1
2496
2496
  };
2497
2497
  }
2498
- class dA {
2498
+ class kA {
2499
2499
  constructor(A, I) {
2500
2500
  this.name = A, this.attributes = I, this.size = 0;
2501
2501
  }
@@ -2544,7 +2544,7 @@ class hC {
2544
2544
  return this.type.isArray ? this.type.stride : this.size;
2545
2545
  }
2546
2546
  }
2547
- class PA extends dA {
2547
+ class PA extends kA {
2548
2548
  constructor(A, I) {
2549
2549
  super(A, I), this.members = [], this.align = 0, this.startLine = -1, this.endLine = -1, this.inUse = !1;
2550
2550
  }
@@ -2552,7 +2552,7 @@ class PA extends dA {
2552
2552
  return !0;
2553
2553
  }
2554
2554
  }
2555
- class XA extends dA {
2555
+ class _A extends kA {
2556
2556
  constructor(A, I) {
2557
2557
  super(A, I), this.count = 0, this.stride = 0;
2558
2558
  }
@@ -2563,7 +2563,7 @@ class XA extends dA {
2563
2563
  return `array<${this.format.getTypeName()}, ${this.count}>`;
2564
2564
  }
2565
2565
  }
2566
- class CB extends dA {
2566
+ class CB extends kA {
2567
2567
  constructor(A, I, g) {
2568
2568
  super(A, g), this.format = I;
2569
2569
  }
@@ -2574,7 +2574,7 @@ class CB extends dA {
2574
2574
  return `&${this.format.getTypeName()}`;
2575
2575
  }
2576
2576
  }
2577
- class BI extends dA {
2577
+ class gI extends kA {
2578
2578
  constructor(A, I, g, B) {
2579
2579
  super(A, g), this.format = I, this.access = B;
2580
2580
  }
@@ -2885,9 +2885,9 @@ function _(C, A, I, g, B) {
2885
2885
  return B;
2886
2886
  }
2887
2887
  const pg = { r8unorm: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8snorm: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8uint: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8sint: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg8unorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8snorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8uint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8sint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba8unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "rgba8unorm-srgb": { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8snorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, bgra8unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "bgra8unorm-srgb": { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, r16uint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r16sint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r16float: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg16uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg16sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg16float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba16uint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba16sint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba16float: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, r32uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r32sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r32float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg32uint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg32sint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg32float: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba32uint: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba32sint: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba32float: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgb10a2uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgb10a2unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rg11b10ufloat: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, stencil8: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !1, hasStencil: !0, channels: 1 }, depth16unorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, channels: 1 }, depth24plus: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, depthOnlyFormat: "depth32float", channels: 1 }, "depth24plus-stencil8": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !0, depthOnlyFormat: "depth32float", channels: 1 }, depth32float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, channels: 1 }, "depth32float-stencil8": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !0, stencilOnlyFormat: "depth32float", channels: 1 }, rgb9e5ufloat: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "bc1-rgba-unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc1-rgba-unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc2-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc2-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc3-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc3-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc4-r-unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 1 }, "bc4-r-snorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 1 }, "bc5-rg-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 2 }, "bc5-rg-snorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 2 }, "bc6h-rgb-ufloat": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc6h-rgb-float": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc7-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc7-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8a1unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8a1unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgba8unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgba8unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "eac-r11unorm": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 1 }, "eac-r11snorm": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 1 }, "eac-rg11unorm": { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 2 }, "eac-rg11snorm": { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 2 }, "astc-4x4-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-4x4-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x4-unorm": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x4-unorm-srgb": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x5-unorm": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-5x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x5-unorm": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x6-unorm": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-6x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x5-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-8x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-8x6-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x8-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-8x8-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x5-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-10x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-10x6-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-10x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-10x8-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x8-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x10-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-10x10-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x10-unorm": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x10-unorm-srgb": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x12-unorm": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 12, isCompressed: !0, channels: 4 }, "astc-12x12-unorm-srgb": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 12, isCompressed: !0, channels: 4 } };
2888
- class LA {
2888
+ class dA {
2889
2889
  constructor() {
2890
- this.id = LA._id++, this.line = 0;
2890
+ this.id = dA._id++, this.line = 0;
2891
2891
  }
2892
2892
  get isAstNode() {
2893
2893
  return !0;
@@ -2913,17 +2913,17 @@ class LA {
2913
2913
  return (g = (I = this.constEvaluate(A)) === null || I === void 0 ? void 0 : I.toString()) !== null && g !== void 0 ? g : "";
2914
2914
  }
2915
2915
  }
2916
- LA._id = 0;
2917
- class Cg extends LA {
2916
+ dA._id = 0;
2917
+ class Cg extends dA {
2918
2918
  }
2919
2919
  Cg.instance = new Cg();
2920
- class Qg extends LA {
2920
+ class Qg extends dA {
2921
2921
  }
2922
2922
  Qg.instance = new Qg();
2923
2923
  const LQ = /* @__PURE__ */ new Set(["all", "any", "select", "arrayLength", "abs", "acos", "acosh", "asin", "asinh", "atan", "atanh", "atan2", "ceil", "clamp", "cos", "cosh", "countLeadingZeros", "countOneBits", "countTrailingZeros", "cross", "degrees", "determinant", "distance", "dot", "dot4U8Packed", "dot4I8Packed", "exp", "exp2", "extractBits", "faceForward", "firstLeadingBit", "firstTrailingBit", "floor", "fma", "fract", "frexp", "insertBits", "inverseSqrt", "ldexp", "length", "log", "log2", "max", "min", "mix", "modf", "normalize", "pow", "quantizeToF16", "radians", "reflect", "refract", "reverseBits", "round", "saturate", "sign", "sin", "sinh", "smoothstep", "sqrt", "step", "tan", "tanh", "transpose", "trunc", "dpdx", "dpdxCoarse", "dpdxFine", "dpdy", "dpdyCoarse", "dpdyFine", "fwidth", "fwidthCoarse", "fwidthFine", "textureDimensions", "textureGather", "textureGatherCompare", "textureLoad", "textureNumLayers", "textureNumLevels", "textureNumSamples", "textureSample", "textureSampleBias", "textureSampleCompare", "textureSampleCompareLevel", "textureSampleGrad", "textureSampleLevel", "textureSampleBaseClampToEdge", "textureStore", "atomicLoad", "atomicStore", "atomicAdd", "atomicSub", "atomicMax", "atomicMin", "atomicAnd", "atomicOr", "atomicXor", "atomicExchange", "atomicCompareExchangeWeak", "pack4x8snorm", "pack4x8unorm", "pack4xI8", "pack4xU8", "pack4x8Clamp", "pack4xU8Clamp", "pack2x16snorm", "pack2x16unorm", "pack2x16float", "unpack4x8snorm", "unpack4x8unorm", "unpack4xI8", "unpack4xU8", "unpack2x16snorm", "unpack2x16unorm", "unpack2x16float", "storageBarrier", "textureBarrier", "workgroupBarrier", "workgroupUniformLoad", "subgroupAdd", "subgroupExclusiveAdd", "subgroupInclusiveAdd", "subgroupAll", "subgroupAnd", "subgroupAny", "subgroupBallot", "subgroupBroadcast", "subgroupBroadcastFirst", "subgroupElect", "subgroupMax", "subgroupMin", "subgroupMul", "subgroupExclusiveMul", "subgroupInclusiveMul", "subgroupOr", "subgroupShuffle", "subgroupShuffleDown", "subgroupShuffleUp", "subgroupShuffleXor", "subgroupXor", "quadBroadcast", "quadSwapDiagonal", "quadSwapX", "quadSwapY"]);
2924
- class iA extends LA {
2924
+ class EA extends dA {
2925
2925
  }
2926
- class mI extends iA {
2926
+ class mI extends EA {
2927
2927
  constructor(A, I, g, B, Q, E) {
2928
2928
  super(), this.calls = /* @__PURE__ */ new Set(), this.name = A, this.args = I, this.returnType = g, this.body = B, this.startLine = Q, this.endLine = E;
2929
2929
  }
@@ -2937,7 +2937,7 @@ class mI extends iA {
2937
2937
  this.searchBlock(this.body, A);
2938
2938
  }
2939
2939
  }
2940
- class wC extends iA {
2940
+ class wC extends EA {
2941
2941
  constructor(A) {
2942
2942
  super(), this.expression = A;
2943
2943
  }
@@ -2948,7 +2948,7 @@ class wC extends iA {
2948
2948
  this.expression.search(A);
2949
2949
  }
2950
2950
  }
2951
- class JQ extends iA {
2951
+ class JQ extends EA {
2952
2952
  constructor(A, I) {
2953
2953
  super(), this.condition = A, this.body = I;
2954
2954
  }
@@ -2959,7 +2959,7 @@ class JQ extends iA {
2959
2959
  this.condition.search(A), this.searchBlock(this.body, A);
2960
2960
  }
2961
2961
  }
2962
- class QB extends iA {
2962
+ class QB extends EA {
2963
2963
  constructor(A, I) {
2964
2964
  super(), this.body = A, this.loopId = I;
2965
2965
  }
@@ -2970,7 +2970,7 @@ class QB extends iA {
2970
2970
  this.searchBlock(this.body, A);
2971
2971
  }
2972
2972
  }
2973
- class YQ extends iA {
2973
+ class YQ extends EA {
2974
2974
  constructor(A, I, g, B) {
2975
2975
  super(), this.init = A, this.condition = I, this.increment = g, this.body = B;
2976
2976
  }
@@ -2982,7 +2982,7 @@ class YQ extends iA {
2982
2982
  (I = this.init) === null || I === void 0 || I.search(A), (g = this.condition) === null || g === void 0 || g.search(A), (B = this.increment) === null || B === void 0 || B.search(A), this.searchBlock(this.body, A);
2983
2983
  }
2984
2984
  }
2985
- class HA extends iA {
2985
+ class HA extends EA {
2986
2986
  constructor(A, I, g, B, Q) {
2987
2987
  super(), this.attributes = null, this.name = A, this.type = I, this.storage = g, this.access = B, this.value = Q;
2988
2988
  }
@@ -2994,7 +2994,7 @@ class HA extends iA {
2994
2994
  A(this), (I = this.value) === null || I === void 0 || I.search(A);
2995
2995
  }
2996
2996
  }
2997
- class lB extends iA {
2997
+ class lB extends EA {
2998
2998
  constructor(A, I, g) {
2999
2999
  super(), this.attributes = null, this.name = A, this.type = I, this.value = g;
3000
3000
  }
@@ -3006,7 +3006,7 @@ class lB extends iA {
3006
3006
  (I = this.value) === null || I === void 0 || I.search(A);
3007
3007
  }
3008
3008
  }
3009
- class fI extends iA {
3009
+ class fI extends EA {
3010
3010
  constructor(A, I, g, B, Q) {
3011
3011
  super(), this.attributes = null, this.name = A, this.type = I, this.storage = g, this.access = B, this.value = Q;
3012
3012
  }
@@ -3018,7 +3018,7 @@ class fI extends iA {
3018
3018
  A(this), (I = this.value) === null || I === void 0 || I.search(A);
3019
3019
  }
3020
3020
  }
3021
- class zI extends iA {
3021
+ class zI extends EA {
3022
3022
  constructor(A, I, g, B, Q) {
3023
3023
  super(), this.attributes = null, this.name = A, this.type = I, this.storage = g, this.access = B, this.value = Q;
3024
3024
  }
@@ -3033,17 +3033,17 @@ class zI extends iA {
3033
3033
  A(this), (I = this.value) === null || I === void 0 || I.search(A);
3034
3034
  }
3035
3035
  }
3036
- var eI, LI, G, h;
3036
+ var aI, LI, G, h;
3037
3037
  ((C) => {
3038
3038
  C.increment = "++", C.decrement = "--";
3039
- })(eI || (eI = {})), ((C) => {
3039
+ })(aI || (aI = {})), ((C) => {
3040
3040
  C.parse = function(A) {
3041
3041
  const I = A;
3042
3042
  if (I === "parse") throw new Error("Invalid value for IncrementOperator");
3043
3043
  return C[I];
3044
3044
  };
3045
- })(eI || (eI = {}));
3046
- class MQ extends iA {
3045
+ })(aI || (aI = {}));
3046
+ class MQ extends EA {
3047
3047
  constructor(A, I) {
3048
3048
  super(), this.operator = A, this.variable = I;
3049
3049
  }
@@ -3063,7 +3063,7 @@ class MQ extends iA {
3063
3063
  return I;
3064
3064
  };
3065
3065
  })(LI || (LI = {}));
3066
- class fQ extends iA {
3066
+ class fQ extends EA {
3067
3067
  constructor(A, I, g) {
3068
3068
  super(), this.operator = A, this.variable = I, this.value = g;
3069
3069
  }
@@ -3074,7 +3074,7 @@ class fQ extends iA {
3074
3074
  this.variable.search(A), this.value.search(A);
3075
3075
  }
3076
3076
  }
3077
- class LB extends iA {
3077
+ class LB extends EA {
3078
3078
  constructor(A, I) {
3079
3079
  super(), this.name = A, this.args = I;
3080
3080
  }
@@ -3089,7 +3089,7 @@ class LB extends iA {
3089
3089
  A(this);
3090
3090
  }
3091
3091
  }
3092
- class uQ extends iA {
3092
+ class uQ extends EA {
3093
3093
  constructor(A, I) {
3094
3094
  super(), this.body = A, this.continuing = I;
3095
3095
  }
@@ -3101,7 +3101,7 @@ class uQ extends iA {
3101
3101
  this.searchBlock(this.body, A), (I = this.continuing) === null || I === void 0 || I.search(A);
3102
3102
  }
3103
3103
  }
3104
- class KQ extends iA {
3104
+ class KQ extends EA {
3105
3105
  constructor(A, I) {
3106
3106
  super(), this.condition = A, this.cases = I;
3107
3107
  }
@@ -3113,7 +3113,7 @@ class KQ extends iA {
3113
3113
  for (const I of this.cases) I.search(A);
3114
3114
  }
3115
3115
  }
3116
- class HQ extends iA {
3116
+ class HQ extends EA {
3117
3117
  constructor(A, I, g, B) {
3118
3118
  super(), this.condition = A, this.body = I, this.elseif = g, this.else = B;
3119
3119
  }
@@ -3124,7 +3124,7 @@ class HQ extends iA {
3124
3124
  this.condition.search(A), this.searchBlock(this.body, A), this.searchBlock(this.elseif, A), this.searchBlock(this.else, A);
3125
3125
  }
3126
3126
  }
3127
- class qQ extends iA {
3127
+ class qQ extends EA {
3128
3128
  constructor(A) {
3129
3129
  super(), this.value = A;
3130
3130
  }
@@ -3136,7 +3136,7 @@ class qQ extends iA {
3136
3136
  (I = this.value) === null || I === void 0 || I.search(A);
3137
3137
  }
3138
3138
  }
3139
- class Pi extends iA {
3139
+ class Pi extends EA {
3140
3140
  constructor(A) {
3141
3141
  super(), this.name = A;
3142
3142
  }
@@ -3144,7 +3144,7 @@ class Pi extends iA {
3144
3144
  return "enable";
3145
3145
  }
3146
3146
  }
3147
- class Vi extends iA {
3147
+ class Vi extends EA {
3148
3148
  constructor(A) {
3149
3149
  super(), this.extensions = A;
3150
3150
  }
@@ -3152,7 +3152,7 @@ class Vi extends iA {
3152
3152
  return "requires";
3153
3153
  }
3154
3154
  }
3155
- class pQ extends iA {
3155
+ class pQ extends EA {
3156
3156
  constructor(A, I) {
3157
3157
  super(), this.severity = A, this.rule = I;
3158
3158
  }
@@ -3160,7 +3160,7 @@ class pQ extends iA {
3160
3160
  return "diagnostic";
3161
3161
  }
3162
3162
  }
3163
- class JB extends iA {
3163
+ class JB extends EA {
3164
3164
  constructor(A, I) {
3165
3165
  super(), this.name = A, this.type = I;
3166
3166
  }
@@ -3168,12 +3168,12 @@ class JB extends iA {
3168
3168
  return "alias";
3169
3169
  }
3170
3170
  }
3171
- class Oi extends iA {
3171
+ class Oi extends EA {
3172
3172
  get astNodeType() {
3173
3173
  return "discard";
3174
3174
  }
3175
3175
  }
3176
- class mQ extends iA {
3176
+ class mQ extends EA {
3177
3177
  constructor() {
3178
3178
  super(...arguments), this.condition = null, this.loopId = -1;
3179
3179
  }
@@ -3181,7 +3181,7 @@ class mQ extends iA {
3181
3181
  return "break";
3182
3182
  }
3183
3183
  }
3184
- class xQ extends iA {
3184
+ class xQ extends EA {
3185
3185
  constructor() {
3186
3186
  super(...arguments), this.loopId = -1;
3187
3187
  }
@@ -3189,7 +3189,7 @@ class xQ extends iA {
3189
3189
  return "continue";
3190
3190
  }
3191
3191
  }
3192
- class N extends iA {
3192
+ class N extends EA {
3193
3193
  constructor(A) {
3194
3194
  super(), this.attributes = null, this.name = A;
3195
3195
  }
@@ -3289,12 +3289,12 @@ class JI extends N {
3289
3289
  return "sampler";
3290
3290
  }
3291
3291
  }
3292
- class fA extends LA {
3292
+ class YA extends dA {
3293
3293
  constructor() {
3294
3294
  super(), this.postfix = null, this.hasParen = !1;
3295
3295
  }
3296
3296
  }
3297
- class CI extends fA {
3297
+ class BI extends YA {
3298
3298
  constructor(A) {
3299
3299
  super(), this.value = A;
3300
3300
  }
@@ -3308,7 +3308,7 @@ class CI extends fA {
3308
3308
  return this.value;
3309
3309
  }
3310
3310
  }
3311
- class KA extends fA {
3311
+ class KA extends YA {
3312
3312
  constructor(A, I) {
3313
3313
  super(), this.type = A, this.args = I;
3314
3314
  }
@@ -3322,7 +3322,7 @@ class KA extends fA {
3322
3322
  return I && (I[0] = this.type), A.evalExpression(this, A.context);
3323
3323
  }
3324
3324
  }
3325
- class YB extends fA {
3325
+ class YB extends YA {
3326
3326
  constructor(A, I) {
3327
3327
  super(), this.cachedReturnValue = null, this.name = A, this.args = I;
3328
3328
  }
@@ -3343,7 +3343,7 @@ class YB extends fA {
3343
3343
  A(this);
3344
3344
  }
3345
3345
  }
3346
- class wA extends fA {
3346
+ class wA extends YA {
3347
3347
  constructor(A) {
3348
3348
  super(), this.name = A;
3349
3349
  }
@@ -3357,7 +3357,7 @@ class wA extends fA {
3357
3357
  return A.evalExpression(this, A.context);
3358
3358
  }
3359
3359
  }
3360
- class bQ extends fA {
3360
+ class bQ extends YA {
3361
3361
  constructor(A, I) {
3362
3362
  super(), this.name = A, this.initializer = I;
3363
3363
  }
@@ -3372,7 +3372,7 @@ class bQ extends fA {
3372
3372
  this.initializer.search(A);
3373
3373
  }
3374
3374
  }
3375
- class rA extends fA {
3375
+ class rA extends YA {
3376
3376
  constructor(A, I) {
3377
3377
  super(), this.value = A, this.type = I;
3378
3378
  }
@@ -3395,7 +3395,7 @@ class rA extends fA {
3395
3395
  return this.value instanceof r || this.value instanceof p ? this.value.data : (console.error("Value is not a vector or matrix."), new Float32Array(0));
3396
3396
  }
3397
3397
  }
3398
- class TQ extends fA {
3398
+ class TQ extends YA {
3399
3399
  constructor(A, I) {
3400
3400
  super(), this.type = A, this.value = I;
3401
3401
  }
@@ -3406,7 +3406,7 @@ class TQ extends fA {
3406
3406
  this.value.search(A);
3407
3407
  }
3408
3408
  }
3409
- class hI extends fA {
3409
+ class hI extends YA {
3410
3410
  constructor(A) {
3411
3411
  super(), this.index = A;
3412
3412
  }
@@ -3414,7 +3414,7 @@ class hI extends fA {
3414
3414
  this.index.search(A);
3415
3415
  }
3416
3416
  }
3417
- class WQ extends fA {
3417
+ class WQ extends YA {
3418
3418
  constructor() {
3419
3419
  super();
3420
3420
  }
@@ -3433,7 +3433,7 @@ class tA extends WQ {
3433
3433
  this.right.search(A);
3434
3434
  }
3435
3435
  }
3436
- class YA extends WQ {
3436
+ class LA extends WQ {
3437
3437
  constructor(A, I, g) {
3438
3438
  super(), this.operator = A, this.left = I, this.right = g;
3439
3439
  }
@@ -3450,7 +3450,7 @@ class YA extends WQ {
3450
3450
  this.left.search(A), this.right.search(A);
3451
3451
  }
3452
3452
  }
3453
- class vQ extends LA {
3453
+ class vQ extends dA {
3454
3454
  constructor(A) {
3455
3455
  super(), this.body = A;
3456
3456
  }
@@ -3458,7 +3458,7 @@ class vQ extends LA {
3458
3458
  A(this), this.searchBlock(this.body, A);
3459
3459
  }
3460
3460
  }
3461
- class Ag extends fA {
3461
+ class Ag extends YA {
3462
3462
  get astNodeType() {
3463
3463
  return "default";
3464
3464
  }
@@ -3485,7 +3485,7 @@ class PQ extends vQ {
3485
3485
  this.searchBlock(this.body, A);
3486
3486
  }
3487
3487
  }
3488
- class FC extends LA {
3488
+ class FC extends dA {
3489
3489
  constructor(A, I, g) {
3490
3490
  super(), this.name = A, this.type = I, this.attributes = g;
3491
3491
  }
@@ -3493,7 +3493,7 @@ class FC extends LA {
3493
3493
  return "argument";
3494
3494
  }
3495
3495
  }
3496
- class _i extends LA {
3496
+ class _i extends dA {
3497
3497
  constructor(A, I) {
3498
3498
  super(), this.condition = A, this.body = I;
3499
3499
  }
@@ -3504,7 +3504,7 @@ class _i extends LA {
3504
3504
  this.condition.search(A), this.searchBlock(this.body, A);
3505
3505
  }
3506
3506
  }
3507
- class SC extends LA {
3507
+ class SC extends dA {
3508
3508
  constructor(A, I, g) {
3509
3509
  super(), this.name = A, this.type = I, this.attributes = g;
3510
3510
  }
@@ -3512,7 +3512,7 @@ class SC extends LA {
3512
3512
  return "member";
3513
3513
  }
3514
3514
  }
3515
- class VQ extends LA {
3515
+ class VQ extends dA {
3516
3516
  constructor(A, I) {
3517
3517
  super(), this.name = A, this.value = I;
3518
3518
  }
@@ -3520,9 +3520,9 @@ class VQ extends LA {
3520
3520
  return "attribute";
3521
3521
  }
3522
3522
  }
3523
- class uA {
3523
+ class MA {
3524
3524
  constructor(A, I) {
3525
- this.parent = null, this.typeInfo = A, this.parent = I, this.id = uA._id++;
3525
+ this.parent = null, this.typeInfo = A, this.parent = I, this.id = MA._id++;
3526
3526
  }
3527
3527
  setDataValue(A, I, g, B) {
3528
3528
  console.error(`SetDataValue: Not implemented for ${this.constructor.name}`);
@@ -3534,8 +3534,8 @@ class uA {
3534
3534
  return `<${this.typeInfo.getTypeName()}>`;
3535
3535
  }
3536
3536
  }
3537
- uA._id = 0;
3538
- class NC extends uA {
3537
+ MA._id = 0;
3538
+ class NC extends MA {
3539
3539
  constructor(A, I) {
3540
3540
  super(A, I);
3541
3541
  }
@@ -3546,9 +3546,9 @@ class NC extends uA {
3546
3546
  return this.typeInfo.name;
3547
3547
  }
3548
3548
  }
3549
- class EB extends uA {
3549
+ class EB extends MA {
3550
3550
  constructor() {
3551
- super(new dA("void", null), null);
3551
+ super(new kA("void", null), null);
3552
3552
  }
3553
3553
  clone() {
3554
3554
  return this;
@@ -3558,7 +3558,7 @@ class EB extends uA {
3558
3558
  }
3559
3559
  }
3560
3560
  EB.void = new EB();
3561
- class sI extends uA {
3561
+ class oI extends MA {
3562
3562
  constructor(A) {
3563
3563
  super(new CB("pointer", A.typeInfo, null), null), this.reference = A;
3564
3564
  }
@@ -3575,7 +3575,7 @@ class sI extends uA {
3575
3575
  return `&${this.reference.toString()}`;
3576
3576
  }
3577
3577
  }
3578
- class c extends uA {
3578
+ class c extends MA {
3579
3579
  constructor(A, I, g = null) {
3580
3580
  super(I, g), A instanceof Int32Array || A instanceof Uint32Array || A instanceof Float32Array ? this.data = A : this.typeInfo.name === "x32" ? A - Math.floor(A) !== 0 ? this.data = new Float32Array([A]) : this.data = A >= 0 ? new Uint32Array([A]) : new Int32Array([A]) : this.typeInfo.name === "i32" || this.typeInfo.name === "bool" ? this.data = new Int32Array([A]) : this.typeInfo.name === "u32" ? this.data = new Uint32Array([A]) : this.typeInfo.name === "f32" || this.typeInfo.name === "f16" ? this.data = new Float32Array([A]) : console.error("ScalarData2: Invalid type", I);
3581
3581
  }
@@ -3608,7 +3608,7 @@ function Xi(C, A, I) {
3608
3608
  const g = A.length;
3609
3609
  return g === 2 ? I === "f32" ? new r(new Float32Array(A), C.getTypeInfo("vec2f")) : I === "i32" || I === "bool" ? new r(new Int32Array(A), C.getTypeInfo("vec2i")) : I === "u32" ? new r(new Uint32Array(A), C.getTypeInfo("vec2u")) : I === "f16" ? new r(new Float32Array(A), C.getTypeInfo("vec2h")) : (console.error(`getSubData: Unknown format ${I}`), null) : g === 3 ? I === "f32" ? new r(new Float32Array(A), C.getTypeInfo("vec3f")) : I === "i32" || I === "bool" ? new r(new Int32Array(A), C.getTypeInfo("vec3i")) : I === "u32" ? new r(new Uint32Array(A), C.getTypeInfo("vec3u")) : I === "f16" ? new r(new Float32Array(A), C.getTypeInfo("vec3h")) : (console.error(`getSubData: Unknown format ${I}`), null) : g === 4 ? I === "f32" ? new r(new Float32Array(A), C.getTypeInfo("vec4f")) : I === "i32" || I === "bool" ? new r(new Int32Array(A), C.getTypeInfo("vec4i")) : I === "u32" ? new r(new Uint32Array(A), C.getTypeInfo("vec4u")) : I === "f16" ? new r(new Float32Array(A), C.getTypeInfo("vec4h")) : (console.error(`getSubData: Unknown format ${I}`), null) : (console.error(`getSubData: Invalid vector size ${A.length}`), null);
3610
3610
  }
3611
- class r extends uA {
3611
+ class r extends MA {
3612
3612
  constructor(A, I, g = null) {
3613
3613
  if (super(I, g), A instanceof Float32Array || A instanceof Uint32Array || A instanceof Int32Array) this.data = A;
3614
3614
  else {
@@ -3623,12 +3623,12 @@ class r extends uA {
3623
3623
  throw new Error("VectorData: Invalid data type");
3624
3624
  }
3625
3625
  setDataValue(A, I, g, B) {
3626
- g instanceof CI ? console.error("TODO: Set vector postfix") : I instanceof r ? this.data = I.data : console.error("SetDataValue: Invalid value", I);
3626
+ g instanceof BI ? console.error("TODO: Set vector postfix") : I instanceof r ? this.data = I.data : console.error("SetDataValue: Invalid value", I);
3627
3627
  }
3628
3628
  getSubData(A, I, g) {
3629
3629
  if (I === null) return this;
3630
3630
  let B = A.getTypeInfo("f32");
3631
- if (this.typeInfo instanceof BI) B = this.typeInfo.format || B;
3631
+ if (this.typeInfo instanceof gI) B = this.typeInfo.format || B;
3632
3632
  else {
3633
3633
  const E = this.typeInfo.name;
3634
3634
  E === "vec2f" || E === "vec3f" || E === "vec4f" ? B = A.getTypeInfo("f32") : E === "vec2i" || E === "vec3i" || E === "vec4i" ? B = A.getTypeInfo("i32") : E === "vec2b" || E === "vec3b" || E === "vec4b" ? B = A.getTypeInfo("bool") : E === "vec2u" || E === "vec3u" || E === "vec4u" ? B = A.getTypeInfo("u32") : E === "vec2h" || E === "vec3h" || E === "vec4h" ? B = A.getTypeInfo("f16") : console.error(`GetSubData: Unknown type ${E}`);
@@ -3661,7 +3661,7 @@ class r extends uA {
3661
3661
  }
3662
3662
  throw new Error("GetSubData: Invalid data type");
3663
3663
  }
3664
- if (!(I instanceof CI)) return console.error("GetSubData: Unknown postfix", I), null;
3664
+ if (!(I instanceof BI)) return console.error("GetSubData: Unknown postfix", I), null;
3665
3665
  {
3666
3666
  const E = I.value.toLowerCase();
3667
3667
  if (E.length === 1) {
@@ -3700,7 +3700,7 @@ class r extends uA {
3700
3700
  return A;
3701
3701
  }
3702
3702
  }
3703
- class p extends uA {
3703
+ class p extends MA {
3704
3704
  constructor(A, I, g = null) {
3705
3705
  super(I, g), A instanceof Float32Array ? this.data = A : this.data = new Float32Array(A);
3706
3706
  }
@@ -3708,12 +3708,12 @@ class p extends uA {
3708
3708
  return new p(new Float32Array(this.data), this.typeInfo, null);
3709
3709
  }
3710
3710
  setDataValue(A, I, g, B) {
3711
- g instanceof CI ? console.error("TODO: Set matrix postfix") : I instanceof p ? this.data = I.data : console.error("SetDataValue: Invalid value", I);
3711
+ g instanceof BI ? console.error("TODO: Set matrix postfix") : I instanceof p ? this.data = I.data : console.error("SetDataValue: Invalid value", I);
3712
3712
  }
3713
3713
  getSubData(A, I, g) {
3714
3714
  if (I === null) return this;
3715
3715
  const B = this.typeInfo.name;
3716
- if (A.getTypeInfo("f32"), this.typeInfo instanceof BI) this.typeInfo.format;
3716
+ if (A.getTypeInfo("f32"), this.typeInfo instanceof gI) this.typeInfo.format;
3717
3717
  else if (B.endsWith("f")) A.getTypeInfo("f32");
3718
3718
  else if (B.endsWith("i")) A.getTypeInfo("i32");
3719
3719
  else if (B.endsWith("u")) A.getTypeInfo("u32");
@@ -3751,19 +3751,19 @@ class p extends uA {
3751
3751
  return A;
3752
3752
  }
3753
3753
  }
3754
- class QA extends uA {
3754
+ class CA extends MA {
3755
3755
  constructor(A, I, g = 0, B = null) {
3756
3756
  super(I, B), this.buffer = A instanceof ArrayBuffer ? A : A.buffer, this.offset = g;
3757
3757
  }
3758
3758
  clone() {
3759
3759
  const A = new Uint8Array(new Uint8Array(this.buffer, this.offset, this.typeInfo.size));
3760
- return new QA(A.buffer, this.typeInfo, 0, null);
3760
+ return new CA(A.buffer, this.typeInfo, 0, null);
3761
3761
  }
3762
3762
  setDataValue(A, I, g, B) {
3763
3763
  if (I === null) return void console.log("setDataValue: NULL data.");
3764
3764
  let Q = this.offset, E = this.typeInfo;
3765
3765
  for (; g; ) {
3766
- if (g instanceof hI) if (E instanceof XA) {
3766
+ if (g instanceof hI) if (E instanceof _A) {
3767
3767
  const i = g.index;
3768
3768
  if (i instanceof rA) {
3769
3769
  if (!(i.value instanceof c)) return void console.error(`SetDataValue: Invalid index type ${i.value}`);
@@ -3776,7 +3776,7 @@ class QA extends uA {
3776
3776
  E = E.format;
3777
3777
  } else console.error(`SetDataValue: Type ${E.getTypeName()} is not an array`);
3778
3778
  else {
3779
- if (!(g instanceof CI)) return void console.error("SetDataValue: Unknown postfix type", g);
3779
+ if (!(g instanceof BI)) return void console.error("SetDataValue: Unknown postfix type", g);
3780
3780
  {
3781
3781
  const i = g.value;
3782
3782
  if (E instanceof PA) {
@@ -3786,7 +3786,7 @@ class QA extends uA {
3786
3786
  break;
3787
3787
  }
3788
3788
  if (!o) return void console.error(`SetDataValue: Member ${i} not found`);
3789
- } else if (E instanceof dA) {
3789
+ } else if (E instanceof kA) {
3790
3790
  const o = E.getTypeName();
3791
3791
  let s = 0;
3792
3792
  if (i === "x" || i === "r") s = 0;
@@ -3893,7 +3893,7 @@ class QA extends uA {
3893
3893
  const i = new Float32Array(this.buffer, B, 16);
3894
3894
  return void (I instanceof p ? (i[0] = I.data[0], i[1] = I.data[1], i[2] = I.data[2], i[3] = I.data[3], i[4] = I.data[4], i[5] = I.data[5], i[6] = I.data[6], i[7] = I.data[7], i[8] = I.data[8], i[9] = I.data[9], i[10] = I.data[10], i[11] = I.data[11], i[12] = I.data[12], i[13] = I.data[13], i[14] = I.data[14], i[15] = I.data[15]) : (i[0] = I[0], i[1] = I[1], i[2] = I[2], i[3] = I[3], i[4] = I[4], i[5] = I[5], i[6] = I[6], i[7] = I[7], i[8] = I[8], i[9] = I[9], i[10] = I[10], i[11] = I[11], i[12] = I[12], i[13] = I[13], i[14] = I[14], i[15] = I[15]));
3895
3895
  }
3896
- if (I instanceof QA) {
3896
+ if (I instanceof CA) {
3897
3897
  if (g === I.typeInfo)
3898
3898
  return void new Uint8Array(this.buffer, B, I.buffer.byteLength).set(new Uint8Array(I.buffer));
3899
3899
  console.error("SetDataValue: Type mismatch", E, I.typeInfo.getTypeName());
@@ -3909,15 +3909,15 @@ class QA extends uA {
3909
3909
  let i = this.offset, o = this.typeInfo;
3910
3910
  for (; I; ) {
3911
3911
  if (I instanceof hI) {
3912
- const t = I.index, a = t instanceof fA ? A.evalExpression(t, g) : t;
3912
+ const t = I.index, a = t instanceof YA ? A.evalExpression(t, g) : t;
3913
3913
  let n = 0;
3914
- if (a instanceof c ? n = a.value : typeof a == "number" ? n = a : console.error("GetDataValue: Invalid index type", t), o instanceof XA) i += n * o.stride, o = o.format;
3914
+ if (a instanceof c ? n = a.value : typeof a == "number" ? n = a : console.error("GetDataValue: Invalid index type", t), o instanceof _A) i += n * o.stride, o = o.format;
3915
3915
  else {
3916
3916
  const D = o.getTypeName();
3917
3917
  D === "mat4x4" || D === "mat4x4f" || D === "mat4x4h" ? (i += 16 * n, o = A.getTypeInfo("vec4f")) : D === "mat4x3" || D === "mat4x3f" || D === "mat4x3h" ? (i += 12 * n, o = A.getTypeInfo("vec3f")) : D === "mat4x2" || D === "mat4x2f" || D === "mat4x2h" ? (i += 8 * n, o = A.getTypeInfo("vec2f")) : D === "mat3x4" || D === "mat3x4f" || D === "mat3x4h" ? (i += 12 * n, o = A.getTypeInfo("vec4f")) : D === "mat3x3" || D === "mat3x3f" || D === "mat3x3h" ? (i += 9 * n, o = A.getTypeInfo("vec3f")) : D === "mat3x2" || D === "mat3x2f" || D === "mat3x2h" ? (i += 6 * n, o = A.getTypeInfo("vec2f")) : D === "mat2x4" || D === "mat2x4f" || D === "mat2x4h" ? (i += 8 * n, o = A.getTypeInfo("vec4f")) : D === "mat2x3" || D === "mat2x3f" || D === "mat2x3h" ? (i += 6 * n, o = A.getTypeInfo("vec3f")) : D === "mat2x2" || D === "mat2x2f" || D === "mat2x2h" ? (i += 4 * n, o = A.getTypeInfo("vec2f")) : D === "vec2f" || D === "vec3f" || D === "vec4f" ? (i += 4 * n, o = A.getTypeInfo("f32")) : D === "vec2h" || D === "vec3h" || D === "vec4h" ? (i += 2 * n, o = A.getTypeInfo("f16")) : D === "vec2b" || D === "vec3b" || D === "vec4b" ? (i += 1 * n, o = A.getTypeInfo("bool")) : D === "vec2i" || D === "vec3i" || D === "vec4i" ? (i += 4 * n, o = A.getTypeInfo("i32")) : D === "vec2u" || D === "vec3u" || D === "vec4u" ? (i += 4 * n, o = A.getTypeInfo("u32")) : console.error(`getDataValue: Type ${o.getTypeName()} is not an array`);
3918
3918
  }
3919
3919
  } else {
3920
- if (!(I instanceof CI)) return console.error("GetDataValue: Unknown postfix type", I), null;
3920
+ if (!(I instanceof BI)) return console.error("GetDataValue: Unknown postfix type", I), null;
3921
3921
  {
3922
3922
  const t = I.value;
3923
3923
  if (o instanceof PA) {
@@ -3927,7 +3927,7 @@ class QA extends uA {
3927
3927
  break;
3928
3928
  }
3929
3929
  if (!a) return console.error(`GetDataValue: Member ${t} not found`), null;
3930
- } else if (o instanceof dA) {
3930
+ } else if (o instanceof kA) {
3931
3931
  const a = o.getTypeName();
3932
3932
  if (a === "vec2f" || a === "vec3f" || a === "vec4f" || a === "vec2i" || a === "vec3i" || a === "vec4i" || a === "vec2u" || a === "vec3u" || a === "vec4u" || a === "vec2b" || a === "vec3b" || a === "vec4b" || a === "vec2h" || a === "vec3h" || a === "vec4h" || a === "vec2" || a === "vec3" || a === "vec4") {
3933
3933
  if (t.length > 0 && t.length < 5) {
@@ -3953,16 +3953,16 @@ class QA extends uA {
3953
3953
  if (a === "vec2f") D.push(new Float32Array(this.buffer, i, 2)[S]);
3954
3954
  else if (a === "vec3f") {
3955
3955
  if (i + 12 >= this.buffer.byteLength) return console.log("Insufficient buffer data"), null;
3956
- const d = new Float32Array(this.buffer, i, 3);
3957
- D.push(d[S]);
3956
+ const l = new Float32Array(this.buffer, i, 3);
3957
+ D.push(l[S]);
3958
3958
  } else if (a === "vec4f") D.push(new Float32Array(this.buffer, i, 4)[S]);
3959
3959
  else if (a === "vec2i") n = "i", D.push(new Int32Array(this.buffer, i, 2)[S]);
3960
3960
  else if (a === "vec3i") n = "i", D.push(new Int32Array(this.buffer, i, 3)[S]);
3961
3961
  else if (a === "vec4i") n = "i", D.push(new Int32Array(this.buffer, i, 4)[S]);
3962
3962
  else if (a === "vec2u") {
3963
3963
  n = "u";
3964
- const d = new Uint32Array(this.buffer, i, 2);
3965
- D.push(d[S]);
3964
+ const l = new Uint32Array(this.buffer, i, 2);
3965
+ D.push(l[S]);
3966
3966
  } else a === "vec3u" ? (n = "u", D.push(new Uint32Array(this.buffer, i, 3)[S])) : a === "vec4u" && (n = "u", D.push(new Uint32Array(this.buffer, i, 4)[S]));
3967
3967
  }
3968
3968
  return D.length === 2 ? o = A.getTypeInfo(`vec2${n}`) : D.length === 3 ? o = A.getTypeInfo(`vec3${n}`) : D.length === 4 ? o = A.getTypeInfo(`vec4${n}`) : console.error(`GetDataValue: Invalid vector length ${D.length}`), new r(D, o, null);
@@ -3976,7 +3976,7 @@ class QA extends uA {
3976
3976
  I = I.postfix;
3977
3977
  }
3978
3978
  const s = o.getTypeName();
3979
- return s === "f32" ? new c(new Float32Array(this.buffer, i, 1), o, this) : s === "i32" ? new c(new Int32Array(this.buffer, i, 1), o, this) : s === "u32" ? new c(new Uint32Array(this.buffer, i, 1), o, this) : s === "vec2f" ? new r(new Float32Array(this.buffer, i, 2), o, this) : s === "vec3f" ? new r(new Float32Array(this.buffer, i, 3), o, this) : s === "vec4f" ? new r(new Float32Array(this.buffer, i, 4), o, this) : s === "vec2i" ? new r(new Int32Array(this.buffer, i, 2), o, this) : s === "vec3i" ? new r(new Int32Array(this.buffer, i, 3), o, this) : s === "vec4i" ? new r(new Int32Array(this.buffer, i, 4), o, this) : s === "vec2u" ? new r(new Uint32Array(this.buffer, i, 2), o, this) : s === "vec3u" ? new r(new Uint32Array(this.buffer, i, 3), o, this) : s === "vec4u" ? new r(new Uint32Array(this.buffer, i, 4), o, this) : o instanceof BI && o.name === "atomic" ? ((B = o.format) === null || B === void 0 ? void 0 : B.name) === "u32" ? new c(new Uint32Array(this.buffer, i, 1)[0], o.format, this) : ((Q = o.format) === null || Q === void 0 ? void 0 : Q.name) === "i32" ? new c(new Int32Array(this.buffer, i, 1)[0], o.format, this) : (console.error(`GetDataValue: Invalid atomic format ${(E = o.format) === null || E === void 0 ? void 0 : E.name}`), null) : new QA(this.buffer, o, i, this);
3979
+ return s === "f32" ? new c(new Float32Array(this.buffer, i, 1), o, this) : s === "i32" ? new c(new Int32Array(this.buffer, i, 1), o, this) : s === "u32" ? new c(new Uint32Array(this.buffer, i, 1), o, this) : s === "vec2f" ? new r(new Float32Array(this.buffer, i, 2), o, this) : s === "vec3f" ? new r(new Float32Array(this.buffer, i, 3), o, this) : s === "vec4f" ? new r(new Float32Array(this.buffer, i, 4), o, this) : s === "vec2i" ? new r(new Int32Array(this.buffer, i, 2), o, this) : s === "vec3i" ? new r(new Int32Array(this.buffer, i, 3), o, this) : s === "vec4i" ? new r(new Int32Array(this.buffer, i, 4), o, this) : s === "vec2u" ? new r(new Uint32Array(this.buffer, i, 2), o, this) : s === "vec3u" ? new r(new Uint32Array(this.buffer, i, 3), o, this) : s === "vec4u" ? new r(new Uint32Array(this.buffer, i, 4), o, this) : o instanceof gI && o.name === "atomic" ? ((B = o.format) === null || B === void 0 ? void 0 : B.name) === "u32" ? new c(new Uint32Array(this.buffer, i, 1)[0], o.format, this) : ((Q = o.format) === null || Q === void 0 ? void 0 : Q.name) === "i32" ? new c(new Int32Array(this.buffer, i, 1)[0], o.format, this) : (console.error(`GetDataValue: Invalid atomic format ${(E = o.format) === null || E === void 0 ? void 0 : E.name}`), null) : new CA(this.buffer, o, i, this);
3980
3980
  }
3981
3981
  toArray() {
3982
3982
  const A = this.typeInfo.getTypeName();
@@ -3984,7 +3984,7 @@ class QA extends uA {
3984
3984
  }
3985
3985
  toString() {
3986
3986
  let A = "";
3987
- if (this.typeInfo instanceof XA) if (this.typeInfo.format.name === "f32") {
3987
+ if (this.typeInfo instanceof _A) if (this.typeInfo.format.name === "f32") {
3988
3988
  const I = new Float32Array(this.buffer, this.offset);
3989
3989
  A = `[${I[0]}`;
3990
3990
  for (let g = 1; g < I.length; ++g) A += `, ${I[g]}`;
@@ -4013,7 +4013,7 @@ class QA extends uA {
4013
4013
  return A;
4014
4014
  }
4015
4015
  }
4016
- class xA extends uA {
4016
+ class xA extends MA {
4017
4017
  constructor(A, I, g, B) {
4018
4018
  super(I, null), this.data = A, this.descriptor = g, this.view = B;
4019
4019
  }
@@ -4080,9 +4080,9 @@ class xA extends uA {
4080
4080
  }
4081
4081
  setPixel(A, I, g, B, Q) {
4082
4082
  const E = this.texelByteSize, i = this.bytesPerRow, o = this.height, s = this.data[B];
4083
- (function(t, a, n, D, F, U, S, d, K, k) {
4084
- const R = D * (S >>= F) * (U >>= F) + n * S + a * d;
4085
- switch (K) {
4083
+ (function(t, a, n, D, F, U, S, l, u, k) {
4084
+ const R = D * (S >>= F) * (U >>= F) + n * S + a * l;
4085
+ switch (u) {
4086
4086
  case "r8unorm":
4087
4087
  return void _(t, R, "8unorm", 1, k);
4088
4088
  case "r8snorm":
@@ -4592,7 +4592,7 @@ class qA {
4592
4592
  return this._types.set(A, Q), this._updateTypeInfo(Q), Q;
4593
4593
  }
4594
4594
  if (A instanceof uI) {
4595
- const B = A, Q = B.format ? this.getTypeInfo(B.format, B.attributes) : null, E = new XA(B.name, I);
4595
+ const B = A, Q = B.format ? this.getTypeInfo(B.format, B.attributes) : null, E = new _A(B.name, I);
4596
4596
  return E.format = Q, E.count = B.count, this._types.set(A, E), this._updateTypeInfo(E), E;
4597
4597
  }
4598
4598
  if (A instanceof mA) {
@@ -4605,20 +4605,20 @@ class qA {
4605
4605
  return this._types.set(A, Q), this._updateTypeInfo(Q), Q;
4606
4606
  }
4607
4607
  if (A instanceof JI) {
4608
- const B = A, Q = B.format instanceof N, E = B.format ? Q ? this.getTypeInfo(B.format, null) : new dA(B.format, null) : null, i = new BI(B.name, E, I, B.access);
4608
+ const B = A, Q = B.format instanceof N, E = B.format ? Q ? this.getTypeInfo(B.format, null) : new kA(B.format, null) : null, i = new gI(B.name, E, I, B.access);
4609
4609
  return this._types.set(A, i), this._updateTypeInfo(i), i;
4610
4610
  }
4611
4611
  if (A instanceof w) {
4612
- const B = A, Q = B.format ? this.getTypeInfo(B.format, null) : null, E = new BI(B.name, Q, I, B.access);
4612
+ const B = A, Q = B.format ? this.getTypeInfo(B.format, null) : null, E = new gI(B.name, Q, I, B.access);
4613
4613
  return this._types.set(A, E), this._updateTypeInfo(E), E;
4614
4614
  }
4615
- const g = new dA(A.name, I);
4615
+ const g = new kA(A.name, I);
4616
4616
  return this._types.set(A, g), this._updateTypeInfo(g), g;
4617
4617
  }
4618
4618
  _updateTypeInfo(A) {
4619
4619
  var I, g, B;
4620
4620
  const Q = this._getTypeSize(A);
4621
- if (A.size = (I = Q?.size) !== null && I !== void 0 ? I : 0, A instanceof XA && A.format) {
4621
+ if (A.size = (I = Q?.size) !== null && I !== void 0 ? I : 0, A instanceof _A && A.format) {
4622
4622
  const E = this._getTypeSize(A.format);
4623
4623
  A.stride = Math.max((g = E?.size) !== null && g !== void 0 ? g : 0, (B = E?.align) !== null && B !== void 0 ? B : 0), this._updateTypeInfo(A.format);
4624
4624
  }
@@ -4640,7 +4640,7 @@ class qA {
4640
4640
  var I, g;
4641
4641
  if (A == null) return null;
4642
4642
  const B = this._getAttributeNum(A.attributes, "size", 0), Q = this._getAttributeNum(A.attributes, "align", 0);
4643
- if (A instanceof hC && (A = A.type), A instanceof dA) {
4643
+ if (A instanceof hC && (A = A.type), A instanceof kA) {
4644
4644
  const E = this._getAlias(A.name);
4645
4645
  E !== null && (A = E);
4646
4646
  }
@@ -4658,7 +4658,7 @@ class qA {
4658
4658
  return new XI(Math.max(Q, E.align / i), Math.max(B, E.size / i));
4659
4659
  }
4660
4660
  }
4661
- if (A instanceof XA) {
4661
+ if (A instanceof _A) {
4662
4662
  let E = A, i = 8, o = 8;
4663
4663
  const s = this._getTypeSize(E.format);
4664
4664
  return s !== null && (o = s.size, i = s.align), o = E.count * this._getAttributeNum((g = A?.attributes) !== null && g !== void 0 ? g : null, "stride", this._roundUp(i, o)), B && (o = B), new XI(Math.max(Q, i), Math.max(B, o));
@@ -4796,7 +4796,7 @@ class Qo {
4796
4796
  let g = A.args[0];
4797
4797
  g instanceof tA && (g = g.right);
4798
4798
  const B = this.exec.evalExpression(g, I);
4799
- if (B instanceof QA && B.typeInfo.size === 0) {
4799
+ if (B instanceof CA && B.typeInfo.size === 0) {
4800
4800
  const Q = B.typeInfo, E = B.buffer.byteLength / Q.stride;
4801
4801
  return new c(E, this.getTypeInfo("u32"));
4802
4802
  }
@@ -5388,7 +5388,7 @@ class Qo {
5388
5388
  const B = this.exec.getVariableName(g, I), Q = I.getVariable(B);
5389
5389
  let E = A.args[1];
5390
5390
  const i = this.exec.evalExpression(E, I), o = Q.value.getSubData(this.exec, g.postfix, I);
5391
- return o instanceof c && i instanceof c && (o.value = i.value), Q.value instanceof QA && Q.value.setDataValue(this.exec, o, g.postfix, I), null;
5391
+ return o instanceof c && i instanceof c && (o.value = i.value), Q.value instanceof CA && Q.value.setDataValue(this.exec, o, g.postfix, I), null;
5392
5392
  }
5393
5393
  AtomicAdd(A, I) {
5394
5394
  let g = A.args[0];
@@ -5396,7 +5396,7 @@ class Qo {
5396
5396
  const B = this.exec.getVariableName(g, I), Q = I.getVariable(B);
5397
5397
  let E = A.args[1];
5398
5398
  const i = this.exec.evalExpression(E, I), o = Q.value.getSubData(this.exec, g.postfix, I), s = new c(o.value, o.typeInfo);
5399
- return o instanceof c && i instanceof c && (o.value += i.value), Q.value instanceof QA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
5399
+ return o instanceof c && i instanceof c && (o.value += i.value), Q.value instanceof CA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
5400
5400
  }
5401
5401
  AtomicSub(A, I) {
5402
5402
  let g = A.args[0];
@@ -5404,7 +5404,7 @@ class Qo {
5404
5404
  const B = this.exec.getVariableName(g, I), Q = I.getVariable(B);
5405
5405
  let E = A.args[1];
5406
5406
  const i = this.exec.evalExpression(E, I), o = Q.value.getSubData(this.exec, g.postfix, I), s = new c(o.value, o.typeInfo);
5407
- return o instanceof c && i instanceof c && (o.value -= i.value), Q.value instanceof QA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
5407
+ return o instanceof c && i instanceof c && (o.value -= i.value), Q.value instanceof CA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
5408
5408
  }
5409
5409
  AtomicMax(A, I) {
5410
5410
  let g = A.args[0];
@@ -5412,7 +5412,7 @@ class Qo {
5412
5412
  const B = this.exec.getVariableName(g, I), Q = I.getVariable(B);
5413
5413
  let E = A.args[1];
5414
5414
  const i = this.exec.evalExpression(E, I), o = Q.value.getSubData(this.exec, g.postfix, I), s = new c(o.value, o.typeInfo);
5415
- return o instanceof c && i instanceof c && (o.value = Math.max(o.value, i.value)), Q.value instanceof QA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
5415
+ return o instanceof c && i instanceof c && (o.value = Math.max(o.value, i.value)), Q.value instanceof CA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
5416
5416
  }
5417
5417
  AtomicMin(A, I) {
5418
5418
  let g = A.args[0];
@@ -5420,7 +5420,7 @@ class Qo {
5420
5420
  const B = this.exec.getVariableName(g, I), Q = I.getVariable(B);
5421
5421
  let E = A.args[1];
5422
5422
  const i = this.exec.evalExpression(E, I), o = Q.value.getSubData(this.exec, g.postfix, I), s = new c(o.value, o.typeInfo);
5423
- return o instanceof c && i instanceof c && (o.value = Math.min(o.value, i.value)), Q.value instanceof QA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
5423
+ return o instanceof c && i instanceof c && (o.value = Math.min(o.value, i.value)), Q.value instanceof CA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
5424
5424
  }
5425
5425
  AtomicAnd(A, I) {
5426
5426
  let g = A.args[0];
@@ -5428,7 +5428,7 @@ class Qo {
5428
5428
  const B = this.exec.getVariableName(g, I), Q = I.getVariable(B);
5429
5429
  let E = A.args[1];
5430
5430
  const i = this.exec.evalExpression(E, I), o = Q.value.getSubData(this.exec, g.postfix, I), s = new c(o.value, o.typeInfo);
5431
- return o instanceof c && i instanceof c && (o.value = o.value & i.value), Q.value instanceof QA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
5431
+ return o instanceof c && i instanceof c && (o.value = o.value & i.value), Q.value instanceof CA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
5432
5432
  }
5433
5433
  AtomicOr(A, I) {
5434
5434
  let g = A.args[0];
@@ -5436,7 +5436,7 @@ class Qo {
5436
5436
  const B = this.exec.getVariableName(g, I), Q = I.getVariable(B);
5437
5437
  let E = A.args[1];
5438
5438
  const i = this.exec.evalExpression(E, I), o = Q.value.getSubData(this.exec, g.postfix, I), s = new c(o.value, o.typeInfo);
5439
- return o instanceof c && i instanceof c && (o.value = o.value | i.value), Q.value instanceof QA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
5439
+ return o instanceof c && i instanceof c && (o.value = o.value | i.value), Q.value instanceof CA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
5440
5440
  }
5441
5441
  AtomicXor(A, I) {
5442
5442
  let g = A.args[0];
@@ -5444,7 +5444,7 @@ class Qo {
5444
5444
  const B = this.exec.getVariableName(g, I), Q = I.getVariable(B);
5445
5445
  let E = A.args[1];
5446
5446
  const i = this.exec.evalExpression(E, I), o = Q.value.getSubData(this.exec, g.postfix, I), s = new c(o.value, o.typeInfo);
5447
- return o instanceof c && i instanceof c && (o.value = o.value ^ i.value), Q.value instanceof QA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
5447
+ return o instanceof c && i instanceof c && (o.value = o.value ^ i.value), Q.value instanceof CA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
5448
5448
  }
5449
5449
  AtomicExchange(A, I) {
5450
5450
  let g = A.args[0];
@@ -5452,7 +5452,7 @@ class Qo {
5452
5452
  const B = this.exec.getVariableName(g, I), Q = I.getVariable(B);
5453
5453
  let E = A.args[1];
5454
5454
  const i = this.exec.evalExpression(E, I), o = Q.value.getSubData(this.exec, g.postfix, I), s = new c(o.value, o.typeInfo);
5455
- return o instanceof c && i instanceof c && (o.value = i.value), Q.value instanceof QA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
5455
+ return o instanceof c && i instanceof c && (o.value = i.value), Q.value instanceof CA && Q.value.setDataValue(this.exec, o, g.postfix, I), s;
5456
5456
  }
5457
5457
  AtomicCompareExchangeWeak(A, I) {
5458
5458
  return console.error("TODO: atomicCompareExchangeWeak"), null;
@@ -5594,7 +5594,7 @@ class Qo {
5594
5594
  }
5595
5595
  }
5596
5596
  const mg = { vec2: 2, vec2f: 2, vec2i: 2, vec2u: 2, vec2b: 2, vec2h: 2, vec3: 3, vec3f: 3, vec3i: 3, vec3u: 3, vec3b: 3, vec3h: 3, vec4: 4, vec4f: 4, vec4i: 4, vec4u: 4, vec4b: 4, vec4h: 4 }, cA = { mat2x2: [2, 2, 4], mat2x2f: [2, 2, 4], mat2x2h: [2, 2, 4], mat2x3: [2, 3, 6], mat2x3f: [2, 3, 6], mat2x3h: [2, 3, 6], mat2x4: [2, 4, 8], mat2x4f: [2, 4, 8], mat2x4h: [2, 4, 8], mat3x2: [3, 2, 6], mat3x2f: [3, 2, 6], mat3x2h: [3, 2, 6], mat3x3: [3, 3, 9], mat3x3f: [3, 3, 9], mat3x3h: [3, 3, 9], mat3x4: [3, 4, 12], mat3x4f: [3, 4, 12], mat3x4h: [3, 4, 12], mat4x2: [4, 2, 8], mat4x2f: [4, 2, 8], mat4x2h: [4, 2, 8], mat4x3: [4, 3, 12], mat4x3f: [4, 3, 12], mat4x3h: [4, 3, 12], mat4x4: [4, 4, 16], mat4x4f: [4, 4, 16], mat4x4h: [4, 4, 16] };
5597
- class BA extends Co {
5597
+ class gA extends Co {
5598
5598
  constructor(A, I) {
5599
5599
  var g;
5600
5600
  super(), this.ast = A ?? [], this.reflection = new qA(), this.reflection.updateAST(this.ast), this.context = (g = I?.clone()) !== null && g !== void 0 ? g : new KB(), this.builtins = new Qo(this), this.typeInfo = { bool: this.getTypeInfo(N.bool), i32: this.getTypeInfo(N.i32), u32: this.getTypeInfo(N.u32), f32: this.getTypeInfo(N.f32), f16: this.getTypeInfo(N.f16), vec2f: this.getTypeInfo(w.vec2f), vec2u: this.getTypeInfo(w.vec2u), vec2i: this.getTypeInfo(w.vec2i), vec2h: this.getTypeInfo(w.vec2h), vec3f: this.getTypeInfo(w.vec3f), vec3u: this.getTypeInfo(w.vec3u), vec3i: this.getTypeInfo(w.vec3i), vec3h: this.getTypeInfo(w.vec3h), vec4f: this.getTypeInfo(w.vec4f), vec4u: this.getTypeInfo(w.vec4u), vec4i: this.getTypeInfo(w.vec4i), vec4h: this.getTypeInfo(w.vec4h), mat2x2f: this.getTypeInfo(w.mat2x2f), mat2x3f: this.getTypeInfo(w.mat2x3f), mat2x4f: this.getTypeInfo(w.mat2x4f), mat3x2f: this.getTypeInfo(w.mat3x2f), mat3x3f: this.getTypeInfo(w.mat3x3f), mat3x4f: this.getTypeInfo(w.mat3x4f), mat4x2f: this.getTypeInfo(w.mat4x2f), mat4x3f: this.getTypeInfo(w.mat4x3f), mat4x4f: this.getTypeInfo(w.mat4x4f) };
@@ -5605,7 +5605,7 @@ class BA extends Co {
5605
5605
  if (B === null) return null;
5606
5606
  if (B instanceof c) return B.value;
5607
5607
  if (B instanceof r || B instanceof p) return Array.from(B.data);
5608
- if (B instanceof QA && B.typeInfo instanceof XA) {
5608
+ if (B instanceof CA && B.typeInfo instanceof _A) {
5609
5609
  if (B.typeInfo.format.name === "u32") return Array.from(new Uint32Array(B.buffer, B.offset, B.typeInfo.count));
5610
5610
  if (B.typeInfo.format.name === "i32") return Array.from(new Int32Array(B.buffer, B.offset, B.typeInfo.count));
5611
5611
  if (B.typeInfo.format.name === "f32") return Array.from(new Float32Array(B.buffer, B.offset, B.typeInfo.count));
@@ -5633,20 +5633,20 @@ class BA extends Co {
5633
5633
  const F = g[n][D];
5634
5634
  Q.variables.forEach((U) => {
5635
5635
  var S;
5636
- const d = U.node;
5637
- if (d?.attributes) {
5638
- let K = null, k = null;
5639
- for (const R of d.attributes) R.name === "binding" ? K = R.value : R.name === "group" && (k = R.value);
5640
- if (D === K && n === k) {
5636
+ const l = U.node;
5637
+ if (l?.attributes) {
5638
+ let u = null, k = null;
5639
+ for (const R of l.attributes) R.name === "binding" ? u = R.value : R.name === "group" && (k = R.value);
5640
+ if (D === u && n === k) {
5641
5641
  let R = !1;
5642
5642
  for (const L of a.resources) if (L.name === U.name && L.group === parseInt(n) && L.binding === parseInt(D)) {
5643
5643
  R = !0;
5644
5644
  break;
5645
5645
  }
5646
5646
  if (R) if (F.texture !== void 0 && F.descriptor !== void 0) {
5647
- const L = new xA(F.texture, this.getTypeInfo(d.type), F.descriptor, (S = F.texture.view) !== null && S !== void 0 ? S : null);
5647
+ const L = new xA(F.texture, this.getTypeInfo(l.type), F.descriptor, (S = F.texture.view) !== null && S !== void 0 ? S : null);
5648
5648
  U.value = L;
5649
- } else F.uniform !== void 0 ? U.value = new QA(F.uniform, this.getTypeInfo(d.type)) : U.value = new QA(F, this.getTypeInfo(d.type));
5649
+ } else F.uniform !== void 0 ? U.value = new CA(F.uniform, this.getTypeInfo(l.type)) : U.value = new CA(F, this.getTypeInfo(l.type));
5650
5650
  }
5651
5651
  }
5652
5652
  });
@@ -5661,9 +5661,9 @@ class BA extends Co {
5661
5661
  if (!(g instanceof c)) throw new Error("Invalid break-if condition");
5662
5662
  if (!g.value) return null;
5663
5663
  }
5664
- return BA._breakObj;
5664
+ return gA._breakObj;
5665
5665
  }
5666
- if (A instanceof xQ) return BA._continueObj;
5666
+ if (A instanceof xQ) return gA._continueObj;
5667
5667
  if (A instanceof fI) this._let(A, I);
5668
5668
  else if (A instanceof HA) this._var(A, I);
5669
5669
  else if (A instanceof zI) this._const(A, I);
@@ -5693,7 +5693,7 @@ class BA extends Co {
5693
5693
  return null;
5694
5694
  }
5695
5695
  evalExpression(A, I) {
5696
- return A instanceof YA ? this._evalBinaryOp(A, I) : A instanceof rA ? this._evalLiteral(A, I) : A instanceof wA ? this._evalVariable(A, I) : A instanceof YB ? this._evalCall(A, I) : A instanceof KA ? this._evalCreate(A, I) : A instanceof bQ ? this._evalConst(A, I) : A instanceof TQ ? this._evalBitcast(A, I) : A instanceof tA ? this._evalUnaryOp(A, I) : (console.error("Invalid expression type", A, `Line ${A.line}`), null);
5696
+ return A instanceof LA ? this._evalBinaryOp(A, I) : A instanceof rA ? this._evalLiteral(A, I) : A instanceof wA ? this._evalVariable(A, I) : A instanceof YB ? this._evalCall(A, I) : A instanceof KA ? this._evalCreate(A, I) : A instanceof bQ ? this._evalConst(A, I) : A instanceof TQ ? this._evalBitcast(A, I) : A instanceof tA ? this._evalUnaryOp(A, I) : (console.error("Invalid expression type", A, `Line ${A.line}`), null);
5697
5697
  }
5698
5698
  getTypeInfo(A) {
5699
5699
  var I;
@@ -5707,7 +5707,7 @@ class BA extends Co {
5707
5707
  _setOverrides(A, I) {
5708
5708
  for (const g in A) {
5709
5709
  const B = A[g], Q = this.reflection.getOverrideInfo(g);
5710
- Q !== null ? (Q.type === null && (Q.type = this.getTypeInfo("u32")), BA._numericScalarTypes.has(Q.type.name) ? I.setVariable(g, new c(B, Q.type)) : BA._vectorTypes.has(Q.type.name) ? I.setVariable(g, new r(B, Q.type)) : console.error(`Invalid constant type for ${g}`)) : console.error(`Override ${g} does not exist in the shader.`);
5710
+ Q !== null ? (Q.type === null && (Q.type = this.getTypeInfo("u32")), gA._numericScalarTypes.has(Q.type.name) ? I.setVariable(g, new c(B, Q.type)) : gA._vectorTypes.has(Q.type.name) ? I.setVariable(g, new r(B, Q.type)) : console.error(`Invalid constant type for ${g}`)) : console.error(`Override ${g} does not exist in the shader.`);
5711
5711
  }
5712
5712
  }
5713
5713
  _dispatchWorkgroup(A, I, g) {
@@ -5781,11 +5781,11 @@ class BA extends Co {
5781
5781
  if (A instanceof tA) {
5782
5782
  if (A.operator === "*") {
5783
5783
  const g = this._getVariableData(A.right, I);
5784
- return g instanceof sI ? g.reference.getSubData(this, A.postfix, I) : (console.error(`Variable ${A.right} is not a pointer. Line ${A.line}`), null);
5784
+ return g instanceof oI ? g.reference.getSubData(this, A.postfix, I) : (console.error(`Variable ${A.right} is not a pointer. Line ${A.line}`), null);
5785
5785
  }
5786
5786
  if (A.operator === "&") {
5787
5787
  const g = this._getVariableData(A.right, I);
5788
- return new sI(g);
5788
+ return new oI(g);
5789
5789
  }
5790
5790
  }
5791
5791
  return null;
@@ -5798,7 +5798,7 @@ class BA extends Co {
5798
5798
  if (o instanceof c || o instanceof r || o instanceof p) {
5799
5799
  if (s instanceof c || s instanceof r || s instanceof p && o.data.length === s.data.length) return void o.data.set(s.data);
5800
5800
  console.error(`Invalid assignment. Line ${A.line}`);
5801
- } else if (o instanceof QA && s instanceof QA && o.buffer.byteLength - o.offset >= s.buffer.byteLength - s.offset) return void (o.buffer.byteLength % 4 == 0 ? new Uint32Array(o.buffer, o.offset, o.typeInfo.size / 4).set(new Uint32Array(s.buffer, s.offset, s.typeInfo.size / 4)) : new Uint8Array(o.buffer, o.offset, o.typeInfo.size).set(new Uint8Array(s.buffer, s.offset, s.typeInfo.size)));
5801
+ } else if (o instanceof CA && s instanceof CA && o.buffer.byteLength - o.offset >= s.buffer.byteLength - s.offset) return void (o.buffer.byteLength % 4 == 0 ? new Uint32Array(o.buffer, o.offset, o.typeInfo.size / 4).set(new Uint32Array(s.buffer, s.offset, s.typeInfo.size / 4)) : new Uint8Array(o.buffer, o.offset, o.typeInfo.size).set(new Uint8Array(s.buffer, s.offset, s.typeInfo.size)));
5802
5802
  return console.error(`Invalid assignment. Line ${A.line}`), null;
5803
5803
  }
5804
5804
  if (t === "+=") return o instanceof c || o instanceof r || o instanceof p ? s instanceof c || s instanceof r || s instanceof p ? void o.data.set(s.data.map((a, n) => o.data[n] + a)) : void console.error(`Invalid assignment . Line ${A.line}`) : void console.error(`Invalid assignment. Line ${A.line}`);
@@ -5808,7 +5808,7 @@ class BA extends Co {
5808
5808
  if (A.variable.operator === "*") {
5809
5809
  B = this.getVariableName(A.variable.right, I);
5810
5810
  const o = I.getVariable(B);
5811
- if (!(o && o.value instanceof sI)) return void console.error(`Variable ${B} is not a pointer. Line ${A.line}`);
5811
+ if (!(o && o.value instanceof oI)) return void console.error(`Variable ${B} is not a pointer. Line ${A.line}`);
5812
5812
  g = o.value.reference;
5813
5813
  let s = A.variable.postfix;
5814
5814
  if (!s) {
@@ -5829,7 +5829,7 @@ class BA extends Co {
5829
5829
  if (o === null) return void console.error(`Variable ${B} not found. Line ${A.line}`);
5830
5830
  g = o.value;
5831
5831
  }
5832
- if (g instanceof sI && (g = g.reference), g === null) return void console.error(`Variable ${B} not found. Line ${A.line}`);
5832
+ if (g instanceof oI && (g = g.reference), g === null) return void console.error(`Variable ${B} not found. Line ${A.line}`);
5833
5833
  const E = this.evalExpression(A.value, I), i = A.operator;
5834
5834
  if (i !== "=") {
5835
5835
  const o = g.getSubData(this, Q, I);
@@ -5864,9 +5864,9 @@ class BA extends Co {
5864
5864
  if (!(o instanceof c && E instanceof c)) return void console.error(`Invalid type for ${A.operator} operator. Line ${A.line}`);
5865
5865
  i === "+=" ? o.value += E.value : i === "-=" ? o.value -= E.value : i === "*=" ? o.value *= E.value : i === "/=" ? o.value /= E.value : i === "%=" ? o.value %= E.value : i === "&=" ? o.value &= E.value : i === "|=" ? o.value |= E.value : i === "^=" ? o.value ^= E.value : i === "<<=" ? o.value <<= E.value : i === ">>=" ? o.value >>= E.value : console.error(`Invalid operator ${i}. Line ${A.line}`);
5866
5866
  }
5867
- return void (g instanceof QA && g.setDataValue(this, o, Q, I));
5867
+ return void (g instanceof CA && g.setDataValue(this, o, Q, I));
5868
5868
  }
5869
- if (g instanceof QA) g.setDataValue(this, E, Q, I);
5869
+ if (g instanceof CA) g.setDataValue(this, E, Q, I);
5870
5870
  else if (Q) {
5871
5871
  if (!(g instanceof r || g instanceof p)) return void console.error(`Variable ${B} is not a vector or matrix. Line ${A.line}`);
5872
5872
  if (Q instanceof hI) {
@@ -5914,7 +5914,7 @@ class BA extends Co {
5914
5914
  }
5915
5915
  }
5916
5916
  }
5917
- } else if (Q instanceof CI) {
5917
+ } else if (Q instanceof BI) {
5918
5918
  const o = Q.value;
5919
5919
  if (!(g instanceof r)) return void console.error(`Invalid assignment to ${o}. Variable ${B} is not a vector. Line ${A.line}`);
5920
5920
  if (E instanceof c) {
@@ -5974,7 +5974,7 @@ class BA extends Co {
5974
5974
  A.value instanceof tA || (g = g.clone());
5975
5975
  } else {
5976
5976
  const B = A.type.name;
5977
- if (BA._defaultableTypes.has(B)) {
5977
+ if (gA._defaultableTypes.has(B)) {
5978
5978
  const Q = new KA(A.type, []);
5979
5979
  g = this._evalCreate(Q, I);
5980
5980
  }
@@ -5989,7 +5989,7 @@ class BA extends Co {
5989
5989
  } else {
5990
5990
  if (A.type === null) return void console.error(`Variable ${A.name} has no type. Line ${A.line}`);
5991
5991
  const B = A.type.name;
5992
- if (BA._defaultableTypes.has(B) || A.type instanceof uI || A.type instanceof mA || A.type instanceof w) {
5992
+ if (gA._defaultableTypes.has(B) || A.type instanceof uI || A.type instanceof mA || A.type instanceof w) {
5993
5993
  const Q = new KA(A.type, []);
5994
5994
  g = this._evalCreate(Q, I);
5995
5995
  }
@@ -6031,8 +6031,8 @@ class BA extends Co {
6031
6031
  _for(A, I) {
6032
6032
  for (I = I.clone(), this.execStatement(A.init, I); this._getScalarValue(this.evalExpression(A.condition, I)); ) {
6033
6033
  const g = this._execStatements(A.body, I);
6034
- if (g === BA._breakObj) break;
6035
- if (g !== null && g !== BA._continueObj) return g;
6034
+ if (g === gA._breakObj) break;
6035
+ if (g !== null && g !== gA._continueObj) return g;
6036
6036
  this.execStatement(A.increment, I);
6037
6037
  }
6038
6038
  return null;
@@ -6040,9 +6040,9 @@ class BA extends Co {
6040
6040
  _loop(A, I) {
6041
6041
  for (I = I.clone(); ; ) {
6042
6042
  const g = this._execStatements(A.body, I);
6043
- if (g === BA._breakObj) break;
6044
- if (g === BA._continueObj) {
6045
- if (A.continuing && this._execStatements(A.continuing.body, I) === BA._breakObj)
6043
+ if (g === gA._breakObj) break;
6044
+ if (g === gA._continueObj) {
6045
+ if (A.continuing && this._execStatements(A.continuing.body, I) === gA._breakObj)
6046
6046
  break;
6047
6047
  } else if (g !== null) return g;
6048
6048
  }
@@ -6051,8 +6051,8 @@ class BA extends Co {
6051
6051
  _while(A, I) {
6052
6052
  for (I = I.clone(); this._getScalarValue(this.evalExpression(A.condition, I)); ) {
6053
6053
  const g = this._execStatements(A.body, I);
6054
- if (g === BA._breakObj) break;
6055
- if (g !== BA._continueObj && g !== null) return g;
6054
+ if (g === gA._breakObj) break;
6055
+ if (g !== gA._continueObj && g !== null) return g;
6056
6056
  }
6057
6057
  return null;
6058
6058
  }
@@ -6159,13 +6159,13 @@ class BA extends Co {
6159
6159
  const B = A instanceof KA ? A.type.name : A.name, Q = A instanceof KA ? this.getTypeInfo(A.type) : this.getTypeInfo(A.name);
6160
6160
  if (Q === null) return console.error(`Unknown type ${B}. Line ${A.line}`), null;
6161
6161
  if (Q.size === 0) return null;
6162
- const E = new QA(new ArrayBuffer(Q.size), Q, 0);
6162
+ const E = new CA(new ArrayBuffer(Q.size), Q, 0);
6163
6163
  if (Q instanceof PA) {
6164
6164
  if (A.args) for (let i = 0; i < A.args.length; ++i) {
6165
6165
  const o = Q.members[i], s = A.args[i], t = this.evalExpression(s, I);
6166
6166
  E.setData(this, t, o.type, o.offset, I);
6167
6167
  }
6168
- } else if (Q instanceof XA) {
6168
+ } else if (Q instanceof _A) {
6169
6169
  let i = 0;
6170
6170
  if (A.args) for (let o = 0; o < A.args.length; ++o) {
6171
6171
  const s = A.args[o], t = this.evalExpression(s, I);
@@ -6186,15 +6186,15 @@ class BA extends Co {
6186
6186
  let I = A[0];
6187
6187
  if (I.name === "f32") return I;
6188
6188
  for (let g = 1; g < A.length; ++g) {
6189
- const B = BA._priority.get(I.name);
6190
- BA._priority.get(A[g].name) < B && (I = A[g]);
6189
+ const B = gA._priority.get(I.name);
6190
+ gA._priority.get(A[g].name) < B && (I = A[g]);
6191
6191
  }
6192
6192
  return I.name === "x32" ? this.getTypeInfo("i32") : I;
6193
6193
  }
6194
6194
  _evalUnaryOp(A, I) {
6195
6195
  const g = this.evalExpression(A.right, I);
6196
- if (A.operator === "&") return new sI(g);
6197
- if (A.operator === "*") return g instanceof sI ? g.reference.getSubData(this, A.postfix, I) : (console.error(`Invalid dereference. Line ${A.line}`), null);
6196
+ if (A.operator === "&") return new oI(g);
6197
+ if (A.operator === "*") return g instanceof oI ? g.reference.getSubData(this, A.postfix, I) : (console.error(`Invalid dereference. Line ${A.line}`), null);
6198
6198
  const B = g instanceof c ? g.value : g instanceof r ? Array.from(g.data) : null;
6199
6199
  switch (A.operator) {
6200
6200
  case "+": {
@@ -6239,7 +6239,7 @@ class BA extends Co {
6239
6239
  return A.typeInfo.getTypeName().startsWith("vec");
6240
6240
  }
6241
6241
  _evalBinaryOp(A, I) {
6242
- const g = this.evalExpression(A.left, I), B = this.evalExpression(A.right, I), Q = g instanceof c ? g.value : g instanceof r || g instanceof p ? Array.from(g.data) : g instanceof QA ? g.toArray() : null, E = B instanceof c ? B.value : B instanceof r || B instanceof p ? Array.from(B.data) : B instanceof QA ? B.toArray() : null;
6242
+ const g = this.evalExpression(A.left, I), B = this.evalExpression(A.right, I), Q = g instanceof c ? g.value : g instanceof r || g instanceof p ? Array.from(g.data) : g instanceof CA ? g.toArray() : null, E = B instanceof c ? B.value : B instanceof r || B instanceof p ? Array.from(B.data) : B instanceof CA ? B.toArray() : null;
6243
6243
  switch (A.operator) {
6244
6244
  case "+": {
6245
6245
  if (J(Q) && J(E)) {
@@ -6281,15 +6281,15 @@ class BA extends Co {
6281
6281
  if (J(Q) && J(E)) {
6282
6282
  const t = Q, a = E;
6283
6283
  if (this._isMatrixType(g) && this._isMatrixType(B)) {
6284
- const n = (function(S, d, K, k) {
6285
- if (cA[d.name] === void 0 || cA[k.name] === void 0) return null;
6286
- const R = cA[d.name][0], L = cA[d.name][1], M = cA[k.name][0];
6284
+ const n = (function(S, l, u, k) {
6285
+ if (cA[l.name] === void 0 || cA[k.name] === void 0) return null;
6286
+ const R = cA[l.name][0], L = cA[l.name][1], M = cA[k.name][0];
6287
6287
  if (R !== cA[k.name][1]) return null;
6288
6288
  const W = new Array(M * L);
6289
- for (let IA = 0; IA < L; IA++) for (let CA = 0; CA < M; CA++) {
6290
- let $ = 0;
6291
- for (let gA = 0; gA < R; gA++) $ += S[gA * L + IA] * K[CA * R + gA];
6292
- W[IA * M + CA] = $;
6289
+ for (let $ = 0; $ < L; $++) for (let BA = 0; BA < M; BA++) {
6290
+ let IA = 0;
6291
+ for (let iA = 0; iA < R; iA++) IA += S[iA * L + $] * u[BA * R + iA];
6292
+ W[$ * M + BA] = IA;
6293
6293
  }
6294
6294
  return W;
6295
6295
  })(t, g.typeInfo, a, B.typeInfo);
@@ -6300,12 +6300,12 @@ class BA extends Co {
6300
6300
  if (this._isMatrixType(g) && this._isVectorType(B)) {
6301
6301
  const n = (function(D, F, U, S) {
6302
6302
  if (cA[F.name] === void 0 || mg[S.name] === void 0) return null;
6303
- const d = cA[F.name][0], K = cA[F.name][1];
6304
- if (d !== U.length) return null;
6305
- const k = new Array(K);
6306
- for (let R = 0; R < K; R++) {
6303
+ const l = cA[F.name][0], u = cA[F.name][1];
6304
+ if (l !== U.length) return null;
6305
+ const k = new Array(u);
6306
+ for (let R = 0; R < u; R++) {
6307
6307
  let L = 0;
6308
- for (let M = 0; M < d; M++) L += D[M * K + R] * U[M];
6308
+ for (let M = 0; M < l; M++) L += D[M * u + R] * U[M];
6309
6309
  k[R] = L;
6310
6310
  }
6311
6311
  return k;
@@ -6315,12 +6315,12 @@ class BA extends Co {
6315
6315
  if (this._isVectorType(g) && this._isMatrixType(B)) {
6316
6316
  const n = (function(D, F, U, S) {
6317
6317
  if (mg[F.name] === void 0 || cA[S.name] === void 0) return null;
6318
- const d = cA[S.name][0], K = cA[S.name][1];
6319
- if (K !== D.length) return null;
6318
+ const l = cA[S.name][0], u = cA[S.name][1];
6319
+ if (u !== D.length) return null;
6320
6320
  const k = [];
6321
- for (let R = 0; R < d; R++) {
6321
+ for (let R = 0; R < l; R++) {
6322
6322
  let L = 0;
6323
- for (let M = 0; M < K; M++) L += D[M] * U[M * d + R];
6323
+ for (let M = 0; M < u; M++) L += D[M] * U[M * l + R];
6324
6324
  k[R] = L;
6325
6325
  }
6326
6326
  return k;
@@ -6963,14 +6963,14 @@ class BA extends Co {
6963
6963
  const o = this.evalExpression(i, I);
6964
6964
  o instanceof r ? E.push(...o.data) : o instanceof c ? E.push(o.value) : o instanceof p && E.push(...o.data);
6965
6965
  }
6966
- if (g instanceof BI && g.format === null && (g.format = this.getTypeInfo("f32")), E.length === 0) {
6966
+ if (g instanceof gI && g.format === null && (g.format = this.getTypeInfo("f32")), E.length === 0) {
6967
6967
  const i = new Array(Q[2]).fill(0);
6968
6968
  return new p(i, g).getSubData(this, A.postfix, I);
6969
6969
  }
6970
6970
  return E.length !== Q[2] ? (console.error(`Invalid matrix constructor. Line ${A.line}`), null) : new p(E, g).getSubData(this, A.postfix, I);
6971
6971
  }
6972
6972
  }
6973
- BA._numericScalarTypes = /* @__PURE__ */ new Set(["f32", "i32", "u32", "bool", "f16"]), BA._vectorTypes = /* @__PURE__ */ new Set(["vec2", "vec3", "vec4", "vec2f", "vec3f", "vec4f", "vec2i", "vec3i", "vec4i", "vec2u", "vec3u", "vec4u", "vec2h", "vec3h", "vec4h", "vec2b", "vec3b", "vec4b"]), BA._matrixTypes = /* @__PURE__ */ new Set(["mat2x2", "mat2x3", "mat2x4", "mat3x2", "mat3x3", "mat3x4", "mat4x2", "mat4x3", "mat4x4", "mat2x2f", "mat2x3f", "mat2x4f", "mat3x2f", "mat3x3f", "mat3x4f", "mat4x2f", "mat4x3f", "mat4x4f", "mat2x2h", "mat2x3h", "mat2x4h", "mat3x2h", "mat3x3h", "mat3x4h", "mat4x2h", "mat4x3h", "mat4x4h"]), BA._defaultableTypes = /* @__PURE__ */ new Set([...BA._numericScalarTypes, ...BA._vectorTypes, ...BA._matrixTypes, "array"]), BA._breakObj = new NC(new dA("BREAK", null), null), BA._continueObj = new NC(new dA("CONTINUE", null), null), BA._priority = /* @__PURE__ */ new Map([["f32", 0], ["f16", 1], ["u32", 2], ["i32", 3], ["x32", 3]]);
6973
+ gA._numericScalarTypes = /* @__PURE__ */ new Set(["f32", "i32", "u32", "bool", "f16"]), gA._vectorTypes = /* @__PURE__ */ new Set(["vec2", "vec3", "vec4", "vec2f", "vec3f", "vec4f", "vec2i", "vec3i", "vec4i", "vec2u", "vec3u", "vec4u", "vec2h", "vec3h", "vec4h", "vec2b", "vec3b", "vec4b"]), gA._matrixTypes = /* @__PURE__ */ new Set(["mat2x2", "mat2x3", "mat2x4", "mat3x2", "mat3x3", "mat3x4", "mat4x2", "mat4x3", "mat4x4", "mat2x2f", "mat2x3f", "mat2x4f", "mat3x2f", "mat3x3f", "mat3x4f", "mat4x2f", "mat4x3f", "mat4x4f", "mat2x2h", "mat2x3h", "mat2x4h", "mat3x2h", "mat3x3h", "mat3x4h", "mat4x2h", "mat4x3h", "mat4x4h"]), gA._defaultableTypes = /* @__PURE__ */ new Set([...gA._numericScalarTypes, ...gA._vectorTypes, ...gA._matrixTypes, "array"]), gA._breakObj = new NC(new kA("BREAK", null), null), gA._continueObj = new NC(new kA("CONTINUE", null), null), gA._priority = /* @__PURE__ */ new Map([["f32", 0], ["f16", 1], ["u32", 2], ["i32", 3], ["x32", 3]]);
6974
6974
  class Eo {
6975
6975
  constructor() {
6976
6976
  this.constants = /* @__PURE__ */ new Map(), this.aliases = /* @__PURE__ */ new Map(), this.structs = /* @__PURE__ */ new Map();
@@ -6978,7 +6978,7 @@ class Eo {
6978
6978
  }
6979
6979
  class io {
6980
6980
  constructor() {
6981
- this._tokens = [], this._current = 0, this._currentLine = 1, this._deferArrayCountEval = [], this._currentLoop = [], this._context = new Eo(), this._exec = new BA(), this._forwardTypeCount = 0;
6981
+ this._tokens = [], this._current = 0, this._currentLine = 1, this._deferArrayCountEval = [], this._currentLoop = [], this._context = new Eo(), this._exec = new gA(), this._forwardTypeCount = 0;
6982
6982
  }
6983
6983
  parse(A) {
6984
6984
  this._initialize(A), this._deferArrayCountEval.length = 0;
@@ -7254,7 +7254,7 @@ class io {
7254
7254
  if (I === null) return null;
7255
7255
  if (!this._check(e.increment_operators)) return this._current = A, null;
7256
7256
  const g = this._consume(e.increment_operators, "Expected increment operator");
7257
- return this._updateNode(new MQ(g.type === e.tokens.plus_plus ? eI.increment : eI.decrement, I));
7257
+ return this._updateNode(new MQ(g.type === e.tokens.plus_plus ? aI.increment : aI.decrement, I));
7258
7258
  }
7259
7259
  _assignment_statement() {
7260
7260
  let A = null;
@@ -7354,51 +7354,51 @@ class io {
7354
7354
  }
7355
7355
  _short_circuit_or_expression() {
7356
7356
  let A = this._short_circuit_and_expr();
7357
- for (; this._match(e.tokens.or_or); ) A = this._updateNode(new YA(this._previous().toString(), A, this._short_circuit_and_expr()));
7357
+ for (; this._match(e.tokens.or_or); ) A = this._updateNode(new LA(this._previous().toString(), A, this._short_circuit_and_expr()));
7358
7358
  return A;
7359
7359
  }
7360
7360
  _short_circuit_and_expr() {
7361
7361
  let A = this._inclusive_or_expression();
7362
- for (; this._match(e.tokens.and_and); ) A = this._updateNode(new YA(this._previous().toString(), A, this._inclusive_or_expression()));
7362
+ for (; this._match(e.tokens.and_and); ) A = this._updateNode(new LA(this._previous().toString(), A, this._inclusive_or_expression()));
7363
7363
  return A;
7364
7364
  }
7365
7365
  _inclusive_or_expression() {
7366
7366
  let A = this._exclusive_or_expression();
7367
- for (; this._match(e.tokens.or); ) A = this._updateNode(new YA(this._previous().toString(), A, this._exclusive_or_expression()));
7367
+ for (; this._match(e.tokens.or); ) A = this._updateNode(new LA(this._previous().toString(), A, this._exclusive_or_expression()));
7368
7368
  return A;
7369
7369
  }
7370
7370
  _exclusive_or_expression() {
7371
7371
  let A = this._and_expression();
7372
- for (; this._match(e.tokens.xor); ) A = this._updateNode(new YA(this._previous().toString(), A, this._and_expression()));
7372
+ for (; this._match(e.tokens.xor); ) A = this._updateNode(new LA(this._previous().toString(), A, this._and_expression()));
7373
7373
  return A;
7374
7374
  }
7375
7375
  _and_expression() {
7376
7376
  let A = this._equality_expression();
7377
- for (; this._match(e.tokens.and); ) A = this._updateNode(new YA(this._previous().toString(), A, this._equality_expression()));
7377
+ for (; this._match(e.tokens.and); ) A = this._updateNode(new LA(this._previous().toString(), A, this._equality_expression()));
7378
7378
  return A;
7379
7379
  }
7380
7380
  _equality_expression() {
7381
7381
  const A = this._relational_expression();
7382
- return this._match([e.tokens.equal_equal, e.tokens.not_equal]) ? this._updateNode(new YA(this._previous().toString(), A, this._relational_expression())) : A;
7382
+ return this._match([e.tokens.equal_equal, e.tokens.not_equal]) ? this._updateNode(new LA(this._previous().toString(), A, this._relational_expression())) : A;
7383
7383
  }
7384
7384
  _relational_expression() {
7385
7385
  let A = this._shift_expression();
7386
- for (; this._match([e.tokens.less_than, e.tokens.greater_than, e.tokens.less_than_equal, e.tokens.greater_than_equal]); ) A = this._updateNode(new YA(this._previous().toString(), A, this._shift_expression()));
7386
+ for (; this._match([e.tokens.less_than, e.tokens.greater_than, e.tokens.less_than_equal, e.tokens.greater_than_equal]); ) A = this._updateNode(new LA(this._previous().toString(), A, this._shift_expression()));
7387
7387
  return A;
7388
7388
  }
7389
7389
  _shift_expression() {
7390
7390
  let A = this._additive_expression();
7391
- for (; this._match([e.tokens.shift_left, e.tokens.shift_right]); ) A = this._updateNode(new YA(this._previous().toString(), A, this._additive_expression()));
7391
+ for (; this._match([e.tokens.shift_left, e.tokens.shift_right]); ) A = this._updateNode(new LA(this._previous().toString(), A, this._additive_expression()));
7392
7392
  return A;
7393
7393
  }
7394
7394
  _additive_expression() {
7395
7395
  let A = this._multiplicative_expression();
7396
- for (; this._match([e.tokens.plus, e.tokens.minus]); ) A = this._updateNode(new YA(this._previous().toString(), A, this._multiplicative_expression()));
7396
+ for (; this._match([e.tokens.plus, e.tokens.minus]); ) A = this._updateNode(new LA(this._previous().toString(), A, this._multiplicative_expression()));
7397
7397
  return A;
7398
7398
  }
7399
7399
  _multiplicative_expression() {
7400
7400
  let A = this._unary_expression();
7401
- for (; this._match([e.tokens.star, e.tokens.forward_slash, e.tokens.modulo]); ) A = this._updateNode(new YA(this._previous().toString(), A, this._unary_expression()));
7401
+ for (; this._match([e.tokens.star, e.tokens.forward_slash, e.tokens.modulo]); ) A = this._updateNode(new LA(this._previous().toString(), A, this._unary_expression()));
7402
7402
  return A;
7403
7403
  }
7404
7404
  _unary_expression() {
@@ -7416,7 +7416,7 @@ class io {
7416
7416
  return g && (I.postfix = g), I;
7417
7417
  }
7418
7418
  if (this._match(e.tokens.period)) {
7419
- const A = this._consume(e.tokens.name, "Expected member name."), I = this._postfix_expression(), g = this._updateNode(new CI(A.lexeme));
7419
+ const A = this._consume(e.tokens.name, "Expected member name."), I = this._postfix_expression(), g = this._updateNode(new BI(A.lexeme));
7420
7420
  return I && (g.postfix = I), g;
7421
7421
  }
7422
7422
  return null;
@@ -7666,7 +7666,7 @@ class io {
7666
7666
  const E = this._short_circuit_or_expression();
7667
7667
  try {
7668
7668
  let o = [N.f32], s = E.constEvaluate(this._exec, o);
7669
- s instanceof c && this._validateTypeRange(s.value, o[0]), o[0] instanceof w && o[0].format === null && s.typeInfo instanceof BI && s.typeInfo.format !== null && (s.typeInfo.format.name === "f16" ? o[0].format = N.f16 : s.typeInfo.format.name === "f32" ? o[0].format = N.f32 : s.typeInfo.format.name === "i32" ? o[0].format = N.i32 : s.typeInfo.format.name === "u32" ? o[0].format = N.u32 : s.typeInfo.format.name === "bool" ? o[0].format = N.bool : console.error(`TODO: implement template format type ${s.typeInfo.format.name}`)), Q = this._updateNode(new rA(s, o[0])), this._exec.context.setVariable(I.toString(), s);
7669
+ s instanceof c && this._validateTypeRange(s.value, o[0]), o[0] instanceof w && o[0].format === null && s.typeInfo instanceof gI && s.typeInfo.format !== null && (s.typeInfo.format.name === "f16" ? o[0].format = N.f16 : s.typeInfo.format.name === "f32" ? o[0].format = N.f32 : s.typeInfo.format.name === "i32" ? o[0].format = N.i32 : s.typeInfo.format.name === "u32" ? o[0].format = N.u32 : s.typeInfo.format.name === "bool" ? o[0].format = N.bool : console.error(`TODO: implement template format type ${s.typeInfo.format.name}`)), Q = this._updateNode(new rA(s, o[0])), this._exec.context.setVariable(I.toString(), s);
7670
7670
  } catch {
7671
7671
  Q = E;
7672
7672
  }
@@ -7875,7 +7875,7 @@ function ao(C, A) {
7875
7875
  }
7876
7876
  return g.map((Q) => ({ entries: [...Q.values()].sort(to) }));
7877
7877
  }
7878
- function AI(C, A) {
7878
+ function $A(C, A) {
7879
7879
  return Object.fromEntries(A.map((I) => {
7880
7880
  const g = yo(C, I, 0);
7881
7881
  return [
@@ -8011,7 +8011,7 @@ function bg(C, A) {
8011
8011
  return I;
8012
8012
  }
8013
8013
  function ho(C) {
8014
- const A = new oo(C), I = Object.fromEntries(A.structs.map((a) => [a.name, OQ(A, a, 0)])), g = AI(A, A.uniforms), B = AI(A, A.immediates), Q = AI(A, A.storage.filter((a) => a.resourceType === sA.Storage)), E = AI(A, A.storage.filter((a) => a.resourceType === sA.StorageTexture)), i = AI(A, A.textures.filter((a) => a.type.name !== "texture_external")), o = AI(A, A.textures.filter((a) => a.type.name === "texture_external")), s = AI(A, A.samplers), t = {
8014
+ const A = new oo(C), I = Object.fromEntries(A.structs.map((a) => [a.name, OQ(A, a, 0)])), g = $A(A, A.uniforms), B = $A(A, A.immediates), Q = $A(A, A.storage.filter((a) => a.resourceType === sA.Storage)), E = $A(A, A.storage.filter((a) => a.resourceType === sA.StorageTexture)), i = $A(A, A.textures.filter((a) => a.type.name !== "texture_external")), o = $A(A, A.textures.filter((a) => a.type.name === "texture_external")), s = $A(A, A.samplers), t = {
8015
8015
  ...bg(A.entry.vertex, GPUShaderStage.VERTEX),
8016
8016
  ...bg(A.entry.fragment, GPUShaderStage.FRAGMENT),
8017
8017
  ...bg(A.entry.compute, GPUShaderStage.COMPUTE)
@@ -8413,8 +8413,8 @@ class Mo extends cQ {
8413
8413
  context_;
8414
8414
  depthFormat_;
8415
8415
  device_;
8416
- currentProjection_ = FA();
8417
- currentModelView_ = FA();
8416
+ currentProjection_ = SA();
8417
+ currentModelView_ = SA();
8418
8418
  colorMSAATexture_ = null;
8419
8419
  depthStencilTexture_ = null;
8420
8420
  passEncoder_ = null;
@@ -8457,7 +8457,7 @@ class Mo extends cQ {
8457
8457
  for (const o of A.layers)
8458
8458
  (o.blendMode === "none" ? I : g).push(o);
8459
8459
  for (const o of [...I, ...g])
8460
- o.update({ viewport: A });
8460
+ o.update(A);
8461
8461
  if (getComputedStyle(A.element).visibility === "hidden") return;
8462
8462
  const B = A.getBoxRelativeTo(this.canvas), Q = new GA(
8463
8463
  eA(0, 0),
@@ -8544,7 +8544,7 @@ class Mo extends cQ {
8544
8544
  },
8545
8545
  Q
8546
8546
  );
8547
- B.setPipeline(E.pipeline), _A(
8547
+ B.setPipeline(E.pipeline), eI(
8548
8548
  this.currentModelView_,
8549
8549
  I.viewMatrix,
8550
8550
  A.transform.matrix
@@ -8605,7 +8605,7 @@ class Mo extends cQ {
8605
8605
  this.texturePool_.dispose(A);
8606
8606
  }
8607
8607
  setUniformsForObject(A, I, g) {
8608
- _A(
8608
+ eI(
8609
8609
  this.currentModelView_,
8610
8610
  g.viewMatrix,
8611
8611
  A.transform.matrix
@@ -8633,7 +8633,7 @@ class Mo extends cQ {
8633
8633
  );
8634
8634
  }
8635
8635
  updateProjection(A) {
8636
- _A(
8636
+ eI(
8637
8637
  this.currentProjection_,
8638
8638
  Jo,
8639
8639
  A
@@ -8795,71 +8795,61 @@ class bo {
8795
8795
  return [...g, ...B];
8796
8796
  }
8797
8797
  updateChunksForImage(A, I) {
8798
- const g = I.camera;
8799
- if (g.type !== "OrthographicCamera")
8800
- throw new Error(
8801
- "ChunkStoreView currently supports only orthographic cameras. Update the implementation before using a perspective camera."
8802
- );
8803
- const Q = g.getWorldViewRect(), E = Math.abs(Q.max[0] - Q.min[0]), i = I.element, o = I.getBoxRelativeTo(i).toRect().width, s = E / o, t = Math.log2(1 / s);
8804
- this.setLOD(t);
8805
- const a = this.getZBounds(A);
8806
- if (!(this.policyChanged_ || this.viewBounds2DChanged(Q) || this.zBoundsChanged(a) || this.lastTCoord_ !== A.t || this.cCoordsChanged(A.c))) return;
8807
- const D = this.timeIndex(A);
8808
- if (!this.store_.hasChunksAtTime(D)) {
8798
+ const g = I.worldViewRect, Q = Math.abs(g.max[0] - g.min[0]) / I.bufferWidthPx, E = Math.log2(1 / Q);
8799
+ this.setLOD(E);
8800
+ const i = this.getZBounds(A);
8801
+ if (!(this.policyChanged_ || this.viewBounds2DChanged(g) || this.zBoundsChanged(i) || this.lastTCoord_ !== A.t || this.cCoordsChanged(A.c))) return;
8802
+ const s = this.timeIndex(A);
8803
+ if (!this.store_.hasChunksAtTime(s)) {
8809
8804
  H.warn(
8810
8805
  "ChunkStoreView",
8811
8806
  "updateChunkViewStates called with no chunks initialized"
8812
8807
  ), this.chunkViewStates_.clear();
8813
8808
  return;
8814
8809
  }
8815
- const F = NQ();
8816
- oi(F, Q.min, Q.max, 0.5);
8817
- const [U, S] = this.getZBounds(A), d = new gI(
8818
- P(Q.min[0], Q.min[1], U),
8819
- P(Q.max[0], Q.max[1], S)
8810
+ const t = NQ();
8811
+ oi(t, g.min, g.max, 0.5);
8812
+ const [a, n] = this.getZBounds(A), D = new II(
8813
+ P(g.min[0], g.min[1], a),
8814
+ P(g.max[0], g.max[1], n)
8820
8815
  );
8821
8816
  this.chunkViewStates_.forEach(Wg);
8822
- const K = this.channelsOfInterest(A), k = this.fallbackLOD(), R = this.getPaddedBounds(d), L = this.currentLOD_ === k ? [this.currentLOD_] : [this.currentLOD_, k];
8823
- for (const M of L) {
8824
- const W = M === this.currentLOD_, IA = M === k;
8817
+ const F = this.channelsOfInterest(A), U = this.fallbackLOD(), S = this.getPaddedBounds(D), l = this.currentLOD_ === U ? [this.currentLOD_] : [this.currentLOD_, U];
8818
+ for (const u of l) {
8819
+ const k = u === this.currentLOD_, R = u === U;
8825
8820
  this.iterateChunksInBox(
8826
- D,
8827
- M,
8828
- K,
8829
- R,
8830
- (CA, $) => {
8831
- const gA = gI.intersects($, d), SA = W && !gA, NA = this.computePriority(
8832
- IA,
8821
+ s,
8822
+ u,
8823
+ F,
8824
+ S,
8825
+ (L, M) => {
8826
+ const W = II.intersects(M, D), $ = k && !W, BA = this.computePriority(
8827
+ R,
8828
+ k,
8833
8829
  W,
8834
- gA,
8835
- SA,
8830
+ $,
8836
8831
  !0
8837
8832
  );
8838
- NA !== null && this.chunkViewStates_.set(CA, {
8839
- visible: gA,
8840
- prefetch: SA,
8841
- priority: NA,
8842
- orderKey: this.squareDistance2D(CA, F)
8833
+ BA !== null && this.chunkViewStates_.set(L, {
8834
+ visible: W,
8835
+ prefetch: $,
8836
+ priority: BA,
8837
+ orderKey: this.squareDistance2D(L, t)
8843
8838
  });
8844
8839
  }
8845
8840
  );
8846
8841
  }
8847
8842
  this.markTimeChunksForPrefetchImage(
8848
- D,
8843
+ s,
8849
8844
  A,
8850
- d,
8851
- F
8852
- ), this.policyChanged_ = !1, this.lastViewBounds2D_ = Q.clone(), this.lastZBounds_ = a, this.lastTCoord_ = A.t, this.lastCCoords_ = A.c ? [...A.c] : void 0;
8845
+ D,
8846
+ t
8847
+ ), this.policyChanged_ = !1, this.lastViewBounds2D_ = g.clone(), this.lastZBounds_ = i, this.lastTCoord_ = A.t, this.lastCCoords_ = A.c ? [...A.c] : void 0;
8853
8848
  }
8854
8849
  updateChunksForVolume(A, I) {
8855
- const g = _A(
8856
- FA(),
8857
- I.camera.projectionMatrix,
8858
- I.camera.viewMatrix
8859
- );
8860
- if (!(this.policyChanged_ || this.hasViewProjectionChanged(g) || this.lastTCoord_ !== A.t || this.cCoordsChanged(A.c))) return;
8861
- const Q = this.timeIndex(A);
8862
- if (!this.store_.hasChunksAtTime(Q)) {
8850
+ if (!(this.policyChanged_ || this.hasViewProjectionChanged(I) || this.lastTCoord_ !== A.t || this.cCoordsChanged(A.c))) return;
8851
+ const B = this.timeIndex(A);
8852
+ if (!this.store_.hasChunksAtTime(B)) {
8863
8853
  H.warn(
8864
8854
  "ChunkStoreView",
8865
8855
  "updateChunksForVolume called with no chunks initialized"
@@ -8867,32 +8857,32 @@ class bo {
8867
8857
  return;
8868
8858
  }
8869
8859
  this.currentLOD_ = this.policy_.lod.min, this.chunkViewStates_.forEach(Wg);
8870
- const E = this.channelsOfInterest(A), i = this.fallbackLOD(), o = (s) => {
8871
- const t = s.lod === i, a = s.lod === this.currentLOD_, n = this.computePriority(
8860
+ const Q = this.channelsOfInterest(A), E = this.fallbackLOD(), i = (o) => {
8861
+ const s = o.lod === E, t = o.lod === this.currentLOD_, a = this.computePriority(
8862
+ s,
8872
8863
  t,
8873
- a,
8874
8864
  !0,
8875
8865
  !1,
8876
8866
  !0
8877
8867
  );
8878
- n !== null && this.chunkViewStates_.set(s, {
8868
+ a !== null && this.chunkViewStates_.set(o, {
8879
8869
  visible: !0,
8880
8870
  prefetch: !1,
8881
- priority: n,
8871
+ priority: a,
8882
8872
  orderKey: 0
8883
8873
  });
8884
8874
  };
8885
8875
  this.iterateAllChunksAtLod(
8886
- Q,
8876
+ B,
8887
8877
  this.currentLOD_,
8888
- E,
8889
- o
8890
- ), this.currentLOD_ !== i && this.iterateAllChunksAtLod(
8891
8878
  Q,
8892
- i,
8879
+ i
8880
+ ), this.currentLOD_ !== E && this.iterateAllChunksAtLod(
8881
+ B,
8893
8882
  E,
8894
- o
8895
- ), this.markTimeChunksForPrefetchVolume(Q, A), this.policyChanged_ = !1, this.lastTCoord_ = A.t, this.lastCCoords_ = A.c ? [...A.c] : void 0, this.lastViewProjection_ = g;
8883
+ Q,
8884
+ i
8885
+ ), this.markTimeChunksForPrefetchVolume(B, A), this.policyChanged_ = !1, this.lastTCoord_ = A.t, this.lastCCoords_ = A.c ? [...A.c] : void 0, this.lastViewProjection_ = I;
8896
8886
  }
8897
8887
  allVisibleFallbackLODLoaded() {
8898
8888
  const A = this.fallbackLOD();
@@ -8987,8 +8977,8 @@ class bo {
8987
8977
  // Half-open chunk-index range [min, max) at a given LOD that covers `bounds`.
8988
8978
  // Returns null if the bounds don't overlap the data grid.
8989
8979
  chunkIndexRange(A, I) {
8990
- const g = this.store_.dimensions, B = g.x.lods[I], Q = g.y.lods[I], E = g.z?.lods[I], i = Math.ceil(B.size / B.chunkSize), o = Math.ceil(Q.size / Q.chunkSize), s = E ? Math.ceil(E.size / E.chunkSize) : 1, t = B.chunkSize * B.scale, a = Q.chunkSize * Q.scale, n = E ? E.chunkSize * E.scale : 1, D = B.translation, F = Q.translation, U = E?.translation ?? 0, S = Math.max(0, Math.floor((A.min[0] - D) / t)), d = Math.min(i, Math.ceil((A.max[0] - D) / t)), K = Math.max(0, Math.floor((A.min[1] - F) / a)), k = Math.min(o, Math.ceil((A.max[1] - F) / a)), R = E ? Math.max(0, Math.floor((A.min[2] - U) / n)) : 0, L = E ? Math.min(s, Math.ceil((A.max[2] - U) / n)) : 1;
8991
- return S >= d || K >= k || R >= L ? null : { xMin: S, xMax: d, yMin: K, yMax: k, zMin: R, zMax: L };
8980
+ const g = this.store_.dimensions, B = g.x.lods[I], Q = g.y.lods[I], E = g.z?.lods[I], i = Math.ceil(B.size / B.chunkSize), o = Math.ceil(Q.size / Q.chunkSize), s = E ? Math.ceil(E.size / E.chunkSize) : 1, t = B.chunkSize * B.scale, a = Q.chunkSize * Q.scale, n = E ? E.chunkSize * E.scale : 1, D = B.translation, F = Q.translation, U = E?.translation ?? 0, S = Math.max(0, Math.floor((A.min[0] - D) / t)), l = Math.min(i, Math.ceil((A.max[0] - D) / t)), u = Math.max(0, Math.floor((A.min[1] - F) / a)), k = Math.min(o, Math.ceil((A.max[1] - F) / a)), R = E ? Math.max(0, Math.floor((A.min[2] - U) / n)) : 0, L = E ? Math.min(s, Math.ceil((A.max[2] - U) / n)) : 1;
8981
+ return S >= l || u >= k || R >= L ? null : { xMin: S, xMax: l, yMin: u, yMax: k, zMin: R, zMax: L };
8992
8982
  }
8993
8983
  iterateChunksInBox(A, I, g, B, Q) {
8994
8984
  const E = this.chunkIndexRange(B, I);
@@ -9019,7 +9009,7 @@ class bo {
9019
9009
  }
9020
9010
  }
9021
9011
  getChunkAabb(A) {
9022
- return new gI(
9012
+ return new II(
9023
9013
  P(A.offset.x, A.offset.y, A.offset.z),
9024
9014
  P(
9025
9015
  A.offset.x + A.shape.x * A.scale.x,
@@ -9069,7 +9059,7 @@ class bo {
9069
9059
  getPaddedBounds(A) {
9070
9060
  const I = this.store_.dimensions, g = I.x.lods[this.currentLOD_], B = I.y.lods[this.currentLOD_], Q = I.z?.lods[this.currentLOD_], E = g.chunkSize * g.scale * this.policy_.prefetch.x, i = B.chunkSize * B.scale * this.policy_.prefetch.y;
9071
9061
  let o = 0;
9072
- return Q && (o = Q.chunkSize * Q.scale * this.policy_.prefetch.z), new gI(
9062
+ return Q && (o = Q.chunkSize * Q.scale * this.policy_.prefetch.z), new II(
9073
9063
  P(
9074
9064
  A.min[0] - E,
9075
9065
  A.min[1] - i,
@@ -9096,33 +9086,32 @@ function Wg(C) {
9096
9086
  class To {
9097
9087
  // Chunks indexed as chunks_[lod][t][c][z][y][x].
9098
9088
  chunks_;
9099
- loader_;
9100
9089
  lowestResLOD_;
9101
9090
  dimensions_;
9102
9091
  views_ = [];
9103
9092
  hasHadViews_ = !1;
9104
9093
  constructor(A) {
9105
- this.loader_ = A, this.dimensions_ = this.loader_.getSourceDimensionMap(), this.lowestResLOD_ = this.dimensions_.numLods - 1, this.validateXYScaleRatios();
9094
+ this.dimensions_ = A, this.lowestResLOD_ = this.dimensions_.numLods - 1, this.validateXYScaleRatios();
9106
9095
  const { size: I } = this.getAndValidateTimeDimension(), { size: g } = this.getAndValidateChannelDimension(), B = this.dimensions_.numLods;
9107
9096
  this.chunks_ = new Array(B);
9108
9097
  for (let Q = 0; Q < B; ++Q) {
9109
9098
  const E = this.dimensions_.x.lods[Q], i = this.dimensions_.y.lods[Q], o = this.dimensions_.z?.lods[Q], s = E.chunkSize, t = i.chunkSize, a = o?.chunkSize ?? 1, n = Math.ceil(E.size / s), D = Math.ceil(i.size / t), F = o ? Math.ceil(o.size / a) : 1, U = new Array(I);
9110
9099
  this.chunks_[Q] = U;
9111
9100
  for (let S = 0; S < I; ++S) {
9112
- const d = new Array(g);
9113
- U[S] = d;
9114
- for (let K = 0; K < g; ++K) {
9101
+ const l = new Array(g);
9102
+ U[S] = l;
9103
+ for (let u = 0; u < g; ++u) {
9115
9104
  const k = new Array(F);
9116
- d[K] = k;
9105
+ l[u] = k;
9117
9106
  for (let R = 0; R < F; ++R) {
9118
9107
  const L = o !== void 0 ? o.translation + R * a * o.scale : 0, M = new Array(D);
9119
9108
  k[R] = M;
9120
9109
  for (let W = 0; W < D; ++W) {
9121
- const IA = i.translation + W * t * i.scale, CA = new Array(n);
9122
- M[W] = CA;
9123
- for (let $ = 0; $ < n; ++$) {
9124
- const gA = E.translation + $ * s * E.scale;
9125
- CA[$] = {
9110
+ const $ = i.translation + W * t * i.scale, BA = new Array(n);
9111
+ M[W] = BA;
9112
+ for (let IA = 0; IA < n; ++IA) {
9113
+ const iA = E.translation + IA * s * E.scale;
9114
+ BA[IA] = {
9126
9115
  state: "unloaded",
9127
9116
  lod: Q,
9128
9117
  visible: !1,
@@ -9130,21 +9119,21 @@ class To {
9130
9119
  priority: null,
9131
9120
  orderKey: null,
9132
9121
  shape: {
9133
- x: Math.min(s, E.size - $ * s),
9122
+ x: Math.min(s, E.size - IA * s),
9134
9123
  y: Math.min(t, i.size - W * t),
9135
9124
  z: Math.min(a, (o?.size ?? 1) - R * a),
9136
9125
  c: 1
9137
9126
  },
9138
9127
  rowAlignmentBytes: 1,
9139
- chunkIndex: { x: $, y: W, z: R, c: K, t: S },
9128
+ chunkIndex: { x: IA, y: W, z: R, c: u, t: S },
9140
9129
  scale: {
9141
9130
  x: E.scale,
9142
9131
  y: i.scale,
9143
9132
  z: o?.scale ?? 1
9144
9133
  },
9145
9134
  offset: {
9146
- x: gA,
9147
- y: IA,
9135
+ x: iA,
9136
+ y: $,
9148
9137
  z: L
9149
9138
  }
9150
9139
  };
@@ -9173,9 +9162,6 @@ class To {
9173
9162
  getLowestResLOD() {
9174
9163
  return this.lowestResLOD_;
9175
9164
  }
9176
- loadChunkData(A, I) {
9177
- return this.loader_.loadChunkData(A, I);
9178
- }
9179
9165
  addView(A) {
9180
9166
  const I = new bo(this, A);
9181
9167
  return this.views_.push(I), this.hasHadViews_ = !0, I;
@@ -9271,7 +9257,7 @@ class To {
9271
9257
  }
9272
9258
  }
9273
9259
  class Wo {
9274
- stores_ = /* @__PURE__ */ new Map();
9260
+ stores_ = [];
9275
9261
  queue_ = new Ko();
9276
9262
  get queueStats() {
9277
9263
  return {
@@ -9283,21 +9269,21 @@ class Wo {
9283
9269
  return po();
9284
9270
  }
9285
9271
  addView(A, I) {
9286
- let g = this.stores_.get(A);
9287
- return g || (g = new To(A.getLoader()), this.stores_.set(A, g)), g.addView(I);
9272
+ let g = this.stores_.find((B) => B.source === A)?.store;
9273
+ return g || (g = new To(A.loader.getSourceDimensionMap()), this.stores_.push({ source: A, store: g })), g.addView(I);
9288
9274
  }
9289
9275
  update() {
9290
- for (const [A, I] of this.stores_) {
9276
+ for (const { source: A, store: I } of this.stores_) {
9291
9277
  const g = I.updateAndCollectChunkChanges();
9292
9278
  for (const B of g)
9293
9279
  B.priority === null ? this.queue_.cancel(B) : B.state === "queued" && this.queue_.enqueue(
9294
9280
  B,
9295
- (Q) => I.loadChunkData(B, Q)
9281
+ (Q) => A.loader.loadChunkData(B, Q)
9296
9282
  );
9297
9283
  }
9298
9284
  this.queue_.flush();
9299
- for (const [A, I] of this.stores_)
9300
- I.canDispose() && this.stores_.delete(A);
9285
+ for (let A = this.stores_.length - 1; A >= 0; A--)
9286
+ this.stores_[A].store.canDispose() && this.stores_.splice(A, 1);
9301
9287
  }
9302
9288
  }
9303
9289
  var KI = function(C = 1) {
@@ -9344,11 +9330,11 @@ var KI = function(C = 1) {
9344
9330
  KI.Panel = function(C, A, I, g) {
9345
9331
  var B = 1 / 0, Q = 0, E = Math.round, i = E(window.devicePixelRatio || 1), o = E(80 * i * g), s = E(48 * i * g), t = E(3 * i * g), a = E(2 * i * g), n = E(3 * i * g), D = E(15 * i * g), F = E(74 * i * g), U = E(30 * i * g), S = document.createElement("canvas");
9346
9332
  S.width = o, S.height = s, S.style.cssText = `width:${E(g * 80)}px;height:${E(g * 48)}px`;
9347
- var d = S.getContext("2d");
9348
- return d.font = "bold " + E(9 * i * g) + "px Helvetica,Arial,sans-serif", d.textBaseline = "top", d.fillStyle = I, d.fillRect(0, 0, o, s), d.fillStyle = A, d.fillText(C, t, a), d.fillRect(n, D, F, U), d.fillStyle = I, d.globalAlpha = 0.9, d.fillRect(n, D, F, U), {
9333
+ var l = S.getContext("2d");
9334
+ return l.font = "bold " + E(9 * i * g) + "px Helvetica,Arial,sans-serif", l.textBaseline = "top", l.fillStyle = I, l.fillRect(0, 0, o, s), l.fillStyle = A, l.fillText(C, t, a), l.fillRect(n, D, F, U), l.fillStyle = I, l.globalAlpha = 0.9, l.fillRect(n, D, F, U), {
9349
9335
  dom: S,
9350
- update: function(K, k) {
9351
- B = Math.min(B, K), Q = Math.max(Q, K), d.fillStyle = I, d.globalAlpha = 1, d.fillRect(0, 0, o, D), d.fillStyle = A, d.fillText(E(K) + " " + C + " (" + E(B) + "-" + E(Q) + ")", t, a), d.drawImage(S, n + i, D, F - i, U, n, D, F - i, U), d.fillRect(n + F - i, D, i, U), d.fillStyle = I, d.globalAlpha = 0.9, d.fillRect(n + F - i, D, i, E((1 - K / k) * U));
9336
+ update: function(u, k) {
9337
+ B = Math.min(B, u), Q = Math.max(Q, u), l.fillStyle = I, l.globalAlpha = 1, l.fillRect(0, 0, o, D), l.fillStyle = A, l.fillText(E(u) + " " + C + " (" + E(B) + "-" + E(Q) + ")", t, a), l.drawImage(S, n + i, D, F - i, U, n, D, F - i, U), l.fillRect(n + F - i, D, i, U), l.fillStyle = I, l.globalAlpha = 0.9, l.fillRect(n + F - i, D, i, E((1 - u / k) * U));
9352
9338
  }
9353
9339
  };
9354
9340
  };
@@ -9484,6 +9470,9 @@ class Oo {
9484
9470
  eA(t + n, a + D)
9485
9471
  );
9486
9472
  }
9473
+ getBufferRect() {
9474
+ return this.getBoxRelativeTo(this.element).toRect();
9475
+ }
9487
9476
  clientToClip(A, I = 0) {
9488
9477
  const [g, B] = A, Q = this.element.getBoundingClientRect();
9489
9478
  return P(
@@ -9895,7 +9884,7 @@ class qB extends vI {
9895
9884
  super(`Unsupported: ${A}`), this.feature = A;
9896
9885
  }
9897
9886
  }
9898
- function oI(C) {
9887
+ function iI(C) {
9899
9888
  return () => {
9900
9889
  throw new qB(`${C} encode`);
9901
9890
  };
@@ -9909,7 +9898,7 @@ class ag {
9909
9898
  static fromConfig(A, I) {
9910
9899
  return new ag(A, I);
9911
9900
  }
9912
- encode = oI("bitround");
9901
+ encode = iI("bitround");
9913
9902
  /**
9914
9903
  * Decode a chunk of data (no-op).
9915
9904
  * @param arr - The chunk to decode
@@ -10111,9 +10100,9 @@ function UI(C) {
10111
10100
  throw new nA(`Unknown or unsupported dataType: ${C}`);
10112
10101
  return I;
10113
10102
  }
10114
- function QI(C, A) {
10103
+ function CI(C, A) {
10115
10104
  const I = C.length;
10116
- typeof A == "string" && (A = A === "C" ? Array.from({ length: I }, (Q, E) => E) : Array.from({ length: I }, (Q, E) => I - 1 - E)), RA(I === A.length, "Order length must match the number of dimensions.");
10105
+ typeof A == "string" && (A = A === "C" ? Array.from({ length: I }, (Q, E) => E) : Array.from({ length: I }, (Q, E) => I - 1 - E)), FA(I === A.length, "Order length must match the number of dimensions.");
10117
10106
  let g = 1, B = new Array(I);
10118
10107
  for (let Q = A.length - 1; Q >= 0; Q--)
10119
10108
  B[A[Q]] = g, g *= C[A[Q]];
@@ -10264,7 +10253,7 @@ function $Q(C, ...A) {
10264
10253
  if (!A.some((I) => C instanceof I))
10265
10254
  throw C;
10266
10255
  }
10267
- function RA(C, A = "") {
10256
+ function FA(C, A = "") {
10268
10257
  if (!C)
10269
10258
  throw new Error(A);
10270
10259
  }
@@ -10276,7 +10265,7 @@ async function AE(C, { format: A, signal: I }) {
10276
10265
  let B = new Uint8Array(C.buffer, C.byteOffset, C.byteLength);
10277
10266
  g = new Response(B.slice().buffer);
10278
10267
  }
10279
- RA(g.body, "Response does not contain body.");
10268
+ FA(g.body, "Response does not contain body.");
10280
10269
  try {
10281
10270
  return await new Response(g.body.pipeThrough(new DecompressionStream(A), { signal: I })).arrayBuffer();
10282
10271
  } catch {
@@ -10299,7 +10288,7 @@ class lg {
10299
10288
  #B;
10300
10289
  #C;
10301
10290
  constructor(A, I) {
10302
- this.#C = A?.endian, this.#I = UI(I.dataType), this.#B = I.shape, this.#A = QI(I.shape, "C");
10291
+ this.#C = A?.endian, this.#I = UI(I.dataType), this.#B = I.shape, this.#A = CI(I.shape, "C");
10303
10292
  const g = new this.#I(0);
10304
10293
  this.#g = g.BYTES_PER_ELEMENT;
10305
10294
  }
@@ -10476,7 +10465,7 @@ class xB {
10476
10465
  const Q = A.rounding ?? "nearest-even", E = A.scalar_map?.decode ? pC(A.scalar_map.decode, B, g) : [], i = A.scalar_map?.encode ? pC(A.scalar_map.encode, g, B) : [];
10477
10466
  return new xB(g, B, Q, A.out_of_range, E, i);
10478
10467
  }
10479
- encode = oI("cast_value");
10468
+ encode = iI("cast_value");
10480
10469
  decode(A) {
10481
10470
  const I = A.data, g = new this.#I(I.length);
10482
10471
  for (let B = 0; B < I.length; B++)
@@ -10531,7 +10520,7 @@ class bB {
10531
10520
  static fromConfig() {
10532
10521
  return new bB();
10533
10522
  }
10534
- encode = oI("crc32c");
10523
+ encode = iI("crc32c");
10535
10524
  decode(A) {
10536
10525
  return new Uint8Array(A.buffer, A.byteOffset, A.byteLength - 4);
10537
10526
  }
@@ -10598,14 +10587,14 @@ class WB {
10598
10587
  static fromConfig(A) {
10599
10588
  return new WB();
10600
10589
  }
10601
- encode = oI("gzip");
10590
+ encode = iI("gzip");
10602
10591
  async decode(A) {
10603
10592
  const I = await AE(A, { format: "gzip" });
10604
10593
  return new Uint8Array(I);
10605
10594
  }
10606
10595
  }
10607
10596
  function ns(C, A) {
10608
- return RA(!Number.isNaN(A), "JsonCodec allow_nan is false but NaN was encountered during encoding."), RA(A !== Number.POSITIVE_INFINITY, "JsonCodec allow_nan is false but Infinity was encountered during encoding."), RA(A !== Number.NEGATIVE_INFINITY, "JsonCodec allow_nan is false but -Infinity was encountered during encoding."), A;
10597
+ return FA(!Number.isNaN(A), "JsonCodec allow_nan is false but NaN was encountered during encoding."), FA(A !== Number.POSITIVE_INFINITY, "JsonCodec allow_nan is false but Infinity was encountered during encoding."), FA(A !== Number.NEGATIVE_INFINITY, "JsonCodec allow_nan is false but -Infinity was encountered during encoding."), A;
10609
10598
  }
10610
10599
  function rs(C, A) {
10611
10600
  return A instanceof Object && !Array.isArray(A) ? Object.keys(A).sort().reduce((I, g) => (I[g] = A[g], I), {}) : A;
@@ -10635,9 +10624,9 @@ class rg {
10635
10624
  }
10636
10625
  encode(A) {
10637
10626
  const { indent: I, encoding: g, ensure_ascii: B, check_circular: Q, allow_nan: E, sort_keys: i } = this.#A;
10638
- RA(g === "utf-8", "JsonCodec does not yet support non-utf-8 encoding.");
10627
+ FA(g === "utf-8", "JsonCodec does not yet support non-utf-8 encoding.");
10639
10628
  const o = [];
10640
- RA(Q, "JsonCodec does not yet support skipping the check for circular references during encoding."), E || o.push(ns), i && o.push(rs);
10629
+ FA(Q, "JsonCodec does not yet support skipping the check for circular references during encoding."), E || o.push(ns), i && o.push(rs);
10641
10630
  const s = Array.from(A.data);
10642
10631
  s.push("|O"), s.push(A.shape);
10643
10632
  let t;
@@ -10655,10 +10644,10 @@ class rg {
10655
10644
  }
10656
10645
  decode(A) {
10657
10646
  const { strict: I } = this.#I;
10658
- RA(I, "JsonCodec does not yet support non-strict decoding.");
10647
+ FA(I, "JsonCodec does not yet support non-strict decoding.");
10659
10648
  const g = PI(A), B = g.pop();
10660
- g.pop(), RA(B, "0D not implemented for JsonCodec.");
10661
- const Q = QI(B, "C");
10649
+ g.pop(), FA(B, "0D not implemented for JsonCodec.");
10650
+ const Q = CI(B, "C");
10662
10651
  return { data: g, shape: B, stride: Q };
10663
10652
  }
10664
10653
  }
@@ -10688,7 +10677,7 @@ class vB {
10688
10677
  throw new nA(`scale_offset codec does not support data type: ${I.dataType}`);
10689
10678
  return new vB(ng(I.dataType, A.scale ?? 1), ng(I.dataType, A.offset ?? 0), UI(I.dataType));
10690
10679
  }
10691
- encode = oI("scale_offset");
10680
+ encode = iI("scale_offset");
10692
10681
  decode(A) {
10693
10682
  const I = A.data, g = new this.#A(I.length);
10694
10683
  for (let B = 0; B < I.length; B++)
@@ -10702,7 +10691,7 @@ class ZB {
10702
10691
  constructor(A, I) {
10703
10692
  if (I) {
10704
10693
  let g = new (UI(I.dataType))(0);
10705
- RA("BYTES_PER_ELEMENT" in g, `Shuffle codec requires a fixed-size dtype, got "${I.dataType}"`), this.#A = g.BYTES_PER_ELEMENT;
10694
+ FA("BYTES_PER_ELEMENT" in g, `Shuffle codec requires a fixed-size dtype, got "${I.dataType}"`), this.#A = g.BYTES_PER_ELEMENT;
10706
10695
  } else
10707
10696
  this.#A = A.elementsize ?? 4;
10708
10697
  }
@@ -10749,7 +10738,7 @@ function cs(C, A) {
10749
10738
  ) : I = new C.constructor(C.data.length), {
10750
10739
  data: I,
10751
10740
  shape: C.shape,
10752
- stride: QI(C.shape, A)
10741
+ stride: CI(C.shape, A)
10753
10742
  };
10754
10743
  }
10755
10744
  function ws(C, A) {
@@ -10770,11 +10759,11 @@ function ws(C, A) {
10770
10759
  }
10771
10760
  function Gs(C) {
10772
10761
  let A = C.shape.length;
10773
- return RA(A === C.stride.length, "Shape and stride must have the same length."), C.stride.map((I, g) => ({ stride: I, index: g })).sort((I, g) => g.stride - I.stride).map((I) => I.index);
10762
+ return FA(A === C.stride.length, "Shape and stride must have the same length."), C.stride.map((I, g) => ({ stride: I, index: g })).sort((I, g) => g.stride - I.stride).map((I) => I.index);
10774
10763
  }
10775
10764
  function Fs(C, A) {
10776
10765
  let I = Gs(C);
10777
- return RA(I.length === A.length, "Orders must match"), I.every((g, B) => g === A[B]);
10766
+ return FA(I.length === A.length, "Orders must match"), I.every((g, B) => g === A[B]);
10778
10767
  }
10779
10768
  class PB {
10780
10769
  kind = "array_to_array";
@@ -10790,7 +10779,7 @@ class PB {
10790
10779
  Q[i] = B - i - 1, E[i] = B - i - 1;
10791
10780
  else
10792
10781
  Q = g, Q.forEach((i, o) => {
10793
- RA(E[i] === void 0, `Invalid permutation: ${JSON.stringify(g)}`), E[i] = o;
10782
+ FA(E[i] === void 0, `Invalid permutation: ${JSON.stringify(g)}`), E[i] = o;
10794
10783
  });
10795
10784
  this.#A = Q, this.#I = E;
10796
10785
  }
@@ -10804,7 +10793,7 @@ class PB {
10804
10793
  return {
10805
10794
  data: A.data,
10806
10795
  shape: A.shape,
10807
- stride: QI(A.shape, this.#A)
10796
+ stride: CI(A.shape, this.#A)
10808
10797
  };
10809
10798
  }
10810
10799
  }
@@ -10813,12 +10802,12 @@ class Dg {
10813
10802
  #A;
10814
10803
  #I;
10815
10804
  constructor(A) {
10816
- this.#A = A, this.#I = QI(A, "C");
10805
+ this.#A = A, this.#I = CI(A, "C");
10817
10806
  }
10818
10807
  static fromConfig(A, I) {
10819
10808
  return new Dg(I.shape);
10820
10809
  }
10821
- encode = oI("vlen-utf8");
10810
+ encode = iI("vlen-utf8");
10822
10811
  decode(A) {
10823
10812
  let I = new TextDecoder(), g = new DataView(A.buffer), B = Array(g.getUint32(0, !0)), Q = 4;
10824
10813
  for (let E = 0; E < B.length; E++) {
@@ -10833,7 +10822,7 @@ class VB {
10833
10822
  static fromConfig(A) {
10834
10823
  return new VB();
10835
10824
  }
10836
- encode = oI("zlib");
10825
+ encode = iI("zlib");
10837
10826
  async decode(A) {
10838
10827
  const I = await AE(A, { format: "deflate" });
10839
10828
  return new Uint8Array(I);
@@ -10959,15 +10948,15 @@ function Us(C, A, I, g) {
10959
10948
  let D = await o[n];
10960
10949
  if (D === null)
10961
10950
  return;
10962
- let { data: F, shape: U, stride: S } = D, d = s.map((R, L) => R % U[L]).reduce((R, L, M) => R + L * S[M], 0), K = F[d], k = F[d + 1];
10963
- if (!(K === vC && k === vC))
10951
+ let { data: F, shape: U, stride: S } = D, l = s.map((R, L) => R % U[L]).reduce((R, L, M) => R + L * S[M], 0), u = F[l], k = F[l + 1];
10952
+ if (!(u === vC && k === vC))
10964
10953
  return B(n, {
10965
- offset: Number(K),
10954
+ offset: Number(u),
10966
10955
  length: Number(k)
10967
10956
  }, t);
10968
10957
  };
10969
10958
  }
10970
- class lA {
10959
+ class UA {
10971
10960
  store;
10972
10961
  path;
10973
10962
  constructor(A, I = "/") {
@@ -10975,10 +10964,10 @@ class lA {
10975
10964
  }
10976
10965
  resolve(A) {
10977
10966
  let I = new URL(`file://${this.path.endsWith("/") ? this.path : `${this.path}/`}`);
10978
- return new lA(this.store, decodeURIComponent(new URL(A, I).pathname));
10967
+ return new UA(this.store, decodeURIComponent(new URL(A, I).pathname));
10979
10968
  }
10980
10969
  }
10981
- class OB extends lA {
10970
+ class OB extends UA {
10982
10971
  kind = "group";
10983
10972
  #A;
10984
10973
  constructor(A, I, g) {
@@ -11011,7 +11000,7 @@ function ds(C, A) {
11011
11000
  fillValue: A.fill_value
11012
11001
  }),
11013
11002
  getStrides(E) {
11014
- return QI(E, Q);
11003
+ return CI(E, Q);
11015
11004
  },
11016
11005
  getChunkBytes: Us(C, A.chunk_grid.configuration.chunk_shape, g.encodeChunkKey, I)
11017
11006
  };
@@ -11028,7 +11017,7 @@ function ds(C, A) {
11028
11017
  fillValue: A.fill_value
11029
11018
  }),
11030
11019
  getStrides(Q) {
11031
- return QI(Q, B);
11020
+ return CI(Q, B);
11032
11021
  },
11033
11022
  async getChunkBytes(Q, E) {
11034
11023
  let i = g.encodeChunkKey(Q), o = C.resolve(i).path;
@@ -11036,7 +11025,7 @@ function ds(C, A) {
11036
11025
  }
11037
11026
  };
11038
11027
  }
11039
- let hg = class extends lA {
11028
+ let hg = class extends UA {
11040
11029
  kind = "array";
11041
11030
  #A;
11042
11031
  [jI];
@@ -11145,7 +11134,7 @@ async function Ys(C, A) {
11145
11134
  return I ? PI(I) : {};
11146
11135
  }
11147
11136
  async function Ms(C, A = {}) {
11148
- let I = "store" in C ? C : new lA(C), { signal: g } = A, B = {};
11137
+ let I = "store" in C ? C : new UA(C), { signal: g } = A, B = {};
11149
11138
  return (A.attrs ?? !0) && (B = await Ys(I, g)), g?.throwIfAborted(), A.kind === "array" ? PC(I, B, g) : A.kind === "group" ? VC(I, B, g) : PC(I, B, g).catch((Q) => ($Q(Q, kI, nA), VC(I, B, g)));
11150
11139
  }
11151
11140
  async function PC(C, A, I) {
@@ -11168,7 +11157,7 @@ async function fs(C, A) {
11168
11157
  return Q.node_type === "array" && (Q.fill_value = zQ(Q)), Q.node_type === "array" ? gE(new hg(I, C.path, Q)) : new OB(I, C.path, Q);
11169
11158
  }
11170
11159
  async function us(C, A = {}) {
11171
- let I = "store" in C ? C : new lA(C), g = await fs(I, A.signal);
11160
+ let I = "store" in C ? C : new UA(C), g = await fs(I, A.signal);
11172
11161
  if (Lg.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && g instanceof hg || A.kind === "group" && g instanceof OB)
11173
11162
  return g;
11174
11163
  let B = g instanceof hg ? "array" : "group";
@@ -11177,12 +11166,12 @@ async function us(C, A = {}) {
11177
11166
  found: B
11178
11167
  });
11179
11168
  }
11180
- async function UA(C, A = {}) {
11181
- let I = "store" in C ? C.store : C, g = Lg.versionMax(I), B = g === "v2" ? UA.v2 : UA.v3, Q = g === "v2" ? UA.v3 : UA.v2;
11169
+ async function RA(C, A = {}) {
11170
+ let I = "store" in C ? C.store : C, g = Lg.versionMax(I), B = g === "v2" ? RA.v2 : RA.v3, Q = g === "v2" ? RA.v3 : RA.v2;
11182
11171
  return B(C, A).catch((E) => ($Q(E, kI, nA), Q(C, A)));
11183
11172
  }
11184
- UA.v2 = Ms;
11185
- UA.v3 = us;
11173
+ RA.v2 = Ms;
11174
+ RA.v3 = us;
11186
11175
  async function Ks(C, A) {
11187
11176
  const I = A.split("/"), g = I.pop();
11188
11177
  if (!g)
@@ -11213,18 +11202,18 @@ class _B {
11213
11202
  async function VI(C, A) {
11214
11203
  if (A === "v2")
11215
11204
  try {
11216
- return UA.v2(C, { kind: "group", attrs: !0 });
11205
+ return RA.v2(C, { kind: "group", attrs: !0 });
11217
11206
  } catch {
11218
11207
  throw new Error(`Failed to open Zarr v2 group at ${C}`);
11219
11208
  }
11220
11209
  if (A === "v3")
11221
11210
  try {
11222
- return UA.v3(C, { kind: "group" });
11211
+ return RA.v3(C, { kind: "group" });
11223
11212
  } catch {
11224
11213
  throw new Error(`Failed to open Zarr v3 group at ${C}`);
11225
11214
  }
11226
11215
  try {
11227
- return UA(C, { kind: "group" });
11216
+ return RA(C, { kind: "group" });
11228
11217
  } catch {
11229
11218
  throw new Error(`Failed to open Zarr group at ${C}`);
11230
11219
  }
@@ -11232,18 +11221,18 @@ async function VI(C, A) {
11232
11221
  async function Hs(C, A) {
11233
11222
  if (A === "v2")
11234
11223
  try {
11235
- return UA.v2(C, { kind: "array", attrs: !1 });
11224
+ return RA.v2(C, { kind: "array", attrs: !1 });
11236
11225
  } catch {
11237
11226
  throw new Error(`Failed to open Zarr v2 array at ${C}`);
11238
11227
  }
11239
11228
  if (A === "v3")
11240
11229
  try {
11241
- return UA.v3(C, { kind: "array" });
11230
+ return RA.v3(C, { kind: "array" });
11242
11231
  } catch {
11243
11232
  throw new Error(`Failed to open Zarr v3 array at ${C}`);
11244
11233
  }
11245
11234
  try {
11246
- return UA(C, { kind: "array" });
11235
+ return RA(C, { kind: "array" });
11247
11236
  } catch {
11248
11237
  throw new Error(`Failed to open Zarr array at ${C}`);
11249
11238
  }
@@ -11253,11 +11242,11 @@ async function qs(C) {
11253
11242
  switch (C.type) {
11254
11243
  case "fetch": {
11255
11244
  const g = new WI(C.url);
11256
- A = new lA(g);
11245
+ A = new UA(g);
11257
11246
  break;
11258
11247
  }
11259
11248
  case "filesystem": {
11260
- A = new lA(
11249
+ A = new UA(
11261
11250
  new _B(C.directoryHandle),
11262
11251
  C.path
11263
11252
  );
@@ -11316,18 +11305,18 @@ function xs(C, A, I, g) {
11316
11305
  const s = g.cChunkSize ? Q.c % g.cChunkSize : 0, t = g.tChunkSize ? Q.t % g.tChunkSize : 0, a = B.x * B.y * B.z, n = E.c !== void 0 ? I[E.c] : 0, D = E.t !== void 0 ? I[E.t] : 0, F = t * D + s * n, U = o.x === B.x && o.y === B.y && o.z === B.z;
11317
11306
  if (F === 0 && C.length === a && U)
11318
11307
  return C;
11319
- const d = new C.constructor(
11308
+ const l = new C.constructor(
11320
11309
  a
11321
- ), K = E.z !== void 0 ? I[E.z] : 0, k = I[E.y];
11310
+ ), u = E.z !== void 0 ? I[E.z] : 0, k = I[E.y];
11322
11311
  let R = 0;
11323
11312
  for (let L = 0; L < B.z; L++) {
11324
- const M = F + L * K;
11313
+ const M = F + L * u;
11325
11314
  for (let W = 0; W < B.y; W++) {
11326
- const IA = M + W * k, CA = IA + B.x;
11327
- d.set(C.subarray(IA, CA), R), R += B.x;
11315
+ const $ = M + W * k, BA = $ + B.x;
11316
+ l.set(C.subarray($, BA), R), R += B.x;
11328
11317
  }
11329
11318
  }
11330
- return d;
11319
+ return l;
11331
11320
  }
11332
11321
  const BE = `function xg(B, A) {
11333
11322
  return {
@@ -15006,17 +14995,17 @@ function bs(C) {
15006
14995
  }
15007
14996
  }
15008
14997
  const Ts = Math.max(1, navigator.hardwareConcurrency - 2);
15009
- let MA = [], Ws = 0, CE = 0;
15010
- const EI = /* @__PURE__ */ new Map(), yg = /* @__PURE__ */ new Set();
14998
+ let JA = [], Ws = 0, CE = 0;
14999
+ const QI = /* @__PURE__ */ new Map(), yg = /* @__PURE__ */ new Set();
15011
15000
  function QE(C) {
15012
- const A = MA.find((I) => I.worker === C);
15001
+ const A = JA.find((I) => I.worker === C);
15013
15002
  return A || H.error(
15014
15003
  "ZarrWorker",
15015
15004
  "Worker not found in pool - this should not happen"
15016
15005
  ), A;
15017
15006
  }
15018
15007
  function vs(C, A) {
15019
- const { id: I, success: g } = C.data, B = EI.get(I);
15008
+ const { id: I, success: g } = C.data, B = QI.get(I);
15020
15009
  if (!B) {
15021
15010
  yg.has(I) ? yg.delete(I) : H.warn(
15022
15011
  "ZarrWorker",
@@ -15025,7 +15014,7 @@ function vs(C, A) {
15025
15014
  );
15026
15015
  return;
15027
15016
  }
15028
- EI.delete(I), B.abortListener && B.abortSignal && B.abortSignal.removeEventListener("abort", B.abortListener);
15017
+ QI.delete(I), B.abortListener && B.abortSignal && B.abortSignal.removeEventListener("abort", B.abortListener);
15029
15018
  const Q = QE(A);
15030
15019
  Q && Q.pendingCount > 0 ? Q.pendingCount-- : Q && H.error(
15031
15020
  "ZarrWorker",
@@ -15047,16 +15036,16 @@ function _C(C, A) {
15047
15036
  );
15048
15037
  const I = QE(A);
15049
15038
  if (I) {
15050
- const B = MA.indexOf(I);
15051
- MA.splice(B, 1);
15039
+ const B = JA.indexOf(I);
15040
+ JA.splice(B, 1);
15052
15041
  }
15053
15042
  const g = I?.workerId;
15054
15043
  if (g !== void 0)
15055
- for (const [B, Q] of EI.entries())
15056
- Q.workerId === g && (Q.reject(new Error(`Worker error: ${C.message}`)), EI.delete(B));
15044
+ for (const [B, Q] of QI.entries())
15045
+ Q.workerId === g && (Q.reject(new Error(`Worker error: ${C.message}`)), QI.delete(B));
15057
15046
  try {
15058
15047
  const B = EE();
15059
- MA.push({
15048
+ JA.push({
15060
15049
  worker: B,
15061
15050
  pendingCount: 0,
15062
15051
  workerId: CE++
@@ -15073,9 +15062,9 @@ function EE() {
15073
15062
  ), C;
15074
15063
  }
15075
15064
  function Zs() {
15076
- if (MA.length === 0)
15065
+ if (JA.length === 0)
15077
15066
  throw new Error("Worker pool is not initialized");
15078
- return MA.sort((C, A) => C.pendingCount - A.pendingCount)[0];
15067
+ return JA.sort((C, A) => C.pendingCount - A.pendingCount)[0];
15079
15068
  }
15080
15069
  async function Ps(C, A, I, g) {
15081
15070
  return new Promise((B, Q) => {
@@ -15084,12 +15073,12 @@ async function Ps(C, A, I, g) {
15084
15073
  reject: Q,
15085
15074
  workerId: E.workerId
15086
15075
  };
15087
- if (EI.set(i, o), g?.signal) {
15076
+ if (QI.set(i, o), g?.signal) {
15088
15077
  const s = () => {
15089
15078
  E.worker.postMessage({
15090
15079
  id: i,
15091
15080
  type: "cancel"
15092
- }), EI.delete(i), yg.add(i), E.pendingCount--, Q(new DOMException("Operation was aborted", "AbortError"));
15081
+ }), QI.delete(i), yg.add(i), E.pendingCount--, Q(new DOMException("Operation was aborted", "AbortError"));
15093
15082
  };
15094
15083
  if (g.signal.aborted) {
15095
15084
  s(), yg.delete(i);
@@ -15107,11 +15096,11 @@ async function Ps(C, A, I, g) {
15107
15096
  });
15108
15097
  }
15109
15098
  function Vs() {
15110
- if (!(MA.length > 0))
15099
+ if (!(JA.length > 0))
15111
15100
  try {
15112
15101
  for (let C = 0; C < Ts; C++) {
15113
15102
  const A = EE();
15114
- MA.push({
15103
+ JA.push({
15115
15104
  worker: A,
15116
15105
  pendingCount: 0,
15117
15106
  workerId: CE++
@@ -15119,7 +15108,7 @@ function Vs() {
15119
15108
  }
15120
15109
  H.debug(
15121
15110
  "ZarrWorker",
15122
- `Initialized worker pool with ${MA.length} workers`
15111
+ `Initialized worker pool with ${JA.length} workers`
15123
15112
  );
15124
15113
  } catch {
15125
15114
  H.warn("ZarrWorker", "Failed to create workers - clearing pool"), _s();
@@ -15153,9 +15142,9 @@ async function Os(C, A, I, g, B) {
15153
15142
  }
15154
15143
  }
15155
15144
  function _s() {
15156
- for (const C of MA)
15145
+ for (const C of JA)
15157
15146
  C.worker.terminate();
15158
- MA = [], EI.clear();
15147
+ JA = [], QI.clear();
15159
15148
  }
15160
15149
  class Xs {
15161
15150
  metadata_;
@@ -15212,12 +15201,12 @@ function js(C, A) {
15212
15201
  const I = C.axes.map((a) => a.name), g = C.axes.length, B = XC(I, "x"), Q = XC(I, "y"), E = (a, n) => {
15213
15202
  const D = [];
15214
15203
  for (let F = 0; F < C.datasets.length; F++) {
15215
- const U = C.datasets[F], S = A[F], d = U.coordinateTransformations[0].scale, K = U.coordinateTransformations.length === 2 ? U.coordinateTransformations[1].translation : new Array(g).fill(0);
15204
+ const U = C.datasets[F], S = A[F], l = U.coordinateTransformations[0].scale, u = U.coordinateTransformations.length === 2 ? U.coordinateTransformations[1].translation : new Array(g).fill(0);
15216
15205
  D.push({
15217
15206
  size: S.shape[n],
15218
15207
  chunkSize: S.chunks[n],
15219
- scale: d[n],
15220
- translation: K[n]
15208
+ scale: l[n],
15209
+ translation: u[n]
15221
15210
  });
15222
15211
  }
15223
15212
  if (C.axes[n].type === "space" && $s(D))
@@ -15348,7 +15337,7 @@ const f = V.arrayToEnum([
15348
15337
  default:
15349
15338
  return f.unknown;
15350
15339
  }
15351
- }, l = V.arrayToEnum([
15340
+ }, d = V.arrayToEnum([
15352
15341
  "invalid_type",
15353
15342
  "invalid_literal",
15354
15343
  "custom",
@@ -15433,52 +15422,52 @@ vA.create = (C) => new vA(C);
15433
15422
  const aB = (C, A) => {
15434
15423
  let I;
15435
15424
  switch (C.code) {
15436
- case l.invalid_type:
15425
+ case d.invalid_type:
15437
15426
  C.received === f.undefined ? I = "Required" : I = `Expected ${C.expected}, received ${C.received}`;
15438
15427
  break;
15439
- case l.invalid_literal:
15428
+ case d.invalid_literal:
15440
15429
  I = `Invalid literal value, expected ${JSON.stringify(C.expected, V.jsonStringifyReplacer)}`;
15441
15430
  break;
15442
- case l.unrecognized_keys:
15431
+ case d.unrecognized_keys:
15443
15432
  I = `Unrecognized key(s) in object: ${V.joinValues(C.keys, ", ")}`;
15444
15433
  break;
15445
- case l.invalid_union:
15434
+ case d.invalid_union:
15446
15435
  I = "Invalid input";
15447
15436
  break;
15448
- case l.invalid_union_discriminator:
15437
+ case d.invalid_union_discriminator:
15449
15438
  I = `Invalid discriminator value. Expected ${V.joinValues(C.options)}`;
15450
15439
  break;
15451
- case l.invalid_enum_value:
15440
+ case d.invalid_enum_value:
15452
15441
  I = `Invalid enum value. Expected ${V.joinValues(C.options)}, received '${C.received}'`;
15453
15442
  break;
15454
- case l.invalid_arguments:
15443
+ case d.invalid_arguments:
15455
15444
  I = "Invalid function arguments";
15456
15445
  break;
15457
- case l.invalid_return_type:
15446
+ case d.invalid_return_type:
15458
15447
  I = "Invalid function return type";
15459
15448
  break;
15460
- case l.invalid_date:
15449
+ case d.invalid_date:
15461
15450
  I = "Invalid date";
15462
15451
  break;
15463
- case l.invalid_string:
15452
+ case d.invalid_string:
15464
15453
  typeof C.validation == "object" ? "includes" in C.validation ? (I = `Invalid input: must include "${C.validation.includes}"`, typeof C.validation.position == "number" && (I = `${I} at one or more positions greater than or equal to ${C.validation.position}`)) : "startsWith" in C.validation ? I = `Invalid input: must start with "${C.validation.startsWith}"` : "endsWith" in C.validation ? I = `Invalid input: must end with "${C.validation.endsWith}"` : V.assertNever(C.validation) : C.validation !== "regex" ? I = `Invalid ${C.validation}` : I = "Invalid";
15465
15454
  break;
15466
- case l.too_small:
15455
+ case d.too_small:
15467
15456
  C.type === "array" ? I = `Array must contain ${C.exact ? "exactly" : C.inclusive ? "at least" : "more than"} ${C.minimum} element(s)` : C.type === "string" ? I = `String must contain ${C.exact ? "exactly" : C.inclusive ? "at least" : "over"} ${C.minimum} character(s)` : C.type === "number" ? I = `Number must be ${C.exact ? "exactly equal to " : C.inclusive ? "greater than or equal to " : "greater than "}${C.minimum}` : C.type === "bigint" ? I = `Number must be ${C.exact ? "exactly equal to " : C.inclusive ? "greater than or equal to " : "greater than "}${C.minimum}` : C.type === "date" ? I = `Date must be ${C.exact ? "exactly equal to " : C.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(C.minimum))}` : I = "Invalid input";
15468
15457
  break;
15469
- case l.too_big:
15458
+ case d.too_big:
15470
15459
  C.type === "array" ? I = `Array must contain ${C.exact ? "exactly" : C.inclusive ? "at most" : "less than"} ${C.maximum} element(s)` : C.type === "string" ? I = `String must contain ${C.exact ? "exactly" : C.inclusive ? "at most" : "under"} ${C.maximum} character(s)` : C.type === "number" ? I = `Number must be ${C.exact ? "exactly" : C.inclusive ? "less than or equal to" : "less than"} ${C.maximum}` : C.type === "bigint" ? I = `BigInt must be ${C.exact ? "exactly" : C.inclusive ? "less than or equal to" : "less than"} ${C.maximum}` : C.type === "date" ? I = `Date must be ${C.exact ? "exactly" : C.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(C.maximum))}` : I = "Invalid input";
15471
15460
  break;
15472
- case l.custom:
15461
+ case d.custom:
15473
15462
  I = "Invalid input";
15474
15463
  break;
15475
- case l.invalid_intersection_types:
15464
+ case d.invalid_intersection_types:
15476
15465
  I = "Intersection results could not be merged";
15477
15466
  break;
15478
- case l.not_multiple_of:
15467
+ case d.not_multiple_of:
15479
15468
  I = `Number must be a multiple of ${C.multipleOf}`;
15480
15469
  break;
15481
- case l.not_finite:
15470
+ case d.not_finite:
15482
15471
  I = "Number must be finite";
15483
15472
  break;
15484
15473
  default:
@@ -15529,7 +15518,7 @@ function Y(C, A) {
15529
15518
  });
15530
15519
  C.common.issues.push(g);
15531
15520
  }
15532
- class kA {
15521
+ class NA {
15533
15522
  constructor() {
15534
15523
  this.value = "valid";
15535
15524
  }
@@ -15557,7 +15546,7 @@ class kA {
15557
15546
  value: E
15558
15547
  });
15559
15548
  }
15560
- return kA.mergeObjectSync(A, g);
15549
+ return NA.mergeObjectSync(A, g);
15561
15550
  }
15562
15551
  static mergeObjectSync(A, I) {
15563
15552
  const g = {};
@@ -15572,12 +15561,12 @@ class kA {
15572
15561
  }
15573
15562
  const m = Object.freeze({
15574
15563
  status: "aborted"
15575
- }), YI = (C) => ({ status: "dirty", value: C }), JA = (C) => ({ status: "valid", value: C }), zC = (C) => C.status === "aborted", $C = (C) => C.status === "dirty", yI = (C) => C.status === "valid", cg = (C) => typeof Promise < "u" && C instanceof Promise;
15576
- var u;
15564
+ }), YI = (C) => ({ status: "dirty", value: C }), lA = (C) => ({ status: "valid", value: C }), zC = (C) => C.status === "aborted", $C = (C) => C.status === "dirty", yI = (C) => C.status === "valid", cg = (C) => typeof Promise < "u" && C instanceof Promise;
15565
+ var K;
15577
15566
  (function(C) {
15578
15567
  C.errToObj = (A) => typeof A == "string" ? { message: A } : A || {}, C.toString = (A) => typeof A == "string" ? A : A?.message;
15579
- })(u || (u = {}));
15580
- class zA {
15568
+ })(K || (K = {}));
15569
+ class jA {
15581
15570
  constructor(A, I, g, B) {
15582
15571
  this._cachedPath = [], this.parent = A, this.data = I, this._path = g, this._key = B;
15583
15572
  }
@@ -15630,7 +15619,7 @@ class Z {
15630
15619
  }
15631
15620
  _processInputParams(A) {
15632
15621
  return {
15633
- status: new kA(),
15622
+ status: new NA(),
15634
15623
  ctx: {
15635
15624
  common: A.parent.common,
15636
15625
  data: A.data,
@@ -15729,7 +15718,7 @@ class Z {
15729
15718
  const g = (B) => typeof I == "string" || typeof I > "u" ? { message: I } : typeof I == "function" ? I(B) : I;
15730
15719
  return this._refinement((B, Q) => {
15731
15720
  const E = A(B), i = () => Q.addIssue({
15732
- code: l.custom,
15721
+ code: d.custom,
15733
15722
  ...g(B)
15734
15723
  });
15735
15724
  return typeof Promise < "u" && E instanceof Promise ? E.then((o) => o ? !0 : (i(), !1)) : E ? !0 : (i(), !1);
@@ -15756,7 +15745,7 @@ class Z {
15756
15745
  };
15757
15746
  }
15758
15747
  optional() {
15759
- return jA.create(this, this._def);
15748
+ return XA.create(this, this._def);
15760
15749
  }
15761
15750
  nullable() {
15762
15751
  return FI.create(this, this._def);
@@ -15870,17 +15859,17 @@ class VA extends Z {
15870
15859
  if (this._def.coerce && (A.data = String(A.data)), this._getType(A) !== f.string) {
15871
15860
  const Q = this._getOrReturnCtx(A);
15872
15861
  return Y(Q, {
15873
- code: l.invalid_type,
15862
+ code: d.invalid_type,
15874
15863
  expected: f.string,
15875
15864
  received: Q.parsedType
15876
15865
  }), m;
15877
15866
  }
15878
- const g = new kA();
15867
+ const g = new NA();
15879
15868
  let B;
15880
15869
  for (const Q of this._def.checks)
15881
15870
  if (Q.kind === "min")
15882
15871
  A.data.length < Q.value && (B = this._getOrReturnCtx(A, B), Y(B, {
15883
- code: l.too_small,
15872
+ code: d.too_small,
15884
15873
  minimum: Q.value,
15885
15874
  type: "string",
15886
15875
  inclusive: !0,
@@ -15889,7 +15878,7 @@ class VA extends Z {
15889
15878
  }), g.dirty());
15890
15879
  else if (Q.kind === "max")
15891
15880
  A.data.length > Q.value && (B = this._getOrReturnCtx(A, B), Y(B, {
15892
- code: l.too_big,
15881
+ code: d.too_big,
15893
15882
  maximum: Q.value,
15894
15883
  type: "string",
15895
15884
  inclusive: !0,
@@ -15899,14 +15888,14 @@ class VA extends Z {
15899
15888
  else if (Q.kind === "length") {
15900
15889
  const E = A.data.length > Q.value, i = A.data.length < Q.value;
15901
15890
  (E || i) && (B = this._getOrReturnCtx(A, B), E ? Y(B, {
15902
- code: l.too_big,
15891
+ code: d.too_big,
15903
15892
  maximum: Q.value,
15904
15893
  type: "string",
15905
15894
  inclusive: !0,
15906
15895
  exact: !0,
15907
15896
  message: Q.message
15908
15897
  }) : i && Y(B, {
15909
- code: l.too_small,
15898
+ code: d.too_small,
15910
15899
  minimum: Q.value,
15911
15900
  type: "string",
15912
15901
  inclusive: !0,
@@ -15916,43 +15905,43 @@ class VA extends Z {
15916
15905
  } else if (Q.kind === "email")
15917
15906
  tt.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
15918
15907
  validation: "email",
15919
- code: l.invalid_string,
15908
+ code: d.invalid_string,
15920
15909
  message: Q.message
15921
15910
  }), g.dirty());
15922
15911
  else if (Q.kind === "emoji")
15923
15912
  Og || (Og = new RegExp(at, "u")), Og.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
15924
15913
  validation: "emoji",
15925
- code: l.invalid_string,
15914
+ code: d.invalid_string,
15926
15915
  message: Q.message
15927
15916
  }), g.dirty());
15928
15917
  else if (Q.kind === "uuid")
15929
15918
  Et.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
15930
15919
  validation: "uuid",
15931
- code: l.invalid_string,
15920
+ code: d.invalid_string,
15932
15921
  message: Q.message
15933
15922
  }), g.dirty());
15934
15923
  else if (Q.kind === "nanoid")
15935
15924
  it.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
15936
15925
  validation: "nanoid",
15937
- code: l.invalid_string,
15926
+ code: d.invalid_string,
15938
15927
  message: Q.message
15939
15928
  }), g.dirty());
15940
15929
  else if (Q.kind === "cuid")
15941
15930
  Bt.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
15942
15931
  validation: "cuid",
15943
- code: l.invalid_string,
15932
+ code: d.invalid_string,
15944
15933
  message: Q.message
15945
15934
  }), g.dirty());
15946
15935
  else if (Q.kind === "cuid2")
15947
15936
  Ct.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
15948
15937
  validation: "cuid2",
15949
- code: l.invalid_string,
15938
+ code: d.invalid_string,
15950
15939
  message: Q.message
15951
15940
  }), g.dirty());
15952
15941
  else if (Q.kind === "ulid")
15953
15942
  Qt.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
15954
15943
  validation: "ulid",
15955
- code: l.invalid_string,
15944
+ code: d.invalid_string,
15956
15945
  message: Q.message
15957
15946
  }), g.dirty());
15958
15947
  else if (Q.kind === "url")
@@ -15961,61 +15950,61 @@ class VA extends Z {
15961
15950
  } catch {
15962
15951
  B = this._getOrReturnCtx(A, B), Y(B, {
15963
15952
  validation: "url",
15964
- code: l.invalid_string,
15953
+ code: d.invalid_string,
15965
15954
  message: Q.message
15966
15955
  }), g.dirty();
15967
15956
  }
15968
15957
  else Q.kind === "regex" ? (Q.regex.lastIndex = 0, Q.regex.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
15969
15958
  validation: "regex",
15970
- code: l.invalid_string,
15959
+ code: d.invalid_string,
15971
15960
  message: Q.message
15972
15961
  }), g.dirty())) : Q.kind === "trim" ? A.data = A.data.trim() : Q.kind === "includes" ? A.data.includes(Q.value, Q.position) || (B = this._getOrReturnCtx(A, B), Y(B, {
15973
- code: l.invalid_string,
15962
+ code: d.invalid_string,
15974
15963
  validation: { includes: Q.value, position: Q.position },
15975
15964
  message: Q.message
15976
15965
  }), g.dirty()) : Q.kind === "toLowerCase" ? A.data = A.data.toLowerCase() : Q.kind === "toUpperCase" ? A.data = A.data.toUpperCase() : Q.kind === "startsWith" ? A.data.startsWith(Q.value) || (B = this._getOrReturnCtx(A, B), Y(B, {
15977
- code: l.invalid_string,
15966
+ code: d.invalid_string,
15978
15967
  validation: { startsWith: Q.value },
15979
15968
  message: Q.message
15980
15969
  }), g.dirty()) : Q.kind === "endsWith" ? A.data.endsWith(Q.value) || (B = this._getOrReturnCtx(A, B), Y(B, {
15981
- code: l.invalid_string,
15970
+ code: d.invalid_string,
15982
15971
  validation: { endsWith: Q.value },
15983
15972
  message: Q.message
15984
15973
  }), g.dirty()) : Q.kind === "datetime" ? Gt(Q).test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
15985
- code: l.invalid_string,
15974
+ code: d.invalid_string,
15986
15975
  validation: "datetime",
15987
15976
  message: Q.message
15988
15977
  }), g.dirty()) : Q.kind === "date" ? ct.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
15989
- code: l.invalid_string,
15978
+ code: d.invalid_string,
15990
15979
  validation: "date",
15991
15980
  message: Q.message
15992
15981
  }), g.dirty()) : Q.kind === "time" ? wt(Q).test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
15993
- code: l.invalid_string,
15982
+ code: d.invalid_string,
15994
15983
  validation: "time",
15995
15984
  message: Q.message
15996
15985
  }), g.dirty()) : Q.kind === "duration" ? st.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
15997
15986
  validation: "duration",
15998
- code: l.invalid_string,
15987
+ code: d.invalid_string,
15999
15988
  message: Q.message
16000
15989
  }), g.dirty()) : Q.kind === "ip" ? Ft(A.data, Q.version) || (B = this._getOrReturnCtx(A, B), Y(B, {
16001
15990
  validation: "ip",
16002
- code: l.invalid_string,
15991
+ code: d.invalid_string,
16003
15992
  message: Q.message
16004
15993
  }), g.dirty()) : Q.kind === "jwt" ? St(A.data, Q.alg) || (B = this._getOrReturnCtx(A, B), Y(B, {
16005
15994
  validation: "jwt",
16006
- code: l.invalid_string,
15995
+ code: d.invalid_string,
16007
15996
  message: Q.message
16008
15997
  }), g.dirty()) : Q.kind === "cidr" ? Nt(A.data, Q.version) || (B = this._getOrReturnCtx(A, B), Y(B, {
16009
15998
  validation: "cidr",
16010
- code: l.invalid_string,
15999
+ code: d.invalid_string,
16011
16000
  message: Q.message
16012
16001
  }), g.dirty()) : Q.kind === "base64" ? ht.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
16013
16002
  validation: "base64",
16014
- code: l.invalid_string,
16003
+ code: d.invalid_string,
16015
16004
  message: Q.message
16016
16005
  }), g.dirty()) : Q.kind === "base64url" ? yt.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
16017
16006
  validation: "base64url",
16018
- code: l.invalid_string,
16007
+ code: d.invalid_string,
16019
16008
  message: Q.message
16020
16009
  }), g.dirty()) : V.assertNever(Q);
16021
16010
  return { status: g.value, value: A.data };
@@ -16023,8 +16012,8 @@ class VA extends Z {
16023
16012
  _regex(A, I, g) {
16024
16013
  return this.refinement((B) => A.test(B), {
16025
16014
  validation: I,
16026
- code: l.invalid_string,
16027
- ...u.errToObj(g)
16015
+ code: d.invalid_string,
16016
+ ...K.errToObj(g)
16028
16017
  });
16029
16018
  }
16030
16019
  _addCheck(A) {
@@ -16034,46 +16023,46 @@ class VA extends Z {
16034
16023
  });
16035
16024
  }
16036
16025
  email(A) {
16037
- return this._addCheck({ kind: "email", ...u.errToObj(A) });
16026
+ return this._addCheck({ kind: "email", ...K.errToObj(A) });
16038
16027
  }
16039
16028
  url(A) {
16040
- return this._addCheck({ kind: "url", ...u.errToObj(A) });
16029
+ return this._addCheck({ kind: "url", ...K.errToObj(A) });
16041
16030
  }
16042
16031
  emoji(A) {
16043
- return this._addCheck({ kind: "emoji", ...u.errToObj(A) });
16032
+ return this._addCheck({ kind: "emoji", ...K.errToObj(A) });
16044
16033
  }
16045
16034
  uuid(A) {
16046
- return this._addCheck({ kind: "uuid", ...u.errToObj(A) });
16035
+ return this._addCheck({ kind: "uuid", ...K.errToObj(A) });
16047
16036
  }
16048
16037
  nanoid(A) {
16049
- return this._addCheck({ kind: "nanoid", ...u.errToObj(A) });
16038
+ return this._addCheck({ kind: "nanoid", ...K.errToObj(A) });
16050
16039
  }
16051
16040
  cuid(A) {
16052
- return this._addCheck({ kind: "cuid", ...u.errToObj(A) });
16041
+ return this._addCheck({ kind: "cuid", ...K.errToObj(A) });
16053
16042
  }
16054
16043
  cuid2(A) {
16055
- return this._addCheck({ kind: "cuid2", ...u.errToObj(A) });
16044
+ return this._addCheck({ kind: "cuid2", ...K.errToObj(A) });
16056
16045
  }
16057
16046
  ulid(A) {
16058
- return this._addCheck({ kind: "ulid", ...u.errToObj(A) });
16047
+ return this._addCheck({ kind: "ulid", ...K.errToObj(A) });
16059
16048
  }
16060
16049
  base64(A) {
16061
- return this._addCheck({ kind: "base64", ...u.errToObj(A) });
16050
+ return this._addCheck({ kind: "base64", ...K.errToObj(A) });
16062
16051
  }
16063
16052
  base64url(A) {
16064
16053
  return this._addCheck({
16065
16054
  kind: "base64url",
16066
- ...u.errToObj(A)
16055
+ ...K.errToObj(A)
16067
16056
  });
16068
16057
  }
16069
16058
  jwt(A) {
16070
- return this._addCheck({ kind: "jwt", ...u.errToObj(A) });
16059
+ return this._addCheck({ kind: "jwt", ...K.errToObj(A) });
16071
16060
  }
16072
16061
  ip(A) {
16073
- return this._addCheck({ kind: "ip", ...u.errToObj(A) });
16062
+ return this._addCheck({ kind: "ip", ...K.errToObj(A) });
16074
16063
  }
16075
16064
  cidr(A) {
16076
- return this._addCheck({ kind: "cidr", ...u.errToObj(A) });
16065
+ return this._addCheck({ kind: "cidr", ...K.errToObj(A) });
16077
16066
  }
16078
16067
  datetime(A) {
16079
16068
  return typeof A == "string" ? this._addCheck({
@@ -16087,7 +16076,7 @@ class VA extends Z {
16087
16076
  precision: typeof A?.precision > "u" ? null : A?.precision,
16088
16077
  offset: A?.offset ?? !1,
16089
16078
  local: A?.local ?? !1,
16090
- ...u.errToObj(A?.message)
16079
+ ...K.errToObj(A?.message)
16091
16080
  });
16092
16081
  }
16093
16082
  date(A) {
@@ -16101,17 +16090,17 @@ class VA extends Z {
16101
16090
  }) : this._addCheck({
16102
16091
  kind: "time",
16103
16092
  precision: typeof A?.precision > "u" ? null : A?.precision,
16104
- ...u.errToObj(A?.message)
16093
+ ...K.errToObj(A?.message)
16105
16094
  });
16106
16095
  }
16107
16096
  duration(A) {
16108
- return this._addCheck({ kind: "duration", ...u.errToObj(A) });
16097
+ return this._addCheck({ kind: "duration", ...K.errToObj(A) });
16109
16098
  }
16110
16099
  regex(A, I) {
16111
16100
  return this._addCheck({
16112
16101
  kind: "regex",
16113
16102
  regex: A,
16114
- ...u.errToObj(I)
16103
+ ...K.errToObj(I)
16115
16104
  });
16116
16105
  }
16117
16106
  includes(A, I) {
@@ -16119,49 +16108,49 @@ class VA extends Z {
16119
16108
  kind: "includes",
16120
16109
  value: A,
16121
16110
  position: I?.position,
16122
- ...u.errToObj(I?.message)
16111
+ ...K.errToObj(I?.message)
16123
16112
  });
16124
16113
  }
16125
16114
  startsWith(A, I) {
16126
16115
  return this._addCheck({
16127
16116
  kind: "startsWith",
16128
16117
  value: A,
16129
- ...u.errToObj(I)
16118
+ ...K.errToObj(I)
16130
16119
  });
16131
16120
  }
16132
16121
  endsWith(A, I) {
16133
16122
  return this._addCheck({
16134
16123
  kind: "endsWith",
16135
16124
  value: A,
16136
- ...u.errToObj(I)
16125
+ ...K.errToObj(I)
16137
16126
  });
16138
16127
  }
16139
16128
  min(A, I) {
16140
16129
  return this._addCheck({
16141
16130
  kind: "min",
16142
16131
  value: A,
16143
- ...u.errToObj(I)
16132
+ ...K.errToObj(I)
16144
16133
  });
16145
16134
  }
16146
16135
  max(A, I) {
16147
16136
  return this._addCheck({
16148
16137
  kind: "max",
16149
16138
  value: A,
16150
- ...u.errToObj(I)
16139
+ ...K.errToObj(I)
16151
16140
  });
16152
16141
  }
16153
16142
  length(A, I) {
16154
16143
  return this._addCheck({
16155
16144
  kind: "length",
16156
16145
  value: A,
16157
- ...u.errToObj(I)
16146
+ ...K.errToObj(I)
16158
16147
  });
16159
16148
  }
16160
16149
  /**
16161
16150
  * Equivalent to `.min(1)`
16162
16151
  */
16163
16152
  nonempty(A) {
16164
- return this.min(1, u.errToObj(A));
16153
+ return this.min(1, K.errToObj(A));
16165
16154
  }
16166
16155
  trim() {
16167
16156
  return new VA({
@@ -16260,54 +16249,54 @@ class cI extends Z {
16260
16249
  if (this._def.coerce && (A.data = Number(A.data)), this._getType(A) !== f.number) {
16261
16250
  const Q = this._getOrReturnCtx(A);
16262
16251
  return Y(Q, {
16263
- code: l.invalid_type,
16252
+ code: d.invalid_type,
16264
16253
  expected: f.number,
16265
16254
  received: Q.parsedType
16266
16255
  }), m;
16267
16256
  }
16268
16257
  let g;
16269
- const B = new kA();
16258
+ const B = new NA();
16270
16259
  for (const Q of this._def.checks)
16271
16260
  Q.kind === "int" ? V.isInteger(A.data) || (g = this._getOrReturnCtx(A, g), Y(g, {
16272
- code: l.invalid_type,
16261
+ code: d.invalid_type,
16273
16262
  expected: "integer",
16274
16263
  received: "float",
16275
16264
  message: Q.message
16276
16265
  }), B.dirty()) : Q.kind === "min" ? (Q.inclusive ? A.data < Q.value : A.data <= Q.value) && (g = this._getOrReturnCtx(A, g), Y(g, {
16277
- code: l.too_small,
16266
+ code: d.too_small,
16278
16267
  minimum: Q.value,
16279
16268
  type: "number",
16280
16269
  inclusive: Q.inclusive,
16281
16270
  exact: !1,
16282
16271
  message: Q.message
16283
16272
  }), B.dirty()) : Q.kind === "max" ? (Q.inclusive ? A.data > Q.value : A.data >= Q.value) && (g = this._getOrReturnCtx(A, g), Y(g, {
16284
- code: l.too_big,
16273
+ code: d.too_big,
16285
16274
  maximum: Q.value,
16286
16275
  type: "number",
16287
16276
  inclusive: Q.inclusive,
16288
16277
  exact: !1,
16289
16278
  message: Q.message
16290
16279
  }), B.dirty()) : Q.kind === "multipleOf" ? Rt(A.data, Q.value) !== 0 && (g = this._getOrReturnCtx(A, g), Y(g, {
16291
- code: l.not_multiple_of,
16280
+ code: d.not_multiple_of,
16292
16281
  multipleOf: Q.value,
16293
16282
  message: Q.message
16294
16283
  }), B.dirty()) : Q.kind === "finite" ? Number.isFinite(A.data) || (g = this._getOrReturnCtx(A, g), Y(g, {
16295
- code: l.not_finite,
16284
+ code: d.not_finite,
16296
16285
  message: Q.message
16297
16286
  }), B.dirty()) : V.assertNever(Q);
16298
16287
  return { status: B.value, value: A.data };
16299
16288
  }
16300
16289
  gte(A, I) {
16301
- return this.setLimit("min", A, !0, u.toString(I));
16290
+ return this.setLimit("min", A, !0, K.toString(I));
16302
16291
  }
16303
16292
  gt(A, I) {
16304
- return this.setLimit("min", A, !1, u.toString(I));
16293
+ return this.setLimit("min", A, !1, K.toString(I));
16305
16294
  }
16306
16295
  lte(A, I) {
16307
- return this.setLimit("max", A, !0, u.toString(I));
16296
+ return this.setLimit("max", A, !0, K.toString(I));
16308
16297
  }
16309
16298
  lt(A, I) {
16310
- return this.setLimit("max", A, !1, u.toString(I));
16299
+ return this.setLimit("max", A, !1, K.toString(I));
16311
16300
  }
16312
16301
  setLimit(A, I, g, B) {
16313
16302
  return new cI({
@@ -16318,7 +16307,7 @@ class cI extends Z {
16318
16307
  kind: A,
16319
16308
  value: I,
16320
16309
  inclusive: g,
16321
- message: u.toString(B)
16310
+ message: K.toString(B)
16322
16311
  }
16323
16312
  ]
16324
16313
  });
@@ -16332,7 +16321,7 @@ class cI extends Z {
16332
16321
  int(A) {
16333
16322
  return this._addCheck({
16334
16323
  kind: "int",
16335
- message: u.toString(A)
16324
+ message: K.toString(A)
16336
16325
  });
16337
16326
  }
16338
16327
  positive(A) {
@@ -16340,7 +16329,7 @@ class cI extends Z {
16340
16329
  kind: "min",
16341
16330
  value: 0,
16342
16331
  inclusive: !1,
16343
- message: u.toString(A)
16332
+ message: K.toString(A)
16344
16333
  });
16345
16334
  }
16346
16335
  negative(A) {
@@ -16348,7 +16337,7 @@ class cI extends Z {
16348
16337
  kind: "max",
16349
16338
  value: 0,
16350
16339
  inclusive: !1,
16351
- message: u.toString(A)
16340
+ message: K.toString(A)
16352
16341
  });
16353
16342
  }
16354
16343
  nonpositive(A) {
@@ -16356,7 +16345,7 @@ class cI extends Z {
16356
16345
  kind: "max",
16357
16346
  value: 0,
16358
16347
  inclusive: !0,
16359
- message: u.toString(A)
16348
+ message: K.toString(A)
16360
16349
  });
16361
16350
  }
16362
16351
  nonnegative(A) {
@@ -16364,20 +16353,20 @@ class cI extends Z {
16364
16353
  kind: "min",
16365
16354
  value: 0,
16366
16355
  inclusive: !0,
16367
- message: u.toString(A)
16356
+ message: K.toString(A)
16368
16357
  });
16369
16358
  }
16370
16359
  multipleOf(A, I) {
16371
16360
  return this._addCheck({
16372
16361
  kind: "multipleOf",
16373
16362
  value: A,
16374
- message: u.toString(I)
16363
+ message: K.toString(I)
16375
16364
  });
16376
16365
  }
16377
16366
  finite(A) {
16378
16367
  return this._addCheck({
16379
16368
  kind: "finite",
16380
- message: u.toString(A)
16369
+ message: K.toString(A)
16381
16370
  });
16382
16371
  }
16383
16372
  safe(A) {
@@ -16385,12 +16374,12 @@ class cI extends Z {
16385
16374
  kind: "min",
16386
16375
  inclusive: !0,
16387
16376
  value: Number.MIN_SAFE_INTEGER,
16388
- message: u.toString(A)
16377
+ message: K.toString(A)
16389
16378
  })._addCheck({
16390
16379
  kind: "max",
16391
16380
  inclusive: !0,
16392
16381
  value: Number.MAX_SAFE_INTEGER,
16393
- message: u.toString(A)
16382
+ message: K.toString(A)
16394
16383
  });
16395
16384
  }
16396
16385
  get minValue() {
@@ -16438,22 +16427,22 @@ class xI extends Z {
16438
16427
  if (this._getType(A) !== f.bigint)
16439
16428
  return this._getInvalidInput(A);
16440
16429
  let g;
16441
- const B = new kA();
16430
+ const B = new NA();
16442
16431
  for (const Q of this._def.checks)
16443
16432
  Q.kind === "min" ? (Q.inclusive ? A.data < Q.value : A.data <= Q.value) && (g = this._getOrReturnCtx(A, g), Y(g, {
16444
- code: l.too_small,
16433
+ code: d.too_small,
16445
16434
  type: "bigint",
16446
16435
  minimum: Q.value,
16447
16436
  inclusive: Q.inclusive,
16448
16437
  message: Q.message
16449
16438
  }), B.dirty()) : Q.kind === "max" ? (Q.inclusive ? A.data > Q.value : A.data >= Q.value) && (g = this._getOrReturnCtx(A, g), Y(g, {
16450
- code: l.too_big,
16439
+ code: d.too_big,
16451
16440
  type: "bigint",
16452
16441
  maximum: Q.value,
16453
16442
  inclusive: Q.inclusive,
16454
16443
  message: Q.message
16455
16444
  }), B.dirty()) : Q.kind === "multipleOf" ? A.data % Q.value !== BigInt(0) && (g = this._getOrReturnCtx(A, g), Y(g, {
16456
- code: l.not_multiple_of,
16445
+ code: d.not_multiple_of,
16457
16446
  multipleOf: Q.value,
16458
16447
  message: Q.message
16459
16448
  }), B.dirty()) : V.assertNever(Q);
@@ -16462,22 +16451,22 @@ class xI extends Z {
16462
16451
  _getInvalidInput(A) {
16463
16452
  const I = this._getOrReturnCtx(A);
16464
16453
  return Y(I, {
16465
- code: l.invalid_type,
16454
+ code: d.invalid_type,
16466
16455
  expected: f.bigint,
16467
16456
  received: I.parsedType
16468
16457
  }), m;
16469
16458
  }
16470
16459
  gte(A, I) {
16471
- return this.setLimit("min", A, !0, u.toString(I));
16460
+ return this.setLimit("min", A, !0, K.toString(I));
16472
16461
  }
16473
16462
  gt(A, I) {
16474
- return this.setLimit("min", A, !1, u.toString(I));
16463
+ return this.setLimit("min", A, !1, K.toString(I));
16475
16464
  }
16476
16465
  lte(A, I) {
16477
- return this.setLimit("max", A, !0, u.toString(I));
16466
+ return this.setLimit("max", A, !0, K.toString(I));
16478
16467
  }
16479
16468
  lt(A, I) {
16480
- return this.setLimit("max", A, !1, u.toString(I));
16469
+ return this.setLimit("max", A, !1, K.toString(I));
16481
16470
  }
16482
16471
  setLimit(A, I, g, B) {
16483
16472
  return new xI({
@@ -16488,7 +16477,7 @@ class xI extends Z {
16488
16477
  kind: A,
16489
16478
  value: I,
16490
16479
  inclusive: g,
16491
- message: u.toString(B)
16480
+ message: K.toString(B)
16492
16481
  }
16493
16482
  ]
16494
16483
  });
@@ -16504,7 +16493,7 @@ class xI extends Z {
16504
16493
  kind: "min",
16505
16494
  value: BigInt(0),
16506
16495
  inclusive: !1,
16507
- message: u.toString(A)
16496
+ message: K.toString(A)
16508
16497
  });
16509
16498
  }
16510
16499
  negative(A) {
@@ -16512,7 +16501,7 @@ class xI extends Z {
16512
16501
  kind: "max",
16513
16502
  value: BigInt(0),
16514
16503
  inclusive: !1,
16515
- message: u.toString(A)
16504
+ message: K.toString(A)
16516
16505
  });
16517
16506
  }
16518
16507
  nonpositive(A) {
@@ -16520,7 +16509,7 @@ class xI extends Z {
16520
16509
  kind: "max",
16521
16510
  value: BigInt(0),
16522
16511
  inclusive: !0,
16523
- message: u.toString(A)
16512
+ message: K.toString(A)
16524
16513
  });
16525
16514
  }
16526
16515
  nonnegative(A) {
@@ -16528,14 +16517,14 @@ class xI extends Z {
16528
16517
  kind: "min",
16529
16518
  value: BigInt(0),
16530
16519
  inclusive: !0,
16531
- message: u.toString(A)
16520
+ message: K.toString(A)
16532
16521
  });
16533
16522
  }
16534
16523
  multipleOf(A, I) {
16535
16524
  return this._addCheck({
16536
16525
  kind: "multipleOf",
16537
16526
  value: A,
16538
- message: u.toString(I)
16527
+ message: K.toString(I)
16539
16528
  });
16540
16529
  }
16541
16530
  get minValue() {
@@ -16562,12 +16551,12 @@ class eB extends Z {
16562
16551
  if (this._def.coerce && (A.data = !!A.data), this._getType(A) !== f.boolean) {
16563
16552
  const g = this._getOrReturnCtx(A);
16564
16553
  return Y(g, {
16565
- code: l.invalid_type,
16554
+ code: d.invalid_type,
16566
16555
  expected: f.boolean,
16567
16556
  received: g.parsedType
16568
16557
  }), m;
16569
16558
  }
16570
- return JA(A.data);
16559
+ return lA(A.data);
16571
16560
  }
16572
16561
  }
16573
16562
  eB.create = (C) => new eB({
@@ -16580,7 +16569,7 @@ class wg extends Z {
16580
16569
  if (this._def.coerce && (A.data = new Date(A.data)), this._getType(A) !== f.date) {
16581
16570
  const Q = this._getOrReturnCtx(A);
16582
16571
  return Y(Q, {
16583
- code: l.invalid_type,
16572
+ code: d.invalid_type,
16584
16573
  expected: f.date,
16585
16574
  received: Q.parsedType
16586
16575
  }), m;
@@ -16588,21 +16577,21 @@ class wg extends Z {
16588
16577
  if (Number.isNaN(A.data.getTime())) {
16589
16578
  const Q = this._getOrReturnCtx(A);
16590
16579
  return Y(Q, {
16591
- code: l.invalid_date
16580
+ code: d.invalid_date
16592
16581
  }), m;
16593
16582
  }
16594
- const g = new kA();
16583
+ const g = new NA();
16595
16584
  let B;
16596
16585
  for (const Q of this._def.checks)
16597
16586
  Q.kind === "min" ? A.data.getTime() < Q.value && (B = this._getOrReturnCtx(A, B), Y(B, {
16598
- code: l.too_small,
16587
+ code: d.too_small,
16599
16588
  message: Q.message,
16600
16589
  inclusive: !0,
16601
16590
  exact: !1,
16602
16591
  minimum: Q.value,
16603
16592
  type: "date"
16604
16593
  }), g.dirty()) : Q.kind === "max" ? A.data.getTime() > Q.value && (B = this._getOrReturnCtx(A, B), Y(B, {
16605
- code: l.too_big,
16594
+ code: d.too_big,
16606
16595
  message: Q.message,
16607
16596
  inclusive: !0,
16608
16597
  exact: !1,
@@ -16624,14 +16613,14 @@ class wg extends Z {
16624
16613
  return this._addCheck({
16625
16614
  kind: "min",
16626
16615
  value: A.getTime(),
16627
- message: u.toString(I)
16616
+ message: K.toString(I)
16628
16617
  });
16629
16618
  }
16630
16619
  max(A, I) {
16631
16620
  return this._addCheck({
16632
16621
  kind: "max",
16633
16622
  value: A.getTime(),
16634
- message: u.toString(I)
16623
+ message: K.toString(I)
16635
16624
  });
16636
16625
  }
16637
16626
  get minDate() {
@@ -16658,12 +16647,12 @@ class IQ extends Z {
16658
16647
  if (this._getType(A) !== f.symbol) {
16659
16648
  const g = this._getOrReturnCtx(A);
16660
16649
  return Y(g, {
16661
- code: l.invalid_type,
16650
+ code: d.invalid_type,
16662
16651
  expected: f.symbol,
16663
16652
  received: g.parsedType
16664
16653
  }), m;
16665
16654
  }
16666
- return JA(A.data);
16655
+ return lA(A.data);
16667
16656
  }
16668
16657
  }
16669
16658
  IQ.create = (C) => new IQ({
@@ -16675,12 +16664,12 @@ class gQ extends Z {
16675
16664
  if (this._getType(A) !== f.undefined) {
16676
16665
  const g = this._getOrReturnCtx(A);
16677
16666
  return Y(g, {
16678
- code: l.invalid_type,
16667
+ code: d.invalid_type,
16679
16668
  expected: f.undefined,
16680
16669
  received: g.parsedType
16681
16670
  }), m;
16682
16671
  }
16683
- return JA(A.data);
16672
+ return lA(A.data);
16684
16673
  }
16685
16674
  }
16686
16675
  gQ.create = (C) => new gQ({
@@ -16692,12 +16681,12 @@ class BQ extends Z {
16692
16681
  if (this._getType(A) !== f.null) {
16693
16682
  const g = this._getOrReturnCtx(A);
16694
16683
  return Y(g, {
16695
- code: l.invalid_type,
16684
+ code: d.invalid_type,
16696
16685
  expected: f.null,
16697
16686
  received: g.parsedType
16698
16687
  }), m;
16699
16688
  }
16700
- return JA(A.data);
16689
+ return lA(A.data);
16701
16690
  }
16702
16691
  }
16703
16692
  BQ.create = (C) => new BQ({
@@ -16709,7 +16698,7 @@ class nB extends Z {
16709
16698
  super(...arguments), this._any = !0;
16710
16699
  }
16711
16700
  _parse(A) {
16712
- return JA(A.data);
16701
+ return lA(A.data);
16713
16702
  }
16714
16703
  }
16715
16704
  nB.create = (C) => new nB({
@@ -16721,24 +16710,24 @@ class CQ extends Z {
16721
16710
  super(...arguments), this._unknown = !0;
16722
16711
  }
16723
16712
  _parse(A) {
16724
- return JA(A.data);
16713
+ return lA(A.data);
16725
16714
  }
16726
16715
  }
16727
16716
  CQ.create = (C) => new CQ({
16728
16717
  typeName: x.ZodUnknown,
16729
16718
  ...b(C)
16730
16719
  });
16731
- class $A extends Z {
16720
+ class zA extends Z {
16732
16721
  _parse(A) {
16733
16722
  const I = this._getOrReturnCtx(A);
16734
16723
  return Y(I, {
16735
- code: l.invalid_type,
16724
+ code: d.invalid_type,
16736
16725
  expected: f.never,
16737
16726
  received: I.parsedType
16738
16727
  }), m;
16739
16728
  }
16740
16729
  }
16741
- $A.create = (C) => new $A({
16730
+ zA.create = (C) => new zA({
16742
16731
  typeName: x.ZodNever,
16743
16732
  ...b(C)
16744
16733
  });
@@ -16747,12 +16736,12 @@ class QQ extends Z {
16747
16736
  if (this._getType(A) !== f.undefined) {
16748
16737
  const g = this._getOrReturnCtx(A);
16749
16738
  return Y(g, {
16750
- code: l.invalid_type,
16739
+ code: d.invalid_type,
16751
16740
  expected: f.void,
16752
16741
  received: g.parsedType
16753
16742
  }), m;
16754
16743
  }
16755
- return JA(A.data);
16744
+ return lA(A.data);
16756
16745
  }
16757
16746
  }
16758
16747
  QQ.create = (C) => new QQ({
@@ -16764,14 +16753,14 @@ class pA extends Z {
16764
16753
  const { ctx: I, status: g } = this._processInputParams(A), B = this._def;
16765
16754
  if (I.parsedType !== f.array)
16766
16755
  return Y(I, {
16767
- code: l.invalid_type,
16756
+ code: d.invalid_type,
16768
16757
  expected: f.array,
16769
16758
  received: I.parsedType
16770
16759
  }), m;
16771
16760
  if (B.exactLength !== null) {
16772
16761
  const E = I.data.length > B.exactLength.value, i = I.data.length < B.exactLength.value;
16773
16762
  (E || i) && (Y(I, {
16774
- code: E ? l.too_big : l.too_small,
16763
+ code: E ? d.too_big : d.too_small,
16775
16764
  minimum: i ? B.exactLength.value : void 0,
16776
16765
  maximum: E ? B.exactLength.value : void 0,
16777
16766
  type: "array",
@@ -16781,23 +16770,23 @@ class pA extends Z {
16781
16770
  }), g.dirty());
16782
16771
  }
16783
16772
  if (B.minLength !== null && I.data.length < B.minLength.value && (Y(I, {
16784
- code: l.too_small,
16773
+ code: d.too_small,
16785
16774
  minimum: B.minLength.value,
16786
16775
  type: "array",
16787
16776
  inclusive: !0,
16788
16777
  exact: !1,
16789
16778
  message: B.minLength.message
16790
16779
  }), g.dirty()), B.maxLength !== null && I.data.length > B.maxLength.value && (Y(I, {
16791
- code: l.too_big,
16780
+ code: d.too_big,
16792
16781
  maximum: B.maxLength.value,
16793
16782
  type: "array",
16794
16783
  inclusive: !0,
16795
16784
  exact: !1,
16796
16785
  message: B.maxLength.message
16797
16786
  }), g.dirty()), I.common.async)
16798
- return Promise.all([...I.data].map((E, i) => B.type._parseAsync(new zA(I, E, I.path, i)))).then((E) => kA.mergeArray(g, E));
16799
- const Q = [...I.data].map((E, i) => B.type._parseSync(new zA(I, E, I.path, i)));
16800
- return kA.mergeArray(g, Q);
16787
+ return Promise.all([...I.data].map((E, i) => B.type._parseAsync(new jA(I, E, I.path, i)))).then((E) => NA.mergeArray(g, E));
16788
+ const Q = [...I.data].map((E, i) => B.type._parseSync(new jA(I, E, I.path, i)));
16789
+ return NA.mergeArray(g, Q);
16801
16790
  }
16802
16791
  get element() {
16803
16792
  return this._def.type;
@@ -16805,19 +16794,19 @@ class pA extends Z {
16805
16794
  min(A, I) {
16806
16795
  return new pA({
16807
16796
  ...this._def,
16808
- minLength: { value: A, message: u.toString(I) }
16797
+ minLength: { value: A, message: K.toString(I) }
16809
16798
  });
16810
16799
  }
16811
16800
  max(A, I) {
16812
16801
  return new pA({
16813
16802
  ...this._def,
16814
- maxLength: { value: A, message: u.toString(I) }
16803
+ maxLength: { value: A, message: K.toString(I) }
16815
16804
  });
16816
16805
  }
16817
16806
  length(A, I) {
16818
16807
  return new pA({
16819
16808
  ...this._def,
16820
- exactLength: { value: A, message: u.toString(I) }
16809
+ exactLength: { value: A, message: K.toString(I) }
16821
16810
  });
16822
16811
  }
16823
16812
  nonempty(A) {
@@ -16832,12 +16821,12 @@ pA.create = (C, A) => new pA({
16832
16821
  typeName: x.ZodArray,
16833
16822
  ...b(A)
16834
16823
  });
16835
- function aI(C) {
16824
+ function tI(C) {
16836
16825
  if (C instanceof aA) {
16837
16826
  const A = {};
16838
16827
  for (const I in C.shape) {
16839
16828
  const g = C.shape[I];
16840
- A[I] = jA.create(aI(g));
16829
+ A[I] = XA.create(tI(g));
16841
16830
  }
16842
16831
  return new aA({
16843
16832
  ...C._def,
@@ -16845,8 +16834,8 @@ function aI(C) {
16845
16834
  });
16846
16835
  } else return C instanceof pA ? new pA({
16847
16836
  ...C._def,
16848
- type: aI(C.element)
16849
- }) : C instanceof jA ? jA.create(aI(C.unwrap())) : C instanceof FI ? FI.create(aI(C.unwrap())) : C instanceof iI ? iI.create(C.items.map((A) => aI(A))) : C;
16837
+ type: tI(C.element)
16838
+ }) : C instanceof XA ? XA.create(tI(C.unwrap())) : C instanceof FI ? FI.create(tI(C.unwrap())) : C instanceof EI ? EI.create(C.items.map((A) => tI(A))) : C;
16850
16839
  }
16851
16840
  class aA extends Z {
16852
16841
  constructor() {
@@ -16862,13 +16851,13 @@ class aA extends Z {
16862
16851
  if (this._getType(A) !== f.object) {
16863
16852
  const s = this._getOrReturnCtx(A);
16864
16853
  return Y(s, {
16865
- code: l.invalid_type,
16854
+ code: d.invalid_type,
16866
16855
  expected: f.object,
16867
16856
  received: s.parsedType
16868
16857
  }), m;
16869
16858
  }
16870
16859
  const { status: g, ctx: B } = this._processInputParams(A), { shape: Q, keys: E } = this._getCached(), i = [];
16871
- if (!(this._def.catchall instanceof $A && this._def.unknownKeys === "strip"))
16860
+ if (!(this._def.catchall instanceof zA && this._def.unknownKeys === "strip"))
16872
16861
  for (const s in B.data)
16873
16862
  E.includes(s) || i.push(s);
16874
16863
  const o = [];
@@ -16876,11 +16865,11 @@ class aA extends Z {
16876
16865
  const t = Q[s], a = B.data[s];
16877
16866
  o.push({
16878
16867
  key: { status: "valid", value: s },
16879
- value: t._parse(new zA(B, a, B.path, s)),
16868
+ value: t._parse(new jA(B, a, B.path, s)),
16880
16869
  alwaysSet: s in B.data
16881
16870
  });
16882
16871
  }
16883
- if (this._def.catchall instanceof $A) {
16872
+ if (this._def.catchall instanceof zA) {
16884
16873
  const s = this._def.unknownKeys;
16885
16874
  if (s === "passthrough")
16886
16875
  for (const t of i)
@@ -16890,7 +16879,7 @@ class aA extends Z {
16890
16879
  });
16891
16880
  else if (s === "strict")
16892
16881
  i.length > 0 && (Y(B, {
16893
- code: l.unrecognized_keys,
16882
+ code: d.unrecognized_keys,
16894
16883
  keys: i
16895
16884
  }), g.dirty());
16896
16885
  else if (s !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
@@ -16901,7 +16890,7 @@ class aA extends Z {
16901
16890
  o.push({
16902
16891
  key: { status: "valid", value: t },
16903
16892
  value: s._parse(
16904
- new zA(B, a, B.path, t)
16893
+ new jA(B, a, B.path, t)
16905
16894
  //, ctx.child(key), value, getParsedType(value)
16906
16895
  ),
16907
16896
  alwaysSet: t in B.data
@@ -16919,20 +16908,20 @@ class aA extends Z {
16919
16908
  });
16920
16909
  }
16921
16910
  return s;
16922
- }).then((s) => kA.mergeObjectSync(g, s)) : kA.mergeObjectSync(g, o);
16911
+ }).then((s) => NA.mergeObjectSync(g, s)) : NA.mergeObjectSync(g, o);
16923
16912
  }
16924
16913
  get shape() {
16925
16914
  return this._def.shape();
16926
16915
  }
16927
16916
  strict(A) {
16928
- return u.errToObj, new aA({
16917
+ return K.errToObj, new aA({
16929
16918
  ...this._def,
16930
16919
  unknownKeys: "strict",
16931
16920
  ...A !== void 0 ? {
16932
16921
  errorMap: (I, g) => {
16933
16922
  const B = this._def.errorMap?.(I, g).message ?? g.defaultError;
16934
16923
  return I.code === "unrecognized_keys" ? {
16935
- message: u.errToObj(A).message ?? B
16924
+ message: K.errToObj(A).message ?? B
16936
16925
  } : {
16937
16926
  message: B
16938
16927
  };
@@ -17081,7 +17070,7 @@ class aA extends Z {
17081
17070
  * @deprecated
17082
17071
  */
17083
17072
  deepPartial() {
17084
- return aI(this);
17073
+ return tI(this);
17085
17074
  }
17086
17075
  partial(A) {
17087
17076
  const I = {};
@@ -17101,7 +17090,7 @@ class aA extends Z {
17101
17090
  I[g] = this.shape[g];
17102
17091
  else {
17103
17092
  let Q = this.shape[g];
17104
- for (; Q instanceof jA; )
17093
+ for (; Q instanceof XA; )
17105
17094
  Q = Q._def.innerType;
17106
17095
  I[g] = Q;
17107
17096
  }
@@ -17117,21 +17106,21 @@ class aA extends Z {
17117
17106
  aA.create = (C, A) => new aA({
17118
17107
  shape: () => C,
17119
17108
  unknownKeys: "strip",
17120
- catchall: $A.create(),
17109
+ catchall: zA.create(),
17121
17110
  typeName: x.ZodObject,
17122
17111
  ...b(A)
17123
17112
  });
17124
17113
  aA.strictCreate = (C, A) => new aA({
17125
17114
  shape: () => C,
17126
17115
  unknownKeys: "strict",
17127
- catchall: $A.create(),
17116
+ catchall: zA.create(),
17128
17117
  typeName: x.ZodObject,
17129
17118
  ...b(A)
17130
17119
  });
17131
17120
  aA.lazycreate = (C, A) => new aA({
17132
17121
  shape: C,
17133
17122
  unknownKeys: "strip",
17134
- catchall: $A.create(),
17123
+ catchall: zA.create(),
17135
17124
  typeName: x.ZodObject,
17136
17125
  ...b(A)
17137
17126
  });
@@ -17147,7 +17136,7 @@ class Gg extends Z {
17147
17136
  return I.common.issues.push(...i.ctx.common.issues), i.result;
17148
17137
  const E = Q.map((i) => new vA(i.ctx.common.issues));
17149
17138
  return Y(I, {
17150
- code: l.invalid_union,
17139
+ code: d.invalid_union,
17151
17140
  unionErrors: E
17152
17141
  }), m;
17153
17142
  }
@@ -17194,7 +17183,7 @@ class Gg extends Z {
17194
17183
  return I.common.issues.push(...Q.ctx.common.issues), Q.result;
17195
17184
  const i = E.map((o) => new vA(o));
17196
17185
  return Y(I, {
17197
- code: l.invalid_union,
17186
+ code: d.invalid_union,
17198
17187
  unionErrors: i
17199
17188
  }), m;
17200
17189
  }
@@ -17241,7 +17230,7 @@ class Fg extends Z {
17241
17230
  return m;
17242
17231
  const i = rB(Q.value, E.value);
17243
17232
  return i.valid ? (($C(Q) || $C(E)) && I.dirty(), { status: I.value, value: i.data }) : (Y(g, {
17244
- code: l.invalid_intersection_types
17233
+ code: d.invalid_intersection_types
17245
17234
  }), m);
17246
17235
  };
17247
17236
  return g.common.async ? Promise.all([
@@ -17272,25 +17261,25 @@ Fg.create = (C, A, I) => new Fg({
17272
17261
  typeName: x.ZodIntersection,
17273
17262
  ...b(I)
17274
17263
  });
17275
- class iI extends Z {
17264
+ class EI extends Z {
17276
17265
  _parse(A) {
17277
17266
  const { status: I, ctx: g } = this._processInputParams(A);
17278
17267
  if (g.parsedType !== f.array)
17279
17268
  return Y(g, {
17280
- code: l.invalid_type,
17269
+ code: d.invalid_type,
17281
17270
  expected: f.array,
17282
17271
  received: g.parsedType
17283
17272
  }), m;
17284
17273
  if (g.data.length < this._def.items.length)
17285
17274
  return Y(g, {
17286
- code: l.too_small,
17275
+ code: d.too_small,
17287
17276
  minimum: this._def.items.length,
17288
17277
  inclusive: !0,
17289
17278
  exact: !1,
17290
17279
  type: "array"
17291
17280
  }), m;
17292
17281
  !this._def.rest && g.data.length > this._def.items.length && (Y(g, {
17293
- code: l.too_big,
17282
+ code: d.too_big,
17294
17283
  maximum: this._def.items.length,
17295
17284
  inclusive: !0,
17296
17285
  exact: !1,
@@ -17298,24 +17287,24 @@ class iI extends Z {
17298
17287
  }), I.dirty());
17299
17288
  const Q = [...g.data].map((E, i) => {
17300
17289
  const o = this._def.items[i] || this._def.rest;
17301
- return o ? o._parse(new zA(g, E, g.path, i)) : null;
17290
+ return o ? o._parse(new jA(g, E, g.path, i)) : null;
17302
17291
  }).filter((E) => !!E);
17303
- return g.common.async ? Promise.all(Q).then((E) => kA.mergeArray(I, E)) : kA.mergeArray(I, Q);
17292
+ return g.common.async ? Promise.all(Q).then((E) => NA.mergeArray(I, E)) : NA.mergeArray(I, Q);
17304
17293
  }
17305
17294
  get items() {
17306
17295
  return this._def.items;
17307
17296
  }
17308
17297
  rest(A) {
17309
- return new iI({
17298
+ return new EI({
17310
17299
  ...this._def,
17311
17300
  rest: A
17312
17301
  });
17313
17302
  }
17314
17303
  }
17315
- iI.create = (C, A) => {
17304
+ EI.create = (C, A) => {
17316
17305
  if (!Array.isArray(C))
17317
17306
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
17318
- return new iI({
17307
+ return new EI({
17319
17308
  items: C,
17320
17309
  typeName: x.ZodTuple,
17321
17310
  rest: null,
@@ -17333,13 +17322,13 @@ class EQ extends Z {
17333
17322
  const { status: I, ctx: g } = this._processInputParams(A);
17334
17323
  if (g.parsedType !== f.map)
17335
17324
  return Y(g, {
17336
- code: l.invalid_type,
17325
+ code: d.invalid_type,
17337
17326
  expected: f.map,
17338
17327
  received: g.parsedType
17339
17328
  }), m;
17340
17329
  const B = this._def.keyType, Q = this._def.valueType, E = [...g.data.entries()].map(([i, o], s) => ({
17341
- key: B._parse(new zA(g, i, g.path, [s, "key"])),
17342
- value: Q._parse(new zA(g, o, g.path, [s, "value"]))
17330
+ key: B._parse(new jA(g, i, g.path, [s, "key"])),
17331
+ value: Q._parse(new jA(g, o, g.path, [s, "value"]))
17343
17332
  }));
17344
17333
  if (g.common.async) {
17345
17334
  const i = /* @__PURE__ */ new Map();
@@ -17375,20 +17364,20 @@ class bI extends Z {
17375
17364
  const { status: I, ctx: g } = this._processInputParams(A);
17376
17365
  if (g.parsedType !== f.set)
17377
17366
  return Y(g, {
17378
- code: l.invalid_type,
17367
+ code: d.invalid_type,
17379
17368
  expected: f.set,
17380
17369
  received: g.parsedType
17381
17370
  }), m;
17382
17371
  const B = this._def;
17383
17372
  B.minSize !== null && g.data.size < B.minSize.value && (Y(g, {
17384
- code: l.too_small,
17373
+ code: d.too_small,
17385
17374
  minimum: B.minSize.value,
17386
17375
  type: "set",
17387
17376
  inclusive: !0,
17388
17377
  exact: !1,
17389
17378
  message: B.minSize.message
17390
17379
  }), I.dirty()), B.maxSize !== null && g.data.size > B.maxSize.value && (Y(g, {
17391
- code: l.too_big,
17380
+ code: d.too_big,
17392
17381
  maximum: B.maxSize.value,
17393
17382
  type: "set",
17394
17383
  inclusive: !0,
@@ -17405,19 +17394,19 @@ class bI extends Z {
17405
17394
  }
17406
17395
  return { status: I.value, value: s };
17407
17396
  }
17408
- const i = [...g.data.values()].map((o, s) => Q._parse(new zA(g, o, g.path, s)));
17397
+ const i = [...g.data.values()].map((o, s) => Q._parse(new jA(g, o, g.path, s)));
17409
17398
  return g.common.async ? Promise.all(i).then((o) => E(o)) : E(i);
17410
17399
  }
17411
17400
  min(A, I) {
17412
17401
  return new bI({
17413
17402
  ...this._def,
17414
- minSize: { value: A, message: u.toString(I) }
17403
+ minSize: { value: A, message: K.toString(I) }
17415
17404
  });
17416
17405
  }
17417
17406
  max(A, I) {
17418
17407
  return new bI({
17419
17408
  ...this._def,
17420
- maxSize: { value: A, message: u.toString(I) }
17409
+ maxSize: { value: A, message: K.toString(I) }
17421
17410
  });
17422
17411
  }
17423
17412
  size(A, I) {
@@ -17454,7 +17443,7 @@ class DB extends Z {
17454
17443
  const I = this._getOrReturnCtx(A);
17455
17444
  return Y(I, {
17456
17445
  received: I.data,
17457
- code: l.invalid_literal,
17446
+ code: d.invalid_literal,
17458
17447
  expected: this._def.value
17459
17448
  }), m;
17460
17449
  }
@@ -17483,18 +17472,18 @@ class wI extends Z {
17483
17472
  return Y(I, {
17484
17473
  expected: V.joinValues(g),
17485
17474
  received: I.parsedType,
17486
- code: l.invalid_type
17475
+ code: d.invalid_type
17487
17476
  }), m;
17488
17477
  }
17489
17478
  if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(A.data)) {
17490
17479
  const I = this._getOrReturnCtx(A), g = this._def.values;
17491
17480
  return Y(I, {
17492
17481
  received: I.data,
17493
- code: l.invalid_enum_value,
17482
+ code: d.invalid_enum_value,
17494
17483
  options: g
17495
17484
  }), m;
17496
17485
  }
17497
- return JA(A.data);
17486
+ return lA(A.data);
17498
17487
  }
17499
17488
  get options() {
17500
17489
  return this._def.values;
@@ -17539,18 +17528,18 @@ class oQ extends Z {
17539
17528
  return Y(g, {
17540
17529
  expected: V.joinValues(B),
17541
17530
  received: g.parsedType,
17542
- code: l.invalid_type
17531
+ code: d.invalid_type
17543
17532
  }), m;
17544
17533
  }
17545
17534
  if (this._cache || (this._cache = new Set(V.getValidEnumValues(this._def.values))), !this._cache.has(A.data)) {
17546
17535
  const B = V.objectValues(I);
17547
17536
  return Y(g, {
17548
17537
  received: g.data,
17549
- code: l.invalid_enum_value,
17538
+ code: d.invalid_enum_value,
17550
17539
  options: B
17551
17540
  }), m;
17552
17541
  }
17553
- return JA(A.data);
17542
+ return lA(A.data);
17554
17543
  }
17555
17544
  get enum() {
17556
17545
  return this._def.values;
@@ -17569,12 +17558,12 @@ class Sg extends Z {
17569
17558
  const { ctx: I } = this._processInputParams(A);
17570
17559
  if (I.parsedType !== f.promise && I.common.async === !1)
17571
17560
  return Y(I, {
17572
- code: l.invalid_type,
17561
+ code: d.invalid_type,
17573
17562
  expected: f.promise,
17574
17563
  received: I.parsedType
17575
17564
  }), m;
17576
17565
  const g = I.parsedType === f.promise ? I.data : Promise.resolve(I.data);
17577
- return JA(g.then((B) => this._def.type.parseAsync(B, {
17566
+ return lA(g.then((B) => this._def.type.parseAsync(B, {
17578
17567
  path: I.path,
17579
17568
  errorMap: I.common.contextualErrorMap
17580
17569
  })));
@@ -17677,22 +17666,22 @@ GI.createWithPreprocess = (C, A, I) => new GI({
17677
17666
  typeName: x.ZodEffects,
17678
17667
  ...b(I)
17679
17668
  });
17680
- class jA extends Z {
17669
+ class XA extends Z {
17681
17670
  _parse(A) {
17682
- return this._getType(A) === f.undefined ? JA(void 0) : this._def.innerType._parse(A);
17671
+ return this._getType(A) === f.undefined ? lA(void 0) : this._def.innerType._parse(A);
17683
17672
  }
17684
17673
  unwrap() {
17685
17674
  return this._def.innerType;
17686
17675
  }
17687
17676
  }
17688
- jA.create = (C, A) => new jA({
17677
+ XA.create = (C, A) => new XA({
17689
17678
  innerType: C,
17690
17679
  typeName: x.ZodOptional,
17691
17680
  ...b(A)
17692
17681
  });
17693
17682
  class FI extends Z {
17694
17683
  _parse(A) {
17695
- return this._getType(A) === f.null ? JA(null) : this._def.innerType._parse(A);
17684
+ return this._getType(A) === f.null ? lA(null) : this._def.innerType._parse(A);
17696
17685
  }
17697
17686
  unwrap() {
17698
17687
  return this._def.innerType;
@@ -17771,7 +17760,7 @@ class sQ extends Z {
17771
17760
  if (this._getType(A) !== f.nan) {
17772
17761
  const g = this._getOrReturnCtx(A);
17773
17762
  return Y(g, {
17774
- code: l.invalid_type,
17763
+ code: d.invalid_type,
17775
17764
  expected: f.nan,
17776
17765
  received: g.parsedType
17777
17766
  }), m;
@@ -17855,14 +17844,14 @@ var x;
17855
17844
  C.ZodString = "ZodString", C.ZodNumber = "ZodNumber", C.ZodNaN = "ZodNaN", C.ZodBigInt = "ZodBigInt", C.ZodBoolean = "ZodBoolean", C.ZodDate = "ZodDate", C.ZodSymbol = "ZodSymbol", C.ZodUndefined = "ZodUndefined", C.ZodNull = "ZodNull", C.ZodAny = "ZodAny", C.ZodUnknown = "ZodUnknown", C.ZodNever = "ZodNever", C.ZodVoid = "ZodVoid", C.ZodArray = "ZodArray", C.ZodObject = "ZodObject", C.ZodUnion = "ZodUnion", C.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", C.ZodIntersection = "ZodIntersection", C.ZodTuple = "ZodTuple", C.ZodRecord = "ZodRecord", C.ZodMap = "ZodMap", C.ZodSet = "ZodSet", C.ZodFunction = "ZodFunction", C.ZodLazy = "ZodLazy", C.ZodLiteral = "ZodLiteral", C.ZodEnum = "ZodEnum", C.ZodEffects = "ZodEffects", C.ZodNativeEnum = "ZodNativeEnum", C.ZodOptional = "ZodOptional", C.ZodNullable = "ZodNullable", C.ZodDefault = "ZodDefault", C.ZodCatch = "ZodCatch", C.ZodPromise = "ZodPromise", C.ZodBranded = "ZodBranded", C.ZodPipeline = "ZodPipeline", C.ZodReadonly = "ZodReadonly";
17856
17845
  })(x || (x = {}));
17857
17846
  const z = VA.create, T = cI.create, tE = eB.create, OA = nB.create;
17858
- $A.create;
17847
+ zA.create;
17859
17848
  const j = pA.create, q = aA.create;
17860
17849
  Gg.create;
17861
17850
  Fg.create;
17862
- iI.create;
17851
+ EI.create;
17863
17852
  const yA = DB.create, nI = wI.create;
17864
17853
  Sg.create;
17865
- jA.create;
17854
+ XA.create;
17866
17855
  FI.create;
17867
17856
  const Ut = q({
17868
17857
  /**The multiscale datasets for this image*/
@@ -18301,7 +18290,7 @@ function aE(C, A) {
18301
18290
  return delete I[A], I;
18302
18291
  }
18303
18292
  async function Fa(C, A) {
18304
- const I = new WI(C), g = new lA(I), B = SI(A), Q = await VI(g, B);
18293
+ const I = new WI(C), g = new UA(I), B = SI(A), Q = await VI(g, B);
18305
18294
  try {
18306
18295
  return Kt(Q.attrs);
18307
18296
  } catch {
@@ -18360,7 +18349,7 @@ function pt(C) {
18360
18349
  }
18361
18350
  }
18362
18351
  async function Sa(C, A, I) {
18363
- const g = C + "/" + A, B = new WI(g), Q = new lA(B), E = SI(I), i = await VI(Q, E);
18352
+ const g = C + "/" + A, B = new WI(g), Q = new UA(B), E = SI(I), i = await VI(Q, E);
18364
18353
  try {
18365
18354
  return pt(i.attrs);
18366
18355
  } catch {
@@ -18444,7 +18433,7 @@ class MI {
18444
18433
  getChannelCount() {
18445
18434
  return this.getDimensions().c?.lods[0].size ?? 1;
18446
18435
  }
18447
- getLoader() {
18436
+ get loader() {
18448
18437
  return this.loader_;
18449
18438
  }
18450
18439
  /**
@@ -18454,7 +18443,7 @@ class MI {
18454
18443
  * @param props.version OME-Zarr version
18455
18444
  */
18456
18445
  static async fromHttp(A) {
18457
- const I = new lA(new WI(A.url)), g = await MI.openLoader(I, A.version);
18446
+ const I = new UA(new WI(A.url)), g = await MI.openLoader(I, A.version);
18458
18447
  return new MI({ location: I, version: A.version, loader: g });
18459
18448
  }
18460
18449
  /**
@@ -18467,7 +18456,7 @@ class MI {
18467
18456
  * ask the user once for permission to the root directory
18468
18457
  */
18469
18458
  static async fromFileSystem(A) {
18470
- const I = new lA(
18459
+ const I = new UA(
18471
18460
  new _B(A.directory),
18472
18461
  A.path
18473
18462
  ), g = await MI.openLoader(I, A.version);
@@ -18626,9 +18615,9 @@ class Tt extends NI {
18626
18615
  const Wt = P(0, 1, 0);
18627
18616
  class vt {
18628
18617
  dirty_ = !0;
18629
- matrix_ = FA();
18618
+ matrix_ = SA();
18630
18619
  rotation_ = IB();
18631
- translation_ = EA();
18620
+ translation_ = QA();
18632
18621
  scale_ = P(1, 1, 1);
18633
18622
  addRotation(A) {
18634
18623
  Bi(this.rotation_, this.rotation_, A), this.dirty_ = !0;
@@ -18656,7 +18645,7 @@ class vt {
18656
18645
  }
18657
18646
  targetTo(A) {
18658
18647
  NB(this.translation_, A) && (A = bA(A), A[2] += AA);
18659
- const I = ZE(FA(), this.translation_, A, Wt), g = qE(GQ(), I);
18648
+ const I = ZE(SA(), this.translation_, A, Wt), g = qE(GQ(), I);
18660
18649
  SQ(this.rotation_, g), RB(this.rotation_, this.rotation_), this.dirty_ = !0;
18661
18650
  }
18662
18651
  get scale() {
@@ -18666,7 +18655,7 @@ class vt {
18666
18655
  return this.dirty_ && (this.computeMatrix(), this.dirty_ = !1), this.matrix_;
18667
18656
  }
18668
18657
  get inverse() {
18669
- return kg(FA(), this.matrix);
18658
+ return kg(SA(), this.matrix);
18670
18659
  }
18671
18660
  computeMatrix() {
18672
18661
  xE(
@@ -18838,14 +18827,14 @@ class nE extends NI {
18838
18827
  for (let D = 0; D < t; ++D) {
18839
18828
  const F = D * n;
18840
18829
  for (let U = 0; U < s; ++U) {
18841
- const S = U * a, d = U / i, K = D / o, k = [S, F, 0], R = [0, 0, 1], L = [d, K];
18830
+ const S = U * a, l = U / i, u = D / o, k = [S, F, 0], R = [0, 0, 1], L = [l, u];
18842
18831
  Q.push(...k, ...R, ...L);
18843
18832
  }
18844
18833
  }
18845
18834
  for (let D = 0; D < o; ++D)
18846
18835
  for (let F = 0; F < i; ++F) {
18847
- const U = F + s * D, S = F + s * (D + 1), d = F + 1 + s * (D + 1), K = F + 1 + s * D;
18848
- E.push(U, S, K), E.push(S, d, K);
18836
+ const U = F + s * D, S = F + s * (D + 1), l = F + 1 + s * (D + 1), u = F + 1 + s * D;
18837
+ E.push(U, S, u), E.push(S, l, u);
18849
18838
  }
18850
18839
  this.vertexData_ = new Float32Array(Q), this.indexData_ = new Uint32Array(E), this.addAttribute({
18851
18840
  type: "position",
@@ -19001,14 +18990,18 @@ class DE extends Jg {
19001
18990
  this.releaseAndRemoveChunks(this.visibleChunks_.keys()), this.clearObjects(), this.chunkStoreView_?.dispose(), this.chunkStoreView_ = void 0;
19002
18991
  }
19003
18992
  update(A) {
19004
- if (!(!A || !this.chunkStoreView_)) {
19005
- this.chunkStoreView_.updateChunksForImage(
19006
- this.sliceCoords_,
19007
- A.viewport
19008
- ), this.updateChunks();
19009
- for (const [I, g] of this.visibleChunks_)
19010
- g.zTexCoord = this.zTexCoordForChunk(I);
19011
- }
18993
+ if (!A || !this.chunkStoreView_) return;
18994
+ const I = A.camera;
18995
+ if (I.type !== "OrthographicCamera")
18996
+ throw new Error(
18997
+ "Image rendering currently supports only orthographic cameras. Update the implementation before using a perspective camera."
18998
+ );
18999
+ this.chunkStoreView_.updateChunksForImage(this.sliceCoords_, {
19000
+ worldViewRect: I.getWorldViewRect(),
19001
+ bufferWidthPx: A.getBufferRect().width
19002
+ }), this.updateChunks();
19003
+ for (const [g, B] of this.visibleChunks_)
19004
+ B.zTexCoord = this.zTexCoordForChunk(g);
19012
19005
  }
19013
19006
  updateChunks() {
19014
19007
  if (!this.chunkStoreView_ || (this.state !== "ready" && this.setState("ready"), this.visibleChunks_.size > 0 && !this.chunkStoreView_.allVisibleFallbackLODLoaded() && !this.isPresentationStale()))
@@ -19102,7 +19095,7 @@ class DE extends Jg {
19102
19095
  }
19103
19096
  async readValueFromChunk(A, I, g) {
19104
19097
  const B = SB(
19105
- EA(),
19098
+ QA(),
19106
19099
  g,
19107
19100
  I.transform.inverse
19108
19101
  ), Q = Math.floor(B[0]), E = Math.floor(B[1]);
@@ -19174,31 +19167,31 @@ class _t extends NI {
19174
19167
  });
19175
19168
  }
19176
19169
  buildFace(A, I, g, B, Q, E, i, o, s, t, a, n, D) {
19177
- const F = E / s, U = i / t, S = E / 2, d = i / 2, K = o / 2 * a, k = s + 1, R = t + 1, L = n.length / 8;
19170
+ const F = E / s, U = i / t, S = E / 2, l = i / 2, u = o / 2 * a, k = s + 1, R = t + 1, L = n.length / 8;
19178
19171
  for (let M = 0; M < R; M++) {
19179
- const W = -d + M * U;
19180
- for (let IA = 0; IA < k; IA++) {
19181
- const CA = -S + IA * F, $ = { x: 0, y: 0, z: 0 };
19182
- $[A] = CA * B, $[I] = W * Q, $[g] = K;
19183
- const gA = { x: 0, y: 0, z: 0 };
19184
- gA[g] = a;
19185
- const SA = IA / s, NA = 1 - M / t;
19172
+ const W = -l + M * U;
19173
+ for (let $ = 0; $ < k; $++) {
19174
+ const BA = -S + $ * F, IA = { x: 0, y: 0, z: 0 };
19175
+ IA[A] = BA * B, IA[I] = W * Q, IA[g] = u;
19176
+ const iA = { x: 0, y: 0, z: 0 };
19177
+ iA[g] = a;
19178
+ const fA = $ / s, uA = 1 - M / t;
19186
19179
  n.push(
19187
- $.x,
19188
- $.y,
19189
- $.z,
19190
- gA.x,
19191
- gA.y,
19192
- gA.z,
19193
- SA,
19194
- NA
19180
+ IA.x,
19181
+ IA.y,
19182
+ IA.z,
19183
+ iA.x,
19184
+ iA.y,
19185
+ iA.z,
19186
+ fA,
19187
+ uA
19195
19188
  );
19196
19189
  }
19197
19190
  }
19198
19191
  for (let M = 0; M < t; M++)
19199
19192
  for (let W = 0; W < s; W++) {
19200
- const IA = L + W + k * M, CA = L + W + k * (M + 1), $ = L + (W + 1) + k * (M + 1), gA = L + (W + 1) + k * M;
19201
- D.push(IA, CA, gA, CA, $, gA);
19193
+ const $ = L + W + k * M, BA = L + W + k * (M + 1), IA = L + (W + 1) + k * (M + 1), iA = L + (W + 1) + k * M;
19194
+ D.push($, BA, iA, BA, IA, iA);
19202
19195
  }
19203
19196
  }
19204
19197
  }
@@ -19324,7 +19317,7 @@ function jt(C) {
19324
19317
  }
19325
19318
  }
19326
19319
  function zt(C, A) {
19327
- const I = A.position, g = EA(), B = EA();
19320
+ const I = A.position, g = QA(), B = QA();
19328
19321
  return C.sort((Q, E) => {
19329
19322
  HI(g, Q.boundingBox.max, Q.boundingBox.min), qI(g, g, 0.5), HI(B, E.boundingBox.max, E.boundingBox.min), qI(B, B, 0.5);
19330
19323
  const i = sC(I, g), o = sC(I, B);
@@ -19440,7 +19433,7 @@ class Ua extends Jg {
19440
19433
  y: I.shape.y * I.scale.y,
19441
19434
  z: I.shape.z * I.scale.z
19442
19435
  };
19443
- A.transform.setScale([g.x, g.y, g.z]), II(A.voxelScale, I.scale.x, I.scale.y, I.scale.z);
19436
+ A.transform.setScale([g.x, g.y, g.z]), AI(A.voxelScale, I.scale.x, I.scale.y, I.scale.z);
19444
19437
  const B = {
19445
19438
  x: I.shape.x * I.scale.x / 2,
19446
19439
  y: I.shape.y * I.scale.y / 2,
@@ -19456,17 +19449,13 @@ class Ua extends Jg {
19456
19449
  A.clearLoadedChannels(), this.pool_.release(this.volumeToPoolKey_.get(A), A), this.volumeToPoolKey_.delete(A);
19457
19450
  }
19458
19451
  update(A) {
19459
- if (!this.chunkStoreView_) return;
19460
- if (A === void 0)
19461
- throw new Error(
19462
- "RenderContext is required for the VolumeLayer update as camera information is used to reorder the chunks."
19463
- );
19452
+ if (!A || !this.chunkStoreView_) return;
19464
19453
  this.chunkStoreView_.updateChunksForVolume(
19465
19454
  this.sliceCoords_,
19466
- A.viewport
19455
+ A.camera.getViewProjection()
19467
19456
  );
19468
- const I = A.viewport.cameraControls?.isMoving ?? !1;
19469
- this.interactiveStepSizeScale_ = I ? $t : 1, this.updateChunks(), zt(this.objects, A.viewport.camera);
19457
+ const I = A.cameraControls?.isMoving ?? !1;
19458
+ this.interactiveStepSizeScale_ = I ? $t : 1, this.updateChunks(), zt(this.objects, A.camera);
19470
19459
  }
19471
19460
  getUniforms() {
19472
19461
  return {
@@ -19669,14 +19658,18 @@ class hE extends Jg {
19669
19658
  this.releaseAndRemoveChunks(this.visibleChunks_.keys()), this.clearObjects(), this.chunkStoreView_?.dispose(), this.chunkStoreView_ = void 0;
19670
19659
  }
19671
19660
  update(A) {
19672
- if (!(!A || !this.chunkStoreView_)) {
19673
- this.chunkStoreView_.updateChunksForImage(
19674
- this.sliceCoords_,
19675
- A.viewport
19676
- ), this.updateChunks();
19677
- for (const [I, g] of this.visibleChunks_)
19678
- g.zTexCoord = this.zTexCoordForChunk(I);
19679
- }
19661
+ if (!A || !this.chunkStoreView_) return;
19662
+ const I = A.camera;
19663
+ if (I.type !== "OrthographicCamera")
19664
+ throw new Error(
19665
+ "Label rendering currently supports only orthographic cameras. Update the implementation before using a perspective camera."
19666
+ );
19667
+ this.chunkStoreView_.updateChunksForImage(this.sliceCoords_, {
19668
+ worldViewRect: I.getWorldViewRect(),
19669
+ bufferWidthPx: A.getBufferRect().width
19670
+ }), this.updateChunks();
19671
+ for (const [g, B] of this.visibleChunks_)
19672
+ B.zTexCoord = this.zTexCoordForChunk(g);
19680
19673
  }
19681
19674
  updateChunks() {
19682
19675
  if (!this.chunkStoreView_ || (this.state !== "ready" && this.setState("ready"), this.visibleChunks_.size > 0 && !this.chunkStoreView_.allVisibleFallbackLODLoaded() && !this.isPresentationStale()))
@@ -19752,7 +19745,7 @@ class hE extends Jg {
19752
19745
  }
19753
19746
  async readValueFromChunk(A, I, g) {
19754
19747
  const B = SB(
19755
- EA(),
19748
+ QA(),
19756
19749
  g,
19757
19750
  I.transform.inverse
19758
19751
  ), Q = Math.floor(B[0]), E = Math.floor(B[1]);
@@ -19939,9 +19932,9 @@ const jg = -1, nQ = 0, aa = 1, rQ = 9e-3, ea = 1e-3, na = 9e-4, ra = 0.5, Da = 6
19939
19932
  class la {
19940
19933
  camera_;
19941
19934
  orbitVelocity_ = new eQ(0, 0, 0);
19942
- panVelocity_ = EA();
19935
+ panVelocity_ = QA();
19943
19936
  currPos_;
19944
- currCenter_ = EA();
19937
+ currCenter_ = QA();
19945
19938
  dampingFactor_;
19946
19939
  currMouseButton_ = jg;
19947
19940
  constructor(A, I) {
@@ -20008,21 +20001,21 @@ class la {
20008
20001
  this.orbitVelocity_.phi -= A * rQ, this.orbitVelocity_.theta += I * rQ;
20009
20002
  }
20010
20003
  pan(A, I) {
20011
- const g = this.currPos_.radius * ea, B = EA();
20004
+ const g = this.currPos_.radius * ea, B = QA();
20012
20005
  oC(B, B, this.camera_.right, A), oC(B, B, this.camera_.up, I), qI(B, B, g), AB(this.panVelocity_, this.panVelocity_, B);
20013
20006
  }
20014
20007
  zoom(A) {
20015
20008
  this.orbitVelocity_.radius += A * na;
20016
20009
  }
20017
20010
  updateCamera() {
20018
- const A = HI(EA(), this.currCenter_, this.currPos_.toVec3());
20011
+ const A = HI(QA(), this.currCenter_, this.currPos_.toVec3());
20019
20012
  this.camera_.transform.setTranslation(A), this.camera_.transform.targetTo(this.currCenter_);
20020
20013
  }
20021
20014
  cutoffLowVelocity() {
20022
20015
  Math.abs(this.orbitVelocity_.phi) < AA && (this.orbitVelocity_.phi = 0), Math.abs(this.orbitVelocity_.theta) < AA && (this.orbitVelocity_.theta = 0), Math.abs(this.orbitVelocity_.radius) < AA && (this.orbitVelocity_.radius = 0), FB(this.panVelocity_) < AA && XE(this.panVelocity_);
20023
20016
  }
20024
20017
  }
20025
- class tI {
20018
+ class sI {
20026
20019
  normal;
20027
20020
  signedDistance;
20028
20021
  constructor(A = P(0, 1, 0), I = 0) {
@@ -20046,41 +20039,41 @@ class ha {
20046
20039
  planes_;
20047
20040
  constructor(A) {
20048
20041
  this.planes_ = [
20049
- new tI(EA(), 0),
20050
- new tI(EA(), 0),
20051
- new tI(EA(), 0),
20052
- new tI(EA(), 0),
20053
- new tI(EA(), 0),
20054
- new tI(EA(), 0)
20042
+ new sI(QA(), 0),
20043
+ new sI(QA(), 0),
20044
+ new sI(QA(), 0),
20045
+ new sI(QA(), 0),
20046
+ new sI(QA(), 0),
20047
+ new sI(QA(), 0)
20055
20048
  ], this.setWithViewProjection(A);
20056
20049
  }
20057
20050
  // Uses the fast plane-extraction algorithm described in
20058
20051
  // Gribb & Hartmann (1997): https://tinyurl.com/5x5htcwm
20059
20052
  setWithViewProjection(A) {
20060
- const I = EA();
20053
+ const I = QA();
20061
20054
  this.planes_[0].set(
20062
- II(I, A[3] + A[0], A[7] + A[4], A[11] + A[8]),
20055
+ AI(I, A[3] + A[0], A[7] + A[4], A[11] + A[8]),
20063
20056
  A[15] + A[12]
20064
20057
  ), this.planes_[1].set(
20065
- II(I, A[3] - A[0], A[7] - A[4], A[11] - A[8]),
20058
+ AI(I, A[3] - A[0], A[7] - A[4], A[11] - A[8]),
20066
20059
  A[15] - A[12]
20067
20060
  ), this.planes_[2].set(
20068
- II(I, A[3] - A[1], A[7] - A[5], A[11] - A[9]),
20061
+ AI(I, A[3] - A[1], A[7] - A[5], A[11] - A[9]),
20069
20062
  A[15] - A[13]
20070
20063
  ), this.planes_[3].set(
20071
- II(I, A[3] + A[1], A[7] + A[5], A[11] + A[9]),
20064
+ AI(I, A[3] + A[1], A[7] + A[5], A[11] + A[9]),
20072
20065
  A[15] + A[13]
20073
20066
  ), this.planes_[4].set(
20074
- II(I, A[3] + A[2], A[7] + A[6], A[11] + A[10]),
20067
+ AI(I, A[3] + A[2], A[7] + A[6], A[11] + A[10]),
20075
20068
  A[15] + A[14]
20076
20069
  ), this.planes_[5].set(
20077
- II(I, A[3] - A[2], A[7] - A[6], A[11] - A[10]),
20070
+ AI(I, A[3] - A[2], A[7] - A[6], A[11] - A[10]),
20078
20071
  A[15] - A[14]
20079
20072
  );
20080
20073
  for (const g of this.planes_) g.normalize();
20081
20074
  }
20082
20075
  intersectsWithBox3(A) {
20083
- const I = EA();
20076
+ const I = QA();
20084
20077
  for (const g of this.planes_) {
20085
20078
  const B = g.normal;
20086
20079
  if (I[0] = B[0] > 0 ? A.max[0] : A.min[0], I[1] = B[1] > 0 ? A.max[1] : A.min[1], I[2] = B[2] > 0 ? A.max[2] : A.min[2], g.signedDistanceToPoint(I) < 0) return !1;
@@ -20089,7 +20082,7 @@ class ha {
20089
20082
  }
20090
20083
  }
20091
20084
  class cE extends dI {
20092
- projectionMatrix_ = FA();
20085
+ projectionMatrix_ = SA();
20093
20086
  near_ = 0;
20094
20087
  far_ = 0;
20095
20088
  update() {
@@ -20109,10 +20102,11 @@ class cE extends dI {
20109
20102
  const A = this.transform.matrix;
20110
20103
  return P(A[4], A[5], A[6]);
20111
20104
  }
20105
+ getViewProjection() {
20106
+ return eI(SA(), this.projectionMatrix, this.viewMatrix);
20107
+ }
20112
20108
  get frustum() {
20113
- return new ha(
20114
- _A(FA(), this.projectionMatrix, this.viewMatrix)
20115
- );
20109
+ return new ha(this.getViewProjection());
20116
20110
  }
20117
20111
  pan(A) {
20118
20112
  this.transform.addTranslation(A);
@@ -20122,7 +20116,7 @@ class cE extends dI {
20122
20116
  }
20123
20117
  clipToWorld(A) {
20124
20118
  const I = Bg(A[0], A[1], A[2], 1), g = kg(
20125
- FA(),
20119
+ SA(),
20126
20120
  this.projectionMatrix_
20127
20121
  ), B = pI(
20128
20122
  rI(),
@@ -20170,12 +20164,8 @@ class La extends cE {
20170
20164
  }
20171
20165
  getWorldViewRect() {
20172
20166
  let A = Bg(-1, -1, 0, 1), I = Bg(1, 1, 0, 1);
20173
- const g = _A(
20174
- FA(),
20175
- this.projectionMatrix,
20176
- this.viewMatrix
20177
- ), B = kg(FA(), g);
20178
- return A = pI(rI(), A, B), I = pI(rI(), I, B), new GA(
20167
+ const g = kg(SA(), this.getViewProjection());
20168
+ return A = pI(rI(), A, g), I = pI(rI(), I, g), new GA(
20179
20169
  eA(A[0], A[1]),
20180
20170
  eA(I[0], I[1])
20181
20171
  );
@@ -20198,7 +20188,7 @@ const yQ = 0;
20198
20188
  class Ja {
20199
20189
  camera_;
20200
20190
  dragActive_ = !1;
20201
- dragStart_ = EA();
20191
+ dragStart_ = QA();
20202
20192
  constructor(A) {
20203
20193
  this.camera_ = A;
20204
20194
  }
@@ -20230,7 +20220,7 @@ class Ja {
20230
20220
  I.preventDefault();
20231
20221
  const g = bA(A.worldPos), B = I.deltaY < 0 ? 1.05 : 0.95;
20232
20222
  this.camera_.zoom(B);
20233
- const Q = this.camera_.clipToWorld(A.clipPos), E = AB(EA(), g, Q);
20223
+ const Q = this.camera_.clipToWorld(A.clipPos), E = AB(QA(), g, Q);
20234
20224
  this.camera_.pan(E);
20235
20225
  }
20236
20226
  onPointerDown(A) {
@@ -20239,7 +20229,7 @@ class Ja {
20239
20229
  }
20240
20230
  onPointerMove(A) {
20241
20231
  if (!this.dragActive_ || !A.worldPos) return;
20242
- const I = AB(EA(), this.dragStart_, A.worldPos);
20232
+ const I = AB(QA(), this.dragStart_, A.worldPos);
20243
20233
  this.camera_.pan(I);
20244
20234
  }
20245
20235
  onPointerEnd(A) {