@needle-tools/engine 4.16.0-next.bc4d35d → 4.16.1

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.
@@ -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) {
@@ -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 _();
@@ -1988,11 +1988,11 @@ Ro('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"]
1988
1988
  Ro('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";');
1989
1989
  Ro('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";');
1990
1990
  Ro('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";');
1991
- Ro('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.16.0";');
1991
+ Ro('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.16.1";');
1992
1992
  Ro('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
1993
- Ro('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Fri Mar 06 2026 15:28:20 GMT+0000 (Coordinated Universal Time)";');
1993
+ Ro('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Mon Mar 09 2026 14:22:17 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 15:28:20 GMT+0000 (Coordinated Universal Time)";
1995
+ const Gi = "4.16.1", Rc = "undefined", Bd = "Mon Mar 09 2026 14:22:17 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";
@@ -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) {
@@ -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`));
@@ -8119,7 +8119,7 @@ Object.getOwnPropertyDescriptor(M.prototype, "worldRotation") || Object.definePr
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);
@@ -11408,7 +11408,7 @@ class Tu extends HTMLElement {
11408
11408
  }
11409
11409
  }
11410
11410
  customElements.get(va) || customElements.define(va, Tu);
11411
- 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 = {};
11412
11412
  class XD {
11413
11413
  name;
11414
11414
  /** for debugging only */
@@ -11430,12 +11430,12 @@ var Ce = /* @__PURE__ */ ((s) => (s[s.Start = -1] = "Start", s[s.EarlyUpdate = 0
11430
11430
  function Eg(s, e) {
11431
11431
  if (!s) return;
11432
11432
  if (!s.isComponent) {
11433
- (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.
11434
11434
  The script will be ignored. Please make sure your component extends "Behaviour" imported from "@needle-tools/engine"
11435
11435
  `, s);
11436
11436
  return;
11437
11437
  }
11438
- e || (e = N.Current, Ze && console.warn("> Registering component without context"));
11438
+ e || (e = N.Current, qe && console.warn("> Registering component without context"));
11439
11439
  const t = e?.new_scripts;
11440
11440
  t.includes(s) || t.push(s);
11441
11441
  }
@@ -11800,9 +11800,9 @@ class N {
11800
11800
  createNewRenderer(e) {
11801
11801
  if (this.renderer?.dispose(), e = { ...N.DefaultWebGLRendererParameters, ...e }, !e.canvas) {
11802
11802
  const t = this.domElement?.shadowRoot?.querySelector("canvas");
11803
- 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).");
11804
11804
  }
11805
- 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 = {
11806
11806
  library: new _S(),
11807
11807
  modelViewMatrix: null,
11808
11808
  modelNormalViewMatrix: null
@@ -11910,7 +11910,7 @@ class N {
11910
11910
  this.internalOnDestroy();
11911
11911
  }
11912
11912
  internalOnDestroy() {
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 || (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();
11914
11914
  for (const e of this._disposeCallbacks)
11915
11915
  try {
11916
11916
  e();
@@ -12049,10 +12049,10 @@ Start a coroutine from a component by calling "this.startCoroutine(myCoroutine()
12049
12049
  // #region internal create
12050
12050
  async internalOnCreate(e) {
12051
12051
  const t = ++this._createId;
12052
- Ze && console.log("Creating context", this.name, e);
12052
+ qe && console.log("Creating context", this.name, e);
12053
12053
  const i = globalThis["needle:dependencies:ready"];
12054
- i instanceof Promise && (Ze && console.log("Waiting for dependencies to be ready"), await i.catch((h) => {
12055
- if (Ze || L()) {
12054
+ i instanceof Promise && (qe && console.log("Waiting for dependencies to be ready"), await i.catch((h) => {
12055
+ if (qe || L()) {
12056
12056
  if (Pu("Needle Engine dependencies failed to load. Please check the console for more details"), h instanceof ReferenceError) {
12057
12057
  let d = "YourComponentName";
12058
12058
  const f = h.message.indexOf("'");
@@ -12077,7 +12077,7 @@ Possible solutions:
12077
12077
  console.error("Needle Engine dependencies failed to load", h);
12078
12078
  }
12079
12079
  }).then(() => {
12080
- Ze && console.log("Needle Engine dependencies are ready");
12080
+ qe && console.log("Needle Engine dependencies are ready");
12081
12081
  })), this.clear();
12082
12082
  const n = this.renderer, o = !n || n.isDisposed === !0;
12083
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);
@@ -12092,7 +12092,7 @@ Possible solutions:
12092
12092
  if (t !== this._createId || e?.abortSignal?.aborted)
12093
12093
  return !1;
12094
12094
  if (this.internalOnUpdateVisible(), !this.renderer)
12095
- 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;
12096
12096
  !this.isManagedExternally && !this.domElement.shadowRoot && this.domElement.prepend(this.renderer.domElement), N.Current = this, N.Current = this;
12097
12097
  for (let h = 0; h < this.new_scripts.length; h++) {
12098
12098
  const d = this.new_scripts[h];
@@ -12118,7 +12118,7 @@ Possible solutions:
12118
12118
  }
12119
12119
  }), h ? this.setCurrentCamera(h) : !pe.dispatchCallback(ue.MissingCamera, this, { files: a }) && !this.mainCamera && !this.isManagedExternally && console.warn("Missing camera in main scene", this);
12120
12120
  }
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)), 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;
12122
12122
  const l = pe.dispatchCallback(ue.ContextCreated, this, { files: a });
12123
12123
  if (l) {
12124
12124
  const h = this.domElement;
@@ -12127,7 +12127,7 @@ Possible solutions:
12127
12127
  if (e?.abortSignal?.aborted)
12128
12128
  return !1;
12129
12129
  const c = this.rootSourceId;
12130
- 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;
12131
12131
  }
12132
12132
  rootSceneSourceIdentifiers = [];
12133
12133
  async internalLoadInitialContent(e, t) {
@@ -12144,15 +12144,15 @@ Possible solutions:
12144
12144
  }, r = Qn(), a = 0;
12145
12145
  for (let l = 0; l < n.length; l++) {
12146
12146
  if (t.abortSignal?.aborted) {
12147
- Ze && console.log("Aborting loading because of abort signal");
12147
+ qe && console.log("Aborting loading because of abort signal");
12148
12148
  break;
12149
12149
  }
12150
12150
  if (e !== this._createId) {
12151
- 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);
12152
12152
  break;
12153
12153
  }
12154
12154
  const c = n[l];
12155
- 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);
12156
12156
  const h = await r.loadSync(this, c, c, a, (d) => {
12157
12157
  t.abortSignal?.aborted || (o.name = c, o.progress = d, o.index = l, o.count = n.length, t.onLoadingProgress?.call(this, o));
12158
12158
  });
@@ -12162,7 +12162,7 @@ Possible solutions:
12162
12162
  }) : console.warn("Could not load file: " + c);
12163
12163
  }
12164
12164
  if (e !== this._createId || t.abortSignal?.aborted) {
12165
- 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);
12166
12166
  for (const l of i)
12167
12167
  if (l && l.file)
12168
12168
  for (const c of l.file.scenes)
@@ -12200,11 +12200,11 @@ Possible solutions:
12200
12200
  _renderlooperrors = 0;
12201
12201
  /** Performs a full update step including script callbacks, rendering (unless isManagedExternally is set to false) and post render callbacks */
12202
12202
  update(e, t) {
12203
- if (t === void 0 && (t = null), L() || Ze || Ck())
12203
+ if (t === void 0 && (t = null), L() || qe || Ck())
12204
12204
  try {
12205
12205
  this.internalStep(e, t), this._renderlooperrors = 0;
12206
12206
  } catch (i) {
12207
- 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 + `
12208
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 }));
12209
12209
  }
12210
12210
  else
@@ -15237,7 +15237,7 @@ class Fs extends R {
15237
15237
  if (r < 1 / 0) {
15238
15238
  const a = U();
15239
15239
  a.x = o.min.x + (o.max.x - o.min.x) * 0.5;
15240
- const l = qe(this.gameObject).x;
15240
+ const l = Xe(this.gameObject).x;
15241
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);
15242
15242
  }
15243
15243
  Nh && z.DrawWireBox3(o, 65280, 5);
@@ -15586,7 +15586,7 @@ var A;
15586
15586
  e.load = n;
15587
15587
  })(s.POSTPROCESSING_AO || (s.POSTPROCESSING_AO = {}));
15588
15588
  })(A || (A = {}));
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 || {}), 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 || {});
15590
15590
  const Nt = function(s, e) {
15591
15591
  return function(t, i, n) {
15592
15592
  PM(t, i, n, s, e);
@@ -15742,7 +15742,7 @@ const ui = class _d extends R {
15742
15742
  _mass = 0;
15743
15743
  useGravity = !0;
15744
15744
  centerOfMass = new _(0, 0, 0);
15745
- constraints = Ke.None;
15745
+ constraints = Ze.None;
15746
15746
  isKinematic = !1;
15747
15747
  drag = 0;
15748
15748
  angularDrag = 1;
@@ -15751,51 +15751,51 @@ const ui = class _d extends R {
15751
15751
  collisionDetectionMode = Lg.Discrete;
15752
15752
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15753
15753
  get lockPositionX() {
15754
- return (this.constraints & Ke.FreezePositionX) !== 0;
15754
+ return (this.constraints & Ze.FreezePositionX) !== 0;
15755
15755
  }
15756
15756
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15757
15757
  get lockPositionY() {
15758
- return (this.constraints & Ke.FreezePositionY) !== 0;
15758
+ return (this.constraints & Ze.FreezePositionY) !== 0;
15759
15759
  }
15760
15760
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15761
15761
  get lockPositionZ() {
15762
- return (this.constraints & Ke.FreezePositionZ) !== 0;
15762
+ return (this.constraints & Ze.FreezePositionZ) !== 0;
15763
15763
  }
15764
15764
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15765
15765
  get lockRotationX() {
15766
- return (this.constraints & Ke.FreezeRotationX) !== 0;
15766
+ return (this.constraints & Ze.FreezeRotationX) !== 0;
15767
15767
  }
15768
15768
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15769
15769
  get lockRotationY() {
15770
- return (this.constraints & Ke.FreezeRotationY) !== 0;
15770
+ return (this.constraints & Ze.FreezeRotationY) !== 0;
15771
15771
  }
15772
15772
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15773
15773
  get lockRotationZ() {
15774
- return (this.constraints & Ke.FreezeRotationZ) !== 0;
15774
+ return (this.constraints & Ze.FreezeRotationZ) !== 0;
15775
15775
  }
15776
15776
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15777
15777
  set lockPositionX(e) {
15778
- e ? this.constraints |= Ke.FreezePositionX : this.constraints &= ~Ke.FreezePositionX;
15778
+ e ? this.constraints |= Ze.FreezePositionX : this.constraints &= ~Ze.FreezePositionX;
15779
15779
  }
15780
15780
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15781
15781
  set lockPositionY(e) {
15782
- e ? this.constraints |= Ke.FreezePositionY : this.constraints &= ~Ke.FreezePositionY;
15782
+ e ? this.constraints |= Ze.FreezePositionY : this.constraints &= ~Ze.FreezePositionY;
15783
15783
  }
15784
15784
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15785
15785
  set lockPositionZ(e) {
15786
- e ? this.constraints |= Ke.FreezePositionZ : this.constraints &= ~Ke.FreezePositionZ;
15786
+ e ? this.constraints |= Ze.FreezePositionZ : this.constraints &= ~Ze.FreezePositionZ;
15787
15787
  }
15788
15788
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15789
15789
  set lockRotationX(e) {
15790
- e ? this.constraints |= Ke.FreezeRotationX : this.constraints &= ~Ke.FreezeRotationX;
15790
+ e ? this.constraints |= Ze.FreezeRotationX : this.constraints &= ~Ze.FreezeRotationX;
15791
15791
  }
15792
15792
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15793
15793
  set lockRotationY(e) {
15794
- e ? this.constraints |= Ke.FreezeRotationY : this.constraints &= ~Ke.FreezeRotationY;
15794
+ e ? this.constraints |= Ze.FreezeRotationY : this.constraints &= ~Ze.FreezeRotationY;
15795
15795
  }
15796
15796
  /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
15797
15797
  set lockRotationZ(e) {
15798
- e ? this.constraints |= Ke.FreezeRotationZ : this.constraints &= ~Ke.FreezeRotationZ;
15798
+ e ? this.constraints |= Ze.FreezeRotationZ : this.constraints &= ~Ze.FreezeRotationZ;
15799
15799
  }
15800
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.
15801
15801
  *
@@ -19525,7 +19525,7 @@ class Mt extends R {
19525
19525
  if (this.box || (this.box = new Ci()), e || this.context.time.frameCount != this._lastMatrixUpdateFrame) {
19526
19526
  const t = this._lastMatrixUpdateFrame < 0;
19527
19527
  this._lastMatrixUpdateFrame = this.context.time.frameCount;
19528
- 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);
19529
19529
  this.box.setFromCenterAndSize(n, o);
19530
19530
  }
19531
19531
  return this.box;
@@ -23662,7 +23662,7 @@ class Lo extends R {
23662
23662
  this.removePreviouslyAddedObjects();
23663
23663
  const r = n.scene;
23664
23664
  r.position.copy(this.gameObject.worldPosition);
23665
- const a = qe(this.gameObject);
23665
+ const a = Xe(this.gameObject);
23666
23666
  let l = new _(0, 0, 0);
23667
23667
  a.x = Math.abs(a.x), a.y = Math.abs(a.y), a.z = Math.abs(a.z);
23668
23668
  let c = r.scale.clone();
@@ -26515,7 +26515,7 @@ class ll extends R {
26515
26515
  }
26516
26516
  *moveToTarget() {
26517
26517
  if (!this.target || !this.object) return;
26518
- 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);
26519
26519
  if (a < 0.01 && l < 0.01 && c < 0.01) {
26520
26520
  Rt(this.object, t), Xn(this.object, n), Ec(this.object, r), this.coroutine = null;
26521
26521
  return;
@@ -28684,7 +28684,7 @@ class Ji extends R {
28684
28684
  if (i.x != 0 || i.y != 0) {
28685
28685
  const n = U(i.x, 0, i.y);
28686
28686
  n.multiplyScalar(this.context.time.deltaTimeUnscaled * this.movementSpeed);
28687
- const o = qe(t);
28687
+ const o = Xe(t);
28688
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);
28689
28689
  for (const r of t.children) r.updateWorldMatrix(!1, !1);
28690
28690
  }
@@ -33004,7 +33004,7 @@ S([
33004
33004
  S([
33005
33005
  u()
33006
33006
  ], Ve.prototype, "worldSpace");
33007
- class Xe {
33007
+ class Qe {
33008
33008
  enabled;
33009
33009
  space = 0;
33010
33010
  orbitalX;
@@ -33050,61 +33050,61 @@ class Xe {
33050
33050
  }
33051
33051
  S([
33052
33052
  u()
33053
- ], Xe.prototype, "enabled");
33053
+ ], Qe.prototype, "enabled");
33054
33054
  S([
33055
33055
  u()
33056
- ], Xe.prototype, "space");
33056
+ ], Qe.prototype, "space");
33057
33057
  S([
33058
33058
  u(Y)
33059
- ], Xe.prototype, "orbitalX");
33059
+ ], Qe.prototype, "orbitalX");
33060
33060
  S([
33061
33061
  u(Y)
33062
- ], Xe.prototype, "orbitalY");
33062
+ ], Qe.prototype, "orbitalY");
33063
33063
  S([
33064
33064
  u(Y)
33065
- ], Xe.prototype, "orbitalZ");
33065
+ ], Qe.prototype, "orbitalZ");
33066
33066
  S([
33067
33067
  u()
33068
- ], Xe.prototype, "orbitalXMultiplier");
33068
+ ], Qe.prototype, "orbitalXMultiplier");
33069
33069
  S([
33070
33070
  u()
33071
- ], Xe.prototype, "orbitalYMultiplier");
33071
+ ], Qe.prototype, "orbitalYMultiplier");
33072
33072
  S([
33073
33073
  u()
33074
- ], Xe.prototype, "orbitalZMultiplier");
33074
+ ], Qe.prototype, "orbitalZMultiplier");
33075
33075
  S([
33076
33076
  u()
33077
- ], Xe.prototype, "orbitalOffsetX");
33077
+ ], Qe.prototype, "orbitalOffsetX");
33078
33078
  S([
33079
33079
  u()
33080
- ], Xe.prototype, "orbitalOffsetY");
33080
+ ], Qe.prototype, "orbitalOffsetY");
33081
33081
  S([
33082
33082
  u()
33083
- ], Xe.prototype, "orbitalOffsetZ");
33083
+ ], Qe.prototype, "orbitalOffsetZ");
33084
33084
  S([
33085
33085
  u(Y)
33086
- ], Xe.prototype, "speedModifier");
33086
+ ], Qe.prototype, "speedModifier");
33087
33087
  S([
33088
33088
  u()
33089
- ], Xe.prototype, "speedModifierMultiplier");
33089
+ ], Qe.prototype, "speedModifierMultiplier");
33090
33090
  S([
33091
33091
  u(Y)
33092
- ], Xe.prototype, "x");
33092
+ ], Qe.prototype, "x");
33093
33093
  S([
33094
33094
  u()
33095
- ], Xe.prototype, "xMultiplier");
33095
+ ], Qe.prototype, "xMultiplier");
33096
33096
  S([
33097
33097
  u(Y)
33098
- ], Xe.prototype, "y");
33098
+ ], Qe.prototype, "y");
33099
33099
  S([
33100
33100
  u()
33101
- ], Xe.prototype, "yMultiplier");
33101
+ ], Qe.prototype, "yMultiplier");
33102
33102
  S([
33103
33103
  u(Y)
33104
- ], Xe.prototype, "z");
33104
+ ], Qe.prototype, "z");
33105
33105
  S([
33106
33106
  u()
33107
- ], Xe.prototype, "zMultiplier");
33107
+ ], Qe.prototype, "zMultiplier");
33108
33108
  class si {
33109
33109
  animation;
33110
33110
  enabled;
@@ -34228,11 +34228,11 @@ const Vt = class Pd extends R {
34228
34228
  if (this._bursts && (this.emission.bursts = this._bursts, delete this._bursts), !this._isPlaying) return;
34229
34229
  const e = this.context.mainCamera;
34230
34230
  if (e) {
34231
- const n = qe(e);
34231
+ const n = Xe(e);
34232
34232
  this._cameraScale = n.x;
34233
34233
  }
34234
34234
  const t = !this.worldspace, i = this.gameObject;
34235
- 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) {
34236
34236
  const n = gx(this, Fm);
34237
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);
34238
34238
  }
@@ -34273,7 +34273,7 @@ Ue([
34273
34273
  u(Ve)
34274
34274
  ], Vt.prototype, "trails");
34275
34275
  Ue([
34276
- u(Xe)
34276
+ u(Qe)
34277
34277
  ], Vt.prototype, "velocityOverLifetime");
34278
34278
  Ue([
34279
34279
  u(vt)
@@ -34313,7 +34313,7 @@ function gx(s, e) {
34313
34313
  if (e.set(1, 1, 1), s.gameObject.parent && s.localspace)
34314
34314
  switch (s.main.scalingMode) {
34315
34315
  case Dm.Local:
34316
- 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;
34317
34317
  break;
34318
34318
  default:
34319
34319
  if (!s.unsupported_scaling_mode) {
@@ -34321,7 +34321,7 @@ function gx(s, e) {
34321
34321
  const t = "ParticleSystem scale mode " + Dm[s.main.scalingMode] + " is not supported";
34322
34322
  L() && _e(t), console.warn(t, s.name, s);
34323
34323
  }
34324
- e = qe(s.gameObject, e);
34324
+ e = Xe(s.gameObject, e);
34325
34325
  break;
34326
34326
  }
34327
34327
  return e;
@@ -34447,10 +34447,10 @@ const ut = {
34447
34447
  /** Used to render effects at the end of the post-processing chain, e.g. for final adjustments or overlays. */
34448
34448
  AT_END: 1e4
34449
34449
  };
34450
- let Qe = null;
34450
+ let Ye = null;
34451
34451
  function gA(s) {
34452
- 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) => {
34453
- 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;
34454
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;
34455
34455
  }), lc === "verbose" && console.debug("After ordering effects", [...s]);
34456
34456
  }
@@ -36378,7 +36378,7 @@ var tI = Object.defineProperty, iI = Object.getOwnPropertyDescriptor, Ii = (s, e
36378
36378
  (r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
36379
36379
  return i && n && tI(e, t, n), n;
36380
36380
  };
36381
- const Ye = x("debugvideo");
36381
+ const Ke = x("debugvideo");
36382
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 || {});
36383
36383
  class yt extends R {
36384
36384
  playOnAwake = !0;
@@ -36513,7 +36513,7 @@ class yt extends R {
36513
36513
  wasPlaying = !1;
36514
36514
  /** ensure's the video element has been created and will start loading the clip */
36515
36515
  preloadVideo() {
36516
- 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);
36517
36517
  }
36518
36518
  /** @deprecated use `preloadVideo()` */
36519
36519
  preload() {
@@ -36525,11 +36525,11 @@ class yt extends R {
36525
36525
  this.clip = e, this.source = 0, this._videoElement ? (this._videoElement.srcObject = e, this._isPlaying && this.play(), this.updateAspect()) : this.create(this.playOnAwake);
36526
36526
  }
36527
36527
  setClipURL(e) {
36528
- 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));
36529
36529
  }
36530
36530
  /** @internal */
36531
36531
  onEnable() {
36532
- 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();
36533
36533
  }
36534
36534
  /** @internal */
36535
36535
  onDisable() {
@@ -36563,7 +36563,7 @@ class yt extends R {
36563
36563
  /** start playing the video source */
36564
36564
  play() {
36565
36565
  if (this._videoElement || this.create(!1), !this._videoElement) {
36566
- Ye && console.warn("Can not play: no video element found", this);
36566
+ Ke && console.warn("Can not play: no video element found", this);
36567
36567
  return;
36568
36568
  }
36569
36569
  if (!(this._isPlaying && !this._videoElement?.ended && !this._videoElement?.paused)) {
@@ -36571,24 +36571,24 @@ class yt extends R {
36571
36571
  this.ensureM3UCanBePlayed();
36572
36572
  return;
36573
36573
  }
36574
- Ye && console.log("Video Play()", this.clip, this._videoElement, this.time), this._videoElement.currentTime = this.time, this._videoElement.play().catch((e) => {
36575
- 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(() => {
36576
36576
  this._isPlaying && !this.destroyed && this.activeAndEnabled && this.play();
36577
36577
  }, 1e3);
36578
- }), Ye && console.log("play", this._videoElement, this.time);
36578
+ }), Ke && console.log("play", this._videoElement, this.time);
36579
36579
  }
36580
36580
  }
36581
36581
  /**
36582
36582
  * Stop the video playback. This will reset the video to the beginning
36583
36583
  */
36584
36584
  stop() {
36585
- 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));
36586
36586
  }
36587
36587
  /**
36588
36588
  * Pause the video playback
36589
36589
  */
36590
36590
  pause() {
36591
- 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);
36592
36592
  }
36593
36593
  /** create the video element and assign the video source url or stream */
36594
36594
  create(e) {
@@ -36601,7 +36601,7 @@ class yt extends R {
36601
36601
  t = this.url, !t?.length && typeof this.clip == "string" && (t = this.clip);
36602
36602
  break;
36603
36603
  }
36604
- 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);
36605
36605
  }
36606
36606
  updateAspect() {
36607
36607
  this.aspectMode !== 0 && this.startCoroutine(this.updateAspectImpl());
@@ -36624,7 +36624,7 @@ class yt extends R {
36624
36624
  _targetObjects;
36625
36625
  createVideoElement() {
36626
36626
  const e = document.createElement("video");
36627
- 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;
36628
36628
  }
36629
36629
  handleBeginPlaying(e) {
36630
36630
  if (!this.activeAndEnabled || !this._videoElement) return;
@@ -36647,11 +36647,11 @@ class yt extends R {
36647
36647
  this._targetObjects.push(t), i !== this._videoMaterial && (this._videoMaterial = i.clone(), t.material = this._videoMaterial);
36648
36648
  const n = "map", o = this._videoMaterial;
36649
36649
  if (!this.targetMaterialProperty)
36650
- 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;
36651
36651
  else
36652
36652
  switch (this.targetMaterialProperty) {
36653
36653
  default:
36654
- 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;
36655
36655
  break;
36656
36656
  }
36657
36657
  } else {
@@ -36697,7 +36697,7 @@ class yt extends R {
36697
36697
  for (const o of this._targetObjects) {
36698
36698
  let r = 1;
36699
36699
  if (o.parent) {
36700
- const a = qe(o.parent);
36700
+ const a = Xe(o.parent);
36701
36701
  r = a.x / a.y;
36702
36702
  }
36703
36703
  switch (this.aspectMode) {
@@ -36719,11 +36719,11 @@ class yt extends R {
36719
36719
  ensureM3UCanBePlayed() {
36720
36720
  if (!this.shouldUseM3U) return;
36721
36721
  let e = document.head.querySelector("script[data-hls_library]");
36722
- 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));
36723
36723
  }
36724
36724
  _hls;
36725
36725
  onHlsAvailable = () => {
36726
- 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));
36727
36727
  };
36728
36728
  }
36729
36729
  Ii([
@@ -43477,17 +43477,9 @@ class tS extends HTMLElement {
43477
43477
  _didFullyLoad = !1;
43478
43478
  _didInitialize = !1;
43479
43479
  constructor() {
43480
- super(), this.addEventListener("ready", this.onReady), this._overlay_ar = new LL(), this._context = new N({ domElement: this });
43481
- }
43482
- ensureInitialized() {
43483
- this._didInitialize || (this._didInitialize = !0, this.initializeDom());
43484
- }
43485
- initializeDom() {
43486
- V0();
43487
- const e = this.attachShadow({ mode: "open", delegatesFocus: !0 });
43488
- this.setAttribute("role", "application"), this.setAttribute("aria-label", "Needle Engine 3D scene");
43489
- const t = document.createElement("template");
43490
- t.innerHTML = `<style>
43480
+ super(), this.attachShadow({ mode: "open", delegatesFocus: !0 });
43481
+ const e = document.createElement("template");
43482
+ e.innerHTML = `<style>
43491
43483
  @import url('https://fonts.googleapis.com/css2?family=Roboto+Flex:opsz,wght@8..144,100..1000&display=swap');
43492
43484
 
43493
43485
  :host {
@@ -43552,7 +43544,7 @@ class tS extends HTMLElement {
43552
43544
  }
43553
43545
  :host .quit-ar-button {
43554
43546
  position: absolute;
43555
- // top: env(titlebar-area-y); /** this doesnt work **/
43547
+ /** top: env(titlebar-area-y); this doesnt work **/
43556
43548
  top: 60px; /** camera access needs a bit more space **/
43557
43549
  right: 20px;
43558
43550
  z-index: 9999;
@@ -43564,13 +43556,20 @@ class tS extends HTMLElement {
43564
43556
  <div class="content">
43565
43557
  <slot class="overlay-content" style="display: contents;"></slot>
43566
43558
  </div>
43567
- `, e.appendChild(t.content.cloneNode(!0)), 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");
43568
43567
  }
43569
43568
  /**
43570
43569
  * @internal
43571
43570
  */
43572
- async connectedCallback() {
43573
- 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.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")) {
43574
43573
  const t = globalThis["needle:codegen_files"];
43575
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));
43576
43575
  }
@@ -44262,7 +44261,7 @@ class Oc {
44262
44261
  Ne && console.warn("Physics are disabled");
44263
44262
  return;
44264
44263
  }
44265
- const i = e.gameObject, n = qe(i, this._tempPosition).multiply(t);
44264
+ const i = e.gameObject, n = Xe(i, this._tempPosition).multiply(t);
44266
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));
44267
44266
  const o = 1e-7;
44268
44267
  n.x < o && (n.x = o), n.y < o && (n.y = o), n.z < o && (n.z = o);
@@ -44483,12 +44482,12 @@ Error:`, r), null;
44483
44482
  switch (i.type) {
44484
44483
  // Sphere Collider
44485
44484
  case A.RAPIER_PHYSICS.MODULE.ShapeType.Ball: {
44486
- 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);
44487
44486
  n = f.radius !== m, f.radius = m, n && t.setShape(f);
44488
44487
  break;
44489
44488
  }
44490
44489
  case A.RAPIER_PHYSICS.MODULE.ShapeType.Cuboid:
44491
- 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);
44492
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);
44493
44492
  break;
44494
44493
  }
@@ -44568,7 +44567,7 @@ Error:`, r), null;
44568
44567
  const a = t.center;
44569
44568
  if (a && a.isVector3) {
44570
44569
  this._tempQuaternion.set(r.x, r.y, r.z, r.w);
44571
- 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);
44572
44571
  l.multiply(c), o.x -= l.x, o.y -= l.y, o.z -= l.z;
44573
44572
  }
44574
44573
  Wa(t.gameObject, o.x, o.y, o.z), Vv(t.gameObject, r.x, r.y, r.z, r.w);
@@ -44605,12 +44604,12 @@ Error:`, r), null;
44605
44604
  _tempCenterQuaternion = new V();
44606
44605
  tryApplyCenter(e, t) {
44607
44606
  const i = e.center;
44608
- 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);
44609
44608
  }
44610
44609
  static _matricesBuffer = [];
44611
44610
  getRigidbodyRelativeMatrix(e, t, i, n) {
44612
44611
  if (n === void 0 && (n = Oc._matricesBuffer, n.length = 0), e === t) {
44613
- const o = qe(e, this._tempPosition);
44612
+ const o = Xe(e, this._tempPosition);
44614
44613
  i.makeScale(o.x, o.y, o.z);
44615
44614
  for (let r = n.length - 1; r >= 0; r--)
44616
44615
  i.multiply(n[r]);
@@ -45286,7 +45285,7 @@ const x2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45286
45285
  USDZUIExtension: lx,
45287
45286
  UsageMarker: Nu,
45288
45287
  VariantAction: $w,
45289
- VelocityOverLifetimeModule: Xe,
45288
+ VelocityOverLifetimeModule: Qe,
45290
45289
  VerticalLayoutGroup: nx,
45291
45290
  VideoPlayer: yt,
45292
45291
  get ViewBox() {
@@ -45694,7 +45693,7 @@ export {
45694
45693
  FO as RendererData,
45695
45694
  Sw as RendererLightmap,
45696
45695
  Je as Rigidbody,
45697
- Ke as RigidbodyConstraints,
45696
+ Ze as RigidbodyConstraints,
45698
45697
  ie as RoomEvents,
45699
45698
  kn as RotationBySpeedModule,
45700
45699
  is as RotationOverLifetimeModule,
@@ -45776,7 +45775,7 @@ export {
45776
45775
  zD as UserJoinedOrLeftRoomModel,
45777
45776
  Gi as VERSION,
45778
45777
  $w as VariantAction,
45779
- Xe as VelocityOverLifetimeModule,
45778
+ Qe as VelocityOverLifetimeModule,
45780
45779
  nx as VerticalLayoutGroup,
45781
45780
  yt as VideoPlayer,
45782
45781
  at as ViewBox,
@@ -45886,7 +45885,7 @@ export {
45886
45885
  te as getWorldPosition,
45887
45886
  ve as getWorldQuaternion,
45888
45887
  hg as getWorldRotation,
45889
- qe as getWorldScale,
45888
+ Xe as getWorldScale,
45890
45889
  Os as hasCommercialLicense,
45891
45890
  Au as hasIndieLicense,
45892
45891
  vm as hasPointerEventComponent,