import{C as e,E as t,K as n,et as r,p as i,rt as a,u as o,w as s}from"./three.module-BFsVh7r1.js";import{t as c}from"./fflate.module-BIQmJeC9.js";var l=class extends n{constructor(e){super(e)}load(t,n,r,i){let a=this,o=new e(a.manager);o.setPath(a.path),o.setResponseType(`arraybuffer`),o.setRequestHeader(a.requestHeader),o.setWithCredentials(a.withCredentials),o.load(t,function(e){try{n(a.parse(e))}catch(e){i?i(e):console.error(e),a.manager.itemError(t)}},r,i)}parse(e){function l(e){let t=new DataView(e);if(String.fromCharCode(t.getUint8(0),t.getUint8(1))===`PK`){let n=null,r=null;console.log(`THREE.AMFLoader: Loading Zip`);try{n=c(new Uint8Array(e))}catch(e){if(e instanceof ReferenceError)return console.log(`THREE.AMFLoader: fflate missing and file is compressed.`),null}for(r in n)if(r.toLowerCase().slice(-4)===`.amf`)break;console.log(`THREE.AMFLoader: Trying to load file asset: `+r),t=new DataView(n[r].buffer)}let n=new TextDecoder().decode(t),r=new DOMParser().parseFromString(n,`application/xml`);return r.documentElement.nodeName.toLowerCase()===`amf`?r:(console.log(`THREE.AMFLoader: Error loading AMF - no AMF document found.`),null)}function u(e){let t=1,n=`millimeter`;e.documentElement.attributes.unit!==void 0&&(n=e.documentElement.attributes.unit.value.toLowerCase());let r={millimeter:1,inch:25.4,feet:304.8,meter:1e3,micron:.001};return r[n]!==void 0&&(t=r[n]),console.log(`THREE.AMFLoader: Unit scale: `+t),t}function d(e){let t=`AMF Material`,n=e.attributes.id.textContent,r={r:1,g:1,b:1,a:1},o=null;for(let n=0;n