@thatopen/components 2.1.6 → 2.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -95,10 +95,10 @@ function Gs(l, s, t, e, i = null) {
95
95
  let o = 1 / 0, n = 1 / 0, r = 1 / 0, a = -1 / 0, c = -1 / 0, h = -1 / 0, d = 1 / 0, E = 1 / 0, u = 1 / 0, f = -1 / 0, R = -1 / 0, m = -1 / 0;
96
96
  const C = i !== null;
97
97
  for (let A = s * 6, F = (s + t) * 6; A < F; A += 6) {
98
- const p = l[A + 0], T = l[A + 1], g = p - T, _ = p + T;
99
- g < o && (o = g), _ > a && (a = _), C && p < d && (d = p), C && p > f && (f = p);
100
- const S = l[A + 2], N = l[A + 3], y = S - N, w = S + N;
101
- y < n && (n = y), w > c && (c = w), C && S < E && (E = S), C && S > R && (R = S);
98
+ const p = l[A + 0], T = l[A + 1], g = p - T, S = p + T;
99
+ g < o && (o = g), S > a && (a = S), C && p < d && (d = p), C && p > f && (f = p);
100
+ const _ = l[A + 2], N = l[A + 3], y = _ - N, w = _ + N;
101
+ y < n && (n = y), w > c && (c = w), C && _ < E && (E = _), C && _ > R && (R = _);
102
102
  const L = l[A + 4], U = l[A + 5], x = L - U, B = L + U;
103
103
  x < r && (r = x), B > h && (h = B), C && L < u && (u = L), C && L > m && (m = L);
104
104
  }
@@ -133,8 +133,8 @@ function ho(l, s) {
133
133
  F < T && (T = F), p < T && (T = p);
134
134
  let g = A;
135
135
  F > g && (g = F), p > g && (g = p);
136
- const _ = (g - T) / 2, S = C * 2;
137
- o[u + S + 0] = T + _, o[u + S + 1] = _ + (Math.abs(T) + _) * io, T < s[C] && (s[C] = T), g > s[C + 3] && (s[C + 3] = g);
136
+ const S = (g - T) / 2, _ = C * 2;
137
+ o[u + _ + 0] = T + S, o[u + _ + 1] = S + (Math.abs(T) + S) * io, T < s[C] && (s[C] = T), g > s[C + 3] && (s[C + 3] = g);
138
138
  }
139
139
  }
140
140
  return o;
@@ -167,11 +167,11 @@ function uo(l, s, t, e, i, o) {
167
167
  T.candidate = t[p + 2 * E], T.count = 0;
168
168
  const {
169
169
  bounds: g,
170
- leftCacheBounds: _,
171
- rightCacheBounds: S
170
+ leftCacheBounds: S,
171
+ rightCacheBounds: _
172
172
  } = T;
173
173
  for (let N = 0; N < 3; N++)
174
- S[N] = 1 / 0, S[N + 3] = -1 / 0, _[N] = 1 / 0, _[N + 3] = -1 / 0, g[N] = 1 / 0, g[N + 3] = -1 / 0;
174
+ _[N] = 1 / 0, _[N + 3] = -1 / 0, S[N] = 1 / 0, S[N + 3] = -1 / 0, g[N] = 1 / 0, g[N + 3] = -1 / 0;
175
175
  Qe(p, t, g);
176
176
  }
177
177
  C.sort(Eo);
@@ -184,17 +184,17 @@ function uo(l, s, t, e, i, o) {
184
184
  for (let p = h; p < d; p += 6) {
185
185
  const T = t[p + 2 * E];
186
186
  for (let g = 0; g < F; g++) {
187
- const _ = C[g];
188
- T >= _.candidate ? Qe(p, t, _.rightCacheBounds) : (Qe(p, t, _.leftCacheBounds), _.count++);
187
+ const S = C[g];
188
+ T >= S.candidate ? Qe(p, t, S.rightCacheBounds) : (Qe(p, t, S.leftCacheBounds), S.count++);
189
189
  }
190
190
  }
191
191
  for (let p = 0; p < F; p++) {
192
- const T = C[p], g = T.count, _ = i - T.count, S = T.leftCacheBounds, N = T.rightCacheBounds;
192
+ const T = C[p], g = T.count, S = i - T.count, _ = T.leftCacheBounds, N = T.rightCacheBounds;
193
193
  let y = 0;
194
- g !== 0 && (y = Ae(S) / a);
194
+ g !== 0 && (y = Ae(_) / a);
195
195
  let w = 0;
196
- _ !== 0 && (w = Ae(N) / a);
197
- const L = bi + Ys * (y * g + w * _);
196
+ S !== 0 && (w = Ae(N) / a);
197
+ const L = bi + Ys * (y * g + w * S);
198
198
  L < c && (n = E, c = L, r = T.candidate);
199
199
  }
200
200
  } else {
@@ -208,8 +208,8 @@ function uo(l, s, t, e, i, o) {
208
208
  for (let F = h; F < d; F += 6) {
209
209
  let g = ~~((t[F + 2 * E] - u) / m);
210
210
  g >= Mt && (g = Mt - 1);
211
- const _ = Ut[g];
212
- _.count++, Qe(F, t, _.bounds);
211
+ const S = Ut[g];
212
+ S.count++, Qe(F, t, S.bounds);
213
213
  }
214
214
  const C = Ut[Mt - 1];
215
215
  Bi(C.bounds, C.rightCacheBounds);
@@ -219,12 +219,12 @@ function uo(l, s, t, e, i, o) {
219
219
  }
220
220
  let A = 0;
221
221
  for (let F = 0; F < Mt - 1; F++) {
222
- const p = Ut[F], T = p.count, g = p.bounds, S = Ut[F + 1].rightCacheBounds;
222
+ const p = Ut[F], T = p.count, g = p.bounds, _ = Ut[F + 1].rightCacheBounds;
223
223
  T !== 0 && (A === 0 ? Bi(g, je) : Yi(g, je, je)), A += T;
224
224
  let N = 0, y = 0;
225
225
  A !== 0 && (N = Ae(je) / a);
226
226
  const w = i - A;
227
- w !== 0 && (y = Ae(S) / a);
227
+ w !== 0 && (y = Ae(_) / a);
228
228
  const L = bi + Ys * (N * A + y * w);
229
229
  L < c && (n = E, c = L, r = p.candidate);
230
230
  }
@@ -308,10 +308,10 @@ function To(l, s) {
308
308
  function A(p) {
309
309
  a && a(p / c);
310
310
  }
311
- function F(p, T, g, _ = null, S = 0) {
312
- if (!d && S >= i && (d = !0, o && (console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`), console.warn(t))), g <= n || S >= i)
311
+ function F(p, T, g, S = null, _ = 0) {
312
+ if (!d && _ >= i && (d = !0, o && (console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`), console.warn(t))), g <= n || _ >= i)
313
313
  return A(T + g), p.offset = T, p.count = g, p;
314
- const N = uo(p.boundingData, _, f, T, g, r);
314
+ const N = uo(p.boundingData, S, f, T, g, r);
315
315
  if (N.axis === -1)
316
316
  return A(T + g), p.offset = T, p.count = g, p;
317
317
  const y = R(h, e, f, T, g, N);
@@ -320,9 +320,9 @@ function To(l, s) {
320
320
  else {
321
321
  p.splitAxis = N.axis;
322
322
  const w = new qe(), L = T, U = y - T;
323
- p.left = w, w.boundingData = new Float32Array(6), Gs(f, L, U, w.boundingData, u), F(w, L, U, u, S + 1);
323
+ p.left = w, w.boundingData = new Float32Array(6), Gs(f, L, U, w.boundingData, u), F(w, L, U, u, _ + 1);
324
324
  const x = new qe(), B = y, H = g - U;
325
- p.right = x, x.boundingData = new Float32Array(6), Gs(f, B, H, x.boundingData, u), F(x, B, H, u, S + 1);
325
+ p.right = x, x.boundingData = new Float32Array(6), Gs(f, B, H, x.boundingData, u), F(x, B, H, u, _ + 1);
326
326
  }
327
327
  return p;
328
328
  }
@@ -493,17 +493,17 @@ Ft.prototype.intersectsTriangle = function() {
493
493
  const A = R.points;
494
494
  let F = 0, p = -1;
495
495
  for (let T = 0; T < 3; T++) {
496
- const { start: g, end: _ } = h;
497
- g.copy(A[T]), _.copy(A[(T + 1) % 3]), h.delta(n);
498
- const S = zs(m.distanceToPoint(g));
499
- if (zs(m.normal.dot(n)) && S) {
496
+ const { start: g, end: S } = h;
497
+ g.copy(A[T]), S.copy(A[(T + 1) % 3]), h.delta(n);
498
+ const _ = zs(m.distanceToPoint(g));
499
+ if (zs(m.normal.dot(n)) && _) {
500
500
  C.copy(h), F = 2;
501
501
  break;
502
502
  }
503
503
  const N = m.intersectLine(h, u);
504
- if (!N && S && u.copy(g), (N || S) && !zs(u.distanceTo(_))) {
504
+ if (!N && _ && u.copy(g), (N || _) && !zs(u.distanceTo(S))) {
505
505
  if (F <= 1)
506
- (F === 1 ? C.start : C.end).copy(u), S && (p = F);
506
+ (F === 1 ? C.start : C.end).copy(u), _ && (p = F);
507
507
  else if (F >= 2) {
508
508
  (p === 1 ? C.start : C.end).copy(u), F = 2;
509
509
  break;
@@ -525,17 +525,17 @@ Ft.prototype.intersectsTriangle = function() {
525
525
  if (e.setFromPoints(w, t), y.isSeparated(e))
526
526
  return !1;
527
527
  }
528
- const _ = m.satBounds, S = m.satAxes;
528
+ const S = m.satBounds, _ = m.satAxes;
529
529
  s[0] = this.a, s[1] = this.b, s[2] = this.c;
530
530
  for (let N = 0; N < 4; N++) {
531
- const y = _[N], w = S[N];
531
+ const y = S[N], w = _[N];
532
532
  if (e.setFromPoints(w, s), y.isSeparated(e))
533
533
  return !1;
534
534
  }
535
535
  for (let N = 0; N < 4; N++) {
536
536
  const y = g[N];
537
537
  for (let w = 0; w < 4; w++) {
538
- const L = S[w];
538
+ const L = _[w];
539
539
  if (o.crossVectors(y, L), e.setFromPoints(o, s), i.setFromPoints(o, t), e.isSeparated(i))
540
540
  return !1;
541
541
  }
@@ -556,8 +556,8 @@ Ft.prototype.intersectsTriangle = function() {
556
556
  let U = E.start;
557
557
  E.start = E.end, E.end = U;
558
558
  }
559
- const _ = d.start.dot(r), S = d.end.dot(r), N = E.start.dot(r), y = E.end.dot(r), w = S < N, L = _ < y;
560
- return _ !== y && N !== S && w === L ? !1 : (C && (c.subVectors(d.start, E.start), c.dot(r) > 0 ? C.start.copy(d.start) : C.start.copy(E.start), c.subVectors(d.end, E.end), c.dot(r) < 0 ? C.end.copy(d.end) : C.end.copy(E.end)), !0);
559
+ const S = d.start.dot(r), _ = d.end.dot(r), N = E.start.dot(r), y = E.end.dot(r), w = _ < N, L = S < y;
560
+ return S !== y && N !== _ && w === L ? !1 : (C && (c.subVectors(d.start, E.start), c.dot(r) > 0 ? C.start.copy(d.start) : C.start.copy(E.start), c.subVectors(d.end, E.end), c.dot(r) < 0 ? C.end.copy(d.end) : C.end.copy(E.end)), !0);
561
561
  }
562
562
  };
563
563
  }();
@@ -695,8 +695,8 @@ at.prototype.distanceToBox = function() {
695
695
  for (let m = 0; m < 3; m++)
696
696
  for (let C = 0; C <= 1; C++)
697
697
  for (let A = 0; A <= 1; A++) {
698
- const F = (m + 1) % 3, p = (m + 2) % 3, T = C << F | A << p, g = 1 << m | C << F | A << p, _ = u[T], S = u[g];
699
- s[R].set(_, S);
698
+ const F = (m + 1) % 3, p = (m + 2) % 3, T = C << F | A << p, g = 1 << m | C << F | A << p, S = u[T], _ = u[g];
699
+ s[R].set(S, _);
700
700
  const y = l[m], w = l[F], L = l[p], U = t[R], x = U.start, B = U.end;
701
701
  x[y] = d[y], x[w] = C ? d[w] : E[w], x[L] = A ? d[L] : E[w], B[y] = E[y], B[w] = C ? d[w] : E[w], B[L] = A ? d[L] : E[w], R++;
702
702
  }
@@ -772,7 +772,7 @@ class Oo {
772
772
  const Z = new Oo();
773
773
  let Yt, Ie;
774
774
  const Jt = [], Ke = /* @__PURE__ */ new Oi(() => new gt());
775
- function _o(l, s, t, e, i, o) {
775
+ function So(l, s, t, e, i, o) {
776
776
  Yt = Ke.getPrimitive(), Ie = Ke.getPrimitive(), Jt.push(Yt, Ie), Z.setBuffer(l._roots[s]);
777
777
  const n = ai(0, l.geometry, t, e, i, o);
778
778
  Z.clearBuffer(), Ke.releasePrimitive(Yt), Ke.releasePrimitive(Ie), Jt.pop(), Jt.pop();
@@ -825,13 +825,13 @@ function ai(l, s, t, e, i = null, o = 0, n = 0) {
825
825
  if (g)
826
826
  return !0;
827
827
  F = Ie, K(R, r, F);
828
- const _ = Et(R * 2, a), S = t(F, _, C, n + 1, o + R);
828
+ const S = Et(R * 2, a), _ = t(F, S, C, n + 1, o + R);
829
829
  let N;
830
- if (S === xi) {
830
+ if (_ === xi) {
831
831
  const L = y(R), x = w(R) - L;
832
832
  N = e(L, x, !0, n + 1, o + R, F);
833
833
  } else
834
- N = S && ai(
834
+ N = _ && ai(
835
835
  R,
836
836
  s,
837
837
  t,
@@ -844,7 +844,7 @@ function ai(l, s, t, e, i = null, o = 0, n = 0) {
844
844
  }
845
845
  }
846
846
  const Fe = /* @__PURE__ */ new M(), Hs = /* @__PURE__ */ new M();
847
- function So(l, s, t = {}, e = 0, i = 1 / 0) {
847
+ function _o(l, s, t = {}, e = 0, i = 1 / 0) {
848
848
  const o = e * e, n = i * i;
849
849
  let r = 1 / 0, a = null;
850
850
  if (l.shapecast(
@@ -933,20 +933,20 @@ function wo(l, s = null) {
933
933
  const R = E * 2;
934
934
  if (r[R + 15] === Us) {
935
935
  const C = n[E + 6], A = r[R + 14];
936
- let F = 1 / 0, p = 1 / 0, T = 1 / 0, g = -1 / 0, _ = -1 / 0, S = -1 / 0;
936
+ let F = 1 / 0, p = 1 / 0, T = 1 / 0, g = -1 / 0, S = -1 / 0, _ = -1 / 0;
937
937
  for (let N = 3 * C, y = 3 * (C + A); N < y; N++) {
938
938
  let w = e[N];
939
939
  const L = i.getX(w), U = i.getY(w), x = i.getZ(w);
940
- L < F && (F = L), L > g && (g = L), U < p && (p = U), U > _ && (_ = U), x < T && (T = x), x > S && (S = x);
940
+ L < F && (F = L), L > g && (g = L), U < p && (p = U), U > S && (S = U), x < T && (T = x), x > _ && (_ = x);
941
941
  }
942
- return a[E + 0] !== F || a[E + 1] !== p || a[E + 2] !== T || a[E + 3] !== g || a[E + 4] !== _ || a[E + 5] !== S ? (a[E + 0] = F, a[E + 1] = p, a[E + 2] = T, a[E + 3] = g, a[E + 4] = _, a[E + 5] = S, !0) : !1;
942
+ return a[E + 0] !== F || a[E + 1] !== p || a[E + 2] !== T || a[E + 3] !== g || a[E + 4] !== S || a[E + 5] !== _ ? (a[E + 0] = F, a[E + 1] = p, a[E + 2] = T, a[E + 3] = g, a[E + 4] = S, a[E + 5] = _, !0) : !1;
943
943
  } else {
944
944
  const C = E + 8, A = n[E + 6], F = C + u, p = A + u;
945
- let T = f, g = !1, _ = !1;
946
- s ? T || (g = s.has(F), _ = s.has(p), T = !g && !_) : (g = !0, _ = !0);
947
- const S = T || g, N = T || _;
945
+ let T = f, g = !1, S = !1;
946
+ s ? T || (g = s.has(F), S = s.has(p), T = !g && !S) : (g = !0, S = !0);
947
+ const _ = T || g, N = T || S;
948
948
  let y = !1;
949
- S && (y = d(C, u, T));
949
+ _ && (y = d(C, u, T));
950
950
  let w = !1;
951
951
  N && (w = d(A, u, T));
952
952
  const L = y || w;
@@ -1076,14 +1076,14 @@ function ko(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1076
1076
  return ns.copy(t).invert(), Oe.matrix.copy(ns), l.shapecast(
1077
1077
  {
1078
1078
  boundsTraverseOrder: (T) => ks.distanceToBox(T),
1079
- intersectsBounds: (T, g, _) => _ < A && _ < n ? (g && (Oe.min.copy(T.min), Oe.max.copy(T.max), Oe.needsUpdate = !0), !0) : !1,
1079
+ intersectsBounds: (T, g, S) => S < A && S < n ? (g && (Oe.min.copy(T.min), Oe.max.copy(T.max), Oe.needsUpdate = !0), !0) : !1,
1080
1080
  intersectsRange: (T, g) => {
1081
1081
  if (s.boundsTree)
1082
1082
  return s.boundsTree.shapecast({
1083
- boundsTraverseOrder: (S) => Oe.distanceToBox(S),
1084
- intersectsBounds: (S, N, y) => y < A && y < n,
1085
- intersectsRange: (S, N) => {
1086
- for (let y = S, w = S + N; y < w; y++) {
1083
+ boundsTraverseOrder: (_) => Oe.distanceToBox(_),
1084
+ intersectsBounds: (_, N, y) => y < A && y < n,
1085
+ intersectsRange: (_, N) => {
1086
+ for (let y = _, w = _ + N; y < w; y++) {
1087
1087
  tt(u, 3 * y, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1088
1088
  for (let L = T, U = T + g; L < U; L++) {
1089
1089
  tt(E, 3 * L, c, a), E.needsUpdate = !0;
@@ -1095,13 +1095,13 @@ function ko(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1095
1095
  }
1096
1096
  });
1097
1097
  {
1098
- const _ = Ce(s);
1099
- for (let S = 0, N = _; S < N; S++) {
1100
- tt(u, 3 * S, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1098
+ const S = Ce(s);
1099
+ for (let _ = 0, N = S; _ < N; _++) {
1100
+ tt(u, 3 * _, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1101
1101
  for (let y = T, w = T + g; y < w; y++) {
1102
1102
  tt(E, 3 * y, c, a), E.needsUpdate = !0;
1103
1103
  const L = E.distanceToTriangle(u, f, m);
1104
- if (L < A && (R.copy(f), C && C.copy(m), A = L, F = y, p = S), L < o)
1104
+ if (L < A && (R.copy(f), C && C.copy(m), A = L, F = y, p = _), L < o)
1105
1105
  return !0;
1106
1106
  }
1107
1107
  }
@@ -1121,24 +1121,24 @@ function Wo(l, s = null) {
1121
1121
  const R = E * 2;
1122
1122
  if (r[R + 15] === Us) {
1123
1123
  const C = n[E + 6], A = r[R + 14];
1124
- let F = 1 / 0, p = 1 / 0, T = 1 / 0, g = -1 / 0, _ = -1 / 0, S = -1 / 0;
1124
+ let F = 1 / 0, p = 1 / 0, T = 1 / 0, g = -1 / 0, S = -1 / 0, _ = -1 / 0;
1125
1125
  for (let N = C, y = C + A; N < y; N++) {
1126
1126
  const w = 3 * l.resolveTriangleIndex(N);
1127
1127
  for (let L = 0; L < 3; L++) {
1128
1128
  let U = w + L;
1129
1129
  U = e ? e[U] : U;
1130
1130
  const x = i.getX(U), B = i.getY(U), H = i.getZ(U);
1131
- x < F && (F = x), x > g && (g = x), B < p && (p = B), B > _ && (_ = B), H < T && (T = H), H > S && (S = H);
1131
+ x < F && (F = x), x > g && (g = x), B < p && (p = B), B > S && (S = B), H < T && (T = H), H > _ && (_ = H);
1132
1132
  }
1133
1133
  }
1134
- return a[E + 0] !== F || a[E + 1] !== p || a[E + 2] !== T || a[E + 3] !== g || a[E + 4] !== _ || a[E + 5] !== S ? (a[E + 0] = F, a[E + 1] = p, a[E + 2] = T, a[E + 3] = g, a[E + 4] = _, a[E + 5] = S, !0) : !1;
1134
+ return a[E + 0] !== F || a[E + 1] !== p || a[E + 2] !== T || a[E + 3] !== g || a[E + 4] !== S || a[E + 5] !== _ ? (a[E + 0] = F, a[E + 1] = p, a[E + 2] = T, a[E + 3] = g, a[E + 4] = S, a[E + 5] = _, !0) : !1;
1135
1135
  } else {
1136
1136
  const C = E + 8, A = n[E + 6], F = C + u, p = A + u;
1137
- let T = f, g = !1, _ = !1;
1138
- s ? T || (g = s.has(F), _ = s.has(p), T = !g && !_) : (g = !0, _ = !0);
1139
- const S = T || g, N = T || _;
1137
+ let T = f, g = !1, S = !1;
1138
+ s ? T || (g = s.has(F), S = s.has(p), T = !g && !S) : (g = !0, S = !0);
1139
+ const _ = T || g, N = T || S;
1140
1140
  let y = !1;
1141
- S && (y = d(C, u, T));
1141
+ _ && (y = d(C, u, T));
1142
1142
  let w = !1;
1143
1143
  N && (w = d(A, u, T));
1144
1144
  const L = y || w;
@@ -1196,7 +1196,7 @@ function di(l, s, t, e) {
1196
1196
  return m && A ? m.distance <= A.distance ? m : A : m || A || null;
1197
1197
  }
1198
1198
  }
1199
- const os = /* @__PURE__ */ new gt(), oe = /* @__PURE__ */ new Ft(), re = /* @__PURE__ */ new Ft(), _e = /* @__PURE__ */ new Lt(), ji = /* @__PURE__ */ new at(), rs = /* @__PURE__ */ new at();
1199
+ const os = /* @__PURE__ */ new gt(), oe = /* @__PURE__ */ new Ft(), re = /* @__PURE__ */ new Ft(), Se = /* @__PURE__ */ new Lt(), ji = /* @__PURE__ */ new at(), rs = /* @__PURE__ */ new at();
1200
1200
  function jo(l, s, t, e) {
1201
1201
  Z.setBuffer(l._roots[s]);
1202
1202
  const i = ui(0, l, t, e);
@@ -1207,8 +1207,8 @@ function ui(l, s, t, e, i = null) {
1207
1207
  let a = l * 2;
1208
1208
  if (i === null && (t.boundingBox || t.computeBoundingBox(), ji.set(t.boundingBox.min, t.boundingBox.max, e), i = ji), Et(a, n)) {
1209
1209
  const h = s.geometry, d = h.index, E = h.attributes.position, u = t.index, f = t.attributes.position, R = dt(l, r), m = ft(a, n);
1210
- if (_e.copy(e).invert(), t.boundsTree)
1211
- return K(l, o, rs), rs.matrix.copy(_e), rs.needsUpdate = !0, t.boundsTree.shapecast({
1210
+ if (Se.copy(e).invert(), t.boundsTree)
1211
+ return K(l, o, rs), rs.matrix.copy(Se), rs.needsUpdate = !0, t.boundsTree.shapecast({
1212
1212
  intersectsBounds: (A) => rs.intersectsBox(A),
1213
1213
  intersectsTriangle: (A) => {
1214
1214
  A.a.applyMatrix4(e), A.b.applyMatrix4(e), A.c.applyMatrix4(e), A.needsUpdate = !0;
@@ -1220,7 +1220,7 @@ function ui(l, s, t, e, i = null) {
1220
1220
  });
1221
1221
  for (let C = R, A = m + R; C < A; C++) {
1222
1222
  const F = s.resolveTriangleIndex(C);
1223
- tt(oe, 3 * F, d, E), oe.a.applyMatrix4(_e), oe.b.applyMatrix4(_e), oe.c.applyMatrix4(_e), oe.needsUpdate = !0;
1223
+ tt(oe, 3 * F, d, E), oe.a.applyMatrix4(Se), oe.b.applyMatrix4(Se), oe.c.applyMatrix4(Se), oe.needsUpdate = !0;
1224
1224
  for (let p = 0, T = u.count; p < T; p += 3)
1225
1225
  if (tt(re, p, u, f), re.needsUpdate = !0, oe.intersectsTriangle(re))
1226
1226
  return !0;
@@ -1230,26 +1230,26 @@ function ui(l, s, t, e, i = null) {
1230
1230
  return K(h, o, os), !!(i.intersectsBox(os) && ui(h, s, t, e, i) || (K(d, o, os), i.intersectsBox(os) && ui(d, s, t, e, i)));
1231
1231
  }
1232
1232
  }
1233
- const as = /* @__PURE__ */ new Lt(), Ws = /* @__PURE__ */ new at(), Se = /* @__PURE__ */ new at(), qo = /* @__PURE__ */ new M(), Ko = /* @__PURE__ */ new M(), $o = /* @__PURE__ */ new M(), Jo = /* @__PURE__ */ new M();
1233
+ const as = /* @__PURE__ */ new Lt(), Ws = /* @__PURE__ */ new at(), _e = /* @__PURE__ */ new at(), qo = /* @__PURE__ */ new M(), Ko = /* @__PURE__ */ new M(), $o = /* @__PURE__ */ new M(), Jo = /* @__PURE__ */ new M();
1234
1234
  function tr(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1235
1235
  s.boundingBox || s.computeBoundingBox(), Ws.set(s.boundingBox.min, s.boundingBox.max, t), Ws.needsUpdate = !0;
1236
1236
  const r = l.geometry, a = r.attributes.position, c = r.index, h = s.attributes.position, d = s.index, E = It.getPrimitive(), u = It.getPrimitive();
1237
1237
  let f = qo, R = Ko, m = null, C = null;
1238
1238
  i && (m = $o, C = Jo);
1239
1239
  let A = 1 / 0, F = null, p = null;
1240
- return as.copy(t).invert(), Se.matrix.copy(as), l.shapecast(
1240
+ return as.copy(t).invert(), _e.matrix.copy(as), l.shapecast(
1241
1241
  {
1242
1242
  boundsTraverseOrder: (T) => Ws.distanceToBox(T),
1243
- intersectsBounds: (T, g, _) => _ < A && _ < n ? (g && (Se.min.copy(T.min), Se.max.copy(T.max), Se.needsUpdate = !0), !0) : !1,
1243
+ intersectsBounds: (T, g, S) => S < A && S < n ? (g && (_e.min.copy(T.min), _e.max.copy(T.max), _e.needsUpdate = !0), !0) : !1,
1244
1244
  intersectsRange: (T, g) => {
1245
1245
  if (s.boundsTree) {
1246
- const _ = s.boundsTree;
1247
- return _.shapecast({
1248
- boundsTraverseOrder: (S) => Se.distanceToBox(S),
1249
- intersectsBounds: (S, N, y) => y < A && y < n,
1250
- intersectsRange: (S, N) => {
1251
- for (let y = S, w = S + N; y < w; y++) {
1252
- const L = _.resolveTriangleIndex(y);
1246
+ const S = s.boundsTree;
1247
+ return S.shapecast({
1248
+ boundsTraverseOrder: (_) => _e.distanceToBox(_),
1249
+ intersectsBounds: (_, N, y) => y < A && y < n,
1250
+ intersectsRange: (_, N) => {
1251
+ for (let y = _, w = _ + N; y < w; y++) {
1252
+ const L = S.resolveTriangleIndex(y);
1253
1253
  tt(u, 3 * L, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1254
1254
  for (let U = T, x = T + g; U < x; U++) {
1255
1255
  const B = l.resolveTriangleIndex(U);
@@ -1262,14 +1262,14 @@ function tr(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1262
1262
  }
1263
1263
  });
1264
1264
  } else {
1265
- const _ = Ce(s);
1266
- for (let S = 0, N = _; S < N; S++) {
1267
- tt(u, 3 * S, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1265
+ const S = Ce(s);
1266
+ for (let _ = 0, N = S; _ < N; _++) {
1267
+ tt(u, 3 * _, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1268
1268
  for (let y = T, w = T + g; y < w; y++) {
1269
1269
  const L = l.resolveTriangleIndex(y);
1270
1270
  tt(E, 3 * L, c, a), E.needsUpdate = !0;
1271
1271
  const U = E.distanceToTriangle(u, f, m);
1272
- if (U < A && (R.copy(f), C && C.copy(m), A = U, F = y, p = S), U < o)
1272
+ if (U < A && (R.copy(f), C && C.copy(m), A = U, F = y, p = _), U < o)
1273
1273
  return !0;
1274
1274
  }
1275
1275
  }
@@ -1316,9 +1316,9 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1316
1316
  let d, E;
1317
1317
  h ? (d = As, E = be) : (d = be, E = As);
1318
1318
  const u = d.float32Array, f = d.uint32Array, R = d.uint16Array, m = E.float32Array, C = E.uint32Array, A = E.uint16Array, F = l * 2, p = s * 2, T = Et(F, R), g = Et(p, A);
1319
- let _ = !1;
1319
+ let S = !1;
1320
1320
  if (g && T)
1321
- h ? _ = i(
1321
+ h ? S = i(
1322
1322
  dt(s, C),
1323
1323
  ft(s * 2, A),
1324
1324
  dt(l, f),
@@ -1327,7 +1327,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1327
1327
  n + s,
1328
1328
  r,
1329
1329
  o + l
1330
- ) : _ = i(
1330
+ ) : S = i(
1331
1331
  dt(l, f),
1332
1332
  ft(l * 2, R),
1333
1333
  dt(s, C),
@@ -1338,12 +1338,12 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1338
1338
  n + s
1339
1339
  );
1340
1340
  else if (g) {
1341
- const S = vt.getPrimitive();
1342
- K(s, m, S), S.applyMatrix4(t);
1341
+ const _ = vt.getPrimitive();
1342
+ K(s, m, _), _.applyMatrix4(t);
1343
1343
  const N = pt(l), y = Ct(l, f);
1344
1344
  K(N, u, ae), K(y, u, ce);
1345
- const w = S.intersectsBox(ae), L = S.intersectsBox(ce);
1346
- _ = w && Tt(
1345
+ const w = _.intersectsBox(ae), L = _.intersectsBox(ce);
1346
+ S = w && Tt(
1347
1347
  s,
1348
1348
  N,
1349
1349
  e,
@@ -1353,7 +1353,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1353
1353
  o,
1354
1354
  a,
1355
1355
  r + 1,
1356
- S,
1356
+ _,
1357
1357
  !h
1358
1358
  ) || L && Tt(
1359
1359
  s,
@@ -1365,17 +1365,17 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1365
1365
  o,
1366
1366
  a,
1367
1367
  r + 1,
1368
- S,
1368
+ _,
1369
1369
  !h
1370
- ), vt.releasePrimitive(S);
1370
+ ), vt.releasePrimitive(_);
1371
1371
  } else {
1372
- const S = pt(s), N = Ct(s, C);
1373
- K(S, m, Xs), K(N, m, Zs);
1372
+ const _ = pt(s), N = Ct(s, C);
1373
+ K(_, m, Xs), K(N, m, Zs);
1374
1374
  const y = c.intersectsBox(Xs), w = c.intersectsBox(Zs);
1375
1375
  if (y && w)
1376
- _ = Tt(
1376
+ S = Tt(
1377
1377
  l,
1378
- S,
1378
+ _,
1379
1379
  t,
1380
1380
  e,
1381
1381
  i,
@@ -1400,9 +1400,9 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1400
1400
  );
1401
1401
  else if (y)
1402
1402
  if (T)
1403
- _ = Tt(
1403
+ S = Tt(
1404
1404
  l,
1405
- S,
1405
+ _,
1406
1406
  t,
1407
1407
  e,
1408
1408
  i,
@@ -1419,8 +1419,8 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1419
1419
  const U = pt(l), x = Ct(l, f);
1420
1420
  K(U, u, ae), K(x, u, ce);
1421
1421
  const B = L.intersectsBox(ae), H = L.intersectsBox(ce);
1422
- _ = B && Tt(
1423
- S,
1422
+ S = B && Tt(
1423
+ _,
1424
1424
  U,
1425
1425
  e,
1426
1426
  t,
@@ -1432,7 +1432,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1432
1432
  L,
1433
1433
  !h
1434
1434
  ) || H && Tt(
1435
- S,
1435
+ _,
1436
1436
  x,
1437
1437
  e,
1438
1438
  t,
@@ -1447,7 +1447,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1447
1447
  }
1448
1448
  else if (w)
1449
1449
  if (T)
1450
- _ = Tt(
1450
+ S = Tt(
1451
1451
  l,
1452
1452
  N,
1453
1453
  t,
@@ -1466,7 +1466,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1466
1466
  const U = pt(l), x = Ct(l, f);
1467
1467
  K(U, u, ae), K(x, u, ce);
1468
1468
  const B = L.intersectsBox(ae), H = L.intersectsBox(ce);
1469
- _ = B && Tt(
1469
+ S = B && Tt(
1470
1470
  N,
1471
1471
  U,
1472
1472
  e,
@@ -1493,10 +1493,10 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1493
1493
  ), vt.releasePrimitive(L);
1494
1494
  }
1495
1495
  }
1496
- return _;
1496
+ return S;
1497
1497
  }
1498
1498
  const cs = /* @__PURE__ */ new at(), qi = /* @__PURE__ */ new gt();
1499
- class _i {
1499
+ class Si {
1500
1500
  static serialize(s, t = {}) {
1501
1501
  t = {
1502
1502
  cloneBuffers: !0,
@@ -1520,7 +1520,7 @@ class _i {
1520
1520
  indirect: !!s.indirectBuffer,
1521
1521
  ...e
1522
1522
  };
1523
- const { index: i, roots: o, indirectBuffer: n } = s, r = new _i(t, { ...e, [Vs]: !0 });
1523
+ const { index: i, roots: o, indirectBuffer: n } = s, r = new Si(t, { ...e, [Vs]: !0 });
1524
1524
  if (r._roots = o, r._indirectBuffer = n || null, e.setIndex) {
1525
1525
  const a = t.getIndex();
1526
1526
  if (a === null) {
@@ -1622,7 +1622,7 @@ class _i {
1622
1622
  const h = this._roots;
1623
1623
  for (let d = 0, E = h.length; d < E; d++) {
1624
1624
  const u = h[d];
1625
- if (a = _o(this, d, o, n, i, c), a)
1625
+ if (a = So(this, d, o, n, i, c), a)
1626
1626
  break;
1627
1627
  c += u.byteLength;
1628
1628
  }
@@ -1646,18 +1646,18 @@ class _i {
1646
1646
  };
1647
1647
  if (o) {
1648
1648
  const f = (R, m, C, A, F, p, T, g) => {
1649
- for (let _ = C, S = C + A; _ < S; _++) {
1650
- u(_), h.a.applyMatrix4(t), h.b.applyMatrix4(t), h.c.applyMatrix4(t), h.needsUpdate = !0;
1649
+ for (let S = C, _ = C + A; S < _; S++) {
1650
+ u(S), h.a.applyMatrix4(t), h.b.applyMatrix4(t), h.c.applyMatrix4(t), h.needsUpdate = !0;
1651
1651
  for (let N = R, y = R + m; N < y; N++)
1652
- if (c(N), n.needsUpdate = !0, o(n, h, N, _, F, p, T, g))
1652
+ if (c(N), n.needsUpdate = !0, o(n, h, N, S, F, p, T, g))
1653
1653
  return !0;
1654
1654
  }
1655
1655
  return !1;
1656
1656
  };
1657
1657
  if (i) {
1658
1658
  const R = i;
1659
- i = function(m, C, A, F, p, T, g, _) {
1660
- return R(m, C, A, F, p, T, g, _) ? !0 : f(m, C, A, F, p, T, g, _);
1659
+ i = function(m, C, A, F, p, T, g, S) {
1660
+ return R(m, C, A, F, p, T, g, S) ? !0 : f(m, C, A, F, p, T, g, S);
1661
1661
  };
1662
1662
  } else
1663
1663
  i = f;
@@ -1693,7 +1693,7 @@ class _i {
1693
1693
  );
1694
1694
  }
1695
1695
  closestPointToPoint(s, t = {}, e = 0, i = 1 / 0) {
1696
- return So(
1696
+ return _o(
1697
1697
  this,
1698
1698
  s,
1699
1699
  t,
@@ -1731,7 +1731,7 @@ function nr(l, s) {
1731
1731
  ir.call(this, l, s);
1732
1732
  }
1733
1733
  function or(l) {
1734
- return this.boundsTree = new _i(this, l), this.boundsTree;
1734
+ return this.boundsTree = new Si(this, l), this.boundsTree;
1735
1735
  }
1736
1736
  function rr() {
1737
1737
  this.boundsTree = null;
@@ -1794,7 +1794,7 @@ class Ts {
1794
1794
  this.handlers.length = 0;
1795
1795
  }
1796
1796
  }
1797
- class Si {
1797
+ class _i {
1798
1798
  constructor(s) {
1799
1799
  /** Whether is component is {@link Disposable}. */
1800
1800
  I(this, "isDisposeable", () => "dispose" in this && "onDisposed" in this);
@@ -1809,9 +1809,9 @@ class Si {
1809
1809
  this.components = s;
1810
1810
  }
1811
1811
  }
1812
- class et extends Si {
1812
+ class et extends _i {
1813
1813
  }
1814
- class Ni extends Si {
1814
+ class Ni extends _i {
1815
1815
  constructor(t) {
1816
1816
  super(t);
1817
1817
  I(this, "worlds", /* @__PURE__ */ new Map());
@@ -2404,16 +2404,16 @@ function Tr(l) {
2404
2404
  f.divideScalar(R), m /= R, C /= R, A /= R, F /= R, p /= R, T /= R, m -= f.x * f.x, C -= f.x * f.y, A -= f.x * f.z, F -= f.y * f.y, p -= f.y * f.z, T -= f.z * f.z;
2405
2405
  const g = new O.Matrix3();
2406
2406
  g.elements[0] = m, g.elements[1] = C, g.elements[2] = A, g.elements[3] = C, g.elements[4] = F, g.elements[5] = p, g.elements[6] = A, g.elements[7] = p, g.elements[8] = T, Cr(g, e);
2407
- const _ = e.unitary, S = new O.Vector3(), N = new O.Vector3(), y = new O.Vector3();
2408
- _.extractBasis(S, N, y);
2407
+ const S = e.unitary, _ = new O.Vector3(), N = new O.Vector3(), y = new O.Vector3();
2408
+ S.extractBasis(_, N, y);
2409
2409
  let w = -1 / 0, L = -1 / 0, U = -1 / 0, x = 1 / 0, B = 1 / 0, H = 1 / 0;
2410
2410
  for (let it = 0, Xt = s.length; it < Xt; it++) {
2411
2411
  const J = s[it];
2412
- w = Math.max(S.dot(J), w), L = Math.max(N.dot(J), L), U = Math.max(y.dot(J), U), x = Math.min(S.dot(J), x), B = Math.min(N.dot(J), B), H = Math.min(y.dot(J), H);
2412
+ w = Math.max(_.dot(J), w), L = Math.max(N.dot(J), L), U = Math.max(y.dot(J), U), x = Math.min(_.dot(J), x), B = Math.min(N.dot(J), B), H = Math.min(y.dot(J), H);
2413
2413
  }
2414
- S.multiplyScalar(0.5 * (x + w)), N.multiplyScalar(0.5 * (B + L)), y.multiplyScalar(0.5 * (H + U));
2414
+ _.multiplyScalar(0.5 * (x + w)), N.multiplyScalar(0.5 * (B + L)), y.multiplyScalar(0.5 * (H + U));
2415
2415
  const q = new O.Vector3(), st = new O.Vector3(), Q = new O.Matrix3();
2416
- q.add(S).add(N).add(y), st.x = w - x, st.y = L - B, st.z = U - H, st.multiplyScalar(0.5), Q.copy(_);
2416
+ q.add(_).add(N).add(y), st.x = w - x, st.y = L - B, st.z = U - H, st.multiplyScalar(0.5), Q.copy(S);
2417
2417
  const { x: Ht, y: kt, z: Wt } = st, We = new O.Matrix4();
2418
2418
  We.makeScale(Ht * 2, kt * 2, Wt * 2);
2419
2419
  const Te = new O.Matrix4();
@@ -2968,7 +2968,7 @@ const Fs = class Fs {
2968
2968
  /**
2969
2969
  * The version of the @thatopen/components library.
2970
2970
  */
2971
- I(Fs, "release", "2.1.6");
2971
+ I(Fs, "release", "2.1.7");
2972
2972
  let pi = Fs;
2973
2973
  class Rr {
2974
2974
  constructor(s) {
@@ -3131,7 +3131,7 @@ const gs = class gs extends et {
3131
3131
  */
3132
3132
  I(gs, "uuid", "d5d8bdf0-db25-4952-b951-b643af207ace");
3133
3133
  let He = gs;
3134
- class Fr extends Si {
3134
+ class Fr extends _i {
3135
3135
  constructor() {
3136
3136
  super(...arguments);
3137
3137
  /**
@@ -3448,8 +3448,8 @@ function rn(l, s, t, e, i = 1 / 0, o, n) {
3448
3448
  u = u / B * F, f = f / B * F, R = R / B * F;
3449
3449
  }
3450
3450
  h = l.x - u, d = l.y - f, E = l.z - R;
3451
- const g = (t.x + r * u) * o, _ = (t.y + r * f) * o, S = (t.z + r * R) * o;
3452
- t.x = (t.x - r * g) * c, t.y = (t.y - r * _) * c, t.z = (t.z - r * S) * c, n.x = h + (u + g) * c, n.y = d + (f + _) * c, n.z = E + (R + S) * c;
3451
+ const g = (t.x + r * u) * o, S = (t.y + r * f) * o, _ = (t.z + r * R) * o;
3452
+ t.x = (t.x - r * g) * c, t.y = (t.y - r * S) * c, t.z = (t.z - r * _) * c, n.x = h + (u + g) * c, n.y = d + (f + S) * c, n.z = E + (R + _) * c;
3453
3453
  const N = m - l.x, y = C - l.y, w = A - l.z, L = n.x - m, U = n.y - C, x = n.z - A;
3454
3454
  return N * L + y * U + w * x > 0 && (n.x = m, n.y = C, n.z = A, t.x = (n.x - m) / o, t.y = (n.y - C) / o, t.z = (n.z - A) / o), n;
3455
3455
  }
@@ -3525,8 +3525,8 @@ class gr {
3525
3525
  }
3526
3526
  }
3527
3527
  }
3528
- const Or = "2.7.3", Es = 1 / 8, bn = typeof window < "u", _r = bn && /Mac/.test(navigator.platform), Sr = !(bn && "PointerEvent" in window);
3529
- let Y, an, ds, ti, lt, G, z, Ee, Le, Ot, _t, Qt, cn, ln, ut, Me, de, hn, ei, En, si, ii, us;
3528
+ const Or = "2.7.3", Es = 1 / 8, bn = typeof window < "u", Sr = bn && /Mac/.test(navigator.platform), _r = !(bn && "PointerEvent" in window);
3529
+ let Y, an, ds, ti, lt, G, z, Ee, Le, Ot, St, Qt, cn, ln, ut, Me, de, hn, ei, En, si, ii, us;
3530
3530
  class ot extends gr {
3531
3531
  /**
3532
3532
  * Injects THREE as the dependency. You can then proceed to use CameraControls.
@@ -3569,7 +3569,7 @@ class ot extends gr {
3569
3569
  * @category Statics
3570
3570
  */
3571
3571
  static install(s) {
3572
- Y = s.THREE, an = Object.freeze(new Y.Vector3(0, 0, 0)), ds = Object.freeze(new Y.Vector3(0, 1, 0)), ti = Object.freeze(new Y.Vector3(0, 0, 1)), lt = new Y.Vector2(), G = new Y.Vector3(), z = new Y.Vector3(), Ee = new Y.Vector3(), Le = new Y.Vector3(), Ot = new Y.Vector3(), _t = new Y.Vector3(), Qt = new Y.Vector3(), cn = new Y.Vector3(), ln = new Y.Vector3(), ut = new Y.Spherical(), Me = new Y.Spherical(), de = new Y.Box3(), hn = new Y.Box3(), ei = new Y.Sphere(), En = new Y.Quaternion(), si = new Y.Quaternion(), ii = new Y.Matrix4(), us = new Y.Raycaster();
3572
+ Y = s.THREE, an = Object.freeze(new Y.Vector3(0, 0, 0)), ds = Object.freeze(new Y.Vector3(0, 1, 0)), ti = Object.freeze(new Y.Vector3(0, 0, 1)), lt = new Y.Vector2(), G = new Y.Vector3(), z = new Y.Vector3(), Ee = new Y.Vector3(), Le = new Y.Vector3(), Ot = new Y.Vector3(), St = new Y.Vector3(), Qt = new Y.Vector3(), cn = new Y.Vector3(), ln = new Y.Vector3(), ut = new Y.Spherical(), Me = new Y.Spherical(), de = new Y.Box3(), hn = new Y.Box3(), ei = new Y.Sphere(), En = new Y.Quaternion(), si = new Y.Quaternion(), ii = new Y.Matrix4(), us = new Y.Raycaster();
3573
3573
  }
3574
3574
  /**
3575
3575
  * list all ACTIONs
@@ -3598,25 +3598,25 @@ class ot extends gr {
3598
3598
  constructor(s, t) {
3599
3599
  super(), this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.minDistance = Number.EPSILON, this.maxDistance = 1 / 0, this.infinityDolly = !1, this.minZoom = 0.01, this.maxZoom = 1 / 0, this.smoothTime = 0.25, this.draggingSmoothTime = 0.125, this.maxSpeed = 1 / 0, this.azimuthRotateSpeed = 1, this.polarRotateSpeed = 1, this.dollySpeed = 1, this.dollyDragInverted = !1, this.truckSpeed = 2, this.dollyToCursor = !1, this.dragToOffset = !1, this.verticalDragToForward = !1, this.boundaryFriction = 0, this.restThreshold = 0.01, this.colliderMeshes = [], this.cancel = () => {
3600
3600
  }, this._enabled = !0, this._state = P.NONE, this._viewport = null, this._changedDolly = 0, this._changedZoom = 0, this._hasRested = !0, this._boundaryEnclosesCamera = !1, this._needsUpdate = !0, this._updatedLastTime = !1, this._elementRect = new DOMRect(), this._isDragging = !1, this._dragNeedsUpdate = !0, this._activePointers = [], this._lockedPointer = null, this._interactiveArea = new DOMRect(0, 0, 1, 1), this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._isUserControllingOffset = !1, this._isUserControllingZoom = !1, this._lastDollyDirection = le.NONE, this._thetaVelocity = { value: 0 }, this._phiVelocity = { value: 0 }, this._radiusVelocity = { value: 0 }, this._targetVelocity = new Y.Vector3(), this._focalOffsetVelocity = new Y.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (p, T, g) => {
3601
- let _, S;
3601
+ let S, _;
3602
3602
  if (Zt(this._camera)) {
3603
3603
  const N = G.copy(this._camera.position).sub(this._target), y = this._camera.getEffectiveFOV() * Ne, w = N.length() * Math.tan(y * 0.5);
3604
- _ = this.truckSpeed * p * w / this._elementRect.height, S = this.truckSpeed * T * w / this._elementRect.height;
3604
+ S = this.truckSpeed * p * w / this._elementRect.height, _ = this.truckSpeed * T * w / this._elementRect.height;
3605
3605
  } else if (bt(this._camera)) {
3606
3606
  const N = this._camera;
3607
- _ = p * (N.right - N.left) / N.zoom / this._elementRect.width, S = T * (N.top - N.bottom) / N.zoom / this._elementRect.height;
3607
+ S = p * (N.right - N.left) / N.zoom / this._elementRect.width, _ = T * (N.top - N.bottom) / N.zoom / this._elementRect.height;
3608
3608
  } else
3609
3609
  return;
3610
- this.verticalDragToForward ? (g ? this.setFocalOffset(this._focalOffsetEnd.x + _, this._focalOffsetEnd.y, this._focalOffsetEnd.z, !0) : this.truck(_, 0, !0), this.forward(-S, !0)) : g ? this.setFocalOffset(this._focalOffsetEnd.x + _, this._focalOffsetEnd.y + S, this._focalOffsetEnd.z, !0) : this.truck(_, S, !0);
3610
+ this.verticalDragToForward ? (g ? this.setFocalOffset(this._focalOffsetEnd.x + S, this._focalOffsetEnd.y, this._focalOffsetEnd.z, !0) : this.truck(S, 0, !0), this.forward(-_, !0)) : g ? this.setFocalOffset(this._focalOffsetEnd.x + S, this._focalOffsetEnd.y + _, this._focalOffsetEnd.z, !0) : this.truck(S, _, !0);
3611
3611
  }, this._rotateInternal = (p, T) => {
3612
- const g = he * this.azimuthRotateSpeed * p / this._elementRect.height, _ = he * this.polarRotateSpeed * T / this._elementRect.height;
3613
- this.rotate(g, _, !0);
3612
+ const g = he * this.azimuthRotateSpeed * p / this._elementRect.height, S = he * this.polarRotateSpeed * T / this._elementRect.height;
3613
+ this.rotate(g, S, !0);
3614
3614
  }, this._dollyInternal = (p, T, g) => {
3615
- const _ = Math.pow(0.95, -p * this.dollySpeed), S = this._sphericalEnd.radius, N = this._sphericalEnd.radius * _, y = mt(N, this.minDistance, this.maxDistance), w = y - N;
3616
- this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(N, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(w, !0), this._dollyToNoClamp(y, !0)) : this._dollyToNoClamp(y, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? N : y) - S, this._dollyControlCoord.set(T, g)), this._lastDollyDirection = Math.sign(-p);
3615
+ const S = Math.pow(0.95, -p * this.dollySpeed), _ = this._sphericalEnd.radius, N = this._sphericalEnd.radius * S, y = mt(N, this.minDistance, this.maxDistance), w = y - N;
3616
+ this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(N, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(w, !0), this._dollyToNoClamp(y, !0)) : this._dollyToNoClamp(y, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? N : y) - _, this._dollyControlCoord.set(T, g)), this._lastDollyDirection = Math.sign(-p);
3617
3617
  }, this._zoomInternal = (p, T, g) => {
3618
- const _ = Math.pow(0.95, p * this.dollySpeed), S = this._zoom, N = this._zoom * _;
3619
- this.zoomTo(N, !0), this.dollyToCursor && (this._changedZoom += N - S, this._dollyControlCoord.set(T, g));
3618
+ const S = Math.pow(0.95, p * this.dollySpeed), _ = this._zoom, N = this._zoom * S;
3619
+ this.zoomTo(N, !0), this.dollyToCursor && (this._changedZoom += N - _, this._dollyControlCoord.set(T, g));
3620
3620
  }, typeof Y > "u" && console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."), this._camera = s, this._yAxisUpSpace = new Y.Quaternion().setFromUnitVectors(this._camera.up, ds), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = P.NONE, this._target = new Y.Vector3(), this._targetEnd = this._target.clone(), this._focalOffset = new Y.Vector3(), this._focalOffsetEnd = this._focalOffset.clone(), this._spherical = new Y.Spherical().setFromVector3(G.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)), this._sphericalEnd = this._spherical.clone(), this._lastDistance = this._spherical.radius, this._zoom = this._camera.zoom, this._zoomEnd = this._zoom, this._lastZoom = this._zoom, this._nearPlaneCorners = [
3621
3621
  new Y.Vector3(),
3622
3622
  new Y.Vector3(),
@@ -3636,14 +3636,14 @@ class ot extends gr {
3636
3636
  if (!this._enabled || !this._domElement)
3637
3637
  return;
3638
3638
  if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
3639
- const _ = this._domElement.getBoundingClientRect(), S = p.clientX / _.width, N = p.clientY / _.height;
3640
- if (S < this._interactiveArea.left || S > this._interactiveArea.right || N < this._interactiveArea.top || N > this._interactiveArea.bottom)
3639
+ const S = this._domElement.getBoundingClientRect(), _ = p.clientX / S.width, N = p.clientY / S.height;
3640
+ if (_ < this._interactiveArea.left || _ > this._interactiveArea.right || N < this._interactiveArea.top || N > this._interactiveArea.bottom)
3641
3641
  return;
3642
3642
  }
3643
3643
  const T = p.pointerType !== "mouse" ? null : (p.buttons & V.LEFT) === V.LEFT ? V.LEFT : (p.buttons & V.MIDDLE) === V.MIDDLE ? V.MIDDLE : (p.buttons & V.RIGHT) === V.RIGHT ? V.RIGHT : null;
3644
3644
  if (T !== null) {
3645
- const _ = this._findPointerByMouseButton(T);
3646
- _ && this._disposePointer(_);
3645
+ const S = this._findPointerByMouseButton(T);
3646
+ S && this._disposePointer(S);
3647
3647
  }
3648
3648
  if ((p.buttons & V.LEFT) === V.LEFT && this._lockedPointer)
3649
3649
  return;
@@ -3660,14 +3660,14 @@ class ot extends gr {
3660
3660
  if (!this._enabled || !this._domElement || this._lockedPointer)
3661
3661
  return;
3662
3662
  if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
3663
- const _ = this._domElement.getBoundingClientRect(), S = p.clientX / _.width, N = p.clientY / _.height;
3664
- if (S < this._interactiveArea.left || S > this._interactiveArea.right || N < this._interactiveArea.top || N > this._interactiveArea.bottom)
3663
+ const S = this._domElement.getBoundingClientRect(), _ = p.clientX / S.width, N = p.clientY / S.height;
3664
+ if (_ < this._interactiveArea.left || _ > this._interactiveArea.right || N < this._interactiveArea.top || N > this._interactiveArea.bottom)
3665
3665
  return;
3666
3666
  }
3667
3667
  const T = (p.buttons & V.LEFT) === V.LEFT ? V.LEFT : (p.buttons & V.MIDDLE) === V.MIDDLE ? V.MIDDLE : (p.buttons & V.RIGHT) === V.RIGHT ? V.RIGHT : null;
3668
3668
  if (T !== null) {
3669
- const _ = this._findPointerByMouseButton(T);
3670
- _ && this._disposePointer(_);
3669
+ const S = this._findPointerByMouseButton(T);
3670
+ S && this._disposePointer(S);
3671
3671
  }
3672
3672
  const g = {
3673
3673
  pointerId: 1,
@@ -3740,7 +3740,7 @@ class ot extends gr {
3740
3740
  const N = performance.now();
3741
3741
  E - N < 1e3 && this._getClientRect(this._elementRect), E = N;
3742
3742
  }
3743
- const T = _r ? -1 : -3, g = p.deltaMode === 1 ? p.deltaY / T : p.deltaY / (T * 10), _ = this.dollyToCursor ? (p.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, S = this.dollyToCursor ? (p.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
3743
+ const T = Sr ? -1 : -3, g = p.deltaMode === 1 ? p.deltaY / T : p.deltaY / (T * 10), S = this.dollyToCursor ? (p.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, _ = this.dollyToCursor ? (p.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
3744
3744
  switch (this.mouseButtons.wheel) {
3745
3745
  case P.ROTATE: {
3746
3746
  this._rotateInternal(p.deltaX, p.deltaY), this._isUserControllingRotate = !0;
@@ -3755,11 +3755,11 @@ class ot extends gr {
3755
3755
  break;
3756
3756
  }
3757
3757
  case P.DOLLY: {
3758
- this._dollyInternal(-g, _, S), this._isUserControllingDolly = !0;
3758
+ this._dollyInternal(-g, S, _), this._isUserControllingDolly = !0;
3759
3759
  break;
3760
3760
  }
3761
3761
  case P.ZOOM: {
3762
- this._zoomInternal(-g, _, S), this._isUserControllingZoom = !0;
3762
+ this._zoomInternal(-g, S, _), this._isUserControllingZoom = !0;
3763
3763
  break;
3764
3764
  }
3765
3765
  }
@@ -3777,8 +3777,8 @@ class ot extends gr {
3777
3777
  if (!this._enabled)
3778
3778
  return;
3779
3779
  if ($s(this._activePointers, lt), this._getClientRect(this._elementRect), e.copy(lt), i.copy(lt), this._activePointers.length >= 2) {
3780
- const g = lt.x - this._activePointers[1].clientX, _ = lt.y - this._activePointers[1].clientY, S = Math.sqrt(g * g + _ * _);
3781
- o.set(0, S);
3780
+ const g = lt.x - this._activePointers[1].clientX, S = lt.y - this._activePointers[1].clientY, _ = Math.sqrt(g * g + S * S);
3781
+ o.set(0, _);
3782
3782
  const N = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, y = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
3783
3783
  i.set(N, y);
3784
3784
  }
@@ -3803,18 +3803,18 @@ class ot extends gr {
3803
3803
  if (!this._enabled || !this._dragNeedsUpdate)
3804
3804
  return;
3805
3805
  this._dragNeedsUpdate = !1, $s(this._activePointers, lt);
3806
- const T = this._domElement && document.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, g = T ? -T.deltaX : i.x - lt.x, _ = T ? -T.deltaY : i.y - lt.y;
3807
- if (i.copy(lt), ((this._state & P.ROTATE) === P.ROTATE || (this._state & P.TOUCH_ROTATE) === P.TOUCH_ROTATE || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE || (this._state & P.TOUCH_ZOOM_ROTATE) === P.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(g, _), this._isUserControllingRotate = !0), (this._state & P.DOLLY) === P.DOLLY || (this._state & P.ZOOM) === P.ZOOM) {
3808
- const S = this.dollyToCursor ? (e.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, N = this.dollyToCursor ? (e.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0, y = this.dollyDragInverted ? -1 : 1;
3809
- (this._state & P.DOLLY) === P.DOLLY ? (this._dollyInternal(y * _ * Es, S, N), this._isUserControllingDolly = !0) : (this._zoomInternal(y * _ * Es, S, N), this._isUserControllingZoom = !0);
3806
+ const T = this._domElement && document.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, g = T ? -T.deltaX : i.x - lt.x, S = T ? -T.deltaY : i.y - lt.y;
3807
+ if (i.copy(lt), ((this._state & P.ROTATE) === P.ROTATE || (this._state & P.TOUCH_ROTATE) === P.TOUCH_ROTATE || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE || (this._state & P.TOUCH_ZOOM_ROTATE) === P.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(g, S), this._isUserControllingRotate = !0), (this._state & P.DOLLY) === P.DOLLY || (this._state & P.ZOOM) === P.ZOOM) {
3808
+ const _ = this.dollyToCursor ? (e.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, N = this.dollyToCursor ? (e.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0, y = this.dollyDragInverted ? -1 : 1;
3809
+ (this._state & P.DOLLY) === P.DOLLY ? (this._dollyInternal(y * S * Es, _, N), this._isUserControllingDolly = !0) : (this._zoomInternal(y * S * Es, _, N), this._isUserControllingZoom = !0);
3810
3810
  }
3811
3811
  if ((this._state & P.TOUCH_DOLLY) === P.TOUCH_DOLLY || (this._state & P.TOUCH_ZOOM) === P.TOUCH_ZOOM || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_ZOOM_TRUCK) === P.TOUCH_ZOOM_TRUCK || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET || (this._state & P.TOUCH_ZOOM_OFFSET) === P.TOUCH_ZOOM_OFFSET || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE || (this._state & P.TOUCH_ZOOM_ROTATE) === P.TOUCH_ZOOM_ROTATE) {
3812
- const S = lt.x - this._activePointers[1].clientX, N = lt.y - this._activePointers[1].clientY, y = Math.sqrt(S * S + N * N), w = o.y - y;
3812
+ const _ = lt.x - this._activePointers[1].clientX, N = lt.y - this._activePointers[1].clientY, y = Math.sqrt(_ * _ + N * N), w = o.y - y;
3813
3813
  o.set(0, y);
3814
3814
  const L = this.dollyToCursor ? (i.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, U = this.dollyToCursor ? (i.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
3815
3815
  (this._state & P.TOUCH_DOLLY) === P.TOUCH_DOLLY || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(w * Es, L, U), this._isUserControllingDolly = !0) : (this._zoomInternal(w * Es, L, U), this._isUserControllingZoom = !0);
3816
3816
  }
3817
- ((this._state & P.TRUCK) === P.TRUCK || (this._state & P.TOUCH_TRUCK) === P.TOUCH_TRUCK || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_ZOOM_TRUCK) === P.TOUCH_ZOOM_TRUCK) && (this._truckInternal(g, _, !1), this._isUserControllingTruck = !0), ((this._state & P.OFFSET) === P.OFFSET || (this._state & P.TOUCH_OFFSET) === P.TOUCH_OFFSET || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET || (this._state & P.TOUCH_ZOOM_OFFSET) === P.TOUCH_ZOOM_OFFSET) && (this._truckInternal(g, _, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
3817
+ ((this._state & P.TRUCK) === P.TRUCK || (this._state & P.TOUCH_TRUCK) === P.TOUCH_TRUCK || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_ZOOM_TRUCK) === P.TOUCH_ZOOM_TRUCK) && (this._truckInternal(g, S, !1), this._isUserControllingTruck = !0), ((this._state & P.OFFSET) === P.OFFSET || (this._state & P.TOUCH_OFFSET) === P.TOUCH_OFFSET || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET || (this._state & P.TOUCH_ZOOM_OFFSET) === P.TOUCH_ZOOM_OFFSET) && (this._truckInternal(g, S, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
3818
3818
  }, C = () => {
3819
3819
  $s(this._activePointers, lt), i.copy(lt), this._dragNeedsUpdate = !1, (this._activePointers.length === 0 || this._activePointers.length === 1 && this._activePointers[0] === this._lockedPointer) && (this._isDragging = !1), this._activePointers.length === 0 && this._domElement && (this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("pointerup", h), this._domElement.ownerDocument.removeEventListener("mouseup", d), this.dispatchEvent({ type: "controlend" }));
3820
3820
  };
@@ -3836,7 +3836,7 @@ class ot extends gr {
3836
3836
  this.unlockPointer();
3837
3837
  };
3838
3838
  this._addAllEventListeners = (p) => {
3839
- this._domElement = p, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", n), Sr && this._domElement.addEventListener("mousedown", r), this._domElement.addEventListener("pointercancel", h), this._domElement.addEventListener("wheel", u, { passive: !1 }), this._domElement.addEventListener("contextmenu", f);
3839
+ this._domElement = p, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", n), _r && this._domElement.addEventListener("mousedown", r), this._domElement.addEventListener("pointercancel", h), this._domElement.addEventListener("wheel", u, { passive: !1 }), this._domElement.addEventListener("contextmenu", f);
3840
3840
  }, this._removeAllEventListeners = () => {
3841
3841
  this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", n), this._domElement.removeEventListener("mousedown", r), this._domElement.removeEventListener("pointercancel", h), this._domElement.removeEventListener("wheel", u, { passive: !1 }), this._domElement.removeEventListener("contextmenu", f), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("pointerup", h), this._domElement.ownerDocument.removeEventListener("mouseup", d), this._domElement.ownerDocument.removeEventListener("pointerlockchange", A), this._domElement.ownerDocument.removeEventListener("pointerlockerror", F));
3842
3842
  }, this.cancel = () => {
@@ -4137,8 +4137,8 @@ class ot extends gr {
4137
4137
  * @category Methods
4138
4138
  */
4139
4139
  truck(s, t, e = !1) {
4140
- this._camera.updateMatrix(), Ot.setFromMatrixColumn(this._camera.matrix, 0), _t.setFromMatrixColumn(this._camera.matrix, 1), Ot.multiplyScalar(s), _t.multiplyScalar(-t);
4141
- const i = G.copy(Ot).add(_t), o = z.copy(this._targetEnd).add(i);
4140
+ this._camera.updateMatrix(), Ot.setFromMatrixColumn(this._camera.matrix, 0), St.setFromMatrixColumn(this._camera.matrix, 1), Ot.multiplyScalar(s), St.multiplyScalar(-t);
4141
+ const i = G.copy(Ot).add(St), o = z.copy(this._targetEnd).add(i);
4142
4142
  return this.moveTo(o.x, o.y, o.z, e);
4143
4143
  }
4144
4144
  /**
@@ -4332,9 +4332,9 @@ class ot extends gr {
4332
4332
  * @category Methods
4333
4333
  */
4334
4334
  setOrbitPoint(s, t, e) {
4335
- this._camera.updateMatrixWorld(), Ot.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), _t.setFromMatrixColumn(this._camera.matrixWorldInverse, 1), Qt.setFromMatrixColumn(this._camera.matrixWorldInverse, 2);
4335
+ this._camera.updateMatrixWorld(), Ot.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), St.setFromMatrixColumn(this._camera.matrixWorldInverse, 1), Qt.setFromMatrixColumn(this._camera.matrixWorldInverse, 2);
4336
4336
  const i = G.set(s, t, e), o = i.distanceTo(this._camera.position), n = i.sub(this._camera.position);
4337
- Ot.multiplyScalar(n.x), _t.multiplyScalar(n.y), Qt.multiplyScalar(n.z), G.copy(Ot).add(_t).add(Qt), G.z = G.z + o, this.dollyTo(o, !1), this.setFocalOffset(-G.x, G.y, -G.z, !1), this.moveTo(s, t, e, !1);
4337
+ Ot.multiplyScalar(n.x), St.multiplyScalar(n.y), Qt.multiplyScalar(n.z), G.copy(Ot).add(St).add(Qt), G.z = G.z + o, this.dollyTo(o, !1), this.setFocalOffset(-G.x, G.y, -G.z, !1), this.moveTo(s, t, e, !1);
4338
4338
  }
4339
4339
  /**
4340
4340
  * Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
@@ -4529,22 +4529,22 @@ class ot extends gr {
4529
4529
  const R = z.crossVectors(f, u), m = this._sphericalEnd.radius * Math.tan(E.getEffectiveFOV() * Ne * 0.5), A = (this._sphericalEnd.radius - d - this._sphericalEnd.radius) / this._sphericalEnd.radius, F = Ee.copy(this._targetEnd).add(f.multiplyScalar(this._dollyControlCoord.x * m * E.aspect)).add(R.multiplyScalar(this._dollyControlCoord.y * m)), p = G.copy(this._targetEnd).lerp(F, A), T = this._lastDollyDirection === le.IN && this._spherical.radius <= this.minDistance, g = this._lastDollyDirection === le.OUT && this.maxDistance <= this._spherical.radius;
4530
4530
  if (this.infinityDolly && (T || g)) {
4531
4531
  this._sphericalEnd.radius -= d, this._spherical.radius -= d;
4532
- const S = z.copy(u).multiplyScalar(-d);
4533
- p.add(S);
4532
+ const _ = z.copy(u).multiplyScalar(-d);
4533
+ p.add(_);
4534
4534
  }
4535
4535
  this._boundary.clampPoint(p, p);
4536
- const _ = z.subVectors(p, this._targetEnd);
4537
- this._targetEnd.copy(p), this._target.add(_), this._changedDolly -= d, X(this._changedDolly) && (this._changedDolly = 0);
4536
+ const S = z.subVectors(p, this._targetEnd);
4537
+ this._targetEnd.copy(p), this._target.add(S), this._changedDolly -= d, X(this._changedDolly) && (this._changedDolly = 0);
4538
4538
  } else if (bt(this._camera) && this._changedZoom !== 0) {
4539
4539
  const d = this._zoom - this._lastZoom, E = this._camera, u = G.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (E.near + E.far) / (E.near - E.far)).unproject(E), f = z.set(0, 0, -1).applyQuaternion(E.quaternion), R = Ee.copy(u).add(f.multiplyScalar(-u.dot(E.up))), C = -(this._zoom - d - this._zoom) / this._zoom, A = this._getCameraDirection(Le), F = this._targetEnd.dot(A), p = G.copy(this._targetEnd).lerp(R, C), T = p.dot(A), g = A.multiplyScalar(T - F);
4540
4540
  p.sub(g), this._boundary.clampPoint(p, p);
4541
- const _ = z.subVectors(p, this._targetEnd);
4542
- this._targetEnd.copy(p), this._target.add(_), this._changedZoom -= d, X(this._changedZoom) && (this._changedZoom = 0);
4541
+ const S = z.subVectors(p, this._targetEnd);
4542
+ this._targetEnd.copy(p), this._target.add(S), this._changedZoom -= d, X(this._changedZoom) && (this._changedZoom = 0);
4543
4543
  }
4544
4544
  }
4545
4545
  this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0), this._dragNeedsUpdate = !0;
4546
4546
  const a = this._collisionTest();
4547
- this._spherical.radius = Math.min(this._spherical.radius, a), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!X(this._focalOffset.x) || !X(this._focalOffset.y) || !X(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), Ot.setFromMatrixColumn(this._camera.matrix, 0), _t.setFromMatrixColumn(this._camera.matrix, 1), Qt.setFromMatrixColumn(this._camera.matrix, 2), Ot.multiplyScalar(this._focalOffset.x), _t.multiplyScalar(-this._focalOffset.y), Qt.multiplyScalar(this._focalOffset.z), G.copy(Ot).add(_t).add(Qt), this._camera.position.add(G)), this._boundaryEnclosesCamera && this._encloseToBoundary(this._camera.position.copy(this._target), G.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse), 1);
4547
+ this._spherical.radius = Math.min(this._spherical.radius, a), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!X(this._focalOffset.x) || !X(this._focalOffset.y) || !X(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), Ot.setFromMatrixColumn(this._camera.matrix, 0), St.setFromMatrixColumn(this._camera.matrix, 1), Qt.setFromMatrixColumn(this._camera.matrix, 2), Ot.multiplyScalar(this._focalOffset.x), St.multiplyScalar(-this._focalOffset.y), Qt.multiplyScalar(this._focalOffset.z), G.copy(Ot).add(St).add(Qt), this._camera.position.add(G)), this._boundaryEnclosesCamera && this._encloseToBoundary(this._camera.position.copy(this._target), G.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse), 1);
4548
4548
  const h = this._needsUpdate;
4549
4549
  return h && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : h ? (this.dispatchEvent({ type: "update" }), X(t, this.restThreshold) && X(e, this.restThreshold) && X(i, this.restThreshold) && X(o.x, this.restThreshold) && X(o.y, this.restThreshold) && X(o.z, this.restThreshold) && X(n.x, this.restThreshold) && X(n.y, this.restThreshold) && X(n.z, this.restThreshold) && X(r, this.restThreshold) && !this._hasRested && (this._hasRested = !0, this.dispatchEvent({ type: "rest" }))) : !h && this._updatedLastTime && this.dispatchEvent({ type: "sleep" }), this._lastDistance = this._spherical.radius, this._lastZoom = this._zoom, this._updatedLastTime = h, this._needsUpdate = !1, h;
4550
4550
  }
@@ -5096,7 +5096,7 @@ class Nr {
5096
5096
  s ? t.addEventListener("update", this.updateZoom) : t.removeEventListener("update", this.updateZoom);
5097
5097
  }
5098
5098
  }
5099
- const _s = class _s extends et {
5099
+ const Ss = class Ss extends et {
5100
5100
  constructor(t) {
5101
5101
  super(t);
5102
5102
  /**
@@ -5116,7 +5116,7 @@ const _s = class _s extends et {
5116
5116
  I(this, "onDisposed", new D());
5117
5117
  /** {@link Component.enabled} */
5118
5118
  I(this, "enabled", !0);
5119
- t.add(_s.uuid, this);
5119
+ t.add(Ss.uuid, this);
5120
5120
  }
5121
5121
  /**
5122
5122
  * Creates a new grid for the given world.
@@ -5160,8 +5160,8 @@ const _s = class _s extends et {
5160
5160
  * A unique identifier for the component.
5161
5161
  * This UUID is used to register the component within the Components system.
5162
5162
  */
5163
- I(_s, "uuid", "d1e814d5-b81c-4452-87a2-f039375e0489");
5164
- let dn = _s;
5163
+ I(Ss, "uuid", "d1e814d5-b81c-4452-87a2-f039375e0489");
5164
+ let dn = Ss;
5165
5165
  const jt = new jn(), nt = new M(), xt = new M(), j = new Pt(), un = {
5166
5166
  X: new M(1, 0, 0),
5167
5167
  Y: new M(0, 1, 0),
@@ -5320,7 +5320,7 @@ function oi(l, s, t) {
5320
5320
  return e[i];
5321
5321
  return !1;
5322
5322
  }
5323
- const Is = new qn(), W = new M(0, 1, 0), Cn = new M(0, 0, 0), Tn = new Lt(), fs = new Pt(), Rs = new Pt(), St = new M(), mn = new Lt(), Ue = new M(1, 0, 0), qt = new M(0, 1, 0), xe = new M(0, 0, 1), ps = new M(), we = new M(), De = new M();
5323
+ const Is = new qn(), W = new M(0, 1, 0), Cn = new M(0, 0, 0), Tn = new Lt(), fs = new Pt(), Rs = new Pt(), _t = new M(), mn = new Lt(), Ue = new M(1, 0, 0), qt = new M(0, 1, 0), xe = new M(0, 0, 1), ps = new M(), we = new M(), De = new M();
5324
5324
  class Ur extends ri {
5325
5325
  constructor() {
5326
5326
  super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
@@ -5427,7 +5427,7 @@ class Ur extends ri {
5427
5427
  XZ: [
5428
5428
  [new v(new rt(0.2, 0.2, 0.01), e), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
5429
5429
  ]
5430
- }, _ = {
5430
+ }, S = {
5431
5431
  START: [
5432
5432
  [new v(new Ze(0.01, 2), i), null, null, null, "helper"]
5433
5433
  ],
@@ -5446,7 +5446,7 @@ class Ur extends ri {
5446
5446
  Z: [
5447
5447
  [new Dt(C, i.clone()), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
5448
5448
  ]
5449
- }, S = {
5449
+ }, _ = {
5450
5450
  XYZE: [
5451
5451
  [new v(F(0.5, 1), f), null, [0, Math.PI / 2, 0]]
5452
5452
  ],
@@ -5557,7 +5557,7 @@ class Ur extends ri {
5557
5557
  }
5558
5558
  return H;
5559
5559
  }
5560
- this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = x(T)), this.add(this.gizmo.rotate = x(S)), this.add(this.gizmo.scale = x(w)), this.add(this.picker.translate = x(g)), this.add(this.picker.rotate = x(y)), this.add(this.picker.scale = x(L)), this.add(this.helper.translate = x(_)), this.add(this.helper.rotate = x(N)), this.add(this.helper.scale = x(U)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
5560
+ this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = x(T)), this.add(this.gizmo.rotate = x(_)), this.add(this.gizmo.scale = x(w)), this.add(this.picker.translate = x(g)), this.add(this.picker.rotate = x(y)), this.add(this.picker.scale = x(L)), this.add(this.helper.translate = x(S)), this.add(this.helper.rotate = x(N)), this.add(this.helper.scale = x(U)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
5561
5561
  }
5562
5562
  // updateMatrixWorld will update transformations and appearance of individual handles
5563
5563
  updateMatrixWorld(s) {
@@ -5594,34 +5594,34 @@ class xr extends v {
5594
5594
  case "scale":
5595
5595
  switch (this.axis) {
5596
5596
  case "X":
5597
- W.copy(this.eye).cross(ps), St.copy(ps).cross(W);
5597
+ W.copy(this.eye).cross(ps), _t.copy(ps).cross(W);
5598
5598
  break;
5599
5599
  case "Y":
5600
- W.copy(this.eye).cross(we), St.copy(we).cross(W);
5600
+ W.copy(this.eye).cross(we), _t.copy(we).cross(W);
5601
5601
  break;
5602
5602
  case "Z":
5603
- W.copy(this.eye).cross(De), St.copy(De).cross(W);
5603
+ W.copy(this.eye).cross(De), _t.copy(De).cross(W);
5604
5604
  break;
5605
5605
  case "XY":
5606
- St.copy(De);
5606
+ _t.copy(De);
5607
5607
  break;
5608
5608
  case "YZ":
5609
- St.copy(ps);
5609
+ _t.copy(ps);
5610
5610
  break;
5611
5611
  case "XZ":
5612
- W.copy(De), St.copy(we);
5612
+ W.copy(De), _t.copy(we);
5613
5613
  break;
5614
5614
  case "XYZ":
5615
5615
  case "E":
5616
- St.set(0, 0, 0);
5616
+ _t.set(0, 0, 0);
5617
5617
  break;
5618
5618
  }
5619
5619
  break;
5620
5620
  case "rotate":
5621
5621
  default:
5622
- St.set(0, 0, 0);
5622
+ _t.set(0, 0, 0);
5623
5623
  }
5624
- St.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (mn.lookAt(nt.set(0, 0, 0), St, W), this.quaternion.setFromRotationMatrix(mn)), super.updateMatrixWorld(s);
5624
+ _t.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (mn.lookAt(nt.set(0, 0, 0), _t, W), this.quaternion.setFromRotationMatrix(mn)), super.updateMatrixWorld(s);
5625
5625
  }
5626
5626
  }
5627
5627
  class Pi {
@@ -6522,7 +6522,7 @@ class Gr {
6522
6522
  this._camera.left = e * t / -2, this._camera.right = e * t / 2, this._camera.top = e / 2, this._camera.bottom = -e / 2, this._camera.updateProjectionMatrix(), this.onResize.trigger(s);
6523
6523
  }
6524
6524
  }
6525
- const Ss = class Ss extends et {
6525
+ const _s = class _s extends et {
6526
6526
  constructor(t) {
6527
6527
  super(t);
6528
6528
  /** {@link Updateable.onAfterUpdate} */
@@ -6537,7 +6537,7 @@ const Ss = class Ss extends et {
6537
6537
  * A collection of {@link MiniMap} instances, each associated with a unique world ID.
6538
6538
  */
6539
6539
  I(this, "list", /* @__PURE__ */ new Map());
6540
- this.components.add(Ss.uuid, this);
6540
+ this.components.add(_s.uuid, this);
6541
6541
  }
6542
6542
  /**
6543
6543
  * Creates a new {@link MiniMap} instance associated with the given world.
@@ -6580,8 +6580,8 @@ const Ss = class Ss extends et {
6580
6580
  * A unique identifier for the component.
6581
6581
  * This UUID is used to register the component within the Components system.
6582
6582
  */
6583
- I(Ss, "uuid", "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f");
6584
- let An = Ss;
6583
+ I(_s, "uuid", "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f");
6584
+ let An = _s;
6585
6585
  class zr {
6586
6586
  constructor(s) {
6587
6587
  /** {@link NavigationMode.enabled} */
@@ -7370,7 +7370,24 @@ const Ns = class Ns extends et {
7370
7370
  }
7371
7371
  if (t.length)
7372
7372
  for (const i of t)
7373
- i.coordinationMatrix.equals(this.baseCoordinationMatrix) || (i.position.set(0, 0, 0), i.rotation.set(0, 0, 0), i.scale.set(1, 1, 1), i.updateMatrix(), i.applyMatrix4(i.coordinationMatrix.clone().invert()), i.applyMatrix4(this.baseCoordinationMatrix));
7373
+ i.coordinationMatrix.equals(this.baseCoordinationMatrix) || (i.position.set(0, 0, 0), i.rotation.set(0, 0, 0), i.scale.set(1, 1, 1), i.updateMatrix(), this.applyBaseCoordinateSystem(i, i.coordinationMatrix));
7374
+ }
7375
+ /**
7376
+ * Applies the base coordinate system to the provided object.
7377
+ *
7378
+ * This function takes an object and its original coordinate system as input.
7379
+ * It then inverts the original coordinate system and applies the base coordinate system
7380
+ * to the object. This ensures that the object's position, rotation, and scale are
7381
+ * transformed to match the base coordinate system (which is taken from the first model loaded).
7382
+ *
7383
+ * @param object - The object to which the base coordinate system will be applied.
7384
+ * This should be an instance of THREE.Object3D.
7385
+ *
7386
+ * @param originalCoordinateSystem - The original coordinate system of the object.
7387
+ * This should be a THREE.Matrix4 representing the object's transformation matrix.
7388
+ */
7389
+ applyBaseCoordinateSystem(t, e) {
7390
+ t.applyMatrix4(e.clone().invert()), t.applyMatrix4(this.baseCoordinationMatrix);
7374
7391
  }
7375
7392
  };
7376
7393
  /**
@@ -9694,10 +9711,10 @@ const Ge = class Ge extends et {
9694
9711
  for (let n = 0; n < i; n++) {
9695
9712
  const r = t.geometries.get(n), { x: a, y: c, z: h, w: d } = r.color, E = d !== 1, { geometryExpressID: u } = r, f = `${u}-${E}`;
9696
9713
  if (!this._visitedFragments.has(f)) {
9697
- const T = this.getGeometry(this.webIfc, u), g = E ? this._materialT : this._material, _ = new Vt.Fragment(T, g, 1);
9698
- e.add(_.mesh), e.items.push(_);
9699
- const S = this._visitedFragments.size;
9700
- this._visitedFragments.set(f, { index: S, fragment: _ });
9714
+ const T = this.getGeometry(this.webIfc, u), g = E ? this._materialT : this._material, S = new Vt.Fragment(T, g, 1);
9715
+ e.add(S.mesh), e.items.push(S);
9716
+ const _ = this._visitedFragments.size;
9717
+ this._visitedFragments.set(f, { index: _, fragment: S });
9701
9718
  }
9702
9719
  const R = new O.Color().setRGB(a, c, h, "srgb"), m = new O.Matrix4();
9703
9720
  m.fromArray(r.flatTransformation);
@@ -10591,7 +10608,7 @@ const Ms = class Ms extends et {
10591
10608
  * This UUID is used to register the component within the Components system.
10592
10609
  */
10593
10610
  I(Ms, "uuid", "dd9ccf2d-8a21-4821-b7f6-2949add16a29");
10594
- let _n = Ms;
10611
+ let Sn = Ms;
10595
10612
  class jr extends yi {
10596
10613
  constructor() {
10597
10614
  super(...arguments);
@@ -10722,8 +10739,8 @@ const ws = class ws extends et {
10722
10739
  o[a].push(p);
10723
10740
  const T = this.webIfc.GetLine(0, p);
10724
10741
  if (T.GlobalId) {
10725
- const _ = (T == null ? void 0 : T.GlobalId.value) || (T == null ? void 0 : T.GlobalId);
10726
- n.globalToExpressIDs.set(_, p);
10742
+ const S = (T == null ? void 0 : T.GlobalId.value) || (T == null ? void 0 : T.GlobalId);
10743
+ n.globalToExpressIDs.set(S, p);
10727
10744
  }
10728
10745
  const g = this._spatialTree.itemsByFloor[p] || 0;
10729
10746
  n.data.set(p, [[], [g, m]]), r++;
@@ -10818,7 +10835,7 @@ const ws = class ws extends et {
10818
10835
  * This UUID is used to register the component within the Components system.
10819
10836
  */
10820
10837
  I(ws, "uuid", "d9999a00-e1f5-4d3f-8cfe-c56e08609764");
10821
- let Sn = ws;
10838
+ let _n = ws;
10822
10839
  class qr extends yi {
10823
10840
  constructor() {
10824
10841
  super(...arguments);
@@ -11017,8 +11034,8 @@ const Ds = class Ds extends et {
11017
11034
  const C = /* @__PURE__ */ new Set(), A = new Set(R);
11018
11035
  for (const [T, g] of f) {
11019
11036
  m === null ? m = g : g !== m && C.add(g), h.delete(T);
11020
- const { edges: _ } = d.get(g);
11021
- _.delete(T), A.delete(T);
11037
+ const { edges: S } = d.get(g);
11038
+ S.delete(T), A.delete(T);
11022
11039
  }
11023
11040
  if (m === null)
11024
11041
  throw new Error("Error computing face!");
@@ -11030,10 +11047,10 @@ const Ds = class Ds extends et {
11030
11047
  g.add(T);
11031
11048
  }
11032
11049
  for (const T of C) {
11033
- const g = d.get(T), { edges: _, indices: S } = g, N = d.get(m), { edges: y, indices: w } = N;
11034
- for (const L of _)
11035
- y.add(L), h.set(L, m);
11050
+ const g = d.get(T), { edges: S, indices: _ } = g, N = d.get(m), { edges: y, indices: w } = N;
11036
11051
  for (const L of S)
11052
+ y.add(L), h.set(L, m);
11053
+ for (const L of _)
11037
11054
  w.add(L);
11038
11055
  d.delete(T);
11039
11056
  }
@@ -11209,7 +11226,7 @@ I(Ds, "uuid", "267ca032-672f-4cb0-afa9-d24e904f39d6");
11209
11226
  let Nn = Ds;
11210
11227
  export {
11211
11228
  Ts as AsyncEvent,
11212
- Si as Base,
11229
+ _i as Base,
11213
11230
  ar as BaseCamera,
11214
11231
  cr as BaseRenderer,
11215
11232
  lr as BaseScene,
@@ -11228,12 +11245,12 @@ export {
11228
11245
  ht as FragmentsManager,
11229
11246
  vn as GeometryTypes,
11230
11247
  dn as Grids,
11231
- _n as Hider,
11248
+ Sn as Hider,
11232
11249
  oa as IfcCategories,
11233
11250
  Bn as IfcCategoryMap,
11234
11251
  Zr as IfcElements,
11235
11252
  yi as IfcFragmentSettings,
11236
- Sn as IfcGeometryTiler,
11253
+ _n as IfcGeometryTiler,
11237
11254
  mi as IfcJsonExporter,
11238
11255
  Ri as IfcLoader,
11239
11256
  gn as IfcPropertiesManager,