@needle-tools/engine 3.34.0-alpha.1 → 3.34.0-alpha.2

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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,15 @@ All notable changes to this package will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [3.34.0-alpha.2] - 2023-03-07
8
+ - Fix: Partially revert alias plugin changes to fix issues with md5 package
9
+ - Fix: Check if asap exists before referencing it
10
+
11
+ ## [3.34.0-alpha.1] - 2023-03-07
12
+ - Add: Show warning if a custom object is missing @serializable decorator
13
+ - Fix: Remove leftover console logs
14
+ - Fix: asap was not included in bundle + version
15
+
7
16
  ## [3.34.0-alpha] - 2023-03-07
8
17
  - Add: Vite plugin for showing indicator that needle engine bundle is still loading (Needle ASAP)
9
18
  - Add: Vite plugin for build info now includes file hash so we can skip uploading unchanged files
@@ -30138,13 +30138,13 @@ class _w {
30138
30138
  }
30139
30139
  r(_w, "eventListeners", /* @__PURE__ */ new Map());
30140
30140
  const gT = IA("debugdefines");
30141
- ME('if(!globalThis[""3.34.0-alpha.1""]) globalThis[""3.34.0-alpha.1""] = "0.0.0";');
30141
+ ME('if(!globalThis[""3.34.0-alpha.2""]) globalThis[""3.34.0-alpha.2""] = "0.0.0";');
30142
30142
  ME('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";');
30143
- ME('if(!globalThis[""Thu Mar 07 2024 01:47:46 GMT+0800 (Pacific Standard Time)""]) globalThis[""Thu Mar 07 2024 01:47:46 GMT+0800 (Pacific Standard Time)""] = "unknown";');
30144
- ME('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.34.0-alpha.1";');
30143
+ ME('if(!globalThis[""Thu Mar 07 2024 14:14:30 GMT+0100 (Central European Standard Time)""]) globalThis[""Thu Mar 07 2024 14:14:30 GMT+0100 (Central European Standard Time)""] = "unknown";');
30144
+ ME('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.34.0-alpha.2";');
30145
30145
  ME('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
30146
- ME('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Mar 07 2024 01:47:46 GMT+0800 (Pacific Standard Time)";');
30147
- const on = "3.34.0-alpha.1", TR = "undefined", IT = "Thu Mar 07 2024 01:47:46 GMT+0800 (Pacific Standard Time)";
30146
+ ME('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Mar 07 2024 14:14:30 GMT+0100 (Central European Standard Time)";');
30147
+ const on = "3.34.0-alpha.2", TR = "undefined", IT = "Thu Mar 07 2024 14:14:30 GMT+0100 (Central European Standard Time)";
30148
30148
  gT && console.log(`Engine version: ${on} (generator: ${TR})
30149
30149
  Project built at ${IT}`);
30150
30150
  const Sa = "needle_isActiveInHierarchy", hQ = "builtin_components", _p = "needle_editor_guid";
@@ -39076,7 +39076,8 @@ in script ${t}.ts
39076
39076
  <a href="https://docs.needle.tools/serializable" target="_blank">documentation</a>`), console.warn(t, s, g[s], g);
39077
39077
  continue;
39078
39078
  }
39079
- } else if (!Array.isArray(C) && ((o = C.constructor) == null ? void 0 : o.name) === "Object") {
39079
+ } else if (!Array.isArray(C) && ((o = C.constructor) == null ? void 0 : o.name) === "Object" && !C.constructor["did_warn:missing_serializable"]) {
39080
+ C.constructor["did_warn:missing_serializable"] = !0;
39080
39081
  const B = 'You might be missing a @serializable(Type) decorator for field "' + s + '" in ' + t + ".ts";
39081
39082
  console.warn(B + `
39082
39083
  `, n), Zs(Yo.Warn, "Deserialization issue: Please check the console for details!");
@@ -30138,13 +30138,13 @@ class Gb {
30138
30138
  }
30139
30139
  h(Gb, "eventListeners", /* @__PURE__ */ new Map());
30140
30140
  const xU = ne("debugdefines");
30141
- $f('if(!globalThis[""3.34.0-alpha.1""]) globalThis[""3.34.0-alpha.1""] = "0.0.0";');
30141
+ $f('if(!globalThis[""3.34.0-alpha.2""]) globalThis[""3.34.0-alpha.2""] = "0.0.0";');
30142
30142
  $f('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";');
30143
- $f('if(!globalThis[""Thu Mar 07 2024 01:47:51 GMT+0800 (Pacific Standard Time)""]) globalThis[""Thu Mar 07 2024 01:47:51 GMT+0800 (Pacific Standard Time)""] = "unknown";');
30144
- $f('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.34.0-alpha.1";');
30143
+ $f('if(!globalThis[""Thu Mar 07 2024 14:14:37 GMT+0100 (Central European Standard Time)""]) globalThis[""Thu Mar 07 2024 14:14:37 GMT+0100 (Central European Standard Time)""] = "unknown";');
30144
+ $f('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.34.0-alpha.2";');
30145
30145
  $f('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
30146
- $f('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Mar 07 2024 01:47:51 GMT+0800 (Pacific Standard Time)";');
30147
- const Wl = "3.34.0-alpha.1", ET = "undefined", wU = "Thu Mar 07 2024 01:47:51 GMT+0800 (Pacific Standard Time)";
30146
+ $f('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Mar 07 2024 14:14:37 GMT+0100 (Central European Standard Time)";');
30147
+ const Wl = "3.34.0-alpha.2", ET = "undefined", wU = "Thu Mar 07 2024 14:14:37 GMT+0100 (Central European Standard Time)";
30148
30148
  xU && console.log(`Engine version: ${Wl} (generator: ${ET})
30149
30149
  Project built at ${wU}`);
30150
30150
  const rh = "needle_isActiveInHierarchy", jd = "builtin_components", r0 = "needle_editor_guid";
@@ -39076,7 +39076,8 @@ in script ${i}.ts
39076
39076
  <a href="https://docs.needle.tools/serializable" target="_blank">documentation</a>`), console.warn(i, a, s[a], s);
39077
39077
  continue;
39078
39078
  }
39079
- } else if (!Array.isArray(l) && ((o = l.constructor) == null ? void 0 : o.name) === "Object") {
39079
+ } else if (!Array.isArray(l) && ((o = l.constructor) == null ? void 0 : o.name) === "Object" && !l.constructor["did_warn:missing_serializable"]) {
39080
+ l.constructor["did_warn:missing_serializable"] = !0;
39080
39081
  const d = 'You might be missing a @serializable(Type) decorator for field "' + a + '" in ' + i + ".ts";
39081
39082
  console.warn(d + `
39082
39083
  `, c), Ga(Ro.Warn, "Deserialization issue: Please check the console for details!");
@@ -4322,7 +4322,7 @@ void main() {
4322
4322
  `;a+=r(o);const l=Object.keys(s);let c="";for(let u=0;u<l.length;u++){const d=l[u],p=s[d];if(Jm.has(p)){c+="";continue}Jm.set(p,!0),c+=d+":"+n(p,o+1),u<l.length-1&&(c+=", "),c.length>=60&&(c+=`
4323
4323
  `,c+=r(o),a+=c,c="")}return a+=c,a+=`
4324
4324
  }`,a}return s}function r(s){let o="";for(let a=0;a<s;a++)o+=" ";return o}}const Kq=ee("nodevlogs");function Ki(i,e=Hs.Log){Ra(e,i)}function ji(i){Ki(i,Hs.Warn)}function Ek(i){Ki(i,Hs.Error)}let nE;function pt(){return Kq?!1:nE!==void 0?nE:Ts()}function Zq(i){nE=i}const wu=new mu,Qr=new S,Gc=new S,Qi=new Me,Mk={X:new S(1,0,0),Y:new S(0,1,0),Z:new S(0,0,1)},rE={type:"change"},Tk={type:"mouseDown"},Ik={type:"mouseUp",mode:null},Rk={type:"objectChange"};class $q extends ge{constructor(e,t){super(),t===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),t=document),this.isTransformControls=!0,this.visible=!1,this.domElement=t,this.domElement.style.touchAction="none";const n=new oE;this._gizmo=n,this.add(n);const r=new sY;this._plane=r,this.add(r);const s=this;function o(y,b){let _=b;Object.defineProperty(s,y,{get:function(){return _!==void 0?_:b},set:function(E){_!==E&&(_=E,r[y]=E,n[y]=E,s.dispatchEvent({type:y+"-changed",value:E}),s.dispatchEvent(rE))}}),s[y]=b,r[y]=b,n[y]=b}o("camera",e),o("object",void 0),o("enabled",!0),o("axis",null),o("mode","translate"),o("translationSnap",null),o("rotationSnap",null),o("scaleSnap",null),o("space","world"),o("size",1),o("dragging",!1),o("showX",!0),o("showY",!0),o("showZ",!0);const a=new S,l=new S,c=new Me,u=new Me,d=new S,p=new Me,f=new S,m=new S,A=new S,v=0,g=new S;o("worldPosition",a),o("worldPositionStart",l),o("worldQuaternion",c),o("worldQuaternionStart",u),o("cameraPosition",d),o("cameraQuaternion",p),o("pointStart",f),o("pointEnd",m),o("rotationAxis",A),o("rotationAngle",v),o("eye",g),this._offset=new S,this._startNorm=new S,this._endNorm=new S,this._cameraScale=new S,this._parentPosition=new S,this._parentQuaternion=new Me,this._parentQuaternionInv=new Me,this._parentScale=new S,this._worldScaleStart=new S,this._worldQuaternionInv=new Me,this._worldScale=new S,this._positionStart=new S,this._quaternionStart=new Me,this._scaleStart=new S,this._getPointer=eY.bind(this),this._onPointerDown=iY.bind(this),this._onPointerHover=tY.bind(this),this._onPointerMove=nY.bind(this),this._onPointerUp=rY.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;e!==null&&wu.setFromCamera(e,this.camera);const t=sE(this._gizmo.picker[this.mode],wu);t?this.axis=t.object.name:this.axis=null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e!=null&&e.button!==0)&&this.axis!==null){e!==null&&wu.setFromCamera(e,this.camera);const t=sE(this._plane,wu,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,Tk.mode=this.mode,this.dispatchEvent(Tk)}}pointerMove(e){const t=this.axis,n=this.mode,r=this.object;let s=this.space;if(n==="scale"?s="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(s="world"),r===void 0||t===null||this.dragging===!1||e!==null&&e.button!==-1)return;e!==null&&wu.setFromCamera(e,this.camera);const o=sE(this._plane,wu,!0);if(o){if(this.pointEnd.copy(o.point).sub(this.worldPositionStart),n==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),s==="local"&&t!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf("X")===-1&&(this._offset.x=0),t.indexOf("Y")===-1&&(this._offset.y=0),t.indexOf("Z")===-1&&(this._offset.z=0),s==="local"&&t!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),r.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(s==="local"&&(r.position.applyQuaternion(Qi.copy(this._quaternionStart).invert()),t.search("X")!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this._quaternionStart)),s==="world"&&(r.parent&&r.position.add(Qr.setFromMatrixPosition(r.parent.matrixWorld)),t.search("X")!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.parent&&r.position.sub(Qr.setFromMatrixPosition(r.parent.matrixWorld))));else if(n==="scale"){if(t.search("XYZ")!==-1){let a=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(a*=-1),Gc.set(a,a,a)}else Qr.copy(this.pointStart),Gc.copy(this.pointEnd),Qr.applyQuaternion(this._worldQuaternionInv),Gc.applyQuaternion(this._worldQuaternionInv),Gc.divide(Qr),t.search("X")===-1&&(Gc.x=1),t.search("Y")===-1&&(Gc.y=1),t.search("Z")===-1&&(Gc.z=1);r.scale.copy(this._scaleStart).multiply(Gc),this.scaleSnap&&(t.search("X")!==-1&&(r.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Y")!==-1&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Z")!==-1&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(n==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const a=20/this.worldPosition.distanceTo(Qr.setFromMatrixPosition(this.camera.matrixWorld));let l=!1;t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(Qr.copy(this.rotationAxis).cross(this.eye))*a):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(Mk[t]),Qr.copy(Mk[t]),s==="local"&&Qr.applyQuaternion(this.worldQuaternion),Qr.cross(this.eye),Qr.length()===0?l=!0:this.rotationAngle=this._offset.dot(Qr.normalize())*a),(t==="E"||l)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),s==="local"&&t!=="E"&&t!=="XYZE"?(r.quaternion.copy(this._quaternionStart),r.quaternion.multiply(Qi.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),r.quaternion.copy(Qi.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(rE),this.dispatchEvent(Rk)}}pointerUp(e){e!==null&&e.button!==0||(this.dragging&&this.axis!==null&&(Ik.mode=this.mode,this.dispatchEvent(Ik)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}attach(e){return this.object=e,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(rE),this.dispatchEvent(Rk),this.pointStart.copy(this.pointEnd))}getRaycaster(){return wu}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}}function eY(i){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:i.button};{const e=this.domElement.getBoundingClientRect();return{x:(i.clientX-e.left)/e.width*2-1,y:-(i.clientY-e.top)/e.height*2+1,button:i.button}}}function tY(i){if(this.enabled)switch(i.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(i));break}}function iY(i){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(i.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(i)),this.pointerDown(this._getPointer(i)))}function nY(i){this.enabled&&this.pointerMove(this._getPointer(i))}function rY(i){this.enabled&&(this.domElement.releasePointerCapture(i.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(i)))}function sE(i,e,t){const n=e.intersectObject(i,!0);for(let r=0;r<n.length;r++)if(n[r].object.visible||t)return n[r];return!1}const Yy=new Li,Ei=new S(0,1,0),Pk=new S(0,0,0),Bk=new Ee,Jy=new Me,Ky=new Me,Ba=new S,Dk=new Ee,Km=new S(1,0,0),Su=new S(0,1,0),Zm=new S(0,0,1),Zy=new S,$m=new S,eg=new S;class oE extends ge{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const e=new ii({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new mn({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),n=e.clone();n.opacity=.15;const r=t.clone();r.opacity=.5;const s=e.clone();s.color.setHex(16711680);const o=e.clone();o.color.setHex(65280);const a=e.clone();a.color.setHex(255);const l=e.clone();l.color.setHex(16711680),l.opacity=.5;const c=e.clone();c.color.setHex(65280),c.opacity=.5;const u=e.clone();u.color.setHex(255),u.opacity=.5;const d=e.clone();d.opacity=.25;const p=e.clone();p.color.setHex(16776960),p.opacity=.25,e.clone().color.setHex(16776960);const f=e.clone();f.color.setHex(7895160);const m=new _n(0,.04,.1,12);m.translate(0,.05,0);const A=new Pi(.08,.08,.08);A.translate(0,.04,0);const v=new yt;v.setAttribute("position",new ot([0,0,0,1,0,0],3));const g=new _n(.0075,.0075,.5,3);g.translate(0,.25,0);function y(k,W){const U=new vc(k,.0075,3,64,W*Math.PI*2);return U.rotateY(Math.PI/2),U.rotateX(Math.PI/2),U}function b(){const k=new yt;return k.setAttribute("position",new ot([0,0,0,1,1,1],3)),k}const _={X:[[new me(m,s),[.5,0,0],[0,0,-Math.PI/2]],[new me(m,s),[-.5,0,0],[0,0,Math.PI/2]],[new me(g,s),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new me(m,o),[0,.5,0]],[new me(m,o),[0,-.5,0],[Math.PI,0,0]],[new me(g,o)]],Z:[[new me(m,a),[0,0,.5],[Math.PI/2,0,0]],[new me(m,a),[0,0,-.5],[-Math.PI/2,0,0]],[new me(g,a),null,[Math.PI/2,0,0]]],XYZ:[[new me(new gc(.1,0),d.clone()),[0,0,0]]],XY:[[new me(new Pi(.15,.15,.01),u.clone()),[.15,.15,0]]],YZ:[[new me(new Pi(.15,.15,.01),l.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new me(new Pi(.15,.15,.01),c.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},E={X:[[new me(new _n(.2,0,.6,4),n),[.3,0,0],[0,0,-Math.PI/2]],[new me(new _n(.2,0,.6,4),n),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new me(new _n(.2,0,.6,4),n),[0,.3,0]],[new me(new _n(.2,0,.6,4),n),[0,-.3,0],[0,0,Math.PI]]],Z:[[new me(new _n(.2,0,.6,4),n),[0,0,.3],[Math.PI/2,0,0]],[new me(new _n(.2,0,.6,4),n),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new me(new gc(.2,0),n)]],XY:[[new me(new Pi(.2,.2,.01),n),[.15,.15,0]]],YZ:[[new me(new Pi(.2,.2,.01),n),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new me(new Pi(.2,.2,.01),n),[.15,0,.15],[-Math.PI/2,0,0]]]},I={START:[[new me(new gc(.01,2),r),null,null,null,"helper"]],END:[[new me(new gc(.01,2),r),null,null,null,"helper"]],DELTA:[[new gn(b(),r),null,null,null,"helper"]],X:[[new gn(v,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new gn(v,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new gn(v,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},M={XYZE:[[new me(y(.5,1),f),null,[0,Math.PI/2,0]]],X:[[new me(y(.5,.5),s)]],Y:[[new me(y(.5,.5),o),null,[0,0,-Math.PI/2]]],Z:[[new me(y(.5,.5),a),null,[0,Math.PI/2,0]]],E:[[new me(y(.75,1),p),null,[0,Math.PI/2,0]]]},T={AXIS:[[new gn(v,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},D={XYZE:[[new me(new va(.25,10,8),n)]],X:[[new me(new vc(.5,.1,4,24),n),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new me(new vc(.5,.1,4,24),n),[0,0,0],[Math.PI/2,0,0]]],Z:[[new me(new vc(.5,.1,4,24),n),[0,0,0],[0,0,-Math.PI/2]]],E:[[new me(new vc(.75,.1,2,24),n)]]},C={X:[[new me(A,s),[.5,0,0],[0,0,-Math.PI/2]],[new me(g,s),[0,0,0],[0,0,-Math.PI/2]],[new me(A,s),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new me(A,o),[0,.5,0]],[new me(g,o)],[new me(A,o),[0,-.5,0],[0,0,Math.PI]]],Z:[[new me(A,a),[0,0,.5],[Math.PI/2,0,0]],[new me(g,a),[0,0,0],[Math.PI/2,0,0]],[new me(A,a),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new me(new Pi(.15,.15,.01),u),[.15,.15,0]]],YZ:[[new me(new Pi(.15,.15,.01),l),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new me(new Pi(.15,.15,.01),c),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new me(new Pi(.1,.1,.1),d.clone())]]},P={X:[[new me(new _n(.2,0,.6,4),n),[.3,0,0],[0,0,-Math.PI/2]],[new me(new _n(.2,0,.6,4),n),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new me(new _n(.2,0,.6,4),n),[0,.3,0]],[new me(new _n(.2,0,.6,4),n),[0,-.3,0],[0,0,Math.PI]]],Z:[[new me(new _n(.2,0,.6,4),n),[0,0,.3],[Math.PI/2,0,0]],[new me(new _n(.2,0,.6,4),n),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new me(new Pi(.2,.2,.01),n),[.15,.15,0]]],YZ:[[new me(new Pi(.2,.2,.01),n),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new me(new Pi(.2,.2,.01),n),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new me(new Pi(.2,.2,.2),n),[0,0,0]]]},Q={X:[[new gn(v,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new gn(v,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new gn(v,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function G(k){const W=new ge;for(const U in k)for(let F=k[U].length;F--;){const z=k[U][F][0].clone(),Z=k[U][F][1],K=k[U][F][2],se=k[U][F][3],Ae=k[U][F][4];z.name=U,z.tag=Ae,Z&&z.position.set(Z[0],Z[1],Z[2]),K&&z.rotation.set(K[0],K[1],K[2]),se&&z.scale.set(se[0],se[1],se[2]),z.updateMatrix();const Re=z.geometry.clone();Re.applyMatrix4(z.matrix),z.geometry=Re,z.renderOrder=1/0,z.position.set(0,0,0),z.rotation.set(0,0,0),z.scale.set(1,1,1),W.add(z)}return W}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=G(_)),this.add(this.gizmo.rotate=G(M)),this.add(this.gizmo.scale=G(C)),this.add(this.picker.translate=G(E)),this.add(this.picker.rotate=G(D)),this.add(this.picker.scale=G(P)),this.add(this.helper.translate=G(I)),this.add(this.helper.rotate=G(T)),this.add(this.helper.scale=G(Q)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){const t=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:Ky;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let r=0;r<n.length;r++){const s=n[r];s.visible=!0,s.rotation.set(0,0,0),s.position.copy(this.worldPosition);let o;if(this.camera.isOrthographicCamera?o=(this.camera.top-this.camera.bottom)/this.camera.zoom:o=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),s.scale.set(1,1,1).multiplyScalar(o*this.size/4),s.tag==="helper"){s.visible=!1,s.name==="AXIS"?(s.visible=!!this.axis,this.axis==="X"&&(Qi.setFromEuler(Yy.set(0,0,0)),s.quaternion.copy(t).multiply(Qi),Math.abs(Ei.copy(Km).applyQuaternion(t).dot(this.eye))>.9&&(s.visible=!1)),this.axis==="Y"&&(Qi.setFromEuler(Yy.set(0,0,Math.PI/2)),s.quaternion.copy(t).multiply(Qi),Math.abs(Ei.copy(Su).applyQuaternion(t).dot(this.eye))>.9&&(s.visible=!1)),this.axis==="Z"&&(Qi.setFromEuler(Yy.set(0,Math.PI/2,0)),s.quaternion.copy(t).multiply(Qi),Math.abs(Ei.copy(Zm).applyQuaternion(t).dot(this.eye))>.9&&(s.visible=!1)),this.axis==="XYZE"&&(Qi.setFromEuler(Yy.set(0,Math.PI/2,0)),Ei.copy(this.rotationAxis),s.quaternion.setFromRotationMatrix(Bk.lookAt(Pk,Ei,Su)),s.quaternion.multiply(Qi),s.visible=this.dragging),this.axis==="E"&&(s.visible=!1)):s.name==="START"?(s.position.copy(this.worldPositionStart),s.visible=this.dragging):s.name==="END"?(s.position.copy(this.worldPosition),s.visible=this.dragging):s.name==="DELTA"?(s.position.copy(this.worldPositionStart),s.quaternion.copy(this.worldQuaternionStart),Qr.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Qr.applyQuaternion(this.worldQuaternionStart.clone().invert()),s.scale.copy(Qr),s.visible=this.dragging):(s.quaternion.copy(t),this.dragging?s.position.copy(this.worldPositionStart):s.position.copy(this.worldPosition),this.axis&&(s.visible=this.axis.search(s.name)!==-1));continue}s.quaternion.copy(t),this.mode==="translate"||this.mode==="scale"?(s.name==="X"&&Math.abs(Ei.copy(Km).applyQuaternion(t).dot(this.eye))>.99&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="Y"&&Math.abs(Ei.copy(Su).applyQuaternion(t).dot(this.eye))>.99&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="Z"&&Math.abs(Ei.copy(Zm).applyQuaternion(t).dot(this.eye))>.99&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="XY"&&Math.abs(Ei.copy(Zm).applyQuaternion(t).dot(this.eye))<.2&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="YZ"&&Math.abs(Ei.copy(Km).applyQuaternion(t).dot(this.eye))<.2&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="XZ"&&Math.abs(Ei.copy(Su).applyQuaternion(t).dot(this.eye))<.2&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1)):this.mode==="rotate"&&(Jy.copy(t),Ei.copy(this.eye).applyQuaternion(Qi.copy(t).invert()),s.name.search("E")!==-1&&s.quaternion.setFromRotationMatrix(Bk.lookAt(this.eye,Pk,Su)),s.name==="X"&&(Qi.setFromAxisAngle(Km,Math.atan2(-Ei.y,Ei.z)),Qi.multiplyQuaternions(Jy,Qi),s.quaternion.copy(Qi)),s.name==="Y"&&(Qi.setFromAxisAngle(Su,Math.atan2(Ei.x,Ei.z)),Qi.multiplyQuaternions(Jy,Qi),s.quaternion.copy(Qi)),s.name==="Z"&&(Qi.setFromAxisAngle(Zm,Math.atan2(Ei.y,Ei.x)),Qi.multiplyQuaternions(Jy,Qi),s.quaternion.copy(Qi))),s.visible=s.visible&&(s.name.indexOf("X")===-1||this.showX),s.visible=s.visible&&(s.name.indexOf("Y")===-1||this.showY),s.visible=s.visible&&(s.name.indexOf("Z")===-1||this.showZ),s.visible=s.visible&&(s.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),s.material._color=s.material._color||s.material.color.clone(),s.material._opacity=s.material._opacity||s.material.opacity,s.material.color.copy(s.material._color),s.material.opacity=s.material._opacity,this.enabled&&this.axis&&(s.name===this.axis||this.axis.split("").some(function(a){return s.name===a}))&&(s.material.color.setHex(16776960),s.material.opacity=1)}super.updateMatrixWorld(e)}}class sY extends me{constructor(){super(new kn(1e5,1e5,2,2),new ii({visible:!1,wireframe:!0,side:hi,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(t="local"),Zy.copy(Km).applyQuaternion(t==="local"?this.worldQuaternion:Ky),$m.copy(Su).applyQuaternion(t==="local"?this.worldQuaternion:Ky),eg.copy(Zm).applyQuaternion(t==="local"?this.worldQuaternion:Ky),Ei.copy($m),this.mode){case"translate":case"scale":switch(this.axis){case"X":Ei.copy(this.eye).cross(Zy),Ba.copy(Zy).cross(Ei);break;case"Y":Ei.copy(this.eye).cross($m),Ba.copy($m).cross(Ei);break;case"Z":Ei.copy(this.eye).cross(eg),Ba.copy(eg).cross(Ei);break;case"XY":Ba.copy(eg);break;case"YZ":Ba.copy(Zy);break;case"XZ":Ei.copy(eg),Ba.copy($m);break;case"XYZ":case"E":Ba.set(0,0,0);break}break;case"rotate":default:Ba.set(0,0,0)}Ba.length()===0?this.quaternion.copy(this.cameraQuaternion):(Dk.lookAt(Qr.set(0,0,0),Ba,Ei),this.quaternion.setFromRotationMatrix(Dk)),super.updateMatrixWorld(e)}}const oY=ee("debugpatch");function $y(i,e,t,n){const r=oY===e;if(!t&&!n)return;const s=e+"___needle";lY(i,e,t,n);const o=Object.getOwnPropertyDescriptor(i,e),a=i[e];r&&console.log("Patch",i.constructor.name,e,o,a),o?(r&&console.log("Apply patch with existing descriptor",i.constructor.name,e,o),typeof o.value=="function"&&(i[e]=kk(o.value,i,e))):(r&&console.log("Create patch with new property",i.constructor.name,e,o),Object.defineProperty(i,e,{set:function(l){if(typeof l=="function")this[s]=kk(l,i,e);else{const c=this[s];Lk(i,e,this,c,l),this[s]=l,Uk(i,e,this,c,l)}},get:function(){const l=this[s];return typeof l=="function"&&l[s]?l[s]:l}}))}function aY(i,e,t){const n=lE(i,e);if(n)for(let r=n.length-1;r>=0;r--){const s=n[r];s.prefix===t&&(s.prefix=null),s.postfix===t&&(s.postfix=null),!s.prefix&&!s.postfix&&n.splice(r,1)}}const Ok=Symbol("Needle:Patches:WrappedFunction");function kk(i,e,t){if(i[Ok])return i;const n=function(...r){Lk(e,t,this,...r);const s=i.apply(this,r);return Uk(e,t,this,s,...r),s};return n[Ok]=!0,n}const eb="Needle:Patches";function aE(){return globalThis[eb]||(globalThis[eb]=new WeakMap),globalThis[eb]}function lE(i,e){const t=aE().get(i);return t?t.get(e):null}function lY(i,e,t,n){let r=aE().get(i);r||(r=new Map,aE().set(i,r));let s=r.get(e);s||(s=[],r.set(e,s)),s.push({prefix:t,postfix:n})}function Lk(i,e,t,...n){var r;if(!t)return;const s=lE(i,e);if(s)for(const o of s)(r=o.prefix)==null||r.call(t,...n)}function Uk(i,e,t,n,...r){var s;if(!t)return;const o=lE(i,e);if(o)for(const a of o)(s=a.postfix)==null||s.call(t,n,...r)}const Fk=Symbol("gltf-loader-internal-usage-tracker"),cY=ee("debugusers"),tb=class{constructor(i){h(this,"parser"),h(this,"_getDependency"),h(this,"_loadingId"),h(this,"_loadedObjects",new Set),this.parser=i,this._getDependency=this.parser.getDependency,this._loadingId=Date.now().toString()}get name(){return"NEEDLE_internal_usage_tracker"}static isLoading(i){return tb._loadingProcesses>0}beforeRoot(){tb._loadingProcesses++;const i=this,e=this._getDependency;return this.parser.getDependency=function(t,n){const r=e.call(this,t,n);return r.then(s=>(s&&(i._loadedObjects.add(s),s[Fk]=i._loadingId),s)),r},null}afterRoot(i){tb._loadingProcesses--,this.parser.getDependency=this._getDependency;for(const e of this._loadedObjects)delete e[Fk],e instanceof ge&&(e.parent||e instanceof me&&(cY&&console.warn("> GLTF LOADER: Mesh not used in scene!",e),e.material=null,e.geometry=null));return null}};let cE=tb;h(cE,"_loadingProcesses",0);class Nk{constructor(){window.addEventListener("unhandledrejection",e=>{var t;if(e.defaultPrevented)return;const n=(t=e?.reason)==null?void 0:t.path;if(n){const r=n[0];r&&r.tagName==="IMG"&&(console.warn(`Could not load image:
4325
- `+r.src),e.preventDefault())}})}}const ib=ee("trackresources");function zk(){return ib==="dispose"}let Cu=!0;ib===0&&(Cu=!1);function hY(i){Cu=i}function jk(){return Cu}const Qk=Symbol("disposable");function hE(i,e){i&&(i[Qk]=e,Eu&&console.warn("Set disposable",e,i))}const Gk=Symbol("disposed");function uY(i){return i[Gk]===!0}function Ti(i){var e;if(i){if(i[Qk]===!1){Eu&&console.warn("Object is marked as not disposable",i);return}if(i[Gk]=!0,i instanceof Nr)Ti(i.environment),Ti(i.background),Ti(i.customDepthMaterial),Ti(i.customDistanceMaterial);else if(i instanceof Yo)Ti(i.geometry),Ti(i.material),Ti(i.skeleton),Ti(i.bindMatrix),Ti(i.bindMatrixInverse),Ti(i.customDepthMaterial),Ti(i.customDistanceMaterial),i.geometry=null,i.material=null;else if(i instanceof me)Ti(i.geometry),Ti(i.material),Ti(i.customDepthMaterial),Ti(i.customDistanceMaterial),i.geometry=null,i.material=null;else if(i instanceof yt){_p(i);for(const t of Object.keys(i.attributes)){const n=i.attributes[t];Ti(n)}}else if(i instanceof $e||i instanceof _s)Eu&&console.warn("BufferAttribute dispose not supported",i.count);else if(i instanceof Array)for(const t of i)t instanceof Ot&&Ti(t);else if(i instanceof Ot){_p(i);for(const n of Object.keys(i)){const r=i[n];r instanceof Tt&&(Ti(r),i[n]=null)}const t=i.uniforms;if(t)for(const n of Object.keys(t)){const r=t[n];r instanceof Tt?(Ti(r),t[n]=null):r instanceof be&&(Ti(r.value),r.value=null)}}else i instanceof Tt?(_p(i),_p(i.source),((e=i.source)==null?void 0:e.data)instanceof ImageBitmap&&_p(i.source.data)):i instanceof Qf?(_p(i.boneTexture),i.boneTexture=null):i instanceof Sm||!(i instanceof ge)&&Eu&&console.warn("Unknown object type",i)}}function _p(i){i&&((Eu||zk()||ib)&&console.warn("\u{1F9E8} FREE",i),i instanceof ImageBitmap?i.close():i instanceof bl?i.data=null:i.dispose())}function Hk(i){(i instanceof me||i instanceof Yo)&&(i.material=null,i.geometry=null)}const dY=new Set;function uE(i,e,t=null,n){if(n||(n=dY,n.clear()),!i)return n;const r=i[tg];if(r)for(const s of r)n.has(s)||t?.call(null,s)!==!1&&(n.add(s),e&&uE(s,!0,t,n));return n}function pY(i){return i[ig]}const Eu=ee("debugresourceusers")||ee("debugmemory"),tg=Symbol("needle-resource-users"),ig=Symbol("needle-resource-users-count");function as(i,e){$y(i,e,function(t,n){Cu&&(nb(tg,this,t,!1),nb(tg,this,n,!0))})}Cu&&(as(me.prototype,"material"),as(me.prototype,"geometry"),as(Ot.prototype,"map"),as(Ot.prototype,"bumpMap"),as(Ot.prototype,"alphaMap"),as(Ot.prototype,"normalMap"),as(Ot.prototype,"displacementMap"),as(Ot.prototype,"roughnessMap"),as(Ot.prototype,"metalnessMap"),as(Ot.prototype,"emissiveMap"),as(Ot.prototype,"specularMap"),as(Ot.prototype,"envMap"),as(Ot.prototype,"lightMap"),as(Ot.prototype,"aoMap"),as(Ot.prototype,"gradientMap"));function fY(i){if(Cu===!1)return;const e=i[tg];if(e)for(const t of e)nb(tg,t,i,!1)}Cu&&$y(Ot.prototype,"dispose",function(){fY(this)});let dE=0;function nb(i,e,t,n){if(dE>0)return;if(Array.isArray(t)){for(const s of t)nb(i,e,s,n);return}if(!t)return;let r=t[i];if(r||(r=new Set),n){if(e&&!r.has(e)){r.add(e);let s=t[ig]||0;s+=1,t[ig]=s,Eu&&console.warn(`\u{1F7E2} Added user of "${t.type}"`,e,t,s,"users:",r)}}else if(e&&r.has(e)){r.delete(e);let s=t[ig]||0;s>0&&(s-=1,t[ig]=s),Eu&&console.warn(`\u{1F534} Removed user of "${t.type}"`,e,t,s,"users:",r),s<=0&&(cE.isLoading(t)||(ib&&console.warn(`\u{1F534} Removed all user of "${t.type}"`,t),zk()&&Ti(t)))}t[i]=r}try{$y(Tl.prototype,"render",function(){dE++},function(){dE--})}catch(i){console.warn("Could not wrap WebGLRenderer.render",i)}var ng=(i=>(i.Added="component-added",i.Removing="removing-component",i))(ng||{});const Vk=ee("debugcomponentevents");class rg{static addComponentLifecylceEventListener(e,t){this.eventListeners.has(e)&&this.eventListeners.set(e,[]);let n=this.eventListeners.get(e);n||(n=[]),n.push(t),this.eventListeners.set(e,n),Vk&&console.log("Added event listener for "+e,this.eventListeners)}static removeComponentLifecylceEventListener(e,t){const n=this.eventListeners.get(e);if(!n)return;const r=n.indexOf(t);r<0||n.splice(r,1)}static dispatchComponentLifecycleEvent(e,t){const n=this.eventListeners.get(e);if(Vk&&console.log("Dispatching event "+e,n),!!n)for(const r of n)r(t)}}h(rg,"eventListeners",new Map);const Wk=ee("debugdefines");xp('if(!globalThis[""3.34.0-alpha.1""]) globalThis[""3.34.0-alpha.1""] = "0.0.0";'),xp('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";'),xp('if(!globalThis[""Thu Mar 07 2024 01:47:51 GMT+0800 (Pacific Standard Time)""]) globalThis[""Thu Mar 07 2024 01:47:51 GMT+0800 (Pacific Standard Time)""] = "unknown";'),xp('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.34.0-alpha.1";'),xp('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";'),xp('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Mar 07 2024 01:47:51 GMT+0800 (Pacific Standard Time)";');const Ll="3.34.0-alpha.1",rb="undefined",pE="Thu Mar 07 2024 01:47:51 GMT+0800 (Pacific Standard Time)";Wk&&console.log(`Engine version: ${Ll} (generator: ${rb})
4325
+ `+r.src),e.preventDefault())}})}}const ib=ee("trackresources");function zk(){return ib==="dispose"}let Cu=!0;ib===0&&(Cu=!1);function hY(i){Cu=i}function jk(){return Cu}const Qk=Symbol("disposable");function hE(i,e){i&&(i[Qk]=e,Eu&&console.warn("Set disposable",e,i))}const Gk=Symbol("disposed");function uY(i){return i[Gk]===!0}function Ti(i){var e;if(i){if(i[Qk]===!1){Eu&&console.warn("Object is marked as not disposable",i);return}if(i[Gk]=!0,i instanceof Nr)Ti(i.environment),Ti(i.background),Ti(i.customDepthMaterial),Ti(i.customDistanceMaterial);else if(i instanceof Yo)Ti(i.geometry),Ti(i.material),Ti(i.skeleton),Ti(i.bindMatrix),Ti(i.bindMatrixInverse),Ti(i.customDepthMaterial),Ti(i.customDistanceMaterial),i.geometry=null,i.material=null;else if(i instanceof me)Ti(i.geometry),Ti(i.material),Ti(i.customDepthMaterial),Ti(i.customDistanceMaterial),i.geometry=null,i.material=null;else if(i instanceof yt){_p(i);for(const t of Object.keys(i.attributes)){const n=i.attributes[t];Ti(n)}}else if(i instanceof $e||i instanceof _s)Eu&&console.warn("BufferAttribute dispose not supported",i.count);else if(i instanceof Array)for(const t of i)t instanceof Ot&&Ti(t);else if(i instanceof Ot){_p(i);for(const n of Object.keys(i)){const r=i[n];r instanceof Tt&&(Ti(r),i[n]=null)}const t=i.uniforms;if(t)for(const n of Object.keys(t)){const r=t[n];r instanceof Tt?(Ti(r),t[n]=null):r instanceof be&&(Ti(r.value),r.value=null)}}else i instanceof Tt?(_p(i),_p(i.source),((e=i.source)==null?void 0:e.data)instanceof ImageBitmap&&_p(i.source.data)):i instanceof Qf?(_p(i.boneTexture),i.boneTexture=null):i instanceof Sm||!(i instanceof ge)&&Eu&&console.warn("Unknown object type",i)}}function _p(i){i&&((Eu||zk()||ib)&&console.warn("\u{1F9E8} FREE",i),i instanceof ImageBitmap?i.close():i instanceof bl?i.data=null:i.dispose())}function Hk(i){(i instanceof me||i instanceof Yo)&&(i.material=null,i.geometry=null)}const dY=new Set;function uE(i,e,t=null,n){if(n||(n=dY,n.clear()),!i)return n;const r=i[tg];if(r)for(const s of r)n.has(s)||t?.call(null,s)!==!1&&(n.add(s),e&&uE(s,!0,t,n));return n}function pY(i){return i[ig]}const Eu=ee("debugresourceusers")||ee("debugmemory"),tg=Symbol("needle-resource-users"),ig=Symbol("needle-resource-users-count");function as(i,e){$y(i,e,function(t,n){Cu&&(nb(tg,this,t,!1),nb(tg,this,n,!0))})}Cu&&(as(me.prototype,"material"),as(me.prototype,"geometry"),as(Ot.prototype,"map"),as(Ot.prototype,"bumpMap"),as(Ot.prototype,"alphaMap"),as(Ot.prototype,"normalMap"),as(Ot.prototype,"displacementMap"),as(Ot.prototype,"roughnessMap"),as(Ot.prototype,"metalnessMap"),as(Ot.prototype,"emissiveMap"),as(Ot.prototype,"specularMap"),as(Ot.prototype,"envMap"),as(Ot.prototype,"lightMap"),as(Ot.prototype,"aoMap"),as(Ot.prototype,"gradientMap"));function fY(i){if(Cu===!1)return;const e=i[tg];if(e)for(const t of e)nb(tg,t,i,!1)}Cu&&$y(Ot.prototype,"dispose",function(){fY(this)});let dE=0;function nb(i,e,t,n){if(dE>0)return;if(Array.isArray(t)){for(const s of t)nb(i,e,s,n);return}if(!t)return;let r=t[i];if(r||(r=new Set),n){if(e&&!r.has(e)){r.add(e);let s=t[ig]||0;s+=1,t[ig]=s,Eu&&console.warn(`\u{1F7E2} Added user of "${t.type}"`,e,t,s,"users:",r)}}else if(e&&r.has(e)){r.delete(e);let s=t[ig]||0;s>0&&(s-=1,t[ig]=s),Eu&&console.warn(`\u{1F534} Removed user of "${t.type}"`,e,t,s,"users:",r),s<=0&&(cE.isLoading(t)||(ib&&console.warn(`\u{1F534} Removed all user of "${t.type}"`,t),zk()&&Ti(t)))}t[i]=r}try{$y(Tl.prototype,"render",function(){dE++},function(){dE--})}catch(i){console.warn("Could not wrap WebGLRenderer.render",i)}var ng=(i=>(i.Added="component-added",i.Removing="removing-component",i))(ng||{});const Vk=ee("debugcomponentevents");class rg{static addComponentLifecylceEventListener(e,t){this.eventListeners.has(e)&&this.eventListeners.set(e,[]);let n=this.eventListeners.get(e);n||(n=[]),n.push(t),this.eventListeners.set(e,n),Vk&&console.log("Added event listener for "+e,this.eventListeners)}static removeComponentLifecylceEventListener(e,t){const n=this.eventListeners.get(e);if(!n)return;const r=n.indexOf(t);r<0||n.splice(r,1)}static dispatchComponentLifecycleEvent(e,t){const n=this.eventListeners.get(e);if(Vk&&console.log("Dispatching event "+e,n),!!n)for(const r of n)r(t)}}h(rg,"eventListeners",new Map);const Wk=ee("debugdefines");xp('if(!globalThis[""3.34.0-alpha.2""]) globalThis[""3.34.0-alpha.2""] = "0.0.0";'),xp('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";'),xp('if(!globalThis[""Thu Mar 07 2024 14:14:37 GMT+0100 (Central European Standard Time)""]) globalThis[""Thu Mar 07 2024 14:14:37 GMT+0100 (Central European Standard Time)""] = "unknown";'),xp('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.34.0-alpha.2";'),xp('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";'),xp('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Mar 07 2024 14:14:37 GMT+0100 (Central European Standard Time)";');const Ll="3.34.0-alpha.2",rb="undefined",pE="Thu Mar 07 2024 14:14:37 GMT+0100 (Central European Standard Time)";Wk&&console.log(`Engine version: ${Ll} (generator: ${rb})
4326
4326
  Project built at ${pE}`);const Ul="needle_isActiveInHierarchy",Mu="builtin_components",sg="needle_editor_guid";function xp(i){try{(0,eval)(i)}catch(e){Wk&&console.error(e)}}const og=Symbol("NEEDLE_NEED_UPDATE_INSTANCE"),Xk=Symbol("isUsingInstancing"),qk=Symbol("instancingRenderer"),fE=Symbol("instancingAutoUpdateBounds");class ba{static isUsingInstancing(e){return e[Xk]===!0}static getRenderer(e){return e[qk]||null}setAutoUpdateBounds(e,t){const n=ba.getRenderer(e);n&&(n[fE]=t)}static markDirty(e,t=!0){if(e&&(this.isUsingInstancing(e)&&(e[og]=!0,e.matrixWorldNeedsUpdate=!0),t))for(const n of e.children)ba.markDirty(n,!0)}}function Tu(i,e){try{e?i(e):i()}catch(t){return console.error(t),!1}return!0}const mE=ee("debugnewscripts"),mY=ee("debughierarchy"),Gi=[];function gY(){return Gi.length>0}function sb(i){if(!(i.new_scripts.length<=0)){if(mE&&console.log("Register new components",i.new_scripts.length,[...i.new_scripts],i.alias?"element: "+i.alias:i.hash,i),i.new_scripts_pre_setup_callbacks.length>0){for(const e of i.new_scripts_pre_setup_callbacks)e&&e();i.new_scripts_pre_setup_callbacks.length=0}Gi.length=0,i.new_scripts.length>0&&Gi.push(...i.new_scripts),i.new_scripts.length=0;for(let e=0;e<Gi.length;e++)try{const t=Gi[e];if(t.isComponent!==!0){(pt()||mE)&&console.error(`Registered script is not a Needle Engine component.
4327
4327
  The script will be ignored. Please make sure your component extends "Behaviour" imported from "@needle-tools/engine"
4328
4328
  `,t),Gi.splice(e,1),e--;continue}if(t.destroyed)continue;if(!t.gameObject){console.error("MISSING GAMEOBJECT - will ignore",t),Gi.splice(e,1),e--;continue}t.context=i,ag(t.gameObject),gE(t,i)}catch(t){console.error(t),Fl(Gi[e],i),Gi.splice(e,1),e--}for(let e=0;e<Gi.length;e++)try{const t=Gi[e];if(t.destroyed){Fl(Gi[e],i),Gi.splice(e,1),e--;continue}if(t.registering)try{t.registering()}catch(n){console.error(n)}t.__internalAwake!==void 0&&(t.gameObject||console.error("MISSING GAMEOBJECT",t,t.gameObject),ag(t.gameObject),t.activeAndEnabled&&Tu(t.__internalAwake.bind(t)))}catch(t){console.error(t),Fl(Gi[e],i),Gi.splice(e,1),e--}for(let e=0;e<Gi.length;e++)try{const t=Gi[e];if(t.destroyed||t.enabled===!1||(ag(t.gameObject),t.activeAndEnabled===!1))continue;t.__internalEnable!==void 0&&(t.enabled=!0,Tu(t.__internalEnable.bind(t)))}catch(t){console.error(t),Fl(Gi[e],i),Gi.splice(e,1),e--}for(let e=0;e<Gi.length;e++)try{const t=Gi[e];if(t.destroyed||!t.gameObject)continue;i.new_script_start.push(t)}catch(t){console.error(t),Fl(Gi[e],i),Gi.splice(e,1),e--}Gi.length=0;for(const e of i.new_scripts_post_setup_callbacks)e&&e();i.new_scripts_post_setup_callbacks.length=0}}function vY(i){i&&(i.__internalDisable(!0),Fl(i,i.context))}function Yk(i,e){for(let t=0;t<i.new_script_start.length;t++)try{const n=i.new_script_start[t];if(e!==void 0&&n.gameObject!==e||n.destroyed||n.activeAndEnabled===!1)continue;Tu(n.__internalAwake.bind(n)),n.enabled&&(Tu(n.__internalEnable.bind(n)),Tu(n.__internalStart.bind(n)),i.new_script_start.splice(t,1),t--)}catch(n){console.error(n),Fl(i.new_script_start[t],i),i.new_script_start.splice(t,1),t--}}function gE(i,e){e.scripts.indexOf(i)===-1&&(e.scripts.push(i),i.earlyUpdate&&e.scripts_earlyUpdate.push(i),i.update&&e.scripts_update.push(i),i.lateUpdate&&e.scripts_lateUpdate.push(i),i.onBeforeRender&&e.scripts_onBeforeRender.push(i),i.onAfterRender&&e.scripts_onAfterRender.push(i),i.onPausedChanged&&e.scripts_pausedChanged.push(i),vE(i,null)&&e.new_scripts_xr.push(i),vE(i,"immersive-vr")&&e.scripts_immersive_vr.push(i),vE(i,"immersive-ar")&&e.scripts_immersive_ar.push(i))}function Fl(i,e){xo(i,e.new_scripts),xo(i,e.new_script_start),xo(i,e.scripts),xo(i,e.scripts_earlyUpdate),xo(i,e.scripts_update),xo(i,e.scripts_lateUpdate),xo(i,e.scripts_onBeforeRender),xo(i,e.scripts_onAfterRender),xo(i,e.scripts_pausedChanged),xo(i,e.new_scripts_xr),xo(i,e.scripts_immersive_vr),xo(i,e.scripts_immersive_ar),e.stopAllCoroutinesFrom(i)}function xo(i,e){const t=e.indexOf(i);t>=0&&e.splice(t,1)}function vE(i,e){var t;if(i){const n=i;if(n.onBeforeXR||n.onEnterXR||n.onUpdateXR||n.onLeaveXR||n.onXRControllerAdded||n.onXRControllerRemoved)return!(e!=null&&((t=n.supportsXR)==null?void 0:t.call(n,e))===!1)}return!1}function ob(i){if(i||(i=li.Current.scene),!i){console.trace("Invalid call - no current context.");return}const e=Bp(i);Jk(i,e,!0)||(mE||pt()?console.error(`Error updating hierarchy
@@ -4844,7 +4844,7 @@ Please change to:
4844
4844
  ${a}? : Object3D;
4845
4845
 
4846
4846
  in script ${s}.ts
4847
- <a href="https://docs.needle.tools/serializable" target="_blank">documentation</a>`),console.warn(s,a,i[a],i);continue}}else if(!Array.isArray(l)&&((r=l.constructor)==null?void 0:r.name)==="Object"){const u='You might be missing a @serializable(Type) decorator for field "'+a+'" in '+s+".ts";console.warn(u+`
4847
+ <a href="https://docs.needle.tools/serializable" target="_blank">documentation</a>`),console.warn(s,a,i[a],i);continue}}else if(!Array.isArray(l)&&((r=l.constructor)==null?void 0:r.name)==="Object"&&!l.constructor["did_warn:missing_serializable"]){l.constructor["did_warn:missing_serializable"]=!0;const u='You might be missing a @serializable(Type) decorator for field "'+a+'" in '+s+".ts";console.warn(u+`
4848
4848
  `,c),Ra(Hs.Warn,"Deserialization issue: Please check the console for details!")}}if(typeof l=="string"&&(c.endsWith(".gltf")||c.endsWith(".glb"))){Ra(Hs.Warn,`<strong>Missing serialization for object reference!</strong>
4849
4849
 
4850
4850
  Please change to:
@@ -4322,7 +4322,7 @@ void main() {
4322
4322
  `;a+=n(o);const l=Object.keys(r);let c="";for(let u=0;u<l.length;u++){const d=l[u],f=r[d];if(_m.has(f)){c+="";continue}_m.set(f,!0),c+=d+":"+i(f,o+1),u<l.length-1&&(c+=", "),c.length>=60&&(c+=`
4323
4323
  `,c+=n(o),a+=c,c="")}return a+=c,a+=`
4324
4324
  }`,a}return r}function n(r){let o="";for(let a=0;a<r;a++)o+=" ";return o}}const KX=ne("nodevlogs");function cn(s,e=ro.Log){$a(e,s)}function $i(s){cn(s,ro.Warn)}function xN(s){cn(s,ro.Error)}let b1;function _t(){return KX?!1:b1!==void 0?b1:zr()}function ZX(s){b1=s}const hu=new fd,Xs=new w,Hc=new w,Yi=new Ce,I2={X:new w(1,0,0),Y:new w(0,1,0),Z:new w(0,0,1)},qS={type:"change"},R2={type:"mouseDown"},P2={type:"mouseUp",mode:null},B2={type:"objectChange"};class $X extends ge{constructor(e,t){super(),t===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),t=document),this.isTransformControls=!0,this.visible=!1,this.domElement=t,this.domElement.style.touchAction="none";const i=new bI;this._gizmo=i,this.add(i);const n=new rY;this._plane=n,this.add(n);const r=this;function o(_,y){let b=y;Object.defineProperty(r,_,{get:function(){return b!==void 0?b:y},set:function(E){b!==E&&(b=E,n[_]=E,i[_]=E,r.dispatchEvent({type:_+"-changed",value:E}),r.dispatchEvent(qS))}}),r[_]=y,n[_]=y,i[_]=y}o("camera",e),o("object",void 0),o("enabled",!0),o("axis",null),o("mode","translate"),o("translationSnap",null),o("rotationSnap",null),o("scaleSnap",null),o("space","world"),o("size",1),o("dragging",!1),o("showX",!0),o("showY",!0),o("showZ",!0);const a=new w,l=new w,c=new Ce,u=new Ce,d=new w,f=new Ce,p=new w,m=new w,A=new w,v=0,g=new w;o("worldPosition",a),o("worldPositionStart",l),o("worldQuaternion",c),o("worldQuaternionStart",u),o("cameraPosition",d),o("cameraQuaternion",f),o("pointStart",p),o("pointEnd",m),o("rotationAxis",A),o("rotationAngle",v),o("eye",g),this._offset=new w,this._startNorm=new w,this._endNorm=new w,this._cameraScale=new w,this._parentPosition=new w,this._parentQuaternion=new Ce,this._parentQuaternionInv=new Ce,this._parentScale=new w,this._worldScaleStart=new w,this._worldQuaternionInv=new Ce,this._worldScale=new w,this._positionStart=new w,this._quaternionStart=new Ce,this._scaleStart=new w,this._getPointer=eY.bind(this),this._onPointerDown=iY.bind(this),this._onPointerHover=tY.bind(this),this._onPointerMove=nY.bind(this),this._onPointerUp=sY.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;e!==null&&hu.setFromCamera(e,this.camera);const t=XS(this._gizmo.picker[this.mode],hu);t?this.axis=t.object.name:this.axis=null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e!=null&&e.button!==0)&&this.axis!==null){e!==null&&hu.setFromCamera(e,this.camera);const t=XS(this._plane,hu,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,R2.mode=this.mode,this.dispatchEvent(R2)}}pointerMove(e){const t=this.axis,i=this.mode,n=this.object;let r=this.space;if(i==="scale"?r="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(r="world"),n===void 0||t===null||this.dragging===!1||e!==null&&e.button!==-1)return;e!==null&&hu.setFromCamera(e,this.camera);const o=XS(this._plane,hu,!0);if(o){if(this.pointEnd.copy(o.point).sub(this.worldPositionStart),i==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),r==="local"&&t!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf("X")===-1&&(this._offset.x=0),t.indexOf("Y")===-1&&(this._offset.y=0),t.indexOf("Z")===-1&&(this._offset.z=0),r==="local"&&t!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),n.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(r==="local"&&(n.position.applyQuaternion(Yi.copy(this._quaternionStart).invert()),t.search("X")!==-1&&(n.position.x=Math.round(n.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(n.position.y=Math.round(n.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(n.position.z=Math.round(n.position.z/this.translationSnap)*this.translationSnap),n.position.applyQuaternion(this._quaternionStart)),r==="world"&&(n.parent&&n.position.add(Xs.setFromMatrixPosition(n.parent.matrixWorld)),t.search("X")!==-1&&(n.position.x=Math.round(n.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(n.position.y=Math.round(n.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(n.position.z=Math.round(n.position.z/this.translationSnap)*this.translationSnap),n.parent&&n.position.sub(Xs.setFromMatrixPosition(n.parent.matrixWorld))));else if(i==="scale"){if(t.search("XYZ")!==-1){let a=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(a*=-1),Hc.set(a,a,a)}else Xs.copy(this.pointStart),Hc.copy(this.pointEnd),Xs.applyQuaternion(this._worldQuaternionInv),Hc.applyQuaternion(this._worldQuaternionInv),Hc.divide(Xs),t.search("X")===-1&&(Hc.x=1),t.search("Y")===-1&&(Hc.y=1),t.search("Z")===-1&&(Hc.z=1);n.scale.copy(this._scaleStart).multiply(Hc),this.scaleSnap&&(t.search("X")!==-1&&(n.scale.x=Math.round(n.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Y")!==-1&&(n.scale.y=Math.round(n.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Z")!==-1&&(n.scale.z=Math.round(n.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(i==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const a=20/this.worldPosition.distanceTo(Xs.setFromMatrixPosition(this.camera.matrixWorld));let l=!1;t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(Xs.copy(this.rotationAxis).cross(this.eye))*a):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(I2[t]),Xs.copy(I2[t]),r==="local"&&Xs.applyQuaternion(this.worldQuaternion),Xs.cross(this.eye),Xs.length()===0?l=!0:this.rotationAngle=this._offset.dot(Xs.normalize())*a),(t==="E"||l)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),r==="local"&&t!=="E"&&t!=="XYZE"?(n.quaternion.copy(this._quaternionStart),n.quaternion.multiply(Yi.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),n.quaternion.copy(Yi.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),n.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(qS),this.dispatchEvent(B2)}}pointerUp(e){e!==null&&e.button!==0||(this.dragging&&this.axis!==null&&(P2.mode=this.mode,this.dispatchEvent(P2)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}attach(e){return this.object=e,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(qS),this.dispatchEvent(B2),this.pointStart.copy(this.pointEnd))}getRaycaster(){return hu}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}}function eY(s){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:s.button};{const e=this.domElement.getBoundingClientRect();return{x:(s.clientX-e.left)/e.width*2-1,y:-(s.clientY-e.top)/e.height*2+1,button:s.button}}}function tY(s){if(this.enabled)switch(s.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(s));break}}function iY(s){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(s.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(s)),this.pointerDown(this._getPointer(s)))}function nY(s){this.enabled&&this.pointerMove(this._getPointer(s))}function sY(s){this.enabled&&(this.domElement.releasePointerCapture(s.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(s)))}function XS(s,e,t){const i=e.intersectObject(s,!0);for(let n=0;n<i.length;n++)if(i[n].object.visible||t)return i[n];return!1}const l0=new zi,Ri=new w(0,1,0),D2=new w(0,0,0),O2=new we,c0=new Ce,c_=new Ce,Ra=new w,L2=new we,Km=new w(1,0,0),Eu=new w(0,1,0),Zm=new w(0,0,1),h0=new w,bm=new w,xm=new w;class bI extends ge{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const e=new ai({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new In({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),i=e.clone();i.opacity=.15;const n=t.clone();n.opacity=.5;const r=e.clone();r.color.setHex(16711680);const o=e.clone();o.color.setHex(65280);const a=e.clone();a.color.setHex(255);const l=e.clone();l.color.setHex(16711680),l.opacity=.5;const c=e.clone();c.color.setHex(65280),c.opacity=.5;const u=e.clone();u.color.setHex(255),u.opacity=.5;const d=e.clone();d.opacity=.25;const f=e.clone();f.color.setHex(16776960),f.opacity=.25,e.clone().color.setHex(16776960);const m=e.clone();m.color.setHex(7895160);const A=new Sn(0,.04,.1,12);A.translate(0,.05,0);const v=new Oi(.08,.08,.08);v.translate(0,.04,0);const g=new wt;g.setAttribute("position",new ut([0,0,0,1,0,0],3));const _=new Sn(.0075,.0075,.5,3);_.translate(0,.25,0);function y(V,L){const k=new Jl(V,.0075,3,64,L*Math.PI*2);return k.rotateY(Math.PI/2),k.rotateX(Math.PI/2),k}function b(){const V=new wt;return V.setAttribute("position",new ut([0,0,0,1,1,1],3)),V}const E={X:[[new pe(A,r),[.5,0,0],[0,0,-Math.PI/2]],[new pe(A,r),[-.5,0,0],[0,0,Math.PI/2]],[new pe(_,r),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new pe(A,o),[0,.5,0]],[new pe(A,o),[0,-.5,0],[Math.PI,0,0]],[new pe(_,o)]],Z:[[new pe(A,a),[0,0,.5],[Math.PI/2,0,0]],[new pe(A,a),[0,0,-.5],[-Math.PI/2,0,0]],[new pe(_,a),null,[Math.PI/2,0,0]]],XYZ:[[new pe(new ic(.1,0),d.clone()),[0,0,0]]],XY:[[new pe(new Oi(.15,.15,.01),u.clone()),[.15,.15,0]]],YZ:[[new pe(new Oi(.15,.15,.01),l.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new pe(new Oi(.15,.15,.01),c.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},M={X:[[new pe(new Sn(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new pe(new Sn(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new pe(new Sn(.2,0,.6,4),i),[0,.3,0]],[new pe(new Sn(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new pe(new Sn(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new pe(new Sn(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new pe(new ic(.2,0),i)]],XY:[[new pe(new Oi(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new pe(new Oi(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new pe(new Oi(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]]},T={START:[[new pe(new ic(.01,2),n),null,null,null,"helper"]],END:[[new pe(new ic(.01,2),n),null,null,null,"helper"]],DELTA:[[new En(b(),n),null,null,null,"helper"]],X:[[new En(g,n.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new En(g,n.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new En(g,n.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},C={XYZE:[[new pe(y(.5,1),m),null,[0,Math.PI/2,0]]],X:[[new pe(y(.5,.5),r)]],Y:[[new pe(y(.5,.5),o),null,[0,0,-Math.PI/2]]],Z:[[new pe(y(.5,.5),a),null,[0,Math.PI/2,0]]],E:[[new pe(y(.75,1),f),null,[0,Math.PI/2,0]]]},B={AXIS:[[new En(g,n.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},S={XYZE:[[new pe(new Sa(.25,10,8),i)]],X:[[new pe(new Jl(.5,.1,4,24),i),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new pe(new Jl(.5,.1,4,24),i),[0,0,0],[Math.PI/2,0,0]]],Z:[[new pe(new Jl(.5,.1,4,24),i),[0,0,0],[0,0,-Math.PI/2]]],E:[[new pe(new Jl(.75,.1,2,24),i)]]},R={X:[[new pe(v,r),[.5,0,0],[0,0,-Math.PI/2]],[new pe(_,r),[0,0,0],[0,0,-Math.PI/2]],[new pe(v,r),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new pe(v,o),[0,.5,0]],[new pe(_,o)],[new pe(v,o),[0,-.5,0],[0,0,Math.PI]]],Z:[[new pe(v,a),[0,0,.5],[Math.PI/2,0,0]],[new pe(_,a),[0,0,0],[Math.PI/2,0,0]],[new pe(v,a),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new pe(new Oi(.15,.15,.01),u),[.15,.15,0]]],YZ:[[new pe(new Oi(.15,.15,.01),l),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new pe(new Oi(.15,.15,.01),c),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new pe(new Oi(.1,.1,.1),d.clone())]]},Q={X:[[new pe(new Sn(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new pe(new Sn(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new pe(new Sn(.2,0,.6,4),i),[0,.3,0]],[new pe(new Sn(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new pe(new Sn(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new pe(new Sn(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new pe(new Oi(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new pe(new Oi(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new pe(new Oi(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new pe(new Oi(.2,.2,.2),i),[0,0,0]]]},z={X:[[new En(g,n.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new En(g,n.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new En(g,n.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function O(V){const L=new ge;for(const k in V)for(let G=V[k].length;G--;){const Y=V[k][G][0].clone(),$=V[k][G][1],re=V[k][G][2],ce=V[k][G][3],Re=V[k][G][4];Y.name=k,Y.tag=Re,$&&Y.position.set($[0],$[1],$[2]),re&&Y.rotation.set(re[0],re[1],re[2]),ce&&Y.scale.set(ce[0],ce[1],ce[2]),Y.updateMatrix();const ie=Y.geometry.clone();ie.applyMatrix4(Y.matrix),Y.geometry=ie,Y.renderOrder=1/0,Y.position.set(0,0,0),Y.rotation.set(0,0,0),Y.scale.set(1,1,1),L.add(Y)}return L}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=O(E)),this.add(this.gizmo.rotate=O(C)),this.add(this.gizmo.scale=O(R)),this.add(this.picker.translate=O(M)),this.add(this.picker.rotate=O(S)),this.add(this.picker.scale=O(Q)),this.add(this.helper.translate=O(T)),this.add(this.helper.rotate=O(B)),this.add(this.helper.scale=O(z)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){const i=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:c_;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let r=0;r<n.length;r++){const o=n[r];o.visible=!0,o.rotation.set(0,0,0),o.position.copy(this.worldPosition);let a;if(this.camera.isOrthographicCamera?a=(this.camera.top-this.camera.bottom)/this.camera.zoom:a=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),o.scale.set(1,1,1).multiplyScalar(a*this.size/4),o.tag==="helper"){o.visible=!1,o.name==="AXIS"?(o.visible=!!this.axis,this.axis==="X"&&(Yi.setFromEuler(l0.set(0,0,0)),o.quaternion.copy(i).multiply(Yi),Math.abs(Ri.copy(Km).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Y"&&(Yi.setFromEuler(l0.set(0,0,Math.PI/2)),o.quaternion.copy(i).multiply(Yi),Math.abs(Ri.copy(Eu).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Z"&&(Yi.setFromEuler(l0.set(0,Math.PI/2,0)),o.quaternion.copy(i).multiply(Yi),Math.abs(Ri.copy(Zm).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="XYZE"&&(Yi.setFromEuler(l0.set(0,Math.PI/2,0)),Ri.copy(this.rotationAxis),o.quaternion.setFromRotationMatrix(O2.lookAt(D2,Ri,Eu)),o.quaternion.multiply(Yi),o.visible=this.dragging),this.axis==="E"&&(o.visible=!1)):o.name==="START"?(o.position.copy(this.worldPositionStart),o.visible=this.dragging):o.name==="END"?(o.position.copy(this.worldPosition),o.visible=this.dragging):o.name==="DELTA"?(o.position.copy(this.worldPositionStart),o.quaternion.copy(this.worldQuaternionStart),Xs.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Xs.applyQuaternion(this.worldQuaternionStart.clone().invert()),o.scale.copy(Xs),o.visible=this.dragging):(o.quaternion.copy(i),this.dragging?o.position.copy(this.worldPositionStart):o.position.copy(this.worldPosition),this.axis&&(o.visible=this.axis.search(o.name)!==-1));continue}o.quaternion.copy(i),this.mode==="translate"||this.mode==="scale"?(o.name==="X"&&Math.abs(Ri.copy(Km).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Y"&&Math.abs(Ri.copy(Eu).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Z"&&Math.abs(Ri.copy(Zm).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XY"&&Math.abs(Ri.copy(Zm).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="YZ"&&Math.abs(Ri.copy(Km).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XZ"&&Math.abs(Ri.copy(Eu).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1)):this.mode==="rotate"&&(c0.copy(i),Ri.copy(this.eye).applyQuaternion(Yi.copy(i).invert()),o.name.search("E")!==-1&&o.quaternion.setFromRotationMatrix(O2.lookAt(this.eye,D2,Eu)),o.name==="X"&&(Yi.setFromAxisAngle(Km,Math.atan2(-Ri.y,Ri.z)),Yi.multiplyQuaternions(c0,Yi),o.quaternion.copy(Yi)),o.name==="Y"&&(Yi.setFromAxisAngle(Eu,Math.atan2(Ri.x,Ri.z)),Yi.multiplyQuaternions(c0,Yi),o.quaternion.copy(Yi)),o.name==="Z"&&(Yi.setFromAxisAngle(Zm,Math.atan2(Ri.y,Ri.x)),Yi.multiplyQuaternions(c0,Yi),o.quaternion.copy(Yi))),o.visible=o.visible&&(o.name.indexOf("X")===-1||this.showX),o.visible=o.visible&&(o.name.indexOf("Y")===-1||this.showY),o.visible=o.visible&&(o.name.indexOf("Z")===-1||this.showZ),o.visible=o.visible&&(o.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),o.material._color=o.material._color||o.material.color.clone(),o.material._opacity=o.material._opacity||o.material.opacity,o.material.color.copy(o.material._color),o.material.opacity=o.material._opacity,this.enabled&&this.axis&&(o.name===this.axis||this.axis.split("").some(function(l){return o.name===l}))&&(o.material.color.setHex(16776960),o.material.opacity=1)}super.updateMatrixWorld(e)}}class rY extends pe{constructor(){super(new Nn(1e5,1e5,2,2),new ai({visible:!1,wireframe:!0,side:mi,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(t="local"),h0.copy(Km).applyQuaternion(t==="local"?this.worldQuaternion:c_),bm.copy(Eu).applyQuaternion(t==="local"?this.worldQuaternion:c_),xm.copy(Zm).applyQuaternion(t==="local"?this.worldQuaternion:c_),Ri.copy(bm),this.mode){case"translate":case"scale":switch(this.axis){case"X":Ri.copy(this.eye).cross(h0),Ra.copy(h0).cross(Ri);break;case"Y":Ri.copy(this.eye).cross(bm),Ra.copy(bm).cross(Ri);break;case"Z":Ri.copy(this.eye).cross(xm),Ra.copy(xm).cross(Ri);break;case"XY":Ra.copy(xm);break;case"YZ":Ra.copy(h0);break;case"XZ":Ri.copy(xm),Ra.copy(bm);break;case"XYZ":case"E":Ra.set(0,0,0);break}break;case"rotate":default:Ra.set(0,0,0)}Ra.length()===0?this.quaternion.copy(this.cameraQuaternion):(L2.lookAt(Xs.set(0,0,0),Ra,Ri),this.quaternion.setFromRotationMatrix(L2)),super.updateMatrixWorld(e)}}const oY=ne("debugpatch");function Ux(s,e,t,i){const n=oY===e;if(!t&&!i)return;const r=e+"___needle";lY(s,e,t,i);const o=Object.getOwnPropertyDescriptor(s,e),a=s[e];n&&console.log("Patch",s.constructor.name,e,o,a),o?(n&&console.log("Apply patch with existing descriptor",s.constructor.name,e,o),typeof o.value=="function"&&(s[e]=F2(o.value,s,e))):(n&&console.log("Create patch with new property",s.constructor.name,e,o),Object.defineProperty(s,e,{set:function(l){if(typeof l=="function")this[r]=F2(l,s,e);else{const c=this[r];wN(s,e,this,c,l),this[r]=l,SN(s,e,this,c,l)}},get:function(){const l=this[r];return typeof l=="function"&&l[r]?l[r]:l}}))}function aY(s,e,t){const i=xI(s,e);if(i)for(let n=i.length-1;n>=0;n--){const r=i[n];r.prefix===t&&(r.prefix=null),r.postfix===t&&(r.postfix=null),!r.prefix&&!r.postfix&&i.splice(n,1)}}const k2=Symbol("Needle:Patches:WrappedFunction");function F2(s,e,t){if(s[k2])return s;const i=function(...n){wN(e,t,this,...n);const r=s.apply(this,n);return SN(e,t,this,r,...n),r};return i[k2]=!0,i}const h_="Needle:Patches";function x1(){return globalThis[h_]||(globalThis[h_]=new WeakMap),globalThis[h_]}function xI(s,e){const t=x1().get(s);return t?t.get(e):null}function lY(s,e,t,i){let n=x1().get(s);n||(n=new Map,x1().set(s,n));let r=n.get(e);r||(r=[],n.set(e,r)),r.push({prefix:t,postfix:i})}function wN(s,e,t,...i){var r;if(!t)return;const n=xI(s,e);if(n)for(const o of n)(r=o.prefix)==null||r.call(t,...i)}function SN(s,e,t,i,...n){var o;if(!t)return;const r=xI(s,e);if(r)for(const a of r)(o=a.postfix)==null||o.call(t,i,...n)}const U2=Symbol("gltf-loader-internal-usage-tracker"),cY=ne("debugusers"),zg=class{constructor(e){h(this,"parser");h(this,"_getDependency");h(this,"_loadingId");h(this,"_loadedObjects",new Set);this.parser=e,this._getDependency=this.parser.getDependency,this._loadingId=Date.now().toString()}get name(){return"NEEDLE_internal_usage_tracker"}static isLoading(e){return zg._loadingProcesses>0}beforeRoot(){zg._loadingProcesses++;const e=this,t=this._getDependency;return this.parser.getDependency=function(i,n){const r=t.call(this,i,n);return r.then(o=>(o&&(e._loadedObjects.add(o),o[U2]=e._loadingId),o)),r},null}afterRoot(e){zg._loadingProcesses--,this.parser.getDependency=this._getDependency;for(const t of this._loadedObjects)delete t[U2],t instanceof ge&&(t.parent||t instanceof pe&&(cY&&console.warn("> GLTF LOADER: Mesh not used in scene!",t),t.material=null,t.geometry=null));return null}};let _g=zg;h(_g,"_loadingProcesses",0);class CN{constructor(){window.addEventListener("unhandledrejection",e=>{var i;if(e.defaultPrevented)return;const t=(i=e==null?void 0:e.reason)==null?void 0:i.path;if(t){const n=t[0];n&&n.tagName==="IMG"&&(console.warn(`Could not load image:
4325
- `+n.src),e.preventDefault())}})}}const Nx=ne("trackresources");function EN(){return Nx==="dispose"}let md=!0;Nx===0&&(md=!1);function hY(s){md=s}function MN(){return md}const TN=Symbol("disposable");function wI(s,e){s&&(s[TN]=e,Wu&&console.warn("Set disposable",e,s))}const IN=Symbol("disposed");function uY(s){return s[IN]===!0}function Bi(s){var e;if(s){if(s[TN]===!1){Wu&&console.warn("Object is marked as not disposable",s);return}if(s[IN]=!0,s instanceof tr)Bi(s.environment),Bi(s.background),Bi(s.customDepthMaterial),Bi(s.customDistanceMaterial);else if(s instanceof ma)Bi(s.geometry),Bi(s.material),Bi(s.skeleton),Bi(s.bindMatrix),Bi(s.bindMatrixInverse),Bi(s.customDepthMaterial),Bi(s.customDistanceMaterial),s.geometry=null,s.material=null;else if(s instanceof pe)Bi(s.geometry),Bi(s.material),Bi(s.customDepthMaterial),Bi(s.customDistanceMaterial),s.geometry=null,s.material=null;else if(s instanceof wt){hf(s);for(const t of Object.keys(s.attributes)){const i=s.attributes[t];Bi(i)}}else if(s instanceof it||s instanceof xr)Wu&&console.warn("BufferAttribute dispose not supported",s.count);else if(s instanceof Array)for(const t of s)t instanceof Nt&&Bi(t);else if(s instanceof Nt){hf(s);for(const i of Object.keys(s)){const n=s[i];n instanceof Dt&&(Bi(n),s[i]=null)}const t=s.uniforms;if(t)for(const i of Object.keys(t)){const n=t[i];n instanceof Dt?(Bi(n),t[i]=null):n instanceof _e&&(Bi(n.value),n.value=null)}}else s instanceof Dt?(hf(s),hf(s.source),((e=s.source)==null?void 0:e.data)instanceof ImageBitmap&&hf(s.source.data)):s instanceof Ip?(hf(s.boneTexture),s.boneTexture=null):s instanceof jv||!(s instanceof ge)&&Wu&&console.warn("Unknown object type",s)}}function hf(s){s&&((Wu||EN()||Nx)&&console.warn("🧨 FREE",s),s instanceof ImageBitmap?s.close():s instanceof tc?s.data=null:s.dispose())}function RN(s){(s instanceof pe||s instanceof ma)&&(s.material=null,s.geometry=null)}const dY=new Set;function SI(s,e,t=null,i){if(i||(i=dY,i.clear()),!s)return i;const n=s[pv];if(n)for(const r of n)i.has(r)||(t==null?void 0:t.call(null,r))!==!1&&(i.add(r),e&&SI(r,!0,t,i));return i}function fY(s){return s[$m]}const Wu=ne("debugresourceusers")||ne("debugmemory"),pv=Symbol("needle-resource-users"),$m=Symbol("needle-resource-users-count");function lr(s,e){Ux(s,e,function(t,i){md&&(cb(pv,this,t,!1),cb(pv,this,i,!0))})}md&&(lr(pe.prototype,"material"),lr(pe.prototype,"geometry"),lr(Nt.prototype,"map"),lr(Nt.prototype,"bumpMap"),lr(Nt.prototype,"alphaMap"),lr(Nt.prototype,"normalMap"),lr(Nt.prototype,"displacementMap"),lr(Nt.prototype,"roughnessMap"),lr(Nt.prototype,"metalnessMap"),lr(Nt.prototype,"emissiveMap"),lr(Nt.prototype,"specularMap"),lr(Nt.prototype,"envMap"),lr(Nt.prototype,"lightMap"),lr(Nt.prototype,"aoMap"),lr(Nt.prototype,"gradientMap"));function pY(s){if(md===!1)return;const e=s[pv];if(e)for(const t of e)cb(pv,t,s,!1)}md&&Ux(Nt.prototype,"dispose",function(){pY(this)});let w1=0;function cb(s,e,t,i){if(w1>0)return;if(Array.isArray(t)){for(const r of t)cb(s,e,r,i);return}if(!t)return;let n=t[s];if(n||(n=new Set),i){if(e&&!n.has(e)){n.add(e);let r=t[$m]||0;r+=1,t[$m]=r,Wu&&console.warn(`🟢 Added user of "${t.type}"`,e,t,r,"users:",n)}}else if(e&&n.has(e)){n.delete(e);let r=t[$m]||0;r>0&&(r-=1,t[$m]=r),Wu&&console.warn(`🔴 Removed user of "${t.type}"`,e,t,r,"users:",n),r<=0&&(_g.isLoading(t)||(Nx&&console.warn(`🔴 Removed all user of "${t.type}"`,t),EN()&&Bi(t)))}t[s]=n}try{Ux(yc.prototype,"render",function(){w1++},function(){w1--})}catch(s){console.warn("Could not wrap WebGLRenderer.render",s)}var nA=(s=>(s.Added="component-added",s.Removing="removing-component",s))(nA||{});const N2=ne("debugcomponentevents");class sA{static addComponentLifecylceEventListener(e,t){this.eventListeners.has(e)&&this.eventListeners.set(e,[]);let i=this.eventListeners.get(e);i||(i=[]),i.push(t),this.eventListeners.set(e,i),N2&&console.log("Added event listener for "+e,this.eventListeners)}static removeComponentLifecylceEventListener(e,t){const i=this.eventListeners.get(e);if(!i)return;const n=i.indexOf(t);n<0||i.splice(n,1)}static dispatchComponentLifecycleEvent(e,t){const i=this.eventListeners.get(e);if(N2&&console.log("Dispatching event "+e,i),!!i)for(const n of i)n(t)}}h(sA,"eventListeners",new Map);const PN=ne("debugdefines");Bp('if(!globalThis[""3.34.0-alpha.1""]) globalThis[""3.34.0-alpha.1""] = "0.0.0";');Bp('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";');Bp('if(!globalThis[""Thu Mar 07 2024 01:47:51 GMT+0800 (Pacific Standard Time)""]) globalThis[""Thu Mar 07 2024 01:47:51 GMT+0800 (Pacific Standard Time)""] = "unknown";');Bp('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.34.0-alpha.1";');Bp('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');Bp('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Mar 07 2024 01:47:51 GMT+0800 (Pacific Standard Time)";');const tl="3.34.0-alpha.1",zx="undefined",CI="Thu Mar 07 2024 01:47:51 GMT+0800 (Pacific Standard Time)";PN&&console.log(`Engine version: ${tl} (generator: ${zx})
4325
+ `+n.src),e.preventDefault())}})}}const Nx=ne("trackresources");function EN(){return Nx==="dispose"}let md=!0;Nx===0&&(md=!1);function hY(s){md=s}function MN(){return md}const TN=Symbol("disposable");function wI(s,e){s&&(s[TN]=e,Wu&&console.warn("Set disposable",e,s))}const IN=Symbol("disposed");function uY(s){return s[IN]===!0}function Bi(s){var e;if(s){if(s[TN]===!1){Wu&&console.warn("Object is marked as not disposable",s);return}if(s[IN]=!0,s instanceof tr)Bi(s.environment),Bi(s.background),Bi(s.customDepthMaterial),Bi(s.customDistanceMaterial);else if(s instanceof ma)Bi(s.geometry),Bi(s.material),Bi(s.skeleton),Bi(s.bindMatrix),Bi(s.bindMatrixInverse),Bi(s.customDepthMaterial),Bi(s.customDistanceMaterial),s.geometry=null,s.material=null;else if(s instanceof pe)Bi(s.geometry),Bi(s.material),Bi(s.customDepthMaterial),Bi(s.customDistanceMaterial),s.geometry=null,s.material=null;else if(s instanceof wt){hf(s);for(const t of Object.keys(s.attributes)){const i=s.attributes[t];Bi(i)}}else if(s instanceof it||s instanceof xr)Wu&&console.warn("BufferAttribute dispose not supported",s.count);else if(s instanceof Array)for(const t of s)t instanceof Nt&&Bi(t);else if(s instanceof Nt){hf(s);for(const i of Object.keys(s)){const n=s[i];n instanceof Dt&&(Bi(n),s[i]=null)}const t=s.uniforms;if(t)for(const i of Object.keys(t)){const n=t[i];n instanceof Dt?(Bi(n),t[i]=null):n instanceof _e&&(Bi(n.value),n.value=null)}}else s instanceof Dt?(hf(s),hf(s.source),((e=s.source)==null?void 0:e.data)instanceof ImageBitmap&&hf(s.source.data)):s instanceof Ip?(hf(s.boneTexture),s.boneTexture=null):s instanceof jv||!(s instanceof ge)&&Wu&&console.warn("Unknown object type",s)}}function hf(s){s&&((Wu||EN()||Nx)&&console.warn("🧨 FREE",s),s instanceof ImageBitmap?s.close():s instanceof tc?s.data=null:s.dispose())}function RN(s){(s instanceof pe||s instanceof ma)&&(s.material=null,s.geometry=null)}const dY=new Set;function SI(s,e,t=null,i){if(i||(i=dY,i.clear()),!s)return i;const n=s[pv];if(n)for(const r of n)i.has(r)||(t==null?void 0:t.call(null,r))!==!1&&(i.add(r),e&&SI(r,!0,t,i));return i}function fY(s){return s[$m]}const Wu=ne("debugresourceusers")||ne("debugmemory"),pv=Symbol("needle-resource-users"),$m=Symbol("needle-resource-users-count");function lr(s,e){Ux(s,e,function(t,i){md&&(cb(pv,this,t,!1),cb(pv,this,i,!0))})}md&&(lr(pe.prototype,"material"),lr(pe.prototype,"geometry"),lr(Nt.prototype,"map"),lr(Nt.prototype,"bumpMap"),lr(Nt.prototype,"alphaMap"),lr(Nt.prototype,"normalMap"),lr(Nt.prototype,"displacementMap"),lr(Nt.prototype,"roughnessMap"),lr(Nt.prototype,"metalnessMap"),lr(Nt.prototype,"emissiveMap"),lr(Nt.prototype,"specularMap"),lr(Nt.prototype,"envMap"),lr(Nt.prototype,"lightMap"),lr(Nt.prototype,"aoMap"),lr(Nt.prototype,"gradientMap"));function pY(s){if(md===!1)return;const e=s[pv];if(e)for(const t of e)cb(pv,t,s,!1)}md&&Ux(Nt.prototype,"dispose",function(){pY(this)});let w1=0;function cb(s,e,t,i){if(w1>0)return;if(Array.isArray(t)){for(const r of t)cb(s,e,r,i);return}if(!t)return;let n=t[s];if(n||(n=new Set),i){if(e&&!n.has(e)){n.add(e);let r=t[$m]||0;r+=1,t[$m]=r,Wu&&console.warn(`🟢 Added user of "${t.type}"`,e,t,r,"users:",n)}}else if(e&&n.has(e)){n.delete(e);let r=t[$m]||0;r>0&&(r-=1,t[$m]=r),Wu&&console.warn(`🔴 Removed user of "${t.type}"`,e,t,r,"users:",n),r<=0&&(_g.isLoading(t)||(Nx&&console.warn(`🔴 Removed all user of "${t.type}"`,t),EN()&&Bi(t)))}t[s]=n}try{Ux(yc.prototype,"render",function(){w1++},function(){w1--})}catch(s){console.warn("Could not wrap WebGLRenderer.render",s)}var nA=(s=>(s.Added="component-added",s.Removing="removing-component",s))(nA||{});const N2=ne("debugcomponentevents");class sA{static addComponentLifecylceEventListener(e,t){this.eventListeners.has(e)&&this.eventListeners.set(e,[]);let i=this.eventListeners.get(e);i||(i=[]),i.push(t),this.eventListeners.set(e,i),N2&&console.log("Added event listener for "+e,this.eventListeners)}static removeComponentLifecylceEventListener(e,t){const i=this.eventListeners.get(e);if(!i)return;const n=i.indexOf(t);n<0||i.splice(n,1)}static dispatchComponentLifecycleEvent(e,t){const i=this.eventListeners.get(e);if(N2&&console.log("Dispatching event "+e,i),!!i)for(const n of i)n(t)}}h(sA,"eventListeners",new Map);const PN=ne("debugdefines");Bp('if(!globalThis[""3.34.0-alpha.2""]) globalThis[""3.34.0-alpha.2""] = "0.0.0";');Bp('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";');Bp('if(!globalThis[""Thu Mar 07 2024 14:14:37 GMT+0100 (Central European Standard Time)""]) globalThis[""Thu Mar 07 2024 14:14:37 GMT+0100 (Central European Standard Time)""] = "unknown";');Bp('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.34.0-alpha.2";');Bp('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');Bp('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Mar 07 2024 14:14:37 GMT+0100 (Central European Standard Time)";');const tl="3.34.0-alpha.2",zx="undefined",CI="Thu Mar 07 2024 14:14:37 GMT+0100 (Central European Standard Time)";PN&&console.log(`Engine version: ${tl} (generator: ${zx})
4326
4326
  Project built at ${CI}`);const cc="needle_isActiveInHierarchy",Iu="builtin_components",bg="needle_editor_guid";function Bp(s){try{(0,eval)(s)}catch(e){PN&&console.error(e)}}const mv=Symbol("NEEDLE_NEED_UPDATE_INSTANCE"),BN=Symbol("isUsingInstancing"),DN=Symbol("instancingRenderer"),S1=Symbol("instancingAutoUpdateBounds");class va{static isUsingInstancing(e){return e[BN]===!0}static getRenderer(e){return e[DN]||null}setAutoUpdateBounds(e,t){const i=va.getRenderer(e);i&&(i[S1]=t)}static markDirty(e,t=!0){if(e&&(this.isUsingInstancing(e)&&(e[mv]=!0,e.matrixWorldNeedsUpdate=!0),t))for(const i of e.children)va.markDirty(i,!0)}}function qu(s,e){try{e?s(e):s()}catch(t){return console.error(t),!1}return!0}const C1=ne("debugnewscripts"),mY=ne("debughierarchy"),qi=[];function gY(){return qi.length>0}function hb(s){if(!(s.new_scripts.length<=0)){if(C1&&console.log("Register new components",s.new_scripts.length,[...s.new_scripts],s.alias?"element: "+s.alias:s.hash,s),s.new_scripts_pre_setup_callbacks.length>0){for(const e of s.new_scripts_pre_setup_callbacks)e&&e();s.new_scripts_pre_setup_callbacks.length=0}qi.length=0,s.new_scripts.length>0&&qi.push(...s.new_scripts),s.new_scripts.length=0;for(let e=0;e<qi.length;e++)try{const t=qi[e];if(t.isComponent!==!0){(_t()||C1)&&console.error(`Registered script is not a Needle Engine component.
4327
4327
  The script will be ignored. Please make sure your component extends "Behaviour" imported from "@needle-tools/engine"
4328
4328
  `,t),qi.splice(e,1),e--;continue}if(t.destroyed)continue;if(!t.gameObject){console.error("MISSING GAMEOBJECT - will ignore",t),qi.splice(e,1),e--;continue}t.context=s,xg(t.gameObject),EI(t,s)}catch(t){console.error(t),Kl(qi[e],s),qi.splice(e,1),e--}for(let e=0;e<qi.length;e++)try{const t=qi[e];if(t.destroyed){Kl(qi[e],s),qi.splice(e,1),e--;continue}if(t.registering)try{t.registering()}catch(i){console.error(i)}t.__internalAwake!==void 0&&(t.gameObject||console.error("MISSING GAMEOBJECT",t,t.gameObject),xg(t.gameObject),t.activeAndEnabled&&qu(t.__internalAwake.bind(t)))}catch(t){console.error(t),Kl(qi[e],s),qi.splice(e,1),e--}for(let e=0;e<qi.length;e++)try{const t=qi[e];if(t.destroyed||t.enabled===!1||(xg(t.gameObject),t.activeAndEnabled===!1))continue;t.__internalEnable!==void 0&&(t.enabled=!0,qu(t.__internalEnable.bind(t)))}catch(t){console.error(t),Kl(qi[e],s),qi.splice(e,1),e--}for(let e=0;e<qi.length;e++)try{const t=qi[e];if(t.destroyed||!t.gameObject)continue;s.new_script_start.push(t)}catch(t){console.error(t),Kl(qi[e],s),qi.splice(e,1),e--}qi.length=0;for(const e of s.new_scripts_post_setup_callbacks)e&&e();s.new_scripts_post_setup_callbacks.length=0}}function vY(s){s&&(s.__internalDisable(!0),Kl(s,s.context))}function ON(s,e){for(let t=0;t<s.new_script_start.length;t++)try{const i=s.new_script_start[t];if(e!==void 0&&i.gameObject!==e||i.destroyed||i.activeAndEnabled===!1)continue;qu(i.__internalAwake.bind(i)),i.enabled&&(qu(i.__internalEnable.bind(i)),qu(i.__internalStart.bind(i)),s.new_script_start.splice(t,1),t--)}catch(i){console.error(i),Kl(s.new_script_start[t],s),s.new_script_start.splice(t,1),t--}}function EI(s,e){e.scripts.indexOf(s)===-1&&(e.scripts.push(s),s.earlyUpdate&&e.scripts_earlyUpdate.push(s),s.update&&e.scripts_update.push(s),s.lateUpdate&&e.scripts_lateUpdate.push(s),s.onBeforeRender&&e.scripts_onBeforeRender.push(s),s.onAfterRender&&e.scripts_onAfterRender.push(s),s.onPausedChanged&&e.scripts_pausedChanged.push(s),YS(s,null)&&e.new_scripts_xr.push(s),YS(s,"immersive-vr")&&e.scripts_immersive_vr.push(s),YS(s,"immersive-ar")&&e.scripts_immersive_ar.push(s))}function Kl(s,e){Co(s,e.new_scripts),Co(s,e.new_script_start),Co(s,e.scripts),Co(s,e.scripts_earlyUpdate),Co(s,e.scripts_update),Co(s,e.scripts_lateUpdate),Co(s,e.scripts_onBeforeRender),Co(s,e.scripts_onAfterRender),Co(s,e.scripts_pausedChanged),Co(s,e.new_scripts_xr),Co(s,e.scripts_immersive_vr),Co(s,e.scripts_immersive_ar),e.stopAllCoroutinesFrom(s)}function Co(s,e){const t=e.indexOf(s);t>=0&&e.splice(t,1)}function YS(s,e){var t;if(s){const i=s;if(i.onBeforeXR||i.onEnterXR||i.onUpdateXR||i.onLeaveXR||i.onXRControllerAdded||i.onXRControllerRemoved)return!(e!=null&&((t=i.supportsXR)==null?void 0:t.call(i,e))===!1)}return!1}function u_(s){if(s||(s=hi.Current.scene),!s){console.trace("Invalid call - no current context.");return}const e=Op(s);LN(s,e,!0)||(C1||_t()?console.error(`Error updating hierarchy
@@ -4844,7 +4844,7 @@ Please change to:
4844
4844
  ${a}? : Object3D;
4845
4845
 
4846
4846
  in script ${i}.ts
4847
- <a href="https://docs.needle.tools/serializable" target="_blank">documentation</a>`),console.warn(i,a,s[a],s);continue}}else if(!Array.isArray(l)&&((o=l.constructor)==null?void 0:o.name)==="Object"){const d='You might be missing a @serializable(Type) decorator for field "'+a+'" in '+i+".ts";console.warn(d+`
4847
+ <a href="https://docs.needle.tools/serializable" target="_blank">documentation</a>`),console.warn(i,a,s[a],s);continue}}else if(!Array.isArray(l)&&((o=l.constructor)==null?void 0:o.name)==="Object"&&!l.constructor["did_warn:missing_serializable"]){l.constructor["did_warn:missing_serializable"]=!0;const d='You might be missing a @serializable(Type) decorator for field "'+a+'" in '+i+".ts";console.warn(d+`
4848
4848
  `,c),$a(ro.Warn,"Deserialization issue: Please check the console for details!")}}if(typeof l=="string"&&(c.endsWith(".gltf")||c.endsWith(".glb"))){$a(ro.Warn,`<strong>Missing serialization for object reference!</strong>
4849
4849
 
4850
4850
  Please change to:
@@ -4322,7 +4322,7 @@ void main() {
4322
4322
  `;s+=g(o);const C=Object.keys(I);let a="";for(let r=0;r<C.length;r++){const B=C[r],Q=I[B];if(Gc.has(Q)){a+="";continue}Gc.set(Q,!0),a+=B+":"+i(Q,o+1),r<C.length-1&&(a+=", "),a.length>=60&&(a+=`
4323
4323
  `,a+=g(o),s+=a,a="")}return s+=a,s+=`
4324
4324
  }`,s}return I}function g(I){let o="";for(let s=0;s<I;s++)o+=" ";return o}}const m9=tA("nodevlogs");function ii(t,A=Ao.Log){Ts(A,t)}function Wt(t){ii(t,Ao.Warn)}function lL(t){ii(t,Ao.Error)}let fM;function he(){return m9?!1:fM!==void 0?fM:bI()}function k9(t){fM=t}const Pr=new br,Xg=new S,on=new S,zt=new UA,dL={X:new S(1,0,0),Y:new S(0,1,0),Z:new S(0,0,1)},mM={type:"change"},uL={type:"mouseDown"},pL={type:"mouseUp",mode:null},DL={type:"objectChange"};class M9 extends pA{constructor(A,e){super(),e===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),e=document),this.isTransformControls=!0,this.visible=!1,this.domElement=e,this.domElement.style.touchAction="none";const i=new MM;this._gizmo=i,this.add(i);const g=new K9;this._plane=g,this.add(g);const I=this;function o(u,p){let D=p;Object.defineProperty(I,u,{get:function(){return D!==void 0?D:p},set:function(m){D!==m&&(D=m,g[u]=m,i[u]=m,I.dispatchEvent({type:u+"-changed",value:m}),I.dispatchEvent(mM))}}),I[u]=p,g[u]=p,i[u]=p}o("camera",A),o("object",void 0),o("enabled",!0),o("axis",null),o("mode","translate"),o("translationSnap",null),o("rotationSnap",null),o("scaleSnap",null),o("space","world"),o("size",1),o("dragging",!1),o("showX",!0),o("showY",!0),o("showZ",!0);const s=new S,C=new S,a=new UA,r=new UA,B=new S,Q=new UA,E=new S,h=new S,d=new S,l=0,c=new S;o("worldPosition",s),o("worldPositionStart",C),o("worldQuaternion",a),o("worldQuaternionStart",r),o("cameraPosition",B),o("cameraQuaternion",Q),o("pointStart",E),o("pointEnd",h),o("rotationAxis",d),o("rotationAngle",l),o("eye",c),this._offset=new S,this._startNorm=new S,this._endNorm=new S,this._cameraScale=new S,this._parentPosition=new S,this._parentQuaternion=new UA,this._parentQuaternionInv=new UA,this._parentScale=new S,this._worldScaleStart=new S,this._worldQuaternionInv=new UA,this._worldScale=new S,this._positionStart=new S,this._quaternionStart=new UA,this._scaleStart=new S,this._getPointer=G9.bind(this),this._onPointerDown=U9.bind(this),this._onPointerHover=R9.bind(this),this._onPointerMove=N9.bind(this),this._onPointerUp=F9.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(A){if(this.object===void 0||this.dragging===!0)return;A!==null&&Pr.setFromCamera(A,this.camera);const e=kM(this._gizmo.picker[this.mode],Pr);e?this.axis=e.object.name:this.axis=null}pointerDown(A){if(!(this.object===void 0||this.dragging===!0||A!=null&&A.button!==0)&&this.axis!==null){A!==null&&Pr.setFromCamera(A,this.camera);const e=kM(this._plane,Pr,!0);e&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(e.point).sub(this.worldPositionStart)),this.dragging=!0,uL.mode=this.mode,this.dispatchEvent(uL)}}pointerMove(A){const e=this.axis,i=this.mode,g=this.object;let I=this.space;if(i==="scale"?I="local":(e==="E"||e==="XYZE"||e==="XYZ")&&(I="world"),g===void 0||e===null||this.dragging===!1||A!==null&&A.button!==-1)return;A!==null&&Pr.setFromCamera(A,this.camera);const o=kM(this._plane,Pr,!0);if(o){if(this.pointEnd.copy(o.point).sub(this.worldPositionStart),i==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),I==="local"&&e!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),e.indexOf("X")===-1&&(this._offset.x=0),e.indexOf("Y")===-1&&(this._offset.y=0),e.indexOf("Z")===-1&&(this._offset.z=0),I==="local"&&e!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),g.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(I==="local"&&(g.position.applyQuaternion(zt.copy(this._quaternionStart).invert()),e.search("X")!==-1&&(g.position.x=Math.round(g.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(g.position.y=Math.round(g.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(g.position.z=Math.round(g.position.z/this.translationSnap)*this.translationSnap),g.position.applyQuaternion(this._quaternionStart)),I==="world"&&(g.parent&&g.position.add(Xg.setFromMatrixPosition(g.parent.matrixWorld)),e.search("X")!==-1&&(g.position.x=Math.round(g.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(g.position.y=Math.round(g.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(g.position.z=Math.round(g.position.z/this.translationSnap)*this.translationSnap),g.parent&&g.position.sub(Xg.setFromMatrixPosition(g.parent.matrixWorld))));else if(i==="scale"){if(e.search("XYZ")!==-1){let s=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(s*=-1),on.set(s,s,s)}else Xg.copy(this.pointStart),on.copy(this.pointEnd),Xg.applyQuaternion(this._worldQuaternionInv),on.applyQuaternion(this._worldQuaternionInv),on.divide(Xg),e.search("X")===-1&&(on.x=1),e.search("Y")===-1&&(on.y=1),e.search("Z")===-1&&(on.z=1);g.scale.copy(this._scaleStart).multiply(on),this.scaleSnap&&(e.search("X")!==-1&&(g.scale.x=Math.round(g.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Y")!==-1&&(g.scale.y=Math.round(g.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Z")!==-1&&(g.scale.z=Math.round(g.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(i==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const s=20/this.worldPosition.distanceTo(Xg.setFromMatrixPosition(this.camera.matrixWorld));let C=!1;e==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(Xg.copy(this.rotationAxis).cross(this.eye))*s):(e==="X"||e==="Y"||e==="Z")&&(this.rotationAxis.copy(dL[e]),Xg.copy(dL[e]),I==="local"&&Xg.applyQuaternion(this.worldQuaternion),Xg.cross(this.eye),Xg.length()===0?C=!0:this.rotationAngle=this._offset.dot(Xg.normalize())*s),(e==="E"||C)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),I==="local"&&e!=="E"&&e!=="XYZE"?(g.quaternion.copy(this._quaternionStart),g.quaternion.multiply(zt.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),g.quaternion.copy(zt.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),g.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(mM),this.dispatchEvent(DL)}}pointerUp(A){A!==null&&A.button!==0||(this.dragging&&this.axis!==null&&(pL.mode=this.mode,this.dispatchEvent(pL)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(A){A.geometry&&A.geometry.dispose(),A.material&&A.material.dispose()})}attach(A){return this.object=A,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(mM),this.dispatchEvent(DL),this.pointStart.copy(this.pointEnd))}getRaycaster(){return Pr}getMode(){return this.mode}setMode(A){this.mode=A}setTranslationSnap(A){this.translationSnap=A}setRotationSnap(A){this.rotationSnap=A}setScaleSnap(A){this.scaleSnap=A}setSize(A){this.size=A}setSpace(A){this.space=A}}function G9(t){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:t.button};{const A=this.domElement.getBoundingClientRect();return{x:(t.clientX-A.left)/A.width*2-1,y:-(t.clientY-A.top)/A.height*2+1,button:t.button}}}function R9(t){if(this.enabled)switch(t.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(t));break}}function U9(t){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(t.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(t)),this.pointerDown(this._getPointer(t)))}function N9(t){this.enabled&&this.pointerMove(this._getPointer(t))}function F9(t){this.enabled&&(this.domElement.releasePointerCapture(t.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(t)))}function kM(t,A,e){const i=A.intersectObject(t,!0);for(let g=0;g<i.length;g++)if(i[g].object.visible||e)return i[g];return!1}const FD=new Ht,Nt=new S(0,1,0),wL=new S(0,0,0),yL=new RA,KD=new UA,JD=new UA,_s=new S,SL=new RA,Rc=new S(1,0,0),jr=new S(0,1,0),Uc=new S(0,0,1),vD=new S,Nc=new S,Fc=new S;class MM extends pA{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const A=new It({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),e=new Si({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),i=A.clone();i.opacity=.15;const g=e.clone();g.opacity=.5;const I=A.clone();I.color.setHex(16711680);const o=A.clone();o.color.setHex(65280);const s=A.clone();s.color.setHex(255);const C=A.clone();C.color.setHex(16711680),C.opacity=.5;const a=A.clone();a.color.setHex(65280),a.opacity=.5;const r=A.clone();r.color.setHex(255),r.opacity=.5;const B=A.clone();B.opacity=.25;const Q=A.clone();Q.color.setHex(16776960),Q.opacity=.25,A.clone().color.setHex(16776960);const E=A.clone();E.color.setHex(7895160);const h=new Ni(0,.04,.1,12);h.translate(0,.05,0);const d=new qt(.08,.08,.08);d.translate(0,.04,0);const l=new pe;l.setAttribute("position",new Ce([0,0,0,1,0,0],3));const c=new Ni(.0075,.0075,.5,3);c.translate(0,.25,0);function u(v,j){const b=new Ra(v,.0075,3,64,j*Math.PI*2);return b.rotateY(Math.PI/2),b.rotateX(Math.PI/2),b}function p(){const v=new pe;return v.setAttribute("position",new Ce([0,0,0,1,1,1],3)),v}const D={X:[[new uA(h,I),[.5,0,0],[0,0,-Math.PI/2]],[new uA(h,I),[-.5,0,0],[0,0,Math.PI/2]],[new uA(c,I),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new uA(h,o),[0,.5,0]],[new uA(h,o),[0,-.5,0],[Math.PI,0,0]],[new uA(c,o)]],Z:[[new uA(h,s),[0,0,.5],[Math.PI/2,0,0]],[new uA(h,s),[0,0,-.5],[-Math.PI/2,0,0]],[new uA(c,s),null,[Math.PI/2,0,0]]],XYZ:[[new uA(new Ga(.1,0),B.clone()),[0,0,0]]],XY:[[new uA(new qt(.15,.15,.01),r.clone()),[.15,.15,0]]],YZ:[[new uA(new qt(.15,.15,.01),C.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new uA(new qt(.15,.15,.01),a.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},m={X:[[new uA(new Ni(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new uA(new Ni(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new uA(new Ni(.2,0,.6,4),i),[0,.3,0]],[new uA(new Ni(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new uA(new Ni(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new uA(new Ni(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new uA(new Ga(.2,0),i)]],XY:[[new uA(new qt(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new uA(new qt(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new uA(new qt(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]]},G={START:[[new uA(new Ga(.01,2),g),null,null,null,"helper"]],END:[[new uA(new Ga(.01,2),g),null,null,null,"helper"]],DELTA:[[new fi(p(),g),null,null,null,"helper"]],X:[[new fi(l,g.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new fi(l,g.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new fi(l,g.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},k={XYZE:[[new uA(u(.5,1),E),null,[0,Math.PI/2,0]]],X:[[new uA(u(.5,.5),I)]],Y:[[new uA(u(.5,.5),o),null,[0,0,-Math.PI/2]]],Z:[[new uA(u(.5,.5),s),null,[0,Math.PI/2,0]]],E:[[new uA(u(.75,1),Q),null,[0,Math.PI/2,0]]]},M={AXIS:[[new fi(l,g.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},K={XYZE:[[new uA(new Ms(.25,10,8),i)]],X:[[new uA(new Ra(.5,.1,4,24),i),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new uA(new Ra(.5,.1,4,24),i),[0,0,0],[Math.PI/2,0,0]]],Z:[[new uA(new Ra(.5,.1,4,24),i),[0,0,0],[0,0,-Math.PI/2]]],E:[[new uA(new Ra(.75,.1,2,24),i)]]},f={X:[[new uA(d,I),[.5,0,0],[0,0,-Math.PI/2]],[new uA(c,I),[0,0,0],[0,0,-Math.PI/2]],[new uA(d,I),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new uA(d,o),[0,.5,0]],[new uA(c,o)],[new uA(d,o),[0,-.5,0],[0,0,Math.PI]]],Z:[[new uA(d,s),[0,0,.5],[Math.PI/2,0,0]],[new uA(c,s),[0,0,0],[Math.PI/2,0,0]],[new uA(d,s),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new uA(new qt(.15,.15,.01),r),[.15,.15,0]]],YZ:[[new uA(new qt(.15,.15,.01),C),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new uA(new qt(.15,.15,.01),a),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new uA(new qt(.1,.1,.1),B.clone())]]},N={X:[[new uA(new Ni(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new uA(new Ni(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new uA(new Ni(.2,0,.6,4),i),[0,.3,0]],[new uA(new Ni(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new uA(new Ni(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new uA(new Ni(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new uA(new qt(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new uA(new qt(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new uA(new qt(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new uA(new qt(.2,.2,.2),i),[0,0,0]]]},H={X:[[new fi(l,g.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new fi(l,g.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new fi(l,g.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function _(v){const j=new pA;for(const b in v)for(let L=v[b].length;L--;){const Y=v[b][L][0].clone(),$=v[b][L][1],X=v[b][L][2],sA=v[b][L][3],wA=v[b][L][4];Y.name=b,Y.tag=wA,$&&Y.position.set($[0],$[1],$[2]),X&&Y.rotation.set(X[0],X[1],X[2]),sA&&Y.scale.set(sA[0],sA[1],sA[2]),Y.updateMatrix();const KA=Y.geometry.clone();KA.applyMatrix4(Y.matrix),Y.geometry=KA,Y.renderOrder=1/0,Y.position.set(0,0,0),Y.rotation.set(0,0,0),Y.scale.set(1,1,1),j.add(Y)}return j}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=_(D)),this.add(this.gizmo.rotate=_(k)),this.add(this.gizmo.scale=_(f)),this.add(this.picker.translate=_(m)),this.add(this.picker.rotate=_(K)),this.add(this.picker.scale=_(N)),this.add(this.helper.translate=_(G)),this.add(this.helper.rotate=_(M)),this.add(this.helper.scale=_(H)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(A){const e=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:JD;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let i=[];i=i.concat(this.picker[this.mode].children),i=i.concat(this.gizmo[this.mode].children),i=i.concat(this.helper[this.mode].children);for(let g=0;g<i.length;g++){const I=i[g];I.visible=!0,I.rotation.set(0,0,0),I.position.copy(this.worldPosition);let o;if(this.camera.isOrthographicCamera?o=(this.camera.top-this.camera.bottom)/this.camera.zoom:o=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),I.scale.set(1,1,1).multiplyScalar(o*this.size/4),I.tag==="helper"){I.visible=!1,I.name==="AXIS"?(I.visible=!!this.axis,this.axis==="X"&&(zt.setFromEuler(FD.set(0,0,0)),I.quaternion.copy(e).multiply(zt),Math.abs(Nt.copy(Rc).applyQuaternion(e).dot(this.eye))>.9&&(I.visible=!1)),this.axis==="Y"&&(zt.setFromEuler(FD.set(0,0,Math.PI/2)),I.quaternion.copy(e).multiply(zt),Math.abs(Nt.copy(jr).applyQuaternion(e).dot(this.eye))>.9&&(I.visible=!1)),this.axis==="Z"&&(zt.setFromEuler(FD.set(0,Math.PI/2,0)),I.quaternion.copy(e).multiply(zt),Math.abs(Nt.copy(Uc).applyQuaternion(e).dot(this.eye))>.9&&(I.visible=!1)),this.axis==="XYZE"&&(zt.setFromEuler(FD.set(0,Math.PI/2,0)),Nt.copy(this.rotationAxis),I.quaternion.setFromRotationMatrix(yL.lookAt(wL,Nt,jr)),I.quaternion.multiply(zt),I.visible=this.dragging),this.axis==="E"&&(I.visible=!1)):I.name==="START"?(I.position.copy(this.worldPositionStart),I.visible=this.dragging):I.name==="END"?(I.position.copy(this.worldPosition),I.visible=this.dragging):I.name==="DELTA"?(I.position.copy(this.worldPositionStart),I.quaternion.copy(this.worldQuaternionStart),Xg.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Xg.applyQuaternion(this.worldQuaternionStart.clone().invert()),I.scale.copy(Xg),I.visible=this.dragging):(I.quaternion.copy(e),this.dragging?I.position.copy(this.worldPositionStart):I.position.copy(this.worldPosition),this.axis&&(I.visible=this.axis.search(I.name)!==-1));continue}I.quaternion.copy(e),this.mode==="translate"||this.mode==="scale"?(I.name==="X"&&Math.abs(Nt.copy(Rc).applyQuaternion(e).dot(this.eye))>.99&&(I.scale.set(1e-10,1e-10,1e-10),I.visible=!1),I.name==="Y"&&Math.abs(Nt.copy(jr).applyQuaternion(e).dot(this.eye))>.99&&(I.scale.set(1e-10,1e-10,1e-10),I.visible=!1),I.name==="Z"&&Math.abs(Nt.copy(Uc).applyQuaternion(e).dot(this.eye))>.99&&(I.scale.set(1e-10,1e-10,1e-10),I.visible=!1),I.name==="XY"&&Math.abs(Nt.copy(Uc).applyQuaternion(e).dot(this.eye))<.2&&(I.scale.set(1e-10,1e-10,1e-10),I.visible=!1),I.name==="YZ"&&Math.abs(Nt.copy(Rc).applyQuaternion(e).dot(this.eye))<.2&&(I.scale.set(1e-10,1e-10,1e-10),I.visible=!1),I.name==="XZ"&&Math.abs(Nt.copy(jr).applyQuaternion(e).dot(this.eye))<.2&&(I.scale.set(1e-10,1e-10,1e-10),I.visible=!1)):this.mode==="rotate"&&(KD.copy(e),Nt.copy(this.eye).applyQuaternion(zt.copy(e).invert()),I.name.search("E")!==-1&&I.quaternion.setFromRotationMatrix(yL.lookAt(this.eye,wL,jr)),I.name==="X"&&(zt.setFromAxisAngle(Rc,Math.atan2(-Nt.y,Nt.z)),zt.multiplyQuaternions(KD,zt),I.quaternion.copy(zt)),I.name==="Y"&&(zt.setFromAxisAngle(jr,Math.atan2(Nt.x,Nt.z)),zt.multiplyQuaternions(KD,zt),I.quaternion.copy(zt)),I.name==="Z"&&(zt.setFromAxisAngle(Uc,Math.atan2(Nt.y,Nt.x)),zt.multiplyQuaternions(KD,zt),I.quaternion.copy(zt))),I.visible=I.visible&&(I.name.indexOf("X")===-1||this.showX),I.visible=I.visible&&(I.name.indexOf("Y")===-1||this.showY),I.visible=I.visible&&(I.name.indexOf("Z")===-1||this.showZ),I.visible=I.visible&&(I.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),I.material._color=I.material._color||I.material.color.clone(),I.material._opacity=I.material._opacity||I.material.opacity,I.material.color.copy(I.material._color),I.material.opacity=I.material._opacity,this.enabled&&this.axis&&(I.name===this.axis||this.axis.split("").some(function(s){return I.name===s}))&&(I.material.color.setHex(16776960),I.material.opacity=1)}super.updateMatrixWorld(A)}}class K9 extends uA{constructor(){super(new ji(1e5,1e5,2,2),new It({visible:!1,wireframe:!0,side:Et,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(A){let e=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(e="local"),vD.copy(Rc).applyQuaternion(e==="local"?this.worldQuaternion:JD),Nc.copy(jr).applyQuaternion(e==="local"?this.worldQuaternion:JD),Fc.copy(Uc).applyQuaternion(e==="local"?this.worldQuaternion:JD),Nt.copy(Nc),this.mode){case"translate":case"scale":switch(this.axis){case"X":Nt.copy(this.eye).cross(vD),_s.copy(vD).cross(Nt);break;case"Y":Nt.copy(this.eye).cross(Nc),_s.copy(Nc).cross(Nt);break;case"Z":Nt.copy(this.eye).cross(Fc),_s.copy(Fc).cross(Nt);break;case"XY":_s.copy(Fc);break;case"YZ":_s.copy(vD);break;case"XZ":Nt.copy(Fc),_s.copy(Nc);break;case"XYZ":case"E":_s.set(0,0,0);break}break;case"rotate":default:_s.set(0,0,0)}_s.length()===0?this.quaternion.copy(this.cameraQuaternion):(SL.lookAt(Xg.set(0,0,0),_s,Nt),this.quaternion.setFromRotationMatrix(SL)),super.updateMatrixWorld(A)}}const J9=tA("debugpatch");function qD(t,A,e,i){const g=J9===A;if(!e&&!i)return;const I=A+"___needle";q9(t,A,e,i);const o=Object.getOwnPropertyDescriptor(t,A),s=t[A];g&&console.log("Patch",t.constructor.name,A,o,s),o?(g&&console.log("Apply patch with existing descriptor",t.constructor.name,A,o),typeof o.value=="function"&&(t[A]=mL(o.value,t,A))):(g&&console.log("Create patch with new property",t.constructor.name,A,o),Object.defineProperty(t,A,{set:function(C){if(typeof C=="function")this[I]=mL(C,t,A);else{const a=this[I];kL(t,A,this,a,C),this[I]=C,ML(t,A,this,a,C)}},get:function(){const C=this[I];return typeof C=="function"&&C[I]?C[I]:C}}))}function v9(t,A,e){const i=RM(t,A);if(i)for(let g=i.length-1;g>=0;g--){const I=i[g];I.prefix===e&&(I.prefix=null),I.postfix===e&&(I.postfix=null),!I.prefix&&!I.postfix&&i.splice(g,1)}}const fL=Symbol("Needle:Patches:WrappedFunction");function mL(t,A,e){if(t[fL])return t;const i=function(...g){kL(A,e,this,...g);const I=t.apply(this,g);return ML(A,e,this,I,...g),I};return i[fL]=!0,i}const bD="Needle:Patches";function GM(){return globalThis[bD]||(globalThis[bD]=new WeakMap),globalThis[bD]}function RM(t,A){const e=GM().get(t);return e?e.get(A):null}function q9(t,A,e,i){let g=GM().get(t);g||(g=new Map,GM().set(t,g));let I=g.get(A);I||(I=[],g.set(A,I)),I.push({prefix:e,postfix:i})}function kL(t,A,e,...i){var g;if(!e)return;const I=RM(t,A);if(I)for(const o of I)(g=o.prefix)==null||g.call(e,...i)}function ML(t,A,e,i,...g){var I;if(!e)return;const o=RM(t,A);if(o)for(const s of o)(I=s.postfix)==null||I.call(e,i,...g)}const GL=Symbol("gltf-loader-internal-usage-tracker"),b9=tA("debugusers"),LD=class{constructor(t){n(this,"parser"),n(this,"_getDependency"),n(this,"_loadingId"),n(this,"_loadedObjects",new Set),this.parser=t,this._getDependency=this.parser.getDependency,this._loadingId=Date.now().toString()}get name(){return"NEEDLE_internal_usage_tracker"}static isLoading(t){return LD._loadingProcesses>0}beforeRoot(){LD._loadingProcesses++;const t=this,A=this._getDependency;return this.parser.getDependency=function(e,i){const g=A.call(this,e,i);return g.then(I=>(I&&(t._loadedObjects.add(I),I[GL]=t._loadingId),I)),g},null}afterRoot(t){LD._loadingProcesses--,this.parser.getDependency=this._getDependency;for(const A of this._loadedObjects)delete A[GL],A instanceof pA&&(A.parent||A instanceof uA&&(b9&&console.warn("> GLTF LOADER: Mesh not used in scene!",A),A.material=null,A.geometry=null));return null}};let UM=LD;n(UM,"_loadingProcesses",0);class RL{constructor(){window.addEventListener("unhandledrejection",A=>{var e;if(A.defaultPrevented)return;const i=(e=A?.reason)==null?void 0:e.path;if(i){const g=i[0];g&&g.tagName==="IMG"&&(console.warn(`Could not load image:
4325
- `+g.src),A.preventDefault())}})}}const xD=tA("trackresources");function UL(){return xD==="dispose"}let Wr=!0;xD===0&&(Wr=!1);function L9(t){Wr=t}function NL(){return Wr}const FL=Symbol("disposable");function NM(t,A){t&&(t[FL]=A,zr&&console.warn("Set disposable",A,t))}const KL=Symbol("disposed");function x9(t){return t[KL]===!0}function Kt(t){var A;if(t){if(t[FL]===!1){zr&&console.warn("Object is marked as not disposable",t);return}if(t[KL]=!0,t instanceof zg)Kt(t.environment),Kt(t.background),Kt(t.customDepthMaterial),Kt(t.customDistanceMaterial);else if(t instanceof os)Kt(t.geometry),Kt(t.material),Kt(t.skeleton),Kt(t.bindMatrix),Kt(t.bindMatrixInverse),Kt(t.customDepthMaterial),Kt(t.customDistanceMaterial),t.geometry=null,t.material=null;else if(t instanceof uA)Kt(t.geometry),Kt(t.material),Kt(t.customDepthMaterial),Kt(t.customDistanceMaterial),t.geometry=null,t.material=null;else if(t instanceof pe){jQ(t);for(const e of Object.keys(t.attributes)){const i=t.attributes[e];Kt(i)}}else if(t instanceof ee||t instanceof UI)zr&&console.warn("BufferAttribute dispose not supported",t.count);else if(t instanceof Array)for(const e of t)e instanceof ve&&Kt(e);else if(t instanceof ve){jQ(t);for(const i of Object.keys(t)){const g=t[i];g instanceof Re&&(Kt(g),t[i]=null)}const e=t.uniforms;if(e)for(const i of Object.keys(e)){const g=e[i];g instanceof Re?(Kt(g),e[i]=null):g instanceof SA&&(Kt(g.value),g.value=null)}}else t instanceof Re?(jQ(t),jQ(t.source),((A=t.source)==null?void 0:A.data)instanceof ImageBitmap&&jQ(t.source.data)):t instanceof hh?(jQ(t.boneTexture),t.boneTexture=null):t instanceof ic||!(t instanceof pA)&&zr&&console.warn("Unknown object type",t)}}function jQ(t){t&&((zr||UL()||xD)&&console.warn("\u{1F9E8} FREE",t),t instanceof ImageBitmap?t.close():t instanceof FC?t.data=null:t.dispose())}function JL(t){(t instanceof uA||t instanceof os)&&(t.material=null,t.geometry=null)}const Y9=new Set;function FM(t,A,e=null,i){if(i||(i=Y9,i.clear()),!t)return i;const g=t[Kc];if(g)for(const I of g)i.has(I)||e?.call(null,I)!==!1&&(i.add(I),A&&FM(I,!0,e,i));return i}function T9(t){return t[Jc]}const zr=tA("debugresourceusers")||tA("debugmemory"),Kc=Symbol("needle-resource-users"),Jc=Symbol("needle-resource-users-count");function cI(t,A){qD(t,A,function(e,i){Wr&&(YD(Kc,this,e,!1),YD(Kc,this,i,!0))})}Wr&&(cI(uA.prototype,"material"),cI(uA.prototype,"geometry"),cI(ve.prototype,"map"),cI(ve.prototype,"bumpMap"),cI(ve.prototype,"alphaMap"),cI(ve.prototype,"normalMap"),cI(ve.prototype,"displacementMap"),cI(ve.prototype,"roughnessMap"),cI(ve.prototype,"metalnessMap"),cI(ve.prototype,"emissiveMap"),cI(ve.prototype,"specularMap"),cI(ve.prototype,"envMap"),cI(ve.prototype,"lightMap"),cI(ve.prototype,"aoMap"),cI(ve.prototype,"gradientMap"));function H9(t){if(Wr===!1)return;const A=t[Kc];if(A)for(const e of A)YD(Kc,e,t,!1)}Wr&&qD(ve.prototype,"dispose",function(){H9(this)});let KM=0;function YD(t,A,e,i){if(KM>0)return;if(Array.isArray(e)){for(const I of e)YD(t,A,I,i);return}if(!e)return;let g=e[t];if(g||(g=new Set),i){if(A&&!g.has(A)){g.add(A);let I=e[Jc]||0;I+=1,e[Jc]=I,zr&&console.warn(`\u{1F7E2} Added user of "${e.type}"`,A,e,I,"users:",g)}}else if(A&&g.has(A)){g.delete(A);let I=e[Jc]||0;I>0&&(I-=1,e[Jc]=I),zr&&console.warn(`\u{1F534} Removed user of "${e.type}"`,A,e,I,"users:",g),I<=0&&(UM.isLoading(e)||(xD&&console.warn(`\u{1F534} Removed all user of "${e.type}"`,e),UL()&&Kt(e)))}e[t]=g}try{qD(YC.prototype,"render",function(){KM++},function(){KM--})}catch(t){console.warn("Could not wrap WebGLRenderer.render",t)}var vc=(t=>(t.Added="component-added",t.Removing="removing-component",t))(vc||{});const vL=tA("debugcomponentevents");class qc{static addComponentLifecylceEventListener(A,e){this.eventListeners.has(A)&&this.eventListeners.set(A,[]);let i=this.eventListeners.get(A);i||(i=[]),i.push(e),this.eventListeners.set(A,i),vL&&console.log("Added event listener for "+A,this.eventListeners)}static removeComponentLifecylceEventListener(A,e){const i=this.eventListeners.get(A);if(!i)return;const g=i.indexOf(e);g<0||i.splice(g,1)}static dispatchComponentLifecycleEvent(A,e){const i=this.eventListeners.get(A);if(vL&&console.log("Dispatching event "+A,i),!!i)for(const g of i)g(e)}}n(qc,"eventListeners",new Map);const qL=tA("debugdefines");WQ('if(!globalThis[""3.34.0-alpha.1""]) globalThis[""3.34.0-alpha.1""] = "0.0.0";'),WQ('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";'),WQ('if(!globalThis[""Thu Mar 07 2024 01:47:46 GMT+0800 (Pacific Standard Time)""]) globalThis[""Thu Mar 07 2024 01:47:46 GMT+0800 (Pacific Standard Time)""] = "unknown";'),WQ('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.34.0-alpha.1";'),WQ('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";'),WQ('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Mar 07 2024 01:47:46 GMT+0800 (Pacific Standard Time)";');const zC="3.34.0-alpha.1",TD="undefined",JM="Thu Mar 07 2024 01:47:46 GMT+0800 (Pacific Standard Time)";qL&&console.log(`Engine version: ${zC} (generator: ${TD})
4325
+ `+g.src),A.preventDefault())}})}}const xD=tA("trackresources");function UL(){return xD==="dispose"}let Wr=!0;xD===0&&(Wr=!1);function L9(t){Wr=t}function NL(){return Wr}const FL=Symbol("disposable");function NM(t,A){t&&(t[FL]=A,zr&&console.warn("Set disposable",A,t))}const KL=Symbol("disposed");function x9(t){return t[KL]===!0}function Kt(t){var A;if(t){if(t[FL]===!1){zr&&console.warn("Object is marked as not disposable",t);return}if(t[KL]=!0,t instanceof zg)Kt(t.environment),Kt(t.background),Kt(t.customDepthMaterial),Kt(t.customDistanceMaterial);else if(t instanceof os)Kt(t.geometry),Kt(t.material),Kt(t.skeleton),Kt(t.bindMatrix),Kt(t.bindMatrixInverse),Kt(t.customDepthMaterial),Kt(t.customDistanceMaterial),t.geometry=null,t.material=null;else if(t instanceof uA)Kt(t.geometry),Kt(t.material),Kt(t.customDepthMaterial),Kt(t.customDistanceMaterial),t.geometry=null,t.material=null;else if(t instanceof pe){jQ(t);for(const e of Object.keys(t.attributes)){const i=t.attributes[e];Kt(i)}}else if(t instanceof ee||t instanceof UI)zr&&console.warn("BufferAttribute dispose not supported",t.count);else if(t instanceof Array)for(const e of t)e instanceof ve&&Kt(e);else if(t instanceof ve){jQ(t);for(const i of Object.keys(t)){const g=t[i];g instanceof Re&&(Kt(g),t[i]=null)}const e=t.uniforms;if(e)for(const i of Object.keys(e)){const g=e[i];g instanceof Re?(Kt(g),e[i]=null):g instanceof SA&&(Kt(g.value),g.value=null)}}else t instanceof Re?(jQ(t),jQ(t.source),((A=t.source)==null?void 0:A.data)instanceof ImageBitmap&&jQ(t.source.data)):t instanceof hh?(jQ(t.boneTexture),t.boneTexture=null):t instanceof ic||!(t instanceof pA)&&zr&&console.warn("Unknown object type",t)}}function jQ(t){t&&((zr||UL()||xD)&&console.warn("\u{1F9E8} FREE",t),t instanceof ImageBitmap?t.close():t instanceof FC?t.data=null:t.dispose())}function JL(t){(t instanceof uA||t instanceof os)&&(t.material=null,t.geometry=null)}const Y9=new Set;function FM(t,A,e=null,i){if(i||(i=Y9,i.clear()),!t)return i;const g=t[Kc];if(g)for(const I of g)i.has(I)||e?.call(null,I)!==!1&&(i.add(I),A&&FM(I,!0,e,i));return i}function T9(t){return t[Jc]}const zr=tA("debugresourceusers")||tA("debugmemory"),Kc=Symbol("needle-resource-users"),Jc=Symbol("needle-resource-users-count");function cI(t,A){qD(t,A,function(e,i){Wr&&(YD(Kc,this,e,!1),YD(Kc,this,i,!0))})}Wr&&(cI(uA.prototype,"material"),cI(uA.prototype,"geometry"),cI(ve.prototype,"map"),cI(ve.prototype,"bumpMap"),cI(ve.prototype,"alphaMap"),cI(ve.prototype,"normalMap"),cI(ve.prototype,"displacementMap"),cI(ve.prototype,"roughnessMap"),cI(ve.prototype,"metalnessMap"),cI(ve.prototype,"emissiveMap"),cI(ve.prototype,"specularMap"),cI(ve.prototype,"envMap"),cI(ve.prototype,"lightMap"),cI(ve.prototype,"aoMap"),cI(ve.prototype,"gradientMap"));function H9(t){if(Wr===!1)return;const A=t[Kc];if(A)for(const e of A)YD(Kc,e,t,!1)}Wr&&qD(ve.prototype,"dispose",function(){H9(this)});let KM=0;function YD(t,A,e,i){if(KM>0)return;if(Array.isArray(e)){for(const I of e)YD(t,A,I,i);return}if(!e)return;let g=e[t];if(g||(g=new Set),i){if(A&&!g.has(A)){g.add(A);let I=e[Jc]||0;I+=1,e[Jc]=I,zr&&console.warn(`\u{1F7E2} Added user of "${e.type}"`,A,e,I,"users:",g)}}else if(A&&g.has(A)){g.delete(A);let I=e[Jc]||0;I>0&&(I-=1,e[Jc]=I),zr&&console.warn(`\u{1F534} Removed user of "${e.type}"`,A,e,I,"users:",g),I<=0&&(UM.isLoading(e)||(xD&&console.warn(`\u{1F534} Removed all user of "${e.type}"`,e),UL()&&Kt(e)))}e[t]=g}try{qD(YC.prototype,"render",function(){KM++},function(){KM--})}catch(t){console.warn("Could not wrap WebGLRenderer.render",t)}var vc=(t=>(t.Added="component-added",t.Removing="removing-component",t))(vc||{});const vL=tA("debugcomponentevents");class qc{static addComponentLifecylceEventListener(A,e){this.eventListeners.has(A)&&this.eventListeners.set(A,[]);let i=this.eventListeners.get(A);i||(i=[]),i.push(e),this.eventListeners.set(A,i),vL&&console.log("Added event listener for "+A,this.eventListeners)}static removeComponentLifecylceEventListener(A,e){const i=this.eventListeners.get(A);if(!i)return;const g=i.indexOf(e);g<0||i.splice(g,1)}static dispatchComponentLifecycleEvent(A,e){const i=this.eventListeners.get(A);if(vL&&console.log("Dispatching event "+A,i),!!i)for(const g of i)g(e)}}n(qc,"eventListeners",new Map);const qL=tA("debugdefines");WQ('if(!globalThis[""3.34.0-alpha.2""]) globalThis[""3.34.0-alpha.2""] = "0.0.0";'),WQ('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";'),WQ('if(!globalThis[""Thu Mar 07 2024 14:14:30 GMT+0100 (Central European Standard Time)""]) globalThis[""Thu Mar 07 2024 14:14:30 GMT+0100 (Central European Standard Time)""] = "unknown";'),WQ('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.34.0-alpha.2";'),WQ('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";'),WQ('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Mar 07 2024 14:14:30 GMT+0100 (Central European Standard Time)";');const zC="3.34.0-alpha.2",TD="undefined",JM="Thu Mar 07 2024 14:14:30 GMT+0100 (Central European Standard Time)";qL&&console.log(`Engine version: ${zC} (generator: ${TD})
4326
4326
  Project built at ${JM}`);const ZC="needle_isActiveInHierarchy",Zr="builtin_components",bc="needle_editor_guid";function WQ(t){try{(0,eval)(t)}catch(A){qL&&console.error(A)}}const Lc=Symbol("NEEDLE_NEED_UPDATE_INSTANCE"),bL=Symbol("isUsingInstancing"),LL=Symbol("instancingRenderer"),vM=Symbol("instancingAutoUpdateBounds");class Us{static isUsingInstancing(A){return A[bL]===!0}static getRenderer(A){return A[LL]||null}setAutoUpdateBounds(A,e){const i=Us.getRenderer(A);i&&(i[vM]=e)}static markDirty(A,e=!0){if(A&&(this.isUsingInstancing(A)&&(A[Lc]=!0,A.matrixWorldNeedsUpdate=!0),e))for(const i of A.children)Us.markDirty(i,!0)}}function Vr(t,A){try{A?t(A):t()}catch(e){return console.error(e),!1}return!0}const qM=tA("debugnewscripts"),_9=tA("debughierarchy"),Zt=[];function O9(){return Zt.length>0}function HD(t){if(!(t.new_scripts.length<=0)){if(qM&&console.log("Register new components",t.new_scripts.length,[...t.new_scripts],t.alias?"element: "+t.alias:t.hash,t),t.new_scripts_pre_setup_callbacks.length>0){for(const A of t.new_scripts_pre_setup_callbacks)A&&A();t.new_scripts_pre_setup_callbacks.length=0}Zt.length=0,t.new_scripts.length>0&&Zt.push(...t.new_scripts),t.new_scripts.length=0;for(let A=0;A<Zt.length;A++)try{const e=Zt[A];if(e.isComponent!==!0){(he()||qM)&&console.error(`Registered script is not a Needle Engine component.
4327
4327
  The script will be ignored. Please make sure your component extends "Behaviour" imported from "@needle-tools/engine"
4328
4328
  `,e),Zt.splice(A,1),A--;continue}if(e.destroyed)continue;if(!e.gameObject){console.error("MISSING GAMEOBJECT - will ignore",e),Zt.splice(A,1),A--;continue}e.context=t,xc(e.gameObject),bM(e,t)}catch(e){console.error(e),VC(Zt[A],t),Zt.splice(A,1),A--}for(let A=0;A<Zt.length;A++)try{const e=Zt[A];if(e.destroyed){VC(Zt[A],t),Zt.splice(A,1),A--;continue}if(e.registering)try{e.registering()}catch(i){console.error(i)}e.__internalAwake!==void 0&&(e.gameObject||console.error("MISSING GAMEOBJECT",e,e.gameObject),xc(e.gameObject),e.activeAndEnabled&&Vr(e.__internalAwake.bind(e)))}catch(e){console.error(e),VC(Zt[A],t),Zt.splice(A,1),A--}for(let A=0;A<Zt.length;A++)try{const e=Zt[A];if(e.destroyed||e.enabled===!1||(xc(e.gameObject),e.activeAndEnabled===!1))continue;e.__internalEnable!==void 0&&(e.enabled=!0,Vr(e.__internalEnable.bind(e)))}catch(e){console.error(e),VC(Zt[A],t),Zt.splice(A,1),A--}for(let A=0;A<Zt.length;A++)try{const e=Zt[A];if(e.destroyed||!e.gameObject)continue;t.new_script_start.push(e)}catch(e){console.error(e),VC(Zt[A],t),Zt.splice(A,1),A--}Zt.length=0;for(const A of t.new_scripts_post_setup_callbacks)A&&A();t.new_scripts_post_setup_callbacks.length=0}}function P9(t){t&&(t.__internalDisable(!0),VC(t,t.context))}function xL(t,A){for(let e=0;e<t.new_script_start.length;e++)try{const i=t.new_script_start[e];if(A!==void 0&&i.gameObject!==A||i.destroyed||i.activeAndEnabled===!1)continue;Vr(i.__internalAwake.bind(i)),i.enabled&&(Vr(i.__internalEnable.bind(i)),Vr(i.__internalStart.bind(i)),t.new_script_start.splice(e,1),e--)}catch(i){console.error(i),VC(t.new_script_start[e],t),t.new_script_start.splice(e,1),e--}}function bM(t,A){A.scripts.indexOf(t)===-1&&(A.scripts.push(t),t.earlyUpdate&&A.scripts_earlyUpdate.push(t),t.update&&A.scripts_update.push(t),t.lateUpdate&&A.scripts_lateUpdate.push(t),t.onBeforeRender&&A.scripts_onBeforeRender.push(t),t.onAfterRender&&A.scripts_onAfterRender.push(t),t.onPausedChanged&&A.scripts_pausedChanged.push(t),LM(t,null)&&A.new_scripts_xr.push(t),LM(t,"immersive-vr")&&A.scripts_immersive_vr.push(t),LM(t,"immersive-ar")&&A.scripts_immersive_ar.push(t))}function VC(t,A){No(t,A.new_scripts),No(t,A.new_script_start),No(t,A.scripts),No(t,A.scripts_earlyUpdate),No(t,A.scripts_update),No(t,A.scripts_lateUpdate),No(t,A.scripts_onBeforeRender),No(t,A.scripts_onAfterRender),No(t,A.scripts_pausedChanged),No(t,A.new_scripts_xr),No(t,A.scripts_immersive_vr),No(t,A.scripts_immersive_ar),A.stopAllCoroutinesFrom(t)}function No(t,A){const e=A.indexOf(t);e>=0&&A.splice(e,1)}function LM(t,A){var e;if(t){const i=t;if(i.onBeforeXR||i.onEnterXR||i.onUpdateXR||i.onLeaveXR||i.onXRControllerAdded||i.onXRControllerRemoved)return!(A!=null&&((e=i.supportsXR)==null?void 0:e.call(i,A))===!1)}return!1}function _D(t){if(t||(t=at.Current.scene),!t){console.trace("Invalid call - no current context.");return}const A=gE(t);YL(t,A,!0)||(qM||he()?console.error(`Error updating hierarchy
@@ -4844,7 +4844,7 @@ Please change to:
4844
4844
  ${s}? : Object3D;
4845
4845
 
4846
4846
  in script ${I}.ts
4847
- <a href="https://docs.needle.tools/serializable" target="_blank">documentation</a>`),console.warn(I,s,t[s],t);continue}}else if(!Array.isArray(C)&&((g=C.constructor)==null?void 0:g.name)==="Object"){const r='You might be missing a @serializable(Type) decorator for field "'+s+'" in '+I+".ts";console.warn(r+`
4847
+ <a href="https://docs.needle.tools/serializable" target="_blank">documentation</a>`),console.warn(I,s,t[s],t);continue}}else if(!Array.isArray(C)&&((g=C.constructor)==null?void 0:g.name)==="Object"&&!C.constructor["did_warn:missing_serializable"]){C.constructor["did_warn:missing_serializable"]=!0;const r='You might be missing a @serializable(Type) decorator for field "'+s+'" in '+I+".ts";console.warn(r+`
4848
4848
  `,a),Ts(Ao.Warn,"Deserialization issue: Please check the console for details!")}}if(typeof C=="string"&&(a.endsWith(".gltf")||a.endsWith(".glb"))){Ts(Ao.Warn,`<strong>Missing serialization for object reference!</strong>
4849
4849
 
4850
4850
  Please change to:
@@ -4322,7 +4322,7 @@ void main() {
4322
4322
  `;s+=i(o);const n=Object.keys(I);let C="";for(let a=0;a<n.length;a++){const B=n[a],Q=I[B];if(Xc.has(Q)){C+="";continue}Xc.set(Q,!0),C+=B+":"+t(Q,o+1),a<n.length-1&&(C+=", "),C.length>=60&&(C+=`
4323
4323
  `,C+=i(o),s+=C,C="")}return s+=C,s+=`
4324
4324
  }`,s}return I}function i(I){let o="";for(let s=0;s<I;s++)o+=" ";return o}}const m9=IA("nodevlogs");function hi(g,A=co.Log){an(A,g)}function Ii(g){hi(g,co.Warn)}function g2(g){hi(g,co.Error)}let YG;function De(){return m9?!1:YG!==void 0?YG:VI()}function M9(g){YG=g}const Kr=new bB,iI=new y,Ia=new y,ti=new kA,pq={X:new y(1,0,0),Y:new y(0,1,0),Z:new y(0,0,1)},cm={type:"change"},fq={type:"mouseDown"},Dq={type:"mouseUp",mode:null},yq={type:"objectChange"};class G9 extends pA{constructor(A,e){super(),e===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),e=document),this.isTransformControls=!0,this.visible=!1,this.domElement=e,this.domElement.style.touchAction="none";const t=new vU;this._gizmo=t,this.add(t);const i=new K9;this._plane=i,this.add(i);const I=this;function o(p,u){let f=u;Object.defineProperty(I,p,{get:function(){return f!==void 0?f:u},set:function(m){f!==m&&(f=m,i[p]=m,t[p]=m,I.dispatchEvent({type:p+"-changed",value:m}),I.dispatchEvent(cm))}}),I[p]=u,i[p]=u,t[p]=u}o("camera",A),o("object",void 0),o("enabled",!0),o("axis",null),o("mode","translate"),o("translationSnap",null),o("rotationSnap",null),o("scaleSnap",null),o("space","world"),o("size",1),o("dragging",!1),o("showX",!0),o("showY",!0),o("showZ",!0);const s=new y,n=new y,C=new kA,a=new kA,B=new y,Q=new kA,E=new y,c=new y,d=new y,l=0,h=new y;o("worldPosition",s),o("worldPositionStart",n),o("worldQuaternion",C),o("worldQuaternionStart",a),o("cameraPosition",B),o("cameraQuaternion",Q),o("pointStart",E),o("pointEnd",c),o("rotationAxis",d),o("rotationAngle",l),o("eye",h),this._offset=new y,this._startNorm=new y,this._endNorm=new y,this._cameraScale=new y,this._parentPosition=new y,this._parentQuaternion=new kA,this._parentQuaternionInv=new kA,this._parentScale=new y,this._worldScaleStart=new y,this._worldQuaternionInv=new kA,this._worldScale=new y,this._positionStart=new y,this._quaternionStart=new kA,this._scaleStart=new y,this._getPointer=k9.bind(this),this._onPointerDown=U9.bind(this),this._onPointerHover=R9.bind(this),this._onPointerMove=N9.bind(this),this._onPointerUp=F9.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(A){if(this.object===void 0||this.dragging===!0)return;A!==null&&Kr.setFromCamera(A,this.camera);const e=hm(this._gizmo.picker[this.mode],Kr);e?this.axis=e.object.name:this.axis=null}pointerDown(A){if(!(this.object===void 0||this.dragging===!0||A!=null&&A.button!==0)&&this.axis!==null){A!==null&&Kr.setFromCamera(A,this.camera);const e=hm(this._plane,Kr,!0);e&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(e.point).sub(this.worldPositionStart)),this.dragging=!0,fq.mode=this.mode,this.dispatchEvent(fq)}}pointerMove(A){const e=this.axis,t=this.mode,i=this.object;let I=this.space;if(t==="scale"?I="local":(e==="E"||e==="XYZE"||e==="XYZ")&&(I="world"),i===void 0||e===null||this.dragging===!1||A!==null&&A.button!==-1)return;A!==null&&Kr.setFromCamera(A,this.camera);const o=hm(this._plane,Kr,!0);if(o){if(this.pointEnd.copy(o.point).sub(this.worldPositionStart),t==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),I==="local"&&e!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),e.indexOf("X")===-1&&(this._offset.x=0),e.indexOf("Y")===-1&&(this._offset.y=0),e.indexOf("Z")===-1&&(this._offset.z=0),I==="local"&&e!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),i.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(I==="local"&&(i.position.applyQuaternion(ti.copy(this._quaternionStart).invert()),e.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.position.applyQuaternion(this._quaternionStart)),I==="world"&&(i.parent&&i.position.add(iI.setFromMatrixPosition(i.parent.matrixWorld)),e.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.parent&&i.position.sub(iI.setFromMatrixPosition(i.parent.matrixWorld))));else if(t==="scale"){if(e.search("XYZ")!==-1){let s=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(s*=-1),Ia.set(s,s,s)}else iI.copy(this.pointStart),Ia.copy(this.pointEnd),iI.applyQuaternion(this._worldQuaternionInv),Ia.applyQuaternion(this._worldQuaternionInv),Ia.divide(iI),e.search("X")===-1&&(Ia.x=1),e.search("Y")===-1&&(Ia.y=1),e.search("Z")===-1&&(Ia.z=1);i.scale.copy(this._scaleStart).multiply(Ia),this.scaleSnap&&(e.search("X")!==-1&&(i.scale.x=Math.round(i.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Y")!==-1&&(i.scale.y=Math.round(i.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Z")!==-1&&(i.scale.z=Math.round(i.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(t==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const s=20/this.worldPosition.distanceTo(iI.setFromMatrixPosition(this.camera.matrixWorld));let n=!1;e==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(iI.copy(this.rotationAxis).cross(this.eye))*s):(e==="X"||e==="Y"||e==="Z")&&(this.rotationAxis.copy(pq[e]),iI.copy(pq[e]),I==="local"&&iI.applyQuaternion(this.worldQuaternion),iI.cross(this.eye),iI.length()===0?n=!0:this.rotationAngle=this._offset.dot(iI.normalize())*s),(e==="E"||n)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),I==="local"&&e!=="E"&&e!=="XYZE"?(i.quaternion.copy(this._quaternionStart),i.quaternion.multiply(ti.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),i.quaternion.copy(ti.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),i.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(cm),this.dispatchEvent(yq)}}pointerUp(A){A!==null&&A.button!==0||(this.dragging&&this.axis!==null&&(Dq.mode=this.mode,this.dispatchEvent(Dq)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(A){A.geometry&&A.geometry.dispose(),A.material&&A.material.dispose()})}attach(A){return this.object=A,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(cm),this.dispatchEvent(yq),this.pointStart.copy(this.pointEnd))}getRaycaster(){return Kr}getMode(){return this.mode}setMode(A){this.mode=A}setTranslationSnap(A){this.translationSnap=A}setRotationSnap(A){this.rotationSnap=A}setScaleSnap(A){this.scaleSnap=A}setSize(A){this.size=A}setSpace(A){this.space=A}}function k9(g){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:g.button};{const A=this.domElement.getBoundingClientRect();return{x:(g.clientX-A.left)/A.width*2-1,y:-(g.clientY-A.top)/A.height*2+1,button:g.button}}}function R9(g){if(this.enabled)switch(g.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(g));break}}function U9(g){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(g.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(g)),this.pointerDown(this._getPointer(g)))}function N9(g){this.enabled&&this.pointerMove(this._getPointer(g))}function F9(g){this.enabled&&(this.domElement.releasePointerCapture(g.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(g)))}function hm(g,A,e){const t=A.intersectObject(g,!0);for(let i=0;i<t.length;i++)if(t[i].object.visible||e)return t[i];return!1}const Pp=new Wt,qt=new y(0,1,0),wq=new y(0,0,0),Sq=new MA,Wp=new kA,jf=new kA,Ts=new y,mq=new MA,kh=new y(1,0,0),Vr=new y(0,1,0),Rh=new y(0,0,1),jp=new y,$c=new y,Ah=new y;class vU extends pA{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const A=new at({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),e=new xi({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=A.clone();t.opacity=.15;const i=e.clone();i.opacity=.5;const I=A.clone();I.color.setHex(16711680);const o=A.clone();o.color.setHex(65280);const s=A.clone();s.color.setHex(255);const n=A.clone();n.color.setHex(16711680),n.opacity=.5;const C=A.clone();C.color.setHex(65280),C.opacity=.5;const a=A.clone();a.color.setHex(255),a.opacity=.5;const B=A.clone();B.opacity=.25;const Q=A.clone();Q.color.setHex(16776960),Q.opacity=.25,A.clone().color.setHex(16776960);const c=A.clone();c.color.setHex(7895160);const d=new Ki(0,.04,.1,12);d.translate(0,.05,0);const l=new Yt(.08,.08,.08);l.translate(0,.04,0);const h=new we;h.setAttribute("position",new Qe([0,0,0,1,0,0],3));const p=new Ki(.0075,.0075,.5,3);p.translate(0,.25,0);function u(O,q){const v=new aC(O,.0075,3,64,q*Math.PI*2);return v.rotateY(Math.PI/2),v.rotateX(Math.PI/2),v}function f(){const O=new we;return O.setAttribute("position",new Qe([0,0,0,1,1,1],3)),O}const m={X:[[new dA(d,I),[.5,0,0],[0,0,-Math.PI/2]],[new dA(d,I),[-.5,0,0],[0,0,Math.PI/2]],[new dA(p,I),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new dA(d,o),[0,.5,0]],[new dA(d,o),[0,-.5,0],[Math.PI,0,0]],[new dA(p,o)]],Z:[[new dA(d,s),[0,0,.5],[Math.PI/2,0,0]],[new dA(d,s),[0,0,-.5],[-Math.PI/2,0,0]],[new dA(p,s),null,[Math.PI/2,0,0]]],XYZ:[[new dA(new hC(.1,0),B.clone()),[0,0,0]]],XY:[[new dA(new Yt(.15,.15,.01),a.clone()),[.15,.15,0]]],YZ:[[new dA(new Yt(.15,.15,.01),n.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new dA(new Yt(.15,.15,.01),C.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},M={X:[[new dA(new Ki(.2,0,.6,4),t),[.3,0,0],[0,0,-Math.PI/2]],[new dA(new Ki(.2,0,.6,4),t),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new dA(new Ki(.2,0,.6,4),t),[0,.3,0]],[new dA(new Ki(.2,0,.6,4),t),[0,-.3,0],[0,0,Math.PI]]],Z:[[new dA(new Ki(.2,0,.6,4),t),[0,0,.3],[Math.PI/2,0,0]],[new dA(new Ki(.2,0,.6,4),t),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new dA(new hC(.2,0),t)]],XY:[[new dA(new Yt(.2,.2,.01),t),[.15,.15,0]]],YZ:[[new dA(new Yt(.2,.2,.01),t),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new dA(new Yt(.2,.2,.01),t),[.15,0,.15],[-Math.PI/2,0,0]]]},k={START:[[new dA(new hC(.01,2),i),null,null,null,"helper"]],END:[[new dA(new hC(.01,2),i),null,null,null,"helper"]],DELTA:[[new qi(f(),i),null,null,null,"helper"]],X:[[new qi(h,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new qi(h,i.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new qi(h,i.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},S={XYZE:[[new dA(u(.5,1),c),null,[0,Math.PI/2,0]]],X:[[new dA(u(.5,.5),I)]],Y:[[new dA(u(.5,.5),o),null,[0,0,-Math.PI/2]]],Z:[[new dA(u(.5,.5),s),null,[0,Math.PI/2,0]]],E:[[new dA(u(.75,1),Q),null,[0,Math.PI/2,0]]]},F={AXIS:[[new qi(h,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},w={XYZE:[[new dA(new qs(.25,10,8),t)]],X:[[new dA(new aC(.5,.1,4,24),t),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new dA(new aC(.5,.1,4,24),t),[0,0,0],[Math.PI/2,0,0]]],Z:[[new dA(new aC(.5,.1,4,24),t),[0,0,0],[0,0,-Math.PI/2]]],E:[[new dA(new aC(.75,.1,2,24),t)]]},R={X:[[new dA(l,I),[.5,0,0],[0,0,-Math.PI/2]],[new dA(p,I),[0,0,0],[0,0,-Math.PI/2]],[new dA(l,I),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new dA(l,o),[0,.5,0]],[new dA(p,o)],[new dA(l,o),[0,-.5,0],[0,0,Math.PI]]],Z:[[new dA(l,s),[0,0,.5],[Math.PI/2,0,0]],[new dA(p,s),[0,0,0],[Math.PI/2,0,0]],[new dA(l,s),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new dA(new Yt(.15,.15,.01),a),[.15,.15,0]]],YZ:[[new dA(new Yt(.15,.15,.01),n),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new dA(new Yt(.15,.15,.01),C),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new dA(new Yt(.1,.1,.1),B.clone())]]},H={X:[[new dA(new Ki(.2,0,.6,4),t),[.3,0,0],[0,0,-Math.PI/2]],[new dA(new Ki(.2,0,.6,4),t),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new dA(new Ki(.2,0,.6,4),t),[0,.3,0]],[new dA(new Ki(.2,0,.6,4),t),[0,-.3,0],[0,0,Math.PI]]],Z:[[new dA(new Ki(.2,0,.6,4),t),[0,0,.3],[Math.PI/2,0,0]],[new dA(new Ki(.2,0,.6,4),t),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new dA(new Yt(.2,.2,.01),t),[.15,.15,0]]],YZ:[[new dA(new Yt(.2,.2,.01),t),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new dA(new Yt(.2,.2,.01),t),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new dA(new Yt(.2,.2,.2),t),[0,0,0]]]},Y={X:[[new qi(h,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new qi(h,i.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new qi(h,i.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function J(O){const q=new pA;for(const v in O)for(let T=O[v].length;T--;){const V=O[v][T][0].clone(),AA=O[v][T][1],sA=O[v][T][2],QA=O[v][T][3],FA=O[v][T][4];V.name=v,V.tag=FA,AA&&V.position.set(AA[0],AA[1],AA[2]),sA&&V.rotation.set(sA[0],sA[1],sA[2]),QA&&V.scale.set(QA[0],QA[1],QA[2]),V.updateMatrix();const iA=V.geometry.clone();iA.applyMatrix4(V.matrix),V.geometry=iA,V.renderOrder=1/0,V.position.set(0,0,0),V.rotation.set(0,0,0),V.scale.set(1,1,1),q.add(V)}return q}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=J(m)),this.add(this.gizmo.rotate=J(S)),this.add(this.gizmo.scale=J(R)),this.add(this.picker.translate=J(M)),this.add(this.picker.rotate=J(w)),this.add(this.picker.scale=J(H)),this.add(this.helper.translate=J(k)),this.add(this.helper.rotate=J(F)),this.add(this.helper.scale=J(Y)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(A){const t=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:jf;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let i=[];i=i.concat(this.picker[this.mode].children),i=i.concat(this.gizmo[this.mode].children),i=i.concat(this.helper[this.mode].children);for(let I=0;I<i.length;I++){const o=i[I];o.visible=!0,o.rotation.set(0,0,0),o.position.copy(this.worldPosition);let s;if(this.camera.isOrthographicCamera?s=(this.camera.top-this.camera.bottom)/this.camera.zoom:s=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),o.scale.set(1,1,1).multiplyScalar(s*this.size/4),o.tag==="helper"){o.visible=!1,o.name==="AXIS"?(o.visible=!!this.axis,this.axis==="X"&&(ti.setFromEuler(Pp.set(0,0,0)),o.quaternion.copy(t).multiply(ti),Math.abs(qt.copy(kh).applyQuaternion(t).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Y"&&(ti.setFromEuler(Pp.set(0,0,Math.PI/2)),o.quaternion.copy(t).multiply(ti),Math.abs(qt.copy(Vr).applyQuaternion(t).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Z"&&(ti.setFromEuler(Pp.set(0,Math.PI/2,0)),o.quaternion.copy(t).multiply(ti),Math.abs(qt.copy(Rh).applyQuaternion(t).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="XYZE"&&(ti.setFromEuler(Pp.set(0,Math.PI/2,0)),qt.copy(this.rotationAxis),o.quaternion.setFromRotationMatrix(Sq.lookAt(wq,qt,Vr)),o.quaternion.multiply(ti),o.visible=this.dragging),this.axis==="E"&&(o.visible=!1)):o.name==="START"?(o.position.copy(this.worldPositionStart),o.visible=this.dragging):o.name==="END"?(o.position.copy(this.worldPosition),o.visible=this.dragging):o.name==="DELTA"?(o.position.copy(this.worldPositionStart),o.quaternion.copy(this.worldQuaternionStart),iI.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),iI.applyQuaternion(this.worldQuaternionStart.clone().invert()),o.scale.copy(iI),o.visible=this.dragging):(o.quaternion.copy(t),this.dragging?o.position.copy(this.worldPositionStart):o.position.copy(this.worldPosition),this.axis&&(o.visible=this.axis.search(o.name)!==-1));continue}o.quaternion.copy(t),this.mode==="translate"||this.mode==="scale"?(o.name==="X"&&Math.abs(qt.copy(kh).applyQuaternion(t).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Y"&&Math.abs(qt.copy(Vr).applyQuaternion(t).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Z"&&Math.abs(qt.copy(Rh).applyQuaternion(t).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XY"&&Math.abs(qt.copy(Rh).applyQuaternion(t).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="YZ"&&Math.abs(qt.copy(kh).applyQuaternion(t).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XZ"&&Math.abs(qt.copy(Vr).applyQuaternion(t).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1)):this.mode==="rotate"&&(Wp.copy(t),qt.copy(this.eye).applyQuaternion(ti.copy(t).invert()),o.name.search("E")!==-1&&o.quaternion.setFromRotationMatrix(Sq.lookAt(this.eye,wq,Vr)),o.name==="X"&&(ti.setFromAxisAngle(kh,Math.atan2(-qt.y,qt.z)),ti.multiplyQuaternions(Wp,ti),o.quaternion.copy(ti)),o.name==="Y"&&(ti.setFromAxisAngle(Vr,Math.atan2(qt.x,qt.z)),ti.multiplyQuaternions(Wp,ti),o.quaternion.copy(ti)),o.name==="Z"&&(ti.setFromAxisAngle(Rh,Math.atan2(qt.y,qt.x)),ti.multiplyQuaternions(Wp,ti),o.quaternion.copy(ti))),o.visible=o.visible&&(o.name.indexOf("X")===-1||this.showX),o.visible=o.visible&&(o.name.indexOf("Y")===-1||this.showY),o.visible=o.visible&&(o.name.indexOf("Z")===-1||this.showZ),o.visible=o.visible&&(o.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),o.material._color=o.material._color||o.material.color.clone(),o.material._opacity=o.material._opacity||o.material.opacity,o.material.color.copy(o.material._color),o.material.opacity=o.material._opacity,this.enabled&&this.axis&&(o.name===this.axis||this.axis.split("").some(function(n){return o.name===n}))&&(o.material.color.setHex(16776960),o.material.opacity=1)}super.updateMatrixWorld(A)}}class K9 extends dA{constructor(){super(new Vi(1e5,1e5,2,2),new at({visible:!1,wireframe:!0,side:ut,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(A){let e=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(e="local"),jp.copy(kh).applyQuaternion(e==="local"?this.worldQuaternion:jf),$c.copy(Vr).applyQuaternion(e==="local"?this.worldQuaternion:jf),Ah.copy(Rh).applyQuaternion(e==="local"?this.worldQuaternion:jf),qt.copy($c),this.mode){case"translate":case"scale":switch(this.axis){case"X":qt.copy(this.eye).cross(jp),Ts.copy(jp).cross(qt);break;case"Y":qt.copy(this.eye).cross($c),Ts.copy($c).cross(qt);break;case"Z":qt.copy(this.eye).cross(Ah),Ts.copy(Ah).cross(qt);break;case"XY":Ts.copy(Ah);break;case"YZ":Ts.copy(jp);break;case"XZ":qt.copy(Ah),Ts.copy($c);break;case"XYZ":case"E":Ts.set(0,0,0);break}break;case"rotate":default:Ts.set(0,0,0)}Ts.length()===0?this.quaternion.copy(this.cameraQuaternion):(mq.lookAt(iI.set(0,0,0),Ts,qt),this.quaternion.setFromRotationMatrix(mq)),super.updateMatrixWorld(A)}}const J9=IA("debugpatch");function xw(g,A,e,t){const i=J9===A;if(!e&&!t)return;const I=A+"___needle";v9(g,A,e,t);const o=Object.getOwnPropertyDescriptor(g,A),s=g[A];i&&console.log("Patch",g.constructor.name,A,o,s),o?(i&&console.log("Apply patch with existing descriptor",g.constructor.name,A,o),typeof o.value=="function"&&(g[A]=Gq(o.value,g,A))):(i&&console.log("Create patch with new property",g.constructor.name,A,o),Object.defineProperty(g,A,{set:function(n){if(typeof n=="function")this[I]=Gq(n,g,A);else{const C=this[I];I2(g,A,this,C,n),this[I]=n,o2(g,A,this,C,n)}},get:function(){const n=this[I];return typeof n=="function"&&n[I]?n[I]:n}}))}function q9(g,A,e){const t=bU(g,A);if(t)for(let i=t.length-1;i>=0;i--){const I=t[i];I.prefix===e&&(I.prefix=null),I.postfix===e&&(I.postfix=null),!I.prefix&&!I.postfix&&t.splice(i,1)}}const Mq=Symbol("Needle:Patches:WrappedFunction");function Gq(g,A,e){if(g[Mq])return g;const t=function(...i){I2(A,e,this,...i);const I=g.apply(this,i);return o2(A,e,this,I,...i),I};return t[Mq]=!0,t}const zf="Needle:Patches";function TG(){return globalThis[zf]||(globalThis[zf]=new WeakMap),globalThis[zf]}function bU(g,A){const e=TG().get(g);return e?e.get(A):null}function v9(g,A,e,t){let i=TG().get(g);i||(i=new Map,TG().set(g,i));let I=i.get(A);I||(I=[],i.set(A,I)),I.push({prefix:e,postfix:t})}function I2(g,A,e,...t){var I;if(!e)return;const i=bU(g,A);if(i)for(const o of i)(I=o.prefix)==null||I.call(e,...t)}function o2(g,A,e,t,...i){var o;if(!e)return;const I=bU(g,A);if(I)for(const s of I)(o=s.postfix)==null||o.call(e,t,...i)}const kq=Symbol("gltf-loader-internal-usage-tracker"),b9=IA("debugusers"),ll=class{constructor(A){r(this,"parser");r(this,"_getDependency");r(this,"_loadingId");r(this,"_loadedObjects",new Set);this.parser=A,this._getDependency=this.parser.getDependency,this._loadingId=Date.now().toString()}get name(){return"NEEDLE_internal_usage_tracker"}static isLoading(A){return ll._loadingProcesses>0}beforeRoot(){ll._loadingProcesses++;const A=this,e=this._getDependency;return this.parser.getDependency=function(t,i){const I=e.call(this,t,i);return I.then(o=>(o&&(A._loadedObjects.add(o),o[kq]=A._loadingId),o)),I},null}afterRoot(A){ll._loadingProcesses--,this.parser.getDependency=this._getDependency;for(const e of this._loadedObjects)delete e[kq],e instanceof pA&&(e.parent||e instanceof dA&&(b9&&console.warn("> GLTF LOADER: Mesh not used in scene!",e),e.material=null,e.geometry=null));return null}};let Xh=ll;r(Xh,"_loadingProcesses",0);class s2{constructor(){window.addEventListener("unhandledrejection",A=>{var t;if(A.defaultPrevented)return;const e=(t=A==null?void 0:A.reason)==null?void 0:t.path;if(e){const i=e[0];i&&i.tagName==="IMG"&&(console.warn(`Could not load image:
4325
- `+i.src),A.preventDefault())}})}}const Yw=IA("trackresources");function n2(){return Yw==="dispose"}let xB=!0;Yw===0&&(xB=!1);function L9(g){xB=g}function C2(){return xB}const a2=Symbol("disposable");function LU(g,A){g&&(g[a2]=A,cB&&console.warn("Set disposable",A,g))}const r2=Symbol("disposed");function x9(g){return g[r2]===!0}function bt(g){var A;if(g){if(g[a2]===!1){cB&&console.warn("Object is marked as not disposable",g);return}if(g[r2]=!0,g instanceof aI)bt(g.environment),bt(g.background),bt(g.customDepthMaterial),bt(g.customDistanceMaterial);else if(g instanceof Ms)bt(g.geometry),bt(g.material),bt(g.skeleton),bt(g.bindMatrix),bt(g.bindMatrixInverse),bt(g.customDepthMaterial),bt(g.customDistanceMaterial),g.geometry=null,g.material=null;else if(g instanceof dA)bt(g.geometry),bt(g.material),bt(g.customDepthMaterial),bt(g.customDistanceMaterial),g.geometry=null,g.material=null;else if(g instanceof we){JQ(g);for(const e of Object.keys(g.attributes)){const t=g.attributes[e];bt(t)}}else if(g instanceof ge||g instanceof NI)cB&&console.warn("BufferAttribute dispose not supported",g.count);else if(g instanceof Array)for(const e of g)e instanceof Ye&&bt(e);else if(g instanceof Ye){JQ(g);for(const t of Object.keys(g)){const i=g[t];i instanceof Je&&(bt(i),g[t]=null)}const e=g.uniforms;if(e)for(const t of Object.keys(e)){const i=e[t];i instanceof Je?(bt(i),e[t]=null):i instanceof wA&&(bt(i.value),i.value=null)}}else g instanceof Je?(JQ(g),JQ(g.source),((A=g.source)==null?void 0:A.data)instanceof ImageBitmap&&JQ(g.source.data)):g instanceof ic?(JQ(g.boneTexture),g.boneTexture=null):g instanceof Gd||!(g instanceof pA)&&cB&&console.warn("Unknown object type",g)}}function JQ(g){g&&((cB||n2()||Yw)&&console.warn("🧨 FREE",g),g instanceof ImageBitmap?g.close():g instanceof cC?g.data=null:g.dispose())}function B2(g){(g instanceof dA||g instanceof Ms)&&(g.material=null,g.geometry=null)}const Y9=new Set;function xU(g,A,e=null,t){if(t||(t=Y9,t.clear()),!g)return t;const i=g[Ol];if(i)for(const I of i)t.has(I)||(e==null?void 0:e.call(null,I))!==!1&&(t.add(I),A&&xU(I,!0,e,t));return t}function T9(g){return g[Uh]}const cB=IA("debugresourceusers")||IA("debugmemory"),Ol=Symbol("needle-resource-users"),Uh=Symbol("needle-resource-users-count");function lI(g,A){xw(g,A,function(e,t){xB&&($D(Ol,this,e,!1),$D(Ol,this,t,!0))})}xB&&(lI(dA.prototype,"material"),lI(dA.prototype,"geometry"),lI(Ye.prototype,"map"),lI(Ye.prototype,"bumpMap"),lI(Ye.prototype,"alphaMap"),lI(Ye.prototype,"normalMap"),lI(Ye.prototype,"displacementMap"),lI(Ye.prototype,"roughnessMap"),lI(Ye.prototype,"metalnessMap"),lI(Ye.prototype,"emissiveMap"),lI(Ye.prototype,"specularMap"),lI(Ye.prototype,"envMap"),lI(Ye.prototype,"lightMap"),lI(Ye.prototype,"aoMap"),lI(Ye.prototype,"gradientMap"));function _9(g){if(xB===!1)return;const A=g[Ol];if(A)for(const e of A)$D(Ol,e,g,!1)}xB&&xw(Ye.prototype,"dispose",function(){_9(this)});let _G=0;function $D(g,A,e,t){if(_G>0)return;if(Array.isArray(e)){for(const I of e)$D(g,A,I,t);return}if(!e)return;let i=e[g];if(i||(i=new Set),t){if(A&&!i.has(A)){i.add(A);let I=e[Uh]||0;I+=1,e[Uh]=I,cB&&console.warn(`🟢 Added user of "${e.type}"`,A,e,I,"users:",i)}}else if(A&&i.has(A)){i.delete(A);let I=e[Uh]||0;I>0&&(I-=1,e[Uh]=I),cB&&console.warn(`🔴 Removed user of "${e.type}"`,A,e,I,"users:",i),I<=0&&(Xh.isLoading(e)||(Yw&&console.warn(`🔴 Removed all user of "${e.type}"`,e),n2()&&bt(e)))}e[g]=i}try{xw(qC.prototype,"render",function(){_G++},function(){_G--})}catch(g){console.warn("Could not wrap WebGLRenderer.render",g)}var xd=(g=>(g.Added="component-added",g.Removing="removing-component",g))(xd||{});const Rq=IA("debugcomponentevents");class Yd{static addComponentLifecylceEventListener(A,e){this.eventListeners.has(A)&&this.eventListeners.set(A,[]);let t=this.eventListeners.get(A);t||(t=[]),t.push(e),this.eventListeners.set(A,t),Rq&&console.log("Added event listener for "+A,this.eventListeners)}static removeComponentLifecylceEventListener(A,e){const t=this.eventListeners.get(A);if(!t)return;const i=t.indexOf(e);i<0||t.splice(i,1)}static dispatchComponentLifecycleEvent(A,e){const t=this.eventListeners.get(A);if(Rq&&console.log("Dispatching event "+A,t),!!t)for(const i of t)i(e)}}r(Yd,"eventListeners",new Map);const Q2=IA("debugdefines");oc('if(!globalThis[""3.34.0-alpha.1""]) globalThis[""3.34.0-alpha.1""] = "0.0.0";');oc('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";');oc('if(!globalThis[""Thu Mar 07 2024 01:47:46 GMT+0800 (Pacific Standard Time)""]) globalThis[""Thu Mar 07 2024 01:47:46 GMT+0800 (Pacific Standard Time)""] = "unknown";');oc('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.34.0-alpha.1";');oc('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');oc('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Mar 07 2024 01:47:46 GMT+0800 (Pacific Standard Time)";');const Bn="3.34.0-alpha.1",Tw="undefined",YU="Thu Mar 07 2024 01:47:46 GMT+0800 (Pacific Standard Time)";Q2&&console.log(`Engine version: ${Bn} (generator: ${Tw})
4325
+ `+i.src),A.preventDefault())}})}}const Yw=IA("trackresources");function n2(){return Yw==="dispose"}let xB=!0;Yw===0&&(xB=!1);function L9(g){xB=g}function C2(){return xB}const a2=Symbol("disposable");function LU(g,A){g&&(g[a2]=A,cB&&console.warn("Set disposable",A,g))}const r2=Symbol("disposed");function x9(g){return g[r2]===!0}function bt(g){var A;if(g){if(g[a2]===!1){cB&&console.warn("Object is marked as not disposable",g);return}if(g[r2]=!0,g instanceof aI)bt(g.environment),bt(g.background),bt(g.customDepthMaterial),bt(g.customDistanceMaterial);else if(g instanceof Ms)bt(g.geometry),bt(g.material),bt(g.skeleton),bt(g.bindMatrix),bt(g.bindMatrixInverse),bt(g.customDepthMaterial),bt(g.customDistanceMaterial),g.geometry=null,g.material=null;else if(g instanceof dA)bt(g.geometry),bt(g.material),bt(g.customDepthMaterial),bt(g.customDistanceMaterial),g.geometry=null,g.material=null;else if(g instanceof we){JQ(g);for(const e of Object.keys(g.attributes)){const t=g.attributes[e];bt(t)}}else if(g instanceof ge||g instanceof NI)cB&&console.warn("BufferAttribute dispose not supported",g.count);else if(g instanceof Array)for(const e of g)e instanceof Ye&&bt(e);else if(g instanceof Ye){JQ(g);for(const t of Object.keys(g)){const i=g[t];i instanceof Je&&(bt(i),g[t]=null)}const e=g.uniforms;if(e)for(const t of Object.keys(e)){const i=e[t];i instanceof Je?(bt(i),e[t]=null):i instanceof wA&&(bt(i.value),i.value=null)}}else g instanceof Je?(JQ(g),JQ(g.source),((A=g.source)==null?void 0:A.data)instanceof ImageBitmap&&JQ(g.source.data)):g instanceof ic?(JQ(g.boneTexture),g.boneTexture=null):g instanceof Gd||!(g instanceof pA)&&cB&&console.warn("Unknown object type",g)}}function JQ(g){g&&((cB||n2()||Yw)&&console.warn("🧨 FREE",g),g instanceof ImageBitmap?g.close():g instanceof cC?g.data=null:g.dispose())}function B2(g){(g instanceof dA||g instanceof Ms)&&(g.material=null,g.geometry=null)}const Y9=new Set;function xU(g,A,e=null,t){if(t||(t=Y9,t.clear()),!g)return t;const i=g[Ol];if(i)for(const I of i)t.has(I)||(e==null?void 0:e.call(null,I))!==!1&&(t.add(I),A&&xU(I,!0,e,t));return t}function T9(g){return g[Uh]}const cB=IA("debugresourceusers")||IA("debugmemory"),Ol=Symbol("needle-resource-users"),Uh=Symbol("needle-resource-users-count");function lI(g,A){xw(g,A,function(e,t){xB&&($D(Ol,this,e,!1),$D(Ol,this,t,!0))})}xB&&(lI(dA.prototype,"material"),lI(dA.prototype,"geometry"),lI(Ye.prototype,"map"),lI(Ye.prototype,"bumpMap"),lI(Ye.prototype,"alphaMap"),lI(Ye.prototype,"normalMap"),lI(Ye.prototype,"displacementMap"),lI(Ye.prototype,"roughnessMap"),lI(Ye.prototype,"metalnessMap"),lI(Ye.prototype,"emissiveMap"),lI(Ye.prototype,"specularMap"),lI(Ye.prototype,"envMap"),lI(Ye.prototype,"lightMap"),lI(Ye.prototype,"aoMap"),lI(Ye.prototype,"gradientMap"));function _9(g){if(xB===!1)return;const A=g[Ol];if(A)for(const e of A)$D(Ol,e,g,!1)}xB&&xw(Ye.prototype,"dispose",function(){_9(this)});let _G=0;function $D(g,A,e,t){if(_G>0)return;if(Array.isArray(e)){for(const I of e)$D(g,A,I,t);return}if(!e)return;let i=e[g];if(i||(i=new Set),t){if(A&&!i.has(A)){i.add(A);let I=e[Uh]||0;I+=1,e[Uh]=I,cB&&console.warn(`🟢 Added user of "${e.type}"`,A,e,I,"users:",i)}}else if(A&&i.has(A)){i.delete(A);let I=e[Uh]||0;I>0&&(I-=1,e[Uh]=I),cB&&console.warn(`🔴 Removed user of "${e.type}"`,A,e,I,"users:",i),I<=0&&(Xh.isLoading(e)||(Yw&&console.warn(`🔴 Removed all user of "${e.type}"`,e),n2()&&bt(e)))}e[g]=i}try{xw(qC.prototype,"render",function(){_G++},function(){_G--})}catch(g){console.warn("Could not wrap WebGLRenderer.render",g)}var xd=(g=>(g.Added="component-added",g.Removing="removing-component",g))(xd||{});const Rq=IA("debugcomponentevents");class Yd{static addComponentLifecylceEventListener(A,e){this.eventListeners.has(A)&&this.eventListeners.set(A,[]);let t=this.eventListeners.get(A);t||(t=[]),t.push(e),this.eventListeners.set(A,t),Rq&&console.log("Added event listener for "+A,this.eventListeners)}static removeComponentLifecylceEventListener(A,e){const t=this.eventListeners.get(A);if(!t)return;const i=t.indexOf(e);i<0||t.splice(i,1)}static dispatchComponentLifecycleEvent(A,e){const t=this.eventListeners.get(A);if(Rq&&console.log("Dispatching event "+A,t),!!t)for(const i of t)i(e)}}r(Yd,"eventListeners",new Map);const Q2=IA("debugdefines");oc('if(!globalThis[""3.34.0-alpha.2""]) globalThis[""3.34.0-alpha.2""] = "0.0.0";');oc('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";');oc('if(!globalThis[""Thu Mar 07 2024 14:14:30 GMT+0100 (Central European Standard Time)""]) globalThis[""Thu Mar 07 2024 14:14:30 GMT+0100 (Central European Standard Time)""] = "unknown";');oc('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.34.0-alpha.2";');oc('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');oc('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Mar 07 2024 14:14:30 GMT+0100 (Central European Standard Time)";');const Bn="3.34.0-alpha.2",Tw="undefined",YU="Thu Mar 07 2024 14:14:30 GMT+0100 (Central European Standard Time)";Q2&&console.log(`Engine version: ${Bn} (generator: ${Tw})
4326
4326
  Project built at ${YU}`);const yC="needle_isActiveInHierarchy",Xr="builtin_components",$h="needle_editor_guid";function oc(g){try{(0,eval)(g)}catch(A){Q2&&console.error(A)}}const Pl=Symbol("NEEDLE_NEED_UPDATE_INSTANCE"),E2=Symbol("isUsingInstancing"),c2=Symbol("instancingRenderer"),HG=Symbol("instancingAutoUpdateBounds");class ks{static isUsingInstancing(A){return A[E2]===!0}static getRenderer(A){return A[c2]||null}setAutoUpdateBounds(A,e){const t=ks.getRenderer(A);t&&(t[HG]=e)}static markDirty(A,e=!0){if(A&&(this.isUsingInstancing(A)&&(A[Pl]=!0,A.matrixWorldNeedsUpdate=!0),e))for(const t of A.children)ks.markDirty(t,!0)}}function hB(g,A){try{A?g(A):g()}catch(e){return console.error(e),!1}return!0}const OG=IA("debugnewscripts"),H9=IA("debughierarchy"),Ai=[];function O9(){return Ai.length>0}function Ay(g){if(!(g.new_scripts.length<=0)){if(OG&&console.log("Register new components",g.new_scripts.length,[...g.new_scripts],g.alias?"element: "+g.alias:g.hash,g),g.new_scripts_pre_setup_callbacks.length>0){for(const A of g.new_scripts_pre_setup_callbacks)A&&A();g.new_scripts_pre_setup_callbacks.length=0}Ai.length=0,g.new_scripts.length>0&&Ai.push(...g.new_scripts),g.new_scripts.length=0;for(let A=0;A<Ai.length;A++)try{const e=Ai[A];if(e.isComponent!==!0){(De()||OG)&&console.error(`Registered script is not a Needle Engine component.
4327
4327
  The script will be ignored. Please make sure your component extends "Behaviour" imported from "@needle-tools/engine"
4328
4328
  `,e),Ai.splice(A,1),A--;continue}if(e.destroyed)continue;if(!e.gameObject){console.error("MISSING GAMEOBJECT - will ignore",e),Ai.splice(A,1),A--;continue}e.context=g,Al(e.gameObject),TU(e,g)}catch(e){console.error(e),rC(Ai[A],g),Ai.splice(A,1),A--}for(let A=0;A<Ai.length;A++)try{const e=Ai[A];if(e.destroyed){rC(Ai[A],g),Ai.splice(A,1),A--;continue}if(e.registering)try{e.registering()}catch(t){console.error(t)}e.__internalAwake!==void 0&&(e.gameObject||console.error("MISSING GAMEOBJECT",e,e.gameObject),Al(e.gameObject),e.activeAndEnabled&&hB(e.__internalAwake.bind(e)))}catch(e){console.error(e),rC(Ai[A],g),Ai.splice(A,1),A--}for(let A=0;A<Ai.length;A++)try{const e=Ai[A];if(e.destroyed||e.enabled===!1||(Al(e.gameObject),e.activeAndEnabled===!1))continue;e.__internalEnable!==void 0&&(e.enabled=!0,hB(e.__internalEnable.bind(e)))}catch(e){console.error(e),rC(Ai[A],g),Ai.splice(A,1),A--}for(let A=0;A<Ai.length;A++)try{const e=Ai[A];if(e.destroyed||!e.gameObject)continue;g.new_script_start.push(e)}catch(e){console.error(e),rC(Ai[A],g),Ai.splice(A,1),A--}Ai.length=0;for(const A of g.new_scripts_post_setup_callbacks)A&&A();g.new_scripts_post_setup_callbacks.length=0}}function P9(g){g&&(g.__internalDisable(!0),rC(g,g.context))}function h2(g,A){for(let e=0;e<g.new_script_start.length;e++)try{const t=g.new_script_start[e];if(A!==void 0&&t.gameObject!==A||t.destroyed||t.activeAndEnabled===!1)continue;hB(t.__internalAwake.bind(t)),t.enabled&&(hB(t.__internalEnable.bind(t)),hB(t.__internalStart.bind(t)),g.new_script_start.splice(e,1),e--)}catch(t){console.error(t),rC(g.new_script_start[e],g),g.new_script_start.splice(e,1),e--}}function TU(g,A){A.scripts.indexOf(g)===-1&&(A.scripts.push(g),g.earlyUpdate&&A.scripts_earlyUpdate.push(g),g.update&&A.scripts_update.push(g),g.lateUpdate&&A.scripts_lateUpdate.push(g),g.onBeforeRender&&A.scripts_onBeforeRender.push(g),g.onAfterRender&&A.scripts_onAfterRender.push(g),g.onPausedChanged&&A.scripts_pausedChanged.push(g),lm(g,null)&&A.new_scripts_xr.push(g),lm(g,"immersive-vr")&&A.scripts_immersive_vr.push(g),lm(g,"immersive-ar")&&A.scripts_immersive_ar.push(g))}function rC(g,A){Jo(g,A.new_scripts),Jo(g,A.new_script_start),Jo(g,A.scripts),Jo(g,A.scripts_earlyUpdate),Jo(g,A.scripts_update),Jo(g,A.scripts_lateUpdate),Jo(g,A.scripts_onBeforeRender),Jo(g,A.scripts_onAfterRender),Jo(g,A.scripts_pausedChanged),Jo(g,A.new_scripts_xr),Jo(g,A.scripts_immersive_vr),Jo(g,A.scripts_immersive_ar),A.stopAllCoroutinesFrom(g)}function Jo(g,A){const e=A.indexOf(g);e>=0&&A.splice(e,1)}function lm(g,A){var e;if(g){const t=g;if(t.onBeforeXR||t.onEnterXR||t.onUpdateXR||t.onLeaveXR||t.onXRControllerAdded||t.onXRControllerRemoved)return!(A!=null&&((e=t.supportsXR)==null?void 0:e.call(t,A))===!1)}return!1}function Vf(g){if(g||(g=Bt.Current.scene),!g){console.trace("Invalid call - no current context.");return}const A=nc(g);l2(g,A,!0)||(OG||De()?console.error(`Error updating hierarchy
@@ -4844,7 +4844,7 @@ Please change to:
4844
4844
  ${s}? : Object3D;
4845
4845
 
4846
4846
  in script ${t}.ts
4847
- <a href="https://docs.needle.tools/serializable" target="_blank">documentation</a>`),console.warn(t,s,g[s],g);continue}}else if(!Array.isArray(n)&&((o=n.constructor)==null?void 0:o.name)==="Object"){const B='You might be missing a @serializable(Type) decorator for field "'+s+'" in '+t+".ts";console.warn(B+`
4847
+ <a href="https://docs.needle.tools/serializable" target="_blank">documentation</a>`),console.warn(t,s,g[s],g);continue}}else if(!Array.isArray(n)&&((o=n.constructor)==null?void 0:o.name)==="Object"&&!n.constructor["did_warn:missing_serializable"]){n.constructor["did_warn:missing_serializable"]=!0;const B='You might be missing a @serializable(Type) decorator for field "'+s+'" in '+t+".ts";console.warn(B+`
4848
4848
  `,C),an(co.Warn,"Deserialization issue: Please check the console for details!")}}if(typeof n=="string"&&(C.endsWith(".gltf")||C.endsWith(".glb"))){an(co.Warn,`<strong>Missing serialization for object reference!</strong>
4849
4849
 
4850
4850
  Please change to:
@@ -316,9 +316,12 @@ function checkObjectAssignments(obj, serializedData, implementationInformation)
316
316
  // we can check the constructor name because this is dev only
317
317
  const valueName = value.constructor?.name;
318
318
  if (valueName === "Object") {
319
- const warning = "You might be missing a @serializable(Type) decorator for field \"" + key + "\" in " + typeName + ".ts";
320
- console.warn(warning + "\n", serialized);
321
- addLog(LogType.Warn, "Deserialization issue: Please check the console for details!");
319
+ if (!value.constructor["did_warn:missing_serializable"]) {
320
+ value.constructor["did_warn:missing_serializable"] = true;
321
+ const warning = "You might be missing a @serializable(Type) decorator for field \"" + key + "\" in " + typeName + ".ts";
322
+ console.warn(warning + "\n", serialized);
323
+ addLog(LogType.Warn, "Deserialization issue: Please check the console for details!");
324
+ }
322
325
  }
323
326
  }
324
327
  }
@@ -1 +1 @@
1
- {"version":3,"file":"engine_serialization_core.js","sourceRoot":"","sources":["../../src/engine/engine_serialization_core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAY,OAAO,EAAE,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,MAAM,EAAC,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAE7E,MAAM,KAAK,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAM1C,wEAAwE;AACxE,sFAAsF;AACtF,MAAM,mBAAmB;IACrB,QAAQ,CAAC,IAAsB,EAAE,GAAoB;QACjD,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACxC,IAAI,QAAQ,KAAK,GAAG;gBAAE,OAAO;YAC7B,OAAO,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,wBAAwB,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;SAC1E;QACD,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MAAM,CAAC,wBAAwB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;KACrD,QAAQ,CAAC,IAAI,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE;IACtD,OAAO,IAAI,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/engine",
3
- "version": "3.34.0-alpha.1",
3
+ "version": "3.34.0-alpha.2",
4
4
  "description": "Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in",
5
5
  "main": "dist/needle-engine.umd.cjs",
6
6
  "type": "module",
@@ -22,10 +22,10 @@ const packages_to_resolve = {
22
22
  },
23
23
  /* Removed. Three.js is manually resolved below to ensure all dependencies resolve to the same three.js version.
24
24
  'three': null,
25
+ */
25
26
  'peerjs': null,
26
27
  'websocket-ts': null,
27
28
  'md5': null,
28
- */
29
29
  }
30
30
 
31
31
  /**
@@ -19,18 +19,20 @@ export const needleAsap = async (command, config, userSettings) => {
19
19
  transformIndexHtml: {
20
20
  enforce: 'pre',
21
21
  transform(html, _ctx) {
22
- return {
23
- html,
24
- tags: [
25
- {
26
- tag: 'script',
27
- children: code,
28
- attrs: {
29
- type: "module",
30
- async: true,
31
- }
32
- },
33
- ]
22
+ if (existsSync(process.cwd() + "/node_modules/@needle-tools/engine/src/asap/needle-asap.ts")) {
23
+ return {
24
+ html,
25
+ tags: [
26
+ {
27
+ tag: 'script',
28
+ children: code,
29
+ attrs: {
30
+ type: "module",
31
+ async: true,
32
+ }
33
+ },
34
+ ]
35
+ }
34
36
  }
35
37
  }
36
38
  },
@@ -394,9 +394,12 @@ function checkObjectAssignments(obj: any, serializedData: any, implementationInf
394
394
  // we can check the constructor name because this is dev only
395
395
  const valueName = value.constructor?.name;
396
396
  if (valueName === "Object") {
397
- const warning = "You might be missing a @serializable(Type) decorator for field \"" + key + "\" in " + typeName + ".ts";
398
- console.warn(warning + "\n", serialized);
399
- addLog(LogType.Warn, "Deserialization issue: Please check the console for details!");
397
+ if (!value.constructor["did_warn:missing_serializable"]) {
398
+ value.constructor["did_warn:missing_serializable"] = true;
399
+ const warning = "You might be missing a @serializable(Type) decorator for field \"" + key + "\" in " + typeName + ".ts";
400
+ console.warn(warning + "\n", serialized);
401
+ addLog(LogType.Warn, "Deserialization issue: Please check the console for details!");
402
+ }
400
403
  }
401
404
  }
402
405
  }