@needle-tools/engine 5.0.0 → 5.1.0-experimental.1
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/components.needle.json +1 -1
- package/dist/generateMeshBVH.worker-DT9A2Hrc.js +1 -0
- package/dist/gltf-progressive-3BwW4ETO.min.js +10 -0
- package/dist/gltf-progressive-ByD1UX0A.umd.cjs +10 -0
- package/dist/{gltf-progressive-Cl167Vjx.js → gltf-progressive-DwWaVr0o.js} +412 -394
- package/dist/gltf-progressive.worker-DpfUjn1n.js +3 -0
- package/dist/{materialx-qPScBWhj.min.js → materialx-9KHBidZa.min.js} +1 -1
- package/dist/{materialx-4ApD6Vz5.js → materialx-BBDu8W5P.js} +1 -1
- package/dist/{materialx-D0XUnhBY.umd.cjs → materialx-hLP3E8AA.umd.cjs} +2 -2
- package/dist/{needle-engine.bundle-CoEvMwYM.min.js → needle-engine.bundle-BiCxyTBE.min.js} +110 -110
- package/dist/{needle-engine.bundle-BAYLGumK.umd.cjs → needle-engine.bundle-CaHKqc30.umd.cjs} +123 -123
- package/dist/{needle-engine.bundle-BDIyvCV6.js → needle-engine.bundle-JZXX6OjM.js} +2143 -2088
- package/dist/needle-engine.d.ts +102 -44
- package/dist/needle-engine.js +480 -476
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/{postprocessing-B_9sKVU7.min.js → postprocessing-BZfyAdCY.min.js} +1 -1
- package/dist/{postprocessing-WDc9WwI3.js → postprocessing-CXlA3QA6.js} +1 -1
- package/dist/{postprocessing-B2wb6pzI.umd.cjs → postprocessing-Dwy7Hz_T.umd.cjs} +38 -38
- package/dist/three-examples.js +4760 -3641
- package/dist/three-examples.min.js +17 -35
- package/dist/three-examples.umd.cjs +16 -34
- package/dist/three.js +48533 -28562
- package/dist/three.min.js +716 -502
- package/dist/three.umd.cjs +720 -506
- package/dist/vendor-Bf43L3CE.min.js +1116 -0
- package/dist/{vendor-CntUvmJu.umd.cjs → vendor-BlyEaMTL.umd.cjs} +31 -31
- package/dist/{vendor-vHLk8sXu.js → vendor-D-7l5gB0.js} +2562 -2556
- package/lib/engine/engine_animation.js +1 -1
- package/lib/engine/engine_animation.js.map +1 -1
- package/lib/engine/engine_audio.js.map +1 -1
- package/lib/engine/engine_context.js +3 -6
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine/engine_create_objects.js +0 -1
- package/lib/engine/engine_create_objects.js.map +1 -1
- package/lib/engine/engine_element.d.ts +113 -0
- package/lib/engine/engine_element.js +833 -0
- package/lib/engine/engine_element.js.map +1 -0
- package/lib/engine/engine_element_attributes.d.ts +72 -0
- package/lib/engine/engine_element_attributes.js +2 -0
- package/lib/engine/engine_element_attributes.js.map +1 -0
- package/lib/engine/engine_element_extras.d.ts +6 -0
- package/lib/engine/engine_element_extras.js +14 -0
- package/lib/engine/engine_element_extras.js.map +1 -0
- package/lib/engine/engine_element_loading.d.ts +44 -0
- package/lib/engine/engine_element_loading.js +350 -0
- package/lib/engine/engine_element_loading.js.map +1 -0
- package/lib/engine/engine_element_overlay.d.ts +21 -0
- package/lib/engine/engine_element_overlay.js +167 -0
- package/lib/engine/engine_element_overlay.js.map +1 -0
- package/lib/engine/engine_license.js.map +1 -1
- package/lib/engine/engine_pmrem.js +2 -2
- package/lib/engine/engine_pmrem.js.map +1 -1
- package/lib/engine/engine_scenetools.d.ts +62 -0
- package/lib/engine/engine_scenetools.js +337 -0
- package/lib/engine/engine_scenetools.js.map +1 -0
- package/lib/engine/engine_test_utils.d.ts +39 -0
- package/lib/engine/engine_test_utils.js +84 -0
- package/lib/engine/engine_test_utils.js.map +1 -0
- package/lib/engine/engine_three_utils.js.map +1 -1
- package/lib/engine/engine_time.js +4 -3
- package/lib/engine/engine_time.js.map +1 -1
- package/lib/engine/engine_ui.d.ts +25 -0
- package/lib/engine/engine_ui.dummy_canvas.d.ts +2 -0
- package/lib/engine/engine_ui.dummy_canvas.js +55 -0
- package/lib/engine/engine_ui.dummy_canvas.js.map +1 -0
- package/lib/engine/engine_ui.js +168 -0
- package/lib/engine/engine_ui.js.map +1 -0
- package/lib/engine/extensions/NEEDLE_lightmaps.js +2 -2
- package/lib/engine/extensions/NEEDLE_lightmaps.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_pmrem.d.ts +1 -1
- package/lib/engine/webcomponents/icons.js +3 -2
- package/lib/engine/webcomponents/icons.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.attributes.d.ts +69 -0
- package/lib/engine/webcomponents/needle-engine.attributes.js +2 -0
- package/lib/engine/webcomponents/needle-engine.attributes.js.map +1 -0
- package/lib/engine-components/AudioSource.js +1 -1
- package/lib/engine-components/AudioSource.js.map +1 -1
- package/lib/engine-components/Light.d.ts +3 -0
- package/lib/engine-components/Light.js +39 -31
- package/lib/engine-components/Light.js.map +1 -1
- package/lib/engine-components/OrbitControls.js +2 -1
- package/lib/engine-components/OrbitControls.js.map +1 -1
- package/lib/engine-components/SpriteRenderer.d.ts +1 -1
- package/lib/engine-components/VideoPlayer.d.ts +1 -1
- package/lib/engine-components/export/usdz/ThreeUSDZExporter.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/Animation.js +1 -0
- package/lib/engine-components/export/usdz/extensions/Animation.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js.map +1 -1
- package/lib/engine-components/particlesystem/ParticleSystem.d.ts +1 -1
- package/lib/engine-components/postprocessing/PostProcessingHandler.js.map +1 -1
- package/lib/engine-components/timeline/TimelineTracks.js.map +1 -1
- package/lib/engine-components/ui/BaseUIComponent_Uikit.d.ts +54 -0
- package/lib/engine-components/ui/BaseUIComponent_Uikit.js +114 -0
- package/lib/engine-components/ui/BaseUIComponent_Uikit.js.map +1 -0
- package/lib/engine-components/ui/BaseUikitComponent.d.ts +54 -0
- package/lib/engine-components/ui/BaseUikitComponent.js +114 -0
- package/lib/engine-components/ui/BaseUikitComponent.js.map +1 -0
- package/lib/engine-components/ui/Button.legacy.d.ts +68 -0
- package/lib/engine-components/ui/Button.legacy.js +320 -0
- package/lib/engine-components/ui/Button.legacy.js.map +1 -0
- package/lib/engine-components/ui/ButtonUikit.d.ts +51 -0
- package/lib/engine-components/ui/ButtonUikit.js +187 -0
- package/lib/engine-components/ui/ButtonUikit.js.map +1 -0
- package/lib/engine-components/ui/Canvas.js +2 -2
- package/lib/engine-components/ui/Canvas.js.map +1 -1
- package/lib/engine-components/ui/Canvas.legacy.d.ts +76 -0
- package/lib/engine-components/ui/Canvas.legacy.js +409 -0
- package/lib/engine-components/ui/Canvas.legacy.js.map +1 -0
- package/lib/engine-components/ui/CanvasUikit.d.ts +68 -0
- package/lib/engine-components/ui/CanvasUikit.js +289 -0
- package/lib/engine-components/ui/CanvasUikit.js.map +1 -0
- package/lib/engine-components/ui/Graphic.d.ts +3 -3
- package/lib/engine-components/ui/Graphic.js +6 -2
- package/lib/engine-components/ui/Graphic.js.map +1 -1
- package/lib/engine-components/ui/Graphic.legacy.d.ts +55 -0
- package/lib/engine-components/ui/Graphic.legacy.js +268 -0
- package/lib/engine-components/ui/Graphic.legacy.js.map +1 -0
- package/lib/engine-components/ui/GraphicUikit.d.ts +21 -0
- package/lib/engine-components/ui/GraphicUikit.js +65 -0
- package/lib/engine-components/ui/GraphicUikit.js.map +1 -0
- package/lib/engine-components/ui/Image.js.map +1 -1
- package/lib/engine-components/ui/Image.legacy.d.ts +39 -0
- package/lib/engine-components/ui/Image.legacy.js +121 -0
- package/lib/engine-components/ui/Image.legacy.js.map +1 -0
- package/lib/engine-components/ui/ImageUikit.d.ts +22 -0
- package/lib/engine-components/ui/ImageUikit.js +97 -0
- package/lib/engine-components/ui/ImageUikit.js.map +1 -0
- package/lib/engine-components/ui/RenderMode.d.ts +14 -0
- package/lib/engine-components/ui/RenderMode.js +16 -0
- package/lib/engine-components/ui/RenderMode.js.map +1 -0
- package/lib/engine-components/ui/Text.d.ts +64 -11
- package/lib/engine-components/ui/Text.js +154 -45
- package/lib/engine-components/ui/Text.js.map +1 -1
- package/lib/engine-components/ui/Text.legacy.d.ts +81 -0
- package/lib/engine-components/ui/Text.legacy.js +548 -0
- package/lib/engine-components/ui/Text.legacy.js.map +1 -0
- package/lib/engine-components/ui/TextUikit.d.ts +42 -0
- package/lib/engine-components/ui/TextUikit.js +164 -0
- package/lib/engine-components/ui/TextUikit.js.map +1 -0
- package/lib/engine-components/ui/index.d.ts +1 -0
- package/lib/engine-components/ui/index.js +1 -0
- package/lib/engine-components/ui/index.js.map +1 -1
- package/lib/engine-components/webxr/WebARCameraBackground.d.ts +1 -1
- package/lib/include/three/EXT_mesh_gpu_instancing_exporter.d.ts +6 -0
- package/lib/include/three/EXT_mesh_gpu_instancing_exporter.js +46 -0
- package/lib/include/three/EXT_mesh_gpu_instancing_exporter.js.map +1 -0
- package/package.json +5 -5
- package/plugins/common/buildinfo.d.ts +6 -0
- package/plugins/vite/ai.d.ts +7 -8
- package/plugins/vite/ai.js +95 -20
- package/plugins/vite/alias.js +6 -0
- package/plugins/vite/dependencies.js +7 -0
- package/src/engine/engine_animation.ts +1 -1
- package/src/engine/engine_audio.ts +1 -1
- package/src/engine/engine_context.ts +3 -6
- package/src/engine/engine_create_objects.ts +0 -1
- package/src/engine/engine_license.ts +0 -2
- package/src/engine/engine_pmrem.ts +3 -3
- package/src/engine/engine_three_utils.ts +2 -2
- package/src/engine/engine_time.ts +4 -3
- package/src/engine/extensions/NEEDLE_lightmaps.ts +3 -3
- package/src/engine/webcomponents/icons.ts +3 -2
- package/src/engine-components/AudioSource.ts +1 -1
- package/src/engine-components/Light.ts +39 -31
- package/src/engine-components/OrbitControls.ts +2 -2
- package/src/engine-components/export/usdz/ThreeUSDZExporter.ts +2 -2
- package/src/engine-components/export/usdz/extensions/Animation.ts +6 -5
- package/src/engine-components/export/usdz/extensions/behavior/BehaviourComponents.ts +1 -1
- package/src/engine-components/postprocessing/PostProcessingHandler.ts +3 -3
- package/src/engine-components/timeline/TimelineTracks.ts +2 -2
- package/src/engine-components/ui/Canvas.ts +2 -2
- package/src/engine-components/ui/Graphic.ts +7 -3
- package/src/engine-components/ui/Image.ts +1 -1
- package/src/engine-components/ui/Text.ts +170 -52
- package/src/engine-components/ui/index.ts +2 -1
- package/dist/generateMeshBVH.worker-DiCnZlf3.js +0 -21
- package/dist/gltf-progressive-BryRjllq.min.js +0 -10
- package/dist/gltf-progressive-DJBMx-zB.umd.cjs +0 -10
- package/dist/gltf-progressive.worker-BqODMeeW.js +0 -23
- package/dist/vendor-DPbfJJ4d.min.js +0 -1116
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";const r=require("./three.umd.cjs");class mo extends r.Mesh{constructor(e,t,s,n=128){if(t<=0||s<=0||n<=0)throw new Error("GroundedSkybox height, radius, and resolution must be positive.");const i=new r.SphereGeometry(s,2*n,n);i.scale(1,1,-1);const o=i.getAttribute("position"),a=new r.Vector3;for(let A=0;A<o.count;++A)if(a.fromBufferAttribute(o,A),a.y<0){const l=-t*3/2,h=a.y<l?-t/a.y:1-a.y*a.y/(3*l*l);a.multiplyScalar(h),a.toArray(o.array,3*A)}o.needsUpdate=!0,super(i,new r.MeshBasicMaterial({map:e,depthWrite:!1}))}}function bo(c,e=1e-4){e=Math.max(e,Number.EPSILON);const t={},s=c.getIndex(),n=c.getAttribute("position"),i=s?s.count:n.count;let o=0;const a=Object.keys(c.attributes),A={},l={},h=[],u=["getX","getY","getZ","getW"],g=["setX","setY","setZ","setW"];for(let w=0,C=a.length;w<C;w++){const y=a[w],x=c.attributes[y];A[y]=new x.constructor(new x.array.constructor(x.count*x.itemSize),x.itemSize,x.normalized);const R=c.morphAttributes[y];R&&(l[y]||(l[y]=[]),R.forEach((D,S)=>{const v=new D.array.constructor(D.count*D.itemSize);l[y][S]=new D.constructor(v,D.itemSize,D.normalized)}))}const f=e*.5,I=Math.log10(1/e),m=Math.pow(10,I),b=f*m;for(let w=0;w<i;w++){const C=s?s.getX(w):w;let y="";for(let x=0,R=a.length;x<R;x++){const D=a[x],S=c.getAttribute(D),v=S.itemSize;for(let N=0;N<v;N++)y+=`${~~(S[u[N]](C)*m+b)},`}if(y in t)h.push(t[y]);else{for(let x=0,R=a.length;x<R;x++){const D=a[x],S=c.getAttribute(D),v=c.morphAttributes[D],N=S.itemSize,G=A[D],H=l[D];for(let X=0;X<N;X++){const U=u[X],Y=g[X];if(G[Y](o,S[U](C)),v)for(let O=0,Z=v.length;O<Z;O++)H[O][Y](o,v[O][U](C))}}t[y]=o,h.push(o),o++}}const B=c.clone();for(const w in c.attributes){const C=A[w];if(B.setAttribute(w,new C.constructor(C.array.slice(0,o*C.itemSize),C.itemSize,C.normalized)),w in l)for(let y=0;y<l[w].length;y++){const x=l[w][y];B.morphAttributes[w][y]=new x.constructor(x.array.slice(0,o*x.itemSize),x.itemSize,x.normalized)}}return B.setIndex(h),B}function As(c,e){if(e===r.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),c;if(e===r.TriangleFanDrawMode||e===r.TriangleStripDrawMode){let t=c.getIndex();if(t===null){const o=[],a=c.getAttribute("position");if(a!==void 0){for(let A=0;A<a.count;A++)o.push(A);c.setIndex(o),t=c.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),c}const s=t.count-2,n=[];if(e===r.TriangleFanDrawMode)for(let o=1;o<=s;o++)n.push(t.getX(0)),n.push(t.getX(o)),n.push(t.getX(o+1));else for(let o=0;o<s;o++)o%2===0?(n.push(t.getX(o)),n.push(t.getX(o+1)),n.push(t.getX(o+2))):(n.push(t.getX(o+2)),n.push(t.getX(o+1)),n.push(t.getX(o)));n.length/3!==s&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const i=c.clone();return i.setIndex(n),i.clearGroups(),i}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),c}class Vn extends r.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new wo(t)}),this.register(function(t){return new Qo(t)}),this.register(function(t){return new Fo(t)}),this.register(function(t){return new Lo(t)}),this.register(function(t){return new ko(t)}),this.register(function(t){return new So(t)}),this.register(function(t){return new To(t)}),this.register(function(t){return new vo(t)}),this.register(function(t){return new Mo(t)}),this.register(function(t){return new yo(t)}),this.register(function(t){return new Ro(t)}),this.register(function(t){return new xo(t)}),this.register(function(t){return new _o(t)}),this.register(function(t){return new Do(t)}),this.register(function(t){return new Co(t)}),this.register(function(t){return new Go(t)}),this.register(function(t){return new Uo(t)})}load(e,t,s,n){const i=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const l=r.LoaderUtils.extractUrlBase(e);o=r.LoaderUtils.resolveURL(l,this.path)}else o=r.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);const a=function(l){n?n(l):console.error(l),i.manager.itemError(e),i.manager.itemEnd(e)},A=new r.FileLoader(this.manager);A.setPath(this.path),A.setResponseType("arraybuffer"),A.setRequestHeader(this.requestHeader),A.setWithCredentials(this.withCredentials),A.load(e,function(l){try{i.parse(l,o,function(h){t(h),i.manager.itemEnd(e)},a)}catch(h){a(h)}},s,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,s,n){let i,o;const a={},A={},l=new TextDecoder;if(typeof e=="string")try{i=JSON.parse(e)}catch(u){o=e,n&&n(u);return}else if(e instanceof ArrayBuffer)if(l.decode(new Uint8Array(e,0,4))===Zs){try{a[re.KHR_BINARY_GLTF]=new No(e)}catch(g){n&&n(g);return}try{i=JSON.parse(a[re.KHR_BINARY_GLTF].content)}catch(g){o=a[re.KHR_BINARY_GLTF].content,n&&n(g);return}}else try{i=JSON.parse(l.decode(e))}catch(g){o=l.decode(e),n&&n(g);return}else i=e;if(i.asset===void 0||i.asset.version[0]<2){n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}this.json=i,this.jsonErrorData=o;const h=new Zo(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});h.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u<this.pluginCallbacks.length;u++){const g=this.pluginCallbacks[u](h);g.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),A[g.name]=g,a[g.name]=!0}if(i.extensionsUsed)for(let u=0;u<i.extensionsUsed.length;++u){const g=i.extensionsUsed[u],f=i.extensionsRequired||[];switch(g){case re.KHR_MATERIALS_UNLIT:a[g]=new Bo;break;case re.KHR_DRACO_MESH_COMPRESSION:a[g]=new Po(i,this.dracoLoader);break;case re.KHR_TEXTURE_TRANSFORM:a[g]=new Oo;break;case re.KHR_MESH_QUANTIZATION:a[g]=new Ho;break;default:f.indexOf(g)>=0&&A[g]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+g+'".')}}h.setExtensions(a),h.setPlugins(A),h.parse(s,n)}parseAsync(e,t){const s=this;return new Promise(function(n,i){s.parse(e,t,n,i)})}}function Eo(){let c={};return{get:function(e){return c[e]},add:function(e,t){c[e]=t},remove:function(e){delete c[e]},removeAll:function(){c={}}}}const re={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 Co{constructor(e){this.parser=e,this.name=re.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let s=0,n=t.length;s<n;s++){const i=t[s];i.extensions&&i.extensions[this.name]&&i.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,i.extensions[this.name].light)}}_loadLight(e){const t=this.parser,s="light:"+e;let n=t.cache.get(s);if(n)return n;const i=t.json,A=((i.extensions&&i.extensions[this.name]||{}).lights||[])[e];let l;const h=new r.Color(16777215);A.color!==void 0&&h.setRGB(A.color[0],A.color[1],A.color[2],r.LinearSRGBColorSpace);const u=A.range!==void 0?A.range:0;switch(A.type){case"directional":l=new r.DirectionalLight(h),l.target.position.set(0,0,-1),l.add(l.target);break;case"point":l=new r.PointLight(h),l.distance=u;break;case"spot":l=new r.SpotLight(h),l.distance=u,A.spot=A.spot||{},A.spot.innerConeAngle=A.spot.innerConeAngle!==void 0?A.spot.innerConeAngle:0,A.spot.outerConeAngle=A.spot.outerConeAngle!==void 0?A.spot.outerConeAngle:Math.PI/4,l.angle=A.spot.outerConeAngle,l.penumbra=1-A.spot.innerConeAngle/A.spot.outerConeAngle,l.target.position.set(0,0,-1),l.add(l.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+A.type)}return l.position.set(0,0,0),l.decay=2,at(l,A),A.intensity!==void 0&&(l.intensity=A.intensity),l.name=t.createUniqueName(A.name||"light_"+e),n=Promise.resolve(l),t.cache.add(s,n),n}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,s=this.parser,i=s.json.nodes[e],a=(i.extensions&&i.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(A){return s._getNodeRef(t.cache,a,A)})}}let Bo=class{constructor(){this.name=re.KHR_MATERIALS_UNLIT}getMaterialType(){return r.MeshBasicMaterial}extendParams(e,t,s){const n=[];e.color=new r.Color(1,1,1),e.opacity=1;const i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){const o=i.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],r.LinearSRGBColorSpace),e.opacity=o[3]}i.baseColorTexture!==void 0&&n.push(s.assignTexture(e,"map",i.baseColorTexture,r.SRGBColorSpace))}return Promise.all(n)}},yo=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name].emissiveStrength;return i!==void 0&&(t.emissiveIntensity=i),Promise.resolve()}},wo=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:r.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],o=n.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&i.push(s.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&i.push(s.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(i.push(s.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const a=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new r.Vector2(a,a)}return Promise.all(i)}},Qo=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_DISPERSION}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:r.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name];return t.dispersion=i.dispersion!==void 0?i.dispersion:0,Promise.resolve()}},xo=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:r.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],o=n.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&i.push(s.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&i.push(s.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(i)}},So=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_SHEEN}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:r.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[];t.sheenColor=new r.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=n.extensions[this.name];if(o.sheenColorFactor!==void 0){const a=o.sheenColorFactor;t.sheenColor.setRGB(a[0],a[1],a[2],r.LinearSRGBColorSpace)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&i.push(s.assignTexture(t,"sheenColorMap",o.sheenColorTexture,r.SRGBColorSpace)),o.sheenRoughnessTexture!==void 0&&i.push(s.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(i)}},To=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:r.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],o=n.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&i.push(s.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(i)}},vo=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_VOLUME}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:r.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],o=n.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&i.push(s.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const a=o.attenuationColor||[1,1,1];return t.attenuationColor=new r.Color().setRGB(a[0],a[1],a[2],r.LinearSRGBColorSpace),Promise.all(i)}},Mo=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_IOR}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:r.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name];return t.ior=i.ior!==void 0?i.ior:1.5,Promise.resolve()}},Ro=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_SPECULAR}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:r.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],o=n.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&i.push(s.assignTexture(t,"specularIntensityMap",o.specularTexture));const a=o.specularColorFactor||[1,1,1];return t.specularColor=new r.Color().setRGB(a[0],a[1],a[2],r.LinearSRGBColorSpace),o.specularColorTexture!==void 0&&i.push(s.assignTexture(t,"specularColorMap",o.specularColorTexture,r.SRGBColorSpace)),Promise.all(i)}},Do=class{constructor(e){this.parser=e,this.name=re.EXT_MATERIALS_BUMP}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:r.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],o=n.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&i.push(s.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(i)}},_o=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:r.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],o=n.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&i.push(s.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(i)}};class Fo{constructor(e){this.parser=e,this.name=re.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,s=t.json,n=s.textures[e];if(!n.extensions||!n.extensions[this.name])return null;const i=n.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(s.extensionsRequired&&s.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i.source,o)}}class Lo{constructor(e){this.parser=e,this.name=re.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,n=s.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;const o=i.extensions[t],a=n.images[o.source];let A=s.textureLoader;if(a.uri){const l=s.options.manager.getHandler(a.uri);l!==null&&(A=l)}return this.detectSupport().then(function(l){if(l)return s.loadTextureImage(e,o.source,A);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class ko{constructor(e){this.parser=e,this.name=re.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,n=s.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;const o=i.extensions[t],a=n.images[o.source];let A=s.textureLoader;if(a.uri){const l=s.options.manager.getHandler(a.uri);l!==null&&(A=l)}return this.detectSupport().then(function(l){if(l)return s.loadTextureImage(e,o.source,A);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class Go{constructor(e){this.name=re.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,s=t.bufferViews[e];if(s.extensions&&s.extensions[this.name]){const n=s.extensions[this.name],i=this.parser.getDependency("buffer",n.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return i.then(function(a){const A=n.byteOffset||0,l=n.byteLength||0,h=n.count,u=n.byteStride,g=new Uint8Array(a,A,l);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(h,u,g,n.mode,n.filter).then(function(f){return f.buffer}):o.ready.then(function(){const f=new ArrayBuffer(h*u);return o.decodeGltfBuffer(new Uint8Array(f),h,u,g,n.mode,n.filter),f})})}else return null}}let Uo=class{constructor(e){this.name=re.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,s=t.nodes[e];if(!s.extensions||!s.extensions[this.name]||s.mesh===void 0)return null;const n=t.meshes[s.mesh];for(const l of n.primitives)if(l.mode!==Ve.TRIANGLES&&l.mode!==Ve.TRIANGLE_STRIP&&l.mode!==Ve.TRIANGLE_FAN&&l.mode!==void 0)return null;const o=s.extensions[this.name].attributes,a=[],A={};for(const l in o)a.push(this.parser.getDependency("accessor",o[l]).then(h=>(A[l]=h,A[l])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(l=>{const h=l.pop(),u=h.isGroup?h.children:[h],g=l[0].count,f=[];for(const I of u){const m=new r.Matrix4,b=new r.Vector3,B=new r.Quaternion,w=new r.Vector3(1,1,1),C=new r.InstancedMesh(I.geometry,I.material,g);for(let y=0;y<g;y++)A.TRANSLATION&&b.fromBufferAttribute(A.TRANSLATION,y),A.ROTATION&&B.fromBufferAttribute(A.ROTATION,y),A.SCALE&&w.fromBufferAttribute(A.SCALE,y),C.setMatrixAt(y,m.compose(b,B,w));for(const y in A)if(y==="_COLOR_0"){const x=A[y];C.instanceColor=new r.InstancedBufferAttribute(x.array,x.itemSize,x.normalized)}else y!=="TRANSLATION"&&y!=="ROTATION"&&y!=="SCALE"&&I.geometry.setAttribute(y,A[y]);r.Object3D.prototype.copy.call(C,I),this.parser.assignFinalMaterial(C),f.push(C)}return h.isGroup?(h.clear(),h.add(...f),h):f[0]}))}};const Zs="glTF",Rt=12,cs={JSON:1313821514,BIN:5130562};class No{constructor(e){this.name=re.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Rt),s=new TextDecoder;if(this.header={magic:s.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==Zs)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-Rt,i=new DataView(e,Rt);let o=0;for(;o<n;){const a=i.getUint32(o,!0);o+=4;const A=i.getUint32(o,!0);if(o+=4,A===cs.JSON){const l=new Uint8Array(e,Rt+o,a);this.content=s.decode(l)}else if(A===cs.BIN){const l=Rt+o;this.body=e.slice(l,l+a)}o+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Po{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=re.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const s=this.json,n=this.dracoLoader,i=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,a={},A={},l={};for(const h in o){const u=Un[h]||h.toLowerCase();a[u]=o[h]}for(const h in e.attributes){const u=Un[h]||h.toLowerCase();if(o[h]!==void 0){const g=s.accessors[e.attributes[h]],f=Tt[g.componentType];l[u]=f.name,A[u]=g.normalized===!0}}return t.getDependency("bufferView",i).then(function(h){return new Promise(function(u,g){n.decodeDracoFile(h,function(f){for(const I in f.attributes){const m=f.attributes[I],b=A[I];b!==void 0&&(m.normalized=b)}u(f)},a,l,r.LinearSRGBColorSpace,g)})})}}class Oo{constructor(){this.name=re.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class Ho{constructor(){this.name=re.KHR_MESH_QUANTIZATION}}class $s extends r.Interpolant{constructor(e,t,s,n){super(e,t,s,n)}copySampleValue_(e){const t=this.resultBuffer,s=this.sampleValues,n=this.valueSize,i=e*n*3+n;for(let o=0;o!==n;o++)t[o]=s[i+o];return t}interpolate_(e,t,s,n){const i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,A=a*2,l=a*3,h=n-t,u=(s-t)/h,g=u*u,f=g*u,I=e*l,m=I-l,b=-2*f+3*g,B=f-g,w=1-b,C=B-g+u;for(let y=0;y!==a;y++){const x=o[m+y+a],R=o[m+y+A]*h,D=o[I+y+a],S=o[I+y]*h;i[y]=w*x+C*R+b*D+B*S}return i}}const jo=new r.Quaternion;class qo extends $s{interpolate_(e,t,s,n){const i=super.interpolate_(e,t,s,n);return jo.fromArray(i).normalize().toArray(i),i}}const Ve={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},Tt={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},ls={9728:r.NearestFilter,9729:r.LinearFilter,9984:r.NearestMipmapNearestFilter,9985:r.LinearMipmapNearestFilter,9986:r.NearestMipmapLinearFilter,9987:r.LinearMipmapLinearFilter},hs={33071:r.ClampToEdgeWrapping,33648:r.MirroredRepeatWrapping,10497:r.RepeatWrapping},pn={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Un={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"},lt={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},zo={CUBICSPLINE:void 0,LINEAR:r.InterpolateLinear,STEP:r.InterpolateDiscrete},gn={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Yo(c){return c.DefaultMaterial===void 0&&(c.DefaultMaterial=new r.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:r.FrontSide})),c.DefaultMaterial}function dt(c,e,t){for(const s in t.extensions)c[s]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[s]=t.extensions[s])}function at(c,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(c.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function Ko(c,e,t){let s=!1,n=!1,i=!1;for(let l=0,h=e.length;l<h;l++){const u=e[l];if(u.POSITION!==void 0&&(s=!0),u.NORMAL!==void 0&&(n=!0),u.COLOR_0!==void 0&&(i=!0),s&&n&&i)break}if(!s&&!n&&!i)return Promise.resolve(c);const o=[],a=[],A=[];for(let l=0,h=e.length;l<h;l++){const u=e[l];if(s){const g=u.POSITION!==void 0?t.getDependency("accessor",u.POSITION):c.attributes.position;o.push(g)}if(n){const g=u.NORMAL!==void 0?t.getDependency("accessor",u.NORMAL):c.attributes.normal;a.push(g)}if(i){const g=u.COLOR_0!==void 0?t.getDependency("accessor",u.COLOR_0):c.attributes.color;A.push(g)}}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(A)]).then(function(l){const h=l[0],u=l[1],g=l[2];return s&&(c.morphAttributes.position=h),n&&(c.morphAttributes.normal=u),i&&(c.morphAttributes.color=g),c.morphTargetsRelative=!0,c})}function Vo(c,e){if(c.updateMorphTargets(),e.weights!==void 0)for(let t=0,s=e.weights.length;t<s;t++)c.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(c.morphTargetInfluences.length===t.length){c.morphTargetDictionary={};for(let s=0,n=t.length;s<n;s++)c.morphTargetDictionary[t[s]]=s}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Jo(c){let e;const t=c.extensions&&c.extensions[re.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+fn(t.attributes):e=c.indices+":"+fn(c.attributes)+":"+c.mode,c.targets!==void 0)for(let s=0,n=c.targets.length;s<n;s++)e+=":"+fn(c.targets[s]);return e}function fn(c){let e="";const t=Object.keys(c).sort();for(let s=0,n=t.length;s<n;s++)e+=t[s]+":"+c[t[s]]+";";return e}function Nn(c){switch(c){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 Wo(c){return c.search(/\.jpe?g($|\?)/i)>0||c.search(/^data\:image\/jpeg/)===0?"image/jpeg":c.search(/\.webp($|\?)/i)>0||c.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const Xo=new r.Matrix4;class Zo{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Eo,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 s=!1,n=-1,i=!1,o=-1;if(typeof navigator<"u"){const a=navigator.userAgent;s=/^((?!chrome|android).)*safari/i.test(a)===!0;const A=a.match(/Version\/(\d+)/);n=s&&A?parseInt(A[1],10):-1,i=a.indexOf("Firefox")>-1,o=i?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||s&&n<17||i&&o<98?this.textureLoader=new r.TextureLoader(this.options.manager):this.textureLoader=new r.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new r.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const s=this,n=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([s.getDependencies("scene"),s.getDependencies("animation"),s.getDependencies("camera")])}).then(function(o){const a={scene:o[0][n.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:n.asset,parser:s,userData:{}};return dt(i,a,n),at(a,n),Promise.all(s._invokeAll(function(A){return A.afterRoot&&A.afterRoot(a)})).then(function(){for(const A of a.scenes)A.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],s=this.json.meshes||[];for(let n=0,i=t.length;n<i;n++){const o=t[n].joints;for(let a=0,A=o.length;a<A;a++)e[o[a]].isBone=!0}for(let n=0,i=e.length;n<i;n++){const o=e[n];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(s[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,s){if(e.refs[t]<=1)return s;const n=s.clone(),i=(o,a)=>{const A=this.associations.get(o);A!=null&&this.associations.set(a,A);for(const[l,h]of o.children.entries())i(h,a.children[l])};return i(s,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let s=0;s<t.length;s++){const n=e(t[s]);if(n)return n}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const s=[];for(let n=0;n<t.length;n++){const i=e(t[n]);i&&s.push(i)}return s}getDependency(e,t){const s=e+":"+t;let n=this.cache.get(s);if(!n){switch(e){case"scene":n=this.loadScene(t);break;case"node":n=this._invokeOne(function(i){return i.loadNode&&i.loadNode(t)});break;case"mesh":n=this._invokeOne(function(i){return i.loadMesh&&i.loadMesh(t)});break;case"accessor":n=this.loadAccessor(t);break;case"bufferView":n=this._invokeOne(function(i){return i.loadBufferView&&i.loadBufferView(t)});break;case"buffer":n=this.loadBuffer(t);break;case"material":n=this._invokeOne(function(i){return i.loadMaterial&&i.loadMaterial(t)});break;case"texture":n=this._invokeOne(function(i){return i.loadTexture&&i.loadTexture(t)});break;case"skin":n=this.loadSkin(t);break;case"animation":n=this._invokeOne(function(i){return i.loadAnimation&&i.loadAnimation(t)});break;case"camera":n=this.loadCamera(t);break;default:if(n=this._invokeOne(function(i){return i!=this&&i.getDependency&&i.getDependency(e,t)}),!n)throw new Error("Unknown type: "+e);break}this.cache.add(s,n)}return n}getDependencies(e){let t=this.cache.get(e);if(!t){const s=this,n=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(n.map(function(i,o){return s.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],s=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[re.KHR_BINARY_GLTF].body);const n=this.options;return new Promise(function(i,o){s.load(r.LoaderUtils.resolveURL(t.uri,n.path),i,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(s){const n=t.byteLength||0,i=t.byteOffset||0;return s.slice(i,i+n)})}loadAccessor(e){const t=this,s=this.json,n=this.json.accessors[e];if(n.bufferView===void 0&&n.sparse===void 0){const o=pn[n.type],a=Tt[n.componentType],A=n.normalized===!0,l=new a(n.count*o);return Promise.resolve(new r.BufferAttribute(l,o,A))}const i=[];return n.bufferView!==void 0?i.push(this.getDependency("bufferView",n.bufferView)):i.push(null),n.sparse!==void 0&&(i.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),i.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(i).then(function(o){const a=o[0],A=pn[n.type],l=Tt[n.componentType],h=l.BYTES_PER_ELEMENT,u=h*A,g=n.byteOffset||0,f=n.bufferView!==void 0?s.bufferViews[n.bufferView].byteStride:void 0,I=n.normalized===!0;let m,b;if(f&&f!==u){const B=Math.floor(g/f),w="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+B+":"+n.count;let C=t.cache.get(w);C||(m=new l(a,B*f,n.count*f/h),C=new r.InterleavedBuffer(m,f/h),t.cache.add(w,C)),b=new r.InterleavedBufferAttribute(C,A,g%f/h,I)}else a===null?m=new l(n.count*A):m=new l(a,g,n.count*A),b=new r.BufferAttribute(m,A,I);if(n.sparse!==void 0){const B=pn.SCALAR,w=Tt[n.sparse.indices.componentType],C=n.sparse.indices.byteOffset||0,y=n.sparse.values.byteOffset||0,x=new w(o[1],C,n.sparse.count*B),R=new l(o[2],y,n.sparse.count*A);a!==null&&(b=new r.BufferAttribute(b.array.slice(),b.itemSize,b.normalized)),b.normalized=!1;for(let D=0,S=x.length;D<S;D++){const v=x[D];if(b.setX(v,R[D*A]),A>=2&&b.setY(v,R[D*A+1]),A>=3&&b.setZ(v,R[D*A+2]),A>=4&&b.setW(v,R[D*A+3]),A>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}b.normalized=I}return b})}loadTexture(e){const t=this.json,s=this.options,i=t.textures[e].source,o=t.images[i];let a=this.textureLoader;if(o.uri){const A=s.manager.getHandler(o.uri);A!==null&&(a=A)}return this.loadTextureImage(e,i,a)}loadTextureImage(e,t,s){const n=this,i=this.json,o=i.textures[e],a=i.images[t],A=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[A])return this.textureCache[A];const l=this.loadImageSource(t,s).then(function(h){h.flipY=!1,h.name=o.name||a.name||"",h.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(h.name=a.uri);const g=(i.samplers||{})[o.sampler]||{};return h.magFilter=ls[g.magFilter]||r.LinearFilter,h.minFilter=ls[g.minFilter]||r.LinearMipmapLinearFilter,h.wrapS=hs[g.wrapS]||r.RepeatWrapping,h.wrapT=hs[g.wrapT]||r.RepeatWrapping,h.anisotropy=4,n.associations.set(h,{textures:e}),h}).catch(function(){return null});return this.textureCache[A]=l,l}loadImageSource(e,t){const s=this,n=this.json,i=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());const o=n.images[e],a=self.URL||self.webkitURL;let A=o.uri||"",l=!1;if(o.bufferView!==void 0)A=s.getDependency("bufferView",o.bufferView).then(function(u){l=!0;const g=new Blob([u],{type:o.mimeType});return A=a.createObjectURL(g),A});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const h=Promise.resolve(A).then(function(u){return new Promise(function(g,f){let I=g;t.isImageBitmapLoader===!0&&(I=function(m){const b=new r.Texture(m);b.needsUpdate=!0,g(b)}),t.load(r.LoaderUtils.resolveURL(u,i.path),I,void 0,f)})}).then(function(u){return l===!0&&a.revokeObjectURL(A),at(u,o),u.userData.mimeType=o.mimeType||Wo(o.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",A),u});return this.sourceCache[e]=h,h}assignTexture(e,t,s,n){const i=this;return this.getDependency("texture",s.index).then(function(o){if(!o)return null;if(s.texCoord!==void 0&&s.texCoord>0&&(o=o.clone(),o.channel=s.texCoord),i.extensions[re.KHR_TEXTURE_TRANSFORM]){const a=s.extensions!==void 0?s.extensions[re.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const A=i.associations.get(o);o=i.extensions[re.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),i.associations.set(o,A)}}return n!==void 0&&(o.colorSpace=n),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let s=e.material;const n=t.attributes.tangent===void 0,i=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+s.uuid;let A=this.cache.get(a);A||(A=new r.PointsMaterial,r.Material.prototype.copy.call(A,s),A.color.copy(s.color),A.map=s.map,A.sizeAttenuation=!1,this.cache.add(a,A)),s=A}else if(e.isLine){const a="LineBasicMaterial:"+s.uuid;let A=this.cache.get(a);A||(A=new r.LineBasicMaterial,r.Material.prototype.copy.call(A,s),A.color.copy(s.color),A.map=s.map,this.cache.add(a,A)),s=A}if(n||i||o){let a="ClonedMaterial:"+s.uuid+":";n&&(a+="derivative-tangents:"),i&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let A=this.cache.get(a);A||(A=s.clone(),i&&(A.vertexColors=!0),o&&(A.flatShading=!0),n&&(A.normalScale&&(A.normalScale.y*=-1),A.clearcoatNormalScale&&(A.clearcoatNormalScale.y*=-1)),this.cache.add(a,A),this.associations.set(A,this.associations.get(s))),s=A}e.material=s}getMaterialType(){return r.MeshStandardMaterial}loadMaterial(e){const t=this,s=this.json,n=this.extensions,i=s.materials[e];let o;const a={},A=i.extensions||{},l=[];if(A[re.KHR_MATERIALS_UNLIT]){const u=n[re.KHR_MATERIALS_UNLIT];o=u.getMaterialType(),l.push(u.extendParams(a,i,t))}else{const u=i.pbrMetallicRoughness||{};if(a.color=new r.Color(1,1,1),a.opacity=1,Array.isArray(u.baseColorFactor)){const g=u.baseColorFactor;a.color.setRGB(g[0],g[1],g[2],r.LinearSRGBColorSpace),a.opacity=g[3]}u.baseColorTexture!==void 0&&l.push(t.assignTexture(a,"map",u.baseColorTexture,r.SRGBColorSpace)),a.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,a.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(l.push(t.assignTexture(a,"metalnessMap",u.metallicRoughnessTexture)),l.push(t.assignTexture(a,"roughnessMap",u.metallicRoughnessTexture))),o=this._invokeOne(function(g){return g.getMaterialType&&g.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(g){return g.extendMaterialParams&&g.extendMaterialParams(e,a)})))}i.doubleSided===!0&&(a.side=r.DoubleSide);const h=i.alphaMode||gn.OPAQUE;if(h===gn.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,h===gn.MASK&&(a.alphaTest=i.alphaCutoff!==void 0?i.alphaCutoff:.5)),i.normalTexture!==void 0&&o!==r.MeshBasicMaterial&&(l.push(t.assignTexture(a,"normalMap",i.normalTexture)),a.normalScale=new r.Vector2(1,1),i.normalTexture.scale!==void 0)){const u=i.normalTexture.scale;a.normalScale.set(u,u)}if(i.occlusionTexture!==void 0&&o!==r.MeshBasicMaterial&&(l.push(t.assignTexture(a,"aoMap",i.occlusionTexture)),i.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=i.occlusionTexture.strength)),i.emissiveFactor!==void 0&&o!==r.MeshBasicMaterial){const u=i.emissiveFactor;a.emissive=new r.Color().setRGB(u[0],u[1],u[2],r.LinearSRGBColorSpace)}return i.emissiveTexture!==void 0&&o!==r.MeshBasicMaterial&&l.push(t.assignTexture(a,"emissiveMap",i.emissiveTexture,r.SRGBColorSpace)),Promise.all(l).then(function(){const u=new o(a);return i.name&&(u.name=i.name),at(u,i),t.associations.set(u,{materials:e}),i.extensions&&dt(n,u,i),u})}createUniqueName(e){const t=r.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,s=this.extensions,n=this.primitiveCache;function i(a){return s[re.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(A){return us(A,a,t)})}const o=[];for(let a=0,A=e.length;a<A;a++){const l=e[a],h=Jo(l),u=n[h];if(u)o.push(u.promise);else{let g;l.extensions&&l.extensions[re.KHR_DRACO_MESH_COMPRESSION]?g=i(l):g=us(new r.BufferGeometry,l,t),n[h]={primitive:l,promise:g},o.push(g)}}return Promise.all(o)}loadMesh(e){const t=this,s=this.json,n=this.extensions,i=s.meshes[e],o=i.primitives,a=[];for(let A=0,l=o.length;A<l;A++){const h=o[A].material===void 0?Yo(this.cache):this.getDependency("material",o[A].material);a.push(h)}return a.push(t.loadGeometries(o)),Promise.all(a).then(function(A){const l=A.slice(0,A.length-1),h=A[A.length-1],u=[];for(let f=0,I=h.length;f<I;f++){const m=h[f],b=o[f];let B;const w=l[f];if(b.mode===Ve.TRIANGLES||b.mode===Ve.TRIANGLE_STRIP||b.mode===Ve.TRIANGLE_FAN||b.mode===void 0)B=i.isSkinnedMesh===!0?new r.SkinnedMesh(m,w):new r.Mesh(m,w),B.isSkinnedMesh===!0&&B.normalizeSkinWeights(),b.mode===Ve.TRIANGLE_STRIP?B.geometry=As(B.geometry,r.TriangleStripDrawMode):b.mode===Ve.TRIANGLE_FAN&&(B.geometry=As(B.geometry,r.TriangleFanDrawMode));else if(b.mode===Ve.LINES)B=new r.LineSegments(m,w);else if(b.mode===Ve.LINE_STRIP)B=new r.Line(m,w);else if(b.mode===Ve.LINE_LOOP)B=new r.LineLoop(m,w);else if(b.mode===Ve.POINTS)B=new r.Points(m,w);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+b.mode);Object.keys(B.geometry.morphAttributes).length>0&&Vo(B,i),B.name=t.createUniqueName(i.name||"mesh_"+e),at(B,i),b.extensions&&dt(n,B,b),t.assignFinalMaterial(B),u.push(B)}for(let f=0,I=u.length;f<I;f++)t.associations.set(u[f],{meshes:e,primitives:f});if(u.length===1)return i.extensions&&dt(n,u[0],i),u[0];const g=new r.Group;i.extensions&&dt(n,g,i),t.associations.set(g,{meshes:e});for(let f=0,I=u.length;f<I;f++)g.add(u[f]);return g})}loadCamera(e){let t;const s=this.json.cameras[e],n=s[s.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return s.type==="perspective"?t=new r.PerspectiveCamera(r.MathUtils.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):s.type==="orthographic"&&(t=new r.OrthographicCamera(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),s.name&&(t.name=this.createUniqueName(s.name)),at(t,s),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],s=[];for(let n=0,i=t.joints.length;n<i;n++)s.push(this._loadNodeShallow(t.joints[n]));return t.inverseBindMatrices!==void 0?s.push(this.getDependency("accessor",t.inverseBindMatrices)):s.push(null),Promise.all(s).then(function(n){const i=n.pop(),o=n,a=[],A=[];for(let l=0,h=o.length;l<h;l++){const u=o[l];if(u){a.push(u);const g=new r.Matrix4;i!==null&&g.fromArray(i.array,l*16),A.push(g)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[l])}return new r.Skeleton(a,A)})}loadAnimation(e){const t=this.json,s=this,n=t.animations[e],i=n.name?n.name:"animation_"+e,o=[],a=[],A=[],l=[],h=[];let u=0,g=n.channels.length;for(u=0,g=n.channels.length;u<g;u++){const f=n.channels[u],I=n.samplers[f.sampler],m=f.target,b=m.node,B=n.parameters!==void 0?n.parameters[I.input]:I.input,w=n.parameters!==void 0?n.parameters[I.output]:I.output;m.node!==void 0&&(o.push(this.getDependency("node",b)),a.push(this.getDependency("accessor",B)),A.push(this.getDependency("accessor",w)),l.push(I),h.push(m))}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(A),Promise.all(l),Promise.all(h)]).then(function(f){const I=f[0],m=f[1],b=f[2],B=f[3],w=f[4],C=[];for(u=0,g=I.length;u<g;u++){const y=I[u],x=m[u],R=b[u],D=B[u],S=w[u];if(y===void 0)continue;y.updateMatrix&&y.updateMatrix();const v=s._createAnimationTracks(y,x,R,D,S);if(v)for(let N=0;N<v.length;N++)C.push(v[N])}return new r.AnimationClip(i,void 0,C)})}createNodeMesh(e){const t=this.json,s=this,n=t.nodes[e];return n.mesh===void 0?null:s.getDependency("mesh",n.mesh).then(function(i){const o=s._getNodeRef(s.meshCache,n.mesh,i);return n.weights!==void 0&&o.traverse(function(a){if(a.isMesh)for(let A=0,l=n.weights.length;A<l;A++)a.morphTargetInfluences[A]=n.weights[A]}),o})}loadNode(e){const t=this.json,s=this,n=t.nodes[e],i=s._loadNodeShallow(e),o=[],a=n.children||[];for(let l=0,h=a.length;l<h;l++)o.push(s.getDependency("node",a[l]));const A=n.skin===void 0?Promise.resolve(null):s.getDependency("skin",n.skin);return Promise.all([i,Promise.all(o),A]).then(function(l){const h=l[0],u=l[1],g=l[2];g!==null&&h.traverse(function(f){f.isSkinnedMesh&&f.bind(g,Xo)});for(let f=0,I=u.length;f<I;f++)h.add(u[f]);return h})}_loadNodeShallow(e){const t=this.json,s=this.extensions,n=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const i=t.nodes[e],o=i.name?n.createUniqueName(i.name):"",a=[],A=n._invokeOne(function(l){return l.createNodeMesh&&l.createNodeMesh(e)});return A&&a.push(A),i.camera!==void 0&&a.push(n.getDependency("camera",i.camera).then(function(l){return n._getNodeRef(n.cameraCache,i.camera,l)})),n._invokeAll(function(l){return l.createNodeAttachment&&l.createNodeAttachment(e)}).forEach(function(l){a.push(l)}),this.nodeCache[e]=Promise.all(a).then(function(l){let h;if(i.isBone===!0?h=new r.Bone:l.length>1?h=new r.Group:l.length===1?h=l[0]:h=new r.Object3D,h!==l[0])for(let u=0,g=l.length;u<g;u++)h.add(l[u]);if(i.name&&(h.userData.name=i.name,h.name=o),at(h,i),i.extensions&&dt(s,h,i),i.matrix!==void 0){const u=new r.Matrix4;u.fromArray(i.matrix),h.applyMatrix4(u)}else i.translation!==void 0&&h.position.fromArray(i.translation),i.rotation!==void 0&&h.quaternion.fromArray(i.rotation),i.scale!==void 0&&h.scale.fromArray(i.scale);return n.associations.has(h)||n.associations.set(h,{}),n.associations.get(h).nodes=e,h}),this.nodeCache[e]}loadScene(e){const t=this.extensions,s=this.json.scenes[e],n=this,i=new r.Group;s.name&&(i.name=n.createUniqueName(s.name)),at(i,s),s.extensions&&dt(t,i,s);const o=s.nodes||[],a=[];for(let A=0,l=o.length;A<l;A++)a.push(n.getDependency("node",o[A]));return Promise.all(a).then(function(A){for(let h=0,u=A.length;h<u;h++)i.add(A[h]);const l=h=>{const u=new Map;for(const[g,f]of n.associations)(g instanceof r.Material||g instanceof r.Texture)&&u.set(g,f);return h.traverse(g=>{const f=n.associations.get(g);f!=null&&u.set(g,f)}),u};return n.associations=l(i),i})}_createAnimationTracks(e,t,s,n,i){const o=[],a=e.name?e.name:e.uuid,A=[];lt[i.path]===lt.weights?e.traverse(function(g){g.morphTargetInfluences&&A.push(g.name?g.name:g.uuid)}):A.push(a);let l;switch(lt[i.path]){case lt.weights:l=r.NumberKeyframeTrack;break;case lt.rotation:l=r.QuaternionKeyframeTrack;break;case lt.position:case lt.scale:l=r.VectorKeyframeTrack;break;default:s.itemSize===1?l=r.NumberKeyframeTrack:l=r.VectorKeyframeTrack;break}const h=n.interpolation!==void 0?zo[n.interpolation]:r.InterpolateLinear,u=this._getArrayFromAccessor(s);for(let g=0,f=A.length;g<f;g++){const I=new l(A[g]+"."+lt[i.path],t.array,u,h);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(I),o.push(I)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const s=Nn(t.constructor),n=new Float32Array(t.length);for(let i=0,o=t.length;i<o;i++)n[i]=t[i]*s;t=n}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(s){const n=this instanceof r.QuaternionKeyframeTrack?qo:$s;return new n(this.times,this.values,this.getValueSize()/3,s)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function $o(c,e,t){const s=e.attributes,n=new r.Box3;if(s.POSITION!==void 0){const a=t.json.accessors[s.POSITION],A=a.min,l=a.max;if(A!==void 0&&l!==void 0){if(n.set(new r.Vector3(A[0],A[1],A[2]),new r.Vector3(l[0],l[1],l[2])),a.normalized){const h=Nn(Tt[a.componentType]);n.min.multiplyScalar(h),n.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const i=e.targets;if(i!==void 0){const a=new r.Vector3,A=new r.Vector3;for(let l=0,h=i.length;l<h;l++){const u=i[l];if(u.POSITION!==void 0){const g=t.json.accessors[u.POSITION],f=g.min,I=g.max;if(f!==void 0&&I!==void 0){if(A.setX(Math.max(Math.abs(f[0]),Math.abs(I[0]))),A.setY(Math.max(Math.abs(f[1]),Math.abs(I[1]))),A.setZ(Math.max(Math.abs(f[2]),Math.abs(I[2]))),g.normalized){const m=Nn(Tt[g.componentType]);A.multiplyScalar(m)}a.max(A)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(a)}c.boundingBox=n;const o=new r.Sphere;n.getCenter(o.center),o.radius=n.min.distanceTo(n.max)/2,c.boundingSphere=o}function us(c,e,t){const s=e.attributes,n=[];function i(o,a){return t.getDependency("accessor",o).then(function(A){c.setAttribute(a,A)})}for(const o in s){const a=Un[o]||o.toLowerCase();a in c.attributes||n.push(i(s[o],a))}if(e.indices!==void 0&&!c.index){const o=t.getDependency("accessor",e.indices).then(function(a){c.setIndex(a)});n.push(o)}return r.ColorManagement.workingColorSpace!==r.LinearSRGBColorSpace&&"COLOR_0"in s&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${r.ColorManagement.workingColorSpace}" not supported.`),at(c,e),$o(c,e,t),Promise.all(n).then(function(){return e.targets!==void 0?Ko(c,e.targets,t):c})}var er=(function(){var c="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:P8Yqdbk;3sezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfgocl4cifcd4hxdndndndnaoc9WGgmTmbcbhPcehsawcjdfhzalhHinaraH9Rax6midnaraHaxfgl9RcK6mbczhoinawcj;cbfaogifgoc9WfhOdndndndndnaHaic9WfgAco4fRbbaAci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOalRblalRbbgAco4gCaCciSgCE86bbaocGfalclfaCfgORbbaAcl4ciGgCaCciSgCE86bbaocVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbaoc7faOaCfgORbbaAciGgAaAciSgAE86bbaoctfaOaAfgARbbalRbegOco4gCaCciSgCE86bbaoc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc93faAaCfgARbbaOciGgOaOciSgOE86bbaoc94faAaOfgARbbalRbdgOco4gCaCciSgCE86bbaoc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc97faAaCfgARbbaOciGgOaOciSgOE86bbaoc98faAaOfgORbbalRbiglco4gAaAciSgAE86bbaoc99faOaAfgORbbalcl4ciGgAaAciSgAE86bbaoc9:faOaAfgORbbalcd4ciGgAaAciSgAE86bbaocufaOaAfgoRbbalciGglalciSglE86bbaoalfhlxdkaOalRbwalRbbgAcl4gCaCcsSgCE86bbaocGfalcwfaCfgORbbaAcsGgAaAcsSgAE86bbaocVfaOaAfgORbbalRbegAcl4gCaCcsSgCE86bbaoc7faOaCfgORbbaAcsGgAaAcsSgAE86bbaoctfaOaAfgORbbalRbdgAcl4gCaCcsSgCE86bbaoc91faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc4faOaAfgORbbalRbigAcl4gCaCcsSgCE86bbaoc93faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc94faOaAfgORbbalRblgAcl4gCaCcsSgCE86bbaoc95faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc96faOaAfgORbbalRbvgAcl4gCaCcsSgCE86bbaoc97faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc98faOaAfgORbbalRbogAcl4gCaCcsSgCE86bbaoc99faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc9:faOaAfgORbbalRbrglcl4gAaAcsSgAE86bbaocufaOaAfgoRbbalcsGglalcsSglE86bbaoalfhlxekaOal8Pbb83bbaOcwfalcwf8Pbb83bbalczfhlkdnaiam9pmbaiczfhoaral9RcL0mekkaiam6mialTmidnakTmbawaPfRbbhOcbhoazhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkkazcefhzaPcefgPad6hsalhHaPad9hmexvkkcbhlasceGmdxikalaxad2fhCdnakTmbcbhHcehsawcjdfhminaral9Rax6mialTmdalaxfhlawaHfRbbhOcbhoamhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkamcefhmaHcefgHad6hsaHad9hmbkaChlxikcbhocehsinaral9Rax6mdalTmealaxfhlaocefgoad6hsadao9hmbkaChlxdkcbhlasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqalmbkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;yzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2geTmbinababydbgdcwtcw91:Yadce91cjjj;8ifcjjj98G::NUdbabclfhbaecufgembkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfhiaeczfheadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;t9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;h8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgohAaoclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;uzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:EPliuo97eue978Jjjjjbca9Rhidndnadcl9hmbdnaec98GglTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaiaeciGgvcdtgdVcbczad9R;8kbaiabalcdtfglad;8qbbdnavTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkalaiad;8qbbskdnaec98GgxTmbcbhvabhdinadczfglalpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgvax6mbkkaxae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabaxcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbhdabheinaeaepbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbaeczfheadclfgdav6mbkkdnaval9pmbaialciGgdcdtgeVcbc;abae9R;8kbaiabavcdtfgvae;8qbbdnadTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiae;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),s=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n=WebAssembly.validate(t)?e:c,i,o=WebAssembly.instantiate(a(n),{}).then(function(B){i=B.instance,i.exports.__wasm_call_ctors()});function a(B){for(var w=new Uint8Array(B.length),C=0;C<B.length;++C){var y=B.charCodeAt(C);w[C]=y>96?y-97:y>64?y-39:y+4}for(var x=0,C=0;C<B.length;++C)w[x++]=w[C]<60?s[w[C]]:(w[C]-60)*64+w[++C];return w.buffer.slice(0,x)}function A(B,w,C,y,x,R){var D=i.exports.sbrk,S=C+3&-4,v=D(S*y),N=D(x.length),G=new Uint8Array(i.exports.memory.buffer);G.set(x,N);var H=B(v,C,y,N,x.length);if(H==0&&R&&R(v,S,y),w.set(G.subarray(v,v+C*y)),D(v-D(0)),H!=0)throw new Error("Malformed buffer data: "+H)}var l={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},h={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},u=[],g=0;function f(B){var w={object:new Worker(B),pending:0,requests:{}};return w.object.onmessage=function(C){var y=C.data;w.pending-=y.count,w.requests[y.id][y.action](y.value),delete w.requests[y.id]},w}function I(B){for(var w="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(a(n))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+A.toString()+b.toString(),C=new Blob([w],{type:"text/javascript"}),y=URL.createObjectURL(C),x=0;x<B;++x)u[x]=f(y);URL.revokeObjectURL(y)}function m(B,w,C,y,x){for(var R=u[0],D=1;D<u.length;++D)u[D].pending<R.pending&&(R=u[D]);return new Promise(function(S,v){var N=new Uint8Array(C),G=g++;R.pending+=B,R.requests[G]={resolve:S,reject:v},R.object.postMessage({id:G,count:B,size:w,source:N,mode:y,filter:x},[N.buffer])})}function b(B){o.then(function(){var w=B.data;try{var C=new Uint8Array(w.count*w.size);A(i.exports[w.mode],C,w.count,w.size,w.source,i.exports[w.filter]),self.postMessage({id:w.id,count:w.count,action:"resolve",value:C},[C.buffer])}catch(y){self.postMessage({id:w.id,count:w.count,action:"reject",value:y})}})}return{ready:o,supported:!0,useWorkers:function(B){I(B)},decodeVertexBuffer:function(B,w,C,y,x){A(i.exports.meshopt_decodeVertexBuffer,B,w,C,y,i.exports[l[x]])},decodeIndexBuffer:function(B,w,C,y){A(i.exports.meshopt_decodeIndexBuffer,B,w,C,y)},decodeIndexSequence:function(B,w,C,y){A(i.exports.meshopt_decodeIndexSequence,B,w,C,y)},decodeGltfBuffer:function(B,w,C,y,x,R){A(i.exports[h[x]],B,w,C,y,i.exports[l[R]])},decodeGltfBufferAsync:function(B,w,C,y,x){return u.length>0?m(B,w,C,h[y],l[x]):o.then(function(){var R=new Uint8Array(B*w);return A(i.exports[h[y]],R,B,w,C,i.exports[l[x]]),R})}}})();const dn=new WeakMap;class tr extends r.Loader{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,s,n){const i=new r.FileLoader(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,o=>{this.parse(o,t,n)},s,n)}parse(e,t,s=()=>{}){this.decodeDracoFile(e,t,null,null,r.SRGBColorSpace,s).catch(s)}decodeDracoFile(e,t,s,n,i=r.LinearSRGBColorSpace,o=()=>{}){const a={attributeIDs:s||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!s,vertexColorSpace:i};return this.decodeGeometry(e,a).then(t).catch(o)}decodeGeometry(e,t){const s=JSON.stringify(t);if(dn.has(e)){const A=dn.get(e);if(A.key===s)return A.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n;const i=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(i,o).then(A=>(n=A,new Promise((l,h)=>{n._callbacks[i]={resolve:l,reject:h},n.postMessage({type:"decode",id:i,taskConfig:t,buffer:e},[e])}))).then(A=>this._createGeometry(A.geometry));return a.catch(()=>!0).then(()=>{n&&i&&this._releaseTask(n,i)}),dn.set(e,{key:s,promise:a}),a}_createGeometry(e){const t=new r.BufferGeometry;e.index&&t.setIndex(new r.BufferAttribute(e.index.array,1));for(let s=0;s<e.attributes.length;s++){const n=e.attributes[s],i=n.name,o=n.array,a=n.itemSize,A=new r.BufferAttribute(o,a);i==="color"&&(this._assignVertexColorSpace(A,n.vertexColorSpace),A.normalized=!(o instanceof Float32Array)),t.setAttribute(i,A)}return t}_assignVertexColorSpace(e,t){if(t!==r.SRGBColorSpace)return;const s=new r.Color;for(let n=0,i=e.count;n<i;n++)s.fromBufferAttribute(e,n),r.ColorManagement.toWorkingColorSpace(s,r.SRGBColorSpace),e.setXYZ(n,s.r,s.g,s.b)}_loadLibrary(e,t){const s=new r.FileLoader(this.manager);return s.setPath(this.decoderPath),s.setResponseType(t),s.setWithCredentials(this.withCredentials),new Promise((n,i)=>{s.load(e,n,void 0,i)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(s=>{const n=s[0];e||(this.decoderConfig.wasmBinary=s[1]);const i=nr.toString(),o=["/* draco decoder */",n,"","/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join(`
|
|
2
|
-
`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const n=new Worker(this.workerSourceURL);n._callbacks={},n._taskCosts={},n._taskLoad=0,n.postMessage({type:"init",decoderConfig:this.decoderConfig}),n.onmessage=function(i){const o=i.data;switch(o.type){case"decode":n._callbacks[o.id].resolve(o);break;case"error":n._callbacks[o.id].reject(o);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+o.type+'"')}},this.workerPool.push(n)}else this.workerPool.sort(function(n,i){return n._taskLoad>i._taskLoad?-1:1});const s=this.workerPool[this.workerPool.length-1];return s._taskCosts[e]=t,s._taskLoad+=t,s})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function nr(){let c,e;onmessage=function(o){const a=o.data;switch(a.type){case"init":c=a.decoderConfig,e=new Promise(function(h){c.onModuleLoaded=function(u){h({draco:u})},DracoDecoderModule(c)});break;case"decode":const A=a.buffer,l=a.taskConfig;e.then(h=>{const u=h.draco,g=new u.Decoder;try{const f=t(u,g,new Int8Array(A),l),I=f.attributes.map(m=>m.array.buffer);f.index&&I.push(f.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:f},I)}catch(f){console.error(f),self.postMessage({type:"error",id:a.id,error:f.message})}finally{u.destroy(g)}});break}};function t(o,a,A,l){const h=l.attributeIDs,u=l.attributeTypes;let g,f;const I=a.GetEncodedGeometryType(A);if(I===o.TRIANGULAR_MESH)g=new o.Mesh,f=a.DecodeArrayToMesh(A,A.byteLength,g);else if(I===o.POINT_CLOUD)g=new o.PointCloud,f=a.DecodeArrayToPointCloud(A,A.byteLength,g);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||g.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());const m={index:null,attributes:[]};for(const b in h){const B=self[u[b]];let w,C;if(l.useUniqueIDs)C=h[b],w=a.GetAttributeByUniqueId(g,C);else{if(C=a.GetAttributeId(g,o[h[b]]),C===-1)continue;w=a.GetAttribute(g,C)}const y=n(o,a,g,b,B,w);b==="color"&&(y.vertexColorSpace=l.vertexColorSpace),m.attributes.push(y)}return I===o.TRIANGULAR_MESH&&(m.index=s(o,a,g)),o.destroy(g),m}function s(o,a,A){const h=A.num_faces()*3,u=h*4,g=o._malloc(u);a.GetTrianglesUInt32Array(A,u,g);const f=new Uint32Array(o.HEAPF32.buffer,g,h).slice();return o._free(g),{array:f,itemSize:1}}function n(o,a,A,l,h,u){const g=u.num_components(),I=A.num_points()*g,m=I*h.BYTES_PER_ELEMENT,b=i(o,h),B=o._malloc(m);a.GetAttributeDataArrayForAllPoints(A,u,b,m,B);const w=new h(o.HEAPF32.buffer,B,I).slice();return o._free(B),{name:l,array:w,itemSize:g}}function i(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}class sr{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const s=this.workersResolve[e];if(s&&s(t),this.queue.length){const{resolve:n,msg:i,transfer:o}=this.queue.shift();this.workersResolve[e]=n,this.workers[e].postMessage(i,o)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(s=>{const n=this._getIdleWorker();n!==-1?(this._initWorker(n),this.workerStatus|=1<<n,this.workersResolve[n]=s,this.workers[n].postMessage(e,t)):this.queue.push({resolve:s,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const ir=0,ps=2,or=1,gs=2,rr=0,ar=1,Ar=10,cr=0,ei=9,ti=15,ni=16,si=22,ii=37,oi=43,ri=76,ai=83,Ai=97,ci=100,li=103,hi=109,ui=122,pi=123,lr=131,hr=132,ur=133,pr=134,gr=137,fr=138,dr=141,Ir=142,mr=145,br=146,gi=148,fi=152,Er=157,Cr=158,di=165,Ii=166,Jn=1000066e3;class Dt{constructor(e,t,s,n){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,s),this._littleEndian=n,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t=0){const s=this._offset;let n=0;for(;this._dataView.getUint8(this._offset)!==t&&n<e;)n++,this._offset++;return n<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+s,n)}}const Fe=[171,75,84,88,32,50,48,187,13,10,26,10];function fs(c){return new TextDecoder().decode(c)}function Br(c){const e=new Uint8Array(c.buffer,c.byteOffset,Fe.length);if(e[0]!==Fe[0]||e[1]!==Fe[1]||e[2]!==Fe[2]||e[3]!==Fe[3]||e[4]!==Fe[4]||e[5]!==Fe[5]||e[6]!==Fe[6]||e[7]!==Fe[7]||e[8]!==Fe[8]||e[9]!==Fe[9]||e[10]!==Fe[10]||e[11]!==Fe[11])throw new Error("Missing KTX 2.0 identifier.");const t={vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,levelCount:0,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null},s=17*Uint32Array.BYTES_PER_ELEMENT,n=new Dt(c,Fe.length,s,!0);t.vkFormat=n._nextUint32(),t.typeSize=n._nextUint32(),t.pixelWidth=n._nextUint32(),t.pixelHeight=n._nextUint32(),t.pixelDepth=n._nextUint32(),t.layerCount=n._nextUint32(),t.faceCount=n._nextUint32(),t.levelCount=n._nextUint32(),t.supercompressionScheme=n._nextUint32();const i=n._nextUint32(),o=n._nextUint32(),a=n._nextUint32(),A=n._nextUint32(),l=n._nextUint64(),h=n._nextUint64(),u=3*Math.max(t.levelCount,1)*8,g=new Dt(c,Fe.length+s,u,!0);for(let te=0,W=Math.max(t.levelCount,1);te<W;te++)t.levels.push({levelData:new Uint8Array(c.buffer,c.byteOffset+g._nextUint64(),g._nextUint64()),uncompressedByteLength:g._nextUint64()});const f=new Dt(c,i,o,!0);f._skip(4);const I=f._nextUint16(),m=f._nextUint16(),b=f._nextUint16(),B=f._nextUint16(),w={vendorId:I,descriptorType:m,versionNumber:b,colorModel:f._nextUint8(),colorPrimaries:f._nextUint8(),transferFunction:f._nextUint8(),flags:f._nextUint8(),texelBlockDimension:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],bytesPlane:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],samples:[]},C=(B/4-6)/4;for(let te=0;te<C;te++){const W={bitOffset:f._nextUint16(),bitLength:f._nextUint8(),channelType:f._nextUint8(),samplePosition:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};64&W.channelType?(W.sampleLower=f._nextInt32(),W.sampleUpper=f._nextInt32()):(W.sampleLower=f._nextUint32(),W.sampleUpper=f._nextUint32()),w.samples[te]=W}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(w);const y=new Dt(c,a,A,!0);for(;y._offset<A;){const te=y._nextUint32(),W=y._scan(te),se=fs(W);if(t.keyValue[se]=y._nextUint8Array(te-W.byteLength-1),se.match(/^ktx/i)){const pe=fs(t.keyValue[se]);t.keyValue[se]=pe.substring(0,pe.lastIndexOf("\0"))}y._skip(te%4?4-te%4:0)}if(h<=0)return t;const x=new Dt(c,l,h,!0),R=x._nextUint16(),D=x._nextUint16(),S=x._nextUint32(),v=x._nextUint32(),N=x._nextUint32(),G=x._nextUint32(),H=[];for(let te=0,W=Math.max(t.levelCount,1);te<W;te++)H.push({imageFlags:x._nextUint32(),rgbSliceByteOffset:x._nextUint32(),rgbSliceByteLength:x._nextUint32(),alphaSliceByteOffset:x._nextUint32(),alphaSliceByteLength:x._nextUint32()});const X=l+x._offset,U=X+S,Y=U+v,O=Y+N,Z=new Uint8Array(c.buffer,c.byteOffset+X,S),ie=new Uint8Array(c.buffer,c.byteOffset+U,v),ee=new Uint8Array(c.buffer,c.byteOffset+Y,N),ce=new Uint8Array(c.buffer,c.byteOffset+O,G);return t.globalData={endpointCount:R,selectorCount:D,imageDescs:H,endpointsData:Z,selectorsData:ie,tablesData:ee,extendedData:ce},t}let In,rt,Pn;const mn={env:{emscripten_notify_memory_growth:function(c){Pn=new Uint8Array(rt.exports.memory.buffer)}}};class yr{init(){return In||(In=typeof fetch<"u"?fetch("data:application/wasm;base64,"+ds).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,mn)).then(this._init):WebAssembly.instantiate(Buffer.from(ds,"base64"),mn).then(this._init),In)}_init(e){rt=e.instance,mn.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!rt)throw new Error("ZSTDDecoder: Await .init() before decoding.");const s=e.byteLength,n=rt.exports.malloc(s);Pn.set(e,n),t=t||Number(rt.exports.ZSTD_findDecompressedSize(n,s));const i=rt.exports.malloc(t),o=rt.exports.ZSTD_decompress(i,t,n,s),a=Pn.slice(i,i+o);return rt.exports.free(n),rt.exports.free(i),a}}const ds="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBc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0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAn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IAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBA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QALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCA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skAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQ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AUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",wr="display-p3",Qr="display-p3-linear",bn=new WeakMap;let En=0,Cn;class Je extends r.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new sr,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return this.workerConfig={astcSupported:await e.hasFeatureAsync("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:await e.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await e.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await e.hasFeatureAsync("texture-compression-bc"),bptcSupported:await e.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await e.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:e.hasFeature("texture-compression-bptc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),astcHDRSupported:e.extensions.has("WEBGL_compressed_texture_astc")&&e.extensions.get("WEBGL_compressed_texture_astc").getSupportedProfiles().includes("hdr"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this}init(){if(!this.transcoderPending){const e=new r.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),s=new r.FileLoader(this.manager);s.setPath(this.transcoderPath),s.setResponseType("arraybuffer"),s.setWithCredentials(this.withCredentials);const n=s.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,n]).then(([i,o])=>{const a=Je.BasisWorker.toString(),A=["/* constants */","let _EngineFormat = "+JSON.stringify(Je.EngineFormat),"let _EngineType = "+JSON.stringify(Je.EngineType),"let _TranscoderFormat = "+JSON.stringify(Je.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(Je.BasisFormat),"/* basis_transcoder.js */",i,"/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join(`
|
|
3
|
-
`);this.workerSourceURL=URL.createObjectURL(new Blob([A])),this.transcoderBinary=o,this.workerPool.setWorkerCreator(()=>{const l=new Worker(this.workerSourceURL),h=this.transcoderBinary.slice(0);return l.postMessage({type:"init",config:this.workerConfig,transcoderBinary:h},[h]),l})}),En>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),En++}return this.transcoderPending}load(e,t,s,n){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const i=new r.FileLoader(this.manager);i.setPath(this.path),i.setCrossOrigin(this.crossOrigin),i.setWithCredentials(this.withCredentials),i.setResponseType("arraybuffer"),i.load(e,o=>{this.parse(o,t,n)},s,n)}parse(e,t,s){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(bn.has(e))return bn.get(e).promise.then(t).catch(s);this._createTexture(e).then(n=>t?t(n):null).catch(s)}_createTextureFrom(e,t){const{type:s,error:n,data:{faces:i,width:o,height:a,format:A,type:l,dfdFlags:h}}=e;if(s==="error")return Promise.reject(n);let u;if(t.faceCount===6)u=new r.CompressedCubeTexture(i,A,l);else{const g=i[0].mipmaps;u=t.layerCount>1?new r.CompressedArrayTexture(g,o,a,t.layerCount,A,l):new r.CompressedTexture(g,o,a,A,l)}return u.minFilter=i[0].mipmaps.length===1?r.LinearFilter:r.LinearMipmapLinearFilter,u.magFilter=r.LinearFilter,u.generateMipmaps=!1,u.needsUpdate=!0,u.colorSpace=mi(t),u.premultiplyAlpha=!!(h&or),u}async _createTexture(e,t={}){const s=Br(new Uint8Array(e)),n=s.vkFormat===Jn&&s.dataFormatDescriptor[0].colorModel===167;if(!(s.vkFormat===cr||n&&!this.workerConfig.astcHDRSupported))return Sr(s);const o=t,a=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:o},[e])).then(A=>this._createTextureFrom(A.data,s));return bn.set(e,{promise:a}),a}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),En--}}Je.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2};Je.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16,BC6H:22,RGB_HALF:24,RGBA_HALF:25};Je.EngineFormat={RGBAFormat:r.RGBAFormat,RGBA_ASTC_4x4_Format:r.RGBA_ASTC_4x4_Format,RGB_BPTC_UNSIGNED_Format:r.RGB_BPTC_UNSIGNED_Format,RGBA_BPTC_Format:r.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:r.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:r.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:r.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:r.RGB_ETC1_Format,RGB_ETC2_Format:r.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:r.RGB_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format:r.RGBA_S3TC_DXT1_Format};Je.EngineType={UnsignedByteType:r.UnsignedByteType,HalfFloatType:r.HalfFloatType,FloatType:r.FloatType};Je.BasisWorker=function(){let c,e,t;const s=_EngineFormat,n=_EngineType,i=_TranscoderFormat,o=_BasisFormat;self.addEventListener("message",function(I){const m=I.data;switch(m.type){case"init":c=m.config,a(m.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:b,buffers:B,width:w,height:C,hasAlpha:y,format:x,type:R,dfdFlags:D}=A(m.buffer);self.postMessage({type:"transcode",id:m.id,data:{faces:b,width:w,height:C,hasAlpha:y,format:x,type:R,dfdFlags:D}},B)}catch(b){console.error(b),self.postMessage({type:"error",id:m.id,error:b.message})}});break}});function a(I){e=new Promise(m=>{t={wasmBinary:I,onRuntimeInitialized:m},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function A(I){const m=new t.KTX2File(new Uint8Array(I));function b(){m.close(),m.delete()}if(!m.isValid())throw b(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let B;if(m.isUASTC())B=o.UASTC;else if(m.isETC1S())B=o.ETC1S;else if(m.isHDR())B=o.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const w=m.getWidth(),C=m.getHeight(),y=m.getLayers()||1,x=m.getLevels(),R=m.getFaces(),D=m.getHasAlpha(),S=m.getDFDFlags(),{transcoderFormat:v,engineFormat:N,engineType:G}=u(B,w,C,D);if(!w||!C||!x)throw b(),new Error("THREE.KTX2Loader: Invalid texture");if(!m.startTranscoding())throw b(),new Error("THREE.KTX2Loader: .startTranscoding failed");const H=[],X=[];for(let U=0;U<R;U++){const Y=[];for(let O=0;O<x;O++){const Z=[];let ie,ee;for(let te=0;te<y;te++){const W=m.getImageLevelInfo(O,te,U);U===0&&O===0&&te===0&&(W.origWidth%4!==0||W.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),x>1?(ie=W.origWidth,ee=W.origHeight):(ie=W.width,ee=W.height);let se=new Uint8Array(m.getImageTranscodedSizeInBytes(O,te,0,v));const pe=m.transcodeImage(se,O,te,U,v,0,-1,-1);if(G===n.HalfFloatType&&(se=new Uint16Array(se.buffer,se.byteOffset,se.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!pe)throw b(),new Error("THREE.KTX2Loader: .transcodeImage failed.");Z.push(se)}const ce=f(Z);Y.push({data:ce,width:ie,height:ee}),X.push(ce.buffer)}H.push({mipmaps:Y,width:w,height:C,format:N,type:G})}return b(),{faces:H,buffers:X,width:w,height:C,hasAlpha:D,dfdFlags:S,format:N,type:G}}const l=[{if:"astcSupported",basisFormat:[o.UASTC],transcoderFormat:[i.ASTC_4x4,i.ASTC_4x4],engineFormat:[s.RGBA_ASTC_4x4_Format,s.RGBA_ASTC_4x4_Format],engineType:[n.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[i.BC7_M5,i.BC7_M5],engineFormat:[s.RGBA_BPTC_Format,s.RGBA_BPTC_Format],engineType:[n.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[i.BC1,i.BC3],engineFormat:[s.RGBA_S3TC_DXT1_Format,s.RGBA_S3TC_DXT5_Format],engineType:[n.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[i.ETC1,i.ETC2],engineFormat:[s.RGB_ETC2_Format,s.RGBA_ETC2_EAC_Format],engineType:[n.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[i.ETC1],engineFormat:[s.RGB_ETC1_Format],engineType:[n.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[i.PVRTC1_4_RGB,i.PVRTC1_4_RGBA],engineFormat:[s.RGB_PVRTC_4BPPV1_Format,s.RGBA_PVRTC_4BPPV1_Format],engineType:[n.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[o.UASTC_HDR],transcoderFormat:[i.BC6H],engineFormat:[s.RGB_BPTC_UNSIGNED_Format],engineType:[n.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[i.RGBA32,i.RGBA32],engineFormat:[s.RGBAFormat,s.RGBAFormat],engineType:[n.UnsignedByteType,n.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[o.UASTC_HDR],transcoderFormat:[i.RGBA_HALF],engineFormat:[s.RGBAFormat],engineType:[n.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],h={[o.ETC1S]:l.filter(I=>I.basisFormat.includes(o.ETC1S)).sort((I,m)=>I.priorityUASTC-m.priorityUASTC),[o.UASTC]:l.filter(I=>I.basisFormat.includes(o.UASTC)).sort((I,m)=>I.priorityUASTC-m.priorityUASTC),[o.UASTC_HDR]:l.filter(I=>I.basisFormat.includes(o.UASTC_HDR)).sort((I,m)=>I.priorityHDR-m.priorityHDR)};function u(I,m,b,B){const w=h[I];for(let C=0;C<w.length;C++){const y=w[C];if(y.if&&!c[y.if]||!y.basisFormat.includes(I)||B&&y.transcoderFormat.length<2||y.needsPowerOfTwo&&!(g(m)&&g(b)))continue;const x=y.transcoderFormat[B?1:0],R=y.engineFormat[B?1:0],D=y.engineType[0];return{transcoderFormat:x,engineFormat:R,engineType:D}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function g(I){return I<=2?!0:(I&I-1)===0&&I!==0}function f(I){if(I.length===1)return I[0];let m=0;for(let w=0;w<I.length;w++){const C=I[w];m+=C.byteLength}const b=new Uint8Array(m);let B=0;for(let w=0;w<I.length;w++){const C=I[w];b.set(C,B),B+=C.byteLength}return b}};const xr=new Set([r.RGBAFormat,r.RGBFormat,r.RGFormat,r.RedFormat]),Bn={[hi]:r.RGBAFormat,[Ai]:r.RGBAFormat,[ii]:r.RGBAFormat,[oi]:r.RGBAFormat,[li]:r.RGFormat,[ai]:r.RGFormat,[ni]:r.RGFormat,[si]:r.RGFormat,[ci]:r.RedFormat,[ri]:r.RedFormat,[ti]:r.RedFormat,[ei]:r.RedFormat,[pi]:r.RGBFormat,[ui]:r.RGBFormat,[gi]:r.RGB_ETC2_Format,[fi]:r.RGBA_ETC2_EAC_Format,[Jn]:r.RGBA_ASTC_4x4_Format,[Cr]:r.RGBA_ASTC_4x4_Format,[Er]:r.RGBA_ASTC_4x4_Format,[Ii]:r.RGBA_ASTC_6x6_Format,[di]:r.RGBA_ASTC_6x6_Format,[ur]:r.RGBA_S3TC_DXT1_Format,[pr]:r.RGBA_S3TC_DXT1_Format,[lr]:r.RGB_S3TC_DXT1_Format,[hr]:r.RGB_S3TC_DXT1_Format,[fr]:r.RGBA_S3TC_DXT3_Format,[gr]:r.RGBA_S3TC_DXT3_Format,[Ir]:r.RGBA_S3TC_DXT5_Format,[dr]:r.RGBA_S3TC_DXT5_Format,[br]:r.RGBA_BPTC_Format,[mr]:r.RGBA_BPTC_Format},_t={[hi]:r.FloatType,[Ai]:r.HalfFloatType,[ii]:r.UnsignedByteType,[oi]:r.UnsignedByteType,[li]:r.FloatType,[ai]:r.HalfFloatType,[ni]:r.UnsignedByteType,[si]:r.UnsignedByteType,[ci]:r.FloatType,[ri]:r.HalfFloatType,[ti]:r.UnsignedByteType,[ei]:r.UnsignedByteType,[pi]:r.UnsignedInt5999Type,[ui]:r.UnsignedInt101111Type,[gi]:r.UnsignedByteType,[fi]:r.UnsignedByteType,[Jn]:r.HalfFloatType,[Ii]:r.UnsignedByteType,[di]:r.UnsignedByteType};async function Sr(c){const{vkFormat:e}=c;if(Bn[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;c.supercompressionScheme===ps&&(Cn||(Cn=new Promise(async o=>{const a=new yr;await a.init(),o(a)})),t=await Cn);const s=[];for(let o=0;o<c.levels.length;o++){const a=Math.max(1,c.pixelWidth>>o),A=Math.max(1,c.pixelHeight>>o),l=c.pixelDepth?Math.max(1,c.pixelDepth>>o):0,h=c.levels[o];let u;if(c.supercompressionScheme===ir)u=h.levelData;else if(c.supercompressionScheme===ps)u=t.decode(h.levelData,h.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let g;_t[e]===r.FloatType?g=new Float32Array(u.buffer,u.byteOffset,u.byteLength/Float32Array.BYTES_PER_ELEMENT):_t[e]===r.HalfFloatType?g=new Uint16Array(u.buffer,u.byteOffset,u.byteLength/Uint16Array.BYTES_PER_ELEMENT):_t[e]===r.UnsignedInt5999Type||_t[e]===r.UnsignedInt101111Type?g=new Uint32Array(u.buffer,u.byteOffset,u.byteLength/Uint32Array.BYTES_PER_ELEMENT):g=u,s.push({data:g,width:a,height:A,depth:l})}const n=c.levelCount===0||s.length>1;let i;if(xr.has(Bn[e]))i=c.pixelDepth===0?new r.DataTexture(s[0].data,c.pixelWidth,c.pixelHeight):new r.Data3DTexture(s[0].data,c.pixelWidth,c.pixelHeight,c.pixelDepth),i.minFilter=n?r.NearestMipmapNearestFilter:r.NearestFilter,i.magFilter=r.NearestFilter,i.generateMipmaps=c.levelCount===0;else{if(c.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");i=new r.CompressedTexture(s,c.pixelWidth,c.pixelHeight),i.minFilter=n?r.LinearMipmapLinearFilter:r.LinearFilter,i.magFilter=r.LinearFilter}return i.mipmaps=s,i.type=_t[e],i.format=Bn[e],i.colorSpace=mi(c),i.needsUpdate=!0,Promise.resolve(i)}function mi(c){const e=c.dataFormatDescriptor[0];return e.colorPrimaries===ar?e.transferFunction===gs?r.SRGBColorSpace:r.LinearSRGBColorSpace:e.colorPrimaries===Ar?e.transferFunction===gs?wr:Qr:(e.colorPrimaries===rr||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),r.NoColorSpace)}const bi=new r.NodeFrame;bi.camera=new r.PerspectiveCamera;r.ShaderLib.basic,r.ShaderLib.basic,r.ShaderLib.points,r.ShaderLib.standard,r.ShaderLib.physical,r.ShaderLib.phong;var zt=function(){var c=0,e=document.createElement("div");e.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",e.addEventListener("click",function(h){h.preventDefault(),s(++c%e.children.length)},!1);function t(h){return e.appendChild(h.dom),h}function s(h){for(var u=0;u<e.children.length;u++)e.children[u].style.display=u===h?"block":"none";c=h}var n=(performance||Date).now(),i=n,o=0,a=t(new zt.Panel("FPS","#0ff","#002")),A=t(new zt.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var l=t(new zt.Panel("MB","#f08","#201"));return s(0),{REVISION:16,dom:e,addPanel:t,showPanel:s,begin:function(){n=(performance||Date).now()},end:function(){o++;var h=(performance||Date).now();if(A.update(h-n,200),h>=i+1e3&&(a.update(o*1e3/(h-i),100),i=h,o=0,l)){var u=performance.memory;l.update(u.usedJSHeapSize/1048576,u.jsHeapSizeLimit/1048576)}return h},update:function(){n=this.end()},domElement:e,setMode:s}};zt.Panel=function(c,e,t){var s=1/0,n=0,i=Math.round,o=i(window.devicePixelRatio||1),a=80*o,A=48*o,l=3*o,h=2*o,u=3*o,g=15*o,f=74*o,I=30*o,m=document.createElement("canvas");m.width=a,m.height=A,m.style.cssText="width:80px;height:48px";var b=m.getContext("2d");return b.font="bold "+9*o+"px Helvetica,Arial,sans-serif",b.textBaseline="top",b.fillStyle=t,b.fillRect(0,0,a,A),b.fillStyle=e,b.fillText(c,l,h),b.fillRect(u,g,f,I),b.fillStyle=t,b.globalAlpha=.9,b.fillRect(u,g,f,I),{dom:m,update:function(B,w){s=Math.min(s,B),n=Math.max(n,B),b.fillStyle=t,b.globalAlpha=1,b.fillRect(0,0,a,g),b.fillStyle=e,b.fillText(i(B)+" "+c+" ("+i(s)+"-"+i(n)+")",l,h),b.drawImage(m,u+o,g,f-o,I,u,g,f-o,I),b.fillRect(u+f-o,g,o,I),b.fillStyle=t,b.globalAlpha=.9,b.fillRect(u+f-o,g,o,i((1-B/w)*I))}}};class Tr extends r.ExtrudeGeometry{constructor(e,t={}){const s=t.font;if(s===void 0)super();else{const n=s.generateShapes(e,t.size);t.depth===void 0&&t.height!==void 0&&console.warn("THREE.TextGeometry: .height is now depreciated. Please use .depth instead"),t.depth=t.depth!==void 0?t.depth:t.height!==void 0?t.height:50,t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(n,t)}this.type="TextGeometry"}}class vr extends r.Loader{constructor(e){super(e)}load(e,t,s,n){const i=this,o=new r.FileLoader(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){const A=i.parse(JSON.parse(a));t&&t(A)},s,n)}parse(e){return new Ei(e)}}class Ei{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100){const s=[],n=Mr(e,t,this.data);for(let i=0,o=n.length;i<o;i++)s.push(...n[i].toShapes());return s}}function Mr(c,e,t){const s=Array.from(c),n=e/t.resolution,i=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*n,o=[];let a=0,A=0;for(let l=0;l<s.length;l++){const h=s[l];if(h===`
|
|
4
|
-
`)a=0,A-=i;else{const u=Rr(h,n,a,A,t);a+=u.offsetX,o.push(u.path)}}return o}function Rr(c,e,t,s,n){const i=n.glyphs[c]||n.glyphs["?"];if(!i){console.error('THREE.Font: character "'+c+'" does not exists in font family '+n.familyName+".");return}const o=new r.ShapePath;let a,A,l,h,u,g,f,I;if(i.o){const m=i._cachedOutline||(i._cachedOutline=i.o.split(" "));for(let b=0,B=m.length;b<B;)switch(m[b++]){case"m":a=m[b++]*e+t,A=m[b++]*e+s,o.moveTo(a,A);break;case"l":a=m[b++]*e+t,A=m[b++]*e+s,o.lineTo(a,A);break;case"q":l=m[b++]*e+t,h=m[b++]*e+s,u=m[b++]*e+t,g=m[b++]*e+s,o.quadraticCurveTo(u,g,l,h);break;case"b":l=m[b++]*e+t,h=m[b++]*e+s,u=m[b++]*e+t,g=m[b++]*e+s,f=m[b++]*e+t,I=m[b++]*e+s,o.bezierCurveTo(u,g,f,I,l,h);break}}return{offsetX:i.ha*e,path:o}}var we=Uint8Array,He=Uint16Array,Wn=Int32Array,cn=new we([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ln=new we([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),On=new we([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ci=function(c,e){for(var t=new He(31),s=0;s<31;++s)t[s]=e+=1<<c[s-1];for(var n=new Wn(t[30]),s=1;s<30;++s)for(var i=t[s];i<t[s+1];++i)n[i]=i-t[s]<<5|s;return{b:t,r:n}},Bi=Ci(cn,2),yi=Bi.b,Hn=Bi.r;yi[28]=258,Hn[258]=28;var wi=Ci(ln,0),Dr=wi.b,Is=wi.r,jn=new He(32768);for(var be=0;be<32768;++be){var ht=(be&43690)>>1|(be&21845)<<1;ht=(ht&52428)>>2|(ht&13107)<<2,ht=(ht&61680)>>4|(ht&3855)<<4,jn[be]=((ht&65280)>>8|(ht&255)<<8)>>1}var nt=(function(c,e,t){for(var s=c.length,n=0,i=new He(e);n<s;++n)c[n]&&++i[c[n]-1];var o=new He(e);for(n=1;n<e;++n)o[n]=o[n-1]+i[n-1]<<1;var a;if(t){a=new He(1<<e);var A=15-e;for(n=0;n<s;++n)if(c[n])for(var l=n<<4|c[n],h=e-c[n],u=o[c[n]-1]++<<h,g=u|(1<<h)-1;u<=g;++u)a[jn[u]>>A]=l}else for(a=new He(s),n=0;n<s;++n)c[n]&&(a[n]=jn[o[c[n]-1]++]>>15-c[n]);return a}),pt=new we(288);for(var be=0;be<144;++be)pt[be]=8;for(var be=144;be<256;++be)pt[be]=9;for(var be=256;be<280;++be)pt[be]=7;for(var be=280;be<288;++be)pt[be]=8;var Yt=new we(32);for(var be=0;be<32;++be)Yt[be]=5;var _r=nt(pt,9,0),Fr=nt(pt,9,1),Lr=nt(Yt,5,0),kr=nt(Yt,5,1),yn=function(c){for(var e=c[0],t=1;t<c.length;++t)c[t]>e&&(e=c[t]);return e},We=function(c,e,t){var s=e/8|0;return(c[s]|c[s+1]<<8)>>(e&7)&t},wn=function(c,e){var t=e/8|0;return(c[t]|c[t+1]<<8|c[t+2]<<16)>>(e&7)},Xn=function(c){return(c+7)/8|0},Zn=function(c,e,t){return(t==null||t>c.length)&&(t=c.length),new we(c.subarray(e,t))},Gr=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ge=function(c,e,t){var s=new Error(e||Gr[c]);if(s.code=c,Error.captureStackTrace&&Error.captureStackTrace(s,Ge),!t)throw s;return s},Ur=function(c,e,t,s){var n=c.length,i=0;if(!n||e.f&&!e.l)return t||new we(0);var o=!t,a=o||e.i!=2,A=e.i;o&&(t=new we(n*3));var l=function(At){var gt=t.length;if(At>gt){var st=new we(Math.max(gt*2,At));st.set(t),t=st}},h=e.f||0,u=e.p||0,g=e.b||0,f=e.l,I=e.d,m=e.m,b=e.n,B=n*8;do{if(!f){h=We(c,u,1);var w=We(c,u+1,3);if(u+=3,w)if(w==1)f=Fr,I=kr,m=9,b=5;else if(w==2){var R=We(c,u,31)+257,D=We(c,u+10,15)+4,S=R+We(c,u+5,31)+1;u+=14;for(var v=new we(S),N=new we(19),G=0;G<D;++G)N[On[G]]=We(c,u+G*3,7);u+=D*3;for(var H=yn(N),X=(1<<H)-1,U=nt(N,H,1),G=0;G<S;){var Y=U[We(c,u,X)];u+=Y&15;var C=Y>>4;if(C<16)v[G++]=C;else{var O=0,Z=0;for(C==16?(Z=3+We(c,u,3),u+=2,O=v[G-1]):C==17?(Z=3+We(c,u,7),u+=3):C==18&&(Z=11+We(c,u,127),u+=7);Z--;)v[G++]=O}}var ie=v.subarray(0,R),ee=v.subarray(R);m=yn(ie),b=yn(ee),f=nt(ie,m,1),I=nt(ee,b,1)}else Ge(1);else{var C=Xn(u)+4,y=c[C-4]|c[C-3]<<8,x=C+y;if(x>n){A&&Ge(0);break}a&&l(g+y),t.set(c.subarray(C,x),g),e.b=g+=y,e.p=u=x*8,e.f=h;continue}if(u>B){A&&Ge(0);break}}a&&l(g+131072);for(var ce=(1<<m)-1,te=(1<<b)-1,W=u;;W=u){var O=f[wn(c,u)&ce],se=O>>4;if(u+=O&15,u>B){A&&Ge(0);break}if(O||Ge(2),se<256)t[g++]=se;else if(se==256){W=u,f=null;break}else{var pe=se-254;if(se>264){var G=se-257,Ie=cn[G];pe=We(c,u,(1<<Ie)-1)+yi[G],u+=Ie}var Ae=I[wn(c,u)&te],Ue=Ae>>4;Ae||Ge(3),u+=Ae&15;var ee=Dr[Ue];if(Ue>3){var Ie=ln[Ue];ee+=wn(c,u)&(1<<Ie)-1,u+=Ie}if(u>B){A&&Ge(0);break}a&&l(g+131072);var Ne=g+pe;if(g<ee){var Ct=i-ee,Bt=Math.min(ee,Ne);for(Ct+g<0&&Ge(3);g<Bt;++g)t[g]=s[Ct+g]}for(;g<Ne;++g)t[g]=t[g-ee]}}e.l=f,e.p=W,e.b=g,e.f=h,f&&(h=1,e.m=m,e.d=I,e.n=b)}while(!h);return g!=t.length&&o?Zn(t,0,g):t.subarray(0,g)},ot=function(c,e,t){t<<=e&7;var s=e/8|0;c[s]|=t,c[s+1]|=t>>8},Ft=function(c,e,t){t<<=e&7;var s=e/8|0;c[s]|=t,c[s+1]|=t>>8,c[s+2]|=t>>16},Qn=function(c,e){for(var t=[],s=0;s<c.length;++s)c[s]&&t.push({s,f:c[s]});var n=t.length,i=t.slice();if(!n)return{t:xi,l:0};if(n==1){var o=new we(t[0].s+1);return o[t[0].s]=1,{t:o,l:1}}t.sort(function(x,R){return x.f-R.f}),t.push({s:-1,f:25001});var a=t[0],A=t[1],l=0,h=1,u=2;for(t[0]={s:-1,f:a.f+A.f,l:a,r:A};h!=n-1;)a=t[t[l].f<t[u].f?l++:u++],A=t[l!=h&&t[l].f<t[u].f?l++:u++],t[h++]={s:-1,f:a.f+A.f,l:a,r:A};for(var g=i[0].s,s=1;s<n;++s)i[s].s>g&&(g=i[s].s);var f=new He(g+1),I=qn(t[h-1],f,0);if(I>e){var s=0,m=0,b=I-e,B=1<<b;for(i.sort(function(R,D){return f[D.s]-f[R.s]||R.f-D.f});s<n;++s){var w=i[s].s;if(f[w]>e)m+=B-(1<<I-f[w]),f[w]=e;else break}for(m>>=b;m>0;){var C=i[s].s;f[C]<e?m-=1<<e-f[C]++-1:++s}for(;s>=0&&m;--s){var y=i[s].s;f[y]==e&&(--f[y],++m)}I=e}return{t:new we(f),l:I}},qn=function(c,e,t){return c.s==-1?Math.max(qn(c.l,e,t+1),qn(c.r,e,t+1)):e[c.s]=t},ms=function(c){for(var e=c.length;e&&!c[--e];);for(var t=new He(++e),s=0,n=c[0],i=1,o=function(A){t[s++]=A},a=1;a<=e;++a)if(c[a]==n&&a!=e)++i;else{if(!n&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(n),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(n);i=1,n=c[a]}return{c:t.subarray(0,s),n:e}},Lt=function(c,e){for(var t=0,s=0;s<e.length;++s)t+=c[s]*e[s];return t},Qi=function(c,e,t){var s=t.length,n=Xn(e+2);c[n]=s&255,c[n+1]=s>>8,c[n+2]=c[n]^255,c[n+3]=c[n+1]^255;for(var i=0;i<s;++i)c[n+i+4]=t[i];return(n+4+s)*8},bs=function(c,e,t,s,n,i,o,a,A,l,h){ot(e,h++,t),++n[256];for(var u=Qn(n,15),g=u.t,f=u.l,I=Qn(i,15),m=I.t,b=I.l,B=ms(g),w=B.c,C=B.n,y=ms(m),x=y.c,R=y.n,D=new He(19),S=0;S<w.length;++S)++D[w[S]&31];for(var S=0;S<x.length;++S)++D[x[S]&31];for(var v=Qn(D,7),N=v.t,G=v.l,H=19;H>4&&!N[On[H-1]];--H);var X=l+5<<3,U=Lt(n,pt)+Lt(i,Yt)+o,Y=Lt(n,g)+Lt(i,m)+o+14+3*H+Lt(D,N)+2*D[16]+3*D[17]+7*D[18];if(A>=0&&X<=U&&X<=Y)return Qi(e,h,c.subarray(A,A+l));var O,Z,ie,ee;if(ot(e,h,1+(Y<U)),h+=2,Y<U){O=nt(g,f,0),Z=g,ie=nt(m,b,0),ee=m;var ce=nt(N,G,0);ot(e,h,C-257),ot(e,h+5,R-1),ot(e,h+10,H-4),h+=14;for(var S=0;S<H;++S)ot(e,h+3*S,N[On[S]]);h+=3*H;for(var te=[w,x],W=0;W<2;++W)for(var se=te[W],S=0;S<se.length;++S){var pe=se[S]&31;ot(e,h,ce[pe]),h+=N[pe],pe>15&&(ot(e,h,se[S]>>5&127),h+=se[S]>>12)}}else O=_r,Z=pt,ie=Lr,ee=Yt;for(var S=0;S<a;++S){var Ie=s[S];if(Ie>255){var pe=Ie>>18&31;Ft(e,h,O[pe+257]),h+=Z[pe+257],pe>7&&(ot(e,h,Ie>>23&31),h+=cn[pe]);var Ae=Ie&31;Ft(e,h,ie[Ae]),h+=ee[Ae],Ae>3&&(Ft(e,h,Ie>>5&8191),h+=ln[Ae])}else Ft(e,h,O[Ie]),h+=Z[Ie]}return Ft(e,h,O[256]),h+Z[256]},Nr=new Wn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),xi=new we(0),Pr=function(c,e,t,s,n,i){var o=i.z||c.length,a=new we(s+o+5*(1+Math.ceil(o/7e3))+n),A=a.subarray(s,a.length-n),l=i.l,h=(i.r||0)&7;if(e){h&&(A[0]=i.r>>3);for(var u=Nr[e-1],g=u>>13,f=u&8191,I=(1<<t)-1,m=i.p||new He(32768),b=i.h||new He(I+1),B=Math.ceil(t/3),w=2*B,C=function(yt){return(c[yt]^c[yt+1]<<B^c[yt+2]<<w)&I},y=new Wn(25e3),x=new He(288),R=new He(32),D=0,S=0,v=i.i||0,N=0,G=i.w||0,H=0;v+2<o;++v){var X=C(v),U=v&32767,Y=b[X];if(m[U]=Y,b[X]=U,G<=v){var O=o-v;if((D>7e3||N>24576)&&(O>423||!l)){h=bs(c,A,0,y,x,R,S,N,H,v-H,h),N=D=S=0,H=v;for(var Z=0;Z<286;++Z)x[Z]=0;for(var Z=0;Z<30;++Z)R[Z]=0}var ie=2,ee=0,ce=f,te=U-Y&32767;if(O>2&&X==C(v-te))for(var W=Math.min(g,O)-1,se=Math.min(32767,v),pe=Math.min(258,O);te<=se&&--ce&&U!=Y;){if(c[v+ie]==c[v+ie-te]){for(var Ie=0;Ie<pe&&c[v+Ie]==c[v+Ie-te];++Ie);if(Ie>ie){if(ie=Ie,ee=te,Ie>W)break;for(var Ae=Math.min(te,Ie-2),Ue=0,Z=0;Z<Ae;++Z){var Ne=v-te+Z&32767,Ct=m[Ne],Bt=Ne-Ct&32767;Bt>Ue&&(Ue=Bt,Y=Ne)}}}U=Y,Y=m[U],te+=U-Y&32767}if(ee){y[N++]=268435456|Hn[ie]<<18|Is[ee];var At=Hn[ie]&31,gt=Is[ee]&31;S+=cn[At]+ln[gt],++x[257+At],++R[gt],G=v+ie,++D}else y[N++]=c[v],++x[c[v]]}}for(v=Math.max(v,G);v<o;++v)y[N++]=c[v],++x[c[v]];h=bs(c,A,l,y,x,R,S,N,H,v-H,h),l||(i.r=h&7|A[h/8|0]<<3,h-=7,i.h=b,i.p=m,i.i=v,i.w=G)}else{for(var v=i.w||0;v<o+l;v+=65535){var st=v+65535;st>=o&&(A[h/8|0]=l,st=o),h=Qi(A,h+1,c.subarray(v,st))}i.i=o}return Zn(a,0,s+Xn(h)+n)},Or=(function(){for(var c=new Int32Array(256),e=0;e<256;++e){for(var t=e,s=9;--s;)t=(t&1&&-306674912)^t>>>1;c[e]=t}return c})(),Hr=function(){var c=-1;return{p:function(e){for(var t=c,s=0;s<e.length;++s)t=Or[t&255^e[s]]^t>>>8;c=t},d:function(){return~c}}},jr=function(c,e,t,s,n){if(!n&&(n={l:1},e.dictionary)){var i=e.dictionary.subarray(-32768),o=new we(i.length+c.length);o.set(i),o.set(c,i.length),c=o,n.w=i.length}return Pr(c,e.level==null?6:e.level,e.mem==null?n.l?Math.ceil(Math.max(8,Math.min(13,Math.log(c.length)))*1.5):20:12+e.mem,t,s,n)},Si=function(c,e){var t={};for(var s in c)t[s]=c[s];for(var s in e)t[s]=e[s];return t},Me=function(c,e,t){for(;t;++e)c[e]=t,t>>>=8},qr=function(c,e){return((c[0]&15)!=8||c[0]>>4>7||(c[0]<<8|c[1])%31)&&Ge(6,"invalid zlib data"),(c[1]>>5&1)==1&&Ge(6,"invalid zlib data: "+(c[1]&32?"need":"unexpected")+" dictionary"),(c[1]>>3&4)+2};function zr(c,e){return jr(c,e||{},0,0)}function Ot(c,e){return Ur(c.subarray(qr(c),-4),{i:2},e,e)}var Ti=function(c,e,t,s){for(var n in c){var i=c[n],o=e+n,a=s;Array.isArray(i)&&(a=Si(s,i[1]),i=i[0]),i instanceof we?t[o]=[i,a]:(t[o+="/"]=[new we(0),a],Ti(i,o,t,s))}},Es=typeof TextEncoder<"u"&&new TextEncoder,Yr=typeof TextDecoder<"u"&&new TextDecoder,Kr=0;try{Yr.decode(xi,{stream:!0}),Kr=1}catch{}function zn(c,e){var t;if(Es)return Es.encode(c);for(var s=c.length,n=new we(c.length+(c.length>>1)),i=0,o=function(l){n[i++]=l},t=0;t<s;++t){if(i+5>n.length){var a=new we(i+8+(s-t<<1));a.set(n),n=a}var A=c.charCodeAt(t);A<128||e?o(A):A<2048?(o(192|A>>6),o(128|A&63)):A>55295&&A<57344?(A=65536+(A&1047552)|c.charCodeAt(++t)&1023,o(240|A>>18),o(128|A>>12&63),o(128|A>>6&63),o(128|A&63)):(o(224|A>>12),o(128|A>>6&63),o(128|A&63))}return Zn(n,0,i)}var Yn=function(c){var e=0;if(c)for(var t in c){var s=c[t].length;s>65535&&Ge(9),e+=s+4}return e},Cs=function(c,e,t,s,n,i,o,a){var A=s.length,l=t.extra,h=a&&a.length,u=Yn(l);Me(c,e,o!=null?33639248:67324752),e+=4,o!=null&&(c[e++]=20,c[e++]=t.os),c[e]=20,e+=2,c[e++]=t.flag<<1|(i<0&&8),c[e++]=n&&8,c[e++]=t.compression&255,c[e++]=t.compression>>8;var g=new Date(t.mtime==null?Date.now():t.mtime),f=g.getFullYear()-1980;if((f<0||f>119)&&Ge(10),Me(c,e,f<<25|g.getMonth()+1<<21|g.getDate()<<16|g.getHours()<<11|g.getMinutes()<<5|g.getSeconds()>>1),e+=4,i!=-1&&(Me(c,e,t.crc),Me(c,e+4,i<0?-i-2:i),Me(c,e+8,t.size)),Me(c,e+12,A),Me(c,e+14,u),e+=16,o!=null&&(Me(c,e,h),Me(c,e+6,t.attrs),Me(c,e+10,o),e+=14),c.set(s,e),e+=A,u)for(var I in l){var m=l[I],b=m.length;Me(c,e,+I),Me(c,e+2,b),c.set(m,e+4),e+=4+b}return h&&(c.set(a,e),e+=h),e},Vr=function(c,e,t,s,n){Me(c,e,101010256),Me(c,e+8,t),Me(c,e+10,t),Me(c,e+12,s),Me(c,e+16,n)};function Jr(c,e){e||(e={});var t={},s=[];Ti(c,"",t,e);var n=0,i=0;for(var o in t){var a=t[o],A=a[0],l=a[1],h=l.level==0?0:8,u=zn(o),g=u.length,f=l.comment,I=f&&zn(f),m=I&&I.length,b=Yn(l.extra);g>65535&&Ge(11);var B=h?zr(A,l):A,w=B.length,C=Hr();C.p(A),s.push(Si(l,{size:A.length,crc:C.d(),c:B,f:u,m:I,u:g!=o.length||I&&f.length!=m,o:n,compression:h})),n+=30+g+b+w,i+=76+2*(g+b)+(m||0)+w}for(var y=new we(i+22),x=n,R=i-n,D=0;D<s.length;++D){var u=s[D];Cs(y,u.o,u,u.f,u.u,u.c.length);var S=30+u.f.length+Yn(u.extra);y.set(u.c,u.o+S),Cs(y,n,u,u.f,u.u,u.c.length,u.o,u.m),n+=16+S+(u.m?u.m.length:0)}return Vr(y,n,s.length,R,x),y}class Wr extends r.DataTextureLoader{constructor(e){super(e),this.type=r.HalfFloatType}parse(e){const v=Math.pow(2.7182818,2.2);function N(p,d){let E=0;for(let M=0;M<65536;++M)(M==0||p[M>>3]&1<<(M&7))&&(d[E++]=M);const Q=E-1;for(;E<65536;)d[E++]=0;return Q}function G(p){for(let d=0;d<16384;d++)p[d]={},p[d].len=0,p[d].lit=0,p[d].p=null}const H={l:0,c:0,lc:0};function X(p,d,E,Q,M){for(;E<p;)d=d<<8|is(Q,M),E+=8;E-=p,H.l=d>>E&(1<<p)-1,H.c=d,H.lc=E}const U=new Array(59);function Y(p){for(let E=0;E<=58;++E)U[E]=0;for(let E=0;E<65537;++E)U[p[E]]+=1;let d=0;for(let E=58;E>0;--E){const Q=d+U[E]>>1;U[E]=d,d=Q}for(let E=0;E<65537;++E){const Q=p[E];Q>0&&(p[E]=Q|U[Q]++<<6)}}function O(p,d,E,Q,M,T){const L=d;let P=0,k=0;for(;Q<=M;Q++){if(L.value-d.value>E)return!1;X(6,P,k,p,L);const F=H.l;if(P=H.c,k=H.lc,T[Q]=F,F==63){if(L.value-d.value>E)throw new Error("Something wrong with hufUnpackEncTable");X(8,P,k,p,L);let _=H.l+6;if(P=H.c,k=H.lc,Q+_>M+1)throw new Error("Something wrong with hufUnpackEncTable");for(;_--;)T[Q++]=0;Q--}else if(F>=59){let _=F-59+2;if(Q+_>M+1)throw new Error("Something wrong with hufUnpackEncTable");for(;_--;)T[Q++]=0;Q--}}Y(T)}function Z(p){return p&63}function ie(p){return p>>6}function ee(p,d,E,Q){for(;d<=E;d++){const M=ie(p[d]),T=Z(p[d]);if(M>>T)throw new Error("Invalid table entry");if(T>14){const L=Q[M>>T-14];if(L.len)throw new Error("Invalid table entry");if(L.lit++,L.p){const P=L.p;L.p=new Array(L.lit);for(let k=0;k<L.lit-1;++k)L.p[k]=P[k]}else L.p=new Array(1);L.p[L.lit-1]=d}else if(T){let L=0;for(let P=1<<14-T;P>0;P--){const k=Q[(M<<14-T)+L];if(k.len||k.p)throw new Error("Invalid table entry");k.len=T,k.lit=d,L++}}}return!0}const ce={c:0,lc:0};function te(p,d,E,Q){p=p<<8|is(E,Q),d+=8,ce.c=p,ce.lc=d}const W={c:0,lc:0};function se(p,d,E,Q,M,T,L,P,k){if(p==d){Q<8&&(te(E,Q,M,T),E=ce.c,Q=ce.lc),Q-=8;let F=E>>Q;if(F=new Uint8Array([F])[0],P.value+F>k)return!1;const _=L[P.value-1];for(;F-- >0;)L[P.value++]=_}else if(P.value<k)L[P.value++]=p;else return!1;W.c=E,W.lc=Q}function pe(p){return p&65535}function Ie(p){const d=pe(p);return d>32767?d-65536:d}const Ae={a:0,b:0};function Ue(p,d){const E=Ie(p),M=Ie(d),T=E+(M&1)+(M>>1),L=T,P=T-M;Ae.a=L,Ae.b=P}function Ne(p,d){const E=pe(p),Q=pe(d),M=E-(Q>>1)&65535,T=Q+M-32768&65535;Ae.a=T,Ae.b=M}function Ct(p,d,E,Q,M,T,L){const P=L<16384,k=E>M?M:E;let F=1,_,j;for(;F<=k;)F<<=1;for(F>>=1,_=F,F>>=1;F>=1;){j=0;const V=j+T*(M-_),q=T*F,$=T*_,z=Q*F,J=Q*_;let ne,ge,Ce,Oe;for(;j<=V;j+=$){let me=j;const le=j+Q*(E-_);for(;me<=le;me+=J){const Qe=me+z,Ye=me+q,Se=Ye+z;P?(Ue(p[me+d],p[Ye+d]),ne=Ae.a,Ce=Ae.b,Ue(p[Qe+d],p[Se+d]),ge=Ae.a,Oe=Ae.b,Ue(ne,ge),p[me+d]=Ae.a,p[Qe+d]=Ae.b,Ue(Ce,Oe),p[Ye+d]=Ae.a,p[Se+d]=Ae.b):(Ne(p[me+d],p[Ye+d]),ne=Ae.a,Ce=Ae.b,Ne(p[Qe+d],p[Se+d]),ge=Ae.a,Oe=Ae.b,Ne(ne,ge),p[me+d]=Ae.a,p[Qe+d]=Ae.b,Ne(Ce,Oe),p[Ye+d]=Ae.a,p[Se+d]=Ae.b)}if(E&F){const Qe=me+q;P?Ue(p[me+d],p[Qe+d]):Ne(p[me+d],p[Qe+d]),ne=Ae.a,p[Qe+d]=Ae.b,p[me+d]=ne}}if(M&F){let me=j;const le=j+Q*(E-_);for(;me<=le;me+=J){const Qe=me+z;P?Ue(p[me+d],p[Qe+d]):Ne(p[me+d],p[Qe+d]),ne=Ae.a,p[Qe+d]=Ae.b,p[me+d]=ne}}_=F,F>>=1}return j}function Bt(p,d,E,Q,M,T,L,P,k){let F=0,_=0;const j=L,V=Math.trunc(Q.value+(M+7)/8);for(;Q.value<V;)for(te(F,_,E,Q),F=ce.c,_=ce.lc;_>=14;){const $=F>>_-14&16383,z=d[$];if(z.len)_-=z.len,se(z.lit,T,F,_,E,Q,P,k,j),F=W.c,_=W.lc;else{if(!z.p)throw new Error("hufDecode issues");let J;for(J=0;J<z.lit;J++){const ne=Z(p[z.p[J]]);for(;_<ne&&Q.value<V;)te(F,_,E,Q),F=ce.c,_=ce.lc;if(_>=ne&&ie(p[z.p[J]])==(F>>_-ne&(1<<ne)-1)){_-=ne,se(z.p[J],T,F,_,E,Q,P,k,j),F=W.c,_=W.lc;break}}if(J==z.lit)throw new Error("hufDecode issues")}}const q=8-M&7;for(F>>=q,_-=q;_>0;){const $=d[F<<14-_&16383];if($.len)_-=$.len,se($.lit,T,F,_,E,Q,P,k,j),F=W.c,_=W.lc;else throw new Error("hufDecode issues")}return!0}function At(p,d,E,Q,M,T){const L={value:0},P=E.value,k=ze(d,E),F=ze(d,E);E.value+=4;const _=ze(d,E);if(E.value+=4,k<0||k>=65537||F<0||F>=65537)throw new Error("Something wrong with HUF_ENCSIZE");const j=new Array(65537),V=new Array(16384);G(V);const q=Q-(E.value-P);if(O(p,E,q,k,F,j),_>8*(Q-(E.value-P)))throw new Error("Something wrong with hufUncompress");ee(j,k,F,V),Bt(j,V,p,E,_,F,T,M,L)}function gt(p,d,E){for(let Q=0;Q<E;++Q)d[Q]=p[d[Q]]}function st(p){for(let d=1;d<p.length;d++){const E=p[d-1]+p[d]-128;p[d]=E}}function yt(p,d){let E=0,Q=Math.floor((p.length+1)/2),M=0;const T=p.length-1;for(;!(M>T||(d[M++]=p[E++],M>T));)d[M++]=p[Q++]}function ns(p){let d=p.byteLength;const E=new Array;let Q=0;const M=new DataView(p);for(;d>0;){const T=M.getInt8(Q++);if(T<0){const L=-T;d-=L+1;for(let P=0;P<L;P++)E.push(M.getUint8(Q++))}else{const L=T;d-=2;const P=M.getUint8(Q++);for(let k=0;k<L+1;k++)E.push(P)}}return E}function Ni(p,d,E,Q,M,T){let L=new DataView(T.buffer);const P=E[p.idx[0]].width,k=E[p.idx[0]].height,F=3,_=Math.floor(P/8),j=Math.ceil(P/8),V=Math.ceil(k/8),q=P-(j-1)*8,$=k-(V-1)*8,z={value:0},J=new Array(F),ne=new Array(F),ge=new Array(F),Ce=new Array(F),Oe=new Array(F);for(let le=0;le<F;++le)Oe[le]=d[p.idx[le]],J[le]=le<1?0:J[le-1]+j*V,ne[le]=new Float32Array(64),ge[le]=new Uint16Array(64),Ce[le]=new Uint16Array(j*64);for(let le=0;le<V;++le){let Qe=8;le==V-1&&(Qe=$);let Ye=8;for(let ue=0;ue<j;++ue){ue==j-1&&(Ye=q);for(let de=0;de<F;++de)ge[de].fill(0),ge[de][0]=M[J[de]++],Pi(z,Q,ge[de]),Oi(ge[de],ne[de]),Hi(ne[de]);ji(ne);for(let de=0;de<F;++de)qi(ne[de],Ce[de],ue*64)}let Se=0;for(let ue=0;ue<F;++ue){const de=E[p.idx[ue]].type;for(let it=8*le;it<8*le+Qe;++it){Se=Oe[ue][it];for(let Mt=0;Mt<_;++Mt){const Xe=Mt*64+(it&7)*8;L.setUint16(Se+0*de,Ce[ue][Xe+0],!0),L.setUint16(Se+2*de,Ce[ue][Xe+1],!0),L.setUint16(Se+4*de,Ce[ue][Xe+2],!0),L.setUint16(Se+6*de,Ce[ue][Xe+3],!0),L.setUint16(Se+8*de,Ce[ue][Xe+4],!0),L.setUint16(Se+10*de,Ce[ue][Xe+5],!0),L.setUint16(Se+12*de,Ce[ue][Xe+6],!0),L.setUint16(Se+14*de,Ce[ue][Xe+7],!0),Se+=16*de}}if(_!=j)for(let it=8*le;it<8*le+Qe;++it){const Mt=Oe[ue][it]+8*_*2*de,Xe=_*64+(it&7)*8;for(let Jt=0;Jt<Ye;++Jt)L.setUint16(Mt+Jt*2*de,Ce[ue][Xe+Jt],!0)}}}const me=new Uint16Array(P);L=new DataView(T.buffer);for(let le=0;le<F;++le){E[p.idx[le]].decoded=!0;const Qe=E[p.idx[le]].type;if(E[le].type==2)for(let Ye=0;Ye<k;++Ye){const Se=Oe[le][Ye];for(let ue=0;ue<P;++ue)me[ue]=L.getUint16(Se+ue*2*Qe,!0);for(let ue=0;ue<P;++ue)L.setFloat32(Se+ue*2*Qe,K(me[ue]),!0)}}}function Pi(p,d,E){let Q,M=1;for(;M<64;)Q=d[p.value],Q==65280?M=64:Q>>8==255?M+=Q&255:(E[M]=Q,M++),p.value++}function Oi(p,d){d[0]=K(p[0]),d[1]=K(p[1]),d[2]=K(p[5]),d[3]=K(p[6]),d[4]=K(p[14]),d[5]=K(p[15]),d[6]=K(p[27]),d[7]=K(p[28]),d[8]=K(p[2]),d[9]=K(p[4]),d[10]=K(p[7]),d[11]=K(p[13]),d[12]=K(p[16]),d[13]=K(p[26]),d[14]=K(p[29]),d[15]=K(p[42]),d[16]=K(p[3]),d[17]=K(p[8]),d[18]=K(p[12]),d[19]=K(p[17]),d[20]=K(p[25]),d[21]=K(p[30]),d[22]=K(p[41]),d[23]=K(p[43]),d[24]=K(p[9]),d[25]=K(p[11]),d[26]=K(p[18]),d[27]=K(p[24]),d[28]=K(p[31]),d[29]=K(p[40]),d[30]=K(p[44]),d[31]=K(p[53]),d[32]=K(p[10]),d[33]=K(p[19]),d[34]=K(p[23]),d[35]=K(p[32]),d[36]=K(p[39]),d[37]=K(p[45]),d[38]=K(p[52]),d[39]=K(p[54]),d[40]=K(p[20]),d[41]=K(p[22]),d[42]=K(p[33]),d[43]=K(p[38]),d[44]=K(p[46]),d[45]=K(p[51]),d[46]=K(p[55]),d[47]=K(p[60]),d[48]=K(p[21]),d[49]=K(p[34]),d[50]=K(p[37]),d[51]=K(p[47]),d[52]=K(p[50]),d[53]=K(p[56]),d[54]=K(p[59]),d[55]=K(p[61]),d[56]=K(p[35]),d[57]=K(p[36]),d[58]=K(p[48]),d[59]=K(p[49]),d[60]=K(p[57]),d[61]=K(p[58]),d[62]=K(p[62]),d[63]=K(p[63])}function Hi(p){const d=.5*Math.cos(.7853975),E=.5*Math.cos(3.14159/16),Q=.5*Math.cos(3.14159/8),M=.5*Math.cos(3*3.14159/16),T=.5*Math.cos(5*3.14159/16),L=.5*Math.cos(3*3.14159/8),P=.5*Math.cos(7*3.14159/16),k=new Array(4),F=new Array(4),_=new Array(4),j=new Array(4);for(let V=0;V<8;++V){const q=V*8;k[0]=Q*p[q+2],k[1]=L*p[q+2],k[2]=Q*p[q+6],k[3]=L*p[q+6],F[0]=E*p[q+1]+M*p[q+3]+T*p[q+5]+P*p[q+7],F[1]=M*p[q+1]-P*p[q+3]-E*p[q+5]-T*p[q+7],F[2]=T*p[q+1]-E*p[q+3]+P*p[q+5]+M*p[q+7],F[3]=P*p[q+1]-T*p[q+3]+M*p[q+5]-E*p[q+7],_[0]=d*(p[q+0]+p[q+4]),_[3]=d*(p[q+0]-p[q+4]),_[1]=k[0]+k[3],_[2]=k[1]-k[2],j[0]=_[0]+_[1],j[1]=_[3]+_[2],j[2]=_[3]-_[2],j[3]=_[0]-_[1],p[q+0]=j[0]+F[0],p[q+1]=j[1]+F[1],p[q+2]=j[2]+F[2],p[q+3]=j[3]+F[3],p[q+4]=j[3]-F[3],p[q+5]=j[2]-F[2],p[q+6]=j[1]-F[1],p[q+7]=j[0]-F[0]}for(let V=0;V<8;++V)k[0]=Q*p[16+V],k[1]=L*p[16+V],k[2]=Q*p[48+V],k[3]=L*p[48+V],F[0]=E*p[8+V]+M*p[24+V]+T*p[40+V]+P*p[56+V],F[1]=M*p[8+V]-P*p[24+V]-E*p[40+V]-T*p[56+V],F[2]=T*p[8+V]-E*p[24+V]+P*p[40+V]+M*p[56+V],F[3]=P*p[8+V]-T*p[24+V]+M*p[40+V]-E*p[56+V],_[0]=d*(p[V]+p[32+V]),_[3]=d*(p[V]-p[32+V]),_[1]=k[0]+k[3],_[2]=k[1]-k[2],j[0]=_[0]+_[1],j[1]=_[3]+_[2],j[2]=_[3]-_[2],j[3]=_[0]-_[1],p[0+V]=j[0]+F[0],p[8+V]=j[1]+F[1],p[16+V]=j[2]+F[2],p[24+V]=j[3]+F[3],p[32+V]=j[3]-F[3],p[40+V]=j[2]-F[2],p[48+V]=j[1]-F[1],p[56+V]=j[0]-F[0]}function ji(p){for(let d=0;d<64;++d){const E=p[0][d],Q=p[1][d],M=p[2][d];p[0][d]=E+1.5747*M,p[1][d]=E-.1873*Q-.4682*M,p[2][d]=E+1.8556*Q}}function qi(p,d,E){for(let Q=0;Q<64;++Q)d[E+Q]=r.DataUtils.toHalfFloat(zi(p[Q]))}function zi(p){return p<=1?Math.sign(p)*Math.pow(Math.abs(p),2.2):Math.sign(p)*Math.pow(v,Math.abs(p)-1)}function hn(p){return new DataView(p.array.buffer,p.offset.value,p.size)}function Yi(p){const d=p.viewer.buffer.slice(p.offset.value,p.offset.value+p.size),E=new Uint8Array(ns(d)),Q=new Uint8Array(E.length);return st(E),yt(E,Q),new DataView(Q.buffer)}function un(p){const d=p.array.slice(p.offset.value,p.offset.value+p.size),E=Ot(d),Q=new Uint8Array(E.length);return st(E),yt(E,Q),new DataView(Q.buffer)}function Ki(p){const d=p.viewer,E={value:p.offset.value},Q=new Uint16Array(p.columns*p.lines*(p.inputChannels.length*p.type)),M=new Uint8Array(8192);let T=0;const L=new Array(p.inputChannels.length);for(let $=0,z=p.inputChannels.length;$<z;$++)L[$]={},L[$].start=T,L[$].end=L[$].start,L[$].nx=p.columns,L[$].ny=p.lines,L[$].size=p.type,T+=L[$].nx*L[$].ny*L[$].size;const P=vt(d,E),k=vt(d,E);if(k>=8192)throw new Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(P<=k)for(let $=0;$<k-P+1;$++)M[$+P]=ct(d,E);const F=new Uint16Array(65536),_=N(M,F),j=ze(d,E);At(p.array,d,E,j,Q,T);for(let $=0;$<p.inputChannels.length;++$){const z=L[$];for(let J=0;J<L[$].size;++J)Ct(Q,z.start+J,z.nx,z.size,z.ny,z.nx*z.size,_)}gt(F,Q,T);let V=0;const q=new Uint8Array(Q.buffer.byteLength);for(let $=0;$<p.lines;$++)for(let z=0;z<p.inputChannels.length;z++){const J=L[z],ne=J.nx*J.size,ge=new Uint8Array(Q.buffer,J.end*2,ne*2);q.set(ge,V),V+=ne*2,J.end+=ne}return new DataView(q.buffer)}function Vi(p){const d=p.array.slice(p.offset.value,p.offset.value+p.size),E=Ot(d),Q=p.inputChannels.length*p.lines*p.columns*p.totalBytes,M=new ArrayBuffer(Q),T=new DataView(M);let L=0,P=0;const k=new Array(4);for(let F=0;F<p.lines;F++)for(let _=0;_<p.inputChannels.length;_++){let j=0;switch(p.inputChannels[_].pixelType){case 1:k[0]=L,k[1]=k[0]+p.columns,L=k[1]+p.columns;for(let q=0;q<p.columns;++q){const $=E[k[0]++]<<8|E[k[1]++];j+=$,T.setUint16(P,j,!0),P+=2}break;case 2:k[0]=L,k[1]=k[0]+p.columns,k[2]=k[1]+p.columns,L=k[2]+p.columns;for(let q=0;q<p.columns;++q){const $=E[k[0]++]<<24|E[k[1]++]<<16|E[k[2]++]<<8;j+=$,T.setUint32(P,j,!0),P+=4}break}}return T}function ss(p){const d=p.viewer,E={value:p.offset.value},Q=new Uint8Array(p.columns*p.lines*(p.inputChannels.length*p.type*2)),M={version:Pe(d,E),unknownUncompressedSize:Pe(d,E),unknownCompressedSize:Pe(d,E),acCompressedSize:Pe(d,E),dcCompressedSize:Pe(d,E),rleCompressedSize:Pe(d,E),rleUncompressedSize:Pe(d,E),rleRawSize:Pe(d,E),totalAcUncompressedCount:Pe(d,E),totalDcUncompressedCount:Pe(d,E),acCompression:Pe(d,E)};if(M.version<2)throw new Error("EXRLoader.parse: "+ft.compression+" version "+M.version+" is unsupported");const T=new Array;let L=vt(d,E)-2;for(;L>0;){const z=Vt(d.buffer,E),J=ct(d,E),ne=J>>2&3,ge=(J>>4)-1,Ce=new Int8Array([ge])[0],Oe=ct(d,E);T.push({name:z,index:Ce,type:Oe,compression:ne}),L-=z.length+3}const P=ft.channels,k=new Array(p.inputChannels.length);for(let z=0;z<p.inputChannels.length;++z){const J=k[z]={},ne=P[z];J.name=ne.name,J.compression=0,J.decoded=!1,J.type=ne.pixelType,J.pLinear=ne.pLinear,J.width=p.columns,J.height=p.lines}const F={idx:new Array(3)};for(let z=0;z<p.inputChannels.length;++z){const J=k[z];for(let ne=0;ne<T.length;++ne){const ge=T[ne];J.name==ge.name&&(J.compression=ge.compression,ge.index>=0&&(F.idx[ge.index]=z),J.offset=z)}}let _,j,V;if(M.acCompressedSize>0)switch(M.acCompression){case 0:_=new Uint16Array(M.totalAcUncompressedCount),At(p.array,d,E,M.acCompressedSize,_,M.totalAcUncompressedCount);break;case 1:const z=p.array.slice(E.value,E.value+M.totalAcUncompressedCount),J=Ot(z);_=new Uint16Array(J.buffer),E.value+=M.totalAcUncompressedCount;break}if(M.dcCompressedSize>0){const z={array:p.array,offset:E,size:M.dcCompressedSize};j=new Uint16Array(un(z).buffer),E.value+=M.dcCompressedSize}if(M.rleRawSize>0){const z=p.array.slice(E.value,E.value+M.rleCompressedSize),J=Ot(z);V=ns(J.buffer),E.value+=M.rleCompressedSize}let q=0;const $=new Array(k.length);for(let z=0;z<$.length;++z)$[z]=new Array;for(let z=0;z<p.lines;++z)for(let J=0;J<k.length;++J)$[J].push(q),q+=k[J].width*p.type*2;Ni(F,$,k,_,j,Q);for(let z=0;z<k.length;++z){const J=k[z];if(!J.decoded)switch(J.compression){case 2:let ne=0,ge=0;for(let Ce=0;Ce<p.lines;++Ce){let Oe=$[z][ne];for(let me=0;me<J.width;++me){for(let le=0;le<2*J.type;++le)Q[Oe++]=V[ge+le*J.width*J.height];ge++}ne++}break;default:throw new Error("EXRLoader.parse: unsupported channel compression")}}return new DataView(Q.buffer)}function Vt(p,d){const E=new Uint8Array(p);let Q=0;for(;E[d.value+Q]!=0;)Q+=1;const M=new TextDecoder().decode(E.slice(d.value,d.value+Q));return d.value=d.value+Q+1,M}function Ji(p,d,E){const Q=new TextDecoder().decode(new Uint8Array(p).slice(d.value,d.value+E));return d.value=d.value+E,Q}function Wi(p,d){const E=qe(p,d),Q=ze(p,d);return[E,Q]}function Xi(p,d){const E=ze(p,d),Q=ze(p,d);return[E,Q]}function qe(p,d){const E=p.getInt32(d.value,!0);return d.value=d.value+4,E}function ze(p,d){const E=p.getUint32(d.value,!0);return d.value=d.value+4,E}function is(p,d){const E=p[d.value];return d.value=d.value+1,E}function ct(p,d){const E=p.getUint8(d.value);return d.value=d.value+1,E}const Pe=function(p,d){let E;return"getBigInt64"in DataView.prototype?E=Number(p.getBigInt64(d.value,!0)):E=p.getUint32(d.value+4,!0)+Number(p.getUint32(d.value,!0)<<32),d.value+=8,E};function De(p,d){const E=p.getFloat32(d.value,!0);return d.value+=4,E}function Zi(p,d){return r.DataUtils.toHalfFloat(De(p,d))}function K(p){const d=(p&31744)>>10,E=p&1023;return(p>>15?-1:1)*(d?d===31?E?NaN:1/0:Math.pow(2,d-15)*(1+E/1024):6103515625e-14*(E/1024))}function vt(p,d){const E=p.getUint16(d.value,!0);return d.value+=2,E}function $i(p,d){return K(vt(p,d))}function eo(p,d,E,Q){const M=E.value,T=[];for(;E.value<M+Q-1;){const L=Vt(d,E),P=qe(p,E),k=ct(p,E);E.value+=3;const F=qe(p,E),_=qe(p,E);T.push({name:L,pixelType:P,pLinear:k,xSampling:F,ySampling:_})}return E.value+=1,T}function to(p,d){const E=De(p,d),Q=De(p,d),M=De(p,d),T=De(p,d),L=De(p,d),P=De(p,d),k=De(p,d),F=De(p,d);return{redX:E,redY:Q,greenX:M,greenY:T,blueX:L,blueY:P,whiteX:k,whiteY:F}}function no(p,d){const E=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],Q=ct(p,d);return E[Q]}function so(p,d){const E=qe(p,d),Q=qe(p,d),M=qe(p,d),T=qe(p,d);return{xMin:E,yMin:Q,xMax:M,yMax:T}}function io(p,d){const E=["INCREASING_Y","DECREASING_Y","RANDOM_Y"],Q=ct(p,d);return E[Q]}function oo(p,d){const E=["ENVMAP_LATLONG","ENVMAP_CUBE"],Q=ct(p,d);return E[Q]}function ro(p,d){const E=["ONE_LEVEL","MIPMAP_LEVELS","RIPMAP_LEVELS"],Q=["ROUND_DOWN","ROUND_UP"],M=ze(p,d),T=ze(p,d),L=ct(p,d);return{xSize:M,ySize:T,levelMode:E[L&15],roundingMode:Q[L>>4]}}function ao(p,d){const E=De(p,d),Q=De(p,d);return[E,Q]}function Ao(p,d){const E=De(p,d),Q=De(p,d),M=De(p,d);return[E,Q,M]}function co(p,d,E,Q,M){if(Q==="string"||Q==="stringvector"||Q==="iccProfile")return Ji(d,E,M);if(Q==="chlist")return eo(p,d,E,M);if(Q==="chromaticities")return to(p,E);if(Q==="compression")return no(p,E);if(Q==="box2i")return so(p,E);if(Q==="envmap")return oo(p,E);if(Q==="tiledesc")return ro(p,E);if(Q==="lineOrder")return io(p,E);if(Q==="float")return De(p,E);if(Q==="v2f")return ao(p,E);if(Q==="v3f")return Ao(p,E);if(Q==="int")return qe(p,E);if(Q==="rational")return Wi(p,E);if(Q==="timecode")return Xi(p,E);if(Q==="preview")return E.value+=M,"skipped";E.value+=M}function lo(p,d){const E=Math.log2(p);return d=="ROUND_DOWN"?Math.floor(E):Math.ceil(E)}function ho(p,d,E){let Q=0;switch(p.levelMode){case"ONE_LEVEL":Q=1;break;case"MIPMAP_LEVELS":Q=lo(Math.max(d,E),p.roundingMode)+1;break;case"RIPMAP_LEVELS":throw new Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.")}return Q}function os(p,d,E,Q){const M=new Array(p);for(let T=0;T<p;T++){const L=1<<T;let P=d/L|0;Q=="ROUND_UP"&&P*L<d&&(P+=1);const k=Math.max(P,1);M[T]=(k+E-1)/E|0}return M}function uo(){const p=this,d=p.offset,E={value:0};for(let Q=0;Q<p.tileCount;Q++){const M=qe(p.viewer,d),T=qe(p.viewer,d);d.value+=8,p.size=ze(p.viewer,d);const L=M*p.blockWidth,P=T*p.blockHeight;p.columns=L+p.blockWidth>p.width?p.width-L:p.blockWidth,p.lines=P+p.blockHeight>p.height?p.height-P:p.blockHeight;const k=p.columns*p.totalBytes,_=p.size<p.lines*k?p.uncompress(p):hn(p);d.value+=p.size;for(let j=0;j<p.lines;j++){const V=j*p.columns*p.totalBytes;for(let q=0;q<p.inputChannels.length;q++){const $=ft.channels[q].name,z=p.channelByteOffsets[$]*p.columns,J=p.decodeChannels[$];if(J===void 0)continue;E.value=V+z;const ne=(p.height-(1+P+j))*p.outLineWidth;for(let ge=0;ge<p.columns;ge++){const Ce=ne+(ge+L)*p.outputChannels+J;p.byteArray[Ce]=p.getter(_,E)}}}}}function po(){const p=this,d=p.offset,E={value:0};for(let Q=0;Q<p.height/p.blockHeight;Q++){const M=qe(p.viewer,d)-ft.dataWindow.yMin;p.size=ze(p.viewer,d),p.lines=M+p.blockHeight>p.height?p.height-M:p.blockHeight;const T=p.columns*p.totalBytes,P=p.size<p.lines*T?p.uncompress(p):hn(p);d.value+=p.size;for(let k=0;k<p.blockHeight;k++){const F=Q*p.blockHeight,_=k+p.scanOrder(F);if(_>=p.height)continue;const j=k*T,V=(p.height-1-_)*p.outLineWidth;for(let q=0;q<p.inputChannels.length;q++){const $=ft.channels[q].name,z=p.channelByteOffsets[$]*p.columns,J=p.decodeChannels[$];if(J!==void 0){E.value=j+z;for(let ne=0;ne<p.columns;ne++){const ge=V+ne*p.outputChannels+J;p.byteArray[ge]=p.getter(P,E)}}}}}}function go(p,d,E){const Q={};if(p.getUint32(0,!0)!=20000630)throw new Error("THREE.EXRLoader: Provided file doesn't appear to be in OpenEXR format.");Q.version=p.getUint8(4);const M=p.getUint8(5);Q.spec={singleTile:!!(M&2),longName:!!(M&4),deepFormat:!!(M&8),multiPart:!!(M&16)},E.value=8;let T=!0;for(;T;){const L=Vt(d,E);if(L==0)T=!1;else{const P=Vt(d,E),k=ze(p,E),F=co(p,d,E,P,k);F===void 0?console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${P}'.`):Q[L]=F}}if((M&-7)!=0)throw console.error("THREE.EXRHeader:",Q),new Error("THREE.EXRLoader: Provided file is currently unsupported.");return Q}function fo(p,d,E,Q,M){const T={size:0,viewer:d,array:E,offset:Q,width:p.dataWindow.xMax-p.dataWindow.xMin+1,height:p.dataWindow.yMax-p.dataWindow.yMin+1,inputChannels:p.channels,channelByteOffsets:{},scanOrder:null,totalBytes:null,columns:null,lines:null,type:null,uncompress:null,getter:null,format:null,colorSpace:r.LinearSRGBColorSpace};switch(p.compression){case"NO_COMPRESSION":T.blockHeight=1,T.uncompress=hn;break;case"RLE_COMPRESSION":T.blockHeight=1,T.uncompress=Yi;break;case"ZIPS_COMPRESSION":T.blockHeight=1,T.uncompress=un;break;case"ZIP_COMPRESSION":T.blockHeight=16,T.uncompress=un;break;case"PIZ_COMPRESSION":T.blockHeight=32,T.uncompress=Ki;break;case"PXR24_COMPRESSION":T.blockHeight=16,T.uncompress=Vi;break;case"DWAA_COMPRESSION":T.blockHeight=32,T.uncompress=ss;break;case"DWAB_COMPRESSION":T.blockHeight=256,T.uncompress=ss;break;default:throw new Error("EXRLoader.parse: "+p.compression+" is unsupported")}const L={};for(const _ of p.channels)switch(_.name){case"Y":case"R":case"G":case"B":case"A":L[_.name]=!0,T.type=_.pixelType}let P=!1;if(L.R&&L.G&&L.B)P=!L.A,T.outputChannels=4,T.decodeChannels={R:0,G:1,B:2,A:3};else if(L.Y)T.outputChannels=1,T.decodeChannels={Y:0};else throw new Error("EXRLoader.parse: file contains unsupported data channels.");if(T.type==1)switch(M){case r.FloatType:T.getter=$i;break;case r.HalfFloatType:T.getter=vt;break}else if(T.type==2)switch(M){case r.FloatType:T.getter=De;break;case r.HalfFloatType:T.getter=Zi}else throw new Error("EXRLoader.parse: unsupported pixelType "+T.type+" for "+p.compression+".");T.columns=T.width;const k=T.width*T.height*T.outputChannels;switch(M){case r.FloatType:T.byteArray=new Float32Array(k),P&&T.byteArray.fill(1,0,k);break;case r.HalfFloatType:T.byteArray=new Uint16Array(k),P&&T.byteArray.fill(15360,0,k);break;default:console.error("THREE.EXRLoader: unsupported type: ",M);break}let F=0;for(const _ of p.channels)T.decodeChannels[_.name]!==void 0&&(T.channelByteOffsets[_.name]=F),F+=_.pixelType*2;if(T.totalBytes=F,T.outLineWidth=T.width*T.outputChannels,p.lineOrder==="INCREASING_Y"?T.scanOrder=_=>_:T.scanOrder=_=>T.height-1-_,T.outputChannels==4?(T.format=r.RGBAFormat,T.colorSpace=r.LinearSRGBColorSpace):(T.format=r.RedFormat,T.colorSpace=r.NoColorSpace),p.spec.singleTile){T.blockHeight=p.tiles.ySize,T.blockWidth=p.tiles.xSize;const _=ho(p.tiles,T.width,T.height),j=os(_,T.width,p.tiles.xSize,p.tiles.roundingMode),V=os(_,T.height,p.tiles.ySize,p.tiles.roundingMode);T.tileCount=j[0]*V[0];for(let q=0;q<_;q++)for(let $=0;$<V[q];$++)for(let z=0;z<j[q];z++)Pe(d,Q);T.decode=uo.bind(T)}else{T.blockWidth=T.width;const _=Math.ceil(T.height/T.blockHeight);for(let j=0;j<_;j++)Pe(d,Q);T.decode=po.bind(T)}return T}const rs={value:0},as=new DataView(e),Io=new Uint8Array(e),ft=go(as,e,rs),wt=fo(ft,as,Io,rs,this.type);return wt.decode(),{header:ft,width:wt.width,height:wt.height,data:wt.byteArray,format:wt.format,colorSpace:wt.colorSpace,type:this.type}}setDataType(e){return this.type=e,this}load(e,t,s,n){function i(o,a){o.colorSpace=a.colorSpace,o.minFilter=r.LinearFilter,o.magFilter=r.LinearFilter,o.generateMipmaps=!1,o.flipY=!1,t&&t(o,a)}return super.load(e,i,s,n)}}class Xr extends r.DataTextureLoader{constructor(e){super(e),this.type=r.HalfFloatType}parse(e){const o=function(S,v){switch(S){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(v||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(v||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(v||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(v||""))}},u=function(S,v,N){v=v||1024;let H=S.pos,X=-1,U=0,Y="",O=String.fromCharCode.apply(null,new Uint16Array(S.subarray(H,H+128)));for(;0>(X=O.indexOf(`
|
|
5
|
-
`))&&
|
|
6
|
-
`;
|
|
7
|
-
`,
|
|
8
|
-
`;continue}if((O=Y.match(N))&&(U.gamma=parseFloat(O[1])),(O=Y.match(G))&&(U.exposure=parseFloat(O[1])),(O=Y.match(H))&&(U.valid|=2,U.format=O[1]),(O=Y.match(X))&&(U.valid|=4,U.height=parseInt(O[1],10),U.width=parseInt(O[2],10)),U.valid&2&&U.valid&4)break}return U.valid&2||o(3,"missing format specifier"),U.valid&4||o(3,"missing image size specifier"),U},f=function(S,v,N){const G=v;if(G<8||G>32767||S[0]!==2||S[1]!==2||S[2]&128)return new Uint8Array(S);G!==(S[2]<<8|S[3])&&o(3,"wrong scanline width");const H=new Uint8Array(4*v*N);H.length||o(4,"unable to allocate buffer space");let X=0,U=0;const Y=4*G,O=new Uint8Array(4),Z=new Uint8Array(Y);let ie=N;for(;ie>0&&U<S.byteLength;){U+4>S.byteLength&&o(1),O[0]=S[U++],O[1]=S[U++],O[2]=S[U++],O[3]=S[U++],(O[0]!=2||O[1]!=2||(O[2]<<8|O[3])!=G)&&o(3,"bad rgbe scanline format");let ee=0,ce;for(;ee<Y&&U<S.byteLength;){ce=S[U++];const W=ce>128;if(W&&(ce-=128),(ce===0||ee+ce>Y)&&o(3,"bad scanline data"),W){const se=S[U++];for(let pe=0;pe<ce;pe++)Z[ee++]=se}else Z.set(S.subarray(U,U+ce),ee),ee+=ce,U+=ce}const te=G;for(let W=0;W<te;W++){let se=0;H[X]=Z[W+se],se+=G,H[X+1]=Z[W+se],se+=G,H[X+2]=Z[W+se],se+=G,H[X+3]=Z[W+se],X+=4}ie--}return H},I=function(S,v,N,G){const H=S[v+3],X=Math.pow(2,H-128)/255;N[G+0]=S[v+0]*X,N[G+1]=S[v+1]*X,N[G+2]=S[v+2]*X,N[G+3]=1},m=function(S,v,N,G){const H=S[v+3],X=Math.pow(2,H-128)/255;N[G+0]=r.DataUtils.toHalfFloat(Math.min(S[v+0]*X,65504)),N[G+1]=r.DataUtils.toHalfFloat(Math.min(S[v+1]*X,65504)),N[G+2]=r.DataUtils.toHalfFloat(Math.min(S[v+2]*X,65504)),N[G+3]=r.DataUtils.toHalfFloat(1)},b=new Uint8Array(e);b.pos=0;const B=g(b),w=B.width,C=B.height,y=f(b.subarray(b.pos),w,C);let x,R,D;switch(this.type){case r.FloatType:D=y.length/4;const S=new Float32Array(D*4);for(let N=0;N<D;N++)I(y,N*4,S,N*4);x=S,R=r.FloatType;break;case r.HalfFloatType:D=y.length/4;const v=new Uint16Array(D*4);for(let N=0;N<D;N++)m(y,N*4,v,N*4);x=v,R=r.HalfFloatType;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:w,height:C,data:x,header:B.string,gamma:B.gamma,exposure:B.exposure,type:R}}setDataType(e){return this.type=e,this}load(e,t,s,n){function i(o,a){switch(o.type){case r.FloatType:case r.HalfFloatType:o.colorSpace=r.LinearSRGBColorSpace,o.minFilter=r.LinearFilter,o.magFilter=r.LinearFilter,o.generateMipmaps=!1,o.flipY=!0;break}t&&t(o,a)}return super.load(e,i,s,n)}}const It=new r.Raycaster,_e=new r.Vector3,ut=new r.Vector3,Ee=new r.Quaternion,Bs={X:new r.Vector3(1,0,0),Y:new r.Vector3(0,1,0),Z:new r.Vector3(0,0,1)},xn={type:"change"},ys={type:"mouseDown",mode:null},ws={type:"mouseUp",mode:null},Qs={type:"objectChange"};class Zr extends r.Controls{constructor(e,t=null){super(void 0,t);const s=new ia(this);this._root=s;const n=new vi;this._gizmo=n,s.add(n);const i=new oa;this._plane=i,s.add(i);const o=this;function a(C,y){let x=y;Object.defineProperty(o,C,{get:function(){return x!==void 0?x:y},set:function(R){x!==R&&(x=R,i[C]=R,n[C]=R,o.dispatchEvent({type:C+"-changed",value:R}),o.dispatchEvent(xn))}}),o[C]=y,i[C]=y,n[C]=y}a("camera",e),a("object",void 0),a("enabled",!0),a("axis",null),a("mode","translate"),a("translationSnap",null),a("rotationSnap",null),a("scaleSnap",null),a("space","world"),a("size",1),a("dragging",!1),a("showX",!0),a("showY",!0),a("showZ",!0);const A=new r.Vector3,l=new r.Vector3,h=new r.Quaternion,u=new r.Quaternion,g=new r.Vector3,f=new r.Quaternion,I=new r.Vector3,m=new r.Vector3,b=new r.Vector3,B=0,w=new r.Vector3;a("worldPosition",A),a("worldPositionStart",l),a("worldQuaternion",h),a("worldQuaternionStart",u),a("cameraPosition",g),a("cameraQuaternion",f),a("pointStart",I),a("pointEnd",m),a("rotationAxis",b),a("rotationAngle",B),a("eye",w),this._offset=new r.Vector3,this._startNorm=new r.Vector3,this._endNorm=new r.Vector3,this._cameraScale=new r.Vector3,this._parentPosition=new r.Vector3,this._parentQuaternion=new r.Quaternion,this._parentQuaternionInv=new r.Quaternion,this._parentScale=new r.Vector3,this._worldScaleStart=new r.Vector3,this._worldQuaternionInv=new r.Quaternion,this._worldScale=new r.Vector3,this._positionStart=new r.Vector3,this._quaternionStart=new r.Quaternion,this._scaleStart=new r.Vector3,this._getPointer=$r.bind(this),this._onPointerDown=ta.bind(this),this._onPointerHover=ea.bind(this),this._onPointerMove=na.bind(this),this._onPointerUp=sa.bind(this),t!==null&&this.connect()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="auto"}getHelper(){return this._root}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;e!==null&&It.setFromCamera(e,this.camera);const t=Sn(this._gizmo.picker[this.mode],It);t?this.axis=t.object.name:this.axis=null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e!=null&&e.button!==0)&&this.axis!==null){e!==null&&It.setFromCamera(e,this.camera);const t=Sn(this._plane,It,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,ys.mode=this.mode,this.dispatchEvent(ys)}}pointerMove(e){const t=this.axis,s=this.mode,n=this.object;let i=this.space;if(s==="scale"?i="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(i="world"),n===void 0||t===null||this.dragging===!1||e!==null&&e.button!==-1)return;e!==null&&It.setFromCamera(e,this.camera);const o=Sn(this._plane,It,!0);if(o){if(this.pointEnd.copy(o.point).sub(this.worldPositionStart),s==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),i==="local"&&t!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf("X")===-1&&(this._offset.x=0),t.indexOf("Y")===-1&&(this._offset.y=0),t.indexOf("Z")===-1&&(this._offset.z=0),i==="local"&&t!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),n.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(i==="local"&&(n.position.applyQuaternion(Ee.copy(this._quaternionStart).invert()),t.search("X")!==-1&&(n.position.x=Math.round(n.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(n.position.y=Math.round(n.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(n.position.z=Math.round(n.position.z/this.translationSnap)*this.translationSnap),n.position.applyQuaternion(this._quaternionStart)),i==="world"&&(n.parent&&n.position.add(_e.setFromMatrixPosition(n.parent.matrixWorld)),t.search("X")!==-1&&(n.position.x=Math.round(n.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(n.position.y=Math.round(n.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(n.position.z=Math.round(n.position.z/this.translationSnap)*this.translationSnap),n.parent&&n.position.sub(_e.setFromMatrixPosition(n.parent.matrixWorld))));else if(s==="scale"){if(t.search("XYZ")!==-1){let a=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(a*=-1),ut.set(a,a,a)}else _e.copy(this.pointStart),ut.copy(this.pointEnd),_e.applyQuaternion(this._worldQuaternionInv),ut.applyQuaternion(this._worldQuaternionInv),ut.divide(_e),t.search("X")===-1&&(ut.x=1),t.search("Y")===-1&&(ut.y=1),t.search("Z")===-1&&(ut.z=1);n.scale.copy(this._scaleStart).multiply(ut),this.scaleSnap&&(t.search("X")!==-1&&(n.scale.x=Math.round(n.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Y")!==-1&&(n.scale.y=Math.round(n.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Z")!==-1&&(n.scale.z=Math.round(n.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(s==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const a=20/this.worldPosition.distanceTo(_e.setFromMatrixPosition(this.camera.matrixWorld));let A=!1;t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(_e.copy(this.rotationAxis).cross(this.eye))*a):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(Bs[t]),_e.copy(Bs[t]),i==="local"&&_e.applyQuaternion(this.worldQuaternion),_e.cross(this.eye),_e.length()===0?A=!0:this.rotationAngle=this._offset.dot(_e.normalize())*a),(t==="E"||A)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),i==="local"&&t!=="E"&&t!=="XYZE"?(n.quaternion.copy(this._quaternionStart),n.quaternion.multiply(Ee.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),n.quaternion.copy(Ee.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),n.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(xn),this.dispatchEvent(Qs)}}pointerUp(e){e!==null&&e.button!==0||(this.dragging&&this.axis!==null&&(ws.mode=this.mode,this.dispatchEvent(ws)),this.dragging=!1,this.axis=null)}dispose(){this.disconnect(),this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}attach(e){return this.object=e,this._root.visible=!0,this}detach(){return this.object=void 0,this.axis=null,this._root.visible=!1,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(xn),this.dispatchEvent(Qs),this.pointStart.copy(this.pointEnd))}getRaycaster(){return It}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}}function $r(c){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:c.button};{const e=this.domElement.getBoundingClientRect();return{x:(c.clientX-e.left)/e.width*2-1,y:-(c.clientY-e.top)/e.height*2+1,button:c.button}}}function ea(c){if(this.enabled)switch(c.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(c));break}}function ta(c){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(c.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(c)),this.pointerDown(this._getPointer(c)))}function na(c){this.enabled&&this.pointerMove(this._getPointer(c))}function sa(c){this.enabled&&(this.domElement.releasePointerCapture(c.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(c)))}function Sn(c,e,t){const s=e.intersectObject(c,!0);for(let n=0;n<s.length;n++)if(s[n].object.visible||t)return s[n];return!1}const Wt=new r.Euler,fe=new r.Vector3(0,1,0),xs=new r.Vector3(0,0,0),Ss=new r.Matrix4,Xt=new r.Quaternion,an=new r.Quaternion,Ze=new r.Vector3,Ts=new r.Matrix4,Ht=new r.Vector3(1,0,0),bt=new r.Vector3(0,1,0),jt=new r.Vector3(0,0,1),Zt=new r.Vector3,kt=new r.Vector3,Gt=new r.Vector3;class ia extends r.Object3D{constructor(e){super(),this.isTransformControlsRoot=!0,this.controls=e,this.visible=!1}updateMatrixWorld(e){const t=this.controls;t.object!==void 0&&(t.object.updateMatrixWorld(),t.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):t.object.parent.matrixWorld.decompose(t._parentPosition,t._parentQuaternion,t._parentScale),t.object.matrixWorld.decompose(t.worldPosition,t.worldQuaternion,t._worldScale),t._parentQuaternionInv.copy(t._parentQuaternion).invert(),t._worldQuaternionInv.copy(t.worldQuaternion).invert()),t.camera.updateMatrixWorld(),t.camera.matrixWorld.decompose(t.cameraPosition,t.cameraQuaternion,t._cameraScale),t.camera.isOrthographicCamera?t.camera.getWorldDirection(t.eye).negate():t.eye.copy(t.cameraPosition).sub(t.worldPosition).normalize(),super.updateMatrixWorld(e)}}class vi extends r.Object3D{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const e=new r.MeshBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new r.LineBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),s=e.clone();s.opacity=.15;const n=t.clone();n.opacity=.5;const i=e.clone();i.color.setHex(16711680);const o=e.clone();o.color.setHex(65280);const a=e.clone();a.color.setHex(255);const A=e.clone();A.color.setHex(16711680),A.opacity=.5;const l=e.clone();l.color.setHex(65280),l.opacity=.5;const h=e.clone();h.color.setHex(255),h.opacity=.5;const u=e.clone();u.opacity=.25;const g=e.clone();g.color.setHex(16776960),g.opacity=.25,e.clone().color.setHex(16776960);const I=e.clone();I.color.setHex(7895160);const m=new r.CylinderGeometry(0,.04,.1,12);m.translate(0,.05,0);const b=new r.BoxGeometry(.08,.08,.08);b.translate(0,.04,0);const B=new r.BufferGeometry;B.setAttribute("position",new r.Float32BufferAttribute([0,0,0,1,0,0],3));const w=new r.CylinderGeometry(.0075,.0075,.5,3);w.translate(0,.25,0);function C(Y,O){const Z=new r.TorusGeometry(Y,.0075,3,64,O*Math.PI*2);return Z.rotateY(Math.PI/2),Z.rotateX(Math.PI/2),Z}function y(){const Y=new r.BufferGeometry;return Y.setAttribute("position",new r.Float32BufferAttribute([0,0,0,1,1,1],3)),Y}const x={X:[[new r.Mesh(m,i),[.5,0,0],[0,0,-Math.PI/2]],[new r.Mesh(m,i),[-.5,0,0],[0,0,Math.PI/2]],[new r.Mesh(w,i),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new r.Mesh(m,o),[0,.5,0]],[new r.Mesh(m,o),[0,-.5,0],[Math.PI,0,0]],[new r.Mesh(w,o)]],Z:[[new r.Mesh(m,a),[0,0,.5],[Math.PI/2,0,0]],[new r.Mesh(m,a),[0,0,-.5],[-Math.PI/2,0,0]],[new r.Mesh(w,a),null,[Math.PI/2,0,0]]],XYZ:[[new r.Mesh(new r.OctahedronGeometry(.1,0),u.clone()),[0,0,0]]],XY:[[new r.Mesh(new r.BoxGeometry(.15,.15,.01),h.clone()),[.15,.15,0]]],YZ:[[new r.Mesh(new r.BoxGeometry(.15,.15,.01),A.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new r.Mesh(new r.BoxGeometry(.15,.15,.01),l.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},R={X:[[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),s),[.3,0,0],[0,0,-Math.PI/2]],[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),s),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),s),[0,.3,0]],[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),s),[0,-.3,0],[0,0,Math.PI]]],Z:[[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),s),[0,0,.3],[Math.PI/2,0,0]],[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),s),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new r.Mesh(new r.OctahedronGeometry(.2,0),s)]],XY:[[new r.Mesh(new r.BoxGeometry(.2,.2,.01),s),[.15,.15,0]]],YZ:[[new r.Mesh(new r.BoxGeometry(.2,.2,.01),s),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new r.Mesh(new r.BoxGeometry(.2,.2,.01),s),[.15,0,.15],[-Math.PI/2,0,0]]]},D={START:[[new r.Mesh(new r.OctahedronGeometry(.01,2),n),null,null,null,"helper"]],END:[[new r.Mesh(new r.OctahedronGeometry(.01,2),n),null,null,null,"helper"]],DELTA:[[new r.Line(y(),n),null,null,null,"helper"]],X:[[new r.Line(B,n.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new r.Line(B,n.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new r.Line(B,n.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},S={XYZE:[[new r.Mesh(C(.5,1),I),null,[0,Math.PI/2,0]]],X:[[new r.Mesh(C(.5,.5),i)]],Y:[[new r.Mesh(C(.5,.5),o),null,[0,0,-Math.PI/2]]],Z:[[new r.Mesh(C(.5,.5),a),null,[0,Math.PI/2,0]]],E:[[new r.Mesh(C(.75,1),g),null,[0,Math.PI/2,0]]]},v={AXIS:[[new r.Line(B,n.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},N={XYZE:[[new r.Mesh(new r.SphereGeometry(.25,10,8),s)]],X:[[new r.Mesh(new r.TorusGeometry(.5,.1,4,24),s),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new r.Mesh(new r.TorusGeometry(.5,.1,4,24),s),[0,0,0],[Math.PI/2,0,0]]],Z:[[new r.Mesh(new r.TorusGeometry(.5,.1,4,24),s),[0,0,0],[0,0,-Math.PI/2]]],E:[[new r.Mesh(new r.TorusGeometry(.75,.1,2,24),s)]]},G={X:[[new r.Mesh(b,i),[.5,0,0],[0,0,-Math.PI/2]],[new r.Mesh(w,i),[0,0,0],[0,0,-Math.PI/2]],[new r.Mesh(b,i),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new r.Mesh(b,o),[0,.5,0]],[new r.Mesh(w,o)],[new r.Mesh(b,o),[0,-.5,0],[0,0,Math.PI]]],Z:[[new r.Mesh(b,a),[0,0,.5],[Math.PI/2,0,0]],[new r.Mesh(w,a),[0,0,0],[Math.PI/2,0,0]],[new r.Mesh(b,a),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new r.Mesh(new r.BoxGeometry(.15,.15,.01),h),[.15,.15,0]]],YZ:[[new r.Mesh(new r.BoxGeometry(.15,.15,.01),A),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new r.Mesh(new r.BoxGeometry(.15,.15,.01),l),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new r.Mesh(new r.BoxGeometry(.1,.1,.1),u.clone())]]},H={X:[[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),s),[.3,0,0],[0,0,-Math.PI/2]],[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),s),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),s),[0,.3,0]],[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),s),[0,-.3,0],[0,0,Math.PI]]],Z:[[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),s),[0,0,.3],[Math.PI/2,0,0]],[new r.Mesh(new r.CylinderGeometry(.2,0,.6,4),s),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new r.Mesh(new r.BoxGeometry(.2,.2,.01),s),[.15,.15,0]]],YZ:[[new r.Mesh(new r.BoxGeometry(.2,.2,.01),s),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new r.Mesh(new r.BoxGeometry(.2,.2,.01),s),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new r.Mesh(new r.BoxGeometry(.2,.2,.2),s),[0,0,0]]]},X={X:[[new r.Line(B,n.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new r.Line(B,n.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new r.Line(B,n.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function U(Y){const O=new r.Object3D;for(const Z in Y)for(let ie=Y[Z].length;ie--;){const ee=Y[Z][ie][0].clone(),ce=Y[Z][ie][1],te=Y[Z][ie][2],W=Y[Z][ie][3],se=Y[Z][ie][4];ee.name=Z,ee.tag=se,ce&&ee.position.set(ce[0],ce[1],ce[2]),te&&ee.rotation.set(te[0],te[1],te[2]),W&&ee.scale.set(W[0],W[1],W[2]),ee.updateMatrix();const pe=ee.geometry.clone();pe.applyMatrix4(ee.matrix),ee.geometry=pe,ee.renderOrder=1/0,ee.position.set(0,0,0),ee.rotation.set(0,0,0),ee.scale.set(1,1,1),O.add(ee)}return O}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=U(x)),this.add(this.gizmo.rotate=U(S)),this.add(this.gizmo.scale=U(G)),this.add(this.picker.translate=U(R)),this.add(this.picker.rotate=U(N)),this.add(this.picker.scale=U(H)),this.add(this.helper.translate=U(D)),this.add(this.helper.rotate=U(v)),this.add(this.helper.scale=U(X)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){const s=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:an;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let i=0;i<n.length;i++){const o=n[i];o.visible=!0,o.rotation.set(0,0,0),o.position.copy(this.worldPosition);let a;if(this.camera.isOrthographicCamera?a=(this.camera.top-this.camera.bottom)/this.camera.zoom:a=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),o.scale.set(1,1,1).multiplyScalar(a*this.size/4),o.tag==="helper"){o.visible=!1,o.name==="AXIS"?(o.visible=!!this.axis,this.axis==="X"&&(Ee.setFromEuler(Wt.set(0,0,0)),o.quaternion.copy(s).multiply(Ee),Math.abs(fe.copy(Ht).applyQuaternion(s).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Y"&&(Ee.setFromEuler(Wt.set(0,0,Math.PI/2)),o.quaternion.copy(s).multiply(Ee),Math.abs(fe.copy(bt).applyQuaternion(s).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Z"&&(Ee.setFromEuler(Wt.set(0,Math.PI/2,0)),o.quaternion.copy(s).multiply(Ee),Math.abs(fe.copy(jt).applyQuaternion(s).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="XYZE"&&(Ee.setFromEuler(Wt.set(0,Math.PI/2,0)),fe.copy(this.rotationAxis),o.quaternion.setFromRotationMatrix(Ss.lookAt(xs,fe,bt)),o.quaternion.multiply(Ee),o.visible=this.dragging),this.axis==="E"&&(o.visible=!1)):o.name==="START"?(o.position.copy(this.worldPositionStart),o.visible=this.dragging):o.name==="END"?(o.position.copy(this.worldPosition),o.visible=this.dragging):o.name==="DELTA"?(o.position.copy(this.worldPositionStart),o.quaternion.copy(this.worldQuaternionStart),_e.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),_e.applyQuaternion(this.worldQuaternionStart.clone().invert()),o.scale.copy(_e),o.visible=this.dragging):(o.quaternion.copy(s),this.dragging?o.position.copy(this.worldPositionStart):o.position.copy(this.worldPosition),this.axis&&(o.visible=this.axis.search(o.name)!==-1));continue}o.quaternion.copy(s),this.mode==="translate"||this.mode==="scale"?(o.name==="X"&&Math.abs(fe.copy(Ht).applyQuaternion(s).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Y"&&Math.abs(fe.copy(bt).applyQuaternion(s).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Z"&&Math.abs(fe.copy(jt).applyQuaternion(s).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XY"&&Math.abs(fe.copy(jt).applyQuaternion(s).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="YZ"&&Math.abs(fe.copy(Ht).applyQuaternion(s).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XZ"&&Math.abs(fe.copy(bt).applyQuaternion(s).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1)):this.mode==="rotate"&&(Xt.copy(s),fe.copy(this.eye).applyQuaternion(Ee.copy(s).invert()),o.name.search("E")!==-1&&o.quaternion.setFromRotationMatrix(Ss.lookAt(this.eye,xs,bt)),o.name==="X"&&(Ee.setFromAxisAngle(Ht,Math.atan2(-fe.y,fe.z)),Ee.multiplyQuaternions(Xt,Ee),o.quaternion.copy(Ee)),o.name==="Y"&&(Ee.setFromAxisAngle(bt,Math.atan2(fe.x,fe.z)),Ee.multiplyQuaternions(Xt,Ee),o.quaternion.copy(Ee)),o.name==="Z"&&(Ee.setFromAxisAngle(jt,Math.atan2(fe.y,fe.x)),Ee.multiplyQuaternions(Xt,Ee),o.quaternion.copy(Ee))),o.visible=o.visible&&(o.name.indexOf("X")===-1||this.showX),o.visible=o.visible&&(o.name.indexOf("Y")===-1||this.showY),o.visible=o.visible&&(o.name.indexOf("Z")===-1||this.showZ),o.visible=o.visible&&(o.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),o.material._color=o.material._color||o.material.color.clone(),o.material._opacity=o.material._opacity||o.material.opacity,o.material.color.copy(o.material._color),o.material.opacity=o.material._opacity,this.enabled&&this.axis&&(o.name===this.axis||this.axis.split("").some(function(A){return o.name===A}))&&(o.material.color.setHex(16776960),o.material.opacity=1)}super.updateMatrixWorld(e)}}class oa extends r.Mesh{constructor(){super(new r.PlaneGeometry(1e5,1e5,2,2),new r.MeshBasicMaterial({visible:!1,wireframe:!0,side:r.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(t="local"),Zt.copy(Ht).applyQuaternion(t==="local"?this.worldQuaternion:an),kt.copy(bt).applyQuaternion(t==="local"?this.worldQuaternion:an),Gt.copy(jt).applyQuaternion(t==="local"?this.worldQuaternion:an),fe.copy(kt),this.mode){case"translate":case"scale":switch(this.axis){case"X":fe.copy(this.eye).cross(Zt),Ze.copy(Zt).cross(fe);break;case"Y":fe.copy(this.eye).cross(kt),Ze.copy(kt).cross(fe);break;case"Z":fe.copy(this.eye).cross(Gt),Ze.copy(Gt).cross(fe);break;case"XY":Ze.copy(Gt);break;case"YZ":Ze.copy(Zt);break;case"XZ":fe.copy(Gt),Ze.copy(kt);break;case"XYZ":case"E":Ze.set(0,0,0);break}break;default:Ze.set(0,0,0)}Ze.length()===0?this.quaternion.copy(this.cameraQuaternion):(Ts.lookAt(_e.set(0,0,0),Ze,fe),this.quaternion.setFromRotationMatrix(Ts)),super.updateMatrixWorld(e)}}const vs={type:"change"},$n={type:"start"},Mi={type:"end"},ra={type:"endMovement"},$t=new r.Ray,Ms=new r.Plane,aa=Math.cos(70*r.MathUtils.DEG2RAD),xe=new r.Vector3;new r.Vector3;const ke=2*Math.PI,he={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},mt=1e-6;let Aa=class extends r.Controls{constructor(e,t=null){super(e,t),this.state=he.NONE,this.enabled=!0,this.target=new r.Vector3,this.cursor=new r.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:r.MOUSE.ROTATE,MIDDLE:r.MOUSE.DOLLY,RIGHT:r.MOUSE.PAN},this.touches={ONE:r.TOUCH.ROTATE,TWO:r.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new r.Vector3,this._lastQuaternion=new r.Quaternion,this._lastTargetPosition=new r.Vector3,this._quat=new r.Quaternion().setFromUnitVectors(e.up,new r.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new r.Spherical,this._sphericalDelta=new r.Spherical,this._scale=1,this._currentScale=1,this._panOffset=new r.Vector3,this._rotateStart=new r.Vector2,this._rotateEnd=new r.Vector2,this._rotateDelta=new r.Vector2,this._panStart=new r.Vector2,this._panEnd=new r.Vector2,this._panDelta=new r.Vector2,this._dollyStart=new r.Vector2,this._dollyEnd=new r.Vector2,this._dollyDelta=new r.Vector2,this._dollyDirection=new r.Vector3,this._mouse=new r.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._lastIsDamping=!1,this._isDamping=!1,this._onPointerMove=la.bind(this),this._onPointerDown=ca.bind(this),this._onPointerUp=ha.bind(this),this._onContextMenu=ma.bind(this),this._onMouseWheel=ga.bind(this),this._onKeyDown=fa.bind(this),this._onTouchStart=da.bind(this),this._onTouchMove=Ia.bind(this),this._onMouseDown=ua.bind(this),this._onMouseMove=pa.bind(this),this._interceptControlDown=ba.bind(this),this._interceptControlUp=Ea.bind(this),this.domElement!==null&&this.connect(),this.update()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(vs),this.update(),this.state=he.NONE,this._isDamping=!1}update(e=null){if(this.enableDamping&&e===null)return;const t=this.object.getWorldPosition(this.object.position);xe.copy(t).sub(this.target),xe.applyQuaternion(this._quat),this._spherical.setFromVector3(xe),this.autoRotate&&this.state===he.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let s=this.minAzimuthAngle,n=this.maxAzimuthAngle;isFinite(s)&&isFinite(n)&&(s<-Math.PI?s+=ke:s>Math.PI&&(s-=ke),n<-Math.PI?n+=ke:n>Math.PI&&(n-=ke),s<=n?this._spherical.theta=Math.max(s,Math.min(n,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(s+n)/2?Math.max(s,this._spherical.theta):Math.min(n,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.enableDamping?this._currentScale=r.MathUtils.lerp(this._currentScale,this._scale,this.dampingFactor):this._currentScale=this._scale,this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const o=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._currentScale),i=Math.abs(o-this._spherical.radius)>mt*100}if(xe.setFromSpherical(this._spherical),xe.applyQuaternion(this._quatInverse),t.copy(this.target).add(xe),this.object.parent?this.object.parent.worldToLocal(t):this.object.position.copy(t),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let o=null;if(this.object.isPerspectiveCamera){const a=xe.length();o=this._clampDistance(a*this._currentScale);const A=a-o;this.object.position.addScaledVector(this._dollyDirection,A),this.object.updateMatrixWorld(),i=Math.abs(A)>mt}else if(this.object.isOrthographicCamera){const a=new r.Vector3(this._mouse.x,this._mouse.y,0);a.unproject(this.object);const A=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._currentScale)),this.object.updateProjectionMatrix(),i=Math.abs(A-this.object.zoom)>mt;const l=new r.Vector3(this._mouse.x,this._mouse.y,0);l.unproject(this.object),this.object.position.sub(l).add(a),this.object.updateMatrixWorld(),o=xe.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;o!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position):($t.origin.copy(this.object.position),$t.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot($t.direction))<aa?this.object.lookAt(this.target):(Ms.setFromNormalAndCoplanarPoint(this.object.up,this.target),$t.intersectPlane(Ms,this.target))))}else if(this.object.isOrthographicCamera){const o=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),Math.abs(o-this.object.zoom)>mt&&(this.object.updateProjectionMatrix(),i=!0)}return this._scale=1,i||this._lastPosition.distanceToSquared(this.object.position)>mt||8*(1-this._lastQuaternion.dot(this.object.quaternion))>mt||this._lastTargetPosition.distanceToSquared(this.target)>mt?(this.dispatchEvent(vs),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),this._lastIsDamping=!0,this._isDamping=!0,!0):(this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),this.state===he.NONE&&(this._lastIsDamping=this._isDamping,this._isDamping=!1),this._lastIsDamping&&!this._isDamping&&this.state===he.NONE&&(this._isDamping=!1,this._lastIsDamping=!1,this.dispatchEvent(ra)),this._performCursorZoom=!1,!1)}_getAutoRotationAngle(e){return e!==null?ke/60*this.autoRotateSpeed*e:ke/60/60*this.autoRotateSpeed}_getZoomScale(e){const t=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){xe.setFromMatrixColumn(t,0),xe.multiplyScalar(-e),this._panOffset.add(xe)}_panUp(e,t){this.screenSpacePanning===!0?xe.setFromMatrixColumn(t,1):(xe.setFromMatrixColumn(t,0),xe.crossVectors(this.object.up,xe)),xe.multiplyScalar(e),this._panOffset.add(xe)}_pan(e,t){const s=this.domElement;if(this.object.isPerspectiveCamera){this.object.getWorldPosition(xe).sub(this.target);let n=xe.length();n*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*n/s.clientHeight,this.object.matrixWorld),this._panUp(2*t*n/s.clientHeight,this.object.matrixWorld)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/s.clientWidth,this.object.matrixWorld),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/s.clientHeight,this.object.matrixWorld)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const s=this.domElement.getBoundingClientRect(),n=e-s.left,i=t-s.top,o=s.width,a=s.height;this._mouse.x=n/o*2-1,this._mouse.y=-(i/a)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(ke*this._rotateDelta.x/t.clientHeight),this._rotateUp(ke*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this._rotateUp(ke*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this._rotateUp(-ke*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this._rotateLeft(ke*this.rotateSpeed/this.domElement.clientHeight):this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this._rotateLeft(-ke*this.rotateSpeed/this.domElement.clientHeight):this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),s=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this._rotateStart.set(s,n)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),s=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this._panStart.set(s,n)}}_handleTouchStartDolly(e){const t=this._getSecondPointerPosition(e),s=e.pageX-t.x,n=e.pageY-t.y,i=Math.sqrt(s*s+n*n);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const s=this._getSecondPointerPosition(e),n=.5*(e.pageX+s.x),i=.5*(e.pageY+s.y);this._rotateEnd.set(n,i)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(ke*this._rotateDelta.x/t.clientHeight),this._rotateUp(ke*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),s=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this._panEnd.set(s,n)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const t=this._getSecondPointerPosition(e),s=e.pageX-t.x,n=e.pageY-t.y,i=Math.sqrt(s*s+n*n);this._dollyEnd.set(0,i),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const o=(e.pageX+t.x)*.5,a=(e.pageY+t.y)*.5;this._updateZoomParameters(o,a)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new r.Vector2,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){const t=e.deltaMode,s={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:s.deltaY*=16;break;case 2:s.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(s.deltaY*=10),s}};function ca(c){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(c.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),window.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(c)&&(this._addPointer(c),c.pointerType==="touch"?this._onTouchStart(c):this._onMouseDown(c)))}function la(c){this.enabled!==!1&&(c.pointerType==="touch"?this._onTouchMove(c):this._onMouseMove(c))}function ha(c){switch(this._removePointer(c),this._pointers.length){case 0:this.domElement.releasePointerCapture(c.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),window.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(Mi),this.state=he.NONE;break;case 1:const e=this._pointers[0],t=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:t.x,pageY:t.y});break}}function ua(c){let e;switch(c.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case r.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(c),this.state=he.DOLLY;break;case r.MOUSE.ROTATE:if(c.ctrlKey||c.metaKey||c.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(c),this.state=he.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(c),this.state=he.ROTATE}break;case r.MOUSE.PAN:if(c.ctrlKey||c.metaKey||c.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(c),this.state=he.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(c),this.state=he.PAN}break;default:this.state=he.NONE}this.state!==he.NONE&&this.dispatchEvent($n)}function pa(c){switch(this.state){case he.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(c);break;case he.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(c);break;case he.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(c);break}}function ga(c){this.enabled===!1||this.enableZoom===!1||this.state!==he.NONE||(c.preventDefault(),this.dispatchEvent($n),this._handleMouseWheel(this._customWheelEvent(c)),this.dispatchEvent(Mi))}function fa(c){this.enabled===!1||this.enablePan===!1||this._handleKeyDown(c)}function da(c){switch(this._trackPointer(c),this._pointers.length){case 1:switch(this.touches.ONE){case r.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(c),this.state=he.TOUCH_ROTATE;break;case r.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(c),this.state=he.TOUCH_PAN;break;default:this.state=he.NONE}break;case 2:switch(this.touches.TWO){case r.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(c),this.state=he.TOUCH_DOLLY_PAN;break;case r.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(c),this.state=he.TOUCH_DOLLY_ROTATE;break;default:this.state=he.NONE}break;default:this.state=he.NONE}this.state!==he.NONE&&this.dispatchEvent($n)}function Ia(c){switch(this._trackPointer(c),this.state){case he.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(c),this.update();break;case he.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(c),this.update();break;case he.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(c),this.update();break;case he.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(c),this.update();break;default:this.state=he.NONE}}function ma(c){this.enabled!==!1&&c.preventDefault()}function ba(c){c.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Ea(c){c.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}class Ca extends r.Line{constructor(e,t=1,s=16,n=2){const i=new r.BufferGeometry,o=s+n*2,a=new Float32Array((o*3+3)*3);i.setAttribute("position",new r.BufferAttribute(a,3));const A=new r.LineBasicMaterial({color:65280}),l=new r.LineBasicMaterial({color:16776960});super(i,[l,A]),this.audio=e,this.range=t,this.divisionsInnerAngle=s,this.divisionsOuterAngle=n,this.type="PositionalAudioHelper",this.update()}update(){const e=this.audio,t=this.range,s=this.divisionsInnerAngle,n=this.divisionsOuterAngle,i=r.MathUtils.degToRad(e.panner.coneInnerAngle),o=r.MathUtils.degToRad(e.panner.coneOuterAngle),a=i/2,A=o/2;let l=0,h=0,u,g;const f=this.geometry,I=f.attributes.position;f.clearGroups();function m(b,B,w,C){const y=(B-b)/w;for(I.setXYZ(l,0,0,0),h++,u=b;u<B;u+=y)g=l+h,I.setXYZ(g,Math.sin(u)*t,0,Math.cos(u)*t),I.setXYZ(g+1,Math.sin(Math.min(u+y,B))*t,0,Math.cos(Math.min(u+y,B))*t),I.setXYZ(g+2,0,0,0),h+=3;f.addGroup(l,h,C),l+=h,h=0}m(-A,-a,n,0),m(-a,a,s,1),m(a,A,n,0),I.needsUpdate=!0,i===o&&(this.material[0].visible=!1)}dispose(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()}}const Ba={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
|
|
1
|
+
"use strict";const a=require("./three.umd.cjs");class Po extends a.Mesh{constructor(e,t,i,n=128){if(t<=0||i<=0||n<=0)throw new Error("GroundedSkybox height, radius, and resolution must be positive.");const s=new a.SphereGeometry(i,2*n,n);s.scale(1,1,-1);const o=s.getAttribute("position"),r=new a.Vector3;for(let A=0;A<o.count;++A)if(r.fromBufferAttribute(o,A),r.y<0){const l=-t*3/2,h=r.y<l?-t/r.y:1-r.y*r.y/(3*l*l);r.multiplyScalar(h),r.toArray(o.array,3*A)}o.needsUpdate=!0,super(s,new a.MeshBasicMaterial({map:e,depthWrite:!1}))}}function No(c,e=1e-4){e=Math.max(e,Number.EPSILON);const t={},i=c.getIndex(),n=c.getAttribute("position"),s=i?i.count:n.count;let o=0;const r=Object.keys(c.attributes),A={},l={},h=[],p=["getX","getY","getZ","getW"],u=["setX","setY","setZ","setW"];for(let w=0,C=r.length;w<C;w++){const y=r[w],Q=c.attributes[y];A[y]=new Q.constructor(new Q.array.constructor(Q.count*Q.itemSize),Q.itemSize,Q.normalized);const R=c.morphAttributes[y];R&&(l[y]||(l[y]=[]),R.forEach((M,T)=>{const D=new M.array.constructor(M.count*M.itemSize);l[y][T]=new M.constructor(D,M.itemSize,M.normalized)}))}const f=e*.5,b=Math.log10(1/e),m=Math.pow(10,b),E=f*m;for(let w=0;w<s;w++){const C=i?i.getX(w):w;let y="";for(let Q=0,R=r.length;Q<R;Q++){const M=r[Q],T=c.getAttribute(M),D=T.itemSize;for(let G=0;G<D;G++)y+=`${~~(T[p[G]](C)*m+E)},`}if(y in t)h.push(t[y]);else{for(let Q=0,R=r.length;Q<R;Q++){const M=r[Q],T=c.getAttribute(M),D=c.morphAttributes[M],G=T.itemSize,U=A[M],j=l[M];for(let X=0;X<G;X++){const N=p[X],V=u[X];if(U[V](o,T[N](C)),D)for(let H=0,$=D.length;H<$;H++)j[H][V](o,D[H][N](C))}}t[y]=o,h.push(o),o++}}const B=c.clone();for(const w in c.attributes){const C=A[w];if(B.setAttribute(w,new C.constructor(C.array.slice(0,o*C.itemSize),C.itemSize,C.normalized)),w in l)for(let y=0;y<l[w].length;y++){const Q=l[w][y];B.morphAttributes[w][y]=new Q.constructor(Q.array.slice(0,o*Q.itemSize),Q.itemSize,Q.normalized)}}return B.setIndex(h),B}function Ai(c,e){if(e===a.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),c;if(e===a.TriangleFanDrawMode||e===a.TriangleStripDrawMode){let t=c.getIndex();if(t===null){const o=[],r=c.getAttribute("position");if(r!==void 0){for(let A=0;A<r.count;A++)o.push(A);c.setIndex(o),t=c.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),c}const i=t.count-2,n=[];if(e===a.TriangleFanDrawMode)for(let o=1;o<=i;o++)n.push(t.getX(0)),n.push(t.getX(o)),n.push(t.getX(o+1));else for(let o=0;o<i;o++)o%2===0?(n.push(t.getX(o)),n.push(t.getX(o+1)),n.push(t.getX(o+2))):(n.push(t.getX(o+2)),n.push(t.getX(o+1)),n.push(t.getX(o)));n.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=c.clone();return s.setIndex(n),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),c}function Oo(c){const e=new Map,t=new Map,i=c.clone();return Zi(c,i,function(n,s){e.set(s,n),t.set(n,s)}),i.traverse(function(n){if(!n.isSkinnedMesh)return;const s=n,o=e.get(n),r=o.skeleton.bones;s.skeleton=o.skeleton.clone(),s.bindMatrix.copy(o.bindMatrix),s.skeleton.bones=r.map(function(A){return t.get(A)}),s.bind(s.skeleton,s.bindMatrix)}),i}function Zi(c,e,t){t(c,e);for(let i=0;i<c.children.length;i++)Zi(c.children[i],e.children[i],t)}class Kn extends a.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new zo(t)}),this.register(function(t){return new Vo(t)}),this.register(function(t){return new na(t)}),this.register(function(t){return new ia(t)}),this.register(function(t){return new sa(t)}),this.register(function(t){return new Jo(t)}),this.register(function(t){return new Xo(t)}),this.register(function(t){return new Wo(t)}),this.register(function(t){return new Zo(t)}),this.register(function(t){return new Ko(t)}),this.register(function(t){return new $o(t)}),this.register(function(t){return new Yo(t)}),this.register(function(t){return new ta(t)}),this.register(function(t){return new ea(t)}),this.register(function(t){return new jo(t)}),this.register(function(t){return new ci(t,re.EXT_MESHOPT_COMPRESSION)}),this.register(function(t){return new ci(t,re.KHR_MESHOPT_COMPRESSION)}),this.register(function(t){return new oa(t)})}load(e,t,i,n){const s=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const l=a.LoaderUtils.extractUrlBase(e);o=a.LoaderUtils.resolveURL(l,this.path)}else o=a.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);const r=function(l){n?n(l):console.error(l),s.manager.itemError(e),s.manager.itemEnd(e)},A=new a.FileLoader(this.manager);A.setPath(this.path),A.setResponseType("arraybuffer"),A.setRequestHeader(this.requestHeader),A.setWithCredentials(this.withCredentials),A.load(e,function(l){try{s.parse(l,o,function(h){t(h),s.manager.itemEnd(e)},r)}catch(h){r(h)}},i,r)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,i,n){let s,o;const r={},A={},l=new TextDecoder;if(typeof e=="string")try{s=JSON.parse(e)}catch(p){o=e,n&&n(p);return}else if(e instanceof ArrayBuffer)if(l.decode(new Uint8Array(e,0,4))===$i){try{r[re.KHR_BINARY_GLTF]=new aa(e)}catch(u){n&&n(u);return}try{s=JSON.parse(r[re.KHR_BINARY_GLTF].content)}catch(u){o=r[re.KHR_BINARY_GLTF].content,n&&n(u);return}}else try{s=JSON.parse(l.decode(e))}catch(u){o=l.decode(e),n&&n(u);return}else s=e;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}this.json=s,this.jsonErrorData=o;const h=new Ea(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});h.fileLoader.setRequestHeader(this.requestHeader);for(let p=0;p<this.pluginCallbacks.length;p++){const u=this.pluginCallbacks[p](h);u.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),A[u.name]=u,r[u.name]=!0}if(s.extensionsUsed)for(let p=0;p<s.extensionsUsed.length;++p){const u=s.extensionsUsed[p],f=s.extensionsRequired||[];switch(u){case re.KHR_MATERIALS_UNLIT:r[u]=new qo;break;case re.KHR_DRACO_MESH_COMPRESSION:r[u]=new ra(s,this.dracoLoader);break;case re.KHR_TEXTURE_TRANSFORM:r[u]=new Aa;break;case re.KHR_MESH_QUANTIZATION:r[u]=new ca;break;default:f.indexOf(u)>=0&&A[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}h.setExtensions(r),h.setPlugins(A),h.parse(i,n)}parseAsync(e,t){const i=this;return new Promise(function(n,s){i.parse(e,t,n,s)})}}function Ho(){let c={};return{get:function(e){return c[e]},add:function(e,t){c[e]=t},remove:function(e){delete c[e]},removeAll:function(){c={}}}}function Se(c,e,t){const i=c.json.materials[e];return i.extensions&&i.extensions[t]?i.extensions[t]:null}const re={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",KHR_MESHOPT_COMPRESSION:"KHR_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class jo{constructor(e){this.parser=e,this.name=re.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,n=t.length;i<n;i++){const s=t[i];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const t=this.parser,i="light:"+e;let n=t.cache.get(i);if(n)return n;const s=t.json,A=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let l;const h=new a.Color(16777215);A.color!==void 0&&h.setRGB(A.color[0],A.color[1],A.color[2],a.LinearSRGBColorSpace);const p=A.range!==void 0?A.range:0;switch(A.type){case"directional":l=new a.DirectionalLight(h),l.target.position.set(0,0,-1),l.add(l.target);break;case"point":l=new a.PointLight(h),l.distance=p;break;case"spot":l=new a.SpotLight(h),l.distance=p,A.spot=A.spot||{},A.spot.innerConeAngle=A.spot.innerConeAngle!==void 0?A.spot.innerConeAngle:0,A.spot.outerConeAngle=A.spot.outerConeAngle!==void 0?A.spot.outerConeAngle:Math.PI/4,l.angle=A.spot.outerConeAngle,l.penumbra=1-A.spot.innerConeAngle/A.spot.outerConeAngle,l.target.position.set(0,0,-1),l.add(l.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+A.type)}return l.position.set(0,0,0),nt(l,A),A.intensity!==void 0&&(l.intensity=A.intensity),l.name=t.createUniqueName(A.name||"light_"+e),n=Promise.resolve(l),t.cache.add(i,n),n}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,i=this.parser,s=i.json.nodes[e],r=(s.extensions&&s.extensions[this.name]||{}).light;return r===void 0?null:this._loadLight(r).then(function(A){return i._getNodeRef(t.cache,r,A)})}}let qo=class{constructor(){this.name=re.KHR_MATERIALS_UNLIT}getMaterialType(){return a.MeshBasicMaterial}extendParams(e,t,i){const n=[];e.color=new a.Color(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const o=s.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],a.LinearSRGBColorSpace),e.opacity=o[3]}s.baseColorTexture!==void 0&&n.push(i.assignTexture(e,"map",s.baseColorTexture,a.SRGBColorSpace))}return Promise.all(n)}},Ko=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const i=Se(this.parser,e,this.name);return i===null||i.emissiveStrength!==void 0&&(t.emissiveIntensity=i.emissiveStrength),Promise.resolve()}},zo=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){return Se(this.parser,e,this.name)!==null?a.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const i=Se(this.parser,e,this.name);if(i===null)return Promise.resolve();const n=[];if(i.clearcoatFactor!==void 0&&(t.clearcoat=i.clearcoatFactor),i.clearcoatTexture!==void 0&&n.push(this.parser.assignTexture(t,"clearcoatMap",i.clearcoatTexture)),i.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=i.clearcoatRoughnessFactor),i.clearcoatRoughnessTexture!==void 0&&n.push(this.parser.assignTexture(t,"clearcoatRoughnessMap",i.clearcoatRoughnessTexture)),i.clearcoatNormalTexture!==void 0&&(n.push(this.parser.assignTexture(t,"clearcoatNormalMap",i.clearcoatNormalTexture)),i.clearcoatNormalTexture.scale!==void 0)){const s=i.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new a.Vector2(s,s)}return Promise.all(n)}},Vo=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_DISPERSION}getMaterialType(e){return Se(this.parser,e,this.name)!==null?a.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const i=Se(this.parser,e,this.name);return i===null||(t.dispersion=i.dispersion!==void 0?i.dispersion:0),Promise.resolve()}},Yo=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){return Se(this.parser,e,this.name)!==null?a.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const i=Se(this.parser,e,this.name);if(i===null)return Promise.resolve();const n=[];return i.iridescenceFactor!==void 0&&(t.iridescence=i.iridescenceFactor),i.iridescenceTexture!==void 0&&n.push(this.parser.assignTexture(t,"iridescenceMap",i.iridescenceTexture)),i.iridescenceIor!==void 0&&(t.iridescenceIOR=i.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),i.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=i.iridescenceThicknessMinimum),i.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=i.iridescenceThicknessMaximum),i.iridescenceThicknessTexture!==void 0&&n.push(this.parser.assignTexture(t,"iridescenceThicknessMap",i.iridescenceThicknessTexture)),Promise.all(n)}},Jo=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_SHEEN}getMaterialType(e){return Se(this.parser,e,this.name)!==null?a.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const i=Se(this.parser,e,this.name);if(i===null)return Promise.resolve();const n=[];if(t.sheenColor=new a.Color(0,0,0),t.sheenRoughness=0,t.sheen=1,i.sheenColorFactor!==void 0){const s=i.sheenColorFactor;t.sheenColor.setRGB(s[0],s[1],s[2],a.LinearSRGBColorSpace)}return i.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=i.sheenRoughnessFactor),i.sheenColorTexture!==void 0&&n.push(this.parser.assignTexture(t,"sheenColorMap",i.sheenColorTexture,a.SRGBColorSpace)),i.sheenRoughnessTexture!==void 0&&n.push(this.parser.assignTexture(t,"sheenRoughnessMap",i.sheenRoughnessTexture)),Promise.all(n)}},Xo=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){return Se(this.parser,e,this.name)!==null?a.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const i=Se(this.parser,e,this.name);if(i===null)return Promise.resolve();const n=[];return i.transmissionFactor!==void 0&&(t.transmission=i.transmissionFactor),i.transmissionTexture!==void 0&&n.push(this.parser.assignTexture(t,"transmissionMap",i.transmissionTexture)),Promise.all(n)}},Wo=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_VOLUME}getMaterialType(e){return Se(this.parser,e,this.name)!==null?a.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const i=Se(this.parser,e,this.name);if(i===null)return Promise.resolve();const n=[];t.thickness=i.thicknessFactor!==void 0?i.thicknessFactor:0,i.thicknessTexture!==void 0&&n.push(this.parser.assignTexture(t,"thicknessMap",i.thicknessTexture)),t.attenuationDistance=i.attenuationDistance||1/0;const s=i.attenuationColor||[1,1,1];return t.attenuationColor=new a.Color().setRGB(s[0],s[1],s[2],a.LinearSRGBColorSpace),Promise.all(n)}},Zo=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_IOR}getMaterialType(e){return Se(this.parser,e,this.name)!==null?a.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const i=Se(this.parser,e,this.name);return i===null||(t.ior=i.ior!==void 0?i.ior:1.5),Promise.resolve()}},$o=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_SPECULAR}getMaterialType(e){return Se(this.parser,e,this.name)!==null?a.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const i=Se(this.parser,e,this.name);if(i===null)return Promise.resolve();const n=[];t.specularIntensity=i.specularFactor!==void 0?i.specularFactor:1,i.specularTexture!==void 0&&n.push(this.parser.assignTexture(t,"specularIntensityMap",i.specularTexture));const s=i.specularColorFactor||[1,1,1];return t.specularColor=new a.Color().setRGB(s[0],s[1],s[2],a.LinearSRGBColorSpace),i.specularColorTexture!==void 0&&n.push(this.parser.assignTexture(t,"specularColorMap",i.specularColorTexture,a.SRGBColorSpace)),Promise.all(n)}},ea=class{constructor(e){this.parser=e,this.name=re.EXT_MATERIALS_BUMP}getMaterialType(e){return Se(this.parser,e,this.name)!==null?a.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const i=Se(this.parser,e,this.name);if(i===null)return Promise.resolve();const n=[];return t.bumpScale=i.bumpFactor!==void 0?i.bumpFactor:1,i.bumpTexture!==void 0&&n.push(this.parser.assignTexture(t,"bumpMap",i.bumpTexture)),Promise.all(n)}},ta=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){return Se(this.parser,e,this.name)!==null?a.MeshPhysicalMaterial:null}extendMaterialParams(e,t){const i=Se(this.parser,e,this.name);if(i===null)return Promise.resolve();const n=[];return i.anisotropyStrength!==void 0&&(t.anisotropy=i.anisotropyStrength),i.anisotropyRotation!==void 0&&(t.anisotropyRotation=i.anisotropyRotation),i.anisotropyTexture!==void 0&&n.push(this.parser.assignTexture(t,"anisotropyMap",i.anisotropyTexture)),Promise.all(n)}};class na{constructor(e){this.parser=e,this.name=re.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,i=t.json,n=i.textures[e];if(!n.extensions||!n.extensions[this.name])return null;const s=n.extensions[this.name],o=t.options.ktx2Loader;if(!o){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 t.loadTextureImage(e,s.source,o)}}class ia{constructor(e){this.parser=e,this.name=re.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,i=this.parser,n=i.json,s=n.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],r=n.images[o.source];let A=i.textureLoader;if(r.uri){const l=i.options.manager.getHandler(r.uri);l!==null&&(A=l)}return i.loadTextureImage(e,o.source,A)}}class sa{constructor(e){this.parser=e,this.name=re.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,i=this.parser,n=i.json,s=n.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],r=n.images[o.source];let A=i.textureLoader;if(r.uri){const l=i.options.manager.getHandler(r.uri);l!==null&&(A=l)}return i.loadTextureImage(e,o.source,A)}}class ci{constructor(e,t){this.name=t,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const n=i.extensions[this.name],s=this.parser.getDependency("buffer",n.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(r){const A=n.byteOffset||0,l=n.byteLength||0,h=n.count,p=n.byteStride,u=new Uint8Array(r,A,l);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(h,p,u,n.mode,n.filter).then(function(f){return f.buffer}):o.ready.then(function(){const f=new ArrayBuffer(h*p);return o.decodeGltfBuffer(new Uint8Array(f),h,p,u,n.mode,n.filter),f})})}else return null}}let oa=class{constructor(e){this.name=re.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const n=t.meshes[i.mesh];for(const l of n.primitives)if(l.mode!==Je.TRIANGLES&&l.mode!==Je.TRIANGLE_STRIP&&l.mode!==Je.TRIANGLE_FAN&&l.mode!==void 0)return null;const o=i.extensions[this.name].attributes,r=[],A={};for(const l in o)r.push(this.parser.getDependency("accessor",o[l]).then(h=>(A[l]=h,A[l])));return r.length<1?null:(r.push(this.parser.createNodeMesh(e)),Promise.all(r).then(l=>{const h=l.pop(),p=h.isGroup?h.children:[h],u=l[0].count,f=[];for(const b of p){const m=new a.Matrix4,E=new a.Vector3,B=new a.Quaternion,w=new a.Vector3(1,1,1),C=new a.InstancedMesh(b.geometry,b.material,u);for(let y=0;y<u;y++)A.TRANSLATION&&E.fromBufferAttribute(A.TRANSLATION,y),A.ROTATION&&B.fromBufferAttribute(A.ROTATION,y),A.SCALE&&w.fromBufferAttribute(A.SCALE,y),C.setMatrixAt(y,m.compose(E,B,w));for(const y in A)if(y==="_COLOR_0"){const Q=A[y];C.instanceColor=new a.InstancedBufferAttribute(Q.array,Q.itemSize,Q.normalized)}else y!=="TRANSLATION"&&y!=="ROTATION"&&y!=="SCALE"&&b.geometry.setAttribute(y,A[y]);a.Object3D.prototype.copy.call(C,b),this.parser.assignFinalMaterial(C),f.push(C)}return h.isGroup?(h.clear(),h.add(...f),h):f[0]}))}};const $i="glTF",Ft=12,li={JSON:1313821514,BIN:5130562};class aa{constructor(e){this.name=re.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Ft),i=new TextDecoder;if(this.header={magic:i.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==$i)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-Ft,s=new DataView(e,Ft);let o=0;for(;o<n;){const r=s.getUint32(o,!0);o+=4;const A=s.getUint32(o,!0);if(o+=4,A===li.JSON){const l=new Uint8Array(e,Ft+o,r);this.content=i.decode(l)}else if(A===li.BIN){const l=Ft+o;this.body=e.slice(l,l+r)}o+=r}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class ra{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=re.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const i=this.json,n=this.dracoLoader,s=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,r={},A={},l={};for(const h in o){const p=kn[h]||h.toLowerCase();r[p]=o[h]}for(const h in e.attributes){const p=kn[h]||h.toLowerCase();if(o[h]!==void 0){const u=i.accessors[e.attributes[h]],f=Dt[u.componentType];l[p]=f.name,A[p]=u.normalized===!0}}return t.getDependency("bufferView",s).then(function(h){return new Promise(function(p,u){n.decodeDracoFile(h,function(f){for(const b in f.attributes){const m=f.attributes[b],E=A[b];E!==void 0&&(m.normalized=E)}p(f)},r,l,a.LinearSRGBColorSpace,u)})})}}class Aa{constructor(){this.name=re.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class ca{constructor(){this.name=re.KHR_MESH_QUANTIZATION}}class es extends a.Interpolant{constructor(e,t,i,n){super(e,t,i,n)}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,n=this.valueSize,s=e*n*3+n;for(let o=0;o!==n;o++)t[o]=i[s+o];return t}interpolate_(e,t,i,n){const s=this.resultBuffer,o=this.sampleValues,r=this.valueSize,A=r*2,l=r*3,h=n-t,p=(i-t)/h,u=p*p,f=u*p,b=e*l,m=b-l,E=-2*f+3*u,B=f-u,w=1-E,C=B-u+p;for(let y=0;y!==r;y++){const Q=o[m+y+r],R=o[m+y+A]*h,M=o[b+y+r],T=o[b+y]*h;s[y]=w*Q+C*R+E*M+B*T}return s}}const la=new a.Quaternion;class ha extends es{interpolate_(e,t,i,n){const s=super.interpolate_(e,t,i,n);return la.fromArray(s).normalize().toArray(s),s}}const Je={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},Dt={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},hi={9728:a.NearestFilter,9729:a.LinearFilter,9984:a.NearestMipmapNearestFilter,9985:a.LinearMipmapNearestFilter,9986:a.NearestMipmapLinearFilter,9987:a.LinearMipmapLinearFilter},pi={33071:a.ClampToEdgeWrapping,33648:a.MirroredRepeatWrapping,10497:a.RepeatWrapping},pn={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},kn={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"},gt={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},pa={CUBICSPLINE:void 0,LINEAR:a.InterpolateLinear,STEP:a.InterpolateDiscrete},gn={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function ga(c){return c.DefaultMaterial===void 0&&(c.DefaultMaterial=new a.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:a.FrontSide})),c.DefaultMaterial}function Et(c,e,t){for(const i in t.extensions)c[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function nt(c,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(c.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function ua(c,e,t){let i=!1,n=!1,s=!1;for(let l=0,h=e.length;l<h;l++){const p=e[l];if(p.POSITION!==void 0&&(i=!0),p.NORMAL!==void 0&&(n=!0),p.COLOR_0!==void 0&&(s=!0),i&&n&&s)break}if(!i&&!n&&!s)return Promise.resolve(c);const o=[],r=[],A=[];for(let l=0,h=e.length;l<h;l++){const p=e[l];if(i){const u=p.POSITION!==void 0?t.getDependency("accessor",p.POSITION):c.attributes.position;o.push(u)}if(n){const u=p.NORMAL!==void 0?t.getDependency("accessor",p.NORMAL):c.attributes.normal;r.push(u)}if(s){const u=p.COLOR_0!==void 0?t.getDependency("accessor",p.COLOR_0):c.attributes.color;A.push(u)}}return Promise.all([Promise.all(o),Promise.all(r),Promise.all(A)]).then(function(l){const h=l[0],p=l[1],u=l[2];return i&&(c.morphAttributes.position=h),n&&(c.morphAttributes.normal=p),s&&(c.morphAttributes.color=u),c.morphTargetsRelative=!0,c})}function fa(c,e){if(c.updateMorphTargets(),e.weights!==void 0)for(let t=0,i=e.weights.length;t<i;t++)c.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(c.morphTargetInfluences.length===t.length){c.morphTargetDictionary={};for(let i=0,n=t.length;i<n;i++)c.morphTargetDictionary[t[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function da(c){let e;const t=c.extensions&&c.extensions[re.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+un(t.attributes):e=c.indices+":"+un(c.attributes)+":"+c.mode,c.targets!==void 0)for(let i=0,n=c.targets.length;i<n;i++)e+=":"+un(c.targets[i]);return e}function un(c){let e="";const t=Object.keys(c).sort();for(let i=0,n=t.length;i<n;i++)e+=t[i]+":"+c[t[i]]+";";return e}function Ln(c){switch(c){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 ba(c){return c.search(/\.jpe?g($|\?)/i)>0||c.search(/^data\:image\/jpeg/)===0?"image/jpeg":c.search(/\.webp($|\?)/i)>0||c.search(/^data\:image\/webp/)===0?"image/webp":c.search(/\.ktx2($|\?)/i)>0||c.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const ma=new a.Matrix4;class Ea{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Ho,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,o=-1;if(typeof navigator<"u"&&typeof navigator.userAgent<"u"){const r=navigator.userAgent;i=/^((?!chrome|android).)*safari/i.test(r)===!0;const A=r.match(/Version\/(\d+)/);n=i&&A?parseInt(A[1],10):-1,s=r.indexOf("Firefox")>-1,o=s?r.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&n<17||s&&o<98?this.textureLoader=new a.TextureLoader(this.options.manager):this.textureLoader=new a.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new a.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,n=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const r={scene:o[0][n.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:n.asset,parser:i,userData:{}};return Et(s,r,n),nt(r,n),Promise.all(i._invokeAll(function(A){return A.afterRoot&&A.afterRoot(r)})).then(function(){for(const A of r.scenes)A.updateMatrixWorld();e(r)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let n=0,s=t.length;n<s;n++){const o=t[n].joints;for(let r=0,A=o.length;r<A;r++)e[o[r]].isBone=!0}for(let n=0,s=e.length;n<s;n++){const o=e[n];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(i[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,i){if(e.refs[t]<=1)return i;const n=i.clone(),s=(o,r)=>{const A=this.associations.get(o);A!=null&&this.associations.set(r,A);for(const[l,h]of o.children.entries())s(h,r.children[l])};return s(i,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){const n=e(t[i]);if(n)return n}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const i=[];for(let n=0;n<t.length;n++){const s=e(t[n]);s&&i.push(s)}return i}getDependency(e,t){const i=e+":"+t;let n=this.cache.get(i);if(!n){switch(e){case"scene":n=this.loadScene(t);break;case"node":n=this._invokeOne(function(s){return s.loadNode&&s.loadNode(t)});break;case"mesh":n=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":n=this.loadAccessor(t);break;case"bufferView":n=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":n=this.loadBuffer(t);break;case"material":n=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":n=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":n=this.loadSkin(t);break;case"animation":n=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(t)});break;case"camera":n=this.loadCamera(t);break;default:if(n=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(e,t)}),!n)throw new Error("Unknown type: "+e);break}this.cache.add(i,n)}return n}getDependencies(e){let t=this.cache.get(e);if(!t){const i=this,n=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(n.map(function(s,o){return i.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],i=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[re.KHR_BINARY_GLTF].body);const n=this.options;return new Promise(function(s,o){i.load(a.LoaderUtils.resolveURL(t.uri,n.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(i){const n=t.byteLength||0,s=t.byteOffset||0;return i.slice(s,s+n)})}loadAccessor(e){const t=this,i=this.json,n=this.json.accessors[e];if(n.bufferView===void 0&&n.sparse===void 0){const o=pn[n.type],r=Dt[n.componentType],A=n.normalized===!0,l=new r(n.count*o);return Promise.resolve(new a.BufferAttribute(l,o,A))}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(o){const r=o[0],A=pn[n.type],l=Dt[n.componentType],h=l.BYTES_PER_ELEMENT,p=h*A,u=n.byteOffset||0,f=n.bufferView!==void 0?i.bufferViews[n.bufferView].byteStride:void 0,b=n.normalized===!0;let m,E;if(f&&f!==p){const B=Math.floor(u/f),w="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+B+":"+n.count;let C=t.cache.get(w);C||(m=new l(r,B*f,n.count*f/h),C=new a.InterleavedBuffer(m,f/h),t.cache.add(w,C)),E=new a.InterleavedBufferAttribute(C,A,u%f/h,b)}else r===null?m=new l(n.count*A):m=new l(r,u,n.count*A),E=new a.BufferAttribute(m,A,b);if(n.sparse!==void 0){const B=pn.SCALAR,w=Dt[n.sparse.indices.componentType],C=n.sparse.indices.byteOffset||0,y=n.sparse.values.byteOffset||0,Q=new w(o[1],C,n.sparse.count*B),R=new l(o[2],y,n.sparse.count*A);r!==null&&(E=new a.BufferAttribute(E.array.slice(),E.itemSize,E.normalized)),E.normalized=!1;for(let M=0,T=Q.length;M<T;M++){const D=Q[M];if(E.setX(D,R[M*A]),A>=2&&E.setY(D,R[M*A+1]),A>=3&&E.setZ(D,R[M*A+2]),A>=4&&E.setW(D,R[M*A+3]),A>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}E.normalized=b}return E})}loadTexture(e){const t=this.json,i=this.options,s=t.textures[e].source,o=t.images[s];let r=this.textureLoader;if(o.uri){const A=i.manager.getHandler(o.uri);A!==null&&(r=A)}return this.loadTextureImage(e,s,r)}loadTextureImage(e,t,i){const n=this,s=this.json,o=s.textures[e],r=s.images[t],A=(r.uri||r.bufferView)+":"+o.sampler;if(this.textureCache[A])return this.textureCache[A];const l=this.loadImageSource(t,i).then(function(h){h.flipY=!1,h.name=o.name||r.name||"",h.name===""&&typeof r.uri=="string"&&r.uri.startsWith("data:image/")===!1&&(h.name=r.uri);const u=(s.samplers||{})[o.sampler]||{};return h.magFilter=hi[u.magFilter]||a.LinearFilter,h.minFilter=hi[u.minFilter]||a.LinearMipmapLinearFilter,h.wrapS=pi[u.wrapS]||a.RepeatWrapping,h.wrapT=pi[u.wrapT]||a.RepeatWrapping,h.generateMipmaps=!h.isCompressedTexture&&h.minFilter!==a.NearestFilter&&h.minFilter!==a.LinearFilter,h.anisotropy=4,n.associations.set(h,{textures:e}),h}).catch(function(){return null});return this.textureCache[A]=l,l}loadImageSource(e,t){const i=this,n=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(p=>p.clone());const o=n.images[e],r=self.URL||self.webkitURL;let A=o.uri||"",l=!1;if(o.bufferView!==void 0)A=i.getDependency("bufferView",o.bufferView).then(function(p){l=!0;const u=new Blob([p],{type:o.mimeType});return A=r.createObjectURL(u),A});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const h=Promise.resolve(A).then(function(p){return new Promise(function(u,f){let b=u;t.isImageBitmapLoader===!0&&(b=function(m){const E=new a.Texture(m);E.needsUpdate=!0,u(E)}),t.load(a.LoaderUtils.resolveURL(p,s.path),b,void 0,f)})}).then(function(p){return l===!0&&r.revokeObjectURL(A),nt(p,o),p.userData.mimeType=o.mimeType||ba(o.uri),p}).catch(function(p){throw console.error("THREE.GLTFLoader: Couldn't load texture",A),p});return this.sourceCache[e]=h,h}assignTexture(e,t,i,n){const s=this;return this.getDependency("texture",i.index).then(function(o){if(!o)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(o=o.clone(),o.channel=i.texCoord),s.extensions[re.KHR_TEXTURE_TRANSFORM]){const r=i.extensions!==void 0?i.extensions[re.KHR_TEXTURE_TRANSFORM]:void 0;if(r){const A=s.associations.get(o);o=s.extensions[re.KHR_TEXTURE_TRANSFORM].extendTexture(o,r),s.associations.set(o,A)}}return n!==void 0&&(o.colorSpace=n),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const n=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const r="PointsMaterial:"+i.uuid;let A=this.cache.get(r);A||(A=new a.PointsMaterial,a.Material.prototype.copy.call(A,i),A.color.copy(i.color),A.map=i.map,A.sizeAttenuation=!1,this.cache.add(r,A)),i=A}else if(e.isLine){const r="LineBasicMaterial:"+i.uuid;let A=this.cache.get(r);A||(A=new a.LineBasicMaterial,a.Material.prototype.copy.call(A,i),A.color.copy(i.color),A.map=i.map,this.cache.add(r,A)),i=A}if(n||s||o){let r="ClonedMaterial:"+i.uuid+":";n&&(r+="derivative-tangents:"),s&&(r+="vertex-colors:"),o&&(r+="flat-shading:");let A=this.cache.get(r);A||(A=i.clone(),s&&(A.vertexColors=!0),o&&(A.flatShading=!0),n&&(A.normalScale&&(A.normalScale.y*=-1),A.clearcoatNormalScale&&(A.clearcoatNormalScale.y*=-1)),this.cache.add(r,A),this.associations.set(A,this.associations.get(i))),i=A}e.material=i}getMaterialType(){return a.MeshStandardMaterial}loadMaterial(e){const t=this,i=this.json,n=this.extensions,s=i.materials[e];let o;const r={},A=s.extensions||{},l=[];if(A[re.KHR_MATERIALS_UNLIT]){const p=n[re.KHR_MATERIALS_UNLIT];o=p.getMaterialType(),l.push(p.extendParams(r,s,t))}else{const p=s.pbrMetallicRoughness||{};if(r.color=new a.Color(1,1,1),r.opacity=1,Array.isArray(p.baseColorFactor)){const u=p.baseColorFactor;r.color.setRGB(u[0],u[1],u[2],a.LinearSRGBColorSpace),r.opacity=u[3]}p.baseColorTexture!==void 0&&l.push(t.assignTexture(r,"map",p.baseColorTexture,a.SRGBColorSpace)),r.metalness=p.metallicFactor!==void 0?p.metallicFactor:1,r.roughness=p.roughnessFactor!==void 0?p.roughnessFactor:1,p.metallicRoughnessTexture!==void 0&&(l.push(t.assignTexture(r,"metalnessMap",p.metallicRoughnessTexture)),l.push(t.assignTexture(r,"roughnessMap",p.metallicRoughnessTexture))),o=this._invokeOne(function(u){return u.getMaterialType&&u.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(u){return u.extendMaterialParams&&u.extendMaterialParams(e,r)})))}s.doubleSided===!0&&(r.side=a.DoubleSide);const h=s.alphaMode||gn.OPAQUE;if(h===gn.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,h===gn.MASK&&(r.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==a.MeshBasicMaterial&&(l.push(t.assignTexture(r,"normalMap",s.normalTexture)),r.normalScale=new a.Vector2(1,1),s.normalTexture.scale!==void 0)){const p=s.normalTexture.scale;r.normalScale.set(p,p)}if(s.occlusionTexture!==void 0&&o!==a.MeshBasicMaterial&&(l.push(t.assignTexture(r,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(r.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==a.MeshBasicMaterial){const p=s.emissiveFactor;r.emissive=new a.Color().setRGB(p[0],p[1],p[2],a.LinearSRGBColorSpace)}return s.emissiveTexture!==void 0&&o!==a.MeshBasicMaterial&&l.push(t.assignTexture(r,"emissiveMap",s.emissiveTexture,a.SRGBColorSpace)),Promise.all(l).then(function(){const p=new o(r);return s.name&&(p.name=s.name),nt(p,s),t.associations.set(p,{materials:e}),s.extensions&&Et(n,p,s),p})}createUniqueName(e){const t=a.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,n=this.primitiveCache;function s(r){return i[re.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(r,t).then(function(A){return gi(A,r,t)})}const o=[];for(let r=0,A=e.length;r<A;r++){const l=e[r],h=da(l),p=n[h];if(p)o.push(p.promise);else{let u;l.extensions&&l.extensions[re.KHR_DRACO_MESH_COMPRESSION]?u=s(l):u=gi(new a.BufferGeometry,l,t),n[h]={primitive:l,promise:u},o.push(u)}}return Promise.all(o)}loadMesh(e){const t=this,i=this.json,n=this.extensions,s=i.meshes[e],o=s.primitives,r=[];for(let A=0,l=o.length;A<l;A++){const h=o[A].material===void 0?ga(this.cache):this.getDependency("material",o[A].material);r.push(h)}return r.push(t.loadGeometries(o)),Promise.all(r).then(function(A){const l=A.slice(0,A.length-1),h=A[A.length-1],p=[];for(let f=0,b=h.length;f<b;f++){const m=h[f],E=o[f];let B;const w=l[f];if(E.mode===Je.TRIANGLES||E.mode===Je.TRIANGLE_STRIP||E.mode===Je.TRIANGLE_FAN||E.mode===void 0)B=s.isSkinnedMesh===!0?new a.SkinnedMesh(m,w):new a.Mesh(m,w),B.isSkinnedMesh===!0&&B.normalizeSkinWeights(),E.mode===Je.TRIANGLE_STRIP?B.geometry=Ai(B.geometry,a.TriangleStripDrawMode):E.mode===Je.TRIANGLE_FAN&&(B.geometry=Ai(B.geometry,a.TriangleFanDrawMode));else if(E.mode===Je.LINES)B=new a.LineSegments(m,w);else if(E.mode===Je.LINE_STRIP)B=new a.Line(m,w);else if(E.mode===Je.LINE_LOOP)B=new a.LineLoop(m,w);else if(E.mode===Je.POINTS)B=new a.Points(m,w);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+E.mode);Object.keys(B.geometry.morphAttributes).length>0&&fa(B,s),B.name=t.createUniqueName(s.name||"mesh_"+e),nt(B,s),E.extensions&&Et(n,B,E),t.assignFinalMaterial(B),p.push(B)}for(let f=0,b=p.length;f<b;f++)t.associations.set(p[f],{meshes:e,primitives:f});if(p.length===1)return s.extensions&&Et(n,p[0],s),p[0];const u=new a.Group;s.extensions&&Et(n,u,s),t.associations.set(u,{meshes:e});for(let f=0,b=p.length;f<b;f++)u.add(p[f]);return u})}loadCamera(e){let t;const i=this.json.cameras[e],n=i[i.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?t=new a.PerspectiveCamera(a.MathUtils.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):i.type==="orthographic"&&(t=new a.OrthographicCamera(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),nt(t,i),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],i=[];for(let n=0,s=t.joints.length;n<s;n++)i.push(this._loadNodeShallow(t.joints[n]));return t.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",t.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(n){const s=n.pop(),o=n,r=[],A=[];for(let l=0,h=o.length;l<h;l++){const p=o[l];if(p){r.push(p);const u=new a.Matrix4;s!==null&&u.fromArray(s.array,l*16),A.push(u)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[l])}return new a.Skeleton(r,A)})}loadAnimation(e){const t=this.json,i=this,n=t.animations[e],s=n.name?n.name:"animation_"+e,o=[],r=[],A=[],l=[],h=[];let p=0,u=n.channels.length;for(p=0,u=n.channels.length;p<u;p++){const f=n.channels[p],b=n.samplers[f.sampler],m=f.target,E=m.node,B=n.parameters!==void 0?n.parameters[b.input]:b.input,w=n.parameters!==void 0?n.parameters[b.output]:b.output;m.node!==void 0&&(o.push(this.getDependency("node",E)),r.push(this.getDependency("accessor",B)),A.push(this.getDependency("accessor",w)),l.push(b),h.push(m))}return Promise.all([Promise.all(o),Promise.all(r),Promise.all(A),Promise.all(l),Promise.all(h)]).then(function(f){const b=f[0],m=f[1],E=f[2],B=f[3],w=f[4],C=[];for(p=0,u=b.length;p<u;p++){const Q=b[p],R=m[p],M=E[p],T=B[p],D=w[p];if(Q===void 0)continue;Q.updateMatrix&&Q.updateMatrix();const G=i._createAnimationTracks(Q,R,M,T,D);if(G)for(let U=0;U<G.length;U++)C.push(G[U])}const y=new a.AnimationClip(s,void 0,C);return nt(y,n),y})}createNodeMesh(e){const t=this.json,i=this,n=t.nodes[e];return n.mesh===void 0?null:i.getDependency("mesh",n.mesh).then(function(s){const o=i._getNodeRef(i.meshCache,n.mesh,s);return n.weights!==void 0&&o.traverse(function(r){if(r.isMesh)for(let A=0,l=n.weights.length;A<l;A++)r.morphTargetInfluences[A]=n.weights[A]}),o})}loadNode(e){const t=this.json,i=this,n=t.nodes[e],s=i._loadNodeShallow(e),o=[],r=n.children||[];for(let l=0,h=r.length;l<h;l++)o.push(i.getDependency("node",r[l]));const A=n.skin===void 0?Promise.resolve(null):i.getDependency("skin",n.skin);return Promise.all([s,Promise.all(o),A]).then(function(l){const h=l[0],p=l[1],u=l[2];u!==null&&h.traverse(function(f){f.isSkinnedMesh&&f.bind(u,ma)});for(let f=0,b=p.length;f<b;f++)h.add(p[f]);if(h.userData.pivot!==void 0&&p.length>0){const f=h.userData.pivot,b=p[0];h.pivot=new a.Vector3().fromArray(f),h.position.x-=f[0],h.position.y-=f[1],h.position.z-=f[2],b.position.set(0,0,0),delete h.userData.pivot}return h})}_loadNodeShallow(e){const t=this.json,i=this.extensions,n=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const s=t.nodes[e],o=s.name?n.createUniqueName(s.name):"",r=[],A=n._invokeOne(function(l){return l.createNodeMesh&&l.createNodeMesh(e)});return A&&r.push(A),s.camera!==void 0&&r.push(n.getDependency("camera",s.camera).then(function(l){return n._getNodeRef(n.cameraCache,s.camera,l)})),n._invokeAll(function(l){return l.createNodeAttachment&&l.createNodeAttachment(e)}).forEach(function(l){r.push(l)}),this.nodeCache[e]=Promise.all(r).then(function(l){let h;if(s.isBone===!0?h=new a.Bone:l.length>1?h=new a.Group:l.length===1?h=l[0]:h=new a.Object3D,h!==l[0])for(let p=0,u=l.length;p<u;p++)h.add(l[p]);if(s.name&&(h.userData.name=s.name,h.name=o),nt(h,s),s.extensions&&Et(i,h,s),s.matrix!==void 0){const p=new a.Matrix4;p.fromArray(s.matrix),h.applyMatrix4(p)}else s.translation!==void 0&&h.position.fromArray(s.translation),s.rotation!==void 0&&h.quaternion.fromArray(s.rotation),s.scale!==void 0&&h.scale.fromArray(s.scale);if(!n.associations.has(h))n.associations.set(h,{});else if(s.mesh!==void 0&&n.meshCache.refs[s.mesh]>1){const p=n.associations.get(h);n.associations.set(h,{...p})}return n.associations.get(h).nodes=e,h}),this.nodeCache[e]}loadScene(e){const t=this.extensions,i=this.json.scenes[e],n=this,s=new a.Group;i.name&&(s.name=n.createUniqueName(i.name)),nt(s,i),i.extensions&&Et(t,s,i);const o=i.nodes||[],r=[];for(let A=0,l=o.length;A<l;A++)r.push(n.getDependency("node",o[A]));return Promise.all(r).then(function(A){for(let h=0,p=A.length;h<p;h++){const u=A[h];u.parent!==null?s.add(Oo(u)):s.add(u)}const l=h=>{const p=new Map;for(const[u,f]of n.associations)(u instanceof a.Material||u instanceof a.Texture)&&p.set(u,f);return h.traverse(u=>{const f=n.associations.get(u);f!=null&&p.set(u,f)}),p};return n.associations=l(s),s})}_createAnimationTracks(e,t,i,n,s){const o=[],r=e.name?e.name:e.uuid,A=[];gt[s.path]===gt.weights?e.traverse(function(u){u.morphTargetInfluences&&A.push(u.name?u.name:u.uuid)}):A.push(r);let l;switch(gt[s.path]){case gt.weights:l=a.NumberKeyframeTrack;break;case gt.rotation:l=a.QuaternionKeyframeTrack;break;case gt.translation:case gt.scale:l=a.VectorKeyframeTrack;break;default:i.itemSize===1?l=a.NumberKeyframeTrack:l=a.VectorKeyframeTrack;break}const h=n.interpolation!==void 0?pa[n.interpolation]:a.InterpolateLinear,p=this._getArrayFromAccessor(i);for(let u=0,f=A.length;u<f;u++){const b=new l(A[u]+"."+gt[s.path],t.array,p,h);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(b),o.push(b)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const i=Ln(t.constructor),n=new Float32Array(t.length);for(let s=0,o=t.length;s<o;s++)n[s]=t[s]*i;t=n}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(i){const n=this instanceof a.QuaternionKeyframeTrack?ha:es;return new n(this.times,this.values,this.getValueSize()/3,i)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function Ia(c,e,t){const i=e.attributes,n=new a.Box3;if(i.POSITION!==void 0){const r=t.json.accessors[i.POSITION],A=r.min,l=r.max;if(A!==void 0&&l!==void 0){if(n.set(new a.Vector3(A[0],A[1],A[2]),new a.Vector3(l[0],l[1],l[2])),r.normalized){const h=Ln(Dt[r.componentType]);n.min.multiplyScalar(h),n.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const r=new a.Vector3,A=new a.Vector3;for(let l=0,h=s.length;l<h;l++){const p=s[l];if(p.POSITION!==void 0){const u=t.json.accessors[p.POSITION],f=u.min,b=u.max;if(f!==void 0&&b!==void 0){if(A.setX(Math.max(Math.abs(f[0]),Math.abs(b[0]))),A.setY(Math.max(Math.abs(f[1]),Math.abs(b[1]))),A.setZ(Math.max(Math.abs(f[2]),Math.abs(b[2]))),u.normalized){const m=Ln(Dt[u.componentType]);A.multiplyScalar(m)}r.max(A)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(r)}c.boundingBox=n;const o=new a.Sphere;n.getCenter(o.center),o.radius=n.min.distanceTo(n.max)/2,c.boundingSphere=o}function gi(c,e,t){const i=e.attributes,n=[];function s(o,r){return t.getDependency("accessor",o).then(function(A){c.setAttribute(r,A)})}for(const o in i){const r=kn[o]||o.toLowerCase();r in c.attributes||n.push(s(i[o],r))}if(e.indices!==void 0&&!c.index){const o=t.getDependency("accessor",e.indices).then(function(r){c.setIndex(r)});n.push(o)}return a.ColorManagement.workingColorSpace!==a.LinearSRGBColorSpace&&"COLOR_0"in i&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${a.ColorManagement.workingColorSpace}" not supported.`),nt(c,e),Ia(c,e,t),Promise.all(n).then(function(){return e.targets!==void 0?ua(c,e.targets,t):c})}var Ca=(function(){var c="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuec:W:Odkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq;lZkdbk;jYi5ud9:du8Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCabaOad2fhXaAcethQaxaDfhiaOaeaoaeao6E9RhLalcl4cifcd4hKazcj;cbfaAfhYcbh8AazcjdfhEaHh3incbhodnawTmbaxa8Acd4fRbbhokaocFeGh5cbh8Eazcj;cbfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcj;cbfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcj;cbfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaK6mva8FaKfhidnaCTmbaPai9RcK6mbaocdtc:q1jjbfcj1jjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bbarcwf9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfag9c8F1:NghcKtc8F91aicdfa8J9c8N1:Nfg8KRbbG86bbarcVfcba8KahcjeGcr4fghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fag9c8F1:NgicKtc8F91aha8J9c8N1:NfghRbbG86bbarc96fcbahaicjeGcr4fgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbb83bbarcwfaicwf8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasa8Acd4fRbbgociGPlbedrbkaATmdaza8Afh8Fazcj;cbfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeaza8Afhaazcj;cbfhhcbhoceh8EaYh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaLaocefgofmbka8FaQfh8FcdhoaacdfhaahaQfhha8EceGhlcbh8EalmbxdkkaATmbcbaocl49Rh8Eaza8AfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaYhainazcj;cbfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E93aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3a8Aclfg8Aad6mbkaXazcjdfaAad2z:jjjjb8AazazcjdfaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaok:XseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiaPfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaOfhiazaOfhxxekaxcbalRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhAascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhzaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkaOhlxekalcefhlkaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDclfaO87ebaDcdfaz87ebxekabarcdtfgDaABdbaDcwfaOBdbaDclfazBdbkavc;abfaocitfgDazBdbaDaABdlavaicdtfaABdbavc;abfaocefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfaocdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnaecvfal9nmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk::ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxabaiarcefciGfcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGfgkcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkabaiarcufciGfcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkabakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K1jjbgeabcifc98GfgbBd:K1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;teeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk:3eedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdxaialBdwaialBdlaialBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk81dbcjwk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:Kwkl8WNbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuec:q:6dkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:Ctklbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:183lYud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxavaialfgmar9Rgoad;8qbbcj;abad9Uc;WFbGcjdadca0EhPdndndnadTmbaoadfhscbhzinaeaz9nmdamax9RaD6miabazad2fhHaxaDfhOaPaeaz9RazaPfae6EgAcsfgocl4cifcd4hCavcj;cbfaoc9WGgXcetfhQavcj;cbfaXci2fhLavcj;cbfaXfhKcbhYaoc;ab6h8AincbhodnawTmbaxaYcd4fRbbhokaocFeGhEcbh3avcj;cbfh5indndndndnaEa3cet4ciGgoc9:fPdebdkamaO9RaX6mwavcj;cbfa3aX2faOaX;8qbbaOaAfhOxdkavcj;cbfa3aX2fcbaX;8kbxekamaO9RaC6moaoclVcbawEhraOaCfhocbhidna8Ambamao9Rc;Gb6mbcbhlina5alfhidndndndndndnaOalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaoclffahc:q:yjjbfRbbfhoxikaiaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaocwffahc:q:yjjbfRbbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaaaocdffahc:q:yjjbfRbbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaoclffahc:q:yjjbfRbbfhoxikaiczfaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaocwffahc:q:yjjbfRbbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaaaocdffahc:q:yjjbfRbbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaoclffahc:q:yjjbfRbbfhoxikaicafaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaocwffahc:q:yjjbfRbbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaaaocdffahc:q:yjjbfRbbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaop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ahc:q:yjjbfRbbfhoxikaqaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spkbbaaaocwffahc:q:yjjbfRbbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpkbbaaaocdffahc:q:yjjbfRbbfhokalcdfhlaiczfgiaX6mbkkaohOaoTmoka5aXfh5a3cefg3cl9hmbkdndndndnawTmbasaYcd4fRbbglciGPlbedwbkaXTmdavcjdfaYfhlavaYfpbdbhgcbhoinalavcj;cbfaofpblbg8JaKaofpblbg8KpmbzeHdOiAlCvXoQrLg8LaQaofpblbg8MaLaofpblbg8NpmbzeHdOiAlCvXoQrLgypmbezHdiOAlvCXorQLg8Ecep9Ta8Epxeeeeeeeeeeeeeeeeg8Fp9op9Hp9rg8Eagp9Uggp9Abbbaladfglaga8Ea8Epmlvorlvorlvorlvorp9Uggp9Abbbaladfglaga8Ea8EpmwDqkwDqkwDqkwDqkp9Uggp9Abbbaladfglaga8Ea8EpmxmPsxmPsxmPsxmPsp9Uggp9Abbbaladfglaga8LaypmwDKYqk8AExm35Ps8E8Fg8Ecep9Ta8Ea8Fp9op9Hp9rg8Ep9Uggp9Abbbaladfglaga8Ea8Epmlvorlvorlvorlvorp9Uggp9Abbbaladfglaga8Ea8EpmwDqkwDqkwDqkwDqkp9Uggp9Abbbaladfglaga8Ea8EpmxmPsxmPsxmPsxmPsp9Uggp9Abbbaladfglaga8Ja8KpmwKDYq8AkEx3m5P8Es8Fg8Ja8Ma8NpmwKDYq8AkEx3m5P8Es8Fg8K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rg8Fp9Abbbaradfgra8Fa8Ea8EpmwDqkwDqkwDqkwDqkp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmxmPsxmPsxmPsxmPsp9rg8Fp9Abbbaradfgra8Faga8JpmwDKYqk8AExm35Ps8E8Fg8Eaip:Rea8Ealp:Sep9qg8Ep9rg8Fp9Abbbaradfgra8Fa8Ea8Epmlvorlvorlvorlvorp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmwDqkwDqkwDqkwDqkp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmxmPsxmPsxmPsxmPsp9rg8Fp9AbbbaradfhraoczfgoaX6mbkkaYclfgYad6mbkaHavcjdfaAad2;8qbbavavcjdfaAcufad2fad;8qbbaAazfhzc9:hoaOhxaOmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdaPaeao9RaoaPfae6Eaofgoae6mbkaial9Rhxkcbc99amax9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbk:TseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiaPfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaOfhiazaOfhxxekaxcbalRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhAascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhzaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkaOhlxekalcefhlkaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDclfaO87ebaDcdfaz87ebxekabarcdtfgDaABdbaDcwfaOBdbaDclfazBdbkavc;abfaocitfgDazBdbaDaABdlavaicdtfaABdbavc;abfaocefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfaocdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnaecvfal9nmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:2Pliur97eue978Jjjjjbc8W9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskaipxFubbFubbFubbFubbgxpklbdnalTmbcbhvabhdinadczfgmampbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraipblbaDaopmlvorxmPsCXQL358E8Fp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgPp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;MeawaqawaPp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiczfpxbbbbbbbbbbbbbbbbgopklbaiaopklbaiabalcitfgdaeciGglcitgv;8qbbaiaxpkladnalTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraipblaaDaopmlvorxmPsCXQL358E8Fp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgPp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;MeawaqawaPp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkadaiav;8qbbkk:Iwllue97euo978Jjjjjbca9Rhidnaec98GglTmbcbhvabhoinaocKfpx:ji:1S:ji:1S:ji:1S:ji:1SaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkpxibbbibbbibbbibbbp9qgxp;6ep;Negmaxaxp:1ep;7egxaxp;KearaDpmbediwDqkzHOAKY8AEgxczp:Reczp:Sep;6egrarp;Meaxczp:Sep;6egDaDp;Meaqczp:Reczp:Sep;6egqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gxp;KepxFFbbFFbbFFbbFFbbgPp9oamaDp;Meaxp;Keczp:Rep9qgDamarp;Meaxp;KeaPp9oamaqp;Meaxp;Keczp:Rep9qgxpmwDKYqk8AExm35Ps8E8Fgrp5eakclp:RegmpEi:T:j83ibawarp5bampEd:T:j83ibaocwfaDaxpmbezHdiOAlvCXorQLgxp5eampEe:T:j83ibaoaxp5bampEb:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiczfpxbbbbbbbbbbbbbbbbgmpklbaiampklbaiabalcitfgoaeciGgvcitgw;8qbbdnavTmbaipx:ji:1S:ji:1S:ji:1S:ji:1SaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkpxibbbibbbibbbibbbp9qgxp;6ep;Negmaxaxp:1ep;7egxaxp;KearaDpmbediwDqkzHOAKY8AEgxczp:Reczp:Sep;6egrarp;Meaxczp:Sep;6egDaDp;Meaqczp:Reczp:Sep;6egqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gxp;KepxFFbbFFbbFFbbFFbbgPp9oamaDp;Meaxp;Keczp:Rep9qgDamarp;Meaxp;KeaPp9oamaqp;Meaxp;Keczp:Rep9qgxpmwDKYqk8AExm35Ps8E8Fgrp5eakclp:RegmpEi:T:j83iKaiarp5bampEd:T:j83izaiaDaxpmbezHdiOAlvCXorQLgxp5eampEe:T:j83iwaiaxp5bampEb:T:j83ibkaoaiaw;8qbbkk;uddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaic8WfpxbbbbbbbbbbbbbbbbgopklbaicafaopklbaiczfaopklbaiaopklbaiabavcdtfgdalciGgecdtgv;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkadaiav;8qbbkk:CPvdue97euw97eu8Jjjjjbc8W9Rhiaec98Ghldndnadcl9hmbaipxbbbbbbbbbbbbbbbbgvpklbdnalTmbcbhoabhdinadpbbbhradpxbbuJbbuJbbuJbbuJaipblbarcKp:Tep9qgwcep:Seawp9qgDcdp:SeaDp9qgDclp:SeaDp9qgqp;6ep;NegDarcwp:RecKp:SegkarpxFbbbFbbbFbbbFbbbgxp9ogmp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gPp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oaDamakp:Xearczp:RecKp:Segrp:Uep;6ep;MeaPp;Keaxp9op9qaDamakarp:Uep:Xep;6ep;MeaPp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qaDaqawcep:Rep9oawpxebbbebbbebbbebbbp9op9qp;6ep;MeaPp;KecKp:Rep9qpkbbadczfhdaoclfgoal6mbkkalaeSmeaiavpklaaicafabalcdtfgdaeciGglcdtgo;8qbbaiavpklbdnalTmbaipblahraipxbbuJbbuJbbuJbbuJaipblbarcKp:Tep9qgwcep:Seawp9qgDcdp:SeaDp9qgDclp:SeaDp9qgqp;6ep;NegDarcwp:RecKp:SegkarpxFbbbFbbbFbbbFbbbgxp9ogmp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gPp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oaDamakp:Xearczp:RecKp:Segrp:Uep;6ep;MeaPp;Keaxp9op9qaDamakarp:Uep:Xep;6ep;MeaPp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qaDaqawcep:Rep9oawpxebbbebbbebbbebbbp9op9qp;6ep;MeaPp;KecKp:Rep9qpklakadaicafao;8qbbskaipxbbbbbbbbbbbbbbbbgvpklbdnalTmbcbhoabhdinadczfgspxbFu9hbFu9hbFu9hbFu9hadpbbbgDaspbbbgPpmlvorxmPsCXQL358E8Fgmczp:Teaipblbp9qgrcep:Searp9qgwcdp:Seawp9qgwclp:Seawp9qgwcwp:Seawp9qgqp;6ep;NegwaDaPpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbgPp9ogkaDczp:Segxp:Ueamczp:Reczp:Segmp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gDp;KeaPp9oawakaxamp:Uep:Xep;6ep;MeaDp;Keczp:Rep9qgxawaqarcep:Rep9oarpxebbbebbbebbbebbbp9op9qp;6ep;MeaDp;Keczp:Reawamakp:Uep;6ep;MeaDp;KeaPp9op9qgrpmwDKYqk8AExm35Ps8E8FpkbbadaxarpmbezHdiOAlvCXorQLpkbbadcafhdaoclfgoal6mbkkalaeSmbaiczfpxbbbbbbbbbbbbbbbbgrpklbaiarpklbaiabalcitfgdaeciGglcitgo;8qbbaiavpkladnalTmbaipxbFu9hbFu9hbFu9hbFu9haipblbgDaipblzgPpmlvorxmPsCXQL358E8Fgmczp:Teaipblap9qgrcep:Searp9qgwcdp:Seawp9qgwclp:Seawp9qgwcwp:Seawp9qgqp;6ep;NegwaDaPpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbgPp9ogkaDczp:Segxp:Ueamczp:Reczp:Segmp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gDp;KeaPp9oawakaxamp:Uep:Xep;6ep;MeaDp;Keczp:Rep9qgxawaqarcep:Rep9oarpxebbbebbbebbbebbbp9op9qp;6ep;MeaDp;Keczp:Reawamakp:Uep;6ep;MeaDp;KeaPp9op9qgrpmwDKYqk8AExm35Ps8E8FpklzaiaxarpmbezHdiOAlvCXorQLpklbkadaiao;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n=WebAssembly.validate(t)?r(e):r(c),s,o=WebAssembly.instantiate(n,{}).then(function(B){s=B.instance,s.exports.__wasm_call_ctors()});function r(B){for(var w=new Uint8Array(B.length),C=0;C<B.length;++C){var y=B.charCodeAt(C);w[C]=y>96?y-97:y>64?y-39:y+4}for(var Q=0,C=0;C<B.length;++C)w[Q++]=w[C]<60?i[w[C]]:(w[C]-60)*64+w[++C];return w.buffer.slice(0,Q)}function A(B,w,C,y,Q,R,M){var T=B.exports.sbrk,D=y+3&-4,G=T(D*Q),U=T(R.length),j=new Uint8Array(B.exports.memory.buffer);j.set(R,U);var X=w(G,y,Q,U,R.length);if(X==0&&M&&M(G,D,Q),C.set(j.subarray(G,G+y*Q)),T(G-T(0)),X!=0)throw new Error("Malformed buffer data: "+X)}var l={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},h={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},p=[],u=0;function f(B){var w={object:new Worker(B),pending:0,requests:{}};return w.object.onmessage=function(C){var y=C.data;w.pending-=y.count,w.requests[y.id][y.action](y.value),delete w.requests[y.id]},w}function b(B){for(var w="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(n)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+E.name+";"+A.toString()+E.toString(),C=new Blob([w],{type:"text/javascript"}),y=URL.createObjectURL(C),Q=p.length;Q<B;++Q)p[Q]=f(y);for(var Q=B;Q<p.length;++Q)p[Q].object.postMessage({});p.length=B,URL.revokeObjectURL(y)}function m(B,w,C,y,Q){for(var R=p[0],M=1;M<p.length;++M)p[M].pending<R.pending&&(R=p[M]);return new Promise(function(T,D){var G=new Uint8Array(C),U=++u;R.pending+=B,R.requests[U]={resolve:T,reject:D},R.object.postMessage({id:U,count:B,size:w,source:G,mode:y,filter:Q},[G.buffer])})}function E(B){var w=B.data;if(!w.id)return self.close();self.ready.then(function(C){try{var y=new Uint8Array(w.count*w.size);A(C,C.exports[w.mode],y,w.count,w.size,w.source,C.exports[w.filter]),self.postMessage({id:w.id,count:w.count,action:"resolve",value:y},[y.buffer])}catch(Q){self.postMessage({id:w.id,count:w.count,action:"reject",value:Q})}})}return{ready:o,supported:!0,useWorkers:function(B){b(B)},decodeVertexBuffer:function(B,w,C,y,Q){A(s,s.exports.meshopt_decodeVertexBuffer,B,w,C,y,s.exports[l[Q]])},decodeIndexBuffer:function(B,w,C,y){A(s,s.exports.meshopt_decodeIndexBuffer,B,w,C,y)},decodeIndexSequence:function(B,w,C,y){A(s,s.exports.meshopt_decodeIndexSequence,B,w,C,y)},decodeGltfBuffer:function(B,w,C,y,Q,R){A(s,s.exports[h[Q]],B,w,C,y,s.exports[l[R]])},decodeGltfBufferAsync:function(B,w,C,y,Q){return p.length>0?m(B,w,C,h[y],l[Q]):o.then(function(){var R=new Uint8Array(B*w);return A(s,s.exports[h[y]],R,B,w,C,s.exports[l[Q]]),R})}}})();const fn=new WeakMap;class Ba extends a.Loader{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,i,n){const s=new a.FileLoader(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,o=>{this.parse(o,t,n)},i,n)}parse(e,t,i=()=>{}){this.decodeDracoFile(e,t,null,null,a.SRGBColorSpace,i).catch(i)}decodeDracoFile(e,t,i,n,s=a.LinearSRGBColorSpace,o=()=>{}){const r={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!i,vertexColorSpace:s};return this.decodeGeometry(e,r).then(t).catch(o)}decodeGeometry(e,t){const i=JSON.stringify(t);if(fn.has(e)){const A=fn.get(e);if(A.key===i)return A.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n;const s=this.workerNextTaskID++,o=e.byteLength,r=this._getWorker(s,o).then(A=>(n=A,new Promise((l,h)=>{n._callbacks[s]={resolve:l,reject:h},n.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(A=>this._createGeometry(A.geometry));return r.catch(()=>!0).then(()=>{n&&s&&this._releaseTask(n,s)}),fn.set(e,{key:i,promise:r}),r}_createGeometry(e){const t=new a.BufferGeometry;e.index&&t.setIndex(new a.BufferAttribute(e.index.array,1));for(let i=0;i<e.attributes.length;i++){const{name:n,array:s,itemSize:o,stride:r,vertexColorSpace:A}=e.attributes[i];let l;if(o===r)l=new a.BufferAttribute(s,o);else{const h=new a.InterleavedBuffer(s,r);l=new a.InterleavedBufferAttribute(h,o,0)}n==="color"&&(this._assignVertexColorSpace(l,A),l.normalized=!(s instanceof Float32Array)),t.setAttribute(n,l)}return t}_assignVertexColorSpace(e,t){if(t!==a.SRGBColorSpace)return;const i=new a.Color;for(let n=0,s=e.count;n<s;n++)i.fromBufferAttribute(e,n),a.ColorManagement.colorSpaceToWorking(i,a.SRGBColorSpace),e.setXYZ(n,i.r,i.g,i.b)}_loadLibrary(e,t){const i=new a.FileLoader(this.manager);return i.setPath(this.decoderPath),i.setResponseType(t),i.setWithCredentials(this.withCredentials),new Promise((n,s)=>{i.load(e,n,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(i=>{const n=i[0];e||(this.decoderConfig.wasmBinary=i[1]);const s=ya.toString(),o=["/* draco decoder */",n,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(`
|
|
2
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const n=new Worker(this.workerSourceURL);n._callbacks={},n._taskCosts={},n._taskLoad=0,n.postMessage({type:"init",decoderConfig:this.decoderConfig}),n.onmessage=function(s){const o=s.data;switch(o.type){case"decode":n._callbacks[o.id].resolve(o);break;case"error":n._callbacks[o.id].reject(o);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+o.type+'"')}},this.workerPool.push(n)}else this.workerPool.sort(function(n,s){return n._taskLoad>s._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function ya(){let c,e;onmessage=function(o){const r=o.data;switch(r.type){case"init":c=r.decoderConfig,e=new Promise(function(h){c.onModuleLoaded=function(p){h({draco:p})},DracoDecoderModule(c)});break;case"decode":const A=r.buffer,l=r.taskConfig;e.then(h=>{const p=h.draco,u=new p.Decoder;try{const f=t(p,u,new Int8Array(A),l),b=f.attributes.map(m=>m.array.buffer);f.index&&b.push(f.index.array.buffer),self.postMessage({type:"decode",id:r.id,geometry:f},b)}catch(f){console.error(f),self.postMessage({type:"error",id:r.id,error:f.message})}finally{p.destroy(u)}});break}};function t(o,r,A,l){const h=l.attributeIDs,p=l.attributeTypes;let u,f;const b=r.GetEncodedGeometryType(A);if(b===o.TRIANGULAR_MESH)u=new o.Mesh,f=r.DecodeArrayToMesh(A,A.byteLength,u);else if(b===o.POINT_CLOUD)u=new o.PointCloud,f=r.DecodeArrayToPointCloud(A,A.byteLength,u);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||u.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());const m={index:null,attributes:[]};for(const E in h){const B=self[p[E]];let w,C;if(l.useUniqueIDs)C=h[E],w=r.GetAttributeByUniqueId(u,C);else{if(C=r.GetAttributeId(u,o[h[E]]),C===-1)continue;w=r.GetAttribute(u,C)}const y=n(o,r,u,E,B,w);E==="color"&&(y.vertexColorSpace=l.vertexColorSpace),m.attributes.push(y)}return b===o.TRIANGULAR_MESH&&(m.index=i(o,r,u)),o.destroy(u),m}function i(o,r,A){const h=A.num_faces()*3,p=h*4,u=o._malloc(p);r.GetTrianglesUInt32Array(A,p,u);const f=new Uint32Array(o.HEAPF32.buffer,u,h).slice();return o._free(u),{array:f,itemSize:1}}function n(o,r,A,l,h,p){const u=A.num_points(),f=p.num_components(),b=s(o,h),m=f*h.BYTES_PER_ELEMENT,E=Math.ceil(m/4)*4,B=E/h.BYTES_PER_ELEMENT,w=u*m,C=u*E,y=o._malloc(w);r.GetAttributeDataArrayForAllPoints(A,p,b,w,y);const Q=new h(o.HEAPF32.buffer,y,w/h.BYTES_PER_ELEMENT);let R;if(m===E)R=Q.slice();else{R=new h(C/h.BYTES_PER_ELEMENT);let M=0;for(let T=0,D=Q.length;T<D;T++){for(let G=0;G<f;G++)R[M+G]=Q[T*f+G];M+=B}}return o._free(y),{name:l,count:u,itemSize:f,array:R,stride:B}}function s(o,r){switch(r){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}class wa{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0,this.workerCreator=null}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const i=this.workersResolve[e];if(i&&i(t),this.queue.length){const{resolve:n,msg:s,transfer:o}=this.queue.shift();this.workersResolve[e]=n,this.workers[e].postMessage(s,o)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(i=>{const n=this._getIdleWorker();n!==-1?(this._initWorker(n),this.workerStatus|=1<<n,this.workersResolve[n]=i,this.workers[n].postMessage(e,t)):this.queue.push({resolve:i,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const Qa=0,ui=2,xa=1,fi=2,Sa=0,Ta=1,va=10,Da=0,ts=9,ns=15,is=16,ss=22,os=37,as=43,rs=76,As=83,cs=97,ls=100,hs=103,ps=109,gs=122,us=123,fs=131,ds=132,bs=133,ms=134,Es=137,Is=138,Cs=139,Bs=140,ys=141,ws=142,Qs=145,xs=146,Ss=148,Ts=152,vs=153,Ds=154,Rs=155,Ms=156,Fs=157,_s=158,ks=165,Ls=166,Gs=1000054e3,Us=1000054001,Ps=1000054004,Ns=1000054005,zn=1000066e3,Os=1000066004;class _t{constructor(e,t,i,n){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,i),this._littleEndian=n,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t=0){const i=this._offset;let n=0;for(;this._dataView.getUint8(this._offset)!==t&&n<e;)n++,this._offset++;return n<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+i,n)}}const Ge=[171,75,84,88,32,50,48,187,13,10,26,10];function di(c){return new TextDecoder().decode(c)}function Ra(c){const e=new Uint8Array(c.buffer,c.byteOffset,Ge.length);if(e[0]!==Ge[0]||e[1]!==Ge[1]||e[2]!==Ge[2]||e[3]!==Ge[3]||e[4]!==Ge[4]||e[5]!==Ge[5]||e[6]!==Ge[6]||e[7]!==Ge[7]||e[8]!==Ge[8]||e[9]!==Ge[9]||e[10]!==Ge[10]||e[11]!==Ge[11])throw new Error("Missing KTX 2.0 identifier.");const t={vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,levelCount:0,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null},i=17*Uint32Array.BYTES_PER_ELEMENT,n=new _t(c,Ge.length,i,!0);t.vkFormat=n._nextUint32(),t.typeSize=n._nextUint32(),t.pixelWidth=n._nextUint32(),t.pixelHeight=n._nextUint32(),t.pixelDepth=n._nextUint32(),t.layerCount=n._nextUint32(),t.faceCount=n._nextUint32(),t.levelCount=n._nextUint32(),t.supercompressionScheme=n._nextUint32();const s=n._nextUint32(),o=n._nextUint32(),r=n._nextUint32(),A=n._nextUint32(),l=n._nextUint64(),h=n._nextUint64(),p=3*Math.max(t.levelCount,1)*8,u=new _t(c,Ge.length+i,p,!0);for(let ne=0,Z=Math.max(t.levelCount,1);ne<Z;ne++)t.levels.push({levelData:new Uint8Array(c.buffer,c.byteOffset+u._nextUint64(),u._nextUint64()),uncompressedByteLength:u._nextUint64()});const f=new _t(c,s,o,!0);f._skip(4);const b=f._nextUint16(),m=f._nextUint16(),E=f._nextUint16(),B=f._nextUint16(),w={vendorId:b,descriptorType:m,versionNumber:E,colorModel:f._nextUint8(),colorPrimaries:f._nextUint8(),transferFunction:f._nextUint8(),flags:f._nextUint8(),texelBlockDimension:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],bytesPlane:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],samples:[]},C=(B/4-6)/4;for(let ne=0;ne<C;ne++){const Z={bitOffset:f._nextUint16(),bitLength:f._nextUint8(),channelType:f._nextUint8(),samplePosition:[f._nextUint8(),f._nextUint8(),f._nextUint8(),f._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};64&Z.channelType?(Z.sampleLower=f._nextInt32(),Z.sampleUpper=f._nextInt32()):(Z.sampleLower=f._nextUint32(),Z.sampleUpper=f._nextUint32()),w.samples[ne]=Z}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(w);const y=new _t(c,r,A,!0);for(;y._offset<A;){const ne=y._nextUint32(),Z=y._scan(ne),se=di(Z);if(t.keyValue[se]=y._nextUint8Array(ne-Z.byteLength-1),se.match(/^ktx/i)){const ue=di(t.keyValue[se]);t.keyValue[se]=ue.substring(0,ue.lastIndexOf("\0"))}y._skip(ne%4?4-ne%4:0)}if(h<=0)return t;const Q=new _t(c,l,h,!0),R=Q._nextUint16(),M=Q._nextUint16(),T=Q._nextUint32(),D=Q._nextUint32(),G=Q._nextUint32(),U=Q._nextUint32(),j=[];for(let ne=0,Z=Math.max(t.levelCount,1);ne<Z;ne++)j.push({imageFlags:Q._nextUint32(),rgbSliceByteOffset:Q._nextUint32(),rgbSliceByteLength:Q._nextUint32(),alphaSliceByteOffset:Q._nextUint32(),alphaSliceByteLength:Q._nextUint32()});const X=l+Q._offset,N=X+T,V=N+D,H=V+G,$=new Uint8Array(c.buffer,c.byteOffset+X,T),oe=new Uint8Array(c.buffer,c.byteOffset+N,D),te=new Uint8Array(c.buffer,c.byteOffset+V,G),le=new Uint8Array(c.buffer,c.byteOffset+H,U);return t.globalData={endpointCount:R,selectorCount:M,imageDescs:j,endpointsData:$,selectorsData:oe,tablesData:te,extendedData:le},t}let dn,At,Gn;const bn={env:{emscripten_notify_memory_growth:function(c){Gn=new Uint8Array(At.exports.memory.buffer)}}};class Ma{init(){return dn||(dn=typeof fetch<"u"?fetch("data:application/wasm;base64,"+bi).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,bn)).then(this._init):WebAssembly.instantiate(Buffer.from(bi,"base64"),bn).then(this._init),dn)}_init(e){At=e.instance,bn.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!At)throw new Error("ZSTDDecoder: Await .init() before decoding.");const i=e.byteLength,n=At.exports.malloc(i);Gn.set(e,n),t=t||Number(At.exports.ZSTD_findDecompressedSize(n,i));const s=At.exports.malloc(t),o=At.exports.ZSTD_decompress(s,t,n,i),r=Gn.slice(s,s+o);return At.exports.free(n),At.exports.free(s),r}}const bi="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUB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gAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YE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ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARB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B0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxAB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EDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN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AAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",Fa="display-p3",_a="display-p3-linear";({...a.ColorManagement.spaces[a.SRGBColorSpace]});const mn=new WeakMap;let En=0,In;class Xe extends a.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new wa,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return console.warn('KTX2Loader: "detectSupportAsync()" has been deprecated. Use "detectSupport()" and "await renderer.init();" when creating the renderer.'),await e.init(),this.detectSupport(e)}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-s3tc"),bptcSupported:e.hasFeature("texture-compression-bc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:(this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),astcHDRSupported:e.extensions.has("WEBGL_compressed_texture_astc")&&e.extensions.get("WEBGL_compressed_texture_astc").getSupportedProfiles().includes("hdr"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},typeof navigator<"u"&&typeof navigator.platform<"u"&&typeof navigator.userAgent<"u"&&navigator.platform.indexOf("Linux")>=0&&navigator.userAgent.indexOf("Firefox")>=0&&this.workerConfig.astcSupported&&this.workerConfig.etc2Supported&&this.workerConfig.bptcSupported&&this.workerConfig.dxtSupported&&(this.workerConfig.astcSupported=!1,this.workerConfig.etc2Supported=!1)),this}init(){if(!this.transcoderPending){const e=new a.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),i=new a.FileLoader(this.manager);i.setPath(this.transcoderPath),i.setResponseType("arraybuffer"),i.setWithCredentials(this.withCredentials);const n=i.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,n]).then(([s,o])=>{const r=Xe.BasisWorker.toString(),A=["/* constants */","let _EngineFormat = "+JSON.stringify(Xe.EngineFormat),"let _EngineType = "+JSON.stringify(Xe.EngineType),"let _TranscoderFormat = "+JSON.stringify(Xe.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(Xe.BasisFormat),"/* basis_transcoder.js */",s,"/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join(`
|
|
3
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([A])),this.transcoderBinary=o,this.workerPool.setWorkerCreator(()=>{const l=new Worker(this.workerSourceURL),h=this.transcoderBinary.slice(0);return l.postMessage({type:"init",config:this.workerConfig,transcoderBinary:h},[h]),l})}),En>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),En++}return this.transcoderPending}load(e,t,i,n){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const s=new a.FileLoader(this.manager);s.setPath(this.path),s.setCrossOrigin(this.crossOrigin),s.setWithCredentials(this.withCredentials),s.setRequestHeader(this.requestHeader),s.setResponseType("arraybuffer"),s.load(e,o=>{this.parse(o,t,n)},i,n)}parse(e,t,i){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(mn.has(e))return mn.get(e).promise.then(t).catch(i);this._createTexture(e).then(n=>t?t(n):null).catch(i)}_createTextureFrom(e,t){const{type:i,error:n,data:{faces:s,width:o,height:r,format:A,type:l,dfdFlags:h}}=e;if(i==="error")return Promise.reject(n);let p;if(t.faceCount===6)p=new a.CompressedCubeTexture(s,A,l);else{const u=s[0].mipmaps;p=t.layerCount>1?new a.CompressedArrayTexture(u,o,r,t.layerCount,A,l):new a.CompressedTexture(u,o,r,A,l)}return p.minFilter=s[0].mipmaps.length===1?a.LinearFilter:a.LinearMipmapLinearFilter,p.magFilter=a.LinearFilter,p.generateMipmaps=!1,p.needsUpdate=!0,p.colorSpace=Hs(t),p.premultiplyAlpha=!!(h&xa),p}async _createTexture(e,t={}){const i=Ra(new Uint8Array(e)),n=i.vkFormat===zn&&i.dataFormatDescriptor[0].colorModel===167;if(!(i.vkFormat===Da||n&&!this.workerConfig.astcHDRSupported))return La(i);const o=t,r=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:o},[e])).then(A=>this._createTextureFrom(A.data,i));return mn.set(e,{promise:r}),r}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),En--}}Xe.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2};Xe.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16,BC6H:22,RGB_HALF:24,RGBA_HALF:25};Xe.EngineFormat={RGBAFormat:a.RGBAFormat,RGBA_ASTC_4x4_Format:a.RGBA_ASTC_4x4_Format,RGB_BPTC_UNSIGNED_Format:a.RGB_BPTC_UNSIGNED_Format,RGBA_BPTC_Format:a.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:a.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:a.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:a.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:a.RGB_ETC1_Format,RGB_ETC2_Format:a.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:a.RGB_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format:a.RGBA_S3TC_DXT1_Format};Xe.EngineType={UnsignedByteType:a.UnsignedByteType,HalfFloatType:a.HalfFloatType,FloatType:a.FloatType};Xe.BasisWorker=function(){let c,e,t;const i=_EngineFormat,n=_EngineType,s=_TranscoderFormat,o=_BasisFormat;self.addEventListener("message",function(b){const m=b.data;switch(m.type){case"init":c=m.config,r(m.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:E,buffers:B,width:w,height:C,hasAlpha:y,format:Q,type:R,dfdFlags:M}=A(m.buffer);self.postMessage({type:"transcode",id:m.id,data:{faces:E,width:w,height:C,hasAlpha:y,format:Q,type:R,dfdFlags:M}},B)}catch(E){console.error(E),self.postMessage({type:"error",id:m.id,error:E.message})}});break}});function r(b){e=new Promise(m=>{t={wasmBinary:b,onRuntimeInitialized:m},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function A(b){const m=new t.KTX2File(new Uint8Array(b));function E(){m.close(),m.delete()}if(!m.isValid())throw E(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let B;if(m.isUASTC())B=o.UASTC;else if(m.isETC1S())B=o.ETC1S;else if(m.isHDR())B=o.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const w=m.getWidth(),C=m.getHeight(),y=m.getLayers()||1,Q=m.getLevels(),R=m.getFaces(),M=m.getHasAlpha(),T=m.getDFDFlags(),{transcoderFormat:D,engineFormat:G,engineType:U}=p(B,w,C,M);if(!w||!C||!Q)throw E(),new Error("THREE.KTX2Loader: Invalid texture");if(!m.startTranscoding())throw E(),new Error("THREE.KTX2Loader: .startTranscoding failed");const j=[],X=[];for(let N=0;N<R;N++){const V=[];for(let H=0;H<Q;H++){const $=[];let oe,te;for(let ne=0;ne<y;ne++){const Z=m.getImageLevelInfo(H,ne,N);N===0&&H===0&&ne===0&&(Z.origWidth%4!==0||Z.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),Q>1?(oe=Z.origWidth,te=Z.origHeight):(oe=Z.width,te=Z.height);let se=new Uint8Array(m.getImageTranscodedSizeInBytes(H,ne,0,D));const ue=m.transcodeImage(se,H,ne,N,D,0,-1,-1);if(U===n.HalfFloatType&&(se=new Uint16Array(se.buffer,se.byteOffset,se.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!ue)throw E(),new Error("THREE.KTX2Loader: .transcodeImage failed.");$.push(se)}const le=f($);V.push({data:le,width:oe,height:te}),X.push(le.buffer)}j.push({mipmaps:V,width:w,height:C,format:G,type:U})}return E(),{faces:j,buffers:X,width:w,height:C,hasAlpha:M,dfdFlags:T,format:G,type:U}}const l=[{if:"astcSupported",basisFormat:[o.UASTC],transcoderFormat:[s.ASTC_4x4,s.ASTC_4x4],engineFormat:[i.RGBA_ASTC_4x4_Format,i.RGBA_ASTC_4x4_Format],engineType:[n.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[s.BC7_M5,s.BC7_M5],engineFormat:[i.RGBA_BPTC_Format,i.RGBA_BPTC_Format],engineType:[n.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[s.BC1,s.BC3],engineFormat:[i.RGBA_S3TC_DXT1_Format,i.RGBA_S3TC_DXT5_Format],engineType:[n.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[s.ETC1,s.ETC2],engineFormat:[i.RGB_ETC2_Format,i.RGBA_ETC2_EAC_Format],engineType:[n.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[s.ETC1],engineFormat:[i.RGB_ETC1_Format],engineType:[n.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[s.PVRTC1_4_RGB,s.PVRTC1_4_RGBA],engineFormat:[i.RGB_PVRTC_4BPPV1_Format,i.RGBA_PVRTC_4BPPV1_Format],engineType:[n.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[o.UASTC_HDR],transcoderFormat:[s.BC6H],engineFormat:[i.RGB_BPTC_UNSIGNED_Format],engineType:[n.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[s.RGBA32,s.RGBA32],engineFormat:[i.RGBAFormat,i.RGBAFormat],engineType:[n.UnsignedByteType,n.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[o.UASTC_HDR],transcoderFormat:[s.RGBA_HALF],engineFormat:[i.RGBAFormat],engineType:[n.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],h={[o.ETC1S]:l.filter(b=>b.basisFormat.includes(o.ETC1S)).sort((b,m)=>b.priorityETC1S-m.priorityETC1S),[o.UASTC]:l.filter(b=>b.basisFormat.includes(o.UASTC)).sort((b,m)=>b.priorityUASTC-m.priorityUASTC),[o.UASTC_HDR]:l.filter(b=>b.basisFormat.includes(o.UASTC_HDR)).sort((b,m)=>b.priorityHDR-m.priorityHDR)};function p(b,m,E,B){const w=h[b];for(let C=0;C<w.length;C++){const y=w[C];if(y.if&&!c[y.if]||!y.basisFormat.includes(b)||B&&y.transcoderFormat.length<2||y.needsPowerOfTwo&&!(u(m)&&u(E)))continue;const Q=y.transcoderFormat[B?1:0],R=y.engineFormat[B?1:0],M=y.engineType[0];return{transcoderFormat:Q,engineFormat:R,engineType:M}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function u(b){return b<=2?!0:(b&b-1)===0&&b!==0}function f(b){if(b.length===1)return b[0];let m=0;for(let w=0;w<b.length;w++){const C=b[w];m+=C.byteLength}const E=new Uint8Array(m);let B=0;for(let w=0;w<b.length;w++){const C=b[w];E.set(C,B),B+=C.byteLength}return E}};const ka=new Set([a.RGBAFormat,a.RGBFormat,a.RGFormat,a.RedFormat]),Cn={[ps]:a.RGBAFormat,[hs]:a.RGFormat,[ls]:a.RedFormat,[cs]:a.RGBAFormat,[As]:a.RGFormat,[rs]:a.RedFormat,[as]:a.RGBAFormat,[os]:a.RGBAFormat,[ss]:a.RGFormat,[is]:a.RGFormat,[ns]:a.RedFormat,[ts]:a.RedFormat,[us]:a.RGBFormat,[gs]:a.RGBFormat,[Ts]:a.RGBA_ETC2_EAC_Format,[Ss]:a.RGB_ETC2_Format,[vs]:a.R11_EAC_Format,[Ds]:a.SIGNED_R11_EAC_Format,[Rs]:a.RG11_EAC_Format,[Ms]:a.SIGNED_RG11_EAC_Format,[zn]:a.RGBA_ASTC_4x4_Format,[_s]:a.RGBA_ASTC_4x4_Format,[Fs]:a.RGBA_ASTC_4x4_Format,[Os]:a.RGBA_ASTC_6x6_Format,[Ls]:a.RGBA_ASTC_6x6_Format,[ks]:a.RGBA_ASTC_6x6_Format,[ms]:a.RGBA_S3TC_DXT1_Format,[bs]:a.RGBA_S3TC_DXT1_Format,[ds]:a.RGB_S3TC_DXT1_Format,[fs]:a.RGB_S3TC_DXT1_Format,[Is]:a.RGBA_S3TC_DXT5_Format,[Es]:a.RGBA_S3TC_DXT5_Format,[Bs]:a.SIGNED_RED_RGTC1_Format,[Cs]:a.RED_RGTC1_Format,[ws]:a.SIGNED_RED_GREEN_RGTC2_Format,[ys]:a.RED_GREEN_RGTC2_Format,[xs]:a.RGBA_BPTC_Format,[Qs]:a.RGBA_BPTC_Format,[Ns]:a.RGBA_PVRTC_4BPPV1_Format,[Us]:a.RGBA_PVRTC_4BPPV1_Format,[Ps]:a.RGBA_PVRTC_2BPPV1_Format,[Gs]:a.RGBA_PVRTC_2BPPV1_Format},St={[ps]:a.FloatType,[hs]:a.FloatType,[ls]:a.FloatType,[cs]:a.HalfFloatType,[As]:a.HalfFloatType,[rs]:a.HalfFloatType,[as]:a.UnsignedByteType,[os]:a.UnsignedByteType,[ss]:a.UnsignedByteType,[is]:a.UnsignedByteType,[ns]:a.UnsignedByteType,[ts]:a.UnsignedByteType,[us]:a.UnsignedInt5999Type,[gs]:a.UnsignedInt101111Type,[Ts]:a.UnsignedByteType,[Ss]:a.UnsignedByteType,[vs]:a.UnsignedByteType,[Ds]:a.UnsignedByteType,[Rs]:a.UnsignedByteType,[Ms]:a.UnsignedByteType,[zn]:a.HalfFloatType,[_s]:a.UnsignedByteType,[Fs]:a.UnsignedByteType,[Os]:a.HalfFloatType,[Ls]:a.UnsignedByteType,[ks]:a.UnsignedByteType,[ms]:a.UnsignedByteType,[bs]:a.UnsignedByteType,[ds]:a.UnsignedByteType,[fs]:a.UnsignedByteType,[Is]:a.UnsignedByteType,[Es]:a.UnsignedByteType,[Bs]:a.UnsignedByteType,[Cs]:a.UnsignedByteType,[ws]:a.UnsignedByteType,[ys]:a.UnsignedByteType,[xs]:a.UnsignedByteType,[Qs]:a.UnsignedByteType,[Ns]:a.UnsignedByteType,[Us]:a.UnsignedByteType,[Ps]:a.UnsignedByteType,[Gs]:a.UnsignedByteType};async function La(c){const{vkFormat:e}=c;if(Cn[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat: "+e);St[e]===void 0&&console.warn('THREE.KTX2Loader: Missing ".type" for vkFormat: '+e);let t;c.supercompressionScheme===ui&&(In||(In=new Promise(async o=>{const r=new Ma;await r.init(),o(r)})),t=await In);const i=[];for(let o=0;o<c.levels.length;o++){const r=Math.max(1,c.pixelWidth>>o),A=Math.max(1,c.pixelHeight>>o),l=c.pixelDepth?Math.max(1,c.pixelDepth>>o):0,h=c.levels[o];let p;if(c.supercompressionScheme===Qa)p=h.levelData;else if(c.supercompressionScheme===ui)p=t.decode(h.levelData,h.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let u;St[e]===a.FloatType?u=new Float32Array(p.buffer,p.byteOffset,p.byteLength/Float32Array.BYTES_PER_ELEMENT):St[e]===a.HalfFloatType?u=new Uint16Array(p.buffer,p.byteOffset,p.byteLength/Uint16Array.BYTES_PER_ELEMENT):St[e]===a.UnsignedInt5999Type||St[e]===a.UnsignedInt101111Type?u=new Uint32Array(p.buffer,p.byteOffset,p.byteLength/Uint32Array.BYTES_PER_ELEMENT):u=p,i.push({data:u,width:r,height:A,depth:l})}const n=c.levelCount===0||i.length>1;let s;if(ka.has(Cn[e]))s=c.pixelDepth===0?new a.DataTexture(i[0].data,c.pixelWidth,c.pixelHeight):new a.Data3DTexture(i[0].data,c.pixelWidth,c.pixelHeight,c.pixelDepth),s.minFilter=n?a.NearestMipmapNearestFilter:a.NearestFilter,s.magFilter=a.NearestFilter,s.generateMipmaps=c.levelCount===0;else{if(c.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");s=new a.CompressedTexture(i,c.pixelWidth,c.pixelHeight),s.minFilter=n?a.LinearMipmapLinearFilter:a.LinearFilter,s.magFilter=a.LinearFilter}return s.mipmaps=i,s.type=St[e],s.format=Cn[e],s.colorSpace=Hs(c),s.needsUpdate=!0,Promise.resolve(s)}function Hs(c){const e=c.dataFormatDescriptor[0];return e.colorPrimaries===Ta?e.transferFunction===fi?a.SRGBColorSpace:a.LinearSRGBColorSpace:e.colorPrimaries===va?e.transferFunction===fi?Fa:_a:(e.colorPrimaries===Sa||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),a.NoColorSpace)}const js=new a.NodeFrame;js.camera=new a.PerspectiveCamera;a.ShaderLib.basic,a.ShaderLib.basic,a.ShaderLib.points,a.ShaderLib.standard,a.ShaderLib.physical,a.ShaderLib.phong;var qt=function(){var c=0,e=document.createElement("div");e.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",e.addEventListener("click",function(h){h.preventDefault(),i(++c%e.children.length)},!1);function t(h){return e.appendChild(h.dom),h}function i(h){for(var p=0;p<e.children.length;p++)e.children[p].style.display=p===h?"block":"none";c=h}var n=(performance||Date).now(),s=n,o=0,r=t(new qt.Panel("FPS","#0ff","#002")),A=t(new qt.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var l=t(new qt.Panel("MB","#f08","#201"));return i(0),{REVISION:16,dom:e,addPanel:t,showPanel:i,begin:function(){n=(performance||Date).now()},end:function(){o++;var h=(performance||Date).now();if(A.update(h-n,200),h>=s+1e3&&(r.update(o*1e3/(h-s),100),s=h,o=0,l)){var p=performance.memory;l.update(p.usedJSHeapSize/1048576,p.jsHeapSizeLimit/1048576)}return h},update:function(){n=this.end()},domElement:e,setMode:i}};qt.Panel=function(c,e,t){var i=1/0,n=0,s=Math.round,o=s(window.devicePixelRatio||1),r=80*o,A=48*o,l=3*o,h=2*o,p=3*o,u=15*o,f=74*o,b=30*o,m=document.createElement("canvas");m.width=r,m.height=A,m.style.cssText="width:80px;height:48px";var E=m.getContext("2d");return E.font="bold "+9*o+"px Helvetica,Arial,sans-serif",E.textBaseline="top",E.fillStyle=t,E.fillRect(0,0,r,A),E.fillStyle=e,E.fillText(c,l,h),E.fillRect(p,u,f,b),E.fillStyle=t,E.globalAlpha=.9,E.fillRect(p,u,f,b),{dom:m,update:function(B,w){i=Math.min(i,B),n=Math.max(n,B),E.fillStyle=t,E.globalAlpha=1,E.fillRect(0,0,r,u),E.fillStyle=e,E.fillText(s(B)+" "+c+" ("+s(i)+"-"+s(n)+")",l,h),E.drawImage(m,p+o,u,f-o,b,p,u,f-o,b),E.fillRect(p+f-o,u,o,b),E.fillStyle=t,E.globalAlpha=.9,E.fillRect(p+f-o,u,o,s((1-B/w)*b))}}};class Ga extends a.ExtrudeGeometry{constructor(e,t={}){const i=t.font;if(i===void 0)super();else{const n=i.generateShapes(e,t.size,t.direction);t.depth===void 0&&(t.depth=50),t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(n,t)}this.type="TextGeometry"}}class Ua extends a.Loader{constructor(e){super(e)}load(e,t,i,n){const s=this,o=new a.FileLoader(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(r){const A=s.parse(JSON.parse(r));t&&t(A)},i,n)}parse(e){return new qs(e)}}class qs{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100,i="ltr"){const n=[],s=Pa(e,t,this.data,i);for(let o=0,r=s.length;o<r;o++)n.push(...s[o].toShapes());return n}}function Pa(c,e,t,i){const n=Array.from(c),s=e/t.resolution,o=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*s,r=[];let A=0,l=0;(i=="rtl"||i=="tb")&&n.reverse();for(let h=0;h<n.length;h++){const p=n[h];if(p===`
|
|
4
|
+
`)A=0,l-=o;else{const u=Na(p,s,A,l,t);i=="tb"?(A=0,l+=t.ascender*s):A+=u.offsetX,r.push(u.path)}}return r}function Na(c,e,t,i,n){const s=n.glyphs[c]||n.glyphs["?"];if(!s){console.error('THREE.Font: character "'+c+'" does not exists in font family '+n.familyName+".");return}const o=new a.ShapePath;let r,A,l,h,p,u,f,b;if(s.o){const m=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let E=0,B=m.length;E<B;)switch(m[E++]){case"m":r=m[E++]*e+t,A=m[E++]*e+i,o.moveTo(r,A);break;case"l":r=m[E++]*e+t,A=m[E++]*e+i,o.lineTo(r,A);break;case"q":l=m[E++]*e+t,h=m[E++]*e+i,p=m[E++]*e+t,u=m[E++]*e+i,o.quadraticCurveTo(p,u,l,h);break;case"b":l=m[E++]*e+t,h=m[E++]*e+i,p=m[E++]*e+t,u=m[E++]*e+i,f=m[E++]*e+t,b=m[E++]*e+i,o.bezierCurveTo(p,u,f,b,l,h);break}}return{offsetX:s.ha*e,path:o}}var xe=Uint8Array,qe=Uint16Array,Vn=Int32Array,An=new xe([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),cn=new xe([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Un=new xe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ks=function(c,e){for(var t=new qe(31),i=0;i<31;++i)t[i]=e+=1<<c[i-1];for(var n=new Vn(t[30]),i=1;i<30;++i)for(var s=t[i];s<t[i+1];++s)n[s]=s-t[i]<<5|i;return{b:t,r:n}},zs=Ks(An,2),Vs=zs.b,Pn=zs.r;Vs[28]=258,Pn[258]=28;var Ys=Ks(cn,0),Oa=Ys.b,mi=Ys.r,Nn=new qe(32768);for(var Ce=0;Ce<32768;++Ce){var ut=(Ce&43690)>>1|(Ce&21845)<<1;ut=(ut&52428)>>2|(ut&13107)<<2,ut=(ut&61680)>>4|(ut&3855)<<4,Nn[Ce]=((ut&65280)>>8|(ut&255)<<8)>>1}var st=(function(c,e,t){for(var i=c.length,n=0,s=new qe(e);n<i;++n)c[n]&&++s[c[n]-1];var o=new qe(e);for(n=1;n<e;++n)o[n]=o[n-1]+s[n-1]<<1;var r;if(t){r=new qe(1<<e);var A=15-e;for(n=0;n<i;++n)if(c[n])for(var l=n<<4|c[n],h=e-c[n],p=o[c[n]-1]++<<h,u=p|(1<<h)-1;p<=u;++p)r[Nn[p]>>A]=l}else for(r=new qe(i),n=0;n<i;++n)c[n]&&(r[n]=Nn[o[c[n]-1]++]>>15-c[n]);return r}),dt=new xe(288);for(var Ce=0;Ce<144;++Ce)dt[Ce]=8;for(var Ce=144;Ce<256;++Ce)dt[Ce]=9;for(var Ce=256;Ce<280;++Ce)dt[Ce]=7;for(var Ce=280;Ce<288;++Ce)dt[Ce]=8;var zt=new xe(32);for(var Ce=0;Ce<32;++Ce)zt[Ce]=5;var Ha=st(dt,9,0),ja=st(dt,9,1),qa=st(zt,5,0),Ka=st(zt,5,1),Bn=function(c){for(var e=c[0],t=1;t<c.length;++t)c[t]>e&&(e=c[t]);return e},We=function(c,e,t){var i=e/8|0;return(c[i]|c[i+1]<<8)>>(e&7)&t},yn=function(c,e){var t=e/8|0;return(c[t]|c[t+1]<<8|c[t+2]<<16)>>(e&7)},Yn=function(c){return(c+7)/8|0},Jn=function(c,e,t){return(t==null||t>c.length)&&(t=c.length),new xe(c.subarray(e,t))},za=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ne=function(c,e,t){var i=new Error(e||za[c]);if(i.code=c,Error.captureStackTrace&&Error.captureStackTrace(i,Ne),!t)throw i;return i},Va=function(c,e,t,i){var n=c.length,s=0;if(!n||e.f&&!e.l)return t||new xe(0);var o=!t,r=o||e.i!=2,A=e.i;o&&(t=new xe(n*3));var l=function(lt){var bt=t.length;if(lt>bt){var ot=new xe(Math.max(bt*2,lt));ot.set(t),t=ot}},h=e.f||0,p=e.p||0,u=e.b||0,f=e.l,b=e.d,m=e.m,E=e.n,B=n*8;do{if(!f){h=We(c,p,1);var w=We(c,p+1,3);if(p+=3,w)if(w==1)f=ja,b=Ka,m=9,E=5;else if(w==2){var R=We(c,p,31)+257,M=We(c,p+10,15)+4,T=R+We(c,p+5,31)+1;p+=14;for(var D=new xe(T),G=new xe(19),U=0;U<M;++U)G[Un[U]]=We(c,p+U*3,7);p+=M*3;for(var j=Bn(G),X=(1<<j)-1,N=st(G,j,1),U=0;U<T;){var V=N[We(c,p,X)];p+=V&15;var C=V>>4;if(C<16)D[U++]=C;else{var H=0,$=0;for(C==16?($=3+We(c,p,3),p+=2,H=D[U-1]):C==17?($=3+We(c,p,7),p+=3):C==18&&($=11+We(c,p,127),p+=7);$--;)D[U++]=H}}var oe=D.subarray(0,R),te=D.subarray(R);m=Bn(oe),E=Bn(te),f=st(oe,m,1),b=st(te,E,1)}else Ne(1);else{var C=Yn(p)+4,y=c[C-4]|c[C-3]<<8,Q=C+y;if(Q>n){A&&Ne(0);break}r&&l(u+y),t.set(c.subarray(C,Q),u),e.b=u+=y,e.p=p=Q*8,e.f=h;continue}if(p>B){A&&Ne(0);break}}r&&l(u+131072);for(var le=(1<<m)-1,ne=(1<<E)-1,Z=p;;Z=p){var H=f[yn(c,p)&le],se=H>>4;if(p+=H&15,p>B){A&&Ne(0);break}if(H||Ne(2),se<256)t[u++]=se;else if(se==256){Z=p,f=null;break}else{var ue=se-254;if(se>264){var U=se-257,Ee=An[U];ue=We(c,p,(1<<Ee)-1)+Vs[U],p+=Ee}var ce=b[yn(c,p)&ne],Oe=ce>>4;ce||Ne(3),p+=ce&15;var te=Oa[Oe];if(Oe>3){var Ee=cn[Oe];te+=yn(c,p)&(1<<Ee)-1,p+=Ee}if(p>B){A&&Ne(0);break}r&&l(u+131072);var He=u+ue;if(u<te){var wt=s-te,Qt=Math.min(te,He);for(wt+u<0&&Ne(3);u<Qt;++u)t[u]=i[wt+u]}for(;u<He;++u)t[u]=t[u-te]}}e.l=f,e.p=Z,e.b=u,e.f=h,f&&(h=1,e.m=m,e.d=b,e.n=E)}while(!h);return u!=t.length&&o?Jn(t,0,u):t.subarray(0,u)},rt=function(c,e,t){t<<=e&7;var i=e/8|0;c[i]|=t,c[i+1]|=t>>8},kt=function(c,e,t){t<<=e&7;var i=e/8|0;c[i]|=t,c[i+1]|=t>>8,c[i+2]|=t>>16},wn=function(c,e){for(var t=[],i=0;i<c.length;++i)c[i]&&t.push({s:i,f:c[i]});var n=t.length,s=t.slice();if(!n)return{t:Xs,l:0};if(n==1){var o=new xe(t[0].s+1);return o[t[0].s]=1,{t:o,l:1}}t.sort(function(Q,R){return Q.f-R.f}),t.push({s:-1,f:25001});var r=t[0],A=t[1],l=0,h=1,p=2;for(t[0]={s:-1,f:r.f+A.f,l:r,r:A};h!=n-1;)r=t[t[l].f<t[p].f?l++:p++],A=t[l!=h&&t[l].f<t[p].f?l++:p++],t[h++]={s:-1,f:r.f+A.f,l:r,r:A};for(var u=s[0].s,i=1;i<n;++i)s[i].s>u&&(u=s[i].s);var f=new qe(u+1),b=On(t[h-1],f,0);if(b>e){var i=0,m=0,E=b-e,B=1<<E;for(s.sort(function(R,M){return f[M.s]-f[R.s]||R.f-M.f});i<n;++i){var w=s[i].s;if(f[w]>e)m+=B-(1<<b-f[w]),f[w]=e;else break}for(m>>=E;m>0;){var C=s[i].s;f[C]<e?m-=1<<e-f[C]++-1:++i}for(;i>=0&&m;--i){var y=s[i].s;f[y]==e&&(--f[y],++m)}b=e}return{t:new xe(f),l:b}},On=function(c,e,t){return c.s==-1?Math.max(On(c.l,e,t+1),On(c.r,e,t+1)):e[c.s]=t},Ei=function(c){for(var e=c.length;e&&!c[--e];);for(var t=new qe(++e),i=0,n=c[0],s=1,o=function(A){t[i++]=A},r=1;r<=e;++r)if(c[r]==n&&r!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=c[r]}return{c:t.subarray(0,i),n:e}},Lt=function(c,e){for(var t=0,i=0;i<e.length;++i)t+=c[i]*e[i];return t},Js=function(c,e,t){var i=t.length,n=Yn(e+2);c[n]=i&255,c[n+1]=i>>8,c[n+2]=c[n]^255,c[n+3]=c[n+1]^255;for(var s=0;s<i;++s)c[n+s+4]=t[s];return(n+4+i)*8},Ii=function(c,e,t,i,n,s,o,r,A,l,h){rt(e,h++,t),++n[256];for(var p=wn(n,15),u=p.t,f=p.l,b=wn(s,15),m=b.t,E=b.l,B=Ei(u),w=B.c,C=B.n,y=Ei(m),Q=y.c,R=y.n,M=new qe(19),T=0;T<w.length;++T)++M[w[T]&31];for(var T=0;T<Q.length;++T)++M[Q[T]&31];for(var D=wn(M,7),G=D.t,U=D.l,j=19;j>4&&!G[Un[j-1]];--j);var X=l+5<<3,N=Lt(n,dt)+Lt(s,zt)+o,V=Lt(n,u)+Lt(s,m)+o+14+3*j+Lt(M,G)+2*M[16]+3*M[17]+7*M[18];if(A>=0&&X<=N&&X<=V)return Js(e,h,c.subarray(A,A+l));var H,$,oe,te;if(rt(e,h,1+(V<N)),h+=2,V<N){H=st(u,f,0),$=u,oe=st(m,E,0),te=m;var le=st(G,U,0);rt(e,h,C-257),rt(e,h+5,R-1),rt(e,h+10,j-4),h+=14;for(var T=0;T<j;++T)rt(e,h+3*T,G[Un[T]]);h+=3*j;for(var ne=[w,Q],Z=0;Z<2;++Z)for(var se=ne[Z],T=0;T<se.length;++T){var ue=se[T]&31;rt(e,h,le[ue]),h+=G[ue],ue>15&&(rt(e,h,se[T]>>5&127),h+=se[T]>>12)}}else H=Ha,$=dt,oe=qa,te=zt;for(var T=0;T<r;++T){var Ee=i[T];if(Ee>255){var ue=Ee>>18&31;kt(e,h,H[ue+257]),h+=$[ue+257],ue>7&&(rt(e,h,Ee>>23&31),h+=An[ue]);var ce=Ee&31;kt(e,h,oe[ce]),h+=te[ce],ce>3&&(kt(e,h,Ee>>5&8191),h+=cn[ce])}else kt(e,h,H[Ee]),h+=$[Ee]}return kt(e,h,H[256]),h+$[256]},Ya=new Vn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Xs=new xe(0),Ja=function(c,e,t,i,n,s){var o=s.z||c.length,r=new xe(i+o+5*(1+Math.ceil(o/7e3))+n),A=r.subarray(i,r.length-n),l=s.l,h=(s.r||0)&7;if(e){h&&(A[0]=s.r>>3);for(var p=Ya[e-1],u=p>>13,f=p&8191,b=(1<<t)-1,m=s.p||new qe(32768),E=s.h||new qe(b+1),B=Math.ceil(t/3),w=2*B,C=function(xt){return(c[xt]^c[xt+1]<<B^c[xt+2]<<w)&b},y=new Vn(25e3),Q=new qe(288),R=new qe(32),M=0,T=0,D=s.i||0,G=0,U=s.w||0,j=0;D+2<o;++D){var X=C(D),N=D&32767,V=E[X];if(m[N]=V,E[X]=N,U<=D){var H=o-D;if((M>7e3||G>24576)&&(H>423||!l)){h=Ii(c,A,0,y,Q,R,T,G,j,D-j,h),G=M=T=0,j=D;for(var $=0;$<286;++$)Q[$]=0;for(var $=0;$<30;++$)R[$]=0}var oe=2,te=0,le=f,ne=N-V&32767;if(H>2&&X==C(D-ne))for(var Z=Math.min(u,H)-1,se=Math.min(32767,D),ue=Math.min(258,H);ne<=se&&--le&&N!=V;){if(c[D+oe]==c[D+oe-ne]){for(var Ee=0;Ee<ue&&c[D+Ee]==c[D+Ee-ne];++Ee);if(Ee>oe){if(oe=Ee,te=ne,Ee>Z)break;for(var ce=Math.min(ne,Ee-2),Oe=0,$=0;$<ce;++$){var He=D-ne+$&32767,wt=m[He],Qt=He-wt&32767;Qt>Oe&&(Oe=Qt,V=He)}}}N=V,V=m[N],ne+=N-V&32767}if(te){y[G++]=268435456|Pn[oe]<<18|mi[te];var lt=Pn[oe]&31,bt=mi[te]&31;T+=An[lt]+cn[bt],++Q[257+lt],++R[bt],U=D+oe,++M}else y[G++]=c[D],++Q[c[D]]}}for(D=Math.max(D,U);D<o;++D)y[G++]=c[D],++Q[c[D]];h=Ii(c,A,l,y,Q,R,T,G,j,D-j,h),l||(s.r=h&7|A[h/8|0]<<3,h-=7,s.h=E,s.p=m,s.i=D,s.w=U)}else{for(var D=s.w||0;D<o+l;D+=65535){var ot=D+65535;ot>=o&&(A[h/8|0]=l,ot=o),h=Js(A,h+1,c.subarray(D,ot))}s.i=o}return Jn(r,0,i+Yn(h)+n)},Xa=(function(){for(var c=new Int32Array(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(t&1&&-306674912)^t>>>1;c[e]=t}return c})(),Wa=function(){var c=-1;return{p:function(e){for(var t=c,i=0;i<e.length;++i)t=Xa[t&255^e[i]]^t>>>8;c=t},d:function(){return~c}}},Za=function(c,e,t,i,n){if(!n&&(n={l:1},e.dictionary)){var s=e.dictionary.subarray(-32768),o=new xe(s.length+c.length);o.set(s),o.set(c,s.length),c=o,n.w=s.length}return Ja(c,e.level==null?6:e.level,e.mem==null?n.l?Math.ceil(Math.max(8,Math.min(13,Math.log(c.length)))*1.5):20:12+e.mem,t,i,n)},Ws=function(c,e){var t={};for(var i in c)t[i]=c[i];for(var i in e)t[i]=e[i];return t},Fe=function(c,e,t){for(;t;++e)c[e]=t,t>>>=8},$a=function(c,e){return((c[0]&15)!=8||c[0]>>4>7||(c[0]<<8|c[1])%31)&&Ne(6,"invalid zlib data"),(c[1]>>5&1)==1&&Ne(6,"invalid zlib data: "+(c[1]&32?"need":"unexpected")+" dictionary"),(c[1]>>3&4)+2};function er(c,e){return Za(c,e||{},0,0)}function Ot(c,e){return Va(c.subarray($a(c),-4),{i:2},e,e)}var Zs=function(c,e,t,i){for(var n in c){var s=c[n],o=e+n,r=i;Array.isArray(s)&&(r=Ws(i,s[1]),s=s[0]),s instanceof xe?t[o]=[s,r]:(t[o+="/"]=[new xe(0),r],Zs(s,o,t,i))}},Ci=typeof TextEncoder<"u"&&new TextEncoder,tr=typeof TextDecoder<"u"&&new TextDecoder,nr=0;try{tr.decode(Xs,{stream:!0}),nr=1}catch{}function Hn(c,e){var t;if(Ci)return Ci.encode(c);for(var i=c.length,n=new xe(c.length+(c.length>>1)),s=0,o=function(l){n[s++]=l},t=0;t<i;++t){if(s+5>n.length){var r=new xe(s+8+(i-t<<1));r.set(n),n=r}var A=c.charCodeAt(t);A<128||e?o(A):A<2048?(o(192|A>>6),o(128|A&63)):A>55295&&A<57344?(A=65536+(A&1047552)|c.charCodeAt(++t)&1023,o(240|A>>18),o(128|A>>12&63),o(128|A>>6&63),o(128|A&63)):(o(224|A>>12),o(128|A>>6&63),o(128|A&63))}return Jn(n,0,s)}var jn=function(c){var e=0;if(c)for(var t in c){var i=c[t].length;i>65535&&Ne(9),e+=i+4}return e},Bi=function(c,e,t,i,n,s,o,r){var A=i.length,l=t.extra,h=r&&r.length,p=jn(l);Fe(c,e,o!=null?33639248:67324752),e+=4,o!=null&&(c[e++]=20,c[e++]=t.os),c[e]=20,e+=2,c[e++]=t.flag<<1|(s<0&&8),c[e++]=n&&8,c[e++]=t.compression&255,c[e++]=t.compression>>8;var u=new Date(t.mtime==null?Date.now():t.mtime),f=u.getFullYear()-1980;if((f<0||f>119)&&Ne(10),Fe(c,e,f<<25|u.getMonth()+1<<21|u.getDate()<<16|u.getHours()<<11|u.getMinutes()<<5|u.getSeconds()>>1),e+=4,s!=-1&&(Fe(c,e,t.crc),Fe(c,e+4,s<0?-s-2:s),Fe(c,e+8,t.size)),Fe(c,e+12,A),Fe(c,e+14,p),e+=16,o!=null&&(Fe(c,e,h),Fe(c,e+6,t.attrs),Fe(c,e+10,o),e+=14),c.set(i,e),e+=A,p)for(var b in l){var m=l[b],E=m.length;Fe(c,e,+b),Fe(c,e+2,E),c.set(m,e+4),e+=4+E}return h&&(c.set(r,e),e+=h),e},ir=function(c,e,t,i,n){Fe(c,e,101010256),Fe(c,e+8,t),Fe(c,e+10,t),Fe(c,e+12,i),Fe(c,e+16,n)};function sr(c,e){e||(e={});var t={},i=[];Zs(c,"",t,e);var n=0,s=0;for(var o in t){var r=t[o],A=r[0],l=r[1],h=l.level==0?0:8,p=Hn(o),u=p.length,f=l.comment,b=f&&Hn(f),m=b&&b.length,E=jn(l.extra);u>65535&&Ne(11);var B=h?er(A,l):A,w=B.length,C=Wa();C.p(A),i.push(Ws(l,{size:A.length,crc:C.d(),c:B,f:p,m:b,u:u!=o.length||b&&f.length!=m,o:n,compression:h})),n+=30+u+E+w,s+=76+2*(u+E)+(m||0)+w}for(var y=new xe(s+22),Q=n,R=s-n,M=0;M<i.length;++M){var p=i[M];Bi(y,p.o,p,p.f,p.u,p.c.length);var T=30+p.f.length+jn(p.extra);y.set(p.c,p.o+T),Bi(y,n,p,p.f,p.u,p.c.length,p.o,p.m),n+=16+T+(p.m?p.m.length:0)}return ir(y,n,i.length,R,Q),y}class or extends a.DataTextureLoader{constructor(e){super(e),this.type=a.HalfFloatType,this.outputFormat=a.RGBAFormat}parse(e){const D=Math.pow(2.7182818,2.2);function G(g,d){let I=0;for(let v=0;v<65536;++v)(v==0||g[v>>3]&1<<(v&7))&&(d[I++]=v);const S=I-1;for(;I<65536;)d[I++]=0;return S}function U(g){for(let d=0;d<16384;d++)g[d]={},g[d].len=0,g[d].lit=0,g[d].p=null}const j={l:0,c:0,lc:0};function X(g,d,I,S,v){for(;I<g;)d=d<<8|si(S,v),I+=8;I-=g,j.l=d>>I&(1<<g)-1,j.c=d,j.lc=I}const N=new Array(59);function V(g){for(let I=0;I<=58;++I)N[I]=0;for(let I=0;I<65537;++I)N[g[I]]+=1;let d=0;for(let I=58;I>0;--I){const S=d+N[I]>>1;N[I]=d,d=S}for(let I=0;I<65537;++I){const S=g[I];S>0&&(g[I]=S|N[S]++<<6)}}function H(g,d,I,S,v,L){const x=d;let P=0,_=0;for(;S<=v;S++){if(x.value-d.value>I)return!1;X(6,P,_,g,x);const F=j.l;if(P=j.c,_=j.lc,L[S]=F,F==63){if(x.value-d.value>I)throw new Error("Something wrong with hufUnpackEncTable");X(8,P,_,g,x);let k=j.l+6;if(P=j.c,_=j.lc,S+k>v+1)throw new Error("Something wrong with hufUnpackEncTable");for(;k--;)L[S++]=0;S--}else if(F>=59){let k=F-59+2;if(S+k>v+1)throw new Error("Something wrong with hufUnpackEncTable");for(;k--;)L[S++]=0;S--}}V(L)}function $(g){return g&63}function oe(g){return g>>6}function te(g,d,I,S){for(;d<=I;d++){const v=oe(g[d]),L=$(g[d]);if(v>>L)throw new Error("Invalid table entry");if(L>14){const x=S[v>>L-14];if(x.len)throw new Error("Invalid table entry");if(x.lit++,x.p){const P=x.p;x.p=new Array(x.lit);for(let _=0;_<x.lit-1;++_)x.p[_]=P[_]}else x.p=new Array(1);x.p[x.lit-1]=d}else if(L){let x=0;for(let P=1<<14-L;P>0;P--){const _=S[(v<<14-L)+x];if(_.len||_.p)throw new Error("Invalid table entry");_.len=L,_.lit=d,x++}}}return!0}const le={c:0,lc:0};function ne(g,d,I,S){g=g<<8|si(I,S),d+=8,le.c=g,le.lc=d}const Z={c:0,lc:0};function se(g,d,I,S,v,L,x,P,_){if(g==d){S<8&&(ne(I,S,v,L),I=le.c,S=le.lc),S-=8;let F=I>>S;if(F=new Uint8Array([F])[0],P.value+F>_)return!1;const k=x[P.value-1];for(;F-- >0;)x[P.value++]=k}else if(P.value<_)x[P.value++]=g;else return!1;Z.c=I,Z.lc=S}function ue(g){return g&65535}function Ee(g){const d=ue(g);return d>32767?d-65536:d}const ce={a:0,b:0};function Oe(g,d){const I=Ee(g),v=Ee(d),L=I+(v&1)+(v>>1),x=L,P=L-v;ce.a=x,ce.b=P}function He(g,d){const I=ue(g),S=ue(d),v=I-(S>>1)&65535,L=S+v-32768&65535;ce.a=L,ce.b=v}function wt(g,d,I,S,v,L,x){const P=x<16384,_=I>v?v:I;let F=1,k,q;for(;F<=_;)F<<=1;for(F>>=1,k=F,F>>=1;F>=1;){q=0;const O=q+L*(v-k),z=L*F,W=L*k,K=S*F,J=S*k;let ee,pe,de,Te;for(;q<=O;q+=W){let fe=q;const ie=q+S*(I-k);for(;fe<=ie;fe+=J){const ye=fe+K,De=fe+z,Ie=De+K;P?(Oe(g[fe+d],g[De+d]),ee=ce.a,de=ce.b,Oe(g[ye+d],g[Ie+d]),pe=ce.a,Te=ce.b,Oe(ee,pe),g[fe+d]=ce.a,g[ye+d]=ce.b,Oe(de,Te),g[De+d]=ce.a,g[Ie+d]=ce.b):(He(g[fe+d],g[De+d]),ee=ce.a,de=ce.b,He(g[ye+d],g[Ie+d]),pe=ce.a,Te=ce.b,He(ee,pe),g[fe+d]=ce.a,g[ye+d]=ce.b,He(de,Te),g[De+d]=ce.a,g[Ie+d]=ce.b)}if(I&F){const ye=fe+z;P?Oe(g[fe+d],g[ye+d]):He(g[fe+d],g[ye+d]),ee=ce.a,g[ye+d]=ce.b,g[fe+d]=ee}}if(v&F){let fe=q;const ie=q+S*(I-k);for(;fe<=ie;fe+=J){const ye=fe+K;P?Oe(g[fe+d],g[ye+d]):He(g[fe+d],g[ye+d]),ee=ce.a,g[ye+d]=ce.b,g[fe+d]=ee}}k=F,F>>=1}return q}function Qt(g,d,I,S,v,L,x,P,_){let F=0,k=0;const q=x,O=Math.trunc(S.value+(v+7)/8);for(;S.value<O;)for(ne(F,k,I,S),F=le.c,k=le.lc;k>=14;){const W=F>>k-14&16383,K=d[W];if(K.len)k-=K.len,se(K.lit,L,F,k,I,S,P,_,q),F=Z.c,k=Z.lc;else{if(!K.p)throw new Error("hufDecode issues");let J;for(J=0;J<K.lit;J++){const ee=$(g[K.p[J]]);for(;k<ee&&S.value<O;)ne(F,k,I,S),F=le.c,k=le.lc;if(k>=ee&&oe(g[K.p[J]])==(F>>k-ee&(1<<ee)-1)){k-=ee,se(K.p[J],L,F,k,I,S,P,_,q),F=Z.c,k=Z.lc;break}}if(J==K.lit)throw new Error("hufDecode issues")}}const z=8-v&7;for(F>>=z,k-=z;k>0;){const W=d[F<<14-k&16383];if(W.len)k-=W.len,se(W.lit,L,F,k,I,S,P,_,q),F=Z.c,k=Z.lc;else throw new Error("hufDecode issues")}return!0}function lt(g,d,I,S,v,L){const x={value:0},P=I.value,_=Ve(d,I),F=Ve(d,I);I.value+=4;const k=Ve(d,I);if(I.value+=4,_<0||_>=65537||F<0||F>=65537)throw new Error("Something wrong with HUF_ENCSIZE");const q=new Array(65537),O=new Array(16384);U(O);const z=S-(I.value-P);if(H(g,I,z,_,F,q),k>8*(S-(I.value-P)))throw new Error("Something wrong with hufUncompress");te(q,_,F,O),Qt(q,O,g,I,k,F,L,v,x)}function bt(g,d,I){for(let S=0;S<I;++S)d[S]=g[d[S]]}function ot(g){for(let d=1;d<g.length;d++){const I=g[d-1]+g[d]-128;g[d]=I}}function xt(g,d){let I=0,S=Math.floor((g.length+1)/2),v=0;const L=g.length-1;for(;!(v>L||(d[v++]=g[I++],v>L));)d[v++]=g[S++]}function Zn(g){let d=g.byteLength;const I=new Array;let S=0;const v=new DataView(g);for(;d>0;){const L=v.getInt8(S++);if(L<0){const x=-L;d-=x+1;for(let P=0;P<x;P++)I.push(v.getUint8(S++))}else{const x=L;d-=2;const P=v.getUint8(S++);for(let _=0;_<x+1;_++)I.push(P)}}return I}function co(g,d,I,S,v,L){let x=new DataView(L.buffer);const P=I[g.idx[0]].width,_=I[g.idx[0]].height,F=3,k=Math.floor(P/8),q=Math.ceil(P/8),O=Math.ceil(_/8),z=P-(q-1)*8,W=_-(O-1)*8,K={value:0},J=new Array(F),ee=new Array(F),pe=new Array(F),de=new Array(F),Te=new Array(F);for(let ie=0;ie<F;++ie)Te[ie]=d[g.idx[ie]],J[ie]=ie<1?0:J[ie-1]+q*O,ee[ie]=new Float32Array(64),pe[ie]=new Uint16Array(64),de[ie]=new Uint16Array(q*64);for(let ie=0;ie<O;++ie){let ye=8;ie==O-1&&(ye=W);let De=8;for(let he=0;he<q;++he){he==q-1&&(De=z);for(let me=0;me<F;++me)pe[me].fill(0),pe[me][0]=v[J[me]++],$n(K,S,pe[me]),ei(pe[me],ee[me]),ti(ee[me]);ho(ee);for(let me=0;me<F;++me)ni(ee[me],de[me],he*64)}let Ie=0;for(let he=0;he<F;++he){const me=I[g.idx[he]].type;for(let at=8*ie;at<8*ie+ye;++at){Ie=Te[he][at];for(let Mt=0;Mt<k;++Mt){const Ze=Mt*64+(at&7)*8;x.setUint16(Ie+0*me,de[he][Ze+0],!0),x.setUint16(Ie+2*me,de[he][Ze+1],!0),x.setUint16(Ie+4*me,de[he][Ze+2],!0),x.setUint16(Ie+6*me,de[he][Ze+3],!0),x.setUint16(Ie+8*me,de[he][Ze+4],!0),x.setUint16(Ie+10*me,de[he][Ze+5],!0),x.setUint16(Ie+12*me,de[he][Ze+6],!0),x.setUint16(Ie+14*me,de[he][Ze+7],!0),Ie+=16*me}}if(k!=q)for(let at=8*ie;at<8*ie+ye;++at){const Mt=Te[he][at]+8*k*2*me,Ze=k*64+(at&7)*8;for(let Jt=0;Jt<De;++Jt)x.setUint16(Mt+Jt*2*me,de[he][Ze+Jt],!0)}}}const fe=new Uint16Array(P);x=new DataView(L.buffer);for(let ie=0;ie<F;++ie){I[g.idx[ie]].decoded=!0;const ye=I[g.idx[ie]].type;if(I[ie].type==2)for(let De=0;De<_;++De){const Ie=Te[ie][De];for(let he=0;he<P;++he)fe[he]=x.getUint16(Ie+he*2*ye,!0);for(let he=0;he<P;++he)x.setFloat32(Ie+he*2*ye,Y(fe[he]),!0)}}}function lo(g,d,I,S,v,L){const x=new DataView(L.buffer),P=I[g],_=P.width,F=P.height,k=Math.ceil(_/8),q=Math.ceil(F/8),O=Math.floor(_/8),z=_-(k-1)*8,W=F-(q-1)*8,K={value:0};let J=0;const ee=new Float32Array(64),pe=new Uint16Array(64),de=new Uint16Array(k*64);for(let Te=0;Te<q;++Te){let fe=8;Te==q-1&&(fe=W);for(let ie=0;ie<k;++ie)pe.fill(0),pe[0]=v[J++],$n(K,S,pe),ei(pe,ee),ti(ee),ni(ee,de,ie*64);for(let ie=8*Te;ie<8*Te+fe;++ie){let ye=d[g][ie];for(let De=0;De<O;++De){const Ie=De*64+(ie&7)*8;for(let he=0;he<8;++he)x.setUint16(ye+he*2*P.type,de[Ie+he],!0);ye+=16*P.type}if(k!=O){const De=O*64+(ie&7)*8;for(let Ie=0;Ie<z;++Ie)x.setUint16(ye+Ie*2*P.type,de[De+Ie],!0)}}}P.decoded=!0}function $n(g,d,I){let S,v=1;for(;v<64;)S=d[g.value],S==65280?v=64:S>>8==255?v+=S&255:(I[v]=S,v++),g.value++}function ei(g,d){d[0]=Y(g[0]),d[1]=Y(g[1]),d[2]=Y(g[5]),d[3]=Y(g[6]),d[4]=Y(g[14]),d[5]=Y(g[15]),d[6]=Y(g[27]),d[7]=Y(g[28]),d[8]=Y(g[2]),d[9]=Y(g[4]),d[10]=Y(g[7]),d[11]=Y(g[13]),d[12]=Y(g[16]),d[13]=Y(g[26]),d[14]=Y(g[29]),d[15]=Y(g[42]),d[16]=Y(g[3]),d[17]=Y(g[8]),d[18]=Y(g[12]),d[19]=Y(g[17]),d[20]=Y(g[25]),d[21]=Y(g[30]),d[22]=Y(g[41]),d[23]=Y(g[43]),d[24]=Y(g[9]),d[25]=Y(g[11]),d[26]=Y(g[18]),d[27]=Y(g[24]),d[28]=Y(g[31]),d[29]=Y(g[40]),d[30]=Y(g[44]),d[31]=Y(g[53]),d[32]=Y(g[10]),d[33]=Y(g[19]),d[34]=Y(g[23]),d[35]=Y(g[32]),d[36]=Y(g[39]),d[37]=Y(g[45]),d[38]=Y(g[52]),d[39]=Y(g[54]),d[40]=Y(g[20]),d[41]=Y(g[22]),d[42]=Y(g[33]),d[43]=Y(g[38]),d[44]=Y(g[46]),d[45]=Y(g[51]),d[46]=Y(g[55]),d[47]=Y(g[60]),d[48]=Y(g[21]),d[49]=Y(g[34]),d[50]=Y(g[37]),d[51]=Y(g[47]),d[52]=Y(g[50]),d[53]=Y(g[56]),d[54]=Y(g[59]),d[55]=Y(g[61]),d[56]=Y(g[35]),d[57]=Y(g[36]),d[58]=Y(g[48]),d[59]=Y(g[49]),d[60]=Y(g[57]),d[61]=Y(g[58]),d[62]=Y(g[62]),d[63]=Y(g[63])}function ti(g){const d=.5*Math.cos(.7853975),I=.5*Math.cos(3.14159/16),S=.5*Math.cos(3.14159/8),v=.5*Math.cos(3*3.14159/16),L=.5*Math.cos(5*3.14159/16),x=.5*Math.cos(3*3.14159/8),P=.5*Math.cos(7*3.14159/16),_=new Array(4),F=new Array(4),k=new Array(4),q=new Array(4);for(let O=0;O<8;++O){const z=O*8;_[0]=S*g[z+2],_[1]=x*g[z+2],_[2]=S*g[z+6],_[3]=x*g[z+6],F[0]=I*g[z+1]+v*g[z+3]+L*g[z+5]+P*g[z+7],F[1]=v*g[z+1]-P*g[z+3]-I*g[z+5]-L*g[z+7],F[2]=L*g[z+1]-I*g[z+3]+P*g[z+5]+v*g[z+7],F[3]=P*g[z+1]-L*g[z+3]+v*g[z+5]-I*g[z+7],k[0]=d*(g[z+0]+g[z+4]),k[3]=d*(g[z+0]-g[z+4]),k[1]=_[0]+_[3],k[2]=_[1]-_[2],q[0]=k[0]+k[1],q[1]=k[3]+k[2],q[2]=k[3]-k[2],q[3]=k[0]-k[1],g[z+0]=q[0]+F[0],g[z+1]=q[1]+F[1],g[z+2]=q[2]+F[2],g[z+3]=q[3]+F[3],g[z+4]=q[3]-F[3],g[z+5]=q[2]-F[2],g[z+6]=q[1]-F[1],g[z+7]=q[0]-F[0]}for(let O=0;O<8;++O)_[0]=S*g[16+O],_[1]=x*g[16+O],_[2]=S*g[48+O],_[3]=x*g[48+O],F[0]=I*g[8+O]+v*g[24+O]+L*g[40+O]+P*g[56+O],F[1]=v*g[8+O]-P*g[24+O]-I*g[40+O]-L*g[56+O],F[2]=L*g[8+O]-I*g[24+O]+P*g[40+O]+v*g[56+O],F[3]=P*g[8+O]-L*g[24+O]+v*g[40+O]-I*g[56+O],k[0]=d*(g[O]+g[32+O]),k[3]=d*(g[O]-g[32+O]),k[1]=_[0]+_[3],k[2]=_[1]-_[2],q[0]=k[0]+k[1],q[1]=k[3]+k[2],q[2]=k[3]-k[2],q[3]=k[0]-k[1],g[0+O]=q[0]+F[0],g[8+O]=q[1]+F[1],g[16+O]=q[2]+F[2],g[24+O]=q[3]+F[3],g[32+O]=q[3]-F[3],g[40+O]=q[2]-F[2],g[48+O]=q[1]-F[1],g[56+O]=q[0]-F[0]}function ho(g){for(let d=0;d<64;++d){const I=g[0][d],S=g[1][d],v=g[2][d];g[0][d]=I+1.5747*v,g[1][d]=I-.1873*S-.4682*v,g[2][d]=I+1.8556*S}}function ni(g,d,I){for(let S=0;S<64;++S)d[I+S]=a.DataUtils.toHalfFloat(po(g[S]))}function po(g){return g<=1?Math.sign(g)*Math.pow(Math.abs(g),2.2):Math.sign(g)*Math.pow(D,Math.abs(g)-1)}function ln(g){return new DataView(g.array.buffer,g.offset.value,g.size)}function go(g){const d=g.viewer.buffer.slice(g.offset.value,g.offset.value+g.size),I=new Uint8Array(Zn(d)),S=new Uint8Array(I.length);return ot(I),xt(I,S),new DataView(S.buffer)}function hn(g){const d=g.array.slice(g.offset.value,g.offset.value+g.size),I=Ot(d),S=new Uint8Array(I.length);return ot(I),xt(I,S),new DataView(S.buffer)}function uo(g){const d=g.viewer,I={value:g.offset.value},S=new Uint16Array(g.columns*g.lines*(g.inputChannels.length*g.type)),v=new Uint8Array(8192);let L=0;const x=new Array(g.inputChannels.length);for(let W=0,K=g.inputChannels.length;W<K;W++)x[W]={},x[W].start=L,x[W].end=x[W].start,x[W].nx=g.columns,x[W].ny=g.lines,x[W].size=g.type,L+=x[W].nx*x[W].ny*x[W].size;const P=Rt(d,I),_=Rt(d,I);if(_>=8192)throw new Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(P<=_)for(let W=0;W<_-P+1;W++)v[W+P]=ht(d,I);const F=new Uint16Array(65536),k=G(v,F),q=Ve(d,I);lt(g.array,d,I,q,S,L);for(let W=0;W<g.inputChannels.length;++W){const K=x[W];for(let J=0;J<x[W].size;++J)wt(S,K.start+J,K.nx,K.size,K.ny,K.nx*K.size,k)}bt(F,S,L);let O=0;const z=new Uint8Array(S.buffer.byteLength);for(let W=0;W<g.lines;W++)for(let K=0;K<g.inputChannels.length;K++){const J=x[K],ee=J.nx*J.size,pe=new Uint8Array(S.buffer,J.end*2,ee*2);z.set(pe,O),O+=ee*2,J.end+=ee}return new DataView(z.buffer)}function fo(g){const d=g.array.slice(g.offset.value,g.offset.value+g.size),I=Ot(d),S=g.inputChannels.length*g.lines*g.columns*g.totalBytes,v=new ArrayBuffer(S),L=new DataView(v);let x=0,P=0;const _=new Array(4);for(let F=0;F<g.lines;F++)for(let k=0;k<g.inputChannels.length;k++){let q=0;switch(g.inputChannels[k].pixelType){case 1:_[0]=x,_[1]=_[0]+g.columns,x=_[1]+g.columns;for(let z=0;z<g.columns;++z){const W=I[_[0]++]<<8|I[_[1]++];q+=W,L.setUint16(P,q,!0),P+=2}break;case 2:_[0]=x,_[1]=_[0]+g.columns,_[2]=_[1]+g.columns,x=_[2]+g.columns;for(let z=0;z<g.columns;++z){const W=I[_[0]++]<<24|I[_[1]++]<<16|I[_[2]++]<<8;q+=W,L.setUint32(P,q,!0),P+=4}break}}return L}function ii(g){const d=g.viewer,I={value:g.offset.value},S=new Uint8Array(g.columns*g.lines*(g.inputChannels.length*g.type*2)),v={version:je(d,I),unknownUncompressedSize:je(d,I),unknownCompressedSize:je(d,I),acCompressedSize:je(d,I),dcCompressedSize:je(d,I),rleCompressedSize:je(d,I),rleUncompressedSize:je(d,I),rleRawSize:je(d,I),totalAcUncompressedCount:je(d,I),totalDcUncompressedCount:je(d,I),acCompression:je(d,I)};if(v.version<2)throw new Error("EXRLoader.parse: "+mt.compression+" version "+v.version+" is unsupported");const L=new Array;let x=Rt(d,I)-2;for(;x>0;){const K=Yt(d.buffer,I),J=ht(d,I),ee=J>>2&3,pe=(J>>4)-1,de=new Int8Array([pe])[0],Te=ht(d,I);L.push({name:K,index:de,type:Te,compression:ee}),x-=K.length+3}const P=mt.channels,_=new Array(g.inputChannels.length);for(let K=0;K<g.inputChannels.length;++K){const J=_[K]={},ee=P[K];J.name=ee.name,J.compression=0,J.decoded=!1,J.type=ee.pixelType,J.pLinear=ee.pLinear,J.width=g.columns,J.height=g.lines}const F={idx:new Array(3)};for(let K=0;K<g.inputChannels.length;++K){const J=_[K];for(let ee=0;ee<L.length;++ee){const pe=L[ee];J.name==pe.name&&(J.compression=pe.compression,pe.index>=0&&(F.idx[pe.index]=K),J.offset=K)}}let k,q,O;if(v.acCompressedSize>0)switch(v.acCompression){case 0:k=new Uint16Array(v.totalAcUncompressedCount),lt(g.array,d,I,v.acCompressedSize,k,v.totalAcUncompressedCount);break;case 1:const K=g.array.slice(I.value,I.value+v.totalAcUncompressedCount),J=Ot(K);k=new Uint16Array(J.buffer),I.value+=v.totalAcUncompressedCount;break}if(v.dcCompressedSize>0){const K={array:g.array,offset:I,size:v.dcCompressedSize};q=new Uint16Array(hn(K).buffer),I.value+=v.dcCompressedSize}if(v.rleRawSize>0){const K=g.array.slice(I.value,I.value+v.rleCompressedSize),J=Ot(K);O=Zn(J.buffer),I.value+=v.rleCompressedSize}let z=0;const W=new Array(_.length);for(let K=0;K<W.length;++K)W[K]=new Array;for(let K=0;K<g.lines;++K)for(let J=0;J<_.length;++J)W[J].push(z),z+=_[J].width*g.type*2;F.idx[0]!==void 0&&_[F.idx[0]]&&co(F,W,_,k,q,S);for(let K=0;K<_.length;++K){const J=_[K];if(!J.decoded)switch(J.compression){case 2:let ee=0,pe=0;for(let de=0;de<g.lines;++de){let Te=W[K][ee];for(let fe=0;fe<J.width;++fe){for(let ie=0;ie<2*J.type;++ie)S[Te++]=O[pe+ie*J.width*J.height];pe++}ee++}break;case 1:lo(K,W,_,k,q,S);break;default:throw new Error("EXRLoader.parse: unsupported channel compression")}}return new DataView(S.buffer)}function Yt(g,d){const I=new Uint8Array(g);let S=0;for(;I[d.value+S]!=0;)S+=1;const v=new TextDecoder().decode(I.slice(d.value,d.value+S));return d.value=d.value+S+1,v}function bo(g,d,I){const S=new TextDecoder().decode(new Uint8Array(g).slice(d.value,d.value+I));return d.value=d.value+I,S}function mo(g,d){const I=ze(g,d),S=Ve(g,d);return[I,S]}function Eo(g,d){const I=Ve(g,d),S=Ve(g,d);return[I,S]}function ze(g,d){const I=g.getInt32(d.value,!0);return d.value=d.value+4,I}function Ve(g,d){const I=g.getUint32(d.value,!0);return d.value=d.value+4,I}function si(g,d){const I=g[d.value];return d.value=d.value+1,I}function ht(g,d){const I=g.getUint8(d.value);return d.value=d.value+1,I}const je=function(g,d){let I;return"getBigInt64"in DataView.prototype?I=Number(g.getBigInt64(d.value,!0)):I=g.getUint32(d.value+4,!0)+Number(g.getUint32(d.value,!0)<<32),d.value+=8,I};function ke(g,d){const I=g.getFloat32(d.value,!0);return d.value+=4,I}function Io(g,d){return a.DataUtils.toHalfFloat(ke(g,d))}function Y(g){const d=(g&31744)>>10,I=g&1023;return(g>>15?-1:1)*(d?d===31?I?NaN:1/0:Math.pow(2,d-15)*(1+I/1024):6103515625e-14*(I/1024))}function Rt(g,d){const I=g.getUint16(d.value,!0);return d.value+=2,I}function Co(g,d){return Y(Rt(g,d))}function Bo(g,d,I,S){const v=I.value,L=[];for(;I.value<v+S-1;){const x=Yt(d,I),P=ze(g,I),_=ht(g,I);I.value+=3;const F=ze(g,I),k=ze(g,I);L.push({name:x,pixelType:P,pLinear:_,xSampling:F,ySampling:k})}return I.value+=1,L}function yo(g,d){const I=ke(g,d),S=ke(g,d),v=ke(g,d),L=ke(g,d),x=ke(g,d),P=ke(g,d),_=ke(g,d),F=ke(g,d);return{redX:I,redY:S,greenX:v,greenY:L,blueX:x,blueY:P,whiteX:_,whiteY:F}}function wo(g,d){const I=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],S=ht(g,d);return I[S]}function Qo(g,d){const I=ze(g,d),S=ze(g,d),v=ze(g,d),L=ze(g,d);return{xMin:I,yMin:S,xMax:v,yMax:L}}function xo(g,d){const I=["INCREASING_Y","DECREASING_Y","RANDOM_Y"],S=ht(g,d);return I[S]}function So(g,d){const I=["ENVMAP_LATLONG","ENVMAP_CUBE"],S=ht(g,d);return I[S]}function To(g,d){const I=["ONE_LEVEL","MIPMAP_LEVELS","RIPMAP_LEVELS"],S=["ROUND_DOWN","ROUND_UP"],v=Ve(g,d),L=Ve(g,d),x=ht(g,d);return{xSize:v,ySize:L,levelMode:I[x&15],roundingMode:S[x>>4]}}function vo(g,d){const I=ke(g,d),S=ke(g,d);return[I,S]}function Do(g,d){const I=ke(g,d),S=ke(g,d),v=ke(g,d);return[I,S,v]}function Ro(g,d,I,S,v){if(S==="string"||S==="stringvector"||S==="iccProfile")return bo(d,I,v);if(S==="chlist")return Bo(g,d,I,v);if(S==="chromaticities")return yo(g,I);if(S==="compression")return wo(g,I);if(S==="box2i")return Qo(g,I);if(S==="envmap")return So(g,I);if(S==="tiledesc")return To(g,I);if(S==="lineOrder")return xo(g,I);if(S==="float")return ke(g,I);if(S==="v2f")return vo(g,I);if(S==="v3f")return Do(g,I);if(S==="int")return ze(g,I);if(S==="rational")return mo(g,I);if(S==="timecode")return Eo(g,I);if(S==="preview")return I.value+=v,"skipped";I.value+=v}function Mo(g,d){const I=Math.log2(g);return d=="ROUND_DOWN"?Math.floor(I):Math.ceil(I)}function Fo(g,d,I){let S=0;switch(g.levelMode){case"ONE_LEVEL":S=1;break;case"MIPMAP_LEVELS":S=Mo(Math.max(d,I),g.roundingMode)+1;break;case"RIPMAP_LEVELS":throw new Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.")}return S}function oi(g,d,I,S){const v=new Array(g);for(let L=0;L<g;L++){const x=1<<L;let P=d/x|0;S=="ROUND_UP"&&P*x<d&&(P+=1);const _=Math.max(P,1);v[L]=(_+I-1)/I|0}return v}function _o(){const g=this,d=g.offset,I={value:0};for(let S=0;S<g.tileCount;S++){const v=ze(g.viewer,d),L=ze(g.viewer,d);d.value+=8,g.size=Ve(g.viewer,d);const x=v*g.blockWidth,P=L*g.blockHeight;g.columns=x+g.blockWidth>g.width?g.width-x:g.blockWidth,g.lines=P+g.blockHeight>g.height?g.height-P:g.blockHeight;const _=g.columns*g.totalBytes,k=g.size<g.lines*_?g.uncompress(g):ln(g);d.value+=g.size;for(let q=0;q<g.lines;q++){const O=q*g.columns*g.totalBytes;for(let z=0;z<g.inputChannels.length;z++){const W=mt.channels[z].name,K=g.channelByteOffsets[W]*g.columns,J=g.decodeChannels[W];if(J===void 0)continue;I.value=O+K;const ee=(g.height-(1+P+q))*g.outLineWidth;for(let pe=0;pe<g.columns;pe++){const de=ee+(pe+x)*g.outputChannels+J;g.byteArray[de]=g.getter(k,I)}}}}}function ko(){const g=this,d=g.offset,I={value:0};for(let S=0;S<g.height/g.blockHeight;S++){const v=ze(g.viewer,d)-mt.dataWindow.yMin;g.size=Ve(g.viewer,d),g.lines=v+g.blockHeight>g.height?g.height-v:g.blockHeight;const L=g.columns*g.totalBytes,P=g.size<g.lines*L?g.uncompress(g):ln(g);d.value+=g.size;for(let _=0;_<g.blockHeight;_++){const F=S*g.blockHeight,k=_+g.scanOrder(F);if(k>=g.height)continue;const q=_*L,O=(g.height-1-k)*g.outLineWidth;for(let z=0;z<g.inputChannels.length;z++){const W=mt.channels[z].name,K=g.channelByteOffsets[W]*g.columns,J=g.decodeChannels[W];if(J!==void 0){I.value=q+K;for(let ee=0;ee<g.columns;ee++){const pe=O+ee*g.outputChannels+J;g.byteArray[pe]=g.getter(P,I)}}}}}}function Lo(g,d,I){const S={};if(g.getUint32(0,!0)!=20000630)throw new Error("THREE.EXRLoader: Provided file doesn't appear to be in OpenEXR format.");S.version=g.getUint8(4);const v=g.getUint8(5);S.spec={singleTile:!!(v&2),longName:!!(v&4),deepFormat:!!(v&8),multiPart:!!(v&16)},I.value=8;let L=!0;for(;L;){const x=Yt(d,I);if(x==="")L=!1;else{const P=Yt(d,I),_=Ve(g,I),F=Ro(g,d,I,P,_);F===void 0?console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${P}'.`):S[x]=F}}if((v&-7)!=0)throw console.error("THREE.EXRHeader:",S),new Error("THREE.EXRLoader: Provided file is currently unsupported.");return S}function Go(g,d,I,S,v,L){const x={size:0,viewer:d,array:I,offset:S,width:g.dataWindow.xMax-g.dataWindow.xMin+1,height:g.dataWindow.yMax-g.dataWindow.yMin+1,inputChannels:g.channels,channelByteOffsets:{},shouldExpand:!1,scanOrder:null,totalBytes:null,columns:null,lines:null,type:null,uncompress:null,getter:null,format:null,colorSpace:a.LinearSRGBColorSpace};switch(g.compression){case"NO_COMPRESSION":x.blockHeight=1,x.uncompress=ln;break;case"RLE_COMPRESSION":x.blockHeight=1,x.uncompress=go;break;case"ZIPS_COMPRESSION":x.blockHeight=1,x.uncompress=hn;break;case"ZIP_COMPRESSION":x.blockHeight=16,x.uncompress=hn;break;case"PIZ_COMPRESSION":x.blockHeight=32,x.uncompress=uo;break;case"PXR24_COMPRESSION":x.blockHeight=16,x.uncompress=fo;break;case"DWAA_COMPRESSION":x.blockHeight=32,x.uncompress=ii;break;case"DWAB_COMPRESSION":x.blockHeight=256,x.uncompress=ii;break;default:throw new Error("EXRLoader.parse: "+g.compression+" is unsupported")}const P={};for(const O of g.channels)switch(O.name){case"Y":case"R":case"G":case"B":case"A":P[O.name]=!0,x.type=O.pixelType}let _=!1,F=!1;if(P.R&&P.G&&P.B)x.outputChannels=4;else if(P.Y)x.outputChannels=1;else throw new Error("EXRLoader.parse: file contains unsupported data channels.");switch(x.outputChannels){case 4:L==a.RGBAFormat?(_=!P.A,x.format=a.RGBAFormat,x.colorSpace=a.LinearSRGBColorSpace,x.outputChannels=4,x.decodeChannels={R:0,G:1,B:2,A:3}):L==a.RGFormat?(x.format=a.RGFormat,x.colorSpace=a.LinearSRGBColorSpace,x.outputChannels=2,x.decodeChannels={R:0,G:1}):L==a.RedFormat?(x.format=a.RedFormat,x.colorSpace=a.LinearSRGBColorSpace,x.outputChannels=1,x.decodeChannels={R:0}):F=!0;break;case 1:L==a.RGBAFormat?(_=!0,x.format=a.RGBAFormat,x.colorSpace=a.LinearSRGBColorSpace,x.outputChannels=4,x.shouldExpand=!0,x.decodeChannels={Y:0}):L==a.RGFormat?(x.format=a.RGFormat,x.colorSpace=a.LinearSRGBColorSpace,x.outputChannels=2,x.shouldExpand=!0,x.decodeChannels={Y:0}):L==a.RedFormat?(x.format=a.RedFormat,x.colorSpace=a.LinearSRGBColorSpace,x.outputChannels=1,x.decodeChannels={Y:0}):F=!0;break;default:F=!0}if(F)throw new Error("EXRLoader.parse: invalid output format for specified file.");if(x.type==1)switch(v){case a.FloatType:x.getter=Co;break;case a.HalfFloatType:x.getter=Rt;break}else if(x.type==2)switch(v){case a.FloatType:x.getter=ke;break;case a.HalfFloatType:x.getter=Io}else throw new Error("EXRLoader.parse: unsupported pixelType "+x.type+" for "+g.compression+".");x.columns=x.width;const k=x.width*x.height*x.outputChannels;switch(v){case a.FloatType:x.byteArray=new Float32Array(k),_&&x.byteArray.fill(1,0,k);break;case a.HalfFloatType:x.byteArray=new Uint16Array(k),_&&x.byteArray.fill(15360,0,k);break;default:console.error("THREE.EXRLoader: unsupported type: ",v);break}let q=0;for(const O of g.channels)x.decodeChannels[O.name]!==void 0&&(x.channelByteOffsets[O.name]=q),q+=O.pixelType*2;if(x.totalBytes=q,x.outLineWidth=x.width*x.outputChannels,g.lineOrder==="INCREASING_Y"?x.scanOrder=O=>O:x.scanOrder=O=>x.height-1-O,g.spec.singleTile){x.blockHeight=g.tiles.ySize,x.blockWidth=g.tiles.xSize;const O=Fo(g.tiles,x.width,x.height),z=oi(O,x.width,g.tiles.xSize,g.tiles.roundingMode),W=oi(O,x.height,g.tiles.ySize,g.tiles.roundingMode);x.tileCount=z[0]*W[0];for(let K=0;K<O;K++)for(let J=0;J<W[K];J++)for(let ee=0;ee<z[K];ee++)je(d,S);x.decode=_o.bind(x)}else{x.blockWidth=x.width;const O=Math.ceil(x.height/x.blockHeight);for(let z=0;z<O;z++)je(d,S);x.decode=ko.bind(x)}return x}const ai={value:0},ri=new DataView(e),Uo=new Uint8Array(e),mt=Lo(ri,e,ai),pt=Go(mt,ri,Uo,ai,this.type,this.outputFormat);if(pt.decode(),pt.shouldExpand){const g=pt.byteArray;if(this.outputFormat==a.RGBAFormat)for(let d=0;d<g.length;d+=4)g[d+2]=g[d+1]=g[d];else if(this.outputFormat==a.RGFormat)for(let d=0;d<g.length;d+=2)g[d+1]=g[d]}return{header:mt,width:pt.width,height:pt.height,data:pt.byteArray,format:pt.format,colorSpace:pt.colorSpace,type:this.type}}setDataType(e){return this.type=e,this}setOutputFormat(e){return this.outputFormat=e,this}load(e,t,i,n){function s(o,r){o.colorSpace=r.colorSpace,o.minFilter=a.LinearFilter,o.magFilter=a.LinearFilter,o.generateMipmaps=!1,o.flipY=!1,t&&t(o,r)}return super.load(e,s,i,n)}}class ar extends a.DataTextureLoader{constructor(e){super(e),this.type=a.HalfFloatType}parse(e){const o=function(T,D){switch(T){case 1:throw new Error("THREE.HDRLoader: Read Error: "+(D||""));case 2:throw new Error("THREE.HDRLoader: Write Error: "+(D||""));case 3:throw new Error("THREE.HDRLoader: Bad File Format: "+(D||""));default:case 4:throw new Error("THREE.HDRLoader: Memory Error: "+(D||""))}},p=function(T,D,G){D=D||1024;let j=T.pos,X=-1,N=0,V="",H=String.fromCharCode.apply(null,new Uint16Array(T.subarray(j,j+128)));for(;0>(X=H.indexOf(`
|
|
5
|
+
`))&&N<D&&j<T.byteLength;)V+=H,N+=H.length,j+=128,H+=String.fromCharCode.apply(null,new Uint16Array(T.subarray(j,j+128)));return-1<X?(T.pos+=N+X+1,V+H.slice(0,X)):!1},u=function(T){const D=/^#\?(\S+)/,G=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,U=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,j=/^\s*FORMAT=(\S+)\s*$/,X=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,N={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let V,H;for((T.pos>=T.byteLength||!(V=p(T)))&&o(1,"no header found"),(H=V.match(D))||o(3,"bad initial token"),N.valid|=1,N.programtype=H[1],N.string+=V+`
|
|
6
|
+
`;V=p(T),V!==!1;){if(N.string+=V+`
|
|
7
|
+
`,V.charAt(0)==="#"){N.comments+=V+`
|
|
8
|
+
`;continue}if((H=V.match(G))&&(N.gamma=parseFloat(H[1])),(H=V.match(U))&&(N.exposure=parseFloat(H[1])),(H=V.match(j))&&(N.valid|=2,N.format=H[1]),(H=V.match(X))&&(N.valid|=4,N.height=parseInt(H[1],10),N.width=parseInt(H[2],10)),N.valid&2&&N.valid&4)break}return N.valid&2||o(3,"missing format specifier"),N.valid&4||o(3,"missing image size specifier"),N},f=function(T,D,G){const U=D;if(U<8||U>32767||T[0]!==2||T[1]!==2||T[2]&128)return new Uint8Array(T);U!==(T[2]<<8|T[3])&&o(3,"wrong scanline width");const j=new Uint8Array(4*D*G);j.length||o(4,"unable to allocate buffer space");let X=0,N=0;const V=4*U,H=new Uint8Array(4),$=new Uint8Array(V);let oe=G;for(;oe>0&&N<T.byteLength;){N+4>T.byteLength&&o(1),H[0]=T[N++],H[1]=T[N++],H[2]=T[N++],H[3]=T[N++],(H[0]!=2||H[1]!=2||(H[2]<<8|H[3])!=U)&&o(3,"bad rgbe scanline format");let te=0,le;for(;te<V&&N<T.byteLength;){le=T[N++];const Z=le>128;if(Z&&(le-=128),(le===0||te+le>V)&&o(3,"bad scanline data"),Z){const se=T[N++];for(let ue=0;ue<le;ue++)$[te++]=se}else $.set(T.subarray(N,N+le),te),te+=le,N+=le}const ne=U;for(let Z=0;Z<ne;Z++){let se=0;j[X]=$[Z+se],se+=U,j[X+1]=$[Z+se],se+=U,j[X+2]=$[Z+se],se+=U,j[X+3]=$[Z+se],X+=4}oe--}return j},b=function(T,D,G,U){const j=T[D+3],X=Math.pow(2,j-128)/255;G[U+0]=T[D+0]*X,G[U+1]=T[D+1]*X,G[U+2]=T[D+2]*X,G[U+3]=1},m=function(T,D,G,U){const j=T[D+3],X=Math.pow(2,j-128)/255;G[U+0]=a.DataUtils.toHalfFloat(Math.min(T[D+0]*X,65504)),G[U+1]=a.DataUtils.toHalfFloat(Math.min(T[D+1]*X,65504)),G[U+2]=a.DataUtils.toHalfFloat(Math.min(T[D+2]*X,65504)),G[U+3]=a.DataUtils.toHalfFloat(1)},E=new Uint8Array(e);E.pos=0;const B=u(E),w=B.width,C=B.height,y=f(E.subarray(E.pos),w,C);let Q,R,M;switch(this.type){case a.FloatType:M=y.length/4;const T=new Float32Array(M*4);for(let G=0;G<M;G++)b(y,G*4,T,G*4);Q=T,R=a.FloatType;break;case a.HalfFloatType:M=y.length/4;const D=new Uint16Array(M*4);for(let G=0;G<M;G++)m(y,G*4,D,G*4);Q=D,R=a.HalfFloatType;break;default:throw new Error("THREE.HDRLoader: Unsupported type: "+this.type)}return{width:w,height:C,data:Q,header:B.string,gamma:B.gamma,exposure:B.exposure,type:R}}setDataType(e){return this.type=e,this}load(e,t,i,n){function s(o,r){switch(o.type){case a.FloatType:case a.HalfFloatType:o.colorSpace=a.LinearSRGBColorSpace,o.minFilter=a.LinearFilter,o.magFilter=a.LinearFilter,o.generateMipmaps=!1,o.flipY=!0;break}t&&t(o,r)}return super.load(e,s,i,n)}}const It=new a.Raycaster,Le=new a.Vector3,ft=new a.Vector3,Be=new a.Quaternion,yi={X:new a.Vector3(1,0,0),Y:new a.Vector3(0,1,0),Z:new a.Vector3(0,0,1)},Qn={type:"change"},wi={type:"mouseDown",mode:null},Qi={type:"mouseUp",mode:null},xi={type:"objectChange"};class rr extends a.Controls{constructor(e,t=null){super(void 0,t);const i=new gr(this);this._root=i;const n=new $s;this._gizmo=n,i.add(n);const s=new ur;this._plane=s,i.add(s);const o=this;function r(C,y){let Q=y;Object.defineProperty(o,C,{get:function(){return Q!==void 0?Q:y},set:function(R){Q!==R&&(Q=R,s[C]=R,n[C]=R,o.dispatchEvent({type:C+"-changed",value:R}),o.dispatchEvent(Qn))}}),o[C]=y,s[C]=y,n[C]=y}r("camera",e),r("object",void 0),r("enabled",!0),r("axis",null),r("mode","translate"),r("translationSnap",null),r("rotationSnap",null),r("scaleSnap",null),r("space","world"),r("size",1),r("dragging",!1),r("showX",!0),r("showY",!0),r("showZ",!0),r("minX",-1/0),r("maxX",1/0),r("minY",-1/0),r("maxY",1/0),r("minZ",-1/0),r("maxZ",1/0);const A=new a.Vector3,l=new a.Vector3,h=new a.Quaternion,p=new a.Quaternion,u=new a.Vector3,f=new a.Quaternion,b=new a.Vector3,m=new a.Vector3,E=new a.Vector3,B=0,w=new a.Vector3;r("worldPosition",A),r("worldPositionStart",l),r("worldQuaternion",h),r("worldQuaternionStart",p),r("cameraPosition",u),r("cameraQuaternion",f),r("pointStart",b),r("pointEnd",m),r("rotationAxis",E),r("rotationAngle",B),r("eye",w),this._offset=new a.Vector3,this._startNorm=new a.Vector3,this._endNorm=new a.Vector3,this._cameraScale=new a.Vector3,this._parentPosition=new a.Vector3,this._parentQuaternion=new a.Quaternion,this._parentQuaternionInv=new a.Quaternion,this._parentScale=new a.Vector3,this._worldScaleStart=new a.Vector3,this._worldQuaternionInv=new a.Quaternion,this._worldScale=new a.Vector3,this._positionStart=new a.Vector3,this._quaternionStart=new a.Quaternion,this._scaleStart=new a.Vector3,this._getPointer=Ar.bind(this),this._onPointerDown=lr.bind(this),this._onPointerHover=cr.bind(this),this._onPointerMove=hr.bind(this),this._onPointerUp=pr.bind(this),t!==null&&this.connect(t)}connect(e){super.connect(e),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="auto"}getHelper(){return this._root}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;e!==null&&It.setFromCamera(e,this.camera);const t=xn(this._gizmo.picker[this.mode],It);t?this.axis=t.object.name:this.axis=null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e!=null&&e.button!==0)&&this.axis!==null){e!==null&&It.setFromCamera(e,this.camera);const t=xn(this._plane,It,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,wi.mode=this.mode,this.dispatchEvent(wi)}}pointerMove(e){const t=this.axis,i=this.mode,n=this.object;let s=this.space;if(i==="scale"?s="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(s="world"),n===void 0||t===null||this.dragging===!1||e!==null&&e.button!==-1)return;e!==null&&It.setFromCamera(e,this.camera);const o=xn(this._plane,It,!0);if(o){if(this.pointEnd.copy(o.point).sub(this.worldPositionStart),i==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),s==="local"&&t!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf("X")===-1&&(this._offset.x=0),t.indexOf("Y")===-1&&(this._offset.y=0),t.indexOf("Z")===-1&&(this._offset.z=0),s==="local"&&t!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),n.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(s==="local"&&(n.position.applyQuaternion(Be.copy(this._quaternionStart).invert()),t.search("X")!==-1&&(n.position.x=Math.round(n.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(n.position.y=Math.round(n.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(n.position.z=Math.round(n.position.z/this.translationSnap)*this.translationSnap),n.position.applyQuaternion(this._quaternionStart)),s==="world"&&(n.parent&&n.position.add(Le.setFromMatrixPosition(n.parent.matrixWorld)),t.search("X")!==-1&&(n.position.x=Math.round(n.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(n.position.y=Math.round(n.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(n.position.z=Math.round(n.position.z/this.translationSnap)*this.translationSnap),n.parent&&n.position.sub(Le.setFromMatrixPosition(n.parent.matrixWorld)))),n.position.x=Math.max(this.minX,Math.min(this.maxX,n.position.x)),n.position.y=Math.max(this.minY,Math.min(this.maxY,n.position.y)),n.position.z=Math.max(this.minZ,Math.min(this.maxZ,n.position.z));else if(i==="scale"){if(t.search("XYZ")!==-1){let r=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(r*=-1),ft.set(r,r,r)}else Le.copy(this.pointStart),ft.copy(this.pointEnd),Le.applyQuaternion(this._worldQuaternionInv),ft.applyQuaternion(this._worldQuaternionInv),ft.divide(Le),t.search("X")===-1&&(ft.x=1),t.search("Y")===-1&&(ft.y=1),t.search("Z")===-1&&(ft.z=1);n.scale.copy(this._scaleStart).multiply(ft),this.scaleSnap&&(t.search("X")!==-1&&(n.scale.x=Math.round(n.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Y")!==-1&&(n.scale.y=Math.round(n.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Z")!==-1&&(n.scale.z=Math.round(n.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(i==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const r=20/this.worldPosition.distanceTo(Le.setFromMatrixPosition(this.camera.matrixWorld));let A=!1;t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(Le.copy(this.rotationAxis).cross(this.eye))*r):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(yi[t]),Le.copy(yi[t]),s==="local"&&Le.applyQuaternion(this.worldQuaternion),Le.cross(this.eye),Le.length()===0?A=!0:this.rotationAngle=this._offset.dot(Le.normalize())*r),(t==="E"||A)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),s==="local"&&t!=="E"&&t!=="XYZE"?(n.quaternion.copy(this._quaternionStart),n.quaternion.multiply(Be.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),n.quaternion.copy(Be.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),n.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(Qn),this.dispatchEvent(xi)}}pointerUp(e){e!==null&&e.button!==0||(this.dragging&&this.axis!==null&&(Qi.mode=this.mode,this.dispatchEvent(Qi)),this.dragging=!1,this.axis=null)}dispose(){this.disconnect(),this._root.dispose()}attach(e){return this.object=e,this._root.visible=!0,this}detach(){return this.object=void 0,this.axis=null,this._root.visible=!1,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(Qn),this.dispatchEvent(xi),this.pointStart.copy(this.pointEnd))}getRaycaster(){return It}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}setColors(e,t,i,n){const s=this._gizmo.materialLib;s.xAxis.color.set(e),s.yAxis.color.set(t),s.zAxis.color.set(i),s.active.color.set(n),s.xAxisTransparent.color.set(e),s.yAxisTransparent.color.set(t),s.zAxisTransparent.color.set(i),s.activeTransparent.color.set(n),s.xAxis._color&&s.xAxis._color.set(e),s.yAxis._color&&s.yAxis._color.set(t),s.zAxis._color&&s.zAxis._color.set(i),s.active._color&&s.active._color.set(n),s.xAxisTransparent._color&&s.xAxisTransparent._color.set(e),s.yAxisTransparent._color&&s.yAxisTransparent._color.set(t),s.zAxisTransparent._color&&s.zAxisTransparent._color.set(i),s.activeTransparent._color&&s.activeTransparent._color.set(n)}}function Ar(c){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:c.button};{const e=this.domElement.getBoundingClientRect();return{x:(c.clientX-e.left)/e.width*2-1,y:-(c.clientY-e.top)/e.height*2+1,button:c.button}}}function cr(c){if(this.enabled)switch(c.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(c));break}}function lr(c){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(c.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(c)),this.pointerDown(this._getPointer(c)))}function hr(c){this.enabled&&this.pointerMove(this._getPointer(c))}function pr(c){this.enabled&&(this.domElement.releasePointerCapture(c.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(c)))}function xn(c,e,t){const i=e.intersectObject(c,!0);for(let n=0;n<i.length;n++)if(i[n].object.visible||t)return i[n];return!1}const Xt=new a.Euler,be=new a.Vector3(0,1,0),Si=new a.Vector3(0,0,0),Ti=new a.Matrix4,Wt=new a.Quaternion,an=new a.Quaternion,$e=new a.Vector3,vi=new a.Matrix4,Ht=new a.Vector3(1,0,0),Bt=new a.Vector3(0,1,0),jt=new a.Vector3(0,0,1),Zt=new a.Vector3,Gt=new a.Vector3,Ut=new a.Vector3;class gr extends a.Object3D{constructor(e){super(),this.isTransformControlsRoot=!0,this.controls=e,this.visible=!1}updateMatrixWorld(e){const t=this.controls;t.object!==void 0&&(t.object.updateMatrixWorld(),t.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):t.object.parent.matrixWorld.decompose(t._parentPosition,t._parentQuaternion,t._parentScale),t.object.matrixWorld.decompose(t.worldPosition,t.worldQuaternion,t._worldScale),t._parentQuaternionInv.copy(t._parentQuaternion).invert(),t._worldQuaternionInv.copy(t.worldQuaternion).invert()),t.camera.updateMatrixWorld(),t.camera.matrixWorld.decompose(t.cameraPosition,t.cameraQuaternion,t._cameraScale),t.camera.isOrthographicCamera?t.camera.getWorldDirection(t.eye).negate():t.eye.copy(t.cameraPosition).sub(t.worldPosition).normalize(),super.updateMatrixWorld(e)}dispose(){this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}}class $s extends a.Object3D{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const e=new a.MeshBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new a.LineBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),i=e.clone();i.opacity=.15;const n=t.clone();n.opacity=.5;const s=e.clone();s.color.setHex(16711680);const o=e.clone();o.color.setHex(65280);const r=e.clone();r.color.setHex(255);const A=e.clone();A.color.setHex(16711680),A.opacity=.5;const l=e.clone();l.color.setHex(65280),l.opacity=.5;const h=e.clone();h.color.setHex(255),h.opacity=.5;const p=e.clone();p.opacity=.25;const u=e.clone();u.color.setHex(16776960),u.opacity=.25;const f=e.clone();f.color.setHex(16776960);const b=e.clone();b.color.setHex(7895160),this.materialLib={xAxis:s,yAxis:o,zAxis:r,active:f,xAxisTransparent:A,yAxisTransparent:l,zAxisTransparent:h,activeTransparent:u};const m=new a.CylinderGeometry(0,.04,.1,12);m.translate(0,.05,0);const E=new a.BoxGeometry(.08,.08,.08);E.translate(0,.04,0);const B=new a.BufferGeometry;B.setAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));const w=new a.CylinderGeometry(.0075,.0075,.5,3);w.translate(0,.25,0);function C(V,H){const $=new a.TorusGeometry(V,.0075,3,64,H*Math.PI*2);return $.rotateY(Math.PI/2),$.rotateX(Math.PI/2),$}function y(){const V=new a.BufferGeometry;return V.setAttribute("position",new a.Float32BufferAttribute([0,0,0,1,1,1],3)),V}const Q={X:[[new a.Mesh(m,s),[.5,0,0],[0,0,-Math.PI/2]],[new a.Mesh(m,s),[-.5,0,0],[0,0,Math.PI/2]],[new a.Mesh(w,s),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(m,o),[0,.5,0]],[new a.Mesh(m,o),[0,-.5,0],[Math.PI,0,0]],[new a.Mesh(w,o)]],Z:[[new a.Mesh(m,r),[0,0,.5],[Math.PI/2,0,0]],[new a.Mesh(m,r),[0,0,-.5],[-Math.PI/2,0,0]],[new a.Mesh(w,r),null,[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.1,0),p),[0,0,0]]],XY:[[new a.Mesh(new a.BoxGeometry(.15,.15,.01),h),[.15,.15,0]]],YZ:[[new a.Mesh(new a.BoxGeometry(.15,.15,.01),A),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.BoxGeometry(.15,.15,.01),l),[.15,0,.15],[-Math.PI/2,0,0]]]},R={X:[[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),i),[0,.3,0]],[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.2,0),i)]],XY:[[new a.Mesh(new a.BoxGeometry(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new a.Mesh(new a.BoxGeometry(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.BoxGeometry(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]]},M={START:[[new a.Mesh(new a.OctahedronGeometry(.01,2),n),null,null,null,"helper"]],END:[[new a.Mesh(new a.OctahedronGeometry(.01,2),n),null,null,null,"helper"]],DELTA:[[new a.Line(y(),n),null,null,null,"helper"]],X:[[new a.Line(B,n),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new a.Line(B,n),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new a.Line(B,n),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},T={XYZE:[[new a.Mesh(C(.5,1),b),null,[0,Math.PI/2,0]]],X:[[new a.Mesh(C(.5,.5),s)]],Y:[[new a.Mesh(C(.5,.5),o),null,[0,0,-Math.PI/2]]],Z:[[new a.Mesh(C(.5,.5),r),null,[0,Math.PI/2,0]]],E:[[new a.Mesh(C(.75,1),u),null,[0,Math.PI/2,0]]]},D={AXIS:[[new a.Line(B,n),[-1e3,0,0],null,[1e6,1,1],"helper"]]},G={XYZE:[[new a.Mesh(new a.SphereGeometry(.25,10,8),i)]],X:[[new a.Mesh(new a.TorusGeometry(.5,.1,4,24),i),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new a.Mesh(new a.TorusGeometry(.5,.1,4,24),i),[0,0,0],[Math.PI/2,0,0]]],Z:[[new a.Mesh(new a.TorusGeometry(.5,.1,4,24),i),[0,0,0],[0,0,-Math.PI/2]]],E:[[new a.Mesh(new a.TorusGeometry(.75,.1,2,24),i)]]},U={X:[[new a.Mesh(E,s),[.5,0,0],[0,0,-Math.PI/2]],[new a.Mesh(w,s),[0,0,0],[0,0,-Math.PI/2]],[new a.Mesh(E,s),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new a.Mesh(E,o),[0,.5,0]],[new a.Mesh(w,o)],[new a.Mesh(E,o),[0,-.5,0],[0,0,Math.PI]]],Z:[[new a.Mesh(E,r),[0,0,.5],[Math.PI/2,0,0]],[new a.Mesh(w,r),[0,0,0],[Math.PI/2,0,0]],[new a.Mesh(E,r),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new a.Mesh(new a.BoxGeometry(.15,.15,.01),h),[.15,.15,0]]],YZ:[[new a.Mesh(new a.BoxGeometry(.15,.15,.01),A),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.BoxGeometry(.15,.15,.01),l),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.BoxGeometry(.1,.1,.1),p)]]},j={X:[[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),i),[0,.3,0]],[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new a.Mesh(new a.BoxGeometry(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new a.Mesh(new a.BoxGeometry(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.BoxGeometry(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.BoxGeometry(.2,.2,.2),i),[0,0,0]]]},X={X:[[new a.Line(B,n),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new a.Line(B,n),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new a.Line(B,n),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function N(V){const H=new a.Object3D;for(const $ in V)for(let oe=V[$].length;oe--;){const te=V[$][oe][0].clone(),le=V[$][oe][1],ne=V[$][oe][2],Z=V[$][oe][3],se=V[$][oe][4];te.name=$,te.tag=se,le&&te.position.set(le[0],le[1],le[2]),ne&&te.rotation.set(ne[0],ne[1],ne[2]),Z&&te.scale.set(Z[0],Z[1],Z[2]),te.updateMatrix();const ue=te.geometry.clone();ue.applyMatrix4(te.matrix),te.geometry=ue,te.renderOrder=1/0,te.position.set(0,0,0),te.rotation.set(0,0,0),te.scale.set(1,1,1),H.add(te)}return H}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=N(Q)),this.add(this.gizmo.rotate=N(T)),this.add(this.gizmo.scale=N(U)),this.add(this.picker.translate=N(R)),this.add(this.picker.rotate=N(G)),this.add(this.picker.scale=N(j)),this.add(this.helper.translate=N(M)),this.add(this.helper.rotate=N(D)),this.add(this.helper.scale=N(X)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){const i=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:an;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let s=0;s<n.length;s++){const o=n[s];o.visible=!0,o.rotation.set(0,0,0),o.position.copy(this.worldPosition);let r;if(this.camera.isOrthographicCamera?r=(this.camera.top-this.camera.bottom)/this.camera.zoom:r=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),o.scale.set(1,1,1).multiplyScalar(r*this.size/4),o.tag==="helper"){o.visible=!1,o.name==="AXIS"?(o.visible=!!this.axis,this.axis==="X"&&(Be.setFromEuler(Xt.set(0,0,0)),o.quaternion.copy(i).multiply(Be),Math.abs(be.copy(Ht).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Y"&&(Be.setFromEuler(Xt.set(0,0,Math.PI/2)),o.quaternion.copy(i).multiply(Be),Math.abs(be.copy(Bt).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Z"&&(Be.setFromEuler(Xt.set(0,Math.PI/2,0)),o.quaternion.copy(i).multiply(Be),Math.abs(be.copy(jt).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="XYZE"&&(Be.setFromEuler(Xt.set(0,Math.PI/2,0)),be.copy(this.rotationAxis),o.quaternion.setFromRotationMatrix(Ti.lookAt(Si,be,Bt)),o.quaternion.multiply(Be),o.visible=this.dragging),this.axis==="E"&&(o.visible=!1)):o.name==="START"?(o.position.copy(this.worldPositionStart),o.visible=this.dragging):o.name==="END"?(o.position.copy(this.worldPosition),o.visible=this.dragging):o.name==="DELTA"?(o.position.copy(this.worldPositionStart),o.quaternion.copy(this.worldQuaternionStart),Le.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Le.applyQuaternion(this.worldQuaternionStart.clone().invert()),o.scale.copy(Le),o.visible=this.dragging):(o.quaternion.copy(i),this.dragging?o.position.copy(this.worldPositionStart):o.position.copy(this.worldPosition),this.axis&&(o.visible=this.axis.search(o.name)!==-1));continue}o.quaternion.copy(i),this.mode==="translate"||this.mode==="scale"?(o.name==="X"&&Math.abs(be.copy(Ht).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Y"&&Math.abs(be.copy(Bt).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Z"&&Math.abs(be.copy(jt).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XY"&&Math.abs(be.copy(jt).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="YZ"&&Math.abs(be.copy(Ht).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XZ"&&Math.abs(be.copy(Bt).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1)):this.mode==="rotate"&&(Wt.copy(i),be.copy(this.eye).applyQuaternion(Be.copy(i).invert()),o.name.search("E")!==-1&&o.quaternion.setFromRotationMatrix(Ti.lookAt(this.eye,Si,Bt)),o.name==="X"&&(Be.setFromAxisAngle(Ht,Math.atan2(-be.y,be.z)),Be.multiplyQuaternions(Wt,Be),o.quaternion.copy(Be)),o.name==="Y"&&(Be.setFromAxisAngle(Bt,Math.atan2(be.x,be.z)),Be.multiplyQuaternions(Wt,Be),o.quaternion.copy(Be)),o.name==="Z"&&(Be.setFromAxisAngle(jt,Math.atan2(be.y,be.x)),Be.multiplyQuaternions(Wt,Be),o.quaternion.copy(Be))),o.visible=o.visible&&(o.name.indexOf("X")===-1||this.showX),o.visible=o.visible&&(o.name.indexOf("Y")===-1||this.showY),o.visible=o.visible&&(o.name.indexOf("Z")===-1||this.showZ),o.visible=o.visible&&(o.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),o.material._color=o.material._color||o.material.color.clone(),o.material._opacity=o.material._opacity||o.material.opacity,o.material.color.copy(o.material._color),o.material.opacity=o.material._opacity,this.enabled&&this.axis&&(o.name===this.axis?(o.material.color.copy(this.materialLib.active.color),o.material.opacity=1):this.axis.split("").some(function(A){return o.name===A})&&(o.material.color.copy(this.materialLib.active.color),o.material.opacity=1))}super.updateMatrixWorld(e)}}class ur extends a.Mesh{constructor(){super(new a.PlaneGeometry(1e5,1e5,2,2),new a.MeshBasicMaterial({visible:!1,wireframe:!0,side:a.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(t="local"),Zt.copy(Ht).applyQuaternion(t==="local"?this.worldQuaternion:an),Gt.copy(Bt).applyQuaternion(t==="local"?this.worldQuaternion:an),Ut.copy(jt).applyQuaternion(t==="local"?this.worldQuaternion:an),be.copy(Gt),this.mode){case"translate":case"scale":switch(this.axis){case"X":be.copy(this.eye).cross(Zt),$e.copy(Zt).cross(be);break;case"Y":be.copy(this.eye).cross(Gt),$e.copy(Gt).cross(be);break;case"Z":be.copy(this.eye).cross(Ut),$e.copy(Ut).cross(be);break;case"XY":$e.copy(Ut);break;case"YZ":$e.copy(Zt);break;case"XZ":be.copy(Ut),$e.copy(Gt);break;case"XYZ":case"E":$e.set(0,0,0);break}break;default:$e.set(0,0,0)}$e.length()===0?this.quaternion.copy(this.cameraQuaternion):(vi.lookAt(Le.set(0,0,0),$e,be),this.quaternion.setFromRotationMatrix(vi)),super.updateMatrixWorld(e)}}const Di={type:"change"},Xn={type:"start"},eo={type:"end"},fr={type:"endMovement"},$t=new a.Ray,Ri=new a.Plane,dr=Math.cos(70*a.MathUtils.DEG2RAD),ve=new a.Vector3;new a.Vector3;const Pe=2*Math.PI,ge={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Ct=1e-6;let br=class extends a.Controls{constructor(e,t=null){super(e,t),this.state=ge.NONE,this.target=new a.Vector3,this.cursor=new a.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:a.MOUSE.ROTATE,MIDDLE:a.MOUSE.DOLLY,RIGHT:a.MOUSE.PAN},this.touches={ONE:a.TOUCH.ROTATE,TWO:a.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._cursorStyle="auto",this._domElementKeyEvents=null,this._lastPosition=new a.Vector3,this._lastQuaternion=new a.Quaternion,this._lastTargetPosition=new a.Vector3,this._quat=new a.Quaternion().setFromUnitVectors(e.up,new a.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new a.Spherical,this._sphericalDelta=new a.Spherical,this._scale=1,this._currentScale=1,this._panOffset=new a.Vector3,this._rotateStart=new a.Vector2,this._rotateEnd=new a.Vector2,this._rotateDelta=new a.Vector2,this._panStart=new a.Vector2,this._panEnd=new a.Vector2,this._panDelta=new a.Vector2,this._dollyStart=new a.Vector2,this._dollyEnd=new a.Vector2,this._dollyDelta=new a.Vector2,this._dollyDirection=new a.Vector3,this._mouse=new a.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._lastIsDamping=!1,this._isDamping=!1,this._onPointerMove=Er.bind(this),this._onPointerDown=mr.bind(this),this._onPointerUp=Ir.bind(this),this._onContextMenu=Sr.bind(this),this._onMouseWheel=yr.bind(this),this._onKeyDown=wr.bind(this),this._onTouchStart=Qr.bind(this),this._onTouchMove=xr.bind(this),this._onMouseDown=Cr.bind(this),this._onMouseMove=Br.bind(this),this._interceptControlDown=Tr.bind(this),this._interceptControlUp=vr.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}set cursorStyle(e){this._cursorStyle=e,e==="grab"?this.domElement.style.cursor="grab":this.domElement.style.cursor="auto"}get cursorStyle(){return this._cursorStyle}connect(e){super.connect(e),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Di),this.update(),this.state=ge.NONE,this._isDamping=!1}pan(e,t){this._pan(e,t),this.update()}dollyIn(e){this._dollyIn(e),this.update()}dollyOut(e){this._dollyOut(e),this.update()}rotateLeft(e){this._rotateLeft(e),this.update()}rotateUp(e){this._rotateUp(e),this.update()}update(e=null){if(this.enableDamping&&e===null)return;const t=this.object.getWorldPosition(this.object.position);ve.copy(t).sub(this.target),ve.applyQuaternion(this._quat),this._spherical.setFromVector3(ve),this.autoRotate&&this.state===ge.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let i=this.minAzimuthAngle,n=this.maxAzimuthAngle;isFinite(i)&&isFinite(n)&&(i<-Math.PI?i+=Pe:i>Math.PI&&(i-=Pe),n<-Math.PI?n+=Pe:n>Math.PI&&(n-=Pe),i<=n?this._spherical.theta=Math.max(i,Math.min(n,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(i+n)/2?Math.max(i,this._spherical.theta):Math.min(n,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let s=!1;if(this.enableDamping?this._currentScale=a.MathUtils.lerp(this._currentScale,this._scale,this.dampingFactor):this._currentScale=this._scale,this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const o=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._currentScale),s=Math.abs(o-this._spherical.radius)>Ct*100}if(ve.setFromSpherical(this._spherical),ve.applyQuaternion(this._quatInverse),t.copy(this.target).add(ve),this.object.parent?this.object.parent.worldToLocal(t):this.object.position.copy(t),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let o=null;if(this.object.isPerspectiveCamera){const r=ve.length();o=this._clampDistance(r*this._currentScale);const A=r-o;this.object.position.addScaledVector(this._dollyDirection,A),this.object.updateMatrixWorld(),s=Math.abs(A)>Ct}else if(this.object.isOrthographicCamera){const r=new a.Vector3(this._mouse.x,this._mouse.y,0);r.unproject(this.object);const A=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._currentScale)),this.object.updateProjectionMatrix(),s=Math.abs(A-this.object.zoom)>Ct;const l=new a.Vector3(this._mouse.x,this._mouse.y,0);l.unproject(this.object),this.object.position.sub(l).add(r),this.object.updateMatrixWorld(),o=ve.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;o!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position):($t.origin.copy(this.object.position),$t.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot($t.direction))<dr?this.object.lookAt(this.target):(Ri.setFromNormalAndCoplanarPoint(this.object.up,this.target),$t.intersectPlane(Ri,this.target))))}else if(this.object.isOrthographicCamera){const o=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),Math.abs(o-this.object.zoom)>Ct&&(this.object.updateProjectionMatrix(),s=!0)}return this._scale=1,s||this._lastPosition.distanceToSquared(this.object.position)>Ct||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Ct||this._lastTargetPosition.distanceToSquared(this.target)>Ct?(this.dispatchEvent(Di),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),this._lastIsDamping=!0,this._isDamping=!0,!0):(this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),this.state===ge.NONE&&(this._lastIsDamping=this._isDamping,this._isDamping=!1),this._lastIsDamping&&!this._isDamping&&this.state===ge.NONE&&(this._isDamping=!1,this._lastIsDamping=!1,this.dispatchEvent(fr)),this._performCursorZoom=!1,!1)}_getAutoRotationAngle(e){return e!==null?Pe/60*this.autoRotateSpeed*e:Pe/60/60*this.autoRotateSpeed}_getZoomScale(e){const t=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){ve.setFromMatrixColumn(t,0),ve.multiplyScalar(-e),this._panOffset.add(ve)}_panUp(e,t){this.screenSpacePanning===!0?ve.setFromMatrixColumn(t,1):(ve.setFromMatrixColumn(t,0),ve.crossVectors(this.object.up,ve)),ve.multiplyScalar(e),this._panOffset.add(ve)}_pan(e,t){const i=this.domElement;if(this.object.isPerspectiveCamera){this.object.getWorldPosition(ve).sub(this.target);let n=ve.length();n*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*n/i.clientHeight,this.object.matrixWorld),this._panUp(2*t*n/i.clientHeight,this.object.matrixWorld)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/i.clientWidth,this.object.matrixWorld),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/i.clientHeight,this.object.matrixWorld)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const i=this.domElement.getBoundingClientRect(),n=e-i.left,s=t-i.top,o=i.width,r=i.height;this._mouse.x=n/o*2-1,this._mouse.y=-(s/r)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(Pe*this._rotateDelta.x/t.clientHeight),this._rotateUp(Pe*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(Pe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-Pe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(Pe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-Pe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),i=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this._rotateStart.set(i,n)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),i=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this._panStart.set(i,n)}}_handleTouchStartDolly(e){const t=this._getSecondPointerPosition(e),i=e.pageX-t.x,n=e.pageY-t.y,s=Math.sqrt(i*i+n*n);this._dollyStart.set(0,s)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const i=this._getSecondPointerPosition(e),n=.5*(e.pageX+i.x),s=.5*(e.pageY+i.y);this._rotateEnd.set(n,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(Pe*this._rotateDelta.x/t.clientHeight),this._rotateUp(Pe*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),i=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this._panEnd.set(i,n)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const t=this._getSecondPointerPosition(e),i=e.pageX-t.x,n=e.pageY-t.y,s=Math.sqrt(i*i+n*n);this._dollyEnd.set(0,s),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const o=(e.pageX+t.x)*.5,r=(e.pageY+t.y)*.5;this._updateZoomParameters(o,r)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new a.Vector2,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){const t=e.deltaMode,i={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:i.deltaY*=16;break;case 2:i.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(i.deltaY*=10),i}};function mr(c){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(c.pointerId),this.domElement.ownerDocument.addEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(c)&&(this._addPointer(c),c.pointerType==="touch"?this._onTouchStart(c):this._onMouseDown(c),this._cursorStyle==="grab"&&(this.domElement.style.cursor="grabbing")))}function Er(c){this.enabled!==!1&&(c.pointerType==="touch"?this._onTouchMove(c):this._onMouseMove(c))}function Ir(c){switch(this._removePointer(c),this._pointers.length){case 0:this.domElement.releasePointerCapture(c.pointerId),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(eo),this.state=ge.NONE,this._cursorStyle==="grab"&&(this.domElement.style.cursor="grab");break;case 1:const e=this._pointers[0],t=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:t.x,pageY:t.y});break}}function Cr(c){let e;switch(c.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case a.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(c),this.state=ge.DOLLY;break;case a.MOUSE.ROTATE:if(c.ctrlKey||c.metaKey||c.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(c),this.state=ge.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(c),this.state=ge.ROTATE}break;case a.MOUSE.PAN:if(c.ctrlKey||c.metaKey||c.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(c),this.state=ge.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(c),this.state=ge.PAN}break;default:this.state=ge.NONE}this.state!==ge.NONE&&this.dispatchEvent(Xn)}function Br(c){switch(this.state){case ge.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(c);break;case ge.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(c);break;case ge.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(c);break}}function yr(c){this.enabled===!1||this.enableZoom===!1||this.state!==ge.NONE||(c.preventDefault(),this.dispatchEvent(Xn),this._handleMouseWheel(this._customWheelEvent(c)),this.dispatchEvent(eo))}function wr(c){this.enabled!==!1&&this._handleKeyDown(c)}function Qr(c){switch(this._trackPointer(c),this._pointers.length){case 1:switch(this.touches.ONE){case a.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(c),this.state=ge.TOUCH_ROTATE;break;case a.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(c),this.state=ge.TOUCH_PAN;break;default:this.state=ge.NONE}break;case 2:switch(this.touches.TWO){case a.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(c),this.state=ge.TOUCH_DOLLY_PAN;break;case a.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(c),this.state=ge.TOUCH_DOLLY_ROTATE;break;default:this.state=ge.NONE}break;default:this.state=ge.NONE}this.state!==ge.NONE&&this.dispatchEvent(Xn)}function xr(c){switch(this._trackPointer(c),this.state){case ge.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(c),this.update();break;case ge.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(c),this.update();break;case ge.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(c),this.update();break;case ge.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(c),this.update();break;default:this.state=ge.NONE}}function Sr(c){this.enabled!==!1&&c.preventDefault()}function Tr(c){c.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function vr(c){c.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}class Dr extends a.Line{constructor(e,t=1,i=16,n=2){const s=new a.BufferGeometry,o=i+n*2,r=new Float32Array((o*3+3)*3);s.setAttribute("position",new a.BufferAttribute(r,3));const A=new a.LineBasicMaterial({color:65280}),l=new a.LineBasicMaterial({color:16776960});super(s,[l,A]),this.audio=e,this.range=t,this.divisionsInnerAngle=i,this.divisionsOuterAngle=n,this.type="PositionalAudioHelper",this.update()}update(){const e=this.audio,t=this.range,i=this.divisionsInnerAngle,n=this.divisionsOuterAngle,s=a.MathUtils.degToRad(e.panner.coneInnerAngle),o=a.MathUtils.degToRad(e.panner.coneOuterAngle),r=s/2,A=o/2;let l=0,h=0,p,u;const f=this.geometry,b=f.attributes.position;f.clearGroups();function m(E,B,w,C){const y=(B-E)/w;for(b.setXYZ(l,0,0,0),h++,p=E;p<B;p+=y)u=l+h,b.setXYZ(u,Math.sin(p)*t,0,Math.cos(p)*t),b.setXYZ(u+1,Math.sin(Math.min(p+y,B))*t,0,Math.cos(Math.min(p+y,B))*t),b.setXYZ(u+2,0,0,0),h+=3;f.addGroup(l,h,C),l+=h,h=0}m(-A,-r,n,0),m(-r,r,i,1),m(r,A,n,0),b.needsUpdate=!0,s===o&&(this.material[0].visible=!1)}dispose(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()}}const Rr={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
|
|
9
9
|
|
|
10
10
|
varying vec2 vUv;
|
|
11
11
|
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
|
|
38
38
|
gl_FragColor = sum;
|
|
39
39
|
|
|
40
|
-
}`},
|
|
40
|
+
}`},Mr={name:"VerticalBlurShader",uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:`
|
|
41
41
|
|
|
42
42
|
varying vec2 vUv;
|
|
43
43
|
|
|
@@ -69,24 +69,7 @@
|
|
|
69
69
|
|
|
70
70
|
gl_FragColor = sum;
|
|
71
71
|
|
|
72
|
-
}`};let Ut,Tn,Qt,en;function vn(c,e=1/0,t=null){Tn||(Tn=new r.PlaneGeometry(2,2,1,1)),Qt||(Qt=new r.ShaderMaterial({uniforms:{blitTexture:new r.Uniform$1(c)},vertexShader:`
|
|
73
|
-
varying vec2 vUv;
|
|
74
|
-
void main(){
|
|
75
|
-
vUv = uv;
|
|
76
|
-
gl_Position = vec4(position.xy * 1.0,0.,.999999);
|
|
77
|
-
}`,fragmentShader:`
|
|
78
|
-
uniform sampler2D blitTexture;
|
|
79
|
-
varying vec2 vUv;
|
|
80
|
-
|
|
81
|
-
void main(){
|
|
82
|
-
gl_FragColor = vec4(vUv.xy, 0, 1);
|
|
83
|
-
|
|
84
|
-
#ifdef IS_SRGB
|
|
85
|
-
gl_FragColor = sRGBTransferOETF( texture2D( blitTexture, vUv) );
|
|
86
|
-
#else
|
|
87
|
-
gl_FragColor = texture2D( blitTexture, vUv);
|
|
88
|
-
#endif
|
|
89
|
-
}`})),Qt.uniforms.blitTexture.value=c,Qt.defines.IS_SRGB=c.colorSpace==r.SRGBColorSpace,Qt.needsUpdate=!0,en||(en=new r.Mesh(Tn,Qt),en.frustumCulled=!1);const s=new r.PerspectiveCamera,n=new r.Scene;n.add(en),t===null&&(t=Ut=new r.WebGLRenderer({antialias:!1}));const i=Math.min(c.image.width,e),o=Math.min(c.image.height,e);t.setSize(i,o),t.clear(),t.render(n,s);const a=document.createElement("canvas"),A=a.getContext("2d");a.width=i,a.height=o,A.drawImage(t.domElement,0,0,i,o);const l=new r.CanvasTexture(a);return l.minFilter=c.minFilter,l.magFilter=c.magFilter,l.wrapS=c.wrapS,l.wrapT=c.wrapT,l.colorSpace=c.colorSpace,l.name=c.name,Ut&&(Ut.forceContextLoss(),Ut.dispose(),Ut=null),l}const Rs={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class es{constructor(){this.pluginCallbacks=[],this.register(function(e){return new _a(e)}),this.register(function(e){return new Fa(e)}),this.register(function(e){return new Ua(e)}),this.register(function(e){return new Na(e)}),this.register(function(e){return new Pa(e)}),this.register(function(e){return new Oa(e)}),this.register(function(e){return new La(e)}),this.register(function(e){return new ka(e)}),this.register(function(e){return new Ga(e)}),this.register(function(e){return new Ha(e)}),this.register(function(e){return new ja(e)}),this.register(function(e){return new qa(e)}),this.register(function(e){return new za(e)}),this.register(function(e){return new Ya(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,s,n){const i=new Da,o=[];for(let a=0,A=this.pluginCallbacks.length;a<A;a++)o.push(this.pluginCallbacks[a](i));i.setPlugins(o),i.write(e,t,n).catch(s)}parseAsync(e,t){const s=this;return new Promise(function(n,i){s.parse(e,n,i,t)})}}const ae={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},Mn="KHR_mesh_quantization",je={};je[r.NearestFilter]=ae.NEAREST;je[r.NearestMipmapNearestFilter]=ae.NEAREST_MIPMAP_NEAREST;je[r.NearestMipmapLinearFilter]=ae.NEAREST_MIPMAP_LINEAR;je[r.LinearFilter]=ae.LINEAR;je[r.LinearMipmapNearestFilter]=ae.LINEAR_MIPMAP_NEAREST;je[r.LinearMipmapLinearFilter]=ae.LINEAR_MIPMAP_LINEAR;je[r.ClampToEdgeWrapping]=ae.CLAMP_TO_EDGE;je[r.RepeatWrapping]=ae.REPEAT;je[r.MirroredRepeatWrapping]=ae.MIRRORED_REPEAT;const Ds={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},wa=new r.Color,_s=12,Qa=1179937895,xa=2,Fs=8,Sa=1313821514,Ta=5130562;function qt(c,e){return c.length===e.length&&c.every(function(t,s){return t===e[s]})}function va(c){return new TextEncoder().encode(c).buffer}function Ma(c){return qt(c.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function Ra(c,e,t){const s={min:new Array(c.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(c.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let n=e;n<e+t;n++)for(let i=0;i<c.itemSize;i++){let o;c.itemSize>4?o=c.array[n*c.itemSize+i]:(i===0?o=c.getX(n):i===1?o=c.getY(n):i===2?o=c.getZ(n):i===3&&(o=c.getW(n)),c.normalized===!0&&(o=r.MathUtils.normalize(o,c.array))),s.min[i]=Math.min(s.min[i],o),s.max[i]=Math.max(s.max[i],o)}return s}function Ri(c){return Math.ceil(c/4)*4}function Rn(c,e=0){const t=Ri(c.byteLength);if(t!==c.byteLength){const s=new Uint8Array(t);if(s.set(new Uint8Array(c)),e!==0)for(let n=c.byteLength;n<t;n++)s[n]=e;return s.buffer}return c}function Ls(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function ks(c,e){if(c.toBlob!==void 0)return new Promise(s=>c.toBlob(s,e));let t;return e==="image/jpeg"?t=.92:e==="image/webp"&&(t=.8),c.convertToBlob({type:e,quality:t})}class Da{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter r"+r.REVISION}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,t,s={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},s),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);const n=this,i=n.buffers,o=n.json;s=n.options;const a=n.extensionsUsed,A=n.extensionsRequired,l=new Blob(i,{type:"application/octet-stream"}),h=Object.keys(a),u=Object.keys(A);if(h.length>0&&(o.extensionsUsed=h),u.length>0&&(o.extensionsRequired=u),o.buffers&&o.buffers.length>0&&(o.buffers[0].byteLength=l.size),s.binary===!0){const g=new FileReader;g.readAsArrayBuffer(l),g.onloadend=function(){const f=Rn(g.result),I=new DataView(new ArrayBuffer(Fs));I.setUint32(0,f.byteLength,!0),I.setUint32(4,Ta,!0);const m=Rn(va(JSON.stringify(o)),32),b=new DataView(new ArrayBuffer(Fs));b.setUint32(0,m.byteLength,!0),b.setUint32(4,Sa,!0);const B=new ArrayBuffer(_s),w=new DataView(B);w.setUint32(0,Qa,!0),w.setUint32(4,xa,!0);const C=_s+b.byteLength+m.byteLength+I.byteLength+f.byteLength;w.setUint32(8,C,!0);const y=new Blob([B,b,m,I,f],{type:"application/octet-stream"}),x=new FileReader;x.readAsArrayBuffer(y),x.onloadend=function(){t(x.result)}}}else if(o.buffers&&o.buffers.length>0){const g=new FileReader;g.readAsDataURL(l),g.onloadend=function(){const f=g.result;o.buffers[0].uri=f,t(o)}}else t(o)}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;const s=this.options,n=this.extensionsUsed;try{const i=JSON.parse(JSON.stringify(e.userData));if(s.includeCustomExtensions&&i.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(const o in i.gltfExtensions)t.extensions[o]=i.gltfExtensions[o],n[o]=!0;delete i.gltfExtensions}Object.keys(i).length>0&&(t.extras=i)}catch(i){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+i.message)}}getUID(e,t=!1){if(this.uids.has(e)===!1){const n=new Map;n.set(!0,this.uid++),n.set(!1,this.uid++),this.uids.set(e,n)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const s=new r.Vector3;for(let n=0,i=e.count;n<i;n++)if(Math.abs(s.fromBufferAttribute(e,n).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);const s=e.clone(),n=new r.Vector3;for(let i=0,o=s.count;i<o;i++)n.fromBufferAttribute(s,i),n.x===0&&n.y===0&&n.z===0?n.setX(1):n.normalize(),s.setXYZ(i,n.x,n.y,n.z);return t.attributesNormalized.set(e,s),s}applyTextureTransform(e,t){let s=!1;const n={};(t.offset.x!==0||t.offset.y!==0)&&(n.offset=t.offset.toArray(),s=!0),t.rotation!==0&&(n.rotation=t.rotation,s=!0),(t.repeat.x!==1||t.repeat.y!==1)&&(n.scale=t.repeat.toArray(),s=!0),s&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=n,this.extensionsUsed.KHR_texture_transform=!0)}buildMetalRoughTexture(e,t){if(e===t)return e;function s(f){return f.colorSpace===r.SRGBColorSpace?function(m){return m<.04045?m*.0773993808:Math.pow(m*.9478672986+.0521327014,2.4)}:function(m){return m}}console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),e instanceof r.CompressedTexture&&(e=vn(e)),t instanceof r.CompressedTexture&&(t=vn(t));const n=e?e.image:null,i=t?t.image:null,o=Math.max(n?n.width:0,i?i.width:0),a=Math.max(n?n.height:0,i?i.height:0),A=Ls();A.width=o,A.height=a;const l=A.getContext("2d",{willReadFrequently:!0});l.fillStyle="#00ffff",l.fillRect(0,0,o,a);const h=l.getImageData(0,0,o,a);if(n){l.drawImage(n,0,0,o,a);const f=s(e),I=l.getImageData(0,0,o,a).data;for(let m=2;m<I.length;m+=4)h.data[m]=f(I[m]/256)*256}if(i){l.drawImage(i,0,0,o,a);const f=s(t),I=l.getImageData(0,0,o,a).data;for(let m=1;m<I.length;m+=4)h.data[m]=f(I[m]/256)*256}l.putImageData(h,0,0);const g=(e||t).clone();return g.source=new r.Source(A),g.colorSpace=r.NoColorSpace,g.channel=(e||t).channel,e&&t&&e.channel!==t.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),g}processBuffer(e){const t=this.json,s=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),s.push(e),0}processBufferView(e,t,s,n,i){const o=this.json;o.bufferViews||(o.bufferViews=[]);let a;switch(t){case ae.BYTE:case ae.UNSIGNED_BYTE:a=1;break;case ae.SHORT:case ae.UNSIGNED_SHORT:a=2;break;default:a=4}let A=e.itemSize*a;i===ae.ARRAY_BUFFER&&(A=Math.ceil(A/4)*4);const l=Ri(n*A),h=new DataView(new ArrayBuffer(l));let u=0;for(let I=s;I<s+n;I++){for(let m=0;m<e.itemSize;m++){let b;e.itemSize>4?b=e.array[I*e.itemSize+m]:(m===0?b=e.getX(I):m===1?b=e.getY(I):m===2?b=e.getZ(I):m===3&&(b=e.getW(I)),e.normalized===!0&&(b=r.MathUtils.normalize(b,e.array))),t===ae.FLOAT?h.setFloat32(u,b,!0):t===ae.INT?h.setInt32(u,b,!0):t===ae.UNSIGNED_INT?h.setUint32(u,b,!0):t===ae.SHORT?h.setInt16(u,b,!0):t===ae.UNSIGNED_SHORT?h.setUint16(u,b,!0):t===ae.BYTE?h.setInt8(u,b):t===ae.UNSIGNED_BYTE&&h.setUint8(u,b),u+=a}u%A!==0&&(u+=A-u%A)}const g={buffer:this.processBuffer(h.buffer),byteOffset:this.byteOffset,byteLength:l};return i!==void 0&&(g.target=i),i===ae.ARRAY_BUFFER&&(g.byteStride=A),this.byteOffset+=l,o.bufferViews.push(g),{id:o.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const t=this,s=t.json;return s.bufferViews||(s.bufferViews=[]),new Promise(function(n){const i=new FileReader;i.readAsArrayBuffer(e),i.onloadend=function(){const o=Rn(i.result),a={buffer:t.processBuffer(o),byteOffset:t.byteOffset,byteLength:o.byteLength};t.byteOffset+=o.byteLength,n(s.bufferViews.push(a)-1)}})}processAccessor(e,t,s,n){const i=this.json,o={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let a;if(e.array.constructor===Float32Array)a=ae.FLOAT;else if(e.array.constructor===Int32Array)a=ae.INT;else if(e.array.constructor===Uint32Array)a=ae.UNSIGNED_INT;else if(e.array.constructor===Int16Array)a=ae.SHORT;else if(e.array.constructor===Uint16Array)a=ae.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)a=ae.BYTE;else if(e.array.constructor===Uint8Array)a=ae.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(s===void 0&&(s=0),(n===void 0||n===1/0)&&(n=e.count),n===0)return null;const A=Ra(e,s,n);let l;t!==void 0&&(l=e===t.index?ae.ELEMENT_ARRAY_BUFFER:ae.ARRAY_BUFFER);const h=this.processBufferView(e,a,s,n,l),u={bufferView:h.id,byteOffset:h.byteOffset,componentType:a,count:n,max:A.max,min:A.min,type:o[e.itemSize]};return e.normalized===!0&&(u.normalized=!0),i.accessors||(i.accessors=[]),i.accessors.push(u)-1}processImage(e,t,s,n="image/png"){if(e!==null){const i=this,o=i.cache,a=i.json,A=i.options,l=i.pending;o.images.has(e)||o.images.set(e,{});const h=o.images.get(e),u=n+":flipY/"+s.toString();if(h[u]!==void 0)return h[u];a.images||(a.images=[]);const g={mimeType:n},f=Ls();f.width=Math.min(e.width,A.maxTextureSize),f.height=Math.min(e.height,A.maxTextureSize);const I=f.getContext("2d",{willReadFrequently:!0});if(s===!0&&(I.translate(0,f.height),I.scale(1,-1)),e.data!==void 0){t!==r.RGBAFormat&&console.error("GLTFExporter: Only RGBAFormat is supported.",t),(e.width>A.maxTextureSize||e.height>A.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const b=new Uint8ClampedArray(e.height*e.width*4);for(let B=0;B<b.length;B+=4)b[B+0]=e.data[B+0],b[B+1]=e.data[B+1],b[B+2]=e.data[B+2],b[B+3]=e.data[B+3];I.putImageData(new ImageData(b,e.width,e.height),0,0)}else if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)I.drawImage(e,0,0,f.width,f.height);else throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");A.binary===!0?l.push(ks(f,n).then(b=>i.processBufferViewImage(b)).then(b=>{g.bufferView=b})):f.toDataURL!==void 0?g.uri=f.toDataURL(n):l.push(ks(f,n).then(b=>new FileReader().readAsDataURL(b)).then(b=>{g.uri=b}));const m=a.images.push(g)-1;return h[u]=m,m}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){const t=this.json;t.samplers||(t.samplers=[]);const s={magFilter:je[e.magFilter],minFilter:je[e.minFilter],wrapS:je[e.wrapS],wrapT:je[e.wrapT]};return t.samplers.push(s)-1}processTexture(e){const s=this.options,n=this.cache,i=this.json;if(n.textures.has(e))return n.textures.get(e);const o={keep:!0,newTexture:null};if(this._invokeAll(function(h){h.beforeWriteTexture&&h.beforeWriteTexture(e,o)}),o.keep===!1)return null;o.newTexture!=null&&(e=o.newTexture),i.textures||(i.textures=[]),e instanceof r.CompressedTexture&&(e=vn(e,s.maxTextureSize));let a=e.userData.mimeType;a==="image/webp"&&(a="image/png");const A={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,a)};e.name&&(A.name=e.name),this._invokeAll(function(h){h.writeTexture&&h.writeTexture(e,A)});const l=i.textures.push(A)-1;return n.textures.set(e,l),l}processMaterial(e){const t=this.cache,s=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;s.materials||(s.materials=[]);const n={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const i=e.color.toArray().concat([e.opacity]);qt(i,[1,1,1,1])||(n.pbrMetallicRoughness.baseColorFactor=i),e.isMeshStandardMaterial?(n.pbrMetallicRoughness.metallicFactor=e.metalness,n.pbrMetallicRoughness.roughnessFactor=e.roughness):(n.pbrMetallicRoughness.metallicFactor=.5,n.pbrMetallicRoughness.roughnessFactor=.5);const o=e.metalnessMap?.image?e.metalnessMap:void 0,a=e.roughnessMap?.image?e.roughnessMap:void 0;if(o||a){const l=this.buildMetalRoughTexture(o,a),h={index:this.processTexture(l),channel:l.channel};this.applyTextureTransform(h,l),n.pbrMetallicRoughness.metallicRoughnessTexture=h}if(e.map){const l={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(l,e.map),n.pbrMetallicRoughness.baseColorTexture=l}if(e.emissive){const l=e.emissive;if(Math.max(l.r,l.g,l.b)>0&&(n.emissiveFactor=e.emissive.toArray()),e.emissiveMap?.image){const u={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(u,e.emissiveMap),n.emissiveTexture=u}}if(e.normalMap?.image){const l={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(l.scale=e.normalScale.x),this.applyTextureTransform(l,e.normalMap),n.normalTexture=l}if(e.aoMap?.image){const l={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(l.strength=e.aoMapIntensity),this.applyTextureTransform(l,e.aoMap),n.occlusionTexture=l}e.transparent?n.alphaMode="BLEND":e.alphaTest>0&&(n.alphaMode="MASK",n.alphaCutoff=e.alphaTest),e.side===r.DoubleSide&&(n.doubleSided=!0),e.name!==""&&(n.name=e.name),this.serializeUserData(e,n),this._invokeAll(function(l){l.writeMaterial&&l.writeMaterial(e,n)});const A=s.materials.push(n)-1;return t.materials.set(e,A),A}processMesh(e){const t={keep:!0};if(this._invokeAll(function(x){x.beforeWriteMesh&&x.beforeWriteMesh(e,t)}),t.keep!=!0)return null;const s=this.cache,n=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let x=0,R=e.material.length;x<R;x++)i.push(e.material[x].uuid);else i.push(e.material.uuid);const o=i.join(":");if(s.meshes.has(o))return s.meshes.get(o);const a=e.geometry;let A;e.isLineSegments?A=ae.LINES:e.isLineLoop?A=ae.LINE_LOOP:e.isLine?A=ae.LINE_STRIP:e.isPoints?A=ae.POINTS:A=e.material.wireframe?ae.LINES:ae.TRIANGLES;const l={},h={},u=[],g=[],f={uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},I=a.getAttribute("normal");I!==void 0&&!this.isNormalizedNormalAttribute(I)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),a.setAttribute("normal",this.createNormalizedNormalAttribute(I)));let m=null;for(let x in a.attributes){if(x.slice(0,5)==="morph")continue;const R=a.attributes[x];if(x=f[x]||x.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(x)||(x="_"+x),s.attributes.has(this.getUID(R))){h[x]=s.attributes.get(this.getUID(R));continue}m=null;const S=R.array;x==="JOINTS_0"&&!(S instanceof Uint16Array)&&!(S instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),m=new r.BufferAttribute(new Uint16Array(S),R.itemSize,R.normalized));const v=this.processAccessor(m||R,a);v!==null&&(x.startsWith("_")||this.detectMeshQuantization(x,R),h[x]=v,s.attributes.set(this.getUID(R),v))}if(I!==void 0&&a.setAttribute("normal",I),Object.keys(h).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const x=[],R=[],D={};if(e.morphTargetDictionary!==void 0)for(const S in e.morphTargetDictionary)D[e.morphTargetDictionary[S]]=S;for(let S=0;S<e.morphTargetInfluences.length;++S){const v={};let N=!1;for(const G in a.morphAttributes){if(G!=="position"&&G!=="normal"&&G!=="color"){N||(console.warn("GLTFExporter: Only POSITION, NORMAL and COLOR morph are supported."),N=!0);continue}const H=a.morphAttributes[G][S],X=G.toUpperCase()+(G==="color"?"_0":""),U=a.attributes[G];if(s.attributes.has(this.getUID(H,!0))){v[X]=s.attributes.get(this.getUID(H,!0));continue}const Y=H.clone();if(!a.morphTargetsRelative)for(let O=0,Z=H.count;O<Z;O++)for(let ie=0;ie<H.itemSize;ie++)ie===0&&Y.setX(O,H.getX(O)-U.getX(O)),ie===1&&Y.setY(O,H.getY(O)-U.getY(O)),ie===2&&Y.setZ(O,H.getZ(O)-U.getZ(O)),ie===3&&Y.setW(O,H.getW(O)-U.getW(O));v[X]=this.processAccessor(Y,a),s.attributes.set(this.getUID(U,!0),v[X])}g.push(v),x.push(e.morphTargetInfluences[S]),e.morphTargetDictionary!==void 0&&R.push(D[S])}l.weights=x,R.length>0&&(l.extras={},l.extras.targetNames=R)}const b=Array.isArray(e.material);if(b&&a.groups.length===0)return null;let B=!1;if(b&&a.index===null){const x=[];for(let R=0,D=a.attributes.position.count;R<D;R++)x[R]=R;a.setIndex(x),B=!0}const w=b?e.material:[e.material],C=b?a.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let x=0,R=C.length;x<R;x++){const D={mode:A,attributes:h};if(this.serializeUserData(a,D),g.length>0&&(D.targets=g),a.index!==null){let v=this.getUID(a.index);(C[x].start!==void 0||C[x].count!==void 0)&&(v+=":"+C[x].start+":"+C[x].count),s.attributes.has(v)?D.indices=s.attributes.get(v):(D.indices=this.processAccessor(a.index,a,C[x].start,C[x].count),s.attributes.set(v,D.indices)),D.indices===null&&delete D.indices}const S=this.processMaterial(w[C[x].materialIndex]);S!==null&&(D.material=S),u.push(D)}B===!0&&a.setIndex(null),l.primitives=u,n.meshes||(n.meshes=[]),this._invokeAll(function(x){x.writeMesh&&x.writeMesh(e,l)});const y=n.meshes.push(l)-1;return s.meshes.set(o,y),y}detectMeshQuantization(e,t){if(this.extensionsUsed[Mn])return;let s;switch(t.array.constructor){case Int8Array:s="byte";break;case Uint8Array:s="unsigned byte";break;case Int16Array:s="short";break;case Uint16Array:s="unsigned short";break;default:return}t.normalized&&(s+=" normalized");const n=e.split("_",1)[0];Rs[n]&&Rs[n].includes(s)&&(this.extensionsUsed[Mn]=!0,this.extensionsRequired[Mn]=!0)}processCamera(e){const t=this.json;t.cameras||(t.cameras=[]);const s=e.isOrthographicCamera,n={type:s?"orthographic":"perspective"};return s?n.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:n.perspective={aspectRatio:e.aspect,yfov:r.MathUtils.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(n.name=e.type),t.cameras.push(n)-1}processAnimation(e,t){const s=this.json,n=this.nodeMap;s.animations||(s.animations=[]),e=es.Utils.mergeMorphTargetTracks(e.clone(),t);const i=e.tracks,o=[],a=[];for(let A=0;A<i.length;++A){const l=i[A],h=r.PropertyBinding.parseTrackName(l.name);let u=r.PropertyBinding.findNode(t,h.nodeName);const g=Ds[h.propertyName];if(h.objectName==="bones"&&(u.isSkinnedMesh===!0?u=u.skeleton.getBoneByName(h.objectIndex):u=void 0),!u||!g){console.warn('THREE.GLTFExporter: Could not export animation track "%s".',l.name);continue}const f=1;let I=l.values.length/l.times.length;g===Ds.morphTargetInfluences&&(I/=u.morphTargetInfluences.length);let m;l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(m="CUBICSPLINE",I/=3):l.getInterpolation()===r.InterpolateDiscrete?m="STEP":m="LINEAR",a.push({input:this.processAccessor(new r.BufferAttribute(l.times,f)),output:this.processAccessor(new r.BufferAttribute(l.values,I)),interpolation:m}),o.push({sampler:a.length-1,target:{node:n.get(u),path:g}})}return s.animations.push({name:e.name||"clip_"+s.animations.length,samplers:a,channels:o}),s.animations.length-1}processSkin(e){const t=this.json,s=this.nodeMap,n=t.nodes[s.get(e)],i=e.skeleton;if(i===void 0)return null;const o=e.skeleton.bones[0];if(o===void 0)return null;const a=[],A=new Float32Array(i.bones.length*16),l=new r.Matrix4;for(let u=0;u<i.bones.length;++u)a.push(s.get(i.bones[u])),l.copy(i.boneInverses[u]),l.multiply(e.bindMatrix).toArray(A,u*16);return t.skins===void 0&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new r.BufferAttribute(A,16)),joints:a,skeleton:s.get(o)}),n.skin=t.skins.length-1}processNode(e){const t={keep:!0};if(this._invokeAll(function(A){A.beforeWriteNode&&A.beforeWriteNode(e,t)}),t.keep!=!0)return null;const s=this.json,n=this.options,i=this.nodeMap;s.nodes||(s.nodes=[]);const o={};if(n.trs){const A=e.quaternion.toArray(),l=e.position.toArray(),h=e.scale.toArray();qt(A,[0,0,0,1])||(o.rotation=A),qt(l,[0,0,0])||(o.translation=l),qt(h,[1,1,1])||(o.scale=h)}else e.matrixAutoUpdate&&e.updateMatrix(),Ma(e.matrix)===!1&&(o.matrix=e.matrix.elements);if(e.name!==""&&(o.name=String(e.name)),this.serializeUserData(e,o),e.isMesh||e.isLine||e.isPoints){const A=this.processMesh(e);A!==null&&(o.mesh=A)}else e.isCamera&&(o.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){const A=[];for(let l=0,h=e.children.length;l<h;l++){const u=e.children[l];if(u.visible||n.onlyVisible===!1){const g=this.processNode(u);g!==null&&A.push(g)}}A.length>0&&(o.children=A)}this._invokeAll(function(A){A.writeNode&&A.writeNode(e,o)});const a=s.nodes.push(o)-1;return i.set(e,a),a}processScene(e){const t=this.json,s=this.options;t.scenes||(t.scenes=[],t.scene=0);const n={};e.name!==""&&(n.name=e.name),t.scenes.push(n);const i=[];for(let o=0,a=e.children.length;o<a;o++){const A=e.children[o];if(A.visible||s.onlyVisible===!1){const l=this.processNode(A);l!==null&&i.push(l)}}i.length>0&&(n.nodes=i),this.serializeUserData(e,n)}processObjects(e){const t=new r.Scene;t.name="AuxScene";for(let s=0;s<e.length;s++)t.children.push(e[s]);this.processScene(t)}processInput(e){const t=this.options;e=e instanceof Array?e:[e],this._invokeAll(function(n){n.beforeParse&&n.beforeParse(e)});const s=[];for(let n=0;n<e.length;n++)e[n]instanceof r.Scene?this.processScene(e[n]):s.push(e[n]);s.length>0&&this.processObjects(s);for(let n=0;n<this.skins.length;++n)this.processSkin(this.skins[n]);for(let n=0;n<t.animations.length;++n)this.processAnimation(t.animations[n],e[0]);this._invokeAll(function(n){n.afterParse&&n.afterParse(e)})}_invokeAll(e){for(let t=0,s=this.plugins.length;t<s;t++)e(this.plugins[t])}}class _a{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight){console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);return}const s=this.writer,n=s.json,i=s.extensionsUsed,o={};e.name&&(o.name=e.name),o.color=e.color.toArray(),o.intensity=e.intensity,e.isDirectionalLight?o.type="directional":e.isPointLight?(o.type="point",e.distance>0&&(o.range=e.distance)):e.isSpotLight&&(o.type="spot",e.distance>0&&(o.range=e.distance),o.spot={},o.spot.innerConeAngle=(1-e.penumbra)*e.angle,o.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),i[this.name]||(n.extensions=n.extensions||{},n.extensions[this.name]={lights:[]},i[this.name]=!0);const a=n.extensions[this.name].lights;a.push(o),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}}class Fa{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;const n=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},n[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}}class La{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;const s=this.writer,n=s.extensionsUsed,i={};if(i.clearcoatFactor=e.clearcoat,e.clearcoatMap){const o={index:s.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};s.applyTextureTransform(o,e.clearcoatMap),i.clearcoatTexture=o}if(i.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){const o={index:s.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};s.applyTextureTransform(o,e.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=o}if(e.clearcoatNormalMap){const o={index:s.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};e.clearcoatNormalScale.x!==1&&(o.scale=e.clearcoatNormalScale.x),s.applyTextureTransform(o,e.clearcoatNormalMap),i.clearcoatNormalTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class ka{constructor(e){this.writer=e,this.name="KHR_materials_dispersion"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.dispersion===0)return;const n=this.writer.extensionsUsed,i={};i.dispersion=e.dispersion,t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class Ga{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;const s=this.writer,n=s.extensionsUsed,i={};if(i.iridescenceFactor=e.iridescence,e.iridescenceMap){const o={index:s.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};s.applyTextureTransform(o,e.iridescenceMap),i.iridescenceTexture=o}if(i.iridescenceIor=e.iridescenceIOR,i.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){const o={index:s.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};s.applyTextureTransform(o,e.iridescenceThicknessMap),i.iridescenceThicknessTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class Ua{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const s=this.writer,n=s.extensionsUsed,i={};if(i.transmissionFactor=e.transmission,e.transmissionMap){const o={index:s.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};s.applyTextureTransform(o,e.transmissionMap),i.transmissionTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class Na{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const s=this.writer,n=s.extensionsUsed,i={};if(i.thicknessFactor=e.thickness,e.thicknessMap){const o={index:s.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};s.applyTextureTransform(o,e.thicknessMap),i.thicknessTexture=o}e.attenuationDistance!==1/0&&(i.attenuationDistance=e.attenuationDistance),i.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class Pa{constructor(e){this.writer=e,this.name="KHR_materials_ior"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;const n=this.writer.extensionsUsed,i={};i.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class Oa{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(wa)&&!e.specularIntensityMap&&!e.specularColorMap)return;const s=this.writer,n=s.extensionsUsed,i={};if(e.specularIntensityMap){const o={index:s.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};s.applyTextureTransform(o,e.specularIntensityMap),i.specularTexture=o}if(e.specularColorMap){const o={index:s.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};s.applyTextureTransform(o,e.specularColorMap),i.specularColorTexture=o}i.specularFactor=e.specularIntensity,i.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class Ha{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;const s=this.writer,n=s.extensionsUsed,i={};if(e.sheenRoughnessMap){const o={index:s.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};s.applyTextureTransform(o,e.sheenRoughnessMap),i.sheenRoughnessTexture=o}if(e.sheenColorMap){const o={index:s.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};s.applyTextureTransform(o,e.sheenColorMap),i.sheenColorTexture=o}i.sheenRoughnessFactor=e.sheenRoughness,i.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class ja{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;const s=this.writer,n=s.extensionsUsed,i={};if(e.anisotropyMap){const o={index:s.processTexture(e.anisotropyMap)};s.applyTextureTransform(o,e.anisotropyMap),i.anisotropyTexture=o}i.anisotropyStrength=e.anisotropy,i.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class qa{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;const n=this.writer.extensionsUsed,i={};i.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class za{constructor(e){this.writer=e,this.name="EXT_materials_bump"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.bumpScale===1&&!e.bumpMap)return;const s=this.writer,n=s.extensionsUsed,i={};if(e.bumpMap){const o={index:s.processTexture(e.bumpMap),texCoord:e.bumpMap.channel};s.applyTextureTransform(o,e.bumpMap),i.bumpTexture=o}i.bumpFactor=e.bumpScale,t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class Ya{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,t){if(!e.isInstancedMesh)return;const s=this.writer,n=e,i=new Float32Array(n.count*3),o=new Float32Array(n.count*4),a=new Float32Array(n.count*3),A=new r.Matrix4,l=new r.Vector3,h=new r.Quaternion,u=new r.Vector3;for(let f=0;f<n.count;f++)n.getMatrixAt(f,A),A.decompose(l,h,u),l.toArray(i,f*3),h.toArray(o,f*4),u.toArray(a,f*3);const g={TRANSLATION:s.processAccessor(new r.BufferAttribute(i,3)),ROTATION:s.processAccessor(new r.BufferAttribute(o,4)),SCALE:s.processAccessor(new r.BufferAttribute(a,3))};n.instanceColor&&(g._COLOR_0=s.processAccessor(n.instanceColor)),t.extensions=t.extensions||{},t.extensions[this.name]={attributes:g},s.extensionsUsed[this.name]=!0,s.extensionsRequired[this.name]=!0}}es.Utils={insertKeyframe:function(c,e){const s=c.getValueSize(),n=new c.TimeBufferType(c.times.length+1),i=new c.ValueBufferType(c.values.length+s),o=c.createInterpolant(new c.ValueBufferType(s));let a;if(c.times.length===0){n[0]=e;for(let A=0;A<s;A++)i[A]=0;a=0}else if(e<c.times[0]){if(Math.abs(c.times[0]-e)<.001)return 0;n[0]=e,n.set(c.times,1),i.set(o.evaluate(e),0),i.set(c.values,s),a=0}else if(e>c.times[c.times.length-1]){if(Math.abs(c.times[c.times.length-1]-e)<.001)return c.times.length-1;n[n.length-1]=e,n.set(c.times,0),i.set(c.values,0),i.set(o.evaluate(e),c.values.length),a=n.length-1}else for(let A=0;A<c.times.length;A++){if(Math.abs(c.times[A]-e)<.001)return A;if(c.times[A]<e&&c.times[A+1]>e){n.set(c.times.slice(0,A+1),0),n[A+1]=e,n.set(c.times.slice(A+1),A+2),i.set(c.values.slice(0,(A+1)*s),0),i.set(o.evaluate(e),(A+1)*s),i.set(c.values.slice((A+1)*s),(A+2)*s),a=A+1;break}}return c.times=n,c.values=i,a},mergeMorphTargetTracks:function(c,e){const t=[],s={},n=c.tracks;for(let i=0;i<n.length;++i){let o=n[i];const a=r.PropertyBinding.parseTrackName(o.name),A=r.PropertyBinding.findNode(e,a.nodeName);if(a.propertyName!=="morphTargetInfluences"||a.propertyIndex===void 0){t.push(o);continue}if(o.createInterpolant!==o.InterpolantFactoryMethodDiscrete&&o.createInterpolant!==o.InterpolantFactoryMethodLinear){if(o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),o=o.clone(),o.setInterpolation(r.InterpolateLinear)}const l=A.morphTargetInfluences.length,h=A.morphTargetDictionary[a.propertyIndex];if(h===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+a.propertyIndex);let u;if(s[A.uuid]===void 0){u=o.clone();const f=new u.ValueBufferType(l*u.times.length);for(let I=0;I<u.times.length;I++)f[I*l+h]=u.values[I];u.name=(a.nodeName||"")+".morphTargetInfluences",u.values=f,s[A.uuid]=u,t.push(u);continue}const g=o.createInterpolant(new o.ValueBufferType(1));u=s[A.uuid];for(let f=0;f<u.times.length;f++)u.values[f*l+h]=g.evaluate(u.times[f]);for(let f=0;f<o.times.length;f++){const I=this.insertKeyframe(u,o.times[f]);u.values[I*l+h]=o.values[f]}}return c.tracks=t,c}};const Be={ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};async function Di(c){const e=await fetch(c);if(e.ok)return e.json();throw new Error(e.statusText)}async function Ka(c){if(!c)throw new Error("No basePath supplied");return await Di(`${c}/profilesList.json`)}async function Va(c,e,t=null,s=!0){if(!c)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No basePath supplied");const n=await Ka(e);let i;if(c.profiles.some(A=>{const l=n[A];return l&&(i={profileId:A,profilePath:`${e}/${l.path}`,deprecated:!!l.deprecated}),!!i}),!i){if(!t)throw new Error("No matching profile name found");const A=n[t];if(!A)throw new Error(`No matching profile name found and default profile "${t}" missing.`);i={profileId:t,profilePath:`${e}/${A.path}`,deprecated:!!A.deprecated}}const o=await Di(i.profilePath);let a;if(s){let A;if(c.handedness==="any"?A=o.layouts[Object.keys(o.layouts)[0]]:A=o.layouts[c.handedness],!A)throw new Error(`No matching handedness, ${c.handedness}, in profile ${i.profileId}`);A.assetPath&&(a=i.profilePath.replace("profile.json",A.assetPath))}return{profile:o,assetPath:a}}const Ja={xAxis:0,yAxis:0,button:0,state:Be.ComponentState.DEFAULT};function Wa(c=0,e=0){let t=c,s=e;if(Math.sqrt(c*c+e*e)>1){const o=Math.atan2(e,c);t=Math.cos(o),s=Math.sin(o)}return{normalizedXAxis:t*.5+.5,normalizedYAxis:s*.5+.5}}class Xa{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===Be.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(Ja)}updateFromComponent({xAxis:e,yAxis:t,button:s,state:n}){const{normalizedXAxis:i,normalizedYAxis:o}=Wa(e,t);switch(this.componentProperty){case Be.ComponentProperty.X_AXIS:this.value=this.states.includes(n)?i:.5;break;case Be.ComponentProperty.Y_AXIS:this.value=this.states.includes(n)?o:.5;break;case Be.ComponentProperty.BUTTON:this.value=this.states.includes(n)?s:0;break;case Be.ComponentProperty.STATE:this.valueNodeProperty===Be.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(n):this.value=this.states.includes(n)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class Za{constructor(e,t){if(!e||!t||!t.visualResponses||!t.gamepadIndices||Object.keys(t.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach(s=>{const n=new Xa(t.visualResponses[s]);this.visualResponses[s]=n}),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:Be.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(e){if(this.values.state=Be.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&e.buttons.length>this.gamepadIndices.button){const t=e.buttons[this.gamepadIndices.button];this.values.button=t.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,t.pressed||this.values.button===1?this.values.state=Be.ComponentState.PRESSED:(t.touched||this.values.button>Be.ButtonTouchThreshold)&&(this.values.state=Be.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&e.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=e.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===Be.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Be.AxisTouchThreshold&&(this.values.state=Be.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&e.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=e.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===Be.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Be.AxisTouchThreshold&&(this.values.state=Be.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(t=>{t.updateFromComponent(this.values)})}}class $a{constructor(e,t,s){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");this.xrInputSource=e,this.assetUrl=s,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(n=>{const i=this.layoutDescription.components[n];this.components[n]=new Za(n,i)}),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const e=[];return Object.values(this.components).forEach(t=>{e.push(t.data)}),e}updateFromGamepad(){Object.values(this.components).forEach(e=>{e.updateFromGamepad(this.xrInputSource.gamepad)})}}const eA="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",tA="generic-trigger";class nA extends r.Object3D{constructor(){super(),this.motionController=null,this.envMap=null}setEnvironmentMap(e){return this.envMap==e?this:(this.envMap=e,this.traverse(t=>{t.isMesh&&(t.material.envMap=this.envMap,t.material.needsUpdate=!0)}),this)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(t=>{Object.values(t.visualResponses).forEach(s=>{const{valueNode:n,minNode:i,maxNode:o,value:a,valueNodeProperty:A}=s;n&&(A===Be.VisualResponseProperty.VISIBILITY?n.visible=a:A===Be.VisualResponseProperty.TRANSFORM&&(n.quaternion.slerpQuaternions(i.quaternion,o.quaternion,a),n.position.lerpVectors(i.position,o.position,a)))})}))}}function sA(c,e){Object.values(c.components).forEach(t=>{const{type:s,touchPointNodeName:n,visualResponses:i}=t;if(s===Be.ComponentType.TOUCHPAD)if(t.touchPointNode=e.getObjectByName(n),t.touchPointNode){const o=new r.SphereGeometry(.001),a=new r.MeshBasicMaterial({color:255}),A=new r.Mesh(o,a);t.touchPointNode.add(A)}else console.warn(`Could not find touch dot, ${t.touchPointNodeName}, in touchpad component ${t.id}`);Object.values(i).forEach(o=>{const{valueNodeName:a,minNodeName:A,maxNodeName:l,valueNodeProperty:h}=o;if(h===Be.VisualResponseProperty.TRANSFORM){if(o.minNode=e.getObjectByName(A),o.maxNode=e.getObjectByName(l),!o.minNode){console.warn(`Could not find ${A} in the model`);return}if(!o.maxNode){console.warn(`Could not find ${l} in the model`);return}}o.valueNode=e.getObjectByName(a),o.valueNode||console.warn(`Could not find ${a} in the model`)})})}function Gs(c,e){sA(c.motionController,e),c.envMap&&e.traverse(t=>{t.isMesh&&(t.material.envMap=c.envMap,t.material.needsUpdate=!0)}),c.layers.mask!=0&&e.traverse(t=>{t.layers.mask=c.layers.mask}),c.add(e)}class iA{constructor(e=null,t=null){this.gltfLoader=e,this.path=eA,this._assetCache={},this.onLoad=t,this.gltfLoader||(this.gltfLoader=new Vn)}setPath(e){return this.path=e,this}createControllerModel(e){const t=new nA;let s=null;return e.addEventListener("connected",n=>{const i=n.data;i.targetRayMode!=="tracked-pointer"||!i.gamepad||i.hand||Va(i,this.path,tA).then(({profile:o,assetPath:a})=>{t.motionController=new $a(i,o,a);const A=this._assetCache[t.motionController.assetUrl];if(A)s=A.scene.clone(),Gs(t,s),this.onLoad&&this.onLoad(s);else{if(!this.gltfLoader)throw new Error("GLTFLoader not set.");this.gltfLoader.setPath(""),this.gltfLoader.load(t.motionController.assetUrl,l=>{this._assetCache[t.motionController.assetUrl]=l,s=l.scene.clone(),Gs(t,s),this.onLoad&&this.onLoad(s)},null,()=>{throw new Error(`Asset ${t.motionController.assetUrl} missing or malformed.`)})}}).catch(o=>{console.warn(o)})}),e.addEventListener("disconnected",()=>{t.motionController=null,t.remove(s),s=null}),t}}const oA="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/generic-hand/";class rA{constructor(e,t,s,n,i=null,o=null){this.controller=t,this.handModel=e,this.bones=[],i===null&&(i=new Vn,i.setPath(s||oA)),i.load(`${n}.glb`,a=>{const A=a.scene.children[0];this.handModel.add(A),A.layers.mask=this.handModel.layers.mask;const l=A.getObjectByProperty("type","SkinnedMesh");l.frustumCulled=!1,l.castShadow=!0,l.receiveShadow=!0,["wrist","thumb-metacarpal","thumb-phalanx-proximal","thumb-phalanx-distal","thumb-tip","index-finger-metacarpal","index-finger-phalanx-proximal","index-finger-phalanx-intermediate","index-finger-phalanx-distal","index-finger-tip","middle-finger-metacarpal","middle-finger-phalanx-proximal","middle-finger-phalanx-intermediate","middle-finger-phalanx-distal","middle-finger-tip","ring-finger-metacarpal","ring-finger-phalanx-proximal","ring-finger-phalanx-intermediate","ring-finger-phalanx-distal","ring-finger-tip","pinky-finger-metacarpal","pinky-finger-phalanx-proximal","pinky-finger-phalanx-intermediate","pinky-finger-phalanx-distal","pinky-finger-tip"].forEach(u=>{const g=A.getObjectByName(u);g!==void 0?g.jointName=u:console.warn(`Couldn't find ${u} in ${n} hand mesh`),this.bones.push(g)}),o&&o(A)})}updateMesh(){const e=this.controller.joints;for(let t=0;t<this.bones.length;t++){const s=this.bones[t];if(s){const n=e[s.jointName];if(n.visible){const i=n.position;s.position.copy(i),s.quaternion.copy(n.quaternion)}}}}}const Us=new r.Box3,tn=new r.Vector3;class _i extends r.InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],s=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(s),this.setAttribute("position",new r.Float32BufferAttribute(e,3)),this.setAttribute("uv",new r.Float32BufferAttribute(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,s=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),s.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const s=new r.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceStart",new r.InterleavedBufferAttribute(s,3,0)),this.setAttribute("instanceEnd",new r.InterleavedBufferAttribute(s,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const s=new r.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceColorStart",new r.InterleavedBufferAttribute(s,3,0)),this.setAttribute("instanceColorEnd",new r.InterleavedBufferAttribute(s,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new r.WireframeGeometry(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new r.Box3);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),Us.setFromBufferAttribute(t),this.boundingBox.union(Us))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new r.Sphere),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const s=this.boundingSphere.center;this.boundingBox.getCenter(s);let n=0;for(let i=0,o=e.count;i<o;i++)tn.fromBufferAttribute(e,i),n=Math.max(n,s.distanceToSquared(tn)),tn.fromBufferAttribute(t,i),n=Math.max(n,s.distanceToSquared(tn));this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}r.UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new r.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};r.ShaderLib.line={uniforms:r.UniformsUtils.merge([r.UniformsLib.common,r.UniformsLib.fog,r.UniformsLib.line]),vertexShader:`
|
|
72
|
+
}`},Mi={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class Kt{constructor(){this.textureUtils=null,this.pluginCallbacks=[],this.register(function(e){return new jr(e)}),this.register(function(e){return new qr(e)}),this.register(function(e){return new Yr(e)}),this.register(function(e){return new Jr(e)}),this.register(function(e){return new Xr(e)}),this.register(function(e){return new Wr(e)}),this.register(function(e){return new Kr(e)}),this.register(function(e){return new zr(e)}),this.register(function(e){return new Vr(e)}),this.register(function(e){return new Zr(e)}),this.register(function(e){return new $r(e)}),this.register(function(e){return new eA(e)}),this.register(function(e){return new tA(e)}),this.register(function(e){return new nA(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}setTextureUtils(e){return this.textureUtils=e,this}parse(e,t,i,n){const s=new Hr,o=[];for(let r=0,A=this.pluginCallbacks.length;r<A;r++)o.push(this.pluginCallbacks[r](s));s.setPlugins(o),s.setTextureUtils(this.textureUtils),s.writeAsync(e,t,n).catch(i)}parseAsync(e,t){const i=this;return new Promise(function(n,s){i.parse(e,n,s,t)})}}const Ae={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},Sn="KHR_mesh_quantization",Ke={};Ke[a.NearestFilter]=Ae.NEAREST;Ke[a.NearestMipmapNearestFilter]=Ae.NEAREST_MIPMAP_NEAREST;Ke[a.NearestMipmapLinearFilter]=Ae.NEAREST_MIPMAP_LINEAR;Ke[a.LinearFilter]=Ae.LINEAR;Ke[a.LinearMipmapNearestFilter]=Ae.LINEAR_MIPMAP_NEAREST;Ke[a.LinearMipmapLinearFilter]=Ae.LINEAR_MIPMAP_LINEAR;Ke[a.ClampToEdgeWrapping]=Ae.CLAMP_TO_EDGE;Ke[a.RepeatWrapping]=Ae.REPEAT;Ke[a.MirroredRepeatWrapping]=Ae.MIRRORED_REPEAT;const Fi={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},Fr=new a.Color,_i=12,_r=1179937895,kr=2,ki=8,Lr=1313821514,Gr=5130562;function ct(c,e){return c.length===e.length&&c.every(function(t,i){return t===e[i]})}function Ur(c){return new TextEncoder().encode(c).buffer}function Pr(c){return ct(c.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function Nr(c,e,t){const i={min:new Array(c.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(c.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let n=e;n<e+t;n++)for(let s=0;s<c.itemSize;s++){let o;c.itemSize>4?o=c.array[n*c.itemSize+s]:(s===0?o=c.getX(n):s===1?o=c.getY(n):s===2?o=c.getZ(n):s===3&&(o=c.getW(n)),c.normalized===!0&&(o=a.MathUtils.normalize(o,c.array))),i.min[s]=Math.min(i.min[s],o),i.max[s]=Math.max(i.max[s],o)}return i}function to(c){return Math.ceil(c/4)*4}function Tn(c,e=0){const t=to(c.byteLength);if(t!==c.byteLength){const i=new Uint8Array(t);if(i.set(new Uint8Array(c)),e!==0)for(let n=c.byteLength;n<t;n++)i[n]=e;return i.buffer}return c}function Li(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function Or(c,e){if(typeof OffscreenCanvas<"u"&&c instanceof OffscreenCanvas){let t;return e==="image/jpeg"?t=.92:e==="image/webp"&&(t=.8),c.convertToBlob({type:e,quality:t})}else return new Promise(t=>c.toBlob(t,e))}class Hr{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter r"+a.REVISION}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map},this.textureUtils=null}setPlugins(e){this.plugins=e}setTextureUtils(e){this.textureUtils=e}async writeAsync(e,t,i={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},i),this.options.animations.length>0&&(this.options.trs=!0),await this.processInputAsync(e),await Promise.all(this.pending);const n=this,s=n.buffers,o=n.json;i=n.options;const r=n.extensionsUsed,A=n.extensionsRequired,l=new Blob(s,{type:"application/octet-stream"}),h=Object.keys(r),p=Object.keys(A);if(h.length>0&&(o.extensionsUsed=h),p.length>0&&(o.extensionsRequired=p),o.buffers&&o.buffers.length>0&&(o.buffers[0].byteLength=l.size),i.binary===!0){const u=new FileReader;u.readAsArrayBuffer(l),u.onloadend=function(){const f=Tn(u.result),b=new DataView(new ArrayBuffer(ki));b.setUint32(0,f.byteLength,!0),b.setUint32(4,Gr,!0);const m=Tn(Ur(JSON.stringify(o)),32),E=new DataView(new ArrayBuffer(ki));E.setUint32(0,m.byteLength,!0),E.setUint32(4,Lr,!0);const B=new ArrayBuffer(_i),w=new DataView(B);w.setUint32(0,_r,!0),w.setUint32(4,kr,!0);const C=_i+E.byteLength+m.byteLength+b.byteLength+f.byteLength;w.setUint32(8,C,!0);const y=new Blob([B,E,m,b,f],{type:"application/octet-stream"}),Q=new FileReader;Q.readAsArrayBuffer(y),Q.onloadend=function(){t(Q.result)}}}else if(o.buffers&&o.buffers.length>0){const u=new FileReader;u.readAsDataURL(l),u.onloadend=function(){const f=u.result;o.buffers[0].uri=f,t(o)}}else t(o)}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;const i=this.options,n=this.extensionsUsed;try{const s=JSON.parse(JSON.stringify(e.userData));if(i.includeCustomExtensions&&s.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(const o in s.gltfExtensions)t.extensions[o]=s.gltfExtensions[o],n[o]=!0;delete s.gltfExtensions}Object.keys(s).length>0&&(t.extras=s)}catch(s){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+s.message)}}getUID(e,t=!1){if(this.uids.has(e)===!1){const n=new Map;n.set(!0,this.uid++),n.set(!1,this.uid++),this.uids.set(e,n)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const i=new a.Vector3;for(let n=0,s=e.count;n<s;n++)if(Math.abs(i.fromBufferAttribute(e,n).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);const i=e.clone(),n=new a.Vector3;for(let s=0,o=i.count;s<o;s++)n.fromBufferAttribute(i,s),n.x===0&&n.y===0&&n.z===0?n.setX(1):n.normalize(),i.setXYZ(s,n.x,n.y,n.z);return t.attributesNormalized.set(e,i),i}applyTextureTransform(e,t){let i=!1;const n={};(t.offset.x!==0||t.offset.y!==0)&&(n.offset=t.offset.toArray(),i=!0),t.rotation!==0&&(n.rotation=t.rotation,i=!0),(t.repeat.x!==1||t.repeat.y!==1)&&(n.scale=t.repeat.toArray(),i=!0),i&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=n,this.extensionsUsed.KHR_texture_transform=!0)}async buildMetalRoughTextureAsync(e,t){if(e===t)return e;function i(f){return f.colorSpace===a.SRGBColorSpace?function(m){return m<.04045?m*.0773993808:Math.pow(m*.9478672986+.0521327014,2.4)}:function(m){return m}}e instanceof a.CompressedTexture&&(e=await this.decompressTextureAsync(e)),t instanceof a.CompressedTexture&&(t=await this.decompressTextureAsync(t));const n=e?e.image:null,s=t?t.image:null,o=Math.max(n?n.width:0,s?s.width:0),r=Math.max(n?n.height:0,s?s.height:0),A=Li();A.width=o,A.height=r;const l=A.getContext("2d",{willReadFrequently:!0});l.fillStyle="#00ffff",l.fillRect(0,0,o,r);const h=l.getImageData(0,0,o,r);if(n){l.drawImage(n,0,0,o,r);const f=i(e),b=l.getImageData(0,0,o,r).data;for(let m=2;m<b.length;m+=4)h.data[m]=f(b[m]/256)*256}if(s){l.drawImage(s,0,0,o,r);const f=i(t),b=l.getImageData(0,0,o,r).data;for(let m=1;m<b.length;m+=4)h.data[m]=f(b[m]/256)*256}l.putImageData(h,0,0);const u=(e||t).clone();return u.source=new a.Source(A),u.colorSpace=a.NoColorSpace,u.channel=(e||t).channel,e&&t&&e.channel!==t.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),u}async decompressTextureAsync(e,t=1/0){if(this.textureUtils===null)throw new Error("THREE.GLTFExporter: setTextureUtils() must be called to process compressed textures.");return await this.textureUtils.decompress(e,t)}processBuffer(e){const t=this.json,i=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),i.push(e),0}processBufferView(e,t,i,n,s){const o=this.json;o.bufferViews||(o.bufferViews=[]);let r;switch(t){case Ae.BYTE:case Ae.UNSIGNED_BYTE:r=1;break;case Ae.SHORT:case Ae.UNSIGNED_SHORT:r=2;break;default:r=4}let A=e.itemSize*r;s===Ae.ARRAY_BUFFER&&(A=Math.ceil(A/4)*4);const l=to(n*A),h=new DataView(new ArrayBuffer(l));let p=0;for(let b=i;b<i+n;b++){for(let m=0;m<e.itemSize;m++){let E;e.itemSize>4?E=e.array[b*e.itemSize+m]:(m===0?E=e.getX(b):m===1?E=e.getY(b):m===2?E=e.getZ(b):m===3&&(E=e.getW(b)),e.normalized===!0&&(E=a.MathUtils.normalize(E,e.array))),t===Ae.FLOAT?h.setFloat32(p,E,!0):t===Ae.INT?h.setInt32(p,E,!0):t===Ae.UNSIGNED_INT?h.setUint32(p,E,!0):t===Ae.SHORT?h.setInt16(p,E,!0):t===Ae.UNSIGNED_SHORT?h.setUint16(p,E,!0):t===Ae.BYTE?h.setInt8(p,E):t===Ae.UNSIGNED_BYTE&&h.setUint8(p,E),p+=r}p%A!==0&&(p+=A-p%A)}const u={buffer:this.processBuffer(h.buffer),byteOffset:this.byteOffset,byteLength:l};return s!==void 0&&(u.target=s),s===Ae.ARRAY_BUFFER&&(u.byteStride=A),this.byteOffset+=l,o.bufferViews.push(u),{id:o.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const t=this,i=t.json;return i.bufferViews||(i.bufferViews=[]),new Promise(function(n){const s=new FileReader;s.readAsArrayBuffer(e),s.onloadend=function(){const o=Tn(s.result),r={buffer:t.processBuffer(o),byteOffset:t.byteOffset,byteLength:o.byteLength};t.byteOffset+=o.byteLength,n(i.bufferViews.push(r)-1)}})}processAccessor(e,t,i,n){const s=this.json,o={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let r;if(e.array.constructor===Float32Array)r=Ae.FLOAT;else if(e.array.constructor===Int32Array)r=Ae.INT;else if(e.array.constructor===Uint32Array)r=Ae.UNSIGNED_INT;else if(e.array.constructor===Int16Array)r=Ae.SHORT;else if(e.array.constructor===Uint16Array)r=Ae.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)r=Ae.BYTE;else if(e.array.constructor===Uint8Array)r=Ae.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(i===void 0&&(i=0),(n===void 0||n===1/0)&&(n=e.count),n===0)return null;const A=Nr(e,i,n);let l;t!==void 0&&(l=e===t.index?Ae.ELEMENT_ARRAY_BUFFER:Ae.ARRAY_BUFFER);const h=this.processBufferView(e,r,i,n,l),p={bufferView:h.id,byteOffset:h.byteOffset,componentType:r,count:n,max:A.max,min:A.min,type:o[e.itemSize]};return e.normalized===!0&&(p.normalized=!0),s.accessors||(s.accessors=[]),s.accessors.push(p)-1}processImage(e,t,i,n="image/png"){if(e!==null){const s=this,o=s.cache,r=s.json,A=s.options,l=s.pending;o.images.has(e)||o.images.set(e,{});const h=o.images.get(e),p=n+":flipY/"+i.toString();if(h[p]!==void 0)return h[p];r.images||(r.images=[]);const u={mimeType:n},f=Li();f.width=Math.min(e.width,A.maxTextureSize),f.height=Math.min(e.height,A.maxTextureSize);const b=f.getContext("2d",{willReadFrequently:!0});if(i===!0&&(b.translate(0,f.height),b.scale(1,-1)),e.data!==void 0){t!==a.RGBAFormat&&console.error("GLTFExporter: Only RGBAFormat is supported.",t),(e.width>A.maxTextureSize||e.height>A.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const E=new Uint8ClampedArray(e.height*e.width*4);for(let B=0;B<E.length;B+=4)E[B+0]=e.data[B+0],E[B+1]=e.data[B+1],E[B+2]=e.data[B+2],E[B+3]=e.data[B+3];b.putImageData(new ImageData(E,e.width,e.height),0,0)}else if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)b.drawImage(e,0,0,f.width,f.height);else throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");A.binary===!0?l.push(Or(f,n).then(E=>s.processBufferViewImage(E)).then(E=>{u.bufferView=E})):u.uri=a.ImageUtils.getDataURL(f,n);const m=r.images.push(u)-1;return h[p]=m,m}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){const t=this.json;t.samplers||(t.samplers=[]);const i={magFilter:Ke[e.magFilter],minFilter:Ke[e.minFilter],wrapS:Ke[e.wrapS],wrapT:Ke[e.wrapT]};return t.samplers.push(i)-1}async processTextureAsync(e){const i=this.options,n=this.cache,s=this.json;if(n.textures.has(e))return n.textures.get(e);const o={keep:!0,newTexture:null};if(this._invokeAll(function(h){h.beforeWriteTexture&&h.beforeWriteTexture(e,o)}),o.keep===!1)return null;o.newTexture!=null&&(e=o.newTexture),s.textures||(s.textures=[]),e instanceof a.CompressedTexture&&(e=await this.decompressTextureAsync(e,i.maxTextureSize));let r=e.userData.mimeType;r==="image/webp"&&(r="image/png");const A={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,r)};e.name&&(A.name=e.name),await this._invokeAllAsync(async function(h){h.writeTexture&&await h.writeTexture(e,A)});const l=s.textures.push(A)-1;return n.textures.set(e,l),l}async processMaterialAsync(e){const t=this.cache,i=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;i.materials||(i.materials=[]);const n={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const s=e.color.toArray().concat([e.opacity]);ct(s,[1,1,1,1])||(n.pbrMetallicRoughness.baseColorFactor=s),e.isMeshStandardMaterial?(n.pbrMetallicRoughness.metallicFactor=e.metalness,n.pbrMetallicRoughness.roughnessFactor=e.roughness):(n.pbrMetallicRoughness.metallicFactor=0,n.pbrMetallicRoughness.roughnessFactor=1);const o=e.metalnessMap?.image?e.metalnessMap:void 0,r=e.roughnessMap?.image?e.roughnessMap:void 0;if(o||r){const l=await this.buildMetalRoughTextureAsync(o,r),h={index:await this.processTextureAsync(l),texCoord:l.channel};this.applyTextureTransform(h,l),n.pbrMetallicRoughness.metallicRoughnessTexture=h}if(e.map){const l={index:await this.processTextureAsync(e.map),texCoord:e.map.channel};this.applyTextureTransform(l,e.map),n.pbrMetallicRoughness.baseColorTexture=l}if(e.emissive){const l=e.emissive;if(Math.max(l.r,l.g,l.b)>0&&(n.emissiveFactor=e.emissive.toArray()),e.emissiveMap?.image){const p={index:await this.processTextureAsync(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(p,e.emissiveMap),n.emissiveTexture=p}}if(e.normalMap?.image){const l={index:await this.processTextureAsync(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(l.scale=e.normalScale.x),this.applyTextureTransform(l,e.normalMap),n.normalTexture=l}if(e.aoMap?.image){const l={index:await this.processTextureAsync(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(l.strength=e.aoMapIntensity),this.applyTextureTransform(l,e.aoMap),n.occlusionTexture=l}e.transparent?n.alphaMode="BLEND":e.alphaTest>0&&(n.alphaMode="MASK",n.alphaCutoff=e.alphaTest),e.side===a.DoubleSide&&(n.doubleSided=!0),e.name!==""&&(n.name=e.name),this.serializeUserData(e,n),await this._invokeAllAsync(async function(l){l.writeMaterialAsync&&await l.writeMaterialAsync(e,n)});const A=i.materials.push(n)-1;return t.materials.set(e,A),A}async processMeshAsync(e){const t={keep:!0};if(this._invokeAll(function(Q){Q.beforeWriteMesh&&Q.beforeWriteMesh(e,t)}),t.keep!=!0)return null;const i=this.cache,n=this.json,s=[e.geometry.uuid];if(Array.isArray(e.material))for(let Q=0,R=e.material.length;Q<R;Q++)s.push(e.material[Q].uuid);else s.push(e.material.uuid);const o=s.join(":");if(i.meshes.has(o))return i.meshes.get(o);const r=e.geometry;let A;e.isLineSegments?A=Ae.LINES:e.isLineLoop?A=Ae.LINE_LOOP:e.isLine?A=Ae.LINE_STRIP:e.isPoints?A=Ae.POINTS:A=e.material.wireframe?Ae.LINES:Ae.TRIANGLES;const l={},h={},p=[],u=[],f={uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},b=r.getAttribute("normal");b!==void 0&&!this.isNormalizedNormalAttribute(b)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),r.setAttribute("normal",this.createNormalizedNormalAttribute(b)));let m=null;for(let Q in r.attributes){if(Q.slice(0,5)==="morph")continue;const R=r.attributes[Q];if(Q=f[Q]||Q.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(Q)||(Q="_"+Q),i.attributes.has(this.getUID(R))){h[Q]=i.attributes.get(this.getUID(R));continue}m=null;const T=R.array;Q==="JOINTS_0"&&!(T instanceof Uint16Array)&&!(T instanceof Uint8Array)?(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),m=Kt.Utils.toTypedBufferAttribute(R,Uint16Array)):(T instanceof Uint32Array||T instanceof Int32Array)&&!Q.startsWith("_")&&(console.warn(`GLTFExporter: Attribute "${Q}" converted to type FLOAT.`),m=Kt.Utils.toTypedBufferAttribute(R,Float32Array));const D=this.processAccessor(m||R,r);D!==null&&(Q.startsWith("_")||this.detectMeshQuantization(Q,R),h[Q]=D,i.attributes.set(this.getUID(R),D))}if(b!==void 0&&r.setAttribute("normal",b),Object.keys(h).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const Q=[],R=[],M={};if(e.morphTargetDictionary!==void 0)for(const T in e.morphTargetDictionary)M[e.morphTargetDictionary[T]]=T;for(let T=0;T<e.morphTargetInfluences.length;++T){const D={};let G=!1;for(const U in r.morphAttributes){if(U!=="position"&&U!=="normal"&&U!=="color"){G||(console.warn("GLTFExporter: Only POSITION, NORMAL and COLOR morph are supported."),G=!0);continue}const j=r.morphAttributes[U][T],X=U.toUpperCase()+(U==="color"?"_0":""),N=r.attributes[U];if(i.attributes.has(this.getUID(j,!0))){D[X]=i.attributes.get(this.getUID(j,!0));continue}const V=j.clone();if(!r.morphTargetsRelative)for(let H=0,$=j.count;H<$;H++)for(let oe=0;oe<j.itemSize;oe++)oe===0&&V.setX(H,j.getX(H)-N.getX(H)),oe===1&&V.setY(H,j.getY(H)-N.getY(H)),oe===2&&V.setZ(H,j.getZ(H)-N.getZ(H)),oe===3&&V.setW(H,j.getW(H)-N.getW(H));D[X]=this.processAccessor(V,r),i.attributes.set(this.getUID(N,!0),D[X])}u.push(D),Q.push(e.morphTargetInfluences[T]),e.morphTargetDictionary!==void 0&&R.push(M[T])}l.weights=Q,R.length>0&&(l.extras={},l.extras.targetNames=R)}const E=Array.isArray(e.material);if(E&&r.groups.length===0)return null;let B=!1;if(E&&r.index===null){const Q=[];for(let R=0,M=r.attributes.position.count;R<M;R++)Q[R]=R;r.setIndex(Q),B=!0}const w=E?e.material:[e.material],C=E?r.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let Q=0,R=C.length;Q<R;Q++){const M={mode:A,attributes:h};if(this.serializeUserData(r,M),u.length>0&&(M.targets=u),r.index!==null){let D=this.getUID(r.index);(C[Q].start!==void 0||C[Q].count!==void 0)&&(D+=":"+C[Q].start+":"+C[Q].count),i.attributes.has(D)?M.indices=i.attributes.get(D):(M.indices=this.processAccessor(r.index,r,C[Q].start,C[Q].count),i.attributes.set(D,M.indices)),M.indices===null&&delete M.indices}const T=await this.processMaterialAsync(w[C[Q].materialIndex]);T!==null&&(M.material=T),p.push(M)}B===!0&&r.setIndex(null),l.primitives=p,n.meshes||(n.meshes=[]),await this._invokeAllAsync(function(Q){Q.writeMesh&&Q.writeMesh(e,l)});const y=n.meshes.push(l)-1;return i.meshes.set(o,y),y}detectMeshQuantization(e,t){if(this.extensionsUsed[Sn])return;let i;switch(t.array.constructor){case Int8Array:i="byte";break;case Uint8Array:i="unsigned byte";break;case Int16Array:i="short";break;case Uint16Array:i="unsigned short";break;default:return}t.normalized&&(i+=" normalized");const n=e.split("_",1)[0];Mi[n]&&Mi[n].includes(i)&&(this.extensionsUsed[Sn]=!0,this.extensionsRequired[Sn]=!0)}processCamera(e){const t=this.json;t.cameras||(t.cameras=[]);const i=e.isOrthographicCamera,n={type:i?"orthographic":"perspective"};return i?n.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:n.perspective={aspectRatio:e.aspect,yfov:a.MathUtils.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(n.name=e.type),t.cameras.push(n)-1}processAnimation(e,t){const i=this.json,n=this.nodeMap;i.animations||(i.animations=[]),e=Kt.Utils.mergeMorphTargetTracks(e.clone(),t);const s=e.tracks,o=[],r=[];for(let l=0;l<s.length;++l){const h=s[l],p=a.PropertyBinding.parseTrackName(h.name);let u=a.PropertyBinding.findNode(t,p.nodeName);const f=Fi[p.propertyName];if(p.objectName==="bones"&&(u.isSkinnedMesh===!0?u=u.skeleton.getBoneByName(p.objectIndex):u=void 0),!u||!f){console.warn('THREE.GLTFExporter: Could not export animation track "%s".',h.name);continue}const b=1;let m=h.values.length/h.times.length;f===Fi.morphTargetInfluences&&(m/=u.morphTargetInfluences.length);let E;h.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(E="CUBICSPLINE",m/=3):h.getInterpolation()===a.InterpolateDiscrete?E="STEP":E="LINEAR",r.push({input:this.processAccessor(new a.BufferAttribute(h.times,b)),output:this.processAccessor(new a.BufferAttribute(h.values,m)),interpolation:E}),o.push({sampler:r.length-1,target:{node:n.get(u),path:f}})}const A={name:e.name||"clip_"+i.animations.length,samplers:r,channels:o};return this.serializeUserData(e,A),i.animations.push(A),i.animations.length-1}processSkin(e){const t=this.json,i=this.nodeMap,n=t.nodes[i.get(e)],s=e.skeleton;if(s===void 0)return null;const o=e.skeleton.bones[0];if(o===void 0)return null;const r=[],A=new Float32Array(s.bones.length*16),l=new a.Matrix4;for(let p=0;p<s.bones.length;++p)r.push(i.get(s.bones[p])),l.copy(s.boneInverses[p]),l.multiply(e.bindMatrix).toArray(A,p*16);return t.skins===void 0&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new a.BufferAttribute(A,16)),joints:r,skeleton:i.get(o)}),n.skin=t.skins.length-1}async processNodeAsync(e){const t={keep:!0};if(this._invokeAll(function(A){A.beforeWriteNode&&A.beforeWriteNode(e,t)}),t.keep!=!0)return null;const i=this.json,n=this.options,s=this.nodeMap;if(i.nodes||(i.nodes=[]),e.pivot!==null)return await this._processNodeWithPivotAsync(e);const o={};if(n.trs){const A=e.quaternion.toArray(),l=e.position.toArray(),h=e.scale.toArray();ct(A,[0,0,0,1])||(o.rotation=A),ct(l,[0,0,0])||(o.translation=l),ct(h,[1,1,1])||(o.scale=h)}else e.matrixAutoUpdate&&e.updateMatrix(),Pr(e.matrix)===!1&&(o.matrix=e.matrix.elements);if(e.name!==""&&(o.name=String(e.name)),this.serializeUserData(e,o),e.isMesh||e.isLine||e.isPoints){const A=await this.processMeshAsync(e);A!==null&&(o.mesh=A)}else e.isCamera&&(o.camera=this.processCamera(e));e.isSkinnedMesh&&this.skins.push(e);const r=i.nodes.push(o)-1;if(s.set(e,r),e.children.length>0){const A=[];for(let l=0,h=e.children.length;l<h;l++){const p=e.children[l];if(p.visible||n.onlyVisible===!1){const u=await this.processNodeAsync(p);u!==null&&A.push(u)}}A.length>0&&(o.children=A)}return await this._invokeAllAsync(function(A){A.writeNode&&A.writeNode(e,o)}),r}async _processNodeWithPivotAsync(e){const t=this.json,i=this.options,n=this.nodeMap,s=e.pivot,o={},r=e.quaternion.toArray(),A=[e.position.x+s.x,e.position.y+s.y,e.position.z+s.z],l=e.scale.toArray();ct(r,[0,0,0,1])||(o.rotation=r),ct(A,[0,0,0])||(o.translation=A),ct(l,[1,1,1])||(o.scale=l),o.extras={pivot:s.toArray()},e.name!==""&&(o.name=String(e.name)),this.serializeUserData(e,o);const h=t.nodes.push(o)-1;n.set(e,h);const p={},u=[-s.x,-s.y,-s.z];if(ct(u,[0,0,0])||(p.translation=u),e.isMesh||e.isLine||e.isPoints){const m=await this.processMeshAsync(e);m!==null&&(p.mesh=m)}else e.isCamera&&(p.camera=this.processCamera(e));e.isSkinnedMesh&&this.skins.push(e);const b=[t.nodes.push(p)-1];if(e.children.length>0){const m=[];for(let E=0,B=e.children.length;E<B;E++){const w=e.children[E];if(w.visible||i.onlyVisible===!1){const C=await this.processNodeAsync(w);C!==null&&m.push(C)}}m.length>0&&(p.children=m)}return o.children=b,await this._invokeAllAsync(function(m){m.writeNode&&m.writeNode(e,o)}),h}async processSceneAsync(e){const t=this.json,i=this.options;t.scenes||(t.scenes=[],t.scene=0);const n={};e.name!==""&&(n.name=e.name),t.scenes.push(n);const s=[];for(let o=0,r=e.children.length;o<r;o++){const A=e.children[o];if(A.visible||i.onlyVisible===!1){const l=await this.processNodeAsync(A);l!==null&&s.push(l)}}s.length>0&&(n.nodes=s),this.serializeUserData(e,n)}async processObjectsAsync(e){const t=new a.Scene;t.name="AuxScene";for(let i=0;i<e.length;i++)t.children.push(e[i]);await this.processSceneAsync(t)}async processInputAsync(e){const t=this.options;e=e instanceof Array?e:[e],await this._invokeAllAsync(function(n){n.beforeParse&&n.beforeParse(e)});const i=[];for(let n=0;n<e.length;n++)e[n]instanceof a.Scene?await this.processSceneAsync(e[n]):i.push(e[n]);i.length>0&&await this.processObjectsAsync(i);for(let n=0;n<this.skins.length;++n)this.processSkin(this.skins[n]);for(let n=0;n<t.animations.length;++n)this.processAnimation(t.animations[n],e[0]);await this._invokeAllAsync(function(n){n.afterParse&&n.afterParse(e)})}async _invokeAllAsync(e){for(let t=0,i=this.plugins.length;t<i;t++)await e(this.plugins[t])}}class jr{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight){console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);return}const i=this.writer,n=i.json,s=i.extensionsUsed,o={};e.name&&(o.name=e.name),o.color=e.color.toArray(),o.intensity=e.intensity,e.isDirectionalLight?o.type="directional":e.isPointLight?(o.type="point",e.distance>0&&(o.range=e.distance)):e.isSpotLight&&(o.type="spot",e.distance>0&&(o.range=e.distance),o.spot={},o.spot.innerConeAngle=(1-e.penumbra)*e.angle,o.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),s[this.name]||(n.extensions=n.extensions||{},n.extensions[this.name]={lights:[]},s[this.name]=!0);const r=n.extensions[this.name].lights;r.push(o),t.extensions=t.extensions||{},t.extensions[this.name]={light:r.length-1}}}class qr{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}async writeMaterialAsync(e,t){if(!e.isMeshBasicMaterial)return;const n=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},n[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}}class Kr{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;const i=this.writer,n=i.extensionsUsed,s={};if(s.clearcoatFactor=e.clearcoat,e.clearcoatMap){const o={index:await i.processTextureAsync(e.clearcoatMap),texCoord:e.clearcoatMap.channel};i.applyTextureTransform(o,e.clearcoatMap),s.clearcoatTexture=o}if(s.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){const o={index:await i.processTextureAsync(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};i.applyTextureTransform(o,e.clearcoatRoughnessMap),s.clearcoatRoughnessTexture=o}if(e.clearcoatNormalMap){const o={index:await i.processTextureAsync(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};e.clearcoatNormalScale.x!==1&&(o.scale=e.clearcoatNormalScale.x),i.applyTextureTransform(o,e.clearcoatNormalMap),s.clearcoatNormalTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=s,n[this.name]=!0}}class zr{constructor(e){this.writer=e,this.name="KHR_materials_dispersion"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.dispersion===0)return;const n=this.writer.extensionsUsed,s={};s.dispersion=e.dispersion,t.extensions=t.extensions||{},t.extensions[this.name]=s,n[this.name]=!0}}class Vr{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;const i=this.writer,n=i.extensionsUsed,s={};if(s.iridescenceFactor=e.iridescence,e.iridescenceMap){const o={index:await i.processTextureAsync(e.iridescenceMap),texCoord:e.iridescenceMap.channel};i.applyTextureTransform(o,e.iridescenceMap),s.iridescenceTexture=o}if(s.iridescenceIor=e.iridescenceIOR,s.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],s.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){const o={index:await i.processTextureAsync(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};i.applyTextureTransform(o,e.iridescenceThicknessMap),s.iridescenceThicknessTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=s,n[this.name]=!0}}class Yr{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const i=this.writer,n=i.extensionsUsed,s={};if(s.transmissionFactor=e.transmission,e.transmissionMap){const o={index:await i.processTextureAsync(e.transmissionMap),texCoord:e.transmissionMap.channel};i.applyTextureTransform(o,e.transmissionMap),s.transmissionTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=s,n[this.name]=!0}}class Jr{constructor(e){this.writer=e,this.name="KHR_materials_volume"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const i=this.writer,n=i.extensionsUsed,s={};if(s.thicknessFactor=e.thickness,e.thicknessMap){const o={index:await i.processTextureAsync(e.thicknessMap),texCoord:e.thicknessMap.channel};i.applyTextureTransform(o,e.thicknessMap),s.thicknessTexture=o}e.attenuationDistance!==1/0&&(s.attenuationDistance=e.attenuationDistance),s.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=s,n[this.name]=!0}}class Xr{constructor(e){this.writer=e,this.name="KHR_materials_ior"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;const n=this.writer.extensionsUsed,s={};s.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=s,n[this.name]=!0}}class Wr{constructor(e){this.writer=e,this.name="KHR_materials_specular"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(Fr)&&!e.specularIntensityMap&&!e.specularColorMap)return;const i=this.writer,n=i.extensionsUsed,s={};if(e.specularIntensityMap){const o={index:await i.processTextureAsync(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};i.applyTextureTransform(o,e.specularIntensityMap),s.specularTexture=o}if(e.specularColorMap){const o={index:await i.processTextureAsync(e.specularColorMap),texCoord:e.specularColorMap.channel};i.applyTextureTransform(o,e.specularColorMap),s.specularColorTexture=o}s.specularFactor=e.specularIntensity,s.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=s,n[this.name]=!0}}class Zr{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;const i=this.writer,n=i.extensionsUsed,s={};if(e.sheenRoughnessMap){const o={index:await i.processTextureAsync(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};i.applyTextureTransform(o,e.sheenRoughnessMap),s.sheenRoughnessTexture=o}if(e.sheenColorMap){const o={index:await i.processTextureAsync(e.sheenColorMap),texCoord:e.sheenColorMap.channel};i.applyTextureTransform(o,e.sheenColorMap),s.sheenColorTexture=o}s.sheenRoughnessFactor=e.sheenRoughness,s.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=s,n[this.name]=!0}}class $r{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;const i=this.writer,n=i.extensionsUsed,s={};if(e.anisotropyMap){const o={index:await i.processTextureAsync(e.anisotropyMap)};i.applyTextureTransform(o,e.anisotropyMap),s.anisotropyTexture=o}s.anisotropyStrength=e.anisotropy,s.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=s,n[this.name]=!0}}class eA{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}async writeMaterialAsync(e,t){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;const n=this.writer.extensionsUsed,s={};s.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=s,n[this.name]=!0}}class tA{constructor(e){this.writer=e,this.name="EXT_materials_bump"}async writeMaterialAsync(e,t){if(!e.isMeshStandardMaterial||e.bumpScale===1&&!e.bumpMap)return;const i=this.writer,n=i.extensionsUsed,s={};if(e.bumpMap){const o={index:await i.processTextureAsync(e.bumpMap),texCoord:e.bumpMap.channel};i.applyTextureTransform(o,e.bumpMap),s.bumpTexture=o}s.bumpFactor=e.bumpScale,t.extensions=t.extensions||{},t.extensions[this.name]=s,n[this.name]=!0}}class nA{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,t){if(!e.isInstancedMesh)return;const i=this.writer,n=e,s=new Float32Array(n.count*3),o=new Float32Array(n.count*4),r=new Float32Array(n.count*3),A=new a.Matrix4,l=new a.Vector3,h=new a.Quaternion,p=new a.Vector3;for(let f=0;f<n.count;f++)n.getMatrixAt(f,A),A.decompose(l,h,p),l.toArray(s,f*3),h.toArray(o,f*4),p.toArray(r,f*3);const u={TRANSLATION:i.processAccessor(new a.BufferAttribute(s,3)),ROTATION:i.processAccessor(new a.BufferAttribute(o,4)),SCALE:i.processAccessor(new a.BufferAttribute(r,3))};n.instanceColor&&(u._COLOR_0=i.processAccessor(n.instanceColor)),t.extensions=t.extensions||{},t.extensions[this.name]={attributes:u},i.extensionsUsed[this.name]=!0,i.extensionsRequired[this.name]=!0}}Kt.Utils={insertKeyframe:function(c,e){const i=c.getValueSize(),n=new c.TimeBufferType(c.times.length+1),s=new c.ValueBufferType(c.values.length+i),o=c.createInterpolant(new c.ValueBufferType(i));let r;if(c.times.length===0){n[0]=e;for(let A=0;A<i;A++)s[A]=0;r=0}else if(e<c.times[0]){if(Math.abs(c.times[0]-e)<.001)return 0;n[0]=e,n.set(c.times,1),s.set(o.evaluate(e),0),s.set(c.values,i),r=0}else if(e>c.times[c.times.length-1]){if(Math.abs(c.times[c.times.length-1]-e)<.001)return c.times.length-1;n[n.length-1]=e,n.set(c.times,0),s.set(c.values,0),s.set(o.evaluate(e),c.values.length),r=n.length-1}else for(let A=0;A<c.times.length;A++){if(Math.abs(c.times[A]-e)<.001)return A;if(c.times[A]<e&&c.times[A+1]>e){n.set(c.times.slice(0,A+1),0),n[A+1]=e,n.set(c.times.slice(A+1),A+2),s.set(c.values.slice(0,(A+1)*i),0),s.set(o.evaluate(e),(A+1)*i),s.set(c.values.slice((A+1)*i),(A+2)*i),r=A+1;break}}return c.times=n,c.values=s,r},mergeMorphTargetTracks:function(c,e){const t=[],i={},n=c.tracks;for(let s=0;s<n.length;++s){let o=n[s];const r=a.PropertyBinding.parseTrackName(o.name),A=a.PropertyBinding.findNode(e,r.nodeName);if(r.propertyName!=="morphTargetInfluences"||r.propertyIndex===void 0){t.push(o);continue}if(o.createInterpolant!==o.InterpolantFactoryMethodDiscrete&&o.createInterpolant!==o.InterpolantFactoryMethodLinear){if(o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),o=o.clone(),o.setInterpolation(a.InterpolateLinear)}const l=A.morphTargetInfluences.length,h=A.morphTargetDictionary[r.propertyIndex];if(h===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+r.propertyIndex);let p;if(i[A.uuid]===void 0){p=o.clone();const f=new p.ValueBufferType(l*p.times.length);for(let b=0;b<p.times.length;b++)f[b*l+h]=p.values[b];p.name=(r.nodeName||"")+".morphTargetInfluences",p.values=f,i[A.uuid]=p,t.push(p);continue}const u=o.createInterpolant(new o.ValueBufferType(1));p=i[A.uuid];for(let f=0;f<p.times.length;f++)p.values[f*l+h]=u.evaluate(p.times[f]);for(let f=0;f<o.times.length;f++){const b=this.insertKeyframe(p,o.times[f]);p.values[b*l+h]=o.values[f]}}return c.tracks=t,c},toTypedBufferAttribute:function(c,e){const t=new a.BufferAttribute(new e(c.count*c.itemSize),c.itemSize,!1);if(!c.normalized&&!c.isInterleavedBufferAttribute)return t.array.set(c.array),t;for(let i=0,n=c.count;i<n;i++)for(let s=0;s<c.itemSize;s++)t.setComponent(i,s,c.getComponent(i,s));return t}};const we={ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};async function no(c){const e=await fetch(c);if(e.ok)return e.json();throw new Error(e.statusText)}async function iA(c){if(!c)throw new Error("No basePath supplied");return await no(`${c}/profilesList.json`)}async function sA(c,e,t=null,i=!0){if(!c)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No basePath supplied");const n=await iA(e);let s;if(c.profiles.some(A=>{const l=n[A];return l&&(s={profileId:A,profilePath:`${e}/${l.path}`,deprecated:!!l.deprecated}),!!s}),!s){if(!t)throw new Error("No matching profile name found");const A=n[t];if(!A)throw new Error(`No matching profile name found and default profile "${t}" missing.`);s={profileId:t,profilePath:`${e}/${A.path}`,deprecated:!!A.deprecated}}const o=await no(s.profilePath);let r;if(i){let A;if(c.handedness==="any"?A=o.layouts[Object.keys(o.layouts)[0]]:A=o.layouts[c.handedness],!A)throw new Error(`No matching handedness, ${c.handedness}, in profile ${s.profileId}`);A.assetPath&&(r=s.profilePath.replace("profile.json",A.assetPath))}return{profile:o,assetPath:r}}const oA={xAxis:0,yAxis:0,button:0,state:we.ComponentState.DEFAULT};function aA(c=0,e=0){let t=c,i=e;if(Math.sqrt(c*c+e*e)>1){const o=Math.atan2(e,c);t=Math.cos(o),i=Math.sin(o)}return{normalizedXAxis:t*.5+.5,normalizedYAxis:i*.5+.5}}class rA{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===we.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(oA)}updateFromComponent({xAxis:e,yAxis:t,button:i,state:n}){const{normalizedXAxis:s,normalizedYAxis:o}=aA(e,t);switch(this.componentProperty){case we.ComponentProperty.X_AXIS:this.value=this.states.includes(n)?s:.5;break;case we.ComponentProperty.Y_AXIS:this.value=this.states.includes(n)?o:.5;break;case we.ComponentProperty.BUTTON:this.value=this.states.includes(n)?i:0;break;case we.ComponentProperty.STATE:this.valueNodeProperty===we.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(n):this.value=this.states.includes(n)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class AA{constructor(e,t){if(!e||!t||!t.visualResponses||!t.gamepadIndices||Object.keys(t.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach(i=>{const n=new rA(t.visualResponses[i]);this.visualResponses[i]=n}),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:we.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(e){if(this.values.state=we.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&e.buttons.length>this.gamepadIndices.button){const t=e.buttons[this.gamepadIndices.button];this.values.button=t.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,t.pressed||this.values.button===1?this.values.state=we.ComponentState.PRESSED:(t.touched||this.values.button>we.ButtonTouchThreshold)&&(this.values.state=we.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&e.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=e.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===we.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>we.AxisTouchThreshold&&(this.values.state=we.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&e.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=e.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===we.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>we.AxisTouchThreshold&&(this.values.state=we.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(t=>{t.updateFromComponent(this.values)})}}class cA{constructor(e,t,i){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");this.xrInputSource=e,this.assetUrl=i,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(n=>{const s=this.layoutDescription.components[n];this.components[n]=new AA(n,s)}),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const e=[];return Object.values(this.components).forEach(t=>{e.push(t.data)}),e}updateFromGamepad(){Object.values(this.components).forEach(e=>{e.updateFromGamepad(this.xrInputSource.gamepad)})}}const lA="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",hA="generic-trigger";class pA extends a.Object3D{constructor(){super(),this.motionController=null,this.envMap=null}setEnvironmentMap(e){return this.envMap==e?this:(this.envMap=e,this.traverse(t=>{t.isMesh&&(t.material.envMap=this.envMap,t.material.needsUpdate=!0)}),this)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(t=>{Object.values(t.visualResponses).forEach(i=>{const{valueNode:n,minNode:s,maxNode:o,value:r,valueNodeProperty:A}=i;n&&(A===we.VisualResponseProperty.VISIBILITY?n.visible=r:A===we.VisualResponseProperty.TRANSFORM&&(n.quaternion.slerpQuaternions(s.quaternion,o.quaternion,r),n.position.lerpVectors(s.position,o.position,r)))})}))}}function gA(c,e){Object.values(c.components).forEach(t=>{const{type:i,touchPointNodeName:n,visualResponses:s}=t;if(i===we.ComponentType.TOUCHPAD)if(t.touchPointNode=e.getObjectByName(n),t.touchPointNode){const o=new a.SphereGeometry(.001),r=new a.MeshBasicMaterial({color:255}),A=new a.Mesh(o,r);t.touchPointNode.add(A)}else console.warn(`Could not find touch dot, ${t.touchPointNodeName}, in touchpad component ${t.id}`);Object.values(s).forEach(o=>{const{valueNodeName:r,minNodeName:A,maxNodeName:l,valueNodeProperty:h}=o;if(h===we.VisualResponseProperty.TRANSFORM){if(o.minNode=e.getObjectByName(A),o.maxNode=e.getObjectByName(l),!o.minNode){console.warn(`Could not find ${A} in the model`);return}if(!o.maxNode){console.warn(`Could not find ${l} in the model`);return}}o.valueNode=e.getObjectByName(r),o.valueNode||console.warn(`Could not find ${r} in the model`)})})}function Gi(c,e){gA(c.motionController,e),c.envMap&&e.traverse(t=>{t.isMesh&&(t.material.envMap=c.envMap,t.material.needsUpdate=!0)}),c.layers.mask!=0&&e.traverse(t=>{t.layers.mask=c.layers.mask}),c.add(e)}class uA{constructor(e=null,t=null){this.gltfLoader=e,this.path=lA,this._assetCache={},this.onLoad=t,this.gltfLoader||(this.gltfLoader=new Kn)}setPath(e){return this.path=e,this}createControllerModel(e){const t=new pA;let i=null;return e.addEventListener("connected",n=>{const s=n.data;s.targetRayMode!=="tracked-pointer"||!s.gamepad||s.hand||sA(s,this.path,hA).then(({profile:o,assetPath:r})=>{t.motionController=new cA(s,o,r);const A=this._assetCache[t.motionController.assetUrl];if(A)i=A.scene.clone(),Gi(t,i),this.onLoad&&this.onLoad(i);else{if(!this.gltfLoader)throw new Error("GLTFLoader not set.");this.gltfLoader.setPath(""),this.gltfLoader.load(t.motionController.assetUrl,l=>{this._assetCache[t.motionController.assetUrl]=l,i=l.scene.clone(),Gi(t,i),this.onLoad&&this.onLoad(i)},null,()=>{throw new Error(`Asset ${t.motionController.assetUrl} missing or malformed.`)})}}).catch(o=>{console.warn(o)})}),e.addEventListener("disconnected",()=>{t.motionController=null,t.remove(i),i=null}),t}}const fA="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/generic-hand/";class dA{constructor(e,t,i,n,s=null,o=null){this.controller=t,this.handModel=e,this.bones=[],s===null&&(s=new Kn,s.setPath(i||fA)),s.load(`${n}.glb`,r=>{const A=r.scene.children[0];this.handModel.add(A),A.layers.mask=this.handModel.layers.mask;const l=A.getObjectByProperty("type","SkinnedMesh");l.frustumCulled=!1,l.castShadow=!0,l.receiveShadow=!0,["wrist","thumb-metacarpal","thumb-phalanx-proximal","thumb-phalanx-distal","thumb-tip","index-finger-metacarpal","index-finger-phalanx-proximal","index-finger-phalanx-intermediate","index-finger-phalanx-distal","index-finger-tip","middle-finger-metacarpal","middle-finger-phalanx-proximal","middle-finger-phalanx-intermediate","middle-finger-phalanx-distal","middle-finger-tip","ring-finger-metacarpal","ring-finger-phalanx-proximal","ring-finger-phalanx-intermediate","ring-finger-phalanx-distal","ring-finger-tip","pinky-finger-metacarpal","pinky-finger-phalanx-proximal","pinky-finger-phalanx-intermediate","pinky-finger-phalanx-distal","pinky-finger-tip"].forEach(p=>{const u=A.getObjectByName(p);u!==void 0?u.jointName=p:console.warn(`Couldn't find ${p} in ${n} hand mesh`),this.bones.push(u)}),o&&o(A)})}updateMesh(){const e=this.controller.joints;for(let t=0;t<this.bones.length;t++){const i=this.bones[t];if(i){const n=e[i.jointName];if(n.visible){const s=n.position;i.position.copy(s),i.quaternion.copy(n.quaternion)}}}}}const Ui=new a.Box3,en=new a.Vector3;class io extends a.InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(i),this.setAttribute("position",new a.Float32BufferAttribute(e,3)),this.setAttribute("uv",new a.Float32BufferAttribute(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,i=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),i.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const i=new a.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceStart",new a.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceEnd",new a.InterleavedBufferAttribute(i,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const i=new a.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceColorStart",new a.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceColorEnd",new a.InterleavedBufferAttribute(i,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new a.WireframeGeometry(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new a.Box3);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),Ui.setFromBufferAttribute(t),this.boundingBox.union(Ui))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new a.Sphere),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const i=this.boundingSphere.center;this.boundingBox.getCenter(i);let n=0;for(let s=0,o=e.count;s<o;s++)en.fromBufferAttribute(e,s),n=Math.max(n,i.distanceToSquared(en)),en.fromBufferAttribute(t,s),n=Math.max(n,i.distanceToSquared(en));this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}a.UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new a.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};a.ShaderLib.line={uniforms:a.UniformsUtils.merge([a.UniformsLib.common,a.UniformsLib.fog,a.UniformsLib.line]),vertexShader:`
|
|
90
73
|
#include <common>
|
|
91
74
|
#include <color_pars_vertex>
|
|
92
75
|
#include <fog_pars_vertex>
|
|
@@ -367,6 +350,9 @@
|
|
|
367
350
|
|
|
368
351
|
void main() {
|
|
369
352
|
|
|
353
|
+
float alpha = opacity;
|
|
354
|
+
vec4 diffuseColor = vec4( diffuse, alpha );
|
|
355
|
+
|
|
370
356
|
#include <clipping_planes_fragment>
|
|
371
357
|
|
|
372
358
|
#ifdef USE_DASH
|
|
@@ -377,8 +363,6 @@
|
|
|
377
363
|
|
|
378
364
|
#endif
|
|
379
365
|
|
|
380
|
-
float alpha = opacity;
|
|
381
|
-
|
|
382
366
|
#ifdef WORLD_UNITS
|
|
383
367
|
|
|
384
368
|
// Find the closest points on the view ray and the line segment
|
|
@@ -443,8 +427,6 @@
|
|
|
443
427
|
|
|
444
428
|
#endif
|
|
445
429
|
|
|
446
|
-
vec4 diffuseColor = vec4( diffuse, alpha );
|
|
447
|
-
|
|
448
430
|
#include <logdepthbuf_fragment>
|
|
449
431
|
#include <color_fragment>
|
|
450
432
|
|
|
@@ -456,9 +438,9 @@
|
|
|
456
438
|
#include <premultiplied_alpha_fragment>
|
|
457
439
|
|
|
458
440
|
}
|
|
459
|
-
`};class ts extends r.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:r.UniformsUtils.clone(r.ShaderLib.line.uniforms),vertexShader:r.ShaderLib.line.vertexShader,fragmentShader:r.ShaderLib.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const Dn=new r.Vector4,Ns=new r.Vector3,Ps=new r.Vector3,Te=new r.Vector4,ve=new r.Vector4,$e=new r.Vector4,_n=new r.Vector3,Fn=new r.Matrix4,Re=new r.Line3,Os=new r.Vector3,nn=new r.Box3,sn=new r.Sphere,et=new r.Vector4;let tt,Et;function Hs(c,e,t){return et.set(0,0,-e,1).applyMatrix4(c.projectionMatrix),et.multiplyScalar(1/et.w),et.x=Et/t.width,et.y=Et/t.height,et.applyMatrix4(c.projectionMatrixInverse),et.multiplyScalar(1/et.w),Math.abs(Math.max(et.x,et.y))}function aA(c,e){const t=c.matrixWorld,s=c.geometry,n=s.attributes.instanceStart,i=s.attributes.instanceEnd,o=Math.min(s.instanceCount,n.count);for(let a=0,A=o;a<A;a++){Re.start.fromBufferAttribute(n,a),Re.end.fromBufferAttribute(i,a),Re.applyMatrix4(t);const l=new r.Vector3,h=new r.Vector3;tt.distanceSqToSegment(Re.start,Re.end,h,l),h.distanceTo(l)<Et*.5&&e.push({point:h,pointOnLine:l,distance:tt.origin.distanceTo(h),object:c,face:null,faceIndex:a,uv:null,uv1:null})}}function AA(c,e,t){const s=e.projectionMatrix,i=c.material.resolution,o=c.matrixWorld,a=c.geometry,A=a.attributes.instanceStart,l=a.attributes.instanceEnd,h=Math.min(a.instanceCount,A.count),u=-e.near;tt.at(1,$e),$e.w=1,$e.applyMatrix4(e.matrixWorldInverse),$e.applyMatrix4(s),$e.multiplyScalar(1/$e.w),$e.x*=i.x/2,$e.y*=i.y/2,$e.z=0,_n.copy($e),Fn.multiplyMatrices(e.matrixWorldInverse,o);for(let g=0,f=h;g<f;g++){if(Te.fromBufferAttribute(A,g),ve.fromBufferAttribute(l,g),Te.w=1,ve.w=1,Te.applyMatrix4(Fn),ve.applyMatrix4(Fn),Te.z>u&&ve.z>u)continue;if(Te.z>u){const C=Te.z-ve.z,y=(Te.z-u)/C;Te.lerp(ve,y)}else if(ve.z>u){const C=ve.z-Te.z,y=(ve.z-u)/C;ve.lerp(Te,y)}Te.applyMatrix4(s),ve.applyMatrix4(s),Te.multiplyScalar(1/Te.w),ve.multiplyScalar(1/ve.w),Te.x*=i.x/2,Te.y*=i.y/2,ve.x*=i.x/2,ve.y*=i.y/2,Re.start.copy(Te),Re.start.z=0,Re.end.copy(ve),Re.end.z=0;const m=Re.closestPointToPointParameter(_n,!0);Re.at(m,Os);const b=r.MathUtils.lerp(Te.z,ve.z,m),B=b>=-1&&b<=1,w=_n.distanceTo(Os)<Et*.5;if(B&&w){Re.start.fromBufferAttribute(A,g),Re.end.fromBufferAttribute(l,g),Re.start.applyMatrix4(o),Re.end.applyMatrix4(o);const C=new r.Vector3,y=new r.Vector3;tt.distanceSqToSegment(Re.start,Re.end,y,C),t.push({point:y,pointOnLine:C,distance:tt.origin.distanceTo(y),object:c,face:null,faceIndex:g,uv:null,uv1:null})}}}class cA extends r.Mesh{constructor(e=new _i,t=new ts({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,s=e.attributes.instanceEnd,n=new Float32Array(2*t.count);for(let o=0,a=0,A=t.count;o<A;o++,a+=2)Ns.fromBufferAttribute(t,o),Ps.fromBufferAttribute(s,o),n[a]=a===0?0:n[a-1],n[a+1]=n[a]+Ns.distanceTo(Ps);const i=new r.InstancedInterleavedBuffer(n,2,1);return e.setAttribute("instanceDistanceStart",new r.InterleavedBufferAttribute(i,1,0)),e.setAttribute("instanceDistanceEnd",new r.InterleavedBufferAttribute(i,1,1)),this}raycast(e,t){const s=this.material.worldUnits,n=e.camera;n===null&&!s&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const i=e.params.Line2!==void 0&&e.params.Line2.threshold||0;tt=e.ray;const o=this.matrixWorld,a=this.geometry,A=this.material;Et=A.linewidth+i,a.boundingSphere===null&&a.computeBoundingSphere(),sn.copy(a.boundingSphere).applyMatrix4(o);let l;if(s)l=Et*.5;else{const u=Math.max(n.near,sn.distanceToPoint(tt.origin));l=Hs(n,u,A.resolution)}if(sn.radius+=l,tt.intersectsSphere(sn)===!1)return;a.boundingBox===null&&a.computeBoundingBox(),nn.copy(a.boundingBox).applyMatrix4(o);let h;if(s)h=Et*.5;else{const u=Math.max(n.near,nn.distanceToPoint(tt.origin));h=Hs(n,u,A.resolution)}nn.expandByScalar(h),tt.intersectsBox(nn)!==!1&&(s?aA(this,t):AA(this,n,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(Dn),this.material.uniforms.resolution.value.set(Dn.z,Dn.w))}}class Fi extends _i{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,s=new Float32Array(2*t);for(let n=0;n<t;n+=3)s[2*n]=e[n],s[2*n+1]=e[n+1],s[2*n+2]=e[n+2],s[2*n+3]=e[n+3],s[2*n+4]=e[n+4],s[2*n+5]=e[n+5];return super.setPositions(s),this}setColors(e){const t=e.length-3,s=new Float32Array(2*t);for(let n=0;n<t;n+=3)s[2*n]=e[n],s[2*n+1]=e[n+1],s[2*n+2]=e[n+2],s[2*n+3]=e[n+3],s[2*n+4]=e[n+4],s[2*n+5]=e[n+5];return super.setColors(s),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class lA extends cA{constructor(e=new Fi,t=new ts({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}class hA extends r.Mesh{constructor(e){const t=new uA(e),s=new r.PlaneGeometry(t.image.width*.001,t.image.height*.001),n=new r.MeshBasicMaterial({map:t,toneMapped:!1,transparent:!0});super(s,n);function i(o){n.map.dispatchDOMEvent(o)}this.addEventListener("mousedown",i),this.addEventListener("mousemove",i),this.addEventListener("mouseup",i),this.addEventListener("click",i),this.dispose=function(){s.dispose(),n.dispose(),n.map.dispose(),Kn.delete(e),this.removeEventListener("mousedown",i),this.removeEventListener("mousemove",i),this.removeEventListener("mouseup",i),this.removeEventListener("click",i)}}}class uA extends r.CanvasTexture{constructor(e){super(js(e)),this.dom=e,this.anisotropy=16,this.colorSpace=r.SRGBColorSpace,this.minFilter=r.LinearFilter,this.magFilter=r.LinearFilter;const t=new MutationObserver(()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout(()=>this.update(),16))}),s={attributes:!0,childList:!0,subtree:!0,characterData:!0};t.observe(e,s),this.observer=t}dispatchDOMEvent(e){e.data&&pA(this.dom,e.type,e.data.x,e.data.y)}update(){this.image=js(this.dom),this.needsUpdate=!0,this.scheduleUpdate=null}dispose(){this.observer&&this.observer.disconnect(),this.scheduleUpdate=clearTimeout(this.scheduleUpdate),super.dispose()}}const Kn=new WeakMap;function js(c){const e=document.createRange(),t=new r.Color;function s(g){const f=[];let I=!1;function m(){if(I&&(I=!1,g.restore()),f.length===0)return;let b=-1/0,B=-1/0,w=1/0,C=1/0;for(let y=0;y<f.length;y++){const x=f[y];b=Math.max(b,x.x),B=Math.max(B,x.y),w=Math.min(w,x.x+x.width),C=Math.min(C,x.y+x.height)}g.save(),g.beginPath(),g.rect(b,B,w-b,C-B),g.clip(),I=!0}return{add:function(b){f.push(b),m()},remove:function(){f.pop(),m()}}}function n(g,f,I,m){m!==""&&(g.textTransform==="uppercase"&&(m=m.toUpperCase()),h.font=g.fontWeight+" "+g.fontSize+" "+g.fontFamily,h.textBaseline="top",h.fillStyle=g.color,h.fillText(m,f,I+parseFloat(g.fontSize)*.1))}function i(g,f,I,m,b){I<2*b&&(b=I/2),m<2*b&&(b=m/2),h.beginPath(),h.moveTo(g+b,f),h.arcTo(g+I,f,g+I,f+m,b),h.arcTo(g+I,f+m,g,f+m,b),h.arcTo(g,f+m,g,f,b),h.arcTo(g,f,g+I,f,b),h.closePath()}function o(g,f,I,m,b,B){const w=g[f+"Width"],C=g[f+"Style"],y=g[f+"Color"];w!=="0px"&&C!=="none"&&y!=="transparent"&&y!=="rgba(0, 0, 0, 0)"&&(h.strokeStyle=y,h.lineWidth=parseFloat(w),h.beginPath(),h.moveTo(I,m),h.lineTo(I+b,m+B),h.stroke())}function a(g,f){if(g.nodeType===Node.COMMENT_NODE||g.nodeName==="SCRIPT"||g.style&&g.style.display==="none")return;let I=0,m=0,b=0,B=0;if(g.nodeType===Node.TEXT_NODE){e.selectNode(g);const C=e.getBoundingClientRect();I=C.left-A.left-.5,m=C.top-A.top-.5,b=C.width,B=C.height,n(f,I,m,g.nodeValue.trim())}else if(g instanceof HTMLCanvasElement){const C=g.getBoundingClientRect();I=C.left-A.left-.5,m=C.top-A.top-.5,h.save();const y=window.devicePixelRatio;h.scale(1/y,1/y),h.drawImage(g,I,m),h.restore()}else if(g instanceof HTMLImageElement){const C=g.getBoundingClientRect();I=C.left-A.left-.5,m=C.top-A.top-.5,b=C.width,B=C.height,h.drawImage(g,I,m,b,B)}else{const C=g.getBoundingClientRect();I=C.left-A.left-.5,m=C.top-A.top-.5,b=C.width,B=C.height,f=window.getComputedStyle(g),i(I,m,b,B,parseFloat(f.borderRadius));const y=f.backgroundColor;y!=="transparent"&&y!=="rgba(0, 0, 0, 0)"&&(h.fillStyle=y,h.fill());const x=["borderTop","borderLeft","borderBottom","borderRight"];let R=!0,D=null;for(const S of x){if(D!==null&&(R=f[S+"Width"]===f[D+"Width"]&&f[S+"Color"]===f[D+"Color"]&&f[S+"Style"]===f[D+"Style"]),R===!1)break;D=S}if(R===!0){const S=parseFloat(f.borderTopWidth);f.borderTopWidth!=="0px"&&f.borderTopStyle!=="none"&&f.borderTopColor!=="transparent"&&f.borderTopColor!=="rgba(0, 0, 0, 0)"&&(h.strokeStyle=f.borderTopColor,h.lineWidth=S,h.stroke())}else o(f,"borderTop",I,m,b,0),o(f,"borderLeft",I,m,0,B),o(f,"borderBottom",I,m+B,b,0),o(f,"borderRight",I+b,m,0,B);if(g instanceof HTMLInputElement){let S=f.accentColor;(S===void 0||S==="auto")&&(S=f.color),t.set(S);const N=Math.sqrt(.299*t.r**2+.587*t.g**2+.114*t.b**2)<.5?"white":"#111111";if(g.type==="radio"&&(i(I,m,b,B,B),h.fillStyle="white",h.strokeStyle=S,h.lineWidth=1,h.fill(),h.stroke(),g.checked&&(i(I+2,m+2,b-4,B-4,B),h.fillStyle=S,h.strokeStyle=N,h.lineWidth=2,h.fill(),h.stroke())),g.type==="checkbox"&&(i(I,m,b,B,2),h.fillStyle=g.checked?S:"white",h.strokeStyle=g.checked?N:S,h.lineWidth=1,h.stroke(),h.fill(),g.checked)){const G=h.textAlign;h.textAlign="center";const H={color:N,fontFamily:f.fontFamily,fontSize:B+"px",fontWeight:"bold"};n(H,I+b/2,m,"✔"),h.textAlign=G}if(g.type==="range"){const[G,H,X]=["min","max","value"].map(Y=>parseFloat(g[Y])),U=(X-G)/(H-G)*(b-B);i(I,m+B/4,b,B/2,B/4),h.fillStyle=N,h.strokeStyle=S,h.lineWidth=1,h.fill(),h.stroke(),i(I,m+B/4,U+B/2,B/2,B/4),h.fillStyle=S,h.fill(),i(I+U,m,B,B,B/2),h.fillStyle=S,h.fill()}(g.type==="color"||g.type==="text"||g.type==="number")&&(u.add({x:I,y:m,width:b,height:B}),n(f,I+parseInt(f.paddingLeft),m+parseInt(f.paddingTop),g.value),u.remove())}}const w=f.overflow==="auto"||f.overflow==="hidden";w&&u.add({x:I,y:m,width:b,height:B});for(let C=0;C<g.childNodes.length;C++)a(g.childNodes[C],f);w&&u.remove()}const A=c.getBoundingClientRect();let l=Kn.get(c);l===void 0&&(l=document.createElement("canvas"),l.width=A.width,l.height=A.height,Kn.set(c,l));const h=l.getContext("2d"),u=new s(h);return h.clearRect(0,0,l.width,l.height),a(c),l}function pA(c,e,t,s){const n={clientX:t*c.offsetWidth+c.offsetLeft,clientY:s*c.offsetHeight+c.offsetTop,view:c.ownerDocument.defaultView};window.dispatchEvent(new MouseEvent(e,n));const i=c.getBoundingClientRect();t=t*i.width+i.left,s=s*i.height+i.top;function o(a){if(a.nodeType!==Node.TEXT_NODE&&a.nodeType!==Node.COMMENT_NODE){const A=a.getBoundingClientRect();if(t>A.left&&t<A.right&&s>A.top&&s<A.bottom&&(a.dispatchEvent(new MouseEvent(e,n)),a instanceof HTMLInputElement&&a.type==="range"&&(e==="mousedown"||e==="click"))){const[l,h]=["min","max"].map(I=>parseFloat(a[I])),u=A.width,f=(t-A.x)/u;a.value=l+(h-l)*f,a.dispatchEvent(new InputEvent("input",{bubbles:!0}))}for(let l=0;l<a.childNodes.length;l++)o(a.childNodes[l])}}o(c)}const An=new r.Vector2,xt={type:"",data:An},qs=new r.Raycaster;class gA extends r.Group{listenToPointerEvents(e,t){const s=this,n=new r.Raycaster,i=e.domElement;function o(a){a.stopPropagation();const A=e.domElement.getBoundingClientRect();An.x=(a.clientX-A.left)/A.width*2-1,An.y=-(a.clientY-A.top)/A.height*2+1,n.setFromCamera(An,t);const l=n.intersectObjects(s.children,!1);if(l.length>0){const h=l[0],u=h.object,g=h.uv;xt.type=a.type,xt.data.set(g.x,1-g.y),u.dispatchEvent(xt)}}i.addEventListener("pointerdown",o),i.addEventListener("pointerup",o),i.addEventListener("pointermove",o),i.addEventListener("mousedown",o),i.addEventListener("mouseup",o),i.addEventListener("mousemove",o),i.addEventListener("click",o)}listenToXRControllerEvents(e){const t=this,s={move:"mousemove",select:"click",selectstart:"mousedown",selectend:"mouseup"};function n(i){const o=i.target;qs.setFromXRController(o);const a=qs.intersectObjects(t.children,!1);if(a.length>0){const A=a[0],l=A.object,h=A.uv;xt.type=s[i.type],xt.data.set(h.x,1-h.y),l.dispatchEvent(xt)}}e.addEventListener("move",n),e.addEventListener("select",n),e.addEventListener("selectstart",n),e.addEventListener("selectend",n)}}const Nt=new r.Vector3,Pt=new r.Vector3,zs=new r.Matrix3;class fA extends r.LineSegments{constructor(e,t=1,s=16711680){const n=new r.BufferGeometry,i=e.geometry.attributes.normal.count,o=new r.Float32BufferAttribute(i*2*3,3);n.setAttribute("position",o),super(n,new r.LineBasicMaterial({color:s,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),zs.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,s=this.object.geometry;if(s){const n=s.attributes.position,i=s.attributes.normal;let o=0;for(let a=0,A=n.count;a<A;a++)Nt.fromBufferAttribute(n,a).applyMatrix4(e),Pt.fromBufferAttribute(i,a),Pt.applyMatrix3(zs).normalize().multiplyScalar(this.size).add(Nt),t.setXYZ(o,Nt.x,Nt.y,Nt.z),o=o+1,t.setXYZ(o,Pt.x,Pt.y,Pt.z),o=o+1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Li(c,e,t){const s=t.length-c-1;if(e>=t[s])return s-1;if(e<=t[c])return c;let n=c,i=s,o=Math.floor((n+i)/2);for(;e<t[o]||e>=t[o+1];)e<t[o]?i=o:n=o,o=Math.floor((n+i)/2);return o}function dA(c,e,t,s){const n=[],i=[],o=[];n[0]=1;for(let a=1;a<=t;++a){i[a]=e-s[c+1-a],o[a]=s[c+a]-e;let A=0;for(let l=0;l<a;++l){const h=o[l+1],u=i[a-l],g=n[l]/(h+u);n[l]=A+h*g,A=u*g}n[a]=A}return n}function IA(c,e,t,s){const n=Li(c,s,e),i=dA(n,s,c,e),o=new r.Vector4(0,0,0,0);for(let a=0;a<=c;++a){const A=t[n-c+a],l=i[a],h=A.w*l;o.x+=A.x*h,o.y+=A.y*h,o.z+=A.z*h,o.w+=A.w*l}return o}function mA(c,e,t,s,n){const i=[];for(let u=0;u<=t;++u)i[u]=0;const o=[];for(let u=0;u<=s;++u)o[u]=i.slice(0);const a=[];for(let u=0;u<=t;++u)a[u]=i.slice(0);a[0][0]=1;const A=i.slice(0),l=i.slice(0);for(let u=1;u<=t;++u){A[u]=e-n[c+1-u],l[u]=n[c+u]-e;let g=0;for(let f=0;f<u;++f){const I=l[f+1],m=A[u-f];a[u][f]=I+m;const b=a[f][u-1]/a[u][f];a[f][u]=g+I*b,g=m*b}a[u][u]=g}for(let u=0;u<=t;++u)o[0][u]=a[u][t];for(let u=0;u<=t;++u){let g=0,f=1;const I=[];for(let m=0;m<=t;++m)I[m]=i.slice(0);I[0][0]=1;for(let m=1;m<=s;++m){let b=0;const B=u-m,w=t-m;u>=m&&(I[f][0]=I[g][0]/a[w+1][B],b=I[f][0]*a[B][w]);const C=B>=-1?1:-B,y=u-1<=w?m-1:t-u;for(let R=C;R<=y;++R)I[f][R]=(I[g][R]-I[g][R-1])/a[w+1][B+R],b+=I[f][R]*a[B+R][w];u<=w&&(I[f][m]=-I[g][m-1]/a[w+1][u],b+=I[f][m]*a[u][w]),o[m][u]=b;const x=g;g=f,f=x}}let h=t;for(let u=1;u<=s;++u){for(let g=0;g<=t;++g)o[u][g]*=h;h*=t-u}return o}function bA(c,e,t,s,n){const i=n<c?n:c,o=[],a=Li(c,s,e),A=mA(a,s,c,i,e),l=[];for(let h=0;h<t.length;++h){const u=t[h].clone(),g=u.w;u.x*=g,u.y*=g,u.z*=g,l[h]=u}for(let h=0;h<=i;++h){const u=l[a-c].clone().multiplyScalar(A[h][0]);for(let g=1;g<=c;++g)u.add(l[a-c+g].clone().multiplyScalar(A[h][g]));o[h]=u}for(let h=i+1;h<=n+1;++h)o[h]=new r.Vector4(0,0,0);return o}function EA(c,e){let t=1;for(let n=2;n<=c;++n)t*=n;let s=1;for(let n=2;n<=e;++n)s*=n;for(let n=2;n<=c-e;++n)s*=n;return t/s}function CA(c){const e=c.length,t=[],s=[];for(let i=0;i<e;++i){const o=c[i];t[i]=new r.Vector3(o.x,o.y,o.z),s[i]=o.w}const n=[];for(let i=0;i<e;++i){const o=t[i].clone();for(let a=1;a<=i;++a)o.sub(n[i-a].clone().multiplyScalar(EA(i,a)*s[a]));n[i]=o.divideScalar(s[0])}return n}function BA(c,e,t,s,n){const i=bA(c,e,t,s,n);return CA(i)}class yA extends r.Curve{constructor(e,t,s,n,i){super(),this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=n||0,this.endKnot=i||this.knots.length-1;for(let o=0;o<s.length;++o){const a=s[o];this.controlPoints[o]=new r.Vector4(a.x,a.y,a.z,a.w)}}getPoint(e,t=new r.Vector3){const s=t,n=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),i=IA(this.degree,this.knots,this.controlPoints,n);return i.w!==1&&i.divideScalar(i.w),s.set(i.x,i.y,i.z)}getTangent(e,t=new r.Vector3){const s=t,n=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),i=BA(this.degree,this.knots,this.controlPoints,n,1);return s.copy(i[1]).normalize(),s}}let oe,ye,Le;class wA extends r.Loader{constructor(e){super(e)}load(e,t,s,n){const i=this,o=i.path===""?r.LoaderUtils.extractUrlBase(e):i.path,a=new r.FileLoader(this.manager);a.setPath(i.path),a.setResponseType("arraybuffer"),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,function(A){try{t(i.parse(A,o))}catch(l){n?n(l):console.error(l),i.manager.itemError(e)}},s,n)}parse(e,t){if(MA(e))oe=new vA().parse(e);else{const n=Ui(e);if(!RA(n))throw new Error("THREE.FBXLoader: Unknown format.");if(Ks(n)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+Ks(n));oe=new TA().parse(n)}const s=new r.TextureLoader(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new QA(s,this.manager).parse(oe)}getFbxTree(){return oe}}class QA{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){ye=this.parseConnections();const e=this.parseImages(),t=this.parseTextures(e),s=this.parseMaterials(t),n=this.parseDeformers(),i=new xA().parse(n);return this.parseScene(n,i,s),Le}parseConnections(){const e=new Map;return"Connections"in oe&&oe.Connections.connections.forEach(function(s){const n=s[0],i=s[1],o=s[2];e.has(n)||e.set(n,{parents:[],children:[]});const a={ID:i,relationship:o};e.get(n).parents.push(a),e.has(i)||e.set(i,{parents:[],children:[]});const A={ID:n,relationship:o};e.get(i).children.push(A)}),e}parseImages(){const e={},t={};if("Video"in oe.Objects){const s=oe.Objects.Video;for(const n in s){const i=s[n],o=parseInt(n);if(e[o]=i.RelativeFilename||i.Filename,"Content"in i){const a=i.Content instanceof ArrayBuffer&&i.Content.byteLength>0,A=typeof i.Content=="string"&&i.Content!=="";if(a||A){const l=this.parseImage(s[n]);t[i.RelativeFilename||i.Filename]=l}}}}for(const s in e){const n=e[s];t[n]!==void 0?e[s]=t[n]:e[s]=e[s].split("\\").pop()}return e}parseImage(e){const t=e.Content,s=e.RelativeFilename||e.Filename,n=s.slice(s.lastIndexOf(".")+1).toLowerCase();let i;switch(n){case"bmp":i="image/bmp";break;case"jpg":case"jpeg":i="image/jpeg";break;case"png":i="image/png";break;case"tif":i="image/tiff";break;case"tga":this.manager.getHandler(".tga")===null&&console.warn("FBXLoader: TGA loader not found, skipping ",s),i="image/tga";break;default:console.warn('FBXLoader: Image type "'+n+'" is not supported.');return}if(typeof t=="string")return"data:"+i+";base64,"+t;{const o=new Uint8Array(t);return window.URL.createObjectURL(new Blob([o],{type:i}))}}parseTextures(e){const t=new Map;if("Texture"in oe.Objects){const s=oe.Objects.Texture;for(const n in s){const i=this.parseTexture(s[n],e);t.set(parseInt(n),i)}}return t}parseTexture(e,t){const s=this.loadTexture(e,t);s.ID=e.id,s.name=e.attrName;const n=e.WrapModeU,i=e.WrapModeV,o=n!==void 0?n.value:0,a=i!==void 0?i.value:0;if(s.wrapS=o===0?r.RepeatWrapping:r.ClampToEdgeWrapping,s.wrapT=a===0?r.RepeatWrapping:r.ClampToEdgeWrapping,"Scaling"in e){const A=e.Scaling.value;s.repeat.x=A[0],s.repeat.y=A[1]}if("Translation"in e){const A=e.Translation.value;s.offset.x=A[0],s.offset.y=A[1]}return s}loadTexture(e,t){const s=new Set(["tga","tif","tiff","exr","dds","hdr","ktx2"]),n=e.FileName.split(".").pop().toLowerCase(),i=s.has(n)?this.manager.getHandler(`.${n}`):this.textureLoader;if(!i)return console.warn(`FBXLoader: ${n.toUpperCase()} loader not found, creating placeholder texture for`,e.RelativeFilename),new r.Texture;const o=i.path;o||i.setPath(this.textureLoader.path);const a=ye.get(e.id).children;let A;a!==void 0&&a.length>0&&t[a[0].ID]!==void 0&&(A=t[a[0].ID],(A.indexOf("blob:")===0||A.indexOf("data:")===0)&&i.setPath(void 0));const l=i.load(A);return i.setPath(o),l}parseMaterials(e){const t=new Map;if("Material"in oe.Objects){const s=oe.Objects.Material;for(const n in s){const i=this.parseMaterial(s[n],e);i!==null&&t.set(parseInt(n),i)}}return t}parseMaterial(e,t){const s=e.id,n=e.attrName;let i=e.ShadingModel;if(typeof i=="object"&&(i=i.value),!ye.has(s))return null;const o=this.parseParameters(e,t,s);let a;switch(i.toLowerCase()){case"phong":a=new r.MeshPhongMaterial;break;case"lambert":a=new r.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',i),a=new r.MeshPhongMaterial;break}return a.setValues(o),a.name=n,a}parseParameters(e,t,s){const n={};e.BumpFactor&&(n.bumpScale=e.BumpFactor.value),e.Diffuse?n.color=r.ColorManagement.toWorkingColorSpace(new r.Color().fromArray(e.Diffuse.value),r.SRGBColorSpace):e.DiffuseColor&&(e.DiffuseColor.type==="Color"||e.DiffuseColor.type==="ColorRGB")&&(n.color=r.ColorManagement.toWorkingColorSpace(new r.Color().fromArray(e.DiffuseColor.value),r.SRGBColorSpace)),e.DisplacementFactor&&(n.displacementScale=e.DisplacementFactor.value),e.Emissive?n.emissive=r.ColorManagement.toWorkingColorSpace(new r.Color().fromArray(e.Emissive.value),r.SRGBColorSpace):e.EmissiveColor&&(e.EmissiveColor.type==="Color"||e.EmissiveColor.type==="ColorRGB")&&(n.emissive=r.ColorManagement.toWorkingColorSpace(new r.Color().fromArray(e.EmissiveColor.value),r.SRGBColorSpace)),e.EmissiveFactor&&(n.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),e.Opacity&&(n.opacity=parseFloat(e.Opacity.value)),n.opacity<1&&(n.transparent=!0),e.ReflectionFactor&&(n.reflectivity=e.ReflectionFactor.value),e.Shininess&&(n.shininess=e.Shininess.value),e.Specular?n.specular=r.ColorManagement.toWorkingColorSpace(new r.Color().fromArray(e.Specular.value),r.SRGBColorSpace):e.SpecularColor&&e.SpecularColor.type==="Color"&&(n.specular=r.ColorManagement.toWorkingColorSpace(new r.Color().fromArray(e.SpecularColor.value),r.SRGBColorSpace));const i=this;return ye.get(s).children.forEach(function(o){const a=o.relationship;switch(a){case"Bump":n.bumpMap=i.getTexture(t,o.ID);break;case"Maya|TEX_ao_map":n.aoMap=i.getTexture(t,o.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":n.map=i.getTexture(t,o.ID),n.map!==void 0&&(n.map.colorSpace=r.SRGBColorSpace);break;case"DisplacementColor":n.displacementMap=i.getTexture(t,o.ID);break;case"EmissiveColor":n.emissiveMap=i.getTexture(t,o.ID),n.emissiveMap!==void 0&&(n.emissiveMap.colorSpace=r.SRGBColorSpace);break;case"NormalMap":case"Maya|TEX_normal_map":n.normalMap=i.getTexture(t,o.ID);break;case"ReflectionColor":n.envMap=i.getTexture(t,o.ID),n.envMap!==void 0&&(n.envMap.mapping=r.EquirectangularReflectionMapping,n.envMap.colorSpace=r.SRGBColorSpace);break;case"SpecularColor":n.specularMap=i.getTexture(t,o.ID),n.specularMap!==void 0&&(n.specularMap.colorSpace=r.SRGBColorSpace);break;case"TransparentColor":case"TransparencyFactor":n.alphaMap=i.getTexture(t,o.ID),n.transparent=!0;break;default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",a);break}}),n}getTexture(e,t){return"LayeredTexture"in oe.Objects&&t in oe.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=ye.get(t).children[0].ID),e.get(t)}parseDeformers(){const e={},t={};if("Deformer"in oe.Objects){const s=oe.Objects.Deformer;for(const n in s){const i=s[n],o=ye.get(parseInt(n));if(i.attrType==="Skin"){const a=this.parseSkeleton(o,s);a.ID=n,o.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),a.geometryID=o.parents[0].ID,e[n]=a}else if(i.attrType==="BlendShape"){const a={id:n};a.rawTargets=this.parseMorphTargets(o,s),a.id=n,o.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[n]=a}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){const s=[];return e.children.forEach(function(n){const i=t[n.ID];if(i.attrType!=="Cluster")return;const o={ID:n.ID,indices:[],weights:[],transformLink:new r.Matrix4().fromArray(i.TransformLink.a)};"Indexes"in i&&(o.indices=i.Indexes.a,o.weights=i.Weights.a),s.push(o)}),{rawBones:s,bones:[]}}parseMorphTargets(e,t){const s=[];for(let n=0;n<e.children.length;n++){const i=e.children[n],o=t[i.ID],a={name:o.attrName,initialWeight:o.DeformPercent,id:o.id,fullWeights:o.FullWeights.a};if(o.attrType!=="BlendShapeChannel")return;a.geoID=ye.get(parseInt(i.ID)).children.filter(function(A){return A.relationship===void 0})[0].ID,s.push(a)}return s}parseScene(e,t,s){Le=new r.Group;const n=this.parseModels(e.skeletons,t,s),i=oe.Objects.Model,o=this;n.forEach(function(A){const l=i[A.ID];o.setLookAtProperties(A,l),ye.get(A.ID)?.parents?.forEach(function(u){const g=n.get(u.ID);g!==void 0&&g.add(A)}),A.parent===null&&Le.add(A)}),this.bindSkeleton(e.skeletons,t,n),this.addGlobalSceneSettings(),Le.traverse(function(A){if(A.userData.transformData){A.parent&&(A.userData.transformData.parentMatrix=A.parent.matrix,A.userData.transformData.parentMatrixWorld=A.parent.matrixWorld);const l=Gi(A.userData.transformData);A.applyMatrix4(l),A.updateWorldMatrix()}A.isSkinnedMesh&&(A.computeBoundingBox(),A.computeBoundingSphere(),A.boundingBox.expandByScalar(3),A.boundingSphere.radius*=3)});const a=new SA().parse();Le.children.length===1&&Le.children[0].isGroup&&(Le.children[0].animations=a,Le=Le.children[0]),Le.animations=a}parseModels(e,t,s){const n=new Map,i=oe.Objects.Model;for(const o in i){const a=parseInt(o),A=i[o],l=ye.get(a);let h=this.buildSkeleton(l,e,a,A.attrName);if(!h){switch(A.attrType){case"Camera":h=this.createCamera(l);break;case"Light":h=this.createLight(l);break;case"Mesh":h=this.createMesh(l,t,s);break;case"NurbsCurve":h=this.createCurve(l,t);break;case"LimbNode":case"Root":h=new r.Bone;break;default:h=new r.Group;break}h.name=A.attrName?r.PropertyBinding.sanitizeNodeName(A.attrName):"",h.userData.originalName=A.attrName,h.ID=a}this.getTransformData(h,A),n.set(a,h)}return n}buildSkeleton(e,t,s,n){let i=null;return e?.parents.forEach(function(o){for(const a in t){const A=t[a];A.rawBones.forEach(function(l,h){if(l.ID===o.ID){const u=i;i=new r.Bone,i.matrixWorld.copy(l.transformLink),i.name=n?r.PropertyBinding.sanitizeNodeName(n):"",i.userData.originalName=n,i.ID=s,A.bones[h]=i,u!==null&&i.add(u)}})}}),i}createCamera(e){let t,s;if(e.children.forEach(function(n){const i=oe.Objects.NodeAttribute[n.ID];i!==void 0&&(s=i)}),s===void 0)t=new r.Object3D;else{let n=0;s.CameraProjectionType!==void 0&&s.CameraProjectionType.value===1&&(n=1);let i=1;s.NearPlane!==void 0&&(i=s.NearPlane.value/1e3);let o=1e3;s.FarPlane!==void 0&&(o=s.FarPlane.value/1e3);let a=window.innerWidth,A=window.innerHeight;s.AspectWidth!==void 0&&s.AspectHeight!==void 0&&(a=s.AspectWidth.value,A=s.AspectHeight.value);const l=a/A;let h=45;s.FieldOfView!==void 0&&(h=s.FieldOfView.value);const u=s.FocalLength?s.FocalLength.value:null;switch(n){case 0:t=new r.PerspectiveCamera(h,l,i,o),u!==null&&t.setFocalLength(u);break;case 1:console.warn("THREE.FBXLoader: Orthographic cameras not supported yet."),t=new r.Object3D;break;default:console.warn("THREE.FBXLoader: Unknown camera type "+n+"."),t=new r.Object3D;break}}return t}createLight(e){let t,s;if(e.children.forEach(function(n){const i=oe.Objects.NodeAttribute[n.ID];i!==void 0&&(s=i)}),s===void 0)t=new r.Object3D;else{let n;s.LightType===void 0?n=0:n=s.LightType.value;let i=16777215;s.Color!==void 0&&(i=r.ColorManagement.toWorkingColorSpace(new r.Color().fromArray(s.Color.value),r.SRGBColorSpace));let o=s.Intensity===void 0?1:s.Intensity.value/100;s.CastLightOnObject!==void 0&&s.CastLightOnObject.value===0&&(o=0);let a=0;s.FarAttenuationEnd!==void 0&&(s.EnableFarAttenuation!==void 0&&s.EnableFarAttenuation.value===0?a=0:a=s.FarAttenuationEnd.value);const A=1;switch(n){case 0:t=new r.PointLight(i,o,a,A);break;case 1:t=new r.DirectionalLight(i,o);break;case 2:let l=Math.PI/3;s.InnerAngle!==void 0&&(l=r.MathUtils.degToRad(s.InnerAngle.value));let h=0;s.OuterAngle!==void 0&&(h=r.MathUtils.degToRad(s.OuterAngle.value),h=Math.max(h,1)),t=new r.SpotLight(i,o,a,l,h,A);break;default:console.warn("THREE.FBXLoader: Unknown light type "+s.LightType.value+", defaulting to a PointLight."),t=new r.PointLight(i,o);break}s.CastShadows!==void 0&&s.CastShadows.value===1&&(t.castShadow=!0)}return t}createMesh(e,t,s){let n,i=null,o=null;const a=[];if(e.children.forEach(function(A){t.has(A.ID)&&(i=t.get(A.ID)),s.has(A.ID)&&a.push(s.get(A.ID))}),a.length>1?o=a:a.length>0?o=a[0]:(o=new r.MeshPhongMaterial({name:r.Loader.DEFAULT_MATERIAL_NAME,color:13421772}),a.push(o)),"color"in i.attributes&&a.forEach(function(A){A.vertexColors=!0}),i.groups.length>0){let A=!1;for(let l=0,h=i.groups.length;l<h;l++){const u=i.groups[l];(u.materialIndex<0||u.materialIndex>=a.length)&&(u.materialIndex=a.length,A=!0)}if(A){const l=new r.MeshStandardMaterial;a.push(l)}}return i.FBX_Deformer?(n=new r.SkinnedMesh(i,o),n.normalizeSkinWeights()):n=new r.Mesh(i,o),n}createCurve(e,t){const s=e.children.reduce(function(i,o){return t.has(o.ID)&&(i=t.get(o.ID)),i},null),n=new r.LineBasicMaterial({name:r.Loader.DEFAULT_MATERIAL_NAME,color:3342591,linewidth:1});return new r.Line(s,n)}getTransformData(e,t){const s={};"InheritType"in t&&(s.inheritType=parseInt(t.InheritType.value)),"RotationOrder"in t?s.eulerOrder=Kt(t.RotationOrder.value):s.eulerOrder=Kt(0),"Lcl_Translation"in t&&(s.translation=t.Lcl_Translation.value),"PreRotation"in t&&(s.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(s.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(s.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(s.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(s.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(s.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(s.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(s.rotationPivot=t.RotationPivot.value),e.userData.transformData=s}setLookAtProperties(e,t){"LookAtProperty"in t&&ye.get(e.ID).children.forEach(function(n){if(n.relationship==="LookAtProperty"){const i=oe.Objects.Model[n.ID];if("Lcl_Translation"in i){const o=i.Lcl_Translation.value;e.target!==void 0?(e.target.position.fromArray(o),Le.add(e.target)):e.lookAt(new r.Vector3().fromArray(o))}}})}bindSkeleton(e,t,s){const n=this.parsePoseNodes();for(const i in e){const o=e[i];ye.get(parseInt(o.ID)).parents.forEach(function(A){if(t.has(A.ID)){const l=A.ID;ye.get(l).parents.forEach(function(u){s.has(u.ID)&&s.get(u.ID).bind(new r.Skeleton(o.bones),n[u.ID])})}})}}parsePoseNodes(){const e={};if("Pose"in oe.Objects){const t=oe.Objects.Pose;for(const s in t)if(t[s].attrType==="BindPose"&&t[s].NbPoseNodes>0){const n=t[s].PoseNode;Array.isArray(n)?n.forEach(function(i){e[i.Node]=new r.Matrix4().fromArray(i.Matrix.a)}):e[n.Node]=new r.Matrix4().fromArray(n.Matrix.a)}}return e}addGlobalSceneSettings(){if("GlobalSettings"in oe){if("AmbientColor"in oe.GlobalSettings){const e=oe.GlobalSettings.AmbientColor.value,t=e[0],s=e[1],n=e[2];if(t!==0||s!==0||n!==0){const i=new r.Color().setRGB(t,s,n,r.SRGBColorSpace);Le.add(new r.AmbientLight(i,1))}}"UnitScaleFactor"in oe.GlobalSettings&&(Le.userData.unitScaleFactor=oe.GlobalSettings.UnitScaleFactor.value)}}}class xA{constructor(){this.negativeMaterialIndices=!1}parse(e){const t=new Map;if("Geometry"in oe.Objects){const s=oe.Objects.Geometry;for(const n in s){const i=ye.get(parseInt(n)),o=this.parseGeometry(i,s[n],e);t.set(parseInt(n),o)}}return this.negativeMaterialIndices===!0&&console.warn("THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected."),t}parseGeometry(e,t,s){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,s);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,s){const n=s.skeletons,i=[],o=e.parents.map(function(u){return oe.Objects.Model[u.ID]});if(o.length===0)return;const a=e.children.reduce(function(u,g){return n[g.ID]!==void 0&&(u=n[g.ID]),u},null);e.children.forEach(function(u){s.morphTargets[u.ID]!==void 0&&i.push(s.morphTargets[u.ID])});const A=o[0],l={};"RotationOrder"in A&&(l.eulerOrder=Kt(A.RotationOrder.value)),"InheritType"in A&&(l.inheritType=parseInt(A.InheritType.value)),"GeometricTranslation"in A&&(l.translation=A.GeometricTranslation.value),"GeometricRotation"in A&&(l.rotation=A.GeometricRotation.value),"GeometricScaling"in A&&(l.scale=A.GeometricScaling.value);const h=Gi(l);return this.genGeometry(t,a,i,h)}genGeometry(e,t,s,n){const i=new r.BufferGeometry;e.attrName&&(i.name=e.attrName);const o=this.parseGeoNode(e,t),a=this.genBuffers(o),A=new r.Float32BufferAttribute(a.vertex,3);if(A.applyMatrix4(n),i.setAttribute("position",A),a.colors.length>0&&i.setAttribute("color",new r.Float32BufferAttribute(a.colors,3)),t&&(i.setAttribute("skinIndex",new r.Uint16BufferAttribute(a.weightsIndices,4)),i.setAttribute("skinWeight",new r.Float32BufferAttribute(a.vertexWeights,4)),i.FBX_Deformer=t),a.normal.length>0){const l=new r.Matrix3().getNormalMatrix(n),h=new r.Float32BufferAttribute(a.normal,3);h.applyNormalMatrix(l),i.setAttribute("normal",h)}if(a.uvs.forEach(function(l,h){const u=h===0?"uv":`uv${h}`;i.setAttribute(u,new r.Float32BufferAttribute(a.uvs[h],2))}),o.material&&o.material.mappingType!=="AllSame"){let l=a.materialIndex[0],h=0;if(a.materialIndex.forEach(function(u,g){u!==l&&(i.addGroup(h,g-h,l),l=u,h=g)}),i.groups.length>0){const u=i.groups[i.groups.length-1],g=u.start+u.count;g!==a.materialIndex.length&&i.addGroup(g,a.materialIndex.length-g,l)}i.groups.length===0&&i.addGroup(0,a.materialIndex.length,a.materialIndex[0])}return this.addMorphTargets(i,e,s,n),i}parseGeoNode(e,t){const s={};if(s.vertexPositions=e.Vertices!==void 0?e.Vertices.a:[],s.vertexIndices=e.PolygonVertexIndex!==void 0?e.PolygonVertexIndex.a:[],e.LayerElementColor&&(s.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(s.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(s.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){s.uv=[];let n=0;for(;e.LayerElementUV[n];)e.LayerElementUV[n].UV&&s.uv.push(this.parseUVs(e.LayerElementUV[n])),n++}return s.weightTable={},t!==null&&(s.skeleton=t,t.rawBones.forEach(function(n,i){n.indices.forEach(function(o,a){s.weightTable[o]===void 0&&(s.weightTable[o]=[]),s.weightTable[o].push({id:i,weight:n.weights[a]})})})),s}genBuffers(e){const t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let s=0,n=0,i=!1,o=[],a=[],A=[],l=[],h=[],u=[];const g=this;return e.vertexIndices.forEach(function(f,I){let m,b=!1;f<0&&(f=f^-1,b=!0);let B=[],w=[];if(o.push(f*3,f*3+1,f*3+2),e.color){const C=on(I,s,f,e.color);A.push(C[0],C[1],C[2])}if(e.skeleton){if(e.weightTable[f]!==void 0&&e.weightTable[f].forEach(function(C){w.push(C.weight),B.push(C.id)}),w.length>4){i||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),i=!0);const C=[0,0,0,0],y=[0,0,0,0];w.forEach(function(x,R){let D=x,S=B[R];y.forEach(function(v,N,G){if(D>v){G[N]=D,D=v;const H=C[N];C[N]=S,S=H}})}),B=C,w=y}for(;w.length<4;)w.push(0),B.push(0);for(let C=0;C<4;++C)h.push(w[C]),u.push(B[C])}if(e.normal){const C=on(I,s,f,e.normal);a.push(C[0],C[1],C[2])}e.material&&e.material.mappingType!=="AllSame"&&(m=on(I,s,f,e.material)[0],m<0&&(g.negativeMaterialIndices=!0,m=0)),e.uv&&e.uv.forEach(function(C,y){const x=on(I,s,f,C);l[y]===void 0&&(l[y]=[]),l[y].push(x[0]),l[y].push(x[1])}),n++,b&&(g.genFace(t,e,o,m,a,A,l,h,u,n),s++,n=0,o=[],a=[],A=[],l=[],h=[],u=[])}),t}getNormalNewell(e){const t=new r.Vector3(0,0,0);for(let s=0;s<e.length;s++){const n=e[s],i=e[(s+1)%e.length];t.x+=(n.y-i.y)*(n.z+i.z),t.y+=(n.z-i.z)*(n.x+i.x),t.z+=(n.x-i.x)*(n.y+i.y)}return t.normalize(),t}getNormalTangentAndBitangent(e){const t=this.getNormalNewell(e),n=(Math.abs(t.z)>.5?new r.Vector3(0,1,0):new r.Vector3(0,0,1)).cross(t).normalize(),i=t.clone().cross(n).normalize();return{normal:t,tangent:n,bitangent:i}}flattenVertex(e,t,s){return new r.Vector2(e.dot(t),e.dot(s))}genFace(e,t,s,n,i,o,a,A,l,h){let u;if(h>3){const g=[],f=t.baseVertexPositions||t.vertexPositions;for(let B=0;B<s.length;B+=3)g.push(new r.Vector3(f[s[B]],f[s[B+1]],f[s[B+2]]));const{tangent:I,bitangent:m}=this.getNormalTangentAndBitangent(g),b=[];for(const B of g)b.push(this.flattenVertex(B,I,m));u=r.ShapeUtils.triangulateShape(b,[])}else h===2?(console.warn("THREE.FBXLoader: Edge topology detected. This is currently not supported. The resulting mesh will not be correct."),u=[[0,1,2]]):u=[[0,1,2]];for(const[g,f,I]of u)e.vertex.push(t.vertexPositions[s[g*3]]),e.vertex.push(t.vertexPositions[s[g*3+1]]),e.vertex.push(t.vertexPositions[s[g*3+2]]),e.vertex.push(t.vertexPositions[s[f*3]]),e.vertex.push(t.vertexPositions[s[f*3+1]]),e.vertex.push(t.vertexPositions[s[f*3+2]]),e.vertex.push(t.vertexPositions[s[I*3]]),e.vertex.push(t.vertexPositions[s[I*3+1]]),e.vertex.push(t.vertexPositions[s[I*3+2]]),t.skeleton&&(e.vertexWeights.push(A[g*4]),e.vertexWeights.push(A[g*4+1]),e.vertexWeights.push(A[g*4+2]),e.vertexWeights.push(A[g*4+3]),e.vertexWeights.push(A[f*4]),e.vertexWeights.push(A[f*4+1]),e.vertexWeights.push(A[f*4+2]),e.vertexWeights.push(A[f*4+3]),e.vertexWeights.push(A[I*4]),e.vertexWeights.push(A[I*4+1]),e.vertexWeights.push(A[I*4+2]),e.vertexWeights.push(A[I*4+3]),e.weightsIndices.push(l[g*4]),e.weightsIndices.push(l[g*4+1]),e.weightsIndices.push(l[g*4+2]),e.weightsIndices.push(l[g*4+3]),e.weightsIndices.push(l[f*4]),e.weightsIndices.push(l[f*4+1]),e.weightsIndices.push(l[f*4+2]),e.weightsIndices.push(l[f*4+3]),e.weightsIndices.push(l[I*4]),e.weightsIndices.push(l[I*4+1]),e.weightsIndices.push(l[I*4+2]),e.weightsIndices.push(l[I*4+3])),t.color&&(e.colors.push(o[g*3]),e.colors.push(o[g*3+1]),e.colors.push(o[g*3+2]),e.colors.push(o[f*3]),e.colors.push(o[f*3+1]),e.colors.push(o[f*3+2]),e.colors.push(o[I*3]),e.colors.push(o[I*3+1]),e.colors.push(o[I*3+2])),t.material&&t.material.mappingType!=="AllSame"&&(e.materialIndex.push(n),e.materialIndex.push(n),e.materialIndex.push(n)),t.normal&&(e.normal.push(i[g*3]),e.normal.push(i[g*3+1]),e.normal.push(i[g*3+2]),e.normal.push(i[f*3]),e.normal.push(i[f*3+1]),e.normal.push(i[f*3+2]),e.normal.push(i[I*3]),e.normal.push(i[I*3+1]),e.normal.push(i[I*3+2])),t.uv&&t.uv.forEach(function(m,b){e.uvs[b]===void 0&&(e.uvs[b]=[]),e.uvs[b].push(a[b][g*2]),e.uvs[b].push(a[b][g*2+1]),e.uvs[b].push(a[b][f*2]),e.uvs[b].push(a[b][f*2+1]),e.uvs[b].push(a[b][I*2]),e.uvs[b].push(a[b][I*2+1])})}addMorphTargets(e,t,s,n){if(s.length===0)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];const i=this;s.forEach(function(o){o.rawTargets.forEach(function(a){const A=oe.Objects.Geometry[a.geoID];A!==void 0&&i.genMorphGeometry(e,t,A,n,a.name)})})}genMorphGeometry(e,t,s,n,i){const o=t.Vertices!==void 0?t.Vertices.a:[],a=t.PolygonVertexIndex!==void 0?t.PolygonVertexIndex.a:[],A=s.Vertices!==void 0?s.Vertices.a:[],l=s.Indexes!==void 0?s.Indexes.a:[],h=e.attributes.position.count*3,u=new Float32Array(h);for(let m=0;m<l.length;m++){const b=l[m]*3;u[b]=A[m*3],u[b+1]=A[m*3+1],u[b+2]=A[m*3+2]}const g={vertexIndices:a,vertexPositions:u,baseVertexPositions:o},f=this.genBuffers(g),I=new r.Float32BufferAttribute(f.vertex,3);I.name=i||s.attrName,I.applyMatrix4(n),e.morphAttributes.position.push(I)}parseNormals(e){const t=e.MappingInformationType,s=e.ReferenceInformationType,n=e.Normals.a;let i=[];return s==="IndexToDirect"&&("NormalIndex"in e?i=e.NormalIndex.a:"NormalsIndex"in e&&(i=e.NormalsIndex.a)),{dataSize:3,buffer:n,indices:i,mappingType:t,referenceType:s}}parseUVs(e){const t=e.MappingInformationType,s=e.ReferenceInformationType,n=e.UV.a;let i=[];return s==="IndexToDirect"&&(i=e.UVIndex.a),{dataSize:2,buffer:n,indices:i,mappingType:t,referenceType:s}}parseVertexColors(e){if(!e.Colors)return;const t=e.MappingInformationType,s=e.ReferenceInformationType,n=e.Colors.a;let i=[];s==="IndexToDirect"&&(i=e.ColorIndex.a);for(let o=0,a=new r.Color;o<n.length;o+=4)a.fromArray(n,o),r.ColorManagement.toWorkingColorSpace(a,r.SRGBColorSpace),a.toArray(n,o);return{dataSize:4,buffer:n,indices:i,mappingType:t,referenceType:s}}parseMaterialIndices(e){const t=e.MappingInformationType,s=e.ReferenceInformationType;if(t==="NoMappingInformation")return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:s};const n=e.Materials.a,i=[];for(let o=0;o<n.length;++o)i.push(o);return{dataSize:1,buffer:n,indices:i,mappingType:t,referenceType:s}}parseNurbsGeometry(e){const t=parseInt(e.Order);if(isNaN(t))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",e.Order,e.id),new r.BufferGeometry;const s=t-1,n=e.KnotVector.a,i=[],o=e.Points.a;for(let u=0,g=o.length;u<g;u+=4)i.push(new r.Vector4().fromArray(o,u));let a,A;if(e.Form==="Closed")i.push(i[0]);else if(e.Form==="Periodic"){a=s,A=n.length-1-a;for(let u=0;u<s;++u)i.push(i[u])}const h=new yA(s,n,i,a,A).getPoints(i.length*12);return new r.BufferGeometry().setFromPoints(h)}}class SA{parse(){const e=[],t=this.parseClips();if(t!==void 0)for(const s in t){const n=t[s],i=this.addClip(n);e.push(i)}return e}parseClips(){if(oe.Objects.AnimationCurve===void 0)return;const e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);const t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){const e=oe.Objects.AnimationCurveNode,t=new Map;for(const s in e){const n=e[s];if(n.attrName.match(/S|R|T|DeformPercent/)!==null){const i={id:n.id,attr:n.attrName,curves:{}};t.set(i.id,i)}}return t}parseAnimationCurves(e){const t=oe.Objects.AnimationCurve;for(const s in t){const n={id:t[s].id,times:t[s].KeyTime.a.map(DA),values:t[s].KeyValueFloat.a},i=ye.get(n.id);if(i!==void 0){const o=i.parents[0].ID,a=i.parents[0].relationship;a.match(/X/)?e.get(o).curves.x=n:a.match(/Y/)?e.get(o).curves.y=n:a.match(/Z/)?e.get(o).curves.z=n:a.match(/DeformPercent/)&&e.has(o)&&(e.get(o).curves.morph=n)}}}parseAnimationLayers(e){const t=oe.Objects.AnimationLayer,s=new Map;for(const n in t){const i=[],o=ye.get(parseInt(n));o!==void 0&&(o.children.forEach(function(A,l){if(e.has(A.ID)){const h=e.get(A.ID);if(h.curves.x!==void 0||h.curves.y!==void 0||h.curves.z!==void 0){if(i[l]===void 0){const u=ye.get(A.ID).parents.filter(function(g){return g.relationship!==void 0})[0].ID;if(u!==void 0){const g=oe.Objects.Model[u.toString()];if(g===void 0){console.warn("THREE.FBXLoader: Encountered a unused curve.",A);return}const f={modelName:g.attrName?r.PropertyBinding.sanitizeNodeName(g.attrName):"",ID:g.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};Le.traverse(function(I){I.ID===g.id&&(f.transform=I.matrix,I.userData.transformData&&(f.eulerOrder=I.userData.transformData.eulerOrder))}),f.transform||(f.transform=new r.Matrix4),"PreRotation"in g&&(f.preRotation=g.PreRotation.value),"PostRotation"in g&&(f.postRotation=g.PostRotation.value),i[l]=f}}i[l]&&(i[l][h.attr]=h)}else if(h.curves.morph!==void 0){if(i[l]===void 0){const u=ye.get(A.ID).parents.filter(function(B){return B.relationship!==void 0})[0].ID,g=ye.get(u).parents[0].ID,f=ye.get(g).parents[0].ID,I=ye.get(f).parents[0].ID,m=oe.Objects.Model[I],b={modelName:m.attrName?r.PropertyBinding.sanitizeNodeName(m.attrName):"",morphName:oe.Objects.Deformer[u].attrName};i[l]=b}i[l][h.attr]=h}}}),s.set(parseInt(n),i))}return s}parseAnimStacks(e){const t=oe.Objects.AnimationStack,s={};for(const n in t){const i=ye.get(parseInt(n)).children;i.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const o=e.get(i[0].ID);s[n]={name:t[n].attrName,layer:o}}return s}addClip(e){let t=[];const s=this;return e.layer.forEach(function(n){t=t.concat(s.generateTracks(n))}),new r.AnimationClip(e.name,-1,t)}generateTracks(e){const t=[];let s=new r.Vector3,n=new r.Vector3;if(e.transform&&e.transform.decompose(s,new r.Quaternion,n),s=s.toArray(),n=n.toArray(),e.T!==void 0&&Object.keys(e.T.curves).length>0){const i=this.generateVectorTrack(e.modelName,e.T.curves,s,"position");i!==void 0&&t.push(i)}if(e.R!==void 0&&Object.keys(e.R.curves).length>0){const i=this.generateRotationTrack(e.modelName,e.R.curves,e.preRotation,e.postRotation,e.eulerOrder);i!==void 0&&t.push(i)}if(e.S!==void 0&&Object.keys(e.S.curves).length>0){const i=this.generateVectorTrack(e.modelName,e.S.curves,n,"scale");i!==void 0&&t.push(i)}if(e.DeformPercent!==void 0){const i=this.generateMorphTrack(e);i!==void 0&&t.push(i)}return t}generateVectorTrack(e,t,s,n){const i=this.getTimesForAllAxes(t),o=this.getKeyframeTrackValues(i,t,s);return new r.VectorKeyframeTrack(e+"."+n,i,o)}generateRotationTrack(e,t,s,n,i){let o,a;if(t.x===void 0||t.y===void 0||t.z===void 0){console.warn("THREE.FBXLoader: Missing rotation curves "+(t.x===void 0?"x ":"")+(t.y===void 0?"y ":"")+(t.z===void 0?"z ":"")+" for animation of "+e+". This is currently not supported.");return}if(t.x!==void 0&&t.y!==void 0&&t.z!==void 0){const g=this.interpolateRotations(t.x,t.y,t.z,i);o=g[0],a=g[1]}const A=Kt(0);s!==void 0&&(s=s.map(r.MathUtils.degToRad),s.push(A),s=new r.Euler().fromArray(s),s=new r.Quaternion().setFromEuler(s)),n!==void 0&&(n=n.map(r.MathUtils.degToRad),n.push(A),n=new r.Euler().fromArray(n),n=new r.Quaternion().setFromEuler(n).invert());const l=new r.Quaternion,h=new r.Euler,u=[];if(!(!a||!o)){for(let g=0;g<a.length;g+=3)h.set(a[g],a[g+1],a[g+2],i),l.setFromEuler(h),s!==void 0&&l.premultiply(s),n!==void 0&&l.multiply(n),g>2&&new r.Quaternion().fromArray(u,(g-3)/3*4).dot(l)<0&&l.set(-l.x,-l.y,-l.z,-l.w),l.toArray(u,g/3*4);return new r.QuaternionKeyframeTrack(e+".quaternion",o,u)}}generateMorphTrack(e){const t=e.DeformPercent.curves.morph,s=t.values.map(function(i){return i/100}),n=Le.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new r.NumberKeyframeTrack(e.modelName+".morphTargetInfluences["+n+"]",t.times,s)}getTimesForAllAxes(e){let t=[];if(e.x!==void 0&&(t=t.concat(e.x.times)),e.y!==void 0&&(t=t.concat(e.y.times)),e.z!==void 0&&(t=t.concat(e.z.times)),t=t.sort(function(s,n){return s-n}),t.length>1){let s=1,n=t[0];for(let i=1;i<t.length;i++){const o=t[i];o!==n&&(t[s]=o,n=o,s++)}t=t.slice(0,s)}return t}getKeyframeTrackValues(e,t,s){const n=s,i=[];let o=-1,a=-1,A=-1;return e.forEach(function(l){if(t.x&&(o=t.x.times.indexOf(l)),t.y&&(a=t.y.times.indexOf(l)),t.z&&(A=t.z.times.indexOf(l)),o!==-1){const h=t.x.values[o];i.push(h),n[0]=h}else i.push(n[0]);if(a!==-1){const h=t.y.values[a];i.push(h),n[1]=h}else i.push(n[1]);if(A!==-1){const h=t.z.values[A];i.push(h),n[2]=h}else i.push(n[2])}),i}interpolateRotations(e,t,s,n){const i=[],o=[];i.push(e.times[0]),o.push(r.MathUtils.degToRad(e.values[0])),o.push(r.MathUtils.degToRad(t.values[0])),o.push(r.MathUtils.degToRad(s.values[0]));for(let a=1;a<e.values.length;a++){const A=[e.values[a-1],t.values[a-1],s.values[a-1]];if(isNaN(A[0])||isNaN(A[1])||isNaN(A[2]))continue;const l=A.map(r.MathUtils.degToRad),h=[e.values[a],t.values[a],s.values[a]];if(isNaN(h[0])||isNaN(h[1])||isNaN(h[2]))continue;const u=h.map(r.MathUtils.degToRad),g=[h[0]-A[0],h[1]-A[1],h[2]-A[2]],f=[Math.abs(g[0]),Math.abs(g[1]),Math.abs(g[2])];if(f[0]>=180||f[1]>=180||f[2]>=180){const m=Math.max(...f)/180,b=new r.Euler(...l,n),B=new r.Euler(...u,n),w=new r.Quaternion().setFromEuler(b),C=new r.Quaternion().setFromEuler(B);w.dot(C)&&C.set(-C.x,-C.y,-C.z,-C.w);const y=e.times[a-1],x=e.times[a]-y,R=new r.Quaternion,D=new r.Euler;for(let S=0;S<1;S+=1/m)R.copy(w.clone().slerp(C.clone(),S)),i.push(y+S*x),D.setFromQuaternion(R,n),o.push(D.x),o.push(D.y),o.push(D.z)}else i.push(e.times[a]),o.push(r.MathUtils.degToRad(e.values[a])),o.push(r.MathUtils.degToRad(t.values[a])),o.push(r.MathUtils.degToRad(s.values[a]))}return[i,o]}}class TA{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(e){this.nodeStack.push(e),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(e,t){this.currentProp=e,this.currentPropName=t}parse(e){this.currentIndent=0,this.allNodes=new ki,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const t=this,s=e.split(/[\r\n]+/);return s.forEach(function(n,i){const o=n.match(/^[\s\t]*;/),a=n.match(/^[\s\t]*$/);if(o||a)return;const A=n.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),l=n.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),h=n.match("^\\t{"+(t.currentIndent-1)+"}}");A?t.parseNodeBegin(n,A):l?t.parseNodeProperty(n,l,s[++i]):h?t.popStack():n.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(n)}),this.allNodes}parseNodeBegin(e,t){const s=t[1].trim().replace(/^"/,"").replace(/"$/,""),n=t[2].split(",").map(function(A){return A.trim().replace(/^"/,"").replace(/"$/,"")}),i={name:s},o=this.parseNodeAttr(n),a=this.getCurrentNode();this.currentIndent===0?this.allNodes.add(s,i):s in a?(s==="PoseNode"?a.PoseNode.push(i):a[s].id!==void 0&&(a[s]={},a[s][a[s].id]=a[s]),o.id!==""&&(a[s][o.id]=i)):typeof o.id=="number"?(a[s]={},a[s][o.id]=i):s!=="Properties70"&&(s==="PoseNode"?a[s]=[i]:a[s]=i),typeof o.id=="number"&&(i.id=o.id),o.name!==""&&(i.attrName=o.name),o.type!==""&&(i.attrType=o.type),this.pushStack(i)}parseNodeAttr(e){let t=e[0];e[0]!==""&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let s="",n="";return e.length>1&&(s=e[1].replace(/^(\w+)::/,""),n=e[2]),{id:t,name:s,type:n}}parseNodeProperty(e,t,s){let n=t[1].replace(/^"/,"").replace(/"$/,"").trim(),i=t[2].replace(/^"/,"").replace(/"$/,"").trim();n==="Content"&&i===","&&(i=s.replace(/"/g,"").replace(/,$/,"").trim());const o=this.getCurrentNode();if(o.name==="Properties70"){this.parseNodeSpecialProperty(e,n,i);return}if(n==="C"){const A=i.split(",").slice(1),l=parseInt(A[0]),h=parseInt(A[1]);let u=i.split(",").slice(3);u=u.map(function(g){return g.trim().replace(/^"/,"")}),n="connections",i=[l,h],FA(i,u),o[n]===void 0&&(o[n]=[])}n==="Node"&&(o.id=i),n in o&&Array.isArray(o[n])?o[n].push(i):n!=="a"?o[n]=i:o.a=i,this.setCurrentProp(o,n),n==="a"&&i.slice(-1)!==","&&(o.a=kn(i))}parseNodePropertyContinued(e){const t=this.getCurrentNode();t.a+=e,e.slice(-1)!==","&&(t.a=kn(t.a))}parseNodeSpecialProperty(e,t,s){const n=s.split('",').map(function(h){return h.trim().replace(/^\"/,"").replace(/\s/,"_")}),i=n[0],o=n[1],a=n[2],A=n[3];let l=n[4];switch(o){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":l=parseFloat(l);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":l=kn(l);break}this.getPrevNode()[i]={type:o,type2:a,flag:A,value:l},this.setCurrentProp(this.getPrevNode(),i)}}class vA{parse(e){const t=new Ys(e);t.skip(23);const s=t.getUint32();if(s<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+s);const n=new ki;for(;!this.endOfContent(t);){const i=this.parseNode(t,s);i!==null&&n.add(i.name,i)}return n}endOfContent(e){return e.size()%16===0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()}parseNode(e,t){const s={},n=t>=7500?e.getUint64():e.getUint32(),i=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();const o=e.getUint8(),a=e.getString(o);if(n===0)return null;const A=[];for(let g=0;g<i;g++)A.push(this.parseProperty(e));const l=A.length>0?A[0]:"",h=A.length>1?A[1]:"",u=A.length>2?A[2]:"";for(s.singleProperty=i===1&&e.getOffset()===n;n>e.getOffset();){const g=this.parseNode(e,t);g!==null&&this.parseSubNode(a,s,g)}return s.propertyList=A,typeof l=="number"&&(s.id=l),h!==""&&(s.attrName=h),u!==""&&(s.attrType=u),a!==""&&(s.name=a),s}parseSubNode(e,t,s){if(s.singleProperty===!0){const n=s.propertyList[0];Array.isArray(n)?(t[s.name]=s,s.a=n):t[s.name]=n}else if(e==="Connections"&&s.name==="C"){const n=[];s.propertyList.forEach(function(i,o){o!==0&&n.push(i)}),t.connections===void 0&&(t.connections=[]),t.connections.push(n)}else if(s.name==="Properties70")Object.keys(s).forEach(function(i){t[i]=s[i]});else if(e==="Properties70"&&s.name==="P"){let n=s.propertyList[0],i=s.propertyList[1];const o=s.propertyList[2],a=s.propertyList[3];let A;n.indexOf("Lcl ")===0&&(n=n.replace("Lcl ","Lcl_")),i.indexOf("Lcl ")===0&&(i=i.replace("Lcl ","Lcl_")),i==="Color"||i==="ColorRGB"||i==="Vector"||i==="Vector3D"||i.indexOf("Lcl_")===0?A=[s.propertyList[4],s.propertyList[5],s.propertyList[6]]:A=s.propertyList[4],t[n]={type:i,type2:o,flag:a,value:A}}else t[s.name]===void 0?typeof s.id=="number"?(t[s.name]={},t[s.name][s.id]=s):t[s.name]=s:s.name==="PoseNode"?(Array.isArray(t[s.name])||(t[s.name]=[t[s.name]]),t[s.name].push(s)):t[s.name][s.id]===void 0&&(t[s.name][s.id]=s)}parseProperty(e){const t=e.getString(1);let s;switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":return s=e.getUint32(),e.getArrayBuffer(s);case"S":return s=e.getUint32(),e.getString(s);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const n=e.getUint32(),i=e.getUint32(),o=e.getUint32();if(i===0)switch(t){case"b":case"c":return e.getBooleanArray(n);case"d":return e.getFloat64Array(n);case"f":return e.getFloat32Array(n);case"i":return e.getInt32Array(n);case"l":return e.getInt64Array(n)}const a=Ot(new Uint8Array(e.getArrayBuffer(o))),A=new Ys(a.buffer);switch(t){case"b":case"c":return A.getBooleanArray(n);case"d":return A.getFloat64Array(n);case"f":return A.getFloat32Array(n);case"i":return A.getInt32Array(n);case"l":return A.getInt64Array(n)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}class Ys{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=t!==void 0?t:!0,this._textDecoder=new TextDecoder}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e}getBoolean(){return(this.getUint8()&1)===1}getBooleanArray(e){const t=[];for(let s=0;s<e;s++)t.push(this.getBoolean());return t}getUint8(){const e=this.dv.getUint8(this.offset);return this.offset+=1,e}getInt16(){const e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}getInt32(){const e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}getInt32Array(e){const t=[];for(let s=0;s<e;s++)t.push(this.getInt32());return t}getUint32(){const e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}getInt64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),t&2147483648?(t=~t&4294967295,e=~e&4294967295,e===4294967295&&(t=t+1&4294967295),e=e+1&4294967295,-(t*4294967296+e)):t*4294967296+e}getInt64Array(e){const t=[];for(let s=0;s<e;s++)t.push(this.getInt64());return t}getUint64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),t*4294967296+e}getFloat32(){const e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}getFloat32Array(e){const t=[];for(let s=0;s<e;s++)t.push(this.getFloat32());return t}getFloat64(){const e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){const t=[];for(let s=0;s<e;s++)t.push(this.getFloat64());return t}getArrayBuffer(e){const t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}getString(e){const t=this.offset;let s=new Uint8Array(this.dv.buffer,t,e);this.skip(e);const n=s.indexOf(0);return n>=0&&(s=new Uint8Array(this.dv.buffer,t,n)),this._textDecoder.decode(s)}}class ki{add(e,t){this[e]=t}}function MA(c){const e="Kaydara FBX Binary \0";return c.byteLength>=e.length&&e===Ui(c,0,e.length)}function RA(c){const e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let t=0;function s(n){const i=c[n-1];return c=c.slice(t+n),t++,i}for(let n=0;n<e.length;++n)if(s(1)===e[n])return!1;return!0}function Ks(c){const e=/FBXVersion: (\d+)/,t=c.match(e);if(t)return parseInt(t[1]);throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function DA(c){return c/46186158e3}const _A=[];function on(c,e,t,s){let n;switch(s.mappingType){case"ByPolygonVertex":n=c;break;case"ByPolygon":n=e;break;case"ByVertice":n=t;break;case"AllSame":n=s.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+s.mappingType)}s.referenceType==="IndexToDirect"&&(n=s.indices[n]);const i=n*s.dataSize,o=i+s.dataSize;return LA(_A,s.buffer,i,o)}const Ln=new r.Euler,St=new r.Vector3;function Gi(c){const e=new r.Matrix4,t=new r.Matrix4,s=new r.Matrix4,n=new r.Matrix4,i=new r.Matrix4,o=new r.Matrix4,a=new r.Matrix4,A=new r.Matrix4,l=new r.Matrix4,h=new r.Matrix4,u=new r.Matrix4,g=new r.Matrix4,f=c.inheritType?c.inheritType:0;c.translation&&e.setPosition(St.fromArray(c.translation));const I=Kt(0);if(c.preRotation){const G=c.preRotation.map(r.MathUtils.degToRad);G.push(I),t.makeRotationFromEuler(Ln.fromArray(G))}if(c.rotation){const G=c.rotation.map(r.MathUtils.degToRad);G.push(c.eulerOrder||I),s.makeRotationFromEuler(Ln.fromArray(G))}if(c.postRotation){const G=c.postRotation.map(r.MathUtils.degToRad);G.push(I),n.makeRotationFromEuler(Ln.fromArray(G)),n.invert()}c.scale&&i.scale(St.fromArray(c.scale)),c.scalingOffset&&a.setPosition(St.fromArray(c.scalingOffset)),c.scalingPivot&&o.setPosition(St.fromArray(c.scalingPivot)),c.rotationOffset&&A.setPosition(St.fromArray(c.rotationOffset)),c.rotationPivot&&l.setPosition(St.fromArray(c.rotationPivot)),c.parentMatrixWorld&&(u.copy(c.parentMatrix),h.copy(c.parentMatrixWorld));const m=t.clone().multiply(s).multiply(n),b=new r.Matrix4;b.extractRotation(h);const B=new r.Matrix4;B.copyPosition(h);const w=B.clone().invert().multiply(h),C=b.clone().invert().multiply(w),y=i,x=new r.Matrix4;if(f===0)x.copy(b).multiply(m).multiply(C).multiply(y);else if(f===1)x.copy(b).multiply(C).multiply(m).multiply(y);else{const H=new r.Matrix4().scale(new r.Vector3().setFromMatrixScale(u)).clone().invert(),X=C.clone().multiply(H);x.copy(b).multiply(m).multiply(X).multiply(y)}const R=l.clone().invert(),D=o.clone().invert();let S=e.clone().multiply(A).multiply(l).multiply(t).multiply(s).multiply(n).multiply(R).multiply(a).multiply(o).multiply(i).multiply(D);const v=new r.Matrix4().copyPosition(S),N=h.clone().multiply(v);return g.copyPosition(N),S=g.clone().multiply(x),S.premultiply(h.invert()),S}function Kt(c){c=c||0;const e=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return c===6?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),e[0]):e[c]}function kn(c){return c.split(",").map(function(t){return parseFloat(t)})}function Ui(c,e,t){return e===void 0&&(e=0),t===void 0&&(t=c.byteLength),new TextDecoder().decode(new Uint8Array(c,e,t))}function FA(c,e){for(let t=0,s=c.length,n=e.length;t<n;t++,s++)c[s]=e[t]}function LA(c,e,t,s){for(let n=t,i=0;n<s;n++,i++)c[i]=e[n];return c}class kA extends r.Loader{constructor(e){super(e)}load(e,t,s,n){const i=this,o=this.path===""?r.LoaderUtils.extractUrlBase(e):this.path,a=new r.FileLoader(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(A){try{t(i.parse(A,o))}catch(l){n?n(l):console.error(l),i.manager.itemError(e)}},s,n)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){const s=e.split(`
|
|
460
|
-
`);let n={};const
|
|
441
|
+
`};class Wn extends a.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:a.UniformsUtils.clone(a.ShaderLib.line.uniforms),vertexShader:a.ShaderLib.line.vertexShader,fragmentShader:a.ShaderLib.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0!==this.worldUnits&&(this.needsUpdate=!0),e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const vn=new a.Vector4,Pi=new a.Vector3,Ni=new a.Vector3,Re=new a.Vector4,Me=new a.Vector4,et=new a.Vector4,Dn=new a.Vector3,Rn=new a.Matrix4,_e=new a.Line3,Oi=new a.Vector3,tn=new a.Box3,nn=new a.Sphere,tt=new a.Vector4;let it,yt;function Hi(c,e,t){return tt.set(0,0,-e,1).applyMatrix4(c.projectionMatrix),tt.multiplyScalar(1/tt.w),tt.x=yt/t.width,tt.y=yt/t.height,tt.applyMatrix4(c.projectionMatrixInverse),tt.multiplyScalar(1/tt.w),Math.abs(Math.max(tt.x,tt.y))}function bA(c,e){const t=c.matrixWorld,i=c.geometry,n=i.attributes.instanceStart,s=i.attributes.instanceEnd,o=Math.min(i.instanceCount,n.count);for(let r=0,A=o;r<A;r++){_e.start.fromBufferAttribute(n,r),_e.end.fromBufferAttribute(s,r),_e.applyMatrix4(t);const l=new a.Vector3,h=new a.Vector3;it.distanceSqToSegment(_e.start,_e.end,h,l),h.distanceTo(l)<yt*.5&&e.push({point:h,pointOnLine:l,distance:it.origin.distanceTo(h),object:c,face:null,faceIndex:r,uv:null,uv1:null})}}function mA(c,e,t){const i=e.projectionMatrix,s=c.material.resolution,o=c.matrixWorld,r=c.geometry,A=r.attributes.instanceStart,l=r.attributes.instanceEnd,h=Math.min(r.instanceCount,A.count),p=-e.near;it.at(1,et),et.w=1,et.applyMatrix4(e.matrixWorldInverse),et.applyMatrix4(i),et.multiplyScalar(1/et.w),et.x*=s.x/2,et.y*=s.y/2,et.z=0,Dn.copy(et),Rn.multiplyMatrices(e.matrixWorldInverse,o);for(let u=0,f=h;u<f;u++){if(Re.fromBufferAttribute(A,u),Me.fromBufferAttribute(l,u),Re.w=1,Me.w=1,Re.applyMatrix4(Rn),Me.applyMatrix4(Rn),Re.z>p&&Me.z>p)continue;if(Re.z>p){const C=Re.z-Me.z,y=(Re.z-p)/C;Re.lerp(Me,y)}else if(Me.z>p){const C=Me.z-Re.z,y=(Me.z-p)/C;Me.lerp(Re,y)}Re.applyMatrix4(i),Me.applyMatrix4(i),Re.multiplyScalar(1/Re.w),Me.multiplyScalar(1/Me.w),Re.x*=s.x/2,Re.y*=s.y/2,Me.x*=s.x/2,Me.y*=s.y/2,_e.start.copy(Re),_e.start.z=0,_e.end.copy(Me),_e.end.z=0;const m=_e.closestPointToPointParameter(Dn,!0);_e.at(m,Oi);const E=a.MathUtils.lerp(Re.z,Me.z,m),B=E>=-1&&E<=1,w=Dn.distanceTo(Oi)<yt*.5;if(B&&w){_e.start.fromBufferAttribute(A,u),_e.end.fromBufferAttribute(l,u),_e.start.applyMatrix4(o),_e.end.applyMatrix4(o);const C=new a.Vector3,y=new a.Vector3;it.distanceSqToSegment(_e.start,_e.end,y,C),t.push({point:y,pointOnLine:C,distance:it.origin.distanceTo(y),object:c,face:null,faceIndex:u,uv:null,uv1:null})}}}class EA extends a.Mesh{constructor(e=new io,t=new Wn({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,i=e.attributes.instanceEnd,n=new Float32Array(2*t.count);for(let o=0,r=0,A=t.count;o<A;o++,r+=2)Pi.fromBufferAttribute(t,o),Ni.fromBufferAttribute(i,o),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+Pi.distanceTo(Ni);const s=new a.InstancedInterleavedBuffer(n,2,1);return e.setAttribute("instanceDistanceStart",new a.InterleavedBufferAttribute(s,1,0)),e.setAttribute("instanceDistanceEnd",new a.InterleavedBufferAttribute(s,1,1)),this}raycast(e,t){const i=this.material.worldUnits,n=e.camera;n===null&&!i&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const s=e.params.Line2!==void 0&&e.params.Line2.threshold||0;it=e.ray;const o=this.matrixWorld,r=this.geometry,A=this.material;yt=A.linewidth+s,r.boundingSphere===null&&r.computeBoundingSphere(),nn.copy(r.boundingSphere).applyMatrix4(o);let l;if(i)l=yt*.5;else{const p=Math.max(n.near,nn.distanceToPoint(it.origin));l=Hi(n,p,A.resolution)}if(nn.radius+=l,it.intersectsSphere(nn)===!1)return;r.boundingBox===null&&r.computeBoundingBox(),tn.copy(r.boundingBox).applyMatrix4(o);let h;if(i)h=yt*.5;else{const p=Math.max(n.near,tn.distanceToPoint(it.origin));h=Hi(n,p,A.resolution)}tn.expandByScalar(h),it.intersectsBox(tn)!==!1&&(i?bA(this,t):mA(this,n,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(vn),this.material.uniforms.resolution.value.set(vn.z,vn.w))}}class so extends io{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,i=new Float32Array(2*t);for(let n=0;n<t;n+=3)i[2*n]=e[n],i[2*n+1]=e[n+1],i[2*n+2]=e[n+2],i[2*n+3]=e[n+3],i[2*n+4]=e[n+4],i[2*n+5]=e[n+5];return super.setPositions(i),this}setColors(e){const t=e.length-3,i=new Float32Array(2*t);for(let n=0;n<t;n+=3)i[2*n]=e[n],i[2*n+1]=e[n+1],i[2*n+2]=e[n+2],i[2*n+3]=e[n+3],i[2*n+4]=e[n+4],i[2*n+5]=e[n+5];return super.setColors(i),this}setFromPoints(e){const t=e.length-1,i=new Float32Array(6*t);for(let n=0;n<t;n++)i[6*n]=e[n].x,i[6*n+1]=e[n].y,i[6*n+2]=e[n].z||0,i[6*n+3]=e[n+1].x,i[6*n+4]=e[n+1].y,i[6*n+5]=e[n+1].z||0;return super.setPositions(i),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class IA extends EA{constructor(e=new so,t=new Wn({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}class CA extends a.Mesh{constructor(e){const t=new BA(e),i=new a.PlaneGeometry(t.image.width*.001,t.image.height*.001),n=new a.MeshBasicMaterial({map:t,toneMapped:!1,transparent:!0});super(i,n);function s(o){n.map.dispatchDOMEvent(o)}this.addEventListener("mousedown",s),this.addEventListener("mousemove",s),this.addEventListener("mouseup",s),this.addEventListener("click",s),this.dispose=function(){i.dispose(),n.dispose(),n.map.dispose(),qn.delete(e),this.removeEventListener("mousedown",s),this.removeEventListener("mousemove",s),this.removeEventListener("mouseup",s),this.removeEventListener("click",s)}}}class BA extends a.CanvasTexture{constructor(e){super(ji(e)),this.dom=e,this.anisotropy=16,this.colorSpace=a.SRGBColorSpace,this.minFilter=a.LinearFilter,this.magFilter=a.LinearFilter,this.generateMipmaps=!1;const t=new MutationObserver(()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout(()=>this.update(),16))}),i={attributes:!0,childList:!0,subtree:!0,characterData:!0};t.observe(e,i),this.observer=t}dispatchDOMEvent(e){e.data&&yA(this.dom,e.type,e.data.x,e.data.y)}update(){this.image=ji(this.dom),this.needsUpdate=!0,this.scheduleUpdate=null}dispose(){this.observer&&this.observer.disconnect(),this.scheduleUpdate=clearTimeout(this.scheduleUpdate),super.dispose()}}const qn=new WeakMap;function ji(c){const e=document.createRange(),t=new a.Color;function i(u){const f=[];let b=!1;function m(){if(b&&(b=!1,u.restore()),f.length===0)return;let E=-1/0,B=-1/0,w=1/0,C=1/0;for(let y=0;y<f.length;y++){const Q=f[y];E=Math.max(E,Q.x),B=Math.max(B,Q.y),w=Math.min(w,Q.x+Q.width),C=Math.min(C,Q.y+Q.height)}u.save(),u.beginPath(),u.rect(E,B,w-E,C-B),u.clip(),b=!0}return{add:function(E){f.push(E),m()},remove:function(){f.pop(),m()}}}function n(u,f,b,m){m!==""&&(u.textTransform==="uppercase"&&(m=m.toUpperCase()),h.font=u.fontWeight+" "+u.fontSize+" "+u.fontFamily,h.textBaseline="top",h.fillStyle=u.color,h.fillText(m,f,b+parseFloat(u.fontSize)*.1))}function s(u,f,b,m,E){b<2*E&&(E=b/2),m<2*E&&(E=m/2),h.beginPath(),h.moveTo(u+E,f),h.arcTo(u+b,f,u+b,f+m,E),h.arcTo(u+b,f+m,u,f+m,E),h.arcTo(u,f+m,u,f,E),h.arcTo(u,f,u+b,f,E),h.closePath()}function o(u,f,b,m,E,B){const w=u[f+"Width"],C=u[f+"Style"],y=u[f+"Color"];w!=="0px"&&C!=="none"&&y!=="transparent"&&y!=="rgba(0, 0, 0, 0)"&&(h.strokeStyle=y,h.lineWidth=parseFloat(w),h.beginPath(),h.moveTo(b,m),h.lineTo(b+E,m+B),h.stroke())}function r(u,f){if(u.nodeType===Node.COMMENT_NODE||u.nodeName==="SCRIPT"||u.style&&u.style.display==="none")return;let b=0,m=0,E=0,B=0;if(u.nodeType===Node.TEXT_NODE){e.selectNode(u);const C=e.getBoundingClientRect();b=C.left-A.left-.5,m=C.top-A.top-.5,E=C.width,B=C.height,n(f,b,m,u.nodeValue.trim())}else if(u instanceof HTMLCanvasElement){const C=u.getBoundingClientRect();b=C.left-A.left-.5,m=C.top-A.top-.5;const y=C.width,Q=C.height;h.drawImage(u,b,m,y,Q)}else if(u instanceof HTMLImageElement){const C=u.getBoundingClientRect();b=C.left-A.left-.5,m=C.top-A.top-.5,E=C.width,B=C.height,h.drawImage(u,b,m,E,B)}else{const C=u.getBoundingClientRect();b=C.left-A.left-.5,m=C.top-A.top-.5,E=C.width,B=C.height,f=window.getComputedStyle(u),s(b,m,E,B,parseFloat(f.borderRadius));const y=f.backgroundColor;y!=="transparent"&&y!=="rgba(0, 0, 0, 0)"&&(h.fillStyle=y,h.fill());const Q=["borderTop","borderLeft","borderBottom","borderRight"];let R=!0,M=null;for(const T of Q){if(M!==null&&(R=f[T+"Width"]===f[M+"Width"]&&f[T+"Color"]===f[M+"Color"]&&f[T+"Style"]===f[M+"Style"]),R===!1)break;M=T}if(R===!0){const T=parseFloat(f.borderTopWidth);f.borderTopWidth!=="0px"&&f.borderTopStyle!=="none"&&f.borderTopColor!=="transparent"&&f.borderTopColor!=="rgba(0, 0, 0, 0)"&&(h.strokeStyle=f.borderTopColor,h.lineWidth=T,h.stroke())}else o(f,"borderTop",b,m,E,0),o(f,"borderLeft",b,m,0,B),o(f,"borderBottom",b,m+B,E,0),o(f,"borderRight",b+E,m,0,B);if(u instanceof HTMLInputElement){let T=f.accentColor;(T===void 0||T==="auto")&&(T=f.color),t.set(T);const G=Math.sqrt(.299*t.r**2+.587*t.g**2+.114*t.b**2)<.5?"white":"#111111";if(u.type==="radio"&&(s(b,m,E,B,B),h.fillStyle="white",h.strokeStyle=T,h.lineWidth=1,h.fill(),h.stroke(),u.checked&&(s(b+2,m+2,E-4,B-4,B),h.fillStyle=T,h.strokeStyle=G,h.lineWidth=2,h.fill(),h.stroke())),u.type==="checkbox"&&(s(b,m,E,B,2),h.fillStyle=u.checked?T:"white",h.strokeStyle=u.checked?G:T,h.lineWidth=1,h.stroke(),h.fill(),u.checked)){const U=h.textAlign;h.textAlign="center";const j={color:G,fontFamily:f.fontFamily,fontSize:B+"px",fontWeight:"bold"};n(j,b+E/2,m,"✔"),h.textAlign=U}if(u.type==="range"){const[U,j,X]=["min","max","value"].map(V=>parseFloat(u[V])),N=(X-U)/(j-U)*(E-B);s(b,m+B/4,E,B/2,B/4),h.fillStyle=G,h.strokeStyle=T,h.lineWidth=1,h.fill(),h.stroke(),s(b,m+B/4,N+B/2,B/2,B/4),h.fillStyle=T,h.fill(),s(b+N,m,B,B,B/2),h.fillStyle=T,h.fill()}if(u.type==="color"||u.type==="text"||u.type==="number"||u.type==="email"||u.type==="password"){p.add({x:b,y:m,width:E,height:B});const U=u.type==="password"?"*".repeat(u.value.length):u.value;n(f,b+parseInt(f.paddingLeft),m+parseInt(f.paddingTop),U),p.remove()}}}const w=f.overflow==="auto"||f.overflow==="hidden";w&&p.add({x:b,y:m,width:E,height:B});for(let C=0;C<u.childNodes.length;C++)r(u.childNodes[C],f);w&&p.remove()}const A=c.getBoundingClientRect();let l=qn.get(c);l===void 0&&(l=document.createElement("canvas"),qn.set(c,l)),l.width=A.width,l.height=A.height;const h=l.getContext("2d"),p=new i(h);return h.clearRect(0,0,l.width,l.height),r(c),l}function yA(c,e,t,i){const n={clientX:t*c.offsetWidth+c.offsetLeft,clientY:i*c.offsetHeight+c.offsetTop,view:c.ownerDocument.defaultView};window.dispatchEvent(new MouseEvent(e,n));const s=c.getBoundingClientRect();t=t*s.width+s.left,i=i*s.height+s.top;function o(r){if(r.nodeType!==Node.TEXT_NODE&&r.nodeType!==Node.COMMENT_NODE){const A=r.getBoundingClientRect();if(t>A.left&&t<A.right&&i>A.top&&i<A.bottom){if(r.dispatchEvent(new MouseEvent(e,n)),r instanceof HTMLInputElement&&r.type==="range"&&(e==="mousedown"||e==="click")){const[l,h]=["min","max"].map(b=>parseFloat(r[b])),p=A.width,f=(t-A.x)/p;r.value=l+(h-l)*f,r.dispatchEvent(new InputEvent("input",{bubbles:!0}))}r instanceof HTMLInputElement&&(r.type==="text"||r.type==="number"||r.type==="email"||r.type==="password")&&(e==="mousedown"||e==="click")&&r.focus()}for(let l=0;l<r.childNodes.length;l++)o(r.childNodes[l])}}o(c)}const rn=new a.Vector2,Tt={type:"",data:rn},wA={move:"mousemove",select:"click",selectstart:"mousedown",selectend:"mouseup"},qi=new a.Raycaster;class QA extends a.Group{constructor(){super(),this.raycaster=new a.Raycaster,this.element=null,this.camera=null,this.controllers=[],this._onPointerEvent=this.onPointerEvent.bind(this),this._onXRControllerEvent=this.onXRControllerEvent.bind(this)}onPointerEvent(e){e.stopPropagation();const t=this.element.getBoundingClientRect();rn.x=(e.clientX-t.left)/t.width*2-1,rn.y=-(e.clientY-t.top)/t.height*2+1,this.raycaster.setFromCamera(rn,this.camera);const i=this.raycaster.intersectObjects(this.children,!1);if(i.length>0){const n=i[0],s=n.object,o=n.uv;Tt.type=e.type,Tt.data.set(o.x,1-o.y),s.dispatchEvent(Tt)}}onXRControllerEvent(e){const t=e.target;qi.setFromXRController(t);const i=qi.intersectObjects(this.children,!1);if(i.length>0){const n=i[0],s=n.object,o=n.uv;Tt.type=wA[e.type],Tt.data.set(o.x,1-o.y),s.dispatchEvent(Tt)}}listenToPointerEvents(e,t){this.camera=t,this.element=e.domElement,this.element.addEventListener("pointerdown",this._onPointerEvent),this.element.addEventListener("pointerup",this._onPointerEvent),this.element.addEventListener("pointermove",this._onPointerEvent),this.element.addEventListener("mousedown",this._onPointerEvent),this.element.addEventListener("mouseup",this._onPointerEvent),this.element.addEventListener("mousemove",this._onPointerEvent),this.element.addEventListener("click",this._onPointerEvent)}disconnectionPointerEvents(){this.element!==null&&(this.element.removeEventListener("pointerdown",this._onPointerEvent),this.element.removeEventListener("pointerup",this._onPointerEvent),this.element.removeEventListener("pointermove",this._onPointerEvent),this.element.removeEventListener("mousedown",this._onPointerEvent),this.element.removeEventListener("mouseup",this._onPointerEvent),this.element.removeEventListener("mousemove",this._onPointerEvent),this.element.removeEventListener("click",this._onPointerEvent))}listenToXRControllerEvents(e){this.controllers.push(e),e.addEventListener("move",this._onXRControllerEvent),e.addEventListener("select",this._onXRControllerEvent),e.addEventListener("selectstart",this._onXRControllerEvent),e.addEventListener("selectend",this._onXRControllerEvent)}disconnectXrControllerEvents(){for(const e of this.controllers)e.removeEventListener("move",this._onXRControllerEvent),e.removeEventListener("select",this._onXRControllerEvent),e.removeEventListener("selectstart",this._onXRControllerEvent),e.removeEventListener("selectend",this._onXRControllerEvent)}disconnect(){this.disconnectionPointerEvents(),this.disconnectXrControllerEvents(),this.camera=null,this.element=null,this.controllers=[]}}const Pt=new a.Vector3,Nt=new a.Vector3,Ki=new a.Matrix3;class xA extends a.LineSegments{constructor(e,t=1,i=16711680){const n=new a.BufferGeometry,s=e.geometry.attributes.normal.count,o=new a.Float32BufferAttribute(s*2*3,3);n.setAttribute("position",o),super(n,new a.LineBasicMaterial({color:i,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.isVertexNormalsHelper=!0,this.update()}update(){this.object.updateMatrixWorld(!0),Ki.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,i=this.object.geometry;if(i){const n=i.attributes.position,s=i.attributes.normal;let o=0;for(let r=0,A=n.count;r<A;r++)Pt.fromBufferAttribute(n,r).applyMatrix4(e),Nt.fromBufferAttribute(s,r),Nt.applyMatrix3(Ki).normalize().multiplyScalar(this.size).add(Pt),t.setXYZ(o,Pt.x,Pt.y,Pt.z),o=o+1,t.setXYZ(o,Nt.x,Nt.y,Nt.z),o=o+1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function oo(c,e,t){const i=t.length-c-1;if(e>=t[i])return i-1;if(e<=t[c])return c;let n=c,s=i,o=Math.floor((n+s)/2);for(;e<t[o]||e>=t[o+1];)e<t[o]?s=o:n=o,o=Math.floor((n+s)/2);return o}function SA(c,e,t,i){const n=[],s=[],o=[];n[0]=1;for(let r=1;r<=t;++r){s[r]=e-i[c+1-r],o[r]=i[c+r]-e;let A=0;for(let l=0;l<r;++l){const h=o[l+1],p=s[r-l],u=n[l]/(h+p);n[l]=A+h*u,A=p*u}n[r]=A}return n}function TA(c,e,t,i){const n=oo(c,i,e),s=SA(n,i,c,e),o=new a.Vector4(0,0,0,0);for(let r=0;r<=c;++r){const A=t[n-c+r],l=s[r],h=A.w*l;o.x+=A.x*h,o.y+=A.y*h,o.z+=A.z*h,o.w+=A.w*l}return o}function vA(c,e,t,i,n){const s=[];for(let p=0;p<=t;++p)s[p]=0;const o=[];for(let p=0;p<=i;++p)o[p]=s.slice(0);const r=[];for(let p=0;p<=t;++p)r[p]=s.slice(0);r[0][0]=1;const A=s.slice(0),l=s.slice(0);for(let p=1;p<=t;++p){A[p]=e-n[c+1-p],l[p]=n[c+p]-e;let u=0;for(let f=0;f<p;++f){const b=l[f+1],m=A[p-f];r[p][f]=b+m;const E=r[f][p-1]/r[p][f];r[f][p]=u+b*E,u=m*E}r[p][p]=u}for(let p=0;p<=t;++p)o[0][p]=r[p][t];for(let p=0;p<=t;++p){let u=0,f=1;const b=[];for(let m=0;m<=t;++m)b[m]=s.slice(0);b[0][0]=1;for(let m=1;m<=i;++m){let E=0;const B=p-m,w=t-m;p>=m&&(b[f][0]=b[u][0]/r[w+1][B],E=b[f][0]*r[B][w]);const C=B>=-1?1:-B,y=p-1<=w?m-1:t-p;for(let R=C;R<=y;++R)b[f][R]=(b[u][R]-b[u][R-1])/r[w+1][B+R],E+=b[f][R]*r[B+R][w];p<=w&&(b[f][m]=-b[u][m-1]/r[w+1][p],E+=b[f][m]*r[p][w]),o[m][p]=E;const Q=u;u=f,f=Q}}let h=t;for(let p=1;p<=i;++p){for(let u=0;u<=t;++u)o[p][u]*=h;h*=t-p}return o}function DA(c,e,t,i,n){const s=n<c?n:c,o=[],r=oo(c,i,e),A=vA(r,i,c,s,e),l=[];for(let h=0;h<t.length;++h){const p=t[h].clone(),u=p.w;p.x*=u,p.y*=u,p.z*=u,l[h]=p}for(let h=0;h<=s;++h){const p=l[r-c].clone().multiplyScalar(A[h][0]);for(let u=1;u<=c;++u)p.add(l[r-c+u].clone().multiplyScalar(A[h][u]));o[h]=p}for(let h=s+1;h<=n+1;++h)o[h]=new a.Vector4(0,0,0);return o}function RA(c,e){let t=1;for(let n=2;n<=c;++n)t*=n;let i=1;for(let n=2;n<=e;++n)i*=n;for(let n=2;n<=c-e;++n)i*=n;return t/i}function MA(c){const e=c.length,t=[],i=[];for(let s=0;s<e;++s){const o=c[s];t[s]=new a.Vector3(o.x,o.y,o.z),i[s]=o.w}const n=[];for(let s=0;s<e;++s){const o=t[s].clone();for(let r=1;r<=s;++r)o.sub(n[s-r].clone().multiplyScalar(RA(s,r)*i[r]));n[s]=o.divideScalar(i[0])}return n}function FA(c,e,t,i,n){const s=DA(c,e,t,i,n);return MA(s)}class _A extends a.Curve{constructor(e,t,i,n,s){super();const o=t?t.length-1:0,r=i?i.length:0;this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=n||0,this.endKnot=s||o;for(let A=0;A<r;++A){const l=i[A];this.controlPoints[A]=new a.Vector4(l.x,l.y,l.z,l.w)}}getPoint(e,t=new a.Vector3){const i=t,n=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),s=TA(this.degree,this.knots,this.controlPoints,n);return s.w!==1&&s.divideScalar(s.w),i.set(s.x,s.y,s.z)}getTangent(e,t=new a.Vector3){const i=t,n=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),s=FA(this.degree,this.knots,this.controlPoints,n,1);return i.copy(s[1]).normalize(),i}toJSON(){const e=super.toJSON();return e.degree=this.degree,e.knots=[...this.knots],e.controlPoints=this.controlPoints.map(t=>t.toArray()),e.startKnot=this.startKnot,e.endKnot=this.endKnot,e}fromJSON(e){return super.fromJSON(e),this.degree=e.degree,this.knots=[...e.knots],this.controlPoints=e.controlPoints.map(t=>new a.Vector4(t[0],t[1],t[2],t[3])),this.startKnot=e.startKnot,this.endKnot=e.endKnot,this}}let ae,Qe,Ue;class kA extends a.Loader{constructor(e){super(e)}load(e,t,i,n){const s=this,o=s.path===""?a.LoaderUtils.extractUrlBase(e):s.path,r=new a.FileLoader(this.manager);r.setPath(s.path),r.setResponseType("arraybuffer"),r.setRequestHeader(s.requestHeader),r.setWithCredentials(s.withCredentials),r.load(e,function(A){try{t(s.parse(A,o))}catch(l){n?n(l):console.error(l),s.manager.itemError(e)}},i,n)}parse(e,t){if(OA(e))ae=new NA().parse(e);else{const n=Ao(e);if(!HA(n))throw new Error("THREE.FBXLoader: Unknown format.");if(Vi(n)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+Vi(n));ae=new PA().parse(n)}const i=new a.TextureLoader(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new LA(i,this.manager).parse(ae)}getFbxTree(){return ae}}class LA{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){Qe=this.parseConnections();const e=this.parseImages(),t=this.parseTextures(e),i=this.parseMaterials(t),n=this.parseDeformers(),s=new GA().parse(n);return this.parseScene(n,s,i),Ue}parseConnections(){const e=new Map;return"Connections"in ae&&ae.Connections.connections.forEach(function(i){const n=i[0],s=i[1],o=i[2];e.has(n)||e.set(n,{parents:[],children:[]});const r={ID:s,relationship:o};e.get(n).parents.push(r),e.has(s)||e.set(s,{parents:[],children:[]});const A={ID:n,relationship:o};e.get(s).children.push(A)}),e}parseImages(){const e={},t={};if("Video"in ae.Objects){const i=ae.Objects.Video;for(const n in i){const s=i[n],o=parseInt(n);if(e[o]=s.RelativeFilename||s.Filename,"Content"in s){const r=s.Content instanceof ArrayBuffer&&s.Content.byteLength>0,A=typeof s.Content=="string"&&s.Content!=="";if(r||A){const l=this.parseImage(i[n]);t[s.RelativeFilename||s.Filename]=l}}}}for(const i in e){const n=e[i];t[n]!==void 0?e[i]=t[n]:e[i]=e[i].split("\\").pop()}return e}parseImage(e){const t=e.Content,i=e.RelativeFilename||e.Filename,n=i.slice(i.lastIndexOf(".")+1).toLowerCase();let s;switch(n){case"bmp":s="image/bmp";break;case"jpg":case"jpeg":s="image/jpeg";break;case"png":s="image/png";break;case"tif":s="image/tiff";break;case"tga":this.manager.getHandler(".tga")===null&&console.warn("FBXLoader: TGA loader not found, skipping ",i),s="image/tga";break;case"webp":s="image/webp";break;default:console.warn('FBXLoader: Image type "'+n+'" is not supported.');return}if(typeof t=="string")return"data:"+s+";base64,"+t;{const o=new Uint8Array(t);return window.URL.createObjectURL(new Blob([o],{type:s}))}}parseTextures(e){const t=new Map;if("Texture"in ae.Objects){const i=ae.Objects.Texture;for(const n in i){const s=this.parseTexture(i[n],e);t.set(parseInt(n),s)}}return t}parseTexture(e,t){const i=this.loadTexture(e,t);i.ID=e.id,i.name=e.attrName;const n=e.WrapModeU,s=e.WrapModeV,o=n!==void 0?n.value:0,r=s!==void 0?s.value:0;if(i.wrapS=o===0?a.RepeatWrapping:a.ClampToEdgeWrapping,i.wrapT=r===0?a.RepeatWrapping:a.ClampToEdgeWrapping,"Scaling"in e){const A=e.Scaling.value;i.repeat.x=A[0],i.repeat.y=A[1]}if("Translation"in e){const A=e.Translation.value;i.offset.x=A[0],i.offset.y=A[1]}return i}loadTexture(e,t){const i=e.FileName.split(".").pop().toLowerCase();let n=this.manager.getHandler(`.${i}`);n===null&&(n=this.textureLoader);const s=n.path;s||n.setPath(this.textureLoader.path);const o=Qe.get(e.id).children;let r;if(o!==void 0&&o.length>0&&t[o[0].ID]!==void 0&&(r=t[o[0].ID],(r.indexOf("blob:")===0||r.indexOf("data:")===0)&&n.setPath(void 0)),r===void 0)return console.warn("FBXLoader: Undefined filename, creating placeholder texture."),new a.Texture;const A=n.load(r);return n.setPath(s),A}parseMaterials(e){const t=new Map;if("Material"in ae.Objects){const i=ae.Objects.Material;for(const n in i){const s=this.parseMaterial(i[n],e);s!==null&&t.set(parseInt(n),s)}}return t}parseMaterial(e,t){const i=e.id,n=e.attrName;let s=e.ShadingModel;if(typeof s=="object"&&(s=s.value),!Qe.has(i))return null;const o=this.parseParameters(e,t,i);let r;switch(s.toLowerCase()){case"phong":r=new a.MeshPhongMaterial;break;case"lambert":r=new a.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',s),r=new a.MeshPhongMaterial;break}return r.setValues(o),r.name=n,r}parseParameters(e,t,i){const n={};e.BumpFactor&&(n.bumpScale=e.BumpFactor.value),e.Diffuse?n.color=a.ColorManagement.colorSpaceToWorking(new a.Color().fromArray(e.Diffuse.value),a.SRGBColorSpace):e.DiffuseColor&&(e.DiffuseColor.type==="Color"||e.DiffuseColor.type==="ColorRGB")&&(n.color=a.ColorManagement.colorSpaceToWorking(new a.Color().fromArray(e.DiffuseColor.value),a.SRGBColorSpace)),e.DisplacementFactor&&(n.displacementScale=e.DisplacementFactor.value),e.Emissive?n.emissive=a.ColorManagement.colorSpaceToWorking(new a.Color().fromArray(e.Emissive.value),a.SRGBColorSpace):e.EmissiveColor&&(e.EmissiveColor.type==="Color"||e.EmissiveColor.type==="ColorRGB")&&(n.emissive=a.ColorManagement.colorSpaceToWorking(new a.Color().fromArray(e.EmissiveColor.value),a.SRGBColorSpace)),e.EmissiveFactor&&(n.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),n.opacity=1-(e.TransparencyFactor?parseFloat(e.TransparencyFactor.value):0),(n.opacity===1||n.opacity===0)&&(n.opacity=e.Opacity?parseFloat(e.Opacity.value):null,n.opacity===null&&(n.opacity=1-(e.TransparentColor?parseFloat(e.TransparentColor.value[0]):0))),n.opacity<1&&(n.transparent=!0),e.ReflectionFactor&&(n.reflectivity=e.ReflectionFactor.value),e.Shininess&&(n.shininess=e.Shininess.value),e.Specular?n.specular=a.ColorManagement.colorSpaceToWorking(new a.Color().fromArray(e.Specular.value),a.SRGBColorSpace):e.SpecularColor&&e.SpecularColor.type==="Color"&&(n.specular=a.ColorManagement.colorSpaceToWorking(new a.Color().fromArray(e.SpecularColor.value),a.SRGBColorSpace));const s=this;return Qe.get(i).children.forEach(function(o){const r=o.relationship;switch(r){case"Bump":n.bumpMap=s.getTexture(t,o.ID);break;case"Maya|TEX_ao_map":n.aoMap=s.getTexture(t,o.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":n.map=s.getTexture(t,o.ID),n.map!==void 0&&(n.map.colorSpace=a.SRGBColorSpace);break;case"DisplacementColor":n.displacementMap=s.getTexture(t,o.ID);break;case"EmissiveColor":n.emissiveMap=s.getTexture(t,o.ID),n.emissiveMap!==void 0&&(n.emissiveMap.colorSpace=a.SRGBColorSpace);break;case"NormalMap":case"Maya|TEX_normal_map":n.normalMap=s.getTexture(t,o.ID);break;case"ReflectionColor":n.envMap=s.getTexture(t,o.ID),n.envMap!==void 0&&(n.envMap.mapping=a.EquirectangularReflectionMapping,n.envMap.colorSpace=a.SRGBColorSpace);break;case"SpecularColor":n.specularMap=s.getTexture(t,o.ID),n.specularMap!==void 0&&(n.specularMap.colorSpace=a.SRGBColorSpace);break;case"TransparentColor":case"TransparencyFactor":n.alphaMap=s.getTexture(t,o.ID),n.transparent=!0;break;default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",r);break}}),n}getTexture(e,t){return"LayeredTexture"in ae.Objects&&t in ae.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=Qe.get(t).children[0].ID),e.get(t)}parseDeformers(){const e={},t={};if("Deformer"in ae.Objects){const i=ae.Objects.Deformer;for(const n in i){const s=i[n],o=Qe.get(parseInt(n));if(s.attrType==="Skin"){const r=this.parseSkeleton(o,i);r.ID=n,o.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),r.geometryID=o.parents[0].ID,e[n]=r}else if(s.attrType==="BlendShape"){const r={id:n};r.rawTargets=this.parseMorphTargets(o,i),r.id=n,o.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[n]=r}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){const i=[];return e.children.forEach(function(n){const s=t[n.ID];if(s.attrType!=="Cluster")return;const o={ID:n.ID,indices:[],weights:[],transformLink:new a.Matrix4().fromArray(s.TransformLink.a)};"Indexes"in s&&(o.indices=s.Indexes.a,o.weights=s.Weights.a),i.push(o)}),{rawBones:i,bones:[]}}parseMorphTargets(e,t){const i=[];for(let n=0;n<e.children.length;n++){const s=e.children[n],o=t[s.ID],r={name:o.attrName,initialWeight:o.DeformPercent,id:o.id,fullWeights:o.FullWeights.a};if(o.attrType!=="BlendShapeChannel")return;r.geoID=Qe.get(parseInt(s.ID)).children.filter(function(A){return A.relationship===void 0})[0].ID,i.push(r)}return i}parseScene(e,t,i){Ue=new a.Group;const n=this.parseModels(e.skeletons,t,i),s=ae.Objects.Model,o=this;n.forEach(function(A){const l=s[A.ID];o.setLookAtProperties(A,l),Qe.get(A.ID)?.parents?.forEach(function(p){const u=n.get(p.ID);u!==void 0&&u.add(A)}),A.parent===null&&Ue.add(A)}),this.bindSkeleton(e.skeletons,t,n),this.addGlobalSceneSettings(),Ue.traverse(function(A){if(A.userData.transformData){A.parent&&(A.userData.transformData.parentMatrix=A.parent.matrix,A.userData.transformData.parentMatrixWorld=A.parent.matrixWorld);const l=ro(A.userData.transformData);A.applyMatrix4(l),A.updateWorldMatrix()}A.isSkinnedMesh&&(A.computeBoundingBox(),A.computeBoundingSphere(),A.boundingBox.expandByScalar(3),A.boundingSphere.radius*=3)});const r=new UA().parse();Ue.children.length===1&&Ue.children[0].isGroup&&(Ue.children[0].animations=r,Ue=Ue.children[0]),Ue.animations=r}parseModels(e,t,i){const n=new Map,s=ae.Objects.Model;for(const o in s){const r=parseInt(o),A=s[o],l=Qe.get(r);let h=this.buildSkeleton(l,e,r,A.attrName);if(!h){switch(A.attrType){case"Camera":h=this.createCamera(l);break;case"Light":h=this.createLight(l);break;case"Mesh":h=this.createMesh(l,t,i);break;case"NurbsCurve":h=this.createCurve(l,t);break;case"LimbNode":case"Root":h=new a.Bone;break;default:h=new a.Group;break}h.name=A.attrName?a.PropertyBinding.sanitizeNodeName(A.attrName):"",h.userData.originalName=A.attrName,h.ID=r}this.getTransformData(h,A),n.set(r,h)}return n}buildSkeleton(e,t,i,n){let s=null;return e?.parents.forEach(function(o){for(const r in t){const A=t[r];A.rawBones.forEach(function(l,h){if(l.ID===o.ID){const p=s;s=new a.Bone,s.matrixWorld.copy(l.transformLink),s.name=n?a.PropertyBinding.sanitizeNodeName(n):"",s.userData.originalName=n,s.ID=i,A.bones[h]=s,p!==null&&s.add(p)}})}}),s}createCamera(e){let t,i;if(e.children.forEach(function(n){const s=ae.Objects.NodeAttribute[n.ID];s!==void 0&&(i=s)}),i===void 0)t=new a.Object3D;else{let n=0;i.CameraProjectionType!==void 0&&i.CameraProjectionType.value===1&&(n=1);let s=1;i.NearPlane!==void 0&&(s=i.NearPlane.value/1e3);let o=1e3;i.FarPlane!==void 0&&(o=i.FarPlane.value/1e3);let r=window.innerWidth,A=window.innerHeight;i.AspectWidth!==void 0&&i.AspectHeight!==void 0&&(r=i.AspectWidth.value,A=i.AspectHeight.value);const l=r/A;let h=45;i.FieldOfView!==void 0&&(h=i.FieldOfView.value);const p=i.FocalLength?i.FocalLength.value:null;switch(n){case 0:t=new a.PerspectiveCamera(h,l,s,o),p!==null&&t.setFocalLength(p);break;case 1:console.warn("THREE.FBXLoader: Orthographic cameras not supported yet."),t=new a.Object3D;break;default:console.warn("THREE.FBXLoader: Unknown camera type "+n+"."),t=new a.Object3D;break}}return t}createLight(e){let t,i;if(e.children.forEach(function(n){const s=ae.Objects.NodeAttribute[n.ID];s!==void 0&&(i=s)}),i===void 0)t=new a.Object3D;else{let n;i.LightType===void 0?n=0:n=i.LightType.value;let s=16777215;i.Color!==void 0&&(s=a.ColorManagement.colorSpaceToWorking(new a.Color().fromArray(i.Color.value),a.SRGBColorSpace));let o=i.Intensity===void 0?1:i.Intensity.value/100;i.CastLightOnObject!==void 0&&i.CastLightOnObject.value===0&&(o=0);let r=0;i.FarAttenuationEnd!==void 0&&(i.EnableFarAttenuation!==void 0&&i.EnableFarAttenuation.value===0?r=0:r=i.FarAttenuationEnd.value);const A=1;switch(n){case 0:t=new a.PointLight(s,o,r,A);break;case 1:t=new a.DirectionalLight(s,o);break;case 2:let l=Math.PI/3;i.InnerAngle!==void 0&&(l=a.MathUtils.degToRad(i.InnerAngle.value));let h=0;i.OuterAngle!==void 0&&(h=a.MathUtils.degToRad(i.OuterAngle.value),h=Math.max(h,1)),t=new a.SpotLight(s,o,r,l,h,A);break;default:console.warn("THREE.FBXLoader: Unknown light type "+i.LightType.value+", defaulting to a PointLight."),t=new a.PointLight(s,o);break}i.CastShadows!==void 0&&i.CastShadows.value===1&&(t.castShadow=!0)}return t}createMesh(e,t,i){let n,s=null,o=null;const r=[];if(e.children.forEach(function(A){t.has(A.ID)&&(s=t.get(A.ID)),i.has(A.ID)&&r.push(i.get(A.ID))}),r.length>1?o=r:r.length>0?o=r[0]:(o=new a.MeshPhongMaterial({name:a.Loader.DEFAULT_MATERIAL_NAME,color:13421772}),r.push(o)),"color"in s.attributes&&r.forEach(function(A){A.vertexColors=!0}),s.groups.length>0){let A=!1;for(let l=0,h=s.groups.length;l<h;l++){const p=s.groups[l];(p.materialIndex<0||p.materialIndex>=r.length)&&(p.materialIndex=r.length,A=!0)}if(A){const l=new a.MeshStandardMaterial;r.push(l)}}return s.FBX_Deformer?(n=new a.SkinnedMesh(s,o),n.normalizeSkinWeights()):n=new a.Mesh(s,o),n}createCurve(e,t){const i=e.children.reduce(function(s,o){return t.has(o.ID)&&(s=t.get(o.ID)),s},null),n=new a.LineBasicMaterial({name:a.Loader.DEFAULT_MATERIAL_NAME,color:3342591,linewidth:1});return new a.Line(i,n)}getTransformData(e,t){const i={};"InheritType"in t&&(i.inheritType=parseInt(t.InheritType.value)),"RotationOrder"in t?i.eulerOrder=Vt(t.RotationOrder.value):i.eulerOrder=Vt(0),"Lcl_Translation"in t&&(i.translation=t.Lcl_Translation.value),"PreRotation"in t&&(i.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(i.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(i.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(i.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(i.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(i.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(i.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(i.rotationPivot=t.RotationPivot.value),e.userData.transformData=i}setLookAtProperties(e,t){"LookAtProperty"in t&&Qe.get(e.ID).children.forEach(function(n){if(n.relationship==="LookAtProperty"){const s=ae.Objects.Model[n.ID];if("Lcl_Translation"in s){const o=s.Lcl_Translation.value;e.target!==void 0?(e.target.position.fromArray(o),Ue.add(e.target)):e.lookAt(new a.Vector3().fromArray(o))}}})}bindSkeleton(e,t,i){const n=this.parsePoseNodes();for(const s in e){const o=e[s];Qe.get(parseInt(o.ID)).parents.forEach(function(A){if(t.has(A.ID)){const l=A.ID;Qe.get(l).parents.forEach(function(p){i.has(p.ID)&&i.get(p.ID).bind(new a.Skeleton(o.bones),n[p.ID])})}})}}parsePoseNodes(){const e={};if("Pose"in ae.Objects){const t=ae.Objects.Pose;for(const i in t)if(t[i].attrType==="BindPose"&&t[i].NbPoseNodes>0){const n=t[i].PoseNode;Array.isArray(n)?n.forEach(function(s){e[s.Node]=new a.Matrix4().fromArray(s.Matrix.a)}):e[n.Node]=new a.Matrix4().fromArray(n.Matrix.a)}}return e}addGlobalSceneSettings(){if("GlobalSettings"in ae){if("AmbientColor"in ae.GlobalSettings){const e=ae.GlobalSettings.AmbientColor.value,t=e[0],i=e[1],n=e[2];if(t!==0||i!==0||n!==0){const s=new a.Color().setRGB(t,i,n,a.SRGBColorSpace);Ue.add(new a.AmbientLight(s,1))}}"UnitScaleFactor"in ae.GlobalSettings&&(Ue.userData.unitScaleFactor=ae.GlobalSettings.UnitScaleFactor.value)}}}class GA{constructor(){this.negativeMaterialIndices=!1}parse(e){const t=new Map;if("Geometry"in ae.Objects){const i=ae.Objects.Geometry;for(const n in i){const s=Qe.get(parseInt(n)),o=this.parseGeometry(s,i[n],e);t.set(parseInt(n),o)}}return this.negativeMaterialIndices===!0&&console.warn("THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected."),t}parseGeometry(e,t,i){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,i);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,i){const n=i.skeletons,s=[],o=e.parents.map(function(p){return ae.Objects.Model[p.ID]});if(o.length===0)return;const r=e.children.reduce(function(p,u){return n[u.ID]!==void 0&&(p=n[u.ID]),p},null);e.children.forEach(function(p){i.morphTargets[p.ID]!==void 0&&s.push(i.morphTargets[p.ID])});const A=o[0],l={};"RotationOrder"in A&&(l.eulerOrder=Vt(A.RotationOrder.value)),"InheritType"in A&&(l.inheritType=parseInt(A.InheritType.value)),"GeometricTranslation"in A&&(l.translation=A.GeometricTranslation.value),"GeometricRotation"in A&&(l.rotation=A.GeometricRotation.value),"GeometricScaling"in A&&(l.scale=A.GeometricScaling.value);const h=ro(l);return this.genGeometry(t,r,s,h)}genGeometry(e,t,i,n){const s=new a.BufferGeometry;e.attrName&&(s.name=e.attrName);const o=this.parseGeoNode(e,t),r=this.genBuffers(o),A=new a.Float32BufferAttribute(r.vertex,3);if(A.applyMatrix4(n),s.setAttribute("position",A),r.colors.length>0&&s.setAttribute("color",new a.Float32BufferAttribute(r.colors,3)),t&&(s.setAttribute("skinIndex",new a.Uint16BufferAttribute(r.weightsIndices,4)),s.setAttribute("skinWeight",new a.Float32BufferAttribute(r.vertexWeights,4)),s.FBX_Deformer=t),r.normal.length>0){const l=new a.Matrix3().getNormalMatrix(n),h=new a.Float32BufferAttribute(r.normal,3);h.applyNormalMatrix(l),s.setAttribute("normal",h)}if(r.uvs.forEach(function(l,h){const p=h===0?"uv":`uv${h}`;s.setAttribute(p,new a.Float32BufferAttribute(r.uvs[h],2))}),o.material&&o.material.mappingType!=="AllSame"){let l=r.materialIndex[0],h=0;if(r.materialIndex.forEach(function(p,u){p!==l&&(s.addGroup(h,u-h,l),l=p,h=u)}),s.groups.length>0){const p=s.groups[s.groups.length-1],u=p.start+p.count;u!==r.materialIndex.length&&s.addGroup(u,r.materialIndex.length-u,l)}s.groups.length===0&&s.addGroup(0,r.materialIndex.length,r.materialIndex[0])}return this.addMorphTargets(s,e,i,n),s}parseGeoNode(e,t){const i={};if(i.vertexPositions=e.Vertices!==void 0?e.Vertices.a:[],i.vertexIndices=e.PolygonVertexIndex!==void 0?e.PolygonVertexIndex.a:[],e.LayerElementColor&&e.LayerElementColor[0].Colors&&(i.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(i.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(i.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){i.uv=[];let n=0;for(;e.LayerElementUV[n];)e.LayerElementUV[n].UV&&i.uv.push(this.parseUVs(e.LayerElementUV[n])),n++}return i.weightTable={},t!==null&&(i.skeleton=t,t.rawBones.forEach(function(n,s){n.indices.forEach(function(o,r){i.weightTable[o]===void 0&&(i.weightTable[o]=[]),i.weightTable[o].push({id:s,weight:n.weights[r]})})})),i}genBuffers(e){const t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let i=0,n=0,s=!1,o=[],r=[],A=[],l=[],h=[],p=[];const u=this;return e.vertexIndices.forEach(function(f,b){let m,E=!1;f<0&&(f=f^-1,E=!0);let B=[],w=[];if(o.push(f*3,f*3+1,f*3+2),e.color){const C=sn(b,i,f,e.color);A.push(C[0],C[1],C[2])}if(e.skeleton){if(e.weightTable[f]!==void 0&&e.weightTable[f].forEach(function(C){w.push(C.weight),B.push(C.id)}),w.length>4){s||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),s=!0);const C=[0,0,0,0],y=[0,0,0,0];w.forEach(function(Q,R){let M=Q,T=B[R];y.forEach(function(D,G,U){if(M>D){U[G]=M,M=D;const j=C[G];C[G]=T,T=j}})}),B=C,w=y}for(;w.length<4;)w.push(0),B.push(0);for(let C=0;C<4;++C)h.push(w[C]),p.push(B[C])}if(e.normal){const C=sn(b,i,f,e.normal);r.push(C[0],C[1],C[2])}e.material&&e.material.mappingType!=="AllSame"&&(m=sn(b,i,f,e.material)[0],m<0&&(u.negativeMaterialIndices=!0,m=0)),e.uv&&e.uv.forEach(function(C,y){const Q=sn(b,i,f,C);l[y]===void 0&&(l[y]=[]),l[y].push(Q[0]),l[y].push(Q[1])}),n++,E&&(u.genFace(t,e,o,m,r,A,l,h,p,n),i++,n=0,o=[],r=[],A=[],l=[],h=[],p=[])}),t}getNormalNewell(e){const t=new a.Vector3(0,0,0);for(let i=0;i<e.length;i++){const n=e[i],s=e[(i+1)%e.length];t.x+=(n.y-s.y)*(n.z+s.z),t.y+=(n.z-s.z)*(n.x+s.x),t.z+=(n.x-s.x)*(n.y+s.y)}return t.normalize(),t}getNormalTangentAndBitangent(e){const t=this.getNormalNewell(e),n=(Math.abs(t.z)>.5?new a.Vector3(0,1,0):new a.Vector3(0,0,1)).cross(t).normalize(),s=t.clone().cross(n).normalize();return{normal:t,tangent:n,bitangent:s}}flattenVertex(e,t,i){return new a.Vector2(e.dot(t),e.dot(i))}genFace(e,t,i,n,s,o,r,A,l,h){let p;if(h>3){const u=[],f=t.baseVertexPositions||t.vertexPositions;for(let B=0;B<i.length;B+=3)u.push(new a.Vector3(f[i[B]],f[i[B+1]],f[i[B+2]]));const{tangent:b,bitangent:m}=this.getNormalTangentAndBitangent(u),E=[];for(const B of u)E.push(this.flattenVertex(B,b,m));p=a.ShapeUtils.triangulateShape(E,[])}else h===2?(console.warn("THREE.FBXLoader: Edge topology detected. This is currently not supported. The resulting mesh will not be correct."),p=[[0,1,2]]):p=[[0,1,2]];for(const[u,f,b]of p)e.vertex.push(t.vertexPositions[i[u*3]]),e.vertex.push(t.vertexPositions[i[u*3+1]]),e.vertex.push(t.vertexPositions[i[u*3+2]]),e.vertex.push(t.vertexPositions[i[f*3]]),e.vertex.push(t.vertexPositions[i[f*3+1]]),e.vertex.push(t.vertexPositions[i[f*3+2]]),e.vertex.push(t.vertexPositions[i[b*3]]),e.vertex.push(t.vertexPositions[i[b*3+1]]),e.vertex.push(t.vertexPositions[i[b*3+2]]),t.skeleton&&(e.vertexWeights.push(A[u*4]),e.vertexWeights.push(A[u*4+1]),e.vertexWeights.push(A[u*4+2]),e.vertexWeights.push(A[u*4+3]),e.vertexWeights.push(A[f*4]),e.vertexWeights.push(A[f*4+1]),e.vertexWeights.push(A[f*4+2]),e.vertexWeights.push(A[f*4+3]),e.vertexWeights.push(A[b*4]),e.vertexWeights.push(A[b*4+1]),e.vertexWeights.push(A[b*4+2]),e.vertexWeights.push(A[b*4+3]),e.weightsIndices.push(l[u*4]),e.weightsIndices.push(l[u*4+1]),e.weightsIndices.push(l[u*4+2]),e.weightsIndices.push(l[u*4+3]),e.weightsIndices.push(l[f*4]),e.weightsIndices.push(l[f*4+1]),e.weightsIndices.push(l[f*4+2]),e.weightsIndices.push(l[f*4+3]),e.weightsIndices.push(l[b*4]),e.weightsIndices.push(l[b*4+1]),e.weightsIndices.push(l[b*4+2]),e.weightsIndices.push(l[b*4+3])),t.color&&(e.colors.push(o[u*3]),e.colors.push(o[u*3+1]),e.colors.push(o[u*3+2]),e.colors.push(o[f*3]),e.colors.push(o[f*3+1]),e.colors.push(o[f*3+2]),e.colors.push(o[b*3]),e.colors.push(o[b*3+1]),e.colors.push(o[b*3+2])),t.material&&t.material.mappingType!=="AllSame"&&(e.materialIndex.push(n),e.materialIndex.push(n),e.materialIndex.push(n)),t.normal&&(e.normal.push(s[u*3]),e.normal.push(s[u*3+1]),e.normal.push(s[u*3+2]),e.normal.push(s[f*3]),e.normal.push(s[f*3+1]),e.normal.push(s[f*3+2]),e.normal.push(s[b*3]),e.normal.push(s[b*3+1]),e.normal.push(s[b*3+2])),t.uv&&t.uv.forEach(function(m,E){e.uvs[E]===void 0&&(e.uvs[E]=[]),e.uvs[E].push(r[E][u*2]),e.uvs[E].push(r[E][u*2+1]),e.uvs[E].push(r[E][f*2]),e.uvs[E].push(r[E][f*2+1]),e.uvs[E].push(r[E][b*2]),e.uvs[E].push(r[E][b*2+1])})}addMorphTargets(e,t,i,n){if(i.length===0)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];const s=this;i.forEach(function(o){o.rawTargets.forEach(function(r){const A=ae.Objects.Geometry[r.geoID];A!==void 0&&s.genMorphGeometry(e,t,A,n,r.name)})})}genMorphGeometry(e,t,i,n,s){const o=t.Vertices!==void 0?t.Vertices.a:[],r=t.PolygonVertexIndex!==void 0?t.PolygonVertexIndex.a:[],A=i.Vertices!==void 0?i.Vertices.a:[],l=i.Indexes!==void 0?i.Indexes.a:[],h=e.attributes.position.count*3,p=new Float32Array(h);for(let m=0;m<l.length;m++){const E=l[m]*3;p[E]=A[m*3],p[E+1]=A[m*3+1],p[E+2]=A[m*3+2]}const u={vertexIndices:r,vertexPositions:p,baseVertexPositions:o},f=this.genBuffers(u),b=new a.Float32BufferAttribute(f.vertex,3);b.name=s||i.attrName,b.applyMatrix4(n),e.morphAttributes.position.push(b)}parseNormals(e){const t=e.MappingInformationType,i=e.ReferenceInformationType,n=e.Normals.a;let s=[];return i==="IndexToDirect"&&("NormalIndex"in e?s=e.NormalIndex.a:"NormalsIndex"in e&&(s=e.NormalsIndex.a)),{dataSize:3,buffer:n,indices:s,mappingType:t,referenceType:i}}parseUVs(e){const t=e.MappingInformationType,i=e.ReferenceInformationType,n=e.UV.a;let s=[];return i==="IndexToDirect"&&(s=e.UVIndex.a),{dataSize:2,buffer:n,indices:s,mappingType:t,referenceType:i}}parseVertexColors(e){if(!e.Colors)return;const t=e.MappingInformationType,i=e.ReferenceInformationType,n=e.Colors.a;let s=[];i==="IndexToDirect"&&(s=e.ColorIndex.a);for(let o=0,r=new a.Color;o<n.length;o+=4)r.fromArray(n,o),a.ColorManagement.colorSpaceToWorking(r,a.SRGBColorSpace),r.toArray(n,o);return{dataSize:4,buffer:n,indices:s,mappingType:t,referenceType:i}}parseMaterialIndices(e){const t=e.MappingInformationType,i=e.ReferenceInformationType;if(t==="NoMappingInformation")return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:i};const n=e.Materials.a,s=[];for(let o=0;o<n.length;++o)s.push(o);return{dataSize:1,buffer:n,indices:s,mappingType:t,referenceType:i}}parseNurbsGeometry(e){const t=parseInt(e.Order);if(isNaN(t))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",e.Order,e.id),new a.BufferGeometry;const i=t-1,n=e.KnotVector.a,s=[],o=e.Points.a;for(let p=0,u=o.length;p<u;p+=4)s.push(new a.Vector4().fromArray(o,p));let r,A;if(e.Form==="Closed")s.push(s[0]);else if(e.Form==="Periodic"){r=i,A=n.length-1-r;for(let p=0;p<i;++p)s.push(s[p])}const h=new _A(i,n,s,r,A).getPoints(s.length*12);return new a.BufferGeometry().setFromPoints(h)}}class UA{parse(){const e=[],t=this.parseClips();if(t!==void 0)for(const i in t){const n=t[i],s=this.addClip(n);e.push(s)}return e}parseClips(){if(ae.Objects.AnimationCurve===void 0)return;const e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);const t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){const e=ae.Objects.AnimationCurveNode,t=new Map;for(const i in e){const n=e[i];if(n.attrName.match(/S|R|T|DeformPercent/)!==null){const s={id:n.id,attr:n.attrName,curves:{}};t.set(s.id,s)}}return t}parseAnimationCurves(e){const t=ae.Objects.AnimationCurve;for(const i in t){const n={id:t[i].id,times:t[i].KeyTime.a.map(jA),values:t[i].KeyValueFloat.a},s=Qe.get(n.id);if(s!==void 0){const o=s.parents[0].ID,r=s.parents[0].relationship;r.match(/X/)?e.get(o).curves.x=n:r.match(/Y/)?e.get(o).curves.y=n:r.match(/Z/)?e.get(o).curves.z=n:r.match(/DeformPercent/)&&e.has(o)&&(e.get(o).curves.morph=n)}}}parseAnimationLayers(e){const t=ae.Objects.AnimationLayer,i=new Map;for(const n in t){const s=[],o=Qe.get(parseInt(n));o!==void 0&&(o.children.forEach(function(A,l){if(e.has(A.ID)){const h=e.get(A.ID);if(h.curves.x!==void 0||h.curves.y!==void 0||h.curves.z!==void 0){if(s[l]===void 0){const p=Qe.get(A.ID).parents.filter(function(u){return u.relationship!==void 0})[0].ID;if(p!==void 0){const u=ae.Objects.Model[p.toString()];if(u===void 0){console.warn("THREE.FBXLoader: Encountered a unused curve.",A);return}const f={modelName:u.attrName?a.PropertyBinding.sanitizeNodeName(u.attrName):"",ID:u.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};Ue.traverse(function(b){b.ID===u.id&&(f.transform=b.matrix,b.userData.transformData&&(f.eulerOrder=b.userData.transformData.eulerOrder))}),f.transform||(f.transform=new a.Matrix4),"PreRotation"in u&&(f.preRotation=u.PreRotation.value),"PostRotation"in u&&(f.postRotation=u.PostRotation.value),s[l]=f}}s[l]&&(s[l][h.attr]=h)}else if(h.curves.morph!==void 0){if(s[l]===void 0){const p=Qe.get(A.ID).parents.filter(function(B){return B.relationship!==void 0})[0].ID,u=Qe.get(p).parents[0].ID,f=Qe.get(u).parents[0].ID,b=Qe.get(f).parents[0].ID,m=ae.Objects.Model[b],E={modelName:m.attrName?a.PropertyBinding.sanitizeNodeName(m.attrName):"",morphName:ae.Objects.Deformer[p].attrName};s[l]=E}s[l][h.attr]=h}}}),i.set(parseInt(n),s))}return i}parseAnimStacks(e){const t=ae.Objects.AnimationStack,i={};for(const n in t){const s=Qe.get(parseInt(n)).children;s.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const o=e.get(s[0].ID);i[n]={name:t[n].attrName,layer:o}}return i}addClip(e){let t=[];const i=this;return e.layer.forEach(function(n){t=t.concat(i.generateTracks(n))}),new a.AnimationClip(e.name,-1,t)}generateTracks(e){const t=[];let i=new a.Vector3,n=new a.Vector3;if(e.transform&&e.transform.decompose(i,new a.Quaternion,n),i=i.toArray(),n=n.toArray(),e.T!==void 0&&Object.keys(e.T.curves).length>0){const s=this.generateVectorTrack(e.modelName,e.T.curves,i,"position");s!==void 0&&t.push(s)}if(e.R!==void 0&&Object.keys(e.R.curves).length>0){const s=this.generateRotationTrack(e.modelName,e.R.curves,e.preRotation,e.postRotation,e.eulerOrder);s!==void 0&&t.push(s)}if(e.S!==void 0&&Object.keys(e.S.curves).length>0){const s=this.generateVectorTrack(e.modelName,e.S.curves,n,"scale");s!==void 0&&t.push(s)}if(e.DeformPercent!==void 0){const s=this.generateMorphTrack(e);s!==void 0&&t.push(s)}return t}generateVectorTrack(e,t,i,n){const s=this.getTimesForAllAxes(t),o=this.getKeyframeTrackValues(s,t,i);return new a.VectorKeyframeTrack(e+"."+n,s,o)}generateRotationTrack(e,t,i,n,s){let o,r;if(t.x===void 0||t.y===void 0||t.z===void 0){console.warn("THREE.FBXLoader: Missing rotation curves "+(t.x===void 0?"x ":"")+(t.y===void 0?"y ":"")+(t.z===void 0?"z ":"")+" for animation of "+e+". This is currently not supported.");return}if(t.x!==void 0&&t.y!==void 0&&t.z!==void 0){const u=this.interpolateRotations(t.x,t.y,t.z,s);o=u[0],r=u[1]}const A=Vt(0);i!==void 0&&(i=i.map(a.MathUtils.degToRad),i.push(A),i=new a.Euler().fromArray(i),i=new a.Quaternion().setFromEuler(i)),n!==void 0&&(n=n.map(a.MathUtils.degToRad),n.push(A),n=new a.Euler().fromArray(n),n=new a.Quaternion().setFromEuler(n).invert());const l=new a.Quaternion,h=new a.Euler,p=[];if(!(!r||!o)){for(let u=0;u<r.length;u+=3)h.set(r[u],r[u+1],r[u+2],s),l.setFromEuler(h),i!==void 0&&l.premultiply(i),n!==void 0&&l.multiply(n),u>2&&new a.Quaternion().fromArray(p,(u-3)/3*4).dot(l)<0&&l.set(-l.x,-l.y,-l.z,-l.w),l.toArray(p,u/3*4);return new a.QuaternionKeyframeTrack(e+".quaternion",o,p)}}generateMorphTrack(e){const t=e.DeformPercent.curves.morph,i=t.values.map(function(s){return s/100}),n=Ue.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new a.NumberKeyframeTrack(e.modelName+".morphTargetInfluences["+n+"]",t.times,i)}getTimesForAllAxes(e){let t=[];if(e.x!==void 0&&(t=t.concat(e.x.times)),e.y!==void 0&&(t=t.concat(e.y.times)),e.z!==void 0&&(t=t.concat(e.z.times)),t=t.sort(function(i,n){return i-n}),t.length>1){let i=1,n=t[0];for(let s=1;s<t.length;s++){const o=t[s];o!==n&&(t[i]=o,n=o,i++)}t=t.slice(0,i)}return t}getKeyframeTrackValues(e,t,i){const n=i,s=[];let o=-1,r=-1,A=-1;return e.forEach(function(l){if(t.x&&(o=t.x.times.indexOf(l)),t.y&&(r=t.y.times.indexOf(l)),t.z&&(A=t.z.times.indexOf(l)),o!==-1){const h=t.x.values[o];s.push(h),n[0]=h}else s.push(n[0]);if(r!==-1){const h=t.y.values[r];s.push(h),n[1]=h}else s.push(n[1]);if(A!==-1){const h=t.z.values[A];s.push(h),n[2]=h}else s.push(n[2])}),s}interpolateRotations(e,t,i,n){const s=[],o=[];s.push(e.times[0]),o.push(a.MathUtils.degToRad(e.values[0])),o.push(a.MathUtils.degToRad(t.values[0])),o.push(a.MathUtils.degToRad(i.values[0]));for(let r=1;r<e.values.length;r++){const A=[e.values[r-1],t.values[r-1],i.values[r-1]];if(isNaN(A[0])||isNaN(A[1])||isNaN(A[2]))continue;const l=A.map(a.MathUtils.degToRad),h=[e.values[r],t.values[r],i.values[r]];if(isNaN(h[0])||isNaN(h[1])||isNaN(h[2]))continue;const p=h.map(a.MathUtils.degToRad),u=[h[0]-A[0],h[1]-A[1],h[2]-A[2]],f=[Math.abs(u[0]),Math.abs(u[1]),Math.abs(u[2])];if(f[0]>=180||f[1]>=180||f[2]>=180){const m=Math.max(...f)/180,E=new a.Euler(...l,n),B=new a.Euler(...p,n),w=new a.Quaternion().setFromEuler(E),C=new a.Quaternion().setFromEuler(B);w.dot(C)&&C.set(-C.x,-C.y,-C.z,-C.w);const y=e.times[r-1],Q=e.times[r]-y,R=new a.Quaternion,M=new a.Euler;for(let T=0;T<1;T+=1/m)R.copy(w.clone().slerp(C.clone(),T)),s.push(y+T*Q),M.setFromQuaternion(R,n),o.push(M.x),o.push(M.y),o.push(M.z)}else s.push(e.times[r]),o.push(a.MathUtils.degToRad(e.values[r])),o.push(a.MathUtils.degToRad(t.values[r])),o.push(a.MathUtils.degToRad(i.values[r]))}return[s,o]}}class PA{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(e){this.nodeStack.push(e),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(e,t){this.currentProp=e,this.currentPropName=t}parse(e){this.currentIndent=0,this.allNodes=new ao,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const t=this,i=e.split(/[\r\n]+/);return i.forEach(function(n,s){const o=n.match(/^[\s\t]*;/),r=n.match(/^[\s\t]*$/);if(o||r)return;const A=n.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),l=n.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),h=n.match("^\\t{"+(t.currentIndent-1)+"}}");A?t.parseNodeBegin(n,A):l?t.parseNodeProperty(n,l,i[++s]):h?t.popStack():n.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(n)}),this.allNodes}parseNodeBegin(e,t){const i=t[1].trim().replace(/^"/,"").replace(/"$/,""),n=t[2].split(",").map(function(A){return A.trim().replace(/^"/,"").replace(/"$/,"")}),s={name:i},o=this.parseNodeAttr(n),r=this.getCurrentNode();this.currentIndent===0?this.allNodes.add(i,s):i in r?(i==="PoseNode"?r.PoseNode.push(s):r[i].id!==void 0&&(r[i]={},r[i][r[i].id]=r[i]),o.id!==""&&(r[i][o.id]=s)):typeof o.id=="number"?(r[i]={},r[i][o.id]=s):i!=="Properties70"&&(i==="PoseNode"?r[i]=[s]:r[i]=s),typeof o.id=="number"&&(s.id=o.id),o.name!==""&&(s.attrName=o.name),o.type!==""&&(s.attrType=o.type),this.pushStack(s)}parseNodeAttr(e){let t=e[0];e[0]!==""&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let i="",n="";return e.length>1&&(i=e[1].replace(/^(\w+)::/,""),n=e[2]),{id:t,name:i,type:n}}parseNodeProperty(e,t,i){let n=t[1].replace(/^"/,"").replace(/"$/,"").trim(),s=t[2].replace(/^"/,"").replace(/"$/,"").trim();n==="Content"&&s===","&&(s=i.replace(/"/g,"").replace(/,$/,"").trim());const o=this.getCurrentNode();if(o.name==="Properties70"){this.parseNodeSpecialProperty(e,n,s);return}if(n==="C"){const A=s.split(",").slice(1),l=parseInt(A[0]),h=parseInt(A[1]);let p=s.split(",").slice(3);p=p.map(function(u){return u.trim().replace(/^"/,"")}),n="connections",s=[l,h],KA(s,p),o[n]===void 0&&(o[n]=[])}n==="Node"&&(o.id=s),n in o&&Array.isArray(o[n])?o[n].push(s):n!=="a"?o[n]=s:o.a=s,this.setCurrentProp(o,n),n==="a"&&s.slice(-1)!==","&&(o.a=Fn(s))}parseNodePropertyContinued(e){const t=this.getCurrentNode();t.a+=e,e.slice(-1)!==","&&(t.a=Fn(t.a))}parseNodeSpecialProperty(e,t,i){const n=i.split('",').map(function(h){return h.trim().replace(/^\"/,"").replace(/\s/,"_")}),s=n[0],o=n[1],r=n[2],A=n[3];let l=n[4];switch(o){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":l=parseFloat(l);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":l=Fn(l);break}this.getPrevNode()[s]={type:o,type2:r,flag:A,value:l},this.setCurrentProp(this.getPrevNode(),s)}}class NA{parse(e){const t=new zi(e);t.skip(23);const i=t.getUint32();if(i<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+i);const n=new ao;for(;!this.endOfContent(t);){const s=this.parseNode(t,i);s!==null&&n.add(s.name,s)}return n}endOfContent(e){return e.size()%16===0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()}parseNode(e,t){const i={},n=t>=7500?e.getUint64():e.getUint32(),s=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();const o=e.getUint8(),r=e.getString(o);if(n===0)return null;const A=[];for(let u=0;u<s;u++)A.push(this.parseProperty(e));const l=A.length>0?A[0]:"",h=A.length>1?A[1]:"",p=A.length>2?A[2]:"";for(i.singleProperty=s===1&&e.getOffset()===n;n>e.getOffset();){const u=this.parseNode(e,t);u!==null&&this.parseSubNode(r,i,u)}return i.propertyList=A,typeof l=="number"&&(i.id=l),h!==""&&(i.attrName=h),p!==""&&(i.attrType=p),r!==""&&(i.name=r),i}parseSubNode(e,t,i){if(i.singleProperty===!0){const n=i.propertyList[0];Array.isArray(n)?(t[i.name]=i,i.a=n):t[i.name]=n}else if(e==="Connections"&&i.name==="C"){const n=[];i.propertyList.forEach(function(s,o){o!==0&&n.push(s)}),t.connections===void 0&&(t.connections=[]),t.connections.push(n)}else if(i.name==="Properties70")Object.keys(i).forEach(function(s){t[s]=i[s]});else if(e==="Properties70"&&i.name==="P"){let n=i.propertyList[0],s=i.propertyList[1];const o=i.propertyList[2],r=i.propertyList[3];let A;n.indexOf("Lcl ")===0&&(n=n.replace("Lcl ","Lcl_")),s.indexOf("Lcl ")===0&&(s=s.replace("Lcl ","Lcl_")),s==="Color"||s==="ColorRGB"||s==="Vector"||s==="Vector3D"||s.indexOf("Lcl_")===0?A=[i.propertyList[4],i.propertyList[5],i.propertyList[6]]:A=i.propertyList[4],t[n]={type:s,type2:o,flag:r,value:A}}else t[i.name]===void 0?typeof i.id=="number"?(t[i.name]={},t[i.name][i.id]=i):t[i.name]=i:i.name==="PoseNode"?(Array.isArray(t[i.name])||(t[i.name]=[t[i.name]]),t[i.name].push(i)):t[i.name][i.id]===void 0&&(t[i.name][i.id]=i)}parseProperty(e){const t=e.getString(1);let i;switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":return i=e.getUint32(),e.getArrayBuffer(i);case"S":return i=e.getUint32(),e.getString(i);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const n=e.getUint32(),s=e.getUint32(),o=e.getUint32();if(s===0)switch(t){case"b":case"c":return e.getBooleanArray(n);case"d":return e.getFloat64Array(n);case"f":return e.getFloat32Array(n);case"i":return e.getInt32Array(n);case"l":return e.getInt64Array(n)}const r=Ot(new Uint8Array(e.getArrayBuffer(o))),A=new zi(r.buffer);switch(t){case"b":case"c":return A.getBooleanArray(n);case"d":return A.getFloat64Array(n);case"f":return A.getFloat32Array(n);case"i":return A.getInt32Array(n);case"l":return A.getInt64Array(n)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}class zi{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=t!==void 0?t:!0,this._textDecoder=new TextDecoder}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e}getBoolean(){return(this.getUint8()&1)===1}getBooleanArray(e){const t=[];for(let i=0;i<e;i++)t.push(this.getBoolean());return t}getUint8(){const e=this.dv.getUint8(this.offset);return this.offset+=1,e}getInt16(){const e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}getInt32(){const e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}getInt32Array(e){const t=[];for(let i=0;i<e;i++)t.push(this.getInt32());return t}getUint32(){const e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}getInt64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),t&2147483648?(t=~t&4294967295,e=~e&4294967295,e===4294967295&&(t=t+1&4294967295),e=e+1&4294967295,-(t*4294967296+e)):t*4294967296+e}getInt64Array(e){const t=[];for(let i=0;i<e;i++)t.push(this.getInt64());return t}getUint64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),t*4294967296+e}getFloat32(){const e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}getFloat32Array(e){const t=[];for(let i=0;i<e;i++)t.push(this.getFloat32());return t}getFloat64(){const e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){const t=[];for(let i=0;i<e;i++)t.push(this.getFloat64());return t}getArrayBuffer(e){const t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}getString(e){const t=this.offset;let i=new Uint8Array(this.dv.buffer,t,e);this.skip(e);const n=i.indexOf(0);return n>=0&&(i=new Uint8Array(this.dv.buffer,t,n)),this._textDecoder.decode(i)}}class ao{add(e,t){this[e]=t}}function OA(c){const e="Kaydara FBX Binary \0";return c.byteLength>=e.length&&e===Ao(c,0,e.length)}function HA(c){const e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let t=0;function i(n){const s=c[n-1];return c=c.slice(t+n),t++,s}for(let n=0;n<e.length;++n)if(i(1)===e[n])return!1;return!0}function Vi(c){const e=/FBXVersion: (\d+)/,t=c.match(e);if(t)return parseInt(t[1]);throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function jA(c){return c/46186158e3}const qA=[];function sn(c,e,t,i){let n;switch(i.mappingType){case"ByPolygonVertex":n=c;break;case"ByPolygon":n=e;break;case"ByVertice":n=t;break;case"AllSame":n=i.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+i.mappingType)}i.referenceType==="IndexToDirect"&&(n=i.indices[n]);const s=n*i.dataSize,o=s+i.dataSize;return zA(qA,i.buffer,s,o)}const Mn=new a.Euler,vt=new a.Vector3;function ro(c){const e=new a.Matrix4,t=new a.Matrix4,i=new a.Matrix4,n=new a.Matrix4,s=new a.Matrix4,o=new a.Matrix4,r=new a.Matrix4,A=new a.Matrix4,l=new a.Matrix4,h=new a.Matrix4,p=new a.Matrix4,u=new a.Matrix4,f=c.inheritType?c.inheritType:0;c.translation&&e.setPosition(vt.fromArray(c.translation));const b=Vt(0);if(c.preRotation){const U=c.preRotation.map(a.MathUtils.degToRad);U.push(b),t.makeRotationFromEuler(Mn.fromArray(U))}if(c.rotation){const U=c.rotation.map(a.MathUtils.degToRad);U.push(c.eulerOrder||b),i.makeRotationFromEuler(Mn.fromArray(U))}if(c.postRotation){const U=c.postRotation.map(a.MathUtils.degToRad);U.push(b),n.makeRotationFromEuler(Mn.fromArray(U)),n.invert()}c.scale&&s.scale(vt.fromArray(c.scale)),c.scalingOffset&&r.setPosition(vt.fromArray(c.scalingOffset)),c.scalingPivot&&o.setPosition(vt.fromArray(c.scalingPivot)),c.rotationOffset&&A.setPosition(vt.fromArray(c.rotationOffset)),c.rotationPivot&&l.setPosition(vt.fromArray(c.rotationPivot)),c.parentMatrixWorld&&(p.copy(c.parentMatrix),h.copy(c.parentMatrixWorld));const m=t.clone().multiply(i).multiply(n),E=new a.Matrix4;E.extractRotation(h);const B=new a.Matrix4;B.copyPosition(h);const w=B.clone().invert().multiply(h),C=E.clone().invert().multiply(w),y=s,Q=new a.Matrix4;if(f===0)Q.copy(E).multiply(m).multiply(C).multiply(y);else if(f===1)Q.copy(E).multiply(C).multiply(m).multiply(y);else{const j=new a.Matrix4().scale(new a.Vector3().setFromMatrixScale(p)).clone().invert(),X=C.clone().multiply(j);Q.copy(E).multiply(m).multiply(X).multiply(y)}const R=l.clone().invert(),M=o.clone().invert();let T=e.clone().multiply(A).multiply(l).multiply(t).multiply(i).multiply(n).multiply(R).multiply(r).multiply(o).multiply(s).multiply(M);const D=new a.Matrix4().copyPosition(T),G=h.clone().multiply(D);return u.copyPosition(G),T=u.clone().multiply(Q),T.premultiply(h.invert()),T}function Vt(c){c=c||0;const e=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return c===6?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),e[0]):e[c]}function Fn(c){return c.split(",").map(function(t){return parseFloat(t)})}function Ao(c,e,t){return e===void 0&&(e=0),t===void 0&&(t=c.byteLength),new TextDecoder().decode(new Uint8Array(c,e,t))}function KA(c,e){for(let t=0,i=c.length,n=e.length;t<n;t++,i++)c[i]=e[t]}function zA(c,e,t,i){for(let n=t,s=0;n<i;n++,s++)c[s]=e[n];return c}class VA extends a.Loader{constructor(e){super(e)}load(e,t,i,n){const s=this,o=this.path===""?a.LoaderUtils.extractUrlBase(e):this.path,r=new a.FileLoader(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,function(A){try{t(s.parse(A,o))}catch(l){n?n(l):console.error(l),s.manager.itemError(e)}},i,n)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){const i=e.split(`
|
|
442
|
+
`);let n={};const s=/\s+/,o={};for(let A=0;A<i.length;A++){let l=i[A];if(l=l.trim(),l.length===0||l.charAt(0)==="#")continue;const h=l.indexOf(" ");let p=h>=0?l.substring(0,h):l;p=p.toLowerCase();let u=h>=0?l.substring(h+1):"";if(u=u.trim(),p==="newmtl")n={name:u},o[u]=n;else if(p==="ka"||p==="kd"||p==="ks"||p==="ke"){const f=u.split(s,3);n[p]=[parseFloat(f[0]),parseFloat(f[1]),parseFloat(f[2])]}else n[p]=u}const r=new YA(this.resourcePath||t,this.materialOptions);return r.setCrossOrigin(this.crossOrigin),r.setManager(this.manager),r.setMaterials(o),r}}class YA{constructor(e="",t={}){this.baseUrl=e,this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:a.FrontSide,this.wrap=this.options.wrap!==void 0?this.options.wrap:a.RepeatWrapping}setCrossOrigin(e){return this.crossOrigin=e,this}setManager(e){this.manager=e}setMaterials(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(e){if(!this.options)return e;const t={};for(const i in e){const n=e[i],s={};t[i]=s;for(const o in n){let r=!0,A=n[o];const l=o.toLowerCase();switch(l){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(A=[A[0]/255,A[1]/255,A[2]/255]),this.options&&this.options.ignoreZeroRGBs&&A[0]===0&&A[1]===0&&A[2]===0&&(r=!1);break}r&&(s[l]=A)}}return t}preload(){for(const e in this.materialsInfo)this.create(e)}getIndex(e){return this.nameLookup[e]}getAsArray(){let e=0;for(const t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray}create(e){return this.materials[e]===void 0&&this.createMaterial_(e),this.materials[e]}createMaterial_(e){const t=this,i=this.materialsInfo[e],n={name:e,side:this.side};function s(r,A){return typeof A!="string"||A===""?"":/^https?:\/\//i.test(A)?A:r+A}function o(r,A){if(n[r])return;const l=t.getTextureParams(A,n),h=t.loadTexture(s(t.baseUrl,l.url));h.repeat.copy(l.scale),h.offset.copy(l.offset),h.wrapS=t.wrap,h.wrapT=t.wrap,(r==="map"||r==="emissiveMap")&&(h.colorSpace=a.SRGBColorSpace),n[r]=h}for(const r in i){const A=i[r];let l;if(A!=="")switch(r.toLowerCase()){case"kd":n.color=a.ColorManagement.colorSpaceToWorking(new a.Color().fromArray(A),a.SRGBColorSpace);break;case"ks":n.specular=a.ColorManagement.colorSpaceToWorking(new a.Color().fromArray(A),a.SRGBColorSpace);break;case"ke":n.emissive=a.ColorManagement.colorSpaceToWorking(new a.Color().fromArray(A),a.SRGBColorSpace);break;case"map_kd":o("map",A);break;case"map_ks":o("specularMap",A);break;case"map_ke":o("emissiveMap",A);break;case"norm":o("normalMap",A);break;case"map_bump":case"bump":o("bumpMap",A);break;case"disp":o("displacementMap",A);break;case"map_d":o("alphaMap",A),n.transparent=!0;break;case"ns":n.shininess=parseFloat(A);break;case"d":l=parseFloat(A),l<1&&(n.opacity=l,n.transparent=!0);break;case"tr":l=parseFloat(A),this.options&&this.options.invertTrProperty&&(l=1-l),l>0&&(n.opacity=1-l,n.transparent=!0);break}}return this.materials[e]=new a.MeshPhongMaterial(n),this.materials[e]}getTextureParams(e,t){const i={scale:new a.Vector2(1,1),offset:new a.Vector2(0,0)},n=e.split(/\s+/);let s;return s=n.indexOf("-bm"),s>=0&&(t.bumpScale=parseFloat(n[s+1]),n.splice(s,2)),s=n.indexOf("-mm"),s>=0&&(t.displacementBias=parseFloat(n[s+1]),t.displacementScale=parseFloat(n[s+2]),n.splice(s,3)),s=n.indexOf("-s"),s>=0&&(i.scale.set(parseFloat(n[s+1]),parseFloat(n[s+2])),n.splice(s,4)),s=n.indexOf("-o"),s>=0&&(i.offset.set(parseFloat(n[s+1]),parseFloat(n[s+2])),n.splice(s,4)),i.url=n.join(" ").trim(),i}loadTexture(e,t,i,n,s){const o=this.manager!==void 0?this.manager:a.DefaultLoadingManager;let r=o.getHandler(e);r===null&&(r=new a.TextureLoader(o)),r.setCrossOrigin&&r.setCrossOrigin(this.crossOrigin);const A=r.load(e,i,n,s);return t!==void 0&&(A.mapping=t),A}}const JA=/^[og]\s*(.+)?/,XA=/^mtllib /,WA=/^usemtl /,ZA=/^usemap /,Yi=/\s+/,Ji=new a.Vector3,_n=new a.Vector3,Xi=new a.Vector3,Wi=new a.Vector3,Ye=new a.Vector3,on=new a.Color;function $A(){const c={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&this.object.fromDeclaration===!1){this.object.name=e,this.object.fromDeclaration=t!==!1;return}const i=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:t!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(n,s){const o=this._finalize(!1);o&&(o.inherited||o.groupCount<=0)&&this.materials.splice(o.index,1);const r={index:this.materials.length,name:n||"",mtllib:Array.isArray(s)&&s.length>0?s[s.length-1]:"",smooth:o!==void 0?o.smooth:this.smooth,groupStart:o!==void 0?o.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(A){const l={index:typeof A=="number"?A:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return l.clone=this.clone.bind(l),l}};return this.materials.push(r),r},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(n){const s=this.currentMaterial();if(s&&s.groupEnd===-1&&(s.groupEnd=this.geometry.vertices.length/3,s.groupCount=s.groupEnd-s.groupStart,s.inherited=!1),n&&this.materials.length>1)for(let o=this.materials.length-1;o>=0;o--)this.materials[o].groupCount<=0&&this.materials.splice(o,1);return n&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),s}},i&&i.name&&typeof i.clone=="function"){const n=i.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,t){const i=parseInt(e,10);return(i>=0?i-1:i+t/3)*3},parseNormalIndex:function(e,t){const i=parseInt(e,10);return(i>=0?i-1:i+t/3)*3},parseUVIndex:function(e,t){const i=parseInt(e,10);return(i>=0?i-1:i+t/2)*2},addVertex:function(e,t,i){const n=this.vertices,s=this.object.geometry.vertices;s.push(n[e+0],n[e+1],n[e+2]),s.push(n[t+0],n[t+1],n[t+2]),s.push(n[i+0],n[i+1],n[i+2])},addVertexPoint:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,i){const n=this.normals,s=this.object.geometry.normals;s.push(n[e+0],n[e+1],n[e+2]),s.push(n[t+0],n[t+1],n[t+2]),s.push(n[i+0],n[i+1],n[i+2])},addFaceNormal:function(e,t,i){const n=this.vertices,s=this.object.geometry.normals;Ji.fromArray(n,e),_n.fromArray(n,t),Xi.fromArray(n,i),Ye.subVectors(Xi,_n),Wi.subVectors(Ji,_n),Ye.cross(Wi),Ye.normalize(),s.push(Ye.x,Ye.y,Ye.z),s.push(Ye.x,Ye.y,Ye.z),s.push(Ye.x,Ye.y,Ye.z)},addColor:function(e,t,i){const n=this.colors,s=this.object.geometry.colors;n[e]!==void 0&&s.push(n[e+0],n[e+1],n[e+2]),n[t]!==void 0&&s.push(n[t+0],n[t+1],n[t+2]),n[i]!==void 0&&s.push(n[i+0],n[i+1],n[i+2])},addUV:function(e,t,i){const n=this.uvs,s=this.object.geometry.uvs;s.push(n[e+0],n[e+1]),s.push(n[t+0],n[t+1]),s.push(n[i+0],n[i+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,i,n,s,o,r,A,l){const h=this.vertices.length;let p=this.parseVertexIndex(e,h),u=this.parseVertexIndex(t,h),f=this.parseVertexIndex(i,h);if(this.addVertex(p,u,f),this.addColor(p,u,f),r!==void 0&&r!==""){const b=this.normals.length;p=this.parseNormalIndex(r,b),u=this.parseNormalIndex(A,b),f=this.parseNormalIndex(l,b),this.addNormal(p,u,f)}else this.addFaceNormal(p,u,f);if(n!==void 0&&n!==""){const b=this.uvs.length;p=this.parseUVIndex(n,b),u=this.parseUVIndex(s,b),f=this.parseUVIndex(o,b),this.addUV(p,u,f),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const t=this.vertices.length;for(let i=0,n=e.length;i<n;i++){const s=this.parseVertexIndex(e[i],t);this.addVertexPoint(s),this.addColor(s)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";const i=this.vertices.length,n=this.uvs.length;for(let s=0,o=e.length;s<o;s++)this.addVertexLine(this.parseVertexIndex(e[s],i));for(let s=0,o=t.length;s<o;s++)this.addUVLine(this.parseUVIndex(t[s],n))}};return c.startObject("",!1),c}class ec extends a.Loader{constructor(e){super(e),this.materials=null,this.materialsLoader=new VA(e)}load(e,t,i,n){const s=this,o=new a.FileLoader(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,async function(r){try{const A=s.parse(r,!0);for(let l=0,h=A.materialLibraries.length;l<h;l++){const p=A.materialLibraries[l];if(!p||typeof p!="string"||p.trim()===""){console.warn("THREE.OBJLoader: Invalid or empty material library reference, skipping.");continue}const u=e.startsWith("blob:")?e+"/"+p:new URL(p,e);console.debug("Loading MTL file: "+u),await new Promise((f,b)=>{s.materialsLoader.load(u.toString(),m=>{s.setMaterials(m),f()},null,b)})}t(s.createObjects(A))}catch(A){n?n(A):console.error(A),s.manager.itemError(e)}},i,n)}setMTLLoader(e){return this.materialsLoader=e,this}setMaterials(e){return this.materials=e,this}parse(e,t=!1){const i=new $A;e.indexOf(`\r
|
|
461
443
|
`)!==-1&&(e=e.replace(/\r\n/g,`
|
|
462
444
|
`)),e.indexOf(`\\
|
|
463
445
|
`)!==-1&&(e=e.replace(/\\\n/g,""));const n=e.split(`
|
|
464
|
-
`);let
|
|
446
|
+
`);let s=[];for(let o=0,r=n.length;o<r;o++){const A=n[o].trimStart();if(A.length===0)continue;const l=A.charAt(0);if(l!=="#")if(l==="v"){const h=A.split(Yi);switch(h[0]){case"v":i.vertices.push(parseFloat(h[1]),parseFloat(h[2]),parseFloat(h[3])),h.length>=7?(on.setRGB(parseFloat(h[4]),parseFloat(h[5]),parseFloat(h[6]),a.SRGBColorSpace),i.colors.push(on.r,on.g,on.b)):i.colors.push(void 0,void 0,void 0);break;case"vn":i.normals.push(parseFloat(h[1]),parseFloat(h[2]),parseFloat(h[3]));break;case"vt":i.uvs.push(parseFloat(h[1]),parseFloat(h[2]));break}}else if(l==="f"){const p=A.slice(1).trim().split(Yi),u=[];for(let b=0,m=p.length;b<m;b++){const E=p[b];if(E.length>0){const B=E.split("/");u.push(B)}}const f=u[0];for(let b=1,m=u.length-1;b<m;b++){const E=u[b],B=u[b+1];i.addFace(f[0],E[0],B[0],f[1],E[1],B[1],f[2],E[2],B[2])}}else if(l==="l"){const h=A.substring(1).trim().split(" ");let p=[];const u=[];if(A.indexOf("/")===-1)p=h;else for(let f=0,b=h.length;f<b;f++){const m=h[f].split("/");m[0]!==""&&p.push(m[0]),m[1]!==""&&u.push(m[1])}i.addLineGeometry(p,u)}else if(l==="p"){const p=A.slice(1).trim().split(" ");i.addPointGeometry(p)}else if((s=JA.exec(A))!==null){const h=(" "+s[0].slice(1).trim()).slice(1);i.startObject(h)}else if(WA.test(A))i.object.startMaterial(A.substring(7).trim(),i.materialLibraries);else if(XA.test(A))i.materialLibraries.push(A.substring(7).trim());else if(ZA.test(A))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(l==="s"){if(s=A.split(" "),s.length>1){const p=s[1].trim().toLowerCase();i.object.smooth=p!=="0"&&p!=="off"}else i.object.smooth=!0;const h=i.object.currentMaterial();h&&(h.smooth=i.object.smooth)}else{if(A==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+A+'"')}}return i.finalize(),t?i:this.createObjects(i)}createObjects(e){const t=new a.Group;if(t.materialLibraries=[].concat(e.materialLibraries),!(e.objects.length===1&&e.objects[0].geometry.vertices.length===0)===!0)for(let n=0,s=e.objects.length;n<s;n++){const o=e.objects[n],r=o.geometry,A=o.materials,l=r.type==="Line",h=r.type==="Points";let p=!1;if(r.vertices.length===0)continue;const u=new a.BufferGeometry;u.setAttribute("position",new a.Float32BufferAttribute(r.vertices,3)),r.normals.length>0&&u.setAttribute("normal",new a.Float32BufferAttribute(r.normals,3)),r.colors.length>0&&(p=!0,u.setAttribute("color",new a.Float32BufferAttribute(r.colors,3))),r.hasUVIndices===!0&&u.setAttribute("uv",new a.Float32BufferAttribute(r.uvs,2));const f=[];for(let m=0,E=A.length;m<E;m++){const B=A[m],w=B.name+"_"+B.smooth+"_"+p;let C=e.materials[w];if(this.materials!==null){if(C=this.materials.create(B.name),l&&C&&!(C instanceof a.LineBasicMaterial)){const y=new a.LineBasicMaterial;a.Material.prototype.copy.call(y,C),y.color.copy(C.color),C=y}else if(h&&C&&!(C instanceof a.PointsMaterial)){const y=new a.PointsMaterial({size:10,sizeAttenuation:!1});a.Material.prototype.copy.call(y,C),y.color.copy(C.color),y.map=C.map,C=y}}C===void 0&&(l?C=new a.LineBasicMaterial:h?C=new a.PointsMaterial({size:1,sizeAttenuation:!1}):C=new a.MeshPhongMaterial,C.name=B.name,C.flatShading=!B.smooth,C.vertexColors=p,e.materials[w]=C),f.push(C)}let b;if(f.length>1){for(let m=0,E=A.length;m<E;m++){const B=A[m];u.addGroup(B.groupStart,B.groupCount,m)}l?b=new a.LineSegments(u,f):h?b=new a.Points(u,f):b=new a.Mesh(u,f)}else l?b=new a.LineSegments(u,f[0]):h?b=new a.Points(u,f[0]):b=new a.Mesh(u,f[0]);b.name=o.name,t.add(b)}else if(e.vertices.length>0){const n=new a.PointsMaterial({size:1,sizeAttenuation:!1}),s=new a.BufferGeometry;s.setAttribute("position",new a.Float32BufferAttribute(e.vertices,3)),e.colors.length>0&&e.colors[0]!==void 0&&(s.setAttribute("color",new a.Float32BufferAttribute(e.colors,3)),n.vertexColors=!0);const o=new a.Points(s,n);t.add(o)}return t}}class tc{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}new a.OrthographicCamera(-1,1,1,-1,0,1);class nc extends a.BufferGeometry{constructor(){super(),this.setAttribute("position",new a.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new a.Float32BufferAttribute([0,2,0,0,2,0],2))}}new nc;exports.DRACOLoader=Ba;exports.EXRLoader=or;exports.FBXLoader=kA;exports.Font=qs;exports.FontLoader=Ua;exports.GLTFExporter=Kt;exports.GLTFLoader=Kn;exports.GroundedSkybox=Po;exports.HDRLoader=ar;exports.HTMLMesh=CA;exports.HorizontalBlurShader=Rr;exports.InteractiveGroup=QA;exports.KTX2Loader=Xe;exports.Line2=IA;exports.LineGeometry=so;exports.LineMaterial=Wn;exports.MeshoptDecoder=Ca;exports.OBJLoader=ec;exports.OrbitControls=br;exports.Pass=tc;exports.PositionalAudioHelper=Dr;exports.Stats=qt;exports.TextGeometry=Ga;exports.TransformControls=rr;exports.TransformControlsGizmo=$s;exports.VertexNormalsHelper=xA;exports.VerticalBlurShader=Mr;exports.XRControllerModelFactory=uA;exports.XRHandMeshModel=dA;exports.mergeVertices=No;exports.nodeFrame=js;exports.strToU8=Hn;exports.zipSync=sr;
|