@thatopen/components 2.1.16 → 2.1.18

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
@@ -1,39 +1,39 @@
1
- var kn = Object.defineProperty;
2
- var Xn = (l, s, t) => s in l ? kn(l, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[s] = t;
3
- var I = (l, s, t) => (Xn(l, typeof s != "symbol" ? s + "" : s, t), t);
1
+ var Xn = Object.defineProperty;
2
+ var Zn = (l, s, t) => s in l ? Xn(l, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[s] = t;
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 Pn, Vector3 as M, Vector2 as fe, Plane as Fi, Line3 as Lt, Triangle as ue, Sphere as Zn, Matrix4 as yt, Box3 as gt, BackSide as Qn, DoubleSide as Ln, FrontSide as wi, Mesh as v, Ray as jn, Raycaster as qn, Quaternion as Pt, Object3D as ri, Euler as Kn, MeshBasicMaterial as yn, LineBasicMaterial as $n, CylinderGeometry as ct, BoxGeometry as rt, BufferGeometry as Di, Float32BufferAttribute as Ui, OctahedronGeometry as Ze, Line as Dt, SphereGeometry as Jn, TorusGeometry as Re, PlaneGeometry as to } from "three";
5
+ import { BufferAttribute as Pn, Vector3 as M, Vector2 as fe, Plane as Fi, Line3 as Pt, Triangle as ue, Sphere as Qn, Matrix4 as yt, Box3 as gt, BackSide as jn, DoubleSide as yn, FrontSide as wi, Mesh as v, Ray as qn, Raycaster as Kn, Quaternion as Lt, Object3D as ri, Euler as $n, MeshBasicMaterial as Mn, LineBasicMaterial as Jn, CylinderGeometry as ct, BoxGeometry as rt, BufferGeometry as Di, Float32BufferAttribute as Ui, OctahedronGeometry as Ze, Line as Dt, SphereGeometry as to, TorusGeometry as Re, PlaneGeometry as eo } from "three";
6
6
  import * as Vt from "@thatopen/fragments";
7
- import { Serializer as eo } from "@thatopen/fragments";
7
+ import { Serializer as so } from "@thatopen/fragments";
8
8
  import * as U from "web-ifc";
9
- const Mn = 0, so = 1, io = 2, xi = 2, Ys = 1.25, bi = 1, Cs = 6 * 4 + 4 + 4, Us = 65535, no = Math.pow(2, -24), Vs = Symbol("SKIP_GENERATION");
10
- function oo(l) {
9
+ const wn = 0, io = 1, no = 2, xi = 2, Ys = 1.25, bi = 1, Cs = 6 * 4 + 4 + 4, Us = 65535, oo = Math.pow(2, -24), Vs = Symbol("SKIP_GENERATION");
10
+ function ro(l) {
11
11
  return l.index ? l.index.count : l.attributes.position.count;
12
12
  }
13
13
  function Ce(l) {
14
- return oo(l) / 3;
14
+ return ro(l) / 3;
15
15
  }
16
- function ro(l, s = ArrayBuffer) {
16
+ function ao(l, s = ArrayBuffer) {
17
17
  return l > 65535 ? new Uint32Array(new s(4 * l)) : new Uint16Array(new s(2 * l));
18
18
  }
19
- function ao(l, s) {
19
+ function co(l, s) {
20
20
  if (!l.index) {
21
- const t = l.attributes.position.count, e = s.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, i = ro(t, e);
21
+ const t = l.attributes.position.count, e = s.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, i = ao(t, e);
22
22
  l.setIndex(new Pn(i, 1));
23
23
  for (let o = 0; o < t; o++)
24
24
  i[o] = o;
25
25
  }
26
26
  }
27
- function wn(l) {
27
+ function Dn(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 Dn(l) {
34
+ function Un(l) {
35
35
  if (!l.groups || !l.groups.length)
36
- return wn(l);
36
+ return Dn(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;
@@ -49,10 +49,10 @@ function Dn(l) {
49
49
  }
50
50
  return s;
51
51
  }
52
- function co(l) {
52
+ function lo(l) {
53
53
  if (l.groups.length === 0)
54
54
  return !1;
55
- const s = Ce(l), t = Dn(l).sort((o, n) => o.offset - n.offset), e = t[t.length - 1];
55
+ const s = Ce(l), t = Un(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;
@@ -60,7 +60,7 @@ function co(l) {
60
60
  function K(l, s, t) {
61
61
  return t.min.x = s[l], t.min.y = s[l + 1], t.min.z = s[l + 2], t.max.x = s[l + 3], t.max.y = s[l + 4], t.max.z = s[l + 5], t;
62
62
  }
63
- function lo(l) {
63
+ function ho(l) {
64
64
  l[0] = l[1] = l[2] = 1 / 0, l[3] = l[4] = l[5] = -1 / 0;
65
65
  }
66
66
  function vi(l) {
@@ -97,14 +97,14 @@ function Gs(l, s, t, e, i = null) {
97
97
  for (let A = s * 6, F = (s + t) * 6; A < F; A += 6) {
98
98
  const p = l[A + 0], m = l[A + 1], g = p - m, S = p + m;
99
99
  g < o && (o = g), S > a && (a = S), C && p < d && (d = p), C && p > f && (f = p);
100
- const _ = l[A + 2], N = l[A + 3], L = _ - N, D = _ + N;
101
- L < n && (n = L), D > c && (c = D), C && _ < E && (E = _), C && _ > T && (T = _);
100
+ const _ = l[A + 2], N = l[A + 3], P = _ - N, D = _ + N;
101
+ P < n && (n = P), D > c && (c = D), C && _ < E && (E = _), C && _ > T && (T = _);
102
102
  const y = l[A + 4], x = l[A + 5], b = y - x, B = y + x;
103
103
  b < r && (r = b), B > h && (h = B), C && y < u && (u = y), C && y > R && (R = y);
104
104
  }
105
105
  e[0] = o, e[1] = n, e[2] = r, e[3] = a, e[4] = c, e[5] = h, C && (i[0] = d, i[1] = E, i[2] = u, i[3] = f, i[4] = T, i[5] = R);
106
106
  }
107
- function ho(l, s, t, e) {
107
+ function Eo(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;
109
109
  for (let h = s * 6, d = (s + t) * 6; h < d; h += 6) {
110
110
  const E = l[h + 0];
@@ -116,8 +116,8 @@ function ho(l, s, t, e) {
116
116
  }
117
117
  e[0] = i, e[1] = o, e[2] = n, e[3] = r, e[4] = a, e[5] = c;
118
118
  }
119
- function Eo(l, s) {
120
- lo(s);
119
+ function uo(l, s) {
120
+ ho(s);
121
121
  const t = l.attributes.position, e = l.index ? l.index.array : null, i = Ce(l), o = new Float32Array(i * 6), n = t.normalized, r = t.array, a = t.offset || 0;
122
122
  let c = 3;
123
123
  t.isInterleavedBufferAttribute && (c = t.data.stride);
@@ -134,25 +134,25 @@ function Eo(l, s) {
134
134
  let g = A;
135
135
  F > g && (g = F), p > g && (g = p);
136
136
  const S = (g - m) / 2, _ = C * 2;
137
- o[u + _ + 0] = m + S, o[u + _ + 1] = S + (Math.abs(m) + S) * no, m < s[C] && (s[C] = m), g > s[C + 3] && (s[C + 3] = g);
137
+ o[u + _ + 0] = m + S, o[u + _ + 1] = S + (Math.abs(m) + S) * oo, m < s[C] && (s[C] = m), g > s[C + 3] && (s[C + 3] = g);
138
138
  }
139
139
  }
140
140
  return o;
141
141
  }
142
- const Mt = 32, uo = (l, s) => l.candidate - s.candidate, Ut = new Array(Mt).fill().map(() => ({
142
+ const Mt = 32, Io = (l, s) => l.candidate - s.candidate, Ut = new Array(Mt).fill().map(() => ({
143
143
  count: 0,
144
144
  bounds: new Float32Array(6),
145
145
  rightCacheBounds: new Float32Array(6),
146
146
  leftCacheBounds: new Float32Array(6),
147
147
  candidate: 0
148
148
  })), je = new Float32Array(6);
149
- function Io(l, s, t, e, i, o) {
149
+ function fo(l, s, t, e, i, o) {
150
150
  let n = -1, r = 0;
151
- if (o === Mn)
151
+ if (o === wn)
152
152
  n = vi(s), n !== -1 && (r = (s[n] + s[n + 3]) / 2);
153
- else if (o === so)
154
- n = vi(l), n !== -1 && (r = fo(t, e, i, n));
155
- else if (o === io) {
153
+ else if (o === io)
154
+ n = vi(l), n !== -1 && (r = po(t, e, i, n));
155
+ else if (o === no) {
156
156
  const a = Ae(l);
157
157
  let c = Ys * i;
158
158
  const h = e * 6, d = (e + i) * 6;
@@ -174,7 +174,7 @@ function Io(l, s, t, e, i, o) {
174
174
  _[N] = 1 / 0, _[N + 3] = -1 / 0, S[N] = 1 / 0, S[N + 3] = -1 / 0, g[N] = 1 / 0, g[N + 3] = -1 / 0;
175
175
  Qe(p, t, g);
176
176
  }
177
- C.sort(uo);
177
+ C.sort(Io);
178
178
  let F = i;
179
179
  for (let p = 0; p < F; p++) {
180
180
  const m = C[p];
@@ -190,11 +190,11 @@ function Io(l, s, t, e, i, o) {
190
190
  }
191
191
  for (let p = 0; p < F; p++) {
192
192
  const m = C[p], g = m.count, S = i - m.count, _ = m.leftCacheBounds, N = m.rightCacheBounds;
193
- let L = 0;
194
- g !== 0 && (L = Ae(_) / a);
193
+ let P = 0;
194
+ g !== 0 && (P = Ae(_) / a);
195
195
  let D = 0;
196
196
  S !== 0 && (D = Ae(N) / a);
197
- const y = bi + Ys * (L * g + D * S);
197
+ const y = bi + Ys * (P * g + D * S);
198
198
  y < c && (n = E, c = y, r = m.candidate);
199
199
  }
200
200
  } else {
@@ -221,11 +221,11 @@ function Io(l, s, t, e, i, o) {
221
221
  for (let F = 0; F < Mt - 1; F++) {
222
222
  const p = Ut[F], m = p.count, g = p.bounds, _ = Ut[F + 1].rightCacheBounds;
223
223
  m !== 0 && (A === 0 ? Bi(g, je) : Yi(g, je, je)), A += m;
224
- let N = 0, L = 0;
224
+ let N = 0, P = 0;
225
225
  A !== 0 && (N = Ae(je) / a);
226
226
  const D = i - A;
227
- D !== 0 && (L = Ae(_) / a);
228
- const y = bi + Ys * (N * A + L * D);
227
+ D !== 0 && (P = Ae(_) / a);
228
+ const y = bi + Ys * (N * A + P * D);
229
229
  y < c && (n = E, c = y, r = p.candidate);
230
230
  }
231
231
  }
@@ -234,7 +234,7 @@ function Io(l, s, t, e, i, o) {
234
234
  console.warn(`MeshBVH: Invalid build strategy value ${o} used.`);
235
235
  return { axis: n, pos: r };
236
236
  }
237
- function fo(l, s, t, e) {
237
+ function po(l, s, t, e) {
238
238
  let i = 0;
239
239
  for (let o = s, n = s + t; o < n; o++)
240
240
  i += l[o * 6 + e * 2];
@@ -244,7 +244,7 @@ class qe {
244
244
  constructor() {
245
245
  }
246
246
  }
247
- function po(l, s, t, e, i, o) {
247
+ function Co(l, s, t, e, i, o) {
248
248
  let n = e, r = e + i - 1;
249
249
  const a = o.pos, c = o.axis * 2;
250
250
  for (; ; ) {
@@ -266,7 +266,7 @@ function po(l, s, t, e, i, o) {
266
266
  return n;
267
267
  }
268
268
  }
269
- function Co(l, s, t, e, i, o) {
269
+ function To(l, s, t, e, i, o) {
270
270
  let n = e, r = e + i - 1;
271
271
  const a = o.pos, c = o.axis * 2;
272
272
  for (; ; ) {
@@ -286,19 +286,19 @@ function Co(l, s, t, e, i, o) {
286
286
  return n;
287
287
  }
288
288
  }
289
- function To(l, s) {
289
+ function mo(l, s) {
290
290
  const t = (l.index ? l.index.count : l.attributes.position.count) / 3, e = t > 2 ** 16, i = e ? 4 : 2, o = s ? new SharedArrayBuffer(t * i) : new ArrayBuffer(t * i), n = e ? new Uint32Array(o) : new Uint16Array(o);
291
291
  for (let r = 0, a = n.length; r < a; r++)
292
292
  n[r] = r;
293
293
  return n;
294
294
  }
295
- function mo(l, s) {
295
+ function Ro(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), h = l._indirectBuffer;
297
297
  let d = !1;
298
- const E = new Float32Array(6), u = new Float32Array(6), f = Eo(t, E), T = s.indirect ? Co : po, R = [], C = s.indirect ? wn(t) : Dn(t);
298
+ const E = new Float32Array(6), u = new Float32Array(6), f = uo(t, E), T = s.indirect ? To : Co, R = [], C = s.indirect ? Dn(t) : Un(t);
299
299
  if (C.length === 1) {
300
300
  const p = C[0], m = new qe();
301
- m.boundingData = E, ho(f, p.offset, p.count, u), F(m, p.offset, p.count, u), R.push(m);
301
+ m.boundingData = E, Eo(f, p.offset, p.count, u), F(m, p.offset, p.count, u), R.push(m);
302
302
  } else
303
303
  for (let p of C) {
304
304
  const m = new qe();
@@ -311,28 +311,28 @@ function mo(l, s) {
311
311
  function F(p, m, 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
313
  return A(m + g), p.offset = m, p.count = g, p;
314
- const N = Io(p.boundingData, S, f, m, g, r);
314
+ const N = fo(p.boundingData, S, f, m, g, r);
315
315
  if (N.axis === -1)
316
316
  return A(m + g), p.offset = m, p.count = g, p;
317
- const L = T(h, e, f, m, g, N);
318
- if (L === m || L === m + g)
317
+ const P = T(h, e, f, m, g, N);
318
+ if (P === m || P === m + g)
319
319
  A(m + g), p.offset = m, p.count = g;
320
320
  else {
321
321
  p.splitAxis = N.axis;
322
- const D = new qe(), y = m, x = L - m;
322
+ const D = new qe(), y = m, x = P - m;
323
323
  p.left = D, D.boundingData = new Float32Array(6), Gs(f, y, x, D.boundingData, u), F(D, y, x, u, _ + 1);
324
- const b = new qe(), B = L, H = g - x;
324
+ const b = new qe(), B = P, H = g - x;
325
325
  p.right = b, b.boundingData = new Float32Array(6), Gs(f, B, H, b.boundingData, u), F(b, B, H, u, _ + 1);
326
326
  }
327
327
  return p;
328
328
  }
329
329
  }
330
- function Ro(l, s) {
330
+ function Ao(l, s) {
331
331
  const t = l.geometry;
332
- s.indirect && (l._indirectBuffer = To(t, s.useSharedArrayBuffer), co(t) && !s.verbose && console.warn(
332
+ s.indirect && (l._indirectBuffer = mo(t, s.useSharedArrayBuffer), lo(t) && !s.verbose && console.warn(
333
333
  'MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.'
334
- )), l._indirectBuffer || ao(t, s);
335
- const e = mo(l, s);
334
+ )), l._indirectBuffer || co(t, s);
335
+ const e = Ro(l, s);
336
336
  let i, o, n;
337
337
  const r = [], a = s.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer;
338
338
  for (let d = 0; d < e.length; d++) {
@@ -401,7 +401,7 @@ wt.prototype.setFromBox = function() {
401
401
  this.min = n, this.max = r;
402
402
  };
403
403
  }();
404
- const Ao = function() {
404
+ const Fo = function() {
405
405
  const l = new M(), s = new M(), t = new M();
406
406
  return function(i, o, n) {
407
407
  const r = i.start, a = l, c = o.start, h = s;
@@ -413,7 +413,7 @@ const Ao = function() {
413
413
  }(), gi = function() {
414
414
  const l = new fe(), s = new M(), t = new M();
415
415
  return function(i, o, n, r) {
416
- Ao(i, o, l);
416
+ Fo(i, o, l);
417
417
  let a = l.x, c = l.y;
418
418
  if (a >= 0 && a <= 1 && c >= 0 && c <= 1) {
419
419
  i.at(a, n), o.at(c, r);
@@ -439,8 +439,8 @@ const Ao = function() {
439
439
  }
440
440
  }
441
441
  };
442
- }(), Fo = function() {
443
- const l = new M(), s = new M(), t = new Fi(), e = new Lt();
442
+ }(), go = function() {
443
+ const l = new M(), s = new M(), t = new Fi(), e = new Pt();
444
444
  return function(o, n) {
445
445
  const { radius: r, center: a } = o, { a: c, b: h, c: d } = n;
446
446
  if (e.start = c, e.end = h, e.closestPointToPoint(a, !0, l).distanceTo(a) <= r || (e.start = c, e.end = d, e.closestPointToPoint(a, !0, l).distanceTo(a) <= r) || (e.start = h, e.end = d, e.closestPointToPoint(a, !0, l).distanceTo(a) <= r))
@@ -453,16 +453,16 @@ const Ao = function() {
453
453
  }
454
454
  return !1;
455
455
  };
456
- }(), go = 1e-15;
456
+ }(), Oo = 1e-15;
457
457
  function zs(l) {
458
- return Math.abs(l) < go;
458
+ return Math.abs(l) < Oo;
459
459
  }
460
460
  class Ft extends ue {
461
461
  constructor(...s) {
462
- super(...s), this.isExtendedTriangle = !0, this.satAxes = new Array(4).fill().map(() => new M()), this.satBounds = new Array(4).fill().map(() => new wt()), this.points = [this.a, this.b, this.c], this.sphere = new Zn(), this.plane = new Fi(), this.needsUpdate = !0;
462
+ super(...s), this.isExtendedTriangle = !0, this.satAxes = new Array(4).fill().map(() => new M()), this.satBounds = new Array(4).fill().map(() => new wt()), this.points = [this.a, this.b, this.c], this.sphere = new Qn(), this.plane = new Fi(), this.needsUpdate = !0;
463
463
  }
464
464
  intersectsSphere(s) {
465
- return Fo(s, this);
465
+ return go(s, this);
466
466
  }
467
467
  update() {
468
468
  const s = this.a, t = this.b, e = this.c, i = this.points, o = this.satAxes, n = this.satBounds, r = o[0], a = n[0];
@@ -476,7 +476,7 @@ class Ft extends ue {
476
476
  }
477
477
  }
478
478
  Ft.prototype.closestPointToSegment = function() {
479
- const l = new M(), s = new M(), t = new Lt();
479
+ const l = new M(), s = new M(), t = new Pt();
480
480
  return function(i, o = null, n = null) {
481
481
  const { start: r, end: a } = i, c = this.points;
482
482
  let h, d = 1 / 0;
@@ -488,7 +488,7 @@ Ft.prototype.closestPointToSegment = function() {
488
488
  };
489
489
  }();
490
490
  Ft.prototype.intersectsTriangle = function() {
491
- const l = new Ft(), s = new Array(3), t = new Array(3), e = new wt(), i = new wt(), o = new M(), n = new M(), r = new M(), a = new M(), c = new M(), h = new Lt(), d = new Lt(), E = new Lt(), u = new M();
491
+ const l = new Ft(), s = new Array(3), t = new Array(3), e = new wt(), i = new wt(), o = new M(), n = new M(), r = new M(), a = new M(), c = new M(), h = new Pt(), d = new Pt(), E = new Pt(), u = new M();
492
492
  function f(T, R, C) {
493
493
  const A = T.points;
494
494
  let F = 0, p = -1;
@@ -521,22 +521,22 @@ Ft.prototype.intersectsTriangle = function() {
521
521
  const m = this.satBounds, g = this.satAxes;
522
522
  t[0] = R.a, t[1] = R.b, t[2] = R.c;
523
523
  for (let N = 0; N < 4; N++) {
524
- const L = m[N], D = g[N];
525
- if (e.setFromPoints(D, t), L.isSeparated(e))
524
+ const P = m[N], D = g[N];
525
+ if (e.setFromPoints(D, t), P.isSeparated(e))
526
526
  return !1;
527
527
  }
528
528
  const S = R.satBounds, _ = R.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 L = S[N], D = _[N];
532
- if (e.setFromPoints(D, s), L.isSeparated(e))
531
+ const P = S[N], D = _[N];
532
+ if (e.setFromPoints(D, s), P.isSeparated(e))
533
533
  return !1;
534
534
  }
535
535
  for (let N = 0; N < 4; N++) {
536
- const L = g[N];
536
+ const P = g[N];
537
537
  for (let D = 0; D < 4; D++) {
538
538
  const y = _[D];
539
- if (o.crossVectors(L, y), e.setFromPoints(o, s), i.setFromPoints(o, t), e.isSeparated(i))
539
+ if (o.crossVectors(P, y), e.setFromPoints(o, s), i.setFromPoints(o, t), e.isSeparated(i))
540
540
  return !1;
541
541
  }
542
542
  }
@@ -556,8 +556,8 @@ Ft.prototype.intersectsTriangle = function() {
556
556
  let x = E.start;
557
557
  E.start = E.end, E.end = x;
558
558
  }
559
- const S = d.start.dot(r), _ = d.end.dot(r), N = E.start.dot(r), L = E.end.dot(r), D = _ < N, y = S < L;
560
- return S !== L && N !== _ && D === y ? !1 : (C && (c.subVectors(d.start, E.start), c.dot(r) > 0 ? C.start.copy(d.start) : C.start.copy(E.start), c.subVectors(d.end, E.end), c.dot(r) < 0 ? C.end.copy(d.end) : C.end.copy(E.end)), !0);
559
+ const S = d.start.dot(r), _ = d.end.dot(r), N = E.start.dot(r), P = E.end.dot(r), D = _ < N, y = S < P;
560
+ return S !== P && N !== _ && D === y ? !1 : (C && (c.subVectors(d.start, E.start), c.dot(r) > 0 ? C.start.copy(d.start) : C.start.copy(E.start), c.subVectors(d.end, E.end), c.dot(r) < 0 ? C.end.copy(d.end) : C.end.copy(E.end)), !0);
561
561
  }
562
562
  };
563
563
  }();
@@ -568,7 +568,7 @@ Ft.prototype.distanceToPoint = function() {
568
568
  };
569
569
  }();
570
570
  Ft.prototype.distanceToTriangle = function() {
571
- const l = new M(), s = new M(), t = ["a", "b", "c"], e = new Lt(), i = new Lt();
571
+ const l = new M(), s = new M(), t = ["a", "b", "c"], e = new Pt(), i = new Pt();
572
572
  return function(n, r = null, a = null) {
573
573
  const c = r || a ? e : null;
574
574
  if (this.intersectsTriangle(n, c))
@@ -678,7 +678,7 @@ at.prototype.distanceToPoint = function() {
678
678
  };
679
679
  }();
680
680
  at.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 M(), i = new M();
681
+ const l = ["x", "y", "z"], s = new Array(12).fill().map(() => new Pt()), t = new Array(12).fill().map(() => new Pt()), e = new M(), i = new M();
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;
@@ -697,8 +697,8 @@ at.prototype.distanceToBox = function() {
697
697
  for (let A = 0; A <= 1; A++) {
698
698
  const F = (R + 1) % 3, p = (R + 2) % 3, m = C << F | A << p, g = 1 << R | C << F | A << p, S = u[m], _ = u[g];
699
699
  s[T].set(S, _);
700
- const L = l[R], D = l[F], y = l[p], x = t[T], b = x.start, B = x.end;
701
- b[L] = d[L], b[D] = C ? d[D] : E[D], b[y] = A ? d[y] : E[D], B[L] = E[L], B[D] = C ? d[D] : E[D], B[y] = A ? d[y] : E[D], T++;
700
+ const P = l[R], D = l[F], y = l[p], x = t[T], b = x.start, B = x.end;
701
+ b[P] = d[P], b[D] = C ? d[D] : E[D], b[y] = A ? d[y] : E[D], B[P] = E[P], B[D] = C ? d[D] : E[D], B[y] = A ? d[y] : E[D], T++;
702
702
  }
703
703
  for (let R = 0; R <= 1; R++)
704
704
  for (let C = 0; C <= 1; C++)
@@ -733,12 +733,12 @@ class Oi {
733
733
  this._primitives.push(s);
734
734
  }
735
735
  }
736
- class Oo extends Oi {
736
+ class So extends Oi {
737
737
  constructor() {
738
738
  super(() => new Ft());
739
739
  }
740
740
  }
741
- const It = /* @__PURE__ */ new Oo();
741
+ const It = /* @__PURE__ */ new So();
742
742
  function Et(l, s) {
743
743
  return s[l + 15] === 65535;
744
744
  }
@@ -754,10 +754,10 @@ function pt(l) {
754
754
  function Ct(l, s) {
755
755
  return s[l + 6];
756
756
  }
757
- function Un(l, s) {
757
+ function xn(l, s) {
758
758
  return s[l + 7];
759
759
  }
760
- class So {
760
+ class _o {
761
761
  constructor() {
762
762
  this.float32Array = null, this.uint16Array = null, this.uint32Array = null;
763
763
  const s = [];
@@ -769,10 +769,10 @@ class So {
769
769
  };
770
770
  }
771
771
  }
772
- const Z = new So();
772
+ const Z = new _o();
773
773
  let Yt, Ie;
774
774
  const Jt = [], Ke = /* @__PURE__ */ new Oi(() => new gt());
775
- function _o(l, s, t, e, i, o) {
775
+ function No(l, s, t, e, i, o) {
776
776
  Yt = Ke.getPrimitive(), Ie = Ke.getPrimitive(), Jt.push(Yt, Ie), Z.setBuffer(l._roots[s]);
777
777
  const n = ai(0, l.geometry, t, e, i, o);
778
778
  Z.clearBuffer(), Ke.releasePrimitive(Yt), Ke.releasePrimitive(Ie), Jt.pop(), Jt.pop();
@@ -786,7 +786,7 @@ function ai(l, s, t, e, i = null, o = 0, n = 0) {
786
786
  const E = dt(l, c), u = ft(h, a);
787
787
  return K(l, r, Yt), e(E, u, !1, n, o + l, Yt);
788
788
  } else {
789
- let L = function(y) {
789
+ let P = function(y) {
790
790
  const { uint16Array: x, uint32Array: b } = Z;
791
791
  let B = y * 2;
792
792
  for (; !Et(B, x); )
@@ -810,7 +810,7 @@ function ai(l, s, t, e, i = null, o = 0, n = 0) {
810
810
  const p = Et(f * 2, a), m = t(A, p, R, n + 1, o + f);
811
811
  let g;
812
812
  if (m === xi) {
813
- const y = L(f), b = D(f) - y;
813
+ const y = P(f), b = D(f) - y;
814
814
  g = e(y, b, !0, n + 1, o + f, A);
815
815
  } else
816
816
  g = m && ai(
@@ -828,7 +828,7 @@ function ai(l, s, t, e, i = null, o = 0, n = 0) {
828
828
  const S = Et(T * 2, a), _ = t(F, S, C, n + 1, o + T);
829
829
  let N;
830
830
  if (_ === xi) {
831
- const y = L(T), b = D(T) - y;
831
+ const y = P(T), b = D(T) - y;
832
832
  N = e(y, b, !0, n + 1, o + T, F);
833
833
  } else
834
834
  N = _ && ai(
@@ -844,7 +844,7 @@ function ai(l, s, t, e, i = null, o = 0, n = 0) {
844
844
  }
845
845
  }
846
846
  const Fe = /* @__PURE__ */ new M(), Hs = /* @__PURE__ */ new M();
847
- function No(l, s, t = {}, e = 0, i = 1 / 0) {
847
+ function Lo(l, s, t = {}, e = 0, i = 1 / 0) {
848
848
  const o = e * e, n = i * i;
849
849
  let r = 1 / 0, a = null;
850
850
  if (l.shapecast(
@@ -865,12 +865,12 @@ function No(l, s, t = {}, e = 0, i = 1 / 0) {
865
865
  const te = /* @__PURE__ */ new M(), ee = /* @__PURE__ */ new M(), se = /* @__PURE__ */ new M(), $e = /* @__PURE__ */ new fe(), Je = /* @__PURE__ */ new fe(), ts = /* @__PURE__ */ new fe(), Vi = /* @__PURE__ */ new M(), Gi = /* @__PURE__ */ new M(), zi = /* @__PURE__ */ new M(), es = /* @__PURE__ */ new M();
866
866
  function Po(l, s, t, e, i, o) {
867
867
  let n;
868
- return o === Qn ? n = l.intersectTriangle(e, t, s, !0, i) : n = l.intersectTriangle(s, t, e, o !== Ln, i), n === null ? null : {
868
+ return o === jn ? n = l.intersectTriangle(e, t, s, !0, i) : n = l.intersectTriangle(s, t, e, o !== yn, i), n === null ? null : {
869
869
  distance: l.origin.distanceTo(i),
870
870
  point: i.clone()
871
871
  };
872
872
  }
873
- function Lo(l, s, t, e, i, o, n, r, a) {
873
+ function yo(l, s, t, e, i, o, n, r, a) {
874
874
  te.fromBufferAttribute(s, o), ee.fromBufferAttribute(s, n), se.fromBufferAttribute(s, r);
875
875
  const c = Po(l, te, ee, se, es, a);
876
876
  if (c) {
@@ -891,7 +891,7 @@ function xs(l, s, t, e, i) {
891
891
  let n = o + 0, r = o + 1, a = o + 2;
892
892
  const c = l.index;
893
893
  l.index && (n = c.getX(n), r = c.getX(r), a = c.getX(a));
894
- const { position: h, normal: d, uv: E, uv1: u } = l.attributes, f = Lo(t, h, d, E, u, n, r, a, s);
894
+ const { position: h, normal: d, uv: E, uv1: u } = l.attributes, f = yo(t, h, d, E, u, n, r, a, s);
895
895
  return f ? (f.faceIndex = e, i && i.push(f), f) : null;
896
896
  }
897
897
  function tt(l, s, t, e) {
@@ -899,12 +899,12 @@ function tt(l, s, t, e) {
899
899
  let r = s, a = s + 1, c = s + 2;
900
900
  t && (r = t.getX(r), a = t.getX(a), c = t.getX(c)), i.x = e.getX(r), i.y = e.getY(r), i.z = e.getZ(r), o.x = e.getX(a), o.y = e.getY(a), o.z = e.getZ(a), n.x = e.getX(c), n.y = e.getY(c), n.z = e.getZ(c);
901
901
  }
902
- function yo(l, s, t, e, i, o) {
902
+ function Mo(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
905
  xs(n, s, t, a, o);
906
906
  }
907
- function Mo(l, s, t, e, i) {
907
+ function wo(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, h = e + i; c < h; c++) {
@@ -913,7 +913,7 @@ function Mo(l, s, t, e, i) {
913
913
  }
914
914
  return a;
915
915
  }
916
- function wo(l, s, t, e, i, o, n) {
916
+ function Do(l, s, t, e, i, o, n) {
917
917
  const { geometry: r } = t, { index: a } = r, c = r.attributes.position;
918
918
  for (let h = l, d = s + l; h < d; h++) {
919
919
  let E;
@@ -922,7 +922,7 @@ function wo(l, s, t, e, i, o, n) {
922
922
  }
923
923
  return !1;
924
924
  }
925
- function Do(l, s = null) {
925
+ function Uo(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;
@@ -934,7 +934,7 @@ function Do(l, s = null) {
934
934
  if (r[T + 15] === Us) {
935
935
  const C = n[E + 6], A = r[T + 14];
936
936
  let F = 1 / 0, p = 1 / 0, m = 1 / 0, g = -1 / 0, S = -1 / 0, _ = -1 / 0;
937
- for (let N = 3 * C, L = 3 * (C + A); N < L; N++) {
937
+ for (let N = 3 * C, P = 3 * (C + A); N < P; N++) {
938
938
  let D = e[N];
939
939
  const y = i.getX(D), x = i.getY(D), b = i.getZ(D);
940
940
  y < F && (F = y), y > g && (g = y), x < p && (p = x), x > S && (S = x), b < m && (m = b), b > _ && (_ = b);
@@ -945,11 +945,11 @@ function Do(l, s = null) {
945
945
  let m = f, g = !1, S = !1;
946
946
  s ? m || (g = s.has(F), S = s.has(p), m = !g && !S) : (g = !0, S = !0);
947
947
  const _ = m || g, N = m || S;
948
- let L = !1;
949
- _ && (L = d(C, u, m));
948
+ let P = !1;
949
+ _ && (P = d(C, u, m));
950
950
  let D = !1;
951
951
  N && (D = d(A, u, m));
952
- const y = L || D;
952
+ const y = P || D;
953
953
  if (y)
954
954
  for (let x = 0; x < 3; x++) {
955
955
  const b = C + x, B = A + x, H = a[b], q = a[b + 3], st = a[B], Q = a[B + 3];
@@ -963,14 +963,14 @@ const Hi = /* @__PURE__ */ new gt();
963
963
  function Gt(l, s, t, e) {
964
964
  return K(l, s, Hi), t.intersectBox(Hi, e);
965
965
  }
966
- function Uo(l, s, t, e, i, o) {
966
+ function xo(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 h = r ? r[a] : a;
970
970
  xs(n, s, t, h, o);
971
971
  }
972
972
  }
973
- function xo(l, s, t, e, i) {
973
+ function bo(l, s, t, e, i) {
974
974
  const { geometry: o, _indirectBuffer: n } = l;
975
975
  let r = 1 / 0, a = null;
976
976
  for (let c = e, h = e + i; c < h; c++) {
@@ -979,7 +979,7 @@ function xo(l, s, t, e, i) {
979
979
  }
980
980
  return a;
981
981
  }
982
- function bo(l, s, t, e, i, o, n) {
982
+ function vo(l, s, t, e, i, o, n) {
983
983
  const { geometry: r } = t, { index: a } = r, c = r.attributes.position;
984
984
  for (let h = l, d = s + l; h < d; h++) {
985
985
  let E;
@@ -989,14 +989,14 @@ function bo(l, s, t, e, i, o, n) {
989
989
  return !1;
990
990
  }
991
991
  const Wi = /* @__PURE__ */ new M();
992
- function vo(l, s, t, e, i) {
992
+ function Bo(l, s, t, e, i) {
993
993
  Z.setBuffer(l._roots[s]), ci(0, l, t, e, i), Z.clearBuffer();
994
994
  }
995
995
  function ci(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 h = dt(l, r), d = ft(a, n);
999
- yo(s, t, e, h, d, i);
999
+ Mo(s, t, e, h, d, i);
1000
1000
  } else {
1001
1001
  const h = pt(l);
1002
1002
  Gt(h, o, e, Wi) && ci(h, s, t, e, i);
@@ -1004,8 +1004,8 @@ function ci(l, s, t, e, i) {
1004
1004
  Gt(d, o, e, Wi) && ci(d, s, t, e, i);
1005
1005
  }
1006
1006
  }
1007
- const ki = /* @__PURE__ */ new M(), Bo = ["x", "y", "z"];
1008
- function Yo(l, s, t, e) {
1007
+ const ki = /* @__PURE__ */ new M(), Yo = ["x", "y", "z"];
1008
+ function Vo(l, s, t, e) {
1009
1009
  Z.setBuffer(l._roots[s]);
1010
1010
  const i = li(0, l, t, e);
1011
1011
  return Z.clearBuffer(), i;
@@ -1015,9 +1015,9 @@ function li(l, s, t, e) {
1015
1015
  let r = l * 2;
1016
1016
  if (Et(r, o)) {
1017
1017
  const c = dt(l, n), h = ft(r, o);
1018
- return Mo(s, t, e, c, h);
1018
+ return wo(s, t, e, c, h);
1019
1019
  } else {
1020
- const c = Un(l, n), h = Bo[c], E = e.direction[h] >= 0;
1020
+ const c = xn(l, n), h = Yo[c], E = e.direction[h] >= 0;
1021
1021
  let u, f;
1022
1022
  E ? (u = pt(l), f = Ct(l, n)) : (u = Ct(l, n), f = pt(l));
1023
1023
  const R = Gt(u, i, e, ki) ? li(u, s, t, e) : null;
@@ -1034,7 +1034,7 @@ function li(l, s, t, e) {
1034
1034
  }
1035
1035
  }
1036
1036
  const ss = /* @__PURE__ */ new gt(), ie = /* @__PURE__ */ new Ft(), ne = /* @__PURE__ */ new Ft(), ge = /* @__PURE__ */ new yt(), Xi = /* @__PURE__ */ new at(), is = /* @__PURE__ */ new at();
1037
- function Vo(l, s, t, e) {
1037
+ function Go(l, s, t, e) {
1038
1038
  Z.setBuffer(l._roots[s]);
1039
1039
  const i = hi(0, l, t, e);
1040
1040
  return Z.clearBuffer(), i;
@@ -1066,12 +1066,12 @@ function hi(l, s, t, e, i = null) {
1066
1066
  return K(h, o, ss), !!(i.intersectsBox(ss) && hi(h, s, t, e, i) || (K(d, o, ss), i.intersectsBox(ss) && hi(d, s, t, e, i)));
1067
1067
  }
1068
1068
  }
1069
- const ns = /* @__PURE__ */ new yt(), Ws = /* @__PURE__ */ new at(), Oe = /* @__PURE__ */ new at(), Go = /* @__PURE__ */ new M(), zo = /* @__PURE__ */ new M(), Ho = /* @__PURE__ */ new M(), Wo = /* @__PURE__ */ new M();
1070
- function ko(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1069
+ const ns = /* @__PURE__ */ new yt(), Ws = /* @__PURE__ */ new at(), Oe = /* @__PURE__ */ new at(), zo = /* @__PURE__ */ new M(), Ho = /* @__PURE__ */ new M(), Wo = /* @__PURE__ */ new M(), ko = /* @__PURE__ */ new M();
1070
+ function Xo(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1071
1071
  s.boundingBox || s.computeBoundingBox(), Ws.set(s.boundingBox.min, s.boundingBox.max, t), Ws.needsUpdate = !0;
1072
1072
  const r = l.geometry, a = r.attributes.position, c = r.index, h = s.attributes.position, d = s.index, E = It.getPrimitive(), u = It.getPrimitive();
1073
- let f = Go, T = zo, R = null, C = null;
1074
- i && (R = Ho, C = Wo);
1073
+ let f = zo, T = Ho, R = null, C = null;
1074
+ i && (R = Wo, C = ko);
1075
1075
  let A = 1 / 0, F = null, p = null;
1076
1076
  return ns.copy(t).invert(), Oe.matrix.copy(ns), l.shapecast(
1077
1077
  {
@@ -1081,14 +1081,14 @@ function ko(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1081
1081
  if (s.boundsTree)
1082
1082
  return s.boundsTree.shapecast({
1083
1083
  boundsTraverseOrder: (_) => Oe.distanceToBox(_),
1084
- intersectsBounds: (_, N, L) => L < A && L < n,
1084
+ intersectsBounds: (_, N, P) => P < A && P < n,
1085
1085
  intersectsRange: (_, N) => {
1086
- for (let L = _, D = _ + N; L < D; L++) {
1087
- tt(u, 3 * L, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1086
+ for (let P = _, D = _ + N; P < D; P++) {
1087
+ tt(u, 3 * P, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1088
1088
  for (let y = m, x = m + g; y < x; y++) {
1089
1089
  tt(E, 3 * y, c, a), E.needsUpdate = !0;
1090
1090
  const b = E.distanceToTriangle(u, f, R);
1091
- if (b < A && (T.copy(f), C && C.copy(R), A = b, F = y, p = L), b < o)
1091
+ if (b < A && (T.copy(f), C && C.copy(R), A = b, F = y, p = P), b < o)
1092
1092
  return !0;
1093
1093
  }
1094
1094
  }
@@ -1098,10 +1098,10 @@ function ko(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
  tt(u, 3 * _, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1101
- for (let L = m, D = m + g; L < D; L++) {
1102
- tt(E, 3 * L, c, a), E.needsUpdate = !0;
1101
+ for (let P = m, D = m + g; P < D; P++) {
1102
+ tt(E, 3 * P, c, a), E.needsUpdate = !0;
1103
1103
  const y = E.distanceToTriangle(u, f, R);
1104
- if (y < A && (T.copy(f), C && C.copy(R), A = y, F = L, p = _), y < o)
1104
+ if (y < A && (T.copy(f), C && C.copy(R), A = y, F = P, p = _), y < o)
1105
1105
  return !0;
1106
1106
  }
1107
1107
  }
@@ -1110,7 +1110,7 @@ function ko(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1110
1110
  }
1111
1111
  ), It.releasePrimitive(E), It.releasePrimitive(u), A === 1 / 0 ? null : (e.point ? e.point.copy(T) : e.point = T.clone(), e.distance = A, e.faceIndex = F, i && (i.point ? i.point.copy(C) : i.point = C.clone(), i.point.applyMatrix4(ns), T.applyMatrix4(ns), i.distance = T.sub(i.point).length(), i.faceIndex = p), e);
1112
1112
  }
1113
- function Xo(l, s = null) {
1113
+ function Zo(l, s = null) {
1114
1114
  s && Array.isArray(s) && (s = new Set(s));
1115
1115
  const t = l.geometry, e = t.index ? t.index.array : null, i = t.attributes.position;
1116
1116
  let o, n, r, a, c = 0;
@@ -1122,7 +1122,7 @@ function Xo(l, s = null) {
1122
1122
  if (r[T + 15] === Us) {
1123
1123
  const C = n[E + 6], A = r[T + 14];
1124
1124
  let F = 1 / 0, p = 1 / 0, m = 1 / 0, g = -1 / 0, S = -1 / 0, _ = -1 / 0;
1125
- for (let N = C, L = C + A; N < L; N++) {
1125
+ for (let N = C, P = C + A; N < P; N++) {
1126
1126
  const D = 3 * l.resolveTriangleIndex(N);
1127
1127
  for (let y = 0; y < 3; y++) {
1128
1128
  let x = D + y;
@@ -1137,11 +1137,11 @@ function Xo(l, s = null) {
1137
1137
  let m = f, g = !1, S = !1;
1138
1138
  s ? m || (g = s.has(F), S = s.has(p), m = !g && !S) : (g = !0, S = !0);
1139
1139
  const _ = m || g, N = m || S;
1140
- let L = !1;
1141
- _ && (L = d(C, u, m));
1140
+ let P = !1;
1141
+ _ && (P = d(C, u, m));
1142
1142
  let D = !1;
1143
1143
  N && (D = d(A, u, m));
1144
- const y = L || D;
1144
+ const y = P || D;
1145
1145
  if (y)
1146
1146
  for (let x = 0; x < 3; x++) {
1147
1147
  const b = C + x, B = A + x, H = a[b], q = a[b + 3], st = a[B], Q = a[B + 3];
@@ -1152,14 +1152,14 @@ function Xo(l, s = null) {
1152
1152
  }
1153
1153
  }
1154
1154
  const Zi = /* @__PURE__ */ new M();
1155
- function Zo(l, s, t, e, i) {
1155
+ function Qo(l, s, t, e, i) {
1156
1156
  Z.setBuffer(l._roots[s]), Ei(0, l, t, e, i), Z.clearBuffer();
1157
1157
  }
1158
1158
  function Ei(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 h = dt(l, r), d = ft(a, n);
1162
- Uo(s, t, e, h, d, i);
1162
+ xo(s, t, e, h, d, i);
1163
1163
  } else {
1164
1164
  const h = pt(l);
1165
1165
  Gt(h, o, e, Zi) && Ei(h, s, t, e, i);
@@ -1167,8 +1167,8 @@ function Ei(l, s, t, e, i) {
1167
1167
  Gt(d, o, e, Zi) && Ei(d, s, t, e, i);
1168
1168
  }
1169
1169
  }
1170
- const Qi = /* @__PURE__ */ new M(), Qo = ["x", "y", "z"];
1171
- function jo(l, s, t, e) {
1170
+ const Qi = /* @__PURE__ */ new M(), jo = ["x", "y", "z"];
1171
+ function qo(l, s, t, e) {
1172
1172
  Z.setBuffer(l._roots[s]);
1173
1173
  const i = di(0, l, t, e);
1174
1174
  return Z.clearBuffer(), i;
@@ -1178,9 +1178,9 @@ function di(l, s, t, e) {
1178
1178
  let r = l * 2;
1179
1179
  if (Et(r, o)) {
1180
1180
  const c = dt(l, n), h = ft(r, o);
1181
- return xo(s, t, e, c, h);
1181
+ return bo(s, t, e, c, h);
1182
1182
  } else {
1183
- const c = Un(l, n), h = Qo[c], E = e.direction[h] >= 0;
1183
+ const c = xn(l, n), h = jo[c], E = e.direction[h] >= 0;
1184
1184
  let u, f;
1185
1185
  E ? (u = pt(l), f = Ct(l, n)) : (u = Ct(l, n), f = pt(l));
1186
1186
  const R = Gt(u, i, e, Qi) ? di(u, s, t, e) : null;
@@ -1197,7 +1197,7 @@ function di(l, s, t, e) {
1197
1197
  }
1198
1198
  }
1199
1199
  const os = /* @__PURE__ */ new gt(), oe = /* @__PURE__ */ new Ft(), re = /* @__PURE__ */ new Ft(), Se = /* @__PURE__ */ new yt(), ji = /* @__PURE__ */ new at(), rs = /* @__PURE__ */ new at();
1200
- function qo(l, s, t, e) {
1200
+ function Ko(l, s, t, e) {
1201
1201
  Z.setBuffer(l._roots[s]);
1202
1202
  const i = ui(0, l, t, e);
1203
1203
  return Z.clearBuffer(), i;
@@ -1230,12 +1230,12 @@ function ui(l, s, t, e, i = null) {
1230
1230
  return K(h, o, os), !!(i.intersectsBox(os) && ui(h, s, t, e, i) || (K(d, o, os), i.intersectsBox(os) && ui(d, s, t, e, i)));
1231
1231
  }
1232
1232
  }
1233
- const as = /* @__PURE__ */ new yt(), ks = /* @__PURE__ */ new at(), _e = /* @__PURE__ */ new at(), Ko = /* @__PURE__ */ new M(), $o = /* @__PURE__ */ new M(), Jo = /* @__PURE__ */ new M(), tr = /* @__PURE__ */ new M();
1234
- function er(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1233
+ const as = /* @__PURE__ */ new yt(), ks = /* @__PURE__ */ new at(), _e = /* @__PURE__ */ new at(), $o = /* @__PURE__ */ new M(), Jo = /* @__PURE__ */ new M(), tr = /* @__PURE__ */ new M(), er = /* @__PURE__ */ new M();
1234
+ function sr(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1235
1235
  s.boundingBox || s.computeBoundingBox(), ks.set(s.boundingBox.min, s.boundingBox.max, t), ks.needsUpdate = !0;
1236
1236
  const r = l.geometry, a = r.attributes.position, c = r.index, h = s.attributes.position, d = s.index, E = It.getPrimitive(), u = It.getPrimitive();
1237
- let f = Ko, T = $o, R = null, C = null;
1238
- i && (R = Jo, C = tr);
1237
+ let f = $o, T = Jo, R = null, C = null;
1238
+ i && (R = tr, C = er);
1239
1239
  let A = 1 / 0, F = null, p = null;
1240
1240
  return as.copy(t).invert(), _e.matrix.copy(as), l.shapecast(
1241
1241
  {
@@ -1246,16 +1246,16 @@ function er(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1246
1246
  const S = s.boundsTree;
1247
1247
  return S.shapecast({
1248
1248
  boundsTraverseOrder: (_) => _e.distanceToBox(_),
1249
- intersectsBounds: (_, N, L) => L < A && L < n,
1249
+ intersectsBounds: (_, N, P) => P < A && P < n,
1250
1250
  intersectsRange: (_, N) => {
1251
- for (let L = _, D = _ + N; L < D; L++) {
1252
- const y = S.resolveTriangleIndex(L);
1251
+ for (let P = _, D = _ + N; P < D; P++) {
1252
+ const y = S.resolveTriangleIndex(P);
1253
1253
  tt(u, 3 * y, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1254
1254
  for (let x = m, b = m + g; x < b; x++) {
1255
1255
  const B = l.resolveTriangleIndex(x);
1256
1256
  tt(E, 3 * B, c, a), E.needsUpdate = !0;
1257
1257
  const H = E.distanceToTriangle(u, f, R);
1258
- if (H < A && (T.copy(f), C && C.copy(R), A = H, F = x, p = L), H < o)
1258
+ if (H < A && (T.copy(f), C && C.copy(R), A = H, F = x, p = P), H < o)
1259
1259
  return !0;
1260
1260
  }
1261
1261
  }
@@ -1265,11 +1265,11 @@ function er(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
  tt(u, 3 * _, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1268
- for (let L = m, D = m + g; L < D; L++) {
1269
- const y = l.resolveTriangleIndex(L);
1268
+ for (let P = m, D = m + g; P < D; P++) {
1269
+ const y = l.resolveTriangleIndex(P);
1270
1270
  tt(E, 3 * y, c, a), E.needsUpdate = !0;
1271
1271
  const x = E.distanceToTriangle(u, f, R);
1272
- if (x < A && (T.copy(f), C && C.copy(R), A = x, F = L, p = _), x < o)
1272
+ if (x < A && (T.copy(f), C && C.copy(R), A = x, F = P, p = _), x < o)
1273
1273
  return !0;
1274
1274
  }
1275
1275
  }
@@ -1278,12 +1278,12 @@ function er(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1278
1278
  }
1279
1279
  ), It.releasePrimitive(E), It.releasePrimitive(u), A === 1 / 0 ? null : (e.point ? e.point.copy(T) : e.point = T.clone(), e.distance = A, e.faceIndex = F, i && (i.point ? i.point.copy(C) : i.point = C.clone(), i.point.applyMatrix4(as), T.applyMatrix4(as), i.distance = T.sub(i.point).length(), i.faceIndex = p), e);
1280
1280
  }
1281
- function sr() {
1281
+ function ir() {
1282
1282
  return typeof SharedArrayBuffer < "u";
1283
1283
  }
1284
1284
  const be = new Z.constructor(), As = new Z.constructor(), vt = new Oi(() => new gt()), ae = new gt(), ce = new gt(), Xs = new gt(), Zs = new gt();
1285
1285
  let Qs = !1;
1286
- function ir(l, s, t, e) {
1286
+ function nr(l, s, t, e) {
1287
1287
  if (Qs)
1288
1288
  throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");
1289
1289
  Qs = !0;
@@ -1340,8 +1340,8 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1340
1340
  else if (g) {
1341
1341
  const _ = vt.getPrimitive();
1342
1342
  K(s, R, _), _.applyMatrix4(t);
1343
- const N = pt(l), L = Ct(l, f);
1344
- K(N, u, ae), K(L, u, ce);
1343
+ const N = pt(l), P = Ct(l, f);
1344
+ K(N, u, ae), K(P, u, ce);
1345
1345
  const D = _.intersectsBox(ae), y = _.intersectsBox(ce);
1346
1346
  S = D && Tt(
1347
1347
  s,
@@ -1357,7 +1357,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1357
1357
  !h
1358
1358
  ) || y && Tt(
1359
1359
  s,
1360
- L,
1360
+ P,
1361
1361
  e,
1362
1362
  t,
1363
1363
  i,
@@ -1371,8 +1371,8 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1371
1371
  } else {
1372
1372
  const _ = pt(s), N = Ct(s, C);
1373
1373
  K(_, R, Xs), K(N, R, Zs);
1374
- const L = c.intersectsBox(Xs), D = c.intersectsBox(Zs);
1375
- if (L && D)
1374
+ const P = c.intersectsBox(Xs), D = c.intersectsBox(Zs);
1375
+ if (P && D)
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, h = !1) {
1398
1398
  c,
1399
1399
  h
1400
1400
  );
1401
- else if (L)
1401
+ else if (P)
1402
1402
  if (m)
1403
1403
  S = Tt(
1404
1404
  l,
@@ -1541,7 +1541,7 @@ class Si {
1541
1541
  } else
1542
1542
  throw new Error("MeshBVH: Only BufferGeometries are supported.");
1543
1543
  if (t = Object.assign({
1544
- strategy: Mn,
1544
+ strategy: wn,
1545
1545
  maxDepth: 40,
1546
1546
  maxLeafTris: 10,
1547
1547
  verbose: !0,
@@ -1552,14 +1552,14 @@ class Si {
1552
1552
  // undocumented options
1553
1553
  // Whether to skip generating the tree. Used for deserialization.
1554
1554
  [Vs]: !1
1555
- }, t), t.useSharedArrayBuffer && !sr())
1555
+ }, t), t.useSharedArrayBuffer && !ir())
1556
1556
  throw new Error("MeshBVH: SharedArrayBuffer is not available.");
1557
- this.geometry = s, this._roots = null, this._indirectBuffer = null, t[Vs] || (Ro(this, t), !s.boundingBox && t.setBoundingBox && (s.boundingBox = this.getBoundingBox(new gt())));
1557
+ this.geometry = s, this._roots = null, this._indirectBuffer = null, t[Vs] || (Ao(this, t), !s.boundingBox && t.setBoundingBox && (s.boundingBox = this.getBoundingBox(new gt())));
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 ? Xo : Do)(this, s);
1562
+ return (this.indirect ? Zo : Uo)(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);
@@ -1577,7 +1577,7 @@ class Si {
1577
1577
  }
1578
1578
  /* Core Cast Functions */
1579
1579
  raycast(s, t = wi) {
1580
- const e = this._roots, i = this.geometry, o = [], n = t.isMaterial, r = Array.isArray(t), a = i.groups, c = n ? t.side : t, h = this.indirect ? Zo : vo;
1580
+ const e = this._roots, i = this.geometry, o = [], n = t.isMaterial, r = Array.isArray(t), a = i.groups, c = n ? t.side : t, h = this.indirect ? Qo : Bo;
1581
1581
  for (let d = 0, E = e.length; d < E; d++) {
1582
1582
  const u = r ? t[a[d].materialIndex].side : c, f = o.length;
1583
1583
  if (h(this, d, u, s, o), r) {
@@ -1591,7 +1591,7 @@ class Si {
1591
1591
  raycastFirst(s, t = wi) {
1592
1592
  const e = this._roots, i = this.geometry, o = t.isMaterial, n = Array.isArray(t);
1593
1593
  let r = null;
1594
- const a = i.groups, c = o ? t.side : t, h = this.indirect ? jo : Yo;
1594
+ const a = i.groups, c = o ? t.side : t, h = this.indirect ? qo : Vo;
1595
1595
  for (let d = 0, E = e.length; d < E; d++) {
1596
1596
  const u = n ? t[a[d].materialIndex].side : c, f = h(this, d, u, s);
1597
1597
  f != null && (r == null || f.distance < r.distance) && (r = f, n && (f.face.materialIndex = a[d].materialIndex));
@@ -1600,13 +1600,13 @@ class Si {
1600
1600
  }
1601
1601
  intersectsGeometry(s, t) {
1602
1602
  let e = !1;
1603
- const i = this._roots, o = this.indirect ? qo : Vo;
1603
+ const i = this._roots, o = this.indirect ? Ko : Go;
1604
1604
  for (let n = 0, r = i.length; n < r && (e = o(this, n, s, t), !e); n++)
1605
1605
  ;
1606
1606
  return e;
1607
1607
  }
1608
1608
  shapecast(s) {
1609
- const t = It.getPrimitive(), e = this.indirect ? bo : wo;
1609
+ const t = It.getPrimitive(), e = this.indirect ? vo : Do;
1610
1610
  let {
1611
1611
  boundsTraverseOrder: i,
1612
1612
  intersectsBounds: o,
@@ -1622,7 +1622,7 @@ class Si {
1622
1622
  const h = this._roots;
1623
1623
  for (let d = 0, E = h.length; d < E; d++) {
1624
1624
  const u = h[d];
1625
- if (a = _o(this, d, o, n, i, c), a)
1625
+ if (a = No(this, d, o, n, i, c), a)
1626
1626
  break;
1627
1627
  c += u.byteLength;
1628
1628
  }
@@ -1648,7 +1648,7 @@ class Si {
1648
1648
  const f = (T, R, C, A, F, p, m, g) => {
1649
1649
  for (let S = C, _ = C + A; S < _; S++) {
1650
1650
  u(S), h.a.applyMatrix4(t), h.b.applyMatrix4(t), h.c.applyMatrix4(t), h.needsUpdate = !0;
1651
- for (let N = T, L = T + R; N < L; N++)
1651
+ for (let N = T, P = T + R; N < P; N++)
1652
1652
  if (c(N), n.needsUpdate = !0, o(n, h, N, S, F, p, m, g))
1653
1653
  return !0;
1654
1654
  }
@@ -1662,7 +1662,7 @@ class Si {
1662
1662
  } else
1663
1663
  i = f;
1664
1664
  }
1665
- return ir(this, s, t, i);
1665
+ return nr(this, s, t, i);
1666
1666
  }
1667
1667
  /* Derived Cast Functions */
1668
1668
  intersectsBox(s, t) {
@@ -1682,7 +1682,7 @@ class Si {
1682
1682
  );
1683
1683
  }
1684
1684
  closestPointToGeometry(s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1685
- return (this.indirect ? er : ko)(
1685
+ return (this.indirect ? sr : Xo)(
1686
1686
  this,
1687
1687
  s,
1688
1688
  t,
@@ -1693,7 +1693,7 @@ class Si {
1693
1693
  );
1694
1694
  }
1695
1695
  closestPointToPoint(s, t = {}, e = 0, i = 1 / 0) {
1696
- return No(
1696
+ return Lo(
1697
1697
  this,
1698
1698
  s,
1699
1699
  t,
@@ -1710,8 +1710,8 @@ class Si {
1710
1710
  function Ki(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 js = /* @__PURE__ */ new jn(), $i = /* @__PURE__ */ new yt(), nr = v.prototype.raycast;
1714
- function or(l, s) {
1713
+ const js = /* @__PURE__ */ new qn(), $i = /* @__PURE__ */ new yt(), or = v.prototype.raycast;
1714
+ function rr(l, s) {
1715
1715
  if (this.geometry.boundsTree) {
1716
1716
  if (this.material === void 0)
1717
1717
  return;
@@ -1728,12 +1728,12 @@ function or(l, s) {
1728
1728
  }
1729
1729
  }
1730
1730
  } else
1731
- nr.call(this, l, s);
1731
+ or.call(this, l, s);
1732
1732
  }
1733
- function rr(l) {
1733
+ function ar(l) {
1734
1734
  return this.boundsTree = new Si(this, l), this.boundsTree;
1735
1735
  }
1736
- function ar() {
1736
+ function cr() {
1737
1737
  this.boundsTree = null;
1738
1738
  }
1739
1739
  class w {
@@ -1829,7 +1829,7 @@ class Ni extends _i {
1829
1829
  });
1830
1830
  }
1831
1831
  }
1832
- class cr extends Ni {
1832
+ class lr extends Ni {
1833
1833
  constructor() {
1834
1834
  super(...arguments);
1835
1835
  /**
@@ -1840,7 +1840,7 @@ class cr extends Ni {
1840
1840
  I(this, "hasCameraControls", () => "controls" in this);
1841
1841
  }
1842
1842
  }
1843
- class lr extends Ni {
1843
+ class hr extends Ni {
1844
1844
  constructor() {
1845
1845
  super(...arguments);
1846
1846
  /** {@link Updateable.onBeforeUpdate} */
@@ -1958,7 +1958,7 @@ const ve = class ve extends et {
1958
1958
  */
1959
1959
  I(ve, "uuid", "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");
1960
1960
  let zt = ve;
1961
- class hr extends Ni {
1961
+ class Er extends Ni {
1962
1962
  constructor(t) {
1963
1963
  super(t);
1964
1964
  /** {@link Disposable.onDisposed} */
@@ -1974,63 +1974,131 @@ class hr extends Ni {
1974
1974
  this.three.children = [], this.onDisposed.trigger(), this.onDisposed.reset();
1975
1975
  }
1976
1976
  }
1977
- class sa extends Set {
1977
+ class ia extends Set {
1978
+ /**
1979
+ * Constructs a new instance of the DataSet class.
1980
+ *
1981
+ * @param iterable - An optional iterable object to initialize the set with.
1982
+ */
1978
1983
  constructor(t) {
1979
1984
  super(t);
1985
+ /**
1986
+ * An event that is triggered when a new item is added to the set.
1987
+ */
1980
1988
  I(this, "onItemAdded", new w());
1989
+ /**
1990
+ * An event that is triggered when an item is deleted from the set.
1991
+ */
1981
1992
  I(this, "onItemDeleted", new w());
1993
+ /**
1994
+ * An event that is triggered when the set is cleared.
1995
+ */
1982
1996
  I(this, "onCleared", new w());
1983
1997
  }
1998
+ /**
1999
+ * Clears the set and triggers the onCleared event.
2000
+ */
1984
2001
  clear() {
1985
2002
  super.clear(), this.onCleared.trigger();
1986
2003
  }
2004
+ /**
2005
+ * Adds a value to the set and triggers the onItemAdded event.
2006
+ *
2007
+ * @param value - The value to add to the set.
2008
+ * @returns - The set instance.
2009
+ */
1987
2010
  add(t) {
1988
2011
  if (this.has(t))
1989
2012
  return this;
1990
2013
  const i = super.add(t);
1991
2014
  return this.onItemAdded || (this.onItemAdded = new w()), this.onItemAdded.trigger(t), i;
1992
2015
  }
2016
+ /**
2017
+ * Deletes a value from the set and triggers the onItemDeleted event.
2018
+ *
2019
+ * @param value - The value to delete from the set.
2020
+ * @returns - True if the value was successfully deleted, false otherwise.
2021
+ */
1993
2022
  delete(t) {
1994
2023
  const e = super.delete(t);
1995
2024
  return e && this.onItemDeleted.trigger(), e;
1996
2025
  }
2026
+ /**
2027
+ * Clears the set and resets the onItemAdded, onItemDeleted, and onCleared events.
2028
+ */
1997
2029
  dispose() {
1998
2030
  this.clear(), this.onItemAdded.reset(), this.onItemDeleted.reset(), this.onCleared.reset();
1999
2031
  }
2000
2032
  }
2001
- class ia extends Map {
2033
+ class Ji extends Map {
2034
+ /**
2035
+ * Constructs a new DataMap instance.
2036
+ *
2037
+ * @param iterable - An iterable object containing key-value pairs to populate the map.
2038
+ */
2002
2039
  constructor(t) {
2003
2040
  super(t);
2041
+ /**
2042
+ * An event triggered when a new item is set in the map.
2043
+ */
2004
2044
  I(this, "onItemSet", new w());
2045
+ /**
2046
+ * An event triggered when an existing item in the map is updated.
2047
+ */
2005
2048
  I(this, "onItemUpdated", new w());
2049
+ /**
2050
+ * An event triggered when an item is deleted from the map.
2051
+ */
2006
2052
  I(this, "onItemDeleted", new w());
2053
+ /**
2054
+ * An event triggered when the map is cleared.
2055
+ */
2007
2056
  I(this, "onCleared", new w());
2008
2057
  }
2058
+ /**
2059
+ * Clears the map and triggers the onCleared event.
2060
+ */
2009
2061
  clear() {
2010
2062
  super.clear(), this.onCleared.trigger();
2011
2063
  }
2064
+ /**
2065
+ * Sets the value for the specified key in the map and triggers the appropriate event (onItemSet or onItemUpdated).
2066
+ *
2067
+ * @param key - The key of the item to set.
2068
+ * @param value - The value of the item to set.
2069
+ * @returns The DataMap instance.
2070
+ */
2012
2071
  set(t, e) {
2013
2072
  const i = this.has(t), o = super.set(t, e);
2014
2073
  return i ? (this.onItemUpdated || (this.onItemUpdated = new w()), this.onItemUpdated.trigger({ key: t, value: e })) : (this.onItemSet || (this.onItemSet = new w()), this.onItemSet.trigger({ key: t, value: e })), o;
2015
2074
  }
2075
+ /**
2076
+ * Deletes the specified key from the map and triggers the onItemDeleted event if the key was found.
2077
+ *
2078
+ * @param key - The key of the item to delete.
2079
+ * @returns True if the key was found and deleted; otherwise, false.
2080
+ */
2016
2081
  delete(t) {
2017
2082
  const e = super.delete(t);
2018
2083
  return e && this.onItemDeleted.trigger(), e;
2019
2084
  }
2085
+ /**
2086
+ * Clears the map and resets the events.
2087
+ */
2020
2088
  dispose() {
2021
2089
  this.clear(), this.onItemSet.reset(), this.onItemDeleted.reset(), this.onCleared.reset();
2022
2090
  }
2023
2091
  }
2024
- const ms = 0, Er = 1, dr = new M(), Ji = new Lt(), qs = new Fi(), tn = new M(), ls = new ue();
2025
- class ur {
2092
+ const ms = 0, dr = 1, ur = new M(), tn = new Pt(), qs = new Fi(), en = new M(), ls = new ue();
2093
+ class Ir {
2026
2094
  constructor() {
2027
- this.tolerance = -1, this.faces = [], this.newFaces = [], this.assigned = new en(), this.unassigned = new en(), this.vertices = [];
2095
+ this.tolerance = -1, this.faces = [], this.newFaces = [], this.assigned = new sn(), this.unassigned = new sn(), this.vertices = [];
2028
2096
  }
2029
2097
  setFromPoints(s) {
2030
2098
  if (s.length >= 4) {
2031
2099
  this.makeEmpty();
2032
2100
  for (let t = 0, e = s.length; t < e; t++)
2033
- this.vertices.push(new Ir(s[t]));
2101
+ this.vertices.push(new fr(s[t]));
2034
2102
  this.compute();
2035
2103
  }
2036
2104
  return this;
@@ -2070,7 +2138,7 @@ class ur {
2070
2138
  return i !== -1 / 0 ? s.at(i, t) : s.at(o, t), t;
2071
2139
  }
2072
2140
  intersectsRay(s) {
2073
- return this.intersectRay(s, dr) !== null;
2141
+ return this.intersectRay(s, ur) !== null;
2074
2142
  }
2075
2143
  makeEmpty() {
2076
2144
  return this.faces = [], this.vertices = [], this;
@@ -2154,12 +2222,12 @@ class ur {
2154
2222
  }
2155
2223
  const r = e[n], a = i[n];
2156
2224
  let c, h;
2157
- o = 0, Ji.set(r.point, a.point);
2225
+ o = 0, tn.set(r.point, a.point);
2158
2226
  for (let E = 0, u = this.vertices.length; E < u; E++) {
2159
2227
  const f = s[E];
2160
2228
  if (f !== r && f !== a) {
2161
- Ji.closestPointToPoint(f.point, !0, tn);
2162
- const T = tn.distanceToSquared(f.point);
2229
+ tn.closestPointToPoint(f.point, !0, en);
2230
+ const T = en.distanceToSquared(f.point);
2163
2231
  T > o && (o = T, c = f);
2164
2232
  }
2165
2233
  }
@@ -2237,7 +2305,7 @@ class ur {
2237
2305
  // For an edge to be part of the horizon it must join a face that can see
2238
2306
  // 'eyePoint' and a face that cannot see 'eyePoint'.
2239
2307
  computeHorizon(s, t, e, i) {
2240
- this.deleteFaceVertices(e), e.mark = Er;
2308
+ this.deleteFaceVertices(e), e.mark = dr;
2241
2309
  let o;
2242
2310
  t === null ? o = t = e.getEdge(0) : o = t.next;
2243
2311
  do {
@@ -2323,12 +2391,12 @@ class Ks {
2323
2391
  return this.twin = s, s.twin = this, this;
2324
2392
  }
2325
2393
  }
2326
- class Ir {
2394
+ class fr {
2327
2395
  constructor(s) {
2328
2396
  this.point = s, this.prev = null, this.next = null, this.face = null;
2329
2397
  }
2330
2398
  }
2331
- class en {
2399
+ class sn {
2332
2400
  constructor() {
2333
2401
  this.head = null, this.tail = null;
2334
2402
  }
@@ -2375,14 +2443,14 @@ const Ii = [2, 2, 1], fi = [1, 0, 0];
2375
2443
  function Nt(l, s) {
2376
2444
  return l * 3 + s;
2377
2445
  }
2378
- function fr(l) {
2446
+ function pr(l) {
2379
2447
  const s = l.elements;
2380
2448
  let t = 0;
2381
2449
  for (let e = 0; e < 9; e++)
2382
2450
  t += s[e] * s[e];
2383
2451
  return Math.sqrt(t);
2384
2452
  }
2385
- function pr(l) {
2453
+ function Cr(l) {
2386
2454
  const s = l.elements;
2387
2455
  let t = 0;
2388
2456
  for (let e = 0; e < 3; e++) {
@@ -2391,7 +2459,7 @@ function pr(l) {
2391
2459
  }
2392
2460
  return Math.sqrt(t);
2393
2461
  }
2394
- function Cr(l, s) {
2462
+ function Tr(l, s) {
2395
2463
  let t = 0, e = 1;
2396
2464
  const i = l.elements;
2397
2465
  for (let c = 0; c < 3; c++) {
@@ -2407,22 +2475,22 @@ function Cr(l, s) {
2407
2475
  }
2408
2476
  return s.identity(), s.elements[Nt(r, r)] = o, s.elements[Nt(a, a)] = o, s.elements[Nt(a, r)] = n, s.elements[Nt(r, a)] = -n, s;
2409
2477
  }
2410
- function Tr(l, s) {
2478
+ function mr(l, s) {
2411
2479
  let t = 0, e = 0;
2412
2480
  const i = 10;
2413
2481
  s.unitary.identity(), s.diagonal.copy(l);
2414
- const o = s.unitary, n = s.diagonal, r = new O.Matrix3(), a = new O.Matrix3(), c = Number.EPSILON * fr(n);
2415
- for (; e < i && pr(n) > c; )
2416
- Cr(n, r), a.copy(r).transpose(), n.multiply(r), n.premultiply(a), o.multiply(r), ++t > 2 && (e++, t = 0);
2482
+ const o = s.unitary, n = s.diagonal, r = new O.Matrix3(), a = new O.Matrix3(), c = Number.EPSILON * pr(n);
2483
+ for (; e < i && Cr(n) > c; )
2484
+ Tr(n, r), a.copy(r).transpose(), n.multiply(r), n.premultiply(a), o.multiply(r), ++t > 2 && (e++, t = 0);
2417
2485
  return s;
2418
2486
  }
2419
- function mr(l) {
2487
+ function Rr(l) {
2420
2488
  const s = [];
2421
2489
  for (let it = 0; it < l.length - 2; it += 3) {
2422
2490
  const Xt = l[it], J = l[it + 1], $t = l[it + 2];
2423
2491
  s.push(new O.Vector3(Xt, J, $t));
2424
2492
  }
2425
- const t = new ur();
2493
+ const t = new Ir();
2426
2494
  t.setFromPoints(s);
2427
2495
  const e = {
2428
2496
  unitary: new O.Matrix3(),
@@ -2435,8 +2503,8 @@ function mr(l) {
2435
2503
  do
2436
2504
  o.push($t), $t = $t.next;
2437
2505
  while ($t !== J.edge);
2438
- const Hn = o.length - 2;
2439
- for (let Xe = 1, Wn = Hn; Xe <= Wn; Xe++) {
2506
+ const Wn = o.length - 2;
2507
+ for (let Xe = 1, kn = Wn; Xe <= kn; Xe++) {
2440
2508
  const bs = o[0].vertex, vs = o[Xe + 0].vertex, Bs = o[Xe + 1].vertex;
2441
2509
  n.push(bs.point.x, bs.point.y, bs.point.z), n.push(vs.point.x, vs.point.y, vs.point.z), n.push(Bs.point.x, Bs.point.y, Bs.point.z);
2442
2510
  }
@@ -2450,17 +2518,17 @@ function mr(l) {
2450
2518
  }
2451
2519
  f.divideScalar(T), R /= T, C /= T, A /= T, F /= T, p /= T, m /= T, R -= f.x * f.x, C -= f.x * f.y, A -= f.x * f.z, F -= f.y * f.y, p -= f.y * f.z, m -= f.z * f.z;
2452
2520
  const g = new O.Matrix3();
2453
- g.elements[0] = R, g.elements[1] = C, g.elements[2] = A, g.elements[3] = C, g.elements[4] = F, g.elements[5] = p, g.elements[6] = A, g.elements[7] = p, g.elements[8] = m, Tr(g, e);
2454
- const S = e.unitary, _ = new O.Vector3(), N = new O.Vector3(), L = new O.Vector3();
2455
- S.extractBasis(_, N, L);
2521
+ g.elements[0] = R, g.elements[1] = C, g.elements[2] = A, g.elements[3] = C, g.elements[4] = F, g.elements[5] = p, g.elements[6] = A, g.elements[7] = p, g.elements[8] = m, mr(g, e);
2522
+ const S = e.unitary, _ = new O.Vector3(), N = new O.Vector3(), P = new O.Vector3();
2523
+ S.extractBasis(_, N, P);
2456
2524
  let D = -1 / 0, y = -1 / 0, x = -1 / 0, b = 1 / 0, B = 1 / 0, H = 1 / 0;
2457
2525
  for (let it = 0, Xt = s.length; it < Xt; it++) {
2458
2526
  const J = s[it];
2459
- D = Math.max(_.dot(J), D), y = Math.max(N.dot(J), y), x = Math.max(L.dot(J), x), b = Math.min(_.dot(J), b), B = Math.min(N.dot(J), B), H = Math.min(L.dot(J), H);
2527
+ D = Math.max(_.dot(J), D), y = Math.max(N.dot(J), y), x = Math.max(P.dot(J), x), b = Math.min(_.dot(J), b), B = Math.min(N.dot(J), B), H = Math.min(P.dot(J), H);
2460
2528
  }
2461
- _.multiplyScalar(0.5 * (b + D)), N.multiplyScalar(0.5 * (B + y)), L.multiplyScalar(0.5 * (H + x));
2529
+ _.multiplyScalar(0.5 * (b + D)), N.multiplyScalar(0.5 * (B + y)), P.multiplyScalar(0.5 * (H + x));
2462
2530
  const q = new O.Vector3(), st = new O.Vector3(), Q = new O.Matrix3();
2463
- q.add(_).add(N).add(L), st.x = D - b, st.y = y - B, st.z = x - H, st.multiplyScalar(0.5), Q.copy(S);
2531
+ q.add(_).add(N).add(P), st.x = D - b, st.y = y - B, st.z = x - H, st.multiplyScalar(0.5), Q.copy(S);
2464
2532
  const { x: Ht, y: Wt, z: kt } = st, ke = new O.Matrix4();
2465
2533
  ke.makeScale(Ht * 2, Wt * 2, kt * 2);
2466
2534
  const Te = new O.Matrix4();
@@ -2472,7 +2540,7 @@ function mr(l) {
2472
2540
  const me = new O.Matrix4();
2473
2541
  return me.multiply(yi), me.multiply(Mi), me.multiply(Te), me.multiply(ke), { center: q, halfSizes: st, rotation: Q, transformation: me };
2474
2542
  }
2475
- function Rr(l, s, t) {
2543
+ function Ar(l, s, t) {
2476
2544
  const e = [
2477
2545
  l[0] - s[0],
2478
2546
  l[1] - s[1],
@@ -2480,7 +2548,7 @@ function Rr(l, s, t) {
2480
2548
  ];
2481
2549
  return t[0] * e[0] + t[1] * e[1] + t[2] * e[2] > 0;
2482
2550
  }
2483
- class sn {
2551
+ class nn {
2484
2552
  static isTransparent(s) {
2485
2553
  return s.transparent && s.opacity < 1;
2486
2554
  }
@@ -3009,15 +3077,15 @@ const Fs = class Fs {
3009
3077
  this._clock.stop(), this.onDisposed.trigger(), this.onDisposed.reset();
3010
3078
  }
3011
3079
  static setupBVH() {
3012
- O.BufferGeometry.prototype.computeBoundsTree = rr, O.BufferGeometry.prototype.disposeBoundsTree = ar, O.Mesh.prototype.raycast = or;
3080
+ O.BufferGeometry.prototype.computeBoundsTree = ar, O.BufferGeometry.prototype.disposeBoundsTree = cr, O.Mesh.prototype.raycast = rr;
3013
3081
  }
3014
3082
  };
3015
3083
  /**
3016
3084
  * The version of the @thatopen/components library.
3017
3085
  */
3018
- I(Fs, "release", "2.1.16");
3086
+ I(Fs, "release", "2.1.18");
3019
3087
  let pi = Fs;
3020
- class Ar {
3088
+ class Fr {
3021
3089
  constructor(s) {
3022
3090
  I(this, "_event");
3023
3091
  I(this, "_position", new O.Vector2());
@@ -3052,7 +3120,7 @@ class Ar {
3052
3120
  s ? this.dom.addEventListener("pointermove", this.updateMouseInfo) : this.dom.removeEventListener("pointermove", this.updateMouseInfo);
3053
3121
  }
3054
3122
  }
3055
- class Fr {
3123
+ class gr {
3056
3124
  constructor(s, t) {
3057
3125
  /** {@link Component.enabled} */
3058
3126
  I(this, "enabled", !0);
@@ -3075,7 +3143,7 @@ class Fr {
3075
3143
  const e = t.renderer;
3076
3144
  if (!e)
3077
3145
  throw new Error("A renderer is needed for the raycaster to work!");
3078
- this.world = t, this.mouse = new Ar(e.three.domElement), this.components = s;
3146
+ this.world = t, this.mouse = new Fr(e.three.domElement), this.components = s;
3079
3147
  }
3080
3148
  /** {@link Disposable.dispose} */
3081
3149
  dispose() {
@@ -3149,7 +3217,7 @@ const gs = class gs extends et {
3149
3217
  get(t) {
3150
3218
  if (this.list.has(t.uuid))
3151
3219
  return this.list.get(t.uuid);
3152
- const e = new Fr(this.components, t);
3220
+ const e = new gr(this.components, t);
3153
3221
  return this.list.set(t.uuid, e), t.onDisposed.add(() => {
3154
3222
  this.delete(t);
3155
3223
  }), e;
@@ -3178,7 +3246,7 @@ const gs = class gs extends et {
3178
3246
  */
3179
3247
  I(gs, "uuid", "d5d8bdf0-db25-4952-b951-b643af207ace");
3180
3248
  let He = gs;
3181
- class gr extends _i {
3249
+ class Or extends _i {
3182
3250
  constructor() {
3183
3251
  super(...arguments);
3184
3252
  /**
@@ -3278,7 +3346,7 @@ class gr extends _i {
3278
3346
  this._scene = null, this._camera = null, this._renderer = null, this.onDisposed.trigger();
3279
3347
  }
3280
3348
  }
3281
- class oa extends hr {
3349
+ class oa extends Er {
3282
3350
  constructor(t) {
3283
3351
  super(t);
3284
3352
  /** {@link Configurable.isSetup} */
@@ -3322,7 +3390,7 @@ class oa extends hr {
3322
3390
  this.three.add(e, i), this.isSetup = !0, this.onSetup.trigger(this);
3323
3391
  }
3324
3392
  }
3325
- class ra extends lr {
3393
+ class ra extends hr {
3326
3394
  /**
3327
3395
  * Constructor for the SimpleRenderer class.
3328
3396
  *
@@ -3426,7 +3494,7 @@ const V = {
3426
3494
  LEFT: 1,
3427
3495
  RIGHT: 2,
3428
3496
  MIDDLE: 4
3429
- }, P = Object.freeze({
3497
+ }, L = Object.freeze({
3430
3498
  NONE: 0,
3431
3499
  ROTATE: 1,
3432
3500
  TRUCK: 2,
@@ -3455,23 +3523,23 @@ function Zt(l) {
3455
3523
  function bt(l) {
3456
3524
  return l.isOrthographicCamera;
3457
3525
  }
3458
- const he = Math.PI * 2, nn = Math.PI / 2, xn = 1e-5, Ne = Math.PI / 180;
3526
+ const he = Math.PI * 2, on = Math.PI / 2, bn = 1e-5, Ne = Math.PI / 180;
3459
3527
  function mt(l, s, t) {
3460
3528
  return Math.max(s, Math.min(t, l));
3461
3529
  }
3462
- function X(l, s = xn) {
3530
+ function X(l, s = bn) {
3463
3531
  return Math.abs(l) < s;
3464
3532
  }
3465
- function W(l, s, t = xn) {
3533
+ function W(l, s, t = bn) {
3466
3534
  return X(l - s, t);
3467
3535
  }
3468
- function on(l, s) {
3536
+ function rn(l, s) {
3469
3537
  return Math.round(l / s) * s;
3470
3538
  }
3471
- function Pe(l) {
3539
+ function Le(l) {
3472
3540
  return isFinite(l) ? l : l < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;
3473
3541
  }
3474
- function Le(l) {
3542
+ function Pe(l) {
3475
3543
  return Math.abs(l) < Number.MAX_VALUE ? l : l * (1 / 0);
3476
3544
  }
3477
3545
  function hs(l, s, t, e, i = 1 / 0, o) {
@@ -3485,7 +3553,7 @@ function hs(l, s, t, e, i = 1 / 0, o) {
3485
3553
  let u = s + (c + E) * a;
3486
3554
  return h - l > 0 == u > h && (u = h, t.value = (u - h) / o), u;
3487
3555
  }
3488
- function rn(l, s, t, e, i = 1 / 0, o, n) {
3556
+ function an(l, s, t, e, i = 1 / 0, o, n) {
3489
3557
  e = Math.max(1e-4, e);
3490
3558
  const r = 2 / e, a = r * o, c = 1 / (1 + a + 0.48 * a * a + 0.235 * a * a * a);
3491
3559
  let h = s.x, d = s.y, E = s.z, u = l.x - h, f = l.y - d, T = l.z - E;
@@ -3497,8 +3565,8 @@ function rn(l, s, t, e, i = 1 / 0, o, n) {
3497
3565
  h = l.x - u, d = l.y - f, E = l.z - T;
3498
3566
  const g = (t.x + r * u) * o, S = (t.y + r * f) * o, _ = (t.z + r * T) * o;
3499
3567
  t.x = (t.x - r * g) * c, t.y = (t.y - r * S) * c, t.z = (t.z - r * _) * c, n.x = h + (u + g) * c, n.y = d + (f + S) * c, n.z = E + (T + _) * c;
3500
- const N = R - l.x, L = C - l.y, D = A - l.z, y = n.x - R, x = n.y - C, b = n.z - A;
3501
- return N * y + L * x + D * b > 0 && (n.x = R, n.y = C, n.z = A, t.x = (n.x - R) / o, t.y = (n.y - C) / o, t.z = (n.z - A) / o), n;
3568
+ const N = R - l.x, P = C - l.y, D = A - l.z, y = n.x - R, x = n.y - C, b = n.z - A;
3569
+ return N * y + P * x + D * b > 0 && (n.x = R, n.y = C, n.z = A, t.x = (n.x - R) / o, t.y = (n.y - C) / o, t.z = (n.z - A) / o), n;
3502
3570
  }
3503
3571
  function $s(l, s) {
3504
3572
  s.set(0, 0), l.forEach((t) => {
@@ -3508,7 +3576,7 @@ function $s(l, s) {
3508
3576
  function Js(l, s) {
3509
3577
  return bt(l) ? (console.warn(`${s} is not supported in OrthographicCamera`), !0) : !1;
3510
3578
  }
3511
- class Or {
3579
+ class Sr {
3512
3580
  constructor() {
3513
3581
  this._listeners = {};
3514
3582
  }
@@ -3572,9 +3640,9 @@ class Or {
3572
3640
  }
3573
3641
  }
3574
3642
  }
3575
- const Sr = "2.7.3", Es = 1 / 8, bn = typeof window < "u", _r = bn && /Mac/.test(navigator.platform), Nr = !(bn && "PointerEvent" in window);
3576
- let Y, an, ds, ti, lt, G, z, Ee, ye, Ot, St, Qt, cn, ln, ut, Me, de, hn, ei, En, si, ii, us;
3577
- class ot extends Or {
3643
+ const _r = "2.7.3", Es = 1 / 8, vn = typeof window < "u", Nr = vn && /Mac/.test(navigator.platform), Lr = !(vn && "PointerEvent" in window);
3644
+ let Y, cn, ds, ti, lt, G, z, Ee, ye, Ot, St, Qt, ln, hn, ut, Me, de, En, ei, dn, si, ii, us;
3645
+ class ot extends Sr {
3578
3646
  /**
3579
3647
  * Injects THREE as the dependency. You can then proceed to use CameraControls.
3580
3648
  *
@@ -3616,14 +3684,14 @@ class ot extends Or {
3616
3684
  * @category Statics
3617
3685
  */
3618
3686
  static install(s) {
3619
- Y = s.THREE, an = Object.freeze(new Y.Vector3(0, 0, 0)), ds = Object.freeze(new Y.Vector3(0, 1, 0)), ti = Object.freeze(new Y.Vector3(0, 0, 1)), lt = new Y.Vector2(), G = new Y.Vector3(), z = new Y.Vector3(), Ee = new Y.Vector3(), ye = new Y.Vector3(), Ot = new Y.Vector3(), St = new Y.Vector3(), Qt = new Y.Vector3(), cn = new Y.Vector3(), ln = new Y.Vector3(), ut = new Y.Spherical(), Me = new Y.Spherical(), de = new Y.Box3(), hn = new Y.Box3(), ei = new Y.Sphere(), En = new Y.Quaternion(), si = new Y.Quaternion(), ii = new Y.Matrix4(), us = new Y.Raycaster();
3687
+ Y = s.THREE, cn = Object.freeze(new Y.Vector3(0, 0, 0)), ds = Object.freeze(new Y.Vector3(0, 1, 0)), ti = Object.freeze(new Y.Vector3(0, 0, 1)), lt = new Y.Vector2(), G = new Y.Vector3(), z = new Y.Vector3(), Ee = new Y.Vector3(), ye = new Y.Vector3(), Ot = new Y.Vector3(), St = new Y.Vector3(), Qt = new Y.Vector3(), ln = new Y.Vector3(), hn = new Y.Vector3(), ut = new Y.Spherical(), Me = new Y.Spherical(), de = new Y.Box3(), En = new Y.Box3(), ei = new Y.Sphere(), dn = new Y.Quaternion(), si = new Y.Quaternion(), ii = new Y.Matrix4(), us = new Y.Raycaster();
3620
3688
  }
3621
3689
  /**
3622
3690
  * list all ACTIONs
3623
3691
  * @category Statics
3624
3692
  */
3625
3693
  static get ACTION() {
3626
- return P;
3694
+ return L;
3627
3695
  }
3628
3696
  /**
3629
3697
  * Creates a `CameraControls` instance.
@@ -3644,10 +3712,10 @@ class ot extends Or {
3644
3712
  */
3645
3713
  constructor(s, t) {
3646
3714
  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 = () => {
3647
- }, this._enabled = !0, this._state = P.NONE, this._viewport = null, this._changedDolly = 0, this._changedZoom = 0, this._hasRested = !0, this._boundaryEnclosesCamera = !1, this._needsUpdate = !0, this._updatedLastTime = !1, this._elementRect = new DOMRect(), this._isDragging = !1, this._dragNeedsUpdate = !0, this._activePointers = [], this._lockedPointer = null, this._interactiveArea = new DOMRect(0, 0, 1, 1), this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._isUserControllingOffset = !1, this._isUserControllingZoom = !1, this._lastDollyDirection = le.NONE, this._thetaVelocity = { value: 0 }, this._phiVelocity = { value: 0 }, this._radiusVelocity = { value: 0 }, this._targetVelocity = new Y.Vector3(), this._focalOffsetVelocity = new Y.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (p, m, g) => {
3715
+ }, this._enabled = !0, this._state = L.NONE, this._viewport = null, this._changedDolly = 0, this._changedZoom = 0, this._hasRested = !0, this._boundaryEnclosesCamera = !1, this._needsUpdate = !0, this._updatedLastTime = !1, this._elementRect = new DOMRect(), this._isDragging = !1, this._dragNeedsUpdate = !0, this._activePointers = [], this._lockedPointer = null, this._interactiveArea = new DOMRect(0, 0, 1, 1), this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._isUserControllingOffset = !1, this._isUserControllingZoom = !1, this._lastDollyDirection = le.NONE, this._thetaVelocity = { value: 0 }, this._phiVelocity = { value: 0 }, this._radiusVelocity = { value: 0 }, this._targetVelocity = new Y.Vector3(), this._focalOffsetVelocity = new Y.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (p, m, g) => {
3648
3716
  let S, _;
3649
3717
  if (Zt(this._camera)) {
3650
- const N = G.copy(this._camera.position).sub(this._target), L = this._camera.getEffectiveFOV() * Ne, D = N.length() * Math.tan(L * 0.5);
3718
+ const N = G.copy(this._camera.position).sub(this._target), P = this._camera.getEffectiveFOV() * Ne, D = N.length() * Math.tan(P * 0.5);
3651
3719
  S = this.truckSpeed * p * D / this._elementRect.height, _ = this.truckSpeed * m * D / this._elementRect.height;
3652
3720
  } else if (bt(this._camera)) {
3653
3721
  const N = this._camera;
@@ -3659,25 +3727,25 @@ class ot extends Or {
3659
3727
  const g = he * this.azimuthRotateSpeed * p / this._elementRect.height, S = he * this.polarRotateSpeed * m / this._elementRect.height;
3660
3728
  this.rotate(g, S, !0);
3661
3729
  }, this._dollyInternal = (p, m, g) => {
3662
- const S = Math.pow(0.95, -p * this.dollySpeed), _ = this._sphericalEnd.radius, N = this._sphericalEnd.radius * S, L = mt(N, this.minDistance, this.maxDistance), D = L - N;
3663
- this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(N, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(D, !0), this._dollyToNoClamp(L, !0)) : this._dollyToNoClamp(L, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? N : L) - _, this._dollyControlCoord.set(m, g)), this._lastDollyDirection = Math.sign(-p);
3730
+ const S = Math.pow(0.95, -p * this.dollySpeed), _ = this._sphericalEnd.radius, N = this._sphericalEnd.radius * S, P = mt(N, this.minDistance, this.maxDistance), D = P - N;
3731
+ this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(N, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(D, !0), this._dollyToNoClamp(P, !0)) : this._dollyToNoClamp(P, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? N : P) - _, this._dollyControlCoord.set(m, g)), this._lastDollyDirection = Math.sign(-p);
3664
3732
  }, this._zoomInternal = (p, m, g) => {
3665
3733
  const S = Math.pow(0.95, p * this.dollySpeed), _ = this._zoom, N = this._zoom * S;
3666
3734
  this.zoomTo(N, !0), this.dollyToCursor && (this._changedZoom += N - _, this._dollyControlCoord.set(m, g));
3667
- }, typeof Y > "u" && console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."), this._camera = s, this._yAxisUpSpace = new Y.Quaternion().setFromUnitVectors(this._camera.up, ds), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = P.NONE, this._target = new Y.Vector3(), this._targetEnd = this._target.clone(), this._focalOffset = new Y.Vector3(), this._focalOffsetEnd = this._focalOffset.clone(), this._spherical = new Y.Spherical().setFromVector3(G.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)), this._sphericalEnd = this._spherical.clone(), this._lastDistance = this._spherical.radius, this._zoom = this._camera.zoom, this._zoomEnd = this._zoom, this._lastZoom = this._zoom, this._nearPlaneCorners = [
3735
+ }, typeof Y > "u" && console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."), this._camera = s, this._yAxisUpSpace = new Y.Quaternion().setFromUnitVectors(this._camera.up, ds), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = L.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 = [
3668
3736
  new Y.Vector3(),
3669
3737
  new Y.Vector3(),
3670
3738
  new Y.Vector3(),
3671
3739
  new Y.Vector3()
3672
3740
  ], 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 = {
3673
- left: P.ROTATE,
3674
- middle: P.DOLLY,
3675
- right: P.TRUCK,
3676
- wheel: Zt(this._camera) ? P.DOLLY : bt(this._camera) ? P.ZOOM : P.NONE
3741
+ left: L.ROTATE,
3742
+ middle: L.DOLLY,
3743
+ right: L.TRUCK,
3744
+ wheel: Zt(this._camera) ? L.DOLLY : bt(this._camera) ? L.ZOOM : L.NONE
3677
3745
  }, this.touches = {
3678
- one: P.TOUCH_ROTATE,
3679
- two: Zt(this._camera) ? P.TOUCH_DOLLY_TRUCK : bt(this._camera) ? P.TOUCH_ZOOM_TRUCK : P.NONE,
3680
- three: P.TOUCH_TRUCK
3746
+ one: L.TOUCH_ROTATE,
3747
+ two: Zt(this._camera) ? L.TOUCH_DOLLY_TRUCK : bt(this._camera) ? L.TOUCH_ZOOM_TRUCK : L.NONE,
3748
+ three: L.TOUCH_TRUCK
3681
3749
  };
3682
3750
  const e = new Y.Vector2(), i = new Y.Vector2(), o = new Y.Vector2(), n = (p) => {
3683
3751
  if (!this._enabled || !this._domElement)
@@ -3754,7 +3822,7 @@ class ot extends Or {
3754
3822
  if (m && this._disposePointer(m), p.pointerType === "touch")
3755
3823
  switch (this._activePointers.length) {
3756
3824
  case 0:
3757
- this._state = P.NONE;
3825
+ this._state = L.NONE;
3758
3826
  break;
3759
3827
  case 1:
3760
3828
  this._state = this.touches.one;
@@ -3767,45 +3835,45 @@ class ot extends Or {
3767
3835
  break;
3768
3836
  }
3769
3837
  else
3770
- this._state = P.NONE;
3838
+ this._state = L.NONE;
3771
3839
  C();
3772
3840
  }
3773
3841
  }, d = () => {
3774
3842
  const p = this._findPointerById(1);
3775
- p && p === this._lockedPointer || (p && this._disposePointer(p), this._state = P.NONE, C());
3843
+ p && p === this._lockedPointer || (p && this._disposePointer(p), this._state = L.NONE, C());
3776
3844
  };
3777
3845
  let E = -1;
3778
3846
  const u = (p) => {
3779
- if (!this._domElement || !this._enabled || this.mouseButtons.wheel === P.NONE)
3847
+ if (!this._domElement || !this._enabled || this.mouseButtons.wheel === L.NONE)
3780
3848
  return;
3781
3849
  if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
3782
- const N = this._domElement.getBoundingClientRect(), L = p.clientX / N.width, D = p.clientY / N.height;
3783
- if (L < this._interactiveArea.left || L > this._interactiveArea.right || D < this._interactiveArea.top || D > this._interactiveArea.bottom)
3850
+ const N = this._domElement.getBoundingClientRect(), P = p.clientX / N.width, D = p.clientY / N.height;
3851
+ if (P < this._interactiveArea.left || P > this._interactiveArea.right || D < this._interactiveArea.top || D > this._interactiveArea.bottom)
3784
3852
  return;
3785
3853
  }
3786
- if (p.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel === P.ROTATE || this.mouseButtons.wheel === P.TRUCK) {
3854
+ if (p.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel === L.ROTATE || this.mouseButtons.wheel === L.TRUCK) {
3787
3855
  const N = performance.now();
3788
3856
  E - N < 1e3 && this._getClientRect(this._elementRect), E = N;
3789
3857
  }
3790
- const m = _r ? -1 : -3, g = p.deltaMode === 1 ? p.deltaY / m : p.deltaY / (m * 10), S = this.dollyToCursor ? (p.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, _ = this.dollyToCursor ? (p.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
3858
+ const m = Nr ? -1 : -3, g = p.deltaMode === 1 ? p.deltaY / m : p.deltaY / (m * 10), S = this.dollyToCursor ? (p.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, _ = this.dollyToCursor ? (p.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
3791
3859
  switch (this.mouseButtons.wheel) {
3792
- case P.ROTATE: {
3860
+ case L.ROTATE: {
3793
3861
  this._rotateInternal(p.deltaX, p.deltaY), this._isUserControllingRotate = !0;
3794
3862
  break;
3795
3863
  }
3796
- case P.TRUCK: {
3864
+ case L.TRUCK: {
3797
3865
  this._truckInternal(p.deltaX, p.deltaY, !1), this._isUserControllingTruck = !0;
3798
3866
  break;
3799
3867
  }
3800
- case P.OFFSET: {
3868
+ case L.OFFSET: {
3801
3869
  this._truckInternal(p.deltaX, p.deltaY, !0), this._isUserControllingOffset = !0;
3802
3870
  break;
3803
3871
  }
3804
- case P.DOLLY: {
3872
+ case L.DOLLY: {
3805
3873
  this._dollyInternal(-g, S, _), this._isUserControllingDolly = !0;
3806
3874
  break;
3807
3875
  }
3808
- case P.ZOOM: {
3876
+ case L.ZOOM: {
3809
3877
  this._zoomInternal(-g, S, _), this._isUserControllingZoom = !0;
3810
3878
  break;
3811
3879
  }
@@ -3826,8 +3894,8 @@ class ot extends Or {
3826
3894
  if ($s(this._activePointers, lt), this._getClientRect(this._elementRect), e.copy(lt), i.copy(lt), this._activePointers.length >= 2) {
3827
3895
  const g = lt.x - this._activePointers[1].clientX, S = lt.y - this._activePointers[1].clientY, _ = Math.sqrt(g * g + S * S);
3828
3896
  o.set(0, _);
3829
- const N = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, L = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
3830
- i.set(N, L);
3897
+ const N = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, P = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
3898
+ i.set(N, P);
3831
3899
  }
3832
3900
  if (this._state = 0, !p)
3833
3901
  this._lockedPointer && (this._state = this._state | this.mouseButtons.left);
@@ -3845,23 +3913,23 @@ class ot extends Or {
3845
3913
  }
3846
3914
  else
3847
3915
  !this._lockedPointer && (p.buttons & V.LEFT) === V.LEFT && (this._state = this._state | this.mouseButtons.left), (p.buttons & V.MIDDLE) === V.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (p.buttons & V.RIGHT) === V.RIGHT && (this._state = this._state | this.mouseButtons.right);
3848
- ((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" });
3916
+ ((this._state & L.ROTATE) === L.ROTATE || (this._state & L.TOUCH_ROTATE) === L.TOUCH_ROTATE || (this._state & L.TOUCH_DOLLY_ROTATE) === L.TOUCH_DOLLY_ROTATE || (this._state & L.TOUCH_ZOOM_ROTATE) === L.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 & L.TRUCK) === L.TRUCK || (this._state & L.TOUCH_TRUCK) === L.TOUCH_TRUCK || (this._state & L.TOUCH_DOLLY_TRUCK) === L.TOUCH_DOLLY_TRUCK || (this._state & L.TOUCH_ZOOM_TRUCK) === L.TOUCH_ZOOM_TRUCK) && (this._targetEnd.copy(this._target), this._targetVelocity.set(0, 0, 0)), ((this._state & L.DOLLY) === L.DOLLY || (this._state & L.TOUCH_DOLLY) === L.TOUCH_DOLLY || (this._state & L.TOUCH_DOLLY_TRUCK) === L.TOUCH_DOLLY_TRUCK || (this._state & L.TOUCH_DOLLY_OFFSET) === L.TOUCH_DOLLY_OFFSET || (this._state & L.TOUCH_DOLLY_ROTATE) === L.TOUCH_DOLLY_ROTATE) && (this._sphericalEnd.radius = this._spherical.radius, this._radiusVelocity.value = 0), ((this._state & L.ZOOM) === L.ZOOM || (this._state & L.TOUCH_ZOOM) === L.TOUCH_ZOOM || (this._state & L.TOUCH_ZOOM_TRUCK) === L.TOUCH_ZOOM_TRUCK || (this._state & L.TOUCH_ZOOM_OFFSET) === L.TOUCH_ZOOM_OFFSET || (this._state & L.TOUCH_ZOOM_ROTATE) === L.TOUCH_ZOOM_ROTATE) && (this._zoomEnd = this._zoom, this._zoomVelocity.value = 0), ((this._state & L.OFFSET) === L.OFFSET || (this._state & L.TOUCH_OFFSET) === L.TOUCH_OFFSET || (this._state & L.TOUCH_DOLLY_OFFSET) === L.TOUCH_DOLLY_OFFSET || (this._state & L.TOUCH_ZOOM_OFFSET) === L.TOUCH_ZOOM_OFFSET) && (this._focalOffsetEnd.copy(this._focalOffset), this._focalOffsetVelocity.set(0, 0, 0)), this.dispatchEvent({ type: "controlstart" });
3849
3917
  }, R = () => {
3850
3918
  if (!this._enabled || !this._dragNeedsUpdate)
3851
3919
  return;
3852
3920
  this._dragNeedsUpdate = !1, $s(this._activePointers, lt);
3853
3921
  const m = this._domElement && document.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, g = m ? -m.deltaX : i.x - lt.x, S = m ? -m.deltaY : i.y - lt.y;
3854
- if (i.copy(lt), ((this._state & P.ROTATE) === P.ROTATE || (this._state & P.TOUCH_ROTATE) === P.TOUCH_ROTATE || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE || (this._state & P.TOUCH_ZOOM_ROTATE) === P.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(g, S), this._isUserControllingRotate = !0), (this._state & P.DOLLY) === P.DOLLY || (this._state & P.ZOOM) === P.ZOOM) {
3855
- 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;
3856
- (this._state & P.DOLLY) === P.DOLLY ? (this._dollyInternal(L * S * Es, _, N), this._isUserControllingDolly = !0) : (this._zoomInternal(L * S * Es, _, N), this._isUserControllingZoom = !0);
3922
+ if (i.copy(lt), ((this._state & L.ROTATE) === L.ROTATE || (this._state & L.TOUCH_ROTATE) === L.TOUCH_ROTATE || (this._state & L.TOUCH_DOLLY_ROTATE) === L.TOUCH_DOLLY_ROTATE || (this._state & L.TOUCH_ZOOM_ROTATE) === L.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(g, S), this._isUserControllingRotate = !0), (this._state & L.DOLLY) === L.DOLLY || (this._state & L.ZOOM) === L.ZOOM) {
3923
+ 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;
3924
+ (this._state & L.DOLLY) === L.DOLLY ? (this._dollyInternal(P * S * Es, _, N), this._isUserControllingDolly = !0) : (this._zoomInternal(P * S * Es, _, N), this._isUserControllingZoom = !0);
3857
3925
  }
3858
- 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) {
3859
- const _ = lt.x - this._activePointers[1].clientX, N = lt.y - this._activePointers[1].clientY, L = Math.sqrt(_ * _ + N * N), D = o.y - L;
3860
- o.set(0, L);
3926
+ if ((this._state & L.TOUCH_DOLLY) === L.TOUCH_DOLLY || (this._state & L.TOUCH_ZOOM) === L.TOUCH_ZOOM || (this._state & L.TOUCH_DOLLY_TRUCK) === L.TOUCH_DOLLY_TRUCK || (this._state & L.TOUCH_ZOOM_TRUCK) === L.TOUCH_ZOOM_TRUCK || (this._state & L.TOUCH_DOLLY_OFFSET) === L.TOUCH_DOLLY_OFFSET || (this._state & L.TOUCH_ZOOM_OFFSET) === L.TOUCH_ZOOM_OFFSET || (this._state & L.TOUCH_DOLLY_ROTATE) === L.TOUCH_DOLLY_ROTATE || (this._state & L.TOUCH_ZOOM_ROTATE) === L.TOUCH_ZOOM_ROTATE) {
3927
+ const _ = lt.x - this._activePointers[1].clientX, N = lt.y - this._activePointers[1].clientY, P = Math.sqrt(_ * _ + N * N), D = o.y - P;
3928
+ o.set(0, P);
3861
3929
  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;
3862
- (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(D * Es, y, x), this._isUserControllingDolly = !0) : (this._zoomInternal(D * Es, y, x), this._isUserControllingZoom = !0);
3930
+ (this._state & L.TOUCH_DOLLY) === L.TOUCH_DOLLY || (this._state & L.TOUCH_DOLLY_ROTATE) === L.TOUCH_DOLLY_ROTATE || (this._state & L.TOUCH_DOLLY_TRUCK) === L.TOUCH_DOLLY_TRUCK || (this._state & L.TOUCH_DOLLY_OFFSET) === L.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(D * Es, y, x), this._isUserControllingDolly = !0) : (this._zoomInternal(D * Es, y, x), this._isUserControllingZoom = !0);
3863
3931
  }
3864
- ((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" });
3932
+ ((this._state & L.TRUCK) === L.TRUCK || (this._state & L.TOUCH_TRUCK) === L.TOUCH_TRUCK || (this._state & L.TOUCH_DOLLY_TRUCK) === L.TOUCH_DOLLY_TRUCK || (this._state & L.TOUCH_ZOOM_TRUCK) === L.TOUCH_ZOOM_TRUCK) && (this._truckInternal(g, S, !1), this._isUserControllingTruck = !0), ((this._state & L.OFFSET) === L.OFFSET || (this._state & L.TOUCH_OFFSET) === L.TOUCH_OFFSET || (this._state & L.TOUCH_DOLLY_OFFSET) === L.TOUCH_DOLLY_OFFSET || (this._state & L.TOUCH_ZOOM_OFFSET) === L.TOUCH_ZOOM_OFFSET) && (this._truckInternal(g, S, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
3865
3933
  }, C = () => {
3866
3934
  $s(this._activePointers, lt), i.copy(lt), this._dragNeedsUpdate = !1, (this._activePointers.length === 0 || this._activePointers.length === 1 && this._activePointers[0] === this._lockedPointer) && (this._isDragging = !1), this._activePointers.length === 0 && this._domElement && (this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("pointerup", h), this._domElement.ownerDocument.removeEventListener("mouseup", d), this.dispatchEvent({ type: "controlend" }));
3867
3935
  };
@@ -3883,11 +3951,11 @@ class ot extends Or {
3883
3951
  this.unlockPointer();
3884
3952
  };
3885
3953
  this._addAllEventListeners = (p) => {
3886
- this._domElement = p, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", n), Nr && this._domElement.addEventListener("mousedown", r), this._domElement.addEventListener("pointercancel", h), this._domElement.addEventListener("wheel", u, { passive: !1 }), this._domElement.addEventListener("contextmenu", f);
3954
+ this._domElement = p, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", n), Lr && this._domElement.addEventListener("mousedown", r), this._domElement.addEventListener("pointercancel", h), this._domElement.addEventListener("wheel", u, { passive: !1 }), this._domElement.addEventListener("contextmenu", f);
3887
3955
  }, this._removeAllEventListeners = () => {
3888
3956
  this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", n), this._domElement.removeEventListener("mousedown", r), this._domElement.removeEventListener("pointercancel", h), this._domElement.removeEventListener("wheel", u, { passive: !1 }), this._domElement.removeEventListener("contextmenu", f), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("pointerup", h), this._domElement.ownerDocument.removeEventListener("mouseup", d), this._domElement.ownerDocument.removeEventListener("pointerlockchange", A), this._domElement.ownerDocument.removeEventListener("pointerlockerror", F));
3889
3957
  }, this.cancel = () => {
3890
- this._state !== P.NONE && (this._state = P.NONE, this._activePointers.length = 0, C());
3958
+ this._state !== L.NONE && (this._state = L.NONE, this._activePointers.length = 0, C());
3891
3959
  }, t && this.connect(t), this.update(0);
3892
3960
  }
3893
3961
  /**
@@ -4252,11 +4320,11 @@ class ot extends Or {
4252
4320
  fitToBox(s, t, { cover: e = !1, paddingLeft: i = 0, paddingRight: o = 0, paddingBottom: n = 0, paddingTop: r = 0 } = {}) {
4253
4321
  const a = [], c = s.isBox3 ? de.copy(s) : de.setFromObject(s);
4254
4322
  c.isEmpty() && (console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"), Promise.resolve());
4255
- const h = on(this._sphericalEnd.theta, nn), d = on(this._sphericalEnd.phi, nn);
4323
+ const h = rn(this._sphericalEnd.theta, on), d = rn(this._sphericalEnd.phi, on);
4256
4324
  a.push(this.rotateTo(h, d, t));
4257
- const E = G.setFromSpherical(this._sphericalEnd).normalize(), u = En.setFromUnitVectors(E, ti), f = W(Math.abs(E.y), 1);
4325
+ const E = G.setFromSpherical(this._sphericalEnd).normalize(), u = dn.setFromUnitVectors(E, ti), f = W(Math.abs(E.y), 1);
4258
4326
  f && u.multiply(si.setFromAxisAngle(ds, h)), u.multiply(this._yAxisUpSpaceInverse);
4259
- const T = hn.makeEmpty();
4327
+ const T = En.makeEmpty();
4260
4328
  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(ti, E), f && u.premultiply(si.invert()), u.premultiply(this._yAxisUpSpace);
4261
4329
  const R = T.getSize(G), C = T.getCenter(z).applyQuaternion(u);
4262
4330
  if (Zt(this._camera)) {
@@ -4532,7 +4600,7 @@ class ot extends Or {
4532
4600
  * @category Methods
4533
4601
  */
4534
4602
  update(s) {
4535
- const t = this._sphericalEnd.theta - this._spherical.theta, e = this._sphericalEnd.phi - this._spherical.phi, i = this._sphericalEnd.radius - this._spherical.radius, o = cn.subVectors(this._targetEnd, this._target), n = ln.subVectors(this._focalOffsetEnd, this._focalOffset), r = this._zoomEnd - this._zoom;
4603
+ const t = this._sphericalEnd.theta - this._spherical.theta, e = this._sphericalEnd.phi - this._spherical.phi, i = this._sphericalEnd.radius - this._spherical.radius, o = ln.subVectors(this._targetEnd, this._target), n = hn.subVectors(this._focalOffsetEnd, this._focalOffset), r = this._zoomEnd - this._zoom;
4536
4604
  if (X(t))
4537
4605
  this._thetaVelocity.value = 0, this._spherical.theta = this._sphericalEnd.theta;
4538
4606
  else {
@@ -4555,13 +4623,13 @@ class ot extends Or {
4555
4623
  this._targetVelocity.set(0, 0, 0), this._target.copy(this._targetEnd);
4556
4624
  else {
4557
4625
  const d = this._isUserControllingTruck ? this.draggingSmoothTime : this.smoothTime;
4558
- rn(this._target, this._targetEnd, this._targetVelocity, d, this.maxSpeed, s, this._target), this._needsUpdate = !0;
4626
+ an(this._target, this._targetEnd, this._targetVelocity, d, this.maxSpeed, s, this._target), this._needsUpdate = !0;
4559
4627
  }
4560
4628
  if (X(n.x) && X(n.y) && X(n.z))
4561
4629
  this._focalOffsetVelocity.set(0, 0, 0), this._focalOffset.copy(this._focalOffsetEnd);
4562
4630
  else {
4563
4631
  const d = this._isUserControllingOffset ? this.draggingSmoothTime : this.smoothTime;
4564
- rn(this._focalOffset, this._focalOffsetEnd, this._focalOffsetVelocity, d, this.maxSpeed, s, this._focalOffset), this._needsUpdate = !0;
4632
+ an(this._focalOffset, this._focalOffsetEnd, this._focalOffsetVelocity, d, this.maxSpeed, s, this._focalOffset), this._needsUpdate = !0;
4565
4633
  }
4566
4634
  if (X(r))
4567
4635
  this._zoomVelocity.value = 0, this._zoom = this._zoomEnd;
@@ -4603,13 +4671,13 @@ class ot extends Or {
4603
4671
  return JSON.stringify({
4604
4672
  enabled: this._enabled,
4605
4673
  minDistance: this.minDistance,
4606
- maxDistance: Pe(this.maxDistance),
4674
+ maxDistance: Le(this.maxDistance),
4607
4675
  minZoom: this.minZoom,
4608
- maxZoom: Pe(this.maxZoom),
4676
+ maxZoom: Le(this.maxZoom),
4609
4677
  minPolarAngle: this.minPolarAngle,
4610
- maxPolarAngle: Pe(this.maxPolarAngle),
4611
- minAzimuthAngle: Pe(this.minAzimuthAngle),
4612
- maxAzimuthAngle: Pe(this.maxAzimuthAngle),
4678
+ maxPolarAngle: Le(this.maxPolarAngle),
4679
+ minAzimuthAngle: Le(this.minAzimuthAngle),
4680
+ maxAzimuthAngle: Le(this.maxAzimuthAngle),
4613
4681
  smoothTime: this.smoothTime,
4614
4682
  draggingSmoothTime: this.draggingSmoothTime,
4615
4683
  dollySpeed: this.dollySpeed,
@@ -4634,7 +4702,7 @@ class ot extends Or {
4634
4702
  */
4635
4703
  fromJSON(s, t = !1) {
4636
4704
  const e = JSON.parse(s);
4637
- 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;
4705
+ 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;
4638
4706
  }
4639
4707
  /**
4640
4708
  * Attach all internal event handlers to enable drag control.
@@ -4645,7 +4713,7 @@ class ot extends Or {
4645
4713
  console.warn("camera-controls is already connected.");
4646
4714
  return;
4647
4715
  }
4648
- s.setAttribute("data-camera-controls-version", Sr), this._addAllEventListeners(s), this._getClientRect(this._elementRect);
4716
+ s.setAttribute("data-camera-controls-version", _r), this._addAllEventListeners(s), this._getClientRect(this._elementRect);
4649
4717
  }
4650
4718
  /**
4651
4719
  * Detach all internal event handlers to disable drag control.
@@ -4708,7 +4776,7 @@ class ot extends Or {
4708
4776
  if (!(this.colliderMeshes.length >= 1) || Js(this._camera, "_collisionTest"))
4709
4777
  return s;
4710
4778
  const e = this._getTargetDirection(ye);
4711
- ii.lookAt(an, e, this._camera.up);
4779
+ ii.lookAt(cn, e, this._camera.up);
4712
4780
  for (let i = 0; i < 4; i++) {
4713
4781
  const o = z.copy(this._nearPlaneCorners[i]);
4714
4782
  o.applyMatrix4(ii);
@@ -4790,7 +4858,7 @@ class ot extends Or {
4790
4858
  }), e.radius = Math.sqrt(o), e;
4791
4859
  }
4792
4860
  }
4793
- class We extends cr {
4861
+ class We extends lr {
4794
4862
  constructor(t) {
4795
4863
  super(t);
4796
4864
  /** {@link Updateable.onBeforeUpdate} */
@@ -4951,7 +5019,7 @@ const Os = class Os extends et {
4951
5019
  * @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
4952
5020
  */
4953
5021
  create() {
4954
- const t = new gr(this.components), e = t.uuid;
5022
+ const t = new Or(this.components), e = t.uuid;
4955
5023
  if (this.list.has(e))
4956
5024
  throw new Error("There is already a world with this name!");
4957
5025
  return this.list.set(e, t), this.onWorldCreated.trigger(t), t;
@@ -5208,18 +5276,18 @@ const Ss = class Ss extends et {
5208
5276
  * This UUID is used to register the component within the Components system.
5209
5277
  */
5210
5278
  I(Ss, "uuid", "d1e814d5-b81c-4452-87a2-f039375e0489");
5211
- let dn = Ss;
5212
- const jt = new qn(), nt = new M(), xt = new M(), j = new Pt(), un = {
5279
+ let un = Ss;
5280
+ const jt = new Kn(), nt = new M(), xt = new M(), j = new Lt(), In = {
5213
5281
  X: new M(1, 0, 0),
5214
5282
  Y: new M(0, 1, 0),
5215
5283
  Z: new M(0, 0, 1)
5216
- }, ni = { type: "change" }, In = { type: "mouseDown" }, fn = { type: "mouseUp", mode: null }, pn = { type: "objectChange" };
5217
- class Lr extends ri {
5284
+ }, ni = { type: "change" }, fn = { type: "mouseDown" }, pn = { type: "mouseUp", mode: null }, Cn = { type: "objectChange" };
5285
+ class yr extends ri {
5218
5286
  constructor(s, t) {
5219
5287
  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";
5220
- const e = new xr();
5288
+ const e = new br();
5221
5289
  this._gizmo = e, this.add(e);
5222
- const i = new br();
5290
+ const i = new vr();
5223
5291
  this._plane = i, this.add(i);
5224
5292
  const o = this;
5225
5293
  function n(A, F) {
@@ -5234,8 +5302,8 @@ class Lr extends ri {
5234
5302
  }), o[A] = F, i[A] = F, e[A] = F;
5235
5303
  }
5236
5304
  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);
5237
- const r = new M(), a = new M(), c = new Pt(), h = new Pt(), d = new M(), E = new Pt(), u = new M(), f = new M(), T = new M(), R = 0, C = new M();
5238
- n("worldPosition", r), n("worldPositionStart", a), n("worldQuaternion", c), n("worldQuaternionStart", h), n("cameraPosition", d), n("cameraQuaternion", E), n("pointStart", u), n("pointEnd", f), n("rotationAxis", T), n("rotationAngle", R), n("eye", C), this._offset = new M(), this._startNorm = new M(), this._endNorm = new M(), this._cameraScale = new M(), this._parentPosition = new M(), this._parentQuaternion = new Pt(), this._parentQuaternionInv = new Pt(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new Pt(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new Pt(), this._scaleStart = new M(), this._getPointer = yr.bind(this), this._onPointerDown = wr.bind(this), this._onPointerHover = Mr.bind(this), this._onPointerMove = Dr.bind(this), this._onPointerUp = Ur.bind(this), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp);
5305
+ const r = new M(), a = new M(), c = new Lt(), h = new Lt(), d = new M(), E = new Lt(), u = new M(), f = new M(), T = new M(), R = 0, C = new M();
5306
+ n("worldPosition", r), n("worldPositionStart", a), n("worldQuaternion", c), n("worldQuaternionStart", h), n("cameraPosition", d), n("cameraQuaternion", E), n("pointStart", u), n("pointEnd", f), n("rotationAxis", T), n("rotationAngle", R), n("eye", C), this._offset = new M(), this._startNorm = new M(), this._endNorm = new M(), this._cameraScale = new M(), this._parentPosition = new M(), this._parentQuaternion = new Lt(), this._parentQuaternionInv = new Lt(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new Lt(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new Lt(), this._scaleStart = new M(), this._getPointer = Mr.bind(this), this._onPointerDown = Dr.bind(this), this._onPointerHover = wr.bind(this), this._onPointerMove = Ur.bind(this), this._onPointerUp = xr.bind(this), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp);
5239
5307
  }
5240
5308
  // updateMatrixWorld updates key transformation variables
5241
5309
  updateMatrixWorld() {
@@ -5252,7 +5320,7 @@ class Lr extends ri {
5252
5320
  if (!(this.object === void 0 || this.dragging === !0 || s.button !== 0) && this.axis !== null) {
5253
5321
  jt.setFromCamera(s, this.camera);
5254
5322
  const t = oi(this._plane, jt, !0);
5255
- 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, In.mode = this.mode, this.dispatchEvent(In);
5323
+ 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, fn.mode = this.mode, this.dispatchEvent(fn);
5256
5324
  }
5257
5325
  }
5258
5326
  pointerMove(s) {
@@ -5276,13 +5344,13 @@ class Lr extends ri {
5276
5344
  this._offset.copy(this.pointEnd).sub(this.pointStart);
5277
5345
  const r = 20 / this.worldPosition.distanceTo(nt.setFromMatrixPosition(this.camera.matrixWorld));
5278
5346
  let a = !1;
5279
- 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(un[t]), nt.copy(un[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());
5347
+ 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(In[t]), nt.copy(In[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());
5280
5348
  }
5281
- this.dispatchEvent(ni), this.dispatchEvent(pn);
5349
+ this.dispatchEvent(ni), this.dispatchEvent(Cn);
5282
5350
  }
5283
5351
  }
5284
5352
  pointerUp(s) {
5285
- s.button === 0 && (this.dragging && this.axis !== null && (fn.mode = this.mode, this.dispatchEvent(fn)), this.dragging = !1, this.axis = null);
5353
+ s.button === 0 && (this.dragging && this.axis !== null && (pn.mode = this.mode, this.dispatchEvent(pn)), this.dragging = !1, this.axis = null);
5286
5354
  }
5287
5355
  dispose() {
5288
5356
  this.domElement.removeEventListener("pointerdown", this._onPointerDown), this.domElement.removeEventListener("pointermove", this._onPointerHover), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.traverse(function(s) {
@@ -5298,7 +5366,7 @@ class Lr extends ri {
5298
5366
  return this.object = void 0, this.visible = !1, this.axis = null, this;
5299
5367
  }
5300
5368
  reset() {
5301
- this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(ni), this.dispatchEvent(pn), this.pointStart.copy(this.pointEnd));
5369
+ this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(ni), this.dispatchEvent(Cn), this.pointStart.copy(this.pointEnd));
5302
5370
  }
5303
5371
  getRaycaster() {
5304
5372
  return jt;
@@ -5326,7 +5394,7 @@ class Lr extends ri {
5326
5394
  this.space = s;
5327
5395
  }
5328
5396
  }
5329
- function yr(l) {
5397
+ function Mr(l) {
5330
5398
  if (this.domElement.ownerDocument.pointerLockElement)
5331
5399
  return {
5332
5400
  x: 0,
@@ -5342,7 +5410,7 @@ function yr(l) {
5342
5410
  };
5343
5411
  }
5344
5412
  }
5345
- function Mr(l) {
5413
+ function wr(l) {
5346
5414
  if (this.enabled)
5347
5415
  switch (l.pointerType) {
5348
5416
  case "mouse":
@@ -5351,13 +5419,13 @@ function Mr(l) {
5351
5419
  break;
5352
5420
  }
5353
5421
  }
5354
- function wr(l) {
5422
+ function Dr(l) {
5355
5423
  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)));
5356
5424
  }
5357
- function Dr(l) {
5425
+ function Ur(l) {
5358
5426
  this.enabled && this.pointerMove(this._getPointer(l));
5359
5427
  }
5360
- function Ur(l) {
5428
+ function xr(l) {
5361
5429
  this.enabled && (this.domElement.releasePointerCapture(l.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(l)));
5362
5430
  }
5363
5431
  function oi(l, s, t) {
@@ -5367,17 +5435,17 @@ function oi(l, s, t) {
5367
5435
  return e[i];
5368
5436
  return !1;
5369
5437
  }
5370
- const Is = new Kn(), k = new M(0, 1, 0), Cn = new M(0, 0, 0), Tn = new yt(), fs = new Pt(), Rs = new Pt(), _t = new M(), mn = new yt(), Ue = new M(1, 0, 0), qt = new M(0, 1, 0), xe = new M(0, 0, 1), ps = new M(), we = new M(), De = new M();
5371
- class xr extends ri {
5438
+ const Is = new $n(), k = new M(0, 1, 0), Tn = new M(0, 0, 0), mn = new yt(), fs = new Lt(), Rs = new Lt(), _t = new M(), Rn = new yt(), Ue = new M(1, 0, 0), qt = new M(0, 1, 0), xe = new M(0, 0, 1), ps = new M(), we = new M(), De = new M();
5439
+ class br extends ri {
5372
5440
  constructor() {
5373
5441
  super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
5374
- const s = new yn({
5442
+ const s = new Mn({
5375
5443
  depthTest: !1,
5376
5444
  depthWrite: !1,
5377
5445
  fog: !1,
5378
5446
  toneMapped: !1,
5379
5447
  transparent: !0
5380
- }), t = new $n({
5448
+ }), t = new Jn({
5381
5449
  depthTest: !1,
5382
5450
  depthWrite: !1,
5383
5451
  fog: !1,
@@ -5513,9 +5581,9 @@ class xr extends ri {
5513
5581
  AXIS: [
5514
5582
  [new Dt(C, i.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
5515
5583
  ]
5516
- }, L = {
5584
+ }, P = {
5517
5585
  XYZE: [
5518
- [new v(new Jn(0.25, 10, 8), e)]
5586
+ [new v(new to(0.25, 10, 8), e)]
5519
5587
  ],
5520
5588
  X: [
5521
5589
  [new v(new Re(0.5, 0.1, 4, 24), e), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
@@ -5604,7 +5672,7 @@ class xr extends ri {
5604
5672
  }
5605
5673
  return H;
5606
5674
  }
5607
- this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = b(m)), this.add(this.gizmo.rotate = b(_)), this.add(this.gizmo.scale = b(D)), 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;
5675
+ this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = b(m)), this.add(this.gizmo.rotate = b(_)), this.add(this.gizmo.scale = b(D)), this.add(this.picker.translate = b(g)), this.add(this.picker.rotate = b(P)), 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;
5608
5676
  }
5609
5677
  // updateMatrixWorld will update transformations and appearance of individual handles
5610
5678
  updateMatrixWorld(s) {
@@ -5617,21 +5685,21 @@ class xr extends ri {
5617
5685
  n.visible = !0, n.rotation.set(0, 0, 0), n.position.copy(this.worldPosition);
5618
5686
  let r;
5619
5687
  if (this.camera.isOrthographicCamera ? r = (this.camera.top - this.camera.bottom) / this.camera.zoom : r = this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), n.scale.set(1, 1, 1).multiplyScalar(r * this.size / 4), n.tag === "helper") {
5620
- n.visible = !1, n.name === "AXIS" ? (n.visible = !!this.axis, this.axis === "X" && (j.setFromEuler(Is.set(0, 0, 0)), n.quaternion.copy(e).multiply(j), Math.abs(k.copy(Ue).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Y" && (j.setFromEuler(Is.set(0, 0, Math.PI / 2)), n.quaternion.copy(e).multiply(j), Math.abs(k.copy(qt).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Z" && (j.setFromEuler(Is.set(0, Math.PI / 2, 0)), n.quaternion.copy(e).multiply(j), Math.abs(k.copy(xe).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "XYZE" && (j.setFromEuler(Is.set(0, Math.PI / 2, 0)), k.copy(this.rotationAxis), n.quaternion.setFromRotationMatrix(Tn.lookAt(Cn, k, qt)), n.quaternion.multiply(j), n.visible = this.dragging), this.axis === "E" && (n.visible = !1)) : n.name === "START" ? (n.position.copy(this.worldPositionStart), n.visible = this.dragging) : n.name === "END" ? (n.position.copy(this.worldPosition), n.visible = this.dragging) : n.name === "DELTA" ? (n.position.copy(this.worldPositionStart), n.quaternion.copy(this.worldQuaternionStart), nt.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), nt.applyQuaternion(this.worldQuaternionStart.clone().invert()), n.scale.copy(nt), n.visible = this.dragging) : (n.quaternion.copy(e), this.dragging ? n.position.copy(this.worldPositionStart) : n.position.copy(this.worldPosition), this.axis && (n.visible = this.axis.search(n.name) !== -1));
5688
+ n.visible = !1, n.name === "AXIS" ? (n.visible = !!this.axis, this.axis === "X" && (j.setFromEuler(Is.set(0, 0, 0)), n.quaternion.copy(e).multiply(j), Math.abs(k.copy(Ue).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Y" && (j.setFromEuler(Is.set(0, 0, Math.PI / 2)), n.quaternion.copy(e).multiply(j), Math.abs(k.copy(qt).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Z" && (j.setFromEuler(Is.set(0, Math.PI / 2, 0)), n.quaternion.copy(e).multiply(j), Math.abs(k.copy(xe).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "XYZE" && (j.setFromEuler(Is.set(0, Math.PI / 2, 0)), k.copy(this.rotationAxis), n.quaternion.setFromRotationMatrix(mn.lookAt(Tn, k, qt)), n.quaternion.multiply(j), n.visible = this.dragging), this.axis === "E" && (n.visible = !1)) : n.name === "START" ? (n.position.copy(this.worldPositionStart), n.visible = this.dragging) : n.name === "END" ? (n.position.copy(this.worldPosition), n.visible = this.dragging) : n.name === "DELTA" ? (n.position.copy(this.worldPositionStart), n.quaternion.copy(this.worldQuaternionStart), nt.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), nt.applyQuaternion(this.worldQuaternionStart.clone().invert()), n.scale.copy(nt), n.visible = this.dragging) : (n.quaternion.copy(e), this.dragging ? n.position.copy(this.worldPositionStart) : n.position.copy(this.worldPosition), this.axis && (n.visible = this.axis.search(n.name) !== -1));
5621
5689
  continue;
5622
5690
  }
5623
- n.quaternion.copy(e), this.mode === "translate" || this.mode === "scale" ? (n.name === "X" && Math.abs(k.copy(Ue).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Y" && Math.abs(k.copy(qt).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Z" && Math.abs(k.copy(xe).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XY" && Math.abs(k.copy(xe).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "YZ" && Math.abs(k.copy(Ue).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XZ" && Math.abs(k.copy(qt).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1)) : this.mode === "rotate" && (fs.copy(e), k.copy(this.eye).applyQuaternion(j.copy(e).invert()), n.name.search("E") !== -1 && n.quaternion.setFromRotationMatrix(Tn.lookAt(this.eye, Cn, qt)), n.name === "X" && (j.setFromAxisAngle(Ue, Math.atan2(-k.y, k.z)), j.multiplyQuaternions(fs, j), n.quaternion.copy(j)), n.name === "Y" && (j.setFromAxisAngle(qt, Math.atan2(k.x, k.z)), j.multiplyQuaternions(fs, j), n.quaternion.copy(j)), n.name === "Z" && (j.setFromAxisAngle(xe, Math.atan2(k.y, k.x)), j.multiplyQuaternions(fs, j), n.quaternion.copy(j))), n.visible = n.visible && (n.name.indexOf("X") === -1 || this.showX), n.visible = n.visible && (n.name.indexOf("Y") === -1 || this.showY), n.visible = n.visible && (n.name.indexOf("Z") === -1 || this.showZ), n.visible = n.visible && (n.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), n.material._color = n.material._color || n.material.color.clone(), n.material._opacity = n.material._opacity || n.material.opacity, n.material.color.copy(n.material._color), n.material.opacity = n.material._opacity, this.enabled && this.axis && (n.name === this.axis || this.axis.split("").some(function(a) {
5691
+ n.quaternion.copy(e), this.mode === "translate" || this.mode === "scale" ? (n.name === "X" && Math.abs(k.copy(Ue).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Y" && Math.abs(k.copy(qt).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Z" && Math.abs(k.copy(xe).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XY" && Math.abs(k.copy(xe).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "YZ" && Math.abs(k.copy(Ue).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XZ" && Math.abs(k.copy(qt).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1)) : this.mode === "rotate" && (fs.copy(e), k.copy(this.eye).applyQuaternion(j.copy(e).invert()), n.name.search("E") !== -1 && n.quaternion.setFromRotationMatrix(mn.lookAt(this.eye, Tn, qt)), n.name === "X" && (j.setFromAxisAngle(Ue, Math.atan2(-k.y, k.z)), j.multiplyQuaternions(fs, j), n.quaternion.copy(j)), n.name === "Y" && (j.setFromAxisAngle(qt, Math.atan2(k.x, k.z)), j.multiplyQuaternions(fs, j), n.quaternion.copy(j)), n.name === "Z" && (j.setFromAxisAngle(xe, Math.atan2(k.y, k.x)), j.multiplyQuaternions(fs, j), n.quaternion.copy(j))), n.visible = n.visible && (n.name.indexOf("X") === -1 || this.showX), n.visible = n.visible && (n.name.indexOf("Y") === -1 || this.showY), n.visible = n.visible && (n.name.indexOf("Z") === -1 || this.showZ), n.visible = n.visible && (n.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), n.material._color = n.material._color || n.material.color.clone(), n.material._opacity = n.material._opacity || n.material.opacity, n.material.color.copy(n.material._color), n.material.opacity = n.material._opacity, this.enabled && this.axis && (n.name === this.axis || this.axis.split("").some(function(a) {
5624
5692
  return n.name === a;
5625
5693
  })) && (n.material.color.setHex(16776960), n.material.opacity = 1);
5626
5694
  }
5627
5695
  super.updateMatrixWorld(s);
5628
5696
  }
5629
5697
  }
5630
- class br extends v {
5698
+ class vr extends v {
5631
5699
  constructor() {
5632
5700
  super(
5633
- new to(1e5, 1e5, 2, 2),
5634
- new yn({ visible: !1, wireframe: !0, side: Ln, transparent: !0, opacity: 0.1, toneMapped: !1 })
5701
+ new eo(1e5, 1e5, 2, 2),
5702
+ new Mn({ visible: !1, wireframe: !0, side: yn, transparent: !0, opacity: 0.1, toneMapped: !1 })
5635
5703
  ), this.isTransformControlsPlane = !0, this.type = "TransformControlsPlane";
5636
5704
  }
5637
5705
  updateMatrixWorld(s) {
@@ -5668,10 +5736,10 @@ class br extends v {
5668
5736
  default:
5669
5737
  _t.set(0, 0, 0);
5670
5738
  }
5671
- _t.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (mn.lookAt(nt.set(0, 0, 0), _t, k), this.quaternion.setFromRotationMatrix(mn)), super.updateMatrixWorld(s);
5739
+ _t.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (Rn.lookAt(nt.set(0, 0, 0), _t, k), this.quaternion.setFromRotationMatrix(Rn)), super.updateMatrixWorld(s);
5672
5740
  }
5673
5741
  }
5674
- class Pi {
5742
+ class Li {
5675
5743
  constructor(s, t, e, i, o, n = 5, r = !0) {
5676
5744
  /** Event that fires when the user starts dragging a clipping plane. */
5677
5745
  I(this, "onDraggingStarted", new w());
@@ -5719,7 +5787,7 @@ class Pi {
5719
5787
  });
5720
5788
  if (this.components = s, this.world = t, !t.renderer)
5721
5789
  throw new Error("The given world must have a renderer!");
5722
- this.normal = i, this.origin = e, t.renderer.setPlane(!0, this.three), this._planeMesh = Pi.newPlaneMesh(n, o), this._helper = this.newHelper(), this._controls = this.newTransformControls(), this.three.setFromNormalAndCoplanarPoint(i, e), r && this.toggleControls(!0);
5790
+ this.normal = i, this.origin = e, t.renderer.setPlane(!0, this.three), this._planeMesh = Li.newPlaneMesh(n, o), this._helper = this.newHelper(), this._controls = this.newTransformControls(), this.three.setFromNormalAndCoplanarPoint(i, e), r && this.toggleControls(!0);
5723
5791
  }
5724
5792
  /**
5725
5793
  * Getter for the enabled state of the clipping plane.
@@ -5809,7 +5877,7 @@ class Pi {
5809
5877
  newTransformControls() {
5810
5878
  if (!this.world.renderer)
5811
5879
  throw new Error("No renderer found for clipping plane!");
5812
- const s = this.world.camera.three, t = this.world.renderer.three.domElement, e = new Lr(s, t);
5880
+ const s = this.world.camera.three, t = this.world.renderer.three.domElement, e = new yr(s, t);
5813
5881
  return this.initializeControls(e), this.world.scene.three.add(e), e;
5814
5882
  }
5815
5883
  initializeControls(s) {
@@ -5885,7 +5953,7 @@ const Be = class Be extends et {
5885
5953
  * The type of clipping plane to be created.
5886
5954
  * Default is {@link SimplePlane}.
5887
5955
  */
5888
- I(this, "Type", Pi);
5956
+ I(this, "Type", Li);
5889
5957
  /**
5890
5958
  * A list of all the clipping planes created by this component.
5891
5959
  */
@@ -6074,8 +6142,8 @@ const Be = class Be extends et {
6074
6142
  * This UUID is used to register the component within the Components system.
6075
6143
  */
6076
6144
  I(Be, "uuid", "66290bc5-18c4-4cd1-9379-2e17a0617611");
6077
- let Rn = Be;
6078
- function vr(l, s, t, e) {
6145
+ let An = Be;
6146
+ function Br(l, s, t, e) {
6079
6147
  return new Promise((i, o) => {
6080
6148
  function n() {
6081
6149
  const r = l.clientWaitSync(s, t, 0);
@@ -6092,15 +6160,15 @@ function vr(l, s, t, e) {
6092
6160
  n();
6093
6161
  });
6094
6162
  }
6095
- async function Br(l, s, t, e, i, o, n) {
6163
+ async function Yr(l, s, t, e, i, o, n) {
6096
6164
  const r = l.fenceSync(l.SYNC_GPU_COMMANDS_COMPLETE, 0);
6097
- l.flush(), await vr(l, r, 0, 10), l.deleteSync(r), l.bindBuffer(s, t), l.getBufferSubData(s, e, i, o, n), l.bindBuffer(s, null);
6165
+ l.flush(), await Br(l, r, 0, 10), l.deleteSync(r), l.bindBuffer(s, t), l.getBufferSubData(s, e, i, o, n), l.bindBuffer(s, null);
6098
6166
  }
6099
- async function Yr(l, s, t, e, i, o, n, r) {
6167
+ async function Vr(l, s, t, e, i, o, n, r) {
6100
6168
  const a = l.createBuffer();
6101
- return l.bindBuffer(l.PIXEL_PACK_BUFFER, a), l.bufferData(l.PIXEL_PACK_BUFFER, r.byteLength, l.STREAM_READ), l.readPixels(s, t, e, i, o, n, 0), l.bindBuffer(l.PIXEL_PACK_BUFFER, null), await Br(l, l.PIXEL_PACK_BUFFER, a, 0, r), l.deleteBuffer(a), r;
6169
+ return l.bindBuffer(l.PIXEL_PACK_BUFFER, a), l.bufferData(l.PIXEL_PACK_BUFFER, r.byteLength, l.STREAM_READ), l.readPixels(s, t, e, i, o, n, 0), l.bindBuffer(l.PIXEL_PACK_BUFFER, null), await Yr(l, l.PIXEL_PACK_BUFFER, a, 0, r), l.deleteBuffer(a), r;
6102
6170
  }
6103
- class Vr {
6171
+ class Gr {
6104
6172
  constructor(s, t, e) {
6105
6173
  /** {@link Disposable.onDisposed} */
6106
6174
  I(this, "onDisposed", new w());
@@ -6155,7 +6223,7 @@ class Vr {
6155
6223
  const t = this.world.camera.three;
6156
6224
  t.updateMatrix(), this.renderer.setSize(this._width, this._height), this.renderer.setRenderTarget(this.renderTarget), this.renderer.render(this.scene, t);
6157
6225
  const e = this.renderer.getContext();
6158
- await Yr(
6226
+ await Vr(
6159
6227
  e,
6160
6228
  0,
6161
6229
  0,
@@ -6227,7 +6295,7 @@ class Vr {
6227
6295
  s && (s.updateInterval !== void 0 && (this.updateInterval = s.updateInterval), s.height !== void 0 && (this._height = s.height), s.width !== void 0 && (this._width = s.width), s.autoUpdate !== void 0 && (this.autoUpdate = s.autoUpdate));
6228
6296
  }
6229
6297
  }
6230
- class Gr extends Vr {
6298
+ class zr extends Gr {
6231
6299
  constructor(t, e, i) {
6232
6300
  super(t, e, i);
6233
6301
  /**
@@ -6313,13 +6381,13 @@ class Gr extends Vr {
6313
6381
  let d = !0;
6314
6382
  const E = [];
6315
6383
  for (const u of o)
6316
- sn.isTransparent(u) ? E.push(this._transparentMat) : (d = !1, E.push(n));
6384
+ nn.isTransparent(u) ? E.push(this._transparentMat) : (d = !1, E.push(n));
6317
6385
  if (d) {
6318
6386
  n.dispose(), this.isProcessing = !1;
6319
6387
  return;
6320
6388
  }
6321
6389
  a = E;
6322
- } else if (sn.isTransparent(o)) {
6390
+ } else if (nn.isTransparent(o)) {
6323
6391
  n.dispose(), this.isProcessing = !1;
6324
6392
  return;
6325
6393
  } else
@@ -6412,7 +6480,7 @@ const Ye = class Ye extends et {
6412
6480
  create(t, e) {
6413
6481
  if (this.list.has(t.uuid))
6414
6482
  return this.list.get(t.uuid);
6415
- const i = new Gr(this.components, t, e);
6483
+ const i = new zr(this.components, t, e);
6416
6484
  return this.list.set(t.uuid, i), i;
6417
6485
  }
6418
6486
  /**
@@ -6452,7 +6520,7 @@ const Ye = class Ye extends et {
6452
6520
  */
6453
6521
  I(Ye, "uuid", "69f2a50d-c266-44fc-b1bd-fa4d34be89e6");
6454
6522
  let Ti = Ye;
6455
- class zr {
6523
+ class Hr {
6456
6524
  constructor(s) {
6457
6525
  /** {@link Disposable.onDisposed} */
6458
6526
  I(this, "onDisposed", new w());
@@ -6621,7 +6689,7 @@ const _s = class _s extends et {
6621
6689
  create(t) {
6622
6690
  if (this.list.has(t.uuid))
6623
6691
  throw new Error("This world already has a minimap!");
6624
- const e = new zr(t);
6692
+ const e = new Hr(t);
6625
6693
  return this.list.set(t.uuid, e), e;
6626
6694
  }
6627
6695
  /**
@@ -6652,8 +6720,8 @@ const _s = class _s extends et {
6652
6720
  * This UUID is used to register the component within the Components system.
6653
6721
  */
6654
6722
  I(_s, "uuid", "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f");
6655
- let An = _s;
6656
- class Hr {
6723
+ let Fn = _s;
6724
+ class Wr {
6657
6725
  constructor(s) {
6658
6726
  /** {@link NavigationMode.enabled} */
6659
6727
  I(this, "enabled", !1);
@@ -6680,7 +6748,7 @@ class Hr {
6680
6748
  ), s.truckSpeed = 50, s.mouseButtons.wheel = ot.ACTION.DOLLY, s.touches.two = ot.ACTION.TOUCH_ZOOM_TRUCK;
6681
6749
  }
6682
6750
  }
6683
- class Wr {
6751
+ class kr {
6684
6752
  constructor(s) {
6685
6753
  /** {@link NavigationMode.enabled} */
6686
6754
  I(this, "enabled", !0);
@@ -6703,7 +6771,7 @@ class Wr {
6703
6771
  s.moveTo(n.x, n.y, n.z);
6704
6772
  }
6705
6773
  }
6706
- class kr {
6774
+ class Xr {
6707
6775
  constructor(s) {
6708
6776
  /** {@link NavigationMode.enabled} */
6709
6777
  I(this, "enabled", !1);
@@ -6723,7 +6791,7 @@ class kr {
6723
6791
  t.azimuthRotateSpeed = s ? 0 : this.defaultAzimuthSpeed, t.polarRotateSpeed = s ? 0 : this.defaultPolarSpeed, this.mouseInitialized || (this.mouseAction1 = t.touches.one, this.mouseAction2 = t.touches.two, this.mouseInitialized = !0), s ? (t.mouseButtons.left = ot.ACTION.TRUCK, t.touches.one = ot.ACTION.TOUCH_TRUCK, t.touches.two = ot.ACTION.TOUCH_ZOOM) : (t.mouseButtons.left = ot.ACTION.ROTATE, t.touches.one = this.mouseAction1, t.touches.two = this.mouseAction2);
6724
6792
  }
6725
6793
  }
6726
- class Xr {
6794
+ class Zr {
6727
6795
  constructor(s) {
6728
6796
  /**
6729
6797
  * Event that fires when the {@link CameraProjection} changes.
@@ -6820,14 +6888,14 @@ class aa extends We {
6820
6888
  I(this, "_navigationModes", /* @__PURE__ */ new Map());
6821
6889
  I(this, "_mode", null);
6822
6890
  I(this, "previousSize", null);
6823
- this.threePersp = this.three, this.threeOrtho = this.newOrthoCamera(), this.projection = new Xr(this), this.onAspectUpdated.add(() => {
6891
+ this.threePersp = this.three, this.threeOrtho = this.newOrthoCamera(), this.projection = new Zr(this), this.onAspectUpdated.add(() => {
6824
6892
  this.setOrthoPerspCameraAspect();
6825
6893
  }), this.projection.onChanged.add(
6826
6894
  (e) => {
6827
6895
  this.three = e, this.updateAspect();
6828
6896
  }
6829
6897
  ), this.onWorldChanged.add(({ action: e }) => {
6830
- e === "added" && (this._navigationModes.clear(), this._navigationModes.set("Orbit", new Wr(this)), this._navigationModes.set("FirstPerson", new Hr(this)), this._navigationModes.set("Plan", new kr(this)), this._mode = this._navigationModes.get("Orbit"), this.mode.set(!0, { preventTargetAdjustment: !0 }), this.currentWorld && this.currentWorld.renderer && (this.previousSize = this.currentWorld.renderer.getSize().clone()));
6898
+ e === "added" && (this._navigationModes.clear(), this._navigationModes.set("Orbit", new kr(this)), this._navigationModes.set("FirstPerson", new Wr(this)), this._navigationModes.set("Plan", new Xr(this)), this._mode = this._navigationModes.get("Orbit"), this.mode.set(!0, { preventTargetAdjustment: !0 }), this.currentWorld && this.currentWorld.renderer && (this.previousSize = this.currentWorld.renderer.getSize().clone()));
6831
6899
  });
6832
6900
  }
6833
6901
  /**
@@ -6913,7 +6981,7 @@ class aa extends We {
6913
6981
  this.threeOrtho.left = -a, this.threeOrtho.right = a, this.threeOrtho.top = r, this.threeOrtho.bottom = -r, this.threeOrtho.updateProjectionMatrix(), this.previousSize.copy(t);
6914
6982
  }
6915
6983
  }
6916
- const Zr = /* @__PURE__ */ new Map([
6984
+ const Qr = /* @__PURE__ */ new Map([
6917
6985
  [
6918
6986
  U.IFCRELAGGREGATES,
6919
6987
  {
@@ -7009,7 +7077,7 @@ const Zr = /* @__PURE__ */ new Map([
7009
7077
  I(this, "relationMaps", {});
7010
7078
  /** {@link Component.enabled} */
7011
7079
  I(this, "enabled", !0);
7012
- I(this, "_relToAttributesMap", Zr);
7080
+ I(this, "_relToAttributesMap", Qr);
7013
7081
  I(this, "_inverseAttributes", [
7014
7082
  "IsDecomposedBy",
7015
7083
  "Decomposes",
@@ -7038,7 +7106,9 @@ const Zr = /* @__PURE__ */ new Map([
7038
7106
  U.IFCRELDEFINESBYPROPERTIES,
7039
7107
  U.IFCRELDEFINESBYTYPE,
7040
7108
  U.IFCRELDEFINESBYTEMPLATE,
7041
- U.IFCRELCONTAINEDINSPATIALSTRUCTURE
7109
+ U.IFCRELCONTAINEDINSPATIALSTRUCTURE,
7110
+ U.IFCRELFLOWCONTROLELEMENTS,
7111
+ U.IFCRELCONNECTSELEMENTS
7042
7112
  ]);
7043
7113
  I(this, "onFragmentsDisposed", (t) => {
7044
7114
  delete this.relationMaps[t.groupID];
@@ -7329,20 +7399,20 @@ const Ns = class Ns extends et {
7329
7399
  */
7330
7400
  I(this, "onFragmentsDisposed", new w());
7331
7401
  /**
7332
- * Map containing all loaded fragments.
7402
+ * DataMap containing all loaded fragments.
7333
7403
  * The key is the fragment's unique identifier, and the value is the fragment itself.
7334
7404
  */
7335
- I(this, "list", /* @__PURE__ */ new Map());
7405
+ I(this, "list", new Ji());
7336
7406
  /**
7337
- * Map containing all loaded fragment groups.
7407
+ * DataMap containing all loaded fragment groups.
7338
7408
  * The key is the group's unique identifier, and the value is the group itself.
7339
7409
  */
7340
- I(this, "groups", /* @__PURE__ */ new Map());
7410
+ I(this, "groups", new Ji());
7341
7411
  I(this, "baseCoordinationModel", "");
7342
7412
  I(this, "baseCoordinationMatrix", new O.Matrix4());
7343
7413
  /** {@link Component.enabled} */
7344
7414
  I(this, "enabled", !0);
7345
- I(this, "_loader", new eo());
7415
+ I(this, "_loader", new so());
7346
7416
  this.components.add(Ns.uuid, this);
7347
7417
  }
7348
7418
  /**
@@ -7479,6 +7549,20 @@ const Ns = class Ns extends et {
7479
7549
  applyBaseCoordinateSystem(t, e) {
7480
7550
  t.applyMatrix4(e.clone().invert()), t.applyMatrix4(this.baseCoordinationMatrix);
7481
7551
  }
7552
+ /**
7553
+ * Creates a copy of the whole model or a part of it.
7554
+ *
7555
+ * @param model - The model to clone.
7556
+ * @param items - Optional - The part of the model to be cloned. If not given, the whole group is cloned.
7557
+ *
7558
+ */
7559
+ clone(t, e) {
7560
+ const i = t.cloneGroup(e);
7561
+ this.groups.set(i.uuid, i);
7562
+ for (const o of i.items)
7563
+ this.list.set(o.id, o);
7564
+ return i;
7565
+ }
7482
7566
  };
7483
7567
  /**
7484
7568
  * A unique identifier for the component.
@@ -7761,8 +7845,8 @@ const At = class At extends et {
7761
7845
  }
7762
7846
  };
7763
7847
  I(At, "uuid", "d1444724-dba6-4cdd-a0c7-68ee1450d166");
7764
- let Fn = At;
7765
- const vn = /* @__PURE__ */ new Set([
7848
+ let gn = At;
7849
+ const Bn = /* @__PURE__ */ new Set([
7766
7850
  1123145078,
7767
7851
  574549367,
7768
7852
  1675464909,
@@ -7895,12 +7979,12 @@ const vn = /* @__PURE__ */ new Set([
7895
7979
  2513912981,
7896
7980
  2830218821,
7897
7981
  427810014
7898
- ]), Ps = class Ps extends et {
7982
+ ]), Ls = class Ls extends et {
7899
7983
  constructor(t) {
7900
7984
  super(t);
7901
7985
  /** {@link Component.enabled} */
7902
7986
  I(this, "enabled", !0);
7903
- t.add(Ps.uuid, this);
7987
+ t.add(Ls.uuid, this);
7904
7988
  }
7905
7989
  /**
7906
7990
  * Exports all the properties of an IFC into an array of JS objects.
@@ -7921,7 +8005,7 @@ const vn = /* @__PURE__ */ new Set([
7921
8005
  for (const c of a)
7922
8006
  r.add(c);
7923
8007
  for (const c of r) {
7924
- if (vn.has(c))
8008
+ if (Bn.has(c))
7925
8009
  continue;
7926
8010
  const h = a.has(c) && o, d = t.GetLineIDsWithType(e, c);
7927
8011
  for (const E of d) {
@@ -7936,9 +8020,9 @@ const vn = /* @__PURE__ */ new Set([
7936
8020
  * A unique identifier for the component.
7937
8021
  * This UUID is used to register the component within the Components system.
7938
8022
  */
7939
- I(Ps, "uuid", "b32c4332-cd67-436e-ba7f-196646c7a635");
7940
- let mi = Ps;
7941
- const Qr = {
8023
+ I(Ls, "uuid", "b32c4332-cd67-436e-ba7f-196646c7a635");
8024
+ let mi = Ls;
8025
+ const jr = {
7942
8026
  103090709: "IFCPROJECT",
7943
8027
  4097777520: "IFCSITE",
7944
8028
  4031249490: "IFCBUILDING",
@@ -8079,7 +8163,7 @@ const Qr = {
8079
8163
  };
8080
8164
  class ca {
8081
8165
  getAll(s, t) {
8082
- const e = {}, i = Object.keys(Qr).map((o) => parseInt(o, 10));
8166
+ const e = {}, i = Object.keys(jr).map((o) => parseInt(o, 10));
8083
8167
  for (let o = 0; o < i.length; o++) {
8084
8168
  const n = i[o], r = s.GetLineIDsWithType(t, n), a = r.size();
8085
8169
  for (let c = 0; c < a; c++)
@@ -8088,7 +8172,7 @@ class ca {
8088
8172
  return e;
8089
8173
  }
8090
8174
  }
8091
- const Bn = {
8175
+ const Yn = {
8092
8176
  950732822: "IFCURIREFERENCE",
8093
8177
  4075327185: "IFCTIME",
8094
8178
  1209108979: "IFCTEMPERATURERATEOFCHANGEMEASURE",
@@ -9326,7 +9410,7 @@ class Kt {
9326
9410
  return i === null || e[i] === void 0 || e[i] === null ? o = null : o = e[i].value, { key: i, value: o };
9327
9411
  }
9328
9412
  static isRel(s) {
9329
- return Bn[s].startsWith("IFCREL");
9413
+ return Yn[s].startsWith("IFCREL");
9330
9414
  }
9331
9415
  static async attributeExists(s, t, e) {
9332
9416
  const i = await s.getProperties(t);
@@ -9365,7 +9449,7 @@ class Kt {
9365
9449
  // return propertyInstance;
9366
9450
  // }
9367
9451
  }
9368
- class jr {
9452
+ class qr {
9369
9453
  constructor() {
9370
9454
  I(this, "factor", 1);
9371
9455
  I(this, "complement", 1);
@@ -9423,10 +9507,10 @@ class jr {
9423
9507
  ]);
9424
9508
  }
9425
9509
  }
9426
- class Yn {
9510
+ class Vn {
9427
9511
  constructor() {
9428
9512
  I(this, "itemsByFloor", {});
9429
- I(this, "_units", new jr());
9513
+ I(this, "_units", new qr());
9430
9514
  }
9431
9515
  // TODO: Maybe make this more flexible so that it also support more exotic spatial structures?
9432
9516
  setUp(s) {
@@ -9493,7 +9577,7 @@ class Yn {
9493
9577
  this.itemsByFloor = {};
9494
9578
  }
9495
9579
  }
9496
- class Li {
9580
+ class Pi {
9497
9581
  constructor() {
9498
9582
  /** Whether to extract the IFC properties into a JSON. */
9499
9583
  I(this, "includeProperties", !0);
@@ -9537,7 +9621,7 @@ class Li {
9537
9621
  I(this, "customLocateFileHandler", null);
9538
9622
  }
9539
9623
  }
9540
- class Vn {
9624
+ class Gn {
9541
9625
  constructor() {
9542
9626
  I(this, "defLineMat", new O.LineBasicMaterial({ color: 16777215 }));
9543
9627
  }
@@ -9588,7 +9672,7 @@ class Vn {
9588
9672
  return e;
9589
9673
  }
9590
9674
  }
9591
- class Gn {
9675
+ class zn {
9592
9676
  getNameInfo(s) {
9593
9677
  var d;
9594
9678
  const t = {}, { arguments: e } = s.GetHeaderLine(0, U.FILE_NAME) || {};
@@ -9623,7 +9707,7 @@ class Gn {
9623
9707
  return o != null && o.value && (t.implementationLevel = o.value), t;
9624
9708
  }
9625
9709
  }
9626
- class zn {
9710
+ class Hn {
9627
9711
  static get(s, t) {
9628
9712
  const e = [
9629
9713
  U.IFCPROJECT,
@@ -9662,7 +9746,7 @@ const Ge = class Ge extends et {
9662
9746
  * The settings for the IfcLoader.
9663
9747
  * It includes options for excluding categories, setting WASM paths, and more.
9664
9748
  */
9665
- I(this, "settings", new Li());
9749
+ I(this, "settings", new Pi());
9666
9750
  /**
9667
9751
  * The instance of the Web-IFC library used for handling IFC data.
9668
9752
  */
@@ -9670,10 +9754,10 @@ const Ge = class Ge extends et {
9670
9754
  /** {@link Component.enabled} */
9671
9755
  I(this, "enabled", !0);
9672
9756
  I(this, "_material", new O.MeshLambertMaterial());
9673
- I(this, "_spatialTree", new Yn());
9674
- I(this, "_metaData", new Gn());
9757
+ I(this, "_spatialTree", new Vn());
9758
+ I(this, "_metaData", new zn());
9675
9759
  I(this, "_fragmentInstances", /* @__PURE__ */ new Map());
9676
- I(this, "_civil", new Vn());
9760
+ I(this, "_civil", new Gn());
9677
9761
  I(this, "_visitedFragments", /* @__PURE__ */ new Map());
9678
9762
  I(this, "_materialT", new O.MeshLambertMaterial({
9679
9763
  transparent: !0,
@@ -9737,7 +9821,7 @@ const Ge = class Ge extends et {
9737
9821
  const d = h.GlobalId.value || h.GlobalId;
9738
9822
  o.globalToExpressIDs.set(d, c);
9739
9823
  }
9740
- return zn.get(o, this.webIfc), this.cleanUp(), console.log(`Streaming the IFC took ${performance.now() - i} ms!`), o;
9824
+ return Hn.get(o, this.webIfc), this.cleanUp(), console.log(`Streaming the IFC took ${performance.now() - i} ms!`), o;
9741
9825
  }
9742
9826
  /**
9743
9827
  * Reads an IFC file and initializes the Web-IFC library.
@@ -10247,8 +10331,8 @@ const Bt = class Bt extends et {
10247
10331
  * This UUID is used to register the component within the Components system.
10248
10332
  */
10249
10333
  I(Bt, "uuid", "58c2d9f0-183c-48d6-a402-dfcf5b9a34df");
10250
- let gn = Bt;
10251
- const Ls = class Ls extends et {
10334
+ let On = Bt;
10335
+ const Ps = class Ps extends et {
10252
10336
  constructor(t) {
10253
10337
  super(t);
10254
10338
  /** {@link Component.enabled} */
@@ -10275,7 +10359,7 @@ const Ls = class Ls extends et {
10275
10359
  }
10276
10360
  }
10277
10361
  });
10278
- t.add(Ls.uuid, this), t.get(ht).onFragmentsDisposed.add(this.onFragmentsDisposed);
10362
+ t.add(Ps.uuid, this), t.get(ht).onFragmentsDisposed.add(this.onFragmentsDisposed);
10279
10363
  }
10280
10364
  /** {@link Disposable.dispose} */
10281
10365
  dispose() {
@@ -10428,7 +10512,7 @@ const Ls = class Ls extends et {
10428
10512
  byEntity(t) {
10429
10513
  this.list.entities || (this.list.entities = {});
10430
10514
  for (const [e, i] of t.data) {
10431
- const n = i[1][1], r = Bn[n];
10515
+ const n = i[1][1], r = Yn[n];
10432
10516
  this.saveItem(t, "entities", r, e);
10433
10517
  }
10434
10518
  }
@@ -10603,8 +10687,8 @@ const Ls = class Ls extends et {
10603
10687
  * A unique identifier for the component.
10604
10688
  * This UUID is used to register the component within the Components system.
10605
10689
  */
10606
- I(Ls, "uuid", "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");
10607
- let Ai = Ls;
10690
+ I(Ps, "uuid", "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");
10691
+ let Ai = Ps;
10608
10692
  const ys = class ys extends et {
10609
10693
  constructor(t) {
10610
10694
  super(t);
@@ -10674,7 +10758,7 @@ const ys = class ys extends et {
10674
10758
  * This UUID is used to register the component within the Components system.
10675
10759
  */
10676
10760
  I(ys, "uuid", "d260618b-ce88-4c7d-826c-6debb91de3e2");
10677
- let On = ys;
10761
+ let Sn = ys;
10678
10762
  const Ms = class Ms extends et {
10679
10763
  constructor(t) {
10680
10764
  super(t);
@@ -10730,8 +10814,8 @@ const Ms = class Ms extends et {
10730
10814
  * This UUID is used to register the component within the Components system.
10731
10815
  */
10732
10816
  I(Ms, "uuid", "dd9ccf2d-8a21-4821-b7f6-2949add16a29");
10733
- let Sn = Ms;
10734
- class qr extends Li {
10817
+ let _n = Ms;
10818
+ class Kr extends Pi {
10735
10819
  constructor() {
10736
10820
  super(...arguments);
10737
10821
  /**
@@ -10774,20 +10858,20 @@ const ws = class ws extends et {
10774
10858
  /**
10775
10859
  * Settings for the IfcGeometryTiler.
10776
10860
  */
10777
- I(this, "settings", new qr());
10861
+ I(this, "settings", new Kr());
10778
10862
  /** {@link Component.enabled} */
10779
10863
  I(this, "enabled", !0);
10780
10864
  /**
10781
10865
  * The WebIFC API instance used for IFC file processing.
10782
10866
  */
10783
10867
  I(this, "webIfc", new U.IfcAPI());
10784
- I(this, "_spatialTree", new Yn());
10785
- I(this, "_metaData", new Gn());
10868
+ I(this, "_spatialTree", new Vn());
10869
+ I(this, "_metaData", new zn());
10786
10870
  I(this, "_visitedGeometries", /* @__PURE__ */ new Map());
10787
10871
  I(this, "_streamSerializer", new Vt.StreamSerializer());
10788
10872
  I(this, "_geometries", /* @__PURE__ */ new Map());
10789
10873
  I(this, "_geometryCount", 0);
10790
- I(this, "_civil", new Vn());
10874
+ I(this, "_civil", new Gn());
10791
10875
  I(this, "_groupSerializer", new Vt.Serializer());
10792
10876
  I(this, "_assets", []);
10793
10877
  I(this, "_meshesWithHoles", /* @__PURE__ */ new Set());
@@ -10881,7 +10965,7 @@ const ws = class ws extends et {
10881
10965
  const { opaque: d, transparent: E } = n.geometryIDs;
10882
10966
  for (const [T, { index: R, uuid: C }] of this._visitedGeometries)
10883
10967
  n.keyFragments.set(R, C), (T > 1 ? d : E).set(T, R);
10884
- zn.get(n, this.webIfc);
10968
+ Hn.get(n, this.webIfc);
10885
10969
  const u = this.webIfc.GetCoordinationMatrix(0);
10886
10970
  n.coordinationMatrix.fromArray(u), n.civilData = this._civil.read(this.webIfc);
10887
10971
  const f = this._groupSerializer.export(n);
@@ -10921,11 +11005,11 @@ const ws = class ws extends et {
10921
11005
  ), r = new Float32Array(n.length / 2), a = new Float32Array(n.length / 2);
10922
11006
  for (let u = 0; u < n.length; u += 6)
10923
11007
  r[u / 2] = n[u], r[u / 2 + 1] = n[u + 1], r[u / 2 + 2] = n[u + 2], a[u / 2] = n[u + 3], a[u / 2 + 1] = n[u + 4], a[u / 2 + 2] = n[u + 5];
10924
- const c = mr(r), h = new Float32Array(c.transformation.elements), d = [c.center.x, c.center.y, c.center.z];
11008
+ const c = Rr(r), h = new Float32Array(c.transformation.elements), d = [c.center.x, c.center.y, c.center.z];
10925
11009
  let E = !1;
10926
11010
  for (let u = 0; u < r.length - 2; u += 3) {
10927
11011
  const f = r[u], T = r[u + 1], R = r[u + 2], C = a[u], A = a[u + 1], F = a[u + 2];
10928
- if (Rr(d, [f, T, R], [C, A, F])) {
11012
+ if (Ar(d, [f, T, R], [C, A, F])) {
10929
11013
  E = !0;
10930
11014
  break;
10931
11015
  }
@@ -10953,8 +11037,8 @@ const ws = class ws extends et {
10953
11037
  * This UUID is used to register the component within the Components system.
10954
11038
  */
10955
11039
  I(ws, "uuid", "d9999a00-e1f5-4d3f-8cfe-c56e08609764");
10956
- let _n = ws;
10957
- class Kr extends Li {
11040
+ let Nn = ws;
11041
+ class $r extends Pi {
10958
11042
  constructor() {
10959
11043
  super(...arguments);
10960
11044
  /**
@@ -10964,7 +11048,7 @@ class Kr extends Li {
10964
11048
  I(this, "propertiesSize", 100);
10965
11049
  }
10966
11050
  }
10967
- class $r extends et {
11051
+ class Jr extends et {
10968
11052
  constructor() {
10969
11053
  super(...arguments);
10970
11054
  /**
@@ -10989,7 +11073,7 @@ class $r extends et {
10989
11073
  /**
10990
11074
  * An instance of the PropertiesStreamingSettings class, which holds the settings for the streaming process.
10991
11075
  */
10992
- I(this, "settings", new Kr());
11076
+ I(this, "settings", new $r());
10993
11077
  /**
10994
11078
  * An instance of the IfcAPI class from the Web-IFC library, which provides methods for reading and processing IFC data.
10995
11079
  */
@@ -11037,7 +11121,7 @@ class $r extends et {
11037
11121
  e.add(c);
11038
11122
  let o = 0.01, n = 0;
11039
11123
  for (const c of e) {
11040
- if (n++, vn.has(c))
11124
+ if (n++, Bn.has(c))
11041
11125
  continue;
11042
11126
  const h = i.has(c), d = this.webIfc.GetLineIDsWithType(0, c), E = d.size();
11043
11127
  let u = 0;
@@ -11082,7 +11166,7 @@ class $r extends et {
11082
11166
  * A unique identifier for the component.
11083
11167
  * This UUID is used to register the component within the Components system.
11084
11168
  */
11085
- I($r, "uuid", "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");
11169
+ I(Jr, "uuid", "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");
11086
11170
  const Ds = class Ds extends et {
11087
11171
  constructor(t) {
11088
11172
  super(t);
@@ -11165,9 +11249,9 @@ const Ds = class Ds extends et {
11165
11249
  g.add(m);
11166
11250
  }
11167
11251
  for (const m of C) {
11168
- const g = d.get(m), { edges: S, indices: _ } = g, N = d.get(R), { edges: L, indices: D } = N;
11252
+ const g = d.get(m), { edges: S, indices: _ } = g, N = d.get(R), { edges: P, indices: D } = N;
11169
11253
  for (const y of S)
11170
- L.add(y), h.set(y, R);
11254
+ P.add(y), h.set(y, R);
11171
11255
  for (const y of _)
11172
11256
  D.add(y);
11173
11257
  d.delete(m);
@@ -11341,66 +11425,66 @@ const Ds = class Ds extends et {
11341
11425
  * This UUID is used to register the component within the Components system.
11342
11426
  */
11343
11427
  I(Ds, "uuid", "267ca032-672f-4cb0-afa9-d24e904f39d6");
11344
- let Nn = Ds;
11428
+ let Ln = Ds;
11345
11429
  export {
11346
11430
  Ts as AsyncEvent,
11347
11431
  _i as Base,
11348
- cr as BaseCamera,
11349
- lr as BaseRenderer,
11350
- hr as BaseScene,
11432
+ lr as BaseCamera,
11433
+ hr as BaseRenderer,
11434
+ Er as BaseScene,
11351
11435
  Ni as BaseWorldItem,
11352
- Fn as BoundingBoxer,
11436
+ gn as BoundingBoxer,
11353
11437
  Ai as Classifier,
11354
- Rn as Clipper,
11438
+ An as Clipper,
11355
11439
  et as Component,
11356
11440
  pi as Components,
11357
- Vr as CullerRenderer,
11441
+ Gr as CullerRenderer,
11358
11442
  Ti as Cullers,
11359
- ia as DataMap,
11360
- sa as DataSet,
11443
+ Ji as DataMap,
11444
+ ia as DataSet,
11361
11445
  zt as Disposer,
11362
11446
  w as Event,
11363
- On as Exploder,
11364
- Hr as FirstPersonMode,
11447
+ Sn as Exploder,
11448
+ Wr as FirstPersonMode,
11365
11449
  ht as FragmentsManager,
11366
- vn as GeometryTypes,
11367
- dn as Grids,
11368
- Sn as Hider,
11450
+ Bn as GeometryTypes,
11451
+ un as Grids,
11452
+ _n as Hider,
11369
11453
  ca as IfcCategories,
11370
- Bn as IfcCategoryMap,
11371
- Qr as IfcElements,
11372
- Li as IfcFragmentSettings,
11373
- _n as IfcGeometryTiler,
11454
+ Yn as IfcCategoryMap,
11455
+ jr as IfcElements,
11456
+ Pi as IfcFragmentSettings,
11457
+ Nn as IfcGeometryTiler,
11374
11458
  mi as IfcJsonExporter,
11375
11459
  Ri as IfcLoader,
11376
- gn as IfcPropertiesManager,
11377
- $r as IfcPropertiesTiler,
11460
+ On as IfcPropertiesManager,
11461
+ Jr as IfcPropertiesTiler,
11378
11462
  Kt as IfcPropertiesUtils,
11379
11463
  pe as IfcRelationsIndexer,
11380
- qr as IfcStreamingSettings,
11381
- sn as MaterialsUtils,
11382
- Nn as MeasurementUtils,
11383
- Gr as MeshCullerRenderer,
11384
- zr as MiniMap,
11385
- An as MiniMaps,
11386
- Ar as Mouse,
11387
- Wr as OrbitMode,
11464
+ Kr as IfcStreamingSettings,
11465
+ nn as MaterialsUtils,
11466
+ Ln as MeasurementUtils,
11467
+ zr as MeshCullerRenderer,
11468
+ Hr as MiniMap,
11469
+ Fn as MiniMaps,
11470
+ Fr as Mouse,
11471
+ kr as OrbitMode,
11388
11472
  aa as OrthoPerspectiveCamera,
11389
- kr as PlanMode,
11390
- Xr as ProjectionManager,
11391
- Kr as PropertiesStreamingSettings,
11473
+ Xr as PlanMode,
11474
+ Zr as ProjectionManager,
11475
+ $r as PropertiesStreamingSettings,
11392
11476
  He as Raycasters,
11393
11477
  We as SimpleCamera,
11394
11478
  Pr as SimpleGrid,
11395
- Pi as SimplePlane,
11396
- Fr as SimpleRaycaster,
11479
+ Li as SimplePlane,
11480
+ gr as SimpleRaycaster,
11397
11481
  ra as SimpleRenderer,
11398
11482
  oa as SimpleScene,
11399
- gr as SimpleWorld,
11483
+ Or as SimpleWorld,
11400
11484
  ze as UUID,
11401
11485
  na as VertexPicker,
11402
11486
  Ci as Worlds,
11403
- Rr as isPointInFrontOfPlane,
11404
- mr as obbFromPoints,
11405
- Yr as readPixelsAsync
11487
+ Ar as isPointInFrontOfPlane,
11488
+ Rr as obbFromPoints,
11489
+ Vr as readPixelsAsync
11406
11490
  };