u-space 0.0.21 → 0.0.22

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.js CHANGED
@@ -1,22 +1,22 @@
1
- import { Raycaster as Be, Vector2 as C, EventDispatcher as Le, Box2 as tt, Matrix4 as Ie, Vector3 as w, Box3 as X, Scene as Re, Color as M, AmbientLight as st, DirectionalLight as ue, PointLight as me, SpotLight as fe, HemisphereLight as ge, DirectionalLightHelper as nt, PointLightHelper as it, SpotLightHelper as rt, HemisphereLightHelper as ot, RenderPipeline as at, PerspectiveCamera as J, Sphere as ze, Spherical as S, Quaternion as ct, Vector4 as ht, MathUtils as lt, PMREMGenerator as dt, OrthographicCamera as V, TimestampQuery as pt, Cache as ut, Timer as mt, WebGPURenderer as ft, PCFShadowMap as gt, AgXToneMapping as yt, Fog as wt, FogExp2 as vt, MeshStandardNodeMaterial as R, Loader as bt, LoaderUtils as L, FileLoader as Ne, TextureLoader as je, Group as I, SRGBColorSpace as De, RepeatWrapping as ye, BufferGeometry as K, BufferAttribute as we, Mesh as D, FrontSide as xt, BackSide as Ct, DoubleSide as St, REVISION as ve, CubeTextureLoader as Mt, EquirectangularReflectionMapping as _t, Sprite as Tt, AnimationMixer as Et, LoopRepeat as Pt, LoopOnce as Ot, SphereGeometry as At, TubeGeometry as Bt, LineCurve3 as Lt, CatmullRomCurve3 as It, SpriteNodeMaterial as Rt, CanvasTexture as zt, ShapeGeometry as Nt, Shape as ke, ExtrudeGeometry as jt, PlaneGeometry as Dt, CircleGeometry as kt, ClippingGroup as Ut, Plane as Ht, PlaneHelper as Ft, LineBasicMaterial as Z, Line as ee } from "three/webgpu";
2
- import { pass as de, mrt as Gt, output as $t, add as be, blendColor as Wt, emissive as Kt, normalView as Qt, velocity as Xt, color as H, uv as xe, time as te, pow as se, sin as pe, mix as ne, mx_noise_float as Ce, Fn as Ue, userData as B, materialColor as Se, select as ie, materialOpacity as qt, vec3 as Yt } from "three/tsl";
1
+ import { Raycaster as Le, Vector2 as C, EventDispatcher as Re, Box2 as st, Matrix4 as Ie, Vector3 as w, Box3 as q, Scene as ze, Color as M, AmbientLight as nt, DirectionalLight as me, PointLight as fe, SpotLight as ge, HemisphereLight as ye, DirectionalLightHelper as it, PointLightHelper as rt, SpotLightHelper as at, HemisphereLightHelper as ot, RenderPipeline as ct, PerspectiveCamera as V, Sphere as Ne, Spherical as S, Quaternion as ht, Vector4 as lt, MathUtils as dt, PMREMGenerator as pt, OrthographicCamera as Z, TimestampQuery as Y, Cache as ut, Timer as mt, WebGPURenderer as ft, PCFShadowMap as gt, AgXToneMapping as yt, Fog as wt, FogExp2 as vt, MeshStandardNodeMaterial as I, Loader as bt, LoaderUtils as L, FileLoader as je, TextureLoader as De, Group as R, SRGBColorSpace as ke, RepeatWrapping as we, BufferGeometry as K, BufferAttribute as ve, Mesh as D, FrontSide as xt, BackSide as Ct, DoubleSide as St, REVISION as be, CubeTextureLoader as Mt, EquirectangularReflectionMapping as Tt, Sprite as _t, AnimationMixer as Et, LoopRepeat as Pt, LoopOnce as Ot, SphereGeometry as At, TubeGeometry as Bt, LineCurve3 as Lt, CatmullRomCurve3 as Rt, SpriteNodeMaterial as It, CanvasTexture as zt, ShapeGeometry as Nt, Shape as Ue, ExtrudeGeometry as jt, PlaneGeometry as Dt, CircleGeometry as kt, ClippingGroup as Ut, Plane as Ht, PlaneHelper as Ft, LineBasicMaterial as ee, Line as te } from "three/webgpu";
2
+ import { pass as pe, mrt as Gt, output as $t, add as xe, blendColor as Wt, emissive as Kt, normalView as Qt, velocity as qt, color as H, uv as Ce, time as se, pow as ne, sin as ue, mix as ie, mx_noise_float as Se, Fn as He, userData as B, materialColor as Me, select as re, materialOpacity as Xt, vec3 as Yt } from "three/tsl";
3
3
  import { bloom as Jt } from "three/addons/tsl/display/BloomNode.js";
4
4
  import { ssgi as Vt } from "three/addons/tsl/display/SSGINode.js";
5
5
  import { traa as Zt } from "three/addons/tsl/display/TRAANode.js";
6
- import He from "camera-controls";
6
+ import Fe from "camera-controls";
7
7
  import { RoomEnvironment as es } from "three/addons/environments/RoomEnvironment.js";
8
8
  import { ViewHelper as ts } from "three/addons/helpers/ViewHelper.js";
9
9
  import { CSS2DRenderer as ss, CSS2DObject as ns } from "three/addons/renderers/CSS2DRenderer.js";
10
- import { CSS2DObject as Nn } from "three/addons/renderers/CSS2DRenderer.js";
11
- import { CSS3DRenderer as is, CSS3DSprite as rs, CSS3DObject as os } from "three/addons/renderers/CSS3DRenderer.js";
12
- import { CSS3DObject as Dn, CSS3DSprite as kn } from "three/addons/renderers/CSS3DRenderer.js";
13
- import { GLTFLoader as Fe } from "three/addons/loaders/GLTFLoader.js";
14
- import { FBXLoader as as } from "three/addons/loaders/FBXLoader.js";
10
+ import { CSS2DObject as jn } from "three/addons/renderers/CSS2DRenderer.js";
11
+ import { CSS3DRenderer as is, CSS3DSprite as rs, CSS3DObject as as } from "three/addons/renderers/CSS3DRenderer.js";
12
+ import { CSS3DObject as kn, CSS3DSprite as Un } from "three/addons/renderers/CSS3DRenderer.js";
13
+ import { GLTFLoader as Ge } from "three/addons/loaders/GLTFLoader.js";
14
+ import { FBXLoader as os } from "three/addons/loaders/FBXLoader.js";
15
15
  import { OBJLoader as cs } from "three/addons/loaders/OBJLoader.js";
16
16
  import { STLLoader as hs } from "three/addons/loaders/STLLoader.js";
17
17
  import { DRACOLoader as ls } from "three/addons/loaders/DRACOLoader.js";
18
18
  import { KTX2Loader as ds } from "three/addons/loaders/KTX2Loader.js";
19
- import { MeshoptDecoder as Me } from "three/addons/libs/meshopt_decoder.module.js";
19
+ import { MeshoptDecoder as Te } from "three/addons/libs/meshopt_decoder.module.js";
20
20
  import { HDRLoader as ps } from "three/addons/loaders/HDRLoader.js";
21
21
  import { clone as us } from "three/addons/utils/SkeletonUtils.js";
22
22
  import { Easing as m, Tween as ms } from "three/addons/libs/tween.module.js";
@@ -52,7 +52,7 @@ class gs {
52
52
  domElement;
53
53
  scene;
54
54
  camera;
55
- raycaster = new Be();
55
+ raycaster = new Le();
56
56
  pointer = new C();
57
57
  hoveredObject = null;
58
58
  pointerDownTime = 0;
@@ -205,7 +205,7 @@ class gs {
205
205
  this.domElement.removeEventListener("click", this._onClick), this.domElement.removeEventListener("dblclick", this._onDblClick), this.domElement.removeEventListener("contextmenu", this._onContextMenu), this.domElement.removeEventListener("pointerdown", this._onPointerDown), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.clickTimer && (clearTimeout(this.clickTimer), this.clickTimer = null), this.hoveredObject = null, this._excludeSet.clear();
206
206
  }
207
207
  }
208
- class vn extends Le {
208
+ class bn extends Re {
209
209
  scene;
210
210
  camera;
211
211
  domElement;
@@ -321,21 +321,21 @@ class vn extends Le {
321
321
  ), i = new C(
322
322
  this._endPoint.x / t * 2 - 1,
323
323
  -(this._endPoint.y / s) * 2 + 1
324
- ), r = new tt(
324
+ ), r = new st(
325
325
  new C(Math.min(n.x, i.x), Math.min(n.y, i.y)),
326
326
  new C(Math.max(n.x, i.x), Math.max(n.y, i.y))
327
- ), o = this.targetObjects || this.scene.children, a = [], c = new Ie();
327
+ ), a = this.targetObjects || this.scene.children, o = [], c = new Ie();
328
328
  c.multiplyMatrices(this.camera.projectionMatrix, this.camera.matrixWorldInverse);
329
329
  const l = (d) => {
330
330
  if (!d.visible) return;
331
331
  const p = new w();
332
- if (p.setFromMatrixPosition(d.matrixWorld), p.applyMatrix4(c), p.z > -1 && p.z < 1 && r.containsPoint(new C(p.x, p.y)) && a.push(d), this._deep)
332
+ if (p.setFromMatrixPosition(d.matrixWorld), p.applyMatrix4(c), p.z > -1 && p.z < 1 && r.containsPoint(new C(p.x, p.y)) && o.push(d), this._deep)
333
333
  for (const u of d.children)
334
334
  l(u);
335
335
  };
336
- for (const d of o)
336
+ for (const d of a)
337
337
  l(d);
338
- return a;
338
+ return o;
339
339
  }
340
340
  dispose() {
341
341
  this.disableBoxSelection(), this._selected.clear();
@@ -475,15 +475,15 @@ class ys {
475
475
  const i = n.material;
476
476
  if (!i) return;
477
477
  const r = Array.isArray(i) ? i : [i];
478
- for (const o of r)
479
- o.transparent = t < 1, o.opacity = t, o.needsUpdate = !0;
478
+ for (const a of r)
479
+ a.transparent = t < 1, a.opacity = t, a.needsUpdate = !0;
480
480
  });
481
481
  }
482
482
  /**
483
483
  * Get the bounding box of an object by id, or all objects if no id provided.
484
484
  */
485
485
  getBoundingBox(e) {
486
- const t = new X();
486
+ const t = new q();
487
487
  if (e) {
488
488
  const s = this.idMap.get(e);
489
489
  s && t.setFromObject(s);
@@ -518,7 +518,7 @@ class ys {
518
518
  e.visible = !0;
519
519
  }
520
520
  }
521
- class bn {
521
+ class xn {
522
522
  scenes = /* @__PURE__ */ new Map();
523
523
  _activeSceneKey = null;
524
524
  /**
@@ -531,7 +531,7 @@ class bn {
531
531
  * Create and register a new scene.
532
532
  */
533
533
  create(e, t = {}) {
534
- const s = new Re();
534
+ const s = new ze();
535
535
  return t.background !== void 0 && (s.background = new M(t.background)), this.scenes.set(e, s), s;
536
536
  }
537
537
  /**
@@ -592,7 +592,7 @@ class bn {
592
592
  return this.scenes.size;
593
593
  }
594
594
  }
595
- class xn {
595
+ class Cn {
596
596
  scene;
597
597
  lights = /* @__PURE__ */ new Map();
598
598
  helpers = /* @__PURE__ */ new Map();
@@ -600,16 +600,16 @@ class xn {
600
600
  this.scene = e;
601
601
  }
602
602
  addAmbient(e, t = {}) {
603
- const { color: s = 16777215, intensity: n = 0.5 } = t, i = new st(s, n);
603
+ const { color: s = 16777215, intensity: n = 0.5 } = t, i = new nt(s, n);
604
604
  return i.name = e, this._register(e, i), i;
605
605
  }
606
606
  addDirectional(e, t = {}) {
607
- const { color: s = 16777215, intensity: n = 1, position: i = { x: 5, y: 10, z: 5 }, castShadow: r = !1, shadowMapSize: o = 1024 } = t, a = new ue(s, n);
608
- return a.position.set(i.x, i.y, i.z), a.castShadow = r, r && a.shadow.mapSize.setScalar(o), a.name = e, this._register(e, a), a;
607
+ const { color: s = 16777215, intensity: n = 1, position: i = { x: 5, y: 10, z: 5 }, castShadow: r = !1, shadowMapSize: a = 1024 } = t, o = new me(s, n);
608
+ return o.position.set(i.x, i.y, i.z), o.castShadow = r, r && o.shadow.mapSize.setScalar(a), o.name = e, this._register(e, o), o;
609
609
  }
610
610
  addPoint(e, t = {}) {
611
- const { color: s = 16777215, intensity: n = 1, distance: i = 0, decay: r = 2, position: o = { x: 0, y: 5, z: 0 }, castShadow: a = !1 } = t, c = new me(s, n, i, r);
612
- return c.position.set(o.x, o.y, o.z), c.castShadow = a, c.name = e, this._register(e, c), c;
611
+ const { color: s = 16777215, intensity: n = 1, distance: i = 0, decay: r = 2, position: a = { x: 0, y: 5, z: 0 }, castShadow: o = !1 } = t, c = new fe(s, n, i, r);
612
+ return c.position.set(a.x, a.y, a.z), c.castShadow = o, c.name = e, this._register(e, c), c;
613
613
  }
614
614
  addSpot(e, t = {}) {
615
615
  const {
@@ -617,16 +617,16 @@ class xn {
617
617
  intensity: n = 1,
618
618
  distance: i = 0,
619
619
  angle: r = Math.PI / 6,
620
- penumbra: o = 0.1,
621
- decay: a = 2,
620
+ penumbra: a = 0.1,
621
+ decay: o = 2,
622
622
  position: c = { x: 0, y: 10, z: 0 },
623
623
  target: l,
624
624
  castShadow: d = !1
625
- } = t, p = new fe(s, n, i, r, o, a);
625
+ } = t, p = new ge(s, n, i, r, a, o);
626
626
  return p.position.set(c.x, c.y, c.z), l && p.target.position.set(l.x, l.y, l.z), p.castShadow = d, p.name = e, this._register(e, p), p;
627
627
  }
628
628
  addHemisphere(e, t = {}) {
629
- const { skyColor: s = 8900331, groundColor: n = 3549447, intensity: i = 0.6 } = t, r = new ge(s, n, i);
629
+ const { skyColor: s = 8900331, groundColor: n = 3549447, intensity: i = 0.6 } = t, r = new ye(s, n, i);
630
630
  return r.name = e, this._register(e, r), r;
631
631
  }
632
632
  /**
@@ -677,7 +677,7 @@ class xn {
677
677
  const t = this.lights.get(e);
678
678
  if (!t) return;
679
679
  let s = null;
680
- t instanceof ue ? s = new nt(t, 1) : t instanceof me ? s = new it(t, 0.5) : t instanceof fe ? s = new rt(t) : t instanceof ge && (s = new ot(t, 1)), s && (this.scene.add(s), this.helpers.set(e, s));
680
+ t instanceof me ? s = new it(t, 1) : t instanceof fe ? s = new rt(t, 0.5) : t instanceof ge ? s = new at(t) : t instanceof ye && (s = new ot(t, 1)), s && (this.scene.add(s), this.helpers.set(e, s));
681
681
  }
682
682
  /**
683
683
  * Hide (remove) the helper for a light.
@@ -708,18 +708,18 @@ class xn {
708
708
  this.removeAll(), this.hideAllHelpers();
709
709
  }
710
710
  }
711
- class ws extends at {
711
+ class ws extends ct {
712
712
  scene;
713
713
  camera;
714
714
  scenePass;
715
715
  needsUpdateOutputNode;
716
- #o;
717
- #s;
718
- #n = !1;
719
- #a = { strength: 1, radius: 0, threshold: 0 };
720
- #d = null;
721
- #i = !1;
722
- #t = {
716
+ #t;
717
+ #e;
718
+ #s = !1;
719
+ #r = { strength: 1, radius: 0, threshold: 0 };
720
+ #n = null;
721
+ #a = !1;
722
+ #o = {
723
723
  sliceCount: 1,
724
724
  stepCount: 12,
725
725
  aoIntensity: 1,
@@ -728,29 +728,29 @@ class ws extends at {
728
728
  thickness: 1
729
729
  };
730
730
  #p = null;
731
- #c = !1;
732
- #h = null;
731
+ #h = !1;
732
+ #l = null;
733
733
  #u = null;
734
- #l;
735
- #r;
734
+ #d;
735
+ #c;
736
736
  #m = !1;
737
737
  #f = !0;
738
738
  constructor(...e) {
739
739
  const [t, s, n] = e;
740
- super(t), this.scene = s, this.camera = n, this.scenePass = de(s, n), this.needsUpdateOutputNode = !0, this.#o = /* @__PURE__ */ new Set(), this.#s = [], this.#l = /* @__PURE__ */ new Set(), this.#r = /* @__PURE__ */ new Map(), this.#g();
740
+ super(t), this.scene = s, this.camera = n, this.scenePass = pe(s, n), this.needsUpdateOutputNode = !0, this.#t = /* @__PURE__ */ new Set(), this.#e = [], this.#d = /* @__PURE__ */ new Set(), this.#c = /* @__PURE__ */ new Map(), this.#g();
741
741
  }
742
742
  /** @deprecated Use `scenePass` instead */
743
743
  get currentOutputNode() {
744
744
  return this.scenePass;
745
745
  }
746
746
  addOverlayPass(e) {
747
- this.#o.add(e), this.needsUpdateOutputNode = !0;
747
+ this.#t.add(e), this.needsUpdateOutputNode = !0;
748
748
  }
749
749
  removeOverlayPass(e) {
750
- this.#o.delete(e), this.needsUpdateOutputNode = !0;
750
+ this.#t.delete(e), this.needsUpdateOutputNode = !0;
751
751
  }
752
752
  setCamera(e) {
753
- this.camera = e, this.#e();
753
+ this.camera = e, this.#i();
754
754
  }
755
755
  /** @deprecated Use `setOutputComposer` instead */
756
756
  setCurrentOutputNode(e) {
@@ -764,78 +764,78 @@ class ws extends at {
764
764
  this.#u = e, this.needsUpdateOutputNode = !0;
765
765
  }
766
766
  addOutputEffect(e) {
767
- return this.#l.add(e), this.needsUpdateOutputNode = !0, this;
767
+ return this.#d.add(e), this.needsUpdateOutputNode = !0, this;
768
768
  }
769
769
  removeOutputEffect(e) {
770
- return this.#l.delete(e), this.needsUpdateOutputNode = !0, this;
770
+ return this.#d.delete(e), this.needsUpdateOutputNode = !0, this;
771
771
  }
772
772
  addMRTChannel(e, t) {
773
- return this.#r.get(e) === t ? this : (this.#r.set(e, t), this.#e(), this);
773
+ return this.#c.get(e) === t ? this : (this.#c.set(e, t), this.#i(), this);
774
774
  }
775
775
  removeMRTChannel(e) {
776
- return this.#r.delete(e) && this.#e(), this;
776
+ return this.#c.delete(e) && this.#i(), this;
777
777
  }
778
778
  enableBloom(e) {
779
- e && Object.assign(this.#a, e), this.#n = !0, this.#e();
779
+ e && Object.assign(this.#r, e), this.#s = !0, this.#i();
780
780
  }
781
781
  disableBloom() {
782
- this.#n = !1, this.#d = null, this.#e();
782
+ this.#s = !1, this.#n = null, this.#i();
783
783
  }
784
784
  updateBloom(e) {
785
- Object.assign(this.#a, e), this.#n && (this.needsUpdateOutputNode = !0);
785
+ Object.assign(this.#r, e), this.#s && (this.needsUpdateOutputNode = !0);
786
786
  }
787
787
  enableSSGI(e) {
788
- e && Object.assign(this.#t, e), this.#i = !0, this.#e();
788
+ e && Object.assign(this.#o, e), this.#a = !0, this.#i();
789
789
  }
790
790
  disableSSGI() {
791
- this.#i = !1, this.#p = null, this.#e();
791
+ this.#a = !1, this.#p = null, this.#i();
792
792
  }
793
793
  updateSSGI(e) {
794
- if (Object.assign(this.#t, e), this.#p) {
794
+ if (Object.assign(this.#o, e), this.#p) {
795
795
  const t = this.#p;
796
796
  e.sliceCount !== void 0 && (t.sliceCount.value = e.sliceCount), e.stepCount !== void 0 && (t.stepCount.value = e.stepCount), e.aoIntensity !== void 0 && (t.aoIntensity.value = e.aoIntensity), e.giIntensity !== void 0 && (t.giIntensity.value = e.giIntensity), e.radius !== void 0 && (t.radius.value = e.radius), e.thickness !== void 0 && (t.thickness.value = e.thickness);
797
797
  }
798
798
  }
799
799
  enableTRAA() {
800
- this.#c = !0, this.#e();
800
+ this.#h = !0, this.#i();
801
801
  }
802
802
  disableTRAA() {
803
- this.#c = !1, this.#h = null, this.#e();
803
+ this.#h = !1, this.#l = null, this.#i();
804
804
  }
805
- #e() {
805
+ #i() {
806
806
  const e = this.scenePass;
807
- this.scenePass = de(this.scene, this.camera), this.#g(), this.needsUpdateOutputNode = !0, e.dispose();
807
+ this.scenePass = pe(this.scene, this.camera), this.#g(), this.needsUpdateOutputNode = !0, e.dispose();
808
808
  }
809
809
  #g() {
810
- if (this.#n || this.#i || this.#c || this.#r.size > 0) {
810
+ if (this.#s || this.#a || this.#h || this.#c.size > 0) {
811
811
  const t = { output: $t };
812
- this.#r.forEach((s, n) => {
812
+ this.#c.forEach((s, n) => {
813
813
  n !== "output" && (t[n] = s);
814
- }), this.#n && (t.emissive = Kt), this.#i && (t.normal = Qt), this.#c && (t.velocity = Xt), this.scenePass.setMRT(Gt(t));
814
+ }), this.#s && (t.emissive = Kt), this.#a && (t.normal = Qt), this.#h && (t.velocity = qt), this.scenePass.setMRT(Gt(t));
815
815
  }
816
816
  }
817
817
  #y() {
818
- for (const e of this.#s)
818
+ for (const e of this.#e)
819
819
  e.dispose();
820
- this.#s = [];
820
+ this.#e = [];
821
821
  }
822
822
  #w() {
823
823
  let e = this.scenePass.getTextureNode();
824
- if (this.#i)
825
- if (!(this.camera instanceof J))
824
+ if (this.#a)
825
+ if (!(this.camera instanceof V))
826
826
  console.warn("RenderPipeline: SSGI requires a PerspectiveCamera, skipping.");
827
827
  else {
828
828
  const t = this.scenePass.getTextureNode(), s = this.scenePass.getTextureNode("depth"), n = this.scenePass.getTextureNode("normal"), i = Vt(t, s, n, this.camera);
829
- i.sliceCount.value = this.#t.sliceCount, i.stepCount.value = this.#t.stepCount, i.aoIntensity.value = this.#t.aoIntensity, i.giIntensity.value = this.#t.giIntensity, i.radius.value = this.#t.radius, i.thickness.value = this.#t.thickness, this.#p = i, e = be(e, i), this.#s.push(i);
829
+ i.sliceCount.value = this.#o.sliceCount, i.stepCount.value = this.#o.stepCount, i.aoIntensity.value = this.#o.aoIntensity, i.giIntensity.value = this.#o.giIntensity, i.radius.value = this.#o.radius, i.thickness.value = this.#o.thickness, this.#p = i, e = xe(e, i), this.#e.push(i);
830
830
  }
831
- if (this.#n) {
831
+ if (this.#s) {
832
832
  const t = this.scenePass.getTextureNode("emissive");
833
- this.#d = Jt(
833
+ this.#n = Jt(
834
834
  t,
835
- this.#a.strength,
836
- this.#a.radius,
837
- this.#a.threshold
838
- ), e = be(e, this.#d), this.#s.push(this.#d);
835
+ this.#r.strength,
836
+ this.#r.radius,
837
+ this.#r.threshold
838
+ ), e = xe(e, this.#n), this.#e.push(this.#n);
839
839
  }
840
840
  return e;
841
841
  }
@@ -846,16 +846,16 @@ class ws extends at {
846
846
  this.#y();
847
847
  let e, t = !1, s = !1;
848
848
  const n = this.#u !== null;
849
- if (n ? e = this.#u(this.scenePass) : this.#n || this.#i ? e = this.#w() : e = this.#l.size > 0 ? this.scenePass.getTextureNode() : this.scenePass, n || this.#l.forEach((i) => {
849
+ if (n ? e = this.#u(this.scenePass) : this.#s || this.#a ? e = this.#w() : e = this.#d.size > 0 ? this.scenePass.getTextureNode() : this.scenePass, n || this.#d.forEach((i) => {
850
850
  t ||= i.includesTemporalAntialias === !0, s ||= i.includesOutputTransform === !0, e = i(this.scenePass, e);
851
- }), this.#v(s), this.#c && !t) {
851
+ }), this.#v(s), this.#h && !t) {
852
852
  const i = this.scenePass.getTextureNode("depth"), r = this.scenePass.getTextureNode("velocity");
853
- this.#h = Zt(e, i, r, this.camera), this.#s.push(this.#h), e = this.#h;
853
+ this.#l = Zt(e, i, r, this.camera), this.#e.push(this.#l), e = this.#l;
854
854
  } else
855
- this.#h = null;
856
- this.#o.size > 0 && this.#o.forEach((i) => {
855
+ this.#l = null;
856
+ this.#t.size > 0 && this.#t.forEach((i) => {
857
857
  const r = Wt(e, i);
858
- this.#s.push(r), e = r;
858
+ this.#e.push(r), e = r;
859
859
  }), this.outputNode = e, this.needsUpdate = !0;
860
860
  }
861
861
  render() {
@@ -868,16 +868,16 @@ class ws extends at {
868
868
  const vs = {
869
869
  Vector2: C,
870
870
  Vector3: w,
871
- Vector4: ht,
872
- Quaternion: ct,
871
+ Vector4: lt,
872
+ Quaternion: ht,
873
873
  Matrix4: Ie,
874
874
  Spherical: S,
875
- Box3: X,
876
- Sphere: ze,
877
- Raycaster: Be
875
+ Box3: q,
876
+ Sphere: Ne,
877
+ Raycaster: Le
878
878
  };
879
- He.install({ THREE: vs });
880
- class bs extends He {
879
+ Fe.install({ THREE: vs });
880
+ class bs extends Fe {
881
881
  constructor(...e) {
882
882
  super(...e), this.minDistance = 0.2, this.smoothTime = 0.2, this.dollySpeed = 0.2;
883
883
  }
@@ -891,10 +891,10 @@ class bs extends He {
891
891
  if (e.isEmpty())
892
892
  return console.warn("CameraControls.flyToBox: The provided Box3 is empty."), !1;
893
893
  this.absoluteRotations();
894
- const { viewpoint: s = "frontTop", enableTransition: n = !0, padding: i = 0.1, cover: r = !1 } = t, o = [];
894
+ const { viewpoint: s = "frontTop", enableTransition: n = !0, padding: i = 0.1, cover: r = !1 } = t, a = [];
895
895
  if (s !== "current") {
896
- const a = _e[s.toUpperCase()] ?? _e.FRONTTOP, c = a.theta, l = a.phi;
897
- o.push(
896
+ const o = _e[s.toUpperCase()] ?? _e.FRONTTOP, c = o.theta, l = o.phi;
897
+ a.push(
898
898
  this.fitToBox(e, n, {
899
899
  paddingLeft: i,
900
900
  paddingRight: i,
@@ -902,15 +902,15 @@ class bs extends He {
902
902
  paddingBottom: i,
903
903
  cover: r
904
904
  })
905
- ), o.push(this.rotateTo(c, l, n));
905
+ ), a.push(this.rotateTo(c, l, n));
906
906
  } else {
907
- const a = new ze();
908
- e.getBoundingSphere(a), a.radius += i, o.push(this.fitToSphere(a, n));
907
+ const o = new Ne();
908
+ e.getBoundingSphere(o), o.radius += i, a.push(this.fitToSphere(o, n));
909
909
  }
910
- return await Promise.all(o), !0;
910
+ return await Promise.all(a), !0;
911
911
  }
912
912
  async flyToObject(e, t = {}) {
913
- const s = new X().setFromObject(e);
913
+ const s = new q().setFromObject(e);
914
914
  return this.flyToBox(s, t);
915
915
  }
916
916
  /**
@@ -979,7 +979,7 @@ const _e = {
979
979
  };
980
980
  function xs(h, e) {
981
981
  const t = h - e;
982
- return lt.euclideanModulo(t + Math.PI, Math.PI * 2) - Math.PI;
982
+ return dt.euclideanModulo(t + Math.PI, Math.PI * 2) - Math.PI;
983
983
  }
984
984
  class Cs {
985
985
  environment = new es();
@@ -987,7 +987,7 @@ class Cs {
987
987
  pmremGenerator;
988
988
  envMap = null;
989
989
  constructor(e) {
990
- this.renderer = e, this.pmremGenerator = new dt(e);
990
+ this.renderer = e, this.pmremGenerator = new pt(e);
991
991
  }
992
992
  update() {
993
993
  this.envMap || (this.envMap = this.pmremGenerator.fromScene(this.environment).texture);
@@ -996,20 +996,20 @@ class Cs {
996
996
  this.pmremGenerator.dispose(), this.envMap?.dispose();
997
997
  }
998
998
  }
999
- const Y = 128;
999
+ const J = 128;
1000
1000
  class Ss extends ts {
1001
1001
  viewer;
1002
1002
  overlayPass;
1003
1003
  constructor(e) {
1004
1004
  super(e.camera, e.el), this.viewer = e;
1005
- const t = new V(-2, 2, 2, -2, 0, 4);
1006
- t.position.set(0, 0, 2), this.overlayPass = de(this, t), this.setLabels("x", "y", "z");
1005
+ const t = new Z(-2, 2, 2, -2, 0, 4);
1006
+ t.position.set(0, 0, 2), this.overlayPass = pe(this, t), this.setLabels("x", "y", "z");
1007
1007
  }
1008
1008
  _update = () => {
1009
1009
  this.quaternion.copy(this.viewer.camera.quaternion).invert();
1010
1010
  const e = this.location;
1011
1011
  let t, s;
1012
- e.left !== null ? t = e.left : t = this.viewer.el.offsetWidth - Y - e.right, e.top !== null ? s = e.top : s = this.viewer.el.offsetHeight - Y - e.bottom, this.overlayPass.setViewport(t, s, Y, Y);
1012
+ e.left !== null ? t = e.left : t = this.viewer.el.offsetWidth - J - e.right, e.top !== null ? s = e.top : s = this.viewer.el.offsetHeight - J - e.bottom, this.overlayPass.setViewport(t, s, J, J);
1013
1013
  };
1014
1014
  enable() {
1015
1015
  return this.viewer.renderPipeline.addOverlayPass(this.overlayPass), this.viewer.addEventListener("beforeRender", this._update), this.viewer.render(), this;
@@ -1018,8 +1018,8 @@ class Ss extends ts {
1018
1018
  return this.viewer.renderPipeline.removeOverlayPass(this.overlayPass), this.viewer.removeEventListener("beforeRender", this._update), this.viewer.render(), this;
1019
1019
  }
1020
1020
  }
1021
- const Ge = "position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:hidden;", Ms = Ge + "z-index:0;", _s = Ge + "z-index:1;";
1022
- class Ts {
1021
+ const $e = "position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:hidden;", Ms = $e + "z-index:0;", Ts = $e + "z-index:1;";
1022
+ class _s {
1023
1023
  el;
1024
1024
  css2dRenderer = null;
1025
1025
  css3dRenderer = null;
@@ -1028,7 +1028,7 @@ class Ts {
1028
1028
  }
1029
1029
  initCSS2DRenderer() {
1030
1030
  const e = new ss();
1031
- return e.setSize(this.el.clientWidth, this.el.clientHeight), e.domElement.style.cssText = _s, this.el.appendChild(e.domElement), this.css2dRenderer = e, e;
1031
+ return e.setSize(this.el.clientWidth, this.el.clientHeight), e.domElement.style.cssText = Ts, this.el.appendChild(e.domElement), this.css2dRenderer = e, e;
1032
1032
  }
1033
1033
  initCSS3DRenderer() {
1034
1034
  const e = new is();
@@ -1041,7 +1041,7 @@ class Ts {
1041
1041
  return this.css3dRenderer || this.initCSS3DRenderer(), new rs(e);
1042
1042
  }
1043
1043
  createCSS3DObject(e) {
1044
- return this.css3dRenderer || this.initCSS3DRenderer(), new os(e);
1044
+ return this.css3dRenderer || this.initCSS3DRenderer(), new as(e);
1045
1045
  }
1046
1046
  render(e, t) {
1047
1047
  this.css2dRenderer && this.css2dRenderer.render(e, t), this.css3dRenderer && this.css3dRenderer.render(e, t);
@@ -1053,7 +1053,8 @@ class Ts {
1053
1053
  this.css2dRenderer && (this.el.removeChild(this.css2dRenderer.domElement), this.css2dRenderer = null), this.css3dRenderer && (this.el.removeChild(this.css3dRenderer.domElement), this.css3dRenderer = null);
1054
1054
  }
1055
1055
  }
1056
- class Es {
1056
+ const Es = "timestamp-query";
1057
+ class Ps {
1057
1058
  el;
1058
1059
  renderer;
1059
1060
  container;
@@ -1064,13 +1065,14 @@ class Es {
1064
1065
  linesText;
1065
1066
  timestampText;
1066
1067
  _enabled = !1;
1068
+ #t = !1;
1067
1069
  constructor(e, t) {
1068
1070
  this.el = e, this.renderer = t;
1069
1071
  const s = document.createElement("div");
1070
1072
  s.style.position = "absolute", s.style.left = "12px", s.style.bottom = "12px", s.style.fontSize = "12px", s.style.color = "#fff", s.style.pointerEvents = "none", this.container = s;
1071
- function n(r, o = !0) {
1072
- const a = document.createElement("span");
1073
- return o && (a.style.marginLeft = "6px"), a.innerText = r, a;
1073
+ function n(r, a = !0) {
1074
+ const o = document.createElement("span");
1075
+ return a && (o.style.marginLeft = "6px"), o.innerText = r, o;
1074
1076
  }
1075
1077
  function i() {
1076
1078
  return document.createElement("br");
@@ -1080,23 +1082,53 @@ class Es {
1080
1082
  update() {
1081
1083
  if (this._enabled) {
1082
1084
  const { render: e } = this.renderer.info;
1083
- this.drawCallsText.innerText = e.drawCalls.toString(), this.frameCallsText.innerText = e.frameCalls.toString(), this.trianglesText.innerText = e.triangles.toString(), this.pointsText.innerText = e.points.toString(), this.linesText.innerText = e.lines.toString(), this.renderer.resolveTimestampsAsync(pt.RENDER).then((t) => {
1084
- this.timestampText.innerText = t?.toFixed(2) ?? "0";
1085
- });
1085
+ if (this.drawCallsText.innerText = e.drawCalls.toString(), this.frameCallsText.innerText = e.frameCalls.toString(), this.trianglesText.innerText = e.triangles.toString(), this.pointsText.innerText = e.points.toString(), this.linesText.innerText = e.lines.toString(), !this.#t) {
1086
+ this.timestampText.innerText = "0";
1087
+ return;
1088
+ }
1089
+ this.#n(Y.RENDER).then((t) => {
1090
+ this._enabled && (this.timestampText.innerText = t?.toFixed(2) ?? "0");
1091
+ }), this.#n(Y.COMPUTE);
1086
1092
  }
1087
1093
  }
1088
1094
  enable() {
1089
- this._enabled = !0, this.el.appendChild(this.container);
1095
+ this._enabled = !0, this.#r(!0), this.el.appendChild(this.container);
1090
1096
  }
1091
1097
  disable() {
1092
- this._enabled = !1, this.container.remove();
1098
+ this._enabled = !1, this.#r(!1), this.#a(), this.container.remove();
1093
1099
  }
1094
1100
  dispose() {
1095
1101
  this.disable();
1096
1102
  }
1103
+ #e() {
1104
+ return this.renderer.backend;
1105
+ }
1106
+ #s() {
1107
+ try {
1108
+ return this.renderer.hasFeature(Es);
1109
+ } catch {
1110
+ return !0;
1111
+ }
1112
+ }
1113
+ #r(e) {
1114
+ const t = this.#e();
1115
+ if (!t) {
1116
+ this.#t = !1;
1117
+ return;
1118
+ }
1119
+ t.trackTimestamp = e && this.#s(), this.#t = t.trackTimestamp === !0;
1120
+ }
1121
+ #n(e) {
1122
+ const t = this.#e()?.timestampQueryPool?.[e];
1123
+ return t?.resolveQueriesAsync ? Promise.resolve(t.resolveQueriesAsync()).catch(() => {
1124
+ }) : Promise.resolve(void 0);
1125
+ }
1126
+ #a() {
1127
+ this.#n(Y.RENDER), this.#n(Y.COMPUTE);
1128
+ }
1097
1129
  }
1098
1130
  ut.enabled = !0;
1099
- class Cn extends Le {
1131
+ class Sn extends Re {
1100
1132
  el;
1101
1133
  renderer;
1102
1134
  scene;
@@ -1113,11 +1145,11 @@ class Cn extends Le {
1113
1145
  frameCount = 1;
1114
1146
  frameloop = "demand";
1115
1147
  constructor({ el: e, rendererOptions: t }) {
1116
- super(), this.el = e, this.renderer = this._initRenderer(t), this.scene = this.createScene(), this.camera = this.createPerspectiveCamera(), this.info = new Es(this.el, this.renderer), this.controls = new bs(this.camera, this.renderer.domElement), this.renderPipeline = new ws(this.renderer, this.scene, this.camera), this.timer = new mt(), this.roomEnvironment = new Cs(this.renderer), this.interactionManager = new gs(this.renderer.domElement, this.scene, this.camera), this.objectManager = new ys(), this.viewerHelper = new Ss(this), this.cssRenderer = new Ts(this.el), window.addEventListener("resize", this.onWindowResize);
1148
+ super(), this.el = e, this.renderer = this._initRenderer(t), this.scene = this.createScene(), this.camera = this.createPerspectiveCamera(), this.info = new Ps(this.el, this.renderer), this.controls = new bs(this.camera, this.renderer.domElement), this.renderPipeline = new ws(this.renderer, this.scene, this.camera), this.timer = new mt(), this.roomEnvironment = new Cs(this.renderer), this.interactionManager = new gs(this.renderer.domElement, this.scene, this.camera), this.objectManager = new ys(), this.viewerHelper = new Ss(this), this.cssRenderer = new _s(this.el), window.addEventListener("resize", this.onWindowResize);
1117
1149
  }
1118
1150
  onWindowResize = () => {
1119
1151
  const e = this.el.clientWidth, t = this.el.clientHeight;
1120
- this.camera instanceof J ? (this.camera.aspect = e / t, this.camera.updateProjectionMatrix()) : this.camera instanceof V && (this.camera.left = -e / 2, this.camera.right = e / 2, this.camera.top = t / 2, this.camera.bottom = -t / 2, this.camera.updateProjectionMatrix()), this.renderer.setSize(e, t), this.cssRenderer.resize(e, t), this.render();
1152
+ this.camera instanceof V ? (this.camera.aspect = e / t, this.camera.updateProjectionMatrix()) : this.camera instanceof Z && (this.camera.left = -e / 2, this.camera.right = e / 2, this.camera.top = t / 2, this.camera.bottom = -t / 2, this.camera.updateProjectionMatrix()), this.renderer.setSize(e, t), this.cssRenderer.resize(e, t), this.render();
1121
1153
  };
1122
1154
  async init() {
1123
1155
  await this.renderer.init(), this.roomEnvironment.update(), this.scene.environment = this.roomEnvironment.envMap;
@@ -1126,7 +1158,7 @@ class Cn extends Le {
1126
1158
  this.camera = e, this.controls.camera = e, this.interactionManager.setCamera(e), this.renderPipeline.setCamera(e), this.onWindowResize(), this.dispatchEvent({ type: "cameraChange", camera: e });
1127
1159
  }
1128
1160
  setCameraByType(e) {
1129
- e === "perspective" && !(this.camera instanceof J) ? this.setCamera(this.createPerspectiveCamera()) : e === "orthographic" && !(this.camera instanceof V) && this.setCamera(this.createOrthographicCamera());
1161
+ e === "perspective" && !(this.camera instanceof V) ? this.setCamera(this.createPerspectiveCamera()) : e === "orthographic" && !(this.camera instanceof Z) && this.setCamera(this.createOrthographicCamera());
1130
1162
  }
1131
1163
  render(e = 1) {
1132
1164
  return this.frameCount += e, new Promise((t) => {
@@ -1148,21 +1180,21 @@ class Cn extends Le {
1148
1180
  logarithmicDepthBuffer: !0,
1149
1181
  antialias: !1,
1150
1182
  depth: !1,
1151
- trackTimestamp: !0,
1183
+ trackTimestamp: !1,
1152
1184
  ...e
1153
1185
  });
1154
- return t.setSize(this.el.clientWidth, this.el.clientHeight), t.shadowMap.enabled = !0, t.shadowMap.type = gt, t.toneMapping = yt, t.toneMappingExposure = 1, t.info.autoReset = !1, t.setPixelRatio(window.devicePixelRatio), t.setAnimationLoop(this.animate), this.el.appendChild(t.domElement), t;
1186
+ return t.setSize(this.el.clientWidth, this.el.clientHeight), t.shadowMap.enabled = !0, t.shadowMap.type = gt, t.toneMapping = yt, t.toneMappingExposure = 1, t.info.autoReset = !1, t.setPixelRatio(Math.min(window.devicePixelRatio, 1.5)), t.setAnimationLoop(this.animate), this.el.appendChild(t.domElement), t;
1155
1187
  }
1156
1188
  createScene() {
1157
- const e = new Re();
1189
+ const e = new ze();
1158
1190
  return e.background = new M(0), e;
1159
1191
  }
1160
1192
  createPerspectiveCamera() {
1161
- const e = new J(50, this.el.clientWidth / this.el.clientHeight, 0.1, 1e5);
1193
+ const e = new V(50, this.el.clientWidth / this.el.clientHeight, 0.1, 1e5);
1162
1194
  return e.position.setScalar(5), e;
1163
1195
  }
1164
1196
  createOrthographicCamera() {
1165
- const e = new V(
1197
+ const e = new Z(
1166
1198
  -this.el.clientWidth / 2,
1167
1199
  this.el.clientWidth / 2,
1168
1200
  this.el.clientHeight / 2,
@@ -1184,8 +1216,8 @@ class Cn extends Le {
1184
1216
  async screenshot(e = {}) {
1185
1217
  const { type: t = "image/png", quality: s = 1 } = e, n = this.el.clientWidth, i = this.el.clientHeight, r = e.width && e.height;
1186
1218
  r && this.renderer.setSize(e.width, e.height), await this.render();
1187
- const o = this.renderer.domElement.toDataURL(t, s);
1188
- return r && (this.renderer.setSize(n, i), this.onWindowResize()), o;
1219
+ const a = this.renderer.domElement.toDataURL(t, s);
1220
+ return r && (this.renderer.setSize(n, i), this.onWindowResize()), a;
1189
1221
  }
1190
1222
  /**
1191
1223
  * Set the scene background color, texture, or null.
@@ -1235,22 +1267,22 @@ class Cn extends Le {
1235
1267
  this.el.removeChild(this.renderer.domElement), window.removeEventListener("resize", this.onWindowResize), this.info.dispose(), this.interactionManager.dispose(), this.roomEnvironment.dispose(), this.cssRenderer.dispose(), this.renderPipeline.dispose(), this.renderer.dispose();
1236
1268
  }
1237
1269
  }
1238
- class Ps extends Fe {
1270
+ class Os extends Ge {
1239
1271
  constructor(e) {
1240
1272
  super(e);
1241
1273
  }
1242
1274
  parse(e, t, s, n) {
1243
- if (Os(e.slice(0, 8)) === "SBMG----") {
1244
- const r = As(e.slice(8));
1275
+ if (As(e.slice(0, 8)) === "SBMG----") {
1276
+ const r = Bs(e.slice(8));
1245
1277
  return super.parse(r, t, s, n);
1246
1278
  } else
1247
1279
  return super.parse(e, t, s, n);
1248
1280
  }
1249
1281
  }
1250
- function Os(h) {
1282
+ function As(h) {
1251
1283
  return new TextDecoder().decode(new Uint8Array(h));
1252
1284
  }
1253
- function As(h) {
1285
+ function Bs(h) {
1254
1286
  const e = new DataView(h);
1255
1287
  for (let t = 0; t < e.byteLength; t++) {
1256
1288
  const s = e.getUint8(t), n = (s >> 4 & 15) + (s << 4 & 240);
@@ -1258,72 +1290,72 @@ function As(h) {
1258
1290
  }
1259
1291
  return e.buffer;
1260
1292
  }
1261
- const Bs = 8, Ls = 130, Te = 66, Is = "SBK-----", Rs = "SBM-----", $e = new TextDecoder(), zs = new TextEncoder();
1262
- function Ns(h) {
1263
- let e = Bs;
1293
+ const Ls = 8, Rs = 130, Ee = 66, Is = "SBK-----", zs = "SBM-----", We = new TextDecoder(), Ns = new TextEncoder();
1294
+ function js(h) {
1295
+ let e = Ls;
1264
1296
  const t = new Uint8Array(h, 0, e);
1265
- if ($e.decode(t) !== Is)
1297
+ if (We.decode(t) !== Is)
1266
1298
  return h;
1267
- e += Ls;
1299
+ e += Rs;
1268
1300
  const n = new Uint8Array(h, 0, e);
1269
1301
  if (n[40] === 1) {
1270
- const r = zs.encode(Rs), o = new Uint8Array([n[41]]), a = js(n), c = Ds(a);
1271
- let l = Te % c.length;
1272
- const d = e + Te, p = new Uint8Array(h, d), u = new Uint8Array(p.length);
1302
+ const r = Ns.encode(zs), a = new Uint8Array([n[41]]), o = Ds(n), c = ks(o);
1303
+ let l = Ee % c.length;
1304
+ const d = e + Ee, p = new Uint8Array(h, d), u = new Uint8Array(p.length);
1273
1305
  for (let v = 0; v < p.length; v++)
1274
1306
  u[v] = p[v] ^ c[l], l = (l + 1) % c.length;
1275
- const f = new Uint8Array(r.length + o.length + u.length);
1276
- return f.set(r), f.set(o, r.length), f.set(u, r.length + o.length), f.buffer;
1307
+ const f = new Uint8Array(r.length + a.length + u.length);
1308
+ return f.set(r), f.set(a, r.length), f.set(u, r.length + a.length), f.buffer;
1277
1309
  }
1278
1310
  }
1279
- function js(h) {
1311
+ function Ds(h) {
1280
1312
  const e = new Uint8Array(128);
1281
1313
  return e.set(h.slice(42, 74), 0), e.set(h.slice(74, 138), 32), e.set(h.slice(8, 40), 96), e;
1282
1314
  }
1283
- function Ds(h) {
1315
+ function ks(h) {
1284
1316
  const e = new Uint8Array(64);
1285
1317
  return e.set(h.slice(0, 8), 0), e.set(h.slice(24, 32), 8), e.set(h.slice(40, 56), 16), e.set(h.slice(64, 88), 32), e.set(h.slice(96, 104), 56), e;
1286
1318
  }
1287
- const ks = (h, e, t) => {
1319
+ const Us = (h, e, t) => {
1288
1320
  const s = h.buffer.slice(t, t + e);
1289
- let n = $e.decode(s);
1321
+ let n = We.decode(s);
1290
1322
  return n = n.replace("\\", "/"), n.startsWith("Maps/") || (n = `Maps/${n}`), n;
1291
- }, Us = (h, e, t) => {
1292
- const [s, n, i, r, o] = e, a = t || r < 1;
1293
- return new R({
1323
+ }, Hs = (h, e, t) => {
1324
+ const [s, n, i, r, a] = e, o = t || r < 1;
1325
+ return new I({
1294
1326
  name: h,
1295
1327
  color: new M(s, n, i),
1296
1328
  opacity: r,
1297
- transparent: a,
1329
+ transparent: o,
1298
1330
  alphaTest: 0.01,
1299
- side: o
1331
+ side: a
1300
1332
  });
1301
- }, Hs = (h) => h?.toLowerCase().endsWith(".png") ?? !1;
1302
- class Fs {
1333
+ }, Fs = (h) => h?.toLowerCase().endsWith(".png") ?? !1;
1334
+ class Gs {
1303
1335
  data;
1304
1336
  options;
1305
1337
  textureLoader;
1306
1338
  littleEndian = !0;
1307
1339
  materials = /* @__PURE__ */ new Map();
1308
1340
  constructor(e, t) {
1309
- this.data = e, this.options = t, this.textureLoader = new je(t.manager), this.textureLoader.setCrossOrigin(t.crossOrigin), this.textureLoader.setRequestHeader(t.requestHeader);
1341
+ this.data = e, this.options = t, this.textureLoader = new De(t.manager), this.textureLoader.setCrossOrigin(t.crossOrigin), this.textureLoader.setRequestHeader(t.requestHeader);
1310
1342
  }
1311
1343
  parse(e, t) {
1312
1344
  let s = this.data;
1313
- const n = Ns(this.data);
1345
+ const n = js(this.data);
1314
1346
  n && (s = n);
1315
1347
  const i = new DataView(s);
1316
1348
  let r = 8;
1317
- const o = i.getUint8(r);
1318
- r += 1, o === 1 ? this._parseV2(i, r, e) : o === 2 ? this._parseV2(i, r, e) : o === 3 ? this._parseV3(i, r, e) : t?.(new Error(`SBMLoader: Unsupported SBM version: ${o}`));
1349
+ const a = i.getUint8(r);
1350
+ r += 1, a === 1 ? this._parseV2(i, r, e) : a === 2 ? this._parseV2(i, r, e) : a === 3 ? this._parseV3(i, r, e) : t?.(new Error(`SBMLoader: Unsupported SBM version: ${a}`));
1319
1351
  }
1320
1352
  _parseV2(e, t, s) {
1321
- const n = new I(), i = e.getUint16(t, this.littleEndian);
1353
+ const n = new R(), i = e.getUint16(t, this.littleEndian);
1322
1354
  t += 2;
1323
1355
  const r = e.getUint16(t, this.littleEndian);
1324
1356
  t += 2;
1325
- for (let o = 0; o < i; ++o) {
1326
- const a = e.getUint16(t, this.littleEndian).toString();
1357
+ for (let a = 0; a < i; ++a) {
1358
+ const o = e.getUint16(t, this.littleEndian).toString();
1327
1359
  t += 2, t += 4, t += 4, t += 4, t += 4;
1328
1360
  const c = e.getFloat32(t, this.littleEndian);
1329
1361
  t += 4;
@@ -1337,16 +1369,16 @@ class Fs {
1337
1369
  t += 1, u === 0 ? u = xt : u === 1 ? u = Ct : u === 2 && (u = St);
1338
1370
  const f = e.getUint16(t, this.littleEndian);
1339
1371
  t += 2;
1340
- const v = f > 0 ? ks(e, f, t) : "";
1341
- if (t += f, !this.materials.has(a)) {
1342
- const x = Us(a, [c, l, d, p, u], Hs(v));
1343
- this.materials.set(a, x), v && this.options.path && this.textureLoader.load(L.resolveURL(v, this.options.path), (y) => {
1344
- y.colorSpace = De, y.wrapS = ye, y.wrapT = ye, y.flipY = !1, y.anisotropy = 16, x.map = y;
1372
+ const v = f > 0 ? Us(e, f, t) : "";
1373
+ if (t += f, !this.materials.has(o)) {
1374
+ const x = Hs(o, [c, l, d, p, u], Fs(v));
1375
+ this.materials.set(o, x), v && this.options.path && this.textureLoader.load(L.resolveURL(v, this.options.path), (y) => {
1376
+ y.colorSpace = ke, y.wrapS = we, y.wrapT = we, y.flipY = !1, y.anisotropy = 16, x.map = y;
1345
1377
  });
1346
1378
  }
1347
1379
  }
1348
- for (let o = 0; o < r; ++o) {
1349
- const a = e.getUint16(t, this.littleEndian).toString();
1380
+ for (let a = 0; a < r; ++a) {
1381
+ const o = e.getUint16(t, this.littleEndian).toString();
1350
1382
  t += 2;
1351
1383
  const c = e.getUint16(t, this.littleEndian).toString();
1352
1384
  t += 2;
@@ -1360,9 +1392,9 @@ class Fs {
1360
1392
  if (t += 2, v > 0)
1361
1393
  for (let g = 0; g < v; g++)
1362
1394
  t += 4, t += 4, t += 4;
1363
- const _ = e.getUint16(t, this.littleEndian);
1364
- if (t += 2, _ > 0)
1365
- for (let g = 0; g < _; g++) {
1395
+ const T = e.getUint16(t, this.littleEndian);
1396
+ if (t += 2, T > 0)
1397
+ for (let g = 0; g < T; g++) {
1366
1398
  const b = new C();
1367
1399
  b.setX(e.getFloat32(t, this.littleEndian)), t += 4, b.setY(e.getFloat32(t, this.littleEndian)), t += 4, d.push(b);
1368
1400
  }
@@ -1378,47 +1410,47 @@ class Fs {
1378
1410
  const P = [b, z, N];
1379
1411
  p.push(P), d.length > 0 && u.push([d[P[0]], d[P[1]], d[P[2]]]);
1380
1412
  }
1381
- const y = [], T = [];
1413
+ const y = [], _ = [];
1382
1414
  for (let g = 0; g < p.length; g++) {
1383
1415
  const b = p[g], z = l[b[0]], N = l[b[1]], P = l[b[2]];
1384
1416
  y.push(...z.toArray(), ...N.toArray(), ...P.toArray());
1385
- let q = new C(), $ = new C(), k = new C();
1417
+ let X = new C(), $ = new C(), k = new C();
1386
1418
  const U = u[g];
1387
- U !== void 0 && (q = U[0], $ = U[1], k = U[2]), T.push(...q.toArray(), ...$.toArray(), ...k.toArray());
1419
+ U !== void 0 && (X = U[0], $ = U[1], k = U[2]), _.push(...X.toArray(), ...$.toArray(), ...k.toArray());
1388
1420
  }
1389
- const O = new Float32Array(y), A = new Float32Array(T), E = new K();
1390
- if (O.length > 0 && E.setAttribute("position", new we(O, 3)), A.length > 0 && E.setAttribute("uv", new we(A, 2)), E.computeVertexNormals(), this.materials.has(c)) {
1421
+ const O = new Float32Array(y), A = new Float32Array(_), E = new K();
1422
+ if (O.length > 0 && E.setAttribute("position", new ve(O, 3)), A.length > 0 && E.setAttribute("uv", new ve(A, 2)), E.computeVertexNormals(), this.materials.has(c)) {
1391
1423
  const g = new D(E, this.materials.get(c));
1392
- g.name = a, g.castShadow = !0, g.receiveShadow = !0, n.add(g);
1424
+ g.name = o, g.castShadow = !0, g.receiveShadow = !0, n.add(g);
1393
1425
  }
1394
1426
  }
1395
1427
  s(n);
1396
1428
  }
1397
1429
  _parseV3(e, t, s) {
1398
- const n = new I();
1430
+ const n = new R();
1399
1431
  console.warn("SBMLoader: SBM version 3 is not supported yet."), s(n);
1400
1432
  }
1401
1433
  }
1402
- class Gs extends bt {
1434
+ class $s extends bt {
1403
1435
  load(e, t, s, n) {
1404
1436
  let i;
1405
1437
  if (this.resourcePath !== "")
1406
1438
  i = this.resourcePath;
1407
1439
  else if (this.path !== "") {
1408
- const a = L.extractUrlBase(e);
1409
- i = L.resolveURL(a, this.path);
1440
+ const o = L.extractUrlBase(e);
1441
+ i = L.resolveURL(o, this.path);
1410
1442
  } else
1411
1443
  i = L.extractUrlBase(e);
1412
1444
  this.manager.itemStart(e);
1413
- const r = (a) => {
1414
- n ? n(a) : console.error(a), this.manager.itemError(e), this.manager.itemEnd(e);
1415
- }, o = new Ne(this.manager);
1416
- o.setPath(this.path), o.setResponseType("arraybuffer"), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(
1445
+ const r = (o) => {
1446
+ n ? n(o) : console.error(o), this.manager.itemError(e), this.manager.itemEnd(e);
1447
+ }, a = new je(this.manager);
1448
+ a.setPath(this.path), a.setResponseType("arraybuffer"), a.setRequestHeader(this.requestHeader), a.setWithCredentials(this.withCredentials), a.load(
1417
1449
  e,
1418
- (a) => {
1450
+ (o) => {
1419
1451
  try {
1420
1452
  this.parse(
1421
- a,
1453
+ o,
1422
1454
  i,
1423
1455
  (c) => {
1424
1456
  t(c), this.manager.itemEnd(e);
@@ -1439,7 +1471,7 @@ class Gs extends bt {
1439
1471
  n?.(new Error(`SBMLoader: Invalid SBM format: ${i}`));
1440
1472
  return;
1441
1473
  }
1442
- new Fs(e, {
1474
+ new Gs(e, {
1443
1475
  path: t,
1444
1476
  crossOrigin: this.crossOrigin,
1445
1477
  requestHeader: this.requestHeader,
@@ -1461,7 +1493,7 @@ class Gs extends bt {
1461
1493
  });
1462
1494
  }
1463
1495
  }
1464
- const $s = [
1496
+ const Ws = [
1465
1497
  "map",
1466
1498
  "alphaMap",
1467
1499
  "aoMap",
@@ -1495,7 +1527,7 @@ function W(h) {
1495
1527
  for (const s of t) {
1496
1528
  if (!s) continue;
1497
1529
  let n = !1;
1498
- for (const i of $s) {
1530
+ for (const i of Ws) {
1499
1531
  const r = s[i];
1500
1532
  r?.isTexture && r.image == null && (r.dispose(), s[i] = null, n = !0);
1501
1533
  }
@@ -1505,17 +1537,17 @@ function W(h) {
1505
1537
  }
1506
1538
  class j {
1507
1539
  static CACHE_NAME = "u-space-model-loader-cache";
1508
- static fileLoader = new Ne().setResponseType("arraybuffer");
1540
+ static fileLoader = new je().setResponseType("arraybuffer");
1509
1541
  static dracoLoader = new ls().setDecoderPath(
1510
- `https://cdn.jsdelivr.net/npm/three@0.${ve}.0/examples/jsm/libs/draco/`
1542
+ `https://cdn.jsdelivr.net/npm/three@0.${be}.0/examples/jsm/libs/draco/`
1511
1543
  );
1512
1544
  static ktx2Loader = new ds().setTranscoderPath(
1513
- `https://cdn.jsdelivr.net/npm/three@0.${ve}.0/examples/jsm/libs/basis/`
1545
+ `https://cdn.jsdelivr.net/npm/three@0.${be}.0/examples/jsm/libs/basis/`
1514
1546
  );
1515
- static gltfLoader = new Fe().setDRACOLoader(j.dracoLoader).setKTX2Loader(j.ktx2Loader).setMeshoptDecoder(Me);
1516
- static sbmxLoader = new Ps().setDRACOLoader(j.dracoLoader).setKTX2Loader(j.ktx2Loader).setMeshoptDecoder(Me);
1517
- static sbmLoader = new Gs();
1518
- static fbxLoader = new as();
1547
+ static gltfLoader = new Ge().setDRACOLoader(j.dracoLoader).setKTX2Loader(j.ktx2Loader).setMeshoptDecoder(Te);
1548
+ static sbmxLoader = new Os().setDRACOLoader(j.dracoLoader).setKTX2Loader(j.ktx2Loader).setMeshoptDecoder(Te);
1549
+ static sbmLoader = new $s();
1550
+ static fbxLoader = new os();
1519
1551
  static objLoader = new cs();
1520
1552
  static stlLoader = new hs();
1521
1553
  static setLoadingManager(e) {
@@ -1551,17 +1583,17 @@ class j {
1551
1583
  const r = await this.sbmxLoader.parseAsync(n, L.extractUrlBase(e));
1552
1584
  return r.scene.animations = r.animations, W(r.scene);
1553
1585
  case "sbm":
1554
- const o = await this.sbmLoader.parseAsync(n, L.extractUrlBase(e));
1555
- return W(o);
1556
- case "fbx":
1557
- const a = this.fbxLoader.parse(n, L.extractUrlBase(e));
1586
+ const a = await this.sbmLoader.parseAsync(n, L.extractUrlBase(e));
1558
1587
  return W(a);
1588
+ case "fbx":
1589
+ const o = this.fbxLoader.parse(n, L.extractUrlBase(e));
1590
+ return W(o);
1559
1591
  case "obj":
1560
1592
  const c = new TextDecoder().decode(n), l = this.objLoader.parse(c);
1561
1593
  return W(l);
1562
1594
  case "stl":
1563
1595
  const d = this.stlLoader.parse(n);
1564
- return new D(d, new R());
1596
+ return new D(d, new I());
1565
1597
  default:
1566
1598
  throw new Error(`Unsupported model format: ${s}`);
1567
1599
  }
@@ -1578,8 +1610,8 @@ class j {
1578
1610
  }
1579
1611
  }
1580
1612
  }
1581
- class Sn {
1582
- static textureLoader = new je();
1613
+ class Mn {
1614
+ static textureLoader = new De();
1583
1615
  static hdrLoader = new ps();
1584
1616
  static cubeTextureLoader = new Mt();
1585
1617
  static setLoadingManager(e) {
@@ -1590,7 +1622,7 @@ class Sn {
1590
1622
  }
1591
1623
  static async loadAsyncHDR(e) {
1592
1624
  const t = await this.hdrLoader.loadAsync(e);
1593
- return t.mapping = _t, t;
1625
+ return t.mapping = Tt, t;
1594
1626
  }
1595
1627
  static async loadAsyncCubeTexture(e, t) {
1596
1628
  return this.cubeTextureLoader.setPath(e), await this.cubeTextureLoader.loadAsync(t);
@@ -1609,7 +1641,7 @@ class G extends D {
1609
1641
  return this.visible === !1 && this.ignoreInvisibleWhenRaycast === !0 ? !1 : super.raycast(e, t);
1610
1642
  }
1611
1643
  }
1612
- class We extends I {
1644
+ class Ke extends R {
1613
1645
  isBaseGroup = !0;
1614
1646
  type = "BaseGroup";
1615
1647
  ignoreInvisibleWhenRaycast = !0;
@@ -1620,7 +1652,7 @@ class We extends I {
1620
1652
  return this.visible === !1 && this.ignoreInvisibleWhenRaycast === !0 ? !1 : super.raycast(e, t);
1621
1653
  }
1622
1654
  }
1623
- class Ws extends Tt {
1655
+ class Ks extends _t {
1624
1656
  isBaseSprite = !0;
1625
1657
  type = "BaseSprite";
1626
1658
  ignoreInvisibleWhenRaycast = !0;
@@ -1631,7 +1663,7 @@ class Ws extends Tt {
1631
1663
  return this.visible === !1 && this.ignoreInvisibleWhenRaycast === !0 ? !1 : super.raycast(e, t);
1632
1664
  }
1633
1665
  }
1634
- class re extends We {
1666
+ class ae extends Ke {
1635
1667
  isModel = !0;
1636
1668
  type = "Model";
1637
1669
  static memoryCache = /* @__PURE__ */ new Map();
@@ -1645,9 +1677,9 @@ class re extends We {
1645
1677
  const { url: t, cache: s = !0, persistent: n = !0 } = e;
1646
1678
  try {
1647
1679
  let i;
1648
- s ? re.memoryCache.has(t) ? i = re.memoryCache.get(t) : (i = j.loadAsync(t, { persistent: n }), re.memoryCache.set(t, i)) : i = j.loadAsync(t, { persistent: n });
1649
- const r = await i, o = us(r);
1650
- return this.add(o), o.animations && o.animations.length > 0 && (this.animations = o.animations, this.mixer = new Et(o)), o;
1680
+ s ? ae.memoryCache.has(t) ? i = ae.memoryCache.get(t) : (i = j.loadAsync(t, { persistent: n }), ae.memoryCache.set(t, i)) : i = j.loadAsync(t, { persistent: n });
1681
+ const r = await i, a = us(r);
1682
+ return this.add(a), a.animations && a.animations.length > 0 && (this.animations = a.animations, this.mixer = new Et(a)), a;
1651
1683
  } catch (i) {
1652
1684
  return console.error(`[Model] Failed to load model from ${t}:`, i), null;
1653
1685
  }
@@ -1655,11 +1687,11 @@ class re extends We {
1655
1687
  playAnimation(e, t = {}) {
1656
1688
  if (!this.mixer || this.animations.length === 0) return null;
1657
1689
  const { loop: s = !0, repetitions: n = 1 / 0, timeScale: i = 1, clampWhenFinished: r = !1 } = t;
1658
- let o;
1659
- if (e === void 0 ? o = this.animations[0] : typeof e == "number" ? o = this.animations[e] : o = this.animations.find((c) => c.name === e), !o)
1690
+ let a;
1691
+ if (e === void 0 ? a = this.animations[0] : typeof e == "number" ? a = this.animations[e] : a = this.animations.find((c) => c.name === e), !a)
1660
1692
  return console.warn(`[Model] Animation not found: ${e}`), null;
1661
- let a = this.actions.get(o.name);
1662
- return a || (a = this.mixer.clipAction(o), this.actions.set(o.name, a)), a.setLoop(s ? Pt : Ot, n), a.clampWhenFinished = r, a.timeScale = i, a.reset().play(), a;
1693
+ let o = this.actions.get(a.name);
1694
+ return o || (o = this.mixer.clipAction(a), this.actions.set(a.name, o)), o.setLoop(s ? Pt : Ot, n), o.clampWhenFinished = r, o.timeScale = i, o.reset().play(), o;
1663
1695
  }
1664
1696
  playAllAnimations(e = {}) {
1665
1697
  return this.animations.map((t, s) => this.playAnimation(s, e)).filter((t) => t !== null);
@@ -1680,7 +1712,7 @@ class re extends We {
1680
1712
  * Get the axis-aligned bounding box of this model.
1681
1713
  */
1682
1714
  getBoundingBox() {
1683
- return new X().setFromObject(this);
1715
+ return new q().setFromObject(this);
1684
1716
  }
1685
1717
  /**
1686
1718
  * Get the center point of this model's bounding box.
@@ -1704,7 +1736,7 @@ class re extends We {
1704
1736
  typeof caches < "u" && await caches.delete("u-space-loader-cache");
1705
1737
  }
1706
1738
  }
1707
- class Ks extends G {
1739
+ class Qs extends G {
1708
1740
  isSphereMesh = !0;
1709
1741
  type = "SphereMesh";
1710
1742
  constructor({ geometryParameters: e, materialParameters: t } = {}) {
@@ -1716,10 +1748,10 @@ class Ks extends G {
1716
1748
  e?.phiLength,
1717
1749
  e?.thetaStart,
1718
1750
  e?.thetaLength
1719
- ), this.material = new R(t);
1751
+ ), this.material = new I(t);
1720
1752
  }
1721
1753
  }
1722
- class Ee extends G {
1754
+ class Pe extends G {
1723
1755
  isTubeMesh = !0;
1724
1756
  type = "TubeMesh";
1725
1757
  constructor({ geometryParameters: e, materialParameters: t } = {}) {
@@ -1729,10 +1761,10 @@ class Ee extends G {
1729
1761
  e?.radius,
1730
1762
  e?.radialSegments,
1731
1763
  e?.closed
1732
- ), this.material = new R(t);
1764
+ ), this.material = new I(t);
1733
1765
  }
1734
1766
  }
1735
- class Mn extends We {
1767
+ class Tn extends Ke {
1736
1768
  isTopology = !0;
1737
1769
  type = "Topology";
1738
1770
  // Visuals
@@ -1783,8 +1815,8 @@ class Mn extends We {
1783
1815
  console.error(`[Topology] Cannot add edge. One or both nodes not found: ${e}, ${t}`);
1784
1816
  return;
1785
1817
  }
1786
- const o = s ?? i.distanceTo(r);
1787
- this.getNeighbors(e)?.set(t, o), n && this.getNeighbors(t)?.set(e, o);
1818
+ const a = s ?? i.distanceTo(r);
1819
+ this.getNeighbors(e)?.set(t, a), n && this.getNeighbors(t)?.set(e, a);
1788
1820
  }
1789
1821
  /**
1790
1822
  * Remove an edge between two nodes.
@@ -1802,32 +1834,32 @@ class Mn extends We {
1802
1834
  if (!this.nodes.has(e) || !this.nodes.has(t))
1803
1835
  return console.warn("[Topology] Start or End node not found."), [];
1804
1836
  const s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
1805
- for (const [a] of this.nodes)
1806
- s.set(a, 1 / 0), n.set(a, null), i.add(a);
1837
+ for (const [o] of this.nodes)
1838
+ s.set(o, 1 / 0), n.set(o, null), i.add(o);
1807
1839
  for (s.set(e, 0); i.size > 0; ) {
1808
- let a = null, c = 1 / 0;
1840
+ let o = null, c = 1 / 0;
1809
1841
  for (const d of i) {
1810
1842
  const p = s.get(d);
1811
- p < c && (c = p, a = d);
1843
+ p < c && (c = p, o = d);
1812
1844
  }
1813
- if (a === null || a === t || c === 1 / 0)
1845
+ if (o === null || o === t || c === 1 / 0)
1814
1846
  break;
1815
- i.delete(a);
1816
- const l = this.adjacencyMap?.get(a);
1847
+ i.delete(o);
1848
+ const l = this.adjacencyMap?.get(o);
1817
1849
  if (l)
1818
1850
  for (const [d, p] of l) {
1819
1851
  if (!i.has(d)) continue;
1820
- const u = s.get(a) + p;
1821
- u < s.get(d) && (s.set(d, u), n.set(d, a));
1852
+ const u = s.get(o) + p;
1853
+ u < s.get(d) && (s.set(d, u), n.set(d, o));
1822
1854
  }
1823
1855
  }
1824
1856
  const r = [];
1825
- let o = t;
1857
+ let a = t;
1826
1858
  if (n.get(t) === null && e !== t)
1827
1859
  return [];
1828
- for (; o !== null; ) {
1829
- const a = this.nodes.get(o);
1830
- a && r.unshift(a), o = n.get(o) || null;
1860
+ for (; a !== null; ) {
1861
+ const o = this.nodes.get(a);
1862
+ o && r.unshift(o), a = n.get(a) || null;
1831
1863
  }
1832
1864
  return r;
1833
1865
  }
@@ -1835,8 +1867,8 @@ class Mn extends We {
1835
1867
  * Renders the entire topology graph structure using TubeGeometry and Spheres.
1836
1868
  */
1837
1869
  renderGraph() {
1838
- this.clearGraph(), this.graphGroup = new I();
1839
- const e = new Ks({
1870
+ this.clearGraph(), this.graphGroup = new R();
1871
+ const e = new Qs({
1840
1872
  geometryParameters: {
1841
1873
  radius: this.parameters.nodeRadius,
1842
1874
  widthSegments: 16,
@@ -1853,12 +1885,12 @@ class Mn extends We {
1853
1885
  const t = /* @__PURE__ */ new Set();
1854
1886
  this.adjacencyMap.forEach((s, n) => {
1855
1887
  s.forEach((i, r) => {
1856
- const o = [n, r].sort().join("-");
1857
- if (t.has(o)) return;
1858
- t.add(o);
1859
- const a = this.nodes.get(n), c = this.nodes.get(r);
1860
- if (a && c) {
1861
- const l = new Lt(a, c), d = new Ee({
1888
+ const a = [n, r].sort().join("-");
1889
+ if (t.has(a)) return;
1890
+ t.add(a);
1891
+ const o = this.nodes.get(n), c = this.nodes.get(r);
1892
+ if (o && c) {
1893
+ const l = new Lt(o, c), d = new Pe({
1862
1894
  geometryParameters: {
1863
1895
  path: l,
1864
1896
  tubularSegments: 1,
@@ -1885,7 +1917,7 @@ class Mn extends We {
1885
1917
  */
1886
1918
  renderPath(e, t = this.parameters.pathColor) {
1887
1919
  if (e.length < 2) return;
1888
- const s = new It(e, !1, "catmullrom", 0), n = new Ee({
1920
+ const s = new Rt(e, !1, "catmullrom", 0), n = new Pe({
1889
1921
  geometryParameters: {
1890
1922
  path: s,
1891
1923
  tubularSegments: e.length * 10,
@@ -1911,9 +1943,9 @@ class Mn extends We {
1911
1943
  });
1912
1944
  const t = [], s = /* @__PURE__ */ new Set();
1913
1945
  return this.adjacencyMap.forEach((n, i) => {
1914
- n.forEach((r, o) => {
1915
- const a = [i, o].sort().join("-");
1916
- s.has(a) || (s.add(a), t.push({ from: i, to: o, weight: r }));
1946
+ n.forEach((r, a) => {
1947
+ const o = [i, a].sort().join("-");
1948
+ s.has(o) || (s.add(o), t.push({ from: i, to: a, weight: r }));
1917
1949
  });
1918
1950
  }), { nodes: e, edges: t };
1919
1951
  }
@@ -1935,7 +1967,7 @@ class Mn extends We {
1935
1967
  return this.adjacencyMap.get(e);
1936
1968
  }
1937
1969
  }
1938
- class _n extends Ws {
1970
+ class _n extends Ks {
1939
1971
  isPoi = !0;
1940
1972
  type = "Poi";
1941
1973
  parameters = {
@@ -1954,7 +1986,7 @@ class _n extends Ws {
1954
1986
  _canvas = document.createElement("canvas");
1955
1987
  _lastParametersJSON = "";
1956
1988
  constructor(e = {}) {
1957
- super(new Rt()), Object.assign(this.parameters, e), this.updateAsync();
1989
+ super(new It()), Object.assign(this.parameters, e), this.updateAsync();
1958
1990
  }
1959
1991
  /**
1960
1992
  * Update the POI with new parameters
@@ -1970,33 +2002,33 @@ class _n extends Ws {
1970
2002
  n.font = `${this.parameters.fontSize}px ${this.parameters.fontFamily}`;
1971
2003
  let i = null;
1972
2004
  this.parameters.img && (i = await this._loadImage(this.parameters.img));
1973
- const { text: r, fontSize: o, color: a, iconSize: c, padding: l, backgroundColor: d, borderRadius: p, textPosition: u, scaleFactor: f } = this.parameters, v = n.measureText(r), _ = r ? v.width : 0, x = r ? o : 0;
1974
- let y = 0, T = 0, O = 0, A = 0, E = 0, g = 0;
2005
+ const { text: r, fontSize: a, color: o, iconSize: c, padding: l, backgroundColor: d, borderRadius: p, textPosition: u, scaleFactor: f } = this.parameters, v = n.measureText(r), T = r ? v.width : 0, x = r ? a : 0;
2006
+ let y = 0, _ = 0, O = 0, A = 0, E = 0, g = 0;
1975
2007
  const b = !!i, z = !!r;
1976
2008
  if (b && z)
1977
2009
  switch (u) {
1978
2010
  case "top":
1979
- y = Math.max(c, _), T = c + l + x, E = (y - _) / 2, g = x / 2, O = (y - c) / 2, A = x + l;
2011
+ y = Math.max(c, T), _ = c + l + x, E = (y - T) / 2, g = x / 2, O = (y - c) / 2, A = x + l;
1980
2012
  break;
1981
2013
  case "bottom":
1982
- y = Math.max(c, _), T = c + l + x, O = (y - c) / 2, A = 0, E = (y - _) / 2, g = c + l + x / 2;
2014
+ y = Math.max(c, T), _ = c + l + x, O = (y - c) / 2, A = 0, E = (y - T) / 2, g = c + l + x / 2;
1983
2015
  break;
1984
2016
  case "left":
1985
- y = c + l + _, T = Math.max(c, x), E = 0, g = T / 2, O = _ + l, A = (T - c) / 2;
2017
+ y = c + l + T, _ = Math.max(c, x), E = 0, g = _ / 2, O = T + l, A = (_ - c) / 2;
1986
2018
  break;
1987
2019
  default:
1988
- y = c + l + _, T = Math.max(c, x), O = 0, A = (T - c) / 2, E = c + l, g = T / 2;
2020
+ y = c + l + T, _ = Math.max(c, x), O = 0, A = (_ - c) / 2, E = c + l, g = _ / 2;
1989
2021
  break;
1990
2022
  }
1991
- else b ? (y = c, T = c, O = 0, A = 0) : z && (y = _, T = x, E = 0, g = x / 2);
1992
- const N = y + l * 2, P = T + l * 2;
1993
- if (s.width = N, s.height = P, n.font = `${o}px ${this.parameters.fontFamily}`, d && (n.fillStyle = d, this._drawRoundedRect(n, 0, 0, N, P, p), n.fill()), b && n.drawImage(i, O + l, A + l, c, c), z) {
1994
- n.fillStyle = a;
1995
- const k = n.measureText(r), U = k.actualBoundingBoxAscent + k.actualBoundingBoxDescent, et = k.actualBoundingBoxAscent - U / 2;
1996
- n.textBaseline = "alphabetic", n.fillText(r, E + l, g + l + et);
2023
+ else b ? (y = c, _ = c, O = 0, A = 0) : z && (y = T, _ = x, E = 0, g = x / 2);
2024
+ const N = y + l * 2, P = _ + l * 2;
2025
+ if (s.width = N, s.height = P, n.font = `${a}px ${this.parameters.fontFamily}`, d && (n.fillStyle = d, this._drawRoundedRect(n, 0, 0, N, P, p), n.fill()), b && n.drawImage(i, O + l, A + l, c, c), z) {
2026
+ n.fillStyle = o;
2027
+ const k = n.measureText(r), U = k.actualBoundingBoxAscent + k.actualBoundingBoxDescent, tt = k.actualBoundingBoxAscent - U / 2;
2028
+ n.textBaseline = "alphabetic", n.fillText(r, E + l, g + l + tt);
1997
2029
  }
1998
- const q = this.material.map, $ = new zt(s);
1999
- $.colorSpace = De, this.material.map = $, q?.dispose(), this.scale.set(N * f, P * f, 1);
2030
+ const X = this.material.map, $ = new zt(s);
2031
+ $.colorSpace = ke, this.material.map = $, X?.dispose(), this.scale.set(N * f, P * f, 1);
2000
2032
  }
2001
2033
  _loadImage(e) {
2002
2034
  return new Promise((t, s) => {
@@ -2014,39 +2046,39 @@ class _n extends Ws {
2014
2046
  this.material.map?.dispose(), this.material.dispose();
2015
2047
  }
2016
2048
  }
2017
- class Ke extends G {
2049
+ class Qe extends G {
2018
2050
  isShapeMesh = !0;
2019
2051
  type = "ShapeMesh";
2020
2052
  constructor({ geometryParameters: e, materialParameters: t } = {}) {
2021
- super(), this.geometry = new Nt(e?.shape, e?.curveSegments), this.material = new R(t), this.geometry.rotateX(-Math.PI / 2);
2053
+ super(), this.geometry = new Nt(e?.shape, e?.curveSegments), this.material = new I(t), this.geometry.rotateX(-Math.PI / 2);
2022
2054
  }
2023
2055
  static createFromPoints(e, t = {}) {
2024
- return new Ke({
2056
+ return new Qe({
2025
2057
  ...t,
2026
2058
  geometryParameters: {
2027
2059
  ...t.geometryParameters,
2028
- shape: new ke(e.map((s) => new C(s.x, -s.z)))
2060
+ shape: new Ue(e.map((s) => new C(s.x, -s.z)))
2029
2061
  }
2030
2062
  });
2031
2063
  }
2032
2064
  }
2033
- class Qe extends G {
2065
+ class qe extends G {
2034
2066
  isExtrudeMesh = !0;
2035
2067
  type = "ExtrudeMesh";
2036
2068
  constructor({ geometryParameters: e, materialParameters: t } = {}) {
2037
- super(), this.geometry = new jt(e?.shape, e?.options), this.material = new R(t), this.geometry.rotateX(-Math.PI / 2);
2069
+ super(), this.geometry = new jt(e?.shape, e?.options), this.material = new I(t), this.geometry.rotateX(-Math.PI / 2);
2038
2070
  }
2039
2071
  static createFromPoints(e, t = {}) {
2040
- return e && e.length === 0 && (e = void 0), new Qe({
2072
+ return e && e.length === 0 && (e = void 0), new qe({
2041
2073
  ...t,
2042
2074
  geometryParameters: {
2043
2075
  ...t.geometryParameters,
2044
- shape: new ke(e?.map((s) => new C(s.x, -s.z)))
2076
+ shape: new Ue(e?.map((s) => new C(s.x, -s.z)))
2045
2077
  }
2046
2078
  });
2047
2079
  }
2048
2080
  }
2049
- class Tn extends G {
2081
+ class En extends G {
2050
2082
  isPlaneMesh = !0;
2051
2083
  type = "PlaneMesh";
2052
2084
  constructor({ geometryParameters: e, materialParameters: t } = {}) {
@@ -2055,10 +2087,10 @@ class Tn extends G {
2055
2087
  e?.height,
2056
2088
  e?.widthSegments,
2057
2089
  e?.heightSegments
2058
- ), this.material = new R(t);
2090
+ ), this.material = new I(t);
2059
2091
  }
2060
2092
  }
2061
- class En extends G {
2093
+ class Pn extends G {
2062
2094
  isCircleMesh = !0;
2063
2095
  type = "CircleMesh";
2064
2096
  constructor({ geometryParameters: e, materialParameters: t } = {}) {
@@ -2069,7 +2101,7 @@ class En extends G {
2069
2101
  e?.thetaStart,
2070
2102
  e?.thetaLength
2071
2103
  ),
2072
- new R(t)
2104
+ new I(t)
2073
2105
  ), this.geometry.rotateX(-Math.PI / 2);
2074
2106
  }
2075
2107
  }
@@ -2080,14 +2112,14 @@ class F {
2080
2112
  });
2081
2113
  }
2082
2114
  }
2083
- class Pn {
2115
+ class On {
2084
2116
  static flow(e = {}) {
2085
- const { baseColor: t = 16777215, flowColor: s = 65280, speed: n = 1, scale: i = 3, intensity: r = 4 } = e, o = H(new M(t)), a = H(new M(s)), c = xe().x.mul(i).sub(te.mul(n)), l = se(pe(c).add(1).mul(0.5), r);
2086
- return ne(o, a, l);
2117
+ const { baseColor: t = 16777215, flowColor: s = 65280, speed: n = 1, scale: i = 3, intensity: r = 4 } = e, a = H(new M(t)), o = H(new M(s)), c = Ce().x.mul(i).sub(se.mul(n)), l = ne(ue(c).add(1).mul(0.5), r);
2118
+ return ie(a, o, l);
2087
2119
  }
2088
2120
  static breathe(e = {}) {
2089
- const { baseColor: t = 16777215, breathColor: s = 65280, speed: n = 1, intensity: i = 2 } = e, r = H(new M(t)), o = H(new M(s)), a = pe(te.mul(n)).add(1).mul(0.5), c = se(a, i);
2090
- return ne(r, o, c);
2121
+ const { baseColor: t = 16777215, breathColor: s = 65280, speed: n = 1, intensity: i = 2 } = e, r = H(new M(t)), a = H(new M(s)), o = ue(se.mul(n)).add(1).mul(0.5), c = ne(o, i);
2122
+ return ie(r, a, c);
2091
2123
  }
2092
2124
  static fluid(e = {}) {
2093
2125
  const {
@@ -2096,48 +2128,48 @@ class Pn {
2096
2128
  speed: n = 1,
2097
2129
  scale: i = 1,
2098
2130
  intensity: r = 1,
2099
- distortion: o = 0.5
2100
- } = e, a = H(new M(t)), c = H(new M(s)), l = xe().mul(i), d = te.mul(n), p = Ce(l.add(d), 1, 0), u = l.add(p.mul(o)), f = Ce(u, 1, 0).add(1).mul(0.5), v = se(f, r);
2101
- return ne(a, c, v);
2131
+ distortion: a = 0.5
2132
+ } = e, o = H(new M(t)), c = H(new M(s)), l = Ce().mul(i), d = se.mul(n), p = Se(l.add(d), 1, 0), u = l.add(p.mul(a)), f = Se(u, 1, 0).add(1).mul(0.5), v = ne(f, r);
2133
+ return ie(o, c, v);
2102
2134
  }
2103
2135
  }
2104
- function On(h) {
2136
+ function An(h) {
2105
2137
  }
2106
- const he = "uSpaceHighlight", Q = `${he}/enabled`, Xe = `${he}/opacity`, qe = `${he}/color`, Ye = `${he}/overwrite`, le = "uSpaceBreathe", ae = `${le}/enabled`, Je = `${le}/color`, Ve = `${le}/speed`, Ze = `${le}/intensity`, ce = /* @__PURE__ */ new WeakMap(), Qs = Ue(() => {
2107
- const h = B(Q, "uint"), e = B(qe, "uint"), t = B(Ye, "uint"), s = Ae(e), n = Se.mul(s), i = ie(t.greaterThan(0), s, n), r = ie(h.greaterThan(0), i, Se), o = B(ae, "uint"), a = B(Je, "uint"), c = B(Ve, "float"), l = B(Ze, "float"), d = Ae(a), p = pe(te.mul(c)).add(1).mul(0.5), u = se(p, l), f = ne(r, d, u);
2108
- return ie(o.greaterThan(0), f, r);
2109
- })(), Xs = Ue(() => {
2138
+ const le = "uSpaceHighlight", Q = `${le}/enabled`, Xe = `${le}/opacity`, Ye = `${le}/color`, Je = `${le}/overwrite`, de = "uSpaceBreathe", ce = `${de}/enabled`, Ve = `${de}/color`, Ze = `${de}/speed`, et = `${de}/intensity`, he = /* @__PURE__ */ new WeakMap(), qs = He(() => {
2139
+ const h = B(Q, "uint"), e = B(Ye, "uint"), t = B(Je, "uint"), s = Be(e), n = Me.mul(s), i = re(t.greaterThan(0), s, n), r = re(h.greaterThan(0), i, Me), a = B(ce, "uint"), o = B(Ve, "uint"), c = B(Ze, "float"), l = B(et, "float"), d = Be(o), p = ue(se.mul(c)).add(1).mul(0.5), u = ne(p, l), f = ie(r, d, u);
2140
+ return re(a.greaterThan(0), f, r);
2141
+ })(), Xs = He(() => {
2110
2142
  const h = B(Q, "uint"), e = B(Xe, "float");
2111
- return ie(h.greaterThan(0), e, qt);
2143
+ return re(h.greaterThan(0), e, Xt);
2112
2144
  })();
2113
- function Pe(h) {
2145
+ function Oe(h) {
2114
2146
  const e = h.material;
2115
2147
  if (!e || Array.isArray(e)) return;
2116
- let t = ce.get(e);
2148
+ let t = he.get(e);
2117
2149
  t || (t = {
2118
2150
  colorNode: e.colorNode,
2119
2151
  opacityNode: e.opacityNode,
2120
2152
  transparent: e.transparent,
2121
2153
  depthWrite: e.depthWrite,
2122
2154
  activeMeshes: /* @__PURE__ */ new Set()
2123
- }, ce.set(e, t)), t.activeMeshes.add(h), e.transparent = !0, e.colorNode = Qs, e.opacityNode = Xs, e.needsUpdate = !0;
2155
+ }, he.set(e, t)), t.activeMeshes.add(h), e.transparent = !0, e.colorNode = qs, e.opacityNode = Xs, e.needsUpdate = !0;
2124
2156
  }
2125
- function Oe(h) {
2126
- const e = h.userData[Q], t = h.userData[ae];
2157
+ function Ae(h) {
2158
+ const e = h.userData[Q], t = h.userData[ce];
2127
2159
  if (e || t) return;
2128
2160
  const s = h.material;
2129
2161
  if (!s || Array.isArray(s)) return;
2130
- const n = ce.get(s);
2131
- n && (n.activeMeshes.delete(h), !(n.activeMeshes.size > 0) && (s.colorNode = n.colorNode, s.opacityNode = n.opacityNode, s.transparent = n.transparent, s.depthWrite = n.depthWrite, s.needsUpdate = !0, ce.delete(s)));
2162
+ const n = he.get(s);
2163
+ n && (n.activeMeshes.delete(h), !(n.activeMeshes.size > 0) && (s.colorNode = n.colorNode, s.opacityNode = n.opacityNode, s.transparent = n.transparent, s.depthWrite = n.depthWrite, s.needsUpdate = !0, he.delete(s)));
2132
2164
  }
2133
2165
  class oe {
2134
2166
  static highlightColor(e, t = {}) {
2135
- const s = Array.isArray(e) ? e : [e], { opacity: n = 0.5, color: i = 16711680, overwrite: r = !1, depthWrite: o } = t, a = new M(i).getHex();
2167
+ const s = Array.isArray(e) ? e : [e], { opacity: n = 0.5, color: i = 16711680, overwrite: r = !1, depthWrite: a } = t, o = new M(i).getHex();
2136
2168
  for (const c of s)
2137
2169
  F.traverseMeshes(c, (l) => {
2138
- if (l.userData[Q] = 1, l.userData[Xe] = n, l.userData[qe] = a, l.userData[Ye] = r ? 1 : 0, Pe(l), o !== void 0) {
2170
+ if (l.userData[Q] = 1, l.userData[Xe] = n, l.userData[Ye] = o, l.userData[Je] = r ? 1 : 0, Oe(l), a !== void 0) {
2139
2171
  const d = l.material;
2140
- d && !Array.isArray(d) && (d.depthWrite = o);
2172
+ d && !Array.isArray(d) && (d.depthWrite = a);
2141
2173
  }
2142
2174
  });
2143
2175
  }
@@ -2145,7 +2177,7 @@ class oe {
2145
2177
  const t = Array.isArray(e) ? e : [e];
2146
2178
  for (const s of t)
2147
2179
  F.traverseMeshes(s, (n) => {
2148
- n.userData[Q] = 0, Oe(n);
2180
+ n.userData[Q] = 0, Ae(n);
2149
2181
  });
2150
2182
  }
2151
2183
  static breatheColor(e, t = {}) {
@@ -2160,14 +2192,14 @@ class oe {
2160
2192
  n.color = new M(n.color).getHex();
2161
2193
  for (const i of s)
2162
2194
  F.traverseMeshes(i, (r) => {
2163
- r.userData[ae] = 1, r.userData[Je] = n.color, r.userData[Ve] = n.speed, r.userData[Ze] = n.intensity, Pe(r);
2195
+ r.userData[ce] = 1, r.userData[Ve] = n.color, r.userData[Ze] = n.speed, r.userData[et] = n.intensity, Oe(r);
2164
2196
  });
2165
2197
  }
2166
2198
  static removeBreatheColor(e) {
2167
2199
  const t = Array.isArray(e) ? e : [e];
2168
2200
  for (const s of t)
2169
2201
  F.traverseMeshes(s, (n) => {
2170
- n.userData[ae] = 0, Oe(n);
2202
+ n.userData[ce] = 0, Ae(n);
2171
2203
  });
2172
2204
  }
2173
2205
  /**
@@ -2205,18 +2237,18 @@ class oe {
2205
2237
  }
2206
2238
  static _fade(e, t, s, n) {
2207
2239
  const i = Array.isArray(e) ? e : [e], r = [];
2208
- for (const o of i)
2209
- F.traverseMeshes(o, (a) => {
2210
- const c = a.material;
2240
+ for (const a of i)
2241
+ F.traverseMeshes(a, (o) => {
2242
+ const c = o.material;
2211
2243
  !c || Array.isArray(c) || (c.transparent = !0, c.opacity = t, c.needsUpdate = !0, r.push({ material: c, targetOpacity: s }));
2212
2244
  });
2213
- return r.length === 0 ? Promise.resolve() : new Promise((o) => {
2214
- const a = performance.now();
2245
+ return r.length === 0 ? Promise.resolve() : new Promise((a) => {
2246
+ const o = performance.now();
2215
2247
  let c = 0;
2216
2248
  const l = () => {
2217
- const d = performance.now() - a, p = Math.min(d / n, 1);
2249
+ const d = performance.now() - o, p = Math.min(d / n, 1);
2218
2250
  if (!i[0].parent) {
2219
- cancelAnimationFrame(c), o();
2251
+ cancelAnimationFrame(c), a();
2220
2252
  return;
2221
2253
  }
2222
2254
  for (const { material: f, targetOpacity: v } of r)
@@ -2227,18 +2259,18 @@ class oe {
2227
2259
  if (s >= 1)
2228
2260
  for (const { material: f } of r)
2229
2261
  f.transparent = !1;
2230
- o();
2262
+ a();
2231
2263
  }
2232
2264
  };
2233
2265
  c = requestAnimationFrame(l);
2234
2266
  });
2235
2267
  }
2236
2268
  }
2237
- const Ae = (h) => {
2269
+ const Be = (h) => {
2238
2270
  const e = h.shiftRight(16).bitAnd(255).toFloat().div(255), t = h.shiftRight(8).bitAnd(255).toFloat().div(255), s = h.bitAnd(255).toFloat().div(255);
2239
2271
  return Yt(e, t, s);
2240
2272
  };
2241
- class qs extends ms {
2273
+ class Ys extends ms {
2242
2274
  viewer;
2243
2275
  constructor(e, t) {
2244
2276
  super(t), this.viewer = e;
@@ -2247,7 +2279,7 @@ class qs extends ms {
2247
2279
  this.update(e) && this.viewer.render();
2248
2280
  };
2249
2281
  easingByMode(e) {
2250
- const t = Ys[e];
2282
+ const t = Js[e];
2251
2283
  return super.easing(t);
2252
2284
  }
2253
2285
  start(e, t) {
@@ -2257,21 +2289,21 @@ class qs extends ms {
2257
2289
  return this.viewer.removeEventListener("afterControlsUpdate", this._update), super.stop();
2258
2290
  }
2259
2291
  }
2260
- function An(h, e, t, s = {}, n, i) {
2261
- return new Promise((r, o) => {
2262
- const { duration: a = 1e3, delay: c = 0, repeat: l = !1, mode: d = "Linear.None", yoyo: p = !1 } = s, u = new qs(h, e).to(t, a).easingByMode(d).delay(c).onUpdate((f) => {
2292
+ function Bn(h, e, t, s = {}, n, i) {
2293
+ return new Promise((r, a) => {
2294
+ const { duration: o = 1e3, delay: c = 0, repeat: l = !1, mode: d = "Linear.None", yoyo: p = !1 } = s, u = new Ys(h, e).to(t, o).easingByMode(d).delay(c).onUpdate((f) => {
2263
2295
  n?.(f, u);
2264
2296
  }).onComplete(() => {
2265
2297
  r();
2266
2298
  }).onStop(() => {
2267
- o("animation stop");
2299
+ a("animation stop");
2268
2300
  }).onStart(() => {
2269
2301
  i?.(u);
2270
2302
  });
2271
2303
  typeof l == "number" ? u.repeat(l) : typeof l == "boolean" && l && u.repeat(1 / 0), p && u.repeatDelay(20), u.yoyo(p), u.start();
2272
2304
  });
2273
2305
  }
2274
- const Ys = {
2306
+ const Js = {
2275
2307
  "Linear.None": m.Linear.None,
2276
2308
  "Quadratic.In": m.Quadratic.In,
2277
2309
  "Quadratic.Out": m.Quadratic.Out,
@@ -2304,7 +2336,7 @@ const Ys = {
2304
2336
  "Bounce.Out": m.Bounce.Out,
2305
2337
  "Bounce.InOut": m.Bounce.InOut
2306
2338
  };
2307
- class Bn {
2339
+ class Ln {
2308
2340
  scene;
2309
2341
  planes = /* @__PURE__ */ new Map();
2310
2342
  helpers = /* @__PURE__ */ new Map();
@@ -2353,24 +2385,24 @@ class Bn {
2353
2385
  constant: n = 0,
2354
2386
  showHelper: i = !1,
2355
2387
  helperSize: r = 5,
2356
- helperColor: o = 16711680
2357
- } = t, a = new Ht(new w(s.x, s.y, s.z), n);
2358
- return this.planes.set(e, a), this._syncPlanes(), i && this.showHelper(e, r, o), a;
2388
+ helperColor: a = 16711680
2389
+ } = t, o = new Ht(new w(s.x, s.y, s.z), n);
2390
+ return this.planes.set(e, o), this._syncPlanes(), i && this.showHelper(e, r, a), o;
2359
2391
  }
2360
2392
  /**
2361
2393
  * Add six clipping planes that form a box around a Box3.
2362
2394
  * Returns the six plane ids: `${id}_+x`, `${id}_-x`, etc.
2363
2395
  */
2364
2396
  addBox(e, t, s = {}) {
2365
- const { showHelpers: n = !1, helperColor: i = 16711680 } = s, r = t.min, o = t.max, a = [
2366
- { suffix: "+x", normal: { x: -1, y: 0, z: 0 }, constant: o.x },
2397
+ const { showHelpers: n = !1, helperColor: i = 16711680 } = s, r = t.min, a = t.max, o = [
2398
+ { suffix: "+x", normal: { x: -1, y: 0, z: 0 }, constant: a.x },
2367
2399
  { suffix: "-x", normal: { x: 1, y: 0, z: 0 }, constant: -r.x },
2368
- { suffix: "+y", normal: { x: 0, y: -1, z: 0 }, constant: o.y },
2400
+ { suffix: "+y", normal: { x: 0, y: -1, z: 0 }, constant: a.y },
2369
2401
  { suffix: "-y", normal: { x: 0, y: 1, z: 0 }, constant: -r.y },
2370
- { suffix: "+z", normal: { x: 0, y: 0, z: -1 }, constant: o.z },
2402
+ { suffix: "+z", normal: { x: 0, y: 0, z: -1 }, constant: a.z },
2371
2403
  { suffix: "-z", normal: { x: 0, y: 0, z: 1 }, constant: -r.z }
2372
2404
  ], c = [];
2373
- for (const l of a) {
2405
+ for (const l of o) {
2374
2406
  const d = `${e}_${l.suffix}`;
2375
2407
  this.addPlane(d, { normal: l.normal, constant: l.constant, showHelper: n, helperColor: i }), c.push(d);
2376
2408
  }
@@ -2380,7 +2412,7 @@ class Bn {
2380
2412
  * Add a clipping box from an object's bounding box with optional padding.
2381
2413
  */
2382
2414
  addBoxFromObject(e, t, s = 0, n = {}) {
2383
- const i = new X().setFromObject(t);
2415
+ const i = new q().setFromObject(t);
2384
2416
  return i.expandByScalar(s), this.addBox(e, i, n);
2385
2417
  }
2386
2418
  /**
@@ -2446,7 +2478,7 @@ class Bn {
2446
2478
  this.detach(), this.removeAll(), this.scene.remove(this.group);
2447
2479
  }
2448
2480
  }
2449
- class Ln {
2481
+ class Rn {
2450
2482
  scene;
2451
2483
  measurements = /* @__PURE__ */ new Map();
2452
2484
  _idCounter = 0;
@@ -2457,19 +2489,19 @@ class Ln {
2457
2489
  * Measure distance between two points.
2458
2490
  */
2459
2491
  measureDistance(e, t, s = {}) {
2460
- const { lineColor: n = 16776960 } = s, i = new w(e.x, e.y, e.z), r = new w(t.x, t.y, t.z), o = i.distanceTo(r), a = `measure_dist_${this._idCounter++}`, c = new I();
2461
- c.name = a;
2462
- const l = new K().setFromPoints([i, r]), d = new Z({ color: n }), p = new ee(l, d);
2492
+ const { lineColor: n = 16776960 } = s, i = new w(e.x, e.y, e.z), r = new w(t.x, t.y, t.z), a = i.distanceTo(r), o = `measure_dist_${this._idCounter++}`, c = new R();
2493
+ c.name = o;
2494
+ const l = new K().setFromPoints([i, r]), d = new ee({ color: n }), p = new te(l, d);
2463
2495
  c.add(p), this.scene.add(c);
2464
2496
  const u = {
2465
- id: a,
2497
+ id: o,
2466
2498
  type: "distance",
2467
- value: o,
2499
+ value: a,
2468
2500
  unit: "m",
2469
2501
  points: [i, r],
2470
2502
  object: c
2471
2503
  };
2472
- return this.measurements.set(a, u), u;
2504
+ return this.measurements.set(o, u), u;
2473
2505
  }
2474
2506
  /**
2475
2507
  * Measure the area of a polygon defined by 3+ coplanar points.
@@ -2478,17 +2510,17 @@ class Ln {
2478
2510
  const { lineColor: s = 65280 } = t;
2479
2511
  if (e.length < 3)
2480
2512
  throw new Error("MeasureTool.measureArea requires at least 3 points");
2481
- const n = e.map((u) => new w(u.x, u.y, u.z)), i = this._calculatePolygonArea(n), r = `measure_area_${this._idCounter++}`, o = new I();
2482
- o.name = r;
2483
- const a = [...n, n[0]], c = new K().setFromPoints(a), l = new Z({ color: s }), d = new ee(c, l);
2484
- o.add(d), this.scene.add(o);
2513
+ const n = e.map((u) => new w(u.x, u.y, u.z)), i = this._calculatePolygonArea(n), r = `measure_area_${this._idCounter++}`, a = new R();
2514
+ a.name = r;
2515
+ const o = [...n, n[0]], c = new K().setFromPoints(o), l = new ee({ color: s }), d = new te(c, l);
2516
+ a.add(d), this.scene.add(a);
2485
2517
  const p = {
2486
2518
  id: r,
2487
2519
  type: "area",
2488
2520
  value: i,
2489
2521
  unit: "m²",
2490
2522
  points: n,
2491
- object: o
2523
+ object: a
2492
2524
  };
2493
2525
  return this.measurements.set(r, p), p;
2494
2526
  }
@@ -2496,16 +2528,16 @@ class Ln {
2496
2528
  * Measure the angle between three points (vertex at the middle point).
2497
2529
  */
2498
2530
  measureAngle(e, t, s, n = {}) {
2499
- const { lineColor: i = 16746496 } = n, r = new w(e.x, e.y, e.z), o = new w(t.x, t.y, t.z), a = new w(s.x, s.y, s.z), c = r.clone().sub(o).normalize(), l = a.clone().sub(o).normalize(), p = Math.acos(Math.max(-1, Math.min(1, c.dot(l)))) * 180 / Math.PI, u = `measure_angle_${this._idCounter++}`, f = new I();
2531
+ const { lineColor: i = 16746496 } = n, r = new w(e.x, e.y, e.z), a = new w(t.x, t.y, t.z), o = new w(s.x, s.y, s.z), c = r.clone().sub(a).normalize(), l = o.clone().sub(a).normalize(), p = Math.acos(Math.max(-1, Math.min(1, c.dot(l)))) * 180 / Math.PI, u = `measure_angle_${this._idCounter++}`, f = new R();
2500
2532
  f.name = u;
2501
- const v = new K().setFromPoints([r, o, a]), _ = new Z({ color: i }), x = new ee(v, _);
2533
+ const v = new K().setFromPoints([r, a, o]), T = new ee({ color: i }), x = new te(v, T);
2502
2534
  f.add(x), this.scene.add(f);
2503
2535
  const y = {
2504
2536
  id: u,
2505
2537
  type: "angle",
2506
2538
  value: p,
2507
2539
  unit: "°",
2508
- points: [r, o, a],
2540
+ points: [r, a, o],
2509
2541
  object: f
2510
2542
  };
2511
2543
  return this.measurements.set(u, y), y;
@@ -2545,8 +2577,8 @@ class Ln {
2545
2577
  _calculatePolygonArea(e) {
2546
2578
  const t = e.length, s = new w();
2547
2579
  for (let i = 0; i < t; i++) {
2548
- const r = e[i], o = e[(i + 1) % t], a = new w().crossVectors(r, o);
2549
- s.add(a);
2580
+ const r = e[i], a = e[(i + 1) % t], o = new w().crossVectors(r, a);
2581
+ s.add(o);
2550
2582
  }
2551
2583
  const n = new w();
2552
2584
  if (t >= 3) {
@@ -2579,7 +2611,7 @@ class In {
2579
2611
  */
2580
2612
  add(e, t) {
2581
2613
  this.annotations.has(e) && this.remove(e);
2582
- const s = new I();
2614
+ const s = new R();
2583
2615
  s.name = `annotation_${e}`;
2584
2616
  const n = new w(t.position.x, t.position.y, t.position.z);
2585
2617
  s.position.copy(n);
@@ -2596,27 +2628,27 @@ class In {
2596
2628
  for (const [c, l] of Object.entries(t.labelStyle))
2597
2629
  l !== void 0 && (i.style[c] = l);
2598
2630
  let r = null;
2599
- const o = t.labelOffset || { x: 0, y: 2, z: 0 };
2631
+ const a = t.labelOffset || { x: 0, y: 2, z: 0 };
2600
2632
  if (t.showLeaderLine !== !1) {
2601
2633
  const { lineColor: c = 16777215 } = t, l = new K().setFromPoints([
2602
2634
  new w(0, 0, 0),
2603
- new w(o.x, o.y, o.z)
2604
- ]), d = new Z({ color: c });
2605
- r = new ee(l, d), s.add(r);
2635
+ new w(a.x, a.y, a.z)
2636
+ ]), d = new ee({ color: c });
2637
+ r = new te(l, d), s.add(r);
2606
2638
  }
2607
2639
  if (this._createCSSObject) {
2608
2640
  const c = this._createCSSObject(i);
2609
- c.position.set(o.x, o.y, o.z), s.add(c);
2641
+ c.position.set(a.x, a.y, a.z), s.add(c);
2610
2642
  }
2611
2643
  this.scene.add(s);
2612
- const a = {
2644
+ const o = {
2613
2645
  id: e,
2614
2646
  options: t,
2615
2647
  group: s,
2616
2648
  labelElement: i,
2617
2649
  line: r
2618
2650
  };
2619
- return this.annotations.set(e, a), a;
2651
+ return this.annotations.set(e, o), o;
2620
2652
  }
2621
2653
  /**
2622
2654
  * Quick-add a text annotation.
@@ -2710,47 +2742,47 @@ class In {
2710
2742
  this.removeAll();
2711
2743
  }
2712
2744
  }
2713
- const Js = "0.0.21";
2714
- window.__USPACE__ = { version: Js };
2745
+ const Vs = "0.0.22";
2746
+ window.__USPACE__ = { version: Vs };
2715
2747
  export {
2716
2748
  In as AnnotationManager,
2717
- We as BaseGroup,
2749
+ Ke as BaseGroup,
2718
2750
  G as BaseMesh,
2719
- Ws as BaseSprite,
2720
- Nn as CSS2DObject,
2721
- Dn as CSS3DObject,
2722
- kn as CSS3DSprite,
2723
- Ts as CSSRenderer,
2751
+ Ks as BaseSprite,
2752
+ jn as CSS2DObject,
2753
+ kn as CSS3DObject,
2754
+ Un as CSS3DSprite,
2755
+ _s as CSSRenderer,
2724
2756
  bs as CameraControls,
2725
- En as CircleMesh,
2726
- Bn as ClippingTool,
2727
- Qe as ExtrudeMesh,
2757
+ Pn as CircleMesh,
2758
+ Ln as ClippingTool,
2759
+ qe as ExtrudeMesh,
2728
2760
  fs as InteractionEvent,
2729
2761
  gs as InteractionManager,
2730
- xn as LightManager,
2762
+ Cn as LightManager,
2731
2763
  oe as MaterialEffects,
2732
- Ln as MeasureTool,
2733
- re as Model,
2764
+ Rn as MeasureTool,
2765
+ ae as Model,
2734
2766
  j as ModelLoaderManager,
2735
2767
  ys as ObjectManager,
2736
2768
  F as ObjectUtils,
2737
- Tn as PlaneMesh,
2769
+ En as PlaneMesh,
2738
2770
  _n as Poi,
2739
2771
  ws as RenderPipeline,
2740
2772
  Cs as RoomEnvironment,
2741
- Gs as SBMLoader,
2742
- Ps as SBMXLoader,
2743
- bn as SceneManager,
2744
- vn as Selection,
2745
- Ke as ShapeMesh,
2746
- Ks as SphereMesh,
2747
- Pn as TSLEffects,
2748
- Sn as TextureLoaderManager,
2749
- Mn as Topology,
2750
- Ee as TubeMesh,
2751
- qs as Tween,
2752
- Cn as Viewer,
2753
- On as reinterpretType,
2754
- An as tweenAnimation,
2755
- Js as version
2773
+ $s as SBMLoader,
2774
+ Os as SBMXLoader,
2775
+ xn as SceneManager,
2776
+ bn as Selection,
2777
+ Qe as ShapeMesh,
2778
+ Qs as SphereMesh,
2779
+ On as TSLEffects,
2780
+ Mn as TextureLoaderManager,
2781
+ Tn as Topology,
2782
+ Pe as TubeMesh,
2783
+ Ys as Tween,
2784
+ Sn as Viewer,
2785
+ An as reinterpretType,
2786
+ Bn as tweenAnimation,
2787
+ Vs as version
2756
2788
  };