ss-component-new 1.1.821 → 1.1.822
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/{OrbitControls-D6pgin7s.js → OrbitControls-Cm4Xs_Bq.js} +1 -1
- package/dist/{OrbitControls-Ff5ikkUQ.cjs → OrbitControls-D-XDZGf-.cjs} +1 -1
- package/dist/{STLLoader-BNh7D2zV.cjs → STLLoader-BxpEhvEg.cjs} +161 -161
- package/dist/{STLLoader-LGKv5i3H.js → STLLoader-DofhZbOw.js} +522 -593
- package/dist/{array-D1hKYLwI.cjs → array-Bfmx0w6P.cjs} +2 -2
- package/dist/{array-C60T9pDZ.js → array-DbAuNWGt.js} +1 -1
- package/dist/{iconfont-v9CcCMwF.js → iconfont-DQodgJo8.js} +73 -75
- package/dist/iconfont-Di4uXnX1.cjs +1 -0
- package/dist/icons/svg/editTable.svg +1 -1
- package/dist/icons/svg/export.svg +1 -0
- package/dist/icons/svg/model.svg +1 -0
- package/dist/icons/svg/three.svg +1 -0
- package/dist/index-1i-XlS2m.js +101 -0
- package/dist/{index-BdsJiFeW.cjs → index-6jSC3unU.cjs} +1 -1
- package/dist/{index-2kzGjuzu.js → index-6zbHinQ6.js} +10 -9
- package/dist/index-B-oe2x1V.cjs +109 -0
- package/dist/index-B-qent3l.cjs +1 -0
- package/dist/{index-CukZ8eDZ.js → index-BBo52W9F.js} +4 -4
- package/dist/index-BOev8isw.cjs +21 -0
- package/dist/index-BQgnYD51.js +6492 -0
- package/dist/{index-owcnOlVq.js → index-BYW-ix_Q.js} +5 -5
- package/dist/{index-4_M1SpeV.js → index-Bi1gr72d.js} +14 -14
- package/dist/{index-DnVaHi8q.js → index-BmHmnXS9.js} +7 -7
- package/dist/index-BoS30LXH.cjs +1 -0
- package/dist/index-BuBMi9JA.cjs +1 -0
- package/dist/{index-Zi9xLtwj.js → index-BvE05H-i.js} +2 -2
- package/dist/index-BwpOMKef.cjs +1 -0
- package/dist/index-C18ZPRC7.cjs +1 -0
- package/dist/{index-HVJSfh2g.js → index-CJx2DcDb.js} +21 -19
- package/dist/{index-B3cUSGXB.js → index-CL59qQ_W.js} +9 -8
- package/dist/{index-DDsJpzfR.js → index-CLdN0W98.js} +47 -47
- package/dist/index-CPP7L10q.cjs +1 -0
- package/dist/index-CSWIBSmo.cjs +1 -0
- package/dist/{index-DEobyz7r.js → index-CTgZZ96L.js} +6 -5
- package/dist/{index-WXpPDsev.js → index-CZ1ui4mT.js} +1 -1
- package/dist/index-CfQvGqaX.cjs +1 -0
- package/dist/index-CgJYAzeA.cjs +1 -0
- package/dist/index-ChtmIuBu.js +29771 -0
- package/dist/index-CjFcaJcL.cjs +1 -0
- package/dist/index-CjTmkzBO.js +24 -0
- package/dist/{index-Dtw4WkUo.cjs → index-CngO0AUc.cjs} +1 -1
- package/dist/index-CqCPdyGu.js +1248 -0
- package/dist/index-Cr6pWv0l.cjs +1 -0
- package/dist/{index-Cw95lvvp.js → index-D8Msszln.js} +223 -223
- package/dist/index-DDvUG6fk.js +22 -0
- package/dist/{index-CdMrhxHS.js → index-DMlIMlyC.js} +10 -10
- package/dist/{index-3Cdyqd1B.cjs → index-DOBeGYzT.cjs} +1 -1
- package/dist/index-DP0k43fj.cjs +1 -0
- package/dist/index-DTxccgVM.cjs +1 -0
- package/dist/{index-JAJeIBYE.cjs → index-DVAGljX0.cjs} +1 -1
- package/dist/{index-B5Vi6RBj.cjs → index-DVCrYVKw.cjs} +1 -1
- package/dist/{index-Dxoxm0Cc.js → index-DZWNGFC0.js} +22 -22
- package/dist/{index-CY2iphpd.cjs → index-DbniLh9G.cjs} +1 -1
- package/dist/index-Dj_ofPeK.cjs +1 -0
- package/dist/{index-DtogzZej.js → index-DocnYz5P.js} +1 -1
- package/dist/index-DrL7vroa.js +319 -0
- package/dist/index-Dt2McMki.js +13668 -0
- package/dist/{index-Cphx1eY1.js → index-Gba1Qfcc.js} +7 -8
- package/dist/{index-DMb9Vu-7.js → index-IUkCD4R_.js} +1 -1
- package/dist/{index-DAyzDsjs.js → index-K6BRW_Bw.js} +1 -1
- package/dist/{index-DzM8zZqe.js → index-OH9t-y2p.js} +4 -4
- package/dist/index-PNDdZKYG.cjs +1 -0
- package/dist/{index-Dn04IPFM.js → index-QETLKFyV.js} +10 -10
- package/dist/{index-BWHtpT9o.cjs → index-RgTvyK54.cjs} +1 -1
- package/dist/{index-Cuj-fGNO.cjs → index-VAIU8vMN.cjs} +1 -1
- package/dist/{index-CF_0RdqV.cjs → index-dukFqRog.cjs} +1 -1
- package/dist/{index-C9Boo2Cw.cjs → index-dyoOdMKX.cjs} +1 -1
- package/dist/index-f9bwREQl.cjs +1 -0
- package/dist/index-rPc9VS0S.cjs +1 -0
- package/dist/index-tPamnhR2.js +236 -0
- package/dist/{index-H3kf9EQv.js → index-tX2Hs05F.js} +11 -10
- package/dist/{index-DEU-pXeW.js → index-uvns6W6E.js} +1838 -1812
- package/dist/index-weauvEnW.cjs +4 -0
- package/dist/{index-B8xEed7C.cjs → index-wlnPb2aB.cjs} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-iyZtrhDf.js → index.vue_vue_type_script_setup_true_lang-C4G6mB7R.js} +28 -28
- package/dist/{index.vue_vue_type_script_setup_true_lang-CaYQQb8M.cjs → index.vue_vue_type_script_setup_true_lang-CWi4UVPF.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-qefZ9E5G.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CtN9Ij0Y.js} +53 -23
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CTcahF4Z.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-mQIxU0SD.cjs} +90 -90
- package/dist/{index.vue_vue_type_style_index_0_scoped_6bfd62db_lang-Cxjh1E1z.js → index.vue_vue_type_style_index_0_scoped_1966237d_lang-D3xcEtDT.js} +6488 -6474
- package/dist/{index.vue_vue_type_style_index_0_scoped_6bfd62db_lang-0eNHRdYw.cjs → index.vue_vue_type_style_index_0_scoped_1966237d_lang-DwIFJsxs.cjs} +14 -14
- package/dist/{index.vue_vue_type_style_index_0_scoped_86d2b6b8_lang-kymzIBO8.js → index.vue_vue_type_style_index_0_scoped_86d2b6b8_lang-D5CTJUDi.js} +17 -17
- package/dist/{index.vue_vue_type_style_index_0_scoped_86d2b6b8_lang-GlR2V0TC.cjs → index.vue_vue_type_style_index_0_scoped_86d2b6b8_lang-VPQBXOPW.cjs} +1 -1
- package/dist/index.vue_vue_type_style_index_1_lang-DraQDAAw.cjs +32 -0
- package/dist/index.vue_vue_type_style_index_1_lang-hffXwR3x.js +7028 -0
- package/dist/isUndefined-4Qg9wncf.js +84 -0
- package/dist/isUndefined-BEt4O79g.cjs +1 -0
- package/dist/{main-C6I42yaU.js → main-CBCk94h5.js} +30 -29
- package/dist/main-DO_PN7jt.cjs +1 -0
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +2 -2
- package/dist/ss-component.js +11 -11
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +12 -12
- package/dist/threeModel-GKSAzHfe.cjs +1 -0
- package/dist/{threeModel-BEt5OVCP.js → threeModel-RJwJMtfW.js} +91 -92
- package/dist/{threePreview-BUZRvBRx.js → threePreview-BSqdALPK.js} +3 -3
- package/dist/{threePreview-Dyzqu5s7.cjs → threePreview-CKvbwCiX.cjs} +1 -1
- package/dist/threeSceneView-BVbVe_Et.js +1277 -0
- package/dist/threeSceneView-KvCERteS.cjs +5 -0
- package/dist/{threeViewerHost-IhSFkCeD.js → threeViewerHost-AuhfL2Cn.js} +55 -57
- package/dist/threeViewerHost-D0pu5wk5.cjs +1 -0
- package/package.json +1 -1
- package/public/icons/svg/editTable.svg +1 -1
- package/public/icons/svg/export.svg +1 -0
- package/public/icons/svg/model.svg +1 -0
- package/public/icons/svg/three.svg +1 -0
- package/dist/animationData-B2T3Oamw.js +0 -108
- package/dist/animationData-Db_9HBoM.cjs +0 -1
- package/dist/iconfont-CZj6ltAs.cjs +0 -1
- package/dist/index-2KKrCkl8.cjs +0 -1
- package/dist/index-2OWkrGDh.js +0 -24
- package/dist/index-B1iXzkUF.cjs +0 -1
- package/dist/index-BBB4VObc.cjs +0 -11
- package/dist/index-BIVWMqJQ.cjs +0 -1
- package/dist/index-BWpZSzL1.cjs +0 -1
- package/dist/index-BllULnvx.cjs +0 -1
- package/dist/index-BvO1uTn0.js +0 -21
- package/dist/index-C2bI4adc.js +0 -8628
- package/dist/index-C9pN8_un.js +0 -548
- package/dist/index-CPdKWCSo.cjs +0 -1
- package/dist/index-CQfFbeTJ.cjs +0 -1
- package/dist/index-CZJOPfp5.js +0 -1152
- package/dist/index-Cb0q1Y5b.cjs +0 -1
- package/dist/index-Cfomm0G1.cjs +0 -109
- package/dist/index-CvvFU_QA.cjs +0 -1
- package/dist/index-DYMLmifU.cjs +0 -1
- package/dist/index-DfPyuGyq.js +0 -101
- package/dist/index-Dm2qfeUm.cjs +0 -1
- package/dist/index-DtX1F0sz.cjs +0 -4
- package/dist/index-Du3VUDcF.cjs +0 -1
- package/dist/index-VWNqRYy9.js +0 -36270
- package/dist/index-kmj8K3JX.cjs +0 -1
- package/dist/index-ndZw4AQJ.cjs +0 -1
- package/dist/index-y5FEcncv.cjs +0 -1
- package/dist/index.vue_vue_type_style_index_1_lang-Bmwy3cgo.cjs +0 -42
- package/dist/index.vue_vue_type_style_index_1_lang-Rs1M3B8e.js +0 -11984
- package/dist/main-2gDZp_zL.cjs +0 -1
- package/dist/threeModel-DgOcIXVI.cjs +0 -1
- package/dist/threeSceneView-BZx98QgN.js +0 -1450
- package/dist/threeSceneView-DSkGJN5d.cjs +0 -5
- package/dist/threeViewerHost-T_51aUg5.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("vue"),v=require("./iconfont-CZj6ltAs.cjs"),u=require("./STLLoader-BNh7D2zV.cjs"),V=require("./index-BBB4VObc.cjs"),Q=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function K(f,t){if(t===u.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),f;if(t===u.TriangleFanDrawMode||t===u.TriangleStripDrawMode){let e=f.getIndex();if(e===null){const r=[],a=f.getAttribute("position");if(a!==void 0){for(let o=0;o<a.count;o++)r.push(o);f.setIndex(r),e=f.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),f}const i=e.count-2,n=[];if(t===u.TriangleFanDrawMode)for(let r=1;r<=i;r++)n.push(e.getX(0)),n.push(e.getX(r)),n.push(e.getX(r+1));else for(let r=0;r<i;r++)r%2===0?(n.push(e.getX(r)),n.push(e.getX(r+1)),n.push(e.getX(r+2))):(n.push(e.getX(r+2)),n.push(e.getX(r+1)),n.push(e.getX(r)));n.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=f.clone();return s.setIndex(n),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),f}class Z extends u.Loader{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new re(e)}),this.register(function(e){return new ie(e)}),this.register(function(e){return new pe(e)}),this.register(function(e){return new me(e)}),this.register(function(e){return new ge(e)}),this.register(function(e){return new ae(e)}),this.register(function(e){return new ce(e)}),this.register(function(e){return new le(e)}),this.register(function(e){return new ue(e)}),this.register(function(e){return new se(e)}),this.register(function(e){return new de(e)}),this.register(function(e){return new oe(e)}),this.register(function(e){return new he(e)}),this.register(function(e){return new fe(e)}),this.register(function(e){return new te(e)}),this.register(function(e){return new Te(e)}),this.register(function(e){return new Re(e)})}load(t,e,i,n){const s=this;let r;if(this.resourcePath!=="")r=this.resourcePath;else if(this.path!==""){const c=u.LoaderUtils.extractUrlBase(t);r=u.LoaderUtils.resolveURL(c,this.path)}else r=u.LoaderUtils.extractUrlBase(t);this.manager.itemStart(t);const a=function(c){n?n(c):console.error(c),s.manager.itemError(t),s.manager.itemEnd(t)},o=new u.FileLoader(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(c){try{s.parse(c,r,function(d){e(d),s.manager.itemEnd(t)},a)}catch(d){a(d)}},i,a)}setDRACOLoader(t){return this.dracoLoader=t,this}setKTX2Loader(t){return this.ktx2Loader=t,this}setMeshoptDecoder(t){return this.meshoptDecoder=t,this}register(t){return this.pluginCallbacks.indexOf(t)===-1&&this.pluginCallbacks.push(t),this}unregister(t){return this.pluginCallbacks.indexOf(t)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1),this}parse(t,e,i,n){let s;const r={},a={},o=new TextDecoder;if(typeof t=="string")s=JSON.parse(t);else if(t instanceof ArrayBuffer)if(o.decode(new Uint8Array(t,0,4))===Y){try{r[L.KHR_BINARY_GLTF]=new xe(t)}catch(l){n&&n(l);return}s=JSON.parse(r[L.KHR_BINARY_GLTF].content)}else s=JSON.parse(o.decode(t));else s=t;if(s.asset===void 0||s.asset.version[0]<2){n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const c=new Oe(s,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let d=0;d<this.pluginCallbacks.length;d++){const l=this.pluginCallbacks[d](c);l.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[l.name]=l,r[l.name]=!0}if(s.extensionsUsed)for(let d=0;d<s.extensionsUsed.length;++d){const l=s.extensionsUsed[d],h=s.extensionsRequired||[];switch(l){case L.KHR_MATERIALS_UNLIT:r[l]=new ne;break;case L.KHR_DRACO_MESH_COMPRESSION:r[l]=new Ee(s,this.dracoLoader);break;case L.KHR_TEXTURE_TRANSFORM:r[l]=new Me;break;case L.KHR_MESH_QUANTIZATION:r[l]=new Le;break;default:h.indexOf(l)>=0&&a[l]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+l+'".')}}c.setExtensions(r),c.setPlugins(a),c.parse(i,n)}parseAsync(t,e){const i=this;return new Promise(function(n,s){i.parse(t,e,n,s)})}}function ee(){let f={};return{get:function(t){return f[t]},add:function(t,e){f[t]=e},remove:function(t){delete f[t]},removeAll:function(){f={}}}}const L={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class te{constructor(t){this.parser=t,this.name=L.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,e=this.parser.json.nodes||[];for(let i=0,n=e.length;i<n;i++){const s=e[i];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&t._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(t){const e=this.parser,i="light:"+t;let n=e.cache.get(i);if(n)return n;const s=e.json,o=((s.extensions&&s.extensions[this.name]||{}).lights||[])[t];let c;const d=new u.Color(16777215);o.color!==void 0&&d.setRGB(o.color[0],o.color[1],o.color[2],u.LinearSRGBColorSpace);const l=o.range!==void 0?o.range:0;switch(o.type){case"directional":c=new u.DirectionalLight(d),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new u.PointLight(d),c.distance=l;break;case"spot":c=new u.SpotLight(d),c.distance=l,o.spot=o.spot||{},o.spot.innerConeAngle=o.spot.innerConeAngle!==void 0?o.spot.innerConeAngle:0,o.spot.outerConeAngle=o.spot.outerConeAngle!==void 0?o.spot.outerConeAngle:Math.PI/4,c.angle=o.spot.outerConeAngle,c.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return c.position.set(0,0,0),O(c,o),o.intensity!==void 0&&(c.intensity=o.intensity),c.name=e.createUniqueName(o.name||"light_"+t),n=Promise.resolve(c),e.cache.add(i,n),n}getDependency(t,e){if(t==="light")return this._loadLight(e)}createNodeAttachment(t){const e=this,i=this.parser,s=i.json.nodes[t],a=(s.extensions&&s.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(o){return i._getNodeRef(e.cache,a,o)})}}class ne{constructor(){this.name=L.KHR_MATERIALS_UNLIT}getMaterialType(){return u.MeshBasicMaterial}extendParams(t,e,i){const n=[];t.color=new u.Color(1,1,1),t.opacity=1;const s=e.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const r=s.baseColorFactor;t.color.setRGB(r[0],r[1],r[2],u.LinearSRGBColorSpace),t.opacity=r[3]}s.baseColorTexture!==void 0&&n.push(i.assignTexture(t,"map",s.baseColorTexture,u.SRGBColorSpace))}return Promise.all(n)}}class se{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(t,e){const n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name].emissiveStrength;return s!==void 0&&(e.emissiveIntensity=s),Promise.resolve()}}class re{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_CLEARCOAT}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];if(r.clearcoatFactor!==void 0&&(e.clearcoat=r.clearcoatFactor),r.clearcoatTexture!==void 0&&s.push(i.assignTexture(e,"clearcoatMap",r.clearcoatTexture)),r.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=r.clearcoatRoughnessFactor),r.clearcoatRoughnessTexture!==void 0&&s.push(i.assignTexture(e,"clearcoatRoughnessMap",r.clearcoatRoughnessTexture)),r.clearcoatNormalTexture!==void 0&&(s.push(i.assignTexture(e,"clearcoatNormalMap",r.clearcoatNormalTexture)),r.clearcoatNormalTexture.scale!==void 0)){const a=r.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new u.Vector2(a,a)}return Promise.all(s)}}class ie{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_DISPERSION}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name];return e.dispersion=s.dispersion!==void 0?s.dispersion:0,Promise.resolve()}}class oe{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_IRIDESCENCE}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];return r.iridescenceFactor!==void 0&&(e.iridescence=r.iridescenceFactor),r.iridescenceTexture!==void 0&&s.push(i.assignTexture(e,"iridescenceMap",r.iridescenceTexture)),r.iridescenceIor!==void 0&&(e.iridescenceIOR=r.iridescenceIor),e.iridescenceThicknessRange===void 0&&(e.iridescenceThicknessRange=[100,400]),r.iridescenceThicknessMinimum!==void 0&&(e.iridescenceThicknessRange[0]=r.iridescenceThicknessMinimum),r.iridescenceThicknessMaximum!==void 0&&(e.iridescenceThicknessRange[1]=r.iridescenceThicknessMaximum),r.iridescenceThicknessTexture!==void 0&&s.push(i.assignTexture(e,"iridescenceThicknessMap",r.iridescenceThicknessTexture)),Promise.all(s)}}class ae{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_SHEEN}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[];e.sheenColor=new u.Color(0,0,0),e.sheenRoughness=0,e.sheen=1;const r=n.extensions[this.name];if(r.sheenColorFactor!==void 0){const a=r.sheenColorFactor;e.sheenColor.setRGB(a[0],a[1],a[2],u.LinearSRGBColorSpace)}return r.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=r.sheenRoughnessFactor),r.sheenColorTexture!==void 0&&s.push(i.assignTexture(e,"sheenColorMap",r.sheenColorTexture,u.SRGBColorSpace)),r.sheenRoughnessTexture!==void 0&&s.push(i.assignTexture(e,"sheenRoughnessMap",r.sheenRoughnessTexture)),Promise.all(s)}}class ce{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_TRANSMISSION}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];return r.transmissionFactor!==void 0&&(e.transmission=r.transmissionFactor),r.transmissionTexture!==void 0&&s.push(i.assignTexture(e,"transmissionMap",r.transmissionTexture)),Promise.all(s)}}class le{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_VOLUME}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];e.thickness=r.thicknessFactor!==void 0?r.thicknessFactor:0,r.thicknessTexture!==void 0&&s.push(i.assignTexture(e,"thicknessMap",r.thicknessTexture)),e.attenuationDistance=r.attenuationDistance||1/0;const a=r.attenuationColor||[1,1,1];return e.attenuationColor=new u.Color().setRGB(a[0],a[1],a[2],u.LinearSRGBColorSpace),Promise.all(s)}}class ue{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_IOR}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name];return e.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}}class de{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_SPECULAR}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];e.specularIntensity=r.specularFactor!==void 0?r.specularFactor:1,r.specularTexture!==void 0&&s.push(i.assignTexture(e,"specularIntensityMap",r.specularTexture));const a=r.specularColorFactor||[1,1,1];return e.specularColor=new u.Color().setRGB(a[0],a[1],a[2],u.LinearSRGBColorSpace),r.specularColorTexture!==void 0&&s.push(i.assignTexture(e,"specularColorMap",r.specularColorTexture,u.SRGBColorSpace)),Promise.all(s)}}class fe{constructor(t){this.parser=t,this.name=L.EXT_MATERIALS_BUMP}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];return e.bumpScale=r.bumpFactor!==void 0?r.bumpFactor:1,r.bumpTexture!==void 0&&s.push(i.assignTexture(e,"bumpMap",r.bumpTexture)),Promise.all(s)}}class he{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_ANISOTROPY}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];return r.anisotropyStrength!==void 0&&(e.anisotropy=r.anisotropyStrength),r.anisotropyRotation!==void 0&&(e.anisotropyRotation=r.anisotropyRotation),r.anisotropyTexture!==void 0&&s.push(i.assignTexture(e,"anisotropyMap",r.anisotropyTexture)),Promise.all(s)}}class pe{constructor(t){this.parser=t,this.name=L.KHR_TEXTURE_BASISU}loadTexture(t){const e=this.parser,i=e.json,n=i.textures[t];if(!n.extensions||!n.extensions[this.name])return null;const s=n.extensions[this.name],r=e.options.ktx2Loader;if(!r){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,s.source,r)}}class me{constructor(t){this.parser=t,this.name=L.EXT_TEXTURE_WEBP}loadTexture(t){const e=this.name,i=this.parser,n=i.json,s=n.textures[t];if(!s.extensions||!s.extensions[e])return null;const r=s.extensions[e],a=n.images[r.source];let o=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(o=c)}return i.loadTextureImage(t,r.source,o)}}class ge{constructor(t){this.parser=t,this.name=L.EXT_TEXTURE_AVIF}loadTexture(t){const e=this.name,i=this.parser,n=i.json,s=n.textures[t];if(!s.extensions||!s.extensions[e])return null;const r=s.extensions[e],a=n.images[r.source];let o=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(o=c)}return i.loadTextureImage(t,r.source,o)}}class Te{constructor(t){this.name=L.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){const e=this.parser.json,i=e.bufferViews[t];if(i.extensions&&i.extensions[this.name]){const n=i.extensions[this.name],s=this.parser.getDependency("buffer",n.buffer),r=this.parser.options.meshoptDecoder;if(!r||!r.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(a){const o=n.byteOffset||0,c=n.byteLength||0,d=n.count,l=n.byteStride,h=new Uint8Array(a,o,c);return r.decodeGltfBufferAsync?r.decodeGltfBufferAsync(d,l,h,n.mode,n.filter).then(function(m){return m.buffer}):r.ready.then(function(){const m=new ArrayBuffer(d*l);return r.decodeGltfBuffer(new Uint8Array(m),d,l,h,n.mode,n.filter),m})})}else return null}}class Re{constructor(t){this.name=L.EXT_MESH_GPU_INSTANCING,this.parser=t}createNodeMesh(t){const e=this.parser.json,i=e.nodes[t];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const n=e.meshes[i.mesh];for(const c of n.primitives)if(c.mode!==C.TRIANGLES&&c.mode!==C.TRIANGLE_STRIP&&c.mode!==C.TRIANGLE_FAN&&c.mode!==void 0)return null;const r=i.extensions[this.name].attributes,a=[],o={};for(const c in r)a.push(this.parser.getDependency("accessor",r[c]).then(d=>(o[c]=d,o[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(t)),Promise.all(a).then(c=>{const d=c.pop(),l=d.isGroup?d.children:[d],h=c[0].count,m=[];for(const g of l){const M=new u.Matrix4,T=new u.Vector3,x=new u.Quaternion,A=new u.Vector3(1,1,1),y=new u.InstancedMesh(g.geometry,g.material,h);for(let E=0;E<h;E++)o.TRANSLATION&&T.fromBufferAttribute(o.TRANSLATION,E),o.ROTATION&&x.fromBufferAttribute(o.ROTATION,E),o.SCALE&&A.fromBufferAttribute(o.SCALE,E),y.setMatrixAt(E,M.compose(T,x,A));for(const E in o)if(E==="_COLOR_0"){const _=o[E];y.instanceColor=new u.InstancedBufferAttribute(_.array,_.itemSize,_.normalized)}else E!=="TRANSLATION"&&E!=="ROTATION"&&E!=="SCALE"&&g.geometry.setAttribute(E,o[E]);u.Object3D.prototype.copy.call(y,g),this.parser.assignFinalMaterial(y),m.push(y)}return d.isGroup?(d.clear(),d.add(...m),d):m[0]}))}}const Y="glTF",D=12,X={JSON:1313821514,BIN:5130562};class xe{constructor(t){this.name=L.KHR_BINARY_GLTF,this.content=null,this.body=null;const e=new DataView(t,0,D),i=new TextDecoder;if(this.header={magic:i.decode(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==Y)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-D,s=new DataView(t,D);let r=0;for(;r<n;){const a=s.getUint32(r,!0);r+=4;const o=s.getUint32(r,!0);if(r+=4,o===X.JSON){const c=new Uint8Array(t,D+r,a);this.content=i.decode(c)}else if(o===X.BIN){const c=D+r;this.body=t.slice(c,c+a)}r+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Ee{constructor(t,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=L.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=e,this.dracoLoader.preload()}decodePrimitive(t,e){const i=this.json,n=this.dracoLoader,s=t.extensions[this.name].bufferView,r=t.extensions[this.name].attributes,a={},o={},c={};for(const d in r){const l=U[d]||d.toLowerCase();a[l]=r[d]}for(const d in t.attributes){const l=U[d]||d.toLowerCase();if(r[d]!==void 0){const h=i.accessors[t.attributes[d]],m=F[h.componentType];c[l]=m.name,o[l]=h.normalized===!0}}return e.getDependency("bufferView",s).then(function(d){return new Promise(function(l,h){n.decodeDracoFile(d,function(m){for(const g in m.attributes){const M=m.attributes[g],T=o[g];T!==void 0&&(M.normalized=T)}l(m)},a,c,u.LinearSRGBColorSpace,h)})})}}class Me{constructor(){this.name=L.KHR_TEXTURE_TRANSFORM}extendTexture(t,e){return(e.texCoord===void 0||e.texCoord===t.channel)&&e.offset===void 0&&e.rotation===void 0&&e.scale===void 0||(t=t.clone(),e.texCoord!==void 0&&(t.channel=e.texCoord),e.offset!==void 0&&t.offset.fromArray(e.offset),e.rotation!==void 0&&(t.rotation=e.rotation),e.scale!==void 0&&t.repeat.fromArray(e.scale),t.needsUpdate=!0),t}}class Le{constructor(){this.name=L.KHR_MESH_QUANTIZATION}}class $ extends u.Interpolant{constructor(t,e,i,n){super(t,e,i,n)}copySampleValue_(t){const e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,s=t*n*3+n;for(let r=0;r!==n;r++)e[r]=i[s+r];return e}interpolate_(t,e,i,n){const s=this.resultBuffer,r=this.sampleValues,a=this.valueSize,o=a*2,c=a*3,d=n-e,l=(i-e)/d,h=l*l,m=h*l,g=t*c,M=g-c,T=-2*m+3*h,x=m-h,A=1-T,y=x-h+l;for(let E=0;E!==a;E++){const _=r[M+E+a],N=r[M+E+o]*d,w=r[g+E+a],I=r[g+E]*d;s[E]=A*_+y*N+T*w+x*I}return s}}const Ae=new u.Quaternion;class _e extends ${interpolate_(t,e,i,n){const s=super.interpolate_(t,e,i,n);return Ae.fromArray(s).normalize().toArray(s),s}}const C={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},F={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},z={9728:u.NearestFilter,9729:u.LinearFilter,9984:u.NearestMipmapNearestFilter,9985:u.LinearMipmapNearestFilter,9986:u.NearestMipmapLinearFilter,9987:u.LinearMipmapLinearFilter},q={33071:u.ClampToEdgeWrapping,33648:u.MirroredRepeatWrapping,10497:u.RepeatWrapping},G={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},U={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},P={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Se={CUBICSPLINE:void 0,LINEAR:u.InterpolateLinear,STEP:u.InterpolateDiscrete},H={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function ye(f){return f.DefaultMaterial===void 0&&(f.DefaultMaterial=new u.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:u.FrontSide})),f.DefaultMaterial}function k(f,t,e){for(const i in e.extensions)f[i]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[i]=e.extensions[i])}function O(f,t){t.extras!==void 0&&(typeof t.extras=="object"?Object.assign(f.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function we(f,t,e){let i=!1,n=!1,s=!1;for(let c=0,d=t.length;c<d;c++){const l=t[c];if(l.POSITION!==void 0&&(i=!0),l.NORMAL!==void 0&&(n=!0),l.COLOR_0!==void 0&&(s=!0),i&&n&&s)break}if(!i&&!n&&!s)return Promise.resolve(f);const r=[],a=[],o=[];for(let c=0,d=t.length;c<d;c++){const l=t[c];if(i){const h=l.POSITION!==void 0?e.getDependency("accessor",l.POSITION):f.attributes.position;r.push(h)}if(n){const h=l.NORMAL!==void 0?e.getDependency("accessor",l.NORMAL):f.attributes.normal;a.push(h)}if(s){const h=l.COLOR_0!==void 0?e.getDependency("accessor",l.COLOR_0):f.attributes.color;o.push(h)}}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(o)]).then(function(c){const d=c[0],l=c[1],h=c[2];return i&&(f.morphAttributes.position=d),n&&(f.morphAttributes.normal=l),s&&(f.morphAttributes.color=h),f.morphTargetsRelative=!0,f})}function be(f,t){if(f.updateMorphTargets(),t.weights!==void 0)for(let e=0,i=t.weights.length;e<i;e++)f.morphTargetInfluences[e]=t.weights[e];if(t.extras&&Array.isArray(t.extras.targetNames)){const e=t.extras.targetNames;if(f.morphTargetInfluences.length===e.length){f.morphTargetDictionary={};for(let i=0,n=e.length;i<n;i++)f.morphTargetDictionary[e[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Ne(f){let t;const e=f.extensions&&f.extensions[L.KHR_DRACO_MESH_COMPRESSION];if(e?t="draco:"+e.bufferView+":"+e.indices+":"+B(e.attributes):t=f.indices+":"+B(f.attributes)+":"+f.mode,f.targets!==void 0)for(let i=0,n=f.targets.length;i<n;i++)t+=":"+B(f.targets[i]);return t}function B(f){let t="";const e=Object.keys(f).sort();for(let i=0,n=e.length;i<n;i++)t+=e[i]+":"+f[e[i]]+";";return t}function j(f){switch(f){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function Ce(f){return f.search(/\.jpe?g($|\?)/i)>0||f.search(/^data\:image\/jpeg/)===0?"image/jpeg":f.search(/\.webp($|\?)/i)>0||f.search(/^data\:image\/webp/)===0?"image/webp":f.search(/\.ktx2($|\?)/i)>0||f.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const Ie=new u.Matrix4;class Oe{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new ee,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,n=-1,s=!1,r=-1;if(typeof navigator<"u"){const a=navigator.userAgent;i=/^((?!chrome|android).)*safari/i.test(a)===!0;const o=a.match(/Version\/(\d+)/);n=i&&o?parseInt(o[1],10):-1,s=a.indexOf("Firefox")>-1,r=s?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&n<17||s&&r<98?this.textureLoader=new u.TextureLoader(this.options.manager):this.textureLoader=new u.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new u.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){const i=this,n=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(r){return r._markDefs&&r._markDefs()}),Promise.all(this._invokeAll(function(r){return r.beforeRoot&&r.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(r){const a={scene:r[0][n.scene||0],scenes:r[0],animations:r[1],cameras:r[2],asset:n.asset,parser:i,userData:{}};return k(s,a,n),O(a,n),Promise.all(i._invokeAll(function(o){return o.afterRoot&&o.afterRoot(a)})).then(function(){for(const o of a.scenes)o.updateMatrixWorld();t(a)})}).catch(e)}_markDefs(){const t=this.json.nodes||[],e=this.json.skins||[],i=this.json.meshes||[];for(let n=0,s=e.length;n<s;n++){const r=e[n].joints;for(let a=0,o=r.length;a<o;a++)t[r[a]].isBone=!0}for(let n=0,s=t.length;n<s;n++){const r=t[n];r.mesh!==void 0&&(this._addNodeRef(this.meshCache,r.mesh),r.skin!==void 0&&(i[r.mesh].isSkinnedMesh=!0)),r.camera!==void 0&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(t,e){e!==void 0&&(t.refs[e]===void 0&&(t.refs[e]=t.uses[e]=0),t.refs[e]++)}_getNodeRef(t,e,i){if(t.refs[e]<=1)return i;const n=i.clone(),s=(r,a)=>{const o=this.associations.get(r);o!=null&&this.associations.set(a,o);for(const[c,d]of r.children.entries())s(d,a.children[c])};return s(i,n),n.name+="_instance_"+t.uses[e]++,n}_invokeOne(t){const e=Object.values(this.plugins);e.push(this);for(let i=0;i<e.length;i++){const n=t(e[i]);if(n)return n}return null}_invokeAll(t){const e=Object.values(this.plugins);e.unshift(this);const i=[];for(let n=0;n<e.length;n++){const s=t(e[n]);s&&i.push(s)}return i}getDependency(t,e){const i=t+":"+e;let n=this.cache.get(i);if(!n){switch(t){case"scene":n=this.loadScene(e);break;case"node":n=this._invokeOne(function(s){return s.loadNode&&s.loadNode(e)});break;case"mesh":n=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(e)});break;case"accessor":n=this.loadAccessor(e);break;case"bufferView":n=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(e)});break;case"buffer":n=this.loadBuffer(e);break;case"material":n=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(e)});break;case"texture":n=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(e)});break;case"skin":n=this.loadSkin(e);break;case"animation":n=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(e)});break;case"camera":n=this.loadCamera(e);break;default:if(n=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(t,e)}),!n)throw new Error("Unknown type: "+t);break}this.cache.add(i,n)}return n}getDependencies(t){let e=this.cache.get(t);if(!e){const i=this,n=this.json[t+(t==="mesh"?"es":"s")]||[];e=Promise.all(n.map(function(s,r){return i.getDependency(t,r)})),this.cache.add(t,e)}return e}loadBuffer(t){const e=this.json.buffers[t],i=this.fileLoader;if(e.type&&e.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");if(e.uri===void 0&&t===0)return Promise.resolve(this.extensions[L.KHR_BINARY_GLTF].body);const n=this.options;return new Promise(function(s,r){i.load(u.LoaderUtils.resolveURL(e.uri,n.path),s,void 0,function(){r(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))})})}loadBufferView(t){const e=this.json.bufferViews[t];return this.getDependency("buffer",e.buffer).then(function(i){const n=e.byteLength||0,s=e.byteOffset||0;return i.slice(s,s+n)})}loadAccessor(t){const e=this,i=this.json,n=this.json.accessors[t];if(n.bufferView===void 0&&n.sparse===void 0){const r=G[n.type],a=F[n.componentType],o=n.normalized===!0,c=new a(n.count*r);return Promise.resolve(new u.BufferAttribute(c,r,o))}const s=[];return n.bufferView!==void 0?s.push(this.getDependency("bufferView",n.bufferView)):s.push(null),n.sparse!==void 0&&(s.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(s).then(function(r){const a=r[0],o=G[n.type],c=F[n.componentType],d=c.BYTES_PER_ELEMENT,l=d*o,h=n.byteOffset||0,m=n.bufferView!==void 0?i.bufferViews[n.bufferView].byteStride:void 0,g=n.normalized===!0;let M,T;if(m&&m!==l){const x=Math.floor(h/m),A="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+x+":"+n.count;let y=e.cache.get(A);y||(M=new c(a,x*m,n.count*m/d),y=new u.InterleavedBuffer(M,m/d),e.cache.add(A,y)),T=new u.InterleavedBufferAttribute(y,o,h%m/d,g)}else a===null?M=new c(n.count*o):M=new c(a,h,n.count*o),T=new u.BufferAttribute(M,o,g);if(n.sparse!==void 0){const x=G.SCALAR,A=F[n.sparse.indices.componentType],y=n.sparse.indices.byteOffset||0,E=n.sparse.values.byteOffset||0,_=new A(r[1],y,n.sparse.count*x),N=new c(r[2],E,n.sparse.count*o);a!==null&&(T=new u.BufferAttribute(T.array.slice(),T.itemSize,T.normalized)),T.normalized=!1;for(let w=0,I=_.length;w<I;w++){const S=_[w];if(T.setX(S,N[w*o]),o>=2&&T.setY(S,N[w*o+1]),o>=3&&T.setZ(S,N[w*o+2]),o>=4&&T.setW(S,N[w*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}T.normalized=g}return T})}loadTexture(t){const e=this.json,i=this.options,s=e.textures[t].source,r=e.images[s];let a=this.textureLoader;if(r.uri){const o=i.manager.getHandler(r.uri);o!==null&&(a=o)}return this.loadTextureImage(t,s,a)}loadTextureImage(t,e,i){const n=this,s=this.json,r=s.textures[t],a=s.images[e],o=(a.uri||a.bufferView)+":"+r.sampler;if(this.textureCache[o])return this.textureCache[o];const c=this.loadImageSource(e,i).then(function(d){d.flipY=!1,d.name=r.name||a.name||"",d.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(d.name=a.uri);const h=(s.samplers||{})[r.sampler]||{};return d.magFilter=z[h.magFilter]||u.LinearFilter,d.minFilter=z[h.minFilter]||u.LinearMipmapLinearFilter,d.wrapS=q[h.wrapS]||u.RepeatWrapping,d.wrapT=q[h.wrapT]||u.RepeatWrapping,d.generateMipmaps=!d.isCompressedTexture&&d.minFilter!==u.NearestFilter&&d.minFilter!==u.LinearFilter,n.associations.set(d,{textures:t}),d}).catch(function(){return null});return this.textureCache[o]=c,c}loadImageSource(t,e){const i=this,n=this.json,s=this.options;if(this.sourceCache[t]!==void 0)return this.sourceCache[t].then(l=>l.clone());const r=n.images[t],a=self.URL||self.webkitURL;let o=r.uri||"",c=!1;if(r.bufferView!==void 0)o=i.getDependency("bufferView",r.bufferView).then(function(l){c=!0;const h=new Blob([l],{type:r.mimeType});return o=a.createObjectURL(h),o});else if(r.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");const d=Promise.resolve(o).then(function(l){return new Promise(function(h,m){let g=h;e.isImageBitmapLoader===!0&&(g=function(M){const T=new u.Texture(M);T.needsUpdate=!0,h(T)}),e.load(u.LoaderUtils.resolveURL(l,s.path),g,void 0,m)})}).then(function(l){return c===!0&&a.revokeObjectURL(o),O(l,r),l.userData.mimeType=r.mimeType||Ce(r.uri),l}).catch(function(l){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),l});return this.sourceCache[t]=d,d}assignTexture(t,e,i,n){const s=this;return this.getDependency("texture",i.index).then(function(r){if(!r)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(r=r.clone(),r.channel=i.texCoord),s.extensions[L.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[L.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const o=s.associations.get(r);r=s.extensions[L.KHR_TEXTURE_TRANSFORM].extendTexture(r,a),s.associations.set(r,o)}}return n!==void 0&&(r.colorSpace=n),t[e]=r,r})}assignFinalMaterial(t){const e=t.geometry;let i=t.material;const n=e.attributes.tangent===void 0,s=e.attributes.color!==void 0,r=e.attributes.normal===void 0;if(t.isPoints){const a="PointsMaterial:"+i.uuid;let o=this.cache.get(a);o||(o=new u.PointsMaterial,u.Material.prototype.copy.call(o,i),o.color.copy(i.color),o.map=i.map,o.sizeAttenuation=!1,this.cache.add(a,o)),i=o}else if(t.isLine){const a="LineBasicMaterial:"+i.uuid;let o=this.cache.get(a);o||(o=new u.LineBasicMaterial,u.Material.prototype.copy.call(o,i),o.color.copy(i.color),o.map=i.map,this.cache.add(a,o)),i=o}if(n||s||r){let a="ClonedMaterial:"+i.uuid+":";n&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),r&&(a+="flat-shading:");let o=this.cache.get(a);o||(o=i.clone(),s&&(o.vertexColors=!0),r&&(o.flatShading=!0),n&&(o.normalScale&&(o.normalScale.y*=-1),o.clearcoatNormalScale&&(o.clearcoatNormalScale.y*=-1)),this.cache.add(a,o),this.associations.set(o,this.associations.get(i))),i=o}t.material=i}getMaterialType(){return u.MeshStandardMaterial}loadMaterial(t){const e=this,i=this.json,n=this.extensions,s=i.materials[t];let r;const a={},o=s.extensions||{},c=[];if(o[L.KHR_MATERIALS_UNLIT]){const l=n[L.KHR_MATERIALS_UNLIT];r=l.getMaterialType(),c.push(l.extendParams(a,s,e))}else{const l=s.pbrMetallicRoughness||{};if(a.color=new u.Color(1,1,1),a.opacity=1,Array.isArray(l.baseColorFactor)){const h=l.baseColorFactor;a.color.setRGB(h[0],h[1],h[2],u.LinearSRGBColorSpace),a.opacity=h[3]}l.baseColorTexture!==void 0&&c.push(e.assignTexture(a,"map",l.baseColorTexture,u.SRGBColorSpace)),a.metalness=l.metallicFactor!==void 0?l.metallicFactor:1,a.roughness=l.roughnessFactor!==void 0?l.roughnessFactor:1,l.metallicRoughnessTexture!==void 0&&(c.push(e.assignTexture(a,"metalnessMap",l.metallicRoughnessTexture)),c.push(e.assignTexture(a,"roughnessMap",l.metallicRoughnessTexture))),r=this._invokeOne(function(h){return h.getMaterialType&&h.getMaterialType(t)}),c.push(Promise.all(this._invokeAll(function(h){return h.extendMaterialParams&&h.extendMaterialParams(t,a)})))}s.doubleSided===!0&&(a.side=u.DoubleSide);const d=s.alphaMode||H.OPAQUE;if(d===H.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,d===H.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&r!==u.MeshBasicMaterial&&(c.push(e.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new u.Vector2(1,1),s.normalTexture.scale!==void 0)){const l=s.normalTexture.scale;a.normalScale.set(l,l)}if(s.occlusionTexture!==void 0&&r!==u.MeshBasicMaterial&&(c.push(e.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&r!==u.MeshBasicMaterial){const l=s.emissiveFactor;a.emissive=new u.Color().setRGB(l[0],l[1],l[2],u.LinearSRGBColorSpace)}return s.emissiveTexture!==void 0&&r!==u.MeshBasicMaterial&&c.push(e.assignTexture(a,"emissiveMap",s.emissiveTexture,u.SRGBColorSpace)),Promise.all(c).then(function(){const l=new r(a);return s.name&&(l.name=s.name),O(l,s),e.associations.set(l,{materials:t}),s.extensions&&k(n,l,s),l})}createUniqueName(t){const e=u.PropertyBinding.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){const e=this,i=this.extensions,n=this.primitiveCache;function s(a){return i[L.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,e).then(function(o){return W(o,a,e)})}const r=[];for(let a=0,o=t.length;a<o;a++){const c=t[a],d=Ne(c),l=n[d];if(l)r.push(l.promise);else{let h;c.extensions&&c.extensions[L.KHR_DRACO_MESH_COMPRESSION]?h=s(c):h=W(new u.BufferGeometry,c,e),n[d]={primitive:c,promise:h},r.push(h)}}return Promise.all(r)}loadMesh(t){const e=this,i=this.json,n=this.extensions,s=i.meshes[t],r=s.primitives,a=[];for(let o=0,c=r.length;o<c;o++){const d=r[o].material===void 0?ye(this.cache):this.getDependency("material",r[o].material);a.push(d)}return a.push(e.loadGeometries(r)),Promise.all(a).then(function(o){const c=o.slice(0,o.length-1),d=o[o.length-1],l=[];for(let m=0,g=d.length;m<g;m++){const M=d[m],T=r[m];let x;const A=c[m];if(T.mode===C.TRIANGLES||T.mode===C.TRIANGLE_STRIP||T.mode===C.TRIANGLE_FAN||T.mode===void 0)x=s.isSkinnedMesh===!0?new u.SkinnedMesh(M,A):new u.Mesh(M,A),x.isSkinnedMesh===!0&&x.normalizeSkinWeights(),T.mode===C.TRIANGLE_STRIP?x.geometry=K(x.geometry,u.TriangleStripDrawMode):T.mode===C.TRIANGLE_FAN&&(x.geometry=K(x.geometry,u.TriangleFanDrawMode));else if(T.mode===C.LINES)x=new u.LineSegments(M,A);else if(T.mode===C.LINE_STRIP)x=new u.Line(M,A);else if(T.mode===C.LINE_LOOP)x=new u.LineLoop(M,A);else if(T.mode===C.POINTS)x=new u.Points(M,A);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+T.mode);Object.keys(x.geometry.morphAttributes).length>0&&be(x,s),x.name=e.createUniqueName(s.name||"mesh_"+t),O(x,s),T.extensions&&k(n,x,T),e.assignFinalMaterial(x),l.push(x)}for(let m=0,g=l.length;m<g;m++)e.associations.set(l[m],{meshes:t,primitives:m});if(l.length===1)return s.extensions&&k(n,l[0],s),l[0];const h=new u.Group;s.extensions&&k(n,h,s),e.associations.set(h,{meshes:t});for(let m=0,g=l.length;m<g;m++)h.add(l[m]);return h})}loadCamera(t){let e;const i=this.json.cameras[t],n=i[i.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?e=new u.PerspectiveCamera(u.MathUtils.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):i.type==="orthographic"&&(e=new u.OrthographicCamera(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),i.name&&(e.name=this.createUniqueName(i.name)),O(e,i),Promise.resolve(e)}loadSkin(t){const e=this.json.skins[t],i=[];for(let n=0,s=e.joints.length;n<s;n++)i.push(this._loadNodeShallow(e.joints[n]));return e.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",e.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(n){const s=n.pop(),r=n,a=[],o=[];for(let c=0,d=r.length;c<d;c++){const l=r[c];if(l){a.push(l);const h=new u.Matrix4;s!==null&&h.fromArray(s.array,c*16),o.push(h)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',e.joints[c])}return new u.Skeleton(a,o)})}loadAnimation(t){const e=this.json,i=this,n=e.animations[t],s=n.name?n.name:"animation_"+t,r=[],a=[],o=[],c=[],d=[];for(let l=0,h=n.channels.length;l<h;l++){const m=n.channels[l],g=n.samplers[m.sampler],M=m.target,T=M.node,x=n.parameters!==void 0?n.parameters[g.input]:g.input,A=n.parameters!==void 0?n.parameters[g.output]:g.output;M.node!==void 0&&(r.push(this.getDependency("node",T)),a.push(this.getDependency("accessor",x)),o.push(this.getDependency("accessor",A)),c.push(g),d.push(M))}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(o),Promise.all(c),Promise.all(d)]).then(function(l){const h=l[0],m=l[1],g=l[2],M=l[3],T=l[4],x=[];for(let A=0,y=h.length;A<y;A++){const E=h[A],_=m[A],N=g[A],w=M[A],I=T[A];if(E===void 0)continue;E.updateMatrix&&E.updateMatrix();const S=i._createAnimationTracks(E,_,N,w,I);if(S)for(let R=0;R<S.length;R++)x.push(S[R])}return new u.AnimationClip(s,void 0,x)})}createNodeMesh(t){const e=this.json,i=this,n=e.nodes[t];return n.mesh===void 0?null:i.getDependency("mesh",n.mesh).then(function(s){const r=i._getNodeRef(i.meshCache,n.mesh,s);return n.weights!==void 0&&r.traverse(function(a){if(a.isMesh)for(let o=0,c=n.weights.length;o<c;o++)a.morphTargetInfluences[o]=n.weights[o]}),r})}loadNode(t){const e=this.json,i=this,n=e.nodes[t],s=i._loadNodeShallow(t),r=[],a=n.children||[];for(let c=0,d=a.length;c<d;c++)r.push(i.getDependency("node",a[c]));const o=n.skin===void 0?Promise.resolve(null):i.getDependency("skin",n.skin);return Promise.all([s,Promise.all(r),o]).then(function(c){const d=c[0],l=c[1],h=c[2];h!==null&&d.traverse(function(m){m.isSkinnedMesh&&m.bind(h,Ie)});for(let m=0,g=l.length;m<g;m++)d.add(l[m]);return d})}_loadNodeShallow(t){const e=this.json,i=this.extensions,n=this;if(this.nodeCache[t]!==void 0)return this.nodeCache[t];const s=e.nodes[t],r=s.name?n.createUniqueName(s.name):"",a=[],o=n._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(t)});return o&&a.push(o),s.camera!==void 0&&a.push(n.getDependency("camera",s.camera).then(function(c){return n._getNodeRef(n.cameraCache,s.camera,c)})),n._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(t)}).forEach(function(c){a.push(c)}),this.nodeCache[t]=Promise.all(a).then(function(c){let d;if(s.isBone===!0?d=new u.Bone:c.length>1?d=new u.Group:c.length===1?d=c[0]:d=new u.Object3D,d!==c[0])for(let l=0,h=c.length;l<h;l++)d.add(c[l]);if(s.name&&(d.userData.name=s.name,d.name=r),O(d,s),s.extensions&&k(i,d,s),s.matrix!==void 0){const l=new u.Matrix4;l.fromArray(s.matrix),d.applyMatrix4(l)}else s.translation!==void 0&&d.position.fromArray(s.translation),s.rotation!==void 0&&d.quaternion.fromArray(s.rotation),s.scale!==void 0&&d.scale.fromArray(s.scale);if(!n.associations.has(d))n.associations.set(d,{});else if(s.mesh!==void 0&&n.meshCache.refs[s.mesh]>1){const l=n.associations.get(d);n.associations.set(d,{...l})}return n.associations.get(d).nodes=t,d}),this.nodeCache[t]}loadScene(t){const e=this.extensions,i=this.json.scenes[t],n=this,s=new u.Group;i.name&&(s.name=n.createUniqueName(i.name)),O(s,i),i.extensions&&k(e,s,i);const r=i.nodes||[],a=[];for(let o=0,c=r.length;o<c;o++)a.push(n.getDependency("node",r[o]));return Promise.all(a).then(function(o){for(let d=0,l=o.length;d<l;d++)s.add(o[d]);const c=d=>{const l=new Map;for(const[h,m]of n.associations)(h instanceof u.Material||h instanceof u.Texture)&&l.set(h,m);return d.traverse(h=>{const m=n.associations.get(h);m!=null&&l.set(h,m)}),l};return n.associations=c(s),s})}_createAnimationTracks(t,e,i,n,s){const r=[],a=t.name?t.name:t.uuid,o=[];P[s.path]===P.weights?t.traverse(function(h){h.morphTargetInfluences&&o.push(h.name?h.name:h.uuid)}):o.push(a);let c;switch(P[s.path]){case P.weights:c=u.NumberKeyframeTrack;break;case P.rotation:c=u.QuaternionKeyframeTrack;break;case P.translation:case P.scale:c=u.VectorKeyframeTrack;break;default:switch(i.itemSize){case 1:c=u.NumberKeyframeTrack;break;case 2:case 3:default:c=u.VectorKeyframeTrack;break}break}const d=n.interpolation!==void 0?Se[n.interpolation]:u.InterpolateLinear,l=this._getArrayFromAccessor(i);for(let h=0,m=o.length;h<m;h++){const g=new c(o[h]+"."+P[s.path],e.array,l,d);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(g),r.push(g)}return r}_getArrayFromAccessor(t){let e=t.array;if(t.normalized){const i=j(e.constructor),n=new Float32Array(e.length);for(let s=0,r=e.length;s<r;s++)n[s]=e[s]*i;e=n}return e}_createCubicSplineTrackInterpolant(t){t.createInterpolant=function(i){const n=this instanceof u.QuaternionKeyframeTrack?_e:$;return new n(this.times,this.values,this.getValueSize()/3,i)},t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function ve(f,t,e){const i=t.attributes,n=new u.Box3;if(i.POSITION!==void 0){const a=e.json.accessors[i.POSITION],o=a.min,c=a.max;if(o!==void 0&&c!==void 0){if(n.set(new u.Vector3(o[0],o[1],o[2]),new u.Vector3(c[0],c[1],c[2])),a.normalized){const d=j(F[a.componentType]);n.min.multiplyScalar(d),n.max.multiplyScalar(d)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=t.targets;if(s!==void 0){const a=new u.Vector3,o=new u.Vector3;for(let c=0,d=s.length;c<d;c++){const l=s[c];if(l.POSITION!==void 0){const h=e.json.accessors[l.POSITION],m=h.min,g=h.max;if(m!==void 0&&g!==void 0){if(o.setX(Math.max(Math.abs(m[0]),Math.abs(g[0]))),o.setY(Math.max(Math.abs(m[1]),Math.abs(g[1]))),o.setZ(Math.max(Math.abs(m[2]),Math.abs(g[2]))),h.normalized){const M=j(F[h.componentType]);o.multiplyScalar(M)}a.max(o)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(a)}f.boundingBox=n;const r=new u.Sphere;n.getCenter(r.center),r.radius=n.min.distanceTo(n.max)/2,f.boundingSphere=r}function W(f,t,e){const i=t.attributes,n=[];function s(r,a){return e.getDependency("accessor",r).then(function(o){f.setAttribute(a,o)})}for(const r in i){const a=U[r]||r.toLowerCase();a in f.attributes||n.push(s(i[r],a))}if(t.indices!==void 0&&!f.index){const r=e.getDependency("accessor",t.indices).then(function(a){f.setIndex(a)});n.push(r)}return u.ColorManagement.workingColorSpace!==u.LinearSRGBColorSpace&&"COLOR_0"in i&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${u.ColorManagement.workingColorSpace}" not supported.`),O(f,t),ve(f,t,e),Promise.all(n).then(function(){return t.targets!==void 0?we(f,t.targets,e):f})}function Pe(){const f=p.ref(!1),t=p.ref(""),e=p.shallowRef([]),i=p.ref(null),n=new u.MTLLoader,s=new u.OBJLoader,r=new u.STLLoader,a=new Z;return{isLoading:f,loadingProgress:t,loadedModels:e,error:i,loadModelsFromBlobs:async c=>{var m;if(!c||c.length===0){console.warn("loadModelsFromBlobs 加载的文件数组为空!");return}f.value=!0,t.value="准备加载...",e.value=[],i.value=null;const d=new Map;c.forEach(g=>{g instanceof File&&d.set(g.name.toLowerCase(),g)});const l=[],h=[];try{for(const g of c){const M=g.name||"unknown_file",T=(m=M.split(".").pop())==null?void 0:m.toLowerCase();if(T==="mtl")continue;const x=URL.createObjectURL(g);l.push(x);let A=null;const y=E=>{const _=E.lengthComputable?E.loaded/E.total*100:0;t.value=`正在加载 ${M}... ${Math.round(_)}%`};switch(t.value=`正在加载 ${M}... 0%`,T){case"obj":const E=M.replace(/\.obj$/i,".mtl").toLowerCase();if(d.has(E)){const I=d.get(E),S=URL.createObjectURL(I);l.push(S);const R=await n.loadAsync(S);R.preload(),s.setMaterials(R)}else s.setMaterials(null);A=await s.loadAsync(x,y);break;case"stl":const _=await r.loadAsync(x,y),N=new u.MeshPhongMaterial({color:11184810,specular:1118481,shininess:200});A=new u.Mesh(_,N);break;case"gltf":case"glb":A=(await a.loadAsync(x,y)).scene;break;default:console.warn(`不支持的文件类型: .${T}`),t.value=`不支持的文件类型: ${M}`;continue}A&&(A.userData.boundingBox=new u.Box3().setFromObject(A),h.push(A))}e.value=h,t.value="加载完成!"}catch(g){throw console.error("加载模型时出错:",g),i.value=`加载失败: ${g.message||"未知错误"}`,t.value="加载失败!",e.value=[],g}finally{f.value=!1,l.forEach(g=>URL.revokeObjectURL(g))}}}}const ke={class:"obj-viewer-container"},Fe={class:"buttonGroup-topLeft"},De={class:"buttonGroup-left"},Ge={class:"left-panel"},He={class:"panel-header"},Be={key:0,class:"clipping-content"},Ue={class:"radio-group"},je={class:"radio-label"},Ve={class:"radio-label"},Ke={class:"radio-label"},Xe={class:"radio-label"},ze={key:0,class:"loading-overlay"},qe=p.defineComponent({__name:"threePreview",props:{fileBlobs:{default:()=>[]}},setup(f){const t=f,e=p.ref(null),i=p.ref(!1),n=p.ref(""),{currentModels:s,resetView:r,initThreeJS:a,handleResize:o,getThreeJSObjects:c,cleanup:d,setModels:l}=v.useThreeJS(e),{isLoading:h,loadingProgress:m,loadedModels:g,error:M,loadModelsFromBlobs:T}=Pe(),{isAnimating:x,toggleAnimation:A,stopAnimation:y}=v.useAnimation(c,s),{isClipping:E,activeClippingAxis:_,toggleClipping:N,updateClippingPlanes:w}=v.useClipping(c,s);p.watch(()=>t.fileBlobs,S=>{S&&S.length>0&&T(S).catch(R=>{console.error("加载错误:",R)})},{immediate:!0,deep:!0}),p.watch(g,S=>{S&&S.length>0&&l(S)}),p.watch(M,S=>{S&&V.ElMessage.error(`模型加载失败: ${S}`)});const I=S=>{i.value=!0,n.value=S,E.value||N()};return p.onMounted(async()=>{await p.nextTick();try{a(),window.addEventListener("resize",o)}catch(S){console.error("Three.js 初始化失败:",S),V.ElMessage.error("渲染引擎初始化失败!")}}),p.onBeforeUnmount(()=>{n.value="",window.removeEventListener("resize",o),x.value&&y(),d()}),(S,R)=>{const J=p.resolveComponent("el-scrollbar");return p.openBlock(),p.createElementBlock("div",ke,[p.createElementVNode("div",{ref_key:"threejsContainer",ref:e,class:"threejs-container"},null,512),R[15]||(R[15]=p.createElementVNode("div",{class:"buttonGroup-top"},null,-1)),p.createElementVNode("div",Fe,[p.createVNode(v.SvgIcon,{name:"viewReset",size:"24",onClick:p.unref(r),title:"重置"},null,8,["onClick"]),p.createVNode(v.SvgIcon,{name:"fangda",size:"24",title:"放大"}),p.createVNode(v.SvgIcon,{name:"suoxiao",size:"24",title:"缩小"}),p.createVNode(v.SvgIcon,{name:"lookAround",size:"24",onClick:p.unref(A),title:p.unref(x)?"停止动画":"动画视图"},null,8,["onClick","title"])]),p.createElementVNode("div",De,[p.createVNode(v.SvgIcon,{name:"clipping",size:"24",onClick:R[0]||(R[0]=b=>I("剖面视图")),active:i.value&&n.value==="剖面视图",title:"剖面视图"},null,8,["active"])]),R[16]||(R[16]=p.createElementVNode("div",{class:"buttonGroup-right"},null,-1)),R[17]||(R[17]=p.createElementVNode("div",{class:"buttonGroup-bottom"},null,-1)),p.withDirectives(p.createElementVNode("div",Ge,[p.createElementVNode("div",He,[p.createElementVNode("span",null,p.toDisplayString(n.value),1),p.createElementVNode("span",{class:"close",onClick:R[1]||(R[1]=b=>i.value=!1)}," X ")]),p.createVNode(J,{"max-height":"650px"},{default:p.withCtx(()=>[n.value==="剖面视图"?(p.openBlock(),p.createElementBlock("div",Be,[p.createElementVNode("div",Ue,[p.createElementVNode("label",je,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":R[2]||(R[2]=b=>p.isRef(_)?_.value=b:null),onChange:R[3]||(R[3]=(...b)=>p.unref(w)&&p.unref(w)(...b))},null,544),[[p.vModelRadio,p.unref(_)]]),R[10]||(R[10]=p.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),p.createElementVNode("label",Ve,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":R[4]||(R[4]=b=>p.isRef(_)?_.value=b:null),onChange:R[5]||(R[5]=(...b)=>p.unref(w)&&p.unref(w)(...b))},null,544),[[p.vModelRadio,p.unref(_)]]),R[11]||(R[11]=p.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),p.createElementVNode("label",Ke,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":R[6]||(R[6]=b=>p.isRef(_)?_.value=b:null),onChange:R[7]||(R[7]=(...b)=>p.unref(w)&&p.unref(w)(...b))},null,544),[[p.vModelRadio,p.unref(_)]]),R[12]||(R[12]=p.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),p.createElementVNode("label",Xe,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":R[8]||(R[8]=b=>p.isRef(_)?_.value=b:null),onChange:R[9]||(R[9]=(...b)=>p.unref(w)&&p.unref(w)(...b))},null,544),[[p.vModelRadio,p.unref(_)]]),R[13]||(R[13]=p.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):p.createCommentVNode("",!0)]),_:1})],512),[[p.vShow,i.value]]),p.unref(h)?(p.openBlock(),p.createElementBlock("div",ze,[R[14]||(R[14]=p.createElementVNode("div",{class:"loading-spinner"},null,-1)),p.createElementVNode("p",null,p.toDisplayString(p.unref(m)),1)])):p.createCommentVNode("",!0)])}}}),We=Q._export_sfc(qe,[["__scopeId","data-v-bd3231bf"]]);exports.default=We;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("vue"),v=require("./iconfont-Di4uXnX1.cjs"),u=require("./STLLoader-BxpEhvEg.cjs"),V=require("./index-BOev8isw.cjs"),Q=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function K(f,t){if(t===u.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),f;if(t===u.TriangleFanDrawMode||t===u.TriangleStripDrawMode){let e=f.getIndex();if(e===null){const r=[],a=f.getAttribute("position");if(a!==void 0){for(let o=0;o<a.count;o++)r.push(o);f.setIndex(r),e=f.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),f}const i=e.count-2,n=[];if(t===u.TriangleFanDrawMode)for(let r=1;r<=i;r++)n.push(e.getX(0)),n.push(e.getX(r)),n.push(e.getX(r+1));else for(let r=0;r<i;r++)r%2===0?(n.push(e.getX(r)),n.push(e.getX(r+1)),n.push(e.getX(r+2))):(n.push(e.getX(r+2)),n.push(e.getX(r+1)),n.push(e.getX(r)));n.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=f.clone();return s.setIndex(n),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),f}class Z extends u.Loader{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new re(e)}),this.register(function(e){return new ie(e)}),this.register(function(e){return new pe(e)}),this.register(function(e){return new me(e)}),this.register(function(e){return new ge(e)}),this.register(function(e){return new ae(e)}),this.register(function(e){return new ce(e)}),this.register(function(e){return new le(e)}),this.register(function(e){return new ue(e)}),this.register(function(e){return new se(e)}),this.register(function(e){return new de(e)}),this.register(function(e){return new oe(e)}),this.register(function(e){return new he(e)}),this.register(function(e){return new fe(e)}),this.register(function(e){return new te(e)}),this.register(function(e){return new Te(e)}),this.register(function(e){return new Re(e)})}load(t,e,i,n){const s=this;let r;if(this.resourcePath!=="")r=this.resourcePath;else if(this.path!==""){const c=u.LoaderUtils.extractUrlBase(t);r=u.LoaderUtils.resolveURL(c,this.path)}else r=u.LoaderUtils.extractUrlBase(t);this.manager.itemStart(t);const a=function(c){n?n(c):console.error(c),s.manager.itemError(t),s.manager.itemEnd(t)},o=new u.FileLoader(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(c){try{s.parse(c,r,function(d){e(d),s.manager.itemEnd(t)},a)}catch(d){a(d)}},i,a)}setDRACOLoader(t){return this.dracoLoader=t,this}setKTX2Loader(t){return this.ktx2Loader=t,this}setMeshoptDecoder(t){return this.meshoptDecoder=t,this}register(t){return this.pluginCallbacks.indexOf(t)===-1&&this.pluginCallbacks.push(t),this}unregister(t){return this.pluginCallbacks.indexOf(t)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1),this}parse(t,e,i,n){let s;const r={},a={},o=new TextDecoder;if(typeof t=="string")s=JSON.parse(t);else if(t instanceof ArrayBuffer)if(o.decode(new Uint8Array(t,0,4))===Y){try{r[L.KHR_BINARY_GLTF]=new xe(t)}catch(l){n&&n(l);return}s=JSON.parse(r[L.KHR_BINARY_GLTF].content)}else s=JSON.parse(o.decode(t));else s=t;if(s.asset===void 0||s.asset.version[0]<2){n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const c=new Oe(s,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let d=0;d<this.pluginCallbacks.length;d++){const l=this.pluginCallbacks[d](c);l.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[l.name]=l,r[l.name]=!0}if(s.extensionsUsed)for(let d=0;d<s.extensionsUsed.length;++d){const l=s.extensionsUsed[d],h=s.extensionsRequired||[];switch(l){case L.KHR_MATERIALS_UNLIT:r[l]=new ne;break;case L.KHR_DRACO_MESH_COMPRESSION:r[l]=new Ee(s,this.dracoLoader);break;case L.KHR_TEXTURE_TRANSFORM:r[l]=new Me;break;case L.KHR_MESH_QUANTIZATION:r[l]=new Le;break;default:h.indexOf(l)>=0&&a[l]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+l+'".')}}c.setExtensions(r),c.setPlugins(a),c.parse(i,n)}parseAsync(t,e){const i=this;return new Promise(function(n,s){i.parse(t,e,n,s)})}}function ee(){let f={};return{get:function(t){return f[t]},add:function(t,e){f[t]=e},remove:function(t){delete f[t]},removeAll:function(){f={}}}}const L={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class te{constructor(t){this.parser=t,this.name=L.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,e=this.parser.json.nodes||[];for(let i=0,n=e.length;i<n;i++){const s=e[i];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&t._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(t){const e=this.parser,i="light:"+t;let n=e.cache.get(i);if(n)return n;const s=e.json,o=((s.extensions&&s.extensions[this.name]||{}).lights||[])[t];let c;const d=new u.Color(16777215);o.color!==void 0&&d.setRGB(o.color[0],o.color[1],o.color[2],u.LinearSRGBColorSpace);const l=o.range!==void 0?o.range:0;switch(o.type){case"directional":c=new u.DirectionalLight(d),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new u.PointLight(d),c.distance=l;break;case"spot":c=new u.SpotLight(d),c.distance=l,o.spot=o.spot||{},o.spot.innerConeAngle=o.spot.innerConeAngle!==void 0?o.spot.innerConeAngle:0,o.spot.outerConeAngle=o.spot.outerConeAngle!==void 0?o.spot.outerConeAngle:Math.PI/4,c.angle=o.spot.outerConeAngle,c.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return c.position.set(0,0,0),O(c,o),o.intensity!==void 0&&(c.intensity=o.intensity),c.name=e.createUniqueName(o.name||"light_"+t),n=Promise.resolve(c),e.cache.add(i,n),n}getDependency(t,e){if(t==="light")return this._loadLight(e)}createNodeAttachment(t){const e=this,i=this.parser,s=i.json.nodes[t],a=(s.extensions&&s.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(o){return i._getNodeRef(e.cache,a,o)})}}class ne{constructor(){this.name=L.KHR_MATERIALS_UNLIT}getMaterialType(){return u.MeshBasicMaterial}extendParams(t,e,i){const n=[];t.color=new u.Color(1,1,1),t.opacity=1;const s=e.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const r=s.baseColorFactor;t.color.setRGB(r[0],r[1],r[2],u.LinearSRGBColorSpace),t.opacity=r[3]}s.baseColorTexture!==void 0&&n.push(i.assignTexture(t,"map",s.baseColorTexture,u.SRGBColorSpace))}return Promise.all(n)}}class se{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(t,e){const n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name].emissiveStrength;return s!==void 0&&(e.emissiveIntensity=s),Promise.resolve()}}class re{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_CLEARCOAT}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];if(r.clearcoatFactor!==void 0&&(e.clearcoat=r.clearcoatFactor),r.clearcoatTexture!==void 0&&s.push(i.assignTexture(e,"clearcoatMap",r.clearcoatTexture)),r.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=r.clearcoatRoughnessFactor),r.clearcoatRoughnessTexture!==void 0&&s.push(i.assignTexture(e,"clearcoatRoughnessMap",r.clearcoatRoughnessTexture)),r.clearcoatNormalTexture!==void 0&&(s.push(i.assignTexture(e,"clearcoatNormalMap",r.clearcoatNormalTexture)),r.clearcoatNormalTexture.scale!==void 0)){const a=r.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new u.Vector2(a,a)}return Promise.all(s)}}class ie{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_DISPERSION}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name];return e.dispersion=s.dispersion!==void 0?s.dispersion:0,Promise.resolve()}}class oe{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_IRIDESCENCE}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];return r.iridescenceFactor!==void 0&&(e.iridescence=r.iridescenceFactor),r.iridescenceTexture!==void 0&&s.push(i.assignTexture(e,"iridescenceMap",r.iridescenceTexture)),r.iridescenceIor!==void 0&&(e.iridescenceIOR=r.iridescenceIor),e.iridescenceThicknessRange===void 0&&(e.iridescenceThicknessRange=[100,400]),r.iridescenceThicknessMinimum!==void 0&&(e.iridescenceThicknessRange[0]=r.iridescenceThicknessMinimum),r.iridescenceThicknessMaximum!==void 0&&(e.iridescenceThicknessRange[1]=r.iridescenceThicknessMaximum),r.iridescenceThicknessTexture!==void 0&&s.push(i.assignTexture(e,"iridescenceThicknessMap",r.iridescenceThicknessTexture)),Promise.all(s)}}class ae{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_SHEEN}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[];e.sheenColor=new u.Color(0,0,0),e.sheenRoughness=0,e.sheen=1;const r=n.extensions[this.name];if(r.sheenColorFactor!==void 0){const a=r.sheenColorFactor;e.sheenColor.setRGB(a[0],a[1],a[2],u.LinearSRGBColorSpace)}return r.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=r.sheenRoughnessFactor),r.sheenColorTexture!==void 0&&s.push(i.assignTexture(e,"sheenColorMap",r.sheenColorTexture,u.SRGBColorSpace)),r.sheenRoughnessTexture!==void 0&&s.push(i.assignTexture(e,"sheenRoughnessMap",r.sheenRoughnessTexture)),Promise.all(s)}}class ce{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_TRANSMISSION}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];return r.transmissionFactor!==void 0&&(e.transmission=r.transmissionFactor),r.transmissionTexture!==void 0&&s.push(i.assignTexture(e,"transmissionMap",r.transmissionTexture)),Promise.all(s)}}class le{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_VOLUME}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];e.thickness=r.thicknessFactor!==void 0?r.thicknessFactor:0,r.thicknessTexture!==void 0&&s.push(i.assignTexture(e,"thicknessMap",r.thicknessTexture)),e.attenuationDistance=r.attenuationDistance||1/0;const a=r.attenuationColor||[1,1,1];return e.attenuationColor=new u.Color().setRGB(a[0],a[1],a[2],u.LinearSRGBColorSpace),Promise.all(s)}}class ue{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_IOR}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=n.extensions[this.name];return e.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}}class de{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_SPECULAR}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];e.specularIntensity=r.specularFactor!==void 0?r.specularFactor:1,r.specularTexture!==void 0&&s.push(i.assignTexture(e,"specularIntensityMap",r.specularTexture));const a=r.specularColorFactor||[1,1,1];return e.specularColor=new u.Color().setRGB(a[0],a[1],a[2],u.LinearSRGBColorSpace),r.specularColorTexture!==void 0&&s.push(i.assignTexture(e,"specularColorMap",r.specularColorTexture,u.SRGBColorSpace)),Promise.all(s)}}class fe{constructor(t){this.parser=t,this.name=L.EXT_MATERIALS_BUMP}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];return e.bumpScale=r.bumpFactor!==void 0?r.bumpFactor:1,r.bumpTexture!==void 0&&s.push(i.assignTexture(e,"bumpMap",r.bumpTexture)),Promise.all(s)}}class he{constructor(t){this.parser=t,this.name=L.KHR_MATERIALS_ANISOTROPY}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:u.MeshPhysicalMaterial}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],r=n.extensions[this.name];return r.anisotropyStrength!==void 0&&(e.anisotropy=r.anisotropyStrength),r.anisotropyRotation!==void 0&&(e.anisotropyRotation=r.anisotropyRotation),r.anisotropyTexture!==void 0&&s.push(i.assignTexture(e,"anisotropyMap",r.anisotropyTexture)),Promise.all(s)}}class pe{constructor(t){this.parser=t,this.name=L.KHR_TEXTURE_BASISU}loadTexture(t){const e=this.parser,i=e.json,n=i.textures[t];if(!n.extensions||!n.extensions[this.name])return null;const s=n.extensions[this.name],r=e.options.ktx2Loader;if(!r){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,s.source,r)}}class me{constructor(t){this.parser=t,this.name=L.EXT_TEXTURE_WEBP}loadTexture(t){const e=this.name,i=this.parser,n=i.json,s=n.textures[t];if(!s.extensions||!s.extensions[e])return null;const r=s.extensions[e],a=n.images[r.source];let o=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(o=c)}return i.loadTextureImage(t,r.source,o)}}class ge{constructor(t){this.parser=t,this.name=L.EXT_TEXTURE_AVIF}loadTexture(t){const e=this.name,i=this.parser,n=i.json,s=n.textures[t];if(!s.extensions||!s.extensions[e])return null;const r=s.extensions[e],a=n.images[r.source];let o=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(o=c)}return i.loadTextureImage(t,r.source,o)}}class Te{constructor(t){this.name=L.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){const e=this.parser.json,i=e.bufferViews[t];if(i.extensions&&i.extensions[this.name]){const n=i.extensions[this.name],s=this.parser.getDependency("buffer",n.buffer),r=this.parser.options.meshoptDecoder;if(!r||!r.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(a){const o=n.byteOffset||0,c=n.byteLength||0,d=n.count,l=n.byteStride,h=new Uint8Array(a,o,c);return r.decodeGltfBufferAsync?r.decodeGltfBufferAsync(d,l,h,n.mode,n.filter).then(function(m){return m.buffer}):r.ready.then(function(){const m=new ArrayBuffer(d*l);return r.decodeGltfBuffer(new Uint8Array(m),d,l,h,n.mode,n.filter),m})})}else return null}}class Re{constructor(t){this.name=L.EXT_MESH_GPU_INSTANCING,this.parser=t}createNodeMesh(t){const e=this.parser.json,i=e.nodes[t];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const n=e.meshes[i.mesh];for(const c of n.primitives)if(c.mode!==C.TRIANGLES&&c.mode!==C.TRIANGLE_STRIP&&c.mode!==C.TRIANGLE_FAN&&c.mode!==void 0)return null;const r=i.extensions[this.name].attributes,a=[],o={};for(const c in r)a.push(this.parser.getDependency("accessor",r[c]).then(d=>(o[c]=d,o[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(t)),Promise.all(a).then(c=>{const d=c.pop(),l=d.isGroup?d.children:[d],h=c[0].count,m=[];for(const g of l){const M=new u.Matrix4,T=new u.Vector3,x=new u.Quaternion,A=new u.Vector3(1,1,1),y=new u.InstancedMesh(g.geometry,g.material,h);for(let E=0;E<h;E++)o.TRANSLATION&&T.fromBufferAttribute(o.TRANSLATION,E),o.ROTATION&&x.fromBufferAttribute(o.ROTATION,E),o.SCALE&&A.fromBufferAttribute(o.SCALE,E),y.setMatrixAt(E,M.compose(T,x,A));for(const E in o)if(E==="_COLOR_0"){const _=o[E];y.instanceColor=new u.InstancedBufferAttribute(_.array,_.itemSize,_.normalized)}else E!=="TRANSLATION"&&E!=="ROTATION"&&E!=="SCALE"&&g.geometry.setAttribute(E,o[E]);u.Object3D.prototype.copy.call(y,g),this.parser.assignFinalMaterial(y),m.push(y)}return d.isGroup?(d.clear(),d.add(...m),d):m[0]}))}}const Y="glTF",D=12,X={JSON:1313821514,BIN:5130562};class xe{constructor(t){this.name=L.KHR_BINARY_GLTF,this.content=null,this.body=null;const e=new DataView(t,0,D),i=new TextDecoder;if(this.header={magic:i.decode(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==Y)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-D,s=new DataView(t,D);let r=0;for(;r<n;){const a=s.getUint32(r,!0);r+=4;const o=s.getUint32(r,!0);if(r+=4,o===X.JSON){const c=new Uint8Array(t,D+r,a);this.content=i.decode(c)}else if(o===X.BIN){const c=D+r;this.body=t.slice(c,c+a)}r+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Ee{constructor(t,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=L.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=e,this.dracoLoader.preload()}decodePrimitive(t,e){const i=this.json,n=this.dracoLoader,s=t.extensions[this.name].bufferView,r=t.extensions[this.name].attributes,a={},o={},c={};for(const d in r){const l=U[d]||d.toLowerCase();a[l]=r[d]}for(const d in t.attributes){const l=U[d]||d.toLowerCase();if(r[d]!==void 0){const h=i.accessors[t.attributes[d]],m=F[h.componentType];c[l]=m.name,o[l]=h.normalized===!0}}return e.getDependency("bufferView",s).then(function(d){return new Promise(function(l,h){n.decodeDracoFile(d,function(m){for(const g in m.attributes){const M=m.attributes[g],T=o[g];T!==void 0&&(M.normalized=T)}l(m)},a,c,u.LinearSRGBColorSpace,h)})})}}class Me{constructor(){this.name=L.KHR_TEXTURE_TRANSFORM}extendTexture(t,e){return(e.texCoord===void 0||e.texCoord===t.channel)&&e.offset===void 0&&e.rotation===void 0&&e.scale===void 0||(t=t.clone(),e.texCoord!==void 0&&(t.channel=e.texCoord),e.offset!==void 0&&t.offset.fromArray(e.offset),e.rotation!==void 0&&(t.rotation=e.rotation),e.scale!==void 0&&t.repeat.fromArray(e.scale),t.needsUpdate=!0),t}}class Le{constructor(){this.name=L.KHR_MESH_QUANTIZATION}}class $ extends u.Interpolant{constructor(t,e,i,n){super(t,e,i,n)}copySampleValue_(t){const e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,s=t*n*3+n;for(let r=0;r!==n;r++)e[r]=i[s+r];return e}interpolate_(t,e,i,n){const s=this.resultBuffer,r=this.sampleValues,a=this.valueSize,o=a*2,c=a*3,d=n-e,l=(i-e)/d,h=l*l,m=h*l,g=t*c,M=g-c,T=-2*m+3*h,x=m-h,A=1-T,y=x-h+l;for(let E=0;E!==a;E++){const _=r[M+E+a],N=r[M+E+o]*d,w=r[g+E+a],I=r[g+E]*d;s[E]=A*_+y*N+T*w+x*I}return s}}const Ae=new u.Quaternion;class _e extends ${interpolate_(t,e,i,n){const s=super.interpolate_(t,e,i,n);return Ae.fromArray(s).normalize().toArray(s),s}}const C={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},F={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},z={9728:u.NearestFilter,9729:u.LinearFilter,9984:u.NearestMipmapNearestFilter,9985:u.LinearMipmapNearestFilter,9986:u.NearestMipmapLinearFilter,9987:u.LinearMipmapLinearFilter},q={33071:u.ClampToEdgeWrapping,33648:u.MirroredRepeatWrapping,10497:u.RepeatWrapping},G={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},U={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},P={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Se={CUBICSPLINE:void 0,LINEAR:u.InterpolateLinear,STEP:u.InterpolateDiscrete},H={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function ye(f){return f.DefaultMaterial===void 0&&(f.DefaultMaterial=new u.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:u.FrontSide})),f.DefaultMaterial}function k(f,t,e){for(const i in e.extensions)f[i]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[i]=e.extensions[i])}function O(f,t){t.extras!==void 0&&(typeof t.extras=="object"?Object.assign(f.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function we(f,t,e){let i=!1,n=!1,s=!1;for(let c=0,d=t.length;c<d;c++){const l=t[c];if(l.POSITION!==void 0&&(i=!0),l.NORMAL!==void 0&&(n=!0),l.COLOR_0!==void 0&&(s=!0),i&&n&&s)break}if(!i&&!n&&!s)return Promise.resolve(f);const r=[],a=[],o=[];for(let c=0,d=t.length;c<d;c++){const l=t[c];if(i){const h=l.POSITION!==void 0?e.getDependency("accessor",l.POSITION):f.attributes.position;r.push(h)}if(n){const h=l.NORMAL!==void 0?e.getDependency("accessor",l.NORMAL):f.attributes.normal;a.push(h)}if(s){const h=l.COLOR_0!==void 0?e.getDependency("accessor",l.COLOR_0):f.attributes.color;o.push(h)}}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(o)]).then(function(c){const d=c[0],l=c[1],h=c[2];return i&&(f.morphAttributes.position=d),n&&(f.morphAttributes.normal=l),s&&(f.morphAttributes.color=h),f.morphTargetsRelative=!0,f})}function be(f,t){if(f.updateMorphTargets(),t.weights!==void 0)for(let e=0,i=t.weights.length;e<i;e++)f.morphTargetInfluences[e]=t.weights[e];if(t.extras&&Array.isArray(t.extras.targetNames)){const e=t.extras.targetNames;if(f.morphTargetInfluences.length===e.length){f.morphTargetDictionary={};for(let i=0,n=e.length;i<n;i++)f.morphTargetDictionary[e[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Ne(f){let t;const e=f.extensions&&f.extensions[L.KHR_DRACO_MESH_COMPRESSION];if(e?t="draco:"+e.bufferView+":"+e.indices+":"+B(e.attributes):t=f.indices+":"+B(f.attributes)+":"+f.mode,f.targets!==void 0)for(let i=0,n=f.targets.length;i<n;i++)t+=":"+B(f.targets[i]);return t}function B(f){let t="";const e=Object.keys(f).sort();for(let i=0,n=e.length;i<n;i++)t+=e[i]+":"+f[e[i]]+";";return t}function j(f){switch(f){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function Ce(f){return f.search(/\.jpe?g($|\?)/i)>0||f.search(/^data\:image\/jpeg/)===0?"image/jpeg":f.search(/\.webp($|\?)/i)>0||f.search(/^data\:image\/webp/)===0?"image/webp":f.search(/\.ktx2($|\?)/i)>0||f.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const Ie=new u.Matrix4;class Oe{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new ee,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,n=-1,s=!1,r=-1;if(typeof navigator<"u"){const a=navigator.userAgent;i=/^((?!chrome|android).)*safari/i.test(a)===!0;const o=a.match(/Version\/(\d+)/);n=i&&o?parseInt(o[1],10):-1,s=a.indexOf("Firefox")>-1,r=s?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&n<17||s&&r<98?this.textureLoader=new u.TextureLoader(this.options.manager):this.textureLoader=new u.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new u.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){const i=this,n=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(r){return r._markDefs&&r._markDefs()}),Promise.all(this._invokeAll(function(r){return r.beforeRoot&&r.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(r){const a={scene:r[0][n.scene||0],scenes:r[0],animations:r[1],cameras:r[2],asset:n.asset,parser:i,userData:{}};return k(s,a,n),O(a,n),Promise.all(i._invokeAll(function(o){return o.afterRoot&&o.afterRoot(a)})).then(function(){for(const o of a.scenes)o.updateMatrixWorld();t(a)})}).catch(e)}_markDefs(){const t=this.json.nodes||[],e=this.json.skins||[],i=this.json.meshes||[];for(let n=0,s=e.length;n<s;n++){const r=e[n].joints;for(let a=0,o=r.length;a<o;a++)t[r[a]].isBone=!0}for(let n=0,s=t.length;n<s;n++){const r=t[n];r.mesh!==void 0&&(this._addNodeRef(this.meshCache,r.mesh),r.skin!==void 0&&(i[r.mesh].isSkinnedMesh=!0)),r.camera!==void 0&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(t,e){e!==void 0&&(t.refs[e]===void 0&&(t.refs[e]=t.uses[e]=0),t.refs[e]++)}_getNodeRef(t,e,i){if(t.refs[e]<=1)return i;const n=i.clone(),s=(r,a)=>{const o=this.associations.get(r);o!=null&&this.associations.set(a,o);for(const[c,d]of r.children.entries())s(d,a.children[c])};return s(i,n),n.name+="_instance_"+t.uses[e]++,n}_invokeOne(t){const e=Object.values(this.plugins);e.push(this);for(let i=0;i<e.length;i++){const n=t(e[i]);if(n)return n}return null}_invokeAll(t){const e=Object.values(this.plugins);e.unshift(this);const i=[];for(let n=0;n<e.length;n++){const s=t(e[n]);s&&i.push(s)}return i}getDependency(t,e){const i=t+":"+e;let n=this.cache.get(i);if(!n){switch(t){case"scene":n=this.loadScene(e);break;case"node":n=this._invokeOne(function(s){return s.loadNode&&s.loadNode(e)});break;case"mesh":n=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(e)});break;case"accessor":n=this.loadAccessor(e);break;case"bufferView":n=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(e)});break;case"buffer":n=this.loadBuffer(e);break;case"material":n=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(e)});break;case"texture":n=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(e)});break;case"skin":n=this.loadSkin(e);break;case"animation":n=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(e)});break;case"camera":n=this.loadCamera(e);break;default:if(n=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(t,e)}),!n)throw new Error("Unknown type: "+t);break}this.cache.add(i,n)}return n}getDependencies(t){let e=this.cache.get(t);if(!e){const i=this,n=this.json[t+(t==="mesh"?"es":"s")]||[];e=Promise.all(n.map(function(s,r){return i.getDependency(t,r)})),this.cache.add(t,e)}return e}loadBuffer(t){const e=this.json.buffers[t],i=this.fileLoader;if(e.type&&e.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");if(e.uri===void 0&&t===0)return Promise.resolve(this.extensions[L.KHR_BINARY_GLTF].body);const n=this.options;return new Promise(function(s,r){i.load(u.LoaderUtils.resolveURL(e.uri,n.path),s,void 0,function(){r(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))})})}loadBufferView(t){const e=this.json.bufferViews[t];return this.getDependency("buffer",e.buffer).then(function(i){const n=e.byteLength||0,s=e.byteOffset||0;return i.slice(s,s+n)})}loadAccessor(t){const e=this,i=this.json,n=this.json.accessors[t];if(n.bufferView===void 0&&n.sparse===void 0){const r=G[n.type],a=F[n.componentType],o=n.normalized===!0,c=new a(n.count*r);return Promise.resolve(new u.BufferAttribute(c,r,o))}const s=[];return n.bufferView!==void 0?s.push(this.getDependency("bufferView",n.bufferView)):s.push(null),n.sparse!==void 0&&(s.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(s).then(function(r){const a=r[0],o=G[n.type],c=F[n.componentType],d=c.BYTES_PER_ELEMENT,l=d*o,h=n.byteOffset||0,m=n.bufferView!==void 0?i.bufferViews[n.bufferView].byteStride:void 0,g=n.normalized===!0;let M,T;if(m&&m!==l){const x=Math.floor(h/m),A="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+x+":"+n.count;let y=e.cache.get(A);y||(M=new c(a,x*m,n.count*m/d),y=new u.InterleavedBuffer(M,m/d),e.cache.add(A,y)),T=new u.InterleavedBufferAttribute(y,o,h%m/d,g)}else a===null?M=new c(n.count*o):M=new c(a,h,n.count*o),T=new u.BufferAttribute(M,o,g);if(n.sparse!==void 0){const x=G.SCALAR,A=F[n.sparse.indices.componentType],y=n.sparse.indices.byteOffset||0,E=n.sparse.values.byteOffset||0,_=new A(r[1],y,n.sparse.count*x),N=new c(r[2],E,n.sparse.count*o);a!==null&&(T=new u.BufferAttribute(T.array.slice(),T.itemSize,T.normalized)),T.normalized=!1;for(let w=0,I=_.length;w<I;w++){const S=_[w];if(T.setX(S,N[w*o]),o>=2&&T.setY(S,N[w*o+1]),o>=3&&T.setZ(S,N[w*o+2]),o>=4&&T.setW(S,N[w*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}T.normalized=g}return T})}loadTexture(t){const e=this.json,i=this.options,s=e.textures[t].source,r=e.images[s];let a=this.textureLoader;if(r.uri){const o=i.manager.getHandler(r.uri);o!==null&&(a=o)}return this.loadTextureImage(t,s,a)}loadTextureImage(t,e,i){const n=this,s=this.json,r=s.textures[t],a=s.images[e],o=(a.uri||a.bufferView)+":"+r.sampler;if(this.textureCache[o])return this.textureCache[o];const c=this.loadImageSource(e,i).then(function(d){d.flipY=!1,d.name=r.name||a.name||"",d.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(d.name=a.uri);const h=(s.samplers||{})[r.sampler]||{};return d.magFilter=z[h.magFilter]||u.LinearFilter,d.minFilter=z[h.minFilter]||u.LinearMipmapLinearFilter,d.wrapS=q[h.wrapS]||u.RepeatWrapping,d.wrapT=q[h.wrapT]||u.RepeatWrapping,d.generateMipmaps=!d.isCompressedTexture&&d.minFilter!==u.NearestFilter&&d.minFilter!==u.LinearFilter,n.associations.set(d,{textures:t}),d}).catch(function(){return null});return this.textureCache[o]=c,c}loadImageSource(t,e){const i=this,n=this.json,s=this.options;if(this.sourceCache[t]!==void 0)return this.sourceCache[t].then(l=>l.clone());const r=n.images[t],a=self.URL||self.webkitURL;let o=r.uri||"",c=!1;if(r.bufferView!==void 0)o=i.getDependency("bufferView",r.bufferView).then(function(l){c=!0;const h=new Blob([l],{type:r.mimeType});return o=a.createObjectURL(h),o});else if(r.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");const d=Promise.resolve(o).then(function(l){return new Promise(function(h,m){let g=h;e.isImageBitmapLoader===!0&&(g=function(M){const T=new u.Texture(M);T.needsUpdate=!0,h(T)}),e.load(u.LoaderUtils.resolveURL(l,s.path),g,void 0,m)})}).then(function(l){return c===!0&&a.revokeObjectURL(o),O(l,r),l.userData.mimeType=r.mimeType||Ce(r.uri),l}).catch(function(l){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),l});return this.sourceCache[t]=d,d}assignTexture(t,e,i,n){const s=this;return this.getDependency("texture",i.index).then(function(r){if(!r)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(r=r.clone(),r.channel=i.texCoord),s.extensions[L.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[L.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const o=s.associations.get(r);r=s.extensions[L.KHR_TEXTURE_TRANSFORM].extendTexture(r,a),s.associations.set(r,o)}}return n!==void 0&&(r.colorSpace=n),t[e]=r,r})}assignFinalMaterial(t){const e=t.geometry;let i=t.material;const n=e.attributes.tangent===void 0,s=e.attributes.color!==void 0,r=e.attributes.normal===void 0;if(t.isPoints){const a="PointsMaterial:"+i.uuid;let o=this.cache.get(a);o||(o=new u.PointsMaterial,u.Material.prototype.copy.call(o,i),o.color.copy(i.color),o.map=i.map,o.sizeAttenuation=!1,this.cache.add(a,o)),i=o}else if(t.isLine){const a="LineBasicMaterial:"+i.uuid;let o=this.cache.get(a);o||(o=new u.LineBasicMaterial,u.Material.prototype.copy.call(o,i),o.color.copy(i.color),o.map=i.map,this.cache.add(a,o)),i=o}if(n||s||r){let a="ClonedMaterial:"+i.uuid+":";n&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),r&&(a+="flat-shading:");let o=this.cache.get(a);o||(o=i.clone(),s&&(o.vertexColors=!0),r&&(o.flatShading=!0),n&&(o.normalScale&&(o.normalScale.y*=-1),o.clearcoatNormalScale&&(o.clearcoatNormalScale.y*=-1)),this.cache.add(a,o),this.associations.set(o,this.associations.get(i))),i=o}t.material=i}getMaterialType(){return u.MeshStandardMaterial}loadMaterial(t){const e=this,i=this.json,n=this.extensions,s=i.materials[t];let r;const a={},o=s.extensions||{},c=[];if(o[L.KHR_MATERIALS_UNLIT]){const l=n[L.KHR_MATERIALS_UNLIT];r=l.getMaterialType(),c.push(l.extendParams(a,s,e))}else{const l=s.pbrMetallicRoughness||{};if(a.color=new u.Color(1,1,1),a.opacity=1,Array.isArray(l.baseColorFactor)){const h=l.baseColorFactor;a.color.setRGB(h[0],h[1],h[2],u.LinearSRGBColorSpace),a.opacity=h[3]}l.baseColorTexture!==void 0&&c.push(e.assignTexture(a,"map",l.baseColorTexture,u.SRGBColorSpace)),a.metalness=l.metallicFactor!==void 0?l.metallicFactor:1,a.roughness=l.roughnessFactor!==void 0?l.roughnessFactor:1,l.metallicRoughnessTexture!==void 0&&(c.push(e.assignTexture(a,"metalnessMap",l.metallicRoughnessTexture)),c.push(e.assignTexture(a,"roughnessMap",l.metallicRoughnessTexture))),r=this._invokeOne(function(h){return h.getMaterialType&&h.getMaterialType(t)}),c.push(Promise.all(this._invokeAll(function(h){return h.extendMaterialParams&&h.extendMaterialParams(t,a)})))}s.doubleSided===!0&&(a.side=u.DoubleSide);const d=s.alphaMode||H.OPAQUE;if(d===H.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,d===H.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&r!==u.MeshBasicMaterial&&(c.push(e.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new u.Vector2(1,1),s.normalTexture.scale!==void 0)){const l=s.normalTexture.scale;a.normalScale.set(l,l)}if(s.occlusionTexture!==void 0&&r!==u.MeshBasicMaterial&&(c.push(e.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&r!==u.MeshBasicMaterial){const l=s.emissiveFactor;a.emissive=new u.Color().setRGB(l[0],l[1],l[2],u.LinearSRGBColorSpace)}return s.emissiveTexture!==void 0&&r!==u.MeshBasicMaterial&&c.push(e.assignTexture(a,"emissiveMap",s.emissiveTexture,u.SRGBColorSpace)),Promise.all(c).then(function(){const l=new r(a);return s.name&&(l.name=s.name),O(l,s),e.associations.set(l,{materials:t}),s.extensions&&k(n,l,s),l})}createUniqueName(t){const e=u.PropertyBinding.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){const e=this,i=this.extensions,n=this.primitiveCache;function s(a){return i[L.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,e).then(function(o){return W(o,a,e)})}const r=[];for(let a=0,o=t.length;a<o;a++){const c=t[a],d=Ne(c),l=n[d];if(l)r.push(l.promise);else{let h;c.extensions&&c.extensions[L.KHR_DRACO_MESH_COMPRESSION]?h=s(c):h=W(new u.BufferGeometry,c,e),n[d]={primitive:c,promise:h},r.push(h)}}return Promise.all(r)}loadMesh(t){const e=this,i=this.json,n=this.extensions,s=i.meshes[t],r=s.primitives,a=[];for(let o=0,c=r.length;o<c;o++){const d=r[o].material===void 0?ye(this.cache):this.getDependency("material",r[o].material);a.push(d)}return a.push(e.loadGeometries(r)),Promise.all(a).then(function(o){const c=o.slice(0,o.length-1),d=o[o.length-1],l=[];for(let m=0,g=d.length;m<g;m++){const M=d[m],T=r[m];let x;const A=c[m];if(T.mode===C.TRIANGLES||T.mode===C.TRIANGLE_STRIP||T.mode===C.TRIANGLE_FAN||T.mode===void 0)x=s.isSkinnedMesh===!0?new u.SkinnedMesh(M,A):new u.Mesh(M,A),x.isSkinnedMesh===!0&&x.normalizeSkinWeights(),T.mode===C.TRIANGLE_STRIP?x.geometry=K(x.geometry,u.TriangleStripDrawMode):T.mode===C.TRIANGLE_FAN&&(x.geometry=K(x.geometry,u.TriangleFanDrawMode));else if(T.mode===C.LINES)x=new u.LineSegments(M,A);else if(T.mode===C.LINE_STRIP)x=new u.Line(M,A);else if(T.mode===C.LINE_LOOP)x=new u.LineLoop(M,A);else if(T.mode===C.POINTS)x=new u.Points(M,A);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+T.mode);Object.keys(x.geometry.morphAttributes).length>0&&be(x,s),x.name=e.createUniqueName(s.name||"mesh_"+t),O(x,s),T.extensions&&k(n,x,T),e.assignFinalMaterial(x),l.push(x)}for(let m=0,g=l.length;m<g;m++)e.associations.set(l[m],{meshes:t,primitives:m});if(l.length===1)return s.extensions&&k(n,l[0],s),l[0];const h=new u.Group;s.extensions&&k(n,h,s),e.associations.set(h,{meshes:t});for(let m=0,g=l.length;m<g;m++)h.add(l[m]);return h})}loadCamera(t){let e;const i=this.json.cameras[t],n=i[i.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?e=new u.PerspectiveCamera(u.MathUtils.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):i.type==="orthographic"&&(e=new u.OrthographicCamera(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),i.name&&(e.name=this.createUniqueName(i.name)),O(e,i),Promise.resolve(e)}loadSkin(t){const e=this.json.skins[t],i=[];for(let n=0,s=e.joints.length;n<s;n++)i.push(this._loadNodeShallow(e.joints[n]));return e.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",e.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(n){const s=n.pop(),r=n,a=[],o=[];for(let c=0,d=r.length;c<d;c++){const l=r[c];if(l){a.push(l);const h=new u.Matrix4;s!==null&&h.fromArray(s.array,c*16),o.push(h)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',e.joints[c])}return new u.Skeleton(a,o)})}loadAnimation(t){const e=this.json,i=this,n=e.animations[t],s=n.name?n.name:"animation_"+t,r=[],a=[],o=[],c=[],d=[];for(let l=0,h=n.channels.length;l<h;l++){const m=n.channels[l],g=n.samplers[m.sampler],M=m.target,T=M.node,x=n.parameters!==void 0?n.parameters[g.input]:g.input,A=n.parameters!==void 0?n.parameters[g.output]:g.output;M.node!==void 0&&(r.push(this.getDependency("node",T)),a.push(this.getDependency("accessor",x)),o.push(this.getDependency("accessor",A)),c.push(g),d.push(M))}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(o),Promise.all(c),Promise.all(d)]).then(function(l){const h=l[0],m=l[1],g=l[2],M=l[3],T=l[4],x=[];for(let A=0,y=h.length;A<y;A++){const E=h[A],_=m[A],N=g[A],w=M[A],I=T[A];if(E===void 0)continue;E.updateMatrix&&E.updateMatrix();const S=i._createAnimationTracks(E,_,N,w,I);if(S)for(let R=0;R<S.length;R++)x.push(S[R])}return new u.AnimationClip(s,void 0,x)})}createNodeMesh(t){const e=this.json,i=this,n=e.nodes[t];return n.mesh===void 0?null:i.getDependency("mesh",n.mesh).then(function(s){const r=i._getNodeRef(i.meshCache,n.mesh,s);return n.weights!==void 0&&r.traverse(function(a){if(a.isMesh)for(let o=0,c=n.weights.length;o<c;o++)a.morphTargetInfluences[o]=n.weights[o]}),r})}loadNode(t){const e=this.json,i=this,n=e.nodes[t],s=i._loadNodeShallow(t),r=[],a=n.children||[];for(let c=0,d=a.length;c<d;c++)r.push(i.getDependency("node",a[c]));const o=n.skin===void 0?Promise.resolve(null):i.getDependency("skin",n.skin);return Promise.all([s,Promise.all(r),o]).then(function(c){const d=c[0],l=c[1],h=c[2];h!==null&&d.traverse(function(m){m.isSkinnedMesh&&m.bind(h,Ie)});for(let m=0,g=l.length;m<g;m++)d.add(l[m]);return d})}_loadNodeShallow(t){const e=this.json,i=this.extensions,n=this;if(this.nodeCache[t]!==void 0)return this.nodeCache[t];const s=e.nodes[t],r=s.name?n.createUniqueName(s.name):"",a=[],o=n._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(t)});return o&&a.push(o),s.camera!==void 0&&a.push(n.getDependency("camera",s.camera).then(function(c){return n._getNodeRef(n.cameraCache,s.camera,c)})),n._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(t)}).forEach(function(c){a.push(c)}),this.nodeCache[t]=Promise.all(a).then(function(c){let d;if(s.isBone===!0?d=new u.Bone:c.length>1?d=new u.Group:c.length===1?d=c[0]:d=new u.Object3D,d!==c[0])for(let l=0,h=c.length;l<h;l++)d.add(c[l]);if(s.name&&(d.userData.name=s.name,d.name=r),O(d,s),s.extensions&&k(i,d,s),s.matrix!==void 0){const l=new u.Matrix4;l.fromArray(s.matrix),d.applyMatrix4(l)}else s.translation!==void 0&&d.position.fromArray(s.translation),s.rotation!==void 0&&d.quaternion.fromArray(s.rotation),s.scale!==void 0&&d.scale.fromArray(s.scale);if(!n.associations.has(d))n.associations.set(d,{});else if(s.mesh!==void 0&&n.meshCache.refs[s.mesh]>1){const l=n.associations.get(d);n.associations.set(d,{...l})}return n.associations.get(d).nodes=t,d}),this.nodeCache[t]}loadScene(t){const e=this.extensions,i=this.json.scenes[t],n=this,s=new u.Group;i.name&&(s.name=n.createUniqueName(i.name)),O(s,i),i.extensions&&k(e,s,i);const r=i.nodes||[],a=[];for(let o=0,c=r.length;o<c;o++)a.push(n.getDependency("node",r[o]));return Promise.all(a).then(function(o){for(let d=0,l=o.length;d<l;d++)s.add(o[d]);const c=d=>{const l=new Map;for(const[h,m]of n.associations)(h instanceof u.Material||h instanceof u.Texture)&&l.set(h,m);return d.traverse(h=>{const m=n.associations.get(h);m!=null&&l.set(h,m)}),l};return n.associations=c(s),s})}_createAnimationTracks(t,e,i,n,s){const r=[],a=t.name?t.name:t.uuid,o=[];P[s.path]===P.weights?t.traverse(function(h){h.morphTargetInfluences&&o.push(h.name?h.name:h.uuid)}):o.push(a);let c;switch(P[s.path]){case P.weights:c=u.NumberKeyframeTrack;break;case P.rotation:c=u.QuaternionKeyframeTrack;break;case P.translation:case P.scale:c=u.VectorKeyframeTrack;break;default:switch(i.itemSize){case 1:c=u.NumberKeyframeTrack;break;case 2:case 3:default:c=u.VectorKeyframeTrack;break}break}const d=n.interpolation!==void 0?Se[n.interpolation]:u.InterpolateLinear,l=this._getArrayFromAccessor(i);for(let h=0,m=o.length;h<m;h++){const g=new c(o[h]+"."+P[s.path],e.array,l,d);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(g),r.push(g)}return r}_getArrayFromAccessor(t){let e=t.array;if(t.normalized){const i=j(e.constructor),n=new Float32Array(e.length);for(let s=0,r=e.length;s<r;s++)n[s]=e[s]*i;e=n}return e}_createCubicSplineTrackInterpolant(t){t.createInterpolant=function(i){const n=this instanceof u.QuaternionKeyframeTrack?_e:$;return new n(this.times,this.values,this.getValueSize()/3,i)},t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function ve(f,t,e){const i=t.attributes,n=new u.Box3;if(i.POSITION!==void 0){const a=e.json.accessors[i.POSITION],o=a.min,c=a.max;if(o!==void 0&&c!==void 0){if(n.set(new u.Vector3(o[0],o[1],o[2]),new u.Vector3(c[0],c[1],c[2])),a.normalized){const d=j(F[a.componentType]);n.min.multiplyScalar(d),n.max.multiplyScalar(d)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=t.targets;if(s!==void 0){const a=new u.Vector3,o=new u.Vector3;for(let c=0,d=s.length;c<d;c++){const l=s[c];if(l.POSITION!==void 0){const h=e.json.accessors[l.POSITION],m=h.min,g=h.max;if(m!==void 0&&g!==void 0){if(o.setX(Math.max(Math.abs(m[0]),Math.abs(g[0]))),o.setY(Math.max(Math.abs(m[1]),Math.abs(g[1]))),o.setZ(Math.max(Math.abs(m[2]),Math.abs(g[2]))),h.normalized){const M=j(F[h.componentType]);o.multiplyScalar(M)}a.max(o)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(a)}f.boundingBox=n;const r=new u.Sphere;n.getCenter(r.center),r.radius=n.min.distanceTo(n.max)/2,f.boundingSphere=r}function W(f,t,e){const i=t.attributes,n=[];function s(r,a){return e.getDependency("accessor",r).then(function(o){f.setAttribute(a,o)})}for(const r in i){const a=U[r]||r.toLowerCase();a in f.attributes||n.push(s(i[r],a))}if(t.indices!==void 0&&!f.index){const r=e.getDependency("accessor",t.indices).then(function(a){f.setIndex(a)});n.push(r)}return u.ColorManagement.workingColorSpace!==u.LinearSRGBColorSpace&&"COLOR_0"in i&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${u.ColorManagement.workingColorSpace}" not supported.`),O(f,t),ve(f,t,e),Promise.all(n).then(function(){return t.targets!==void 0?we(f,t.targets,e):f})}function Pe(){const f=p.ref(!1),t=p.ref(""),e=p.shallowRef([]),i=p.ref(null),n=new u.MTLLoader,s=new u.OBJLoader,r=new u.STLLoader,a=new Z;return{isLoading:f,loadingProgress:t,loadedModels:e,error:i,loadModelsFromBlobs:async c=>{var m;if(!c||c.length===0){console.warn("loadModelsFromBlobs 加载的文件数组为空!");return}f.value=!0,t.value="准备加载...",e.value=[],i.value=null;const d=new Map;c.forEach(g=>{g instanceof File&&d.set(g.name.toLowerCase(),g)});const l=[],h=[];try{for(const g of c){const M=g.name||"unknown_file",T=(m=M.split(".").pop())==null?void 0:m.toLowerCase();if(T==="mtl")continue;const x=URL.createObjectURL(g);l.push(x);let A=null;const y=E=>{const _=E.lengthComputable?E.loaded/E.total*100:0;t.value=`正在加载 ${M}... ${Math.round(_)}%`};switch(t.value=`正在加载 ${M}... 0%`,T){case"obj":const E=M.replace(/\.obj$/i,".mtl").toLowerCase();if(d.has(E)){const I=d.get(E),S=URL.createObjectURL(I);l.push(S);const R=await n.loadAsync(S);R.preload(),s.setMaterials(R)}else s.setMaterials(null);A=await s.loadAsync(x,y);break;case"stl":const _=await r.loadAsync(x,y),N=new u.MeshPhongMaterial({color:11184810,specular:1118481,shininess:200});A=new u.Mesh(_,N);break;case"gltf":case"glb":A=(await a.loadAsync(x,y)).scene;break;default:console.warn(`不支持的文件类型: .${T}`),t.value=`不支持的文件类型: ${M}`;continue}A&&(A.userData.boundingBox=new u.Box3().setFromObject(A),h.push(A))}e.value=h,t.value="加载完成!"}catch(g){throw console.error("加载模型时出错:",g),i.value=`加载失败: ${g.message||"未知错误"}`,t.value="加载失败!",e.value=[],g}finally{f.value=!1,l.forEach(g=>URL.revokeObjectURL(g))}}}}const ke={class:"obj-viewer-container"},Fe={class:"buttonGroup-topLeft"},De={class:"buttonGroup-left"},Ge={class:"left-panel"},He={class:"panel-header"},Be={key:0,class:"clipping-content"},Ue={class:"radio-group"},je={class:"radio-label"},Ve={class:"radio-label"},Ke={class:"radio-label"},Xe={class:"radio-label"},ze={key:0,class:"loading-overlay"},qe=p.defineComponent({__name:"threePreview",props:{fileBlobs:{default:()=>[]}},setup(f){const t=f,e=p.ref(null),i=p.ref(!1),n=p.ref(""),{currentModels:s,resetView:r,initThreeJS:a,handleResize:o,getThreeJSObjects:c,cleanup:d,setModels:l}=v.useThreeJS(e),{isLoading:h,loadingProgress:m,loadedModels:g,error:M,loadModelsFromBlobs:T}=Pe(),{isAnimating:x,toggleAnimation:A,stopAnimation:y}=v.useAnimation(c,s),{isClipping:E,activeClippingAxis:_,toggleClipping:N,updateClippingPlanes:w}=v.useClipping(c,s);p.watch(()=>t.fileBlobs,S=>{S&&S.length>0&&T(S).catch(R=>{console.error("加载错误:",R)})},{immediate:!0,deep:!0}),p.watch(g,S=>{S&&S.length>0&&l(S)}),p.watch(M,S=>{S&&V.ElMessage.error(`模型加载失败: ${S}`)});const I=S=>{i.value=!0,n.value=S,E.value||N()};return p.onMounted(async()=>{await p.nextTick();try{a(),window.addEventListener("resize",o)}catch(S){console.error("Three.js 初始化失败:",S),V.ElMessage.error("渲染引擎初始化失败!")}}),p.onBeforeUnmount(()=>{n.value="",window.removeEventListener("resize",o),x.value&&y(),d()}),(S,R)=>{const J=p.resolveComponent("el-scrollbar");return p.openBlock(),p.createElementBlock("div",ke,[p.createElementVNode("div",{ref_key:"threejsContainer",ref:e,class:"threejs-container"},null,512),R[15]||(R[15]=p.createElementVNode("div",{class:"buttonGroup-top"},null,-1)),p.createElementVNode("div",Fe,[p.createVNode(v.SvgIcon,{name:"viewReset",size:"24",onClick:p.unref(r),title:"重置"},null,8,["onClick"]),p.createVNode(v.SvgIcon,{name:"fangda",size:"24",title:"放大"}),p.createVNode(v.SvgIcon,{name:"suoxiao",size:"24",title:"缩小"}),p.createVNode(v.SvgIcon,{name:"lookAround",size:"24",onClick:p.unref(A),title:p.unref(x)?"停止动画":"动画视图"},null,8,["onClick","title"])]),p.createElementVNode("div",De,[p.createVNode(v.SvgIcon,{name:"clipping",size:"24",onClick:R[0]||(R[0]=b=>I("剖面视图")),active:i.value&&n.value==="剖面视图",title:"剖面视图"},null,8,["active"])]),R[16]||(R[16]=p.createElementVNode("div",{class:"buttonGroup-right"},null,-1)),R[17]||(R[17]=p.createElementVNode("div",{class:"buttonGroup-bottom"},null,-1)),p.withDirectives(p.createElementVNode("div",Ge,[p.createElementVNode("div",He,[p.createElementVNode("span",null,p.toDisplayString(n.value),1),p.createElementVNode("span",{class:"close",onClick:R[1]||(R[1]=b=>i.value=!1)}," X ")]),p.createVNode(J,{"max-height":"650px"},{default:p.withCtx(()=>[n.value==="剖面视图"?(p.openBlock(),p.createElementBlock("div",Be,[p.createElementVNode("div",Ue,[p.createElementVNode("label",je,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":R[2]||(R[2]=b=>p.isRef(_)?_.value=b:null),onChange:R[3]||(R[3]=(...b)=>p.unref(w)&&p.unref(w)(...b))},null,544),[[p.vModelRadio,p.unref(_)]]),R[10]||(R[10]=p.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),p.createElementVNode("label",Ve,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":R[4]||(R[4]=b=>p.isRef(_)?_.value=b:null),onChange:R[5]||(R[5]=(...b)=>p.unref(w)&&p.unref(w)(...b))},null,544),[[p.vModelRadio,p.unref(_)]]),R[11]||(R[11]=p.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),p.createElementVNode("label",Ke,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":R[6]||(R[6]=b=>p.isRef(_)?_.value=b:null),onChange:R[7]||(R[7]=(...b)=>p.unref(w)&&p.unref(w)(...b))},null,544),[[p.vModelRadio,p.unref(_)]]),R[12]||(R[12]=p.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),p.createElementVNode("label",Xe,[p.withDirectives(p.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":R[8]||(R[8]=b=>p.isRef(_)?_.value=b:null),onChange:R[9]||(R[9]=(...b)=>p.unref(w)&&p.unref(w)(...b))},null,544),[[p.vModelRadio,p.unref(_)]]),R[13]||(R[13]=p.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):p.createCommentVNode("",!0)]),_:1})],512),[[p.vShow,i.value]]),p.unref(h)?(p.openBlock(),p.createElementBlock("div",ze,[R[14]||(R[14]=p.createElementVNode("div",{class:"loading-spinner"},null,-1)),p.createElementVNode("p",null,p.toDisplayString(p.unref(m)),1)])):p.createCommentVNode("",!0)])}}}),We=Q._export_sfc(qe,[["__scopeId","data-v-bd3231bf"]]);exports.default=We;
|