ss-component-new 1.1.321 → 1.1.322

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/{array-B7a7NPJU.cjs → array-BbvvSsMu.cjs} +1 -1
  2. package/dist/{array-C-FBt-w6.js → array-D1c5z7wR.js} +2 -2
  3. package/dist/{cloneDeep-Dfe27GGP.cjs → cloneDeep-Cz5C3YTY.cjs} +1 -1
  4. package/dist/{cloneDeep-BCBo2P7c.js → cloneDeep-_BP6PqFE.js} +1 -1
  5. package/dist/{index-DtKo1EwI.cjs → index-2DyWZAdI.cjs} +1 -1
  6. package/dist/{index-B8R_1YcJ.cjs → index-8Hh6ndcp.cjs} +1 -1
  7. package/dist/{index-BQg0VVq4.cjs → index-B04yaoqW.cjs} +1 -1
  8. package/dist/{index-zKJ_fhRb.js → index-B5mGte2C.js} +1 -1
  9. package/dist/{index-BYj7719b.js → index-B5xspgKx.js} +4 -4
  10. package/dist/{index-DYKwo9dQ.cjs → index-BDEd8FiZ.cjs} +1 -1
  11. package/dist/{index-B31X029_.js → index-BHVJl56b.js} +1 -1
  12. package/dist/{index-DH_8-yVF.cjs → index-BLnGKCeV.cjs} +1 -1
  13. package/dist/{index-CvyP7SN4.cjs → index-BViHfbD_.cjs} +1 -1
  14. package/dist/{index-DJCo-V_0.js → index-Bbd67AeJ.js} +3 -3
  15. package/dist/{index-Bs0aQvhY.cjs → index-BcojRq7f.cjs} +1 -1
  16. package/dist/{index-B9ylWbtH.cjs → index-BmH4vIv5.cjs} +1 -1
  17. package/dist/{index-BW8fHFr3.cjs → index-BnhhKe8F.cjs} +1 -1
  18. package/dist/{index-IynRqxzh.js → index-Bo9FXjtY.js} +9 -9
  19. package/dist/{index-BhRm0szn.cjs → index-BtqwaqYq.cjs} +1 -1
  20. package/dist/{index-CXJxkaVz.cjs → index-BvHZX-h-.cjs} +1 -1
  21. package/dist/{index-BCoI86GW.js → index-C6JIrngm.js} +8 -8
  22. package/dist/{index-a2ldY1f-.js → index-CAc69tT_.js} +188 -175
  23. package/dist/{index-C_ALukSb.js → index-CCK5r26s.js} +5 -5
  24. package/dist/{index-9GphTnn3.js → index-CFmGx7au.js} +3 -3
  25. package/dist/{index-Bgho40P2.cjs → index-CIKYVmYG.cjs} +1 -1
  26. package/dist/{index-Ca2rHt6C.js → index-COd6JefL.js} +1 -1
  27. package/dist/{index-BeJ-4T1d.js → index-CPFvyv9G.js} +7 -7
  28. package/dist/{index-56_km5fJ.cjs → index-CS1cZGwT.cjs} +1 -1
  29. package/dist/{index-GQAcezLl.cjs → index-CVOAzSks.cjs} +1 -1
  30. package/dist/{index-XAfW8sqN.js → index-CZoo5L0I.js} +8 -8
  31. package/dist/{index-CymFMSAS.js → index-C_IxW7Md.js} +9 -9
  32. package/dist/{index-bag5UhkN.js → index-Cex_DdEz.js} +6 -6
  33. package/dist/{index-6JoL18KU.js → index-CifB8Q5h.js} +6 -6
  34. package/dist/{index-B1pGYX6g.js → index-Cq_-kyms.js} +3 -3
  35. package/dist/{index-Cum9FmiL.js → index-CvmUTrUZ.js} +7 -7
  36. package/dist/{index-CLaDIaSW.cjs → index-CvqVEDJp.cjs} +1 -1
  37. package/dist/{index-CnyOW-3P.js → index-Cy7V5CTy.js} +4 -4
  38. package/dist/{index-DSmYcj7E.cjs → index-D7VphCVl.cjs} +1 -1
  39. package/dist/{index-ZC9w1ZOi.cjs → index-DAwrHG2B.cjs} +1 -1
  40. package/dist/{index-Yb-y-7vb.js → index-DFfFpmpu.js} +5 -5
  41. package/dist/{index-BK4WawKM.cjs → index-DHpjhrEA.cjs} +1 -1
  42. package/dist/index-DK5Q4nqN.cjs +11 -0
  43. package/dist/{index-DGQdhDlx.cjs → index-DSg6qN3u.cjs} +1 -1
  44. package/dist/{index-DFnqEKzJ.cjs → index-D_43dEyj.cjs} +1 -1
  45. package/dist/{index-ETZte82B.js → index-DdlsSh-T.js} +5 -5
  46. package/dist/{index-yAPzGZyB.js → index-DfXZ2EMp.js} +3 -3
  47. package/dist/{index-B2enzaE2.js → index-DiNYreUx.js} +3 -3
  48. package/dist/{index-DzbEZsq7.cjs → index-DiPSBd5G.cjs} +1 -1
  49. package/dist/{index-41WzW0HQ.js → index-Djvu9TqC.js} +8 -8
  50. package/dist/{index-DWRuDpPB.js → index-GuVmUiOk.js} +1 -1
  51. package/dist/{index-rsQ55kHW.cjs → index-RK4ejtZg.cjs} +1 -1
  52. package/dist/{index-CO1MoNNj.cjs → index-TdIgNVKx.cjs} +1 -1
  53. package/dist/{index-CksMAtZu.cjs → index-UEe32A7X.cjs} +161 -161
  54. package/dist/{index-gv4Kx45I.cjs → index-feWSPCw8.cjs} +1 -1
  55. package/dist/index-q45-pnfC.js +5632 -0
  56. package/dist/{index-C9giOxZg.js → index-znmNCY8T.js} +6 -6
  57. package/dist/{index.vue_vue_type_script_setup_true_lang-CI6HPiSn.js → index.vue_vue_type_script_setup_true_lang-DCkScM42.js} +1 -1
  58. package/dist/{index.vue_vue_type_script_setup_true_lang-Dhlx6gOT.cjs → index.vue_vue_type_script_setup_true_lang-DXsUWEZn.cjs} +1 -1
  59. package/dist/index.vue_vue_type_style_index_0_scoped_62633fa4_lang-CMqyfT8F.js +1146 -0
  60. package/dist/index.vue_vue_type_style_index_0_scoped_62633fa4_lang-CtS3lsVS.cjs +1 -0
  61. package/dist/{index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-CUJRJXLZ.js → index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-BxpfZWjj.js} +8 -8
  62. package/dist/{index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-BRb9nIeN.cjs → index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-tJav1eMA.cjs} +1 -1
  63. package/dist/{login-DFyLmZjC.js → login-B19t0BgJ.js} +2 -2
  64. package/dist/{login-DI3Yef8J.cjs → login-CIjEq-GP.cjs} +1 -1
  65. package/dist/{main-MMs-Ocq5.cjs → main-EHe9Q7Jw.cjs} +1 -1
  66. package/dist/{main-KRl16v8X.js → main-vsUpk0Pc.js} +7 -7
  67. package/dist/{menu-ClaTWnGZ.cjs → menu-BwznZPTB.cjs} +1 -1
  68. package/dist/{menu-9axm5sPU.js → menu-DXatuTQB.js} +1 -1
  69. package/dist/model/final.pcd +19333 -0
  70. package/dist/model/target.pcd +29276 -0
  71. package/dist/obj/model.mtl +42 -0
  72. package/dist/obj/model.obj +26110 -0
  73. package/dist/ss-component.cjs +1 -1
  74. package/dist/ss-component.css +1 -1
  75. package/dist/ss-component.js +7 -7
  76. package/dist/ss-component3.cjs +1 -1
  77. package/dist/ss-component3.js +1 -1
  78. package/package.json +1 -1
  79. package/public/model/final.pcd +19333 -0
  80. package/public/model/target.pcd +29276 -0
  81. package/public/obj/model.mtl +42 -0
  82. package/public/obj/model.obj +26110 -0
  83. package/dist/index-Coyk-8_r.js +0 -5421
  84. package/dist/index-aBU24Yq6.cjs +0 -9
  85. package/dist/index.vue_vue_type_style_index_0_scoped_63a4bd9d_lang-BRkLNqo1.js +0 -1091
  86. package/dist/index.vue_vue_type_style_index_0_scoped_63a4bd9d_lang-C-PKZjBI.cjs +0 -1
@@ -1,9 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),at=require("./index-CLaDIaSW.cjs"),Ft=require("./index-DGQdhDlx.cjs"),Xe=require("./index-DFnqEKzJ.cjs"),r=require("./index-CksMAtZu.cjs"),he=require("./menu-ClaTWnGZ.cjs"),zn=require("./index-Bs0aQvhY.cjs"),ue=require("./index.vue_vue_type_style_index_0_scoped_63a4bd9d_lang-C-PKZjBI.cjs"),yt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),gt=require("./array-B7a7NPJU.cjs"),dn=require("./login-DI3Yef8J.cjs"),ht=require("./index-BpPyaNFa.cjs"),un=require("./index-BQg0VVq4.cjs"),pt=require("./cloneDeep-Dfe27GGP.cjs"),jt=require("./index-DYKwo9dQ.cjs"),Qt=require("./index-ZC9w1ZOi.cjs"),en={type:"change"},Ot={type:"start"},hn={type:"end"},Tt=new r.Ray,tn=new r.Plane,Gn=Math.cos(70*r.MathUtils.DEG2RAD),Fe=new r.Vector3,$e=2*Math.PI,xe={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Lt=1e-6;class qn extends r.Controls{constructor(o,l=null){super(o,l),this.state=xe.NONE,this.target=new r.Vector3,this.cursor=new r.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:r.MOUSE.ROTATE,MIDDLE:r.MOUSE.DOLLY,RIGHT:r.MOUSE.PAN},this.touches={ONE:r.TOUCH.ROTATE,TWO:r.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new r.Vector3,this._lastQuaternion=new r.Quaternion,this._lastTargetPosition=new r.Vector3,this._quat=new r.Quaternion().setFromUnitVectors(o.up,new r.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new r.Spherical,this._sphericalDelta=new r.Spherical,this._scale=1,this._panOffset=new r.Vector3,this._rotateStart=new r.Vector2,this._rotateEnd=new r.Vector2,this._rotateDelta=new r.Vector2,this._panStart=new r.Vector2,this._panEnd=new r.Vector2,this._panDelta=new r.Vector2,this._dollyStart=new r.Vector2,this._dollyEnd=new r.Vector2,this._dollyDelta=new r.Vector2,this._dollyDirection=new r.Vector3,this._mouse=new r.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=$n.bind(this),this._onPointerDown=Hn.bind(this),this._onPointerUp=Yn.bind(this),this._onContextMenu=eo.bind(this),this._onMouseWheel=Zn.bind(this),this._onKeyDown=Jn.bind(this),this._onTouchStart=Xn.bind(this),this._onTouchMove=Qn.bind(this),this._onMouseDown=Kn.bind(this),this._onMouseMove=Wn.bind(this),this._interceptControlDown=to.bind(this),this._interceptControlUp=no.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(o){super.connect(o),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(o){o.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=o}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(en),this.update(),this.state=xe.NONE}update(o=null){const l=this.object.position;Fe.copy(l).sub(this.target),Fe.applyQuaternion(this._quat),this._spherical.setFromVector3(Fe),this.autoRotate&&this.state===xe.NONE&&this._rotateLeft(this._getAutoRotationAngle(o)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let d=this.minAzimuthAngle,u=this.maxAzimuthAngle;isFinite(d)&&isFinite(u)&&(d<-Math.PI?d+=$e:d>Math.PI&&(d-=$e),u<-Math.PI?u+=$e:u>Math.PI&&(u-=$e),d<=u?this._spherical.theta=Math.max(d,Math.min(u,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(d+u)/2?Math.max(d,this._spherical.theta):Math.min(u,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let c=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const C=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),c=C!=this._spherical.radius}if(Fe.setFromSpherical(this._spherical),Fe.applyQuaternion(this._quatInverse),l.copy(this.target).add(Fe),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let C=null;if(this.object.isPerspectiveCamera){const h=Fe.length();C=this._clampDistance(h*this._scale);const y=h-C;this.object.position.addScaledVector(this._dollyDirection,y),this.object.updateMatrixWorld(),c=!!y}else if(this.object.isOrthographicCamera){const h=new r.Vector3(this._mouse.x,this._mouse.y,0);h.unproject(this.object);const y=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),c=y!==this.object.zoom;const m=new r.Vector3(this._mouse.x,this._mouse.y,0);m.unproject(this.object),this.object.position.sub(m).add(h),this.object.updateMatrixWorld(),C=Fe.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;C!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(C).add(this.object.position):(Tt.origin.copy(this.object.position),Tt.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Tt.direction))<Gn?this.object.lookAt(this.target):(tn.setFromNormalAndCoplanarPoint(this.object.up,this.target),Tt.intersectPlane(tn,this.target))))}else if(this.object.isOrthographicCamera){const C=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),C!==this.object.zoom&&(this.object.updateProjectionMatrix(),c=!0)}return this._scale=1,this._performCursorZoom=!1,c||this._lastPosition.distanceToSquared(this.object.position)>Lt||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Lt||this._lastTargetPosition.distanceToSquared(this.target)>Lt?(this.dispatchEvent(en),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(o){return o!==null?$e/60*this.autoRotateSpeed*o:$e/60/60*this.autoRotateSpeed}_getZoomScale(o){const l=Math.abs(o*.01);return Math.pow(.95,this.zoomSpeed*l)}_rotateLeft(o){this._sphericalDelta.theta-=o}_rotateUp(o){this._sphericalDelta.phi-=o}_panLeft(o,l){Fe.setFromMatrixColumn(l,0),Fe.multiplyScalar(-o),this._panOffset.add(Fe)}_panUp(o,l){this.screenSpacePanning===!0?Fe.setFromMatrixColumn(l,1):(Fe.setFromMatrixColumn(l,0),Fe.crossVectors(this.object.up,Fe)),Fe.multiplyScalar(o),this._panOffset.add(Fe)}_pan(o,l){const d=this.domElement;if(this.object.isPerspectiveCamera){const u=this.object.position;Fe.copy(u).sub(this.target);let c=Fe.length();c*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*o*c/d.clientHeight,this.object.matrix),this._panUp(2*l*c/d.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(o*(this.object.right-this.object.left)/this.object.zoom/d.clientWidth,this.object.matrix),this._panUp(l*(this.object.top-this.object.bottom)/this.object.zoom/d.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(o){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(o){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(o,l){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const d=this.domElement.getBoundingClientRect(),u=o-d.left,c=l-d.top,C=d.width,h=d.height;this._mouse.x=u/C*2-1,this._mouse.y=-(c/h)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(o){return Math.max(this.minDistance,Math.min(this.maxDistance,o))}_handleMouseDownRotate(o){this._rotateStart.set(o.clientX,o.clientY)}_handleMouseDownDolly(o){this._updateZoomParameters(o.clientX,o.clientX),this._dollyStart.set(o.clientX,o.clientY)}_handleMouseDownPan(o){this._panStart.set(o.clientX,o.clientY)}_handleMouseMoveRotate(o){this._rotateEnd.set(o.clientX,o.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const l=this.domElement;this._rotateLeft($e*this._rotateDelta.x/l.clientHeight),this._rotateUp($e*this._rotateDelta.y/l.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(o){this._dollyEnd.set(o.clientX,o.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(o){this._panEnd.set(o.clientX,o.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(o){this._updateZoomParameters(o.clientX,o.clientY),o.deltaY<0?this._dollyIn(this._getZoomScale(o.deltaY)):o.deltaY>0&&this._dollyOut(this._getZoomScale(o.deltaY)),this.update()}_handleKeyDown(o){let l=!1;switch(o.code){case this.keys.UP:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateUp($e*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),l=!0;break;case this.keys.BOTTOM:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateUp(-$e*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),l=!0;break;case this.keys.LEFT:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateLeft($e*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),l=!0;break;case this.keys.RIGHT:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateLeft(-$e*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),l=!0;break}l&&(o.preventDefault(),this.update())}_handleTouchStartRotate(o){if(this._pointers.length===1)this._rotateStart.set(o.pageX,o.pageY);else{const l=this._getSecondPointerPosition(o),d=.5*(o.pageX+l.x),u=.5*(o.pageY+l.y);this._rotateStart.set(d,u)}}_handleTouchStartPan(o){if(this._pointers.length===1)this._panStart.set(o.pageX,o.pageY);else{const l=this._getSecondPointerPosition(o),d=.5*(o.pageX+l.x),u=.5*(o.pageY+l.y);this._panStart.set(d,u)}}_handleTouchStartDolly(o){const l=this._getSecondPointerPosition(o),d=o.pageX-l.x,u=o.pageY-l.y,c=Math.sqrt(d*d+u*u);this._dollyStart.set(0,c)}_handleTouchStartDollyPan(o){this.enableZoom&&this._handleTouchStartDolly(o),this.enablePan&&this._handleTouchStartPan(o)}_handleTouchStartDollyRotate(o){this.enableZoom&&this._handleTouchStartDolly(o),this.enableRotate&&this._handleTouchStartRotate(o)}_handleTouchMoveRotate(o){if(this._pointers.length==1)this._rotateEnd.set(o.pageX,o.pageY);else{const d=this._getSecondPointerPosition(o),u=.5*(o.pageX+d.x),c=.5*(o.pageY+d.y);this._rotateEnd.set(u,c)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const l=this.domElement;this._rotateLeft($e*this._rotateDelta.x/l.clientHeight),this._rotateUp($e*this._rotateDelta.y/l.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(o){if(this._pointers.length===1)this._panEnd.set(o.pageX,o.pageY);else{const l=this._getSecondPointerPosition(o),d=.5*(o.pageX+l.x),u=.5*(o.pageY+l.y);this._panEnd.set(d,u)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(o){const l=this._getSecondPointerPosition(o),d=o.pageX-l.x,u=o.pageY-l.y,c=Math.sqrt(d*d+u*u);this._dollyEnd.set(0,c),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const C=(o.pageX+l.x)*.5,h=(o.pageY+l.y)*.5;this._updateZoomParameters(C,h)}_handleTouchMoveDollyPan(o){this.enableZoom&&this._handleTouchMoveDolly(o),this.enablePan&&this._handleTouchMovePan(o)}_handleTouchMoveDollyRotate(o){this.enableZoom&&this._handleTouchMoveDolly(o),this.enableRotate&&this._handleTouchMoveRotate(o)}_addPointer(o){this._pointers.push(o.pointerId)}_removePointer(o){delete this._pointerPositions[o.pointerId];for(let l=0;l<this._pointers.length;l++)if(this._pointers[l]==o.pointerId){this._pointers.splice(l,1);return}}_isTrackingPointer(o){for(let l=0;l<this._pointers.length;l++)if(this._pointers[l]==o.pointerId)return!0;return!1}_trackPointer(o){let l=this._pointerPositions[o.pointerId];l===void 0&&(l=new r.Vector2,this._pointerPositions[o.pointerId]=l),l.set(o.pageX,o.pageY)}_getSecondPointerPosition(o){const l=o.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[l]}_customWheelEvent(o){const l=o.deltaMode,d={clientX:o.clientX,clientY:o.clientY,deltaY:o.deltaY};switch(l){case 1:d.deltaY*=16;break;case 2:d.deltaY*=100;break}return o.ctrlKey&&!this._controlActive&&(d.deltaY*=10),d}}function Hn(M){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(M.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(M)&&(this._addPointer(M),M.pointerType==="touch"?this._onTouchStart(M):this._onMouseDown(M)))}function $n(M){this.enabled!==!1&&(M.pointerType==="touch"?this._onTouchMove(M):this._onMouseMove(M))}function Yn(M){switch(this._removePointer(M),this._pointers.length){case 0:this.domElement.releasePointerCapture(M.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(hn),this.state=xe.NONE;break;case 1:const o=this._pointers[0],l=this._pointerPositions[o];this._onTouchStart({pointerId:o,pageX:l.x,pageY:l.y});break}}function Kn(M){let o;switch(M.button){case 0:o=this.mouseButtons.LEFT;break;case 1:o=this.mouseButtons.MIDDLE;break;case 2:o=this.mouseButtons.RIGHT;break;default:o=-1}switch(o){case r.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(M),this.state=xe.DOLLY;break;case r.MOUSE.ROTATE:if(M.ctrlKey||M.metaKey||M.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(M),this.state=xe.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(M),this.state=xe.ROTATE}break;case r.MOUSE.PAN:if(M.ctrlKey||M.metaKey||M.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(M),this.state=xe.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(M),this.state=xe.PAN}break;default:this.state=xe.NONE}this.state!==xe.NONE&&this.dispatchEvent(Ot)}function Wn(M){switch(this.state){case xe.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(M);break;case xe.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(M);break;case xe.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(M);break}}function Zn(M){this.enabled===!1||this.enableZoom===!1||this.state!==xe.NONE||(M.preventDefault(),this.dispatchEvent(Ot),this._handleMouseWheel(this._customWheelEvent(M)),this.dispatchEvent(hn))}function Jn(M){this.enabled!==!1&&this._handleKeyDown(M)}function Xn(M){switch(this._trackPointer(M),this._pointers.length){case 1:switch(this.touches.ONE){case r.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(M),this.state=xe.TOUCH_ROTATE;break;case r.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(M),this.state=xe.TOUCH_PAN;break;default:this.state=xe.NONE}break;case 2:switch(this.touches.TWO){case r.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(M),this.state=xe.TOUCH_DOLLY_PAN;break;case r.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(M),this.state=xe.TOUCH_DOLLY_ROTATE;break;default:this.state=xe.NONE}break;default:this.state=xe.NONE}this.state!==xe.NONE&&this.dispatchEvent(Ot)}function Qn(M){switch(this._trackPointer(M),this.state){case xe.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(M),this.update();break;case xe.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(M),this.update();break;case xe.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(M),this.update();break;case xe.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(M),this.update();break;default:this.state=xe.NONE}}function eo(M){this.enabled!==!1&&M.preventDefault()}function to(M){M.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function no(M){M.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function oo(M){let o=null,l=null,d=null,u=null,c=null,C=null;const h=e.ref([]),y=e.ref(new r.Vector3),m=e.ref(new r.Vector3),L=()=>{if(!M.value)return;o=new r.Scene,o.background=new r.Color(16777215);const A=M.value;l=new r.PerspectiveCamera(75,A.clientWidth/A.clientHeight,.1,1e4),d=new r.WebGLRenderer({antialias:!0,alpha:!0}),d.setSize(A.clientWidth,A.clientHeight),d.localClippingEnabled=!0,d.shadowMap.enabled=!0,d.shadowMap.type=r.PCFSoftShadowMap,d.toneMapping=r.ACESFilmicToneMapping,d.toneMappingExposure=1,d.outputColorSpace=r.SRGBColorSpace,A.appendChild(d.domElement),u=new qn(l,d.domElement),u.enableDamping=!0,u.dampingFactor=.05,c=new r.Xe(l,d,{container:A,type:"cube",placement:"bottom-left",offset:{left:350,bottom:22},background:{color:"#D1D1D1"}}),c.attachControls(u),R(),O()},R=()=>{const A=new r.AmbientLight(4210752,.6);o.add(A);const w=new r.DirectionalLight(16777215,2);w.position.set(10,10,8),w.castShadow=!0,w.shadow.mapSize.width=2048,w.shadow.mapSize.height=2048,w.shadow.camera.near=.5,w.shadow.camera.far=50,o.add(w);const g=new r.DirectionalLight(16777215,.8);g.position.set(-8,-8,6),o.add(g);const j=new r.DirectionalLight(16777215,.6);j.position.set(0,-15,2),o.add(j);const S=new r.HemisphereLight(16777215,4473924,.8);o.add(S);const v=new r.PointLight(16777215,1,50);v.position.set(15,15,15),o.add(v);const Y=new r.PointLight(16777215,.5,50);Y.position.set(-15,-15,15),o.add(Y)},O=()=>{C=requestAnimationFrame(O),u&&u.update(),d&&o&&l&&d.render(o,l),c&&c.render()},E=A=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(g=>{A[g]&&A[g].dispose&&A[g].dispose()}),A.dispose&&A.dispose()},P=A=>{A.traverse(w=>{w.geometry&&w.geometry.dispose(),w.material&&(Array.isArray(w.material)?w.material.forEach(g=>{E(g)}):E(w.material))})};return{currentModels:h,initialCameraPosition:y,initialTargetPosition:m,initThreeJS:L,handleResize:()=>{if(!M.value||!l||!d||!c)return;const A=M.value,w=A.clientWidth,g=A.clientHeight;l.aspect=w/g,l.updateProjectionMatrix(),d.setSize(w,g),c.update()},fitCameraToAllModels:()=>{if(!l||!u||h.value.length===0)return;const A=new r.Box3;h.value.forEach(F=>{A.expandByObject(F)});const w=A.getSize(new r.Vector3),g=A.getCenter(new r.Vector3),S=Math.max(w.x,w.y,w.z)*.8,v=new r.Vector3(g.x+S,g.y+S,g.z+S),Y=g.clone();l.position.copy(v),l.lookAt(Y),u.target.copy(Y),u.update(),y.value.copy(v),m.value.copy(Y)},getThreeJSObjects:()=>({scene:o,camera:l,renderer:d,controls:u,gizmo:c}),clearAllModels:()=>{if(!o)return;h.value.forEach(w=>{o.remove(w),P(w)});const A=[];o.children.forEach(w=>{!w.isLight&&!w.isCamera&&A.push(w)}),A.forEach(w=>{o.remove(w),P(w)}),h.value=[]},cleanup:()=>{C&&cancelAnimationFrame(C),d&&d.dispose(),u&&u.dispose(),c&&c.dispose()}}}function so(M,o){const l=e.ref(!1);let d=null,u=12700,c=new r.Vector3,C=new r.Vector3,h=new r.Vector3,y=0,m=null;const L=b=>b<.5?4*b*b*b:1-Math.pow(-2*b+2,3)/2,R=b=>{const x=new r.Vector3,_=y*1.2,G=new r.Vector3(h.x+_,h.y,h.z),A=new r.Vector3(h.x,h.y+_,h.z),w=new r.Vector3(h.x,h.y-_,h.z);if(b<=.567){const j=b/.567*Math.PI*2;x.x=h.x+Math.cos(j)*_,x.z=h.z+Math.sin(j)*_,x.y=h.y}else if(b<=.724){const g=(b-.567)/.157,j=L(g);x.lerpVectors(G,A,j)}else if(b<=.881){const g=(b-.724)/.157,S=L(g)*Math.PI;x.x=h.x+Math.sin(S)*_,x.y=h.y+Math.cos(S)*_,x.z=h.z}else{const g=(b-.881)/.119,j=L(g);x.lerpVectors(w,c,j)}return x},O=()=>{const{camera:b,controls:x}=M();if(!b||!x)return;d||(d=Date.now());const _=Date.now()-d,G=Math.min(_/u,1);if(G>=1){P();return}const A=R(G);b.position.copy(A),b.lookAt(h),x.target.copy(h),m=requestAnimationFrame(O)},E=()=>{if(o.value.length===0)return;const{camera:b,controls:x}=M();if(!b||!x)return;c.copy(b.position),C.copy(x.target);const _=new r.Box3;o.value.forEach(v=>{_.expandByObject(v)});const G=_.getSize(new r.Vector3);h=_.getCenter(new r.Vector3),y=Math.max(G.x,G.y,G.z)*1.2;const A=new r.Vector3(h.x+y*1.2,h.y,h.z);x.enabled=!1;const w=b.position.clone(),g=1e3,j=Date.now(),S=()=>{const v=Date.now()-j,Y=Math.min(v/g,1),F=L(Y);b.position.lerpVectors(w,A,F),b.lookAt(h),x.target.copy(h),Y<1?requestAnimationFrame(S):(l.value=!0,d=null,O())};S()},P=()=>{l.value=!1,d=null,m&&(cancelAnimationFrame(m),m=null);const{controls:b}=M();b&&(b.enabled=!0,b.target.copy(C))};return{isAnimating:l,toggleAnimation:()=>{if(l.value){l.value=!1,d=null,m&&(cancelAnimationFrame(m),m=null);const{camera:b,controls:x}=M();if(!b||!x)return;x.enabled=!0;const _=b.position.clone(),G=x.target.clone(),A=1500,w=Date.now(),g=()=>{const j=Date.now()-w,S=Math.min(j/A,1),v=L(S);b.position.lerpVectors(_,c,v),x.target.lerpVectors(G,C,v),S<1&&requestAnimationFrame(g)};g()}else E()},startAnimation:E,stopAnimation:P}}function io(M,o){const l=e.ref(!1),d=e.ref("none");let u=[],c=[],C=new r.Box3,h=new r.Vector3;const y=()=>{u=[new r.Plane(new r.Vector3(1,0,0),0),new r.Plane(new r.Vector3(0,1,0),0),new r.Plane(new r.Vector3(0,0,1),0)]},m=()=>{C.makeEmpty(),o.value.forEach(N=>{C.expandByObject(N)}),h=C.getCenter(new r.Vector3)},L=N=>{const b=C.getSize(new r.Vector3);let x,_,G;N==="x"?(x=new r.PlaneGeometry(b.z*1.2,b.y*1.2),_=new r.Vector3(h.x,h.y,h.z),G=new r.Euler(0,Math.PI/2,0)):N==="y"?(x=new r.PlaneGeometry(b.x*1.2,b.z*1.2),_=new r.Vector3(h.x,h.y,h.z),G=new r.Euler(Math.PI/2,0,0)):N==="z"&&(x=new r.PlaneGeometry(b.x*1.2,b.y*1.2),_=new r.Vector3(h.x,h.y,h.z),G=new r.Euler(0,0,0));const A=new r.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:r.DoubleSide,depthWrite:!1}),w=new r.Mesh(x,A);return w.position.copy(_),w.rotation.copy(G),w},R=()=>{if(O(),E(),d.value==="none")return;m();let N=null;if(d.value==="x"?(u[0].constant=-h.x,N=u[0]):d.value==="y"?(u[1].constant=-h.y,N=u[1]):d.value==="z"&&(u[2].constant=-h.z,N=u[2]),N){o.value.forEach(x=>{x.traverse(_=>{_.isMesh&&_.material&&(Array.isArray(_.material)?_.material.forEach(G=>{G.clippingPlanes=[N]}):_.material.clippingPlanes=[N])})});const{scene:b}=M();if(b){const x=L(d.value);b.add(x),c.push(x)}}},O=()=>{o.value.forEach(N=>{N.traverse(b=>{b.isMesh&&b.material&&(Array.isArray(b.material)?b.material.forEach(x=>{x.clippingPlanes=[]}):b.material.clippingPlanes=[])})})},E=()=>{const{scene:N}=M();N&&c.forEach(b=>{N.remove(b),b.geometry.dispose(),b.material.dispose()}),c=[]};return{isClipping:l,activeClippingAxis:d,toggleClipping:()=>{l.value=!l.value,l.value?(y(),o.value.length>0&&m()):(d.value="none",O(),E())},updateClippingPlanes:R,clearClippingPlanes:O,clearClippingMeshes:E}}const ao=/^[og]\s*(.+)?/,ro=/^mtllib /,lo=/^usemtl /,co=/^usemap /,nn=/\s+/,on=new r.Vector3,Vt=new r.Vector3,sn=new r.Vector3,an=new r.Vector3,Je=new r.Vector3,Nt=new r.Color;function uo(){const M={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(o,l){if(this.object&&this.object.fromDeclaration===!1){this.object.name=o,this.object.fromDeclaration=l!==!1;return}const d=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:o||"",fromDeclaration:l!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(u,c){const C=this._finalize(!1);C&&(C.inherited||C.groupCount<=0)&&this.materials.splice(C.index,1);const h={index:this.materials.length,name:u||"",mtllib:Array.isArray(c)&&c.length>0?c[c.length-1]:"",smooth:C!==void 0?C.smooth:this.smooth,groupStart:C!==void 0?C.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(y){const m={index:typeof y=="number"?y:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return m.clone=this.clone.bind(m),m}};return this.materials.push(h),h},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(u){const c=this.currentMaterial();if(c&&c.groupEnd===-1&&(c.groupEnd=this.geometry.vertices.length/3,c.groupCount=c.groupEnd-c.groupStart,c.inherited=!1),u&&this.materials.length>1)for(let C=this.materials.length-1;C>=0;C--)this.materials[C].groupCount<=0&&this.materials.splice(C,1);return u&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),c}},d&&d.name&&typeof d.clone=="function"){const u=d.clone(0);u.inherited=!0,this.object.materials.push(u)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(o,l){const d=parseInt(o,10);return(d>=0?d-1:d+l/3)*3},parseNormalIndex:function(o,l){const d=parseInt(o,10);return(d>=0?d-1:d+l/3)*3},parseUVIndex:function(o,l){const d=parseInt(o,10);return(d>=0?d-1:d+l/2)*2},addVertex:function(o,l,d){const u=this.vertices,c=this.object.geometry.vertices;c.push(u[o+0],u[o+1],u[o+2]),c.push(u[l+0],u[l+1],u[l+2]),c.push(u[d+0],u[d+1],u[d+2])},addVertexPoint:function(o){const l=this.vertices;this.object.geometry.vertices.push(l[o+0],l[o+1],l[o+2])},addVertexLine:function(o){const l=this.vertices;this.object.geometry.vertices.push(l[o+0],l[o+1],l[o+2])},addNormal:function(o,l,d){const u=this.normals,c=this.object.geometry.normals;c.push(u[o+0],u[o+1],u[o+2]),c.push(u[l+0],u[l+1],u[l+2]),c.push(u[d+0],u[d+1],u[d+2])},addFaceNormal:function(o,l,d){const u=this.vertices,c=this.object.geometry.normals;on.fromArray(u,o),Vt.fromArray(u,l),sn.fromArray(u,d),Je.subVectors(sn,Vt),an.subVectors(on,Vt),Je.cross(an),Je.normalize(),c.push(Je.x,Je.y,Je.z),c.push(Je.x,Je.y,Je.z),c.push(Je.x,Je.y,Je.z)},addColor:function(o,l,d){const u=this.colors,c=this.object.geometry.colors;u[o]!==void 0&&c.push(u[o+0],u[o+1],u[o+2]),u[l]!==void 0&&c.push(u[l+0],u[l+1],u[l+2]),u[d]!==void 0&&c.push(u[d+0],u[d+1],u[d+2])},addUV:function(o,l,d){const u=this.uvs,c=this.object.geometry.uvs;c.push(u[o+0],u[o+1]),c.push(u[l+0],u[l+1]),c.push(u[d+0],u[d+1])},addDefaultUV:function(){const o=this.object.geometry.uvs;o.push(0,0),o.push(0,0),o.push(0,0)},addUVLine:function(o){const l=this.uvs;this.object.geometry.uvs.push(l[o+0],l[o+1])},addFace:function(o,l,d,u,c,C,h,y,m){const L=this.vertices.length;let R=this.parseVertexIndex(o,L),O=this.parseVertexIndex(l,L),E=this.parseVertexIndex(d,L);if(this.addVertex(R,O,E),this.addColor(R,O,E),h!==void 0&&h!==""){const P=this.normals.length;R=this.parseNormalIndex(h,P),O=this.parseNormalIndex(y,P),E=this.parseNormalIndex(m,P),this.addNormal(R,O,E)}else this.addFaceNormal(R,O,E);if(u!==void 0&&u!==""){const P=this.uvs.length;R=this.parseUVIndex(u,P),O=this.parseUVIndex(c,P),E=this.parseUVIndex(C,P),this.addUV(R,O,E),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(o){this.object.geometry.type="Points";const l=this.vertices.length;for(let d=0,u=o.length;d<u;d++){const c=this.parseVertexIndex(o[d],l);this.addVertexPoint(c),this.addColor(c)}},addLineGeometry:function(o,l){this.object.geometry.type="Line";const d=this.vertices.length,u=this.uvs.length;for(let c=0,C=o.length;c<C;c++)this.addVertexLine(this.parseVertexIndex(o[c],d));for(let c=0,C=l.length;c<C;c++)this.addUVLine(this.parseUVIndex(l[c],u))}};return M.startObject("",!1),M}class Bt extends r.Loader{constructor(o){super(o),this.materials=null}load(o,l,d,u){const c=this,C=new r.FileLoader(this.manager);C.setPath(this.path),C.setRequestHeader(this.requestHeader),C.setWithCredentials(this.withCredentials),C.load(o,function(h){try{l(c.parse(h))}catch(y){u?u(y):console.error(y),c.manager.itemError(o)}},d,u)}setMaterials(o){return this.materials=o,this}parse(o){const l=new uo;o.indexOf(`\r
2
- `)!==-1&&(o=o.replace(/\r\n/g,`
3
- `)),o.indexOf(`\\
4
- `)!==-1&&(o=o.replace(/\\\n/g,""));const d=o.split(`
5
- `);let u=[];for(let h=0,y=d.length;h<y;h++){const m=d[h].trimStart();if(m.length===0)continue;const L=m.charAt(0);if(L!=="#")if(L==="v"){const R=m.split(nn);switch(R[0]){case"v":l.vertices.push(parseFloat(R[1]),parseFloat(R[2]),parseFloat(R[3])),R.length>=7?(Nt.setRGB(parseFloat(R[4]),parseFloat(R[5]),parseFloat(R[6]),r.SRGBColorSpace),l.colors.push(Nt.r,Nt.g,Nt.b)):l.colors.push(void 0,void 0,void 0);break;case"vn":l.normals.push(parseFloat(R[1]),parseFloat(R[2]),parseFloat(R[3]));break;case"vt":l.uvs.push(parseFloat(R[1]),parseFloat(R[2]));break}}else if(L==="f"){const O=m.slice(1).trim().split(nn),E=[];for(let N=0,b=O.length;N<b;N++){const x=O[N];if(x.length>0){const _=x.split("/");E.push(_)}}const P=E[0];for(let N=1,b=E.length-1;N<b;N++){const x=E[N],_=E[N+1];l.addFace(P[0],x[0],_[0],P[1],x[1],_[1],P[2],x[2],_[2])}}else if(L==="l"){const R=m.substring(1).trim().split(" ");let O=[];const E=[];if(m.indexOf("/")===-1)O=R;else for(let P=0,N=R.length;P<N;P++){const b=R[P].split("/");b[0]!==""&&O.push(b[0]),b[1]!==""&&E.push(b[1])}l.addLineGeometry(O,E)}else if(L==="p"){const O=m.slice(1).trim().split(" ");l.addPointGeometry(O)}else if((u=ao.exec(m))!==null){const R=(" "+u[0].slice(1).trim()).slice(1);l.startObject(R)}else if(lo.test(m))l.object.startMaterial(m.substring(7).trim(),l.materialLibraries);else if(ro.test(m))l.materialLibraries.push(m.substring(7).trim());else if(co.test(m))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(L==="s"){if(u=m.split(" "),u.length>1){const O=u[1].trim().toLowerCase();l.object.smooth=O!=="0"&&O!=="off"}else l.object.smooth=!0;const R=l.object.currentMaterial();R&&(R.smooth=l.object.smooth)}else{if(m==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+m+'"')}}l.finalize();const c=new r.Group;if(c.materialLibraries=[].concat(l.materialLibraries),!(l.objects.length===1&&l.objects[0].geometry.vertices.length===0)===!0)for(let h=0,y=l.objects.length;h<y;h++){const m=l.objects[h],L=m.geometry,R=m.materials,O=L.type==="Line",E=L.type==="Points";let P=!1;if(L.vertices.length===0)continue;const N=new r.BufferGeometry;N.setAttribute("position",new r.Float32BufferAttribute(L.vertices,3)),L.normals.length>0&&N.setAttribute("normal",new r.Float32BufferAttribute(L.normals,3)),L.colors.length>0&&(P=!0,N.setAttribute("color",new r.Float32BufferAttribute(L.colors,3))),L.hasUVIndices===!0&&N.setAttribute("uv",new r.Float32BufferAttribute(L.uvs,2));const b=[];for(let _=0,G=R.length;_<G;_++){const A=R[_],w=A.name+"_"+A.smooth+"_"+P;let g=l.materials[w];if(this.materials!==null){if(g=this.materials.create(A.name),O&&g&&!(g instanceof r.LineBasicMaterial)){const j=new r.LineBasicMaterial;r.Material.prototype.copy.call(j,g),j.color.copy(g.color),g=j}else if(E&&g&&!(g instanceof r.PointsMaterial)){const j=new r.PointsMaterial({size:10,sizeAttenuation:!1});r.Material.prototype.copy.call(j,g),j.color.copy(g.color),j.map=g.map,g=j}}g===void 0&&(O?g=new r.LineBasicMaterial:E?g=new r.PointsMaterial({size:1,sizeAttenuation:!1}):g=new r.MeshPhongMaterial,g.name=A.name,g.flatShading=!A.smooth,g.vertexColors=P,l.materials[w]=g),b.push(g)}let x;if(b.length>1){for(let _=0,G=R.length;_<G;_++){const A=R[_];N.addGroup(A.groupStart,A.groupCount,_)}O?x=new r.LineSegments(N,b):E?x=new r.Points(N,b):x=new r.Mesh(N,b)}else O?x=new r.LineSegments(N,b[0]):E?x=new r.Points(N,b[0]):x=new r.Mesh(N,b[0]);x.name=m.name,c.add(x)}else if(l.vertices.length>0){const h=new r.PointsMaterial({size:1,sizeAttenuation:!1}),y=new r.BufferGeometry;y.setAttribute("position",new r.Float32BufferAttribute(l.vertices,3)),l.colors.length>0&&l.colors[0]!==void 0&&(y.setAttribute("color",new r.Float32BufferAttribute(l.colors,3)),h.vertexColors=!0);const m=new r.Points(y,h);c.add(m)}return c}}class Rt extends r.Loader{constructor(o){super(o)}load(o,l,d,u){const c=this,C=this.path===""?r.LoaderUtils.extractUrlBase(o):this.path,h=new r.FileLoader(this.manager);h.setPath(this.path),h.setRequestHeader(this.requestHeader),h.setWithCredentials(this.withCredentials),h.load(o,function(y){try{l(c.parse(y,C))}catch(m){u?u(m):console.error(m),c.manager.itemError(o)}},d,u)}setMaterialOptions(o){return this.materialOptions=o,this}parse(o,l){const d=o.split(`
6
- `);let u={};const c=/\s+/,C={};for(let y=0;y<d.length;y++){let m=d[y];if(m=m.trim(),m.length===0||m.charAt(0)==="#")continue;const L=m.indexOf(" ");let R=L>=0?m.substring(0,L):m;R=R.toLowerCase();let O=L>=0?m.substring(L+1):"";if(O=O.trim(),R==="newmtl")u={name:O},C[O]=u;else if(R==="ka"||R==="kd"||R==="ks"||R==="ke"){const E=O.split(c,3);u[R]=[parseFloat(E[0]),parseFloat(E[1]),parseFloat(E[2])]}else u[R]=O}const h=new ho(this.resourcePath||l,this.materialOptions);return h.setCrossOrigin(this.crossOrigin),h.setManager(this.manager),h.setMaterials(C),h}}class ho{constructor(o="",l={}){this.baseUrl=o,this.options=l,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:r.FrontSide,this.wrap=this.options.wrap!==void 0?this.options.wrap:r.RepeatWrapping}setCrossOrigin(o){return this.crossOrigin=o,this}setManager(o){this.manager=o}setMaterials(o){this.materialsInfo=this.convert(o),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(o){if(!this.options)return o;const l={};for(const d in o){const u=o[d],c={};l[d]=c;for(const C in u){let h=!0,y=u[C];const m=C.toLowerCase();switch(m){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(y=[y[0]/255,y[1]/255,y[2]/255]),this.options&&this.options.ignoreZeroRGBs&&y[0]===0&&y[1]===0&&y[2]===0&&(h=!1);break}h&&(c[m]=y)}}return l}preload(){for(const o in this.materialsInfo)this.create(o)}getIndex(o){return this.nameLookup[o]}getAsArray(){let o=0;for(const l in this.materialsInfo)this.materialsArray[o]=this.create(l),this.nameLookup[l]=o,o++;return this.materialsArray}create(o){return this.materials[o]===void 0&&this.createMaterial_(o),this.materials[o]}createMaterial_(o){const l=this,d=this.materialsInfo[o],u={name:o,side:this.side};function c(h,y){return typeof y!="string"||y===""?"":/^https?:\/\//i.test(y)?y:h+y}function C(h,y){if(u[h])return;const m=l.getTextureParams(y,u),L=l.loadTexture(c(l.baseUrl,m.url));L.repeat.copy(m.scale),L.offset.copy(m.offset),L.wrapS=l.wrap,L.wrapT=l.wrap,(h==="map"||h==="emissiveMap")&&(L.colorSpace=r.SRGBColorSpace),u[h]=L}for(const h in d){const y=d[h];let m;if(y!=="")switch(h.toLowerCase()){case"kd":u.color=r.ColorManagement.colorSpaceToWorking(new r.Color().fromArray(y),r.SRGBColorSpace);break;case"ks":u.specular=r.ColorManagement.colorSpaceToWorking(new r.Color().fromArray(y),r.SRGBColorSpace);break;case"ke":u.emissive=r.ColorManagement.colorSpaceToWorking(new r.Color().fromArray(y),r.SRGBColorSpace);break;case"map_kd":C("map",y);break;case"map_ks":C("specularMap",y);break;case"map_ke":C("emissiveMap",y);break;case"norm":C("normalMap",y);break;case"map_bump":case"bump":C("bumpMap",y);break;case"disp":C("displacementMap",y);break;case"map_d":C("alphaMap",y),u.transparent=!0;break;case"ns":u.shininess=parseFloat(y);break;case"d":m=parseFloat(y),m<1&&(u.opacity=m,u.transparent=!0);break;case"tr":m=parseFloat(y),this.options&&this.options.invertTrProperty&&(m=1-m),m>0&&(u.opacity=1-m,u.transparent=!0);break}}return this.materials[o]=new r.MeshPhongMaterial(u),this.materials[o]}getTextureParams(o,l){const d={scale:new r.Vector2(1,1),offset:new r.Vector2(0,0)},u=o.split(/\s+/);let c;return c=u.indexOf("-bm"),c>=0&&(l.bumpScale=parseFloat(u[c+1]),u.splice(c,2)),c=u.indexOf("-mm"),c>=0&&(l.displacementBias=parseFloat(u[c+1]),l.displacementScale=parseFloat(u[c+2]),u.splice(c,3)),c=u.indexOf("-s"),c>=0&&(d.scale.set(parseFloat(u[c+1]),parseFloat(u[c+2])),u.splice(c,4)),c=u.indexOf("-o"),c>=0&&(d.offset.set(parseFloat(u[c+1]),parseFloat(u[c+2])),u.splice(c,4)),d.url=u.join(" ").trim(),d}loadTexture(o,l,d,u,c){const C=this.manager!==void 0?this.manager:r.DefaultLoadingManager;let h=C.getHandler(o);h===null&&(h=new r.TextureLoader(C)),h.setCrossOrigin&&h.setCrossOrigin(this.crossOrigin);const y=h.load(o,d,u,c);return l!==void 0&&(y.mapping=l),y}}class At extends r.Loader{constructor(o){super(o)}load(o,l,d,u){const c=this,C=new r.FileLoader(this.manager);C.setPath(this.path),C.setResponseType("arraybuffer"),C.setRequestHeader(this.requestHeader),C.setWithCredentials(this.withCredentials),C.load(o,function(h){try{l(c.parse(h))}catch(y){u?u(y):console.error(y),c.manager.itemError(o)}},d,u)}parse(o){function l(m){const L=new DataView(m),R=32/8*3+32/8*3*3+16/8,O=L.getUint32(80,!0);if(80+32/8+O*R===L.byteLength)return!0;const P=[115,111,108,105,100];for(let N=0;N<5;N++)if(d(P,L,N))return!1;return!0}function d(m,L,R){for(let O=0,E=m.length;O<E;O++)if(m[O]!==L.getUint8(R+O))return!1;return!0}function u(m){const L=new DataView(m),R=L.getUint32(80,!0);let O,E,P,N=!1,b,x,_,G,A;for(let F=0;F<70;F++)L.getUint32(F,!1)==1129270351&&L.getUint8(F+4)==82&&L.getUint8(F+5)==61&&(N=!0,b=new Float32Array(R*3*3),x=L.getUint8(F+6)/255,_=L.getUint8(F+7)/255,G=L.getUint8(F+8)/255,A=L.getUint8(F+9)/255);const w=84,g=12*4+2,j=new r.BufferGeometry,S=new Float32Array(R*3*3),v=new Float32Array(R*3*3),Y=new r.Color;for(let F=0;F<R;F++){const q=w+F*g,ie=L.getFloat32(q,!0),ce=L.getFloat32(q+4,!0),D=L.getFloat32(q+8,!0);if(N){const p=L.getUint16(q+48,!0);(p&32768)===0?(O=(p&31)/31,E=(p>>5&31)/31,P=(p>>10&31)/31):(O=x,E=_,P=G)}for(let p=1;p<=3;p++){const X=q+p*12,re=F*3*3+(p-1)*3;S[re]=L.getFloat32(X,!0),S[re+1]=L.getFloat32(X+4,!0),S[re+2]=L.getFloat32(X+8,!0),v[re]=ie,v[re+1]=ce,v[re+2]=D,N&&(Y.setRGB(O,E,P,r.SRGBColorSpace),b[re]=Y.r,b[re+1]=Y.g,b[re+2]=Y.b)}}return j.setAttribute("position",new r.BufferAttribute(S,3)),j.setAttribute("normal",new r.BufferAttribute(v,3)),N&&(j.setAttribute("color",new r.BufferAttribute(b,3)),j.hasColors=!0,j.alpha=A),j}function c(m){const L=new r.BufferGeometry,R=/solid([\s\S]*?)endsolid/g,O=/facet([\s\S]*?)endfacet/g,E=/solid\s(.+)/;let P=0;const N=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,b=new RegExp("vertex"+N+N+N,"g"),x=new RegExp("normal"+N+N+N,"g"),_=[],G=[],A=[],w=new r.Vector3;let g,j=0,S=0,v=0;for(;(g=R.exec(m))!==null;){S=v;const Y=g[0],F=(g=E.exec(Y))!==null?g[1]:"";for(A.push(F);(g=O.exec(Y))!==null;){let ce=0,D=0;const p=g[0];for(;(g=x.exec(p))!==null;)w.x=parseFloat(g[1]),w.y=parseFloat(g[2]),w.z=parseFloat(g[3]),D++;for(;(g=b.exec(p))!==null;)_.push(parseFloat(g[1]),parseFloat(g[2]),parseFloat(g[3])),G.push(w.x,w.y,w.z),ce++,v++;D!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+P),ce!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+P),P++}const q=S,ie=v-S;L.userData.groupNames=A,L.addGroup(q,ie,j),j++}return L.setAttribute("position",new r.Float32BufferAttribute(_,3)),L.setAttribute("normal",new r.Float32BufferAttribute(G,3)),L}function C(m){return typeof m!="string"?new TextDecoder().decode(m):m}function h(m){if(typeof m=="string"){const L=new Uint8Array(m.length);for(let R=0;R<m.length;R++)L[R]=m.charCodeAt(R)&255;return L.buffer||L}else return m}const y=h(o);return l(y)?u(y):c(C(o))}}class rn extends r.DataTextureLoader{constructor(o){super(o)}parse(o){function l(p){switch(p.image_type){case O:case N:if(p.colormap_length>256||p.colormap_size!==24||p.colormap_type!==1)throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case E:case P:case b:case x:if(p.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case R:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+p.image_type)}if(p.width<=0||p.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(p.pixel_size!==8&&p.pixel_size!==16&&p.pixel_size!==24&&p.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+p.pixel_size)}function d(p,X,re,V,$){let Q,oe;const U=re.pixel_size>>3,z=re.width*re.height*U;if(X&&(oe=$.subarray(V,V+=re.colormap_length*(re.colormap_size>>3))),p){Q=new Uint8Array(z);let T,I,W,J=0;const ge=new Uint8Array(U);for(;J<z;)if(T=$[V++],I=(T&127)+1,T&128){for(W=0;W<U;++W)ge[W]=$[V++];for(W=0;W<I;++W)Q.set(ge,J+W*U);J+=U*I}else{for(I*=U,W=0;W<I;++W)Q[J+W]=$[V++];J+=I}}else Q=$.subarray(V,V+=X?re.width*re.height:z);return{pixel_data:Q,palettes:oe}}function u(p,X,re,V,$,Q,oe,U,z){const T=z;let I,W=0,J,ge;const Me=Y.width;for(ge=X;ge!==V;ge+=re)for(J=$;J!==oe;J+=Q,W++)I=U[W],p[(J+Me*ge)*4+3]=255,p[(J+Me*ge)*4+2]=T[I*3+0],p[(J+Me*ge)*4+1]=T[I*3+1],p[(J+Me*ge)*4+0]=T[I*3+2];return p}function c(p,X,re,V,$,Q,oe,U){let z,T=0,I,W;const J=Y.width;for(W=X;W!==V;W+=re)for(I=$;I!==oe;I+=Q,T+=2)z=U[T+0]+(U[T+1]<<8),p[(I+J*W)*4+0]=(z&31744)>>7,p[(I+J*W)*4+1]=(z&992)>>2,p[(I+J*W)*4+2]=(z&31)<<3,p[(I+J*W)*4+3]=z&32768?0:255;return p}function C(p,X,re,V,$,Q,oe,U){let z=0,T,I;const W=Y.width;for(I=X;I!==V;I+=re)for(T=$;T!==oe;T+=Q,z+=3)p[(T+W*I)*4+3]=255,p[(T+W*I)*4+2]=U[z+0],p[(T+W*I)*4+1]=U[z+1],p[(T+W*I)*4+0]=U[z+2];return p}function h(p,X,re,V,$,Q,oe,U){let z=0,T,I;const W=Y.width;for(I=X;I!==V;I+=re)for(T=$;T!==oe;T+=Q,z+=4)p[(T+W*I)*4+2]=U[z+0],p[(T+W*I)*4+1]=U[z+1],p[(T+W*I)*4+0]=U[z+2],p[(T+W*I)*4+3]=U[z+3];return p}function y(p,X,re,V,$,Q,oe,U){let z,T=0,I,W;const J=Y.width;for(W=X;W!==V;W+=re)for(I=$;I!==oe;I+=Q,T++)z=U[T],p[(I+J*W)*4+0]=z,p[(I+J*W)*4+1]=z,p[(I+J*W)*4+2]=z,p[(I+J*W)*4+3]=255;return p}function m(p,X,re,V,$,Q,oe,U){let z=0,T,I;const W=Y.width;for(I=X;I!==V;I+=re)for(T=$;T!==oe;T+=Q,z+=2)p[(T+W*I)*4+0]=U[z+0],p[(T+W*I)*4+1]=U[z+0],p[(T+W*I)*4+2]=U[z+0],p[(T+W*I)*4+3]=U[z+1];return p}function L(p,X,re,V,$){let Q,oe,U,z,T,I;switch((Y.flags&_)>>G){default:case g:Q=0,U=1,T=X,oe=0,z=1,I=re;break;case A:Q=0,U=1,T=X,oe=re-1,z=-1,I=-1;break;case j:Q=X-1,U=-1,T=-1,oe=0,z=1,I=re;break;case w:Q=X-1,U=-1,T=-1,oe=re-1,z=-1,I=-1;break}if(ie)switch(Y.pixel_size){case 8:y(p,oe,z,I,Q,U,T,V);break;case 16:m(p,oe,z,I,Q,U,T,V);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(Y.pixel_size){case 8:u(p,oe,z,I,Q,U,T,V,$);break;case 16:c(p,oe,z,I,Q,U,T,V);break;case 24:C(p,oe,z,I,Q,U,T,V);break;case 32:h(p,oe,z,I,Q,U,T,V);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return p}const R=0,O=1,E=2,P=3,N=9,b=10,x=11,_=48,G=4,A=0,w=1,g=2,j=3;if(o.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let S=0;const v=new Uint8Array(o),Y={id_length:v[S++],colormap_type:v[S++],image_type:v[S++],colormap_index:v[S++]|v[S++]<<8,colormap_length:v[S++]|v[S++]<<8,colormap_size:v[S++],origin:[v[S++]|v[S++]<<8,v[S++]|v[S++]<<8],width:v[S++]|v[S++]<<8,height:v[S++]|v[S++]<<8,pixel_size:v[S++],flags:v[S++]};if(l(Y),Y.id_length+S>o.length)throw new Error("THREE.TGALoader: No data.");S+=Y.id_length;let F=!1,q=!1,ie=!1;switch(Y.image_type){case N:F=!0,q=!0;break;case O:q=!0;break;case b:F=!0;break;case E:break;case x:F=!0,ie=!0;break;case P:ie=!0;break}const ce=new Uint8Array(Y.width*Y.height*4),D=d(F,q,Y,S,v);return L(ce,Y.width,Y.height,D.pixel_data,D.palettes),{data:ce,width:Y.width,height:Y.height,flipY:!0,generateMipmaps:!0,minFilter:r.LinearMipmapLinearFilter}}}class po extends r.Loader{load(o,l,d,u){const c=this,C=c.path===""?r.LoaderUtils.extractUrlBase(o):c.path,h=new r.FileLoader(c.manager);h.setPath(c.path),h.setRequestHeader(c.requestHeader),h.setWithCredentials(c.withCredentials),h.load(o,function(y){try{l(c.parse(y,C))}catch(m){u?u(m):console.error(m),c.manager.itemError(o)}},d,u)}parse(o,l){function d(n,t){const i=[],s=n.childNodes;for(let a=0,f=s.length;a<f;a++){const k=s[a];k.nodeName===t&&i.push(k)}return i}function u(n){if(n.length===0)return[];const t=n.trim().split(/\s+/),i=new Array(t.length);for(let s=0,a=t.length;s<a;s++)i[s]=t[s];return i}function c(n){if(n.length===0)return[];const t=n.trim().split(/\s+/),i=new Array(t.length);for(let s=0,a=t.length;s<a;s++)i[s]=parseFloat(t[s]);return i}function C(n){if(n.length===0)return[];const t=n.trim().split(/\s+/),i=new Array(t.length);for(let s=0,a=t.length;s<a;s++)i[s]=parseInt(t[s]);return i}function h(n){return n.substring(1)}function y(){return"three_default_"+In++}function m(n){return Object.keys(n).length===0}function L(n){return{unit:R(d(n,"unit")[0]),upAxis:O(d(n,"up_axis")[0])}}function R(n){return n!==void 0&&n.hasAttribute("meter")===!0?parseFloat(n.getAttribute("meter")):1}function O(n){return n!==void 0?n.textContent:"Y_UP"}function E(n,t,i,s){const a=d(n,t)[0];if(a!==void 0){const f=d(a,i);for(let k=0;k<f.length;k++)s(f[k])}}function P(n,t){for(const i in n){const s=n[i];s.build=t(n[i])}}function N(n,t){return n.build!==void 0||(n.build=t(n)),n.build}function b(n){const t={sources:{},samplers:{},channels:{}};let i=!1;for(let s=0,a=n.childNodes.length;s<a;s++){const f=n.childNodes[s];if(f.nodeType!==1)continue;let k;switch(f.nodeName){case"source":k=f.getAttribute("id"),t.sources[k]=me(f);break;case"sampler":k=f.getAttribute("id"),t.samplers[k]=x(f);break;case"channel":k=f.getAttribute("target"),t.channels[k]=_(f);break;case"animation":b(f),i=!0;break;default:console.log(f)}}i===!1&&(le.animations[n.getAttribute("id")||r.MathUtils.generateUUID()]=t)}function x(n){const t={inputs:{}};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"input":const f=h(a.getAttribute("source")),k=a.getAttribute("semantic");t.inputs[k]=f;break}}return t}function _(n){const t={};let s=n.getAttribute("target").split("/");const a=s.shift();let f=s.shift();const k=f.indexOf("(")!==-1,Z=f.indexOf(".")!==-1;if(Z)s=f.split("."),f=s.shift(),t.member=s.shift();else if(k){const H=f.split("(");f=H.shift();for(let K=0;K<H.length;K++)H[K]=parseInt(H[K].replace(/\)/,""));t.indices=H}return t.id=a,t.sid=f,t.arraySyntax=k,t.memberSyntax=Z,t.sampler=h(n.getAttribute("source")),t}function G(n){const t=[],i=n.channels,s=n.samplers,a=n.sources;for(const f in i)if(i.hasOwnProperty(f)){const k=i[f],Z=s[k.sampler],H=Z.inputs.INPUT,K=Z.inputs.OUTPUT,ne=a[H],B=a[K],te=w(k,ne,B);Y(te,t)}return t}function A(n){return N(le.animations[n],G)}function w(n,t,i){const s=le.nodes[n.id],a=wt(s.id),f=s.transforms[n.sid],k=s.matrix.clone().transpose();let Z,H,K,ne,B,te;const ee={};switch(f){case"matrix":for(K=0,ne=t.array.length;K<ne;K++)if(Z=t.array[K],H=K*i.stride,ee[Z]===void 0&&(ee[Z]={}),n.arraySyntax===!0){const Pe=i.array[H],ve=n.indices[0]+4*n.indices[1];ee[Z][ve]=Pe}else for(B=0,te=i.stride;B<te;B++)ee[Z][B]=i.array[H+B];break;case"translate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',f);break;case"rotate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',f);break;case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',f);break}const ae=g(ee,k);return{name:a.uuid,keyframes:ae}}function g(n,t){const i=[];for(const a in n)i.push({time:parseFloat(a),value:n[a]});i.sort(s);for(let a=0;a<16;a++)F(i,a,t.elements[a]);return i;function s(a,f){return a.time-f.time}}const j=new r.Vector3,S=new r.Vector3,v=new r.Quaternion;function Y(n,t){const i=n.keyframes,s=n.name,a=[],f=[],k=[],Z=[];for(let H=0,K=i.length;H<K;H++){const ne=i[H],B=ne.time,te=ne.value;Ze.fromArray(te).transpose(),Ze.decompose(j,v,S),a.push(B),f.push(j.x,j.y,j.z),k.push(v.x,v.y,v.z,v.w),Z.push(S.x,S.y,S.z)}return f.length>0&&t.push(new r.VectorKeyframeTrack(s+".position",a,f)),k.length>0&&t.push(new r.QuaternionKeyframeTrack(s+".quaternion",a,k)),Z.length>0&&t.push(new r.VectorKeyframeTrack(s+".scale",a,Z)),t}function F(n,t,i){let s,a=!0,f,k;for(f=0,k=n.length;f<k;f++)s=n[f],s.value[t]===void 0?s.value[t]=null:a=!1;if(a===!0)for(f=0,k=n.length;f<k;f++)s=n[f],s.value[t]=i;else q(n,t)}function q(n,t){let i,s;for(let a=0,f=n.length;a<f;a++){const k=n[a];if(k.value[t]===null){if(i=ie(n,a,t),s=ce(n,a,t),i===null){k.value[t]=s.value[t];continue}if(s===null){k.value[t]=i.value[t];continue}D(k,i,s,t)}}}function ie(n,t,i){for(;t>=0;){const s=n[t];if(s.value[i]!==null)return s;t--}return null}function ce(n,t,i){for(;t<n.length;){const s=n[t];if(s.value[i]!==null)return s;t++}return null}function D(n,t,i,s){if(i.time-t.time===0){n.value[s]=t.value[s];return}n.value[s]=(n.time-t.time)*(i.value[s]-t.value[s])/(i.time-t.time)+t.value[s]}function p(n){const t={name:n.getAttribute("id")||"default",start:parseFloat(n.getAttribute("start")||0),end:parseFloat(n.getAttribute("end")||0),animations:[]};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"instance_animation":t.animations.push(h(a.getAttribute("url")));break}}le.clips[n.getAttribute("id")]=t}function X(n){const t=[],i=n.name,s=n.end-n.start||-1,a=n.animations;for(let f=0,k=a.length;f<k;f++){const Z=A(a[f]);for(let H=0,K=Z.length;H<K;H++)t.push(Z[H])}return new r.AnimationClip(i,s,t)}function re(n){return N(le.clips[n],X)}function V(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"skin":t.id=h(a.getAttribute("source")),t.skin=$(a);break;case"morph":t.id=h(a.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.");break}}le.controllers[n.getAttribute("id")]=t}function $(n){const t={sources:{}};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"bind_shape_matrix":t.bindShapeMatrix=c(a.textContent);break;case"source":const f=a.getAttribute("id");t.sources[f]=me(a);break;case"joints":t.joints=Q(a);break;case"vertex_weights":t.vertexWeights=oe(a);break}}return t}function Q(n){const t={inputs:{}};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"input":const f=a.getAttribute("semantic"),k=h(a.getAttribute("source"));t.inputs[f]=k;break}}return t}function oe(n){const t={inputs:{}};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"input":const f=a.getAttribute("semantic"),k=h(a.getAttribute("source")),Z=parseInt(a.getAttribute("offset"));t.inputs[f]={id:k,offset:Z};break;case"vcount":t.vcount=C(a.textContent);break;case"v":t.v=C(a.textContent);break}}return t}function U(n){const t={id:n.id},i=le.geometries[t.id];return n.skin!==void 0&&(t.skin=z(n.skin),i.sources.skinIndices=t.skin.indices,i.sources.skinWeights=t.skin.weights),t}function z(n){const i={joints:[],indices:{array:[],stride:4},weights:{array:[],stride:4}},s=n.sources,a=n.vertexWeights,f=a.vcount,k=a.v,Z=a.inputs.JOINT.offset,H=a.inputs.WEIGHT.offset,K=n.sources[n.joints.inputs.JOINT],ne=n.sources[n.joints.inputs.INV_BIND_MATRIX],B=s[a.inputs.WEIGHT.id].array;let te=0,ee,ae,se;for(ee=0,se=f.length;ee<se;ee++){const ve=f[ee],be=[];for(ae=0;ae<ve;ae++){const we=k[te+Z],it=k[te+H],He=B[it];be.push({index:we,weight:He}),te+=2}for(be.sort(Pe),ae=0;ae<4;ae++){const we=be[ae];we!==void 0?(i.indices.array.push(we.index),i.weights.array.push(we.weight)):(i.indices.array.push(0),i.weights.array.push(0))}}for(n.bindShapeMatrix?i.bindMatrix=new r.Matrix4().fromArray(n.bindShapeMatrix).transpose():i.bindMatrix=new r.Matrix4().identity(),ee=0,se=K.array.length;ee<se;ee++){const ve=K.array[ee],be=new r.Matrix4().fromArray(ne.array,ee*ne.stride).transpose();i.joints.push({name:ve,boneInverse:be})}return i;function Pe(ve,be){return be.weight-ve.weight}}function T(n){return N(le.controllers[n],U)}function I(n){const t={init_from:d(n,"init_from")[0].textContent};le.images[n.getAttribute("id")]=t}function W(n){return n.build!==void 0?n.build:n.init_from}function J(n){const t=le.images[n];return t!==void 0?N(t,W):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",n),null)}function ge(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"profile_COMMON":t.profile=Me(a);break}}le.effects[n.getAttribute("id")]=t}function Me(n){const t={surfaces:{},samplers:{}};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"newparam":je(a,t);break;case"technique":t.technique=de(a);break;case"extra":t.extra=qe(a);break}}return t}function je(n,t){const i=n.getAttribute("sid");for(let s=0,a=n.childNodes.length;s<a;s++){const f=n.childNodes[s];if(f.nodeType===1)switch(f.nodeName){case"surface":t.surfaces[i]=Ye(f);break;case"sampler2D":t.samplers[i]=Ee(f);break}}}function Ye(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"init_from":t.init_from=a.textContent;break}}return t}function Ee(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"source":t.source=a.textContent;break}}return t}function de(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"constant":case"lambert":case"blinn":case"phong":t.type=a.nodeName,t.parameters=Ue(a);break;case"extra":t.extra=qe(a);break}}return t}function Ue(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":t[a.nodeName]=ze(a);break;case"transparent":t[a.nodeName]={opaque:a.hasAttribute("opaque")?a.getAttribute("opaque"):"A_ONE",data:ze(a)};break}}return t}function ze(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"color":t[a.nodeName]=c(a.textContent);break;case"float":t[a.nodeName]=parseFloat(a.textContent);break;case"texture":t[a.nodeName]={id:a.getAttribute("texture"),extra:Ke(a)};break}}return t}function Ke(n){const t={technique:{}};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"extra":et(a,t);break}}return t}function et(n,t){for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"technique":tt(a,t);break}}}function tt(n,t){for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":t.technique[a.nodeName]=parseFloat(a.textContent);break;case"wrapU":case"wrapV":a.textContent.toUpperCase()==="TRUE"?t.technique[a.nodeName]=1:a.textContent.toUpperCase()==="FALSE"?t.technique[a.nodeName]=0:t.technique[a.nodeName]=parseInt(a.textContent);break;case"bump":t[a.nodeName]=Se(a);break}}}function qe(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"technique":t.technique=Te(a);break}}return t}function Te(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"double_sided":t[a.nodeName]=parseInt(a.textContent);break;case"bump":t[a.nodeName]=Se(a);break}}return t}function Se(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"texture":t[a.nodeName]={id:a.getAttribute("texture"),texcoord:a.getAttribute("texcoord"),extra:Ke(a)};break}}return t}function _e(n){return n}function ft(n){return N(le.effects[n],_e)}function We(n){const t={name:n.getAttribute("name")};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"instance_effect":t.url=h(a.getAttribute("url"));break}}le.materials[n.getAttribute("id")]=t}function Be(n){let t,i=n.slice((n.lastIndexOf(".")-1>>>0)+2);switch(i=i.toLowerCase(),i){case"tga":t=Pt;break;default:t=Zt}return t}function fe(n){const t=ft(n.url),i=t.profile.technique;let s;switch(i.type){case"phong":case"blinn":s=new r.MeshPhongMaterial;break;case"lambert":s=new r.MeshLambertMaterial;break;default:s=new r.MeshBasicMaterial;break}s.name=n.name||"";function a(H,K=null){const ne=t.profile.samplers[H.id];let B=null;if(ne!==void 0){const te=t.profile.surfaces[ne.source];B=J(te.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),B=J(H.id);if(B!==null){const te=Be(B);if(te!==void 0){const ee=te.load(B),ae=H.extra;if(ae!==void 0&&ae.technique!==void 0&&m(ae.technique)===!1){const se=ae.technique;ee.wrapS=se.wrapU?r.RepeatWrapping:r.ClampToEdgeWrapping,ee.wrapT=se.wrapV?r.RepeatWrapping:r.ClampToEdgeWrapping,ee.offset.set(se.offsetU||0,se.offsetV||0),ee.repeat.set(se.repeatU||1,se.repeatV||1)}else ee.wrapS=r.RepeatWrapping,ee.wrapT=r.RepeatWrapping;return K!==null&&(ee.colorSpace=K),ee}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",B),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",H.id),null}const f=i.parameters;for(const H in f){const K=f[H];switch(H){case"diffuse":K.color&&s.color.fromArray(K.color),K.texture&&(s.map=a(K.texture,r.SRGBColorSpace));break;case"specular":K.color&&s.specular&&s.specular.fromArray(K.color),K.texture&&(s.specularMap=a(K.texture));break;case"bump":K.texture&&(s.normalMap=a(K.texture));break;case"ambient":K.texture&&(s.lightMap=a(K.texture,r.SRGBColorSpace));break;case"shininess":K.float&&s.shininess&&(s.shininess=K.float);break;case"emission":K.color&&s.emissive&&s.emissive.fromArray(K.color),K.texture&&(s.emissiveMap=a(K.texture,r.SRGBColorSpace));break}}r.ColorManagement.colorSpaceToWorking(s.color,r.SRGBColorSpace),s.specular&&r.ColorManagement.colorSpaceToWorking(s.specular,r.SRGBColorSpace),s.emissive&&r.ColorManagement.colorSpaceToWorking(s.emissive,r.SRGBColorSpace);let k=f.transparent,Z=f.transparency;if(Z===void 0&&k&&(Z={float:1}),k===void 0&&Z&&(k={opaque:"A_ONE",data:{color:[1,1,1,1]}}),k&&Z)if(k.data.texture)s.transparent=!0;else{const H=k.data.color;switch(k.opaque){case"A_ONE":s.opacity=H[3]*Z.float;break;case"RGB_ZERO":s.opacity=1-H[0]*Z.float;break;case"A_ZERO":s.opacity=1-H[3]*Z.float;break;case"RGB_ONE":s.opacity=H[0]*Z.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',k.opaque)}s.opacity<1&&(s.transparent=!0)}if(i.extra!==void 0&&i.extra.technique!==void 0){const H=i.extra.technique;for(const K in H){const ne=H[K];switch(K){case"double_sided":s.side=ne===1?r.DoubleSide:r.FrontSide;break;case"bump":s.normalMap=a(ne.texture),s.normalScale=new r.Vector2(1,1);break}}}return s}function Ge(n){return N(le.materials[n],fe)}function rt(n){const t={name:n.getAttribute("name")};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"optics":t.optics=Ne(a);break}}le.cameras[n.getAttribute("id")]=t}function Ne(n){for(let t=0;t<n.childNodes.length;t++){const i=n.childNodes[t];switch(i.nodeName){case"technique_common":return nt(i)}}return{}}function nt(n){const t={};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];switch(s.nodeName){case"perspective":case"orthographic":t.technique=s.nodeName,t.parameters=mt(s);break}}return t}function mt(n){const t={};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];switch(s.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":t[s.nodeName]=parseFloat(s.textContent);break}}return t}function lt(n){let t;switch(n.optics.technique){case"perspective":t=new r.PerspectiveCamera(n.optics.parameters.yfov,n.optics.parameters.aspect_ratio,n.optics.parameters.znear,n.optics.parameters.zfar);break;case"orthographic":let i=n.optics.parameters.ymag,s=n.optics.parameters.xmag;const a=n.optics.parameters.aspect_ratio;s=s===void 0?i*a:s,i=i===void 0?s/a:i,s*=.5,i*=.5,t=new r.OrthographicCamera(-s,s,i,-i,n.optics.parameters.znear,n.optics.parameters.zfar);break;default:t=new r.PerspectiveCamera;break}return t.name=n.name||"",t}function Ve(n){const t=le.cameras[n];return t!==void 0?N(t,lt):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",n),null)}function ke(n){let t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"technique_common":t=Qe(a);break}}le.lights[n.getAttribute("id")]=t}function Qe(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"directional":case"point":case"spot":case"ambient":t.technique=a.nodeName,t.parameters=pe(a)}}return t}function pe(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"color":const f=c(a.textContent);t.color=new r.Color().fromArray(f),r.ColorManagement.colorSpaceToWorking(t.color,r.SRGBColorSpace);break;case"falloff_angle":t.falloffAngle=parseFloat(a.textContent);break;case"quadratic_attenuation":const k=parseFloat(a.textContent);t.distance=k?Math.sqrt(1/k):0;break}}return t}function Ce(n){let t;switch(n.technique){case"directional":t=new r.DirectionalLight;break;case"point":t=new r.PointLight;break;case"spot":t=new r.SpotLight;break;case"ambient":t=new r.AmbientLight;break}return n.parameters.color&&t.color.copy(n.parameters.color),n.parameters.distance&&(t.distance=n.parameters.distance),t}function Oe(n){const t=le.lights[n];return t!==void 0?N(t,Ce):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",n),null)}function Ae(n){const t={name:n.getAttribute("name"),sources:{},vertices:{},primitives:[]},i=d(n,"mesh")[0];if(i!==void 0){for(let s=0;s<i.childNodes.length;s++){const a=i.childNodes[s];if(a.nodeType!==1)continue;const f=a.getAttribute("id");switch(a.nodeName){case"source":t.sources[f]=me(a);break;case"vertices":t.vertices=Re(a);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",a.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":t.primitives.push(Le(a));break;default:console.log(a)}}le.geometries[n.getAttribute("id")]=t}}function me(n){const t={array:[],stride:3};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"float_array":t.array=c(s.textContent);break;case"Name_array":t.array=u(s.textContent);break;case"technique_common":const a=d(s,"accessor")[0];a!==void 0&&(t.stride=parseInt(a.getAttribute("stride")));break}}return t}function Re(n){const t={};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];s.nodeType===1&&(t[s.getAttribute("semantic")]=h(s.getAttribute("source")))}return t}function Le(n){const t={type:n.nodeName,material:n.getAttribute("material"),count:parseInt(n.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"input":const f=h(a.getAttribute("source")),k=a.getAttribute("semantic"),Z=parseInt(a.getAttribute("offset")),H=parseInt(a.getAttribute("set")),K=H>0?k+H:k;t.inputs[K]={id:f,offset:Z},t.stride=Math.max(t.stride,Z+1),k==="TEXCOORD"&&(t.hasUV=!0);break;case"vcount":t.vcount=C(a.textContent);break;case"p":t.p=C(a.textContent);break}}return t}function st(n){const t={};for(let i=0;i<n.length;i++){const s=n[i];t[s.type]===void 0&&(t[s.type]=[]),t[s.type].push(s)}return t}function ct(n){let t=0;for(let i=0,s=n.length;i<s;i++)n[i].hasUV===!0&&t++;t>0&&t<n.length&&(n.uvsNeedsFix=!0)}function dt(n){const t={},i=n.sources,s=n.vertices,a=n.primitives;if(a.length===0)return{};const f=st(a);for(const k in f){const Z=f[k];ct(Z),t[k]=ut(Z,i,s)}return t}function ut(n,t,i){const s={},a={array:[],stride:0},f={array:[],stride:0},k={array:[],stride:0},Z={array:[],stride:0},H={array:[],stride:0},K={array:[],stride:4},ne={array:[],stride:4},B=new r.BufferGeometry,te=[];let ee=0;for(let ae=0;ae<n.length;ae++){const se=n[ae],Pe=se.inputs;let ve=0;switch(se.type){case"lines":case"linestrips":ve=se.count*2;break;case"triangles":ve=se.count*3;break;case"polylist":for(let be=0;be<se.count;be++){const we=se.vcount[be];switch(we){case 3:ve+=3;break;case 4:ve+=6;break;default:ve+=(we-2)*3;break}}break;default:console.warn("THREE.ColladaLoader: Unknown primitive type:",se.type)}B.addGroup(ee,ve,ae),ee+=ve,se.material&&te.push(se.material);for(const be in Pe){const we=Pe[be];switch(be){case"VERTEX":for(const it in i){const He=i[it];switch(it){case"POSITION":const _t=a.array.length;if(Ie(se,t[He],we.offset,a.array),a.stride=t[He].stride,t.skinWeights&&t.skinIndices&&(Ie(se,t.skinIndices,we.offset,K.array),Ie(se,t.skinWeights,we.offset,ne.array)),se.hasUV===!1&&n.uvsNeedsFix===!0){const Un=(a.array.length-_t)/a.stride;for(let Xt=0;Xt<Un;Xt++)k.array.push(0,0)}break;case"NORMAL":Ie(se,t[He],we.offset,f.array),f.stride=t[He].stride;break;case"COLOR":Ie(se,t[He],we.offset,H.array),H.stride=t[He].stride;break;case"TEXCOORD":Ie(se,t[He],we.offset,k.array),k.stride=t[He].stride;break;case"TEXCOORD1":Ie(se,t[He],we.offset,Z.array),k.stride=t[He].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',it)}}break;case"NORMAL":Ie(se,t[we.id],we.offset,f.array),f.stride=t[we.id].stride;break;case"COLOR":Ie(se,t[we.id],we.offset,H.array,!0),H.stride=t[we.id].stride;break;case"TEXCOORD":Ie(se,t[we.id],we.offset,k.array),k.stride=t[we.id].stride;break;case"TEXCOORD1":Ie(se,t[we.id],we.offset,Z.array),Z.stride=t[we.id].stride;break}}}return a.array.length>0&&B.setAttribute("position",new r.Float32BufferAttribute(a.array,a.stride)),f.array.length>0&&B.setAttribute("normal",new r.Float32BufferAttribute(f.array,f.stride)),H.array.length>0&&B.setAttribute("color",new r.Float32BufferAttribute(H.array,H.stride)),k.array.length>0&&B.setAttribute("uv",new r.Float32BufferAttribute(k.array,k.stride)),Z.array.length>0&&B.setAttribute("uv1",new r.Float32BufferAttribute(Z.array,Z.stride)),K.array.length>0&&B.setAttribute("skinIndex",new r.Float32BufferAttribute(K.array,K.stride)),ne.array.length>0&&B.setAttribute("skinWeight",new r.Float32BufferAttribute(ne.array,ne.stride)),s.data=B,s.type=n[0].type,s.materialKeys=te,s}function Ie(n,t,i,s,a=!1){const f=n.p,k=n.stride,Z=n.vcount;function H(B){let te=f[B+i]*ne;const ee=te+ne;for(;te<ee;te++)s.push(K[te]);if(a){const ae=s.length-ne-1;vt.setRGB(s[ae+0],s[ae+1],s[ae+2],r.SRGBColorSpace),s[ae+0]=vt.r,s[ae+1]=vt.g,s[ae+2]=vt.b}}const K=t.array,ne=t.stride;if(n.vcount!==void 0){let B=0;for(let te=0,ee=Z.length;te<ee;te++){const ae=Z[te];if(ae===4){const se=B+k*0,Pe=B+k*1,ve=B+k*2,be=B+k*3;H(se),H(Pe),H(be),H(Pe),H(ve),H(be)}else if(ae===3){const se=B+k*0,Pe=B+k*1,ve=B+k*2;H(se),H(Pe),H(ve)}else if(ae>4)for(let se=1,Pe=ae-2;se<=Pe;se++){const ve=B+k*0,be=B+k*se,we=B+k*(se+1);H(ve),H(be),H(we)}B+=k*ae}}else for(let B=0,te=f.length;B<te;B+=k)H(B)}function ot(n){return N(le.geometries[n],dt)}function Ct(n){const t={name:n.getAttribute("name")||"",joints:{},links:[]};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"technique_common":gn(s,t);break}}le.kinematicsModels[n.getAttribute("id")]=t}function fn(n){return n.build!==void 0?n.build:n}function mn(n){return N(le.kinematicsModels[n],fn)}function gn(n,t){for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"joint":t.joints[s.getAttribute("sid")]=yn(s);break;case"link":t.links.push(It(s));break}}}function yn(n){let t;for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"prismatic":case"revolute":t=bn(s);break}}return t}function bn(n){const t={sid:n.getAttribute("sid"),name:n.getAttribute("name")||"",axis:new r.Vector3,limits:{min:0,max:0},type:n.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"axis":const a=c(s.textContent);t.axis.fromArray(a);break;case"limits":const f=s.getElementsByTagName("max")[0],k=s.getElementsByTagName("min")[0];t.limits.max=parseFloat(f.textContent),t.limits.min=parseFloat(k.textContent);break}}return t.limits.min>=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function It(n){const t={sid:n.getAttribute("sid"),name:n.getAttribute("name")||"",attachments:[],transforms:[]};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"attachment_full":t.attachments.push(wn(s));break;case"matrix":case"translate":case"rotate":t.transforms.push(Ut(s));break}}return t}function wn(n){const t={joint:n.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"link":t.links.push(It(s));break;case"matrix":case"translate":case"rotate":t.transforms.push(Ut(s));break}}return t}function Ut(n){const t={type:n.nodeName},i=c(n.textContent);switch(t.type){case"matrix":t.obj=new r.Matrix4,t.obj.fromArray(i).transpose();break;case"translate":t.obj=new r.Vector3,t.obj.fromArray(i);break;case"rotate":t.obj=new r.Vector3,t.obj.fromArray(i),t.angle=r.MathUtils.degToRad(i[3]);break}return t}function _n(n){const t={name:n.getAttribute("name")||"",rigidBodies:{}};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"rigid_body":t.rigidBodies[s.getAttribute("name")]={},kn(s,t.rigidBodies[s.getAttribute("name")]);break}}le.physicsModels[n.getAttribute("id")]=t}function kn(n,t){for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"technique_common":Cn(s,t);break}}}function Cn(n,t){for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"inertia":t.inertia=c(s.textContent);break;case"mass":t.mass=c(s.textContent)[0];break}}}function vn(n){const t={bindJointAxis:[]};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"bind_joint_axis":t.bindJointAxis.push(xn(s));break}}le.kinematicsScenes[h(n.getAttribute("url"))]=t}function xn(n){const t={target:n.getAttribute("target").split("/").pop()};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"axis":const a=s.getElementsByTagName("param")[0];t.axis=a.textContent;const f=t.axis.split("inst_").pop().split("axis")[0];t.jointIndex=f.substring(0,f.length-1);break}}return t}function En(n){return n.build!==void 0?n.build:n}function Tn(n){return N(le.kinematicsScenes[n],En)}function Nn(){const n=Object.keys(le.kinematicsModels)[0],t=Object.keys(le.kinematicsScenes)[0],i=Object.keys(le.visualScenes)[0];if(n===void 0||t===void 0)return;const s=mn(n),a=Tn(t),f=Yt(i),k=a.bindJointAxis,Z={};for(let ne=0,B=k.length;ne<B;ne++){const te=k[ne],ee=De.querySelector('[sid="'+te.target+'"]');if(ee){const ae=ee.parentElement;H(te.jointIndex,ae)}}function H(ne,B){const te=B.getAttribute("name"),ee=s.joints[ne];f.traverse(function(ae){ae.name===te&&(Z[ne]={object:ae,transforms:An(B),joint:ee,position:ee.zeroPosition})})}const K=new r.Matrix4;Jt={joints:s&&s.joints,getJointValue:function(ne){const B=Z[ne];if(B)return B.position;console.warn("THREE.ColladaLoader: Joint "+ne+" doesn't exist.")},setJointValue:function(ne,B){const te=Z[ne];if(te){const ee=te.joint;if(B>ee.limits.max||B<ee.limits.min)console.warn("THREE.ColladaLoader: Joint "+ne+" value "+B+" outside of limits (min: "+ee.limits.min+", max: "+ee.limits.max+").");else if(ee.static)console.warn("THREE.ColladaLoader: Joint "+ne+" is static.");else{const ae=te.object,se=ee.axis,Pe=te.transforms;Ze.identity();for(let ve=0;ve<Pe.length;ve++){const be=Pe[ve];if(be.sid&&be.sid.indexOf(ne)!==-1)switch(ee.type){case"revolute":Ze.multiply(K.makeRotationAxis(se,r.MathUtils.degToRad(B)));break;case"prismatic":Ze.multiply(K.makeTranslation(se.x*B,se.y*B,se.z*B));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+ee.type);break}else switch(be.type){case"matrix":Ze.multiply(be.obj);break;case"translate":Ze.multiply(K.makeTranslation(be.obj.x,be.obj.y,be.obj.z));break;case"scale":Ze.scale(be.obj);break;case"rotate":Ze.multiply(K.makeRotationAxis(be.obj,be.angle));break}}ae.matrix.copy(Ze),ae.matrix.decompose(ae.position,ae.quaternion,ae.scale),Z[ne].position=B}}else console.log("THREE.ColladaLoader: "+ne+" does not exist.")}}}function An(n){const t=[],i=De.querySelector('[id="'+n.id+'"]');for(let s=0;s<i.childNodes.length;s++){const a=i.childNodes[s];if(a.nodeType!==1)continue;let f,k;switch(a.nodeName){case"matrix":f=c(a.textContent);const Z=new r.Matrix4().fromArray(f).transpose();t.push({sid:a.getAttribute("sid"),type:a.nodeName,obj:Z});break;case"translate":case"scale":f=c(a.textContent),k=new r.Vector3().fromArray(f),t.push({sid:a.getAttribute("sid"),type:a.nodeName,obj:k});break;case"rotate":f=c(a.textContent),k=new r.Vector3().fromArray(f);const H=r.MathUtils.degToRad(f[3]);t.push({sid:a.getAttribute("sid"),type:a.nodeName,obj:k,angle:H});break}}return t}function Mn(n){const t=n.getElementsByTagName("node");for(let i=0;i<t.length;i++){const s=t[i];s.hasAttribute("id")===!1&&s.setAttribute("id",y())}}const Ze=new r.Matrix4,bt=new r.Vector3;function Mt(n){const t={name:n.getAttribute("name")||"",type:n.getAttribute("type"),id:n.getAttribute("id"),sid:n.getAttribute("sid"),matrix:new r.Matrix4,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType!==1)continue;let a;switch(s.nodeName){case"node":t.nodes.push(s.getAttribute("id")),Mt(s);break;case"instance_camera":t.instanceCameras.push(h(s.getAttribute("url")));break;case"instance_controller":t.instanceControllers.push(zt(s));break;case"instance_light":t.instanceLights.push(h(s.getAttribute("url")));break;case"instance_geometry":t.instanceGeometries.push(zt(s));break;case"instance_node":t.instanceNodes.push(h(s.getAttribute("url")));break;case"matrix":a=c(s.textContent),t.matrix.multiply(Ze.fromArray(a).transpose()),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"translate":a=c(s.textContent),bt.fromArray(a),t.matrix.multiply(Ze.makeTranslation(bt.x,bt.y,bt.z)),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"rotate":a=c(s.textContent);const f=r.MathUtils.degToRad(a[3]);t.matrix.multiply(Ze.makeRotationAxis(bt.fromArray(a),f)),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"scale":a=c(s.textContent),t.matrix.scale(bt.fromArray(a)),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"extra":break;default:console.log(s)}}return Ht(t.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",t.id):le.nodes[t.id]=t,t}function zt(n){const t={id:h(n.getAttribute("url")),materials:{},skeletons:[]};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];switch(s.nodeName){case"bind_material":const a=s.getElementsByTagName("instance_material");for(let f=0;f<a.length;f++){const k=a[f],Z=k.getAttribute("symbol"),H=k.getAttribute("target");t.materials[Z]=h(H)}break;case"skeleton":t.skeletons.push(h(s.textContent));break}}return t}function Sn(n,t){const i=[],s=[];let a,f,k;for(a=0;a<n.length;a++){const K=n[a];let ne;if(Ht(K))ne=wt(K),Gt(ne,t,i);else if(Rn(K)){const te=le.visualScenes[K].children;for(let ee=0;ee<te.length;ee++){const ae=te[ee];if(ae.type==="JOINT"){const se=wt(ae.id);Gt(se,t,i)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",K)}for(a=0;a<t.length;a++)for(f=0;f<i.length;f++)if(k=i[f],k.bone.name===t[a].name){s[a]=k,k.processed=!0;break}for(a=0;a<i.length;a++)k=i[a],k.processed===!1&&(s.push(k),k.processed=!0);const Z=[],H=[];for(a=0;a<s.length;a++)k=s[a],Z.push(k.bone),H.push(k.boneInverse);return new r.Skeleton(Z,H)}function Gt(n,t,i){n.traverse(function(s){if(s.isBone===!0){let a;for(let f=0;f<t.length;f++){const k=t[f];if(k.name===s.name){a=k.boneInverse;break}}a===void 0&&(a=new r.Matrix4),i.push({bone:s,boneInverse:a,processed:!1})}})}function Pn(n){const t=[],i=n.matrix,s=n.nodes,a=n.type,f=n.instanceCameras,k=n.instanceControllers,Z=n.instanceLights,H=n.instanceGeometries,K=n.instanceNodes;for(let B=0,te=s.length;B<te;B++)t.push(wt(s[B]));for(let B=0,te=f.length;B<te;B++){const ee=Ve(f[B]);ee!==null&&t.push(ee.clone())}for(let B=0,te=k.length;B<te;B++){const ee=k[B],ae=T(ee.id),se=ot(ae.id),Pe=qt(se,ee.materials),ve=ee.skeletons,be=ae.skin.joints,we=Sn(ve,be);for(let it=0,He=Pe.length;it<He;it++){const _t=Pe[it];_t.isSkinnedMesh&&(_t.bind(we,ae.skin.bindMatrix),_t.normalizeSkinWeights()),t.push(_t)}}for(let B=0,te=Z.length;B<te;B++){const ee=Oe(Z[B]);ee!==null&&t.push(ee.clone())}for(let B=0,te=H.length;B<te;B++){const ee=H[B],ae=ot(ee.id),se=qt(ae,ee.materials);for(let Pe=0,ve=se.length;Pe<ve;Pe++)t.push(se[Pe])}for(let B=0,te=K.length;B<te;B++)t.push(wt(K[B]).clone());let ne;if(s.length===0&&t.length===1)ne=t[0];else{ne=a==="JOINT"?new r.Bone:new r.Group;for(let B=0;B<t.length;B++)ne.add(t[B])}return ne.name=a==="JOINT"?n.sid:n.name,ne.matrix.copy(i),ne.matrix.decompose(ne.position,ne.quaternion,ne.scale),ne}const Ln=new r.MeshBasicMaterial({name:r.Loader.DEFAULT_MATERIAL_NAME,color:16711935});function Vn(n,t){const i=[];for(let s=0,a=n.length;s<a;s++){const f=t[n[s]];f===void 0?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",n[s]),i.push(Ln)):i.push(Ge(f))}return i}function qt(n,t){const i=[];for(const s in n){const a=n[s],f=Vn(a.materialKeys,t);if(f.length===0&&(s==="lines"||s==="linestrips"?f.push(new r.LineBasicMaterial):f.push(new r.MeshPhongMaterial)),s==="lines"||s==="linestrips")for(let K=0,ne=f.length;K<ne;K++){const B=f[K];if(B.isMeshPhongMaterial===!0||B.isMeshLambertMaterial===!0){const te=new r.LineBasicMaterial;te.color.copy(B.color),te.opacity=B.opacity,te.transparent=B.transparent,f[K]=te}}const k=a.data.attributes.skinIndex!==void 0,Z=f.length===1?f[0]:f;let H;switch(s){case"lines":H=new r.LineSegments(a.data,Z);break;case"linestrips":H=new r.Line(a.data,Z);break;case"triangles":case"polylist":k?H=new r.SkinnedMesh(a.data,Z):H=new r.Mesh(a.data,Z);break}i.push(H)}return i}function Ht(n){return le.nodes[n]!==void 0}function wt(n){return N(le.nodes[n],Pn)}function Bn(n){const t={name:n.getAttribute("name"),children:[]};Mn(n);const i=d(n,"node");for(let s=0;s<i.length;s++)t.children.push(Mt(i[s]));le.visualScenes[n.getAttribute("id")]=t}function $t(n){const t=new r.Group;t.name=n.name;const i=n.children;for(let s=0;s<i.length;s++){const a=i[s];t.add(wt(a.id))}return t}function Rn(n){return le.visualScenes[n]!==void 0}function Yt(n){return N(le.visualScenes[n],$t)}function Dn(n){const t=d(n,"instance_visual_scene")[0];return Yt(h(t.getAttribute("url")))}function Fn(){const n=le.clips;if(m(n)===!0){if(m(le.animations)===!1){const t=[];for(const i in le.animations){const s=A(i);for(let a=0,f=s.length;a<f;a++)t.push(s[a])}xt.push(new r.AnimationClip("default",-1,t))}}else for(const t in n)xt.push(re(t))}function jn(n){let t="";const i=[n];for(;i.length;){const s=i.shift();s.nodeType===Node.TEXT_NODE?t+=s.textContent:(t+=`
7
- `,i.push(...s.childNodes))}return t.trim()}if(o.length===0)return{scene:new r.Scene};const Kt=new DOMParser().parseFromString(o,"application/xml"),De=d(Kt,"COLLADA")[0],St=Kt.getElementsByTagName("parsererror")[0];if(St!==void 0){const n=d(St,"div")[0];let t;return n?t=n.textContent:t=jn(St),console.error(`THREE.ColladaLoader: Failed to parse collada file.
8
- `,t),null}const On=De.getAttribute("version");console.debug("THREE.ColladaLoader: File version",On);const Wt=L(d(De,"asset")[0]),Zt=new r.TextureLoader(this.manager);Zt.setPath(this.resourcePath||l).setCrossOrigin(this.crossOrigin);let Pt;rn&&(Pt=new rn(this.manager),Pt.setPath(this.resourcePath||l));const vt=new r.Color,xt=[];let Jt={},In=0;const le={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};E(De,"library_animations","animation",b),E(De,"library_animation_clips","animation_clip",p),E(De,"library_controllers","controller",V),E(De,"library_images","image",I),E(De,"library_effects","effect",ge),E(De,"library_materials","material",We),E(De,"library_cameras","camera",rt),E(De,"library_lights","light",ke),E(De,"library_geometries","geometry",Ae),E(De,"library_nodes","node",Mt),E(De,"library_visual_scenes","visual_scene",Bn),E(De,"library_kinematics_models","kinematics_model",Ct),E(De,"library_physics_models","physics_model",_n),E(De,"scene","instance_kinematics_scene",vn),P(le.animations,G),P(le.clips,X),P(le.controllers,U),P(le.images,W),P(le.effects,_e),P(le.materials,fe),P(le.cameras,lt),P(le.lights,Ce),P(le.geometries,dt),P(le.visualScenes,$t),Fn(),Nn();const Et=Dn(d(De,"scene")[0]);return Et.animations=xt,Wt.upAxis==="Z_UP"&&(console.warn("THREE.ColladaLoader: You are loading an asset with a Z-UP coordinate system. The loader just rotates the asset to transform it into Y-UP. The vertex data are not converted, see #24289."),Et.rotation.set(-Math.PI/2,0,0)),Et.scale.multiplyScalar(Wt.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),xt},kinematics:Jt,library:le,scene:Et}}}const Dt=new r.Quaternion,ln=new r.Euler;function kt(M){return M?M.trim().split(/\s+/g).map(o=>parseFloat(o)):[0,0,0]}function cn(M,o,l=!1){l||M.rotation.set(0,0,0),ln.set(o[0],o[1],o[2],"ZYX"),Dt.setFromEuler(ln),Dt.multiply(M.quaternion),M.quaternion.copy(Dt)}class fo{constructor(o){this.manager=o||r.DefaultLoadingManager,this.loadMeshCb=this.defaultMeshLoader.bind(this),this.parseVisual=!0,this.parseCollision=!1,this.packages="",this.workingPath="",this.fetchOptions={}}loadAsync(o){return new Promise((l,d)=>{this.load(o,l,null,d)})}load(o,l,d,u){const c=this.manager,C=r.LoaderUtils.extractUrlBase(o),h=this.manager.resolveURL(o);c.itemStart(h),fetch(h,this.fetchOptions).then(y=>{if(y.ok)return d&&d(null),y.text();throw new Error(`URDFLoader: Failed to load url '${h}' with error code ${y.status} : ${y.statusText}.`)}).then(y=>{const m=this.parse(y,this.workingPath||C);l(m),c.itemEnd(h)}).catch(y=>{u?u(y):console.error("URDFLoader: Error loading file.",y),c.itemError(h),c.itemEnd(h)})}parse(o,l=this.workingPath){const d=this.packages,u=this.loadMeshCb,c=this.parseVisual,C=this.parseCollision,h=this.manager,y={},m={},L={};function R(_){if(!/^package:\/\//.test(_))return l?l+_:_;const[G,A]=_.replace(/^package:\/\//,"").split(/\/(.+)/);if(typeof d=="string")return d.endsWith(G)?d+"/"+A:d+"/"+G+"/"+A;if(d instanceof Function)return d(G)+"/"+A;if(typeof d=="object")return G in d?d[G]+"/"+A:(console.error(`URDFLoader : ${G} not found in provided package list.`),null)}function O(_){let G;_ instanceof Document?G=[..._.children]:_ instanceof Element?G=[_]:G=[...new DOMParser().parseFromString(_,"text/xml").children];const A=G.filter(w=>w.nodeName==="robot").pop();return E(A)}function E(_){const G=[..._.children],A=G.filter(F=>F.nodeName.toLowerCase()==="link"),w=G.filter(F=>F.nodeName.toLowerCase()==="joint"),g=G.filter(F=>F.nodeName.toLowerCase()==="material"),j=new r.URDFRobot;j.robotName=_.getAttribute("name"),j.urdfRobotNode=_,g.forEach(F=>{const q=F.getAttribute("name");L[q]=b(F)});const S={},v={};A.forEach(F=>{const q=F.getAttribute("name"),ie=_.querySelector(`child[link="${q}"]`)===null;y[q]=N(F,S,v,ie?j:null)}),w.forEach(F=>{const q=F.getAttribute("name");m[q]=P(F)}),j.joints=m,j.links=y,j.colliders=v,j.visual=S;const Y=Object.values(m);return Y.forEach(F=>{F instanceof r.URDFMimicJoint&&m[F.mimicJoint].mimicJoints.push(F)}),Y.forEach(F=>{const q=new Set,ie=ce=>{if(q.has(ce))throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");q.add(ce),ce.mimicJoints.forEach(D=>{ie(D)})};ie(F)}),j.frames={...v,...S,...y,...m},j}function P(_){const G=[..._.children],A=_.getAttribute("type");let w;const g=G.find(q=>q.nodeName.toLowerCase()==="mimic");g?(w=new r.URDFMimicJoint,w.mimicJoint=g.getAttribute("joint"),w.multiplier=parseFloat(g.getAttribute("multiplier")||1),w.offset=parseFloat(g.getAttribute("offset")||0)):w=new r.URDFJoint,w.urdfNode=_,w.name=_.getAttribute("name"),w.urdfName=w.name,w.jointType=A;let j=null,S=null,v=[0,0,0],Y=[0,0,0];G.forEach(q=>{const ie=q.nodeName.toLowerCase();ie==="origin"?(v=kt(q.getAttribute("xyz")),Y=kt(q.getAttribute("rpy"))):ie==="child"?S=y[q.getAttribute("link")]:ie==="parent"?j=y[q.getAttribute("link")]:ie==="limit"&&(w.limit.lower=parseFloat(q.getAttribute("lower")||w.limit.lower),w.limit.upper=parseFloat(q.getAttribute("upper")||w.limit.upper))}),j.add(w),w.add(S),cn(w,Y),w.position.set(v[0],v[1],v[2]);const F=G.filter(q=>q.nodeName.toLowerCase()==="axis")[0];if(F){const q=F.getAttribute("xyz").split(/\s+/g).map(ie=>parseFloat(ie));w.axis=new r.Vector3(q[0],q[1],q[2]),w.axis.normalize()}return w}function N(_,G,A,w=null){w===null&&(w=new r.URDFLink);const g=[..._.children];return w.name=_.getAttribute("name"),w.urdfName=w.name,w.urdfNode=_,c&&g.filter(S=>S.nodeName.toLowerCase()==="visual").forEach(S=>{const v=x(S,L);if(w.add(v),S.hasAttribute("name")){const Y=S.getAttribute("name");v.name=Y,v.urdfName=Y,G[Y]=v}}),C&&g.filter(S=>S.nodeName.toLowerCase()==="collision").forEach(S=>{const v=x(S);if(w.add(v),S.hasAttribute("name")){const Y=S.getAttribute("name");v.name=Y,v.urdfName=Y,A[Y]=v}}),w}function b(_){const G=[..._.children],A=new r.MeshPhongMaterial;return A.name=_.getAttribute("name")||"",G.forEach(w=>{const g=w.nodeName.toLowerCase();if(g==="color"){const j=w.getAttribute("rgba").split(/\s/g).map(S=>parseFloat(S));A.color.setRGB(j[0],j[1],j[2]),A.opacity=j[3],A.transparent=j[3]<1,A.depthWrite=!A.transparent}else if(g==="texture"){const j=w.getAttribute("filename");if(j){const S=new r.TextureLoader(h),v=R(j);A.map=S.load(v),A.map.colorSpace=r.SRGBColorSpace}}}),A}function x(_,G={}){const A=_.nodeName.toLowerCase()==="collision",w=[..._.children];let g=null;const j=w.filter(v=>v.nodeName.toLowerCase()==="material")[0];if(j){const v=j.getAttribute("name");v&&v in G?g=G[v]:g=b(j)}else g=new r.MeshPhongMaterial;const S=A?new r.URDFCollider:new r.URDFVisual;return S.urdfNode=_,w.forEach(v=>{const Y=v.nodeName.toLowerCase();if(Y==="geometry"){const F=v.children[0].nodeName.toLowerCase();if(F==="mesh"){const q=v.children[0].getAttribute("filename"),ie=R(q);if(ie!==null){const ce=v.children[0].getAttribute("scale");if(ce){const D=kt(ce);S.scale.set(D[0],D[1],D[2])}u(ie,h,(D,p)=>{p?console.error("URDFLoader: Error loading mesh.",p):D&&(D instanceof r.Mesh&&(D.material=g),D.position.set(0,0,0),D.quaternion.identity(),S.add(D))})}}else if(F==="box"){const q=new r.Mesh;q.geometry=new r.BoxGeometry(1,1,1),q.material=g;const ie=kt(v.children[0].getAttribute("size"));q.scale.set(ie[0],ie[1],ie[2]),S.add(q)}else if(F==="sphere"){const q=new r.Mesh;q.geometry=new r.SphereGeometry(1,30,30),q.material=g;const ie=parseFloat(v.children[0].getAttribute("radius"))||0;q.scale.set(ie,ie,ie),S.add(q)}else if(F==="cylinder"){const q=new r.Mesh;q.geometry=new r.CylinderGeometry(1,1,1,30),q.material=g;const ie=parseFloat(v.children[0].getAttribute("radius"))||0,ce=parseFloat(v.children[0].getAttribute("length"))||0;q.scale.set(ie,ce,ie),q.rotation.set(Math.PI/2,0,0),S.add(q)}}else if(Y==="origin"){const F=kt(v.getAttribute("xyz")),q=kt(v.getAttribute("rpy"));S.position.set(F[0],F[1],F[2]),S.rotation.set(0,0,0),cn(S,q)}}),S}return O(o)}defaultMeshLoader(o,l,d){/\.stl$/i.test(o)?new At(l).load(o,c=>{const C=new r.Mesh(c,new r.MeshPhongMaterial);d(C)}):/\.dae$/i.test(o)?new po(l).load(o,c=>d(c.scene)):console.warn(`URDFLoader: Could not load model at ${o}.
9
- No loader available`)}}function mo(M,o,l,d,u){const c=async O=>{try{const E=await jt.downloadAvatarApi({url:O});if(E.status!==200)throw new Error(`下载失败: ${E.status}`);return E.data}catch(E){throw console.error("addModelFromUrl失败:",E),E}},C=O=>new Promise((E,P)=>{const N=new FileReader;N.onload=b=>{try{const x=b.target.result,G=new Rt().parse(x);G.preload(),E(G)}catch(x){P(x)}},N.onerror=()=>{P(new Error("MTL文件读取失败"))},N.readAsText(O)}),h=async O=>{const E={materials:{},create:function(P){return this.materials[P]?this.materials[P]:(console.warn(`Material '${P}' not found, using default material`),new r.MeshPhongMaterial({color:8947848,side:r.DoubleSide}))},getAsArray:function(){const P=[];for(const N in this.materials)P.push(this.materials[N]);return P},preload:function(){for(const P in this.materials)this.materials[P].map&&(this.materials[P].map.needsUpdate=!0)}};for(const P of O){const N=await C(P);Object.assign(E.materials,N.materials)}return E.preload(),E},y=async(O,E=[])=>new Promise((P,N)=>{const b=new FileReader;b.onload=async x=>{try{const _=x.target.result;let G=null;E&&E.length>0&&(E.length===1?G=await C(E[0]):G=await h(E));const A=new Bt;G&&A.setMaterials(G);const w=A.parse(_);G||w.traverse(g=>{g.isMesh&&(g.material=new r.MeshPhongMaterial({color:8947848,side:r.DoubleSide}))}),P(w)}catch(_){N(_)}},b.onerror=()=>{N(new Error("OBJ文件读取失败"))},b.readAsText(O)}),m=async O=>{var E;try{l.value=!0;const{scene:P}=M();if(!P)throw new Error("Scene not initialized");u();const N=[];for(let b=0;b<O.length;b++){const x=O[b];d.value=`正在加载模型 ${b+1}/${O.length}...`;const _=await c(x.objUrl),G=((E=x.objUrl)==null?void 0:E.split("/").pop())||`model_${b}.obj`,A=new File([_],G,{type:_.type});let w=[];if(x.mtlUrls){const j=Array.isArray(x.mtlUrls)?x.mtlUrls:[x.mtlUrls];for(let S=0;S<j.length;S++){const v=j[S],Y=await c(v),F=(v==null?void 0:v.split("/").pop())||`material_${b}_${S}.mtl`,q=new File([Y],F,{type:Y.type});w.push(q)}}const g=await y(A,w);P.add(g),o.value.push(g),N.push(g)}return l.value=!1,N}catch(P){throw console.error("加载模型失败:",P),l.value=!1,P}},L=async(O,E,P=[],N=[])=>{let b;const x=O.toLowerCase();switch(x){case".txt":case".cpt":case".obj":const _=await E.text();if(x===".txt"||x===".cpt"){const ce=/^(?!.*\bf\b)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?$/gm,p=[..._.matchAll(ce)].map(V=>({x:parseFloat(V[1]),y:parseFloat(V[2]),z:parseFloat(V[3])})),X=new r.BufferGeometry,re=p.flatMap(V=>[V.x,V.y,V.z]);if(X.setAttribute("position",new r.Float32BufferAttribute(re,3)),x===".txt"){const V=new r.PointsMaterial({color:"#5B5C99",size:1,sizeAttenuation:!1});b=new r.Points(X,V)}else if(x===".cpt"){const V=new r.LineBasicMaterial({color:"#5B5C99",linewidth:100});b=new r.Line(X,V)}}else if(x===".obj"){const ce=new Bt;if(P&&P.length>0){const D=new Rt;for(const p of P){const X=await p.text(),re=D.parse(X);re.preload(),ce.setMaterials(re);break}}b=ce.parse(_),(!P||P.length===0)&&b.traverse(D=>{D.isMesh&&(D.material=new r.MeshPhongMaterial({color:"#B3B3D4"})),D instanceof r.Mesh&&(D.material.side=r.DoubleSide)})}break;case".stl":const G=await E.arrayBuffer(),w=new At().parse(G),g=new r.MeshPhongMaterial({color:"#B3B3D4",side:r.DoubleSide});b=new r.Mesh(w,g);break;case".urdf":const j=await E.text(),S=new fo,v=new Map;N.forEach(ce=>{v.set(ce.name,ce.blob)}),S.loadMeshCb=async(ce,D,p,X,re)=>{const V=ce.split("/").pop(),$=v.get(V);if(!$){re(new Error(`找不到文件: ${V}`));return}const Q=V.split(".").pop().toLowerCase();switch(Q){case"stl":const oe=await $.arrayBuffer(),z=new At(D).parse(oe),T=new r.Mesh(z,new r.MeshPhongMaterial);p(T);break;case"obj":const I=await $.text(),W=new Bt(D),J=V.replace(".obj",".mtl"),ge=v.get(J);if(ge){const je=await ge.text(),Ee=new Rt(D).parse(je);Ee.preload(),W.setMaterials(Ee)}const Me=W.parse(I);p(Me);break;default:re(new Error(`不支持的文件格式: ${Q}`))}},b=S.parse(j);break;case".nc":const Y=["Mach_B_Axis_0.STL","Mach_C_Axis_0.STL","Mach_X_Axis_0.STL","Mach_Y_Axis_0.STL","Mach_Z_Axis_0.STL","Mach_Spindle_0.STL"],F={"Mach_Y_Axis_0.STL":"rgb(128,118,152)","Mach_B_Axis_0.STL":"rgb(204,143,89)","Mach_C_Axis_0.STL":"rgb(145,245,251)","Mach_X_Axis_0.STL":"rgb(125,158,192)","Mach_Z_Axis_0.STL":"rgb(248,228,118)","Mach_Spindle_0.STL":"rgb(145,145,145)"},q=new r.Group,ie=Y.map(ce=>new Promise((D,p)=>{new At().load(`/model/${ce}`,re=>{const V=new r.MeshPhongMaterial({color:F[ce]||"#B3B3D4",side:r.DoubleSide}),$=new r.Mesh(re,V);D($)},void 0,p)}));try{(await Promise.all(ie)).forEach(D=>q.add(D)),b=q}catch(ce){throw console.error("加载NC文件对应的STL文件失败:",ce),new Error("无法加载.NC文件对应的STL文件")}break;default:throw new Error(`不支持的文件格式: ${O}`)}return b};return{addModelsFromUrls:m,loadModelByDefaultPath:async O=>{console.log(O);try{l.value=!0,d.value="正在加载模型...";const{scene:E}=M();if(!E)throw new Error("Scene not initialized");u(),await new Promise(N=>setTimeout(N,100));const P=[];for(let N=0;N<O.length;N++){const b=O[N],x=await L(b.suffix,b.blob,b.mtlBlobs||[],b.meshFiles||[]);E.add(x),o.value.push(x),P.push(x)}return l.value=!1,d.value="",P}catch(E){throw console.error("加载模型失败:",E),l.value=!1,d.value="",E}}}}const go={class:"obj-viewer-container"},yo={class:"floating-controls"},bo=["disabled"],wo=["disabled","title"],_o={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},ko={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Co=["disabled"],vo=["title"],xo={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Eo={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},To={key:0,class:"clipping-panel"},No={class:"panel-content"},Ao={class:"radio-group"},Mo={class:"radio-label"},So={class:"radio-label"},Po={class:"radio-label"},Lo={class:"radio-label"},Vo={key:1,class:"loading-overlay"},Bo={__name:"threeModel",setup(M,{expose:o}){const l=e.ref(null),d=e.ref(!1),u=e.ref(""),c=e.ref(!1),C=e.ref(!1),{currentModels:h,initialCameraPosition:y,initialTargetPosition:m,initThreeJS:L,handleResize:R,fitCameraToAllModels:O,getThreeJSObjects:E,clearAllModels:P,cleanup:N}=oo(l),{isAnimating:b,toggleAnimation:x,stopAnimation:_}=so(E,h),{isClipping:G,activeClippingAxis:A,toggleClipping:w,updateClippingPlanes:g}=io(E,h),{addModelsFromUrls:j,loadModelByDefaultPath:S}=mo(E,h,d,u,P),v=()=>{if(C.value||h.value.length===0)return;C.value=!0,b.value&&_();const{camera:D,controls:p}=E();if(!D||!p)return;p.enabled=!0;const X=U=>U<.5?4*U*U*U:1-Math.pow(-2*U+2,3)/2,re=D.position.clone(),V=p.target.clone(),$=1500,Q=Date.now(),oe=()=>{const U=Date.now()-Q,z=Math.min(U/$,1),T=X(z);D.position.lerpVectors(re,y.value,T),p.target.lerpVectors(V,m.value,T),z<1?requestAnimationFrame(oe):C.value=!1};oe()},Y=()=>{document.fullscreenElement?document.exitFullscreen().then(()=>{c.value=!1,e.nextTick(()=>{R()})}).catch(D=>{console.error("无法退出全屏:",D)}):l.value.requestFullscreen().then(()=>{c.value=!0,e.nextTick(()=>{R()})}).catch(D=>{console.error("无法进入全屏:",D)})},F=()=>{c.value=!!document.fullscreenElement,c.value||e.nextTick(()=>{R()})},q=async(D,p)=>{try{b.value&&_(),G.value&&w();const X=await p(D);return O(),X}catch(X){throw console.error("加载模型失败:",X),X}},ie=async D=>q(D,j),ce=async D=>q(D,S);return e.onMounted(async()=>{await e.nextTick(),L(),window.addEventListener("resize",R),document.addEventListener("fullscreenchange",F)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",R),document.removeEventListener("fullscreenchange",F),b.value&&_(),N()}),o({addModelsFromUrls:ie,loadModelByDefaultPath:ce}),(D,p)=>(e.openBlock(),e.createElementBlock("div",go,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:l,class:"threejs-container"},null,512),e.createElementVNode("div",yo,[e.createElementVNode("button",{onClick:v,class:e.normalizeClass(["control-btn","reset-btn"]),disabled:d.value||e.unref(h).length===0||C.value,title:"重置"},p[10]||(p[10]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),e.createElementVNode("polyline",{points:"9,22 9,12 15,12 15,22"})],-1)]),8,bo),e.createElementVNode("button",{onClick:p[0]||(p[0]=(...X)=>e.unref(x)&&e.unref(x)(...X)),class:e.normalizeClass(["control-btn","animation-btn",{active:e.unref(b)}]),disabled:d.value||e.unref(h).length===0,title:e.unref(b)?"停止动画":"动画视图"},[e.unref(b)?(e.openBlock(),e.createElementBlock("svg",ko,p[12]||(p[12]=[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),e.createElementVNode("rect",{x:"9.5",y:"8",width:"2",height:"8",fill:"currentColor"},null,-1),e.createElementVNode("rect",{x:"12.5",y:"8",width:"2",height:"8",fill:"currentColor"},null,-1)]))):(e.openBlock(),e.createElementBlock("svg",_o,p[11]||(p[11]=[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),e.createElementVNode("polygon",{points:"10,8 16,12 10,16",fill:"currentColor"},null,-1)])))],10,wo),e.createElementVNode("button",{onClick:p[1]||(p[1]=(...X)=>e.unref(w)&&e.unref(w)(...X)),class:e.normalizeClass(["control-btn","clipping-btn",{active:e.unref(G)}]),disabled:d.value||e.unref(h).length===0,title:"剖面视图"},p[13]||(p[13]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("rect",{x:"3",y:"3",width:"18",height:"18"}),e.createElementVNode("line",{x1:"-14",y1:"12",x2:"30",y2:"12","stroke-dasharray":"4,2"})],-1)]),10,Co),e.createElementVNode("button",{onClick:Y,class:e.normalizeClass(["control-btn","fullscreen-btn"]),title:c.value?"退出全屏":"全屏"},[c.value?(e.openBlock(),e.createElementBlock("svg",Eo,p[15]||(p[15]=[e.createElementVNode("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"},null,-1)]))):(e.openBlock(),e.createElementBlock("svg",xo,p[14]||(p[14]=[e.createElementVNode("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"},null,-1)])))],8,vo)]),e.unref(G)?(e.openBlock(),e.createElementBlock("div",To,[e.createElementVNode("div",No,[e.createElementVNode("div",Ao,[e.createElementVNode("label",Mo,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":p[2]||(p[2]=X=>e.isRef(A)?A.value=X:null),onChange:p[3]||(p[3]=(...X)=>e.unref(g)&&e.unref(g)(...X))},null,544),[[e.vModelRadio,e.unref(A)]]),p[16]||(p[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",So,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":p[4]||(p[4]=X=>e.isRef(A)?A.value=X:null),onChange:p[5]||(p[5]=(...X)=>e.unref(g)&&e.unref(g)(...X))},null,544),[[e.vModelRadio,e.unref(A)]]),p[17]||(p[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",Po,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":p[6]||(p[6]=X=>e.isRef(A)?A.value=X:null),onChange:p[7]||(p[7]=(...X)=>e.unref(g)&&e.unref(g)(...X))},null,544),[[e.vModelRadio,e.unref(A)]]),p[18]||(p[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",Lo,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":p[8]||(p[8]=X=>e.isRef(A)?A.value=X:null),onChange:p[9]||(p[9]=(...X)=>e.unref(g)&&e.unref(g)(...X))},null,544),[[e.vModelRadio,e.unref(A)]]),p[19]||(p[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])])):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("div",Vo,[p[20]||(p[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(u.value),1)])):e.createCommentVNode("",!0)]))}},Ro=yt._export_sfc(Bo,[["__scopeId","data-v-4d1111d9"]]),Do={class:"bread-content"},Fo=["onClick"],jo={key:0,class:"split-title"},Oo={__name:"index",props:{breadArray:{type:Array,default:()=>[]}},emits:["click"],setup(M,{emit:o}){const l=M,d=e.ref([]),u=o;e.onMounted(()=>{d.value=l==null?void 0:l.breadArray}),e.watch(()=>l==null?void 0:l.breadArray,()=>{d.value=l==null?void 0:l.breadArray},{deep:!0,immediate:!0});const c=C=>{u("click",C)};return(C,h)=>(e.openBlock(),e.createElementBlock("div",Do,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(y,m)=>{var L;return e.openBlock(),e.createElementBlock("div",{key:m,class:"bread-item"},[e.createElementVNode("div",{class:"bread-title",onClick:R=>c(y),style:e.normalizeStyle({opacity:((L=d.value)==null?void 0:L.length)-1===m?"0.7":"1"})},e.toDisplayString(y.value),13,Fo),m!==d.value.length-1&&Array.isArray(d.value)?(e.openBlock(),e.createElementBlock("div",jo,e.toDisplayString("/"))):e.createCommentVNode("",!0)])}),128))]))}},pn=yt._export_sfc(Oo,[["__scopeId","data-v-ded7e2bd"]]),Io={class:"item-menu-content"},Uo={class:"item-left-content"},zo={key:0,class:"page-icon"},Go={class:"avatar"},qo={style:{display:"flex"}},Ho={class:"select-icon"},$o={key:0,class:"model-operate",style:{width:"0px"}},Yo={class:"model-select"},Ko={class:"model-fill"},Wo={key:1,class:"show-main-content"},Zo={class:"show-content"},Jo={class:"item-view-group"},Xo={class:"show-item-content"},Qo={class:"item-view-group"},es={key:2,class:"show-main-content"},ts={__name:"browser",props:{content:String,jsonContents:Array},emits:["change","contentChange"],setup(M,{emit:o}){const l=dn.useLoginState(),{loginUserInfo:d,cryptoInfo:u}=he.storeToRefs(l);e.onMounted(()=>{un.ElNotification({title:"温馨提示:",type:"success",message:"欢迎使用系统",duration:1e3})});const c=r.useModelComp(Xe.pinia);r.useFormToTableComp(Xe.pinia),e.ref(!0);const C=he.useMenuState();e.ref(!0);const{itemData:h,isEdit:y,isRefreshCurStructure:m,curStructureCompIds:L}=he.storeToRefs(c),R=r.useUnit(Xe.pinia),{activeMenuPath:O,menus:E,importLoading:P}=he.storeToRefs(C),{selectIndex:N,selectTitle:b}=he.storeToRefs(R);return e.ref([]),e.ref(!1),(x,_)=>{const G=e.resolveComponent("el-aside"),A=e.resolveComponent("el-button"),w=e.resolveComponent("el-avatar"),g=e.resolveComponent("el-header"),j=e.resolveComponent("router-view"),S=e.resolveComponent("el-main"),v=e.resolveComponent("el-container"),Y=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createBlock(v,{"element-loading-text":"正在加载页面数据..."},{default:e.withCtx(()=>[e.unref(y)==="view"?(e.openBlock(),e.createBlock(G,{key:0,width:"250px"},{default:e.withCtx(()=>[e.createVNode(Ft.default,{mode:"vertical"})]),_:1})):e.createCommentVNode("",!0),e.createVNode(v,null,{default:e.withCtx(()=>[e.createVNode(g,null,{default:e.withCtx(()=>{var F;return[e.createElementVNode("div",Io,[e.createElementVNode("div",Uo,[e.unref(y)==="edit"?(e.openBlock(),e.createElementBlock("div",zo,[e.createVNode(A,{text:"",onClick:e.unref(ue.onBack)},{default:e.withCtx(()=>_[2]||(_[2]=[e.createTextVNode(" 返回页面 ")])),_:1,__:[2]},8,["onClick"]),e.createVNode(A,{text:"",onClick:_[0]||(_[0]=q=>{var ie,ce;return e.unref(ue.clickSavePage)((ce=(ie=e.unref(b))==null?void 0:ie.map(D=>D.value))==null?void 0:ce.join("/"))})},{icon:e.withCtx(()=>[e.createVNode(ht.SvgIcon,{name:"Store"})]),default:e.withCtx(()=>[_[3]||(_[3]=e.createTextVNode(" 保存页面 "))]),_:1,__:[3]})])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(pn,{key:e.unref(b),breadArray:e.unref(b),onClick:e.unref(ue.onClick)},null,8,["breadArray","onClick"]))]),e.createElementVNode("div",Go,[e.unref(y)==="view"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"select-icon",onClick:_[1]||(_[1]=(...q)=>e.unref(ue.onSelectFixContent)&&e.unref(ue.onSelectFixContent)(...q))},[e.createElementVNode("div",qo,[e.createVNode(ht.SvgIcon,{name:"write",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}})]),_[4]||(_[4]=e.createElementVNode("div",{class:"layout-trigger"},e.toDisplayString("修改布局"),-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",Ho,[e.renderSlot(x.$slots,"default",{},void 0,!0)]),e.createVNode(w,{size:35,src:(F=e.unref(d))==null?void 0:F.avatarUrl},{default:e.withCtx(()=>{var q;return[e.createTextVNode(e.toDisplayString(((q=e.unref(d))==null?void 0:q.account)??"未知"),1)]}),_:1},8,["src"])])])]}),_:3}),e.createVNode(S,null,{default:e.withCtx(()=>{var F,q,ie,ce;return[e.unref(y)==="edit"?(e.openBlock(),e.createElementBlock("div",$o,[e.createElementVNode("div",Yo,[e.createVNode(at.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:x.innerWidth},[e.createVNode(at.modelShow)])),e.createElementVNode("div",Ko,[e.createVNode(at.modelFill)])])):x.$route.path==="/"&&((F=e.unref(ue.showItems))==null?void 0:F.length)>0&&e.unref(y)==="view"?(e.openBlock(),e.createElementBlock("div",Wo,[e.createElementVNode("div",Zo,[(q=e.unref(pt.cloneDeep)(e.unref(ue.showItems)))!=null&&q.find(D=>D.comp==="FormTop")?(e.openBlock(),e.createElementBlock("div",{class:"show-header",key:x.index},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((ie=e.unref(pt.cloneDeep)(e.unref(ue.showItems)))==null?void 0:ie.filter(D=>D.comp==="FormTop"),(D,p)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:p},[e.createElementVNode("div",Jo,e.toDisplayString(D.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(ue.getComponents)(D.comp)),{itemData:D==null?void 0:D.compData,childItemData:D==null?void 0:D.itemChildData,key:(D==null?void 0:D.id)??p,onChange:e.unref(ue.onChange),index:(D==null?void 0:D.id)??p,onContentChange:e.unref(ue.onContentChange),onPageChange:e.unref(ue.onPageChange)},null,40,["itemData","childItemData","onChange","index","onContentChange","onPageChange"]))]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Xo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((ce=e.unref(pt.cloneDeep)(e.unref(ue.showItems)))==null?void 0:ce.filter(D=>D.comp!=="FormTop"),(D,p)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:p},[e.createElementVNode("div",Qo,e.toDisplayString(D.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(ue.getComponents)(D.comp)),{itemData:D==null?void 0:D.compData,childItemData:D==null?void 0:D.itemChildData,key:(D==null?void 0:D.id)??p,onChange:e.unref(ue.onChange),index:(D==null?void 0:D.id)??p,onContentChange:e.unref(ue.onContentChange),onPageChange:e.unref(ue.onPageChange)},null,40,["itemData","childItemData","onChange","index","onContentChange","onPageChange"]))]))),128))])])])):e.unref(y)==="view"?(e.openBlock(),e.createElementBlock("div",es,[e.createVNode(j)])):e.createCommentVNode("",!0)]}),_:1})]),_:3})]),_:3})),[[Y,e.unref(P)]])}}},ns=yt._export_sfc(ts,[["__scopeId","data-v-d2611062"]]);function os(M,o,l,d,u,c){const C=e.resolveComponent("svg-icon"),h=e.resolveComponent("ssMenu");return e.openBlock(),e.createBlock(h,{mode:M.mode,menuList:M.renderMenuList,onClickMenu:M.clickMenu,onOpenMenu:M.openMenu,onCloseMenu:M.closeMenu},{title:e.withCtx(({menu:y})=>[e.createVNode(C,{name:y.icon??"Fold",class:"menu-icon"},null,8,["name"]),e.createElementVNode("span",null,e.toDisplayString(y.title??""),1)]),_:1},8,["mode","menuList","onClickMenu","onOpenMenu","onCloseMenu"])}const ss=yt._export_sfc(ue._sfc_main,[["render",os],["__scopeId","data-v-e003bdbb"]]),ye=[{key:"FitCurve_Eleven",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35326658522693",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35326658522693",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35326658522693/outputResources"},{key:"MakeShape",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35018179530309",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35018179530309",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35018179530309/outputResources"},{key:"FillEmpty",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35018289382469",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35018289382469",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35018289382469/outputResources"},{key:"ToolPathFakeFast",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35484063607109",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35484063607109",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35484063607109/outputResources"},{key:"FiveAxisCalculator",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35237389477957",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35237389477957",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35237389477957/outputResources"},{key:"DetectionAlgorithm",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35459977498949",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35459977498949",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35459977498949/outputResources"},{key:"FeatureSelectionAlgorithm_FFS",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35277984187973",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35277984187973",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35277984187973/outputResources"},{key:"AIParameterOptimization",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35788169784389",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35788169784389"}],is={class:"structure-buttons"},as={class:"structure-paths"},rs={class:"client-header-user"},ls={class:"select-icon"},cs={class:"model-select"},ds={class:"model-show"},us={class:"model-fill"},hs={class:"client-header-logo"},ps={class:"client-header-menu"},fs={class:"client-header-user"},ms={style:{display:"flex"}},gs={class:"select-icon"},ys={class:"client-main-content"},bs={key:0,class:"item-view-group"},ws={key:0,class:"calculator"},_s={class:"router-aside"},ks=e.defineComponent({__name:"client",props:{windowConfig:{type:Object,default:()=>{}}},setup(M){const o=r.useUnit(Xe.pinia),l=e.ref(0),d=e.ref(!1),{selectTitle:u}=he.storeToRefs(o),c=e.ref(!1),C=e.ref(!1),h=e.ref(!1),y=r.useTableComp(Xe.pinia),{tableShowThree:m}=he.storeToRefs(y),L=dn.useLoginState(),{loginUserInfo:R}=he.storeToRefs(L),O=r.useModelComp(Xe.pinia),{isEdit:E}=he.storeToRefs(O),P=he.useMenuState(Xe.pinia),N=zn.useFormComp(Xe.pinia),{objUrl:b,blobUrls:x}=he.storeToRefs(N),_=e.ref(null),G=e.ref(!0),{importLoading:A,activeMenuPath:w,platName:g}=he.storeToRefs(P),j=e.ref(!1);e.watch(()=>w.value,async V=>{V&&(j.value=!0)},{immediate:!0});const S=async V=>{var oe,U,z,T,I,W,J;const $=(oe=V==null?void 0:V.split("/"))==null?void 0:oe[0],Q=await he.getInsofDataApi({key:{type:"mainEquip",systemKey:sessionStorage.getItem("systemKey"),pageKey:$}});return((U=Q==null?void 0:Q.data)==null?void 0:U.type)==="success"?((J=(W=(I=(T=(z=Q==null?void 0:Q.data)==null?void 0:z.result)==null?void 0:T[0])==null?void 0:I.value)==null?void 0:W.tableData)==null?void 0:J.隐藏三维显示)!==!0:!0};e.watch(()=>ue.showItems.value,()=>{var V,$,Q,oe,U;if(((V=ue.showItems.value)==null?void 0:V.length)===2&&(($=ue.showItems.value)!=null&&$.find(z=>(z==null?void 0:z.name)==="输入"))&&((Q=ue.showItems.value)!=null&&Q.find(z=>(z==null?void 0:z.name)==="输出"))){const z=(oe=ue.showItems.value)==null?void 0:oe.find(T=>(T==null?void 0:T.name)==="输出");C.value=((U=z==null?void 0:z.comp)==null?void 0:U.toUpperCase())==="FORM",c.value=!0}else c.value=!1,C.value=!1},{deep:!0,immediate:!0}),e.watch(()=>w.value,async()=>{w.value&&(G.value=await S(w.value))},{deep:!0,immediate:!0}),e.watch(()=>[b.value,_.value],()=>{var V;((V=b.value)==null?void 0:V.length)>0&&_.value&&_.value.addModelsFromUrls(b.value)},{immediate:!0,deep:!0}),e.watch(()=>x==null?void 0:x.value,async()=>{var V,$,Q,oe;if(x!=null&&x.value&&((V=x==null?void 0:x.value)==null?void 0:V.length)>0&&!(($=ue.showItems.value)!=null&&$.find(U=>(U==null?void 0:U.name)==="输入")&&((Q=ue.showItems.value)!=null&&Q.find(U=>(U==null?void 0:U.name)==="输出")))){let U=[];const z=await((oe=pt.cloneDeep(x==null?void 0:x.value))==null?void 0:oe.map(async T=>{var Me,je,Ye,Ee,de,Ue,ze,Ke,et,tt;let I,W;const J=(je=(Me=T==null?void 0:T.blob)==null?void 0:Me.split("undefined,"))==null?void 0:je[1];let ge=J==null?void 0:J.split(",");if((ge==null?void 0:ge.length)>1){let qe=await(ge==null?void 0:ge.map(async Te=>{var _e,ft,We,Be,fe,Ge;I=await he.axios.get(Te,{responseType:"blob",headers:{"Content-Type":"application/json"}});let Se=[];if(((_e=T==null?void 0:T.mtlBlobs)==null?void 0:_e.length)>0){let rt=await((ft=T==null?void 0:T.mtlBlobs)==null?void 0:ft.map(async Ne=>{let nt=await he.axios.get(Ne,{responseType:"blob",headers:{"Content-Type":"application/json"}});return Se.push(new Blob([nt.data],{type:"application/octet-stream;charset=UTF-8"})),nt}));await Promise.all(rt)}return((Be=Te==null?void 0:Te.split("."))==null?void 0:Be[((We=Te==null?void 0:Te.split("."))==null?void 0:We.length)-1])!=="undefined"&&U.push({suffix:"."+((Ge=Te==null?void 0:Te.split("."))==null?void 0:Ge[((fe=Te==null?void 0:Te.split("."))==null?void 0:fe.length)-1]),blob:new Blob([I.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:Se}),I}));await Promise.all(qe)}else if(!(J!=null&&J.includes("https://"))&&!(J!=null&&J.includes("http://"))){I=await jt.downloadAvatarApi({url:J});let qe=[];if(((Ye=T==null?void 0:T.mtlBlobs)==null?void 0:Ye.length)>0){let Te=await((Ee=T==null?void 0:T.mtlBlobs)==null?void 0:Ee.map(async Se=>{let _e=await jt.downloadAvatarApi({url:Se});return qe.push(new Blob([_e.data],{type:"application/octet-stream;charset=UTF-8"})),_e}));await Promise.all(Te)}W={suffix:"."+((Ue=J==null?void 0:J.split("."))==null?void 0:Ue[((de=J==null?void 0:J.split("."))==null?void 0:de.length)-1]),blob:new Blob([I.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:qe}}else{I=await he.axios.get(J,{responseType:"blob",headers:{"Content-Type":"application/json"}});let qe=[];if(((ze=T==null?void 0:T.mtlBlobs)==null?void 0:ze.length)>0){let Te=await((Ke=T==null?void 0:T.mtlBlobs)==null?void 0:Ke.map(async Se=>{let _e=await he.axios.get(Se,{responseType:"blob",headers:{"Content-Type":"application/json"}});return qe.push(new Blob([_e.data],{type:"application/octet-stream;charset=UTF-8"})),_e}));await Promise.all(Te)}W={suffix:"."+((tt=J==null?void 0:J.split("."))==null?void 0:tt[((et=J==null?void 0:J.split("."))==null?void 0:et.length)-1]),blob:new Blob([I.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:qe}}W&&U.push(W)}));await Promise.all(z),_.value.loadModelByDefaultPath(U)}},{immediate:!0,deep:!0}),e.watch(()=>m.value,async()=>{var $,Q,oe,U;if(m.value!==""&&m.value){let z=($=w.value)==null?void 0:$.split("/"),T=z[(z==null?void 0:z.length)-2];const W=(((Q=ye==null?void 0:ye.find(je=>(je==null?void 0:je.key)===T))==null?void 0:Q.download)??"")+"/"+m.value,J=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),ge=await he.axios.post(W,null,{responseType:"blob",headers:{Authorization:J,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var V=new Blob([ge.data],{type:"application/octet-stream;charset=UTF-8"});const Me=[{suffix:"."+((U=(oe=m.value)==null?void 0:oe.split("."))==null?void 0:U[1]),blob:V,mtlBlobs:[]}];_.value.loadModelByDefaultPath(Me)}},{deep:!0,immediate:!0});const v=async()=>{var I,W,J,ge,Me,je,Ye,Ee,de,Ue,ze,Ke,et,tt,qe,Te,Se;d.value=!0;let V=(I=w.value)==null?void 0:I.split("/"),$=V[(V==null?void 0:V.length)-2];const Q=((W=ye==null?void 0:ye.find(_e=>(_e==null?void 0:_e.key)===$))==null?void 0:W.value)??"";let oe="";const U=await he.axios.post("http://139.196.154.85:20024/api/sysAuth/login",{account:"superadmin",password:"9bf00809059adc7f57bd290bf73ddf4d16f4c83b5937e2d68144ab0bd60d045d22d70afeed8f2fa071cda536e1fac0daf12b8e63dd870c3ca8b308f23be6e693bb32ebd3d013116dc8338d6854b1332701a522a7c43706a6db4162fbe991c8c08aa842fbbc34",codeId:0,code:""});((J=U==null?void 0:U.data)==null?void 0:J.code)===200&&(oe=`Bearer ${(Me=(ge=U.data)==null?void 0:ge.result)==null?void 0:Me.accessToken}`,sessionStorage.setItem("magicToken",oe));const z=oe===""?"123456":oe,T=await he.axios.post(Q,null,{headers:{Authorization:z,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if(((je=T==null?void 0:T.data)==null?void 0:je.type)==="success"&&r.IsJson((Ee=(Ye=T==null?void 0:T.data)==null?void 0:Ye.result)==null?void 0:Ee.result)){const _e=(et=(Ke=(ze=JSON.parse((Ue=(de=T==null?void 0:T.data)==null?void 0:de.result)==null?void 0:Ue.result))==null?void 0:ze.lines_file_paths)==null?void 0:Ke[0])==null?void 0:et.split("\\"),We=(((tt=ye==null?void 0:ye.find(fe=>(fe==null?void 0:fe.key)===$))==null?void 0:tt.resources)??"")+"/"+(((_e==null?void 0:_e[(_e==null?void 0:_e.length)-2])==="inputResources"?"outputResources":_e==null?void 0:_e[(_e==null?void 0:_e.length)-2])??"outputResources"),Be=await he.axios.post(We,null,{headers:{Authorization:z,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if(((qe=Be==null?void 0:Be.data)==null?void 0:qe.type)==="success"){const fe=(Te=Be==null?void 0:Be.data)==null?void 0:Te.result,Ge=ue.showItems.value,rt=await((Se=pt.cloneDeep(Ge))==null?void 0:Se.map(async Ne=>{var nt,mt,lt,Ve,ke,Qe;if((Ne==null?void 0:Ne.name)==="输出"){if((Ne==null?void 0:Ne.comp)==="Table")Ne.compData=(nt=Ne==null?void 0:Ne.compData)==null?void 0:nt.map(pe=>{var Ce,Oe;return(pe==null?void 0:pe.key)==="tableContents"&&(pe.contents=(Oe=(Ce=pe==null?void 0:pe.contents)==null?void 0:Ce.map(Ae=>(Ae=Ae==null?void 0:Ae.map((me,Re)=>{var Le,st,ct;return typeof me=="string"&&Re>1?((Le=pe==null?void 0:pe.contents)==null?void 0:Le.length)>1?me=((st=fe==null?void 0:fe[Re-1])!=null&&st.includes("input")?me:fe==null?void 0:fe[Re-1])??me:me=fe==null?void 0:fe[0]:me=((ct=fe==null?void 0:fe[Re-1])!=null&&ct.includes("input")?me:fe==null?void 0:fe[Re-1])??me,me}),Ae)))==null?void 0:Oe.filter((Ae,me)=>me<=(fe==null?void 0:fe.length)-1)),pe});else if((Ne==null?void 0:Ne.comp)==="Form"){let pe="";if(fe==null||fe.forEach(Ce=>{pe=pe===""?pe+Ce:pe+","+Ce}),Ne.compData=(mt=Ne==null?void 0:Ne.compData)==null?void 0:mt.map(Ce=>{var Oe;return(Ce==null?void 0:Ce.key)==="formContent"&&(Ce.contents=(Oe=Ce.contents)==null?void 0:Oe.map(Ae=>(Ae.value=pe,Ae))),Ce}),(lt=pe==null?void 0:pe.split(","))!=null&&lt.find(Ce=>Ce.includes(".obj"))){let Ce={};Ce.suffix=".obj";const Oe=[];let Ae=await((ke=(Ve=pe==null?void 0:pe.split(","))==null?void 0:Ve.filter(me=>me.includes(".obj")||me.includes(".mtl")))==null?void 0:ke.map(async me=>{var Le,st;if(me.includes(".obj")){const dt=(((Le=ye==null?void 0:ye.find(ot=>(ot==null?void 0:ot.key)===$))==null?void 0:Le.download)??"")+"/"+me,ut=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),Ie=await he.axios.post(dt,null,{responseType:"blob",headers:{Authorization:ut,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var Re=new Blob([Ie.data],{type:"application/octet-stream;charset=UTF-8"});Ce.blob=Re}else if(me.includes(".mtl")){const dt=(((st=ye==null?void 0:ye.find(Ct=>(Ct==null?void 0:Ct.key)===$))==null?void 0:st.download)??"")+"/"+me,ut=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),Ie=await he.axios.post(dt,null,{responseType:"blob",headers:{Authorization:ut,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var Re=new Blob([Ie.data],{type:"application/octet-stream;charset=UTF-8"});Oe.push(Re)}}));await Promise.all(Ae),Ce.mtlBlobs=Oe,_.value.loadModelByDefaultPath([Ce])}else{const Ce=[];let Oe=await((Qe=pe==null?void 0:pe.split(","))==null?void 0:Qe.map(async Ae=>{var ut,Ie;let me={};me.suffix="."+((ut=Ae==null?void 0:Ae.split("."))==null?void 0:ut[1]);const Le=(((Ie=ye==null?void 0:ye.find(ot=>(ot==null?void 0:ot.key)===$))==null?void 0:Ie.download)??"")+"/"+Ae,st=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),ct=await he.axios.post(Le,null,{responseType:"blob",headers:{Authorization:st,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var dt=new Blob([ct.data],{type:"application/octet-stream;charset=UTF-8"});me.blob=dt,Ce.push(me)}));await Promise.all(Oe),_.value.loadModelByDefaultPath(Ce)}}}return Ne}));ue.showItems.value=await Promise.all(rt)}}l.value++,d.value=!1},Y=e.ref(""),F=e.ref("open"),q=e.ref("open"),ie=e.ref(!1),ce=()=>{const V=document.getElementById("menuCollapse");F.value==="open"?(V.style.width="18.75rem",V.style.height="96%",V.style.overflow="auto"):(V.style.width="50px",V.style.height="50px",V.style.overflow="hidden")},D=()=>{const V=document.getElementById("operateCollapse");q.value==="open"?(V.style.width="25rem",V.style.height="96%",V.style.overflow="auto"):(V.style.width="50px",V.style.height="50px",V.style.overflow="hidden")},p=()=>{ie.value=!ie.value;const V=document.getElementById("operateCollapse"),$=document.getElementById("menuCollapse");ie.value?($.style.width="18.75rem",V.style.width="calc(100% - 24rem)"):V.style.width="400px"},X=V=>{const $=URL.createObjectURL(V),Q=document.createElement("a");Q.href=$,Q.download="file.txt",document.body.appendChild(Q),Q.click(),document.body.removeChild(Q),URL.revokeObjectURL($),h.value=!1},re=async()=>{var I,W,J,ge,Me,je,Ye,Ee,de,Ue,ze,Ke,et,tt,qe,Te;h.value=!0;let V=(I=w.value)==null?void 0:I.split("/"),$=V[(V==null?void 0:V.length)-2];const Q=((W=ye==null?void 0:ye.find(Se=>(Se==null?void 0:Se.key)===$))==null?void 0:W.value)??"";let oe="";const U=await he.axios.post("http://139.196.154.85:20024/api/sysAuth/login",{account:"superadmin",password:"9bf00809059adc7f57bd290bf73ddf4d16f4c83b5937e2d68144ab0bd60d045d22d70afeed8f2fa071cda536e1fac0daf12b8e63dd870c3ca8b308f23be6e693bb32ebd3d013116dc8338d6854b1332701a522a7c43706a6db4162fbe991c8c08aa842fbbc34",codeId:0,code:""});if(((J=U==null?void 0:U.data)==null?void 0:J.code)===200)oe=`Bearer ${(Me=(ge=U.data)==null?void 0:ge.result)==null?void 0:Me.accessToken}`,sessionStorage.setItem("magicToken",oe);else throw he.ElMessage.error("响应出错了"),new Error("响应出错了");const z=oe===""?"123456":oe,T=await he.axios.post(Q,null,{headers:{Authorization:z,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if(((je=T==null?void 0:T.data)==null?void 0:je.code)===200){if(r.IsJson((Ee=(Ye=T==null?void 0:T.data)==null?void 0:Ye.result)==null?void 0:Ee.result)){const Se=(et=(Ke=(ze=JSON.parse((Ue=(de=T==null?void 0:T.data)==null?void 0:de.result)==null?void 0:Ue.result))==null?void 0:ze.lines_file_paths)==null?void 0:Ke[0])==null?void 0:et.split("\\"),ft=(((tt=ye==null?void 0:ye.find(Be=>(Be==null?void 0:Be.key)===$))==null?void 0:tt.resources)??"")+"/"+((Se==null?void 0:Se[(Se==null?void 0:Se.length)-2])??"outputResources"),We=await he.axios.post(ft,null,{headers:{Authorization:z,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if(((qe=We==null?void 0:We.data)==null?void 0:qe.code)===200){const Be=(Te=We==null?void 0:We.data)==null?void 0:Te.result,fe=pt.cloneDeep(ue.showItems.value);fe==null||fe.map(async Ge=>{var rt,Ne,nt,mt,lt;if((Ge==null?void 0:Ge.name)==="输出"&&(Ge==null?void 0:Ge.comp)==="Form"){let Ve="";Be==null||Be.forEach(ke=>{Ve=Ve===""?Ve+ke:Ve+","+ke}),Ge.compData=(rt=Ge==null?void 0:Ge.compData)==null?void 0:rt.map(ke=>{var Qe;return(ke==null?void 0:ke.key)==="formContent"&&(ke.contents=(Qe=ke.contents)==null?void 0:Qe.map(pe=>(pe.value=Ve,pe))),ke}),console.log(221,Ve),(Ne=Ve==null?void 0:Ve.split(","))!=null&&Ne.find(ke=>ke.includes(".obj"))?(mt=(nt=Ve==null?void 0:Ve.split(","))==null?void 0:nt.filter(ke=>ke.includes(".obj")||ke.includes(".mtl")))==null||mt.map(async ke=>{var Qe,pe;if(ke.includes(".obj")){const Oe=(((Qe=ye==null?void 0:ye.find(Le=>(Le==null?void 0:Le.key)===$))==null?void 0:Qe.download)??"")+"/"+ke,Ae=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),me=await he.axios.post(Oe,null,{responseType:"blob",headers:{Authorization:Ae,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});let Re=new Blob([me.data],{type:"application/octet-stream;charset=UTF-8"});X(Re)}else if(ke.includes(".mtl")){const Oe=(((pe=ye==null?void 0:ye.find(Le=>(Le==null?void 0:Le.key)===$))==null?void 0:pe.download)??"")+"/"+ke,Ae=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),me=await he.axios.post(Oe,null,{responseType:"blob",headers:{Authorization:Ae,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});let Re=new Blob([me.data],{type:"application/octet-stream;charset=UTF-8"});X(Re)}}):(lt=Ve==null?void 0:Ve.split(","))==null||lt.map(async ke=>{var me,Re;""+((me=ke==null?void 0:ke.split("."))==null?void 0:me[1]);const pe=(((Re=ye==null?void 0:ye.find(Le=>(Le==null?void 0:Le.key)===$))==null?void 0:Re.download)??"")+"/"+ke,Ce=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),Oe=await he.axios.post(pe,null,{responseType:"blob",headers:{Authorization:Ce,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});let Ae=new Blob([Oe.data],{type:"application/octet-stream;charset=UTF-8"});X(Ae)})}})}else throw he.ElMessage.error("响应出错了"),new Error("响应出错了")}}else throw he.ElMessage.error("响应出错了"),new Error("响应出错了")};return(V,$)=>{const Q=e.resolveComponent("el-button"),oe=e.resolveComponent("el-avatar"),U=e.resolveComponent("el-header"),z=e.resolveComponent("el-container"),T=e.resolveComponent("el-icon"),I=e.resolveComponent("el-input"),W=e.resolveComponent("el-aside"),J=e.resolveComponent("el-collapse-item"),ge=e.resolveComponent("el-collapse"),Me=e.resolveComponent("el-main"),je=e.resolveComponent("router-view"),Ye=e.resolveDirective("loading");return e.unref(E)==="edit"?(e.openBlock(),e.createBlock(z,{key:0,class:"client-container"},{default:e.withCtx(()=>[e.createVNode(U,{class:"client-structure-header"},{default:e.withCtx(()=>{var Ee;return[e.createElementVNode("div",is,[e.createVNode(Q,{class:"select-icon",onClick:e.unref(ue.onBack)},{default:e.withCtx(()=>$[6]||($[6]=[e.createTextVNode(" 返回页面 ")])),_:1,__:[6]},8,["onClick"]),e.createVNode(Q,{class:"select-icon",onClick:$[0]||($[0]=de=>{var Ue,ze;return e.unref(ue.clickSavePage)((ze=(Ue=e.unref(u))==null?void 0:Ue.map(Ke=>Ke.value))==null?void 0:ze.join("/"))})},{icon:e.withCtx(()=>[e.createVNode(ht.SvgIcon,{name:"Store"})]),default:e.withCtx(()=>[$[7]||($[7]=e.createTextVNode(" 保存页面 "))]),_:1,__:[7]})]),e.createElementVNode("div",as,[(e.openBlock(),e.createBlock(pn,{key:e.unref(u),breadArray:e.unref(u),onClick:e.unref(ue.onClick)},null,8,["breadArray","onClick"]))]),e.createElementVNode("div",rs,[e.createElementVNode("div",ls,[e.renderSlot(V.$slots,"default",{},void 0,!0)]),e.createVNode(oe,{size:35,src:(Ee=e.unref(R))==null?void 0:Ee.avatarUrl},{default:e.withCtx(()=>{var de;return[e.createTextVNode(e.toDisplayString(((de=e.unref(R))==null?void 0:de.account)??"未知"),1)]}),_:1},8,["src"])])]}),_:3}),e.unref(E)==="edit"?(e.openBlock(),e.createBlock(z,{key:0,class:"model-operate",style:{"margin-top":"10px",height:"0px"}},{default:e.withCtx(()=>[e.createElementVNode("div",cs,[e.createVNode(at.modelSelect)]),e.createElementVNode("div",ds,[e.createVNode(at.modelShow)]),e.createElementVNode("div",us,[e.createVNode(at.modelFill)])]),_:1})):e.createCommentVNode("",!0)]),_:3})):e.withDirectives((e.openBlock(),e.createBlock(z,{key:1,class:"client-container","element-loading-text":"正在加载页面数据..."},{default:e.withCtx(()=>[e.createVNode(U,{class:"client-header"},{default:e.withCtx(()=>{var Ee;return[e.createElementVNode("div",hs,[e.createVNode(ht.SvgIcon,{name:"logo",style:{width:"clamp(18px, 1.5rem, 24px)",height:"clamp(18px, 1.5rem, 24px)","margin-right":"8px"}}),e.createTextVNode(" "+e.toDisplayString(e.unref(g)===""?"CPMPIP":e.unref(g)),1)]),e.createElementVNode("div",ps,[e.createVNode(ss,{mode:"horizontal"})]),e.createElementVNode("div",fs,[e.createVNode(I,{modelValue:Y.value,"onUpdate:modelValue":$[1]||($[1]=de=>Y.value=de),clearable:"",placeholder:"搜索",style:{width:"130px"}},{prefix:e.withCtx(()=>[e.createVNode(T,{class:"el-input__icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(un.search_default))]),_:1})]),_:1},8,["modelValue"]),e.unref(E)==="view"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"select-icon",onClick:$[2]||($[2]=(...de)=>e.unref(ue.onSelectFixContent)&&e.unref(ue.onSelectFixContent)(...de))},[e.createElementVNode("div",ms,[e.createVNode(ht.SvgIcon,{name:"write",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}})]),$[8]||($[8]=e.createElementVNode("div",{class:"layout-trigger"},e.toDisplayString("修改布局"),-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",gs,[e.renderSlot(V.$slots,"default",{},void 0,!0)]),e.createVNode(oe,{size:35,src:(Ee=e.unref(R))==null?void 0:Ee.avatarUrl},{default:e.withCtx(()=>{var de;return[e.createTextVNode(e.toDisplayString(((de=e.unref(R))==null?void 0:de.account)??"未知"),1)]}),_:1},8,["src"])])]}),_:3}),e.createVNode(z,{class:"client-body"},{default:e.withCtx(()=>[V.$route.path==="/"?(e.openBlock(),e.createBlock(Me,{key:0,class:"client-main"},{default:e.withCtx(()=>[e.createVNode(ge,{modelValue:F.value,"onUpdate:modelValue":$[3]||($[3]=Ee=>F.value=Ee),accordion:"",class:"client-aside",id:"menuCollapse",onChange:ce},{default:e.withCtx(()=>[e.createVNode(J,{name:"open"},{icon:e.withCtx(()=>[e.createVNode(ht.SvgIcon,{name:F.value===""?"Right":"Left",style:{width:"20px",height:"20px"}},null,8,["name"])]),default:e.withCtx(()=>[e.createVNode(W,{style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(Ft.default,{mode:"vertical"})]),_:1})]),_:1})]),_:1},8,["modelValue"]),e.createElementVNode("div",ys,[e.createVNode(Ro,{isShow:j.value,windowConfig:M.windowConfig,ref_key:"threeModelRef",ref:_},null,8,["isShow","windowConfig"])]),e.createVNode(ge,{modelValue:q.value,"onUpdate:modelValue":$[5]||($[5]=Ee=>q.value=Ee),accordion:"",class:"client-main-operate",id:"operateCollapse",onChange:D},{default:e.withCtx(()=>[e.createVNode(J,{name:"open"},{icon:e.withCtx(()=>[e.createVNode(ht.SvgIcon,{name:q.value==="open"?"Right":"Left",style:{width:"20px",height:"20px"}},null,8,["name"])]),default:e.withCtx(()=>{var Ee;return[e.createElementVNode("div",null,[e.createVNode(ht.SvgIcon,{class:"fold-icon",name:ie.value?"Right":"Left",onClick:p},null,8,["name"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((Ee=e.unref(pt.cloneDeep)(e.unref(ue.showItems)))==null?void 0:Ee.filter(de=>de.comp!=="FormTop"),(de,Ue)=>{var ze;return e.openBlock(),e.createElementBlock("div",{class:"item-view-content",key:Ue},[((ze=de==null?void 0:de.comp)==null?void 0:ze.toUpperCase())!=="TABLE"?(e.openBlock(),e.createElementBlock("div",bs,e.toDisplayString(de.name),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(ue.getComponents)(de.comp)),{compName:de.name,itemData:de==null?void 0:de.compData,childItemData:de==null?void 0:de.itemChildData,key:(de==null?void 0:de.id)??Ue,onChange:e.unref(ue.onChange),index:(de==null?void 0:de.id)??Ue,onContentChange:e.unref(ue.onContentChange),onPageChange:e.unref(ue.onPageChange)},null,40,["compName","itemData","childItemData","onChange","index","onContentChange","onPageChange"]))])}),128)),c.value?(e.openBlock(),e.createElementBlock("div",ws,[C.value?(e.openBlock(),e.createBlock(Qt._sfc_main,{key:0,class:"calculator-content",onClickTrigger:re,loading:h.value,modelValue:"预览"},null,8,["loading"])):e.createCommentVNode("",!0),e.createVNode(Qt._sfc_main,{class:"calculator-content",onClickTrigger:$[4]||($[4]=de=>v()),loading:d.value,modelValue:"调用方法"},null,8,["loading"])])):e.createCommentVNode("",!0)])]}),_:1})]),_:1},8,["modelValue"])]),_:1})):(e.openBlock(),e.createBlock(Me,{key:1,class:"client-router"},{default:e.withCtx(()=>[e.createElementVNode("div",_s,[e.createVNode(W,{width:"300px"},{default:e.withCtx(()=>[e.createVNode(Ft.default,{mode:"vertical"})]),_:1})]),e.createVNode(Me,{class:"router-main"},{default:e.withCtx(()=>[e.createVNode(je)]),_:1})]),_:1}))]),_:1})]),_:3})),[[Ye,e.unref(A)]])}}}),Cs=yt._export_sfc(ks,[["__scopeId","data-v-dc9969fa"]]),vs={class:"system-wrap"},xs={__name:"index",props:{windowConfig:{type:Object,default:()=>{}},platform:{type:String,default:"browser"},content:String,jsonContents:Array},setup(M){const o=r.useModelComp(Xe.pinia),l=r.useUnit(Xe.pinia),d=he.useMenuState();e.ref(!1);const u=e.ref(!0),c=M,C=e.computed(()=>(c==null?void 0:c.platform)==="browser"?[{name:"--ssbutton-theme-color",value:"#fff"},{name:"--ssbutton-theme-bg",value:"var(--ssComponent-primary-color)"}]:[{name:"--ssbutton-theme-color",value:"#323333"},{name:"--ssbutton-theme-bg",value:"#72B02D"}]),h=y=>{const m=document.documentElement;y==null||y.forEach(L=>{m.style.setProperty(L.name,L.value)})};return e.watch(()=>c.platform,(y,m)=>{y&&h(C.value)},{immediate:!0}),e.watch(()=>[c==null?void 0:c.content,c==null?void 0:c.jsonContents],async()=>{var L,R,O,E;if(((L=c==null?void 0:c.jsonContents)==null?void 0:L.length)>0){o.setOriginalData(c==null?void 0:c.jsonContents);return}if(!(c!=null&&c.content)||((R=c==null?void 0:c.content)==null?void 0:R.length)===0)return;u.value=!0,d.setImportLoading(!0);let y=[],m=[];l.setSelectTitle([]),l.setSelectIndex(""),l.setSelectMenu(""),(E=(O=c==null?void 0:c.content)==null?void 0:O.filter(P=>P!==""))==null||E.forEach(P=>{gt.isExpandStringToJson(P)?m.push(gt.expandStringToJson(P)):gt.expandNewStringToJson(P)?m.push(gt.expandNewStringToJson(P)):gt.expandContentStringToJson(P)?m.push(gt.expandContentStringToJson(P)):m.push(ue.expandToNewContents(P))}),y=m==null?void 0:m[0],await ue.savePageDataAsync(y),await r.loadingSystemType(),o.setOriginalData(y),d.setImportLoading(!1)},{deep:!0,immediate:!0}),(y,m)=>(e.openBlock(),e.createElementBlock("div",vs,[M.platform==="browser"?(e.openBlock(),e.createBlock(ns,{key:0},{default:e.withCtx(()=>[e.renderSlot(y.$slots,"default",{},void 0,!0)]),_:3})):(e.openBlock(),e.createBlock(Cs,{key:1,windowConfig:M.windowConfig},{default:e.withCtx(()=>[e.renderSlot(y.$slots,"default",{},void 0,!0)]),_:3},8,["windowConfig"]))]))}},Es=yt._export_sfc(xs,[["__scopeId","data-v-136f5a47"]]),Ts={class:"add-model-content"},Ns={key:0,class:"model-operate"},As={class:"model-select"},Ms={class:"model-fill"},Ss={key:1,class:"model-view"},Ps={key:0,class:"model-import-data"},Ls={__name:"index",props:{mode:{type:String,default:"view"},content:{type:String,default:""},jsonContents:{type:Array,default:()=>[]},showButton:{type:Boolean,default:!0}},emits:["change","contentChange"],setup(M,{emit:o}){const l=M,d=o,u=e.ref([]),c=e.ref([]),C=e.ref([]),h=e.ref(0),y=r.useModelComp(Xe.pinia),m=he.useMenuState(Xe.pinia),{itemData:L,originalData:R}=he.storeToRefs(y),{activeMenuPath:O,platform:E}=he.storeToRefs(m),P=e.ref(null),N=e.ref(0),b=e.ref([]);e.ref("");const x=e.ref(0),_=g=>{d("contentChange",g)},G=g=>{var S;const j=(S=pt.cloneDeep(g==null?void 0:g.wholeValue))==null?void 0:S.map(v=>{var Y;return(v==null?void 0:v.comp)==="Form"&&(v.compData=(Y=v.compData)==null?void 0:Y.map(F=>((F==null?void 0:F.key)==="formContent"&&(F.contents=gt.arrayToNumberArray(F==null?void 0:F.contents)),F))),v});d("change",{originalContents:R.value,currentContents:g==null?void 0:g.wholeValue,editContent:g==null?void 0:g.editValue,arrayToContents:j})};e.watch(()=>c.value,()=>{x.value===c.value.length&&c.value.length!==0&&(u.value=c.value)},{deep:!0,immediate:!0});const A=()=>{P.value.click()},w=async g=>{const j=g.target.files;if(!j)return;new FileReader,u.value=[],c.value=[],x.value=j.length;const S=Array.from(j).map(async v=>await new Promise(Y=>{const F=new FileReader;F.onload=q=>{try{c.value.push(q.target.result),N.value++}catch(ie){console.error("解析失败:",ie);return}},F.onerror=()=>Y(`读取 ${v.name} 失败`),F.readAsText(v),g.target.value="",P.value=null}));await Promise.all(S)};return e.watch(()=>[l==null?void 0:l.content,l==null?void 0:l.jsonContents],async()=>{await r.loadingSystemType(),u.value=l.content,C.value=l==null?void 0:l.jsonContents},{deep:!0,immediate:!0}),e.watch(()=>N.value,()=>{var g;((g=b.value)==null?void 0:g.length)!==0&&(y.setOriginalData(b.value),y.setItemData(b.value))},{deep:!0,immediate:!0}),(g,j)=>{const S=e.resolveComponent("svg-icon");return e.openBlock(),e.createElementBlock("div",Ts,[(l==null?void 0:l.mode)==="edit"?(e.openBlock(),e.createElementBlock("div",Ns,[e.createElementVNode("div",As,[e.createVNode(at.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:h.value},[e.createVNode(at.modelShow)])),e.createElementVNode("div",Ms,[e.createVNode(at.modelFill)])])):e.createCommentVNode("",!0),(l==null?void 0:l.mode)==="view"?(e.openBlock(),e.createElementBlock("div",Ss,[(e.openBlock(),e.createBlock(Es,{platform:e.unref(E),content:u.value,onChange:G,jsonContents:C.value,onContentChange:_,key:h.value},{default:e.withCtx(()=>{var v;return[((v=l==null?void 0:l.jsonContents)==null?void 0:v.length)===0&&(l!=null&&l.showButton)?(e.openBlock(),e.createElementBlock("div",Ps,[e.createElementVNode("div",{class:"import-button",onClick:A},[e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:P,accept:".txt, .inm",onChange:w,style:{display:"none"},multiple:""},null,544),e.createVNode(S,{name:"import",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}}),j[0]||(j[0]=e.createElementVNode("div",{class:"import-trigger"},e.toDisplayString("导入模型"),-1))])])):e.createCommentVNode("",!0)]}),_:1},8,["platform","content","jsonContents"]))])):e.createCommentVNode("",!0)])}}},Vs=yt._export_sfc(Ls,[["__scopeId","data-v-63a4bd9d"]]);exports.default=Vs;