@needle-tools/engine 4.16.0-next.1243700 → 4.16.0-next.1c21170

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.
@@ -1,6 +1,6 @@
1
- import { Vector2 as Z, Vector3 as _, Vector4 as ge, Quaternion as V, PlaneGeometry as Sn, WebGLRenderer as Br, PerspectiveCamera as de, OrthographicCamera as uu, Scene as qi, Mesh as H, Texture as xe, Uniform$1 as Vi, Color as re, ShaderMaterial as Gn, Box3 as Ci, ShadowMaterial as dv, Euler as ct, MeshStandardMaterial as pt, Box3Helper as sS, GridHelper as uv, Object3D as M, Material as be, Matrix3 as fv, Matrix4 as ee, Layers as Co, Ray as Rs, MathUtils as Ss, AxesHelper as Pi, MeshBasicMaterial as Se, DoubleSide as Oi, BufferGeometry as yn, Group as Cs, CylinderGeometry as pv, SphereGeometry as fu, BoxGeometry as Fa, SpriteMaterial as oS, Sprite as rS, Shape as aS, ExtrudeGeometry as lS, Fog as mv, DirectionalLight as Np, PointLight as Qm, TextureLoader as kr, EdgesGeometry as cS, LineSegments as gv, LineBasicMaterial as Ym, Line as Ua, BufferAttribute as mt, Raycaster as pu, Sphere as mu, ArrayCamera as hS, Plane as Or, SkinnedMesh as yo, InterleavedBufferAttribute as yv, Skeleton as dS, Bone as uS, WebGLCubeRenderTarget as fS, CubeCamera as pS, AnimationClip as ki, FileLoader as Km, PropertyBinding as za, KeyframeTrack as mS, LinearSRGBColorSpace as Ts, ShaderChunk as Zt, DataTexture as Zm, RGBAFormat as gu, EquirectangularReflectionMapping as Ps, SRGBColorSpace as As, Clock as gS, NeutralToneMapping as Na, AgXToneMapping as yu, ACESFilmicToneMapping as _u, NoToneMapping as Ed, PCFSoftShadowMap$1 as yS, BasicNodeLibrary as _S, WebGLRenderTarget as qn, DepthTexture as _v, NearestFilter as Rd, LoopRepeat as bS, LoopOnce as $p, AnimationMixer as Jm, CompressedTexture as vS, FrontSide as Po, Camera as wS, Frustum as Fy, AudioListener as xS, PositionalAudio as SS, AudioLoader as Wp, EventDispatcher as eg, BackSide as bu, MeshDepthMaterial as CS, CustomBlending as PS, MaxEquation as kS, AlwaysStencilFunc as OS, GreaterEqualStencilFunc as MS, NotEqualStencilFunc as ES, GreaterStencilFunc as RS, LessEqualStencilFunc as TS, EqualStencilFunc as AS, LessStencilFunc as IS, NeverStencilFunc as Uy, InvertStencilOp as LS, DecrementWrapStencilOp as DS, IncrementWrapStencilOp as jS, DecrementStencilOp as BS, IncrementStencilOp as FS, ReplaceStencilOp as US, ZeroStencilOp as zS, KeepStencilOp as NS, CubeUVReflectionMapping as bv, CubeTexture as vv, AmbientLight as $S, HemisphereLight as WS, Loader as VS, RawShaderMaterial as wv, GLSL3 as HS, AlwaysDepth as GS, GreaterEqualDepth as qS, GreaterDepth as XS, LessEqualDepth as QS, LessDepth as YS, NotEqualDepth as KS, EqualDepth as ZS, BatchedMesh as zy, LinearFilter as Td, UnsignedByteType as JS, MeshPhysicalMaterial as Ny, RingGeometry as eC, Line3 as tC, AdditiveBlending as xv, BoxHelper as iC, SpotLight as nC, DirectionalLightHelper as sC, CameraHelper as oC, LOD as rC, Triangle as aC, NormalBlending as lC, ReinhardToneMapping as tg, LinearToneMapping as ig, HalfFloatType as Mf, VideoTexture as cC, CompressedCubeTexture as hC, EquirectangularRefractionMapping as dC, CatmullRomCurve3 as uC, VectorKeyframeTrack as fC, QuaternionKeyframeTrack as pC, Audio as mC, ShaderLib as Ad, UniformsUtils as Sv, MirroredRepeatWrapping as $y, MeshNormalMaterial as gC, AudioContext as yC, PMREMGenerator$1 as _C } from "./three.js";
1
+ import { Vector2 as Z, Vector3 as _, Vector4 as ge, Quaternion as V, PlaneGeometry as Sn, WebGLRenderer as Br, PerspectiveCamera as de, OrthographicCamera as uu, Scene as qi, Mesh as H, Texture as xe, Uniform$1 as Vi, Color as re, ShaderMaterial as Gn, Box3 as Ci, ShadowMaterial as dv, Euler as ct, MeshStandardMaterial as pt, Box3Helper as sS, GridHelper as uv, Object3D as M, Material as be, Matrix3 as fv, Matrix4 as ee, Layers as Co, Ray as Rs, MathUtils as Ss, AxesHelper as Pi, MeshBasicMaterial as Se, DoubleSide as Oi, BufferGeometry as yn, Group as Cs, CylinderGeometry as pv, SphereGeometry as fu, BoxGeometry as Fa, SpriteMaterial as oS, Sprite as rS, Shape as aS, ExtrudeGeometry as lS, Fog as mv, DirectionalLight as Np, PointLight as Qm, TextureLoader as kr, EdgesGeometry as cS, LineSegments as gv, LineBasicMaterial as Ym, Line as za, BufferAttribute as mt, Raycaster as pu, Sphere as mu, ArrayCamera as hS, Plane as Or, SkinnedMesh as yo, InterleavedBufferAttribute as yv, Skeleton as dS, Bone as uS, WebGLCubeRenderTarget as fS, CubeCamera as pS, AnimationClip as ki, FileLoader as Km, PropertyBinding as Ua, KeyframeTrack as mS, LinearSRGBColorSpace as Ts, ShaderChunk as Zt, DataTexture as Zm, RGBAFormat as gu, EquirectangularReflectionMapping as Ps, SRGBColorSpace as As, Clock as gS, NeutralToneMapping as Na, AgXToneMapping as yu, ACESFilmicToneMapping as _u, NoToneMapping as Ed, PCFSoftShadowMap$1 as yS, BasicNodeLibrary as _S, WebGLRenderTarget as qn, DepthTexture as _v, NearestFilter as Rd, LoopRepeat as bS, LoopOnce as $p, AnimationMixer as Jm, CompressedTexture as vS, FrontSide as Po, Camera as wS, Frustum as Fy, AudioListener as xS, PositionalAudio as SS, AudioLoader as Wp, EventDispatcher as eg, BackSide as bu, MeshDepthMaterial as CS, CustomBlending as PS, MaxEquation as kS, AlwaysStencilFunc as OS, GreaterEqualStencilFunc as MS, NotEqualStencilFunc as ES, GreaterStencilFunc as RS, LessEqualStencilFunc as TS, EqualStencilFunc as AS, LessStencilFunc as IS, NeverStencilFunc as zy, InvertStencilOp as LS, DecrementWrapStencilOp as DS, IncrementWrapStencilOp as jS, DecrementStencilOp as BS, IncrementStencilOp as FS, ReplaceStencilOp as zS, ZeroStencilOp as US, KeepStencilOp as NS, CubeUVReflectionMapping as bv, CubeTexture as vv, AmbientLight as $S, HemisphereLight as WS, Loader as VS, RawShaderMaterial as wv, GLSL3 as HS, AlwaysDepth as GS, GreaterEqualDepth as qS, GreaterDepth as XS, LessEqualDepth as QS, LessDepth as YS, NotEqualDepth as KS, EqualDepth as ZS, BatchedMesh as Uy, LinearFilter as Td, UnsignedByteType as JS, MeshPhysicalMaterial as Ny, RingGeometry as eC, Line3 as tC, AdditiveBlending as xv, BoxHelper as iC, SpotLight as nC, DirectionalLightHelper as sC, CameraHelper as oC, LOD as rC, Triangle as aC, NormalBlending as lC, ReinhardToneMapping as tg, LinearToneMapping as ig, HalfFloatType as Mf, VideoTexture as cC, CompressedCubeTexture as hC, EquirectangularRefractionMapping as dC, CatmullRomCurve3 as uC, VectorKeyframeTrack as fC, QuaternionKeyframeTrack as pC, Audio as mC, ShaderLib as Ad, UniformsUtils as Sv, MirroredRepeatWrapping as $y, MeshNormalMaterial as gC, AudioContext as yC, PMREMGenerator$1 as _C } from "./three.js";
2
2
  import { createLoaders as ng, getRaycastMesh as Cv, LODsManager as Zo, NEEDLE_progressive as We, addDracoAndKTX2Loaders as bC, configureLoader as vC, setKTX2TranscoderLocation as wC, setDracoDecoderLocation as xC } from "./gltf-progressive-_wvokUUu.js";
3
- import { GroundedSkybox as $a, Font as SC, TextGeometry as CC, FontLoader as PC, GLTFLoader as Is, TransformControlsGizmo as Pv, EXRLoader as sg, RGBELoader as kv, Stats as kC, nodeFrame as Wy, OrbitControls as OC, PositionalAudioHelper as MC, HorizontalBlurShader as EC, VerticalBlurShader as RC, GLTFExporter as Ov, strToU8 as Mv, zipSync as TC, XRControllerModelFactory as AC, XRHandMeshModel as IC, Line2 as LC, LineGeometry as DC, LineMaterial as jC, TransformControls as BC, InteractiveGroup as FC, HTMLMesh as UC, VertexNormalsHelper as zC, OBJLoader as og, FBXLoader as Ev, mergeVertices as NC } from "./three-examples.js";
3
+ import { GroundedSkybox as $a, Font as SC, TextGeometry as CC, FontLoader as PC, GLTFLoader as Is, TransformControlsGizmo as Pv, EXRLoader as sg, RGBELoader as kv, Stats as kC, nodeFrame as Wy, OrbitControls as OC, PositionalAudioHelper as MC, HorizontalBlurShader as EC, VerticalBlurShader as RC, GLTFExporter as Ov, strToU8 as Mv, zipSync as TC, XRControllerModelFactory as AC, XRHandMeshModel as IC, Line2 as LC, LineGeometry as DC, LineMaterial as jC, TransformControls as BC, InteractiveGroup as FC, HTMLMesh as zC, VertexNormalsHelper as UC, OBJLoader as og, FBXLoader as Ev, mergeVertices as NC } from "./three-examples.js";
4
4
  import { fetchProfile as $C, MotionController as WC, $70d766613f57b014$export$2e2bcd8739ae039 as Vy, ByteBuffer as VC, v5 as Hy, md5 as Gy, SIZE_PREFIX_LENGTH as Rv, Builder as rg, createNoise4D as HC, Matrix4 as Ef, BatchedParticleRenderer as GC, ParticleSystem as qC, RenderMode as fs, ConstantColor as XC, Vector4 as QC, ConstantValue as YC, TrailParticle as qy, WorkerBase as KC, MeshBVH as ZC } from "./vendor-BsRxp-FT.js";
5
5
  import { __webpack_exports__default as Pe, __webpack_exports__Text as Tv, __webpack_exports__Block as Av, __webpack_exports__update as JC, SimpleStateBehavior as e1, __webpack_exports__Inline as Rf, __webpack_exports__FontLibrary as Xy, ThreeMeshUI as Qy } from "./three-mesh-ui-B-lqrZWj.js";
6
6
  import { EffectAttribute as t1 } from "./postprocessing-C-WOZQC5.js";
@@ -539,7 +539,7 @@ let lg = !1;
539
539
  const Af = "needle_engine_global_error_container";
540
540
  var Hi = /* @__PURE__ */ ((s) => (s[s.Log = 0] = "Log", s[s.Warn = 1] = "Warn", s[s.Error = 2] = "Error", s))(Hi || {});
541
541
  function Fv() {
542
- return zv;
542
+ return Uv;
543
543
  }
544
544
  const Hp = new Array();
545
545
  function u1(s) {
@@ -558,18 +558,18 @@ function f1(...s) {
558
558
  If = !1;
559
559
  }
560
560
  }
561
- const Uv = console.error, p1 = function(...s) {
562
- Uv.apply(console, s), y1(s), pr(2, s, {}), g1(...s);
561
+ const zv = console.error, p1 = function(...s) {
562
+ zv.apply(console, s), y1(s), pr(2, s, {}), g1(...s);
563
563
  };
564
564
  function m1(s) {
565
- lg = !s, s ? console.error = p1 : console.error = Uv;
565
+ lg = !s, s ? console.error = p1 : console.error = zv;
566
566
  }
567
567
  function wD(s) {
568
568
  return m1(s);
569
569
  }
570
- let zv = 0;
570
+ let Uv = 0;
571
571
  function g1(...s) {
572
- zv += 1, f1(...s);
572
+ Uv += 1, f1(...s);
573
573
  }
574
574
  function y1(s) {
575
575
  if (Array.isArray(s))
@@ -1010,7 +1010,7 @@ function Su(s, e, t = !0, i = !1) {
1010
1010
  }
1011
1011
  function PD(s, e, t, i = 1) {
1012
1012
  if (t) {
1013
- const n = z(0, 0, 0), o = e.x / window.innerWidth * 2 - 1, r = -(e.y / window.innerHeight) * 2 + 1;
1013
+ const n = U(0, 0, 0), o = e.x / window.innerWidth * 2 - 1, r = -(e.y / window.innerHeight) * 2 + 1;
1014
1014
  n.set(
1015
1015
  o,
1016
1016
  r,
@@ -1024,7 +1024,7 @@ function PD(s, e, t, i = 1) {
1024
1024
  return null;
1025
1025
  }
1026
1026
  const E1 = new Qi(() => new _(), 100);
1027
- function z(s, e, t) {
1027
+ function U(s, e, t) {
1028
1028
  const i = E1.get();
1029
1029
  return i.set(0, 0, 0), s instanceof _ ? i.copy(s) : Array.isArray(s) ? i.set(s[0], s[1], s[2]) : s instanceof DOMPointReadOnly ? i.set(s.x, s.y, s.z) : typeof s == "number" ? (i.x = s, i.y = e !== void 0 ? e : i.x, i.z = t !== void 0 ? t : i.x) : typeof s == "object" && (i.x = s.x, i.y = s.y, i.z = s.z), i;
1030
1030
  }
@@ -1070,7 +1070,7 @@ function Vv(s, e, t, i, n) {
1070
1070
  _r.set(e, t, i, n), Xn(s, _r);
1071
1071
  }
1072
1072
  const I1 = new Qi(() => new _(), 100), L1 = new _();
1073
- function qe(s, e = null) {
1073
+ function Xe(s, e = null) {
1074
1074
  return e || (e = I1.get()), s ? s.parent ? (s.getWorldScale(e), e) : e.copy(s.scale) : e.set(0, 0, 0);
1075
1075
  }
1076
1076
  function Ec(s, e) {
@@ -1103,7 +1103,7 @@ function hg(s) {
1103
1103
  const e = Hv(s), t = F1;
1104
1104
  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;
1105
1105
  }
1106
- function U1(s, e) {
1106
+ function z1(s, e) {
1107
1107
  Cu(s, e.x, e.y, e.z, !0);
1108
1108
  }
1109
1109
  function Cu(s, e, t, i, n = !0) {
@@ -1126,7 +1126,7 @@ function OD(s) {
1126
1126
  e = t.name + "/" + e, t = t.parent;
1127
1127
  return e;
1128
1128
  }
1129
- function z1(s) {
1129
+ function U1(s) {
1130
1130
  if (s) {
1131
1131
  const e = s;
1132
1132
  return e.blendMode !== void 0 && e.clampWhenFinished !== void 0 && e.enabled !== void 0 && e.fadeIn !== void 0 && e.getClip !== void 0;
@@ -1309,7 +1309,7 @@ function H1(s, e, t) {
1309
1309
  const l = new _();
1310
1310
  l.set(r.x / n.x, r.y / n.y, r.z / n.z);
1311
1311
  const c = Math.min(l.x, l.y, l.z), h = t?.scale !== !1;
1312
- if (h && Ec(s, qe(s).multiplyScalar(c)), t?.position !== !1) {
1312
+ if (h && Ec(s, Xe(s).multiplyScalar(c)), t?.position !== !1) {
1313
1313
  const d = new _();
1314
1314
  i.getCenter(d), d.y = i.min.y;
1315
1315
  const f = new _();
@@ -1990,9 +1990,9 @@ Ro('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUIL
1990
1990
  Ro('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";');
1991
1991
  Ro('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.16.0";');
1992
1992
  Ro('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
1993
- Ro('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Fri Mar 06 2026 14:13:58 GMT+0000 (Coordinated Universal Time)";');
1993
+ Ro('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Mon Mar 09 2026 14:04:08 GMT+0000 (Coordinated Universal Time)";');
1994
1994
  Ro('globalThis["__NEEDLE_PUBLIC_KEY__"] = "' + NEEDLE_PUBLIC_KEY + '";');
1995
- const Gi = "4.16.0", Rc = "undefined", Bd = "Fri Mar 06 2026 14:13:58 GMT+0000 (Coordinated Universal Time)";
1995
+ const Gi = "4.16.0", Rc = "undefined", Bd = "Mon Mar 09 2026 14:04:08 GMT+0000 (Coordinated Universal Time)";
1996
1996
  t0 && console.log(`Engine version: ${Gi} (generator: ${Rc})
1997
1997
  Project built at ${Bd}`);
1998
1998
  const mr = NEEDLE_PUBLIC_KEY, bo = "needle_isActiveInHierarchy", ha = "builtin_components", cd = "needle_editor_guid";
@@ -2210,9 +2210,9 @@ function g_(s, e, t) {
2210
2210
  };
2211
2211
  return i[m_] = !0, i;
2212
2212
  }
2213
- const Uf = "Needle:Patches";
2213
+ const zf = "Needle:Patches";
2214
2214
  function Kp() {
2215
- return globalThis[Uf] || (globalThis[Uf] = /* @__PURE__ */ new WeakMap()), globalThis[Uf];
2215
+ return globalThis[zf] || (globalThis[zf] = /* @__PURE__ */ new WeakMap()), globalThis[zf];
2216
2216
  }
2217
2217
  function fg(s, e) {
2218
2218
  const t = Kp().get(s);
@@ -2934,7 +2934,7 @@ class AP {
2934
2934
  this.convertScreenspaceToRaycastSpace(r);
2935
2935
  const a = this.tempFarPlaneVector.set(r.x, r.y, 1);
2936
2936
  r.unproject(o), a.unproject(o);
2937
- const l = o.worldUp || z(0, 1, 0).applyQuaternion(ve(o));
2937
+ const l = o.worldUp || U(0, 1, 0).applyQuaternion(ve(o));
2938
2938
  this.tempLookMatrix.lookAt(a, r, l), n.position.set(r.x, r.y, r.z), n.quaternion.setFromRotationMatrix(this.tempLookMatrix);
2939
2939
  }
2940
2940
  return n;
@@ -3200,7 +3200,7 @@ class l0 {
3200
3200
  _rayQuaternion = new V();
3201
3201
  /** Grip position in rig space */
3202
3202
  get gripPosition() {
3203
- return z(this._gripPosition);
3203
+ return U(this._gripPosition);
3204
3204
  }
3205
3205
  /** Grip rotation in rig space */
3206
3206
  get gripQuaternion() {
@@ -3213,11 +3213,11 @@ class l0 {
3213
3213
  * @link https://developer.mozilla.org/en-US/docs/Web/API/XRPose/linearVelocity
3214
3214
  */
3215
3215
  get gripLinearVelocity() {
3216
- return z(this._linearVelocity).applyQuaternion($i);
3216
+ return U(this._linearVelocity).applyQuaternion($i);
3217
3217
  }
3218
3218
  /** Ray position in rig space */
3219
3219
  get rayPosition() {
3220
- return z(this._rayPosition);
3220
+ return U(this._rayPosition);
3221
3221
  }
3222
3222
  /** Ray rotation in rig space */
3223
3223
  get rayQuaternion() {
@@ -3225,7 +3225,7 @@ class l0 {
3225
3225
  }
3226
3226
  /** Controller grip position in worldspace */
3227
3227
  get gripWorldPosition() {
3228
- return z(this._gripWorldPosition);
3228
+ return U(this._gripWorldPosition);
3229
3229
  }
3230
3230
  _gripWorldPosition = new _();
3231
3231
  /** Controller grip rotation in wordspace */
@@ -3235,7 +3235,7 @@ class l0 {
3235
3235
  _gripWorldQuaternion = new V();
3236
3236
  /** Controller ray position in worldspace (this value is calculated once per frame by default - call `updateRayWorldPosition` to force an update) */
3237
3237
  get rayWorldPosition() {
3238
- return z(this._rayWorldPosition);
3238
+ return U(this._rayWorldPosition);
3239
3239
  }
3240
3240
  _rayWorldPosition = new _();
3241
3241
  /** Recalculates the ray world position */
@@ -3249,7 +3249,7 @@ class l0 {
3249
3249
  }
3250
3250
  _rayWorldQuaternion = new V();
3251
3251
  get pinchPosition() {
3252
- return z(this._pinchPosition);
3252
+ return U(this._pinchPosition);
3253
3253
  }
3254
3254
  _pinchPosition = new _();
3255
3255
  /** Recalculates the ray world quaternion */
@@ -3259,7 +3259,7 @@ class l0 {
3259
3259
  }
3260
3260
  /** The controller ray in worldspace */
3261
3261
  get ray() {
3262
- return this._ray.origin.copy(this.rayWorldPosition), this._ray.direction.copy(z(0, 0, 1).applyQuaternion(this.rayWorldQuaternion)), this._ray;
3262
+ return this._ray.origin.copy(this.rayWorldPosition), this._ray.direction.copy(U(0, 0, 1).applyQuaternion(this.rayWorldQuaternion)), this._ray;
3263
3263
  }
3264
3264
  _ray;
3265
3265
  /** Recalculated once per update */
@@ -3273,7 +3273,7 @@ class l0 {
3273
3273
  if (this._hand_wristDotUp !== void 0) return this._hand_wristDotUp;
3274
3274
  const e = this.handObject?.joints.wrist;
3275
3275
  if (e) {
3276
- const t = z(0, 1, 0).applyQuaternion(e.quaternion), i = z(0, 1, 0).dot(t);
3276
+ const t = U(0, 1, 0).applyQuaternion(e.quaternion), i = U(0, 1, 0).dot(t);
3277
3277
  return this._hand_wristDotUp = i;
3278
3278
  }
3279
3279
  }
@@ -3334,7 +3334,7 @@ class l0 {
3334
3334
  this.onUpdateFrame(e), this.updateInputEvents(), this.onUpdateMove();
3335
3335
  }
3336
3336
  onRenderDebug() {
3337
- U.DrawSphere(this.rayWorldPosition, 3e-3), U.DrawDirection(this.rayWorldPosition, z(0, 0, 10).applyQuaternion(this.rayWorldQuaternion));
3337
+ z.DrawSphere(this.rayWorldPosition, 3e-3), z.DrawDirection(this.rayWorldPosition, U(0, 0, 10).applyQuaternion(this.rayWorldQuaternion));
3338
3338
  const t = (this.inputSource.gripSpace ? this.gripWorldPosition : this.object.worldPosition).sub(this.object.worldForward.multiplyScalar(0.1)), i = this.inputSource.profiles.join(`
3339
3339
  `);
3340
3340
  let n = `Controller[${this.index}] (${this.inputSource.targetRayMode}, ${this.side})
@@ -3358,7 +3358,7 @@ Layout: `;
3358
3358
  ${o}: ${this._layout.components[o]?.type} [${l}] (${r.x.toPrecision(2)},${r.y.toPrecision(2)})`;
3359
3359
  }
3360
3360
  }
3361
- U.DrawLabel(t, n, 6e-3);
3361
+ z.DrawLabel(t, n, 6e-3);
3362
3362
  }
3363
3363
  onUpdateFrame(e) {
3364
3364
  if (this._handJointPoses.clear(), this._hand_wristDotUp = void 0, !this.xr.referenceSpace || !this.inputSource.gamepad?.connected) {
@@ -3370,13 +3370,13 @@ Layout: `;
3370
3370
  let i = null, n = null, o = null, r = null;
3371
3371
  if (t) {
3372
3372
  const h = t.transform;
3373
- this._rayMatrix.fromArray(h.matrix).premultiply(ka), this._rayMatrix.decompose(this._rayPosition, this._rayQuaternion, z(1, 1, 1)), o = z(h.position), r = _i(h.orientation), this._rayPositionRaw.copy(o), this._rayRotationRaw.copy(r);
3373
+ this._rayMatrix.fromArray(h.matrix).premultiply(ka), this._rayMatrix.decompose(this._rayPosition, this._rayQuaternion, U(1, 1, 1)), o = U(h.position), r = _i(h.orientation), this._rayPositionRaw.copy(o), this._rayRotationRaw.copy(r);
3374
3374
  }
3375
3375
  if (this.inputSource.gripSpace) {
3376
3376
  const h = e.getPose(this.inputSource.gripSpace, this.xr.referenceSpace);
3377
3377
  if (h) {
3378
3378
  const d = h.transform;
3379
- if (i = z(d.position), n = _i(d.orientation), this._gripMatrix.fromArray(d.matrix).premultiply(ka), this._gripMatrix.decompose(this._gripPosition, this._gripQuaternion, z(1, 1, 1)), "linearVelocity" in h && h.linearVelocity) {
3379
+ if (i = U(d.position), n = _i(d.orientation), this._gripMatrix.fromArray(d.matrix).premultiply(ka), this._gripMatrix.decompose(this._gripPosition, this._gripQuaternion, U(1, 1, 1)), "linearVelocity" in h && h.linearVelocity) {
3380
3380
  const f = h.linearVelocity;
3381
3381
  this._linearVelocity.set(f.x, f.y, f.z);
3382
3382
  }
@@ -3394,7 +3394,7 @@ Layout: `;
3394
3394
  }
3395
3395
  h || (this._object.position.copy(this._rayPosition), this._object.quaternion.copy(this._rayQuaternion).multiply($i));
3396
3396
  const p = a.get("middle-finger-metacarpal"), g = p && this.getHandJointPose(p, e);
3397
- g && (this._gripMatrix.fromArray(g.transform.matrix).premultiply(ka), this._gripMatrix.decompose(this._gripPosition, this._gripQuaternion, z(1, 1, 1)), i = z().copy(g.transform.position), n = _i().copy(g.transform.orientation), n.multiply(BP), i.add(z(FP).applyQuaternion(n)));
3397
+ g && (this._gripMatrix.fromArray(g.transform.matrix).premultiply(ka), this._gripMatrix.decompose(this._gripPosition, this._gripQuaternion, U(1, 1, 1)), i = U().copy(g.transform.position), n = _i().copy(g.transform.orientation), n.multiply(BP), i.add(U(FP).applyQuaternion(n)));
3398
3398
  } else this.inputSource.gripSpace && this.targetRayMode === "transient-pointer" && i && n ? (this._object.position.copy(i), this._object.quaternion.copy(n).multiply($i)) : o && r && (this._object.position.copy(o), this._object.quaternion.copy(r).multiply($i));
3399
3399
  rs && (o && r && (this._raySpaceObject?.position.copy(o), this._raySpaceObject?.quaternion.copy(r).multiply($i)), i && n && (this._gripSpaceObject?.position.copy(i), this._gripSpaceObject?.quaternion.copy(n).multiply($i)));
3400
3400
  const l = this.xr.context.mainCamera?.parent, c = l ? ve(l) : void 0;
@@ -3577,13 +3577,13 @@ Layout: `;
3577
3577
  if (!this.emitPointerDownEvent || this.inputSource !== e.inputSource) return;
3578
3578
  this.onUpdateFrame(e.frame), this._hasSelectEvent = !0;
3579
3579
  const t = this._layout?.selectComponentId, i = this._layout?.components[t]?.gamepadIndices?.button;
3580
- i !== void 0 && (this._selectButtonIndex = i), !Mh && (rs && U.DrawDirection(this.rayWorldPosition, z(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 16711680, 10), this.emitPointerEvent(Be.PointerDown, this._selectButtonIndex || 0, "xr-standard-trigger", !0, e));
3580
+ i !== void 0 && (this._selectButtonIndex = i), !Mh && (rs && z.DrawDirection(this.rayWorldPosition, U(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 16711680, 10), this.emitPointerEvent(Be.PointerDown, this._selectButtonIndex || 0, "xr-standard-trigger", !0, e));
3581
3581
  };
3582
3582
  onSelectEnd = (e) => {
3583
3583
  this.emitPointerUpEvent && (Mh || this.inputSource === e.inputSource && this.emitPointerEvent(Be.PointerUp, this._selectButtonIndex || 0, "xr-standard-trigger", !0, e));
3584
3584
  };
3585
3585
  onSequeezeStart = (e) => {
3586
- this.emitPointerDownEvent && this.inputSource === e.inputSource && (this._squeezeButtonIndex = this._layout?.components["xr-standard-squeeze"]?.gamepadIndices?.button, this._squeezeButtonIndex !== void 0 && (rs && U.DrawDirection(this.rayWorldPosition, z(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 255, 10), this.emitPointerEvent(Be.PointerDown, this._squeezeButtonIndex || 0, "xr-standard-squeeze", !0, e)));
3586
+ this.emitPointerDownEvent && this.inputSource === e.inputSource && (this._squeezeButtonIndex = this._layout?.components["xr-standard-squeeze"]?.gamepadIndices?.button, this._squeezeButtonIndex !== void 0 && (rs && z.DrawDirection(this.rayWorldPosition, U(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 255, 10), this.emitPointerEvent(Be.PointerDown, this._squeezeButtonIndex || 0, "xr-standard-squeeze", !0, e)));
3587
3587
  };
3588
3588
  onSequeezeEnd = (e) => {
3589
3589
  this.emitPointerUpEvent && this.inputSource === e.inputSource && this._squeezeButtonIndex !== void 0 && this.emitPointerEvent(Be.PointerUp, this._squeezeButtonIndex || 0, "xr-standard-squeeze", !0, e);
@@ -3639,7 +3639,7 @@ Layout: `;
3639
3639
  if (!this.emitPointerMoveEvent) return;
3640
3640
  let e = !1;
3641
3641
  if (this._lastPointerMovePosition.distanceTo(this.gripWorldPosition) > this.pointerMoveDistanceThreshold * this.xr.rigScale && (e = !0), e || this._lastPointerMoveQuaternion.angleTo(this.gripWorldQuaternion) > this.pointerMoveAngleThreshold && (e = !0), e) {
3642
- this._didMoveLastFrame = !0, this._lastPointerMovePosition.copy(this.gripWorldPosition), this._lastPointerMoveQuaternion.copy(this.gripWorldQuaternion), rs && U.DrawLabel(this.rayWorldPosition.add(this.object.worldForward.multiplyScalar(0.1)), "move", 0.01);
3642
+ this._didMoveLastFrame = !0, this._lastPointerMovePosition.copy(this.gripWorldPosition), this._lastPointerMoveQuaternion.copy(this.gripWorldQuaternion), rs && z.DrawLabel(this.rayWorldPosition.add(this.object.worldForward.multiplyScalar(0.1)), "move", 0.01);
3643
3643
  let i = this.xr.context.input.getFirstPressedButtonForPointer(this.index);
3644
3644
  i === void 0 && (i = 0);
3645
3645
  const n = this.gamepad?.buttons[i]?.value;
@@ -3853,11 +3853,11 @@ const Jp = /* @__PURE__ */ new WeakMap(), h0 = {};
3853
3853
  function d0(s, e) {
3854
3854
  h0[s] = e;
3855
3855
  }
3856
- function UP(s) {
3856
+ function zP(s) {
3857
3857
  const e = s.getBufferIdentifier(), t = h0[e];
3858
3858
  return t(s);
3859
3859
  }
3860
- function zP(s) {
3860
+ function UP(s) {
3861
3861
  return typeof s.guid == "function" ? s.guid() : null;
3862
3862
  }
3863
3863
  let gg;
@@ -3970,7 +3970,7 @@ class FD {
3970
3970
  room;
3971
3971
  // room name
3972
3972
  }
3973
- class UD {
3973
+ class zD {
3974
3974
  userId;
3975
3975
  }
3976
3976
  var GP = /* @__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))(GP || {});
@@ -4398,7 +4398,7 @@ class qP {
4398
4398
  Th && console.log("<< bin", this.context.time.frame);
4399
4399
  const t = await e.arrayBuffer();
4400
4400
  var i = new Uint8Array(t);
4401
- const n = new VC(i), o = n.getBufferIdentifier(), r = this._listenersBinary[o], a = UP(n), l = zP(a);
4401
+ const n = new VC(i), o = n.getBufferIdentifier(), r = this._listenersBinary[o], a = zP(n), l = UP(a);
4402
4402
  if (l && typeof l == "string" && (this._state[l] = a), !r) return;
4403
4403
  const c = a ?? n;
4404
4404
  for (const h of r)
@@ -4499,7 +4499,7 @@ ${a.href}`);
4499
4499
  }
4500
4500
  }
4501
4501
  const uc = x("debugwebxr");
4502
- class zf {
4502
+ class Uf {
4503
4503
  controllerStates = [];
4504
4504
  userId;
4505
4505
  context;
@@ -4583,9 +4583,9 @@ class XP {
4583
4583
  }
4584
4584
  onJoinedRoom = () => {
4585
4585
  if (this.context.connection.connectionId) {
4586
- this._states.has(this.context.connection.connectionId) || (uc && console.log("XRSync: Local user joined room", this.context.connection.connectionId), this._states.set(this.context.connection.connectionId, new zf(this.context.connection.connectionId, this.context)));
4586
+ this._states.has(this.context.connection.connectionId) || (uc && console.log("XRSync: Local user joined room", this.context.connection.connectionId), this._states.set(this.context.connection.connectionId, new Uf(this.context.connection.connectionId, this.context)));
4587
4587
  for (const e of this.context.connection.usersInRoom())
4588
- this._states.has(e) || this._states.set(e, new zf(e, this.context));
4588
+ this._states.has(e) || this._states.set(e, new Uf(e, this.context));
4589
4589
  }
4590
4590
  };
4591
4591
  onLeftRoom = () => {
@@ -4593,7 +4593,7 @@ class XP {
4593
4593
  };
4594
4594
  onOtherUserJoinedRoom = (e) => {
4595
4595
  const t = e.userId;
4596
- this._states.has(t) || (uc && console.log("XRSync: Remote user joined room", t), this._states.set(t, new zf(t, this.context)));
4596
+ this._states.has(t) || (uc && console.log("XRSync: Remote user joined room", t), this._states.set(t, new Uf(t, this.context)));
4597
4597
  };
4598
4598
  onOtherUserLeftRoom = (e) => {
4599
4599
  const t = e.userId;
@@ -4652,7 +4652,7 @@ const QP = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.o
4652
4652
  btoa(ZP);
4653
4653
  const JP = '<svg viewBox="0 0 509 154" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><path d="M665.95 132.73v44.88l-10.56-8.4c-.8-.64-1.2-1.44-1.2-2.4v-32.4c0-6.48-4.12-9.72-12.36-9.72-2.16 0-4.18.4-6.06 1.2-1.88.8-3.54 1.8-4.98 3-1.44 1.2-2.56 2.5-3.36 3.9-.8 1.4-1.2 2.7-1.2 3.9v40.92l-10.68-8.4c-.72-.64-1.08-1.44-1.08-2.4v-53.76l10.92 8.52c.32.24.56.44.72.6.16.16.36.32.6.48.96-1.2 2.14-2.28 3.54-3.24 1.4-.96 2.92-1.76 4.56-2.4 1.64-.64 3.34-1.14 5.1-1.5 1.76-.36 3.44-.54 5.04-.54 1.44 0 2.92.04 4.44.12 1.52.08 2.84.28 3.96.6 4.56 1.12 7.8 3.12 9.72 6 1.92 2.88 2.88 6.56 2.88 11.04ZM732.38 146.05c0 .88.02 1.5.06 1.86.04.36-.02.98-.18 1.86h-7.08c-2.08 0-4.44-.02-7.08-.06-2.64-.04-5.36-.06-8.16-.06h-22.08c0 2.88.56 5.36 1.68 7.44 1.12 2.08 2.6 3.8 4.44 5.16 1.84 1.36 3.94 2.36 6.3 3 2.36.64 4.74.96 7.14.96 3.04 0 5.9-.76 8.58-2.28 2.68-1.52 4.94-3.52 6.78-6 .64.56 1.54 1.48 2.7 2.76 1.16 1.28 2.94 3.2 5.34 5.76-2.8 3.36-6.22 6.02-10.26 7.98-4.04 1.96-8.42 2.94-13.14 2.94-4.72 0-8.92-.64-12.84-1.92-3.92-1.28-7.32-3.24-10.2-5.88-2.88-2.64-5.12-5.98-6.72-10.02-1.6-4.04-2.4-8.82-2.4-14.34 0-4.96.66-9.42 1.98-13.38 1.32-3.96 3.22-7.32 5.7-10.08s5.44-4.9 8.88-6.42c3.44-1.52 7.32-2.28 11.64-2.28 5.76 0 10.52.88 14.28 2.64 3.76 1.76 6.72 4.16 8.88 7.2 2.16 3.04 3.66 6.54 4.5 10.5.84 3.96 1.26 8.18 1.26 12.66Zm-29.4-22.8c-2.16.16-4.16.72-6 1.68-1.84.96-3.42 2.2-4.74 3.72-1.32 1.52-2.36 3.28-3.12 5.28-.76 2-1.14 4.12-1.14 6.36h33.12c0-2-.22-4.06-.66-6.18-.44-2.12-1.3-4.02-2.58-5.7-1.28-1.68-3.1-3.02-5.46-4.02-2.36-1-5.5-1.38-9.42-1.14ZM795.93 146.05c0 .88.02 1.5.06 1.86.04.36-.02.98-.18 1.86h-7.08c-2.08 0-4.44-.02-7.08-.06-2.64-.04-5.36-.06-8.16-.06h-22.08c0 2.88.56 5.36 1.68 7.44 1.12 2.08 2.6 3.8 4.44 5.16 1.84 1.36 3.94 2.36 6.3 3 2.36.64 4.74.96 7.14.96 3.04 0 5.9-.76 8.58-2.28 2.68-1.52 4.94-3.52 6.78-6 .64.56 1.54 1.48 2.7 2.76 1.16 1.28 2.94 3.2 5.34 5.76-2.8 3.36-6.22 6.02-10.26 7.98-4.04 1.96-8.42 2.94-13.14 2.94-4.72 0-8.92-.64-12.84-1.92-3.92-1.28-7.32-3.24-10.2-5.88-2.88-2.64-5.12-5.98-6.72-10.02-1.6-4.04-2.4-8.82-2.4-14.34 0-4.96.66-9.42 1.98-13.38 1.32-3.96 3.22-7.32 5.7-10.08s5.44-4.9 8.88-6.42c3.44-1.52 7.32-2.28 11.64-2.28 5.76 0 10.52.88 14.28 2.64 3.76 1.76 6.72 4.16 8.88 7.2 2.16 3.04 3.66 6.54 4.5 10.5.84 3.96 1.26 8.18 1.26 12.66Zm-29.4-22.8c-2.16.16-4.16.72-6 1.68-1.84.96-3.42 2.2-4.74 3.72-1.32 1.52-2.36 3.28-3.12 5.28-.76 2-1.14 4.12-1.14 6.36h33.12c0-2-.22-4.06-.66-6.18-.44-2.12-1.3-4.02-2.58-5.7-1.28-1.68-3.1-3.02-5.46-4.02-2.36-1-5.5-1.38-9.42-1.14ZM858.57 97.21c.64.48.96 1.16.96 2.04v74.88c-.08 1.04-.12 2.12-.12 3.24-1.84-1.52-3.56-2.92-5.16-4.2-1.36-1.12-2.66-2.18-3.9-3.18-1.24-1-2.06-1.66-2.46-1.98-1.76 2.48-4.26 4.44-7.5 5.88-3.24 1.44-7.02 2.16-11.34 2.16-3.84 0-7.4-.7-10.68-2.1-3.28-1.4-6.14-3.44-8.58-6.12-2.44-2.68-4.34-5.94-5.7-9.78-1.36-3.84-2.04-8.16-2.04-12.96 0-4.32.78-8.34 2.34-12.06 1.56-3.72 3.6-6.92 6.12-9.6 2.52-2.68 5.38-4.78 8.58-6.3 3.2-1.52 6.48-2.28 9.84-2.28 2.56 0 4.82.22 6.78.66 1.96.44 3.68 1.06 5.16 1.86s2.78 1.74 3.9 2.82a35.92 35.92 0 0 1 3.12 3.42V88.57l10.68 8.64Zm-27.96 67.92c3.6 0 6.52-.68 8.76-2.04 2.24-1.36 3.98-3.06 5.22-5.1a20.5 20.5 0 0 0 2.58-6.54c.48-2.32.72-4.44.72-6.36v-1.2c0-1.12-.22-2.7-.66-4.74-.44-2.04-1.28-4.06-2.52-6.06s-3-3.7-5.28-5.1c-2.28-1.4-5.22-2.02-8.82-1.86-3.44 0-6.26.74-8.46 2.22-2.2 1.48-3.96 3.26-5.28 5.34-1.32 2.08-2.24 4.2-2.76 6.36-.52 2.16-.78 3.92-.78 5.28 0 1.84.24 3.92.72 6.24.48 2.32 1.36 4.48 2.64 6.48s3.04 3.68 5.28 5.04c2.24 1.36 5.12 2.04 8.64 2.04ZM882.81 97.09c.64.48.96 1.12.96 1.92l-.12 41.04v37.08l-10.56-8.4c-.72-.64-1.08-1.44-1.08-2.4V88.45l10.8 8.64ZM950.36 146.05c0 .88.02 1.5.06 1.86.04.36-.02.98-.18 1.86h-7.08c-2.08 0-4.44-.02-7.08-.06-2.64-.04-5.36-.06-8.16-.06h-22.08c0 2.88.56 5.36 1.68 7.44 1.12 2.08 2.6 3.8 4.44 5.16 1.84 1.36 3.94 2.36 6.3 3 2.36.64 4.74.96 7.14.96 3.04 0 5.9-.76 8.58-2.28 2.68-1.52 4.94-3.52 6.78-6 .64.56 1.54 1.48 2.7 2.76 1.16 1.28 2.94 3.2 5.34 5.76-2.8 3.36-6.22 6.02-10.26 7.98-4.04 1.96-8.42 2.94-13.14 2.94-4.72 0-8.92-.64-12.84-1.92-3.92-1.28-7.32-3.24-10.2-5.88-2.88-2.64-5.12-5.98-6.72-10.02-1.6-4.04-2.4-8.82-2.4-14.34 0-4.96.66-9.42 1.98-13.38 1.32-3.96 3.22-7.32 5.7-10.08s5.44-4.9 8.88-6.42c3.44-1.52 7.32-2.28 11.64-2.28 5.76 0 10.52.88 14.28 2.64 3.76 1.76 6.72 4.16 8.88 7.2 2.16 3.04 3.66 6.54 4.5 10.5.84 3.96 1.26 8.18 1.26 12.66Zm-29.4-22.8c-2.16.16-4.16.72-6 1.68-1.84.96-3.42 2.2-4.74 3.72-1.32 1.52-2.36 3.28-3.12 5.28-.76 2-1.14 4.12-1.14 6.36h33.12c0-2-.22-4.06-.66-6.18-.44-2.12-1.3-4.02-2.58-5.7-1.28-1.68-3.1-3.02-5.46-4.02-2.36-1-5.5-1.38-9.42-1.14Z" style="fill-rule:nonzero" transform="translate(-452.406 -63.709) scale(1.00797)"/><path d="M79.32 36.98v150.76L95 174.54l6.59-156.31-22.27 18.75Z" style="fill:url(#a);fill-rule:nonzero" transform="matrix(.80638 0 0 .80638 2.361 1.094)"/><path d="M79.32 36.98 57.05 18.23l6.59 156.31 15.68 13.2V36.98Z" style="fill:url(#b);fill-rule:nonzero" transform="matrix(.80638 0 0 .80638 2.361 1.094)"/><path d="m25.19 104.83 8.63 49.04 12.5-14.95-2.46-56.42-18.67 22.33Z" style="fill:url(#c);fill-rule:nonzero" transform="matrix(.80638 0 0 .80638 2.361 1.094)"/><path d="M25.19 104.83 0 90.24l16.97 53.86 16.85 9.77-8.63-49.04Z" style="fill:url(#d);fill-rule:nonzero" transform="matrix(.80638 0 0 .80638 2.361 1.094)"/><path d="M43.86 82.5 18.69 67.98 0 90.24l25.18 14.59L43.86 82.5Z" style="fill:#9c3;fill-rule:nonzero" transform="matrix(.80638 0 0 .80638 2.361 1.094)"/><path d="m134.82 78.69-9.97 56.5 15.58-9.04L160 64.1l-25.18 14.59Z" style="fill:url(#e);fill-rule:nonzero" transform="matrix(.80638 0 0 .80638 2.361 1.094)"/><path d="m134.82 78.69-18.68-22.33-2.86 65 11.57 13.83 9.97-56.5Z" style="fill:url(#f);fill-rule:nonzero" transform="matrix(.80638 0 0 .80638 2.361 1.094)"/><path d="m160 64.1-18.69-22.26-25.17 14.52 18.67 22.33L160 64.1Z" style="fill:#ffe113;fill-rule:nonzero" transform="matrix(.80638 0 0 .80638 2.361 1.094)"/><path d="M101.59 18.23 79.32 0 57.05 18.23l22.27 18.75 22.27-18.75Z" style="fill:#f3e600;fill-rule:nonzero" transform="matrix(.80638 0 0 .80638 2.361 1.094)"/><defs><linearGradient id="a" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(.84 -162.96 162.96 .84 89.64 184.81)"><stop offset="0" style="stop-color:#62d399;stop-opacity:1"/><stop offset=".51" style="stop-color:#acd842;stop-opacity:1"/><stop offset=".9" style="stop-color:#d7db0a;stop-opacity:1"/><stop offset="1" style="stop-color:#d7db0a;stop-opacity:1"/></linearGradient><linearGradient id="b" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="rotate(-90.565 123.412 54.953) scale(162.14)"><stop offset="0" style="stop-color:#0ba398;stop-opacity:1"/><stop offset=".5" style="stop-color:#4ca352;stop-opacity:1"/><stop offset="1" style="stop-color:#76a30a;stop-opacity:1"/></linearGradient><linearGradient id="c" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="scale(-68) rotate(88.4 .881 -1.396)"><stop offset="0" style="stop-color:#36a382;stop-opacity:1"/><stop offset=".19" style="stop-color:#36a382;stop-opacity:1"/><stop offset=".54" style="stop-color:#49a459;stop-opacity:1"/><stop offset="1" style="stop-color:#76a30b;stop-opacity:1"/></linearGradient><linearGradient id="d" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="rotate(-88 87.255 68.431) scale(62.42)"><stop offset="0" style="stop-color:#267880;stop-opacity:1"/><stop offset=".51" style="stop-color:#457a5c;stop-opacity:1"/><stop offset="1" style="stop-color:#717516;stop-opacity:1"/></linearGradient><linearGradient id="e" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="rotate(-79.1 149.53 -14.065) scale(73.28)"><stop offset="0" style="stop-color:#b0d939;stop-opacity:1"/><stop offset="1" style="stop-color:#eadb04;stop-opacity:1"/></linearGradient><linearGradient id="f" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="rotate(-67.997 148.705 -15.558) scale(69.8226)"><stop offset="0" style="stop-color:#74af52;stop-opacity:1"/><stop offset=".17" style="stop-color:#74af52;stop-opacity:1"/><stop offset=".48" style="stop-color:#99be32;stop-opacity:1"/><stop offset="1" style="stop-color:#c0c40a;stop-opacity:1"/></linearGradient></defs></svg>', ek = btoa(JP), tk = "data:image/svg+xml;charset=utf-8;base64," + ek, P_ = tk;
4654
4654
  var Hc = /* @__PURE__ */ ((s) => (s[s.Quad = 0] = "Quad", s[s.Cube = 1] = "Cube", s[s.Sphere = 2] = "Sphere", s[s.Cylinder = 3] = "Cylinder", s[s.RoundedCube = 10] = "RoundedCube", s))(Hc || {});
4655
- class Ur {
4655
+ class zr {
4656
4656
  /**
4657
4657
  * Creates a 3D text object
4658
4658
  * @param text The text to display
@@ -4829,7 +4829,7 @@ function k_(s, e) {
4829
4829
  }
4830
4830
  }
4831
4831
  function O_() {
4832
- return new Cs().add(Ur.createPrimitive("Sphere", { material: new Se({ transparent: !0, opacity: 0.1 }) }));
4832
+ return new Cs().add(zr.createPrimitive("Sphere", { material: new Se({ transparent: !0, opacity: 0.1 }) }));
4833
4833
  }
4834
4834
  class qa {
4835
4835
  static _active = null;
@@ -4972,7 +4972,7 @@ class qa {
4972
4972
  color: 2236962,
4973
4973
  metalness: 1,
4974
4974
  roughness: 0.8
4975
- }), p = Hc.Sphere, g = Ur.createPrimitive(p, { material: f });
4975
+ }), p = Hc.Sphere, g = zr.createPrimitive(p, { material: f });
4976
4976
  g.position.x = F.random(-50, 50), g.position.y = F.random(-2, 50), g.position.z = F.random(-50, 50), g.rotation.x = F.random(0, Math.PI * 2), g.rotation.y = F.random(0, Math.PI * 2), g.rotation.z = F.random(0, Math.PI * 2), g.scale.multiplyScalar(0.5 + Math.random() * 10);
4977
4977
  const y = g.position.distanceTo(this._camera.position) - g.scale.x;
4978
4978
  y < 10 && (g.position.z += 5, g.position.multiplyScalar(1 + 1 / y)), this._roomFlyObjects.push(g), this._scene.add(g);
@@ -5496,8 +5496,8 @@ class K {
5496
5496
  */
5497
5497
  getUserOffsetInRig() {
5498
5498
  const e = this.context.mainCamera?.position;
5499
- if (!e || !this.rig) return z(0, 0, 0);
5500
- const t = z(e);
5499
+ if (!e || !this.rig) return U(0, 0, 0);
5500
+ const t = U(e);
5501
5501
  return t.x *= -1, t.z *= -1, t.applyQuaternion(_i(this.rig.gameObject.quaternion)), t;
5502
5502
  }
5503
5503
  updateActiveXRRig() {
@@ -5550,7 +5550,7 @@ class K {
5550
5550
  convertHitTestResult(e) {
5551
5551
  const t = this.context.renderer.xr.getReferenceSpace(), i = t && e.getPose(t);
5552
5552
  if (i) {
5553
- const n = z(i.transform.position), o = _i(i.transform.orientation), r = this.context.mainCamera;
5553
+ const n = U(i.transform.position), o = _i(i.transform.orientation), r = this.context.mainCamera;
5554
5554
  if (r?.parent !== this._cameraRenderParent && n.applyMatrix4(ka), r?.parent) {
5555
5555
  n.applyMatrix4(r.parent.matrixWorld), o.multiply($i);
5556
5556
  const a = ve(r.parent);
@@ -5562,7 +5562,7 @@ class K {
5562
5562
  }
5563
5563
  /** convert a XRRigidTransform from XR session space to threejs / Needle Engine XR space */
5564
5564
  convertSpace(e) {
5565
- const t = z(e.position);
5565
+ const t = U(e.position);
5566
5566
  t.applyMatrix4(ka);
5567
5567
  const i = _i(e.orientation);
5568
5568
  return i.premultiply($i), { position: t, quaternion: i };
@@ -5586,7 +5586,7 @@ class K {
5586
5586
  */
5587
5587
  _mainCamera = null;
5588
5588
  constructor(e, t, i, n) {
5589
- ak(e, n.init), this.session = t, this.mode = e, this.context = i, (He || x("console")) && hc(!0), this._xr_scripts = [...n.scripts], this._xr_update_scripts = this._xr_scripts.filter((o) => typeof o.onUpdateXR == "function"), this._controllerAdded = n.controller_added, this._controllerRemoved = n.controller_removed, Bs(this.onBefore, Ce.LateUpdate), this.context.pre_render_callbacks.push(this.onBeforeRender), this.context.post_render_callbacks.push(this.onAfterRender), (n.init.optionalFeatures?.includes("hit-test") || n.init.requiredFeatures?.includes("hit-test")) && t.requestReferenceSpace("viewer").then((o) => t.requestHitTestSource?.call(t, { space: o })?.then((r) => this._viewerHitTestSource = r).catch((r) => console.error(r))).catch((o) => console.error(o)), this.context.mainCamera && (this._originalCameraWorldPosition = te(this.context.mainCamera, new _()), this._originalCameraWorldRotation = ve(this.context.mainCamera, new V()), this._originalCameraWorldScale = qe(this.context.mainCamera, new _()), this._originalCameraParent = this.context.mainCamera.parent, this.context.mainCamera instanceof de && (this.context.mainCamera[Ih] = this.context.mainCamera.fov)), this._defaultRig = new LP(), this.context.scene.add(this._defaultRig.gameObject), this.addRig(this._defaultRig);
5589
+ ak(e, n.init), this.session = t, this.mode = e, this.context = i, (He || x("console")) && hc(!0), this._xr_scripts = [...n.scripts], this._xr_update_scripts = this._xr_scripts.filter((o) => typeof o.onUpdateXR == "function"), this._controllerAdded = n.controller_added, this._controllerRemoved = n.controller_removed, Bs(this.onBefore, Ce.LateUpdate), this.context.pre_render_callbacks.push(this.onBeforeRender), this.context.post_render_callbacks.push(this.onAfterRender), (n.init.optionalFeatures?.includes("hit-test") || n.init.requiredFeatures?.includes("hit-test")) && t.requestReferenceSpace("viewer").then((o) => t.requestHitTestSource?.call(t, { space: o })?.then((r) => this._viewerHitTestSource = r).catch((r) => console.error(r))).catch((o) => console.error(o)), this.context.mainCamera && (this._originalCameraWorldPosition = te(this.context.mainCamera, new _()), this._originalCameraWorldRotation = ve(this.context.mainCamera, new V()), this._originalCameraWorldScale = Xe(this.context.mainCamera, new _()), this._originalCameraParent = this.context.mainCamera.parent, this.context.mainCamera instanceof de && (this.context.mainCamera[Ih] = this.context.mainCamera.fov)), this._defaultRig = new LP(), this.context.scene.add(this._defaultRig.gameObject), this.addRig(this._defaultRig);
5590
5590
  for (let o = 0; o < t.inputSources.length; o++) {
5591
5591
  const r = t.inputSources[o];
5592
5592
  if (!r.handedness) {
@@ -5719,11 +5719,11 @@ class K {
5719
5719
  if (this._didStart = !0, this.mode === "immersive-vr") {
5720
5720
  const o = tn(this.context.scene.children);
5721
5721
  if (o) {
5722
- const r = o.getSize(z());
5722
+ const r = o.getSize(U());
5723
5723
  if (r.length() > 0) {
5724
5724
  const a = this._defaultRig.gameObject;
5725
5725
  a.position.set(o.min.x + r.x * 0.5, o.min.y, o.max.z + r.z * 0.5 + 1.5);
5726
- const l = o.getCenter(z());
5726
+ const l = o.getCenter(U());
5727
5727
  l.y = a.position.y, a.lookAt(l);
5728
5728
  }
5729
5729
  }
@@ -5803,7 +5803,7 @@ class K {
5803
5803
  for (const o of this.controllers)
5804
5804
  n += `
5805
5805
  ${o.hand ? "hand" : "ctrl"} ${o.inputSource.handedness}[${o.index}] con:${o.connected} tr:${o.isTracking} hts:${o.hasHitTestSource ? "yes" : "no"}`;
5806
- Wf = 0, U.DrawLabel(e, n, void 0, 1 / 60 * 20);
5806
+ Wf = 0, z.DrawLabel(e, n, void 0, 1 / 60 * 20);
5807
5807
  }
5808
5808
  }
5809
5809
  onBeforeRender = () => {
@@ -5905,7 +5905,7 @@ ${o.hand ? "hand" : "ctrl"} ${o.inputSource.handedness}[${o.index}] con:${o.conn
5905
5905
  let e = 0.02;
5906
5906
  const t = 1e-3;
5907
5907
  if (this.rig) {
5908
- const i = qe(this.rig.gameObject);
5908
+ const i = Xe(this.rig.gameObject);
5909
5909
  e *= i.x;
5910
5910
  }
5911
5911
  this._camera instanceof de && Math.abs(this._camera.near - e) > t && (this.isAR ? this.originalCameraNearPlane = this._camera.near : this._camera.near = e, He && console.debug(`Setting camera near plane to ${e} (was ${this.originalCameraNearPlane}) to account for XR rendering scale`));
@@ -6028,7 +6028,7 @@ class ae extends re {
6028
6028
  }
6029
6029
  }
6030
6030
  const It = new _(), E_ = new _(), R_ = new V(), uk = x("debuggizmos"), an = 8947848, Gf = 32;
6031
- class U {
6031
+ class z {
6032
6032
  constructor() {
6033
6033
  }
6034
6034
  /**
@@ -6059,7 +6059,7 @@ class U {
6059
6059
  * @returns a handle to the label that can be used to update the text
6060
6060
  */
6061
6061
  static DrawLabel(e, t, i = 0.05, n = 0, o, r, a) {
6062
- if (!U.enabled) return null;
6062
+ if (!z.enabled) return null;
6063
6063
  o || (o = an);
6064
6064
  const l = K.active?.rigScale ?? 1, c = ji.getTextLabel(n, t, i * l, o, r);
6065
6065
  return a instanceof M && a.add(c), c.position.x = e.x, c.position.y = e.y, c.position.z = e.z, c;
@@ -6073,7 +6073,7 @@ class U {
6073
6073
  * @param depthTest if true the ray will be rendered with depth test
6074
6074
  */
6075
6075
  static DrawRay(e, t, i = an, n = 0, o = !0) {
6076
- if (!U.enabled) return;
6076
+ if (!z.enabled) return;
6077
6077
  const r = ji.getLine(n), a = r.geometry.getAttribute("position");
6078
6078
  a.setXYZ(0, e.x, e.y, e.z), It.set(t.x, t.y, t.z).multiplyScalar(999999999), a.setXYZ(1, e.x + It.x, e.y + It.y, e.z + It.z), a.needsUpdate = !0, r.material.depthTest = o, r.material.depthWrite = !1, r.material.fog = !1, dn(r.material, i);
6079
6079
  }
@@ -6087,7 +6087,7 @@ class U {
6087
6087
  * @param lengthFactor the length of the line. Default is 1
6088
6088
  */
6089
6089
  static DrawDirection(e, t, i = an, n = 0, o = !0, r = 1) {
6090
- if (!U.enabled) return;
6090
+ if (!z.enabled) return;
6091
6091
  const a = ji.getLine(n), l = a.geometry.getAttribute("position");
6092
6092
  l.setXYZ(0, e.x, e.y, e.z), t.w !== void 0 ? (It.set(0, 0, -r), R_.set(t.x, t.y, t.z, t.w), It.applyQuaternion(R_)) : (It.set(t.x, t.y, t.z), It.multiplyScalar(r)), l.setXYZ(1, e.x + It.x, e.y + It.y, e.z + It.z), l.needsUpdate = !0, a.material.depthTest = o, a.material.depthWrite = !1, dn(a.material, i);
6093
6093
  }
@@ -6100,7 +6100,7 @@ class U {
6100
6100
  * @param depthTest if true the line will be rendered with depth test
6101
6101
  */
6102
6102
  static DrawLine(e, t, i = an, n = 0, o = !0) {
6103
- if (!U.enabled) return;
6103
+ if (!z.enabled) return;
6104
6104
  const r = ji.getLine(n), a = r.geometry.getAttribute("position");
6105
6105
  a.setXYZ(0, e.x, e.y, e.z), a.setXYZ(1, t.x, t.y, t.z), a.needsUpdate = !0, r.material.depthTest = o, r.material.depthWrite = !1, r.material.fog = !1, dn(r.material, i);
6106
6106
  }
@@ -6114,7 +6114,7 @@ class U {
6114
6114
  * @param depthTest if true the circle will be rendered with depth test
6115
6115
  */
6116
6116
  static DrawCircle(e, t, i, n = an, o = 0, r = !0) {
6117
- if (!U.enabled) return;
6117
+ if (!z.enabled) return;
6118
6118
  const a = ji.getCircle(o);
6119
6119
  a.position.set(e.x, e.y, e.z), a.scale.set(i, i, i), a.quaternion.setFromUnitVectors(this._up, It.set(t.x, t.y, t.z).normalize()), a.material.depthTest = r, a.material.depthWrite = !1, a.material.fog = !1, dn(a.material, n);
6120
6120
  }
@@ -6127,7 +6127,7 @@ class U {
6127
6127
  * @param depthTest if true the sphere will be rendered with depth test
6128
6128
  */
6129
6129
  static DrawWireSphere(e, t, i = an, n = 0, o = !0) {
6130
- if (!U.enabled) return;
6130
+ if (!z.enabled) return;
6131
6131
  const r = ji.getSphere(t, n, !0);
6132
6132
  Wa(r, e.x, e.y, e.z), r.material.depthTest = o, r.material.depthWrite = !1, r.material.fog = !1, dn(r.material, i);
6133
6133
  }
@@ -6140,7 +6140,7 @@ class U {
6140
6140
  * @param depthTest if true the sphere will be rendered with depth test
6141
6141
  */
6142
6142
  static DrawSphere(e, t, i = an, n = 0, o = !0) {
6143
- if (!U.enabled) return;
6143
+ if (!z.enabled) return;
6144
6144
  const r = ji.getSphere(t, n, !1);
6145
6145
  Wa(r, e.x, e.y, e.z), r.material.depthTest = o, r.material.depthWrite = !1, dn(r.material, i);
6146
6146
  }
@@ -6154,7 +6154,7 @@ class U {
6154
6154
  * @param depthTest if true the box will be rendered with depth test
6155
6155
  */
6156
6156
  static DrawWireBox(e, t, i = an, n = 0, o = !0, r = void 0) {
6157
- if (!U.enabled) return;
6157
+ if (!z.enabled) return;
6158
6158
  const a = ji.getBox(n);
6159
6159
  a.position.set(e.x, e.y, e.z), a.scale.set(t.x, t.y, t.z), r ? a.quaternion.copy(r) : a.quaternion.identity(), a.material.depthTest = o, a.material.wireframe = !0, a.material.depthWrite = !1, a.material.fog = !1, dn(a.material, i);
6160
6160
  }
@@ -6166,7 +6166,7 @@ class U {
6166
6166
  * @param depthTest if true the box will be rendered with depth test. Default: true
6167
6167
  */
6168
6168
  static DrawWireBox3(e, t = an, i = 0, n = !0) {
6169
- if (!U.enabled) return;
6169
+ if (!z.enabled) return;
6170
6170
  const o = ji.getBox(i);
6171
6171
  o.position.copy(e.getCenter(It)), o.scale.copy(e.getSize(It)), o.material.depthTest = n, o.material.wireframe = !0, o.material.depthWrite = !1, o.material.fog = !1, dn(o.material, t);
6172
6172
  }
@@ -6181,7 +6181,7 @@ class U {
6181
6181
  * @param wireframe if true the arrow will be rendered as wireframe
6182
6182
  */
6183
6183
  static DrawArrow(e, t, i = an, n = 0, o = !0, r = !1) {
6184
- if (!U.enabled) return;
6184
+ if (!z.enabled) return;
6185
6185
  const a = ji.getArrowHead(n);
6186
6186
  a.position.set(t.x, t.y, t.z), a.quaternion.setFromUnitVectors(this._up.set(0, 1, 0), It.set(t.x, t.y, t.z).sub(E_.set(e.x, e.y, e.z)).normalize());
6187
6187
  const c = It.set(t.x, t.y, t.z).sub(E_.set(e.x, e.y, e.z)).length() * 0.1;
@@ -6277,7 +6277,7 @@ class ji {
6277
6277
  static getLine(e) {
6278
6278
  let t = this.linesCache.pop();
6279
6279
  if (!t) {
6280
- t = new Ua();
6280
+ t = new za();
6281
6281
  let i = t.geometry.getAttribute("position");
6282
6282
  i || (i = new mt(new Float32Array(6), 3), t.geometry.setAttribute("position", i));
6283
6283
  }
@@ -6286,13 +6286,13 @@ class ji {
6286
6286
  static getCircle(e) {
6287
6287
  let t = this.circlesCache.pop();
6288
6288
  if (!t) {
6289
- t = new Ua();
6289
+ t = new za();
6290
6290
  let i = t.geometry.getAttribute("position");
6291
6291
  if (!i) {
6292
6292
  i = new mt(new Float32Array(Gf * 3), 3), t.geometry.setAttribute("position", i);
6293
- const n = z(0, 1, 0), o = z(0, 0, 1), r = z(o);
6293
+ const n = U(0, 1, 0), o = U(0, 0, 1), r = U(o);
6294
6294
  r.cross(n).normalize();
6295
- const a = z(r), l = Math.PI * 2 / (Gf - 1);
6295
+ const a = U(r), l = Math.PI * 2 / (Gf - 1);
6296
6296
  for (let c = 0; c < Gf + 1; c++) {
6297
6297
  const h = l * c;
6298
6298
  n.copy(a).multiplyScalar(Math.cos(h) * 1), r.copy(o).multiplyScalar(Math.sin(h) * 1);
@@ -6380,7 +6380,7 @@ class ji {
6380
6380
  }
6381
6381
  }
6382
6382
  const Yt = x("debugphysics"), pk = x("debugworker"), T_ = new Co();
6383
- class zr {
6383
+ class Ur {
6384
6384
  static AllLayers = 4294967295;
6385
6385
  ray;
6386
6386
  cam;
@@ -6446,7 +6446,7 @@ class Ic {
6446
6446
  }
6447
6447
  // raycasting
6448
6448
  raycaster = new pu();
6449
- defaultRaycastOptions = new zr();
6449
+ defaultRaycastOptions = new Ur();
6450
6450
  targetBuffer = new Array(1);
6451
6451
  defaultThresholds = {
6452
6452
  Mesh: {},
@@ -6507,7 +6507,7 @@ class Ic {
6507
6507
  }
6508
6508
  intersect(e, t, i, n) {
6509
6509
  for (const o of t) {
6510
- if (!o || o.visible === !1 || U.isGizmo(o) || n.lineThreshold !== void 0 && n.lineThreshold < 0 && o instanceof Ua)
6510
+ if (!o || o.visible === !1 || z.isGizmo(o) || n.lineThreshold !== void 0 && n.lineThreshold < 0 && o instanceof za)
6511
6511
  continue;
6512
6512
  let r = !0;
6513
6513
  const a = o, l = a.geometry;
@@ -6524,9 +6524,9 @@ class Ic {
6524
6524
  const f = Cv(o);
6525
6525
  f && (a.geometry = f);
6526
6526
  }
6527
- if (!d && gk(a, e, i) || (n.useAcceleratedRaycast !== !1 ? Ud.runMeshBVHRaycast(e, a, i, this.context, n) : e.intersectObject(a, !1, i)), a.geometry = l, Yt && i.length != c) {
6527
+ if (!d && gk(a, e, i) || (n.useAcceleratedRaycast !== !1 ? zd.runMeshBVHRaycast(e, a, i, this.context, n) : e.intersectObject(a, !1, i)), a.geometry = l, Yt && i.length != c) {
6528
6528
  const f = i[i.length - 1];
6529
- U.DrawWireSphere(f.point, 0.1, 7798784, 1, !1), U.DrawWireMesh({ mesh: o, depthTest: !1, duration: 0.2, color: 7798784 });
6529
+ z.DrawWireSphere(f.point, 0.1, 7798784, 1, !1), z.DrawWireMesh({ mesh: o, depthTest: !1, duration: 0.2, color: 7798784 });
6530
6530
  }
6531
6531
  }
6532
6532
  n.recursive !== !1 && this.intersect(e, o.children, i, n);
@@ -6535,8 +6535,8 @@ class Ic {
6535
6535
  }
6536
6536
  tempBoundingBox = new Ci();
6537
6537
  intersectSphere(e, t, i, n, o, r, a, l) {
6538
- let c = e && e.isMesh && e.layers.test(n) && !U.isGizmo(e);
6539
- c &&= e.visible, c &&= !(e instanceof Ua), c &&= !(e instanceof $a);
6538
+ let c = e && e.isMesh && e.layers.test(n) && !z.isGizmo(e);
6539
+ c &&= e.visible, c &&= !(e instanceof za), c &&= !(e instanceof $a);
6540
6540
  const h = e, d = h.geometry;
6541
6541
  if (c && l) {
6542
6542
  const f = l(e);
@@ -6549,7 +6549,7 @@ class Ic {
6549
6549
  const f = this.sphere;
6550
6550
  f.center.copy(t), f.radius = i;
6551
6551
  const p = o.length;
6552
- if (Ud.runMeshBVHRaycast(this.sphere, h, o, this.context, {}), p != o.length && !r)
6552
+ if (zd.runMeshBVHRaycast(this.sphere, h, o, this.context, {}), p != o.length && !r)
6553
6553
  return;
6554
6554
  } else if (d.boundingBox || d.computeBoundingBox(), d.boundingBox) {
6555
6555
  h.matrixWorldNeedsUpdate && h.updateWorldMatrix(!1, !1);
@@ -6580,19 +6580,19 @@ function gk(s, e, t) {
6580
6580
  const l = this, c = l.geometry.boundingSphere;
6581
6581
  if (c) {
6582
6582
  if (l instanceof $a) {
6583
- Lh.setFromNormalAndCoplanarPoint(z(0, 1, 0), z(0, -l.position.y, 0)), Lh.applyMatrix4(l.matrixWorld, mk);
6584
- const d = o.ray.intersectPlane(Lh, z());
6583
+ Lh.setFromNormalAndCoplanarPoint(U(0, 1, 0), U(0, -l.position.y, 0)), Lh.applyMatrix4(l.matrixWorld, mk);
6584
+ const d = o.ray.intersectPlane(Lh, U());
6585
6585
  if (d) {
6586
6586
  tr.copy(c), tr.applyMatrix4(l.matrixWorld);
6587
- const p = z(d).sub(o.ray.origin).length(), g = tr.radius * 0.5;
6587
+ const p = U(d).sub(o.ray.origin).length(), g = tr.radius * 0.5;
6588
6588
  p < g && r.push({ distance: p, point: d, object: l, normal: Lh.normal.clone() });
6589
6589
  }
6590
6590
  return;
6591
6591
  }
6592
6592
  tr.copy(c), tr.applyMatrix4(l.matrixWorld);
6593
- const h = o.ray.intersectSphere(tr, z());
6593
+ const h = o.ray.intersectSphere(tr, U());
6594
6594
  if (h) {
6595
- const d = z(h).sub(o.ray.origin), f = d.length();
6595
+ const d = U(h).sub(o.ray.origin), f = d.length();
6596
6596
  if (f > tr.radius) {
6597
6597
  const p = d.clone().normalize();
6598
6598
  r.push({ distance: f, point: h, object: l, normal: p });
@@ -6601,7 +6601,7 @@ function gk(s, e, t) {
6601
6601
  }
6602
6602
  }), s._computeIntersections = n, e.intersectObject(s, !1, t), s._computeIntersections = i, !0;
6603
6603
  }
6604
- var Ud;
6604
+ var zd;
6605
6605
  ((s) => {
6606
6606
  let e = 0;
6607
6607
  function t(b, v, T, k, E) {
@@ -6694,7 +6694,7 @@ var Ud;
6694
6694
  d = !1;
6695
6695
  });
6696
6696
  }
6697
- })(Ud || (Ud = {}));
6697
+ })(zd || (zd = {}));
6698
6698
  const I_ = /* @__PURE__ */ Symbol("gltf-loader-internal-usage-tracker"), yk = x("debugusers");
6699
6699
  class Ma {
6700
6700
  get name() {
@@ -6759,7 +6759,7 @@ function m0() {
6759
6759
  }
6760
6760
  let Nr = !0;
6761
6761
  ku === 0 && (Nr = !1);
6762
- function zD(s) {
6762
+ function UD(s) {
6763
6763
  Nr = s;
6764
6764
  }
6765
6765
  function bk() {
@@ -6833,7 +6833,7 @@ function WD(s) {
6833
6833
  const vr = x("debugresourceusers") || x("debugmemory"), Lc = /* @__PURE__ */ Symbol("needle-resource-users"), Yl = /* @__PURE__ */ Symbol("needle-resource-users-count");
6834
6834
  function Ht(s, e) {
6835
6835
  ug(s, e, function(t, i) {
6836
- Nr && !Ic.raycasting && (zd(Lc, this, t, !1), zd(Lc, this, i, !0));
6836
+ Nr && !Ic.raycasting && (Ud(Lc, this, t, !1), Ud(Lc, this, i, !0));
6837
6837
  });
6838
6838
  }
6839
6839
  Nr && (Ht(H.prototype, "material"), Ht(H.prototype, "geometry"), Ht(be.prototype, "map"), Ht(be.prototype, "bumpMap"), Ht(be.prototype, "alphaMap"), Ht(be.prototype, "normalMap"), Ht(be.prototype, "displacementMap"), Ht(be.prototype, "roughnessMap"), Ht(be.prototype, "metalnessMap"), Ht(be.prototype, "emissiveMap"), Ht(be.prototype, "specularMap"), Ht(be.prototype, "envMap"), Ht(be.prototype, "lightMap"), Ht(be.prototype, "aoMap"), Ht(be.prototype, "gradientMap"));
@@ -6842,17 +6842,17 @@ function xk(s) {
6842
6842
  const e = s[Lc];
6843
6843
  if (e)
6844
6844
  for (const t of e)
6845
- zd(Lc, t, s, !1);
6845
+ Ud(Lc, t, s, !1);
6846
6846
  }
6847
6847
  Nr && ug(be.prototype, "dispose", function() {
6848
6848
  xk(this);
6849
6849
  });
6850
6850
  let tm = 0;
6851
- function zd(s, e, t, i) {
6851
+ function Ud(s, e, t, i) {
6852
6852
  if (tm > 0) return;
6853
6853
  if (Array.isArray(t)) {
6854
6854
  for (const o of t)
6855
- zd(s, e, o, i);
6855
+ Ud(s, e, o, i);
6856
6856
  return;
6857
6857
  }
6858
6858
  if (!t) return;
@@ -7127,7 +7127,7 @@ pe.registerCallback(ue.ContextCreated, (s) => {
7127
7127
  Lk(e), Tk(e);
7128
7128
  });
7129
7129
  const Wd = x("debugcomponents"), B_ = "eff8ba80-635d-11ec-90d6-0242ac120003";
7130
- class Ut {
7130
+ class zt {
7131
7131
  get seed() {
7132
7132
  return this._seed;
7133
7133
  }
@@ -7137,7 +7137,7 @@ class Ut {
7137
7137
  _originalSeed;
7138
7138
  _seed;
7139
7139
  constructor(e) {
7140
- typeof e == "string" && (e = Ut.hash(e)), this._originalSeed = e, this._seed = e;
7140
+ typeof e == "string" && (e = zt.hash(e)), this._originalSeed = e, this._seed = e;
7141
7141
  }
7142
7142
  reset() {
7143
7143
  this._seed = this._originalSeed;
@@ -7149,10 +7149,10 @@ class Ut {
7149
7149
  return this._seed -= 1, Hy(t.toString(), B_);
7150
7150
  }
7151
7151
  initialize(e) {
7152
- typeof e == "string" ? this._seed = Ut.hash(e) : this._seed = e;
7152
+ typeof e == "string" ? this._seed = zt.hash(e) : this._seed = e;
7153
7153
  }
7154
7154
  static createFromString(e) {
7155
- return new Ut(this.hash(e));
7155
+ return new zt(this.hash(e));
7156
7156
  }
7157
7157
  static hash(e) {
7158
7158
  let t = 0;
@@ -7261,7 +7261,7 @@ function Lk(s) {
7261
7261
  return;
7262
7262
  }
7263
7263
  const i = new Jn();
7264
- e.position && (i.position = new _(e.position.x, e.position.y, e.position.z)), e.rotation && (i.rotation = new V(e.rotation.x, e.rotation.y, e.rotation.z, e.rotation.w)), e.scale && (i.scale = new _(e.scale.x, e.scale.y, e.scale.z)), i.parent = e.parent, e.seed && (i.idProvider = new Ut(e.seed)), i.visible = e.visible, i.context = s, Wd && s.alias && console.log("[Remote] instantiate in: " + s.alias);
7264
+ e.position && (i.position = new _(e.position.x, e.position.y, e.position.z)), e.rotation && (i.rotation = new V(e.rotation.x, e.rotation.y, e.rotation.z, e.rotation.w)), e.scale && (i.scale = new _(e.scale.x, e.scale.y, e.scale.z)), i.parent = e.parent, e.seed && (i.idProvider = new zt(e.seed)), i.visible = e.visible, i.context = s, Wd && s.alias && console.log("[Remote] instantiate in: " + s.alias);
7265
7265
  const n = Er(t, i);
7266
7266
  da.push(new WeakRef(n)), n && (e.parent === "scene" && s.scene.add(n), Wd && console.log("[Remote] new instance", "gameobject:", n?.guid, t));
7267
7267
  }), s.connection.beginListen("left-room", () => {
@@ -7275,7 +7275,7 @@ function Lk(s) {
7275
7275
  }
7276
7276
  function Dk(s, e) {
7277
7277
  const t = Ik(), i = e ?? new Jn();
7278
- i.idProvider = new Ut(t);
7278
+ i.idProvider = new zt(t);
7279
7279
  const n = Er(s, i);
7280
7280
  return { seed: t, instance: n };
7281
7281
  }
@@ -7331,9 +7331,9 @@ class Fk {
7331
7331
  return this._reverseTypes.get(e) || null;
7332
7332
  }
7333
7333
  }
7334
- const Uk = /* @__PURE__ */ Symbol("BuiltInType"), P = new Fk(), M0 = function(s) {
7334
+ const zk = /* @__PURE__ */ Symbol("BuiltInType"), P = new Fk(), M0 = function(s) {
7335
7335
  P.get(s.name) || P.add(s.name, s);
7336
- }, wg = x("debugresolvedependencies"), zk = ["/extensions/", "extensions/"], Nk = [
7336
+ }, wg = x("debugresolvedependencies"), Uk = ["/extensions/", "extensions/"], Nk = [
7337
7337
  { prefix: "/nodes/", dependencyName: "node" },
7338
7338
  { prefix: "/meshes/", dependencyName: "mesh" },
7339
7339
  { prefix: "/materials/", dependencyName: "material" },
@@ -7368,7 +7368,7 @@ function rm(s, e, t, i) {
7368
7368
  if (r != null)
7369
7369
  typeof r.then == "function" ? i.push(r.then((a) => t[n] = a)) : t[n] = r;
7370
7370
  else {
7371
- const a = U_(s, e, o);
7371
+ const a = z_(s, e, o);
7372
7372
  if (a) {
7373
7373
  i.push(a.then((l) => (t[n] = l, l)));
7374
7374
  continue;
@@ -7393,13 +7393,13 @@ function rm(s, e, t, i) {
7393
7393
  else typeof o == "object" && rm(s, e, o, i);
7394
7394
  }
7395
7395
  else if (typeof t == "string") {
7396
- const n = U_(s, e, t);
7396
+ const n = z_(s, e, t);
7397
7397
  n && i.push(n);
7398
7398
  }
7399
7399
  }
7400
7400
  function F_(s, e) {
7401
7401
  if (s && s.plugins && typeof e == "string") {
7402
- for (const t of zk)
7402
+ for (const t of Uk)
7403
7403
  if (e.startsWith(t)) {
7404
7404
  let i = e.substring(t.length);
7405
7405
  const n = i.indexOf("/");
@@ -7414,7 +7414,7 @@ function F_(s, e) {
7414
7414
  }
7415
7415
  return null;
7416
7416
  }
7417
- function U_(s, e, t) {
7417
+ function z_(s, e, t) {
7418
7418
  for (const i of s) {
7419
7419
  const n = E0(i.prefix, t);
7420
7420
  if (n >= 0)
@@ -7638,7 +7638,7 @@ function am(s, e, t) {
7638
7638
  }
7639
7639
  const Qk = x("noerrors");
7640
7640
  function Yk(s, e, t) {
7641
- if (Qk || !e || !Xi() || !s || s.constructor && s.constructor[Uk] === !0) return;
7641
+ if (Qk || !e || !Xi() || !s || s.constructor && s.constructor[zk] === !0) return;
7642
7642
  const i = s.constructor?.name, n = Object.getOwnPropertyNames(e);
7643
7643
  for (const o of n) {
7644
7644
  if (o === "sourceId") continue;
@@ -7700,7 +7700,7 @@ function Kk(s, e) {
7700
7700
  continue;
7701
7701
  }
7702
7702
  for (const o of Object.keys(i))
7703
- if (n[o] === void 0 && z_(i[o]) && !z_(n)) {
7703
+ if (n[o] === void 0 && U_(i[o]) && !U_(n)) {
7704
7704
  const a = Zk(n, o);
7705
7705
  if (a && (a?.writable === void 0 || a?.writable === !1) && a.set === void 0) {
7706
7706
  Fn && console.warn('Property is not writable "' + o + '"', n, a, i[o], n[o]);
@@ -7718,7 +7718,7 @@ function Zk(s, e) {
7718
7718
  s = Object.getPrototypeOf(s);
7719
7719
  }
7720
7720
  }
7721
- function z_(s) {
7721
+ function U_(s) {
7722
7722
  switch (typeof s) {
7723
7723
  case "number":
7724
7724
  case "string":
@@ -7905,7 +7905,7 @@ function Mu(s, e, t) {
7905
7905
  const i = tl(s, e);
7906
7906
  return i || Hn(s, e, t);
7907
7907
  }
7908
- const D0 = new Ut("addComponentIdProvider");
7908
+ const D0 = new zt("addComponentIdProvider");
7909
7909
  function Ra(s, e, t = !0) {
7910
7910
  s.userData || (s.userData = {}), s.userData.components || (s.userData.components = []), s.userData.components.push(e), e.gameObject = s, (e.guid === void 0 || e.guid === "invalid") && (e.guid = D0.generateUUID()), Cg(s), Eg(e, e.context);
7911
7911
  try {
@@ -8114,12 +8114,12 @@ Object.getOwnPropertyDescriptor(M.prototype, "worldRotation") || Object.definePr
8114
8114
  return hg(this);
8115
8115
  },
8116
8116
  set: function(s) {
8117
- U1(this, s);
8117
+ z1(this, s);
8118
8118
  }
8119
8119
  });
8120
8120
  Object.getOwnPropertyDescriptor(M.prototype, "worldScale") || Object.defineProperty(M.prototype, "worldScale", {
8121
8121
  get: function() {
8122
- return qe(this);
8122
+ return Xe(this);
8123
8123
  },
8124
8124
  set: function(s) {
8125
8125
  Ec(this, s);
@@ -8128,7 +8128,7 @@ Object.getOwnPropertyDescriptor(M.prototype, "worldScale") || Object.definePrope
8128
8128
  const hO = new ee(), dO = new _(0, 0, 0), uO = new _(0, 1, 0);
8129
8129
  Object.getOwnPropertyDescriptor(M.prototype, "worldForward") || Object.defineProperty(M.prototype, "worldForward", {
8130
8130
  get: function() {
8131
- return z().set(0, 0, 1).applyQuaternion(ve(this));
8131
+ return U().set(0, 0, 1).applyQuaternion(ve(this));
8132
8132
  },
8133
8133
  set: function(s) {
8134
8134
  const e = _i().setFromRotationMatrix(hO.lookAt(dO.set(0, 0, 0), s, uO.set(0, 1, 0)));
@@ -8137,12 +8137,12 @@ Object.getOwnPropertyDescriptor(M.prototype, "worldForward") || Object.definePro
8137
8137
  });
8138
8138
  Object.getOwnPropertyDescriptor(M.prototype, "worldRight") || Object.defineProperty(M.prototype, "worldRight", {
8139
8139
  get: function() {
8140
- return z().set(1, 0, 0).applyQuaternion(ve(this));
8140
+ return U().set(1, 0, 0).applyQuaternion(ve(this));
8141
8141
  }
8142
8142
  });
8143
8143
  Object.getOwnPropertyDescriptor(M.prototype, "worldUp") || Object.defineProperty(M.prototype, "worldUp", {
8144
8144
  get: function() {
8145
- return z().set(0, 1, 0).applyQuaternion(ve(this));
8145
+ return U().set(0, 1, 0).applyQuaternion(ve(this));
8146
8146
  }
8147
8147
  });
8148
8148
  Object.getOwnPropertyDescriptor(M.prototype, "contains") || Object.defineProperty(M.prototype, "contains", {
@@ -8241,7 +8241,7 @@ function dm(s, e = !0, t = !0) {
8241
8241
  t && n.removeFromParent();
8242
8242
  }
8243
8243
  function Ya(s, e, t = !0) {
8244
- return U0(s, e, t);
8244
+ return z0(s, e, t);
8245
8245
  }
8246
8246
  function* kg(s, e, t = !1, i = 999, n = 0) {
8247
8247
  if (s?.userData.components && !(n > i)) {
@@ -8252,7 +8252,7 @@ function* kg(s, e, t = !1, i = 999, n = 0) {
8252
8252
  yield* kg(o, e, !0, i, n + 1);
8253
8253
  }
8254
8254
  }
8255
- function U0(s, e, t, i = 0) {
8255
+ function z0(s, e, t, i = 0) {
8256
8256
  if (s) {
8257
8257
  if (s.isObject3D, i > 1e3) {
8258
8258
  console.warn("Failed to iterate components: too many levels");
@@ -8271,7 +8271,7 @@ function U0(s, e, t, i = 0) {
8271
8271
  for (let o = 0; o < s.children.length; o++) {
8272
8272
  const r = s.children[o];
8273
8273
  if (!r) continue;
8274
- const a = U0(r, e, t, n);
8274
+ const a = z0(r, e, t, n);
8275
8275
  if (a !== void 0) return a;
8276
8276
  }
8277
8277
  }
@@ -8283,8 +8283,8 @@ function Er(s, e) {
8283
8283
  let t = null;
8284
8284
  e != null && (e.x !== void 0 ? (t = new Jn(), t.position = e) : t = e);
8285
8285
  let i = N.Current;
8286
- t?.context && (i = t.context), fd && i.alias && console.log("context", i.alias), t && !t.idProvider && (t.idProvider = new Ut(Date.now()));
8287
- const n = [], o = {}, r = {}, a = z0(i, s, t, n, o, r);
8286
+ t?.context && (i = t.context), fd && i.alias && console.log("context", i.alias), t && !t.idProvider && (t.idProvider = new zt(Date.now()));
8287
+ const n = [], o = {}, r = {}, a = U0(i, s, t, n, o, r);
8288
8288
  a && (_O(a, o), yO(r, o)), fd && (Xp(s, !0), Xp(a, !0));
8289
8289
  const l = {};
8290
8290
  if (t?.components !== !1) {
@@ -8300,7 +8300,7 @@ function Er(s, e) {
8300
8300
  }
8301
8301
  return a;
8302
8302
  }
8303
- function z0(s, e, t, i, n, o) {
8303
+ function U0(s, e, t, i, n, o) {
8304
8304
  if (!e || e[vi])
8305
8305
  return null;
8306
8306
  const r = e.userData;
@@ -8358,7 +8358,7 @@ function z0(s, e, t, i, n, o) {
8358
8358
  }
8359
8359
  t && (t.position = void 0, t.rotation = void 0, t.scale = void 0, t.parent = void 0, t.visible = void 0);
8360
8360
  for (const h in e.children) {
8361
- const d = e.children[h], f = z0(s, d, t, i, n, o);
8361
+ const d = e.children[h], f = U0(s, d, t, i, n, o);
8362
8362
  f && (n[f.uuid] = { original: d, clone: f }, l.add(f));
8363
8363
  }
8364
8364
  return l;
@@ -9014,8 +9014,8 @@ class Ls {
9014
9014
  continue;
9015
9015
  }
9016
9016
  for (const a in r.tracks) {
9017
- const l = r.tracks[a], c = za.parseTrackName(l.name);
9018
- let h = za.findNode(t, c.nodeName);
9017
+ const l = r.tracks[a], c = Ua.parseTrackName(l.name);
9018
+ let h = Ua.findNode(t, c.nodeName);
9019
9019
  if (!h) {
9020
9020
  const f = l.__objectName ?? l.name.substring(0, l.name.indexOf("."));
9021
9021
  if (h = t.getObjectByProperty("uuid", f), !h)
@@ -9106,7 +9106,7 @@ function* PO(s) {
9106
9106
  yield;
9107
9107
  }
9108
9108
  const H_ = "NEEDLE_lightmaps", ea = x("debuglightmapsextension") || x("debuglightmaps");
9109
- var Un = /* @__PURE__ */ ((s) => (s[s.Lightmap = 0] = "Lightmap", s[s.Skybox = 1] = "Skybox", s[s.Reflection = 2] = "Reflection", s))(Un || {});
9109
+ var zn = /* @__PURE__ */ ((s) => (s[s.Lightmap = 0] = "Lightmap", s[s.Skybox = 1] = "Skybox", s[s.Reflection = 2] = "Reflection", s))(zn || {});
9110
9110
  class kO {
9111
9111
  get name() {
9112
9112
  return H_;
@@ -9149,7 +9149,7 @@ class kO {
9149
9149
  }
9150
9150
  resolveTexture(e, t) {
9151
9151
  const i = t;
9152
- ea && console.log("Light Texture loaded:", i), i?.isTexture && (this.registry ? (i.colorSpace = Ts, this.registry.registerTexture(this.source, e.type, i, e.index)) : console.log(Un[e.type], e.pointer, i));
9152
+ ea && console.log("Light Texture loaded:", i), i?.isTexture && (this.registry ? (i.colorSpace = Ts, this.registry.registerTexture(this.source, e.type, i, e.index)) : console.log(zn[e.type], e.pointer, i));
9153
9153
  }
9154
9154
  }
9155
9155
  const ta = !!x("debuglightmaps");
@@ -9163,27 +9163,27 @@ class OO {
9163
9163
  this.context = e;
9164
9164
  }
9165
9165
  registerTexture(e, t, i, n) {
9166
- ta && console.log("Registering ", Un[t] + ' "' + e + '"', i), this.map.has(e) || this.map.set(e, /* @__PURE__ */ new Map());
9166
+ ta && console.log("Registering ", zn[t] + ' "' + e + '"', i), this.map.has(e) || this.map.set(e, /* @__PURE__ */ new Map());
9167
9167
  const o = this.map.get(e), r = o?.get(t) ?? [];
9168
9168
  r.length < n && (r.length = n + 1), vk(i, !1), r[n] = i, o?.set(t, r);
9169
9169
  }
9170
9170
  tryGetLightmap(e, t = 0) {
9171
- return this.tryGet(e, Un.Lightmap, t);
9171
+ return this.tryGet(e, zn.Lightmap, t);
9172
9172
  }
9173
9173
  tryGetSkybox(e) {
9174
- return ta && console.log("[Get Skybox]", e, this.map), this.tryGet(e, Un.Skybox, 0);
9174
+ return ta && console.log("[Get Skybox]", e, this.map), this.tryGet(e, zn.Skybox, 0);
9175
9175
  }
9176
9176
  tryGetReflection(e) {
9177
- return ta && console.log("[Get Reflection]", e, this.map), this.tryGet(e, Un.Reflection, 0);
9177
+ return ta && console.log("[Get Reflection]", e, this.map), this.tryGet(e, zn.Reflection, 0);
9178
9178
  }
9179
9179
  tryGet(e, t, i) {
9180
9180
  if (!e)
9181
9181
  return ta && console.warn("Missing source id"), null;
9182
9182
  const n = this.map.get(e);
9183
9183
  if (!n)
9184
- return ta && console.warn(`[Lighting] No ${Un[t]} texture entry for`, e), null;
9184
+ return ta && console.warn(`[Lighting] No ${zn[t]} texture entry for`, e), null;
9185
9185
  const o = n.get(t);
9186
- return o === void 0 ? (ta && console.warn(`[Lighting] No ${Un[t]} texture for`, e, "index", i), null) : !o?.length || o.length <= i ? null : o[i];
9186
+ return o === void 0 ? (ta && console.warn(`[Lighting] No ${zn[t]} texture for`, e, "index", i), null) : !o?.length || o.length <= i ? null : o[i];
9187
9187
  }
9188
9188
  }
9189
9189
  Zt.lights_fragment_maps = Zt.lights_fragment_maps.replace("vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );", `
@@ -9253,7 +9253,7 @@ class MO {
9253
9253
  }
9254
9254
  /** @internal */
9255
9255
  setRenderer(e) {
9256
- this._lodsManager?.disable(), Zo.removePlugin(this), Zo.addPlugin(this), Zo.debugDrawLine = U.DrawLine, this._lodsManager = Zo.get(e, { engine: "needle-engine" }), this.applySettings(), this._lodsManager.enable();
9256
+ this._lodsManager?.disable(), Zo.removePlugin(this), Zo.addPlugin(this), Zo.debugDrawLine = z.DrawLine, this._lodsManager = Zo.get(e, { engine: "needle-engine" }), this.applySettings(), this._lodsManager.enable();
9257
9257
  }
9258
9258
  disable() {
9259
9259
  this._lodsManager?.disable(), Zo.removePlugin(this);
@@ -9273,7 +9273,7 @@ class MO {
9273
9273
  jh.copy(a), jh.applyMatrix4(t.matrixWorld);
9274
9274
  const l = jh.center, c = jh.radius, h = ["#76c43e", "#bcc43e", "#c4ac3e", "#c4673e", "#ff3e3e"];
9275
9275
  if (r)
9276
- U.DrawWireSphere(l, c, h[o], 0.1);
9276
+ z.DrawWireSphere(l, c, h[o], 0.1);
9277
9277
  else {
9278
9278
  const d = t.geometry.index?.count ?? 0, f = We.getMeshLODExtension(t.geometry)?.lods;
9279
9279
  o = f ? Math.min(f?.length - 1, o) : 0;
@@ -9292,8 +9292,8 @@ TEX ` + i.texture_lod;
9292
9292
  ` + (n.lastScreenCoverage * 100).toFixed(1) + `% cov
9293
9293
  ` + (n.lastCentrality * 100).toFixed(1) + `% centr
9294
9294
  ` + (Dh.min.x.toFixed(2) + "-" + Dh.max.x.toFixed(2) + "x" + Dh.min.y.toFixed(2) + "-" + Dh.max.y.toFixed(2)) + " scr"), n.lastScreenCoverage > 0.1) {
9295
- const m = e, w = m.worldForward, b = m.worldPosition, T = z(w).multiplyScalar(c * 0.7).add(l), k = T.distanceTo(b), E = h[Math.min(h.length - 1, Math.max(0, o))] + "88", I = this.context.domHeight > 0 ? screen.height / this.context.domHeight : 1, j = e.isPerspectiveCamera ? Math.tan(e.fov * Math.PI / 180 / 2) : 1;
9296
- U.DrawLabel(T, y, k * 0.012 * I * j, void 0, 16777215, E);
9295
+ const m = e, w = m.worldForward, b = m.worldPosition, T = U(w).multiplyScalar(c * 0.7).add(l), k = T.distanceTo(b), E = h[Math.min(h.length - 1, Math.max(0, o))] + "88", I = this.context.domHeight > 0 ? screen.height / this.context.domHeight : 1, j = e.isPerspectiveCamera ? Math.tan(e.fov * Math.PI / 180 / 2) : 1;
9296
+ z.DrawLabel(T, y, k * 0.012 * I * j, void 0, 16777215, E);
9297
9297
  }
9298
9298
  }
9299
9299
  }
@@ -9516,7 +9516,7 @@ class FO {
9516
9516
  /** @internal */
9517
9517
  internalRegisterReflection(e, t) {
9518
9518
  ln && console.log("Register reflection", e, t);
9519
- const i = new UO(this.context, t, 1);
9519
+ const i = new zO(this.context, t, 1);
9520
9520
  this._lighting[e] = i;
9521
9521
  }
9522
9522
  /** @internal */
@@ -9566,7 +9566,7 @@ class FO {
9566
9566
  }
9567
9567
  _lighting = {};
9568
9568
  }
9569
- class UO {
9569
+ class zO {
9570
9570
  get Source() {
9571
9571
  return this._source;
9572
9572
  }
@@ -9628,7 +9628,7 @@ class UO {
9628
9628
  const X_ = x("timescale");
9629
9629
  let fm = 1;
9630
9630
  typeof X_ == "number" && (fm = X_);
9631
- class zO {
9631
+ class UO {
9632
9632
  /** The time in seconds since the start of Needle Engine. */
9633
9633
  get time() {
9634
9634
  return this._time;
@@ -10177,8 +10177,12 @@ class H0 extends HTMLElement {
10177
10177
  static create() {
10178
10178
  return document.createElement(Xd);
10179
10179
  }
10180
+ _didInitialize = !1;
10180
10181
  constructor() {
10181
- super(), this._root = this.attachShadow({ mode: "closed" });
10182
+ super();
10183
+ }
10184
+ initializeDom() {
10185
+ this._root = this.attachShadow({ mode: "closed" });
10182
10186
  const e = document.createElement("template");
10183
10187
  e.innerHTML = `<style>
10184
10188
  :host {
@@ -10226,19 +10230,22 @@ class H0 extends HTMLElement {
10226
10230
  globalThis.open("https://needle.tools", "_blank");
10227
10231
  });
10228
10232
  }
10233
+ ensureInitialized() {
10234
+ this._didInitialize || (this._didInitialize = !0, this.initializeDom());
10235
+ }
10229
10236
  connectedCallback() {
10230
- this.wrapper.setAttribute("title", "Made with Needle Engine"), this.setAttribute("aria-label", "Needle Engine logo. Click to open the Needle Engine website.");
10237
+ this.ensureInitialized(), this.wrapper && (this.wrapper.setAttribute("title", "Made with Needle Engine"), this.setAttribute("aria-label", "Needle Engine logo. Click to open the Needle Engine website."));
10231
10238
  }
10232
10239
  _root;
10233
10240
  wrapper;
10234
10241
  logoElement;
10235
10242
  /** Show or hide the logo element (used by the menu) */
10236
10243
  setLogoVisible(e) {
10237
- this.logoElement.style.display = e ? "block" : "none";
10244
+ this.ensureInitialized(), this.logoElement && (this.logoElement.style.display = e ? "block" : "none");
10238
10245
  }
10239
10246
  /** Switch the logo between full and compact versions */
10240
10247
  setType(e) {
10241
- e === "full" ? (this.logoElement.src = P_, this.logoElement.classList.remove("with-text"), this.logoElement.classList.remove("compact")) : (this.logoElement.src = Ga, this.logoElement.classList.add("with-text"), this.logoElement.classList.add("compact"));
10248
+ this.ensureInitialized(), this.logoElement && (e === "full" ? (this.logoElement.src = P_, this.logoElement.classList.remove("with-text"), this.logoElement.classList.remove("compact")) : (this.logoElement.src = Ga, this.logoElement.classList.add("with-text"), this.logoElement.classList.add("compact")));
10242
10249
  }
10243
10250
  }
10244
10251
  customElements.get(Xd) || customElements.define(Xd, H0);
@@ -10581,7 +10588,7 @@ let wo = class {
10581
10588
  _menu;
10582
10589
  _spatialMenu;
10583
10590
  constructor(e) {
10584
- this._menu = Tu.getOrCreate(e.domElement, e), this._context = e, this._spatialMenu = new GO(e, this._menu), window.addEventListener("message", this.onPostMessage), pg(this.onStartXR);
10591
+ this._menu = Tu.getOrCreate(e.domElement, e), this._menu.ensureInitialized(), this._context = e, this._spatialMenu = new GO(e, this._menu), window.addEventListener("message", this.onPostMessage), pg(this.onStartXR);
10585
10592
  }
10586
10593
  /** @ignore internal method */
10587
10594
  onDestroy() {
@@ -10695,8 +10702,11 @@ class Tu extends HTMLElement {
10695
10702
  }
10696
10703
  _domElement = null;
10697
10704
  _context = null;
10705
+ _didInitialize = !1;
10698
10706
  constructor() {
10699
10707
  super();
10708
+ }
10709
+ initializeDom() {
10700
10710
  const e = document.createElement("template");
10701
10711
  e.innerHTML = `<style>
10702
10712
 
@@ -11136,9 +11146,12 @@ class Tu extends HTMLElement {
11136
11146
  }
11137
11147
  }).observe(this.root, { childList: !0, subtree: !0, attributes: !0 }), wa && this.___insertDebugOptions();
11138
11148
  }
11149
+ ensureInitialized() {
11150
+ this._didInitialize || (this._didInitialize = !0, this.initializeDom());
11151
+ }
11139
11152
  _sizeChangeInterval;
11140
11153
  connectedCallback() {
11141
- window.addEventListener("resize", this.handleSizeChange), this.handleMenuVisible(), this._sizeChangeInterval = setInterval(() => this.handleSizeChange(void 0, !1), 5e3), setTimeout(() => {
11154
+ this.ensureInitialized(), window.addEventListener("resize", this.handleSizeChange), this.handleMenuVisible(), this._sizeChangeInterval = setInterval(() => this.handleSizeChange(void 0, !1), 5e3), setTimeout(() => {
11142
11155
  this._domElement?.addEventListener("resize", this.handleSizeChange), this._domElement?.addEventListener("click", this.#t);
11143
11156
  }, 1);
11144
11157
  }
@@ -11395,7 +11408,7 @@ class Tu extends HTMLElement {
11395
11408
  }
11396
11409
  }
11397
11410
  customElements.get(va) || customElements.define(va, Tu);
11398
- const Ze = x("debugcontext"), XO = x("stats"), QO = x("debugactive"), YO = x("debugframerate"), KO = x("debugcoroutine"), qD = {};
11411
+ const qe = x("debugcontext"), XO = x("stats"), QO = x("debugactive"), YO = x("debugframerate"), KO = x("debugcoroutine"), qD = {};
11399
11412
  class XD {
11400
11413
  name;
11401
11414
  /** for debugging only */
@@ -11417,12 +11430,12 @@ var Ce = /* @__PURE__ */ ((s) => (s[s.Start = -1] = "Start", s[s.EarlyUpdate = 0
11417
11430
  function Eg(s, e) {
11418
11431
  if (!s) return;
11419
11432
  if (!s.isComponent) {
11420
- (L() || Ze) && console.error(`Registered script is not a Needle Engine component.
11433
+ (L() || qe) && console.error(`Registered script is not a Needle Engine component.
11421
11434
  The script will be ignored. Please make sure your component extends "Behaviour" imported from "@needle-tools/engine"
11422
11435
  `, s);
11423
11436
  return;
11424
11437
  }
11425
- e || (e = N.Current, Ze && console.warn("> Registering component without context"));
11438
+ e || (e = N.Current, qe && console.warn("> Registering component without context"));
11426
11439
  const t = e?.new_scripts;
11427
11440
  t.includes(s) || t.push(s);
11428
11441
  }
@@ -11769,7 +11782,7 @@ class N {
11769
11782
  _isVisible = !1;
11770
11783
  _stats = XO ? new kC() : null;
11771
11784
  constructor(e) {
11772
- this.name = e?.name || "", this.alias = e?.alias, this.domElement = e?.domElement || document.body, this.hash = e?.hash, e?.renderer && (this.renderer = e.renderer, this.isManagedExternally = !0), e?.runInBackground !== void 0 && (this.runInBackground = e.runInBackground), e?.scene ? this.scene = e.scene : this.scene = new qi(), e?.camera && (this._mainCamera = e.camera), this.application = new Yn(this), this.time = new zO(), this.input = new AP(this), this.physics = new Ic(this), this.connection = new qP(this), this.assets = new _k(), this.sceneLighting = new FO(this), this.addressables = new bO(this), this.lightmaps = new OO(this), this.players = new TO(this), this.menu = new wo(this), this.lodsManager = new MO(this), this.animations = new CO(this), this.accessibility = new Fd(this);
11785
+ this.name = e?.name || "", this.alias = e?.alias, this.domElement = e?.domElement || document.body, this.hash = e?.hash, e?.renderer && (this.renderer = e.renderer, this.isManagedExternally = !0), e?.runInBackground !== void 0 && (this.runInBackground = e.runInBackground), e?.scene ? this.scene = e.scene : this.scene = new qi(), e?.camera && (this._mainCamera = e.camera), this.application = new Yn(this), this.time = new UO(), this.input = new AP(this), this.physics = new Ic(this), this.connection = new qP(this), this.assets = new _k(), this.sceneLighting = new FO(this), this.addressables = new bO(this), this.lightmaps = new OO(this), this.players = new TO(this), this.menu = new wo(this), this.lodsManager = new MO(this), this.animations = new CO(this), this.accessibility = new Fd(this);
11773
11786
  const t = () => this._needsUpdateSize = !0;
11774
11787
  window.addEventListener("resize", t), this._disposeCallbacks.push(() => window.removeEventListener("resize", t));
11775
11788
  const i = new ResizeObserver((n) => this._needsUpdateSize = !0);
@@ -11787,9 +11800,9 @@ class N {
11787
11800
  createNewRenderer(e) {
11788
11801
  if (this.renderer?.dispose(), e = { ...N.DefaultWebGLRendererParameters, ...e }, !e.canvas) {
11789
11802
  const t = this.domElement?.shadowRoot?.querySelector("canvas");
11790
- t && (e.canvas = t, Ze && console.log("Using canvas from shadow root", t));
11803
+ t ? (e.canvas = t, qe && console.log("Using canvas from shadow root", t)) : qe && console.warn("No canvas found in shadow root, creating new canvas. This may cause input events to not work correctly. To fix this, make sure to use the canvas provided by the Needle Engine Web Component (e.g. by using context.createNewRenderer() without parameters or passing the canvas from the shadow root explicitly).");
11791
11804
  }
11792
- return Ze && console.log("Using Renderer Parameters:", e, this.domElement), this.renderer = new Br(e), this.renderer.domElement.setAttribute("aria-label", "3D rendering"), this.renderer.domElement.setAttribute("role", "img"), this.renderer.debug.checkShaderErrors = L() || x("checkshadererrors") === !0, this.renderer.toneMappingExposure = 1, this.renderer.toneMapping = Ed, this.renderer.setClearColor(new re("lightgrey"), 0), this.renderer.shadowMap.enabled = !0, this.renderer.shadowMap.type = yS, this.renderer.setSize(this.domWidth, this.domHeight), this.renderer.outputColorSpace = As, this.renderer.nodes = {
11805
+ return qe && console.log("Using Renderer Parameters:", e, this.domElement), this.renderer = new Br(e), this.renderer.domElement.setAttribute("aria-label", "3D rendering"), this.renderer.domElement.setAttribute("role", "img"), this.renderer.debug.checkShaderErrors = L() || x("checkshadererrors") === !0, this.renderer.toneMappingExposure = 1, this.renderer.toneMapping = Ed, this.renderer.setClearColor(new re("lightgrey"), 0), this.renderer.shadowMap.enabled = !0, this.renderer.shadowMap.type = yS, this.renderer.setSize(this.domWidth, this.domHeight), this.renderer.outputColorSpace = As, this.renderer.nodes = {
11793
11806
  library: new _S(),
11794
11807
  modelViewMatrix: null,
11795
11808
  modelNormalViewMatrix: null
@@ -11897,7 +11910,7 @@ class N {
11897
11910
  this.internalOnDestroy();
11898
11911
  }
11899
11912
  internalOnDestroy() {
11900
- N.Current = this, pe.dispatchCallback(ue.ContextDestroying, this), Rn(this, ue.ContextDestroying), this.clear(), this.renderer?.setAnimationLoop(null), this.renderer && (this.renderer.setClearAlpha(0), this.renderer.clear(), this.isManagedExternally || (Ze && console.log("Disposing renderer"), this.renderer.dispose())), this.scene = null, this.renderer = null, this.input.dispose(), this.menu.onDestroy(), this.animations.onDestroy();
11913
+ N.Current = this, pe.dispatchCallback(ue.ContextDestroying, this), Rn(this, ue.ContextDestroying), this.clear(), this.renderer?.setAnimationLoop(null), this.renderer && (this.renderer.setClearAlpha(0), this.renderer.clear(), this.isManagedExternally || (qe && console.log("Disposing renderer"), this.renderer.dispose())), this.scene = null, this.renderer = null, this.input.dispose(), this.menu.onDestroy(), this.animations.onDestroy();
11901
11914
  for (const e of this._disposeCallbacks)
11902
11915
  try {
11903
11916
  e();
@@ -12036,10 +12049,10 @@ Start a coroutine from a component by calling "this.startCoroutine(myCoroutine()
12036
12049
  // #region internal create
12037
12050
  async internalOnCreate(e) {
12038
12051
  const t = ++this._createId;
12039
- Ze && console.log("Creating context", this.name, e);
12052
+ qe && console.log("Creating context", this.name, e);
12040
12053
  const i = globalThis["needle:dependencies:ready"];
12041
- i instanceof Promise && (Ze && console.log("Waiting for dependencies to be ready"), await i.catch((h) => {
12042
- if (Ze || L()) {
12054
+ i instanceof Promise && (qe && console.log("Waiting for dependencies to be ready"), await i.catch((h) => {
12055
+ if (qe || L()) {
12043
12056
  if (Pu("Needle Engine dependencies failed to load. Please check the console for more details"), h instanceof ReferenceError) {
12044
12057
  let d = "YourComponentName";
12045
12058
  const f = h.message.indexOf("'");
@@ -12064,7 +12077,7 @@ Possible solutions:
12064
12077
  console.error("Needle Engine dependencies failed to load", h);
12065
12078
  }
12066
12079
  }).then(() => {
12067
- Ze && console.log("Needle Engine dependencies are ready");
12080
+ qe && console.log("Needle Engine dependencies are ready");
12068
12081
  })), this.clear();
12069
12082
  const n = this.renderer, o = !n || n.isDisposed === !0;
12070
12083
  this.isManagedExternally === !1 && o ? this.createNewRenderer() : this.lodsManager.setRenderer(this.renderer), this.renderer?.setAnimationLoop(null), N.Current = this, await pe.dispatchCallback(ue.ContextCreationStart, this);
@@ -12079,7 +12092,7 @@ Possible solutions:
12079
12092
  if (t !== this._createId || e?.abortSignal?.aborted)
12080
12093
  return !1;
12081
12094
  if (this.internalOnUpdateVisible(), !this.renderer)
12082
- return Ze && console.warn("Context has no renderer (perhaps it was disconnected?", this.domElement.isConnected), !1;
12095
+ return qe && console.warn("Context has no renderer (perhaps it was disconnected?", this.domElement.isConnected), !1;
12083
12096
  !this.isManagedExternally && !this.domElement.shadowRoot && this.domElement.prepend(this.renderer.domElement), N.Current = this, N.Current = this;
12084
12097
  for (let h = 0; h < this.new_scripts.length; h++) {
12085
12098
  const d = this.new_scripts[h];
@@ -12105,7 +12118,7 @@ Possible solutions:
12105
12118
  }
12106
12119
  }), h ? this.setCurrentCamera(h) : !pe.dispatchCallback(ue.MissingCamera, this, { files: a }) && !this.mainCamera && !this.isManagedExternally && console.warn("Missing camera in main scene", this);
12107
12120
  }
12108
- this.input.bindEvents(), N.Current = this, $d(this), this.physics.engine && (this.physics.engine?.step(0), this.physics.engine?.postStep()), !this.isManagedExternally && this.composer && this.mainCamera, this._needsUpdateSize = !0, this._stats && (this._stats.showPanel(0), this._stats.dom.style.position = "absolute", this.domElement.shadowRoot?.appendChild(this._stats.dom)), Ze && Xp(this.scene, !0), this.targetFrameRate === void 0 ? (Ze && console.warn("No target framerate set, using default", N.DefaultTargetFrameRate), this.targetFrameRate = N._defaultTargetFramerate) : Ze && console.log("Target framerate set to", this.targetFrameRate), this._dispatchReadyAfterFrame = !0;
12121
+ this.input.bindEvents(), N.Current = this, $d(this), this.physics.engine && (this.physics.engine?.step(0), this.physics.engine?.postStep()), !this.isManagedExternally && this.composer && this.mainCamera, this._needsUpdateSize = !0, this._stats && (this._stats.showPanel(0), this._stats.dom.style.position = "absolute", this.domElement.shadowRoot?.appendChild(this._stats.dom)), qe && Xp(this.scene, !0), this.targetFrameRate === void 0 ? (qe && console.warn("No target framerate set, using default", N.DefaultTargetFrameRate), this.targetFrameRate = N._defaultTargetFramerate) : qe && console.log("Target framerate set to", this.targetFrameRate), this._dispatchReadyAfterFrame = !0;
12109
12122
  const l = pe.dispatchCallback(ue.ContextCreated, this, { files: a });
12110
12123
  if (l) {
12111
12124
  const h = this.domElement;
@@ -12114,7 +12127,7 @@ Possible solutions:
12114
12127
  if (e?.abortSignal?.aborted)
12115
12128
  return !1;
12116
12129
  const c = this.rootSourceId;
12117
- return c && this.sceneLighting.enable(c), Rn(this, ue.ContextCreated), Ze && console.log("Context Created...", this.renderer, this.renderer.domElement), this._isCreating = !1, !this.isManagedExternally && !e?.abortSignal?.aborted && this.restartRenderLoop(), !0;
12130
+ return c && this.sceneLighting.enable(c), Rn(this, ue.ContextCreated), qe && console.log("Context Created...", this.renderer, this.renderer.domElement), this._isCreating = !1, !this.isManagedExternally && !e?.abortSignal?.aborted && this.restartRenderLoop(), !0;
12118
12131
  }
12119
12132
  rootSceneSourceIdentifiers = [];
12120
12133
  async internalLoadInitialContent(e, t) {
@@ -12131,15 +12144,15 @@ Possible solutions:
12131
12144
  }, r = Qn(), a = 0;
12132
12145
  for (let l = 0; l < n.length; l++) {
12133
12146
  if (t.abortSignal?.aborted) {
12134
- Ze && console.log("Aborting loading because of abort signal");
12147
+ qe && console.log("Aborting loading because of abort signal");
12135
12148
  break;
12136
12149
  }
12137
12150
  if (e !== this._createId) {
12138
- Ze && console.log("Aborting loading because create id changed", e, this._createId);
12151
+ qe && console.log("Aborting loading because create id changed", e, this._createId);
12139
12152
  break;
12140
12153
  }
12141
12154
  const c = n[l];
12142
- t?.onLoadingStart?.call(this, l, c), Ze && console.log("Context Load " + c);
12155
+ t?.onLoadingStart?.call(this, l, c), qe && console.log("Context Load " + c);
12143
12156
  const h = await r.loadSync(this, c, c, a, (d) => {
12144
12157
  t.abortSignal?.aborted || (o.name = c, o.progress = d, o.index = l, o.count = n.length, t.onLoadingProgress?.call(this, o));
12145
12158
  });
@@ -12149,7 +12162,7 @@ Possible solutions:
12149
12162
  }) : console.warn("Could not load file: " + c);
12150
12163
  }
12151
12164
  if (e !== this._createId || t.abortSignal?.aborted) {
12152
- Ze && console.log("Aborting loading because create id changed or abort signal was set", e, this._createId);
12165
+ qe && console.log("Aborting loading because create id changed or abort signal was set", e, this._createId);
12153
12166
  for (const l of i)
12154
12167
  if (l && l.file)
12155
12168
  for (const c of l.file.scenes)
@@ -12165,7 +12178,7 @@ Possible solutions:
12165
12178
  if (!Array.isArray(c.file.parser.json.materials)) continue;
12166
12179
  for (let d = 0; d < c.file.parser.json.materials.length; d++) {
12167
12180
  const f = await c.file.parser.getDependency("material", d), p = new M();
12168
- p.position.x = d * 1.1, p.position.y = h, this.scene.add(p), Ur.createPrimitive("ShaderBall", {
12181
+ p.position.x = d * 1.1, p.position.y = h, this.scene.add(p), zr.createPrimitive("ShaderBall", {
12169
12182
  parent: p,
12170
12183
  material: f
12171
12184
  });
@@ -12187,11 +12200,11 @@ Possible solutions:
12187
12200
  _renderlooperrors = 0;
12188
12201
  /** Performs a full update step including script callbacks, rendering (unless isManagedExternally is set to false) and post render callbacks */
12189
12202
  update(e, t) {
12190
- if (t === void 0 && (t = null), L() || Ze || Ck())
12203
+ if (t === void 0 && (t = null), L() || qe || Ck())
12191
12204
  try {
12192
12205
  this.internalStep(e, t), this._renderlooperrors = 0;
12193
12206
  } catch (i) {
12194
- this._renderlooperrors += 1, (L() || Ze) && (i instanceof Error || i instanceof TypeError) && Ie("Caught unhandled exception during render-loop - see console for details.", { type: Hi.Error }), console.error("Frame #" + this.time.frame + `
12207
+ this._renderlooperrors += 1, (L() || qe) && (i instanceof Error || i instanceof TypeError) && Ie("Caught unhandled exception during render-loop - see console for details.", { type: Hi.Error }), console.error("Frame #" + this.time.frame + `
12195
12208
  `, i), this._renderlooperrors >= 3 && (console.warn("Stopping render loop due to error"), this.renderer.setAnimationLoop(null), ci.sendError(N.Current, "renderloop", i instanceof Error ? i : new Error(String(i)))), this.domElement.dispatchEvent(new CustomEvent("error", { detail: i }));
12196
12209
  }
12197
12210
  else
@@ -14080,7 +14093,7 @@ class n2 {
14080
14093
  return !0;
14081
14094
  }
14082
14095
  }
14083
- class Uh {
14096
+ class zh {
14084
14097
  /** The name of the animation */
14085
14098
  name;
14086
14099
  /** The hash of the name */
@@ -14111,7 +14124,7 @@ function pM(s, e) {
14111
14124
  };
14112
14125
  }
14113
14126
  var lr = /* @__PURE__ */ ((s) => (s[s.If = 1] = "If", s[s.IfNot = 2] = "IfNot", s[s.Greater = 3] = "Greater", s[s.Less = 4] = "Less", s[s.Equals = 6] = "Equals", s[s.NotEqual = 7] = "NotEqual", s))(lr || {}), Z0 = /* @__PURE__ */ ((s) => (s[s.Float = 1] = "Float", s[s.Int = 3] = "Int", s[s.Bool = 4] = "Bool", s[s.Trigger = 9] = "Trigger", s))(Z0 || {});
14114
- const st = x("debuganimatorcontroller"), zh = x("debugrootmotion");
14127
+ const st = x("debuganimatorcontroller"), Uh = x("debugrootmotion");
14115
14128
  class vn {
14116
14129
  /**
14117
14130
  * Creates an AnimatorController from a set of animation clips.
@@ -14153,7 +14166,7 @@ class vn {
14153
14166
  }
14154
14167
  const n = {
14155
14168
  name: "AnimatorController",
14156
- guid: new Ut(Date.now()).generateUUID(),
14169
+ guid: new zt(Date.now()).generateUUID(),
14157
14170
  parameters: [],
14158
14171
  layers: [{
14159
14172
  name: "Base Layer",
@@ -14332,7 +14345,7 @@ class vn {
14332
14345
  const e = this._activeState.motion.action;
14333
14346
  if (!e) return null;
14334
14347
  const t = this._activeState.motion.clip.duration, i = t <= 0 ? 0 : Math.abs(e.time / t);
14335
- return new Uh(this._activeState, i, t, this._speed);
14348
+ return new zh(this._activeState, i, t, this._speed);
14336
14349
  }
14337
14350
  /**
14338
14351
  * Gets the animation action currently playing.
@@ -14419,7 +14432,7 @@ class vn {
14419
14432
  if (typeof this.model == "string")
14420
14433
  return console.warn("AnimatorController has not been resolved, can not create model from string", this.model), null;
14421
14434
  st && console.warn("AnimatorController clone()", this.model);
14422
- const e = wu(this.model, (i, n, o) => o == null ? !0 : !(o.type === "Object3D" || o.isObject3D === !0 || z1(o) || o.tracks !== void 0 || o instanceof vn));
14435
+ const e = wu(this.model, (i, n, o) => o == null ? !0 : !(o.type === "Object3D" || o.isObject3D === !0 || U1(o) || o.tracks !== void 0 || o instanceof vn));
14423
14436
  return console.assert(e !== this.model), new vn(e);
14424
14437
  }
14425
14438
  /**
@@ -14514,7 +14527,7 @@ Exit Time: ` + c, o.hasExitTime);
14514
14527
  i && this.setTimescale(i, t);
14515
14528
  let n = !1;
14516
14529
  if (t.motion.isLooping && i && (i.time >= i.getClip().duration ? (n = !0, i.reset(), i.time = 0, i.play()) : i.time <= 0 && i.timeScale < 0 && (n = !0, i.reset(), i.time = i.getClip().duration, i.play())), !n && t && !e && i && this.animator && t.behaviours) {
14517
- const o = i?.getClip().duration, r = i.time / o, a = new Uh(this._activeState, r, o, this._speed);
14530
+ const o = i?.getClip().duration, r = i.time / o, a = new zh(this._activeState, r, o, this._speed);
14518
14531
  for (const l of t.behaviours)
14519
14532
  l.instance && l.instance.onStateUpdate?.call(l.instance, this.animator, a, 0);
14520
14533
  }
@@ -14549,7 +14562,7 @@ Exit Time: ` + c, o.hasExitTime);
14549
14562
  }
14550
14563
  }
14551
14564
  if (this._activeState?.behaviours && this._activeState.motion.action) {
14552
- const h = this._activeState?.motion.clip.duration, d = this._activeState.motion.action.time / h, f = new Uh(this._activeState, d, h, this._speed);
14565
+ const h = this._activeState?.motion.clip.duration, d = this._activeState.motion.action.time / h, f = new zh(this._activeState, d, h, this._speed);
14553
14566
  for (const p of this._activeState.behaviours)
14554
14567
  p.instance?.onStateExit?.call(p.instance, this.animator, f, n);
14555
14568
  }
@@ -14566,7 +14579,7 @@ Exit Time: ` + c, o.hasExitTime);
14566
14579
  l.isRunning() && l.stop(), l.reset(), l.enabled = !0, this.setTimescale(l, e);
14567
14580
  const h = e.motion.clip.duration;
14568
14581
  if (l.time = o ? 0 : i * h, l.timeScale < 0 && (l.time = h - l.time), l.clampWhenFinished = !0, l.setLoop($p, 0), t > 0 ? l.fadeIn(t) : l.weight = 1, l.play(), window.requestAnimationFrame(() => Ls.testIfRootCanAnimate(l)), this.rootMotionHandler && this.rootMotionHandler.onStart(l), this._activeStates.includes(e) || this._activeStates.push(e), this._activeState.behaviours) {
14569
- const d = new Uh(e, i, h, this._speed);
14582
+ const d = new zh(e, i, h, this._speed);
14570
14583
  for (const f of this._activeState.behaviours)
14571
14584
  f.instance?.onStateEnter?.call(f.instance, this.animator, d, n);
14572
14585
  }
@@ -14725,7 +14738,7 @@ class rt {
14725
14738
  if (e.getClip() !== this.clip) return;
14726
14739
  rt.lastObjRotation[this.cacheId] || (rt.lastObjRotation[this.cacheId] = this.root.quaternion.clone());
14727
14740
  const t = rt.lastObjRotation[this.cacheId];
14728
- if (rt.spaceRotation[this.cacheId].copy(t), zh) {
14741
+ if (rt.spaceRotation[this.cacheId].copy(t), Uh) {
14729
14742
  const i = new ct().setFromQuaternion(t);
14730
14743
  console.log("START", this.clip.name, F.toDegrees(i.y), this.root.position.z);
14731
14744
  }
@@ -14737,18 +14750,18 @@ class rt {
14737
14750
  handlePosition(e, t) {
14738
14751
  if (t) {
14739
14752
  const i = this.root;
14740
- zh && i.add(new Pi()), rt.lastObjPosition[this.cacheId] || (rt.lastObjPosition[this.cacheId] = this.root.position.clone());
14753
+ Uh && i.add(new Pi()), rt.lastObjPosition[this.cacheId] || (rt.lastObjPosition[this.cacheId] = this.root.position.clone());
14741
14754
  const n = new _(), o = new _();
14742
14755
  this.positionWrapper = new ab(t, (r, a) => {
14743
14756
  const l = this.action.getEffectiveWeight();
14744
- return zh && i.position.length() > 8 && i.position.set(0, i.position.y, 0), r > this._prevTime && (n.set(a[0], a[1], a[2]), n.sub(o), n.multiplyScalar(l), n.applyQuaternion(this.getClipRotationOffset()), n.applyQuaternion(i.quaternion), this.positionChange.copy(n)), o.fromArray(a), this._prevTime = r, a[0] = 0, a[1] = 0, a[2] = 0, a;
14757
+ return Uh && i.position.length() > 8 && i.position.set(0, i.position.y, 0), r > this._prevTime && (n.set(a[0], a[1], a[2]), n.sub(o), n.multiplyScalar(l), n.applyQuaternion(this.getClipRotationOffset()), n.applyQuaternion(i.quaternion), this.positionChange.copy(n)), o.fromArray(a), this._prevTime = r, a[0] = 0, a[1] = 0, a[2] = 0, a;
14745
14758
  });
14746
14759
  }
14747
14760
  }
14748
14761
  static identityQuaternion = new V();
14749
14762
  handleRotation(e, t) {
14750
14763
  if (t) {
14751
- if (zh) {
14764
+ if (Uh) {
14752
14765
  const r = t.values, a = new ct().setFromQuaternion(new V(r[0], r[1], r[2], r[3]));
14753
14766
  console.log(e.name, t.name, "FIRST ROTATION IN TRACK", F.toDegrees(a.y));
14754
14767
  const l = t.values.length - 4, c = new V().set(r[l], r[l + 1], r[l + 2], r[l + 3]), h = new ct().setFromQuaternion(c);
@@ -15222,12 +15235,12 @@ class Fs extends R {
15222
15235
  this._projection.updateWorldMatrix(!0, !0);
15223
15236
  const o = tn(this.context.scene.children, [this._projection]), r = o.min.y;
15224
15237
  if (r < 1 / 0) {
15225
- const a = z();
15238
+ const a = U();
15226
15239
  a.x = o.min.x + (o.max.x - o.min.x) * 0.5;
15227
- const l = qe(this.gameObject).x;
15240
+ const l = Xe(this.gameObject).x;
15228
15241
  a.y = r + this._height * l - i, a.z = o.min.z + (o.max.z - o.min.z) * 0.5, Rt(this._projection, a);
15229
15242
  }
15230
- Nh && U.DrawWireBox3(o, 65280, 5);
15243
+ Nh && z.DrawWireBox3(o, 65280, 5);
15231
15244
  }
15232
15245
  this.context.scene.backgroundBlurriness > 1e-3 && this._needsTextureUpdate && this.updateBlurriness(e, this.context.scene.backgroundBlurriness), this._lastBackground = e, this._lastHeight = this._height, this._lastRadius = this._radius, this._needsTextureUpdate = !1;
15233
15246
  }
@@ -15371,7 +15384,7 @@ function SM(s) {
15371
15384
  const k = l.clone();
15372
15385
  s.fitDirection ? k.sub(new _().copy(s.fitDirection).multiplyScalar(1e6)) : k.sub(t.worldPosition), i === "y" && (k.y = 0), k.normalize(), k.multiplyScalar(b), i === "y" && (k.y += -v * 4 * b);
15373
15386
  let E = l.clone().sub(k);
15374
- return s.cameraOffset && (s.cameraOffset.x !== void 0 && (E.x += s.cameraOffset.x), s.cameraOffset.y !== void 0 && (E.y += s.cameraOffset.y), s.cameraOffset.z !== void 0 && (E.z += s.cameraOffset.z)), s.relativeCameraOffset && (s.relativeCameraOffset.x !== void 0 && (E.x += s.relativeCameraOffset.x * a.x), s.relativeCameraOffset.y !== void 0 && (E.y += s.relativeCameraOffset.y * a.y), s.relativeCameraOffset.z !== void 0 && (E.z += s.relativeCameraOffset.z * a.z)), t.parent && (E = t.parent.worldToLocal(E)), s.debug && (U.DrawWireBox3(d, 16777011, 10), U.DrawWireBox3(f, 65280, 10)), s.autoApply && (t.position.copy(E), t.lookAt(T), r > 0 && t instanceof de && (t.fov = r, t.updateProjectionMatrix())), {
15387
+ return s.cameraOffset && (s.cameraOffset.x !== void 0 && (E.x += s.cameraOffset.x), s.cameraOffset.y !== void 0 && (E.y += s.cameraOffset.y), s.cameraOffset.z !== void 0 && (E.z += s.cameraOffset.z)), s.relativeCameraOffset && (s.relativeCameraOffset.x !== void 0 && (E.x += s.relativeCameraOffset.x * a.x), s.relativeCameraOffset.y !== void 0 && (E.y += s.relativeCameraOffset.y * a.y), s.relativeCameraOffset.z !== void 0 && (E.z += s.relativeCameraOffset.z * a.z)), t.parent && (E = t.parent.worldToLocal(E)), s.debug && (z.DrawWireBox3(d, 16777011, 10), z.DrawWireBox3(f, 65280, 10)), s.autoApply && (t.position.copy(E), t.lookAt(T), r > 0 && t instanceof de && (t.fov = r, t.updateProjectionMatrix())), {
15375
15388
  camera: t,
15376
15389
  position: E,
15377
15390
  lookAt: T,
@@ -15573,7 +15586,7 @@ var A;
15573
15586
  e.load = n;
15574
15587
  })(s.POSTPROCESSING_AO || (s.POSTPROCESSING_AO = {}));
15575
15588
  })(A || (A = {}));
15576
- var Pt = /* @__PURE__ */ ((s) => (s[s.Average = 0] = "Average", s[s.Multiply = 1] = "Multiply", s[s.Minimum = 2] = "Minimum", s[s.Maximum = 3] = "Maximum", s))(Pt || {}), Lg = /* @__PURE__ */ ((s) => (s[s.Discrete = 0] = "Discrete", s[s.Continuous = 1] = "Continuous", s))(Lg || {}), Ke = /* @__PURE__ */ ((s) => (s[s.None = 0] = "None", s[s.FreezePositionX = 2] = "FreezePositionX", s[s.FreezePositionY = 4] = "FreezePositionY", s[s.FreezePositionZ = 8] = "FreezePositionZ", s[s.FreezePosition = 14] = "FreezePosition", s[s.FreezeRotationX = 16] = "FreezeRotationX", s[s.FreezeRotationY = 32] = "FreezeRotationY", s[s.FreezeRotationZ = 64] = "FreezeRotationZ", s[s.FreezeRotation = 112] = "FreezeRotation", s[s.FreezeAll = 126] = "FreezeAll", s))(Ke || {}), Zl = /* @__PURE__ */ ((s) => (s[s.None = 0] = "None", s[s.X = 2] = "X", s[s.Y = 4] = "Y", s[s.Z = 8] = "Z", s[s.All = -1] = "All", s))(Zl || {});
15589
+ var Pt = /* @__PURE__ */ ((s) => (s[s.Average = 0] = "Average", s[s.Multiply = 1] = "Multiply", s[s.Minimum = 2] = "Minimum", s[s.Maximum = 3] = "Maximum", s))(Pt || {}), Lg = /* @__PURE__ */ ((s) => (s[s.Discrete = 0] = "Discrete", s[s.Continuous = 1] = "Continuous", s))(Lg || {}), Ze = /* @__PURE__ */ ((s) => (s[s.None = 0] = "None", s[s.FreezePositionX = 2] = "FreezePositionX", s[s.FreezePositionY = 4] = "FreezePositionY", s[s.FreezePositionZ = 8] = "FreezePositionZ", s[s.FreezePosition = 14] = "FreezePosition", s[s.FreezeRotationX = 16] = "FreezeRotationX", s[s.FreezeRotationY = 32] = "FreezeRotationY", s[s.FreezeRotationZ = 64] = "FreezeRotationZ", s[s.FreezeRotation = 112] = "FreezeRotation", s[s.FreezeAll = 126] = "FreezeAll", s))(Ze || {}), Zl = /* @__PURE__ */ ((s) => (s[s.None = 0] = "None", s[s.X = 2] = "X", s[s.Y = 4] = "Y", s[s.Z = 8] = "Z", s[s.All = -1] = "All", s))(Zl || {});
15577
15590
  const Nt = function(s, e) {
15578
15591
  return function(t, i, n) {
15579
15592
  PM(t, i, n, s, e);
@@ -15729,7 +15742,7 @@ const ui = class _d extends R {
15729
15742
  _mass = 0;
15730
15743
  useGravity = !0;
15731
15744
  centerOfMass = new _(0, 0, 0);
15732
- constraints = Ke.None;
15745
+ constraints = Ze.None;
15733
15746
  isKinematic = !1;
15734
15747
  drag = 0;
15735
15748
  angularDrag = 1;
@@ -15738,51 +15751,51 @@ const ui = class _d extends R {
15738
15751
  collisionDetectionMode = Lg.Discrete;
15739
15752
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15740
15753
  get lockPositionX() {
15741
- return (this.constraints & Ke.FreezePositionX) !== 0;
15754
+ return (this.constraints & Ze.FreezePositionX) !== 0;
15742
15755
  }
15743
15756
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15744
15757
  get lockPositionY() {
15745
- return (this.constraints & Ke.FreezePositionY) !== 0;
15758
+ return (this.constraints & Ze.FreezePositionY) !== 0;
15746
15759
  }
15747
15760
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15748
15761
  get lockPositionZ() {
15749
- return (this.constraints & Ke.FreezePositionZ) !== 0;
15762
+ return (this.constraints & Ze.FreezePositionZ) !== 0;
15750
15763
  }
15751
15764
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15752
15765
  get lockRotationX() {
15753
- return (this.constraints & Ke.FreezeRotationX) !== 0;
15766
+ return (this.constraints & Ze.FreezeRotationX) !== 0;
15754
15767
  }
15755
15768
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15756
15769
  get lockRotationY() {
15757
- return (this.constraints & Ke.FreezeRotationY) !== 0;
15770
+ return (this.constraints & Ze.FreezeRotationY) !== 0;
15758
15771
  }
15759
15772
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15760
15773
  get lockRotationZ() {
15761
- return (this.constraints & Ke.FreezeRotationZ) !== 0;
15774
+ return (this.constraints & Ze.FreezeRotationZ) !== 0;
15762
15775
  }
15763
15776
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15764
15777
  set lockPositionX(e) {
15765
- e ? this.constraints |= Ke.FreezePositionX : this.constraints &= ~Ke.FreezePositionX;
15778
+ e ? this.constraints |= Ze.FreezePositionX : this.constraints &= ~Ze.FreezePositionX;
15766
15779
  }
15767
15780
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15768
15781
  set lockPositionY(e) {
15769
- e ? this.constraints |= Ke.FreezePositionY : this.constraints &= ~Ke.FreezePositionY;
15782
+ e ? this.constraints |= Ze.FreezePositionY : this.constraints &= ~Ze.FreezePositionY;
15770
15783
  }
15771
15784
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15772
15785
  set lockPositionZ(e) {
15773
- e ? this.constraints |= Ke.FreezePositionZ : this.constraints &= ~Ke.FreezePositionZ;
15786
+ e ? this.constraints |= Ze.FreezePositionZ : this.constraints &= ~Ze.FreezePositionZ;
15774
15787
  }
15775
15788
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15776
15789
  set lockRotationX(e) {
15777
- e ? this.constraints |= Ke.FreezeRotationX : this.constraints &= ~Ke.FreezeRotationX;
15790
+ e ? this.constraints |= Ze.FreezeRotationX : this.constraints &= ~Ze.FreezeRotationX;
15778
15791
  }
15779
15792
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15780
15793
  set lockRotationY(e) {
15781
- e ? this.constraints |= Ke.FreezeRotationY : this.constraints &= ~Ke.FreezeRotationY;
15794
+ e ? this.constraints |= Ze.FreezeRotationY : this.constraints &= ~Ze.FreezeRotationY;
15782
15795
  }
15783
15796
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15784
15797
  set lockRotationZ(e) {
15785
- e ? this.constraints |= Ke.FreezeRotationZ : this.constraints &= ~Ke.FreezeRotationZ;
15798
+ e ? this.constraints |= Ze.FreezeRotationZ : this.constraints &= ~Ze.FreezeRotationZ;
15786
15799
  }
15787
15800
  /** Gravity is such a common force that it is implemented as a special case (even if it could easily be implemented by the user using force application). Note however that a change of gravity won't automatically wake-up the sleeping bodies so keep in mind that you may want to wake them up manually before a gravity change.
15788
15801
  *
@@ -16652,10 +16665,10 @@ class FM extends nn {
16652
16665
  }
16653
16666
  }
16654
16667
  new FM();
16655
- var UM = Object.defineProperty, zM = (s, e, t, i) => {
16668
+ var zM = Object.defineProperty, UM = (s, e, t, i) => {
16656
16669
  for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
16657
16670
  (r = s[o]) && (n = r(e, t, n) || n);
16658
- return n && UM(e, t, n), n;
16671
+ return n && zM(e, t, n), n;
16659
16672
  };
16660
16673
  class Fc extends R {
16661
16674
  awake() {
@@ -16677,14 +16690,14 @@ class wn extends Fc {
16677
16690
  }
16678
16691
  performRaycast(e = null) {
16679
16692
  if (!this.targets) return null;
16680
- e ??= new zr(), e.targets = this.targets, e.results = this.raycastHits, e.useAcceleratedRaycast = !0;
16693
+ e ??= new Ur(), e.targets = this.targets, e.results = this.raycastHits, e.useAcceleratedRaycast = !0;
16681
16694
  const t = e.testObject;
16682
16695
  this.ignoreSkinnedMeshes && (e.testObject = (n) => n instanceof yo ? "continue in children" : t ? t(n) : !0);
16683
16696
  const i = this.context.physics.raycast(e);
16684
16697
  return e.testObject = t, i;
16685
16698
  }
16686
16699
  }
16687
- zM([
16700
+ UM([
16688
16701
  u()
16689
16702
  ], wn.prototype, "ignoreSkinnedMeshes");
16690
16703
  class jg extends wn {
@@ -16852,7 +16865,7 @@ class hi extends R {
16852
16865
  if (e === void 0 || e.propagationStopped || e.defaultPrevented || e.used) return;
16853
16866
  const t = new Du(this.context.input, e);
16854
16867
  this._currentPointerEventName = e.type, t.inputSource = this.context.input, t.isClick = e.isClick, t.isDoubleClick = e.isDoubleClick, t.isDown = e.type == Be.PointerDown, t.isUp = e.type == Be.PointerUp, t.isPressed = this.context.input.getPointerPressed(e.pointerId);
16855
- const i = new zr();
16868
+ const i = new Ur();
16856
16869
  e.hasRay ? i.ray = e.ray : i.screenPoint = this.context.input.getPointerPositionRC(e.pointerId), i.allowSlowRaycastFallback = e.isClick || e.isDoubleClick;
16857
16870
  const n = this.performRaycast(i);
16858
16871
  if (no && (t.isDown ? console.log("DOWN", { id: t.pointerId, hits: n.length }) : t.isUp && console.log("UP", { id: t.pointerId, hits: n.length }), t.isClick && console.log("CLICK", { id: t.pointerId, hits: n.length })), n) {
@@ -17426,7 +17439,7 @@ class ye extends R {
17426
17439
  };
17427
17440
  updateTargetNow(e) {
17428
17441
  const t = new Rs(this._cameraObject?.worldPosition, this._cameraObject?.worldForward.multiplyScalar(-1)), i = this.context.physics.raycastFromRay(t, e), n = i.length > 0 ? i[0] : void 0;
17429
- n && n.distance > this.minZoom && n.distance < this.maxZoom ? (Lt && U.DrawWireSphere(n.point, 0.1, 16711680, 2), this._controls?.target.copy(i[0].point)) : Lt && console.log("OrbitControls: No hit found when updating target", { hits: [...i] });
17442
+ n && n.distance > this.minZoom && n.distance < this.maxZoom ? (Lt && z.DrawWireSphere(n.point, 0.1, 16711680, 2), this._controls?.target.copy(i[0].point)) : Lt && console.log("OrbitControls: No hit found when updating target", { hits: [...i] });
17430
17443
  }
17431
17444
  _orbitStartAngle = 0;
17432
17445
  _zoomStartDistance = 0;
@@ -17458,10 +17471,10 @@ class ye extends R {
17458
17471
  if (t && !this.setLookTargetFromConstraint()) {
17459
17472
  this.debugLog && console.log("NO TARGET");
17460
17473
  const i = te(t.threeCamera), n = Math.max(0.01, i.length()), o = new _(0, 0, -n).applyMatrix4(t.threeCamera.matrixWorld);
17461
- Lt && U.DrawLine(i, o, 5592575, 10), this.setLookTargetPosition(o, !0);
17474
+ Lt && z.DrawLine(i, o, 5592575, 10), this.setLookTargetPosition(o, !0);
17462
17475
  }
17463
17476
  if (!this.setLookTargetFromConstraint()) {
17464
- const i = new zr();
17477
+ const i = new Ur();
17465
17478
  i.screenPoint = new Z(0, 0), i.lineThreshold = 0.1;
17466
17479
  const n = this.context.physics.raycast(i);
17467
17480
  n.length > 0 && this.setLookTargetPosition(n[0].point, !0), HM && console.log("OrbitControls hits", ...n);
@@ -17494,8 +17507,8 @@ class ye extends R {
17494
17507
  }
17495
17508
  }
17496
17509
  if (this.targetBounds) {
17497
- const t = this._controls.target, i = this.targetBounds.worldPosition, n = z(this.targetBounds.worldScale).multiplyScalar(0.5), o = z(i).sub(n), r = z(i).add(n), a = z(this._controls.target).clamp(o, r), l = 0.1;
17498
- t.lerp(a, this.context.time.deltaTime / l), this._lookTargetLerpActive && this._lookTargetEndPosition.lerp(a, this.context.time.deltaTime / (l * 5)), Lt && U.DrawWireBox(i, n.multiplyScalar(2), 16755200);
17510
+ const t = this._controls.target, i = this.targetBounds.worldPosition, n = U(this.targetBounds.worldScale).multiplyScalar(0.5), o = U(i).sub(n), r = U(i).add(n), a = U(this._controls.target).clamp(o, r), l = 0.1;
17511
+ t.lerp(a, this.context.time.deltaTime / l), this._lookTargetLerpActive && this._lookTargetEndPosition.lerp(a, this.context.time.deltaTime / (l * 5)), Lt && z.DrawWireBox(i, n.multiplyScalar(2), 16755200);
17499
17512
  }
17500
17513
  if (this._controls) {
17501
17514
  this.debugLog && (this._controls.domElement = this.context.renderer.domElement);
@@ -17505,7 +17518,7 @@ class ye extends R {
17505
17518
  const i = typeof $h == "number" ? $h : 0.99;
17506
17519
  this._controls.dampingFactor = Math.max(1e-3, 1 - Math.min(1, i));
17507
17520
  }
17508
- this.allowInterrupt || (this._lookTargetLerpActive && (this._controls.enablePan = !1), this._cameraLerpActive && (this._controls.enableRotate = !1, this._controls.autoRotate = !1), (this._lookTargetLerpActive || this._cameraLerpActive) && (this._controls.enableZoom = !1)), this.context.isInXR || (!op && this.lookAtConstraint?.locked && !this._lookTargetLerpActive && this.setLookTargetFromConstraint(0, this.lookAtConstraint01), this._controls.update(this.context.time.deltaTime), Lt && U.DrawWireSphere(this._controls.target, 0.1, 65280));
17521
+ this.allowInterrupt || (this._lookTargetLerpActive && (this._controls.enablePan = !1), this._cameraLerpActive && (this._controls.enableRotate = !1, this._controls.autoRotate = !1), (this._lookTargetLerpActive || this._cameraLerpActive) && (this._controls.enableZoom = !1)), this.context.isInXR || (!op && this.lookAtConstraint?.locked && !this._lookTargetLerpActive && this.setLookTargetFromConstraint(0, this.lookAtConstraint01), this._controls.update(this.context.time.deltaTime), Lt && z.DrawWireSphere(this._controls.target, 0.1, 65280));
17509
17522
  }
17510
17523
  }
17511
17524
  __onPreRender = () => {
@@ -17534,7 +17547,7 @@ class ye extends R {
17534
17547
  const i = e.worldPosition, n = e.worldForward;
17535
17548
  e instanceof wS && (Lt && console.debug("[OrbitControls] setCameraAndLookTarget flip forward direction for camera"), n.multiplyScalar(-1));
17536
17549
  const o = new Rs(i, n);
17537
- return Lt && U.DrawRay(o.origin, o.direction, 16711680, 10), this.setTargetFromRaycast(o, t) || this.setLookTargetPosition(o.at(2, z()), t), this.setCameraTargetPosition(i, t), !0;
17550
+ return Lt && z.DrawRay(o.origin, o.direction, 16711680, 10), this.setTargetFromRaycast(o, t) || this.setLookTargetPosition(o.at(2, U()), t), this.setCameraTargetPosition(i, t), !0;
17538
17551
  }
17539
17552
  /** Moves the camera to position smoothly.
17540
17553
  * @param position The position in local space of the controllerObject to move the camera to. If null the camera will stop lerping to the target.
@@ -17585,7 +17598,7 @@ class ye extends R {
17585
17598
  * @param immediateOrDuration If true the camera target will move immediately to the new position, otherwise it will lerp. If a number is passed in it will be used as the duration of the lerp.
17586
17599
  */
17587
17600
  setLookTargetPosition(e = null, t = !1) {
17588
- this._controls && e && (e instanceof M && (e = te(e)), this._lookTargetEndPosition.copy(e), this._didSetTarget++, Lt && (console.warn("OrbitControls: setLookTargetPosition", e, t), U.DrawWireSphere(this._lookTargetEndPosition, 0.2, 16711680, 2)), t === !0 ? this.lerpLookTarget(this._lookTargetEndPosition, this._lookTargetEndPosition, 1) : (this._lookTargetLerpActive = !0, this._lookTargetLerp01 = 0, this._lookTargetStartPosition.copy(this._controls.target), typeof t == "number" ? this._lookTargetLerpDuration = t : this._lookTargetLerpDuration = this.targetLerpDuration));
17601
+ this._controls && e && (e instanceof M && (e = te(e)), this._lookTargetEndPosition.copy(e), this._didSetTarget++, Lt && (console.warn("OrbitControls: setLookTargetPosition", e, t), z.DrawWireSphere(this._lookTargetEndPosition, 0.2, 16711680, 2)), t === !0 ? this.lerpLookTarget(this._lookTargetEndPosition, this._lookTargetEndPosition, 1) : (this._lookTargetLerpActive = !0, this._lookTargetLerp01 = 0, this._lookTargetStartPosition.copy(this._controls.target), typeof t == "number" ? this._lookTargetLerpDuration = t : this._lookTargetLerpDuration = this.targetLerpDuration));
17589
17602
  }
17590
17603
  /** True while the camera look target is being lerped */
17591
17604
  get lookTargetLerpActive() {
@@ -17941,7 +17954,7 @@ const so = x("debugcam"), hb = x("debugscreenpointtoray"), $t = class Jl extends
17941
17954
  const t = e.clientX, i = e.clientY;
17942
17955
  console.log("touch", t.toFixed(2), i.toFixed(2));
17943
17956
  const n = this.screenPointToRay(t, i), o = "#" + Math.floor(Math.random() * 16777215).toString(16);
17944
- U.DrawRay(n.origin, n.direction, o, 10);
17957
+ z.DrawRay(n.origin, n.direction, o, 10);
17945
17958
  });
17946
17959
  }
17947
17960
  /** @internal */
@@ -19369,12 +19382,12 @@ Fu([
19369
19382
  Fu([
19370
19383
  u()
19371
19384
  ], nl.prototype, "eyesOpen");
19372
- var fE = Object.defineProperty, Ug = (s, e, t, i) => {
19385
+ var fE = Object.defineProperty, zg = (s, e, t, i) => {
19373
19386
  for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
19374
19387
  (r = s[o]) && (n = r(e, t, n) || n);
19375
19388
  return n && fE(e, t, n), n;
19376
19389
  };
19377
- const Uu = class aw extends R {
19390
+ const zu = class aw extends R {
19378
19391
  head = null;
19379
19392
  eyes = null;
19380
19393
  target = null;
@@ -19402,17 +19415,17 @@ const Uu = class aw extends R {
19402
19415
  }
19403
19416
  }
19404
19417
  };
19405
- Ug([
19418
+ zg([
19406
19419
  u(M)
19407
- ], Uu.prototype, "head");
19408
- Ug([
19420
+ ], zu.prototype, "head");
19421
+ zg([
19409
19422
  u(M)
19410
- ], Uu.prototype, "eyes");
19411
- Ug([
19423
+ ], zu.prototype, "eyes");
19424
+ zg([
19412
19425
  u(M)
19413
- ], Uu.prototype, "target");
19414
- let lw = Uu;
19415
- var pE = Object.defineProperty, zg = (s, e, t, i) => {
19426
+ ], zu.prototype, "target");
19427
+ let lw = zu;
19428
+ var pE = Object.defineProperty, Ug = (s, e, t, i) => {
19416
19429
  for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
19417
19430
  (r = s[o]) && (n = r(e, t, n) || n);
19418
19431
  return n && pE(e, t, n), n;
@@ -19439,13 +19452,13 @@ class Zc extends R {
19439
19452
  this._axes && this.gameObject.remove(this._axes);
19440
19453
  }
19441
19454
  }
19442
- zg([
19455
+ Ug([
19443
19456
  u()
19444
19457
  ], Zc.prototype, "length");
19445
- zg([
19458
+ Ug([
19446
19459
  u()
19447
19460
  ], Zc.prototype, "depthTest");
19448
- zg([
19461
+ Ug([
19449
19462
  u()
19450
19463
  ], Zc.prototype, "isGizmo");
19451
19464
  class cw extends R {
@@ -19493,7 +19506,7 @@ class Mt extends R {
19493
19506
  }
19494
19507
  this.updateBox();
19495
19508
  const t = this.box?.intersectsBox(Mt.testBox);
19496
- return t && gE && U.DrawWireBox3(Mt.testBox, 16711680, 5), t;
19509
+ return t && gE && z.DrawWireBox3(Mt.testBox, 16711680, 5), t;
19497
19510
  }
19498
19511
  /**
19499
19512
  * Tests if this helper's bounding box intersects with another box
@@ -19512,7 +19525,7 @@ class Mt extends R {
19512
19525
  if (this.box || (this.box = new Ci()), e || this.context.time.frameCount != this._lastMatrixUpdateFrame) {
19513
19526
  const t = this._lastMatrixUpdateFrame < 0;
19514
19527
  this._lastMatrixUpdateFrame = this.context.time.frameCount;
19515
- const i = t, n = te(this.gameObject, Mt._position, i), o = qe(this.gameObject, Mt._size);
19528
+ const i = t, n = te(this.gameObject, Mt._position, i), o = Xe(this.gameObject, Mt._size);
19516
19529
  this.box.setFromCenterAndSize(n, o);
19517
19530
  }
19518
19531
  return this.box;
@@ -19680,7 +19693,7 @@ const Ng = class hw extends Pn {
19680
19693
  const t = this.gameObject, i = t.position.clone(), n = t.quaternion.clone(), o = t.scale.clone(), r = t.parent;
19681
19694
  t.position.set(0, 0, 0), t.quaternion.set(0, 0, 0, 1), t.scale.set(1, 1, 1), t.parent = null, t.updateMatrix();
19682
19695
  const a = tn([t]);
19683
- t.position.copy(i), t.quaternion.copy(n), t.scale.copy(o), t.parent = r, e?.debug === !0 && U.DrawWireBox3(a, 16768256, 20), this.size = a.getSize(new _()) || new _(1, 1, 1), this.center = a.getCenter(new _()) || new _(0, 0, 0), this.size.length() <= 0 && this.size.set(0.01, 0.01, 0.01);
19696
+ t.position.copy(i), t.quaternion.copy(n), t.scale.copy(o), t.parent = r, e?.debug === !0 && z.DrawWireBox3(a, 16768256, 20), this.size = a.getSize(new _()) || new _(1, 1, 1), this.center = a.getCenter(new _()) || new _(0, 0, 0), this.size.length() <= 0 && this.size.set(0.01, 0.01, 0.01);
19684
19697
  }
19685
19698
  };
19686
19699
  fi([
@@ -19753,7 +19766,7 @@ fi([
19753
19766
  fi([
19754
19767
  u()
19755
19768
  ], Oo.prototype, "height");
19756
- var _E = Object.defineProperty, Us = (s, e, t, i) => {
19769
+ var _E = Object.defineProperty, zs = (s, e, t, i) => {
19757
19770
  for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
19758
19771
  (r = s[o]) && (n = r(e, t, n) || n);
19759
19772
  return n && _E(e, t, n), n;
@@ -19812,13 +19825,13 @@ class sl extends R {
19812
19825
  return this._contactVelocity;
19813
19826
  }
19814
19827
  }
19815
- Us([
19828
+ zs([
19816
19829
  u(_)
19817
19830
  ], sl.prototype, "center");
19818
- Us([
19831
+ zs([
19819
19832
  u()
19820
19833
  ], sl.prototype, "radius");
19821
- Us([
19834
+ zs([
19822
19835
  u()
19823
19836
  ], sl.prototype, "height");
19824
19837
  class Ao extends R {
@@ -19880,24 +19893,24 @@ class Ao extends R {
19880
19893
  } else this.animator?.setBool("falling", !1);
19881
19894
  }
19882
19895
  }
19883
- _raycastOptions = new zr();
19896
+ _raycastOptions = new Ur();
19884
19897
  }
19885
- Us([
19898
+ zs([
19886
19899
  u(sl)
19887
19900
  ], Ao.prototype, "controller");
19888
- Us([
19901
+ zs([
19889
19902
  u()
19890
19903
  ], Ao.prototype, "movementSpeed");
19891
- Us([
19904
+ zs([
19892
19905
  u()
19893
19906
  ], Ao.prototype, "rotationSpeed");
19894
- Us([
19907
+ zs([
19895
19908
  u()
19896
19909
  ], Ao.prototype, "jumpForce");
19897
- Us([
19910
+ zs([
19898
19911
  u()
19899
19912
  ], Ao.prototype, "doubleJumpForce");
19900
- Us([
19913
+ zs([
19901
19914
  u(Tt)
19902
19915
  ], Ao.prototype, "animator");
19903
19916
  var bE = Object.defineProperty, ol = (s, e, t, i) => {
@@ -19910,7 +19923,7 @@ Rg((s) => {
19910
19923
  const e = s.domElement.getAttribute("contactshadows") || s.domElement.getAttribute("contact-shadows");
19911
19924
  if (e != null && e != "0" && e != "false") {
19912
19925
  console.debug("Auto-creating ContactShadows because of `contactshadows` attribute");
19913
- const t = zu.auto(s), i = parseFloat(e);
19926
+ const t = Uu.auto(s), i = parseFloat(e);
19914
19927
  isNaN(i) || (t.opacity = i, t.darkness = i);
19915
19928
  }
19916
19929
  });
@@ -19985,7 +19998,7 @@ const Hr = class ec extends R {
19985
19998
  fitShadows(e = {}) {
19986
19999
  Dl && console.warn("Fitting shadows to scene"), qp(this.shadowsRoot, !1);
19987
20000
  const t = e.object || this.context.scene, i = tn(t, [this.shadowsRoot]), n = Math.max(1, this.blur / 32), o = i.max.x - i.min.x, r = i.max.z - i.min.z;
19988
- i.expandByVector(new _(n * o, 0, n * r)), Dl && U.DrawWireBox3(i, 16776960, 60), this.gameObject.parent && i.applyMatrix4(this.gameObject.parent.matrixWorld.clone().invert());
20001
+ i.expandByVector(new _(n * o, 0, n * r)), Dl && z.DrawWireBox3(i, 16776960, 60), this.gameObject.parent && i.applyMatrix4(this.gameObject.parent.matrixWorld.clone().invert());
19989
20002
  const a = i.min, l = Math.max(1e-5, (i.max.y - a.y) * 2e-3);
19990
20003
  i.max.y += l, this.shadowsRoot.position.set((a.x + i.max.x) / 2, a.y - l, (a.z + i.max.z) / 2), this.shadowsRoot.scale.set(i.max.x - a.x, i.max.y - a.y, i.max.z - a.z), e.positionOffset && (e.positionOffset.x !== void 0 && (this.shadowsRoot.position.x += e.positionOffset.x), e.positionOffset.y !== void 0 && (this.shadowsRoot.position.y += e.positionOffset.y), e.positionOffset.z !== void 0 && (this.shadowsRoot.position.z += e.positionOffset.z)), e.scaleFactor && (e.scaleFactor.x !== void 0 && (this.shadowsRoot.scale.x *= e.scaleFactor.x), e.scaleFactor.y !== void 0 && (this.shadowsRoot.scale.y *= e.scaleFactor.y), e.scaleFactor.z !== void 0 && (this.shadowsRoot.scale.z *= e.scaleFactor.z)), this.applyMinSize(), this.shadowsRoot.matrixWorldNeedsUpdate = !0, Dl && console.log("Fitted shadows to scene", this.shadowsRoot.scale.clone());
19991
20004
  }
@@ -20104,7 +20117,7 @@ ol([
20104
20117
  ol([
20105
20118
  u()
20106
20119
  ], Hr.prototype, "backfaceShadows");
20107
- let zu = Hr;
20120
+ let Uu = Hr;
20108
20121
  const fb = [], ap = new Array(), vE = x("logstats");
20109
20122
  class dw extends R {
20110
20123
  onEnable() {
@@ -20147,7 +20160,7 @@ class fw extends R {
20147
20160
  try {
20148
20161
  if (e.box) {
20149
20162
  const o = e.box, r = Mt.testBox;
20150
- U.DrawWireBox3(o, 16711680, 5), U.DrawWireBox3(r, 255, 5), console.log("DeleteBox: Destroying", this.gameObject, { deleteBoxArea: o, deletedObjectArea: r });
20163
+ z.DrawWireBox3(o, 16711680, 5), z.DrawWireBox3(r, 255, 5), console.log("DeleteBox: Destroying", this.gameObject, { deleteBoxArea: o, deletedObjectArea: r });
20151
20164
  } else
20152
20165
  console.log("DeleteBox: Destroying", this.gameObject);
20153
20166
  } catch {
@@ -20185,7 +20198,7 @@ var SE = Object.defineProperty, Gr = (s, e, t, i) => {
20185
20198
  };
20186
20199
  const Wn = x("debugdrag"), lp = [];
20187
20200
  var pw = /* @__PURE__ */ ((s) => (s[s.XZPlane = 0] = "XZPlane", s[s.Attached = 1] = "Attached", s[s.HitNormal = 2] = "HitNormal", s[s.DynamicViewAngle = 3] = "DynamicViewAngle", s[s.SnapToSurfaces = 4] = "SnapToSurfaces", s[s.None = 5] = "None", s))(pw || {});
20188
- const Io = class Ui extends R {
20201
+ const Io = class zi extends R {
20189
20202
  /**
20190
20203
  * Checks if any DragControls component is currently active with selected objects
20191
20204
  * @returns True if any DragControls component is currently active
@@ -20257,7 +20270,7 @@ const Io = class Ui extends R {
20257
20270
  }
20258
20271
  /** @internal */
20259
20272
  onEnable() {
20260
- Ui._instances.push(this), this.context.accessibility.updateElement(this, {
20273
+ zi._instances.push(this), this.context.accessibility.updateElement(this, {
20261
20274
  role: "button",
20262
20275
  label: "Drag " + (this.gameObject.name || "object"),
20263
20276
  hidden: !1
@@ -20265,7 +20278,7 @@ const Io = class Ui extends R {
20265
20278
  }
20266
20279
  /** @internal */
20267
20280
  onDisable() {
20268
- this.context.accessibility.updateElement(this, { hidden: !0 }), Ui._instances = Ui._instances.filter((e) => e !== this);
20281
+ this.context.accessibility.updateElement(this, { hidden: !0 }), zi._instances = zi._instances.filter((e) => e !== this);
20269
20282
  }
20270
20283
  onDestroy() {
20271
20284
  this.context.accessibility.removeElement(this);
@@ -20285,8 +20298,8 @@ const Io = class Ui extends R {
20285
20298
  */
20286
20299
  onPointerEnter(e) {
20287
20300
  if (!this.allowEdit(this.gameObject) || e.mode !== "screen" || (e.event.mode === "tracked-pointer" || e.event.mode === "transient-pointer" ? this.xrDragMode : this.dragMode) === 5) return;
20288
- const n = C.getComponentInParent(e.object, Ui);
20289
- !n || n !== this || (Ui.lastHovered = e.object, this.context.domElement.style.cursor = "pointer", this.context.accessibility.hover(this, `Draggable ${e.object?.name}`));
20301
+ const n = C.getComponentInParent(e.object, zi);
20302
+ !n || n !== this || (zi.lastHovered = e.object, this.context.domElement.style.cursor = "pointer", this.context.accessibility.hover(this, `Draggable ${e.object?.name}`));
20290
20303
  }
20291
20304
  /**
20292
20305
  * Handles pointer movement events. Marks the event as used if dragging is active.
@@ -20302,7 +20315,7 @@ const Io = class Ui extends R {
20302
20315
  * @internal
20303
20316
  */
20304
20317
  onPointerExit(e) {
20305
- this.allowEdit(this.gameObject) && e.mode === "screen" && Ui.lastHovered === e.object && (this.context.domElement.style.cursor = "auto");
20318
+ this.allowEdit(this.gameObject) && e.mode === "screen" && zi.lastHovered === e.object && (this.context.domElement.style.cursor = "auto");
20306
20319
  }
20307
20320
  /**
20308
20321
  * Handles pointer down events. Initiates the potential drag operation if conditions are met.
@@ -20310,8 +20323,8 @@ const Io = class Ui extends R {
20310
20323
  * @internal
20311
20324
  */
20312
20325
  onPointerDown(e) {
20313
- if (!(!this.allowEdit(this.gameObject) || e.used || (e.mode === "tracked-pointer" || e.mode === "transient-pointer" ? this.xrDragMode : this.dragMode) === 5) && (Ui.lastHovered = e.object, e.button === 0)) {
20314
- this._dragHandlers.size === 0 && (this._didDrag = !1, this._totalMovement.set(0, 0, 0), this._potentialDragStartEvt = e), this._targetObject || this.setTargetObject(this.gameObject), Ui._active += 1;
20326
+ if (!(!this.allowEdit(this.gameObject) || e.used || (e.mode === "tracked-pointer" || e.mode === "transient-pointer" ? this.xrDragMode : this.dragMode) === 5) && (zi.lastHovered = e.object, e.button === 0)) {
20327
+ this._dragHandlers.size === 0 && (this._didDrag = !1, this._totalMovement.set(0, 0, 0), this._potentialDragStartEvt = e), this._targetObject || this.setTargetObject(this.gameObject), zi._active += 1;
20315
20328
  const n = new cp(this, this._targetObject);
20316
20329
  if (this._dragHandlers.set(e.event.space, n), n.onDragStart(e), this._dragHandlers.size === 2) {
20317
20330
  const o = this._dragHandlers.values(), r = o.next().value, a = o.next().value;
@@ -20335,10 +20348,10 @@ const Io = class Ui extends R {
20335
20348
  * @internal
20336
20349
  */
20337
20350
  onPointerUp(e) {
20338
- if (Wn && U.DrawLabel(e.point ?? this.gameObject.worldPosition, "POINTERUP:" + e.pointerId + ", " + e.button, 0.03, 3), !this.allowEdit(this.gameObject) || e.button !== 0) return;
20351
+ if (Wn && z.DrawLabel(e.point ?? this.gameObject.worldPosition, "POINTERUP:" + e.pointerId + ", " + e.button, 0.03, 3), !this.allowEdit(this.gameObject) || e.button !== 0) return;
20339
20352
  this._potentialDragStartEvt = null;
20340
20353
  const t = this._dragHandlers.get(e.event.space), i = this._dragHandlers.get(this.gameObject);
20341
- i && (i.handlerA === t || i.handlerB === t) && (this._dragHandlers.delete(this.gameObject), i.onDragEnd(e)), t && (Ui._active > 0 && (Ui._active -= 1), this.setTargetObject(null), t.onDragEnd && t.onDragEnd(e), this._dragHandlers.delete(e.event.space), this._dragHandlers.size === 0 && this.onLastDragEnd(e), e.use()), this.context.accessibility.unfocus(this), this.context.accessibility.updateElement(this, {
20354
+ i && (i.handlerA === t || i.handlerB === t) && (this._dragHandlers.delete(this.gameObject), i.onDragEnd(e)), t && (zi._active > 0 && (zi._active -= 1), this.setTargetObject(null), t.onDragEnd && t.onDragEnd(e), this._dragHandlers.delete(e.event.space), this._dragHandlers.size === 0 && this.onLastDragEnd(e), e.use()), this.context.accessibility.unfocus(this), this.context.accessibility.updateElement(this, {
20342
20355
  busy: !1
20343
20356
  });
20344
20357
  }
@@ -20370,7 +20383,7 @@ const Io = class Ui extends R {
20370
20383
  */
20371
20384
  onFirstDragStart(e) {
20372
20385
  if (!e || !e.object) return;
20373
- const t = C.getComponentInParent(e.object, Ui);
20386
+ const t = C.getComponentInParent(e.object, zi);
20374
20387
  if (!t || t !== this && t._isDragging) return;
20375
20388
  const i = this._targetObject || this.gameObject;
20376
20389
  if (!i) return;
@@ -20455,7 +20468,7 @@ class CE {
20455
20468
  if (this._tempVec1.copy(this.handlerA.hitPointInLocalSpace), this._tempVec2.copy(this.handlerB.hitPointInLocalSpace), this.gameObject.localToWorld(this._tempVec1), this.gameObject.localToWorld(this._tempVec2), o && (o.worldToLocal(this._tempVec1), o.worldToLocal(this._tempVec2)), this._initialDistance = this._tempVec1.distanceTo(this._tempVec2), this._initialDistance < 0.02 ? (Wn && console.log("Finding alternative drag attachment points since initial distance is too low: " + this._initialDistance.toFixed(2)), this.handlerA.followObject.parent.getWorldPosition(this._tempVec1), this.handlerB.followObject.parent.getWorldPosition(this._tempVec2), this._handlerAAttachmentPoint.copy(this._tempVec1), this._handlerBAttachmentPoint.copy(this._tempVec2), this.gameObject.worldToLocal(this._handlerAAttachmentPoint), this.gameObject.worldToLocal(this._handlerBAttachmentPoint), this._initialDistance = this._tempVec1.distanceTo(this._tempVec2), this._initialDistance < 1e-3 && (console.warn("Not supported right now – controller drag points for multitouch are too close!"), this._initialDistance = 1)) : (this._handlerAAttachmentPoint.copy(this.handlerA.hitPointInLocalSpace), this._handlerBAttachmentPoint.copy(this.handlerB.hitPointInLocalSpace)), this._tempVec3.lerpVectors(this._tempVec1, this._tempVec2, 0.5), this._initialScale.copy(t.scale), Wn) {
20456
20469
  this._followObject.add(new Pi(2)), this._manipulatorObject.add(new Pi(5));
20457
20470
  const r = (a) => `${a.x.toFixed(2)}, ${a.y.toFixed(2)}, ${a.z.toFixed(2)}`;
20458
- U.DrawLine(this._tempVec1, this._tempVec2, 65535, 0, !1), U.DrawLabel(this._tempVec3, "A:B " + this._initialDistance.toFixed(2) + `
20471
+ z.DrawLine(this._tempVec1, this._tempVec2, 65535, 0, !1), z.DrawLabel(this._tempVec3, "A:B " + this._initialDistance.toFixed(2) + `
20459
20472
  ` + r(this._tempVec1) + `
20460
20473
  ` + r(this._tempVec2), 0.03, 5);
20461
20474
  }
@@ -20492,7 +20505,7 @@ class CE {
20492
20505
  const e = this.context.mainCamera;
20493
20506
  this.tempLookMatrix.lookAt(this._tempVec3, this._tempVec2, e.worldUp), this._manipulatorObject.quaternion.setFromRotationMatrix(this.tempLookMatrix);
20494
20507
  const t = this._tempVec1.distanceTo(this._tempVec2);
20495
- this._manipulatorObject.scale.copy(this._initialScale).multiplyScalar(t / this._initialDistance), this._manipulatorObject.updateMatrix(), this._manipulatorObject.updateMatrixWorld(!0), Wn && (U.DrawLabel(this._tempVec3.clone().add(new _(0, 0.2, 0)), "A:B " + t.toFixed(2), 0.03), U.DrawLine(this._tempVec1, this._tempVec2, 65280, 0, !1));
20508
+ this._manipulatorObject.scale.copy(this._initialScale).multiplyScalar(t / this._initialDistance), this._manipulatorObject.updateMatrix(), this._manipulatorObject.updateMatrixWorld(!0), Wn && (z.DrawLabel(this._tempVec3.clone().add(new _(0, 0.2, 0)), "A:B " + t.toFixed(2), 0.03), z.DrawLine(this._tempVec1, this._tempVec2, 65280, 0, !1));
20496
20509
  }
20497
20510
  onDragUpdate() {
20498
20511
  this.alignManipulator();
@@ -20592,7 +20605,7 @@ class cp {
20592
20605
  const t = this._hitPointInLocalSpace.clone();
20593
20606
  this.gameObject.localToWorld(t), this._grabStartDistance = t.distanceTo(e.worldPosition);
20594
20607
  const n = K.active?.rig?.gameObject?.worldScale.x || 1;
20595
- this._grabStartDistance /= n, this._totalMovementAlongRayDirection = 0, this._lastDragPosRigSpace = void 0, Wn && (U.DrawLine(t, e.worldPosition, 65280, 0.5, !1), U.DrawLabel(e.worldPosition.add(new _(0, 0.1, 0)), this._grabStartDistance.toFixed(2), 0.03, 0.5));
20608
+ this._grabStartDistance /= n, this._totalMovementAlongRayDirection = 0, this._lastDragPosRigSpace = void 0, Wn && (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));
20596
20609
  }
20597
20610
  onDragStart(e) {
20598
20611
  if (!this.gameObject) {
@@ -20646,7 +20659,7 @@ class cp {
20646
20659
  const n = e.worldForward;
20647
20660
  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), Wn) {
20648
20661
  let o = t;
20649
- i && (o = o.clone(), o.transformDirection(i.matrixWorld)), U.DrawRay(o, n, 255);
20662
+ i && (o = o.clone(), o.transformDirection(i.matrixWorld)), z.DrawRay(o, n, 255);
20650
20663
  }
20651
20664
  }
20652
20665
  onDragUpdate(e) {
@@ -20684,12 +20697,12 @@ class cp {
20684
20697
  const v = b[0];
20685
20698
  if (this._draggedOverObject === v.object ? this._draggedOverObjectDuration += this.context.time.deltaTime : (this._draggedOverObject = v.object, this._draggedOverObjectDuration = 0), v.face) {
20686
20699
  this._hasLastSurfaceHitPoint = !0, this._lastSurfaceHitPoint.copy(v.point);
20687
- const k = this._draggedOverObjectDuration >= 0.15, I = this._totalMovement.length() >= 1e-3, j = z(v.normal || v.face.normal).applyQuaternion(v.object.worldQuaternion);
20700
+ const k = this._draggedOverObjectDuration >= 0.15, I = this._totalMovement.length() >= 1e-3, j = U(v.normal || v.face.normal).applyQuaternion(v.object.worldQuaternion);
20688
20701
  if ((k || I) && (this._draggedOverObjectLastSetUp !== this._draggedOverObject || this._draggedOverObjectLastNormal.dot(j) < 0.999999 || this.context.time.frame % 60 === 0)) {
20689
20702
  this._draggedOverObjectLastSetUp = this._draggedOverObject, this._draggedOverObjectLastNormal.copy(v.face.normal);
20690
- const B = z(), G = z();
20703
+ const B = U(), G = U();
20691
20704
  this._bounds.getCenter(B), this._bounds.getSize(G), B.sub(G.multiplyScalar(0.5).multiply(j)), this._hitPointInLocalSpace.copy(B), this._hitNormalInLocalSpace.copy(v.face.normal), this._bounds.getCenter(B), this._bounds.getSize(G), B.add(G.multiplyScalar(0.5).multiply(v.face.normal));
20692
- const X = z(this._hitPointInLocalSpace).add(B);
20705
+ const X = U(this._hitPointInLocalSpace).add(B);
20693
20706
  this._followObject.localToWorld(X);
20694
20707
  const O = v.point;
20695
20708
  this._dragPlane.setFromNormalAndCoplanarPoint(j, O);
@@ -20700,8 +20713,8 @@ class cp {
20700
20713
  }
20701
20714
  if (l !== 1 && p.intersectPlane(this._dragPlane, this._tempVec)) {
20702
20715
  this._followObject.worldPosition = this._tempVec, this._followObject.updateMatrix(), this._followObject.updateMatrixWorld(!0);
20703
- const b = z(this._hitPointInLocalSpace);
20704
- this._followObject.localToWorld(b), Wn && U.DrawLine(b, this._tempVec, 65535, 0, !1), this._followObject.worldPosition = this._tempVec.multiplyScalar(2).sub(b), this._followObject.updateMatrix(), this._followObject.updateMatrix();
20716
+ const b = U(this._hitPointInLocalSpace);
20717
+ this._followObject.localToWorld(b), Wn && z.DrawLine(b, this._tempVec, 65535, 0, !1), this._followObject.worldPosition = this._tempVec.multiplyScalar(2).sub(b), this._followObject.updateMatrix(), this._followObject.updateMatrix();
20705
20718
  }
20706
20719
  if (this.settings.snapGridResolution > 0) {
20707
20720
  const b = this._followObject.worldPosition, v = this.settings.snapGridResolution;
@@ -20713,9 +20726,9 @@ class cp {
20713
20726
  const w = t.worldQuaternion;
20714
20727
  if (w.slerp(this._followObject.worldQuaternion, y), t.worldQuaternion = w, t.matrixAutoUpdate === !1 && t.updateMatrix(), Wn) {
20715
20728
  const b = this._hitPointInLocalSpace.clone();
20716
- t.localToWorld(b), U.DrawSphere(b, 0.02, 16711680);
20729
+ t.localToWorld(b), z.DrawSphere(b, 0.02, 16711680);
20717
20730
  const v = this._hitNormalInLocalSpace.clone();
20718
- v.applyQuaternion(w), U.DrawRay(b, v, 16711680), U.DrawLabel(
20731
+ v.applyQuaternion(w), z.DrawRay(b, v, 16711680), z.DrawLabel(
20719
20732
  m.add(new _(0, 0.25, 0)),
20720
20733
  `Distance: ${this._totalMovement.length().toFixed(2)}
20721
20734
 
@@ -20729,7 +20742,7 @@ class cp {
20729
20742
  0.03
20730
20743
  );
20731
20744
  const T = this._bottomCenter.clone(), k = this._backCenter.clone(), E = this._backBottomCenter.clone();
20732
- t.localToWorld(T), t.localToWorld(k), t.localToWorld(E), U.DrawSphere(T, 0.01, 65280, 0, !1), U.DrawSphere(k, 0.01, 255, 0, !1), U.DrawSphere(E, 0.01, 16711935, 0, !1), U.DrawLine(T, E, 65535, 0, !1), U.DrawLine(E, k, 65535, 0, !1);
20745
+ t.localToWorld(T), t.localToWorld(k), t.localToWorld(E), z.DrawSphere(T, 0.01, 65280, 0, !1), z.DrawSphere(k, 0.01, 255, 0, !1), z.DrawSphere(E, 0.01, 16711935, 0, !1), z.DrawLine(T, E, 65535, 0, !1), z.DrawLine(E, k, 65535, 0, !1);
20733
20746
  }
20734
20747
  }
20735
20748
  onDragEnd(e) {
@@ -20740,7 +20753,7 @@ class cp {
20740
20753
  setPlaneViewAligned(e, t) {
20741
20754
  if (!this._followObject.parent)
20742
20755
  return !1;
20743
- const i = this._followObject.parent.worldForward, n = z(0, 1, 0), o = i, r = n.angleTo(o), a = 0.5;
20756
+ const i = this._followObject.parent.worldForward, n = U(0, 1, 0), o = i, r = n.angleTo(o), a = 0.5;
20744
20757
  return t && (r > Math.PI / 2 + a || r < Math.PI / 2 - a) ? this._dragPlane.setFromNormalAndCoplanarPoint(n, e) : this._dragPlane.setFromNormalAndCoplanarPoint(i, e), !0;
20745
20758
  }
20746
20759
  }
@@ -20782,7 +20795,7 @@ class mw {
20782
20795
  static geometry = new yn().setFromPoints([new _(0, 0, 0), new _(0, -1, 0)]);
20783
20796
  constructor(e) {
20784
20797
  this._camera = e;
20785
- const t = new Ua(mw.geometry), i = t.material;
20798
+ const t = new za(mw.geometry), i = t.material;
20786
20799
  i.color = new re(0.4, 0.4, 0.4), t.layers.set(2), t.name = "line", t.scale.y = 1, this._groundLine = t;
20787
20800
  const n = new fu(0.5, 22, 22), o = new Se({ color: i.color }), r = new H(n, o);
20788
20801
  r.visible = !1, r.layers.set(2), this._groundMarker = r;
@@ -20824,14 +20837,14 @@ class mw {
20824
20837
  }
20825
20838
  onUpdateGroundPlane() {
20826
20839
  if (!this._selected || !this._context) return;
20827
- const e = te(this._selected), t = new Rs(z(0, 0.1, 0).add(e), z(0, -1, 0)), i = new zr();
20840
+ const e = te(this._selected), t = new Rs(U(0, 0.1, 0).add(e), U(0, -1, 0)), i = new Ur();
20828
20841
  i.testObject = (o) => o !== this._selected;
20829
20842
  const n = this._context.physics.raycastFromRay(t, i);
20830
20843
  for (let o = 0; o < n.length; o++) {
20831
20844
  const r = n[o];
20832
20845
  if (!r.face || this.contains(this._selected, r.object))
20833
20846
  continue;
20834
- const a = z(0, 1, 0);
20847
+ const a = U(0, 1, 0);
20835
20848
  this._groundPlane.setFromNormalAndCoplanarPoint(a, r.point);
20836
20849
  break;
20837
20850
  }
@@ -21127,9 +21140,9 @@ function dp(s) {
21127
21140
  case 0:
21128
21141
  return NS;
21129
21142
  case 1:
21130
- return zS;
21131
- case 2:
21132
21143
  return US;
21144
+ case 2:
21145
+ return zS;
21133
21146
  case 3:
21134
21147
  return FS;
21135
21148
  case 4:
@@ -21146,7 +21159,7 @@ function dp(s) {
21146
21159
  function TE(s) {
21147
21160
  switch (s) {
21148
21161
  case 1:
21149
- return Uy;
21162
+ return zy;
21150
21163
  case 2:
21151
21164
  return IS;
21152
21165
  case 3:
@@ -21162,7 +21175,7 @@ function TE(s) {
21162
21175
  case 8:
21163
21176
  return OS;
21164
21177
  }
21165
- return Uy;
21178
+ return zy;
21166
21179
  }
21167
21180
  const AE = "NEEDLE_render_objects";
21168
21181
  class IE {
@@ -21573,18 +21586,18 @@ async function BE(s, e) {
21573
21586
  return d;
21574
21587
  }).catch((d) => (console.warn("Failed to load texture from url:", s), null));
21575
21588
  }
21576
- var FE = Object.defineProperty, UE = Object.getOwnPropertyDescriptor, $u = (s, e, t, i) => {
21577
- for (var n = i > 1 ? void 0 : i ? UE(e, t) : e, o = s.length - 1, r; o >= 0; o--)
21589
+ var FE = Object.defineProperty, zE = Object.getOwnPropertyDescriptor, $u = (s, e, t, i) => {
21590
+ for (var n = i > 1 ? void 0 : i ? zE(e, t) : e, o = s.length - 1, r; o >= 0; o--)
21578
21591
  (r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
21579
21592
  return i && n && FE(e, t, n), n;
21580
21593
  };
21581
- const ia = x("debugreflectionprobe"), bb = x("noreflectionprobe"), zE = /* @__PURE__ */ Symbol("reflectionProbeKey"), eh = class ro extends R {
21594
+ const ia = x("debugreflectionprobe"), bb = x("noreflectionprobe"), UE = /* @__PURE__ */ Symbol("reflectionProbeKey"), eh = class ro extends R {
21582
21595
  static _probes = /* @__PURE__ */ new Map();
21583
21596
  /**
21584
21597
  * Checks if the given material is currently using a reflection probe. This is determined by checking for an override on the material's "envMap" property, which is set by the Renderer component when applying a reflection probe.
21585
21598
  */
21586
21599
  static isUsingReflectionProbe(e) {
21587
- return !!e[zE];
21600
+ return !!e[UE];
21588
21601
  }
21589
21602
  /**
21590
21603
  * Event invoked when a reflection probe is enabled. Used internally by Renderer components to update probes when they become active. Not recommended to call this directly in most cases.
@@ -21981,7 +21994,7 @@ class Cm extends R {
21981
21994
  _hemisphereLightObj;
21982
21995
  awake() {
21983
21996
  if (this.sourceId) {
21984
- const t = this.environmentReflectionSource === um.Skybox ? Un.Skybox : Un.Reflection, i = this.context.lightmaps.tryGet(this.sourceId, t, 0);
21997
+ const t = this.environmentReflectionSource === um.Skybox ? zn.Skybox : zn.Reflection, i = this.context.lightmaps.tryGet(this.sourceId, t, 0);
21985
21998
  this._hasReflection = i != null, i && this.context.sceneLighting.internalRegisterReflection(this.sourceId, i);
21986
21999
  }
21987
22000
  this.enabled = !1, this.context.sceneLighting.internalRegisterSceneLightSettings(this), pa && window.addEventListener("keydown", (t) => {
@@ -22055,7 +22068,7 @@ class qE extends VS {
22055
22068
  });
22056
22069
  }
22057
22070
  onLoaded(e) {
22058
- return Ur.createPrimitive("ShaderBall", { material: e });
22071
+ return zr.createPrimitive("ShaderBall", { material: e });
22059
22072
  }
22060
22073
  }
22061
22074
  class XE {
@@ -22631,7 +22644,7 @@ class tR {
22631
22644
  updateBounds(e = !0, t = !0) {
22632
22645
  if (this._needUpdateBounds = !1, e && this._batchedMesh.computeBoundingBox(), t && this._batchedMesh.computeBoundingSphere(), jt && this._batchedMesh.boundingSphere) {
22633
22646
  const i = this._batchedMesh.boundingSphere;
22634
- U.DrawWireSphere(i.center, i.radius, 65280);
22647
+ z.DrawWireSphere(i.center, i.radius, 65280);
22635
22648
  }
22636
22649
  }
22637
22650
  _context;
@@ -22661,7 +22674,7 @@ class tR {
22661
22674
  constructor(e, t, i, n, o) {
22662
22675
  this.name = e, this.geometry = t, this.material = i, this._context = o, this._maxInstanceCount = Math.max(2, n), jt && (this._debugMaterial = xb());
22663
22676
  const r = this.tryEstimateVertexCountSize(this._maxInstanceCount, [t], n);
22664
- this._maxVertexCount = r.vertexCount, this._maxIndexCount = r.indexCount, this._batchedMesh = new zy(this._maxInstanceCount, this._maxVertexCount, this._maxIndexCount, this._debugMaterial ?? this.material), this._batchedMesh.name = this.getBatchedMeshName(), this._batchedMesh[Kl] = !0, this._batchedMesh.visible = !0, this._context.scene.add(this._batchedMesh), i instanceof wv && (i.defines.USE_INSTANCING = !0, i.needsUpdate = !0), o.pre_render_callbacks.push(this.onBeforeRender), o.post_render_callbacks.push(this.onAfterRender), jt && console.log(`Instanced renderer (${this.name}) created with ${this._maxInstanceCount} instances, ${this._maxVertexCount} max vertices and ${this._maxIndexCount} max indices for "${e}"`);
22677
+ this._maxVertexCount = r.vertexCount, this._maxIndexCount = r.indexCount, this._batchedMesh = new Uy(this._maxInstanceCount, this._maxVertexCount, this._maxIndexCount, this._debugMaterial ?? this.material), this._batchedMesh.name = this.getBatchedMeshName(), this._batchedMesh[Kl] = !0, this._batchedMesh.visible = !0, this._context.scene.add(this._batchedMesh), i instanceof wv && (i.defines.USE_INSTANCING = !0, i.needsUpdate = !0), o.pre_render_callbacks.push(this.onBeforeRender), o.post_render_callbacks.push(this.onAfterRender), jt && console.log(`Instanced renderer (${this.name}) created with ${this._maxInstanceCount} instances, ${this._maxVertexCount} max vertices and ${this._maxIndexCount} max indices for "${e}"`);
22665
22678
  }
22666
22679
  dispose() {
22667
22680
  jt && console.warn("Dispose instanced renderer", this.name), this._context.scene.remove(this._batchedMesh), this._batchedMesh.dispose(), this._batchedMesh = null, this._handles = [];
@@ -22742,7 +22755,7 @@ Max count ${this._maxInstanceCount} → ${o}
22742
22755
  Max vertex count ${this._maxVertexCount.toLocaleString()} -> ${l.toLocaleString()}
22743
22756
  Max index count ${this._maxIndexCount.toLocaleString()} -> ${c.toLocaleString()}`);
22744
22757
  this._maxVertexCount = l, this._maxIndexCount = c;
22745
- const h = new zy(o, this._maxVertexCount, this._maxIndexCount, this._debugMaterial ?? this.material);
22758
+ const h = new Uy(o, this._maxVertexCount, this._maxIndexCount, this._debugMaterial ?? this.material);
22746
22759
  h.name = this.getBatchedMeshName(), h.layers = this._batchedMesh.layers, h.castShadow = this._batchedMesh.castShadow, h.receiveShadow = this._batchedMesh.receiveShadow, h.visible = this._batchedMesh.visible, h[Kl] = this._batchedMesh[Kl], h.matrixAutoUpdate = this._batchedMesh.matrixAutoUpdate, h.matrixWorldNeedsUpdate = this._batchedMesh.matrixWorldNeedsUpdate, h.matrixAutoUpdate = this._batchedMesh.matrixAutoUpdate, h.matrixWorld.copy(this._batchedMesh.matrixWorld), h.matrix.copy(this._batchedMesh.matrix), this._batchedMesh.dispose(), this._batchedMesh.removeFromParent(), this._geometryIds = /* @__PURE__ */ new WeakMap(), this._batchedMesh = h, this._maxInstanceCount = o;
22747
22760
  const d = [...this._handles];
22748
22761
  this._handles = [];
@@ -22955,7 +22968,7 @@ Texture:`, i), this.setLightmapDebugMaterial()) : Hh && console.log("Use debugli
22955
22968
  });
22956
22969
  }
22957
22970
  }
22958
- var iR = Object.defineProperty, zs = (s, e, t, i) => {
22971
+ var iR = Object.defineProperty, Us = (s, e, t, i) => {
22959
22972
  for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
22960
22973
  (r = s[o]) && (n = r(e, t, n) || n);
22961
22974
  return n && iR(e, t, n), n;
@@ -23298,8 +23311,8 @@ const es = class xd extends R {
23298
23311
  if (this.gameObject) {
23299
23312
  if ((this._probeAnchorLastFrame !== this.probeAnchor || this._reflectionProbe?.activeAndEnabled === !1) && (this._reflectionProbe?.unapply(this.gameObject), this.updateReflectionProbe()), ma == this.name && this.gameObject instanceof H) {
23300
23313
  this.gameObject.geometry.computeBoundingSphere();
23301
- const e = z(this.gameObject.geometry.boundingSphere.center).applyMatrix4(this.gameObject.matrixWorld);
23302
- U.DrawWireSphere(e, this.gameObject.geometry.boundingSphere.radius, 56831);
23314
+ const e = U(this.gameObject.geometry.boundingSphere.center).applyMatrix4(this.gameObject.matrixWorld);
23315
+ z.DrawWireSphere(e, this.gameObject.geometry.boundingSphere.radius, 56831);
23303
23316
  }
23304
23317
  if (this.isMultiMaterialObject(this.gameObject) && this.gameObject.children?.length > 0)
23305
23318
  for (const e of this.gameObject.children)
@@ -23372,31 +23385,31 @@ const es = class xd extends R {
23372
23385
  return e.type === "Mesh" || e.type === "SkinnedMesh";
23373
23386
  }
23374
23387
  };
23375
- zs([
23388
+ Us([
23376
23389
  u()
23377
23390
  ], es.prototype, "receiveShadows");
23378
- zs([
23391
+ Us([
23379
23392
  u()
23380
23393
  ], es.prototype, "shadowCastingMode");
23381
- zs([
23394
+ Us([
23382
23395
  u()
23383
23396
  ], es.prototype, "lightmapIndex");
23384
- zs([
23397
+ Us([
23385
23398
  u(ge)
23386
23399
  ], es.prototype, "lightmapScaleOffset");
23387
- zs([
23400
+ Us([
23388
23401
  u()
23389
23402
  ], es.prototype, "enableInstancing");
23390
- zs([
23403
+ Us([
23391
23404
  u()
23392
23405
  ], es.prototype, "renderOrder");
23393
- zs([
23406
+ Us([
23394
23407
  u()
23395
23408
  ], es.prototype, "allowOcclusionWhenDynamic");
23396
- zs([
23409
+ Us([
23397
23410
  u(M)
23398
23411
  ], es.prototype, "probeAnchor");
23399
- zs([
23412
+ Us([
23400
23413
  u()
23401
23414
  ], es.prototype, "reflectionProbeUsage");
23402
23415
  let di = es;
@@ -23426,8 +23439,8 @@ class Cw extends Wu {
23426
23439
  if (Cb) {
23427
23440
  for (const e of this.sharedMeshes)
23428
23441
  if (e instanceof yo && e.boundingSphere) {
23429
- const t = z(e.boundingSphere.center).applyMatrix4(e.matrixWorld);
23430
- U.DrawWireSphere(t, e.boundingSphere.radius, "red");
23442
+ const t = U(e.boundingSphere.center).applyMatrix4(e.matrixWorld);
23443
+ z.DrawWireSphere(t, e.boundingSphere.radius, "red");
23431
23444
  }
23432
23445
  }
23433
23446
  }
@@ -23649,14 +23662,14 @@ class Lo extends R {
23649
23662
  this.removePreviouslyAddedObjects();
23650
23663
  const r = n.scene;
23651
23664
  r.position.copy(this.gameObject.worldPosition);
23652
- const a = qe(this.gameObject);
23665
+ const a = Xe(this.gameObject);
23653
23666
  let l = new _(0, 0, 0);
23654
23667
  a.x = Math.abs(a.x), a.y = Math.abs(a.y), a.z = Math.abs(a.z);
23655
23668
  let c = r.scale.clone();
23656
23669
  const h = new Ci().setFromCenterAndSize(new _(0, this.fitVolumeSize.y * a.y * 0.5, 0).add(this.gameObject.worldPosition), this.fitVolumeSize.clone().multiply(a));
23657
- if (Bt && U.DrawWireBox3(h, 255, 5), this.fitIntoVolume && (H1(r, h, {
23670
+ if (Bt && z.DrawWireBox3(h, 255, 5), this.fitIntoVolume && (H1(r, h, {
23658
23671
  position: !this.placeAtHitPosition
23659
- }), c = r.scale.clone().divide(a), l = r.worldPosition.clone().sub(this.gameObject.worldPosition).divide(a), Bt && U.DrawSphere(l, 0.1, 16711680, 5)), this.gameObject.attach(r), r.position.copy(l), r.quaternion.identity(), r.scale.copy(c), Bt && U.DrawArrow(this.gameObject.worldPosition, r.getWorldPosition(new _()), 65280, 5), this._addedObjects.push(r), this._addedModels.push(n), this.placeAtHitPosition && t && t.screenposition) {
23672
+ }), c = r.scale.clone().divide(a), l = r.worldPosition.clone().sub(this.gameObject.worldPosition).divide(a), Bt && z.DrawSphere(l, 0.1, 16711680, 5)), this.gameObject.attach(r), r.position.copy(l), r.quaternion.identity(), r.scale.copy(c), Bt && z.DrawArrow(this.gameObject.worldPosition, r.getWorldPosition(new _()), 65280, 5), this._addedObjects.push(r), this._addedModels.push(n), this.placeAtHitPosition && t && t.screenposition) {
23660
23673
  r.visible = !1;
23661
23674
  const f = this.context.physics.raycast({ screenPoint: this.context.input.convertScreenspaceToRaycastSpace(t.screenposition.clone()) });
23662
23675
  if (r.visible = !0, f && f.length > 0)
@@ -23752,7 +23765,7 @@ function cR(s) {
23752
23765
  var tu;
23753
23766
  ((s) => {
23754
23767
  async function e(i, n, o) {
23755
- const r = o.guid, a = new Ut(r), l = new Blob([i], { type: i.type || kE(i.name) || void 0 }), c = URL.createObjectURL(l), h = await Qn().loadSync(n, c, i.name, a).catch((d) => (console.error(`Failed to load file "${i.name}" (${i.type}):`, d), null));
23768
+ const r = o.guid, a = new zt(r), l = new Blob([i], { type: i.type || kE(i.name) || void 0 }), c = URL.createObjectURL(l), h = await Qn().loadSync(n, c, i.name, a).catch((d) => (console.error(`Failed to load file "${i.name}" (${i.type}):`, d), null));
23756
23769
  return URL.revokeObjectURL(c), h ? new Promise((d, f) => {
23757
23770
  const p = new FileReader();
23758
23771
  p.readAsArrayBuffer(i), p.onloadend = async (g) => {
@@ -23764,8 +23777,8 @@ var tu;
23764
23777
  s.loadFile = e;
23765
23778
  async function t(i, n) {
23766
23779
  return new Promise(async (o, r) => {
23767
- const a = new Ut(n.guid), l = i.toString();
23768
- Bt && U.DrawWireSphere(n.point, 0.1, 16711680, 3);
23780
+ const a = new zt(n.guid), l = i.toString();
23781
+ Bt && z.DrawWireSphere(n.point, 0.1, 16711680, 3);
23769
23782
  const c = dr.addPreview({
23770
23783
  guid: n.guid,
23771
23784
  parent: n.parent,
@@ -23798,7 +23811,7 @@ const Vu = class Pw extends R {
23798
23811
  start() {
23799
23812
  if (this._currentCount = 0, this._startPosition = null, this._startQuaternion = null, this.object || (this.object = this.gameObject), this.object) {
23800
23813
  if (this.object === this.gameObject) {
23801
- const t = new Ut(this.guid);
23814
+ const t = new zt(this.guid);
23802
23815
  this.object = C.instantiate(this.object, { idProvider: t, keepWorldPosition: !1 }), C.getComponent(this.object, Pw)?.destroy();
23803
23816
  let n = this.object.getComponentInChildren(xa);
23804
23817
  n || (n = this.object.addComponent(xa, {
@@ -23950,7 +23963,7 @@ class Mw {
23950
23963
  }
23951
23964
  class uR extends Mw {
23952
23965
  beforeWriteNode(e, t) {
23953
- U.isGizmo(e) && (t.keep = !1);
23966
+ z.isGizmo(e) && (t.keep = !1);
23954
23967
  }
23955
23968
  }
23956
23969
  class Ew extends Mw {
@@ -24934,7 +24947,7 @@ async function MR(s, e) {
24934
24947
  he.start("export-usdz-resources", "export-usdz");
24935
24948
  const t = [];
24936
24949
  for (const c of s.document.children)
24937
- Uw(c, s, t);
24950
+ zw(c, s, t);
24938
24951
  const i = t.length;
24939
24952
  for (let c = 0; c < i; c++)
24940
24953
  he.report("export-usdz-resources", { totalSteps: i, currentStep: c }), await new Promise((h, d) => {
@@ -24953,12 +24966,12 @@ async function MR(s, e) {
24953
24966
  }, a = r(s.document);
24954
24967
  he.start("export-usdz-xforms", "export-usdz"), he.report("export-usdz-xforms", { totalSteps: a, currentStep: 1 });
24955
24968
  for (const c of s.document.children)
24956
- zw(c, n, s);
24969
+ Uw(c, n, s);
24957
24970
  he.end("export-usdz-xforms"), he.report("export-usdz", "invoke onAfterHierarchy"), await Sd(s, "onAfterHierarchy", n), n.closeBlock(), n.closeBlock(), he.report("export-usdz", "Building materials");
24958
24971
  const l = FR(s.materials, s.textures, e.quickLookCompatible);
24959
24972
  n.appendLine(l), n.closeBlock(), he.report("export-usdz", "write to string"), s.output += n.toString();
24960
24973
  }
24961
- function Uw(s, e, t) {
24974
+ function zw(s, e, t) {
24962
24975
  if (!s) return;
24963
24976
  const i = s.geometry, n = s.material;
24964
24977
  if (i)
@@ -24975,7 +24988,7 @@ function Uw(s, e, t) {
24975
24988
  console.warn("NeedleUSDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)", n?.name);
24976
24989
  n && e.materials.get(n.uuid) === void 0 && (e.materials[n.uuid] = n);
24977
24990
  for (const o of s.children)
24978
- Uw(o, e, t);
24991
+ zw(o, e, t);
24979
24992
  }
24980
24993
  async function Sd(s, e, t = null) {
24981
24994
  if (s.extensions) {
@@ -25091,7 +25104,7 @@ function Ba(s, e) {
25091
25104
  t = Mb(i) + "/" + t, i = i.parent;
25092
25105
  return t;
25093
25106
  }
25094
- function zw(s, e, t) {
25107
+ function Uw(s, e, t) {
25095
25108
  if (s == null)
25096
25109
  return;
25097
25110
  he.report("export-usdz-xforms", { message: "buildXform " + s.displayName || s.name, autoStep: !0 });
@@ -25115,7 +25128,7 @@ function zw(s, e, t) {
25115
25128
  if (s.children) {
25116
25129
  e.appendLine();
25117
25130
  for (const p of s.children)
25118
- zw(p, e, t);
25131
+ Uw(p, e, t);
25119
25132
  }
25120
25133
  e.closeBlock();
25121
25134
  }
@@ -25302,7 +25315,7 @@ function FR(s, e, t = !1) {
25302
25315
  const i = [];
25303
25316
  for (const n in s) {
25304
25317
  const o = s[n];
25305
- i.push(UR(o, e, t));
25318
+ i.push(zR(o, e, t));
25306
25319
  }
25307
25320
  return `
25308
25321
  def "Materials"
@@ -25310,11 +25323,11 @@ function FR(s, e, t = !1) {
25310
25323
  ${i.join("")}
25311
25324
  }`;
25312
25325
  }
25313
- function zi(s) {
25326
+ function Ui(s) {
25314
25327
  return Zi(s.name) + "_" + (s.source?.id ?? s.id);
25315
25328
  }
25316
25329
  function Xs(s, e, t, i, n, o, r = void 0, a = void 0) {
25317
- const l = zi(s), c = l + (a !== void 0 && a !== 1 ? "_" + a : ""), h = t && a !== void 0 && a !== 1, d = h ? new ge(1, 1, 1, a) : void 0;
25330
+ const l = Ui(s), c = l + (a !== void 0 && a !== 1 ? "_" + a : ""), h = t && a !== void 0 && a !== 1, d = h ? new ge(1, 1, 1, a) : void 0;
25318
25331
  a === void 0 && (a = 1), h && (a = 1), d && d.w <= 0.05 && (d.w = 0.05), i[c] = { texture: s, scale: d };
25319
25332
  const f = s.channel > 0 ? "st" + s.channel : "st";
25320
25333
  o.add(s.channel);
@@ -25365,7 +25378,7 @@ function Xs(s, e, t, i, n, o, r = void 0, a = void 0) {
25365
25378
  ${n.transparent || n.alphaTest > 0 ? "float outputs:a" : ""}
25366
25379
  }`;
25367
25380
  }
25368
- function UR(s, e, t = !1) {
25381
+ function zR(s, e, t = !1) {
25369
25382
  const i = Hu(s);
25370
25383
  if (s.colorWrite === !1 || s.userData?.isShadowCatcherMaterial || s.userData?.isLightBlendMaterial) {
25371
25384
  const f = s.userData.isLightBlendMaterial || s.userData.isShadowCatcherMaterial ? "ND_realitykit_shadowreceiver_surfaceshader" : "ND_realitykit_occlusion_surfaceshader";
@@ -25388,18 +25401,18 @@ function UR(s, e, t = !1) {
25388
25401
  if (s.isMeshPhysicalNodeMaterial === !0)
25389
25402
  return yR(s, i, e);
25390
25403
  let c = s.transparent || s.alphaTest ? s.opacity : 1, h = !1, d = !1;
25391
- if (s instanceof Ny && s.transmission !== void 0 && (c *= 1 - s.transmission * (1 - s.roughness * 0.5)), s.map ? (r.push(`${o}color3f inputs:diffuseColor.connect = ${Xt}/${i}/${zi(s.map)}_diffuse.outputs:rgb>`), s instanceof Se && s.transparent && s.alphaTest == 0 && t ? (r.push(`${o}float inputs:opacity.connect = ${Xt}/${i}/${zi(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 = ${Xt}/${i}/${zi(s.map)}_diffuse.outputs:a>`), h = !0) : s.alphaTest > 0 && (r.push(`${o}float inputs:opacity.connect = ${Xt}/${i}/${zi(s.map)}_diffuse.outputs:a>`), h = !0, r.push(`${o}float inputs:opacityThreshold = ${s.alphaTest}`), d = !0), a.push(Xs(s.map, "diffuse", t, e, s, l, s.color, c))) : r.push(`${o}color3f inputs:diffuseColor = ${Tb(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 = ${Xt}/${i}/${zi(s.aoMap)}_occlusion.outputs:r>`), a.push(Xs(s.aoMap, "occlusion", t, e, s, l))), s.alphaMap ? (r.push(`${o}float inputs:opacity.connect = ${Xt}/${i}/${zi(s.alphaMap)}_opacity.outputs:r>`), r.push(`${o}float inputs:opacityThreshold = 0.0000000001`), h = !0, d = !0, a.push(Xs(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 pt) {
25404
+ if (s instanceof Ny && s.transmission !== void 0 && (c *= 1 - s.transmission * (1 - s.roughness * 0.5)), s.map ? (r.push(`${o}color3f inputs:diffuseColor.connect = ${Xt}/${i}/${Ui(s.map)}_diffuse.outputs:rgb>`), s instanceof Se && s.transparent && s.alphaTest == 0 && t ? (r.push(`${o}float inputs:opacity.connect = ${Xt}/${i}/${Ui(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 = ${Xt}/${i}/${Ui(s.map)}_diffuse.outputs:a>`), h = !0) : s.alphaTest > 0 && (r.push(`${o}float inputs:opacity.connect = ${Xt}/${i}/${Ui(s.map)}_diffuse.outputs:a>`), h = !0, r.push(`${o}float inputs:opacityThreshold = ${s.alphaTest}`), d = !0), a.push(Xs(s.map, "diffuse", t, e, s, l, s.color, c))) : r.push(`${o}color3f inputs:diffuseColor = ${Tb(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 = ${Xt}/${i}/${Ui(s.aoMap)}_occlusion.outputs:r>`), a.push(Xs(s.aoMap, "occlusion", t, e, s, l))), s.alphaMap ? (r.push(`${o}float inputs:opacity.connect = ${Xt}/${i}/${Ui(s.alphaMap)}_opacity.outputs:r>`), r.push(`${o}float inputs:opacityThreshold = 0.0000000001`), h = !0, d = !0, a.push(Xs(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 pt) {
25392
25405
  if (s.emissiveMap) {
25393
- r.push(`${o}color3f inputs:emissiveColor.connect = ${Xt}/${i}/${zi(s.emissiveMap)}_emissive.outputs:rgb>`);
25406
+ r.push(`${o}color3f inputs:emissiveColor.connect = ${Xt}/${i}/${Ui(s.emissiveMap)}_emissive.outputs:rgb>`);
25394
25407
  const f = s.emissive.clone();
25395
25408
  f.multiplyScalar(s.emissiveIntensity), a.push(Xs(s.emissiveMap, "emissive", t, e, s, l, f));
25396
25409
  } else if (s.emissive?.getHex() > 0) {
25397
25410
  const f = s.emissive.clone();
25398
25411
  f.multiplyScalar(s.emissiveIntensity), r.push(`${o}color3f inputs:emissiveColor = ${Tb(f)}`);
25399
25412
  }
25400
- s.normalMap && (r.push(`${o}normal3f inputs:normal.connect = ${Xt}/${i}/${zi(s.normalMap)}_normal.outputs:rgb>`), a.push(Xs(s.normalMap, "normal", t, e, s, l))), s.roughnessMap && s.roughness === 1 ? (r.push(`${o}float inputs:roughness.connect = ${Xt}/${i}/${zi(s.roughnessMap)}_roughness.outputs:g>`), a.push(Xs(s.roughnessMap, "roughness", t, e, s, l))) : r.push(`${o}float inputs:roughness = ${s.roughness !== void 0 ? s.roughness : 1}`), s.metalnessMap && s.metalness === 1 ? (r.push(`${o}float inputs:metallic.connect = ${Xt}/${i}/${zi(s.metalnessMap)}_metallic.outputs:b>`), a.push(Xs(s.metalnessMap, "metallic", t, e, s, l))) : r.push(`${o}float inputs:metallic = ${s.metalness !== void 0 ? s.metalness : 0}`);
25413
+ s.normalMap && (r.push(`${o}normal3f inputs:normal.connect = ${Xt}/${i}/${Ui(s.normalMap)}_normal.outputs:rgb>`), a.push(Xs(s.normalMap, "normal", t, e, s, l))), s.roughnessMap && s.roughness === 1 ? (r.push(`${o}float inputs:roughness.connect = ${Xt}/${i}/${Ui(s.roughnessMap)}_roughness.outputs:g>`), a.push(Xs(s.roughnessMap, "roughness", t, e, s, l))) : r.push(`${o}float inputs:roughness = ${s.roughness !== void 0 ? s.roughness : 1}`), s.metalnessMap && s.metalness === 1 ? (r.push(`${o}float inputs:metallic.connect = ${Xt}/${i}/${Ui(s.metalnessMap)}_metallic.outputs:b>`), a.push(Xs(s.metalnessMap, "metallic", t, e, s, l))) : r.push(`${o}float inputs:metallic = ${s.metalness !== void 0 ? s.metalness : 0}`);
25401
25414
  }
25402
- return s instanceof Ny && (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 = ${Xt}/${i}/${zi(s.transmissionMap)}_transmission.outputs:r>`), a.push(Xs(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."), `
25415
+ return s instanceof Ny && (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 = ${Xt}/${i}/${Ui(s.transmissionMap)}_transmission.outputs:r>`), a.push(Xs(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."), `
25403
25416
 
25404
25417
  def Material "${i}" ${s.name ? `(
25405
25418
  displayName = "${Iw(s.name)}"
@@ -25493,7 +25506,7 @@ const Qg = [
25493
25506
  // RGBA_BPTC_Format
25494
25507
  ];
25495
25508
  x("debugusdz");
25496
- class zt {
25509
+ class Ut {
25497
25510
  static global_id = 0;
25498
25511
  id;
25499
25512
  trigger;
@@ -25503,7 +25516,7 @@ class zt {
25503
25516
  return this.exclusive = e, this;
25504
25517
  }
25505
25518
  constructor(e, t, i) {
25506
- this.id = "Behavior_" + Zi(e) + "_" + zt.global_id++, this.trigger = t, this.action = i;
25519
+ this.id = "Behavior_" + Zi(e) + "_" + Ut.global_id++, this.trigger = t, this.action = i;
25507
25520
  }
25508
25521
  writeTo(e, t, i) {
25509
25522
  if (!this.trigger || !this.action) return;
@@ -25773,7 +25786,7 @@ class me {
25773
25786
  }
25774
25787
  */
25775
25788
  }
25776
- class zR {
25789
+ class UR {
25777
25790
  get id() {
25778
25791
  return this.object.uuid;
25779
25792
  }
@@ -25790,7 +25803,7 @@ class zR {
25790
25803
  this.onApply(e);
25791
25804
  }
25792
25805
  }
25793
- class $w extends zR {
25806
+ class $w extends UR {
25794
25807
  constructor(e, t, i, n) {
25795
25808
  super(e), this.matrix = t, this.material = i, this.geometry = n;
25796
25809
  }
@@ -25833,7 +25846,7 @@ class NR {
25833
25846
  return this.sortedActions || this.organize(), this.sortedActions[e.uuid];
25834
25847
  }
25835
25848
  }
25836
- const zn = x("debugusdzanimation"), Rm = x("debugusdzanimationserialization");
25849
+ const Un = x("debugusdzanimation"), Rm = x("debugusdzanimationserialization");
25837
25850
  class yr {
25838
25851
  _start;
25839
25852
  get start() {
@@ -25872,8 +25885,8 @@ class yr {
25872
25885
  let e;
25873
25886
  try {
25874
25887
  for (const t of this.clip?.tracks ?? []) {
25875
- const i = za.parseTrackName(t.name);
25876
- let n = za.findNode(this.root, i.nodeName);
25888
+ const i = Ua.parseTrackName(t.name);
25889
+ let n = Ua.findNode(this.root, i.nodeName);
25877
25890
  if (n)
25878
25891
  if (!e) e = n;
25879
25892
  else {
@@ -26084,11 +26097,11 @@ class Yg {
26084
26097
  const i = e.uuid + (t?.uuid ?? "-rest");
26085
26098
  if (this.rootAndClipToRegisteredAnimationMap.has(i))
26086
26099
  return this.rootAndClipToRegisteredAnimationMap.get(i);
26087
- zn && console.log("registerAnimation", e, t);
26100
+ Un && console.log("registerAnimation", e, t);
26088
26101
  const n = this.injectRestPoses ? 1 : 0, o = (this.rootToRegisteredClip.get(e)?.length ?? 0) + n, r = this.rootTargetMap.get(e), a = new Set(r);
26089
26102
  if (t && t.tracks)
26090
26103
  for (const c of t.tracks) {
26091
- const h = za.parseTrackName(c.name), d = za.findNode(e, h.nodeName);
26104
+ const h = Ua.parseTrackName(c.name), d = Ua.findNode(e, h.nodeName);
26092
26105
  if (!d) {
26093
26106
  console.warn("no object found for track", c.name, "using " + e.name + " instead");
26094
26107
  continue;
@@ -26103,7 +26116,7 @@ class Yg {
26103
26116
  let p = f[o];
26104
26117
  p || (p = new $e(e, d, t), f[o] = p), p.addTrack(c), r?.includes(d) || r?.push(d);
26105
26118
  }
26106
- zn && console.log("Unregistered nodes for this clip", a, "clip", t, "at slot", o, "for root", e, "targets", r);
26119
+ Un && console.log("Unregistered nodes for this clip", a, "clip", t, "at slot", o, "for root", e, "targets", r);
26107
26120
  for (const c of a) {
26108
26121
  const h = this.dict.get(c);
26109
26122
  if (!h) continue;
@@ -26113,10 +26126,10 @@ class Yg {
26113
26126
  h[0] = f;
26114
26127
  }
26115
26128
  let d = h[o];
26116
- d || (zn && console.log("Adding padding clip for ", c, t, "at slot", o), d = new $e(e, c, t), h[o] = d);
26129
+ d || (Un && console.log("Adding padding clip for ", c, t, "at slot", o), d = new $e(e, c, t), h[o] = d);
26117
26130
  }
26118
26131
  const l = new yr(this, e, t);
26119
- if (this.rootAndClipToRegisteredAnimationMap.set(i, l), zn && console.log({ root: e, clip: t, info: l }), t) {
26132
+ if (this.rootAndClipToRegisteredAnimationMap.set(i, l), Un && console.log({ root: e, clip: t, info: l }), t) {
26120
26133
  const c = this.rootToRegisteredClip.get(e);
26121
26134
  if (c ? c.push(t) : this.rootToRegisteredClip.set(e, [t]), !this.clipToStartTime.get(t)) {
26122
26135
  this.lastClipEndTime == null && (this.lastClipEndTime = $e.restPoseClipDuration);
@@ -26128,10 +26141,10 @@ class Yg {
26128
26141
  return l;
26129
26142
  }
26130
26143
  onAfterHierarchy(e) {
26131
- zn && console.log("Animation clips per animation target node", this.dict);
26144
+ Un && console.log("Animation clips per animation target node", this.dict);
26132
26145
  }
26133
26146
  onAfterBuildDocument(e) {
26134
- zn && console.log("Animation data", { dict: this.dict, rootTargetMap: this.rootTargetMap, rootToRegisteredClip: this.rootToRegisteredClip });
26147
+ Un && console.log("Animation data", { dict: this.dict, rootTargetMap: this.rootTargetMap, rootToRegisteredClip: this.rootToRegisteredClip });
26135
26148
  for (const t of this.rootTargetMap.keys()) {
26136
26149
  const i = this.rootTargetMap.get(t);
26137
26150
  if (!i) continue;
@@ -26217,7 +26230,7 @@ class $R {
26217
26230
  for (const oi of J)
26218
26231
  ke++, oi || (se.has(fe) || se.set(fe, []), se.get(fe).push(ke));
26219
26232
  }
26220
- zn && console.log("Bone count: ", O.size, "TransformData entries per bone: ", W, "Undefined bone entries: ", se), console.assert(q, "All bones should have the same number of TransformData entries", O), console.assert(se.size === 0, "All TransformData entries should be set", se);
26233
+ Un && console.log("Bone count: ", O.size, "TransformData entries per bone: ", W, "Undefined bone entries: ", se), console.assert(q, "All bones should have the same number of TransformData entries", O), console.assert(se.size === 0, "All TransformData entries should be set", se);
26221
26234
  const oe = [];
26222
26235
  for (const [fe, J] of O)
26223
26236
  for (let ke = 0; ke < J.length; ke++) {
@@ -26268,7 +26281,7 @@ class $R {
26268
26281
  return W.join(", ");
26269
26282
  }, f = function(O) {
26270
26283
  const W = /* @__PURE__ */ new Map();
26271
- if (zn) {
26284
+ if (Un) {
26272
26285
  const q = new Array();
26273
26286
  for (const [se, oe] of o)
26274
26287
  q.push(se.uuid + ": " + oe.length + " " + oe.map((fe) => fe.clip?.uuid.substring(0, 6)).join(" "));
@@ -26319,7 +26332,7 @@ class $R {
26319
26332
  const B = y.map((O) => '"' + Ba(O.bone, v) + '"').join(", "), G = y.map((O) => Eb(O.inverse.clone().invert())).join(", ");
26320
26333
  e.beginBlock('def Skeleton "Rig"'), e.appendLine(`uniform matrix4d[] bindTransforms = [${G}]`), e.appendLine(`uniform token[] joints = [${B}]`), e.appendLine('uniform token purpose = "guide"'), e.appendLine(`uniform matrix4d[] restTransforms = [${k.map((O) => Eb(O)).join(", ")}]`);
26321
26334
  const X = p(y.map((O) => O.bone));
26322
- if (zn) {
26335
+ if (Un) {
26323
26336
  let O = 1e7, W = 0;
26324
26337
  for (const q of X.position?.keys() ?? [])
26325
26338
  O = Math.min(O, q), W = Math.max(W, q);
@@ -26393,7 +26406,7 @@ class $R {
26393
26406
  const w = !g.clip, b = d === "position" && (g.pos || w), v = d === "rotation" && (g.rot || w), T = d === "scale" && (g.scale || w);
26394
26407
  if (b || v || T) {
26395
26408
  const k = g.clip?.name ?? "rest", E = g.getDuration();
26396
- zn && console.log("Write .timeSamples:", k, y, E, h), e.appendLine("# " + k + ": start=" + l.format(y * $e.frameRate) + ", length=" + l.format(E * $e.frameRate) + ", frames=" + g.getFrames());
26409
+ Un && console.log("Write .timeSamples:", k, y, E, h), e.appendLine("# " + k + ": start=" + l.format(y * $e.frameRate) + ", length=" + l.format(E * $e.frameRate) + ", frames=" + g.getFrames());
26397
26410
  }
26398
26411
  if (b)
26399
26412
  for (const { time: k, translation: E } of g.getValues(m, !0, !1, !1)) {
@@ -26457,7 +26470,7 @@ class al {
26457
26470
  }
26458
26471
  }
26459
26472
  }
26460
- var VR = Object.defineProperty, Ue = (s, e, t, i) => {
26473
+ var VR = Object.defineProperty, ze = (s, e, t, i) => {
26461
26474
  for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
26462
26475
  (r = s[o]) && (n = r(e, t, n) || n);
26463
26476
  return n && VR(e, t, n), n;
@@ -26502,7 +26515,7 @@ class ll extends R {
26502
26515
  }
26503
26516
  *moveToTarget() {
26504
26517
  if (!this.target || !this.object) return;
26505
- 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);
26518
+ const e = te(this.object).clone(), t = te(this.target).clone(), i = ve(this.object).clone(), n = ve(this.target).clone(), o = Xe(this.object).clone(), r = Xe(this.target).clone(), a = e.distanceTo(t), l = i.angleTo(n), c = o.distanceTo(r);
26506
26519
  if (a < 0.01 && l < 0.01 && c < 0.01) {
26507
26520
  Rt(this.object, t), Xn(this.object, n), Ec(this.object, r), this.coroutine = null;
26508
26521
  return;
@@ -26523,7 +26536,7 @@ class ll extends R {
26523
26536
  }
26524
26537
  beforeCreateDocument(e) {
26525
26538
  if (this.target && this.object && this.gameObject) {
26526
- const t = new zt(
26539
+ const t = new Ut(
26527
26540
  "Move to " + this.target?.name,
26528
26541
  Jt.tapTrigger(this.gameObject),
26529
26542
  me.transformAction(this.object, this.target, this.duration, this.relativeMotion ? "relative" : "absolute")
@@ -26532,16 +26545,16 @@ class ll extends R {
26532
26545
  }
26533
26546
  }
26534
26547
  }
26535
- Ue([
26548
+ ze([
26536
26549
  u(M)
26537
26550
  ], ll.prototype, "object");
26538
- Ue([
26551
+ ze([
26539
26552
  u(M)
26540
26553
  ], ll.prototype, "target");
26541
- Ue([
26554
+ ze([
26542
26555
  u()
26543
26556
  ], ll.prototype, "duration");
26544
- Ue([
26557
+ ze([
26545
26558
  u()
26546
26559
  ], ll.prototype, "relativeMotion");
26547
26560
  const Gu = class qt extends R {
@@ -26626,12 +26639,12 @@ const Gu = class qt extends R {
26626
26639
  createAndAttachBehaviors(e, t, i) {
26627
26640
  const n = [], o = Math.max(0, this.fadeDuration);
26628
26641
  n.push(me.fadeAction([...this.targetModels, ...i], o, !1)), n.push(me.fadeAction(t, o, !0)), e.addBehavior(
26629
- new zt(
26642
+ new Ut(
26630
26643
  "Select_" + this.selfModel.name,
26631
26644
  Jt.tapTrigger(this.selfModel),
26632
26645
  me.parallel(...n)
26633
26646
  )
26634
- ), qt._parallelStartHiddenActions.push(...t), qt._startHiddenBehaviour || (qt._startHiddenBehaviour = new zt(
26647
+ ), qt._parallelStartHiddenActions.push(...t), qt._startHiddenBehaviour || (qt._startHiddenBehaviour = new Ut(
26635
26648
  "StartHidden_" + this.selfModel.name,
26636
26649
  Jt.sceneStartTrigger(),
26637
26650
  me.fadeAction(qt._parallelStartHiddenActions, o, !1)
@@ -26651,13 +26664,13 @@ const Gu = class qt extends R {
26651
26664
  return e;
26652
26665
  }
26653
26666
  };
26654
- Ue([
26667
+ ze([
26655
26668
  u(be)
26656
26669
  ], Gu.prototype, "materialToSwitch");
26657
- Ue([
26670
+ ze([
26658
26671
  u(be)
26659
26672
  ], Gu.prototype, "variantMaterial");
26660
- Ue([
26673
+ ze([
26661
26674
  u()
26662
26675
  ], Gu.prototype, "fadeDuration");
26663
26676
  let Ww = Gu;
@@ -26715,13 +26728,13 @@ const th = class Le extends R {
26715
26728
  if (this.toggleModel) {
26716
26729
  if (this.toggleOnClick) {
26717
26730
  const a = [];
26718
- a.push(me.fadeAction(n, 0, !1)), a.push(me.fadeAction(this.toggleModel, 0, !0)), a.push(me.fadeAction(this.targetModel, 0, o)), e.addBehavior(new zt(
26731
+ a.push(me.fadeAction(n, 0, !1)), a.push(me.fadeAction(this.toggleModel, 0, !0)), a.push(me.fadeAction(this.targetModel, 0, o)), e.addBehavior(new Ut(
26719
26732
  "Toggle_" + n.name + "_ToggleTo" + (o ? "On" : "Off"),
26720
26733
  Jt.tapTrigger(n),
26721
26734
  me.parallel(...a)
26722
26735
  ));
26723
26736
  const l = [];
26724
- l.push(me.fadeAction(this.toggleModel, 0, !1)), l.push(me.fadeAction(n, 0, !0)), l.push(me.fadeAction(this.targetModel, 0, !o)), e.addBehavior(new zt(
26737
+ l.push(me.fadeAction(this.toggleModel, 0, !1)), l.push(me.fadeAction(n, 0, !0)), l.push(me.fadeAction(this.targetModel, 0, !o)), e.addBehavior(new Ut(
26725
26738
  "Toggle_" + n.name + "_ToggleTo" + (o ? "Off" : "On"),
26726
26739
  Jt.tapTrigger(this.toggleModel),
26727
26740
  me.parallel(...l)
@@ -26729,7 +26742,7 @@ const th = class Le extends R {
26729
26742
  }
26730
26743
  } else {
26731
26744
  const a = [];
26732
- this.hideSelf && a.push(me.fadeAction(n, 0, !1)), a.push(me.fadeAction(this.targetModel, 0, o)), e.addBehavior(new zt(
26745
+ this.hideSelf && a.push(me.fadeAction(n, 0, !1)), a.push(me.fadeAction(this.targetModel, 0, o)), e.addBehavior(new Ut(
26733
26746
  "Toggle_" + n.name + "_ToggleTo" + (o ? "On" : "Off"),
26734
26747
  Jt.tapTrigger(n),
26735
26748
  a.length > 1 ? me.parallel(...a) : a[0]
@@ -26743,16 +26756,16 @@ const th = class Le extends R {
26743
26756
  this.gameObject[Le.wasVisible] !== void 0 && (this.gameObject.visible = this.gameObject[Le.wasVisible], delete this.gameObject[Le.wasVisible]), this.target && this.target[Le.wasVisible] !== void 0 && (this.target.visible = this.target[Le.wasVisible], delete this.target[Le.wasVisible]), delete this.gameObject[Le.toggleClone], delete this.gameObject[Le.reverseToggleClone];
26744
26757
  }
26745
26758
  };
26746
- Ue([
26759
+ ze([
26747
26760
  u(M)
26748
26761
  ], th.prototype, "target");
26749
- Ue([
26762
+ ze([
26750
26763
  u()
26751
26764
  ], th.prototype, "toggleOnClick");
26752
- Ue([
26765
+ ze([
26753
26766
  u()
26754
26767
  ], th.prototype, "targetState");
26755
- Ue([
26768
+ ze([
26756
26769
  u()
26757
26770
  ], th.prototype, "hideSelf");
26758
26771
  let Vw = th;
@@ -26763,7 +26776,7 @@ class un extends R {
26763
26776
  const i = Array.isArray(e) ? e : [e];
26764
26777
  for (const n of i)
26765
26778
  un._fadeObjects.includes(n) || (console.log("adding hide on start", n), un._fadeObjects.push(n));
26766
- un._fadeBehaviour === void 0 && (un._fadeBehaviour = new zt(
26779
+ un._fadeBehaviour === void 0 && (un._fadeBehaviour = new Ut(
26767
26780
  "HideOnStart",
26768
26781
  Jt.sceneStartTrigger(),
26769
26782
  //@ts-ignore
@@ -26804,7 +26817,7 @@ class ih extends R {
26804
26817
  }
26805
26818
  createBehaviours(e, t, i) {
26806
26819
  if (this.target && t.uuid === this.gameObject.uuid) {
26807
- const n = new zt(
26820
+ const n = new Ut(
26808
26821
  "emphasize " + this.name,
26809
26822
  Jt.tapTrigger(this.gameObject),
26810
26823
  me.emphasize(this.target, this.duration, this.motionType, void 0, "basic")
@@ -26815,13 +26828,13 @@ class ih extends R {
26815
26828
  afterCreateDocument(e, t) {
26816
26829
  }
26817
26830
  }
26818
- Ue([
26831
+ ze([
26819
26832
  u()
26820
26833
  ], ih.prototype, "target");
26821
- Ue([
26834
+ ze([
26822
26835
  u()
26823
26836
  ], ih.prototype, "duration");
26824
- Ue([
26837
+ ze([
26825
26838
  u()
26826
26839
  ], ih.prototype, "motionType");
26827
26840
  class Tr extends R {
@@ -26877,7 +26890,7 @@ class Tr extends R {
26877
26890
  const d = this.name ? "_" + this.name : "";
26878
26891
  if (l && this.trigger === "tap") {
26879
26892
  this.toggleOnClick && (h.multiplePerformOperation = "stop");
26880
- const f = new zt(
26893
+ const f = new Ut(
26881
26894
  "playAudio" + d,
26882
26895
  Jt.tapTrigger(t),
26883
26896
  h
@@ -26888,7 +26901,7 @@ class Tr extends R {
26888
26901
  if (l && this.trigger === "tap")
26889
26902
  console.warn("USDZExport: Audio sources that are played on tap can't also auto-play at scene start due to a QuickLook bug.");
26890
26903
  else {
26891
- const f = new zt(
26904
+ const f = new Ut(
26892
26905
  "playAudioOnStart" + d,
26893
26906
  Jt.sceneStartTrigger(),
26894
26907
  h
@@ -26898,13 +26911,13 @@ class Tr extends R {
26898
26911
  }
26899
26912
  }
26900
26913
  }
26901
- Ue([
26914
+ ze([
26902
26915
  u(Ki)
26903
26916
  ], Tr.prototype, "target");
26904
- Ue([
26917
+ ze([
26905
26918
  u(URL)
26906
26919
  ], Tr.prototype, "clip");
26907
- Ue([
26920
+ ze([
26908
26921
  u()
26909
26922
  ], Tr.prototype, "toggleOnClick");
26910
26923
  const Kg = class Ln extends R {
@@ -26976,7 +26989,7 @@ const Kg = class Ln extends R {
26976
26989
  this.animationSequence,
26977
26990
  this.animationLoopAfterSequence,
26978
26991
  this.randomOffsetNormalized
26979
- ), c = new zt(
26992
+ ), c = new Ut(
26980
26993
  this.trigger + "_" + r + "_toPlayAnimation_" + this.stateName + "_on_" + this.target?.name,
26981
26994
  this.trigger == "tap" ? Jt.tapTrigger(this.selfModel) : Jt.sceneStartTrigger(),
26982
26995
  l
@@ -27124,10 +27137,10 @@ const Kg = class Ln extends R {
27124
27137
  n && (this.animationSequence = n.animationSequence, this.animationLoopAfterSequence = n.animationLoopAfterSequence, this.randomOffsetNormalized = n.randomTimeOffset, this.stateAnimationModel = t);
27125
27138
  }
27126
27139
  };
27127
- Ue([
27140
+ ze([
27128
27141
  u(Tt)
27129
27142
  ], Kg.prototype, "animator");
27130
- Ue([
27143
+ ze([
27131
27144
  u()
27132
27145
  ], Kg.prototype, "stateName");
27133
27146
  let iu = Kg;
@@ -27138,13 +27151,13 @@ class nh extends R {
27138
27151
  getDuration() {
27139
27152
  }
27140
27153
  }
27141
- Ue([
27154
+ ze([
27142
27155
  u(M)
27143
27156
  ], nh.prototype, "target");
27144
27157
  class qu extends R {
27145
27158
  target;
27146
27159
  }
27147
- Ue([
27160
+ ze([
27148
27161
  u(nh)
27149
27162
  ], qu.prototype, "target");
27150
27163
  class Xu extends nh {
@@ -27162,10 +27175,10 @@ class Xu extends nh {
27162
27175
  return this.duration;
27163
27176
  }
27164
27177
  }
27165
- Ue([
27178
+ ze([
27166
27179
  u()
27167
27180
  ], Xu.prototype, "type");
27168
- Ue([
27181
+ ze([
27169
27182
  u()
27170
27183
  ], Xu.prototype, "duration");
27171
27184
  class Hw extends qu {
@@ -27375,7 +27388,7 @@ _t([
27375
27388
  et()
27376
27389
  ], Do.prototype, "vertices", 2);
27377
27390
  const yp = /* @__PURE__ */ Symbol("spriteOwner");
27378
- class Uc {
27391
+ class zc {
27379
27392
  sprites;
27380
27393
  constructor() {
27381
27394
  this.sprites = [];
@@ -27383,11 +27396,11 @@ class Uc {
27383
27396
  }
27384
27397
  _t([
27385
27398
  u(Do)
27386
- ], Uc.prototype, "sprites", 2);
27399
+ ], zc.prototype, "sprites", 2);
27387
27400
  const Zg = class Tm {
27388
27401
  static create() {
27389
27402
  const e = new Tm();
27390
- return e.spriteSheet = new Uc(), e;
27403
+ return e.spriteSheet = new zc(), e;
27391
27404
  }
27392
27405
  // we don't assign anything here because it's used by the serialization system.
27393
27406
  // there's currently a limitation in the serializer when e.g. spriteSheet is already assigned it will not be overriden by the serializer
@@ -27402,7 +27415,7 @@ const Zg = class Tm {
27402
27415
  * Set the sprite to be rendered in the currently assigned sprite sheet at the currently active index {@link index}
27403
27416
  */
27404
27417
  set sprite(e) {
27405
- e && (this.spriteSheet ? ((this.index === null || this.index === void 0) && (this.index = 0), this.spriteSheet.sprites[this.index] = e) : (this.spriteSheet = new Uc(), this.spriteSheet.sprites = [e], this.index = 0));
27418
+ e && (this.spriteSheet ? ((this.index === null || this.index === void 0) && (this.index = 0), this.spriteSheet.sprites[this.index] = e) : (this.spriteSheet = new zc(), this.spriteSheet.sprites = [e], this.index = 0));
27406
27419
  }
27407
27420
  /** The currently active sprite */
27408
27421
  get sprite() {
@@ -27427,7 +27440,7 @@ const Zg = class Tm {
27427
27440
  }
27428
27441
  };
27429
27442
  _t([
27430
- u(Uc)
27443
+ u(zc)
27431
27444
  ], Zg.prototype, "spriteSheet", 2);
27432
27445
  _t([
27433
27446
  u()
@@ -27728,7 +27741,7 @@ class mn extends R {
27728
27741
  this._reticle[t] = o, o.matrixAutoUpdate = !1, o.visible = !1;
27729
27742
  }
27730
27743
  if (o.lastPos = o.lastPos || i.position.clone(), o.lastQuat = o.lastQuat || i.quaternion.clone(), o.position.copy(o.lastPos.lerp(i.position, this.context.time.deltaTime / 0.1)), o.lastPos.copy(o.position), o.quaternion.copy(o.lastQuat.slerp(i.quaternion, this.context.time.deltaTime / 0.05)), o.lastQuat.copy(o.quaternion), o.scale.set(n, n, n), this.customReticle && this.applyViewBasedTransform(o), o.updateMatrix(), o.visible = !0, o.parent !== this.context.scene && this.context.scene.add(o), this._placementStartTime < 0 && (this._placementStartTime = this.context.time.realtimeSinceStartup), this.autoPlace)
27731
- if (this.upVec.set(0, 1, 0).applyQuaternion(o.quaternion), this.upVec.dot(z(0, 1, 0)) > 0.9) {
27744
+ if (this.upVec.set(0, 1, 0).applyQuaternion(o.quaternion), this.upVec.dot(U(0, 1, 0)) > 0.9) {
27732
27745
  let a = o["autoplace:timer"] || 0;
27733
27746
  a >= 1 ? (o.visible = !1, this.onPlaceScene(null)) : (a += this.context.time.deltaTime, o["autoplace:timer"] = a);
27734
27747
  } else
@@ -28445,7 +28458,7 @@ class Ir extends R {
28445
28458
  else {
28446
28459
  const e = new M();
28447
28460
  e.name = "Head";
28448
- const t = Ur.createPrimitive(Hc.Cube);
28461
+ const t = zr.createPrimitive(Hc.Cube);
28449
28462
  e.add(t), this.gameObject.add(e), this.head = new ne("", this.sourceId, e), jl && console.log("Create head", e);
28450
28463
  }
28451
28464
  if (this.rightHand)
@@ -28584,7 +28597,7 @@ class Mo extends R {
28584
28597
  }
28585
28598
  async loadHandModel(e, t) {
28586
28599
  const i = this.context, n = i.renderer.xr.getHand(t.index);
28587
- n || (Qs ? U.DrawLabel(t.rayWorldPosition, "No hand found for index " + t.index, 0.05, 5) : console.warn("No hand found for index " + t.index));
28600
+ n || (Qs ? z.DrawLabel(t.rayWorldPosition, "No hand found for index " + t.index, 0.05, 5) : console.warn("No hand found for index " + t.index));
28588
28601
  const o = new Is();
28589
28602
  Ag(o, i), await km(o, i, this.sourceId ?? "", this.sourceId ?? "");
28590
28603
  const r = ww(o);
@@ -28597,7 +28610,7 @@ class Mo extends R {
28597
28610
  const f = r?.gltf;
28598
28611
  f?.scene.children?.length === 0 && (f.scene.children[0] = d), r?.gltf && Qn().createBuiltinComponents(e.context, e.sourceId || a, r.gltf, null, r), d.traverse((p) => {
28599
28612
  p.layers.set(2), K.active?.isPassThrough && !l && this.makeOccluder(p), p instanceof H && We.assignMeshLOD(p, 0);
28600
- }), t.connected || (Qs && U.DrawLabel(t.rayWorldPosition, "Hand is loaded but not connected anymore", 0.05, 5), d.removeFromParent());
28613
+ }), t.connected || (Qs && z.DrawLabel(t.rayWorldPosition, "Hand is loaded but not connected anymore", 0.05, 5), d.removeFromParent());
28601
28614
  });
28602
28615
  if (Qs && c.add(new Pi(0.5)), t.inputSource.hand) {
28603
28616
  Qs && console.log(t.inputSource.hand);
@@ -28607,7 +28620,7 @@ class Mo extends R {
28607
28620
  f.matrixAutoUpdate = !1, f.visible = !0, n.joints[d.jointName] = f, n.add(f);
28608
28621
  }
28609
28622
  } else
28610
- Qs && U.DrawLabel(t.rayWorldPosition, "No inputSource.hand found for index " + t.index, 0.05, 5);
28623
+ Qs && z.DrawLabel(t.rayWorldPosition, "No inputSource.hand found for index " + t.index, 0.05, 5);
28611
28624
  return { handObject: c, handmesh: h };
28612
28625
  }
28613
28626
  makeOccluder(e) {
@@ -28669,9 +28682,9 @@ class Ji extends R {
28669
28682
  onHandleMovement(e, t) {
28670
28683
  const i = e.getStick("xr-standard-thumbstick");
28671
28684
  if (i.x != 0 || i.y != 0) {
28672
- const n = z(i.x, 0, i.y);
28685
+ const n = U(i.x, 0, i.y);
28673
28686
  n.multiplyScalar(this.context.time.deltaTimeUnscaled * this.movementSpeed);
28674
- const o = qe(t);
28687
+ const o = Xe(t);
28675
28688
  n.multiplyScalar(o.x), n.applyQuaternion(e.xr.poseOrientation), n.y = 0, n.applyQuaternion(t.worldQuaternion), L() && Number.isNaN(n.x) && console.error("Stick movement resulted in NaN", { stick: i, vec: n }), t.position.add(n), t.updateWorldMatrix(!1, !1);
28676
28689
  for (const r of t.children) r.updateWorldMatrix(!1, !1);
28677
28690
  }
@@ -28706,7 +28719,7 @@ class Ji extends R {
28706
28719
  this._didTeleport = !0;
28707
28720
  const n = this.context.physics.raycastFromRay(e.ray)[0];
28708
28721
  if (n && n.object instanceof $a) {
28709
- const r = n.normal?.dot(z(0, 1, 0));
28722
+ const r = n.normal?.dot(U(0, 1, 0));
28710
28723
  if (r !== void 0 && r < 0.4)
28711
28724
  return;
28712
28725
  }
@@ -28716,15 +28729,15 @@ class Ji extends R {
28716
28729
  const r = t.worldPosition;
28717
28730
  this._plane.setFromNormalAndCoplanarPoint(new _(0, 1, 0), r);
28718
28731
  const a = e.ray;
28719
- o = r.clone(), this._plane.intersectLine(new tC(a.origin, z(a.direction).multiplyScalar(1e4).add(a.origin)), o), o.distanceTo(r) > t.scale.x * 10 && (o = null);
28732
+ o = r.clone(), this._plane.intersectLine(new tC(a.origin, U(a.direction).multiplyScalar(1e4).add(a.origin)), o), o.distanceTo(r) > t.scale.x * 10 && (o = null);
28720
28733
  }
28721
28734
  if (o) {
28722
28735
  if (this.useTeleportTarget && !C.getComponentInParent(n.object, ty))
28723
28736
  return;
28724
28737
  const r = o.clone();
28725
- if (bp && U.DrawSphere(o, 0.025, 16711680, 5), this.context.mainCamera?.position) {
28738
+ if (bp && z.DrawSphere(o, 0.025, 16711680, 5), this.context.mainCamera?.position) {
28726
28739
  const l = this.context.xr?.getUserOffsetInRig();
28727
- l && (l.y = 0, r.sub(l), bp && U.DrawWireSphere(l.add(r), 0.025, 65280, 5));
28740
+ l && (l.y = 0, r.sub(l), bp && z.DrawWireSphere(l.add(r), 0.025, 65280, 5));
28728
28741
  }
28729
28742
  this._teleportBuffer.push(t.matrix.clone()), this._teleportBuffer.length > 10 && this._teleportBuffer.shift(), this.useTeleportFade ? e.xr.fadeTransition()?.then(() => {
28730
28743
  t.worldPosition = r;
@@ -28787,7 +28800,7 @@ class Ji extends R {
28787
28800
  if (c || (c = l[0]), n && (n.controller = i, n.hit = c), this._hitDistances[t] = c?.distance || null, c) {
28788
28801
  this._lastHitDistances[t] = c.distance;
28789
28802
  const h = e.rigScale ?? 1;
28790
- bp && (U.DrawWireSphere(c.point, 0.025 * h, 16711680), U.DrawLabel(z(0, 0.2, 0).add(c.point), c.object.name, 0.02, 0)), n || (n = this.createHitPointObject(), this._hitDiscs[t] = n), n.hit = c, n.visible = c.distance > h * 0.05;
28803
+ bp && (z.DrawWireSphere(c.point, 0.025 * h, 16711680), z.DrawLabel(U(0, 0.2, 0).add(c.point), c.object.name, 0.02, 0)), n || (n = this.createHitPointObject(), this._hitDiscs[t] = n), n.hit = c, n.visible = c.distance > h * 0.05;
28791
28804
  let d = 0.01 * (h + c.distance);
28792
28805
  const f = i.getButton("primary")?.pressed;
28793
28806
  f && (d *= 1.1), n.scale.set(d, d, d), n.layers.set(2);
@@ -28809,8 +28822,8 @@ class Ji extends R {
28809
28822
  return vm(e) || e.isUI === !0 ? !0 : e.isScene ? !1 : e.parent ? this.isObjectWithInteractiveComponent(e.parent, t + 1) : !1;
28810
28823
  }
28811
28824
  updateHitPointerPosition(e, t, i) {
28812
- const n = z(e.rayWorldPosition);
28813
- n.add(z(0, 0, i - 0.01).applyQuaternion(e.rayWorldQuaternion)), t.position.lerp(n, this.context.time.deltaTimeUnscaled / 0.05);
28825
+ const n = U(e.rayWorldPosition);
28826
+ n.add(U(0, 0, i - 0.01).applyQuaternion(e.rayWorldQuaternion)), t.position.lerp(n, this.context.time.deltaTimeUnscaled / 0.05);
28814
28827
  }
28815
28828
  hitPointRaycastFilter = (e) => e.type === "SkinnedMesh" ? "continue in children" : !0;
28816
28829
  /** create an object to visualize hit points in the scene */
@@ -30401,11 +30414,11 @@ class Ri extends R {
30401
30414
  }
30402
30415
  onEnable() {
30403
30416
  Bb && console.log(this.name, this), this._rectTransform = this.gameObject.getComponent(Zn);
30404
- const e = this.gameObject.getComponentInParent(zc);
30417
+ const e = this.gameObject.getComponentInParent(Uc);
30405
30418
  e && e.registerLayoutGroup(this), this._needsUpdate = !0;
30406
30419
  }
30407
30420
  onDisable() {
30408
- const e = this.gameObject.getComponentInParent(zc);
30421
+ const e = this.gameObject.getComponentInParent(Uc);
30409
30422
  e && e.unregisterLayoutGroup(this);
30410
30423
  }
30411
30424
  // for animation:
@@ -30752,7 +30765,7 @@ ts([
30752
30765
  ts([
30753
30766
  u()
30754
30767
  ], en.prototype, "planeDistance", 2);
30755
- let zc = en;
30768
+ let Uc = en;
30756
30769
  var ET = Object.defineProperty, RT = Object.getOwnPropertyDescriptor, oy = (s, e, t, i) => {
30757
30770
  for (var n = i > 1 ? void 0 : i ? RT(e, t) : e, o = s.length - 1, r; o >= 0; o--)
30758
30771
  (r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
@@ -30803,7 +30816,7 @@ class lx {
30803
30816
  // TODO would probably be better to export each object instead of the entire Canvas
30804
30817
  // so that we don't export them twice (once as regular hierarchy, once as part of Canvas export)
30805
30818
  onExportObject(e, t, i) {
30806
- const n = C.getComponent(e, zc);
30819
+ const n = C.getComponent(e, Uc);
30807
30820
  if (n && n.enabled && n.renderMode === rx.WorldSpace) {
30808
30821
  const o = new sy(), r = C.getComponent(e, Zn), a = C.getComponent(e, Lr), l = new Array();
30809
30822
  if (r) {
@@ -30948,7 +30961,7 @@ function AT(s, e) {
30948
30961
  return o;
30949
30962
  }
30950
30963
  function IT(s) {
30951
- return new zt(
30964
+ return new Ut(
30952
30965
  "DisableAtStart",
30953
30966
  Jt.sceneStartTrigger(),
30954
30967
  me.fadeAction(s, 0, !1)
@@ -31134,7 +31147,7 @@ const pi = class cr extends R {
31134
31147
  a.keepObject = (k) => {
31135
31148
  let E = !0;
31136
31149
  const I = C.getComponent(k, di);
31137
- return I && !I.enabled && (E = !1), E && y.includes(k) && (E = !1), E && C.getComponentInParent(k, zu) && (E = !1), E && C.getComponentInParent(k, Fs) && (E = !1), St && !E && console.log("USDZExporter: Discarding object", k), E;
31150
+ return I && !I.enabled && (E = !1), E && y.includes(k) && (E = !1), E && C.getComponentInParent(k, Uu) && (E = !1), E && C.getComponentInParent(k, Fs) && (E = !1), St && !E && console.log("USDZExporter: Discarding object", k), E;
31138
31151
  }, a.beforeWritingDocument = () => {
31139
31152
  if (L() && l && c) {
31140
31153
  const k = l.animatedRoots;
@@ -31364,10 +31377,10 @@ ay([
31364
31377
  ay([
31365
31378
  u()
31366
31379
  ], fl.prototype, "isGizmo");
31367
- var UT = Object.defineProperty, ly = (s, e, t, i) => {
31380
+ var zT = Object.defineProperty, ly = (s, e, t, i) => {
31368
31381
  for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
31369
31382
  (r = s[o]) && (n = r(e, t, n) || n);
31370
- return n && UT(e, t, n), n;
31383
+ return n && zT(e, t, n), n;
31371
31384
  };
31372
31385
  class ah extends R {
31373
31386
  isGizmo = !1;
@@ -31397,10 +31410,10 @@ ly([
31397
31410
  ly([
31398
31411
  u(re)
31399
31412
  ], ah.prototype, "color1");
31400
- var zT = Object.defineProperty, cy = (s, e, t, i) => {
31413
+ var UT = Object.defineProperty, cy = (s, e, t, i) => {
31401
31414
  for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
31402
31415
  (r = s[o]) && (n = r(e, t, n) || n);
31403
- return n && zT(e, t, n), n;
31416
+ return n && UT(e, t, n), n;
31404
31417
  };
31405
31418
  class hy extends R {
31406
31419
  connectedBody;
@@ -31444,7 +31457,7 @@ var NT = Object.defineProperty, $T = Object.getOwnPropertyDescriptor, Ti = (s, e
31444
31457
  function aa(s) {
31445
31458
  return s * Math.PI / 180;
31446
31459
  }
31447
- const Ub = 300, Ks = x("debuglights");
31460
+ const zb = 300, Ks = x("debuglights");
31448
31461
  class Wt extends R {
31449
31462
  type = 0;
31450
31463
  get range() {
@@ -31598,7 +31611,7 @@ class Wt extends R {
31598
31611
  switch (this.type) {
31599
31612
  case 1:
31600
31613
  const t = new Np(this.color, this.intensity * Math.PI);
31601
- if (t.position.set(0, 0, -Ub * 0.5).applyQuaternion(this.gameObject.quaternion), this.gameObject.add(t.target), Wa(t.target, 0, 0, 0), this.light = t, this.gameObject.position.set(0, 0, 0), this.gameObject.rotation.set(0, 0, 0), Ks) {
31614
+ if (t.position.set(0, 0, -zb * 0.5).applyQuaternion(this.gameObject.quaternion), this.gameObject.add(t.target), Wa(t.target, 0, 0, 0), this.light = t, this.gameObject.position.set(0, 0, 0), this.gameObject.rotation.set(0, 0, 0), Ks) {
31602
31615
  const r = new sC(this.light, 0.2, this.color);
31603
31616
  this.context.scene.add(r);
31604
31617
  }
@@ -31618,7 +31631,7 @@ class Wt extends R {
31618
31631
  if (this._intensity >= 0 ? this.light.intensity = this._intensity : this._intensity = this.light.intensity, this.shadows !== 0 ? this.light.castShadow = !0 : this.light.castShadow = !1, this.light.shadow) {
31619
31632
  this._shadowResolution !== void 0 && this._shadowResolution > 4 ? (this.light.shadow.mapSize.width = this._shadowResolution, this.light.shadow.mapSize.height = this._shadowResolution) : (this.light.shadow.mapSize.width = 2048, this.light.shadow.mapSize.height = 2048), Ks && console.log("Override shadow bias?", this._overrideShadowBiasSettings, this.shadowBias, this.shadowNormalBias), this.light.shadow.bias = this.shadowBias, this.light.shadow.normalBias = this.shadowNormalBias, this.updateShadowSoftHard();
31620
31633
  const t = this.light.shadow.camera;
31621
- if (t.near = this.shadowNearPlane, this._shadowDistance !== void 0 && typeof this._shadowDistance == "number" ? t.far = this._shadowDistance : t.far = Ub * Math.abs(this.gameObject.scale.z), this.gameObject.scale.set(1, 1, 1), this.shadowWidth !== void 0)
31634
+ if (t.near = this.shadowNearPlane, this._shadowDistance !== void 0 && typeof this._shadowDistance == "number" ? t.far = this._shadowDistance : t.far = zb * Math.abs(this.gameObject.scale.z), this.gameObject.scale.set(1, 1, 1), this.shadowWidth !== void 0)
31622
31635
  t.left = -this.shadowWidth / 2, t.right = this.shadowWidth / 2;
31623
31636
  else {
31624
31637
  const i = this.gameObject.scale.x;
@@ -31835,7 +31848,7 @@ class ch extends R {
31835
31848
  if (e && this.filePath) {
31836
31849
  this._isLoadingOrDoneLoading = !0;
31837
31850
  const t = new Jn();
31838
- t.idProvider = new Ut(this.hash(this.guid)), t.parent = this.loadAssetInParent !== !1 ? e : this.gameObject, this.gameObject.updateMatrix();
31851
+ t.idProvider = new zt(this.hash(this.guid)), t.parent = this.loadAssetInParent !== !1 ? e : this.gameObject, this.gameObject.updateMatrix();
31839
31852
  const i = this.gameObject.matrix;
31840
31853
  ed && console.log("Load nested:", this.filePath?.url ?? this.filePath, this.gameObject.position);
31841
31854
  const n = await this.filePath?.instantiate?.call(this.filePath, t);
@@ -32228,7 +32241,7 @@ S([
32228
32241
  u()
32229
32242
  ], Ws.prototype, "curveMultiplier");
32230
32243
  let Y = Ws;
32231
- const Uo = class Ot {
32244
+ const zo = class Ot {
32232
32245
  static constant(e) {
32233
32246
  const t = new Ot();
32234
32247
  return t.constant(e), t;
@@ -32277,26 +32290,26 @@ const Uo = class Ot {
32277
32290
  };
32278
32291
  S([
32279
32292
  u()
32280
- ], Uo.prototype, "mode");
32293
+ ], zo.prototype, "mode");
32281
32294
  S([
32282
32295
  u(ae)
32283
- ], Uo.prototype, "color");
32296
+ ], zo.prototype, "color");
32284
32297
  S([
32285
32298
  u(ae)
32286
- ], Uo.prototype, "colorMin");
32299
+ ], zo.prototype, "colorMin");
32287
32300
  S([
32288
32301
  u(ae)
32289
- ], Uo.prototype, "colorMax");
32302
+ ], zo.prototype, "colorMax");
32290
32303
  S([
32291
32304
  u(ml)
32292
- ], Uo.prototype, "gradient");
32305
+ ], zo.prototype, "gradient");
32293
32306
  S([
32294
32307
  u(ml)
32295
- ], Uo.prototype, "gradientMin");
32308
+ ], zo.prototype, "gradientMin");
32296
32309
  S([
32297
32310
  u(ml)
32298
- ], Uo.prototype, "gradientMax");
32299
- let gl = Uo;
32311
+ ], zo.prototype, "gradientMax");
32312
+ let gl = zo;
32300
32313
  var Dm = /* @__PURE__ */ ((s) => (s[s.Hierarchy = 0] = "Hierarchy", s[s.Local = 1] = "Local", s[s.Shape = 2] = "Shape", s))(Dm || {});
32301
32314
  class ni {
32302
32315
  cullingMode;
@@ -32419,7 +32432,7 @@ class jm {
32419
32432
  return t;
32420
32433
  }
32421
32434
  }
32422
- class zo {
32435
+ class Uo {
32423
32436
  enabled;
32424
32437
  get burstCount() {
32425
32438
  return this.bursts?.length ?? 0;
@@ -32446,22 +32459,22 @@ class zo {
32446
32459
  }
32447
32460
  S([
32448
32461
  u()
32449
- ], zo.prototype, "enabled");
32462
+ ], Uo.prototype, "enabled");
32450
32463
  S([
32451
32464
  u()
32452
- ], zo.prototype, "bursts");
32465
+ ], Uo.prototype, "bursts");
32453
32466
  S([
32454
32467
  u(Y)
32455
- ], zo.prototype, "rateOverTime");
32468
+ ], Uo.prototype, "rateOverTime");
32456
32469
  S([
32457
32470
  u()
32458
- ], zo.prototype, "rateOverTimeMultiplier");
32471
+ ], Uo.prototype, "rateOverTimeMultiplier");
32459
32472
  S([
32460
32473
  u(Y)
32461
- ], zo.prototype, "rateOverDistance");
32474
+ ], Uo.prototype, "rateOverDistance");
32462
32475
  S([
32463
32476
  u()
32464
- ], zo.prototype, "rateOverDistanceMultiplier");
32477
+ ], Uo.prototype, "rateOverDistanceMultiplier");
32465
32478
  class py {
32466
32479
  enabled;
32467
32480
  color;
@@ -32574,7 +32587,7 @@ const it = class ac {
32574
32587
  if (i && (n *= this.system.worldScale.x), this.enabled) {
32575
32588
  switch (this.shapeType) {
32576
32589
  case 5:
32577
- td && U.DrawWireBox(this.position, this.scale, 14540253, 1), this._vector.x = Math.random() * this.scale.x - this.scale.x / 2, this._vector.y = Math.random() * this.scale.y - this.scale.y / 2, this._vector.z = Math.random() * this.scale.z - this.scale.z / 2, this._vector.add(t);
32590
+ td && z.DrawWireBox(this.position, this.scale, 14540253, 1), this._vector.x = Math.random() * this.scale.x - this.scale.x / 2, this._vector.y = Math.random() * this.scale.y - this.scale.y / 2, this._vector.z = Math.random() * this.scale.z - this.scale.z / 2, this._vector.add(t);
32578
32591
  break;
32579
32592
  case 4:
32580
32593
  this.randomConePoint(this.position, this.angle, n, this.radiusThickness, this.arc, this.arcMode, this._vector);
@@ -32621,7 +32634,7 @@ const it = class ac {
32621
32634
  }
32622
32635
  this.randomizePosition(this._vector, this.randomPositionAmount);
32623
32636
  }
32624
- this.applyRotation(this._vector), i && (this._vector.applyQuaternion(this.system.worldQuaternion), this._vector.add(this.system.worldPos)), td && U.DrawSphere(this._vector, 0.03, 16711680, 0.5, !0);
32637
+ this.applyRotation(this._vector), i && (this._vector.applyQuaternion(this.system.worldQuaternion), this._vector.add(this.system.worldPos)), td && z.DrawSphere(this._vector, 0.03, 16711680, 0.5, !0);
32625
32638
  }
32626
32639
  _dir = new _();
32627
32640
  getDirection(e, t) {
@@ -32655,7 +32668,7 @@ const it = class ac {
32655
32668
  {
32656
32669
  const l = a.index;
32657
32670
  if (l) {
32658
- const c = e.mesh_normal, h = l.getX(c * 3), d = l.getX(c * 3 + 1), f = l.getX(c * 3 + 2), p = a.getAttribute("position"), g = z(), y = z(), m = z();
32671
+ const c = e.mesh_normal, h = l.getX(c * 3), d = l.getX(c * 3 + 1), f = l.getX(c * 3 + 2), p = a.getAttribute("position"), g = U(), y = U(), m = U();
32659
32672
  g.fromBufferAttribute(p, h), y.fromBufferAttribute(p, d), m.fromBufferAttribute(p, f), g.sub(y), m.sub(y), g.cross(m), this._dir.copy(g).multiplyScalar(-1);
32660
32673
  const w = ve(r);
32661
32674
  this._dir.applyQuaternion(w);
@@ -32668,7 +32681,7 @@ const it = class ac {
32668
32681
  this._dir.set(0, 0, 1);
32669
32682
  break;
32670
32683
  }
32671
- return this._space === 1 && this._dir.applyQuaternion(this.system.worldQuaternion), this.applyRotation(this._dir), this._dir.normalize(), this.spherizeDirection(this._dir, this.sphericalDirectionAmount), this.randomizeDirection(this._dir, this.randomDirectionAmount), td && (U.DrawSphere(t, 0.01, 8925952, 0.5, !0), U.DrawDirection(t, this._dir, 8925952, 0.5, !0)), this._dir;
32684
+ return this._space === 1 && this._dir.applyQuaternion(this.system.worldQuaternion), this.applyRotation(this._dir), this._dir.normalize(), this.spherizeDirection(this._dir, this.sphericalDirectionAmount), this.randomizeDirection(this._dir, this.randomDirectionAmount), td && (z.DrawSphere(t, 0.01, 8925952, 0.5, !0), z.DrawDirection(t, this._dir, 8925952, 0.5, !0)), this._dir;
32672
32685
  }
32673
32686
  static _randomQuat = new V();
32674
32687
  static _tempVec = new _();
@@ -32991,7 +33004,7 @@ S([
32991
33004
  S([
32992
33005
  u()
32993
33006
  ], Ve.prototype, "worldSpace");
32994
- class Xe {
33007
+ class Qe {
32995
33008
  enabled;
32996
33009
  space = 0;
32997
33010
  orbitalX;
@@ -33037,61 +33050,61 @@ class Xe {
33037
33050
  }
33038
33051
  S([
33039
33052
  u()
33040
- ], Xe.prototype, "enabled");
33053
+ ], Qe.prototype, "enabled");
33041
33054
  S([
33042
33055
  u()
33043
- ], Xe.prototype, "space");
33056
+ ], Qe.prototype, "space");
33044
33057
  S([
33045
33058
  u(Y)
33046
- ], Xe.prototype, "orbitalX");
33059
+ ], Qe.prototype, "orbitalX");
33047
33060
  S([
33048
33061
  u(Y)
33049
- ], Xe.prototype, "orbitalY");
33062
+ ], Qe.prototype, "orbitalY");
33050
33063
  S([
33051
33064
  u(Y)
33052
- ], Xe.prototype, "orbitalZ");
33065
+ ], Qe.prototype, "orbitalZ");
33053
33066
  S([
33054
33067
  u()
33055
- ], Xe.prototype, "orbitalXMultiplier");
33068
+ ], Qe.prototype, "orbitalXMultiplier");
33056
33069
  S([
33057
33070
  u()
33058
- ], Xe.prototype, "orbitalYMultiplier");
33071
+ ], Qe.prototype, "orbitalYMultiplier");
33059
33072
  S([
33060
33073
  u()
33061
- ], Xe.prototype, "orbitalZMultiplier");
33074
+ ], Qe.prototype, "orbitalZMultiplier");
33062
33075
  S([
33063
33076
  u()
33064
- ], Xe.prototype, "orbitalOffsetX");
33077
+ ], Qe.prototype, "orbitalOffsetX");
33065
33078
  S([
33066
33079
  u()
33067
- ], Xe.prototype, "orbitalOffsetY");
33080
+ ], Qe.prototype, "orbitalOffsetY");
33068
33081
  S([
33069
33082
  u()
33070
- ], Xe.prototype, "orbitalOffsetZ");
33083
+ ], Qe.prototype, "orbitalOffsetZ");
33071
33084
  S([
33072
33085
  u(Y)
33073
- ], Xe.prototype, "speedModifier");
33086
+ ], Qe.prototype, "speedModifier");
33074
33087
  S([
33075
33088
  u()
33076
- ], Xe.prototype, "speedModifierMultiplier");
33089
+ ], Qe.prototype, "speedModifierMultiplier");
33077
33090
  S([
33078
33091
  u(Y)
33079
- ], Xe.prototype, "x");
33092
+ ], Qe.prototype, "x");
33080
33093
  S([
33081
33094
  u()
33082
- ], Xe.prototype, "xMultiplier");
33095
+ ], Qe.prototype, "xMultiplier");
33083
33096
  S([
33084
33097
  u(Y)
33085
- ], Xe.prototype, "y");
33098
+ ], Qe.prototype, "y");
33086
33099
  S([
33087
33100
  u()
33088
- ], Xe.prototype, "yMultiplier");
33101
+ ], Qe.prototype, "yMultiplier");
33089
33102
  S([
33090
33103
  u(Y)
33091
- ], Xe.prototype, "z");
33104
+ ], Qe.prototype, "z");
33092
33105
  S([
33093
33106
  u()
33094
- ], Xe.prototype, "zMultiplier");
33107
+ ], Qe.prototype, "zMultiplier");
33095
33108
  class si {
33096
33109
  animation;
33097
33110
  enabled;
@@ -33523,7 +33536,7 @@ class mx {
33523
33536
  ), this.particleSystem.worldSpace || i.multiplyMatrices(this._emitterMatrix, i), this.subParticleSystem.emit(t, e.emissionState, i);
33524
33537
  }
33525
33538
  }
33526
- var ZT = Object.defineProperty, ze = (s, e, t, i) => {
33539
+ var ZT = Object.defineProperty, Ue = (s, e, t, i) => {
33527
33540
  for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
33528
33541
  (r = s[o]) && (n = r(e, t, n) || n);
33529
33542
  return n && ZT(e, t, n), n;
@@ -33573,28 +33586,28 @@ class On extends R {
33573
33586
  return new H(t, this.getMaterial());
33574
33587
  }
33575
33588
  }
33576
- ze([
33589
+ Ue([
33577
33590
  u()
33578
33591
  ], On.prototype, "renderMode");
33579
- ze([
33592
+ Ue([
33580
33593
  u(be)
33581
33594
  ], On.prototype, "particleMaterial");
33582
- ze([
33595
+ Ue([
33583
33596
  u(be)
33584
33597
  ], On.prototype, "trailMaterial");
33585
- ze([
33598
+ Ue([
33586
33599
  u()
33587
33600
  ], On.prototype, "maxParticleSize");
33588
- ze([
33601
+ Ue([
33589
33602
  u()
33590
33603
  ], On.prototype, "minParticleSize");
33591
- ze([
33604
+ Ue([
33592
33605
  u()
33593
33606
  ], On.prototype, "velocityScale");
33594
- ze([
33607
+ Ue([
33595
33608
  u()
33596
33609
  ], On.prototype, "cameraVelocityScale");
33597
- ze([
33610
+ Ue([
33598
33611
  u()
33599
33612
  ], On.prototype, "lengthScale");
33600
33613
  class id {
@@ -33706,16 +33719,16 @@ class sA extends qr {
33706
33719
  }
33707
33720
  }
33708
33721
  }
33709
- const zb = /* @__PURE__ */ Symbol("particleRotation");
33722
+ const Ub = /* @__PURE__ */ Symbol("particleRotation");
33710
33723
  class oA extends qr {
33711
33724
  type = "NeedleRotation";
33712
33725
  initialize(e) {
33713
- e[zb] = Math.random();
33726
+ e[Ub] = Math.random();
33714
33727
  }
33715
33728
  update(e, t) {
33716
33729
  if (e.rotation === void 0) return;
33717
33730
  const i = e.age / e.life;
33718
- if (typeof e.rotation == "number" && (this.system.rotationOverLifetime.enabled ? e.rotation += this.system.rotationOverLifetime.evaluate(i, e[zb]) * t : this.system.renderer.renderMode === ps.Billboard && (e.rotation = Math.PI), this.system.rotationBySpeed.enabled)) {
33731
+ if (typeof e.rotation == "number" && (this.system.rotationOverLifetime.enabled ? e.rotation += this.system.rotationOverLifetime.evaluate(i, e[Ub]) * t : this.system.renderer.renderMode === ps.Billboard && (e.rotation = Math.PI), this.system.rotationBySpeed.enabled)) {
33719
33732
  const n = e.velocity.length();
33720
33733
  e.rotation += this.system.rotationBySpeed.evaluate(i, n) * t;
33721
33734
  }
@@ -33735,7 +33748,7 @@ class aA extends qr {
33735
33748
  this.system.sizeOverLifetime.enabled && (n *= this.system.sizeOverLifetime.evaluate(i, void 0, e[Nb]).x);
33736
33749
  let o = 1;
33737
33750
  this.system.renderer.renderMode !== ps.Mesh && (o = this.system.worldScale.x / this.system.cameraScale);
33738
- const r = z(e.startSize).multiplyScalar(n * o);
33751
+ const r = U(e.startSize).multiplyScalar(n * o);
33739
33752
  if (e.size.set(r.x, r.y, r.z), this.system.localspace) {
33740
33753
  const a = gx(this.system, rA);
33741
33754
  e.size.x *= a.x, e.size.y *= a.y, e.size.z *= a.z;
@@ -34137,8 +34150,8 @@ const Vt = class Pd extends R {
34137
34150
  set subEmitterSystems(e) {
34138
34151
  for (let t = 0; t < e.length; t++) {
34139
34152
  const i = e[t];
34140
- if (!(i instanceof Um)) {
34141
- const n = new Um();
34153
+ if (!(i instanceof zm)) {
34154
+ const n = new zm();
34142
34155
  Xa(n, i), e[t] = n;
34143
34156
  }
34144
34157
  }
@@ -34215,11 +34228,11 @@ const Vt = class Pd extends R {
34215
34228
  if (this._bursts && (this.emission.bursts = this._bursts, delete this._bursts), !this._isPlaying) return;
34216
34229
  const e = this.context.mainCamera;
34217
34230
  if (e) {
34218
- const n = qe(e);
34231
+ const n = Xe(e);
34219
34232
  this._cameraScale = n.x;
34220
34233
  }
34221
34234
  const t = !this.worldspace, i = this.gameObject;
34222
- if (ve(i, this.__worldQuaternion), this._worldQuaternionInverted.copy(this.__worldQuaternion).invert(), qe(this.gameObject, this._worldScale), t && this._container && this.gameObject?.parent) {
34235
+ if (ve(i, this.__worldQuaternion), this._worldQuaternionInverted.copy(this.__worldQuaternion).invert(), Xe(this.gameObject, this._worldScale), t && this._container && this.gameObject?.parent) {
34223
34236
  const n = gx(this, Fm);
34224
34237
  this._container.matrix.makeScale(n.x, n.y, n.z), this._container.matrix.makeRotationFromQuaternion(this.__worldQuaternion), this._container.matrix.setPosition(this.worldPos), this._container.matrix.scale(this.gameObject.scale);
34225
34238
  }
@@ -34238,53 +34251,53 @@ const Vt = class Pd extends R {
34238
34251
  }
34239
34252
  }
34240
34253
  };
34241
- ze([
34254
+ Ue([
34242
34255
  u(py)
34243
34256
  ], Vt.prototype, "colorOverLifetime");
34244
- ze([
34257
+ Ue([
34245
34258
  u(ni)
34246
34259
  ], Vt.prototype, "main");
34247
- ze([
34248
- u(zo)
34260
+ Ue([
34261
+ u(Uo)
34249
34262
  ], Vt.prototype, "emission");
34250
- ze([
34263
+ Ue([
34251
34264
  u(yl)
34252
34265
  ], Vt.prototype, "sizeOverLifetime");
34253
- ze([
34266
+ Ue([
34254
34267
  u(ux)
34255
34268
  ], Vt.prototype, "shape");
34256
- ze([
34269
+ Ue([
34257
34270
  u(we)
34258
34271
  ], Vt.prototype, "noise");
34259
- ze([
34272
+ Ue([
34260
34273
  u(Ve)
34261
34274
  ], Vt.prototype, "trails");
34262
- ze([
34263
- u(Xe)
34275
+ Ue([
34276
+ u(Qe)
34264
34277
  ], Vt.prototype, "velocityOverLifetime");
34265
- ze([
34278
+ Ue([
34266
34279
  u(vt)
34267
34280
  ], Vt.prototype, "limitVelocityOverLifetime");
34268
- ze([
34281
+ Ue([
34269
34282
  u(px)
34270
34283
  ], Vt.prototype, "inheritVelocity");
34271
- ze([
34284
+ Ue([
34272
34285
  u(dh)
34273
34286
  ], Vt.prototype, "colorBySpeed");
34274
- ze([
34287
+ Ue([
34275
34288
  u(si)
34276
34289
  ], Vt.prototype, "textureSheetAnimation");
34277
- ze([
34290
+ Ue([
34278
34291
  u(is)
34279
34292
  ], Vt.prototype, "rotationOverLifetime");
34280
- ze([
34293
+ Ue([
34281
34294
  u(kn)
34282
34295
  ], Vt.prototype, "rotationBySpeed");
34283
- ze([
34296
+ Ue([
34284
34297
  u(Ai)
34285
34298
  ], Vt.prototype, "sizeBySpeed");
34286
34299
  let su = Vt;
34287
- class Um {
34300
+ class zm {
34288
34301
  particleSystem;
34289
34302
  emitProbability = 1;
34290
34303
  properties;
@@ -34300,7 +34313,7 @@ function gx(s, e) {
34300
34313
  if (e.set(1, 1, 1), s.gameObject.parent && s.localspace)
34301
34314
  switch (s.main.scalingMode) {
34302
34315
  case Dm.Local:
34303
- e = qe(s.gameObject.parent, e), e.x = 1 / e.x, e.y = 1 / e.y, e.z = 1 / e.z;
34316
+ e = Xe(s.gameObject.parent, e), e.x = 1 / e.x, e.y = 1 / e.y, e.z = 1 / e.z;
34304
34317
  break;
34305
34318
  default:
34306
34319
  if (!s.unsupported_scaling_mode) {
@@ -34308,7 +34321,7 @@ function gx(s, e) {
34308
34321
  const t = "ParticleSystem scale mode " + Dm[s.main.scalingMode] + " is not supported";
34309
34322
  L() && _e(t), console.warn(t, s.name, s);
34310
34323
  }
34311
- e = qe(s.gameObject, e);
34324
+ e = Xe(s.gameObject, e);
34312
34325
  break;
34313
34326
  }
34314
34327
  return e;
@@ -34389,9 +34402,9 @@ class $c extends R {
34389
34402
  }
34390
34403
  }
34391
34404
  const lc = x("debugpost");
34392
- let zm = null;
34405
+ let Um = null;
34393
34406
  function pA(s) {
34394
- zm = s;
34407
+ Um = s;
34395
34408
  }
34396
34409
  function yx(s) {
34397
34410
  let e = s.gameObject;
@@ -34406,10 +34419,10 @@ function yx(s) {
34406
34419
  function mA(s) {
34407
34420
  let e = yx(s);
34408
34421
  if (!e)
34409
- if (zm) {
34422
+ if (Um) {
34410
34423
  lc && console.warn("Adding postprocessing manager to the scene.");
34411
34424
  const t = s.scene;
34412
- e = Hn(t, zm);
34425
+ e = Hn(t, Um);
34413
34426
  } else
34414
34427
  L() && console.warn("No post processing manager found");
34415
34428
  return e;
@@ -34434,10 +34447,10 @@ const ut = {
34434
34447
  /** Used to render effects at the end of the post-processing chain, e.g. for final adjustments or overlays. */
34435
34448
  AT_END: 1e4
34436
34449
  };
34437
- let Qe = null;
34450
+ let Ye = null;
34438
34451
  function gA(s) {
34439
- lc === "verbose" && console.debug("Before ordering effects", [...s]), Qe || (Qe = /* @__PURE__ */ new Map(), Qe.set(A.POSTPROCESSING.MODULE.NormalPass, ut.NormalPass), Qe.set(A.POSTPROCESSING.MODULE.DepthDownsamplingPass, ut.DepthDownsamplingPass), Qe.set(A.POSTPROCESSING.MODULE.SMAAEffect, ut.SMAA), Qe.set(A.POSTPROCESSING.MODULE.SSAOEffect, ut.SSAO), Qe.set(A.POSTPROCESSING_AO.MODULE.N8AOPostPass, ut.SSAO), Qe.set(A.POSTPROCESSING_AO.MODULE.N8AOPass, ut.SSAO), Qe.set(A.POSTPROCESSING.MODULE.TiltShiftEffect, ut.TiltShift), Qe.set(A.POSTPROCESSING.MODULE.DepthOfFieldEffect, ut.DepthOfField), Qe.set(A.POSTPROCESSING.MODULE.ChromaticAberrationEffect, ut.ChromaticAberration), Qe.set(A.POSTPROCESSING.MODULE.BloomEffect, ut.Bloom), Qe.set(A.POSTPROCESSING.MODULE.SelectiveBloomEffect, ut.Bloom), Qe.set(A.POSTPROCESSING.MODULE.VignetteEffect, ut.Vignette), Qe.set(A.POSTPROCESSING.MODULE.PixelationEffect, ut.Pixelation), Qe.set(A.POSTPROCESSING.MODULE.ToneMappingEffect, ut.ToneMapping), Qe.set(A.POSTPROCESSING.MODULE.HueSaturationEffect, ut.HueSaturation), Qe.set(A.POSTPROCESSING.MODULE.BrightnessContrastEffect, ut.BrightnessContrast)), s.sort((e, t) => {
34440
- const i = typeof e.priority == "number" ? e.priority : Qe.get(e.effect.constructor) ?? Number.NEGATIVE_INFINITY, n = typeof t.priority == "number" ? t.priority : Qe.get(t.effect.constructor) ?? Number.NEGATIVE_INFINITY;
34452
+ lc === "verbose" && console.debug("Before ordering effects", [...s]), Ye || (Ye = /* @__PURE__ */ new Map(), Ye.set(A.POSTPROCESSING.MODULE.NormalPass, ut.NormalPass), Ye.set(A.POSTPROCESSING.MODULE.DepthDownsamplingPass, ut.DepthDownsamplingPass), Ye.set(A.POSTPROCESSING.MODULE.SMAAEffect, ut.SMAA), Ye.set(A.POSTPROCESSING.MODULE.SSAOEffect, ut.SSAO), Ye.set(A.POSTPROCESSING_AO.MODULE.N8AOPostPass, ut.SSAO), Ye.set(A.POSTPROCESSING_AO.MODULE.N8AOPass, ut.SSAO), Ye.set(A.POSTPROCESSING.MODULE.TiltShiftEffect, ut.TiltShift), Ye.set(A.POSTPROCESSING.MODULE.DepthOfFieldEffect, ut.DepthOfField), Ye.set(A.POSTPROCESSING.MODULE.ChromaticAberrationEffect, ut.ChromaticAberration), Ye.set(A.POSTPROCESSING.MODULE.BloomEffect, ut.Bloom), Ye.set(A.POSTPROCESSING.MODULE.SelectiveBloomEffect, ut.Bloom), Ye.set(A.POSTPROCESSING.MODULE.VignetteEffect, ut.Vignette), Ye.set(A.POSTPROCESSING.MODULE.PixelationEffect, ut.Pixelation), Ye.set(A.POSTPROCESSING.MODULE.ToneMappingEffect, ut.ToneMapping), Ye.set(A.POSTPROCESSING.MODULE.HueSaturationEffect, ut.HueSaturation), Ye.set(A.POSTPROCESSING.MODULE.BrightnessContrastEffect, ut.BrightnessContrast)), s.sort((e, t) => {
34453
+ const i = typeof e.priority == "number" ? e.priority : Ye.get(e.effect.constructor) ?? Number.NEGATIVE_INFINITY, n = typeof t.priority == "number" ? t.priority : Ye.get(t.effect.constructor) ?? Number.NEGATIVE_INFINITY;
34441
34454
  return i === Number.NEGATIVE_INFINITY ? (lc && console.warn("Unknown effect found: ", e.constructor.name, e), 1) : n === Number.NEGATIVE_INFINITY ? (lc && console.warn("Unknown effect found: ", t.constructor.name, t), -1) : i - n;
34442
34455
  }), lc === "verbose" && console.debug("After ordering effects", [...s]);
34443
34456
  }
@@ -34993,7 +35006,7 @@ class ou extends ht {
34993
35006
  return this.effect;
34994
35007
  }
34995
35008
  }
34996
- var FA = Object.defineProperty, UA = (s, e, t, i) => {
35009
+ var FA = Object.defineProperty, zA = (s, e, t, i) => {
34997
35010
  for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
34998
35011
  (r = s[o]) && (n = r(e, t, n) || n);
34999
35012
  return n && FA(e, t, n), n;
@@ -35010,14 +35023,14 @@ class df extends ht {
35010
35023
  }, e;
35011
35024
  }
35012
35025
  }
35013
- UA([
35026
+ zA([
35014
35027
  u($)
35015
35028
  ], df.prototype, "granularity");
35016
35029
  Mn("PixelationEffect", df);
35017
- var zA = Object.defineProperty, fh = (s, e, t, i) => {
35030
+ var UA = Object.defineProperty, fh = (s, e, t, i) => {
35018
35031
  for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
35019
35032
  (r = s[o]) && (n = r(e, t, n) || n);
35020
- return n && zA(e, t, n), n;
35033
+ return n && UA(e, t, n), n;
35021
35034
  };
35022
35035
  class No extends ht {
35023
35036
  get typeName() {
@@ -35352,7 +35365,7 @@ vy([
35352
35365
  ], bl.prototype, "center");
35353
35366
  Mn("Vignette", bl);
35354
35367
  globalThis.NEEDLE_USE_POSTPROCESSING = globalThis.NEEDLE_USE_POSTPROCESSING !== void 0 ? globalThis.NEEDLE_USE_POSTPROCESSING : !0;
35355
- const ls = x("debugpost"), Tp = /* @__PURE__ */ Symbol("needle:postprocessing-handler"), Ul = /* @__PURE__ */ Symbol("needle:previous-autoclear-state"), zl = /* @__PURE__ */ Symbol("needle:previous-tone-mapping");
35368
+ const ls = x("debugpost"), Tp = /* @__PURE__ */ Symbol("needle:postprocessing-handler"), zl = /* @__PURE__ */ Symbol("needle:previous-autoclear-state"), Ul = /* @__PURE__ */ Symbol("needle:previous-tone-mapping");
35356
35369
  class xx {
35357
35370
  _composer = null;
35358
35371
  _lastVolumeComponents;
@@ -35384,7 +35397,7 @@ class xx {
35384
35397
  this._lastVolumeComponents.length = 0;
35385
35398
  }
35386
35399
  const t = this.context;
35387
- t[Tp] === this && (delete t[Tp], typeof t.renderer[Ul] == "boolean" && (t.renderer.autoClear = t.renderer[Ul]), typeof t.renderer[zl] == "number" && (t.renderer.toneMapping = t.renderer[zl])), this._composer?.removeAllPasses(), e && this._composer?.dispose(), t.composer === this._composer && (t.composer = null), this.handleDevicePixelRatio();
35400
+ t[Tp] === this && (delete t[Tp], typeof t.renderer[zl] == "boolean" && (t.renderer.autoClear = t.renderer[zl]), typeof t.renderer[Ul] == "number" && (t.renderer.toneMapping = t.renderer[Ul])), this._composer?.removeAllPasses(), e && this._composer?.dispose(), t.composer === this._composer && (t.composer = null), this.handleDevicePixelRatio();
35388
35401
  }
35389
35402
  dispose() {
35390
35403
  this.unapply(!0);
@@ -35465,7 +35478,7 @@ class xx {
35465
35478
  if (this._anyPassHasDepth = !1, this._anyPassHasNormal = !1, this._hasSmaaEffect = !1, this._effects.length <= 0)
35466
35479
  return;
35467
35480
  const t = e.mainCameraComponent, i = e.renderer, n = e.scene, o = t.threeCamera;
35468
- if (typeof i[Ul] == "boolean" && (i.autoClear = i[Ul]), i[Ul] = i.autoClear, typeof i[zl] == "number" && (i.toneMapping = i[zl]), i[zl] = i.toneMapping, i.toneMapping != Ed && !this._effects.find((h) => h instanceof A.POSTPROCESSING.MODULE.ToneMappingEffect)) {
35481
+ if (typeof i[zl] == "boolean" && (i.autoClear = i[zl]), i[zl] = i.autoClear, typeof i[Ul] == "number" && (i.toneMapping = i[Ul]), i[Ul] = i.toneMapping, i.toneMapping != Ed && !this._effects.find((h) => h instanceof A.POSTPROCESSING.MODULE.ToneMappingEffect)) {
35469
35482
  const h = new A.POSTPROCESSING.MODULE.ToneMappingEffect();
35470
35483
  h.name = `ToneMapping (${i.toneMapping})`, h.mode = kd(i.toneMapping), this._effects.push({
35471
35484
  typeName: "ToneMapping",
@@ -35776,7 +35789,7 @@ Sx([
35776
35789
  const od = /* @__PURE__ */ new Map();
35777
35790
  pA(ph);
35778
35791
  async function wy(s) {
35779
- const { NeedleEngineWebComponent: e } = await Promise.resolve().then(() => UL);
35792
+ const { NeedleEngineWebComponent: e } = await Promise.resolve().then(() => zL);
35780
35793
  e.observedAttributes.includes(s) || e.observedAttributes.push(s);
35781
35794
  }
35782
35795
  var QA = Object.defineProperty, wt = (s, e, t, i) => {
@@ -36365,7 +36378,7 @@ var tI = Object.defineProperty, iI = Object.getOwnPropertyDescriptor, Ii = (s, e
36365
36378
  (r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
36366
36379
  return i && n && tI(e, t, n), n;
36367
36380
  };
36368
- const Ye = x("debugvideo");
36381
+ const Ke = x("debugvideo");
36369
36382
  var Cx = /* @__PURE__ */ ((s) => (s[s.None = 0] = "None", s[s.AdjustHeight = 1] = "AdjustHeight", s[s.AdjustWidth = 2] = "AdjustWidth", s))(Cx || {}), Px = /* @__PURE__ */ ((s) => (s[s.VideoClip = 0] = "VideoClip", s[s.Url = 1] = "Url", s))(Px || {}), kx = /* @__PURE__ */ ((s) => (s[s.CameraFarPlane = 0] = "CameraFarPlane", s[s.CameraNearPlane = 1] = "CameraNearPlane", s[s.RenderTexture = 2] = "RenderTexture", s[s.MaterialOverride = 3] = "MaterialOverride", s))(kx || {});
36370
36383
  class yt extends R {
36371
36384
  playOnAwake = !0;
@@ -36500,7 +36513,7 @@ class yt extends R {
36500
36513
  wasPlaying = !1;
36501
36514
  /** ensure's the video element has been created and will start loading the clip */
36502
36515
  preloadVideo() {
36503
- Ye && console.log("Video Preload: " + this.name, this.clip), this.create(!1);
36516
+ Ke && console.log("Video Preload: " + this.name, this.clip), this.create(!1);
36504
36517
  }
36505
36518
  /** @deprecated use `preloadVideo()` */
36506
36519
  preload() {
@@ -36512,11 +36525,11 @@ class yt extends R {
36512
36525
  this.clip = e, this.source = 0, this._videoElement ? (this._videoElement.srcObject = e, this._isPlaying && this.play(), this.updateAspect()) : this.create(this.playOnAwake);
36513
36526
  }
36514
36527
  setClipURL(e) {
36515
- this._url !== e && (this._url = e, this.source = 1, Ye && console.log("set url", e), this._videoElement ? e.endsWith(".m3u8") || e.includes(".m3u") ? this.ensureM3UCanBePlayed() : (this._videoElement.src = e, this._isPlaying && (this.stop(), this.play())) : this.create(this.playOnAwake));
36528
+ this._url !== e && (this._url = e, this.source = 1, Ke && console.log("set url", e), this._videoElement ? e.endsWith(".m3u8") || e.includes(".m3u") ? this.ensureM3UCanBePlayed() : (this._videoElement.src = e, this._isPlaying && (this.stop(), this.play())) : this.create(this.playOnAwake));
36516
36529
  }
36517
36530
  /** @internal */
36518
36531
  onEnable() {
36519
- Ye && console.log("VideoPlayer.onEnable", Px[this.source], this.clip, this.url, this), window.addEventListener("visibilitychange", this.visibilityChanged), this.playOnAwake === !0 ? this.create(!0) : this.preloadVideo(), this.screenspace ? this._overlay?.start() : this._overlay?.stop();
36532
+ Ke && console.log("VideoPlayer.onEnable", Px[this.source], this.clip, this.url, this), window.addEventListener("visibilitychange", this.visibilityChanged), this.playOnAwake === !0 ? this.create(!0) : this.preloadVideo(), this.screenspace ? this._overlay?.start() : this._overlay?.stop();
36520
36533
  }
36521
36534
  /** @internal */
36522
36535
  onDisable() {
@@ -36550,7 +36563,7 @@ class yt extends R {
36550
36563
  /** start playing the video source */
36551
36564
  play() {
36552
36565
  if (this._videoElement || this.create(!1), !this._videoElement) {
36553
- Ye && console.warn("Can not play: no video element found", this);
36566
+ Ke && console.warn("Can not play: no video element found", this);
36554
36567
  return;
36555
36568
  }
36556
36569
  if (!(this._isPlaying && !this._videoElement?.ended && !this._videoElement?.paused)) {
@@ -36558,24 +36571,24 @@ class yt extends R {
36558
36571
  this.ensureM3UCanBePlayed();
36559
36572
  return;
36560
36573
  }
36561
- Ye && console.log("Video Play()", this.clip, this._videoElement, this.time), this._videoElement.currentTime = this.time, this._videoElement.play().catch((e) => {
36562
- console.log(e), Ye && console.error("Error playing video", e, "CODE=" + e.code, this.videoElement?.src, this), setTimeout(() => {
36574
+ Ke && console.log("Video Play()", this.clip, this._videoElement, this.time), this._videoElement.currentTime = this.time, this._videoElement.play().catch((e) => {
36575
+ console.log(e), Ke && console.error("Error playing video", e, "CODE=" + e.code, this.videoElement?.src, this), setTimeout(() => {
36563
36576
  this._isPlaying && !this.destroyed && this.activeAndEnabled && this.play();
36564
36577
  }, 1e3);
36565
- }), Ye && console.log("play", this._videoElement, this.time);
36578
+ }), Ke && console.log("play", this._videoElement, this.time);
36566
36579
  }
36567
36580
  }
36568
36581
  /**
36569
36582
  * Stop the video playback. This will reset the video to the beginning
36570
36583
  */
36571
36584
  stop() {
36572
- this._isPlaying = !1, this.time = 0, this._videoElement && (this._videoElement.currentTime = 0, this._videoElement.pause(), Ye && console.log("STOP", this));
36585
+ this._isPlaying = !1, this.time = 0, this._videoElement && (this._videoElement.currentTime = 0, this._videoElement.pause(), Ke && console.log("STOP", this));
36573
36586
  }
36574
36587
  /**
36575
36588
  * Pause the video playback
36576
36589
  */
36577
36590
  pause() {
36578
- this.time = this._videoElement?.currentTime ?? 0, this._isPlaying = !1, this._videoElement?.pause(), Ye && console.log("PAUSE", this, this.currentTime);
36591
+ this.time = this._videoElement?.currentTime ?? 0, this._isPlaying = !1, this._videoElement?.pause(), Ke && console.log("PAUSE", this, this.currentTime);
36579
36592
  }
36580
36593
  /** create the video element and assign the video source url or stream */
36581
36594
  create(e) {
@@ -36588,7 +36601,7 @@ class yt extends R {
36588
36601
  t = this.url, !t?.length && typeof this.clip == "string" && (t = this.clip);
36589
36602
  break;
36590
36603
  }
36591
- return t ? (this._videoElement || (Ye && console.warn("Create VideoElement", this), this._videoElement = this.createVideoElement(), this.context.domElement.shadowRoot.prepend(this._videoElement), this.updateVideoElementStyles()), typeof t == "string" ? (Ye && console.log("Set Video src", t), this._videoElement.src = t) : (Ye && console.log("Set Video srcObject", t), this._videoElement.srcObject = t), this._videoTexture || (this._videoTexture = new cC(this._videoElement)), this._videoTexture.flipY = !1, this._videoTexture.colorSpace = As, e && this.handleBeginPlaying(e), Ye && console.log("Video: handle playing done...", t, e), !0) : (Ye && console.warn("No video source set", this), !1);
36604
+ return t ? (this._videoElement || (Ke && console.warn("Create VideoElement", this), this._videoElement = this.createVideoElement(), this.context.domElement.shadowRoot.prepend(this._videoElement), this.updateVideoElementStyles()), typeof t == "string" ? (Ke && console.log("Set Video src", t), this._videoElement.src = t) : (Ke && console.log("Set Video srcObject", t), this._videoElement.srcObject = t), this._videoTexture || (this._videoTexture = new cC(this._videoElement)), this._videoTexture.flipY = !1, this._videoTexture.colorSpace = As, e && this.handleBeginPlaying(e), Ke && console.log("Video: handle playing done...", t, e), !0) : (Ke && console.warn("No video source set", this), !1);
36592
36605
  }
36593
36606
  updateAspect() {
36594
36607
  this.aspectMode !== 0 && this.startCoroutine(this.updateAspectImpl());
@@ -36611,7 +36624,7 @@ class yt extends R {
36611
36624
  _targetObjects;
36612
36625
  createVideoElement() {
36613
36626
  const e = document.createElement("video");
36614
- return this._crossOrigin && e.setAttribute("crossorigin", this._crossOrigin), Ye && console.log("created video element", e), e;
36627
+ return this._crossOrigin && e.setAttribute("crossorigin", this._crossOrigin), Ke && console.log("created video element", e), e;
36615
36628
  }
36616
36629
  handleBeginPlaying(e) {
36617
36630
  if (!this.activeAndEnabled || !this._videoElement) return;
@@ -36634,11 +36647,11 @@ class yt extends R {
36634
36647
  this._targetObjects.push(t), i !== this._videoMaterial && (this._videoMaterial = i.clone(), t.material = this._videoMaterial);
36635
36648
  const n = "map", o = this._videoMaterial;
36636
36649
  if (!this.targetMaterialProperty)
36637
- Ye && o[n] === void 0 && console.warn(`The target material does not have a '${n}' property, video might not render correctly.`), o[n] = this._videoTexture;
36650
+ Ke && o[n] === void 0 && console.warn(`The target material does not have a '${n}' property, video might not render correctly.`), o[n] = this._videoTexture;
36638
36651
  else
36639
36652
  switch (this.targetMaterialProperty) {
36640
36653
  default:
36641
- Ye && o[this.targetMaterialProperty] === void 0 && console.warn(`The target material does not have a '${this.targetMaterialProperty}' property, video might not render correctly.`), o[n] = this._videoTexture;
36654
+ Ke && o[this.targetMaterialProperty] === void 0 && console.warn(`The target material does not have a '${this.targetMaterialProperty}' property, video might not render correctly.`), o[n] = this._videoTexture;
36642
36655
  break;
36643
36656
  }
36644
36657
  } else {
@@ -36684,7 +36697,7 @@ class yt extends R {
36684
36697
  for (const o of this._targetObjects) {
36685
36698
  let r = 1;
36686
36699
  if (o.parent) {
36687
- const a = qe(o.parent);
36700
+ const a = Xe(o.parent);
36688
36701
  r = a.x / a.y;
36689
36702
  }
36690
36703
  switch (this.aspectMode) {
@@ -36706,11 +36719,11 @@ class yt extends R {
36706
36719
  ensureM3UCanBePlayed() {
36707
36720
  if (!this.shouldUseM3U) return;
36708
36721
  let e = document.head.querySelector("script[data-hls_library]");
36709
- e ? globalThis.Hls ? this.onHlsAvailable() : e.addEventListener("load", this.onHlsAvailable) : (Ye && console.log("HLS: load script"), e = document.createElement("script"), e.dataset.hls_library = "hls.js", e.src = "https://cdn.jsdelivr.net/npm/hls.js@1", e.addEventListener("load", this.onHlsAvailable), document.head.append(e));
36722
+ e ? globalThis.Hls ? this.onHlsAvailable() : e.addEventListener("load", this.onHlsAvailable) : (Ke && console.log("HLS: load script"), e = document.createElement("script"), e.dataset.hls_library = "hls.js", e.src = "https://cdn.jsdelivr.net/npm/hls.js@1", e.addEventListener("load", this.onHlsAvailable), document.head.append(e));
36710
36723
  }
36711
36724
  _hls;
36712
36725
  onHlsAvailable = () => {
36713
- Ye && console.log("HLS: available", this.clip), !(!this.shouldUseM3U || !this.url) && (this._hls || (this._hls = new Hls()), this.videoElement.autoplay = !0, this._hls.loadSource(this.url), this._hls.attachMedia(this.videoElement), this._videoElement?.play(), Ye && console.log("HLS: loaded", this.clip));
36726
+ Ke && console.log("HLS: available", this.clip), !(!this.shouldUseM3U || !this.url) && (this._hls || (this._hls = new Hls()), this.videoElement.autoplay = !0, this._hls.loadSource(this.url), this._hls.attachMedia(this.videoElement), this._videoElement?.play(), Ke && console.log("HLS: loaded", this.clip));
36714
36727
  };
36715
36728
  }
36716
36729
  Ii([
@@ -36776,7 +36789,7 @@ class nI {
36776
36789
  const e = this._videos[this._videos.length - 1];
36777
36790
  if (!e) return;
36778
36791
  if (this._isInScreenspaceMode = !0, !this._screenspaceModeQuad) {
36779
- if (this._screenspaceModeQuad = Ur.createPrimitive(Hc.Quad, {
36792
+ if (this._screenspaceModeQuad = zr.createPrimitive(Hc.Quad, {
36780
36793
  material: new oI(e)
36781
36794
  }), !this._screenspaceModeQuad) return;
36782
36795
  this._screenspaceModeQuad.geometry.scale(2, 2, 2);
@@ -37267,14 +37280,14 @@ class $o extends R {
37267
37280
  const t = this._referencePointDir.dot(this.context.mainCamera.worldForward) > 0.2;
37268
37281
  if (cI && this.referencePoint) {
37269
37282
  const i = this.gameObject.worldPosition;
37270
- U.DrawArrow(z(i), i.sub(this._referencePointDir), t ? 16711680 : 65280), U.DrawWireSphere(this.referencePoint.worldPosition, 0.05, 255);
37283
+ z.DrawArrow(U(i), i.sub(this._referencePointDir), t ? 16711680 : 65280), z.DrawWireSphere(this.referencePoint.worldPosition, 0.05, 255);
37271
37284
  }
37272
37285
  t ? this.updateAlpha(this.minAlpha, this.fadeDuration) : this.updateAlpha(1, this.fadeDuration);
37273
37286
  }
37274
37287
  // private readonly rendererMaterials = new WeakMap<Renderer, Array<MaterialWithState>>();
37275
37288
  // private readonly rendererMaterialsOriginal = new WeakMap<Renderer, Array<Material>>();
37276
37289
  updateDirection() {
37277
- this.referencePoint ??= this.context.scene, this._referencePointVector.copy(this.gameObject.worldPosition.sub(this.referencePoint.worldPosition)), this._distance = this._referencePointVector.length(), this._referencePointDir.copy(this._referencePointVector).multiply(z(1, 0.5, 1)).normalize();
37290
+ this.referencePoint ??= this.context.scene, this._referencePointVector.copy(this.gameObject.worldPosition.sub(this.referencePoint.worldPosition)), this._distance = this._referencePointVector.length(), this._referencePointDir.copy(this._referencePointVector).multiply(U(1, 0.5, 1)).normalize();
37278
37291
  }
37279
37292
  /**
37280
37293
  * Update the alpha of the object's materials towards the target alpha over the given duration.
@@ -37324,7 +37337,7 @@ class ff extends R {
37324
37337
  if (this.gameObject instanceof H)
37325
37338
  this.gameObject instanceof H && this.gameObject.material && (this.gameObject.material = this.gameObject.material.clone(), this.targetMesh = this.gameObject, this.targetMesh.receiveShadow = !0);
37326
37339
  else {
37327
- const e = Ur.createPrimitive(Hc.Quad, {
37340
+ const e = zr.createPrimitive(Hc.Quad, {
37328
37341
  name: "ShadowCatcher",
37329
37342
  material: new pt({
37330
37343
  // HACK heuristic to get approx. the same colors out as with the current default ShadowCatcher material
@@ -38081,7 +38094,7 @@ class wI {
38081
38094
  * Attempts to select an avatar to spectate through raycasting
38082
38095
  */
38083
38096
  trySelectObject() {
38084
- const e = new zr();
38097
+ const e = new Ur();
38085
38098
  e.setMask(16777215);
38086
38099
  const t = this.context.physics.raycast(e);
38087
38100
  if (wi && console.log(...t), t?.length)
@@ -38528,7 +38541,7 @@ class xl extends R {
38528
38541
  const e = new Ym({
38529
38542
  color: 6684927
38530
38543
  }), t = this.spline.length * 10, i = this._curve.getPoints(t), n = new yn().setFromPoints(i);
38531
- this._debugLine = new Ua(n, e), this.gameObject?.add(this._debugLine);
38544
+ this._debugLine = new za(n, e), this.gameObject?.add(this._debugLine);
38532
38545
  }
38533
38546
  }
38534
38547
  }
@@ -39095,7 +39108,7 @@ var FI = Object.defineProperty, mf = (s, e, t, i) => {
39095
39108
  (r = s[o]) && (n = r(e, t, n) || n);
39096
39109
  return n && FI(e, t, n), n;
39097
39110
  };
39098
- const UI = x("debugsignals");
39111
+ const zI = x("debugsignals");
39099
39112
  class ky {
39100
39113
  guid;
39101
39114
  }
@@ -39125,7 +39138,7 @@ const Dx = class ds extends R {
39125
39138
  events;
39126
39139
  /** @internal */
39127
39140
  awake() {
39128
- UI && console.log("SignalReceiver awake", this);
39141
+ zI && console.log("SignalReceiver awake", this);
39129
39142
  }
39130
39143
  /** @internal */
39131
39144
  onEnable() {
@@ -39223,7 +39236,7 @@ class bh {
39223
39236
  return 0;
39224
39237
  }
39225
39238
  }
39226
- class zI {
39239
+ class UI {
39227
39240
  clip;
39228
39241
  rootPositionOffset;
39229
39242
  rootQuaternionOffset;
@@ -39319,7 +39332,7 @@ class lu extends bh {
39319
39332
  if (!this._didBind) {
39320
39333
  this._didBind = !0, Vn && console.log(this.models), this.mixer ? this.target = this.mixer.getRoot() : console.warn("No mixer was assigned to animation track");
39321
39334
  for (const e of this.actions) {
39322
- const t = new zI(e);
39335
+ const t = new UI(e);
39323
39336
  this._actionOffsets.push(t);
39324
39337
  }
39325
39338
  this.target && (this._animator = C.getComponent(this.target, Tt) ?? null, this._animator && rb(this._animator.gameObject, this, !0));
@@ -40403,7 +40416,7 @@ class Go extends R {
40403
40416
  onPointerClick(e) {
40404
40417
  if (this.interactable && !(e.button !== 0 && e.event.pointerType === mg.Mouse) && (rr && (console.warn("Button Click", this.onClick), Ie("CLICKED button " + this.name + " at " + this.context.time.frameCount)), this.onClick && this.onClick.listenerCount > 0 && (this.onClick.invoke(), e.use(), this.context.accessibility.focus(this), rr))) {
40405
40418
  const t = this.gameObject.worldPosition;
40406
- t.add(this.gameObject.worldUp.multiplyScalar(1 + Math.random() * 0.5)), U.DrawLabel(t, "CLICK:" + Date.now(), 0.1, 1 + Math.random() * 0.5);
40419
+ t.add(this.gameObject.worldUp.multiplyScalar(1 + Math.random() * 0.5)), z.DrawLabel(t, "CLICK:" + Date.now(), 0.1, 1 + Math.random() * 0.5);
40407
40420
  }
40408
40421
  }
40409
40422
  colors;
@@ -40667,7 +40680,7 @@ vf([
40667
40680
  u(ce)
40668
40681
  ], wh.prototype, "onEndEdit");
40669
40682
  let Fx = wh;
40670
- var YI = Object.defineProperty, Ux = (s, e, t, i) => {
40683
+ var YI = Object.defineProperty, zx = (s, e, t, i) => {
40671
40684
  for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
40672
40685
  (r = s[o]) && (n = r(e, t, n) || n);
40673
40686
  return n && YI(e, t, n), n;
@@ -40690,7 +40703,7 @@ class wf extends R {
40690
40703
  e.style.display = "block", e.style.visibility = "hidden";
40691
40704
  const t = new FC();
40692
40705
  t.listenToPointerEvents(this.context.renderer, this.context.mainCamera), this.gameObject.add(t);
40693
- const i = new UC(e);
40706
+ const i = new zC(e);
40694
40707
  t.add(i), i.visible = !1;
40695
40708
  const n = i.material;
40696
40709
  n.transparent = !0, setTimeout(() => {
@@ -40713,10 +40726,10 @@ class wf extends R {
40713
40726
  this._object?.removeFromParent();
40714
40727
  }
40715
40728
  }
40716
- Ux([
40729
+ zx([
40717
40730
  u()
40718
40731
  ], wf.prototype, "id");
40719
- Ux([
40732
+ zx([
40720
40733
  u()
40721
40734
  ], wf.prototype, "keepAspect");
40722
40735
  const KI = {
@@ -40899,7 +40912,7 @@ var JI = Object.defineProperty, xf = (s, e, t, i) => {
40899
40912
  (r = s[o]) && (n = r(e, t, n) || n);
40900
40913
  return n && JI(e, t, n), n;
40901
40914
  };
40902
- const xh = class zx extends R {
40915
+ const xh = class Ux extends R {
40903
40916
  target;
40904
40917
  invertForward = !1;
40905
40918
  keepUpDirection = !0;
@@ -40910,7 +40923,7 @@ const xh = class zx extends R {
40910
40923
  let e = this.target;
40911
40924
  if (e || (e = this.context.mainCamera, L() && !this.__did_warn && (this.__did_warn = !0, console.debug(`[LookAt] No target set on ${this.name}, using main camera as target.`))), !e) return;
40912
40925
  let t = this.copyTargetRotation;
40913
- (this.context.isInVR || this.context.isInPassThrough) && (t = !1), Su(this.gameObject, e, this.keepUpDirection, t), this.invertForward && this.gameObject.quaternion.multiply(zx.flipYQuat);
40926
+ (this.context.isInVR || this.context.isInPassThrough) && (t = !1), Su(this.gameObject, e, this.keepUpDirection, t), this.invertForward && this.gameObject.quaternion.multiply(Ux.flipYQuat);
40914
40927
  }
40915
40928
  /** @internal */
40916
40929
  createBehaviours(e, t, i) {
@@ -40922,7 +40935,7 @@ const xh = class zx extends R {
40922
40935
  const a = this.invertForward ? -1 : 1;
40923
40936
  r.setMatrix(r.getMatrix().multiply(new ee().makeRotationZ(Math.PI / 2 * a))), t.setMatrix(t.getMatrix().multiply(new ee().makeRotationZ(-Math.PI / 2 * a)));
40924
40937
  }
40925
- const o = new zt(
40938
+ const o = new Ut(
40926
40939
  "lookat " + this.name,
40927
40940
  Jt.sceneStartTrigger(),
40928
40941
  me.lookAtCameraAction(
@@ -41116,9 +41129,9 @@ class Cl extends R {
41116
41129
  /** @internal */
41117
41130
  lateUpdate() {
41118
41131
  this.updateDistance();
41119
- const e = this.useFullPage ? this._ndc_x : this.context.input.mousePositionRC.x, t = this.useFullPage ? this._ndc_y : this.context.input.mousePositionRC.y, i = this.context.mainCamera, n = i.worldPosition, o = z(e, t, 1).unproject(i);
41132
+ const e = this.useFullPage ? this._ndc_x : this.context.input.mousePositionRC.x, t = this.useFullPage ? this._ndc_y : this.context.input.mousePositionRC.y, i = this.context.mainCamera, n = i.worldPosition, o = U(e, t, 1).unproject(i);
41120
41133
  o.sub(n).normalize();
41121
- const r = z(o).multiplyScalar(this._distance).add(n);
41134
+ const r = U(o).multiplyScalar(this._distance).add(n);
41122
41135
  let a = r;
41123
41136
  if (this.damping > 0) {
41124
41137
  const l = this.gameObject.worldPosition;
@@ -41130,7 +41143,7 @@ class Cl extends R {
41130
41143
  const l = this.context.physics.raycastFromRay(Lp);
41131
41144
  if (l?.length) {
41132
41145
  const c = l[0];
41133
- this.damping > 0 ? this.gameObject.worldPosition = a.lerp(c.point, this.context.time.deltaTime / this.damping) : this.gameObject.worldPosition = c.point, iL && U.DrawLine(c.point, c.normal.add(c.point), 65280);
41146
+ this.damping > 0 ? this.gameObject.worldPosition = a.lerp(c.point, this.context.time.deltaTime / this.damping) : this.gameObject.worldPosition = c.point, iL && z.DrawLine(c.point, c.normal.add(c.point), 65280);
41134
41147
  }
41135
41148
  }
41136
41149
  }
@@ -41438,10 +41451,10 @@ let at = class extends R {
41438
41451
  internalUpdate = () => {
41439
41452
  if (this.context.isInXR || this.destroyed || !this.activeAndEnabled) return;
41440
41453
  if (!(at.instances[at.instances.length - 1] === this)) {
41441
- (eo || this.debug) && U.DrawWireBox(this.gameObject.worldPosition, this.gameObject.worldScale, cL);
41454
+ (eo || this.debug) && z.DrawWireBox(this.gameObject.worldPosition, this.gameObject.worldScale, cL);
41442
41455
  return;
41443
41456
  }
41444
- (eo || this.debug) && U.DrawWireBox(this.gameObject.worldPosition, this.gameObject.worldScale, 14540032, 0, !0, this.gameObject.worldQuaternion);
41457
+ (eo || this.debug) && z.DrawWireBox(this.gameObject.worldPosition, this.gameObject.worldScale, 14540032, 0, !0, this.gameObject.worldQuaternion);
41445
41458
  const e = this.context.mainCamera;
41446
41459
  if (!e || !(e instanceof de))
41447
41460
  return;
@@ -41458,22 +41471,22 @@ let at = class extends R {
41458
41471
  l && (n = l.width, o = l.height, r = t / n, a = i / o), at._tempProjectionMatrix.copy(e.projectionMatrix), at._tempProjectionMatrixInverse.copy(e.projectionMatrixInverse);
41459
41472
  const c = e.view, h = e.zoom, d = e.aspect, f = e.fov;
41460
41473
  e.view = null, e.zoom = 1, e.fov = this.referenceFieldOfView, e.updateProjectionMatrix();
41461
- const p = this.gameObject.worldPosition, g = this.gameObject.worldScale, y = e.worldPosition, m = y.distanceTo(p), w = Math.max(g.x, g.y, g.z), b = z(y).sub(p);
41474
+ const p = this.gameObject.worldPosition, g = this.gameObject.worldScale, y = e.worldPosition, m = y.distanceTo(p), w = Math.max(g.x, g.y, g.z), b = U(y).sub(p);
41462
41475
  if (m < w) {
41463
41476
  (this.debug || eo) && console.warn("[ViewBox] Moving camera out of bounds", m, "<", w);
41464
- const W = z(b);
41477
+ const W = U(b);
41465
41478
  W.y *= 1e-8, W.normalize();
41466
41479
  const q = w - m, se = y.add(W.multiplyScalar(q));
41467
41480
  e.worldPosition = se.lerp(y, 1 - this.context.time.deltaTime);
41468
41481
  }
41469
- const v = z(p);
41482
+ const v = U(p);
41470
41483
  e.worldToLocal(v), e.lookAt(p), e.updateMatrixWorld();
41471
41484
  const T = this.referenceFieldOfView * Math.PI / 180, k = 2 * Math.tan(T / 2) * m, E = k * e.aspect, I = this.projectBoxIntoCamera(e, 1), j = I.maxX - I.minX, B = I.maxY - I.minY, X = this.fit(
41472
41485
  j * e.aspect,
41473
41486
  B,
41474
41487
  E / r,
41475
41488
  k / a
41476
- ) / (k * 0.5), O = z(p);
41489
+ ) / (k * 0.5), O = U(p);
41477
41490
  O.project(e), this.context.focusRectSettings.offsetX = O.x, this.context.focusRectSettings.offsetY = O.y, this.context.focusRectSettings.zoom = X, this.context.focusRect || this.context.setCameraFocusRect(this.context.domElement), e.view = c, e.zoom = h, e.aspect = d, e.fov = f, e.projectionMatrix.copy(at._tempProjectionMatrix), e.projectionMatrixInverse.copy(at._tempProjectionMatrixInverse);
41478
41491
  };
41479
41492
  /**
@@ -41485,14 +41498,14 @@ let at = class extends R {
41485
41498
  }
41486
41499
  projectBoxIntoCamera(s, e) {
41487
41500
  const t = 0.5 * e, i = [
41488
- z(-t, -t, -t),
41489
- z(t, -t, -t),
41490
- z(-t, t, -t),
41491
- z(t, t, -t),
41492
- z(-t, -t, t),
41493
- z(t, -t, t),
41494
- z(-t, t, t),
41495
- z(t, t, t)
41501
+ U(-t, -t, -t),
41502
+ U(t, -t, -t),
41503
+ U(-t, t, -t),
41504
+ U(t, t, -t),
41505
+ U(-t, -t, t),
41506
+ U(t, -t, t),
41507
+ U(-t, t, t),
41508
+ U(t, t, t)
41496
41509
  ];
41497
41510
  let n = Number.POSITIVE_INFINITY, o = Number.NEGATIVE_INFINITY, r = Number.POSITIVE_INFINITY, a = Number.NEGATIVE_INFINITY;
41498
41511
  for (let l = 0; l < i.length; l++) {
@@ -41553,7 +41566,7 @@ class Xo extends R {
41553
41566
  this.controlVisibility && (this.gameObject.visible = !1);
41554
41567
  return;
41555
41568
  }
41556
- this.controlVisibility && (this.gameObject.visible = !0), this.useGripSpace || t.targetRayMode === "transient-pointer" ? (this.gameObject.worldPosition = t.gripWorldPosition, this.gameObject.worldQuaternion = t.gripWorldQuaternion, this.gameObject.worldScale = z(t.xr.rigScale, t.xr.rigScale, t.xr.rigScale).multiply(this._startScale)) : (this.gameObject.worldPosition = t.rayWorldPosition, this.gameObject.worldQuaternion = t.rayWorldQuaternion, this.gameObject.worldScale = z(t.xr.rigScale, t.xr.rigScale, t.xr.rigScale).multiply(this._startScale));
41569
+ this.controlVisibility && (this.gameObject.visible = !0), this.useGripSpace || t.targetRayMode === "transient-pointer" ? (this.gameObject.worldPosition = t.gripWorldPosition, this.gameObject.worldQuaternion = t.gripWorldQuaternion, this.gameObject.worldScale = U(t.xr.rigScale, t.xr.rigScale, t.xr.rigScale).multiply(this._startScale)) : (this.gameObject.worldPosition = t.rayWorldPosition, this.gameObject.worldQuaternion = t.rayWorldQuaternion, this.gameObject.worldScale = U(t.xr.rigScale, t.xr.rigScale, t.xr.rigScale).multiply(this._startScale));
41557
41570
  }
41558
41571
  }
41559
41572
  /** @internal */
@@ -42388,7 +42401,7 @@ class Ko extends R {
42388
42401
  for (const d of this._allPlanes.values())
42389
42402
  !d.mesh || !d.mesh.visible || (this.bounds.makeEmpty(), d.mesh.traverse((f) => {
42390
42403
  f instanceof H && this.bounds.expandByObject(f);
42391
- }), this.bounds.getCenter(this.center), this.labelOffset.copy(h).sub(this.center).normalize().multiplyScalar(0.1), U.DrawLabel(
42404
+ }), this.bounds.getCenter(this.center), this.labelOffset.copy(h).sub(this.center).normalize().multiplyScalar(0.1), z.DrawLabel(
42392
42405
  this.center.add(this.labelOffset),
42393
42406
  (d.xrData.semanticLabel || "plane").toUpperCase() + `
42394
42407
  ` + d.xrData.lastChangedTime.toFixed(2),
@@ -42512,7 +42525,7 @@ class Ko extends R {
42512
42525
  if (f.userData.normalsHelper)
42513
42526
  f.userData.normalsHelper.update();
42514
42527
  else {
42515
- const p = new zC(f, 0.05, 255);
42528
+ const p = new UC(f, 0.05, 255);
42516
42529
  p.layers.disableAll(), p.layers.set(2), this.context.scene.add(p), f.userData.normalsHelper = p;
42517
42530
  }
42518
42531
  }));
@@ -42665,7 +42678,7 @@ P.add("SphereCollider", Jc);
42665
42678
  P.add("BoxCollider", $g);
42666
42679
  P.add("MeshCollider", Vr);
42667
42680
  P.add("CapsuleCollider", Oo);
42668
- P.add("ContactShadows", zu);
42681
+ P.add("ContactShadows", Uu);
42669
42682
  P.add("LogStats", dw);
42670
42683
  P.add("DeleteBox", Sr);
42671
42684
  P.add("Deletable", fw);
@@ -42758,7 +42771,7 @@ P.add("TransformGizmo", Sl);
42758
42771
  P.add("BaseUIComponent", xn);
42759
42772
  P.add("UIRootComponent", Zu);
42760
42773
  P.add("Button", Go);
42761
- P.add("Canvas", zc);
42774
+ P.add("Canvas", Uc);
42762
42775
  P.add("CanvasGroup", Lr);
42763
42776
  P.add("EventSystem", hi);
42764
42777
  P.add("Graphic", Ju);
@@ -42816,7 +42829,7 @@ async function kL(s, e, t, i = null, n) {
42816
42829
  }
42817
42830
  const o = [];
42818
42831
  let r = i;
42819
- typeof r == "number" && (r = new Ut(i));
42832
+ typeof r == "number" && (r = new zt(i));
42820
42833
  const a = e.indexOf("?");
42821
42834
  e = a === -1 ? e : e.substring(0, a);
42822
42835
  const l = new R0(t.scene);
@@ -42849,13 +42862,13 @@ const Hm = /* @__PURE__ */ Symbol("original-component-name"), la = /* @__PURE__
42849
42862
  function Gm(s, e, t, i) {
42850
42863
  if (e === null || !s) return;
42851
42864
  const n = s.guid, o = s.guid;
42852
- o?.length && (la.has(o) || (Pc && console.log('Creating InstanceIdProvider with key "' + o + '" for object ' + s.name), la.set(o, new Ut(o))));
42865
+ o?.length && (la.has(o) || (Pc && console.log('Creating InstanceIdProvider with key "' + o + '" for object ' + s.name), la.set(o, new zt(o))));
42853
42866
  const r = o && la.get(o) || e;
42854
42867
  if (s.guid = r.generateUUID(), n && n !== "invalid" && (t[n] = s.guid), s && s.userData && s.userData.components)
42855
42868
  for (const a of s.userData.components) {
42856
42869
  if (a === null) continue;
42857
42870
  const l = a.guid;
42858
- l ? la.has(l) || (Pc && console.log('Creating InstanceIdProvider with key "' + l + '" for component ' + a[Hm]), la.set(l, new Ut(l))) : Pc && console.warn("Can not create IdProvider: component " + a[Hm] + " has no guid", a.guid);
42871
+ l ? la.has(l) || (Pc && console.log('Creating InstanceIdProvider with key "' + l + '" for component ' + a[Hm]), la.set(l, new zt(l))) : Pc && console.warn("Can not create IdProvider: component " + a[Hm] + " has no guid", a.guid);
42859
42872
  const c = la.get(l) || e, h = a.guid;
42860
42873
  a.guid = c.generateUUID(), h && h !== "invalid" && (t[h] = a.guid), a.resolveGuids && i.push(a);
42861
42874
  }
@@ -43462,8 +43475,9 @@ class tS extends HTMLElement {
43462
43475
  _previousSrc = null;
43463
43476
  /** @private set to true after <needle-engine> did load completely at least once. Set to false when < to false when <needle-engine> is removed from the document removed from the document */
43464
43477
  _didFullyLoad = !1;
43478
+ _didInitialize = !1;
43465
43479
  constructor() {
43466
- super(), this._overlay_ar = new LL(), this.addEventListener("ready", this.onReady), V0(), this.attachShadow({ mode: "open", delegatesFocus: !0 }), this.setAttribute("role", "application"), this.setAttribute("aria-label", "Needle Engine 3D scene");
43480
+ super(), this.attachShadow({ mode: "open", delegatesFocus: !0 });
43467
43481
  const e = document.createElement("template");
43468
43482
  e.innerHTML = `<style>
43469
43483
  @import url('https://fonts.googleapis.com/css2?family=Roboto+Flex:opsz,wght@8..144,100..1000&display=swap');
@@ -43530,7 +43544,7 @@ class tS extends HTMLElement {
43530
43544
  }
43531
43545
  :host .quit-ar-button {
43532
43546
  position: absolute;
43533
- // top: env(titlebar-area-y); /** this doesnt work **/
43547
+ /** top: env(titlebar-area-y); this doesnt work **/
43534
43548
  top: 60px; /** camera access needs a bit more space **/
43535
43549
  right: 20px;
43536
43550
  z-index: 9999;
@@ -43542,13 +43556,20 @@ class tS extends HTMLElement {
43542
43556
  <div class="content">
43543
43557
  <slot class="overlay-content" style="display: contents;"></slot>
43544
43558
  </div>
43545
- `, this.shadowRoot && this.shadowRoot.appendChild(e.content.cloneNode(!0)), this._context = new N({ domElement: this }), this.addEventListener("error", this.onError);
43559
+ `, this.shadowRoot.appendChild(e.content.cloneNode(!0)), this.addEventListener("ready", this.onReady), this.addEventListener("error", this.onError);
43560
+ }
43561
+ ensureInitialized() {
43562
+ this._didInitialize || (this._didInitialize = !0, this.initializeDom());
43563
+ }
43564
+ // #region Init DOM
43565
+ initializeDom() {
43566
+ V0(), this.setAttribute("role", "application"), this.setAttribute("aria-label", "Needle Engine 3D scene");
43546
43567
  }
43547
43568
  /**
43548
43569
  * @internal
43549
43570
  */
43550
- async connectedCallback() {
43551
- if (Oe && console.log("<needle-engine> connected"), this.setPublicKey(), this.setVersion(), (this.getAttribute("tabindex") === null || this.getAttribute("tabindex") === void 0) && this.setAttribute("tabindex", "0"), this.addEventListener("xr-session-started", this.onXRSessionStarted), this.onSetupDesktop(), !this.getAttribute("src")) {
43571
+ connectedCallback() {
43572
+ if (Oe && 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 LL(), this._context ??= new N({ domElement: this }), this.addEventListener("xr-session-started", this.onXRSessionStarted), this.onSetupDesktop(), !this.getAttribute("src")) {
43552
43573
  const t = globalThis["needle:codegen_files"];
43553
43574
  Oe && console.log('src is null, trying to load from globalThis["needle:codegen_files"]', t), t && (Oe && console.log('globalThis["needle:codegen_files"]', t), this.setAttribute("src", t));
43554
43575
  }
@@ -43963,11 +43984,11 @@ function FL(s) {
43963
43984
  }
43964
43985
  }, { once: !0 });
43965
43986
  }
43966
- const UL = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
43987
+ const zL = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
43967
43988
  __proto__: null,
43968
43989
  NeedleEngineWebComponent: tS
43969
43990
  }, Symbol.toStringTag, { value: "Module" }));
43970
- function zL() {
43991
+ function UL() {
43971
43992
  Yn.registerWaitForInteraction(() => {
43972
43993
  const s = yC.getContext();
43973
43994
  s.addEventListener("statechange", () => {
@@ -43982,8 +44003,8 @@ function zL() {
43982
44003
  });
43983
44004
  });
43984
44005
  }
43985
- setTimeout(zL, 1e3);
43986
- const Ne = x("debugphysics"), Fp = x("debugcolliderplacement"), Up = x("debugcollisions"), NL = x("showcolliders"), ad = x("debugraycasts"), ri = /* @__PURE__ */ Symbol("needle component"), Dt = /* @__PURE__ */ Symbol("physics body"), rv = /* @__PURE__ */ Symbol("rigidbody");
44006
+ setTimeout(UL, 1e3);
44007
+ const Ne = x("debugphysics"), Fp = x("debugcolliderplacement"), zp = x("debugcollisions"), NL = x("showcolliders"), ad = x("debugraycasts"), ri = /* @__PURE__ */ Symbol("needle component"), Dt = /* @__PURE__ */ Symbol("physics body"), rv = /* @__PURE__ */ Symbol("rigidbody");
43987
44008
  globalThis.NEEDLE_USE_RAPIER = globalThis.NEEDLE_USE_RAPIER !== void 0 ? globalThis.NEEDLE_USE_RAPIER : !0;
43988
44009
  Ne && console.log("Use Rapier", !0, globalThis.NEEDLE_USE_RAPIER);
43989
44010
  pe.registerCallback(ue.ContextCreationStart, (s) => {
@@ -44106,7 +44127,7 @@ class Oc {
44106
44127
  n === void 0 && (n = 1 / 0), o === void 0 && (o = !0);
44107
44128
  const r = this.getPhysicsRay(this.rapierRay, e, t);
44108
44129
  if (!r) return null;
44109
- (this.debugRenderRaycasts || ad) && U.DrawRay(r.origin, r.dir, 255, 1);
44130
+ (this.debugRenderRaycasts || ad) && z.DrawRay(r.origin, r.dir, 255, 1);
44110
44131
  const a = this.world?.castRay(r, n, o, i?.queryFilterFlags, i?.filterGroups, void 0, void 0, (l) => {
44111
44132
  const c = l[ri];
44112
44133
  return i?.filterPredicate ? i.filterPredicate(c) : i?.useIgnoreRaycastLayer !== !1 ? !c?.gameObject.layers.isEnabled(2) : !0;
@@ -44124,7 +44145,7 @@ class Oc {
44124
44145
  n === void 0 && (n = 1 / 0), o === void 0 && (o = !0);
44125
44146
  const r = this.getPhysicsRay(this.rapierRay, e, t);
44126
44147
  if (!r) return null;
44127
- (this.debugRenderRaycasts || ad) && U.DrawRay(r.origin, r.dir, 255, 1);
44148
+ (this.debugRenderRaycasts || ad) && z.DrawRay(r.origin, r.dir, 255, 1);
44128
44149
  const a = this.world?.castRayAndGetNormal(r, n, o, i?.queryFilterFlags, i?.filterGroups, void 0, void 0, (l) => {
44129
44150
  const c = l[ri];
44130
44151
  return i?.filterPredicate ? i.filterPredicate(c) : i?.useIgnoreRaycastLayer !== !1 ? !c?.gameObject.layers.isEnabled(2) : !0;
@@ -44173,7 +44194,7 @@ class Oc {
44173
44194
  * @returns array of colliders that overlap with the sphere. Note: they currently only contain the collider and the gameobject
44174
44195
  */
44175
44196
  sphereOverlap(e, t) {
44176
- return this.rapierSphere ??= new A.RAPIER_PHYSICS.MODULE.Ball(t), this.rapierSphere.radius = t, (this.debugRenderRaycasts || ad) && U.DrawWireSphere(e, t, 3359999, 1), this.shapeOverlap(e, this.rapierIdentityRotation, this.rapierSphere);
44197
+ return this.rapierSphere ??= new A.RAPIER_PHYSICS.MODULE.Ball(t), this.rapierSphere.radius = t, (this.debugRenderRaycasts || ad) && z.DrawWireSphere(e, t, 3359999, 1), this.shapeOverlap(e, this.rapierIdentityRotation, this.rapierSphere);
44177
44198
  }
44178
44199
  /** box overlap detection using rapier against colliders
44179
44200
  * @param point center of the box in worldspace
@@ -44182,7 +44203,7 @@ class Oc {
44182
44203
  * @returns array of colliders that overlap with the box. Note: they currently only contain the collider and the gameobject
44183
44204
  */
44184
44205
  boxOverlap(e, t, i = null) {
44185
- return i === null && (i = this.rapierIdentityRotation), this.rapierBox ??= new A.RAPIER_PHYSICS.MODULE.Cuboid(1, 1, 1), this.rapierBox.halfExtents.x = t.x * 0.5, this.rapierBox.halfExtents.y = t.y * 0.5, this.rapierBox.halfExtents.z = t.z * 0.5, (this.debugRenderRaycasts || ad) && U.DrawWireBox(e, t, 3359999, 1, !0, i), this.shapeOverlap(e, i, this.rapierBox);
44206
+ return i === null && (i = this.rapierIdentityRotation), this.rapierBox ??= new A.RAPIER_PHYSICS.MODULE.Cuboid(1, 1, 1), this.rapierBox.halfExtents.x = t.x * 0.5, this.rapierBox.halfExtents.y = t.y * 0.5, this.rapierBox.halfExtents.z = t.z * 0.5, (this.debugRenderRaycasts || ad) && z.DrawWireBox(e, t, 3359999, 1, !0, i), this.shapeOverlap(e, i, this.rapierBox);
44186
44207
  }
44187
44208
  shapeOverlap(e, t, i) {
44188
44209
  return this.rapierColliderArray.length = 0, this._isInitialized ? this.world ? (this.world.intersectionsWithShape(
@@ -44240,7 +44261,7 @@ class Oc {
44240
44261
  Ne && console.warn("Physics are disabled");
44241
44262
  return;
44242
44263
  }
44243
- const i = e.gameObject, n = qe(i, this._tempPosition).multiply(t);
44264
+ const i = e.gameObject, n = Xe(i, this._tempPosition).multiply(t);
44244
44265
  n.multiplyScalar(0.5), n.x < 0 && (n.x = Math.abs(n.x)), n.y < 0 && (n.y = Math.abs(n.y)), n.z < 0 && (n.z = Math.abs(n.z));
44245
44266
  const o = 1e-7;
44246
44267
  n.x < o && (n.x = o), n.y < o && (n.y = o), n.z < o && (n.z = o);
@@ -44461,12 +44482,12 @@ Error:`, r), null;
44461
44482
  switch (i.type) {
44462
44483
  // Sphere Collider
44463
44484
  case A.RAPIER_PHYSICS.MODULE.ShapeType.Ball: {
44464
- const f = i, p = e, g = e.gameObject, y = qe(g, this._tempPosition), m = Math.abs(p.radius * y.x);
44485
+ const f = i, p = e, g = e.gameObject, y = Xe(g, this._tempPosition), m = Math.abs(p.radius * y.x);
44465
44486
  n = f.radius !== m, f.radius = m, n && t.setShape(f);
44466
44487
  break;
44467
44488
  }
44468
44489
  case A.RAPIER_PHYSICS.MODULE.ShapeType.Cuboid:
44469
- const o = i, r = e, a = e.gameObject, l = qe(a, this._tempPosition), c = Math.abs(r.size.x * 0.5 * l.x), h = Math.abs(r.size.y * 0.5 * l.y), d = Math.abs(r.size.z * 0.5 * l.z);
44490
+ const o = i, r = e, a = e.gameObject, l = Xe(a, this._tempPosition), c = Math.abs(r.size.x * 0.5 * l.x), h = Math.abs(r.size.y * 0.5 * l.y), d = Math.abs(r.size.z * 0.5 * l.z);
44470
44491
  n = o.halfExtents.x !== c || o.halfExtents.y !== h || o.halfExtents.z !== d, o.halfExtents.x = c, o.halfExtents.y = h, o.halfExtents.z = d, n && t.setShape(o);
44471
44492
  break;
44472
44493
  }
@@ -44546,7 +44567,7 @@ Error:`, r), null;
44546
44567
  const a = t.center;
44547
44568
  if (a && a.isVector3) {
44548
44569
  this._tempQuaternion.set(r.x, r.y, r.z, r.w);
44549
- const l = this._tempPosition.copy(a).applyQuaternion(this._tempQuaternion), c = qe(t.gameObject);
44570
+ const l = this._tempPosition.copy(a).applyQuaternion(this._tempQuaternion), c = Xe(t.gameObject);
44550
44571
  l.multiply(c), o.x -= l.x, o.y -= l.y, o.z -= l.z;
44551
44572
  }
44552
44573
  Wa(t.gameObject, o.x, o.y, o.z), Vv(t.gameObject, r.x, r.y, r.z, r.w);
@@ -44583,12 +44604,12 @@ Error:`, r), null;
44583
44604
  _tempCenterQuaternion = new V();
44584
44605
  tryApplyCenter(e, t) {
44585
44606
  const i = e.center;
44586
- i && e.gameObject && (i.x !== 0 || i.y !== 0 || i.z !== 0) && (this._tempCenterPos.x = i.x, this._tempCenterPos.y = i.y, this._tempCenterPos.z = i.z, qe(e.gameObject, this._tempCenterVec), this._tempCenterPos.multiply(this._tempCenterVec), e.attachedRigidbody ? this._tempCenterPos.applyQuaternion(e.gameObject.quaternion) : (ve(e.gameObject, this._tempCenterQuaternion), this._tempCenterPos.applyQuaternion(this._tempCenterQuaternion)), t.x += this._tempCenterPos.x, t.y += this._tempCenterPos.y, t.z += this._tempCenterPos.z);
44607
+ i && e.gameObject && (i.x !== 0 || i.y !== 0 || i.z !== 0) && (this._tempCenterPos.x = i.x, this._tempCenterPos.y = i.y, this._tempCenterPos.z = i.z, Xe(e.gameObject, this._tempCenterVec), this._tempCenterPos.multiply(this._tempCenterVec), e.attachedRigidbody ? this._tempCenterPos.applyQuaternion(e.gameObject.quaternion) : (ve(e.gameObject, this._tempCenterQuaternion), this._tempCenterPos.applyQuaternion(this._tempCenterQuaternion)), t.x += this._tempCenterPos.x, t.y += this._tempCenterPos.y, t.z += this._tempCenterPos.z);
44587
44608
  }
44588
44609
  static _matricesBuffer = [];
44589
44610
  getRigidbodyRelativeMatrix(e, t, i, n) {
44590
44611
  if (n === void 0 && (n = Oc._matricesBuffer, n.length = 0), e === t) {
44591
- const o = qe(e, this._tempPosition);
44612
+ const o = Xe(e, this._tempPosition);
44592
44613
  i.makeScale(o.x, o.y, o.z);
44593
44614
  for (let r = n.length - 1; r >= 0; r--)
44594
44615
  i.multiply(n[r]);
@@ -44644,7 +44665,7 @@ class $L {
44644
44665
  const n = this.world.getCollider(e), o = this.world.getCollider(t);
44645
44666
  if (!n || !o) return;
44646
44667
  const r = n[ri], a = o[ri];
44647
- Up && console.log("EVT", r.name, a.name, i, n, o), r && a && (i ? (this.onCollisionStarted(r, n, a, o), this.onCollisionStarted(a, o, r, n)) : (this.onCollisionEnded(r, a), this.onCollisionEnded(a, r)));
44668
+ zp && console.log("EVT", r.name, a.name, i, n, o), r && a && (i ? (this.onCollisionStarted(r, n, a, o), this.onCollisionStarted(a, o, r, n)) : (this.onCollisionEnded(r, a), this.onCollisionEnded(a, r)));
44648
44669
  });
44649
44670
  }
44650
44671
  update() {
@@ -44662,7 +44683,7 @@ class $L {
44662
44683
  Ya(r, (c) => {
44663
44684
  if (c.destroyed) return;
44664
44685
  const h = c.onCollisionEnter || c.onCollisionStay || c.onCollisionExit;
44665
- if (h || Up) {
44686
+ if (h || zp) {
44666
44687
  if (!o) {
44667
44688
  const d = [], f = a.normal();
44668
44689
  i instanceof Vr && i.convex && (f.x = -f.x, f.y = -f.y, f.z = -f.z);
@@ -44670,7 +44691,7 @@ class $L {
44670
44691
  const g = a.solverContactPoint(p), y = a.contactImpulse(p);
44671
44692
  if (g) {
44672
44693
  const m = a.contactDist(p), w = a.solverContactFriction(p), b = a.solverContactTangentVelocity(p), v = new PP(g, m, f, y, w, b);
44673
- d.push(v), Up && U.DrawDirection(g, f, 16711680, 3, !0);
44694
+ d.push(v), zp && z.DrawDirection(g, f, 16711680, 3, !0);
44674
44695
  }
44675
44696
  }
44676
44697
  o = new kP(r, i, d);
@@ -44827,7 +44848,7 @@ function HL(s, e, t) {
44827
44848
  const i = new Set(t);
44828
44849
  return Array.from(i);
44829
44850
  }
44830
- const cv = "needle-button", zp = L();
44851
+ const cv = "needle-button", Up = L();
44831
44852
  class GL extends HTMLElement {
44832
44853
  static observedAttributes = ["ar", "vr", "quicklook", "qrcode"];
44833
44854
  constructor() {
@@ -44856,7 +44877,7 @@ class GL extends HTMLElement {
44856
44877
  else if (this.getAttribute("qrcode") != null)
44857
44878
  this.#r ??= new pn(), this.#e = this.#r.createQRCode({ anchorElement: this }), this.setAttribute("aria-label", "Share application with QR code");
44858
44879
  else {
44859
- zp ? console.warn("No button type specified for <needle-button>. Use either ar, vr or quicklook attribute.") : console.debug("No button type specified for <needle-button>. Use either ar, vr or quicklook attribute."), this.setAttribute("aria-label", "Needle Button with no specified type");
44880
+ Up ? console.warn("No button type specified for <needle-button>. Use either ar, vr or quicklook attribute.") : console.debug("No button type specified for <needle-button>. Use either ar, vr or quicklook attribute."), this.setAttribute("aria-label", "Needle Button with no specified type");
44860
44881
  return;
44861
44882
  }
44862
44883
  this.#t ??= this.attachShadow({ mode: "open" }), this.#n ??= document.createElement("slot"), this.#s ??= document.createElement("style"), this.#s.innerHTML = `
@@ -44892,13 +44913,13 @@ class GL extends HTMLElement {
44892
44913
  justify-content: center;
44893
44914
  gap: .5rem;
44894
44915
  }
44895
- `), this.#n.innerHTML = this.#e.innerHTML, this.#n.style.cssText = "display: flex; align-items: center; justify-content: center;", this.#e.innerHTML = this.#n.outerHTML, this.#t.innerHTML = this.#e.outerHTML, this.#t.prepend(this.#s), qd(mm, { element: this.#t }), this.#o?.disconnect(), this.#o ??= new MutationObserver(() => this.#c()), this.#o.observe(this.#e, { attributes: !0 }), zp && console.log("Needle Button updated", this);
44916
+ `), this.#n.innerHTML = this.#e.innerHTML, this.#n.style.cssText = "display: flex; align-items: center; justify-content: center;", this.#e.innerHTML = this.#n.outerHTML, this.#t.innerHTML = this.#e.outerHTML, this.#t.prepend(this.#s), qd(mm, { element: this.#t }), this.#o?.disconnect(), this.#o ??= new MutationObserver(() => this.#c()), this.#o.observe(this.#e, { attributes: !0 }), Up && console.log("Needle Button updated", this);
44896
44917
  }
44897
44918
  #c() {
44898
44919
  this.#e && (this.#e.style.display === "none" ? this.style.display = "none" : this.style.display === "none" && (this.style.display = ""));
44899
44920
  }
44900
44921
  #a = (e) => {
44901
- zp && console.log("Needle Button clicked", { defaultPrevented: e.defaultPrevented, hasButton: !!this.#e }), !e.defaultPrevented && this.#e && this.#e.click();
44922
+ Up && console.log("Needle Button clicked", { defaultPrevented: e.defaultPrevented, hasButton: !!this.#e }), !e.defaultPrevented && this.#e && this.#e.click();
44902
44923
  };
44903
44924
  }
44904
44925
  typeof window < "u" && !window.customElements.get(cv) && window.customElements.define(cv, GL);
@@ -45091,7 +45112,7 @@ const x2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45091
45112
  BaseUIComponent: xn,
45092
45113
  BasicIKConstraint: cw,
45093
45114
  BehaviorExtension: Yw,
45094
- BehaviorModel: zt,
45115
+ BehaviorModel: Ut,
45095
45116
  BloomEffect: by,
45096
45117
  BoxCollider: $g,
45097
45118
  BoxGizmo: fl,
@@ -45100,7 +45121,7 @@ const x2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45100
45121
  CallInfo: co,
45101
45122
  Camera: xi,
45102
45123
  CameraTargetReachedEvent: Zd,
45103
- Canvas: zc,
45124
+ Canvas: Uc,
45104
45125
  CanvasGroup: Lr,
45105
45126
  CapsuleCollider: Oo,
45106
45127
  ChangeMaterialOnClick: Ww,
@@ -45112,7 +45133,7 @@ const x2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45112
45133
  ColorAdjustments: Xr,
45113
45134
  ColorBySpeedModule: dh,
45114
45135
  ColorOverLifetimeModule: py,
45115
- ContactShadows: zu,
45136
+ ContactShadows: Uu,
45116
45137
  ControlTrackHandler: My,
45117
45138
  CursorFollow: Cl,
45118
45139
  CustomBranding: ul,
@@ -45125,7 +45146,7 @@ const x2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45125
45146
  DropListener: Lo,
45126
45147
  Duplicatable: kw,
45127
45148
  EffectWrapper: ou,
45128
- EmissionModule: zo,
45149
+ EmissionModule: Uo,
45129
45150
  EmphasizeOnClick: ih,
45130
45151
  EnvironmentScene: Ay,
45131
45152
  EventList: ce,
@@ -45237,8 +45258,8 @@ const x2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45237
45258
  Sprite: Do,
45238
45259
  SpriteData: vc,
45239
45260
  SpriteRenderer: Ei,
45240
- SpriteSheet: Uc,
45241
- SubEmitterSystem: Um,
45261
+ SpriteSheet: zc,
45262
+ SubEmitterSystem: zm,
45242
45263
  SyncedCamera: Ax,
45243
45264
  SyncedRoom: os,
45244
45265
  SyncedTransform: Kn,
@@ -45264,7 +45285,7 @@ const x2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45264
45285
  USDZUIExtension: lx,
45265
45286
  UsageMarker: Nu,
45266
45287
  VariantAction: $w,
45267
- VelocityOverLifetimeModule: Xe,
45288
+ VelocityOverLifetimeModule: Qe,
45268
45289
  VerticalLayoutGroup: nx,
45269
45290
  VideoPlayer: yt,
45270
45291
  get ViewBox() {
@@ -45433,7 +45454,7 @@ export {
45433
45454
  lr as AnimatorConditionMode,
45434
45455
  vn as AnimatorController,
45435
45456
  Z0 as AnimatorControllerParameterType,
45436
- Uh as AnimatorStateInfo,
45457
+ zh as AnimatorStateInfo,
45437
45458
  af as Antialiasing,
45438
45459
  Yn as Application,
45439
45460
  _k as AssetDatabase,
@@ -45459,7 +45480,7 @@ export {
45459
45480
  xn as BaseUIComponent,
45460
45481
  cw as BasicIKConstraint,
45461
45482
  Yw as BehaviorExtension,
45462
- zt as BehaviorModel,
45483
+ Ut as BehaviorModel,
45463
45484
  Ka as BlobStorage,
45464
45485
  by as BloomEffect,
45465
45486
  $g as BoxCollider,
@@ -45471,7 +45492,7 @@ export {
45471
45492
  co as CallInfo,
45472
45493
  xi as Camera,
45473
45494
  Zd as CameraTargetReachedEvent,
45474
- zc as Canvas,
45495
+ Uc as Canvas,
45475
45496
  Lr as CanvasGroup,
45476
45497
  Oo as CapsuleCollider,
45477
45498
  Ww as ChangeMaterialOnClick,
@@ -45495,7 +45516,7 @@ export {
45495
45516
  x2 as Components,
45496
45517
  HP as ConnectionEvents,
45497
45518
  PP as ContactPoint,
45498
- zu as ContactShadows,
45519
+ Uu as ContactShadows,
45499
45520
  N as Context,
45500
45521
  XD as ContextArgs,
45501
45522
  ue as ContextEvent,
@@ -45516,7 +45537,7 @@ export {
45516
45537
  Lo as DropListener,
45517
45538
  kw as Duplicatable,
45518
45539
  ou as EffectWrapper,
45519
- zo as EmissionModule,
45540
+ Uo as EmissionModule,
45520
45541
  ih as EmphasizeOnClick,
45521
45542
  du as EngineLoadingView,
45522
45543
  Ay as EnvironmentScene,
@@ -45534,7 +45555,7 @@ export {
45534
45555
  Ce as FrameEvent,
45535
45556
  Rc as GENERATOR,
45536
45557
  C as GameObject,
45537
- U as Gizmos,
45558
+ z as Gizmos,
45538
45559
  Aw as GltfExport,
45539
45560
  Tw as GltfExportBox,
45540
45561
  ml as Gradient,
@@ -45563,7 +45584,7 @@ export {
45563
45584
  Ja as InstancingHandler,
45564
45585
  _n as InstancingUtil,
45565
45586
  Ek as InstantiateEvent,
45566
- Ut as InstantiateIdProvider,
45587
+ zt as InstantiateIdProvider,
45567
45588
  Jn as InstantiateOptions,
45568
45589
  uw as Interactable,
45569
45590
  hu as InternalScreenshotUtils,
@@ -45574,7 +45595,7 @@ export {
45574
45595
  lh as LODModel,
45575
45596
  FD as LeftRoomResponse,
45576
45597
  Wt as Light,
45577
- UO as LightData,
45598
+ zO as LightData,
45578
45599
  vt as LimitVelocityOverLifetimeModule,
45579
45600
  b2 as LoadingElementOptions,
45580
45601
  dw as LogStats,
@@ -45600,7 +45621,7 @@ export {
45600
45621
  mb as NeedleEngineModelLoader,
45601
45622
  tS as NeedleEngineWebComponent,
45602
45623
  Ns as NeedleMenu,
45603
- Uf as NeedlePatchesKey,
45624
+ zf as NeedlePatchesKey,
45604
45625
  l0 as NeedleXRController,
45605
45626
  K as NeedleXRSession,
45606
45627
  XP as NeedleXRSync,
@@ -45613,7 +45634,7 @@ export {
45613
45634
  Ak as NewInstanceModel,
45614
45635
  we as NoiseModule,
45615
45636
  wn as ObjectRaycaster,
45616
- Ur as ObjectUtils,
45637
+ zr as ObjectUtils,
45617
45638
  pl as OffsetConstraint,
45618
45639
  Lf as OneEuroFilter,
45619
45640
  $v as OneEuroFilterXYZ,
@@ -45660,7 +45681,7 @@ export {
45660
45681
  ae as RGBAColor,
45661
45682
  Oc as RapierPhysics,
45662
45683
  Ty as RawImage,
45663
- zr as RaycastOptions,
45684
+ Ur as RaycastOptions,
45664
45685
  yT as Rect,
45665
45686
  Zn as RectTransform,
45666
45687
  ao as ReflectionProbe,
@@ -45672,7 +45693,7 @@ export {
45672
45693
  FO as RendererData,
45673
45694
  Sw as RendererLightmap,
45674
45695
  Je as Rigidbody,
45675
- Ke as RigidbodyConstraints,
45696
+ Ze as RigidbodyConstraints,
45676
45697
  ie as RoomEvents,
45677
45698
  kn as RotationBySpeedModule,
45678
45699
  is as RotationOverLifetimeModule,
@@ -45713,11 +45734,11 @@ export {
45713
45734
  Do as Sprite,
45714
45735
  vc as SpriteData,
45715
45736
  Ei as SpriteRenderer,
45716
- Uc as SpriteSheet,
45737
+ zc as SpriteSheet,
45717
45738
  n2 as StateMachineBehaviour,
45718
45739
  iw as StreamEndedEvent,
45719
45740
  tE as StreamReceivedEvent,
45720
- Um as SubEmitterSystem,
45741
+ zm as SubEmitterSystem,
45721
45742
  Ax as SyncedCamera,
45722
45743
  os as SyncedRoom,
45723
45744
  Kn as SyncedTransform,
@@ -45730,7 +45751,7 @@ export {
45730
45751
  sy as TextExtension,
45731
45752
  si as TextureSheetAnimationModule,
45732
45753
  Vs as TiltShiftEffect,
45733
- zO as Time,
45754
+ UO as Time,
45734
45755
  Dr as ToneMappingEffect,
45735
45756
  bh as TrackHandler,
45736
45757
  Ni as TrackType,
@@ -45751,10 +45772,10 @@ export {
45751
45772
  lx as USDZUIExtension,
45752
45773
  FM as UriSerializer,
45753
45774
  Nu as UsageMarker,
45754
- UD as UserJoinedOrLeftRoomModel,
45775
+ zD as UserJoinedOrLeftRoomModel,
45755
45776
  Gi as VERSION,
45756
45777
  $w as VariantAction,
45757
- Xe as VelocityOverLifetimeModule,
45778
+ Qe as VelocityOverLifetimeModule,
45758
45779
  nx as VerticalLayoutGroup,
45759
45780
  yt as VideoPlayer,
45760
45781
  at as ViewBox,
@@ -45856,7 +45877,7 @@ export {
45856
45877
  WD as getResourceUserCount,
45857
45878
  T1 as getTempColor,
45858
45879
  _i as getTempQuaternion,
45859
- z as getTempVector,
45880
+ U as getTempVector,
45860
45881
  vu as getUrlParams,
45861
45882
  V1 as getVisibleInCustomShadowRendering,
45862
45883
  B1 as getWorldDirection,
@@ -45864,7 +45885,7 @@ export {
45864
45885
  te as getWorldPosition,
45865
45886
  ve as getWorldQuaternion,
45866
45887
  hg as getWorldRotation,
45867
- qe as getWorldScale,
45888
+ Xe as getWorldScale,
45868
45889
  Os as hasCommercialLicense,
45869
45890
  Au as hasIndieLicense,
45870
45891
  vm as hasPointerEventComponent,
@@ -45878,7 +45899,7 @@ export {
45878
45899
  fO as isActiveInHierarchy,
45879
45900
  Qc as isActiveSelf,
45880
45901
  pD as isAndroidDevice,
45881
- z1 as isAnimationAction,
45902
+ U1 as isAnimationAction,
45882
45903
  s0 as isComponent,
45883
45904
  oD as isDebugMode,
45884
45905
  hD as isDesktop,
@@ -45972,7 +45993,7 @@ export {
45972
45993
  rD as setParam,
45973
45994
  Id as setParamWithoutReload,
45974
45995
  jD as setPeerOptions,
45975
- zD as setResourceTrackingEnabled,
45996
+ UD as setResourceTrackingEnabled,
45976
45997
  Iv as setState,
45977
45998
  qv as setVisibleInCustomShadowRendering,
45978
45999
  Gv as setWorldEuler,
@@ -45980,7 +46001,7 @@ export {
45980
46001
  Wa as setWorldPositionXYZ,
45981
46002
  Xn as setWorldQuaternion,
45982
46003
  Vv as setWorldQuaternionXYZW,
45983
- U1 as setWorldRotation,
46004
+ z1 as setWorldRotation,
45984
46005
  Cu as setWorldRotationXYZ,
45985
46006
  Ec as setWorldScale,
45986
46007
  Pu as showBalloonError,
@@ -45993,11 +46014,11 @@ export {
45993
46014
  P0 as syncInstantiate,
45994
46015
  MD as textureToCanvas,
45995
46016
  l1 as toSourceId,
45996
- UP as tryCastBinary,
46017
+ zP as tryCastBinary,
45997
46018
  ME as tryDetermineMimetypeFromBinary,
45998
46019
  OE as tryDetermineMimetypeFromURL,
45999
46020
  Mc as tryFindObject,
46000
- zP as tryGetGuid,
46021
+ UP as tryGetGuid,
46001
46022
  aM as unregisterHotReloadType,
46002
46023
  Lv as unwatchWrite,
46003
46024
  P1 as useForAutoFit,