@needle-tools/engine 3.44.2 → 3.44.4

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/dist/needle-engine.js +1106 -1093
  3. package/dist/needle-engine.light.js +219 -206
  4. package/dist/needle-engine.light.min.js +46 -46
  5. package/dist/needle-engine.light.umd.cjs +51 -51
  6. package/dist/needle-engine.min.js +74 -74
  7. package/dist/needle-engine.umd.cjs +79 -79
  8. package/lib/engine/engine_addressables.d.ts +8 -1
  9. package/lib/engine/engine_addressables.js +12 -2
  10. package/lib/engine/engine_addressables.js.map +1 -1
  11. package/lib/engine-components/AnimatorController.js +5 -1
  12. package/lib/engine-components/AnimatorController.js.map +1 -1
  13. package/lib/engine-components/DragControls.js +4 -2
  14. package/lib/engine-components/DragControls.js.map +1 -1
  15. package/lib/engine-components/SceneSwitcher.js +15 -1
  16. package/lib/engine-components/SceneSwitcher.js.map +1 -1
  17. package/lib/engine-components/webxr/controllers/XRControllerFollow.js +3 -0
  18. package/lib/engine-components/webxr/controllers/XRControllerFollow.js.map +1 -1
  19. package/lib/engine-components/webxr/controllers/XRControllerModel.d.ts +8 -0
  20. package/lib/engine-components/webxr/controllers/XRControllerModel.js +8 -0
  21. package/lib/engine-components/webxr/controllers/XRControllerModel.js.map +1 -1
  22. package/lib/engine-components/webxr/controllers/XRControllerMovement.d.ts +21 -7
  23. package/lib/engine-components/webxr/controllers/XRControllerMovement.js +22 -8
  24. package/lib/engine-components/webxr/controllers/XRControllerMovement.js.map +1 -1
  25. package/package.json +1 -1
  26. package/src/engine/engine_addressables.ts +13 -2
  27. package/src/engine-components/AnimatorController.ts +3 -1
  28. package/src/engine-components/DragControls.ts +4 -2
  29. package/src/engine-components/SceneSwitcher.ts +16 -3
  30. package/src/engine-components/webxr/controllers/XRControllerFollow.ts +3 -0
  31. package/src/engine-components/webxr/controllers/XRControllerModel.ts +8 -0
  32. package/src/engine-components/webxr/controllers/XRControllerMovement.ts +22 -9
@@ -15,7 +15,7 @@ var fE = (s, e, t) => (dE(s, e, "access private method"), t);
15
15
  * Copyright 2010-2023 Three.js Authors
16
16
  * SPDX-License-Identifier: MIT
17
17
  */
18
- const _h = "162", Hd = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 }, Vd = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }, r4 = 0, BI = 1, o4 = 2, kj = 3, Fj = 0, u2 = 1, d2 = 2, Ul = 3, ps = 0, xn = 1, yi = 2, fn = 0, Ou = 1, Df = 2, DI = 3, OI = 4, f2 = 5, Cu = 100, a4 = 101, l4 = 102, LI = 103, Qw = 104, c4 = 200, h4 = 201, u4 = 202, d4 = 203, jw = 204, Ww = 205, f4 = 206, p4 = 207, m4 = 208, g4 = 209, y4 = 210, A4 = 211, v4 = 212, _4 = 213, b4 = 214, p2 = 0, JS = 1, Rv = 2, Of = 3, bg = 4, ZS = 5, $S = 6, x0 = 7, w0 = 0, x4 = 1, w4 = 2, Jr = 0, Hg = 1, S0 = 2, S4 = 3, C0 = 4, C4 = 5, Vg = 6, Lf = 7, kI = "attached", E4 = "detached", eC = 300, bh = 301, Wu = 302, mo = 303, xg = 304, Qg = 306, yo = 1e3, $n = 1001, kf = 1002, Ht = 1003, wg = 1004, Uj = 1004, eh = 1005, Nj = 1005, Dt = 1006, gf = 1007, zj = 1007, po = 1008, Gj = 1008, Dn = 1009, M4 = 1010, T4 = 1011, tC = 1012, m2 = 1013, el = 1014, Hn = 1015, ds = 1016, g2 = 1017, y2 = 1018, ph = 1020, I4 = 1021, tn = 1023, iC = 1024, R4 = 1025, Lu = 1026, qu = 1027, jg = 1028, A2 = 1029, v2 = 1030, _2 = 1031, b2 = 1033, iw = 33776, nw = 33777, sw = 33778, rw = 33779, FI = 35840, UI = 35841, NI = 35842, zI = 35843, x2 = 36196, GI = 37492, HI = 37496, VI = 37808, QI = 37809, jI = 37810, WI = 37811, qI = 37812, XI = 37813, YI = 37814, KI = 37815, JI = 37816, ZI = 37817, $I = 37818, eR = 37819, tR = 37820, iR = 37821, ow = 36492, nR = 36494, sR = 36495, P4 = 36283, rR = 36284, oR = 36285, aR = 36286, Pv = 2200, w2 = 2201, B4 = 2202, Xu = 2300, ac = 2301, aw = 2302, tf = 2400, nf = 2401, Bv = 2402, nC = 2500, S2 = 2501, D4 = 0, C2 = 1, qw = 2, O4 = 3e3, lR = 3001, tr = 3200, sC = 3201, Zu = 0, L4 = 1, fo = "", vt = "srgb", Oi = "srgb-linear", rC = "display-p3", E0 = "display-p3-linear", Dv = "linear", ji = "srgb", Ov = "rec709", Lv = "p3", k4 = 0, vu = 7680, F4 = 7681, U4 = 7682, N4 = 7683, z4 = 34055, G4 = 34056, H4 = 5386, cR = 512, V4 = 513, Q4 = 514, j4 = 515, W4 = 516, q4 = 517, X4 = 518, Xw = 519, Y4 = 512, K4 = 513, J4 = 514, E2 = 515, Z4 = 516, $4 = 517, eG = 518, tG = 519, kv = 35044, yr = 35048, Hj = 35040, Vj = 35045, Qj = 35049, jj = 35041, Wj = 35046, qj = 35050, Xj = 35042, Yj = "100", Yw = "300 es", Kw = 1035, Kl = 2e3, Fv = 2001;
18
+ const _h = "162", Hd = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 }, Vd = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }, r4 = 0, BI = 1, o4 = 2, kj = 3, Fj = 0, u2 = 1, d2 = 2, Ul = 3, ps = 0, xn = 1, yi = 2, fn = 0, Ou = 1, Df = 2, DI = 3, OI = 4, f2 = 5, Cu = 100, a4 = 101, l4 = 102, LI = 103, Qw = 104, c4 = 200, h4 = 201, u4 = 202, d4 = 203, jw = 204, Ww = 205, f4 = 206, p4 = 207, m4 = 208, g4 = 209, y4 = 210, A4 = 211, v4 = 212, _4 = 213, b4 = 214, p2 = 0, JS = 1, Rv = 2, Of = 3, bg = 4, ZS = 5, $S = 6, x0 = 7, w0 = 0, x4 = 1, w4 = 2, Jr = 0, Hg = 1, S0 = 2, S4 = 3, C0 = 4, C4 = 5, Vg = 6, Lf = 7, kI = "attached", E4 = "detached", eC = 300, bh = 301, Wu = 302, mo = 303, xg = 304, Qg = 306, yo = 1e3, $n = 1001, kf = 1002, Ht = 1003, wg = 1004, Uj = 1004, eh = 1005, Nj = 1005, Dt = 1006, gf = 1007, zj = 1007, po = 1008, Gj = 1008, Dn = 1009, M4 = 1010, T4 = 1011, tC = 1012, m2 = 1013, el = 1014, Hn = 1015, ds = 1016, g2 = 1017, y2 = 1018, ph = 1020, I4 = 1021, tn = 1023, iC = 1024, R4 = 1025, Lu = 1026, qu = 1027, jg = 1028, A2 = 1029, v2 = 1030, _2 = 1031, b2 = 1033, iw = 33776, nw = 33777, sw = 33778, rw = 33779, FI = 35840, UI = 35841, NI = 35842, zI = 35843, x2 = 36196, GI = 37492, HI = 37496, VI = 37808, QI = 37809, jI = 37810, WI = 37811, qI = 37812, XI = 37813, YI = 37814, KI = 37815, JI = 37816, ZI = 37817, $I = 37818, eR = 37819, tR = 37820, iR = 37821, ow = 36492, nR = 36494, sR = 36495, P4 = 36283, rR = 36284, oR = 36285, aR = 36286, Pv = 2200, w2 = 2201, B4 = 2202, Xu = 2300, ac = 2301, aw = 2302, tf = 2400, nf = 2401, Bv = 2402, nC = 2500, S2 = 2501, D4 = 0, C2 = 1, qw = 2, O4 = 3e3, lR = 3001, tr = 3200, sC = 3201, Zu = 0, L4 = 1, fo = "", vt = "srgb", Li = "srgb-linear", rC = "display-p3", E0 = "display-p3-linear", Dv = "linear", ji = "srgb", Ov = "rec709", Lv = "p3", k4 = 0, vu = 7680, F4 = 7681, U4 = 7682, N4 = 7683, z4 = 34055, G4 = 34056, H4 = 5386, cR = 512, V4 = 513, Q4 = 514, j4 = 515, W4 = 516, q4 = 517, X4 = 518, Xw = 519, Y4 = 512, K4 = 513, J4 = 514, E2 = 515, Z4 = 516, $4 = 517, eG = 518, tG = 519, kv = 35044, yr = 35048, Hj = 35040, Vj = 35045, Qj = 35049, jj = 35041, Wj = 35046, qj = 35050, Xj = 35042, Yj = "100", Yw = "300 es", Kw = 1035, Kl = 2e3, Fv = 2001;
19
19
  let Ds = class {
20
20
  addEventListener(e, t) {
21
21
  this._listeners === void 0 && (this._listeners = {});
@@ -636,7 +636,7 @@ const qO = /* @__PURE__ */ new Ut().set(
636
636
  -0.0786361,
637
637
  1.0982735
638
638
  ), E_ = {
639
- [Oi]: {
639
+ [Li]: {
640
640
  transfer: Dv,
641
641
  primaries: Ov,
642
642
  toReference: (s) => s,
@@ -660,9 +660,9 @@ const qO = /* @__PURE__ */ new Ut().set(
660
660
  toReference: (s) => s.convertSRGBToLinear().applyMatrix3(XO),
661
661
  fromReference: (s) => s.applyMatrix3(qO).convertLinearToSRGB()
662
662
  }
663
- }, uW = /* @__PURE__ */ new Set([Oi, E0]), wi = {
663
+ }, uW = /* @__PURE__ */ new Set([Li, E0]), wi = {
664
664
  enabled: !0,
665
- _workingColorSpace: Oi,
665
+ _workingColorSpace: Li,
666
666
  get workingColorSpace() {
667
667
  return this._workingColorSpace;
668
668
  },
@@ -9385,7 +9385,7 @@ class dR {
9385
9385
  generateMipmaps: !1,
9386
9386
  type: ds,
9387
9387
  format: tn,
9388
- colorSpace: Oi,
9388
+ colorSpace: Li,
9389
9389
  depthBuffer: !1
9390
9390
  }, n = pL(e, t, i), { _lodMax: r } = this;
9391
9391
  if ({ sizeLods: this._sizeLods, lodPlanes: this._lodPlanes, sigmas: this._sigmas } = fL(r), this._pingPongRenderTarget === null || this._pingPongRenderTarget.width !== e || this._pingPongRenderTarget.height !== t) {
@@ -10585,7 +10585,7 @@ function RX(s) {
10585
10585
  const e = wi.getPrimaries(wi.workingColorSpace), t = wi.getPrimaries(s);
10586
10586
  let i;
10587
10587
  switch (e === t ? i = "" : e === Lv && t === Ov ? i = "LinearDisplayP3ToLinearSRGB" : e === Ov && t === Lv && (i = "LinearSRGBToLinearDisplayP3"), s) {
10588
- case Oi:
10588
+ case Li:
10589
10589
  case E0:
10590
10590
  return [i, "LinearTransferOETF"];
10591
10591
  case vt:
@@ -11229,7 +11229,7 @@ function JX(s, e, t, i, n, r, o) {
11229
11229
  instancingColor: Ve && O.instanceColor !== null,
11230
11230
  instancingMorph: Ve && O.morphTexture !== null,
11231
11231
  supportsVertexTextures: p,
11232
- outputColorSpace: We === null ? s.outputColorSpace : We.isXRRenderTarget === !0 ? We.texture.colorSpace : Oi,
11232
+ outputColorSpace: We === null ? s.outputColorSpace : We.isXRRenderTarget === !0 ? We.texture.colorSpace : Li,
11233
11233
  alphaToCoverage: !!C.alphaToCoverage,
11234
11234
  map: st,
11235
11235
  matcap: W,
@@ -12824,7 +12824,7 @@ function uY(s, e, t, i, n, r, o) {
12824
12824
  }
12825
12825
  function at(H, L) {
12826
12826
  const me = H.colorSpace, _e = H.format, Pe = H.type;
12827
- return H.isCompressedTexture === !0 || H.isVideoTexture === !0 || H.format === Kw || me !== Oi && me !== fo && (wi.getTransfer(me) === ji ? a === !1 ? e.has("EXT_sRGB") === !0 && _e === tn ? (H.format = Kw, H.minFilter = Dt, H.generateMipmaps = !1) : L = T2.sRGBToLinear(L) : (_e !== tn || Pe !== Dn) && console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : console.error("THREE.WebGLTextures: Unsupported texture color space:", me)), L;
12827
+ return H.isCompressedTexture === !0 || H.isVideoTexture === !0 || H.format === Kw || me !== Li && me !== fo && (wi.getTransfer(me) === ji ? a === !1 ? e.has("EXT_sRGB") === !0 && _e === tn ? (H.format = Kw, H.minFilter = Dt, H.generateMipmaps = !1) : L = T2.sRGBToLinear(L) : (_e !== tn || Pe !== Dn) && console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : console.error("THREE.WebGLTextures: Unsupported texture color space:", me)), L;
12828
12828
  }
12829
12829
  function kt(H) {
12830
12830
  return typeof HTMLImageElement < "u" && H instanceof HTMLImageElement ? (h.width = H.naturalWidth || H.width, h.height = H.naturalHeight || H.height) : typeof VideoFrame < "u" && H instanceof VideoFrame ? (h.width = H.displayWidth, h.height = H.displayHeight) : (h.width = H.width, h.height = H.height), h;
@@ -13868,7 +13868,7 @@ class Eh {
13868
13868
  }
13869
13869
  function B(R, G, V, Y, K) {
13870
13870
  G.isScene !== !0 && (G = gt), at.resetTextureUnits();
13871
- const pe = G.fog, he = Y.isMeshStandardMaterial ? G.environment : null, be = M === null ? v.outputColorSpace : M.isXRRenderTarget === !0 ? M.texture.colorSpace : Oi, Be = (Y.isMeshStandardMaterial ? H : kt).get(Y.envMap || he), Oe = Y.vertexColors === !0 && !!V.attributes.color && V.attributes.color.itemSize === 4, je = !!V.attributes.tangent && (!!Y.normalMap || Y.anisotropy > 0), Je = !!V.morphAttributes.position, et = !!V.morphAttributes.normal, ht = !!V.morphAttributes.color;
13871
+ const pe = G.fog, he = Y.isMeshStandardMaterial ? G.environment : null, be = M === null ? v.outputColorSpace : M.isXRRenderTarget === !0 ? M.texture.colorSpace : Li, Be = (Y.isMeshStandardMaterial ? H : kt).get(Y.envMap || he), Oe = Y.vertexColors === !0 && !!V.attributes.color && V.attributes.color.itemSize === 4, je = !!V.attributes.tangent && (!!Y.normalMap || Y.anisotropy > 0), Je = !!V.morphAttributes.position, et = !!V.morphAttributes.normal, ht = !!V.morphAttributes.color;
13872
13872
  let Mt = Jr;
13873
13873
  Y.toneMapped && (M === null || M.isXRRenderTarget === !0) && (Mt = v.toneMapping);
13874
13874
  const vi = V.morphAttributes.position || V.morphAttributes.normal || V.morphAttributes.color, Qt = vi !== void 0 ? vi.length : 0, Pt = $e.get(Y), Ri = g.state.lights;
@@ -13878,11 +13878,11 @@ class Eh {
13878
13878
  }
13879
13879
  let St = !1;
13880
13880
  Y.version === Pt.__version ? (Pt.needsLights && Pt.lightsStateVersion !== Ri.state.version || Pt.outputColorSpace !== be || K.isBatchedMesh && Pt.batching === !1 || !K.isBatchedMesh && Pt.batching === !0 || K.isInstancedMesh && Pt.instancing === !1 || !K.isInstancedMesh && Pt.instancing === !0 || K.isSkinnedMesh && Pt.skinning === !1 || !K.isSkinnedMesh && Pt.skinning === !0 || K.isInstancedMesh && Pt.instancingColor === !0 && K.instanceColor === null || K.isInstancedMesh && Pt.instancingColor === !1 && K.instanceColor !== null || K.isInstancedMesh && Pt.instancingMorph === !0 && K.morphTexture === null || K.isInstancedMesh && Pt.instancingMorph === !1 && K.morphTexture !== null || Pt.envMap !== Be || Y.fog === !0 && Pt.fog !== pe || Pt.numClippingPlanes !== void 0 && (Pt.numClippingPlanes !== ke.numPlanes || Pt.numIntersection !== ke.numIntersection) || Pt.vertexAlphas !== Oe || Pt.vertexTangents !== je || Pt.morphTargets !== Je || Pt.morphNormals !== et || Pt.morphColors !== ht || Pt.toneMapping !== Mt || Ne.isWebGL2 === !0 && Pt.morphTargetsCount !== Qt) && (St = !0) : (St = !0, Pt.__version = Y.version);
13881
- let Ui = Pt.currentProgram;
13882
- St === !0 && (Ui = Zt(Y, G, K));
13881
+ let Ni = Pt.currentProgram;
13882
+ St === !0 && (Ni = Zt(Y, G, K));
13883
13883
  let kr = !1, an = !1, pi = !1;
13884
- const Wt = Ui.getUniforms(), Ls = Pt.uniforms;
13885
- if (Ee.useProgram(Ui.program) && (kr = !0, an = !0, pi = !0), Y.id !== T && (T = Y.id, an = !0), kr || P !== R) {
13884
+ const Wt = Ni.getUniforms(), Ls = Pt.uniforms;
13885
+ if (Ee.useProgram(Ni.program) && (kr = !0, an = !0, pi = !0), Y.id !== T && (T = Y.id, an = !0), kr || P !== R) {
13886
13886
  Wt.setValue(W, "projectionMatrix", R.projectionMatrix), Wt.setValue(W, "viewMatrix", R.matrixWorldInverse);
13887
13887
  const yn = Wt.map.cameraPosition;
13888
13888
  yn !== void 0 && yn.setValue(W, Ve.setFromMatrixPosition(R.matrixWorld)), Ne.logarithmicDepthBuffer && Wt.setValue(
@@ -13898,16 +13898,16 @@ class Eh {
13898
13898
  }
13899
13899
  K.isBatchedMesh && (Wt.setOptional(W, K, "batchingTexture"), Wt.setValue(W, "batchingTexture", K._matricesTexture, at));
13900
13900
  const bc = V.morphAttributes;
13901
- if ((bc.position !== void 0 || bc.normal !== void 0 || bc.color !== void 0 && Ne.isWebGL2 === !0) && Fe.update(K, V, Ui), (an || Pt.receiveShadow !== K.receiveShadow) && (Pt.receiveShadow = K.receiveShadow, Wt.setValue(W, "receiveShadow", K.receiveShadow)), Y.isMeshGouraudMaterial && Y.envMap !== null && (Ls.envMap.value = Be, Ls.flipEnvMap.value = Be.isCubeTexture && Be.isRenderTargetTexture === !1 ? -1 : 1), an && (Wt.setValue(W, "toneMappingExposure", v.toneMappingExposure), Pt.needsLights && N(Ls, pi), pe && Y.fog === !0 && Te.refreshFogUniforms(Ls, pe), Te.refreshMaterialUniforms(Ls, Y, k, D, Se), hw.upload(W, Ry(Pt), Ls, at)), Y.isShaderMaterial && Y.uniformsNeedUpdate === !0 && (hw.upload(W, Ry(Pt), Ls, at), Y.uniformsNeedUpdate = !1), Y.isSpriteMaterial && Wt.setValue(W, "center", K.center), Wt.setValue(W, "modelViewMatrix", K.modelViewMatrix), Wt.setValue(W, "normalMatrix", K.normalMatrix), Wt.setValue(W, "modelMatrix", K.matrixWorld), Y.isShaderMaterial || Y.isRawShaderMaterial) {
13901
+ if ((bc.position !== void 0 || bc.normal !== void 0 || bc.color !== void 0 && Ne.isWebGL2 === !0) && Fe.update(K, V, Ni), (an || Pt.receiveShadow !== K.receiveShadow) && (Pt.receiveShadow = K.receiveShadow, Wt.setValue(W, "receiveShadow", K.receiveShadow)), Y.isMeshGouraudMaterial && Y.envMap !== null && (Ls.envMap.value = Be, Ls.flipEnvMap.value = Be.isCubeTexture && Be.isRenderTargetTexture === !1 ? -1 : 1), an && (Wt.setValue(W, "toneMappingExposure", v.toneMappingExposure), Pt.needsLights && N(Ls, pi), pe && Y.fog === !0 && Te.refreshFogUniforms(Ls, pe), Te.refreshMaterialUniforms(Ls, Y, k, D, Se), hw.upload(W, Ry(Pt), Ls, at)), Y.isShaderMaterial && Y.uniformsNeedUpdate === !0 && (hw.upload(W, Ry(Pt), Ls, at), Y.uniformsNeedUpdate = !1), Y.isSpriteMaterial && Wt.setValue(W, "center", K.center), Wt.setValue(W, "modelViewMatrix", K.modelViewMatrix), Wt.setValue(W, "normalMatrix", K.normalMatrix), Wt.setValue(W, "modelMatrix", K.matrixWorld), Y.isShaderMaterial || Y.isRawShaderMaterial) {
13902
13902
  const yn = Y.uniformsGroups;
13903
13903
  for (let zh = 0, Dj = yn.length; zh < Dj; zh++)
13904
13904
  if (Ne.isWebGL2) {
13905
13905
  const QO = yn[zh];
13906
- rt.update(QO, Ui), rt.bind(QO, Ui);
13906
+ rt.update(QO, Ni), rt.bind(QO, Ni);
13907
13907
  } else
13908
13908
  console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.");
13909
13909
  }
13910
- return Ui;
13910
+ return Ni;
13911
13911
  }
13912
13912
  function N(R, G) {
13913
13913
  R.ambientLightColor.needsUpdate = G, R.lightProbe.needsUpdate = G, R.directionalLights.needsUpdate = G, R.directionalLightShadows.needsUpdate = G, R.pointLights.needsUpdate = G, R.pointLightShadows.needsUpdate = G, R.spotLights.needsUpdate = G, R.spotLightShadows.needsUpdate = G, R.rectAreaLights.needsUpdate = G, R.hemisphereLights.needsUpdate = G;
@@ -14020,7 +14020,7 @@ class Eh {
14020
14020
  return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."), this.outputColorSpace === vt ? lR : O4;
14021
14021
  }
14022
14022
  set outputEncoding(e) {
14023
- console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."), this.outputColorSpace = e === lR ? vt : Oi;
14023
+ console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."), this.outputColorSpace = e === lR ? vt : Li;
14024
14024
  }
14025
14025
  get useLegacyLights() {
14026
14026
  return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."), this._useLegacyLights;
@@ -21611,7 +21611,7 @@ const XK = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
21611
21611
  LinearMipMapNearestFilter: zj,
21612
21612
  LinearMipmapLinearFilter: po,
21613
21613
  LinearMipmapNearestFilter: gf,
21614
- LinearSRGBColorSpace: Oi,
21614
+ LinearSRGBColorSpace: Li,
21615
21615
  LinearToneMapping: Hg,
21616
21616
  LinearTransfer: Dv,
21617
21617
  Loader: ys,
@@ -28661,7 +28661,7 @@ const JH = () => rS.update(), ZH = {
28661
28661
  };
28662
28662
  typeof global < "u" && (global.ThreeMeshUI = ZH);
28663
28663
  const Bee = ZH;
28664
- var Dee = ss.ti, $H = ss.nS, OB = ss.eB, Oee = ss.Yp, ER = ss.VB, Lee = ss.BC, kee = ss.zN, dw = ss.cV, Fee = ss.hW, Uee = ss.k2, Nee = ss.K6, zee = ss.M7, Gee = ss.ls, Hee = ss.Hi, LB = ss.EY, Vee = ss.MR, Qee = ss.zf, zi = ss.Ay, eV = ss.yo;
28664
+ var Dee = ss.ti, $H = ss.nS, OB = ss.eB, Oee = ss.Yp, ER = ss.VB, Lee = ss.BC, kee = ss.zN, dw = ss.cV, Fee = ss.hW, Uee = ss.k2, Nee = ss.K6, zee = ss.M7, Gee = ss.ls, Hee = ss.Hi, LB = ss.EY, Vee = ss.MR, Qee = ss.zf, Gi = ss.Ay, eV = ss.yo;
28665
28665
  const Nk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
28666
28666
  __proto__: null,
28667
28667
  BaseProperty: Dee,
@@ -28681,7 +28681,7 @@ const Nk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
28681
28681
  Text: LB,
28682
28682
  TypographicFont: Vee,
28683
28683
  TypographicGlyph: Qee,
28684
- default: zi,
28684
+ default: Gi,
28685
28685
  update: eV
28686
28686
  }, Symbol.toStringTag, { value: "Module" }));
28687
28687
  class jee {
@@ -28885,7 +28885,7 @@ function GC(s, e, t = !0, i = !1) {
28885
28885
  lM.copy(s.quaternion);
28886
28886
  const n = Gt(e), r = Gt(s);
28887
28887
  if (i) {
28888
- if (ll(s, Fi(e)), t) {
28888
+ if (ll(s, Ui(e)), t) {
28889
28889
  const o = r.y, a = r.sub(sV(s));
28890
28890
  a.y = o, s.lookAt(a);
28891
28891
  }
@@ -28895,7 +28895,7 @@ function GC(s, e, t = !0, i = !1) {
28895
28895
  t && (n.y = r.y), s.lookAt(n), Number.isNaN(s.quaternion.x) && s.quaternion.copy(lM);
28896
28896
  }
28897
28897
  const Kee = new al(() => new w(), 100);
28898
- function Gi(s, e, t) {
28898
+ function Oi(s, e, t) {
28899
28899
  const i = Kee.get();
28900
28900
  return s instanceof w ? i.copy(s) : s instanceof DOMPointReadOnly ? i.set(s.x, s.y, s.z) : (typeof s == "number" && (i.x = s), typeof e == "number" && (i.y = e), typeof t == "number" && (i.z = t)), i;
28901
28901
  }
@@ -28920,7 +28920,7 @@ function Rg(s, e, t, i) {
28920
28920
  return n.set(e, t, i), $s(s, n), s;
28921
28921
  }
28922
28922
  const aS = new al(() => new Ce(), 100), vf = new Ce(), cM = new Ce();
28923
- function Fi(s, e = null) {
28923
+ function Ui(s, e = null) {
28924
28924
  if (!s)
28925
28925
  return aS.get().identity();
28926
28926
  const t = e ?? aS.get();
@@ -28954,11 +28954,11 @@ function Jv(s, e) {
28954
28954
  }
28955
28955
  const ete = new w(), Qk = new Ce();
28956
28956
  function Oxe(s) {
28957
- return Fi(s, Qk), ete.set(0, 0, 1).applyQuaternion(Qk);
28957
+ return Ui(s, Qk), ete.set(0, 0, 1).applyQuaternion(Qk);
28958
28958
  }
28959
28959
  const tte = new al(() => new w(), 100), jk = new Ce();
28960
28960
  function sV(s, e) {
28961
- return e || (e = tte.get().set(0, 0, 1)), Fi(s, jk), e.applyQuaternion(jk);
28961
+ return e || (e = tte.get().set(0, 0, 1)), Ui(s, jk), e.applyQuaternion(jk);
28962
28962
  }
28963
28963
  const Wk = new fi(), qk = new fi(), ite = new w();
28964
28964
  function rV(s) {
@@ -29209,7 +29209,7 @@ class cte {
29209
29209
  const h = Date.now();
29210
29210
  for (let u = 0; u < this._activeTexts.length; u++) {
29211
29211
  const f = this._activeTexts[u];
29212
- if (f instanceof zi.Text && h - f._activatedTime > 2e4) {
29212
+ if (f instanceof Gi.Text && h - f._activatedTime > 2e4) {
29213
29213
  f.removeFromParent(), this._textBuffer.push(f), this._activeTexts.splice(u, 1);
29214
29214
  break;
29215
29215
  }
@@ -29258,15 +29258,15 @@ class cte {
29258
29258
  n.textContent = "[" + a + "] " + t, n.visible = !0, n._activatedTime = Date.now(), i.add(n), this._activeTexts.push(n), this.context && this.context.scene.add(i), n.set({
29259
29259
  backgroundColor: r,
29260
29260
  color: o
29261
- }), zi.update();
29261
+ }), Gi.update();
29262
29262
  }
29263
29263
  ensureFont() {
29264
- let e = zi.FontLibrary.getFontFamily(this.familyName);
29264
+ let e = Gi.FontLibrary.getFontFamily(this.familyName);
29265
29265
  if (!e) {
29266
- e = zi.FontLibrary.addFontFamily(this.familyName);
29266
+ e = Gi.FontLibrary.addFontFamily(this.familyName);
29267
29267
  const t = e.addVariant("normal", "normal", "./include/needle/arial-msdf.json", "./include/needle/arial.png");
29268
29268
  t == null || t.addEventListener("ready", () => {
29269
- zi.update();
29269
+ Gi.update();
29270
29270
  });
29271
29271
  }
29272
29272
  }
@@ -29278,7 +29278,7 @@ class cte {
29278
29278
  }
29279
29279
  if (e.children.length > 20 && this._activeTexts.length > 0)
29280
29280
  return this._activeTexts.shift();
29281
- const t = new zi.Text(this.textOptions);
29281
+ const t = new Gi.Text(this.textOptions);
29282
29282
  return setTimeout(() => this.disableDepthTestRecursive(t), 500), setTimeout(() => this.disableDepthTestRecursive(t), 1500), t;
29283
29283
  }
29284
29284
  disableDepthTestRecursive(e, t = 0) {
@@ -29288,7 +29288,7 @@ class cte {
29288
29288
  }
29289
29289
  e.renderOrder = 10 * t, e.layers.set(2);
29290
29290
  const i = e.material;
29291
- i && (i.depthWrite = !1, i.depthTest = !1, i.transparent = !0), t === 0 && zi.update();
29291
+ i && (i.depthWrite = !1, i.depthTest = !1, i.transparent = !0), t === 0 && Gi.update();
29292
29292
  }
29293
29293
  getRoot() {
29294
29294
  if (this.root)
@@ -29309,7 +29309,7 @@ class cte {
29309
29309
  whiteSpace: "pre-wrap",
29310
29310
  flexDirection: "column-reverse"
29311
29311
  };
29312
- return this.root = new zi.Block(t), this.root;
29312
+ return this.root = new Gi.Block(t), this.root;
29313
29313
  }
29314
29314
  }
29315
29315
  let qr = null;
@@ -29624,13 +29624,13 @@ function bte() {
29624
29624
  return s || null;
29625
29625
  }
29626
29626
  const mV = ie("debugdefines");
29627
- Kg('if(!globalThis[""3.44.2""]) globalThis[""3.44.2""] = "0.0.0";');
29627
+ Kg('if(!globalThis[""3.44.4""]) globalThis[""3.44.4""] = "0.0.0";');
29628
29628
  Kg('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";');
29629
- Kg('if(!globalThis[""Fri Jul 05 2024 15:23:54 GMT+0200 (Central European Summer Time)""]) globalThis[""Fri Jul 05 2024 15:23:54 GMT+0200 (Central European Summer Time)""] = "unknown";');
29630
- Kg('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.44.2";');
29629
+ Kg('if(!globalThis[""Tue Jul 09 2024 10:40:57 GMT+0200 (Central European Summer Time)""]) globalThis[""Tue Jul 09 2024 10:40:57 GMT+0200 (Central European Summer Time)""] = "unknown";');
29630
+ Kg('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.44.4";');
29631
29631
  Kg('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
29632
- Kg('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Fri Jul 05 2024 15:23:54 GMT+0200 (Central European Summer Time)";');
29633
- const tl = "3.44.2", FB = "undefined", gV = "Fri Jul 05 2024 15:23:54 GMT+0200 (Central European Summer Time)";
29632
+ Kg('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Tue Jul 09 2024 10:40:57 GMT+0200 (Central European Summer Time)";');
29633
+ const tl = "3.44.4", FB = "undefined", gV = "Tue Jul 09 2024 10:40:57 GMT+0200 (Central European Summer Time)";
29634
29634
  mV && console.log(`Engine version: ${tl} (generator: ${FB})
29635
29635
  Project built at ${gV}`);
29636
29636
  const Uu = "needle_isActiveInHierarchy", Im = "builtin_components", pw = "needle_editor_guid";
@@ -42144,7 +42144,7 @@ class Rre {
42144
42144
  const r = t.json, l = ((r.extensions && r.extensions[this.name] || {}).lights || [])[e];
42145
42145
  let c;
42146
42146
  const h = new ve(16777215);
42147
- l.color !== void 0 && h.setRGB(l.color[0], l.color[1], l.color[2], Oi);
42147
+ l.color !== void 0 && h.setRGB(l.color[0], l.color[1], l.color[2], Li);
42148
42148
  const u = l.range !== void 0 ? l.range : 0;
42149
42149
  switch (l.type) {
42150
42150
  case "directional":
@@ -42186,7 +42186,7 @@ let Pre = class {
42186
42186
  if (r) {
42187
42187
  if (Array.isArray(r.baseColorFactor)) {
42188
42188
  const o = r.baseColorFactor;
42189
- e.color.setRGB(o[0], o[1], o[2], Oi), e.opacity = o[3];
42189
+ e.color.setRGB(o[0], o[1], o[2], Li), e.opacity = o[3];
42190
42190
  }
42191
42191
  r.baseColorTexture !== void 0 && n.push(i.assignTexture(e, "map", r.baseColorTexture, vt));
42192
42192
  }
@@ -42254,7 +42254,7 @@ let Pre = class {
42254
42254
  const o = n.extensions[this.name];
42255
42255
  if (o.sheenColorFactor !== void 0) {
42256
42256
  const a = o.sheenColorFactor;
42257
- t.sheenColor.setRGB(a[0], a[1], a[2], Oi);
42257
+ t.sheenColor.setRGB(a[0], a[1], a[2], Li);
42258
42258
  }
42259
42259
  return o.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = o.sheenRoughnessFactor), o.sheenColorTexture !== void 0 && r.push(i.assignTexture(t, "sheenColorMap", o.sheenColorTexture, vt)), o.sheenRoughnessTexture !== void 0 && r.push(i.assignTexture(t, "sheenRoughnessMap", o.sheenRoughnessTexture)), Promise.all(r);
42260
42260
  }
@@ -42288,7 +42288,7 @@ let Pre = class {
42288
42288
  const r = [], o = n.extensions[this.name];
42289
42289
  t.thickness = o.thicknessFactor !== void 0 ? o.thicknessFactor : 0, o.thicknessTexture !== void 0 && r.push(i.assignTexture(t, "thicknessMap", o.thicknessTexture)), t.attenuationDistance = o.attenuationDistance || 1 / 0;
42290
42290
  const a = o.attenuationColor || [1, 1, 1];
42291
- return t.attenuationColor = new ve().setRGB(a[0], a[1], a[2], Oi), Promise.all(r);
42291
+ return t.attenuationColor = new ve().setRGB(a[0], a[1], a[2], Li), Promise.all(r);
42292
42292
  }
42293
42293
  }, Ure = class {
42294
42294
  constructor(e) {
@@ -42320,7 +42320,7 @@ let Pre = class {
42320
42320
  const r = [], o = n.extensions[this.name];
42321
42321
  t.specularIntensity = o.specularFactor !== void 0 ? o.specularFactor : 1, o.specularTexture !== void 0 && r.push(i.assignTexture(t, "specularIntensityMap", o.specularTexture));
42322
42322
  const a = o.specularColorFactor || [1, 1, 1];
42323
- return t.specularColor = new ve().setRGB(a[0], a[1], a[2], Oi), o.specularColorTexture !== void 0 && r.push(i.assignTexture(t, "specularColorMap", o.specularColorTexture, vt)), Promise.all(r);
42323
+ return t.specularColor = new ve().setRGB(a[0], a[1], a[2], Li), o.specularColorTexture !== void 0 && r.push(i.assignTexture(t, "specularColorMap", o.specularColorTexture, vt)), Promise.all(r);
42324
42324
  }
42325
42325
  }, zre = class {
42326
42326
  constructor(e) {
@@ -42550,7 +42550,7 @@ class Xre {
42550
42550
  g !== void 0 && (y.normalized = g);
42551
42551
  }
42552
42552
  u(p);
42553
- }, a, c, Oi, f);
42553
+ }, a, c, Li, f);
42554
42554
  });
42555
42555
  });
42556
42556
  }
@@ -43137,7 +43137,7 @@ class ooe {
43137
43137
  const u = r.pbrMetallicRoughness || {};
43138
43138
  if (a.color = new ve(1, 1, 1), a.opacity = 1, Array.isArray(u.baseColorFactor)) {
43139
43139
  const f = u.baseColorFactor;
43140
- a.color.setRGB(f[0], f[1], f[2], Oi), a.opacity = f[3];
43140
+ a.color.setRGB(f[0], f[1], f[2], Li), a.opacity = f[3];
43141
43141
  }
43142
43142
  u.baseColorTexture !== void 0 && c.push(t.assignTexture(a, "map", u.baseColorTexture, vt)), a.metalness = u.metallicFactor !== void 0 ? u.metallicFactor : 1, a.roughness = u.roughnessFactor !== void 0 ? u.roughnessFactor : 1, u.metallicRoughnessTexture !== void 0 && (c.push(t.assignTexture(a, "metalnessMap", u.metallicRoughnessTexture)), c.push(t.assignTexture(a, "roughnessMap", u.metallicRoughnessTexture))), o = this._invokeOne(function(f) {
43143
43143
  return f.getMaterialType && f.getMaterialType(e);
@@ -43153,7 +43153,7 @@ class ooe {
43153
43153
  }
43154
43154
  if (r.occlusionTexture !== void 0 && o !== $t && (c.push(t.assignTexture(a, "aoMap", r.occlusionTexture)), r.occlusionTexture.strength !== void 0 && (a.aoMapIntensity = r.occlusionTexture.strength)), r.emissiveFactor !== void 0 && o !== $t) {
43155
43155
  const u = r.emissiveFactor;
43156
- a.emissive = new ve().setRGB(u[0], u[1], u[2], Oi);
43156
+ a.emissive = new ve().setRGB(u[0], u[1], u[2], Li);
43157
43157
  }
43158
43158
  return r.emissiveTexture !== void 0 && o !== $t && c.push(t.assignTexture(a, "emissiveMap", r.emissiveTexture, vt)), Promise.all(c).then(function() {
43159
43159
  const u = new o(a);
@@ -43513,7 +43513,7 @@ function MU(s, e, t) {
43513
43513
  });
43514
43514
  n.push(o);
43515
43515
  }
43516
- return wi.workingColorSpace !== Oi && "COLOR_0" in i && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${wi.workingColorSpace}" not supported.`), xu(s, e), aoe(s, e, t), Promise.all(n).then(function() {
43516
+ return wi.workingColorSpace !== Li && "COLOR_0" in i && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${wi.workingColorSpace}" not supported.`), xu(s, e), aoe(s, e, t), Promise.all(n).then(function() {
43517
43517
  return e.targets !== void 0 ? toe(s, e.targets, t) : s;
43518
43518
  });
43519
43519
  }
@@ -45382,7 +45382,7 @@ function gT(s, e, t) {
45382
45382
  return i[n];
45383
45383
  return !1;
45384
45384
  }
45385
- const ix = new fi(), Ni = new w(0, 1, 0), QU = new w(0, 0, 0), jU = new ye(), nx = new Ce(), bw = new Ce(), El = new w(), WU = new ye(), DA = new w(1, 0, 0), jd = new w(0, 1, 0), OA = new w(0, 0, 1), sx = new w(), oA = new w(), aA = new w();
45385
+ const ix = new fi(), zi = new w(0, 1, 0), QU = new w(0, 0, 0), jU = new ye(), nx = new Ce(), bw = new Ce(), El = new w(), WU = new ye(), DA = new w(1, 0, 0), jd = new w(0, 1, 0), OA = new w(0, 0, 1), sx = new w(), oA = new w(), aA = new w();
45386
45386
  class iD extends Ae {
45387
45387
  constructor() {
45388
45388
  super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
@@ -45632,10 +45632,10 @@ class iD extends Ae {
45632
45632
  o.visible = !0, o.rotation.set(0, 0, 0), o.position.copy(this.worldPosition);
45633
45633
  let a;
45634
45634
  if (this.camera.isOrthographicCamera ? a = (this.camera.top - this.camera.bottom) / this.camera.zoom : a = this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), o.scale.set(1, 1, 1).multiplyScalar(a * this.size / 4), o.tag === "helper") {
45635
- o.visible = !1, o.name === "AXIS" ? (o.visible = !!this.axis, this.axis === "X" && (un.setFromEuler(ix.set(0, 0, 0)), o.quaternion.copy(i).multiply(un), Math.abs(Ni.copy(DA).applyQuaternion(i).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Y" && (un.setFromEuler(ix.set(0, 0, Math.PI / 2)), o.quaternion.copy(i).multiply(un), Math.abs(Ni.copy(jd).applyQuaternion(i).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Z" && (un.setFromEuler(ix.set(0, Math.PI / 2, 0)), o.quaternion.copy(i).multiply(un), Math.abs(Ni.copy(OA).applyQuaternion(i).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "XYZE" && (un.setFromEuler(ix.set(0, Math.PI / 2, 0)), Ni.copy(this.rotationAxis), o.quaternion.setFromRotationMatrix(jU.lookAt(QU, Ni, jd)), o.quaternion.multiply(un), o.visible = this.dragging), this.axis === "E" && (o.visible = !1)) : o.name === "START" ? (o.position.copy(this.worldPositionStart), o.visible = this.dragging) : o.name === "END" ? (o.position.copy(this.worldPosition), o.visible = this.dragging) : o.name === "DELTA" ? (o.position.copy(this.worldPositionStart), o.quaternion.copy(this.worldQuaternionStart), mr.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), mr.applyQuaternion(this.worldQuaternionStart.clone().invert()), o.scale.copy(mr), o.visible = this.dragging) : (o.quaternion.copy(i), this.dragging ? o.position.copy(this.worldPositionStart) : o.position.copy(this.worldPosition), this.axis && (o.visible = this.axis.search(o.name) !== -1));
45635
+ o.visible = !1, o.name === "AXIS" ? (o.visible = !!this.axis, this.axis === "X" && (un.setFromEuler(ix.set(0, 0, 0)), o.quaternion.copy(i).multiply(un), Math.abs(zi.copy(DA).applyQuaternion(i).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Y" && (un.setFromEuler(ix.set(0, 0, Math.PI / 2)), o.quaternion.copy(i).multiply(un), Math.abs(zi.copy(jd).applyQuaternion(i).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Z" && (un.setFromEuler(ix.set(0, Math.PI / 2, 0)), o.quaternion.copy(i).multiply(un), Math.abs(zi.copy(OA).applyQuaternion(i).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "XYZE" && (un.setFromEuler(ix.set(0, Math.PI / 2, 0)), zi.copy(this.rotationAxis), o.quaternion.setFromRotationMatrix(jU.lookAt(QU, zi, jd)), o.quaternion.multiply(un), o.visible = this.dragging), this.axis === "E" && (o.visible = !1)) : o.name === "START" ? (o.position.copy(this.worldPositionStart), o.visible = this.dragging) : o.name === "END" ? (o.position.copy(this.worldPosition), o.visible = this.dragging) : o.name === "DELTA" ? (o.position.copy(this.worldPositionStart), o.quaternion.copy(this.worldQuaternionStart), mr.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), mr.applyQuaternion(this.worldQuaternionStart.clone().invert()), o.scale.copy(mr), o.visible = this.dragging) : (o.quaternion.copy(i), this.dragging ? o.position.copy(this.worldPositionStart) : o.position.copy(this.worldPosition), this.axis && (o.visible = this.axis.search(o.name) !== -1));
45636
45636
  continue;
45637
45637
  }
45638
- o.quaternion.copy(i), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs(Ni.copy(DA).applyQuaternion(i).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Y" && Math.abs(Ni.copy(jd).applyQuaternion(i).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Z" && Math.abs(Ni.copy(OA).applyQuaternion(i).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XY" && Math.abs(Ni.copy(OA).applyQuaternion(i).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "YZ" && Math.abs(Ni.copy(DA).applyQuaternion(i).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XZ" && Math.abs(Ni.copy(jd).applyQuaternion(i).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1)) : this.mode === "rotate" && (nx.copy(i), Ni.copy(this.eye).applyQuaternion(un.copy(i).invert()), o.name.search("E") !== -1 && o.quaternion.setFromRotationMatrix(jU.lookAt(this.eye, QU, jd)), o.name === "X" && (un.setFromAxisAngle(DA, Math.atan2(-Ni.y, Ni.z)), un.multiplyQuaternions(nx, un), o.quaternion.copy(un)), o.name === "Y" && (un.setFromAxisAngle(jd, Math.atan2(Ni.x, Ni.z)), un.multiplyQuaternions(nx, un), o.quaternion.copy(un)), o.name === "Z" && (un.setFromAxisAngle(OA, Math.atan2(Ni.y, Ni.x)), un.multiplyQuaternions(nx, un), o.quaternion.copy(un))), o.visible = o.visible && (o.name.indexOf("X") === -1 || this.showX), o.visible = o.visible && (o.name.indexOf("Y") === -1 || this.showY), o.visible = o.visible && (o.name.indexOf("Z") === -1 || this.showZ), o.visible = o.visible && (o.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), o.material._color = o.material._color || o.material.color.clone(), o.material._opacity = o.material._opacity || o.material.opacity, o.material.color.copy(o.material._color), o.material.opacity = o.material._opacity, this.enabled && this.axis && (o.name === this.axis || this.axis.split("").some(function(l) {
45638
+ o.quaternion.copy(i), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs(zi.copy(DA).applyQuaternion(i).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Y" && Math.abs(zi.copy(jd).applyQuaternion(i).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Z" && Math.abs(zi.copy(OA).applyQuaternion(i).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XY" && Math.abs(zi.copy(OA).applyQuaternion(i).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "YZ" && Math.abs(zi.copy(DA).applyQuaternion(i).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XZ" && Math.abs(zi.copy(jd).applyQuaternion(i).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1)) : this.mode === "rotate" && (nx.copy(i), zi.copy(this.eye).applyQuaternion(un.copy(i).invert()), o.name.search("E") !== -1 && o.quaternion.setFromRotationMatrix(jU.lookAt(this.eye, QU, jd)), o.name === "X" && (un.setFromAxisAngle(DA, Math.atan2(-zi.y, zi.z)), un.multiplyQuaternions(nx, un), o.quaternion.copy(un)), o.name === "Y" && (un.setFromAxisAngle(jd, Math.atan2(zi.x, zi.z)), un.multiplyQuaternions(nx, un), o.quaternion.copy(un)), o.name === "Z" && (un.setFromAxisAngle(OA, Math.atan2(zi.y, zi.x)), un.multiplyQuaternions(nx, un), o.quaternion.copy(un))), o.visible = o.visible && (o.name.indexOf("X") === -1 || this.showX), o.visible = o.visible && (o.name.indexOf("Y") === -1 || this.showY), o.visible = o.visible && (o.name.indexOf("Z") === -1 || this.showZ), o.visible = o.visible && (o.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), o.material._color = o.material._color || o.material.color.clone(), o.material._opacity = o.material._opacity || o.material.opacity, o.material.color.copy(o.material._color), o.material.opacity = o.material._opacity, this.enabled && this.axis && (o.name === this.axis || this.axis.split("").some(function(l) {
45639
45639
  return o.name === l;
45640
45640
  })) && (o.material.color.setHex(16776960), o.material.opacity = 1);
45641
45641
  }
@@ -45651,18 +45651,18 @@ class Noe extends fe {
45651
45651
  }
45652
45652
  updateMatrixWorld(e) {
45653
45653
  let t = this.space;
45654
- switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), sx.copy(DA).applyQuaternion(t === "local" ? this.worldQuaternion : bw), oA.copy(jd).applyQuaternion(t === "local" ? this.worldQuaternion : bw), aA.copy(OA).applyQuaternion(t === "local" ? this.worldQuaternion : bw), Ni.copy(oA), this.mode) {
45654
+ switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), sx.copy(DA).applyQuaternion(t === "local" ? this.worldQuaternion : bw), oA.copy(jd).applyQuaternion(t === "local" ? this.worldQuaternion : bw), aA.copy(OA).applyQuaternion(t === "local" ? this.worldQuaternion : bw), zi.copy(oA), this.mode) {
45655
45655
  case "translate":
45656
45656
  case "scale":
45657
45657
  switch (this.axis) {
45658
45658
  case "X":
45659
- Ni.copy(this.eye).cross(sx), El.copy(sx).cross(Ni);
45659
+ zi.copy(this.eye).cross(sx), El.copy(sx).cross(zi);
45660
45660
  break;
45661
45661
  case "Y":
45662
- Ni.copy(this.eye).cross(oA), El.copy(oA).cross(Ni);
45662
+ zi.copy(this.eye).cross(oA), El.copy(oA).cross(zi);
45663
45663
  break;
45664
45664
  case "Z":
45665
- Ni.copy(this.eye).cross(aA), El.copy(aA).cross(Ni);
45665
+ zi.copy(this.eye).cross(aA), El.copy(aA).cross(zi);
45666
45666
  break;
45667
45667
  case "XY":
45668
45668
  El.copy(aA);
@@ -45671,7 +45671,7 @@ class Noe extends fe {
45671
45671
  El.copy(sx);
45672
45672
  break;
45673
45673
  case "XZ":
45674
- Ni.copy(aA), El.copy(oA);
45674
+ zi.copy(aA), El.copy(oA);
45675
45675
  break;
45676
45676
  case "XYZ":
45677
45677
  case "E":
@@ -45683,7 +45683,7 @@ class Noe extends fe {
45683
45683
  default:
45684
45684
  El.set(0, 0, 0);
45685
45685
  }
45686
- El.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (WU.lookAt(mr.set(0, 0, 0), El, Ni), this.quaternion.setFromRotationMatrix(WU)), super.updateMatrixWorld(e);
45686
+ El.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (WU.lookAt(mr.set(0, 0, 0), El, zi), this.quaternion.setFromRotationMatrix(WU)), super.updateMatrixWorld(e);
45687
45687
  }
45688
45688
  }
45689
45689
  const zoe = ie("debugpatch");
@@ -47108,7 +47108,7 @@ uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuf
47108
47108
  [_i.FRAGMENT_MAIN_IMAGE, null],
47109
47109
  [_i.VERTEX_HEAD, null],
47110
47110
  [_i.VERTEX_MAIN_SUPPORT, null]
47111
- ]), this.defines = /* @__PURE__ */ new Map(), this.uniforms = /* @__PURE__ */ new Map(), this.blendModes = /* @__PURE__ */ new Map(), this.extensions = /* @__PURE__ */ new Set(), this.attributes = Yo.NONE, this.varyings = /* @__PURE__ */ new Set(), this.uvTransformation = !1, this.readDepth = !1, this.colorSpace = Oi;
47111
+ ]), this.defines = /* @__PURE__ */ new Map(), this.uniforms = /* @__PURE__ */ new Map(), this.blendModes = /* @__PURE__ */ new Map(), this.extensions = /* @__PURE__ */ new Set(), this.attributes = Yo.NONE, this.varyings = /* @__PURE__ */ new Set(), this.uvTransformation = !1, this.readDepth = !1, this.colorSpace = Li;
47112
47112
  }
47113
47113
  }, bT = !1, tN = class {
47114
47114
  /**
@@ -48700,7 +48700,7 @@ uniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varyin
48700
48700
  extensions: o = null,
48701
48701
  vertexShader: a = null
48702
48702
  } = {}) {
48703
- super(), this.name = s, this.renderer = null, this.attributes = t, this.fragmentShader = e, this.vertexShader = a, this.defines = n, this.uniforms = r, this.extensions = o, this.blendMode = new ele(i), this.blendMode.addEventListener("change", (l) => this.setChanged()), this._inputColorSpace = Oi, this._outputColorSpace = fo;
48703
+ super(), this.name = s, this.renderer = null, this.attributes = t, this.fragmentShader = e, this.vertexShader = a, this.defines = n, this.uniforms = r, this.extensions = o, this.blendMode = new ele(i), this.blendMode.addEventListener("change", (l) => this.setChanged()), this._inputColorSpace = Li, this._outputColorSpace = fo;
48704
48704
  }
48705
48705
  /**
48706
48706
  * The input color space.
@@ -55377,11 +55377,21 @@ const wT = Symbol("assetReference"), $d = class {
55377
55377
  set asset(e) {
55378
55378
  this._asset = e;
55379
55379
  }
55380
- // TODO: rename to url
55381
- /** The url of the loaded asset (or the asset to be loaded) */
55380
+ /** The url of the loaded asset (or the asset to be loaded)
55381
+ * @deprecated use url */
55382
55382
  get uri() {
55383
55383
  return this._url;
55384
55384
  }
55385
+ /** The url of the loaded asset (or the asset to be loaded) */
55386
+ get url() {
55387
+ return this._url;
55388
+ }
55389
+ /**
55390
+ * @returns true if the uri is a valid URL (http, https, blob)
55391
+ */
55392
+ get hasUrl() {
55393
+ return this._url !== void 0 && (this._url.startsWith("http") || this._url.startsWith("blob:"));
55394
+ }
55385
55395
  /**
55386
55396
  * This is the loaded asset root object. If the asset is a glb/gltf file this will be the {@link three#Scene} object.
55387
55397
  */
@@ -56046,12 +56056,12 @@ function pD(s = null) {
56046
56056
  const fP = Symbol("GizmoCache");
56047
56057
  class In {
56048
56058
  static ensureFont() {
56049
- let e = zi.FontLibrary.getFontFamily(this.familyName);
56059
+ let e = Gi.FontLibrary.getFontFamily(this.familyName);
56050
56060
  if (!e) {
56051
- e = zi.FontLibrary.addFontFamily(this.familyName);
56061
+ e = Gi.FontLibrary.addFontFamily(this.familyName);
56052
56062
  const t = e.addVariant("normal", "normal", "https://uploads.needle.tools/include/font-msdf.json", "https://uploads.needle.tools/include/font.png");
56053
56063
  t == null || t.addEventListener("ready", () => {
56054
- zi.update();
56064
+ Gi.update();
56055
56065
  });
56056
56066
  }
56057
56067
  }
@@ -56142,10 +56152,10 @@ class In {
56142
56152
  }), t.renderOrder = 999999, t[fP] = n, this.timedObjectsBuffer.push(t), i <= 0 && e.currentFrameEvent >= sn.OnBeforeRender ? this.timesBuffer.push(0) : this.timesBuffer.push(Lt.Current.time.realtimeSinceStartup + i), e.scene.add(t);
56143
56153
  }
56144
56154
  static onBeforeRender(e, t) {
56145
- this.tmuiNeedsUpdate && zi.update();
56155
+ this.tmuiNeedsUpdate && Gi.update();
56146
56156
  for (let i = 0; i < t.length; i++) {
56147
56157
  const n = t[i];
56148
- if (e.mainCamera && n instanceof zi.MeshUIBaseElement) {
56158
+ if (e.mainCamera && n instanceof Gi.MeshUIBaseElement) {
56149
56159
  if (Ng(n))
56150
56160
  continue;
56151
56161
  const r = e.isInVR, o = !1, a = !r;
@@ -56953,14 +56963,14 @@ class d8 {
56953
56963
  return;
56954
56964
  this.onUpdateFrame(e.frame), this._hasSelectEvent = !0;
56955
56965
  const t = (n = this._layout) == null ? void 0 : n.selectComponentId, i = (a = (o = (r = this._layout) == null ? void 0 : r.components[t]) == null ? void 0 : o.gamepadIndices) == null ? void 0 : a.button;
56956
- i !== void 0 && (this._selectButtonIndex = i), !ax && (lu && _t.DrawDirection(this.rayWorldPosition, Gi(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 16711680, 10), this.emitPointerEvent(vn.PointerDown, this._selectButtonIndex || 0, "xr-standard-trigger", !0, e));
56966
+ i !== void 0 && (this._selectButtonIndex = i), !ax && (lu && _t.DrawDirection(this.rayWorldPosition, Oi(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 16711680, 10), this.emitPointerEvent(vn.PointerDown, this._selectButtonIndex || 0, "xr-standard-trigger", !0, e));
56957
56967
  });
56958
56968
  d(this, "onSelectEnd", (e) => {
56959
56969
  ax || this.inputSource === e.inputSource && this.emitPointerEvent(vn.PointerUp, this._selectButtonIndex || 0, "xr-standard-trigger", !0, e);
56960
56970
  });
56961
56971
  d(this, "onSequeezeStart", (e) => {
56962
56972
  var t, i, n;
56963
- this.inputSource === e.inputSource && (this._squeezeButtonIndex = (n = (i = (t = this._layout) == null ? void 0 : t.components["xr-standard-squeeze"]) == null ? void 0 : i.gamepadIndices) == null ? void 0 : n.button, this._squeezeButtonIndex !== void 0 && (lu && _t.DrawDirection(this.rayWorldPosition, Gi(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 255, 10), this.emitPointerEvent(vn.PointerDown, this._squeezeButtonIndex || 0, "xr-standard-squeeze", !0, e)));
56973
+ this.inputSource === e.inputSource && (this._squeezeButtonIndex = (n = (i = (t = this._layout) == null ? void 0 : t.components["xr-standard-squeeze"]) == null ? void 0 : i.gamepadIndices) == null ? void 0 : n.button, this._squeezeButtonIndex !== void 0 && (lu && _t.DrawDirection(this.rayWorldPosition, Oi(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 255, 10), this.emitPointerEvent(vn.PointerDown, this._squeezeButtonIndex || 0, "xr-standard-squeeze", !0, e)));
56964
56974
  });
56965
56975
  d(this, "onSequeezeEnd", (e) => {
56966
56976
  this.inputSource === e.inputSource && this._squeezeButtonIndex !== void 0 && this.emitPointerEvent(vn.PointerUp, this._squeezeButtonIndex || 0, "xr-standard-squeeze", !0, e);
@@ -57081,7 +57091,7 @@ class d8 {
57081
57091
  }
57082
57092
  /** Grip position in rig space */
57083
57093
  get gripPosition() {
57084
- return Gi(this._gripPosition).applyMatrix4(gS);
57094
+ return Oi(this._gripPosition).applyMatrix4(gS);
57085
57095
  }
57086
57096
  /** Grip rotation in rig space */
57087
57097
  get gripQuaternion() {
@@ -57091,11 +57101,11 @@ class d8 {
57091
57101
  * @link https://developer.mozilla.org/en-US/docs/Web/API/XRPose/linearVelocity
57092
57102
  */
57093
57103
  get gripLinearVelocity() {
57094
- return Gi(this._linearVelocity).applyQuaternion(va);
57104
+ return Oi(this._linearVelocity).applyQuaternion(va);
57095
57105
  }
57096
57106
  /** Ray position in rig space */
57097
57107
  get rayPosition() {
57098
- return Gi(this._rayPosition).applyMatrix4(gS);
57108
+ return Oi(this._rayPosition).applyMatrix4(gS);
57099
57109
  }
57100
57110
  /** Ray rotation in rig space */
57101
57111
  get rayQuaternion() {
@@ -57103,7 +57113,7 @@ class d8 {
57103
57113
  }
57104
57114
  /** Controller grip position in worldspace */
57105
57115
  get gripWorldPosition() {
57106
- return Gi(this._gripWorldPosition);
57116
+ return Oi(this._gripWorldPosition);
57107
57117
  }
57108
57118
  /** Controller grip rotation in wordspace */
57109
57119
  get gripWorldQuaternion() {
@@ -57111,7 +57121,7 @@ class d8 {
57111
57121
  }
57112
57122
  /** Controller ray position in worldspace (this value is calculated once per frame by default - call `updateRayWorldPosition` to force an update) */
57113
57123
  get rayWorldPosition() {
57114
- return Gi(this._rayWorldPosition);
57124
+ return Oi(this._rayWorldPosition);
57115
57125
  }
57116
57126
  /** Recalculates the ray world position */
57117
57127
  updateRayWorldPosition() {
@@ -57126,12 +57136,12 @@ class d8 {
57126
57136
  /** Recalculates the ray world quaternion */
57127
57137
  updateRayWorldQuaternion() {
57128
57138
  var i;
57129
- const e = (i = this.xr.context.mainCamera) == null ? void 0 : i.parent, t = e ? Fi(e) : void 0;
57139
+ const e = (i = this.xr.context.mainCamera) == null ? void 0 : i.parent, t = e ? Ui(e) : void 0;
57130
57140
  this._rayWorldQuaternion.copy(this._rayQuaternion).multiply(va), t && this._rayWorldQuaternion.premultiply(t);
57131
57141
  }
57132
57142
  /** The controller ray in worldspace */
57133
57143
  get ray() {
57134
- return this._ray.origin.copy(this.rayWorldPosition), this._ray.direction.copy(Gi(0, 0, 1).applyQuaternion(this.rayWorldQuaternion)), this._ray;
57144
+ return this._ray.origin.copy(this.rayWorldPosition), this._ray.direction.copy(Oi(0, 0, 1).applyQuaternion(this.rayWorldQuaternion)), this._ray;
57135
57145
  }
57136
57146
  /** The controller object space.
57137
57147
  * You can use it to attach objects to the controller.
@@ -57150,7 +57160,7 @@ class d8 {
57150
57160
  }
57151
57161
  onRenderDebug() {
57152
57162
  var n;
57153
- _t.DrawWireSphere(this.rayWorldPosition, 0.02), _t.DrawDirection(this.rayWorldPosition, Gi(0, 0, 10).applyQuaternion(this.rayWorldQuaternion));
57163
+ _t.DrawWireSphere(this.rayWorldPosition, 0.02), _t.DrawDirection(this.rayWorldPosition, Oi(0, 0, 10).applyQuaternion(this.rayWorldQuaternion));
57154
57164
  const e = this.gripWorldPosition.sub(this.object.worldForward.multiplyScalar(0.1)), t = this.inputSource.profiles.join(`
57155
57165
  `);
57156
57166
  let i = `Controller[${this.index}] ${this.side}
@@ -57198,7 +57208,7 @@ Pinch: ${(n = this.getGesture("pinch")) == null ? void 0 : n.value.toFixed(3)}`)
57198
57208
  }
57199
57209
  } else
57200
57210
  this.inputSource.gripSpace && this.targetRayMode === "transient-pointer" ? (this._object.position.copy(this._gripPosition), this._object.quaternion.copy(this._gripQuaternion).multiply(va)) : (this._object.position.copy(this._rayPosition), this._object.quaternion.copy(this._rayQuaternion).multiply(va));
57201
- const n = (l = this.xr.context.mainCamera) == null ? void 0 : l.parent, r = n ? Fi(n) : void 0;
57211
+ const n = (l = this.xr.context.mainCamera) == null ? void 0 : l.parent, r = n ? Ui(n) : void 0;
57202
57212
  this._gripWorldPosition.copy(this._gripPosition), n && this._gripWorldPosition.applyMatrix4(n.matrixWorld), this._gripWorldQuaternion.copy(this._gripQuaternion), this._gripWorldQuaternion.multiply(va), r && this._gripWorldQuaternion.premultiply(r), this.updateRayWorldPosition(), this.updateRayWorldQuaternion();
57203
57213
  }
57204
57214
  /** Called when the input source disconnects */
@@ -64141,7 +64151,7 @@ const Yc = class {
64141
64151
  qhe(e, n.init), this.session = t, this.mode = e, this.context = i, (xs || ie("console")) && Zv(!0), this._xr_scripts = [...n.scripts], this._xr_update_scripts = this._xr_scripts.filter((a) => typeof a.onUpdateXR == "function"), this._controllerAdded = n.controller_added, this._controllerRemoved = n.controller_removed, nd(this.onBefore, sn.LateUpdate), this.context.pre_render_callbacks.push(this.onBeforeRender), this.context.post_render_callbacks.push(this.onAfterRender), ((r = n.init.optionalFeatures) != null && r.includes("hit-test") || (o = n.init.requiredFeatures) != null && o.includes("hit-test")) && t.requestReferenceSpace("viewer").then((a) => {
64142
64152
  var l, c;
64143
64153
  return (c = (l = t.requestHitTestSource) == null ? void 0 : l.call(t, { space: a })) == null ? void 0 : c.then((h) => this._viewerHitTestSource = h);
64144
- }).catch((a) => console.warn(a)), this.context.mainCamera && (this._originalCameraWorldPosition = Gt(this.context.mainCamera, new w()), this._originalCameraWorldRotation = Fi(this.context.mainCamera, new Ce()), this._originalCameraWorldScale = en(this.context.mainCamera, new w()), this._originalCameraParent = this.context.mainCamera.parent), this._defaultRig = new Yce(), this.context.scene.add(this._defaultRig.gameObject), this.addRig(this._defaultRig);
64154
+ }).catch((a) => console.warn(a)), this.context.mainCamera && (this._originalCameraWorldPosition = Gt(this.context.mainCamera, new w()), this._originalCameraWorldRotation = Ui(this.context.mainCamera, new Ce()), this._originalCameraWorldScale = en(this.context.mainCamera, new w()), this._originalCameraParent = this.context.mainCamera.parent), this._defaultRig = new Yce(), this.context.scene.add(this._defaultRig.gameObject), this.addRig(this._defaultRig);
64145
64155
  for (let a = 0; a < t.inputSources.length; a++) {
64146
64156
  const l = t.inputSources[a];
64147
64157
  if (!l.handedness) {
@@ -64503,10 +64513,10 @@ const Yc = class {
64503
64513
  convertHitTestResult(e) {
64504
64514
  const t = this.context.renderer.xr.getReferenceSpace(), i = t && e.getPose(t);
64505
64515
  if (i) {
64506
- const n = Gi(i.transform.position), r = jm(i.transform.orientation), o = this.context.mainCamera;
64516
+ const n = Oi(i.transform.position), r = jm(i.transform.orientation), o = this.context.mainCamera;
64507
64517
  if ((o == null ? void 0 : o.parent) !== this._cameraRenderParent && n.applyMatrix4(gS), o != null && o.parent) {
64508
64518
  n.applyMatrix4(o.parent.matrixWorld), r.multiply(va);
64509
- const a = Fi(o.parent);
64519
+ const a = Ui(o.parent);
64510
64520
  a.premultiply(va), r.premultiply(a);
64511
64521
  }
64512
64522
  return { hit: e, position: n, quaternion: r };
@@ -64515,7 +64525,7 @@ const Yc = class {
64515
64525
  }
64516
64526
  /** convert a XRRigidTransform from XR session space to threejs / Needle Engine XR space */
64517
64527
  convertSpace(e) {
64518
- const t = Gi(e.position);
64528
+ const t = Oi(e.position);
64519
64529
  t.applyMatrix4(gS);
64520
64530
  const i = jm(e.orientation);
64521
64531
  return i.premultiply(va), { position: t, quaternion: i };
@@ -64966,20 +64976,20 @@ class c0 extends Z2 {
64966
64976
  let Ri = Be;
64967
64977
  const St = Be + R * (Z - be);
64968
64978
  for (; Ri <= St; Ri += ht) {
64969
- const Ui = Ri + et, kr = Ri + je, an = kr + et;
64970
- K ? (Le(B[Ri + N], B[kr + N]), Mt = Se.a, Qt = Se.b, Le(B[Ui + N], B[an + N]), vi = Se.a, Pt = Se.b, Le(Mt, vi), B[Ri + N] = Se.a, B[Ui + N] = Se.b, Le(Qt, Pt), B[kr + N] = Se.a, B[an + N] = Se.b) : (We(B[Ri + N], B[kr + N]), Mt = Se.a, Qt = Se.b, We(B[Ui + N], B[an + N]), vi = Se.a, Pt = Se.b, We(Mt, vi), B[Ri + N] = Se.a, B[Ui + N] = Se.b, We(Qt, Pt), B[kr + N] = Se.a, B[an + N] = Se.b);
64979
+ const Ni = Ri + et, kr = Ri + je, an = kr + et;
64980
+ K ? (Le(B[Ri + N], B[kr + N]), Mt = Se.a, Qt = Se.b, Le(B[Ni + N], B[an + N]), vi = Se.a, Pt = Se.b, Le(Mt, vi), B[Ri + N] = Se.a, B[Ni + N] = Se.b, Le(Qt, Pt), B[kr + N] = Se.a, B[an + N] = Se.b) : (We(B[Ri + N], B[kr + N]), Mt = Se.a, Qt = Se.b, We(B[Ni + N], B[an + N]), vi = Se.a, Pt = Se.b, We(Mt, vi), B[Ri + N] = Se.a, B[Ni + N] = Se.b, We(Qt, Pt), B[kr + N] = Se.a, B[an + N] = Se.b);
64971
64981
  }
64972
64982
  if (Z & he) {
64973
- const Ui = Ri + je;
64974
- K ? Le(B[Ri + N], B[Ui + N]) : We(B[Ri + N], B[Ui + N]), Mt = Se.a, B[Ui + N] = Se.b, B[Ri + N] = Mt;
64983
+ const Ni = Ri + je;
64984
+ K ? Le(B[Ri + N], B[Ni + N]) : We(B[Ri + N], B[Ni + N]), Mt = Se.a, B[Ni + N] = Se.b, B[Ri + N] = Mt;
64975
64985
  }
64976
64986
  }
64977
64987
  if (G & he) {
64978
64988
  let Ri = Be;
64979
64989
  const St = Be + R * (Z - be);
64980
64990
  for (; Ri <= St; Ri += ht) {
64981
- const Ui = Ri + et;
64982
- K ? Le(B[Ri + N], B[Ui + N]) : We(B[Ri + N], B[Ui + N]), Mt = Se.a, B[Ui + N] = Se.b, B[Ri + N] = Mt;
64991
+ const Ni = Ri + et;
64992
+ K ? Le(B[Ri + N], B[Ni + N]) : We(B[Ri + N], B[Ni + N]), Mt = Se.a, B[Ni + N] = Se.b, B[Ri + N] = Mt;
64983
64993
  }
64984
64994
  }
64985
64995
  be = he, he >>= 1;
@@ -65078,8 +65088,8 @@ class c0 extends Z2 {
65078
65088
  for (let St = 0; St < he; ++St)
65079
65089
  Pt[St] = N[B.idx[St]], ht[St] = St < 1 ? 0 : ht[St - 1] + Be * Oe, Mt[St] = new Float32Array(64), vi[St] = new Uint16Array(64), Qt[St] = new Uint16Array(Be * 64);
65080
65090
  for (let St = 0; St < Oe; ++St) {
65081
- let Ui = 8;
65082
- St == Oe - 1 && (Ui = Je);
65091
+ let Ni = 8;
65092
+ St == Oe - 1 && (Ni = Je);
65083
65093
  let kr = 8;
65084
65094
  for (let pi = 0; pi < Be; ++pi) {
65085
65095
  pi == Be - 1 && (kr = je);
@@ -65092,7 +65102,7 @@ class c0 extends Z2 {
65092
65102
  let an = 0;
65093
65103
  for (let pi = 0; pi < he; ++pi) {
65094
65104
  const Wt = Z[B.idx[pi]].type;
65095
- for (let Ls = 8 * St; Ls < 8 * St + Ui; ++Ls) {
65105
+ for (let Ls = 8 * St; Ls < 8 * St + Ni; ++Ls) {
65096
65106
  an = Pt[pi][Ls];
65097
65107
  for (let bc = 0; bc < be; ++bc) {
65098
65108
  const yn = bc * 64 + (Ls & 7) * 8;
@@ -65100,7 +65110,7 @@ class c0 extends Z2 {
65100
65110
  }
65101
65111
  }
65102
65112
  if (be != Be)
65103
- for (let Ls = 8 * St; Ls < 8 * St + Ui; ++Ls) {
65113
+ for (let Ls = 8 * St; Ls < 8 * St + Ni; ++Ls) {
65104
65114
  const bc = Pt[pi][Ls] + 8 * be * 2 * Wt, yn = be * 64 + (Ls & 7) * 8;
65105
65115
  for (let zh = 0; zh < kr; ++zh)
65106
65116
  Y.setUint16(bc + zh * 2 * Wt, Qt[pi][yn + zh], !0);
@@ -65111,14 +65121,14 @@ class c0 extends Z2 {
65111
65121
  Y = new DataView(V.buffer);
65112
65122
  for (let St = 0; St < he; ++St) {
65113
65123
  Z[B.idx[St]].decoded = !0;
65114
- const Ui = Z[B.idx[St]].type;
65124
+ const Ni = Z[B.idx[St]].type;
65115
65125
  if (Z[St].type == 2)
65116
65126
  for (let kr = 0; kr < pe; ++kr) {
65117
65127
  const an = Pt[St][kr];
65118
65128
  for (let pi = 0; pi < K; ++pi)
65119
- Ri[pi] = Y.getUint16(an + pi * 2 * Ui, !0);
65129
+ Ri[pi] = Y.getUint16(an + pi * 2 * Ni, !0);
65120
65130
  for (let pi = 0; pi < K; ++pi)
65121
- Y.setFloat32(an + pi * 2 * Ui, ae(Ri[pi]), !0);
65131
+ Y.setFloat32(an + pi * 2 * Ni, ae(Ri[pi]), !0);
65122
65132
  }
65123
65133
  }
65124
65134
  }
@@ -65508,7 +65518,7 @@ class c0 extends Z2 {
65508
65518
  uncompress: null,
65509
65519
  getter: null,
65510
65520
  format: null,
65511
- colorSpace: Oi
65521
+ colorSpace: Li
65512
65522
  };
65513
65523
  switch (B.compression) {
65514
65524
  case "NO_COMPRESSION":
@@ -65573,7 +65583,7 @@ class c0 extends Z2 {
65573
65583
  console.error("THREE.EXRLoader: unsupported type: ", G);
65574
65584
  break;
65575
65585
  }
65576
- return V.bytesPerLine = V.width * V.inputSize * V.channels, V.outputChannels == 4 ? (V.format = tn, V.colorSpace = Oi) : (V.format = jg, V.colorSpace = fo), V;
65586
+ return V.bytesPerLine = V.width * V.inputSize * V.channels, V.outputChannels == 4 ? (V.format = tn, V.colorSpace = Li) : (V.format = jg, V.colorSpace = fo), V;
65577
65587
  }
65578
65588
  const Mo = new DataView(e), Uh = new Uint8Array(e), To = { value: 0 }, Nh = gn(Mo, e, To), Zt = Mn(Nh, Mo, Uh, To, this.type), Ry = { value: 0 }, C_ = { R: 0, G: 1, B: 2, A: 3, Y: 0 };
65579
65589
  for (let B = 0; B < Zt.height / Zt.scanlineBlockSize; B++) {
@@ -65758,7 +65768,7 @@ class _S extends Z2 {
65758
65768
  switch (o.type) {
65759
65769
  case Hn:
65760
65770
  case ds:
65761
- o.colorSpace = Oi, o.minFilter = Dt, o.magFilter = Dt, o.generateMipmaps = !1, o.flipY = !0;
65771
+ o.colorSpace = Li, o.minFilter = Dt, o.magFilter = Dt, o.generateMipmaps = !1, o.flipY = !0;
65762
65772
  break;
65763
65773
  }
65764
65774
  t && t(o, a);
@@ -65813,7 +65823,7 @@ class tue {
65813
65823
  }
65814
65824
  resolveTexture(e, t) {
65815
65825
  const i = t;
65816
- uA && console.log("Lightmap loaded:", i), i != null && i.isTexture && (this.registry ? (i.colorSpace = Oi, this.registry.registerTexture(this.source, e.type, i, e.index)) : console.log(Bu[e.type], e.pointer, i));
65826
+ uA && console.log("Lightmap loaded:", i), i != null && i.isTexture && (this.registry ? (i.colorSpace = Li, this.registry.registerTexture(this.source, e.type, i, e.index)) : console.log(Bu[e.type], e.pointer, i));
65817
65827
  }
65818
65828
  }
65819
65829
  const WN = !!ie("debuglightmaps");
@@ -65947,7 +65957,7 @@ TEX ` + i.texture_lod;
65947
65957
  ` + (n.lastScreenCoverage * 100).toFixed(1) + `% cov
65948
65958
  ` + (n.lastCentrality * 100).toFixed(1) + `% centr
65949
65959
  ` + (px.min.x.toFixed(2) + "-" + px.max.x.toFixed(2) + "x" + px.min.y.toFixed(2) + "-" + px.max.y.toFixed(2)) + " scr"), n.lastScreenCoverage > 0.1) {
65950
- const v = e, b = v.worldForward, S = v.worldPosition, M = Gi(b).multiplyScalar(f * 0.7).add(u), T = M.distanceTo(S), P = p[Math.min(p.length - 1, Math.max(0, r))] + "88", C = this.context.domHeight > 0 ? screen.height / this.context.domHeight : 1, I = e.isPerspectiveCamera ? Math.tan(e.fov * Math.PI / 180 / 2) : 1;
65960
+ const v = e, b = v.worldForward, S = v.worldPosition, M = Oi(b).multiplyScalar(f * 0.7).add(u), T = M.distanceTo(S), P = p[Math.min(p.length - 1, Math.max(0, r))] + "88", C = this.context.domHeight > 0 ? screen.height / this.context.domHeight : 1, I = e.isPerspectiveCamera ? Math.tan(e.fov * Math.PI / 180 / 2) : 1;
65951
65961
  _t.DrawLabel(M, _, T * 0.012 * C * I, void 0, 16777215, P);
65952
65962
  }
65953
65963
  }
@@ -66912,7 +66922,7 @@ class bue {
66912
66922
  this.createButtonFromHTMLNode(l);
66913
66923
  }), a.removedNodes.forEach((l) => {
66914
66924
  const c = l, h = this.htmlButtonsMap.get(c);
66915
- h && (this.htmlButtonsMap.delete(c), h.remove(), zi.update());
66925
+ h && (this.htmlButtonsMap.delete(c), h.remove(), Gi.update());
66916
66926
  }));
66917
66927
  }).observe(i, { childList: !0 }) : console.error("Could not find options container in needle menu");
66918
66928
  }
@@ -66968,7 +66978,7 @@ class bue {
66968
66978
  const y = 5;
66969
66979
  (r = this.menu) == null || r.quaternion.slerp(this._menuTarget.quaternion, this._context.time.deltaTime * y), (o = this.menu) == null || o.scale.setScalar(n);
66970
66980
  }
66971
- this.uiisDirty && (this.uiisDirty = !1, zi.update());
66981
+ this.uiisDirty && (this.uiisDirty = !1, Gi.update());
66972
66982
  }
66973
66983
  ensureRenderOnTop(e, t = 0) {
66974
66984
  e instanceof fe && (e.material.depthTest = !1, e.material.depthWrite = !1), e.renderOrder = 1e3 + t * 2;
@@ -66978,7 +66988,7 @@ class bue {
66978
66988
  getMenu() {
66979
66989
  if (this.menu)
66980
66990
  return this.menu;
66981
- this.ensureFont(), this.menu = new zi.Block({
66991
+ this.ensureFont(), this.menu = new Gi.Block({
66982
66992
  boxSizing: "border-box",
66983
66993
  fontFamily: this.familyName,
66984
66994
  height: "auto",
@@ -67002,7 +67012,7 @@ class bue {
67002
67012
  handleNeedleWatermark() {
67003
67013
  var e;
67004
67014
  if (!this._poweredByNeedleElement) {
67005
- this._poweredByNeedleElement = new zi.Block({
67015
+ this._poweredByNeedleElement = new Gi.Block({
67006
67016
  width: "auto",
67007
67017
  height: "auto",
67008
67018
  fontSize: 0.05,
@@ -67018,11 +67028,11 @@ class bue {
67018
67028
  }), this._poweredByNeedleElement["needle:use_eventsystem"] = !0;
67019
67029
  const t = new $N(this._context, () => globalThis.open("https://needle.tools", "_self"));
67020
67030
  fg(this._poweredByNeedleElement, t);
67021
- const i = new zi.Text({
67031
+ const i = new Gi.Text({
67022
67032
  textContent: "Powered by",
67023
67033
  width: "auto",
67024
67034
  height: "auto"
67025
- }), n = new zi.Text({
67035
+ }), n = new Gi.Text({
67026
67036
  textContent: "needle",
67027
67037
  width: "auto",
67028
67038
  height: "auto",
@@ -67053,9 +67063,9 @@ class bue {
67053
67063
  }
67054
67064
  }
67055
67065
  ensureFont() {
67056
- let e = zi.FontLibrary.getFontFamily(this.familyName);
67066
+ let e = Gi.FontLibrary.getFontFamily(this.familyName);
67057
67067
  if (!e) {
67058
- e = zi.FontLibrary.addFontFamily(this.familyName);
67068
+ e = Gi.FontLibrary.addFontFamily(this.familyName);
67059
67069
  const t = e.addVariant("normal", "normal", "./include/needle/arial-msdf.json", "./include/needle/arial.png");
67060
67070
  t == null || t.addEventListener("ready", () => {
67061
67071
  this.markDirty();
@@ -67063,7 +67073,7 @@ class bue {
67063
67073
  }
67064
67074
  }
67065
67075
  createButton(e, t) {
67066
- const i = new zi.Block({
67076
+ const i = new Gi.Block({
67067
67077
  width: "auto",
67068
67078
  height: "auto",
67069
67079
  whiteSpace: "pre-wrap",
@@ -67077,7 +67087,7 @@ class bue {
67077
67087
  borderRadius: 0.02,
67078
67088
  cursor: "pointer",
67079
67089
  fontSize: 0.05
67080
- }), n = new zi.Text({
67090
+ }), n = new Gi.Text({
67081
67091
  textContent: "",
67082
67092
  width: "auto",
67083
67093
  justifyContent: "center",
@@ -67130,7 +67140,7 @@ class xue {
67130
67140
  if (!this.spatialIcon) {
67131
67141
  const n = await ZN(e);
67132
67142
  if (n && !this.spatialIcon) {
67133
- const o = new zi.Block({
67143
+ const o = new Gi.Block({
67134
67144
  width: 0.08,
67135
67145
  height: 0.08,
67136
67146
  backgroundColor: 16777215,
@@ -67179,10 +67189,10 @@ class $N {
67179
67189
  return this.gameObject;
67180
67190
  }
67181
67191
  onPointerEnter() {
67182
- this.context.input.setCursorPointer(), this.allowModifyUI && (this.element.set({ backgroundOpacity: 1 }), zi.update());
67192
+ this.context.input.setCursorPointer(), this.allowModifyUI && (this.element.set({ backgroundOpacity: 1 }), Gi.update());
67183
67193
  }
67184
67194
  onPointerExit() {
67185
- this.context.input.setCursorNormal(), this.allowModifyUI && (this.element.set({ backgroundOpacity: 0 }), zi.update());
67195
+ this.context.input.setCursorNormal(), this.allowModifyUI && (this.element.set({ backgroundOpacity: 0 }), Gi.update());
67186
67196
  }
67187
67197
  onPointerDown(e) {
67188
67198
  e.use();
@@ -69083,7 +69093,7 @@ Object.getOwnPropertyDescriptor(Ae.prototype, "worldPosition") || Object.defineP
69083
69093
  });
69084
69094
  Object.getOwnPropertyDescriptor(Ae.prototype, "worldQuaternion") || Object.defineProperty(Ae.prototype, "worldQuaternion", {
69085
69095
  get: function() {
69086
- return this instanceof iD ? Fi(this.object) : Fi(this);
69096
+ return this instanceof iD ? Ui(this.object) : Ui(this);
69087
69097
  },
69088
69098
  set: function(s) {
69089
69099
  ll(this, s);
@@ -69107,17 +69117,17 @@ Object.getOwnPropertyDescriptor(Ae.prototype, "worldScale") || Object.defineProp
69107
69117
  });
69108
69118
  Object.getOwnPropertyDescriptor(Ae.prototype, "worldForward") || Object.defineProperty(Ae.prototype, "worldForward", {
69109
69119
  get: function() {
69110
- return Gi().set(0, 0, 1).applyQuaternion(Fi(this));
69120
+ return Oi().set(0, 0, 1).applyQuaternion(Ui(this));
69111
69121
  }
69112
69122
  });
69113
69123
  Object.getOwnPropertyDescriptor(Ae.prototype, "worldRight") || Object.defineProperty(Ae.prototype, "worldRight", {
69114
69124
  get: function() {
69115
- return Gi().set(1, 0, 0).applyQuaternion(Fi(this));
69125
+ return Oi().set(1, 0, 0).applyQuaternion(Ui(this));
69116
69126
  }
69117
69127
  });
69118
69128
  Object.getOwnPropertyDescriptor(Ae.prototype, "worldUp") || Object.defineProperty(Ae.prototype, "worldUp", {
69119
69129
  get: function() {
69120
- return Gi().set(0, 1, 0).applyQuaternion(Fi(this));
69130
+ return Oi().set(0, 1, 0).applyQuaternion(Ui(this));
69121
69131
  }
69122
69132
  });
69123
69133
  Vue(Ae);
@@ -69665,7 +69675,7 @@ let Re = (Yl = class {
69665
69675
  Rg(this.gameObject, e, t, i);
69666
69676
  }
69667
69677
  get worldQuaternion() {
69668
- return Fi(this.gameObject);
69678
+ return Ui(this.gameObject);
69669
69679
  }
69670
69680
  set worldQuaternion(e) {
69671
69681
  ll(this.gameObject, e);
@@ -70416,7 +70426,7 @@ class ude extends vl {
70416
70426
  onDeserialize(e, t) {
70417
70427
  if (e instanceof Vt && t.type === Mf) {
70418
70428
  const i = e, n = new Mf(i.image.width, i.image.height, {
70419
- colorSpace: Oi
70429
+ colorSpace: Li
70420
70430
  });
70421
70431
  return n.texture = i, i.isRenderTargetTexture = !0, i.flipY = !0, i.offset.y = 1, i.repeat.y = -1, i.needsUpdate = !0, i.mipmaps = [], i instanceof ku && (i.isCompressedTexture = !1, i.format = RGBAFormat), n;
70422
70432
  }
@@ -74788,7 +74798,7 @@ class Ia {
74788
74798
  let h = o.exitTime;
74789
74799
  i.timeScale < 0 && (h = 1 - h);
74790
74800
  let u = !1;
74791
- if (o.hasExitTime ? u = c >= h : u = !0, u) {
74801
+ if (o.hasExitTime ? i.timeScale > 0 ? u = c >= o.exitTime : i.timeScale < 0 && (u = 1 - c >= o.exitTime) : u = !0, u) {
74792
74802
  for (const f of o.conditions) {
74793
74803
  const p = this.model.parameters.find((m) => m.name === f.parameter);
74794
74804
  (p == null ? void 0 : p.type) === MQ.Trigger && p.value && (p.value = !1);
@@ -77353,7 +77363,7 @@ const LQ = (wI = class extends Re {
77353
77363
  if (r.length() < 0.1)
77354
77364
  return;
77355
77365
  const o = LQ.forward;
77356
- if (o.set(0, 0, 1), o.applyQuaternion(Fi(this.head)), o.dot(r) > 0.45)
77366
+ if (o.set(0, 0, 1), o.applyQuaternion(Ui(this.head)), o.dot(r) > 0.45)
77357
77367
  for (let l = 0; l < t.length; l++)
77358
77368
  t[l].lookAt(this.currentTargetPoint);
77359
77369
  }
@@ -78377,7 +78387,7 @@ const HA = (CI = class extends dl {
78377
78387
  e = HA.textureCache.get(e);
78378
78388
  else if (!e.isRenderTargetTexture) {
78379
78389
  const t = e.clone();
78380
- t.colorSpace = Oi, HA.textureCache.set(e, t), e = t;
78390
+ t.colorSpace = Li, HA.textureCache.set(e, t), e = t;
78381
78391
  }
78382
78392
  this.setOptions({ backgroundImage: e, borderRadius: 0, backgroundOpacity: this.color.alpha, backgroundSize: "stretch" }), Ai.assignTextureLOD(e, 0).then((t) => {
78383
78393
  t instanceof Vt && (e && HA.textureCache.set(e, t), this.setOptions({ backgroundImage: t }), this.markDirty());
@@ -79177,7 +79187,7 @@ class dy extends Re {
79177
79187
  *moveToTarget() {
79178
79188
  if (!this.target || !this.object)
79179
79189
  return;
79180
- const t = Gt(this.object).clone(), i = Gt(this.target).clone(), n = Fi(this.object).clone(), r = Fi(this.target).clone(), o = en(this.object).clone(), a = en(this.target).clone(), l = t.distanceTo(i), c = n.angleTo(r), h = o.distanceTo(a);
79190
+ const t = Gt(this.object).clone(), i = Gt(this.target).clone(), n = Ui(this.object).clone(), r = Ui(this.target).clone(), o = en(this.object).clone(), a = en(this.target).clone(), l = t.distanceTo(i), c = n.angleTo(r), h = o.distanceTo(a);
79181
79191
  if (l < 0.01 && c < 0.01 && h < 0.01) {
79182
79192
  $s(this.object, i), ll(this.object, r), Jv(this.object, a), this.coroutine = null;
79183
79193
  return;
@@ -81034,7 +81044,7 @@ class tme {
81034
81044
  const M = E.substring(10), T = Number.parseInt(M);
81035
81045
  if (T >= 0) {
81036
81046
  const P = await this.parser.getDependency("texture", T);
81037
- P instanceof Vt && (P.colorSpace = Oi, P.needsUpdate = !0), u[S] = { value: P };
81047
+ P instanceof Vt && (P.colorSpace = Li, P.needsUpdate = !0), u[S] = { value: P };
81038
81048
  continue;
81039
81049
  }
81040
81050
  }
@@ -81973,7 +81983,7 @@ const kw = class extends Re {
81973
81983
  if (this.gameObject) {
81974
81984
  if (this._probeAnchorLastFrame !== this.probeAnchor && ((e = this._reflectionProbe) == null || e.onUnset(this), this.updateReflectionProbe()), VA == this.name && this.gameObject instanceof fe) {
81975
81985
  this.gameObject.geometry.computeBoundingSphere();
81976
- const n = Gi(this.gameObject.geometry.boundingSphere.center).applyMatrix4(this.gameObject.matrixWorld);
81986
+ const n = Oi(this.gameObject.geometry.boundingSphere.center).applyMatrix4(this.gameObject.matrixWorld);
81977
81987
  _t.DrawWireSphere(n, this.gameObject.geometry.boundingSphere.radius, 56831);
81978
81988
  }
81979
81989
  if (this.isMultiMaterialObject(this.gameObject) && ((t = this.gameObject.children) == null ? void 0 : t.length) > 0)
@@ -82088,7 +82098,7 @@ class c6 extends O1 {
82088
82098
  if (E3) {
82089
82099
  for (const t of this.sharedMeshes)
82090
82100
  if (t instanceof go && t.boundingSphere) {
82091
- const i = Gi(t.boundingSphere.center).applyMatrix4(t.matrixWorld);
82101
+ const i = Oi(t.boundingSphere.center).applyMatrix4(t.matrixWorld);
82092
82102
  _t.DrawWireSphere(i, t.boundingSphere.radius, "red");
82093
82103
  }
82094
82104
  }
@@ -82645,9 +82655,9 @@ const QA = ($x = class {
82645
82655
  {
82646
82656
  const l = a.index;
82647
82657
  if (l) {
82648
- const c = s.mesh_normal, h = l.getX(c * 3), u = l.getX(c * 3 + 1), f = l.getX(c * 3 + 2), p = a.getAttribute("position"), m = Gi(), y = Gi(), g = Gi();
82658
+ const c = s.mesh_normal, h = l.getX(c * 3), u = l.getX(c * 3 + 1), f = l.getX(c * 3 + 2), p = a.getAttribute("position"), m = Oi(), y = Oi(), g = Oi();
82649
82659
  m.fromBufferAttribute(p, h), y.fromBufferAttribute(p, u), g.fromBufferAttribute(p, f), m.sub(y), g.sub(y), m.cross(g), this._dir.copy(m).multiplyScalar(-1);
82650
- const A = Fi(o);
82660
+ const A = Ui(o);
82651
82661
  this._dir.applyQuaternion(A);
82652
82662
  }
82653
82663
  }
@@ -82767,7 +82777,7 @@ oe([
82767
82777
  oe([
82768
82778
  x(O1)
82769
82779
  ], Ln.prototype, "meshRenderer", 2);
82770
- class Li {
82780
+ class ki {
82771
82781
  constructor() {
82772
82782
  d(this, "damping");
82773
82783
  d(this, "enabled");
@@ -82816,82 +82826,82 @@ class Li {
82816
82826
  }
82817
82827
  oe([
82818
82828
  x()
82819
- ], Li.prototype, "damping", 2);
82829
+ ], ki.prototype, "damping", 2);
82820
82830
  oe([
82821
82831
  x()
82822
- ], Li.prototype, "enabled", 2);
82832
+ ], ki.prototype, "enabled", 2);
82823
82833
  oe([
82824
82834
  x()
82825
- ], Li.prototype, "frequency", 2);
82835
+ ], ki.prototype, "frequency", 2);
82826
82836
  oe([
82827
82837
  x()
82828
- ], Li.prototype, "octaveCount", 2);
82838
+ ], ki.prototype, "octaveCount", 2);
82829
82839
  oe([
82830
82840
  x()
82831
- ], Li.prototype, "octaveMultiplier", 2);
82841
+ ], ki.prototype, "octaveMultiplier", 2);
82832
82842
  oe([
82833
82843
  x()
82834
- ], Li.prototype, "octaveScale", 2);
82844
+ ], ki.prototype, "octaveScale", 2);
82835
82845
  oe([
82836
82846
  x(At)
82837
- ], Li.prototype, "positionAmount", 2);
82847
+ ], ki.prototype, "positionAmount", 2);
82838
82848
  oe([
82839
82849
  x()
82840
- ], Li.prototype, "quality", 2);
82850
+ ], ki.prototype, "quality", 2);
82841
82851
  oe([
82842
82852
  x(At)
82843
- ], Li.prototype, "remap", 2);
82853
+ ], ki.prototype, "remap", 2);
82844
82854
  oe([
82845
82855
  x()
82846
- ], Li.prototype, "remapEnabled", 2);
82856
+ ], ki.prototype, "remapEnabled", 2);
82847
82857
  oe([
82848
82858
  x()
82849
- ], Li.prototype, "remapMultiplier", 2);
82859
+ ], ki.prototype, "remapMultiplier", 2);
82850
82860
  oe([
82851
82861
  x(At)
82852
- ], Li.prototype, "remapX", 2);
82862
+ ], ki.prototype, "remapX", 2);
82853
82863
  oe([
82854
82864
  x()
82855
- ], Li.prototype, "remapXMultiplier", 2);
82865
+ ], ki.prototype, "remapXMultiplier", 2);
82856
82866
  oe([
82857
82867
  x(At)
82858
- ], Li.prototype, "remapY", 2);
82868
+ ], ki.prototype, "remapY", 2);
82859
82869
  oe([
82860
82870
  x()
82861
- ], Li.prototype, "remapYMultiplier", 2);
82871
+ ], ki.prototype, "remapYMultiplier", 2);
82862
82872
  oe([
82863
82873
  x(At)
82864
- ], Li.prototype, "remapZ", 2);
82874
+ ], ki.prototype, "remapZ", 2);
82865
82875
  oe([
82866
82876
  x()
82867
- ], Li.prototype, "remapZMultiplier", 2);
82877
+ ], ki.prototype, "remapZMultiplier", 2);
82868
82878
  oe([
82869
82879
  x()
82870
- ], Li.prototype, "scrollSpeedMultiplier", 2);
82880
+ ], ki.prototype, "scrollSpeedMultiplier", 2);
82871
82881
  oe([
82872
82882
  x()
82873
- ], Li.prototype, "separateAxes", 2);
82883
+ ], ki.prototype, "separateAxes", 2);
82874
82884
  oe([
82875
82885
  x()
82876
- ], Li.prototype, "strengthMultiplier", 2);
82886
+ ], ki.prototype, "strengthMultiplier", 2);
82877
82887
  oe([
82878
82888
  x(At)
82879
- ], Li.prototype, "strengthX", 2);
82889
+ ], ki.prototype, "strengthX", 2);
82880
82890
  oe([
82881
82891
  x()
82882
- ], Li.prototype, "strengthXMultiplier", 2);
82892
+ ], ki.prototype, "strengthXMultiplier", 2);
82883
82893
  oe([
82884
82894
  x(At)
82885
- ], Li.prototype, "strengthY", 2);
82895
+ ], ki.prototype, "strengthY", 2);
82886
82896
  oe([
82887
82897
  x()
82888
- ], Li.prototype, "strengthYMultiplier", 2);
82898
+ ], ki.prototype, "strengthYMultiplier", 2);
82889
82899
  oe([
82890
82900
  x(At)
82891
- ], Li.prototype, "strengthZ", 2);
82901
+ ], ki.prototype, "strengthZ", 2);
82892
82902
  oe([
82893
82903
  x()
82894
- ], Li.prototype, "strengthZMultiplier", 2);
82904
+ ], ki.prototype, "strengthZMultiplier", 2);
82895
82905
  class Cn {
82896
82906
  constructor() {
82897
82907
  d(this, "enabled");
@@ -85670,7 +85680,7 @@ class fl extends Re {
85670
85680
  d(this, "useTeleportTarget", !1);
85671
85681
  d(this, "useTeleportFade", !1);
85672
85682
  d(this, "showRays", !0);
85673
- d(this, "showHits", !0);
85683
+ d(this, "showHits", !1);
85674
85684
  d(this, "isXRMovementHandler", !0);
85675
85685
  d(this, "xrSessionMode", "immersive-vr");
85676
85686
  d(this, "_didApplyRotation", !1);
@@ -85768,12 +85778,12 @@ class fl extends Re {
85768
85778
  let o = this._hitDiscs[i];
85769
85779
  if (o && (o.hit = r), r) {
85770
85780
  const a = t.rigScale ?? 1;
85771
- L3 && (_t.DrawWireSphere(r.point, 0.025 * a, 16711680), _t.DrawLabel(Gi(0, 0.2, 0).add(r.point), r.object.name, 0.02, 0)), o || (o = this.createHitPointObject(), this._hitDiscs[i] = o), o.visible = !0;
85781
+ L3 && (_t.DrawWireSphere(r.point, 0.025 * a, 16711680), _t.DrawLabel(Oi(0, 0.2, 0).add(r.point), r.object.name, 0.02, 0)), o || (o = this.createHitPointObject(), this._hitDiscs[i] = o), o.visible = !0;
85772
85782
  const l = 0.01 * (a + r.distance);
85773
85783
  if (o.scale.set(l, l, l), o.layers.disableAll(), o.layers.enable(2), o.hit = r, r.normal) {
85774
85784
  const c = 0.02 * a;
85775
85785
  o.position.set(0, 0, -0.1 * c).applyQuaternion(n.rayWorldQuaternion), o.position.add(r.point);
85776
- const h = r.normal.applyQuaternion(Fi(r.object));
85786
+ const h = r.normal.applyQuaternion(Ui(r.object));
85777
85787
  o.quaternion.setFromUnitVectors(Wme, h);
85778
85788
  } else
85779
85789
  o.position.add(r.point);
@@ -87561,16 +87571,16 @@ class gge {
87561
87571
  if (A.length > 0) {
87562
87572
  const _ = A[0];
87563
87573
  if (this._draggedOverObject === _.object ? this._draggedOverObjectDuration += this.context.time.deltaTime : (this._draggedOverObject = _.object, this._draggedOverObjectDuration = 0), _.face) {
87564
- const b = this._draggedOverObjectDuration >= 0.15;
87565
- if (b && (this._draggedOverObjectLastSetUp !== this._draggedOverObject || this._draggedOverObjectLastNormal.dot(_.face.normal) < 0.999999 || this.context.time.frame % 60 === 0)) {
87574
+ const b = this._draggedOverObjectDuration >= 0.15, S = 1e-3, E = this._totalMovement.length() >= S;
87575
+ if ((b || E) && (this._draggedOverObjectLastSetUp !== this._draggedOverObject || this._draggedOverObjectLastNormal.dot(_.face.normal) < 0.999999 || this.context.time.frame % 60 === 0)) {
87566
87576
  this._draggedOverObjectLastSetUp = this._draggedOverObject, this._draggedOverObjectLastNormal.copy(_.face.normal);
87567
- const S = Gi(), E = Gi();
87568
- this._bounds.getCenter(S), this._bounds.getSize(E), S.sub(E.multiplyScalar(0.5).multiply(_.face.normal)), this._hitPointInLocalSpace.copy(S), this._hitNormalInLocalSpace.copy(_.face.normal), this._bounds.getCenter(S), this._bounds.getSize(E), S.add(E.multiplyScalar(0.5).multiply(_.face.normal));
87569
- const M = Gi(this._hitPointInLocalSpace).add(S);
87570
- this._followObject.localToWorld(M);
87571
- const T = _.point;
87572
- this._dragPlane.setFromNormalAndCoplanarPoint(_.face.normal, T);
87573
- } else if (!b)
87577
+ const M = Oi(), T = Oi();
87578
+ this._bounds.getCenter(M), this._bounds.getSize(T), M.sub(T.multiplyScalar(0.5).multiply(_.face.normal)), this._hitPointInLocalSpace.copy(M), this._hitNormalInLocalSpace.copy(_.face.normal), this._bounds.getCenter(M), this._bounds.getSize(T), M.add(T.multiplyScalar(0.5).multiply(_.face.normal));
87579
+ const P = Oi(this._hitPointInLocalSpace).add(M);
87580
+ this._followObject.localToWorld(P);
87581
+ const C = _.point;
87582
+ this._dragPlane.setFromNormalAndCoplanarPoint(_.face.normal, C);
87583
+ } else if (!(b || E))
87574
87584
  return;
87575
87585
  }
87576
87586
  }
@@ -87689,14 +87699,14 @@ const VO = class {
87689
87699
  onUpdateGroundPlane() {
87690
87700
  if (!this._selected || !this._context)
87691
87701
  return;
87692
- const e = Gt(this._selected), t = new xo(Gi(0, 0.1, 0).add(e), Gi(0, -1, 0)), i = new uc();
87702
+ const e = Gt(this._selected), t = new xo(Oi(0, 0.1, 0).add(e), Oi(0, -1, 0)), i = new uc();
87693
87703
  i.testObject = (r) => r !== this._selected;
87694
87704
  const n = this._context.physics.raycastFromRay(t, i);
87695
87705
  for (let r = 0; r < n.length; r++) {
87696
87706
  const o = n[r];
87697
87707
  if (!o.face || this.contains(this._selected, o.object))
87698
87708
  continue;
87699
- const a = Gi(0, 1, 0);
87709
+ const a = Oi(0, 1, 0);
87700
87710
  this._groundPlane.setFromNormalAndCoplanarPoint(a, o.point);
87701
87711
  break;
87702
87712
  }
@@ -90683,7 +90693,7 @@ class Sy extends Re {
90683
90693
  update() {
90684
90694
  if (!this.from)
90685
90695
  return;
90686
- var t = Gt(this.from), i = Fi(this.from);
90696
+ var t = Gt(this.from), i = Ui(this.from);
90687
90697
  this.offset.copy(this.positionOffset);
90688
90698
  const n = this.offset.length();
90689
90699
  if (this.referenceSpace && this.offset.transformDirection(this.referenceSpace.matrixWorld).multiplyScalar(n), t.add(this.offset), this.levelPosition && this.referenceSpace) {
@@ -95718,7 +95728,7 @@ class hve {
95718
95728
  const t = e.map;
95719
95729
  if (this.clonedTexture.original !== t || !this.clonedTexture.clone) {
95720
95730
  const i = t.clone();
95721
- i.premultiplyAlpha = !1, i.colorSpace = Oi, this.clonedTexture.original = t, this.clonedTexture.clone = i;
95731
+ i.premultiplyAlpha = !1, i.colorSpace = Li, this.clonedTexture.original = t, this.clonedTexture.clone = i;
95722
95732
  }
95723
95733
  return this.clonedTexture.clone;
95724
95734
  }
@@ -96034,7 +96044,7 @@ const Uw = class extends Re {
96034
96044
  this._cameraScale = a.x;
96035
96045
  }
96036
96046
  const i = !this.worldspace, n = this.gameObject;
96037
- if (Fi(n, this.__worldQuaternion), this._worldQuaternionInverted.copy(this.__worldQuaternion).invert(), en(this.gameObject, this._worldScale), i && this._container && ((r = this.gameObject) != null && r.parent)) {
96047
+ if (Ui(n, this.__worldQuaternion), this._worldQuaternionInverted.copy(this.__worldQuaternion).invert(), en(this.gameObject, this._worldScale), i && this._container && ((r = this.gameObject) != null && r.parent)) {
96038
96048
  const a = L6(this, $P);
96039
96049
  this._container.matrix.makeScale(a.x, a.y, a.z), this._container.matrix.makeRotationFromQuaternion(this.__worldQuaternion), this._container.matrix.setPosition(this.worldPos), this._container.matrix.scale(this.gameObject.scale);
96040
96050
  }
@@ -96072,7 +96082,7 @@ En([
96072
96082
  x(Ln)
96073
96083
  ], As.prototype, "shape", 2);
96074
96084
  En([
96075
- x(Li)
96085
+ x(ki)
96076
96086
  ], As.prototype, "noise", 2);
96077
96087
  En([
96078
96088
  x(Cn)
@@ -98147,7 +98157,10 @@ class so extends Re {
98147
98157
  }
98148
98158
  /** @internal */
98149
98159
  awake() {
98150
- this.scenes === void 0 && (this.scenes = []), Uo && console.log("SceneSwitcher", this);
98160
+ this.scenes === void 0 && (this.scenes = []);
98161
+ for (const t of this.scenes)
98162
+ t && !t.hasUrl && t.asset instanceof Ae && t.asset.removeFromParent();
98163
+ Uo && console.log("SceneSwitcher", this);
98151
98164
  }
98152
98165
  /** @internal */
98153
98166
  async onEnable() {
@@ -98271,7 +98284,7 @@ class so extends Re {
98271
98284
  const a = o.sceneClosing();
98272
98285
  a instanceof Promise && await a;
98273
98286
  }
98274
- this._currentScene.unload();
98287
+ this._currentScene.hasUrl ? this._currentScene.unload() : this._currentScene.asset instanceof Ae && this._currentScene.asset.removeFromParent();
98275
98288
  }
98276
98289
  this._currentScene = void 0;
98277
98290
  const i = this._currentIndex = ((n = this.scenes) == null ? void 0 : n.indexOf(t)) ?? -1;
@@ -99633,7 +99646,7 @@ const q6 = (TI = class extends Re {
99633
99646
  this.positionAxes & zA.X && (n.x = nt.lerp(n.x, t.x, i)), this.positionAxes & zA.Y && (n.y = nt.lerp(n.y, t.y, i)), this.positionAxes & zA.Z && (n.z = nt.lerp(n.z, t.z, i)), this.worldPosition = n;
99634
99647
  }
99635
99648
  if (this.rotateFactor > 0) {
99636
- const t = Fi(this.target);
99649
+ const t = Ui(this.target);
99637
99650
  this.flipForward && t.premultiply(q6._invertForward);
99638
99651
  const i = this._firstUpdate || e ? 1 : nt.clamp01(this.context.time.deltaTime * this.rotateFactor);
99639
99652
  this.worldQuaternion = this.worldQuaternion.slerp(t, i);
@@ -100492,7 +100505,7 @@ const i2 = (RI = class extends Re {
100492
100505
  if (!this.context.connection.isConnected || this.context.connection.connectionId === null)
100493
100506
  return;
100494
100507
  this._model === null && (this._model = new A0e(this.context.connection.connectionId, this.context.connection.connectionId + "_camera"));
100495
- const t = Gt(e), i = Fi(e);
100508
+ const t = Gt(e), i = Ui(e);
100496
100509
  (t.distanceTo(this._lastWorldPosition) > 1e-3 || i.angleTo(this._lastWorldQuaternion) > 0.01) && (this._needsUpdate = !0), this._lastWorldPosition.copy(t), this._lastWorldQuaternion.copy(i), !((!this._needsUpdate || this.context.time.frameCount % 2 !== 0) && !(this.context.time.realtimeSinceStartup - this._lastUpdateTime > this._camTimeoutInSeconds * 0.5)) && (this._lastUpdateTime = this.context.time.realtimeSinceStartup, this._needsUpdate = !1, this._model.send(e, this.context.connection), this.context.isInXR || this.context.players.setPlayerView(this.context.connection.connectionId, e, Ef.Browser));
100497
100510
  }
100498
100511
  onReceivedRemoteCameraInfoBin(e) {
@@ -101840,7 +101853,7 @@ class cE extends Re {
101840
101853
  this.controlVisibility && (this.gameObject.visible = !1);
101841
101854
  return;
101842
101855
  }
101843
- this.controlVisibility && (this.gameObject.visible = !0), this.useGripSpace || i.targetRayMode === "transient-pointer" ? (this.gameObject.worldPosition = i.gripWorldPosition, this.gameObject.worldQuaternion = i.gripWorldQuaternion) : (this.gameObject.worldPosition = i.rayWorldPosition, this.gameObject.worldQuaternion = i.rayWorldQuaternion);
101856
+ this.controlVisibility && (this.gameObject.visible = !0), this.useGripSpace || i.targetRayMode === "transient-pointer" ? (this.gameObject.worldPosition = i.gripWorldPosition, this.gameObject.worldQuaternion = i.gripWorldQuaternion, this.gameObject.worldScale = Oi(i.xr.rigScale, i.xr.rigScale, i.xr.rigScale)) : (this.gameObject.worldPosition = i.rayWorldPosition, this.gameObject.worldQuaternion = i.rayWorldQuaternion, this.gameObject.worldScale = Oi(i.xr.rigScale, i.xr.rigScale, i.xr.rigScale));
101844
101857
  }
101845
101858
  }
101846
101859
  }
@@ -102007,7 +102020,7 @@ const X0e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
102007
102020
  NeedleMenu: Dh,
102008
102021
  NestedGltf: uO,
102009
102022
  Networking: p_,
102010
- NoiseModule: Li,
102023
+ NoiseModule: ki,
102011
102024
  ObjectRaycaster: Pa,
102012
102025
  OffsetConstraint: Sy,
102013
102026
  OpenURL: m_,
@@ -102234,7 +102247,7 @@ J.add("MinMaxGradient", ea);
102234
102247
  J.add("NeedleMenu", Dh);
102235
102248
  J.add("NestedGltf", uO);
102236
102249
  J.add("Networking", p_);
102237
- J.add("NoiseModule", Li);
102250
+ J.add("NoiseModule", ki);
102238
102251
  J.add("ObjectRaycaster", Pa);
102239
102252
  J.add("OffsetConstraint", Sy);
102240
102253
  J.add("OpenURL", m_);
@@ -105235,7 +105248,7 @@ const Iv = class {
105235
105248
  throw new Error("Physics world not initialized");
105236
105249
  const i = this._tempMatrix;
105237
105250
  let n;
105238
- e.attachedRigidbody ? n = this.getRigidbody(e, this._tempMatrix) : (js && console.log("Create collider without rigidbody", e.name), i.makeRotationFromQuaternion(Fi(e.gameObject)), i.setPosition(Gt(e.gameObject))), i.decompose(this._tempPosition, this._tempQuaternion, this._tempScale), this.tryApplyCenter(e, this._tempPosition), t.setTranslation(this._tempPosition.x, this._tempPosition.y, this._tempPosition.z), t.setRotation(this._tempQuaternion), t.setSensor(e.isTrigger);
105251
+ e.attachedRigidbody ? n = this.getRigidbody(e, this._tempMatrix) : (js && console.log("Create collider without rigidbody", e.name), i.makeRotationFromQuaternion(Ui(e.gameObject)), i.setPosition(Gt(e.gameObject))), i.decompose(this._tempPosition, this._tempQuaternion, this._tempScale), this.tryApplyCenter(e, this._tempPosition), t.setTranslation(this._tempPosition.x, this._tempPosition.y, this._tempPosition.z), t.setRotation(this._tempQuaternion), t.setSensor(e.isTrigger);
105239
105252
  const r = e.sharedMaterial;
105240
105253
  if (r) {
105241
105254
  if (r.bounciness !== void 0 && t.setRestitution(r.bounciness), r.bounceCombine !== void 0)
@@ -105314,12 +105327,12 @@ Error:`, a), null;
105314
105327
  const r = n.isKinematic && !yI;
105315
105328
  js && console.log("Create rigidbody", r);
105316
105329
  const o = r ? zd.RigidBodyDesc.kinematicPositionBased() : zd.RigidBodyDesc.dynamic(), a = Gt(e.attachedRigidbody.gameObject);
105317
- o.setTranslation(a.x, a.y, a.z), o.setRotation(Fi(e.attachedRigidbody.gameObject)), o.centerOfMass = new zd.Vector3(n.centerOfMass.x, n.centerOfMass.y, n.centerOfMass.z), i = this.world.createRigidBody(o), this.bodies.push(i), this.objects.push(n);
105330
+ o.setTranslation(a.x, a.y, a.z), o.setRotation(Ui(e.attachedRigidbody.gameObject)), o.centerOfMass = new zd.Vector3(n.centerOfMass.x, n.centerOfMass.y, n.centerOfMass.z), i = this.world.createRigidBody(o), this.bodies.push(i), this.objects.push(n);
105318
105331
  }
105319
105332
  i[co] = n, n[Vr] = i, this.internalUpdateRigidbodyProperties(n, i), this.getRigidbodyRelativeMatrix(e.gameObject, n.gameObject, t), e[$z] = i;
105320
105333
  } else {
105321
105334
  const n = zd.RigidBodyDesc.kinematicPositionBased(), r = Gt(e.gameObject);
105322
- n.setTranslation(r.x, r.y, r.z), n.setRotation(Fi(e.gameObject)), i = this.world.createRigidBody(n), t.identity(), i[co] = null;
105335
+ n.setTranslation(r.x, r.y, r.z), n.setRotation(Ui(e.gameObject)), i = this.world.createRigidBody(n), t.identity(), i[co] = null;
105323
105336
  }
105324
105337
  return i;
105325
105338
  }
@@ -105424,7 +105437,7 @@ Error:`, a), null;
105424
105437
  }
105425
105438
  syncPhysicsBody(e, t, i, n) {
105426
105439
  if (t instanceof Kz) {
105427
- const r = Gt(e, this._tempPosition), o = Fi(e, this._tempQuaternion);
105440
+ const r = Gt(e, this._tempPosition), o = Ui(e, this._tempQuaternion);
105428
105441
  switch (t.bodyType()) {
105429
105442
  case Sv.Fixed:
105430
105443
  case Sv.KinematicPositionBased:
@@ -105436,7 +105449,7 @@ Error:`, a), null;
105436
105449
  break;
105437
105450
  }
105438
105451
  } else if (t instanceof Jz) {
105439
- const r = Gt(e, this._tempPosition), o = Fi(e, this._tempQuaternion), a = t[co];
105452
+ const r = Gt(e, this._tempPosition), o = Ui(e, this._tempQuaternion), a = t[co];
105440
105453
  if (this.tryApplyCenter(a, r), i) {
105441
105454
  const l = t.translation();
105442
105455
  (l.x !== r.x || l.y !== r.y || l.z !== r.z) && t.setTranslation(r);
@@ -105449,7 +105462,7 @@ Error:`, a), null;
105449
105462
  }
105450
105463
  tryApplyCenter(e, t) {
105451
105464
  const i = e.center;
105452
- i && e.gameObject && (i.x !== 0 || i.y !== 0 || i.z !== 0) && (this._tempCenterPos.x = -i.x, this._tempCenterPos.y = i.y, this._tempCenterPos.z = i.z, en(e.gameObject, this._tempCenterVec), this._tempCenterPos.multiply(this._tempCenterVec), e.attachedRigidbody ? this._tempCenterPos.applyQuaternion(e.gameObject.quaternion) : (Fi(e.gameObject, this._tempCenterQuaternion), this._tempCenterPos.applyQuaternion(this._tempCenterQuaternion)), t.x += this._tempCenterPos.x, t.y += this._tempCenterPos.y, t.z += this._tempCenterPos.z);
105465
+ i && e.gameObject && (i.x !== 0 || i.y !== 0 || i.z !== 0) && (this._tempCenterPos.x = -i.x, this._tempCenterPos.y = i.y, this._tempCenterPos.z = i.z, en(e.gameObject, this._tempCenterVec), this._tempCenterPos.multiply(this._tempCenterVec), e.attachedRigidbody ? this._tempCenterPos.applyQuaternion(e.gameObject.quaternion) : (Ui(e.gameObject, this._tempCenterQuaternion), this._tempCenterPos.applyQuaternion(this._tempCenterQuaternion)), t.x += this._tempCenterPos.x, t.y += this._tempCenterPos.y, t.z += this._tempCenterPos.z);
105453
105466
  }
105454
105467
  getRigidbodyRelativeMatrix(e, t, i, n) {
105455
105468
  if (n === void 0 && (n = Iv._matricesBuffer, n.length = 0), e === t) {
@@ -106112,10 +106125,10 @@ class G_e {
106112
106125
  return e !== void 0 && (this.tail = (this.tail + 1) % this.elements.length), e;
106113
106126
  }
106114
106127
  }
106115
- var ki;
106128
+ var Fi;
106116
106129
  (function(s) {
106117
106130
  s.open = "open", s.close = "close", s.error = "error", s.message = "message", s.retry = "retry", s.reconnect = "reconnect";
106118
- })(ki || (ki = {}));
106131
+ })(Fi || (Fi = {}));
106119
106132
  class Bj {
106120
106133
  /**
106121
106134
  * Creates a new websocket.
@@ -106126,7 +106139,7 @@ class Bj {
106126
106139
  */
106127
106140
  constructor(e, t, i) {
106128
106141
  var n, r, o, a, l, c, h, u, f, p, m, y, g, A, _;
106129
- this._closedByUser = !1, this.handleOpenEvent = (v) => this.handleEvent(ki.open, v), this.handleErrorEvent = (v) => this.handleEvent(ki.error, v), this.handleCloseEvent = (v) => this.handleEvent(ki.close, v), this.handleMessageEvent = (v) => this.handleEvent(ki.message, v), this._url = e, this._protocols = t, this._options = {
106142
+ this._closedByUser = !1, this.handleOpenEvent = (v) => this.handleEvent(Fi.open, v), this.handleErrorEvent = (v) => this.handleEvent(Fi.error, v), this.handleCloseEvent = (v) => this.handleEvent(Fi.close, v), this.handleMessageEvent = (v) => this.handleEvent(Fi.message, v), this._url = e, this._protocols = t, this._options = {
106130
106143
  buffer: i == null ? void 0 : i.buffer,
106131
106144
  retry: {
106132
106145
  maxRetries: (n = i == null ? void 0 : i.retry) === null || n === void 0 ? void 0 : n.maxRetries,
@@ -106311,13 +106324,13 @@ class Bj {
106311
106324
  * @return the created browser-native websocket which is also stored in the '_underlyingWebsocket' property.
106312
106325
  */
106313
106326
  tryConnect() {
106314
- return this._underlyingWebsocket = new WebSocket(this.url, this.protocols), this._underlyingWebsocket.addEventListener(ki.open, this.handleOpenEvent), this._underlyingWebsocket.addEventListener(ki.close, this.handleCloseEvent), this._underlyingWebsocket.addEventListener(ki.error, this.handleErrorEvent), this._underlyingWebsocket.addEventListener(ki.message, this.handleMessageEvent), this._underlyingWebsocket;
106327
+ return this._underlyingWebsocket = new WebSocket(this.url, this.protocols), this._underlyingWebsocket.addEventListener(Fi.open, this.handleOpenEvent), this._underlyingWebsocket.addEventListener(Fi.close, this.handleCloseEvent), this._underlyingWebsocket.addEventListener(Fi.error, this.handleErrorEvent), this._underlyingWebsocket.addEventListener(Fi.message, this.handleMessageEvent), this._underlyingWebsocket;
106315
106328
  }
106316
106329
  /**
106317
106330
  * Removes all event listeners from the browser-native websocket and closes it.
106318
106331
  */
106319
106332
  clearWebsocket() {
106320
- this._underlyingWebsocket.removeEventListener(ki.open, this.handleOpenEvent), this._underlyingWebsocket.removeEventListener(ki.close, this.handleCloseEvent), this._underlyingWebsocket.removeEventListener(ki.error, this.handleErrorEvent), this._underlyingWebsocket.removeEventListener(ki.message, this.handleMessageEvent), this._underlyingWebsocket.close();
106333
+ this._underlyingWebsocket.removeEventListener(Fi.open, this.handleOpenEvent), this._underlyingWebsocket.removeEventListener(Fi.close, this.handleCloseEvent), this._underlyingWebsocket.removeEventListener(Fi.error, this.handleErrorEvent), this._underlyingWebsocket.removeEventListener(Fi.message, this.handleMessageEvent), this._underlyingWebsocket.close();
106321
106334
  }
106322
106335
  /**
106323
106336
  * Dispatch an event to all listeners of the given event-type.
@@ -106339,22 +106352,22 @@ class Bj {
106339
106352
  */
106340
106353
  handleEvent(e, t) {
106341
106354
  switch (e) {
106342
- case ki.close:
106355
+ case Fi.close:
106343
106356
  this.dispatchEvent(e, t), this.scheduleConnectionRetryIfNeeded();
106344
106357
  break;
106345
- case ki.open:
106358
+ case Fi.open:
106346
106359
  if (this.backoff !== void 0 && this._lastConnection !== void 0) {
106347
106360
  const i = {
106348
106361
  retries: this.backoff.retries,
106349
106362
  lastConnection: new Date(this._lastConnection)
106350
- }, n = new CustomEvent(ki.reconnect, {
106363
+ }, n = new CustomEvent(Fi.reconnect, {
106351
106364
  detail: i
106352
106365
  });
106353
- this.dispatchEvent(ki.reconnect, n), this.backoff.reset();
106366
+ this.dispatchEvent(Fi.reconnect, n), this.backoff.reset();
106354
106367
  }
106355
106368
  this._lastConnection = /* @__PURE__ */ new Date(), this.dispatchEvent(e, t), this.sendBufferedData();
106356
106369
  break;
106357
- case ki.retry:
106370
+ case Fi.retry:
106358
106371
  this.dispatchEvent(e, t), this.clearWebsocket(), this.tryConnect();
106359
106372
  break;
106360
106373
  default:
@@ -106377,8 +106390,8 @@ class Bj {
106377
106390
  if (this.closedByUser || this.backoff === void 0)
106378
106391
  return;
106379
106392
  const e = (i) => {
106380
- const n = new CustomEvent(ki.retry, { detail: i });
106381
- this.handleEvent(ki.retry, n);
106393
+ const n = new CustomEvent(Fi.retry, { detail: i });
106394
+ this.handleEvent(Fi.retry, n);
106382
106395
  }, t = {
106383
106396
  backoff: this._options.retry.instantReconnect === !0 ? 0 : this.backoff.next(),
106384
106397
  retries: this._options.retry.instantReconnect === !0 ? 0 : this.backoff.retries,
@@ -106505,7 +106518,7 @@ class H_e {
106505
106518
  * @param options the listener options
106506
106519
  */
106507
106520
  onOpen(e, t) {
106508
- return this.addListener(ki.open, e, t), this;
106521
+ return this.addListener(Fi.open, e, t), this;
106509
106522
  }
106510
106523
  /**
106511
106524
  * Adds an 'close' event listener to the websocket. Subsequent calls to this method will add additional listeners that will be
@@ -106515,7 +106528,7 @@ class H_e {
106515
106528
  * @param options the listener options
106516
106529
  */
106517
106530
  onClose(e, t) {
106518
- return this.addListener(ki.close, e, t), this;
106531
+ return this.addListener(Fi.close, e, t), this;
106519
106532
  }
106520
106533
  /**
106521
106534
  * Adds an 'error' event listener to the websocket. Subsequent calls to this method will add additional listeners that will be
@@ -106525,7 +106538,7 @@ class H_e {
106525
106538
  * @param options the listener options
106526
106539
  */
106527
106540
  onError(e, t) {
106528
- return this.addListener(ki.error, e, t), this;
106541
+ return this.addListener(Fi.error, e, t), this;
106529
106542
  }
106530
106543
  /**
106531
106544
  * Adds an 'message' event listener to the websocket. Subsequent calls to this method will add additional listeners that will be
@@ -106535,7 +106548,7 @@ class H_e {
106535
106548
  * @param options the listener options
106536
106549
  */
106537
106550
  onMessage(e, t) {
106538
- return this.addListener(ki.message, e, t), this;
106551
+ return this.addListener(Fi.message, e, t), this;
106539
106552
  }
106540
106553
  /**
106541
106554
  * Adds an 'retry' event listener to the websocket. Subsequent calls to this method will add additional listeners that will be
@@ -106545,7 +106558,7 @@ class H_e {
106545
106558
  * @param options the listener options
106546
106559
  */
106547
106560
  onRetry(e, t) {
106548
- return this.addListener(ki.retry, e, t), this;
106561
+ return this.addListener(Fi.retry, e, t), this;
106549
106562
  }
106550
106563
  /**
106551
106564
  * Adds an 'reconnect' event listener to the websocket. Subsequent calls to this method will add additional listeners that will be
@@ -106555,7 +106568,7 @@ class H_e {
106555
106568
  * @param options the listener options
106556
106569
  */
106557
106570
  onReconnect(e, t) {
106558
- return this.addListener(ki.reconnect, e, t), this;
106571
+ return this.addListener(Fi.reconnect, e, t), this;
106559
106572
  }
106560
106573
  /**
106561
106574
  * Builds the websocket.
@@ -106598,7 +106611,7 @@ const V_e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
106598
106611
  Websocket: Bj,
106599
106612
  WebsocketBuilder: H_e,
106600
106613
  get WebsocketEvent() {
106601
- return ki;
106614
+ return Fi;
106602
106615
  }
106603
106616
  }, Symbol.toStringTag, { value: "Module" })), ha = {
106604
106617
  node: "node",
@@ -107124,7 +107137,7 @@ export {
107124
107137
  C1 as NetworkedStreams,
107125
107138
  p_ as Networking,
107126
107139
  Pue as NewInstanceModel,
107127
- Li as NoiseModule,
107140
+ ki as NoiseModule,
107128
107141
  Pa as ObjectRaycaster,
107129
107142
  l1 as ObjectUtils,
107130
107143
  Sy as OffsetConstraint,
@@ -107366,12 +107379,12 @@ export {
107366
107379
  khe as getPeerjsInstance,
107367
107380
  Rwe as getResourceUserCount,
107368
107381
  jm as getTempQuaternion,
107369
- Gi as getTempVector,
107382
+ Oi as getTempVector,
107370
107383
  LC as getUrlParams,
107371
107384
  sV as getWorldDirection,
107372
107385
  rV as getWorldEuler,
107373
107386
  Gt as getWorldPosition,
107374
- Fi as getWorldQuaternion,
107387
+ Ui as getWorldQuaternion,
107375
107388
  HC as getWorldRotation,
107376
107389
  en as getWorldScale,
107377
107390
  Nu as hasCommercialLicense,