@needle-tools/engine 4.10.0-beta.4 → 4.10.0-beta.5

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.
@@ -141,7 +141,7 @@ void main(){
141
141
  #__vconsole .vc-mask {
142
142
  overflow: hidden;
143
143
  }
144
- `,gr?.prepend(i),o===!0&&Lb()<=0&&r_(),console.log("\u{1F335} Debug console has loaded")}},e.onerror=()=>{console.warn("\u{1F335} Debug console failed to load."+(window.crossOriginIsolated?"This page is using cross-origin isolation, so external scripts can't be loaded.":"")),nc=!1,Hi=null},e.src="https://cdn.jsdelivr.net/npm/vconsole@3.15.1/dist/vconsole.min.js",document.body.appendChild(e)}function RO(){if(!globalThis.VConsole)return;const o=new VConsole.VConsolePlugin("needle-console","\u{1F335} Inspect glTF"),e=()=>document.querySelector("#__vc_plug_"+o._id+" iframe");return o.on("renderTab",function(t){const i=globalThis["needle:codegen_files"];if(!i||i.length===0)return;let n=globalThis["needle:codegen_files"][0];const s=n.indexOf("?");s>-1&&(n=n.substring(0,s));const r=location.protocol+"//"+location.host+location.pathname+"/"+n,a=encodeURIComponent(r);o.fullUrl="https://viewer.needle.tools?inspect&file="+a;var l='<iframe src="" style="width: 100%; height: 99%; border: none;"></iframe>';t(l)}),o.on("show",function(){const t=e();t&&t.src!==o.fullUrl&&(t.src=o.fullUrl)}),o.on("hide",function(){const t=e();t&&(t.src="")}),o.on("addTopBar",function(t){var i=new Array;i.push({name:"Open in new window \u2197",onClick:function(n){window.open(o.fullUrl,"_blank"),Hi?.hide()}}),i.push({name:"Reload",onClick:function(n){const s=e();s&&(s.src=o.fullUrl)}}),i.push({name:"Fullscreen",onClick:function(n){const s=e();s.requestFullscreen?s.requestFullscreen():s.webkitRequestFullscreen instanceof Function&&s.webkitRequestFullscreen()}}),t(i)}),o}function TO(){return document.querySelector("#__vconsole .vc-switch")||null}function EO(){return document.querySelector("#__vconsole")||null}const l_=x("debugdefines");ms('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"] = "0.0.0";'),ms('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";'),ms('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";'),ms('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";'),ms('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.10.0-beta.4";'),ms('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";'),ms('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Sep 25 2025 08:56:41 GMT+0000 (Coordinated Universal Time)";'),ms('globalThis["__NEEDLE_PUBLIC_KEY__"] = "'+NEEDLE_PUBLIC_KEY+'";');const yn="4.10.0-beta.4",Ad="undefined",tg="Thu Sep 25 2025 08:56:41 GMT+0000 (Coordinated Universal Time)";l_&&console.log(`Engine version: ${yn} (generator: ${Ad})
144
+ `,gr?.prepend(i),o===!0&&Lb()<=0&&r_(),console.log("\u{1F335} Debug console has loaded")}},e.onerror=()=>{console.warn("\u{1F335} Debug console failed to load."+(window.crossOriginIsolated?"This page is using cross-origin isolation, so external scripts can't be loaded.":"")),nc=!1,Hi=null},e.src="https://cdn.jsdelivr.net/npm/vconsole@3.15.1/dist/vconsole.min.js",document.body.appendChild(e)}function RO(){if(!globalThis.VConsole)return;const o=new VConsole.VConsolePlugin("needle-console","\u{1F335} Inspect glTF"),e=()=>document.querySelector("#__vc_plug_"+o._id+" iframe");return o.on("renderTab",function(t){const i=globalThis["needle:codegen_files"];if(!i||i.length===0)return;let n=globalThis["needle:codegen_files"][0];const s=n.indexOf("?");s>-1&&(n=n.substring(0,s));const r=location.protocol+"//"+location.host+location.pathname+"/"+n,a=encodeURIComponent(r);o.fullUrl="https://viewer.needle.tools?inspect&file="+a;var l='<iframe src="" style="width: 100%; height: 99%; border: none;"></iframe>';t(l)}),o.on("show",function(){const t=e();t&&t.src!==o.fullUrl&&(t.src=o.fullUrl)}),o.on("hide",function(){const t=e();t&&(t.src="")}),o.on("addTopBar",function(t){var i=new Array;i.push({name:"Open in new window \u2197",onClick:function(n){window.open(o.fullUrl,"_blank"),Hi?.hide()}}),i.push({name:"Reload",onClick:function(n){const s=e();s&&(s.src=o.fullUrl)}}),i.push({name:"Fullscreen",onClick:function(n){const s=e();s.requestFullscreen?s.requestFullscreen():s.webkitRequestFullscreen instanceof Function&&s.webkitRequestFullscreen()}}),t(i)}),o}function TO(){return document.querySelector("#__vconsole .vc-switch")||null}function EO(){return document.querySelector("#__vconsole")||null}const l_=x("debugdefines");ms('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"] = "0.0.0";'),ms('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";'),ms('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";'),ms('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";'),ms('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.10.0-beta.5";'),ms('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";'),ms('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Sep 25 2025 09:17:47 GMT+0000 (Coordinated Universal Time)";'),ms('globalThis["__NEEDLE_PUBLIC_KEY__"] = "'+NEEDLE_PUBLIC_KEY+'";');const yn="4.10.0-beta.5",Ad="undefined",tg="Thu Sep 25 2025 09:17:47 GMT+0000 (Coordinated Universal Time)";l_&&console.log(`Engine version: ${yn} (generator: ${Ad})
145
145
  Project built at ${tg}`);const Ma=NEEDLE_PUBLIC_KEY,So="needle_isActiveInHierarchy",fr="builtin_components",oc="needle_editor_guid";function ms(o){try{(0,eval)(o)}catch(e){l_&&console.error(e)}}let c_,h_=null;function bn(){return c_}function ig(o){if(o==null){console.warn("Oh no: someone tried registering a non-existend gltf-loader. When you see this log it might mean that needle-engine is being imported multiple times. Please check your project setup.");return}h_!==o&&(h_=o,c_=new o)}const Si=Symbol("shadowDomOwner"),AO=x("debugpatch");function Id(o,e,t,i){const n=AO===e;if(!t&&!i)return;const s=e+"___needle";LO(o,e,t,i);const r=Object.getOwnPropertyDescriptor(o,e),a=o[e];n&&console.log("Patch",o.constructor.name,e,r,a),r?(n&&console.log("Apply patch with existing descriptor",o.constructor.name,e,r),typeof r.value=="function"&&(o[e]=u_(r.value,o,e))):(n&&console.log("Create patch with new property",o.constructor.name,e,r),Object.defineProperty(o,e,{set:function(l){if(typeof l=="function")this[s]=u_(l,o,e);else{const c=this[s];p_(o,e,this,c,l),this[s]=l,m_(o,e,this,c,l)}},get:function(){const l=this[s];return typeof l=="function"&&l[s]?l[s]:l}}))}function IO(o,e,t){const i=og(o,e);if(i)for(let n=i.length-1;n>=0;n--){const s=i[n];s.prefix===t&&(s.prefix=null),s.postfix===t&&(s.postfix=null),!s.prefix&&!s.postfix&&i.splice(n,1)}}const d_=Symbol("Needle:Patches:WrappedFunction");function u_(o,e,t){if(o[d_])return o;const i=function(...n){p_(e,t,this,...n);const s=o.apply(this,n);return m_(e,t,this,s,...n),s};return i[d_]=!0,i}const Ld="Needle:Patches";function ng(){return globalThis[Ld]||(globalThis[Ld]=new WeakMap),globalThis[Ld]}function og(o,e){const t=ng().get(o);return t?t.get(e):null}function LO(o,e,t,i){let n=ng().get(o);n||(n=new Map,ng().set(o,n));let s=n.get(e);s||(s=[],n.set(e,s)),s.push({prefix:t,postfix:i})}function p_(o,e,t,...i){if(!t)return;const n=og(o,e);if(n)for(const s of n)s.prefix?.call(t,...i)}function m_(o,e,t,i,...n){if(!t)return;const s=og(o,e);if(s)for(const r of s)r.postfix?.call(t,i,...n)}const Ra=[];function jd(o){Ra.indexOf(o)===-1&&Ra.push(o)}function jO(o){const e=Ra.indexOf(o);e!==-1&&Ra.splice(e,1)}const Ta=[];function sg(o){Ta.indexOf(o)===-1&&Ta.push(o)}function DO(o){const e=Ta.indexOf(o);e!==-1&&Ta.splice(e,1)}function g_(o){globalThis.dispatchEvent(new CustomEvent("needle-xrsession-start",{detail:o}));for(let e=0;e<Ra.length;e++)Ra[e](o)}function f_(o){globalThis.dispatchEvent(new CustomEvent("needle-xrsession-end",{detail:o}));for(let e=0;e<Ta.length;e++)Ta[e](o)}const ot=x("debuginput");var Dd=(o=>(o.Mouse="mouse",o.Touch="touch",o.Controller="controller",o.Hand="hand",o))(Dd||{}),Ee=(o=>(o.PointerDown="pointerdown",o.PointerUp="pointerup",o.PointerMove="pointermove",o.KeyDown="keydown",o.KeyUp="keyup",o.KeyPressed="keypress",o))(Ee||{});class Co extends PointerEvent{clientZ;deviceIndex;origin;source;mode;get isSpatial(){return this.mode!="screen"}get ray(){return this._ray||(this._ray=new ls(this.space.worldPosition.clone(),this.space.worldForward.clone())),this._ray}set ray(e){this._ray=e}get hasRay(){return this._ray!==void 0}_ray;space;isClick=!1;isDoubleClick=!1;get used(){return this._used}_used=!1;use(){this._used=!0}get pointerId(){return this._pointerid}_pointerid;get pointerType(){return this._pointerType}_pointerType;get type(){return this._type}_type;metadata={};intersections=new Array;constructor(e,t,i){super(e,i),this.clientZ=i.clientZ,this._pointerid=i.pointerId,this._pointerType=i.pointerType,this._type=e,this.deviceIndex=i.deviceIndex,this.origin=i.origin,this.source=t,this.mode=i.mode,this._ray=i.ray,this.space=i.device}_immediatePropagationStopped=!1;get immediatePropagationStopped(){return this._immediatePropagationStopped}_propagationStopped=!1;get propagationStopped(){return this._immediatePropagationStopped||this._propagationStopped}stopImmediatePropagation(){this._immediatePropagationStopped=!0,super.stopImmediatePropagation(),this.source?.stopImmediatePropagation()}stopPropagation(){this._propagationStopped=!0,super.stopPropagation(),this.source?.stopPropagation(),ot&&console.warn("Stop propagation...",this.pointerId,this.pointerType)}}class sc extends KeyboardEvent{source;constructor(e,t,i){super(e,i),this.source=t}stopImmediatePropagation(){super.stopImmediatePropagation(),this.source?.stopImmediatePropagation()}}class BO{key;keyType;source;constructor(e){this.key=e.key,this.keyType=e.type,this.source=e}}var ii=(o=>(o[o.Early=-100]="Early",o[o.Default=0]="Default",o[o.Late=100]="Late",o))(ii||{});class y_{_eventListeners={};addEventListener(e,t,i){if(this._eventListeners[e]||(this._eventListeners[e]=[]),!t||typeof t!="function"){console.error("Invalid call to addEventListener: callback is required and must be a function!");return}i?i={...i}:i={};let n=0;i?.queue!=null&&(n=i.queue);const s=this._eventListeners[e],r=s.find(a=>a.priority===n);r?r.listeners.push({callback:t,options:i}):(s.push({priority:n,listeners:[{callback:t,options:i}]}),s.sort((a,l)=>a.priority-l.priority))}removeEventListener(e,t,i){if(!this._eventListeners[e]||!t)return;const n=this._eventListeners[e];if(i?.queue!=null){const s=n.find(a=>a.priority===i.queue);if(!s)return;const r=s.listeners.findIndex(a=>a.callback===t);r>=0&&s.listeners.splice(r,1)}else for(const s of n){const r=s.listeners.findIndex(a=>a.callback===t);r>=0&&s.listeners.splice(r,1)}}dispatchEvent(e){let t=!1;if(e instanceof sc){const i=this._eventListeners[e.type];if(i)for(const n of i)for(let s=0;s<n.listeners.length;s++){const r=n.listeners[s];if(r.options?.signal?.aborted){n.listeners.splice(s,1),s--;continue}r.options.once&&(n.listeners.splice(s,1),s--),r.callback(e)}}if(e instanceof Co){const i=this._eventListeners[e.type];if(i)for(const n of i){if(t)break;for(let s=0;s<n.listeners.length;s++){const r=n.listeners[s];if(r.options?.signal?.aborted){n.listeners.splice(s,1),s--;continue}if(e.immediatePropagationStopped){t=!0,ot&&console.log("immediatePropagationStopped",e.type);break}else e.propagationStopped&&(t=!0,ot&&console.log("propagationStopped",e.type));r.options.once&&(n.listeners.splice(s,1),s--),r.callback(e)}}}}_doubleClickTimeThreshold=.2;_longPressTimeThreshold=1;get mousePosition(){return this._pointerPositions[0]}get mousePositionRC(){return this._pointerPositionsRC[0]}get mouseDown(){return this._pointerDown[0]}get mouseUp(){return this._pointerUp[0]}get mouseClick(){return this._pointerClick[0]}get mouseDoubleClick(){return this._pointerDoubleClick[0]}get mousePressed(){return this._pointerPressed[0]}get mouseWheelChanged(){return this.getMouseWheelChanged(0)}get click(){return this._pointerClick[0]}get doubleClick(){return this._pointerDoubleClick[0]}getGamepad(e=0){return typeof navigator<"u"&&"getGamepads"in navigator&&navigator.getGamepads()[e]||null}_setCursorTypes=[];setCursorPointer(){this.setCursor("pointer")}setCursorNormal(){this.unsetCursor("pointer")}setCursor(e){this._setCursorTypes.push(e),this._setCursorTypes.length>10&&this._setCursorTypes.shift(),this.updateCursor()}unsetCursor(e){for(let t=this._setCursorTypes.length-1;t>=0;t--)if(this._setCursorTypes[t]===e){this._setCursorTypes.splice(t,1),this.updateCursor();break}}updateCursor(){this._setCursorTypes?.length==0?this.context.domElement.style.cursor="default":this.context.domElement.style.cursor=this._setCursorTypes[this._setCursorTypes.length-1]}getIsPointerIdInUse(e){for(const t of this._pointerEventsPressed)if(t.pointerId===e&&t.used)return!0;return!1}getPointerPressedCount(){let e=0;for(let t=0;t<this._pointerPressed.length;t++)this._pointerPressed[t]&&e++;return e}getPointerPosition(e){return e>=this._pointerPositions.length?null:this._pointerPositions[e]}getPointerPositionLastFrame(e){return e>=this._pointerPositionsLastFrame.length?null:this._pointerPositionsLastFrame[e]}getPointerPositionDelta(e){return e>=this._pointerPositionsDelta.length?null:this._pointerPositionsDelta[e]}getPointerPositionRC(e){return e>=this._pointerPositionsRC.length?null:this._pointerPositionsRC[e]}getPointerDown(e){return e>=this._pointerDown.length?!1:this._pointerDown[e]}getPointerUp(e){return e>=this._pointerUp.length?!1:this._pointerUp[e]}getPointerPressed(e){return e>=this._pointerPressed.length?!1:this._pointerPressed[e]}getPointerClicked(e){return e>=this._pointerClick.length?!1:this._pointerClick[e]}getPointerDoubleClicked(e){return e>=this._pointerDoubleClick.length?!1:this._pointerDoubleClick[e]}getPointerDownTime(e){return e>=this._pointerDownTime.length?-1:this._pointerDownTime[e]}getPointerUpTime(e){return e>=this._pointerUpTime.length?-1:this._pointerUpTime[e]}getPointerLongPress(e){return e>=this._pointerDownTime.length?!1:this.getPointerPressed(e)&&this.context.time.time-this._pointerDownTime[e]>this._longPressTimeThreshold}getIsMouse(e){return e<0||e>=this._pointerTypes.length?!1:this._pointerTypes[e]==="mouse"}getIsTouch(e){return e<0||e>=this._pointerTypes.length?!1:this._pointerTypes[e]==="touch"}getTouchesPressedCount(){let e=0;for(let t=0;t<this._pointerPressed.length;t++)this._pointerPressed[t]&&this.getIsTouch(t)&&e++;return e}getMouseWheelChanged(e=0){return e>=this._mouseWheelChanged.length?!1:this._mouseWheelChanged[e]}getMouseWheelDeltaY(e=0){return e>=this._mouseWheelDeltaY.length?0:this._mouseWheelDeltaY[e]}getPointerEvent(e){if(!(e>=this._pointerEvent.length))return this._pointerEvent[e]??void 0}*foreachPointerId(e){for(let t=0;t<this._pointerTypes.length;t++)if(this._pointerIsActive(t)){if(e!==void 0){const i=this._pointerTypes[t];if(Array.isArray(e)){let n=!1;for(const s of e)if(i===s){n=!0;break}if(!n)continue}else if(e!==i)continue}yield t}}*foreachTouchId(){for(let e=0;e<this._pointerTypes.length;e++)this._pointerTypes[e]==="touch"&&this._pointerIsActive[e]&&(yield e)}_pointerIsActive(e){return e<0?!1:this._pointerPressed[e]||this._pointerDown[e]||this._pointerUp[e]}context;_pointerDown=[!1];_pointerUp=[!1];_pointerClick=[!1];_pointerDoubleClick=[!1];_pointerPressed=[!1];_pointerPositions=[new J];_pointerPositionsLastFrame=[new J];_pointerPositionsDelta=[new J];_pointerPositionsRC=[new J];_pointerPositionDown=[new b];_pointerDownTime=[];_pointerUpTime=[];_pointerUpTimestamp=[];_pointerIds=[];_pointerTypes=[""];_mouseWheelChanged=[!1];_mouseWheelDeltaY=[0];_pointerEvent=[];_pointerEventsPressed=[];_pointerSpace=[];_pressedStack=new Map;onDownButton(e,t){let i=this._pressedStack.get(e);i||(i=[],this._pressedStack.set(e,i)),i.push(t)}onReleaseButton(e,t){const i=this._pressedStack.get(e);if(!i)return;const n=i.indexOf(t);n>=0&&i.splice(n,1)}getFirstPressedButtonForPointer(e){const t=this._pressedStack.get(e);if(t)return t[0]}getLatestPressedButtonForPointer(e){const t=this._pressedStack.get(e);if(t)return t[t.length-1]}getKeyDown(e){if(e!==void 0)return this.isKeyDown(e);for(const t in this.keysPressed){const i=this.keysPressed[t];if(i.startFrame===this.context.time.frameCount)return i.key}return null}getKeyPressed(e){if(e!==void 0)return this.isKeyPressed(e);for(const t in this.keysPressed){const i=this.keysPressed[t];if(i.pressed)return i.key}return null}getKeyUp(e){if(e!==void 0)return this.isKeyUp(e);for(const t in this.keysPressed){const i=this.keysPressed[t];return i.pressed===!1&&i.frame===this.context.time.frameCount}return null}isKeyDown(e){if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(e);if(t!==null){for(const n of t)if(this.isKeyDown(n))return!0;return!1}const i=this.keysPressed[e];return i?i.startFrame===this.context.time.frameCount&&i.pressed:!1}isKeyUp(e){if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(e);if(t!==null){for(const n of t)if(this.isKeyUp(n))return!0;return!1}const i=this.keysPressed[e];return i?i.frame===this.context.time.frameCount&&i.pressed===!1:!1}isKeyPressed(e){if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(e);if(t!==null){for(const n of t)if(this.isKeyPressed(n))return!0;return!1}const i=this.keysPressed[e];return i&&i.pressed||!1}getCodeForCommonKeyName(e){if(e.length===1){if(e>="0"&&e<="9")return["Digit"+e];if(e>="a"&&e<="z")return["Key"+e.toUpperCase()];if(e==" ")return["Space"]}switch(e){case"shift":case"Shift":return["ShiftLeft","ShiftRight"];case"control":case"Control":return["ControlLeft","ControlRight"];case"alt":case"Alt":return["AltLeft","AltRight"]}return null}createInputEvent(e){switch(e.type){case"pointerdown":ot&&Te("Create Pointer down"),this.onDownButton(e.deviceIndex,e.button),this.onDown(e);break;case"pointermove":ot&&Te("Create Pointer move"),this.onMove(e);break;case"pointerup":ot&&Te("Create Pointer up"),this.onUp(e),this.onReleaseButton(e.deviceIndex,e.button);break}}convertScreenspaceToRaycastSpace(e){return e.x=(e.x-this.context.domX)/this.context.domWidth*2-1,e.y=-((e.y-this.context.domY)/this.context.domHeight)*2+1,e}constructor(e){this.context=e,this.context.post_render_callbacks.push(this.onEndOfFrame)}_htmlEventSource;bindEvents(){this.unbindEvents(),this._htmlEventSource=this.context.renderer.domElement,window.addEventListener("contextmenu",this.onContextMenu),this._htmlEventSource.addEventListener("pointerdown",this.onPointerDown,{passive:!0}),window.addEventListener("pointermove",this.onPointerMove,{passive:!0,capture:!0}),window.addEventListener("pointerup",this.onPointerUp,{passive:!0}),window.addEventListener("pointercancel",this.onPointerCancel,{passive:!0}),window.addEventListener("touchstart",this.onTouchStart,{passive:!0}),window.addEventListener("touchmove",this.onTouchMove,{passive:!0}),window.addEventListener("touchend",this.onTouchEnd,{passive:!0}),this._htmlEventSource.addEventListener("wheel",this.onMouseWheel,{passive:!0}),window.addEventListener("wheel",this.onWheelWindow,{passive:!0}),window.addEventListener("keydown",this.onKeyDown,!1),window.addEventListener("keypress",this.onKeyPressed,!1),window.addEventListener("keyup",this.onKeyUp,!1),window.addEventListener("blur",this.onLostFocus)}unbindEvents(){for(const e in this._eventListeners)this._eventListeners[e].length=0;window.removeEventListener("contextmenu",this.onContextMenu),this._htmlEventSource?.removeEventListener("pointerdown",this.onPointerDown),window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerCancel),window.removeEventListener("touchstart",this.onTouchStart),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd),this._htmlEventSource?.removeEventListener("wheel",this.onMouseWheel,!1),window.removeEventListener("wheel",this.onWheelWindow,!1),window.removeEventListener("keydown",this.onKeyDown,!1),window.removeEventListener("keypress",this.onKeyPressed,!1),window.removeEventListener("keyup",this.onKeyUp,!1),window.removeEventListener("blur",this.onLostFocus)}dispose(){const e=this.context.post_render_callbacks.indexOf(this.onEndOfFrame);e>=0&&this.context.post_render_callbacks.splice(e,1),this.unbindEvents()}onLostFocus=()=>{for(const e in this.keysPressed)this.keysPressed[e].pressed=!1};_receivedPointerMoveEventsThisFrame=new Array;onEndOfFrame=()=>{this._receivedPointerMoveEventsThisFrame.length=0;for(let e=0;e<this._pointerUp.length;e++)this._pointerUp[e]=!1;for(let e=0;e<this._pointerDown.length;e++)this._pointerDown[e]=!1;for(let e=0;e<this._pointerClick.length;e++)this._pointerClick[e]=!1;for(let e=0;e<this._pointerDoubleClick.length;e++)this._pointerDoubleClick[e]=!1;for(const e of this._pointerPositionsDelta)e.set(0,0);for(let e=0;e<this._mouseWheelChanged.length;e++)this._mouseWheelChanged[e]=!1;for(let e=0;e<this._mouseWheelDeltaY.length;e++)this._mouseWheelDeltaY[e]=0};canReceiveInput(e){return e.target===this.context.renderer?.domElement||e.target===this.context.domElement||this.context.isInAR||this.context.isInAR&&e.target===document.body&&G.isMozillaXR()?!0:(ot&&console.warn("CanReceiveInput:False for",e.target),!1)}onContextMenu=e=>{this.canReceiveInput(e)!==!1&&e instanceof PointerEvent&&e.pointerType};keysPressed={};onKeyDown=e=>{if(ot&&console.log(`key down ${e.code}, ${this.context.application.hasFocus}`,e),!this.context.application.hasFocus)return;const t=this.keysPressed[e.code];if(t&&t.pressed)return;this.keysPressed[e.code]={pressed:!0,frame:this.context.time.frameCount+1,startFrame:this.context.time.frameCount+1,key:e.key,code:e.code};const i=new sc("keydown",e,e);this.onDispatchEvent(i)};onKeyPressed=e=>{if(!this.context.application.hasFocus)return;const t=this.keysPressed[e.code];if(!t)return;t.pressed=!0,t.frame=this.context.time.frameCount+1;const i=new sc("keypress",e,e);this.onDispatchEvent(i)};onKeyUp=e=>{if(!this.context.application.hasFocus)return;const t=this.keysPressed[e.code];if(!t)return;t.pressed=!1,t.frame=this.context.time.frameCount+1;const i=new sc("keyup",e,e);this.onDispatchEvent(i)};onWheelWindow=e=>{document.pointerLockElement&&this.onMouseWheel(e)};onMouseWheel=e=>{if(this.canReceiveInput(e)===!1)return;this._mouseWheelDeltaY.length<=0&&this._mouseWheelDeltaY.push(0),this._mouseWheelChanged.length<=0&&this._mouseWheelChanged.push(!1),this._mouseWheelChanged[0]=!0;const t=this._mouseWheelDeltaY[0];this._mouseWheelDeltaY[0]=t+e.deltaY};onPointerDown=e=>{if(this.context.isInAR||this.canReceiveInput(e)===!1)return;e.target instanceof HTMLElement&&e.target.setPointerCapture(e.pointerId);const t=this.getPointerId(e);ot&&Te(`pointer down #${t}, identifier:${e.pointerId}`);const i=this.getAndUpdateSpatialObjectForScreenPosition(t,e.clientX,e.clientY),n=new Co("pointerdown",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:t,button:e.button,clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,buttonName:this.getButtonName(e),device:i,pressure:e.pressure});this.onDown(n)};onPointerMove=e=>{if(this.context.isInAR||this._receivedPointerMoveEventsThisFrame.includes(e.pointerId))return;this._receivedPointerMoveEventsThisFrame.push(e.pointerId);let t=e.button;e.pointerType==="mouse"&&(t=this.getFirstPressedButtonForPointer(0)??0);const i=this.getPointerId(e,t);t===-1&&(t=i);const n=this.getAndUpdateSpatialObjectForScreenPosition(i,e.clientX,e.clientY),s=new Co("pointermove",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:i,button:t,clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,buttonName:this.getButtonName(e),device:n,pressure:e.pressure});this.onMove(s)};onPointerCancel=e=>{this.context.isInAR||(ot&&console.log("Pointer cancel",e),this.onPointerUp(e))};onPointerUp=e=>{if(this.context.isInAR)return;e.target instanceof HTMLElement&&e.target.releasePointerCapture(e.pointerId);const t=this.getPointerId(e),i=new Co("pointerup",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:t,button:e.button,clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,buttonName:this.getButtonName(e),device:this.getAndUpdateSpatialObjectForScreenPosition(t,e.clientX,e.clientY),pressure:e.pressure});this.onUp(i),this._pointerIds[t]=-1,ot&&console.log("ID="+t,"PointerId="+e.pointerId,"ALL:",[...this._pointerIds])};getPointerId(e,t){return e.pointerType==="mouse"?0+(t??e.button):this.getPointerIndex(e.pointerId)}getButtonName(e){const t=e.button;if(e.pointerType==="mouse")switch(t){case 0:return"left";case 1:return"middle";case 2:return"right"}return"unknown"}onTouchStart=e=>{if(this.context.isInAR)for(let t=0;t<e.changedTouches.length;t++){const i=e.changedTouches[t],n=this.getPointerIndex(i.identifier),s=this.getAndUpdateSpatialObjectForScreenPosition(n,i.clientX,i.clientY),r=new Co("pointerdown",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:n,button:0,clientX:i.clientX,clientY:i.clientY,pointerType:"touch",buttonName:"unknown",device:s,pressure:i.force});this.onDown(r)}};onTouchMove=e=>{if(this.context.isInAR)for(let t=0;t<e.changedTouches.length;t++){const i=e.changedTouches[t],n=this.getPointerIndex(i.identifier),s=this.getAndUpdateSpatialObjectForScreenPosition(n,i.clientX,i.clientY),r=new Co("pointermove",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:n,button:0,clientX:i.clientX,clientY:i.clientY,pointerType:"touch",buttonName:"unknown",device:s,pressure:i.force});this.onMove(r)}};onTouchEnd=e=>{if(this.context.isInAR)for(let t=0;t<e.changedTouches.length;t++){const i=e.changedTouches[t],n=this.getPointerIndex(i.identifier),s=new Co("pointerup",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:n,button:0,clientX:i.clientX,clientY:i.clientY,pointerType:"touch",buttonName:"unknown",device:this.getAndUpdateSpatialObjectForScreenPosition(n,i.clientX,i.clientY),pressure:i.force});this.onUp(s),this._pointerIds[n]=-1}};tempNearPlaneVector=new b;tempFarPlaneVector=new b;tempLookMatrix=new ee;getAndUpdateSpatialObjectForScreenPosition(e,t,i){let n=this._pointerSpace[e];n||(n=new k,this._pointerSpace[e]=n),this._pointerSpace[e]=n;const s=this.context.mainCamera;if(s){const r=this.tempNearPlaneVector.set(t,i,-1);this.convertScreenspaceToRaycastSpace(r);const a=this.tempFarPlaneVector.set(r.x,r.y,1);r.unproject(s),a.unproject(s);const l=s.worldUp||z(0,1,0).applyQuaternion(be(s));this.tempLookMatrix.lookAt(a,r,l),n.position.set(r.x,r.y,r.z),n.quaternion.setFromRotationMatrix(this.tempLookMatrix)}return n}isInRect(e){if(this.context.isInXR)return!0;const t=this.context.domElement.getBoundingClientRect(),i=e.clientX,n=e.clientY,s=i>=t.x&&i<=t.right&&n>=t.y&&n<=t.bottom;return ot&&!s&&console.log("Not in rect",t,i,n),s}onDown(e){const t=e.pointerId;if(this.getPointerPressed(t)&&console.warn(`Received pointerDown for pointerId that is already pressed: ${t}`,ot?e:""),ot&&console.log(e.pointerType,"DOWN",t),!!this.isInRect(e)){for(this.setPointerState(t,this._pointerPressed,!0),this.setPointerState(t,this._pointerDown,!0),this.setPointerStateT(t,this._pointerEvent,e.source);t>=this._pointerTypes.length;)this._pointerTypes.push(e.pointerType);for(this._pointerTypes[t]=e.pointerType;t>=this._pointerPositionDown.length;)this._pointerPositionDown.push(new b);for(this._pointerPositionDown[t].set(e.clientX,e.clientY,e.clientZ??0);t>=this._pointerPositions.length;)this._pointerPositions.push(new J);this._pointerPositions[t].set(e.clientX,e.clientY),t>=this._pointerDownTime.length&&this._pointerDownTime.push(0),this._pointerDownTime[t]=this.context.time.realtimeSinceStartup,this.updatePointerPosition(e),this._pointerEventsPressed.push(e),this.onDispatchEvent(e)}}onMove(e){const t=e.pointerId,i=this.getPointerPressed(t);i===!1&&!this.isInRect(e)||e.pointerType==="touch"&&!i||(this.updatePointerPosition(e),this.setPointerStateT(t,this._pointerEvent,e.source),this.onDispatchEvent(e))}onUp(e){const t=e.pointerId;if(!this.getPointerPressed(t)){ot&&console.log(e.pointerType,"UP",t,"was not down");return}ot&&console.log(e.pointerType,"UP",t),this.setPointerState(t,this._pointerPressed,!1),this.setPointerStateT(t,this._pointerEvent,e.source),this.setPointerState(t,this._pointerUp,!0),this.updatePointerPosition(e);for(let a=this._pointerEventsPressed.length-1;a>=0;a--)if(this._pointerEventsPressed[a].pointerId===t){this._pointerEventsPressed.splice(a,1);break}if(!this._pointerPositionDown[t]){ot&&ge("Received pointer up event without matching down event for button: "+t),console.warn("Received pointer up event without matching down event for button: "+t);return}const i=this._pointerUpTime[t],n=this._pointerDownTime[t],s=this.context.time.realtimeSinceStartup,r=s-n;if(t>=this._pointerUpTime.length&&this._pointerUpTime.push(-99),this._pointerUpTime[t]=s,r<1){let a=e.clientX-this._pointerPositionDown[t].x,l=e.clientY-this._pointerPositionDown[t].y,c=0;if(e.isSpatial&&e.clientZ!=null&&(c=e.clientZ-this._pointerPositionDown[t].z,a*=200,l*=200,c*=200),Math.abs(a)<5&&Math.abs(l)<5&&Math.abs(c)<5){this.setPointerState(t,this._pointerClick,!0),e.isClick=!0;const h=s-i;ot&&console.log("CLICK",t,a,l,c,h),h<this._doubleClickTimeThreshold&&h>0&&(this.setPointerState(t,this._pointerDoubleClick,!0),e.isDoubleClick=!0)}}this.onDispatchEvent(e)}updatePointerPosition(e){const t=e.pointerId;for(;t>=this._pointerPositions.length;)this._pointerPositions.push(new J);for(;t>=this._pointerPositionsLastFrame.length;)this._pointerPositionsLastFrame.push(new J);for(;t>=this._pointerPositionsDelta.length;)this._pointerPositionsDelta.push(new J);const i=this._pointerPositionsLastFrame[t];i.copy(this._pointerPositions[t]);const n=this._pointerPositionsDelta[t];let s=e.clientX-i.x,r=e.clientY-i.y;if(e.source instanceof MouseEvent||e.source instanceof TouchEvent){const h=e.source;s===0&&h.movementX!==0&&(s=h.movementX||0),r===0&&h.movementY!==0&&(r=h.movementY||0)}n.x+=s,n.y+=r,this._pointerPositions[t].x=e.clientX,this._pointerPositions[t].y=e.clientY;const a=e.clientX,l=e.clientY;for(;t>=this._pointerPositionsRC.length;)this._pointerPositionsRC.push(new J);const c=this._pointerPositionsRC[t];c.set(a,l),this.convertScreenspaceToRaycastSpace(c)}getPointerIndex(e){let t=-1;for(let i=0;i<this._pointerIds.length;i++){if(this._pointerIds[i]===e)return i;t===-1&&this._pointerIds[i]===-1&&(t=i)}return t!==-1?(this._pointerIds[t]=e,t):(ot&&console.log("PUSH pointerId:",e),this._pointerIds.push(e),this._pointerIds.length-1)}setPointerState(e,t,i){t[e]=i}setPointerStateT(e,t,i){return t[e]=i,i}onDispatchEvent(e){const t=N.Current;try{N.Current=this.context,this.dispatchEvent(e)}finally{N.Current=t}}}const Ea=new ee().makeRotationY(Math.PI),Gi=new U().setFromAxisAngle(new b(0,1,0),Math.PI),FO=x("debugwebxr");class zO{priority=-1e5;gameObject;isXRRig(){return!0}get isActive(){return this.gameObject.visible}constructor(){if(this.gameObject=new k,this.gameObject.name="Implicit XR Rig",FO){const e=vg(16733661);e.position.y+=.5,this.gameObject.add(e)}}}const Po=x("debugwebxr"),Bd=x("debugcustomgesture"),UO="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",NO="generic-trigger",VO=new U().setFromEuler(new nt(yo.degToRad(0),yo.degToRad(-90),yo.degToRad(-90))),WO=new b(.04,-.04,0);class rg{xr;get context(){return this.xr.context}inputSource;index=0;emitEvents=!0;get connected(){return this._connected}_connected=!0;get isTracking(){return this._isTracking}_isTracking=!1;get gamepad(){return this.__gamepad??=this.inputSource.gamepad}__gamepad;get isHand(){return this.hand!=null}get hand(){return this.__hand??=this.inputSource.hand}__hand;get handObject(){return this.context.renderer.xr.getHand(this.index)}get profiles(){return this.inputSource.profiles}get layout(){return this._layout}get targetRayMode(){return this.inputSource.targetRayMode}get targetRaySpace(){return this.inputSource.targetRaySpace}get gripSpace(){return this.inputSource.gripSpace}get side(){return this.__side??=this.inputSource.handedness}__side=void 0;get isRight(){return this.side==="right"}get isLeft(){return this.side==="left"}get isStylus(){return this._isMxInk}getHitTestSource(){return this._hitTestSource||this._requestHitTestSource(),this._hitTestSource}get hasHitTestSource(){return this._hitTestSource}cancelHitTestSource(){this._hitTestSource&&(this._hitTestSource.cancel(),this._hitTestSource=void 0)}_hitTestSource=void 0;_hasSelectEvent=!1;get hasSelectEvent(){return this._hasSelectEvent}_isMxInk=!1;_isMetaQuestTouchController=!1;getHitTest(){return this.xr.getHitTest(this)}_handJointPoses=new Map;getHandJointPose(e,t){if(t=t||this.xr.frame,!this.hand||!t?.getJointPose||!this.xr.referenceSpace)return null;let i=this._handJointPoses?.get(e);return i||(i=t.getJointPose(e,this.xr.referenceSpace),i&&this._handJointPoses.set(e,i),i)}_gripMatrix=new ee;_gripPosition=new b;_gripQuaternion=new U;_linearVelocity=new b;_rayPositionRaw=new b;_rayRotationRaw=new U;_rayMatrix=new ee;_rayPosition=new b;_rayQuaternion=new U;get gripPosition(){return z(this._gripPosition)}get gripQuaternion(){return ti(this._gripQuaternion)}get gripMatrix(){return this._gripMatrix}get gripLinearVelocity(){return z(this._linearVelocity).applyQuaternion(Gi)}get rayPosition(){return z(this._rayPosition)}get rayQuaternion(){return ti(this._rayQuaternion)}get gripWorldPosition(){return z(this._gripWorldPosition)}_gripWorldPosition=new b;get gripWorldQuaternion(){return ti(this._gripWorldQuaternion)}_gripWorldQuaternion=new U;get rayWorldPosition(){return z(this._rayWorldPosition)}_rayWorldPosition=new b;updateRayWorldPosition(){const e=this.xr.context.mainCamera?.parent;this._rayWorldPosition.copy(this._rayPositionRaw),e&&this._rayWorldPosition.applyMatrix4(e.matrixWorld)}get rayWorldQuaternion(){return ti(this._rayWorldQuaternion)}_rayWorldQuaternion=new U;get pinchPosition(){return z(this._pinchPosition)}_pinchPosition=new b;updateRayWorldQuaternion(){const e=this.xr.context.mainCamera?.parent,t=e?be(e):void 0;this._rayWorldQuaternion.copy(this._rayRotationRaw).multiply(Gi),t&&this._rayWorldQuaternion.premultiply(t)}get ray(){return this._ray.origin.copy(this.rayWorldPosition),this._ray.direction.copy(z(0,0,1).applyQuaternion(this.rayWorldQuaternion)),this._ray}_ray;_hand_wristDotUp=void 0;get handWristDotUp(){if(this._hand_wristDotUp!==void 0)return this._hand_wristDotUp;const e=this.handObject?.joints.wrist;if(e){const t=z(0,1,0).applyQuaternion(e.quaternion),i=z(0,1,0).dot(t);return this._hand_wristDotUp=i}}get isHandUpsideDown(){return this.handWristDotUp!==void 0?this.handWristDotUp<-.7:!1}get isTeleportGesture(){return this.isHandUpsideDown&&this.getGesture("pinch")?.isDown}get object(){return this._object}_object;_gripSpaceObject;_raySpaceObject;model=null;_debugAxesHelper=new _i(.15);_debugGripAxesHelper=new _i(.07);_debugRayAxesHelper=new _i(.07);async getModelUrl(){return this.getMotionController?.then(e=>e?.assetUrl||null)}constructor(e,t,i){this.xr=e,this.inputSource=t,this.index=i,this._object=new k,this._object.name=`NeedleXRController_${i}`,Po&&(this._object.add(this._debugAxesHelper),this._gripSpaceObject=new k,this._raySpaceObject=new k,this._gripSpaceObject.name=`NeedleXRController_${i}_gripSpace`,this._raySpaceObject.name=`NeedleXRController_${i}_raySpace`,this._gripSpaceObject.add(this._debugGripAxesHelper),this._raySpaceObject.add(this._debugRayAxesHelper),this.xr.context.scene.add(this._gripSpaceObject),this.xr.context.scene.add(this._raySpaceObject)),this.xr.context.scene.add(this._object),this._ray=new ls,this.pointerInit={origin:this,pointerType:this.hand?"hand":"controller",deviceIndex:this.index,pointerId:-1,mode:this.inputSource.targetRayMode,ray:this._ray,device:this._object,buttonName:"none"},this.initialize(),this.subscribeEvents()}_hitTestSourcePromise=null;_requestHitTestSource(){return this._hitTestSourcePromise?this._hitTestSourcePromise:this.xr.mode==="immersive-ar"&&this.inputSource.targetRayMode==="tracked-pointer"&&this.xr.session.requestHitTestSourceForTransientInput?this._hitTestSourcePromise=this.xr.session.requestHitTestSourceForTransientInput({profile:this.inputSource.profiles[0],offsetRay:new XRRay})?.then(e=>(this._hitTestSourcePromise=null,this.connected?this._hitTestSource=e:(e.cancel(),null)))??null:null}onPointerHits=e=>{};onUpdate(e){this.onUpdateFrame(e),this.updateInputEvents(),this.onUpdateMove()}onRenderDebug(){F.DrawSphere(this.rayWorldPosition,.003),F.DrawDirection(this.rayWorldPosition,z(0,0,10).applyQuaternion(this.rayWorldQuaternion));const e=(this.inputSource.gripSpace?this.gripWorldPosition:this.object.worldPosition).sub(this.object.worldForward.multiplyScalar(.1)),t=this.inputSource.profiles.join(`
146
146
  `);let i=`Controller[${this.index}] (${this.inputSource.targetRayMode}, ${this.side})
147
147
  C:${this.connected?"x":"-"} T:${this.isTracking?"x":"-"} Hand:${this.inputSource.hand?"x":"-"} Pen: ${this._isMxInk?"x":"-"}`;if(this.inputSource.hand&&(i+=`
@@ -1428,7 +1428,7 @@ C) Set "joinRandomRoom" to true`),!1):(g0&&console.log("Join "+this.roomName),th
1428
1428
  * See the License for the specific language governing permissions and
1429
1429
  * limitations under the License.
1430
1430
  */const J2={topLight:{intensity:500,position:[.418,16.199,.3]},room:{position:[-.757,13.219,.717],scale:[31.713,28.305,28.591]},boxes:[{position:[-10.906,2.009,1.846],rotation:-.195,scale:[2.328,7.905,4.651]},{position:[-5.607,-.754,-.758],rotation:.994,scale:[1.97,1.534,3.955]},{position:[6.167,.857,7.803],rotation:.561,scale:[3.927,6.285,3.687]},{position:[-2.017,.018,6.124],rotation:.333,scale:[2.002,4.566,2.064]},{position:[2.291,-.756,-2.621],rotation:-.286,scale:[1.546,1.552,1.496]},{position:[-2.193,-.369,-5.547],rotation:.516,scale:[3.875,3.487,2.986]}],lights:[{intensity:50,position:[-16.116,14.37,8.208],scale:[.1,2.428,2.739]},{intensity:50,position:[-16.109,18.021,-8.207],scale:[.1,2.425,2.751]},{intensity:17,position:[14.904,12.198,-1.832],scale:[.15,4.265,6.331]},{intensity:43,position:[-.462,8.89,14.52],scale:[4.38,5.441,.088]},{intensity:20,position:[3.235,11.486,-12.541],scale:[2.5,2,.1]},{intensity:100,position:[0,20,0],scale:[1,.1,1]}]},eI={topLight:{intensity:400,position:[.5,14,.5]},room:{position:[0,13.2,0],scale:[31.5,28.5,31.5]},boxes:[{position:[-10.906,-1,1.846],rotation:-.195,scale:[2.328,7.905,4.651]},{position:[-5.607,-.754,-.758],rotation:.994,scale:[1.97,1.534,3.955]},{position:[6.167,-.16,7.803],rotation:.561,scale:[3.927,6.285,3.687]},{position:[-2.017,.018,6.124],rotation:.333,scale:[2.002,4.566,2.064]},{position:[2.291,-.756,-2.621],rotation:-.286,scale:[1.546,1.552,1.496]},{position:[-2.193,-.369,-5.547],rotation:.516,scale:[3.875,3.487,2.986]}],lights:[{intensity:80,position:[-14,10,8],scale:[.1,2.5,2.5]},{intensity:80,position:[-14,14,-4],scale:[.1,2.5,2.5]},{intensity:23,position:[14,12,0],scale:[.1,5,5]},{intensity:16,position:[0,9,14],scale:[5,5,.1]},{intensity:80,position:[7,8,-14],scale:[2.5,2.5,.1]},{intensity:80,position:[-7,16,-14],scale:[2.5,2.5,.1]},{intensity:1,position:[0,20,0],scale:[.1,.1,.1]}]};class Hp extends yi{constructor(e){super(),this.position.y=-3.5;const t=new va;t.deleteAttribute("uv");const i=new ut({metalness:0,side:_d}),n=new ut({metalness:0}),s=e=="legacy"?J2:eI,r=new cm(16777215,s.topLight.intensity,28,2);r.position.set(...s.topLight.position),this.add(r);const a=new H(t,i);a.position.set(...s.room.position),a.scale.set(...s.room.scale),this.add(a);for(const l of s.boxes){const c=new H(t,n);c.position.set(...l.position),c.rotation.set(0,l.rotation,0),c.scale.set(...l.scale),this.add(c)}for(const l of s.lights){const c=new H(t,this.createAreaLightMaterial(l.intensity));c.position.set(...l.position),c.scale.set(...l.scale),this.add(c)}}createAreaLightMaterial(e){const t=new we;return t.color.setScalar(e),t}}var tI=Object.defineProperty,Gp=(o,e,t,i)=>{for(var n=void 0,s=o.length-1,r;s>=0;s--)(r=o[s])&&(n=r(e,t,n)||n);return n&&tI(e,t,n),n};const Dh=class dS extends R{target;invertForward=!1;keepUpDirection=!0;copyTargetRotation=!1;static flipYQuat=new U().setFromAxisAngle(new b(0,1,0),Math.PI);onBeforeRender(){let e=this.target;if(e||(e=this.context.mainCamera,A()&&console.warn(`[LookAt] No target set on ${this.name}, using main camera as target.`)),!e)return;let t=this.copyTargetRotation;(this.context.isInVR||this.context.isInPassThrough)&&(t=!1),Kl(this.gameObject,e,this.keepUpDirection,t),this.invertForward&&this.gameObject.quaternion.multiply(dS.flipYQuat)}createBehaviours(e,t,i){if(t.uuid===this.gameObject.uuid){let n=t;if(this.keepUpDirection){const r=it.createEmptyParent(t);n=r;const a=this.invertForward?-1:1;r.setMatrix(r.getMatrix().multiply(new ee().makeRotationZ(Math.PI/2*a))),t.setMatrix(t.getMatrix().multiply(new ee().makeRotationZ(-Math.PI/2*a)))}const s=new Et("lookat "+this.name,Dt.sceneStartTrigger(),me.lookAtCameraAction(n,void 0,this.invertForward?un.back:un.forward,this.keepUpDirection?un.up:un.zero));e.addBehavior(s)}}};Gp([u(k)],Dh.prototype,"target"),Gp([u()],Dh.prototype,"invertForward"),Gp([u()],Dh.prototype,"keepUpDirection"),Gp([u()],Dh.prototype,"copyTargetRotation");let w0=Dh;var iI=Object.defineProperty,S0=(o,e,t,i)=>{for(var n=void 0,s=o.length-1,r;s>=0;s--)(r=o[s])&&(n=r(e,t,n)||n);return n&&iI(e,t,n),n};class Rl extends R{url;mode=0;clickable=!0;async open(){if(!this.url){console.warn("OpenURL: URL is not set, can't open.",this);return}this._validateUrl();let e=this.url;switch(!e.startsWith("mailto:")&&e.includes("@")&&(e="mailto:"+e),A()&&Te("Open URL: "+e),this.mode){case 0:G.isSafari(),globalThis.open(e,"_blank");break;case 1:G.isSafari()&&G.isiOS()?globalThis.open(e,"_top"):globalThis.open(e,"_self");break;case 2:G.isSafari()?globalThis.open(e,"_top"):globalThis.open(e,"_new");break}}start(){this.gameObject.getComponentInParent(ki)||this.gameObject.addComponent(ki)}onPointerEnter(e){!e.used&&this.clickable&&this.context.input.setCursor("pointer")}onPointerExit(){this.clickable&&this.context.input.unsetCursor("pointer")}onPointerClick(e){this.clickable&&!e.used&&this.url?.length&&this.open()}_validateUrl(){this.url&&this.url.startsWith("www.")&&(A()&&console.warn("URL is not valid, adding https:// to the start of the URL",this.url),this.url="https://"+this.url)}}S0([u()],Rl.prototype,"url"),S0([u()],Rl.prototype,"mode"),S0([u()],Rl.prototype,"clickable"),bu(o=>{const e=o.domElement.getAttribute("clickthrough");if(t(e)){const i=o.scene.addComponent(qp);Im(o.domElement,"clickthrough",()=>{const n=o.domElement.getAttribute("clickthrough");i.enabled=t(n)})}function t(i){return i!==null&&i!=="0"&&i!=="false"}});class qp extends R{_previousPointerEvents="all";onEnable(){this.context.input.addEventListener("pointerdown",this.onPointerEvent),this.context.input.addEventListener("pointermove",this.onPointerEvent,{queue:100}),window.addEventListener("touchend",this.onTouchEnd,{passive:!0}),this._previousPointerEvents=this.context.domElement.style.pointerEvents}onDisable(){this.context.input.removeEventListener("pointerdown",this.onPointerEvent),this.context.input.removeEventListener("pointermove",this.onPointerEvent),window.removeEventListener("touchend",this.onTouchEnd),this.context.domElement.style.pointerEvents=this._previousPointerEvents}onPointerEnter(){}onPointerEvent=e=>{e.pointerId>0||(e.intersections?.length<=0?this.context.domElement.style.pointerEvents="none":this.context.domElement.style.pointerEvents="all")};onTouchEnd=e=>{setTimeout(()=>{this.context.domElement.style.pointerEvents="all"},100)}}var nI=Object.defineProperty,O1=(o,e,t,i)=>{for(var n=void 0,s=o.length-1,r;s>=0;s--)(r=o[s])&&(n=r(e,t,n)||n);return n&&nI(e,t,n),n};class Bh extends R{damping=0;keepDistance=!0;awake(){this._distance=-1}_distance=-1;updateDistance(){this.keepDistance&&this._distance!==-1||(this._distance=this.gameObject.worldPosition.distanceTo(this.context.mainCamera.worldPosition))}update(){this.updateDistance();const e=this.context.input.mousePositionRC,t=this.context.mainCamera,i=t.worldPosition,n=z(e.x,e.y,1).unproject(t);n.sub(i).normalize();const s=n.multiplyScalar(this._distance).add(i);if(this.damping>0){const r=this.gameObject.worldPosition;r.lerp(s,this.context.time.deltaTime/this.damping),this.gameObject.worldPosition=r}else this.gameObject.worldPosition=s}}O1([u()],Bh.prototype,"damping"),O1([u()],Bh.prototype,"keepDistance");var oI=Object.defineProperty,sI=Object.getOwnPropertyDescriptor,Tl=(o,e,t,i)=>{for(var n=i>1?void 0:i?sI(e,t):e,s=o.length-1,r;s>=0;s--)(r=o[s])&&(n=(i?r(e,t,n):r(n))||n);return i&&n&&oI(e,t,n),n};let uo=class extends R{type="linear";duration=.1;scaleFactor=1.1;hovered=null;idle=null;animation=null;start(){this.idle||(this.idle=bs.emptyClip()),this.hovered||(this.hovered=bs.createScaleClip({type:"linear",duration:this.duration||.1,scale:this.gameObject.scale,scaleFactor:this.scaleFactor||1.1})),this.animation??=this.gameObject.addComponent(Lt),this.animation.playAutomatically=!1,this.playIdle()}onEnable(){this.animation&&(this.animation.enabled=!0),this.playIdle()}onDisable(){this.animation&&(this.animation.enabled=!1),this.playIdle()}onPointerEnter(){this.playHover()}onPointerExit(){this.playIdle()}playIdle(){this.idle&&this.animation?.play(this.idle,{exclusive:!0,fadeDuration:.1,loop:!0})}playHover(){this.hovered&&this.animation?.play(this.hovered,{exclusive:!0,fadeDuration:.1,loop:!1,clampWhenFinished:!0})}};Tl([u()],uo.prototype,"type",2),Tl([u()],uo.prototype,"duration",2),Tl([u()],uo.prototype,"scaleFactor",2),Tl([u(Wi)],uo.prototype,"hovered",2),Tl([u(Wi)],uo.prototype,"idle",2),uo=Tl([jg],uo);var rI=Object.defineProperty,El=(o,e,t,i)=>{for(var n=void 0,s=o.length-1,r;s>=0;s--)(r=o[s])&&(n=r(e,t,n)||n);return n&&rI(e,t,n),n};const Xp=x("debugscroll");class Qo extends R{target=null;damping=0;invert=!1;htmlSelector=null;mode="window";changed=new he;get currentValue(){return this._current_value}_current_value=0;_target_value=0;_appliedValue=-1;_scrollStart=0;_scrollEnd=0;_scrollValue=0;_scrollContainerHeight=0;onEnable(){window.addEventListener("wheel",this.updateCurrentScrollValue,{passive:!0}),this._appliedValue=-1}onDisable(){window.removeEventListener("wheel",this.updateCurrentScrollValue)}lateUpdate(){this.updateCurrentScrollValue(),this._target_value>=0&&(this.damping>0?(this._current_value=j.lerp(this._current_value,this._target_value,this.context.time.deltaTime/this.damping),Math.abs(this._current_value-this._target_value)<.001&&(this._current_value=this._target_value)):this._current_value=this._target_value);{this._appliedValue=this._current_value;let e=!1;if(this.changed.listenerCount>0){const t={type:"change",value:this._current_value,component:this,preventDefault:()=>{t.defaultPrevented=!0},defaultPrevented:!1};this.changed.invoke(t),e=t.defaultPrevented}if(!e){const t=this.invert?1-this._current_value:this._current_value;Array.isArray(this.target)?this.target.forEach(i=>i&&this.applyScroll(i,t)):this.target&&this.applyScroll(this.target,t),Xp&&this.context.time.frame%30===0&&console.debug(`[ScrollFollow] ${this._current_value.toFixed(5)} \u2014 ${(this._target_value*100).toFixed(0)}%, targets [${Array.isArray(this.target)?this.target.length:1}]`)}}}_lastSelectorValue=null;_lastSelectorElement=null;_rangeStartValue=0;_rangeEndValue=0;updateCurrentScrollValue=()=>{switch(this.mode){case"window":if(this.htmlSelector?.length){if(this.htmlSelector!==this._lastSelectorValue&&(this._lastSelectorElement=document.querySelector(this.htmlSelector),this._lastSelectorValue=this.htmlSelector),this._lastSelectorElement){const e=this._lastSelectorElement.getBoundingClientRect();this._scrollStart=e.top+window.scrollY,this._scrollEnd=e.height-window.innerHeight,this._scrollValue=-e.top,this._target_value=-e.top/(e.height-window.innerHeight),this._rangeStartValue=e.top+window.scrollY,this._rangeEndValue=this._rangeStartValue+e.height-window.innerHeight,this._scrollContainerHeight=e.height;break}}else this._scrollStart=0,this._scrollEnd=window.document.body.scrollHeight-window.innerHeight,this._scrollValue=window.scrollY,this._target_value=this._scrollValue/(this._scrollEnd||1),this._rangeStartValue=0,this._rangeEndValue=document.body.scrollHeight,this._scrollContainerHeight=window.innerHeight;break}(isNaN(this._target_value)||!isFinite(this._target_value))&&(this._target_value=-1)};applyScroll(e,t){if(e)if(e instanceof ra)this.handleTimelineTarget(e,t),e.isPlaying&&e.pause(),e.evaluate();else if(e instanceof ft)e.setFloat("scroll",t);else if(e instanceof Lt)e.time=t*e.duration;else if(e instanceof Mi){if(!e.duration)return;e.time=t*e.duration}else if(e instanceof An)e.position01=t;else if(e instanceof di)e.intensity=t;else if(e instanceof k){e["needle:scrollbounds"]===void 0&&(e["needle:scrollbounds"]=$t(e)||null);const i=e["needle:scrollbounds"];i&&(e.position.y=-i.min.y-t*(i.max.y-i.min.y))}else"scroll"in e&&(typeof e.scroll=="number"?e.scroll=t:typeof e.scroll=="function"&&e.scroll(t))}handleTimelineTarget(e,t){const i=e.duration;Al.length=0;let n=0;for(const l of e.foreachMarker("ScrollMarker")){const c=n++;if(l.element===void 0||l.needsUpdate===!0||l.element&&!l.element?.parentNode){l.needsUpdate=!1;try{if(l.element=M1(c,l.name),Xp&&console.debug(`ScrollMarker #${c} "${l.name}" (${l.time.toFixed(2)}) found`,l.element),l.element)l.timeline=new ViewTimeline({subject:l.element,axis:"block"});else{l.timeline=void 0,(Xp||A())&&console.warn(`No HTML element found for ScrollMarker: ${l.name} (index ${c})`);continue}}catch(h){l.element=null,console.error("ScrollMarker selector is not valid: "+l.name+`
1431
- `,h)}}l.element&&(Al.push(l),l.element.offsetTop,l.element.offsetHeight)}this._scrollValue+this._scrollContainerHeight,po.length=0;let s=0;const r=1/60;let a=0;for(let l=0;l<Al.length;l++){const c=Al[l];if(!c.element)continue;const h=Al[l+1],d=h?h.time-r:i;a+=1;const p=c.timeline;if(p){const m=aI(p),f=1-Math.abs(m-.5)*2,g=c.name||`marker${l}`;if(m>0&&m<=1){const y=c.time+(d-c.time)*m;po.push({name:g,time:y,weight:f}),s+=f}else l===0&&m<=0?(po.push({name:g,time:0,weight:1}),s+=1):l===Al.length-1&&m>=1&&(po.push({name:g,time:i,weight:1}),s+=1)}}if(po.length<=0&&a<=0)e.time=t*i;else if(po.length>0){let l=po[0].time;if(po.length>1)for(const c of po){const h=c.weight/Math.max(1e-5,s),d=Math.abs(c.time-l);l+=d*h}this.damping<=0?e.time=l:e.time=j.lerp(e.time,l,this.context.time.deltaTime/this.damping),Xp&&this.context.time.frame%30===0&&console.log(`[ScrollFollow ] Timeline ${e.name}: ${l.toFixed(3)}`,po.map(c=>`[${c.name} ${(c.weight*100).toFixed(0)}%]`).join(", "))}}}El([u([R,k])],Qo.prototype,"target"),El([u()],Qo.prototype,"damping"),El([u()],Qo.prototype,"invert"),El([u()],Qo.prototype,"htmlSelector"),El([u()],Qo.prototype,"mode"),El([u(he)],Qo.prototype,"changed");const po=[],Al=[],C0=new Map,k1=new Map;let P0=!0;function M1(o,e,t=0){if(!P0){if(e?.length){const n=k1.get(e)||null;if(n)return n}const i=C0.get(o)||null;return i?.getAttribute("data-timeline-marker"),i}return P0=!1,C0.clear(),document.querySelectorAll("[data-timeline-marker]").forEach((i,n)=>{C0.set(n,i);const s=i.getAttribute("data-timeline-marker");s?.length&&k1.set(s,i)}),P0=!1,M1(o,e)}function aI(o){if(!o.source)return 0;const e=o.currentTime,t=o.duration;let i=1;return(t.unit==="seconds"||t.unit==="percent")&&(i=t.value),e.unit==="seconds"?e.value/i:e.value/100}var R1=Object.defineProperty,lI=Object.getOwnPropertyDescriptor,cI=(o,e,t)=>e in o?R1(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,O0=(o,e,t,i)=>{for(var n=i>1?void 0:i?lI(e,t):e,s=o.length-1,r;s>=0;s--)(r=o[s])&&(n=(i?r(e,t,n):r(n))||n);return i&&n&&R1(e,t,n),n},hI=(o,e,t)=>cI(o,e+"",t);const ca=x("debugviewbox"),dI=new oe(.5,.5,.5,.5);let zi=class extends R{referenceFieldOfView=60;debug=!1;onEnable(){(ca||this.debug||A())&&console.debug("[ViewBox] Using camera fov:",this.referenceFieldOfView),zi.instances.push(this)}onDisable(){(ca||this.debug)&&console.debug("[ViewBox] Disabled");const o=zi.instances.indexOf(this);o!==-1&&zi.instances.splice(o,1),this._projectedBoxElement?.remove()}onBeforeRender(){if(this.context.isInXR||this.destroyed)return;if(zi.instances[zi.instances.length-1]!==this){(ca||this.debug)&&F.DrawWireBox(this.gameObject.worldPosition,this.gameObject.worldScale,dI);return}(ca||this.debug)&&F.DrawWireBox(this.gameObject.worldPosition,this.gameObject.worldScale,14540032,0,!0,this.gameObject.worldQuaternion);const o=this.context.mainCamera;if(!o||!(o instanceof re))return;if(this.referenceFieldOfView===void 0||this.referenceFieldOfView<=0){(ca||this.debug)&&console.warn("[ViewBox] No valid referenceFieldOfView set, cannot adjust box size:",this.referenceFieldOfView);return}const e=this.context.domWidth,t=this.context.domHeight;let i=e,n=t,s=1,r=1;const a=this.context.focusRectSize;a&&(a.x,a.y,i=a.width,n=a.height,s=e/i,r=t/n);const l=o.view,c=o.zoom,h=o.aspect,d=o.fov;o.view=null,o.zoom=1,o.fov=this.referenceFieldOfView,o.updateProjectionMatrix();const p=this.gameObject.worldPosition,m=this.gameObject.worldScale,f=o.worldPosition,g=f.distanceTo(p),y=Math.max(m.x,m.y,m.z),_=z(f).sub(p);if(g<y){(this.debug||ca)&&console.warn("[ViewBox] Moving camera out of bounds",g,"<",y);const Z=z(_);Z.y*=1e-8,Z.normalize();const I=(y-g)*10,W=f.add(Z.multiplyScalar(I));o.worldPosition=W.lerp(f,1-this.context.time.deltaTime)}const v=z(p);o.worldToLocal(v),o.lookAt(p),o.updateMatrixWorld();const P=this.referenceFieldOfView*Math.PI/180,M=2*Math.tan(P/2)*g,O=M*o.aspect,E=this.projectBoxIntoCamera(o,1),L=E.maxX-E.minX,$=E.maxY-E.minY,D=this.fit(L*o.aspect,$,O/s,M/r),q=z(p);q.project(o),this.context.focusRectSettings.offsetX=q.x,this.context.focusRectSettings.offsetY=q.y,this.context.focusRectSettings.zoom=D/(M*.5),this.context.focusRect||this.context.setCameraFocusRect(this.context.domElement),o.view=l,o.zoom=c,o.aspect=h,o.fov=d}fit(o,e,t,i){const n=t/o,s=i/e;return Math.min(n,s)}projectBoxIntoCamera(o,e){const t=.5*e,i=[z(-t,-t,-t),z(t,-t,-t),z(-t,t,-t),z(t,t,-t),z(-t,-t,t),z(t,-t,t),z(-t,t,t),z(t,t,t)];let n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let l=0;l<i.length;l++){const c=i[l];c.applyMatrix4(this.gameObject.matrixWorld),c.project(o),c.x<n&&(n=c.x),c.x>s&&(s=c.x),c.y<r&&(r=c.y),c.y>a&&(a=c.y)}return ca&&(this._projectedBoxElement||(this._projectedBoxElement=document.createElement("div")),this._projectedBoxElement.parentElement!==this.context.domElement&&this.context.domElement.appendChild(this._projectedBoxElement),this._projectedBoxElement.style.position="fixed",this._projectedBoxElement.style.outline="2px dashed rgba(255,0,0,.5)",this._projectedBoxElement.style.left=(n*.5+.5)*this.context.domWidth+"px",this._projectedBoxElement.style.top=(-a*.5+.5)*this.context.domHeight+"px",this._projectedBoxElement.style.width=(s-n)*.5*this.context.domWidth+"px",this._projectedBoxElement.style.height=(a-r)*.5*this.context.domHeight+"px",this._projectedBoxElement.style.pointerEvents="none",this._projectedBoxElement.style.zIndex="1000"),{minX:n,maxX:s,minY:r,maxY:a}}_projectedBoxElement=null};hI(zi,"instances",[]),O0([u()],zi.prototype,"referenceFieldOfView",2),O0([u()],zi.prototype,"debug",2),zi=O0([jg],zi);var uI=Object.defineProperty,Il=(o,e,t,i)=>{for(var n=void 0,s=o.length-1,r;s>=0;s--)(r=o[s])&&(n=r(e,t,n)||n);return n&&uI(e,t,n),n};class Yo extends R{get activeAndEnabled(){return!0}side="none";controller=!0;hands=!1;controlVisibility=!0;useGripSpace=!1;resetTransformAfterXRSession=!0;_startPosition=new b;_startRotation=new U;_startScale=new b;onEnterXR(e){this._startPosition.copy(this.gameObject.position),this._startRotation.copy(this.gameObject.quaternion),this._startScale.copy(this.gameObject.scale)}onUpdateXR(e){if(!this.enabled)return;const t=e.xr.getController(this.side);if(t){if(t.hand&&!this.hands){this.controlVisibility&&(this.gameObject.visible=!1);return}else if(!this.controller){this.controlVisibility&&(this.gameObject.visible=!1);return}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))}}onLeaveXR(e){this.resetTransformAfterXRSession&&(this.gameObject.position.copy(this._startPosition),this.gameObject.quaternion.copy(this._startRotation),this.gameObject.scale.copy(this._startScale))}}Il([u()],Yo.prototype,"side"),Il([u()],Yo.prototype,"controller"),Il([u()],Yo.prototype,"hands"),Il([u()],Yo.prototype,"controlVisibility"),Il([u()],Yo.prototype,"useGripSpace"),Il([u()],Yo.prototype,"resetTransformAfterXRSession");function T1(o,e){const t=o.xr.getFrame();if(!t)return console.warn("No XRFrame available"),!1;const i=t.session.enabledFeatures;if(i&&!i.some(s=>s==="camera-access"))return console.error(`No camera feed available - please request the 'camera-access' feature before starting WebXR or add the ARCameraBackground component to your scene.
1431
+ `,h)}}l.element&&(Al.push(l),l.element.offsetTop,l.element.offsetHeight)}this._scrollValue+this._scrollContainerHeight,po.length=0;let s=0;const r=1/60;let a=0;for(let l=0;l<Al.length;l++){const c=Al[l];if(!c.element)continue;const h=Al[l+1],d=h?h.time-r:i;a+=1;const p=c.timeline;if(p){const m=aI(p),f=1-Math.abs(m-.5)*2,g=c.name||`marker${l}`;if(m>0&&m<=1){const y=c.time+(d-c.time)*m;po.push({name:g,time:y,weight:f}),s+=f}else l===0&&m<=0?(po.push({name:g,time:0,weight:1}),s+=1):l===Al.length-1&&m>=1&&(po.push({name:g,time:i,weight:1}),s+=1)}}if(po.length<=0&&a<=0)e.time=t*i;else if(po.length>0){let l=po[0].time;if(po.length>1)for(const c of po){const h=c.weight/Math.max(1e-5,s),d=Math.abs(c.time-l);l+=d*h}this.damping<=0?e.time=l:e.time=j.lerp(e.time,l,this.context.time.deltaTime/this.damping),Xp&&this.context.time.frame%30===0&&console.log(`[ScrollFollow ] Timeline ${e.name}: ${l.toFixed(3)}`,po.map(c=>`[${c.name} ${(c.weight*100).toFixed(0)}%]`).join(", "))}}}El([u([R,k])],Qo.prototype,"target"),El([u()],Qo.prototype,"damping"),El([u()],Qo.prototype,"invert"),El([u()],Qo.prototype,"htmlSelector"),El([u()],Qo.prototype,"mode"),El([u(he)],Qo.prototype,"changed");const po=[],Al=[],C0=new Map,k1=new Map;let P0=!0;function M1(o,e,t=0){if(!P0){if(e?.length){const n=k1.get(e)||null;if(n)return n}const i=C0.get(o)||null;return i?.getAttribute("data-timeline-marker"),i}return P0=!1,C0.clear(),document.querySelectorAll("[data-timeline-marker]").forEach((i,n)=>{C0.set(n,i);const s=i.getAttribute("data-timeline-marker");s?.length&&k1.set(s,i)}),P0=!1,M1(o,e)}function aI(o){if(!o.source)return 0;const e=o.currentTime,t=o.duration;let i=1;return(t.unit==="seconds"||t.unit==="percent")&&(i=t.value),e.unit==="seconds"?e.value/i:e.value/100}var R1=Object.defineProperty,lI=Object.getOwnPropertyDescriptor,cI=(o,e,t)=>e in o?R1(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,O0=(o,e,t,i)=>{for(var n=i>1?void 0:i?lI(e,t):e,s=o.length-1,r;s>=0;s--)(r=o[s])&&(n=(i?r(e,t,n):r(n))||n);return i&&n&&R1(e,t,n),n},hI=(o,e,t)=>cI(o,e+"",t);const ca=x("debugviewbox"),dI=new oe(.5,.5,.5,.5);let zi=class extends R{referenceFieldOfView=void 0;debug=!1;onEnable(){(ca||this.debug||A())&&console.debug("[ViewBox] Using camera fov:",this.referenceFieldOfView),zi.instances.push(this)}onDisable(){(ca||this.debug)&&console.debug("[ViewBox] Disabled");const o=zi.instances.indexOf(this);o!==-1&&zi.instances.splice(o,1),this._projectedBoxElement?.remove()}onBeforeRender(){if(this.context.isInXR||this.destroyed)return;if(zi.instances[zi.instances.length-1]!==this){(ca||this.debug)&&F.DrawWireBox(this.gameObject.worldPosition,this.gameObject.worldScale,dI);return}(ca||this.debug)&&F.DrawWireBox(this.gameObject.worldPosition,this.gameObject.worldScale,14540032,0,!0,this.gameObject.worldQuaternion);const o=this.context.mainCamera;if(!o||!(o instanceof re))return;if(this.referenceFieldOfView===void 0&&(this.referenceFieldOfView=o.fov),this.referenceFieldOfView===void 0||this.referenceFieldOfView<=0){(ca||this.debug)&&console.warn("[ViewBox] No valid referenceFieldOfView set, cannot adjust box size:",this.referenceFieldOfView);return}const e=this.context.domWidth,t=this.context.domHeight;let i=e,n=t,s=1,r=1;const a=this.context.focusRectSize;a&&(a.x,a.y,i=a.width,n=a.height,s=e/i,r=t/n);const l=o.view,c=o.zoom,h=o.aspect,d=o.fov;o.view=null,o.zoom=1,o.fov=this.referenceFieldOfView,o.updateProjectionMatrix();const p=this.gameObject.worldPosition,m=this.gameObject.worldScale,f=o.worldPosition,g=f.distanceTo(p),y=Math.max(m.x,m.y,m.z),_=z(f).sub(p);if(g<y){(this.debug||ca)&&console.warn("[ViewBox] Moving camera out of bounds",g,"<",y);const Z=z(_);Z.y*=1e-8,Z.normalize();const I=(y-g)*10,W=f.add(Z.multiplyScalar(I));o.worldPosition=W.lerp(f,1-this.context.time.deltaTime)}const v=z(p);o.worldToLocal(v),o.lookAt(p),o.updateMatrixWorld();const P=this.referenceFieldOfView*Math.PI/180,M=2*Math.tan(P/2)*g,O=M*o.aspect,E=this.projectBoxIntoCamera(o,1),L=E.maxX-E.minX,$=E.maxY-E.minY,D=this.fit(L*o.aspect,$,O/s,M/r),q=z(p);q.project(o),this.context.focusRectSettings.offsetX=q.x,this.context.focusRectSettings.offsetY=q.y,this.context.focusRectSettings.zoom=D/(M*.5),this.context.focusRect||this.context.setCameraFocusRect(this.context.domElement),o.view=l,o.zoom=c,o.aspect=h,o.fov=d}fit(o,e,t,i){const n=t/o,s=i/e;return Math.min(n,s)}projectBoxIntoCamera(o,e){const t=.5*e,i=[z(-t,-t,-t),z(t,-t,-t),z(-t,t,-t),z(t,t,-t),z(-t,-t,t),z(t,-t,t),z(-t,t,t),z(t,t,t)];let n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let l=0;l<i.length;l++){const c=i[l];c.applyMatrix4(this.gameObject.matrixWorld),c.project(o),c.x<n&&(n=c.x),c.x>s&&(s=c.x),c.y<r&&(r=c.y),c.y>a&&(a=c.y)}return ca&&(this._projectedBoxElement||(this._projectedBoxElement=document.createElement("div")),this._projectedBoxElement.parentElement!==this.context.domElement&&this.context.domElement.appendChild(this._projectedBoxElement),this._projectedBoxElement.style.position="fixed",this._projectedBoxElement.style.outline="2px dashed rgba(255,0,0,.5)",this._projectedBoxElement.style.left=(n*.5+.5)*this.context.domWidth+"px",this._projectedBoxElement.style.top=(-a*.5+.5)*this.context.domHeight+"px",this._projectedBoxElement.style.width=(s-n)*.5*this.context.domWidth+"px",this._projectedBoxElement.style.height=(a-r)*.5*this.context.domHeight+"px",this._projectedBoxElement.style.pointerEvents="none",this._projectedBoxElement.style.zIndex="1000"),{minX:n,maxX:s,minY:r,maxY:a}}_projectedBoxElement=null};hI(zi,"instances",[]),O0([u()],zi.prototype,"referenceFieldOfView",2),O0([u()],zi.prototype,"debug",2),zi=O0([jg],zi);var uI=Object.defineProperty,Il=(o,e,t,i)=>{for(var n=void 0,s=o.length-1,r;s>=0;s--)(r=o[s])&&(n=r(e,t,n)||n);return n&&uI(e,t,n),n};class Yo extends R{get activeAndEnabled(){return!0}side="none";controller=!0;hands=!1;controlVisibility=!0;useGripSpace=!1;resetTransformAfterXRSession=!0;_startPosition=new b;_startRotation=new U;_startScale=new b;onEnterXR(e){this._startPosition.copy(this.gameObject.position),this._startRotation.copy(this.gameObject.quaternion),this._startScale.copy(this.gameObject.scale)}onUpdateXR(e){if(!this.enabled)return;const t=e.xr.getController(this.side);if(t){if(t.hand&&!this.hands){this.controlVisibility&&(this.gameObject.visible=!1);return}else if(!this.controller){this.controlVisibility&&(this.gameObject.visible=!1);return}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))}}onLeaveXR(e){this.resetTransformAfterXRSession&&(this.gameObject.position.copy(this._startPosition),this.gameObject.quaternion.copy(this._startRotation),this.gameObject.scale.copy(this._startScale))}}Il([u()],Yo.prototype,"side"),Il([u()],Yo.prototype,"controller"),Il([u()],Yo.prototype,"hands"),Il([u()],Yo.prototype,"controlVisibility"),Il([u()],Yo.prototype,"useGripSpace"),Il([u()],Yo.prototype,"resetTransformAfterXRSession");function T1(o,e){const t=o.xr.getFrame();if(!t)return console.warn("No XRFrame available"),!1;const i=t.session.enabledFeatures;if(i&&!i.some(s=>s==="camera-access"))return console.error(`No camera feed available - please request the 'camera-access' feature before starting WebXR or add the ARCameraBackground component to your scene.
1432
1432
 
1433
1433
  Example to request camera-access in global scope:
1434
1434
  NeedleXRSession.onSessionRequestStart(evt => {
@@ -1649,4 +1649,4 @@ Error:`,r),null}}updateColliderCollisionGroups(e){const t=e[Vt],i=e.membership;l
1649
1649
  justify-content: center;
1650
1650
  gap: .5rem;
1651
1651
  }
1652
- `),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.#o),pu(ef,{element:this.#t}),this.#s?.disconnect(),this.#s??=new MutationObserver(()=>this.#l()),this.#s.observe(this.#e,{attributes:!0}),F0&&console.log("Needle Button updated")}#l(){this.#e&&(this.#e.style.display==="none"?this.style.display="none":this.style.display==="none"&&(this.style.display=""))}#r=e=>{F0&&console.log("Needle Button clicked"),!e.defaultPrevented&&this.#e&&this.#e.click()}}typeof window<"u"&&!window.customElements.get(Q1)&&window.customElements.define(Q1,Y1);const Zh=x("debugavatar");class z0{root;head;leftHand;rigthHand;get isValid(){return this.head!==null&&this.head!==void 0}constructor(e,t,i,n){this.root=e,this.head=t,this.leftHand=i,this.rigthHand=n,this.root?.traverse(s=>s.layers.set(2))}}class Z1{avatarRegistryUrl=null;async getOrCreateNewAvatarInstance(e,t){if(!t)return console.error("Can not create avatar: failed to provide id or root object"),null;let i=null;if(typeof t=="string"){if(i=await this.loadAvatar(e,t),!i){const s=new jn;i=w.instantiate(Pa(t,e.scene),s)}}else i=t;if(!i)return null;const n=this.findAvatar(i);return n.isValid?(Zh&&console.log("[Custom Avatar] valid config",t,Zh?n:""),n):(console.warn("[Custom Avatar] config isn't valid",t,Zh?n:""),null)}async loadAvatar(e,t){if(console.assert(t!=null&&typeof t=="string","Avatar id must not be null"),t.length<=0||!t)return null;if(Zh&&console.log("[Custom Avatar] "+t+", loading..."),t.endsWith(".glb")||(t+=".glb"),this.avatarRegistryUrl===null){const n=await fetch("./"+t);let s=null;if(n.ok){const r=await n.blob();r&&(s=await r.arrayBuffer())}return s?(await bn().parseSync(e,s,null,0))?.scene??null:null}const i=new xo;return cf(i,e),new Promise((n,s)=>{const r=this.avatarRegistryUrl+"/"+t;i.load(r,async a=>{await bn().createBuiltinComponents(e,r,a,null,void 0),n(a.scene)},a=>{Zh&&console.log("[Custom Avatar] "+a.loaded/a.total*100+"% loaded of "+a.total/1024+"kB")},a=>{console.error("[Custom Avatar] Error when loading: "+a),n(null)})})}cacheModel(e,t){}findAvatar(e){const t=e;let i=t;i.children.length==1&&(i=e.children[0]);let n=this.findAvatarPart(i,["head"]);const s=this.findAvatarPart(i,["left","hand"]),r=this.findAvatarPart(i,["right","hand"]);if(!n){n=t;const a=new b;new bi().setFromObject(n).getSize(a);const l=Math.max(a.x,a.y,a.z);console.warn("[Custom Avatar] Normalizing head scale, it's too big: "+l+" meters! Should be < 0.3m"),l>.3&&n.scale.multiplyScalar(1/l*.3)}return new z0(t,n,s,r)}findAvatarPart(e,t){const i=e.name.toLowerCase();let n=!0;for(const s of t){if(!n)break;i.indexOf(s)===-1&&(n=!1)}if(n)return e;if(e.children)for(const s of e.children){const r=this.findAvatarPart(s,t);if(r)return r}return null}handleCustomAvatarErrors(e){if(!e.ok)throw Error(e.statusText);return e}}class K1{get extensionName(){return"DocumentExtension"}onAfterBuildDocument(e){}}class J1{}const KI=Object.freeze(Object.defineProperty({__proto__:null,ActionBuilder:me,ActionCollection:Lw,ActionModel:fi,AlignmentConstraint:Mc,Animation:Lt,AnimationCurve:hh,AnimationExtension:ep,AnimationTrackHandler:Ah,Animator:ft,AnimatorController:hn,Antialiasing:gh,Attractor:Sl,AudioExtension:pa,AudioListener:Eo,AudioSource:Mi,AudioTrackHandler:ss,Avatar:Ls,AvatarBlink_Simple:jr,AvatarEyeLook_Rotation:Cf,AvatarLoader:Z1,AvatarMarker:Le,AvatarModel:z0,Avatar_Brain_LookAt:jc,Avatar_MouthShapes:Dc,Avatar_MustacheShake:wf,Avatar_POI:Lr,AxesHelper:Ya,BaseUIComponent:ln,BasicIKConstraint:Of,BehaviorExtension:wy,BehaviorModel:Et,BloomEffect:Cp,BoxCollider:Lu,BoxGizmo:qr,BoxHelperComponent:wt,Button:Xo,CallInfo:To,Camera:si,CameraTargetReachedEvent:Lc,Canvas:yl,CanvasGroup:zs,CapsuleCollider:Ao,ChangeMaterialOnClick:cy,ChangeTransformOnClick:Wr,CharacterController:Dr,CharacterControllerInput:Lo,ChromaticAberration:fh,ClickThrough:qp,Collider:ai,ColorAdjustments:Gs,ColorBySpeedModule:xl,ColorOverLifetimeModule:yp,ContactShadows:Fc,ControlTrackHandler:Up,CursorFollow:Bh,CustomBranding:Gr,Deletable:Ef,DeleteBox:or,DepthOfField:Tn,DeviceFlag:ju,DocumentExtension:K1,DragControls:zr,DropListener:jo,Duplicatable:Bf,EffectWrapper:bh,EmissionModule:$o,EmphasizeOnClick:cl,EnvironmentScene:Hp,EventList:he,EventListEvent:Pu,EventSystem:ei,EventTrigger:zu,FieldWithDefault:uw,FixedJoint:Uy,Fog:bl,GltfExport:Zf,GltfExportBox:Qf,Gradient:Qr,Graphic:nh,GraphicRaycaster:Mu,GridHelper:_l,GridLayoutGroup:Ey,GroundProjectedEnv:qn,GroupActionModel:Vr,HideOnStart:dn,HingeJoint:rh,HorizontalLayoutGroup:Ty,get HoverAnimation(){return uo},Image:Ml,InheritVelocityModule:qy,InputField:x0,InstanceHandle:ba,InstancingHandler:ma,Interactable:Tf,Keyframe:ui,LODGroup:lh,LODModel:vl,Light:di,LimitVelocityOverLifetimeModule:lt,LogStats:Rf,LookAt:w0,LookAtConstraint:Er,MainModule:Ft,MarkerTrackHandler:zp,MaskableGraphic:oh,MeshCollider:Ms,MeshRenderer:Wc,MinMaxCurve:Q,MinMaxGradient:Yr,NeedleMenu:io,NestedGltf:ch,Networking:$y,NoiseModule:_e,ObjectRaycaster:ki,OffsetConstraint:Xr,OpenURL:Rl,OrbitControls:fe,Outline:gl,Padding:Hr,ParticleBurst:fp,ParticleSubEmitter:Xy,ParticleSystem:ph,ParticleSystemRenderer:sn,PhysicsExtension:Sy,PixelationEffect:_h,PlayAnimationOnClick:qc,PlayAudioOnClick:As,PlayableDirector:ra,PlayerColor:Nl,PointerEventData:rd,PostProcessingHandler:d0,PreliminaryAction:hl,PreliminaryTrigger:Xc,RawImage:Wp,Rect:Nw,RectTransform:Mn,ReflectionProbe:Vc,RegisteredAnimationInfo:sr,RemoteSkybox:Ep,Renderer:Ti,RendererLightmap:$u,get ResponsiveBox(){return zi},Rigidbody:Ze,RotationBySpeedModule:on,RotationOverLifetimeModule:Rn,SceneSwitcher:Xe,ScreenCapture:Xs,ScreenSpaceAmbientOcclusion:Ho,ScreenSpaceAmbientOcclusionN8:En,ScrollFollow:Qo,SetActiveOnClick:hy,ShadowCatcher:Ph,ShapeModule:Gy,SharpeningEffect:xh,SignalAsset:Fp,SignalReceiver:Eh,SignalReceiverEvent:Th,SignalTrackHandler:Ih,Size:Uw,SizeBySpeedModule:pi,SizeOverLifetimeModule:Zr,SkinnedMeshRenderer:Xf,SmoothFollow:Ip,SpatialGrabRaycaster:ua,SpatialHtml:jh,SpatialTrigger:Lp,SpatialTriggerReceiver:ao,SpectatorCamera:jp,SphereCollider:Za,SplineContainer:oa,SplineData:lo,SplineWalker:An,Sprite:zo,SpriteData:ul,SpriteRenderer:ci,SpriteSheet:dl,SubEmitterSystem:xp,SyncedCamera:p0,SyncedRoom:In,SyncedTransform:Cn,TapGestureTrigger:uy,TeleportTarget:sp,TestRunner:f0,TestSimulateUserData:y0,Text:Bt,TextBuilder:My,TextExtension:hp,TextureSheetAnimationModule:zt,TiltShiftEffect:ro,ToneMappingEffect:Hs,TrailModule:Fe,TransformData:Ne,TransformGizmo:aa,TriggerBuilder:Dt,TriggerModel:er,UIRaycastUtils:mf,UIRootComponent:eh,USDZExporter:oo,USDZText:fl,USDZUIExtension:Ly,UsageMarker:zc,VariantAction:ay,VelocityOverLifetimeModule:Ve,VerticalLayoutGroup:Ry,VideoPlayer:ht,Vignette:ta,VisibilityAction:Qc,Voip:ks,Volume:Pl,VolumeParameter:B,VolumeProfile:wp,WebARCameraBackground:Uh,WebARSessionRoot:Ui,WebXR:rp,WebXRImageTracking:Nh,WebXRImageTrackingModel:Zo,WebXRPlaneTracking:Ko,WebXRTrackedImage:Vl,XRControllerFollow:Yo,XRControllerModel:Uo,XRControllerMovement:Ei,XRFlag:Ji,XRRig:Zp,XRState:Jt,__Ignore:J1},Symbol.toStringTag,{value:"Module"})),Kh=x("debugmissingcamera");ue.registerCallback(de.MissingCamera,o=>{Kh&&console.warn("Creating missing camera");const e=o.context.scene,t=new re;t.name="Default Fallback Camera",e.add(t);const i=new si;if(i.sourceId=o.files?.[0]?.src??"unknown",i.fieldOfView=35,o.context.domElement.getAttribute("transparent")!=null)i.clearFlags=Ir.Uninitialized;else if(o.context.domElement.getAttribute("background-image")?.length||o.context.lightmaps.tryGetSkybox(i.sourceId))i.clearFlags=Ir.Skybox;else{if(i.clearFlags=Ir.SolidColor,!o.context.domElement.getAttribute("background-color")){let s="#efefef";typeof window!==void 0&&window.matchMedia("(prefers-color-scheme: dark)").matches&&(s="#1f1f1f"),e.background=new ne(s)}if(!e.environment){const s=new kC(o.context.renderer),r=new Hp("neutral");e.environment=s.fromScene(r,.025).texture}}const n=Sr(t,i,!0);return t.position.x=0,t.position.y=1,t.position.z=2,o.context.domElement?.cameraControls!=!1&&eS(o.context,n),n}),ue.registerCallback(de.ContextCreated,o=>{if(!o.context.mainCamera){Kh&&console.log("Will not auto-fit because a default camera exists");return}if(o.context.domElement?.cameraControls==!0){if(Nb(o.context.mainCamera)?.isCameraController==!0){Kh&&console.log("Will not auto-fit because a camera controller exists");return}eS(o.context)}});function eS(o,e){e=e??o.mainCameraComponent;const t=e?.gameObject;if(Kh&&console.log("Creating default camera controls",e?.name),t){const i=yc(t,fe);i.sourceId=e?.sourceId??"unknown";const n=o.domElement.getAttribute("auto-rotate");i.autoRotate=n!="0"&&n?.toLowerCase()!="false";const s=Number.parseFloat(n||".5");i.autoRotateSpeed=isNaN(s)?.5:s,Kh&&console.log("Auto-rotate",i.autoRotate,"speed:",i.autoRotateSpeed);const r=o.domElement.getAttribute("auto-fit");i.autoFit=r!=="0"&&r?.toLowerCase()!="false",i.autoTarget=!0}else console.warn("Missing camera object, can not add orbit controls")}ue.registerCallback(de.ContextCreated,o=>{const e=o.context.domElement.getAttribute("autoplay");if(e!==void 0&&(e===""||e==="true"||e==="1")&&o.files)for(const t of o.files)w.foreachComponent(t.file.scene,i=>{if(i.enabled!==!1){if(i instanceof Lt&&i.playAutomatically||i instanceof ft||i instanceof ra&&i.playOnAwake===!0)return!0;if(i instanceof Lt)return i.playAutomatically=!0,!0;if(i instanceof ra)return i.playOnAwake=!0,!0}},!0)!==!0&&bs.autoplayAnimations(t.file)});var U0;(o=>{function e(t,i=!1,n=.75){const s=new oa,r=1-j.clamp(n,0,1);return t.forEach((a,l)=>{const c=new b;l<t.length-1?c.subVectors(t[l+1],a).normalize().multiplyScalar(r):i&&t.length>1&&c.subVectors(t[0],a).normalize().multiplyScalar(r);const h=new lo;h.position.copy(a),h.tangentIn.copy(c),h.tangentOut.copy(c),s.addKnot(h)}),s.closed=i,s}o.createFromPoints=e})(U0||(U0={}));class JI extends rP{constructor(){super(new Worker(URL.createObjectURL(new Blob([`import '${new URL("./generateMeshBVH.worker-2qGLkQjg.js",import.meta.url).toString()}';`],{type:"text/javascript"})),{type:"module"})),this.name="GenerateMeshBVHWorker"}runTask(e,t,i={}){return new Promise((n,s)=>{if(t.getAttribute("position").isInterleavedBufferAttribute||t.index&&t.index.isInterleavedBufferAttribute)throw new Error("GenerateMeshBVHWorker: InterleavedBufferAttribute are not supported for the geometry attributes.");e.onerror=c=>{s(new Error(`[GenerateMeshBVHWorker] ${c.message||"Unknown error. Please check the server console. If you're using vite try adding 'three-mesh-bvh' to 'optimizeDeps.exclude' in your vite.config.js"}`))},e.onmessage=c=>{const{data:h}=c;if(h.error)s(new Error(h.error)),e.onmessage=null;else if(h.serialized){const{serialized:d,position:p}=h,m=aP.deserialize(d,t,{setIndex:!1}),f=Object.assign({setBoundingBox:!0},i);if(t.attributes.position.array=p,d.index)if(t.index)t.index.array=d.index;else{const g=new pt(d.index,1,!1);t.setIndex(g)}f.setBoundingBox&&(t.boundingBox=m.getBoundingBox(new bi)),i.onProgress&&i.onProgress(h.progress),n(m),e.onmessage=null}else i.onProgress&&i.onProgress(h.progress)};const r=t.index?t.index.array:null,a=t.attributes.position.array,l=[a];r&&l.push(r),e.postMessage({index:r,position:a,options:{...i,onProgress:null,includedProgressCallback:!!i.onProgress,groups:[...t.groups]}},l.map(c=>c.buffer).filter(c=>typeof SharedArrayBuffer>"u"||!(c instanceof SharedArrayBuffer)))})}}const eL=Object.freeze(Object.defineProperty({__proto__:null,GenerateMeshBVHWorker:JI},Symbol.toStringTag,{value:"Module"}));export{TR as $physicsKey,me as ActionBuilder,Lw as ActionCollection,fi as ActionModel,zv as Addressables,Mc as AlignmentConstraint,Ha as AmbientMode,Lt as Animation,hh as AnimationCurve,ep as AnimationExtension,Ah as AnimationTrackHandler,bs as AnimationUtils,ft as Animator,Ss as AnimatorConditionMode,hn as AnimatorController,df as AnimatorControllerParameterType,Rc as AnimatorStateInfo,gh as Antialiasing,Ln as Application,H_ as AssetDatabase,ie as AssetReference,Sl as Attractor,pa as AudioExtension,Eo as AudioListener,Mi as AudioSource,ss as AudioTrackHandler,Ls as Avatar,jr as AvatarBlink_Simple,Cf as AvatarEyeLook_Rotation,Z1 as AvatarLoader,Le as AvatarMarker,z0 as AvatarModel,jc as Avatar_Brain_LookAt,Dc as Avatar_MouthShapes,wf as Avatar_MustacheShake,Lr as Avatar_POI,Ga as Axes,Ya as AxesHelper,tg as BUILD_TIME,ln as BaseUIComponent,Of as BasicIKConstraint,wy as BehaviorExtension,Et as BehaviorModel,Mr as BlobStorage,Cp as BloomEffect,Lu as BoxCollider,qr as BoxGizmo,wt as BoxHelperComponent,Xo as Button,Dn as ButtonsFactory,zx as CallDirection,To as CallInfo,si as Camera,Lc as CameraTargetReachedEvent,yl as Canvas,zs as CanvasGroup,Ao as CapsuleCollider,cy as ChangeMaterialOnClick,Wr as ChangeTransformOnClick,Dr as CharacterController,Lo as CharacterControllerInput,fh as ChromaticAberration,xi as CircularBuffer,Ir as ClearFlags,qp as ClickThrough,co as ClipExtrapolation,ai as Collider,Dx as Collision,Su as CollisionDetectionMode,Gs as ColorAdjustments,xl as ColorBySpeedModule,yp as ColorOverLifetimeModule,FM as Component,R as Component$1,qd as ComponentLifecycleEvents,KI as Components,T_ as ConnectionEvents,jx as ContactPoint,Fc as ContactShadows,N as Context,SM as ContextArgs,de as ContextEvent,ue as ContextRegistry,Up as ControlTrackHandler,Bh as CursorFollow,Gr as CustomBranding,Me as CustomShader,du as DefaultReflectionMode,Ef as Deletable,or as DeleteBox,Tn as DepthOfField,ju as DeviceFlag,G as DeviceUtilities,K1 as DocumentExtension,zr as DragControls,If as DragMode,jo as DropListener,Bf as Duplicatable,bh as EffectWrapper,$o as EmissionModule,cl as EmphasizeOnClick,ld as EngineLoadingView,Hp as EnvironmentScene,he as EventList,Pu as EventListEvent,ei as EventSystem,zu as EventTrigger,uw as FieldWithDefault,ya as FileReference,Nv as FileReferenceSerializer,JR as FileSpawnModel,qx as File_Event,Uy as FixedJoint,bl as Fog,xe as FrameEvent,Ad as GENERATOR,w as GameObject,F as Gizmos,Zf as GltfExport,Qf as GltfExportBox,Qr as Gradient,nh as Graphic,Mu as GraphicRaycaster,ir as Graphics,_l as GridHelper,Ey as GridLayoutGroup,qn as GroundProjectedEnv,Vr as GroupActionModel,Eu as HideFlags,dn as HideOnStart,rh as HingeJoint,Ty as HorizontalLayoutGroup,Ck as HostData,uo as HoverAnimation,Ml as Image,fa as ImageReference,Uv as ImageReferenceSerializer,qy as InheritVelocityModule,y_ as Input,ii as InputEventQueue,Ee as InputEvents,x0 as InputField,ba as InstanceHandle,ma as InstancingHandler,cn as InstancingUtil,rv as InstantiateEvent,At as InstantiateIdProvider,jn as InstantiateOptions,Tf as Interactable,zh as InternalScreenshotUtils,XO as JoinedRoomResponse,BO as KeyEventArgs,ui as Keyframe,lh as LODGroup,vl as LODModel,QO as LeftRoomResponse,di as Light,Qv as LightData,lt as LimitVelocityOverLifetimeModule,BI as LoadingElementOptions,Rf as LogStats,wi as LogType,w0 as LookAt,Er as LookAtConstraint,T as MODULES,Ft as MainModule,zp as MarkerTrackHandler,b0 as MarkerType,oh as MaskableGraphic,j as Mathf,Ms as MeshCollider,Wc as MeshRenderer,Q as MinMaxCurve,Yr as MinMaxGradient,pc as NEEDLE_ENGINE_FEATURE_FLAGS,sc as NEKeyboardEvent,Co as NEPointerEvent,Y1 as NeedleButtonElement,jf as NeedleEngineModelLoader,L0 as NeedleEngineWebComponent,io as NeedleMenu,Ld as NeedlePatchesKey,rg as NeedleXRController,Y as NeedleXRSession,I_ as NeedleXRSync,z_ as NeedleXRUtils,ch as NestedGltf,A_ as NetworkConnection,Qn as NetworkedStreamEvents,ad as NetworkedStreams,$y as Networking,lv as NewInstanceModel,_e as NoiseModule,ki as ObjectRaycaster,_r as ObjectUtils,Xr as OffsetConstraint,Pd as OneEuroFilter,Nm as OneEuroFilterXYZ,Rl as OpenURL,fe as OrbitControls,gl as Outline,E_ as OwnershipEvent,ug as OwnershipModel,Ma as PUBLIC_KEY,Hr as Padding,fp as ParticleBurst,Xy as ParticleSubEmitter,ph as ParticleSystem,$s as ParticleSystemBaseBehaviour,sn as ParticleSystemRenderer,gp as ParticleSystemShapeType,os as PeerHandle,M_ as PeerNetworking,zl as Physics,Sy as PhysicsExtension,yt as PhysicsMaterialCombine,_h as PixelationEffect,qc as PlayAnimationOnClick,As as PlayAudioOnClick,ra as PlayableDirector,Nl as PlayerColor,On as PlayerState,Fw as PlayerStateEvent,by as PlayerSync,$v as PlayerView,Hv as PlayerViewManager,rd as PointerEventData,Dd as PointerType,tt as PostProcessingEffect,ct as PostProcessingEffectOrder,d0 as PostProcessingHandler,hl as PreliminaryAction,Xc as PreliminaryTrigger,Ts as PreviewHelper,br as PrimitiveType,ae as Progress,Dm as PromiseAllWithErrors,jm as PromiseErrorResult,oe as RGBAColor,Wl as RapierPhysics,Wp as RawImage,fs as RaycastOptions,Nw as Rect,Mn as RectTransform,Vc as ReflectionProbe,sr as RegisteredAnimationInfo,Ep as RemoteSkybox,fo as RenderTexture,Rx as RenderTextureSerializer,Ti as Renderer,Xv as RendererData,$u as RendererLightmap,zi as ResponsiveBox,Ze as Rigidbody,qe as RigidbodyConstraints,te as RoomEvents,on as RotationBySpeedModule,Rn as RotationOverLifetimeModule,Nu as SceneLightSettings,Xe as SceneSwitcher,Xs as ScreenCapture,Ho as ScreenSpaceAmbientOcclusion,En as ScreenSpaceAmbientOcclusionN8,Qo as ScrollFollow,_n as SendQueue,Ug as SerializationContext,hy as SetActiveOnClick,Ph as ShadowCatcher,Gy as ShapeModule,Bx as ShapeOverlapResult,xh as SharpeningEffect,Fp as SignalAsset,Eh as SignalReceiver,Th as SignalReceiverEvent,Ih as SignalTrackHandler,Uw as Size,pi as SizeBySpeedModule,Zr as SizeOverLifetimeModule,Xf as SkinnedMeshRenderer,Ip as SmoothFollow,ua as SpatialGrabRaycaster,jh as SpatialHtml,Lp as SpatialTrigger,ao as SpatialTriggerReceiver,jp as SpectatorCamera,Za as SphereCollider,wg as SphereIntersection,oa as SplineContainer,lo as SplineData,U0 as SplineUtils,An as SplineWalker,zo as Sprite,ul as SpriteData,ci as SpriteRenderer,dl as SpriteSheet,$M as StateMachineBehaviour,vf as StreamEndedEvent,Fx as StreamReceivedEvent,xp as SubEmitterSystem,p0 as SyncedCamera,In as SyncedRoom,Cn as SyncedTransform,uy as TapGestureTrigger,sp as TeleportTarget,f0 as TestRunner,GI as TestSceneUtils,y0 as TestSimulateUserData,Bt as Text,My as TextBuilder,hp as TextExtension,zt as TextureSheetAnimationModule,ro as TiltShiftEffect,Zv as Time,Hs as ToneMappingEffect,kl as TrackHandler,Bi as TrackType,Fe as TrailModule,Ne as TransformData,aa as TransformGizmo,Dt as TriggerBuilder,er as TriggerModel,C as TypeStore,mf as UIRaycastUtils,eh as UIRootComponent,Kf as USDDocument,it as USDObject,bw as USDWriter,oo as USDZExporter,_w as USDZExporter$1,fl as USDZText,Ly as USDZUIExtension,Tx as UriSerializer,zc as UsageMarker,YO as UserJoinedOrLeftRoomModel,yn as VERSION,ay as VariantAction,Ve as VelocityOverLifetimeModule,Ry as VerticalLayoutGroup,ht as VideoPlayer,_s as ViewDevice,ta as Vignette,Qc as VisibilityAction,ks as Voip,Pl as Volume,B as VolumeParameter,wp as VolumeProfile,iM as WaitForFrames,Vv as WaitForPromise,Xg as WaitForSeconds,is as Watch,Uh as WebARCameraBackground,Ui as WebARSessionRoot,rp as WebXR,tr as WebXRButtonFactory,Nh as WebXRImageTracking,Zo as WebXRImageTrackingModel,Ko as WebXRPlaneTracking,Vl as WebXRTrackedImage,Yo as XRControllerFollow,Uo as XRControllerModel,Ei as XRControllerMovement,Ji as XRFlag,Zp as XRRig,Jt as XRState,Zn as XRStateFlag,J1 as __Ignore,pk as __internalNotifyObjectDestroyed,So as activeInHierarchyFieldName,Im as addAttributeChangeCallback,wn as addComponent,xT as addCustomExtensionPlugin,Sr as addNewComponent,Id as addPatch,iu as apply,BM as applyHMRChanges,Cv as applyPrototypeExtensions,av as beginListenDestroy,hv as beginListenInstantiate,cg as binaryIdentifierCasts,wM as build_scene_functions,fr as builtinComponentKeyName,I0 as calculateProgress01,GP as clearMessages,aR as colorSerializer,mv as compareAssociation,Ou as componentSerializer,Jb as copyTexture,wx as createMotion,ni as debugNet,rc as debugOwner,Cw as decompressGpuTexture,Ql as deepClone,Un as delay,Yl as delayForFrames,eu as deserializeObject,Ci as destroy,Mv as destroyComponentInstance,Xx as determineMimeTypeFromExtension,Pe as disposeObjectResources,Yn as disposeStream,oc as editorGuidKeyName,pr as enableSpatialConsole,cR as euler,pR as eventListSerializer,QI as exportAsGLTF,$g as findByGuid,Ua as findObjectOfType,Ev as findObjectsOfType,Sg as findResourceUsers,Px as fitCamera,t_ as fitObjectIntoVolume,kr as foreachComponent,au as foreachComponentEnumerator,hO as forward,Ib as generateQRCode,cv as generateSeed,$t as getBoundingBox,Nb as getCameraController,Cr as getComponent,_c as getComponentInChildren,vc as getComponentInParent,bc as getComponents,za as getComponentsInChildren,tu as getComponentsInParent,mw as getFormattedDate,Ct as getIconElement,Jg as getIconTexture,bn as getLoader,yc as getOrAddComponent,x as getParam,pO as getParentHierarchyPath,SP as getPath,$O as getPeerOptions,O_ as getPeerjsInstance,gk as getResourceUserCount,$b as getTempColor,ti as getTempQuaternion,z as getTempVector,ql as getUrlParams,e_ as getVisibleInCustomShadowRendering,Xb as getWorldDirection,Xm as getWorldEuler,K as getWorldPosition,be as getWorldQuaternion,Rd as getWorldRotation,He as getWorldScale,vs as hasCommercialLicense,Pc as hasIndieLicense,Cu as hasPointerEventComponent,Gn as hasProLicense,r_ as hideDebugConsole,Pw as imageToCanvas,Wa as instantiate,ow as invokeLoadedImportPluginHooks,f_ as invokeXRSessionEnd,g_ as invokeXRSessionStart,Av as isActiveInHierarchy,Na as isActiveSelf,RP as isAndroidDevice,Kb as isAnimationAction,Lx as isComponent,_P as isDebugMode,PP as isDesktop,Or as isDestroyed,A as isDevEnvironment,uk as isDisposed,qI as isExporting,Ix as isGLTFModel,wb as isHostedOnGlitch,hf as isHotReloadEnabled,jM as isHotReloading,kP as isIPad,tx as isIconElement,$i as isLocalNetwork,EP as isMacOS,OP as isMobileDevice,TP as isMozillaXR,LP as isQuest,q_ as isResourceTrackingEnabled,IP as isSafari,ou as isUsingInstancing,AP as isiOS,MP as isiPad,EI as loadAsset,f1 as loadPMREM,A0 as loadSync,Td as logHierarchy,iO as lookAtInverse,Kl as lookAtObject,nO as lookAtScreenPoint,xP as makeId,Rb as makeIdFromRandomWords,en as makeNameSafe,Iv as markAsInstancedRendered,jP as microphonePermissionsGranted,bP as nameof,Pb as nameofFactory,Mx as objectSerializer,DO as offXRSessionEnd,jO as offXRSessionStart,IM as onAfterRender,AM as onBeforeRender,TM as onClear,EM as onDestroy,cx as onInitialized,bu as onStart,hx as onUpdate,sg as onXRSessionEnd,jd as onXRSessionStart,z1 as parseSync,i_ as placeOnSurface,Zm as postprocessFBXMaterials,tR as prefix,Ob as pushState,wP as randomNumber,hg as registerBinaryType,gu as registerComponent,$f as registerComponentExtension,rn as registerCustomEffectType,Hf as registerExportExtensions,Wu as registerExtensions,fx as registerHotReloadType,ig as registerLoader,uv as registerPrefabProvider,Pv as registerPrototypeExtensions,jg as registerType,Eb as relativePathPrefix,Lm as removeAttributeChangeCallback,Wg as removeComponent,wT as removeCustomImportExtensionType,IO as removePatch,us as resolveUrl,Tb as sanitizeString,A1 as saveImage,mI as screenshot,k0 as screenshot2,Ag as sendDestroyed,u as serializable,bv as serializeObject,Ye as serializeable,xc as setActive,Db as setAllowBalloonMessages,VP as setAllowOverlayMessages,kd as setAutoFitEnabled,Vm as setCameraController,jv as setDestroyed,xO as setDevEnvironment,Q_ as setDisposable,Va as setDontDestroy,Tm as setOrAddParamsToUrl,vP as setParam,Xl as setParamWithoutReload,HO as setPeerOptions,dk as setResourceTrackingEnabled,Em as setState,Ym as setVisibleInCustomShadowRendering,Qm as setWorldEuler,mt as setWorldPosition,dr as setWorldPositionXYZ,fn as setWorldQuaternion,qm as setWorldQuaternionXYZW,Zb as setWorldRotation,Jl as setWorldRotationXYZ,ka as setWorldScale,ic as showBalloonError,Te as showBalloonMessage,ge as showBalloonWarning,eg as showDebugConsole,tO as slerp,gc as syncDestroy,yy as syncField,Ig as syncInstantiate,mO as textureToCanvas,Ab as toSourceId,C_ as tryCastBinary,Yx as tryDetermineMimetypeFromBinary,Qx as tryDetermineMimetypeFromURL,Pa as tryFindObject,P_ as tryGetGuid,yx as unregisterHotReloadType,Am as unwatchWrite,Vb as useForAutoFit,Pt as validate,Sd as watchWrite};
1652
+ `),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.#o),pu(ef,{element:this.#t}),this.#s?.disconnect(),this.#s??=new MutationObserver(()=>this.#l()),this.#s.observe(this.#e,{attributes:!0}),F0&&console.log("Needle Button updated")}#l(){this.#e&&(this.#e.style.display==="none"?this.style.display="none":this.style.display==="none"&&(this.style.display=""))}#r=e=>{F0&&console.log("Needle Button clicked"),!e.defaultPrevented&&this.#e&&this.#e.click()}}typeof window<"u"&&!window.customElements.get(Q1)&&window.customElements.define(Q1,Y1);const Zh=x("debugavatar");class z0{root;head;leftHand;rigthHand;get isValid(){return this.head!==null&&this.head!==void 0}constructor(e,t,i,n){this.root=e,this.head=t,this.leftHand=i,this.rigthHand=n,this.root?.traverse(s=>s.layers.set(2))}}class Z1{avatarRegistryUrl=null;async getOrCreateNewAvatarInstance(e,t){if(!t)return console.error("Can not create avatar: failed to provide id or root object"),null;let i=null;if(typeof t=="string"){if(i=await this.loadAvatar(e,t),!i){const s=new jn;i=w.instantiate(Pa(t,e.scene),s)}}else i=t;if(!i)return null;const n=this.findAvatar(i);return n.isValid?(Zh&&console.log("[Custom Avatar] valid config",t,Zh?n:""),n):(console.warn("[Custom Avatar] config isn't valid",t,Zh?n:""),null)}async loadAvatar(e,t){if(console.assert(t!=null&&typeof t=="string","Avatar id must not be null"),t.length<=0||!t)return null;if(Zh&&console.log("[Custom Avatar] "+t+", loading..."),t.endsWith(".glb")||(t+=".glb"),this.avatarRegistryUrl===null){const n=await fetch("./"+t);let s=null;if(n.ok){const r=await n.blob();r&&(s=await r.arrayBuffer())}return s?(await bn().parseSync(e,s,null,0))?.scene??null:null}const i=new xo;return cf(i,e),new Promise((n,s)=>{const r=this.avatarRegistryUrl+"/"+t;i.load(r,async a=>{await bn().createBuiltinComponents(e,r,a,null,void 0),n(a.scene)},a=>{Zh&&console.log("[Custom Avatar] "+a.loaded/a.total*100+"% loaded of "+a.total/1024+"kB")},a=>{console.error("[Custom Avatar] Error when loading: "+a),n(null)})})}cacheModel(e,t){}findAvatar(e){const t=e;let i=t;i.children.length==1&&(i=e.children[0]);let n=this.findAvatarPart(i,["head"]);const s=this.findAvatarPart(i,["left","hand"]),r=this.findAvatarPart(i,["right","hand"]);if(!n){n=t;const a=new b;new bi().setFromObject(n).getSize(a);const l=Math.max(a.x,a.y,a.z);console.warn("[Custom Avatar] Normalizing head scale, it's too big: "+l+" meters! Should be < 0.3m"),l>.3&&n.scale.multiplyScalar(1/l*.3)}return new z0(t,n,s,r)}findAvatarPart(e,t){const i=e.name.toLowerCase();let n=!0;for(const s of t){if(!n)break;i.indexOf(s)===-1&&(n=!1)}if(n)return e;if(e.children)for(const s of e.children){const r=this.findAvatarPart(s,t);if(r)return r}return null}handleCustomAvatarErrors(e){if(!e.ok)throw Error(e.statusText);return e}}class K1{get extensionName(){return"DocumentExtension"}onAfterBuildDocument(e){}}class J1{}const KI=Object.freeze(Object.defineProperty({__proto__:null,ActionBuilder:me,ActionCollection:Lw,ActionModel:fi,AlignmentConstraint:Mc,Animation:Lt,AnimationCurve:hh,AnimationExtension:ep,AnimationTrackHandler:Ah,Animator:ft,AnimatorController:hn,Antialiasing:gh,Attractor:Sl,AudioExtension:pa,AudioListener:Eo,AudioSource:Mi,AudioTrackHandler:ss,Avatar:Ls,AvatarBlink_Simple:jr,AvatarEyeLook_Rotation:Cf,AvatarLoader:Z1,AvatarMarker:Le,AvatarModel:z0,Avatar_Brain_LookAt:jc,Avatar_MouthShapes:Dc,Avatar_MustacheShake:wf,Avatar_POI:Lr,AxesHelper:Ya,BaseUIComponent:ln,BasicIKConstraint:Of,BehaviorExtension:wy,BehaviorModel:Et,BloomEffect:Cp,BoxCollider:Lu,BoxGizmo:qr,BoxHelperComponent:wt,Button:Xo,CallInfo:To,Camera:si,CameraTargetReachedEvent:Lc,Canvas:yl,CanvasGroup:zs,CapsuleCollider:Ao,ChangeMaterialOnClick:cy,ChangeTransformOnClick:Wr,CharacterController:Dr,CharacterControllerInput:Lo,ChromaticAberration:fh,ClickThrough:qp,Collider:ai,ColorAdjustments:Gs,ColorBySpeedModule:xl,ColorOverLifetimeModule:yp,ContactShadows:Fc,ControlTrackHandler:Up,CursorFollow:Bh,CustomBranding:Gr,Deletable:Ef,DeleteBox:or,DepthOfField:Tn,DeviceFlag:ju,DocumentExtension:K1,DragControls:zr,DropListener:jo,Duplicatable:Bf,EffectWrapper:bh,EmissionModule:$o,EmphasizeOnClick:cl,EnvironmentScene:Hp,EventList:he,EventListEvent:Pu,EventSystem:ei,EventTrigger:zu,FieldWithDefault:uw,FixedJoint:Uy,Fog:bl,GltfExport:Zf,GltfExportBox:Qf,Gradient:Qr,Graphic:nh,GraphicRaycaster:Mu,GridHelper:_l,GridLayoutGroup:Ey,GroundProjectedEnv:qn,GroupActionModel:Vr,HideOnStart:dn,HingeJoint:rh,HorizontalLayoutGroup:Ty,get HoverAnimation(){return uo},Image:Ml,InheritVelocityModule:qy,InputField:x0,InstanceHandle:ba,InstancingHandler:ma,Interactable:Tf,Keyframe:ui,LODGroup:lh,LODModel:vl,Light:di,LimitVelocityOverLifetimeModule:lt,LogStats:Rf,LookAt:w0,LookAtConstraint:Er,MainModule:Ft,MarkerTrackHandler:zp,MaskableGraphic:oh,MeshCollider:Ms,MeshRenderer:Wc,MinMaxCurve:Q,MinMaxGradient:Yr,NeedleMenu:io,NestedGltf:ch,Networking:$y,NoiseModule:_e,ObjectRaycaster:ki,OffsetConstraint:Xr,OpenURL:Rl,OrbitControls:fe,Outline:gl,Padding:Hr,ParticleBurst:fp,ParticleSubEmitter:Xy,ParticleSystem:ph,ParticleSystemRenderer:sn,PhysicsExtension:Sy,PixelationEffect:_h,PlayAnimationOnClick:qc,PlayAudioOnClick:As,PlayableDirector:ra,PlayerColor:Nl,PointerEventData:rd,PostProcessingHandler:d0,PreliminaryAction:hl,PreliminaryTrigger:Xc,RawImage:Wp,Rect:Nw,RectTransform:Mn,ReflectionProbe:Vc,RegisteredAnimationInfo:sr,RemoteSkybox:Ep,Renderer:Ti,RendererLightmap:$u,get ResponsiveBox(){return zi},Rigidbody:Ze,RotationBySpeedModule:on,RotationOverLifetimeModule:Rn,SceneSwitcher:Xe,ScreenCapture:Xs,ScreenSpaceAmbientOcclusion:Ho,ScreenSpaceAmbientOcclusionN8:En,ScrollFollow:Qo,SetActiveOnClick:hy,ShadowCatcher:Ph,ShapeModule:Gy,SharpeningEffect:xh,SignalAsset:Fp,SignalReceiver:Eh,SignalReceiverEvent:Th,SignalTrackHandler:Ih,Size:Uw,SizeBySpeedModule:pi,SizeOverLifetimeModule:Zr,SkinnedMeshRenderer:Xf,SmoothFollow:Ip,SpatialGrabRaycaster:ua,SpatialHtml:jh,SpatialTrigger:Lp,SpatialTriggerReceiver:ao,SpectatorCamera:jp,SphereCollider:Za,SplineContainer:oa,SplineData:lo,SplineWalker:An,Sprite:zo,SpriteData:ul,SpriteRenderer:ci,SpriteSheet:dl,SubEmitterSystem:xp,SyncedCamera:p0,SyncedRoom:In,SyncedTransform:Cn,TapGestureTrigger:uy,TeleportTarget:sp,TestRunner:f0,TestSimulateUserData:y0,Text:Bt,TextBuilder:My,TextExtension:hp,TextureSheetAnimationModule:zt,TiltShiftEffect:ro,ToneMappingEffect:Hs,TrailModule:Fe,TransformData:Ne,TransformGizmo:aa,TriggerBuilder:Dt,TriggerModel:er,UIRaycastUtils:mf,UIRootComponent:eh,USDZExporter:oo,USDZText:fl,USDZUIExtension:Ly,UsageMarker:zc,VariantAction:ay,VelocityOverLifetimeModule:Ve,VerticalLayoutGroup:Ry,VideoPlayer:ht,Vignette:ta,VisibilityAction:Qc,Voip:ks,Volume:Pl,VolumeParameter:B,VolumeProfile:wp,WebARCameraBackground:Uh,WebARSessionRoot:Ui,WebXR:rp,WebXRImageTracking:Nh,WebXRImageTrackingModel:Zo,WebXRPlaneTracking:Ko,WebXRTrackedImage:Vl,XRControllerFollow:Yo,XRControllerModel:Uo,XRControllerMovement:Ei,XRFlag:Ji,XRRig:Zp,XRState:Jt,__Ignore:J1},Symbol.toStringTag,{value:"Module"})),Kh=x("debugmissingcamera");ue.registerCallback(de.MissingCamera,o=>{Kh&&console.warn("Creating missing camera");const e=o.context.scene,t=new re;t.name="Default Fallback Camera",e.add(t);const i=new si;if(i.sourceId=o.files?.[0]?.src??"unknown",i.fieldOfView=35,o.context.domElement.getAttribute("transparent")!=null)i.clearFlags=Ir.Uninitialized;else if(o.context.domElement.getAttribute("background-image")?.length||o.context.lightmaps.tryGetSkybox(i.sourceId))i.clearFlags=Ir.Skybox;else{if(i.clearFlags=Ir.SolidColor,!o.context.domElement.getAttribute("background-color")){let s="#efefef";typeof window!==void 0&&window.matchMedia("(prefers-color-scheme: dark)").matches&&(s="#1f1f1f"),e.background=new ne(s)}if(!e.environment){const s=new kC(o.context.renderer),r=new Hp("neutral");e.environment=s.fromScene(r,.025).texture}}const n=Sr(t,i,!0);return t.position.x=0,t.position.y=1,t.position.z=2,o.context.domElement?.cameraControls!=!1&&eS(o.context,n),n}),ue.registerCallback(de.ContextCreated,o=>{if(!o.context.mainCamera){Kh&&console.log("Will not auto-fit because a default camera exists");return}if(o.context.domElement?.cameraControls==!0){if(Nb(o.context.mainCamera)?.isCameraController==!0){Kh&&console.log("Will not auto-fit because a camera controller exists");return}eS(o.context)}});function eS(o,e){e=e??o.mainCameraComponent;const t=e?.gameObject;if(Kh&&console.log("Creating default camera controls",e?.name),t){const i=yc(t,fe);i.sourceId=e?.sourceId??"unknown";const n=o.domElement.getAttribute("auto-rotate");i.autoRotate=n!="0"&&n?.toLowerCase()!="false";const s=Number.parseFloat(n||".5");i.autoRotateSpeed=isNaN(s)?.5:s,Kh&&console.log("Auto-rotate",i.autoRotate,"speed:",i.autoRotateSpeed);const r=o.domElement.getAttribute("auto-fit");i.autoFit=r!=="0"&&r?.toLowerCase()!="false",i.autoTarget=!0}else console.warn("Missing camera object, can not add orbit controls")}ue.registerCallback(de.ContextCreated,o=>{const e=o.context.domElement.getAttribute("autoplay");if(e!==void 0&&(e===""||e==="true"||e==="1")&&o.files)for(const t of o.files)w.foreachComponent(t.file.scene,i=>{if(i.enabled!==!1){if(i instanceof Lt&&i.playAutomatically||i instanceof ft||i instanceof ra&&i.playOnAwake===!0)return!0;if(i instanceof Lt)return i.playAutomatically=!0,!0;if(i instanceof ra)return i.playOnAwake=!0,!0}},!0)!==!0&&bs.autoplayAnimations(t.file)});var U0;(o=>{function e(t,i=!1,n=.75){const s=new oa,r=1-j.clamp(n,0,1);return t.forEach((a,l)=>{const c=new b;l<t.length-1?c.subVectors(t[l+1],a).normalize().multiplyScalar(r):i&&t.length>1&&c.subVectors(t[0],a).normalize().multiplyScalar(r);const h=new lo;h.position.copy(a),h.tangentIn.copy(c),h.tangentOut.copy(c),s.addKnot(h)}),s.closed=i,s}o.createFromPoints=e})(U0||(U0={}));class JI extends rP{constructor(){super(new Worker(URL.createObjectURL(new Blob([`import '${new URL("./generateMeshBVH.worker-2qGLkQjg.js",import.meta.url).toString()}';`],{type:"text/javascript"})),{type:"module"})),this.name="GenerateMeshBVHWorker"}runTask(e,t,i={}){return new Promise((n,s)=>{if(t.getAttribute("position").isInterleavedBufferAttribute||t.index&&t.index.isInterleavedBufferAttribute)throw new Error("GenerateMeshBVHWorker: InterleavedBufferAttribute are not supported for the geometry attributes.");e.onerror=c=>{s(new Error(`[GenerateMeshBVHWorker] ${c.message||"Unknown error. Please check the server console. If you're using vite try adding 'three-mesh-bvh' to 'optimizeDeps.exclude' in your vite.config.js"}`))},e.onmessage=c=>{const{data:h}=c;if(h.error)s(new Error(h.error)),e.onmessage=null;else if(h.serialized){const{serialized:d,position:p}=h,m=aP.deserialize(d,t,{setIndex:!1}),f=Object.assign({setBoundingBox:!0},i);if(t.attributes.position.array=p,d.index)if(t.index)t.index.array=d.index;else{const g=new pt(d.index,1,!1);t.setIndex(g)}f.setBoundingBox&&(t.boundingBox=m.getBoundingBox(new bi)),i.onProgress&&i.onProgress(h.progress),n(m),e.onmessage=null}else i.onProgress&&i.onProgress(h.progress)};const r=t.index?t.index.array:null,a=t.attributes.position.array,l=[a];r&&l.push(r),e.postMessage({index:r,position:a,options:{...i,onProgress:null,includedProgressCallback:!!i.onProgress,groups:[...t.groups]}},l.map(c=>c.buffer).filter(c=>typeof SharedArrayBuffer>"u"||!(c instanceof SharedArrayBuffer)))})}}const eL=Object.freeze(Object.defineProperty({__proto__:null,GenerateMeshBVHWorker:JI},Symbol.toStringTag,{value:"Module"}));export{TR as $physicsKey,me as ActionBuilder,Lw as ActionCollection,fi as ActionModel,zv as Addressables,Mc as AlignmentConstraint,Ha as AmbientMode,Lt as Animation,hh as AnimationCurve,ep as AnimationExtension,Ah as AnimationTrackHandler,bs as AnimationUtils,ft as Animator,Ss as AnimatorConditionMode,hn as AnimatorController,df as AnimatorControllerParameterType,Rc as AnimatorStateInfo,gh as Antialiasing,Ln as Application,H_ as AssetDatabase,ie as AssetReference,Sl as Attractor,pa as AudioExtension,Eo as AudioListener,Mi as AudioSource,ss as AudioTrackHandler,Ls as Avatar,jr as AvatarBlink_Simple,Cf as AvatarEyeLook_Rotation,Z1 as AvatarLoader,Le as AvatarMarker,z0 as AvatarModel,jc as Avatar_Brain_LookAt,Dc as Avatar_MouthShapes,wf as Avatar_MustacheShake,Lr as Avatar_POI,Ga as Axes,Ya as AxesHelper,tg as BUILD_TIME,ln as BaseUIComponent,Of as BasicIKConstraint,wy as BehaviorExtension,Et as BehaviorModel,Mr as BlobStorage,Cp as BloomEffect,Lu as BoxCollider,qr as BoxGizmo,wt as BoxHelperComponent,Xo as Button,Dn as ButtonsFactory,zx as CallDirection,To as CallInfo,si as Camera,Lc as CameraTargetReachedEvent,yl as Canvas,zs as CanvasGroup,Ao as CapsuleCollider,cy as ChangeMaterialOnClick,Wr as ChangeTransformOnClick,Dr as CharacterController,Lo as CharacterControllerInput,fh as ChromaticAberration,xi as CircularBuffer,Ir as ClearFlags,qp as ClickThrough,co as ClipExtrapolation,ai as Collider,Dx as Collision,Su as CollisionDetectionMode,Gs as ColorAdjustments,xl as ColorBySpeedModule,yp as ColorOverLifetimeModule,FM as Component,R as Component$1,qd as ComponentLifecycleEvents,KI as Components,T_ as ConnectionEvents,jx as ContactPoint,Fc as ContactShadows,N as Context,SM as ContextArgs,de as ContextEvent,ue as ContextRegistry,Up as ControlTrackHandler,Bh as CursorFollow,Gr as CustomBranding,Me as CustomShader,du as DefaultReflectionMode,Ef as Deletable,or as DeleteBox,Tn as DepthOfField,ju as DeviceFlag,G as DeviceUtilities,K1 as DocumentExtension,zr as DragControls,If as DragMode,jo as DropListener,Bf as Duplicatable,bh as EffectWrapper,$o as EmissionModule,cl as EmphasizeOnClick,ld as EngineLoadingView,Hp as EnvironmentScene,he as EventList,Pu as EventListEvent,ei as EventSystem,zu as EventTrigger,uw as FieldWithDefault,ya as FileReference,Nv as FileReferenceSerializer,JR as FileSpawnModel,qx as File_Event,Uy as FixedJoint,bl as Fog,xe as FrameEvent,Ad as GENERATOR,w as GameObject,F as Gizmos,Zf as GltfExport,Qf as GltfExportBox,Qr as Gradient,nh as Graphic,Mu as GraphicRaycaster,ir as Graphics,_l as GridHelper,Ey as GridLayoutGroup,qn as GroundProjectedEnv,Vr as GroupActionModel,Eu as HideFlags,dn as HideOnStart,rh as HingeJoint,Ty as HorizontalLayoutGroup,Ck as HostData,uo as HoverAnimation,Ml as Image,fa as ImageReference,Uv as ImageReferenceSerializer,qy as InheritVelocityModule,y_ as Input,ii as InputEventQueue,Ee as InputEvents,x0 as InputField,ba as InstanceHandle,ma as InstancingHandler,cn as InstancingUtil,rv as InstantiateEvent,At as InstantiateIdProvider,jn as InstantiateOptions,Tf as Interactable,zh as InternalScreenshotUtils,XO as JoinedRoomResponse,BO as KeyEventArgs,ui as Keyframe,lh as LODGroup,vl as LODModel,QO as LeftRoomResponse,di as Light,Qv as LightData,lt as LimitVelocityOverLifetimeModule,BI as LoadingElementOptions,Rf as LogStats,wi as LogType,w0 as LookAt,Er as LookAtConstraint,T as MODULES,Ft as MainModule,zp as MarkerTrackHandler,b0 as MarkerType,oh as MaskableGraphic,j as Mathf,Ms as MeshCollider,Wc as MeshRenderer,Q as MinMaxCurve,Yr as MinMaxGradient,pc as NEEDLE_ENGINE_FEATURE_FLAGS,sc as NEKeyboardEvent,Co as NEPointerEvent,Y1 as NeedleButtonElement,jf as NeedleEngineModelLoader,L0 as NeedleEngineWebComponent,io as NeedleMenu,Ld as NeedlePatchesKey,rg as NeedleXRController,Y as NeedleXRSession,I_ as NeedleXRSync,z_ as NeedleXRUtils,ch as NestedGltf,A_ as NetworkConnection,Qn as NetworkedStreamEvents,ad as NetworkedStreams,$y as Networking,lv as NewInstanceModel,_e as NoiseModule,ki as ObjectRaycaster,_r as ObjectUtils,Xr as OffsetConstraint,Pd as OneEuroFilter,Nm as OneEuroFilterXYZ,Rl as OpenURL,fe as OrbitControls,gl as Outline,E_ as OwnershipEvent,ug as OwnershipModel,Ma as PUBLIC_KEY,Hr as Padding,fp as ParticleBurst,Xy as ParticleSubEmitter,ph as ParticleSystem,$s as ParticleSystemBaseBehaviour,sn as ParticleSystemRenderer,gp as ParticleSystemShapeType,os as PeerHandle,M_ as PeerNetworking,zl as Physics,Sy as PhysicsExtension,yt as PhysicsMaterialCombine,_h as PixelationEffect,qc as PlayAnimationOnClick,As as PlayAudioOnClick,ra as PlayableDirector,Nl as PlayerColor,On as PlayerState,Fw as PlayerStateEvent,by as PlayerSync,$v as PlayerView,Hv as PlayerViewManager,rd as PointerEventData,Dd as PointerType,tt as PostProcessingEffect,ct as PostProcessingEffectOrder,d0 as PostProcessingHandler,hl as PreliminaryAction,Xc as PreliminaryTrigger,Ts as PreviewHelper,br as PrimitiveType,ae as Progress,Dm as PromiseAllWithErrors,jm as PromiseErrorResult,oe as RGBAColor,Wl as RapierPhysics,Wp as RawImage,fs as RaycastOptions,Nw as Rect,Mn as RectTransform,Vc as ReflectionProbe,sr as RegisteredAnimationInfo,Ep as RemoteSkybox,fo as RenderTexture,Rx as RenderTextureSerializer,Ti as Renderer,Xv as RendererData,$u as RendererLightmap,Ze as Rigidbody,qe as RigidbodyConstraints,te as RoomEvents,on as RotationBySpeedModule,Rn as RotationOverLifetimeModule,Nu as SceneLightSettings,Xe as SceneSwitcher,Xs as ScreenCapture,Ho as ScreenSpaceAmbientOcclusion,En as ScreenSpaceAmbientOcclusionN8,Qo as ScrollFollow,_n as SendQueue,Ug as SerializationContext,hy as SetActiveOnClick,Ph as ShadowCatcher,Gy as ShapeModule,Bx as ShapeOverlapResult,xh as SharpeningEffect,Fp as SignalAsset,Eh as SignalReceiver,Th as SignalReceiverEvent,Ih as SignalTrackHandler,Uw as Size,pi as SizeBySpeedModule,Zr as SizeOverLifetimeModule,Xf as SkinnedMeshRenderer,Ip as SmoothFollow,ua as SpatialGrabRaycaster,jh as SpatialHtml,Lp as SpatialTrigger,ao as SpatialTriggerReceiver,jp as SpectatorCamera,Za as SphereCollider,wg as SphereIntersection,oa as SplineContainer,lo as SplineData,U0 as SplineUtils,An as SplineWalker,zo as Sprite,ul as SpriteData,ci as SpriteRenderer,dl as SpriteSheet,$M as StateMachineBehaviour,vf as StreamEndedEvent,Fx as StreamReceivedEvent,xp as SubEmitterSystem,p0 as SyncedCamera,In as SyncedRoom,Cn as SyncedTransform,uy as TapGestureTrigger,sp as TeleportTarget,f0 as TestRunner,GI as TestSceneUtils,y0 as TestSimulateUserData,Bt as Text,My as TextBuilder,hp as TextExtension,zt as TextureSheetAnimationModule,ro as TiltShiftEffect,Zv as Time,Hs as ToneMappingEffect,kl as TrackHandler,Bi as TrackType,Fe as TrailModule,Ne as TransformData,aa as TransformGizmo,Dt as TriggerBuilder,er as TriggerModel,C as TypeStore,mf as UIRaycastUtils,eh as UIRootComponent,Kf as USDDocument,it as USDObject,bw as USDWriter,oo as USDZExporter,_w as USDZExporter$1,fl as USDZText,Ly as USDZUIExtension,Tx as UriSerializer,zc as UsageMarker,YO as UserJoinedOrLeftRoomModel,yn as VERSION,ay as VariantAction,Ve as VelocityOverLifetimeModule,Ry as VerticalLayoutGroup,ht as VideoPlayer,zi as ViewBox,_s as ViewDevice,ta as Vignette,Qc as VisibilityAction,ks as Voip,Pl as Volume,B as VolumeParameter,wp as VolumeProfile,iM as WaitForFrames,Vv as WaitForPromise,Xg as WaitForSeconds,is as Watch,Uh as WebARCameraBackground,Ui as WebARSessionRoot,rp as WebXR,tr as WebXRButtonFactory,Nh as WebXRImageTracking,Zo as WebXRImageTrackingModel,Ko as WebXRPlaneTracking,Vl as WebXRTrackedImage,Yo as XRControllerFollow,Uo as XRControllerModel,Ei as XRControllerMovement,Ji as XRFlag,Zp as XRRig,Jt as XRState,Zn as XRStateFlag,J1 as __Ignore,pk as __internalNotifyObjectDestroyed,So as activeInHierarchyFieldName,Im as addAttributeChangeCallback,wn as addComponent,xT as addCustomExtensionPlugin,Sr as addNewComponent,Id as addPatch,iu as apply,BM as applyHMRChanges,Cv as applyPrototypeExtensions,av as beginListenDestroy,hv as beginListenInstantiate,cg as binaryIdentifierCasts,wM as build_scene_functions,fr as builtinComponentKeyName,I0 as calculateProgress01,GP as clearMessages,aR as colorSerializer,mv as compareAssociation,Ou as componentSerializer,Jb as copyTexture,wx as createMotion,ni as debugNet,rc as debugOwner,Cw as decompressGpuTexture,Ql as deepClone,Un as delay,Yl as delayForFrames,eu as deserializeObject,Ci as destroy,Mv as destroyComponentInstance,Xx as determineMimeTypeFromExtension,Pe as disposeObjectResources,Yn as disposeStream,oc as editorGuidKeyName,pr as enableSpatialConsole,cR as euler,pR as eventListSerializer,QI as exportAsGLTF,$g as findByGuid,Ua as findObjectOfType,Ev as findObjectsOfType,Sg as findResourceUsers,Px as fitCamera,t_ as fitObjectIntoVolume,kr as foreachComponent,au as foreachComponentEnumerator,hO as forward,Ib as generateQRCode,cv as generateSeed,$t as getBoundingBox,Nb as getCameraController,Cr as getComponent,_c as getComponentInChildren,vc as getComponentInParent,bc as getComponents,za as getComponentsInChildren,tu as getComponentsInParent,mw as getFormattedDate,Ct as getIconElement,Jg as getIconTexture,bn as getLoader,yc as getOrAddComponent,x as getParam,pO as getParentHierarchyPath,SP as getPath,$O as getPeerOptions,O_ as getPeerjsInstance,gk as getResourceUserCount,$b as getTempColor,ti as getTempQuaternion,z as getTempVector,ql as getUrlParams,e_ as getVisibleInCustomShadowRendering,Xb as getWorldDirection,Xm as getWorldEuler,K as getWorldPosition,be as getWorldQuaternion,Rd as getWorldRotation,He as getWorldScale,vs as hasCommercialLicense,Pc as hasIndieLicense,Cu as hasPointerEventComponent,Gn as hasProLicense,r_ as hideDebugConsole,Pw as imageToCanvas,Wa as instantiate,ow as invokeLoadedImportPluginHooks,f_ as invokeXRSessionEnd,g_ as invokeXRSessionStart,Av as isActiveInHierarchy,Na as isActiveSelf,RP as isAndroidDevice,Kb as isAnimationAction,Lx as isComponent,_P as isDebugMode,PP as isDesktop,Or as isDestroyed,A as isDevEnvironment,uk as isDisposed,qI as isExporting,Ix as isGLTFModel,wb as isHostedOnGlitch,hf as isHotReloadEnabled,jM as isHotReloading,kP as isIPad,tx as isIconElement,$i as isLocalNetwork,EP as isMacOS,OP as isMobileDevice,TP as isMozillaXR,LP as isQuest,q_ as isResourceTrackingEnabled,IP as isSafari,ou as isUsingInstancing,AP as isiOS,MP as isiPad,EI as loadAsset,f1 as loadPMREM,A0 as loadSync,Td as logHierarchy,iO as lookAtInverse,Kl as lookAtObject,nO as lookAtScreenPoint,xP as makeId,Rb as makeIdFromRandomWords,en as makeNameSafe,Iv as markAsInstancedRendered,jP as microphonePermissionsGranted,bP as nameof,Pb as nameofFactory,Mx as objectSerializer,DO as offXRSessionEnd,jO as offXRSessionStart,IM as onAfterRender,AM as onBeforeRender,TM as onClear,EM as onDestroy,cx as onInitialized,bu as onStart,hx as onUpdate,sg as onXRSessionEnd,jd as onXRSessionStart,z1 as parseSync,i_ as placeOnSurface,Zm as postprocessFBXMaterials,tR as prefix,Ob as pushState,wP as randomNumber,hg as registerBinaryType,gu as registerComponent,$f as registerComponentExtension,rn as registerCustomEffectType,Hf as registerExportExtensions,Wu as registerExtensions,fx as registerHotReloadType,ig as registerLoader,uv as registerPrefabProvider,Pv as registerPrototypeExtensions,jg as registerType,Eb as relativePathPrefix,Lm as removeAttributeChangeCallback,Wg as removeComponent,wT as removeCustomImportExtensionType,IO as removePatch,us as resolveUrl,Tb as sanitizeString,A1 as saveImage,mI as screenshot,k0 as screenshot2,Ag as sendDestroyed,u as serializable,bv as serializeObject,Ye as serializeable,xc as setActive,Db as setAllowBalloonMessages,VP as setAllowOverlayMessages,kd as setAutoFitEnabled,Vm as setCameraController,jv as setDestroyed,xO as setDevEnvironment,Q_ as setDisposable,Va as setDontDestroy,Tm as setOrAddParamsToUrl,vP as setParam,Xl as setParamWithoutReload,HO as setPeerOptions,dk as setResourceTrackingEnabled,Em as setState,Ym as setVisibleInCustomShadowRendering,Qm as setWorldEuler,mt as setWorldPosition,dr as setWorldPositionXYZ,fn as setWorldQuaternion,qm as setWorldQuaternionXYZW,Zb as setWorldRotation,Jl as setWorldRotationXYZ,ka as setWorldScale,ic as showBalloonError,Te as showBalloonMessage,ge as showBalloonWarning,eg as showDebugConsole,tO as slerp,gc as syncDestroy,yy as syncField,Ig as syncInstantiate,mO as textureToCanvas,Ab as toSourceId,C_ as tryCastBinary,Yx as tryDetermineMimetypeFromBinary,Qx as tryDetermineMimetypeFromURL,Pa as tryFindObject,P_ as tryGetGuid,yx as unregisterHotReloadType,Am as unwatchWrite,Vb as useForAutoFit,Pt as validate,Sd as watchWrite};
@@ -1775,11 +1775,11 @@ bo('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"]
1775
1775
  bo('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";');
1776
1776
  bo('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";');
1777
1777
  bo('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";');
1778
- bo('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.10.0-beta.4";');
1778
+ bo('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.10.0-beta.5";');
1779
1779
  bo('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
1780
- bo('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Sep 25 2025 08:56:41 GMT+0000 (Coordinated Universal Time)";');
1780
+ bo('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Sep 25 2025 09:17:47 GMT+0000 (Coordinated Universal Time)";');
1781
1781
  bo('globalThis["__NEEDLE_PUBLIC_KEY__"] = "' + NEEDLE_PUBLIC_KEY + '";');
1782
- const jn = "4.10.0-beta.4", Gm = "undefined", x0 = "Thu Sep 25 2025 08:56:41 GMT+0000 (Coordinated Universal Time)";
1782
+ const jn = "4.10.0-beta.5", Gm = "undefined", x0 = "Thu Sep 25 2025 09:17:47 GMT+0000 (Coordinated Universal Time)";
1783
1783
  w0 && console.log(`Engine version: ${jn} (generator: ${Gm})
1784
1784
  Project built at ${x0}`);
1785
1785
  const Dl = NEEDLE_PUBLIC_KEY, uo = "needle_isActiveInHierarchy", Qr = "builtin_components", qh = "needle_editor_guid";
@@ -39317,15 +39317,8 @@ var lx = Object.defineProperty, ZA = Object.getOwnPropertyDescriptor, JA = (s, e
39317
39317
  }, eI = (s, e, t) => JA(s, e + "", t);
39318
39318
  const Go = w("debugviewbox"), tI = new oe(0.5, 0.5, 0.5, 0.5);
39319
39319
  let $i = class extends R {
39320
- referenceFieldOfView = 60;
39320
+ referenceFieldOfView = void 0;
39321
39321
  debug = !1;
39322
- // awake() {
39323
- // // this.referenceFieldOfView = (this.context.mainCamera as PerspectiveCamera)?.fov || 60;
39324
- // setInterval(()=>{
39325
- // if(Math.random() > .5)
39326
- // this.enabled = !this.enabled
39327
- // }, 1000)
39328
- // }
39329
39322
  onEnable() {
39330
39323
  (Go || this.debug || L()) && console.debug("[ViewBox] Using camera fov:", this.referenceFieldOfView), $i.instances.push(this);
39331
39324
  }
@@ -39344,7 +39337,7 @@ let $i = class extends R {
39344
39337
  const e = this.context.mainCamera;
39345
39338
  if (!e || !(e instanceof le))
39346
39339
  return;
39347
- if (this.referenceFieldOfView === void 0 || this.referenceFieldOfView <= 0) {
39340
+ if (this.referenceFieldOfView === void 0 && (this.referenceFieldOfView = e.fov), this.referenceFieldOfView === void 0 || this.referenceFieldOfView <= 0) {
39348
39341
  (Go || this.debug) && console.warn("[ViewBox] No valid referenceFieldOfView set, cannot adjust box size:", this.referenceFieldOfView);
39349
39342
  return;
39350
39343
  }
@@ -43471,7 +43464,6 @@ export {
43471
43464
  Ki as Renderer,
43472
43465
  zO as RendererData,
43473
43466
  rm as RendererLightmap,
43474
- $i as ResponsiveBox,
43475
43467
  rt as Rigidbody,
43476
43468
  qe as RigidbodyConstraints,
43477
43469
  te as RoomEvents,
@@ -43558,6 +43550,7 @@ export {
43558
43550
  He as VelocityOverLifetimeModule,
43559
43551
  vw as VerticalLayoutGroup,
43560
43552
  mt as VideoPlayer,
43553
+ $i as ViewBox,
43561
43554
  rr as ViewDevice,
43562
43555
  ol as Vignette,
43563
43556
  Tu as VisibilityAction,