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