ss-component-new 1.1.290 → 1.1.310

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 (75) hide show
  1. package/dist/{array-D339uZXb.js → array-CFIAOkpU.js} +2 -2
  2. package/dist/{array-AtQFJ2vI.cjs → array-Dp3mG6qP.cjs} +1 -1
  3. package/dist/{cloneDeep-CQWIrbqu.js → cloneDeep-BC6hApUL.js} +1 -1
  4. package/dist/{cloneDeep-Cy5gcH4s.cjs → cloneDeep-Dqfzct8G.cjs} +1 -1
  5. package/dist/{index-3kKzSjZ0.cjs → index-563TMWMC.cjs} +1 -1
  6. package/dist/{index-B8ZxJexC.cjs → index-5W3FYly6.cjs} +1 -1
  7. package/dist/{index-C2MFTfzW.js → index-6DprAE2h.js} +6 -6
  8. package/dist/{index-DXwKNWWk.cjs → index-B0WB2KTa.cjs} +1 -1
  9. package/dist/{index-cShxcVK6.js → index-B1nJ-Z39.js} +3 -3
  10. package/dist/{index-DnMhJfWN.js → index-B2-tbMJV.js} +4 -4
  11. package/dist/{index-CKju-MUG.cjs → index-BPoaubFA.cjs} +1 -1
  12. package/dist/{index-Bn4_BTJF.cjs → index-BRebILsV.cjs} +1 -1
  13. package/dist/{index-CtaOQXvX.cjs → index-BTnKTcJy.cjs} +1 -1
  14. package/dist/{index-BeqtgUA4.cjs → index-BUzuQGku.cjs} +1 -1
  15. package/dist/{index-Cv_BJkoF.js → index-BiA96Te2.js} +4 -4
  16. package/dist/{index-Qu4zMvbx.cjs → index-BlnkYO02.cjs} +1 -1
  17. package/dist/{index-CMclZit7.js → index-BqyjHr9C.js} +4 -4
  18. package/dist/{index-D07AfqMk.js → index-BsoflaB1.js} +3 -3
  19. package/dist/{index-BHcmcUsH.cjs → index-C098N8un.cjs} +1 -1
  20. package/dist/{index-D2t0GHuc.js → index-C4Sp8WeM.js} +4 -4
  21. package/dist/{index-Dv507uaz.cjs → index-CG7LSylY.cjs} +1 -1
  22. package/dist/{index-BBlUzqj4.cjs → index-CKbCejX8.cjs} +1 -1
  23. package/dist/{index-B5ot2AKt.cjs → index-CMhrZyHq.cjs} +1 -1
  24. package/dist/{index-DawWVxkB.js → index-CND4bAN1.js} +6 -6
  25. package/dist/{index-IjvmSCm2.js → index-COWtJfBt.js} +5 -5
  26. package/dist/{index-BsbrUEYh.js → index-CSMb6JUa.js} +9 -9
  27. package/dist/{index-YooFxY8Y.cjs → index-Cb4nldBH.cjs} +1 -1
  28. package/dist/{index-D9po9WOs.js → index-Cd3MpYaF.js} +8 -8
  29. package/dist/{index-BeriQ3fM.js → index-CeIsvjm_.js} +8 -8
  30. package/dist/{index-C7NJ9nFX.cjs → index-Cehda098.cjs} +1 -1
  31. package/dist/{index-DxO-iCvu.js → index-CfUQUcR0.js} +1 -1
  32. package/dist/{index-CmYcmqtc.cjs → index-Ci-roF0f.cjs} +1 -1
  33. package/dist/{index-Bzym-5H_.cjs → index-CqoO4f6W.cjs} +1 -1
  34. package/dist/{index-BQZDQO_i.js → index-CxHjQMe7.js} +5 -5
  35. package/dist/{index-4RyZMkSe.js → index-Cykuj77e.js} +7 -7
  36. package/dist/{index-BQDIPZDa.js → index-D25w_LCd.js} +4 -4
  37. package/dist/{index-BEGBgo_B.js → index-D4-10GVB.js} +5 -5
  38. package/dist/{index-DNNd6eR_.cjs → index-DA3Sh1Tz.cjs} +1 -1
  39. package/dist/{index-gNi9T_lb.cjs → index-DCCRnjTu.cjs} +1 -1
  40. package/dist/{index-CrrFhzv_.js → index-DE3uvzqv.js} +1 -1
  41. package/dist/{index-Cp7F_B6D.js → index-DJUjFOtq.js} +3 -3
  42. package/dist/{index-D5yajhtO.cjs → index-DX-ZG8i5.cjs} +1 -1
  43. package/dist/{index-BmmcZ2Tp.js → index-DhNtgRPf.js} +1 -1
  44. package/dist/{index-qs5AhtIZ.js → index-Dj4GAvUp.js} +3 -3
  45. package/dist/{index-EPYWKP2l.js → index-DjAg2mhq.js} +3 -3
  46. package/dist/{index-CjMbwBqq.js → index-Dk4rHBYA.js} +1 -1
  47. package/dist/index-Dl7Iwabv.cjs +9 -0
  48. package/dist/{index-YGsZEZKX.cjs → index-DpgIfvxQ.cjs} +1 -1
  49. package/dist/{index-Cnf64BJ6.cjs → index-Dv0cT1Jj.cjs} +1 -1
  50. package/dist/{index-uDD9_wyq.cjs → index-DzHb-2qg.cjs} +1 -1
  51. package/dist/{index-CwDWgUj2.js → index-KxCRKhYW.js} +7 -7
  52. package/dist/{index-DSmuTNGj.cjs → index-Tu-PtE4a.cjs} +1 -1
  53. package/dist/{index-f7hoVZUM.js → index-epYwDqWZ.js} +5 -5
  54. package/dist/{index-Cne4xArW.cjs → index-i0BszWbX.cjs} +1 -1
  55. package/dist/{index-DYiya7rv.js → index-ts5b_rKm.js} +1215 -1216
  56. package/dist/{index-DjfrBuEe.cjs → index-ukJ-kt4p.cjs} +1 -1
  57. package/dist/{index.vue_vue_type_script_setup_true_lang-Z3XfdBed.cjs → index.vue_vue_type_script_setup_true_lang-C1lQOWLE.cjs} +1 -1
  58. package/dist/{index.vue_vue_type_script_setup_true_lang-BZmr7K21.js → index.vue_vue_type_script_setup_true_lang-CApK0j7g.js} +1 -1
  59. package/dist/{index.vue_vue_type_style_index_0_scoped_4bf164f6_lang-trTIwTQe.cjs → index.vue_vue_type_style_index_0_scoped_4bf164f6_lang-CmoZt9g1.cjs} +1 -1
  60. package/dist/{index.vue_vue_type_style_index_0_scoped_4bf164f6_lang-D31_EwO5.js → index.vue_vue_type_style_index_0_scoped_4bf164f6_lang-PEeio78T.js} +13 -13
  61. package/dist/{index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-CIggOAuR.js → index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-DOzj8ZRs.js} +8 -8
  62. package/dist/{index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-COaR4FnN.cjs → index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-r-NO8sGY.cjs} +1 -1
  63. package/dist/{login-CmjkXwNQ.cjs → login-BPkLsYkz.cjs} +1 -1
  64. package/dist/{login-DQiz4jLw.js → login-UhUPZuPH.js} +2 -2
  65. package/dist/{main-DjwccYLR.cjs → main-BTYMrU5V.cjs} +1 -1
  66. package/dist/{main-0Gji26N_.js → main-dSK-267_.js} +7 -7
  67. package/dist/{menu-djOhwwFt.cjs → menu-D1SsYDhc.cjs} +1 -1
  68. package/dist/{menu-CvBl29K2.js → menu-dd51TtC8.js} +1 -1
  69. package/dist/ss-component.cjs +1 -1
  70. package/dist/ss-component.css +1 -1
  71. package/dist/ss-component.js +7 -7
  72. package/dist/ss-component3.cjs +1 -1
  73. package/dist/ss-component3.js +1 -1
  74. package/package.json +1 -1
  75. package/dist/index-CS_8ym5J.cjs +0 -9
@@ -1,9 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Ke=require("./index-Dv507uaz.cjs"),Bt=require("./index-YooFxY8Y.cjs"),Ie=require("./index-DNNd6eR_.cjs"),r=require("./index-DXwKNWWk.cjs"),ye=require("./menu-djOhwwFt.cjs"),Un=require("./index-DjfrBuEe.cjs"),de=require("./index.vue_vue_type_style_index_0_scoped_4bf164f6_lang-trTIwTQe.cjs"),dt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),lt=require("./array-AtQFJ2vI.cjs"),rn=require("./login-CmjkXwNQ.cjs"),et=require("./index-BpPyaNFa.cjs"),ln=require("./index-Qu4zMvbx.cjs"),ct=require("./cloneDeep-Cy5gcH4s.cjs"),Rt=require("./index-BHcmcUsH.cjs"),zn=require("./index-YGsZEZKX.cjs"),Jt={type:"change"},Dt={type:"start"},cn={type:"end"},vt=new r.Ray,Xt=new r.Plane,Gn=Math.cos(70*r.MathUtils.DEG2RAD),Te=new r.Vector3,Ve=2*Math.PI,we={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Mt=1e-6;class qn extends r.Controls{constructor(o,l=null){super(o,l),this.state=we.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(Jt),this.update(),this.state=we.NONE}update(o=null){const l=this.object.position;Te.copy(l).sub(this.target),Te.applyQuaternion(this._quat),this._spherical.setFromVector3(Te),this.autoRotate&&this.state===we.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 c=this.minAzimuthAngle,u=this.maxAzimuthAngle;isFinite(c)&&isFinite(u)&&(c<-Math.PI?c+=Ve:c>Math.PI&&(c-=Ve),u<-Math.PI?u+=Ve:u>Math.PI&&(u-=Ve),c<=u?this._spherical.theta=Math.max(c,Math.min(u,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(c+u)/2?Math.max(c,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 d=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const _=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),d=_!=this._spherical.radius}if(Te.setFromSpherical(this._spherical),Te.applyQuaternion(this._quatInverse),l.copy(this.target).add(Te),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 _=null;if(this.object.isPerspectiveCamera){const p=Te.length();_=this._clampDistance(p*this._scale);const w=p-_;this.object.position.addScaledVector(this._dollyDirection,w),this.object.updateMatrixWorld(),d=!!w}else if(this.object.isOrthographicCamera){const p=new r.Vector3(this._mouse.x,this._mouse.y,0);p.unproject(this.object);const w=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),d=w!==this.object.zoom;const y=new r.Vector3(this._mouse.x,this._mouse.y,0);y.unproject(this.object),this.object.position.sub(y).add(p),this.object.updateMatrixWorld(),_=Te.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;_!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(_).add(this.object.position):(vt.origin.copy(this.object.position),vt.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(vt.direction))<Gn?this.object.lookAt(this.target):(Xt.setFromNormalAndCoplanarPoint(this.object.up,this.target),vt.intersectPlane(Xt,this.target))))}else if(this.object.isOrthographicCamera){const _=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),_!==this.object.zoom&&(this.object.updateProjectionMatrix(),d=!0)}return this._scale=1,this._performCursorZoom=!1,d||this._lastPosition.distanceToSquared(this.object.position)>Mt||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Mt||this._lastTargetPosition.distanceToSquared(this.target)>Mt?(this.dispatchEvent(Jt),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(o){return o!==null?Ve/60*this.autoRotateSpeed*o:Ve/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){Te.setFromMatrixColumn(l,0),Te.multiplyScalar(-o),this._panOffset.add(Te)}_panUp(o,l){this.screenSpacePanning===!0?Te.setFromMatrixColumn(l,1):(Te.setFromMatrixColumn(l,0),Te.crossVectors(this.object.up,Te)),Te.multiplyScalar(o),this._panOffset.add(Te)}_pan(o,l){const c=this.domElement;if(this.object.isPerspectiveCamera){const u=this.object.position;Te.copy(u).sub(this.target);let d=Te.length();d*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*o*d/c.clientHeight,this.object.matrix),this._panUp(2*l*d/c.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(o*(this.object.right-this.object.left)/this.object.zoom/c.clientWidth,this.object.matrix),this._panUp(l*(this.object.top-this.object.bottom)/this.object.zoom/c.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 c=this.domElement.getBoundingClientRect(),u=o-c.left,d=l-c.top,_=c.width,p=c.height;this._mouse.x=u/_*2-1,this._mouse.y=-(d/p)*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(Ve*this._rotateDelta.x/l.clientHeight),this._rotateUp(Ve*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(Ve*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(-Ve*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(Ve*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(-Ve*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),c=.5*(o.pageX+l.x),u=.5*(o.pageY+l.y);this._rotateStart.set(c,u)}}_handleTouchStartPan(o){if(this._pointers.length===1)this._panStart.set(o.pageX,o.pageY);else{const l=this._getSecondPointerPosition(o),c=.5*(o.pageX+l.x),u=.5*(o.pageY+l.y);this._panStart.set(c,u)}}_handleTouchStartDolly(o){const l=this._getSecondPointerPosition(o),c=o.pageX-l.x,u=o.pageY-l.y,d=Math.sqrt(c*c+u*u);this._dollyStart.set(0,d)}_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 c=this._getSecondPointerPosition(o),u=.5*(o.pageX+c.x),d=.5*(o.pageY+c.y);this._rotateEnd.set(u,d)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const l=this.domElement;this._rotateLeft(Ve*this._rotateDelta.x/l.clientHeight),this._rotateUp(Ve*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),c=.5*(o.pageX+l.x),u=.5*(o.pageY+l.y);this._panEnd.set(c,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),c=o.pageX-l.x,u=o.pageY-l.y,d=Math.sqrt(c*c+u*u);this._dollyEnd.set(0,d),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 _=(o.pageX+l.x)*.5,p=(o.pageY+l.y)*.5;this._updateZoomParameters(_,p)}_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,c={clientX:o.clientX,clientY:o.clientY,deltaY:o.deltaY};switch(l){case 1:c.deltaY*=16;break;case 2:c.deltaY*=100;break}return o.ctrlKey&&!this._controlActive&&(c.deltaY*=10),c}}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(cn),this.state=we.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=we.DOLLY;break;case r.MOUSE.ROTATE:if(M.ctrlKey||M.metaKey||M.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(M),this.state=we.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(M),this.state=we.ROTATE}break;case r.MOUSE.PAN:if(M.ctrlKey||M.metaKey||M.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(M),this.state=we.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(M),this.state=we.PAN}break;default:this.state=we.NONE}this.state!==we.NONE&&this.dispatchEvent(Dt)}function Wn(M){switch(this.state){case we.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(M);break;case we.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(M);break;case we.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(M);break}}function Zn(M){this.enabled===!1||this.enableZoom===!1||this.state!==we.NONE||(M.preventDefault(),this.dispatchEvent(Dt),this._handleMouseWheel(this._customWheelEvent(M)),this.dispatchEvent(cn))}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=we.TOUCH_ROTATE;break;case r.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(M),this.state=we.TOUCH_PAN;break;default:this.state=we.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=we.TOUCH_DOLLY_PAN;break;case r.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(M),this.state=we.TOUCH_DOLLY_ROTATE;break;default:this.state=we.NONE}break;default:this.state=we.NONE}this.state!==we.NONE&&this.dispatchEvent(Dt)}function Qn(M){switch(this._trackPointer(M),this.state){case we.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(M),this.update();break;case we.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(M),this.update();break;case we.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(M),this.update();break;case we.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(M),this.update();break;default:this.state=we.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,c=null,u=null,d=null,_=null;const p=e.ref([]),w=e.ref(new r.Vector3),y=e.ref(new r.Vector3),L=()=>{if(!M.value)return;o=new r.Scene,o.background=new r.Color(16777215);const E=M.value;l=new r.PerspectiveCamera(75,E.clientWidth/E.clientHeight,.1,1e4),c=new r.WebGLRenderer({antialias:!0,alpha:!0}),c.setSize(E.clientWidth,E.clientHeight),c.localClippingEnabled=!0,c.shadowMap.enabled=!0,c.shadowMap.type=r.PCFSoftShadowMap,c.toneMapping=r.ACESFilmicToneMapping,c.toneMappingExposure=1,c.outputColorSpace=r.SRGBColorSpace,E.appendChild(c.domElement),u=new qn(l,c.domElement),u.enableDamping=!0,u.dampingFactor=.05,d=new r.Xe(l,c,{container:E,type:"cube",placement:"bottom-left",offset:{left:350,bottom:22},background:{color:"#D1D1D1"}}),d.attachControls(u),R(),V()},R=()=>{const E=new r.AmbientLight(4210752,.6);o.add(E);const C=new r.DirectionalLight(16777215,2);C.position.set(10,10,8),C.castShadow=!0,C.shadow.mapSize.width=2048,C.shadow.mapSize.height=2048,C.shadow.camera.near=.5,C.shadow.camera.far=50,o.add(C);const g=new r.DirectionalLight(16777215,.8);g.position.set(-8,-8,6),o.add(g);const F=new r.DirectionalLight(16777215,.6);F.position.set(0,-15,2),o.add(F);const A=new r.HemisphereLight(16777215,4473924,.8);o.add(A);const x=new r.PointLight(16777215,1,50);x.position.set(15,15,15),o.add(x);const q=new r.PointLight(16777215,.5,50);q.position.set(-15,-15,15),o.add(q)},V=()=>{_=requestAnimationFrame(V),u&&u.update(),c&&o&&l&&c.render(o,l),d&&d.render()},T=E=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(g=>{E[g]&&E[g].dispose&&E[g].dispose()}),E.dispose&&E.dispose()},B=E=>{E.traverse(C=>{C.geometry&&C.geometry.dispose(),C.material&&(Array.isArray(C.material)?C.material.forEach(g=>{T(g)}):T(C.material))})};return{currentModels:p,initialCameraPosition:w,initialTargetPosition:y,initThreeJS:L,handleResize:()=>{if(!M.value||!l||!c||!d)return;const E=M.value,C=E.clientWidth,g=E.clientHeight;l.aspect=C/g,l.updateProjectionMatrix(),c.setSize(C,g),d.update()},fitCameraToAllModels:()=>{if(!l||!u||p.value.length===0)return;const E=new r.Box3;p.value.forEach(D=>{E.expandByObject(D)});const C=E.getSize(new r.Vector3),g=E.getCenter(new r.Vector3),A=Math.max(C.x,C.y,C.z)*.8,x=new r.Vector3(g.x+A,g.y+A,g.z+A),q=g.clone();l.position.copy(x),l.lookAt(q),u.target.copy(q),u.update(),w.value.copy(x),y.value.copy(q)},getThreeJSObjects:()=>({scene:o,camera:l,renderer:c,controls:u,gizmo:d}),clearAllModels:()=>{if(!o)return;p.value.forEach(C=>{o.remove(C),B(C)});const E=[];o.children.forEach(C=>{!C.isLight&&!C.isCamera&&E.push(C)}),E.forEach(C=>{o.remove(C),B(C)}),p.value=[]},cleanup:()=>{_&&cancelAnimationFrame(_),c&&c.dispose(),u&&u.dispose(),d&&d.dispose()}}}function so(M,o){const l=e.ref(!1);let c=null,u=12700,d=new r.Vector3,_=new r.Vector3,p=new r.Vector3,w=0,y=null;const L=m=>m<.5?4*m*m*m:1-Math.pow(-2*m+2,3)/2,R=m=>{const S=new r.Vector3,N=w*1.2,j=new r.Vector3(p.x+N,p.y,p.z),E=new r.Vector3(p.x,p.y+N,p.z),C=new r.Vector3(p.x,p.y-N,p.z);if(m<=.567){const F=m/.567*Math.PI*2;S.x=p.x+Math.cos(F)*N,S.z=p.z+Math.sin(F)*N,S.y=p.y}else if(m<=.724){const g=(m-.567)/.157,F=L(g);S.lerpVectors(j,E,F)}else if(m<=.881){const g=(m-.724)/.157,A=L(g)*Math.PI;S.x=p.x+Math.sin(A)*N,S.y=p.y+Math.cos(A)*N,S.z=p.z}else{const g=(m-.881)/.119,F=L(g);S.lerpVectors(C,d,F)}return S},V=()=>{const{camera:m,controls:S}=M();if(!m||!S)return;c||(c=Date.now());const N=Date.now()-c,j=Math.min(N/u,1);if(j>=1){B();return}const E=R(j);m.position.copy(E),m.lookAt(p),S.target.copy(p),y=requestAnimationFrame(V)},T=()=>{if(o.value.length===0)return;const{camera:m,controls:S}=M();if(!m||!S)return;d.copy(m.position),_.copy(S.target);const N=new r.Box3;o.value.forEach(x=>{N.expandByObject(x)});const j=N.getSize(new r.Vector3);p=N.getCenter(new r.Vector3),w=Math.max(j.x,j.y,j.z)*1.2;const E=new r.Vector3(p.x+w*1.2,p.y,p.z);S.enabled=!1;const C=m.position.clone(),g=1e3,F=Date.now(),A=()=>{const x=Date.now()-F,q=Math.min(x/g,1),D=L(q);m.position.lerpVectors(C,E,D),m.lookAt(p),S.target.copy(p),q<1?requestAnimationFrame(A):(l.value=!0,c=null,V())};A()},B=()=>{l.value=!1,c=null,y&&(cancelAnimationFrame(y),y=null);const{controls:m}=M();m&&(m.enabled=!0,m.target.copy(_))};return{isAnimating:l,toggleAnimation:()=>{if(l.value){l.value=!1,c=null,y&&(cancelAnimationFrame(y),y=null);const{camera:m,controls:S}=M();if(!m||!S)return;S.enabled=!0;const N=m.position.clone(),j=S.target.clone(),E=1500,C=Date.now(),g=()=>{const F=Date.now()-C,A=Math.min(F/E,1),x=L(A);m.position.lerpVectors(N,d,x),S.target.lerpVectors(j,_,x),A<1&&requestAnimationFrame(g)};g()}else T()},startAnimation:T,stopAnimation:B}}function io(M,o){const l=e.ref(!1),c=e.ref("none");let u=[],d=[],_=new r.Box3,p=new r.Vector3;const w=()=>{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)]},y=()=>{_.makeEmpty(),o.value.forEach(k=>{_.expandByObject(k)}),p=_.getCenter(new r.Vector3)},L=k=>{const m=_.getSize(new r.Vector3);let S,N,j;k==="x"?(S=new r.PlaneGeometry(m.z*1.2,m.y*1.2),N=new r.Vector3(p.x,p.y,p.z),j=new r.Euler(0,Math.PI/2,0)):k==="y"?(S=new r.PlaneGeometry(m.x*1.2,m.z*1.2),N=new r.Vector3(p.x,p.y,p.z),j=new r.Euler(Math.PI/2,0,0)):k==="z"&&(S=new r.PlaneGeometry(m.x*1.2,m.y*1.2),N=new r.Vector3(p.x,p.y,p.z),j=new r.Euler(0,0,0));const E=new r.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:r.DoubleSide,depthWrite:!1}),C=new r.Mesh(S,E);return C.position.copy(N),C.rotation.copy(j),C},R=()=>{if(V(),T(),c.value==="none")return;y();let k=null;if(c.value==="x"?(u[0].constant=-p.x,k=u[0]):c.value==="y"?(u[1].constant=-p.y,k=u[1]):c.value==="z"&&(u[2].constant=-p.z,k=u[2]),k){o.value.forEach(S=>{S.traverse(N=>{N.isMesh&&N.material&&(Array.isArray(N.material)?N.material.forEach(j=>{j.clippingPlanes=[k]}):N.material.clippingPlanes=[k])})});const{scene:m}=M();if(m){const S=L(c.value);m.add(S),d.push(S)}}},V=()=>{o.value.forEach(k=>{k.traverse(m=>{m.isMesh&&m.material&&(Array.isArray(m.material)?m.material.forEach(S=>{S.clippingPlanes=[]}):m.material.clippingPlanes=[])})})},T=()=>{const{scene:k}=M();k&&d.forEach(m=>{k.remove(m),m.geometry.dispose(),m.material.dispose()}),d=[]};return{isClipping:l,activeClippingAxis:c,toggleClipping:()=>{l.value=!l.value,l.value?(w(),o.value.length>0&&y()):(c.value="none",V(),T())},updateClippingPlanes:R,clearClippingPlanes:V,clearClippingMeshes:T}}const ao=/^[og]\s*(.+)?/,ro=/^mtllib /,lo=/^usemtl /,co=/^usemap /,Qt=/\s+/,en=new r.Vector3,St=new r.Vector3,tn=new r.Vector3,nn=new r.Vector3,Oe=new r.Vector3,xt=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 c=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,d){const _=this._finalize(!1);_&&(_.inherited||_.groupCount<=0)&&this.materials.splice(_.index,1);const p={index:this.materials.length,name:u||"",mtllib:Array.isArray(d)&&d.length>0?d[d.length-1]:"",smooth:_!==void 0?_.smooth:this.smooth,groupStart:_!==void 0?_.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(w){const y={index:typeof w=="number"?w:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return y.clone=this.clone.bind(y),y}};return this.materials.push(p),p},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(u){const d=this.currentMaterial();if(d&&d.groupEnd===-1&&(d.groupEnd=this.geometry.vertices.length/3,d.groupCount=d.groupEnd-d.groupStart,d.inherited=!1),u&&this.materials.length>1)for(let _=this.materials.length-1;_>=0;_--)this.materials[_].groupCount<=0&&this.materials.splice(_,1);return u&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),d}},c&&c.name&&typeof c.clone=="function"){const u=c.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 c=parseInt(o,10);return(c>=0?c-1:c+l/3)*3},parseNormalIndex:function(o,l){const c=parseInt(o,10);return(c>=0?c-1:c+l/3)*3},parseUVIndex:function(o,l){const c=parseInt(o,10);return(c>=0?c-1:c+l/2)*2},addVertex:function(o,l,c){const u=this.vertices,d=this.object.geometry.vertices;d.push(u[o+0],u[o+1],u[o+2]),d.push(u[l+0],u[l+1],u[l+2]),d.push(u[c+0],u[c+1],u[c+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,c){const u=this.normals,d=this.object.geometry.normals;d.push(u[o+0],u[o+1],u[o+2]),d.push(u[l+0],u[l+1],u[l+2]),d.push(u[c+0],u[c+1],u[c+2])},addFaceNormal:function(o,l,c){const u=this.vertices,d=this.object.geometry.normals;en.fromArray(u,o),St.fromArray(u,l),tn.fromArray(u,c),Oe.subVectors(tn,St),nn.subVectors(en,St),Oe.cross(nn),Oe.normalize(),d.push(Oe.x,Oe.y,Oe.z),d.push(Oe.x,Oe.y,Oe.z),d.push(Oe.x,Oe.y,Oe.z)},addColor:function(o,l,c){const u=this.colors,d=this.object.geometry.colors;u[o]!==void 0&&d.push(u[o+0],u[o+1],u[o+2]),u[l]!==void 0&&d.push(u[l+0],u[l+1],u[l+2]),u[c]!==void 0&&d.push(u[c+0],u[c+1],u[c+2])},addUV:function(o,l,c){const u=this.uvs,d=this.object.geometry.uvs;d.push(u[o+0],u[o+1]),d.push(u[l+0],u[l+1]),d.push(u[c+0],u[c+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,c,u,d,_,p,w,y){const L=this.vertices.length;let R=this.parseVertexIndex(o,L),V=this.parseVertexIndex(l,L),T=this.parseVertexIndex(c,L);if(this.addVertex(R,V,T),this.addColor(R,V,T),p!==void 0&&p!==""){const B=this.normals.length;R=this.parseNormalIndex(p,B),V=this.parseNormalIndex(w,B),T=this.parseNormalIndex(y,B),this.addNormal(R,V,T)}else this.addFaceNormal(R,V,T);if(u!==void 0&&u!==""){const B=this.uvs.length;R=this.parseUVIndex(u,B),V=this.parseUVIndex(d,B),T=this.parseUVIndex(_,B),this.addUV(R,V,T),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(o){this.object.geometry.type="Points";const l=this.vertices.length;for(let c=0,u=o.length;c<u;c++){const d=this.parseVertexIndex(o[c],l);this.addVertexPoint(d),this.addColor(d)}},addLineGeometry:function(o,l){this.object.geometry.type="Line";const c=this.vertices.length,u=this.uvs.length;for(let d=0,_=o.length;d<_;d++)this.addVertexLine(this.parseVertexIndex(o[d],c));for(let d=0,_=l.length;d<_;d++)this.addUVLine(this.parseUVIndex(l[d],u))}};return M.startObject("",!1),M}class Pt extends r.Loader{constructor(o){super(o),this.materials=null}load(o,l,c,u){const d=this,_=new r.FileLoader(this.manager);_.setPath(this.path),_.setRequestHeader(this.requestHeader),_.setWithCredentials(this.withCredentials),_.load(o,function(p){try{l(d.parse(p))}catch(w){u?u(w):console.error(w),d.manager.itemError(o)}},c,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 c=o.split(`
5
- `);let u=[];for(let p=0,w=c.length;p<w;p++){const y=c[p].trimStart();if(y.length===0)continue;const L=y.charAt(0);if(L!=="#")if(L==="v"){const R=y.split(Qt);switch(R[0]){case"v":l.vertices.push(parseFloat(R[1]),parseFloat(R[2]),parseFloat(R[3])),R.length>=7?(xt.setRGB(parseFloat(R[4]),parseFloat(R[5]),parseFloat(R[6]),r.SRGBColorSpace),l.colors.push(xt.r,xt.g,xt.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 V=y.slice(1).trim().split(Qt),T=[];for(let k=0,m=V.length;k<m;k++){const S=V[k];if(S.length>0){const N=S.split("/");T.push(N)}}const B=T[0];for(let k=1,m=T.length-1;k<m;k++){const S=T[k],N=T[k+1];l.addFace(B[0],S[0],N[0],B[1],S[1],N[1],B[2],S[2],N[2])}}else if(L==="l"){const R=y.substring(1).trim().split(" ");let V=[];const T=[];if(y.indexOf("/")===-1)V=R;else for(let B=0,k=R.length;B<k;B++){const m=R[B].split("/");m[0]!==""&&V.push(m[0]),m[1]!==""&&T.push(m[1])}l.addLineGeometry(V,T)}else if(L==="p"){const V=y.slice(1).trim().split(" ");l.addPointGeometry(V)}else if((u=ao.exec(y))!==null){const R=(" "+u[0].slice(1).trim()).slice(1);l.startObject(R)}else if(lo.test(y))l.object.startMaterial(y.substring(7).trim(),l.materialLibraries);else if(ro.test(y))l.materialLibraries.push(y.substring(7).trim());else if(co.test(y))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(L==="s"){if(u=y.split(" "),u.length>1){const V=u[1].trim().toLowerCase();l.object.smooth=V!=="0"&&V!=="off"}else l.object.smooth=!0;const R=l.object.currentMaterial();R&&(R.smooth=l.object.smooth)}else{if(y==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+y+'"')}}l.finalize();const d=new r.Group;if(d.materialLibraries=[].concat(l.materialLibraries),!(l.objects.length===1&&l.objects[0].geometry.vertices.length===0)===!0)for(let p=0,w=l.objects.length;p<w;p++){const y=l.objects[p],L=y.geometry,R=y.materials,V=L.type==="Line",T=L.type==="Points";let B=!1;if(L.vertices.length===0)continue;const k=new r.BufferGeometry;k.setAttribute("position",new r.Float32BufferAttribute(L.vertices,3)),L.normals.length>0&&k.setAttribute("normal",new r.Float32BufferAttribute(L.normals,3)),L.colors.length>0&&(B=!0,k.setAttribute("color",new r.Float32BufferAttribute(L.colors,3))),L.hasUVIndices===!0&&k.setAttribute("uv",new r.Float32BufferAttribute(L.uvs,2));const m=[];for(let N=0,j=R.length;N<j;N++){const E=R[N],C=E.name+"_"+E.smooth+"_"+B;let g=l.materials[C];if(this.materials!==null){if(g=this.materials.create(E.name),V&&g&&!(g instanceof r.LineBasicMaterial)){const F=new r.LineBasicMaterial;r.Material.prototype.copy.call(F,g),F.color.copy(g.color),g=F}else if(T&&g&&!(g instanceof r.PointsMaterial)){const F=new r.PointsMaterial({size:10,sizeAttenuation:!1});r.Material.prototype.copy.call(F,g),F.color.copy(g.color),F.map=g.map,g=F}}g===void 0&&(V?g=new r.LineBasicMaterial:T?g=new r.PointsMaterial({size:1,sizeAttenuation:!1}):g=new r.MeshPhongMaterial,g.name=E.name,g.flatShading=!E.smooth,g.vertexColors=B,l.materials[C]=g),m.push(g)}let S;if(m.length>1){for(let N=0,j=R.length;N<j;N++){const E=R[N];k.addGroup(E.groupStart,E.groupCount,N)}V?S=new r.LineSegments(k,m):T?S=new r.Points(k,m):S=new r.Mesh(k,m)}else V?S=new r.LineSegments(k,m[0]):T?S=new r.Points(k,m[0]):S=new r.Mesh(k,m[0]);S.name=y.name,d.add(S)}else if(l.vertices.length>0){const p=new r.PointsMaterial({size:1,sizeAttenuation:!1}),w=new r.BufferGeometry;w.setAttribute("position",new r.Float32BufferAttribute(l.vertices,3)),l.colors.length>0&&l.colors[0]!==void 0&&(w.setAttribute("color",new r.Float32BufferAttribute(l.colors,3)),p.vertexColors=!0);const y=new r.Points(w,p);d.add(y)}return d}}class Lt extends r.Loader{constructor(o){super(o)}load(o,l,c,u){const d=this,_=this.path===""?r.LoaderUtils.extractUrlBase(o):this.path,p=new r.FileLoader(this.manager);p.setPath(this.path),p.setRequestHeader(this.requestHeader),p.setWithCredentials(this.withCredentials),p.load(o,function(w){try{l(d.parse(w,_))}catch(y){u?u(y):console.error(y),d.manager.itemError(o)}},c,u)}setMaterialOptions(o){return this.materialOptions=o,this}parse(o,l){const c=o.split(`
6
- `);let u={};const d=/\s+/,_={};for(let w=0;w<c.length;w++){let y=c[w];if(y=y.trim(),y.length===0||y.charAt(0)==="#")continue;const L=y.indexOf(" ");let R=L>=0?y.substring(0,L):y;R=R.toLowerCase();let V=L>=0?y.substring(L+1):"";if(V=V.trim(),R==="newmtl")u={name:V},_[V]=u;else if(R==="ka"||R==="kd"||R==="ks"||R==="ke"){const T=V.split(d,3);u[R]=[parseFloat(T[0]),parseFloat(T[1]),parseFloat(T[2])]}else u[R]=V}const p=new ho(this.resourcePath||l,this.materialOptions);return p.setCrossOrigin(this.crossOrigin),p.setManager(this.manager),p.setMaterials(_),p}}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 c in o){const u=o[c],d={};l[c]=d;for(const _ in u){let p=!0,w=u[_];const y=_.toLowerCase();switch(y){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(w=[w[0]/255,w[1]/255,w[2]/255]),this.options&&this.options.ignoreZeroRGBs&&w[0]===0&&w[1]===0&&w[2]===0&&(p=!1);break}p&&(d[y]=w)}}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,c=this.materialsInfo[o],u={name:o,side:this.side};function d(p,w){return typeof w!="string"||w===""?"":/^https?:\/\//i.test(w)?w:p+w}function _(p,w){if(u[p])return;const y=l.getTextureParams(w,u),L=l.loadTexture(d(l.baseUrl,y.url));L.repeat.copy(y.scale),L.offset.copy(y.offset),L.wrapS=l.wrap,L.wrapT=l.wrap,(p==="map"||p==="emissiveMap")&&(L.colorSpace=r.SRGBColorSpace),u[p]=L}for(const p in c){const w=c[p];let y;if(w!=="")switch(p.toLowerCase()){case"kd":u.color=r.ColorManagement.colorSpaceToWorking(new r.Color().fromArray(w),r.SRGBColorSpace);break;case"ks":u.specular=r.ColorManagement.colorSpaceToWorking(new r.Color().fromArray(w),r.SRGBColorSpace);break;case"ke":u.emissive=r.ColorManagement.colorSpaceToWorking(new r.Color().fromArray(w),r.SRGBColorSpace);break;case"map_kd":_("map",w);break;case"map_ks":_("specularMap",w);break;case"map_ke":_("emissiveMap",w);break;case"norm":_("normalMap",w);break;case"map_bump":case"bump":_("bumpMap",w);break;case"disp":_("displacementMap",w);break;case"map_d":_("alphaMap",w),u.transparent=!0;break;case"ns":u.shininess=parseFloat(w);break;case"d":y=parseFloat(w),y<1&&(u.opacity=y,u.transparent=!0);break;case"tr":y=parseFloat(w),this.options&&this.options.invertTrProperty&&(y=1-y),y>0&&(u.opacity=1-y,u.transparent=!0);break}}return this.materials[o]=new r.MeshPhongMaterial(u),this.materials[o]}getTextureParams(o,l){const c={scale:new r.Vector2(1,1),offset:new r.Vector2(0,0)},u=o.split(/\s+/);let d;return d=u.indexOf("-bm"),d>=0&&(l.bumpScale=parseFloat(u[d+1]),u.splice(d,2)),d=u.indexOf("-mm"),d>=0&&(l.displacementBias=parseFloat(u[d+1]),l.displacementScale=parseFloat(u[d+2]),u.splice(d,3)),d=u.indexOf("-s"),d>=0&&(c.scale.set(parseFloat(u[d+1]),parseFloat(u[d+2])),u.splice(d,4)),d=u.indexOf("-o"),d>=0&&(c.offset.set(parseFloat(u[d+1]),parseFloat(u[d+2])),u.splice(d,4)),c.url=u.join(" ").trim(),c}loadTexture(o,l,c,u,d){const _=this.manager!==void 0?this.manager:r.DefaultLoadingManager;let p=_.getHandler(o);p===null&&(p=new r.TextureLoader(_)),p.setCrossOrigin&&p.setCrossOrigin(this.crossOrigin);const w=p.load(o,c,u,d);return l!==void 0&&(w.mapping=l),w}}class Nt extends r.Loader{constructor(o){super(o)}load(o,l,c,u){const d=this,_=new r.FileLoader(this.manager);_.setPath(this.path),_.setResponseType("arraybuffer"),_.setRequestHeader(this.requestHeader),_.setWithCredentials(this.withCredentials),_.load(o,function(p){try{l(d.parse(p))}catch(w){u?u(w):console.error(w),d.manager.itemError(o)}},c,u)}parse(o){function l(y){const L=new DataView(y),R=32/8*3+32/8*3*3+16/8,V=L.getUint32(80,!0);if(80+32/8+V*R===L.byteLength)return!0;const B=[115,111,108,105,100];for(let k=0;k<5;k++)if(c(B,L,k))return!1;return!0}function c(y,L,R){for(let V=0,T=y.length;V<T;V++)if(y[V]!==L.getUint8(R+V))return!1;return!0}function u(y){const L=new DataView(y),R=L.getUint32(80,!0);let V,T,B,k=!1,m,S,N,j,E;for(let D=0;D<70;D++)L.getUint32(D,!1)==1129270351&&L.getUint8(D+4)==82&&L.getUint8(D+5)==61&&(k=!0,m=new Float32Array(R*3*3),S=L.getUint8(D+6)/255,N=L.getUint8(D+7)/255,j=L.getUint8(D+8)/255,E=L.getUint8(D+9)/255);const C=84,g=12*4+2,F=new r.BufferGeometry,A=new Float32Array(R*3*3),x=new Float32Array(R*3*3),q=new r.Color;for(let D=0;D<R;D++){const U=C+D*g,ae=L.getFloat32(U,!0),ce=L.getFloat32(U+4,!0),b=L.getFloat32(U+8,!0);if(k){const h=L.getUint16(U+48,!0);(h&32768)===0?(V=(h&31)/31,T=(h>>5&31)/31,B=(h>>10&31)/31):(V=S,T=N,B=j)}for(let h=1;h<=3;h++){const I=U+h*12,H=D*3*3+(h-1)*3;A[H]=L.getFloat32(I,!0),A[H+1]=L.getFloat32(I+4,!0),A[H+2]=L.getFloat32(I+8,!0),x[H]=ae,x[H+1]=ce,x[H+2]=b,k&&(q.setRGB(V,T,B,r.SRGBColorSpace),m[H]=q.r,m[H+1]=q.g,m[H+2]=q.b)}}return F.setAttribute("position",new r.BufferAttribute(A,3)),F.setAttribute("normal",new r.BufferAttribute(x,3)),k&&(F.setAttribute("color",new r.BufferAttribute(m,3)),F.hasColors=!0,F.alpha=E),F}function d(y){const L=new r.BufferGeometry,R=/solid([\s\S]*?)endsolid/g,V=/facet([\s\S]*?)endfacet/g,T=/solid\s(.+)/;let B=0;const k=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,m=new RegExp("vertex"+k+k+k,"g"),S=new RegExp("normal"+k+k+k,"g"),N=[],j=[],E=[],C=new r.Vector3;let g,F=0,A=0,x=0;for(;(g=R.exec(y))!==null;){A=x;const q=g[0],D=(g=T.exec(q))!==null?g[1]:"";for(E.push(D);(g=V.exec(q))!==null;){let ce=0,b=0;const h=g[0];for(;(g=S.exec(h))!==null;)C.x=parseFloat(g[1]),C.y=parseFloat(g[2]),C.z=parseFloat(g[3]),b++;for(;(g=m.exec(h))!==null;)N.push(parseFloat(g[1]),parseFloat(g[2]),parseFloat(g[3])),j.push(C.x,C.y,C.z),ce++,x++;b!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+B),ce!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+B),B++}const U=A,ae=x-A;L.userData.groupNames=E,L.addGroup(U,ae,F),F++}return L.setAttribute("position",new r.Float32BufferAttribute(N,3)),L.setAttribute("normal",new r.Float32BufferAttribute(j,3)),L}function _(y){return typeof y!="string"?new TextDecoder().decode(y):y}function p(y){if(typeof y=="string"){const L=new Uint8Array(y.length);for(let R=0;R<y.length;R++)L[R]=y.charCodeAt(R)&255;return L.buffer||L}else return y}const w=p(o);return l(w)?u(w):d(_(o))}}class on extends r.DataTextureLoader{constructor(o){super(o)}parse(o){function l(h){switch(h.image_type){case V:case k:if(h.colormap_length>256||h.colormap_size!==24||h.colormap_type!==1)throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case T:case B:case m:case S:if(h.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 "+h.image_type)}if(h.width<=0||h.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(h.pixel_size!==8&&h.pixel_size!==16&&h.pixel_size!==24&&h.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+h.pixel_size)}function c(h,I,H,J,ne){let se,O;const K=H.pixel_size>>3,W=H.width*H.height*K;if(I&&(O=ne.subarray(J,J+=H.colormap_length*(H.colormap_size>>3))),h){se=new Uint8Array(W);let Y,G,X,ue=0;const pe=new Uint8Array(K);for(;ue<W;)if(Y=ne[J++],G=(Y&127)+1,Y&128){for(X=0;X<K;++X)pe[X]=ne[J++];for(X=0;X<G;++X)se.set(pe,ue+X*K);ue+=K*G}else{for(G*=K,X=0;X<G;++X)se[ue+X]=ne[J++];ue+=G}}else se=ne.subarray(J,J+=I?H.width*H.height:W);return{pixel_data:se,palettes:O}}function u(h,I,H,J,ne,se,O,K,W){const Y=W;let G,X=0,ue,pe;const le=q.width;for(pe=I;pe!==J;pe+=H)for(ue=ne;ue!==O;ue+=se,X++)G=K[X],h[(ue+le*pe)*4+3]=255,h[(ue+le*pe)*4+2]=Y[G*3+0],h[(ue+le*pe)*4+1]=Y[G*3+1],h[(ue+le*pe)*4+0]=Y[G*3+2];return h}function d(h,I,H,J,ne,se,O,K){let W,Y=0,G,X;const ue=q.width;for(X=I;X!==J;X+=H)for(G=ne;G!==O;G+=se,Y+=2)W=K[Y+0]+(K[Y+1]<<8),h[(G+ue*X)*4+0]=(W&31744)>>7,h[(G+ue*X)*4+1]=(W&992)>>2,h[(G+ue*X)*4+2]=(W&31)<<3,h[(G+ue*X)*4+3]=W&32768?0:255;return h}function _(h,I,H,J,ne,se,O,K){let W=0,Y,G;const X=q.width;for(G=I;G!==J;G+=H)for(Y=ne;Y!==O;Y+=se,W+=3)h[(Y+X*G)*4+3]=255,h[(Y+X*G)*4+2]=K[W+0],h[(Y+X*G)*4+1]=K[W+1],h[(Y+X*G)*4+0]=K[W+2];return h}function p(h,I,H,J,ne,se,O,K){let W=0,Y,G;const X=q.width;for(G=I;G!==J;G+=H)for(Y=ne;Y!==O;Y+=se,W+=4)h[(Y+X*G)*4+2]=K[W+0],h[(Y+X*G)*4+1]=K[W+1],h[(Y+X*G)*4+0]=K[W+2],h[(Y+X*G)*4+3]=K[W+3];return h}function w(h,I,H,J,ne,se,O,K){let W,Y=0,G,X;const ue=q.width;for(X=I;X!==J;X+=H)for(G=ne;G!==O;G+=se,Y++)W=K[Y],h[(G+ue*X)*4+0]=W,h[(G+ue*X)*4+1]=W,h[(G+ue*X)*4+2]=W,h[(G+ue*X)*4+3]=255;return h}function y(h,I,H,J,ne,se,O,K){let W=0,Y,G;const X=q.width;for(G=I;G!==J;G+=H)for(Y=ne;Y!==O;Y+=se,W+=2)h[(Y+X*G)*4+0]=K[W+0],h[(Y+X*G)*4+1]=K[W+0],h[(Y+X*G)*4+2]=K[W+0],h[(Y+X*G)*4+3]=K[W+1];return h}function L(h,I,H,J,ne){let se,O,K,W,Y,G;switch((q.flags&N)>>j){default:case g:se=0,K=1,Y=I,O=0,W=1,G=H;break;case E:se=0,K=1,Y=I,O=H-1,W=-1,G=-1;break;case F:se=I-1,K=-1,Y=-1,O=0,W=1,G=H;break;case C:se=I-1,K=-1,Y=-1,O=H-1,W=-1,G=-1;break}if(ae)switch(q.pixel_size){case 8:w(h,O,W,G,se,K,Y,J);break;case 16:y(h,O,W,G,se,K,Y,J);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(q.pixel_size){case 8:u(h,O,W,G,se,K,Y,J,ne);break;case 16:d(h,O,W,G,se,K,Y,J);break;case 24:_(h,O,W,G,se,K,Y,J);break;case 32:p(h,O,W,G,se,K,Y,J);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return h}const R=0,V=1,T=2,B=3,k=9,m=10,S=11,N=48,j=4,E=0,C=1,g=2,F=3;if(o.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let A=0;const x=new Uint8Array(o),q={id_length:x[A++],colormap_type:x[A++],image_type:x[A++],colormap_index:x[A++]|x[A++]<<8,colormap_length:x[A++]|x[A++]<<8,colormap_size:x[A++],origin:[x[A++]|x[A++]<<8,x[A++]|x[A++]<<8],width:x[A++]|x[A++]<<8,height:x[A++]|x[A++]<<8,pixel_size:x[A++],flags:x[A++]};if(l(q),q.id_length+A>o.length)throw new Error("THREE.TGALoader: No data.");A+=q.id_length;let D=!1,U=!1,ae=!1;switch(q.image_type){case k:D=!0,U=!0;break;case V:U=!0;break;case m:D=!0;break;case T:break;case S:D=!0,ae=!0;break;case B:ae=!0;break}const ce=new Uint8Array(q.width*q.height*4),b=c(D,U,q,A,x);return L(ce,q.width,q.height,b.pixel_data,b.palettes),{data:ce,width:q.width,height:q.height,flipY:!0,generateMipmaps:!0,minFilter:r.LinearMipmapLinearFilter}}}class po extends r.Loader{load(o,l,c,u){const d=this,_=d.path===""?r.LoaderUtils.extractUrlBase(o):d.path,p=new r.FileLoader(d.manager);p.setPath(d.path),p.setRequestHeader(d.requestHeader),p.setWithCredentials(d.withCredentials),p.load(o,function(w){try{l(d.parse(w,_))}catch(y){u?u(y):console.error(y),d.manager.itemError(o)}},c,u)}parse(o,l){function c(n,t){const i=[],s=n.childNodes;for(let a=0,f=s.length;a<f;a++){const v=s[a];v.nodeName===t&&i.push(v)}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 d(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 _(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 p(n){return n.substring(1)}function w(){return"three_default_"+On++}function y(n){return Object.keys(n).length===0}function L(n){return{unit:R(c(n,"unit")[0]),upAxis:V(c(n,"up_axis")[0])}}function R(n){return n!==void 0&&n.hasAttribute("meter")===!0?parseFloat(n.getAttribute("meter")):1}function V(n){return n!==void 0?n.textContent:"Y_UP"}function T(n,t,i,s){const a=c(n,t)[0];if(a!==void 0){const f=c(a,i);for(let v=0;v<f.length;v++)s(f[v])}}function B(n,t){for(const i in n){const s=n[i];s.build=t(n[i])}}function k(n,t){return n.build!==void 0||(n.build=t(n)),n.build}function m(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 v;switch(f.nodeName){case"source":v=f.getAttribute("id"),t.sources[v]=Ge(f);break;case"sampler":v=f.getAttribute("id"),t.samplers[v]=S(f);break;case"channel":v=f.getAttribute("target"),t.channels[v]=N(f);break;case"animation":m(f),i=!0;break;default:console.log(f)}}i===!1&&(re.animations[n.getAttribute("id")||r.MathUtils.generateUUID()]=t)}function S(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=p(a.getAttribute("source")),v=a.getAttribute("semantic");t.inputs[v]=f;break}}return t}function N(n){const t={};let s=n.getAttribute("target").split("/");const a=s.shift();let f=s.shift();const v=f.indexOf("(")!==-1,Z=f.indexOf(".")!==-1;if(Z)s=f.split("."),f=s.shift(),t.member=s.shift();else if(v){const z=f.split("(");f=z.shift();for(let $=0;$<z.length;$++)z[$]=parseInt(z[$].replace(/\)/,""));t.indices=z}return t.id=a,t.sid=f,t.arraySyntax=v,t.memberSyntax=Z,t.sampler=p(n.getAttribute("source")),t}function j(n){const t=[],i=n.channels,s=n.samplers,a=n.sources;for(const f in i)if(i.hasOwnProperty(f)){const v=i[f],Z=s[v.sampler],z=Z.inputs.INPUT,$=Z.inputs.OUTPUT,te=a[z],P=a[$],ee=C(v,te,P);q(ee,t)}return t}function E(n){return k(re.animations[n],j)}function C(n,t,i){const s=re.nodes[n.id],a=bt(s.id),f=s.transforms[n.sid],v=s.matrix.clone().transpose();let Z,z,$,te,P,ee;const Q={};switch(f){case"matrix":for($=0,te=t.array.length;$<te;$++)if(Z=t.array[$],z=$*i.stride,Q[Z]===void 0&&(Q[Z]={}),n.arraySyntax===!0){const xe=i.array[z],be=n.indices[0]+4*n.indices[1];Q[Z][be]=xe}else for(P=0,ee=i.stride;P<ee;P++)Q[Z][P]=i.array[z+P];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 ie=g(Q,v);return{name:a.uuid,keyframes:ie}}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++)D(i,a,t.elements[a]);return i;function s(a,f){return a.time-f.time}}const F=new r.Vector3,A=new r.Vector3,x=new r.Quaternion;function q(n,t){const i=n.keyframes,s=n.name,a=[],f=[],v=[],Z=[];for(let z=0,$=i.length;z<$;z++){const te=i[z],P=te.time,ee=te.value;Re.fromArray(ee).transpose(),Re.decompose(F,x,A),a.push(P),f.push(F.x,F.y,F.z),v.push(x.x,x.y,x.z,x.w),Z.push(A.x,A.y,A.z)}return f.length>0&&t.push(new r.VectorKeyframeTrack(s+".position",a,f)),v.length>0&&t.push(new r.QuaternionKeyframeTrack(s+".quaternion",a,v)),Z.length>0&&t.push(new r.VectorKeyframeTrack(s+".scale",a,Z)),t}function D(n,t,i){let s,a=!0,f,v;for(f=0,v=n.length;f<v;f++)s=n[f],s.value[t]===void 0?s.value[t]=null:a=!1;if(a===!0)for(f=0,v=n.length;f<v;f++)s=n[f],s.value[t]=i;else U(n,t)}function U(n,t){let i,s;for(let a=0,f=n.length;a<f;a++){const v=n[a];if(v.value[t]===null){if(i=ae(n,a,t),s=ce(n,a,t),i===null){v.value[t]=s.value[t];continue}if(s===null){v.value[t]=i.value[t];continue}b(v,i,s,t)}}}function ae(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 b(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 h(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(p(a.getAttribute("url")));break}}re.clips[n.getAttribute("id")]=t}function I(n){const t=[],i=n.name,s=n.end-n.start||-1,a=n.animations;for(let f=0,v=a.length;f<v;f++){const Z=E(a[f]);for(let z=0,$=Z.length;z<$;z++)t.push(Z[z])}return new r.AnimationClip(i,s,t)}function H(n){return k(re.clips[n],I)}function J(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=p(a.getAttribute("source")),t.skin=ne(a);break;case"morph":t.id=p(a.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.");break}}re.controllers[n.getAttribute("id")]=t}function ne(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=d(a.textContent);break;case"source":const f=a.getAttribute("id");t.sources[f]=Ge(a);break;case"joints":t.joints=se(a);break;case"vertex_weights":t.vertexWeights=O(a);break}}return t}function se(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"),v=p(a.getAttribute("source"));t.inputs[f]=v;break}}return t}function O(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"),v=p(a.getAttribute("source")),Z=parseInt(a.getAttribute("offset"));t.inputs[f]={id:v,offset:Z};break;case"vcount":t.vcount=_(a.textContent);break;case"v":t.v=_(a.textContent);break}}return t}function K(n){const t={id:n.id},i=re.geometries[t.id];return n.skin!==void 0&&(t.skin=W(n.skin),i.sources.skinIndices=t.skin.indices,i.sources.skinWeights=t.skin.weights),t}function W(n){const i={joints:[],indices:{array:[],stride:4},weights:{array:[],stride:4}},s=n.sources,a=n.vertexWeights,f=a.vcount,v=a.v,Z=a.inputs.JOINT.offset,z=a.inputs.WEIGHT.offset,$=n.sources[n.joints.inputs.JOINT],te=n.sources[n.joints.inputs.INV_BIND_MATRIX],P=s[a.inputs.WEIGHT.id].array;let ee=0,Q,ie,oe;for(Q=0,oe=f.length;Q<oe;Q++){const be=f[Q],fe=[];for(ie=0;ie<be;ie++){const me=v[ee+Z],Ye=v[ee+z],Le=P[Ye];fe.push({index:me,weight:Le}),ee+=2}for(fe.sort(xe),ie=0;ie<4;ie++){const me=fe[ie];me!==void 0?(i.indices.array.push(me.index),i.weights.array.push(me.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(),Q=0,oe=$.array.length;Q<oe;Q++){const be=$.array[Q],fe=new r.Matrix4().fromArray(te.array,Q*te.stride).transpose();i.joints.push({name:be,boneInverse:fe})}return i;function xe(be,fe){return fe.weight-be.weight}}function Y(n){return k(re.controllers[n],K)}function G(n){const t={init_from:c(n,"init_from")[0].textContent};re.images[n.getAttribute("id")]=t}function X(n){return n.build!==void 0?n.build:n.init_from}function ue(n){const t=re.images[n];return t!==void 0?k(t,X):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",n),null)}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"profile_COMMON":t.profile=le(a);break}}re.effects[n.getAttribute("id")]=t}function le(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":Se(a,t);break;case"technique":t.technique=tt(a);break;case"extra":t.extra=ut(a);break}}return t}function Se(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]=Pe(f);break;case"sampler2D":t.samplers[i]=De(f);break}}}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"init_from":t.init_from=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"source":t.source=a.textContent;break}}return t}function tt(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=nt(a);break;case"extra":t.extra=ut(a);break}}return t}function nt(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]=We(a);break;case"transparent":t[a.nodeName]={opaque:a.hasAttribute("opaque")?a.getAttribute("opaque"):"A_ONE",data:We(a)};break}}return t}function We(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]=d(a.textContent);break;case"float":t[a.nodeName]=parseFloat(a.textContent);break;case"texture":t[a.nodeName]={id:a.getAttribute("texture"),extra:Ze(a)};break}}return t}function Ze(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":ot(a,t);break}}return t}function ot(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":Ne(a,t);break}}}function Ne(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]=_e(a);break}}}function ut(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=Ue(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"double_sided":t[a.nodeName]=parseInt(a.textContent);break;case"bump":t[a.nodeName]=_e(a);break}}return t}function _e(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:Ze(a)};break}}return t}function he(n){return n}function Fe(n){return k(re.effects[n],he)}function ht(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=p(a.getAttribute("url"));break}}re.materials[n.getAttribute("id")]=t}function ve(n){let t,i=n.slice((n.lastIndexOf(".")-1>>>0)+2);switch(i=i.toLowerCase(),i){case"tga":t=At;break;default:t=Kt}return t}function Je(n){const t=Fe(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(z,$=null){const te=t.profile.samplers[z.id];let P=null;if(te!==void 0){const ee=t.profile.surfaces[te.source];P=ue(ee.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),P=ue(z.id);if(P!==null){const ee=ve(P);if(ee!==void 0){const Q=ee.load(P),ie=z.extra;if(ie!==void 0&&ie.technique!==void 0&&y(ie.technique)===!1){const oe=ie.technique;Q.wrapS=oe.wrapU?r.RepeatWrapping:r.ClampToEdgeWrapping,Q.wrapT=oe.wrapV?r.RepeatWrapping:r.ClampToEdgeWrapping,Q.offset.set(oe.offsetU||0,oe.offsetV||0),Q.repeat.set(oe.repeatU||1,oe.repeatV||1)}else Q.wrapS=r.RepeatWrapping,Q.wrapT=r.RepeatWrapping;return $!==null&&(Q.colorSpace=$),Q}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",P),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",z.id),null}const f=i.parameters;for(const z in f){const $=f[z];switch(z){case"diffuse":$.color&&s.color.fromArray($.color),$.texture&&(s.map=a($.texture,r.SRGBColorSpace));break;case"specular":$.color&&s.specular&&s.specular.fromArray($.color),$.texture&&(s.specularMap=a($.texture));break;case"bump":$.texture&&(s.normalMap=a($.texture));break;case"ambient":$.texture&&(s.lightMap=a($.texture,r.SRGBColorSpace));break;case"shininess":$.float&&s.shininess&&(s.shininess=$.float);break;case"emission":$.color&&s.emissive&&s.emissive.fromArray($.color),$.texture&&(s.emissiveMap=a($.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 v=f.transparent,Z=f.transparency;if(Z===void 0&&v&&(Z={float:1}),v===void 0&&Z&&(v={opaque:"A_ONE",data:{color:[1,1,1,1]}}),v&&Z)if(v.data.texture)s.transparent=!0;else{const z=v.data.color;switch(v.opaque){case"A_ONE":s.opacity=z[3]*Z.float;break;case"RGB_ZERO":s.opacity=1-z[0]*Z.float;break;case"A_ZERO":s.opacity=1-z[3]*Z.float;break;case"RGB_ONE":s.opacity=z[0]*Z.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',v.opaque)}s.opacity<1&&(s.transparent=!0)}if(i.extra!==void 0&&i.extra.technique!==void 0){const z=i.extra.technique;for(const $ in z){const te=z[$];switch($){case"double_sided":s.side=te===1?r.DoubleSide:r.FrontSide;break;case"bump":s.normalMap=a(te.texture),s.normalScale=new r.Vector2(1,1);break}}}return s}function st(n){return k(re.materials[n],Je)}function it(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=pt(a);break}}re.cameras[n.getAttribute("id")]=t}function pt(n){for(let t=0;t<n.childNodes.length;t++){const i=n.childNodes[t];switch(i.nodeName){case"technique_common":return ft(i)}}return{}}function ft(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=at(s);break}}return t}function at(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 ge(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 Ce(n){const t=re.cameras[n];return t!==void 0?k(t,ge):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",n),null)}function je(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=Ae(a);break}}re.lights[n.getAttribute("id")]=t}function Ae(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=ke(a)}}return t}function ke(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=d(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 v=parseFloat(a.textContent);t.distance=v?Math.sqrt(1/v):0;break}}return t}function Be(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 qe(n){const t=re.lights[n];return t!==void 0?k(t,Be):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",n),null)}function He(n){const t={name:n.getAttribute("name"),sources:{},vertices:{},primitives:[]},i=c(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]=Ge(a);break;case"vertices":t.vertices=rt(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(Xe(a));break;default:console.log(a)}}re.geometries[n.getAttribute("id")]=t}}function Ge(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=d(s.textContent);break;case"Name_array":t.array=u(s.textContent);break;case"technique_common":const a=c(s,"accessor")[0];a!==void 0&&(t.stride=parseInt(a.getAttribute("stride")));break}}return t}function rt(n){const t={};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];s.nodeType===1&&(t[s.getAttribute("semantic")]=p(s.getAttribute("source")))}return t}function Xe(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=p(a.getAttribute("source")),v=a.getAttribute("semantic"),Z=parseInt(a.getAttribute("offset")),z=parseInt(a.getAttribute("set")),$=z>0?v+z:v;t.inputs[$]={id:f,offset:Z},t.stride=Math.max(t.stride,Z+1),v==="TEXCOORD"&&(t.hasUV=!0);break;case"vcount":t.vcount=_(a.textContent);break;case"p":t.p=_(a.textContent);break}}return t}function Qe(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 $e(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 mt(n){const t={},i=n.sources,s=n.vertices,a=n.primitives;if(a.length===0)return{};const f=Qe(a);for(const v in f){const Z=f[v];$e(Z),t[v]=un(Z,i,s)}return t}function un(n,t,i){const s={},a={array:[],stride:0},f={array:[],stride:0},v={array:[],stride:0},Z={array:[],stride:0},z={array:[],stride:0},$={array:[],stride:4},te={array:[],stride:4},P=new r.BufferGeometry,ee=[];let Q=0;for(let ie=0;ie<n.length;ie++){const oe=n[ie],xe=oe.inputs;let be=0;switch(oe.type){case"lines":case"linestrips":be=oe.count*2;break;case"triangles":be=oe.count*3;break;case"polylist":for(let fe=0;fe<oe.count;fe++){const me=oe.vcount[fe];switch(me){case 3:be+=3;break;case 4:be+=6;break;default:be+=(me-2)*3;break}}break;default:console.warn("THREE.ColladaLoader: Unknown primitive type:",oe.type)}P.addGroup(Q,be,ie),Q+=be,oe.material&&ee.push(oe.material);for(const fe in xe){const me=xe[fe];switch(fe){case"VERTEX":for(const Ye in i){const Le=i[Ye];switch(Ye){case"POSITION":const yt=a.array.length;if(ze(oe,t[Le],me.offset,a.array),a.stride=t[Le].stride,t.skinWeights&&t.skinIndices&&(ze(oe,t.skinIndices,me.offset,$.array),ze(oe,t.skinWeights,me.offset,te.array)),oe.hasUV===!1&&n.uvsNeedsFix===!0){const In=(a.array.length-yt)/a.stride;for(let Zt=0;Zt<In;Zt++)v.array.push(0,0)}break;case"NORMAL":ze(oe,t[Le],me.offset,f.array),f.stride=t[Le].stride;break;case"COLOR":ze(oe,t[Le],me.offset,z.array),z.stride=t[Le].stride;break;case"TEXCOORD":ze(oe,t[Le],me.offset,v.array),v.stride=t[Le].stride;break;case"TEXCOORD1":ze(oe,t[Le],me.offset,Z.array),v.stride=t[Le].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',Ye)}}break;case"NORMAL":ze(oe,t[me.id],me.offset,f.array),f.stride=t[me.id].stride;break;case"COLOR":ze(oe,t[me.id],me.offset,z.array,!0),z.stride=t[me.id].stride;break;case"TEXCOORD":ze(oe,t[me.id],me.offset,v.array),v.stride=t[me.id].stride;break;case"TEXCOORD1":ze(oe,t[me.id],me.offset,Z.array),Z.stride=t[me.id].stride;break}}}return a.array.length>0&&P.setAttribute("position",new r.Float32BufferAttribute(a.array,a.stride)),f.array.length>0&&P.setAttribute("normal",new r.Float32BufferAttribute(f.array,f.stride)),z.array.length>0&&P.setAttribute("color",new r.Float32BufferAttribute(z.array,z.stride)),v.array.length>0&&P.setAttribute("uv",new r.Float32BufferAttribute(v.array,v.stride)),Z.array.length>0&&P.setAttribute("uv1",new r.Float32BufferAttribute(Z.array,Z.stride)),$.array.length>0&&P.setAttribute("skinIndex",new r.Float32BufferAttribute($.array,$.stride)),te.array.length>0&&P.setAttribute("skinWeight",new r.Float32BufferAttribute(te.array,te.stride)),s.data=P,s.type=n[0].type,s.materialKeys=ee,s}function ze(n,t,i,s,a=!1){const f=n.p,v=n.stride,Z=n.vcount;function z(P){let ee=f[P+i]*te;const Q=ee+te;for(;ee<Q;ee++)s.push($[ee]);if(a){const ie=s.length-te-1;_t.setRGB(s[ie+0],s[ie+1],s[ie+2],r.SRGBColorSpace),s[ie+0]=_t.r,s[ie+1]=_t.g,s[ie+2]=_t.b}}const $=t.array,te=t.stride;if(n.vcount!==void 0){let P=0;for(let ee=0,Q=Z.length;ee<Q;ee++){const ie=Z[ee];if(ie===4){const oe=P+v*0,xe=P+v*1,be=P+v*2,fe=P+v*3;z(oe),z(xe),z(fe),z(xe),z(be),z(fe)}else if(ie===3){const oe=P+v*0,xe=P+v*1,be=P+v*2;z(oe),z(xe),z(be)}else if(ie>4)for(let oe=1,xe=ie-2;oe<=xe;oe++){const be=P+v*0,fe=P+v*oe,me=P+v*(oe+1);z(be),z(fe),z(me)}P+=v*ie}}else for(let P=0,ee=f.length;P<ee;P+=v)z(P)}function Ft(n){return k(re.geometries[n],mt)}function hn(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":mn(s,t);break}}re.kinematicsModels[n.getAttribute("id")]=t}function pn(n){return n.build!==void 0?n.build:n}function fn(n){return k(re.kinematicsModels[n],pn)}function mn(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")]=gn(s);break;case"link":t.links.push(jt(s));break}}}function gn(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=d(s.textContent);t.axis.fromArray(a);break;case"limits":const f=s.getElementsByTagName("max")[0],v=s.getElementsByTagName("min")[0];t.limits.max=parseFloat(f.textContent),t.limits.min=parseFloat(v.textContent);break}}return t.limits.min>=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function jt(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(yn(s));break;case"matrix":case"translate":case"rotate":t.transforms.push(Ot(s));break}}return t}function yn(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(jt(s));break;case"matrix":case"translate":case"rotate":t.transforms.push(Ot(s));break}}return t}function Ot(n){const t={type:n.nodeName},i=d(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 wn(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")]={},_n(s,t.rigidBodies[s.getAttribute("name")]);break}}re.physicsModels[n.getAttribute("id")]=t}function _n(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":kn(s,t);break}}}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"inertia":t.inertia=d(s.textContent);break;case"mass":t.mass=d(s.textContent)[0];break}}}function Cn(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(vn(s));break}}re.kinematicsScenes[p(n.getAttribute("url"))]=t}function vn(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 xn(n){return n.build!==void 0?n.build:n}function Nn(n){return k(re.kinematicsScenes[n],xn)}function En(){const n=Object.keys(re.kinematicsModels)[0],t=Object.keys(re.kinematicsScenes)[0],i=Object.keys(re.visualScenes)[0];if(n===void 0||t===void 0)return;const s=fn(n),a=Nn(t),f=Ht(i),v=a.bindJointAxis,Z={};for(let te=0,P=v.length;te<P;te++){const ee=v[te],Q=Ee.querySelector('[sid="'+ee.target+'"]');if(Q){const ie=Q.parentElement;z(ee.jointIndex,ie)}}function z(te,P){const ee=P.getAttribute("name"),Q=s.joints[te];f.traverse(function(ie){ie.name===ee&&(Z[te]={object:ie,transforms:Tn(P),joint:Q,position:Q.zeroPosition})})}const $=new r.Matrix4;Wt={joints:s&&s.joints,getJointValue:function(te){const P=Z[te];if(P)return P.position;console.warn("THREE.ColladaLoader: Joint "+te+" doesn't exist.")},setJointValue:function(te,P){const ee=Z[te];if(ee){const Q=ee.joint;if(P>Q.limits.max||P<Q.limits.min)console.warn("THREE.ColladaLoader: Joint "+te+" value "+P+" outside of limits (min: "+Q.limits.min+", max: "+Q.limits.max+").");else if(Q.static)console.warn("THREE.ColladaLoader: Joint "+te+" is static.");else{const ie=ee.object,oe=Q.axis,xe=ee.transforms;Re.identity();for(let be=0;be<xe.length;be++){const fe=xe[be];if(fe.sid&&fe.sid.indexOf(te)!==-1)switch(Q.type){case"revolute":Re.multiply($.makeRotationAxis(oe,r.MathUtils.degToRad(P)));break;case"prismatic":Re.multiply($.makeTranslation(oe.x*P,oe.y*P,oe.z*P));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+Q.type);break}else switch(fe.type){case"matrix":Re.multiply(fe.obj);break;case"translate":Re.multiply($.makeTranslation(fe.obj.x,fe.obj.y,fe.obj.z));break;case"scale":Re.scale(fe.obj);break;case"rotate":Re.multiply($.makeRotationAxis(fe.obj,fe.angle));break}}ie.matrix.copy(Re),ie.matrix.decompose(ie.position,ie.quaternion,ie.scale),Z[te].position=P}}else console.log("THREE.ColladaLoader: "+te+" does not exist.")}}}function Tn(n){const t=[],i=Ee.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,v;switch(a.nodeName){case"matrix":f=d(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=d(a.textContent),v=new r.Vector3().fromArray(f),t.push({sid:a.getAttribute("sid"),type:a.nodeName,obj:v});break;case"rotate":f=d(a.textContent),v=new r.Vector3().fromArray(f);const z=r.MathUtils.degToRad(f[3]);t.push({sid:a.getAttribute("sid"),type:a.nodeName,obj:v,angle:z});break}}return t}function An(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",w())}}const Re=new r.Matrix4,gt=new r.Vector3;function Et(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")),Et(s);break;case"instance_camera":t.instanceCameras.push(p(s.getAttribute("url")));break;case"instance_controller":t.instanceControllers.push(It(s));break;case"instance_light":t.instanceLights.push(p(s.getAttribute("url")));break;case"instance_geometry":t.instanceGeometries.push(It(s));break;case"instance_node":t.instanceNodes.push(p(s.getAttribute("url")));break;case"matrix":a=d(s.textContent),t.matrix.multiply(Re.fromArray(a).transpose()),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"translate":a=d(s.textContent),gt.fromArray(a),t.matrix.multiply(Re.makeTranslation(gt.x,gt.y,gt.z)),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"rotate":a=d(s.textContent);const f=r.MathUtils.degToRad(a[3]);t.matrix.multiply(Re.makeRotationAxis(gt.fromArray(a),f)),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"scale":a=d(s.textContent),t.matrix.scale(gt.fromArray(a)),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"extra":break;default:console.log(s)}}return Gt(t.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",t.id):re.nodes[t.id]=t,t}function It(n){const t={id:p(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 v=a[f],Z=v.getAttribute("symbol"),z=v.getAttribute("target");t.materials[Z]=p(z)}break;case"skeleton":t.skeletons.push(p(s.textContent));break}}return t}function Mn(n,t){const i=[],s=[];let a,f,v;for(a=0;a<n.length;a++){const $=n[a];let te;if(Gt($))te=bt($),Ut(te,t,i);else if(Bn($)){const ee=re.visualScenes[$].children;for(let Q=0;Q<ee.length;Q++){const ie=ee[Q];if(ie.type==="JOINT"){const oe=bt(ie.id);Ut(oe,t,i)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",$)}for(a=0;a<t.length;a++)for(f=0;f<i.length;f++)if(v=i[f],v.bone.name===t[a].name){s[a]=v,v.processed=!0;break}for(a=0;a<i.length;a++)v=i[a],v.processed===!1&&(s.push(v),v.processed=!0);const Z=[],z=[];for(a=0;a<s.length;a++)v=s[a],Z.push(v.bone),z.push(v.boneInverse);return new r.Skeleton(Z,z)}function Ut(n,t,i){n.traverse(function(s){if(s.isBone===!0){let a;for(let f=0;f<t.length;f++){const v=t[f];if(v.name===s.name){a=v.boneInverse;break}}a===void 0&&(a=new r.Matrix4),i.push({bone:s,boneInverse:a,processed:!1})}})}function Sn(n){const t=[],i=n.matrix,s=n.nodes,a=n.type,f=n.instanceCameras,v=n.instanceControllers,Z=n.instanceLights,z=n.instanceGeometries,$=n.instanceNodes;for(let P=0,ee=s.length;P<ee;P++)t.push(bt(s[P]));for(let P=0,ee=f.length;P<ee;P++){const Q=Ce(f[P]);Q!==null&&t.push(Q.clone())}for(let P=0,ee=v.length;P<ee;P++){const Q=v[P],ie=Y(Q.id),oe=Ft(ie.id),xe=zt(oe,Q.materials),be=Q.skeletons,fe=ie.skin.joints,me=Mn(be,fe);for(let Ye=0,Le=xe.length;Ye<Le;Ye++){const yt=xe[Ye];yt.isSkinnedMesh&&(yt.bind(me,ie.skin.bindMatrix),yt.normalizeSkinWeights()),t.push(yt)}}for(let P=0,ee=Z.length;P<ee;P++){const Q=qe(Z[P]);Q!==null&&t.push(Q.clone())}for(let P=0,ee=z.length;P<ee;P++){const Q=z[P],ie=Ft(Q.id),oe=zt(ie,Q.materials);for(let xe=0,be=oe.length;xe<be;xe++)t.push(oe[xe])}for(let P=0,ee=$.length;P<ee;P++)t.push(bt($[P]).clone());let te;if(s.length===0&&t.length===1)te=t[0];else{te=a==="JOINT"?new r.Bone:new r.Group;for(let P=0;P<t.length;P++)te.add(t[P])}return te.name=a==="JOINT"?n.sid:n.name,te.matrix.copy(i),te.matrix.decompose(te.position,te.quaternion,te.scale),te}const Pn=new r.MeshBasicMaterial({name:r.Loader.DEFAULT_MATERIAL_NAME,color:16711935});function Ln(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(Pn)):i.push(st(f))}return i}function zt(n,t){const i=[];for(const s in n){const a=n[s],f=Ln(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 $=0,te=f.length;$<te;$++){const P=f[$];if(P.isMeshPhongMaterial===!0||P.isMeshLambertMaterial===!0){const ee=new r.LineBasicMaterial;ee.color.copy(P.color),ee.opacity=P.opacity,ee.transparent=P.transparent,f[$]=ee}}const v=a.data.attributes.skinIndex!==void 0,Z=f.length===1?f[0]:f;let z;switch(s){case"lines":z=new r.LineSegments(a.data,Z);break;case"linestrips":z=new r.Line(a.data,Z);break;case"triangles":case"polylist":v?z=new r.SkinnedMesh(a.data,Z):z=new r.Mesh(a.data,Z);break}i.push(z)}return i}function Gt(n){return re.nodes[n]!==void 0}function bt(n){return k(re.nodes[n],Sn)}function Vn(n){const t={name:n.getAttribute("name"),children:[]};An(n);const i=c(n,"node");for(let s=0;s<i.length;s++)t.children.push(Et(i[s]));re.visualScenes[n.getAttribute("id")]=t}function qt(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(bt(a.id))}return t}function Bn(n){return re.visualScenes[n]!==void 0}function Ht(n){return k(re.visualScenes[n],qt)}function Rn(n){const t=c(n,"instance_visual_scene")[0];return Ht(p(t.getAttribute("url")))}function Dn(){const n=re.clips;if(y(n)===!0){if(y(re.animations)===!1){const t=[];for(const i in re.animations){const s=E(i);for(let a=0,f=s.length;a<f;a++)t.push(s[a])}kt.push(new r.AnimationClip("default",-1,t))}}else for(const t in n)kt.push(H(t))}function Fn(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 $t=new DOMParser().parseFromString(o,"application/xml"),Ee=c($t,"COLLADA")[0],Tt=$t.getElementsByTagName("parsererror")[0];if(Tt!==void 0){const n=c(Tt,"div")[0];let t;return n?t=n.textContent:t=Fn(Tt),console.error(`THREE.ColladaLoader: Failed to parse collada file.
8
- `,t),null}const jn=Ee.getAttribute("version");console.debug("THREE.ColladaLoader: File version",jn);const Yt=L(c(Ee,"asset")[0]),Kt=new r.TextureLoader(this.manager);Kt.setPath(this.resourcePath||l).setCrossOrigin(this.crossOrigin);let At;on&&(At=new on(this.manager),At.setPath(this.resourcePath||l));const _t=new r.Color,kt=[];let Wt={},On=0;const re={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};T(Ee,"library_animations","animation",m),T(Ee,"library_animation_clips","animation_clip",h),T(Ee,"library_controllers","controller",J),T(Ee,"library_images","image",G),T(Ee,"library_effects","effect",pe),T(Ee,"library_materials","material",ht),T(Ee,"library_cameras","camera",it),T(Ee,"library_lights","light",je),T(Ee,"library_geometries","geometry",He),T(Ee,"library_nodes","node",Et),T(Ee,"library_visual_scenes","visual_scene",Vn),T(Ee,"library_kinematics_models","kinematics_model",hn),T(Ee,"library_physics_models","physics_model",wn),T(Ee,"scene","instance_kinematics_scene",Cn),B(re.animations,j),B(re.clips,I),B(re.controllers,K),B(re.images,X),B(re.effects,he),B(re.materials,Je),B(re.cameras,ge),B(re.lights,Be),B(re.geometries,mt),B(re.visualScenes,qt),Dn(),En();const Ct=Rn(c(Ee,"scene")[0]);return Ct.animations=kt,Yt.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."),Ct.rotation.set(-Math.PI/2,0,0)),Ct.scale.multiplyScalar(Yt.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),kt},kinematics:Wt,library:re,scene:Ct}}}const Vt=new r.Quaternion,sn=new r.Euler;function wt(M){return M?M.trim().split(/\s+/g).map(o=>parseFloat(o)):[0,0,0]}function an(M,o,l=!1){l||M.rotation.set(0,0,0),sn.set(o[0],o[1],o[2],"ZYX"),Vt.setFromEuler(sn),Vt.multiply(M.quaternion),M.quaternion.copy(Vt)}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,c)=>{this.load(o,l,null,c)})}load(o,l,c,u){const d=this.manager,_=r.LoaderUtils.extractUrlBase(o),p=this.manager.resolveURL(o);d.itemStart(p),fetch(p,this.fetchOptions).then(w=>{if(w.ok)return c&&c(null),w.text();throw new Error(`URDFLoader: Failed to load url '${p}' with error code ${w.status} : ${w.statusText}.`)}).then(w=>{const y=this.parse(w,this.workingPath||_);l(y),d.itemEnd(p)}).catch(w=>{u?u(w):console.error("URDFLoader: Error loading file.",w),d.itemError(p),d.itemEnd(p)})}parse(o,l=this.workingPath){const c=this.packages,u=this.loadMeshCb,d=this.parseVisual,_=this.parseCollision,p=this.manager,w={},y={},L={};function R(N){if(!/^package:\/\//.test(N))return l?l+N:N;const[j,E]=N.replace(/^package:\/\//,"").split(/\/(.+)/);if(typeof c=="string")return c.endsWith(j)?c+"/"+E:c+"/"+j+"/"+E;if(c instanceof Function)return c(j)+"/"+E;if(typeof c=="object")return j in c?c[j]+"/"+E:(console.error(`URDFLoader : ${j} not found in provided package list.`),null)}function V(N){let j;N instanceof Document?j=[...N.children]:N instanceof Element?j=[N]:j=[...new DOMParser().parseFromString(N,"text/xml").children];const E=j.filter(C=>C.nodeName==="robot").pop();return T(E)}function T(N){const j=[...N.children],E=j.filter(D=>D.nodeName.toLowerCase()==="link"),C=j.filter(D=>D.nodeName.toLowerCase()==="joint"),g=j.filter(D=>D.nodeName.toLowerCase()==="material"),F=new r.URDFRobot;F.robotName=N.getAttribute("name"),F.urdfRobotNode=N,g.forEach(D=>{const U=D.getAttribute("name");L[U]=m(D)});const A={},x={};E.forEach(D=>{const U=D.getAttribute("name"),ae=N.querySelector(`child[link="${U}"]`)===null;w[U]=k(D,A,x,ae?F:null)}),C.forEach(D=>{const U=D.getAttribute("name");y[U]=B(D)}),F.joints=y,F.links=w,F.colliders=x,F.visual=A;const q=Object.values(y);return q.forEach(D=>{D instanceof r.URDFMimicJoint&&y[D.mimicJoint].mimicJoints.push(D)}),q.forEach(D=>{const U=new Set,ae=ce=>{if(U.has(ce))throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");U.add(ce),ce.mimicJoints.forEach(b=>{ae(b)})};ae(D)}),F.frames={...x,...A,...w,...y},F}function B(N){const j=[...N.children],E=N.getAttribute("type");let C;const g=j.find(U=>U.nodeName.toLowerCase()==="mimic");g?(C=new r.URDFMimicJoint,C.mimicJoint=g.getAttribute("joint"),C.multiplier=parseFloat(g.getAttribute("multiplier")||1),C.offset=parseFloat(g.getAttribute("offset")||0)):C=new r.URDFJoint,C.urdfNode=N,C.name=N.getAttribute("name"),C.urdfName=C.name,C.jointType=E;let F=null,A=null,x=[0,0,0],q=[0,0,0];j.forEach(U=>{const ae=U.nodeName.toLowerCase();ae==="origin"?(x=wt(U.getAttribute("xyz")),q=wt(U.getAttribute("rpy"))):ae==="child"?A=w[U.getAttribute("link")]:ae==="parent"?F=w[U.getAttribute("link")]:ae==="limit"&&(C.limit.lower=parseFloat(U.getAttribute("lower")||C.limit.lower),C.limit.upper=parseFloat(U.getAttribute("upper")||C.limit.upper))}),F.add(C),C.add(A),an(C,q),C.position.set(x[0],x[1],x[2]);const D=j.filter(U=>U.nodeName.toLowerCase()==="axis")[0];if(D){const U=D.getAttribute("xyz").split(/\s+/g).map(ae=>parseFloat(ae));C.axis=new r.Vector3(U[0],U[1],U[2]),C.axis.normalize()}return C}function k(N,j,E,C=null){C===null&&(C=new r.URDFLink);const g=[...N.children];return C.name=N.getAttribute("name"),C.urdfName=C.name,C.urdfNode=N,d&&g.filter(A=>A.nodeName.toLowerCase()==="visual").forEach(A=>{const x=S(A,L);if(C.add(x),A.hasAttribute("name")){const q=A.getAttribute("name");x.name=q,x.urdfName=q,j[q]=x}}),_&&g.filter(A=>A.nodeName.toLowerCase()==="collision").forEach(A=>{const x=S(A);if(C.add(x),A.hasAttribute("name")){const q=A.getAttribute("name");x.name=q,x.urdfName=q,E[q]=x}}),C}function m(N){const j=[...N.children],E=new r.MeshPhongMaterial;return E.name=N.getAttribute("name")||"",j.forEach(C=>{const g=C.nodeName.toLowerCase();if(g==="color"){const F=C.getAttribute("rgba").split(/\s/g).map(A=>parseFloat(A));E.color.setRGB(F[0],F[1],F[2]),E.opacity=F[3],E.transparent=F[3]<1,E.depthWrite=!E.transparent}else if(g==="texture"){const F=C.getAttribute("filename");if(F){const A=new r.TextureLoader(p),x=R(F);E.map=A.load(x),E.map.colorSpace=r.SRGBColorSpace}}}),E}function S(N,j={}){const E=N.nodeName.toLowerCase()==="collision",C=[...N.children];let g=null;const F=C.filter(x=>x.nodeName.toLowerCase()==="material")[0];if(F){const x=F.getAttribute("name");x&&x in j?g=j[x]:g=m(F)}else g=new r.MeshPhongMaterial;const A=E?new r.URDFCollider:new r.URDFVisual;return A.urdfNode=N,C.forEach(x=>{const q=x.nodeName.toLowerCase();if(q==="geometry"){const D=x.children[0].nodeName.toLowerCase();if(D==="mesh"){const U=x.children[0].getAttribute("filename"),ae=R(U);if(ae!==null){const ce=x.children[0].getAttribute("scale");if(ce){const b=wt(ce);A.scale.set(b[0],b[1],b[2])}u(ae,p,(b,h)=>{h?console.error("URDFLoader: Error loading mesh.",h):b&&(b instanceof r.Mesh&&(b.material=g),b.position.set(0,0,0),b.quaternion.identity(),A.add(b))})}}else if(D==="box"){const U=new r.Mesh;U.geometry=new r.BoxGeometry(1,1,1),U.material=g;const ae=wt(x.children[0].getAttribute("size"));U.scale.set(ae[0],ae[1],ae[2]),A.add(U)}else if(D==="sphere"){const U=new r.Mesh;U.geometry=new r.SphereGeometry(1,30,30),U.material=g;const ae=parseFloat(x.children[0].getAttribute("radius"))||0;U.scale.set(ae,ae,ae),A.add(U)}else if(D==="cylinder"){const U=new r.Mesh;U.geometry=new r.CylinderGeometry(1,1,1,30),U.material=g;const ae=parseFloat(x.children[0].getAttribute("radius"))||0,ce=parseFloat(x.children[0].getAttribute("length"))||0;U.scale.set(ae,ce,ae),U.rotation.set(Math.PI/2,0,0),A.add(U)}}else if(q==="origin"){const D=wt(x.getAttribute("xyz")),U=wt(x.getAttribute("rpy"));A.position.set(D[0],D[1],D[2]),A.rotation.set(0,0,0),an(A,U)}}),A}return V(o)}defaultMeshLoader(o,l,c){/\.stl$/i.test(o)?new Nt(l).load(o,d=>{const _=new r.Mesh(d,new r.MeshPhongMaterial);c(_)}):/\.dae$/i.test(o)?new po(l).load(o,d=>c(d.scene)):console.warn(`URDFLoader: Could not load model at ${o}.
9
- No loader available`)}}function mo(M,o,l,c,u){const d=async V=>{try{const T=await Rt.downloadAvatarApi({url:V});if(T.status!==200)throw new Error(`下载失败: ${T.status}`);return T.data}catch(T){throw console.error("addModelFromUrl失败:",T),T}},_=V=>new Promise((T,B)=>{const k=new FileReader;k.onload=m=>{try{const S=m.target.result,j=new Lt().parse(S);j.preload(),T(j)}catch(S){B(S)}},k.onerror=()=>{B(new Error("MTL文件读取失败"))},k.readAsText(V)}),p=async V=>{const T={materials:{},create:function(B){return this.materials[B]?this.materials[B]:(console.warn(`Material '${B}' not found, using default material`),new r.MeshPhongMaterial({color:8947848,side:r.DoubleSide}))},getAsArray:function(){const B=[];for(const k in this.materials)B.push(this.materials[k]);return B},preload:function(){for(const B in this.materials)this.materials[B].map&&(this.materials[B].map.needsUpdate=!0)}};for(const B of V){const k=await _(B);Object.assign(T.materials,k.materials)}return T.preload(),T},w=async(V,T=[])=>new Promise((B,k)=>{const m=new FileReader;m.onload=async S=>{try{const N=S.target.result;let j=null;T&&T.length>0&&(T.length===1?j=await _(T[0]):j=await p(T));const E=new Pt;j&&E.setMaterials(j);const C=E.parse(N);j||C.traverse(g=>{g.isMesh&&(g.material=new r.MeshPhongMaterial({color:8947848,side:r.DoubleSide}))}),B(C)}catch(N){k(N)}},m.onerror=()=>{k(new Error("OBJ文件读取失败"))},m.readAsText(V)}),y=async V=>{var T;try{l.value=!0;const{scene:B}=M();if(!B)throw new Error("Scene not initialized");u();const k=[];for(let m=0;m<V.length;m++){const S=V[m];c.value=`正在加载模型 ${m+1}/${V.length}...`;const N=await d(S.objUrl),j=((T=S.objUrl)==null?void 0:T.split("/").pop())||`model_${m}.obj`,E=new File([N],j,{type:N.type});let C=[];if(S.mtlUrls){const F=Array.isArray(S.mtlUrls)?S.mtlUrls:[S.mtlUrls];for(let A=0;A<F.length;A++){const x=F[A],q=await d(x),D=(x==null?void 0:x.split("/").pop())||`material_${m}_${A}.mtl`,U=new File([q],D,{type:q.type});C.push(U)}}const g=await w(E,C);B.add(g),o.value.push(g),k.push(g)}return l.value=!1,k}catch(B){throw console.error("加载模型失败:",B),l.value=!1,B}},L=async(V,T,B=[],k=[])=>{let m;const S=V.toLowerCase();switch(S){case".txt":case".cpt":case".obj":const N=await T.text();if(S===".txt"||S===".cpt"){const ce=/^(?!.*\bf\b)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?$/gm,h=[...N.matchAll(ce)].map(J=>({x:parseFloat(J[1]),y:parseFloat(J[2]),z:parseFloat(J[3])})),I=new r.BufferGeometry,H=h.flatMap(J=>[J.x,J.y,J.z]);if(I.setAttribute("position",new r.Float32BufferAttribute(H,3)),S===".txt"){const J=new r.PointsMaterial({color:"#5B5C99",size:1,sizeAttenuation:!1});m=new r.Points(I,J)}else if(S===".cpt"){const J=new r.LineBasicMaterial({color:"#5B5C99",linewidth:100});m=new r.Line(I,J)}}else if(S===".obj"){const ce=new Pt;if(B&&B.length>0){const b=new Lt;for(const h of B){const I=await h.text(),H=b.parse(I);H.preload(),ce.setMaterials(H);break}}m=ce.parse(N),(!B||B.length===0)&&m.traverse(b=>{b.isMesh&&(b.material=new r.MeshPhongMaterial({color:"#B3B3D4"})),b instanceof r.Mesh&&(b.material.side=r.DoubleSide)})}break;case".stl":const j=await T.arrayBuffer(),C=new Nt().parse(j),g=new r.MeshPhongMaterial({color:"#B3B3D4",side:r.DoubleSide});m=new r.Mesh(C,g);break;case".urdf":const F=await T.text(),A=new fo,x=new Map;k.forEach(ce=>{x.set(ce.name,ce.blob)}),A.loadMeshCb=async(ce,b,h,I,H)=>{const J=ce.split("/").pop(),ne=x.get(J);if(!ne){H(new Error(`找不到文件: ${J}`));return}const se=J.split(".").pop().toLowerCase();switch(se){case"stl":const O=await ne.arrayBuffer(),W=new Nt(b).parse(O),Y=new r.Mesh(W,new r.MeshPhongMaterial);h(Y);break;case"obj":const G=await ne.text(),X=new Pt(b),ue=J.replace(".obj",".mtl"),pe=x.get(ue);if(pe){const Se=await pe.text(),De=new Lt(b).parse(Se);De.preload(),X.setMaterials(De)}const le=X.parse(G);h(le);break;default:H(new Error(`不支持的文件格式: ${se}`))}},m=A.parse(F);break;case".nc":const q=["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"],D={"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)"},U=new r.Group,ae=q.map(ce=>new Promise((b,h)=>{new Nt().load(`/model/${ce}`,H=>{const J=new r.MeshPhongMaterial({color:D[ce]||"#B3B3D4",side:r.DoubleSide}),ne=new r.Mesh(H,J);b(ne)},void 0,h)}));try{(await Promise.all(ae)).forEach(b=>U.add(b)),m=U}catch(ce){throw console.error("加载NC文件对应的STL文件失败:",ce),new Error("无法加载.NC文件对应的STL文件")}break;default:throw new Error(`不支持的文件格式: ${V}`)}return m};return{addModelsFromUrls:y,loadModelByDefaultPath:async V=>{console.log(V);try{l.value=!0,c.value="正在加载模型...";const{scene:T}=M();if(!T)throw new Error("Scene not initialized");u(),await new Promise(k=>setTimeout(k,100));const B=[];for(let k=0;k<V.length;k++){const m=V[k],S=await L(m.suffix,m.blob,m.mtlBlobs||[],m.meshFiles||[]);T.add(S),o.value.push(S),B.push(S)}return l.value=!1,c.value="",B}catch(T){throw console.error("加载模型失败:",T),l.value=!1,c.value="",T}}}}const go={class:"obj-viewer-container"},bo={class:"floating-controls"},yo=["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"},No={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Eo={key:0,class:"clipping-panel"},To={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),c=e.ref(!1),u=e.ref(""),d=e.ref(!1),_=e.ref(!1),{currentModels:p,initialCameraPosition:w,initialTargetPosition:y,initThreeJS:L,handleResize:R,fitCameraToAllModels:V,getThreeJSObjects:T,clearAllModels:B,cleanup:k}=oo(l),{isAnimating:m,toggleAnimation:S,stopAnimation:N}=so(T,p),{isClipping:j,activeClippingAxis:E,toggleClipping:C,updateClippingPlanes:g}=io(T,p),{addModelsFromUrls:F,loadModelByDefaultPath:A}=mo(T,p,c,u,B),x=()=>{if(_.value||p.value.length===0)return;_.value=!0,m.value&&N();const{camera:b,controls:h}=T();if(!b||!h)return;h.enabled=!0;const I=K=>K<.5?4*K*K*K:1-Math.pow(-2*K+2,3)/2,H=b.position.clone(),J=h.target.clone(),ne=1500,se=Date.now(),O=()=>{const K=Date.now()-se,W=Math.min(K/ne,1),Y=I(W);b.position.lerpVectors(H,w.value,Y),h.target.lerpVectors(J,y.value,Y),W<1?requestAnimationFrame(O):_.value=!1};O()},q=()=>{document.fullscreenElement?document.exitFullscreen().then(()=>{d.value=!1,e.nextTick(()=>{R()})}).catch(b=>{console.error("无法退出全屏:",b)}):l.value.requestFullscreen().then(()=>{d.value=!0,e.nextTick(()=>{R()})}).catch(b=>{console.error("无法进入全屏:",b)})},D=()=>{d.value=!!document.fullscreenElement,d.value||e.nextTick(()=>{R()})},U=async(b,h)=>{try{m.value&&N(),j.value&&C();const I=await h(b);return V(),I}catch(I){throw console.error("加载模型失败:",I),I}},ae=async b=>U(b,F),ce=async b=>U(b,A);return e.onMounted(async()=>{await e.nextTick(),L(),window.addEventListener("resize",R),document.addEventListener("fullscreenchange",D)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",R),document.removeEventListener("fullscreenchange",D),m.value&&N(),k()}),o({addModelsFromUrls:ae,loadModelByDefaultPath:ce}),(b,h)=>(e.openBlock(),e.createElementBlock("div",go,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:l,class:"threejs-container"},null,512),e.createElementVNode("div",bo,[e.createElementVNode("button",{onClick:x,class:e.normalizeClass(["control-btn","reset-btn"]),disabled:c.value||e.unref(p).length===0||_.value,title:"重置"},h[10]||(h[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,yo),e.createElementVNode("button",{onClick:h[0]||(h[0]=(...I)=>e.unref(S)&&e.unref(S)(...I)),class:e.normalizeClass(["control-btn","animation-btn",{active:e.unref(m)}]),disabled:c.value||e.unref(p).length===0,title:e.unref(m)?"停止动画":"动画视图"},[e.unref(m)?(e.openBlock(),e.createElementBlock("svg",ko,h[12]||(h[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,h[11]||(h[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:h[1]||(h[1]=(...I)=>e.unref(C)&&e.unref(C)(...I)),class:e.normalizeClass(["control-btn","clipping-btn",{active:e.unref(j)}]),disabled:c.value||e.unref(p).length===0,title:"剖面视图"},h[13]||(h[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:q,class:e.normalizeClass(["control-btn","fullscreen-btn"]),title:d.value?"退出全屏":"全屏"},[d.value?(e.openBlock(),e.createElementBlock("svg",No,h[15]||(h[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,h[14]||(h[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(j)?(e.openBlock(),e.createElementBlock("div",Eo,[e.createElementVNode("div",To,[e.createElementVNode("div",Ao,[e.createElementVNode("label",Mo,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":h[2]||(h[2]=I=>e.isRef(E)?E.value=I:null),onChange:h[3]||(h[3]=(...I)=>e.unref(g)&&e.unref(g)(...I))},null,544),[[e.vModelRadio,e.unref(E)]]),h[16]||(h[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":h[4]||(h[4]=I=>e.isRef(E)?E.value=I:null),onChange:h[5]||(h[5]=(...I)=>e.unref(g)&&e.unref(g)(...I))},null,544),[[e.vModelRadio,e.unref(E)]]),h[17]||(h[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":h[6]||(h[6]=I=>e.isRef(E)?E.value=I:null),onChange:h[7]||(h[7]=(...I)=>e.unref(g)&&e.unref(g)(...I))},null,544),[[e.vModelRadio,e.unref(E)]]),h[18]||(h[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":h[8]||(h[8]=I=>e.isRef(E)?E.value=I:null),onChange:h[9]||(h[9]=(...I)=>e.unref(g)&&e.unref(g)(...I))},null,544),[[e.vModelRadio,e.unref(E)]]),h[19]||(h[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("div",Vo,[h[20]||(h[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(u.value),1)])):e.createCommentVNode("",!0)]))}},Ro=dt._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,c=e.ref([]),u=o;e.onMounted(()=>{c.value=l==null?void 0:l.breadArray}),e.watch(()=>l==null?void 0:l.breadArray,()=>{c.value=l==null?void 0:l.breadArray},{deep:!0,immediate:!0});const d=_=>{u("click",_)};return(_,p)=>(e.openBlock(),e.createElementBlock("div",Do,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(w,y)=>{var L;return e.openBlock(),e.createElementBlock("div",{key:y,class:"bread-item"},[e.createElementVNode("div",{class:"bread-title",onClick:R=>d(w),style:e.normalizeStyle({opacity:((L=c.value)==null?void 0:L.length)-1===y?"0.7":"1"})},e.toDisplayString(w.value),13,Fo),y!==c.value.length-1&&Array.isArray(c.value)?(e.openBlock(),e.createElementBlock("div",jo,e.toDisplayString("/"))):e.createCommentVNode("",!0)])}),128))]))}},dn=dt._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=rn.useLoginState(),{loginUserInfo:c,cryptoInfo:u}=ye.storeToRefs(l);e.onMounted(()=>{ln.ElNotification({title:"温馨提示:",type:"success",message:"欢迎使用系统",duration:1e3})});const d=r.useModelComp(Ie.pinia);r.useFormToTableComp(Ie.pinia),e.ref(!0);const _=ye.useMenuState();e.ref(!0);const{itemData:p,isEdit:w,isRefreshCurStructure:y,curStructureCompIds:L}=ye.storeToRefs(d),R=r.useUnit(Ie.pinia),{activeMenuPath:V,menus:T,importLoading:B}=ye.storeToRefs(_),{selectIndex:k,selectTitle:m}=ye.storeToRefs(R);return e.ref([]),e.ref(!1),(S,N)=>{const j=e.resolveComponent("el-aside"),E=e.resolveComponent("el-button"),C=e.resolveComponent("el-avatar"),g=e.resolveComponent("el-header"),F=e.resolveComponent("router-view"),A=e.resolveComponent("el-main"),x=e.resolveComponent("el-container"),q=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createBlock(x,{"element-loading-text":"正在加载页面数据..."},{default:e.withCtx(()=>[e.unref(w)==="view"?(e.openBlock(),e.createBlock(j,{key:0,width:"250px"},{default:e.withCtx(()=>[e.createVNode(Bt.default,{mode:"vertical"})]),_:1})):e.createCommentVNode("",!0),e.createVNode(x,null,{default:e.withCtx(()=>[e.createVNode(g,null,{default:e.withCtx(()=>{var D;return[e.createElementVNode("div",Io,[e.createElementVNode("div",Uo,[e.unref(w)==="edit"?(e.openBlock(),e.createElementBlock("div",zo,[e.createVNode(E,{text:"",onClick:e.unref(de.onBack)},{default:e.withCtx(()=>N[2]||(N[2]=[e.createTextVNode(" 返回页面 ")])),_:1,__:[2]},8,["onClick"]),e.createVNode(E,{text:"",onClick:N[0]||(N[0]=U=>{var ae,ce;return e.unref(de.clickSavePage)((ce=(ae=e.unref(m))==null?void 0:ae.map(b=>b.value))==null?void 0:ce.join("/"))})},{icon:e.withCtx(()=>[e.createVNode(et.SvgIcon,{name:"Store"})]),default:e.withCtx(()=>[N[3]||(N[3]=e.createTextVNode(" 保存页面 "))]),_:1,__:[3]})])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(dn,{key:e.unref(m),breadArray:e.unref(m),onClick:e.unref(de.onClick)},null,8,["breadArray","onClick"]))]),e.createElementVNode("div",Go,[e.unref(w)==="view"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"select-icon",onClick:N[1]||(N[1]=(...U)=>e.unref(de.onSelectFixContent)&&e.unref(de.onSelectFixContent)(...U))},[e.createElementVNode("div",qo,[e.createVNode(et.SvgIcon,{name:"write",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}})]),N[4]||(N[4]=e.createElementVNode("div",{class:"layout-trigger"},e.toDisplayString("修改布局"),-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",Ho,[e.renderSlot(S.$slots,"default",{},void 0,!0)]),e.createVNode(C,{size:35,src:(D=e.unref(c))==null?void 0:D.avatarUrl},{default:e.withCtx(()=>{var U;return[e.createTextVNode(e.toDisplayString(((U=e.unref(c))==null?void 0:U.account)??"未知"),1)]}),_:1},8,["src"])])])]}),_:3}),e.createVNode(A,null,{default:e.withCtx(()=>{var D,U,ae,ce;return[e.unref(w)==="edit"?(e.openBlock(),e.createElementBlock("div",$o,[e.createElementVNode("div",Yo,[e.createVNode(Ke.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:S.innerWidth},[e.createVNode(Ke.modelShow)])),e.createElementVNode("div",Ko,[e.createVNode(Ke.modelFill)])])):S.$route.path==="/"&&((D=e.unref(de.showItems))==null?void 0:D.length)>0&&e.unref(w)==="view"?(e.openBlock(),e.createElementBlock("div",Wo,[e.createElementVNode("div",Zo,[(U=e.unref(ct.cloneDeep)(e.unref(de.showItems)))!=null&&U.find(b=>b.comp==="FormTop")?(e.openBlock(),e.createElementBlock("div",{class:"show-header",key:S.index},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((ae=e.unref(ct.cloneDeep)(e.unref(de.showItems)))==null?void 0:ae.filter(b=>b.comp==="FormTop"),(b,h)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:h},[e.createElementVNode("div",Jo,e.toDisplayString(b.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(de.getComponents)(b.comp)),{itemData:b==null?void 0:b.compData,childItemData:b==null?void 0:b.itemChildData,key:(b==null?void 0:b.id)??h,onChange:e.unref(de.onChange),index:(b==null?void 0:b.id)??h,onContentChange:e.unref(de.onContentChange),onPageChange:e.unref(de.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(ct.cloneDeep)(e.unref(de.showItems)))==null?void 0:ce.filter(b=>b.comp!=="FormTop"),(b,h)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:h},[e.createElementVNode("div",Qo,e.toDisplayString(b.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(de.getComponents)(b.comp)),{itemData:b==null?void 0:b.compData,childItemData:b==null?void 0:b.itemChildData,key:(b==null?void 0:b.id)??h,onChange:e.unref(de.onChange),index:(b==null?void 0:b.id)??h,onContentChange:e.unref(de.onContentChange),onPageChange:e.unref(de.onPageChange)},null,40,["itemData","childItemData","onChange","index","onContentChange","onPageChange"]))]))),128))])])])):e.unref(w)==="view"?(e.openBlock(),e.createElementBlock("div",es,[e.createVNode(F)])):e.createCommentVNode("",!0)]}),_:1})]),_:3})]),_:3})),[[q,e.unref(B)]])}}},ns=dt._export_sfc(ts,[["__scopeId","data-v-d2611062"]]);function os(M,o,l,c,u,d){const _=e.resolveComponent("svg-icon"),p=e.resolveComponent("ssMenu");return e.openBlock(),e.createBlock(p,{mode:M.mode,menuList:M.renderMenuList,onClickMenu:M.clickMenu,onOpenMenu:M.openMenu,onCloseMenu:M.closeMenu},{title:e.withCtx(({menu:w})=>[e.createVNode(_,{name:w.icon??"Fold",class:"menu-icon"},null,8,["name"]),e.createElementVNode("span",null,e.toDisplayString(w.title??""),1)]),_:1},8,["mode","menuList","onClickMenu","onOpenMenu","onCloseMenu"])}const ss=dt._export_sfc(de._sfc_main,[["render",os],["__scopeId","data-v-e003bdbb"]]),Me=[{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"},bs={class:"client-main-content"},ys={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(Ie.pinia),l=e.ref(0),c=e.ref(!1),{selectTitle:u}=ye.storeToRefs(o),d=e.ref(!1),_=r.useTableComp(Ie.pinia),{tableShowThree:p}=ye.storeToRefs(_),w=rn.useLoginState(),{loginUserInfo:y}=ye.storeToRefs(w),L=r.useModelComp(Ie.pinia),{isEdit:R}=ye.storeToRefs(L),V=ye.useMenuState(Ie.pinia),T=Un.useFormComp(Ie.pinia),{objUrl:B,blobUrls:k}=ye.storeToRefs(T),m=e.ref(null),S=e.ref(!0),{importLoading:N,activeMenuPath:j,platName:E}=ye.storeToRefs(V),C=e.ref(!1);e.watch(()=>j.value,async b=>{b&&(C.value=!0)},{immediate:!0});const g=async b=>{var H,J,ne,se,O,K,W;const h=(H=b==null?void 0:b.split("/"))==null?void 0:H[0],I=await ye.getInsofDataApi({key:{type:"mainEquip",systemKey:sessionStorage.getItem("systemKey"),pageKey:h}});return((J=I==null?void 0:I.data)==null?void 0:J.type)==="success"?((W=(K=(O=(se=(ne=I==null?void 0:I.data)==null?void 0:ne.result)==null?void 0:se[0])==null?void 0:O.value)==null?void 0:K.tableData)==null?void 0:W.隐藏三维显示)!==!0:!0};e.watch(()=>de.showItems.value,()=>{var b,h,I;((b=de.showItems.value)==null?void 0:b.length)===2&&((h=de.showItems.value)!=null&&h.find(H=>(H==null?void 0:H.name)==="输入"))&&((I=de.showItems.value)!=null&&I.find(H=>(H==null?void 0:H.name)==="输出"))?d.value=!0:d.value=!1},{deep:!0,immediate:!0}),e.watch(()=>j.value,async()=>{j.value&&(S.value=await g(j.value))},{deep:!0,immediate:!0}),e.watch(()=>[B.value,m.value],()=>{var b;((b=B.value)==null?void 0:b.length)>0&&m.value&&m.value.addModelsFromUrls(B.value)},{immediate:!0,deep:!0}),e.watch(()=>k==null?void 0:k.value,async()=>{var b,h,I,H,J;if(k!=null&&k.value&&((b=k==null?void 0:k.value)==null?void 0:b.length)>0&&!((h=de.showItems.value)!=null&&h.find(ne=>(ne==null?void 0:ne.name)==="输入")&&((I=de.showItems.value)!=null&&I.find(ne=>(ne==null?void 0:ne.name)==="输出")))){console.log(232,k==null?void 0:k.value);let ne=[];const se=await((J=(H=ct.cloneDeep(k==null?void 0:k.value).split("undefined,"))==null?void 0:H[1])==null?void 0:J.map(async O=>{var G,X,ue,pe,le,Se,Pe,De,tt,nt,We,Ze,ot,Ne,ut;let K,W,Y=(G=O==null?void 0:O.blob)==null?void 0:G.split(",");if((Y==null?void 0:Y.length)>1){let Ue=await(Y==null?void 0:Y.map(async _e=>{var Fe,ht,ve,Je,st,it;K=await ye.axios.get(_e,{responseType:"blob",headers:{"Content-Type":"application/json"}});let he=[];if(((Fe=O==null?void 0:O.mtlBlobs)==null?void 0:Fe.length)>0){let pt=await((ht=O==null?void 0:O.mtlBlobs)==null?void 0:ht.map(async ft=>{let at=await ye.axios.get(ft,{responseType:"blob",headers:{"Content-Type":"application/json"}});return he.push(new Blob([at.data],{type:"application/octet-stream;charset=UTF-8"})),at}));await Promise.all(pt)}return((Je=_e==null?void 0:_e.split("."))==null?void 0:Je[((ve=_e==null?void 0:_e.split("."))==null?void 0:ve.length)-1])!=="undefined"&&ne.push({suffix:"."+((it=_e==null?void 0:_e.split("."))==null?void 0:it[((st=_e==null?void 0:_e.split("."))==null?void 0:st.length)-1]),blob:new Blob([K.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:he}),K}));await Promise.all(Ue)}else if(!((X=O==null?void 0:O.blob)!=null&&X.includes("https://"))&&!((ue=O==null?void 0:O.blob)!=null&&ue.includes("http://"))){K=await Rt.downloadAvatarApi({url:O==null?void 0:O.blob});let Ue=[];if(((pe=O==null?void 0:O.mtlBlobs)==null?void 0:pe.length)>0){let _e=await((le=O==null?void 0:O.mtlBlobs)==null?void 0:le.map(async he=>{let Fe=await Rt.downloadAvatarApi({url:he});return Ue.push(new Blob([Fe.data],{type:"application/octet-stream;charset=UTF-8"})),Fe}));await Promise.all(_e)}W={suffix:"."+((tt=(Se=O==null?void 0:O.blob)==null?void 0:Se.split("."))==null?void 0:tt[((De=(Pe=O==null?void 0:O.blob)==null?void 0:Pe.split("."))==null?void 0:De.length)-1]),blob:new Blob([K.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:Ue}}else{K=await ye.axios.get(O==null?void 0:O.blob,{responseType:"blob",headers:{"Content-Type":"application/json"}});let Ue=[];if(((nt=O==null?void 0:O.mtlBlobs)==null?void 0:nt.length)>0){let _e=await((We=O==null?void 0:O.mtlBlobs)==null?void 0:We.map(async he=>{let Fe=await ye.axios.get(he,{responseType:"blob",headers:{"Content-Type":"application/json"}});return Ue.push(new Blob([Fe.data],{type:"application/octet-stream;charset=UTF-8"})),Fe}));await Promise.all(_e)}W={suffix:"."+((ut=(Ze=O==null?void 0:O.blob)==null?void 0:Ze.split("."))==null?void 0:ut[((Ne=(ot=O==null?void 0:O.blob)==null?void 0:ot.split("."))==null?void 0:Ne.length)-1]),blob:new Blob([K.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:Ue}}console.log(2321,W),W&&ne.push(W)}));await Promise.all(se),m.value.loadModelByDefaultPath(ne)}},{immediate:!0,deep:!0}),e.watch(()=>p.value,async()=>{var h,I,H,J;if(p.value!==""&&p.value){let ne=(h=j.value)==null?void 0:h.split("/"),se=ne[(ne==null?void 0:ne.length)-2];const K=(((I=Me==null?void 0:Me.find(X=>(X==null?void 0:X.key)===se))==null?void 0:I.download)??"")+"/"+p.value,W=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),Y=await ye.axios.post(K,null,{responseType:"blob",headers:{Authorization:W,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var b=new Blob([Y.data],{type:"application/octet-stream;charset=UTF-8"});const G=[{suffix:"."+((J=(H=p.value)==null?void 0:H.split("."))==null?void 0:J[1]),blob:b,mtlBlobs:[]}];m.value.loadModelByDefaultPath(G)}},{deep:!0,immediate:!0});const F=async()=>{var O,K,W,Y,G,X,ue,pe,le,Se,Pe,De,tt,nt,We,Ze,ot;c.value=!0;let b=(O=j.value)==null?void 0:O.split("/"),h=b[(b==null?void 0:b.length)-2];const I=((K=Me==null?void 0:Me.find(Ne=>(Ne==null?void 0:Ne.key)===h))==null?void 0:K.value)??"";let H="";const J=await ye.axios.post("http://139.196.154.85:20024/api/sysAuth/login",{account:"superadmin",password:"9bf00809059adc7f57bd290bf73ddf4d16f4c83b5937e2d68144ab0bd60d045d22d70afeed8f2fa071cda536e1fac0daf12b8e63dd870c3ca8b308f23be6e693bb32ebd3d013116dc8338d6854b1332701a522a7c43706a6db4162fbe991c8c08aa842fbbc34",codeId:0,code:""});((W=J==null?void 0:J.data)==null?void 0:W.code)===200&&(H=`Bearer ${(G=(Y=J.data)==null?void 0:Y.result)==null?void 0:G.accessToken}`,sessionStorage.setItem("magicToken",H));const ne=H===""?"123456":H,se=await ye.axios.post(I,null,{headers:{Authorization:ne,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if(((X=se==null?void 0:se.data)==null?void 0:X.type)==="success"&&r.IsJson((pe=(ue=se==null?void 0:se.data)==null?void 0:ue.result)==null?void 0:pe.result)){const Ne=(tt=(De=(Pe=JSON.parse((Se=(le=se==null?void 0:se.data)==null?void 0:le.result)==null?void 0:Se.result))==null?void 0:Pe.lines_file_paths)==null?void 0:De[0])==null?void 0:tt.split("\\"),Ue=(((nt=Me==null?void 0:Me.find(he=>(he==null?void 0:he.key)===h))==null?void 0:nt.resources)??"")+"/"+(((Ne==null?void 0:Ne[(Ne==null?void 0:Ne.length)-2])==="inputResources"?"outputResources":Ne==null?void 0:Ne[(Ne==null?void 0:Ne.length)-2])??"outputResources"),_e=await ye.axios.post(Ue,null,{headers:{Authorization:ne,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if(((We=_e==null?void 0:_e.data)==null?void 0:We.type)==="success"){const he=(Ze=_e==null?void 0:_e.data)==null?void 0:Ze.result,Fe=de.showItems.value,ht=await((ot=ct.cloneDeep(Fe))==null?void 0:ot.map(async ve=>{var Je,st,it,pt,ft,at;if((ve==null?void 0:ve.name)==="输出"){if((ve==null?void 0:ve.comp)==="Table")ve.compData=(Je=ve==null?void 0:ve.compData)==null?void 0:Je.map(ge=>{var Ce,je;return(ge==null?void 0:ge.key)==="tableContents"&&(ge.contents=(je=(Ce=ge==null?void 0:ge.contents)==null?void 0:Ce.map(Ae=>(Ae=Ae==null?void 0:Ae.map((ke,Be)=>{var qe,He,Ge;return typeof ke=="string"&&Be>1?((qe=ge==null?void 0:ge.contents)==null?void 0:qe.length)>1?ke=((He=he==null?void 0:he[Be-1])!=null&&He.includes("input")?ke:he==null?void 0:he[Be-1])??ke:ke=he==null?void 0:he[0]:ke=((Ge=he==null?void 0:he[Be-1])!=null&&Ge.includes("input")?ke:he==null?void 0:he[Be-1])??ke,ke}),Ae)))==null?void 0:je.filter((Ae,ke)=>ke<=(he==null?void 0:he.length)-1)),ge});else if((ve==null?void 0:ve.comp)==="Form"){let ge="";if(he==null||he.forEach(Ce=>{ge=ge===""?ge+Ce:ge+","+Ce}),ve.compData=(st=ve==null?void 0:ve.compData)==null?void 0:st.map(Ce=>{var je;return(Ce==null?void 0:Ce.key)==="formContent"&&(Ce.contents=(je=Ce.contents)==null?void 0:je.map(Ae=>(Ae.value=ge,Ae))),Ce}),(it=ge==null?void 0:ge.split(","))!=null&&it.find(Ce=>Ce.includes(".obj"))){let Ce={};Ce.suffix=".obj";const je=[];let Ae=await((ft=(pt=ge==null?void 0:ge.split(","))==null?void 0:pt.filter(ke=>ke.includes(".obj")||ke.includes(".mtl")))==null?void 0:ft.map(async ke=>{var qe,He;if(ke.includes(".obj")){const rt=(((qe=Me==null?void 0:Me.find($e=>($e==null?void 0:$e.key)===h))==null?void 0:qe.download)??"")+"/"+ke,Xe=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),Qe=await ye.axios.post(rt,null,{responseType:"blob",headers:{Authorization:Xe,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var Be=new Blob([Qe.data],{type:"application/octet-stream;charset=UTF-8"});Ce.blob=Be}else if(ke.includes(".mtl")){const rt=(((He=Me==null?void 0:Me.find(mt=>(mt==null?void 0:mt.key)===h))==null?void 0:He.download)??"")+"/"+ke,Xe=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),Qe=await ye.axios.post(rt,null,{responseType:"blob",headers:{Authorization:Xe,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var Be=new Blob([Qe.data],{type:"application/octet-stream;charset=UTF-8"});je.push(Be)}}));await Promise.all(Ae),Ce.mtlBlobs=je,m.value.loadModelByDefaultPath([Ce])}else{const Ce=[];let je=await((at=ge==null?void 0:ge.split(","))==null?void 0:at.map(async Ae=>{var Xe,Qe;let ke={};ke.suffix="."+((Xe=Ae==null?void 0:Ae.split("."))==null?void 0:Xe[1]);const qe=(((Qe=Me==null?void 0:Me.find($e=>($e==null?void 0:$e.key)===h))==null?void 0:Qe.download)??"")+"/"+Ae,He=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),Ge=await ye.axios.post(qe,null,{responseType:"blob",headers:{Authorization:He,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var rt=new Blob([Ge.data],{type:"application/octet-stream;charset=UTF-8"});ke.blob=rt,Ce.push(ke)}));await Promise.all(je),m.value.loadModelByDefaultPath(Ce)}}}return ve}));de.showItems.value=await Promise.all(ht)}}l.value++,c.value=!1},A=e.ref(""),x=e.ref("open"),q=e.ref("open"),D=e.ref(!1),U=()=>{const b=document.getElementById("menuCollapse");x.value==="open"?(b.style.width="18.75rem",b.style.height="96%",b.style.overflow="auto"):(b.style.width="50px",b.style.height="50px",b.style.overflow="hidden")},ae=()=>{const b=document.getElementById("operateCollapse");q.value==="open"?(b.style.width="25rem",b.style.height="96%",b.style.overflow="auto"):(b.style.width="50px",b.style.height="50px",b.style.overflow="hidden")},ce=()=>{D.value=!D.value;const b=document.getElementById("operateCollapse"),h=document.getElementById("menuCollapse");D.value?(h.style.width="18.75rem",b.style.width="calc(100% - 24rem)"):b.style.width="400px"};return(b,h)=>{const I=e.resolveComponent("el-button"),H=e.resolveComponent("el-avatar"),J=e.resolveComponent("el-header"),ne=e.resolveComponent("el-container"),se=e.resolveComponent("el-icon"),O=e.resolveComponent("el-input"),K=e.resolveComponent("el-aside"),W=e.resolveComponent("el-collapse-item"),Y=e.resolveComponent("el-collapse"),G=e.resolveComponent("el-main"),X=e.resolveComponent("router-view"),ue=e.resolveDirective("loading");return e.unref(R)==="edit"?(e.openBlock(),e.createBlock(ne,{key:0,class:"client-container"},{default:e.withCtx(()=>[e.createVNode(J,{class:"client-structure-header"},{default:e.withCtx(()=>{var pe;return[e.createElementVNode("div",is,[e.createVNode(I,{class:"select-icon",onClick:e.unref(de.onBack)},{default:e.withCtx(()=>h[6]||(h[6]=[e.createTextVNode(" 返回页面 ")])),_:1,__:[6]},8,["onClick"]),e.createVNode(I,{class:"select-icon",onClick:h[0]||(h[0]=le=>{var Se,Pe;return e.unref(de.clickSavePage)((Pe=(Se=e.unref(u))==null?void 0:Se.map(De=>De.value))==null?void 0:Pe.join("/"))})},{icon:e.withCtx(()=>[e.createVNode(et.SvgIcon,{name:"Store"})]),default:e.withCtx(()=>[h[7]||(h[7]=e.createTextVNode(" 保存页面 "))]),_:1,__:[7]})]),e.createElementVNode("div",as,[(e.openBlock(),e.createBlock(dn,{key:e.unref(u),breadArray:e.unref(u),onClick:e.unref(de.onClick)},null,8,["breadArray","onClick"]))]),e.createElementVNode("div",rs,[e.createElementVNode("div",ls,[e.renderSlot(b.$slots,"default",{},void 0,!0)]),e.createVNode(H,{size:35,src:(pe=e.unref(y))==null?void 0:pe.avatarUrl},{default:e.withCtx(()=>{var le;return[e.createTextVNode(e.toDisplayString(((le=e.unref(y))==null?void 0:le.account)??"未知"),1)]}),_:1},8,["src"])])]}),_:3}),e.unref(R)==="edit"?(e.openBlock(),e.createBlock(ne,{key:0,class:"model-operate",style:{"margin-top":"10px",height:"0px"}},{default:e.withCtx(()=>[e.createElementVNode("div",cs,[e.createVNode(Ke.modelSelect)]),e.createElementVNode("div",ds,[e.createVNode(Ke.modelShow)]),e.createElementVNode("div",us,[e.createVNode(Ke.modelFill)])]),_:1})):e.createCommentVNode("",!0)]),_:3})):e.withDirectives((e.openBlock(),e.createBlock(ne,{key:1,class:"client-container","element-loading-text":"正在加载页面数据..."},{default:e.withCtx(()=>[e.createVNode(J,{class:"client-header"},{default:e.withCtx(()=>{var pe;return[e.createElementVNode("div",hs,[e.createVNode(et.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(E)===""?"CPMPIP":e.unref(E)),1)]),e.createElementVNode("div",ps,[e.createVNode(ss,{mode:"horizontal"})]),e.createElementVNode("div",fs,[e.createVNode(O,{modelValue:A.value,"onUpdate:modelValue":h[1]||(h[1]=le=>A.value=le),clearable:"",placeholder:"搜索",style:{width:"130px"}},{prefix:e.withCtx(()=>[e.createVNode(se,{class:"el-input__icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(ln.search_default))]),_:1})]),_:1},8,["modelValue"]),e.unref(R)==="view"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"select-icon",onClick:h[2]||(h[2]=(...le)=>e.unref(de.onSelectFixContent)&&e.unref(de.onSelectFixContent)(...le))},[e.createElementVNode("div",ms,[e.createVNode(et.SvgIcon,{name:"write",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}})]),h[8]||(h[8]=e.createElementVNode("div",{class:"layout-trigger"},e.toDisplayString("修改布局"),-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",gs,[e.renderSlot(b.$slots,"default",{},void 0,!0)]),e.createVNode(H,{size:35,src:(pe=e.unref(y))==null?void 0:pe.avatarUrl},{default:e.withCtx(()=>{var le;return[e.createTextVNode(e.toDisplayString(((le=e.unref(y))==null?void 0:le.account)??"未知"),1)]}),_:1},8,["src"])])]}),_:3}),e.createVNode(ne,{class:"client-body"},{default:e.withCtx(()=>[b.$route.path==="/"?(e.openBlock(),e.createBlock(G,{key:0,class:"client-main"},{default:e.withCtx(()=>[e.createVNode(Y,{modelValue:x.value,"onUpdate:modelValue":h[3]||(h[3]=pe=>x.value=pe),accordion:"",class:"client-aside",id:"menuCollapse",onChange:U},{default:e.withCtx(()=>[e.createVNode(W,{name:"open"},{icon:e.withCtx(()=>[e.createVNode(et.SvgIcon,{name:x.value===""?"Right":"Left",style:{width:"20px",height:"20px"}},null,8,["name"])]),default:e.withCtx(()=>[e.createVNode(K,{style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(Bt.default,{mode:"vertical"})]),_:1})]),_:1})]),_:1},8,["modelValue"]),e.createElementVNode("div",bs,[e.createVNode(Ro,{isShow:C.value,windowConfig:M.windowConfig,ref_key:"threeModelRef",ref:m},null,8,["isShow","windowConfig"])]),e.createVNode(Y,{modelValue:q.value,"onUpdate:modelValue":h[5]||(h[5]=pe=>q.value=pe),accordion:"",class:"client-main-operate",id:"operateCollapse",onChange:ae},{default:e.withCtx(()=>[e.createVNode(W,{name:"open"},{icon:e.withCtx(()=>[e.createVNode(et.SvgIcon,{name:q.value==="open"?"Right":"Left",style:{width:"20px",height:"20px"}},null,8,["name"])]),default:e.withCtx(()=>{var pe;return[e.createElementVNode("div",null,[e.createVNode(et.SvgIcon,{class:"fold-icon",name:D.value?"Right":"Left",onClick:ce},null,8,["name"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((pe=e.unref(ct.cloneDeep)(e.unref(de.showItems)))==null?void 0:pe.filter(le=>le.comp!=="FormTop"),(le,Se)=>{var Pe;return e.openBlock(),e.createElementBlock("div",{class:"item-view-content",key:Se},[((Pe=le==null?void 0:le.comp)==null?void 0:Pe.toUpperCase())!=="TABLE"?(e.openBlock(),e.createElementBlock("div",ys,e.toDisplayString(le.name),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(de.getComponents)(le.comp)),{compName:le.name,itemData:le==null?void 0:le.compData,childItemData:le==null?void 0:le.itemChildData,key:(le==null?void 0:le.id)??Se,onChange:e.unref(de.onChange),index:(le==null?void 0:le.id)??Se,onContentChange:e.unref(de.onContentChange),onPageChange:e.unref(de.onPageChange)},null,40,["compName","itemData","childItemData","onChange","index","onContentChange","onPageChange"]))])}),128)),d.value?(e.openBlock(),e.createElementBlock("div",ws,[e.createVNode(zn._sfc_main,{class:"calculator-content",onClickTrigger:h[4]||(h[4]=le=>F()),loading:c.value,modelValue:"调用方法"},null,8,["loading"])])):e.createCommentVNode("",!0)])]}),_:1})]),_:1},8,["modelValue"])]),_:1})):(e.openBlock(),e.createBlock(G,{key:1,class:"client-router"},{default:e.withCtx(()=>[e.createElementVNode("div",_s,[e.createVNode(K,{width:"300px"},{default:e.withCtx(()=>[e.createVNode(Bt.default,{mode:"vertical"})]),_:1})]),e.createVNode(G,{class:"router-main"},{default:e.withCtx(()=>[e.createVNode(X)]),_:1})]),_:1}))]),_:1})]),_:3})),[[ue,e.unref(N)]])}}}),Cs=dt._export_sfc(ks,[["__scopeId","data-v-300798c7"]]),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(Ie.pinia),l=r.useUnit(Ie.pinia),c=ye.useMenuState();e.ref(!1);const u=e.ref(!0),d=M;return e.onMounted(()=>{}),e.watch(()=>[d==null?void 0:d.content,d==null?void 0:d.jsonContents],async()=>{var w,y,L,R;if(((w=d==null?void 0:d.jsonContents)==null?void 0:w.length)>0){o.setOriginalData(d==null?void 0:d.jsonContents);return}if(!(d!=null&&d.content)||((y=d==null?void 0:d.content)==null?void 0:y.length)===0)return;u.value=!0,c.setImportLoading(!0);let _=[],p=[];l.setSelectTitle([]),l.setSelectIndex(""),l.setSelectMenu(""),(R=(L=d==null?void 0:d.content)==null?void 0:L.filter(V=>V!==""))==null||R.forEach(V=>{lt.isExpandStringToJson(V)?p.push(lt.expandStringToJson(V)):lt.expandNewStringToJson(V)?p.push(lt.expandNewStringToJson(V)):lt.expandContentStringToJson(V)?p.push(lt.expandContentStringToJson(V)):p.push(de.expandToNewContents(V))}),_=p==null?void 0:p[0],await de.savePageDataAsync(_),await r.loadingSystemType(),o.setOriginalData(_),c.setImportLoading(!1)},{deep:!0,immediate:!0}),(_,p)=>(e.openBlock(),e.createElementBlock("div",vs,[M.platform==="browser"?(e.openBlock(),e.createBlock(ns,{key:0},{default:e.withCtx(()=>[e.renderSlot(_.$slots,"default",{},void 0,!0)]),_:3})):(e.openBlock(),e.createBlock(Cs,{key:1,windowConfig:M.windowConfig},{default:e.withCtx(()=>[e.renderSlot(_.$slots,"default",{},void 0,!0)]),_:3},8,["windowConfig"]))]))}},Ns=dt._export_sfc(xs,[["__scopeId","data-v-65a44ad9"]]),Es={class:"add-model-content"},Ts={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,c=o,u=e.ref([]),d=e.ref([]),_=e.ref([]),p=e.ref(0),w=r.useModelComp(Ie.pinia),y=ye.useMenuState(Ie.pinia),{itemData:L,originalData:R}=ye.storeToRefs(w),{activeMenuPath:V,platform:T}=ye.storeToRefs(y),B=e.ref(null),k=e.ref(0),m=e.ref([]);e.ref("");const S=e.ref(0),N=g=>{c("contentChange",g)},j=g=>{var A;const F=(A=ct.cloneDeep(g==null?void 0:g.wholeValue))==null?void 0:A.map(x=>{var q;return(x==null?void 0:x.comp)==="Form"&&(x.compData=(q=x.compData)==null?void 0:q.map(D=>((D==null?void 0:D.key)==="formContent"&&(D.contents=lt.arrayToNumberArray(D==null?void 0:D.contents)),D))),x});c("change",{originalContents:R.value,currentContents:g==null?void 0:g.wholeValue,editContent:g==null?void 0:g.editValue,arrayToContents:F})};e.watch(()=>d.value,()=>{S.value===d.value.length&&d.value.length!==0&&(u.value=d.value)},{deep:!0,immediate:!0});const E=()=>{B.value.click()},C=async g=>{const F=g.target.files;if(!F)return;new FileReader,u.value=[],d.value=[],S.value=F.length;const A=Array.from(F).map(async x=>await new Promise(q=>{const D=new FileReader;D.onload=U=>{try{d.value.push(U.target.result),k.value++}catch(ae){console.error("解析失败:",ae);return}},D.onerror=()=>q(`读取 ${x.name} 失败`),D.readAsText(x),g.target.value="",B.value=null}));await Promise.all(A)};return e.watch(()=>[l==null?void 0:l.content,l==null?void 0:l.jsonContents],async()=>{await r.loadingSystemType(),u.value=l.content,_.value=l==null?void 0:l.jsonContents},{deep:!0,immediate:!0}),e.watch(()=>k.value,()=>{var g;((g=m.value)==null?void 0:g.length)!==0&&(w.setOriginalData(m.value),w.setItemData(m.value))},{deep:!0,immediate:!0}),(g,F)=>{const A=e.resolveComponent("svg-icon");return e.openBlock(),e.createElementBlock("div",Es,[(l==null?void 0:l.mode)==="edit"?(e.openBlock(),e.createElementBlock("div",Ts,[e.createElementVNode("div",As,[e.createVNode(Ke.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:p.value},[e.createVNode(Ke.modelShow)])),e.createElementVNode("div",Ms,[e.createVNode(Ke.modelFill)])])):e.createCommentVNode("",!0),(l==null?void 0:l.mode)==="view"?(e.openBlock(),e.createElementBlock("div",Ss,[(e.openBlock(),e.createBlock(Ns,{platform:e.unref(T),content:u.value,onChange:j,jsonContents:_.value,onContentChange:N,key:p.value},{default:e.withCtx(()=>{var x;return[((x=l==null?void 0:l.jsonContents)==null?void 0:x.length)===0&&(l!=null&&l.showButton)?(e.openBlock(),e.createElementBlock("div",Ps,[e.createElementVNode("div",{class:"import-button",onClick:E},[e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:B,accept:".txt, .inm",onChange:C,style:{display:"none"},multiple:""},null,544),e.createVNode(A,{name:"import",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}}),F[0]||(F[0]=e.createElementVNode("div",{class:"import-trigger"},e.toDisplayString("导入模型"),-1))])])):e.createCommentVNode("",!0)]}),_:1},8,["platform","content","jsonContents"]))])):e.createCommentVNode("",!0)])}}},Vs=dt._export_sfc(Ls,[["__scopeId","data-v-4bf164f6"]]);exports.default=Vs;