@thatopen/components 2.0.0-alpha.12 → 2.0.0-alpha.13

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
@@ -2,11 +2,11 @@ var Gn = Object.defineProperty;
2
2
  var zn = (l, s, t) => s in l ? Gn(l, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[s] = t;
3
3
  var I = (l, s, t) => (zn(l, typeof s != "symbol" ? s + "" : s, t), t);
4
4
  import * as O from "three";
5
- import { BufferAttribute as Sn, Vector3 as w, Vector2 as pe, Plane as mi, Line3 as Lt, Triangle as Ie, Sphere as Hn, Matrix4 as wt, Box3 as Ot, BackSide as kn, DoubleSide as _n, FrontSide as Li, Mesh as v, Ray as Wn, Raycaster as Xn, Quaternion as Pt, Object3D as ii, Euler as Zn, MeshBasicMaterial as Nn, LineBasicMaterial as Qn, CylinderGeometry as lt, BoxGeometry as rt, BufferGeometry as wi, Float32BufferAttribute as Mi, OctahedronGeometry as je, Line as Ut, SphereGeometry as jn, TorusGeometry as Re, PlaneGeometry as qn } from "three";
5
+ import { BufferAttribute as Sn, Vector3 as w, Vector2 as pe, Plane as mi, Line3 as yt, Triangle as Ie, Sphere as Hn, Matrix4 as wt, Box3 as Ot, BackSide as kn, DoubleSide as _n, FrontSide as yi, Mesh as v, Ray as Wn, Raycaster as Xn, Quaternion as Lt, Object3D as ni, Euler as Zn, MeshBasicMaterial as Nn, LineBasicMaterial as Qn, CylinderGeometry as lt, BoxGeometry as rt, BufferGeometry as wi, Float32BufferAttribute as Mi, OctahedronGeometry as je, Line as Ut, SphereGeometry as jn, TorusGeometry as Re, PlaneGeometry as qn } from "three";
6
6
  import * as Gt from "@thatopen/fragments";
7
7
  import { Serializer as $n } from "@thatopen/fragments";
8
- import * as x from "web-ifc";
9
- const yn = 0, Kn = 1, Jn = 2, Di = 2, bs = 1.25, Ui = 1, ms = 6 * 4 + 4 + 4, ws = 65535, to = Math.pow(2, -24), vs = Symbol("SKIP_GENERATION");
8
+ import * as D from "web-ifc";
9
+ const Pn = 0, Kn = 1, Jn = 2, Di = 2, vs = 1.25, Ui = 1, ms = 6 * 4 + 4 + 4, Ms = 65535, to = Math.pow(2, -24), Bs = Symbol("SKIP_GENERATION");
10
10
  function eo(l) {
11
11
  return l.index ? l.index.count : l.attributes.position.count;
12
12
  }
@@ -24,16 +24,16 @@ function io(l, s) {
24
24
  i[o] = o;
25
25
  }
26
26
  }
27
- function Pn(l) {
27
+ function Ln(l) {
28
28
  const s = Ce(l), t = l.drawRange, e = t.start / 3, i = (t.start + t.count) / 3, o = Math.max(0, e), n = Math.min(s, i) - o;
29
29
  return [{
30
30
  offset: Math.floor(o),
31
31
  count: Math.floor(n)
32
32
  }];
33
33
  }
34
- function Ln(l) {
34
+ function yn(l) {
35
35
  if (!l.groups || !l.groups.length)
36
- return Pn(l);
36
+ return Ln(l);
37
37
  const s = [], t = /* @__PURE__ */ new Set(), e = l.drawRange, i = e.start / 3, o = (e.start + e.count) / 3;
38
38
  for (const r of l.groups) {
39
39
  const a = r.start / 3, c = (r.start + r.count) / 3;
@@ -52,7 +52,7 @@ function Ln(l) {
52
52
  function no(l) {
53
53
  if (l.groups.length === 0)
54
54
  return !1;
55
- const s = Ce(l), t = Ln(l).sort((o, n) => o.offset - n.offset), e = t[t.length - 1];
55
+ const s = Ce(l), t = yn(l).sort((o, n) => o.offset - n.offset), e = t[t.length - 1];
56
56
  e.count = Math.min(s - e.offset, e.count);
57
57
  let i = 0;
58
58
  return t.forEach(({ count: o }) => i += o), s !== i;
@@ -91,18 +91,18 @@ function Ae(l) {
91
91
  const s = l[3] - l[0], t = l[4] - l[1], e = l[5] - l[2];
92
92
  return 2 * (s * t + t * e + e * s);
93
93
  }
94
- function Bs(l, s, t, e, i = null) {
95
- let o = 1 / 0, n = 1 / 0, r = 1 / 0, a = -1 / 0, c = -1 / 0, E = -1 / 0, d = 1 / 0, h = 1 / 0, u = 1 / 0, p = -1 / 0, T = -1 / 0, A = -1 / 0;
94
+ function Ys(l, s, t, e, i = null) {
95
+ let o = 1 / 0, n = 1 / 0, r = 1 / 0, a = -1 / 0, c = -1 / 0, E = -1 / 0, d = 1 / 0, h = 1 / 0, u = 1 / 0, p = -1 / 0, m = -1 / 0, A = -1 / 0;
96
96
  const C = i !== null;
97
- for (let m = s * 6, F = (s + t) * 6; m < F; m += 6) {
98
- const f = l[m + 0], R = l[m + 1], g = f - R, S = f + R;
97
+ for (let T = s * 6, F = (s + t) * 6; T < F; T += 6) {
98
+ const f = l[T + 0], R = l[T + 1], g = f - R, S = f + R;
99
99
  g < o && (o = g), S > a && (a = S), C && f < d && (d = f), C && f > p && (p = f);
100
- const _ = l[m + 2], N = l[m + 3], P = _ - N, M = _ + N;
101
- P < n && (n = P), M > c && (c = M), C && _ < h && (h = _), C && _ > T && (T = _);
102
- const L = l[m + 4], U = l[m + 5], b = L - U, B = L + U;
103
- b < r && (r = b), B > E && (E = B), C && L < u && (u = L), C && L > A && (A = L);
100
+ const _ = l[T + 2], N = l[T + 3], L = _ - N, M = _ + N;
101
+ L < n && (n = L), M > c && (c = M), C && _ < h && (h = _), C && _ > m && (m = _);
102
+ const y = l[T + 4], x = l[T + 5], b = y - x, B = y + x;
103
+ b < r && (r = b), B > E && (E = B), C && y < u && (u = y), C && y > A && (A = y);
104
104
  }
105
- e[0] = o, e[1] = n, e[2] = r, e[3] = a, e[4] = c, e[5] = E, C && (i[0] = d, i[1] = h, i[2] = u, i[3] = p, i[4] = T, i[5] = A);
105
+ e[0] = o, e[1] = n, e[2] = r, e[3] = a, e[4] = c, e[5] = E, C && (i[0] = d, i[1] = h, i[2] = u, i[3] = p, i[4] = m, i[5] = A);
106
106
  }
107
107
  function ro(l, s, t, e) {
108
108
  let i = 1 / 0, o = 1 / 0, n = 1 / 0, r = -1 / 0, a = -1 / 0, c = -1 / 0;
@@ -124,14 +124,14 @@ function ao(l, s) {
124
124
  const E = ["getX", "getY", "getZ"];
125
125
  for (let d = 0; d < i; d++) {
126
126
  const h = d * 3, u = d * 6;
127
- let p = h + 0, T = h + 1, A = h + 2;
128
- e && (p = e[p], T = e[T], A = e[A]), n || (p = p * c + a, T = T * c + a, A = A * c + a);
127
+ let p = h + 0, m = h + 1, A = h + 2;
128
+ e && (p = e[p], m = e[m], A = e[A]), n || (p = p * c + a, m = m * c + a, A = A * c + a);
129
129
  for (let C = 0; C < 3; C++) {
130
- let m, F, f;
131
- n ? (m = t[E[C]](p), F = t[E[C]](T), f = t[E[C]](A)) : (m = r[p + C], F = r[T + C], f = r[A + C]);
132
- let R = m;
130
+ let T, F, f;
131
+ n ? (T = t[E[C]](p), F = t[E[C]](m), f = t[E[C]](A)) : (T = r[p + C], F = r[m + C], f = r[A + C]);
132
+ let R = T;
133
133
  F < R && (R = F), f < R && (R = f);
134
- let g = m;
134
+ let g = T;
135
135
  F > g && (g = F), f > g && (g = f);
136
136
  const S = (g - R) / 2, _ = C * 2;
137
137
  o[u + _ + 0] = R + S, o[u + _ + 1] = S + (Math.abs(R) + S) * to, R < s[C] && (s[C] = R), g > s[C + 3] && (s[C + 3] = g);
@@ -148,22 +148,22 @@ const Mt = 32, co = (l, s) => l.candidate - s.candidate, xt = new Array(Mt).fill
148
148
  })), $e = new Float32Array(6);
149
149
  function lo(l, s, t, e, i, o) {
150
150
  let n = -1, r = 0;
151
- if (o === yn)
151
+ if (o === Pn)
152
152
  n = xi(s), n !== -1 && (r = (s[n] + s[n + 3]) / 2);
153
153
  else if (o === Kn)
154
154
  n = xi(l), n !== -1 && (r = ho(t, e, i, n));
155
155
  else if (o === Jn) {
156
156
  const a = Ae(l);
157
- let c = bs * i;
157
+ let c = vs * i;
158
158
  const E = e * 6, d = (e + i) * 6;
159
159
  for (let h = 0; h < 3; h++) {
160
160
  const u = s[h], A = (s[h + 3] - u) / Mt;
161
161
  if (i < Mt / 4) {
162
162
  const C = [...xt];
163
163
  C.length = i;
164
- let m = 0;
165
- for (let f = E; f < d; f += 6, m++) {
166
- const R = C[m];
164
+ let T = 0;
165
+ for (let f = E; f < d; f += 6, T++) {
166
+ const R = C[T];
167
167
  R.candidate = t[f + 2 * h], R.count = 0;
168
168
  const {
169
169
  bounds: g,
@@ -190,12 +190,12 @@ function lo(l, s, t, e, i, o) {
190
190
  }
191
191
  for (let f = 0; f < F; f++) {
192
192
  const R = C[f], g = R.count, S = i - R.count, _ = R.leftCacheBounds, N = R.rightCacheBounds;
193
- let P = 0;
194
- g !== 0 && (P = Ae(_) / a);
193
+ let L = 0;
194
+ g !== 0 && (L = Ae(_) / a);
195
195
  let M = 0;
196
196
  S !== 0 && (M = Ae(N) / a);
197
- const L = Ui + bs * (P * g + M * S);
198
- L < c && (n = h, c = L, r = R.candidate);
197
+ const y = Ui + vs * (L * g + M * S);
198
+ y < c && (n = h, c = y, r = R.candidate);
199
199
  }
200
200
  } else {
201
201
  for (let F = 0; F < Mt; F++) {
@@ -217,16 +217,16 @@ function lo(l, s, t, e, i, o) {
217
217
  const f = xt[F], R = xt[F + 1];
218
218
  vi(f.bounds, R.rightCacheBounds, f.rightCacheBounds);
219
219
  }
220
- let m = 0;
220
+ let T = 0;
221
221
  for (let F = 0; F < Mt - 1; F++) {
222
222
  const f = xt[F], R = f.count, g = f.bounds, _ = xt[F + 1].rightCacheBounds;
223
- R !== 0 && (m === 0 ? bi(g, $e) : vi(g, $e, $e)), m += R;
224
- let N = 0, P = 0;
225
- m !== 0 && (N = Ae($e) / a);
226
- const M = i - m;
227
- M !== 0 && (P = Ae(_) / a);
228
- const L = Ui + bs * (N * m + P * M);
229
- L < c && (n = h, c = L, r = f.candidate);
223
+ R !== 0 && (T === 0 ? bi(g, $e) : vi(g, $e, $e)), T += R;
224
+ let N = 0, L = 0;
225
+ T !== 0 && (N = Ae($e) / a);
226
+ const M = i - T;
227
+ M !== 0 && (L = Ae(_) / a);
228
+ const y = Ui + vs * (N * T + L * M);
229
+ y < c && (n = h, c = y, r = f.candidate);
230
230
  }
231
231
  }
232
232
  }
@@ -295,34 +295,34 @@ function Io(l, s) {
295
295
  function fo(l, s) {
296
296
  const t = l.geometry, e = t.index ? t.index.array : null, i = s.maxDepth, o = s.verbose, n = s.maxLeafTris, r = s.strategy, a = s.onProgress, c = Ce(t), E = l._indirectBuffer;
297
297
  let d = !1;
298
- const h = new Float32Array(6), u = new Float32Array(6), p = ao(t, h), T = s.indirect ? uo : Eo, A = [], C = s.indirect ? Pn(t) : Ln(t);
298
+ const h = new Float32Array(6), u = new Float32Array(6), p = ao(t, h), m = s.indirect ? uo : Eo, A = [], C = s.indirect ? Ln(t) : yn(t);
299
299
  if (C.length === 1) {
300
300
  const f = C[0], R = new Ke();
301
301
  R.boundingData = h, ro(p, f.offset, f.count, u), F(R, f.offset, f.count, u), A.push(R);
302
302
  } else
303
303
  for (let f of C) {
304
304
  const R = new Ke();
305
- R.boundingData = new Float32Array(6), Bs(p, f.offset, f.count, R.boundingData, u), F(R, f.offset, f.count, u), A.push(R);
305
+ R.boundingData = new Float32Array(6), Ys(p, f.offset, f.count, R.boundingData, u), F(R, f.offset, f.count, u), A.push(R);
306
306
  }
307
307
  return A;
308
- function m(f) {
308
+ function T(f) {
309
309
  a && a(f / c);
310
310
  }
311
311
  function F(f, R, g, S = null, _ = 0) {
312
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
- return m(R + g), f.offset = R, f.count = g, f;
313
+ return T(R + g), f.offset = R, f.count = g, f;
314
314
  const N = lo(f.boundingData, S, p, R, g, r);
315
315
  if (N.axis === -1)
316
- return m(R + g), f.offset = R, f.count = g, f;
317
- const P = T(E, e, p, R, g, N);
318
- if (P === R || P === R + g)
319
- m(R + g), f.offset = R, f.count = g;
316
+ return T(R + g), f.offset = R, f.count = g, f;
317
+ const L = m(E, e, p, R, g, N);
318
+ if (L === R || L === R + g)
319
+ T(R + g), f.offset = R, f.count = g;
320
320
  else {
321
321
  f.splitAxis = N.axis;
322
- const M = new Ke(), L = R, U = P - R;
323
- f.left = M, M.boundingData = new Float32Array(6), Bs(p, L, U, M.boundingData, u), F(M, L, U, u, _ + 1);
324
- const b = new Ke(), B = P, H = g - U;
325
- f.right = b, b.boundingData = new Float32Array(6), Bs(p, B, H, b.boundingData, u), F(b, B, H, u, _ + 1);
322
+ const M = new Ke(), y = R, x = L - R;
323
+ f.left = M, M.boundingData = new Float32Array(6), Ys(p, y, x, M.boundingData, u), F(M, y, x, u, _ + 1);
324
+ const b = new Ke(), B = L, H = g - x;
325
+ f.right = b, b.boundingData = new Float32Array(6), Ys(p, B, H, b.boundingData, u), F(b, B, H, u, _ + 1);
326
326
  }
327
327
  return f;
328
328
  }
@@ -347,18 +347,18 @@ function po(l, s) {
347
347
  return d.count ? 1 : 1 + c(d.left) + c(d.right);
348
348
  }
349
349
  function E(d, h) {
350
- const u = d / 4, p = d / 2, T = !!h.count, A = h.boundingData;
350
+ const u = d / 4, p = d / 2, m = !!h.count, A = h.boundingData;
351
351
  for (let C = 0; C < 6; C++)
352
352
  i[u + C] = A[C];
353
- if (T) {
354
- const C = h.offset, m = h.count;
355
- return o[u + 6] = C, n[p + 14] = m, n[p + 15] = ws, d + ms;
353
+ if (m) {
354
+ const C = h.offset, T = h.count;
355
+ return o[u + 6] = C, n[p + 14] = T, n[p + 15] = Ms, d + ms;
356
356
  } else {
357
- const C = h.left, m = h.right, F = h.splitAxis;
357
+ const C = h.left, T = h.right, F = h.splitAxis;
358
358
  let f;
359
359
  if (f = E(d + ms, C), f / 4 > Math.pow(2, 32))
360
360
  throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");
361
- return o[u + 6] = f / 4, f = E(f, m), o[u + 7] = F, f;
361
+ return o[u + 6] = f / 4, f = E(f, T), o[u + 7] = F, f;
362
362
  }
363
363
  }
364
364
  }
@@ -407,8 +407,8 @@ const Co = function() {
407
407
  const r = i.start, a = l, c = o.start, E = s;
408
408
  t.subVectors(r, c), l.subVectors(i.end, i.start), s.subVectors(o.end, o.start);
409
409
  const d = t.dot(E), h = E.dot(a), u = E.dot(E), p = t.dot(a), A = a.dot(a) * u - h * h;
410
- let C, m;
411
- A !== 0 ? C = (d * h - p * u) / A : C = 0, m = (d + C * h) / u, n.x = C, n.y = m;
410
+ let C, T;
411
+ A !== 0 ? C = (d * h - p * u) / A : C = 0, T = (d + C * h) / u, n.x = C, n.y = T;
412
412
  };
413
413
  }(), Ri = function() {
414
414
  const l = new pe(), s = new w(), t = new w();
@@ -440,21 +440,21 @@ const Co = function() {
440
440
  }
441
441
  };
442
442
  }(), To = function() {
443
- const l = new w(), s = new w(), t = new mi(), e = new Lt();
443
+ const l = new w(), s = new w(), t = new mi(), e = new yt();
444
444
  return function(o, n) {
445
445
  const { radius: r, center: a } = o, { a: c, b: E, c: d } = n;
446
446
  if (e.start = c, e.end = E, e.closestPointToPoint(a, !0, l).distanceTo(a) <= r || (e.start = c, e.end = d, e.closestPointToPoint(a, !0, l).distanceTo(a) <= r) || (e.start = E, e.end = d, e.closestPointToPoint(a, !0, l).distanceTo(a) <= r))
447
447
  return !0;
448
- const T = n.getPlane(t);
449
- if (Math.abs(T.distanceToPoint(a)) <= r) {
450
- const C = T.projectPoint(a, s);
448
+ const m = n.getPlane(t);
449
+ if (Math.abs(m.distanceToPoint(a)) <= r) {
450
+ const C = m.projectPoint(a, s);
451
451
  if (n.containsPoint(C))
452
452
  return !0;
453
453
  }
454
454
  return !1;
455
455
  };
456
456
  }(), mo = 1e-15;
457
- function Ys(l) {
457
+ function Vs(l) {
458
458
  return Math.abs(l) < mo;
459
459
  }
460
460
  class gt extends Ie {
@@ -476,7 +476,7 @@ class gt extends Ie {
476
476
  }
477
477
  }
478
478
  gt.prototype.closestPointToSegment = function() {
479
- const l = new w(), s = new w(), t = new Lt();
479
+ const l = new w(), s = new w(), t = new yt();
480
480
  return function(i, o = null, n = null) {
481
481
  const { start: r, end: a } = i, c = this.points;
482
482
  let E, d = 1 / 0;
@@ -488,20 +488,20 @@ gt.prototype.closestPointToSegment = function() {
488
488
  };
489
489
  }();
490
490
  gt.prototype.intersectsTriangle = function() {
491
- const l = new gt(), s = new Array(3), t = new Array(3), e = new Dt(), i = new Dt(), o = new w(), n = new w(), r = new w(), a = new w(), c = new w(), E = new Lt(), d = new Lt(), h = new Lt(), u = new w();
492
- function p(T, A, C) {
493
- const m = T.points;
491
+ const l = new gt(), s = new Array(3), t = new Array(3), e = new Dt(), i = new Dt(), o = new w(), n = new w(), r = new w(), a = new w(), c = new w(), E = new yt(), d = new yt(), h = new yt(), u = new w();
492
+ function p(m, A, C) {
493
+ const T = m.points;
494
494
  let F = 0, f = -1;
495
495
  for (let R = 0; R < 3; R++) {
496
496
  const { start: g, end: S } = E;
497
- g.copy(m[R]), S.copy(m[(R + 1) % 3]), E.delta(n);
498
- const _ = Ys(A.distanceToPoint(g));
499
- if (Ys(A.normal.dot(n)) && _) {
497
+ g.copy(T[R]), S.copy(T[(R + 1) % 3]), E.delta(n);
498
+ const _ = Vs(A.distanceToPoint(g));
499
+ if (Vs(A.normal.dot(n)) && _) {
500
500
  C.copy(E), F = 2;
501
501
  break;
502
502
  }
503
503
  const N = A.intersectLine(E, u);
504
- if (!N && _ && u.copy(g), (N || _) && !Ys(u.distanceTo(S))) {
504
+ if (!N && _ && u.copy(g), (N || _) && !Vs(u.distanceTo(S))) {
505
505
  if (F <= 1)
506
506
  (F === 1 ? C.start : C.end).copy(u), _ && (f = F);
507
507
  else if (F >= 2) {
@@ -514,33 +514,33 @@ gt.prototype.intersectsTriangle = function() {
514
514
  }
515
515
  return F;
516
516
  }
517
- return function(A, C = null, m = !1) {
517
+ return function(A, C = null, T = !1) {
518
518
  this.needsUpdate && this.update(), A.isExtendedTriangle ? A.needsUpdate && A.update() : (l.copy(A), l.update(), A = l);
519
519
  const F = this.plane, f = A.plane;
520
520
  if (Math.abs(F.normal.dot(f.normal)) > 1 - 1e-10) {
521
521
  const R = this.satBounds, g = this.satAxes;
522
522
  t[0] = A.a, t[1] = A.b, t[2] = A.c;
523
523
  for (let N = 0; N < 4; N++) {
524
- const P = R[N], M = g[N];
525
- if (e.setFromPoints(M, t), P.isSeparated(e))
524
+ const L = R[N], M = g[N];
525
+ if (e.setFromPoints(M, t), L.isSeparated(e))
526
526
  return !1;
527
527
  }
528
528
  const S = A.satBounds, _ = A.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 P = S[N], M = _[N];
532
- if (e.setFromPoints(M, s), P.isSeparated(e))
531
+ const L = S[N], M = _[N];
532
+ if (e.setFromPoints(M, s), L.isSeparated(e))
533
533
  return !1;
534
534
  }
535
535
  for (let N = 0; N < 4; N++) {
536
- const P = g[N];
536
+ const L = g[N];
537
537
  for (let M = 0; M < 4; M++) {
538
- const L = _[M];
539
- if (o.crossVectors(P, L), e.setFromPoints(o, s), i.setFromPoints(o, t), e.isSeparated(i))
538
+ const y = _[M];
539
+ if (o.crossVectors(L, y), e.setFromPoints(o, s), i.setFromPoints(o, t), e.isSeparated(i))
540
540
  return !1;
541
541
  }
542
542
  }
543
- return C && (m || console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."), C.start.set(0, 0, 0), C.end.set(0, 0, 0)), !0;
543
+ return C && (T || console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."), C.start.set(0, 0, 0), C.end.set(0, 0, 0)), !0;
544
544
  } else {
545
545
  const R = p(this, f, d);
546
546
  if (R === 1 && A.containsPoint(d.end))
@@ -553,11 +553,11 @@ gt.prototype.intersectsTriangle = function() {
553
553
  if (g !== 2)
554
554
  return !1;
555
555
  if (d.delta(r), h.delta(a), r.dot(a) < 0) {
556
- let U = h.start;
557
- h.start = h.end, h.end = U;
556
+ let x = h.start;
557
+ h.start = h.end, h.end = x;
558
558
  }
559
- const S = d.start.dot(r), _ = d.end.dot(r), N = h.start.dot(r), P = h.end.dot(r), M = _ < N, L = S < P;
560
- return S !== P && N !== _ && M === L ? !1 : (C && (c.subVectors(d.start, h.start), c.dot(r) > 0 ? C.start.copy(d.start) : C.start.copy(h.start), c.subVectors(d.end, h.end), c.dot(r) < 0 ? C.end.copy(d.end) : C.end.copy(h.end)), !0);
559
+ const S = d.start.dot(r), _ = d.end.dot(r), N = h.start.dot(r), L = h.end.dot(r), M = _ < N, y = S < L;
560
+ return S !== L && N !== _ && M === y ? !1 : (C && (c.subVectors(d.start, h.start), c.dot(r) > 0 ? C.start.copy(d.start) : C.start.copy(h.start), c.subVectors(d.end, h.end), c.dot(r) < 0 ? C.end.copy(d.end) : C.end.copy(h.end)), !0);
561
561
  }
562
562
  };
563
563
  }();
@@ -568,7 +568,7 @@ gt.prototype.distanceToPoint = function() {
568
568
  };
569
569
  }();
570
570
  gt.prototype.distanceToTriangle = function() {
571
- const l = new w(), s = new w(), t = ["a", "b", "c"], e = new Lt(), i = new Lt();
571
+ const l = new w(), s = new w(), t = ["a", "b", "c"], e = new yt(), i = new yt();
572
572
  return function(n, r = null, a = null) {
573
573
  const c = r || a ? e : null;
574
574
  if (this.intersectsTriangle(n, c))
@@ -578,15 +578,15 @@ gt.prototype.distanceToTriangle = function() {
578
578
  let h;
579
579
  const u = t[d], p = n[u];
580
580
  this.closestPointToPoint(p, l), h = p.distanceToSquared(l), h < E && (E = h, r && r.copy(l), a && a.copy(p));
581
- const T = this[u];
582
- n.closestPointToPoint(T, l), h = T.distanceToSquared(l), h < E && (E = h, r && r.copy(T), a && a.copy(l));
581
+ const m = this[u];
582
+ n.closestPointToPoint(m, l), h = m.distanceToSquared(l), h < E && (E = h, r && r.copy(m), a && a.copy(l));
583
583
  }
584
584
  for (let d = 0; d < 3; d++) {
585
585
  const h = t[d], u = t[(d + 1) % 3];
586
586
  e.set(this[h], this[u]);
587
587
  for (let p = 0; p < 3; p++) {
588
- const T = t[p], A = t[(p + 1) % 3];
589
- i.set(n[T], n[A]), Ri(e, i, l, s);
588
+ const m = t[p], A = t[(p + 1) % 3];
589
+ i.set(n[m], n[A]), Ri(e, i, l, s);
590
590
  const C = l.distanceToSquared(s);
591
591
  C < E && (E = C, r && r.copy(l), a && a.copy(s));
592
592
  }
@@ -658,8 +658,8 @@ ct.prototype.intersectsTriangle = function() {
658
658
  for (let h = 0; h < 3; h++) {
659
659
  const u = a[h];
660
660
  for (let p = 0; p < 4; p++) {
661
- const T = E[p];
662
- if (i.crossVectors(u, T), t.setFromPoints(i, s), e.setFromPoints(i, d), t.isSeparated(e))
661
+ const m = E[p];
662
+ if (i.crossVectors(u, m), t.setFromPoints(i, s), e.setFromPoints(i, d), t.isSeparated(e))
663
663
  return !1;
664
664
  }
665
665
  }
@@ -678,7 +678,7 @@ ct.prototype.distanceToPoint = function() {
678
678
  };
679
679
  }();
680
680
  ct.prototype.distanceToBox = function() {
681
- const l = ["x", "y", "z"], s = new Array(12).fill().map(() => new Lt()), t = new Array(12).fill().map(() => new Lt()), e = new w(), i = new w();
681
+ const l = ["x", "y", "z"], s = new Array(12).fill().map(() => new yt()), t = new Array(12).fill().map(() => new yt()), e = new w(), i = new w();
682
682
  return function(n, r = 0, a = null, c = null) {
683
683
  if (this.needsUpdate && this.update(), this.intersectsBox(n))
684
684
  return (a || c) && (n.getCenter(i), this.closestPointToPoint(i, e), n.closestPointToPoint(e, i), a && a.copy(e), c && c.copy(i)), 0;
@@ -687,31 +687,31 @@ ct.prototype.distanceToBox = function() {
687
687
  for (let A = 0; A < 8; A++) {
688
688
  const C = u[A];
689
689
  i.copy(C).clamp(d, h);
690
- const m = C.distanceToSquared(i);
691
- if (m < p && (p = m, a && a.copy(C), c && c.copy(i), m < E))
692
- return Math.sqrt(m);
690
+ const T = C.distanceToSquared(i);
691
+ if (T < p && (p = T, a && a.copy(C), c && c.copy(i), T < E))
692
+ return Math.sqrt(T);
693
693
  }
694
- let T = 0;
694
+ let m = 0;
695
695
  for (let A = 0; A < 3; A++)
696
696
  for (let C = 0; C <= 1; C++)
697
- for (let m = 0; m <= 1; m++) {
698
- const F = (A + 1) % 3, f = (A + 2) % 3, R = C << F | m << f, g = 1 << A | C << F | m << f, S = u[R], _ = u[g];
699
- s[T].set(S, _);
700
- const P = l[A], M = l[F], L = l[f], U = t[T], b = U.start, B = U.end;
701
- b[P] = d[P], b[M] = C ? d[M] : h[M], b[L] = m ? d[L] : h[M], B[P] = h[P], B[M] = C ? d[M] : h[M], B[L] = m ? d[L] : h[M], T++;
697
+ for (let T = 0; T <= 1; T++) {
698
+ const F = (A + 1) % 3, f = (A + 2) % 3, R = C << F | T << f, g = 1 << A | C << F | T << f, S = u[R], _ = u[g];
699
+ s[m].set(S, _);
700
+ const L = l[A], M = l[F], y = l[f], x = t[m], b = x.start, B = x.end;
701
+ b[L] = d[L], b[M] = C ? d[M] : h[M], b[y] = T ? d[y] : h[M], B[L] = h[L], B[M] = C ? d[M] : h[M], B[y] = T ? d[y] : h[M], m++;
702
702
  }
703
703
  for (let A = 0; A <= 1; A++)
704
704
  for (let C = 0; C <= 1; C++)
705
- for (let m = 0; m <= 1; m++) {
706
- i.x = A ? h.x : d.x, i.y = C ? h.y : d.y, i.z = m ? h.z : d.z, this.closestPointToPoint(i, e);
705
+ for (let T = 0; T <= 1; T++) {
706
+ i.x = A ? h.x : d.x, i.y = C ? h.y : d.y, i.z = T ? h.z : d.z, this.closestPointToPoint(i, e);
707
707
  const F = i.distanceToSquared(e);
708
708
  if (F < p && (p = F, a && a.copy(e), c && c.copy(i), F < E))
709
709
  return Math.sqrt(F);
710
710
  }
711
711
  for (let A = 0; A < 12; A++) {
712
712
  const C = s[A];
713
- for (let m = 0; m < 12; m++) {
714
- const F = t[m];
713
+ for (let T = 0; T < 12; T++) {
714
+ const F = t[T];
715
715
  Ri(C, F, e, i);
716
716
  const f = e.distanceToSquared(i);
717
717
  if (f < p && (p = f, a && a.copy(e), c && c.copy(i), f < E))
@@ -774,46 +774,46 @@ let Vt, fe;
774
774
  const te = [], Je = /* @__PURE__ */ new Ai(() => new Ot());
775
775
  function Fo(l, s, t, e, i, o) {
776
776
  Vt = Je.getPrimitive(), fe = Je.getPrimitive(), te.push(Vt, fe), Z.setBuffer(l._roots[s]);
777
- const n = ni(0, l.geometry, t, e, i, o);
777
+ const n = oi(0, l.geometry, t, e, i, o);
778
778
  Z.clearBuffer(), Je.releasePrimitive(Vt), Je.releasePrimitive(fe), te.pop(), te.pop();
779
779
  const r = te.length;
780
780
  return r > 0 && (fe = te[r - 1], Vt = te[r - 2]), n;
781
781
  }
782
- function ni(l, s, t, e, i = null, o = 0, n = 0) {
782
+ function oi(l, s, t, e, i = null, o = 0, n = 0) {
783
783
  const { float32Array: r, uint16Array: a, uint32Array: c } = Z;
784
784
  let E = l * 2;
785
785
  if (Et(E, a)) {
786
786
  const h = dt(l, c), u = ft(E, a);
787
787
  return $(l, r, Vt), e(h, u, !1, n, o + l, Vt);
788
788
  } else {
789
- let P = function(L) {
790
- const { uint16Array: U, uint32Array: b } = Z;
791
- let B = L * 2;
792
- for (; !Et(B, U); )
793
- L = pt(L), B = L * 2;
794
- return dt(L, b);
795
- }, M = function(L) {
796
- const { uint16Array: U, uint32Array: b } = Z;
797
- let B = L * 2;
798
- for (; !Et(B, U); )
799
- L = Ct(L, b), B = L * 2;
800
- return dt(L, b) + ft(B, U);
789
+ let L = function(y) {
790
+ const { uint16Array: x, uint32Array: b } = Z;
791
+ let B = y * 2;
792
+ for (; !Et(B, x); )
793
+ y = pt(y), B = y * 2;
794
+ return dt(y, b);
795
+ }, M = function(y) {
796
+ const { uint16Array: x, uint32Array: b } = Z;
797
+ let B = y * 2;
798
+ for (; !Et(B, x); )
799
+ y = Ct(y, b), B = y * 2;
800
+ return dt(y, b) + ft(B, x);
801
801
  };
802
802
  const h = pt(l), u = Ct(l, c);
803
- let p = h, T = u, A, C, m, F;
804
- if (i && (m = Vt, F = fe, $(p, r, m), $(T, r, F), A = i(m), C = i(F), C < A)) {
805
- p = u, T = h;
806
- const L = A;
807
- A = C, C = L, m = F;
808
- }
809
- m || (m = Vt, $(p, r, m));
810
- const f = Et(p * 2, a), R = t(m, f, A, n + 1, o + p);
803
+ let p = h, m = u, A, C, T, F;
804
+ if (i && (T = Vt, F = fe, $(p, r, T), $(m, r, F), A = i(T), C = i(F), C < A)) {
805
+ p = u, m = h;
806
+ const y = A;
807
+ A = C, C = y, T = F;
808
+ }
809
+ T || (T = Vt, $(p, r, T));
810
+ const f = Et(p * 2, a), R = t(T, f, A, n + 1, o + p);
811
811
  let g;
812
812
  if (R === Di) {
813
- const L = P(p), b = M(p) - L;
814
- g = e(L, b, !0, n + 1, o + p, m);
813
+ const y = L(p), b = M(p) - y;
814
+ g = e(y, b, !0, n + 1, o + p, T);
815
815
  } else
816
- g = R && ni(
816
+ g = R && oi(
817
817
  p,
818
818
  s,
819
819
  t,
@@ -824,15 +824,15 @@ function ni(l, s, t, e, i = null, o = 0, n = 0) {
824
824
  );
825
825
  if (g)
826
826
  return !0;
827
- F = fe, $(T, r, F);
828
- const S = Et(T * 2, a), _ = t(F, S, C, n + 1, o + T);
827
+ F = fe, $(m, r, F);
828
+ const S = Et(m * 2, a), _ = t(F, S, C, n + 1, o + m);
829
829
  let N;
830
830
  if (_ === Di) {
831
- const L = P(T), b = M(T) - L;
832
- N = e(L, b, !0, n + 1, o + T, F);
831
+ const y = L(m), b = M(m) - y;
832
+ N = e(y, b, !0, n + 1, o + m, F);
833
833
  } else
834
- N = _ && ni(
835
- T,
834
+ N = _ && oi(
835
+ m,
836
836
  s,
837
837
  t,
838
838
  e,
@@ -843,7 +843,7 @@ function ni(l, s, t, e, i = null, o = 0, n = 0) {
843
843
  return !!N;
844
844
  }
845
845
  }
846
- const Fe = /* @__PURE__ */ new w(), Vs = /* @__PURE__ */ new w();
846
+ const Fe = /* @__PURE__ */ new w(), Gs = /* @__PURE__ */ new w();
847
847
  function go(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;
@@ -854,13 +854,13 @@ function go(l, s, t = {}, e = 0, i = 1 / 0) {
854
854
  intersectsTriangle: (E, d) => {
855
855
  E.closestPointToPoint(s, Fe);
856
856
  const h = s.distanceToSquared(Fe);
857
- return h < r && (Vs.copy(Fe), r = h, a = d), h < o;
857
+ return h < r && (Gs.copy(Fe), r = h, a = d), h < o;
858
858
  }
859
859
  }
860
860
  ), r === 1 / 0)
861
861
  return null;
862
862
  const c = Math.sqrt(r);
863
- return t.point ? t.point.copy(Vs) : t.point = Vs.clone(), t.distance = c, t.faceIndex = a, t;
863
+ return t.point ? t.point.copy(Gs) : t.point = Gs.clone(), t.distance = c, t.faceIndex = a, t;
864
864
  }
865
865
  const ee = /* @__PURE__ */ new w(), se = /* @__PURE__ */ new w(), ie = /* @__PURE__ */ new w(), ts = /* @__PURE__ */ new pe(), es = /* @__PURE__ */ new pe(), ss = /* @__PURE__ */ new pe(), Bi = /* @__PURE__ */ new w(), Yi = /* @__PURE__ */ new w(), Vi = /* @__PURE__ */ new w(), is = /* @__PURE__ */ new w();
866
866
  function Oo(l, s, t, e, i, o) {
@@ -886,7 +886,7 @@ function So(l, s, t, e, i, o, n, r, a) {
886
886
  }
887
887
  return c;
888
888
  }
889
- function Ms(l, s, t, e, i) {
889
+ function Ds(l, s, t, e, i) {
890
890
  const o = e * 3;
891
891
  let n = o + 0, r = o + 1, a = o + 2;
892
892
  const c = l.index;
@@ -902,18 +902,18 @@ function et(l, s, t, e) {
902
902
  function _o(l, s, t, e, i, o) {
903
903
  const { geometry: n, _indirectBuffer: r } = l;
904
904
  for (let a = e, c = e + i; a < c; a++)
905
- Ms(n, s, t, a, o);
905
+ Ds(n, s, t, a, o);
906
906
  }
907
907
  function No(l, s, t, e, i) {
908
908
  const { geometry: o, _indirectBuffer: n } = l;
909
909
  let r = 1 / 0, a = null;
910
910
  for (let c = e, E = e + i; c < E; c++) {
911
911
  let d;
912
- d = Ms(o, s, t, c), d && d.distance < r && (a = d, r = d.distance);
912
+ d = Ds(o, s, t, c), d && d.distance < r && (a = d, r = d.distance);
913
913
  }
914
914
  return a;
915
915
  }
916
- function yo(l, s, t, e, i, o, n) {
916
+ function Po(l, s, t, e, i, o, n) {
917
917
  const { geometry: r } = t, { index: a } = r, c = r.attributes.position;
918
918
  for (let E = l, d = s + l; E < d; E++) {
919
919
  let h;
@@ -922,7 +922,7 @@ function yo(l, s, t, e, i, o, n) {
922
922
  }
923
923
  return !1;
924
924
  }
925
- function Po(l, s = null) {
925
+ function Lo(l, s = null) {
926
926
  s && Array.isArray(s) && (s = new Set(s));
927
927
  const t = l.geometry, e = t.index ? t.index.array : null, i = t.attributes.position;
928
928
  let o, n, r, a, c = 0;
@@ -930,32 +930,32 @@ function Po(l, s = null) {
930
930
  for (let h = 0, u = E.length; h < u; h++)
931
931
  o = E[h], n = new Uint32Array(o), r = new Uint16Array(o), a = new Float32Array(o), d(0, c), c += o.byteLength;
932
932
  function d(h, u, p = !1) {
933
- const T = h * 2;
934
- if (r[T + 15] === ws) {
935
- const C = n[h + 6], m = r[T + 14];
933
+ const m = h * 2;
934
+ if (r[m + 15] === Ms) {
935
+ const C = n[h + 6], T = r[m + 14];
936
936
  let F = 1 / 0, f = 1 / 0, R = 1 / 0, g = -1 / 0, S = -1 / 0, _ = -1 / 0;
937
- for (let N = 3 * C, P = 3 * (C + m); N < P; N++) {
937
+ for (let N = 3 * C, L = 3 * (C + T); N < L; N++) {
938
938
  let M = e[N];
939
- const L = i.getX(M), U = i.getY(M), b = i.getZ(M);
940
- L < F && (F = L), L > g && (g = L), U < f && (f = U), U > S && (S = U), b < R && (R = b), b > _ && (_ = b);
939
+ const y = i.getX(M), x = i.getY(M), b = i.getZ(M);
940
+ y < F && (F = y), y > g && (g = y), x < f && (f = x), x > S && (S = x), b < R && (R = b), b > _ && (_ = b);
941
941
  }
942
942
  return a[h + 0] !== F || a[h + 1] !== f || a[h + 2] !== R || a[h + 3] !== g || a[h + 4] !== S || a[h + 5] !== _ ? (a[h + 0] = F, a[h + 1] = f, a[h + 2] = R, a[h + 3] = g, a[h + 4] = S, a[h + 5] = _, !0) : !1;
943
943
  } else {
944
- const C = h + 8, m = n[h + 6], F = C + u, f = m + u;
944
+ const C = h + 8, T = n[h + 6], F = C + u, f = T + u;
945
945
  let R = p, g = !1, S = !1;
946
946
  s ? R || (g = s.has(F), S = s.has(f), R = !g && !S) : (g = !0, S = !0);
947
947
  const _ = R || g, N = R || S;
948
- let P = !1;
949
- _ && (P = d(C, u, R));
948
+ let L = !1;
949
+ _ && (L = d(C, u, R));
950
950
  let M = !1;
951
- N && (M = d(m, u, R));
952
- const L = P || M;
953
- if (L)
954
- for (let U = 0; U < 3; U++) {
955
- const b = C + U, B = m + U, H = a[b], q = a[b + 3], st = a[B], Q = a[B + 3];
956
- a[h + U] = H < st ? H : st, a[h + U + 3] = q > Q ? q : Q;
951
+ N && (M = d(T, u, R));
952
+ const y = L || M;
953
+ if (y)
954
+ for (let x = 0; x < 3; x++) {
955
+ const b = C + x, B = T + x, H = a[b], q = a[b + 3], st = a[B], Q = a[B + 3];
956
+ a[h + x] = H < st ? H : st, a[h + x + 3] = q > Q ? q : Q;
957
957
  }
958
- return L;
958
+ return y;
959
959
  }
960
960
  }
961
961
  }
@@ -963,11 +963,11 @@ const Gi = /* @__PURE__ */ new Ot();
963
963
  function zt(l, s, t, e) {
964
964
  return $(l, s, Gi), t.intersectBox(Gi, e);
965
965
  }
966
- function Lo(l, s, t, e, i, o) {
966
+ function yo(l, s, t, e, i, o) {
967
967
  const { geometry: n, _indirectBuffer: r } = l;
968
968
  for (let a = e, c = e + i; a < c; a++) {
969
969
  let E = r ? r[a] : a;
970
- Ms(n, s, t, E, o);
970
+ Ds(n, s, t, E, o);
971
971
  }
972
972
  }
973
973
  function wo(l, s, t, e, i) {
@@ -975,7 +975,7 @@ function wo(l, s, t, e, i) {
975
975
  let r = 1 / 0, a = null;
976
976
  for (let c = e, E = e + i; c < E; c++) {
977
977
  let d;
978
- d = Ms(o, s, t, n ? n[c] : c), d && d.distance < r && (a = d, r = d.distance);
978
+ d = Ds(o, s, t, n ? n[c] : c), d && d.distance < r && (a = d, r = d.distance);
979
979
  }
980
980
  return a;
981
981
  }
@@ -990,27 +990,27 @@ function Mo(l, s, t, e, i, o, n) {
990
990
  }
991
991
  const zi = /* @__PURE__ */ new w();
992
992
  function Do(l, s, t, e, i) {
993
- Z.setBuffer(l._roots[s]), oi(0, l, t, e, i), Z.clearBuffer();
993
+ Z.setBuffer(l._roots[s]), ri(0, l, t, e, i), Z.clearBuffer();
994
994
  }
995
- function oi(l, s, t, e, i) {
995
+ function ri(l, s, t, e, i) {
996
996
  const { float32Array: o, uint16Array: n, uint32Array: r } = Z, a = l * 2;
997
997
  if (Et(a, n)) {
998
998
  const E = dt(l, r), d = ft(a, n);
999
999
  _o(s, t, e, E, d, i);
1000
1000
  } else {
1001
1001
  const E = pt(l);
1002
- zt(E, o, e, zi) && oi(E, s, t, e, i);
1002
+ zt(E, o, e, zi) && ri(E, s, t, e, i);
1003
1003
  const d = Ct(l, r);
1004
- zt(d, o, e, zi) && oi(d, s, t, e, i);
1004
+ zt(d, o, e, zi) && ri(d, s, t, e, i);
1005
1005
  }
1006
1006
  }
1007
1007
  const Hi = /* @__PURE__ */ new w(), Uo = ["x", "y", "z"];
1008
1008
  function xo(l, s, t, e) {
1009
1009
  Z.setBuffer(l._roots[s]);
1010
- const i = ri(0, l, t, e);
1010
+ const i = ai(0, l, t, e);
1011
1011
  return Z.clearBuffer(), i;
1012
1012
  }
1013
- function ri(l, s, t, e) {
1013
+ function ai(l, s, t, e) {
1014
1014
  const { float32Array: i, uint16Array: o, uint32Array: n } = Z;
1015
1015
  let r = l * 2;
1016
1016
  if (Et(r, o)) {
@@ -1020,7 +1020,7 @@ function ri(l, s, t, e) {
1020
1020
  const c = wn(l, n), E = Uo[c], h = e.direction[E] >= 0;
1021
1021
  let u, p;
1022
1022
  h ? (u = pt(l), p = Ct(l, n)) : (u = Ct(l, n), p = pt(l));
1023
- const A = zt(u, i, e, Hi) ? ri(u, s, t, e) : null;
1023
+ const A = zt(u, i, e, Hi) ? ai(u, s, t, e) : null;
1024
1024
  if (A) {
1025
1025
  const F = A.point[E];
1026
1026
  if (h ? F <= i[p + c] : (
@@ -1029,33 +1029,33 @@ function ri(l, s, t, e) {
1029
1029
  ))
1030
1030
  return A;
1031
1031
  }
1032
- const m = zt(p, i, e, Hi) ? ri(p, s, t, e) : null;
1033
- return A && m ? A.distance <= m.distance ? A : m : A || m || null;
1032
+ const T = zt(p, i, e, Hi) ? ai(p, s, t, e) : null;
1033
+ return A && T ? A.distance <= T.distance ? A : T : A || T || null;
1034
1034
  }
1035
1035
  }
1036
1036
  const ns = /* @__PURE__ */ new Ot(), ne = /* @__PURE__ */ new gt(), oe = /* @__PURE__ */ new gt(), ge = /* @__PURE__ */ new wt(), ki = /* @__PURE__ */ new ct(), os = /* @__PURE__ */ new ct();
1037
1037
  function bo(l, s, t, e) {
1038
1038
  Z.setBuffer(l._roots[s]);
1039
- const i = ai(0, l, t, e);
1039
+ const i = ci(0, l, t, e);
1040
1040
  return Z.clearBuffer(), i;
1041
1041
  }
1042
- function ai(l, s, t, e, i = null) {
1042
+ function ci(l, s, t, e, i = null) {
1043
1043
  const { float32Array: o, uint16Array: n, uint32Array: r } = Z;
1044
1044
  let a = l * 2;
1045
1045
  if (i === null && (t.boundingBox || t.computeBoundingBox(), ki.set(t.boundingBox.min, t.boundingBox.max, e), i = ki), Et(a, n)) {
1046
- const E = s.geometry, d = E.index, h = E.attributes.position, u = t.index, p = t.attributes.position, T = dt(l, r), A = ft(a, n);
1046
+ const E = s.geometry, d = E.index, h = E.attributes.position, u = t.index, p = t.attributes.position, m = dt(l, r), A = ft(a, n);
1047
1047
  if (ge.copy(e).invert(), t.boundsTree)
1048
1048
  return $(l, o, os), os.matrix.copy(ge), os.needsUpdate = !0, t.boundsTree.shapecast({
1049
- intersectsBounds: (m) => os.intersectsBox(m),
1050
- intersectsTriangle: (m) => {
1051
- m.a.applyMatrix4(e), m.b.applyMatrix4(e), m.c.applyMatrix4(e), m.needsUpdate = !0;
1052
- for (let F = T * 3, f = (A + T) * 3; F < f; F += 3)
1053
- if (et(oe, F, d, h), oe.needsUpdate = !0, m.intersectsTriangle(oe))
1049
+ intersectsBounds: (T) => os.intersectsBox(T),
1050
+ intersectsTriangle: (T) => {
1051
+ T.a.applyMatrix4(e), T.b.applyMatrix4(e), T.c.applyMatrix4(e), T.needsUpdate = !0;
1052
+ for (let F = m * 3, f = (A + m) * 3; F < f; F += 3)
1053
+ if (et(oe, F, d, h), oe.needsUpdate = !0, T.intersectsTriangle(oe))
1054
1054
  return !0;
1055
1055
  return !1;
1056
1056
  }
1057
1057
  });
1058
- for (let C = T * 3, m = (A + T) * 3; C < m; C += 3) {
1058
+ for (let C = m * 3, T = (A + m) * 3; C < T; C += 3) {
1059
1059
  et(ne, C, d, h), ne.a.applyMatrix4(ge), ne.b.applyMatrix4(ge), ne.c.applyMatrix4(ge), ne.needsUpdate = !0;
1060
1060
  for (let F = 0, f = u.count; F < f; F += 3)
1061
1061
  if (et(oe, F, u, p), oe.needsUpdate = !0, ne.intersectsTriangle(oe))
@@ -1063,32 +1063,32 @@ function ai(l, s, t, e, i = null) {
1063
1063
  }
1064
1064
  } else {
1065
1065
  const E = l + 8, d = r[l + 6];
1066
- return $(E, o, ns), !!(i.intersectsBox(ns) && ai(E, s, t, e, i) || ($(d, o, ns), i.intersectsBox(ns) && ai(d, s, t, e, i)));
1066
+ return $(E, o, ns), !!(i.intersectsBox(ns) && ci(E, s, t, e, i) || ($(d, o, ns), i.intersectsBox(ns) && ci(d, s, t, e, i)));
1067
1067
  }
1068
1068
  }
1069
- const rs = /* @__PURE__ */ new wt(), Gs = /* @__PURE__ */ new ct(), Oe = /* @__PURE__ */ new ct(), vo = /* @__PURE__ */ new w(), Bo = /* @__PURE__ */ new w(), Yo = /* @__PURE__ */ new w(), Vo = /* @__PURE__ */ new w();
1069
+ const rs = /* @__PURE__ */ new wt(), zs = /* @__PURE__ */ new ct(), Oe = /* @__PURE__ */ new ct(), vo = /* @__PURE__ */ new w(), Bo = /* @__PURE__ */ new w(), Yo = /* @__PURE__ */ new w(), Vo = /* @__PURE__ */ new w();
1070
1070
  function Go(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1071
- s.boundingBox || s.computeBoundingBox(), Gs.set(s.boundingBox.min, s.boundingBox.max, t), Gs.needsUpdate = !0;
1071
+ s.boundingBox || s.computeBoundingBox(), zs.set(s.boundingBox.min, s.boundingBox.max, t), zs.needsUpdate = !0;
1072
1072
  const r = l.geometry, a = r.attributes.position, c = r.index, E = s.attributes.position, d = s.index, h = It.getPrimitive(), u = It.getPrimitive();
1073
- let p = vo, T = Bo, A = null, C = null;
1073
+ let p = vo, m = Bo, A = null, C = null;
1074
1074
  i && (A = Yo, C = Vo);
1075
- let m = 1 / 0, F = null, f = null;
1075
+ let T = 1 / 0, F = null, f = null;
1076
1076
  return rs.copy(t).invert(), Oe.matrix.copy(rs), l.shapecast(
1077
1077
  {
1078
- boundsTraverseOrder: (R) => Gs.distanceToBox(R),
1079
- intersectsBounds: (R, g, S) => S < m && S < n ? (g && (Oe.min.copy(R.min), Oe.max.copy(R.max), Oe.needsUpdate = !0), !0) : !1,
1078
+ boundsTraverseOrder: (R) => zs.distanceToBox(R),
1079
+ intersectsBounds: (R, g, S) => S < T && S < n ? (g && (Oe.min.copy(R.min), Oe.max.copy(R.max), Oe.needsUpdate = !0), !0) : !1,
1080
1080
  intersectsRange: (R, g) => {
1081
1081
  if (s.boundsTree)
1082
1082
  return s.boundsTree.shapecast({
1083
1083
  boundsTraverseOrder: (_) => Oe.distanceToBox(_),
1084
- intersectsBounds: (_, N, P) => P < m && P < n,
1084
+ intersectsBounds: (_, N, L) => L < T && L < n,
1085
1085
  intersectsRange: (_, N) => {
1086
- for (let P = _, M = _ + N; P < M; P++) {
1087
- et(u, 3 * P, d, E), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1088
- for (let L = R, U = R + g; L < U; L++) {
1089
- et(h, 3 * L, c, a), h.needsUpdate = !0;
1086
+ for (let L = _, M = _ + N; L < M; L++) {
1087
+ et(u, 3 * L, d, E), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1088
+ for (let y = R, x = R + g; y < x; y++) {
1089
+ et(h, 3 * y, c, a), h.needsUpdate = !0;
1090
1090
  const b = h.distanceToTriangle(u, p, A);
1091
- if (b < m && (T.copy(p), C && C.copy(A), m = b, F = L, f = P), b < o)
1091
+ if (b < T && (m.copy(p), C && C.copy(A), T = b, F = y, f = L), b < o)
1092
1092
  return !0;
1093
1093
  }
1094
1094
  }
@@ -1098,17 +1098,17 @@ function Go(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1098
1098
  const S = Ce(s);
1099
1099
  for (let _ = 0, N = S; _ < N; _++) {
1100
1100
  et(u, 3 * _, d, E), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1101
- for (let P = R, M = R + g; P < M; P++) {
1102
- et(h, 3 * P, c, a), h.needsUpdate = !0;
1103
- const L = h.distanceToTriangle(u, p, A);
1104
- if (L < m && (T.copy(p), C && C.copy(A), m = L, F = P, f = _), L < o)
1101
+ for (let L = R, M = R + g; L < M; L++) {
1102
+ et(h, 3 * L, c, a), h.needsUpdate = !0;
1103
+ const y = h.distanceToTriangle(u, p, A);
1104
+ if (y < T && (m.copy(p), C && C.copy(A), T = y, F = L, f = _), y < o)
1105
1105
  return !0;
1106
1106
  }
1107
1107
  }
1108
1108
  }
1109
1109
  }
1110
1110
  }
1111
- ), It.releasePrimitive(h), It.releasePrimitive(u), m === 1 / 0 ? null : (e.point ? e.point.copy(T) : e.point = T.clone(), e.distance = m, e.faceIndex = F, i && (i.point ? i.point.copy(C) : i.point = C.clone(), i.point.applyMatrix4(rs), T.applyMatrix4(rs), i.distance = T.sub(i.point).length(), i.faceIndex = f), e);
1111
+ ), It.releasePrimitive(h), It.releasePrimitive(u), T === 1 / 0 ? null : (e.point ? e.point.copy(m) : e.point = m.clone(), e.distance = T, e.faceIndex = F, i && (i.point ? i.point.copy(C) : i.point = C.clone(), i.point.applyMatrix4(rs), m.applyMatrix4(rs), i.distance = m.sub(i.point).length(), i.faceIndex = f), e);
1112
1112
  }
1113
1113
  function zo(l, s = null) {
1114
1114
  s && Array.isArray(s) && (s = new Set(s));
@@ -1118,62 +1118,62 @@ function zo(l, s = null) {
1118
1118
  for (let h = 0, u = E.length; h < u; h++)
1119
1119
  o = E[h], n = new Uint32Array(o), r = new Uint16Array(o), a = new Float32Array(o), d(0, c), c += o.byteLength;
1120
1120
  function d(h, u, p = !1) {
1121
- const T = h * 2;
1122
- if (r[T + 15] === ws) {
1123
- const C = n[h + 6], m = r[T + 14];
1121
+ const m = h * 2;
1122
+ if (r[m + 15] === Ms) {
1123
+ const C = n[h + 6], T = r[m + 14];
1124
1124
  let F = 1 / 0, f = 1 / 0, R = 1 / 0, g = -1 / 0, S = -1 / 0, _ = -1 / 0;
1125
- for (let N = C, P = C + m; N < P; N++) {
1125
+ for (let N = C, L = C + T; N < L; N++) {
1126
1126
  const M = 3 * l.resolveTriangleIndex(N);
1127
- for (let L = 0; L < 3; L++) {
1128
- let U = M + L;
1129
- U = e ? e[U] : U;
1130
- const b = i.getX(U), B = i.getY(U), H = i.getZ(U);
1127
+ for (let y = 0; y < 3; y++) {
1128
+ let x = M + y;
1129
+ x = e ? e[x] : x;
1130
+ const b = i.getX(x), B = i.getY(x), H = i.getZ(x);
1131
1131
  b < F && (F = b), b > g && (g = b), B < f && (f = B), B > S && (S = B), H < R && (R = H), H > _ && (_ = H);
1132
1132
  }
1133
1133
  }
1134
1134
  return a[h + 0] !== F || a[h + 1] !== f || a[h + 2] !== R || a[h + 3] !== g || a[h + 4] !== S || a[h + 5] !== _ ? (a[h + 0] = F, a[h + 1] = f, a[h + 2] = R, a[h + 3] = g, a[h + 4] = S, a[h + 5] = _, !0) : !1;
1135
1135
  } else {
1136
- const C = h + 8, m = n[h + 6], F = C + u, f = m + u;
1136
+ const C = h + 8, T = n[h + 6], F = C + u, f = T + u;
1137
1137
  let R = p, g = !1, S = !1;
1138
1138
  s ? R || (g = s.has(F), S = s.has(f), R = !g && !S) : (g = !0, S = !0);
1139
1139
  const _ = R || g, N = R || S;
1140
- let P = !1;
1141
- _ && (P = d(C, u, R));
1140
+ let L = !1;
1141
+ _ && (L = d(C, u, R));
1142
1142
  let M = !1;
1143
- N && (M = d(m, u, R));
1144
- const L = P || M;
1145
- if (L)
1146
- for (let U = 0; U < 3; U++) {
1147
- const b = C + U, B = m + U, H = a[b], q = a[b + 3], st = a[B], Q = a[B + 3];
1148
- a[h + U] = H < st ? H : st, a[h + U + 3] = q > Q ? q : Q;
1143
+ N && (M = d(T, u, R));
1144
+ const y = L || M;
1145
+ if (y)
1146
+ for (let x = 0; x < 3; x++) {
1147
+ const b = C + x, B = T + x, H = a[b], q = a[b + 3], st = a[B], Q = a[B + 3];
1148
+ a[h + x] = H < st ? H : st, a[h + x + 3] = q > Q ? q : Q;
1149
1149
  }
1150
- return L;
1150
+ return y;
1151
1151
  }
1152
1152
  }
1153
1153
  }
1154
1154
  const Wi = /* @__PURE__ */ new w();
1155
1155
  function Ho(l, s, t, e, i) {
1156
- Z.setBuffer(l._roots[s]), ci(0, l, t, e, i), Z.clearBuffer();
1156
+ Z.setBuffer(l._roots[s]), li(0, l, t, e, i), Z.clearBuffer();
1157
1157
  }
1158
- function ci(l, s, t, e, i) {
1158
+ function li(l, s, t, e, i) {
1159
1159
  const { float32Array: o, uint16Array: n, uint32Array: r } = Z, a = l * 2;
1160
1160
  if (Et(a, n)) {
1161
1161
  const E = dt(l, r), d = ft(a, n);
1162
- Lo(s, t, e, E, d, i);
1162
+ yo(s, t, e, E, d, i);
1163
1163
  } else {
1164
1164
  const E = pt(l);
1165
- zt(E, o, e, Wi) && ci(E, s, t, e, i);
1165
+ zt(E, o, e, Wi) && li(E, s, t, e, i);
1166
1166
  const d = Ct(l, r);
1167
- zt(d, o, e, Wi) && ci(d, s, t, e, i);
1167
+ zt(d, o, e, Wi) && li(d, s, t, e, i);
1168
1168
  }
1169
1169
  }
1170
1170
  const Xi = /* @__PURE__ */ new w(), ko = ["x", "y", "z"];
1171
1171
  function Wo(l, s, t, e) {
1172
1172
  Z.setBuffer(l._roots[s]);
1173
- const i = li(0, l, t, e);
1173
+ const i = hi(0, l, t, e);
1174
1174
  return Z.clearBuffer(), i;
1175
1175
  }
1176
- function li(l, s, t, e) {
1176
+ function hi(l, s, t, e) {
1177
1177
  const { float32Array: i, uint16Array: o, uint32Array: n } = Z;
1178
1178
  let r = l * 2;
1179
1179
  if (Et(r, o)) {
@@ -1183,7 +1183,7 @@ function li(l, s, t, e) {
1183
1183
  const c = wn(l, n), E = ko[c], h = e.direction[E] >= 0;
1184
1184
  let u, p;
1185
1185
  h ? (u = pt(l), p = Ct(l, n)) : (u = Ct(l, n), p = pt(l));
1186
- const A = zt(u, i, e, Xi) ? li(u, s, t, e) : null;
1186
+ const A = zt(u, i, e, Xi) ? hi(u, s, t, e) : null;
1187
1187
  if (A) {
1188
1188
  const F = A.point[E];
1189
1189
  if (h ? F <= i[p + c] : (
@@ -1192,33 +1192,33 @@ function li(l, s, t, e) {
1192
1192
  ))
1193
1193
  return A;
1194
1194
  }
1195
- const m = zt(p, i, e, Xi) ? li(p, s, t, e) : null;
1196
- return A && m ? A.distance <= m.distance ? A : m : A || m || null;
1195
+ const T = zt(p, i, e, Xi) ? hi(p, s, t, e) : null;
1196
+ return A && T ? A.distance <= T.distance ? A : T : A || T || null;
1197
1197
  }
1198
1198
  }
1199
1199
  const as = /* @__PURE__ */ new Ot(), re = /* @__PURE__ */ new gt(), ae = /* @__PURE__ */ new gt(), Se = /* @__PURE__ */ new wt(), Zi = /* @__PURE__ */ new ct(), cs = /* @__PURE__ */ new ct();
1200
1200
  function Xo(l, s, t, e) {
1201
1201
  Z.setBuffer(l._roots[s]);
1202
- const i = hi(0, l, t, e);
1202
+ const i = Ei(0, l, t, e);
1203
1203
  return Z.clearBuffer(), i;
1204
1204
  }
1205
- function hi(l, s, t, e, i = null) {
1205
+ function Ei(l, s, t, e, i = null) {
1206
1206
  const { float32Array: o, uint16Array: n, uint32Array: r } = Z;
1207
1207
  let a = l * 2;
1208
1208
  if (i === null && (t.boundingBox || t.computeBoundingBox(), Zi.set(t.boundingBox.min, t.boundingBox.max, e), i = Zi), Et(a, n)) {
1209
- const E = s.geometry, d = E.index, h = E.attributes.position, u = t.index, p = t.attributes.position, T = dt(l, r), A = ft(a, n);
1209
+ const E = s.geometry, d = E.index, h = E.attributes.position, u = t.index, p = t.attributes.position, m = dt(l, r), A = ft(a, n);
1210
1210
  if (Se.copy(e).invert(), t.boundsTree)
1211
1211
  return $(l, o, cs), cs.matrix.copy(Se), cs.needsUpdate = !0, t.boundsTree.shapecast({
1212
- intersectsBounds: (m) => cs.intersectsBox(m),
1213
- intersectsTriangle: (m) => {
1214
- m.a.applyMatrix4(e), m.b.applyMatrix4(e), m.c.applyMatrix4(e), m.needsUpdate = !0;
1215
- for (let F = T, f = A + T; F < f; F++)
1216
- if (et(ae, 3 * s.resolveTriangleIndex(F), d, h), ae.needsUpdate = !0, m.intersectsTriangle(ae))
1212
+ intersectsBounds: (T) => cs.intersectsBox(T),
1213
+ intersectsTriangle: (T) => {
1214
+ T.a.applyMatrix4(e), T.b.applyMatrix4(e), T.c.applyMatrix4(e), T.needsUpdate = !0;
1215
+ for (let F = m, f = A + m; F < f; F++)
1216
+ if (et(ae, 3 * s.resolveTriangleIndex(F), d, h), ae.needsUpdate = !0, T.intersectsTriangle(ae))
1217
1217
  return !0;
1218
1218
  return !1;
1219
1219
  }
1220
1220
  });
1221
- for (let C = T, m = A + T; C < m; C++) {
1221
+ for (let C = m, T = A + m; C < T; C++) {
1222
1222
  const F = s.resolveTriangleIndex(C);
1223
1223
  et(re, 3 * F, d, h), re.a.applyMatrix4(Se), re.b.applyMatrix4(Se), re.c.applyMatrix4(Se), re.needsUpdate = !0;
1224
1224
  for (let f = 0, R = u.count; f < R; f += 3)
@@ -1227,35 +1227,35 @@ function hi(l, s, t, e, i = null) {
1227
1227
  }
1228
1228
  } else {
1229
1229
  const E = l + 8, d = r[l + 6];
1230
- return $(E, o, as), !!(i.intersectsBox(as) && hi(E, s, t, e, i) || ($(d, o, as), i.intersectsBox(as) && hi(d, s, t, e, i)));
1230
+ return $(E, o, as), !!(i.intersectsBox(as) && Ei(E, s, t, e, i) || ($(d, o, as), i.intersectsBox(as) && Ei(d, s, t, e, i)));
1231
1231
  }
1232
1232
  }
1233
- const ls = /* @__PURE__ */ new wt(), zs = /* @__PURE__ */ new ct(), _e = /* @__PURE__ */ new ct(), Zo = /* @__PURE__ */ new w(), Qo = /* @__PURE__ */ new w(), jo = /* @__PURE__ */ new w(), qo = /* @__PURE__ */ new w();
1233
+ const ls = /* @__PURE__ */ new wt(), Hs = /* @__PURE__ */ new ct(), _e = /* @__PURE__ */ new ct(), Zo = /* @__PURE__ */ new w(), Qo = /* @__PURE__ */ new w(), jo = /* @__PURE__ */ new w(), qo = /* @__PURE__ */ new w();
1234
1234
  function $o(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1235
- s.boundingBox || s.computeBoundingBox(), zs.set(s.boundingBox.min, s.boundingBox.max, t), zs.needsUpdate = !0;
1235
+ s.boundingBox || s.computeBoundingBox(), Hs.set(s.boundingBox.min, s.boundingBox.max, t), Hs.needsUpdate = !0;
1236
1236
  const r = l.geometry, a = r.attributes.position, c = r.index, E = s.attributes.position, d = s.index, h = It.getPrimitive(), u = It.getPrimitive();
1237
- let p = Zo, T = Qo, A = null, C = null;
1237
+ let p = Zo, m = Qo, A = null, C = null;
1238
1238
  i && (A = jo, C = qo);
1239
- let m = 1 / 0, F = null, f = null;
1239
+ let T = 1 / 0, F = null, f = null;
1240
1240
  return ls.copy(t).invert(), _e.matrix.copy(ls), l.shapecast(
1241
1241
  {
1242
- boundsTraverseOrder: (R) => zs.distanceToBox(R),
1243
- intersectsBounds: (R, g, S) => S < m && S < n ? (g && (_e.min.copy(R.min), _e.max.copy(R.max), _e.needsUpdate = !0), !0) : !1,
1242
+ boundsTraverseOrder: (R) => Hs.distanceToBox(R),
1243
+ intersectsBounds: (R, g, S) => S < T && S < n ? (g && (_e.min.copy(R.min), _e.max.copy(R.max), _e.needsUpdate = !0), !0) : !1,
1244
1244
  intersectsRange: (R, g) => {
1245
1245
  if (s.boundsTree) {
1246
1246
  const S = s.boundsTree;
1247
1247
  return S.shapecast({
1248
1248
  boundsTraverseOrder: (_) => _e.distanceToBox(_),
1249
- intersectsBounds: (_, N, P) => P < m && P < n,
1249
+ intersectsBounds: (_, N, L) => L < T && L < n,
1250
1250
  intersectsRange: (_, N) => {
1251
- for (let P = _, M = _ + N; P < M; P++) {
1252
- const L = S.resolveTriangleIndex(P);
1253
- et(u, 3 * L, d, E), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1254
- for (let U = R, b = R + g; U < b; U++) {
1255
- const B = l.resolveTriangleIndex(U);
1251
+ for (let L = _, M = _ + N; L < M; L++) {
1252
+ const y = S.resolveTriangleIndex(L);
1253
+ et(u, 3 * y, d, E), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1254
+ for (let x = R, b = R + g; x < b; x++) {
1255
+ const B = l.resolveTriangleIndex(x);
1256
1256
  et(h, 3 * B, c, a), h.needsUpdate = !0;
1257
1257
  const H = h.distanceToTriangle(u, p, A);
1258
- if (H < m && (T.copy(p), C && C.copy(A), m = H, F = U, f = P), H < o)
1258
+ if (H < T && (m.copy(p), C && C.copy(A), T = H, F = x, f = L), H < o)
1259
1259
  return !0;
1260
1260
  }
1261
1261
  }
@@ -1265,28 +1265,28 @@ function $o(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1265
1265
  const S = Ce(s);
1266
1266
  for (let _ = 0, N = S; _ < N; _++) {
1267
1267
  et(u, 3 * _, d, E), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1268
- for (let P = R, M = R + g; P < M; P++) {
1269
- const L = l.resolveTriangleIndex(P);
1270
- et(h, 3 * L, c, a), h.needsUpdate = !0;
1271
- const U = h.distanceToTriangle(u, p, A);
1272
- if (U < m && (T.copy(p), C && C.copy(A), m = U, F = P, f = _), U < o)
1268
+ for (let L = R, M = R + g; L < M; L++) {
1269
+ const y = l.resolveTriangleIndex(L);
1270
+ et(h, 3 * y, c, a), h.needsUpdate = !0;
1271
+ const x = h.distanceToTriangle(u, p, A);
1272
+ if (x < T && (m.copy(p), C && C.copy(A), T = x, F = L, f = _), x < o)
1273
1273
  return !0;
1274
1274
  }
1275
1275
  }
1276
1276
  }
1277
1277
  }
1278
1278
  }
1279
- ), It.releasePrimitive(h), It.releasePrimitive(u), m === 1 / 0 ? null : (e.point ? e.point.copy(T) : e.point = T.clone(), e.distance = m, e.faceIndex = F, i && (i.point ? i.point.copy(C) : i.point = C.clone(), i.point.applyMatrix4(ls), T.applyMatrix4(ls), i.distance = T.sub(i.point).length(), i.faceIndex = f), e);
1279
+ ), It.releasePrimitive(h), It.releasePrimitive(u), T === 1 / 0 ? null : (e.point ? e.point.copy(m) : e.point = m.clone(), e.distance = T, e.faceIndex = F, i && (i.point ? i.point.copy(C) : i.point = C.clone(), i.point.applyMatrix4(ls), m.applyMatrix4(ls), i.distance = m.sub(i.point).length(), i.faceIndex = f), e);
1280
1280
  }
1281
1281
  function Ko() {
1282
1282
  return typeof SharedArrayBuffer < "u";
1283
1283
  }
1284
- const be = new Z.constructor(), Fs = new Z.constructor(), Bt = new Ai(() => new Ot()), ce = new Ot(), le = new Ot(), Hs = new Ot(), ks = new Ot();
1285
- let Ws = !1;
1284
+ const be = new Z.constructor(), Fs = new Z.constructor(), Bt = new Ai(() => new Ot()), ce = new Ot(), le = new Ot(), ks = new Ot(), Ws = new Ot();
1285
+ let Xs = !1;
1286
1286
  function Jo(l, s, t, e) {
1287
- if (Ws)
1287
+ if (Xs)
1288
1288
  throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");
1289
- Ws = !0;
1289
+ Xs = !0;
1290
1290
  const i = l._roots, o = s._roots;
1291
1291
  let n, r = 0, a = 0;
1292
1292
  const c = new wt().copy(t).invert();
@@ -1310,28 +1310,28 @@ function Jo(l, s, t, e) {
1310
1310
  if (Bt.releasePrimitive(h), be.clearBuffer(), r += i[E].length, n)
1311
1311
  break;
1312
1312
  }
1313
- return Ws = !1, n;
1313
+ return Xs = !1, n;
1314
1314
  }
1315
1315
  function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
1316
1316
  let d, h;
1317
1317
  E ? (d = Fs, h = be) : (d = be, h = Fs);
1318
- const u = d.float32Array, p = d.uint32Array, T = d.uint16Array, A = h.float32Array, C = h.uint32Array, m = h.uint16Array, F = l * 2, f = s * 2, R = Et(F, T), g = Et(f, m);
1318
+ const u = d.float32Array, p = d.uint32Array, m = d.uint16Array, A = h.float32Array, C = h.uint32Array, T = h.uint16Array, F = l * 2, f = s * 2, R = Et(F, m), g = Et(f, T);
1319
1319
  let S = !1;
1320
1320
  if (g && R)
1321
1321
  E ? S = i(
1322
1322
  dt(s, C),
1323
- ft(s * 2, m),
1323
+ ft(s * 2, T),
1324
1324
  dt(l, p),
1325
- ft(l * 2, T),
1325
+ ft(l * 2, m),
1326
1326
  a,
1327
1327
  n + s,
1328
1328
  r,
1329
1329
  o + l
1330
1330
  ) : S = i(
1331
1331
  dt(l, p),
1332
- ft(l * 2, T),
1332
+ ft(l * 2, m),
1333
1333
  dt(s, C),
1334
- ft(s * 2, m),
1334
+ ft(s * 2, T),
1335
1335
  r,
1336
1336
  o + l,
1337
1337
  a,
@@ -1340,9 +1340,9 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
1340
1340
  else if (g) {
1341
1341
  const _ = Bt.getPrimitive();
1342
1342
  $(s, A, _), _.applyMatrix4(t);
1343
- const N = pt(l), P = Ct(l, p);
1344
- $(N, u, ce), $(P, u, le);
1345
- const M = _.intersectsBox(ce), L = _.intersectsBox(le);
1343
+ const N = pt(l), L = Ct(l, p);
1344
+ $(N, u, ce), $(L, u, le);
1345
+ const M = _.intersectsBox(ce), y = _.intersectsBox(le);
1346
1346
  S = M && Tt(
1347
1347
  s,
1348
1348
  N,
@@ -1355,9 +1355,9 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
1355
1355
  r + 1,
1356
1356
  _,
1357
1357
  !E
1358
- ) || L && Tt(
1358
+ ) || y && Tt(
1359
1359
  s,
1360
- P,
1360
+ L,
1361
1361
  e,
1362
1362
  t,
1363
1363
  i,
@@ -1370,9 +1370,9 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
1370
1370
  ), Bt.releasePrimitive(_);
1371
1371
  } else {
1372
1372
  const _ = pt(s), N = Ct(s, C);
1373
- $(_, A, Hs), $(N, A, ks);
1374
- const P = c.intersectsBox(Hs), M = c.intersectsBox(ks);
1375
- if (P && M)
1373
+ $(_, A, ks), $(N, A, Ws);
1374
+ const L = c.intersectsBox(ks), M = c.intersectsBox(Ws);
1375
+ if (L && M)
1376
1376
  S = Tt(
1377
1377
  l,
1378
1378
  _,
@@ -1398,7 +1398,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
1398
1398
  c,
1399
1399
  E
1400
1400
  );
1401
- else if (P)
1401
+ else if (L)
1402
1402
  if (R)
1403
1403
  S = Tt(
1404
1404
  l,
@@ -1414,14 +1414,14 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
1414
1414
  E
1415
1415
  );
1416
1416
  else {
1417
- const L = Bt.getPrimitive();
1418
- L.copy(Hs).applyMatrix4(t);
1419
- const U = pt(l), b = Ct(l, p);
1420
- $(U, u, ce), $(b, u, le);
1421
- const B = L.intersectsBox(ce), H = L.intersectsBox(le);
1417
+ const y = Bt.getPrimitive();
1418
+ y.copy(ks).applyMatrix4(t);
1419
+ const x = pt(l), b = Ct(l, p);
1420
+ $(x, u, ce), $(b, u, le);
1421
+ const B = y.intersectsBox(ce), H = y.intersectsBox(le);
1422
1422
  S = B && Tt(
1423
1423
  _,
1424
- U,
1424
+ x,
1425
1425
  e,
1426
1426
  t,
1427
1427
  i,
@@ -1429,7 +1429,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
1429
1429
  o,
1430
1430
  a,
1431
1431
  r + 1,
1432
- L,
1432
+ y,
1433
1433
  !E
1434
1434
  ) || H && Tt(
1435
1435
  _,
@@ -1441,9 +1441,9 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
1441
1441
  o,
1442
1442
  a,
1443
1443
  r + 1,
1444
- L,
1444
+ y,
1445
1445
  !E
1446
- ), Bt.releasePrimitive(L);
1446
+ ), Bt.releasePrimitive(y);
1447
1447
  }
1448
1448
  else if (M)
1449
1449
  if (R)
@@ -1461,14 +1461,14 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
1461
1461
  E
1462
1462
  );
1463
1463
  else {
1464
- const L = Bt.getPrimitive();
1465
- L.copy(ks).applyMatrix4(t);
1466
- const U = pt(l), b = Ct(l, p);
1467
- $(U, u, ce), $(b, u, le);
1468
- const B = L.intersectsBox(ce), H = L.intersectsBox(le);
1464
+ const y = Bt.getPrimitive();
1465
+ y.copy(Ws).applyMatrix4(t);
1466
+ const x = pt(l), b = Ct(l, p);
1467
+ $(x, u, ce), $(b, u, le);
1468
+ const B = y.intersectsBox(ce), H = y.intersectsBox(le);
1469
1469
  S = B && Tt(
1470
1470
  N,
1471
- U,
1471
+ x,
1472
1472
  e,
1473
1473
  t,
1474
1474
  i,
@@ -1476,7 +1476,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
1476
1476
  o,
1477
1477
  a,
1478
1478
  r + 1,
1479
- L,
1479
+ y,
1480
1480
  !E
1481
1481
  ) || H && Tt(
1482
1482
  N,
@@ -1488,9 +1488,9 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
1488
1488
  o,
1489
1489
  a,
1490
1490
  r + 1,
1491
- L,
1491
+ y,
1492
1492
  !E
1493
- ), Bt.releasePrimitive(L);
1493
+ ), Bt.releasePrimitive(y);
1494
1494
  }
1495
1495
  }
1496
1496
  return S;
@@ -1520,7 +1520,7 @@ class Fi {
1520
1520
  indirect: !!s.indirectBuffer,
1521
1521
  ...e
1522
1522
  };
1523
- const { index: i, roots: o, indirectBuffer: n } = s, r = new Fi(t, { ...e, [vs]: !0 });
1523
+ const { index: i, roots: o, indirectBuffer: n } = s, r = new Fi(t, { ...e, [Bs]: !0 });
1524
1524
  if (r._roots = o, r._indirectBuffer = n || null, e.setIndex) {
1525
1525
  const a = t.getIndex();
1526
1526
  if (a === null) {
@@ -1541,7 +1541,7 @@ class Fi {
1541
1541
  } else
1542
1542
  throw new Error("MeshBVH: Only BufferGeometries are supported.");
1543
1543
  if (t = Object.assign({
1544
- strategy: yn,
1544
+ strategy: Pn,
1545
1545
  maxDepth: 40,
1546
1546
  maxLeafTris: 10,
1547
1547
  verbose: !0,
@@ -1551,21 +1551,21 @@ class Fi {
1551
1551
  indirect: !1,
1552
1552
  // undocumented options
1553
1553
  // Whether to skip generating the tree. Used for deserialization.
1554
- [vs]: !1
1554
+ [Bs]: !1
1555
1555
  }, t), t.useSharedArrayBuffer && !Ko())
1556
1556
  throw new Error("MeshBVH: SharedArrayBuffer is not available.");
1557
- this.geometry = s, this._roots = null, this._indirectBuffer = null, t[vs] || (po(this, t), !s.boundingBox && t.setBoundingBox && (s.boundingBox = this.getBoundingBox(new Ot())));
1557
+ this.geometry = s, this._roots = null, this._indirectBuffer = null, t[Bs] || (po(this, t), !s.boundingBox && t.setBoundingBox && (s.boundingBox = this.getBoundingBox(new Ot())));
1558
1558
  const { _indirectBuffer: e } = this;
1559
1559
  this.resolveTriangleIndex = t.indirect ? (i) => e[i] : (i) => i;
1560
1560
  }
1561
1561
  refit(s = null) {
1562
- return (this.indirect ? zo : Po)(this, s);
1562
+ return (this.indirect ? zo : Lo)(this, s);
1563
1563
  }
1564
1564
  traverse(s, t = 0) {
1565
1565
  const e = this._roots[t], i = new Uint32Array(e), o = new Uint16Array(e);
1566
1566
  n(0);
1567
1567
  function n(r, a = 0) {
1568
- const c = r * 2, E = o[c + 15] === ws;
1568
+ const c = r * 2, E = o[c + 15] === Ms;
1569
1569
  if (E) {
1570
1570
  const d = i[r + 6], h = o[c + 14];
1571
1571
  s(a, E, new Float32Array(e, r * 4, 6), d, h);
@@ -1576,19 +1576,19 @@ class Fi {
1576
1576
  }
1577
1577
  }
1578
1578
  /* Core Cast Functions */
1579
- raycast(s, t = Li) {
1579
+ raycast(s, t = yi) {
1580
1580
  const e = this._roots, i = this.geometry, o = [], n = t.isMaterial, r = Array.isArray(t), a = i.groups, c = n ? t.side : t, E = this.indirect ? Ho : Do;
1581
1581
  for (let d = 0, h = e.length; d < h; d++) {
1582
1582
  const u = r ? t[a[d].materialIndex].side : c, p = o.length;
1583
1583
  if (E(this, d, u, s, o), r) {
1584
- const T = a[d].materialIndex;
1584
+ const m = a[d].materialIndex;
1585
1585
  for (let A = p, C = o.length; A < C; A++)
1586
- o[A].face.materialIndex = T;
1586
+ o[A].face.materialIndex = m;
1587
1587
  }
1588
1588
  }
1589
1589
  return o;
1590
1590
  }
1591
- raycastFirst(s, t = Li) {
1591
+ raycastFirst(s, t = yi) {
1592
1592
  const e = this._roots, i = this.geometry, o = t.isMaterial, n = Array.isArray(t);
1593
1593
  let r = null;
1594
1594
  const a = i.groups, c = o ? t.side : t, E = this.indirect ? Wo : xo;
@@ -1606,7 +1606,7 @@ class Fi {
1606
1606
  return e;
1607
1607
  }
1608
1608
  shapecast(s) {
1609
- const t = It.getPrimitive(), e = this.indirect ? Mo : yo;
1609
+ const t = It.getPrimitive(), e = this.indirect ? Mo : Po;
1610
1610
  let {
1611
1611
  boundsTraverseOrder: i,
1612
1612
  intersectsBounds: o,
@@ -1615,7 +1615,7 @@ class Fi {
1615
1615
  } = s;
1616
1616
  if (n && r) {
1617
1617
  const d = n;
1618
- n = (h, u, p, T, A) => d(h, u, p, T, A) ? !0 : e(h, u, this, r, p, T, t);
1618
+ n = (h, u, p, m, A) => d(h, u, p, m, A) ? !0 : e(h, u, this, r, p, m, t);
1619
1619
  } else
1620
1620
  n || (r ? n = (d, h, u, p) => e(d, h, this, r, u, p, t) : n = (d, h, u) => u);
1621
1621
  let a = !1, c = 0;
@@ -1634,30 +1634,30 @@ class Fi {
1634
1634
  intersectsTriangles: o
1635
1635
  } = e;
1636
1636
  const n = It.getPrimitive(), r = this.geometry.index, a = this.geometry.attributes.position, c = this.indirect ? (p) => {
1637
- const T = this.resolveTriangleIndex(p);
1638
- et(n, T * 3, r, a);
1637
+ const m = this.resolveTriangleIndex(p);
1638
+ et(n, m * 3, r, a);
1639
1639
  } : (p) => {
1640
1640
  et(n, p * 3, r, a);
1641
1641
  }, E = It.getPrimitive(), d = s.geometry.index, h = s.geometry.attributes.position, u = s.indirect ? (p) => {
1642
- const T = s.resolveTriangleIndex(p);
1643
- et(E, T * 3, d, h);
1642
+ const m = s.resolveTriangleIndex(p);
1643
+ et(E, m * 3, d, h);
1644
1644
  } : (p) => {
1645
1645
  et(E, p * 3, d, h);
1646
1646
  };
1647
1647
  if (o) {
1648
- const p = (T, A, C, m, F, f, R, g) => {
1649
- for (let S = C, _ = C + m; S < _; S++) {
1648
+ const p = (m, A, C, T, F, f, R, g) => {
1649
+ for (let S = C, _ = C + T; S < _; S++) {
1650
1650
  u(S), E.a.applyMatrix4(t), E.b.applyMatrix4(t), E.c.applyMatrix4(t), E.needsUpdate = !0;
1651
- for (let N = T, P = T + A; N < P; N++)
1651
+ for (let N = m, L = m + A; N < L; N++)
1652
1652
  if (c(N), n.needsUpdate = !0, o(n, E, N, S, F, f, R, g))
1653
1653
  return !0;
1654
1654
  }
1655
1655
  return !1;
1656
1656
  };
1657
1657
  if (i) {
1658
- const T = i;
1659
- i = function(A, C, m, F, f, R, g, S) {
1660
- return T(A, C, m, F, f, R, g, S) ? !0 : p(A, C, m, F, f, R, g, S);
1658
+ const m = i;
1659
+ i = function(A, C, T, F, f, R, g, S) {
1660
+ return m(A, C, T, F, f, R, g, S) ? !0 : p(A, C, T, F, f, R, g, S);
1661
1661
  };
1662
1662
  } else
1663
1663
  i = p;
@@ -1710,18 +1710,18 @@ class Fi {
1710
1710
  function ji(l, s, t) {
1711
1711
  return l === null || (l.point.applyMatrix4(s.matrixWorld), l.distance = l.point.distanceTo(t.ray.origin), l.object = s, l.distance < t.near || l.distance > t.far) ? null : l;
1712
1712
  }
1713
- const Xs = /* @__PURE__ */ new Wn(), qi = /* @__PURE__ */ new wt(), tr = v.prototype.raycast;
1713
+ const Zs = /* @__PURE__ */ new Wn(), qi = /* @__PURE__ */ new wt(), tr = v.prototype.raycast;
1714
1714
  function er(l, s) {
1715
1715
  if (this.geometry.boundsTree) {
1716
1716
  if (this.material === void 0)
1717
1717
  return;
1718
- qi.copy(this.matrixWorld).invert(), Xs.copy(l.ray).applyMatrix4(qi);
1718
+ qi.copy(this.matrixWorld).invert(), Zs.copy(l.ray).applyMatrix4(qi);
1719
1719
  const t = this.geometry.boundsTree;
1720
1720
  if (l.firstHitOnly === !0) {
1721
- const e = ji(t.raycastFirst(Xs, this.material), this, l);
1721
+ const e = ji(t.raycastFirst(Zs, this.material), this, l);
1722
1722
  e && s.push(e);
1723
1723
  } else {
1724
- const e = t.raycast(Xs, this.material);
1724
+ const e = t.raycast(Zs, this.material);
1725
1725
  for (let i = 0, o = e.length; i < o; i++) {
1726
1726
  const n = ji(e[i], this, l);
1727
1727
  n && s.push(n);
@@ -1736,7 +1736,7 @@ function sr(l) {
1736
1736
  function ir() {
1737
1737
  this.boundsTree = null;
1738
1738
  }
1739
- class D {
1739
+ class U {
1740
1740
  constructor() {
1741
1741
  /** Triggers all the callbacks assigned to this event. */
1742
1742
  I(this, "trigger", (s) => {
@@ -1815,7 +1815,7 @@ class Oi extends gi {
1815
1815
  constructor(t) {
1816
1816
  super(t);
1817
1817
  I(this, "worlds", /* @__PURE__ */ new Map());
1818
- I(this, "onWorldChanged", new D());
1818
+ I(this, "onWorldChanged", new U());
1819
1819
  I(this, "currentWorld", null);
1820
1820
  this.onWorldChanged.add(({ world: e, action: i }) => {
1821
1821
  i === "removed" && this.worlds.delete(e.uuid);
@@ -1833,17 +1833,17 @@ class or extends Oi {
1833
1833
  constructor() {
1834
1834
  super(...arguments);
1835
1835
  /** {@link Updateable.onBeforeUpdate} */
1836
- I(this, "onAfterUpdate", new D());
1836
+ I(this, "onAfterUpdate", new U());
1837
1837
  /** {@link Updateable.onAfterUpdate} */
1838
- I(this, "onBeforeUpdate", new D());
1838
+ I(this, "onBeforeUpdate", new U());
1839
1839
  /** {@link Disposable.onDisposed} */
1840
- I(this, "onDisposed", new D());
1841
- I(this, "onResize", new D());
1840
+ I(this, "onDisposed", new U());
1841
+ I(this, "onResize", new U());
1842
1842
  /**
1843
1843
  * Event that fires when there has been a change to the list of clipping
1844
1844
  * planes used by the active renderer.
1845
1845
  */
1846
- I(this, "onClippingPlanesUpdated", new D());
1846
+ I(this, "onClippingPlanesUpdated", new U());
1847
1847
  /**
1848
1848
  * The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this
1849
1849
  * instance of the renderer.
@@ -1936,7 +1936,7 @@ class rr extends Oi {
1936
1936
  constructor(t) {
1937
1937
  super(t);
1938
1938
  /** {@link Disposable.onDisposed} */
1939
- I(this, "onDisposed", new D());
1939
+ I(this, "onDisposed", new U());
1940
1940
  }
1941
1941
  /** {@link Disposable.dispose} */
1942
1942
  dispose() {
@@ -1948,7 +1948,7 @@ class rr extends Oi {
1948
1948
  this.three.children = [], this.onDisposed.trigger(), this.onDisposed.reset();
1949
1949
  }
1950
1950
  }
1951
- const Rs = 0, ar = 1, cr = new w(), $i = new Lt(), Zs = new mi(), Ki = new w(), Es = new Ie();
1951
+ const Rs = 0, ar = 1, cr = new w(), $i = new yt(), Qs = new mi(), Ki = new w(), Es = new Ie();
1952
1952
  class lr {
1953
1953
  constructor() {
1954
1954
  this.tolerance = -1, this.faces = [], this.newFaces = [], this.assigned = new Ji(), this.unassigned = new Ji(), this.vertices = [];
@@ -2086,20 +2086,20 @@ class lr {
2086
2086
  const p = s[h];
2087
2087
  if (p !== r && p !== a) {
2088
2088
  $i.closestPointToPoint(p.point, !0, Ki);
2089
- const T = Ki.distanceToSquared(p.point);
2090
- T > o && (o = T, c = p);
2089
+ const m = Ki.distanceToSquared(p.point);
2090
+ m > o && (o = m, c = p);
2091
2091
  }
2092
2092
  }
2093
- o = -1, Zs.setFromCoplanarPoints(r.point, a.point, c.point);
2093
+ o = -1, Qs.setFromCoplanarPoints(r.point, a.point, c.point);
2094
2094
  for (let h = 0, u = this.vertices.length; h < u; h++) {
2095
2095
  const p = s[h];
2096
2096
  if (p !== r && p !== a && p !== c) {
2097
- const T = Math.abs(Zs.distanceToPoint(p.point));
2098
- T > o && (o = T, E = p);
2097
+ const m = Math.abs(Qs.distanceToPoint(p.point));
2098
+ m > o && (o = m, E = p);
2099
2099
  }
2100
2100
  }
2101
2101
  const d = [];
2102
- if (Zs.distanceToPoint(E.point) < 0) {
2102
+ if (Qs.distanceToPoint(E.point) < 0) {
2103
2103
  d.push(
2104
2104
  Rt.create(r, a, c),
2105
2105
  Rt.create(E, a, r),
@@ -2128,12 +2128,12 @@ class lr {
2128
2128
  const p = s[h];
2129
2129
  if (p !== r && p !== a && p !== c && p !== E) {
2130
2130
  o = this.tolerance;
2131
- let T = null;
2131
+ let m = null;
2132
2132
  for (let A = 0; A < 4; A++) {
2133
2133
  const C = this.faces[A].distanceToPoint(p.point);
2134
- C > o && (o = C, T = this.faces[A]);
2134
+ C > o && (o = C, m = this.faces[A]);
2135
2135
  }
2136
- T !== null && this.addVertexToFace(p, T);
2136
+ m !== null && this.addVertexToFace(p, m);
2137
2137
  }
2138
2138
  }
2139
2139
  return this;
@@ -2209,7 +2209,7 @@ class Rt {
2209
2209
  this.normal = new w(), this.midpoint = new w(), this.area = 0, this.constant = 0, this.outside = null, this.mark = Rs, this.edge = null;
2210
2210
  }
2211
2211
  static create(s, t, e) {
2212
- const i = new Rt(), o = new Qs(s, i), n = new Qs(t, i), r = new Qs(e, i);
2212
+ const i = new Rt(), o = new js(s, i), n = new js(t, i), r = new js(e, i);
2213
2213
  return o.next = r.prev = n, n.next = o.prev = r, r.next = n.prev = o, i.edge = o, i.compute();
2214
2214
  }
2215
2215
  getEdge(s) {
@@ -2228,7 +2228,7 @@ class Rt {
2228
2228
  return this.normal.dot(s) - this.constant;
2229
2229
  }
2230
2230
  }
2231
- class Qs {
2231
+ class js {
2232
2232
  constructor(s, t) {
2233
2233
  this.vertex = s, this.prev = null, this.next = null, this.twin = null, this.face = t;
2234
2234
  }
@@ -2298,8 +2298,8 @@ class Ji {
2298
2298
  return this.head === null;
2299
2299
  }
2300
2300
  }
2301
- const Ei = [2, 2, 1], di = [1, 0, 0];
2302
- function yt(l, s) {
2301
+ const di = [2, 2, 1], ui = [1, 0, 0];
2302
+ function Pt(l, s) {
2303
2303
  return l * 3 + s;
2304
2304
  }
2305
2305
  function Er(l) {
@@ -2313,7 +2313,7 @@ function dr(l) {
2313
2313
  const s = l.elements;
2314
2314
  let t = 0;
2315
2315
  for (let e = 0; e < 3; e++) {
2316
- const i = s[yt(Ei[e], di[e])];
2316
+ const i = s[Pt(di[e], ui[e])];
2317
2317
  t += 2 * i * i;
2318
2318
  }
2319
2319
  return Math.sqrt(t);
@@ -2322,17 +2322,17 @@ function ur(l, s) {
2322
2322
  let t = 0, e = 1;
2323
2323
  const i = l.elements;
2324
2324
  for (let c = 0; c < 3; c++) {
2325
- const E = Math.abs(i[yt(Ei[c], di[c])]);
2325
+ const E = Math.abs(i[Pt(di[c], ui[c])]);
2326
2326
  E > t && (t = E, e = c);
2327
2327
  }
2328
2328
  let o = 1, n = 0;
2329
- const r = di[e], a = Ei[e];
2330
- if (Math.abs(i[yt(a, r)]) > Number.EPSILON) {
2331
- const c = i[yt(a, a)], E = i[yt(r, r)], d = i[yt(a, r)], h = (c - E) / 2 / d;
2329
+ const r = ui[e], a = di[e];
2330
+ if (Math.abs(i[Pt(a, r)]) > Number.EPSILON) {
2331
+ const c = i[Pt(a, a)], E = i[Pt(r, r)], d = i[Pt(a, r)], h = (c - E) / 2 / d;
2332
2332
  let u;
2333
2333
  h < 0 ? u = -1 / (-h + Math.sqrt(1 + h * h)) : u = 1 / (h + Math.sqrt(1 + h * h)), o = 1 / Math.sqrt(1 + u * u), n = u * o;
2334
2334
  }
2335
- return s.identity(), s.elements[yt(r, r)] = o, s.elements[yt(a, a)] = o, s.elements[yt(a, r)] = n, s.elements[yt(r, a)] = -n, s;
2335
+ return s.identity(), s.elements[Pt(r, r)] = o, s.elements[Pt(a, a)] = o, s.elements[Pt(a, r)] = n, s.elements[Pt(r, a)] = -n, s;
2336
2336
  }
2337
2337
  function Ir(l, s) {
2338
2338
  let t = 0, e = 0;
@@ -2364,40 +2364,40 @@ function fr(l) {
2364
2364
  while (Jt !== tt.edge);
2365
2365
  const Yn = o.length - 2;
2366
2366
  for (let Qe = 1, Vn = Yn; Qe <= Vn; Qe++) {
2367
- const Ds = o[0].vertex, Us = o[Qe + 0].vertex, xs = o[Qe + 1].vertex;
2368
- n.push(Ds.point.x, Ds.point.y, Ds.point.z), n.push(Us.point.x, Us.point.y, Us.point.z), n.push(xs.point.x, xs.point.y, xs.point.z);
2367
+ const Us = o[0].vertex, xs = o[Qe + 0].vertex, bs = o[Qe + 1].vertex;
2368
+ n.push(Us.point.x, Us.point.y, Us.point.z), n.push(xs.point.x, xs.point.y, xs.point.z), n.push(bs.point.x, bs.point.y, bs.point.z);
2369
2369
  }
2370
2370
  }
2371
2371
  const r = new O.Vector3(), a = new O.Vector3(), c = new O.Vector3(), E = new O.Vector3(), d = new O.Vector3(), h = new O.Vector3(), u = new O.Vector3(), p = new O.Vector3();
2372
- let T = 0, A = 0, C = 0, m = 0, F = 0, f = 0, R = 0;
2372
+ let m = 0, A = 0, C = 0, T = 0, F = 0, f = 0, R = 0;
2373
2373
  for (let it = 0, Zt = n.length; it < Zt; it += 9) {
2374
2374
  r.fromArray(n, it), a.fromArray(n, it + 3), c.fromArray(n, it + 6), u.set(0, 0, 0), u.add(r).add(a).add(c).divideScalar(3), E.subVectors(a, r), d.subVectors(c, r);
2375
2375
  const tt = h.crossVectors(E, d).length() / 2;
2376
- p.add(h.copy(u).multiplyScalar(tt)), T += tt, A += (9 * u.x * u.x + r.x * r.x + a.x * a.x + c.x * c.x) * (tt / 12), C += (9 * u.x * u.y + r.x * r.y + a.x * a.y + c.x * c.y) * (tt / 12), m += (9 * u.x * u.z + r.x * r.z + a.x * a.z + c.x * c.z) * (tt / 12), F += (9 * u.y * u.y + r.y * r.y + a.y * a.y + c.y * c.y) * (tt / 12), f += (9 * u.y * u.z + r.y * r.z + a.y * a.z + c.y * c.z) * (tt / 12), R += (9 * u.z * u.z + r.z * r.z + a.z * a.z + c.z * c.z) * (tt / 12);
2376
+ p.add(h.copy(u).multiplyScalar(tt)), m += tt, A += (9 * u.x * u.x + r.x * r.x + a.x * a.x + c.x * c.x) * (tt / 12), C += (9 * u.x * u.y + r.x * r.y + a.x * a.y + c.x * c.y) * (tt / 12), T += (9 * u.x * u.z + r.x * r.z + a.x * a.z + c.x * c.z) * (tt / 12), F += (9 * u.y * u.y + r.y * r.y + a.y * a.y + c.y * c.y) * (tt / 12), f += (9 * u.y * u.z + r.y * r.z + a.y * a.z + c.y * c.z) * (tt / 12), R += (9 * u.z * u.z + r.z * r.z + a.z * a.z + c.z * c.z) * (tt / 12);
2377
2377
  }
2378
- p.divideScalar(T), A /= T, C /= T, m /= T, F /= T, f /= T, R /= T, A -= p.x * p.x, C -= p.x * p.y, m -= p.x * p.z, F -= p.y * p.y, f -= p.y * p.z, R -= p.z * p.z;
2378
+ p.divideScalar(m), A /= m, C /= m, T /= m, F /= m, f /= m, R /= m, A -= p.x * p.x, C -= p.x * p.y, T -= p.x * p.z, F -= p.y * p.y, f -= p.y * p.z, R -= p.z * p.z;
2379
2379
  const g = new O.Matrix3();
2380
- g.elements[0] = A, g.elements[1] = C, g.elements[2] = m, g.elements[3] = C, g.elements[4] = F, g.elements[5] = f, g.elements[6] = m, g.elements[7] = f, g.elements[8] = R, Ir(g, e);
2381
- const S = e.unitary, _ = new O.Vector3(), N = new O.Vector3(), P = new O.Vector3();
2382
- S.extractBasis(_, N, P);
2383
- let M = -1 / 0, L = -1 / 0, U = -1 / 0, b = 1 / 0, B = 1 / 0, H = 1 / 0;
2380
+ g.elements[0] = A, g.elements[1] = C, g.elements[2] = T, g.elements[3] = C, g.elements[4] = F, g.elements[5] = f, g.elements[6] = T, g.elements[7] = f, g.elements[8] = R, Ir(g, e);
2381
+ const S = e.unitary, _ = new O.Vector3(), N = new O.Vector3(), L = new O.Vector3();
2382
+ S.extractBasis(_, N, L);
2383
+ let M = -1 / 0, y = -1 / 0, x = -1 / 0, b = 1 / 0, B = 1 / 0, H = 1 / 0;
2384
2384
  for (let it = 0, Zt = s.length; it < Zt; it++) {
2385
2385
  const tt = s[it];
2386
- M = Math.max(_.dot(tt), M), L = Math.max(N.dot(tt), L), U = Math.max(P.dot(tt), U), b = Math.min(_.dot(tt), b), B = Math.min(N.dot(tt), B), H = Math.min(P.dot(tt), H);
2386
+ M = Math.max(_.dot(tt), M), y = Math.max(N.dot(tt), y), x = Math.max(L.dot(tt), x), b = Math.min(_.dot(tt), b), B = Math.min(N.dot(tt), B), H = Math.min(L.dot(tt), H);
2387
2387
  }
2388
- _.multiplyScalar(0.5 * (b + M)), N.multiplyScalar(0.5 * (B + L)), P.multiplyScalar(0.5 * (H + U));
2388
+ _.multiplyScalar(0.5 * (b + M)), N.multiplyScalar(0.5 * (B + y)), L.multiplyScalar(0.5 * (H + x));
2389
2389
  const q = new O.Vector3(), st = new O.Vector3(), Q = new O.Matrix3();
2390
- q.add(_).add(N).add(P), st.x = M - b, st.y = L - B, st.z = U - H, st.multiplyScalar(0.5), Q.copy(S);
2390
+ q.add(_).add(N).add(L), st.x = M - b, st.y = y - B, st.z = x - H, st.multiplyScalar(0.5), Q.copy(S);
2391
2391
  const { x: kt, y: Wt, z: Xt } = st, Ze = new O.Matrix4();
2392
2392
  Ze.makeScale(kt * 2, Wt * 2, Xt * 2);
2393
2393
  const Te = new O.Matrix4();
2394
2394
  Te.makeTranslation(-kt, -Wt, -Xt);
2395
- const yi = new O.Matrix4();
2396
- yi.makeTranslation(q.x, q.y, q.z);
2397
2395
  const Pi = new O.Matrix4();
2398
- Pi.setFromMatrix3(Q);
2396
+ Pi.makeTranslation(q.x, q.y, q.z);
2397
+ const Li = new O.Matrix4();
2398
+ Li.setFromMatrix3(Q);
2399
2399
  const me = new O.Matrix4();
2400
- return me.multiply(yi), me.multiply(Pi), me.multiply(Te), me.multiply(Ze), { center: q, halfSizes: st, rotation: Q, transformation: me };
2400
+ return me.multiply(Pi), me.multiply(Li), me.multiply(Te), me.multiply(Ze), { center: q, halfSizes: st, rotation: Q, transformation: me };
2401
2401
  }
2402
2402
  function pr(l, s, t) {
2403
2403
  const e = [
@@ -2690,18 +2690,18 @@ I(K, "_lut", [
2690
2690
  "ff"
2691
2691
  ]);
2692
2692
  let ke = K;
2693
- class ea extends J {
2693
+ class ta extends J {
2694
2694
  constructor(t, e) {
2695
2695
  super(t);
2696
- I(this, "onVertexFound", new D());
2697
- I(this, "onVertexLost", new D());
2696
+ I(this, "onVertexFound", new U());
2697
+ I(this, "onVertexLost", new U());
2698
2698
  I(this, "components");
2699
2699
  I(this, "_pickedPoint", null);
2700
2700
  I(this, "_config");
2701
2701
  I(this, "_enabled", !1);
2702
2702
  I(this, "_workingPlane", null);
2703
2703
  /** {@link Disposable.onDisposed} */
2704
- I(this, "onDisposed", new D());
2704
+ I(this, "onDisposed", new U());
2705
2705
  this.components = t, this.config = {
2706
2706
  snapDistance: 0.25,
2707
2707
  showOnlyVertex: !1,
@@ -2773,10 +2773,10 @@ class ea extends J {
2773
2773
  );
2774
2774
  }
2775
2775
  }
2776
- const gs = class gs {
2776
+ const Os = class Os {
2777
2777
  constructor() {
2778
2778
  /** {@link Disposable.onDisposed} */
2779
- I(this, "onDisposed", new D());
2779
+ I(this, "onDisposed", new U());
2780
2780
  /** The list of components created in this app. */
2781
2781
  I(this, "list", /* @__PURE__ */ new Map());
2782
2782
  /** If disabled, the animation loop will be stopped. */
@@ -2790,7 +2790,7 @@ const gs = class gs {
2790
2790
  e.enabled && e.isUpdateable() && e.update(s);
2791
2791
  requestAnimationFrame(this.update);
2792
2792
  });
2793
- this._clock = new O.Clock(), gs.setupBVH();
2793
+ this._clock = new O.Clock(), Os.setupBVH();
2794
2794
  }
2795
2795
  add(s, t) {
2796
2796
  if (this.list.has(s))
@@ -2847,14 +2847,14 @@ const gs = class gs {
2847
2847
  O.BufferGeometry.prototype.computeBoundsTree = sr, O.BufferGeometry.prototype.disposeBoundsTree = ir, O.Mesh.prototype.raycast = er;
2848
2848
  }
2849
2849
  };
2850
- I(gs, "release", "1.4.21");
2851
- let ui = gs;
2850
+ I(Os, "release", "1.4.21");
2851
+ let Ii = Os;
2852
2852
  class Cr {
2853
2853
  constructor(s) {
2854
2854
  I(this, "_event");
2855
2855
  I(this, "_position", new O.Vector2());
2856
2856
  /** {@link Disposable.onDisposed} */
2857
- I(this, "onDisposed", new D());
2857
+ I(this, "onDisposed", new U());
2858
2858
  I(this, "updateMouseInfo", (s) => {
2859
2859
  this._event = s;
2860
2860
  });
@@ -2890,7 +2890,7 @@ class Tr {
2890
2890
  I(this, "enabled", !0);
2891
2891
  I(this, "components");
2892
2892
  /** {@link Disposable.onDisposed} */
2893
- I(this, "onDisposed", new D());
2893
+ I(this, "onDisposed", new U());
2894
2894
  /** The position of the mouse in the screen. */
2895
2895
  I(this, "mouse");
2896
2896
  I(this, "three", new O.Raycaster());
@@ -2938,13 +2938,13 @@ class Tr {
2938
2938
  );
2939
2939
  }
2940
2940
  }
2941
- const Os = class Os extends J {
2941
+ const Ss = class Ss extends J {
2942
2942
  constructor(t) {
2943
2943
  super(t);
2944
2944
  I(this, "enabled", !0);
2945
2945
  I(this, "list", /* @__PURE__ */ new Map());
2946
- I(this, "onDisposed", new D());
2947
- t.add(Os.uuid, this);
2946
+ I(this, "onDisposed", new U());
2947
+ t.add(Ss.uuid, this);
2948
2948
  }
2949
2949
  get(t) {
2950
2950
  if (this.list.has(t.uuid))
@@ -2964,8 +2964,8 @@ const Os = class Os extends J {
2964
2964
  this.list.clear(), this.onDisposed.trigger();
2965
2965
  }
2966
2966
  };
2967
- I(Os, "uuid", "d5d8bdf0-db25-4952-b951-b643af207ace");
2968
- let We = Os;
2967
+ I(Ss, "uuid", "d5d8bdf0-db25-4952-b951-b643af207ace");
2968
+ let We = Ss;
2969
2969
  class mr extends gi {
2970
2970
  constructor(t) {
2971
2971
  super(t);
@@ -2973,11 +2973,11 @@ class mr extends gi {
2973
2973
  * All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
2974
2974
  */
2975
2975
  I(this, "meshes", /* @__PURE__ */ new Set());
2976
- I(this, "onAfterUpdate", new D());
2977
- I(this, "onBeforeUpdate", new D());
2976
+ I(this, "onAfterUpdate", new U());
2977
+ I(this, "onBeforeUpdate", new U());
2978
2978
  I(this, "enabled", !0);
2979
2979
  I(this, "uuid", ke.create());
2980
- I(this, "onDisposed", new D());
2980
+ I(this, "onDisposed", new U());
2981
2981
  I(this, "_scene");
2982
2982
  I(this, "_camera");
2983
2983
  I(this, "_renderer", null);
@@ -3018,14 +3018,14 @@ class mr extends gi {
3018
3018
  this._scene = null, this._camera = null, this._renderer = null, this.onDisposed.trigger();
3019
3019
  }
3020
3020
  }
3021
- class sa extends rr {
3021
+ class ea extends rr {
3022
3022
  constructor(t) {
3023
3023
  super(t);
3024
3024
  /** {@link Configurable.isSetup} */
3025
3025
  I(this, "isSetup", !1);
3026
3026
  I(this, "three");
3027
3027
  /** {@link Configurable.onSetup} */
3028
- I(this, "onSetup", new D());
3028
+ I(this, "onSetup", new U());
3029
3029
  I(this, "config", {
3030
3030
  directionalLight: {
3031
3031
  color: new O.Color("white"),
@@ -3054,7 +3054,7 @@ class sa extends rr {
3054
3054
  this.three.add(e, i), this.isSetup = !0, this.onSetup.trigger(this);
3055
3055
  }
3056
3056
  }
3057
- class ia extends or {
3057
+ class sa extends or {
3058
3058
  constructor(t, e, i) {
3059
3059
  super(t);
3060
3060
  I(this, "enabled", !0);
@@ -3064,7 +3064,7 @@ class ia extends or {
3064
3064
  I(this, "_canvas");
3065
3065
  I(this, "_parameters");
3066
3066
  I(this, "_resizeObserver", null);
3067
- I(this, "onContainerUpdated", new D());
3067
+ I(this, "onContainerUpdated", new U());
3068
3068
  /** {@link Resizeable.resize} */
3069
3069
  I(this, "resize", (t) => {
3070
3070
  this.onContainerUpdated.trigger();
@@ -3132,7 +3132,7 @@ const V = {
3132
3132
  LEFT: 1,
3133
3133
  RIGHT: 2,
3134
3134
  MIDDLE: 4
3135
- }, y = Object.freeze({
3135
+ }, P = Object.freeze({
3136
3136
  NONE: 0,
3137
3137
  ROTATE: 1,
3138
3138
  TRUCK: 2,
@@ -3174,10 +3174,10 @@ function k(l, s, t = Mn) {
3174
3174
  function sn(l, s) {
3175
3175
  return Math.round(l / s) * s;
3176
3176
  }
3177
- function ye(l) {
3177
+ function Pe(l) {
3178
3178
  return isFinite(l) ? l : l < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;
3179
3179
  }
3180
- function Pe(l) {
3180
+ function Le(l) {
3181
3181
  return Math.abs(l) < Number.MAX_VALUE ? l : l * (1 / 0);
3182
3182
  }
3183
3183
  function ds(l, s, t, e, i = 1 / 0, o) {
@@ -3194,24 +3194,24 @@ function ds(l, s, t, e, i = 1 / 0, o) {
3194
3194
  function nn(l, s, t, e, i = 1 / 0, o, n) {
3195
3195
  e = Math.max(1e-4, e);
3196
3196
  const r = 2 / e, a = r * o, c = 1 / (1 + a + 0.48 * a * a + 0.235 * a * a * a);
3197
- let E = s.x, d = s.y, h = s.z, u = l.x - E, p = l.y - d, T = l.z - h;
3198
- const A = E, C = d, m = h, F = i * e, f = F * F, R = u * u + p * p + T * T;
3197
+ let E = s.x, d = s.y, h = s.z, u = l.x - E, p = l.y - d, m = l.z - h;
3198
+ const A = E, C = d, T = h, F = i * e, f = F * F, R = u * u + p * p + m * m;
3199
3199
  if (R > f) {
3200
3200
  const B = Math.sqrt(R);
3201
- u = u / B * F, p = p / B * F, T = T / B * F;
3201
+ u = u / B * F, p = p / B * F, m = m / B * F;
3202
3202
  }
3203
- E = l.x - u, d = l.y - p, h = l.z - T;
3204
- const g = (t.x + r * u) * o, S = (t.y + r * p) * o, _ = (t.z + r * T) * o;
3205
- t.x = (t.x - r * g) * c, t.y = (t.y - r * S) * c, t.z = (t.z - r * _) * c, n.x = E + (u + g) * c, n.y = d + (p + S) * c, n.z = h + (T + _) * c;
3206
- const N = A - l.x, P = C - l.y, M = m - l.z, L = n.x - A, U = n.y - C, b = n.z - m;
3207
- return N * L + P * U + M * b > 0 && (n.x = A, n.y = C, n.z = m, t.x = (n.x - A) / o, t.y = (n.y - C) / o, t.z = (n.z - m) / o), n;
3203
+ E = l.x - u, d = l.y - p, h = l.z - m;
3204
+ const g = (t.x + r * u) * o, S = (t.y + r * p) * o, _ = (t.z + r * m) * o;
3205
+ t.x = (t.x - r * g) * c, t.y = (t.y - r * S) * c, t.z = (t.z - r * _) * c, n.x = E + (u + g) * c, n.y = d + (p + S) * c, n.z = h + (m + _) * c;
3206
+ const N = A - l.x, L = C - l.y, M = T - l.z, y = n.x - A, x = n.y - C, b = n.z - T;
3207
+ return N * y + L * x + M * b > 0 && (n.x = A, n.y = C, n.z = T, t.x = (n.x - A) / o, t.y = (n.y - C) / o, t.z = (n.z - T) / o), n;
3208
3208
  }
3209
- function js(l, s) {
3209
+ function qs(l, s) {
3210
3210
  s.set(0, 0), l.forEach((t) => {
3211
3211
  s.x += t.clientX, s.y += t.clientY;
3212
3212
  }), s.x /= l.length, s.y /= l.length;
3213
3213
  }
3214
- function qs(l, s) {
3214
+ function $s(l, s) {
3215
3215
  return vt(l) ? (console.warn(`${s} is not supported in OrthographicCamera`), !0) : !1;
3216
3216
  }
3217
3217
  class Rr {
@@ -3279,7 +3279,7 @@ class Rr {
3279
3279
  }
3280
3280
  }
3281
3281
  const Ar = "2.7.3", us = 1 / 8, Dn = typeof window < "u", Fr = Dn && /Mac/.test(navigator.platform), gr = !(Dn && "PointerEvent" in window);
3282
- let Y, on, Is, $s, ht, G, z, de, Le, St, _t, jt, rn, an, ut, we, ue, cn, Ks, ln, Js, ti, fs;
3282
+ let Y, on, Is, Ks, ht, G, z, de, ye, St, _t, jt, rn, an, ut, we, ue, cn, Js, ln, ti, ei, fs;
3283
3283
  class ot extends Rr {
3284
3284
  /**
3285
3285
  * Injects THREE as the dependency. You can then proceed to use CameraControls.
@@ -3322,14 +3322,14 @@ class ot extends Rr {
3322
3322
  * @category Statics
3323
3323
  */
3324
3324
  static install(s) {
3325
- Y = s.THREE, on = Object.freeze(new Y.Vector3(0, 0, 0)), Is = Object.freeze(new Y.Vector3(0, 1, 0)), $s = Object.freeze(new Y.Vector3(0, 0, 1)), ht = new Y.Vector2(), G = new Y.Vector3(), z = new Y.Vector3(), de = new Y.Vector3(), Le = new Y.Vector3(), St = new Y.Vector3(), _t = new Y.Vector3(), jt = new Y.Vector3(), rn = new Y.Vector3(), an = new Y.Vector3(), ut = new Y.Spherical(), we = new Y.Spherical(), ue = new Y.Box3(), cn = new Y.Box3(), Ks = new Y.Sphere(), ln = new Y.Quaternion(), Js = new Y.Quaternion(), ti = new Y.Matrix4(), fs = new Y.Raycaster();
3325
+ Y = s.THREE, on = Object.freeze(new Y.Vector3(0, 0, 0)), Is = Object.freeze(new Y.Vector3(0, 1, 0)), Ks = Object.freeze(new Y.Vector3(0, 0, 1)), ht = new Y.Vector2(), G = new Y.Vector3(), z = new Y.Vector3(), de = new Y.Vector3(), ye = new Y.Vector3(), St = new Y.Vector3(), _t = new Y.Vector3(), jt = new Y.Vector3(), rn = new Y.Vector3(), an = new Y.Vector3(), ut = new Y.Spherical(), we = new Y.Spherical(), ue = new Y.Box3(), cn = new Y.Box3(), Js = new Y.Sphere(), ln = new Y.Quaternion(), ti = new Y.Quaternion(), ei = new Y.Matrix4(), fs = new Y.Raycaster();
3326
3326
  }
3327
3327
  /**
3328
3328
  * list all ACTIONs
3329
3329
  * @category Statics
3330
3330
  */
3331
3331
  static get ACTION() {
3332
- return y;
3332
+ return P;
3333
3333
  }
3334
3334
  /**
3335
3335
  * Creates a `CameraControls` instance.
@@ -3350,10 +3350,10 @@ class ot extends Rr {
3350
3350
  */
3351
3351
  constructor(s, t) {
3352
3352
  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 = () => {
3353
- }, this._enabled = !0, this._state = y.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 = he.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 = (f, R, g) => {
3353
+ }, 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 = he.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 = (f, R, g) => {
3354
3354
  let S, _;
3355
3355
  if (Qt(this._camera)) {
3356
- const N = G.copy(this._camera.position).sub(this._target), P = this._camera.getEffectiveFOV() * Ne, M = N.length() * Math.tan(P * 0.5);
3356
+ const N = G.copy(this._camera.position).sub(this._target), L = this._camera.getEffectiveFOV() * Ne, M = N.length() * Math.tan(L * 0.5);
3357
3357
  S = this.truckSpeed * f * M / this._elementRect.height, _ = this.truckSpeed * R * M / this._elementRect.height;
3358
3358
  } else if (vt(this._camera)) {
3359
3359
  const N = this._camera;
@@ -3365,25 +3365,25 @@ class ot extends Rr {
3365
3365
  const g = Ee * this.azimuthRotateSpeed * f / this._elementRect.height, S = Ee * this.polarRotateSpeed * R / this._elementRect.height;
3366
3366
  this.rotate(g, S, !0);
3367
3367
  }, this._dollyInternal = (f, R, g) => {
3368
- const S = Math.pow(0.95, -f * this.dollySpeed), _ = this._sphericalEnd.radius, N = this._sphericalEnd.radius * S, P = mt(N, this.minDistance, this.maxDistance), M = P - N;
3369
- this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(N, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(M, !0), this._dollyToNoClamp(P, !0)) : this._dollyToNoClamp(P, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? N : P) - _, this._dollyControlCoord.set(R, g)), this._lastDollyDirection = Math.sign(-f);
3368
+ const S = Math.pow(0.95, -f * this.dollySpeed), _ = this._sphericalEnd.radius, N = this._sphericalEnd.radius * S, L = mt(N, this.minDistance, this.maxDistance), M = L - N;
3369
+ this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(N, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(M, !0), this._dollyToNoClamp(L, !0)) : this._dollyToNoClamp(L, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? N : L) - _, this._dollyControlCoord.set(R, g)), this._lastDollyDirection = Math.sign(-f);
3370
3370
  }, this._zoomInternal = (f, R, g) => {
3371
3371
  const S = Math.pow(0.95, f * this.dollySpeed), _ = this._zoom, N = this._zoom * S;
3372
3372
  this.zoomTo(N, !0), this.dollyToCursor && (this._changedZoom += N - _, this._dollyControlCoord.set(R, g));
3373
- }, 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, Is), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = y.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 = [
3373
+ }, 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, Is), 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 = [
3374
3374
  new Y.Vector3(),
3375
3375
  new Y.Vector3(),
3376
3376
  new Y.Vector3(),
3377
3377
  new Y.Vector3()
3378
3378
  ], this._updateNearPlaneCorners(), this._boundary = new Y.Box3(new Y.Vector3(-1 / 0, -1 / 0, -1 / 0), new Y.Vector3(1 / 0, 1 / 0, 1 / 0)), this._cameraUp0 = this._camera.up.clone(), this._target0 = this._target.clone(), this._position0 = this._camera.position.clone(), this._zoom0 = this._zoom, this._focalOffset0 = this._focalOffset.clone(), this._dollyControlCoord = new Y.Vector2(), this.mouseButtons = {
3379
- left: y.ROTATE,
3380
- middle: y.DOLLY,
3381
- right: y.TRUCK,
3382
- wheel: Qt(this._camera) ? y.DOLLY : vt(this._camera) ? y.ZOOM : y.NONE
3379
+ left: P.ROTATE,
3380
+ middle: P.DOLLY,
3381
+ right: P.TRUCK,
3382
+ wheel: Qt(this._camera) ? P.DOLLY : vt(this._camera) ? P.ZOOM : P.NONE
3383
3383
  }, this.touches = {
3384
- one: y.TOUCH_ROTATE,
3385
- two: Qt(this._camera) ? y.TOUCH_DOLLY_TRUCK : vt(this._camera) ? y.TOUCH_ZOOM_TRUCK : y.NONE,
3386
- three: y.TOUCH_TRUCK
3384
+ one: P.TOUCH_ROTATE,
3385
+ two: Qt(this._camera) ? P.TOUCH_DOLLY_TRUCK : vt(this._camera) ? P.TOUCH_ZOOM_TRUCK : P.NONE,
3386
+ three: P.TOUCH_TRUCK
3387
3387
  };
3388
3388
  const e = new Y.Vector2(), i = new Y.Vector2(), o = new Y.Vector2(), n = (f) => {
3389
3389
  if (!this._enabled || !this._domElement)
@@ -3408,7 +3408,7 @@ class ot extends Rr {
3408
3408
  deltaY: 0,
3409
3409
  mouseButton: R
3410
3410
  };
3411
- this._activePointers.push(g), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", E), this._domElement.ownerDocument.addEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.addEventListener("pointerup", E), this._isDragging = !0, T(f);
3411
+ this._activePointers.push(g), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", E), this._domElement.ownerDocument.addEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.addEventListener("pointerup", E), this._isDragging = !0, m(f);
3412
3412
  }, r = (f) => {
3413
3413
  if (!this._enabled || !this._domElement || this._lockedPointer)
3414
3414
  return;
@@ -3430,7 +3430,7 @@ class ot extends Rr {
3430
3430
  deltaY: 0,
3431
3431
  mouseButton: (f.buttons & V.LEFT) === V.LEFT ? V.LEFT : (f.buttons & V.MIDDLE) === V.LEFT ? V.MIDDLE : (f.buttons & V.RIGHT) === V.LEFT ? V.RIGHT : null
3432
3432
  };
3433
- this._activePointers.push(g), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("mouseup", d), this._domElement.ownerDocument.addEventListener("mousemove", c), this._domElement.ownerDocument.addEventListener("mouseup", d), this._isDragging = !0, T(f);
3433
+ this._activePointers.push(g), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("mouseup", d), this._domElement.ownerDocument.addEventListener("mousemove", c), this._domElement.ownerDocument.addEventListener("mouseup", d), this._isDragging = !0, m(f);
3434
3434
  }, a = (f) => {
3435
3435
  f.cancelable && f.preventDefault();
3436
3436
  const R = f.pointerId, g = this._lockedPointer || this._findPointerById(R);
@@ -3460,7 +3460,7 @@ class ot extends Rr {
3460
3460
  if (R && this._disposePointer(R), f.pointerType === "touch")
3461
3461
  switch (this._activePointers.length) {
3462
3462
  case 0:
3463
- this._state = y.NONE;
3463
+ this._state = P.NONE;
3464
3464
  break;
3465
3465
  case 1:
3466
3466
  this._state = this.touches.one;
@@ -3473,45 +3473,45 @@ class ot extends Rr {
3473
3473
  break;
3474
3474
  }
3475
3475
  else
3476
- this._state = y.NONE;
3476
+ this._state = P.NONE;
3477
3477
  C();
3478
3478
  }
3479
3479
  }, d = () => {
3480
3480
  const f = this._findPointerById(1);
3481
- f && f === this._lockedPointer || (f && this._disposePointer(f), this._state = y.NONE, C());
3481
+ f && f === this._lockedPointer || (f && this._disposePointer(f), this._state = P.NONE, C());
3482
3482
  };
3483
3483
  let h = -1;
3484
3484
  const u = (f) => {
3485
- if (!this._domElement || !this._enabled || this.mouseButtons.wheel === y.NONE)
3485
+ if (!this._domElement || !this._enabled || this.mouseButtons.wheel === P.NONE)
3486
3486
  return;
3487
3487
  if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
3488
- const N = this._domElement.getBoundingClientRect(), P = f.clientX / N.width, M = f.clientY / N.height;
3489
- if (P < this._interactiveArea.left || P > this._interactiveArea.right || M < this._interactiveArea.top || M > this._interactiveArea.bottom)
3488
+ const N = this._domElement.getBoundingClientRect(), L = f.clientX / N.width, M = f.clientY / N.height;
3489
+ if (L < this._interactiveArea.left || L > this._interactiveArea.right || M < this._interactiveArea.top || M > this._interactiveArea.bottom)
3490
3490
  return;
3491
3491
  }
3492
- if (f.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel === y.ROTATE || this.mouseButtons.wheel === y.TRUCK) {
3492
+ if (f.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel === P.ROTATE || this.mouseButtons.wheel === P.TRUCK) {
3493
3493
  const N = performance.now();
3494
3494
  h - N < 1e3 && this._getClientRect(this._elementRect), h = N;
3495
3495
  }
3496
3496
  const R = Fr ? -1 : -3, g = f.deltaMode === 1 ? f.deltaY / R : f.deltaY / (R * 10), S = this.dollyToCursor ? (f.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, _ = this.dollyToCursor ? (f.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
3497
3497
  switch (this.mouseButtons.wheel) {
3498
- case y.ROTATE: {
3498
+ case P.ROTATE: {
3499
3499
  this._rotateInternal(f.deltaX, f.deltaY), this._isUserControllingRotate = !0;
3500
3500
  break;
3501
3501
  }
3502
- case y.TRUCK: {
3502
+ case P.TRUCK: {
3503
3503
  this._truckInternal(f.deltaX, f.deltaY, !1), this._isUserControllingTruck = !0;
3504
3504
  break;
3505
3505
  }
3506
- case y.OFFSET: {
3506
+ case P.OFFSET: {
3507
3507
  this._truckInternal(f.deltaX, f.deltaY, !0), this._isUserControllingOffset = !0;
3508
3508
  break;
3509
3509
  }
3510
- case y.DOLLY: {
3510
+ case P.DOLLY: {
3511
3511
  this._dollyInternal(-g, S, _), this._isUserControllingDolly = !0;
3512
3512
  break;
3513
3513
  }
3514
- case y.ZOOM: {
3514
+ case P.ZOOM: {
3515
3515
  this._zoomInternal(-g, S, _), this._isUserControllingZoom = !0;
3516
3516
  break;
3517
3517
  }
@@ -3526,14 +3526,14 @@ class ot extends Rr {
3526
3526
  }
3527
3527
  f.preventDefault();
3528
3528
  }
3529
- }, T = (f) => {
3529
+ }, m = (f) => {
3530
3530
  if (!this._enabled)
3531
3531
  return;
3532
- if (js(this._activePointers, ht), this._getClientRect(this._elementRect), e.copy(ht), i.copy(ht), this._activePointers.length >= 2) {
3532
+ if (qs(this._activePointers, ht), this._getClientRect(this._elementRect), e.copy(ht), i.copy(ht), this._activePointers.length >= 2) {
3533
3533
  const g = ht.x - this._activePointers[1].clientX, S = ht.y - this._activePointers[1].clientY, _ = Math.sqrt(g * g + S * S);
3534
3534
  o.set(0, _);
3535
- const N = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, P = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
3536
- i.set(N, P);
3535
+ const N = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, L = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
3536
+ i.set(N, L);
3537
3537
  }
3538
3538
  if (this._state = 0, !f)
3539
3539
  this._lockedPointer && (this._state = this._state | this.mouseButtons.left);
@@ -3551,25 +3551,25 @@ class ot extends Rr {
3551
3551
  }
3552
3552
  else
3553
3553
  !this._lockedPointer && (f.buttons & V.LEFT) === V.LEFT && (this._state = this._state | this.mouseButtons.left), (f.buttons & V.MIDDLE) === V.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (f.buttons & V.RIGHT) === V.RIGHT && (this._state = this._state | this.mouseButtons.right);
3554
- ((this._state & y.ROTATE) === y.ROTATE || (this._state & y.TOUCH_ROTATE) === y.TOUCH_ROTATE || (this._state & y.TOUCH_DOLLY_ROTATE) === y.TOUCH_DOLLY_ROTATE || (this._state & y.TOUCH_ZOOM_ROTATE) === y.TOUCH_ZOOM_ROTATE) && (this._sphericalEnd.theta = this._spherical.theta, this._sphericalEnd.phi = this._spherical.phi, this._thetaVelocity.value = 0, this._phiVelocity.value = 0), ((this._state & y.TRUCK) === y.TRUCK || (this._state & y.TOUCH_TRUCK) === y.TOUCH_TRUCK || (this._state & y.TOUCH_DOLLY_TRUCK) === y.TOUCH_DOLLY_TRUCK || (this._state & y.TOUCH_ZOOM_TRUCK) === y.TOUCH_ZOOM_TRUCK) && (this._targetEnd.copy(this._target), this._targetVelocity.set(0, 0, 0)), ((this._state & y.DOLLY) === y.DOLLY || (this._state & y.TOUCH_DOLLY) === y.TOUCH_DOLLY || (this._state & y.TOUCH_DOLLY_TRUCK) === y.TOUCH_DOLLY_TRUCK || (this._state & y.TOUCH_DOLLY_OFFSET) === y.TOUCH_DOLLY_OFFSET || (this._state & y.TOUCH_DOLLY_ROTATE) === y.TOUCH_DOLLY_ROTATE) && (this._sphericalEnd.radius = this._spherical.radius, this._radiusVelocity.value = 0), ((this._state & y.ZOOM) === y.ZOOM || (this._state & y.TOUCH_ZOOM) === y.TOUCH_ZOOM || (this._state & y.TOUCH_ZOOM_TRUCK) === y.TOUCH_ZOOM_TRUCK || (this._state & y.TOUCH_ZOOM_OFFSET) === y.TOUCH_ZOOM_OFFSET || (this._state & y.TOUCH_ZOOM_ROTATE) === y.TOUCH_ZOOM_ROTATE) && (this._zoomEnd = this._zoom, this._zoomVelocity.value = 0), ((this._state & y.OFFSET) === y.OFFSET || (this._state & y.TOUCH_OFFSET) === y.TOUCH_OFFSET || (this._state & y.TOUCH_DOLLY_OFFSET) === y.TOUCH_DOLLY_OFFSET || (this._state & y.TOUCH_ZOOM_OFFSET) === y.TOUCH_ZOOM_OFFSET) && (this._focalOffsetEnd.copy(this._focalOffset), this._focalOffsetVelocity.set(0, 0, 0)), this.dispatchEvent({ type: "controlstart" });
3554
+ ((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._sphericalEnd.theta = this._spherical.theta, this._sphericalEnd.phi = this._spherical.phi, this._thetaVelocity.value = 0, this._phiVelocity.value = 0), ((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._targetEnd.copy(this._target), this._targetVelocity.set(0, 0, 0)), ((this._state & P.DOLLY) === P.DOLLY || (this._state & P.TOUCH_DOLLY) === P.TOUCH_DOLLY || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE) && (this._sphericalEnd.radius = this._spherical.radius, this._radiusVelocity.value = 0), ((this._state & P.ZOOM) === P.ZOOM || (this._state & P.TOUCH_ZOOM) === P.TOUCH_ZOOM || (this._state & P.TOUCH_ZOOM_TRUCK) === P.TOUCH_ZOOM_TRUCK || (this._state & P.TOUCH_ZOOM_OFFSET) === P.TOUCH_ZOOM_OFFSET || (this._state & P.TOUCH_ZOOM_ROTATE) === P.TOUCH_ZOOM_ROTATE) && (this._zoomEnd = this._zoom, this._zoomVelocity.value = 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._focalOffsetEnd.copy(this._focalOffset), this._focalOffsetVelocity.set(0, 0, 0)), this.dispatchEvent({ type: "controlstart" });
3555
3555
  }, A = () => {
3556
3556
  if (!this._enabled || !this._dragNeedsUpdate)
3557
3557
  return;
3558
- this._dragNeedsUpdate = !1, js(this._activePointers, ht);
3558
+ this._dragNeedsUpdate = !1, qs(this._activePointers, ht);
3559
3559
  const R = this._domElement && document.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, g = R ? -R.deltaX : i.x - ht.x, S = R ? -R.deltaY : i.y - ht.y;
3560
- if (i.copy(ht), ((this._state & y.ROTATE) === y.ROTATE || (this._state & y.TOUCH_ROTATE) === y.TOUCH_ROTATE || (this._state & y.TOUCH_DOLLY_ROTATE) === y.TOUCH_DOLLY_ROTATE || (this._state & y.TOUCH_ZOOM_ROTATE) === y.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(g, S), this._isUserControllingRotate = !0), (this._state & y.DOLLY) === y.DOLLY || (this._state & y.ZOOM) === y.ZOOM) {
3561
- 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, P = this.dollyDragInverted ? -1 : 1;
3562
- (this._state & y.DOLLY) === y.DOLLY ? (this._dollyInternal(P * S * us, _, N), this._isUserControllingDolly = !0) : (this._zoomInternal(P * S * us, _, N), this._isUserControllingZoom = !0);
3560
+ if (i.copy(ht), ((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) {
3561
+ 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, L = this.dollyDragInverted ? -1 : 1;
3562
+ (this._state & P.DOLLY) === P.DOLLY ? (this._dollyInternal(L * S * us, _, N), this._isUserControllingDolly = !0) : (this._zoomInternal(L * S * us, _, N), this._isUserControllingZoom = !0);
3563
3563
  }
3564
- if ((this._state & y.TOUCH_DOLLY) === y.TOUCH_DOLLY || (this._state & y.TOUCH_ZOOM) === y.TOUCH_ZOOM || (this._state & y.TOUCH_DOLLY_TRUCK) === y.TOUCH_DOLLY_TRUCK || (this._state & y.TOUCH_ZOOM_TRUCK) === y.TOUCH_ZOOM_TRUCK || (this._state & y.TOUCH_DOLLY_OFFSET) === y.TOUCH_DOLLY_OFFSET || (this._state & y.TOUCH_ZOOM_OFFSET) === y.TOUCH_ZOOM_OFFSET || (this._state & y.TOUCH_DOLLY_ROTATE) === y.TOUCH_DOLLY_ROTATE || (this._state & y.TOUCH_ZOOM_ROTATE) === y.TOUCH_ZOOM_ROTATE) {
3565
- const _ = ht.x - this._activePointers[1].clientX, N = ht.y - this._activePointers[1].clientY, P = Math.sqrt(_ * _ + N * N), M = o.y - P;
3566
- o.set(0, P);
3567
- 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;
3568
- (this._state & y.TOUCH_DOLLY) === y.TOUCH_DOLLY || (this._state & y.TOUCH_DOLLY_ROTATE) === y.TOUCH_DOLLY_ROTATE || (this._state & y.TOUCH_DOLLY_TRUCK) === y.TOUCH_DOLLY_TRUCK || (this._state & y.TOUCH_DOLLY_OFFSET) === y.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(M * us, L, U), this._isUserControllingDolly = !0) : (this._zoomInternal(M * us, L, U), this._isUserControllingZoom = !0);
3564
+ 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) {
3565
+ const _ = ht.x - this._activePointers[1].clientX, N = ht.y - this._activePointers[1].clientY, L = Math.sqrt(_ * _ + N * N), M = o.y - L;
3566
+ o.set(0, L);
3567
+ const y = this.dollyToCursor ? (i.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, x = this.dollyToCursor ? (i.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
3568
+ (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(M * us, y, x), this._isUserControllingDolly = !0) : (this._zoomInternal(M * us, y, x), this._isUserControllingZoom = !0);
3569
3569
  }
3570
- ((this._state & y.TRUCK) === y.TRUCK || (this._state & y.TOUCH_TRUCK) === y.TOUCH_TRUCK || (this._state & y.TOUCH_DOLLY_TRUCK) === y.TOUCH_DOLLY_TRUCK || (this._state & y.TOUCH_ZOOM_TRUCK) === y.TOUCH_ZOOM_TRUCK) && (this._truckInternal(g, S, !1), this._isUserControllingTruck = !0), ((this._state & y.OFFSET) === y.OFFSET || (this._state & y.TOUCH_OFFSET) === y.TOUCH_OFFSET || (this._state & y.TOUCH_DOLLY_OFFSET) === y.TOUCH_DOLLY_OFFSET || (this._state & y.TOUCH_ZOOM_OFFSET) === y.TOUCH_ZOOM_OFFSET) && (this._truckInternal(g, S, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
3570
+ ((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" });
3571
3571
  }, C = () => {
3572
- js(this._activePointers, ht), i.copy(ht), 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", E), this._domElement.ownerDocument.removeEventListener("mouseup", d), this.dispatchEvent({ type: "controlend" }));
3572
+ qs(this._activePointers, ht), i.copy(ht), 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", E), this._domElement.ownerDocument.removeEventListener("mouseup", d), this.dispatchEvent({ type: "controlend" }));
3573
3573
  };
3574
3574
  this.lockPointer = () => {
3575
3575
  !this._enabled || !this._domElement || (this.cancel(), this._lockedPointer = {
@@ -3579,11 +3579,11 @@ class ot extends Rr {
3579
3579
  deltaX: 0,
3580
3580
  deltaY: 0,
3581
3581
  mouseButton: null
3582
- }, this._activePointers.push(this._lockedPointer), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", E), this._domElement.requestPointerLock(), this._domElement.ownerDocument.addEventListener("pointerlockchange", m), this._domElement.ownerDocument.addEventListener("pointerlockerror", F), this._domElement.ownerDocument.addEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.addEventListener("pointerup", E), T());
3582
+ }, this._activePointers.push(this._lockedPointer), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", E), this._domElement.requestPointerLock(), this._domElement.ownerDocument.addEventListener("pointerlockchange", T), this._domElement.ownerDocument.addEventListener("pointerlockerror", F), this._domElement.ownerDocument.addEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.addEventListener("pointerup", E), m());
3583
3583
  }, this.unlockPointer = () => {
3584
- this._lockedPointer !== null && (this._disposePointer(this._lockedPointer), this._lockedPointer = null), document.exitPointerLock(), this.cancel(), this._domElement && (this._domElement.ownerDocument.removeEventListener("pointerlockchange", m), this._domElement.ownerDocument.removeEventListener("pointerlockerror", F));
3584
+ this._lockedPointer !== null && (this._disposePointer(this._lockedPointer), this._lockedPointer = null), document.exitPointerLock(), this.cancel(), this._domElement && (this._domElement.ownerDocument.removeEventListener("pointerlockchange", T), this._domElement.ownerDocument.removeEventListener("pointerlockerror", F));
3585
3585
  };
3586
- const m = () => {
3586
+ const T = () => {
3587
3587
  this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement || this.unlockPointer();
3588
3588
  }, F = () => {
3589
3589
  this.unlockPointer();
@@ -3591,9 +3591,9 @@ class ot extends Rr {
3591
3591
  this._addAllEventListeners = (f) => {
3592
3592
  this._domElement = f, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", n), gr && this._domElement.addEventListener("mousedown", r), this._domElement.addEventListener("pointercancel", E), this._domElement.addEventListener("wheel", u, { passive: !1 }), this._domElement.addEventListener("contextmenu", p);
3593
3593
  }, this._removeAllEventListeners = () => {
3594
- 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", E), this._domElement.removeEventListener("wheel", u, { passive: !1 }), this._domElement.removeEventListener("contextmenu", p), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("pointerup", E), this._domElement.ownerDocument.removeEventListener("mouseup", d), this._domElement.ownerDocument.removeEventListener("pointerlockchange", m), this._domElement.ownerDocument.removeEventListener("pointerlockerror", F));
3594
+ 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", E), this._domElement.removeEventListener("wheel", u, { passive: !1 }), this._domElement.removeEventListener("contextmenu", p), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("pointerup", E), this._domElement.ownerDocument.removeEventListener("mouseup", d), this._domElement.ownerDocument.removeEventListener("pointerlockchange", T), this._domElement.ownerDocument.removeEventListener("pointerlockerror", F));
3595
3595
  }, this.cancel = () => {
3596
- this._state !== y.NONE && (this._state = y.NONE, this._activePointers.length = 0, C());
3596
+ this._state !== P.NONE && (this._state = P.NONE, this._activePointers.length = 0, C());
3597
3597
  }, t && this.connect(t), this.update(0);
3598
3598
  }
3599
3599
  /**
@@ -3849,7 +3849,7 @@ class ot extends Rr {
3849
3849
  * @category Methods
3850
3850
  */
3851
3851
  dollyInFixed(s, t = !1) {
3852
- this._targetEnd.add(this._getCameraDirection(Le).multiplyScalar(s)), t || this._target.copy(this._targetEnd);
3852
+ this._targetEnd.add(this._getCameraDirection(ye).multiplyScalar(s)), t || this._target.copy(this._targetEnd);
3853
3853
  const e = !t || k(this._target.x, this._targetEnd.x, this.restThreshold) && k(this._target.y, this._targetEnd.y, this.restThreshold) && k(this._target.z, this._targetEnd.z, this.restThreshold);
3854
3854
  return this._createOnRestPromise(e);
3855
3855
  }
@@ -3960,16 +3960,16 @@ class ot extends Rr {
3960
3960
  c.isEmpty() && (console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"), Promise.resolve());
3961
3961
  const E = sn(this._sphericalEnd.theta, en), d = sn(this._sphericalEnd.phi, en);
3962
3962
  a.push(this.rotateTo(E, d, t));
3963
- const h = G.setFromSpherical(this._sphericalEnd).normalize(), u = ln.setFromUnitVectors(h, $s), p = k(Math.abs(h.y), 1);
3964
- p && u.multiply(Js.setFromAxisAngle(Is, E)), u.multiply(this._yAxisUpSpaceInverse);
3965
- const T = cn.makeEmpty();
3966
- z.copy(c.min).applyQuaternion(u), T.expandByPoint(z), z.copy(c.min).setX(c.max.x).applyQuaternion(u), T.expandByPoint(z), z.copy(c.min).setY(c.max.y).applyQuaternion(u), T.expandByPoint(z), z.copy(c.max).setZ(c.min.z).applyQuaternion(u), T.expandByPoint(z), z.copy(c.min).setZ(c.max.z).applyQuaternion(u), T.expandByPoint(z), z.copy(c.max).setY(c.min.y).applyQuaternion(u), T.expandByPoint(z), z.copy(c.max).setX(c.min.x).applyQuaternion(u), T.expandByPoint(z), z.copy(c.max).applyQuaternion(u), T.expandByPoint(z), T.min.x -= i, T.min.y -= n, T.max.x += o, T.max.y += r, u.setFromUnitVectors($s, h), p && u.premultiply(Js.invert()), u.premultiply(this._yAxisUpSpace);
3967
- const A = T.getSize(G), C = T.getCenter(z).applyQuaternion(u);
3963
+ const h = G.setFromSpherical(this._sphericalEnd).normalize(), u = ln.setFromUnitVectors(h, Ks), p = k(Math.abs(h.y), 1);
3964
+ p && u.multiply(ti.setFromAxisAngle(Is, E)), u.multiply(this._yAxisUpSpaceInverse);
3965
+ const m = cn.makeEmpty();
3966
+ z.copy(c.min).applyQuaternion(u), m.expandByPoint(z), z.copy(c.min).setX(c.max.x).applyQuaternion(u), m.expandByPoint(z), z.copy(c.min).setY(c.max.y).applyQuaternion(u), m.expandByPoint(z), z.copy(c.max).setZ(c.min.z).applyQuaternion(u), m.expandByPoint(z), z.copy(c.min).setZ(c.max.z).applyQuaternion(u), m.expandByPoint(z), z.copy(c.max).setY(c.min.y).applyQuaternion(u), m.expandByPoint(z), z.copy(c.max).setX(c.min.x).applyQuaternion(u), m.expandByPoint(z), z.copy(c.max).applyQuaternion(u), m.expandByPoint(z), m.min.x -= i, m.min.y -= n, m.max.x += o, m.max.y += r, u.setFromUnitVectors(Ks, h), p && u.premultiply(ti.invert()), u.premultiply(this._yAxisUpSpace);
3967
+ const A = m.getSize(G), C = m.getCenter(z).applyQuaternion(u);
3968
3968
  if (Qt(this._camera)) {
3969
- const m = this.getDistanceToFitBox(A.x, A.y, A.z, e);
3970
- a.push(this.moveTo(C.x, C.y, C.z, t)), a.push(this.dollyTo(m, t)), a.push(this.setFocalOffset(0, 0, 0, t));
3969
+ const T = this.getDistanceToFitBox(A.x, A.y, A.z, e);
3970
+ a.push(this.moveTo(C.x, C.y, C.z, t)), a.push(this.dollyTo(T, t)), a.push(this.setFocalOffset(0, 0, 0, t));
3971
3971
  } else if (vt(this._camera)) {
3972
- const m = this._camera, F = m.right - m.left, f = m.top - m.bottom, R = e ? Math.max(F / A.x, f / A.y) : Math.min(F / A.x, f / A.y);
3972
+ const T = this._camera, F = T.right - T.left, f = T.top - T.bottom, R = e ? Math.max(F / A.x, f / A.y) : Math.min(F / A.x, f / A.y);
3973
3973
  a.push(this.moveTo(C.x, C.y, C.z, t)), a.push(this.zoomTo(R, t)), a.push(this.setFocalOffset(0, 0, 0, t));
3974
3974
  }
3975
3975
  return Promise.all(a);
@@ -3981,7 +3981,7 @@ class ot extends Rr {
3981
3981
  * @category Methods
3982
3982
  */
3983
3983
  fitToSphere(s, t) {
3984
- const e = [], o = s instanceof Y.Sphere ? Ks.copy(s) : ot.createBoundingSphere(s, Ks);
3984
+ const e = [], o = s instanceof Y.Sphere ? Js.copy(s) : ot.createBoundingSphere(s, Js);
3985
3985
  if (e.push(this.moveTo(o.center.x, o.center.y, o.center.z, t)), Qt(this._camera)) {
3986
3986
  const n = this.getDistanceToFitSphere(o.radius);
3987
3987
  e.push(this.dollyTo(n, t));
@@ -4029,10 +4029,10 @@ class ot extends Rr {
4029
4029
  */
4030
4030
  lerpLookAt(s, t, e, i, o, n, r, a, c, E, d, h, u, p = !1) {
4031
4031
  this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = he.NONE, this._changedDolly = 0;
4032
- const T = G.set(i, o, n), A = z.set(s, t, e);
4033
- ut.setFromVector3(A.sub(T).applyQuaternion(this._yAxisUpSpace));
4034
- const C = de.set(E, d, h), m = z.set(r, a, c);
4035
- we.setFromVector3(m.sub(C).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(T.lerp(C, u));
4032
+ const m = G.set(i, o, n), A = z.set(s, t, e);
4033
+ ut.setFromVector3(A.sub(m).applyQuaternion(this._yAxisUpSpace));
4034
+ const C = de.set(E, d, h), T = z.set(r, a, c);
4035
+ we.setFromVector3(T.sub(C).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(m.lerp(C, u));
4036
4036
  const F = we.theta - ut.theta, f = we.phi - ut.phi, R = we.radius - ut.radius;
4037
4037
  this._sphericalEnd.set(ut.radius + R * u, ut.phi + f * u, ut.theta + F * u), this.normalizeRotations(), this._needsUpdate = !0, p || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
4038
4038
  const g = !p || k(this._target.x, this._targetEnd.x, this.restThreshold) && k(this._target.y, this._targetEnd.y, this.restThreshold) && k(this._target.z, this._targetEnd.z, this.restThreshold) && k(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && k(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold) && k(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
@@ -4126,7 +4126,7 @@ class ot extends Rr {
4126
4126
  * @category Methods
4127
4127
  */
4128
4128
  getDistanceToFitBox(s, t, e, i = !1) {
4129
- if (qs(this._camera, "getDistanceToFitBox"))
4129
+ if ($s(this._camera, "getDistanceToFitBox"))
4130
4130
  return this._spherical.radius;
4131
4131
  const o = s / t, n = this._camera.getEffectiveFOV() * Ne, r = this._camera.aspect;
4132
4132
  return ((i ? o > r : o < r) ? t : s / r) * 0.5 / Math.tan(n * 0.5) + e * 0.5;
@@ -4138,7 +4138,7 @@ class ot extends Rr {
4138
4138
  * @category Methods
4139
4139
  */
4140
4140
  getDistanceToFitSphere(s) {
4141
- if (qs(this._camera, "getDistanceToFitSphere"))
4141
+ if ($s(this._camera, "getDistanceToFitSphere"))
4142
4142
  return this._spherical.radius;
4143
4143
  const t = this._camera.getEffectiveFOV() * Ne, e = Math.atan(Math.tan(t * 0.5) * this._camera.aspect) * 2, i = 1 < this._camera.aspect ? t : e;
4144
4144
  return s / Math.sin(i * 0.5);
@@ -4277,9 +4277,9 @@ class ot extends Rr {
4277
4277
  }
4278
4278
  if (this.dollyToCursor) {
4279
4279
  if (Qt(this._camera) && this._changedDolly !== 0) {
4280
- const d = this._spherical.radius - this._lastDistance, h = this._camera, u = this._getCameraDirection(Le), p = G.copy(u).cross(h.up).normalize();
4280
+ const d = this._spherical.radius - this._lastDistance, h = this._camera, u = this._getCameraDirection(ye), p = G.copy(u).cross(h.up).normalize();
4281
4281
  p.lengthSq() === 0 && (p.x = 1);
4282
- const T = z.crossVectors(p, u), A = this._sphericalEnd.radius * Math.tan(h.getEffectiveFOV() * Ne * 0.5), m = (this._sphericalEnd.radius - d - this._sphericalEnd.radius) / this._sphericalEnd.radius, F = de.copy(this._targetEnd).add(p.multiplyScalar(this._dollyControlCoord.x * A * h.aspect)).add(T.multiplyScalar(this._dollyControlCoord.y * A)), f = G.copy(this._targetEnd).lerp(F, m), R = this._lastDollyDirection === he.IN && this._spherical.radius <= this.minDistance, g = this._lastDollyDirection === he.OUT && this.maxDistance <= this._spherical.radius;
4282
+ const m = z.crossVectors(p, u), A = this._sphericalEnd.radius * Math.tan(h.getEffectiveFOV() * Ne * 0.5), T = (this._sphericalEnd.radius - d - this._sphericalEnd.radius) / this._sphericalEnd.radius, F = de.copy(this._targetEnd).add(p.multiplyScalar(this._dollyControlCoord.x * A * h.aspect)).add(m.multiplyScalar(this._dollyControlCoord.y * A)), f = G.copy(this._targetEnd).lerp(F, T), R = this._lastDollyDirection === he.IN && this._spherical.radius <= this.minDistance, g = this._lastDollyDirection === he.OUT && this.maxDistance <= this._spherical.radius;
4283
4283
  if (this.infinityDolly && (R || g)) {
4284
4284
  this._sphericalEnd.radius -= d, this._spherical.radius -= d;
4285
4285
  const _ = z.copy(u).multiplyScalar(-d);
@@ -4289,7 +4289,7 @@ class ot extends Rr {
4289
4289
  const S = z.subVectors(f, this._targetEnd);
4290
4290
  this._targetEnd.copy(f), this._target.add(S), this._changedDolly -= d, X(this._changedDolly) && (this._changedDolly = 0);
4291
4291
  } else if (vt(this._camera) && this._changedZoom !== 0) {
4292
- const d = this._zoom - this._lastZoom, h = this._camera, u = G.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (h.near + h.far) / (h.near - h.far)).unproject(h), p = z.set(0, 0, -1).applyQuaternion(h.quaternion), T = de.copy(u).add(p.multiplyScalar(-u.dot(h.up))), C = -(this._zoom - d - this._zoom) / this._zoom, m = this._getCameraDirection(Le), F = this._targetEnd.dot(m), f = G.copy(this._targetEnd).lerp(T, C), R = f.dot(m), g = m.multiplyScalar(R - F);
4292
+ const d = this._zoom - this._lastZoom, h = this._camera, u = G.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (h.near + h.far) / (h.near - h.far)).unproject(h), p = z.set(0, 0, -1).applyQuaternion(h.quaternion), m = de.copy(u).add(p.multiplyScalar(-u.dot(h.up))), C = -(this._zoom - d - this._zoom) / this._zoom, T = this._getCameraDirection(ye), F = this._targetEnd.dot(T), f = G.copy(this._targetEnd).lerp(m, C), R = f.dot(T), g = T.multiplyScalar(R - F);
4293
4293
  f.sub(g), this._boundary.clampPoint(f, f);
4294
4294
  const S = z.subVectors(f, this._targetEnd);
4295
4295
  this._targetEnd.copy(f), this._target.add(S), this._changedZoom -= d, X(this._changedZoom) && (this._changedZoom = 0);
@@ -4309,13 +4309,13 @@ class ot extends Rr {
4309
4309
  return JSON.stringify({
4310
4310
  enabled: this._enabled,
4311
4311
  minDistance: this.minDistance,
4312
- maxDistance: ye(this.maxDistance),
4312
+ maxDistance: Pe(this.maxDistance),
4313
4313
  minZoom: this.minZoom,
4314
- maxZoom: ye(this.maxZoom),
4314
+ maxZoom: Pe(this.maxZoom),
4315
4315
  minPolarAngle: this.minPolarAngle,
4316
- maxPolarAngle: ye(this.maxPolarAngle),
4317
- minAzimuthAngle: ye(this.minAzimuthAngle),
4318
- maxAzimuthAngle: ye(this.maxAzimuthAngle),
4316
+ maxPolarAngle: Pe(this.maxPolarAngle),
4317
+ minAzimuthAngle: Pe(this.minAzimuthAngle),
4318
+ maxAzimuthAngle: Pe(this.maxAzimuthAngle),
4319
4319
  smoothTime: this.smoothTime,
4320
4320
  draggingSmoothTime: this.draggingSmoothTime,
4321
4321
  dollySpeed: this.dollySpeed,
@@ -4340,7 +4340,7 @@ class ot extends Rr {
4340
4340
  */
4341
4341
  fromJSON(s, t = !1) {
4342
4342
  const e = JSON.parse(s);
4343
- this.enabled = e.enabled, this.minDistance = e.minDistance, this.maxDistance = Pe(e.maxDistance), this.minZoom = e.minZoom, this.maxZoom = Pe(e.maxZoom), this.minPolarAngle = e.minPolarAngle, this.maxPolarAngle = Pe(e.maxPolarAngle), this.minAzimuthAngle = Pe(e.minAzimuthAngle), this.maxAzimuthAngle = Pe(e.maxAzimuthAngle), this.smoothTime = e.smoothTime, this.draggingSmoothTime = e.draggingSmoothTime, this.dollySpeed = e.dollySpeed, this.truckSpeed = e.truckSpeed, this.dollyToCursor = e.dollyToCursor, this.verticalDragToForward = e.verticalDragToForward, this._target0.fromArray(e.target0), this._position0.fromArray(e.position0), this._zoom0 = e.zoom0, this._focalOffset0.fromArray(e.focalOffset0), this.moveTo(e.target[0], e.target[1], e.target[2], t), ut.setFromVector3(G.fromArray(e.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)), this.rotateTo(ut.theta, ut.phi, t), this.dollyTo(ut.radius, t), this.zoomTo(e.zoom, t), this.setFocalOffset(e.focalOffset[0], e.focalOffset[1], e.focalOffset[2], t), this._needsUpdate = !0;
4343
+ this.enabled = e.enabled, this.minDistance = e.minDistance, this.maxDistance = Le(e.maxDistance), this.minZoom = e.minZoom, this.maxZoom = Le(e.maxZoom), this.minPolarAngle = e.minPolarAngle, this.maxPolarAngle = Le(e.maxPolarAngle), this.minAzimuthAngle = Le(e.minAzimuthAngle), this.maxAzimuthAngle = Le(e.maxAzimuthAngle), this.smoothTime = e.smoothTime, this.draggingSmoothTime = e.draggingSmoothTime, this.dollySpeed = e.dollySpeed, this.truckSpeed = e.truckSpeed, this.dollyToCursor = e.dollyToCursor, this.verticalDragToForward = e.verticalDragToForward, this._target0.fromArray(e.target0), this._position0.fromArray(e.position0), this._zoom0 = e.zoom0, this._focalOffset0.fromArray(e.focalOffset0), this.moveTo(e.target[0], e.target[1], e.target[2], t), ut.setFromVector3(G.fromArray(e.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)), this.rotateTo(ut.theta, ut.phi, t), this.dollyTo(ut.radius, t), this.zoomTo(e.zoom, t), this.setFocalOffset(e.focalOffset[0], e.focalOffset[1], e.focalOffset[2], t), this._needsUpdate = !0;
4344
4344
  }
4345
4345
  /**
4346
4346
  * Attach all internal event handlers to enable drag control.
@@ -4411,13 +4411,13 @@ class ot extends Rr {
4411
4411
  // lateUpdate
4412
4412
  _collisionTest() {
4413
4413
  let s = 1 / 0;
4414
- if (!(this.colliderMeshes.length >= 1) || qs(this._camera, "_collisionTest"))
4414
+ if (!(this.colliderMeshes.length >= 1) || $s(this._camera, "_collisionTest"))
4415
4415
  return s;
4416
- const e = this._getTargetDirection(Le);
4417
- ti.lookAt(on, e, this._camera.up);
4416
+ const e = this._getTargetDirection(ye);
4417
+ ei.lookAt(on, e, this._camera.up);
4418
4418
  for (let i = 0; i < 4; i++) {
4419
4419
  const o = z.copy(this._nearPlaneCorners[i]);
4420
- o.applyMatrix4(ti);
4420
+ o.applyMatrix4(ei);
4421
4421
  const n = de.addVectors(this._target, o);
4422
4422
  fs.set(n, e), fs.far = this._spherical.radius + 1;
4423
4423
  const r = fs.intersectObjects(this.colliderMeshes);
@@ -4500,12 +4500,12 @@ class Xe extends nr {
4500
4500
  constructor(t) {
4501
4501
  super(t);
4502
4502
  /** {@link Updateable.onBeforeUpdate} */
4503
- I(this, "onBeforeUpdate", new D());
4503
+ I(this, "onBeforeUpdate", new U());
4504
4504
  /** {@link Updateable.onAfterUpdate} */
4505
- I(this, "onAfterUpdate", new D());
4506
- I(this, "onAspectUpdated", new D());
4505
+ I(this, "onAfterUpdate", new U());
4506
+ I(this, "onAspectUpdated", new U());
4507
4507
  /** {@link Disposable.onDisposed} */
4508
- I(this, "onDisposed", new D());
4508
+ I(this, "onDisposed", new U());
4509
4509
  I(this, "three");
4510
4510
  I(this, "_allControls", /* @__PURE__ */ new Map());
4511
4511
  /**
@@ -4594,15 +4594,15 @@ class Xe extends nr {
4594
4594
  };
4595
4595
  }
4596
4596
  }
4597
- const Ss = class Ss extends J {
4597
+ const _s = class _s extends J {
4598
4598
  constructor(t) {
4599
4599
  super(t);
4600
- I(this, "onAfterUpdate", new D());
4601
- I(this, "onBeforeUpdate", new D());
4602
- I(this, "onDisposed", new D());
4600
+ I(this, "onAfterUpdate", new U());
4601
+ I(this, "onBeforeUpdate", new U());
4602
+ I(this, "onDisposed", new U());
4603
4603
  I(this, "list", /* @__PURE__ */ new Map());
4604
4604
  I(this, "enabled", !0);
4605
- t.add(Ss.uuid, this);
4605
+ t.add(_s.uuid, this);
4606
4606
  }
4607
4607
  create() {
4608
4608
  const t = new mr(this.components), e = t.uuid;
@@ -4625,12 +4625,12 @@ const Ss = class Ss extends J {
4625
4625
  i.update(t);
4626
4626
  }
4627
4627
  };
4628
- I(Ss, "uuid", "fdb61dc4-2ec1-4966-b83d-54ea795fad4a");
4629
- let Ii = Ss;
4628
+ I(_s, "uuid", "fdb61dc4-2ec1-4966-b83d-54ea795fad4a");
4629
+ let fi = _s;
4630
4630
  class Or {
4631
4631
  constructor(s, t, e) {
4632
4632
  /** {@link Disposable.onDisposed} */
4633
- I(this, "onDisposed", new D());
4633
+ I(this, "onDisposed", new U());
4634
4634
  I(this, "world");
4635
4635
  I(this, "components");
4636
4636
  I(this, "_grid");
@@ -4781,7 +4781,7 @@ class Sr extends J {
4781
4781
  constructor() {
4782
4782
  super(...arguments);
4783
4783
  I(this, "list", /* @__PURE__ */ new Map());
4784
- I(this, "onDisposed", new D());
4784
+ I(this, "onDisposed", new U());
4785
4785
  I(this, "config", {
4786
4786
  color: new O.Color(12303291),
4787
4787
  size1: 1,
@@ -4810,12 +4810,12 @@ class Sr extends J {
4810
4810
  }
4811
4811
  }
4812
4812
  I(Sr, "uuid", "d1e814d5-b81c-4452-87a2-f039375e0489");
4813
- const qt = new Xn(), nt = new w(), bt = new w(), j = new Pt(), hn = {
4813
+ const qt = new Xn(), nt = new w(), bt = new w(), j = new Lt(), hn = {
4814
4814
  X: new w(1, 0, 0),
4815
4815
  Y: new w(0, 1, 0),
4816
4816
  Z: new w(0, 0, 1)
4817
- }, ei = { type: "change" }, En = { type: "mouseDown" }, dn = { type: "mouseUp", mode: null }, un = { type: "objectChange" };
4818
- class _r extends ii {
4817
+ }, si = { type: "change" }, En = { type: "mouseDown" }, dn = { type: "mouseUp", mode: null }, un = { type: "objectChange" };
4818
+ class _r extends ni {
4819
4819
  constructor(s, t) {
4820
4820
  super(), t === void 0 && (console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'), t = document), this.isTransformControls = !0, this.visible = !1, this.domElement = t, this.domElement.style.touchAction = "none";
4821
4821
  const e = new Mr();
@@ -4823,20 +4823,20 @@ class _r extends ii {
4823
4823
  const i = new Dr();
4824
4824
  this._plane = i, this.add(i);
4825
4825
  const o = this;
4826
- function n(m, F) {
4826
+ function n(T, F) {
4827
4827
  let f = F;
4828
- Object.defineProperty(o, m, {
4828
+ Object.defineProperty(o, T, {
4829
4829
  get: function() {
4830
4830
  return f !== void 0 ? f : F;
4831
4831
  },
4832
4832
  set: function(R) {
4833
- f !== R && (f = R, i[m] = R, e[m] = R, o.dispatchEvent({ type: m + "-changed", value: R }), o.dispatchEvent(ei));
4833
+ f !== R && (f = R, i[T] = R, e[T] = R, o.dispatchEvent({ type: T + "-changed", value: R }), o.dispatchEvent(si));
4834
4834
  }
4835
- }), o[m] = F, i[m] = F, e[m] = F;
4835
+ }), o[T] = F, i[T] = F, e[T] = F;
4836
4836
  }
4837
4837
  n("camera", s), n("object", void 0), n("enabled", !0), n("axis", null), n("mode", "translate"), n("translationSnap", null), n("rotationSnap", null), n("scaleSnap", null), n("space", "world"), n("size", 1), n("dragging", !1), n("showX", !0), n("showY", !0), n("showZ", !0);
4838
- const r = new w(), a = new w(), c = new Pt(), E = new Pt(), d = new w(), h = new Pt(), u = new w(), p = new w(), T = new w(), A = 0, C = new w();
4839
- n("worldPosition", r), n("worldPositionStart", a), n("worldQuaternion", c), n("worldQuaternionStart", E), n("cameraPosition", d), n("cameraQuaternion", h), n("pointStart", u), n("pointEnd", p), n("rotationAxis", T), n("rotationAngle", A), n("eye", C), this._offset = new w(), this._startNorm = new w(), this._endNorm = new w(), this._cameraScale = new w(), this._parentPosition = new w(), this._parentQuaternion = new Pt(), this._parentQuaternionInv = new Pt(), this._parentScale = new w(), this._worldScaleStart = new w(), this._worldQuaternionInv = new Pt(), this._worldScale = new w(), this._positionStart = new w(), this._quaternionStart = new Pt(), this._scaleStart = new w(), this._getPointer = Nr.bind(this), this._onPointerDown = Pr.bind(this), this._onPointerHover = yr.bind(this), this._onPointerMove = Lr.bind(this), this._onPointerUp = wr.bind(this), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp);
4838
+ const r = new w(), a = new w(), c = new Lt(), E = new Lt(), d = new w(), h = new Lt(), u = new w(), p = new w(), m = new w(), A = 0, C = new w();
4839
+ n("worldPosition", r), n("worldPositionStart", a), n("worldQuaternion", c), n("worldQuaternionStart", E), n("cameraPosition", d), n("cameraQuaternion", h), n("pointStart", u), n("pointEnd", p), n("rotationAxis", m), n("rotationAngle", A), n("eye", C), this._offset = new w(), this._startNorm = new w(), this._endNorm = new w(), this._cameraScale = new w(), this._parentPosition = new w(), this._parentQuaternion = new Lt(), this._parentQuaternionInv = new Lt(), this._parentScale = new w(), this._worldScaleStart = new w(), this._worldQuaternionInv = new Lt(), this._worldScale = new w(), this._positionStart = new w(), this._quaternionStart = new Lt(), this._scaleStart = new w(), this._getPointer = Nr.bind(this), this._onPointerDown = Lr.bind(this), this._onPointerHover = Pr.bind(this), this._onPointerMove = yr.bind(this), this._onPointerUp = wr.bind(this), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp);
4840
4840
  }
4841
4841
  // updateMatrixWorld updates key transformation variables
4842
4842
  updateMatrixWorld() {
@@ -4846,13 +4846,13 @@ class _r extends ii {
4846
4846
  if (this.object === void 0 || this.dragging === !0)
4847
4847
  return;
4848
4848
  qt.setFromCamera(s, this.camera);
4849
- const t = si(this._gizmo.picker[this.mode], qt);
4849
+ const t = ii(this._gizmo.picker[this.mode], qt);
4850
4850
  t ? this.axis = t.object.name : this.axis = null;
4851
4851
  }
4852
4852
  pointerDown(s) {
4853
4853
  if (!(this.object === void 0 || this.dragging === !0 || s.button !== 0) && this.axis !== null) {
4854
4854
  qt.setFromCamera(s, this.camera);
4855
- const t = si(this._plane, qt, !0);
4855
+ const t = ii(this._plane, qt, !0);
4856
4856
  t && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(t.point).sub(this.worldPositionStart)), this.dragging = !0, En.mode = this.mode, this.dispatchEvent(En);
4857
4857
  }
4858
4858
  }
@@ -4862,7 +4862,7 @@ class _r extends ii {
4862
4862
  if (e === "scale" ? o = "local" : (t === "E" || t === "XYZE" || t === "XYZ") && (o = "world"), i === void 0 || t === null || this.dragging === !1 || s.button !== -1)
4863
4863
  return;
4864
4864
  qt.setFromCamera(s, this.camera);
4865
- const n = si(this._plane, qt, !0);
4865
+ const n = ii(this._plane, qt, !0);
4866
4866
  if (n) {
4867
4867
  if (this.pointEnd.copy(n.point).sub(this.worldPositionStart), e === "translate")
4868
4868
  this._offset.copy(this.pointEnd).sub(this.pointStart), o === "local" && t !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), t.indexOf("X") === -1 && (this._offset.x = 0), t.indexOf("Y") === -1 && (this._offset.y = 0), t.indexOf("Z") === -1 && (this._offset.z = 0), o === "local" && t !== "XYZ" ? this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale) : this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), i.position.copy(this._offset).add(this._positionStart), this.translationSnap && (o === "local" && (i.position.applyQuaternion(j.copy(this._quaternionStart).invert()), t.search("X") !== -1 && (i.position.x = Math.round(i.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (i.position.y = Math.round(i.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (i.position.z = Math.round(i.position.z / this.translationSnap) * this.translationSnap), i.position.applyQuaternion(this._quaternionStart)), o === "world" && (i.parent && i.position.add(nt.setFromMatrixPosition(i.parent.matrixWorld)), t.search("X") !== -1 && (i.position.x = Math.round(i.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (i.position.y = Math.round(i.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (i.position.z = Math.round(i.position.z / this.translationSnap) * this.translationSnap), i.parent && i.position.sub(nt.setFromMatrixPosition(i.parent.matrixWorld))));
@@ -4879,7 +4879,7 @@ class _r extends ii {
4879
4879
  let a = !1;
4880
4880
  t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(nt.copy(this.rotationAxis).cross(this.eye)) * r) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(hn[t]), nt.copy(hn[t]), o === "local" && nt.applyQuaternion(this.worldQuaternion), nt.cross(this.eye), nt.length() === 0 ? a = !0 : this.rotationAngle = this._offset.dot(nt.normalize()) * r), (t === "E" || a) && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1), this.rotationSnap && (this.rotationAngle = Math.round(this.rotationAngle / this.rotationSnap) * this.rotationSnap), o === "local" && t !== "E" && t !== "XYZE" ? (i.quaternion.copy(this._quaternionStart), i.quaternion.multiply(j.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), i.quaternion.copy(j.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), i.quaternion.multiply(this._quaternionStart).normalize());
4881
4881
  }
4882
- this.dispatchEvent(ei), this.dispatchEvent(un);
4882
+ this.dispatchEvent(si), this.dispatchEvent(un);
4883
4883
  }
4884
4884
  }
4885
4885
  pointerUp(s) {
@@ -4899,7 +4899,7 @@ class _r extends ii {
4899
4899
  return this.object = void 0, this.visible = !1, this.axis = null, this;
4900
4900
  }
4901
4901
  reset() {
4902
- this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(ei), this.dispatchEvent(un), this.pointStart.copy(this.pointEnd));
4902
+ this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(si), this.dispatchEvent(un), this.pointStart.copy(this.pointEnd));
4903
4903
  }
4904
4904
  getRaycaster() {
4905
4905
  return qt;
@@ -4943,7 +4943,7 @@ function Nr(l) {
4943
4943
  };
4944
4944
  }
4945
4945
  }
4946
- function yr(l) {
4946
+ function Pr(l) {
4947
4947
  if (this.enabled)
4948
4948
  switch (l.pointerType) {
4949
4949
  case "mouse":
@@ -4952,24 +4952,24 @@ function yr(l) {
4952
4952
  break;
4953
4953
  }
4954
4954
  }
4955
- function Pr(l) {
4955
+ function Lr(l) {
4956
4956
  this.enabled && (document.pointerLockElement || this.domElement.setPointerCapture(l.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.pointerHover(this._getPointer(l)), this.pointerDown(this._getPointer(l)));
4957
4957
  }
4958
- function Lr(l) {
4958
+ function yr(l) {
4959
4959
  this.enabled && this.pointerMove(this._getPointer(l));
4960
4960
  }
4961
4961
  function wr(l) {
4962
4962
  this.enabled && (this.domElement.releasePointerCapture(l.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(l)));
4963
4963
  }
4964
- function si(l, s, t) {
4964
+ function ii(l, s, t) {
4965
4965
  const e = s.intersectObject(l, !0);
4966
4966
  for (let i = 0; i < e.length; i++)
4967
4967
  if (e[i].object.visible || t)
4968
4968
  return e[i];
4969
4969
  return !1;
4970
4970
  }
4971
- const ps = new Zn(), W = new w(0, 1, 0), In = new w(0, 0, 0), fn = new wt(), Cs = new Pt(), As = new Pt(), Nt = new w(), pn = new wt(), Ue = new w(1, 0, 0), $t = new w(0, 1, 0), xe = new w(0, 0, 1), Ts = new w(), Me = new w(), De = new w();
4972
- class Mr extends ii {
4971
+ const ps = new Zn(), W = new w(0, 1, 0), In = new w(0, 0, 0), fn = new wt(), Cs = new Lt(), As = new Lt(), Nt = new w(), pn = new wt(), Ue = new w(1, 0, 0), $t = new w(0, 1, 0), xe = new w(0, 0, 1), Ts = new w(), Me = new w(), De = new w();
4972
+ class Mr extends ni {
4973
4973
  constructor() {
4974
4974
  super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
4975
4975
  const s = new Nn({
@@ -5006,14 +5006,14 @@ class Mr extends ii {
5006
5006
  h.color.setHex(16776960), h.opacity = 0.25, s.clone().color.setHex(16776960);
5007
5007
  const p = s.clone();
5008
5008
  p.color.setHex(7895160);
5009
- const T = new lt(0, 0.04, 0.1, 12);
5010
- T.translate(0, 0.05, 0);
5009
+ const m = new lt(0, 0.04, 0.1, 12);
5010
+ m.translate(0, 0.05, 0);
5011
5011
  const A = new rt(0.08, 0.08, 0.08);
5012
5012
  A.translate(0, 0.04, 0);
5013
5013
  const C = new wi();
5014
5014
  C.setAttribute("position", new Mi([0, 0, 0, 1, 0, 0], 3));
5015
- const m = new lt(75e-4, 75e-4, 0.5, 3);
5016
- m.translate(0, 0.25, 0);
5015
+ const T = new lt(75e-4, 75e-4, 0.5, 3);
5016
+ T.translate(0, 0.25, 0);
5017
5017
  function F(B, H) {
5018
5018
  const q = new Re(B, 75e-4, 3, 64, H * Math.PI * 2);
5019
5019
  return q.rotateY(Math.PI / 2), q.rotateX(Math.PI / 2), q;
@@ -5024,19 +5024,19 @@ class Mr extends ii {
5024
5024
  }
5025
5025
  const R = {
5026
5026
  X: [
5027
- [new v(T, o), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
5028
- [new v(T, o), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
5029
- [new v(m, o), [0, 0, 0], [0, 0, -Math.PI / 2]]
5027
+ [new v(m, o), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
5028
+ [new v(m, o), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
5029
+ [new v(T, o), [0, 0, 0], [0, 0, -Math.PI / 2]]
5030
5030
  ],
5031
5031
  Y: [
5032
- [new v(T, n), [0, 0.5, 0]],
5033
- [new v(T, n), [0, -0.5, 0], [Math.PI, 0, 0]],
5034
- [new v(m, n)]
5032
+ [new v(m, n), [0, 0.5, 0]],
5033
+ [new v(m, n), [0, -0.5, 0], [Math.PI, 0, 0]],
5034
+ [new v(T, n)]
5035
5035
  ],
5036
5036
  Z: [
5037
- [new v(T, r), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
5038
- [new v(T, r), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
5039
- [new v(m, r), null, [Math.PI / 2, 0, 0]]
5037
+ [new v(m, r), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
5038
+ [new v(m, r), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
5039
+ [new v(T, r), null, [Math.PI / 2, 0, 0]]
5040
5040
  ],
5041
5041
  XYZ: [
5042
5042
  [new v(new je(0.1, 0), d.clone()), [0, 0, 0]]
@@ -5114,7 +5114,7 @@ class Mr extends ii {
5114
5114
  AXIS: [
5115
5115
  [new Ut(C, i.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
5116
5116
  ]
5117
- }, P = {
5117
+ }, L = {
5118
5118
  XYZE: [
5119
5119
  [new v(new jn(0.25, 10, 8), e)]
5120
5120
  ],
@@ -5133,17 +5133,17 @@ class Mr extends ii {
5133
5133
  }, M = {
5134
5134
  X: [
5135
5135
  [new v(A, o), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
5136
- [new v(m, o), [0, 0, 0], [0, 0, -Math.PI / 2]],
5136
+ [new v(T, o), [0, 0, 0], [0, 0, -Math.PI / 2]],
5137
5137
  [new v(A, o), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
5138
5138
  ],
5139
5139
  Y: [
5140
5140
  [new v(A, n), [0, 0.5, 0]],
5141
- [new v(m, n)],
5141
+ [new v(T, n)],
5142
5142
  [new v(A, n), [0, -0.5, 0], [0, 0, Math.PI]]
5143
5143
  ],
5144
5144
  Z: [
5145
5145
  [new v(A, r), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
5146
- [new v(m, r), [0, 0, 0], [Math.PI / 2, 0, 0]],
5146
+ [new v(T, r), [0, 0, 0], [Math.PI / 2, 0, 0]],
5147
5147
  [new v(A, r), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
5148
5148
  ],
5149
5149
  XY: [
@@ -5158,7 +5158,7 @@ class Mr extends ii {
5158
5158
  XYZ: [
5159
5159
  [new v(new rt(0.1, 0.1, 0.1), d.clone())]
5160
5160
  ]
5161
- }, L = {
5161
+ }, y = {
5162
5162
  X: [
5163
5163
  [new v(new lt(0.2, 0, 0.6, 4), e), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
5164
5164
  [new v(new lt(0.2, 0, 0.6, 4), e), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
@@ -5183,7 +5183,7 @@ class Mr extends ii {
5183
5183
  XYZ: [
5184
5184
  [new v(new rt(0.2, 0.2, 0.2), e), [0, 0, 0]]
5185
5185
  ]
5186
- }, U = {
5186
+ }, x = {
5187
5187
  X: [
5188
5188
  [new Ut(C, i.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
5189
5189
  ],
@@ -5195,7 +5195,7 @@ class Mr extends ii {
5195
5195
  ]
5196
5196
  };
5197
5197
  function b(B) {
5198
- const H = new ii();
5198
+ const H = new ni();
5199
5199
  for (const q in B)
5200
5200
  for (let st = B[q].length; st--; ) {
5201
5201
  const Q = B[q][st][0].clone(), kt = B[q][st][1], Wt = B[q][st][2], Xt = B[q][st][3], Ze = B[q][st][4];
@@ -5205,7 +5205,7 @@ class Mr extends ii {
5205
5205
  }
5206
5206
  return H;
5207
5207
  }
5208
- this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = b(R)), this.add(this.gizmo.rotate = b(_)), this.add(this.gizmo.scale = b(M)), this.add(this.picker.translate = b(g)), this.add(this.picker.rotate = b(P)), this.add(this.picker.scale = b(L)), this.add(this.helper.translate = b(S)), this.add(this.helper.rotate = b(N)), this.add(this.helper.scale = b(U)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
5208
+ this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = b(R)), this.add(this.gizmo.rotate = b(_)), this.add(this.gizmo.scale = b(M)), this.add(this.picker.translate = b(g)), this.add(this.picker.rotate = b(L)), this.add(this.picker.scale = b(y)), this.add(this.helper.translate = b(S)), this.add(this.helper.rotate = b(N)), this.add(this.helper.scale = b(x)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
5209
5209
  }
5210
5210
  // updateMatrixWorld will update transformations and appearance of individual handles
5211
5211
  updateMatrixWorld(s) {
@@ -5275,11 +5275,11 @@ class Dr extends v {
5275
5275
  class Si {
5276
5276
  constructor(s, t, e, i, o, n = 5, r = !0) {
5277
5277
  /** Event that fires when the user starts dragging a clipping plane. */
5278
- I(this, "onDraggingStarted", new D());
5278
+ I(this, "onDraggingStarted", new U());
5279
5279
  /** Event that fires when the user stops dragging a clipping plane. */
5280
- I(this, "onDraggingEnded", new D());
5280
+ I(this, "onDraggingEnded", new U());
5281
5281
  /** {@link Disposable.onDisposed} */
5282
- I(this, "onDisposed", new D());
5282
+ I(this, "onDisposed", new U());
5283
5283
  I(this, "normal");
5284
5284
  I(this, "origin");
5285
5285
  I(this, "three", new O.Plane());
@@ -5400,19 +5400,19 @@ const Be = class Be extends J {
5400
5400
  constructor(t) {
5401
5401
  super(t);
5402
5402
  /** {@link Createable.onAfterCreate} */
5403
- I(this, "onAfterCreate", new D());
5403
+ I(this, "onAfterCreate", new U());
5404
5404
  /** {@link Createable.onAfterDelete} */
5405
- I(this, "onAfterDelete", new D());
5405
+ I(this, "onAfterDelete", new U());
5406
5406
  /** Event that fires when the user starts dragging a clipping plane. */
5407
- I(this, "onBeforeDrag", new D());
5407
+ I(this, "onBeforeDrag", new U());
5408
5408
  /** Event that fires when the user stops dragging a clipping plane. */
5409
- I(this, "onAfterDrag", new D());
5410
- I(this, "onBeforeCreate", new D());
5411
- I(this, "onBeforeCancel", new D());
5412
- I(this, "onAfterCancel", new D());
5413
- I(this, "onBeforeDelete", new D());
5409
+ I(this, "onAfterDrag", new U());
5410
+ I(this, "onBeforeCreate", new U());
5411
+ I(this, "onBeforeCancel", new U());
5412
+ I(this, "onAfterCancel", new U());
5413
+ I(this, "onBeforeDelete", new U());
5414
5414
  /** {@link Disposable.onDisposed} */
5415
- I(this, "onDisposed", new D());
5415
+ I(this, "onDisposed", new U());
5416
5416
  /**
5417
5417
  * Whether to force the clipping plane to be orthogonal in the Y direction
5418
5418
  * (up). This is desirable when clipping a building horizontally and a
@@ -5593,7 +5593,7 @@ const Be = class Be extends J {
5593
5593
  );
5594
5594
  }
5595
5595
  updateMaterialsAndPlanes() {
5596
- const t = this.components.get(Ii);
5596
+ const t = this.components.get(fi);
5597
5597
  for (const [e, i] of t.list) {
5598
5598
  if (!i.renderer)
5599
5599
  continue;
@@ -5616,7 +5616,7 @@ const Ye = class Ye extends J {
5616
5616
  /** {@link Component.enabled} */
5617
5617
  I(this, "enabled", !0);
5618
5618
  /** {@link Disposable.onDisposed} */
5619
- I(this, "onDisposed", new D());
5619
+ I(this, "onDisposed", new U());
5620
5620
  I(this, "list", {});
5621
5621
  I(this, "_originals", {});
5622
5622
  this.components.add(Ye.uuid, this);
@@ -5713,7 +5713,7 @@ async function br(l, s, t, e, i, o, n, r) {
5713
5713
  class vr {
5714
5714
  constructor(s, t, e) {
5715
5715
  /** {@link Disposable.onDisposed} */
5716
- I(this, "onDisposed", new D());
5716
+ I(this, "onDisposed", new U());
5717
5717
  /**
5718
5718
  * Fires after making the visibility check to the meshes. It lists the
5719
5719
  * meshes that are currently visible, and the ones that were visible
@@ -5837,7 +5837,7 @@ class Br extends vr {
5837
5837
  super(t, e, i);
5838
5838
  /* Pixels in screen a geometry must occupy to be considered "seen". */
5839
5839
  I(this, "threshold", 100);
5840
- I(this, "onViewUpdated", new D());
5840
+ I(this, "onViewUpdated", new U());
5841
5841
  I(this, "colorMeshes", /* @__PURE__ */ new Map());
5842
5842
  I(this, "isProcessing", !1);
5843
5843
  I(this, "_colorCodeMeshMap", /* @__PURE__ */ new Map());
@@ -5947,7 +5947,7 @@ const Ve = class Ve extends J {
5947
5947
  I(this, "_enabled", !0);
5948
5948
  I(this, "list", /* @__PURE__ */ new Map());
5949
5949
  /** {@link Disposable.onDisposed} */
5950
- I(this, "onDisposed", new D());
5950
+ I(this, "onDisposed", new U());
5951
5951
  t.add(Ve.uuid, this);
5952
5952
  }
5953
5953
  /** {@link Component.enabled} */
@@ -5978,14 +5978,14 @@ const Ve = class Ve extends J {
5978
5978
  }
5979
5979
  };
5980
5980
  I(Ve, "uuid", "69f2a50d-c266-44fc-b1bd-fa4d34be89e6");
5981
- let fi = Ve;
5981
+ let pi = Ve;
5982
5982
  class Yr {
5983
5983
  constructor(s) {
5984
5984
  /** {@link Disposable.onDisposed} */
5985
- I(this, "onDisposed", new D());
5986
- I(this, "onAfterUpdate", new D());
5987
- I(this, "onBeforeUpdate", new D());
5988
- I(this, "onResize", new D());
5985
+ I(this, "onDisposed", new U());
5986
+ I(this, "onAfterUpdate", new U());
5987
+ I(this, "onBeforeUpdate", new U());
5988
+ I(this, "onResize", new U());
5989
5989
  // By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
5990
5990
  I(this, "frontOffset", 0);
5991
5991
  I(this, "overrideMaterial", new O.MeshDepthMaterial());
@@ -6071,15 +6071,15 @@ class Yr {
6071
6071
  }
6072
6072
  }
6073
6073
  }
6074
- const _s = class _s extends J {
6074
+ const Ns = class Ns extends J {
6075
6075
  constructor(t) {
6076
6076
  super(t);
6077
- I(this, "onAfterUpdate", new D());
6078
- I(this, "onBeforeUpdate", new D());
6079
- I(this, "onDisposed", new D());
6077
+ I(this, "onAfterUpdate", new U());
6078
+ I(this, "onBeforeUpdate", new U());
6079
+ I(this, "onDisposed", new U());
6080
6080
  I(this, "enabled", !0);
6081
6081
  I(this, "list", /* @__PURE__ */ new Map());
6082
- this.components.add(_s.uuid, this);
6082
+ this.components.add(Ns.uuid, this);
6083
6083
  }
6084
6084
  create(t) {
6085
6085
  if (this.list.has(t.uuid))
@@ -6098,8 +6098,8 @@ const _s = class _s extends J {
6098
6098
  e.update();
6099
6099
  }
6100
6100
  };
6101
- I(_s, "uuid", "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f");
6102
- let mn = _s;
6101
+ I(Ns, "uuid", "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f");
6102
+ let mn = Ns;
6103
6103
  class Vr {
6104
6104
  constructor(s) {
6105
6105
  /** {@link NavigationMode.enabled} */
@@ -6175,7 +6175,7 @@ class Hr {
6175
6175
  /**
6176
6176
  * Event that fires when the {@link CameraProjection} changes.
6177
6177
  */
6178
- I(this, "onChanged", new D());
6178
+ I(this, "onChanged", new U());
6179
6179
  I(this, "current", "Perspective");
6180
6180
  I(this, "camera");
6181
6181
  I(this, "_component");
@@ -6237,7 +6237,7 @@ class Hr {
6237
6237
  s.position.copy(t.position), s.quaternion.copy(t.quaternion), this._component.controls.mouseButtons.wheel = ot.ACTION.DOLLY, this.matchOrthoDistanceEnabled ? this._component.controls.distance = this.getDistance() : this._component.controls.distance = this._previousDistance, await this._component.controls.zoomTo(1), s.updateProjectionMatrix(), this._component.controls.camera = s, this.camera = s, this.current = "Perspective";
6238
6238
  }
6239
6239
  }
6240
- class na extends Xe {
6240
+ class ia extends Xe {
6241
6241
  constructor(t) {
6242
6242
  super(t);
6243
6243
  /**
@@ -6330,7 +6330,7 @@ const At = class At extends J {
6330
6330
  /** {@link Component.enabled} */
6331
6331
  I(this, "enabled", !0);
6332
6332
  /** {@link Disposable.onDisposed} */
6333
- I(this, "onDisposed", new D());
6333
+ I(this, "onDisposed", new U());
6334
6334
  I(this, "_absoluteMin");
6335
6335
  I(this, "_absoluteMax");
6336
6336
  I(this, "_meshes", []);
@@ -6564,11 +6564,11 @@ class kr {
6564
6564
  */
6565
6565
  async export(s, t, e = !1, i = !0) {
6566
6566
  const o = {}, n = new Set(s.GetIfcEntityList(t)), r = /* @__PURE__ */ new Set([
6567
- x.IFCPROJECT,
6568
- x.IFCSITE,
6569
- x.IFCBUILDING,
6570
- x.IFCBUILDINGSTOREY,
6571
- x.IFCSPACE
6567
+ D.IFCPROJECT,
6568
+ D.IFCSITE,
6569
+ D.IFCBUILDING,
6570
+ D.IFCBUILDINGSTOREY,
6571
+ D.IFCSPACE
6572
6572
  ]);
6573
6573
  for (const a of r)
6574
6574
  n.add(a);
@@ -6723,7 +6723,7 @@ const Wr = {
6723
6723
  4292641817: "IFCUNITARYEQUIPMENT",
6724
6724
  3009204131: "IFCGRID"
6725
6725
  };
6726
- class oa {
6726
+ class na {
6727
6727
  getAll(s, t) {
6728
6728
  const e = {}, i = Object.keys(Wr).map((o) => parseInt(o, 10));
6729
6729
  for (let o = 0; o < i.length; o++) {
@@ -7879,7 +7879,7 @@ const Un = {
7879
7879
  class Ft {
7880
7880
  static async getUnits(s) {
7881
7881
  var n;
7882
- const { IFCUNITASSIGNMENT: t } = x, e = await s.getAllPropertiesOfType(t);
7882
+ const { IFCUNITASSIGNMENT: t } = D, e = await s.getAllPropertiesOfType(t);
7883
7883
  if (!e)
7884
7884
  return 1;
7885
7885
  const i = Object.keys(e), o = e[parseInt(i[0], 10)];
@@ -7919,10 +7919,10 @@ class Ft {
7919
7919
  );
7920
7920
  if (!(d && h && u))
7921
7921
  continue;
7922
- const p = await s.getProperties((a = E[h]) == null ? void 0 : a.value), T = E[u];
7923
- if (!p || !T || !(T && Array.isArray(T)))
7922
+ const p = await s.getProperties((a = E[h]) == null ? void 0 : a.value), m = E[u];
7923
+ if (!p || !m || !(m && Array.isArray(m)))
7924
7924
  continue;
7925
- const A = T.map((C) => C.value);
7925
+ const A = m.map((C) => C.value);
7926
7926
  o(p.expressID, A), n[p.expressID] = A;
7927
7927
  }
7928
7928
  return n;
@@ -7930,19 +7930,19 @@ class Ft {
7930
7930
  static async getQsetQuantities(s, t, e) {
7931
7931
  const o = e ?? (() => {
7932
7932
  }), n = await s.getProperties(t);
7933
- return !n || n.type !== x.IFCELEMENTQUANTITY ? null : (n.Quantities ?? [{}]).map((c) => (c.value && o(c.value), c.value)).filter((c) => c !== null);
7933
+ return !n || n.type !== D.IFCELEMENTQUANTITY ? null : (n.Quantities ?? [{}]).map((c) => (c.value && o(c.value), c.value)).filter((c) => c !== null);
7934
7934
  }
7935
7935
  static async getPsetProps(s, t, e) {
7936
7936
  const o = e ?? (() => {
7937
7937
  }), n = await s.getProperties(t);
7938
- return !n || n.type !== x.IFCPROPERTYSET ? null : (n.HasProperties ?? [{}]).map((c) => (c.value && o(c.value), c.value)).filter((c) => c !== null);
7938
+ return !n || n.type !== D.IFCPROPERTYSET ? null : (n.HasProperties ?? [{}]).map((c) => (c.value && o(c.value), c.value)).filter((c) => c !== null);
7939
7939
  }
7940
7940
  static async getPsetRel(s, t) {
7941
7941
  var r;
7942
7942
  if (!await s.getProperties(t))
7943
7943
  return null;
7944
7944
  const i = await s.getAllPropertiesOfType(
7945
- x.IFCRELDEFINESBYPROPERTIES
7945
+ D.IFCRELDEFINESBYPROPERTIES
7946
7946
  );
7947
7947
  if (!i)
7948
7948
  return null;
@@ -8011,461 +8011,168 @@ class Ft {
8011
8011
  // return propertyInstance;
8012
8012
  // }
8013
8013
  }
8014
- const Ns = class Ns extends J {
8014
+ const Xr = /* @__PURE__ */ new Map([
8015
+ [
8016
+ D.IFCRELAGGREGATES,
8017
+ {
8018
+ forRelating: "IsDecomposedBy",
8019
+ forRelated: "Decomposes"
8020
+ }
8021
+ ],
8022
+ [
8023
+ D.IFCRELASSOCIATESMATERIAL,
8024
+ {
8025
+ forRelating: "AssociatedTo",
8026
+ forRelated: "HasAssociations"
8027
+ }
8028
+ ],
8029
+ [
8030
+ D.IFCRELASSOCIATESCLASSIFICATION,
8031
+ {
8032
+ forRelating: "ClassificationForObjects",
8033
+ forRelated: "HasAssociations"
8034
+ }
8035
+ ],
8036
+ [
8037
+ D.IFCRELASSIGNSTOGROUP,
8038
+ {
8039
+ forRelating: "IsGroupedBy",
8040
+ forRelated: "HasAssignments"
8041
+ }
8042
+ ],
8043
+ [
8044
+ D.IFCRELDEFINESBYPROPERTIES,
8045
+ {
8046
+ forRelated: "IsDefinedBy",
8047
+ forRelating: "DefinesOcurrence"
8048
+ }
8049
+ ],
8050
+ [
8051
+ D.IFCRELDEFINESBYTYPE,
8052
+ {
8053
+ forRelated: "IsTypedBy",
8054
+ forRelating: "Types"
8055
+ }
8056
+ ],
8057
+ [
8058
+ D.IFCRELDEFINESBYTEMPLATE,
8059
+ {
8060
+ forRelated: "IsDefinedBy",
8061
+ forRelating: "Defines"
8062
+ }
8063
+ ],
8064
+ [
8065
+ D.IFCRELCONTAINEDINSPATIALSTRUCTURE,
8066
+ {
8067
+ forRelated: "ContainedInStructure",
8068
+ forRelating: "ContainsElements"
8069
+ }
8070
+ ]
8071
+ ]), Ge = class Ge extends J {
8015
8072
  constructor(t) {
8016
8073
  super(t);
8017
8074
  /** {@link Disposable.onDisposed} */
8018
- I(this, "onDisposed", new D());
8019
- I(this, "onFragmentsLoaded", new D());
8020
- I(this, "onFragmentsDisposed", new D());
8021
- /** All the created [fragments](https://github.com/ThatOpen/engine_fragment). */
8022
- I(this, "list", /* @__PURE__ */ new Map());
8023
- I(this, "groups", /* @__PURE__ */ new Map());
8024
- /** {@link Component.enabled} */
8075
+ I(this, "onDisposed", new U());
8025
8076
  I(this, "enabled", !0);
8026
- I(this, "baseCoordinationModel", "");
8027
- I(this, "_loader", new $n());
8028
- this.components.add(Ns.uuid, this);
8029
- }
8030
- /** The list of meshes of the created fragments. */
8031
- get meshes() {
8032
- const t = [];
8033
- for (const [e, i] of this.list)
8034
- t.push(i.mesh);
8035
- return t;
8036
- }
8037
- /** {@link Disposable.dispose} */
8038
- dispose() {
8039
- for (const [t, e] of this.groups)
8040
- e.dispose(!0);
8041
- this.baseCoordinationModel = "", this.groups.clear(), this.list.clear(), this.onFragmentsLoaded.reset(), this.onFragmentsDisposed.reset(), this.onDisposed.trigger(), this.onDisposed.reset();
8042
- }
8043
- disposeGroup(t) {
8044
- const { uuid: e } = t, i = [];
8045
- for (const o of t.items)
8046
- i.push(o.id), this.list.delete(o.id);
8047
- t.dispose(!0), this.groups.delete(t.uuid), this.onFragmentsDisposed.trigger({
8048
- groupID: e,
8049
- fragmentIDs: i
8077
+ I(this, "onRelationsIndexed", new U());
8078
+ I(this, "_relToAttributesMap", Xr);
8079
+ I(this, "_inverseAttributes", [
8080
+ "IsDecomposedBy",
8081
+ "Decomposes",
8082
+ "AssociatedTo",
8083
+ "HasAssociations",
8084
+ "ClassificationForObjects",
8085
+ "IsGroupedBy",
8086
+ "HasAssignments",
8087
+ "IsDefinedBy",
8088
+ "DefinesOcurrence",
8089
+ "IsTypedBy",
8090
+ "Types",
8091
+ "Defines",
8092
+ "ContainedInStructure",
8093
+ "ContainsElements"
8094
+ ]);
8095
+ I(this, "_ifcRels", [
8096
+ D.IFCRELAGGREGATES,
8097
+ D.IFCRELASSOCIATESMATERIAL,
8098
+ D.IFCRELASSOCIATESCLASSIFICATION,
8099
+ D.IFCRELASSIGNSTOGROUP,
8100
+ D.IFCRELDEFINESBYPROPERTIES,
8101
+ D.IFCRELDEFINESBYTYPE,
8102
+ D.IFCRELDEFINESBYTEMPLATE,
8103
+ D.IFCRELCONTAINEDINSPATIALSTRUCTURE
8104
+ ]);
8105
+ /**
8106
+ * Holds the relationship mappings for each model processed by the indexer.
8107
+ * The structure is a map where each key is a model's UUID, and the value is another map.
8108
+ * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
8109
+ * representing a specific relation type, and the value is an array of expressIDs of entities
8110
+ * that are related through that relation type. This structure allows for efficient querying
8111
+ * of entity relationships within a model.
8112
+ */
8113
+ I(this, "relationMaps", {});
8114
+ I(this, "onFragmentsDisposed", (t) => {
8115
+ delete this.relationMaps[t.groupID];
8050
8116
  });
8117
+ this.components.add(Ge.uuid, this), t.get(at).onFragmentsDisposed.add(this.onFragmentsDisposed);
8051
8118
  }
8052
8119
  /**
8053
- * Loads one or many fragments into the scene.
8054
- * @param data - the bytes containing the data for the fragments to load.
8055
- * @param coordinate - whether this fragmentsgroup should be federated with the others.
8056
- * @returns the list of IDs of the loaded fragments.
8120
+ * Adds a relation map to the model's relations map.
8121
+ *
8122
+ * @param model - The `FragmentsGroup` model to which the relation map will be added.
8123
+ * @param relationMap - The `RelationsMap` to be added to the model's relations map.
8124
+ *
8125
+ * @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
8057
8126
  */
8058
- load(t, e = !0) {
8059
- const i = this._loader.import(t);
8060
- for (const o of i.items)
8061
- o.group = i, this.list.set(o.id, o);
8062
- return e && this.coordinate([i]), this.groups.set(i.uuid, i), this.onFragmentsLoaded.trigger(i), i;
8127
+ setRelationMap(t, e) {
8128
+ this.relationMaps[t.uuid] = e, this.onRelationsIndexed.trigger({
8129
+ modelID: t.uuid,
8130
+ relationsMap: e
8131
+ });
8063
8132
  }
8064
8133
  /**
8065
- * Export the specified fragments.
8066
- * @param group - the fragments group to be exported.
8067
- * @returns the exported data as binary buffer.
8134
+ * Processes a given model to index its IFC entities relations based on predefined inverse attributes.
8135
+ * This method iterates through each specified inverse attribute, retrieves the corresponding relations,
8136
+ * and maps them in a structured way to facilitate quick access to related entities.
8137
+ *
8138
+ * The process involves querying the model for each relation type associated with the inverse attributes
8139
+ * and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
8140
+ * and contains a nested map where each key is an entity's expressID and its value is another map.
8141
+ * This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
8142
+ * of entities that are related through that attribute.
8143
+ *
8144
+ * @param model The `FragmentsGroup` model to be processed. It must have properties loaded.
8145
+ * @returns A promise that resolves to the relations map for the processed model. This map is a detailed
8146
+ * representation of the relations indexed by entity expressIDs and relation types.
8147
+ * @throws An error if the model does not have properties loaded.
8068
8148
  */
8069
- export(t) {
8070
- return this._loader.export(t);
8071
- }
8072
- coordinate(t = Array.from(this.groups.values())) {
8073
- if (this.baseCoordinationModel.length === 0) {
8074
- const o = t.pop();
8075
- if (!o)
8076
- return;
8077
- this.baseCoordinationModel = o.uuid;
8078
- }
8079
- if (!t.length)
8080
- return;
8081
- const i = this.groups.get(this.baseCoordinationModel);
8082
- if (!i) {
8083
- console.log("No base model found for coordination!");
8084
- return;
8085
- }
8086
- for (const o of t)
8087
- o !== i && (o.position.set(0, 0, 0), o.rotation.set(0, 0, 0), o.scale.set(1, 1, 1), o.updateMatrix(), o.applyMatrix4(o.coordinationMatrix.clone().invert()), o.applyMatrix4(i.coordinationMatrix));
8088
- }
8089
- };
8090
- I(Ns, "uuid", "fef46874-46a3-461b-8c44-2922ab77c806");
8091
- let at = Ns;
8092
- class ra extends J {
8093
- constructor(t) {
8094
- super(t);
8095
- I(this, "onFound", new D());
8096
- /** {@link Disposable.onDisposed} */
8097
- I(this, "onDisposed", new D());
8098
- I(this, "enabled", !0);
8099
- I(this, "indexedModels", {});
8100
- I(this, "_conditionFunctions");
8101
- I(this, "_noHandleAttributes", ["type"]);
8102
- I(this, "onFragmentsDisposed", (t) => {
8103
- delete this.indexedModels[t.groupID];
8104
- });
8105
- this._conditionFunctions = this.getConditionFunctions(), t.get(at).onFragmentsDisposed.add(this.onFragmentsDisposed);
8106
- }
8107
- dispose() {
8108
- this.indexedModels = {}, this.onFound.reset(), this.onDisposed.trigger(), this.onDisposed.reset();
8109
- }
8110
- async indexEntityRelations(t) {
8111
- const e = {};
8112
- await Ft.getRelationMap(
8113
- t,
8114
- x.IFCRELDEFINESBYPROPERTIES,
8115
- async (o, n) => {
8116
- e[o] || (e[o] = /* @__PURE__ */ new Set());
8117
- const r = [];
8118
- await Ft.getPsetProps(t, o, (a) => {
8119
- r.push(a), e[o].add(a), e[a] || (e[a] = /* @__PURE__ */ new Set()), e[a].add(o);
8120
- });
8121
- for (const a of n) {
8122
- e[o].add(a);
8123
- for (const c of r)
8124
- e[c].add(a);
8125
- e[a] || (e[a] = /* @__PURE__ */ new Set()), e[a].add(a);
8126
- }
8127
- }
8128
- );
8129
- const i = [
8130
- x.IFCRELCONTAINEDINSPATIALSTRUCTURE,
8131
- x.IFCRELDEFINESBYTYPE,
8132
- x.IFCRELASSIGNSTOGROUP
8133
- ];
8134
- for (const o of i)
8149
+ async process(t) {
8150
+ if (!t.hasProperties)
8151
+ throw new Error("FragmentsGroup properties not found");
8152
+ let e = this.relationMaps[t.uuid];
8153
+ if (e)
8154
+ return e;
8155
+ e = /* @__PURE__ */ new Map();
8156
+ for (const i of this._ifcRels)
8135
8157
  await Ft.getRelationMap(
8136
8158
  t,
8137
- o,
8138
- async (n, r) => {
8139
- e[n] || (e[n] = /* @__PURE__ */ new Set());
8140
- for (const a of r)
8141
- e[n].add(a), e[a] || (e[a] = /* @__PURE__ */ new Set()), e[a].add(a);
8159
+ i,
8160
+ async (o, n) => {
8161
+ const r = this._relToAttributesMap.get(i);
8162
+ if (!r)
8163
+ return;
8164
+ const { forRelated: a, forRelating: c } = r, E = e.get(o) ?? /* @__PURE__ */ new Map(), d = this._inverseAttributes.indexOf(c);
8165
+ E.set(d, n), e.set(o, E);
8166
+ for (const h of n) {
8167
+ const u = e.get(h) ?? /* @__PURE__ */ new Map(), p = this._inverseAttributes.indexOf(a), m = u.get(p) ?? [];
8168
+ m.push(o), u.set(p, m), e.set(h, u);
8169
+ }
8142
8170
  }
8143
8171
  );
8144
- return this.indexedModels[t.uuid] = e, e;
8145
- }
8146
- async find(t, e) {
8147
- const i = this.components.get(at), o = e || i.groups.values(), n = {};
8148
- for (const a of o) {
8149
- let c = this.indexedModels[a.uuid];
8150
- c || (c = await this.indexEntityRelations(a));
8151
- let E = [];
8152
- for (const [u, p] of t.entries()) {
8153
- const T = /* @__PURE__ */ new Set(), A = this.simpleQuery(a, p, T), C = [];
8154
- for (const m of A) {
8155
- const F = c[m];
8156
- if (F) {
8157
- C.push(m);
8158
- for (const f of F)
8159
- T.has(f) || C.push(f);
8160
- }
8161
- }
8162
- E = p.operator === "AND" && u > 0 ? this.getCommonElements(E, C) : [...E, ...C];
8163
- }
8164
- const d = /* @__PURE__ */ new Set();
8165
- for (const [u] of a.data)
8166
- E.includes(u) && d.add(u);
8167
- const h = /* @__PURE__ */ new Set();
8168
- for (const u of E)
8169
- d.has(u) || h.add(u);
8170
- n[a.uuid] = { modelEntities: d, otherEntities: h };
8171
- }
8172
- const r = this.toFragmentMap(n);
8173
- return this.onFound.trigger(r), r;
8174
- }
8175
- toFragmentMap(t) {
8176
- const e = this.components.get(at), i = {};
8177
- for (const o in t) {
8178
- const n = e.groups.get(o);
8179
- if (!n)
8180
- continue;
8181
- const r = t[o].modelEntities;
8182
- for (const a of r) {
8183
- const c = n.data.get(a);
8184
- if (c)
8185
- for (const E of c[0]) {
8186
- const d = n.keyFragments.get(E);
8187
- if (!d)
8188
- throw new Error("Fragment ID not found!");
8189
- i[d] || (i[d] = /* @__PURE__ */ new Set()), i[d].add(a);
8190
- }
8191
- }
8192
- }
8193
- return i;
8194
- }
8195
- simpleQuery(t, e, i) {
8196
- const o = t.getLocalProperties();
8197
- if (!o)
8198
- throw new Error("Model has no properties");
8199
- let n = {}, r = 0, a = [];
8200
- for (const c of e.queries) {
8201
- let E = [];
8202
- const d = c.operator === "AND" ? n : o;
8203
- if (c.condition) {
8204
- const u = this.getMatchingEntities(
8205
- d,
8206
- c,
8207
- i
8208
- );
8209
- E = u.expressIDs, n = { ...n, ...u.entities };
8210
- } else
8211
- E = [
8212
- ...this.simpleQuery(t, c, i)
8213
- ];
8214
- a = r === 0 ? E : this.combineArrays(
8215
- a,
8216
- E,
8217
- c.operator ?? "AND"
8218
- // Defaults to AND if iterations > 0 and query.operator is not defined
8219
- ), r++;
8220
- }
8221
- return new Set(a);
8222
- }
8223
- getMatchingEntities(t, e, i) {
8224
- const { attribute: o, condition: n } = e;
8225
- let { value: r } = e;
8226
- const a = !this._noHandleAttributes.includes(o), c = [], E = [];
8227
- for (const d in t) {
8228
- const h = t[d];
8229
- if (h === void 0)
8230
- continue;
8231
- const u = h[o];
8232
- let p = a ? u == null ? void 0 : u.value : u;
8233
- if (p == null)
8234
- continue;
8235
- const T = typeof r, A = typeof p;
8236
- T === "number" && A === "string" ? r = r.toString() : T === "string" && A === "number" && (p = p.toString());
8237
- let C = this._conditionFunctions[n](
8238
- p,
8239
- r
8240
- );
8241
- if (e.negateResult && (C = !C), !C) {
8242
- e.negateResult && i.add(h.expressID);
8243
- continue;
8244
- }
8245
- c.push(h.expressID), E.push(h);
8246
- }
8247
- return { expressIDs: c, entities: E, excludedItems: i };
8248
- }
8249
- combineArrays(t, e, i) {
8250
- return i ? i === "AND" ? this.arrayIntersection(t, e) : this.arrayUnion(t, e) : e;
8251
- }
8252
- getCommonElements(...t) {
8253
- const e = [], i = /* @__PURE__ */ new Map();
8254
- for (const o of t) {
8255
- const n = new Set(o);
8256
- for (const r of n)
8257
- i.has(r) ? i.set(r, i.get(r) + 1) : i.set(r, 1);
8258
- }
8259
- for (const [o, n] of i)
8260
- n === t.length && e.push(o);
8261
- return e;
8262
- }
8263
- arrayIntersection(t, e) {
8264
- return t.filter((i) => e.includes(i));
8265
- }
8266
- arrayUnion(t, e) {
8267
- return [...t, ...e];
8268
- }
8269
- getConditionFunctions() {
8270
- return {
8271
- is: (t, e) => t === e,
8272
- includes: (t, e) => t.toString().includes(e.toString()),
8273
- startsWith: (t, e) => t.toString().startsWith(e.toString()),
8274
- endsWith: (t, e) => t.toString().endsWith(e.toString()),
8275
- matches: (t, e) => new RegExp(e.toString()).test(t.toString())
8276
- };
8277
- }
8278
- }
8279
- const Xr = (l, s, t) => {
8280
- var r;
8281
- const i = t ?? (() => {
8282
- }), o = {}, n = Object.keys(l);
8283
- for (const a of n) {
8284
- const c = l[a];
8285
- if (!c)
8286
- continue;
8287
- const E = c.type === s, d = Object.keys(c).find(
8288
- (A) => A.startsWith("Relating")
8289
- ), h = Object.keys(c).find(
8290
- (A) => A.startsWith("Related")
8291
- );
8292
- if (!(E && d && h))
8293
- continue;
8294
- const u = l[(r = c[d]) == null ? void 0 : r.value], p = c[h];
8295
- if (!u || !p || !(p && Array.isArray(p)))
8296
- continue;
8297
- const T = p.map((A) => A.value);
8298
- i(u.expressID, T), o[u.expressID] = T;
8299
- }
8300
- return o;
8301
- }, Zr = /* @__PURE__ */ new Map([
8302
- [
8303
- x.IFCRELAGGREGATES,
8304
- {
8305
- forRelating: "IsDecomposedBy",
8306
- forRelated: "Decomposes"
8307
- }
8308
- ],
8309
- [
8310
- x.IFCRELASSOCIATESMATERIAL,
8311
- {
8312
- forRelating: "AssociatedTo",
8313
- forRelated: "HasAssociations"
8314
- }
8315
- ],
8316
- [
8317
- x.IFCRELASSOCIATESCLASSIFICATION,
8318
- {
8319
- forRelating: "ClassificationForObjects",
8320
- forRelated: "HasAssociations"
8321
- }
8322
- ],
8323
- [
8324
- x.IFCRELASSIGNSTOGROUP,
8325
- {
8326
- forRelating: "IsGroupedBy",
8327
- forRelated: "HasAssignments"
8328
- }
8329
- ],
8330
- [
8331
- x.IFCRELDEFINESBYPROPERTIES,
8332
- {
8333
- forRelated: "IsDefinedBy",
8334
- forRelating: "DefinesOcurrence"
8335
- }
8336
- ],
8337
- [
8338
- x.IFCRELDEFINESBYTYPE,
8339
- {
8340
- forRelated: "IsTypedBy",
8341
- forRelating: "Types"
8342
- }
8343
- ],
8344
- [
8345
- x.IFCRELDEFINESBYTEMPLATE,
8346
- {
8347
- forRelated: "IsDefinedBy",
8348
- forRelating: "Defines"
8349
- }
8350
- ],
8351
- [
8352
- x.IFCRELCONTAINEDINSPATIALSTRUCTURE,
8353
- {
8354
- forRelated: "ContainedInStructure",
8355
- forRelating: "ContainsElements"
8356
- }
8357
- ]
8358
- ]), Ge = class Ge extends J {
8359
- constructor(t) {
8360
- super(t);
8361
- /** {@link Disposable.onDisposed} */
8362
- I(this, "onDisposed", new D());
8363
- I(this, "enabled", !0);
8364
- I(this, "onRelationsIndexed", new D());
8365
- I(this, "_relToAttributesMap", Zr);
8366
- /**
8367
- * Array of inverse attribute names.
8368
- * This array is used to define the inverse attributes that the indexer will process and index.
8369
- */
8370
- I(this, "inverseAttributes", [
8371
- "IsDecomposedBy",
8372
- "Decomposes",
8373
- "AssociatedTo",
8374
- "HasAssociations",
8375
- "ClassificationForObjects",
8376
- "IsGroupedBy",
8377
- "HasAssignments",
8378
- "IsDefinedBy",
8379
- "DefinesOcurrence",
8380
- "IsTypedBy",
8381
- "Types",
8382
- "Defines",
8383
- "ContainedInStructure",
8384
- "ContainsElements"
8385
- ]);
8386
- /**
8387
- * Holds the relationship mappings for each model processed by the indexer.
8388
- * The structure is a map where each key is a model's UUID, and the value is another map.
8389
- * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
8390
- * representing a specific relation type, and the value is an array of expressIDs of entities
8391
- * that are related through that relation type. This structure allows for efficient querying
8392
- * of entity relationships within a model.
8393
- */
8394
- I(this, "relationMaps", {});
8395
- I(this, "onFragmentsDisposed", (t) => {
8396
- delete this.relationMaps[t.groupID];
8397
- });
8398
- this.components.add(Ge.uuid, this), t.get(at).onFragmentsDisposed.add(this.onFragmentsDisposed);
8399
- }
8400
- getAttributeRels(t) {
8401
- const e = [];
8402
- for (const [i, o] of this._relToAttributesMap.entries()) {
8403
- const { forRelating: n, forRelated: r } = o;
8404
- (n === t || r === t) && e.push(i);
8405
- }
8406
- return e;
8407
- }
8408
- /**
8409
- * Adds a relation map to the model's relations map.
8410
- *
8411
- * @param model - The `FragmentsGroup` model to which the relation map will be added.
8412
- * @param relationMap - The `RelationsMap` to be added to the model's relations map.
8413
- *
8414
- * @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
8415
- */
8416
- setRelationMap(t, e) {
8417
- this.relationMaps[t.uuid] = e, this.onRelationsIndexed.trigger({
8418
- modelID: t.uuid,
8419
- relationsMap: e
8420
- });
8421
- }
8422
- /**
8423
- * Processes a given model to index its IFC entities relations based on predefined inverse attributes.
8424
- * This method iterates through each specified inverse attribute, retrieves the corresponding relations,
8425
- * and maps them in a structured way to facilitate quick access to related entities.
8426
- *
8427
- * The process involves querying the model for each relation type associated with the inverse attributes
8428
- * and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
8429
- * and contains a nested map where each key is an entity's expressID and its value is another map.
8430
- * This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
8431
- * of entities that are related through that attribute.
8432
- *
8433
- * @param model The `FragmentsGroup` model to be processed. It must have properties loaded.
8434
- * @returns A promise that resolves to the relations map for the processed model. This map is a detailed
8435
- * representation of the relations indexed by entity expressIDs and relation types.
8436
- * @throws An error if the model does not have properties loaded.
8437
- */
8438
- async process(t) {
8439
- if (!t.hasProperties)
8440
- throw new Error("FragmentsGroup properties not found");
8441
- const e = /* @__PURE__ */ new Map();
8442
- for (const i of this.inverseAttributes) {
8443
- const o = this.getAttributeRels(i);
8444
- for (const n of o)
8445
- await Ft.getRelationMap(
8446
- t,
8447
- n,
8448
- async (r, a) => {
8449
- const c = this._relToAttributesMap.get(n);
8450
- if (!c)
8451
- return;
8452
- const { forRelated: E, forRelating: d } = c;
8453
- if (d) {
8454
- const h = e.get(r) ?? /* @__PURE__ */ new Map(), u = this.inverseAttributes.indexOf(d);
8455
- h.set(u, a), e.set(r, h);
8456
- }
8457
- if (E)
8458
- for (const h of a) {
8459
- const u = e.get(h) ?? /* @__PURE__ */ new Map(), p = this.inverseAttributes.indexOf(E), T = u.get(p) ?? [];
8460
- T.push(r), u.set(p, T), e.set(h, u);
8461
- }
8462
- }
8463
- );
8464
- }
8465
- return this.setRelationMap(t, e), e;
8172
+ return this.setRelationMap(t, e), e;
8466
8173
  }
8467
8174
  /**
8468
- * Processes a given model from a WebIfc API to index its IFC entities relations based on predefined inverse attributes.
8175
+ * Processes a given model from a WebIfc API to index its IFC entities relations.
8469
8176
  *
8470
8177
  * @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
8471
8178
  * @param modelID - The unique identifier of the model within the WebIfc API.
@@ -8473,29 +8180,30 @@ const Xr = (l, s, t) => {
8473
8180
  * This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
8474
8181
  */
8475
8182
  async processFromWebIfc(t, e) {
8476
- const i = /* @__PURE__ */ new Map(), o = {}, n = t.GetAllLines(e);
8477
- for (let r = 0; r < n.size(); r++) {
8478
- const a = n.get(r), c = await t.properties.getItemProperties(e, a);
8479
- o[a] = c;
8480
- }
8481
- for (const r of this.inverseAttributes) {
8482
- const a = this.getAttributeRels(r);
8483
- for (const c of a)
8484
- Xr(o, c, (E, d) => {
8485
- const h = this._relToAttributesMap.get(c);
8486
- if (!h)
8487
- return;
8488
- const { forRelated: u, forRelating: p } = h;
8489
- if (p) {
8490
- const T = i.get(E) ?? /* @__PURE__ */ new Map(), A = this.inverseAttributes.indexOf(p);
8491
- T.set(A, d), i.set(E, T);
8492
- }
8493
- if (u)
8494
- for (const T of d) {
8495
- const A = i.get(T) ?? /* @__PURE__ */ new Map(), C = this.inverseAttributes.indexOf(u), m = A.get(C) ?? [];
8496
- m.push(E), A.set(C, m), i.set(T, A);
8497
- }
8498
- });
8183
+ const i = /* @__PURE__ */ new Map();
8184
+ for (const o of this._ifcRels) {
8185
+ const n = this._relToAttributesMap.get(o);
8186
+ if (!n)
8187
+ continue;
8188
+ const { forRelated: r, forRelating: a } = n, c = t.GetLineIDsWithType(e, o);
8189
+ for (let E = 0; E < c.size(); E++) {
8190
+ const d = await t.properties.getItemProperties(
8191
+ e,
8192
+ c.get(E)
8193
+ ), h = Object.keys(d).find(
8194
+ (T) => T.startsWith("Relating")
8195
+ ), u = Object.keys(d).find(
8196
+ (T) => T.startsWith("Related")
8197
+ );
8198
+ if (!(h && u))
8199
+ continue;
8200
+ const p = d[h].value, m = d[u].map((T) => T.value), A = i.get(p) ?? /* @__PURE__ */ new Map(), C = this._inverseAttributes.indexOf(a);
8201
+ A.set(C, m), i.set(p, A);
8202
+ for (const T of m) {
8203
+ const F = i.get(T) ?? /* @__PURE__ */ new Map(), f = this._inverseAttributes.indexOf(r), R = F.get(f) ?? [];
8204
+ R.push(p), F.set(f, R), i.set(T, F);
8205
+ }
8206
+ }
8499
8207
  }
8500
8208
  return this.onRelationsIndexed.trigger({
8501
8209
  modelID: e.toString(),
@@ -8517,7 +8225,7 @@ const Xr = (l, s, t) => {
8517
8225
  const o = this.relationMaps[t.uuid];
8518
8226
  if (!o)
8519
8227
  return null;
8520
- const n = o.get(e), r = this.inverseAttributes.indexOf(i);
8228
+ const n = o.get(e), r = this._inverseAttributes.indexOf(i);
8521
8229
  if (!n || r === -1)
8522
8230
  return null;
8523
8231
  const a = n.get(r);
@@ -8611,8 +8319,275 @@ const Xr = (l, s, t) => {
8611
8319
  }
8612
8320
  };
8613
8321
  I(Ge, "uuid", "23a889ab-83b3-44a4-8bee-ead83438370b");
8614
- let pi = Ge;
8615
- class Qr {
8322
+ let gs = Ge;
8323
+ const Ps = class Ps extends J {
8324
+ constructor(t) {
8325
+ super(t);
8326
+ /** {@link Disposable.onDisposed} */
8327
+ I(this, "onDisposed", new U());
8328
+ I(this, "onFragmentsLoaded", new U());
8329
+ I(this, "onFragmentsDisposed", new U());
8330
+ /** All the created [fragments](https://github.com/ThatOpen/engine_fragment). */
8331
+ I(this, "list", /* @__PURE__ */ new Map());
8332
+ I(this, "groups", /* @__PURE__ */ new Map());
8333
+ /** {@link Component.enabled} */
8334
+ I(this, "enabled", !0);
8335
+ I(this, "baseCoordinationModel", "");
8336
+ I(this, "_loader", new $n());
8337
+ this.components.add(Ps.uuid, this);
8338
+ }
8339
+ /** The list of meshes of the created fragments. */
8340
+ get meshes() {
8341
+ const t = [];
8342
+ for (const [e, i] of this.list)
8343
+ t.push(i.mesh);
8344
+ return t;
8345
+ }
8346
+ /** {@link Disposable.dispose} */
8347
+ dispose() {
8348
+ for (const [t, e] of this.groups)
8349
+ e.dispose(!0);
8350
+ this.baseCoordinationModel = "", this.groups.clear(), this.list.clear(), this.onFragmentsLoaded.reset(), this.onFragmentsDisposed.reset(), this.onDisposed.trigger(), this.onDisposed.reset();
8351
+ }
8352
+ disposeGroup(t) {
8353
+ const { uuid: e } = t, i = [];
8354
+ for (const o of t.items)
8355
+ i.push(o.id), this.list.delete(o.id);
8356
+ t.dispose(!0), this.groups.delete(t.uuid), this.onFragmentsDisposed.trigger({
8357
+ groupID: e,
8358
+ fragmentIDs: i
8359
+ });
8360
+ }
8361
+ /**
8362
+ * Loads a binar file that contain fragment geometry.
8363
+ * @param data - The binary data to load.
8364
+ * @param config - Optional configuration for loading.
8365
+ * @param config.coordinate - Whether to apply coordinate transformation. Default is true.
8366
+ * @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
8367
+ * @returns The loaded FragmentsGroup.
8368
+ */
8369
+ load(t, e) {
8370
+ const o = { ...{ coordinate: !0 }, config: e }, { coordinate: n, properties: r, relationsMap: a } = o, c = this._loader.import(t);
8371
+ for (const E of c.items)
8372
+ E.group = c, this.list.set(E.id, E);
8373
+ return n && this.coordinate([c]), this.groups.set(c.uuid, c), r && c.setLocalProperties(r), a && this.components.get(gs).setRelationMap(c, a), this.onFragmentsLoaded.trigger(c), c;
8374
+ }
8375
+ /**
8376
+ * Export the specified fragments.
8377
+ * @param group - the fragments group to be exported.
8378
+ * @returns the exported data as binary buffer.
8379
+ */
8380
+ export(t) {
8381
+ return this._loader.export(t);
8382
+ }
8383
+ coordinate(t = Array.from(this.groups.values())) {
8384
+ if (this.baseCoordinationModel.length === 0) {
8385
+ const o = t.pop();
8386
+ if (!o)
8387
+ return;
8388
+ this.baseCoordinationModel = o.uuid;
8389
+ }
8390
+ if (!t.length)
8391
+ return;
8392
+ const i = this.groups.get(this.baseCoordinationModel);
8393
+ if (!i) {
8394
+ console.log("No base model found for coordination!");
8395
+ return;
8396
+ }
8397
+ for (const o of t)
8398
+ o !== i && (o.position.set(0, 0, 0), o.rotation.set(0, 0, 0), o.scale.set(1, 1, 1), o.updateMatrix(), o.applyMatrix4(o.coordinationMatrix.clone().invert()), o.applyMatrix4(i.coordinationMatrix));
8399
+ }
8400
+ };
8401
+ I(Ps, "uuid", "fef46874-46a3-461b-8c44-2922ab77c806");
8402
+ let at = Ps;
8403
+ class oa extends J {
8404
+ constructor(t) {
8405
+ super(t);
8406
+ I(this, "onFound", new U());
8407
+ /** {@link Disposable.onDisposed} */
8408
+ I(this, "onDisposed", new U());
8409
+ I(this, "enabled", !0);
8410
+ I(this, "indexedModels", {});
8411
+ I(this, "_conditionFunctions");
8412
+ I(this, "_noHandleAttributes", ["type"]);
8413
+ I(this, "onFragmentsDisposed", (t) => {
8414
+ delete this.indexedModels[t.groupID];
8415
+ });
8416
+ this._conditionFunctions = this.getConditionFunctions(), t.get(at).onFragmentsDisposed.add(this.onFragmentsDisposed);
8417
+ }
8418
+ dispose() {
8419
+ this.indexedModels = {}, this.onFound.reset(), this.onDisposed.trigger(), this.onDisposed.reset();
8420
+ }
8421
+ async indexEntityRelations(t) {
8422
+ const e = {};
8423
+ await Ft.getRelationMap(
8424
+ t,
8425
+ D.IFCRELDEFINESBYPROPERTIES,
8426
+ async (o, n) => {
8427
+ e[o] || (e[o] = /* @__PURE__ */ new Set());
8428
+ const r = [];
8429
+ await Ft.getPsetProps(t, o, (a) => {
8430
+ r.push(a), e[o].add(a), e[a] || (e[a] = /* @__PURE__ */ new Set()), e[a].add(o);
8431
+ });
8432
+ for (const a of n) {
8433
+ e[o].add(a);
8434
+ for (const c of r)
8435
+ e[c].add(a);
8436
+ e[a] || (e[a] = /* @__PURE__ */ new Set()), e[a].add(a);
8437
+ }
8438
+ }
8439
+ );
8440
+ const i = [
8441
+ D.IFCRELCONTAINEDINSPATIALSTRUCTURE,
8442
+ D.IFCRELDEFINESBYTYPE,
8443
+ D.IFCRELASSIGNSTOGROUP
8444
+ ];
8445
+ for (const o of i)
8446
+ await Ft.getRelationMap(
8447
+ t,
8448
+ o,
8449
+ async (n, r) => {
8450
+ e[n] || (e[n] = /* @__PURE__ */ new Set());
8451
+ for (const a of r)
8452
+ e[n].add(a), e[a] || (e[a] = /* @__PURE__ */ new Set()), e[a].add(a);
8453
+ }
8454
+ );
8455
+ return this.indexedModels[t.uuid] = e, e;
8456
+ }
8457
+ async find(t, e) {
8458
+ const i = this.components.get(at), o = e || i.groups.values(), n = {};
8459
+ for (const a of o) {
8460
+ let c = this.indexedModels[a.uuid];
8461
+ c || (c = await this.indexEntityRelations(a));
8462
+ let E = [];
8463
+ for (const [u, p] of t.entries()) {
8464
+ const m = /* @__PURE__ */ new Set(), A = this.simpleQuery(a, p, m), C = [];
8465
+ for (const T of A) {
8466
+ const F = c[T];
8467
+ if (F) {
8468
+ C.push(T);
8469
+ for (const f of F)
8470
+ m.has(f) || C.push(f);
8471
+ }
8472
+ }
8473
+ E = p.operator === "AND" && u > 0 ? this.getCommonElements(E, C) : [...E, ...C];
8474
+ }
8475
+ const d = /* @__PURE__ */ new Set();
8476
+ for (const [u] of a.data)
8477
+ E.includes(u) && d.add(u);
8478
+ const h = /* @__PURE__ */ new Set();
8479
+ for (const u of E)
8480
+ d.has(u) || h.add(u);
8481
+ n[a.uuid] = { modelEntities: d, otherEntities: h };
8482
+ }
8483
+ const r = this.toFragmentMap(n);
8484
+ return this.onFound.trigger(r), r;
8485
+ }
8486
+ toFragmentMap(t) {
8487
+ const e = this.components.get(at), i = {};
8488
+ for (const o in t) {
8489
+ const n = e.groups.get(o);
8490
+ if (!n)
8491
+ continue;
8492
+ const r = t[o].modelEntities;
8493
+ for (const a of r) {
8494
+ const c = n.data.get(a);
8495
+ if (c)
8496
+ for (const E of c[0]) {
8497
+ const d = n.keyFragments.get(E);
8498
+ if (!d)
8499
+ throw new Error("Fragment ID not found!");
8500
+ i[d] || (i[d] = /* @__PURE__ */ new Set()), i[d].add(a);
8501
+ }
8502
+ }
8503
+ }
8504
+ return i;
8505
+ }
8506
+ simpleQuery(t, e, i) {
8507
+ const o = t.getLocalProperties();
8508
+ if (!o)
8509
+ throw new Error("Model has no properties");
8510
+ let n = {}, r = 0, a = [];
8511
+ for (const c of e.queries) {
8512
+ let E = [];
8513
+ const d = c.operator === "AND" ? n : o;
8514
+ if (c.condition) {
8515
+ const u = this.getMatchingEntities(
8516
+ d,
8517
+ c,
8518
+ i
8519
+ );
8520
+ E = u.expressIDs, n = { ...n, ...u.entities };
8521
+ } else
8522
+ E = [
8523
+ ...this.simpleQuery(t, c, i)
8524
+ ];
8525
+ a = r === 0 ? E : this.combineArrays(
8526
+ a,
8527
+ E,
8528
+ c.operator ?? "AND"
8529
+ // Defaults to AND if iterations > 0 and query.operator is not defined
8530
+ ), r++;
8531
+ }
8532
+ return new Set(a);
8533
+ }
8534
+ getMatchingEntities(t, e, i) {
8535
+ const { attribute: o, condition: n } = e;
8536
+ let { value: r } = e;
8537
+ const a = !this._noHandleAttributes.includes(o), c = [], E = [];
8538
+ for (const d in t) {
8539
+ const h = t[d];
8540
+ if (h === void 0)
8541
+ continue;
8542
+ const u = h[o];
8543
+ let p = a ? u == null ? void 0 : u.value : u;
8544
+ if (p == null)
8545
+ continue;
8546
+ const m = typeof r, A = typeof p;
8547
+ m === "number" && A === "string" ? r = r.toString() : m === "string" && A === "number" && (p = p.toString());
8548
+ let C = this._conditionFunctions[n](
8549
+ p,
8550
+ r
8551
+ );
8552
+ if (e.negateResult && (C = !C), !C) {
8553
+ e.negateResult && i.add(h.expressID);
8554
+ continue;
8555
+ }
8556
+ c.push(h.expressID), E.push(h);
8557
+ }
8558
+ return { expressIDs: c, entities: E, excludedItems: i };
8559
+ }
8560
+ combineArrays(t, e, i) {
8561
+ return i ? i === "AND" ? this.arrayIntersection(t, e) : this.arrayUnion(t, e) : e;
8562
+ }
8563
+ getCommonElements(...t) {
8564
+ const e = [], i = /* @__PURE__ */ new Map();
8565
+ for (const o of t) {
8566
+ const n = new Set(o);
8567
+ for (const r of n)
8568
+ i.has(r) ? i.set(r, i.get(r) + 1) : i.set(r, 1);
8569
+ }
8570
+ for (const [o, n] of i)
8571
+ n === t.length && e.push(o);
8572
+ return e;
8573
+ }
8574
+ arrayIntersection(t, e) {
8575
+ return t.filter((i) => e.includes(i));
8576
+ }
8577
+ arrayUnion(t, e) {
8578
+ return [...t, ...e];
8579
+ }
8580
+ getConditionFunctions() {
8581
+ return {
8582
+ is: (t, e) => t === e,
8583
+ includes: (t, e) => t.toString().includes(e.toString()),
8584
+ startsWith: (t, e) => t.toString().startsWith(e.toString()),
8585
+ endsWith: (t, e) => t.toString().endsWith(e.toString()),
8586
+ matches: (t, e) => new RegExp(e.toString()).test(t.toString())
8587
+ };
8588
+ }
8589
+ }
8590
+ class Zr {
8616
8591
  constructor() {
8617
8592
  I(this, "factor", 1);
8618
8593
  I(this, "complement", 1);
@@ -8634,7 +8609,7 @@ class Qr {
8634
8609
  try {
8635
8610
  const e = s.GetLineIDsWithType(
8636
8611
  0,
8637
- x.IFCUNITASSIGNMENT
8612
+ D.IFCUNITASSIGNMENT
8638
8613
  ).get(0), i = s.GetLine(0, e);
8639
8614
  for (const o of i.Units) {
8640
8615
  if (!o || o.value === null || o.value === void 0)
@@ -8673,7 +8648,7 @@ class Qr {
8673
8648
  class xn {
8674
8649
  constructor() {
8675
8650
  I(this, "itemsByFloor", {});
8676
- I(this, "_units", new Qr());
8651
+ I(this, "_units", new Zr());
8677
8652
  }
8678
8653
  // TODO: Maybe make this more flexible so that it also support more exotic spatial structures?
8679
8654
  setUp(s) {
@@ -8681,19 +8656,19 @@ class xn {
8681
8656
  try {
8682
8657
  const t = s.GetLineIDsWithType(
8683
8658
  0,
8684
- x.IFCRELCONTAINEDINSPATIALSTRUCTURE
8685
- ), e = /* @__PURE__ */ new Set(), i = s.GetLineIDsWithType(0, x.IFCSPACE);
8659
+ D.IFCRELCONTAINEDINSPATIALSTRUCTURE
8660
+ ), e = /* @__PURE__ */ new Set(), i = s.GetLineIDsWithType(0, D.IFCSPACE);
8686
8661
  for (let c = 0; c < i.size(); c++)
8687
8662
  e.add(i.get(c));
8688
- const o = s.GetLineIDsWithType(0, x.IFCRELAGGREGATES), n = o.size();
8663
+ const o = s.GetLineIDsWithType(0, D.IFCRELAGGREGATES), n = o.size();
8689
8664
  for (let c = 0; c < n; c++) {
8690
8665
  const E = o.get(c), d = s.GetLine(0, E);
8691
8666
  if (!d || !d.RelatingObject || !d.RelatedObjects)
8692
8667
  continue;
8693
8668
  const h = d.RelatingObject.value, u = d.RelatedObjects;
8694
8669
  for (const p of u) {
8695
- const T = p.value;
8696
- e.has(T) && (this.itemsByFloor[T] = h);
8670
+ const m = p.value;
8671
+ e.has(m) && (this.itemsByFloor[m] = h);
8697
8672
  }
8698
8673
  }
8699
8674
  const r = {}, a = t.size();
@@ -8705,13 +8680,13 @@ class xn {
8705
8680
  if (e.has(h))
8706
8681
  for (const p of u) {
8707
8682
  r[h] || (r[h] = []);
8708
- const T = p.value;
8709
- r[h].push(T);
8683
+ const m = p.value;
8684
+ r[h].push(m);
8710
8685
  }
8711
8686
  else
8712
8687
  for (const p of u) {
8713
- const T = p.value;
8714
- this.itemsByFloor[T] = h;
8688
+ const m = p.value;
8689
+ this.itemsByFloor[m] = h;
8715
8690
  }
8716
8691
  }
8717
8692
  for (const c in r) {
@@ -8728,8 +8703,8 @@ class xn {
8728
8703
  continue;
8729
8704
  const h = d.RelatingObject.value, u = d.RelatedObjects;
8730
8705
  for (const p of u) {
8731
- const T = p.value, A = this.itemsByFloor[h];
8732
- A !== void 0 && (this.itemsByFloor[T] = A);
8706
+ const m = p.value, A = this.itemsByFloor[h];
8707
+ A !== void 0 && (this.itemsByFloor[m] = A);
8733
8708
  }
8734
8709
  }
8735
8710
  } catch {
@@ -8748,14 +8723,14 @@ class Ni {
8748
8723
  * Generate the geometry for categories that are not included by default,
8749
8724
  * like IFCSPACE.
8750
8725
  */
8751
- I(this, "optionalCategories", [x.IFCSPACE]);
8726
+ I(this, "optionalCategories", [D.IFCSPACE]);
8752
8727
  /** Whether to use the coordination data coming from the IFC files. */
8753
8728
  I(this, "coordinate", !0);
8754
8729
  /** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
8755
8730
  I(this, "wasm", {
8756
8731
  path: "",
8757
8732
  absolute: !1,
8758
- logLevel: x.LogLevel.LOG_LEVEL_OFF
8733
+ logLevel: D.LogLevel.LOG_LEVEL_OFF
8759
8734
  });
8760
8735
  /** List of categories that won't be converted to fragments. */
8761
8736
  I(this, "excludedCategories", /* @__PURE__ */ new Set());
@@ -8799,13 +8774,13 @@ class bn {
8799
8774
  const n = {};
8800
8775
  if (o.data)
8801
8776
  for (const h of o.data) {
8802
- const [u, p] = h.split(": "), T = parseFloat(p);
8803
- n[u] = T || p;
8777
+ const [u, p] = h.split(": "), m = parseFloat(p);
8778
+ n[u] = m || p;
8804
8779
  }
8805
8780
  const { points: r } = o, a = new Float32Array(r.length * 3);
8806
8781
  for (let h = 0; h < r.length; h++) {
8807
- const { x: u, y: p, z: T } = r[h];
8808
- a[h * 3] = u, a[h * 3 + 1] = p, a[h * 3 + 2] = T || 0;
8782
+ const { x: u, y: p, z: m } = r[h];
8783
+ a[h * 3] = u, a[h * 3 + 1] = p, a[h * 3 + 2] = m || 0;
8809
8784
  }
8810
8785
  const c = new O.BufferAttribute(a, 3), E = new O.EdgesGeometry();
8811
8786
  E.setAttribute("position", c);
@@ -8840,13 +8815,13 @@ class vn {
8840
8815
  const ze = class ze extends J {
8841
8816
  constructor(t) {
8842
8817
  super(t);
8843
- I(this, "onIfcStartedLoading", new D());
8844
- I(this, "onSetup", new D());
8818
+ I(this, "onIfcStartedLoading", new U());
8819
+ I(this, "onSetup", new U());
8845
8820
  /** {@link Disposable.onDisposed} */
8846
- I(this, "onDisposed", new D());
8821
+ I(this, "onDisposed", new U());
8847
8822
  I(this, "settings", new Ni());
8848
8823
  I(this, "enabled", !0);
8849
- I(this, "webIfc", new x.IfcAPI());
8824
+ I(this, "webIfc", new D.IfcAPI());
8850
8825
  I(this, "_material", new O.MeshLambertMaterial());
8851
8826
  I(this, "_spatialTree", new xn());
8852
8827
  I(this, "_metaData", new vn());
@@ -8858,7 +8833,7 @@ const ze = class ze extends J {
8858
8833
  transparent: !0,
8859
8834
  opacity: 0.5
8860
8835
  }));
8861
- this.components.add(ze.uuid, this), this.settings.excludedCategories.add(x.IFCOPENINGELEMENT);
8836
+ this.components.add(ze.uuid, this), this.settings.excludedCategories.add(D.IFCOPENINGELEMENT);
8862
8837
  }
8863
8838
  dispose() {
8864
8839
  this.webIfc = null, this.onDisposed.trigger(ze.uuid), this.onDisposed.reset();
@@ -8883,7 +8858,7 @@ const ze = class ze extends J {
8883
8858
  }
8884
8859
  async getAllGeometries() {
8885
8860
  this._spatialTree.setUp(this.webIfc);
8886
- const t = this.webIfc.GetIfcEntityList(0), e = new Gt.FragmentsGroup(), { FILE_NAME: i, FILE_DESCRIPTION: o } = x;
8861
+ const t = this.webIfc.GetIfcEntityList(0), e = new Gt.FragmentsGroup(), { FILE_NAME: i, FILE_DESCRIPTION: o } = D;
8887
8862
  e.ifcMetadata = {
8888
8863
  name: this._metaData.get(this.webIfc, i),
8889
8864
  description: this._metaData.get(this.webIfc, o),
@@ -8892,7 +8867,7 @@ const ze = class ze extends J {
8892
8867
  };
8893
8868
  const n = [];
8894
8869
  for (const a of t) {
8895
- if (!this.webIfc.IsIfcElement(a) && a !== x.IFCSPACE || this.settings.excludedCategories.has(a))
8870
+ if (!this.webIfc.IsIfcElement(a) && a !== D.IFCSPACE || this.settings.excludedCategories.has(a))
8896
8871
  continue;
8897
8872
  const c = this.webIfc.GetLineIDsWithType(0, a), E = c.size();
8898
8873
  for (let d = 0; d < E; d++) {
@@ -8922,7 +8897,7 @@ const ze = class ze extends J {
8922
8897
  return e.coordinationMatrix.fromArray(r), e.civilData = this._civil.read(this.webIfc), e;
8923
8898
  }
8924
8899
  cleanUp() {
8925
- this.webIfc = null, this.webIfc = new x.IfcAPI(), this._visitedFragments.clear(), this._fragmentInstances.clear();
8900
+ this.webIfc = null, this.webIfc = new D.IfcAPI(), this._visitedFragments.clear(), this._fragmentInstances.clear();
8926
8901
  }
8927
8902
  getMesh(t, e) {
8928
8903
  const i = t.geometries.size(), o = t.expressID;
@@ -8934,15 +8909,15 @@ const ze = class ze extends J {
8934
8909
  const _ = this._visitedFragments.size;
8935
8910
  this._visitedFragments.set(p, { index: _, fragment: S });
8936
8911
  }
8937
- const T = new O.Color().setRGB(a, c, E, "srgb"), A = new O.Matrix4();
8912
+ const m = new O.Color().setRGB(a, c, E, "srgb"), A = new O.Matrix4();
8938
8913
  A.fromArray(r.flatTransformation);
8939
8914
  const C = this._visitedFragments.get(p);
8940
8915
  if (C === void 0)
8941
8916
  throw new Error("Error getting geometry data for streaming!");
8942
- const m = e.data.get(o);
8943
- if (!m)
8917
+ const T = e.data.get(o);
8918
+ if (!T)
8944
8919
  throw new Error("Data not found!");
8945
- m[0].push(C.index);
8920
+ T[0].push(C.index);
8946
8921
  const { fragment: F } = C;
8947
8922
  this._fragmentInstances.has(F.id) || this._fragmentInstances.set(F.id, /* @__PURE__ */ new Map());
8948
8923
  const f = this._fragmentInstances.get(F.id);
@@ -8952,9 +8927,9 @@ const ze = class ze extends J {
8952
8927
  const R = f.get(o);
8953
8928
  if (!R)
8954
8929
  throw new Error("Instance not found!");
8955
- R.transforms.push(A), R.colors && R.colors.push(T);
8930
+ R.transforms.push(A), R.colors && R.colors.push(m);
8956
8931
  } else
8957
- f.set(o, { id: o, transforms: [A], colors: [T] });
8932
+ f.set(o, { id: o, transforms: [A], colors: [m] });
8958
8933
  }
8959
8934
  }
8960
8935
  getGeometry(t, e) {
@@ -8972,7 +8947,7 @@ const ze = class ze extends J {
8972
8947
  }
8973
8948
  async autoSetWasm() {
8974
8949
  const t = await fetch(
8975
- `https://unpkg.com/openbim-components@${ui.release}/package.json`
8950
+ `https://unpkg.com/openbim-components@${Ii.release}/package.json`
8976
8951
  );
8977
8952
  if (!t.ok) {
8978
8953
  console.warn(
@@ -8997,13 +8972,13 @@ const Yt = class Yt extends J {
8997
8972
  constructor(t) {
8998
8973
  super(t);
8999
8974
  /** {@link Disposable.onDisposed} */
9000
- I(this, "onDisposed", new D());
9001
- I(this, "onRequestFile", new D());
8975
+ I(this, "onDisposed", new U());
8976
+ I(this, "onRequestFile", new U());
9002
8977
  I(this, "ifcToExport", null);
9003
- I(this, "onElementToPset", new D());
9004
- I(this, "onPropToPset", new D());
9005
- I(this, "onPsetRemoved", new D());
9006
- I(this, "onDataChanged", new D());
8978
+ I(this, "onElementToPset", new U());
8979
+ I(this, "onPropToPset", new U());
8980
+ I(this, "onPsetRemoved", new U());
8981
+ I(this, "onDataChanged", new U());
9007
8982
  I(this, "wasm", {
9008
8983
  path: "/",
9009
8984
  absolute: !1
@@ -9031,15 +9006,15 @@ const Yt = class Yt extends J {
9031
9006
  }
9032
9007
  newGUID(t) {
9033
9008
  const e = Yt.getIFCSchema(t);
9034
- return new x[e].IfcGloballyUniqueId(ke.create());
9009
+ return new D[e].IfcGloballyUniqueId(ke.create());
9035
9010
  }
9036
9011
  async getOwnerHistory(t) {
9037
9012
  const e = await t.getAllPropertiesOfType(
9038
- x.IFCOWNERHISTORY
9013
+ D.IFCOWNERHISTORY
9039
9014
  );
9040
9015
  if (!e)
9041
9016
  throw new Error("No OwnerHistory was found.");
9042
- const i = Object.keys(e).map((r) => parseInt(r, 10)), o = e[i[0]], n = new x.Handle(o.expressID);
9017
+ const i = Object.keys(e).map((r) => parseInt(r, 10)), o = e[i[0]], n = new D.Handle(o.expressID);
9043
9018
  return { ownerHistory: o, ownerHistoryHandle: n };
9044
9019
  }
9045
9020
  registerChange(t, ...e) {
@@ -9054,7 +9029,7 @@ const Yt = class Yt extends J {
9054
9029
  }
9055
9030
  }
9056
9031
  async newPset(t, e, i) {
9057
- const o = Yt.getIFCSchema(t), { ownerHistoryHandle: n } = await this.getOwnerHistory(t), r = this.newGUID(t), a = new x[o].IfcLabel(e), c = i ? new x[o].IfcText(i) : null, E = new x[o].IfcPropertySet(
9032
+ const o = Yt.getIFCSchema(t), { ownerHistoryHandle: n } = await this.getOwnerHistory(t), r = this.newGUID(t), a = new D[o].IfcLabel(e), c = i ? new D[o].IfcText(i) : null, E = new D[o].IfcPropertySet(
9058
9033
  r,
9059
9034
  n,
9060
9035
  a,
@@ -9062,20 +9037,20 @@ const Yt = class Yt extends J {
9062
9037
  []
9063
9038
  );
9064
9039
  E.expressID = this.increaseMaxID(t);
9065
- const d = this.newGUID(t), h = new x[o].IfcRelDefinesByProperties(
9040
+ const d = this.newGUID(t), h = new D[o].IfcRelDefinesByProperties(
9066
9041
  d,
9067
9042
  n,
9068
9043
  null,
9069
9044
  null,
9070
9045
  [],
9071
- new x.Handle(E.expressID)
9046
+ new D.Handle(E.expressID)
9072
9047
  );
9073
9048
  return h.expressID = this.increaseMaxID(t), await this.setData(t, E, h), { pset: E, rel: h };
9074
9049
  }
9075
9050
  async removePset(t, ...e) {
9076
9051
  for (const i of e) {
9077
9052
  const o = await t.getProperties(i);
9078
- if ((o == null ? void 0 : o.type) !== x.IFCPROPERTYSET)
9053
+ if ((o == null ? void 0 : o.type) !== D.IFCPROPERTYSET)
9079
9054
  continue;
9080
9055
  const n = await Ft.getPsetRel(t, i);
9081
9056
  if (n && (await t.setProperties(n, null), this.registerChange(t, n)), o) {
@@ -9086,7 +9061,7 @@ const Yt = class Yt extends J {
9086
9061
  }
9087
9062
  }
9088
9063
  async newSingleProperty(t, e, i, o) {
9089
- const n = Yt.getIFCSchema(t), r = new x[n].IfcIdentifier(i), a = new x[n][e](o), c = new x[n].IfcPropertySingleValue(
9064
+ const n = Yt.getIFCSchema(t), r = new D[n].IfcIdentifier(i), a = new D[n][e](o), c = new D[n].IfcPropertySingleValue(
9090
9065
  r,
9091
9066
  null,
9092
9067
  a,
@@ -9105,7 +9080,7 @@ const Yt = class Yt extends J {
9105
9080
  }
9106
9081
  async removePsetProp(t, e, i) {
9107
9082
  const o = await t.getProperties(e), n = await t.getProperties(i);
9108
- !o || !n || o.type === x.IFCPROPERTYSET && n && (o.HasProperties = o.HasProperties.filter((r) => r.value !== i), await t.setProperties(i, null), this.registerChange(t, e, i));
9083
+ !o || !n || o.type === D.IFCPROPERTYSET && n && (o.HasProperties = o.HasProperties.filter((r) => r.value !== i), await t.setProperties(i, null), this.registerChange(t, e, i));
9109
9084
  }
9110
9085
  async addElementToPset(t, e, ...i) {
9111
9086
  const o = await Ft.getPsetRel(t, e);
@@ -9114,7 +9089,7 @@ const Yt = class Yt extends J {
9114
9089
  const n = await t.getProperties(o);
9115
9090
  if (n) {
9116
9091
  for (const r of i) {
9117
- const a = new x.Handle(r);
9092
+ const a = new D.Handle(r);
9118
9093
  n.RelatedObjects.push(a), this.onElementToPset.trigger({
9119
9094
  model: t,
9120
9095
  psetID: e,
@@ -9130,7 +9105,7 @@ const Yt = class Yt extends J {
9130
9105
  for (const n of i) {
9131
9106
  if (o.HasProperties.includes(n))
9132
9107
  continue;
9133
- const r = new x.Handle(n);
9108
+ const r = new D.Handle(n);
9134
9109
  o.HasProperties.push(r), this.onPropToPset.trigger({ model: t, psetID: e, propID: n });
9135
9110
  }
9136
9111
  this.registerChange(t, e);
@@ -9170,7 +9145,7 @@ const Yt = class Yt extends J {
9170
9145
  const a = r.value;
9171
9146
  if (a === void 0 || a == null)
9172
9147
  throw new Error(`Attribute ${i} has a badly defined handle.`);
9173
- const c = new D();
9148
+ const c = new U();
9174
9149
  return Object.defineProperty(n[i], "value", {
9175
9150
  get() {
9176
9151
  return this._value;
@@ -9183,14 +9158,14 @@ const Yt = class Yt extends J {
9183
9158
  };
9184
9159
  I(Yt, "uuid", "58c2d9f0-183c-48d6-a402-dfcf5b9a34df");
9185
9160
  let An = Yt;
9186
- const ys = class ys extends J {
9161
+ const Ls = class Ls extends J {
9187
9162
  constructor(t) {
9188
9163
  super(t);
9189
9164
  /** {@link Component.enabled} */
9190
9165
  I(this, "enabled", !0);
9191
9166
  I(this, "list", {});
9192
9167
  /** {@link Disposable.onDisposed} */
9193
- I(this, "onDisposed", new D());
9168
+ I(this, "onDisposed", new U());
9194
9169
  I(this, "onFragmentsDisposed", (t) => {
9195
9170
  const { groupID: e, fragmentIDs: i } = t;
9196
9171
  for (const o in this.list) {
@@ -9206,7 +9181,7 @@ const ys = class ys extends J {
9206
9181
  }
9207
9182
  }
9208
9183
  });
9209
- t.add(ys.uuid, this), t.get(at).onFragmentsDisposed.add(this.onFragmentsDisposed);
9184
+ t.add(Ls.uuid, this), t.get(at).onFragmentsDisposed.add(this.onFragmentsDisposed);
9210
9185
  }
9211
9186
  dispose() {
9212
9187
  this.list = {}, this.components.get(at).onFragmentsDisposed.remove(this.onFragmentsDisposed), this.onDisposed.trigger(), this.onDisposed.reset();
@@ -9358,8 +9333,8 @@ const ys = class ys extends J {
9358
9333
  }
9359
9334
  }
9360
9335
  };
9361
- I(ys, "uuid", "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");
9362
- let Ti = ys;
9336
+ I(Ls, "uuid", "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");
9337
+ let Ti = Ls;
9363
9338
  const He = class He extends J {
9364
9339
  constructor(t) {
9365
9340
  super(t);
@@ -9367,7 +9342,7 @@ const He = class He extends J {
9367
9342
  I(this, "height", 10);
9368
9343
  I(this, "groupName", "storeys");
9369
9344
  /** {@link Disposable.onDisposed} */
9370
- I(this, "onDisposed", new D());
9345
+ I(this, "onDisposed", new U());
9371
9346
  I(this, "list", /* @__PURE__ */ new Set());
9372
9347
  t.add(He.uuid, this);
9373
9348
  }
@@ -9400,11 +9375,11 @@ const He = class He extends J {
9400
9375
  };
9401
9376
  I(He, "uuid", "d260618b-ce88-4c7d-826c-6debb91de3e2");
9402
9377
  let Fn = He;
9403
- const Ps = class Ps extends J {
9378
+ const ys = class ys extends J {
9404
9379
  constructor(t) {
9405
9380
  super(t);
9406
9381
  I(this, "enabled", !0);
9407
- this.components.add(Ps.uuid, this);
9382
+ this.components.add(ys.uuid, this);
9408
9383
  }
9409
9384
  set(t, e) {
9410
9385
  const i = this.components.get(at);
@@ -9424,16 +9399,16 @@ const Ps = class Ps extends J {
9424
9399
  this.set(!1), this.set(!0, t);
9425
9400
  }
9426
9401
  updateCulledVisibility(t) {
9427
- const e = this.components.get(fi);
9402
+ const e = this.components.get(pi);
9428
9403
  for (const [i, o] of e.list) {
9429
9404
  const n = o.colorMeshes.get(t.id);
9430
9405
  n && (n.count = t.mesh.count);
9431
9406
  }
9432
9407
  }
9433
9408
  };
9434
- I(Ps, "uuid", "dd9ccf2d-8a21-4821-b7f6-2949add16a29");
9435
- let gn = Ps;
9436
- class jr extends Ni {
9409
+ I(ys, "uuid", "dd9ccf2d-8a21-4821-b7f6-2949add16a29");
9410
+ let gn = ys;
9411
+ class Qr extends Ni {
9437
9412
  constructor() {
9438
9413
  super(...arguments);
9439
9414
  I(this, "minGeometrySize", 10);
@@ -9446,17 +9421,17 @@ class Bn extends Ni {
9446
9421
  I(this, "propertiesSize", 100);
9447
9422
  }
9448
9423
  }
9449
- class qr extends J {
9424
+ class jr extends J {
9450
9425
  constructor() {
9451
9426
  super(...arguments);
9452
9427
  I(this, "onPropertiesStreamed", new Kt());
9453
9428
  I(this, "onProgress", new Kt());
9454
9429
  I(this, "onIndicesStreamed", new Kt());
9455
9430
  /** {@link Disposable.onDisposed} */
9456
- I(this, "onDisposed", new D());
9431
+ I(this, "onDisposed", new U());
9457
9432
  I(this, "enabled", !0);
9458
9433
  I(this, "settings", new Bn());
9459
- I(this, "webIfc", new x.IfcAPI());
9434
+ I(this, "webIfc", new D.IfcAPI());
9460
9435
  }
9461
9436
  async dispose() {
9462
9437
  this.onIndicesStreamed.reset(), this.onPropertiesStreamed.reset(), this.webIfc = null, this.onDisposed.reset();
@@ -9479,18 +9454,18 @@ class qr extends J {
9479
9454
  }
9480
9455
  async streamAllProperties() {
9481
9456
  const { propertiesSize: t } = this.settings, e = new Set(this.webIfc.GetIfcEntityList(0)), i = [
9482
- x.IFCRELDEFINESBYPROPERTIES,
9483
- x.IFCRELDEFINESBYTYPE,
9484
- x.IFCRELASSOCIATESMATERIAL,
9485
- x.IFCRELCONTAINEDINSPATIALSTRUCTURE,
9486
- x.IFCRELASSOCIATESCLASSIFICATION,
9487
- x.IFCRELASSIGNSTOGROUP
9457
+ D.IFCRELDEFINESBYPROPERTIES,
9458
+ D.IFCRELDEFINESBYTYPE,
9459
+ D.IFCRELASSOCIATESMATERIAL,
9460
+ D.IFCRELCONTAINEDINSPATIALSTRUCTURE,
9461
+ D.IFCRELASSOCIATESCLASSIFICATION,
9462
+ D.IFCRELASSIGNSTOGROUP
9488
9463
  ], o = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set([
9489
- x.IFCPROJECT,
9490
- x.IFCSITE,
9491
- x.IFCBUILDING,
9492
- x.IFCBUILDINGSTOREY,
9493
- x.IFCSPACE
9464
+ D.IFCPROJECT,
9465
+ D.IFCSITE,
9466
+ D.IFCBUILDING,
9467
+ D.IFCBUILDINGSTOREY,
9468
+ D.IFCSPACE
9494
9469
  ]);
9495
9470
  for (const E of n)
9496
9471
  e.add(E);
@@ -9502,9 +9477,9 @@ class qr extends J {
9502
9477
  let p = 0;
9503
9478
  for (let A = 0; A < u - t; A += t) {
9504
9479
  const C = {};
9505
- for (let m = 0; m < t; m++) {
9480
+ for (let T = 0; T < t; T++) {
9506
9481
  p++;
9507
- const F = h.get(A + m);
9482
+ const F = h.get(A + T);
9508
9483
  try {
9509
9484
  const f = this.webIfc.GetLine(0, F, d);
9510
9485
  i.includes(E) && this.getIndices(f, F, o), C[f.expressID] = f;
@@ -9517,18 +9492,18 @@ class qr extends J {
9517
9492
  if (p !== u) {
9518
9493
  const A = {};
9519
9494
  for (let C = p; C < u; C++) {
9520
- const m = h.get(C);
9495
+ const T = h.get(C);
9521
9496
  try {
9522
- const F = this.webIfc.GetLine(0, m, d);
9523
- i.includes(E) && this.getIndices(F, m, o), A[F.expressID] = F;
9497
+ const F = this.webIfc.GetLine(0, T, d);
9498
+ i.includes(E) && this.getIndices(F, T, o), A[F.expressID] = F;
9524
9499
  } catch {
9525
- console.log(`Could not get property: ${m}`);
9500
+ console.log(`Could not get property: ${T}`);
9526
9501
  }
9527
9502
  }
9528
9503
  await this.onPropertiesStreamed.trigger({ type: E, data: A });
9529
9504
  }
9530
- const T = a / e.size;
9531
- T > r && (r += 0.01, r = Math.max(r, T), await this.onProgress.trigger(Math.round(r * 100) / 100));
9505
+ const m = a / e.size;
9506
+ m > r && (r += 0.01, r = Math.max(r, m), await this.onProgress.trigger(Math.round(r * 100) / 100));
9532
9507
  }
9533
9508
  const c = [];
9534
9509
  for (const [E, d] of o)
@@ -9557,22 +9532,22 @@ class qr extends J {
9557
9532
  }
9558
9533
  }
9559
9534
  cleanUp() {
9560
- this.webIfc = null, this.webIfc = new x.IfcAPI();
9535
+ this.webIfc = null, this.webIfc = new D.IfcAPI();
9561
9536
  }
9562
9537
  }
9563
- I(qr, "uuid", "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");
9564
- const Ls = class Ls extends J {
9538
+ I(jr, "uuid", "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");
9539
+ const ws = class ws extends J {
9565
9540
  constructor(t) {
9566
9541
  super(t);
9567
- I(this, "onGeometryStreamed", new D());
9568
- I(this, "onAssetStreamed", new D());
9569
- I(this, "onProgress", new D());
9570
- I(this, "onIfcLoaded", new D());
9542
+ I(this, "onGeometryStreamed", new U());
9543
+ I(this, "onAssetStreamed", new U());
9544
+ I(this, "onProgress", new U());
9545
+ I(this, "onIfcLoaded", new U());
9571
9546
  /** {@link Disposable.onDisposed} */
9572
- I(this, "onDisposed", new D());
9573
- I(this, "settings", new jr());
9547
+ I(this, "onDisposed", new U());
9548
+ I(this, "settings", new Qr());
9574
9549
  I(this, "enabled", !0);
9575
- I(this, "webIfc", new x.IfcAPI());
9550
+ I(this, "webIfc", new D.IfcAPI());
9576
9551
  I(this, "_spatialTree", new xn());
9577
9552
  I(this, "_metaData", new vn());
9578
9553
  I(this, "_visitedGeometries", /* @__PURE__ */ new Map());
@@ -9583,7 +9558,7 @@ const Ls = class Ls extends J {
9583
9558
  I(this, "_groupSerializer", new Gt.Serializer());
9584
9559
  I(this, "_assets", []);
9585
9560
  I(this, "_meshesWithHoles", /* @__PURE__ */ new Set());
9586
- this.components.add(Ls.uuid, this), this.settings.excludedCategories.add(x.IFCOPENINGELEMENT);
9561
+ this.components.add(ws.uuid, this), this.settings.excludedCategories.add(D.IFCOPENINGELEMENT);
9587
9562
  }
9588
9563
  dispose() {
9589
9564
  this.onIfcLoaded.reset(), this.onGeometryStreamed.reset(), this.onAssetStreamed.reset(), this.webIfc = null, this.onDisposed.trigger(), this.onDisposed.reset();
@@ -9607,7 +9582,7 @@ const Ls = class Ls extends J {
9607
9582
  async streamAllGeometries() {
9608
9583
  const { minGeometrySize: t, minAssetsSize: e } = this.settings;
9609
9584
  this._spatialTree.setUp(this.webIfc);
9610
- const i = this.webIfc.GetIfcEntityList(0), o = [[]], n = new Gt.FragmentsGroup(), { FILE_NAME: r, FILE_DESCRIPTION: a } = x;
9585
+ const i = this.webIfc.GetIfcEntityList(0), o = [[]], n = new Gt.FragmentsGroup(), { FILE_NAME: r, FILE_DESCRIPTION: a } = D;
9611
9586
  n.ifcMetadata = {
9612
9587
  name: this._metaData.get(this.webIfc, r),
9613
9588
  description: this._metaData.get(this.webIfc, a),
@@ -9615,23 +9590,23 @@ const Ls = class Ls extends J {
9615
9590
  maxExpressID: this.webIfc.GetMaxExpressID(0)
9616
9591
  };
9617
9592
  let c = 0, E = 0;
9618
- for (const m of i) {
9619
- if (!this.webIfc.IsIfcElement(m) && m !== x.IFCSPACE || this.settings.excludedCategories.has(m))
9593
+ for (const T of i) {
9594
+ if (!this.webIfc.IsIfcElement(T) && T !== D.IFCSPACE || this.settings.excludedCategories.has(T))
9620
9595
  continue;
9621
- const F = this.webIfc.GetLineIDsWithType(0, m), f = F.size();
9596
+ const F = this.webIfc.GetLineIDsWithType(0, T), f = F.size();
9622
9597
  console.log(f);
9623
9598
  for (let R = 0; R < f; R++) {
9624
9599
  c > t && (c = 0, E++, o.push([]));
9625
9600
  const g = F.get(R);
9626
9601
  o[E].push(g);
9627
9602
  const S = this._spatialTree.itemsByFloor[g] || 0;
9628
- n.data.set(g, [[], [S, m]]), c++;
9603
+ n.data.set(g, [[], [S, T]]), c++;
9629
9604
  }
9630
9605
  }
9631
9606
  this._spatialTree.cleanUp();
9632
9607
  let d = 0.01, h = 0;
9633
- for (const m of o) {
9634
- h++, this.webIfc.StreamMeshes(0, m, (f) => {
9608
+ for (const T of o) {
9609
+ h++, this.webIfc.StreamMeshes(0, T, (f) => {
9635
9610
  this.getMesh(this.webIfc, f, n);
9636
9611
  }), this._geometryCount > t && await this.streamGeometries(), this._assets.length > e && await this.streamAssets();
9637
9612
  const F = h / o.length;
@@ -9639,12 +9614,12 @@ const Ls = class Ls extends J {
9639
9614
  }
9640
9615
  this._geometryCount && await this.streamGeometries(), this._assets.length && await this.streamAssets();
9641
9616
  const { opaque: u, transparent: p } = n.geometryIDs;
9642
- for (const [m, { index: F, uuid: f }] of this._visitedGeometries)
9643
- n.keyFragments.set(F, f), (m > 1 ? u : p).set(m, F);
9644
- const T = n.data.keys();
9645
- for (const m of T) {
9646
- const [F] = n.data.get(m);
9647
- F.length || n.data.delete(m);
9617
+ for (const [T, { index: F, uuid: f }] of this._visitedGeometries)
9618
+ n.keyFragments.set(F, f), (T > 1 ? u : p).set(T, F);
9619
+ const m = n.data.keys();
9620
+ for (const T of m) {
9621
+ const [F] = n.data.get(T);
9622
+ F.length || n.data.delete(T);
9648
9623
  }
9649
9624
  const A = this.webIfc.GetCoordinationMatrix(0);
9650
9625
  n.coordinationMatrix.fromArray(A), n.civilData = this._civil.read(this.webIfc);
@@ -9652,7 +9627,7 @@ const Ls = class Ls extends J {
9652
9627
  this.onIfcLoaded.trigger(C), n.dispose(!0);
9653
9628
  }
9654
9629
  cleanUp() {
9655
- this.webIfc = null, this.webIfc = new x.IfcAPI(), this._visitedGeometries.clear(), this._geometries.clear(), this._assets = [], this._meshesWithHoles.clear();
9630
+ this.webIfc = null, this.webIfc = new D.IfcAPI(), this._visitedGeometries.clear(), this._geometries.clear(), this._assets = [], this._meshesWithHoles.clear();
9656
9631
  }
9657
9632
  getMesh(t, e, i) {
9658
9633
  const o = e.geometries.size(), n = e.expressID, r = { id: n, geometries: [] };
@@ -9670,7 +9645,7 @@ const Ls = class Ls extends J {
9670
9645
  if (!p)
9671
9646
  throw new Error("Data not found!");
9672
9647
  p[0].push(u.index);
9673
- const { x: T, y: A, z: C, w: m } = c.color, F = [T, A, C, m], f = c.flatTransformation;
9648
+ const { x: m, y: A, z: C, w: T } = c.color, F = [m, A, C, T], f = c.flatTransformation;
9674
9649
  r.geometries.push({ color: F, geometryID: E, transformation: f });
9675
9650
  }
9676
9651
  this._assets.push(r);
@@ -9688,8 +9663,8 @@ const Ls = class Ls extends J {
9688
9663
  const c = fr(r), E = new Float32Array(c.transformation.elements), d = [c.center.x, c.center.y, c.center.z];
9689
9664
  let h = !1;
9690
9665
  for (let u = 0; u < r.length - 2; u += 3) {
9691
- const p = r[u], T = r[u + 1], A = r[u + 2], C = a[u], m = a[u + 1], F = a[u + 2];
9692
- if (pr(d, [p, T, A], [C, m, F])) {
9666
+ const p = r[u], m = r[u + 1], A = r[u + 2], C = a[u], T = a[u + 1], F = a[u + 2];
9667
+ if (pr(d, [p, m, A], [C, T, F])) {
9693
9668
  h = !0;
9694
9669
  break;
9695
9670
  }
@@ -9712,19 +9687,19 @@ const Ls = class Ls extends J {
9712
9687
  this.onGeometryStreamed.trigger({ data: e, buffer: t }), e = null, t = null, this._geometries.clear(), this._geometryCount = 0;
9713
9688
  }
9714
9689
  };
9715
- I(Ls, "uuid", "d9999a00-e1f5-4d3f-8cfe-c56e08609764");
9716
- let On = Ls;
9717
- class $r extends J {
9690
+ I(ws, "uuid", "d9999a00-e1f5-4d3f-8cfe-c56e08609764");
9691
+ let On = ws;
9692
+ class qr extends J {
9718
9693
  constructor() {
9719
9694
  super(...arguments);
9720
9695
  I(this, "onPropertiesStreamed", new Kt());
9721
9696
  I(this, "onProgress", new Kt());
9722
9697
  I(this, "onIndicesStreamed", new Kt());
9723
9698
  /** {@link Disposable.onDisposed} */
9724
- I(this, "onDisposed", new D());
9699
+ I(this, "onDisposed", new U());
9725
9700
  I(this, "enabled", !0);
9726
9701
  I(this, "settings", new Bn());
9727
- I(this, "webIfc", new x.IfcAPI());
9702
+ I(this, "webIfc", new D.IfcAPI());
9728
9703
  }
9729
9704
  async dispose() {
9730
9705
  this.onIndicesStreamed.reset(), this.onPropertiesStreamed.reset(), this.webIfc = null, this.onDisposed.reset();
@@ -9747,11 +9722,11 @@ class $r extends J {
9747
9722
  }
9748
9723
  async streamAllProperties() {
9749
9724
  const { propertiesSize: t } = this.settings, e = new Set(this.webIfc.GetIfcEntityList(0)), i = /* @__PURE__ */ new Set([
9750
- x.IFCPROJECT,
9751
- x.IFCSITE,
9752
- x.IFCBUILDING,
9753
- x.IFCBUILDINGSTOREY,
9754
- x.IFCSPACE
9725
+ D.IFCPROJECT,
9726
+ D.IFCSITE,
9727
+ D.IFCBUILDING,
9728
+ D.IFCBUILDINGSTOREY,
9729
+ D.IFCSPACE
9755
9730
  ]);
9756
9731
  for (const c of i)
9757
9732
  e.add(c);
@@ -9761,45 +9736,45 @@ class $r extends J {
9761
9736
  continue;
9762
9737
  const E = i.has(c), d = this.webIfc.GetLineIDsWithType(0, c), h = d.size();
9763
9738
  let u = 0;
9764
- for (let T = 0; T < h - t; T += t) {
9739
+ for (let m = 0; m < h - t; m += t) {
9765
9740
  const A = {};
9766
9741
  for (let C = 0; C < t; C++) {
9767
9742
  u++;
9768
- const m = d.get(T + C);
9743
+ const T = d.get(m + C);
9769
9744
  try {
9770
- const F = this.webIfc.GetLine(0, m, E);
9745
+ const F = this.webIfc.GetLine(0, T, E);
9771
9746
  A[F.expressID] = F;
9772
9747
  } catch {
9773
- console.log(`Could not get property: ${m}`);
9748
+ console.log(`Could not get property: ${T}`);
9774
9749
  }
9775
9750
  }
9776
9751
  await this.onPropertiesStreamed.trigger({ type: c, data: A });
9777
9752
  }
9778
9753
  if (u !== h) {
9779
- const T = {};
9754
+ const m = {};
9780
9755
  for (let A = u; A < h; A++) {
9781
9756
  const C = d.get(A);
9782
9757
  try {
9783
- const m = this.webIfc.GetLine(0, C, E);
9784
- T[m.expressID] = m;
9758
+ const T = this.webIfc.GetLine(0, C, E);
9759
+ m[T.expressID] = T;
9785
9760
  } catch {
9786
9761
  console.log(`Could not get property: ${C}`);
9787
9762
  }
9788
9763
  }
9789
- await this.onPropertiesStreamed.trigger({ type: c, data: T });
9764
+ await this.onPropertiesStreamed.trigger({ type: c, data: m });
9790
9765
  }
9791
9766
  const p = n / e.size;
9792
9767
  p > o && (o += 0.01, o = Math.max(o, p), await this.onProgress.trigger(Math.round(o * 100) / 100));
9793
9768
  }
9794
- const a = await this.components.get(pi).processFromWebIfc(this.webIfc, 0);
9769
+ const a = await this.components.get(gs).processFromWebIfc(this.webIfc, 0);
9795
9770
  await this.onIndicesStreamed.trigger(a);
9796
9771
  }
9797
9772
  cleanUp() {
9798
- this.webIfc = null, this.webIfc = new x.IfcAPI();
9773
+ this.webIfc = null, this.webIfc = new D.IfcAPI();
9799
9774
  }
9800
9775
  }
9801
- I($r, "uuid", "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");
9802
- class aa {
9776
+ I(qr, "uuid", "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");
9777
+ class ra {
9803
9778
  static getFace(s, t, e) {
9804
9779
  if (!s.geometry.index)
9805
9780
  throw new Error("Geometry must be indexed!");
@@ -9812,8 +9787,8 @@ class aa {
9812
9787
  const { plane: h, edges: u } = this.getFaceData(d, e, s);
9813
9788
  if (h.equals(n)) {
9814
9789
  r.push({ index: d, edges: u });
9815
- for (const { id: p, points: T, distance: A } of u)
9816
- i.set(p, { points: T, distance: A });
9790
+ for (const { id: p, points: m, distance: A } of u)
9791
+ i.set(p, { points: m, distance: A });
9817
9792
  }
9818
9793
  }
9819
9794
  let a = 0;
@@ -9836,36 +9811,36 @@ class aa {
9836
9811
  });
9837
9812
  continue;
9838
9813
  }
9839
- let T = null;
9814
+ let m = null;
9840
9815
  const A = /* @__PURE__ */ new Set(), C = new Set(p);
9841
9816
  for (const [f, R] of u) {
9842
- T === null ? T = R : R !== T && A.add(R), c.delete(f);
9817
+ m === null ? m = R : R !== m && A.add(R), c.delete(f);
9843
9818
  const { edges: g } = E.get(R);
9844
9819
  g.delete(f), C.delete(f);
9845
9820
  }
9846
- if (T === null)
9821
+ if (m === null)
9847
9822
  throw new Error("Error computing face!");
9848
- const m = E.get(T), { indices: F } = m;
9823
+ const T = E.get(m), { indices: F } = T;
9849
9824
  F.add(d);
9850
9825
  for (const f of C) {
9851
- c.set(f, T);
9852
- const { edges: R } = m;
9826
+ c.set(f, m);
9827
+ const { edges: R } = T;
9853
9828
  R.add(f);
9854
9829
  }
9855
9830
  for (const f of A) {
9856
- const R = E.get(f), { edges: g, indices: S } = R, _ = E.get(T), { edges: N, indices: P } = _;
9831
+ const R = E.get(f), { edges: g, indices: S } = R, _ = E.get(m), { edges: N, indices: L } = _;
9857
9832
  for (const M of g)
9858
- N.add(M), c.set(M, T);
9833
+ N.add(M), c.set(M, m);
9859
9834
  for (const M of S)
9860
- P.add(M);
9835
+ L.add(M);
9861
9836
  E.delete(f);
9862
9837
  }
9863
9838
  }
9864
9839
  for (const [d, { indices: h, edges: u }] of E)
9865
9840
  if (h.has(t)) {
9866
9841
  const p = [];
9867
- for (const T of u) {
9868
- const A = i.get(T);
9842
+ for (const m of u) {
9843
+ const A = i.get(m);
9869
9844
  p.push(A);
9870
9845
  }
9871
9846
  return { edges: p, indices: h };
@@ -9884,11 +9859,11 @@ class aa {
9884
9859
  { id: `${n.x}|${n.y}|${n.z}`, value: n },
9885
9860
  { id: `${r.x}|${r.y}|${r.z}`, value: r }
9886
9861
  ];
9887
- c.sort((m, F) => m.id < F.id ? -1 : m.id > F.id ? 1 : 0);
9862
+ c.sort((T, F) => T.id < F.id ? -1 : T.id > F.id ? 1 : 0);
9888
9863
  const [
9889
9864
  { id: E, value: d },
9890
9865
  { id: h, value: u },
9891
- { id: p, value: T }
9866
+ { id: p, value: m }
9892
9867
  ] = c, A = [
9893
9868
  {
9894
9869
  id: `${E}|${h}`,
@@ -9897,13 +9872,13 @@ class aa {
9897
9872
  },
9898
9873
  {
9899
9874
  id: `${h}|${p}`,
9900
- distance: u.distanceTo(T),
9901
- points: [u, T]
9875
+ distance: u.distanceTo(m),
9876
+ points: [u, m]
9902
9877
  },
9903
9878
  {
9904
9879
  id: `${E}|${p}`,
9905
- distance: d.distanceTo(T),
9906
- points: [d, T]
9880
+ distance: d.distanceTo(m),
9881
+ points: [d, m]
9907
9882
  }
9908
9883
  ], C = new O.Plane();
9909
9884
  return C.setFromNormalAndCoplanarPoint(a, o), C.constant = Math.round(C.constant * 10) / 10, { plane: C, edges: A };
@@ -9911,7 +9886,7 @@ class aa {
9911
9886
  static getVerticesAndNormal(s, t, e) {
9912
9887
  if (!s.geometry.index)
9913
9888
  throw new Error("Geometry must be indexed!");
9914
- const i = s.geometry.index.array, o = s.geometry.attributes.position.array, n = s.geometry.attributes.normal.array, r = i[t * 3] * 3, a = i[t * 3 + 1] * 3, c = i[t * 3 + 2] * 3, E = new O.Vector3(o[r], o[r + 1], o[r + 2]), d = new O.Vector3(o[a], o[a + 1], o[a + 2]), h = new O.Vector3(o[c], o[c + 1], o[c + 2]), u = new O.Vector3(n[r], n[r + 1], n[r + 2]), p = new O.Vector3(n[a], n[a + 1], n[a + 2]), T = new O.Vector3(n[c], n[c + 1], n[c + 2]), A = (u.x + p.x + T.x) / 3, C = (u.y + p.y + T.y) / 3, m = (u.z + p.z + T.z) / 3, F = new O.Vector3(A, C, m);
9889
+ const i = s.geometry.index.array, o = s.geometry.attributes.position.array, n = s.geometry.attributes.normal.array, r = i[t * 3] * 3, a = i[t * 3 + 1] * 3, c = i[t * 3 + 2] * 3, E = new O.Vector3(o[r], o[r + 1], o[r + 2]), d = new O.Vector3(o[a], o[a + 1], o[a + 2]), h = new O.Vector3(o[c], o[c + 1], o[c + 2]), u = new O.Vector3(n[r], n[r + 1], n[r + 2]), p = new O.Vector3(n[a], n[a + 1], n[a + 2]), m = new O.Vector3(n[c], n[c + 1], n[c + 2]), A = (u.x + p.x + m.x) / 3, C = (u.y + p.y + m.y) / 3, T = (u.z + p.z + m.z) / 3, F = new O.Vector3(A, C, T);
9915
9890
  if (!F.x && !F.y && !F.z && console.log("hey"), e !== void 0 && s instanceof O.InstancedMesh) {
9916
9891
  const f = new O.Matrix4();
9917
9892
  s.getMatrixAt(e, f);
@@ -9934,49 +9909,49 @@ export {
9934
9909
  Rn as BoundingBoxes,
9935
9910
  Cn as Clipper,
9936
9911
  J as Component,
9937
- ui as Components,
9912
+ Ii as Components,
9938
9913
  vr as CullerRenderer,
9939
- fi as Cullers,
9914
+ pi as Cullers,
9940
9915
  Ht as Disposer,
9941
- D as Event,
9916
+ U as Event,
9942
9917
  Vr as FirstPersonMode,
9943
9918
  Ti as FragmentClassifier,
9944
9919
  Fn as FragmentExploder,
9945
9920
  gn as FragmentHider,
9946
9921
  Ci as FragmentIfcLoader,
9947
9922
  at as FragmentManager,
9948
- qr as FragmentPropsStreamConverter,
9923
+ jr as FragmentPropsStreamConverter,
9949
9924
  Sr as Grids,
9950
- oa as IfcCategories,
9925
+ na as IfcCategories,
9951
9926
  Un as IfcCategoryMap,
9952
9927
  Wr as IfcElements,
9953
9928
  On as IfcGeometryTiler,
9954
9929
  kr as IfcJsonExporter,
9955
- ra as IfcPropertiesFinder,
9930
+ oa as IfcPropertiesFinder,
9956
9931
  An as IfcPropertiesManager,
9957
- $r as IfcPropertiesTiler,
9932
+ qr as IfcPropertiesTiler,
9958
9933
  Ft as IfcPropertiesUtils,
9959
- pi as IfcRelationsIndexer,
9960
- jr as IfcStreamingSettings,
9934
+ gs as IfcRelationsIndexer,
9935
+ Qr as IfcStreamingSettings,
9961
9936
  Tn as Materials,
9962
9937
  tn as MaterialsUtils,
9963
- aa as MeasurementUtils,
9938
+ ra as MeasurementUtils,
9964
9939
  Br as MeshCullerRenderer,
9965
9940
  mn as MiniMaps,
9966
9941
  Gr as OrbitMode,
9967
- na as OrthoPerspectiveCamera,
9942
+ ia as OrthoPerspectiveCamera,
9968
9943
  zr as PlanMode,
9969
9944
  Hr as ProjectionManager,
9970
9945
  Bn as PropertiesStreamingSettings,
9971
9946
  We as Raycasters,
9972
9947
  Xe as SimpleCamera,
9973
9948
  Si as SimplePlane,
9974
- ia as SimpleRenderer,
9975
- sa as SimpleScene,
9949
+ sa as SimpleRenderer,
9950
+ ea as SimpleScene,
9976
9951
  mr as SimpleWorld,
9977
9952
  ke as UUID,
9978
- ea as VertexPicker,
9979
- Ii as Worlds,
9953
+ ta as VertexPicker,
9954
+ fi as Worlds,
9980
9955
  pr as isPointInFrontOfPlane,
9981
9956
  fr as obbFromPoints,
9982
9957
  br as readPixelsAsync