@qispace/vue3-player 0.4.50 → 0.4.51

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.
@@ -11145,7 +11145,7 @@ function WS() {
11145
11145
  }, radToDeg: function(o) {
11146
11146
  return o * _t;
11147
11147
  }, isPowerOfTwo: Jn, ceilPowerOfTwo: ni, floorPowerOfTwo: ur, setQuaternionFromProperEuler: function(o, A, e, i, n) {
11148
- const a = Math.cos, g = Math.sin, I = a(e / 2), u = g(e / 2), c = a((A + i) / 2), C = g((A + i) / 2), f = a((A - i) / 2), m = g((A - i) / 2), M = a((i - A) / 2), F = g((i - A) / 2);
11148
+ const a = Math.cos, g = Math.sin, I = a(e / 2), u = g(e / 2), c = a((A + i) / 2), C = g((A + i) / 2), f = a((A - i) / 2), m = g((A - i) / 2), M = a((i - A) / 2), L = g((i - A) / 2);
11149
11149
  switch (n) {
11150
11150
  case "XYX":
11151
11151
  o.set(I * C, u * f, u * m, I * c);
@@ -11157,13 +11157,13 @@ function WS() {
11157
11157
  o.set(u * f, u * m, I * C, I * c);
11158
11158
  break;
11159
11159
  case "XZX":
11160
- o.set(I * C, u * F, u * M, I * c);
11160
+ o.set(I * C, u * L, u * M, I * c);
11161
11161
  break;
11162
11162
  case "YXY":
11163
- o.set(u * M, I * C, u * F, I * c);
11163
+ o.set(u * M, I * C, u * L, I * c);
11164
11164
  break;
11165
11165
  case "ZYZ":
11166
- o.set(u * F, u * M, I * C, I * c);
11166
+ o.set(u * L, u * M, I * C, I * c);
11167
11167
  }
11168
11168
  }, normalize: St, denormalize: Wi };
11169
11169
  class Te {
@@ -11389,8 +11389,8 @@ function WS() {
11389
11389
  return this.multiplyMatrices(A, this);
11390
11390
  }
11391
11391
  multiplyMatrices(A, e) {
11392
- const i = A.elements, n = e.elements, a = this.elements, g = i[0], I = i[3], u = i[6], c = i[1], C = i[4], f = i[7], m = i[2], M = i[5], F = i[8], N = n[0], R = n[3], G = n[6], _ = n[1], L = n[4], rA = n[7], tA = n[2], eA = n[5], QA = n[8];
11393
- return a[0] = g * N + I * _ + u * tA, a[3] = g * R + I * L + u * eA, a[6] = g * G + I * rA + u * QA, a[1] = c * N + C * _ + f * tA, a[4] = c * R + C * L + f * eA, a[7] = c * G + C * rA + f * QA, a[2] = m * N + M * _ + F * tA, a[5] = m * R + M * L + F * eA, a[8] = m * G + M * rA + F * QA, this;
11392
+ const i = A.elements, n = e.elements, a = this.elements, g = i[0], I = i[3], u = i[6], c = i[1], C = i[4], f = i[7], m = i[2], M = i[5], L = i[8], G = n[0], _ = n[3], N = n[6], R = n[1], F = n[4], rA = n[7], tA = n[2], eA = n[5], QA = n[8];
11393
+ return a[0] = g * G + I * R + u * tA, a[3] = g * _ + I * F + u * eA, a[6] = g * N + I * rA + u * QA, a[1] = c * G + C * R + f * tA, a[4] = c * _ + C * F + f * eA, a[7] = c * N + C * rA + f * QA, a[2] = m * G + M * R + L * tA, a[5] = m * _ + M * F + L * eA, a[8] = m * N + M * rA + L * QA, this;
11394
11394
  }
11395
11395
  multiplyScalar(A) {
11396
11396
  const e = this.elements;
@@ -11401,10 +11401,10 @@ function WS() {
11401
11401
  return e * g * C - e * I * c - i * a * C + i * I * u + n * a * c - n * g * u;
11402
11402
  }
11403
11403
  invert() {
11404
- const A = this.elements, e = A[0], i = A[1], n = A[2], a = A[3], g = A[4], I = A[5], u = A[6], c = A[7], C = A[8], f = C * g - I * c, m = I * u - C * a, M = c * a - g * u, F = e * f + i * m + n * M;
11405
- if (F === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
11406
- const N = 1 / F;
11407
- return A[0] = f * N, A[1] = (n * c - C * i) * N, A[2] = (I * i - n * g) * N, A[3] = m * N, A[4] = (C * e - n * u) * N, A[5] = (n * a - I * e) * N, A[6] = M * N, A[7] = (i * u - c * e) * N, A[8] = (g * e - i * a) * N, this;
11404
+ const A = this.elements, e = A[0], i = A[1], n = A[2], a = A[3], g = A[4], I = A[5], u = A[6], c = A[7], C = A[8], f = C * g - I * c, m = I * u - C * a, M = c * a - g * u, L = e * f + i * m + n * M;
11405
+ if (L === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
11406
+ const G = 1 / L;
11407
+ return A[0] = f * G, A[1] = (n * c - C * i) * G, A[2] = (I * i - n * g) * G, A[3] = m * G, A[4] = (C * e - n * u) * G, A[5] = (n * a - I * e) * G, A[6] = M * G, A[7] = (i * u - c * e) * G, A[8] = (g * e - i * a) * G, this;
11408
11408
  }
11409
11409
  transpose() {
11410
11410
  let A;
@@ -11731,15 +11731,15 @@ function WS() {
11731
11731
  }
11732
11732
  setAxisAngleFromRotationMatrix(A) {
11733
11733
  let e, i, n, a;
11734
- const u = A.elements, c = u[0], C = u[4], f = u[8], m = u[1], M = u[5], F = u[9], N = u[2], R = u[6], G = u[10];
11735
- if (Math.abs(C - m) < 0.01 && Math.abs(f - N) < 0.01 && Math.abs(F - R) < 0.01) {
11736
- if (Math.abs(C + m) < 0.1 && Math.abs(f + N) < 0.1 && Math.abs(F + R) < 0.1 && Math.abs(c + M + G - 3) < 0.1) return this.set(1, 0, 0, 0), this;
11734
+ const u = A.elements, c = u[0], C = u[4], f = u[8], m = u[1], M = u[5], L = u[9], G = u[2], _ = u[6], N = u[10];
11735
+ if (Math.abs(C - m) < 0.01 && Math.abs(f - G) < 0.01 && Math.abs(L - _) < 0.01) {
11736
+ if (Math.abs(C + m) < 0.1 && Math.abs(f + G) < 0.1 && Math.abs(L + _) < 0.1 && Math.abs(c + M + N - 3) < 0.1) return this.set(1, 0, 0, 0), this;
11737
11737
  e = Math.PI;
11738
- const L = (c + 1) / 2, rA = (M + 1) / 2, tA = (G + 1) / 2, eA = (C + m) / 4, QA = (f + N) / 4, bA = (F + R) / 4;
11739
- return L > rA && L > tA ? L < 0.01 ? (i = 0, n = 0.707106781, a = 0.707106781) : (i = Math.sqrt(L), n = eA / i, a = QA / i) : rA > tA ? rA < 0.01 ? (i = 0.707106781, n = 0, a = 0.707106781) : (n = Math.sqrt(rA), i = eA / n, a = bA / n) : tA < 0.01 ? (i = 0.707106781, n = 0.707106781, a = 0) : (a = Math.sqrt(tA), i = QA / a, n = bA / a), this.set(i, n, a, e), this;
11738
+ const F = (c + 1) / 2, rA = (M + 1) / 2, tA = (N + 1) / 2, eA = (C + m) / 4, QA = (f + G) / 4, bA = (L + _) / 4;
11739
+ return F > rA && F > tA ? F < 0.01 ? (i = 0, n = 0.707106781, a = 0.707106781) : (i = Math.sqrt(F), n = eA / i, a = QA / i) : rA > tA ? rA < 0.01 ? (i = 0.707106781, n = 0, a = 0.707106781) : (n = Math.sqrt(rA), i = eA / n, a = bA / n) : tA < 0.01 ? (i = 0.707106781, n = 0.707106781, a = 0) : (a = Math.sqrt(tA), i = QA / a, n = bA / a), this.set(i, n, a, e), this;
11740
11740
  }
11741
- let _ = Math.sqrt((R - F) * (R - F) + (f - N) * (f - N) + (m - C) * (m - C));
11742
- return Math.abs(_) < 1e-3 && (_ = 1), this.x = (R - F) / _, this.y = (f - N) / _, this.z = (m - C) / _, this.w = Math.acos((c + M + G - 1) / 2), this;
11741
+ let R = Math.sqrt((_ - L) * (_ - L) + (f - G) * (f - G) + (m - C) * (m - C));
11742
+ return Math.abs(R) < 1e-3 && (R = 1), this.x = (_ - L) / R, this.y = (f - G) / R, this.z = (m - C) / R, this.w = Math.acos((c + M + N - 1) / 2), this;
11743
11743
  }
11744
11744
  min(A) {
11745
11745
  return this.x = Math.min(this.x, A.x), this.y = Math.min(this.y, A.y), this.z = Math.min(this.z, A.z), this.w = Math.min(this.w, A.w), this;
@@ -11852,18 +11852,18 @@ function WS() {
11852
11852
  }
11853
11853
  static slerpFlat(A, e, i, n, a, g, I) {
11854
11854
  let u = i[n + 0], c = i[n + 1], C = i[n + 2], f = i[n + 3];
11855
- const m = a[g + 0], M = a[g + 1], F = a[g + 2], N = a[g + 3];
11855
+ const m = a[g + 0], M = a[g + 1], L = a[g + 2], G = a[g + 3];
11856
11856
  if (I === 0) return A[e + 0] = u, A[e + 1] = c, A[e + 2] = C, void (A[e + 3] = f);
11857
- if (I === 1) return A[e + 0] = m, A[e + 1] = M, A[e + 2] = F, void (A[e + 3] = N);
11858
- if (f !== N || u !== m || c !== M || C !== F) {
11859
- let R = 1 - I;
11860
- const G = u * m + c * M + C * F + f * N, _ = G >= 0 ? 1 : -1, L = 1 - G * G;
11861
- if (L > Number.EPSILON) {
11862
- const tA = Math.sqrt(L), eA = Math.atan2(tA, G * _);
11863
- R = Math.sin(R * eA) / tA, I = Math.sin(I * eA) / tA;
11864
- }
11865
- const rA = I * _;
11866
- if (u = u * R + m * rA, c = c * R + M * rA, C = C * R + F * rA, f = f * R + N * rA, R === 1 - I) {
11857
+ if (I === 1) return A[e + 0] = m, A[e + 1] = M, A[e + 2] = L, void (A[e + 3] = G);
11858
+ if (f !== G || u !== m || c !== M || C !== L) {
11859
+ let _ = 1 - I;
11860
+ const N = u * m + c * M + C * L + f * G, R = N >= 0 ? 1 : -1, F = 1 - N * N;
11861
+ if (F > Number.EPSILON) {
11862
+ const tA = Math.sqrt(F), eA = Math.atan2(tA, N * R);
11863
+ _ = Math.sin(_ * eA) / tA, I = Math.sin(I * eA) / tA;
11864
+ }
11865
+ const rA = I * R;
11866
+ if (u = u * _ + m * rA, c = c * _ + M * rA, C = C * _ + L * rA, f = f * _ + G * rA, _ === 1 - I) {
11867
11867
  const tA = 1 / Math.sqrt(u * u + c * c + C * C + f * f);
11868
11868
  u *= tA, c *= tA, C *= tA, f *= tA;
11869
11869
  }
@@ -11871,8 +11871,8 @@ function WS() {
11871
11871
  A[e] = u, A[e + 1] = c, A[e + 2] = C, A[e + 3] = f;
11872
11872
  }
11873
11873
  static multiplyQuaternionsFlat(A, e, i, n, a, g) {
11874
- const I = i[n], u = i[n + 1], c = i[n + 2], C = i[n + 3], f = a[g], m = a[g + 1], M = a[g + 2], F = a[g + 3];
11875
- return A[e] = I * F + C * f + u * M - c * m, A[e + 1] = u * F + C * m + c * f - I * M, A[e + 2] = c * F + C * M + I * m - u * f, A[e + 3] = C * F - I * f - u * m - c * M, A;
11874
+ const I = i[n], u = i[n + 1], c = i[n + 2], C = i[n + 3], f = a[g], m = a[g + 1], M = a[g + 2], L = a[g + 3];
11875
+ return A[e] = I * L + C * f + u * M - c * m, A[e + 1] = u * L + C * m + c * f - I * M, A[e + 2] = c * L + C * M + I * m - u * f, A[e + 3] = C * L - I * f - u * m - c * M, A;
11876
11876
  }
11877
11877
  get x() {
11878
11878
  return this._x;
@@ -11908,25 +11908,25 @@ function WS() {
11908
11908
  return this._x = A.x, this._y = A.y, this._z = A.z, this._w = A.w, this._onChangeCallback(), this;
11909
11909
  }
11910
11910
  setFromEuler(A, e) {
11911
- const i = A._x, n = A._y, a = A._z, g = A._order, I = Math.cos, u = Math.sin, c = I(i / 2), C = I(n / 2), f = I(a / 2), m = u(i / 2), M = u(n / 2), F = u(a / 2);
11911
+ const i = A._x, n = A._y, a = A._z, g = A._order, I = Math.cos, u = Math.sin, c = I(i / 2), C = I(n / 2), f = I(a / 2), m = u(i / 2), M = u(n / 2), L = u(a / 2);
11912
11912
  switch (g) {
11913
11913
  case "XYZ":
11914
- this._x = m * C * f + c * M * F, this._y = c * M * f - m * C * F, this._z = c * C * F + m * M * f, this._w = c * C * f - m * M * F;
11914
+ this._x = m * C * f + c * M * L, this._y = c * M * f - m * C * L, this._z = c * C * L + m * M * f, this._w = c * C * f - m * M * L;
11915
11915
  break;
11916
11916
  case "YXZ":
11917
- this._x = m * C * f + c * M * F, this._y = c * M * f - m * C * F, this._z = c * C * F - m * M * f, this._w = c * C * f + m * M * F;
11917
+ this._x = m * C * f + c * M * L, this._y = c * M * f - m * C * L, this._z = c * C * L - m * M * f, this._w = c * C * f + m * M * L;
11918
11918
  break;
11919
11919
  case "ZXY":
11920
- this._x = m * C * f - c * M * F, this._y = c * M * f + m * C * F, this._z = c * C * F + m * M * f, this._w = c * C * f - m * M * F;
11920
+ this._x = m * C * f - c * M * L, this._y = c * M * f + m * C * L, this._z = c * C * L + m * M * f, this._w = c * C * f - m * M * L;
11921
11921
  break;
11922
11922
  case "ZYX":
11923
- this._x = m * C * f - c * M * F, this._y = c * M * f + m * C * F, this._z = c * C * F - m * M * f, this._w = c * C * f + m * M * F;
11923
+ this._x = m * C * f - c * M * L, this._y = c * M * f + m * C * L, this._z = c * C * L - m * M * f, this._w = c * C * f + m * M * L;
11924
11924
  break;
11925
11925
  case "YZX":
11926
- this._x = m * C * f + c * M * F, this._y = c * M * f + m * C * F, this._z = c * C * F - m * M * f, this._w = c * C * f - m * M * F;
11926
+ this._x = m * C * f + c * M * L, this._y = c * M * f + m * C * L, this._z = c * C * L - m * M * f, this._w = c * C * f - m * M * L;
11927
11927
  break;
11928
11928
  case "XZY":
11929
- this._x = m * C * f - c * M * F, this._y = c * M * f - m * C * F, this._z = c * C * F + m * M * f, this._w = c * C * f + m * M * F;
11929
+ this._x = m * C * f - c * M * L, this._y = c * M * f - m * C * L, this._z = c * C * L + m * M * f, this._w = c * C * f + m * M * L;
11930
11930
  }
11931
11931
  return e !== !1 && this._onChangeCallback(), this;
11932
11932
  }
@@ -12544,13 +12544,13 @@ function WS() {
12544
12544
  distanceSqToSegment(A, e, i, n) {
12545
12545
  ac.copy(A).add(e).multiplyScalar(0.5), og.copy(e).sub(A).normalize(), Zr.copy(this.origin).sub(ac);
12546
12546
  const a = 0.5 * A.distanceTo(e), g = -this.direction.dot(og), I = Zr.dot(this.direction), u = -Zr.dot(og), c = Zr.lengthSq(), C = Math.abs(1 - g * g);
12547
- let f, m, M, F;
12548
- if (C > 0) if (f = g * u - I, m = g * I - u, F = a * C, f >= 0) if (m >= -F) if (m <= F) {
12549
- const N = 1 / C;
12550
- f *= N, m *= N, M = f * (f + g * m + 2 * I) + m * (g * f + m + 2 * u) + c;
12547
+ let f, m, M, L;
12548
+ if (C > 0) if (f = g * u - I, m = g * I - u, L = a * C, f >= 0) if (m >= -L) if (m <= L) {
12549
+ const G = 1 / C;
12550
+ f *= G, m *= G, M = f * (f + g * m + 2 * I) + m * (g * f + m + 2 * u) + c;
12551
12551
  } else m = a, f = Math.max(0, -(g * m + I)), M = -f * f + m * (m + 2 * u) + c;
12552
12552
  else m = -a, f = Math.max(0, -(g * m + I)), M = -f * f + m * (m + 2 * u) + c;
12553
- else m <= -F ? (f = Math.max(0, -(-g * a + I)), m = f > 0 ? -a : Math.min(Math.max(-a, -u), a), M = -f * f + m * (m + 2 * u) + c) : m <= F ? (f = 0, m = Math.min(Math.max(-a, -u), a), M = m * (m + 2 * u) + c) : (f = Math.max(0, -(g * a + I)), m = f > 0 ? a : Math.min(Math.max(-a, -u), a), M = -f * f + m * (m + 2 * u) + c);
12553
+ else m <= -L ? (f = Math.max(0, -(-g * a + I)), m = f > 0 ? -a : Math.min(Math.max(-a, -u), a), M = -f * f + m * (m + 2 * u) + c) : m <= L ? (f = 0, m = Math.min(Math.max(-a, -u), a), M = m * (m + 2 * u) + c) : (f = Math.max(0, -(g * a + I)), m = f > 0 ? a : Math.min(Math.max(-a, -u), a), M = -f * f + m * (m + 2 * u) + c);
12554
12554
  else m = g > 0 ? -a : a, f = Math.max(0, -(g * m + I)), M = -f * f + m * (m + 2 * u) + c;
12555
12555
  return i && i.copy(this.origin).addScaledVector(this.direction, f), n && n.copy(ac).addScaledVector(og, m), M;
12556
12556
  }
@@ -12618,9 +12618,9 @@ function WS() {
12618
12618
  constructor() {
12619
12619
  xt.prototype.isMatrix4 = !0, this.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
12620
12620
  }
12621
- set(A, e, i, n, a, g, I, u, c, C, f, m, M, F, N, R) {
12622
- const G = this.elements;
12623
- return G[0] = A, G[4] = e, G[8] = i, G[12] = n, G[1] = a, G[5] = g, G[9] = I, G[13] = u, G[2] = c, G[6] = C, G[10] = f, G[14] = m, G[3] = M, G[7] = F, G[11] = N, G[15] = R, this;
12621
+ set(A, e, i, n, a, g, I, u, c, C, f, m, M, L, G, _) {
12622
+ const N = this.elements;
12623
+ return N[0] = A, N[4] = e, N[8] = i, N[12] = n, N[1] = a, N[5] = g, N[9] = I, N[13] = u, N[2] = c, N[6] = C, N[10] = f, N[14] = m, N[3] = M, N[7] = L, N[11] = G, N[15] = _, this;
12624
12624
  }
12625
12625
  identity() {
12626
12626
  return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this;
@@ -12653,23 +12653,23 @@ function WS() {
12653
12653
  makeRotationFromEuler(A) {
12654
12654
  const e = this.elements, i = A.x, n = A.y, a = A.z, g = Math.cos(i), I = Math.sin(i), u = Math.cos(n), c = Math.sin(n), C = Math.cos(a), f = Math.sin(a);
12655
12655
  if (A.order === "XYZ") {
12656
- const m = g * C, M = g * f, F = I * C, N = I * f;
12657
- e[0] = u * C, e[4] = -u * f, e[8] = c, e[1] = M + F * c, e[5] = m - N * c, e[9] = -I * u, e[2] = N - m * c, e[6] = F + M * c, e[10] = g * u;
12656
+ const m = g * C, M = g * f, L = I * C, G = I * f;
12657
+ e[0] = u * C, e[4] = -u * f, e[8] = c, e[1] = M + L * c, e[5] = m - G * c, e[9] = -I * u, e[2] = G - m * c, e[6] = L + M * c, e[10] = g * u;
12658
12658
  } else if (A.order === "YXZ") {
12659
- const m = u * C, M = u * f, F = c * C, N = c * f;
12660
- e[0] = m + N * I, e[4] = F * I - M, e[8] = g * c, e[1] = g * f, e[5] = g * C, e[9] = -I, e[2] = M * I - F, e[6] = N + m * I, e[10] = g * u;
12659
+ const m = u * C, M = u * f, L = c * C, G = c * f;
12660
+ e[0] = m + G * I, e[4] = L * I - M, e[8] = g * c, e[1] = g * f, e[5] = g * C, e[9] = -I, e[2] = M * I - L, e[6] = G + m * I, e[10] = g * u;
12661
12661
  } else if (A.order === "ZXY") {
12662
- const m = u * C, M = u * f, F = c * C, N = c * f;
12663
- e[0] = m - N * I, e[4] = -g * f, e[8] = F + M * I, e[1] = M + F * I, e[5] = g * C, e[9] = N - m * I, e[2] = -g * c, e[6] = I, e[10] = g * u;
12662
+ const m = u * C, M = u * f, L = c * C, G = c * f;
12663
+ e[0] = m - G * I, e[4] = -g * f, e[8] = L + M * I, e[1] = M + L * I, e[5] = g * C, e[9] = G - m * I, e[2] = -g * c, e[6] = I, e[10] = g * u;
12664
12664
  } else if (A.order === "ZYX") {
12665
- const m = g * C, M = g * f, F = I * C, N = I * f;
12666
- e[0] = u * C, e[4] = F * c - M, e[8] = m * c + N, e[1] = u * f, e[5] = N * c + m, e[9] = M * c - F, e[2] = -c, e[6] = I * u, e[10] = g * u;
12665
+ const m = g * C, M = g * f, L = I * C, G = I * f;
12666
+ e[0] = u * C, e[4] = L * c - M, e[8] = m * c + G, e[1] = u * f, e[5] = G * c + m, e[9] = M * c - L, e[2] = -c, e[6] = I * u, e[10] = g * u;
12667
12667
  } else if (A.order === "YZX") {
12668
- const m = g * u, M = g * c, F = I * u, N = I * c;
12669
- e[0] = u * C, e[4] = N - m * f, e[8] = F * f + M, e[1] = f, e[5] = g * C, e[9] = -I * C, e[2] = -c * C, e[6] = M * f + F, e[10] = m - N * f;
12668
+ const m = g * u, M = g * c, L = I * u, G = I * c;
12669
+ e[0] = u * C, e[4] = G - m * f, e[8] = L * f + M, e[1] = f, e[5] = g * C, e[9] = -I * C, e[2] = -c * C, e[6] = M * f + L, e[10] = m - G * f;
12670
12670
  } else if (A.order === "XZY") {
12671
- const m = g * u, M = g * c, F = I * u, N = I * c;
12672
- e[0] = u * C, e[4] = -f, e[8] = c * C, e[1] = m * f + N, e[5] = g * C, e[9] = M * f - F, e[2] = F * f - M, e[6] = I * C, e[10] = N * f + m;
12671
+ const m = g * u, M = g * c, L = I * u, G = I * c;
12672
+ e[0] = u * C, e[4] = -f, e[8] = c * C, e[1] = m * f + G, e[5] = g * C, e[9] = M * f - L, e[2] = L * f - M, e[6] = I * C, e[10] = G * f + m;
12673
12673
  }
12674
12674
  return e[3] = 0, e[7] = 0, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, this;
12675
12675
  }
@@ -12687,8 +12687,8 @@ function WS() {
12687
12687
  return this.multiplyMatrices(A, this);
12688
12688
  }
12689
12689
  multiplyMatrices(A, e) {
12690
- const i = A.elements, n = e.elements, a = this.elements, g = i[0], I = i[4], u = i[8], c = i[12], C = i[1], f = i[5], m = i[9], M = i[13], F = i[2], N = i[6], R = i[10], G = i[14], _ = i[3], L = i[7], rA = i[11], tA = i[15], eA = n[0], QA = n[4], bA = n[8], IA = n[12], RA = n[1], wA = n[5], jA = n[9], Ce = n[13], Qe = n[2], Ve = n[6], fe = n[10], Me = n[14], _e = n[3], Fe = n[7], YA = n[11], de = n[15];
12691
- return a[0] = g * eA + I * RA + u * Qe + c * _e, a[4] = g * QA + I * wA + u * Ve + c * Fe, a[8] = g * bA + I * jA + u * fe + c * YA, a[12] = g * IA + I * Ce + u * Me + c * de, a[1] = C * eA + f * RA + m * Qe + M * _e, a[5] = C * QA + f * wA + m * Ve + M * Fe, a[9] = C * bA + f * jA + m * fe + M * YA, a[13] = C * IA + f * Ce + m * Me + M * de, a[2] = F * eA + N * RA + R * Qe + G * _e, a[6] = F * QA + N * wA + R * Ve + G * Fe, a[10] = F * bA + N * jA + R * fe + G * YA, a[14] = F * IA + N * Ce + R * Me + G * de, a[3] = _ * eA + L * RA + rA * Qe + tA * _e, a[7] = _ * QA + L * wA + rA * Ve + tA * Fe, a[11] = _ * bA + L * jA + rA * fe + tA * YA, a[15] = _ * IA + L * Ce + rA * Me + tA * de, this;
12690
+ const i = A.elements, n = e.elements, a = this.elements, g = i[0], I = i[4], u = i[8], c = i[12], C = i[1], f = i[5], m = i[9], M = i[13], L = i[2], G = i[6], _ = i[10], N = i[14], R = i[3], F = i[7], rA = i[11], tA = i[15], eA = n[0], QA = n[4], bA = n[8], IA = n[12], RA = n[1], wA = n[5], jA = n[9], Ce = n[13], Qe = n[2], Ve = n[6], fe = n[10], Me = n[14], _e = n[3], Fe = n[7], YA = n[11], de = n[15];
12691
+ return a[0] = g * eA + I * RA + u * Qe + c * _e, a[4] = g * QA + I * wA + u * Ve + c * Fe, a[8] = g * bA + I * jA + u * fe + c * YA, a[12] = g * IA + I * Ce + u * Me + c * de, a[1] = C * eA + f * RA + m * Qe + M * _e, a[5] = C * QA + f * wA + m * Ve + M * Fe, a[9] = C * bA + f * jA + m * fe + M * YA, a[13] = C * IA + f * Ce + m * Me + M * de, a[2] = L * eA + G * RA + _ * Qe + N * _e, a[6] = L * QA + G * wA + _ * Ve + N * Fe, a[10] = L * bA + G * jA + _ * fe + N * YA, a[14] = L * IA + G * Ce + _ * Me + N * de, a[3] = R * eA + F * RA + rA * Qe + tA * _e, a[7] = R * QA + F * wA + rA * Ve + tA * Fe, a[11] = R * bA + F * jA + rA * fe + tA * YA, a[15] = R * IA + F * Ce + rA * Me + tA * de, this;
12692
12692
  }
12693
12693
  multiplyScalar(A) {
12694
12694
  const e = this.elements;
@@ -12708,10 +12708,10 @@ function WS() {
12708
12708
  return A.isVector3 ? (n[12] = A.x, n[13] = A.y, n[14] = A.z) : (n[12] = A, n[13] = e, n[14] = i), this;
12709
12709
  }
12710
12710
  invert() {
12711
- const A = this.elements, e = A[0], i = A[1], n = A[2], a = A[3], g = A[4], I = A[5], u = A[6], c = A[7], C = A[8], f = A[9], m = A[10], M = A[11], F = A[12], N = A[13], R = A[14], G = A[15], _ = f * R * c - N * m * c + N * u * M - I * R * M - f * u * G + I * m * G, L = F * m * c - C * R * c - F * u * M + g * R * M + C * u * G - g * m * G, rA = C * N * c - F * f * c + F * I * M - g * N * M - C * I * G + g * f * G, tA = F * f * u - C * N * u - F * I * m + g * N * m + C * I * R - g * f * R, eA = e * _ + i * L + n * rA + a * tA;
12711
+ const A = this.elements, e = A[0], i = A[1], n = A[2], a = A[3], g = A[4], I = A[5], u = A[6], c = A[7], C = A[8], f = A[9], m = A[10], M = A[11], L = A[12], G = A[13], _ = A[14], N = A[15], R = f * _ * c - G * m * c + G * u * M - I * _ * M - f * u * N + I * m * N, F = L * m * c - C * _ * c - L * u * M + g * _ * M + C * u * N - g * m * N, rA = C * G * c - L * f * c + L * I * M - g * G * M - C * I * N + g * f * N, tA = L * f * u - C * G * u - L * I * m + g * G * m + C * I * _ - g * f * _, eA = e * R + i * F + n * rA + a * tA;
12712
12712
  if (eA === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
12713
12713
  const QA = 1 / eA;
12714
- return A[0] = _ * QA, A[1] = (N * m * a - f * R * a - N * n * M + i * R * M + f * n * G - i * m * G) * QA, A[2] = (I * R * a - N * u * a + N * n * c - i * R * c - I * n * G + i * u * G) * QA, A[3] = (f * u * a - I * m * a - f * n * c + i * m * c + I * n * M - i * u * M) * QA, A[4] = L * QA, A[5] = (C * R * a - F * m * a + F * n * M - e * R * M - C * n * G + e * m * G) * QA, A[6] = (F * u * a - g * R * a - F * n * c + e * R * c + g * n * G - e * u * G) * QA, A[7] = (g * m * a - C * u * a + C * n * c - e * m * c - g * n * M + e * u * M) * QA, A[8] = rA * QA, A[9] = (F * f * a - C * N * a - F * i * M + e * N * M + C * i * G - e * f * G) * QA, A[10] = (g * N * a - F * I * a + F * i * c - e * N * c - g * i * G + e * I * G) * QA, A[11] = (C * I * a - g * f * a - C * i * c + e * f * c + g * i * M - e * I * M) * QA, A[12] = tA * QA, A[13] = (C * N * n - F * f * n + F * i * m - e * N * m - C * i * R + e * f * R) * QA, A[14] = (F * I * n - g * N * n - F * i * u + e * N * u + g * i * R - e * I * R) * QA, A[15] = (g * f * n - C * I * n + C * i * u - e * f * u - g * i * m + e * I * m) * QA, this;
12714
+ return A[0] = R * QA, A[1] = (G * m * a - f * _ * a - G * n * M + i * _ * M + f * n * N - i * m * N) * QA, A[2] = (I * _ * a - G * u * a + G * n * c - i * _ * c - I * n * N + i * u * N) * QA, A[3] = (f * u * a - I * m * a - f * n * c + i * m * c + I * n * M - i * u * M) * QA, A[4] = F * QA, A[5] = (C * _ * a - L * m * a + L * n * M - e * _ * M - C * n * N + e * m * N) * QA, A[6] = (L * u * a - g * _ * a - L * n * c + e * _ * c + g * n * N - e * u * N) * QA, A[7] = (g * m * a - C * u * a + C * n * c - e * m * c - g * n * M + e * u * M) * QA, A[8] = rA * QA, A[9] = (L * f * a - C * G * a - L * i * M + e * G * M + C * i * N - e * f * N) * QA, A[10] = (g * G * a - L * I * a + L * i * c - e * G * c - g * i * N + e * I * N) * QA, A[11] = (C * I * a - g * f * a - C * i * c + e * f * c + g * i * M - e * I * M) * QA, A[12] = tA * QA, A[13] = (C * G * n - L * f * n + L * i * m - e * G * m - C * i * _ + e * f * _) * QA, A[14] = (L * I * n - g * G * n - L * i * u + e * G * u + g * i * _ - e * I * _) * QA, A[15] = (g * f * n - C * I * n + C * i * u - e * f * u - g * i * m + e * I * m) * QA, this;
12715
12715
  }
12716
12716
  scale(A) {
12717
12717
  const e = this.elements, i = A.x, n = A.y, a = A.z;
@@ -12747,8 +12747,8 @@ function WS() {
12747
12747
  return this.set(1, i, a, 0, A, 1, g, 0, e, n, 1, 0, 0, 0, 0, 1), this;
12748
12748
  }
12749
12749
  compose(A, e, i) {
12750
- const n = this.elements, a = e._x, g = e._y, I = e._z, u = e._w, c = a + a, C = g + g, f = I + I, m = a * c, M = a * C, F = a * f, N = g * C, R = g * f, G = I * f, _ = u * c, L = u * C, rA = u * f, tA = i.x, eA = i.y, QA = i.z;
12751
- return n[0] = (1 - (N + G)) * tA, n[1] = (M + rA) * tA, n[2] = (F - L) * tA, n[3] = 0, n[4] = (M - rA) * eA, n[5] = (1 - (m + G)) * eA, n[6] = (R + _) * eA, n[7] = 0, n[8] = (F + L) * QA, n[9] = (R - _) * QA, n[10] = (1 - (m + N)) * QA, n[11] = 0, n[12] = A.x, n[13] = A.y, n[14] = A.z, n[15] = 1, this;
12750
+ const n = this.elements, a = e._x, g = e._y, I = e._z, u = e._w, c = a + a, C = g + g, f = I + I, m = a * c, M = a * C, L = a * f, G = g * C, _ = g * f, N = I * f, R = u * c, F = u * C, rA = u * f, tA = i.x, eA = i.y, QA = i.z;
12751
+ return n[0] = (1 - (G + N)) * tA, n[1] = (M + rA) * tA, n[2] = (L - F) * tA, n[3] = 0, n[4] = (M - rA) * eA, n[5] = (1 - (m + N)) * eA, n[6] = (_ + R) * eA, n[7] = 0, n[8] = (L + F) * QA, n[9] = (_ - R) * QA, n[10] = (1 - (m + G)) * QA, n[11] = 0, n[12] = A.x, n[13] = A.y, n[14] = A.z, n[15] = 1, this;
12752
12752
  }
12753
12753
  decompose(A, e, i) {
12754
12754
  const n = this.elements;
@@ -13110,8 +13110,8 @@ function WS() {
13110
13110
  }
13111
13111
  }
13112
13112
  if (e) {
13113
- const I = g(A.geometries), u = g(A.materials), c = g(A.textures), C = g(A.images), f = g(A.shapes), m = g(A.skeletons), M = g(A.animations), F = g(A.nodes);
13114
- I.length > 0 && (i.geometries = I), u.length > 0 && (i.materials = u), c.length > 0 && (i.textures = c), C.length > 0 && (i.images = C), f.length > 0 && (i.shapes = f), m.length > 0 && (i.skeletons = m), M.length > 0 && (i.animations = M), F.length > 0 && (i.nodes = F);
13113
+ const I = g(A.geometries), u = g(A.materials), c = g(A.textures), C = g(A.images), f = g(A.shapes), m = g(A.skeletons), M = g(A.animations), L = g(A.nodes);
13114
+ I.length > 0 && (i.geometries = I), u.length > 0 && (i.materials = u), c.length > 0 && (i.textures = c), C.length > 0 && (i.images = C), f.length > 0 && (i.shapes = f), m.length > 0 && (i.skeletons = m), M.length > 0 && (i.animations = M), L.length > 0 && (i.nodes = L);
13115
13115
  }
13116
13116
  return i.object = n, i;
13117
13117
  function g(I) {
@@ -13149,8 +13149,8 @@ function WS() {
13149
13149
  On.subVectors(n, e), fr.subVectors(i, e), cc.subVectors(A, e);
13150
13150
  const g = On.dot(On), I = On.dot(fr), u = On.dot(cc), c = fr.dot(fr), C = fr.dot(cc), f = g * c - I * I;
13151
13151
  if (f === 0) return a.set(-2, -1, -1);
13152
- const m = 1 / f, M = (c * u - I * C) * m, F = (g * C - I * u) * m;
13153
- return a.set(1 - M - F, F, M);
13152
+ const m = 1 / f, M = (c * u - I * C) * m, L = (g * C - I * u) * m;
13153
+ return a.set(1 - M - L, L, M);
13154
13154
  }
13155
13155
  static containsPoint(A, e, i, n) {
13156
13156
  return this.getBarycoord(A, e, i, n, pr), pr.x >= 0 && pr.y >= 0 && pr.x + pr.y <= 1;
@@ -13221,14 +13221,14 @@ function WS() {
13221
13221
  const m = u * f - C * c;
13222
13222
  if (m <= 0 && u >= 0 && C <= 0) return g = u / (u - C), e.copy(i).addScaledVector(Vs, g);
13223
13223
  uc.subVectors(A, a);
13224
- const M = Vs.dot(uc), F = Ws.dot(uc);
13225
- if (F >= 0 && M <= F) return e.copy(a);
13226
- const N = M * c - u * F;
13227
- if (N <= 0 && c >= 0 && F <= 0) return I = c / (c - F), e.copy(i).addScaledVector(Ws, I);
13228
- const R = C * F - M * f;
13229
- if (R <= 0 && f - C >= 0 && M - F >= 0) return bh.subVectors(a, n), I = (f - C) / (f - C + (M - F)), e.copy(n).addScaledVector(bh, I);
13230
- const G = 1 / (R + N + m);
13231
- return g = N * G, I = m * G, e.copy(i).addScaledVector(Vs, g).addScaledVector(Ws, I);
13224
+ const M = Vs.dot(uc), L = Ws.dot(uc);
13225
+ if (L >= 0 && M <= L) return e.copy(a);
13226
+ const G = M * c - u * L;
13227
+ if (G <= 0 && c >= 0 && L <= 0) return I = c / (c - L), e.copy(i).addScaledVector(Ws, I);
13228
+ const _ = C * L - M * f;
13229
+ if (_ <= 0 && f - C >= 0 && M - L >= 0) return bh.subVectors(a, n), I = (f - C) / (f - C + (M - L)), e.copy(n).addScaledVector(bh, I);
13230
+ const N = 1 / (_ + G + m);
13231
+ return g = G * N, I = m * N, e.copy(i).addScaledVector(Vs, g).addScaledVector(Ws, I);
13232
13232
  }
13233
13233
  equals(A) {
13234
13234
  return A.a.equals(this.a) && A.b.equals(this.b) && A.c.equals(this.c);
@@ -13742,17 +13742,17 @@ function WS() {
13742
13742
  this.hasAttribute("tangent") === !1 && this.setAttribute("tangent", new Ti(new Float32Array(4 * I), 4));
13743
13743
  const u = this.getAttribute("tangent").array, c = [], C = [];
13744
13744
  for (let RA = 0; RA < I; RA++) c[RA] = new aA(), C[RA] = new aA();
13745
- const f = new aA(), m = new aA(), M = new aA(), F = new Te(), N = new Te(), R = new Te(), G = new aA(), _ = new aA();
13746
- function L(RA, wA, jA) {
13747
- f.fromArray(n, 3 * RA), m.fromArray(n, 3 * wA), M.fromArray(n, 3 * jA), F.fromArray(g, 2 * RA), N.fromArray(g, 2 * wA), R.fromArray(g, 2 * jA), m.sub(f), M.sub(f), N.sub(F), R.sub(F);
13748
- const Ce = 1 / (N.x * R.y - R.x * N.y);
13749
- isFinite(Ce) && (G.copy(m).multiplyScalar(R.y).addScaledVector(M, -N.y).multiplyScalar(Ce), _.copy(M).multiplyScalar(N.x).addScaledVector(m, -R.x).multiplyScalar(Ce), c[RA].add(G), c[wA].add(G), c[jA].add(G), C[RA].add(_), C[wA].add(_), C[jA].add(_));
13745
+ const f = new aA(), m = new aA(), M = new aA(), L = new Te(), G = new Te(), _ = new Te(), N = new aA(), R = new aA();
13746
+ function F(RA, wA, jA) {
13747
+ f.fromArray(n, 3 * RA), m.fromArray(n, 3 * wA), M.fromArray(n, 3 * jA), L.fromArray(g, 2 * RA), G.fromArray(g, 2 * wA), _.fromArray(g, 2 * jA), m.sub(f), M.sub(f), G.sub(L), _.sub(L);
13748
+ const Ce = 1 / (G.x * _.y - _.x * G.y);
13749
+ isFinite(Ce) && (N.copy(m).multiplyScalar(_.y).addScaledVector(M, -G.y).multiplyScalar(Ce), R.copy(M).multiplyScalar(G.x).addScaledVector(m, -_.x).multiplyScalar(Ce), c[RA].add(N), c[wA].add(N), c[jA].add(N), C[RA].add(R), C[wA].add(R), C[jA].add(R));
13750
13750
  }
13751
13751
  let rA = this.groups;
13752
13752
  rA.length === 0 && (rA = [{ start: 0, count: i.length }]);
13753
13753
  for (let RA = 0, wA = rA.length; RA < wA; ++RA) {
13754
13754
  const jA = rA[RA], Ce = jA.start;
13755
- for (let Qe = Ce, Ve = Ce + jA.count; Qe < Ve; Qe += 3) L(i[Qe + 0], i[Qe + 1], i[Qe + 2]);
13755
+ for (let Qe = Ce, Ve = Ce + jA.count; Qe < Ve; Qe += 3) F(i[Qe + 0], i[Qe + 1], i[Qe + 2]);
13756
13756
  }
13757
13757
  const tA = new aA(), eA = new aA(), QA = new aA(), bA = new aA();
13758
13758
  function IA(RA) {
@@ -13775,8 +13775,8 @@ function WS() {
13775
13775
  else for (let m = 0, M = i.count; m < M; m++) i.setXYZ(m, 0, 0, 0);
13776
13776
  const n = new aA(), a = new aA(), g = new aA(), I = new aA(), u = new aA(), c = new aA(), C = new aA(), f = new aA();
13777
13777
  if (A) for (let m = 0, M = A.count; m < M; m += 3) {
13778
- const F = A.getX(m + 0), N = A.getX(m + 1), R = A.getX(m + 2);
13779
- n.fromBufferAttribute(e, F), a.fromBufferAttribute(e, N), g.fromBufferAttribute(e, R), C.subVectors(g, a), f.subVectors(n, a), C.cross(f), I.fromBufferAttribute(i, F), u.fromBufferAttribute(i, N), c.fromBufferAttribute(i, R), I.add(C), u.add(C), c.add(C), i.setXYZ(F, I.x, I.y, I.z), i.setXYZ(N, u.x, u.y, u.z), i.setXYZ(R, c.x, c.y, c.z);
13778
+ const L = A.getX(m + 0), G = A.getX(m + 1), _ = A.getX(m + 2);
13779
+ n.fromBufferAttribute(e, L), a.fromBufferAttribute(e, G), g.fromBufferAttribute(e, _), C.subVectors(g, a), f.subVectors(n, a), C.cross(f), I.fromBufferAttribute(i, L), u.fromBufferAttribute(i, G), c.fromBufferAttribute(i, _), I.add(C), u.add(C), c.add(C), i.setXYZ(L, I.x, I.y, I.z), i.setXYZ(G, u.x, u.y, u.z), i.setXYZ(_, c.x, c.y, c.z);
13780
13780
  }
13781
13781
  else for (let m = 0, M = e.count; m < M; m += 3) n.fromBufferAttribute(e, m + 0), a.fromBufferAttribute(e, m + 1), g.fromBufferAttribute(e, m + 2), C.subVectors(g, a), f.subVectors(n, a), C.cross(f), i.setXYZ(m + 0, C.x, C.y, C.z), i.setXYZ(m + 1, C.x, C.y, C.z), i.setXYZ(m + 2, C.x, C.y, C.z);
13782
13782
  this.normalizeNormals(), i.needsUpdate = !0;
@@ -13792,10 +13792,10 @@ function WS() {
13792
13792
  toNonIndexed() {
13793
13793
  function A(I, u) {
13794
13794
  const c = I.array, C = I.itemSize, f = I.normalized, m = new c.constructor(u.length * C);
13795
- let M = 0, F = 0;
13796
- for (let N = 0, R = u.length; N < R; N++) {
13797
- M = I.isInterleavedBufferAttribute ? u[N] * I.data.stride + I.offset : u[N] * C;
13798
- for (let G = 0; G < C; G++) m[F++] = c[M++];
13795
+ let M = 0, L = 0;
13796
+ for (let G = 0, _ = u.length; G < _; G++) {
13797
+ M = I.isInterleavedBufferAttribute ? u[G] * I.data.stride + I.offset : u[G] * C;
13798
+ for (let N = 0; N < C; N++) m[L++] = c[M++];
13799
13799
  }
13800
13800
  return new Ti(m, C, f);
13801
13801
  }
@@ -13934,34 +13934,34 @@ function WS() {
13934
13934
  _computeIntersections(A, e) {
13935
13935
  let i;
13936
13936
  const n = this.geometry, a = this.material, g = n.index, I = n.attributes.position, u = n.attributes.uv, c = n.attributes.uv1, C = n.attributes.normal, f = n.groups, m = n.drawRange;
13937
- if (g !== null) if (Array.isArray(a)) for (let M = 0, F = f.length; M < F; M++) {
13938
- const N = f[M], R = a[N.materialIndex];
13939
- for (let G = Math.max(N.start, m.start), _ = Math.min(g.count, Math.min(N.start + N.count, m.start + m.count)); G < _; G += 3) {
13940
- const L = g.getX(G), rA = g.getX(G + 1), tA = g.getX(G + 2);
13941
- i = mg(this, R, A, er, u, c, C, L, rA, tA), i && (i.faceIndex = Math.floor(G / 3), i.face.materialIndex = N.materialIndex, e.push(i));
13937
+ if (g !== null) if (Array.isArray(a)) for (let M = 0, L = f.length; M < L; M++) {
13938
+ const G = f[M], _ = a[G.materialIndex];
13939
+ for (let N = Math.max(G.start, m.start), R = Math.min(g.count, Math.min(G.start + G.count, m.start + m.count)); N < R; N += 3) {
13940
+ const F = g.getX(N), rA = g.getX(N + 1), tA = g.getX(N + 2);
13941
+ i = mg(this, _, A, er, u, c, C, F, rA, tA), i && (i.faceIndex = Math.floor(N / 3), i.face.materialIndex = G.materialIndex, e.push(i));
13942
13942
  }
13943
13943
  }
13944
13944
  else
13945
- for (let M = Math.max(0, m.start), F = Math.min(g.count, m.start + m.count); M < F; M += 3) {
13946
- const N = g.getX(M), R = g.getX(M + 1), G = g.getX(M + 2);
13947
- i = mg(this, a, A, er, u, c, C, N, R, G), i && (i.faceIndex = Math.floor(M / 3), e.push(i));
13945
+ for (let M = Math.max(0, m.start), L = Math.min(g.count, m.start + m.count); M < L; M += 3) {
13946
+ const G = g.getX(M), _ = g.getX(M + 1), N = g.getX(M + 2);
13947
+ i = mg(this, a, A, er, u, c, C, G, _, N), i && (i.faceIndex = Math.floor(M / 3), e.push(i));
13948
13948
  }
13949
- else if (I !== void 0) if (Array.isArray(a)) for (let M = 0, F = f.length; M < F; M++) {
13950
- const N = f[M], R = a[N.materialIndex];
13951
- for (let G = Math.max(N.start, m.start), _ = Math.min(I.count, Math.min(N.start + N.count, m.start + m.count)); G < _; G += 3)
13952
- i = mg(this, R, A, er, u, c, C, G, G + 1, G + 2), i && (i.faceIndex = Math.floor(G / 3), i.face.materialIndex = N.materialIndex, e.push(i));
13949
+ else if (I !== void 0) if (Array.isArray(a)) for (let M = 0, L = f.length; M < L; M++) {
13950
+ const G = f[M], _ = a[G.materialIndex];
13951
+ for (let N = Math.max(G.start, m.start), R = Math.min(I.count, Math.min(G.start + G.count, m.start + m.count)); N < R; N += 3)
13952
+ i = mg(this, _, A, er, u, c, C, N, N + 1, N + 2), i && (i.faceIndex = Math.floor(N / 3), i.face.materialIndex = G.materialIndex, e.push(i));
13953
13953
  }
13954
13954
  else
13955
- for (let M = Math.max(0, m.start), F = Math.min(I.count, m.start + m.count); M < F; M += 3)
13955
+ for (let M = Math.max(0, m.start), L = Math.min(I.count, m.start + m.count); M < L; M += 3)
13956
13956
  i = mg(this, a, A, er, u, c, C, M, M + 1, M + 2), i && (i.faceIndex = Math.floor(M / 3), e.push(i));
13957
13957
  }
13958
13958
  }
13959
13959
  function mg(o, A, e, i, n, a, g, I, u, c) {
13960
13960
  o.getVertexPosition(I, js), o.getVertexPosition(u, Xs), o.getVertexPosition(c, $s);
13961
- const C = (function(f, m, M, F, N, R, G, _) {
13962
- let L;
13963
- if (L = m.side === y ? F.intersectTriangle(G, R, N, !0, _) : F.intersectTriangle(N, R, G, m.side === p, _), L === null) return null;
13964
- pg.copy(_), pg.applyMatrix4(f.matrixWorld);
13961
+ const C = (function(f, m, M, L, G, _, N, R) {
13962
+ let F;
13963
+ if (F = m.side === y ? L.intersectTriangle(N, _, G, !0, R) : L.intersectTriangle(G, _, N, m.side === p, R), F === null) return null;
13964
+ pg.copy(R), pg.applyMatrix4(f.matrixWorld);
13965
13965
  const rA = M.ray.origin.distanceTo(pg);
13966
13966
  return rA < M.near || rA > M.far ? null : { distance: rA, point: pg.clone(), object: f };
13967
13967
  })(o, A, e, i, js, Xs, $s, fg);
@@ -13979,7 +13979,7 @@ function WS() {
13979
13979
  n = Math.floor(n), a = Math.floor(a), g = Math.floor(g);
13980
13980
  const u = [], c = [], C = [], f = [];
13981
13981
  let m = 0, M = 0;
13982
- function F(N, R, G, _, L, rA, tA, eA, QA, bA, IA) {
13982
+ function L(G, _, N, R, F, rA, tA, eA, QA, bA, IA) {
13983
13983
  const RA = rA / QA, wA = tA / bA, jA = rA / 2, Ce = tA / 2, Qe = eA / 2, Ve = QA + 1, fe = bA + 1;
13984
13984
  let Me = 0, _e = 0;
13985
13985
  const Fe = new aA();
@@ -13987,7 +13987,7 @@ function WS() {
13987
13987
  const de = YA * wA - Ce;
13988
13988
  for (let be = 0; be < Ve; be++) {
13989
13989
  const ge = be * RA - jA;
13990
- Fe[N] = ge * _, Fe[R] = de * L, Fe[G] = Qe, c.push(Fe.x, Fe.y, Fe.z), Fe[N] = 0, Fe[R] = 0, Fe[G] = eA > 0 ? 1 : -1, C.push(Fe.x, Fe.y, Fe.z), f.push(be / QA), f.push(1 - YA / bA), Me += 1;
13990
+ Fe[G] = ge * R, Fe[_] = de * F, Fe[N] = Qe, c.push(Fe.x, Fe.y, Fe.z), Fe[G] = 0, Fe[_] = 0, Fe[N] = eA > 0 ? 1 : -1, C.push(Fe.x, Fe.y, Fe.z), f.push(be / QA), f.push(1 - YA / bA), Me += 1;
13991
13991
  }
13992
13992
  }
13993
13993
  for (let YA = 0; YA < bA; YA++) for (let de = 0; de < QA; de++) {
@@ -13996,7 +13996,7 @@ function WS() {
13996
13996
  }
13997
13997
  I.addGroup(M, _e, IA), M += _e, m += Me;
13998
13998
  }
13999
- F("z", "y", "x", -1, -1, i, e, A, g, a, 0), F("z", "y", "x", 1, -1, i, e, -A, g, a, 1), F("x", "z", "y", 1, 1, A, i, e, n, g, 2), F("x", "z", "y", 1, -1, A, i, -e, n, g, 3), F("x", "y", "z", 1, -1, A, e, i, n, a, 4), F("x", "y", "z", -1, -1, A, e, -i, n, a, 5), this.setIndex(u), this.setAttribute("position", new an(c, 3)), this.setAttribute("normal", new an(C, 3)), this.setAttribute("uv", new an(f, 2));
13999
+ L("z", "y", "x", -1, -1, i, e, A, g, a, 0), L("z", "y", "x", 1, -1, i, e, -A, g, a, 1), L("x", "z", "y", 1, 1, A, i, e, n, g, 2), L("x", "z", "y", 1, -1, A, i, -e, n, g, 3), L("x", "y", "z", 1, -1, A, e, i, n, a, 4), L("x", "y", "z", -1, -1, A, e, -i, n, a, 5), this.setIndex(u), this.setAttribute("position", new an(c, 3)), this.setAttribute("normal", new an(C, 3)), this.setAttribute("uv", new an(f, 2));
14000
14000
  }
14001
14001
  copy(A) {
14002
14002
  return super.copy(A), this.parameters = Object.assign({}, A.parameters), this;
@@ -14299,8 +14299,8 @@ function WS() {
14299
14299
  return this;
14300
14300
  }
14301
14301
  setFromProjectionMatrix(A) {
14302
- const e = this.planes, i = A.elements, n = i[0], a = i[1], g = i[2], I = i[3], u = i[4], c = i[5], C = i[6], f = i[7], m = i[8], M = i[9], F = i[10], N = i[11], R = i[12], G = i[13], _ = i[14], L = i[15];
14303
- return e[0].setComponents(I - n, f - u, N - m, L - R).normalize(), e[1].setComponents(I + n, f + u, N + m, L + R).normalize(), e[2].setComponents(I + a, f + c, N + M, L + G).normalize(), e[3].setComponents(I - a, f - c, N - M, L - G).normalize(), e[4].setComponents(I - g, f - C, N - F, L - _).normalize(), e[5].setComponents(I + g, f + C, N + F, L + _).normalize(), this;
14302
+ const e = this.planes, i = A.elements, n = i[0], a = i[1], g = i[2], I = i[3], u = i[4], c = i[5], C = i[6], f = i[7], m = i[8], M = i[9], L = i[10], G = i[11], _ = i[12], N = i[13], R = i[14], F = i[15];
14303
+ return e[0].setComponents(I - n, f - u, G - m, F - _).normalize(), e[1].setComponents(I + n, f + u, G + m, F + _).normalize(), e[2].setComponents(I + a, f + c, G + M, F + N).normalize(), e[3].setComponents(I - a, f - c, G - M, F - N).normalize(), e[4].setComponents(I - g, f - C, G - L, F - R).normalize(), e[5].setComponents(I + g, f + C, G + L, F + R).normalize(), this;
14304
14304
  }
14305
14305
  intersectsObject(A) {
14306
14306
  if (A.boundingSphere !== void 0) A.boundingSphere === null && A.computeBoundingSphere(), Qs.copy(A.boundingSphere).applyMatrix4(A.matrixWorld);
@@ -14393,19 +14393,19 @@ function WS() {
14393
14393
  class ki extends fn {
14394
14394
  constructor(A = 1, e = 1, i = 1, n = 1) {
14395
14395
  super(), this.type = "PlaneGeometry", this.parameters = { width: A, height: e, widthSegments: i, heightSegments: n };
14396
- const a = A / 2, g = e / 2, I = Math.floor(i), u = Math.floor(n), c = I + 1, C = u + 1, f = A / I, m = e / u, M = [], F = [], N = [], R = [];
14397
- for (let G = 0; G < C; G++) {
14398
- const _ = G * m - g;
14399
- for (let L = 0; L < c; L++) {
14400
- const rA = L * f - a;
14401
- F.push(rA, -_, 0), N.push(0, 0, 1), R.push(L / I), R.push(1 - G / u);
14396
+ const a = A / 2, g = e / 2, I = Math.floor(i), u = Math.floor(n), c = I + 1, C = u + 1, f = A / I, m = e / u, M = [], L = [], G = [], _ = [];
14397
+ for (let N = 0; N < C; N++) {
14398
+ const R = N * m - g;
14399
+ for (let F = 0; F < c; F++) {
14400
+ const rA = F * f - a;
14401
+ L.push(rA, -R, 0), G.push(0, 0, 1), _.push(F / I), _.push(1 - N / u);
14402
14402
  }
14403
14403
  }
14404
- for (let G = 0; G < u; G++) for (let _ = 0; _ < I; _++) {
14405
- const L = _ + c * G, rA = _ + c * (G + 1), tA = _ + 1 + c * (G + 1), eA = _ + 1 + c * G;
14406
- M.push(L, rA, eA), M.push(rA, tA, eA);
14404
+ for (let N = 0; N < u; N++) for (let R = 0; R < I; R++) {
14405
+ const F = R + c * N, rA = R + c * (N + 1), tA = R + 1 + c * (N + 1), eA = R + 1 + c * N;
14406
+ M.push(F, rA, eA), M.push(rA, tA, eA);
14407
14407
  }
14408
- this.setIndex(M), this.setAttribute("position", new an(F, 3)), this.setAttribute("normal", new an(N, 3)), this.setAttribute("uv", new an(R, 2));
14408
+ this.setIndex(M), this.setAttribute("position", new an(L, 3)), this.setAttribute("normal", new an(G, 3)), this.setAttribute("uv", new an(_, 2));
14409
14409
  }
14410
14410
  copy(A) {
14411
14411
  return super.copy(A), this.parameters = Object.assign({}, A.parameters), this;
@@ -17571,36 +17571,36 @@ void main() {
17571
17571
  function kQ(o, A, e, i, n, a, g) {
17572
17572
  const I = new gt(0);
17573
17573
  let u, c, C = a === !0 ? 0 : 1, f = null, m = 0, M = null;
17574
- function F(N, R) {
17575
- N.getRGB(Dg, Hh(o)), i.buffers.color.setClear(Dg.r, Dg.g, Dg.b, R, g);
17574
+ function L(G, _) {
17575
+ G.getRGB(Dg, Hh(o)), i.buffers.color.setClear(Dg.r, Dg.g, Dg.b, _, g);
17576
17576
  }
17577
17577
  return { getClearColor: function() {
17578
17578
  return I;
17579
- }, setClearColor: function(N, R = 1) {
17580
- I.set(N), C = R, F(I, C);
17579
+ }, setClearColor: function(G, _ = 1) {
17580
+ I.set(G), C = _, L(I, C);
17581
17581
  }, getClearAlpha: function() {
17582
17582
  return C;
17583
- }, setClearAlpha: function(N) {
17584
- C = N, F(I, C);
17585
- }, render: function(N, R) {
17586
- let G = !1, _ = R.isScene === !0 ? R.background : null;
17587
- switch (_ && _.isTexture && (_ = (R.backgroundBlurriness > 0 ? e : A).get(_)), _ === null ? F(I, C) : _ && _.isColor && (F(_, 1), G = !0), o.xr.getEnvironmentBlendMode()) {
17583
+ }, setClearAlpha: function(G) {
17584
+ C = G, L(I, C);
17585
+ }, render: function(G, _) {
17586
+ let N = !1, R = _.isScene === !0 ? _.background : null;
17587
+ switch (R && R.isTexture && (R = (_.backgroundBlurriness > 0 ? e : A).get(R)), R === null ? L(I, C) : R && R.isColor && (L(R, 1), N = !0), o.xr.getEnvironmentBlendMode()) {
17588
17588
  case "opaque":
17589
- G = !0;
17589
+ N = !0;
17590
17590
  break;
17591
17591
  case "additive":
17592
- i.buffers.color.setClear(0, 0, 0, 1, g), G = !0;
17592
+ i.buffers.color.setClear(0, 0, 0, 1, g), N = !0;
17593
17593
  break;
17594
17594
  case "alpha-blend":
17595
- i.buffers.color.setClear(0, 0, 0, 0, g), G = !0;
17595
+ i.buffers.color.setClear(0, 0, 0, 0, g), N = !0;
17596
17596
  }
17597
- (o.autoClear || G) && o.clear(o.autoClearColor, o.autoClearDepth, o.autoClearStencil), _ && (_.isCubeTexture || _.mapping === cA) ? (c === void 0 && (c = new Tt(new Aa(1, 1, 1), new ei({ name: "BackgroundCubeMaterial", uniforms: ea(tr.backgroundCube.uniforms), vertexShader: tr.backgroundCube.vertexShader, fragmentShader: tr.backgroundCube.fragmentShader, side: y, depthTest: !1, depthWrite: !1, fog: !1 })), c.geometry.deleteAttribute("normal"), c.geometry.deleteAttribute("uv"), c.onBeforeRender = function(L, rA, tA) {
17597
+ (o.autoClear || N) && o.clear(o.autoClearColor, o.autoClearDepth, o.autoClearStencil), R && (R.isCubeTexture || R.mapping === cA) ? (c === void 0 && (c = new Tt(new Aa(1, 1, 1), new ei({ name: "BackgroundCubeMaterial", uniforms: ea(tr.backgroundCube.uniforms), vertexShader: tr.backgroundCube.vertexShader, fragmentShader: tr.backgroundCube.fragmentShader, side: y, depthTest: !1, depthWrite: !1, fog: !1 })), c.geometry.deleteAttribute("normal"), c.geometry.deleteAttribute("uv"), c.onBeforeRender = function(F, rA, tA) {
17598
17598
  this.matrixWorld.copyPosition(tA.matrixWorld);
17599
17599
  }, Object.defineProperty(c.material, "envMap", { get: function() {
17600
17600
  return this.uniforms.envMap.value;
17601
- } }), n.update(c)), c.material.uniforms.envMap.value = _, c.material.uniforms.flipEnvMap.value = _.isCubeTexture && _.isRenderTargetTexture === !1 ? -1 : 1, c.material.uniforms.backgroundBlurriness.value = R.backgroundBlurriness, c.material.uniforms.backgroundIntensity.value = R.backgroundIntensity, c.material.toneMapped = _.colorSpace !== iA, f === _ && m === _.version && M === o.toneMapping || (c.material.needsUpdate = !0, f = _, m = _.version, M = o.toneMapping), c.layers.enableAll(), N.unshift(c, c.geometry, c.material, 0, 0, null)) : _ && _.isTexture && (u === void 0 && (u = new Tt(new ki(2, 2), new ei({ name: "BackgroundMaterial", uniforms: ea(tr.background.uniforms), vertexShader: tr.background.vertexShader, fragmentShader: tr.background.fragmentShader, side: p, depthTest: !1, depthWrite: !1, fog: !1 })), u.geometry.deleteAttribute("normal"), Object.defineProperty(u.material, "map", { get: function() {
17601
+ } }), n.update(c)), c.material.uniforms.envMap.value = R, c.material.uniforms.flipEnvMap.value = R.isCubeTexture && R.isRenderTargetTexture === !1 ? -1 : 1, c.material.uniforms.backgroundBlurriness.value = _.backgroundBlurriness, c.material.uniforms.backgroundIntensity.value = _.backgroundIntensity, c.material.toneMapped = R.colorSpace !== iA, f === R && m === R.version && M === o.toneMapping || (c.material.needsUpdate = !0, f = R, m = R.version, M = o.toneMapping), c.layers.enableAll(), G.unshift(c, c.geometry, c.material, 0, 0, null)) : R && R.isTexture && (u === void 0 && (u = new Tt(new ki(2, 2), new ei({ name: "BackgroundMaterial", uniforms: ea(tr.background.uniforms), vertexShader: tr.background.vertexShader, fragmentShader: tr.background.fragmentShader, side: p, depthTest: !1, depthWrite: !1, fog: !1 })), u.geometry.deleteAttribute("normal"), Object.defineProperty(u.material, "map", { get: function() {
17602
17602
  return this.uniforms.t2D.value;
17603
- } }), n.update(u)), u.material.uniforms.t2D.value = _, u.material.uniforms.backgroundIntensity.value = R.backgroundIntensity, u.material.toneMapped = _.colorSpace !== iA, _.matrixAutoUpdate === !0 && _.updateMatrix(), u.material.uniforms.uvTransform.value.copy(_.matrix), f === _ && m === _.version && M === o.toneMapping || (u.material.needsUpdate = !0, f = _, m = _.version, M = o.toneMapping), u.layers.enableAll(), N.unshift(u, u.geometry, u.material, 0, 0, null));
17603
+ } }), n.update(u)), u.material.uniforms.t2D.value = R, u.material.uniforms.backgroundIntensity.value = _.backgroundIntensity, u.material.toneMapped = R.colorSpace !== iA, R.matrixAutoUpdate === !0 && R.updateMatrix(), u.material.uniforms.uvTransform.value.copy(R.matrix), f === R && m === R.version && M === o.toneMapping || (u.material.needsUpdate = !0, f = R, m = R.version, M = o.toneMapping), u.layers.enableAll(), G.unshift(u, u.geometry, u.material, 0, 0, null));
17604
17604
  } };
17605
17605
  }
17606
17606
  function FQ(o, A, e, i) {
@@ -17617,25 +17617,25 @@ void main() {
17617
17617
  for (let IA = 0; IA < n; IA++) eA[IA] = 0, QA[IA] = 0, bA[IA] = 0;
17618
17618
  return { geometry: null, program: null, wireframe: !1, newAttributes: eA, enabledAttributes: QA, attributeDivisors: bA, object: tA, attributes: {}, index: null };
17619
17619
  }
17620
- function F() {
17620
+ function L() {
17621
17621
  const tA = c.newAttributes;
17622
17622
  for (let eA = 0, QA = tA.length; eA < QA; eA++) tA[eA] = 0;
17623
17623
  }
17624
- function N(tA) {
17625
- R(tA, 0);
17624
+ function G(tA) {
17625
+ _(tA, 0);
17626
17626
  }
17627
- function R(tA, eA) {
17627
+ function _(tA, eA) {
17628
17628
  const QA = c.newAttributes, bA = c.enabledAttributes, IA = c.attributeDivisors;
17629
17629
  QA[tA] = 1, bA[tA] === 0 && (o.enableVertexAttribArray(tA), bA[tA] = 1), IA[tA] !== eA && ((i.isWebGL2 ? o : A.get("ANGLE_instanced_arrays"))[i.isWebGL2 ? "vertexAttribDivisor" : "vertexAttribDivisorANGLE"](tA, eA), IA[tA] = eA);
17630
17630
  }
17631
- function G() {
17631
+ function N() {
17632
17632
  const tA = c.newAttributes, eA = c.enabledAttributes;
17633
17633
  for (let QA = 0, bA = eA.length; QA < bA; QA++) eA[QA] !== tA[QA] && (o.disableVertexAttribArray(QA), eA[QA] = 0);
17634
17634
  }
17635
- function _(tA, eA, QA, bA, IA, RA) {
17635
+ function R(tA, eA, QA, bA, IA, RA) {
17636
17636
  i.isWebGL2 !== !0 || QA !== o.INT && QA !== o.UNSIGNED_INT ? o.vertexAttribPointer(tA, eA, QA, bA, IA, RA) : o.vertexAttribIPointer(tA, eA, QA, IA, RA);
17637
17637
  }
17638
- function L() {
17638
+ function F() {
17639
17639
  rA(), C = !0, c !== u && (c = u, f(c.object));
17640
17640
  }
17641
17641
  function rA() {
@@ -17684,7 +17684,7 @@ void main() {
17684
17684
  }
17685
17685
  IA !== null && e.update(IA, o.ELEMENT_ARRAY_BUFFER), (RA || C) && (C = !1, (function(wA, jA, Ce, Qe) {
17686
17686
  if (i.isWebGL2 === !1 && (wA.isInstancedMesh || Qe.isInstancedBufferGeometry) && A.get("ANGLE_instanced_arrays") === null) return;
17687
- F();
17687
+ L();
17688
17688
  const Ve = Qe.attributes, fe = Ce.getAttributes(), Me = jA.defaultAttributeValues;
17689
17689
  for (const _e in fe) {
17690
17690
  const Fe = fe[_e];
@@ -17697,18 +17697,18 @@ void main() {
17697
17697
  if (YA.isInterleavedBufferAttribute) {
17698
17698
  const vA = YA.data, WA = vA.stride, xA = YA.offset;
17699
17699
  if (vA.isInstancedInterleavedBuffer) {
17700
- for (let Be = 0; Be < Fe.locationSize; Be++) R(Fe.location + Be, vA.meshPerAttribute);
17700
+ for (let Be = 0; Be < Fe.locationSize; Be++) _(Fe.location + Be, vA.meshPerAttribute);
17701
17701
  wA.isInstancedMesh !== !0 && Qe._maxInstanceCount === void 0 && (Qe._maxInstanceCount = vA.meshPerAttribute * vA.count);
17702
- } else for (let Be = 0; Be < Fe.locationSize; Be++) N(Fe.location + Be);
17702
+ } else for (let Be = 0; Be < Fe.locationSize; Be++) G(Fe.location + Be);
17703
17703
  o.bindBuffer(o.ARRAY_BUFFER, Xe);
17704
- for (let Be = 0; Be < Fe.locationSize; Be++) _(Fe.location + Be, be / Fe.locationSize, oA, de, WA * lA, (xA + be / Fe.locationSize * Be) * lA);
17704
+ for (let Be = 0; Be < Fe.locationSize; Be++) R(Fe.location + Be, be / Fe.locationSize, oA, de, WA * lA, (xA + be / Fe.locationSize * Be) * lA);
17705
17705
  } else {
17706
17706
  if (YA.isInstancedBufferAttribute) {
17707
- for (let vA = 0; vA < Fe.locationSize; vA++) R(Fe.location + vA, YA.meshPerAttribute);
17707
+ for (let vA = 0; vA < Fe.locationSize; vA++) _(Fe.location + vA, YA.meshPerAttribute);
17708
17708
  wA.isInstancedMesh !== !0 && Qe._maxInstanceCount === void 0 && (Qe._maxInstanceCount = YA.meshPerAttribute * YA.count);
17709
- } else for (let vA = 0; vA < Fe.locationSize; vA++) N(Fe.location + vA);
17709
+ } else for (let vA = 0; vA < Fe.locationSize; vA++) G(Fe.location + vA);
17710
17710
  o.bindBuffer(o.ARRAY_BUFFER, Xe);
17711
- for (let vA = 0; vA < Fe.locationSize; vA++) _(Fe.location + vA, be / Fe.locationSize, oA, de, be * lA, be / Fe.locationSize * vA * lA);
17711
+ for (let vA = 0; vA < Fe.locationSize; vA++) R(Fe.location + vA, be / Fe.locationSize, oA, de, be * lA, be / Fe.locationSize * vA * lA);
17712
17712
  }
17713
17713
  } else if (Me !== void 0) {
17714
17714
  const de = Me[_e];
@@ -17728,10 +17728,10 @@ void main() {
17728
17728
  }
17729
17729
  }
17730
17730
  }
17731
- G();
17731
+ N();
17732
17732
  })(tA, eA, QA, bA), IA !== null && o.bindBuffer(o.ELEMENT_ARRAY_BUFFER, e.get(IA).buffer));
17733
- }, reset: L, resetDefaultState: rA, dispose: function() {
17734
- L();
17733
+ }, reset: F, resetDefaultState: rA, dispose: function() {
17734
+ F();
17735
17735
  for (const tA in I) {
17736
17736
  const eA = I[tA];
17737
17737
  for (const QA in eA) {
@@ -17758,7 +17758,7 @@ void main() {
17758
17758
  for (const IA in bA) m(bA[IA].object), delete bA[IA];
17759
17759
  delete QA[tA.id];
17760
17760
  }
17761
- }, initAttributes: F, enableAttribute: N, disableUnusedAttributes: G };
17761
+ }, initAttributes: L, enableAttribute: G, disableUnusedAttributes: N };
17762
17762
  }
17763
17763
  function LQ(o, A, e, i) {
17764
17764
  const n = i.isWebGL2;
@@ -17788,7 +17788,7 @@ void main() {
17788
17788
  let g = e.precision !== void 0 ? e.precision : "highp";
17789
17789
  const I = n(g);
17790
17790
  I !== g && (g = I);
17791
- const u = a || A.has("WEBGL_draw_buffers"), c = e.logarithmicDepthBuffer === !0, C = o.getParameter(o.MAX_TEXTURE_IMAGE_UNITS), f = o.getParameter(o.MAX_VERTEX_TEXTURE_IMAGE_UNITS), m = o.getParameter(o.MAX_TEXTURE_SIZE), M = o.getParameter(o.MAX_CUBE_MAP_TEXTURE_SIZE), F = o.getParameter(o.MAX_VERTEX_ATTRIBS), N = o.getParameter(o.MAX_VERTEX_UNIFORM_VECTORS), R = o.getParameter(o.MAX_VARYING_VECTORS), G = o.getParameter(o.MAX_FRAGMENT_UNIFORM_VECTORS), _ = f > 0, L = a || A.has("OES_texture_float");
17791
+ const u = a || A.has("WEBGL_draw_buffers"), c = e.logarithmicDepthBuffer === !0, C = o.getParameter(o.MAX_TEXTURE_IMAGE_UNITS), f = o.getParameter(o.MAX_VERTEX_TEXTURE_IMAGE_UNITS), m = o.getParameter(o.MAX_TEXTURE_SIZE), M = o.getParameter(o.MAX_CUBE_MAP_TEXTURE_SIZE), L = o.getParameter(o.MAX_VERTEX_ATTRIBS), G = o.getParameter(o.MAX_VERTEX_UNIFORM_VECTORS), _ = o.getParameter(o.MAX_VARYING_VECTORS), N = o.getParameter(o.MAX_FRAGMENT_UNIFORM_VECTORS), R = f > 0, F = a || A.has("OES_texture_float");
17792
17792
  return { isWebGL2: a, drawBuffers: u, getMaxAnisotropy: function() {
17793
17793
  if (i !== void 0) return i;
17794
17794
  if (A.has("EXT_texture_filter_anisotropic") === !0) {
@@ -17796,24 +17796,24 @@ void main() {
17796
17796
  i = o.getParameter(rA.MAX_TEXTURE_MAX_ANISOTROPY_EXT);
17797
17797
  } else i = 0;
17798
17798
  return i;
17799
- }, getMaxPrecision: n, precision: g, logarithmicDepthBuffer: c, maxTextures: C, maxVertexTextures: f, maxTextureSize: m, maxCubemapSize: M, maxAttributes: F, maxVertexUniforms: N, maxVaryings: R, maxFragmentUniforms: G, vertexTextures: _, floatFragmentTextures: L, floatVertexTextures: _ && L, maxSamples: a ? o.getParameter(o.MAX_SAMPLES) : 0 };
17799
+ }, getMaxPrecision: n, precision: g, logarithmicDepthBuffer: c, maxTextures: C, maxVertexTextures: f, maxTextureSize: m, maxCubemapSize: M, maxAttributes: L, maxVertexUniforms: G, maxVaryings: _, maxFragmentUniforms: N, vertexTextures: R, floatFragmentTextures: F, floatVertexTextures: R && F, maxSamples: a ? o.getParameter(o.MAX_SAMPLES) : 0 };
17800
17800
  }
17801
17801
  function UQ(o) {
17802
17802
  const A = this;
17803
17803
  let e = null, i = 0, n = !1, a = !1;
17804
17804
  const g = new wr(), I = new yt(), u = { value: null, needsUpdate: !1 };
17805
17805
  function c(C, f, m, M) {
17806
- const F = C !== null ? C.length : 0;
17807
- let N = null;
17808
- if (F !== 0) {
17809
- if (N = u.value, M !== !0 || N === null) {
17810
- const R = m + 4 * F, G = f.matrixWorldInverse;
17811
- I.getNormalMatrix(G), (N === null || N.length < R) && (N = new Float32Array(R));
17812
- for (let _ = 0, L = m; _ !== F; ++_, L += 4) g.copy(C[_]).applyMatrix4(G, I), g.normal.toArray(N, L), N[L + 3] = g.constant;
17806
+ const L = C !== null ? C.length : 0;
17807
+ let G = null;
17808
+ if (L !== 0) {
17809
+ if (G = u.value, M !== !0 || G === null) {
17810
+ const _ = m + 4 * L, N = f.matrixWorldInverse;
17811
+ I.getNormalMatrix(N), (G === null || G.length < _) && (G = new Float32Array(_));
17812
+ for (let R = 0, F = m; R !== L; ++R, F += 4) g.copy(C[R]).applyMatrix4(N, I), g.normal.toArray(G, F), G[F + 3] = g.constant;
17813
17813
  }
17814
- u.value = N, u.needsUpdate = !0;
17814
+ u.value = G, u.needsUpdate = !0;
17815
17815
  }
17816
- return A.numPlanes = F, A.numIntersection = 0, N;
17816
+ return A.numPlanes = L, A.numIntersection = 0, G;
17817
17817
  }
17818
17818
  this.uniform = u, this.numPlanes = 0, this.numIntersection = 0, this.init = function(C, f) {
17819
17819
  const m = C.length !== 0 || f || i !== 0 || n;
@@ -17825,16 +17825,16 @@ void main() {
17825
17825
  }, this.setGlobalState = function(C, f) {
17826
17826
  e = c(C, f, 0);
17827
17827
  }, this.setState = function(C, f, m) {
17828
- const M = C.clippingPlanes, F = C.clipIntersection, N = C.clipShadows, R = o.get(C);
17829
- if (!n || M === null || M.length === 0 || a && !N) a ? c(null) : (function() {
17828
+ const M = C.clippingPlanes, L = C.clipIntersection, G = C.clipShadows, _ = o.get(C);
17829
+ if (!n || M === null || M.length === 0 || a && !G) a ? c(null) : (function() {
17830
17830
  u.value !== e && (u.value = e, u.needsUpdate = i > 0), A.numPlanes = i, A.numIntersection = 0;
17831
17831
  })();
17832
17832
  else {
17833
- const G = a ? 0 : i, _ = 4 * G;
17834
- let L = R.clippingState || null;
17835
- u.value = L, L = c(M, f, _, m);
17836
- for (let rA = 0; rA !== _; ++rA) L[rA] = e[rA];
17837
- R.clippingState = L, this.numIntersection = F ? this.numPlanes : 0, this.numPlanes += G;
17833
+ const N = a ? 0 : i, R = 4 * N;
17834
+ let F = _.clippingState || null;
17835
+ u.value = F, F = c(M, f, R, m);
17836
+ for (let rA = 0; rA !== R; ++rA) F[rA] = e[rA];
17837
+ _.clippingState = F, this.numIntersection = L ? this.numPlanes : 0, this.numPlanes += N;
17838
17838
  }
17839
17839
  };
17840
17840
  }
@@ -17951,12 +17951,12 @@ void main() {
17951
17951
  for (let m = 0; m < f; m++) {
17952
17952
  const M = Math.pow(2, C);
17953
17953
  u.push(M);
17954
- let F = 1 / M;
17955
- m > g - 4 ? F = Ph[m - g + 4 - 1] : m === 0 && (F = 0), c.push(F);
17956
- const N = 1 / (M - 2), R = -N, G = 1 + N, _ = [R, R, G, R, G, G, R, R, G, G, R, G], L = 6, rA = 6, tA = 3, eA = 2, QA = 1, bA = new Float32Array(tA * rA * L), IA = new Float32Array(eA * rA * L), RA = new Float32Array(QA * rA * L);
17957
- for (let jA = 0; jA < L; jA++) {
17954
+ let L = 1 / M;
17955
+ m > g - 4 ? L = Ph[m - g + 4 - 1] : m === 0 && (L = 0), c.push(L);
17956
+ const G = 1 / (M - 2), _ = -G, N = 1 + G, R = [_, _, N, _, N, N, _, _, N, N, _, N], F = 6, rA = 6, tA = 3, eA = 2, QA = 1, bA = new Float32Array(tA * rA * F), IA = new Float32Array(eA * rA * F), RA = new Float32Array(QA * rA * F);
17957
+ for (let jA = 0; jA < F; jA++) {
17958
17958
  const Ce = jA % 3 * 2 / 3 - 1, Qe = jA > 2 ? 0 : -1, Ve = [Ce, Qe, 0, Ce + 2 / 3, Qe, 0, Ce + 2 / 3, Qe + 1, 0, Ce, Qe, 0, Ce + 2 / 3, Qe + 1, 0, Ce, Qe + 1, 0];
17959
- bA.set(Ve, tA * rA * jA), IA.set(_, eA * rA * jA);
17959
+ bA.set(Ve, tA * rA * jA), IA.set(R, eA * rA * jA);
17960
17960
  const fe = [jA, jA, jA, jA, jA, jA];
17961
17961
  RA.set(fe, QA * rA * jA);
17962
17962
  }
@@ -18040,15 +18040,15 @@ void main() {
18040
18040
  u.getClearColor(Kh), u.toneMapping = k, u.autoClear = !1;
18041
18041
  const f = new $i({ name: "PMREM.Background", side: y, depthWrite: !1, depthTest: !1 }), m = new Tt(new Aa(), f);
18042
18042
  let M = !1;
18043
- const F = A.background;
18044
- F ? F.isColor && (f.color.copy(F), A.background = null, M = !0) : (f.color.copy(Kh), M = !0);
18045
- for (let N = 0; N < 6; N++) {
18046
- const R = N % 3;
18047
- R === 0 ? (a.up.set(0, g[N], 0), a.lookAt(I[N], 0, 0)) : R === 1 ? (a.up.set(0, 0, g[N]), a.lookAt(0, I[N], 0)) : (a.up.set(0, g[N], 0), a.lookAt(0, 0, I[N]));
18048
- const G = this._cubeSize;
18049
- Mg(n, R * G, N > 2 ? G : 0, G, G), u.setRenderTarget(n), M && u.render(m, a), u.render(A, a);
18043
+ const L = A.background;
18044
+ L ? L.isColor && (f.color.copy(L), A.background = null, M = !0) : (f.color.copy(Kh), M = !0);
18045
+ for (let G = 0; G < 6; G++) {
18046
+ const _ = G % 3;
18047
+ _ === 0 ? (a.up.set(0, g[G], 0), a.lookAt(I[G], 0, 0)) : _ === 1 ? (a.up.set(0, 0, g[G]), a.lookAt(0, I[G], 0)) : (a.up.set(0, g[G], 0), a.lookAt(0, 0, I[G]));
18048
+ const N = this._cubeSize;
18049
+ Mg(n, _ * N, G > 2 ? N : 0, N, N), u.setRenderTarget(n), M && u.render(m, a), u.render(A, a);
18050
18050
  }
18051
- m.geometry.dispose(), m.material.dispose(), u.toneMapping = C, u.autoClear = c, A.background = F;
18051
+ m.geometry.dispose(), m.material.dispose(), u.toneMapping = C, u.autoClear = c, A.background = L;
18052
18052
  }
18053
18053
  _textureToCubeUV(A, e) {
18054
18054
  const i = this._renderer, n = A.mapping === H || A.mapping === z;
@@ -18072,18 +18072,18 @@ void main() {
18072
18072
  this._halfBlur(A, g, e, i, n, "latitudinal", a), this._halfBlur(g, A, i, i, n, "longitudinal", a);
18073
18073
  }
18074
18074
  _halfBlur(A, e, i, n, a, g, I) {
18075
- const u = this._renderer, c = this._blurMaterial, C = new Tt(this._lodPlanes[n], c), f = c.uniforms, m = this._sizeLods[i] - 1, M = isFinite(a) ? Math.PI / (2 * m) : 2 * Math.PI / 39, F = a / M, N = isFinite(a) ? 1 + Math.floor(3 * F) : vg, R = [];
18076
- let G = 0;
18075
+ const u = this._renderer, c = this._blurMaterial, C = new Tt(this._lodPlanes[n], c), f = c.uniforms, m = this._sizeLods[i] - 1, M = isFinite(a) ? Math.PI / (2 * m) : 2 * Math.PI / 39, L = a / M, G = isFinite(a) ? 1 + Math.floor(3 * L) : vg, _ = [];
18076
+ let N = 0;
18077
18077
  for (let rA = 0; rA < vg; ++rA) {
18078
- const tA = rA / F, eA = Math.exp(-tA * tA / 2);
18079
- R.push(eA), rA === 0 ? G += eA : rA < N && (G += 2 * eA);
18078
+ const tA = rA / L, eA = Math.exp(-tA * tA / 2);
18079
+ _.push(eA), rA === 0 ? N += eA : rA < G && (N += 2 * eA);
18080
18080
  }
18081
- for (let rA = 0; rA < R.length; rA++) R[rA] = R[rA] / G;
18082
- f.envMap.value = A.texture, f.samples.value = N, f.weights.value = R, f.latitudinal.value = g === "latitudinal", I && (f.poleAxis.value = I);
18083
- const { _lodMax: _ } = this;
18084
- f.dTheta.value = M, f.mipInt.value = _ - i;
18085
- const L = this._sizeLods[n];
18086
- Mg(e, 3 * L * (n > _ - 4 ? n - _ + 4 : 0), 4 * (this._cubeSize - L), 3 * L, 2 * L), u.setRenderTarget(e), u.render(C, fc);
18081
+ for (let rA = 0; rA < _.length; rA++) _[rA] = _[rA] / N;
18082
+ f.envMap.value = A.texture, f.samples.value = G, f.weights.value = _, f.latitudinal.value = g === "latitudinal", I && (f.poleAxis.value = I);
18083
+ const { _lodMax: R } = this;
18084
+ f.dTheta.value = M, f.mipInt.value = R - i;
18085
+ const F = this._sizeLods[n];
18086
+ Mg(e, 3 * F * (n > R - 4 ? n - R + 4 : 0), 4 * (this._cubeSize - F), 3 * F, 2 * F), u.setRenderTarget(e), u.render(C, fc);
18087
18087
  }
18088
18088
  }
18089
18089
  function Vh(o, A, e) {
@@ -18276,24 +18276,24 @@ void main() {
18276
18276
  const c = [], C = u.index, f = u.attributes.position;
18277
18277
  let m = 0;
18278
18278
  if (C !== null) {
18279
- const N = C.array;
18279
+ const G = C.array;
18280
18280
  m = C.version;
18281
- for (let R = 0, G = N.length; R < G; R += 3) {
18282
- const _ = N[R + 0], L = N[R + 1], rA = N[R + 2];
18283
- c.push(_, L, L, rA, rA, _);
18281
+ for (let _ = 0, N = G.length; _ < N; _ += 3) {
18282
+ const R = G[_ + 0], F = G[_ + 1], rA = G[_ + 2];
18283
+ c.push(R, F, F, rA, rA, R);
18284
18284
  }
18285
18285
  } else {
18286
- const N = f.array;
18286
+ const G = f.array;
18287
18287
  m = f.version;
18288
- for (let R = 0, G = N.length / 3 - 1; R < G; R += 3) {
18289
- const _ = R + 0, L = R + 1, rA = R + 2;
18290
- c.push(_, L, L, rA, rA, _);
18288
+ for (let _ = 0, N = G.length / 3 - 1; _ < N; _ += 3) {
18289
+ const R = _ + 0, F = _ + 1, rA = _ + 2;
18290
+ c.push(R, F, F, rA, rA, R);
18291
18291
  }
18292
18292
  }
18293
18293
  const M = new (ds(c) ? kh : Nh)(c, 1);
18294
18294
  M.version = m;
18295
- const F = a.get(u);
18296
- F && A.remove(F), a.set(u, M);
18295
+ const L = a.get(u);
18296
+ L && A.remove(L), a.set(u, M);
18297
18297
  }
18298
18298
  return { get: function(u, c) {
18299
18299
  return n[c.id] === !0 || (c.addEventListener("dispose", g), n[c.id] = !0, e.memory.geometries++), c;
@@ -18303,7 +18303,7 @@ void main() {
18303
18303
  const C = u.morphAttributes;
18304
18304
  for (const f in C) {
18305
18305
  const m = C[f];
18306
- for (let M = 0, F = m.length; M < F; M++) A.update(m[M], o.ARRAY_BUFFER);
18306
+ for (let M = 0, L = m.length; M < L; M++) A.update(m[M], o.ARRAY_BUFFER);
18307
18307
  }
18308
18308
  }, getWireframeAttribute: function(u) {
18309
18309
  const c = a.get(u);
@@ -18367,15 +18367,15 @@ void main() {
18367
18367
  const f = u.morphTargetInfluences;
18368
18368
  if (A.isWebGL2 === !0) {
18369
18369
  const m = c.morphAttributes.position || c.morphAttributes.normal || c.morphAttributes.color, M = m !== void 0 ? m.length : 0;
18370
- let F = a.get(c);
18371
- if (F === void 0 || F.count !== M) {
18370
+ let L = a.get(c);
18371
+ if (L === void 0 || L.count !== M) {
18372
18372
  let Ce = function() {
18373
18373
  wA.dispose(), a.delete(c), c.removeEventListener("dispose", Ce);
18374
18374
  };
18375
- F !== void 0 && F.texture.dispose();
18376
- const G = c.morphAttributes.position !== void 0, _ = c.morphAttributes.normal !== void 0, L = c.morphAttributes.color !== void 0, rA = c.morphAttributes.position || [], tA = c.morphAttributes.normal || [], eA = c.morphAttributes.color || [];
18375
+ L !== void 0 && L.texture.dispose();
18376
+ const N = c.morphAttributes.position !== void 0, R = c.morphAttributes.normal !== void 0, F = c.morphAttributes.color !== void 0, rA = c.morphAttributes.position || [], tA = c.morphAttributes.normal || [], eA = c.morphAttributes.color || [];
18377
18377
  let QA = 0;
18378
- G === !0 && (QA = 1), _ === !0 && (QA = 2), L === !0 && (QA = 3);
18378
+ N === !0 && (QA = 1), R === !0 && (QA = 2), F === !0 && (QA = 3);
18379
18379
  let bA = c.attributes.position.count * QA, IA = 1;
18380
18380
  bA > A.maxTextureSize && (IA = Math.ceil(bA / A.maxTextureSize), bA = A.maxTextureSize);
18381
18381
  const RA = new Float32Array(bA * IA * 4 * M), wA = new ng(RA, bA, IA, M);
@@ -18385,38 +18385,38 @@ void main() {
18385
18385
  const Ve = rA[Qe], fe = tA[Qe], Me = eA[Qe], _e = bA * IA * 4 * Qe;
18386
18386
  for (let Fe = 0; Fe < Ve.count; Fe++) {
18387
18387
  const YA = Fe * jA;
18388
- G === !0 && (g.fromBufferAttribute(Ve, Fe), RA[_e + YA + 0] = g.x, RA[_e + YA + 1] = g.y, RA[_e + YA + 2] = g.z, RA[_e + YA + 3] = 0), _ === !0 && (g.fromBufferAttribute(fe, Fe), RA[_e + YA + 4] = g.x, RA[_e + YA + 5] = g.y, RA[_e + YA + 6] = g.z, RA[_e + YA + 7] = 0), L === !0 && (g.fromBufferAttribute(Me, Fe), RA[_e + YA + 8] = g.x, RA[_e + YA + 9] = g.y, RA[_e + YA + 10] = g.z, RA[_e + YA + 11] = Me.itemSize === 4 ? g.w : 1);
18388
+ N === !0 && (g.fromBufferAttribute(Ve, Fe), RA[_e + YA + 0] = g.x, RA[_e + YA + 1] = g.y, RA[_e + YA + 2] = g.z, RA[_e + YA + 3] = 0), R === !0 && (g.fromBufferAttribute(fe, Fe), RA[_e + YA + 4] = g.x, RA[_e + YA + 5] = g.y, RA[_e + YA + 6] = g.z, RA[_e + YA + 7] = 0), F === !0 && (g.fromBufferAttribute(Me, Fe), RA[_e + YA + 8] = g.x, RA[_e + YA + 9] = g.y, RA[_e + YA + 10] = g.z, RA[_e + YA + 11] = Me.itemSize === 4 ? g.w : 1);
18389
18389
  }
18390
18390
  }
18391
- F = { count: M, texture: wA, size: new Te(bA, IA) }, a.set(c, F), c.addEventListener("dispose", Ce);
18391
+ L = { count: M, texture: wA, size: new Te(bA, IA) }, a.set(c, L), c.addEventListener("dispose", Ce);
18392
18392
  }
18393
- let N = 0;
18394
- for (let G = 0; G < f.length; G++) N += f[G];
18395
- const R = c.morphTargetsRelative ? 1 : 1 - N;
18396
- C.getUniforms().setValue(o, "morphTargetBaseInfluence", R), C.getUniforms().setValue(o, "morphTargetInfluences", f), C.getUniforms().setValue(o, "morphTargetsTexture", F.texture, e), C.getUniforms().setValue(o, "morphTargetsTextureSize", F.size);
18393
+ let G = 0;
18394
+ for (let N = 0; N < f.length; N++) G += f[N];
18395
+ const _ = c.morphTargetsRelative ? 1 : 1 - G;
18396
+ C.getUniforms().setValue(o, "morphTargetBaseInfluence", _), C.getUniforms().setValue(o, "morphTargetInfluences", f), C.getUniforms().setValue(o, "morphTargetsTexture", L.texture, e), C.getUniforms().setValue(o, "morphTargetsTextureSize", L.size);
18397
18397
  } else {
18398
18398
  const m = f === void 0 ? 0 : f.length;
18399
18399
  let M = i[c.id];
18400
18400
  if (M === void 0 || M.length !== m) {
18401
18401
  M = [];
18402
- for (let _ = 0; _ < m; _++) M[_] = [_, 0];
18402
+ for (let R = 0; R < m; R++) M[R] = [R, 0];
18403
18403
  i[c.id] = M;
18404
18404
  }
18405
- for (let _ = 0; _ < m; _++) {
18406
- const L = M[_];
18407
- L[0] = _, L[1] = f[_];
18405
+ for (let R = 0; R < m; R++) {
18406
+ const F = M[R];
18407
+ F[0] = R, F[1] = f[R];
18408
18408
  }
18409
18409
  M.sort(zQ);
18410
- for (let _ = 0; _ < 8; _++) _ < m && M[_][1] ? (I[_][0] = M[_][0], I[_][1] = M[_][1]) : (I[_][0] = Number.MAX_SAFE_INTEGER, I[_][1] = 0);
18410
+ for (let R = 0; R < 8; R++) R < m && M[R][1] ? (I[R][0] = M[R][0], I[R][1] = M[R][1]) : (I[R][0] = Number.MAX_SAFE_INTEGER, I[R][1] = 0);
18411
18411
  I.sort(KQ);
18412
- const F = c.morphAttributes.position, N = c.morphAttributes.normal;
18413
- let R = 0;
18414
- for (let _ = 0; _ < 8; _++) {
18415
- const L = I[_], rA = L[0], tA = L[1];
18416
- rA !== Number.MAX_SAFE_INTEGER && tA ? (F && c.getAttribute("morphTarget" + _) !== F[rA] && c.setAttribute("morphTarget" + _, F[rA]), N && c.getAttribute("morphNormal" + _) !== N[rA] && c.setAttribute("morphNormal" + _, N[rA]), n[_] = tA, R += tA) : (F && c.hasAttribute("morphTarget" + _) === !0 && c.deleteAttribute("morphTarget" + _), N && c.hasAttribute("morphNormal" + _) === !0 && c.deleteAttribute("morphNormal" + _), n[_] = 0);
18412
+ const L = c.morphAttributes.position, G = c.morphAttributes.normal;
18413
+ let _ = 0;
18414
+ for (let R = 0; R < 8; R++) {
18415
+ const F = I[R], rA = F[0], tA = F[1];
18416
+ rA !== Number.MAX_SAFE_INTEGER && tA ? (L && c.getAttribute("morphTarget" + R) !== L[rA] && c.setAttribute("morphTarget" + R, L[rA]), G && c.getAttribute("morphNormal" + R) !== G[rA] && c.setAttribute("morphNormal" + R, G[rA]), n[R] = tA, _ += tA) : (L && c.hasAttribute("morphTarget" + R) === !0 && c.deleteAttribute("morphTarget" + R), G && c.hasAttribute("morphNormal" + R) === !0 && c.deleteAttribute("morphNormal" + R), n[R] = 0);
18417
18417
  }
18418
- const G = c.morphTargetsRelative ? 1 : 1 - R;
18419
- C.getUniforms().setValue(o, "morphTargetBaseInfluence", G), C.getUniforms().setValue(o, "morphTargetInfluences", n);
18418
+ const N = c.morphTargetsRelative ? 1 : 1 - _;
18419
+ C.getUniforms().setValue(o, "morphTargetBaseInfluence", N), C.getUniforms().setValue(o, "morphTargetInfluences", n);
18420
18420
  }
18421
18421
  } };
18422
18422
  }
@@ -18868,8 +18868,8 @@ void main() {
18868
18868
  const c = I.split(`
18869
18869
  `), C = [], f = Math.max(u - 6, 0), m = Math.min(u + 6, c.length);
18870
18870
  for (let M = f; M < m; M++) {
18871
- const F = M + 1;
18872
- C.push(`${F === u ? ">" : " "} ${F}: ${c[M]}`);
18871
+ const L = M + 1;
18872
+ C.push(`${L === u ? ">" : " "} ${L}: ${c[M]}`);
18873
18873
  }
18874
18874
  return C.join(`
18875
18875
  `);
@@ -18990,7 +18990,7 @@ precision ` + o.precision + " int;";
18990
18990
  })(e), M = e.isWebGL2 ? "" : (function(IA) {
18991
18991
  return [IA.extensionDerivatives || IA.envMapCubeUVHeight || IA.bumpMap || IA.normalMapTangentSpace || IA.clearcoatNormalMap || IA.flatShading || IA.shaderID === "physical" ? "#extension GL_OES_standard_derivatives : enable" : "", (IA.extensionFragDepth || IA.logarithmicDepthBuffer) && IA.rendererExtensionFragDepth ? "#extension GL_EXT_frag_depth : enable" : "", IA.extensionDrawBuffers && IA.rendererExtensionDrawBuffers ? "#extension GL_EXT_draw_buffers : require" : "", (IA.extensionShaderTextureLOD || IA.envMap || IA.transmission) && IA.rendererExtensionShaderTextureLod ? "#extension GL_EXT_shader_texture_lod : enable" : ""].filter(qa).join(`
18992
18992
  `);
18993
- })(e), F = (function(IA) {
18993
+ })(e), L = (function(IA) {
18994
18994
  const RA = [];
18995
18995
  for (const wA in IA) {
18996
18996
  const jA = IA[wA];
@@ -18998,32 +18998,32 @@ precision ` + o.precision + " int;";
18998
18998
  }
18999
18999
  return RA.join(`
19000
19000
  `);
19001
- })(a), N = n.createProgram();
19002
- let R, G, _ = e.glslVersion ? "#version " + e.glslVersion + `
19001
+ })(a), G = n.createProgram();
19002
+ let _, N, R = e.glslVersion ? "#version " + e.glslVersion + `
19003
19003
  ` : "";
19004
- e.isRawShaderMaterial ? (R = [F].filter(qa).join(`
19005
- `), R.length > 0 && (R += `
19006
- `), G = [M, F].filter(qa).join(`
19007
- `), G.length > 0 && (G += `
19008
- `)) : (R = [Iu(e), "#define SHADER_NAME " + e.shaderName, F, e.instancing ? "#define USE_INSTANCING" : "", e.instancingColor ? "#define USE_INSTANCING_COLOR" : "", e.useFog && e.fog ? "#define USE_FOG" : "", e.useFog && e.fogExp2 ? "#define FOG_EXP2" : "", e.map ? "#define USE_MAP" : "", e.envMap ? "#define USE_ENVMAP" : "", e.envMap ? "#define " + C : "", e.lightMap ? "#define USE_LIGHTMAP" : "", e.aoMap ? "#define USE_AOMAP" : "", e.bumpMap ? "#define USE_BUMPMAP" : "", e.normalMap ? "#define USE_NORMALMAP" : "", e.normalMapObjectSpace ? "#define USE_NORMALMAP_OBJECTSPACE" : "", e.normalMapTangentSpace ? "#define USE_NORMALMAP_TANGENTSPACE" : "", e.displacementMap ? "#define USE_DISPLACEMENTMAP" : "", e.emissiveMap ? "#define USE_EMISSIVEMAP" : "", e.clearcoatMap ? "#define USE_CLEARCOATMAP" : "", e.clearcoatRoughnessMap ? "#define USE_CLEARCOAT_ROUGHNESSMAP" : "", e.clearcoatNormalMap ? "#define USE_CLEARCOAT_NORMALMAP" : "", e.iridescenceMap ? "#define USE_IRIDESCENCEMAP" : "", e.iridescenceThicknessMap ? "#define USE_IRIDESCENCE_THICKNESSMAP" : "", e.specularMap ? "#define USE_SPECULARMAP" : "", e.specularColorMap ? "#define USE_SPECULAR_COLORMAP" : "", e.specularIntensityMap ? "#define USE_SPECULAR_INTENSITYMAP" : "", e.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", e.metalnessMap ? "#define USE_METALNESSMAP" : "", e.alphaMap ? "#define USE_ALPHAMAP" : "", e.transmission ? "#define USE_TRANSMISSION" : "", e.transmissionMap ? "#define USE_TRANSMISSIONMAP" : "", e.thicknessMap ? "#define USE_THICKNESSMAP" : "", e.sheenColorMap ? "#define USE_SHEEN_COLORMAP" : "", e.sheenRoughnessMap ? "#define USE_SHEEN_ROUGHNESSMAP" : "", e.mapUv ? "#define MAP_UV " + e.mapUv : "", e.alphaMapUv ? "#define ALPHAMAP_UV " + e.alphaMapUv : "", e.lightMapUv ? "#define LIGHTMAP_UV " + e.lightMapUv : "", e.aoMapUv ? "#define AOMAP_UV " + e.aoMapUv : "", e.emissiveMapUv ? "#define EMISSIVEMAP_UV " + e.emissiveMapUv : "", e.bumpMapUv ? "#define BUMPMAP_UV " + e.bumpMapUv : "", e.normalMapUv ? "#define NORMALMAP_UV " + e.normalMapUv : "", e.displacementMapUv ? "#define DISPLACEMENTMAP_UV " + e.displacementMapUv : "", e.metalnessMapUv ? "#define METALNESSMAP_UV " + e.metalnessMapUv : "", e.roughnessMapUv ? "#define ROUGHNESSMAP_UV " + e.roughnessMapUv : "", e.clearcoatMapUv ? "#define CLEARCOATMAP_UV " + e.clearcoatMapUv : "", e.clearcoatNormalMapUv ? "#define CLEARCOAT_NORMALMAP_UV " + e.clearcoatNormalMapUv : "", e.clearcoatRoughnessMapUv ? "#define CLEARCOAT_ROUGHNESSMAP_UV " + e.clearcoatRoughnessMapUv : "", e.iridescenceMapUv ? "#define IRIDESCENCEMAP_UV " + e.iridescenceMapUv : "", e.iridescenceThicknessMapUv ? "#define IRIDESCENCE_THICKNESSMAP_UV " + e.iridescenceThicknessMapUv : "", e.sheenColorMapUv ? "#define SHEEN_COLORMAP_UV " + e.sheenColorMapUv : "", e.sheenRoughnessMapUv ? "#define SHEEN_ROUGHNESSMAP_UV " + e.sheenRoughnessMapUv : "", e.specularMapUv ? "#define SPECULARMAP_UV " + e.specularMapUv : "", e.specularColorMapUv ? "#define SPECULAR_COLORMAP_UV " + e.specularColorMapUv : "", e.specularIntensityMapUv ? "#define SPECULAR_INTENSITYMAP_UV " + e.specularIntensityMapUv : "", e.transmissionMapUv ? "#define TRANSMISSIONMAP_UV " + e.transmissionMapUv : "", e.thicknessMapUv ? "#define THICKNESSMAP_UV " + e.thicknessMapUv : "", e.vertexTangents ? "#define USE_TANGENT" : "", e.vertexColors ? "#define USE_COLOR" : "", e.vertexAlphas ? "#define USE_COLOR_ALPHA" : "", e.vertexUv1s ? "#define USE_UV1" : "", e.vertexUv2s ? "#define USE_UV2" : "", e.vertexUv3s ? "#define USE_UV3" : "", e.pointsUvs ? "#define USE_POINTS_UV" : "", e.flatShading ? "#define FLAT_SHADED" : "", e.skinning ? "#define USE_SKINNING" : "", e.morphTargets ? "#define USE_MORPHTARGETS" : "", e.morphNormals && e.flatShading === !1 ? "#define USE_MORPHNORMALS" : "", e.morphColors && e.isWebGL2 ? "#define USE_MORPHCOLORS" : "", e.morphTargetsCount > 0 && e.isWebGL2 ? "#define MORPHTARGETS_TEXTURE" : "", e.morphTargetsCount > 0 && e.isWebGL2 ? "#define MORPHTARGETS_TEXTURE_STRIDE " + e.morphTextureStride : "", e.morphTargetsCount > 0 && e.isWebGL2 ? "#define MORPHTARGETS_COUNT " + e.morphTargetsCount : "", e.doubleSided ? "#define DOUBLE_SIDED" : "", e.flipSided ? "#define FLIP_SIDED" : "", e.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", e.shadowMapEnabled ? "#define " + u : "", e.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", e.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", e.logarithmicDepthBuffer && e.rendererExtensionFragDepth ? "#define USE_LOGDEPTHBUF_EXT" : "", "uniform mat4 modelMatrix;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform mat4 viewMatrix;", "uniform mat3 normalMatrix;", "uniform vec3 cameraPosition;", "uniform bool isOrthographic;", "#ifdef USE_INSTANCING", " attribute mat4 instanceMatrix;", "#endif", "#ifdef USE_INSTANCING_COLOR", " attribute vec3 instanceColor;", "#endif", "attribute vec3 position;", "attribute vec3 normal;", "attribute vec2 uv;", "#ifdef USE_UV1", " attribute vec2 uv1;", "#endif", "#ifdef USE_UV2", " attribute vec2 uv2;", "#endif", "#ifdef USE_UV3", " attribute vec2 uv3;", "#endif", "#ifdef USE_TANGENT", " attribute vec4 tangent;", "#endif", "#if defined( USE_COLOR_ALPHA )", " attribute vec4 color;", "#elif defined( USE_COLOR )", " attribute vec3 color;", "#endif", "#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )", " attribute vec3 morphTarget0;", " attribute vec3 morphTarget1;", " attribute vec3 morphTarget2;", " attribute vec3 morphTarget3;", " #ifdef USE_MORPHNORMALS", " attribute vec3 morphNormal0;", " attribute vec3 morphNormal1;", " attribute vec3 morphNormal2;", " attribute vec3 morphNormal3;", " #else", " attribute vec3 morphTarget4;", " attribute vec3 morphTarget5;", " attribute vec3 morphTarget6;", " attribute vec3 morphTarget7;", " #endif", "#endif", "#ifdef USE_SKINNING", " attribute vec4 skinIndex;", " attribute vec4 skinWeight;", "#endif", `
19004
+ e.isRawShaderMaterial ? (_ = [L].filter(qa).join(`
19005
+ `), _.length > 0 && (_ += `
19006
+ `), N = [M, L].filter(qa).join(`
19007
+ `), N.length > 0 && (N += `
19008
+ `)) : (_ = [Iu(e), "#define SHADER_NAME " + e.shaderName, L, e.instancing ? "#define USE_INSTANCING" : "", e.instancingColor ? "#define USE_INSTANCING_COLOR" : "", e.useFog && e.fog ? "#define USE_FOG" : "", e.useFog && e.fogExp2 ? "#define FOG_EXP2" : "", e.map ? "#define USE_MAP" : "", e.envMap ? "#define USE_ENVMAP" : "", e.envMap ? "#define " + C : "", e.lightMap ? "#define USE_LIGHTMAP" : "", e.aoMap ? "#define USE_AOMAP" : "", e.bumpMap ? "#define USE_BUMPMAP" : "", e.normalMap ? "#define USE_NORMALMAP" : "", e.normalMapObjectSpace ? "#define USE_NORMALMAP_OBJECTSPACE" : "", e.normalMapTangentSpace ? "#define USE_NORMALMAP_TANGENTSPACE" : "", e.displacementMap ? "#define USE_DISPLACEMENTMAP" : "", e.emissiveMap ? "#define USE_EMISSIVEMAP" : "", e.clearcoatMap ? "#define USE_CLEARCOATMAP" : "", e.clearcoatRoughnessMap ? "#define USE_CLEARCOAT_ROUGHNESSMAP" : "", e.clearcoatNormalMap ? "#define USE_CLEARCOAT_NORMALMAP" : "", e.iridescenceMap ? "#define USE_IRIDESCENCEMAP" : "", e.iridescenceThicknessMap ? "#define USE_IRIDESCENCE_THICKNESSMAP" : "", e.specularMap ? "#define USE_SPECULARMAP" : "", e.specularColorMap ? "#define USE_SPECULAR_COLORMAP" : "", e.specularIntensityMap ? "#define USE_SPECULAR_INTENSITYMAP" : "", e.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", e.metalnessMap ? "#define USE_METALNESSMAP" : "", e.alphaMap ? "#define USE_ALPHAMAP" : "", e.transmission ? "#define USE_TRANSMISSION" : "", e.transmissionMap ? "#define USE_TRANSMISSIONMAP" : "", e.thicknessMap ? "#define USE_THICKNESSMAP" : "", e.sheenColorMap ? "#define USE_SHEEN_COLORMAP" : "", e.sheenRoughnessMap ? "#define USE_SHEEN_ROUGHNESSMAP" : "", e.mapUv ? "#define MAP_UV " + e.mapUv : "", e.alphaMapUv ? "#define ALPHAMAP_UV " + e.alphaMapUv : "", e.lightMapUv ? "#define LIGHTMAP_UV " + e.lightMapUv : "", e.aoMapUv ? "#define AOMAP_UV " + e.aoMapUv : "", e.emissiveMapUv ? "#define EMISSIVEMAP_UV " + e.emissiveMapUv : "", e.bumpMapUv ? "#define BUMPMAP_UV " + e.bumpMapUv : "", e.normalMapUv ? "#define NORMALMAP_UV " + e.normalMapUv : "", e.displacementMapUv ? "#define DISPLACEMENTMAP_UV " + e.displacementMapUv : "", e.metalnessMapUv ? "#define METALNESSMAP_UV " + e.metalnessMapUv : "", e.roughnessMapUv ? "#define ROUGHNESSMAP_UV " + e.roughnessMapUv : "", e.clearcoatMapUv ? "#define CLEARCOATMAP_UV " + e.clearcoatMapUv : "", e.clearcoatNormalMapUv ? "#define CLEARCOAT_NORMALMAP_UV " + e.clearcoatNormalMapUv : "", e.clearcoatRoughnessMapUv ? "#define CLEARCOAT_ROUGHNESSMAP_UV " + e.clearcoatRoughnessMapUv : "", e.iridescenceMapUv ? "#define IRIDESCENCEMAP_UV " + e.iridescenceMapUv : "", e.iridescenceThicknessMapUv ? "#define IRIDESCENCE_THICKNESSMAP_UV " + e.iridescenceThicknessMapUv : "", e.sheenColorMapUv ? "#define SHEEN_COLORMAP_UV " + e.sheenColorMapUv : "", e.sheenRoughnessMapUv ? "#define SHEEN_ROUGHNESSMAP_UV " + e.sheenRoughnessMapUv : "", e.specularMapUv ? "#define SPECULARMAP_UV " + e.specularMapUv : "", e.specularColorMapUv ? "#define SPECULAR_COLORMAP_UV " + e.specularColorMapUv : "", e.specularIntensityMapUv ? "#define SPECULAR_INTENSITYMAP_UV " + e.specularIntensityMapUv : "", e.transmissionMapUv ? "#define TRANSMISSIONMAP_UV " + e.transmissionMapUv : "", e.thicknessMapUv ? "#define THICKNESSMAP_UV " + e.thicknessMapUv : "", e.vertexTangents ? "#define USE_TANGENT" : "", e.vertexColors ? "#define USE_COLOR" : "", e.vertexAlphas ? "#define USE_COLOR_ALPHA" : "", e.vertexUv1s ? "#define USE_UV1" : "", e.vertexUv2s ? "#define USE_UV2" : "", e.vertexUv3s ? "#define USE_UV3" : "", e.pointsUvs ? "#define USE_POINTS_UV" : "", e.flatShading ? "#define FLAT_SHADED" : "", e.skinning ? "#define USE_SKINNING" : "", e.morphTargets ? "#define USE_MORPHTARGETS" : "", e.morphNormals && e.flatShading === !1 ? "#define USE_MORPHNORMALS" : "", e.morphColors && e.isWebGL2 ? "#define USE_MORPHCOLORS" : "", e.morphTargetsCount > 0 && e.isWebGL2 ? "#define MORPHTARGETS_TEXTURE" : "", e.morphTargetsCount > 0 && e.isWebGL2 ? "#define MORPHTARGETS_TEXTURE_STRIDE " + e.morphTextureStride : "", e.morphTargetsCount > 0 && e.isWebGL2 ? "#define MORPHTARGETS_COUNT " + e.morphTargetsCount : "", e.doubleSided ? "#define DOUBLE_SIDED" : "", e.flipSided ? "#define FLIP_SIDED" : "", e.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", e.shadowMapEnabled ? "#define " + u : "", e.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", e.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", e.logarithmicDepthBuffer && e.rendererExtensionFragDepth ? "#define USE_LOGDEPTHBUF_EXT" : "", "uniform mat4 modelMatrix;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform mat4 viewMatrix;", "uniform mat3 normalMatrix;", "uniform vec3 cameraPosition;", "uniform bool isOrthographic;", "#ifdef USE_INSTANCING", " attribute mat4 instanceMatrix;", "#endif", "#ifdef USE_INSTANCING_COLOR", " attribute vec3 instanceColor;", "#endif", "attribute vec3 position;", "attribute vec3 normal;", "attribute vec2 uv;", "#ifdef USE_UV1", " attribute vec2 uv1;", "#endif", "#ifdef USE_UV2", " attribute vec2 uv2;", "#endif", "#ifdef USE_UV3", " attribute vec2 uv3;", "#endif", "#ifdef USE_TANGENT", " attribute vec4 tangent;", "#endif", "#if defined( USE_COLOR_ALPHA )", " attribute vec4 color;", "#elif defined( USE_COLOR )", " attribute vec3 color;", "#endif", "#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )", " attribute vec3 morphTarget0;", " attribute vec3 morphTarget1;", " attribute vec3 morphTarget2;", " attribute vec3 morphTarget3;", " #ifdef USE_MORPHNORMALS", " attribute vec3 morphNormal0;", " attribute vec3 morphNormal1;", " attribute vec3 morphNormal2;", " attribute vec3 morphNormal3;", " #else", " attribute vec3 morphTarget4;", " attribute vec3 morphTarget5;", " attribute vec3 morphTarget6;", " attribute vec3 morphTarget7;", " #endif", "#endif", "#ifdef USE_SKINNING", " attribute vec4 skinIndex;", " attribute vec4 skinWeight;", "#endif", `
19009
19009
  `].filter(qa).join(`
19010
- `), G = [M, Iu(e), "#define SHADER_NAME " + e.shaderName, F, e.useFog && e.fog ? "#define USE_FOG" : "", e.useFog && e.fogExp2 ? "#define FOG_EXP2" : "", e.map ? "#define USE_MAP" : "", e.matcap ? "#define USE_MATCAP" : "", e.envMap ? "#define USE_ENVMAP" : "", e.envMap ? "#define " + c : "", e.envMap ? "#define " + C : "", e.envMap ? "#define " + f : "", m ? "#define CUBEUV_TEXEL_WIDTH " + m.texelWidth : "", m ? "#define CUBEUV_TEXEL_HEIGHT " + m.texelHeight : "", m ? "#define CUBEUV_MAX_MIP " + m.maxMip + ".0" : "", e.lightMap ? "#define USE_LIGHTMAP" : "", e.aoMap ? "#define USE_AOMAP" : "", e.bumpMap ? "#define USE_BUMPMAP" : "", e.normalMap ? "#define USE_NORMALMAP" : "", e.normalMapObjectSpace ? "#define USE_NORMALMAP_OBJECTSPACE" : "", e.normalMapTangentSpace ? "#define USE_NORMALMAP_TANGENTSPACE" : "", e.emissiveMap ? "#define USE_EMISSIVEMAP" : "", e.clearcoat ? "#define USE_CLEARCOAT" : "", e.clearcoatMap ? "#define USE_CLEARCOATMAP" : "", e.clearcoatRoughnessMap ? "#define USE_CLEARCOAT_ROUGHNESSMAP" : "", e.clearcoatNormalMap ? "#define USE_CLEARCOAT_NORMALMAP" : "", e.iridescence ? "#define USE_IRIDESCENCE" : "", e.iridescenceMap ? "#define USE_IRIDESCENCEMAP" : "", e.iridescenceThicknessMap ? "#define USE_IRIDESCENCE_THICKNESSMAP" : "", e.specularMap ? "#define USE_SPECULARMAP" : "", e.specularColorMap ? "#define USE_SPECULAR_COLORMAP" : "", e.specularIntensityMap ? "#define USE_SPECULAR_INTENSITYMAP" : "", e.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", e.metalnessMap ? "#define USE_METALNESSMAP" : "", e.alphaMap ? "#define USE_ALPHAMAP" : "", e.alphaTest ? "#define USE_ALPHATEST" : "", e.sheen ? "#define USE_SHEEN" : "", e.sheenColorMap ? "#define USE_SHEEN_COLORMAP" : "", e.sheenRoughnessMap ? "#define USE_SHEEN_ROUGHNESSMAP" : "", e.transmission ? "#define USE_TRANSMISSION" : "", e.transmissionMap ? "#define USE_TRANSMISSIONMAP" : "", e.thicknessMap ? "#define USE_THICKNESSMAP" : "", e.vertexTangents ? "#define USE_TANGENT" : "", e.vertexColors || e.instancingColor ? "#define USE_COLOR" : "", e.vertexAlphas ? "#define USE_COLOR_ALPHA" : "", e.vertexUv1s ? "#define USE_UV1" : "", e.vertexUv2s ? "#define USE_UV2" : "", e.vertexUv3s ? "#define USE_UV3" : "", e.pointsUvs ? "#define USE_POINTS_UV" : "", e.gradientMap ? "#define USE_GRADIENTMAP" : "", e.flatShading ? "#define FLAT_SHADED" : "", e.doubleSided ? "#define DOUBLE_SIDED" : "", e.flipSided ? "#define FLIP_SIDED" : "", e.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", e.shadowMapEnabled ? "#define " + u : "", e.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", e.useLegacyLights ? "#define LEGACY_LIGHTS" : "", e.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", e.logarithmicDepthBuffer && e.rendererExtensionFragDepth ? "#define USE_LOGDEPTHBUF_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", "uniform bool isOrthographic;", e.toneMapping !== k ? "#define TONE_MAPPING" : "", e.toneMapping !== k ? kt.tonemapping_pars_fragment : "", e.toneMapping !== k ? Hf("toneMapping", e.toneMapping) : "", e.dithering ? "#define DITHERING" : "", e.opaque ? "#define OPAQUE" : "", kt.encodings_pars_fragment, Tf("linearToOutputTexel", e.outputColorSpace), e.useDepthPacking ? "#define DEPTH_PACKING " + e.depthPacking : "", `
19010
+ `), N = [M, Iu(e), "#define SHADER_NAME " + e.shaderName, L, e.useFog && e.fog ? "#define USE_FOG" : "", e.useFog && e.fogExp2 ? "#define FOG_EXP2" : "", e.map ? "#define USE_MAP" : "", e.matcap ? "#define USE_MATCAP" : "", e.envMap ? "#define USE_ENVMAP" : "", e.envMap ? "#define " + c : "", e.envMap ? "#define " + C : "", e.envMap ? "#define " + f : "", m ? "#define CUBEUV_TEXEL_WIDTH " + m.texelWidth : "", m ? "#define CUBEUV_TEXEL_HEIGHT " + m.texelHeight : "", m ? "#define CUBEUV_MAX_MIP " + m.maxMip + ".0" : "", e.lightMap ? "#define USE_LIGHTMAP" : "", e.aoMap ? "#define USE_AOMAP" : "", e.bumpMap ? "#define USE_BUMPMAP" : "", e.normalMap ? "#define USE_NORMALMAP" : "", e.normalMapObjectSpace ? "#define USE_NORMALMAP_OBJECTSPACE" : "", e.normalMapTangentSpace ? "#define USE_NORMALMAP_TANGENTSPACE" : "", e.emissiveMap ? "#define USE_EMISSIVEMAP" : "", e.clearcoat ? "#define USE_CLEARCOAT" : "", e.clearcoatMap ? "#define USE_CLEARCOATMAP" : "", e.clearcoatRoughnessMap ? "#define USE_CLEARCOAT_ROUGHNESSMAP" : "", e.clearcoatNormalMap ? "#define USE_CLEARCOAT_NORMALMAP" : "", e.iridescence ? "#define USE_IRIDESCENCE" : "", e.iridescenceMap ? "#define USE_IRIDESCENCEMAP" : "", e.iridescenceThicknessMap ? "#define USE_IRIDESCENCE_THICKNESSMAP" : "", e.specularMap ? "#define USE_SPECULARMAP" : "", e.specularColorMap ? "#define USE_SPECULAR_COLORMAP" : "", e.specularIntensityMap ? "#define USE_SPECULAR_INTENSITYMAP" : "", e.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", e.metalnessMap ? "#define USE_METALNESSMAP" : "", e.alphaMap ? "#define USE_ALPHAMAP" : "", e.alphaTest ? "#define USE_ALPHATEST" : "", e.sheen ? "#define USE_SHEEN" : "", e.sheenColorMap ? "#define USE_SHEEN_COLORMAP" : "", e.sheenRoughnessMap ? "#define USE_SHEEN_ROUGHNESSMAP" : "", e.transmission ? "#define USE_TRANSMISSION" : "", e.transmissionMap ? "#define USE_TRANSMISSIONMAP" : "", e.thicknessMap ? "#define USE_THICKNESSMAP" : "", e.vertexTangents ? "#define USE_TANGENT" : "", e.vertexColors || e.instancingColor ? "#define USE_COLOR" : "", e.vertexAlphas ? "#define USE_COLOR_ALPHA" : "", e.vertexUv1s ? "#define USE_UV1" : "", e.vertexUv2s ? "#define USE_UV2" : "", e.vertexUv3s ? "#define USE_UV3" : "", e.pointsUvs ? "#define USE_POINTS_UV" : "", e.gradientMap ? "#define USE_GRADIENTMAP" : "", e.flatShading ? "#define FLAT_SHADED" : "", e.doubleSided ? "#define DOUBLE_SIDED" : "", e.flipSided ? "#define FLIP_SIDED" : "", e.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", e.shadowMapEnabled ? "#define " + u : "", e.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", e.useLegacyLights ? "#define LEGACY_LIGHTS" : "", e.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", e.logarithmicDepthBuffer && e.rendererExtensionFragDepth ? "#define USE_LOGDEPTHBUF_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", "uniform bool isOrthographic;", e.toneMapping !== k ? "#define TONE_MAPPING" : "", e.toneMapping !== k ? kt.tonemapping_pars_fragment : "", e.toneMapping !== k ? Hf("toneMapping", e.toneMapping) : "", e.dithering ? "#define DITHERING" : "", e.opaque ? "#define OPAQUE" : "", kt.encodings_pars_fragment, Tf("linearToOutputTexel", e.outputColorSpace), e.useDepthPacking ? "#define DEPTH_PACKING " + e.depthPacking : "", `
19011
19011
  `].filter(qa).join(`
19012
- `)), g = yc(g), g = gu(g, e), g = lu(g, e), I = yc(I), I = gu(I, e), I = lu(I, e), g = cu(g), I = cu(I), e.isWebGL2 && e.isRawShaderMaterial !== !0 && (_ = `#version 300 es
19013
- `, R = ["precision mediump sampler2DArray;", "#define attribute in", "#define varying out", "#define texture2D texture"].join(`
19012
+ `)), g = yc(g), g = gu(g, e), g = lu(g, e), I = yc(I), I = gu(I, e), I = lu(I, e), g = cu(g), I = cu(I), e.isWebGL2 && e.isRawShaderMaterial !== !0 && (R = `#version 300 es
19013
+ `, _ = ["precision mediump sampler2DArray;", "#define attribute in", "#define varying out", "#define texture2D texture"].join(`
19014
19014
  `) + `
19015
- ` + R, G = ["#define varying in", e.glslVersion === JA ? "" : "layout(location = 0) out highp vec4 pc_fragColor;", e.glslVersion === JA ? "" : "#define gl_FragColor pc_fragColor", "#define gl_FragDepthEXT gl_FragDepth", "#define texture2D texture", "#define textureCube texture", "#define texture2DProj textureProj", "#define texture2DLodEXT textureLod", "#define texture2DProjLodEXT textureProjLod", "#define textureCubeLodEXT textureLod", "#define texture2DGradEXT textureGrad", "#define texture2DProjGradEXT textureProjGrad", "#define textureCubeGradEXT textureGrad"].join(`
19015
+ ` + _, N = ["#define varying in", e.glslVersion === JA ? "" : "layout(location = 0) out highp vec4 pc_fragColor;", e.glslVersion === JA ? "" : "#define gl_FragColor pc_fragColor", "#define gl_FragDepthEXT gl_FragDepth", "#define texture2D texture", "#define textureCube texture", "#define texture2DProj textureProj", "#define texture2DLodEXT textureLod", "#define texture2DProjLodEXT textureProjLod", "#define textureCubeLodEXT textureLod", "#define texture2DGradEXT textureGrad", "#define texture2DProjGradEXT textureProjGrad", "#define textureCubeGradEXT textureGrad"].join(`
19016
19016
  `) + `
19017
- ` + G);
19018
- const L = _ + R + g, rA = _ + G + I, tA = au(n, n.VERTEX_SHADER, L), eA = au(n, n.FRAGMENT_SHADER, rA);
19019
- if (n.attachShader(N, tA), n.attachShader(N, eA), e.index0AttributeName !== void 0 ? n.bindAttribLocation(N, 0, e.index0AttributeName) : e.morphTargets === !0 && n.bindAttribLocation(N, 0, "position"), n.linkProgram(N), o.debug.checkShaderErrors) {
19020
- const IA = n.getProgramInfoLog(N).trim(), RA = n.getShaderInfoLog(tA).trim(), wA = n.getShaderInfoLog(eA).trim();
19017
+ ` + N);
19018
+ const F = R + _ + g, rA = R + N + I, tA = au(n, n.VERTEX_SHADER, F), eA = au(n, n.FRAGMENT_SHADER, rA);
19019
+ if (n.attachShader(G, tA), n.attachShader(G, eA), e.index0AttributeName !== void 0 ? n.bindAttribLocation(G, 0, e.index0AttributeName) : e.morphTargets === !0 && n.bindAttribLocation(G, 0, "position"), n.linkProgram(G), o.debug.checkShaderErrors) {
19020
+ const IA = n.getProgramInfoLog(G).trim(), RA = n.getShaderInfoLog(tA).trim(), wA = n.getShaderInfoLog(eA).trim();
19021
19021
  let jA = !0, Ce = !0;
19022
- n.getProgramParameter(N, n.LINK_STATUS) === !1 ? (jA = !1, typeof o.debug.onShaderError == "function" ? o.debug.onShaderError(n, N, tA, eA) : (ou(n, tA, "vertex"), ou(n, eA, "fragment"), n.getError(), n.getProgramParameter(N, n.VALIDATE_STATUS))) : IA !== "" || RA !== "" && wA !== "" || (Ce = !1), Ce && (this.diagnostics = { runnable: jA, programLog: IA, vertexShader: { log: RA, prefix: R }, fragmentShader: { log: wA, prefix: G } });
19022
+ n.getProgramParameter(G, n.LINK_STATUS) === !1 ? (jA = !1, typeof o.debug.onShaderError == "function" ? o.debug.onShaderError(n, G, tA, eA) : (ou(n, tA, "vertex"), ou(n, eA, "fragment"), n.getError(), n.getProgramParameter(G, n.VALIDATE_STATUS))) : IA !== "" || RA !== "" && wA !== "" || (Ce = !1), Ce && (this.diagnostics = { runnable: jA, programLog: IA, vertexShader: { log: RA, prefix: _ }, fragmentShader: { log: wA, prefix: N } });
19023
19023
  }
19024
19024
  let QA, bA;
19025
19025
  return n.deleteShader(tA), n.deleteShader(eA), this.getUniforms = function() {
19026
- return QA === void 0 && (QA = new xg(n, N)), QA;
19026
+ return QA === void 0 && (QA = new xg(n, G)), QA;
19027
19027
  }, this.getAttributes = function() {
19028
19028
  return bA === void 0 && (bA = (function(IA, RA) {
19029
19029
  const wA = {}, jA = IA.getProgramParameter(RA, IA.ACTIVE_ATTRIBUTES);
@@ -19033,10 +19033,10 @@ precision ` + o.precision + " int;";
19033
19033
  Qe.type === IA.FLOAT_MAT2 && (fe = 2), Qe.type === IA.FLOAT_MAT3 && (fe = 3), Qe.type === IA.FLOAT_MAT4 && (fe = 4), wA[Ve] = { type: Qe.type, location: IA.getAttribLocation(RA, Ve), locationSize: fe };
19034
19034
  }
19035
19035
  return wA;
19036
- })(n, N)), bA;
19036
+ })(n, G)), bA;
19037
19037
  }, this.destroy = function() {
19038
- i.releaseStatesOfProgram(this), n.deleteProgram(N), this.program = void 0;
19039
- }, this.name = e.shaderName, this.id = Uf++, this.cacheKey = A, this.usedTimes = 1, this.program = N, this.vertexShader = tA, this.fragmentShader = eA, this;
19038
+ i.releaseStatesOfProgram(this), n.deleteProgram(G), this.program = void 0;
19039
+ }, this.name = e.shaderName, this.id = Uf++, this.cacheKey = A, this.usedTimes = 1, this.program = G, this.vertexShader = tA, this.fragmentShader = eA, this;
19040
19040
  }
19041
19041
  let zf = 0;
19042
19042
  class qf {
@@ -19080,54 +19080,54 @@ precision ` + o.precision + " int;";
19080
19080
  function Wf(o, A, e, i, n, a, g) {
19081
19081
  const I = new lc(), u = new qf(), c = [], C = n.isWebGL2, f = n.logarithmicDepthBuffer, m = n.vertexTextures;
19082
19082
  let M = n.precision;
19083
- const F = { MeshDepthMaterial: "depth", MeshDistanceMaterial: "distanceRGBA", MeshNormalMaterial: "normal", MeshBasicMaterial: "basic", MeshLambertMaterial: "lambert", MeshPhongMaterial: "phong", MeshToonMaterial: "toon", MeshStandardMaterial: "physical", MeshPhysicalMaterial: "physical", MeshMatcapMaterial: "matcap", LineBasicMaterial: "basic", LineDashedMaterial: "dashed", PointsMaterial: "points", ShadowMaterial: "shadow", SpriteMaterial: "sprite" };
19084
- function N(R) {
19085
- return R === 1 ? "uv1" : R === 2 ? "uv2" : R === 3 ? "uv3" : "uv";
19083
+ const L = { MeshDepthMaterial: "depth", MeshDistanceMaterial: "distanceRGBA", MeshNormalMaterial: "normal", MeshBasicMaterial: "basic", MeshLambertMaterial: "lambert", MeshPhongMaterial: "phong", MeshToonMaterial: "toon", MeshStandardMaterial: "physical", MeshPhysicalMaterial: "physical", MeshMatcapMaterial: "matcap", LineBasicMaterial: "basic", LineDashedMaterial: "dashed", PointsMaterial: "points", ShadowMaterial: "shadow", SpriteMaterial: "sprite" };
19084
+ function G(_) {
19085
+ return _ === 1 ? "uv1" : _ === 2 ? "uv2" : _ === 3 ? "uv3" : "uv";
19086
19086
  }
19087
- return { getParameters: function(R, G, _, L, rA) {
19088
- const tA = L.fog, eA = rA.geometry, QA = R.isMeshStandardMaterial ? L.environment : null, bA = (R.isMeshStandardMaterial ? e : A).get(R.envMap || QA), IA = bA && bA.mapping === cA ? bA.image.height : null, RA = F[R.type];
19089
- R.precision !== null && (M = n.getMaxPrecision(R.precision), M !== R.precision && R.precision);
19087
+ return { getParameters: function(_, N, R, F, rA) {
19088
+ const tA = F.fog, eA = rA.geometry, QA = _.isMeshStandardMaterial ? F.environment : null, bA = (_.isMeshStandardMaterial ? e : A).get(_.envMap || QA), IA = bA && bA.mapping === cA ? bA.image.height : null, RA = L[_.type];
19089
+ _.precision !== null && (M = n.getMaxPrecision(_.precision), M !== _.precision && _.precision);
19090
19090
  const wA = eA.morphAttributes.position || eA.morphAttributes.normal || eA.morphAttributes.color, jA = wA !== void 0 ? wA.length : 0;
19091
19091
  let Ce, Qe, Ve, fe, Me = 0;
19092
19092
  if (eA.morphAttributes.position !== void 0 && (Me = 1), eA.morphAttributes.normal !== void 0 && (Me = 2), eA.morphAttributes.color !== void 0 && (Me = 3), RA) {
19093
19093
  const Le = tr[RA];
19094
19094
  Ce = Le.vertexShader, Qe = Le.fragmentShader;
19095
- } else Ce = R.vertexShader, Qe = R.fragmentShader, u.update(R), Ve = u.getVertexShaderID(R), fe = u.getFragmentShaderID(R);
19096
- const _e = o.getRenderTarget(), Fe = rA.isInstancedMesh === !0, YA = !!R.map, de = !!R.matcap, be = !!bA, ge = !!R.aoMap, Xe = !!R.lightMap, oA = !!R.bumpMap, lA = !!R.normalMap, vA = !!R.displacementMap, WA = !!R.emissiveMap, xA = !!R.metalnessMap, Be = !!R.roughnessMap, kA = R.clearcoat > 0, sA = R.iridescence > 0, TA = R.sheen > 0, ce = R.transmission > 0, Se = kA && !!R.clearcoatMap, Ie = kA && !!R.clearcoatNormalMap, Pe = kA && !!R.clearcoatRoughnessMap, He = sA && !!R.iridescenceMap, Re = sA && !!R.iridescenceThicknessMap, Ct = TA && !!R.sheenColorMap, It = TA && !!R.sheenRoughnessMap, J = !!R.specularMap, $ = !!R.specularColorMap, MA = !!R.specularIntensityMap, te = ce && !!R.transmissionMap, XA = ce && !!R.thicknessMap, _A = !!R.gradientMap, OA = !!R.alphaMap, Ye = R.alphaTest > 0, We = !!R.extensions, yA = !!eA.attributes.uv1, Ke = !!eA.attributes.uv2, ze = !!eA.attributes.uv3;
19097
- return { isWebGL2: C, shaderID: RA, shaderName: R.type, vertexShader: Ce, fragmentShader: Qe, defines: R.defines, customVertexShaderID: Ve, customFragmentShaderID: fe, isRawShaderMaterial: R.isRawShaderMaterial === !0, glslVersion: R.glslVersion, precision: M, instancing: Fe, instancingColor: Fe && rA.instanceColor !== null, supportsVertexTextures: m, outputColorSpace: _e === null ? o.outputColorSpace : _e.isXRRenderTarget === !0 ? _e.texture.colorSpace : q, map: YA, matcap: de, envMap: be, envMapMode: be && bA.mapping, envMapCubeUVHeight: IA, aoMap: ge, lightMap: Xe, bumpMap: oA, normalMap: lA, displacementMap: m && vA, emissiveMap: WA, normalMapObjectSpace: lA && R.normalMapType === 1, normalMapTangentSpace: lA && R.normalMapType === 0, metalnessMap: xA, roughnessMap: Be, clearcoat: kA, clearcoatMap: Se, clearcoatNormalMap: Ie, clearcoatRoughnessMap: Pe, iridescence: sA, iridescenceMap: He, iridescenceThicknessMap: Re, sheen: TA, sheenColorMap: Ct, sheenRoughnessMap: It, specularMap: J, specularColorMap: $, specularIntensityMap: MA, transmission: ce, transmissionMap: te, thicknessMap: XA, gradientMap: _A, opaque: R.transparent === !1 && R.blending === 1, alphaMap: OA, alphaTest: Ye, combine: R.combine, mapUv: YA && N(R.map.channel), aoMapUv: ge && N(R.aoMap.channel), lightMapUv: Xe && N(R.lightMap.channel), bumpMapUv: oA && N(R.bumpMap.channel), normalMapUv: lA && N(R.normalMap.channel), displacementMapUv: vA && N(R.displacementMap.channel), emissiveMapUv: WA && N(R.emissiveMap.channel), metalnessMapUv: xA && N(R.metalnessMap.channel), roughnessMapUv: Be && N(R.roughnessMap.channel), clearcoatMapUv: Se && N(R.clearcoatMap.channel), clearcoatNormalMapUv: Ie && N(R.clearcoatNormalMap.channel), clearcoatRoughnessMapUv: Pe && N(R.clearcoatRoughnessMap.channel), iridescenceMapUv: He && N(R.iridescenceMap.channel), iridescenceThicknessMapUv: Re && N(R.iridescenceThicknessMap.channel), sheenColorMapUv: Ct && N(R.sheenColorMap.channel), sheenRoughnessMapUv: It && N(R.sheenRoughnessMap.channel), specularMapUv: J && N(R.specularMap.channel), specularColorMapUv: $ && N(R.specularColorMap.channel), specularIntensityMapUv: MA && N(R.specularIntensityMap.channel), transmissionMapUv: te && N(R.transmissionMap.channel), thicknessMapUv: XA && N(R.thicknessMap.channel), alphaMapUv: OA && N(R.alphaMap.channel), vertexTangents: lA && !!eA.attributes.tangent, vertexColors: R.vertexColors, vertexAlphas: R.vertexColors === !0 && !!eA.attributes.color && eA.attributes.color.itemSize === 4, vertexUv1s: yA, vertexUv2s: Ke, vertexUv3s: ze, pointsUvs: rA.isPoints === !0 && !!eA.attributes.uv && (YA || OA), fog: !!tA, useFog: R.fog === !0, fogExp2: tA && tA.isFogExp2, flatShading: R.flatShading === !0, sizeAttenuation: R.sizeAttenuation === !0, logarithmicDepthBuffer: f, skinning: rA.isSkinnedMesh === !0, morphTargets: eA.morphAttributes.position !== void 0, morphNormals: eA.morphAttributes.normal !== void 0, morphColors: eA.morphAttributes.color !== void 0, morphTargetsCount: jA, morphTextureStride: Me, numDirLights: G.directional.length, numPointLights: G.point.length, numSpotLights: G.spot.length, numSpotLightMaps: G.spotLightMap.length, numRectAreaLights: G.rectArea.length, numHemiLights: G.hemi.length, numDirLightShadows: G.directionalShadowMap.length, numPointLightShadows: G.pointShadowMap.length, numSpotLightShadows: G.spotShadowMap.length, numSpotLightShadowsWithMaps: G.numSpotLightShadowsWithMaps, numClippingPlanes: g.numPlanes, numClipIntersection: g.numIntersection, dithering: R.dithering, shadowMapEnabled: o.shadowMap.enabled && _.length > 0, shadowMapType: o.shadowMap.type, toneMapping: R.toneMapped ? o.toneMapping : k, useLegacyLights: o.useLegacyLights, premultipliedAlpha: R.premultipliedAlpha, doubleSided: R.side === 2, flipSided: R.side === y, useDepthPacking: R.depthPacking >= 0, depthPacking: R.depthPacking || 0, index0AttributeName: R.index0AttributeName, extensionDerivatives: We && R.extensions.derivatives === !0, extensionFragDepth: We && R.extensions.fragDepth === !0, extensionDrawBuffers: We && R.extensions.drawBuffers === !0, extensionShaderTextureLOD: We && R.extensions.shaderTextureLOD === !0, rendererExtensionFragDepth: C || i.has("EXT_frag_depth"), rendererExtensionDrawBuffers: C || i.has("WEBGL_draw_buffers"), rendererExtensionShaderTextureLod: C || i.has("EXT_shader_texture_lod"), customProgramCacheKey: R.customProgramCacheKey() };
19098
- }, getProgramCacheKey: function(R) {
19099
- const G = [];
19100
- if (R.shaderID ? G.push(R.shaderID) : (G.push(R.customVertexShaderID), G.push(R.customFragmentShaderID)), R.defines !== void 0) for (const _ in R.defines) G.push(_), G.push(R.defines[_]);
19101
- return R.isRawShaderMaterial === !1 && ((function(_, L) {
19102
- _.push(L.precision), _.push(L.outputColorSpace), _.push(L.envMapMode), _.push(L.envMapCubeUVHeight), _.push(L.mapUv), _.push(L.alphaMapUv), _.push(L.lightMapUv), _.push(L.aoMapUv), _.push(L.bumpMapUv), _.push(L.normalMapUv), _.push(L.displacementMapUv), _.push(L.emissiveMapUv), _.push(L.metalnessMapUv), _.push(L.roughnessMapUv), _.push(L.clearcoatMapUv), _.push(L.clearcoatNormalMapUv), _.push(L.clearcoatRoughnessMapUv), _.push(L.iridescenceMapUv), _.push(L.iridescenceThicknessMapUv), _.push(L.sheenColorMapUv), _.push(L.sheenRoughnessMapUv), _.push(L.specularMapUv), _.push(L.specularColorMapUv), _.push(L.specularIntensityMapUv), _.push(L.transmissionMapUv), _.push(L.thicknessMapUv), _.push(L.combine), _.push(L.fogExp2), _.push(L.sizeAttenuation), _.push(L.morphTargetsCount), _.push(L.morphAttributeCount), _.push(L.numDirLights), _.push(L.numPointLights), _.push(L.numSpotLights), _.push(L.numSpotLightMaps), _.push(L.numHemiLights), _.push(L.numRectAreaLights), _.push(L.numDirLightShadows), _.push(L.numPointLightShadows), _.push(L.numSpotLightShadows), _.push(L.numSpotLightShadowsWithMaps), _.push(L.shadowMapType), _.push(L.toneMapping), _.push(L.numClippingPlanes), _.push(L.numClipIntersection), _.push(L.depthPacking);
19103
- })(G, R), (function(_, L) {
19104
- I.disableAll(), L.isWebGL2 && I.enable(0), L.supportsVertexTextures && I.enable(1), L.instancing && I.enable(2), L.instancingColor && I.enable(3), L.matcap && I.enable(4), L.envMap && I.enable(5), L.normalMapObjectSpace && I.enable(6), L.normalMapTangentSpace && I.enable(7), L.clearcoat && I.enable(8), L.iridescence && I.enable(9), L.alphaTest && I.enable(10), L.vertexColors && I.enable(11), L.vertexAlphas && I.enable(12), L.vertexUv1s && I.enable(13), L.vertexUv2s && I.enable(14), L.vertexUv3s && I.enable(15), L.vertexTangents && I.enable(16), _.push(I.mask), I.disableAll(), L.fog && I.enable(0), L.useFog && I.enable(1), L.flatShading && I.enable(2), L.logarithmicDepthBuffer && I.enable(3), L.skinning && I.enable(4), L.morphTargets && I.enable(5), L.morphNormals && I.enable(6), L.morphColors && I.enable(7), L.premultipliedAlpha && I.enable(8), L.shadowMapEnabled && I.enable(9), L.useLegacyLights && I.enable(10), L.doubleSided && I.enable(11), L.flipSided && I.enable(12), L.useDepthPacking && I.enable(13), L.dithering && I.enable(14), L.transmission && I.enable(15), L.sheen && I.enable(16), L.opaque && I.enable(17), L.pointsUvs && I.enable(18), _.push(I.mask);
19105
- })(G, R), G.push(o.outputColorSpace)), G.push(R.customProgramCacheKey), G.join();
19106
- }, getUniforms: function(R) {
19107
- const G = F[R.type];
19108
- let _;
19109
- if (G) {
19110
- const L = tr[G];
19111
- _ = wg.clone(L.uniforms);
19112
- } else _ = R.uniforms;
19113
- return _;
19114
- }, acquireProgram: function(R, G) {
19115
- let _;
19116
- for (let L = 0, rA = c.length; L < rA; L++) {
19117
- const tA = c[L];
19118
- if (tA.cacheKey === G) {
19119
- _ = tA, ++_.usedTimes;
19095
+ } else Ce = _.vertexShader, Qe = _.fragmentShader, u.update(_), Ve = u.getVertexShaderID(_), fe = u.getFragmentShaderID(_);
19096
+ const _e = o.getRenderTarget(), Fe = rA.isInstancedMesh === !0, YA = !!_.map, de = !!_.matcap, be = !!bA, ge = !!_.aoMap, Xe = !!_.lightMap, oA = !!_.bumpMap, lA = !!_.normalMap, vA = !!_.displacementMap, WA = !!_.emissiveMap, xA = !!_.metalnessMap, Be = !!_.roughnessMap, kA = _.clearcoat > 0, sA = _.iridescence > 0, TA = _.sheen > 0, ce = _.transmission > 0, Se = kA && !!_.clearcoatMap, Ie = kA && !!_.clearcoatNormalMap, Pe = kA && !!_.clearcoatRoughnessMap, He = sA && !!_.iridescenceMap, Re = sA && !!_.iridescenceThicknessMap, Ct = TA && !!_.sheenColorMap, It = TA && !!_.sheenRoughnessMap, J = !!_.specularMap, $ = !!_.specularColorMap, MA = !!_.specularIntensityMap, te = ce && !!_.transmissionMap, XA = ce && !!_.thicknessMap, _A = !!_.gradientMap, OA = !!_.alphaMap, Ye = _.alphaTest > 0, We = !!_.extensions, yA = !!eA.attributes.uv1, Ke = !!eA.attributes.uv2, ze = !!eA.attributes.uv3;
19097
+ return { isWebGL2: C, shaderID: RA, shaderName: _.type, vertexShader: Ce, fragmentShader: Qe, defines: _.defines, customVertexShaderID: Ve, customFragmentShaderID: fe, isRawShaderMaterial: _.isRawShaderMaterial === !0, glslVersion: _.glslVersion, precision: M, instancing: Fe, instancingColor: Fe && rA.instanceColor !== null, supportsVertexTextures: m, outputColorSpace: _e === null ? o.outputColorSpace : _e.isXRRenderTarget === !0 ? _e.texture.colorSpace : q, map: YA, matcap: de, envMap: be, envMapMode: be && bA.mapping, envMapCubeUVHeight: IA, aoMap: ge, lightMap: Xe, bumpMap: oA, normalMap: lA, displacementMap: m && vA, emissiveMap: WA, normalMapObjectSpace: lA && _.normalMapType === 1, normalMapTangentSpace: lA && _.normalMapType === 0, metalnessMap: xA, roughnessMap: Be, clearcoat: kA, clearcoatMap: Se, clearcoatNormalMap: Ie, clearcoatRoughnessMap: Pe, iridescence: sA, iridescenceMap: He, iridescenceThicknessMap: Re, sheen: TA, sheenColorMap: Ct, sheenRoughnessMap: It, specularMap: J, specularColorMap: $, specularIntensityMap: MA, transmission: ce, transmissionMap: te, thicknessMap: XA, gradientMap: _A, opaque: _.transparent === !1 && _.blending === 1, alphaMap: OA, alphaTest: Ye, combine: _.combine, mapUv: YA && G(_.map.channel), aoMapUv: ge && G(_.aoMap.channel), lightMapUv: Xe && G(_.lightMap.channel), bumpMapUv: oA && G(_.bumpMap.channel), normalMapUv: lA && G(_.normalMap.channel), displacementMapUv: vA && G(_.displacementMap.channel), emissiveMapUv: WA && G(_.emissiveMap.channel), metalnessMapUv: xA && G(_.metalnessMap.channel), roughnessMapUv: Be && G(_.roughnessMap.channel), clearcoatMapUv: Se && G(_.clearcoatMap.channel), clearcoatNormalMapUv: Ie && G(_.clearcoatNormalMap.channel), clearcoatRoughnessMapUv: Pe && G(_.clearcoatRoughnessMap.channel), iridescenceMapUv: He && G(_.iridescenceMap.channel), iridescenceThicknessMapUv: Re && G(_.iridescenceThicknessMap.channel), sheenColorMapUv: Ct && G(_.sheenColorMap.channel), sheenRoughnessMapUv: It && G(_.sheenRoughnessMap.channel), specularMapUv: J && G(_.specularMap.channel), specularColorMapUv: $ && G(_.specularColorMap.channel), specularIntensityMapUv: MA && G(_.specularIntensityMap.channel), transmissionMapUv: te && G(_.transmissionMap.channel), thicknessMapUv: XA && G(_.thicknessMap.channel), alphaMapUv: OA && G(_.alphaMap.channel), vertexTangents: lA && !!eA.attributes.tangent, vertexColors: _.vertexColors, vertexAlphas: _.vertexColors === !0 && !!eA.attributes.color && eA.attributes.color.itemSize === 4, vertexUv1s: yA, vertexUv2s: Ke, vertexUv3s: ze, pointsUvs: rA.isPoints === !0 && !!eA.attributes.uv && (YA || OA), fog: !!tA, useFog: _.fog === !0, fogExp2: tA && tA.isFogExp2, flatShading: _.flatShading === !0, sizeAttenuation: _.sizeAttenuation === !0, logarithmicDepthBuffer: f, skinning: rA.isSkinnedMesh === !0, morphTargets: eA.morphAttributes.position !== void 0, morphNormals: eA.morphAttributes.normal !== void 0, morphColors: eA.morphAttributes.color !== void 0, morphTargetsCount: jA, morphTextureStride: Me, numDirLights: N.directional.length, numPointLights: N.point.length, numSpotLights: N.spot.length, numSpotLightMaps: N.spotLightMap.length, numRectAreaLights: N.rectArea.length, numHemiLights: N.hemi.length, numDirLightShadows: N.directionalShadowMap.length, numPointLightShadows: N.pointShadowMap.length, numSpotLightShadows: N.spotShadowMap.length, numSpotLightShadowsWithMaps: N.numSpotLightShadowsWithMaps, numClippingPlanes: g.numPlanes, numClipIntersection: g.numIntersection, dithering: _.dithering, shadowMapEnabled: o.shadowMap.enabled && R.length > 0, shadowMapType: o.shadowMap.type, toneMapping: _.toneMapped ? o.toneMapping : k, useLegacyLights: o.useLegacyLights, premultipliedAlpha: _.premultipliedAlpha, doubleSided: _.side === 2, flipSided: _.side === y, useDepthPacking: _.depthPacking >= 0, depthPacking: _.depthPacking || 0, index0AttributeName: _.index0AttributeName, extensionDerivatives: We && _.extensions.derivatives === !0, extensionFragDepth: We && _.extensions.fragDepth === !0, extensionDrawBuffers: We && _.extensions.drawBuffers === !0, extensionShaderTextureLOD: We && _.extensions.shaderTextureLOD === !0, rendererExtensionFragDepth: C || i.has("EXT_frag_depth"), rendererExtensionDrawBuffers: C || i.has("WEBGL_draw_buffers"), rendererExtensionShaderTextureLod: C || i.has("EXT_shader_texture_lod"), customProgramCacheKey: _.customProgramCacheKey() };
19098
+ }, getProgramCacheKey: function(_) {
19099
+ const N = [];
19100
+ if (_.shaderID ? N.push(_.shaderID) : (N.push(_.customVertexShaderID), N.push(_.customFragmentShaderID)), _.defines !== void 0) for (const R in _.defines) N.push(R), N.push(_.defines[R]);
19101
+ return _.isRawShaderMaterial === !1 && ((function(R, F) {
19102
+ R.push(F.precision), R.push(F.outputColorSpace), R.push(F.envMapMode), R.push(F.envMapCubeUVHeight), R.push(F.mapUv), R.push(F.alphaMapUv), R.push(F.lightMapUv), R.push(F.aoMapUv), R.push(F.bumpMapUv), R.push(F.normalMapUv), R.push(F.displacementMapUv), R.push(F.emissiveMapUv), R.push(F.metalnessMapUv), R.push(F.roughnessMapUv), R.push(F.clearcoatMapUv), R.push(F.clearcoatNormalMapUv), R.push(F.clearcoatRoughnessMapUv), R.push(F.iridescenceMapUv), R.push(F.iridescenceThicknessMapUv), R.push(F.sheenColorMapUv), R.push(F.sheenRoughnessMapUv), R.push(F.specularMapUv), R.push(F.specularColorMapUv), R.push(F.specularIntensityMapUv), R.push(F.transmissionMapUv), R.push(F.thicknessMapUv), R.push(F.combine), R.push(F.fogExp2), R.push(F.sizeAttenuation), R.push(F.morphTargetsCount), R.push(F.morphAttributeCount), R.push(F.numDirLights), R.push(F.numPointLights), R.push(F.numSpotLights), R.push(F.numSpotLightMaps), R.push(F.numHemiLights), R.push(F.numRectAreaLights), R.push(F.numDirLightShadows), R.push(F.numPointLightShadows), R.push(F.numSpotLightShadows), R.push(F.numSpotLightShadowsWithMaps), R.push(F.shadowMapType), R.push(F.toneMapping), R.push(F.numClippingPlanes), R.push(F.numClipIntersection), R.push(F.depthPacking);
19103
+ })(N, _), (function(R, F) {
19104
+ I.disableAll(), F.isWebGL2 && I.enable(0), F.supportsVertexTextures && I.enable(1), F.instancing && I.enable(2), F.instancingColor && I.enable(3), F.matcap && I.enable(4), F.envMap && I.enable(5), F.normalMapObjectSpace && I.enable(6), F.normalMapTangentSpace && I.enable(7), F.clearcoat && I.enable(8), F.iridescence && I.enable(9), F.alphaTest && I.enable(10), F.vertexColors && I.enable(11), F.vertexAlphas && I.enable(12), F.vertexUv1s && I.enable(13), F.vertexUv2s && I.enable(14), F.vertexUv3s && I.enable(15), F.vertexTangents && I.enable(16), R.push(I.mask), I.disableAll(), F.fog && I.enable(0), F.useFog && I.enable(1), F.flatShading && I.enable(2), F.logarithmicDepthBuffer && I.enable(3), F.skinning && I.enable(4), F.morphTargets && I.enable(5), F.morphNormals && I.enable(6), F.morphColors && I.enable(7), F.premultipliedAlpha && I.enable(8), F.shadowMapEnabled && I.enable(9), F.useLegacyLights && I.enable(10), F.doubleSided && I.enable(11), F.flipSided && I.enable(12), F.useDepthPacking && I.enable(13), F.dithering && I.enable(14), F.transmission && I.enable(15), F.sheen && I.enable(16), F.opaque && I.enable(17), F.pointsUvs && I.enable(18), R.push(I.mask);
19105
+ })(N, _), N.push(o.outputColorSpace)), N.push(_.customProgramCacheKey), N.join();
19106
+ }, getUniforms: function(_) {
19107
+ const N = L[_.type];
19108
+ let R;
19109
+ if (N) {
19110
+ const F = tr[N];
19111
+ R = wg.clone(F.uniforms);
19112
+ } else R = _.uniforms;
19113
+ return R;
19114
+ }, acquireProgram: function(_, N) {
19115
+ let R;
19116
+ for (let F = 0, rA = c.length; F < rA; F++) {
19117
+ const tA = c[F];
19118
+ if (tA.cacheKey === N) {
19119
+ R = tA, ++R.usedTimes;
19120
19120
  break;
19121
19121
  }
19122
19122
  }
19123
- return _ === void 0 && (_ = new Kf(o, G, R, a), c.push(_)), _;
19124
- }, releaseProgram: function(R) {
19125
- if (--R.usedTimes == 0) {
19126
- const G = c.indexOf(R);
19127
- c[G] = c[c.length - 1], c.pop(), R.destroy();
19123
+ return R === void 0 && (R = new Kf(o, N, _, a), c.push(R)), R;
19124
+ }, releaseProgram: function(_) {
19125
+ if (--_.usedTimes == 0) {
19126
+ const N = c.indexOf(_);
19127
+ c[N] = c[c.length - 1], c.pop(), _.destroy();
19128
19128
  }
19129
- }, releaseShaderCache: function(R) {
19130
- u.remove(R);
19129
+ }, releaseShaderCache: function(_) {
19130
+ u.remove(_);
19131
19131
  }, programs: c, dispose: function() {
19132
19132
  u.dispose();
19133
19133
  } };
@@ -19237,7 +19237,7 @@ precision ` + o.precision + " int;";
19237
19237
  return { setup: function(u, c) {
19238
19238
  let C = 0, f = 0, m = 0;
19239
19239
  for (let IA = 0; IA < 9; IA++) n.probe[IA].set(0, 0, 0);
19240
- let M = 0, F = 0, N = 0, R = 0, G = 0, _ = 0, L = 0, rA = 0, tA = 0, eA = 0;
19240
+ let M = 0, L = 0, G = 0, _ = 0, N = 0, R = 0, F = 0, rA = 0, tA = 0, eA = 0;
19241
19241
  u.sort(ep);
19242
19242
  const QA = c === !0 ? Math.PI : 1;
19243
19243
  for (let IA = 0, RA = u.length; IA < RA; IA++) {
@@ -19248,56 +19248,56 @@ precision ` + o.precision + " int;";
19248
19248
  const fe = e.get(wA);
19249
19249
  if (fe.color.copy(wA.color).multiplyScalar(wA.intensity * QA), wA.castShadow) {
19250
19250
  const Me = wA.shadow, _e = i.get(wA);
19251
- _e.shadowBias = Me.bias, _e.shadowNormalBias = Me.normalBias, _e.shadowRadius = Me.radius, _e.shadowMapSize = Me.mapSize, n.directionalShadow[M] = _e, n.directionalShadowMap[M] = Ve, n.directionalShadowMatrix[M] = wA.shadow.matrix, _++;
19251
+ _e.shadowBias = Me.bias, _e.shadowNormalBias = Me.normalBias, _e.shadowRadius = Me.radius, _e.shadowMapSize = Me.mapSize, n.directionalShadow[M] = _e, n.directionalShadowMap[M] = Ve, n.directionalShadowMatrix[M] = wA.shadow.matrix, R++;
19252
19252
  }
19253
19253
  n.directional[M] = fe, M++;
19254
19254
  } else if (wA.isSpotLight) {
19255
19255
  const fe = e.get(wA);
19256
- fe.position.setFromMatrixPosition(wA.matrixWorld), fe.color.copy(jA).multiplyScalar(Ce * QA), fe.distance = Qe, fe.coneCos = Math.cos(wA.angle), fe.penumbraCos = Math.cos(wA.angle * (1 - wA.penumbra)), fe.decay = wA.decay, n.spot[N] = fe;
19256
+ fe.position.setFromMatrixPosition(wA.matrixWorld), fe.color.copy(jA).multiplyScalar(Ce * QA), fe.distance = Qe, fe.coneCos = Math.cos(wA.angle), fe.penumbraCos = Math.cos(wA.angle * (1 - wA.penumbra)), fe.decay = wA.decay, n.spot[G] = fe;
19257
19257
  const Me = wA.shadow;
19258
- if (wA.map && (n.spotLightMap[tA] = wA.map, tA++, Me.updateMatrices(wA), wA.castShadow && eA++), n.spotLightMatrix[N] = Me.matrix, wA.castShadow) {
19258
+ if (wA.map && (n.spotLightMap[tA] = wA.map, tA++, Me.updateMatrices(wA), wA.castShadow && eA++), n.spotLightMatrix[G] = Me.matrix, wA.castShadow) {
19259
19259
  const _e = i.get(wA);
19260
- _e.shadowBias = Me.bias, _e.shadowNormalBias = Me.normalBias, _e.shadowRadius = Me.radius, _e.shadowMapSize = Me.mapSize, n.spotShadow[N] = _e, n.spotShadowMap[N] = Ve, rA++;
19260
+ _e.shadowBias = Me.bias, _e.shadowNormalBias = Me.normalBias, _e.shadowRadius = Me.radius, _e.shadowMapSize = Me.mapSize, n.spotShadow[G] = _e, n.spotShadowMap[G] = Ve, rA++;
19261
19261
  }
19262
- N++;
19262
+ G++;
19263
19263
  } else if (wA.isRectAreaLight) {
19264
19264
  const fe = e.get(wA);
19265
- fe.color.copy(jA).multiplyScalar(Ce), fe.halfWidth.set(0.5 * wA.width, 0, 0), fe.halfHeight.set(0, 0.5 * wA.height, 0), n.rectArea[R] = fe, R++;
19265
+ fe.color.copy(jA).multiplyScalar(Ce), fe.halfWidth.set(0.5 * wA.width, 0, 0), fe.halfHeight.set(0, 0.5 * wA.height, 0), n.rectArea[_] = fe, _++;
19266
19266
  } else if (wA.isPointLight) {
19267
19267
  const fe = e.get(wA);
19268
19268
  if (fe.color.copy(wA.color).multiplyScalar(wA.intensity * QA), fe.distance = wA.distance, fe.decay = wA.decay, wA.castShadow) {
19269
19269
  const Me = wA.shadow, _e = i.get(wA);
19270
- _e.shadowBias = Me.bias, _e.shadowNormalBias = Me.normalBias, _e.shadowRadius = Me.radius, _e.shadowMapSize = Me.mapSize, _e.shadowCameraNear = Me.camera.near, _e.shadowCameraFar = Me.camera.far, n.pointShadow[F] = _e, n.pointShadowMap[F] = Ve, n.pointShadowMatrix[F] = wA.shadow.matrix, L++;
19270
+ _e.shadowBias = Me.bias, _e.shadowNormalBias = Me.normalBias, _e.shadowRadius = Me.radius, _e.shadowMapSize = Me.mapSize, _e.shadowCameraNear = Me.camera.near, _e.shadowCameraFar = Me.camera.far, n.pointShadow[L] = _e, n.pointShadowMap[L] = Ve, n.pointShadowMatrix[L] = wA.shadow.matrix, F++;
19271
19271
  }
19272
- n.point[F] = fe, F++;
19272
+ n.point[L] = fe, L++;
19273
19273
  } else if (wA.isHemisphereLight) {
19274
19274
  const fe = e.get(wA);
19275
- fe.skyColor.copy(wA.color).multiplyScalar(Ce * QA), fe.groundColor.copy(wA.groundColor).multiplyScalar(Ce * QA), n.hemi[G] = fe, G++;
19275
+ fe.skyColor.copy(wA.color).multiplyScalar(Ce * QA), fe.groundColor.copy(wA.groundColor).multiplyScalar(Ce * QA), n.hemi[N] = fe, N++;
19276
19276
  }
19277
19277
  }
19278
- R > 0 && (A.isWebGL2 || o.has("OES_texture_float_linear") === !0 ? (n.rectAreaLTC1 = Je.LTC_FLOAT_1, n.rectAreaLTC2 = Je.LTC_FLOAT_2) : o.has("OES_texture_half_float_linear") === !0 && (n.rectAreaLTC1 = Je.LTC_HALF_1, n.rectAreaLTC2 = Je.LTC_HALF_2)), n.ambient[0] = C, n.ambient[1] = f, n.ambient[2] = m;
19278
+ _ > 0 && (A.isWebGL2 || o.has("OES_texture_float_linear") === !0 ? (n.rectAreaLTC1 = Je.LTC_FLOAT_1, n.rectAreaLTC2 = Je.LTC_FLOAT_2) : o.has("OES_texture_half_float_linear") === !0 && (n.rectAreaLTC1 = Je.LTC_HALF_1, n.rectAreaLTC2 = Je.LTC_HALF_2)), n.ambient[0] = C, n.ambient[1] = f, n.ambient[2] = m;
19279
19279
  const bA = n.hash;
19280
- bA.directionalLength === M && bA.pointLength === F && bA.spotLength === N && bA.rectAreaLength === R && bA.hemiLength === G && bA.numDirectionalShadows === _ && bA.numPointShadows === L && bA.numSpotShadows === rA && bA.numSpotMaps === tA || (n.directional.length = M, n.spot.length = N, n.rectArea.length = R, n.point.length = F, n.hemi.length = G, n.directionalShadow.length = _, n.directionalShadowMap.length = _, n.pointShadow.length = L, n.pointShadowMap.length = L, n.spotShadow.length = rA, n.spotShadowMap.length = rA, n.directionalShadowMatrix.length = _, n.pointShadowMatrix.length = L, n.spotLightMatrix.length = rA + tA - eA, n.spotLightMap.length = tA, n.numSpotLightShadowsWithMaps = eA, bA.directionalLength = M, bA.pointLength = F, bA.spotLength = N, bA.rectAreaLength = R, bA.hemiLength = G, bA.numDirectionalShadows = _, bA.numPointShadows = L, bA.numSpotShadows = rA, bA.numSpotMaps = tA, n.version = Ap++);
19280
+ bA.directionalLength === M && bA.pointLength === L && bA.spotLength === G && bA.rectAreaLength === _ && bA.hemiLength === N && bA.numDirectionalShadows === R && bA.numPointShadows === F && bA.numSpotShadows === rA && bA.numSpotMaps === tA || (n.directional.length = M, n.spot.length = G, n.rectArea.length = _, n.point.length = L, n.hemi.length = N, n.directionalShadow.length = R, n.directionalShadowMap.length = R, n.pointShadow.length = F, n.pointShadowMap.length = F, n.spotShadow.length = rA, n.spotShadowMap.length = rA, n.directionalShadowMatrix.length = R, n.pointShadowMatrix.length = F, n.spotLightMatrix.length = rA + tA - eA, n.spotLightMap.length = tA, n.numSpotLightShadowsWithMaps = eA, bA.directionalLength = M, bA.pointLength = L, bA.spotLength = G, bA.rectAreaLength = _, bA.hemiLength = N, bA.numDirectionalShadows = R, bA.numPointShadows = F, bA.numSpotShadows = rA, bA.numSpotMaps = tA, n.version = Ap++);
19281
19281
  }, setupView: function(u, c) {
19282
- let C = 0, f = 0, m = 0, M = 0, F = 0;
19283
- const N = c.matrixWorldInverse;
19284
- for (let R = 0, G = u.length; R < G; R++) {
19285
- const _ = u[R];
19286
- if (_.isDirectionalLight) {
19287
- const L = n.directional[C];
19288
- L.direction.setFromMatrixPosition(_.matrixWorld), a.setFromMatrixPosition(_.target.matrixWorld), L.direction.sub(a), L.direction.transformDirection(N), C++;
19289
- } else if (_.isSpotLight) {
19290
- const L = n.spot[m];
19291
- L.position.setFromMatrixPosition(_.matrixWorld), L.position.applyMatrix4(N), L.direction.setFromMatrixPosition(_.matrixWorld), a.setFromMatrixPosition(_.target.matrixWorld), L.direction.sub(a), L.direction.transformDirection(N), m++;
19292
- } else if (_.isRectAreaLight) {
19293
- const L = n.rectArea[M];
19294
- L.position.setFromMatrixPosition(_.matrixWorld), L.position.applyMatrix4(N), I.identity(), g.copy(_.matrixWorld), g.premultiply(N), I.extractRotation(g), L.halfWidth.set(0.5 * _.width, 0, 0), L.halfHeight.set(0, 0.5 * _.height, 0), L.halfWidth.applyMatrix4(I), L.halfHeight.applyMatrix4(I), M++;
19295
- } else if (_.isPointLight) {
19296
- const L = n.point[f];
19297
- L.position.setFromMatrixPosition(_.matrixWorld), L.position.applyMatrix4(N), f++;
19298
- } else if (_.isHemisphereLight) {
19299
- const L = n.hemi[F];
19300
- L.direction.setFromMatrixPosition(_.matrixWorld), L.direction.transformDirection(N), F++;
19282
+ let C = 0, f = 0, m = 0, M = 0, L = 0;
19283
+ const G = c.matrixWorldInverse;
19284
+ for (let _ = 0, N = u.length; _ < N; _++) {
19285
+ const R = u[_];
19286
+ if (R.isDirectionalLight) {
19287
+ const F = n.directional[C];
19288
+ F.direction.setFromMatrixPosition(R.matrixWorld), a.setFromMatrixPosition(R.target.matrixWorld), F.direction.sub(a), F.direction.transformDirection(G), C++;
19289
+ } else if (R.isSpotLight) {
19290
+ const F = n.spot[m];
19291
+ F.position.setFromMatrixPosition(R.matrixWorld), F.position.applyMatrix4(G), F.direction.setFromMatrixPosition(R.matrixWorld), a.setFromMatrixPosition(R.target.matrixWorld), F.direction.sub(a), F.direction.transformDirection(G), m++;
19292
+ } else if (R.isRectAreaLight) {
19293
+ const F = n.rectArea[M];
19294
+ F.position.setFromMatrixPosition(R.matrixWorld), F.position.applyMatrix4(G), I.identity(), g.copy(R.matrixWorld), g.premultiply(G), I.extractRotation(g), F.halfWidth.set(0.5 * R.width, 0, 0), F.halfHeight.set(0, 0.5 * R.height, 0), F.halfWidth.applyMatrix4(I), F.halfHeight.applyMatrix4(I), M++;
19295
+ } else if (R.isPointLight) {
19296
+ const F = n.point[f];
19297
+ F.position.setFromMatrixPosition(R.matrixWorld), F.position.applyMatrix4(G), f++;
19298
+ } else if (R.isHemisphereLight) {
19299
+ const F = n.hemi[L];
19300
+ F.direction.setFromMatrixPosition(R.matrixWorld), F.direction.transformDirection(G), L++;
19301
19301
  }
19302
19302
  }
19303
19303
  }, state: n };
@@ -19374,16 +19374,16 @@ void main() {
19374
19374
  gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
19375
19375
  }` }), M = m.clone();
19376
19376
  M.defines.HORIZONTAL_PASS = 1;
19377
- const F = new fn();
19378
- F.setAttribute("position", new Ti(new Float32Array([-1, -1, 0.5, 3, -1, 0.5, -1, 3, 0.5]), 3));
19379
- const N = new Tt(F, m), R = this;
19377
+ const L = new fn();
19378
+ L.setAttribute("position", new Ti(new Float32Array([-1, -1, 0.5, 3, -1, 0.5, -1, 3, 0.5]), 3));
19379
+ const G = new Tt(L, m), _ = this;
19380
19380
  this.enabled = !1, this.autoUpdate = !0, this.needsUpdate = !1, this.type = Q;
19381
- let G = this.type;
19382
- function _(tA, eA) {
19383
- const QA = A.update(N);
19384
- m.defines.VSM_SAMPLES !== tA.blurSamples && (m.defines.VSM_SAMPLES = tA.blurSamples, M.defines.VSM_SAMPLES = tA.blurSamples, m.needsUpdate = !0, M.needsUpdate = !0), tA.mapPass === null && (tA.mapPass = new Xt(n.x, n.y)), m.uniforms.shadow_pass.value = tA.map.texture, m.uniforms.resolution.value = tA.mapSize, m.uniforms.radius.value = tA.radius, o.setRenderTarget(tA.mapPass), o.clear(), o.renderBufferDirect(eA, null, QA, m, N, null), M.uniforms.shadow_pass.value = tA.mapPass.texture, M.uniforms.resolution.value = tA.mapSize, M.uniforms.radius.value = tA.radius, o.setRenderTarget(tA.map), o.clear(), o.renderBufferDirect(eA, null, QA, M, N, null);
19381
+ let N = this.type;
19382
+ function R(tA, eA) {
19383
+ const QA = A.update(G);
19384
+ m.defines.VSM_SAMPLES !== tA.blurSamples && (m.defines.VSM_SAMPLES = tA.blurSamples, M.defines.VSM_SAMPLES = tA.blurSamples, m.needsUpdate = !0, M.needsUpdate = !0), tA.mapPass === null && (tA.mapPass = new Xt(n.x, n.y)), m.uniforms.shadow_pass.value = tA.map.texture, m.uniforms.resolution.value = tA.mapSize, m.uniforms.radius.value = tA.radius, o.setRenderTarget(tA.mapPass), o.clear(), o.renderBufferDirect(eA, null, QA, m, G, null), M.uniforms.shadow_pass.value = tA.mapPass.texture, M.uniforms.resolution.value = tA.mapSize, M.uniforms.radius.value = tA.radius, o.setRenderTarget(tA.map), o.clear(), o.renderBufferDirect(eA, null, QA, M, G, null);
19385
19385
  }
19386
- function L(tA, eA, QA, bA) {
19386
+ function F(tA, eA, QA, bA) {
19387
19387
  let IA = null;
19388
19388
  const RA = QA.isPointLight === !0 ? tA.customDistanceMaterial : tA.customDepthMaterial;
19389
19389
  if (RA !== void 0) IA = RA;
@@ -19406,12 +19406,12 @@ void main() {
19406
19406
  for (let Qe = 0, Ve = Ce.length; Qe < Ve; Qe++) {
19407
19407
  const fe = Ce[Qe], Me = jA[fe.materialIndex];
19408
19408
  if (Me && Me.visible) {
19409
- const _e = L(tA, Me, bA, IA);
19409
+ const _e = F(tA, Me, bA, IA);
19410
19410
  o.renderBufferDirect(QA, null, wA, _e, tA, fe);
19411
19411
  }
19412
19412
  }
19413
19413
  } else if (jA.visible) {
19414
- const Ce = L(tA, jA, bA, IA);
19414
+ const Ce = F(tA, jA, bA, IA);
19415
19415
  o.renderBufferDirect(QA, null, wA, Ce, tA, null);
19416
19416
  }
19417
19417
  }
@@ -19419,10 +19419,10 @@ void main() {
19419
19419
  for (let wA = 0, jA = RA.length; wA < jA; wA++) rA(RA[wA], eA, QA, bA, IA);
19420
19420
  }
19421
19421
  this.render = function(tA, eA, QA) {
19422
- if (R.enabled === !1 || R.autoUpdate === !1 && R.needsUpdate === !1 || tA.length === 0) return;
19422
+ if (_.enabled === !1 || _.autoUpdate === !1 && _.needsUpdate === !1 || tA.length === 0) return;
19423
19423
  const bA = o.getRenderTarget(), IA = o.getActiveCubeFace(), RA = o.getActiveMipmapLevel(), wA = o.state;
19424
19424
  wA.setBlending(0), wA.buffers.color.setClear(1, 1, 1, 1), wA.buffers.depth.setTest(!0), wA.setScissorTest(!1);
19425
- const jA = G !== E && this.type === E, Ce = G === E && this.type !== E;
19425
+ const jA = N !== E && this.type === E, Ce = N === E && this.type !== E;
19426
19426
  for (let Qe = 0, Ve = tA.length; Qe < Ve; Qe++) {
19427
19427
  const fe = tA[Qe], Me = fe.shadow;
19428
19428
  if (Me === void 0 || Me.autoUpdate === !1 && Me.needsUpdate === !1) continue;
@@ -19438,9 +19438,9 @@ void main() {
19438
19438
  const de = Me.getViewport(YA);
19439
19439
  g.set(a.x * de.x, a.y * de.y, a.x * de.z, a.y * de.w), wA.viewport(g), Me.updateMatrices(fe, YA), i = Me.getFrustum(), rA(eA, QA, Me.camera, fe, this.type);
19440
19440
  }
19441
- Me.isPointLightShadow !== !0 && this.type === E && _(Me, QA), Me.needsUpdate = !1;
19441
+ Me.isPointLightShadow !== !0 && this.type === E && R(Me, QA), Me.needsUpdate = !1;
19442
19442
  }
19443
- G = this.type, R.needsUpdate = !1, o.setRenderTarget(bA, IA, RA);
19443
+ N = this.type, _.needsUpdate = !1, o.setRenderTarget(bA, IA, RA);
19444
19444
  };
19445
19445
  }
19446
19446
  function ap(o, A, e) {
@@ -19519,7 +19519,7 @@ void main() {
19519
19519
  sA = !1, TA = null, ce = null, Se = null, Ie = null, Pe = null, He = null, Re = null, Ct = null;
19520
19520
  } };
19521
19521
  }(), I = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap();
19522
- let c = {}, C = {}, f = /* @__PURE__ */ new WeakMap(), m = [], M = null, F = !1, N = null, R = null, G = null, _ = null, L = null, rA = null, tA = null, eA = !1, QA = null, bA = null, IA = null, RA = null, wA = null;
19522
+ let c = {}, C = {}, f = /* @__PURE__ */ new WeakMap(), m = [], M = null, L = !1, G = null, _ = null, N = null, R = null, F = null, rA = null, tA = null, eA = !1, QA = null, bA = null, IA = null, RA = null, wA = null;
19523
19523
  const jA = o.getParameter(o.MAX_COMBINED_TEXTURE_IMAGE_UNITS);
19524
19524
  let Ce = !1, Qe = 0;
19525
19525
  const Ve = o.getParameter(o.VERSION);
@@ -19549,9 +19549,9 @@ void main() {
19549
19549
  const vA = { 200: o.ZERO, 201: o.ONE, 202: o.SRC_COLOR, 204: o.SRC_ALPHA, 210: o.SRC_ALPHA_SATURATE, 208: o.DST_COLOR, 206: o.DST_ALPHA, 203: o.ONE_MINUS_SRC_COLOR, 205: o.ONE_MINUS_SRC_ALPHA, 209: o.ONE_MINUS_DST_COLOR, 207: o.ONE_MINUS_DST_ALPHA };
19550
19550
  function WA(sA, TA, ce, Se, Ie, Pe, He, Re) {
19551
19551
  if (sA !== 0) {
19552
- if (F === !1 && (Xe(o.BLEND), F = !0), sA === 5) Ie = Ie || TA, Pe = Pe || ce, He = He || Se, TA === R && Ie === L || (o.blendEquationSeparate(lA[TA], lA[Ie]), R = TA, L = Ie), ce === G && Se === _ && Pe === rA && He === tA || (o.blendFuncSeparate(vA[ce], vA[Se], vA[Pe], vA[He]), G = ce, _ = Se, rA = Pe, tA = He), N = sA, eA = !1;
19553
- else if (sA !== N || Re !== eA) {
19554
- if (R === S && L === S || (o.blendEquation(o.FUNC_ADD), R = S, L = S), Re) switch (sA) {
19552
+ if (L === !1 && (Xe(o.BLEND), L = !0), sA === 5) Ie = Ie || TA, Pe = Pe || ce, He = He || Se, TA === _ && Ie === F || (o.blendEquationSeparate(lA[TA], lA[Ie]), _ = TA, F = Ie), ce === N && Se === R && Pe === rA && He === tA || (o.blendFuncSeparate(vA[ce], vA[Se], vA[Pe], vA[He]), N = ce, R = Se, rA = Pe, tA = He), G = sA, eA = !1;
19553
+ else if (sA !== G || Re !== eA) {
19554
+ if (_ === S && F === S || (o.blendEquation(o.FUNC_ADD), _ = S, F = S), Re) switch (sA) {
19555
19555
  case 1:
19556
19556
  o.blendFuncSeparate(o.ONE, o.ONE_MINUS_SRC_ALPHA, o.ONE, o.ONE_MINUS_SRC_ALPHA);
19557
19557
  break;
@@ -19577,9 +19577,9 @@ void main() {
19577
19577
  case 4:
19578
19578
  o.blendFunc(o.ZERO, o.SRC_COLOR);
19579
19579
  }
19580
- G = null, _ = null, rA = null, tA = null, N = sA, eA = Re;
19580
+ N = null, R = null, rA = null, tA = null, G = sA, eA = Re;
19581
19581
  }
19582
- } else F === !0 && (oA(o.BLEND), F = !1);
19582
+ } else L === !0 && (oA(o.BLEND), L = !1);
19583
19583
  }
19584
19584
  function xA(sA) {
19585
19585
  QA !== sA && (sA ? o.frontFace(o.CW) : o.frontFace(o.CCW), QA = sA);
@@ -19687,35 +19687,35 @@ void main() {
19687
19687
  }, viewport: function(sA) {
19688
19688
  de.equals(sA) === !1 && (o.viewport(sA.x, sA.y, sA.z, sA.w), de.copy(sA));
19689
19689
  }, reset: function() {
19690
- o.disable(o.BLEND), o.disable(o.CULL_FACE), o.disable(o.DEPTH_TEST), o.disable(o.POLYGON_OFFSET_FILL), o.disable(o.SCISSOR_TEST), o.disable(o.STENCIL_TEST), o.disable(o.SAMPLE_ALPHA_TO_COVERAGE), o.blendEquation(o.FUNC_ADD), o.blendFunc(o.ONE, o.ZERO), o.blendFuncSeparate(o.ONE, o.ZERO, o.ONE, o.ZERO), o.colorMask(!0, !0, !0, !0), o.clearColor(0, 0, 0, 0), o.depthMask(!0), o.depthFunc(o.LESS), o.clearDepth(1), o.stencilMask(4294967295), o.stencilFunc(o.ALWAYS, 0, 4294967295), o.stencilOp(o.KEEP, o.KEEP, o.KEEP), o.clearStencil(0), o.cullFace(o.BACK), o.frontFace(o.CCW), o.polygonOffset(0, 0), o.activeTexture(o.TEXTURE0), o.bindFramebuffer(o.FRAMEBUFFER, null), i === !0 && (o.bindFramebuffer(o.DRAW_FRAMEBUFFER, null), o.bindFramebuffer(o.READ_FRAMEBUFFER, null)), o.useProgram(null), o.lineWidth(1), o.scissor(0, 0, o.canvas.width, o.canvas.height), o.viewport(0, 0, o.canvas.width, o.canvas.height), c = {}, fe = null, Me = {}, C = {}, f = /* @__PURE__ */ new WeakMap(), m = [], M = null, F = !1, N = null, R = null, G = null, _ = null, L = null, rA = null, tA = null, eA = !1, QA = null, bA = null, IA = null, RA = null, wA = null, YA.set(0, 0, o.canvas.width, o.canvas.height), de.set(0, 0, o.canvas.width, o.canvas.height), n.reset(), a.reset(), g.reset();
19690
+ o.disable(o.BLEND), o.disable(o.CULL_FACE), o.disable(o.DEPTH_TEST), o.disable(o.POLYGON_OFFSET_FILL), o.disable(o.SCISSOR_TEST), o.disable(o.STENCIL_TEST), o.disable(o.SAMPLE_ALPHA_TO_COVERAGE), o.blendEquation(o.FUNC_ADD), o.blendFunc(o.ONE, o.ZERO), o.blendFuncSeparate(o.ONE, o.ZERO, o.ONE, o.ZERO), o.colorMask(!0, !0, !0, !0), o.clearColor(0, 0, 0, 0), o.depthMask(!0), o.depthFunc(o.LESS), o.clearDepth(1), o.stencilMask(4294967295), o.stencilFunc(o.ALWAYS, 0, 4294967295), o.stencilOp(o.KEEP, o.KEEP, o.KEEP), o.clearStencil(0), o.cullFace(o.BACK), o.frontFace(o.CCW), o.polygonOffset(0, 0), o.activeTexture(o.TEXTURE0), o.bindFramebuffer(o.FRAMEBUFFER, null), i === !0 && (o.bindFramebuffer(o.DRAW_FRAMEBUFFER, null), o.bindFramebuffer(o.READ_FRAMEBUFFER, null)), o.useProgram(null), o.lineWidth(1), o.scissor(0, 0, o.canvas.width, o.canvas.height), o.viewport(0, 0, o.canvas.width, o.canvas.height), c = {}, fe = null, Me = {}, C = {}, f = /* @__PURE__ */ new WeakMap(), m = [], M = null, L = !1, G = null, _ = null, N = null, R = null, F = null, rA = null, tA = null, eA = !1, QA = null, bA = null, IA = null, RA = null, wA = null, YA.set(0, 0, o.canvas.width, o.canvas.height), de.set(0, 0, o.canvas.width, o.canvas.height), n.reset(), a.reset(), g.reset();
19691
19691
  } };
19692
19692
  }
19693
19693
  function op(o, A, e, i, n, a, g) {
19694
19694
  const I = n.isWebGL2, u = (n.maxTextures, n.maxCubemapSize), c = n.maxTextureSize, C = n.maxSamples, f = A.has("WEBGL_multisampled_render_to_texture") ? A.get("WEBGL_multisampled_render_to_texture") : null, m = typeof navigator < "u" && /OculusBrowser/g.test(navigator.userAgent), M = /* @__PURE__ */ new WeakMap();
19695
- let F;
19696
- const N = /* @__PURE__ */ new WeakMap();
19697
- let R = !1;
19695
+ let L;
19696
+ const G = /* @__PURE__ */ new WeakMap();
19697
+ let _ = !1;
19698
19698
  try {
19699
- R = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") !== null;
19699
+ _ = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") !== null;
19700
19700
  } catch {
19701
19701
  }
19702
- function G(oA, lA) {
19703
- return R ? new OffscreenCanvas(oA, lA) : un("canvas");
19702
+ function N(oA, lA) {
19703
+ return _ ? new OffscreenCanvas(oA, lA) : un("canvas");
19704
19704
  }
19705
- function _(oA, lA, vA, WA) {
19705
+ function R(oA, lA, vA, WA) {
19706
19706
  let xA = 1;
19707
19707
  if ((oA.width > WA || oA.height > WA) && (xA = WA / Math.max(oA.width, oA.height)), xA < 1 || lA === !0) {
19708
19708
  if (typeof HTMLImageElement < "u" && oA instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && oA instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && oA instanceof ImageBitmap) {
19709
19709
  const Be = lA ? ur : Math.floor, kA = Be(xA * oA.width), sA = Be(xA * oA.height);
19710
- F === void 0 && (F = G(kA, sA));
19711
- const TA = vA ? G(kA, sA) : F;
19710
+ L === void 0 && (L = N(kA, sA));
19711
+ const TA = vA ? N(kA, sA) : L;
19712
19712
  return TA.width = kA, TA.height = sA, TA.getContext("2d").drawImage(oA, 0, 0, kA, sA), oA.width, oA.height, TA;
19713
19713
  }
19714
19714
  return "data" in oA && (oA.width, oA.height), oA;
19715
19715
  }
19716
19716
  return oA;
19717
19717
  }
19718
- function L(oA) {
19718
+ function F(oA) {
19719
19719
  return Jn(oA.width) && Jn(oA.height);
19720
19720
  }
19721
19721
  function rA(oA, lA) {
@@ -19741,10 +19741,10 @@ void main() {
19741
19741
  lA.removeEventListener("dispose", IA), (function(vA) {
19742
19742
  const WA = i.get(vA);
19743
19743
  if (WA.__webglInit === void 0) return;
19744
- const xA = vA.source, Be = N.get(xA);
19744
+ const xA = vA.source, Be = G.get(xA);
19745
19745
  if (Be) {
19746
19746
  const kA = Be[WA.__cacheKey];
19747
- kA.usedTimes--, kA.usedTimes === 0 && wA(vA), Object.keys(Be).length === 0 && N.delete(xA);
19747
+ kA.usedTimes--, kA.usedTimes === 0 && wA(vA), Object.keys(Be).length === 0 && G.delete(xA);
19748
19748
  }
19749
19749
  i.remove(vA);
19750
19750
  })(lA), lA.isVideoTexture && M.delete(lA);
@@ -19769,7 +19769,7 @@ void main() {
19769
19769
  const lA = i.get(oA);
19770
19770
  o.deleteTexture(lA.__webglTexture);
19771
19771
  const vA = oA.source;
19772
- delete N.get(vA)[lA.__cacheKey], g.memory.textures--;
19772
+ delete G.get(vA)[lA.__cacheKey], g.memory.textures--;
19773
19773
  }
19774
19774
  let jA = 0;
19775
19775
  function Ce(oA, lA) {
@@ -19797,8 +19797,8 @@ void main() {
19797
19797
  let vA = !1;
19798
19798
  oA.__webglInit === void 0 && (oA.__webglInit = !0, lA.addEventListener("dispose", IA));
19799
19799
  const WA = lA.source;
19800
- let xA = N.get(WA);
19801
- xA === void 0 && (xA = {}, N.set(WA, xA));
19800
+ let xA = G.get(WA);
19801
+ xA === void 0 && (xA = {}, G.set(WA, xA));
19802
19802
  const Be = (function(kA) {
19803
19803
  const sA = [];
19804
19804
  return sA.push(kA.wrapS), sA.push(kA.wrapT), sA.push(kA.wrapR || 0), sA.push(kA.magFilter), sA.push(kA.minFilter), sA.push(kA.anisotropy), sA.push(kA.internalFormat), sA.push(kA.format), sA.push(kA.type), sA.push(kA.generateMipmaps), sA.push(kA.premultiplyAlpha), sA.push(kA.flipY), sA.push(kA.unpackAlignment), sA.push(kA.colorSpace), sA.join();
@@ -19820,10 +19820,10 @@ void main() {
19820
19820
  e.activeTexture(o.TEXTURE0 + vA), o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, lA.flipY), o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL, lA.premultiplyAlpha), o.pixelStorei(o.UNPACK_ALIGNMENT, lA.unpackAlignment), o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL, o.NONE);
19821
19821
  const sA = (function($) {
19822
19822
  return !I && ($.wrapS !== AA || $.wrapT !== AA || $.minFilter !== dA && $.minFilter !== BA);
19823
- })(lA) && L(lA.image) === !1;
19824
- let TA = _(lA.image, sA, !1, c);
19823
+ })(lA) && F(lA.image) === !1;
19824
+ let TA = R(lA.image, sA, !1, c);
19825
19825
  TA = Xe(lA, TA);
19826
- const ce = L(TA) || I, Se = a.convert(lA.format, lA.colorSpace);
19826
+ const ce = F(TA) || I, Se = a.convert(lA.format, lA.colorSpace);
19827
19827
  let Ie, Pe = a.convert(lA.type), He = eA(lA.internalFormat, Se, Pe, lA.colorSpace);
19828
19828
  fe(WA, lA, ce);
19829
19829
  const Re = lA.mipmaps, Ct = I && lA.isVideoTexture !== !0, It = kA.__version === void 0 || xA === !0, J = QA(lA, TA, ce);
@@ -19936,8 +19936,8 @@ void main() {
19936
19936
  if (sA.version !== TA.__version || kA === !0) {
19937
19937
  e.activeTexture(o.TEXTURE0 + Be), o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, xA.flipY), o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL, xA.premultiplyAlpha), o.pixelStorei(o.UNPACK_ALIGNMENT, xA.unpackAlignment), o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL, o.NONE);
19938
19938
  const ce = xA.isCompressedTexture || xA.image[0].isCompressedTexture, Se = xA.image[0] && xA.image[0].isDataTexture, Ie = [];
19939
- for (let XA = 0; XA < 6; XA++) Ie[XA] = ce || Se ? Se ? xA.image[XA].image : xA.image[XA] : _(xA.image[XA], !1, !0, u), Ie[XA] = Xe(xA, Ie[XA]);
19940
- const Pe = Ie[0], He = L(Pe) || I, Re = a.convert(xA.format, xA.colorSpace), Ct = a.convert(xA.type), It = eA(xA.internalFormat, Re, Ct, xA.colorSpace), J = I && xA.isVideoTexture !== !0, $ = TA.__version === void 0 || kA === !0;
19939
+ for (let XA = 0; XA < 6; XA++) Ie[XA] = ce || Se ? Se ? xA.image[XA].image : xA.image[XA] : R(xA.image[XA], !1, !0, u), Ie[XA] = Xe(xA, Ie[XA]);
19940
+ const Pe = Ie[0], He = F(Pe) || I, Re = a.convert(xA.format, xA.colorSpace), Ct = a.convert(xA.type), It = eA(xA.internalFormat, Re, Ct, xA.colorSpace), J = I && xA.isVideoTexture !== !0, $ = TA.__version === void 0 || kA === !0;
19941
19941
  let MA, te = QA(xA, Pe, He);
19942
19942
  if (fe(o.TEXTURE_CUBE_MAP, xA, He), ce) {
19943
19943
  J && $ && e.texStorage2D(o.TEXTURE_CUBE_MAP, te, It, Pe.width, Pe.height);
@@ -19974,7 +19974,7 @@ void main() {
19974
19974
  }, this.setupRenderTarget = function(oA) {
19975
19975
  const lA = oA.texture, vA = i.get(oA), WA = i.get(lA);
19976
19976
  oA.addEventListener("dispose", RA), oA.isWebGLMultipleRenderTargets !== !0 && (WA.__webglTexture === void 0 && (WA.__webglTexture = o.createTexture()), WA.__version = lA.version, g.memory.textures++);
19977
- const xA = oA.isWebGLCubeRenderTarget === !0, Be = oA.isWebGLMultipleRenderTargets === !0, kA = L(oA) || I;
19977
+ const xA = oA.isWebGLCubeRenderTarget === !0, Be = oA.isWebGLMultipleRenderTargets === !0, kA = F(oA) || I;
19978
19978
  if (xA) {
19979
19979
  vA.__webglFramebuffer = [];
19980
19980
  for (let sA = 0; sA < 6; sA++) vA.__webglFramebuffer[sA] = o.createFramebuffer();
@@ -20015,7 +20015,7 @@ void main() {
20015
20015
  }
20016
20016
  oA.depthBuffer && de(oA);
20017
20017
  }, this.updateRenderTargetMipmap = function(oA) {
20018
- const lA = L(oA) || I, vA = oA.isWebGLMultipleRenderTargets === !0 ? oA.texture : [oA.texture];
20018
+ const lA = F(oA) || I, vA = oA.isWebGLMultipleRenderTargets === !0 ? oA.texture : [oA.texture];
20019
20019
  for (let WA = 0, xA = vA.length; WA < xA; WA++) {
20020
20020
  const Be = vA[WA];
20021
20021
  if (rA(Be, lA)) {
@@ -20174,12 +20174,12 @@ void main() {
20174
20174
  if (A && e.session.visibilityState !== "visible-blurred") {
20175
20175
  if (c && A.hand) {
20176
20176
  g = !0;
20177
- for (const N of A.hand.values()) {
20178
- const R = e.getJointPose(N, i), G = this._getHandJoint(c, N);
20179
- R !== null && (G.matrix.fromArray(R.transform.matrix), G.matrix.decompose(G.position, G.rotation, G.scale), G.matrixWorldNeedsUpdate = !0, G.jointRadius = R.radius), G.visible = R !== null;
20177
+ for (const G of A.hand.values()) {
20178
+ const _ = e.getJointPose(G, i), N = this._getHandJoint(c, G);
20179
+ _ !== null && (N.matrix.fromArray(_.transform.matrix), N.matrix.decompose(N.position, N.rotation, N.scale), N.matrixWorldNeedsUpdate = !0, N.jointRadius = _.radius), N.visible = _ !== null;
20180
20180
  }
20181
- const C = c.joints["index-finger-tip"], f = c.joints["thumb-tip"], m = C.position.distanceTo(f.position), M = 0.02, F = 5e-3;
20182
- c.inputState.pinching && m > M + F ? (c.inputState.pinching = !1, this.dispatchEvent({ type: "pinchend", handedness: A.handedness, target: this })) : !c.inputState.pinching && m <= M - F && (c.inputState.pinching = !0, this.dispatchEvent({ type: "pinchstart", handedness: A.handedness, target: this }));
20181
+ const C = c.joints["index-finger-tip"], f = c.joints["thumb-tip"], m = C.position.distanceTo(f.position), M = 0.02, L = 5e-3;
20182
+ c.inputState.pinching && m > M + L ? (c.inputState.pinching = !1, this.dispatchEvent({ type: "pinchend", handedness: A.handedness, target: this })) : !c.inputState.pinching && m <= M - L && (c.inputState.pinching = !0, this.dispatchEvent({ type: "pinchstart", handedness: A.handedness, target: this }));
20183
20183
  } else u !== null && A.gripSpace && (a = e.getPose(A.gripSpace, i), a !== null && (u.matrix.fromArray(a.transform.matrix), u.matrix.decompose(u.position, u.rotation, u.scale), u.matrixWorldNeedsUpdate = !0, a.linearVelocity ? (u.hasLinearVelocity = !0, u.linearVelocity.copy(a.linearVelocity)) : u.hasLinearVelocity = !1, a.angularVelocity ? (u.hasAngularVelocity = !0, u.angularVelocity.copy(a.angularVelocity)) : u.hasAngularVelocity = !1));
20184
20184
  I !== null && (n = e.getPose(A.targetRaySpace, i), n === null && a !== null && (n = a), n !== null && (I.matrix.fromArray(n.transform.matrix), I.matrix.decompose(I.position, I.rotation, I.scale), I.matrixWorldNeedsUpdate = !0, n.linearVelocity ? (I.hasLinearVelocity = !0, I.linearVelocity.copy(n.linearVelocity)) : I.hasLinearVelocity = !1, n.angularVelocity ? (I.hasAngularVelocity = !0, I.angularVelocity.copy(n.angularVelocity)) : I.hasAngularVelocity = !1, this.dispatchEvent(cp)));
20185
20185
  }
@@ -20203,10 +20203,10 @@ void main() {
20203
20203
  constructor(A, e) {
20204
20204
  super();
20205
20205
  const i = this;
20206
- let n = null, a = 1, g = null, I = "local-floor", u = 1, c = null, C = null, f = null, m = null, M = null, F = null;
20207
- const N = e.getContextAttributes();
20208
- let R = null, G = null;
20209
- const _ = [], L = [], rA = /* @__PURE__ */ new Set(), tA = /* @__PURE__ */ new Map(), eA = new Hi();
20206
+ let n = null, a = 1, g = null, I = "local-floor", u = 1, c = null, C = null, f = null, m = null, M = null, L = null;
20207
+ const G = e.getContextAttributes();
20208
+ let _ = null, N = null;
20209
+ const R = [], F = [], rA = /* @__PURE__ */ new Set(), tA = /* @__PURE__ */ new Map(), eA = new Hi();
20210
20210
  eA.layers.enable(1), eA.viewport = new Jt();
20211
20211
  const QA = new Hi();
20212
20212
  QA.layers.enable(2), QA.viewport = new Jt();
@@ -20214,53 +20214,53 @@ void main() {
20214
20214
  IA.layers.enable(1), IA.layers.enable(2);
20215
20215
  let RA = null, wA = null;
20216
20216
  function jA(YA) {
20217
- const de = L.indexOf(YA.inputSource);
20217
+ const de = F.indexOf(YA.inputSource);
20218
20218
  if (de === -1) return;
20219
- const be = _[de];
20219
+ const be = R[de];
20220
20220
  be !== void 0 && (be.update(YA.inputSource, YA.frame, c || g), be.dispatchEvent({ type: YA.type, data: YA.inputSource }));
20221
20221
  }
20222
20222
  function Ce() {
20223
20223
  n.removeEventListener("select", jA), n.removeEventListener("selectstart", jA), n.removeEventListener("selectend", jA), n.removeEventListener("squeeze", jA), n.removeEventListener("squeezestart", jA), n.removeEventListener("squeezeend", jA), n.removeEventListener("end", Ce), n.removeEventListener("inputsourceschange", Qe);
20224
- for (let YA = 0; YA < _.length; YA++) {
20225
- const de = L[YA];
20226
- de !== null && (L[YA] = null, _[YA].disconnect(de));
20224
+ for (let YA = 0; YA < R.length; YA++) {
20225
+ const de = F[YA];
20226
+ de !== null && (F[YA] = null, R[YA].disconnect(de));
20227
20227
  }
20228
- RA = null, wA = null, A.setRenderTarget(R), M = null, m = null, f = null, n = null, G = null, Fe.stop(), i.isPresenting = !1, i.dispatchEvent({ type: "sessionend" });
20228
+ RA = null, wA = null, A.setRenderTarget(_), M = null, m = null, f = null, n = null, N = null, Fe.stop(), i.isPresenting = !1, i.dispatchEvent({ type: "sessionend" });
20229
20229
  }
20230
20230
  function Qe(YA) {
20231
20231
  for (let de = 0; de < YA.removed.length; de++) {
20232
- const be = YA.removed[de], ge = L.indexOf(be);
20233
- ge >= 0 && (L[ge] = null, _[ge].disconnect(be));
20232
+ const be = YA.removed[de], ge = F.indexOf(be);
20233
+ ge >= 0 && (F[ge] = null, R[ge].disconnect(be));
20234
20234
  }
20235
20235
  for (let de = 0; de < YA.added.length; de++) {
20236
20236
  const be = YA.added[de];
20237
- let ge = L.indexOf(be);
20237
+ let ge = F.indexOf(be);
20238
20238
  if (ge === -1) {
20239
- for (let oA = 0; oA < _.length; oA++) {
20240
- if (oA >= L.length) {
20241
- L.push(be), ge = oA;
20239
+ for (let oA = 0; oA < R.length; oA++) {
20240
+ if (oA >= F.length) {
20241
+ F.push(be), ge = oA;
20242
20242
  break;
20243
20243
  }
20244
- if (L[oA] === null) {
20245
- L[oA] = be, ge = oA;
20244
+ if (F[oA] === null) {
20245
+ F[oA] = be, ge = oA;
20246
20246
  break;
20247
20247
  }
20248
20248
  }
20249
20249
  if (ge === -1) break;
20250
20250
  }
20251
- const Xe = _[ge];
20251
+ const Xe = R[ge];
20252
20252
  Xe && Xe.connect(be);
20253
20253
  }
20254
20254
  }
20255
20255
  this.cameraAutoUpdate = !0, this.enabled = !1, this.isPresenting = !1, this.getController = function(YA) {
20256
- let de = _[YA];
20257
- return de === void 0 && (de = new Dc(), _[YA] = de), de.getTargetRaySpace();
20256
+ let de = R[YA];
20257
+ return de === void 0 && (de = new Dc(), R[YA] = de), de.getTargetRaySpace();
20258
20258
  }, this.getControllerGrip = function(YA) {
20259
- let de = _[YA];
20260
- return de === void 0 && (de = new Dc(), _[YA] = de), de.getGripSpace();
20259
+ let de = R[YA];
20260
+ return de === void 0 && (de = new Dc(), R[YA] = de), de.getGripSpace();
20261
20261
  }, this.getHand = function(YA) {
20262
- let de = _[YA];
20263
- return de === void 0 && (de = new Dc(), _[YA] = de), de.getHandSpace();
20262
+ let de = R[YA];
20263
+ return de === void 0 && (de = new Dc(), R[YA] = de), de.getHandSpace();
20264
20264
  }, this.setFramebufferScaleFactor = function(YA) {
20265
20265
  a = YA, i.isPresenting;
20266
20266
  }, this.setReferenceSpaceType = function(YA) {
@@ -20274,21 +20274,21 @@ void main() {
20274
20274
  }, this.getBinding = function() {
20275
20275
  return f;
20276
20276
  }, this.getFrame = function() {
20277
- return F;
20277
+ return L;
20278
20278
  }, this.getSession = function() {
20279
20279
  return n;
20280
20280
  }, this.setSession = async function(YA) {
20281
20281
  if (n = YA, n !== null) {
20282
- if (R = A.getRenderTarget(), n.addEventListener("select", jA), n.addEventListener("selectstart", jA), n.addEventListener("selectend", jA), n.addEventListener("squeeze", jA), n.addEventListener("squeezestart", jA), n.addEventListener("squeezeend", jA), n.addEventListener("end", Ce), n.addEventListener("inputsourceschange", Qe), N.xrCompatible !== !0 && await e.makeXRCompatible(), n.renderState.layers === void 0 || A.capabilities.isWebGL2 === !1) {
20283
- const de = { antialias: n.renderState.layers !== void 0 || N.antialias, alpha: !0, depth: N.depth, stencil: N.stencil, framebufferScaleFactor: a };
20284
- M = new XRWebGLLayer(n, e, de), n.updateRenderState({ baseLayer: M }), G = new Xt(M.framebufferWidth, M.framebufferHeight, { format: ke, type: SA, colorSpace: A.outputColorSpace, stencilBuffer: N.stencil });
20282
+ if (_ = A.getRenderTarget(), n.addEventListener("select", jA), n.addEventListener("selectstart", jA), n.addEventListener("selectend", jA), n.addEventListener("squeeze", jA), n.addEventListener("squeezestart", jA), n.addEventListener("squeezeend", jA), n.addEventListener("end", Ce), n.addEventListener("inputsourceschange", Qe), G.xrCompatible !== !0 && await e.makeXRCompatible(), n.renderState.layers === void 0 || A.capabilities.isWebGL2 === !1) {
20283
+ const de = { antialias: n.renderState.layers !== void 0 || G.antialias, alpha: !0, depth: G.depth, stencil: G.stencil, framebufferScaleFactor: a };
20284
+ M = new XRWebGLLayer(n, e, de), n.updateRenderState({ baseLayer: M }), N = new Xt(M.framebufferWidth, M.framebufferHeight, { format: ke, type: SA, colorSpace: A.outputColorSpace, stencilBuffer: G.stencil });
20285
20285
  } else {
20286
20286
  let de = null, be = null, ge = null;
20287
- N.depth && (ge = N.stencil ? e.DEPTH24_STENCIL8 : e.DEPTH_COMPONENT24, de = N.stencil ? Ue : se, be = N.stencil ? HA : U);
20287
+ G.depth && (ge = G.stencil ? e.DEPTH24_STENCIL8 : e.DEPTH_COMPONENT24, de = G.stencil ? Ue : se, be = G.stencil ? HA : U);
20288
20288
  const Xe = { colorFormat: e.RGBA8, depthFormat: ge, scaleFactor: a };
20289
- f = new XRWebGLBinding(n, e), m = f.createProjectionLayer(Xe), n.updateRenderState({ layers: [m] }), G = new Xt(m.textureWidth, m.textureHeight, { format: ke, type: SA, depthTexture: new Ip(m.textureWidth, m.textureHeight, be, void 0, void 0, void 0, void 0, void 0, void 0, de), stencilBuffer: N.stencil, colorSpace: A.outputColorSpace, samples: N.antialias ? 4 : 0 }), A.properties.get(G).__ignoreDepthValues = m.ignoreDepthValues;
20289
+ f = new XRWebGLBinding(n, e), m = f.createProjectionLayer(Xe), n.updateRenderState({ layers: [m] }), N = new Xt(m.textureWidth, m.textureHeight, { format: ke, type: SA, depthTexture: new Ip(m.textureWidth, m.textureHeight, be, void 0, void 0, void 0, void 0, void 0, void 0, de), stencilBuffer: G.stencil, colorSpace: A.outputColorSpace, samples: G.antialias ? 4 : 0 }), A.properties.get(N).__ignoreDepthValues = m.ignoreDepthValues;
20290
20290
  }
20291
- G.isXRRenderTarget = !0, this.setFoveation(u), c = null, g = await n.requestReferenceSpace(I), Fe.setContext(n), Fe.start(), i.isPresenting = !0, i.dispatchEvent({ type: "sessionstart" });
20291
+ N.isXRRenderTarget = !0, this.setFoveation(u), c = null, g = await n.requestReferenceSpace(I), Fe.setContext(n), Fe.start(), i.isPresenting = !0, i.dispatchEvent({ type: "sessionstart" });
20292
20292
  }
20293
20293
  }, this.getEnvironmentBlendMode = function() {
20294
20294
  if (n !== null) return n.environmentBlendMode;
@@ -20327,9 +20327,9 @@ void main() {
20327
20327
  let _e = null;
20328
20328
  const Fe = new Oh();
20329
20329
  Fe.setAnimationLoop((function(YA, de) {
20330
- if (C = de.getViewerPose(c || g), F = de, C !== null) {
20330
+ if (C = de.getViewerPose(c || g), L = de, C !== null) {
20331
20331
  const be = C.views;
20332
- M !== null && (A.setRenderTargetFramebuffer(G, M.framebuffer), A.setRenderTarget(G));
20332
+ M !== null && (A.setRenderTargetFramebuffer(N, M.framebuffer), A.setRenderTarget(N));
20333
20333
  let ge = !1;
20334
20334
  be.length !== IA.cameras.length && (IA.cameras.length = 0, ge = !0);
20335
20335
  for (let Xe = 0; Xe < be.length; Xe++) {
@@ -20338,14 +20338,14 @@ void main() {
20338
20338
  if (M !== null) lA = M.getViewport(oA);
20339
20339
  else {
20340
20340
  const WA = f.getViewSubImage(m, oA);
20341
- lA = WA.viewport, Xe === 0 && (A.setRenderTargetTextures(G, WA.colorTexture, m.ignoreDepthValues ? void 0 : WA.depthStencilTexture), A.setRenderTarget(G));
20341
+ lA = WA.viewport, Xe === 0 && (A.setRenderTargetTextures(N, WA.colorTexture, m.ignoreDepthValues ? void 0 : WA.depthStencilTexture), A.setRenderTarget(N));
20342
20342
  }
20343
20343
  let vA = bA[Xe];
20344
20344
  vA === void 0 && (vA = new Hi(), vA.layers.enable(Xe), vA.viewport = new Jt(), bA[Xe] = vA), vA.matrix.fromArray(oA.transform.matrix), vA.matrix.decompose(vA.position, vA.quaternion, vA.scale), vA.projectionMatrix.fromArray(oA.projectionMatrix), vA.projectionMatrixInverse.copy(vA.projectionMatrix).invert(), vA.viewport.set(lA.x, lA.y, lA.width, lA.height), Xe === 0 && (IA.matrix.copy(vA.matrix), IA.matrix.decompose(IA.position, IA.quaternion, IA.scale)), ge === !0 && IA.cameras.push(vA);
20345
20345
  }
20346
20346
  }
20347
- for (let be = 0; be < _.length; be++) {
20348
- const ge = L[be], Xe = _[be];
20347
+ for (let be = 0; be < R.length; be++) {
20348
+ const ge = F[be], Xe = R[be];
20349
20349
  ge !== null && Xe !== void 0 && Xe.update(ge, de, c || g);
20350
20350
  }
20351
20351
  if (_e && _e(YA, de), de.detectedPlanes) {
@@ -20358,7 +20358,7 @@ void main() {
20358
20358
  ge.lastChangedTime > Xe && (tA.set(ge, ge.lastChangedTime), i.dispatchEvent({ type: "planechanged", data: ge }));
20359
20359
  } else rA.add(ge), tA.set(ge, de.lastChangedTime), i.dispatchEvent({ type: "planeadded", data: ge });
20360
20360
  }
20361
- F = null;
20361
+ L = null;
20362
20362
  })), this.setAnimationLoop = function(YA) {
20363
20363
  _e = YA;
20364
20364
  }, this.dispose = function() {
@@ -20410,23 +20410,23 @@ void main() {
20410
20410
  let n = {}, a = {}, g = [];
20411
20411
  const I = e.isWebGL2 ? o.getParameter(o.MAX_UNIFORM_BUFFER_BINDINGS) : 0;
20412
20412
  function u(f, m, M) {
20413
- const F = f.value;
20413
+ const L = f.value;
20414
20414
  if (M[m] === void 0) {
20415
- if (typeof F == "number") M[m] = F;
20415
+ if (typeof L == "number") M[m] = L;
20416
20416
  else {
20417
- const N = Array.isArray(F) ? F : [F], R = [];
20418
- for (let G = 0; G < N.length; G++) R.push(N[G].clone());
20419
- M[m] = R;
20417
+ const G = Array.isArray(L) ? L : [L], _ = [];
20418
+ for (let N = 0; N < G.length; N++) _.push(G[N].clone());
20419
+ M[m] = _;
20420
20420
  }
20421
20421
  return !0;
20422
20422
  }
20423
- if (typeof F == "number") {
20424
- if (M[m] !== F) return M[m] = F, !0;
20423
+ if (typeof L == "number") {
20424
+ if (M[m] !== L) return M[m] = L, !0;
20425
20425
  } else {
20426
- const N = Array.isArray(M[m]) ? M[m] : [M[m]], R = Array.isArray(F) ? F : [F];
20427
- for (let G = 0; G < N.length; G++) {
20428
- const _ = N[G];
20429
- if (_.equals(R[G]) === !1) return _.copy(R[G]), !0;
20426
+ const G = Array.isArray(M[m]) ? M[m] : [M[m]], _ = Array.isArray(L) ? L : [L];
20427
+ for (let N = 0; N < G.length; N++) {
20428
+ const R = G[N];
20429
+ if (R.equals(_[N]) === !1) return R.copy(_[N]), !0;
20430
20430
  }
20431
20431
  }
20432
20432
  return !1;
@@ -20446,38 +20446,38 @@ void main() {
20446
20446
  i.uniformBlockBinding(f, M);
20447
20447
  }, update: function(f, m) {
20448
20448
  let M = n[f.id];
20449
- M === void 0 && ((function(R) {
20450
- const G = R.uniforms;
20451
- let _ = 0;
20452
- const L = 16;
20449
+ M === void 0 && ((function(_) {
20450
+ const N = _.uniforms;
20451
+ let R = 0;
20452
+ const F = 16;
20453
20453
  let rA = 0;
20454
- for (let tA = 0, eA = G.length; tA < eA; tA++) {
20455
- const QA = G[tA], bA = { boundary: 0, storage: 0 }, IA = Array.isArray(QA.value) ? QA.value : [QA.value];
20454
+ for (let tA = 0, eA = N.length; tA < eA; tA++) {
20455
+ const QA = N[tA], bA = { boundary: 0, storage: 0 }, IA = Array.isArray(QA.value) ? QA.value : [QA.value];
20456
20456
  for (let RA = 0, wA = IA.length; RA < wA; RA++) {
20457
20457
  const jA = c(IA[RA]);
20458
20458
  bA.boundary += jA.boundary, bA.storage += jA.storage;
20459
20459
  }
20460
- QA.__data = new Float32Array(bA.storage / Float32Array.BYTES_PER_ELEMENT), QA.__offset = _, tA > 0 && (rA = _ % L, rA !== 0 && L - rA - bA.boundary < 0 && (_ += L - rA, QA.__offset = _)), _ += bA.storage;
20460
+ QA.__data = new Float32Array(bA.storage / Float32Array.BYTES_PER_ELEMENT), QA.__offset = R, tA > 0 && (rA = R % F, rA !== 0 && F - rA - bA.boundary < 0 && (R += F - rA, QA.__offset = R)), R += bA.storage;
20461
20461
  }
20462
- rA = _ % L, rA > 0 && (_ += L - rA), R.__size = _, R.__cache = {};
20463
- })(f), M = (function(R) {
20464
- const G = (function() {
20462
+ rA = R % F, rA > 0 && (R += F - rA), _.__size = R, _.__cache = {};
20463
+ })(f), M = (function(_) {
20464
+ const N = (function() {
20465
20465
  for (let tA = 0; tA < I; tA++) if (g.indexOf(tA) === -1) return g.push(tA), tA;
20466
20466
  return 0;
20467
20467
  })();
20468
- R.__bindingPointIndex = G;
20469
- const _ = o.createBuffer(), L = R.__size, rA = R.usage;
20470
- return o.bindBuffer(o.UNIFORM_BUFFER, _), o.bufferData(o.UNIFORM_BUFFER, L, rA), o.bindBuffer(o.UNIFORM_BUFFER, null), o.bindBufferBase(o.UNIFORM_BUFFER, G, _), _;
20468
+ _.__bindingPointIndex = N;
20469
+ const R = o.createBuffer(), F = _.__size, rA = _.usage;
20470
+ return o.bindBuffer(o.UNIFORM_BUFFER, R), o.bufferData(o.UNIFORM_BUFFER, F, rA), o.bindBuffer(o.UNIFORM_BUFFER, null), o.bindBufferBase(o.UNIFORM_BUFFER, N, R), R;
20471
20471
  })(f), n[f.id] = M, f.addEventListener("dispose", C));
20472
- const F = m.program;
20473
- i.updateUBOMapping(f, F);
20474
- const N = A.render.frame;
20475
- a[f.id] !== N && ((function(R) {
20476
- const G = n[R.id], _ = R.uniforms, L = R.__cache;
20477
- o.bindBuffer(o.UNIFORM_BUFFER, G);
20478
- for (let rA = 0, tA = _.length; rA < tA; rA++) {
20479
- const eA = _[rA];
20480
- if (u(eA, rA, L) === !0) {
20472
+ const L = m.program;
20473
+ i.updateUBOMapping(f, L);
20474
+ const G = A.render.frame;
20475
+ a[f.id] !== G && ((function(_) {
20476
+ const N = n[_.id], R = _.uniforms, F = _.__cache;
20477
+ o.bindBuffer(o.UNIFORM_BUFFER, N);
20478
+ for (let rA = 0, tA = R.length; rA < tA; rA++) {
20479
+ const eA = R[rA];
20480
+ if (u(eA, rA, F) === !0) {
20481
20481
  const QA = eA.__offset, bA = Array.isArray(eA.value) ? eA.value : [eA.value];
20482
20482
  let IA = 0;
20483
20483
  for (let RA = 0; RA < bA.length; RA++) {
@@ -20488,7 +20488,7 @@ void main() {
20488
20488
  }
20489
20489
  }
20490
20490
  o.bindBuffer(o.UNIFORM_BUFFER, null);
20491
- })(f), a[f.id] = N);
20491
+ })(f), a[f.id] = G);
20492
20492
  }, dispose: function() {
20493
20493
  for (const f in n) o.deleteBuffer(n[f]);
20494
20494
  g = [], n = {}, a = {};
@@ -20503,11 +20503,11 @@ void main() {
20503
20503
  const { canvas: e = dp(), context: i = null, depth: n = !0, stencil: a = !0, alpha: g = !1, antialias: I = !1, premultipliedAlpha: u = !0, preserveDrawingBuffer: c = !1, powerPreference: C = "default", failIfMajorPerformanceCaveat: f = !1 } = A;
20504
20504
  let m;
20505
20505
  this.isWebGLRenderer = !0, m = i !== null ? i.getContextAttributes().alpha : g;
20506
- let M = null, F = null;
20507
- const N = [], R = [];
20506
+ let M = null, L = null;
20507
+ const G = [], _ = [];
20508
20508
  this.domElement = e, this.debug = { checkShaderErrors: !0, onShaderError: null }, this.autoClear = !0, this.autoClearColor = !0, this.autoClearDepth = !0, this.autoClearStencil = !0, this.sortObjects = !0, this.clippingPlanes = [], this.localClippingEnabled = !1, this.outputColorSpace = iA, this.useLegacyLights = !0, this.toneMapping = k, this.toneMappingExposure = 1;
20509
- const G = this;
20510
- let _ = !1, L = 0, rA = 0, tA = null, eA = -1, QA = null;
20509
+ const N = this;
20510
+ let R = !1, F = 0, rA = 0, tA = null, eA = -1, QA = null;
20511
20511
  const bA = new Jt(), IA = new Jt();
20512
20512
  let RA = null, wA = e.width, jA = e.height, Ce = 1, Qe = null, Ve = null;
20513
20513
  const fe = new Jt(0, 0, wA, jA), Me = new Jt(0, 0, wA, jA);
@@ -20530,7 +20530,7 @@ void main() {
20530
20530
  const gA = { alpha: !0, depth: n, stencil: a, antialias: I, premultipliedAlpha: u, preserveDrawingBuffer: c, powerPreference: C, failIfMajorPerformanceCaveat: f };
20531
20531
  if ("setAttribute" in e && e.setAttribute("data-engine", `three.js r${B}`), e.addEventListener("webglcontextlost", et, !1), e.addEventListener("webglcontextrestored", dt, !1), e.addEventListener("webglcontextcreationerror", Oe, !1), yA === null) {
20532
20532
  const $A = ["webgl2", "webgl", "experimental-webgl"];
20533
- if (G.isWebGL1Renderer === !0 && $A.shift(), yA = Ke($A, gA), yA === null) throw Ke($A) ? new Error("Error creating WebGL context with your selected attributes.") : new Error("Error creating WebGL context.");
20533
+ if (N.isWebGL1Renderer === !0 && $A.shift(), yA = Ke($A, gA), yA === null) throw Ke($A) ? new Error("Error creating WebGL context with your selected attributes.") : new Error("Error creating WebGL context.");
20534
20534
  }
20535
20535
  yA.getShaderPrecisionFormat === void 0 && (yA.getShaderPrecisionFormat = function() {
20536
20536
  return { rangeMin: 1, rangeMax: 1, precision: 1 };
@@ -20539,15 +20539,15 @@ void main() {
20539
20539
  throw gA.message, gA;
20540
20540
  }
20541
20541
  function ze() {
20542
- vA = new JQ(yA), WA = new GQ(yA, vA, A), vA.init(WA), OA = new gp(yA, vA, WA), xA = new ap(yA, vA, WA), Be = new PQ(yA), kA = new Zf(), sA = new op(yA, vA, xA, kA, WA, OA, Be), TA = new TQ(G), ce = new HQ(G), Se = new NQ(yA, WA), Ye = new FQ(yA, vA, Se, WA), Ie = new YQ(yA, Se, Be, Ye), Pe = new VQ(yA, Ie, Se, Be), te = new qQ(yA, WA, sA), J = new UQ(kA), He = new Wf(G, TA, ce, vA, WA, Ye, J), Re = new up(G, kA), Ct = new Xf(), It = new ip(vA, WA), MA = new kQ(G, TA, ce, xA, Pe, m, u), $ = new sp(G, Pe, WA), We = new Cp(yA, Be, WA, xA), XA = new LQ(yA, vA, Be, WA), _A = new OQ(yA, vA, Be, WA), Be.programs = He.programs, G.capabilities = WA, G.extensions = vA, G.properties = kA, G.renderLists = Ct, G.shadowMap = $, G.state = xA, G.info = Be;
20542
+ vA = new JQ(yA), WA = new GQ(yA, vA, A), vA.init(WA), OA = new gp(yA, vA, WA), xA = new ap(yA, vA, WA), Be = new PQ(yA), kA = new Zf(), sA = new op(yA, vA, xA, kA, WA, OA, Be), TA = new TQ(N), ce = new HQ(N), Se = new NQ(yA, WA), Ye = new FQ(yA, vA, Se, WA), Ie = new YQ(yA, Se, Be, Ye), Pe = new VQ(yA, Ie, Se, Be), te = new qQ(yA, WA, sA), J = new UQ(kA), He = new Wf(N, TA, ce, vA, WA, Ye, J), Re = new up(N, kA), Ct = new Xf(), It = new ip(vA, WA), MA = new kQ(N, TA, ce, xA, Pe, m, u), $ = new sp(N, Pe, WA), We = new Cp(yA, Be, WA, xA), XA = new LQ(yA, vA, Be, WA), _A = new OQ(yA, vA, Be, WA), Be.programs = He.programs, N.capabilities = WA, N.extensions = vA, N.properties = kA, N.renderLists = Ct, N.shadowMap = $, N.state = xA, N.info = Be;
20543
20543
  }
20544
20544
  ze();
20545
- const Le = new hp(G, yA);
20545
+ const Le = new hp(N, yA);
20546
20546
  function et(gA) {
20547
- gA.preventDefault(), _ = !0;
20547
+ gA.preventDefault(), R = !0;
20548
20548
  }
20549
20549
  function dt() {
20550
- _ = !1;
20550
+ R = !1;
20551
20551
  const gA = Be.autoReset, $A = $.enabled, Ee = $.autoUpdate, le = $.needsUpdate, pe = $.type;
20552
20552
  ze(), Be.autoReset = gA, $.enabled = $A, $.autoUpdate = Ee, $.needsUpdate = le, $.type = pe;
20553
20553
  }
@@ -20628,7 +20628,7 @@ void main() {
20628
20628
  $A === null && ($A = oA);
20629
20629
  const ht = pe.isMesh && pe.matrixWorld.determinant() < 0, Mt = (function(Ot, gn, Si, Qt, yi) {
20630
20630
  gn.isScene !== !0 && (gn = oA), sA.resetTextureUnits();
20631
- const II = gn.fog, yw = Qt.isMeshStandardMaterial ? gn.environment : null, Dw = tA === null ? G.outputColorSpace : tA.isXRRenderTarget === !0 ? tA.texture.colorSpace : q, nl = (Qt.isMeshStandardMaterial ? ce : TA).get(Qt.envMap || yw), vw = Qt.vertexColors === !0 && !!Si.attributes.color && Si.attributes.color.itemSize === 4, Mw = !!Qt.normalMap && !!Si.attributes.tangent, Sw = !!Si.morphAttributes.position, xw = !!Si.morphAttributes.normal, bw = !!Si.morphAttributes.color, Rw = Qt.toneMapped ? G.toneMapping : k, WC = Si.morphAttributes.position || Si.morphAttributes.normal || Si.morphAttributes.color, _w = WC !== void 0 ? WC.length : 0, Ai = kA.get(Qt), Nw = F.state.lights;
20631
+ const II = gn.fog, yw = Qt.isMeshStandardMaterial ? gn.environment : null, Dw = tA === null ? N.outputColorSpace : tA.isXRRenderTarget === !0 ? tA.texture.colorSpace : q, nl = (Qt.isMeshStandardMaterial ? ce : TA).get(Qt.envMap || yw), vw = Qt.vertexColors === !0 && !!Si.attributes.color && Si.attributes.color.itemSize === 4, Mw = !!Qt.normalMap && !!Si.attributes.tangent, Sw = !!Si.morphAttributes.position, xw = !!Si.morphAttributes.normal, bw = !!Si.morphAttributes.color, Rw = Qt.toneMapped ? N.toneMapping : k, WC = Si.morphAttributes.position || Si.morphAttributes.normal || Si.morphAttributes.color, _w = WC !== void 0 ? WC.length : 0, Ai = kA.get(Qt), Nw = L.state.lights;
20632
20632
  if (YA === !0 && (de === !0 || Ot !== QA)) {
20633
20633
  const mn = Ot === QA && Qt.id === eA;
20634
20634
  J.setState(Qt, Ot, mn);
@@ -20652,7 +20652,7 @@ void main() {
20652
20652
  mn && WA.floatVertexTextures && (mn.boneTexture === null && mn.computeBoneTexture(), tn.setValue(yA, "boneTexture", mn.boneTexture, sA), tn.setValue(yA, "boneTextureSize", mn.boneTextureSize));
20653
20653
  }
20654
20654
  const uI = Si.morphAttributes;
20655
- (uI.position !== void 0 || uI.normal !== void 0 || uI.color !== void 0 && WA.isWebGL2 === !0) && te.update(yi, Si, Rs), (fo || Ai.receiveShadow !== yi.receiveShadow) && (Ai.receiveShadow = yi.receiveShadow, tn.setValue(yA, "receiveShadow", yi.receiveShadow)), Qt.isMeshGouraudMaterial && Qt.envMap !== null && (_s.envMap.value = nl, _s.flipEnvMap.value = nl.isCubeTexture && nl.isRenderTargetTexture === !1 ? -1 : 1), fo && (tn.setValue(yA, "toneMappingExposure", G.toneMappingExposure), Ai.needsLights && (qn = hI, (sr = _s).ambientLightColor.needsUpdate = qn, sr.lightProbe.needsUpdate = qn, sr.directionalLights.needsUpdate = qn, sr.directionalLightShadows.needsUpdate = qn, sr.pointLights.needsUpdate = qn, sr.pointLightShadows.needsUpdate = qn, sr.spotLights.needsUpdate = qn, sr.spotLightShadows.needsUpdate = qn, sr.rectAreaLights.needsUpdate = qn, sr.hemisphereLights.needsUpdate = qn), II && Qt.fog === !0 && Re.refreshFogUniforms(_s, II), Re.refreshMaterialUniforms(_s, Qt, Ce, jA, be), xg.upload(yA, Ai.uniformsList, _s, sA));
20655
+ (uI.position !== void 0 || uI.normal !== void 0 || uI.color !== void 0 && WA.isWebGL2 === !0) && te.update(yi, Si, Rs), (fo || Ai.receiveShadow !== yi.receiveShadow) && (Ai.receiveShadow = yi.receiveShadow, tn.setValue(yA, "receiveShadow", yi.receiveShadow)), Qt.isMeshGouraudMaterial && Qt.envMap !== null && (_s.envMap.value = nl, _s.flipEnvMap.value = nl.isCubeTexture && nl.isRenderTargetTexture === !1 ? -1 : 1), fo && (tn.setValue(yA, "toneMappingExposure", N.toneMappingExposure), Ai.needsLights && (qn = hI, (sr = _s).ambientLightColor.needsUpdate = qn, sr.lightProbe.needsUpdate = qn, sr.directionalLights.needsUpdate = qn, sr.directionalLightShadows.needsUpdate = qn, sr.pointLights.needsUpdate = qn, sr.pointLightShadows.needsUpdate = qn, sr.spotLights.needsUpdate = qn, sr.spotLightShadows.needsUpdate = qn, sr.rectAreaLights.needsUpdate = qn, sr.hemisphereLights.needsUpdate = qn), II && Qt.fog === !0 && Re.refreshFogUniforms(_s, II), Re.refreshMaterialUniforms(_s, Qt, Ce, jA, be), xg.upload(yA, Ai.uniformsList, _s, sA));
20656
20656
  var sr, qn;
20657
20657
  if (Qt.isShaderMaterial && Qt.uniformsNeedUpdate === !0 && (xg.upload(yA, Ai.uniformsList, _s, sA), Qt.uniformsNeedUpdate = !1), Qt.isSpriteMaterial && tn.setValue(yA, "center", yi.center), tn.setValue(yA, "modelViewMatrix", yi.modelViewMatrix), tn.setValue(yA, "normalMatrix", yi.normalMatrix), tn.setValue(yA, "modelMatrix", yi.matrixWorld), Qt.isShaderMaterial || Qt.isRawShaderMaterial) {
20658
20658
  const mn = Qt.uniformsGroups;
@@ -20688,14 +20688,14 @@ void main() {
20688
20688
  function Ee(le, pe, At) {
20689
20689
  le.transparent === !0 && le.side === 2 && le.forceSinglePass === !1 ? (le.side = y, le.needsUpdate = !0, Mi(le, pe, At), le.side = p, le.needsUpdate = !0, Mi(le, pe, At), le.side = 2) : Mi(le, pe, At);
20690
20690
  }
20691
- F = It.get(gA), F.init(), R.push(F), gA.traverseVisible((function(le) {
20692
- le.isLight && le.layers.test($A.layers) && (F.pushLight(le), le.castShadow && F.pushShadow(le));
20693
- })), F.setupLights(G.useLegacyLights), gA.traverse((function(le) {
20691
+ L = It.get(gA), L.init(), _.push(L), gA.traverseVisible((function(le) {
20692
+ le.isLight && le.layers.test($A.layers) && (L.pushLight(le), le.castShadow && L.pushShadow(le));
20693
+ })), L.setupLights(N.useLegacyLights), gA.traverse((function(le) {
20694
20694
  const pe = le.material;
20695
20695
  if (pe) if (Array.isArray(pe)) for (let At = 0; At < pe.length; At++)
20696
20696
  Ee(pe[At], gA, le);
20697
20697
  else Ee(pe, gA, le);
20698
- })), R.pop(), F = null;
20698
+ })), _.pop(), L = null;
20699
20699
  };
20700
20700
  let at = null;
20701
20701
  function mt() {
@@ -20710,7 +20710,7 @@ void main() {
20710
20710
  if (gA.layers.test($A.layers)) {
20711
20711
  if (gA.isGroup) Ee = gA.renderOrder;
20712
20712
  else if (gA.isLOD) gA.autoUpdate === !0 && gA.update($A);
20713
- else if (gA.isLight) F.pushLight(gA), gA.castShadow && F.pushShadow(gA);
20713
+ else if (gA.isLight) L.pushLight(gA), gA.castShadow && L.pushShadow(gA);
20714
20714
  else if (gA.isSprite) {
20715
20715
  if (!gA.frustumCulled || Fe.intersectsSprite(gA)) {
20716
20716
  le && Xe.setFromMatrixPosition(gA.matrixWorld).applyMatrix4(ge);
@@ -20734,15 +20734,15 @@ void main() {
20734
20734
  }
20735
20735
  function Ft(gA, $A, Ee, le) {
20736
20736
  const pe = gA.opaque, At = gA.transmissive, ht = gA.transparent;
20737
- F.setupLightsView(Ee), YA === !0 && J.setGlobalState(G.clippingPlanes, Ee), At.length > 0 && (function(Mt, Gt, ot, bt) {
20737
+ L.setupLightsView(Ee), YA === !0 && J.setGlobalState(N.clippingPlanes, Ee), At.length > 0 && (function(Mt, Gt, ot, bt) {
20738
20738
  if (be === null) {
20739
20739
  const Bt = WA.isWebGL2;
20740
20740
  be = new Xt(1024, 1024, { generateMipmaps: !0, type: vA.has("EXT_color_buffer_half_float") ? me : SA, minFilter: nA, samples: Bt && I === !0 ? 4 : 0 });
20741
20741
  }
20742
- const Rt = G.getRenderTarget();
20743
- G.setRenderTarget(be), G.clear();
20744
- const Wt = G.toneMapping;
20745
- G.toneMapping = k, oi(Mt, ot, bt), sA.updateMultisampleRenderTarget(be), sA.updateRenderTargetMipmap(be);
20742
+ const Rt = N.getRenderTarget();
20743
+ N.setRenderTarget(be), N.clear();
20744
+ const Wt = N.toneMapping;
20745
+ N.toneMapping = k, oi(Mt, ot, bt), sA.updateMultisampleRenderTarget(be), sA.updateRenderTargetMipmap(be);
20746
20746
  let Dt = !1;
20747
20747
  for (let Bt = 0, Yi = Gt.length; Bt < Yi; Bt++) {
20748
20748
  const jt = Gt[Bt], Ot = jt.object, gn = jt.geometry, Si = jt.material, Qt = jt.group;
@@ -20751,7 +20751,7 @@ void main() {
20751
20751
  Si.side = y, Si.needsUpdate = !0, Ji(Ot, ot, bt, gn, Si, Qt), Si.side = yi, Si.needsUpdate = !0, Dt = !0;
20752
20752
  }
20753
20753
  }
20754
- Dt === !0 && (sA.updateMultisampleRenderTarget(be), sA.updateRenderTargetMipmap(be)), G.setRenderTarget(Rt), G.toneMapping = Wt;
20754
+ Dt === !0 && (sA.updateMultisampleRenderTarget(be), sA.updateRenderTargetMipmap(be)), N.setRenderTarget(Rt), N.toneMapping = Wt;
20755
20755
  })(pe, At, $A, Ee), le && xA.viewport(bA.copy(le)), pe.length > 0 && oi(pe, $A, Ee), At.length > 0 && oi(At, $A, Ee), ht.length > 0 && oi(ht, $A, Ee), xA.buffers.depth.setTest(!0), xA.buffers.depth.setMask(!0), xA.buffers.color.setMask(!0), xA.setPolygonOffset(!1);
20756
20756
  }
20757
20757
  function oi(gA, $A, Ee) {
@@ -20762,17 +20762,17 @@ void main() {
20762
20762
  }
20763
20763
  }
20764
20764
  function Ji(gA, $A, Ee, le, pe, At) {
20765
- gA.onBeforeRender(G, $A, Ee, le, pe, At), gA.modelViewMatrix.multiplyMatrices(Ee.matrixWorldInverse, gA.matrixWorld), gA.normalMatrix.getNormalMatrix(gA.modelViewMatrix), pe.onBeforeRender(G, $A, Ee, le, gA, At), pe.transparent === !0 && pe.side === 2 && pe.forceSinglePass === !1 ? (pe.side = y, pe.needsUpdate = !0, G.renderBufferDirect(Ee, $A, le, pe, gA, At), pe.side = p, pe.needsUpdate = !0, G.renderBufferDirect(Ee, $A, le, pe, gA, At), pe.side = 2) : G.renderBufferDirect(Ee, $A, le, pe, gA, At), gA.onAfterRender(G, $A, Ee, le, pe, At);
20765
+ gA.onBeforeRender(N, $A, Ee, le, pe, At), gA.modelViewMatrix.multiplyMatrices(Ee.matrixWorldInverse, gA.matrixWorld), gA.normalMatrix.getNormalMatrix(gA.modelViewMatrix), pe.onBeforeRender(N, $A, Ee, le, gA, At), pe.transparent === !0 && pe.side === 2 && pe.forceSinglePass === !1 ? (pe.side = y, pe.needsUpdate = !0, N.renderBufferDirect(Ee, $A, le, pe, gA, At), pe.side = p, pe.needsUpdate = !0, N.renderBufferDirect(Ee, $A, le, pe, gA, At), pe.side = 2) : N.renderBufferDirect(Ee, $A, le, pe, gA, At), gA.onAfterRender(N, $A, Ee, le, pe, At);
20766
20766
  }
20767
20767
  function Mi(gA, $A, Ee) {
20768
20768
  $A.isScene !== !0 && ($A = oA);
20769
- const le = kA.get(gA), pe = F.state.lights, At = F.state.shadowsArray, ht = pe.state.version, Mt = He.getParameters(gA, pe.state, At, $A, Ee), Gt = He.getProgramCacheKey(Mt);
20769
+ const le = kA.get(gA), pe = L.state.lights, At = L.state.shadowsArray, ht = pe.state.version, Mt = He.getParameters(gA, pe.state, At, $A, Ee), Gt = He.getProgramCacheKey(Mt);
20770
20770
  let ot = le.programs;
20771
20771
  le.environment = gA.isMeshStandardMaterial ? $A.environment : null, le.fog = $A.fog, le.envMap = (gA.isMeshStandardMaterial ? ce : TA).get(gA.envMap || le.environment), ot === void 0 && (gA.addEventListener("dispose", rt), ot = /* @__PURE__ */ new Map(), le.programs = ot);
20772
20772
  let bt = ot.get(Gt);
20773
20773
  if (bt !== void 0) {
20774
20774
  if (le.currentProgram === bt && le.lightsStateVersion === ht) return pi(gA, Mt), bt;
20775
- } else Mt.uniforms = He.getUniforms(gA), gA.onBuild(Ee, Mt, G), gA.onBeforeCompile(Mt, G), bt = He.acquireProgram(Mt, Gt), ot.set(Gt, bt), le.uniforms = Mt.uniforms;
20775
+ } else Mt.uniforms = He.getUniforms(gA), gA.onBuild(Ee, Mt, N), gA.onBeforeCompile(Mt, N), bt = He.acquireProgram(Mt, Gt), ot.set(Gt, bt), le.uniforms = Mt.uniforms;
20776
20776
  const Rt = le.uniforms;
20777
20777
  (gA.isShaderMaterial || gA.isRawShaderMaterial) && gA.clipping !== !0 || (Rt.clippingPlanes = J.uniform), pi(gA, Mt), le.needsLights = (function(Bt) {
20778
20778
  return Bt.isMeshLambertMaterial || Bt.isMeshToonMaterial || Bt.isMeshPhongMaterial || Bt.isMeshStandardMaterial || Bt.isShadowMaterial || Bt.isShaderMaterial && Bt.lights === !0;
@@ -20789,19 +20789,19 @@ void main() {
20789
20789
  })), typeof self < "u" && Yt.setContext(self), this.setAnimationLoop = function(gA) {
20790
20790
  at = gA, Le.setAnimationLoop(gA), gA === null ? Yt.stop() : Yt.start();
20791
20791
  }, Le.addEventListener("sessionstart", mt), Le.addEventListener("sessionend", Ci), this.render = function(gA, $A) {
20792
- if ($A !== void 0 && $A.isCamera !== !0 || _ === !0) return;
20793
- gA.matrixWorldAutoUpdate === !0 && gA.updateMatrixWorld(), $A.parent === null && $A.matrixWorldAutoUpdate === !0 && $A.updateMatrixWorld(), Le.enabled === !0 && Le.isPresenting === !0 && (Le.cameraAutoUpdate === !0 && Le.updateCamera($A), $A = Le.getCamera()), gA.isScene === !0 && gA.onBeforeRender(G, gA, $A, tA), F = It.get(gA, R.length), F.init(), R.push(F), ge.multiplyMatrices($A.projectionMatrix, $A.matrixWorldInverse), Fe.setFromProjectionMatrix(ge), de = this.localClippingEnabled, YA = J.init(this.clippingPlanes, de), M = Ct.get(gA, N.length), M.init(), N.push(M), lt(gA, $A, 0, G.sortObjects), M.finish(), G.sortObjects === !0 && M.sort(Qe, Ve), YA === !0 && J.beginShadows();
20794
- const Ee = F.state.shadowsArray;
20795
- if ($.render(Ee, gA, $A), YA === !0 && J.endShadows(), this.info.autoReset === !0 && this.info.reset(), MA.render(M, gA), F.setupLights(G.useLegacyLights), $A.isArrayCamera) {
20792
+ if ($A !== void 0 && $A.isCamera !== !0 || R === !0) return;
20793
+ gA.matrixWorldAutoUpdate === !0 && gA.updateMatrixWorld(), $A.parent === null && $A.matrixWorldAutoUpdate === !0 && $A.updateMatrixWorld(), Le.enabled === !0 && Le.isPresenting === !0 && (Le.cameraAutoUpdate === !0 && Le.updateCamera($A), $A = Le.getCamera()), gA.isScene === !0 && gA.onBeforeRender(N, gA, $A, tA), L = It.get(gA, _.length), L.init(), _.push(L), ge.multiplyMatrices($A.projectionMatrix, $A.matrixWorldInverse), Fe.setFromProjectionMatrix(ge), de = this.localClippingEnabled, YA = J.init(this.clippingPlanes, de), M = Ct.get(gA, G.length), M.init(), G.push(M), lt(gA, $A, 0, N.sortObjects), M.finish(), N.sortObjects === !0 && M.sort(Qe, Ve), YA === !0 && J.beginShadows();
20794
+ const Ee = L.state.shadowsArray;
20795
+ if ($.render(Ee, gA, $A), YA === !0 && J.endShadows(), this.info.autoReset === !0 && this.info.reset(), MA.render(M, gA), L.setupLights(N.useLegacyLights), $A.isArrayCamera) {
20796
20796
  const le = $A.cameras;
20797
20797
  for (let pe = 0, At = le.length; pe < At; pe++) {
20798
20798
  const ht = le[pe];
20799
20799
  Ft(M, gA, ht, ht.viewport);
20800
20800
  }
20801
20801
  } else Ft(M, gA, $A);
20802
- tA !== null && (sA.updateMultisampleRenderTarget(tA), sA.updateRenderTargetMipmap(tA)), gA.isScene === !0 && gA.onAfterRender(G, gA, $A), Ye.resetDefaultState(), eA = -1, QA = null, R.pop(), F = R.length > 0 ? R[R.length - 1] : null, N.pop(), M = N.length > 0 ? N[N.length - 1] : null;
20802
+ tA !== null && (sA.updateMultisampleRenderTarget(tA), sA.updateRenderTargetMipmap(tA)), gA.isScene === !0 && gA.onAfterRender(N, gA, $A), Ye.resetDefaultState(), eA = -1, QA = null, _.pop(), L = _.length > 0 ? _[_.length - 1] : null, G.pop(), M = G.length > 0 ? G[G.length - 1] : null;
20803
20803
  }, this.getActiveCubeFace = function() {
20804
- return L;
20804
+ return F;
20805
20805
  }, this.getActiveMipmapLevel = function() {
20806
20806
  return rA;
20807
20807
  }, this.getRenderTarget = function() {
@@ -20814,7 +20814,7 @@ void main() {
20814
20814
  const Ee = kA.get(gA);
20815
20815
  Ee.__webglFramebuffer = $A, Ee.__useDefaultFramebuffer = $A === void 0;
20816
20816
  }, this.setRenderTarget = function(gA, $A = 0, Ee = 0) {
20817
- tA = gA, L = $A, rA = Ee;
20817
+ tA = gA, F = $A, rA = Ee;
20818
20818
  let le = !0, pe = null, At = !1, ht = !1;
20819
20819
  if (gA) {
20820
20820
  const Mt = kA.get(gA);
@@ -20855,7 +20855,7 @@ void main() {
20855
20855
  const pe = $A.image.width, At = $A.image.height, ht = OA.convert(Ee.format), Mt = OA.convert(Ee.type);
20856
20856
  sA.setTexture2D(Ee, 0), yA.pixelStorei(yA.UNPACK_FLIP_Y_WEBGL, Ee.flipY), yA.pixelStorei(yA.UNPACK_PREMULTIPLY_ALPHA_WEBGL, Ee.premultiplyAlpha), yA.pixelStorei(yA.UNPACK_ALIGNMENT, Ee.unpackAlignment), $A.isDataTexture ? yA.texSubImage2D(yA.TEXTURE_2D, le, gA.x, gA.y, pe, At, ht, Mt, $A.image.data) : $A.isCompressedTexture ? yA.compressedTexSubImage2D(yA.TEXTURE_2D, le, gA.x, gA.y, $A.mipmaps[0].width, $A.mipmaps[0].height, ht, $A.mipmaps[0].data) : yA.texSubImage2D(yA.TEXTURE_2D, le, gA.x, gA.y, ht, Mt, $A.image), le === 0 && Ee.generateMipmaps && yA.generateMipmap(yA.TEXTURE_2D), xA.unbindTexture();
20857
20857
  }, this.copyTextureToTexture3D = function(gA, $A, Ee, le, pe = 0) {
20858
- if (G.isWebGL1Renderer) return;
20858
+ if (N.isWebGL1Renderer) return;
20859
20859
  const At = gA.max.x - gA.min.x + 1, ht = gA.max.y - gA.min.y + 1, Mt = gA.max.z - gA.min.z + 1, Gt = OA.convert(le.format), ot = OA.convert(le.type);
20860
20860
  let bt;
20861
20861
  if (le.isData3DTexture) sA.setTexture3D(le, 0), bt = yA.TEXTURE_3D;
@@ -20869,7 +20869,7 @@ void main() {
20869
20869
  }, this.initTexture = function(gA) {
20870
20870
  gA.isCubeTexture ? sA.setTextureCube(gA, 0) : gA.isData3DTexture ? sA.setTexture3D(gA, 0) : gA.isDataArrayTexture || gA.isCompressedArrayTexture ? sA.setTexture2DArray(gA, 0) : sA.setTexture2D(gA, 0), xA.unbindTexture();
20871
20871
  }, this.resetState = function() {
20872
- L = 0, rA = 0, tA = null, xA.reset(), Ye.reset();
20872
+ F = 0, rA = 0, tA = null, xA.reset(), Ye.reset();
20873
20873
  }, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this }));
20874
20874
  }
20875
20875
  get physicallyCorrectLights() {
@@ -21299,21 +21299,21 @@ void main() {
21299
21299
  const i = this.geometry, n = this.matrixWorld, a = A.params.Line.threshold, g = i.drawRange;
21300
21300
  if (i.boundingSphere === null && i.computeBoundingSphere(), kg.copy(i.boundingSphere), kg.applyMatrix4(n), kg.radius += a, A.ray.intersectsSphere(kg) === !1) return;
21301
21301
  ku.copy(n).invert(), Sc.copy(A.ray).applyMatrix4(ku);
21302
- const I = a / ((this.scale.x + this.scale.y + this.scale.z) / 3), u = I * I, c = new aA(), C = new aA(), f = new aA(), m = new aA(), M = this.isLineSegments ? 2 : 1, F = i.index, N = i.attributes.position;
21303
- if (F !== null)
21304
- for (let R = Math.max(0, g.start), G = Math.min(F.count, g.start + g.count) - 1; R < G; R += M) {
21305
- const _ = F.getX(R), L = F.getX(R + 1);
21306
- if (c.fromBufferAttribute(N, _), C.fromBufferAttribute(N, L), Sc.distanceSqToSegment(c, C, m, f) > u) continue;
21302
+ const I = a / ((this.scale.x + this.scale.y + this.scale.z) / 3), u = I * I, c = new aA(), C = new aA(), f = new aA(), m = new aA(), M = this.isLineSegments ? 2 : 1, L = i.index, G = i.attributes.position;
21303
+ if (L !== null)
21304
+ for (let _ = Math.max(0, g.start), N = Math.min(L.count, g.start + g.count) - 1; _ < N; _ += M) {
21305
+ const R = L.getX(_), F = L.getX(_ + 1);
21306
+ if (c.fromBufferAttribute(G, R), C.fromBufferAttribute(G, F), Sc.distanceSqToSegment(c, C, m, f) > u) continue;
21307
21307
  m.applyMatrix4(this.matrixWorld);
21308
21308
  const rA = A.ray.origin.distanceTo(m);
21309
- rA < A.near || rA > A.far || e.push({ distance: rA, point: f.clone().applyMatrix4(this.matrixWorld), index: R, face: null, faceIndex: null, object: this });
21309
+ rA < A.near || rA > A.far || e.push({ distance: rA, point: f.clone().applyMatrix4(this.matrixWorld), index: _, face: null, faceIndex: null, object: this });
21310
21310
  }
21311
21311
  else
21312
- for (let R = Math.max(0, g.start), G = Math.min(N.count, g.start + g.count) - 1; R < G; R += M) {
21313
- if (c.fromBufferAttribute(N, R), C.fromBufferAttribute(N, R + 1), Sc.distanceSqToSegment(c, C, m, f) > u) continue;
21312
+ for (let _ = Math.max(0, g.start), N = Math.min(G.count, g.start + g.count) - 1; _ < N; _ += M) {
21313
+ if (c.fromBufferAttribute(G, _), C.fromBufferAttribute(G, _ + 1), Sc.distanceSqToSegment(c, C, m, f) > u) continue;
21314
21314
  m.applyMatrix4(this.matrixWorld);
21315
- const _ = A.ray.origin.distanceTo(m);
21316
- _ < A.near || _ > A.far || e.push({ distance: _, point: f.clone().applyMatrix4(this.matrixWorld), index: R, face: null, faceIndex: null, object: this });
21315
+ const R = A.ray.origin.distanceTo(m);
21316
+ R < A.near || R > A.far || e.push({ distance: R, point: f.clone().applyMatrix4(this.matrixWorld), index: _, face: null, faceIndex: null, object: this });
21317
21317
  }
21318
21318
  }
21319
21319
  updateMorphTargets() {
@@ -21413,22 +21413,22 @@ void main() {
21413
21413
  super(), this.type = "SphereGeometry", this.parameters = { radius: A, widthSegments: e, heightSegments: i, phiStart: n, phiLength: a, thetaStart: g, thetaLength: I }, e = Math.max(3, Math.floor(e)), i = Math.max(2, Math.floor(i));
21414
21414
  const u = Math.min(g + I, Math.PI);
21415
21415
  let c = 0;
21416
- const C = [], f = new aA(), m = new aA(), M = [], F = [], N = [], R = [];
21417
- for (let G = 0; G <= i; G++) {
21418
- const _ = [], L = G / i;
21416
+ const C = [], f = new aA(), m = new aA(), M = [], L = [], G = [], _ = [];
21417
+ for (let N = 0; N <= i; N++) {
21418
+ const R = [], F = N / i;
21419
21419
  let rA = 0;
21420
- G === 0 && g === 0 ? rA = 0.5 / e : G === i && u === Math.PI && (rA = -0.5 / e);
21420
+ N === 0 && g === 0 ? rA = 0.5 / e : N === i && u === Math.PI && (rA = -0.5 / e);
21421
21421
  for (let tA = 0; tA <= e; tA++) {
21422
21422
  const eA = tA / e;
21423
- f.x = -A * Math.cos(n + eA * a) * Math.sin(g + L * I), f.y = A * Math.cos(g + L * I), f.z = A * Math.sin(n + eA * a) * Math.sin(g + L * I), F.push(f.x, f.y, f.z), m.copy(f).normalize(), N.push(m.x, m.y, m.z), R.push(eA + rA, 1 - L), _.push(c++);
21423
+ f.x = -A * Math.cos(n + eA * a) * Math.sin(g + F * I), f.y = A * Math.cos(g + F * I), f.z = A * Math.sin(n + eA * a) * Math.sin(g + F * I), L.push(f.x, f.y, f.z), m.copy(f).normalize(), G.push(m.x, m.y, m.z), _.push(eA + rA, 1 - F), R.push(c++);
21424
21424
  }
21425
- C.push(_);
21425
+ C.push(R);
21426
21426
  }
21427
- for (let G = 0; G < i; G++) for (let _ = 0; _ < e; _++) {
21428
- const L = C[G][_ + 1], rA = C[G][_], tA = C[G + 1][_], eA = C[G + 1][_ + 1];
21429
- (G !== 0 || g > 0) && M.push(L, rA, eA), (G !== i - 1 || u < Math.PI) && M.push(rA, tA, eA);
21427
+ for (let N = 0; N < i; N++) for (let R = 0; R < e; R++) {
21428
+ const F = C[N][R + 1], rA = C[N][R], tA = C[N + 1][R], eA = C[N + 1][R + 1];
21429
+ (N !== 0 || g > 0) && M.push(F, rA, eA), (N !== i - 1 || u < Math.PI) && M.push(rA, tA, eA);
21430
21430
  }
21431
- this.setIndex(M), this.setAttribute("position", new an(F, 3)), this.setAttribute("normal", new an(N, 3)), this.setAttribute("uv", new an(R, 2));
21431
+ this.setIndex(M), this.setAttribute("position", new an(L, 3)), this.setAttribute("normal", new an(G, 3)), this.setAttribute("uv", new an(_, 2));
21432
21432
  }
21433
21433
  copy(A) {
21434
21434
  return super.copy(A), this.parameters = Object.assign({}, A.parameters), this;
@@ -21611,8 +21611,8 @@ void main() {
21611
21611
  this._weightPrev = c / (e - I), this._weightNext = c / (u - i), this._offsetPrev = a * C, this._offsetNext = g * C;
21612
21612
  }
21613
21613
  interpolate_(A, e, i, n) {
21614
- const a = this.resultBuffer, g = this.sampleValues, I = this.valueSize, u = A * I, c = u - I, C = this._offsetPrev, f = this._offsetNext, m = this._weightPrev, M = this._weightNext, F = (i - e) / (n - e), N = F * F, R = N * F, G = -m * R + 2 * m * N - m * F, _ = (1 + m) * R + (-1.5 - 2 * m) * N + (-0.5 + m) * F + 1, L = (-1 - M) * R + (1.5 + M) * N + 0.5 * F, rA = M * R - M * N;
21615
- for (let tA = 0; tA !== I; ++tA) a[tA] = G * g[C + tA] + _ * g[c + tA] + L * g[u + tA] + rA * g[f + tA];
21614
+ const a = this.resultBuffer, g = this.sampleValues, I = this.valueSize, u = A * I, c = u - I, C = this._offsetPrev, f = this._offsetNext, m = this._weightPrev, M = this._weightNext, L = (i - e) / (n - e), G = L * L, _ = G * L, N = -m * _ + 2 * m * G - m * L, R = (1 + m) * _ + (-1.5 - 2 * m) * G + (-0.5 + m) * L + 1, F = (-1 - M) * _ + (1.5 + M) * G + 0.5 * L, rA = M * _ - M * G;
21615
+ for (let tA = 0; tA !== I; ++tA) a[tA] = N * g[C + tA] + R * g[c + tA] + F * g[u + tA] + rA * g[f + tA];
21616
21616
  return a;
21617
21617
  }
21618
21618
  }
@@ -21759,8 +21759,8 @@ void main() {
21759
21759
  else {
21760
21760
  const C = I * i, f = C - i, m = C + i;
21761
21761
  for (let M = 0; M !== i; ++M) {
21762
- const F = e[C + M];
21763
- if (F !== e[f + M] || F !== e[m + M]) {
21762
+ const L = e[C + M];
21763
+ if (L !== e[f + M] || L !== e[m + M]) {
21764
21764
  u = !0;
21765
21765
  break;
21766
21766
  }
@@ -21870,10 +21870,10 @@ void main() {
21870
21870
  }
21871
21871
  static parseAnimation(A, e) {
21872
21872
  if (!A) return null;
21873
- const i = function(C, f, m, M, F) {
21873
+ const i = function(C, f, m, M, L) {
21874
21874
  if (m.length !== 0) {
21875
- const N = [], R = [];
21876
- Ou(m, N, R, M), N.length !== 0 && F.push(new C(f, N, R));
21875
+ const G = [], _ = [];
21876
+ Ou(m, G, _, M), G.length !== 0 && L.push(new C(f, G, _));
21877
21877
  }
21878
21878
  }, n = [], a = A.name || "default", g = A.fps || 30, I = A.blendMode;
21879
21879
  let u = A.length || -1;
@@ -21883,14 +21883,14 @@ void main() {
21883
21883
  if (f && f.length !== 0) if (f[0].morphTargets) {
21884
21884
  const m = {};
21885
21885
  let M;
21886
- for (M = 0; M < f.length; M++) if (f[M].morphTargets) for (let F = 0; F < f[M].morphTargets.length; F++) m[f[M].morphTargets[F]] = -1;
21887
- for (const F in m) {
21888
- const N = [], R = [];
21889
- for (let G = 0; G !== f[M].morphTargets.length; ++G) {
21890
- const _ = f[M];
21891
- N.push(_.time), R.push(_.morphTarget === F ? 1 : 0);
21886
+ for (M = 0; M < f.length; M++) if (f[M].morphTargets) for (let L = 0; L < f[M].morphTargets.length; L++) m[f[M].morphTargets[L]] = -1;
21887
+ for (const L in m) {
21888
+ const G = [], _ = [];
21889
+ for (let N = 0; N !== f[M].morphTargets.length; ++N) {
21890
+ const R = f[M];
21891
+ G.push(R.time), _.push(R.morphTarget === L ? 1 : 0);
21892
21892
  }
21893
- n.push(new eo(".morphTargetInfluence[" + F + "]", N, R));
21893
+ n.push(new eo(".morphTargetInfluence[" + L + "]", G, _));
21894
21894
  }
21895
21895
  u = m.length * g;
21896
21896
  } else {
@@ -21994,8 +21994,8 @@ void main() {
21994
21994
  return f !== -1 && c.splice(f, 2), this;
21995
21995
  }, this.getHandler = function(C) {
21996
21996
  for (let f = 0, m = c.length; f < m; f += 2) {
21997
- const M = c[f], F = c[f + 1];
21998
- if (M.global && (M.lastIndex = 0), M.test(C)) return F;
21997
+ const M = c[f], L = c[f + 1];
21998
+ if (M.global && (M.lastIndex = 0), M.test(C)) return L;
21999
21999
  }
22000
22000
  return null;
22001
22001
  };
@@ -22054,25 +22054,25 @@ void main() {
22054
22054
  fetch(g).then(((c) => {
22055
22055
  if (c.status === 200 || c.status === 0) {
22056
22056
  if (c.status, typeof ReadableStream > "u" || c.body === void 0 || c.body.getReader === void 0) return c;
22057
- const C = yr[A], f = c.body.getReader(), m = c.headers.get("Content-Length") || c.headers.get("X-File-Size"), M = m ? parseInt(m) : 0, F = M !== 0;
22058
- let N = 0;
22059
- const R = new ReadableStream({ start(G) {
22060
- (function _() {
22061
- f.read().then((({ done: L, value: rA }) => {
22062
- if (L) G.close();
22057
+ const C = yr[A], f = c.body.getReader(), m = c.headers.get("Content-Length") || c.headers.get("X-File-Size"), M = m ? parseInt(m) : 0, L = M !== 0;
22058
+ let G = 0;
22059
+ const _ = new ReadableStream({ start(N) {
22060
+ (function R() {
22061
+ f.read().then((({ done: F, value: rA }) => {
22062
+ if (F) N.close();
22063
22063
  else {
22064
- N += rA.byteLength;
22065
- const tA = new ProgressEvent("progress", { lengthComputable: F, loaded: N, total: M });
22064
+ G += rA.byteLength;
22065
+ const tA = new ProgressEvent("progress", { lengthComputable: L, loaded: G, total: M });
22066
22066
  for (let eA = 0, QA = C.length; eA < QA; eA++) {
22067
22067
  const bA = C[eA];
22068
22068
  bA.onProgress && bA.onProgress(tA);
22069
22069
  }
22070
- G.enqueue(rA), _();
22070
+ N.enqueue(rA), R();
22071
22071
  }
22072
22072
  }));
22073
22073
  })();
22074
22074
  } });
22075
- return new Response(R);
22075
+ return new Response(_);
22076
22076
  }
22077
22077
  throw new Np(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`, c);
22078
22078
  })).then(((c) => {
@@ -22826,17 +22826,17 @@ void main() {
22826
22826
  C === void 0 && (C = {}, c[u] = C);
22827
22827
  for (let f = 0; f !== a; ++f) {
22828
22828
  const m = n[f], M = m.name;
22829
- let F = C[M];
22830
- if (F !== void 0) ++F.referenceCount, g[f] = F;
22829
+ let L = C[M];
22830
+ if (L !== void 0) ++L.referenceCount, g[f] = L;
22831
22831
  else {
22832
- if (F = g[f], F !== void 0) {
22833
- F._cacheIndex === null && (++F.referenceCount, this._addInactiveBinding(F, u, M));
22832
+ if (L = g[f], L !== void 0) {
22833
+ L._cacheIndex === null && (++L.referenceCount, this._addInactiveBinding(L, u, M));
22834
22834
  continue;
22835
22835
  }
22836
- const N = e && e._propertyBindings[f].binding.parsedPath;
22837
- F = new Pp(Vt.create(i, M, N), m.ValueTypeName, m.getValueSize()), ++F.referenceCount, this._addInactiveBinding(F, u, M), g[f] = F;
22836
+ const G = e && e._propertyBindings[f].binding.parsedPath;
22837
+ L = new Pp(Vt.create(i, M, G), m.ValueTypeName, m.getValueSize()), ++L.referenceCount, this._addInactiveBinding(L, u, M), g[f] = L;
22838
22838
  }
22839
- I[f].resultBuffer = F.buffer;
22839
+ I[f].resultBuffer = L.buffer;
22840
22840
  }
22841
22841
  }
22842
22842
  _activateAction(A) {
@@ -23687,10 +23687,10 @@ void main() {
23687
23687
  return g.length < 1 ? null : (g.push(this.parser.createNodeMesh(A)), Promise.all(g).then(((u) => {
23688
23688
  const c = u.pop(), C = c.isGroup ? c.children : [c], f = u[0].count, m = [];
23689
23689
  for (const M of C) {
23690
- const F = new xt(), N = new aA(), R = new Gi(), G = new aA(1, 1, 1), _ = new mp(M.geometry, M.material, f);
23691
- for (let L = 0; L < f; L++) I.TRANSLATION && N.fromBufferAttribute(I.TRANSLATION, L), I.ROTATION && R.fromBufferAttribute(I.ROTATION, L), I.SCALE && G.fromBufferAttribute(I.SCALE, L), _.setMatrixAt(L, F.compose(N, R, G));
23692
- for (const L in I) L !== "TRANSLATION" && L !== "ROTATION" && L !== "SCALE" && M.geometry.setAttribute(L, I[L]);
23693
- gi.prototype.copy.call(_, M), this.parser.assignFinalMaterial(_), m.push(_);
23690
+ const L = new xt(), G = new aA(), _ = new Gi(), N = new aA(1, 1, 1), R = new mp(M.geometry, M.material, f);
23691
+ for (let F = 0; F < f; F++) I.TRANSLATION && G.fromBufferAttribute(I.TRANSLATION, F), I.ROTATION && _.fromBufferAttribute(I.ROTATION, F), I.SCALE && N.fromBufferAttribute(I.SCALE, F), R.setMatrixAt(F, L.compose(G, _, N));
23692
+ for (const F in I) F !== "TRANSLATION" && F !== "ROTATION" && F !== "SCALE" && M.geometry.setAttribute(F, I[F]);
23693
+ gi.prototype.copy.call(R, M), this.parser.assignFinalMaterial(R), m.push(R);
23694
23694
  }
23695
23695
  return c.isGroup ? (c.clear(), c.add(...m), c) : m[0];
23696
23696
  })));
@@ -23743,8 +23743,8 @@ void main() {
23743
23743
  return new Promise((function(f) {
23744
23744
  n.decodeDracoFile(C, (function(m) {
23745
23745
  for (const M in m.attributes) {
23746
- const F = m.attributes[M], N = u[M];
23747
- N !== void 0 && (F.normalized = N);
23746
+ const L = m.attributes[M], G = u[M];
23747
+ G !== void 0 && (L.normalized = G);
23748
23748
  }
23749
23749
  f(m);
23750
23750
  }), I, c);
@@ -23775,10 +23775,10 @@ void main() {
23775
23775
  return e;
23776
23776
  }
23777
23777
  interpolate_(A, e, i, n) {
23778
- const a = this.resultBuffer, g = this.sampleValues, I = this.valueSize, u = 2 * I, c = 3 * I, C = n - e, f = (i - e) / C, m = f * f, M = m * f, F = A * c, N = F - c, R = -2 * M + 3 * m, G = M - m, _ = 1 - R, L = G - m + f;
23778
+ const a = this.resultBuffer, g = this.sampleValues, I = this.valueSize, u = 2 * I, c = 3 * I, C = n - e, f = (i - e) / C, m = f * f, M = m * f, L = A * c, G = L - c, _ = -2 * M + 3 * m, N = M - m, R = 1 - _, F = N - m + f;
23779
23779
  for (let rA = 0; rA !== I; rA++) {
23780
- const tA = g[N + rA + I], eA = g[N + rA + u] * C, QA = g[F + rA + I], bA = g[F + rA] * C;
23781
- a[rA] = _ * tA + L * eA + R * QA + G * bA;
23780
+ const tA = g[G + rA + I], eA = g[G + rA + u] * C, QA = g[L + rA + I], bA = g[L + rA] * C;
23781
+ a[rA] = R * tA + F * eA + _ * QA + N * bA;
23782
23782
  }
23783
23783
  return a;
23784
23784
  }
@@ -23999,22 +23999,22 @@ void main() {
23999
23999
  }
24000
24000
  const a = [];
24001
24001
  return n.bufferView !== void 0 ? a.push(this.getDependency("bufferView", n.bufferView)) : a.push(null), n.sparse !== void 0 && (a.push(this.getDependency("bufferView", n.sparse.indices.bufferView)), a.push(this.getDependency("bufferView", n.sparse.values.bufferView))), Promise.all(a).then((function(g) {
24002
- const I = g[0], u = Jc[n.type], c = da[n.componentType], C = c.BYTES_PER_ELEMENT, f = C * u, m = n.byteOffset || 0, M = n.bufferView !== void 0 ? i.bufferViews[n.bufferView].byteStride : void 0, F = n.normalized === !0;
24003
- let N, R;
24002
+ const I = g[0], u = Jc[n.type], c = da[n.componentType], C = c.BYTES_PER_ELEMENT, f = C * u, m = n.byteOffset || 0, M = n.bufferView !== void 0 ? i.bufferViews[n.bufferView].byteStride : void 0, L = n.normalized === !0;
24003
+ let G, _;
24004
24004
  if (M && M !== f) {
24005
- const G = Math.floor(m / M), _ = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + G + ":" + n.count;
24006
- let L = e.cache.get(_);
24007
- L || (N = new c(I, G * M, n.count * M / C), L = new Bu(N, M / C), e.cache.add(_, L)), R = new Va(L, u, m % M / C, F);
24008
- } else N = I === null ? new c(n.count * u) : new c(I, m, n.count * u), R = new Ti(N, u, F);
24005
+ const N = Math.floor(m / M), R = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + N + ":" + n.count;
24006
+ let F = e.cache.get(R);
24007
+ F || (G = new c(I, N * M, n.count * M / C), F = new Bu(G, M / C), e.cache.add(R, F)), _ = new Va(F, u, m % M / C, L);
24008
+ } else G = I === null ? new c(n.count * u) : new c(I, m, n.count * u), _ = new Ti(G, u, L);
24009
24009
  if (n.sparse !== void 0) {
24010
- const G = Jc.SCALAR, _ = da[n.sparse.indices.componentType], L = n.sparse.indices.byteOffset || 0, rA = n.sparse.values.byteOffset || 0, tA = new _(g[1], L, n.sparse.count * G), eA = new c(g[2], rA, n.sparse.count * u);
24011
- I !== null && (R = new Ti(R.array.slice(), R.itemSize, R.normalized));
24010
+ const N = Jc.SCALAR, R = da[n.sparse.indices.componentType], F = n.sparse.indices.byteOffset || 0, rA = n.sparse.values.byteOffset || 0, tA = new R(g[1], F, n.sparse.count * N), eA = new c(g[2], rA, n.sparse.count * u);
24011
+ I !== null && (_ = new Ti(_.array.slice(), _.itemSize, _.normalized));
24012
24012
  for (let QA = 0, bA = tA.length; QA < bA; QA++) {
24013
24013
  const IA = tA[QA];
24014
- if (R.setX(IA, eA[QA * u]), u >= 2 && R.setY(IA, eA[QA * u + 1]), u >= 3 && R.setZ(IA, eA[QA * u + 2]), u >= 4 && R.setW(IA, eA[QA * u + 3]), u >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
24014
+ if (_.setX(IA, eA[QA * u]), u >= 2 && _.setY(IA, eA[QA * u + 1]), u >= 3 && _.setZ(IA, eA[QA * u + 2]), u >= 4 && _.setW(IA, eA[QA * u + 3]), u >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
24015
24015
  }
24016
24016
  }
24017
- return R;
24017
+ return _;
24018
24018
  }));
24019
24019
  }
24020
24020
  loadTexture(A) {
@@ -24051,11 +24051,11 @@ void main() {
24051
24051
  else if (g.uri === void 0) throw new Error("THREE.GLTFLoader: Image " + A + " is missing URI and bufferView");
24052
24052
  const C = Promise.resolve(u).then((function(f) {
24053
24053
  return new Promise((function(m, M) {
24054
- let F = m;
24055
- e.isImageBitmapLoader === !0 && (F = function(N) {
24056
- const R = new mi(N);
24057
- R.needsUpdate = !0, m(R);
24058
- }), e.load(Lc.resolveURL(f, a.path), F, void 0, M);
24054
+ let L = m;
24055
+ e.isImageBitmapLoader === !0 && (L = function(G) {
24056
+ const _ = new mi(G);
24057
+ _.needsUpdate = !0, m(_);
24058
+ }), e.load(Lc.resolveURL(f, a.path), L, void 0, M);
24059
24059
  }));
24060
24060
  })).then((function(f) {
24061
24061
  var m;
@@ -24166,25 +24166,25 @@ void main() {
24166
24166
  var u;
24167
24167
  return I.push(e.loadGeometries(g)), Promise.all(I).then((function(c) {
24168
24168
  const C = c.slice(0, c.length - 1), f = c[c.length - 1], m = [];
24169
- for (let F = 0, N = f.length; F < N; F++) {
24170
- const R = f[F], G = g[F];
24171
- let _;
24172
- const L = C[F];
24173
- if (G.mode === kn.TRIANGLES || G.mode === kn.TRIANGLE_STRIP || G.mode === kn.TRIANGLE_FAN || G.mode === void 0) _ = a.isSkinnedMesh === !0 ? new Qp(R, L) : new Tt(R, L), _.isSkinnedMesh === !0 && _.normalizeSkinWeights(), G.mode === kn.TRIANGLE_STRIP ? _.geometry = Xu(_.geometry, 1) : G.mode === kn.TRIANGLE_FAN && (_.geometry = Xu(_.geometry, 2));
24174
- else if (G.mode === kn.LINES) _ = new wp(R, L);
24175
- else if (G.mode === kn.LINE_STRIP) _ = new xc(R, L);
24176
- else if (G.mode === kn.LINE_LOOP) _ = new yp(R, L);
24169
+ for (let L = 0, G = f.length; L < G; L++) {
24170
+ const _ = f[L], N = g[L];
24171
+ let R;
24172
+ const F = C[L];
24173
+ if (N.mode === kn.TRIANGLES || N.mode === kn.TRIANGLE_STRIP || N.mode === kn.TRIANGLE_FAN || N.mode === void 0) R = a.isSkinnedMesh === !0 ? new Qp(_, F) : new Tt(_, F), R.isSkinnedMesh === !0 && R.normalizeSkinWeights(), N.mode === kn.TRIANGLE_STRIP ? R.geometry = Xu(R.geometry, 1) : N.mode === kn.TRIANGLE_FAN && (R.geometry = Xu(R.geometry, 2));
24174
+ else if (N.mode === kn.LINES) R = new wp(_, F);
24175
+ else if (N.mode === kn.LINE_STRIP) R = new xc(_, F);
24176
+ else if (N.mode === kn.LINE_LOOP) R = new yp(_, F);
24177
24177
  else {
24178
- if (G.mode !== kn.POINTS) throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + G.mode);
24179
- _ = new Dp(R, L);
24178
+ if (N.mode !== kn.POINTS) throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + N.mode);
24179
+ R = new Dp(_, F);
24180
24180
  }
24181
- Object.keys(_.geometry.morphAttributes).length > 0 && Mm(_, a), _.name = e.createUniqueName(a.name || "mesh_" + A), As(_, a), G.extensions && no(n, _, G), e.assignFinalMaterial(_), m.push(_);
24181
+ Object.keys(R.geometry.morphAttributes).length > 0 && Mm(R, a), R.name = e.createUniqueName(a.name || "mesh_" + A), As(R, a), N.extensions && no(n, R, N), e.assignFinalMaterial(R), m.push(R);
24182
24182
  }
24183
- for (let F = 0, N = m.length; F < N; F++) e.associations.set(m[F], { meshes: A, primitives: F });
24183
+ for (let L = 0, G = m.length; L < G; L++) e.associations.set(m[L], { meshes: A, primitives: L });
24184
24184
  if (m.length === 1) return m[0];
24185
24185
  const M = new ps();
24186
24186
  e.associations.set(M, { meshes: A });
24187
- for (let F = 0, N = m.length; F < N; F++) M.add(m[F]);
24187
+ for (let L = 0, G = m.length; L < G; L++) M.add(m[L]);
24188
24188
  return M;
24189
24189
  }));
24190
24190
  }
@@ -24212,16 +24212,16 @@ void main() {
24212
24212
  loadAnimation(A) {
24213
24213
  const e = this.json.animations[A], i = e.name ? e.name : "animation_" + A, n = [], a = [], g = [], I = [], u = [];
24214
24214
  for (let c = 0, C = e.channels.length; c < C; c++) {
24215
- const f = e.channels[c], m = e.samplers[f.sampler], M = f.target, F = M.node, N = e.parameters !== void 0 ? e.parameters[m.input] : m.input, R = e.parameters !== void 0 ? e.parameters[m.output] : m.output;
24216
- M.node !== void 0 && (n.push(this.getDependency("node", F)), a.push(this.getDependency("accessor", N)), g.push(this.getDependency("accessor", R)), I.push(m), u.push(M));
24215
+ const f = e.channels[c], m = e.samplers[f.sampler], M = f.target, L = M.node, G = e.parameters !== void 0 ? e.parameters[m.input] : m.input, _ = e.parameters !== void 0 ? e.parameters[m.output] : m.output;
24216
+ M.node !== void 0 && (n.push(this.getDependency("node", L)), a.push(this.getDependency("accessor", G)), g.push(this.getDependency("accessor", _)), I.push(m), u.push(M));
24217
24217
  }
24218
24218
  return Promise.all([Promise.all(n), Promise.all(a), Promise.all(g), Promise.all(I), Promise.all(u)]).then((function(c) {
24219
- const C = c[0], f = c[1], m = c[2], M = c[3], F = c[4], N = [];
24220
- for (let R = 0, G = C.length; R < G; R++) {
24221
- const _ = C[R], L = f[R], rA = m[R], tA = M[R], eA = F[R];
24222
- if (_ === void 0) continue;
24219
+ const C = c[0], f = c[1], m = c[2], M = c[3], L = c[4], G = [];
24220
+ for (let _ = 0, N = C.length; _ < N; _++) {
24221
+ const R = C[_], F = f[_], rA = m[_], tA = M[_], eA = L[_];
24222
+ if (R === void 0) continue;
24223
24223
  let QA;
24224
- switch (_.updateMatrix(), Ba[eA.path]) {
24224
+ switch (R.updateMatrix(), Ba[eA.path]) {
24225
24225
  case Ba.weights:
24226
24226
  QA = eo;
24227
24227
  break;
@@ -24231,8 +24231,8 @@ void main() {
24231
24231
  default:
24232
24232
  QA = to;
24233
24233
  }
24234
- const bA = _.name ? _.name : _.uuid, IA = tA.interpolation !== void 0 ? wm[tA.interpolation] : PA, RA = [];
24235
- Ba[eA.path] === Ba.weights ? _.traverse((function(jA) {
24234
+ const bA = R.name ? R.name : R.uuid, IA = tA.interpolation !== void 0 ? wm[tA.interpolation] : PA, RA = [];
24235
+ Ba[eA.path] === Ba.weights ? R.traverse((function(jA) {
24236
24236
  jA.morphTargetInfluences && RA.push(jA.name ? jA.name : jA.uuid);
24237
24237
  })) : RA.push(bA);
24238
24238
  let wA = rA.array;
@@ -24242,13 +24242,13 @@ void main() {
24242
24242
  wA = Ce;
24243
24243
  }
24244
24244
  for (let jA = 0, Ce = RA.length; jA < Ce; jA++) {
24245
- const Qe = new QA(RA[jA] + "." + Ba[eA.path], L.array, wA, IA);
24245
+ const Qe = new QA(RA[jA] + "." + Ba[eA.path], F.array, wA, IA);
24246
24246
  tA.interpolation === "CUBICSPLINE" && (Qe.createInterpolant = function(Ve) {
24247
24247
  return new (this instanceof ys ? mm : AC)(this.times, this.values, this.getValueSize() / 3, Ve);
24248
- }, Qe.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0), N.push(Qe);
24248
+ }, Qe.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0), G.push(Qe);
24249
24249
  }
24250
24250
  }
24251
- return new Rc(i, void 0, N);
24251
+ return new Rc(i, void 0, G);
24252
24252
  }));
24253
24253
  }
24254
24254
  createNodeMesh(A) {
@@ -24334,26 +24334,26 @@ void main() {
24334
24334
  const c = I.attributes, C = new xi();
24335
24335
  if (c.POSITION === void 0) return;
24336
24336
  {
24337
- const M = u.json.accessors[c.POSITION], F = M.min, N = M.max;
24338
- if (F === void 0 || N === void 0) return;
24339
- if (C.set(new aA(F[0], F[1], F[2]), new aA(N[0], N[1], N[2])), M.normalized) {
24340
- const R = Oc(da[M.componentType]);
24341
- C.min.multiplyScalar(R), C.max.multiplyScalar(R);
24337
+ const M = u.json.accessors[c.POSITION], L = M.min, G = M.max;
24338
+ if (L === void 0 || G === void 0) return;
24339
+ if (C.set(new aA(L[0], L[1], L[2]), new aA(G[0], G[1], G[2])), M.normalized) {
24340
+ const _ = Oc(da[M.componentType]);
24341
+ C.min.multiplyScalar(_), C.max.multiplyScalar(_);
24342
24342
  }
24343
24343
  }
24344
24344
  const f = I.targets;
24345
24345
  if (f !== void 0) {
24346
- const M = new aA(), F = new aA();
24347
- for (let N = 0, R = f.length; N < R; N++) {
24348
- const G = f[N];
24349
- if (G.POSITION !== void 0) {
24350
- const _ = u.json.accessors[G.POSITION], L = _.min, rA = _.max;
24351
- if (L !== void 0 && rA !== void 0) {
24352
- if (F.setX(Math.max(Math.abs(L[0]), Math.abs(rA[0]))), F.setY(Math.max(Math.abs(L[1]), Math.abs(rA[1]))), F.setZ(Math.max(Math.abs(L[2]), Math.abs(rA[2]))), _.normalized) {
24353
- const tA = Oc(da[_.componentType]);
24354
- F.multiplyScalar(tA);
24346
+ const M = new aA(), L = new aA();
24347
+ for (let G = 0, _ = f.length; G < _; G++) {
24348
+ const N = f[G];
24349
+ if (N.POSITION !== void 0) {
24350
+ const R = u.json.accessors[N.POSITION], F = R.min, rA = R.max;
24351
+ if (F !== void 0 && rA !== void 0) {
24352
+ if (L.setX(Math.max(Math.abs(F[0]), Math.abs(rA[0]))), L.setY(Math.max(Math.abs(F[1]), Math.abs(rA[1]))), L.setZ(Math.max(Math.abs(F[2]), Math.abs(rA[2]))), R.normalized) {
24353
+ const tA = Oc(da[R.componentType]);
24354
+ L.multiplyScalar(tA);
24355
24355
  }
24356
- M.max(F);
24356
+ M.max(L);
24357
24357
  }
24358
24358
  }
24359
24359
  }
@@ -24365,30 +24365,30 @@ void main() {
24365
24365
  })(o, A, e), Promise.all(n).then((function() {
24366
24366
  return A.targets !== void 0 ? (function(g, I, u) {
24367
24367
  let c = !1, C = !1, f = !1;
24368
- for (let N = 0, R = I.length; N < R; N++) {
24369
- const G = I[N];
24370
- if (G.POSITION !== void 0 && (c = !0), G.NORMAL !== void 0 && (C = !0), G.COLOR_0 !== void 0 && (f = !0), c && C && f) break;
24368
+ for (let G = 0, _ = I.length; G < _; G++) {
24369
+ const N = I[G];
24370
+ if (N.POSITION !== void 0 && (c = !0), N.NORMAL !== void 0 && (C = !0), N.COLOR_0 !== void 0 && (f = !0), c && C && f) break;
24371
24371
  }
24372
24372
  if (!c && !C && !f) return Promise.resolve(g);
24373
- const m = [], M = [], F = [];
24374
- for (let N = 0, R = I.length; N < R; N++) {
24375
- const G = I[N];
24373
+ const m = [], M = [], L = [];
24374
+ for (let G = 0, _ = I.length; G < _; G++) {
24375
+ const N = I[G];
24376
24376
  if (c) {
24377
- const _ = G.POSITION !== void 0 ? u.getDependency("accessor", G.POSITION) : g.attributes.position;
24378
- m.push(_);
24377
+ const R = N.POSITION !== void 0 ? u.getDependency("accessor", N.POSITION) : g.attributes.position;
24378
+ m.push(R);
24379
24379
  }
24380
24380
  if (C) {
24381
- const _ = G.NORMAL !== void 0 ? u.getDependency("accessor", G.NORMAL) : g.attributes.normal;
24382
- M.push(_);
24381
+ const R = N.NORMAL !== void 0 ? u.getDependency("accessor", N.NORMAL) : g.attributes.normal;
24382
+ M.push(R);
24383
24383
  }
24384
24384
  if (f) {
24385
- const _ = G.COLOR_0 !== void 0 ? u.getDependency("accessor", G.COLOR_0) : g.attributes.color;
24386
- F.push(_);
24385
+ const R = N.COLOR_0 !== void 0 ? u.getDependency("accessor", N.COLOR_0) : g.attributes.color;
24386
+ L.push(R);
24387
24387
  }
24388
24388
  }
24389
- return Promise.all([Promise.all(m), Promise.all(M), Promise.all(F)]).then((function(N) {
24390
- const R = N[0], G = N[1], _ = N[2];
24391
- return c && (g.morphAttributes.position = R), C && (g.morphAttributes.normal = G), f && (g.morphAttributes.color = _), g.morphTargetsRelative = !0, g;
24389
+ return Promise.all([Promise.all(m), Promise.all(M), Promise.all(L)]).then((function(G) {
24390
+ const _ = G[0], N = G[1], R = G[2];
24391
+ return c && (g.morphAttributes.position = _), C && (g.morphAttributes.normal = N), f && (g.morphAttributes.color = R), g.morphTargetsRelative = !0, g;
24392
24392
  }));
24393
24393
  })(o, A.targets, e) : o;
24394
24394
  }));
@@ -25611,27 +25611,27 @@ vec2 getEquirectangularTexCoord() {
25611
25611
  var WA = new Fn(Math.max(2 * vA, lA));
25612
25612
  WA.set(A), A = WA;
25613
25613
  }
25614
- }, I = e.f || 0, u = e.p || 0, c = e.b || 0, C = e.l, f = e.d, m = e.m, M = e.n, F = 8 * i;
25614
+ }, I = e.f || 0, u = e.p || 0, c = e.b || 0, C = e.l, f = e.d, m = e.m, M = e.n, L = 8 * i;
25615
25615
  do {
25616
25616
  if (!C) {
25617
25617
  e.f = I = zn(o, u, 1);
25618
- var N = zn(o, u + 1, 3);
25619
- if (u += 3, !N) {
25620
- var R = o[(wA = qm(u) + 4) - 4] | o[wA - 3] << 8, G = wA + R;
25621
- if (G > i) {
25618
+ var G = zn(o, u + 1, 3);
25619
+ if (u += 3, !G) {
25620
+ var _ = o[(wA = qm(u) + 4) - 4] | o[wA - 3] << 8, N = wA + _;
25621
+ if (N > i) {
25622
25622
  if (a) throw "unexpected EOF";
25623
25623
  break;
25624
25624
  }
25625
- n && g(c + R), A.set(o.subarray(wA, G), c), e.b = c += R, e.p = u = 8 * G;
25625
+ n && g(c + _), A.set(o.subarray(wA, N), c), e.b = c += _, e.p = u = 8 * N;
25626
25626
  continue;
25627
25627
  }
25628
- if (N == 1) C = Km, f = zm, m = 9, M = 5;
25628
+ if (G == 1) C = Km, f = zm, m = 9, M = 5;
25629
25629
  else {
25630
- if (N != 2) throw "invalid block type";
25631
- var _ = zn(o, u, 31) + 257, L = zn(o, u + 10, 15) + 4, rA = _ + zn(o, u + 5, 31) + 1;
25630
+ if (G != 2) throw "invalid block type";
25631
+ var R = zn(o, u, 31) + 257, F = zn(o, u + 10, 15) + 4, rA = R + zn(o, u + 5, 31) + 1;
25632
25632
  u += 14;
25633
- for (var tA = new Fn(rA), eA = new Fn(19), QA = 0; QA < L; ++QA) eA[Ym[QA]] = zn(o, u + 3 * QA, 7);
25634
- u += 3 * L;
25633
+ for (var tA = new Fn(rA), eA = new Fn(19), QA = 0; QA < F; ++QA) eA[Ym[QA]] = zn(o, u + 3 * QA, 7);
25634
+ u += 3 * F;
25635
25635
  var bA = Wc(eA), IA = (1 << bA) - 1, RA = so(eA, bA);
25636
25636
  for (QA = 0; QA < rA; ) {
25637
25637
  var wA, jA = RA[zn(o, u, IA)];
@@ -25641,10 +25641,10 @@ vec2 getEquirectangularTexCoord() {
25641
25641
  for (wA == 16 ? (Qe = 3 + zn(o, u, 3), u += 2, Ce = tA[QA - 1]) : wA == 17 ? (Qe = 3 + zn(o, u, 7), u += 3) : wA == 18 && (Qe = 11 + zn(o, u, 127), u += 7); Qe--; ) tA[QA++] = Ce;
25642
25642
  }
25643
25643
  }
25644
- var Ve = tA.subarray(0, _), fe = tA.subarray(_);
25644
+ var Ve = tA.subarray(0, R), fe = tA.subarray(R);
25645
25645
  m = Wc(Ve), M = Wc(fe), C = so(Ve, m), f = so(fe, M);
25646
25646
  }
25647
- if (u > F) {
25647
+ if (u > L) {
25648
25648
  if (a) throw "unexpected EOF";
25649
25649
  break;
25650
25650
  }
@@ -25652,7 +25652,7 @@ vec2 getEquirectangularTexCoord() {
25652
25652
  n && g(c + 131072);
25653
25653
  for (var Me = (1 << m) - 1, _e = (1 << M) - 1, Fe = u; ; Fe = u) {
25654
25654
  var YA = (Ce = C[Zc(o, u) & Me]) >>> 4;
25655
- if ((u += 15 & Ce) > F) {
25655
+ if ((u += 15 & Ce) > L) {
25656
25656
  if (a) throw "unexpected EOF";
25657
25657
  break;
25658
25658
  }
@@ -25670,7 +25670,7 @@ vec2 getEquirectangularTexCoord() {
25670
25670
  }
25671
25671
  var ge = f[Zc(o, u) & _e], Xe = ge >>> 4;
25672
25672
  if (!ge) throw "invalid distance";
25673
- if (u += 15 & ge, fe = Pm[Xe], Xe > 3 && (be = cC[Xe], fe += Zc(o, u) & (1 << be) - 1, u += be), u > F) {
25673
+ if (u += 15 & ge, fe = Pm[Xe], Xe > 3 && (be = cC[Xe], fe += Zc(o, u) & (1 << be) - 1, u += be), u > L) {
25674
25674
  if (a) throw "unexpected EOF";
25675
25675
  break;
25676
25676
  }
@@ -25747,13 +25747,13 @@ vec2 getEquirectangularTexCoord() {
25747
25747
  return J >> 6;
25748
25748
  }
25749
25749
  const M = { c: 0, lc: 0 };
25750
- function F(J, $, MA, te) {
25750
+ function L(J, $, MA, te) {
25751
25751
  J = J << 8 | lA(MA, te), $ += 8, M.c = J, M.lc = $;
25752
25752
  }
25753
- const N = { c: 0, lc: 0 };
25754
- function R(J, $, MA, te, XA, _A, OA, Ye, We) {
25753
+ const G = { c: 0, lc: 0 };
25754
+ function _(J, $, MA, te, XA, _A, OA, Ye, We) {
25755
25755
  if (J == $) {
25756
- te < 8 && (F(MA, te, XA, _A), MA = M.c, te = M.lc);
25756
+ te < 8 && (L(MA, te, XA, _A), MA = M.c, te = M.lc);
25757
25757
  let yA = MA >> (te -= 8);
25758
25758
  if (yA = new Uint8Array([yA])[0], Ye.value + yA > We) return !1;
25759
25759
  const Ke = OA[Ye.value - 1];
@@ -25762,23 +25762,23 @@ vec2 getEquirectangularTexCoord() {
25762
25762
  if (!(Ye.value < We)) return !1;
25763
25763
  OA[Ye.value++] = J;
25764
25764
  }
25765
- N.c = MA, N.lc = te;
25765
+ G.c = MA, G.lc = te;
25766
25766
  }
25767
- function G(J) {
25767
+ function N(J) {
25768
25768
  return 65535 & J;
25769
25769
  }
25770
- function _(J) {
25771
- const $ = G(J);
25770
+ function R(J) {
25771
+ const $ = N(J);
25772
25772
  return $ > 32767 ? $ - 65536 : $;
25773
25773
  }
25774
- const L = { a: 0, b: 0 };
25774
+ const F = { a: 0, b: 0 };
25775
25775
  function rA(J, $) {
25776
- const MA = _(J), te = _($), XA = MA + (1 & te) + (te >> 1), _A = XA, OA = XA - te;
25777
- L.a = _A, L.b = OA;
25776
+ const MA = R(J), te = R($), XA = MA + (1 & te) + (te >> 1), _A = XA, OA = XA - te;
25777
+ F.a = _A, F.b = OA;
25778
25778
  }
25779
25779
  function tA(J, $) {
25780
- const MA = G(J), te = G($), XA = MA - (te >> 1) & 65535, _A = te + XA - 32768 & 65535;
25781
- L.a = _A, L.b = XA;
25780
+ const MA = N(J), te = N($), XA = MA - (te >> 1) & 65535, _A = te + XA - 32768 & 65535;
25781
+ F.a = _A, F.b = XA;
25782
25782
  }
25783
25783
  function eA(J, $, MA, te, XA, _A, OA) {
25784
25784
  const Ye = OA < 16384, We = MA > XA ? XA : MA;
@@ -25793,11 +25793,11 @@ vec2 getEquirectangularTexCoord() {
25793
25793
  const Ft = Ke + te * (MA - yA);
25794
25794
  for (; lt <= Ft; lt += rt) {
25795
25795
  const oi = lt + Oe, Ji = lt + et, Mi = Ji + Oe;
25796
- Ye ? (rA(J[lt + $], J[Ji + $]), at = L.a, Ci = L.b, rA(J[oi + $], J[Mi + $]), mt = L.a, Yt = L.b, rA(at, mt), J[lt + $] = L.a, J[oi + $] = L.b, rA(Ci, Yt), J[Ji + $] = L.a, J[Mi + $] = L.b) : (tA(J[lt + $], J[Ji + $]), at = L.a, Ci = L.b, tA(J[oi + $], J[Mi + $]), mt = L.a, Yt = L.b, tA(at, mt), J[lt + $] = L.a, J[oi + $] = L.b, tA(Ci, Yt), J[Ji + $] = L.a, J[Mi + $] = L.b);
25796
+ Ye ? (rA(J[lt + $], J[Ji + $]), at = F.a, Ci = F.b, rA(J[oi + $], J[Mi + $]), mt = F.a, Yt = F.b, rA(at, mt), J[lt + $] = F.a, J[oi + $] = F.b, rA(Ci, Yt), J[Ji + $] = F.a, J[Mi + $] = F.b) : (tA(J[lt + $], J[Ji + $]), at = F.a, Ci = F.b, tA(J[oi + $], J[Mi + $]), mt = F.a, Yt = F.b, tA(at, mt), J[lt + $] = F.a, J[oi + $] = F.b, tA(Ci, Yt), J[Ji + $] = F.a, J[Mi + $] = F.b);
25797
25797
  }
25798
25798
  if (MA & ze) {
25799
25799
  const oi = lt + et;
25800
- Ye ? rA(J[lt + $], J[oi + $]) : tA(J[lt + $], J[oi + $]), at = L.a, J[oi + $] = L.b, J[lt + $] = at;
25800
+ Ye ? rA(J[lt + $], J[oi + $]) : tA(J[lt + $], J[oi + $]), at = F.a, J[oi + $] = F.b, J[lt + $] = at;
25801
25801
  }
25802
25802
  }
25803
25803
  if (XA & ze) {
@@ -25805,7 +25805,7 @@ vec2 getEquirectangularTexCoord() {
25805
25805
  const Ft = Ke + te * (MA - yA);
25806
25806
  for (; lt <= Ft; lt += rt) {
25807
25807
  const oi = lt + Oe;
25808
- Ye ? rA(J[lt + $], J[oi + $]) : tA(J[lt + $], J[oi + $]), at = L.a, J[oi + $] = L.b, J[lt + $] = at;
25808
+ Ye ? rA(J[lt + $], J[oi + $]) : tA(J[lt + $], J[oi + $]), at = F.a, J[oi + $] = F.b, J[lt + $] = at;
25809
25809
  }
25810
25810
  }
25811
25811
  yA = ze, ze >>= 1;
@@ -25846,17 +25846,17 @@ vec2 getEquirectangularTexCoord() {
25846
25846
  })(Ke, Ye, We, ze), (function(Le, et, dt, Oe, rt, at, mt, Ci, Yt) {
25847
25847
  let lt = 0, Ft = 0;
25848
25848
  const oi = mt, Ji = Math.trunc(Oe.value + (rt + 7) / 8);
25849
- for (; Oe.value < Ji; ) for (F(lt, Ft, dt, Oe), lt = M.c, Ft = M.lc; Ft >= 14; ) {
25849
+ for (; Oe.value < Ji; ) for (L(lt, Ft, dt, Oe), lt = M.c, Ft = M.lc; Ft >= 14; ) {
25850
25850
  const pi = et[lt >> Ft - 14 & 16383];
25851
- if (pi.len) Ft -= pi.len, R(pi.lit, at, lt, Ft, dt, Oe, Ci, Yt, oi), lt = N.c, Ft = N.lc;
25851
+ if (pi.len) Ft -= pi.len, _(pi.lit, at, lt, Ft, dt, Oe, Ci, Yt, oi), lt = G.c, Ft = G.lc;
25852
25852
  else {
25853
25853
  if (!pi.p) throw new Error("hufDecode issues");
25854
25854
  let gA;
25855
25855
  for (gA = 0; gA < pi.lit; gA++) {
25856
25856
  const $A = f(Le[pi.p[gA]]);
25857
- for (; Ft < $A && Oe.value < Ji; ) F(lt, Ft, dt, Oe), lt = M.c, Ft = M.lc;
25857
+ for (; Ft < $A && Oe.value < Ji; ) L(lt, Ft, dt, Oe), lt = M.c, Ft = M.lc;
25858
25858
  if (Ft >= $A && m(Le[pi.p[gA]]) == (lt >> Ft - $A & (1 << $A) - 1)) {
25859
- Ft -= $A, R(pi.p[gA], at, lt, Ft, dt, Oe, Ci, Yt, oi), lt = N.c, Ft = N.lc;
25859
+ Ft -= $A, _(pi.p[gA], at, lt, Ft, dt, Oe, Ci, Yt, oi), lt = G.c, Ft = G.lc;
25860
25860
  break;
25861
25861
  }
25862
25862
  }
@@ -25867,7 +25867,7 @@ vec2 getEquirectangularTexCoord() {
25867
25867
  for (lt >>= Mi, Ft -= Mi; Ft > 0; ) {
25868
25868
  const pi = et[lt << 14 - Ft & 16383];
25869
25869
  if (!pi.len) throw new Error("hufDecode issues");
25870
- Ft -= pi.len, R(pi.lit, at, lt, Ft, dt, Oe, Ci, Yt, oi), lt = N.c, Ft = N.lc;
25870
+ Ft -= pi.len, _(pi.lit, at, lt, Ft, dt, Oe, Ci, Yt, oi), lt = G.c, Ft = G.lc;
25871
25871
  }
25872
25872
  })(Ke, ze, J, MA, yA, We, _A, XA, { value: 0 });
25873
25873
  }
@@ -26386,72 +26386,72 @@ vec2 getEquirectangularTexCoord() {
26386
26386
  };
26387
26387
  const Og = 16209;
26388
26388
  var l0 = function(o, A) {
26389
- let e, i, n, a, g, I, u, c, C, f, m, M, F, N, R, G, _, L, rA, tA, eA, QA, bA, IA;
26389
+ let e, i, n, a, g, I, u, c, C, f, m, M, L, G, _, N, R, F, rA, tA, eA, QA, bA, IA;
26390
26390
  const RA = o.state;
26391
- e = o.next_in, bA = o.input, i = e + (o.avail_in - 5), n = o.next_out, IA = o.output, a = n - (A - o.avail_out), g = n + (o.avail_out - 257), I = RA.dmax, u = RA.wsize, c = RA.whave, C = RA.wnext, f = RA.window, m = RA.hold, M = RA.bits, F = RA.lencode, N = RA.distcode, R = (1 << RA.lenbits) - 1, G = (1 << RA.distbits) - 1;
26391
+ e = o.next_in, bA = o.input, i = e + (o.avail_in - 5), n = o.next_out, IA = o.output, a = n - (A - o.avail_out), g = n + (o.avail_out - 257), I = RA.dmax, u = RA.wsize, c = RA.whave, C = RA.wnext, f = RA.window, m = RA.hold, M = RA.bits, L = RA.lencode, G = RA.distcode, _ = (1 << RA.lenbits) - 1, N = (1 << RA.distbits) - 1;
26392
26392
  A: do {
26393
- M < 15 && (m += bA[e++] << M, M += 8, m += bA[e++] << M, M += 8), _ = F[m & R];
26393
+ M < 15 && (m += bA[e++] << M, M += 8, m += bA[e++] << M, M += 8), R = L[m & _];
26394
26394
  e: for (; ; ) {
26395
- if (L = _ >>> 24, m >>>= L, M -= L, L = _ >>> 16 & 255, L === 0) IA[n++] = 65535 & _;
26395
+ if (F = R >>> 24, m >>>= F, M -= F, F = R >>> 16 & 255, F === 0) IA[n++] = 65535 & R;
26396
26396
  else {
26397
- if (!(16 & L)) {
26398
- if ((64 & L) == 0) {
26399
- _ = F[(65535 & _) + (m & (1 << L) - 1)];
26397
+ if (!(16 & F)) {
26398
+ if ((64 & F) == 0) {
26399
+ R = L[(65535 & R) + (m & (1 << F) - 1)];
26400
26400
  continue e;
26401
26401
  }
26402
- if (32 & L) {
26402
+ if (32 & F) {
26403
26403
  RA.mode = 16191;
26404
26404
  break A;
26405
26405
  }
26406
26406
  o.msg = "invalid literal/length code", RA.mode = Og;
26407
26407
  break A;
26408
26408
  }
26409
- rA = 65535 & _, L &= 15, L && (M < L && (m += bA[e++] << M, M += 8), rA += m & (1 << L) - 1, m >>>= L, M -= L), M < 15 && (m += bA[e++] << M, M += 8, m += bA[e++] << M, M += 8), _ = N[m & G];
26409
+ rA = 65535 & R, F &= 15, F && (M < F && (m += bA[e++] << M, M += 8), rA += m & (1 << F) - 1, m >>>= F, M -= F), M < 15 && (m += bA[e++] << M, M += 8, m += bA[e++] << M, M += 8), R = G[m & N];
26410
26410
  t: for (; ; ) {
26411
- if (L = _ >>> 24, m >>>= L, M -= L, L = _ >>> 16 & 255, !(16 & L)) {
26412
- if ((64 & L) == 0) {
26413
- _ = N[(65535 & _) + (m & (1 << L) - 1)];
26411
+ if (F = R >>> 24, m >>>= F, M -= F, F = R >>> 16 & 255, !(16 & F)) {
26412
+ if ((64 & F) == 0) {
26413
+ R = G[(65535 & R) + (m & (1 << F) - 1)];
26414
26414
  continue t;
26415
26415
  }
26416
26416
  o.msg = "invalid distance code", RA.mode = Og;
26417
26417
  break A;
26418
26418
  }
26419
- if (tA = 65535 & _, L &= 15, M < L && (m += bA[e++] << M, M += 8, M < L && (m += bA[e++] << M, M += 8)), tA += m & (1 << L) - 1, tA > I) {
26419
+ if (tA = 65535 & R, F &= 15, M < F && (m += bA[e++] << M, M += 8, M < F && (m += bA[e++] << M, M += 8)), tA += m & (1 << F) - 1, tA > I) {
26420
26420
  o.msg = "invalid distance too far back", RA.mode = Og;
26421
26421
  break A;
26422
26422
  }
26423
- if (m >>>= L, M -= L, L = n - a, tA > L) {
26424
- if (L = tA - L, L > c && RA.sane) {
26423
+ if (m >>>= F, M -= F, F = n - a, tA > F) {
26424
+ if (F = tA - F, F > c && RA.sane) {
26425
26425
  o.msg = "invalid distance too far back", RA.mode = Og;
26426
26426
  break A;
26427
26427
  }
26428
26428
  if (eA = 0, QA = f, C === 0) {
26429
- if (eA += u - L, L < rA) {
26430
- rA -= L;
26429
+ if (eA += u - F, F < rA) {
26430
+ rA -= F;
26431
26431
  do
26432
26432
  IA[n++] = f[eA++];
26433
- while (--L);
26433
+ while (--F);
26434
26434
  eA = n - tA, QA = IA;
26435
26435
  }
26436
- } else if (C < L) {
26437
- if (eA += u + C - L, L -= C, L < rA) {
26438
- rA -= L;
26436
+ } else if (C < F) {
26437
+ if (eA += u + C - F, F -= C, F < rA) {
26438
+ rA -= F;
26439
26439
  do
26440
26440
  IA[n++] = f[eA++];
26441
- while (--L);
26441
+ while (--F);
26442
26442
  if (eA = 0, C < rA) {
26443
- L = C, rA -= L;
26443
+ F = C, rA -= F;
26444
26444
  do
26445
26445
  IA[n++] = f[eA++];
26446
- while (--L);
26446
+ while (--F);
26447
26447
  eA = n - tA, QA = IA;
26448
26448
  }
26449
26449
  }
26450
- } else if (eA += C - L, L < rA) {
26451
- rA -= L;
26450
+ } else if (eA += C - F, F < rA) {
26451
+ rA -= F;
26452
26452
  do
26453
26453
  IA[n++] = f[eA++];
26454
- while (--L);
26454
+ while (--F);
26455
26455
  eA = n - tA, QA = IA;
26456
26456
  }
26457
26457
  for (; rA > 2; ) IA[n++] = QA[eA++], IA[n++] = QA[eA++], IA[n++] = QA[eA++], rA -= 3;
@@ -26474,36 +26474,36 @@ vec2 getEquirectangularTexCoord() {
26474
26474
  const Pg = 15, c0 = new Uint16Array([3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0]), I0 = new Uint8Array([16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78]), h0 = new Uint16Array([1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0]), u0 = new Uint8Array([16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64]);
26475
26475
  var go = (o, A, e, i, n, a, g, I) => {
26476
26476
  const u = I.bits;
26477
- let c, C, f, m, M, F, N = 0, R = 0, G = 0, _ = 0, L = 0, rA = 0, tA = 0, eA = 0, QA = 0, bA = 0, IA = null;
26477
+ let c, C, f, m, M, L, G = 0, _ = 0, N = 0, R = 0, F = 0, rA = 0, tA = 0, eA = 0, QA = 0, bA = 0, IA = null;
26478
26478
  const RA = new Uint16Array(16), wA = new Uint16Array(16);
26479
26479
  let jA, Ce, Qe, Ve = null;
26480
- for (N = 0; N <= Pg; N++) RA[N] = 0;
26481
- for (R = 0; R < i; R++) RA[A[e + R]]++;
26482
- for (L = u, _ = Pg; _ >= 1 && RA[_] === 0; _--) ;
26483
- if (L > _ && (L = _), _ === 0) return n[a++] = 20971520, n[a++] = 20971520, I.bits = 1, 0;
26484
- for (G = 1; G < _ && RA[G] === 0; G++) ;
26485
- for (L < G && (L = G), eA = 1, N = 1; N <= Pg; N++) if (eA <<= 1, eA -= RA[N], eA < 0) return -1;
26486
- if (eA > 0 && (o === 0 || _ !== 1)) return -1;
26487
- for (wA[1] = 0, N = 1; N < Pg; N++) wA[N + 1] = wA[N] + RA[N];
26488
- for (R = 0; R < i; R++) A[e + R] !== 0 && (g[wA[A[e + R]]++] = R);
26489
- if (o === 0 ? (IA = Ve = g, F = 20) : o === 1 ? (IA = c0, Ve = I0, F = 257) : (IA = h0, Ve = u0, F = 0), bA = 0, R = 0, N = G, M = a, rA = L, tA = 0, f = -1, QA = 1 << L, m = QA - 1, o === 1 && QA > 852 || o === 2 && QA > 592) return 1;
26480
+ for (G = 0; G <= Pg; G++) RA[G] = 0;
26481
+ for (_ = 0; _ < i; _++) RA[A[e + _]]++;
26482
+ for (F = u, R = Pg; R >= 1 && RA[R] === 0; R--) ;
26483
+ if (F > R && (F = R), R === 0) return n[a++] = 20971520, n[a++] = 20971520, I.bits = 1, 0;
26484
+ for (N = 1; N < R && RA[N] === 0; N++) ;
26485
+ for (F < N && (F = N), eA = 1, G = 1; G <= Pg; G++) if (eA <<= 1, eA -= RA[G], eA < 0) return -1;
26486
+ if (eA > 0 && (o === 0 || R !== 1)) return -1;
26487
+ for (wA[1] = 0, G = 1; G < Pg; G++) wA[G + 1] = wA[G] + RA[G];
26488
+ for (_ = 0; _ < i; _++) A[e + _] !== 0 && (g[wA[A[e + _]]++] = _);
26489
+ if (o === 0 ? (IA = Ve = g, L = 20) : o === 1 ? (IA = c0, Ve = I0, L = 257) : (IA = h0, Ve = u0, L = 0), bA = 0, _ = 0, G = N, M = a, rA = F, tA = 0, f = -1, QA = 1 << F, m = QA - 1, o === 1 && QA > 852 || o === 2 && QA > 592) return 1;
26490
26490
  for (; ; ) {
26491
- jA = N - tA, g[R] + 1 < F ? (Ce = 0, Qe = g[R]) : g[R] >= F ? (Ce = Ve[g[R] - F], Qe = IA[g[R] - F]) : (Ce = 96, Qe = 0), c = 1 << N - tA, C = 1 << rA, G = C;
26491
+ jA = G - tA, g[_] + 1 < L ? (Ce = 0, Qe = g[_]) : g[_] >= L ? (Ce = Ve[g[_] - L], Qe = IA[g[_] - L]) : (Ce = 96, Qe = 0), c = 1 << G - tA, C = 1 << rA, N = C;
26492
26492
  do
26493
26493
  C -= c, n[M + (bA >> tA) + C] = jA << 24 | Ce << 16 | Qe | 0;
26494
26494
  while (C !== 0);
26495
- for (c = 1 << N - 1; bA & c; ) c >>= 1;
26496
- if (c !== 0 ? (bA &= c - 1, bA += c) : bA = 0, R++, --RA[N] == 0) {
26497
- if (N === _) break;
26498
- N = A[e + g[R]];
26495
+ for (c = 1 << G - 1; bA & c; ) c >>= 1;
26496
+ if (c !== 0 ? (bA &= c - 1, bA += c) : bA = 0, _++, --RA[G] == 0) {
26497
+ if (G === R) break;
26498
+ G = A[e + g[_]];
26499
26499
  }
26500
- if (N > L && (bA & m) !== f) {
26501
- for (tA === 0 && (tA = L), M += G, rA = N - tA, eA = 1 << rA; rA + tA < _ && (eA -= RA[rA + tA], !(eA <= 0)); ) rA++, eA <<= 1;
26500
+ if (G > F && (bA & m) !== f) {
26501
+ for (tA === 0 && (tA = F), M += N, rA = G - tA, eA = 1 << rA; rA + tA < R && (eA -= RA[rA + tA], !(eA <= 0)); ) rA++, eA <<= 1;
26502
26502
  if (QA += 1 << rA, o === 1 && QA > 852 || o === 2 && QA > 592) return 1;
26503
- f = bA & m, n[f] = L << 24 | rA << 16 | M - a | 0;
26503
+ f = bA & m, n[f] = F << 24 | rA << 16 | M - a | 0;
26504
26504
  }
26505
26505
  }
26506
- return bA !== 0 && (n[M + bA] = N - tA << 24 | 64 << 16 | 0), I.bits = L, 0;
26506
+ return bA !== 0 && (n[M + bA] = G - tA << 24 | 64 << 16 | 0), I.bits = F, 0;
26507
26507
  };
26508
26508
  const { Z_FINISH: pC, Z_BLOCK: C0, Z_TREES: Kg, Z_OK: Ms, Z_STREAM_END: d0, Z_NEED_DICT: B0, Z_STREAM_ERROR: Ln, Z_DATA_ERROR: mC, Z_MEM_ERROR: wC, Z_BUF_ERROR: E0, Z_DEFLATED: yC } = EC, zg = 16180, qg = 16190, Dr = 16191, AI = 16192, eI = 16194, Vg = 16199, Wg = 16200, tI = 16206, li = 16209, DC = (o) => (o >>> 24 & 255) + (o >>> 8 & 65280) + ((65280 & o) << 8) + ((255 & o) << 24);
26509
26509
  function Q0() {
@@ -26552,7 +26552,7 @@ vec2 getEquirectangularTexCoord() {
26552
26552
  return a.window === null && (a.wsize = 1 << a.wbits, a.wnext = 0, a.whave = 0, a.window = new Uint8Array(a.wsize)), i >= a.wsize ? (a.window.set(A.subarray(e - a.wsize, e), 0), a.wnext = 0, a.whave = a.wsize) : (n = a.wsize - a.wnext, n > i && (n = i), a.window.set(A.subarray(e - i, e - i + n), a.wnext), (i -= n) ? (a.window.set(A.subarray(e - i, e), 0), a.wnext = i, a.whave = a.wsize) : (a.wnext += n, a.wnext === a.wsize && (a.wnext = 0), a.whave < a.wsize && (a.whave += n))), 0;
26553
26553
  };
26554
26554
  var p0 = (o, A) => {
26555
- let e, i, n, a, g, I, u, c, C, f, m, M, F, N, R, G, _, L, rA, tA, eA, QA, bA = 0;
26555
+ let e, i, n, a, g, I, u, c, C, f, m, M, L, G, _, N, R, F, rA, tA, eA, QA, bA = 0;
26556
26556
  const IA = new Uint8Array(4);
26557
26557
  let RA, wA;
26558
26558
  const jA = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
@@ -26742,34 +26742,34 @@ vec2 getEquirectangularTexCoord() {
26742
26742
  e.have = 0, e.mode = 16198;
26743
26743
  case 16198:
26744
26744
  for (; e.have < e.nlen + e.ndist; ) {
26745
- for (; bA = e.lencode[c & (1 << e.lenbits) - 1], R = bA >>> 24, G = bA >>> 16 & 255, _ = 65535 & bA, !(R <= C); ) {
26745
+ for (; bA = e.lencode[c & (1 << e.lenbits) - 1], _ = bA >>> 24, N = bA >>> 16 & 255, R = 65535 & bA, !(_ <= C); ) {
26746
26746
  if (I === 0) break A;
26747
26747
  I--, c += i[a++] << C, C += 8;
26748
26748
  }
26749
- if (_ < 16) c >>>= R, C -= R, e.lens[e.have++] = _;
26749
+ if (R < 16) c >>>= _, C -= _, e.lens[e.have++] = R;
26750
26750
  else {
26751
- if (_ === 16) {
26752
- for (wA = R + 2; C < wA; ) {
26751
+ if (R === 16) {
26752
+ for (wA = _ + 2; C < wA; ) {
26753
26753
  if (I === 0) break A;
26754
26754
  I--, c += i[a++] << C, C += 8;
26755
26755
  }
26756
- if (c >>>= R, C -= R, e.have === 0) {
26756
+ if (c >>>= _, C -= _, e.have === 0) {
26757
26757
  o.msg = "invalid bit length repeat", e.mode = li;
26758
26758
  break;
26759
26759
  }
26760
26760
  eA = e.lens[e.have - 1], M = 3 + (3 & c), c >>>= 2, C -= 2;
26761
- } else if (_ === 17) {
26762
- for (wA = R + 3; C < wA; ) {
26761
+ } else if (R === 17) {
26762
+ for (wA = _ + 3; C < wA; ) {
26763
26763
  if (I === 0) break A;
26764
26764
  I--, c += i[a++] << C, C += 8;
26765
26765
  }
26766
- c >>>= R, C -= R, eA = 0, M = 3 + (7 & c), c >>>= 3, C -= 3;
26766
+ c >>>= _, C -= _, eA = 0, M = 3 + (7 & c), c >>>= 3, C -= 3;
26767
26767
  } else {
26768
- for (wA = R + 7; C < wA; ) {
26768
+ for (wA = _ + 7; C < wA; ) {
26769
26769
  if (I === 0) break A;
26770
26770
  I--, c += i[a++] << C, C += 8;
26771
26771
  }
26772
- c >>>= R, C -= R, eA = 0, M = 11 + (127 & c), c >>>= 7, C -= 7;
26772
+ c >>>= _, C -= _, eA = 0, M = 11 + (127 & c), c >>>= 7, C -= 7;
26773
26773
  }
26774
26774
  if (e.have + M > e.nlen + e.ndist) {
26775
26775
  o.msg = "invalid bit length repeat", e.mode = li;
@@ -26799,30 +26799,30 @@ vec2 getEquirectangularTexCoord() {
26799
26799
  o.next_out = g, o.avail_out = u, o.next_in = a, o.avail_in = I, e.hold = c, e.bits = C, l0(o, m), g = o.next_out, n = o.output, u = o.avail_out, a = o.next_in, i = o.input, I = o.avail_in, c = e.hold, C = e.bits, e.mode === Dr && (e.back = -1);
26800
26800
  break;
26801
26801
  }
26802
- for (e.back = 0; bA = e.lencode[c & (1 << e.lenbits) - 1], R = bA >>> 24, G = bA >>> 16 & 255, _ = 65535 & bA, !(R <= C); ) {
26802
+ for (e.back = 0; bA = e.lencode[c & (1 << e.lenbits) - 1], _ = bA >>> 24, N = bA >>> 16 & 255, R = 65535 & bA, !(_ <= C); ) {
26803
26803
  if (I === 0) break A;
26804
26804
  I--, c += i[a++] << C, C += 8;
26805
26805
  }
26806
- if (G && (240 & G) == 0) {
26807
- for (L = R, rA = G, tA = _; bA = e.lencode[tA + ((c & (1 << L + rA) - 1) >> L)], R = bA >>> 24, G = bA >>> 16 & 255, _ = 65535 & bA, !(L + R <= C); ) {
26806
+ if (N && (240 & N) == 0) {
26807
+ for (F = _, rA = N, tA = R; bA = e.lencode[tA + ((c & (1 << F + rA) - 1) >> F)], _ = bA >>> 24, N = bA >>> 16 & 255, R = 65535 & bA, !(F + _ <= C); ) {
26808
26808
  if (I === 0) break A;
26809
26809
  I--, c += i[a++] << C, C += 8;
26810
26810
  }
26811
- c >>>= L, C -= L, e.back += L;
26811
+ c >>>= F, C -= F, e.back += F;
26812
26812
  }
26813
- if (c >>>= R, C -= R, e.back += R, e.length = _, G === 0) {
26813
+ if (c >>>= _, C -= _, e.back += _, e.length = R, N === 0) {
26814
26814
  e.mode = 16205;
26815
26815
  break;
26816
26816
  }
26817
- if (32 & G) {
26817
+ if (32 & N) {
26818
26818
  e.back = -1, e.mode = Dr;
26819
26819
  break;
26820
26820
  }
26821
- if (64 & G) {
26821
+ if (64 & N) {
26822
26822
  o.msg = "invalid literal/length code", e.mode = li;
26823
26823
  break;
26824
26824
  }
26825
- e.extra = 15 & G, e.mode = 16201;
26825
+ e.extra = 15 & N, e.mode = 16201;
26826
26826
  case 16201:
26827
26827
  if (e.extra) {
26828
26828
  for (wA = e.extra; C < wA; ) {
@@ -26833,22 +26833,22 @@ vec2 getEquirectangularTexCoord() {
26833
26833
  }
26834
26834
  e.was = e.length, e.mode = 16202;
26835
26835
  case 16202:
26836
- for (; bA = e.distcode[c & (1 << e.distbits) - 1], R = bA >>> 24, G = bA >>> 16 & 255, _ = 65535 & bA, !(R <= C); ) {
26836
+ for (; bA = e.distcode[c & (1 << e.distbits) - 1], _ = bA >>> 24, N = bA >>> 16 & 255, R = 65535 & bA, !(_ <= C); ) {
26837
26837
  if (I === 0) break A;
26838
26838
  I--, c += i[a++] << C, C += 8;
26839
26839
  }
26840
- if ((240 & G) == 0) {
26841
- for (L = R, rA = G, tA = _; bA = e.distcode[tA + ((c & (1 << L + rA) - 1) >> L)], R = bA >>> 24, G = bA >>> 16 & 255, _ = 65535 & bA, !(L + R <= C); ) {
26840
+ if ((240 & N) == 0) {
26841
+ for (F = _, rA = N, tA = R; bA = e.distcode[tA + ((c & (1 << F + rA) - 1) >> F)], _ = bA >>> 24, N = bA >>> 16 & 255, R = 65535 & bA, !(F + _ <= C); ) {
26842
26842
  if (I === 0) break A;
26843
26843
  I--, c += i[a++] << C, C += 8;
26844
26844
  }
26845
- c >>>= L, C -= L, e.back += L;
26845
+ c >>>= F, C -= F, e.back += F;
26846
26846
  }
26847
- if (c >>>= R, C -= R, e.back += R, 64 & G) {
26847
+ if (c >>>= _, C -= _, e.back += _, 64 & N) {
26848
26848
  o.msg = "invalid distance code", e.mode = li;
26849
26849
  break;
26850
26850
  }
26851
- e.offset = _, e.extra = 15 & G, e.mode = 16203;
26851
+ e.offset = R, e.extra = 15 & N, e.mode = 16203;
26852
26852
  case 16203:
26853
26853
  if (e.extra) {
26854
26854
  for (wA = e.extra; C < wA; ) {
@@ -26869,11 +26869,11 @@ vec2 getEquirectangularTexCoord() {
26869
26869
  o.msg = "invalid distance too far back", e.mode = li;
26870
26870
  break;
26871
26871
  }
26872
- M > e.wnext ? (M -= e.wnext, F = e.wsize - M) : F = e.wnext - M, M > e.length && (M = e.length), N = e.window;
26873
- } else N = n, F = g - e.offset, M = e.length;
26872
+ M > e.wnext ? (M -= e.wnext, L = e.wsize - M) : L = e.wnext - M, M > e.length && (M = e.length), G = e.window;
26873
+ } else G = n, L = g - e.offset, M = e.length;
26874
26874
  M > u && (M = u), u -= M, e.length -= M;
26875
26875
  do
26876
- n[g++] = N[F++];
26876
+ n[g++] = G[L++];
26877
26877
  while (--M);
26878
26878
  e.length === 0 && (e.mode = Wg);
26879
26879
  break;
@@ -27315,20 +27315,20 @@ vec2 getEquirectangularTexCoord() {
27315
27315
  static applyDepth(A, e, i = !0, n) {
27316
27316
  return Mr(this, void 0, void 0, (function* () {
27317
27317
  const a = yield X.fetch(A), g = yield a.arrayBuffer(), I = new Uint8Array(g), u = R0(I), c = this.qiPlayerDepthWidth * this.qiPlayerDepthHeight, C = new Float32Array(4 * c);
27318
- for (let N = 0; N < c; N++) {
27319
- let R = (u[2 * N] | u[2 * N + 1] << 8) / 512;
27320
- C[4 * N] = R;
27318
+ for (let G = 0; G < c; G++) {
27319
+ let _ = (u[2 * G] | u[2 * G + 1] << 8) / 512;
27320
+ C[4 * G] = _;
27321
27321
  }
27322
27322
  if (n) {
27323
- const N = this.qiPlayerDepthWidth / 4, R = new Float32Array(4 * c);
27324
- for (let G = 0; G < this.qiPlayerDepthHeight; G++) for (let _ = 0; _ < this.qiPlayerDepthWidth; _++) {
27325
- let L = _ + G * this.qiPlayerDepthWidth, rA = (this.qiPlayerDepthWidth - 1 - _ + N) % this.qiPlayerDepthWidth;
27323
+ const G = this.qiPlayerDepthWidth / 4, _ = new Float32Array(4 * c);
27324
+ for (let N = 0; N < this.qiPlayerDepthHeight; N++) for (let R = 0; R < this.qiPlayerDepthWidth; R++) {
27325
+ let F = R + N * this.qiPlayerDepthWidth, rA = (this.qiPlayerDepthWidth - 1 - R + G) % this.qiPlayerDepthWidth;
27326
27326
  rA < 0 && (rA += this.qiPlayerDepthWidth);
27327
- let tA = rA + G * this.qiPlayerDepthWidth;
27328
- R[4 * L] = C[4 * tA];
27327
+ let tA = rA + N * this.qiPlayerDepthWidth;
27328
+ _[4 * F] = C[4 * tA];
27329
27329
  }
27330
- for (let G = 0; G < R.length; G += 4) R[G] = Math.max(R[G], 1);
27331
- C.set(R);
27330
+ for (let N = 0; N < _.length; N += 4) _[N] = Math.max(_[N], 1);
27331
+ C.set(_);
27332
27332
  }
27333
27333
  const f = Nt.newDataTexture(C, this.qiPlayerDepthWidth, this.qiPlayerDepthHeight, ke, DA);
27334
27334
  f.minFilter = dA, f.magFilter = dA, this.depthShaderMaterial || (this.depthShaderMaterial = new ei({ uniforms: { u_texture: { value: null }, depthTexture: { value: null } }, vertexShader: `
@@ -27351,8 +27351,8 @@ vec2 getEquirectangularTexCoord() {
27351
27351
  ` })), this.depthShaderMaterial.uniforms.u_texture.value = e, this.depthShaderMaterial.uniforms.depthTexture.value = f;
27352
27352
  const m = new Tt(new ki(1, 1), this.depthShaderMaterial), M = new Nn();
27353
27353
  M.add(m);
27354
- const F = new Xt(e.image.width, e.image.height, { type: me, wrapS: hA, wrapT: hA });
27355
- return X.renderer.setRenderTarget(F), X.renderer.render(M, new _n(-0.5, 0.5, 0.5, -0.5, 0, 1)), X.renderer.setRenderTarget(null), f.dispose(), i && e.dispose(), m.geometry.dispose(), F.texture;
27354
+ const L = new Xt(e.image.width, e.image.height, { type: me, wrapS: hA, wrapT: hA });
27355
+ return X.renderer.setRenderTarget(L), X.renderer.render(M, new _n(-0.5, 0.5, 0.5, -0.5, 0, 1)), X.renderer.setRenderTarget(null), f.dispose(), i && e.dispose(), m.geometry.dispose(), L.texture;
27356
27356
  }));
27357
27357
  }
27358
27358
  static applyDepthFromPng(A, e, i = !0) {
@@ -27448,8 +27448,8 @@ vec2 getEquirectangularTexCoord() {
27448
27448
  const I = g.ptr(), u = g.width(), c = g.height(), C = u * c * 4, f = X.wasm.memory.buffer;
27449
27449
  let m, M;
27450
27450
  e ? (m = new Float32Array(f, I, C), M = DA) : (m = new Uint16Array(f, I, C), M = me);
27451
- const F = new Xr(m, u, c, ke, M);
27452
- return F.needsUpdate = !0, ((performance.now() - i) / 1e3).toFixed(2), F;
27451
+ const L = new Xr(m, u, c, ke, M);
27452
+ return L.needsUpdate = !0, ((performance.now() - i) / 1e3).toFixed(2), L;
27453
27453
  }));
27454
27454
  }
27455
27455
  static loadQhdr(A) {
@@ -27460,10 +27460,10 @@ vec2 getEquirectangularTexCoord() {
27460
27460
  const u = yield X.fetch(A), c = yield u.arrayBuffer(), C = new (N0())();
27461
27461
  yield C.loadAsync(c);
27462
27462
  const f = yield C.file("info.json").async("string"), m = JSON.parse(f), M = new k0(m.width, m.height);
27463
- for (const F of m.channels) {
27464
- const N = yield C.file(`${F.name}.jpg`).async("blob"), R = yield aI.fromBlob(N);
27465
- let G;
27466
- F.hasDeltas && (G = yield (yield C.file(`${F.name}.deltas`).async("blob")).arrayBuffer()), M.setChannel(F, R, G);
27463
+ for (const L of m.channels) {
27464
+ const G = yield C.file(`${L.name}.jpg`).async("blob"), _ = yield aI.fromBlob(G);
27465
+ let N;
27466
+ L.hasDeltas && (N = yield (yield C.file(`${L.name}.deltas`).async("blob")).arrayBuffer()), M.setChannel(L, _, N);
27467
27467
  }
27468
27468
  M.hsvToRgb(), fA.hasFloat32Textures ? g(M.createTexture32()) : g(M.createTexture16());
27469
27469
  } catch (u) {
@@ -27866,7 +27866,7 @@ vec2 getEquirectangularTexCoord() {
27866
27866
  };
27867
27867
  class T0 {
27868
27868
  constructor(A) {
27869
- this.idLabels = [], this.posLabels = [], this.validatorIndex = 0, this.autoOverrideMarkerIds = /* @__PURE__ */ new Set(), this.siteManager = A;
27869
+ this.idLabels = [], this.posLabels = [], this.validatorIndex = 0, this.autoOverrideMarkerIds = /* @__PURE__ */ new Set(), this.promotedNaturalIds = /* @__PURE__ */ new Set(), this.siteManager = A;
27870
27870
  }
27871
27871
  addMarkers(A) {
27872
27872
  return TC(this, void 0, void 0, (function* () {
@@ -27889,7 +27889,7 @@ vec2 getEquirectangularTexCoord() {
27889
27889
  return TC(this, void 0, void 0, (function* () {
27890
27890
  const i = A.id + "_new", n = Object.create(A);
27891
27891
  n.id = i, n.position = e.clone();
27892
- const a = [UC], g = yield Promise.all(a.map(((F) => X.assetManager.loadTexture(F, !1)))), I = new aA(0.25, 0.25, 0.25), u = yield X.assetManager.loadTexturedPlaneModel(a[0], pn.getMaterial(ts, { depthOffset: -0.2, color: new gt(1, 1, 1) }), new aA(0, n.floor_vertical_position - n.position.y, 0), I, !0);
27892
+ const a = [UC], g = yield Promise.all(a.map(((L) => X.assetManager.loadTexture(L, !1)))), I = new aA(0.25, 0.25, 0.25), u = yield X.assetManager.loadTexturedPlaneModel(a[0], pn.getMaterial(ts, { depthOffset: -0.2, color: new gt(1, 1, 1) }), new aA(0, n.floor_vertical_position - n.position.y, 0), I, !0);
27893
27893
  u.position.copy(n.position);
27894
27894
  const c = new Fi();
27895
27895
  c.id = i, c.description = n.description, c.position = n.position, c.rotation = new aA(0, 0, 0), c.model = u, c.textures = g, c.payload = n;
@@ -27939,6 +27939,18 @@ vec2 getEquirectangularTexCoord() {
27939
27939
  applyFallbackMarker(A) {
27940
27940
  A.isVisible = !0, this.applyDepthOverride(A), A.model.visible = !0;
27941
27941
  }
27942
+ isEligibleMarker(A, e, i) {
27943
+ if (e && A.id === e.id) return !1;
27944
+ const n = i?.find(((a) => a.cameraId === A.id));
27945
+ return !(fA.NAV_FALLBACK_RESPECT_OVERRIDES && n && !n.display);
27946
+ }
27947
+ updateNaturalVisibility(A, e, i) {
27948
+ const n = i?.find(((g) => g.cameraId === A.id));
27949
+ if (n !== void 0) return A.model.visible = n.display, n.display ? this.applyDepthOverride(A) : this.restoreOriginalMaterial(A), n.display;
27950
+ this.restoreOriginalMaterial(A);
27951
+ const a = A.setIsVisible(e);
27952
+ return A.model.visible = a, a;
27953
+ }
27942
27954
  update() {
27943
27955
  const A = fA.SHOW_NAVIGATION_MARKERS_ID;
27944
27956
  this.idLabels.forEach(((N) => N.visible = A));
@@ -27949,53 +27961,65 @@ vec2 getEquirectangularTexCoord() {
27949
27961
  const n = X.userData.siteCamera, a = n?.overrides, g = X.instance.siteManager.isLoading();
27950
27962
  if (this.markers.data.forEach(((N, R) => {
27951
27963
  if (N.update(), e || g) return;
27952
- if (this.autoOverrideMarkerIds.has(N.id)) {
27953
- const _ = a?.find(((L) => L.cameraId === N.id));
27954
- return _ !== void 0 ? (N.model.visible = _.display, void (_.display && this.applyDepthOverride(N))) : void this.applyFallbackMarker(N);
27964
+ const F = this.autoOverrideMarkerIds.has(N.id), rA = this.promotedNaturalIds.has(N.id);
27965
+ if (F || rA) {
27966
+ const tA = a?.find(((eA) => eA.cameraId === N.id));
27967
+ return tA !== void 0 ? (N.model.visible = tA.display, void (tA.display && this.applyDepthOverride(N))) : void this.applyFallbackMarker(N);
27955
27968
  }
27956
- if (R !== this.validatorIndex) return;
27957
- const G = a?.find(((_) => _.cameraId === N.id));
27958
- G !== void 0 ? (N.model.visible = G.display, G.display && this.applyDepthOverride(N)) : (this.restoreOriginalMaterial(N), N.model.visible = N.setIsVisible(this.siteManager.getCurrentPanoramaData()));
27969
+ R === this.validatorIndex && this.updateNaturalVisibility(N, this.siteManager.getCurrentPanoramaData(), a);
27959
27970
  })), this.validatorIndex = (this.validatorIndex + 1) % i, this.validatorIndex !== 0 || e || g) return;
27960
- let I = 0;
27961
- for (const N of this.markers.data) n && N.id !== n.id && (this.autoOverrideMarkerIds.has(N.id) || N.model.visible && I++);
27962
- const u = Math.max(0, 0 | fA.NAV_MIN_NATURAL_VISIBLE);
27963
- if (I >= u) {
27971
+ const I = this.siteManager.getCurrentPanoramaData(), u = /* @__PURE__ */ new Set();
27972
+ for (const N of this.markers.data) this.isEligibleMarker(N, n, a) && this.updateNaturalVisibility(N, I, a) && u.add(N.id);
27973
+ for (const N of this.promotedNaturalIds) if (!u.has(N)) {
27974
+ const R = this.markers.data.find(((F) => F.id === N));
27975
+ R && !this.autoOverrideMarkerIds.has(N) && this.restoreOriginalMaterial(R);
27976
+ }
27977
+ this.promotedNaturalIds = u;
27978
+ const c = this.promotedNaturalIds.size, C = Math.max(0, 0 | fA.NAV_MIN_NATURAL_VISIBLE);
27979
+ if (c >= C) {
27964
27980
  if (this.autoOverrideMarkerIds.size > 0) {
27965
27981
  for (const N of this.autoOverrideMarkerIds) {
27966
- const R = this.markers.data.find(((G) => G.id === N));
27967
- R && this.restoreOriginalMaterial(R);
27982
+ const R = this.markers.data.find(((F) => F.id === N));
27983
+ R && !this.promotedNaturalIds.has(N) && this.restoreOriginalMaterial(R);
27968
27984
  }
27969
- fA.NAV_FALLBACK_DEBUG && console.debug("[nav-fallback] deactivated", { from: n?.id, naturalVisibleCount: I, minNaturalVisible: u }), this.autoOverrideMarkerIds.clear();
27985
+ fA.NAV_FALLBACK_DEBUG && console.debug("[nav-fallback] deactivated", { from: n?.id, naturalVisibleCount: c, minNaturalVisible: C, promotedNaturalIds: [...this.promotedNaturalIds] }), this.autoOverrideMarkerIds.clear();
27986
+ }
27987
+ for (const N of this.promotedNaturalIds) {
27988
+ const R = this.markers.data.find(((F) => F.id === N));
27989
+ R && this.applyFallbackMarker(R);
27970
27990
  }
27971
27991
  return;
27972
27992
  }
27973
- const c = X.userData.cameraSmooth.position, C = [];
27974
- for (const N of this.markers.data) {
27975
- if (n && N.id === n.id) continue;
27976
- const R = a?.find(((G) => G.cameraId === N.id));
27977
- fA.NAV_FALLBACK_RESPECT_OVERRIDES && R && !R.display || C.push({ id: N.id, dist: c.distanceTo(N.model.position) });
27978
- }
27979
- C.sort(((N, R) => N.dist - R.dist));
27980
- const f = Math.max(0, u - I), m = Math.max(0, Math.min(0 | fA.NAV_FALLBACK_COUNT, f)), M = Math.min(m, C.length);
27981
- if (M === 0) {
27982
- fA.NAV_FALLBACK_DEBUG && console.debug("[nav-fallback] no eligible candidates", { from: n?.id, keeping: [...this.autoOverrideMarkerIds], naturalVisibleCount: I, minNaturalVisible: u, requested: m });
27993
+ const f = X.userData.cameraSmooth.position, m = [];
27994
+ for (const N of this.markers.data) this.isEligibleMarker(N, n, a) && (this.promotedNaturalIds.has(N.id) || m.push({ id: N.id, dist: f.distanceTo(N.model.position) }));
27995
+ m.sort(((N, R) => N.dist - R.dist));
27996
+ const M = Math.max(0, C - c), L = Math.max(0, Math.min(0 | fA.NAV_FALLBACK_COUNT, M)), G = Math.min(L, m.length);
27997
+ if (G === 0) {
27998
+ fA.NAV_FALLBACK_DEBUG && console.debug("[nav-fallback] no eligible candidates", { from: n?.id, keeping: [...this.autoOverrideMarkerIds], naturalVisibleCount: c, minNaturalVisible: C, requested: L, promotedNaturalIds: [...this.promotedNaturalIds] });
27983
27999
  for (const N of this.autoOverrideMarkerIds) {
27984
- const R = this.markers.data.find(((G) => G.id === N));
28000
+ const R = this.markers.data.find(((F) => F.id === N));
28001
+ R && this.applyFallbackMarker(R);
28002
+ }
28003
+ for (const N of this.promotedNaturalIds) {
28004
+ const R = this.markers.data.find(((F) => F.id === N));
27985
28005
  R && this.applyFallbackMarker(R);
27986
28006
  }
27987
28007
  return;
27988
28008
  }
27989
- const F = new Set(C.slice(0, M).map(((N) => N.id)));
27990
- for (const N of this.autoOverrideMarkerIds) if (!F.has(N)) {
27991
- const R = this.markers.data.find(((G) => G.id === N));
27992
- R && this.restoreOriginalMaterial(R);
28009
+ const _ = new Set(m.slice(0, G).map(((N) => N.id)));
28010
+ for (const N of this.autoOverrideMarkerIds) if (!_.has(N)) {
28011
+ const R = this.markers.data.find(((F) => F.id === N));
28012
+ R && !this.promotedNaturalIds.has(N) && this.restoreOriginalMaterial(R);
28013
+ }
28014
+ for (const N of _) {
28015
+ const R = this.markers.data.find(((F) => F.id === N));
28016
+ R && this.applyFallbackMarker(R);
27993
28017
  }
27994
- for (const N of F) {
27995
- const R = this.markers.data.find(((G) => G.id === N));
28018
+ for (const N of this.promotedNaturalIds) {
28019
+ const R = this.markers.data.find(((F) => F.id === N));
27996
28020
  R && this.applyFallbackMarker(R);
27997
28021
  }
27998
- fA.NAV_FALLBACK_DEBUG && (F.size !== this.autoOverrideMarkerIds.size || [...F].some(((R) => !this.autoOverrideMarkerIds.has(R)))) && console.debug("[nav-fallback] activated", { from: n?.id, ids: [...F], candidateCount: C.length, naturalVisibleCount: I, minNaturalVisible: u, requested: m }), this.autoOverrideMarkerIds = F;
28022
+ fA.NAV_FALLBACK_DEBUG && (_.size !== this.autoOverrideMarkerIds.size || [..._].some(((R) => !this.autoOverrideMarkerIds.has(R)))) && console.debug("[nav-fallback] activated", { from: n?.id, ids: [..._], candidateCount: m.length, naturalVisibleCount: c, minNaturalVisible: C, requested: L, promotedNaturalIds: [...this.promotedNaturalIds] }), this.autoOverrideMarkerIds = _;
27999
28023
  }
28000
28024
  }
28001
28025
  class Ri {
@@ -28144,8 +28168,8 @@ vec2 getEquirectangularTexCoord() {
28144
28168
  g.style.cssText = "width: 100%; padding: 4px; margin-bottom: 6px; background: #333; color: white; border: 1px solid #666;";
28145
28169
  const I = document.createElement("option");
28146
28170
  I.textContent = "-- select --", I.value = "", g.appendChild(I), e.forEach(((m, M) => {
28147
- const F = document.createElement("option");
28148
- F.value = String(M), F.textContent = `${m.id} (${m.type})`, g.appendChild(F);
28171
+ const L = document.createElement("option");
28172
+ L.value = String(M), L.textContent = `${m.id} (${m.type})`, g.appendChild(L);
28149
28173
  })), n.appendChild(g);
28150
28174
  const u = document.createElement("div");
28151
28175
  u.style.cssText = "display: flex; gap: 4px;";
@@ -28159,8 +28183,8 @@ vec2 getEquirectangularTexCoord() {
28159
28183
  C.addEventListener("click", f), c.addEventListener("click", (() => H0(this, void 0, void 0, (function* () {
28160
28184
  const m = parseInt(g.value);
28161
28185
  if (isNaN(m)) return void f();
28162
- const M = e[m], F = yield this.navigationMarkers.addSingleMarker(M, A);
28163
- this.addMarkerToScene(F), this.lastDraggedMarker = F, F.id, A.x.toFixed(2), A.y.toFixed(2), A.z.toFixed(2), f();
28186
+ const M = e[m], L = yield this.navigationMarkers.addSingleMarker(M, A);
28187
+ this.addMarkerToScene(L), this.lastDraggedMarker = L, L.id, A.x.toFixed(2), A.y.toFixed(2), A.z.toFixed(2), f();
28164
28188
  })))), X.canvas.parentElement.appendChild(n);
28165
28189
  }
28166
28190
  }
@@ -28235,13 +28259,13 @@ vec2 getEquirectangularTexCoord() {
28235
28259
  const i = [0.5, 0.75, 1, 10], n = [0.3, 0.7, 1.1, 3], a = [0, 0.33, 0.66, 1], g = new gt(7693926), I = new gt(6710886), u = Math.floor(e * (a.length - 1)), c = u + 1 < a.length ? u + 1 : u;
28236
28260
  let C = 0;
28237
28261
  if (c !== u) {
28238
- const N = a[c] - a[u];
28239
- C = (e - a[u]) / N;
28262
+ const G = a[c] - a[u];
28263
+ C = (e - a[u]) / G;
28240
28264
  }
28241
28265
  const f = Zi.lerp(i[u], i[c], C), m = Zi.lerp(n[u], n[c], C), M = Zi.lerp(a[u], a[c], C);
28242
28266
  this.directionalLight.intensity = f, this.ambientLight.intensity = m;
28243
- const F = new gt().lerpColors(g, I, M);
28244
- this.directionalLight.color = F, this.ambientLight.color = F;
28267
+ const L = new gt().lerpColors(g, I, M);
28268
+ this.directionalLight.color = L, this.ambientLight.color = L;
28245
28269
  }
28246
28270
  if (rr.FLOOR_DEMO) {
28247
28271
  const A = Date.now();
@@ -28484,8 +28508,8 @@ vec2 getEquirectangularTexCoord() {
28484
28508
  a.normalize();
28485
28509
  const C = e.depth.getDepth(a), f = u.project(X.userData.cameraSmooth);
28486
28510
  if (f.z >= -1 && f.z <= 1) {
28487
- const m = X.renderer.domElement.clientWidth / 2, M = X.renderer.domElement.clientHeight / 2, F = (f.x * m + m) / m - 1, N = -1 * ((-f.y * M + M) / M - 1);
28488
- A.push({ id: I, position: { x: g.x, y: g.y, z: g.z }, screenPosition: { x: F, y: N }, occluded: !(C > c - 0.5), visible: F >= -1 && F <= 1 && N >= -1 && N <= 1 });
28511
+ const m = X.renderer.domElement.clientWidth / 2, M = X.renderer.domElement.clientHeight / 2, L = (f.x * m + m) / m - 1, G = -1 * ((-f.y * M + M) / M - 1);
28512
+ A.push({ id: I, position: { x: g.x, y: g.y, z: g.z }, screenPosition: { x: L, y: G }, occluded: !(C > c - 0.5), visible: L >= -1 && L <= 1 && G >= -1 && G <= 1 });
28489
28513
  }
28490
28514
  })), X.renderer.setClearColor(0, 0), X.renderer.setRenderTarget(this.renderTexture), X.renderer.render(this.scene, this.orthoCamera), X.renderer.setRenderTarget(null), X.eventManager.onFrontendMarkersUpdate(A);
28491
28515
  }
@@ -28683,19 +28707,19 @@ vec2 getEquirectangularTexCoord() {
28683
28707
  var f = new Uint8Array(i * n * 4);
28684
28708
  X.renderer.readRenderTargetPixels(a, 0, 0, i, n, f), X.renderer.setRenderTarget(null), e.dispose();
28685
28709
  const m = new Uint8Array(4 * i);
28686
- for (let N = 0; N < n / 2; N++) {
28687
- const R = N * i * 4, G = (n - N - 1) * i * 4;
28688
- m.set(f.subarray(R, R + 4 * i)), f.copyWithin(R, G, G + 4 * i), f.set(m, G);
28689
- }
28690
- const M = 64, F = new Uint8Array(1048576);
28691
- for (let N = 0; N < M; N++) {
28692
- const R = N % 8 * M + Math.floor(N / 8) * M * i;
28693
- for (let G = 0; G < M; G++) for (let _ = 0; _ < M; _++) {
28694
- const L = 4 * (N * M * M + G * M + _), rA = 4 * (_ + G * i + R);
28695
- F[L] = f[rA], F[L + 1] = f[rA + 1], F[L + 2] = f[rA + 2], F[L + 3] = 255;
28710
+ for (let G = 0; G < n / 2; G++) {
28711
+ const _ = G * i * 4, N = (n - G - 1) * i * 4;
28712
+ m.set(f.subarray(_, _ + 4 * i)), f.copyWithin(_, N, N + 4 * i), f.set(m, N);
28713
+ }
28714
+ const M = 64, L = new Uint8Array(1048576);
28715
+ for (let G = 0; G < M; G++) {
28716
+ const _ = G % 8 * M + Math.floor(G / 8) * M * i;
28717
+ for (let N = 0; N < M; N++) for (let R = 0; R < M; R++) {
28718
+ const F = 4 * (G * M * M + N * M + R), rA = 4 * (R + N * i + _);
28719
+ L[F] = f[rA], L[F + 1] = f[rA + 1], L[F + 2] = f[rA + 2], L[F + 3] = 255;
28696
28720
  }
28697
28721
  }
28698
- fA.lutTexture = new Bs(F, M, M, M), fA.lutTexture.format = ke, fA.lutTexture.type = SA, fA.lutTexture.minFilter = BA, fA.lutTexture.magFilter = BA, fA.lutTexture.wrapS = AA, fA.lutTexture.wrapT = AA, fA.lutTexture.needsUpdate = !0, a.dispose(), u.dispose(), I.dispose(), c.geometry.dispose();
28722
+ fA.lutTexture = new Bs(L, M, M, M), fA.lutTexture.format = ke, fA.lutTexture.type = SA, fA.lutTexture.minFilter = BA, fA.lutTexture.magFilter = BA, fA.lutTexture.wrapS = AA, fA.lutTexture.wrapT = AA, fA.lutTexture.needsUpdate = !0, a.dispose(), u.dispose(), I.dispose(), c.geometry.dispose();
28699
28723
  }));
28700
28724
  }
28701
28725
  isInitialized() {
@@ -28935,11 +28959,11 @@ vec2 getEquirectangularTexCoord() {
28935
28959
  var g, I = !1, u = !1;
28936
28960
  try {
28937
28961
  for (var c, C = (function(f) {
28938
- var m, M, F, N = 2;
28939
- for (typeof Symbol < "u" && (M = Symbol.asyncIterator, F = Symbol.iterator); N--; ) {
28962
+ var m, M, L, G = 2;
28963
+ for (typeof Symbol < "u" && (M = Symbol.asyncIterator, L = Symbol.iterator); G--; ) {
28940
28964
  if (M && (m = f[M]) != null) return m.call(f);
28941
- if (F && (m = f[F]) != null) return new $g(m.call(f));
28942
- M = "@@asyncIterator", F = "@@iterator";
28965
+ if (L && (m = f[L]) != null) return new $g(m.call(f));
28966
+ M = "@@asyncIterator", L = "@@iterator";
28943
28967
  }
28944
28968
  throw new TypeError("Object is not async iterable");
28945
28969
  })(o.values()); I = !(c = await C.next()).done; I = !1) {
@@ -29009,8 +29033,8 @@ vec2 getEquirectangularTexCoord() {
29009
29033
  let i = o;
29010
29034
  "body" in o && (i = await (async function(g, I) {
29011
29035
  const u = g.getReader(), c = new ReadableStream({ start: (m) => (async function M() {
29012
- return u.read().then((({ done: F, value: N }) => {
29013
- if (!F) return m.enqueue(N), M();
29036
+ return u.read().then((({ done: L, value: G }) => {
29037
+ if (!L) return m.enqueue(G), M();
29014
29038
  m.close();
29015
29039
  }));
29016
29040
  })() }), C = new Response(c), f = await C.blob();
@@ -29054,40 +29078,40 @@ vec2 getEquirectangularTexCoord() {
29054
29078
  createButtons() {
29055
29079
  this.testManager.clearButtons();
29056
29080
  const A = this.testManager.addAccordion("Test Sites"), e = document.createElement("div");
29057
- e.classList.add("btn-grid"), this.testSites.forEach(((_) => {
29058
- const L = document.createElement("button");
29059
- L.classList.add("btn-toggle"), _.name === this.currentSiteName && L.classList.add("active"), L.textContent = _.name, L.addEventListener("click", (() => {
29081
+ e.classList.add("btn-grid"), this.testSites.forEach(((R) => {
29082
+ const F = document.createElement("button");
29083
+ F.classList.add("btn-toggle"), R.name === this.currentSiteName && F.classList.add("active"), F.textContent = R.name, F.addEventListener("click", (() => {
29060
29084
  let rA;
29061
29085
  this.currentSite = "Loading...";
29062
29086
  let tA = !0;
29063
- _.name === this.currentSiteName && (rA = X.playerAPI.getCurrentCamera().id, tA = !1), X.playerAPI.loadInterior(_.url, rA, tA, ((eA) => {
29064
- eA ? (this.currentSite = xr.resolveFilePath(eA.fileResolver, ""), this.currentSiteName = _.name, this.cameraButtonsCreated = !0, this.createButtons(), this.makeCameraButtons(eA.siteData)) : this.currentSite = "Error";
29087
+ R.name === this.currentSiteName && (rA = X.playerAPI.getCurrentCamera().id, tA = !1), X.playerAPI.loadInterior(R.url, rA, tA, ((eA) => {
29088
+ eA ? (this.currentSite = xr.resolveFilePath(eA.fileResolver, ""), this.currentSiteName = R.name, this.cameraButtonsCreated = !0, this.createButtons(), this.makeCameraButtons(eA.siteData)) : this.currentSite = "Error";
29065
29089
  }));
29066
- })), e.appendChild(L);
29090
+ })), e.appendChild(F);
29067
29091
  })), A.appendChild(e);
29068
29092
  const i = this.testManager.addAccordion("Util Functions"), n = document.createElement("div");
29069
29093
  n.classList.add("btn-grid"), this.testManager.addButtonTo(n, "Pause", (() => X.playerAPI.pause())), this.testManager.addButtonTo(n, "Resume", (() => X.playerAPI.resume())), this.testManager.addButtonTo(n, "Destroy", (() => X.playerAPI.destroy())), this.testManager.addButtonTo(n, "Take Photo", (() => OC(this, void 0, void 0, (function* () {
29070
- const _ = yield X.playerAPI.takePhoto();
29071
- this.testManager.createPreviewImage(_);
29094
+ const R = yield X.playerAPI.takePhoto();
29095
+ this.testManager.createPreviewImage(R);
29072
29096
  })))), this.testManager.addButtonTo(n, "Load Dynamic Markers (string)", (() => {
29073
- let _ = prompt("Enter markers json");
29074
- _ && X.playerAPI.loadDynamicMarkers(_);
29097
+ let R = prompt("Enter markers json");
29098
+ R && X.playerAPI.loadDynamicMarkers(R);
29075
29099
  })), this.testManager.addButtonTo(n, "Load Dynamic Markers (json)", (() => {
29076
29100
  X.playerAPI.loadMarkersJson();
29077
29101
  })), i.appendChild(n);
29078
29102
  const a = document.createElement("div");
29079
- a.classList.add("btn-grid"), a.style.marginTop = "6px", this.testManager.addToggleButton(a, "Auto Rotate", !1, ((_) => {
29103
+ a.classList.add("btn-grid"), a.style.marginTop = "6px", this.testManager.addToggleButton(a, "Auto Rotate", !1, ((R) => {
29080
29104
  X.playerAPI.toggleAutoRotate(), X.playerAPI.setAutoRotateSpeed(0.5);
29081
- })), this.testManager.addToggleButton(a, "Hide Markers", !1, ((_) => {
29082
- _ ? X.playerAPI.hideMarkers() : X.playerAPI.showMarkers();
29105
+ })), this.testManager.addToggleButton(a, "Hide Markers", !1, ((R) => {
29106
+ R ? X.playerAPI.hideMarkers() : X.playerAPI.showMarkers();
29083
29107
  })), i.appendChild(a);
29084
29108
  const g = this.testManager.addAccordion("Tonemappers");
29085
- this.testManager.addRadioGroup(g, [{ name: "AGX", value: "AgXTonemap" }, { name: "Reinhard", value: "reinhardTonemap" }, { name: "Fusion", value: "fusionTonemap" }, { name: "None", value: "NoTonemap" }], this.activeTonemapper, ((_) => {
29086
- this.activeTonemapper = _, X.playerAPI.updateSettings({ ACTIVE_TONEMAPPER: _ });
29109
+ this.testManager.addRadioGroup(g, [{ name: "AGX", value: "AgXTonemap" }, { name: "Reinhard", value: "reinhardTonemap" }, { name: "Fusion", value: "fusionTonemap" }, { name: "None", value: "NoTonemap" }], this.activeTonemapper, ((R) => {
29110
+ this.activeTonemapper = R, X.playerAPI.updateSettings({ ACTIVE_TONEMAPPER: R });
29087
29111
  }));
29088
29112
  const I = this.testManager.addAccordion("SunSim");
29089
- this.testManager.addToggleButton(I, "Sun Sim", !1, ((_) => {
29090
- _ ? X.playerAPI.loadSunSim(11) : X.playerAPI.unloadSunSim();
29113
+ this.testManager.addToggleButton(I, "Sun Sim", !1, ((R) => {
29114
+ R ? X.playerAPI.loadSunSim(11) : X.playerAPI.unloadSunSim();
29091
29115
  }));
29092
29116
  const u = this.testManager.addAccordion("Memory Tests"), c = document.createElement("div");
29093
29117
  c.classList.add("btn-grid"), this.testManager.addButtonTo(c, "Stresstest!", (() => {
@@ -29097,77 +29121,77 @@ vec2 getEquirectangularTexCoord() {
29097
29121
  })), this.testManager.addButtonTo(c, "Force DisposeAll", (() => {
29098
29122
  X.memoryManager.disposeAll();
29099
29123
  })), this.testManager.addButtonTo(c, "Spawn 3D Cubes", (() => {
29100
- const _ = this.testManager.main.siteManager.modelsLayer.scene, L = X.userData.cameraSmooth.position;
29101
- this.testManager.spawnCubes(_, L);
29124
+ const R = this.testManager.main.siteManager.modelsLayer.scene, F = X.userData.cameraSmooth.position;
29125
+ this.testManager.spawnCubes(R, F);
29102
29126
  })), u.appendChild(c);
29103
29127
  const C = this.testManager.addAccordion("Local Mode");
29104
29128
  this.testManager.addButtonTo(C, "Select Local Folder", (() => OC(this, void 0, void 0, (function* () {
29105
- const _ = /[^\/]*(\/.*)/, L = yield (async function(...eA) {
29129
+ const R = /[^\/]*(\/.*)/, F = yield (async function(...eA) {
29106
29130
  return (await q0).default(...eA);
29107
- })({ recursive: !0 }), rA = L.map(((eA) => ({ path: eA.webkitRelativePath.match(_)[1], url: URL.createObjectURL(eA) }))), tA = new z0(rA);
29131
+ })({ recursive: !0 }), rA = F.map(((eA) => ({ path: eA.webkitRelativePath.match(R)[1], url: URL.createObjectURL(eA) }))), tA = new z0(rA);
29108
29132
  X.fileLoader = tA, X.playerAPI.loadInterior("", void 0, !0, ((eA) => {
29109
29133
  eA ? (this.currentSite = xr.resolveFilePath(eA.fileResolver, ""), this.cameraButtonsCreated = !0, this.makeCameraButtons(eA.siteData), this.currentSiteName = "Local", this.createButtons()) : this.currentSite = "Error";
29110
29134
  }));
29111
29135
  }))));
29112
29136
  const f = this.testManager.addAccordion("Settings"), m = document.createElement("div");
29113
- m.classList.add("btn-grid"), this.testManager.addToggleButton(m, "Bloom", fA.UNREAL_BLOOM_ENABLED, ((_) => {
29114
- X.playerAPI.updateSettings({ UNREAL_BLOOM_ENABLED: _ });
29137
+ m.classList.add("btn-grid"), this.testManager.addToggleButton(m, "Bloom", fA.UNREAL_BLOOM_ENABLED, ((R) => {
29138
+ X.playerAPI.updateSettings({ UNREAL_BLOOM_ENABLED: R });
29115
29139
  })), this.testManager.addButtonTo(m, "Bloom +", (() => {
29116
29140
  X.playerAPI.updateSettings({ UNREAL_BLOOOM_STRENGTH: fA.UNREAL_BLOOOM_STRENGTH + 0.1 });
29117
29141
  })), this.testManager.addButtonTo(m, "Bloom -", (() => {
29118
29142
  X.playerAPI.updateSettings({ UNREAL_BLOOOM_STRENGTH: fA.UNREAL_BLOOOM_STRENGTH - 0.1 });
29119
29143
  })), this.testManager.addButtonTo(m, "Set Whitepoint", (() => {
29120
- const _ = document.createElement("input");
29121
- _.type = "color", _.style.display = "none", _.oninput = (L) => {
29122
- const rA = L.target.value, tA = parseInt(rA.substr(1, 2), 16) / 255, eA = parseInt(rA.substr(3, 2), 16) / 255, QA = parseInt(rA.substr(5, 2), 16) / 255;
29144
+ const R = document.createElement("input");
29145
+ R.type = "color", R.style.display = "none", R.oninput = (F) => {
29146
+ const rA = F.target.value, tA = parseInt(rA.substr(1, 2), 16) / 255, eA = parseInt(rA.substr(3, 2), 16) / 255, QA = parseInt(rA.substr(5, 2), 16) / 255;
29123
29147
  X.playerAPI.setWhitePoint(tA, eA, QA);
29124
- }, document.body.appendChild(_), _.click();
29125
- })), f.appendChild(m), this.testManager.addNumberInputTo(f, "Temperature (Kelvin)", fA.temperature, 1e3, 12e3, 1, ((_) => {
29126
- fA.temperature = _;
29127
- })), this.testManager.addNumberInputTo(f, "targetLuminance", fA.targetLuminance, 0.1, 10, 0.1, ((_) => {
29128
- fA.targetLuminance = _;
29129
- })), this.testManager.addNumberInputTo(f, "Exposure Fov Scale", fA.exposureFovScale, 0.1, 1, 0.1, ((_) => {
29130
- fA.exposureFovScale = 1 * _;
29131
- })), this.testManager.addNumberInputTo(f, "sharpenFilter_amount", fA.sharpenFilter_amount, 0.1, 10, 0.1, ((_) => {
29132
- fA.sharpenFilter_amount = _;
29148
+ }, document.body.appendChild(R), R.click();
29149
+ })), f.appendChild(m), this.testManager.addNumberInputTo(f, "Temperature (Kelvin)", fA.temperature, 1e3, 12e3, 1, ((R) => {
29150
+ fA.temperature = R;
29151
+ })), this.testManager.addNumberInputTo(f, "targetLuminance", fA.targetLuminance, 0.1, 10, 0.1, ((R) => {
29152
+ fA.targetLuminance = R;
29153
+ })), this.testManager.addNumberInputTo(f, "Exposure Fov Scale", fA.exposureFovScale, 0.1, 1, 0.1, ((R) => {
29154
+ fA.exposureFovScale = 1 * R;
29155
+ })), this.testManager.addNumberInputTo(f, "sharpenFilter_amount", fA.sharpenFilter_amount, 0.1, 10, 0.1, ((R) => {
29156
+ fA.sharpenFilter_amount = R;
29133
29157
  }));
29134
- const M = this.testManager.addAccordion("LUTs"), F = ["Cool 5", "Cool 10", "Cool 15", "Cool 20", "Cool 25", "Warm 20", "Warm 25", "Warm 10", "Warm 15", "Warm 5", "bw"].map(((_) => ({ name: _, value: _ })));
29135
- this.testManager.addRadioGroup(M, F, this.activeLut, ((_) => {
29136
- this.activeLut = _, X.playerAPI.updateSettings({ lut: `https://cdn.visuado.com/luts/${_}.png` });
29158
+ const M = this.testManager.addAccordion("LUTs"), L = ["Cool 5", "Cool 10", "Cool 15", "Cool 20", "Cool 25", "Warm 20", "Warm 25", "Warm 10", "Warm 15", "Warm 5", "bw"].map(((R) => ({ name: R, value: R })));
29159
+ this.testManager.addRadioGroup(M, L, this.activeLut, ((R) => {
29160
+ this.activeLut = R, X.playerAPI.updateSettings({ lut: `https://cdn.visuado.com/luts/${R}.png` });
29137
29161
  })), this.testManager.addButtonTo(M, "LUT from URL", (() => {
29138
- let _ = prompt("Enter the Lut URL", "");
29139
- var L;
29140
- _ != null && (L = _, new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$", "i").test(L)) ? X.playerAPI.updateSettings({ lut: _ }) : alert("Invalid URL");
29162
+ let R = prompt("Enter the Lut URL", "");
29163
+ var F;
29164
+ R != null && (F = R, new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$", "i").test(F)) ? X.playerAPI.updateSettings({ lut: R }) : alert("Invalid URL");
29141
29165
  }));
29142
- const N = this.testManager.addAccordion("Camera Markers"), R = document.createElement("div");
29143
- R.classList.add("btn-grid"), this.testManager.addToggleButton(R, "Nav Marker IDs", fA.SHOW_NAVIGATION_MARKERS_ID, ((_) => {
29144
- fA.SHOW_NAVIGATION_MARKERS_ID = _;
29145
- })), this.testManager.addToggleButton(R, "Edit Mode", fA.NAVIGATION_MARKERS_EDIT_MODE, ((_) => {
29146
- fA.NAVIGATION_MARKERS_EDIT_MODE = _;
29147
- })), this.testManager.addToggleButton(R, "Add Markers", fA.NAVIGATION_MARKERS_ADD_MODE, ((_) => {
29148
- fA.NAVIGATION_MARKERS_ADD_MODE = _;
29149
- })), N.appendChild(R);
29150
- const G = document.createElement("div");
29151
- G.classList.add("btn-grid"), G.style.marginTop = "6px", this.testManager.addButtonTo(G, "Copy Position", (() => {
29152
- const _ = X.instance.siteManager.navigationLayer, L = _?.lastDraggedMarker;
29153
- if (L) {
29154
- const rA = L.position, tA = JSON.stringify({ x: rA.x, y: rA.y, z: rA.z });
29166
+ const G = this.testManager.addAccordion("Camera Markers"), _ = document.createElement("div");
29167
+ _.classList.add("btn-grid"), this.testManager.addToggleButton(_, "Nav Marker IDs", fA.SHOW_NAVIGATION_MARKERS_ID, ((R) => {
29168
+ fA.SHOW_NAVIGATION_MARKERS_ID = R;
29169
+ })), this.testManager.addToggleButton(_, "Edit Mode", fA.NAVIGATION_MARKERS_EDIT_MODE, ((R) => {
29170
+ fA.NAVIGATION_MARKERS_EDIT_MODE = R;
29171
+ })), this.testManager.addToggleButton(_, "Add Markers", fA.NAVIGATION_MARKERS_ADD_MODE, ((R) => {
29172
+ fA.NAVIGATION_MARKERS_ADD_MODE = R;
29173
+ })), G.appendChild(_);
29174
+ const N = document.createElement("div");
29175
+ N.classList.add("btn-grid"), N.style.marginTop = "6px", this.testManager.addButtonTo(N, "Copy Position", (() => {
29176
+ const R = X.instance.siteManager.navigationLayer, F = R?.lastDraggedMarker;
29177
+ if (F) {
29178
+ const rA = F.position, tA = JSON.stringify({ x: rA.x, y: rA.y, z: rA.z });
29155
29179
  navigator.clipboard.writeText(tA);
29156
29180
  }
29157
- })), this.testManager.addButtonTo(G, "Copy Camera Object", (() => {
29158
- const _ = X.instance.siteManager.navigationLayer, L = _?.lastDraggedMarker;
29159
- if (L && L.payload) {
29160
- const rA = JSON.stringify(this.serializeCameraToJson(L.payload), null, 2);
29181
+ })), this.testManager.addButtonTo(N, "Copy Camera Object", (() => {
29182
+ const R = X.instance.siteManager.navigationLayer, F = R?.lastDraggedMarker;
29183
+ if (F && F.payload) {
29184
+ const rA = JSON.stringify(this.serializeCameraToJson(F.payload), null, 2);
29161
29185
  navigator.clipboard.writeText(rA);
29162
29186
  }
29163
- })), this.testManager.addButtonTo(G, "Copy apartment.json", (() => {
29164
- const _ = X.instance.siteManager.siteData;
29165
- if (!_) return;
29166
- const L = Object.assign({}, _.constructorData);
29167
- L.cameras = _.cameras.map(((tA) => this.serializeCameraToJson(tA)));
29168
- const rA = JSON.stringify(L, null, 2);
29187
+ })), this.testManager.addButtonTo(N, "Copy apartment.json", (() => {
29188
+ const R = X.instance.siteManager.siteData;
29189
+ if (!R) return;
29190
+ const F = Object.assign({}, R.constructorData);
29191
+ F.cameras = R.cameras.map(((tA) => this.serializeCameraToJson(tA)));
29192
+ const rA = JSON.stringify(F, null, 2);
29169
29193
  navigator.clipboard.writeText(rA);
29170
- })), N.appendChild(G), this.cameraAccordionContent = this.testManager.addAccordion("Cameras", !0);
29194
+ })), G.appendChild(N), this.cameraAccordionContent = this.testManager.addAccordion("Cameras", !0);
29171
29195
  }
29172
29196
  serializeCameraToJson(A) {
29173
29197
  const e = ui.convertThreeToUnityCoords(A.position);