softbox 4.21.0 → 4.23.0

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.
@@ -507,7 +507,7 @@ var He = new class {
507
507
  });
508
508
  };
509
509
  }
510
- }(), Ue = /* @__PURE__ */ new r(), We = /* @__PURE__ */ new Float32Array(6), Ge = class {
510
+ }(), Ue = /* @__PURE__ */ new r(), V = /* @__PURE__ */ new Float32Array(6), We = class {
511
511
  constructor() {
512
512
  this._roots = null, this.primitiveBuffer = null, this.primitiveBufferStride = null;
513
513
  }
@@ -529,8 +529,8 @@ var He = new class {
529
529
  writePrimitiveRangeBounds(e, t, n, r) {
530
530
  let i = Infinity, a = Infinity, o = Infinity, s = -Infinity, c = -Infinity, l = -Infinity;
531
531
  for (let n = e, r = e + t; n < r; n++) {
532
- this.writePrimitiveBounds(n, We, 0);
533
- let [e, t, r, u, d, f] = We;
532
+ this.writePrimitiveBounds(n, V, 0);
533
+ let [e, t, r, u, d, f] = V;
534
534
  e < i && (i = e), u > s && (s = u), t < a && (a = t), d > c && (c = d), r < o && (o = r), f > l && (l = f);
535
535
  }
536
536
  return n[r + 0] = i, n[r + 1] = a, n[r + 2] = o, n[r + 3] = s, n[r + 4] = c, n[r + 5] = l, n;
@@ -538,8 +538,8 @@ var He = new class {
538
538
  computePrimitiveBounds(e, t, n) {
539
539
  let r = n.offset || 0;
540
540
  for (let i = e, a = e + t; i < a; i++) {
541
- this.writePrimitiveBounds(i, We, 0);
542
- let [e, t, a, o, s, c] = We, l = (e + o) / 2, u = (t + s) / 2, d = (a + c) / 2, f = (o - e) / 2, p = (s - t) / 2, m = (c - a) / 2, h = (i - r) * 6;
541
+ this.writePrimitiveBounds(i, V, 0);
542
+ let [e, t, a, o, s, c] = V, l = (e + o) / 2, u = (t + s) / 2, d = (a + c) / 2, f = (o - e) / 2, p = (s - t) / 2, m = (c - a) / 2, h = (i - r) * 6;
543
543
  n[h + 0] = l, n[h + 1] = f + (Math.abs(l) + f) * re, n[h + 2] = u, n[h + 3] = p + (Math.abs(u) + p) * re, n[h + 4] = d, n[h + 5] = m + (Math.abs(d) + m) * re;
544
544
  }
545
545
  return n;
@@ -569,7 +569,7 @@ var He = new class {
569
569
  let t = e * 8, n = t * 2;
570
570
  if (k(n, i)) {
571
571
  let e = A(t, r), o = j(n, i);
572
- this.writePrimitiveRangeBounds(e, o, We, 0), a.set(We, t);
572
+ this.writePrimitiveRangeBounds(e, o, V, 0), a.set(V, t);
573
573
  } else {
574
574
  let e = M(t), n = N(t, r);
575
575
  for (let r = 0; r < 3; r++) {
@@ -606,44 +606,44 @@ var He = new class {
606
606
  };
607
607
  //#endregion
608
608
  //#region node_modules/three-mesh-bvh/src/utils/BufferUtils.js
609
- function Ke() {
609
+ function Ge() {
610
610
  return typeof SharedArrayBuffer < "u";
611
611
  }
612
612
  //#endregion
613
613
  //#region node_modules/three-mesh-bvh/src/core/build/geometryUtils.js
614
- function qe(e) {
614
+ function Ke(e) {
615
615
  return e.index ? e.index.count : e.attributes.position.count;
616
616
  }
617
- function Je(e) {
618
- return qe(e) / 3;
617
+ function qe(e) {
618
+ return Ke(e) / 3;
619
619
  }
620
- function Ye(e, t = ArrayBuffer) {
620
+ function Je(e, t = ArrayBuffer) {
621
621
  return e > 65535 ? new Uint32Array(new t(4 * e)) : new Uint16Array(new t(2 * e));
622
622
  }
623
- function Xe(e, t) {
623
+ function Ye(e, t) {
624
624
  if (!e.index) {
625
- let n = e.attributes.position.count, r = Ye(n, t.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer);
625
+ let n = e.attributes.position.count, r = Je(n, t.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer);
626
626
  e.setIndex(new i(r, 1));
627
627
  for (let e = 0; e < n; e++) r[e] = e;
628
628
  }
629
629
  }
630
- function Ze(e, t, n) {
631
- let r = qe(e) / n, i = t || e.drawRange, a = i.start / n, o = (i.start + i.count) / n, s = Math.max(0, a), c = Math.min(r, o) - s;
630
+ function Xe(e, t, n) {
631
+ let r = Ke(e) / n, i = t || e.drawRange, a = i.start / n, o = (i.start + i.count) / n, s = Math.max(0, a), c = Math.min(r, o) - s;
632
632
  return {
633
633
  offset: Math.floor(s),
634
634
  count: Math.floor(c)
635
635
  };
636
636
  }
637
- function Qe(e, t) {
637
+ function Ze(e, t) {
638
638
  return e.groups.map((e) => ({
639
639
  offset: e.start / t,
640
640
  count: e.count / t
641
641
  }));
642
642
  }
643
- function $e(e, t, n) {
644
- let r = Ze(e, t, n), i = Qe(e, n);
643
+ function Qe(e, t, n) {
644
+ let r = Xe(e, t, n), i = Ze(e, n);
645
645
  if (!i.length) return [r];
646
- let a = [], o = r.offset, s = r.offset + r.count, c = qe(e) / n, l = [];
646
+ let a = [], o = r.offset, s = r.offset + r.count, c = Ke(e) / n, l = [];
647
647
  for (let e of i) {
648
648
  let { offset: t, count: n } = e, r = t, i = t + (isFinite(n) ? n : c - t);
649
649
  r < s && i > o && (l.push({
@@ -667,7 +667,7 @@ function $e(e, t, n) {
667
667
  }
668
668
  //#endregion
669
669
  //#region node_modules/three-mesh-bvh/src/core/GeometryBVH.js
670
- function et(e, t) {
670
+ function $e(e, t) {
671
671
  let n = e[e.length - 1], r = n.offset + n.count > 2 ** 16, i = e.reduce((e, t) => e + t.count, 0), a = r ? 4 : 2, o = t ? new SharedArrayBuffer(i * a) : new ArrayBuffer(i * a), s = r ? new Uint32Array(o) : new Uint16Array(o), c = 0;
672
672
  for (let t = 0; t < e.length; t++) {
673
673
  let { offset: n, count: r } = e[t];
@@ -676,7 +676,7 @@ function et(e, t) {
676
676
  }
677
677
  return s;
678
678
  }
679
- var tt = class extends Ge {
679
+ var et = class extends We {
680
680
  get indirect() {
681
681
  return !!this._indirectBuffer;
682
682
  }
@@ -694,7 +694,7 @@ var tt = class extends Ge {
694
694
  constructor(e, t = {}) {
695
695
  if (!e.isBufferGeometry) throw Error("BVH: Only BufferGeometries are supported.");
696
696
  if (e.index && e.index.isInterleavedBufferAttribute) throw Error("BVH: InterleavedBufferAttribute is not supported for the index attribute.");
697
- if (t.useSharedArrayBuffer && !Ke()) throw Error("BVH: SharedArrayBuffer is not available.");
697
+ if (t.useSharedArrayBuffer && !Ge()) throw Error("BVH: SharedArrayBuffer is not available.");
698
698
  super(), this.geometry = e, this.resolvePrimitiveIndex = t.indirect ? (e) => this._indirectBuffer[e] : (e) => e, this.primitiveBuffer = null, this.primitiveBufferStride = null, this._indirectBuffer = null, t = {
699
699
  ...ie,
700
700
  ...t
@@ -703,21 +703,21 @@ var tt = class extends Ge {
703
703
  init(e) {
704
704
  let { geometry: t, primitiveStride: n } = this;
705
705
  if (e.indirect) {
706
- let r = et($e(t, e.range, n), e.useSharedArrayBuffer);
706
+ let r = $e(Qe(t, e.range, n), e.useSharedArrayBuffer);
707
707
  this._indirectBuffer = r;
708
- } else Xe(t, e);
708
+ } else Ye(t, e);
709
709
  super.init(e), !t.boundingBox && e.setBoundingBox && (t.boundingBox = this.getBoundingBox(new r()));
710
710
  }
711
711
  getRootRanges(e) {
712
712
  return this.indirect ? [{
713
713
  offset: 0,
714
714
  count: this._indirectBuffer.length
715
- }] : $e(this.geometry, e, this.primitiveStride);
715
+ }] : Qe(this.geometry, e, this.primitiveStride);
716
716
  }
717
717
  raycastObject3D() {
718
718
  throw Error("BVH: raycastObject3D() not implemented");
719
719
  }
720
- }, V = class {
720
+ }, H = class {
721
721
  constructor() {
722
722
  this.min = Infinity, this.max = -Infinity;
723
723
  }
@@ -741,7 +741,7 @@ var tt = class extends Ge {
741
741
  return this.min > e.max || e.min > this.max;
742
742
  }
743
743
  };
744
- V.prototype.setFromBox = (function() {
744
+ H.prototype.setFromBox = (function() {
745
745
  let e = /* @__PURE__ */ new b();
746
746
  return function(t, n) {
747
747
  let r = n.min, i = n.max, a = Infinity, o = -Infinity;
@@ -755,7 +755,7 @@ V.prototype.setFromBox = (function() {
755
755
  })();
756
756
  //#endregion
757
757
  //#region node_modules/three-mesh-bvh/src/math/MathUtilities.js
758
- var nt = (function() {
758
+ var tt = (function() {
759
759
  let e = /* @__PURE__ */ new b(), t = /* @__PURE__ */ new b(), n = /* @__PURE__ */ new b();
760
760
  return function(r, i, a) {
761
761
  let o = r.start, s = e, c = i.start, l = t;
@@ -763,10 +763,10 @@ var nt = (function() {
763
763
  let u = n.dot(l), d = l.dot(s), f = l.dot(l), p = n.dot(s), m = s.dot(s) * f - d * d, h, g;
764
764
  h = m === 0 ? 0 : (u * d - p * f) / m, g = (u + h * d) / f, a.x = h, a.y = g;
765
765
  };
766
- })(), rt = (function() {
766
+ })(), nt = (function() {
767
767
  let e = /* @__PURE__ */ new y(), t = /* @__PURE__ */ new b(), n = /* @__PURE__ */ new b();
768
768
  return function(r, i, a, o) {
769
- nt(r, i, e);
769
+ tt(r, i, e);
770
770
  let s = e.x, c = e.y;
771
771
  if (s >= 0 && s <= 1 && c >= 0 && c <= 1) {
772
772
  r.at(s, a), i.at(c, o);
@@ -792,7 +792,7 @@ var nt = (function() {
792
792
  }
793
793
  }
794
794
  };
795
- })(), it = (function() {
795
+ })(), rt = (function() {
796
796
  let e = /* @__PURE__ */ new b(), t = /* @__PURE__ */ new b(), n = /* @__PURE__ */ new p(), r = /* @__PURE__ */ new c();
797
797
  return function(i, a) {
798
798
  let { radius: o, center: s } = i, { a: c, b: l, c: u } = a;
@@ -804,15 +804,15 @@ var nt = (function() {
804
804
  }
805
805
  return !1;
806
806
  };
807
- })(), at = [
807
+ })(), it = [
808
808
  "x",
809
809
  "y",
810
810
  "z"
811
- ], H = 1e-15, ot = H * H;
812
- function U(e) {
813
- return Math.abs(e) < H;
811
+ ], U = 1e-15, at = U * U;
812
+ function W(e) {
813
+ return Math.abs(e) < U;
814
814
  }
815
- var W = class extends v {
815
+ var G = class extends v {
816
816
  constructor(...e) {
817
817
  super(...e), this.isExtendedTriangle = !0, this.satAxes = [
818
818
  ,
@@ -824,14 +824,14 @@ var W = class extends v {
824
824
  ,
825
825
  ,
826
826
  ,
827
- ].fill().map(() => new V()), this.points = [
827
+ ].fill().map(() => new H()), this.points = [
828
828
  this.a,
829
829
  this.b,
830
830
  this.c
831
831
  ], this.plane = new p(), this.isDegenerateIntoSegment = !1, this.isDegenerateIntoPoint = !1, this.degenerateSegment = new c(), this.needsUpdate = !0;
832
832
  }
833
833
  intersectsSphere(e) {
834
- return it(e, this);
834
+ return rt(e, this);
835
835
  }
836
836
  update() {
837
837
  let e = this.a, t = this.b, n = this.c, r = this.points, i = this.satAxes, a = this.satBounds, o = i[0], s = a[0];
@@ -843,21 +843,21 @@ var W = class extends v {
843
843
  let f = i[3], p = a[3];
844
844
  f.subVectors(n, e), p.setFromPoints(f, r);
845
845
  let m = c.length(), h = u.length(), g = f.length();
846
- this.isDegenerateIntoPoint = !1, this.isDegenerateIntoSegment = !1, m < H ? h < H || g < H ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(e), this.degenerateSegment.end.copy(n)) : h < H ? g < H ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(t), this.degenerateSegment.end.copy(e)) : g < H && (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(n), this.degenerateSegment.end.copy(t)), this.plane.setFromNormalAndCoplanarPoint(o, e), this.needsUpdate = !1;
846
+ this.isDegenerateIntoPoint = !1, this.isDegenerateIntoSegment = !1, m < U ? h < U || g < U ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(e), this.degenerateSegment.end.copy(n)) : h < U ? g < U ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(t), this.degenerateSegment.end.copy(e)) : g < U && (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(n), this.degenerateSegment.end.copy(t)), this.plane.setFromNormalAndCoplanarPoint(o, e), this.needsUpdate = !1;
847
847
  }
848
848
  };
849
- W.prototype.closestPointToSegment = (function() {
849
+ G.prototype.closestPointToSegment = (function() {
850
850
  let e = /* @__PURE__ */ new b(), t = /* @__PURE__ */ new b(), n = /* @__PURE__ */ new c();
851
851
  return function(r, i = null, a = null) {
852
852
  let { start: o, end: s } = r, c = this.points, l, u = Infinity;
853
853
  for (let o = 0; o < 3; o++) {
854
854
  let s = (o + 1) % 3;
855
- n.start.copy(c[o]), n.end.copy(c[s]), rt(n, r, e, t), l = e.distanceToSquared(t), l < u && (u = l, i && i.copy(e), a && a.copy(t));
855
+ n.start.copy(c[o]), n.end.copy(c[s]), nt(n, r, e, t), l = e.distanceToSquared(t), l < u && (u = l, i && i.copy(e), a && a.copy(t));
856
856
  }
857
857
  return this.closestPointToPoint(o, e), l = o.distanceToSquared(e), l < u && (u = l, i && i.copy(e), a && a.copy(o)), this.closestPointToPoint(s, e), l = s.distanceToSquared(e), l < u && (u = l, i && i.copy(e), a && a.copy(s)), Math.sqrt(u);
858
858
  };
859
- })(), W.prototype.intersectsTriangle = (function() {
860
- let e = /* @__PURE__ */ new W(), t = /* @__PURE__ */ new V(), n = /* @__PURE__ */ new V(), r = /* @__PURE__ */ new b(), i = /* @__PURE__ */ new b(), a = /* @__PURE__ */ new b(), o = /* @__PURE__ */ new b(), s = /* @__PURE__ */ new c(), l = /* @__PURE__ */ new c(), u = /* @__PURE__ */ new b(), d = /* @__PURE__ */ new y(), f = /* @__PURE__ */ new y();
859
+ })(), G.prototype.intersectsTriangle = (function() {
860
+ let e = /* @__PURE__ */ new G(), t = /* @__PURE__ */ new H(), n = /* @__PURE__ */ new H(), r = /* @__PURE__ */ new b(), i = /* @__PURE__ */ new b(), a = /* @__PURE__ */ new b(), o = /* @__PURE__ */ new b(), s = /* @__PURE__ */ new c(), l = /* @__PURE__ */ new c(), u = /* @__PURE__ */ new b(), d = /* @__PURE__ */ new y(), f = /* @__PURE__ */ new y();
861
861
  function p(e, i, a, s) {
862
862
  let c = r;
863
863
  !e.isDegenerateIntoPoint && !e.isDegenerateIntoSegment ? c.copy(e.plane.normal) : c.copy(i.plane.normal);
@@ -888,27 +888,27 @@ W.prototype.closestPointToSegment = (function() {
888
888
  }
889
889
  function g(e, t, n, i) {
890
890
  let a = t.degenerateSegment, o = e.plane.distanceToPoint(a.start), s = e.plane.distanceToPoint(a.end);
891
- return U(o) ? U(s) ? p(e, t, n, i) : (n && (n.start.copy(a.start), n.end.copy(a.start)), e.containsPoint(a.start)) : U(s) ? (n && (n.start.copy(a.end), n.end.copy(a.end)), e.containsPoint(a.end)) : e.plane.intersectLine(a, r) == null ? !1 : (n && (n.start.copy(r), n.end.copy(r)), e.containsPoint(r));
891
+ return W(o) ? W(s) ? p(e, t, n, i) : (n && (n.start.copy(a.start), n.end.copy(a.start)), e.containsPoint(a.start)) : W(s) ? (n && (n.start.copy(a.end), n.end.copy(a.end)), e.containsPoint(a.end)) : e.plane.intersectLine(a, r) == null ? !1 : (n && (n.start.copy(r), n.end.copy(r)), e.containsPoint(r));
892
892
  }
893
893
  function _(e, t, n) {
894
894
  let r = t.a;
895
- return U(e.plane.distanceToPoint(r)) && e.containsPoint(r) ? (n && (n.start.copy(r), n.end.copy(r)), !0) : !1;
895
+ return W(e.plane.distanceToPoint(r)) && e.containsPoint(r) ? (n && (n.start.copy(r), n.end.copy(r)), !0) : !1;
896
896
  }
897
897
  function v(e, t, n) {
898
898
  let i = e.degenerateSegment, a = t.a;
899
- return i.closestPointToPoint(a, !0, r), a.distanceToSquared(r) < ot ? (n && (n.start.copy(a), n.end.copy(a)), !0) : !1;
899
+ return i.closestPointToPoint(a, !0, r), a.distanceToSquared(r) < at ? (n && (n.start.copy(a), n.end.copy(a)), !0) : !1;
900
900
  }
901
901
  function x(e, t, n, o) {
902
902
  if (e.isDegenerateIntoSegment) if (t.isDegenerateIntoSegment) {
903
903
  let o = e.degenerateSegment, s = t.degenerateSegment, c = i, l = a;
904
904
  o.delta(c), s.delta(l);
905
905
  let u = r.subVectors(s.start, o.start), d = c.x * l.y - c.y * l.x;
906
- if (U(d)) return !1;
906
+ if (W(d)) return !1;
907
907
  let f = (u.x * l.y - u.y * l.x) / d, p = -(c.x * u.y - c.y * u.x) / d;
908
- return f < 0 || f > 1 || p < 0 || p > 1 ? !1 : U(o.start.z + c.z * f - (s.start.z + l.z * p)) ? (n && (n.start.copy(o.start).addScaledVector(c, f), n.end.copy(o.start).addScaledVector(c, f)), !0) : !1;
908
+ return f < 0 || f > 1 || p < 0 || p > 1 ? !1 : W(o.start.z + c.z * f - (s.start.z + l.z * p)) ? (n && (n.start.copy(o.start).addScaledVector(c, f), n.end.copy(o.start).addScaledVector(c, f)), !0) : !1;
909
909
  } else if (t.isDegenerateIntoPoint) return v(e, t, n);
910
910
  else return g(t, e, n, o);
911
- else if (e.isDegenerateIntoPoint) return t.isDegenerateIntoPoint ? t.a.distanceToSquared(e.a) < ot ? (n && (n.start.copy(e.a), n.end.copy(e.a)), !0) : !1 : t.isDegenerateIntoSegment ? v(t, e, n) : _(t, e, n);
911
+ else if (e.isDegenerateIntoPoint) return t.isDegenerateIntoPoint ? t.a.distanceToSquared(e.a) < at ? (n && (n.start.copy(e.a), n.end.copy(e.a)), !0) : !1 : t.isDegenerateIntoSegment ? v(t, e, n) : _(t, e, n);
912
912
  else if (t.isDegenerateIntoPoint) return _(e, t, n);
913
913
  else if (t.isDegenerateIntoSegment) return g(e, t, n, o);
914
914
  }
@@ -917,17 +917,17 @@ W.prototype.closestPointToSegment = (function() {
917
917
  let o = x(this, t, n, r);
918
918
  if (o !== void 0) return o;
919
919
  let c = this.plane, m = t.plane, g = m.distanceToPoint(this.a), _ = m.distanceToPoint(this.b), v = m.distanceToPoint(this.c);
920
- U(g) && (g = 0), U(_) && (_ = 0), U(v) && (v = 0);
920
+ W(g) && (g = 0), W(_) && (_ = 0), W(v) && (v = 0);
921
921
  let y = g * _, b = g * v;
922
922
  if (y > 0 && b > 0) return !1;
923
923
  let S = c.distanceToPoint(t.a), C = c.distanceToPoint(t.b), w = c.distanceToPoint(t.c);
924
- U(S) && (S = 0), U(C) && (C = 0), U(w) && (w = 0);
924
+ W(S) && (S = 0), W(C) && (C = 0), W(w) && (w = 0);
925
925
  let T = S * C, ee = S * w;
926
926
  if (T > 0 && ee > 0) return !1;
927
927
  i.copy(c.normal), a.copy(m.normal);
928
928
  let te = i.cross(a), E = 0, ne = Math.abs(te.x), re = Math.abs(te.y);
929
929
  re > ne && (ne = re, E = 1), Math.abs(te.z) > ne && (E = 2);
930
- let D = at[E], ie = this.a[D], O = this.b[D], ae = this.c[D], oe = t.a[D], se = t.b[D], ce = t.c[D];
930
+ let D = it[E], ie = this.a[D], O = this.b[D], ae = this.c[D], oe = t.a[D], se = t.b[D], ce = t.c[D];
931
931
  if (h(this, ie, O, ae, y, b, g, _, v, d, s) || h(t, oe, se, ce, T, ee, S, C, w, f, l)) return p(this, t, n, r);
932
932
  if (d.y < d.x) {
933
933
  let e = d.y;
@@ -939,12 +939,12 @@ W.prototype.closestPointToSegment = (function() {
939
939
  }
940
940
  return d.y < f.x || f.y < d.x ? !1 : (n && (f.x > d.x ? n.start.copy(l.start) : n.start.copy(s.start), f.y < d.y ? n.end.copy(l.end) : n.end.copy(s.end)), !0);
941
941
  };
942
- })(), W.prototype.distanceToPoint = (function() {
942
+ })(), G.prototype.distanceToPoint = (function() {
943
943
  let e = /* @__PURE__ */ new b();
944
944
  return function(t) {
945
945
  return this.closestPointToPoint(t, e), t.distanceTo(e);
946
946
  };
947
- })(), W.prototype.distanceToTriangle = (function() {
947
+ })(), G.prototype.distanceToTriangle = (function() {
948
948
  let e = /* @__PURE__ */ new b(), t = /* @__PURE__ */ new b(), n = [
949
949
  "a",
950
950
  "b",
@@ -965,7 +965,7 @@ W.prototype.closestPointToSegment = (function() {
965
965
  r.set(this[u], this[d]);
966
966
  for (let c = 0; c < 3; c++) {
967
967
  let u = n[c], d = n[(c + 1) % 3];
968
- i.set(a[u], a[d]), rt(r, i, e, t);
968
+ i.set(a[u], a[d]), nt(r, i, e, t);
969
969
  let f = e.distanceToSquared(t);
970
970
  f < l && (l = f, o && o.copy(e), s && s.copy(t));
971
971
  }
@@ -975,7 +975,7 @@ W.prototype.closestPointToSegment = (function() {
975
975
  })();
976
976
  //#endregion
977
977
  //#region node_modules/three-mesh-bvh/src/math/OrientedBox.js
978
- var G = class {
978
+ var K = class {
979
979
  constructor(e, t, n) {
980
980
  this.isOrientedBox = !0, this.min = new b(), this.max = new b(), this.matrix = new d(), this.invMatrix = new d(), this.points = Array(8).fill().map(() => new b()), this.satAxes = [
981
981
  ,
@@ -985,11 +985,11 @@ var G = class {
985
985
  ,
986
986
  ,
987
987
  ,
988
- ].fill().map(() => new V()), this.alignedSatBounds = [
988
+ ].fill().map(() => new H()), this.alignedSatBounds = [
989
989
  ,
990
990
  ,
991
991
  ,
992
- ].fill().map(() => new V()), this.needsUpdate = !1, e && this.min.copy(e), t && this.max.copy(t), n && this.matrix.copy(n);
992
+ ].fill().map(() => new H()), this.needsUpdate = !1, e && this.min.copy(e), t && this.max.copy(t), n && this.matrix.copy(n);
993
993
  }
994
994
  set(e, t, n) {
995
995
  this.min.copy(e), this.max.copy(t), this.matrix.copy(n), this.needsUpdate = !0;
@@ -998,7 +998,7 @@ var G = class {
998
998
  this.min.copy(e.min), this.max.copy(e.max), this.matrix.copy(e.matrix), this.needsUpdate = !0;
999
999
  }
1000
1000
  };
1001
- G.prototype.update = (function() {
1001
+ K.prototype.update = (function() {
1002
1002
  return function() {
1003
1003
  let e = this.matrix, t = this.min, n = this.max, r = this.points;
1004
1004
  for (let i = 0; i <= 1; i++) for (let a = 0; a <= 1; a++) for (let o = 0; o <= 1; o++) {
@@ -1013,8 +1013,8 @@ G.prototype.update = (function() {
1013
1013
  let s = this.alignedSatBounds;
1014
1014
  s[0].setFromPointsField(r, "x"), s[1].setFromPointsField(r, "y"), s[2].setFromPointsField(r, "z"), this.invMatrix.copy(this.matrix).invert(), this.needsUpdate = !1;
1015
1015
  };
1016
- })(), G.prototype.intersectsBox = (function() {
1017
- let e = /* @__PURE__ */ new V();
1016
+ })(), K.prototype.intersectsBox = (function() {
1017
+ let e = /* @__PURE__ */ new H();
1018
1018
  return function(t) {
1019
1019
  this.needsUpdate && this.update();
1020
1020
  let n = t.min, r = t.max, i = this.satBounds, a = this.satAxes, o = this.alignedSatBounds;
@@ -1025,12 +1025,12 @@ G.prototype.update = (function() {
1025
1025
  }
1026
1026
  return !0;
1027
1027
  };
1028
- })(), G.prototype.intersectsTriangle = (function() {
1029
- let e = /* @__PURE__ */ new W(), t = [
1028
+ })(), K.prototype.intersectsTriangle = (function() {
1029
+ let e = /* @__PURE__ */ new G(), t = [
1030
1030
  ,
1031
1031
  ,
1032
1032
  ,
1033
- ], n = /* @__PURE__ */ new V(), r = /* @__PURE__ */ new V(), i = /* @__PURE__ */ new b();
1033
+ ], n = /* @__PURE__ */ new H(), r = /* @__PURE__ */ new H(), i = /* @__PURE__ */ new b();
1034
1034
  return function(a) {
1035
1035
  this.needsUpdate && this.update(), a.isExtendedTriangle ? a.needsUpdate && a.update() : (e.copy(a), e.update(), a = e);
1036
1036
  let o = this.satBounds, s = this.satAxes;
@@ -1053,16 +1053,16 @@ G.prototype.update = (function() {
1053
1053
  }
1054
1054
  return !0;
1055
1055
  };
1056
- })(), G.prototype.closestPointToPoint = (function() {
1056
+ })(), K.prototype.closestPointToPoint = (function() {
1057
1057
  return function(e, t) {
1058
1058
  return this.needsUpdate && this.update(), t.copy(e).applyMatrix4(this.invMatrix).clamp(this.min, this.max).applyMatrix4(this.matrix), t;
1059
1059
  };
1060
- })(), G.prototype.distanceToPoint = (function() {
1060
+ })(), K.prototype.distanceToPoint = (function() {
1061
1061
  let e = new b();
1062
1062
  return function(t) {
1063
1063
  return this.closestPointToPoint(t, e), t.distanceTo(e);
1064
1064
  };
1065
- })(), G.prototype.distanceToBox = (function() {
1065
+ })(), K.prototype.distanceToBox = (function() {
1066
1066
  let e = [
1067
1067
  "x",
1068
1068
  "y",
@@ -1093,7 +1093,7 @@ G.prototype.update = (function() {
1093
1093
  let a = t[e];
1094
1094
  for (let e = 0; e < 12; e++) {
1095
1095
  let t = n[e];
1096
- rt(a, t, r, i);
1096
+ nt(a, t, r, i);
1097
1097
  let o = r.distanceToSquared(i);
1098
1098
  if (o < p && (p = o, s && s.copy(r), c && c.copy(i), o < l)) return Math.sqrt(o);
1099
1099
  }
@@ -1101,29 +1101,29 @@ G.prototype.update = (function() {
1101
1101
  return Math.sqrt(p);
1102
1102
  };
1103
1103
  })();
1104
- var K = /* @__PURE__ */ new class extends Oe {
1104
+ var q = /* @__PURE__ */ new class extends Oe {
1105
1105
  constructor() {
1106
- super(() => new W());
1106
+ super(() => new G());
1107
1107
  }
1108
- }(), st = /* @__PURE__ */ new b(), ct = /* @__PURE__ */ new b();
1109
- function lt(e, t, n = {}, r = 0, i = Infinity) {
1108
+ }(), ot = /* @__PURE__ */ new b(), st = /* @__PURE__ */ new b();
1109
+ function ct(e, t, n = {}, r = 0, i = Infinity) {
1110
1110
  let a = r * r, o = i * i, s = Infinity, c = null;
1111
1111
  if (e.shapecast({
1112
- boundsTraverseOrder: (e) => (st.copy(t).clamp(e.min, e.max), st.distanceToSquared(t)),
1112
+ boundsTraverseOrder: (e) => (ot.copy(t).clamp(e.min, e.max), ot.distanceToSquared(t)),
1113
1113
  intersectsBounds: (e, t, n) => n < s && n < o,
1114
1114
  intersectsTriangle: (e, n) => {
1115
- e.closestPointToPoint(t, st);
1116
- let r = t.distanceToSquared(st);
1117
- return r < s && (ct.copy(st), s = r, c = n), r < a;
1115
+ e.closestPointToPoint(t, ot);
1116
+ let r = t.distanceToSquared(ot);
1117
+ return r < s && (st.copy(ot), s = r, c = n), r < a;
1118
1118
  }
1119
1119
  }), s === Infinity) return null;
1120
1120
  let l = Math.sqrt(s);
1121
- return n.point ? n.point.copy(ct) : n.point = ct.clone(), n.distance = l, n.faceIndex = c, n;
1121
+ return n.point ? n.point.copy(st) : n.point = st.clone(), n.distance = l, n.faceIndex = c, n;
1122
1122
  }
1123
1123
  //#endregion
1124
1124
  //#region node_modules/three-mesh-bvh/src/utils/ThreeRayIntersectUtilities.js
1125
- var ut = parseInt(h) >= 169, dt = parseInt(h) <= 161, q = /* @__PURE__ */ new b(), J = /* @__PURE__ */ new b(), Y = /* @__PURE__ */ new b(), ft = /* @__PURE__ */ new y(), pt = /* @__PURE__ */ new y(), mt = /* @__PURE__ */ new y(), ht = /* @__PURE__ */ new b(), gt = /* @__PURE__ */ new b(), _t = /* @__PURE__ */ new b(), vt = /* @__PURE__ */ new b();
1126
- function yt(e, n, r, i, o, s, c, l) {
1125
+ var lt = parseInt(h) >= 169, ut = parseInt(h) <= 161, J = /* @__PURE__ */ new b(), Y = /* @__PURE__ */ new b(), X = /* @__PURE__ */ new b(), dt = /* @__PURE__ */ new y(), ft = /* @__PURE__ */ new y(), pt = /* @__PURE__ */ new y(), mt = /* @__PURE__ */ new b(), ht = /* @__PURE__ */ new b(), gt = /* @__PURE__ */ new b(), _t = /* @__PURE__ */ new b();
1126
+ function vt(e, n, r, i, o, s, c, l) {
1127
1127
  let u;
1128
1128
  if (u = s === t ? e.intersectTriangle(i, r, n, !0, o) : e.intersectTriangle(n, r, i, s !== a, o), u === null) return null;
1129
1129
  let d = e.origin.distanceTo(o);
@@ -1132,24 +1132,24 @@ function yt(e, n, r, i, o, s, c, l) {
1132
1132
  point: o.clone()
1133
1133
  };
1134
1134
  }
1135
- function bt(e, t, n, r, i, a, o, s, c, l, u) {
1136
- q.fromBufferAttribute(t, a), J.fromBufferAttribute(t, o), Y.fromBufferAttribute(t, s);
1137
- let d = yt(e, q, J, Y, vt, c, l, u);
1135
+ function yt(e, t, n, r, i, a, o, s, c, l, u) {
1136
+ J.fromBufferAttribute(t, a), Y.fromBufferAttribute(t, o), X.fromBufferAttribute(t, s);
1137
+ let d = vt(e, J, Y, X, _t, c, l, u);
1138
1138
  if (d) {
1139
1139
  if (r) {
1140
- ft.fromBufferAttribute(r, a), pt.fromBufferAttribute(r, o), mt.fromBufferAttribute(r, s), d.uv = new y();
1141
- let e = v.getInterpolation(vt, q, J, Y, ft, pt, mt, d.uv);
1142
- ut || (d.uv = e);
1140
+ dt.fromBufferAttribute(r, a), ft.fromBufferAttribute(r, o), pt.fromBufferAttribute(r, s), d.uv = new y();
1141
+ let e = v.getInterpolation(_t, J, Y, X, dt, ft, pt, d.uv);
1142
+ lt || (d.uv = e);
1143
1143
  }
1144
1144
  if (i) {
1145
- ft.fromBufferAttribute(i, a), pt.fromBufferAttribute(i, o), mt.fromBufferAttribute(i, s), d.uv1 = new y();
1146
- let e = v.getInterpolation(vt, q, J, Y, ft, pt, mt, d.uv1);
1147
- ut || (d.uv1 = e), dt && (d.uv2 = d.uv1);
1145
+ dt.fromBufferAttribute(i, a), ft.fromBufferAttribute(i, o), pt.fromBufferAttribute(i, s), d.uv1 = new y();
1146
+ let e = v.getInterpolation(_t, J, Y, X, dt, ft, pt, d.uv1);
1147
+ lt || (d.uv1 = e), ut && (d.uv2 = d.uv1);
1148
1148
  }
1149
1149
  if (n) {
1150
- ht.fromBufferAttribute(n, a), gt.fromBufferAttribute(n, o), _t.fromBufferAttribute(n, s), d.normal = new b();
1151
- let t = v.getInterpolation(vt, q, J, Y, ht, gt, _t, d.normal);
1152
- d.normal.dot(e.direction) > 0 && d.normal.multiplyScalar(-1), ut || (d.normal = t);
1150
+ mt.fromBufferAttribute(n, a), ht.fromBufferAttribute(n, o), gt.fromBufferAttribute(n, s), d.normal = new b();
1151
+ let t = v.getInterpolation(_t, J, Y, X, mt, ht, gt, d.normal);
1152
+ d.normal.dot(e.direction) > 0 && d.normal.multiplyScalar(-1), lt || (d.normal = t);
1153
1153
  }
1154
1154
  let t = {
1155
1155
  a,
@@ -1158,17 +1158,17 @@ function bt(e, t, n, r, i, a, o, s, c, l, u) {
1158
1158
  normal: new b(),
1159
1159
  materialIndex: 0
1160
1160
  };
1161
- if (v.getNormal(q, J, Y, t.normal), d.face = t, d.faceIndex = a, ut) {
1161
+ if (v.getNormal(J, Y, X, t.normal), d.face = t, d.faceIndex = a, lt) {
1162
1162
  let e = new b();
1163
- v.getBarycoord(vt, q, J, Y, e), d.barycoord = e;
1163
+ v.getBarycoord(_t, J, Y, X, e), d.barycoord = e;
1164
1164
  }
1165
1165
  }
1166
1166
  return d;
1167
1167
  }
1168
- function xt(e) {
1168
+ function bt(e) {
1169
1169
  return e && e.isMaterial ? e.side : e;
1170
1170
  }
1171
- function St(e, t, n, r, i, a, o) {
1171
+ function xt(e, t, n, r, i, a, o) {
1172
1172
  let s = r * 3, c = s + 0, l = s + 1, u = s + 2, { index: d, groups: f } = e;
1173
1173
  e.index && (c = d.getX(c), l = d.getX(l), u = d.getX(u));
1174
1174
  let { position: p, normal: m, uv: h, uv1: g } = e.attributes;
@@ -1177,13 +1177,13 @@ function St(e, t, n, r, i, a, o) {
1177
1177
  for (let s = 0, d = f.length; s < d; s++) {
1178
1178
  let { start: d, count: _, materialIndex: v } = f[s];
1179
1179
  if (e >= d && e < d + _) {
1180
- let e = xt(t[v]), s = bt(n, p, m, h, g, c, l, u, e, a, o);
1180
+ let e = bt(t[v]), s = yt(n, p, m, h, g, c, l, u, e, a, o);
1181
1181
  if (s) if (s.faceIndex = r, s.face.materialIndex = v, i) i.push(s);
1182
1182
  else return s;
1183
1183
  }
1184
1184
  }
1185
1185
  } else {
1186
- let e = xt(t), s = bt(n, p, m, h, g, c, l, u, e, a, o);
1186
+ let e = bt(t), s = yt(n, p, m, h, g, c, l, u, e, a, o);
1187
1187
  if (s) if (s.faceIndex = r, s.face.materialIndex = 0, i) i.push(s);
1188
1188
  else return s;
1189
1189
  }
@@ -1191,35 +1191,35 @@ function St(e, t, n, r, i, a, o) {
1191
1191
  }
1192
1192
  //#endregion
1193
1193
  //#region node_modules/three-mesh-bvh/src/utils/TriangleUtilities.js
1194
- function X(e, t, n, r) {
1194
+ function Z(e, t, n, r) {
1195
1195
  let i = e.a, a = e.b, o = e.c, s = t, c = t + 1, l = t + 2;
1196
1196
  n && (s = n.getX(s), c = n.getX(c), l = n.getX(l)), i.x = r.getX(s), i.y = r.getY(s), i.z = r.getZ(s), a.x = r.getX(c), a.y = r.getY(c), a.z = r.getZ(c), o.x = r.getX(l), o.y = r.getY(l), o.z = r.getZ(l);
1197
1197
  }
1198
1198
  //#endregion
1199
1199
  //#region node_modules/three-mesh-bvh/src/core/utils/iterationUtils.generated.js
1200
- function Ct(e, t, n, r, i, a, o, s) {
1200
+ function St(e, t, n, r, i, a, o, s) {
1201
1201
  let { geometry: c, _indirectBuffer: l } = e;
1202
- for (let e = r, l = r + i; e < l; e++) St(c, t, n, e, a, o, s);
1202
+ for (let e = r, l = r + i; e < l; e++) xt(c, t, n, e, a, o, s);
1203
1203
  }
1204
- function wt(e, t, n, r, i, a, o) {
1204
+ function Ct(e, t, n, r, i, a, o) {
1205
1205
  let { geometry: s, _indirectBuffer: c } = e, l = Infinity, u = null;
1206
1206
  for (let e = r, c = r + i; e < c; e++) {
1207
1207
  let r;
1208
- r = St(s, t, n, e, null, a, o), r && r.distance < l && (u = r, l = r.distance);
1208
+ r = xt(s, t, n, e, null, a, o), r && r.distance < l && (u = r, l = r.distance);
1209
1209
  }
1210
1210
  return u;
1211
1211
  }
1212
- function Tt(e, t, n, r, i, a, o) {
1212
+ function wt(e, t, n, r, i, a, o) {
1213
1213
  let { geometry: s } = n, { index: c } = s, l = s.attributes.position;
1214
1214
  for (let n = e, s = t + e; n < s; n++) {
1215
1215
  let e;
1216
- if (e = n, X(o, e * 3, c, l), o.needsUpdate = !0, r(o, e, i, a)) return !0;
1216
+ if (e = n, Z(o, e * 3, c, l), o.needsUpdate = !0, r(o, e, i, a)) return !0;
1217
1217
  }
1218
1218
  return !1;
1219
1219
  }
1220
1220
  //#endregion
1221
1221
  //#region node_modules/three-mesh-bvh/src/core/cast/refit.generated.js
1222
- function Et(e, t = null) {
1222
+ function Tt(e, t = null) {
1223
1223
  t && Array.isArray(t) && (t = new Set(t));
1224
1224
  let n = e.geometry, r = n.index ? n.index.array : null, i = n.attributes.position, a, o, s, c, l = 0, u = e._roots;
1225
1225
  for (let e = 0, t = u.length; e < t; e++) a = u[e], o = new Uint32Array(a), s = new Uint16Array(a), c = new Float32Array(a), d(0, l), l += a.byteLength;
@@ -1255,77 +1255,77 @@ function Et(e, t = null) {
1255
1255
  }
1256
1256
  //#endregion
1257
1257
  //#region node_modules/three-mesh-bvh/src/core/utils/intersectUtils.js
1258
- function Z(e, t, n, r, i) {
1258
+ function Q(e, t, n, r, i) {
1259
1259
  let a, o, s, c, l, u, d = 1 / n.direction.x, f = 1 / n.direction.y, p = 1 / n.direction.z, m = n.origin.x, h = n.origin.y, g = n.origin.z, _ = t[e], v = t[e + 3], y = t[e + 1], b = t[e + 3 + 1], x = t[e + 2], S = t[e + 3 + 2];
1260
1260
  return d >= 0 ? (a = (_ - m) * d, o = (v - m) * d) : (a = (v - m) * d, o = (_ - m) * d), f >= 0 ? (s = (y - h) * f, c = (b - h) * f) : (s = (b - h) * f, c = (y - h) * f), a > c || s > o || ((s > a || isNaN(a)) && (a = s), (c < o || isNaN(o)) && (o = c), p >= 0 ? (l = (x - g) * p, u = (S - g) * p) : (l = (S - g) * p, u = (x - g) * p), a > u || l > o) ? !1 : ((l > a || a !== a) && (a = l), (u < o || o !== o) && (o = u), a <= i && o >= r);
1261
1261
  }
1262
1262
  //#endregion
1263
1263
  //#region node_modules/three-mesh-bvh/src/core/utils/iterationUtils_indirect.generated.js
1264
- function Dt(e, t, n, r, i, a, o, s) {
1264
+ function Et(e, t, n, r, i, a, o, s) {
1265
1265
  let { geometry: c, _indirectBuffer: l } = e;
1266
- for (let e = r, u = r + i; e < u; e++) St(c, t, n, l ? l[e] : e, a, o, s);
1266
+ for (let e = r, u = r + i; e < u; e++) xt(c, t, n, l ? l[e] : e, a, o, s);
1267
1267
  }
1268
- function Ot(e, t, n, r, i, a, o) {
1268
+ function Dt(e, t, n, r, i, a, o) {
1269
1269
  let { geometry: s, _indirectBuffer: c } = e, l = Infinity, u = null;
1270
1270
  for (let e = r, d = r + i; e < d; e++) {
1271
1271
  let r;
1272
- r = St(s, t, n, c ? c[e] : e, null, a, o), r && r.distance < l && (u = r, l = r.distance);
1272
+ r = xt(s, t, n, c ? c[e] : e, null, a, o), r && r.distance < l && (u = r, l = r.distance);
1273
1273
  }
1274
1274
  return u;
1275
1275
  }
1276
- function kt(e, t, n, r, i, a, o) {
1276
+ function Ot(e, t, n, r, i, a, o) {
1277
1277
  let { geometry: s } = n, { index: c } = s, l = s.attributes.position;
1278
1278
  for (let s = e, u = t + e; s < u; s++) {
1279
1279
  let e;
1280
- if (e = n.resolveTriangleIndex(s), X(o, e * 3, c, l), o.needsUpdate = !0, r(o, e, i, a)) return !0;
1280
+ if (e = n.resolveTriangleIndex(s), Z(o, e * 3, c, l), o.needsUpdate = !0, r(o, e, i, a)) return !0;
1281
1281
  }
1282
1282
  return !1;
1283
1283
  }
1284
1284
  //#endregion
1285
1285
  //#region node_modules/three-mesh-bvh/src/core/cast/raycast.generated.js
1286
- function At(e, t, n, r, i, a, o) {
1287
- L.setBuffer(e._roots[t]), jt(0, e, n, r, i, a, o), L.clearBuffer();
1286
+ function kt(e, t, n, r, i, a, o) {
1287
+ L.setBuffer(e._roots[t]), At(0, e, n, r, i, a, o), L.clearBuffer();
1288
1288
  }
1289
- function jt(e, t, n, r, i, a, o) {
1289
+ function At(e, t, n, r, i, a, o) {
1290
1290
  let { float32Array: s, uint16Array: c, uint32Array: l } = L, u = e * 2;
1291
- if (k(u, c)) Ct(t, n, r, A(e, l), j(u, c), i, a, o);
1291
+ if (k(u, c)) St(t, n, r, A(e, l), j(u, c), i, a, o);
1292
1292
  else {
1293
1293
  let c = M(e);
1294
- Z(c, s, r, a, o) && jt(c, t, n, r, i, a, o);
1294
+ Q(c, s, r, a, o) && At(c, t, n, r, i, a, o);
1295
1295
  let u = N(e, l);
1296
- Z(u, s, r, a, o) && jt(u, t, n, r, i, a, o);
1296
+ Q(u, s, r, a, o) && At(u, t, n, r, i, a, o);
1297
1297
  }
1298
1298
  }
1299
1299
  //#endregion
1300
1300
  //#region node_modules/three-mesh-bvh/src/core/cast/raycastFirst.generated.js
1301
- var Mt = [
1301
+ var jt = [
1302
1302
  "x",
1303
1303
  "y",
1304
1304
  "z"
1305
1305
  ];
1306
- function Nt(e, t, n, r, i, a) {
1306
+ function Mt(e, t, n, r, i, a) {
1307
1307
  L.setBuffer(e._roots[t]);
1308
- let o = Pt(0, e, n, r, i, a);
1308
+ let o = Nt(0, e, n, r, i, a);
1309
1309
  return L.clearBuffer(), o;
1310
1310
  }
1311
- function Pt(e, t, n, r, i, a) {
1311
+ function Nt(e, t, n, r, i, a) {
1312
1312
  let { float32Array: o, uint16Array: s, uint32Array: c } = L, l = e * 2;
1313
- if (k(l, s)) return wt(t, n, r, A(e, c), j(l, s), i, a);
1313
+ if (k(l, s)) return Ct(t, n, r, A(e, c), j(l, s), i, a);
1314
1314
  {
1315
- let s = ue(e, c), l = Mt[s], u = r.direction[l] >= 0, d, f;
1315
+ let s = ue(e, c), l = jt[s], u = r.direction[l] >= 0, d, f;
1316
1316
  u ? (d = M(e), f = N(e, c)) : (d = N(e, c), f = M(e));
1317
- let p = Z(d, o, r, i, a) ? Pt(d, t, n, r, i, a) : null;
1317
+ let p = Q(d, o, r, i, a) ? Nt(d, t, n, r, i, a) : null;
1318
1318
  if (p) {
1319
1319
  let e = p.point[l];
1320
1320
  if (u ? e <= o[f + s] : e >= o[f + s + 3]) return p;
1321
1321
  }
1322
- let m = Z(f, o, r, i, a) ? Pt(f, t, n, r, i, a) : null;
1322
+ let m = Q(f, o, r, i, a) ? Nt(f, t, n, r, i, a) : null;
1323
1323
  return p && m ? p.distance <= m.distance ? p : m : p || m || null;
1324
1324
  }
1325
1325
  }
1326
1326
  //#endregion
1327
1327
  //#region node_modules/three-mesh-bvh/src/core/cast/intersectsGeometry.generated.js
1328
- var Ft = /* @__PURE__ */ new r(), It = /* @__PURE__ */ new W(), Q = /* @__PURE__ */ new W(), Lt = /* @__PURE__ */ new d(), Rt = /* @__PURE__ */ new G(), zt = /* @__PURE__ */ new G();
1328
+ var Pt = /* @__PURE__ */ new r(), Ft = /* @__PURE__ */ new G(), It = /* @__PURE__ */ new G(), Lt = /* @__PURE__ */ new d(), Rt = /* @__PURE__ */ new K(), zt = /* @__PURE__ */ new K();
1329
1329
  function Bt(e, t, n, r) {
1330
1330
  L.setBuffer(e._roots[t]);
1331
1331
  let i = Vt(0, e, n, r);
@@ -1339,28 +1339,28 @@ function Vt(e, t, n, r, i = null) {
1339
1339
  intersectsBounds: (e) => zt.intersectsBox(e),
1340
1340
  intersectsTriangle: (e) => {
1341
1341
  e.a.applyMatrix4(r), e.b.applyMatrix4(r), e.c.applyMatrix4(r), e.needsUpdate = !0;
1342
- for (let t = p * 3, n = (m + p) * 3; t < n; t += 3) if (X(Q, t, l, u), Q.needsUpdate = !0, e.intersectsTriangle(Q)) return !0;
1342
+ for (let t = p * 3, n = (m + p) * 3; t < n; t += 3) if (Z(It, t, l, u), It.needsUpdate = !0, e.intersectsTriangle(It)) return !0;
1343
1343
  return !1;
1344
1344
  }
1345
1345
  });
1346
1346
  {
1347
- let e = Je(n);
1347
+ let e = qe(n);
1348
1348
  for (let t = p * 3, n = (m + p) * 3; t < n; t += 3) {
1349
- X(It, t, l, u), It.a.applyMatrix4(Lt), It.b.applyMatrix4(Lt), It.c.applyMatrix4(Lt), It.needsUpdate = !0;
1350
- for (let t = 0, n = e * 3; t < n; t += 3) if (X(Q, t, d, f), Q.needsUpdate = !0, It.intersectsTriangle(Q)) return !0;
1349
+ Z(Ft, t, l, u), Ft.a.applyMatrix4(Lt), Ft.b.applyMatrix4(Lt), Ft.c.applyMatrix4(Lt), Ft.needsUpdate = !0;
1350
+ for (let t = 0, n = e * 3; t < n; t += 3) if (Z(It, t, d, f), It.needsUpdate = !0, Ft.intersectsTriangle(It)) return !0;
1351
1351
  }
1352
1352
  }
1353
1353
  } else {
1354
1354
  let o = M(e), c = N(e, s);
1355
- return O(P(o), a, Ft), !!(i.intersectsBox(Ft) && Vt(o, t, n, r, i) || (O(P(c), a, Ft), i.intersectsBox(Ft) && Vt(c, t, n, r, i)));
1355
+ return O(P(o), a, Pt), !!(i.intersectsBox(Pt) && Vt(o, t, n, r, i) || (O(P(c), a, Pt), i.intersectsBox(Pt) && Vt(c, t, n, r, i)));
1356
1356
  }
1357
1357
  }
1358
1358
  //#endregion
1359
1359
  //#region node_modules/three-mesh-bvh/src/core/cast/closestPointToGeometry.generated.js
1360
- var Ht = /* @__PURE__ */ new d(), Ut = /* @__PURE__ */ new G(), Wt = /* @__PURE__ */ new G(), Gt = /* @__PURE__ */ new b(), Kt = /* @__PURE__ */ new b(), qt = /* @__PURE__ */ new b(), Jt = /* @__PURE__ */ new b();
1360
+ var Ht = /* @__PURE__ */ new d(), Ut = /* @__PURE__ */ new K(), Wt = /* @__PURE__ */ new K(), Gt = /* @__PURE__ */ new b(), Kt = /* @__PURE__ */ new b(), qt = /* @__PURE__ */ new b(), Jt = /* @__PURE__ */ new b();
1361
1361
  function Yt(e, t, n, r = {}, i = {}, a = 0, o = Infinity) {
1362
1362
  t.boundingBox || t.computeBoundingBox(), Ut.set(t.boundingBox.min, t.boundingBox.max, n), Ut.needsUpdate = !0;
1363
- let s = e.geometry, c = s.attributes.position, l = s.index, u = t.attributes.position, d = t.index, f = K.getPrimitive(), p = K.getPrimitive(), m = Gt, h = Kt, g = null, _ = null;
1363
+ let s = e.geometry, c = s.attributes.position, l = s.index, u = t.attributes.position, d = t.index, f = q.getPrimitive(), p = q.getPrimitive(), m = Gt, h = Kt, g = null, _ = null;
1364
1364
  i && (g = qt, _ = Jt);
1365
1365
  let v = Infinity, y = null, b = null;
1366
1366
  return Ht.copy(n).invert(), Wt.matrix.copy(Ht), e.shapecast({
@@ -1372,9 +1372,9 @@ function Yt(e, t, n, r = {}, i = {}, a = 0, o = Infinity) {
1372
1372
  intersectsBounds: (e, t, n) => n < v && n < o,
1373
1373
  intersectsRange: (t, i) => {
1374
1374
  for (let o = t, s = t + i; o < s; o++) {
1375
- X(p, 3 * o, d, u), p.a.applyMatrix4(n), p.b.applyMatrix4(n), p.c.applyMatrix4(n), p.needsUpdate = !0;
1375
+ Z(p, 3 * o, d, u), p.a.applyMatrix4(n), p.b.applyMatrix4(n), p.c.applyMatrix4(n), p.needsUpdate = !0;
1376
1376
  for (let t = e, n = e + r; t < n; t++) {
1377
- X(f, 3 * t, l, c), f.needsUpdate = !0;
1377
+ Z(f, 3 * t, l, c), f.needsUpdate = !0;
1378
1378
  let e = f.distanceToTriangle(p, m, g);
1379
1379
  if (e < v && (h.copy(m), _ && _.copy(g), v = e, y = t, b = o), e < a) return !0;
1380
1380
  }
@@ -1382,18 +1382,18 @@ function Yt(e, t, n, r = {}, i = {}, a = 0, o = Infinity) {
1382
1382
  }
1383
1383
  });
1384
1384
  {
1385
- let i = Je(t);
1385
+ let i = qe(t);
1386
1386
  for (let t = 0, o = i; t < o; t++) {
1387
- X(p, 3 * t, d, u), p.a.applyMatrix4(n), p.b.applyMatrix4(n), p.c.applyMatrix4(n), p.needsUpdate = !0;
1387
+ Z(p, 3 * t, d, u), p.a.applyMatrix4(n), p.b.applyMatrix4(n), p.c.applyMatrix4(n), p.needsUpdate = !0;
1388
1388
  for (let n = e, i = e + r; n < i; n++) {
1389
- X(f, 3 * n, l, c), f.needsUpdate = !0;
1389
+ Z(f, 3 * n, l, c), f.needsUpdate = !0;
1390
1390
  let e = f.distanceToTriangle(p, m, g);
1391
1391
  if (e < v && (h.copy(m), _ && _.copy(g), v = e, y = n, b = t), e < a) return !0;
1392
1392
  }
1393
1393
  }
1394
1394
  }
1395
1395
  }
1396
- }), K.releasePrimitive(f), K.releasePrimitive(p), v === Infinity ? null : (r.point ? r.point.copy(h) : r.point = h.clone(), r.distance = v, r.faceIndex = y, i && (i.point ? i.point.copy(_) : i.point = _.clone(), i.point.applyMatrix4(Ht), h.applyMatrix4(Ht), i.distance = h.sub(i.point).length(), i.faceIndex = b), r);
1396
+ }), q.releasePrimitive(f), q.releasePrimitive(p), v === Infinity ? null : (r.point ? r.point.copy(h) : r.point = h.clone(), r.distance = v, r.faceIndex = y, i && (i.point ? i.point.copy(_) : i.point = _.clone(), i.point.applyMatrix4(Ht), h.applyMatrix4(Ht), i.distance = h.sub(i.point).length(), i.faceIndex = b), r);
1397
1397
  }
1398
1398
  //#endregion
1399
1399
  //#region node_modules/three-mesh-bvh/src/core/cast/refit_indirect.generated.js
@@ -1443,12 +1443,12 @@ function Zt(e, t, n, r, i, a, o) {
1443
1443
  }
1444
1444
  function Qt(e, t, n, r, i, a, o) {
1445
1445
  let { float32Array: s, uint16Array: c, uint32Array: l } = L, u = e * 2;
1446
- if (k(u, c)) Dt(t, n, r, A(e, l), j(u, c), i, a, o);
1446
+ if (k(u, c)) Et(t, n, r, A(e, l), j(u, c), i, a, o);
1447
1447
  else {
1448
1448
  let c = M(e);
1449
- Z(c, s, r, a, o) && Qt(c, t, n, r, i, a, o);
1449
+ Q(c, s, r, a, o) && Qt(c, t, n, r, i, a, o);
1450
1450
  let u = N(e, l);
1451
- Z(u, s, r, a, o) && Qt(u, t, n, r, i, a, o);
1451
+ Q(u, s, r, a, o) && Qt(u, t, n, r, i, a, o);
1452
1452
  }
1453
1453
  }
1454
1454
  //#endregion
@@ -1465,22 +1465,22 @@ function en(e, t, n, r, i, a) {
1465
1465
  }
1466
1466
  function tn(e, t, n, r, i, a) {
1467
1467
  let { float32Array: o, uint16Array: s, uint32Array: c } = L, l = e * 2;
1468
- if (k(l, s)) return Ot(t, n, r, A(e, c), j(l, s), i, a);
1468
+ if (k(l, s)) return Dt(t, n, r, A(e, c), j(l, s), i, a);
1469
1469
  {
1470
1470
  let s = ue(e, c), l = $t[s], u = r.direction[l] >= 0, d, f;
1471
1471
  u ? (d = M(e), f = N(e, c)) : (d = N(e, c), f = M(e));
1472
- let p = Z(d, o, r, i, a) ? tn(d, t, n, r, i, a) : null;
1472
+ let p = Q(d, o, r, i, a) ? tn(d, t, n, r, i, a) : null;
1473
1473
  if (p) {
1474
1474
  let e = p.point[l];
1475
1475
  if (u ? e <= o[f + s] : e >= o[f + s + 3]) return p;
1476
1476
  }
1477
- let m = Z(f, o, r, i, a) ? tn(f, t, n, r, i, a) : null;
1477
+ let m = Q(f, o, r, i, a) ? tn(f, t, n, r, i, a) : null;
1478
1478
  return p && m ? p.distance <= m.distance ? p : m : p || m || null;
1479
1479
  }
1480
1480
  }
1481
1481
  //#endregion
1482
1482
  //#region node_modules/three-mesh-bvh/src/core/cast/intersectsGeometry_indirect.generated.js
1483
- var nn = /* @__PURE__ */ new r(), rn = /* @__PURE__ */ new W(), an = /* @__PURE__ */ new W(), on = /* @__PURE__ */ new d(), sn = /* @__PURE__ */ new G(), cn = /* @__PURE__ */ new G();
1483
+ var nn = /* @__PURE__ */ new r(), rn = /* @__PURE__ */ new G(), an = /* @__PURE__ */ new G(), on = /* @__PURE__ */ new d(), sn = /* @__PURE__ */ new K(), cn = /* @__PURE__ */ new K();
1484
1484
  function ln(e, t, n, r) {
1485
1485
  L.setBuffer(e._roots[t]);
1486
1486
  let i = un(0, e, n, r);
@@ -1494,15 +1494,15 @@ function un(e, t, n, r, i = null) {
1494
1494
  intersectsBounds: (e) => cn.intersectsBox(e),
1495
1495
  intersectsTriangle: (e) => {
1496
1496
  e.a.applyMatrix4(r), e.b.applyMatrix4(r), e.c.applyMatrix4(r), e.needsUpdate = !0;
1497
- for (let n = p, r = m + p; n < r; n++) if (X(an, 3 * t.resolveTriangleIndex(n), l, u), an.needsUpdate = !0, e.intersectsTriangle(an)) return !0;
1497
+ for (let n = p, r = m + p; n < r; n++) if (Z(an, 3 * t.resolveTriangleIndex(n), l, u), an.needsUpdate = !0, e.intersectsTriangle(an)) return !0;
1498
1498
  return !1;
1499
1499
  }
1500
1500
  });
1501
1501
  {
1502
- let e = Je(n);
1502
+ let e = qe(n);
1503
1503
  for (let n = p, r = m + p; n < r; n++) {
1504
- X(rn, 3 * t.resolveTriangleIndex(n), l, u), rn.a.applyMatrix4(on), rn.b.applyMatrix4(on), rn.c.applyMatrix4(on), rn.needsUpdate = !0;
1505
- for (let t = 0, n = e * 3; t < n; t += 3) if (X(an, t, d, f), an.needsUpdate = !0, rn.intersectsTriangle(an)) return !0;
1504
+ Z(rn, 3 * t.resolveTriangleIndex(n), l, u), rn.a.applyMatrix4(on), rn.b.applyMatrix4(on), rn.c.applyMatrix4(on), rn.needsUpdate = !0;
1505
+ for (let t = 0, n = e * 3; t < n; t += 3) if (Z(an, t, d, f), an.needsUpdate = !0, rn.intersectsTriangle(an)) return !0;
1506
1506
  }
1507
1507
  }
1508
1508
  } else {
@@ -1512,10 +1512,10 @@ function un(e, t, n, r, i = null) {
1512
1512
  }
1513
1513
  //#endregion
1514
1514
  //#region node_modules/three-mesh-bvh/src/core/cast/closestPointToGeometry_indirect.generated.js
1515
- var dn = /* @__PURE__ */ new d(), fn = /* @__PURE__ */ new G(), pn = /* @__PURE__ */ new G(), mn = /* @__PURE__ */ new b(), hn = /* @__PURE__ */ new b(), gn = /* @__PURE__ */ new b(), _n = /* @__PURE__ */ new b();
1515
+ var dn = /* @__PURE__ */ new d(), fn = /* @__PURE__ */ new K(), pn = /* @__PURE__ */ new K(), mn = /* @__PURE__ */ new b(), hn = /* @__PURE__ */ new b(), gn = /* @__PURE__ */ new b(), _n = /* @__PURE__ */ new b();
1516
1516
  function vn(e, t, n, r = {}, i = {}, a = 0, o = Infinity) {
1517
1517
  t.boundingBox || t.computeBoundingBox(), fn.set(t.boundingBox.min, t.boundingBox.max, n), fn.needsUpdate = !0;
1518
- let s = e.geometry, c = s.attributes.position, l = s.index, u = t.attributes.position, d = t.index, f = K.getPrimitive(), p = K.getPrimitive(), m = mn, h = hn, g = null, _ = null;
1518
+ let s = e.geometry, c = s.attributes.position, l = s.index, u = t.attributes.position, d = t.index, f = q.getPrimitive(), p = q.getPrimitive(), m = mn, h = hn, g = null, _ = null;
1519
1519
  i && (g = gn, _ = _n);
1520
1520
  let v = Infinity, y = null, b = null;
1521
1521
  return dn.copy(n).invert(), pn.matrix.copy(dn), e.shapecast({
@@ -1530,10 +1530,10 @@ function vn(e, t, n, r = {}, i = {}, a = 0, o = Infinity) {
1530
1530
  intersectsRange: (t, o) => {
1531
1531
  for (let x = t, S = t + o; x < S; x++) {
1532
1532
  let t = s.resolveTriangleIndex(x);
1533
- X(p, 3 * t, d, u), p.a.applyMatrix4(n), p.b.applyMatrix4(n), p.c.applyMatrix4(n), p.needsUpdate = !0;
1533
+ Z(p, 3 * t, d, u), p.a.applyMatrix4(n), p.b.applyMatrix4(n), p.c.applyMatrix4(n), p.needsUpdate = !0;
1534
1534
  for (let t = r, n = r + i; t < n; t++) {
1535
1535
  let n = e.resolveTriangleIndex(t);
1536
- X(f, 3 * n, l, c), f.needsUpdate = !0;
1536
+ Z(f, 3 * n, l, c), f.needsUpdate = !0;
1537
1537
  let r = f.distanceToTriangle(p, m, g);
1538
1538
  if (r < v && (h.copy(m), _ && _.copy(g), v = r, y = t, b = x), r < a) return !0;
1539
1539
  }
@@ -1541,19 +1541,19 @@ function vn(e, t, n, r = {}, i = {}, a = 0, o = Infinity) {
1541
1541
  }
1542
1542
  });
1543
1543
  } else {
1544
- let o = Je(t);
1544
+ let o = qe(t);
1545
1545
  for (let t = 0, s = o; t < s; t++) {
1546
- X(p, 3 * t, d, u), p.a.applyMatrix4(n), p.b.applyMatrix4(n), p.c.applyMatrix4(n), p.needsUpdate = !0;
1546
+ Z(p, 3 * t, d, u), p.a.applyMatrix4(n), p.b.applyMatrix4(n), p.c.applyMatrix4(n), p.needsUpdate = !0;
1547
1547
  for (let n = r, o = r + i; n < o; n++) {
1548
1548
  let r = e.resolveTriangleIndex(n);
1549
- X(f, 3 * r, l, c), f.needsUpdate = !0;
1549
+ Z(f, 3 * r, l, c), f.needsUpdate = !0;
1550
1550
  let i = f.distanceToTriangle(p, m, g);
1551
1551
  if (i < v && (h.copy(m), _ && _.copy(g), v = i, y = n, b = t), i < a) return !0;
1552
1552
  }
1553
1553
  }
1554
1554
  }
1555
1555
  }
1556
- }), K.releasePrimitive(f), K.releasePrimitive(p), v === Infinity ? null : (r.point ? r.point.copy(h) : r.point = h.clone(), r.distance = v, r.faceIndex = y, i && (i.point ? i.point.copy(_) : i.point = _.clone(), i.point.applyMatrix4(dn), h.applyMatrix4(dn), i.distance = h.sub(i.point).length(), i.faceIndex = b), r);
1556
+ }), q.releasePrimitive(f), q.releasePrimitive(p), v === Infinity ? null : (r.point ? r.point.copy(h) : r.point = h.clone(), r.distance = v, r.faceIndex = y, i && (i.point ? i.point.copy(_) : i.point = _.clone(), i.point.applyMatrix4(dn), h.applyMatrix4(dn), i.distance = h.sub(i.point).length(), i.faceIndex = b), r);
1557
1557
  }
1558
1558
  //#endregion
1559
1559
  //#region node_modules/three-mesh-bvh/src/utils/GeometryRayIntersectUtilities.js
@@ -1562,11 +1562,11 @@ function yn(e, t, n) {
1562
1562
  }
1563
1563
  //#endregion
1564
1564
  //#region node_modules/three-mesh-bvh/src/core/MeshBVH.js
1565
- var bn = /* @__PURE__ */ new G(), xn = /* @__PURE__ */ new g(), Sn = /* @__PURE__ */ new b(), Cn = /* @__PURE__ */ new d(), wn = /* @__PURE__ */ new b(), Tn = [
1565
+ var bn = /* @__PURE__ */ new K(), xn = /* @__PURE__ */ new g(), Sn = /* @__PURE__ */ new b(), Cn = /* @__PURE__ */ new d(), wn = /* @__PURE__ */ new b(), Tn = [
1566
1566
  "getX",
1567
1567
  "getY",
1568
1568
  "getZ"
1569
- ], En = class e extends tt {
1569
+ ], En = class e extends et {
1570
1570
  static serialize(e, t = {}) {
1571
1571
  t = {
1572
1572
  cloneBuffers: !0,
@@ -1680,15 +1680,15 @@ var bn = /* @__PURE__ */ new G(), xn = /* @__PURE__ */ new g(), Sn = /* @__PURE_
1680
1680
  return n;
1681
1681
  }
1682
1682
  refit(e = null) {
1683
- return (this.indirect ? Xt : Et)(this, e);
1683
+ return (this.indirect ? Xt : Tt)(this, e);
1684
1684
  }
1685
1685
  raycast(e, t = o, n = 0, r = Infinity) {
1686
- let i = this._roots, a = [], s = this.indirect ? Zt : At;
1686
+ let i = this._roots, a = [], s = this.indirect ? Zt : kt;
1687
1687
  for (let o = 0, c = i.length; o < c; o++) s(this, o, t, e, a, n, r);
1688
1688
  return a;
1689
1689
  }
1690
1690
  raycastFirst(e, t = o, n = 0, r = Infinity) {
1691
- let i = this._roots, a = null, s = this.indirect ? en : Nt;
1691
+ let i = this._roots, a = null, s = this.indirect ? en : Mt;
1692
1692
  for (let o = 0, c = i.length; o < c; o++) {
1693
1693
  let i = s(this, o, t, e, n, r);
1694
1694
  i != null && (a == null || i.distance < a.distance) && (a = i);
@@ -1701,25 +1701,25 @@ var bn = /* @__PURE__ */ new G(), xn = /* @__PURE__ */ new g(), Sn = /* @__PURE_
1701
1701
  return n;
1702
1702
  }
1703
1703
  shapecast(e) {
1704
- let t = K.getPrimitive(), n = super.shapecast({
1704
+ let t = q.getPrimitive(), n = super.shapecast({
1705
1705
  ...e,
1706
1706
  intersectsPrimitive: e.intersectsTriangle,
1707
1707
  scratchPrimitive: t,
1708
- iterate: this.indirect ? kt : Tt
1708
+ iterate: this.indirect ? Ot : wt
1709
1709
  });
1710
- return K.releasePrimitive(t), n;
1710
+ return q.releasePrimitive(t), n;
1711
1711
  }
1712
1712
  bvhcast(t, n, r) {
1713
- let { intersectsRanges: i, intersectsTriangles: a } = r, o = K.getPrimitive(), s = this.geometry.index, c = this.geometry.attributes.position, l = this.indirect ? (e) => {
1713
+ let { intersectsRanges: i, intersectsTriangles: a } = r, o = q.getPrimitive(), s = this.geometry.index, c = this.geometry.attributes.position, l = this.indirect ? (e) => {
1714
1714
  let t = this.resolveTriangleIndex(e);
1715
- X(o, t * 3, s, c);
1715
+ Z(o, t * 3, s, c);
1716
1716
  } : (e) => {
1717
- X(o, e * 3, s, c);
1718
- }, u = K.getPrimitive(), d = t.geometry.index, f = t.geometry.attributes.position, p = t.indirect ? (e) => {
1717
+ Z(o, e * 3, s, c);
1718
+ }, u = q.getPrimitive(), d = t.geometry.index, f = t.geometry.attributes.position, p = t.indirect ? (e) => {
1719
1719
  let n = t.resolveTriangleIndex(e);
1720
- X(u, n * 3, d, f);
1720
+ Z(u, n * 3, d, f);
1721
1721
  } : (e) => {
1722
- X(u, e * 3, d, f);
1722
+ Z(u, e * 3, d, f);
1723
1723
  };
1724
1724
  if (a) {
1725
1725
  if (!(t instanceof e)) throw Error("MeshBVH: \"intersectsTriangles\" callback can only be used with another MeshBVH.");
@@ -1755,7 +1755,7 @@ var bn = /* @__PURE__ */ new G(), xn = /* @__PURE__ */ new g(), Sn = /* @__PURE_
1755
1755
  return (this.indirect ? vn : Yt)(this, e, t, n, r, i, a);
1756
1756
  }
1757
1757
  closestPointToPoint(e, t = {}, n = 0, r = Infinity) {
1758
- return lt(this, e, t, n, r);
1758
+ return ct(this, e, t, n, r);
1759
1759
  }
1760
1760
  }, Dn = {
1761
1761
  Mesh: f.prototype.raycast,
@@ -1821,47 +1821,52 @@ function Mn(e) {
1821
1821
  }
1822
1822
  //#endregion
1823
1823
  //#region src/infrastructure/three/disposal.ts
1824
- function Nn(t) {
1825
- let n = t;
1826
- for (let t of Object.keys(n)) {
1827
- let r = n[t];
1828
- r instanceof e.Texture && r.dispose();
1824
+ var Nn = "softboxExternallyOwnedTextures", Pn = "softboxBackgroundNode", Fn = "softboxStashedMaterials";
1825
+ function In(t) {
1826
+ if (!t.userData.softboxDisposed) {
1827
+ if (!t.userData?.softboxExternallyOwnedTextures) {
1828
+ let n = t;
1829
+ for (let t of Object.keys(n)) {
1830
+ let r = n[t];
1831
+ r instanceof e.Texture && r.dispose();
1832
+ }
1833
+ let r = t;
1834
+ if (r.isShaderMaterial && r.uniforms) for (let t of Object.values(r.uniforms)) t?.value instanceof e.Texture && t.value.dispose();
1835
+ }
1836
+ t.dispose(), t.userData.softboxDisposed = !0;
1829
1837
  }
1830
- let r = t;
1831
- if (r.isShaderMaterial && r.uniforms) for (let t of Object.values(r.uniforms)) t?.value instanceof e.Texture && t.value.dispose();
1832
- t.dispose();
1833
1838
  }
1834
- function Pn(e) {
1839
+ function Ln(e) {
1835
1840
  e.traverse((e) => {
1836
1841
  let t = e;
1837
1842
  t.geometry && typeof t.geometry.dispose == "function" && (Mn(t.geometry), t.geometry.dispose());
1838
1843
  let n = t.material;
1839
- Array.isArray(n) ? n.forEach(Nn) : n && Nn(n);
1844
+ Array.isArray(n) ? n.forEach(In) : n && In(n), (e.userData?.[Fn])?.forEach(In);
1840
1845
  let r = e;
1841
1846
  r.isLight && r.shadow?.dispose && r.shadow.dispose();
1842
1847
  });
1843
1848
  }
1844
- function Fn(t, n) {
1849
+ function Rn(t, n) {
1845
1850
  if (!n?.keepBackgrounds) {
1846
1851
  t.background instanceof e.Texture && (t.background.dispose(), t.background = null), t.environment instanceof e.Texture && (t.environment.dispose(), t.environment = null);
1847
1852
  let n = t;
1848
1853
  n.__originalEnvironmentTexture &&= void 0;
1849
1854
  }
1850
- for (let e of [...t.children]) Pn(e), t.remove(e);
1855
+ for (let e of [...t.children]) n?.keepBackgrounds && e.userData?.softboxBackgroundNode || (Ln(e), t.remove(e));
1851
1856
  }
1852
1857
  //#endregion
1853
1858
  //#region src/infrastructure/three/ContactShadowBaker.ts
1854
- var In = "contact-shadow-baked", Ln = "contact-shadow-live", Rn = "softboxContactShadowHelper", zn = "softboxPathTracingFloor", Bn = Math.PI * (3 - Math.sqrt(5));
1855
- function Vn(e) {
1856
- let t = e.getObjectByName(In);
1857
- t && (e.remove(t), Pn(t));
1858
- }
1859
- function Hn(e) {
1860
- Vn(e);
1861
- let t = e.getObjectByName(Ln);
1859
+ var zn = "contact-shadow-baked", Bn = "contact-shadow-live", Vn = "softboxContactShadowHelper", Hn = "softboxPathTracingFloor", Un = Math.PI * (3 - Math.sqrt(5));
1860
+ function Wn(e) {
1861
+ let t = e.getObjectByName(zn);
1862
+ t && (e.remove(t), Ln(t));
1863
+ }
1864
+ function Gn(e) {
1865
+ Wn(e);
1866
+ let t = e.getObjectByName(Bn);
1862
1867
  t && (t.visible = !0);
1863
1868
  }
1864
- var Un = class t {
1869
+ var Kn = class t {
1865
1870
  static {
1866
1871
  this.AMBIENT_RATIO = .62;
1867
1872
  }
@@ -1924,7 +1929,7 @@ var Un = class t {
1924
1929
  }
1925
1930
  let s = this.measureBakeRegion(a);
1926
1931
  if (!s) return;
1927
- let c = i.getObjectByName(Ln);
1932
+ let c = i.getObjectByName(Bn);
1928
1933
  c?.geometry instanceof e.CircleGeometry && (s.halfExtent = Math.min(s.halfExtent, c.geometry.parameters.radius));
1929
1934
  let l = new e.WebGLRenderTarget(t.ACCUMULATION_TEXTURE_SIZE, t.ACCUMULATION_TEXTURE_SIZE, {
1930
1935
  type: r.capabilities.isWebGL2 ? e.HalfFloatType : e.UnsignedByteType,
@@ -1943,10 +1948,10 @@ var Un = class t {
1943
1948
  this.installBakedMesh(i, s, l, u);
1944
1949
  }
1945
1950
  leaveLiveCatcherInCharge(e) {
1946
- Hn(e);
1951
+ Gn(e);
1947
1952
  }
1948
1953
  evictBakedMesh(e) {
1949
- Vn(e);
1954
+ Wn(e);
1950
1955
  }
1951
1956
  measureBakeRegion(n) {
1952
1957
  let r = new e.Box3().setFromObject(n);
@@ -2015,12 +2020,12 @@ var Un = class t {
2015
2020
  l.lengthSq() < 1e-6 && l.set(1, 0, 0), l.normalize();
2016
2021
  let u = new e.Vector3().crossVectors(c, l), d = Math.round(r * t.AMBIENT_RATIO), f = r - d, p = e.MathUtils.degToRad(t.LIGHT_APERTURE_DEGREES), m = Math.tan(p / 2) * s, h = [];
2017
2022
  for (let e = 0; e < f; e++) {
2018
- let t = m * Math.sqrt((e + .5) / f), n = e * Bn;
2023
+ let t = m * Math.sqrt((e + .5) / f), n = e * Un;
2019
2024
  h.push(i.clone().addScaledVector(l, t * Math.cos(n)).addScaledVector(u, t * Math.sin(n)));
2020
2025
  }
2021
2026
  let g = Math.sin(e.MathUtils.degToRad(t.AMBIENT_MIN_ELEVATION_DEGREES)), _ = t.AMBIENT_MAX_ELEVATION_SIN;
2022
2027
  for (let t = 0; t < d; t++) {
2023
- let n = Math.sqrt((t + .5) / d), r = g + (_ - g) * n, i = Math.sqrt(1 - r * r), o = t * Bn;
2028
+ let n = Math.sqrt((t + .5) / d), r = g + (_ - g) * n, i = Math.sqrt(1 - r * r), o = t * Un;
2024
2029
  h.push(new e.Vector3(i * Math.cos(o), r, i * Math.sin(o)).multiplyScalar(s).add(a));
2025
2030
  }
2026
2031
  return h;
@@ -2038,10 +2043,10 @@ var Un = class t {
2038
2043
  e.fragmentShader = e.fragmentShader.replace("#include <map_fragment>", "#include <map_fragment>\n diffuseColor.a = pow(diffuseColor.a, 0.75);");
2039
2044
  }, o.customProgramCacheKey = () => "contact-shadow-alpha-gamma", o.addEventListener("dispose", () => i.dispose());
2040
2045
  let s = new e.Mesh(a, o);
2041
- s.name = In, s.userData[Rn] = !0, s.rotation.x = -Math.PI / 2;
2046
+ s.name = zn, s.userData[Vn] = !0, s.rotation.x = -Math.PI / 2;
2042
2047
  let c = e.MathUtils.clamp(r.objectHeight * t.FLOOR_LIFT_PER_HEIGHT, t.FLOOR_LIFT_MIN, t.FLOOR_LIFT_MAX);
2043
2048
  s.position.set(r.center.x, c, r.center.z), s.userData.renderTarget = i, n.add(s);
2044
- let l = n.getObjectByName(Ln);
2049
+ let l = n.getObjectByName(Bn);
2045
2050
  l && (l.visible = !1);
2046
2051
  }
2047
2052
  disableColorWrite(e) {
@@ -2058,30 +2063,33 @@ var Un = class t {
2058
2063
  t.colorWrite = e;
2059
2064
  });
2060
2065
  }
2061
- }, Wn = (e, t) => {
2066
+ }, qn = (e, t) => {
2062
2067
  if (e && typeof e == "object") {
2063
2068
  let n = e[t];
2064
2069
  if (typeof n == "function") return n.call(e);
2065
2070
  }
2066
2071
  return null;
2067
2072
  };
2068
- function Gn(t) {
2069
- return Wn(t, "getThreeObject") ?? (t instanceof e.Object3D ? t : null);
2073
+ function Jn(t) {
2074
+ return qn(t, "getThreeObject") ?? (t instanceof e.Object3D ? t : null);
2070
2075
  }
2071
- function Kn(t) {
2072
- return Wn(t, "getThreeCamera") ?? (t instanceof e.Camera ? t : null);
2076
+ function Yn(t) {
2077
+ return qn(t, "getThreeCamera") ?? (t instanceof e.Camera ? t : null);
2073
2078
  }
2074
- function qn(t) {
2075
- return Wn(t, "getThreeScene") ?? (t instanceof e.Scene ? t : null);
2079
+ function Xn(t) {
2080
+ return qn(t, "getThreeScene") ?? (t instanceof e.Scene ? t : null);
2076
2081
  }
2077
- function Jn(t) {
2078
- return Wn(t, "getThreeTexture") ?? (t instanceof e.Texture ? t : null);
2082
+ function Zn(t) {
2083
+ return qn(t, "getThreeTexture") ?? (t instanceof e.Texture ? t : null);
2079
2084
  }
2080
- function Yn(t) {
2081
- return Wn(t, "getThreeRenderer") ?? (t instanceof e.WebGLRenderer ? t : null);
2085
+ function Qn(t) {
2086
+ return qn(t, "getThreeRenderer") ?? (t instanceof e.WebGLRenderer ? t : null);
2082
2087
  }
2083
- function Xn(e) {
2084
- return Wn(e, "getThreeControls");
2088
+ function $n(e) {
2089
+ return qn(e, "getThreeControls");
2085
2090
  }
2086
2091
  //#endregion
2087
- export { x as A, ue as C, w as D, T as E, C as O, A as S, ee as T, Ye as _, qn as a, j as b, Rn as c, zn as d, Hn as f, En as g, jn as h, Yn as i, S as k, Ln as l, Fn as m, Xn as n, Jn as o, Pn as p, Gn as r, In as s, Kn as t, Un as u, qe as v, ne as w, k as x, P as y };
2092
+ //#region src/utils/smoothstep.ts
2093
+ var er = (e) => e * e * (3 - 2 * e);
2094
+ //#endregion
2095
+ export { ee as A, Ke as C, A as D, k as E, x as F, w as M, C as N, ue as O, S as P, Je as S, j as T, In as _, Qn as a, jn as b, zn as c, Kn as d, Hn as f, Fn as g, Nn as h, Jn as i, T as j, ne as k, Vn as l, Pn as m, Yn as n, Xn as o, Gn as p, $n as r, Zn as s, er as t, Bn as u, Ln as v, P as w, En as x, Rn as y };