@needle-tools/engine 5.1.0-experimental.1 → 5.1.0-experimental.3

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 (27) hide show
  1. package/dist/{needle-engine.bundle-JZXX6OjM.js → needle-engine.bundle-Cp6RtfsD.js} +643 -625
  2. package/dist/{needle-engine.bundle-CaHKqc30.umd.cjs → needle-engine.bundle-DQE5rl-V.umd.cjs} +85 -85
  3. package/dist/{needle-engine.bundle-BiCxyTBE.min.js → needle-engine.bundle-EFFJgRPu.min.js} +88 -88
  4. package/dist/needle-engine.d.ts +22 -22
  5. package/dist/needle-engine.js +2 -2
  6. package/dist/needle-engine.min.js +1 -1
  7. package/dist/needle-engine.umd.cjs +1 -1
  8. package/dist/three.js +1 -1
  9. package/dist/three.min.js +18 -18
  10. package/dist/three.umd.cjs +29 -29
  11. package/lib/engine/engine_context.js +2 -2
  12. package/lib/engine/engine_context.js.map +1 -1
  13. package/lib/engine/engine_serialization_builtin_serializer.js +21 -3
  14. package/lib/engine/engine_serialization_builtin_serializer.js.map +1 -1
  15. package/lib/engine/js-extensions/RGBAColor.js +2 -2
  16. package/lib/engine/js-extensions/RGBAColor.js.map +1 -1
  17. package/lib/engine/physics/workers/mesh-bvh/GenerateMeshBVHWorker.js +12 -8
  18. package/lib/engine/physics/workers/mesh-bvh/GenerateMeshBVHWorker.js.map +1 -1
  19. package/lib/engine-components/postprocessing/PostProcessingHandler.js +1 -1
  20. package/lib/engine-components/postprocessing/PostProcessingHandler.js.map +1 -1
  21. package/package.json +2 -2
  22. package/src/engine/engine_context.ts +2 -2
  23. package/src/engine/engine_serialization_builtin_serializer.ts +17 -3
  24. package/src/engine/js-extensions/RGBAColor.ts +6 -2
  25. package/src/engine/physics/workers/mesh-bvh/GenerateMeshBVHWorker.js +11 -8
  26. package/src/engine-components/postprocessing/PostProcessingHandler.ts +1 -1
  27. package/dist/generateMeshBVH.worker-DT9A2Hrc.js +0 -1
@@ -1,6 +1,6 @@
1
- import { Vector2 as Z, Vector3 as _, Vector4 as ye, Quaternion as V, Box3 as Ut, ShadowMaterial as Ov, Euler as dt, PlaneGeometry as kn, WebGLRenderer as Fr, PerspectiveCamera as de, OrthographicCamera as vu, Scene as Ei, Mesh as H, Texture as xe, Uniform as Qi, Color as re, ShaderMaterial as Qn, MeshStandardMaterial as gt, Box3Helper as mS, GridHelper as Rv, Object3D as R, Material as be, Matrix3 as Mv, Matrix4 as ee, Layers as ko, PropertyBinding as za, AnimationClip as Ri, KeyframeTrack as gS, FileLoader as Ev, BufferGeometry as Ki, TextureLoader as Or, MeshBasicMaterial as Se, DoubleSide as Ti, Group as ks, CylinderGeometry as Tv, SphereGeometry as wu, BoxGeometry as Ua, SpriteMaterial as yS, Sprite as _S, Shape as bS, ExtrudeGeometry as vS, Ray as Is, CubeUVReflectionMapping as Ls, LinearSRGBColorSpace as Ds, ShaderChunk as ei, Sphere as xu, DataTexture as rg, RGBAFormat as Su, EquirectangularReflectionMapping as Os, SRGBColorSpace as js, Timer as wS, NeutralToneMapping as Na, AgXToneMapping as Cu, ACESFilmicToneMapping as Pu, NoToneMapping as zd, PCFSoftShadowMap as xS, BasicNodeLibrary as SS, WebGLRenderTarget as Yn, DepthTexture as Av, NearestFilter as Ud, AxesHelper as Mi, MathUtils as Rs, Fog as Iv, DirectionalLight as Qp, PointLight as ag, EdgesGeometry as CS, LineSegments as Yp, LineBasicMaterial as Nd, Line as $a, BufferAttribute as tt, Raycaster as ku, ArrayCamera as PS, Plane as Rr, SkinnedMesh as wo, InterleavedBufferAttribute as Lv, Skeleton as kS, Bone as OS, WebGLCubeRenderTarget as RS, CubeCamera as MS, LoopRepeat as ES, LoopOnce as Kp, AnimationMixer as lg, CompressedTexture as TS, FrontSide as Oo, Camera as AS, Frustum as qy, AudioListener as IS, PositionalAudio as LS, AudioLoader as Zp, VectorKeyframeTrack as DS, QuaternionKeyframeTrack as jS, Audio as BS, BackSide as Ou, PMREMGenerator as FS, EquirectangularRefractionMapping as Dv, CubeTexture as jv, CompressedCubeTexture as zS, EventDispatcher as cg, MeshDepthMaterial as US, CustomBlending as NS, MaxEquation as $S, AlwaysStencilFunc as WS, GreaterEqualStencilFunc as VS, NotEqualStencilFunc as HS, GreaterStencilFunc as GS, LessEqualStencilFunc as qS, EqualStencilFunc as XS, LessStencilFunc as QS, NeverStencilFunc as Xy, InvertStencilOp as YS, DecrementWrapStencilOp as KS, IncrementWrapStencilOp as ZS, DecrementStencilOp as JS, IncrementStencilOp as eC, ReplaceStencilOp as tC, ZeroStencilOp as iC, KeepStencilOp as nC, AmbientLight as sC, HemisphereLight as oC, Loader as rC, GLSL3 as aC, AlwaysDepth as lC, GreaterEqualDepth as cC, GreaterDepth as hC, LessEqualDepth as dC, LessDepth as uC, NotEqualDepth as fC, EqualDepth as pC, RawShaderMaterial as Bv, BatchedMesh as Qy, LinearFilter as $d, UnsignedByteType as mC, MeshPhysicalMaterial as Yy, RingGeometry as gC, Line3 as yC, AdditiveBlending as Fv, BoxHelper as _C, SpotLight as bC, DirectionalLightHelper as vC, CameraHelper as wC, LOD as xC, Triangle as SC, NormalBlending as CC, ReinhardToneMapping as hg, LinearToneMapping as dg, HalfFloatType as Bf, Source as PC, VideoTexture as kC, CatmullRomCurve3 as OC, MirroredRepeatWrapping as Ky, ShaderLib as Wd, UniformsUtils as zv, MeshNormalMaterial as RC, AudioContext as MC } from "./three.js";
1
+ import { Vector2 as K, Vector3 as _, Vector4 as ye, Quaternion as V, Box3 as Ut, ShadowMaterial as Ov, Euler as dt, PlaneGeometry as kn, WebGLRenderer as Fr, PerspectiveCamera as de, OrthographicCamera as vu, Scene as Ei, Mesh as H, Texture as xe, Uniform as Qi, Color as re, ShaderMaterial as Qn, MeshStandardMaterial as gt, Box3Helper as mS, GridHelper as Rv, Object3D as R, Material as be, Matrix3 as Mv, Matrix4 as ee, Layers as ko, PropertyBinding as za, AnimationClip as Ri, KeyframeTrack as gS, FileLoader as Ev, BufferGeometry as Zi, TextureLoader as Or, MeshBasicMaterial as Se, DoubleSide as Ti, Group as ks, CylinderGeometry as Tv, SphereGeometry as wu, BoxGeometry as Ua, SpriteMaterial as yS, Sprite as _S, Shape as bS, ExtrudeGeometry as vS, Ray as Is, CubeUVReflectionMapping as Ls, LinearSRGBColorSpace as Ds, ShaderChunk as ei, Sphere as xu, DataTexture as rg, RGBAFormat as Su, EquirectangularReflectionMapping as Os, SRGBColorSpace as js, Timer as wS, NeutralToneMapping as Na, AgXToneMapping as Cu, ACESFilmicToneMapping as Pu, NoToneMapping as zd, PCFShadowMap as xS, BasicNodeLibrary as SS, WebGLRenderTarget as Yn, DepthTexture as Av, NearestFilter as Ud, AxesHelper as Mi, MathUtils as Rs, Fog as Iv, DirectionalLight as Qp, PointLight as ag, EdgesGeometry as CS, LineSegments as Yp, LineBasicMaterial as Nd, Line as $a, BufferAttribute as tt, Raycaster as ku, ArrayCamera as PS, Plane as Rr, SkinnedMesh as wo, InterleavedBufferAttribute as Lv, Skeleton as kS, Bone as OS, WebGLCubeRenderTarget as RS, CubeCamera as MS, LoopRepeat as ES, LoopOnce as Zp, AnimationMixer as lg, CompressedTexture as TS, FrontSide as Oo, Camera as AS, Frustum as qy, AudioListener as IS, PositionalAudio as LS, AudioLoader as Kp, VectorKeyframeTrack as DS, QuaternionKeyframeTrack as jS, Audio as BS, BackSide as Ou, PMREMGenerator as FS, EquirectangularRefractionMapping as Dv, CubeTexture as jv, CompressedCubeTexture as zS, EventDispatcher as cg, MeshDepthMaterial as US, CustomBlending as NS, MaxEquation as $S, AlwaysStencilFunc as WS, GreaterEqualStencilFunc as VS, NotEqualStencilFunc as HS, GreaterStencilFunc as GS, LessEqualStencilFunc as qS, EqualStencilFunc as XS, LessStencilFunc as QS, NeverStencilFunc as Xy, InvertStencilOp as YS, DecrementWrapStencilOp as ZS, IncrementWrapStencilOp as KS, DecrementStencilOp as JS, IncrementStencilOp as eC, ReplaceStencilOp as tC, ZeroStencilOp as iC, KeepStencilOp as nC, AmbientLight as sC, HemisphereLight as oC, Loader as rC, GLSL3 as aC, AlwaysDepth as lC, GreaterEqualDepth as cC, GreaterDepth as hC, LessEqualDepth as dC, LessDepth as uC, NotEqualDepth as fC, EqualDepth as pC, RawShaderMaterial as Bv, BatchedMesh as Qy, LinearFilter as $d, UnsignedByteType as mC, MeshPhysicalMaterial as Yy, RingGeometry as gC, Line3 as yC, AdditiveBlending as Fv, BoxHelper as _C, SpotLight as bC, DirectionalLightHelper as vC, CameraHelper as wC, LOD as xC, Triangle as SC, NormalBlending as CC, ReinhardToneMapping as hg, LinearToneMapping as dg, HalfFloatType as Bf, Source as PC, VideoTexture as kC, CatmullRomCurve3 as OC, MirroredRepeatWrapping as Zy, ShaderLib as Wd, UniformsUtils as zv, MeshNormalMaterial as RC, AudioContext as MC } from "./three.js";
2
2
  import { createLoaders as ug, LODsManager as er, NEEDLE_progressive as Ve, getRaycastMesh as Uv, setKTX2TranscoderLocation as EC, setDracoDecoderLocation as TC, addDracoAndKTX2Loaders as AC, configureLoader as IC } from "./gltf-progressive-DwWaVr0o.js";
3
- import { GroundedSkybox as Wa, Font as LC, TextGeometry as DC, FontLoader as jC, GLTFLoader as Bs, EXRLoader as fg, HDRLoader as Nv, Stats as BC, nodeFrame as Zy, TransformControlsGizmo as Jy, OrbitControls as FC, PositionalAudioHelper as zC, HorizontalBlurShader as UC, VerticalBlurShader as NC, GLTFExporter as $v, strToU8 as Wv, zipSync as $C, XRControllerModelFactory as WC, XRHandMeshModel as VC, Line2 as HC, LineGeometry as GC, LineMaterial as qC, TransformControls as XC, InteractiveGroup as QC, HTMLMesh as YC, VertexNormalsHelper as KC, OBJLoader as pg, FBXLoader as Vv, mergeVertices as ZC } from "./three-examples.js";
3
+ import { GroundedSkybox as Wa, Font as LC, TextGeometry as DC, FontLoader as jC, GLTFLoader as Bs, EXRLoader as fg, HDRLoader as Nv, Stats as BC, nodeFrame as Ky, TransformControlsGizmo as Jy, OrbitControls as FC, PositionalAudioHelper as zC, HorizontalBlurShader as UC, VerticalBlurShader as NC, GLTFExporter as $v, strToU8 as Wv, zipSync as $C, XRControllerModelFactory as WC, XRHandMeshModel as VC, Line2 as HC, LineGeometry as GC, LineMaterial as qC, TransformControls as XC, InteractiveGroup as QC, HTMLMesh as YC, VertexNormalsHelper as ZC, OBJLoader as pg, FBXLoader as Vv, mergeVertices as KC } from "./three-examples.js";
4
4
  import { _md5 as e_, md5 as JC, v5 as t_, ByteBuffer as e1, fetchProfile as t1, MotionController as i1, SIZE_PREFIX_LENGTH as Hv, Builder as mg, createNoise4D as n1, Matrix4 as Ff, BatchedParticleRenderer as s1, ParticleSystem as o1, RenderMode as ms, ConstantColor as r1, Vector4 as a1, ConstantValue as l1, TrailParticle as i_, WorkerBase as c1, MeshBVH as h1 } from "./vendor-D-7l5gB0.js";
5
5
  import { __webpack_exports__default as ke, __webpack_exports__Text as Gv, __webpack_exports__update as d1, __webpack_exports__Block as qv, SimpleStateBehavior as u1, __webpack_exports__Inline as zf, __webpack_exports__FontLibrary as n_, ThreeMeshUI as s_ } from "./three-mesh-ui-B-lqrZWj.js";
6
6
  import { EffectAttribute as f1 } from "./postprocessing-CXlA3QA6.js";
@@ -70,7 +70,7 @@ class pe {
70
70
  }
71
71
  }
72
72
  const Uf = /* @__PURE__ */ new Map();
73
- function Zi(s = globalThis.location?.hostname) {
73
+ function Ki(s = globalThis.location?.hostname) {
74
74
  if (Uf.has(s)) return Uf.get(s);
75
75
  const e = /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|localhost/.test(s);
76
76
  return Uf.set(s, e), e === !0;
@@ -79,10 +79,10 @@ function p1() {
79
79
  return window.location.hostname.includes("glitch.me");
80
80
  }
81
81
  const m1 = () => (s) => s;
82
- function TD(s) {
82
+ function T2(s) {
83
83
  return m1()(s);
84
84
  }
85
- function AD() {
85
+ function A2() {
86
86
  return !!x("debug");
87
87
  }
88
88
  class Ji {
@@ -137,7 +137,7 @@ function x(s) {
137
137
  return !1;
138
138
  }
139
139
  ur = x("help");
140
- function ID(s, e) {
140
+ function I2(s, e) {
141
141
  const t = Ru();
142
142
  t.has(s) ? t.set(s, e) : t.append(s, e), document.location.search = t.toString();
143
143
  }
@@ -154,12 +154,12 @@ function g1(s, e, t) {
154
154
  function Xv(s, e, t) {
155
155
  window.history.replaceState(t, s, "?" + e.toString());
156
156
  }
157
- function LD(s) {
157
+ function L2(s) {
158
158
  for (var e = "", t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", i = t.length, n = 0; n < s; n++)
159
159
  e += t.charAt(Math.floor(Math.random() * i));
160
160
  return e;
161
161
  }
162
- function DD(s, e) {
162
+ function D2(s, e) {
163
163
  return Math.floor(Math.random() * (e - s + 1)) + s;
164
164
  }
165
165
  const a_ = ["smol", "tiny", "giant", "interesting", "smart", "bright", "dull", "extreme", "beautiful", "pretty", "dark", "epic", "salty", "silly", "funny", "lame", "lazy", "loud", "lucky", "mad", "mean", "mighty", "mysterious", "nasty", "odd", "old", "powerful", "quiet", "rapid", "scary", "shiny", "shy", "silly", "smooth", "sour", "spicy", "stupid", "sweet", "tasty", "terrible", "ugly", "unusual", "vast", "wet", "wild", "witty", "wrong", "zany", "zealous", "zippy", "zombie", "zorro"], l_ = ["cat", "dog", "mouse", "pig", "cow", "horse", "sheep", "chicken", "duck", "goat", "panda", "tiger", "lion", "elephant", "monkey", "bird", "fish", "snake", "frog", "turtle", "hamster", "penguin", "kangaroo", "whale", "dolphin", "crocodile", "snail", "ant", "bee", "beetle", "butterfly", "dragon", "eagle", "fish", "giraffe", "lizard", "panda", "penguin", "rabbit", "snake", "spider", "tiger", "zebra"];
@@ -221,7 +221,7 @@ function Eu(s, e) {
221
221
  });
222
222
  }
223
223
  const Th = x("debugresolveurl"), b1 = "rel:";
224
- function jD(s, e) {
224
+ function j2(s, e) {
225
225
  return To(s, e);
226
226
  }
227
227
  function To(s, e) {
@@ -327,7 +327,7 @@ class xo {
327
327
  const da = /* @__PURE__ */ Symbol("needle:watches");
328
328
  function gg(s, e) {
329
329
  if (!s[da])
330
- if (s instanceof Z)
330
+ if (s instanceof K)
331
331
  s[da] = new xo(s, ["x", "y"]);
332
332
  else if (s instanceof _)
333
333
  s[da] = new xo(s, ["x", "y", "z"]);
@@ -450,37 +450,37 @@ var D;
450
450
  }
451
451
  s.getSafariVersion = fe;
452
452
  })(D || (D = {}));
453
- function BD() {
453
+ function B2() {
454
454
  return D.isDesktop();
455
455
  }
456
- function FD() {
456
+ function F2() {
457
457
  return D.isMobileDevice();
458
458
  }
459
- function zD() {
459
+ function z2() {
460
460
  return D.isiPad();
461
461
  }
462
- function UD() {
462
+ function U2() {
463
463
  return D.isiPad();
464
464
  }
465
- function ND() {
465
+ function N2() {
466
466
  return D.isAndroidDevice();
467
467
  }
468
- function $D() {
468
+ function $2() {
469
469
  return D.isMozillaXR();
470
470
  }
471
- function WD() {
471
+ function W2() {
472
472
  return D.isMacOS();
473
473
  }
474
- function VD() {
474
+ function V2() {
475
475
  return D.isiOS();
476
476
  }
477
- function HD() {
477
+ function H2() {
478
478
  return D.isSafari();
479
479
  }
480
- function GD() {
480
+ function G2() {
481
481
  return D.isQuest();
482
482
  }
483
- async function qD() {
483
+ async function q2() {
484
484
  return D.microphonePermissionsGranted();
485
485
  }
486
486
  const yo = /* @__PURE__ */ new WeakMap();
@@ -496,10 +496,10 @@ function Yv(s, e, t) {
496
496
  }
497
497
  const i = yo.get(s).attributeChangedListeners;
498
498
  return i.has(e) || i.set(e, []), i.get(e).push(t), () => {
499
- Kv(s, e, t);
499
+ Zv(s, e, t);
500
500
  };
501
501
  }
502
- function Kv(s, e, t) {
502
+ function Zv(s, e, t) {
503
503
  if (!yo.get(s)) return;
504
504
  const i = yo.get(s).attributeChangedListeners;
505
505
  if (!i.has(e)) return;
@@ -522,7 +522,7 @@ class c_ {
522
522
  this.reason = e;
523
523
  }
524
524
  }
525
- async function Zv(s) {
525
+ async function Kv(s) {
526
526
  const e = await Promise.allSettled(s).catch((n) => [
527
527
  new c_(n.message)
528
528
  ]);
@@ -564,7 +564,7 @@ const e0 = console.error, k1 = function(...s) {
564
564
  function O1(s) {
565
565
  yg = !s, s ? console.error = k1 : console.error = e0;
566
566
  }
567
- function XD(s) {
567
+ function X2(s) {
568
568
  return O1(s);
569
569
  }
570
570
  let t0 = 0;
@@ -633,7 +633,7 @@ function E1(s, e, t, i = {}) {
633
633
  removeFunction: a
634
634
  });
635
635
  }
636
- function QD() {
636
+ function Q2() {
637
637
  S1 && console.log("Clearing messages");
638
638
  for (const s of va.values())
639
639
  s?.removeFunction.call(s);
@@ -738,10 +738,10 @@ function L() {
738
738
  if (L1) return !1;
739
739
  if (tm !== void 0) return tm;
740
740
  if (Wf !== void 0) return Wf;
741
- let s = Zi();
741
+ let s = Ki();
742
742
  return s || (s = window.location.hostname.endsWith(".local-credentialless.webcontainer.io")), Wf = s, s;
743
743
  }
744
- function YD(s) {
744
+ function Y2(s) {
745
745
  tm = s;
746
746
  }
747
747
  class D1 {
@@ -1002,7 +1002,7 @@ function $1(s, e, t) {
1002
1002
  return s.lerp(e, t).normalize().multiplyScalar(o);
1003
1003
  }
1004
1004
  const Hf = new V(), s0 = new V().setFromAxisAngle(new _(0, 1, 0), Math.PI);
1005
- function KD(s, e) {
1005
+ function Z2(s, e) {
1006
1006
  s.lookAt(e), s.quaternion.multiply(s0);
1007
1007
  }
1008
1008
  function Tu(s, e, t = !0, i = !1) {
@@ -1010,8 +1010,8 @@ function Tu(s, e, t = !0, i = !1) {
1010
1010
  Hf.copy(s.quaternion);
1011
1011
  const n = te(e), o = te(s);
1012
1012
  if (i) {
1013
- if (Kn(s, ve(e)), t) {
1014
- const r = o.y, a = o.sub(K1(s));
1013
+ if (Zn(s, ve(e)), t) {
1014
+ const r = o.y, a = o.sub(Z1(s));
1015
1015
  a.y = r, s.lookAt(a), s.quaternion.multiply(s0);
1016
1016
  }
1017
1017
  Number.isNaN(s.quaternion.x) && s.quaternion.copy(Hf);
@@ -1019,7 +1019,7 @@ function Tu(s, e, t = !0, i = !1) {
1019
1019
  }
1020
1020
  t && (n.y = o.y), s.lookAt(n), Number.isNaN(s.quaternion.x) && s.quaternion.copy(Hf);
1021
1021
  }
1022
- function ZD(s, e, t, i = 1) {
1022
+ function K2(s, e, t, i = 1) {
1023
1023
  if (t) {
1024
1024
  const n = U(0, 0, 0), o = e.x / window.innerWidth * 2 - 1, r = -(e.y / window.innerHeight) * 2 + 1;
1025
1025
  n.set(
@@ -1069,7 +1069,7 @@ function ve(s, e = null) {
1069
1069
  const t = e ?? Gd.get();
1070
1070
  return s.parent ? (s.getWorldQuaternion(t), t) : t.copy(s.quaternion);
1071
1071
  }
1072
- function Kn(s, e) {
1072
+ function Zn(s, e) {
1073
1073
  if (!s) return;
1074
1074
  e !== br && br.copy(e);
1075
1075
  const t = br;
@@ -1078,7 +1078,7 @@ function Kn(s, e) {
1078
1078
  s.quaternion.set(n.x, n.y, n.z, n.w);
1079
1079
  }
1080
1080
  function o0(s, e, t, i, n) {
1081
- br.set(e, t, i, n), Kn(s, br);
1081
+ br.set(e, t, i, n), Zn(s, br);
1082
1082
  }
1083
1083
  const q1 = new Ji(() => new _(), 100), X1 = new _();
1084
1084
  function Qe(s, e = null) {
@@ -1094,31 +1094,31 @@ function Ic(s, e) {
1094
1094
  s.parent.getWorldScale(t), s.scale.copy(e), s.scale.divide(t);
1095
1095
  }
1096
1096
  const Q1 = new _(), g_ = new V();
1097
- function JD(s) {
1097
+ function J2(s) {
1098
1098
  return ve(s, g_), Q1.set(0, 0, 1).applyQuaternion(g_);
1099
1099
  }
1100
1100
  const Y1 = new Ji(() => new _(), 100), y_ = new V();
1101
- function K1(s, e) {
1101
+ function Z1(s, e) {
1102
1102
  return e || (e = Y1.get().set(0, 0, 1)), ve(s, y_), e.applyQuaternion(y_);
1103
1103
  }
1104
- const __ = new dt(), b_ = new dt(), Z1 = new _();
1104
+ const __ = new dt(), b_ = new dt(), K1 = new _();
1105
1105
  function r0(s) {
1106
1106
  const e = Gd.get();
1107
1107
  return s.getWorldQuaternion(e), b_.setFromQuaternion(e), b_;
1108
1108
  }
1109
1109
  function a0(s, e) {
1110
1110
  const t = Gd.get();
1111
- Kn(s, t.setFromEuler(e));
1111
+ Zn(s, t.setFromEuler(e));
1112
1112
  }
1113
1113
  function bg(s) {
1114
- const e = r0(s), t = Z1;
1114
+ const e = r0(s), t = K1;
1115
1115
  return t.set(e.x, e.y, e.z), t.x = F.toDegrees(t.x), t.y = F.toDegrees(t.y), t.z = F.toDegrees(t.z), t;
1116
1116
  }
1117
1117
  function J1(s, e) {
1118
1118
  Au(s, e.x, e.y, e.z, !0);
1119
1119
  }
1120
1120
  function Au(s, e, t, i, n = !0) {
1121
- n && (e = F.toRadians(e), t = F.toRadians(t), i = F.toRadians(i)), __.set(e, t, i), br.setFromEuler(__), Kn(s, br);
1121
+ n && (e = F.toRadians(e), t = F.toRadians(t), i = F.toRadians(i)), __.set(e, t, i), br.setFromEuler(__), Zn(s, br);
1122
1122
  }
1123
1123
  function sm(s, e = !0) {
1124
1124
  s && (e ? (function t(i) {
@@ -1129,7 +1129,7 @@ function sm(s, e = !0) {
1129
1129
  console.log(i + t.name + " <" + t.type + ">");
1130
1130
  }));
1131
1131
  }
1132
- function e2(s) {
1132
+ function eD(s) {
1133
1133
  let e = s?.name || "";
1134
1134
  if (!s) return e;
1135
1135
  let t = s.parent;
@@ -1250,7 +1250,7 @@ class Mr {
1250
1250
  function tP(s) {
1251
1251
  return Mr.copyTexture(s);
1252
1252
  }
1253
- function t2(s, e = !1) {
1253
+ function tD(s, e = !1) {
1254
1254
  return Mr.textureToCanvas(s, e);
1255
1255
  }
1256
1256
  function iP(s) {
@@ -1575,7 +1575,7 @@ function h0(s, ...e) {
1575
1575
  if (typeof o == "function")
1576
1576
  return o.name + "()";
1577
1577
  }
1578
- if (o instanceof Z) return `(${i(o.x)}, ${i(o.y)})`;
1578
+ if (o instanceof K) return `(${i(o.x)}, ${i(o.y)})`;
1579
1579
  if (o instanceof _) return `(${i(o.x)}, ${i(o.y)}, ${i(o.z)})`;
1580
1580
  if (o instanceof ye) return `(${i(o.x)}, ${i(o.y)}, ${i(o.z)}, ${i(o.w)})`;
1581
1581
  if (o instanceof V) return `(${i(o.x)}, ${i(o.y)}, ${i(o.z)}, ${i(o.w)})`;
@@ -2244,11 +2244,11 @@ Ao('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"]
2244
2244
  Ao('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";');
2245
2245
  Ao('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";');
2246
2246
  Ao('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";');
2247
- Ao('globalThis["__NEEDLE_ENGINE_VERSION__"] = "5.1.0-experimental.0";');
2247
+ Ao('globalThis["__NEEDLE_ENGINE_VERSION__"] = "5.1.0-experimental.3";');
2248
2248
  Ao('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
2249
- Ao('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Mon Mar 30 2026 13:05:42 GMT+0700 (Indochina Time)";');
2249
+ Ao('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Mon Mar 30 2026 14:46:42 GMT+0700 (Indochina Time)";');
2250
2250
  Ao('globalThis["__NEEDLE_PUBLIC_KEY__"] = "npk_ad8e492e31253a2800d563522e42a7311d0d7b766ac4ec1f64d3b425f06eacbd";');
2251
- const Pi = "5.1.0-experimental.0", Lc = "undefined", Xd = "Mon Mar 30 2026 13:05:42 GMT+0700 (Indochina Time)";
2251
+ const Pi = "5.1.0-experimental.3", Lc = "undefined", Xd = "Mon Mar 30 2026 14:46:42 GMT+0700 (Indochina Time)";
2252
2252
  y0 && console.log(`Engine version: ${Pi} (generator: ${Lc})
2253
2253
  Project built at ${Xd}`);
2254
2254
  const Oa = "npk_ad8e492e31253a2800d563522e42a7311d0d7b766ac4ec1f64d3b425f06eacbd", ws = "needle_isActiveInHierarchy", ua = "builtin_components", yd = "needle_editor_guid";
@@ -2284,7 +2284,7 @@ function wg(s, e, t, i) {
2284
2284
  }
2285
2285
  }));
2286
2286
  }
2287
- function i2(s, e, t) {
2287
+ function iD(s, e, t) {
2288
2288
  const i = xg(s, e);
2289
2289
  if (i)
2290
2290
  for (let n = i.length - 1; n >= 0; n--) {
@@ -2361,7 +2361,7 @@ const $P = /* @__PURE__ */ Symbol("component-name");
2361
2361
  function w0(s) {
2362
2362
  return s && s.isComponent;
2363
2363
  }
2364
- const n2 = /* @__PURE__ */ Symbol("object"), Xf = new Ji(() => new _(), 20);
2364
+ const nD = /* @__PURE__ */ Symbol("object"), Xf = new Ji(() => new _(), 20);
2365
2365
  class WP {
2366
2366
  _point;
2367
2367
  _normal;
@@ -2489,7 +2489,7 @@ class Qd {
2489
2489
  }
2490
2490
  }
2491
2491
  let x0, O_ = null;
2492
- function Zn() {
2492
+ function Kn() {
2493
2493
  return x0;
2494
2494
  }
2495
2495
  function GP(s) {
@@ -2580,10 +2580,10 @@ const am = /* @__PURE__ */ new WeakMap();
2580
2580
  function C0(s, e) {
2581
2581
  return Ns(s, ue.ContextCreated, e), () => Io(s, ue.ContextCreated);
2582
2582
  }
2583
- function s2(s, e) {
2583
+ function sD(s, e) {
2584
2584
  return Ns(s, ue.ContextClearing, e), () => Io(s, ue.ContextClearing);
2585
2585
  }
2586
- function o2(s, e) {
2586
+ function oD(s, e) {
2587
2587
  return Ns(s, ue.ContextDestroying, e), () => Io(s, ue.ContextDestroying);
2588
2588
  }
2589
2589
  function Cg(s, e) {
@@ -2592,10 +2592,10 @@ function Cg(s, e) {
2592
2592
  function qP(s, e) {
2593
2593
  return Ns(s, Ce.Update, e), () => Io(s, Ce.Update);
2594
2594
  }
2595
- function r2(s, e) {
2595
+ function rD(s, e) {
2596
2596
  return Ns(s, Ce.OnBeforeRender, e), () => Io(s, Ce.OnBeforeRender);
2597
2597
  }
2598
- function a2(s, e) {
2598
+ function aD(s, e) {
2599
2599
  return Ns(s, Ce.OnAfterRender, e), () => Io(s, Ce.OnAfterRender);
2600
2600
  }
2601
2601
  const Tt = x("debuglicense"), P0 = [];
@@ -2660,7 +2660,7 @@ var ui;
2660
2660
  screenHeight: window.screen.height,
2661
2661
  event_name: "page_view"
2662
2662
  }).then((l) => {
2663
- if (l instanceof Response && l.ok && Zi()) {
2663
+ if (l instanceof Response && l.ok && Ki()) {
2664
2664
  const h = (a.domElement?.getAttribute("src") || "") + Pi + Lc + Xd + Oa;
2665
2665
  window.sessionStorage.getItem("session_key") !== h && (window.sessionStorage.setItem("session_key", h), n(a, "info", {
2666
2666
  src: a.domElement?.getAttribute("src") || "",
@@ -2754,7 +2754,7 @@ var ui;
2754
2754
  }
2755
2755
  })(ui || (ui = {}));
2756
2756
  pe.registerCallback(ue.ContextRegistered, (s) => {
2757
- KP(s.context), YP(s.context), setTimeout(() => JP(s.context), 2e3);
2757
+ ZP(s.context), YP(s.context), setTimeout(() => JP(s.context), 2e3);
2758
2758
  });
2759
2759
  let Yd, lm = !1, cm = "";
2760
2760
  async function QP() {
@@ -2818,7 +2818,7 @@ async function YP(s) {
2818
2818
  lm === !0 && (t.style.cssText !== i && (t = e()), s.domElement.shadowRoot ? t.parentNode !== s.domElement.shadowRoot && s.domElement.shadowRoot?.appendChild(t) : t.parentNode != document.body && document.body.appendChild(t));
2819
2819
  }, 500);
2820
2820
  }
2821
- async function KP(s) {
2821
+ async function ZP(s) {
2822
2822
  try {
2823
2823
  if (!Ms() && !Lu())
2824
2824
  return Qf(s);
@@ -2830,7 +2830,7 @@ async function KP(s) {
2830
2830
  async function Qf(s) {
2831
2831
  let e = !1;
2832
2832
  s.domElement.addEventListener("ready", () => e = !0), await Yd?.catch(() => {
2833
- }), !(Ms() || Lu()) && (Es() === !1 && ZP(), e ? hm(s) : s.domElement.addEventListener("ready", () => {
2833
+ }), !(Ms() || Lu()) && (Es() === !1 && KP(), e ? hm(s) : s.domElement.addEventListener("ready", () => {
2834
2834
  hm(s);
2835
2835
  }));
2836
2836
  }
@@ -2889,7 +2889,7 @@ function hm(s) {
2889
2889
  }
2890
2890
  const k0 = "data:image/webp;base64,UklGRrABAABXRUJQVlA4WAoAAAAQAAAAHwAAHwAAQUxQSKEAAAARN6CmbSM4WR7vdARON11EBDq3fLiNbVtVzpMCPlKAEzsx0Y/x+Ovuv4dn0EFE/ydAvz6YggXzgh5sVgXM/zOC/4sii7qgGvB5N7hmuQYwkvazWAu1JPW41FXSHq6pnaQWvqYH18Fc0j1hO/BFTtIeSBlJi5w6qIIO7IOrwhFsB2Yxukif0FTRLpXswHR8MxbslKe9VZsn/Ub5C7YFOpqSTABWUDgg6AAAAFAGAJ0BKiAAIAA+7VyoTqmkpCI3+qgBMB2JbACdMt69DwMIQBLhkTO6XwY00UEDK6cNIDnuNibPf0EgAP7Y1myuiQHLDsF/0h5unrGh6WAbv7aegg2ZMd3uRKfT/3SJztcaujYfTvMXspfCTmYcoO6a+vhC3ss4M8uM58t4siiu59I4aOl59e9Sr6xoxYlHf2v+NnBNpJYeJf8jABQAId/PXuBkLEFkiCucgSGEcfhvajql/j3reCGl0M5/9gQWy7ayNPs+wlvIxFnNfSlfuND4CZOCyxOHhRqOmHN4ULHo3tCSrUNvgAA=";
2891
2891
  let T_ = 0;
2892
- async function ZP(s) {
2892
+ async function KP(s) {
2893
2893
  const e = Date.now();
2894
2894
  if (e - T_ < 2e3) return;
2895
2895
  T_ = e;
@@ -3052,7 +3052,7 @@ pe.registerCallback(ue.ContextCreated, (s) => {
3052
3052
  const e = s.context;
3053
3053
  ok(e), ik(e);
3054
3054
  });
3055
- const Kd = x("debugcomponents"), I_ = "eff8ba80-635d-11ec-90d6-0242ac120003";
3055
+ const Zd = x("debugcomponents"), I_ = "eff8ba80-635d-11ec-90d6-0242ac120003";
3056
3056
  class Nt {
3057
3057
  get seed() {
3058
3058
  return this._seed;
@@ -3119,12 +3119,12 @@ function O0(s, e, t) {
3119
3119
  }
3120
3120
  function ik(s) {
3121
3121
  s.connection.beginListen("instance-destroyed", (e) => {
3122
- Kd && console.log("[Remote] Destroyed", s.scene, e);
3122
+ Zd && console.log("[Remote] Destroyed", s.scene, e);
3123
3123
  const t = ew(e.guid, s.scene);
3124
3124
  t && en(t);
3125
3125
  });
3126
3126
  }
3127
- class l2 {
3127
+ class lD {
3128
3128
  /** File to download */
3129
3129
  filename;
3130
3130
  /** Checksum to verify its the correct file */
@@ -3166,7 +3166,7 @@ function R0(s, e, t, i) {
3166
3166
  if (r) {
3167
3167
  const l = r;
3168
3168
  if (l.guid) {
3169
- Kd && console.log("[Local] new instance", "gameobject:", r?.guid);
3169
+ Zd && console.log("[Local] new instance", "gameobject:", r?.guid);
3170
3170
  const c = new nk(n.guid, l.guid);
3171
3171
  c.seed = a, e.deleteOnDisconnect === !0 && (c.deleteStateOnDisconnect = !0), o && (o.position && (Array.isArray(o.position) ? c.position = { x: o.position[0], y: o.position[1], z: o.position[2] } : c.position = { x: o.position.x, y: o.position.y, z: o.position.z }), o.rotation && (o.rotation instanceof dt ? o.rotation = new V().setFromEuler(o.rotation) : o.rotation instanceof Array && (o.rotation = new V().fromArray(o.rotation)), c.rotation = { x: o.rotation.x, y: o.rotation.y, z: o.rotation.z, w: o.rotation.w }), o.scale && (Array.isArray(o.scale) ? c.scale = { x: o.scale[0], y: o.scale[1], z: o.scale[2] } : c.scale = { x: o.scale.x, y: o.scale.y, z: o.scale.z })), c.position || (c.position = { x: l.position.x, y: l.position.y, z: l.position.z }), c.rotation || (c.rotation = { x: l.quaternion.x, y: l.quaternion.y, z: l.quaternion.z, w: l.quaternion.w }), c.scale || (c.scale = { x: l.scale.x, y: l.scale.y, z: l.scale.z }), c.visible = n.visible, o?.parent && (typeof o.parent == "string" ? c.parent = o.parent : o.parent?.guid ? c.parent = o.parent.guid : o.parent instanceof Ei ? c.parent = "scene" : console.warn("Unsupported parent type in sync instantiate options: " + o.parent?.name)), c.hostData = t, i === !1 && (c.dontSave = !0), !e?.context?.connection && L() && console.debug("Object will be instantiated but it will not be synced: not connected", n.guid), e.context.connection.isInRoom && fa.push(new WeakRef(l)), e?.context?.connection.send("new-instance-created", c);
3172
3172
  } else console.warn("Missing guid, can not send new instance event", l);
@@ -3187,9 +3187,9 @@ function ok(s) {
3187
3187
  return;
3188
3188
  }
3189
3189
  const o = new is();
3190
- i.position && (o.position = new _(i.position.x, i.position.y, i.position.z)), i.rotation && (o.rotation = new V(i.rotation.x, i.rotation.y, i.rotation.z, i.rotation.w)), i.scale && (o.scale = new _(i.scale.x, i.scale.y, i.scale.z)), o.parent = i.parent, i.seed && (o.idProvider = new Nt(i.seed)), o.visible = i.visible, o.context = s, Kd && s.alias && console.log("[Remote] instantiate in: " + s.alias);
3190
+ i.position && (o.position = new _(i.position.x, i.position.y, i.position.z)), i.rotation && (o.rotation = new V(i.rotation.x, i.rotation.y, i.rotation.z, i.rotation.w)), i.scale && (o.scale = new _(i.scale.x, i.scale.y, i.scale.z)), o.parent = i.parent, i.seed && (o.idProvider = new Nt(i.seed)), o.visible = i.visible, o.context = s, Zd && s.alias && console.log("[Remote] instantiate in: " + s.alias);
3191
3191
  const r = Er(n, o);
3192
- fa.push(new WeakRef(r)), r && (i.parent === "scene" && s.scene.add(r), Kd && console.log("[Remote] new instance", "gameobject:", r?.guid, n));
3192
+ fa.push(new WeakRef(r)), r && (i.parent === "scene" && s.scene.add(r), Zd && console.log("[Remote] new instance", "gameobject:", r?.guid, n));
3193
3193
  }), t = s.connection.beginListen("left-room", () => {
3194
3194
  fa.length > 0 && console.debug(`Left networking room, cleaning up ${fa.length} instantiated objects`);
3195
3195
  for (const i of fa) {
@@ -3232,7 +3232,7 @@ function E0(s, e) {
3232
3232
  }
3233
3233
  return null;
3234
3234
  }
3235
- const Zc = x("gizmos"), yt = x("debugextension"), kg = x("debugresolvedependencies"), ck = ["/extensions/", "extensions/"], hk = [
3235
+ const Kc = x("gizmos"), yt = x("debugextension"), kg = x("debugresolvedependencies"), ck = ["/extensions/", "extensions/"], hk = [
3236
3236
  { prefix: "/nodes/", dependencyName: "node" },
3237
3237
  { prefix: "/meshes/", dependencyName: "mesh" },
3238
3238
  { prefix: "/materials/", dependencyName: "material" },
@@ -3408,7 +3408,7 @@ class mk {
3408
3408
  Nn && console.warn("No serializer found for " + i, e, e.name, e.constructor.name);
3409
3409
  }
3410
3410
  }
3411
- const Zd = new mk();
3411
+ const Kd = new mk();
3412
3412
  class rn {
3413
3413
  name;
3414
3414
  // register<T>(c: Constructor<T> | Constructor<T>[])
@@ -3425,13 +3425,13 @@ class rn {
3425
3425
  constructor(e, t) {
3426
3426
  if (this.name = t, Array.isArray(e))
3427
3427
  for (const i of e)
3428
- Zd.register(i, this);
3428
+ Kd.register(i, this);
3429
3429
  else
3430
- Zd.register(e, this);
3430
+ Kd.register(e, this);
3431
3431
  }
3432
3432
  }
3433
3433
  class gk {
3434
- isDevMode = Zi();
3434
+ isDevMode = Ki();
3435
3435
  cache = {};
3436
3436
  /** only call when assigning values for the very first time */
3437
3437
  registerDefinedKeys(e, t) {
@@ -3473,7 +3473,7 @@ function yk(s, e) {
3473
3473
  for (const o in t) {
3474
3474
  const r = s[o];
3475
3475
  if (r != null && typeof r == "object") {
3476
- const a = Zd.getSerializerForConstructor(r);
3476
+ const a = Kd.getSerializerForConstructor(r);
3477
3477
  if (a) {
3478
3478
  i[o] = a.onSerialize(r, e);
3479
3479
  continue;
@@ -3537,7 +3537,7 @@ function um(s, e, t) {
3537
3537
  }
3538
3538
  const _k = x("noerrors");
3539
3539
  function bk(s, e, t) {
3540
- if (_k || !e || !Zi() || !s || s.constructor && s.constructor[jP] === !0) return;
3540
+ if (_k || !e || !Ki() || !s || s.constructor && s.constructor[jP] === !0) return;
3541
3541
  const i = s.constructor?.name, n = Object.getOwnPropertyNames(e);
3542
3542
  for (const o of n) {
3543
3543
  if (o === "sourceId") continue;
@@ -3634,10 +3634,10 @@ function fm(s, e, t, i, n) {
3634
3634
  } catch (h) {
3635
3635
  console.error("Error in callback", h, s);
3636
3636
  }
3637
- if (t.type = r, !o && n && (n instanceof be || n instanceof H || n instanceof Ki || n instanceof Ri))
3637
+ if (t.type = r, !o && n && (n instanceof be || n instanceof H || n instanceof Zi || n instanceof Ri))
3638
3638
  return n;
3639
3639
  if (i || (i = {
3640
- serializer: Zd.getSerializerForConstructor(r)
3640
+ serializer: Kd.getSerializerForConstructor(r)
3641
3641
  }), n && typeof n == "object" && fk(n)) {
3642
3642
  if (n.__concreteInstance)
3643
3643
  return n.__concreteInstance;
@@ -3744,7 +3744,7 @@ class Ck {
3744
3744
  e.url && delete this._assetReferences[e.url];
3745
3745
  }
3746
3746
  }
3747
- const Kf = /* @__PURE__ */ Symbol("assetReference");
3747
+ const Zf = /* @__PURE__ */ Symbol("assetReference");
3748
3748
  class ne {
3749
3749
  /**
3750
3750
  * Get an AssetReference for a URL to be easily loaded.
@@ -3838,7 +3838,7 @@ class ne {
3838
3838
  return e === this.url && (this.mustLoad && await this.loadAssetAsync(), this.asset) ? this.asset : null;
3839
3839
  }
3840
3840
  get mustLoad() {
3841
- return !this.asset || this.asset.__destroyed === !0 || Ka(this.asset) === !0;
3841
+ return !this.asset || this.asset.__destroyed === !0 || Za(this.asset) === !0;
3842
3842
  }
3843
3843
  _loadingPromise = null;
3844
3844
  /**
@@ -3876,14 +3876,14 @@ class ne {
3876
3876
  if (this._rawBinary) {
3877
3877
  if (!(this._rawBinary instanceof ArrayBuffer))
3878
3878
  return console.error("[AssetReference] Failed loading – Invalid data. Must be of type ArrayBuffer. " + typeof this._rawBinary), null;
3879
- this._loadingPromise = Zn().parseSync(t, this._rawBinary, this.url, null), this.raiseProgressEvent(new ProgressEvent("progress", { loaded: this._rawBinary.byteLength, total: this._rawBinary.byteLength }));
3879
+ this._loadingPromise = Kn().parseSync(t, this._rawBinary, this.url, null), this.raiseProgressEvent(new ProgressEvent("progress", { loaded: this._rawBinary.byteLength, total: this._rawBinary.byteLength }));
3880
3880
  } else
3881
- Ys && console.log("Load async", this.url), this._loadingPromise = Zn().loadSync(t, this.url, this.url, null, (n) => {
3881
+ Ys && console.log("Load async", this.url), this._loadingPromise = Kn().loadSync(t, this.url, this.url, null, (n) => {
3882
3882
  this.raiseProgressEvent(n);
3883
3883
  });
3884
3884
  this._loadingPromise.finally(() => this._loadingPromise = null);
3885
3885
  const i = await this._loadingPromise;
3886
- return this._progressListeners.length = 0, this._glbRoot = this.tryGetActualGameObjectRoot(i), i ? (i[Kf] = this, this._glbRoot && (this._glbRoot[Kf] = this), this.asset && (this.asset[Kf] = this), iu(t), i.scene !== void 0 && (this._rawAsset = i), this.asset) : null;
3886
+ return this._progressListeners.length = 0, this._glbRoot = this.tryGetActualGameObjectRoot(i), i ? (i[Zf] = this, this._glbRoot && (this._glbRoot[Zf] = this), this.asset && (this.asset[Zf] = this), iu(t), i.scene !== void 0 && (this._rawAsset = i), this.asset) : null;
3887
3887
  }
3888
3888
  /** loads and returns a new instance of `asset` */
3889
3889
  instantiate(e) {
@@ -4160,7 +4160,7 @@ function* L0(s, e = null) {
4160
4160
  for (; t.time - i < s; )
4161
4161
  yield;
4162
4162
  }
4163
- function* c2(s) {
4163
+ function* cD(s) {
4164
4164
  for (let e = 0; e < s; e++)
4165
4165
  yield;
4166
4166
  }
@@ -4179,7 +4179,7 @@ class Ur {
4179
4179
  static createText(e, t) {
4180
4180
  let i = null;
4181
4181
  const n = t?.font || Tk(t?.familyFamily || null);
4182
- n instanceof LC ? i = this.#t(e, n, t) : i == null && (i = new Ki());
4182
+ n instanceof LC ? i = this.#t(e, n, t) : i == null && (i = new Zi());
4183
4183
  const o = t?.color || 16777215, r = new H(i, t?.material ?? new gt({ color: o }));
4184
4184
  return this.applyDefaultObjectOptions(r, t), n instanceof Promise ? n.then((a) => {
4185
4185
  r.geometry = this.#t(e, a, t), t?.onGeometry && t.onGeometry(r);
@@ -4280,12 +4280,12 @@ function Ek(s, e, t, i, n) {
4280
4280
  generateTopUV: (c, h) => {
4281
4281
  const d = [];
4282
4282
  for (let f = 0; f < h.length; f += 3)
4283
- d.push(new Z(h[f] / s, h[f + 1] / e));
4283
+ d.push(new K(h[f] / s, h[f + 1] / e));
4284
4284
  return d;
4285
4285
  },
4286
4286
  generateSideWallUV: (c, h, d, f, p, g) => {
4287
4287
  const y = [];
4288
- return y.push(new Z(h[d] / s, h[d + 1] / e)), y.push(new Z(h[f] / s, h[f + 1] / e)), y.push(new Z(h[p] / s, h[p + 1] / e)), y.push(new Z(h[g] / s, h[g + 1] / e)), y;
4288
+ return y.push(new K(h[d] / s, h[d + 1] / e)), y.push(new K(h[f] / s, h[f + 1] / e)), y.push(new K(h[p] / s, h[p + 1] / e)), y.push(new K(h[g] / s, h[g + 1] / e)), y;
4289
4289
  }
4290
4290
  }
4291
4291
  });
@@ -4314,18 +4314,18 @@ function Tk(s) {
4314
4314
  });
4315
4315
  return jh.set(e, i), i;
4316
4316
  }
4317
- let Zf = !1, Jf = null;
4317
+ let Kf = !1, Jf = null;
4318
4318
  function Ak(s, e) {
4319
4319
  if (Jf === null) {
4320
4320
  const t = "https://cdn.needle.tools/static/models/shaderball.glb", i = new Bs(), n = ug(null);
4321
- i.setDRACOLoader(n.dracoLoader), i.setKTX2Loader(n.ktx2Loader), Zf = !0, Jf = i.loadAsync(t).then((o) => {
4321
+ i.setDRACOLoader(n.dracoLoader), i.setKTX2Loader(n.ktx2Loader), Kf = !0, Jf = i.loadAsync(t).then((o) => {
4322
4322
  const r = o.scene;
4323
4323
  return r.position.y -= 0.5, r;
4324
4324
  }).catch((o) => (console.warn("Failed to load shaderball mesh: " + o.message), F_())).finally(() => {
4325
- Zf = !1;
4325
+ Kf = !1;
4326
4326
  });
4327
4327
  }
4328
- if (Zf) {
4328
+ if (Kf) {
4329
4329
  const t = F_();
4330
4330
  t.name = "ShaderBall-Placeholder";
4331
4331
  const i = t.children[0];
@@ -4456,7 +4456,7 @@ class Bh extends KeyboardEvent {
4456
4456
  super.stopImmediatePropagation(), this.source?.stopImmediatePropagation();
4457
4457
  }
4458
4458
  }
4459
- class h2 {
4459
+ class hD {
4460
4460
  key;
4461
4461
  keyType;
4462
4462
  source;
@@ -4718,10 +4718,10 @@ class Ik {
4718
4718
  _pointerClick = [!1];
4719
4719
  _pointerDoubleClick = [!1];
4720
4720
  _pointerPressed = [!1];
4721
- _pointerPositions = [new Z()];
4722
- _pointerPositionsLastFrame = [new Z()];
4723
- _pointerPositionsDelta = [new Z()];
4724
- _pointerPositionsRC = [new Z()];
4721
+ _pointerPositions = [new K()];
4722
+ _pointerPositionsLastFrame = [new K()];
4723
+ _pointerPositionsDelta = [new K()];
4724
+ _pointerPositionsRC = [new K()];
4725
4725
  _pointerPositionDown = [new _()];
4726
4726
  _pointerDownTime = [];
4727
4727
  _pointerUpTime = [];
@@ -5041,7 +5041,7 @@ class Ik {
5041
5041
  if (qe && console.log(e.pointerType, "DOWN", t, e.button), !!this.isInRect(e)) {
5042
5042
  for (this.setPointerState(t, this._pointerPressed, !0), this.setPointerState(t, this._pointerDown, !0), this.setPointerStateT(t, this._pointerEvent, e.source); t >= this._pointerTypes.length; ) this._pointerTypes.push(e.pointerType);
5043
5043
  for (this._pointerTypes[t] = e.pointerType; t >= this._pointerPositionDown.length; ) this._pointerPositionDown.push(new _());
5044
- for (this._pointerPositionDown[t].set(e.clientX, e.clientY, e.clientZ ?? 0); t >= this._pointerPositions.length; ) this._pointerPositions.push(new Z());
5044
+ for (this._pointerPositionDown[t].set(e.clientX, e.clientY, e.clientZ ?? 0); t >= this._pointerPositions.length; ) this._pointerPositions.push(new K());
5045
5045
  this._pointerPositions[t].set(e.clientX, e.clientY), t >= this._pointerDownTime.length && this._pointerDownTime.push(0), this._pointerDownTime[t] = this.context.time.realtimeSinceStartup, this.updatePointerPosition(e), this._pointerEventsPressed.push(e), this.onDispatchEvent(e);
5046
5046
  }
5047
5047
  }
@@ -5079,9 +5079,9 @@ class Ik {
5079
5079
  }
5080
5080
  updatePointerPosition(e) {
5081
5081
  const t = e.pointerId;
5082
- for (; t >= this._pointerPositions.length; ) this._pointerPositions.push(new Z());
5083
- for (; t >= this._pointerPositionsLastFrame.length; ) this._pointerPositionsLastFrame.push(new Z());
5084
- for (; t >= this._pointerPositionsDelta.length; ) this._pointerPositionsDelta.push(new Z());
5082
+ for (; t >= this._pointerPositions.length; ) this._pointerPositions.push(new K());
5083
+ for (; t >= this._pointerPositionsLastFrame.length; ) this._pointerPositionsLastFrame.push(new K());
5084
+ for (; t >= this._pointerPositionsDelta.length; ) this._pointerPositionsDelta.push(new K());
5085
5085
  const i = this._pointerPositionsLastFrame[t];
5086
5086
  i.copy(this._pointerPositions[t]);
5087
5087
  const n = this._pointerPositionsDelta[t];
@@ -5092,7 +5092,7 @@ class Ik {
5092
5092
  }
5093
5093
  n.x += o, n.y += r, this._pointerPositions[t].x = e.clientX, this._pointerPositions[t].y = e.clientY;
5094
5094
  const a = e.clientX, l = e.clientY;
5095
- for (; t >= this._pointerPositionsRC.length; ) this._pointerPositionsRC.push(new Z());
5095
+ for (; t >= this._pointerPositionsRC.length; ) this._pointerPositionsRC.push(new K());
5096
5096
  const c = this._pointerPositionsRC[t];
5097
5097
  c.set(a, l), this.convertScreenspaceToRaycastSpace(c);
5098
5098
  }
@@ -5175,7 +5175,7 @@ class Lk {
5175
5175
  } else c.pointer;
5176
5176
  h && a.push(h);
5177
5177
  }
5178
- const l = await Zv(a);
5178
+ const l = await Kv(a);
5179
5179
  l?.anyFailed && (L() || ea) && console.error("[NEEDLE_lightmaps]Error during extension loading:", l), o();
5180
5180
  })) : null;
5181
5181
  }
@@ -5390,10 +5390,10 @@ const A = {
5390
5390
  )
5391
5391
  };
5392
5392
  let Mg;
5393
- function d2() {
5393
+ function dD() {
5394
5394
  return Mg;
5395
5395
  }
5396
- function u2(s) {
5396
+ function uD(s) {
5397
5397
  Mg = s;
5398
5398
  }
5399
5399
  async function zk(s, e) {
@@ -5487,7 +5487,7 @@ const $_ = "https://urls.needle.tools/default-networking-backend/index";
5487
5487
  let Ui = "wss://networking-2.needle.tools/socket";
5488
5488
  const bi = !!x("debugnet"), Uh = !!(bi || x("debugowner")), Nh = x("debugnetbin");
5489
5489
  var Wk = /* @__PURE__ */ ((s) => (s.ConnectionInfo = "connection-start-info", s))(Wk || {}), ie = /* @__PURE__ */ ((s) => (s.Join = "join-room", s.Leave = "leave-room", s.JoinedRoom = "joined-room", s.LeftRoom = "left-room", s.UserJoinedRoom = "user-joined-room", s.UserLeftRoom = "user-left-room", s.RoomStateSent = "room-state-sent", s))(ie || {});
5490
- class f2 {
5490
+ class fD {
5491
5491
  room;
5492
5492
  // room name
5493
5493
  viewId;
@@ -5495,11 +5495,11 @@ class f2 {
5495
5495
  inRoom;
5496
5496
  // connection ids
5497
5497
  }
5498
- class p2 {
5498
+ class pD {
5499
5499
  room;
5500
5500
  // room name
5501
5501
  }
5502
- class m2 {
5502
+ class mD {
5503
5503
  userId;
5504
5504
  }
5505
5505
  var Vk = /* @__PURE__ */ ((s) => (s.RequestHasOwner = "request-has-owner", s.ResponseHasOwner = "response-has-owner", s.RequestIsOwner = "request-is-owner", s.ResponseIsOwner = "response-is-owner", s.RequestOwnership = "request-ownership", s.GainedOwnership = "gained-ownership", s.RemoveOwnership = "remove-ownership", s.LostOwnership = "lost-ownership", s.GainedOwnershipBroadcast = "gained-ownership-broadcast", s.LostOwnershipBroadcast = "lost-ownership-broadcast", s))(Vk || {});
@@ -6096,7 +6096,7 @@ function Jd(s, e) {
6096
6096
  return e;
6097
6097
  }
6098
6098
  const tp = [], W_ = [];
6099
- function Kk(s, e) {
6099
+ function Zk(s, e) {
6100
6100
  if (tp.length === 0)
6101
6101
  for (let t = 0; t < 27; t++) tp.push(0);
6102
6102
  e || (e = tp);
@@ -6104,7 +6104,7 @@ function Kk(s, e) {
6104
6104
  W_[t] = e[t];
6105
6105
  e = W_, s.unity_SHAr = { value: new ye(e[9], e[3], e[6], e[0]) }, s.unity_SHBr = { value: new ye(e[12], e[15], e[18], e[21]) }, s.unity_SHAg = { value: new ye(e[10], e[4], e[7], e[1]) }, s.unity_SHBg = { value: new ye(e[13], e[16], e[19], e[22]) }, s.unity_SHAb = { value: new ye(e[11], e[5], e[8], e[2]) }, s.unity_SHBb = { value: new ye(e[14], e[17], e[20], e[23]) }, s.unity_SHC = { value: new ye(e[24], e[25], e[26], 1) };
6106
6106
  }
6107
- class Zk {
6107
+ class Kk {
6108
6108
  vertexShader;
6109
6109
  fragmentShader;
6110
6110
  technique;
@@ -6121,7 +6121,7 @@ async function Jk(s, e) {
6121
6121
  if (o.uri && r.uri || o.code && r.code) {
6122
6122
  if (!o.code && o.uri && await V_(o), !r.code && r.uri && await V_(r), !o.code || !r.code) return null;
6123
6123
  const a = s.techniques[e];
6124
- return new Zk(o.code, r.code, a);
6124
+ return new Kk(o.code, r.code, a);
6125
6125
  }
6126
6126
  }
6127
6127
  return console.error("Shader technique not found", e), null;
@@ -6596,7 +6596,7 @@ const qa = [];
6596
6596
  function Tg(s) {
6597
6597
  qa.indexOf(s) === -1 && qa.push(s);
6598
6598
  }
6599
- function g2(s) {
6599
+ function gD(s) {
6600
6600
  const e = qa.indexOf(s);
6601
6601
  e !== -1 && qa.splice(e, 1);
6602
6602
  }
@@ -6604,7 +6604,7 @@ const Xa = [];
6604
6604
  function U0(s) {
6605
6605
  Xa.indexOf(s) === -1 && Xa.push(s);
6606
6606
  }
6607
- function y2(s) {
6607
+ function yD(s) {
6608
6608
  const e = Xa.indexOf(s);
6609
6609
  e !== -1 && Xa.splice(e, 1);
6610
6610
  }
@@ -7890,7 +7890,7 @@ class Bc extends HTMLElement {
7890
7890
  const d = this?.parentNode;
7891
7891
  if ((this.style.display != "flex" || this.style.visibility != "visible" || this.style.opacity != "1" || d != this._domElement?.shadowRoot) && !Es()) {
7892
7892
  const f = r++;
7893
- Zi() && this._userRequestedMenuVisible === !1 ? (f === 0 && a(d, this._userRequestedMenuVisible), f === 1 && console.warn("Needle Menu Warning: You need a PRO license to hide the Needle Engine menu → The menu will be visible in your deployed website if you don't have a PRO license. See https://needle.tools/pricing for details.")) : f === 0 ? a(d, !0) : setTimeout(() => a(d, !0), 5);
7893
+ Ki() && this._userRequestedMenuVisible === !1 ? (f === 0 && a(d, this._userRequestedMenuVisible), f === 1 && console.warn("Needle Menu Warning: You need a PRO license to hide the Needle Engine menu → The menu will be visible in your deployed website if you don't have a PRO license. See https://needle.tools/pricing for details.")) : f === 0 ? a(d, !0) : setTimeout(() => a(d, !0), 5);
7894
7894
  }
7895
7895
  } finally {
7896
7896
  l = !1;
@@ -7918,7 +7918,7 @@ class Bc extends HTMLElement {
7918
7918
  /** @private user preference for logo visibility */
7919
7919
  _userRequestedLogoVisible = void 0;
7920
7920
  showNeedleLogo(e) {
7921
- this._userRequestedLogoVisible = e, !(!e && (!Es() || Y_) && (console.warn("[Needle Engine] You need a PRO license to hide the Needle Engine logo in production."), !Zi())) && this.___onSetLogoVisible(e);
7921
+ this._userRequestedLogoVisible = e, !(!e && (!Es() || Y_) && (console.warn("[Needle Engine] You need a PRO license to hide the Needle Engine logo in production."), !Ki())) && this.___onSetLogoVisible(e);
7922
7922
  }
7923
7923
  /** @returns true if the logo is visible */
7924
7924
  get logoIsVisible() {
@@ -8158,8 +8158,8 @@ class Bc extends HTMLElement {
8158
8158
  }), this.appendChild(t);
8159
8159
  }
8160
8160
  }
8161
- const Xe = x("debugcontext"), wO = x("stats"), xO = x("debugactive"), SO = x("debugframerate"), CO = x("debugcoroutine"), b2 = {};
8162
- class v2 {
8161
+ const Xe = x("debugcontext"), wO = x("stats"), xO = x("debugactive"), SO = x("debugframerate"), CO = x("debugcoroutine"), bD = {};
8162
+ class vD {
8163
8163
  name;
8164
8164
  /** for debugging only */
8165
8165
  alias;
@@ -8854,7 +8854,7 @@ Possible solutions:
8854
8854
  if (!this._mainCamera) {
8855
8855
  N.Current = this;
8856
8856
  let h = null;
8857
- Za(this.scene, (d) => {
8857
+ Ka(this.scene, (d) => {
8858
8858
  const f = d;
8859
8859
  if (f?.isCamera) {
8860
8860
  if (bc(f.gameObject), !f.activeAndEnabled) return;
@@ -8887,7 +8887,7 @@ Possible solutions:
8887
8887
  progress: null,
8888
8888
  index: 0,
8889
8889
  count: n.length
8890
- }, r = Zn(), a = 0;
8890
+ }, r = Kn(), a = 0;
8891
8891
  for (let l = 0; l < n.length; l++) {
8892
8892
  if (t.abortSignal?.aborted) {
8893
8893
  Xe && console.log("Aborting loading because of abort signal");
@@ -9121,7 +9121,7 @@ Possible solutions:
9121
9121
  return this.physics.engine.postStep(), !0;
9122
9122
  }
9123
9123
  internalOnRender() {
9124
- this.isManagedExternally || (hR(this), this._currentFrameEvent = -1, Zy.camera = this.mainCamera, Zy.update(), this.renderNow(), this._currentFrameEvent = 4);
9124
+ this.isManagedExternally || (hR(this), this._currentFrameEvent = -1, Ky.camera = this.mainCamera, Ky.update(), this.renderNow(), this._currentFrameEvent = 4);
9125
9125
  }
9126
9126
  internalOnAfterRender() {
9127
9127
  if (this.isVisibleToUser || this.runInBackground) {
@@ -9672,7 +9672,7 @@ Layout: `;
9672
9672
  const t = this.states[e];
9673
9673
  if (!t) return null;
9674
9674
  this.states[e] = t;
9675
- const i = this._needleGamepadButtons[e] || new Z_(void 0, e);
9675
+ const i = this._needleGamepadButtons[e] || new K_(void 0, e);
9676
9676
  return i.pressed = t.pressed, i.value = t.value, i.isDown = t.isDown, i.isUp = t.isUp, this._needleGamepadButtons[e] = i, i;
9677
9677
  }
9678
9678
  getPointerId(e) {
@@ -9688,7 +9688,7 @@ Layout: `;
9688
9688
  /** combine the InputState information + the GamepadButton information (since GamepadButtons can not be extended) */
9689
9689
  toNeedleGamepadButton(e, t) {
9690
9690
  if (!this.inputSource.gamepad?.buttons) return;
9691
- const i = this.inputSource.gamepad?.buttons[e], n = this.states[e], o = this._needleGamepadButtons[e] || new Z_(e, t);
9691
+ const i = this.inputSource.gamepad?.buttons[e], n = this.states[e], o = this._needleGamepadButtons[e] || new K_(e, t);
9692
9692
  return i && (o.pressed = i.pressed, o.value = i.value, o.touched = i.touched), n && (o.isDown = n.isDown, o.isUp = n.isUp), this._needleGamepadButtons[e] = o, o;
9693
9693
  }
9694
9694
  /**
@@ -9810,7 +9810,7 @@ Layout: `;
9810
9810
  updateInputEvents() {
9811
9811
  if (this.gamepad?.buttons) {
9812
9812
  for (let e = 0; e < this.gamepad.buttons.length; e++) {
9813
- const t = this.gamepad.buttons[e], i = this.states[e] || new K_();
9813
+ const t = this.gamepad.buttons[e], i = this.states[e] || new Z_();
9814
9814
  let n = null;
9815
9815
  this._isMxInk && (e === 4 || e === 5) ? (t.value > 0 && !i.pressed ? (n = "pointerdown", i.isDown = !0, i.isUp = !1) : t.value === 0 && i.pressed ? (n = "pointerup", i.isDown = !1, i.isUp = !0) : i.pressed && (n = "pointermove", i.isDown = !1, i.isUp = !1), i.pressed = t.value > 0, i.value = t.value) : (t.pressed && !i.pressed ? (n = "pointerdown", i.isDown = !0, i.isUp = !1) : !t.pressed && i.pressed ? (n = "pointerup", i.isDown = !1, i.isUp = !0) : (i.isDown = !1, i.isUp = !1), i.pressed = t.pressed, i.value = t.value), this.states[e] = i;
9816
9816
  const o = e !== this._selectButtonIndex && e !== this._squeezeButtonIndex;
@@ -9836,7 +9836,7 @@ Layout: `;
9836
9836
  this._pinchPosition.lerpVectors(t.position, i.position, 0.5);
9837
9837
  const o = this.xr.context.mainCamera?.parent;
9838
9838
  if (o && this._pinchPosition.applyMatrix4(o.matrixWorld), n !== 0) {
9839
- const l = this.states.pinch || new K_(), c = (0.02 + 0.01) * 1.5;
9839
+ const l = this.states.pinch || new Z_(), c = (0.02 + 0.01) * 1.5;
9840
9840
  l.value = 1 - (n - 0.02) / c;
9841
9841
  const h = n < 0.02 - 0.01, d = n > 0.02 + 0.01;
9842
9842
  h && !l.pressed ? (Vh && console.log("pinch start", n), l.isDown = !0, l.isUp = !1, l.pressed = !0) : d && l.pressed ? (l.isDown = !1, l.isUp = !0, l.pressed = !1) : (l.isDown = !1, l.isUp = !1), this.states.pinch = l;
@@ -9874,7 +9874,7 @@ Layout: `;
9874
9874
  }
9875
9875
  }
9876
9876
  }
9877
- class K_ {
9877
+ class Z_ {
9878
9878
  /** if the button was pressed the last update */
9879
9879
  isDown = !1;
9880
9880
  /** if the button was released the last update */
@@ -9882,7 +9882,7 @@ class K_ {
9882
9882
  pressed = !1;
9883
9883
  value = 0;
9884
9884
  }
9885
- class Z_ {
9885
+ class K_ {
9886
9886
  /** The index of the button in the input gamepad */
9887
9887
  index;
9888
9888
  name;
@@ -10241,8 +10241,8 @@ async function IO() {
10241
10241
  uc(!0);
10242
10242
  const i = await e;
10243
10243
  if (i) {
10244
- const n = K.getDefaultSessionInit(s);
10245
- K.setSession(s, i, n, t.context);
10244
+ const n = Z.getDefaultSessionInit(s);
10245
+ Z.setSession(s, i, n, t.context);
10246
10246
  } else
10247
10247
  console.error("[NeedleXRSession:granted] ASAP session was rejected");
10248
10248
  e = void 0;
@@ -10258,14 +10258,14 @@ async function IO() {
10258
10258
  navigator.xr?.addEventListener("sessiongranted", async () => {
10259
10259
  const e = sessionStorage.getItem("needle_xr_session_mode"), t = sessionStorage.getItem("needle_xr_session_init") ?? null, i = t ? JSON.parse(t) : null;
10260
10260
  let n = null;
10261
- if (V0() && (await Ya.start(e || s, i || K.getDefaultSessionInit(s)).catch((o) => console.warn("[NeedleXRSession:granted] TemporaryXRContext start failed:", o)), await jO(), n = await Ya.handoff()), n)
10262
- K.setSession(n.mode, n.session, n.init, N.Current);
10261
+ if (V0() && (await Ya.start(e || s, i || Z.getDefaultSessionInit(s)).catch((o) => console.warn("[NeedleXRSession:granted] TemporaryXRContext start failed:", o)), await jO(), n = await Ya.handoff()), n)
10262
+ Z.setSession(n.mode, n.session, n.init, N.Current);
10263
10263
  else if (e && t) {
10264
10264
  console.log("[NeedleXRSession:granted] Restore last session");
10265
10265
  const o = JSON.parse(t);
10266
- K.start(e, o).catch((r) => console.warn(r));
10266
+ Z.start(e, o).catch((r) => console.warn(r));
10267
10267
  } else
10268
- K.start(s).catch((o) => console.warn("[NeedleXRSession:granted] failed:", o));
10268
+ Z.start(s).catch((o) => console.warn("[NeedleXRSession:granted] failed:", o));
10269
10269
  }, { once: !0 });
10270
10270
  }
10271
10271
  }
@@ -10295,15 +10295,15 @@ function jO() {
10295
10295
  });
10296
10296
  }
10297
10297
  D.isDesktop() && L() && window.addEventListener("keydown", (s) => {
10298
- (s.key === "x" || s.key === "Escape") && K.active && K.stop();
10298
+ (s.key === "x" || s.key === "Escape") && Z.active && Z.stop();
10299
10299
  });
10300
10300
  function BO(s) {
10301
10301
  s && s?.toLowerCase() === "ar" && Jn.registerWaitForInteraction(() => {
10302
- K.start("ar");
10302
+ Z.start("ar");
10303
10303
  });
10304
10304
  }
10305
10305
  const Hh = /* @__PURE__ */ Symbol("initial-fov"), rp = /* @__PURE__ */ Symbol("initial-near");
10306
- class K {
10306
+ class Z {
10307
10307
  static _sync = null;
10308
10308
  static getXRSync(e) {
10309
10309
  return this._sync || (this._sync = new TO(e)), this._sync;
@@ -10428,7 +10428,7 @@ class K {
10428
10428
  static offerSession(e, t, i) {
10429
10429
  return "xr" in navigator && navigator.xr && "offerSession" in navigator.xr ? (typeof navigator.xr.offerSession == "function" && (console.log("WebXR offerSession is available - requesting mode: " + e), t == "default" && (t = this.getDefaultSessionInit(e)), navigator.xr.offerSession(e, {
10430
10430
  ...t
10431
- }).then((n) => K.setSession(e, n, t, i)).catch((n) => {
10431
+ }).then((n) => Z.setSession(e, n, t, i)).catch((n) => {
10432
10432
  console.log("XRSession offer rejected (perhaps because another call to offerSession was made or a call to requestSession was made)");
10433
10433
  })), !0) : !1;
10434
10434
  }
@@ -10488,7 +10488,7 @@ class K {
10488
10488
  if (e === "quicklook")
10489
10489
  return console.warn("QuickLook mode is only supported on iOS devices"), null;
10490
10490
  if (e == "ar" && (e = "immersive-ar"), L() && x("debugxrpreroom"))
10491
- return console.warn("Debug: Starting temporary XR session"), await Ya.start(e, t || K.getDefaultSessionInit(e)), null;
10491
+ return console.warn("Debug: Starting temporary XR session"), await Ya.start(e, t || Z.getDefaultSessionInit(e)), null;
10492
10492
  if (this._currentSessionRequest)
10493
10493
  return console.warn("A XRSession is already being requested"), (Ge || L()) && _e("A XRSession is already being requested"), this._currentSessionRequest.then(() => this._activeSession);
10494
10494
  if (this._activeSession)
@@ -10550,7 +10550,7 @@ class K {
10550
10550
  if (this._activeSession)
10551
10551
  return console.error("A XRSession is already running"), this._activeSession;
10552
10552
  const o = e == "immersive-ar" ? n.scripts_immersive_ar : n.scripts_immersive_vr;
10553
- return this._activeSession = new K(e, t, n, {
10553
+ return this._activeSession = new Z(e, t, n, {
10554
10554
  scripts: o,
10555
10555
  controller_added: this._controllerAddedListeners,
10556
10556
  controller_removed: this._controllerRemovedListeners,
@@ -10571,7 +10571,7 @@ class K {
10571
10571
  /** The needle engine context this session was started from */
10572
10572
  context;
10573
10573
  get sync() {
10574
- return K._sync;
10574
+ return Z._sync;
10575
10575
  }
10576
10576
  /** Returns true if the xr session is still active */
10577
10577
  get running() {
@@ -10680,7 +10680,7 @@ class K {
10680
10680
  /** The currently active XR rig */
10681
10681
  get rig() {
10682
10682
  const e = this._rigs[0] ?? null;
10683
- return e?.gameObject && Ka(e.gameObject) || e?.isActive === !1 ? (this.updateActiveXRRig(), this._rigs[0] ?? null) : e;
10683
+ return e?.gameObject && Za(e.gameObject) || e?.isActive === !1 ? (this.updateActiveXRRig(), this._rigs[0] ?? null) : e;
10684
10684
  }
10685
10685
  _rigScale = 1;
10686
10686
  _lastRigScaleUpdate = -1;
@@ -10725,7 +10725,7 @@ class K {
10725
10725
  for (let i = 1; i < this._rigs.length; i++) {
10726
10726
  const n = this._rigs[i];
10727
10727
  if (n.isActive) {
10728
- if (Ka(n.gameObject)) {
10728
+ if (Za(n.gameObject)) {
10729
10729
  this._rigs.splice(i, 1), i--;
10730
10730
  continue;
10731
10731
  }
@@ -10895,7 +10895,7 @@ class K {
10895
10895
  i >= 0 && this.context.post_render_callbacks.splice(i, 1), this.context.xr = null, this.context.renderer.xr.enabled = !1, this.context.pre_update_oneshot_callbacks.push(() => {
10896
10896
  this.context.mainCameraComponent?.applyClearFlags(), this.context.mainCameraComponent?.applyClippingPlane();
10897
10897
  }), aO({ session: this });
10898
- for (const o of K._xrEndListeners)
10898
+ for (const o of Z._xrEndListeners)
10899
10899
  o({ xr: this });
10900
10900
  const n = [...this.controllers];
10901
10901
  for (let o = 0; o < n.length; o++)
@@ -10903,7 +10903,7 @@ class K {
10903
10903
  this.controllers.length = 0, this._newControllers.length = 0;
10904
10904
  for (const o of this._xr_scripts)
10905
10905
  o?.onLeaveXR?.({ xr: this });
10906
- this.sync?.onExitXR(this), this.context.mainCamera && (this._originalCameraParent?.add(this.context.mainCamera), this._originalCameraWorldPosition && At(this.context.mainCamera, this._originalCameraWorldPosition), this._originalCameraWorldRotation && Kn(this.context.mainCamera, this._originalCameraWorldRotation), this._originalCameraWorldScale && Ic(this.context.mainCamera, this._originalCameraWorldScale), this.context.mainCamera instanceof de && (this.context.mainCamera[Hh] && (this.context.mainCamera.fov = this.context.mainCamera[Hh], this.context.mainCamera[Hh] = 0), this.context.mainCamera[rp] && (this.context.mainCamera.near = this.context.mainCamera[rp], this.context.mainCamera[rp] = 0))), this.context.requestSizeUpdate(), this._defaultRig.gameObject.removeFromParent(), uc(!1);
10906
+ this.sync?.onExitXR(this), this.context.mainCamera && (this._originalCameraParent?.add(this.context.mainCamera), this._originalCameraWorldPosition && At(this.context.mainCamera, this._originalCameraWorldPosition), this._originalCameraWorldRotation && Zn(this.context.mainCamera, this._originalCameraWorldRotation), this._originalCameraWorldScale && Ic(this.context.mainCamera, this._originalCameraWorldScale), this.context.mainCamera instanceof de && (this.context.mainCamera[Hh] && (this.context.mainCamera.fov = this.context.mainCamera[Hh], this.context.mainCamera[Hh] = 0), this.context.mainCamera[rp] && (this.context.mainCamera.near = this.context.mainCamera[rp], this.context.mainCamera[rp] = 0))), this.context.requestSizeUpdate(), this._defaultRig.gameObject.removeFromParent(), uc(!1);
10907
10907
  };
10908
10908
  _didStart = !1;
10909
10909
  /** Called every frame by the engine */
@@ -10946,7 +10946,7 @@ class K {
10946
10946
  }
10947
10947
  }
10948
10948
  rO({ session: this }), zr();
10949
- for (const o of K._xrStartListeners)
10949
+ for (const o of Z._xrStartListeners)
10950
10950
  o(i);
10951
10951
  const n = [...this._xr_scripts];
10952
10952
  Ge && console.log("NeedleXRSession start, handle scripts:", n);
@@ -11193,7 +11193,11 @@ class ae extends re {
11193
11193
  return this.alpha;
11194
11194
  }
11195
11195
  constructor(e, t, i, n) {
11196
- super(), typeof e == "number" && typeof t == "number" && typeof i == "number" ? (this.set(e, t, i), this.alpha = typeof n == "number" ? n : 1) : e !== void 0 && (this.set(e), this.alpha = 1);
11196
+ super(), typeof e == "number" && typeof t == "number" && typeof i == "number" ? (this.setRGB(
11197
+ Number.isFinite(e) ? e : 0,
11198
+ Number.isFinite(t) ? t : 0,
11199
+ Number.isFinite(i) ? i : 0
11200
+ ), this.alpha = typeof n == "number" && Number.isFinite(n) ? n : 1) : e !== void 0 && (this.set(e), this.alpha = 1);
11197
11201
  }
11198
11202
  clone() {
11199
11203
  const e = super.clone();
@@ -11278,7 +11282,7 @@ class z {
11278
11282
  static DrawLabel(e, t, i = 0.05, n = 0, o, r, a) {
11279
11283
  if (!z.enabled) return null;
11280
11284
  o || (o = dn);
11281
- const l = K.active?.rigScale ?? 1, c = Ni.getTextLabel(n, t, i * l, o, r);
11285
+ const l = Z.active?.rigScale ?? 1, c = Ni.getTextLabel(n, t, i * l, o, r);
11282
11286
  return a instanceof R && a.add(c), c.position.x = e.x, c.position.y = e.y, c.position.z = e.z, c;
11283
11287
  }
11284
11288
  /**
@@ -11581,7 +11585,7 @@ class Ni {
11581
11585
  for (let i = 0; i < t.length; i++) {
11582
11586
  const n = t[i];
11583
11587
  if (e.mainCamera && n instanceof ke.MeshUIBaseElement) {
11584
- if (Ka(n))
11588
+ if (Za(n))
11585
11589
  continue;
11586
11590
  const o = e.isInVR, r = !1, a = !o;
11587
11591
  Tu(n, e.mainCamera, r, a);
@@ -11592,11 +11596,11 @@ class Ni {
11592
11596
  const n = e.time.realtimeSinceStartup;
11593
11597
  for (let o = t.length - 1; o >= 0; o--) {
11594
11598
  const r = t[o];
11595
- n >= i[o] - 1e-6 && (t.splice(o, 1), i.splice(o, 1), r.removeFromParent(), Ka(r) != !0 && r[vm].push(r));
11599
+ n >= i[o] - 1e-6 && (t.splice(o, 1), i.splice(o, 1), r.removeFromParent(), Za(r) != !0 && r[vm].push(r));
11596
11600
  }
11597
11601
  }
11598
11602
  }
11599
- const Zt = x("debugphysics"), NO = x("debugworker"), nb = new ko();
11603
+ const Kt = x("debugphysics"), NO = x("debugworker"), nb = new ko();
11600
11604
  class Nr {
11601
11605
  static AllLayers = 4294967295;
11602
11606
  ray;
@@ -11615,7 +11619,7 @@ class Nr {
11615
11619
  useAcceleratedRaycast;
11616
11620
  allowSlowRaycastFallback = !0;
11617
11621
  screenPointFromOffset(e, t) {
11618
- this.screenPoint === void 0 && (this.screenPoint = new Z()), this.screenPoint.x = e / window.innerWidth * 2 - 1, this.screenPoint.y = -(t / window.innerHeight) * 2 + 1;
11622
+ this.screenPoint === void 0 && (this.screenPoint = new K()), this.screenPoint.x = e / window.innerWidth * 2 - 1, this.screenPoint.y = -(t / window.innerHeight) * 2 + 1;
11619
11623
  }
11620
11624
  /** sets one layer for raycasting (e.g. layer 4, only objects on layer 4 will then be hit) */
11621
11625
  setLayer(e) {
@@ -11704,23 +11708,23 @@ class zc {
11704
11708
  * @param options raycast options. If null, default options will be used.
11705
11709
  */
11706
11710
  raycast(e = null) {
11707
- Zt && performance.mark("raycast.start"), e || (e = this.defaultRaycastOptions);
11711
+ Kt && performance.mark("raycast.start"), e || (e = this.defaultRaycastOptions);
11708
11712
  const t = e.screenPoint ?? this.context.input.mousePositionRC, i = e.raycaster ?? this.raycaster;
11709
11713
  if (i.near = e.minDistance ?? 0, i.far = e.maxDistance ?? 1 / 0, i.params = this.defaultThresholds, e.lineThreshold === void 0 && (e.lineThreshold = -1), i.params.Line = { threshold: e.lineThreshold }, e.ray)
11710
11714
  i.ray.copy(e.ray);
11711
11715
  else {
11712
11716
  const a = e.cam ?? this.context.mainCamera;
11713
11717
  if (!a)
11714
- return Zt && console.error("Can not perform raycast - no main camera found"), this.defaultRaycastOptions.results && (this.defaultRaycastOptions.results.length = 0), this.defaultRaycastOptions.results ?? [];
11718
+ return Kt && console.error("Can not perform raycast - no main camera found"), this.defaultRaycastOptions.results && (this.defaultRaycastOptions.results.length = 0), this.defaultRaycastOptions.results ?? [];
11715
11719
  const l = this.context.xrCamera;
11716
11720
  this.context.isInXR && l instanceof PS && l.cameras.length > 0 ? i.setFromCamera(t, l.cameras[0]) : i.setFromCamera(t, a);
11717
11721
  }
11718
11722
  let n = e.targets;
11719
11723
  n || (n = this.targetBuffer, n.length = 1, n[0] = this.context.scene);
11720
11724
  let o = e.results;
11721
- this.defaultRaycastOptions.results && (this.defaultRaycastOptions.results.length = 0), o || (this.defaultRaycastOptions.results || (this.defaultRaycastOptions.results = new Array()), o = this.defaultRaycastOptions.results), e.layerMask !== void 0 ? e.layerMask instanceof ko ? i.layers.mask = e.layerMask.mask : i.layers.mask = e.layerMask : (i.layers.enableAll(), i.layers.disable(2)), Zt && console.time("raycast"), o.length = 0, zc._raycasting++, this.intersect(this.raycaster, n, o, e), o.sort((a, l) => a.distance - l.distance);
11725
+ this.defaultRaycastOptions.results && (this.defaultRaycastOptions.results.length = 0), o || (this.defaultRaycastOptions.results || (this.defaultRaycastOptions.results = new Array()), o = this.defaultRaycastOptions.results), e.layerMask !== void 0 ? e.layerMask instanceof ko ? i.layers.mask = e.layerMask.mask : i.layers.mask = e.layerMask : (i.layers.enableAll(), i.layers.disable(2)), Kt && console.time("raycast"), o.length = 0, zc._raycasting++, this.intersect(this.raycaster, n, o, e), o.sort((a, l) => a.distance - l.distance);
11722
11726
  const r = e.ignore;
11723
- return r !== void 0 && r.length > 0 && (o = o.filter((a) => !r.includes(a.object))), zc._raycasting--, Zt && (console.timeEnd("raycast"), console.warn("#" + this.context.time.frame + ", hits:", o?.length ? [...o] : "nothing"), performance.mark("raycast.end"), performance.measure("raycast", "raycast.start", "raycast.end")), o;
11727
+ return r !== void 0 && r.length > 0 && (o = o.filter((a) => !r.includes(a.object))), zc._raycasting--, Kt && (console.timeEnd("raycast"), console.warn("#" + this.context.time.frame + ", hits:", o?.length ? [...o] : "nothing"), performance.mark("raycast.end"), performance.measure("raycast", "raycast.start", "raycast.end")), o;
11724
11728
  }
11725
11729
  intersect(e, t, i, n) {
11726
11730
  for (const o of t) {
@@ -11741,7 +11745,7 @@ class zc {
11741
11745
  const f = Uv(o);
11742
11746
  f && (a.geometry = f);
11743
11747
  }
11744
- if (!d && WO(a, e, i) || (n.useAcceleratedRaycast !== !1 ? eu.runMeshBVHRaycast(e, a, i, this.context, n) : e.intersectObject(a, !1, i)), a.geometry = l, Zt && i.length != c) {
11748
+ if (!d && WO(a, e, i) || (n.useAcceleratedRaycast !== !1 ? eu.runMeshBVHRaycast(e, a, i, this.context, n) : e.intersectObject(a, !1, i)), a.geometry = l, Kt && i.length != c) {
11745
11749
  const f = i[i.length - 1];
11746
11750
  z.DrawWireSphere(f.point, 0.1, 7798784, 1, !1), z.DrawWireMesh({ mesh: o, depthTest: !1, duration: 0.2, color: 7798784 });
11747
11751
  }
@@ -11831,7 +11835,7 @@ var eu;
11831
11835
  l(), r && (j.staticGenerator = new r(w), j.staticGenerator.applyWorldTransforms = !1, j.staticGeometry = j.staticGenerator.generate(), I.boundsTree = a?.call(j.staticGeometry), j.staticGeometryLastUpdate = performance.now() + Math.random() * 200, j.bvhNeedsUpdate = !0);
11832
11836
  else if (I.boundsTree && (j.autoUpdateMeshBvhInterval !== void 0 && j.autoUpdateMeshBvhInterval >= 0 || B === !0)) {
11833
11837
  const G = performance.now(), X = G - j.staticGeometryLastUpdate, O = j.autoUpdateMeshBvhInterval ?? 100;
11834
- (B || X > O) && (Zt && console.warn(`Physics: updating skinned mesh bvh for ${w.name} after ${X.toFixed(2)}ms`), j.bvhNeedsUpdate = !1, j.staticGeometryLastUpdate = G, j.staticGenerator?.generate(j.staticGeometry), I.boundsTree.refit());
11838
+ (B || X > O) && (Kt && console.warn(`Physics: updating skinned mesh bvh for ${w.name} after ${X.toFixed(2)}ms`), j.bvhNeedsUpdate = !1, j.staticGeometryLastUpdate = G, j.staticGenerator?.generate(j.staticGeometry), I.boundsTree.refit());
11835
11839
  }
11836
11840
  } else if (!I.boundsTree) {
11837
11841
  h || v();
@@ -11851,30 +11855,30 @@ var eu;
11851
11855
  }
11852
11856
  if (B != null && !B.running) {
11853
11857
  const G = w.name;
11854
- Zt && console.log("<<<< worker start", G, B), I[p] = "queued", performance.mark("bvh.create.start");
11858
+ Kt && console.log("<<<< worker start", G, B), I[p] = "queued", performance.mark("bvh.create.start");
11855
11859
  const X = I.clone();
11856
11860
  try {
11857
11861
  B.generate(X).then((O) => {
11858
11862
  I[p] = "done", I.boundsTree = O;
11859
11863
  }).catch((O) => {
11860
- I[p] = "failed - " + O?.message, I[g] = !1, Zt && console.error("Failed to generate mesh bvh on worker", O);
11864
+ I[p] = "failed - " + O?.message, I[g] = !1, Kt && console.error("Failed to generate mesh bvh on worker", O);
11861
11865
  }).finally(() => {
11862
- Zt && console.log(">>>>> worker done", G, { hasBoundsTre: I.boundsTree != null }), m.push(B), X.dispose(), performance.mark("bvh.create.end"), performance.measure("bvh.create (worker)", "bvh.create.start", "bvh.create.end");
11866
+ Kt && console.log(">>>>> worker done", G, { hasBoundsTre: I.boundsTree != null }), m.push(B), X.dispose(), performance.mark("bvh.create.end"), performance.measure("bvh.create (worker)", "bvh.create.start", "bvh.create.end");
11863
11867
  });
11864
11868
  } catch (O) {
11865
11869
  console.error("Failed to generate mesh bvh on worker", O);
11866
11870
  }
11867
11871
  } else
11868
- Zt && console.warn("No worker available");
11872
+ Kt && console.warn("No worker available");
11869
11873
  }
11870
11874
  } else (!d || !j) && (l(), o && (performance.mark("bvh.create.start"), I.boundsTree = new o(I), performance.mark("bvh.create.end"), performance.measure("bvh.create", "bvh.create.start", "bvh.create.end")));
11871
11875
  }
11872
11876
  if (b instanceof ku) {
11873
11877
  const j = b, B = w.raycast;
11874
11878
  if (I.boundsTree)
11875
- l(), n && (w.acceleratedRaycast || (w.acceleratedRaycast = n.bind(w), Zt && console.debug(`Physics: bind acceleratedRaycast fn to "${w.name}"`)), w.raycast = w.acceleratedRaycast);
11876
- else if (Zt && console.warn("No bounds tree found for mesh", w.name, { workerTask: I[p], hasAcceleratedRaycast: n != null }), M.allowSlowRaycastFallback === !1 && (I.getAttribute("position")?.array?.length ?? 0) > 2e3)
11877
- return Zt && console.warn("Skipping raycast because no bounds tree is available and allowSlowRaycastFallback is false"), !1;
11879
+ l(), n && (w.acceleratedRaycast || (w.acceleratedRaycast = n.bind(w), Kt && console.debug(`Physics: bind acceleratedRaycast fn to "${w.name}"`)), w.raycast = w.acceleratedRaycast);
11880
+ else if (Kt && console.warn("No bounds tree found for mesh", w.name, { workerTask: I[p], hasAcceleratedRaycast: n != null }), M.allowSlowRaycastFallback === !1 && (I.getAttribute("position")?.array?.length ?? 0) > 2e3)
11881
+ return Kt && console.warn("Skipping raycast because no bounds tree is available and allowSlowRaycastFallback is false"), !1;
11878
11882
  const G = j.firstHitOnly;
11879
11883
  return j.firstHitOnly = !1, j.intersectObject(w, !1, T), j.firstHitOnly = G, w.raycast = B, !0;
11880
11884
  } else if (b instanceof xu) {
@@ -11896,17 +11900,17 @@ var eu;
11896
11900
  i || (i = !0, import("./vendor-D-7l5gB0.js").then((b) => b.index$1).then((b) => {
11897
11901
  n = b.acceleratedRaycast, o = b.MeshBVH, r = b.StaticGeometryGenerator, a = b.computeBoundsTree;
11898
11902
  }).catch((b) => {
11899
- (Zt || L()) && console.error("Failed to load BVH library...", b.message);
11903
+ (Kt || L()) && console.error("Failed to load BVH library...", b.message);
11900
11904
  }));
11901
11905
  }
11902
11906
  const c = new ee();
11903
11907
  let h = !1, d = !1, f = null;
11904
11908
  const p = /* @__PURE__ */ Symbol("Needle:MeshBVH-Worker"), g = /* @__PURE__ */ Symbol("Needle:MeshBVH-CanUseWorker"), y = [], m = [];
11905
11909
  function v() {
11906
- h = !0, d = !0, Promise.resolve().then(() => CD).then((b) => {
11910
+ h = !0, d = !0, Promise.resolve().then(() => C2).then((b) => {
11907
11911
  f = b.GenerateMeshBVHWorker;
11908
11912
  }).catch((b) => {
11909
- Zt || L() ? console.warn("Failed to setup mesh bvh worker") : console.debug("Failed to setup mesh bvh worker", b);
11913
+ Kt || L() ? console.warn("Failed to setup mesh bvh worker") : console.debug("Failed to setup mesh bvh worker", b);
11910
11914
  }).finally(() => {
11911
11915
  d = !1;
11912
11916
  });
@@ -11976,7 +11980,7 @@ function G0() {
11976
11980
  }
11977
11981
  let $r = !0;
11978
11982
  Fu === 0 && ($r = !1);
11979
- function w2(s) {
11983
+ function wD(s) {
11980
11984
  $r = s;
11981
11985
  }
11982
11986
  function GO() {
@@ -11987,7 +11991,7 @@ function qO(s, e) {
11987
11991
  s && (s[q0] = e, wr && console.warn("Set disposable", e, s));
11988
11992
  }
11989
11993
  const X0 = /* @__PURE__ */ Symbol("disposed");
11990
- function x2(s) {
11994
+ function xD(s) {
11991
11995
  return s[X0] === !0;
11992
11996
  }
11993
11997
  function Ae(s) {
@@ -12004,7 +12008,7 @@ function Ae(s) {
12004
12008
  Ae(s.geometry), Ae(s.material), Ae(s.customDepthMaterial), Ae(s.customDistanceMaterial), s.visible = !1;
12005
12009
  else if (s instanceof R)
12006
12010
  s.visible = !1;
12007
- else if (s instanceof Ki) {
12011
+ else if (s instanceof Zi) {
12008
12012
  na(s);
12009
12013
  for (const e of Object.keys(s.attributes)) {
12010
12014
  const t = s.attributes[e];
@@ -12033,7 +12037,7 @@ function Ae(s) {
12033
12037
  function na(s) {
12034
12038
  s && ((wr || G0() || Fu) && console.warn("🧨 FREE", s), s instanceof ImageBitmap || "dispose" in s && typeof s.dispose == "function" && s.dispose());
12035
12039
  }
12036
- function S2(s) {
12040
+ function SD(s) {
12037
12041
  }
12038
12042
  const XO = /* @__PURE__ */ new Set();
12039
12043
  function Q0(s, e, t = null, i) {
@@ -12044,10 +12048,10 @@ function Q0(s, e, t = null, i) {
12044
12048
  i.has(o) || t?.call(null, o) !== !1 && (i.add(o), e && Q0(o, !0, t, i));
12045
12049
  return i;
12046
12050
  }
12047
- function C2(s) {
12048
- return s[Zl];
12051
+ function CD(s) {
12052
+ return s[Kl];
12049
12053
  }
12050
- const wr = x("debugresourceusers") || x("debugmemory"), Uc = /* @__PURE__ */ Symbol("needle-resource-users"), Zl = /* @__PURE__ */ Symbol("needle-resource-users-count");
12054
+ const wr = x("debugresourceusers") || x("debugmemory"), Uc = /* @__PURE__ */ Symbol("needle-resource-users"), Kl = /* @__PURE__ */ Symbol("needle-resource-users-count");
12051
12055
  function qt(s, e) {
12052
12056
  wg(s, e, function(t, i) {
12053
12057
  $r && !zc.raycasting && (tu(Uc, this, t, !1), tu(Uc, this, i, !0));
@@ -12077,13 +12081,13 @@ function tu(s, e, t, i) {
12077
12081
  if (n || (n = /* @__PURE__ */ new Set()), i) {
12078
12082
  if (e && !n.has(e)) {
12079
12083
  n.add(e);
12080
- let o = t[Zl] || 0;
12081
- o += 1, t[Zl] = o, wr && console.warn(`🟢 Added user of "${t.type}"`, e, t, o, "users:", n);
12084
+ let o = t[Kl] || 0;
12085
+ o += 1, t[Kl] = o, wr && console.warn(`🟢 Added user of "${t.type}"`, e, t, o, "users:", n);
12082
12086
  }
12083
12087
  } else if (e && n.has(e)) {
12084
12088
  n.delete(e);
12085
- let o = t[Zl] || 0;
12086
- o > 0 && (o -= 1, t[Zl] = o), wr && console.warn(`🔴 Removed user of "${t.type}"`, e, t, o, "users:", n), o <= 0 && (Aa.isLoading(t) || (Fu && console.warn(`🔴 Removed all user of "${t.type}"`, t), G0() && Ae(t)));
12089
+ let o = t[Kl] || 0;
12090
+ o > 0 && (o -= 1, t[Kl] = o), wr && console.warn(`🔴 Removed user of "${t.type}"`, e, t, o, "users:", n), o <= 0 && (Aa.isLoading(t) || (Fu && console.warn(`🔴 Removed all user of "${t.type}"`, t), G0() && Ae(t)));
12087
12091
  }
12088
12092
  t[s] = n;
12089
12093
  }
@@ -12101,7 +12105,7 @@ try {
12101
12105
  } catch (s) {
12102
12106
  console.warn("Could not wrap WebGLRenderer.render", s);
12103
12107
  }
12104
- const Nc = /* @__PURE__ */ Symbol("NEEDLE_NEED_UPDATE_INSTANCE"), Y0 = /* @__PURE__ */ Symbol("isUsingInstancing"), K0 = /* @__PURE__ */ Symbol("instancingRenderer"), Jl = /* @__PURE__ */ Symbol("instancingAutoUpdateBounds");
12108
+ const Nc = /* @__PURE__ */ Symbol("NEEDLE_NEED_UPDATE_INSTANCE"), Y0 = /* @__PURE__ */ Symbol("isUsingInstancing"), Z0 = /* @__PURE__ */ Symbol("instancingRenderer"), Jl = /* @__PURE__ */ Symbol("instancingAutoUpdateBounds");
12105
12109
  class xn {
12106
12110
  /** Is this object rendered using a InstancedMesh */
12107
12111
  static isUsingInstancing(e) {
@@ -12111,7 +12115,7 @@ class xn {
12111
12115
  * @link https://threejs.org/docs/#api/en/objects/InstancedMesh
12112
12116
  */
12113
12117
  static getRenderer(e) {
12114
- return e[K0] || null;
12118
+ return e[Z0] || null;
12115
12119
  }
12116
12120
  setAutoUpdateBounds(e, t) {
12117
12121
  const i = xn.getRenderer(e);
@@ -12125,24 +12129,24 @@ class xn {
12125
12129
  xn.markDirty(i, !0);
12126
12130
  }
12127
12131
  }
12128
- const Z0 = /* @__PURE__ */ new Map();
12132
+ const K0 = /* @__PURE__ */ new Map();
12129
12133
  function YO(s, e) {
12130
12134
  if (!s) return;
12131
12135
  if (!e) {
12132
12136
  console.warn("No prototype found", s, s.prototype, s.constructor);
12133
12137
  return;
12134
12138
  }
12135
- const t = Z0.get(e);
12139
+ const t = K0.get(e);
12136
12140
  t && t.apply(s);
12137
12141
  }
12138
12142
  function J0(s) {
12139
- const e = KO(s.prototype);
12140
- Z0.set(s, e);
12143
+ const e = ZO(s.prototype);
12144
+ K0.set(s, e);
12141
12145
  }
12142
- function KO(s) {
12143
- return new ZO(s);
12146
+ function ZO(s) {
12147
+ return new KO(s);
12144
12148
  }
12145
- class ZO {
12149
+ class KO {
12146
12150
  $symbol;
12147
12151
  extensions;
12148
12152
  descriptors;
@@ -12236,7 +12240,7 @@ function JO() {
12236
12240
  return this instanceof Jy ? ve(this.object) : ve(this);
12237
12241
  },
12238
12242
  set: function(i) {
12239
- Kn(this, i);
12243
+ Zn(this, i);
12240
12244
  }
12241
12245
  }), Object.getOwnPropertyDescriptor(R.prototype, "worldRotation") || Object.defineProperty(R.prototype, "worldRotation", {
12242
12246
  get: function() {
@@ -12319,7 +12323,7 @@ function ew(s, e) {
12319
12323
  return Ac(s, e, !0, !0);
12320
12324
  }
12321
12325
  const tw = /* @__PURE__ */ Symbol("isDestroyed");
12322
- function Ka(s) {
12326
+ function Za(s) {
12323
12327
  return s[tw];
12324
12328
  }
12325
12329
  function iR(s, e) {
@@ -12365,7 +12369,7 @@ function Sm(s, e = !0, t = !0) {
12365
12369
  Sm(r, e, !1);
12366
12370
  t && n.removeFromParent();
12367
12371
  }
12368
- function Za(s, e, t = !0) {
12372
+ function Ka(s, e, t = !0) {
12369
12373
  return iw(s, e, t);
12370
12374
  }
12371
12375
  function* Fg(s, e, t = !1, i = 999, n = 0) {
@@ -12943,7 +12947,7 @@ function mR(s, e, t = void 0) {
12943
12947
  const Co = x("debughotreload");
12944
12948
  let $c = !1;
12945
12949
  const vc = /* @__PURE__ */ new Map();
12946
- function P2() {
12950
+ function PD() {
12947
12951
  return $c;
12948
12952
  }
12949
12953
  function ub() {
@@ -12985,7 +12989,7 @@ function _R() {
12985
12989
  s.apply(console, e);
12986
12990
  };
12987
12991
  }
12988
- function k2(s) {
12992
+ function kD(s) {
12989
12993
  Co && console.log("[HMR] Apply changes", s, Object.keys(s)), _R();
12990
12994
  for (const e of Object.keys(s))
12991
12995
  try {
@@ -13047,7 +13051,7 @@ class C extends R {
13047
13051
  * @returns True if the GameObject has been destroyed
13048
13052
  */
13049
13053
  static isDestroyed(e) {
13050
- return Ka(e);
13054
+ return Za(e);
13051
13055
  }
13052
13056
  /**
13053
13057
  * Sets the active state of a GameObject
@@ -13098,7 +13102,7 @@ class C extends R {
13098
13102
  * @returns The last return value of the callback
13099
13103
  */
13100
13104
  static foreachComponent(e, t, i = !0) {
13101
- return Za(e, t, i);
13105
+ return Ka(e, t, i);
13102
13106
  }
13103
13107
  /**
13104
13108
  * Creates a new instance of the provided object that will be replicated to all connected clients
@@ -13630,7 +13634,7 @@ class E {
13630
13634
  * @param val The world rotation quaternion to set
13631
13635
  */
13632
13636
  set worldQuaternion(e) {
13633
- Kn(this.gameObject, e);
13637
+ Zn(this.gameObject, e);
13634
13638
  }
13635
13639
  /**
13636
13640
  * Sets the rotation of this component's GameObject in world space using quaternion components
@@ -13737,7 +13741,7 @@ class E {
13737
13741
  return !1;
13738
13742
  }
13739
13743
  }
13740
- const O2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
13744
+ const OD = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
13741
13745
  __proto__: null,
13742
13746
  Behaviour: E,
13743
13747
  Component: E,
@@ -13748,7 +13752,7 @@ var bR = Object.defineProperty, vR = Object.getOwnPropertyDescriptor, Wr = (s, e
13748
13752
  (r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
13749
13753
  return i && n && bR(e, t, n), n;
13750
13754
  };
13751
- const Ks = x("debuganimation");
13755
+ const Zs = x("debuganimation");
13752
13756
  let cw = class {
13753
13757
  x;
13754
13758
  y;
@@ -13801,7 +13805,7 @@ class ii extends E {
13801
13805
  */
13802
13806
  set clip(e) {
13803
13807
  if (!this.__didAwake) {
13804
- Ks && console.warn("Assign clip during serialization", e), this._tempAnimationClipBeforeGameObjectExisted = e;
13808
+ Zs && console.warn("Assign clip during serialization", e), this._tempAnimationClipBeforeGameObjectExisted = e;
13805
13809
  return;
13806
13810
  }
13807
13811
  e && (this.gameObject.animations || (this.gameObject.animations = []), !this.animations.includes(e) && (this.animations.length > 0 ? this.animations.splice(0, 0, e) : this.animations.push(e)));
@@ -13830,7 +13834,7 @@ class ii extends E {
13830
13834
  _handles;
13831
13835
  /** @internal */
13832
13836
  awake() {
13833
- this.mixer = void 0, Ks && console.log("Animation Awake", this.name, this), this._tempAnimationsArray && (this.animations = this._tempAnimationsArray, this._tempAnimationsArray = void 0), this._tempAnimationClipBeforeGameObjectExisted && (this.clip = this._tempAnimationClipBeforeGameObjectExisted, this._tempAnimationClipBeforeGameObjectExisted = null), this.actions = [], this._handles = [];
13837
+ this.mixer = void 0, Zs && console.log("Animation Awake", this.name, this), this._tempAnimationsArray && (this.animations = this._tempAnimationsArray, this._tempAnimationsArray = void 0), this._tempAnimationClipBeforeGameObjectExisted && (this.clip = this._tempAnimationClipBeforeGameObjectExisted, this._tempAnimationClipBeforeGameObjectExisted = null), this.actions = [], this._handles = [];
13834
13838
  }
13835
13839
  /** @internal */
13836
13840
  onEnable() {
@@ -13885,7 +13889,7 @@ class ii extends E {
13885
13889
  return;
13886
13890
  } else if (typeof e == "number") {
13887
13891
  if (e >= this.animations.length) {
13888
- Ks && console.log("No animation at index", e);
13892
+ Zs && console.log("No animation at index", e);
13889
13893
  return;
13890
13894
  }
13891
13895
  e = this.animations[e];
@@ -13913,7 +13917,7 @@ class ii extends E {
13913
13917
  return;
13914
13918
  } else if (typeof e == "number") {
13915
13919
  if (e >= this.animations.length) {
13916
- Ks && console.log("No animation at index", e);
13920
+ Zs && console.log("No animation at index", e);
13917
13921
  return;
13918
13922
  }
13919
13923
  e = this.animations[e];
@@ -13944,15 +13948,15 @@ class ii extends E {
13944
13948
  * @returns a promise that resolves when the animation is finished (note that it will not resolve if the animation is looping)
13945
13949
  */
13946
13950
  play(e = 0, t) {
13947
- if (Ks && console.log("PLAY", e), this.ensureMixer(), !this.mixer) {
13948
- Ks && console.warn("Missing mixer", this);
13951
+ if (Zs && console.log("PLAY", e), this.ensureMixer(), !this.mixer) {
13952
+ Zs && console.warn("Missing mixer", this);
13949
13953
  return;
13950
13954
  }
13951
13955
  e === void 0 && (e = 0);
13952
13956
  let i = e;
13953
13957
  if (typeof e == "number") {
13954
13958
  if (e >= this.animations.length) {
13955
- Ks && console.log("No animation at index", e);
13959
+ Zs && console.log("No animation at index", e);
13956
13960
  return;
13957
13961
  }
13958
13962
  i = this.animations[e];
@@ -13987,7 +13991,7 @@ class ii extends E {
13987
13991
  const r = e.getClip();
13988
13992
  e.time = F.lerp(t.minMaxOffsetNormalized.x, t.minMaxOffsetNormalized.y, Math.random()) * r.duration;
13989
13993
  } else e.time >= e.getClip().duration && (e.time = 0);
13990
- t?.minMaxSpeed ? e.timeScale = F.lerp(t.minMaxSpeed.x, t.minMaxSpeed.y, Math.random()) : e.timeScale = t?.speed ?? 1, t?.loop != null ? e.loop = t.loop ? ES : Kp : e.loop = Kp, t?.clampWhenFinished && (e.clampWhenFinished = !0), e.paused = !1, e.play(), window.requestAnimationFrame(() => Fs.testIfRootCanAnimate(e)), Ks && console.log("PLAY", e.getClip().name, e);
13994
+ t?.minMaxSpeed ? e.timeScale = F.lerp(t.minMaxSpeed.x, t.minMaxSpeed.y, Math.random()) : e.timeScale = t?.speed ?? 1, t?.loop != null ? e.loop = t.loop ? ES : Zp : e.loop = Zp, t?.clampWhenFinished && (e.clampWhenFinished = !0), e.paused = !1, e.play(), window.requestAnimationFrame(() => Fs.testIfRootCanAnimate(e)), Zs && console.log("PLAY", e.getClip().name, e);
13991
13995
  const o = new wR(e, this.mixer, t, (r) => {
13992
13996
  this._handles.splice(this._handles.indexOf(o), 1);
13993
13997
  });
@@ -14072,7 +14076,7 @@ function xR(s) {
14072
14076
  const e = s[kd];
14073
14077
  return e !== void 0 && e.size > 0;
14074
14078
  }
14075
- class M2 {
14079
+ class MD {
14076
14080
  _context;
14077
14081
  get context() {
14078
14082
  return this._context ?? N.Current;
@@ -14566,7 +14570,7 @@ Exit Time: ` + c, o.hasExitTime);
14566
14570
  } else typeof e.cycleOffset == "number" && (i += e.cycleOffset, i %= 1);
14567
14571
  l.isRunning() && l.stop(), l.reset(), l.enabled = !0, this.setTimescale(l, e);
14568
14572
  const h = e.motion.clip.duration;
14569
- if (l.time = o ? 0 : i * h, l.timeScale < 0 && (l.time = h - l.time), l.clampWhenFinished = !0, l.setLoop(Kp, 0), t > 0 ? l.fadeIn(t) : l.weight = 1, l.play(), window.requestAnimationFrame(() => Fs.testIfRootCanAnimate(l)), this.rootMotionHandler && this.rootMotionHandler.onStart(l), this._activeStates.includes(e) || this._activeStates.push(e), this._activeState.behaviours) {
14573
+ if (l.time = o ? 0 : i * h, l.timeScale < 0 && (l.time = h - l.time), l.clampWhenFinished = !0, l.setLoop(Zp, 0), t > 0 ? l.fadeIn(t) : l.weight = 1, l.play(), window.requestAnimationFrame(() => Fs.testIfRootCanAnimate(l)), this.rootMotionHandler && this.rootMotionHandler.onStart(l), this._activeStates.includes(e) || this._activeStates.push(e), this._activeState.behaviours) {
14570
14574
  const d = new qh(e, i, h, this._speed);
14571
14575
  for (const f of this._activeState.behaviours)
14572
14576
  f.instance?.onStateEnter?.call(f.instance, this.animator, d, n);
@@ -15289,15 +15293,23 @@ class MR extends rn {
15289
15293
  super([re, ae], "ColorSerializer");
15290
15294
  }
15291
15295
  onDeserialize(e) {
15292
- if (e != null)
15293
- return e.a !== void 0 ? new ae(e.r, e.g, e.b, e.a) : e.alpha !== void 0 ? new ae(e.r, e.g, e.b, e.alpha) : new re(e.r, e.g, e.b);
15296
+ if (e == null) return;
15297
+ const t = (r, a) => (typeof r != "number" && (r = parseFloat(r)), Number.isNaN(r) ? a : r === 1 / 0 ? 1e6 : r === -1 / 0 ? -1e6 : r), i = t(e.r, 0), n = t(e.g, 0), o = t(e.b, 0);
15298
+ if (e.a !== void 0) {
15299
+ const r = t(e.a, 1);
15300
+ return new ae(i, n, o, r);
15301
+ } else if (e.alpha !== void 0) {
15302
+ const r = t(e.alpha, 1);
15303
+ return new ae(i, n, o, r);
15304
+ }
15305
+ return new re(i, n, o);
15294
15306
  }
15295
15307
  onSerialize(e) {
15296
15308
  if (e != null)
15297
15309
  return e.a !== void 0 ? { r: e.r, g: e.g, b: e.b, a: e.a } : { r: e.r, g: e.g, b: e.b };
15298
15310
  }
15299
15311
  }
15300
- const E2 = new MR();
15312
+ const ED = new MR();
15301
15313
  class ER extends rn {
15302
15314
  constructor() {
15303
15315
  super([dt], "EulerSerializer");
@@ -15314,7 +15326,7 @@ class ER extends rn {
15314
15326
  return { x: e.x, y: e.y, z: e.z, order: e.order };
15315
15327
  }
15316
15328
  }
15317
- const T2 = new ER();
15329
+ const TD = new ER();
15318
15330
  class TR extends rn {
15319
15331
  constructor() {
15320
15332
  super(R, "ObjectSerializer");
@@ -15492,7 +15504,7 @@ Could not find method ${r.method} on object ${l.name}`, l, typeof l[r.method]);
15492
15504
  // };
15493
15505
  // }
15494
15506
  }
15495
- const A2 = new LR(), su = /* @__PURE__ */ new WeakMap(), DR = xe.prototype.clone;
15507
+ const AD = new LR(), su = /* @__PURE__ */ new WeakMap(), DR = xe.prototype.clone;
15496
15508
  xe.prototype.clone = function() {
15497
15509
  const s = DR.call(this);
15498
15510
  return su.has(s) || su.set(s, this), s;
@@ -15746,7 +15758,7 @@ const UR = `
15746
15758
  }
15747
15759
  `;
15748
15760
  function $R(s) {
15749
- if (K.active)
15761
+ if (Z.active)
15750
15762
  return console.warn("[OrbitControls] Can not fit camera while XR session is active"), null;
15751
15763
  const e = N.Current;
15752
15764
  if (!e)
@@ -15911,7 +15923,7 @@ function WR(s, e, t, i, n) {
15911
15923
  if (this[r] === void 0) {
15912
15924
  this[r] = this[o];
15913
15925
  const l = this[o];
15914
- if (l instanceof Z || l instanceof _ || l instanceof ye || l instanceof V) {
15926
+ if (l instanceof K || l instanceof _ || l instanceof ye || l instanceof V) {
15915
15927
  const c = this[o];
15916
15928
  gg(c, () => {
15917
15929
  this.onValidate(o);
@@ -15936,7 +15948,7 @@ function WR(s, e, t, i, n) {
15936
15948
  };
15937
15949
  }
15938
15950
  }
15939
- const L2 = function(s) {
15951
+ const LD = function(s) {
15940
15952
  return function(e, t, i) {
15941
15953
  let n = "";
15942
15954
  typeof t == "string" ? n = t : n = t.name;
@@ -16640,7 +16652,7 @@ class Ja extends Vc {
16640
16652
  */
16641
16653
  static allow = !0;
16642
16654
  performRaycast(e) {
16643
- if (!K.active || !Ja.allow || !e?.ray) return null;
16655
+ if (!Z.active || !Ja.allow || !e?.ray) return null;
16644
16656
  const t = e.ray.origin;
16645
16657
  return this.context.physics.sphereOverlap(t, 0.015, !1, !0);
16646
16658
  }
@@ -16656,14 +16668,14 @@ class fw {
16656
16668
  const i = this.tryFindCanvasGroup(e);
16657
16669
  if (i?.isCanvasGroup === !0 && (t && (t.canvasGroup = i), i.blocksRaycasts === !1 || i.interactable === !1))
16658
16670
  return !1;
16659
- const n = Za(e, (o) => {
16671
+ const n = Ka(e, (o) => {
16660
16672
  if (o.isGraphic === !0) return o;
16661
16673
  }, !1);
16662
16674
  return t && n?.isGraphic === !0 && (t.graphic = n), !(n?.raycastTarget === !1 || n?.layer === 2);
16663
16675
  }
16664
16676
  static tryFindCanvasGroup(e) {
16665
16677
  if (!e) return null;
16666
- const t = Za(e, (i) => {
16678
+ const t = Ka(e, (i) => {
16667
16679
  if (i.activeAndEnabled) {
16668
16680
  const n = i;
16669
16681
  if (n.blocksRaycasts !== void 0 && n.interactable !== void 0) return n;
@@ -17105,10 +17117,10 @@ class jl {
17105
17117
  return e ? e.isBlock || e.isText ? e : this.findBlockOrTextInParent(e.parent) : null;
17106
17118
  }
17107
17119
  }
17108
- var KR = Object.defineProperty, Hg = (s, e, t, i) => {
17120
+ var ZR = Object.defineProperty, Hg = (s, e, t, i) => {
17109
17121
  for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
17110
17122
  (r = s[o]) && (n = r(e, t, n) || n);
17111
- return n && KR(e, t, n), n;
17123
+ return n && ZR(e, t, n), n;
17112
17124
  };
17113
17125
  class il extends E {
17114
17126
  constraintActive = !0;
@@ -17133,10 +17145,10 @@ Hg([
17133
17145
  Hg([
17134
17146
  u(R)
17135
17147
  ], il.prototype, "sources");
17136
- var ZR = Object.defineProperty, JR = Object.getOwnPropertyDescriptor, Pe = (s, e, t, i) => {
17148
+ var KR = Object.defineProperty, JR = Object.getOwnPropertyDescriptor, Pe = (s, e, t, i) => {
17137
17149
  for (var n = i > 1 ? void 0 : i ? JR(e, t) : e, o = s.length - 1, r; o >= 0; o--)
17138
17150
  (r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
17139
- return i && n && ZR(e, t, n), n;
17151
+ return i && n && KR(e, t, n), n;
17140
17152
  };
17141
17153
  const St = x("debugorbit"), up = x("freecam"), eM = x("debugcamerafit"), Yh = x("smoothcam"), tM = { LEFT: "", UP: "", RIGHT: "", BOTTOM: "" };
17142
17154
  let fp;
@@ -17433,7 +17445,7 @@ class me extends E {
17433
17445
  }
17434
17446
  if (!this.setLookTargetFromConstraint()) {
17435
17447
  const i = new Nr();
17436
- i.screenPoint = new Z(0, 0), i.lineThreshold = 0.1;
17448
+ i.screenPoint = new K(0, 0), i.lineThreshold = 0.1;
17437
17449
  const n = this.context.physics.raycast(i);
17438
17450
  n.length > 0 && this.setLookTargetPosition(n[0].point, !0), eM && console.log("OrbitControls hits", ...n);
17439
17451
  }
@@ -18321,7 +18333,7 @@ const Ct = x("debugaudio"), an = class ho extends E {
18321
18333
  }
18322
18334
  /** @internal */
18323
18335
  awake() {
18324
- Ct && console.log("[AudioSource]", this), this.audioLoader = new Zp(), this.playOnAwake && (this.shouldPlay = !0), this.preload && typeof this.clip == "string" && this.audioLoader.load(this.clip, this.createAudio, () => {
18336
+ Ct && console.log("[AudioSource]", this), this.audioLoader = new Kp(), this.playOnAwake && (this.shouldPlay = !0), this.preload && typeof this.clip == "string" && this.audioLoader.load(this.clip, this.createAudio, () => {
18325
18337
  }, console.error);
18326
18338
  }
18327
18339
  /** @internal */
@@ -18384,7 +18396,7 @@ const Ct = x("debugaudio"), an = class ho extends E {
18384
18396
  async onNewClip(e) {
18385
18397
  if (e && (this.clip = e), typeof e == "string")
18386
18398
  if (Ct && console.log(e), e.endsWith(".mp3") || e.endsWith(".wav")) {
18387
- if (this.audioLoader || (this.audioLoader = new Zp()), this.shouldPlay = !0, this._lastClipStartedLoading === e) {
18399
+ if (this.audioLoader || (this.audioLoader = new Kp()), this.shouldPlay = !0, this._lastClipStartedLoading === e) {
18388
18400
  Ct && console.log("Is currently loading:", this._lastClipStartedLoading, this);
18389
18401
  return;
18390
18402
  }
@@ -18934,7 +18946,7 @@ class bo extends oh {
18934
18946
  bo._audioBuffers.clear();
18935
18947
  }
18936
18948
  handleAudioLoading(e, t) {
18937
- this._audioLoader || (this._audioLoader = new Zp());
18949
+ this._audioLoader || (this._audioLoader = new Kp());
18938
18950
  const i = this.getAudioFilePath(e.asset.clip);
18939
18951
  if (bo._audioBuffers.get(i)) {
18940
18952
  const o = bo._audioBuffers.get(i);
@@ -19093,7 +19105,7 @@ const un = x("debugtimeline"), Qg = class Am extends E {
19093
19105
  return this._time;
19094
19106
  }
19095
19107
  set time(e) {
19096
- typeof e == "number" && !Number.isNaN(e) ? this._time = e : (un || Zi()) && console.error("INVALID TIMELINE.TIME VALUE", e, this.name);
19108
+ typeof e == "number" && !Number.isNaN(e) ? this._time = e : (un || Ki()) && console.error("INVALID TIMELINE.TIME VALUE", e, this.name);
19097
19109
  }
19098
19110
  /** The total duration of the timeline in seconds (read from the longest track/clip). */
19099
19111
  get duration() {
@@ -19758,7 +19770,7 @@ function wb(s, e) {
19758
19770
  console.warn("Missing camera object, can not add orbit controls");
19759
19771
  }
19760
19772
  async function Im(s) {
19761
- const { NeedleEngineWebComponent: e } = await Promise.resolve().then(() => fD);
19773
+ const { NeedleEngineWebComponent: e } = await Promise.resolve().then(() => f2);
19762
19774
  e.observedAttributes.includes(s) || e.observedAttributes.push(s);
19763
19775
  }
19764
19776
  var yM = Object.defineProperty, bt = (s, e, t, i) => {
@@ -19770,7 +19782,7 @@ const mt = x("debugsceneswitcher"), _M = x("sceneswitcher:clearscene"), Rd = "sc
19770
19782
  function bM() {
19771
19783
  Im(Rd);
19772
19784
  }
19773
- const Zs = Promise.resolve(!1);
19785
+ const Ks = Promise.resolve(!1);
19774
19786
  class nt extends E {
19775
19787
  autoLoadFirstScene = !0;
19776
19788
  scenes = [];
@@ -19965,14 +19977,14 @@ class nt extends E {
19965
19977
  return this.switchScene(n);
19966
19978
  }
19967
19979
  if (i) e = this.scenes?.indexOf(i);
19968
- else return Zs;
19980
+ else return Ks;
19969
19981
  }
19970
- if (!this.scenes?.length) return Zs;
19982
+ if (!this.scenes?.length) return Ks;
19971
19983
  if (e < 0) {
19972
- if (this.clamp) return Zs;
19984
+ if (this.clamp) return Ks;
19973
19985
  e = this.scenes.length - 1;
19974
19986
  } else if (e >= this.scenes.length) {
19975
- if (this.clamp) return Zs;
19987
+ if (this.clamp) return Ks;
19976
19988
  e = 0;
19977
19989
  }
19978
19990
  const t = this.scenes[e];
@@ -20095,12 +20107,12 @@ class nt extends E {
20095
20107
  if (t instanceof ne)
20096
20108
  return t.preload();
20097
20109
  }
20098
- return Zs;
20110
+ return Ks;
20099
20111
  }
20100
20112
  tryLoadFromQueryParam() {
20101
- if (!this.queryParameterName?.length) return Zs;
20113
+ if (!this.queryParameterName?.length) return Ks;
20102
20114
  const e = x(this.queryParameterName);
20103
- return typeof e == "boolean" ? Zs : this.trySelectSceneFromValue(e);
20115
+ return typeof e == "boolean" ? Ks : this.trySelectSceneFromValue(e);
20104
20116
  }
20105
20117
  /** try to select a scene from a string or index */
20106
20118
  trySelectSceneFromValue(e) {
@@ -20119,7 +20131,7 @@ class nt extends E {
20119
20131
  }
20120
20132
  } else if (typeof e == "number" && e >= 0 && e < this.scenes.length)
20121
20133
  return this.select(e);
20122
- return Zi() && console.warn('[SceneSwitcher] Can not find scene: "' + e + '"', this), Zs;
20134
+ return Ki() && console.warn('[SceneSwitcher] Can not find scene: "' + e + '"', this), Ks;
20123
20135
  }
20124
20136
  _lastLoadingScene = void 0;
20125
20137
  _loadingScenePromise = void 0;
@@ -20346,7 +20358,7 @@ class xM {
20346
20358
  delete this._syncers[e[pp]];
20347
20359
  }
20348
20360
  }
20349
- const Kg = new xM();
20361
+ const Zg = new xM();
20350
20362
  class SM {
20351
20363
  comp;
20352
20364
  constructor(e) {
@@ -20406,12 +20418,12 @@ const Sc = /* @__PURE__ */ Symbol("AutoSyncHandler");
20406
20418
  function PM(s) {
20407
20419
  if (s[Sc])
20408
20420
  return s[Sc];
20409
- const e = Kg.getOrCreateSyncer(s);
20421
+ const e = Zg.getOrCreateSyncer(s);
20410
20422
  return e?.init(s), s[Sc] = e, e;
20411
20423
  }
20412
20424
  function kM(s) {
20413
20425
  const e = s[Sc];
20414
- e && (Kg.removeSyncer(e), e.destroy(), delete s[Sc]);
20426
+ e && (Zg.removeSyncer(e), e.destroy(), delete s[Sc]);
20415
20427
  }
20416
20428
  const yw = function(s = null) {
20417
20429
  return function(e, t) {
@@ -20429,7 +20441,7 @@ const yw = function(s = null) {
20429
20441
  r.__internalAwake = function() {
20430
20442
  if (this[l] !== void 0)
20431
20443
  return;
20432
- if (this[l] = this[i], n = Kg.getOrCreateSyncer(this), Object.getOwnPropertyDescriptor(this, i)?.set === void 0) {
20444
+ if (this[l] = this[i], n = Zg.getOrCreateSyncer(this), Object.getOwnPropertyDescriptor(this, i)?.set === void 0) {
20433
20445
  let d = !1;
20434
20446
  Object.defineProperty(this, i, {
20435
20447
  set: function(f) {
@@ -20460,13 +20472,13 @@ const yw = function(s = null) {
20460
20472
  kM(this), c.call(this);
20461
20473
  };
20462
20474
  };
20463
- }, Kh = /* @__PURE__ */ new Map();
20475
+ }, Zh = /* @__PURE__ */ new Map();
20464
20476
  function _w(s, e) {
20465
- if (Kh.has(s))
20466
- return Kh.get(s);
20477
+ if (Zh.has(s))
20478
+ return Zh.get(s);
20467
20479
  const t = new URL(s, window.location.href), i = OM(t, e);
20468
- return Kh.set(s, i), i.finally(() => {
20469
- Kh.delete(s);
20480
+ return Zh.set(s, i), i.finally(() => {
20481
+ Zh.delete(s);
20470
20482
  }), i;
20471
20483
  }
20472
20484
  async function OM(s, e) {
@@ -20521,7 +20533,7 @@ const Sb = {
20521
20533
  function Cb(s, e, t, i, n) {
20522
20534
  if (e === "transparent" || e?.startsWith("rgb") || e?.startsWith("#"))
20523
20535
  return console.warn(`Needle Engine: Invalid ${n} value (${e}). Did you mean to set background-color instead?`), null;
20524
- const o = new Zg();
20536
+ const o = new Kg();
20525
20537
  o.sourceId = v1(e), o.allowDrop = !1, o.allowNetworking = !1, o.background = t, o.environment = i, C.addComponent(s.scene, o);
20526
20538
  const r = (a) => {
20527
20539
  if (Jt && console.log(n, "CHANGED TO", a), a) {
@@ -20536,7 +20548,7 @@ function Cb(s, e, t, i, n) {
20536
20548
  }
20537
20549
  };
20538
20550
  return Yv(s.domElement, n, r), o.addEventListener("destroy", () => {
20539
- Jt && console.log("Destroyed attribute remote skybox", n), Kv(s.domElement, n, r);
20551
+ Jt && console.log("Destroyed attribute remote skybox", n), Zv(s.domElement, n, r);
20540
20552
  }), o.setSkybox(e);
20541
20553
  }
20542
20554
  const cu = new Array();
@@ -20681,7 +20693,7 @@ rh([
20681
20693
  rh([
20682
20694
  u()
20683
20695
  ], Tr.prototype, "allowNetworking");
20684
- let Zg = Tr;
20696
+ let Kg = Tr;
20685
20697
  function EM(s, e, t) {
20686
20698
  if (s == null) return null;
20687
20699
  const i = e && !t, n = Sb[s.toLowerCase()];
@@ -21585,7 +21597,7 @@ var GM = Object.defineProperty, ey = (s, e, t, i) => {
21585
21597
  (r = s[o]) && (n = r(e, t, n) || n);
21586
21598
  return n && GM(e, t, n), n;
21587
21599
  };
21588
- const Ku = class Pw extends E {
21600
+ const Zu = class Pw extends E {
21589
21601
  head = null;
21590
21602
  eyes = null;
21591
21603
  target = null;
@@ -21615,14 +21627,14 @@ const Ku = class Pw extends E {
21615
21627
  };
21616
21628
  ey([
21617
21629
  u(R)
21618
- ], Ku.prototype, "head");
21630
+ ], Zu.prototype, "head");
21619
21631
  ey([
21620
21632
  u(R)
21621
- ], Ku.prototype, "eyes");
21633
+ ], Zu.prototype, "eyes");
21622
21634
  ey([
21623
21635
  u(R)
21624
- ], Ku.prototype, "target");
21625
- let kw = Ku;
21636
+ ], Zu.prototype, "target");
21637
+ let kw = Zu;
21626
21638
  var qM = Object.defineProperty, ty = (s, e, t, i) => {
21627
21639
  for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
21628
21640
  (r = s[o]) && (n = r(e, t, n) || n);
@@ -21638,7 +21650,7 @@ class ah extends E {
21638
21650
  * If marked as a gizmo, it will only be shown when gizmos are enabled in the global parameters.
21639
21651
  */
21640
21652
  onEnable() {
21641
- if (this.isGizmo && !Zc) return;
21653
+ if (this.isGizmo && !Kc) return;
21642
21654
  this._axes || (this._axes = new Mi(this.length)), this._axes.layers.disableAll(), this._axes.layers.set(this.layer), this.gameObject.add(this._axes);
21643
21655
  const e = this._axes.material;
21644
21656
  e && e.depthTest !== void 0 && (e.depthTest = this.depthTest);
@@ -21968,10 +21980,10 @@ gi([
21968
21980
  gi([
21969
21981
  u()
21970
21982
  ], Mo.prototype, "height");
21971
- var KM = Object.defineProperty, Ws = (s, e, t, i) => {
21983
+ var ZM = Object.defineProperty, Ws = (s, e, t, i) => {
21972
21984
  for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
21973
21985
  (r = s[o]) && (n = r(e, t, n) || n);
21974
- return n && KM(e, t, n), n;
21986
+ return n && ZM(e, t, n), n;
21975
21987
  };
21976
21988
  const kb = x("debugcharactercontroller");
21977
21989
  class sl extends E {
@@ -22060,8 +22072,8 @@ class Lo extends E {
22060
22072
  jump() {
22061
22073
  this.jumpInput = !0;
22062
22074
  }
22063
- lookInput = new Z(0, 0);
22064
- moveInput = new Z(0, 0);
22075
+ lookInput = new K(0, 0);
22076
+ moveInput = new K(0, 0);
22065
22077
  jumpInput = !1;
22066
22078
  onBeforeRender() {
22067
22079
  this.handleInput(this.moveInput, this.lookInput, this.jumpInput), this.lookInput.set(0, 0), this.moveInput.set(0, 0), this.jumpInput = !1;
@@ -22120,7 +22132,7 @@ function vs(s, e) {
22120
22132
  s.layers[Mw] = e;
22121
22133
  }
22122
22134
  const Ob = /* @__PURE__ */ Symbol("DidPatchLayers");
22123
- function ZM() {
22135
+ function KM() {
22124
22136
  const s = ko.prototype;
22125
22137
  if (s[Ob]) return;
22126
22138
  s[Ob] = !0;
@@ -22139,7 +22151,7 @@ Cg((s) => {
22139
22151
  const e = s.domElement.getAttribute("contactshadows") || s.domElement.getAttribute("contact-shadows");
22140
22152
  if (e != null && e != "0" && e != "false") {
22141
22153
  console.debug("Auto-creating ContactShadows because of `contactshadows` attribute");
22142
- const t = Zu.auto(s), i = parseFloat(e);
22154
+ const t = Ku.auto(s), i = parseFloat(e);
22143
22155
  isNaN(i) || (t.opacity = i, t.darkness = i);
22144
22156
  }
22145
22157
  });
@@ -22333,7 +22345,7 @@ ol([
22333
22345
  ol([
22334
22346
  u()
22335
22347
  ], Gr.prototype, "backfaceShadows");
22336
- let Zu = Gr;
22348
+ let Ku = Gr;
22337
22349
  const Rb = [], mp = new Array(), eE = x("logstats");
22338
22350
  class Ew extends E {
22339
22351
  onEnable() {
@@ -22676,7 +22688,7 @@ class sE {
22676
22688
  _followObjectStartWorldQuaternion = new V();
22677
22689
  constructor(e, t, i, n) {
22678
22690
  this.context = e.context, this.settings = e, this.gameObject = t, this.handlerA = i, this.handlerB = n, this._followObject = new R(), this._manipulatorObject = new R(), this.context.scene.add(this._manipulatorObject);
22679
- const o = K.active?.rig?.gameObject;
22691
+ const o = Z.active?.rig?.gameObject;
22680
22692
  if (!this.handlerA || !this.handlerB || !this.handlerA.hitPointInLocalSpace || !this.handlerB.hitPointInLocalSpace) {
22681
22693
  console.error("Invalid: MultiTouchDragHandler needs two valid DragPointerHandlers with hitPointInLocalSpace set.");
22682
22694
  return;
@@ -22820,7 +22832,7 @@ class yp {
22820
22832
  this.gameObject.add(this._followObject), this._followObject.matrixAutoUpdate = !1, this._followObject.position.set(0, 0, 0), this._followObject.quaternion.set(0, 0, 0, 1), this._followObject.scale.set(1, 1, 1), this._followObject.updateMatrix(), this._followObject.updateMatrixWorld(!0), e.attach(this._followObject), this._followObjectStartPosition.copy(this._followObject.position), this._followObjectStartQuaternion.copy(this._followObject.quaternion), this._followObjectStartWorldQuaternion.copy(this._followObject.worldQuaternion), this._followObject.updateMatrix(), this._followObject.updateMatrixWorld(!0);
22821
22833
  const t = this._hitPointInLocalSpace.clone();
22822
22834
  this.gameObject.localToWorld(t), this._grabStartDistance = t.distanceTo(e.worldPosition);
22823
- const n = K.active?.rig?.gameObject?.worldScale.x || 1;
22835
+ const n = Z.active?.rig?.gameObject?.worldScale.x || 1;
22824
22836
  this._grabStartDistance /= n, this._totalMovementAlongRayDirection = 0, this._lastDragPosRigSpace = void 0, qn && (z.DrawLine(t, e.worldPosition, 65280, 0.5, !1), z.DrawLabel(e.worldPosition.add(new _(0, 0.1, 0)), this._grabStartDistance.toFixed(2), 0.03, 0.5));
22825
22837
  }
22826
22838
  onDragStart(e) {
@@ -22870,7 +22882,7 @@ class yp {
22870
22882
  if (!this._followObject.parent) return;
22871
22883
  const e = this._followObject.parent;
22872
22884
  this._followObject.updateMatrix();
22873
- const t = e.worldPosition, i = K.active?.rig?.gameObject;
22885
+ const t = e.worldPosition, i = Z.active?.rig?.gameObject;
22874
22886
  i && i.worldToLocal(t), (this._lastDragPosRigSpace === void 0 || i != this._lastRig) && (this._lastDragPosRigSpace = t.clone(), this._lastRig = i), this._tempVec.copy(t).sub(this._lastDragPosRigSpace);
22875
22887
  const n = e.worldForward;
22876
22888
  if (i && (this._tempMat.copy(i.matrixWorld).invert(), n.transformDirection(this._tempMat)), this._totalMovementAlongRayDirection += n.dot(this._tempVec), this._tempVec.x = Math.abs(this._tempVec.x), this._tempVec.y = Math.abs(this._tempVec.y), this._tempVec.z = Math.abs(this._tempVec.z), this._totalMovement.add(this._tempVec), this._lastDragPosRigSpace.copy(t), qn) {
@@ -22950,7 +22962,7 @@ class yp {
22950
22962
 
22951
22963
  Along Ray: ${this._totalMovementAlongRayDirection.toFixed(2)}
22952
22964
 
22953
- Session: ${!!K.active}
22965
+ Session: ${!!Z.active}
22954
22966
 
22955
22967
  Device: ${this._deviceMode}
22956
22968
 
@@ -23008,7 +23020,7 @@ class Lw {
23008
23020
  _rbs = [];
23009
23021
  _groundLine;
23010
23022
  _groundMarker;
23011
- static geometry = new Ki().setFromPoints([new _(0, 0, 0), new _(0, -1, 0)]);
23023
+ static geometry = new Zi().setFromPoints([new _(0, 0, 0), new _(0, -1, 0)]);
23012
23024
  constructor(e) {
23013
23025
  this._camera = e;
23014
23026
  const t = new $a(Lw.geometry), i = t.material;
@@ -23076,7 +23088,7 @@ class Lw {
23076
23088
  }
23077
23089
  }
23078
23090
  var oE = /* @__PURE__ */ ((s) => (s.File_Spawned = "file-spawned", s))(oE || {});
23079
- class j2 {
23091
+ class jD {
23080
23092
  guid;
23081
23093
  file_name;
23082
23094
  file_hash;
@@ -23318,7 +23330,7 @@ class go {
23318
23330
  const o = i[n];
23319
23331
  if (cE(o.layer, e)) {
23320
23332
  _p && console.log(o), setTimeout(() => {
23321
- Zi() && Bg(e.gameObject) && (_e("Stencil not supported on instanced objects"), console.warn("Stencil not supported on instanced objects", e));
23333
+ Ki() && Bg(e.gameObject) && (_e("Stencil not supported on instanced objects"), console.warn("Stencil not supported on instanced objects", e));
23322
23334
  }, 500);
23323
23335
  for (let r = 0; r < e.sharedMaterials.length; r++) {
23324
23336
  let a = e.sharedMaterials[r];
@@ -23364,9 +23376,9 @@ function bp(s) {
23364
23376
  case 4:
23365
23377
  return JS;
23366
23378
  case 6:
23367
- return ZS;
23368
- case 7:
23369
23379
  return KS;
23380
+ case 7:
23381
+ return ZS;
23370
23382
  case 5:
23371
23383
  return YS;
23372
23384
  }
@@ -23939,7 +23951,7 @@ class vE {
23939
23951
  }
23940
23952
  typeof window < "u" && window.addEventListener("unhandledrejection", (s) => {
23941
23953
  });
23942
- const Dn = yt, Zh = "$___Export_Components", wE = "NEEDLE_components";
23954
+ const Dn = yt, Kh = "$___Export_Components", wE = "NEEDLE_components";
23943
23955
  class xE {
23944
23956
  [ua];
23945
23957
  }
@@ -23981,12 +23993,12 @@ class jw {
23981
23993
  // https://github.com/mrdoob/three.js/blob/efbfc67edc7f65cfcc61a389ffc5fd43ea702bc6/examples/jsm/exporters/GLTFExporter.js#L532
23982
23994
  serializeUserData(e, t) {
23983
23995
  const i = e.userData?.components;
23984
- return !i || i.length <= 0 ? !1 : (delete e.userData.components, e[Zh] = i, !0);
23996
+ return !i || i.length <= 0 ? !1 : (delete e.userData.components, e[Kh] = i, !0);
23985
23997
  }
23986
23998
  afterSerializeUserData(e, t) {
23987
- if (e.type === "Scene" && Dn && console.log("DONE", JSON.stringify(t)), e[Zh] === void 0) return;
23988
- const i = e[Zh];
23989
- delete e[Zh], i !== null && (e.userData.components = i);
23999
+ if (e.type === "Scene" && Dn && console.log("DONE", JSON.stringify(t)), e[Kh] === void 0) return;
24000
+ const i = e[Kh];
24001
+ delete e[Kh], i !== null && (e.userData.components = i);
23990
24002
  }
23991
24003
  writeNode(e, t) {
23992
24004
  const i = this.writer.json.nodes.length;
@@ -24004,7 +24016,7 @@ class jw {
24004
24016
  const c = [];
24005
24017
  for (const h of a) {
24006
24018
  this.context.target = h;
24007
- const d = Zn().writeBuiltinComponentData(h, this.context);
24019
+ const d = Kn().writeBuiltinComponentData(h, this.context);
24008
24020
  d !== null && c.push(d);
24009
24021
  }
24010
24022
  c.length > 0 && (l[ua] = c, Dn && console.log("DID WRITE", n, "nodeIndex", r, c));
@@ -24575,7 +24587,7 @@ class ME {
24575
24587
  g.depthTest = !1, g.depthFunc = lC;
24576
24588
  break;
24577
24589
  }
24578
- g.transparent = p, p && (g.depthWrite = !1), Kk(d), g.onUpdateUniforms();
24590
+ g.transparent = p, p && (g.depthWrite = !1), Zk(d), g.onUpdateUniforms();
24579
24591
  for (const v in f) {
24580
24592
  const b = v, w = f[v].type;
24581
24593
  d[b]?.value === void 0 && (w === Bw.SAMPLER_2D ? (d[b] = { value: Qk }, console.warn("Missing/unassigned texture, fallback to white: " + b)) : b === "unity_OrthoParams" || console.warn("TODO: EXPECTED UNIFORM / fallback NOT SET: " + b, f[v]));
@@ -24611,10 +24623,10 @@ let du;
24611
24623
  const TE = import("./vendor-D-7l5gB0.js").then((s) => s.index$2).then(async (s) => (du = s.GLTFAnimationPointerExtension, du)).catch((s) => {
24612
24624
  console.warn("Failed to import GLTFLoaderAnimationPointer. Please use @needle-tools/three-animationpointer for full KHR_animation support", s);
24613
24625
  }), Ar = new Array();
24614
- function B2(s) {
24626
+ function BD(s) {
24615
24627
  Ar.includes(s) || Ar.push(s);
24616
24628
  }
24617
- function F2(s) {
24629
+ function FD(s) {
24618
24630
  const e = Ar.indexOf(s);
24619
24631
  e >= 0 && Ar.splice(e, 1);
24620
24632
  }
@@ -24757,7 +24769,7 @@ class Ba {
24757
24769
  /** The mesh information of the object - this tries to also calculate the LOD info */
24758
24770
  meshInformation;
24759
24771
  constructor(e, t) {
24760
- this.__instanceIndex = -1, this.object = e, this.renderer = t, e[K0] = t, this.meshInformation = pr(e.geometry), Ba.all.push(this);
24772
+ this.__instanceIndex = -1, this.object = e, this.renderer = t, e[Z0] = t, this.meshInformation = pr(e.geometry), Ba.all.push(this);
24761
24773
  }
24762
24774
  /** Calculates the mesh information again
24763
24775
  * @returns true if the vertex count or index count has changed
@@ -25098,8 +25110,8 @@ Texture:`, i), this.setLightmapDebugMaterial()) : Jh && console.log("Use debugli
25098
25110
  const n = this.renderer.sharedMaterials[i];
25099
25111
  if (!n || n.lightMap === void 0) continue;
25100
25112
  Jh && console.log("Setting lightmap on material", n.name, "for renderer", this.renderer.name), Po.get(this.gameObject).setOverride("lightMap", this.lightmapTexture, {
25101
- offset: new Z(t.z, 1 - t.y - t.w),
25102
- repeat: new Z(t.x, t.y)
25113
+ offset: new K(t.z, 1 - t.y - t.w),
25114
+ repeat: new K(t.x, t.y)
25103
25115
  }), n[Fb] = !0;
25104
25116
  }
25105
25117
  this._isApplied = !0;
@@ -25111,8 +25123,8 @@ Texture:`, i), this.setLightmapDebugMaterial()) : Jh && console.log("Use debugli
25111
25123
  this.lightmapTexture.channel = 1;
25112
25124
  const e = this.lightmapScaleOffset;
25113
25125
  Po.get(this.gameObject).setOverride("lightMap", this.lightmapTexture, {
25114
- offset: new Z(e.z, 1 - e.y - e.w),
25115
- repeat: new Z(e.x, e.y)
25126
+ offset: new K(e.z, 1 - e.y - e.w),
25127
+ repeat: new K(e.x, e.y)
25116
25128
  });
25117
25129
  }
25118
25130
  /**
@@ -25228,7 +25240,7 @@ class FE {
25228
25240
  if (r) {
25229
25241
  this._indexMapMaxIndex = l, this._indexMap = a;
25230
25242
  const c = `Renderer ${e.name} was initialized with missing materials - this may lead to unexpected behaviour when trying to access sharedMaterials by index.`;
25231
- console.warn(c), Zi() && _e("Found renderer with missing materials: please check the console for details.");
25243
+ console.warn(c), Ki() && _e("Found renderer with missing materials: please check the console for details.");
25232
25244
  }
25233
25245
  return new Proxy(this, {
25234
25246
  get(c, h) {
@@ -25674,7 +25686,7 @@ class jo extends E {
25674
25686
  * @returns A promise that resolves to the loaded object or null if loading failed.
25675
25687
  */
25676
25688
  loadFromURL(e, t) {
25677
- return this.addFromUrl(e, { screenposition: new Z(), point: t?.point, size: t?.size }, !1);
25689
+ return this.addFromUrl(e, { screenposition: new K(), point: t?.point, size: t?.size }, !1);
25678
25690
  }
25679
25691
  /**
25680
25692
  * Forgets all previously added objects.
@@ -25710,9 +25722,9 @@ class jo extends E {
25710
25722
  if (console.debug("[DropListener] Received networked event", e), t)
25711
25723
  if (Array.isArray(t))
25712
25724
  for (const i of t)
25713
- this.addFromUrl(i, { screenposition: new Z(), point: e.point, size: e.size }, !0);
25725
+ this.addFromUrl(i, { screenposition: new K(), point: e.point, size: e.size }, !0);
25714
25726
  else
25715
- this.addFromUrl(t, { screenposition: new Z(), point: e.point, size: e.size }, !0);
25727
+ this.addFromUrl(t, { screenposition: new K(), point: e.point, size: e.size }, !0);
25716
25728
  }
25717
25729
  };
25718
25730
  /**
@@ -25724,7 +25736,7 @@ class jo extends E {
25724
25736
  if (this.context.connection.allowEditing === !1 || e.defaultPrevented) return;
25725
25737
  navigator.clipboard.readText().then((i) => {
25726
25738
  if (i && (i.startsWith("http") || i.startsWith("https") || i.startsWith("blob"))) {
25727
- const o = { screenposition: new Z(this.context.input.mousePosition.x, this.context.input.mousePosition.y) };
25739
+ const o = { screenposition: new K(this.context.input.mousePosition.x, this.context.input.mousePosition.y) };
25728
25740
  this.testIfIsInDropArea(o) && this.addFromUrl(i, o, !1);
25729
25741
  }
25730
25742
  }).catch(console.warn);
@@ -25745,7 +25757,7 @@ class jo extends E {
25745
25757
  onDrop = async (e) => {
25746
25758
  if (Bt && console.debug("DropListener Drop", e, this.context.connection.allowEditing), this.context.connection.allowEditing === !1 || !e?.dataTransfer || e["droplistener:handled"]) return;
25747
25759
  e.preventDefault();
25748
- const t = { screenposition: new Z(e.offsetX, e.offsetY) };
25760
+ const t = { screenposition: new K(e.offsetX, e.offsetY) };
25749
25761
  if (this.dropArea && this.testIfIsInDropArea(t) === !1)
25750
25762
  return;
25751
25763
  e["droplistener:handled"] = !0;
@@ -25963,7 +25975,7 @@ function $E(s) {
25963
25975
  var uu;
25964
25976
  ((s) => {
25965
25977
  async function e(i, n, o) {
25966
- const r = o.guid, a = new Nt(r), l = new Blob([i], { type: i.type || rE(i.name) || void 0 }), c = URL.createObjectURL(l), h = await Zn().loadSync(n, c, i.name, a).catch((d) => (console.error(`Failed to load file "${i.name}" (${i.type}):`, d), null));
25978
+ const r = o.guid, a = new Nt(r), l = new Blob([i], { type: i.type || rE(i.name) || void 0 }), c = URL.createObjectURL(l), h = await Kn().loadSync(n, c, i.name, a).catch((d) => (console.error(`Failed to load file "${i.name}" (${i.type}):`, d), null));
25967
25979
  return URL.revokeObjectURL(c), h ? new Promise((d, f) => {
25968
25980
  const p = new FileReader();
25969
25981
  p.readAsArrayBuffer(i), p.onloadend = async (g) => {
@@ -25982,7 +25994,7 @@ var uu;
25982
25994
  parent: n.parent,
25983
25995
  position: n?.point,
25984
25996
  size: n?.size
25985
- }), h = await Zn().loadSync(n.context, l, l, a, (d) => {
25997
+ }), h = await Kn().loadSync(n.context, l, l, a, (d) => {
25986
25998
  c.onProgress(d.loaded / d.total);
25987
25999
  }).catch(console.warn);
25988
26000
  if (h) {
@@ -26457,7 +26469,7 @@ class YE {
26457
26469
  }
26458
26470
  }
26459
26471
  const Be = "</StageRoot/Materials";
26460
- function KE(s, e, t) {
26472
+ function ZE(s, e, t) {
26461
26473
  const i = /* @__PURE__ */ new Map(), n = (y) => {
26462
26474
  const m = y.type___needle, v = i.get(m) || /* @__PURE__ */ new Map();
26463
26475
  if (i.set(m, v), !v.has(y)) {
@@ -26595,7 +26607,7 @@ function td(s) {
26595
26607
  }, g = t(s);
26596
26608
  return p(g);
26597
26609
  }
26598
- function ZE(s, e) {
26610
+ function KE(s, e) {
26599
26611
  switch (e) {
26600
26612
  case "float4":
26601
26613
  return s.isVector4 ? `(${s.x}, ${s.y}, ${s.z}, ${s.w})` : `(${s}, ${s}, ${s}, ${s})`;
@@ -26633,7 +26645,7 @@ function JE(s, e, t, i) {
26633
26645
  d = "time_float";
26634
26646
  break;
26635
26647
  case "ConstNode":
26636
- d = "constant_" + c, f.push(`${h} inputs:value = ${ZE(s.value, h)}`);
26648
+ d = "constant_" + c, f.push(`${h} inputs:value = ${KE(s.value, h)}`);
26637
26649
  break;
26638
26650
  case "JoinNode":
26639
26651
  d = "combine" + s.nodes.length + "_" + c;
@@ -26708,10 +26720,10 @@ function tT(s) {
26708
26720
  function nn(s) {
26709
26721
  return s = s.replace(/[^a-zA-Z0-9_]/g, ""), s.match(/^[a-zA-Z_]/) || (s = "_" + s), s;
26710
26722
  }
26711
- function Kw(s) {
26723
+ function Zw(s) {
26712
26724
  return s = s.replace('"', '\\"'), s;
26713
26725
  }
26714
- function Zw(s) {
26726
+ function Kw(s) {
26715
26727
  if (s.length === 0) return null;
26716
26728
  const e = s.map((i) => {
26717
26729
  const n = new Array();
@@ -26722,7 +26734,7 @@ function Zw(s) {
26722
26734
  return e[0].findLast((i) => e.every((n) => n.includes(i))) || null;
26723
26735
  }
26724
26736
  function Jw(s) {
26725
- const e = Zw(s), t = /* @__PURE__ */ new Set();
26737
+ const e = Kw(s), t = /* @__PURE__ */ new Set();
26726
26738
  for (const i of s) {
26727
26739
  let n = i.parent;
26728
26740
  for (; n && n !== e; )
@@ -26998,7 +27010,7 @@ let aT = class {
26998
27010
  const a = [], l = /* @__PURE__ */ new Set();
26999
27011
  e?.traverse((v) => {
27000
27012
  if (!(!t.exportInvisible && !v.visible) && v instanceof wo) {
27001
- const b = v.skeleton.bones, w = Zw(b);
27013
+ const b = v.skeleton.bones, w = Kw(b);
27002
27014
  if (w) {
27003
27015
  const T = { object: v, originalParent: v.parent, newParent: w };
27004
27016
  a.push(T), l.add(T.object.uuid), T.newParent && l.add(T.newParent.uuid), T.originalParent && l.add(T.originalParent.uuid);
@@ -27313,7 +27325,7 @@ function sx(s, e, t) {
27313
27325
  for (const p of s.animations)
27314
27326
  t.animations.push(p);
27315
27327
  const l = n && n.isBufferGeometry && n.attributes.skinIndex !== void 0 && n.attributes.skinIndex.count > 0, c = l ? "SkelRoot" : "Xform", h = new Array(), d = o && o instanceof Se && o.color && o.color.r === 1 && o.color.g === 1 && o.color.b === 1 && !o.map && o.opacity === 1 && n?.attributes.color;
27316
- if (n?.attributes.color && !d && console.warn("NeedleUSDZExporter: Geometry has vertex colors. Vertex colors will only be shown in QuickLook for unlit materials with white color and no texture. Otherwise, they will be ignored.", s.displayName), e.appendLine(), n ? (e.beginBlock(`def ${c} "${a}"`, "(", !1), t.quickLookCompatible && o && o.side === Ti && !l ? e.appendLine(`prepend references = @./geometries/${Um(n)}.usda@</Geometry_doubleSided>`) : e.appendLine(`prepend references = @./geometries/${Um(n)}.usda@</Geometry>`), d || h.push("MaterialBindingAPI"), l && h.push("SkelBindingAPI")) : r && !t.quickLookCompatible ? e.beginBlock(`def Camera "${a}"`, "(", !1) : s.type !== void 0 ? e.beginBlock(`def ${s.type} "${a}"`) : e.beginBlock(`def Xform "${a}"`, "(", !1), s.type === void 0 && (s.extraSchemas?.length && h.push(...s.extraSchemas), h.length && e.appendLine(`prepend apiSchemas = [${h.map((p) => `"${p}"`).join(", ")}]`)), s.displayName && e.appendLine(`displayName = "${Kw(s.displayName)}"`), (r || s.type === void 0) && (e.closeBlock(")"), e.beginBlock()), n && o) {
27328
+ if (n?.attributes.color && !d && console.warn("NeedleUSDZExporter: Geometry has vertex colors. Vertex colors will only be shown in QuickLook for unlit materials with white color and no texture. Otherwise, they will be ignored.", s.displayName), e.appendLine(), n ? (e.beginBlock(`def ${c} "${a}"`, "(", !1), t.quickLookCompatible && o && o.side === Ti && !l ? e.appendLine(`prepend references = @./geometries/${Um(n)}.usda@</Geometry_doubleSided>`) : e.appendLine(`prepend references = @./geometries/${Um(n)}.usda@</Geometry>`), d || h.push("MaterialBindingAPI"), l && h.push("SkelBindingAPI")) : r && !t.quickLookCompatible ? e.beginBlock(`def Camera "${a}"`, "(", !1) : s.type !== void 0 ? e.beginBlock(`def ${s.type} "${a}"`) : e.beginBlock(`def Xform "${a}"`, "(", !1), s.type === void 0 && (s.extraSchemas?.length && h.push(...s.extraSchemas), h.length && e.appendLine(`prepend apiSchemas = [${h.map((p) => `"${p}"`).join(", ")}]`)), s.displayName && e.appendLine(`displayName = "${Zw(s.displayName)}"`), (r || s.type === void 0) && (e.closeBlock(")"), e.beginBlock()), n && o) {
27317
27329
  if (!d) {
27318
27330
  const p = sf(o);
27319
27331
  e.appendLine(`rel material:binding = </StageRoot/Materials/${p}>`);
@@ -27599,7 +27611,7 @@ function bT(s, e, t = !1) {
27599
27611
  }
27600
27612
  const o = " ", r = [], a = [], l = /* @__PURE__ */ new Set();
27601
27613
  if (s.isMeshPhysicalNodeMaterial === !0)
27602
- return KE(s, i, e);
27614
+ return ZE(s, i, e);
27603
27615
  let c = s.transparent || s.alphaTest ? s.opacity : 1, h = !1, d = !1;
27604
27616
  if (s instanceof Yy && s.transmission !== void 0 && (c *= 1 - s.transmission * (1 - s.roughness * 0.5)), s.map ? (r.push(`${o}color3f inputs:diffuseColor.connect = ${Yt}/${i}/${Gi(s.map)}_diffuse.outputs:rgb>`), s instanceof Se && s.transparent && s.alphaTest == 0 && t ? (r.push(`${o}float inputs:opacity.connect = ${Yt}/${i}/${Gi(s.map)}_diffuse.outputs:a>`), h = !0, r.push(`${o}float inputs:opacityThreshold = ${1e-10}`), d = !0) : s.transparent ? (r.push(`${o}float inputs:opacity.connect = ${Yt}/${i}/${Gi(s.map)}_diffuse.outputs:a>`), h = !0) : s.alphaTest > 0 && (r.push(`${o}float inputs:opacity.connect = ${Yt}/${i}/${Gi(s.map)}_diffuse.outputs:a>`), h = !0, r.push(`${o}float inputs:opacityThreshold = ${s.alphaTest}`), d = !0), a.push(Js(s.map, "diffuse", t, e, s, l, s.color, c))) : r.push(`${o}color3f inputs:diffuseColor = ${Gb(s.color)}`), s.alphaHash && t && (d ? console.warn("Opacity threshold for " + s.name + " was already connected. Skipping alphaHash opacity threshold.") : (r.push(`${o}float inputs:opacityThreshold = 0.0000000001`), d = !0)), s.aoMap && (r.push(`${o}float inputs:occlusion.connect = ${Yt}/${i}/${Gi(s.aoMap)}_occlusion.outputs:r>`), a.push(Js(s.aoMap, "occlusion", t, e, s, l))), s.alphaMap ? (r.push(`${o}float inputs:opacity.connect = ${Yt}/${i}/${Gi(s.alphaMap)}_opacity.outputs:r>`), r.push(`${o}float inputs:opacityThreshold = 0.0000000001`), h = !0, d = !0, a.push(Js(s.alphaMap, "opacity", t, e, s, l, new re(1, 1, 1), c))) : (h ? console.warn("Opacity for " + s.name + " was already connected. Skipping default opacity.") : (r.push(`${o}float inputs:opacity = ${c}`), h = !0), s.alphaTest > 0 && (d ? console.warn("Opacity threshold for " + s.name + " was already connected. Skipping default opacity threshold.") : (r.push(`${o}float inputs:opacityThreshold = ${s.alphaTest}`), d = !0))), s instanceof gt) {
27605
27617
  if (s.emissiveMap) {
@@ -27615,7 +27627,7 @@ function bT(s, e, t = !1) {
27615
27627
  return s instanceof Yy && (r.push(`${o}float inputs:clearcoat = ${s.clearcoat}`), r.push(`${o}float inputs:clearcoatRoughness = ${s.clearcoatRoughness}`), r.push(`${o}float inputs:ior = ${s.ior}`), !s.transparent && !(s.alphaTest > 0) && s.transmissionMap && (r.push(`${o}float inputs:opacity.connect = ${Yt}/${i}/${Gi(s.transmissionMap)}_transmission.outputs:r>`), a.push(Js(s.transmissionMap, "transmission", t, e, s, l)))), l.size > 2 ? console.warn("USDZExporter: Material " + s.name + " uses more than 2 UV channels. Currently, only UV0 and UV1 are supported.") : l.size === 2 && (!l.has(0) || !l.has(1)) && console.warn("USDZExporter: Material " + s.name + " uses UV channels other than 0 and 1. Currently, only UV0 and UV1 are supported."), `
27616
27628
 
27617
27629
  def Material "${i}" ${s.name ? `(
27618
- displayName = "${Kw(s.name)}"
27630
+ displayName = "${Zw(s.name)}"
27619
27631
  )` : ""}
27620
27632
  {
27621
27633
  token outputs:surface.connect = ${Yt}/${i}/PreviewSurface.outputs:surface>
@@ -28717,12 +28729,12 @@ class ll extends E {
28717
28729
  if (!this.target || !this.object) return;
28718
28730
  const e = te(this.object).clone(), t = te(this.target).clone(), i = ve(this.object).clone(), n = ve(this.target).clone(), o = Qe(this.object).clone(), r = Qe(this.target).clone(), a = e.distanceTo(t), l = i.angleTo(n), c = o.distanceTo(r);
28719
28731
  if (a < 0.01 && l < 0.01 && c < 0.01) {
28720
- At(this.object, t), Kn(this.object, n), Ic(this.object, r), this.coroutine = null;
28732
+ At(this.object, t), Zn(this.object, n), Ic(this.object, r), this.coroutine = null;
28721
28733
  return;
28722
28734
  }
28723
28735
  let h = 0, d = 0;
28724
28736
  for (; h < 1; )
28725
- h += this.context.time.deltaTime / this.duration, h > 1 && (h = 1), d = h < 0.5 ? 4 * h * h * h : 1 - Math.pow(-2 * h + 2, 3) / 2, this.targetPos.lerpVectors(e, t, d), this.targetRot.slerpQuaternions(i, n, d), this.targetScale.lerpVectors(o, r, d), At(this.object, this.targetPos), Kn(this.object, this.targetRot), Ic(this.object, this.targetScale), yield;
28737
+ h += this.context.time.deltaTime / this.duration, h > 1 && (h = 1), d = h < 0.5 ? 4 * h * h * h : 1 - Math.pow(-2 * h + 2, 3) / 2, this.targetPos.lerpVectors(e, t, d), this.targetRot.slerpQuaternions(i, n, d), this.targetScale.lerpVectors(o, r, d), At(this.object, this.targetPos), Zn(this.object, this.targetRot), Ic(this.object, this.targetScale), yield;
28726
28738
  this.coroutine = null;
28727
28739
  }
28728
28740
  *moveRelative() {
@@ -29454,7 +29466,7 @@ class kr {
29454
29466
  createARButton(e) {
29455
29467
  if (this._arButton) return this._arButton;
29456
29468
  const t = "immersive-ar", i = document.createElement("button");
29457
- return this._arButton = i, i.classList.add("webxr-button"), i.dataset.needle = "webxr-ar-button", i.innerText = "Enter AR", i.prepend(zt("view_in_ar")), i.title = "Click to start an AR session", i.addEventListener("click", () => K.start(t, e)), gc.setElementPriority(i, MT), this.updateSessionSupported(i, t), this.listenToXRSessionState(i, t), this.hideElementDuringXRSession(i), this.isSecureConnection || (i.disabled = !0, i.title = "WebXR requires a secure connection (HTTPS)"), D.isMozillaXR() || navigator.xr?.addEventListener("devicechange", () => this.updateSessionSupported(i, t)), i;
29469
+ return this._arButton = i, i.classList.add("webxr-button"), i.dataset.needle = "webxr-ar-button", i.innerText = "Enter AR", i.prepend(zt("view_in_ar")), i.title = "Click to start an AR session", i.addEventListener("click", () => Z.start(t, e)), gc.setElementPriority(i, MT), this.updateSessionSupported(i, t), this.listenToXRSessionState(i, t), this.hideElementDuringXRSession(i), this.isSecureConnection || (i.disabled = !0, i.title = "WebXR requires a secure connection (HTTPS)"), D.isMozillaXR() || navigator.xr?.addEventListener("devicechange", () => this.updateSessionSupported(i, t)), i;
29458
29470
  }
29459
29471
  /** get or create the WebXR VR button
29460
29472
  * @param init optional session init options
@@ -29466,7 +29478,7 @@ class kr {
29466
29478
  createVRButton(e) {
29467
29479
  if (this._vrButton) return this._vrButton;
29468
29480
  const t = "immersive-vr", i = document.createElement("button");
29469
- return this._vrButton = i, i.classList.add("webxr-button"), i.dataset.needle = "webxr-vr-button", i.innerText = "Enter VR", i.prepend(zt("panorama_photosphere")), i.title = "Click to start a VR session", i.addEventListener("click", () => K.start(t, e)), gc.setElementPriority(i, OT), this.updateSessionSupported(i, t), this.listenToXRSessionState(i, t), this.hideElementDuringXRSession(i), this.isSecureConnection || (i.disabled = !0, i.title = "WebXR requires a secure connection (HTTPS)"), D.isMozillaXR() || navigator.xr?.addEventListener("devicechange", () => this.updateSessionSupported(i, t)), i;
29481
+ return this._vrButton = i, i.classList.add("webxr-button"), i.dataset.needle = "webxr-vr-button", i.innerText = "Enter VR", i.prepend(zt("panorama_photosphere")), i.title = "Click to start a VR session", i.addEventListener("click", () => Z.start(t, e)), gc.setElementPriority(i, OT), this.updateSessionSupported(i, t), this.listenToXRSessionState(i, t), this.hideElementDuringXRSession(i), this.isSecureConnection || (i.disabled = !0, i.title = "WebXR requires a secure connection (HTTPS)"), D.isMozillaXR() || navigator.xr?.addEventListener("devicechange", () => this.updateSessionSupported(i, t)), i;
29470
29482
  }
29471
29483
  /** get or create the Send To Quest button
29472
29484
  * Behaviour of the button:
@@ -29494,7 +29506,7 @@ class kr {
29494
29506
  e.style.display = "none";
29495
29507
  return;
29496
29508
  }
29497
- K.isSessionSupported(t).then((i) => {
29509
+ Z.isSessionSupported(t).then((i) => {
29498
29510
  e.style.display = i ? "" : "none", L() && !i && console.log('[WebXR] "' + t + '" is not supported on this device. Make sure your server runs using HTTPS and you have a device connected that supports ' + t);
29499
29511
  });
29500
29512
  }
@@ -29507,9 +29519,9 @@ class kr {
29507
29519
  });
29508
29520
  }
29509
29521
  listenToXRSessionState(e, t) {
29510
- t && (K.onSessionRequestStart((i) => {
29522
+ t && (Z.onSessionRequestStart((i) => {
29511
29523
  i.mode === t ? e.classList.add("this-mode-is-requested") : (e["was-disabled"] = e.disabled, e.disabled = !0, e.classList.add("other-mode-is-requested"));
29512
- }), K.onSessionRequestEnd((i) => {
29524
+ }), Z.onSessionRequestEnd((i) => {
29513
29525
  e.classList.remove("this-mode-is-requested"), e.classList.remove("other-mode-is-requested"), e.disabled = e["was-disabled"];
29514
29526
  }));
29515
29527
  }
@@ -29526,7 +29538,7 @@ class Lr {
29526
29538
  if (e.__cached_geometry) return e.__cached_geometry;
29527
29539
  if (e.guid && Lr.cache[e.guid])
29528
29540
  return Cc && console.log("Take cached geometry for sprite", e.guid), Lr.cache[e.guid];
29529
- const t = new Ki();
29541
+ const t = new Zi();
29530
29542
  e.__cached_geometry = t;
29531
29543
  const i = new Float32Array(e.triangles.length * 3), n = new Float32Array(e.triangles.length * 2);
29532
29544
  for (let o = 0; o < e.triangles.length; o += 1) {
@@ -29968,7 +29980,7 @@ class bn extends E {
29968
29980
  console.warn("Reticle is not visible (can not place)");
29969
29981
  return;
29970
29982
  }
29971
- if (K.active?.isTrackingImages) {
29983
+ if (Z.active?.isTrackingImages) {
29972
29984
  console.warn("Scene Placement is disabled while images are being tracked");
29973
29985
  return;
29974
29986
  }
@@ -29977,15 +29989,15 @@ class bn extends E {
29977
29989
  const n = this._reticle[e.origin.index];
29978
29990
  n && (t = n, i = this._hits[e.origin.index]);
29979
29991
  }
29980
- if (e && (e.stopImmediatePropagation(), e.stopPropagation(), e.use()), this._isPlacing = !1, this.context.input.removeEventListener("pointerup", this.onPlaceScene), this.onRevertSceneChanges(), t.position.copy(t.lastPos), t.quaternion.copy(t.lastQuat), this.onApplyPose(t), bn._hasPlaced = !0, this.useXRAnchor && this.onCreateAnchor(K.active, i), this.context.xr)
29992
+ if (e && (e.stopImmediatePropagation(), e.stopPropagation(), e.use()), this._isPlacing = !1, this.context.input.removeEventListener("pointerup", this.onPlaceScene), this.onRevertSceneChanges(), t.position.copy(t.lastPos), t.quaternion.copy(t.lastQuat), this.onApplyPose(t), bn._hasPlaced = !0, this.useXRAnchor && this.onCreateAnchor(Z.active, i), this.context.xr)
29981
29993
  for (const n of this.context.xr.controllers)
29982
29994
  n.cancelHitTestSource();
29983
29995
  };
29984
29996
  onSetScale() {
29985
29997
  if (!bn._hasPlaced) return;
29986
- const e = K.active?.rig?.gameObject;
29998
+ const e = Z.active?.rig?.gameObject;
29987
29999
  if (e) {
29988
- const t = K.active?.rigScale || 1, i = 1 / this._arScale * t, n = new ee().makeScale(i, i, i).invert();
30000
+ const t = Z.active?.rigScale || 1, i = 1 / this._arScale * t, n = new ee().makeScale(i, i, i).invert();
29989
30001
  e.matrix.premultiply(n), e.matrix.decompose(e.position, e.quaternion, e.scale);
29990
30002
  }
29991
30003
  }
@@ -30022,7 +30034,7 @@ class bn extends E {
30022
30034
  a > l && a < 180 - l || a < -l && a > -180 + l ? (this.lookPoint.copy(e.position).add(this.upVec), this.lookPoint.y = e.position.y, e.lookAt(this.lookPoint)) : (n.y = o.y, e.lookAt(n));
30023
30035
  }
30024
30036
  onApplyPose(e) {
30025
- const t = K.active?.rig?.gameObject;
30037
+ const t = Z.active?.rig?.gameObject;
30026
30038
  if (!t) {
30027
30039
  console.warn("No rig object to place");
30028
30040
  return;
@@ -30180,7 +30192,7 @@ var DT = Object.defineProperty, lf = (s, e, t, i) => {
30180
30192
  (r = s[o]) && (n = r(e, t, n) || n);
30181
30193
  return n && DT(e, t, n), n;
30182
30194
  };
30183
- const Kt = x("debugplayersync"), cf = class dx extends E {
30195
+ const Zt = x("debugplayersync"), cf = class dx extends E {
30184
30196
  /**
30185
30197
  * This API is experimental and may change or be removed in the future.
30186
30198
  * Creates a PlayerSync instance at runtime from a given URL and sets it up for networking
@@ -30220,7 +30232,7 @@ const Kt = x("debugplayersync"), cf = class dx extends E {
30220
30232
  this.context.connection.stopListen(ie.RoomStateSent, this.onJoinedRoom), this.context.connection.stopListen(ie.JoinedRoom, this.onJoinedRoom), this.context.connection.stopListen(ie.LeftRoom, this.destroyInstance);
30221
30233
  }
30222
30234
  onJoinedRoom = () => {
30223
- Kt && console.log("PlayerSync.joinedRoom. autoSync is set to " + this.autoSync), this.autoSync && this.getInstance();
30235
+ Zt && console.log("PlayerSync.joinedRoom. autoSync is set to " + this.autoSync), this.autoSync && this.getInstance();
30224
30236
  };
30225
30237
  /**
30226
30238
  * Gets or creates an instance of the assigned asset for the local player
@@ -30228,13 +30240,13 @@ const Kt = x("debugplayersync"), cf = class dx extends E {
30228
30240
  */
30229
30241
  async getInstance() {
30230
30242
  if (this._localInstance) return this._localInstance;
30231
- if (Kt && console.log("PlayerSync.createInstance", this.asset?.url), !this.asset?.asset && !this.asset?.url)
30243
+ if (Zt && console.log("PlayerSync.createInstance", this.asset?.url), !this.asset?.asset && !this.asset?.url)
30232
30244
  return console.error('PlayerSync: can not create an instance because "asset" is not set and or has no URL!'), null;
30233
30245
  this.gameObject.guid || console.warn("PlayerSync: gameObject has no guid! This might cause issues with syncing the player state."), this._localInstance = this.asset?.instantiateSynced({ parent: this.gameObject, deleteOnDisconnect: !0 }, !0);
30234
30246
  const e = await this._localInstance;
30235
30247
  if (e) {
30236
30248
  const t = C.getComponentsInChildren(e, vn);
30237
- if (Kt && console.log(`PlayerSync.createInstance: found ${t?.length} PlayerState components. Owner: ${this.context.connection.connectionId}`), t?.length) {
30249
+ if (Zt && console.log(`PlayerSync.createInstance: found ${t?.length} PlayerState components. Owner: ${this.context.connection.connectionId}`), t?.length) {
30238
30250
  for (const i of t)
30239
30251
  i.owner = this.context.connection.connectionId;
30240
30252
  this.onPlayerSpawned?.invoke(e);
@@ -30249,7 +30261,7 @@ const Kt = x("debugplayersync"), cf = class dx extends E {
30249
30261
  */
30250
30262
  destroyInstance = () => {
30251
30263
  this._localInstance?.then((e) => {
30252
- Kt && console.log("PlayerSync.destroyInstance", e), Du(e, this.context.connection, !0, { saveInRoom: !1 });
30264
+ Zt && console.log("PlayerSync.destroyInstance", e), Du(e, this.context.connection, !0, { saveInRoom: !1 });
30253
30265
  }), this._localInstance = void 0;
30254
30266
  };
30255
30267
  /**
@@ -30354,7 +30366,7 @@ const Vm = class Mt extends E {
30354
30366
  * @param oldOwner The previous owner's connection ID
30355
30367
  */
30356
30368
  onOwnerChange(e, t) {
30357
- Kt && console.log(`PlayerSync.onOwnerChange: ${t} → ${e} (me: ${this.context.connection.connectionId})`);
30369
+ Zt && console.log(`PlayerSync.onOwnerChange: ${t} → ${e} (me: ${this.context.connection.connectionId})`);
30358
30370
  const i = Mt._local.indexOf(this);
30359
30371
  i >= 0 && Mt._local.splice(i, 1);
30360
30372
  const n = {
@@ -30372,21 +30384,21 @@ const Vm = class Mt extends E {
30372
30384
  }
30373
30385
  /** @internal */
30374
30386
  awake() {
30375
- Mt.all.push(this), Kt && console.log("Registered new PlayerState", this.guid, Mt.all.length - 1, Mt.all), this.context.connection.beginListen(ie.UserLeftRoom, this.onUserLeftRoom);
30387
+ Mt.all.push(this), Zt && console.log("Registered new PlayerState", this.guid, Mt.all.length - 1, Mt.all), this.context.connection.beginListen(ie.UserLeftRoom, this.onUserLeftRoom);
30376
30388
  }
30377
30389
  /** @internal */
30378
30390
  async start() {
30379
- Kt && console.log("PLAYERSTATE.START, owner: " + this.owner, this.context.connection.usersInRoom([])), this.owner ? (this.context.connection.isInRoom || await Ro(300), this.context.connection.userIsInRoom(this.owner) == !1 && (Kt && console.log(`PlayerSync.start → doDestroy "${this.name}" because user "${this.owner}" is not in room anymore...`, "Currently in room:", ...this.context.connection.usersInRoom()), this.doDestroy())) : this.owner || (Kt && console.warn("PlayerState.start → owner is undefined!", this.name), setTimeout(() => {
30380
- !this.destroyed && !this.owner ? this.dontDestroy ? Kt && console.warn("PlayerState.start → owner is still undefined but dontDestroy is set to true", this.name) : (Kt && console.warn(`PlayerState.start → owner is still undefined: destroying "${this.name}" instance now`), this.doDestroy()) : Kt && console.log("PlayerState.start → owner is assigned", this.owner);
30391
+ Zt && console.log("PLAYERSTATE.START, owner: " + this.owner, this.context.connection.usersInRoom([])), this.owner ? (this.context.connection.isInRoom || await Ro(300), this.context.connection.userIsInRoom(this.owner) == !1 && (Zt && console.log(`PlayerSync.start → doDestroy "${this.name}" because user "${this.owner}" is not in room anymore...`, "Currently in room:", ...this.context.connection.usersInRoom()), this.doDestroy())) : this.owner || (Zt && console.warn("PlayerState.start → owner is undefined!", this.name), setTimeout(() => {
30392
+ !this.destroyed && !this.owner ? this.dontDestroy ? Zt && console.warn("PlayerState.start → owner is still undefined but dontDestroy is set to true", this.name) : (Zt && console.warn(`PlayerState.start → owner is still undefined: destroying "${this.name}" instance now`), this.doDestroy()) : Zt && console.log("PlayerState.start → owner is assigned", this.owner);
30381
30393
  }, 2e3));
30382
30394
  }
30383
30395
  /** Tells the server that this client has been destroyed, and the networking message for the instantiate will be removed */
30384
30396
  doDestroy() {
30385
- Kt && console.log("PlayerSync.doDestroy → syncDestroy", this.name), Du(this.gameObject, this.context.connection, !0, { saveInRoom: !1 });
30397
+ Zt && console.log("PlayerSync.doDestroy → syncDestroy", this.name), Du(this.gameObject, this.context.connection, !0, { saveInRoom: !1 });
30386
30398
  }
30387
30399
  /** @internal */
30388
30400
  onDestroy() {
30389
- if (Kt && console.warn("PlayerState.onDestroy", this.owner), this.context.connection.stopListen(ie.UserLeftRoom, this.onUserLeftRoom), Mt.all.splice(Mt.all.indexOf(this), 1), this.isLocalPlayer) {
30401
+ if (Zt && console.warn("PlayerState.onDestroy", this.owner), this.context.connection.stopListen(ie.UserLeftRoom, this.onUserLeftRoom), Mt.all.splice(Mt.all.indexOf(this), 1), this.isLocalPlayer) {
30390
30402
  const e = Mt._local.indexOf(this);
30391
30403
  e >= 0 && Mt._local.splice(e, 1);
30392
30404
  }
@@ -30397,7 +30409,7 @@ const Vm = class Mt extends E {
30397
30409
  */
30398
30410
  onUserLeftRoom = (e) => {
30399
30411
  if (e.userId === this.owner) {
30400
- Kt && console.log("PLAYERSYNC LEFT", this.owner), this.doDestroy();
30412
+ Zt && console.log("PLAYERSYNC LEFT", this.owner), this.doDestroy();
30401
30413
  return;
30402
30414
  }
30403
30415
  };
@@ -30455,7 +30467,7 @@ var FT = Object.defineProperty, py = (s, e, t, i) => {
30455
30467
  (r = s[o]) && (n = r(e, t, n) || n);
30456
30468
  return n && FT(e, t, n), n;
30457
30469
  };
30458
- const Fl = x("debugwebxr"), Kb = new V().setFromAxisAngle(new _(0, 1, 0), Math.PI);
30470
+ const Fl = x("debugwebxr"), Zb = new V().setFromAxisAngle(new _(0, 1, 0), Math.PI);
30459
30471
  class Dr extends E {
30460
30472
  head;
30461
30473
  leftHand;
@@ -30493,9 +30505,9 @@ class Dr extends E {
30493
30505
  }
30494
30506
  }
30495
30507
  const n = e.xr.leftController, o = this.leftHand?.asset;
30496
- n && o ? (o.position.copy(n.gripPosition), o.quaternion.copy(n.gripQuaternion), o.quaternion.multiply(Kb), o.visible = n.isTracking, this.updateHandVisibility(n, o, this._leftHandMeshes)) : o && o.visible && (o.visible = !1);
30508
+ n && o ? (o.position.copy(n.gripPosition), o.quaternion.copy(n.gripQuaternion), o.quaternion.multiply(Zb), o.visible = n.isTracking, this.updateHandVisibility(n, o, this._leftHandMeshes)) : o && o.visible && (o.visible = !1);
30497
30509
  const r = e.xr.rightController, a = this.rightHand?.asset;
30498
- r && a ? (a.position.copy(r.gripPosition), a.quaternion.copy(r.gripQuaternion), a.quaternion.multiply(Kb), a.visible = r.isTracking, this.updateHandVisibility(r, a, this._rightHandMeshes)) : a && a.visible && (a.visible = !1);
30510
+ r && a ? (a.position.copy(r.gripPosition), a.quaternion.copy(r.gripQuaternion), a.quaternion.multiply(Zb), a.visible = r.isTracking, this.updateHandVisibility(r, a, this._rightHandMeshes)) : a && a.visible && (a.visible = !1);
30499
30511
  }
30500
30512
  onBeforeRender() {
30501
30513
  this.context.xr && this.context.time.frame % 10 === 0 && this.updateRemoteAvatarVisibility();
@@ -30512,7 +30524,7 @@ class Dr extends E {
30512
30524
  if (this.context.connection.isConnected) {
30513
30525
  const e = vn.getFor(this);
30514
30526
  if (e && e.isLocalPlayer == !1) {
30515
- const t = K.getXRSync(this.context);
30527
+ const t = Z.getXRSync(this.context);
30516
30528
  if (t && t.hasState(e.owner)) {
30517
30529
  this.tryFindAvatarObjectsIfMissing();
30518
30530
  const i = this.leftHand?.asset;
@@ -30564,7 +30576,7 @@ class Dr extends E {
30564
30576
  async loadAvatarObjects(e, t, i) {
30565
30577
  const n = e.loadAssetAsync(), o = t.loadAssetAsync(), r = i.loadAssetAsync(), a = new Array();
30566
30578
  n && a.push(n), o && a.push(o), r && a.push(r);
30567
- const l = await Zv(a);
30579
+ const l = await Kv(a);
30568
30580
  Fl && console.log("Avatar loaded results:", l);
30569
30581
  }
30570
30582
  }
@@ -30586,7 +30598,7 @@ function fx() {
30586
30598
  }
30587
30599
  return kp;
30588
30600
  }
30589
- function Zb(s) {
30601
+ function Kb(s) {
30590
30602
  s !== void 0 && typeof s == "string" && TC(s);
30591
30603
  }
30592
30604
  function Jb(s) {
@@ -30661,7 +30673,7 @@ class Eo extends E {
30661
30673
  this._models.length = 0;
30662
30674
  }
30663
30675
  onBeforeRender() {
30664
- if (K.active && (eo && (to[0] = Date.now()), this.updateRendering(K.active), eo)) {
30676
+ if (Z.active && (eo && (to[0] = Date.now()), this.updateRendering(Z.active), eo)) {
30665
30677
  const e = Date.now() - to[0];
30666
30678
  to.push(e), to.length >= 30 && (to[0] = 0, to.reduce((t, i) => t + i, 0) / to.length, to.length = 0);
30667
30679
  }
@@ -30700,7 +30712,7 @@ class Eo extends E {
30700
30712
  if (!e.connected)
30701
30713
  return console.warn("XRControllerModel.onXRControllerAdded: controller is not connected anymore", e.side), null;
30702
30714
  const n = await ne.getOrCreate("", t).instantiate();
30703
- return Dl(n), K.active?.isPassThrough && n.traverseVisible((o) => {
30715
+ return Dl(n), Z.active?.isPassThrough && n.traverseVisible((o) => {
30704
30716
  this.makeOccluder(o);
30705
30717
  }), n;
30706
30718
  }
@@ -30717,8 +30729,8 @@ class Eo extends E {
30717
30729
  Dl(c);
30718
30730
  const h = new VC(c, n, o.path, a, o, (d) => {
30719
30731
  const f = r?.gltf;
30720
- f?.scene.children?.length === 0 && (f.scene.children[0] = d), r?.gltf && Zn().createBuiltinComponents(e.context, e.sourceId || a, r.gltf, null, r), d.traverse((p) => {
30721
- p.layers.set(2), K.active?.isPassThrough && !l && this.makeOccluder(p), p instanceof H && Ve.assignMeshLOD(p, 0);
30732
+ f?.scene.children?.length === 0 && (f.scene.children[0] = d), r?.gltf && Kn().createBuiltinComponents(e.context, e.sourceId || a, r.gltf, null, r), d.traverse((p) => {
30733
+ p.layers.set(2), Z.active?.isPassThrough && !l && this.makeOccluder(p), p instanceof H && Ve.assignMeshLOD(p, 0);
30722
30734
  }), t.connected || (eo && z.DrawLabel(t.rayWorldPosition, "Hand is loaded but not connected anymore", 0.05, 5), d.removeFromParent());
30723
30735
  });
30724
30736
  if (eo && c.add(new Mi(0.5)), t.inputSource.hand) {
@@ -31035,7 +31047,7 @@ const zl = x("debugwebxr"), VT = x("debugusdz"), ft = class ba extends E {
31035
31047
  * @internal
31036
31048
  */
31037
31049
  awake() {
31038
- K.getXRSync(this.context);
31050
+ Z.getXRSync(this.context);
31039
31051
  }
31040
31052
  /**
31041
31053
  * Sets up the WebXR component when it's enabled. Checks for HTTPS connection,
@@ -31062,15 +31074,15 @@ const zl = x("debugwebxr"), VT = x("debugusdz"), ft = class ba extends E {
31062
31074
  * @returns A Promise that resolves to true if a session was offered, false otherwise
31063
31075
  */
31064
31076
  async handleOfferSession() {
31065
- return this.createVRButton && await K.isVRSupported() && this.createVRButton ? K.offerSession("immersive-vr", "default", this.context) : this.createARButton && await K.isARSupported() && this.createARButton ? K.offerSession("immersive-ar", "default", this.context) : !1;
31077
+ return this.createVRButton && await Z.isVRSupported() && this.createVRButton ? Z.offerSession("immersive-vr", "default", this.context) : this.createARButton && await Z.isARSupported() && this.createARButton ? Z.offerSession("immersive-ar", "default", this.context) : !1;
31066
31078
  }
31067
31079
  /** the currently active webxr input session */
31068
31080
  get session() {
31069
- return K.active ?? null;
31081
+ return Z.active ?? null;
31070
31082
  }
31071
31083
  /** immersive-vr or immersive-ar */
31072
31084
  get sessionMode() {
31073
- return K.activeMode ?? null;
31085
+ return Z.activeMode ?? null;
31074
31086
  }
31075
31087
  /** While AR: this will return the currently active WebARSessionRoot component.
31076
31088
  * You can also query this component in your scene with `findObjectOfType(WebARSessionRoot)`
@@ -31083,21 +31095,21 @@ const zl = x("debugwebxr"), VT = x("debugusdz"), ft = class ba extends E {
31083
31095
  * This is a shorthand for `NeedleXRSession.start("immersive-vr", init, this.context)`
31084
31096
  */
31085
31097
  async enterVR(e) {
31086
- return K.start("immersive-vr", e, this.context);
31098
+ return Z.start("immersive-vr", e, this.context);
31087
31099
  }
31088
31100
  /** Call to start an WebAR session
31089
31101
  *
31090
31102
  * This is a shorthand for `NeedleXRSession.start("immersive-ar", init, this.context)`
31091
31103
  */
31092
31104
  async enterAR(e) {
31093
- return K.start("immersive-ar", e, this.context);
31105
+ return Z.start("immersive-ar", e, this.context);
31094
31106
  }
31095
31107
  /** Call to end a WebXR (AR or VR) session.
31096
31108
  *
31097
31109
  * This is a shorthand for `NeedleXRSession.stop()`
31098
31110
  */
31099
31111
  exitXR() {
31100
- K.stop();
31112
+ Z.stop();
31101
31113
  }
31102
31114
  _exitXRMenuButton;
31103
31115
  _previousXRState = 0;
@@ -31240,7 +31252,7 @@ const zl = x("debugwebxr"), VT = x("debugusdz"), ft = class ba extends E {
31240
31252
  this.addButton(e);
31241
31253
  }
31242
31254
  }
31243
- if (this.createSendToQuestButton && !D.isQuest() && K.isVRSupported().then((e) => {
31255
+ if (this.createSendToQuestButton && !D.isQuest() && Z.isVRSupported().then((e) => {
31244
31256
  if (!e) {
31245
31257
  const t = this.getButtonsFactory().createSendToQuestButton();
31246
31258
  this.addButton(t);
@@ -31609,7 +31621,7 @@ class Pn extends E {
31609
31621
  const o = this._parentComponent.shadowComponent;
31610
31622
  o && (o?.add(e), n = !0);
31611
31623
  }
31612
- this.shadowComponent = e, t && t.shadowComponent && this.shadowComponent && t.shadowComponent.add(this.shadowComponent), Zc && e.add(new Mi(0.5)), this.onAfterAddedToScene(), n && d1(), HT && console.warn("Added shadow component", this.shadowComponent);
31624
+ this.shadowComponent = e, t && t.shadowComponent && this.shadowComponent && t.shadowComponent.add(this.shadowComponent), Kc && e.add(new Mi(0.5)), this.onAfterAddedToScene(), n && d1(), HT && console.warn("Added shadow component", this.shadowComponent);
31613
31625
  }
31614
31626
  setShadowComponentOwner(e) {
31615
31627
  if (e && (e[Si] === void 0 || e[Si] === this) && (e[Si] = this, e.children))
@@ -31671,15 +31683,15 @@ const fn = new _(), Ul = new ee(), ad = new V(), hl = class gx extends Pn {
31671
31683
  }
31672
31684
  _anchoredPosition;
31673
31685
  get anchoredPosition() {
31674
- return this._anchoredPosition || (this._anchoredPosition = new Z()), this._anchoredPosition;
31686
+ return this._anchoredPosition || (this._anchoredPosition = new K()), this._anchoredPosition;
31675
31687
  }
31676
31688
  set anchoredPosition(e) {
31677
31689
  this._anchoredPosition = e;
31678
31690
  }
31679
- sizeDelta = new Z(100, 100);
31680
- pivot = new Z(0.5, 0.5);
31681
- anchorMin = new Z(0, 0);
31682
- anchorMax = new Z(1, 1);
31691
+ sizeDelta = new K(100, 100);
31692
+ pivot = new K(0.5, 0.5);
31693
+ anchorMin = new K(0, 0);
31694
+ anchorMax = new K(1, 1);
31683
31695
  // @serializable(Vector2)
31684
31696
  // offsetMin: Vector2 = new Vector2(0, 0);
31685
31697
  // @serializable(Vector2)
@@ -31712,7 +31724,7 @@ const fn = new _(), Ul = new ee(), ad = new V(), hl = class gx extends Pn {
31712
31724
  _parentRectTransform;
31713
31725
  _lastUpdateFrame = -1;
31714
31726
  awake() {
31715
- super.awake(), this._lastUpdateFrame = -1, this._parentRectTransform = void 0, this.rectBlock = new R(), this.rectBlock.name = this.name, this.lastMatrix = new ee(), this._lastAnchoring = null, this._initialPosition = this.gameObject.position.clone(), this._initialPosition.z = 0, this._anchoredPosition || (this._anchoredPosition = new Z()), pa(this, "_anchoredPosition", () => {
31727
+ super.awake(), this._lastUpdateFrame = -1, this._parentRectTransform = void 0, this.rectBlock = new R(), this.rectBlock.name = this.name, this.lastMatrix = new ee(), this._lastAnchoring = null, this._initialPosition = this.gameObject.position.clone(), this._initialPosition.z = 0, this._anchoredPosition || (this._anchoredPosition = new K()), pa(this, "_anchoredPosition", () => {
31716
31728
  this.markDirty();
31717
31729
  }), pa(this, "sizeDelta", () => {
31718
31730
  this.markDirty();
@@ -31725,7 +31737,7 @@ const fn = new _(), Ul = new ee(), ad = new V(), hl = class gx extends Pn {
31725
31737
  });
31726
31738
  }
31727
31739
  onEnable() {
31728
- super.onEnable(), this.rectBlock || (this.rectBlock = new R()), this.lastMatrix || (this.lastMatrix = new ee()), this._lastAnchoring || (this._lastAnchoring = new Z()), this._initialPosition || (this._initialPosition = new _()), this._anchoredPosition || (this._anchoredPosition = new Z()), this.addShadowComponent(this.rectBlock), this._transformNeedsUpdate = !0, this.canvas?.registerTransform(this);
31740
+ super.onEnable(), this.rectBlock || (this.rectBlock = new R()), this.lastMatrix || (this.lastMatrix = new ee()), this._lastAnchoring || (this._lastAnchoring = new K()), this._initialPosition || (this._initialPosition = new _()), this._anchoredPosition || (this._anchoredPosition = new K()), this.addShadowComponent(this.rectBlock), this._transformNeedsUpdate = !0, this.canvas?.registerTransform(this);
31729
31741
  }
31730
31742
  onDisable() {
31731
31743
  super.onDisable(), this.removeShadowComponent(), this.canvas?.unregisterTransform(this);
@@ -31769,7 +31781,7 @@ const fn = new _(), Ul = new ee(), ad = new V(), hl = class gx extends Pn {
31769
31781
  _lastAnchoring;
31770
31782
  /** applies the position offset to the passed in vector */
31771
31783
  applyAnchoring(e) {
31772
- this._lastAnchoring || (this._lastAnchoring = new Z());
31784
+ this._lastAnchoring || (this._lastAnchoring = new K());
31773
31785
  const t = this._lastAnchoring.sub(this._anchoredPosition);
31774
31786
  this.gameObject.position.x += t.x, this.gameObject.position.y += t.y, this._lastAnchoring.copy(this._anchoredPosition), e.x += this._initialPosition.x - this.gameObject.position.x, e.y += this._initialPosition.y - this.gameObject.position.y, e.z += this._initialPosition.z - this.gameObject.position.z;
31775
31787
  const i = this._parentRectTransform;
@@ -31834,19 +31846,19 @@ const fn = new _(), Ul = new ee(), ad = new V(), hl = class gx extends Pn {
31834
31846
  }
31835
31847
  };
31836
31848
  fh([
31837
- u(Z)
31849
+ u(K)
31838
31850
  ], hl.prototype, "anchoredPosition", 1);
31839
31851
  fh([
31840
- u(Z)
31852
+ u(K)
31841
31853
  ], hl.prototype, "sizeDelta", 2);
31842
31854
  fh([
31843
- u(Z)
31855
+ u(K)
31844
31856
  ], hl.prototype, "pivot", 2);
31845
31857
  fh([
31846
- u(Z)
31858
+ u(K)
31847
31859
  ], hl.prototype, "anchorMin", 2);
31848
31860
  fh([
31849
- u(Z)
31861
+ u(K)
31850
31862
  ], hl.prototype, "anchorMax", 2);
31851
31863
  let ts = hl;
31852
31864
  var YT = Object.defineProperty, yx = (s, e, t, i) => {
@@ -31862,12 +31874,12 @@ yx([
31862
31874
  u(ae)
31863
31875
  ], ph.prototype, "effectColor");
31864
31876
  yx([
31865
- u(Z)
31877
+ u(K)
31866
31878
  ], ph.prototype, "effectDistance");
31867
- var KT = Object.defineProperty, ZT = Object.getOwnPropertyDescriptor, _x = (s, e, t, i) => {
31868
- for (var n = i > 1 ? void 0 : i ? ZT(e, t) : e, o = s.length - 1, r; o >= 0; o--)
31879
+ var ZT = Object.defineProperty, KT = Object.getOwnPropertyDescriptor, _x = (s, e, t, i) => {
31880
+ for (var n = i > 1 ? void 0 : i ? KT(e, t) : e, o = s.length - 1, r; o >= 0; o--)
31869
31881
  (r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
31870
- return i && n && KT(e, t, n), n;
31882
+ return i && n && ZT(e, t, n), n;
31871
31883
  };
31872
31884
  const or = {
31873
31885
  backgroundColor: new re(1, 1, 1),
@@ -33304,7 +33316,7 @@ const yi = class dr extends E {
33304
33316
  a.keepObject = (k) => {
33305
33317
  let M = !0;
33306
33318
  const I = C.getComponent(k, pi);
33307
- return I && !I.enabled && (M = !1), M && y.includes(k) && (M = !1), M && C.getComponentInParent(k, Zu) && (M = !1), M && C.getComponentInParent(k, $s) && (M = !1), Pt && !M && console.log("USDZExporter: Discarding object", k), M;
33319
+ return I && !I.enabled && (M = !1), M && y.includes(k) && (M = !1), M && C.getComponentInParent(k, Ku) && (M = !1), M && C.getComponentInParent(k, $s) && (M = !1), Pt && !M && console.log("USDZExporter: Discarding object", k), M;
33308
33320
  }, a.beforeWritingDocument = () => {
33309
33321
  if (L() && l && c) {
33310
33322
  const k = l.animatedRoots;
@@ -33519,7 +33531,7 @@ class fl extends E {
33519
33531
  _gizmoObject = null;
33520
33532
  _boxHelper = null;
33521
33533
  onEnable() {
33522
- this.isGizmo && !Zc || (this._gizmoObject || (this.objectBounds ? this._gizmoObject = new _C(this.gameObject, this.color ?? 16776960) : (this.objectBounds = !1, this._gizmoObject = Dg(this.color ?? 16776960))), this.objectBounds ? (this.scene.add(this._gizmoObject), this._boxHelper = this._gizmoObject, this.startCoroutine(this.syncObjectBounds(), Ce.OnBeforeRender)) : this.gameObject.add(this._gizmoObject));
33534
+ this.isGizmo && !Kc || (this._gizmoObject || (this.objectBounds ? this._gizmoObject = new _C(this.gameObject, this.color ?? 16776960) : (this.objectBounds = !1, this._gizmoObject = Dg(this.color ?? 16776960))), this.objectBounds ? (this.scene.add(this._gizmoObject), this._boxHelper = this._gizmoObject, this.startCoroutine(this.syncObjectBounds(), Ce.OnBeforeRender)) : this.gameObject.add(this._gizmoObject));
33523
33535
  }
33524
33536
  onDisable() {
33525
33537
  this._gizmoObject && this.gameObject.remove(this._gizmoObject);
@@ -33553,7 +33565,7 @@ class gh extends E {
33553
33565
  offset;
33554
33566
  /** @internal */
33555
33567
  onEnable() {
33556
- if (this.isGizmo && !Zc) return;
33568
+ if (this.isGizmo && !Kc) return;
33557
33569
  const e = this.size, t = this.divisions;
33558
33570
  this.gridHelper || (this.gridHelper = new Rv(e, t, this.color0 ?? new re(0.4, 0.4, 0.4), this.color1 ?? new re(0.6, 0.6, 0.6)), this.offset !== void 0 && (this.gridHelper.position.y += this.offset)), this.gridHelper && this.gameObject.add(this.gridHelper);
33559
33571
  }
@@ -34096,7 +34108,7 @@ const RA = x("debugnet"), gf = class Hm extends E {
34096
34108
  * @returns True if the connection is on a local network, false otherwise
34097
34109
  */
34098
34110
  static IsLocalNetwork(e = window.location.hostname) {
34099
- return Zi(e);
34111
+ return Ki(e);
34100
34112
  }
34101
34113
  };
34102
34114
  Ry([
@@ -34138,7 +34150,7 @@ class pl extends E {
34138
34150
  }
34139
34151
  this.affectPosition && At(this.gameObject, e);
34140
34152
  const n = new dt(this.rotationOffset.x, this.rotationOffset.y, this.rotationOffset.z), o = new V().setFromEuler(n);
34141
- this.affectRotation && Kn(this.gameObject, t.multiply(o));
34153
+ this.affectRotation && Zn(this.gameObject, t.multiply(o));
34142
34154
  const r = new _();
34143
34155
  this.from.getWorldDirection(r).multiplyScalar(50), this.levelLookDirection && (r.y = 0), this.alignLookDirection && this.gameObject.lookAt(r);
34144
34156
  }
@@ -35171,7 +35183,7 @@ S([
35171
35183
  S([
35172
35184
  u()
35173
35185
  ], He.prototype, "worldSpace");
35174
- class Ke {
35186
+ class Ze {
35175
35187
  enabled;
35176
35188
  space = 0;
35177
35189
  orbitalX;
@@ -35217,61 +35229,61 @@ class Ke {
35217
35229
  }
35218
35230
  S([
35219
35231
  u()
35220
- ], Ke.prototype, "enabled");
35232
+ ], Ze.prototype, "enabled");
35221
35233
  S([
35222
35234
  u()
35223
- ], Ke.prototype, "space");
35235
+ ], Ze.prototype, "space");
35224
35236
  S([
35225
35237
  u(Y)
35226
- ], Ke.prototype, "orbitalX");
35238
+ ], Ze.prototype, "orbitalX");
35227
35239
  S([
35228
35240
  u(Y)
35229
- ], Ke.prototype, "orbitalY");
35241
+ ], Ze.prototype, "orbitalY");
35230
35242
  S([
35231
35243
  u(Y)
35232
- ], Ke.prototype, "orbitalZ");
35244
+ ], Ze.prototype, "orbitalZ");
35233
35245
  S([
35234
35246
  u()
35235
- ], Ke.prototype, "orbitalXMultiplier");
35247
+ ], Ze.prototype, "orbitalXMultiplier");
35236
35248
  S([
35237
35249
  u()
35238
- ], Ke.prototype, "orbitalYMultiplier");
35250
+ ], Ze.prototype, "orbitalYMultiplier");
35239
35251
  S([
35240
35252
  u()
35241
- ], Ke.prototype, "orbitalZMultiplier");
35253
+ ], Ze.prototype, "orbitalZMultiplier");
35242
35254
  S([
35243
35255
  u()
35244
- ], Ke.prototype, "orbitalOffsetX");
35256
+ ], Ze.prototype, "orbitalOffsetX");
35245
35257
  S([
35246
35258
  u()
35247
- ], Ke.prototype, "orbitalOffsetY");
35259
+ ], Ze.prototype, "orbitalOffsetY");
35248
35260
  S([
35249
35261
  u()
35250
- ], Ke.prototype, "orbitalOffsetZ");
35262
+ ], Ze.prototype, "orbitalOffsetZ");
35251
35263
  S([
35252
35264
  u(Y)
35253
- ], Ke.prototype, "speedModifier");
35265
+ ], Ze.prototype, "speedModifier");
35254
35266
  S([
35255
35267
  u()
35256
- ], Ke.prototype, "speedModifierMultiplier");
35268
+ ], Ze.prototype, "speedModifierMultiplier");
35257
35269
  S([
35258
35270
  u(Y)
35259
- ], Ke.prototype, "x");
35271
+ ], Ze.prototype, "x");
35260
35272
  S([
35261
35273
  u()
35262
- ], Ke.prototype, "xMultiplier");
35274
+ ], Ze.prototype, "xMultiplier");
35263
35275
  S([
35264
35276
  u(Y)
35265
- ], Ke.prototype, "y");
35277
+ ], Ze.prototype, "y");
35266
35278
  S([
35267
35279
  u()
35268
- ], Ke.prototype, "yMultiplier");
35280
+ ], Ze.prototype, "yMultiplier");
35269
35281
  S([
35270
35282
  u(Y)
35271
- ], Ke.prototype, "z");
35283
+ ], Ze.prototype, "z");
35272
35284
  S([
35273
35285
  u()
35274
- ], Ke.prototype, "zMultiplier");
35286
+ ], Ze.prototype, "zMultiplier");
35275
35287
  class ri {
35276
35288
  animation;
35277
35289
  enabled;
@@ -35587,7 +35599,7 @@ S([
35587
35599
  u()
35588
35600
  ], Bi.prototype, "enabled");
35589
35601
  S([
35590
- u(Z)
35602
+ u(K)
35591
35603
  ], Bi.prototype, "range");
35592
35604
  S([
35593
35605
  u()
@@ -35629,7 +35641,7 @@ S([
35629
35641
  u()
35630
35642
  ], vh.prototype, "enabled");
35631
35643
  S([
35632
- u(Z)
35644
+ u(K)
35633
35645
  ], vh.prototype, "range");
35634
35646
  S([
35635
35647
  u(gl)
@@ -36317,8 +36329,8 @@ const Gt = class jd extends E {
36317
36329
  set subEmitterSystems(e) {
36318
36330
  for (let t = 0; t < e.length; t++) {
36319
36331
  const i = e[t];
36320
- if (!(i instanceof Km)) {
36321
- const n = new Km();
36332
+ if (!(i instanceof Zm)) {
36333
+ const n = new Zm();
36322
36334
  Ga(n, i), e[t] = n;
36323
36335
  }
36324
36336
  }
@@ -36440,7 +36452,7 @@ $e([
36440
36452
  u(He)
36441
36453
  ], Gt.prototype, "trails");
36442
36454
  $e([
36443
- u(Ke)
36455
+ u(Ze)
36444
36456
  ], Gt.prototype, "velocityOverLifetime");
36445
36457
  $e([
36446
36458
  u(xt)
@@ -36464,7 +36476,7 @@ $e([
36464
36476
  u(Bi)
36465
36477
  ], Gt.prototype, "sizeBySpeed");
36466
36478
  let mu = Gt;
36467
- class Km {
36479
+ class Zm {
36468
36480
  particleSystem;
36469
36481
  emitProbability = 1;
36470
36482
  properties;
@@ -36569,9 +36581,9 @@ class Qc extends E {
36569
36581
  }
36570
36582
  }
36571
36583
  const hc = x("debugpost");
36572
- let Zm = null;
36584
+ let Km = null;
36573
36585
  function XA(s) {
36574
- Zm = s;
36586
+ Km = s;
36575
36587
  }
36576
36588
  function Dx(s) {
36577
36589
  let e = s.gameObject;
@@ -36586,10 +36598,10 @@ function Dx(s) {
36586
36598
  function QA(s) {
36587
36599
  let e = Dx(s);
36588
36600
  if (!e)
36589
- if (Zm) {
36601
+ if (Km) {
36590
36602
  hc && console.warn("Adding postprocessing manager to the scene.");
36591
36603
  const t = s.scene;
36592
- e = Xn(t, Zm);
36604
+ e = Xn(t, Km);
36593
36605
  } else
36594
36606
  L() && console.warn("No post processing manager found");
36595
36607
  return e;
@@ -36614,22 +36626,22 @@ const pt = {
36614
36626
  /** Used to render effects at the end of the post-processing chain, e.g. for final adjustments or overlays. */
36615
36627
  AT_END: 1e4
36616
36628
  };
36617
- let Ze = null;
36629
+ let Ke = null;
36618
36630
  function YA(s) {
36619
- if (hc === "verbose" && console.debug("Before ordering effects", [...s]), !Ze) {
36620
- Ze = /* @__PURE__ */ new Map(), Ze.set(A.POSTPROCESSING.MODULE.NormalPass, pt.NormalPass), Ze.set(A.POSTPROCESSING.MODULE.DepthDownsamplingPass, pt.DepthDownsamplingPass), Ze.set(A.POSTPROCESSING.MODULE.SMAAEffect, pt.SMAA), Ze.set(A.POSTPROCESSING.MODULE.SSAOEffect, pt.SSAO);
36631
+ if (hc === "verbose" && console.debug("Before ordering effects", [...s]), !Ke) {
36632
+ Ke = /* @__PURE__ */ new Map(), Ke.set(A.POSTPROCESSING.MODULE.NormalPass, pt.NormalPass), Ke.set(A.POSTPROCESSING.MODULE.DepthDownsamplingPass, pt.DepthDownsamplingPass), Ke.set(A.POSTPROCESSING.MODULE.SMAAEffect, pt.SMAA), Ke.set(A.POSTPROCESSING.MODULE.SSAOEffect, pt.SSAO);
36621
36633
  const e = A.POSTPROCESSING_AO.MAYBEMODULE;
36622
- e && (Ze.set(e.N8AOPostPass, pt.SSAO), Ze.set(e.N8AOPass, pt.SSAO)), Ze.set(A.POSTPROCESSING.MODULE.TiltShiftEffect, pt.TiltShift), Ze.set(A.POSTPROCESSING.MODULE.DepthOfFieldEffect, pt.DepthOfField), Ze.set(A.POSTPROCESSING.MODULE.ChromaticAberrationEffect, pt.ChromaticAberration), Ze.set(A.POSTPROCESSING.MODULE.BloomEffect, pt.Bloom), Ze.set(A.POSTPROCESSING.MODULE.SelectiveBloomEffect, pt.Bloom), Ze.set(A.POSTPROCESSING.MODULE.VignetteEffect, pt.Vignette), Ze.set(A.POSTPROCESSING.MODULE.PixelationEffect, pt.Pixelation), Ze.set(A.POSTPROCESSING.MODULE.ToneMappingEffect, pt.ToneMapping), Ze.set(A.POSTPROCESSING.MODULE.HueSaturationEffect, pt.HueSaturation), Ze.set(A.POSTPROCESSING.MODULE.BrightnessContrastEffect, pt.BrightnessContrast);
36634
+ e && (Ke.set(e.N8AOPostPass, pt.SSAO), Ke.set(e.N8AOPass, pt.SSAO)), Ke.set(A.POSTPROCESSING.MODULE.TiltShiftEffect, pt.TiltShift), Ke.set(A.POSTPROCESSING.MODULE.DepthOfFieldEffect, pt.DepthOfField), Ke.set(A.POSTPROCESSING.MODULE.ChromaticAberrationEffect, pt.ChromaticAberration), Ke.set(A.POSTPROCESSING.MODULE.BloomEffect, pt.Bloom), Ke.set(A.POSTPROCESSING.MODULE.SelectiveBloomEffect, pt.Bloom), Ke.set(A.POSTPROCESSING.MODULE.VignetteEffect, pt.Vignette), Ke.set(A.POSTPROCESSING.MODULE.PixelationEffect, pt.Pixelation), Ke.set(A.POSTPROCESSING.MODULE.ToneMappingEffect, pt.ToneMapping), Ke.set(A.POSTPROCESSING.MODULE.HueSaturationEffect, pt.HueSaturation), Ke.set(A.POSTPROCESSING.MODULE.BrightnessContrastEffect, pt.BrightnessContrast);
36623
36635
  }
36624
36636
  s.sort((e, t) => {
36625
- const i = typeof e.priority == "number" ? e.priority : Ze.get(e.effect.constructor) ?? Number.NEGATIVE_INFINITY, n = typeof t.priority == "number" ? t.priority : Ze.get(t.effect.constructor) ?? Number.NEGATIVE_INFINITY;
36637
+ const i = typeof e.priority == "number" ? e.priority : Ke.get(e.effect.constructor) ?? Number.NEGATIVE_INFINITY, n = typeof t.priority == "number" ? t.priority : Ke.get(t.effect.constructor) ?? Number.NEGATIVE_INFINITY;
36626
36638
  return i === Number.NEGATIVE_INFINITY ? (hc && console.warn("Unknown effect found: ", e.constructor.name, e), 1) : n === Number.NEGATIVE_INFINITY ? (hc && console.warn("Unknown effect found: ", t.constructor.name, t), -1) : i - n;
36627
36639
  }), hc === "verbose" && console.debug("After ordering effects", [...s]);
36628
36640
  }
36629
- var KA = Object.defineProperty, ZA = Object.getOwnPropertyDescriptor, jx = (s, e, t, i) => {
36630
- for (var n = ZA(e, t), o = s.length - 1, r; o >= 0; o--)
36641
+ var ZA = Object.defineProperty, KA = Object.getOwnPropertyDescriptor, jx = (s, e, t, i) => {
36642
+ for (var n = KA(e, t), o = s.length - 1, r; o >= 0; o--)
36631
36643
  (r = s[o]) && (n = r(e, t, n) || n);
36632
- return n && KA(e, t, n), n;
36644
+ return n && ZA(e, t, n), n;
36633
36645
  };
36634
36646
  const JA = x("debugpost");
36635
36647
  class $ {
@@ -36932,7 +36944,7 @@ class wf extends ut {
36932
36944
  intensity = new $(0);
36933
36945
  onCreateEffect() {
36934
36946
  const e = new A.POSTPROCESSING.MODULE.ChromaticAberrationEffect();
36935
- return e.offset = new Z(0, 0), e.radialModulation = !0, e.modulationOffset = 0.15, this.intensity.valueProcessor = (t) => t * 0.02, this.intensity.onValueChanged = (t) => {
36947
+ return e.offset = new K(0, 0), e.radialModulation = !0, e.modulationOffset = 0.15, this.intensity.valueProcessor = (t) => t * 0.02, this.intensity.onValueChanged = (t) => {
36936
36948
  e.offset.x = -t, e.offset.y = t;
36937
36949
  }, e;
36938
36950
  }
@@ -37267,7 +37279,7 @@ xh([
37267
37279
  u($)
37268
37280
  ], Wo.prototype, "luminanceInfluence");
37269
37281
  Tn("ScreenSpaceAmbientOcclusion", Wo);
37270
- var wI = Object.defineProperty, Kr = (s, e, t, i) => {
37282
+ var wI = Object.defineProperty, Zr = (s, e, t, i) => {
37271
37283
  for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
37272
37284
  (r = s[o]) && (n = r(e, t, n) || n);
37273
37285
  return n && wI(e, t, n), n;
@@ -37327,27 +37339,27 @@ class as extends ut {
37327
37339
  }, n;
37328
37340
  }
37329
37341
  }
37330
- Kr([
37342
+ Zr([
37331
37343
  Wt(),
37332
37344
  u()
37333
37345
  ], as.prototype, "gammaCorrection");
37334
- Kr([
37346
+ Zr([
37335
37347
  u($)
37336
37348
  ], as.prototype, "aoRadius");
37337
- Kr([
37349
+ Zr([
37338
37350
  u($)
37339
37351
  ], as.prototype, "falloff");
37340
- Kr([
37352
+ Zr([
37341
37353
  u($)
37342
37354
  ], as.prototype, "intensity");
37343
- Kr([
37355
+ Zr([
37344
37356
  u($)
37345
37357
  ], as.prototype, "color");
37346
- Kr([
37358
+ Zr([
37347
37359
  Wt(),
37348
37360
  u()
37349
37361
  ], as.prototype, "screenspaceRadius");
37350
- Kr([
37362
+ Zr([
37351
37363
  Wt(),
37352
37364
  u()
37353
37365
  ], as.prototype, "quality");
@@ -37725,7 +37737,7 @@ class Yc {
37725
37737
  format: f.texture.format,
37726
37738
  type: Bf,
37727
37739
  depthBuffer: f.depthBuffer,
37728
- depthTexture: f.depthTexture ? new Av(f.width, f.height) : void 0,
37740
+ depthTexture: f.depthTexture ? new Av(f.width, f.height) : null,
37729
37741
  stencilBuffer: f.stencilBuffer,
37730
37742
  samples: Math.max(0, this._multisampling),
37731
37743
  minFilter: f.texture.minFilter ?? $d,
@@ -38484,10 +38496,10 @@ class LI {
38484
38496
  }), window.addEventListener("wheel", this._onMouseWheelFn = (n) => {
38485
38497
  this.overlay.enabled && (e.zoom += n.deltaY * 5e-4, n.preventDefault());
38486
38498
  }, { passive: !1 });
38487
- const t = new Z();
38499
+ const t = new K();
38488
38500
  window.addEventListener("mousemove", (n) => {
38489
38501
  if (this.overlay.enabled && this.context.input.getPointerPressed(0)) {
38490
- const o = new Z(n.movementX, n.movementY);
38502
+ const o = new K(n.movementX, n.movementY);
38491
38503
  o.x /= this.context.domElement.clientWidth, o.y /= this.context.domElement.clientHeight, t.set(o.x, o.y), t.multiplyScalar(e.zoom / -this.context.time.deltaTime * 0.01), e.offset = e.offset.add(t);
38492
38504
  }
38493
38505
  }), window.addEventListener("pointermove", (n) => {
@@ -38526,7 +38538,7 @@ class DI extends Qn {
38526
38538
  const t = this.uniforms.offsetScale.value;
38527
38539
  t.x = e.x, t.y = e.y, this.uniforms.offsetScale.value = t, this.needsUpdate = !0;
38528
38540
  }
38529
- _offset = new Z();
38541
+ _offset = new K();
38530
38542
  get offset() {
38531
38543
  const e = this.uniforms.offsetScale.value;
38532
38544
  return this._offset.set(e.x, e.y), this._offset;
@@ -38610,7 +38622,7 @@ var jI = Object.defineProperty, BI = Object.getOwnPropertyDescriptor, Sh = (s, e
38610
38622
  };
38611
38623
  const kt = x("debugscreensharing");
38612
38624
  var Wx = /* @__PURE__ */ ((s) => (s[s.Screen = 0] = "Screen", s[s.Camera = 1] = "Camera", s[s.Canvas = 2] = "Canvas", s[s.Microphone = 3] = "Microphone", s))(Wx || {});
38613
- class Zr extends E {
38625
+ class Kr extends E {
38614
38626
  allowStartOnClick = !0;
38615
38627
  /** @internal */
38616
38628
  onPointerEnter() {
@@ -38878,19 +38890,19 @@ class Zr extends E {
38878
38890
  }
38879
38891
  Sh([
38880
38892
  u()
38881
- ], Zr.prototype, "allowStartOnClick", 2);
38893
+ ], Kr.prototype, "allowStartOnClick", 2);
38882
38894
  Sh([
38883
38895
  u()
38884
- ], Zr.prototype, "autoConnect", 2);
38896
+ ], Kr.prototype, "autoConnect", 2);
38885
38897
  Sh([
38886
38898
  u(_t)
38887
- ], Zr.prototype, "videoPlayer", 1);
38899
+ ], Kr.prototype, "videoPlayer", 1);
38888
38900
  Sh([
38889
38901
  u()
38890
- ], Zr.prototype, "device", 2);
38902
+ ], Kr.prototype, "device", 2);
38891
38903
  Sh([
38892
38904
  u()
38893
- ], Zr.prototype, "deviceName", 2);
38905
+ ], Kr.prototype, "deviceName", 2);
38894
38906
  var FI = Object.defineProperty, wl = (s, e, t, i) => {
38895
38907
  for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
38896
38908
  (r = s[o]) && (n = r(e, t, n) || n);
@@ -39361,7 +39373,7 @@ class zy extends E {
39361
39373
  _debug;
39362
39374
  _networking;
39363
39375
  awake() {
39364
- if (this._debug = new QI(this.context, this), this._networking = new ZI(this.context, this), this._networking.awake(), C.setActive(this.gameObject, !1), this.cam = C.getComponent(this.gameObject, ki), !this.cam) {
39376
+ if (this._debug = new QI(this.context, this), this._networking = new KI(this.context, this), this._networking.awake(), C.setActive(this.gameObject, !1), this.cam = C.getComponent(this.gameObject, ki), !this.cam) {
39365
39377
  console.warn("SpectatorCamera: Spectator camera needs camera component on the same object.", this);
39366
39378
  return;
39367
39379
  }
@@ -39582,14 +39594,14 @@ class YI {
39582
39594
  this.guid = e, this.targetUserId = t, this.stoppedFollowing = i;
39583
39595
  }
39584
39596
  }
39585
- class KI {
39597
+ class ZI {
39586
39598
  guid;
39587
39599
  userId;
39588
39600
  constructor(e, t) {
39589
39601
  this.guid = e.guid, this.userId = t;
39590
39602
  }
39591
39603
  }
39592
- class ZI {
39604
+ class KI {
39593
39605
  /** List of user IDs currently following this player */
39594
39606
  followers = [];
39595
39607
  context;
@@ -39632,7 +39644,7 @@ class ZI {
39632
39644
  onRequestFollowMe(e = !1) {
39633
39645
  if (Ci && console.log("Request follow", this.context.connection.connectionId), this.context.connection.connectionId) {
39634
39646
  this.spectator.stopSpectating();
39635
- const t = e ? void 0 : this.context.connection.connectionId, i = new KI(this.spectator, t);
39647
+ const t = e ? void 0 : this.context.connection.connectionId, i = new ZI(this.spectator, t);
39636
39648
  this.context.connection.send("spectator-request-follow", i);
39637
39649
  }
39638
39650
  }
@@ -40000,7 +40012,7 @@ class Sl extends E {
40000
40012
  this._debugLine?.removeFromParent(), this._debugLine = null;
40001
40013
  const e = new Nd({
40002
40014
  color: 6684927
40003
- }), t = this.spline.length * 10, i = this._curve.getPoints(t), n = new Ki().setFromPoints(i);
40015
+ }), t = this.spline.length * 10, i = this._curve.getPoints(t), n = new Zi().setFromPoints(i);
40004
40016
  this._debugLine = new $a(n, e), this.gameObject?.add(this._debugLine);
40005
40017
  }
40006
40018
  }
@@ -40584,7 +40596,7 @@ class Cl extends E {
40584
40596
  orbit;
40585
40597
  /** @internal */
40586
40598
  onEnable() {
40587
- if (!(this.isGizmo && !Zc) && this.context.mainCamera && (this._control || (this._control = new XC(this.context.mainCamera, this.context.renderer.domElement), this._control.enabled = !0, this._control.getRaycaster().layers.set(2), this._control.size = 1, ("_root" in this._control ? this._control._root : this._control).traverse((t) => {
40599
+ if (!(this.isGizmo && !Kc) && this.context.mainCamera && (this._control || (this._control = new XC(this.context.mainCamera, this.context.renderer.domElement), this._control.enabled = !0, this._control.getRaycaster().layers.set(2), this._control.size = 1, ("_root" in this._control ? this._control._root : this._control).traverse((t) => {
40588
40600
  const i = t;
40589
40601
  if (i.layers.set(2), i) {
40590
40602
  const n = i.material;
@@ -41098,8 +41110,8 @@ Mf([
41098
41110
  Mf([
41099
41111
  u(ce)
41100
41112
  ], Oh.prototype, "onEndEdit");
41101
- let Kx = Oh;
41102
- var bL = Object.defineProperty, Zx = (s, e, t, i) => {
41113
+ let Zx = Oh;
41114
+ var bL = Object.defineProperty, Kx = (s, e, t, i) => {
41103
41115
  for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
41104
41116
  (r = s[o]) && (n = r(e, t, n) || n);
41105
41117
  return n && bL(e, t, n), n;
@@ -41145,10 +41157,10 @@ class Ef extends E {
41145
41157
  this._object?.removeFromParent();
41146
41158
  }
41147
41159
  }
41148
- Zx([
41160
+ Kx([
41149
41161
  u()
41150
41162
  ], Ef.prototype, "id");
41151
- Zx([
41163
+ Kx([
41152
41164
  u()
41153
41165
  ], Ef.prototype, "keepAspect");
41154
41166
  var vL = Object.defineProperty, Tf = (s, e, t, i) => {
@@ -41302,7 +41314,7 @@ class Wy extends E {
41302
41314
  if (!t) return;
41303
41315
  const i = t.clientX / window.innerWidth * 2 - 1, n = -(t.clientY / window.innerHeight) * 2 + 1;
41304
41316
  this.context.physics.raycast({
41305
- screenPoint: new Z(i, n)
41317
+ screenPoint: new K(i, n)
41306
41318
  }).length > 0 && (this._touchDidHitAnything = !0);
41307
41319
  };
41308
41320
  onTouchEnd = (e) => {
@@ -41883,7 +41895,7 @@ function AL(s, e) {
41883
41895
  const r = new de();
41884
41896
  i.map = e, s.render(o, r);
41885
41897
  }
41886
- function W2(s, e, t, i = "image/webp", n) {
41898
+ function WD(s, e, t, i = "image/webp", n) {
41887
41899
  return sS({ context: s, width: e, height: t, mimeType: i, camera: n });
41888
41900
  }
41889
41901
  function sS(s) {
@@ -41922,8 +41934,8 @@ function sS(s) {
41922
41934
  const j = "type" in s && s.type === "texture";
41923
41935
  let B = null;
41924
41936
  j && (B = new Yn(n, o, {
41925
- wrapS: Ky,
41926
- wrapT: Ky,
41937
+ wrapS: Zy,
41938
+ wrapT: Zy,
41927
41939
  format: 1023
41928
41940
  }), a.setRenderTarget(B));
41929
41941
  let G = c;
@@ -42185,13 +42197,13 @@ void main() {
42185
42197
  }
42186
42198
  `
42187
42199
  );
42188
- var FL = Object.defineProperty, Ko = (s, e, t, i) => {
42200
+ var FL = Object.defineProperty, Zo = (s, e, t, i) => {
42189
42201
  for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
42190
42202
  (r = s[o]) && (n = r(e, t, n) || n);
42191
42203
  return n && FL(e, t, n), n;
42192
42204
  };
42193
42205
  const Oc = x("debugimagetracking");
42194
- class Kc {
42206
+ class Zc {
42195
42207
  /** URL of the tracked marker image */
42196
42208
  get url() {
42197
42209
  return this._trackedImage.image ?? "";
@@ -42253,8 +42265,8 @@ class Kc {
42253
42265
  _rotation;
42254
42266
  ensureTransformData() {
42255
42267
  if (!this._position) {
42256
- this._position = Kc._positionBuffer.get(), this._rotation = Kc._rotationBuffer.get();
42257
- const e = this._pose.transform, t = K.active.convertSpace(e);
42268
+ this._position = Zc._positionBuffer.get(), this._rotation = Zc._rotationBuffer.get();
42269
+ const e = this._pose.transform, t = Z.active.convertSpace(e);
42258
42270
  this._position.copy(t?.position), this._rotation.copy(t?.quaternion);
42259
42271
  }
42260
42272
  }
@@ -42266,7 +42278,7 @@ class Kc {
42266
42278
  this._trackingComponent = e, this._trackedImage = t, this._bitmap = i, this.measuredSize = n, this.state = o, this._pose = r;
42267
42279
  }
42268
42280
  }
42269
- class Zo {
42281
+ class Ko {
42270
42282
  /**
42271
42283
  * Creates a new image tracking configuration.
42272
42284
  *
@@ -42304,24 +42316,24 @@ class Zo {
42304
42316
  return null;
42305
42317
  }
42306
42318
  }
42307
- Ko([
42319
+ Zo([
42308
42320
  u(URL)
42309
- ], Zo.prototype, "image");
42310
- Ko([
42321
+ ], Ko.prototype, "image");
42322
+ Zo([
42311
42323
  u()
42312
- ], Zo.prototype, "widthInMeters");
42313
- Ko([
42324
+ ], Ko.prototype, "widthInMeters");
42325
+ Zo([
42314
42326
  u(ne)
42315
- ], Zo.prototype, "object");
42316
- Ko([
42327
+ ], Ko.prototype, "object");
42328
+ Zo([
42317
42329
  u()
42318
- ], Zo.prototype, "createObjectInstance");
42319
- Ko([
42330
+ ], Ko.prototype, "createObjectInstance");
42331
+ Zo([
42320
42332
  u()
42321
- ], Zo.prototype, "imageDoesNotMove");
42322
- Ko([
42333
+ ], Ko.prototype, "imageDoesNotMove");
42334
+ Zo([
42323
42335
  u()
42324
- ], Zo.prototype, "hideWhenTrackingIsLost");
42336
+ ], Ko.prototype, "hideWhenTrackingIsLost");
42325
42337
  class zL {
42326
42338
  constructor(e, t) {
42327
42339
  this.exporter = e, this.component = t, Oc && console.log(this), this.exporter.anchoringType = "image";
@@ -42512,7 +42524,7 @@ class Df extends E {
42512
42524
  for (const r of n) {
42513
42525
  const a = r.trackingState, l = r.index, c = this.trackedImageIndexMap.get(l);
42514
42526
  if (c) {
42515
- const h = t.getPose(r.imageSpace, o), d = new Kc(this, c, r.image, r.measuredSize, a, h);
42527
+ const h = t.getPose(r.imageSpace, o), d = new Zc(this, c, r.image, r.measuredSize, a, h);
42516
42528
  this.currentImages.push(d);
42517
42529
  } else
42518
42530
  Oc && console.warn("No tracked image for index", l);
@@ -42546,7 +42558,7 @@ class Df extends E {
42546
42558
  }
42547
42559
  }
42548
42560
  onImageTrackingUpdate = (e) => {
42549
- const t = K.active;
42561
+ const t = Z.active;
42550
42562
  if (t)
42551
42563
  for (const i of e) {
42552
42564
  const n = i.model, o = i.state === "tracked";
@@ -42568,10 +42580,10 @@ class Df extends E {
42568
42580
  }
42569
42581
  };
42570
42582
  }
42571
- Ko([
42572
- u(Zo)
42583
+ Zo([
42584
+ u(Ko)
42573
42585
  ], Df.prototype, "trackedImages");
42574
- Ko([
42586
+ Zo([
42575
42587
  u()
42576
42588
  ], Df.prototype, "smooth");
42577
42589
  const Rc = /* @__PURE__ */ new Map(), pd = /* @__PURE__ */ new Map();
@@ -42769,7 +42781,7 @@ class Jo extends E {
42769
42781
  if (f.userData.normalsHelper)
42770
42782
  f.userData.normalsHelper.update();
42771
42783
  else {
42772
- const p = new KC(f, 0.05, 255);
42784
+ const p = new ZC(f, 0.05, 255);
42773
42785
  p.layers.disableAll(), p.layers.set(2), this.context.scene.add(p), f.userData.normalsHelper = p;
42774
42786
  }
42775
42787
  }));
@@ -42792,7 +42804,7 @@ class Jo extends E {
42792
42804
  return !0;
42793
42805
  }
42794
42806
  createGeometry(e) {
42795
- return "polygon" in e ? this.createPlaneGeometry(e.polygon) : "vertices" in e && "indices" in e ? this.createMeshGeometry(e.vertices, e.indices) : new Ki();
42807
+ return "polygon" in e ? this.createPlaneGeometry(e.polygon) : "vertices" in e && "indices" in e ? this.createMeshGeometry(e.vertices, e.indices) : new Zi();
42796
42808
  }
42797
42809
  // we cache vertices-to-geometry, because it looks like when we get an update sometimes the geometry stays the same.
42798
42810
  // so we don't want to re-create the geometry every time.
@@ -42801,7 +42813,7 @@ class Jo extends E {
42801
42813
  const i = e.toString() + "_" + t.toString();
42802
42814
  if (this._verticesCache.has(i))
42803
42815
  return this._verticesCache.get(i);
42804
- const n = new Ki();
42816
+ const n = new Zi();
42805
42817
  n.setIndex(new tt(t, 1)), n.setAttribute("position", new tt(e, 3));
42806
42818
  const o = Array();
42807
42819
  for (let r = 0; r < e.length; r += 3)
@@ -42809,7 +42821,7 @@ class Jo extends E {
42809
42821
  return n.setAttribute("uv", new tt(e, 3)), n.computeVertexNormals(), this._verticesCache.set(i, n), n;
42810
42822
  }
42811
42823
  createPlaneGeometry(e) {
42812
- const t = new Ki(), i = [], n = [];
42824
+ const t = new Zi(), i = [], n = [];
42813
42825
  e.forEach((f) => {
42814
42826
  i.push(f.x, f.y, f.z), n.push(f.x, f.z);
42815
42827
  });
@@ -42858,7 +42870,7 @@ class Hy extends E {
42858
42870
  * Note that this might modify the priority of this rig to be the highest.
42859
42871
  */
42860
42872
  setAsActiveXRRig() {
42861
- K.active?.setRigActive(this);
42873
+ Z.active?.setRigActive(this);
42862
42874
  }
42863
42875
  /**
42864
42876
  * Sets the priority of the rig.
@@ -42903,7 +42915,7 @@ class WL extends E {
42903
42915
  }
42904
42916
  }
42905
42917
  function VL() {
42906
- P.add("AlignmentConstraint", qu), P.add("Animation", ii), P.add("Animator", It), P.add("AudioListener", _o), P.add("AudioSource", tn), P.add("Avatar_Brain_LookAt", hu), P.add("Avatar_MouthShapes", Qu), P.add("Avatar_MustacheShake", xw), P.add("AvatarBlink_Simple", nl), P.add("AvatarEyeLook_Rotation", kw), P.add("AxesHelper", ah), P.add("BasicIKConstraint", Ow), P.add("BoxHelperComponent", Ft), P.add("Camera", ki), P.add("CharacterController", sl), P.add("CharacterControllerInput", Lo), P.add("SphereCollider", lh), P.add("BoxCollider", ny), P.add("MeshCollider", Hr), P.add("CapsuleCollider", Mo), P.add("ContactShadows", Zu), P.add("LogStats", Ew), P.add("DeleteBox", Cr), P.add("Deletable", Aw), P.add("DeviceFlag", sy), P.add("DragControls", Sa), P.add("DropListener", jo), P.add("Duplicatable", Vw), P.add("EventListEvent", Ng), P.add("EventTrigger", ly), P.add("GltfExportBox", Qw), P.add("GltfExport", Yw), P.add("VariantAction", rx), P.add("ChangeTransformOnClick", ll), P.add("ChangeMaterialOnClick", ax), P.add("SetActiveOnClick", lx), P.add("HideOnStart", gn), P.add("EmphasizeOnClick", dh), P.add("PlayAudioOnClick", Ir), P.add("PlayAnimationOnClick", fu), P.add("PreliminaryAction", uh), P.add("PreliminaryTrigger", rf), P.add("VisibilityAction", af), P.add("TapGestureTrigger", cx), P.add("USDZExporter", Ts), P.add("Fog", mh), P.add("BoxGizmo", fl), P.add("GridHelper", gh), P.add("GroundProjectedEnv", $s), P.add("UsageMarker", Ju), P.add("Interactable", Tw), P.add("FixedJoint", Ox), P.add("HingeJoint", pf), P.add("Light", Ht), P.add("LODGroup", ky), P.add("LookAtConstraint", il), P.add("NeedleMenu", Hs), P.add("NestedGltf", _h), P.add("Networking", Rx), P.add("OffsetConstraint", pl), P.add("CameraTargetReachedEvent", ru), P.add("OrbitControls", me), P.add("ParticleSystemRenderer", En), P.add("ParticleSystem", mu), P.add("Attractor", wh), P.add("PlayerColor", Qc), P.add("Antialiasing", bf), P.add("BloomEffect", Ly), P.add("ChromaticAberration", wf), P.add("ColorAdjustments", Qr), P.add("DepthOfField", rs), P.add("EffectWrapper", gu), P.add("PixelationEffect", Sf), P.add("ScreenSpaceAmbientOcclusion", Wo), P.add("ScreenSpaceAmbientOcclusionN8", as), P.add("SharpeningEffect", Cf), P.add("TiltShiftEffect", Xs), P.add("ToneMappingEffect", Br), P.add("Vignette", bl), P.add("Volume", vl), P.add("ReflectionProbe", uo), P.add("Renderer", pi), P.add("MeshRenderer", tf), P.add("SkinnedMeshRenderer", $w), P.add("Rigidbody", it), P.add("SceneSwitcher", nt), P.add("ScreenCapture", Zr), P.add("SeeThrough", Vo), P.add("ShadowCatcher", Pf), P.add("RemoteSkybox", Zg), P.add("SmoothFollow", By), P.add("SpatialTriggerReceiver", As), P.add("SpatialTrigger", Fy), P.add("SpectatorCamera", zy), P.add("SplineContainer", Sl), P.add("SplineWalker", An), P.add("SpriteRenderer", Li), P.add("SyncedCamera", Xx), P.add("SyncedRoom", ls), P.add("SyncedTransform", es), P.add("TestRunner", Qx), P.add("TestSimulateUserData", Yx), P.add("PlayableDirector", Hc), P.add("SignalReceiver", Gu), P.add("AnimationTrackHandler", au), P.add("AudioTrackHandler", bo), P.add("MarkerTrackHandler", qg), P.add("SignalTrackHandler", lu), P.add("ControlTrackHandler", Xg), P.add("TransformGizmo", Cl), P.add("BaseUIComponent", Pn), P.add("UIRootComponent", df), P.add("Button", Xo), P.add("Canvas", qc), P.add("CanvasGroup", jr), P.add("EventSystem", fi), P.add("Graphic", uf), P.add("MaskableGraphic", ff), P.add("Image", kh), P.add("RawImage", Ny), P.add("InputField", Kx), P.add("VerticalLayoutGroup", wx), P.add("HorizontalLayoutGroup", xx), P.add("GridLayoutGroup", Sx), P.add("Outline", ph), P.add("ObjectRaycaster", Cn), P.add("GraphicRaycaster", Wg), P.add("SpatialGrabRaycaster", Ja), P.add("RectTransform", ts), P.add("SpatialHtml", Ef), P.add("Text", si), P.add("EnvironmentScene", Yg), P.add("LookAt", eS), P.add("OpenURL", Mh), P.add("VideoPlayer", _t), P.add("Voip", Vr), P.add("ClickThrough", Wy), P.add("CursorFollow", Pl), P.add("HoverAnimation", Us), P.add("ScrollFollow", Qo), P.add("ViewBox", ct), P.add("Avatar", Dr), P.add("XRControllerFollow", Yo), P.add("XRControllerModel", Eo), P.add("XRControllerMovement", sn), P.add("TeleportTarget", gy), P.add("WebARCameraBackground", Lf), P.add("WebARSessionRoot", bn), P.add("WebXR", yy), P.add("AvatarMarker", Ue), P.add("WebXRImageTracking", Df), P.add("WebXRPlaneTracking", Jo), P.add("XRRig", Hy), P.add("XRFlag", yn), P.add("PlayerSync", ux), P.add("PlayerState", vn), P.add("PresentationMode", WL);
42918
+ P.add("AlignmentConstraint", qu), P.add("Animation", ii), P.add("Animator", It), P.add("AudioListener", _o), P.add("AudioSource", tn), P.add("Avatar_Brain_LookAt", hu), P.add("Avatar_MouthShapes", Qu), P.add("Avatar_MustacheShake", xw), P.add("AvatarBlink_Simple", nl), P.add("AvatarEyeLook_Rotation", kw), P.add("AxesHelper", ah), P.add("BasicIKConstraint", Ow), P.add("BoxHelperComponent", Ft), P.add("Camera", ki), P.add("CharacterController", sl), P.add("CharacterControllerInput", Lo), P.add("SphereCollider", lh), P.add("BoxCollider", ny), P.add("MeshCollider", Hr), P.add("CapsuleCollider", Mo), P.add("ContactShadows", Ku), P.add("LogStats", Ew), P.add("DeleteBox", Cr), P.add("Deletable", Aw), P.add("DeviceFlag", sy), P.add("DragControls", Sa), P.add("DropListener", jo), P.add("Duplicatable", Vw), P.add("EventListEvent", Ng), P.add("EventTrigger", ly), P.add("GltfExportBox", Qw), P.add("GltfExport", Yw), P.add("VariantAction", rx), P.add("ChangeTransformOnClick", ll), P.add("ChangeMaterialOnClick", ax), P.add("SetActiveOnClick", lx), P.add("HideOnStart", gn), P.add("EmphasizeOnClick", dh), P.add("PlayAudioOnClick", Ir), P.add("PlayAnimationOnClick", fu), P.add("PreliminaryAction", uh), P.add("PreliminaryTrigger", rf), P.add("VisibilityAction", af), P.add("TapGestureTrigger", cx), P.add("USDZExporter", Ts), P.add("Fog", mh), P.add("BoxGizmo", fl), P.add("GridHelper", gh), P.add("GroundProjectedEnv", $s), P.add("UsageMarker", Ju), P.add("Interactable", Tw), P.add("FixedJoint", Ox), P.add("HingeJoint", pf), P.add("Light", Ht), P.add("LODGroup", ky), P.add("LookAtConstraint", il), P.add("NeedleMenu", Hs), P.add("NestedGltf", _h), P.add("Networking", Rx), P.add("OffsetConstraint", pl), P.add("CameraTargetReachedEvent", ru), P.add("OrbitControls", me), P.add("ParticleSystemRenderer", En), P.add("ParticleSystem", mu), P.add("Attractor", wh), P.add("PlayerColor", Qc), P.add("Antialiasing", bf), P.add("BloomEffect", Ly), P.add("ChromaticAberration", wf), P.add("ColorAdjustments", Qr), P.add("DepthOfField", rs), P.add("EffectWrapper", gu), P.add("PixelationEffect", Sf), P.add("ScreenSpaceAmbientOcclusion", Wo), P.add("ScreenSpaceAmbientOcclusionN8", as), P.add("SharpeningEffect", Cf), P.add("TiltShiftEffect", Xs), P.add("ToneMappingEffect", Br), P.add("Vignette", bl), P.add("Volume", vl), P.add("ReflectionProbe", uo), P.add("Renderer", pi), P.add("MeshRenderer", tf), P.add("SkinnedMeshRenderer", $w), P.add("Rigidbody", it), P.add("SceneSwitcher", nt), P.add("ScreenCapture", Kr), P.add("SeeThrough", Vo), P.add("ShadowCatcher", Pf), P.add("RemoteSkybox", Kg), P.add("SmoothFollow", By), P.add("SpatialTriggerReceiver", As), P.add("SpatialTrigger", Fy), P.add("SpectatorCamera", zy), P.add("SplineContainer", Sl), P.add("SplineWalker", An), P.add("SpriteRenderer", Li), P.add("SyncedCamera", Xx), P.add("SyncedRoom", ls), P.add("SyncedTransform", es), P.add("TestRunner", Qx), P.add("TestSimulateUserData", Yx), P.add("PlayableDirector", Hc), P.add("SignalReceiver", Gu), P.add("AnimationTrackHandler", au), P.add("AudioTrackHandler", bo), P.add("MarkerTrackHandler", qg), P.add("SignalTrackHandler", lu), P.add("ControlTrackHandler", Xg), P.add("TransformGizmo", Cl), P.add("BaseUIComponent", Pn), P.add("UIRootComponent", df), P.add("Button", Xo), P.add("Canvas", qc), P.add("CanvasGroup", jr), P.add("EventSystem", fi), P.add("Graphic", uf), P.add("MaskableGraphic", ff), P.add("Image", kh), P.add("RawImage", Ny), P.add("InputField", Zx), P.add("VerticalLayoutGroup", wx), P.add("HorizontalLayoutGroup", xx), P.add("GridLayoutGroup", Sx), P.add("Outline", ph), P.add("ObjectRaycaster", Cn), P.add("GraphicRaycaster", Wg), P.add("SpatialGrabRaycaster", Ja), P.add("RectTransform", ts), P.add("SpatialHtml", Ef), P.add("Text", si), P.add("EnvironmentScene", Yg), P.add("LookAt", eS), P.add("OpenURL", Mh), P.add("VideoPlayer", _t), P.add("Voip", Vr), P.add("ClickThrough", Wy), P.add("CursorFollow", Pl), P.add("HoverAnimation", Us), P.add("ScrollFollow", Qo), P.add("ViewBox", ct), P.add("Avatar", Dr), P.add("XRControllerFollow", Yo), P.add("XRControllerModel", Eo), P.add("XRControllerMovement", sn), P.add("TeleportTarget", gy), P.add("WebARCameraBackground", Lf), P.add("WebARSessionRoot", bn), P.add("WebXR", yy), P.add("AvatarMarker", Ue), P.add("WebXRImageTracking", Df), P.add("WebXRPlaneTracking", Jo), P.add("XRRig", Hy), P.add("XRFlag", yn), P.add("PlayerSync", ux), P.add("PlayerState", vn), P.add("PresentationMode", WL);
42907
42919
  }
42908
42920
  function HL() {
42909
42921
  Jn.registerWaitForInteraction(() => {
@@ -43006,7 +43018,7 @@ async function sg(s, e, t, i, n) {
43006
43018
  await sg(s, r, t, i, n + 1);
43007
43019
  if (Hl.length > 0 && n === 0) {
43008
43020
  const r = Hl.join(", ");
43009
- console.warn(`Unknown components in scene: ${r}`), Hl.length = 0, Zi() && Ie(`<strong>Unknown components in scene</strong>:
43021
+ console.warn(`Unknown components in scene: ${r}`), Hl.length = 0, Ki() && Ie(`<strong>Unknown components in scene</strong>:
43010
43022
 
43011
43023
  ${r}
43012
43024
 
@@ -43018,7 +43030,7 @@ function YL(s, e) {
43018
43030
  const { instance: t, compData: i, obj: n } = s;
43019
43031
  e.object = n, e.target = t, um(t, i, e), Mc && console.debug("add " + i.name, i, t);
43020
43032
  }
43021
- class KL {
43033
+ class ZL {
43022
43034
  createBuiltinComponents(e, t, i, n, o) {
43023
43035
  return QL(e, t, i, n, o);
43024
43036
  }
@@ -43026,14 +43038,14 @@ class KL {
43026
43038
  return qL(e, t);
43027
43039
  }
43028
43040
  parseSync(e, t, i, n) {
43029
- return eD(e, t, i, n);
43041
+ return e2(e, t, i, n);
43030
43042
  }
43031
43043
  loadSync(e, t, i, n, o) {
43032
43044
  return aS(e, t, i, n, o);
43033
43045
  }
43034
43046
  }
43035
- function ZL() {
43036
- GP(KL);
43047
+ function KL() {
43048
+ GP(ZL);
43037
43049
  }
43038
43050
  const oS = x("printGltf") || x("printgltf"), JL = x("debugfileformat");
43039
43051
  async function rS(s, e, t) {
@@ -43073,10 +43085,10 @@ Use import { NeedleEngineModelLoader } from "@needle-tools/engine" namespace to
43073
43085
  return new kE();
43074
43086
  }
43075
43087
  }
43076
- function V2(s, e) {
43088
+ function VD(s, e) {
43077
43089
  return aS(e?.context || N.Current, s, s, e?.seed || null, e?.onprogress);
43078
43090
  }
43079
- async function eD(s, e, t, i) {
43091
+ async function e2(s, e, t, i) {
43080
43092
  typeof t != "string" && (console.warn("Parse gltf binary without path, this might lead to errors in resolving extensions. Please provide the source path of the gltf/glb file", t, typeof t), t = ""), oS && console.log("Parse glTF", t);
43081
43093
  const n = await rS(t, s, t);
43082
43094
  if (!n)
@@ -43112,7 +43124,7 @@ async function eD(s, e, t, i) {
43112
43124
  });
43113
43125
  }
43114
43126
  async function aS(s, e, t, i, n) {
43115
- iD(e);
43127
+ i2(e);
43116
43128
  const o = await rS(e, s, t);
43117
43129
  if (!o)
43118
43130
  return;
@@ -43160,7 +43172,7 @@ async function Ec(s, e, t, i, n, o) {
43160
43172
  animations: i.animations,
43161
43173
  scenes: [i]
43162
43174
  };
43163
- else if (i instanceof Ki) {
43175
+ else if (i instanceof Zi) {
43164
43176
  const r = new gt({
43165
43177
  color: new re(14540253)
43166
43178
  }), a = new H(i, r);
@@ -43170,9 +43182,9 @@ async function Ec(s, e, t, i, n, o) {
43170
43182
  scenes: [a]
43171
43183
  };
43172
43184
  } else Array.isArray(i.scenes) === !1 && console.error(`[Needle Engine] The loaded model object does not have a scenes property '${t}' - please make sure the loader is registered correctly and three.js is not imported multiple times.`);
43173
- return t.includes("?") && (t = t.split("?")[0]), nD(s, i), NP(i) && (IE(t, i, e), await Zn().createBuiltinComponents(e, t, i, n, o || void 0)), await tD(i.scene, e, e.mainCamera), i;
43185
+ return t.includes("?") && (t = t.split("?")[0]), n2(s, i), NP(i) && (IE(t, i, e), await Kn().createBuiltinComponents(e, t, i, n, o || void 0)), await t2(i.scene, e, e.mainCamera), i;
43174
43186
  }
43175
- async function tD(s, e, t) {
43187
+ async function t2(s, e, t) {
43176
43188
  t || (t = e.mainCamera);
43177
43189
  try {
43178
43190
  t ? await e.renderer.compileAsync(s, t, e.scene).catch((i) => {
@@ -43182,14 +43194,14 @@ async function tD(s, e, t) {
43182
43194
  console.warn(i?.message || i);
43183
43195
  }
43184
43196
  }
43185
- function iD(s) {
43197
+ function i2(s) {
43186
43198
  if (new URL(s, window.location.href).href.startsWith("file://")) {
43187
43199
  const t = `Hi - it looks like you are trying to load a local file which will not work. You need to use a webserver to serve your files.
43188
43200
  Please refer to the documentation on <a href="https://fwd.needle.tools/needle-engine/docs/local-server">https://docs.needle.tools</a> or ask for help in our <a href="https://discord.needle.tools">discord community</a>`;
43189
43201
  Ie(t), console.warn(t);
43190
43202
  }
43191
43203
  }
43192
- function nD(s, e) {
43204
+ function n2(s, e) {
43193
43205
  if ("scenes" in e) {
43194
43206
  for (const t of e.scenes)
43195
43207
  if (t && !t.animations?.length)
@@ -43205,7 +43217,7 @@ function nD(s, e) {
43205
43217
  }
43206
43218
  }
43207
43219
  let bv = !1;
43208
- function sD() {
43220
+ function s2() {
43209
43221
  bv || (bv = !0, Object.defineProperty(de.prototype, "fov", {
43210
43222
  get: function() {
43211
43223
  return this._fov;
@@ -43236,13 +43248,13 @@ function sD() {
43236
43248
  }));
43237
43249
  }
43238
43250
  let vv = !1;
43239
- function oD() {
43251
+ function o2() {
43240
43252
  vv || (vv = !0, _.prototype.slerp = function(s, e) {
43241
43253
  return $1(this, s, e);
43242
43254
  }, J0(_));
43243
43255
  }
43244
43256
  const Gp = L();
43245
- class rD extends HTMLElement {
43257
+ class r2 extends HTMLElement {
43246
43258
  static observedAttributes = ["ar", "vr", "quicklook", "qrcode"];
43247
43259
  constructor() {
43248
43260
  super(), this.removeEventListener("click", this.#a), this.addEventListener("click", this.#a);
@@ -43315,8 +43327,8 @@ class rD extends HTMLElement {
43315
43327
  Gp && console.log("Needle Button clicked", { defaultPrevented: e.defaultPrevented, hasButton: !!this.#e }), !e.defaultPrevented && this.#e && this.#e.click();
43316
43328
  };
43317
43329
  }
43318
- const Gl = x("debugoverlay"), cS = "ar", aD = "quit-ar";
43319
- class lD {
43330
+ const Gl = x("debugoverlay"), cS = "ar", a2 = "quit-ar";
43331
+ class l2 {
43320
43332
  get ARContainer() {
43321
43333
  return this.arContainer;
43322
43334
  }
@@ -43376,7 +43388,7 @@ class lD {
43376
43388
  const a = document.querySelector('meta[name="viewport"]');
43377
43389
  a && !a.getAttribute("content")?.includes("viewport-fit=") && a.setAttribute("content", a.getAttribute("content") + ",viewport-fit=cover");
43378
43390
  }
43379
- const i = document.querySelector(`.${aD}`);
43391
+ const i = document.querySelector(`.${a2}`);
43380
43392
  if (i) {
43381
43393
  i.addEventListener("click", this.requestEndAR), Gl && i.addEventListener("click", () => console.log("Clicked quit-ar button"));
43382
43394
  return;
@@ -43415,7 +43427,7 @@ class lD {
43415
43427
  }
43416
43428
  const mr = x("debugloading"), ql = x("debugloadingrendering");
43417
43429
  x("debuglicense");
43418
- class H2 {
43430
+ class HD {
43419
43431
  className;
43420
43432
  additionalClasses;
43421
43433
  }
@@ -43603,7 +43615,7 @@ class bu {
43603
43615
  // nonCommercialContainer.style.opacity = "1";
43604
43616
  // }
43605
43617
  }
43606
- const Re = x("debugwebcomponent"), dS = "vr", uS = "desktop", cD = [cS, dS, uS], Ql = "ar-session-active", Yl = "desktop-session-active", hD = [
43618
+ const Re = x("debugwebcomponent"), dS = "vr", uS = "desktop", c2 = [cS, dS, uS], Ql = "ar-session-active", Yl = "desktop-session-active", h2 = [
43607
43619
  // MainAttributes
43608
43620
  "src",
43609
43621
  "hash",
@@ -43633,7 +43645,7 @@ const Re = x("debugwebcomponent"), dS = "vr", uS = "desktop", cD = [cS, dS, uS],
43633
43645
  ];
43634
43646
  class fS extends HTMLElement {
43635
43647
  static get observedAttributes() {
43636
- return hD;
43648
+ return h2;
43637
43649
  }
43638
43650
  get loadingProgress01() {
43639
43651
  return this._loadingProgress01;
@@ -43784,7 +43796,7 @@ class fS extends HTMLElement {
43784
43796
  * @internal
43785
43797
  */
43786
43798
  connectedCallback() {
43787
- if (Re && console.log("<needle-engine> connected"), this.ensureInitialized(), this.setPublicKey(), this.setVersion(), (this.getAttribute("tabindex") === null || this.getAttribute("tabindex") === void 0) && this.setAttribute("tabindex", "0"), this._overlay_ar = new lD(), this.getOrCreateContext(), this.addEventListener("xr-session-started", this.onXRSessionStarted), this.onSetupDesktop(), !this.getAttribute("src")) {
43799
+ if (Re && console.log("<needle-engine> connected"), this.ensureInitialized(), this.setPublicKey(), this.setVersion(), (this.getAttribute("tabindex") === null || this.getAttribute("tabindex") === void 0) && this.setAttribute("tabindex", "0"), this._overlay_ar = new l2(), this.getOrCreateContext(), this.addEventListener("xr-session-started", this.onXRSessionStarted), this.onSetupDesktop(), !this.getAttribute("src")) {
43788
43800
  const t = globalThis["needle:codegen_files"];
43789
43801
  Re && console.log('src is null, trying to load from globalThis["needle:codegen_files"]', t), t && (Re && console.log('globalThis["needle:codegen_files"]', t), this.setAttribute("src", t));
43790
43802
  }
@@ -43823,7 +43835,7 @@ changed from "`, t, '" to "', i, '"'), this.onLoad();
43823
43835
  typeof i == "string" && i.length > 0 && (Re && console.log(e + " attribute changed", i), this.registerEventFromAttribute(e, i));
43824
43836
  break;
43825
43837
  case "dracoDecoderPath":
43826
- Re && console.log("dracoDecoderPath", i), Zb(i);
43838
+ Re && console.log("dracoDecoderPath", i), Kb(i);
43827
43839
  break;
43828
43840
  case "dracoDecoderType":
43829
43841
  i === "wasm" || i === "js" ? (Re && console.log("dracoDecoderType", i), Jb(i)) : console.error("Invalid dracoDecoderType", i, "expected js or wasm");
@@ -43922,7 +43934,7 @@ Needle Engine: Begin loading ` + i + `
43922
43934
  onLoadingProgress: (y) => {
43923
43935
  if (Re && console.debug("Loading progress: ", y), d.signal.aborted) return;
43924
43936
  const m = y.index;
43925
- !h[m] && y.name && (h[m] = dD(y.name)), y.name = h[m], r && this._loadingView?.onLoadingUpdate(y), l.name = y.name, l.progress = y.progress, this._loadingProgress01 = hS(y), l.totalProgress01 = this._loadingProgress01, this.dispatchEvent(c);
43937
+ !h[m] && y.name && (h[m] = d2(y.name)), y.name = h[m], r && this._loadingView?.onLoadingUpdate(y), l.name = y.name, l.progress = y.progress, this._loadingProgress01 = hS(y), l.totalProgress01 = this._loadingProgress01, this.dispatchEvent(c);
43926
43938
  },
43927
43939
  onLoadingFinished: (y, m, v) => {
43928
43940
  Re && console.debug(`Finished loading "${m}" (aborted? ${d.signal.aborted})`), !d.signal.aborted && v && a.push({
@@ -43931,7 +43943,7 @@ Needle Engine: Begin loading ` + i + `
43931
43943
  });
43932
43944
  }
43933
43945
  };
43934
- uD(this);
43946
+ u2(this);
43935
43947
  const p = this.getAttribute("hash");
43936
43948
  p != null && (e.hash = p), e.alias = n, this._createContextPromise = e.create(f);
43937
43949
  const g = await this._createContextPromise;
@@ -44097,7 +44109,7 @@ Needle Engine: finished loading ` + i + `
44097
44109
  if (e.classList.contains(t))
44098
44110
  e.style.visibility = "visible", e.style.display === "none" && (e.style.display = "block");
44099
44111
  else
44100
- for (const o of cD)
44112
+ for (const o of c2)
44101
44113
  e.classList.contains(o) && (e.style.visibility = "hidden", e.style.display = "none");
44102
44114
  }
44103
44115
  foreachHtmlElement(e) {
@@ -44108,7 +44120,7 @@ Needle Engine: finished loading ` + i + `
44108
44120
  }
44109
44121
  onBeforeBeginLoading() {
44110
44122
  const e = this.getAttribute("dracoDecoderPath");
44111
- e && (Re && console.log("using custom draco decoder path", e), Zb(e));
44123
+ e && (Re && console.log("using custom draco decoder path", e), Kb(e));
44112
44124
  const t = this.getAttribute("dracoDecoderType");
44113
44125
  t && (Re && console.log("using custom draco decoder type", t), Jb(t));
44114
44126
  const i = this.getAttribute("ktx2DecoderPath");
@@ -44134,7 +44146,7 @@ Needle Engine: finished loading ` + i + `
44134
44146
  return super.addEventListener(e, t, i);
44135
44147
  }
44136
44148
  }
44137
- function dD(s) {
44149
+ function d2(s) {
44138
44150
  if (s.startsWith("blob:"))
44139
44151
  return "blob";
44140
44152
  const e = s.split("/");
@@ -44155,7 +44167,7 @@ function dD(s) {
44155
44167
  }
44156
44168
  return t;
44157
44169
  }
44158
- function uD(s) {
44170
+ function u2(s) {
44159
44171
  Cg((e) => {
44160
44172
  const t = s.getAttribute("loading-blur");
44161
44173
  if (t !== null && t !== "0" && e.domElement === s) {
@@ -44198,18 +44210,18 @@ function uD(s) {
44198
44210
  }
44199
44211
  }, { once: !0 });
44200
44212
  }
44201
- const fD = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
44213
+ const f2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
44202
44214
  __proto__: null,
44203
44215
  NeedleEngineWebComponent: fS
44204
44216
  }, Symbol.toStringTag, { value: "Module" }));
44205
- function pD() {
44206
- typeof window > "u" || (window.customElements.get("needle-engine") || window.customElements.define("needle-engine", fS), window.customElements.get("needle-button") || window.customElements.define("needle-button", rD), window.customElements.get("needle-logo-element") || window.customElements.define("needle-logo-element", Bu), window.customElements.get("needle-menu") || window.customElements.define("needle-menu", Bc));
44217
+ function p2() {
44218
+ typeof window > "u" || (window.customElements.get("needle-engine") || window.customElements.define("needle-engine", fS), window.customElements.get("needle-button") || window.customElements.define("needle-button", r2), window.customElements.get("needle-logo-element") || window.customElements.define("needle-logo-element", Bu), window.customElements.get("needle-menu") || window.customElements.define("needle-menu", Bc));
44207
44219
  }
44208
44220
  let xv = !1;
44209
- function G2() {
44210
- xv || (xv = !0, pD(), qE(), F0(), ZM(), sD(), JO(), oD(), VL(), ZL(), setTimeout(HL, 1e3), gM(), fM(), MM(), bM());
44221
+ function GD() {
44222
+ xv || (xv = !0, p2(), qE(), F0(), KM(), s2(), JO(), o2(), VL(), KL(), setTimeout(HL, 1e3), gM(), fM(), MM(), bM());
44211
44223
  }
44212
- const je = x("debugphysics"), qp = x("debugcolliderplacement"), Xp = x("debugcollisions"), mD = x("showcolliders"), md = x("debugraycasts"), ci = /* @__PURE__ */ Symbol("needle component"), Ot = /* @__PURE__ */ Symbol("physics body"), Sv = /* @__PURE__ */ Symbol("rigidbody");
44224
+ const je = x("debugphysics"), qp = x("debugcolliderplacement"), Xp = x("debugcollisions"), m2 = x("showcolliders"), md = x("debugraycasts"), ci = /* @__PURE__ */ Symbol("needle component"), Ot = /* @__PURE__ */ Symbol("physics body"), Sv = /* @__PURE__ */ Symbol("rigidbody");
44213
44225
  globalThis.NEEDLE_USE_RAPIER = globalThis.NEEDLE_USE_RAPIER !== void 0 ? globalThis.NEEDLE_USE_RAPIER : !0;
44214
44226
  je && console.log("Use Rapier", !0, globalThis.NEEDLE_USE_RAPIER);
44215
44227
  pe.registerCallback(ue.ContextCreationStart, (s) => {
@@ -44505,7 +44517,7 @@ class Tc {
44505
44517
  je && console.warn("Missing mesh geometry", t.name);
44506
44518
  return;
44507
44519
  }
44508
- o.index?.array?.length || (console.warn(`Your MeshCollider is missing vertices or indices in the assined mesh "${t.name}". Consider providing an indexed geometry.`), o = ZC(o));
44520
+ o.index?.array?.length || (console.warn(`Your MeshCollider is missing vertices or indices in the assined mesh "${t.name}". Consider providing an indexed geometry.`), o = KC(o));
44509
44521
  let r = null;
44510
44522
  const a = o.getAttribute("position");
44511
44523
  if (a instanceof Lv) {
@@ -44741,22 +44753,22 @@ Error:`, r), null;
44741
44753
  }
44742
44754
  }
44743
44755
  postStep() {
44744
- this.world && this.enabled && (this._isUpdatingPhysicsWorld = !0, this.syncObjects(), this._isUpdatingPhysicsWorld = !1, this.eventQueue && !this.collisionHandler && (this.collisionHandler = new gD(this.world, this.eventQueue)), this.collisionHandler && (this.collisionHandler.handleCollisionEvents(), this.collisionHandler.update()), this.updateDebugRendering(this.world));
44756
+ this.world && this.enabled && (this._isUpdatingPhysicsWorld = !0, this.syncObjects(), this._isUpdatingPhysicsWorld = !1, this.eventQueue && !this.collisionHandler && (this.collisionHandler = new g2(this.world, this.eventQueue)), this.collisionHandler && (this.collisionHandler.handleCollisionEvents(), this.collisionHandler.update()), this.updateDebugRendering(this.world));
44745
44757
  }
44746
44758
  updateDebugRendering(e) {
44747
- if (je || qp || mD || this.debugRenderColliders === !0) {
44759
+ if (je || qp || m2 || this.debugRenderColliders === !0) {
44748
44760
  if (!this.lines) {
44749
44761
  const n = new Nd({
44750
44762
  color: 7855479,
44751
44763
  fog: !1
44752
- }), o = new Ki();
44764
+ }), o = new Zi();
44753
44765
  this.lines = new Yp(o, n), this.lines.layers.disableAll(), this.lines.layers.enable(2);
44754
44766
  }
44755
44767
  if (!this.disabledLines) {
44756
44768
  const n = new Nd({
44757
44769
  color: 14514039,
44758
44770
  fog: !1
44759
- }), o = new Ki();
44771
+ }), o = new Zi();
44760
44772
  this.disabledLines = new Yp(o, n), this.disabledLines.layers.disableAll(), this.disabledLines.layers.enable(2);
44761
44773
  }
44762
44774
  this.lines.parent !== this.context?.scene && this.context?.scene.add(this.lines), this.disabledLines.parent !== this.context?.scene && this.context?.scene.add(this.disabledLines);
@@ -44869,7 +44881,7 @@ Error:`, r), null;
44869
44881
  n.elements[0] = 1, n.elements[5] = 1, n.elements[10] = 1, o.elements[0] = 1, o.elements[5] = 1, o.elements[10] = 1, i.copy(o).premultiply(n.invert()).invert();
44870
44882
  }
44871
44883
  }
44872
- class gD {
44884
+ class g2 {
44873
44885
  world;
44874
44886
  eventQueue;
44875
44887
  constructor(e, t) {
@@ -44892,13 +44904,13 @@ class gD {
44892
44904
  onCollisionStarted(e, t, i, n) {
44893
44905
  let o = null;
44894
44906
  if (e.isTrigger || i.isTrigger)
44895
- Za(e.gameObject, (r) => {
44907
+ Ka(e.gameObject, (r) => {
44896
44908
  r.onTriggerEnter && !r.destroyed && r.onTriggerEnter(i), this.activeTriggers.push({ collider: e, component: r, otherCollider: i });
44897
44909
  });
44898
44910
  else {
44899
44911
  const r = e.gameObject;
44900
44912
  this.world.contactPair(t, n, (a, l) => {
44901
- Za(r, (c) => {
44913
+ Ka(r, (c) => {
44902
44914
  if (c.destroyed) return;
44903
44915
  const h = c.onCollisionEnter || c.onCollisionStay || c.onCollisionExit;
44904
44916
  if (h || Xp) {
@@ -44992,26 +45004,26 @@ let og = 0;
44992
45004
  function Cv(s) {
44993
45005
  s ? og++ : og--;
44994
45006
  }
44995
- function q2() {
45007
+ function qD() {
44996
45008
  return og > 0;
44997
45009
  }
44998
- const yD = {
45010
+ const y2 = {
44999
45011
  binary: !0,
45000
45012
  animations: !0
45001
45013
  };
45002
- async function X2(s) {
45014
+ async function XD(s) {
45003
45015
  if (!s.context)
45004
45016
  throw new Error("No context provided to exportAsGLTF");
45005
45017
  s.scene || (s.scene = s.context.scene);
45006
45018
  const e = {
45007
- ...yD,
45019
+ ...y2,
45008
45020
  ...s
45009
45021
  }, { context: t } = e, i = new $v();
45010
45022
  i.register((a) => new Hw(a)), i.register((a) => new HE(a)), i.register((a) => new qw(a)), Uw(i, e.context);
45011
45023
  const n = {
45012
45024
  binary: e.binary,
45013
- animations: bD(t, e.scene, [])
45014
- }, o = new _D();
45025
+ animations: b2(t, e.scene, [])
45026
+ }, o = new _2();
45015
45027
  console.debug("Exporting GLTF", n), o.onBeforeExport(e), Cv(!0);
45016
45028
  const r = await i.parseAsync(e.scene, n).catch((a) => (console.error(a), null));
45017
45029
  if (Cv(!1), o.onAfterExport(e), !r)
@@ -45028,7 +45040,7 @@ async function X2(s) {
45028
45040
  return r;
45029
45041
  }
45030
45042
  const Pv = /* @__PURE__ */ Symbol("needle:weight");
45031
- class _D {
45043
+ class _2 {
45032
45044
  _undo = [];
45033
45045
  onBeforeExport(e) {
45034
45046
  e.context.animations.mixers.forEach((t) => {
@@ -45052,7 +45064,7 @@ class _D {
45052
45064
  this._undo.forEach((t) => t()), this._undo.length = 0;
45053
45065
  }
45054
45066
  }
45055
- function bD(s, e, t) {
45067
+ function b2(s, e, t) {
45056
45068
  s.animations.mixers.forEach((n) => {
45057
45069
  const o = Fs.tryGetActionsFromMixer(n);
45058
45070
  if (o)
@@ -45066,7 +45078,7 @@ function bD(s, e, t) {
45066
45078
  const i = new Set(t);
45067
45079
  return Array.from(i);
45068
45080
  }
45069
- const Kl = x("debugavatar");
45081
+ const Zl = x("debugavatar");
45070
45082
  class pS {
45071
45083
  /** The root object of the avatar model */
45072
45084
  root;
@@ -45095,7 +45107,7 @@ class pS {
45095
45107
  this.root = e, this.head = t, this.leftHand = i, this.rigthHand = n, this.root?.traverse((o) => o.layers.set(2));
45096
45108
  }
45097
45109
  }
45098
- class vD {
45110
+ class v2 {
45099
45111
  avatarRegistryUrl = null;
45100
45112
  // private loader: GLTFLoader | null;
45101
45113
  // private avatarModelCache: Map<string, AvatarModel | null> = new Map<string, AvatarModel | null>();
@@ -45118,7 +45130,7 @@ class vD {
45118
45130
  if (!i)
45119
45131
  return null;
45120
45132
  const n = this.findAvatar(i);
45121
- return n.isValid ? (Kl && console.log("[Custom Avatar] valid config", t, Kl ? n : ""), n) : (console.warn("[Custom Avatar] config isn't valid", t, Kl ? n : ""), null);
45133
+ return n.isValid ? (Zl && console.log("[Custom Avatar] valid config", t, Zl ? n : ""), n) : (console.warn("[Custom Avatar] config isn't valid", t, Zl ? n : ""), null);
45122
45134
  }
45123
45135
  /**
45124
45136
  * Loads an avatar model from a file or registry using the provided ID.
@@ -45128,14 +45140,14 @@ class vD {
45128
45140
  */
45129
45141
  async loadAvatar(e, t) {
45130
45142
  if (console.assert(t != null && typeof t == "string", "Avatar id must not be null"), t.length <= 0 || !t) return null;
45131
- if (Kl && console.log("[Custom Avatar] " + t + ", loading..."), t.endsWith(".glb") || (t += ".glb"), this.avatarRegistryUrl === null) {
45143
+ if (Zl && console.log("[Custom Avatar] " + t + ", loading..."), t.endsWith(".glb") || (t += ".glb"), this.avatarRegistryUrl === null) {
45132
45144
  const n = await fetch("./" + t);
45133
45145
  let o = null;
45134
45146
  if (n.ok) {
45135
45147
  const a = await n.blob();
45136
45148
  a && (o = await a.arrayBuffer());
45137
45149
  }
45138
- return o ? (await Zn().parseSync(e, o, null, 0))?.scene ?? null : null;
45150
+ return o ? (await Kn().parseSync(e, o, null, 0))?.scene ?? null : null;
45139
45151
  }
45140
45152
  const i = new Bs();
45141
45153
  return my(i, e), new Promise((n, o) => {
@@ -45143,10 +45155,10 @@ class vD {
45143
45155
  i.load(
45144
45156
  r,
45145
45157
  async (a) => {
45146
- await Zn().createBuiltinComponents(e, r, a, null, void 0), n(a.scene);
45158
+ await Kn().createBuiltinComponents(e, r, a, null, void 0), n(a.scene);
45147
45159
  },
45148
45160
  (a) => {
45149
- Kl && console.log("[Custom Avatar] " + a.loaded / a.total * 100 + "% loaded of " + a.total / 1024 + "kB");
45161
+ Zl && console.log("[Custom Avatar] " + a.loaded / a.total * 100 + "% loaded of " + a.total / 1024 + "kB");
45150
45162
  },
45151
45163
  (a) => {
45152
45164
  console.error("[Custom Avatar] Error when loading: " + a), n(null);
@@ -45214,16 +45226,16 @@ class vD {
45214
45226
  return e;
45215
45227
  }
45216
45228
  }
45217
- class wD {
45229
+ class w2 {
45218
45230
  get extensionName() {
45219
45231
  return "DocumentExtension";
45220
45232
  }
45221
45233
  onAfterBuildDocument(e) {
45222
45234
  }
45223
45235
  }
45224
- class xD {
45236
+ class x2 {
45225
45237
  }
45226
- const Q2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45238
+ const QD = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45227
45239
  __proto__: null,
45228
45240
  ActionBuilder: ge,
45229
45241
  ActionCollection: wT,
@@ -45244,7 +45256,7 @@ const Q2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45244
45256
  Avatar: Dr,
45245
45257
  AvatarBlink_Simple: nl,
45246
45258
  AvatarEyeLook_Rotation: kw,
45247
- AvatarLoader: vD,
45259
+ AvatarLoader: v2,
45248
45260
  AvatarMarker: Ue,
45249
45261
  AvatarModel: pS,
45250
45262
  Avatar_Brain_LookAt: hu,
@@ -45276,7 +45288,7 @@ const Q2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45276
45288
  ColorAdjustments: Qr,
45277
45289
  ColorBySpeedModule: vh,
45278
45290
  ColorOverLifetimeModule: My,
45279
- ContactShadows: Zu,
45291
+ ContactShadows: Ku,
45280
45292
  ControlTrackHandler: Xg,
45281
45293
  CursorFollow: Pl,
45282
45294
  CustomBranding: ul,
@@ -45284,7 +45296,7 @@ const Q2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45284
45296
  DeleteBox: Cr,
45285
45297
  DepthOfField: rs,
45286
45298
  DeviceFlag: sy,
45287
- DocumentExtension: wD,
45299
+ DocumentExtension: w2,
45288
45300
  DragControls: Sa,
45289
45301
  DropListener: jo,
45290
45302
  Duplicatable: Vw,
@@ -45316,7 +45328,7 @@ const Q2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45316
45328
  },
45317
45329
  Image: kh,
45318
45330
  InheritVelocityModule: Ax,
45319
- InputField: Kx,
45331
+ InputField: Zx,
45320
45332
  InstanceHandle: Ba,
45321
45333
  InstancingHandler: el,
45322
45334
  Interactable: Tw,
@@ -45364,14 +45376,14 @@ const Q2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45364
45376
  RectTransform: ts,
45365
45377
  ReflectionProbe: uo,
45366
45378
  RegisteredAnimationInfo: _r,
45367
- RemoteSkybox: Zg,
45379
+ RemoteSkybox: Kg,
45368
45380
  Renderer: pi,
45369
45381
  RendererLightmap: Nw,
45370
45382
  Rigidbody: it,
45371
45383
  RotationBySpeedModule: Mn,
45372
45384
  RotationOverLifetimeModule: os,
45373
45385
  SceneSwitcher: nt,
45374
- ScreenCapture: Zr,
45386
+ ScreenCapture: Kr,
45375
45387
  ScreenSpaceAmbientOcclusion: Wo,
45376
45388
  ScreenSpaceAmbientOcclusionN8: as,
45377
45389
  ScrollFollow: Qo,
@@ -45402,7 +45414,7 @@ const Q2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45402
45414
  SpriteData: Pc,
45403
45415
  SpriteRenderer: Li,
45404
45416
  SpriteSheet: Gc,
45405
- SubEmitterSystem: Km,
45417
+ SubEmitterSystem: Zm,
45406
45418
  SyncedCamera: Xx,
45407
45419
  SyncedRoom: ls,
45408
45420
  SyncedTransform: es,
@@ -45428,7 +45440,7 @@ const Q2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45428
45440
  USDZUIExtension: kx,
45429
45441
  UsageMarker: Ju,
45430
45442
  VariantAction: rx,
45431
- VelocityOverLifetimeModule: Ke,
45443
+ VelocityOverLifetimeModule: Ze,
45432
45444
  VerticalLayoutGroup: wx,
45433
45445
  VideoPlayer: _t,
45434
45446
  get ViewBox() {
@@ -45444,16 +45456,16 @@ const Q2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45444
45456
  WebARSessionRoot: bn,
45445
45457
  WebXR: yy,
45446
45458
  WebXRImageTracking: Df,
45447
- WebXRImageTrackingModel: Zo,
45459
+ WebXRImageTrackingModel: Ko,
45448
45460
  WebXRPlaneTracking: Jo,
45449
- WebXRTrackedImage: Kc,
45461
+ WebXRTrackedImage: Zc,
45450
45462
  XRControllerFollow: Yo,
45451
45463
  XRControllerModel: Eo,
45452
45464
  XRControllerMovement: sn,
45453
45465
  XRFlag: yn,
45454
45466
  XRRig: Hy,
45455
45467
  XRState: di,
45456
- __Ignore: xD
45468
+ __Ignore: x2
45457
45469
  }, Symbol.toStringTag, { value: "Module" }));
45458
45470
  var kv;
45459
45471
  ((s) => {
@@ -45468,9 +45480,15 @@ var kv;
45468
45480
  }
45469
45481
  s.createFromPoints = e;
45470
45482
  })(kv || (kv = {}));
45471
- class SD extends c1 {
45483
+ class S2 extends c1 {
45472
45484
  constructor() {
45473
- super(/* new-worker */ new Worker(URL.createObjectURL(new Blob(["import '" + `${new URL('./generateMeshBVH.worker-DT9A2Hrc.js', import.meta.url).toString()}` + "';"], { type: 'text/javascript' })), { type: "module" })), this.name = "GenerateMeshBVHWorker";
45485
+ let e;
45486
+ try {
45487
+ e = import.meta.resolve("three-mesh-bvh/src/workers/generateMeshBVH.worker.js");
45488
+ } catch {
45489
+ e = new URL("data:text/javascript;base64,aW1wb3J0IHsKCUJ1ZmZlckdlb21ldHJ5LAoJQnVmZmVyQXR0cmlidXRlLAp9IGZyb20gJ3RocmVlJzsKaW1wb3J0IHsgTWVzaEJWSCB9IGZyb20gJy4uL2NvcmUvTWVzaEJWSC5qcyc7CgpzZWxmLm9ubWVzc2FnZSA9ICggeyBkYXRhIH0gKSA9PiB7CgoJbGV0IHByZXZUaW1lID0gcGVyZm9ybWFuY2Uubm93KCk7CglmdW5jdGlvbiBvblByb2dyZXNzQ2FsbGJhY2soIHByb2dyZXNzICkgewoKCQkvLyBhY2NvdW50IGZvciBlcnJvcgoJCXByb2dyZXNzID0gTWF0aC5taW4oIHByb2dyZXNzLCAxICk7CgoJCWNvbnN0IGN1cnJUaW1lID0gcGVyZm9ybWFuY2Uubm93KCk7CgkJaWYgKCBjdXJyVGltZSAtIHByZXZUaW1lID49IDEwICYmIHByb2dyZXNzICE9PSAxLjAgKSB7CgoJCQlzZWxmLnBvc3RNZXNzYWdlKCB7CgoJCQkJZXJyb3I6IG51bGwsCgkJCQlzZXJpYWxpemVkOiBudWxsLAoJCQkJcG9zaXRpb246IG51bGwsCgkJCQlwcm9ncmVzcywKCgkJCX0gKTsKCQkJcHJldlRpbWUgPSBjdXJyVGltZTsKCgkJfQoKCX0KCgljb25zdCB7IGluZGV4LCBwb3NpdGlvbiwgb3B0aW9ucyB9ID0gZGF0YTsKCXRyeSB7CgoJCWNvbnN0IGdlb21ldHJ5ID0gbmV3IEJ1ZmZlckdlb21ldHJ5KCk7CgkJZ2VvbWV0cnkuc2V0QXR0cmlidXRlKCAncG9zaXRpb24nLCBuZXcgQnVmZmVyQXR0cmlidXRlKCBwb3NpdGlvbiwgMywgZmFsc2UgKSApOwoJCWlmICggaW5kZXggKSB7CgoJCQlnZW9tZXRyeS5zZXRJbmRleCggbmV3IEJ1ZmZlckF0dHJpYnV0ZSggaW5kZXgsIDEsIGZhbHNlICkgKTsKCgkJfQoKCQlpZiAoIG9wdGlvbnMuaW5jbHVkZWRQcm9ncmVzc0NhbGxiYWNrICkgewoKCQkJb3B0aW9ucy5vblByb2dyZXNzID0gb25Qcm9ncmVzc0NhbGxiYWNrOwoKCQl9CgoJCWlmICggb3B0aW9ucy5ncm91cHMgKSB7CgoJCQljb25zdCBncm91cHMgPSBvcHRpb25zLmdyb3VwczsKCQkJZm9yICggY29uc3QgaSBpbiBncm91cHMgKSB7CgoJCQkJY29uc3QgZ3JvdXAgPSBncm91cHNbIGkgXTsKCQkJCWdlb21ldHJ5LmFkZEdyb3VwKCBncm91cC5zdGFydCwgZ3JvdXAuY291bnQsIGdyb3VwLm1hdGVyaWFsSW5kZXggKTsKCgkJCX0KCgkJfQoKCQljb25zdCBidmggPSBuZXcgTWVzaEJWSCggZ2VvbWV0cnksIG9wdGlvbnMgKTsKCQljb25zdCBzZXJpYWxpemVkID0gTWVzaEJWSC5zZXJpYWxpemUoIGJ2aCwgeyBjb3B5SW5kZXhCdWZmZXI6IGZhbHNlIH0gKTsKCQlsZXQgdG9UcmFuc2ZlciA9IFsgcG9zaXRpb24uYnVmZmVyLCAuLi5zZXJpYWxpemVkLnJvb3RzIF07CgkJaWYgKCBzZXJpYWxpemVkLmluZGV4ICkgewoKCQkJdG9UcmFuc2Zlci5wdXNoKCBzZXJpYWxpemVkLmluZGV4LmJ1ZmZlciApOwoKCQl9CgoJCXRvVHJhbnNmZXIgPSB0b1RyYW5zZmVyLmZpbHRlciggdiA9PiAoIHR5cGVvZiBTaGFyZWRBcnJheUJ1ZmZlciA9PT0gJ3VuZGVmaW5lZCcgKSB8fCAhICggdiBpbnN0YW5jZW9mIFNoYXJlZEFycmF5QnVmZmVyICkgKTsKCgkJaWYgKCBidmguX2luZGlyZWN0QnVmZmVyICkgewoKCQkJdG9UcmFuc2Zlci5wdXNoKCBzZXJpYWxpemVkLmluZGlyZWN0QnVmZmVyLmJ1ZmZlciApOwoKCQl9CgoJCXNlbGYucG9zdE1lc3NhZ2UoIHsKCgkJCWVycm9yOiBudWxsLAoJCQlzZXJpYWxpemVkLAoJCQlwb3NpdGlvbiwKCQkJcHJvZ3Jlc3M6IDEsCgoJCX0sIHRvVHJhbnNmZXIgKTsKCgl9IGNhdGNoICggZXJyb3IgKSB7CgoJCXNlbGYucG9zdE1lc3NhZ2UoIHsKCgkJCWVycm9yLAoJCQlzZXJpYWxpemVkOiBudWxsLAoJCQlwb3NpdGlvbjogbnVsbCwKCQkJcHJvZ3Jlc3M6IDEsCgoJCX0gKTsKCgl9Cgp9Owo=", import.meta.url);
45490
+ }
45491
+ super(new Worker(e, { type: "module" })), this.name = "GenerateMeshBVHWorker";
45474
45492
  }
45475
45493
  runTask(e, t, i = {}) {
45476
45494
  return new Promise((n, o) => {
@@ -45510,13 +45528,13 @@ class SD extends c1 {
45510
45528
  });
45511
45529
  }
45512
45530
  }
45513
- const CD = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45531
+ const C2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45514
45532
  __proto__: null,
45515
- GenerateMeshBVHWorker: SD
45533
+ GenerateMeshBVHWorker: S2
45516
45534
  }, Symbol.toStringTag, { value: "Module" }));
45517
45535
  export {
45518
45536
  $P as $componentName,
45519
- n2 as $physicsKey,
45537
+ nD as $physicsKey,
45520
45538
  ge as ActionBuilder,
45521
45539
  wT as ActionCollection,
45522
45540
  vi as ActionModel,
@@ -45545,7 +45563,7 @@ export {
45545
45563
  Dr as Avatar,
45546
45564
  nl as AvatarBlink_Simple,
45547
45565
  kw as AvatarEyeLook_Rotation,
45548
- vD as AvatarLoader,
45566
+ v2 as AvatarLoader,
45549
45567
  Ue as AvatarMarker,
45550
45568
  pS as AvatarModel,
45551
45569
  hu as Avatar_Brain_LookAt,
@@ -45588,15 +45606,15 @@ export {
45588
45606
  Qr as ColorAdjustments,
45589
45607
  vh as ColorBySpeedModule,
45590
45608
  My as ColorOverLifetimeModule,
45591
- O2 as Component,
45609
+ OD as Component,
45592
45610
  E as Component$1,
45593
45611
  vg as ComponentLifecycleEvents,
45594
- Q2 as Components,
45612
+ QD as Components,
45595
45613
  Wk as ConnectionEvents,
45596
45614
  WP as ContactPoint,
45597
- Zu as ContactShadows,
45615
+ Ku as ContactShadows,
45598
45616
  N as Context,
45599
- v2 as ContextArgs,
45617
+ vD as ContextArgs,
45600
45618
  ue as ContextEvent,
45601
45619
  pe as ContextRegistry,
45602
45620
  Xg as ControlTrackHandler,
@@ -45609,7 +45627,7 @@ export {
45609
45627
  rs as DepthOfField,
45610
45628
  sy as DeviceFlag,
45611
45629
  D as DeviceUtilities,
45612
- wD as DocumentExtension,
45630
+ w2 as DocumentExtension,
45613
45631
  Sa as DragControls,
45614
45632
  Iw as DragMode,
45615
45633
  jo as DropListener,
@@ -45626,7 +45644,7 @@ export {
45626
45644
  BE as FieldWithDefault,
45627
45645
  Ea as FileReference,
45628
45646
  Rk as FileReferenceSerializer,
45629
- j2 as FileSpawnModel,
45647
+ jD as FileSpawnModel,
45630
45648
  oE as File_Event,
45631
45649
  Ox as FixedJoint,
45632
45650
  mh as Fog,
@@ -45650,7 +45668,7 @@ export {
45650
45668
  pf as HingeJoint,
45651
45669
  xx as HorizontalLayoutGroup,
45652
45670
  iA as HorizontalWrapMode,
45653
- l2 as HostData,
45671
+ lD as HostData,
45654
45672
  Us as HoverAnimation,
45655
45673
  kh as Image,
45656
45674
  Ma as ImageReference,
@@ -45659,7 +45677,7 @@ export {
45659
45677
  Ik as Input,
45660
45678
  xi as InputEventQueue,
45661
45679
  ze as InputEvents,
45662
- Kx as InputField,
45680
+ Zx as InputField,
45663
45681
  Ba as InstanceHandle,
45664
45682
  el as InstancingHandler,
45665
45683
  xn as InstancingUtil,
@@ -45668,16 +45686,16 @@ export {
45668
45686
  is as InstantiateOptions,
45669
45687
  Tw as Interactable,
45670
45688
  _u as InternalScreenshotUtils,
45671
- f2 as JoinedRoomResponse,
45672
- h2 as KeyEventArgs,
45689
+ fD as JoinedRoomResponse,
45690
+ hD as KeyEventArgs,
45673
45691
  Oi as Keyframe,
45674
45692
  ky as LODGroup,
45675
45693
  yh as LODModel,
45676
- p2 as LeftRoomResponse,
45694
+ pD as LeftRoomResponse,
45677
45695
  Ht as Light,
45678
45696
  iO as LightData,
45679
45697
  xt as LimitVelocityOverLifetimeModule,
45680
- H2 as LoadingElementOptions,
45698
+ HD as LoadingElementOptions,
45681
45699
  Ew as LogStats,
45682
45700
  Yi as LogType,
45683
45701
  eS as LookAt,
@@ -45697,13 +45715,13 @@ export {
45697
45715
  _0 as NEEDLE_ENGINE_FEATURE_FLAGS,
45698
45716
  Bh as NEKeyboardEvent,
45699
45717
  ro as NEPointerEvent,
45700
- rD as NeedleButtonElement,
45718
+ r2 as NeedleButtonElement,
45701
45719
  Eb as NeedleEngineModelLoader,
45702
45720
  fS as NeedleEngineWebComponent,
45703
45721
  Hs as NeedleMenu,
45704
45722
  qf as NeedlePatchesKey,
45705
45723
  W0 as NeedleXRController,
45706
- K as NeedleXRSession,
45724
+ Z as NeedleXRSession,
45707
45725
  TO as NeedleXRSync,
45708
45726
  FO as NeedleXRUtils,
45709
45727
  _h as NestedGltf,
@@ -45756,7 +45774,7 @@ export {
45756
45774
  fr as PreviewHelper,
45757
45775
  Jc as PrimitiveType,
45758
45776
  he as Progress,
45759
- Zv as PromiseAllWithErrors,
45777
+ Kv as PromiseAllWithErrors,
45760
45778
  c_ as PromiseErrorResult,
45761
45779
  ae as RGBAColor,
45762
45780
  Tc as RapierPhysics,
@@ -45766,7 +45784,7 @@ export {
45766
45784
  ts as RectTransform,
45767
45785
  uo as ReflectionProbe,
45768
45786
  _r as RegisteredAnimationInfo,
45769
- Zg as RemoteSkybox,
45787
+ Kg as RemoteSkybox,
45770
45788
  xs as RenderTexture,
45771
45789
  jR as RenderTextureSerializer,
45772
45790
  pi as Renderer,
@@ -45779,7 +45797,7 @@ export {
45779
45797
  os as RotationOverLifetimeModule,
45780
45798
  jm as SceneLightSettings,
45781
45799
  nt as SceneSwitcher,
45782
- Zr as ScreenCapture,
45800
+ Kr as ScreenCapture,
45783
45801
  Wo as ScreenSpaceAmbientOcclusion,
45784
45802
  as as ScreenSpaceAmbientOcclusionN8,
45785
45803
  Qo as ScrollFollow,
@@ -45815,10 +45833,10 @@ export {
45815
45833
  Pc as SpriteData,
45816
45834
  Li as SpriteRenderer,
45817
45835
  Gc as SpriteSheet,
45818
- M2 as StateMachineBehaviour,
45836
+ MD as StateMachineBehaviour,
45819
45837
  vw as StreamEndedEvent,
45820
45838
  LM as StreamReceivedEvent,
45821
- Km as SubEmitterSystem,
45839
+ Zm as SubEmitterSystem,
45822
45840
  Xx as SyncedCamera,
45823
45841
  ls as SyncedRoom,
45824
45842
  es as SyncedTransform,
@@ -45853,10 +45871,10 @@ export {
45853
45871
  kx as USDZUIExtension,
45854
45872
  BR as UriSerializer,
45855
45873
  Ju as UsageMarker,
45856
- m2 as UserJoinedOrLeftRoomModel,
45874
+ mD as UserJoinedOrLeftRoomModel,
45857
45875
  Pi as VERSION,
45858
45876
  rx as VariantAction,
45859
- Ke as VelocityOverLifetimeModule,
45877
+ Ze as VelocityOverLifetimeModule,
45860
45878
  wx as VerticalLayoutGroup,
45861
45879
  tA as VerticalWrapMode,
45862
45880
  _t as VideoPlayer,
@@ -45868,7 +45886,7 @@ export {
45868
45886
  vl as Volume,
45869
45887
  $ as VolumeParameter,
45870
45888
  Ay as VolumeProfile,
45871
- c2 as WaitForFrames,
45889
+ cD as WaitForFrames,
45872
45890
  Mk as WaitForPromise,
45873
45891
  L0 as WaitForSeconds,
45874
45892
  xo as Watch,
@@ -45877,9 +45895,9 @@ export {
45877
45895
  yy as WebXR,
45878
45896
  kr as WebXRButtonFactory,
45879
45897
  Df as WebXRImageTracking,
45880
- Zo as WebXRImageTrackingModel,
45898
+ Ko as WebXRImageTrackingModel,
45881
45899
  Jo as WebXRPlaneTracking,
45882
- Kc as WebXRTrackedImage,
45900
+ Zc as WebXRTrackedImage,
45883
45901
  Yo as XRControllerFollow,
45884
45902
  Eo as XRControllerModel,
45885
45903
  sn as XRControllerMovement,
@@ -45887,25 +45905,25 @@ export {
45887
45905
  Hy as XRRig,
45888
45906
  di as XRState,
45889
45907
  bs as XRStateFlag,
45890
- xD as __Ignore,
45891
- S2 as __internalNotifyObjectDestroyed,
45908
+ x2 as __Ignore,
45909
+ SD as __internalNotifyObjectDestroyed,
45892
45910
  ws as activeInHierarchyFieldName,
45893
45911
  Yv as addAttributeChangeCallback,
45894
45912
  Xn as addComponent,
45895
- B2 as addCustomExtensionPlugin,
45913
+ BD as addCustomExtensionPlugin,
45896
45914
  Ia as addNewComponent,
45897
45915
  wg as addPatch,
45898
45916
  jg as apply,
45899
- k2 as applyHMRChanges,
45917
+ kD as applyHMRChanges,
45900
45918
  YO as applyPrototypeExtensions,
45901
45919
  ik as beginListenDestroy,
45902
45920
  ok as beginListenInstantiate,
45903
45921
  D0 as binaryIdentifierCasts,
45904
- b2 as build_scene_functions,
45922
+ bD as build_scene_functions,
45905
45923
  ua as builtinComponentKeyName,
45906
45924
  hS as calculateProgress01,
45907
- QD as clearMessages,
45908
- E2 as colorSerializer,
45925
+ Q2 as clearMessages,
45926
+ ED as colorSerializer,
45909
45927
  dk as compareAssociation,
45910
45928
  dp as componentSerializer,
45911
45929
  tP as copyTexture,
@@ -45924,18 +45942,18 @@ export {
45924
45942
  Cs as disposeStream,
45925
45943
  yd as editorGuidKeyName,
45926
45944
  uc as enableSpatialConsole,
45927
- T2 as euler,
45928
- A2 as eventListSerializer,
45929
- X2 as exportAsGLTF,
45945
+ TD as euler,
45946
+ AD as eventListSerializer,
45947
+ XD as exportAsGLTF,
45930
45948
  ew as findByGuid,
45931
45949
  nh as findObjectOfType,
45932
45950
  mR as findObjectsOfType,
45933
45951
  Q0 as findResourceUsers,
45934
45952
  $R as fitCamera,
45935
45953
  oP as fitObjectIntoVolume,
45936
- Za as foreachComponent,
45954
+ Ka as foreachComponent,
45937
45955
  Fg as foreachComponentEnumerator,
45938
- JD as forward,
45956
+ J2 as forward,
45939
45957
  mO as generateQRCode,
45940
45958
  sk as generateSeed,
45941
45959
  Ai as getBoundingBox,
@@ -45949,20 +45967,20 @@ export {
45949
45967
  QE as getFormattedDate,
45950
45968
  zt as getIconElement,
45951
45969
  X_ as getIconTexture,
45952
- Zn as getLoader,
45970
+ Kn as getLoader,
45953
45971
  zu as getOrAddComponent,
45954
45972
  x as getParam,
45955
- e2 as getParentHierarchyPath,
45956
- jD as getPath,
45957
- d2 as getPeerOptions,
45973
+ eD as getParentHierarchyPath,
45974
+ j2 as getPath,
45975
+ dD as getPeerOptions,
45958
45976
  zk as getPeerjsInstance,
45959
- C2 as getResourceUserCount,
45977
+ CD as getResourceUserCount,
45960
45978
  H1 as getTempColor,
45961
45979
  wi as getTempQuaternion,
45962
45980
  U as getTempVector,
45963
45981
  Ru as getUrlParams,
45964
45982
  sP as getVisibleInCustomShadowRendering,
45965
- K1 as getWorldDirection,
45983
+ Z1 as getWorldDirection,
45966
45984
  r0 as getWorldEuler,
45967
45985
  te as getWorldPosition,
45968
45986
  ve as getWorldQuaternion,
@@ -45974,70 +45992,70 @@ export {
45974
45992
  Ms as hasProLicense,
45975
45993
  uP as hideDebugConsole,
45976
45994
  uT as imageToCanvas,
45977
- G2 as initEngine,
45995
+ GD as initEngine,
45978
45996
  Er as instantiate,
45979
45997
  IE as invokeLoadedImportPluginHooks,
45980
45998
  aO as invokeXRSessionEnd,
45981
45999
  rO as invokeXRSessionStart,
45982
46000
  eR as isActiveInHierarchy,
45983
46001
  th as isActiveSelf,
45984
- ND as isAndroidDevice,
46002
+ N2 as isAndroidDevice,
45985
46003
  eP as isAnimationAction,
45986
46004
  w0 as isComponent,
45987
- AD as isDebugMode,
45988
- BD as isDesktop,
45989
- Ka as isDestroyed,
46005
+ A2 as isDebugMode,
46006
+ B2 as isDesktop,
46007
+ Za as isDestroyed,
45990
46008
  L as isDevEnvironment,
45991
- x2 as isDisposed,
45992
- q2 as isExporting,
46009
+ xD as isDisposed,
46010
+ qD as isExporting,
45993
46011
  NP as isGLTFModel,
45994
46012
  p1 as isHostedOnGlitch,
45995
46013
  ub as isHotReloadEnabled,
45996
- P2 as isHotReloading,
45997
- zD as isIPad,
46014
+ PD as isHotReloading,
46015
+ z2 as isIPad,
45998
46016
  yO as isIconElement,
45999
- Zi as isLocalNetwork,
46000
- WD as isMacOS,
46001
- FD as isMobileDevice,
46002
- $D as isMozillaXR,
46003
- GD as isQuest,
46017
+ Ki as isLocalNetwork,
46018
+ W2 as isMacOS,
46019
+ F2 as isMobileDevice,
46020
+ $2 as isMozillaXR,
46021
+ G2 as isQuest,
46004
46022
  GO as isResourceTrackingEnabled,
46005
- HD as isSafari,
46023
+ H2 as isSafari,
46006
46024
  Bg as isUsingInstancing,
46007
- VD as isiOS,
46008
- UD as isiPad,
46009
- V2 as loadAsset,
46025
+ V2 as isiOS,
46026
+ U2 as isiPad,
46027
+ VD as loadAsset,
46010
46028
  _w as loadPMREM,
46011
46029
  aS as loadSync,
46012
46030
  sm as logHierarchy,
46013
- KD as lookAtInverse,
46031
+ Z2 as lookAtInverse,
46014
46032
  Tu as lookAtObject,
46015
- ZD as lookAtScreenPoint,
46016
- LD as makeId,
46033
+ K2 as lookAtScreenPoint,
46034
+ L2 as makeId,
46017
46035
  y1 as makeIdFromRandomWords,
46018
46036
  nn as makeNameSafe,
46019
46037
  tR as markAsInstancedRendered,
46020
- qD as microphonePermissionsGranted,
46021
- TD as nameof,
46038
+ q2 as microphonePermissionsGranted,
46039
+ T2 as nameof,
46022
46040
  m1 as nameofFactory,
46023
46041
  AR as objectSerializer,
46024
- y2 as offXRSessionEnd,
46025
- g2 as offXRSessionStart,
46026
- a2 as onAfterRender,
46027
- r2 as onBeforeRender,
46028
- s2 as onClear,
46029
- o2 as onDestroy,
46042
+ yD as offXRSessionEnd,
46043
+ gD as offXRSessionStart,
46044
+ aD as onAfterRender,
46045
+ rD as onBeforeRender,
46046
+ sD as onClear,
46047
+ oD as onDestroy,
46030
46048
  C0 as onInitialized,
46031
46049
  Cg as onStart,
46032
46050
  qP as onUpdate,
46033
46051
  U0 as onXRSessionEnd,
46034
46052
  Tg as onXRSessionStart,
46035
- eD as parseSync,
46053
+ e2 as parseSync,
46036
46054
  rP as placeOnSurface,
46037
46055
  c0 as postprocessFBXMaterials,
46038
- L2 as prefix,
46056
+ LD as prefix,
46039
46057
  g1 as pushState,
46040
- DD as randomNumber,
46058
+ D2 as randomNumber,
46041
46059
  j0 as registerBinaryType,
46042
46060
  Ig as registerComponent,
46043
46061
  zw as registerComponentExtension,
@@ -46050,14 +46068,14 @@ export {
46050
46068
  J0 as registerPrototypeExtensions,
46051
46069
  g0 as registerType,
46052
46070
  b1 as relativePathPrefix,
46053
- Kv as removeAttributeChangeCallback,
46071
+ Zv as removeAttributeChangeCallback,
46054
46072
  rw as removeComponent,
46055
- F2 as removeCustomImportExtensionType,
46056
- i2 as removePatch,
46073
+ FD as removeCustomImportExtensionType,
46074
+ iD as removePatch,
46057
46075
  To as resolveUrl,
46058
46076
  _1 as sanitizeString,
46059
46077
  LL as saveImage,
46060
- W2 as screenshot,
46078
+ WD as screenshot,
46061
46079
  sS as screenshot2,
46062
46080
  O0 as sendDestroyed,
46063
46081
  u as serializable,
@@ -46065,24 +46083,24 @@ export {
46065
46083
  Ye as serializeable,
46066
46084
  wd as setActive,
46067
46085
  O1 as setAllowBalloonMessages,
46068
- XD as setAllowOverlayMessages,
46086
+ X2 as setAllowOverlayMessages,
46069
46087
  nm as setAutoFitEnabled,
46070
46088
  p_ as setCameraController,
46071
46089
  iR as setDestroyed,
46072
- YD as setDevEnvironment,
46090
+ Y2 as setDevEnvironment,
46073
46091
  qO as setDisposable,
46074
46092
  Dl as setDontDestroy,
46075
46093
  r_ as setOrAddParamsToUrl,
46076
- ID as setParam,
46094
+ I2 as setParam,
46077
46095
  Vd as setParamWithoutReload,
46078
- u2 as setPeerOptions,
46079
- w2 as setResourceTrackingEnabled,
46096
+ uD as setPeerOptions,
46097
+ wD as setResourceTrackingEnabled,
46080
46098
  Xv as setState,
46081
46099
  l0 as setVisibleInCustomShadowRendering,
46082
46100
  a0 as setWorldEuler,
46083
46101
  At as setWorldPosition,
46084
46102
  Va as setWorldPositionXYZ,
46085
- Kn as setWorldQuaternion,
46103
+ Zn as setWorldQuaternion,
46086
46104
  o0 as setWorldQuaternionXYZW,
46087
46105
  J1 as setWorldRotation,
46088
46106
  Au as setWorldRotationXYZ,
@@ -46095,7 +46113,7 @@ export {
46095
46113
  Du as syncDestroy,
46096
46114
  yw as syncField,
46097
46115
  R0 as syncInstantiate,
46098
- t2 as textureToCanvas,
46116
+ tD as textureToCanvas,
46099
46117
  v1 as toSourceId,
46100
46118
  Bk as tryCastBinary,
46101
46119
  lE as tryDetermineMimetypeFromBinary,