@needle-tools/engine 4.8.4 → 4.8.5-next.bce3b29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +5 -0
  3. package/dist/{gltf-progressive-PB_58h1b.umd.cjs → gltf-progressive-C-U_onhf.umd.cjs} +1 -1
  4. package/dist/{gltf-progressive-DorC035H.min.js → gltf-progressive-DViD_J_l.min.js} +1 -1
  5. package/dist/{gltf-progressive-B3JW4cAu.js → gltf-progressive-DXRy9EQz.js} +35 -35
  6. package/dist/loader.worker-CiTwpNPW.js +27 -0
  7. package/dist/{needle-engine.bundle-DnjGFnfL.js → needle-engine.bundle-CQrNatER.js} +6363 -6394
  8. package/dist/{needle-engine.bundle-F7Kw2jq3.min.js → needle-engine.bundle-DQ3xTXsS.min.js} +138 -139
  9. package/dist/{needle-engine.bundle-BWvmuHDE.umd.cjs → needle-engine.bundle-DWX1q4LF.umd.cjs} +134 -135
  10. package/dist/needle-engine.js +4 -4
  11. package/dist/needle-engine.min.js +1 -1
  12. package/dist/needle-engine.umd.cjs +1 -1
  13. package/dist/{postprocessing-BgC7XZwK.umd.cjs → postprocessing-61aXdqNz.umd.cjs} +1 -1
  14. package/dist/{postprocessing-ChsrvDkI.min.js → postprocessing-Be9Ds4NK.min.js} +1 -1
  15. package/dist/{postprocessing-DddlM3CK.js → postprocessing-D9jDHD0U.js} +2 -2
  16. package/dist/{three-DrqIzZTH.js → three-BRSLmpyi.js} +2966 -2958
  17. package/dist/{three-DuDKwKB8.min.js → three-CsmWHVn7.min.js} +172 -172
  18. package/dist/{three-B_hneGZr.umd.cjs → three-Dceyffus.umd.cjs} +176 -176
  19. package/dist/{three-examples-BIuXQPSf.js → three-examples-BihZ_R96.js} +2761 -2623
  20. package/dist/{three-examples-CNRuT27G.umd.cjs → three-examples-Ce6Th3bv.umd.cjs} +17 -17
  21. package/dist/three-examples-DKY9Nfge.min.js +501 -0
  22. package/dist/{three-mesh-ui-DWcMuyQ_.min.js → three-mesh-ui-Bwy12Qvg.min.js} +1 -1
  23. package/dist/{three-mesh-ui-tt0buEDC.umd.cjs → three-mesh-ui-Cdh2iW8b.umd.cjs} +1 -1
  24. package/dist/{three-mesh-ui-D6Mz5Yl7.js → three-mesh-ui-gqAXlGNB.js} +1 -1
  25. package/dist/{vendor-C31T0mYm.min.js → vendor-BRpzuoJE.min.js} +1 -1
  26. package/dist/{vendor-D51IT5ns.umd.cjs → vendor-Ja-vKV-a.umd.cjs} +1 -1
  27. package/dist/{vendor-B_ytQUuR.js → vendor-p_xp9KuJ.js} +1 -1
  28. package/lib/engine/debug/debug_console.js +3 -33
  29. package/lib/engine/debug/debug_console.js.map +1 -1
  30. package/lib/engine/engine_pmrem.d.ts +2 -0
  31. package/lib/engine/engine_pmrem.js +100 -0
  32. package/lib/engine/engine_pmrem.js.map +1 -0
  33. package/lib/engine-components/Camera.js +1 -1
  34. package/lib/engine-components/Camera.js.map +1 -1
  35. package/lib/engine-components/DragControls.js +0 -1
  36. package/lib/engine-components/DragControls.js.map +1 -1
  37. package/lib/engine-components/Duplicatable.js +5 -2
  38. package/lib/engine-components/Duplicatable.js.map +1 -1
  39. package/lib/engine-components/Skybox.d.ts +0 -2
  40. package/lib/engine-components/Skybox.js +26 -110
  41. package/lib/engine-components/Skybox.js.map +1 -1
  42. package/lib/engine-components/TransformGizmo.js +10 -2
  43. package/lib/engine-components/TransformGizmo.js.map +1 -1
  44. package/package.json +4 -4
  45. package/src/engine/debug/debug_console.ts +3 -33
  46. package/src/engine/engine_pmrem.ts +118 -0
  47. package/src/engine-components/Camera.ts +1 -1
  48. package/src/engine-components/DragControls.ts +0 -1
  49. package/src/engine-components/Duplicatable.ts +3 -2
  50. package/src/engine-components/Skybox.ts +30 -102
  51. package/src/engine-components/TransformGizmo.ts +11 -2
  52. package/src/include/ktx2/basis_transcoder.js +8 -10
  53. package/src/include/ktx2/basis_transcoder.wasm +0 -0
  54. package/dist/loader.worker-CrU5fNbR.js +0 -27
  55. package/dist/three-examples-D2zemuAM.min.js +0 -501
@@ -1,501 +0,0 @@
1
- import{Mesh as O,SphereGeometry as un,Vector3 as N,MeshBasicMaterial as It,Node as Ho,PerspectiveCamera as Hs,NodeFrame as jo,NodeBuilder as qo,GLSLNodeParser as zo,ShaderLib as Et,UniformsUtils as fn,UniformsLib as ms,normalView as Ko,defaultShaderStages as js,ShaderChunk as Yo,Material as Jt,TrianglesDrawMode as Jo,TriangleFanDrawMode as mn,TriangleStripDrawMode as yi,Matrix4 as oe,Loader as Dt,LoaderUtils as Vt,FileLoader as gt,MeshPhysicalMaterial as Ct,Vector2 as Fe,Color as Be,LinearSRGBColorSpace as We,SRGBColorSpace as re,SpotLight as Qi,PointLight as bn,DirectionalLight as vi,InstancedMesh as Vo,Quaternion as we,InstancedBufferAttribute as Wo,Object3D as Bt,TextureLoader as In,ImageBitmapLoader as Xo,BufferAttribute as nt,InterleavedBuffer as Zo,LinearMipmapLinearFilter as qs,NearestMipmapLinearFilter as xi,LinearMipmapNearestFilter as Si,NearestMipmapNearestFilter as Ti,LinearFilter as dt,NearestFilter as Ri,RepeatWrapping as Wt,MirroredRepeatWrapping as Di,ClampToEdgeWrapping as zs,PointsMaterial as bs,LineBasicMaterial as kt,MeshStandardMaterial as En,DoubleSide as Cn,PropertyBinding as pt,BufferGeometry as At,SkinnedMesh as Bn,LineSegments as Ks,Line as ut,LineLoop as $o,Points as Ys,Group as Xt,MathUtils as Ee,OrthographicCamera as ki,Skeleton as Mi,AnimationClip as wn,Bone as yn,InterpolateDiscrete as Qn,InterpolateLinear as Is,InterleavedBufferAttribute as Zt,Texture as vn,VectorKeyframeTrack as Js,NumberKeyframeTrack as Vs,QuaternionKeyframeTrack as Ws,ColorManagement as Xe,FrontSide as _i,Interpolant as er,Box3 as Xs,Sphere as xn,RGBA_S3TC_DXT1_Format as tr,RGB_PVRTC_4BPPV1_Format as sr,RGB_ETC2_Format as nr,RGB_ETC1_Format as ir,RGBA_S3TC_DXT5_Format as ar,RGBA_PVRTC_4BPPV1_Format as or,RGBA_ETC2_EAC_Format as rr,RGBA_BPTC_Format as Ar,RGBA_ASTC_4x4_Format as Fi,RGBAFormat as Pt,CompressedCubeTexture as cr,UnsignedByteType as ft,CompressedArrayTexture as lr,CompressedTexture as Es,DisplayP3ColorSpace as hr,LinearDisplayP3ColorSpace as gr,NoColorSpace as Zs,RGBA_ASTC_6x6_Format as Li,RedFormat as rs,RGFormat as Cs,HalfFloatType as it,FloatType as wt,DataTexture as dr,Data3DTexture as pr,ExtrudeGeometry as ur,ShapePath as fr,Raycaster as Sn,CylinderGeometry as Ze,BoxGeometry as Ye,Float32BufferAttribute as Te,OctahedronGeometry as $s,TorusGeometry as Bs,Euler as Ot,Controls as Ni,PlaneGeometry as Tn,DataTextureLoader as Ui,DataUtils as As,Vector4 as Mt,Curve as mr,MeshPhongMaterial as ws,MeshLambertMaterial as br,EquirectangularReflectionMapping as Ir,AmbientLight as Er,Uint16BufferAttribute as Cr,Matrix3 as Gi,ShapeUtils as Br,DefaultLoadingManager as wr,Ray as yr,Plane as Qr,MOUSE as cs,TOUCH as ls,Spherical as Pi,ShaderMaterial as Oi,Uniform$1 as vr,Scene as Rn,WebGLRenderer as xr,CanvasTexture as Hi,REVISION as Sr,Source as Tr,InstancedBufferGeometry as Rr,InstancedInterleavedBuffer as Dn,WireframeGeometry as Dr,Line3 as kr,ColorKeyframeTrack as Mr}from"./three-DuDKwKB8.min.js";class _r extends O{constructor(e,t,n,s=128){if(t<=0||n<=0||s<=0)throw new Error("GroundedSkybox height, radius, and resolution must be positive.");const i=new un(n,2*s,s);i.scale(1,1,-1);const a=i.getAttribute("position"),r=new N;for(let A=0;A<a.count;++A)if(r.fromBufferAttribute(a,A),r.y<0){const c=-t*3/2,l=r.y<c?-t/r.y:1-r.y*r.y/(3*c*c);r.multiplyScalar(l),r.toArray(a.array,3*A)}a.needsUpdate=!0,super(i,new It({map:e,depthWrite:!1}))}}class fe extends Ho{constructor(e){super(e.nodeType),this.node=null,this.source=null,this.target=null,this.inclusionType="replace",Object.assign(this,e)}generate(e){return this.node.build(e,this.getNodeType(e))}}const $e=new jo;$e.camera=new Hs;const ji={LineBasicNodeMaterial:Et.basic,MeshBasicNodeMaterial:Et.basic,PointsNodeMaterial:Et.points,MeshStandardNodeMaterial:Et.standard,MeshPhysicalNodeMaterial:Et.physical,MeshPhongNodeMaterial:Et.phong},Fr={atan2:"atan"},Lr={low:"lowp",medium:"mediump",high:"highp"};function Ht(o){return`#include <${o}>`}function ys(o){return`${o}Shader`}class Nr extends qo{constructor(e,t,n,s=null){super(e,t,new zo,null,s),this.shader=n,this.slots={vertex:[],fragment:[]},this._parseShaderLib(),this._parseInclude("fragment","lights_physical_fragment","clearcoat_normal_fragment_begin","transmission_fragment"),this._parseObject(),this._sortSlotsToFlow(),this.useComparisonMethod=!0}getMethod(e){return Fr[e]||e}addSlot(e,t){this.slots[e].push(t)}_parseShaderLib(){const e=this.material;let t=e.type;if(e.isMeshPhysicalNodeMaterial?t="MeshPhysicalNodeMaterial":e.isMeshStandardNodeMaterial?t="MeshStandardNodeMaterial":e.isMeshPhongNodeMaterial?t="MeshPhongNodeMaterial":e.isMeshBasicNodeMaterial?t="MeshBasicNodeMaterial":e.isPointsNodeMaterial?t="PointsNodeMaterial":e.isLineBasicNodeMaterial&&(t="LineBasicNodeMaterial"),ji[t]!==void 0){const n=ji[t],s=this.shader;s.vertexShader=n.vertexShader,s.fragmentShader=n.fragmentShader,s.uniforms=fn.merge([n.uniforms,ms.lights])}}_parseObject(){const{material:e,renderer:t}=this;this.addSlot("fragment",new fe({node:Ko,nodeType:"vec3",source:"void main() {",target:"vec3 TransformedNormalView = %RESULT%;",inclusionType:"append"})),t.toneMappingNode&&t.toneMappingNode.isNode===!0&&this.addSlot("fragment",new fe({node:e.colorNode,nodeType:"vec4",source:Ht("tonemapping_fragment"),target:""})),e.colorNode&&e.colorNode.isNode&&this.addSlot("fragment",new fe({node:e.colorNode,nodeType:"vec4",source:"vec4 diffuseColor = vec4( diffuse, opacity );",target:"vec4 diffuseColor = %RESULT%; diffuseColor.a *= opacity;"})),e.opacityNode&&e.opacityNode.isNode&&this.addSlot("fragment",new fe({node:e.opacityNode,nodeType:"float",source:Ht("alphatest_fragment"),target:"diffuseColor.a = %RESULT%;",inclusionType:"append"})),e.normalNode&&e.normalNode.isNode&&this.addSlot("fragment",new fe({node:e.normalNode,nodeType:"vec3",source:Ht("normal_fragment_begin"),target:"normal = %RESULT%;",inclusionType:"append"})),e.emissiveNode&&e.emissiveNode.isNode&&this.addSlot("fragment",new fe({node:e.emissiveNode,nodeType:"vec3",source:Ht("emissivemap_fragment"),target:"totalEmissiveRadiance = %RESULT%;",inclusionType:"append"})),e.isMeshStandardNodeMaterial&&(e.metalnessNode&&e.metalnessNode.isNode&&this.addSlot("fragment",new fe({node:e.metalnessNode,nodeType:"float",source:Ht("metalnessmap_fragment"),target:"metalnessFactor = %RESULT%;",inclusionType:"append"})),e.roughnessNode&&e.roughnessNode.isNode&&this.addSlot("fragment",new fe({node:e.roughnessNode,nodeType:"float",source:Ht("roughnessmap_fragment"),target:"roughnessFactor = %RESULT%;",inclusionType:"append"})),e.isMeshPhysicalNodeMaterial&&(e.clearcoatNode&&e.clearcoatNode.isNode?(this.addSlot("fragment",new fe({node:e.clearcoatNode,nodeType:"float",source:"material.clearcoat = clearcoat;",target:"material.clearcoat = %RESULT%;"})),e.clearcoatRoughnessNode&&e.clearcoatRoughnessNode.isNode&&this.addSlot("fragment",new fe({node:e.clearcoatRoughnessNode,nodeType:"float",source:"material.clearcoatRoughness = clearcoatRoughness;",target:"material.clearcoatRoughness = %RESULT%;"})),e.clearcoatNormalNode&&e.clearcoatNormalNode.isNode&&this.addSlot("fragment",new fe({node:e.clearcoatNormalNode,nodeType:"vec3",source:"vec3 clearcoatNormal = nonPerturbedNormal;",target:"vec3 clearcoatNormal = %RESULT%;"})),e.defines.USE_CLEARCOAT=""):delete e.defines.USE_CLEARCOAT,e.sheenNode&&e.sheenNode.isNode?(this.addSlot("fragment",new fe({node:e.sheenNode,nodeType:"vec3",source:"material.sheenColor = sheenColor;",target:"material.sheenColor = %RESULT%;"})),e.sheenRoughnessNode&&e.sheenRoughnessNode.isNode&&this.addSlot("fragment",new fe({node:e.sheenRoughnessNode,nodeType:"float",source:"material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );",target:"material.sheenRoughness = clamp( %RESULT%, 0.07, 1.0 );"})),e.defines.USE_SHEEN=""):delete e.defines.USE_SHEEN,e.iridescenceNode&&e.iridescenceNode.isNode?(this.addSlot("fragment",new fe({node:e.iridescenceNode,nodeType:"float",source:"material.iridescence = iridescence;",target:"material.iridescence = %RESULT%;"})),e.iridescenceIORNode&&e.iridescenceIORNode.isNode&&this.addSlot("fragment",new fe({node:e.iridescenceIORNode,nodeType:"float",source:"material.iridescenceIOR = iridescenceIOR;",target:"material.iridescenceIOR = %RESULT%;"})),e.iridescenceThicknessNode&&e.iridescenceThicknessNode.isNode&&this.addSlot("fragment",new fe({node:e.iridescenceThicknessNode,nodeType:"float",source:"material.iridescenceThickness = iridescenceThicknessMaximum;",target:"material.iridescenceThickness = %RESULT%;"})),e.defines.USE_IRIDESCENCE=""):delete e.defines.USE_IRIDESCENCE,e.iorNode&&e.iorNode.isNode&&this.addSlot("fragment",new fe({node:e.iorNode,nodeType:"float",source:"material.ior = ior;",target:"material.ior = %RESULT%;"})),e.specularColorNode&&e.specularColorNode.isNode&&this.addSlot("fragment",new fe({node:e.specularColorNode,nodeType:"vec3",source:"vec3 specularColorFactor = specularColor;",target:"vec3 specularColorFactor = %RESULT%;"})),e.specularIntensityNode&&e.specularIntensityNode.isNode&&this.addSlot("fragment",new fe({node:e.specularIntensityNode,nodeType:"float",source:"float specularIntensityFactor = specularIntensity;",target:"float specularIntensityFactor = %RESULT%;"})),e.transmissionNode&&e.transmissionNode.isNode?(this.addSlot("fragment",new fe({node:e.transmissionNode,nodeType:"float",source:"material.transmission = transmission;",target:"material.transmission = %RESULT%;"})),e.thicknessNode&&e.thicknessNode.isNode&&this.addSlot("fragment",new fe({node:e.thicknessNode,nodeType:"float",source:"material.thickness = thickness;",target:"material.thickness = %RESULT%;"})),e.attenuationDistanceNode&&e.attenuationDistanceNode.isNode&&this.addSlot("fragment",new fe({node:e.attenuationDistanceNode,nodeType:"float",source:"material.attenuationDistance = attenuationDistance;",target:"material.attenuationDistance = %RESULT%;"})),e.attenuationColorNode&&e.attenuationColorNode.isNode&&this.addSlot("fragment",new fe({node:e.attenuationColorNode,nodeType:"vec3",source:"material.attenuationColor = attenuationColor;",target:"material.attenuationColor = %RESULT%;"})),e.transmission=1,e.defines.USE_TRANSMISSION=""):(e.transmission=0,delete e.defines.USE_TRANSMISSION))),e.positionNode&&e.positionNode.isNode&&this.addSlot("vertex",new fe({node:e.positionNode,nodeType:"vec3",source:Ht("begin_vertex"),target:"transformed = %RESULT%;",inclusionType:"append"})),e.sizeNode&&e.sizeNode.isNode&&this.addSlot("vertex",new fe({node:e.sizeNode,nodeType:"float",source:"gl_PointSize = size;",target:"gl_PointSize = %RESULT%;"}))}generateTexture(e,t,n){return e.isTextureCube?`textureCube( ${t}, ${n} )`:`texture2D( ${t}, ${n} )`}generateTextureLevel(e,t,n,s){return`textureLod( ${t}, ${n}, ${s} )`}buildFunctionCode(e){const t=e.layout,n=this.flowShaderNode(e),s=[];for(const i of t.inputs)s.push(this.getType(i.type)+" "+i.name);return`${this.getType(t.type)} ${t.name}( ${s.join(", ")} ) {
2
-
3
- ${n.vars}
4
-
5
- ${n.code}
6
- return ${n.result};
7
-
8
- }`}getUniforms(e){const t=this.uniforms[e];let n="";for(const s of t){if(/^(modelViewMatrix|projectionMatrix)$/.test(s.name))continue;let i=null;s.type==="texture"?i=`sampler2D ${s.name}; `:s.type==="cubeTexture"?i=`samplerCube ${s.name}; `:i=`${this.getVectorType(s.type)} ${s.name}; `;const a=s.node.precision;a!==null?i="uniform "+Lr[a]+" "+i:i="uniform "+i,n+=i}return n}getAttributes(e){let t="";if(e==="vertex"){const n=this.attributes;for(const s of n)/^(position|normal|uv[1-3]?)$/.test(s.name)||(t+=`attribute ${s.type} ${s.name}; `)}return t}getVaryings(e){let t="";const n=this.varyings;if(e==="vertex")for(const s of n)t+=`${s.needsInterpolation?"varying":"/*varying*/"} ${s.type} ${s.name}; `;else if(e==="fragment")for(const s of n)s.needsInterpolation&&(t+=`varying ${s.type} ${s.name}; `);return t}addCode(e,t,n,s=this){const i=ys(e);let a=s[i];const r=a.indexOf(t);if(r!==-1){const A=a.substring(0,r+t.length),c=a.substring(r+t.length);a=`${A}
9
- ${n}
10
- ${c}`}s[i]=a}replaceCode(e,t,n,s=this){const i=ys(e);s[i]=s[i].replaceAll(t,n)}getVertexIndex(){return"gl_VertexID"}getFrontFacing(){return"gl_FrontFacing"}getFragCoord(){return"gl_FragCoord"}isFlipY(){return!0}buildCode(){const e={};for(const t of js){const n=this.getUniforms(t),s=this.getAttributes(t),i=this.getVaryings(t),a=this.getVars(t),r=this.getCodes(t);e[t]=`${this.getSignature()}
11
- // <node_builder>
12
-
13
- // uniforms
14
- ${n}
15
-
16
- // attributes
17
- ${s}
18
-
19
- // varyings
20
- ${i}
21
-
22
- // vars
23
- ${a}
24
-
25
- // codes
26
- ${r}
27
-
28
- // </node_builder>
29
-
30
- ${this.shader[ys(t)]}
31
- `}this.vertexShader=e.vertex,this.fragmentShader=e.fragment}build(){return super.build(!1),this._addSnippets(),this._addUniforms(),this._updateUniforms(),this.shader.vertexShader=this.vertexShader,this.shader.fragmentShader=this.fragmentShader,this}_parseInclude(e,...t){for(const n of t){const s=Ht(n),i=Yo[n],a=ys(e);this.shader[a]=this.shader[a].replaceAll(s,i)}}_sortSlotsToFlow(){for(const e of js){const t=this.shader[ys(e)],n=this.slots[e].sort((s,i)=>t.indexOf(s.source)>t.indexOf(i.source)?1:-1);for(const s of n)this.addFlow(e,s)}}_addSnippets(){for(const e of js){for(const t of this.slots[e]){const n=this.getFlowData(t),s=t.inclusionType,i=t.source,a=n.code+`
32
- `+t.target.replace("%RESULT%",n.result);s==="append"?this.addCode(e,i,a):s==="replace"?this.replaceCode(e,i,a):console.warn(`Inclusion type "${s}" not compatible.`)}this.addCode(e,"main() {",`
33
- `+this.flowCode[e])}}_addUniforms(){for(const e of js)for(const t of this.uniforms[e])this.shader.uniforms[t.name]=t}_updateUniforms(){$e.object=this.object,$e.renderer=this.renderer,$e.material=this.material,$e.scene=this.scene;for(const e of this.updateNodes)$e.updateNode(e)}}const qi=new WeakMap;Jt.prototype.onBuild=function(o,e,t){const n=this;if(n.isNodeMaterial===!0){let s;try{s=new Nr(o,t,e,n).build(),qi.set(n,s)}catch(i){console.error("Material.prototype.onBuild: ",i)}}},Jt.prototype.onBeforeRender=function(o,e,t,n,s){const i=qi.get(this);if(i!==void 0){$e.material=this,$e.camera=t,$e.object=s,$e.renderer=o,$e.scene=e,$e.geometry=n;const a=i.updateNodes;if(a.length>0){o.state.useProgram(null);for(const r of a)$e.updateNode(r)}}};var Qs=function(){var o=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(l){l.preventDefault(),n(++o%e.children.length)},!1);function t(l){return e.appendChild(l.dom),l}function n(l){for(var h=0;h<e.children.length;h++)e.children[h].style.display=h===l?"block":"none";o=l}var s=(performance||Date).now(),i=s,a=0,r=t(new Qs.Panel("FPS","#0ff","#002")),A=t(new Qs.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=t(new Qs.Panel("MB","#f08","#201"));return n(0),{REVISION:16,dom:e,addPanel:t,showPanel:n,begin:function(){s=(performance||Date).now()},end:function(){a++;var l=(performance||Date).now();if(A.update(l-s,200),l>=i+1e3&&(r.update(a*1e3/(l-i),100),i=l,a=0,c)){var h=performance.memory;c.update(h.usedJSHeapSize/1048576,h.jsHeapSizeLimit/1048576)}return l},update:function(){s=this.end()},domElement:e,setMode:n}};Qs.Panel=function(o,e,t){var n=1/0,s=0,i=Math.round,a=i(window.devicePixelRatio||1),r=80*a,A=48*a,c=3*a,l=2*a,h=3*a,d=15*a,p=74*a,f=30*a,b=document.createElement("canvas");b.width=r,b.height=A,b.style.cssText="width:80px;height:48px";var u=b.getContext("2d");return u.font="bold "+9*a+"px Helvetica,Arial,sans-serif",u.textBaseline="top",u.fillStyle=t,u.fillRect(0,0,r,A),u.fillStyle=e,u.fillText(o,c,l),u.fillRect(h,d,p,f),u.fillStyle=t,u.globalAlpha=.9,u.fillRect(h,d,p,f),{dom:b,update:function(I,C){n=Math.min(n,I),s=Math.max(s,I),u.fillStyle=t,u.globalAlpha=1,u.fillRect(0,0,r,d),u.fillStyle=e,u.fillText(i(I)+" "+o+" ("+i(n)+"-"+i(s)+")",c,l),u.drawImage(b,h+a,d,p-a,f,h,d,p-a,f),u.fillRect(h+p-a,d,a,f),u.fillStyle=t,u.globalAlpha=.9,u.fillRect(h+p-a,d,a,i((1-I/C)*f))}}};function Ur(o,e=1e-4){e=Math.max(e,Number.EPSILON);const t={},n=o.getIndex(),s=o.getAttribute("position"),i=n?n.count:s.count;let a=0;const r=Object.keys(o.attributes),A={},c={},l=[],h=["getX","getY","getZ","getW"],d=["setX","setY","setZ","setW"];for(let C=0,E=r.length;C<E;C++){const y=r[C],w=o.attributes[y];A[y]=new w.constructor(new w.array.constructor(w.count*w.itemSize),w.itemSize,w.normalized);const v=o.morphAttributes[y];v&&(c[y]||(c[y]=[]),v.forEach((T,S)=>{const M=new T.array.constructor(T.count*T.itemSize);c[y][S]=new T.constructor(M,T.itemSize,T.normalized)}))}const p=e*.5,f=Math.log10(1/e),b=Math.pow(10,f),u=p*b;for(let C=0;C<i;C++){const E=n?n.getX(C):C;let y="";for(let w=0,v=r.length;w<v;w++){const T=r[w],S=o.getAttribute(T),M=S.itemSize;for(let j=0;j<M;j++)y+=`${~~(S[h[j]](E)*b+u)},`}if(y in t)l.push(t[y]);else{for(let w=0,v=r.length;w<v;w++){const T=r[w],S=o.getAttribute(T),M=o.morphAttributes[T],j=S.itemSize,z=A[T],J=c[T];for(let Z=0;Z<j;Z++){const Y=h[Z],$=d[Z];if(z[$](a,S[Y](E)),M)for(let W=0,V=M.length;W<V;W++)J[W][$](a,M[W][Y](E))}}t[y]=a,l.push(a),a++}}const I=o.clone();for(const C in o.attributes){const E=A[C];if(I.setAttribute(C,new E.constructor(E.array.slice(0,a*E.itemSize),E.itemSize,E.normalized)),C in c)for(let y=0;y<c[C].length;y++){const w=c[C][y];I.morphAttributes[C][y]=new w.constructor(w.array.slice(0,a*w.itemSize),w.itemSize,w.normalized)}}return I.setIndex(l),I}function zi(o,e){if(e===Jo)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),o;if(e===mn||e===yi){let t=o.getIndex();if(t===null){const a=[],r=o.getAttribute("position");if(r!==void 0){for(let A=0;A<r.count;A++)a.push(A);o.setIndex(a),t=o.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),o}const n=t.count-2,s=[];if(e===mn)for(let a=1;a<=n;a++)s.push(t.getX(0)),s.push(t.getX(a)),s.push(t.getX(a+1));else for(let a=0;a<n;a++)a%2===0?(s.push(t.getX(a)),s.push(t.getX(a+1)),s.push(t.getX(a+2))):(s.push(t.getX(a+2)),s.push(t.getX(a+1)),s.push(t.getX(a)));s.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const i=o.clone();return i.setIndex(s),i.clearGroups(),i}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),o}class kn extends Dt{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new jr(t)}),this.register(function(t){return new qr(t)}),this.register(function(t){return new $r(t)}),this.register(function(t){return new eA(t)}),this.register(function(t){return new tA(t)}),this.register(function(t){return new Kr(t)}),this.register(function(t){return new Yr(t)}),this.register(function(t){return new Jr(t)}),this.register(function(t){return new Vr(t)}),this.register(function(t){return new Hr(t)}),this.register(function(t){return new Wr(t)}),this.register(function(t){return new zr(t)}),this.register(function(t){return new Zr(t)}),this.register(function(t){return new Xr(t)}),this.register(function(t){return new Pr(t)}),this.register(function(t){return new sA(t)}),this.register(function(t){return new nA(t)})}load(e,t,n,s){const i=this;let a;if(this.resourcePath!=="")a=this.resourcePath;else if(this.path!==""){const c=Vt.extractUrlBase(e);a=Vt.resolveURL(c,this.path)}else a=Vt.extractUrlBase(e);this.manager.itemStart(e);const r=function(c){s?s(c):console.error(c),i.manager.itemError(e),i.manager.itemEnd(e)},A=new gt(this.manager);A.setPath(this.path),A.setResponseType("arraybuffer"),A.setRequestHeader(this.requestHeader),A.setWithCredentials(this.withCredentials),A.load(e,function(c){try{i.parse(c,a,function(l){t(l),i.manager.itemEnd(e)},r)}catch(l){r(l)}},n,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,n,s){let i,a;const r={},A={},c=new TextDecoder;if(typeof e=="string")try{i=JSON.parse(e)}catch(h){a=e,s&&s(h);return}else if(e instanceof ArrayBuffer)if(c.decode(new Uint8Array(e,0,4))===Ki){try{r[ne.KHR_BINARY_GLTF]=new iA(e)}catch(h){s&&s(h);return}try{i=JSON.parse(r[ne.KHR_BINARY_GLTF].content)}catch(h){a=r[ne.KHR_BINARY_GLTF].content,s&&s(h);return}}else try{i=JSON.parse(c.decode(e))}catch(h){a=c.decode(e),s&&s(h);return}else i=e;if(i.asset===void 0||i.asset.version[0]<2){s&&s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}this.json=i,this.jsonErrorData=a;const l=new mA(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let h=0;h<this.pluginCallbacks.length;h++){const d=this.pluginCallbacks[h](l);d.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),A[d.name]=d,r[d.name]=!0}if(i.extensionsUsed)for(let h=0;h<i.extensionsUsed.length;++h){const d=i.extensionsUsed[h],p=i.extensionsRequired||[];switch(d){case ne.KHR_MATERIALS_UNLIT:r[d]=new Or;break;case ne.KHR_DRACO_MESH_COMPRESSION:r[d]=new aA(i,this.dracoLoader);break;case ne.KHR_TEXTURE_TRANSFORM:r[d]=new oA;break;case ne.KHR_MESH_QUANTIZATION:r[d]=new rA;break;default:p.indexOf(d)>=0&&A[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}l.setExtensions(r),l.setPlugins(A),l.parse(n,s)}parseAsync(e,t){const n=this;return new Promise(function(s,i){n.parse(e,t,s,i)})}}function Gr(){let o={};return{get:function(e){return o[e]},add:function(e,t){o[e]=t},remove:function(e){delete o[e]},removeAll:function(){o={}}}}const ne={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 Pr{constructor(e){this.parser=e,this.name=ne.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,s=t.length;n<s;n++){const i=t[n];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,n="light:"+e;let s=t.cache.get(n);if(s)return s;const i=t.json,a=((i.extensions&&i.extensions[this.name]||{}).lights||[])[e];let r;const A=new Be(16777215);a.color!==void 0&&A.setRGB(a.color[0],a.color[1],a.color[2],We);const c=a.range!==void 0?a.range:0;switch(a.type){case"directional":r=new vi(A),r.target.position.set(0,0,-1),r.add(r.target);break;case"point":r=new bn(A),r.distance=c;break;case"spot":r=new Qi(A),r.distance=c,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,r.angle=a.spot.outerConeAngle,r.penumbra=1-a.spot.innerConeAngle/a.spot.outerConeAngle,r.target.position.set(0,0,-1),r.add(r.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+a.type)}return r.position.set(0,0,0),r.decay=2,_t(r,a),a.intensity!==void 0&&(r.intensity=a.intensity),r.name=t.createUniqueName(a.name||"light_"+e),s=Promise.resolve(r),t.cache.add(n,s),s}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,s=n.json.nodes[e],i=(s.extensions&&s.extensions[this.name]||{}).light;return i===void 0?null:this._loadLight(i).then(function(a){return n._getNodeRef(t.cache,i,a)})}}let Or=class{constructor(){this.name=ne.KHR_MATERIALS_UNLIT}getMaterialType(){return It}extendParams(o,e,t){const n=[];o.color=new Be(1,1,1),o.opacity=1;const s=e.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const i=s.baseColorFactor;o.color.setRGB(i[0],i[1],i[2],We),o.opacity=i[3]}s.baseColorTexture!==void 0&&n.push(t.assignTexture(o,"map",s.baseColorTexture,re))}return Promise.all(n)}},Hr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(o,e){const t=this.parser.json.materials[o];if(!t.extensions||!t.extensions[this.name])return Promise.resolve();const n=t.extensions[this.name].emissiveStrength;return n!==void 0&&(e.emissiveIntensity=n),Promise.resolve()}},jr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_CLEARCOAT}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:Ct}extendMaterialParams(o,e){const t=this.parser,n=t.json.materials[o];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],i=n.extensions[this.name];if(i.clearcoatFactor!==void 0&&(e.clearcoat=i.clearcoatFactor),i.clearcoatTexture!==void 0&&s.push(t.assignTexture(e,"clearcoatMap",i.clearcoatTexture)),i.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=i.clearcoatRoughnessFactor),i.clearcoatRoughnessTexture!==void 0&&s.push(t.assignTexture(e,"clearcoatRoughnessMap",i.clearcoatRoughnessTexture)),i.clearcoatNormalTexture!==void 0&&(s.push(t.assignTexture(e,"clearcoatNormalMap",i.clearcoatNormalTexture)),i.clearcoatNormalTexture.scale!==void 0)){const a=i.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new Fe(a,a)}return Promise.all(s)}},qr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_DISPERSION}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:Ct}extendMaterialParams(o,e){const t=this.parser.json.materials[o];if(!t.extensions||!t.extensions[this.name])return Promise.resolve();const n=t.extensions[this.name];return e.dispersion=n.dispersion!==void 0?n.dispersion:0,Promise.resolve()}},zr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_IRIDESCENCE}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:Ct}extendMaterialParams(o,e){const t=this.parser,n=t.json.materials[o];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],i=n.extensions[this.name];return i.iridescenceFactor!==void 0&&(e.iridescence=i.iridescenceFactor),i.iridescenceTexture!==void 0&&s.push(t.assignTexture(e,"iridescenceMap",i.iridescenceTexture)),i.iridescenceIor!==void 0&&(e.iridescenceIOR=i.iridescenceIor),e.iridescenceThicknessRange===void 0&&(e.iridescenceThicknessRange=[100,400]),i.iridescenceThicknessMinimum!==void 0&&(e.iridescenceThicknessRange[0]=i.iridescenceThicknessMinimum),i.iridescenceThicknessMaximum!==void 0&&(e.iridescenceThicknessRange[1]=i.iridescenceThicknessMaximum),i.iridescenceThicknessTexture!==void 0&&s.push(t.assignTexture(e,"iridescenceThicknessMap",i.iridescenceThicknessTexture)),Promise.all(s)}},Kr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_SHEEN}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:Ct}extendMaterialParams(o,e){const t=this.parser,n=t.json.materials[o];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[];e.sheenColor=new Be(0,0,0),e.sheenRoughness=0,e.sheen=1;const i=n.extensions[this.name];if(i.sheenColorFactor!==void 0){const a=i.sheenColorFactor;e.sheenColor.setRGB(a[0],a[1],a[2],We)}return i.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=i.sheenRoughnessFactor),i.sheenColorTexture!==void 0&&s.push(t.assignTexture(e,"sheenColorMap",i.sheenColorTexture,re)),i.sheenRoughnessTexture!==void 0&&s.push(t.assignTexture(e,"sheenRoughnessMap",i.sheenRoughnessTexture)),Promise.all(s)}},Yr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_TRANSMISSION}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:Ct}extendMaterialParams(o,e){const t=this.parser,n=t.json.materials[o];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],i=n.extensions[this.name];return i.transmissionFactor!==void 0&&(e.transmission=i.transmissionFactor),i.transmissionTexture!==void 0&&s.push(t.assignTexture(e,"transmissionMap",i.transmissionTexture)),Promise.all(s)}},Jr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_VOLUME}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:Ct}extendMaterialParams(o,e){const t=this.parser,n=t.json.materials[o];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],i=n.extensions[this.name];e.thickness=i.thicknessFactor!==void 0?i.thicknessFactor:0,i.thicknessTexture!==void 0&&s.push(t.assignTexture(e,"thicknessMap",i.thicknessTexture)),e.attenuationDistance=i.attenuationDistance||1/0;const a=i.attenuationColor||[1,1,1];return e.attenuationColor=new Be().setRGB(a[0],a[1],a[2],We),Promise.all(s)}},Vr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_IOR}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:Ct}extendMaterialParams(o,e){const t=this.parser.json.materials[o];if(!t.extensions||!t.extensions[this.name])return Promise.resolve();const n=t.extensions[this.name];return e.ior=n.ior!==void 0?n.ior:1.5,Promise.resolve()}},Wr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_SPECULAR}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:Ct}extendMaterialParams(o,e){const t=this.parser,n=t.json.materials[o];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],i=n.extensions[this.name];e.specularIntensity=i.specularFactor!==void 0?i.specularFactor:1,i.specularTexture!==void 0&&s.push(t.assignTexture(e,"specularIntensityMap",i.specularTexture));const a=i.specularColorFactor||[1,1,1];return e.specularColor=new Be().setRGB(a[0],a[1],a[2],We),i.specularColorTexture!==void 0&&s.push(t.assignTexture(e,"specularColorMap",i.specularColorTexture,re)),Promise.all(s)}},Xr=class{constructor(o){this.parser=o,this.name=ne.EXT_MATERIALS_BUMP}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:Ct}extendMaterialParams(o,e){const t=this.parser,n=t.json.materials[o];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],i=n.extensions[this.name];return e.bumpScale=i.bumpFactor!==void 0?i.bumpFactor:1,i.bumpTexture!==void 0&&s.push(t.assignTexture(e,"bumpMap",i.bumpTexture)),Promise.all(s)}},Zr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_ANISOTROPY}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:Ct}extendMaterialParams(o,e){const t=this.parser,n=t.json.materials[o];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const s=[],i=n.extensions[this.name];return i.anisotropyStrength!==void 0&&(e.anisotropy=i.anisotropyStrength),i.anisotropyRotation!==void 0&&(e.anisotropyRotation=i.anisotropyRotation),i.anisotropyTexture!==void 0&&s.push(t.assignTexture(e,"anisotropyMap",i.anisotropyTexture)),Promise.all(s)}};class $r{constructor(e){this.parser=e,this.name=ne.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,s=n.textures[e];if(!s.extensions||!s.extensions[this.name])return null;const i=s.extensions[this.name],a=t.options.ktx2Loader;if(!a){if(n.extensionsRequired&&n.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,a)}}class eA{constructor(e){this.parser=e,this.name=ne.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,s=n.json,i=s.textures[e];if(!i.extensions||!i.extensions[t])return null;const a=i.extensions[t],r=s.images[a.source];let A=n.textureLoader;if(r.uri){const c=n.options.manager.getHandler(r.uri);c!==null&&(A=c)}return this.detectSupport().then(function(c){if(c)return n.loadTextureImage(e,a.source,A);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.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 tA{constructor(e){this.parser=e,this.name=ne.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,s=n.json,i=s.textures[e];if(!i.extensions||!i.extensions[t])return null;const a=i.extensions[t],r=s.images[a.source];let A=n.textureLoader;if(r.uri){const c=n.options.manager.getHandler(r.uri);c!==null&&(A=c)}return this.detectSupport().then(function(c){if(c)return n.loadTextureImage(e,a.source,A);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.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 sA{constructor(e){this.name=ne.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const s=n.extensions[this.name],i=this.parser.getDependency("buffer",s.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.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(r){const A=s.byteOffset||0,c=s.byteLength||0,l=s.count,h=s.byteStride,d=new Uint8Array(r,A,c);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(l,h,d,s.mode,s.filter).then(function(p){return p.buffer}):a.ready.then(function(){const p=new ArrayBuffer(l*h);return a.decodeGltfBuffer(new Uint8Array(p),l,h,d,s.mode,s.filter),p})})}else return null}}let nA=class{constructor(o){this.name=ne.EXT_MESH_GPU_INSTANCING,this.parser=o}createNodeMesh(o){const e=this.parser.json,t=e.nodes[o];if(!t.extensions||!t.extensions[this.name]||t.mesh===void 0)return null;const n=e.meshes[t.mesh];for(const r of n.primitives)if(r.mode!==ct.TRIANGLES&&r.mode!==ct.TRIANGLE_STRIP&&r.mode!==ct.TRIANGLE_FAN&&r.mode!==void 0)return null;const s=t.extensions[this.name].attributes,i=[],a={};for(const r in s)i.push(this.parser.getDependency("accessor",s[r]).then(A=>(a[r]=A,a[r])));return i.length<1?null:(i.push(this.parser.createNodeMesh(o)),Promise.all(i).then(r=>{const A=r.pop(),c=A.isGroup?A.children:[A],l=r[0].count,h=[];for(const d of c){const p=new oe,f=new N,b=new we,u=new N(1,1,1),I=new Vo(d.geometry,d.material,l);for(let C=0;C<l;C++)a.TRANSLATION&&f.fromBufferAttribute(a.TRANSLATION,C),a.ROTATION&&b.fromBufferAttribute(a.ROTATION,C),a.SCALE&&u.fromBufferAttribute(a.SCALE,C),I.setMatrixAt(C,p.compose(f,b,u));for(const C in a)if(C==="_COLOR_0"){const E=a[C];I.instanceColor=new Wo(E.array,E.itemSize,E.normalized)}else C!=="TRANSLATION"&&C!=="ROTATION"&&C!=="SCALE"&&d.geometry.setAttribute(C,a[C]);Bt.prototype.copy.call(I,d),this.parser.assignFinalMaterial(I),h.push(I)}return A.isGroup?(A.clear(),A.add(...h),A):h[0]}))}};const Ki="glTF",vs=12,Yi={JSON:1313821514,BIN:5130562};class iA{constructor(e){this.name=ne.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,vs),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==Ki)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const s=this.header.length-vs,i=new DataView(e,vs);let a=0;for(;a<s;){const r=i.getUint32(a,!0);a+=4;const A=i.getUint32(a,!0);if(a+=4,A===Yi.JSON){const c=new Uint8Array(e,vs+a,r);this.content=n.decode(c)}else if(A===Yi.BIN){const c=vs+a;this.body=e.slice(c,c+r)}a+=r}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class aA{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=ne.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,s=this.dracoLoader,i=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,r={},A={},c={};for(const l in a){const h=_n[l]||l.toLowerCase();r[h]=a[l]}for(const l in e.attributes){const h=_n[l]||l.toLowerCase();if(a[l]!==void 0){const d=n.accessors[e.attributes[l]],p=hs[d.componentType];c[h]=p.name,A[h]=d.normalized===!0}}return t.getDependency("bufferView",i).then(function(l){return new Promise(function(h,d){s.decodeDracoFile(l,function(p){for(const f in p.attributes){const b=p.attributes[f],u=A[f];u!==void 0&&(b.normalized=u)}h(p)},r,c,We,d)})})}}class oA{constructor(){this.name=ne.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 rA{constructor(){this.name=ne.KHR_MESH_QUANTIZATION}}class Ji extends er{constructor(e,t,n,s){super(e,t,n,s)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,s=this.valueSize,i=e*s*3+s;for(let a=0;a!==s;a++)t[a]=n[i+a];return t}interpolate_(e,t,n,s){const i=this.resultBuffer,a=this.sampleValues,r=this.valueSize,A=r*2,c=r*3,l=s-t,h=(n-t)/l,d=h*h,p=d*h,f=e*c,b=f-c,u=-2*p+3*d,I=p-d,C=1-u,E=I-d+h;for(let y=0;y!==r;y++){const w=a[b+y+r],v=a[b+y+A]*l,T=a[f+y+r],S=a[f+y]*l;i[y]=C*w+E*v+u*T+I*S}return i}}const AA=new we;class cA extends Ji{interpolate_(e,t,n,s){const i=super.interpolate_(e,t,n,s);return AA.fromArray(i).normalize().toArray(i),i}}const ct={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},hs={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Vi={9728:Ri,9729:dt,9984:Ti,9985:Si,9986:xi,9987:qs},Wi={33071:zs,33648:Di,10497:Wt},Mn={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},_n={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"},jt={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},lA={CUBICSPLINE:void 0,LINEAR:Is,STEP:Qn},Fn={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function hA(o){return o.DefaultMaterial===void 0&&(o.DefaultMaterial=new En({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:_i})),o.DefaultMaterial}function $t(o,e,t){for(const n in t.extensions)o[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function _t(o,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(o.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function gA(o,e,t){let n=!1,s=!1,i=!1;for(let c=0,l=e.length;c<l;c++){const h=e[c];if(h.POSITION!==void 0&&(n=!0),h.NORMAL!==void 0&&(s=!0),h.COLOR_0!==void 0&&(i=!0),n&&s&&i)break}if(!n&&!s&&!i)return Promise.resolve(o);const a=[],r=[],A=[];for(let c=0,l=e.length;c<l;c++){const h=e[c];if(n){const d=h.POSITION!==void 0?t.getDependency("accessor",h.POSITION):o.attributes.position;a.push(d)}if(s){const d=h.NORMAL!==void 0?t.getDependency("accessor",h.NORMAL):o.attributes.normal;r.push(d)}if(i){const d=h.COLOR_0!==void 0?t.getDependency("accessor",h.COLOR_0):o.attributes.color;A.push(d)}}return Promise.all([Promise.all(a),Promise.all(r),Promise.all(A)]).then(function(c){const l=c[0],h=c[1],d=c[2];return n&&(o.morphAttributes.position=l),s&&(o.morphAttributes.normal=h),i&&(o.morphAttributes.color=d),o.morphTargetsRelative=!0,o})}function dA(o,e){if(o.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)o.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(o.morphTargetInfluences.length===t.length){o.morphTargetDictionary={};for(let n=0,s=t.length;n<s;n++)o.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function pA(o){let e;const t=o.extensions&&o.extensions[ne.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+Ln(t.attributes):e=o.indices+":"+Ln(o.attributes)+":"+o.mode,o.targets!==void 0)for(let n=0,s=o.targets.length;n<s;n++)e+=":"+Ln(o.targets[n]);return e}function Ln(o){let e="";const t=Object.keys(o).sort();for(let n=0,s=t.length;n<s;n++)e+=t[n]+":"+o[t[n]]+";";return e}function Nn(o){switch(o){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 uA(o){return o.search(/\.jpe?g($|\?)/i)>0||o.search(/^data\:image\/jpeg/)===0?"image/jpeg":o.search(/\.webp($|\?)/i)>0||o.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const fA=new oe;class mA{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Gr,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 n=!1,s=-1,i=!1,a=-1;if(typeof navigator<"u"){const r=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(r)===!0;const A=r.match(/Version\/(\d+)/);s=n&&A?parseInt(A[1],10):-1,i=r.indexOf("Firefox")>-1,a=i?r.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&s<17||i&&a<98?this.textureLoader=new In(this.options.manager):this.textureLoader=new Xo(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new gt(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 n=this,s=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(a){return a._markDefs&&a._markDefs()}),Promise.all(this._invokeAll(function(a){return a.beforeRoot&&a.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(a){const r={scene:a[0][s.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:s.asset,parser:n,userData:{}};return $t(i,r,s),_t(r,s),Promise.all(n._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||[],n=this.json.meshes||[];for(let s=0,i=t.length;s<i;s++){const a=t[s].joints;for(let r=0,A=a.length;r<A;r++)e[a[r]].isBone=!0}for(let s=0,i=e.length;s<i;s++){const a=e[s];a.mesh!==void 0&&(this._addNodeRef(this.meshCache,a.mesh),a.skin!==void 0&&(n[a.mesh].isSkinnedMesh=!0)),a.camera!==void 0&&this._addNodeRef(this.cameraCache,a.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,n){if(e.refs[t]<=1)return n;const s=n.clone(),i=(a,r)=>{const A=this.associations.get(a);A!=null&&this.associations.set(r,A);for(const[c,l]of a.children.entries())i(l,r.children[c])};return i(n,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const s=e(t[n]);if(s)return s}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let s=0;s<t.length;s++){const i=e(t[s]);i&&n.push(i)}return n}getDependency(e,t){const n=e+":"+t;let s=this.cache.get(n);if(!s){switch(e){case"scene":s=this.loadScene(t);break;case"node":s=this._invokeOne(function(i){return i.loadNode&&i.loadNode(t)});break;case"mesh":s=this._invokeOne(function(i){return i.loadMesh&&i.loadMesh(t)});break;case"accessor":s=this.loadAccessor(t);break;case"bufferView":s=this._invokeOne(function(i){return i.loadBufferView&&i.loadBufferView(t)});break;case"buffer":s=this.loadBuffer(t);break;case"material":s=this._invokeOne(function(i){return i.loadMaterial&&i.loadMaterial(t)});break;case"texture":s=this._invokeOne(function(i){return i.loadTexture&&i.loadTexture(t)});break;case"skin":s=this.loadSkin(t);break;case"animation":s=this._invokeOne(function(i){return i.loadAnimation&&i.loadAnimation(t)});break;case"camera":s=this.loadCamera(t);break;default:if(s=this._invokeOne(function(i){return i!=this&&i.getDependency&&i.getDependency(e,t)}),!s)throw new Error("Unknown type: "+e);break}this.cache.add(n,s)}return s}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,s=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(s.map(function(i,a){return n.getDependency(e,a)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=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[ne.KHR_BINARY_GLTF].body);const s=this.options;return new Promise(function(i,a){n.load(Vt.resolveURL(t.uri,s.path),i,void 0,function(){a(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(n){const s=t.byteLength||0,i=t.byteOffset||0;return n.slice(i,i+s)})}loadAccessor(e){const t=this,n=this.json,s=this.json.accessors[e];if(s.bufferView===void 0&&s.sparse===void 0){const a=Mn[s.type],r=hs[s.componentType],A=s.normalized===!0,c=new r(s.count*a);return Promise.resolve(new nt(c,a,A))}const i=[];return s.bufferView!==void 0?i.push(this.getDependency("bufferView",s.bufferView)):i.push(null),s.sparse!==void 0&&(i.push(this.getDependency("bufferView",s.sparse.indices.bufferView)),i.push(this.getDependency("bufferView",s.sparse.values.bufferView))),Promise.all(i).then(function(a){const r=a[0],A=Mn[s.type],c=hs[s.componentType],l=c.BYTES_PER_ELEMENT,h=l*A,d=s.byteOffset||0,p=s.bufferView!==void 0?n.bufferViews[s.bufferView].byteStride:void 0,f=s.normalized===!0;let b,u;if(p&&p!==h){const I=Math.floor(d/p),C="InterleavedBuffer:"+s.bufferView+":"+s.componentType+":"+I+":"+s.count;let E=t.cache.get(C);E||(b=new c(r,I*p,s.count*p/l),E=new Zo(b,p/l),t.cache.add(C,E)),u=new Zt(E,A,d%p/l,f)}else r===null?b=new c(s.count*A):b=new c(r,d,s.count*A),u=new nt(b,A,f);if(s.sparse!==void 0){const I=Mn.SCALAR,C=hs[s.sparse.indices.componentType],E=s.sparse.indices.byteOffset||0,y=s.sparse.values.byteOffset||0,w=new C(a[1],E,s.sparse.count*I),v=new c(a[2],y,s.sparse.count*A);r!==null&&(u=new nt(u.array.slice(),u.itemSize,u.normalized)),u.normalized=!1;for(let T=0,S=w.length;T<S;T++){const M=w[T];if(u.setX(M,v[T*A]),A>=2&&u.setY(M,v[T*A+1]),A>=3&&u.setZ(M,v[T*A+2]),A>=4&&u.setW(M,v[T*A+3]),A>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}u.normalized=f}return u})}loadTexture(e){const t=this.json,n=this.options,s=t.textures[e].source,i=t.images[s];let a=this.textureLoader;if(i.uri){const r=n.manager.getHandler(i.uri);r!==null&&(a=r)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,n){const s=this,i=this.json,a=i.textures[e],r=i.images[t],A=(r.uri||r.bufferView)+":"+a.sampler;if(this.textureCache[A])return this.textureCache[A];const c=this.loadImageSource(t,n).then(function(l){l.flipY=!1,l.name=a.name||r.name||"",l.name===""&&typeof r.uri=="string"&&r.uri.startsWith("data:image/")===!1&&(l.name=r.uri);const h=(i.samplers||{})[a.sampler]||{};return l.magFilter=Vi[h.magFilter]||dt,l.minFilter=Vi[h.minFilter]||qs,l.wrapS=Wi[h.wrapS]||Wt,l.wrapT=Wi[h.wrapT]||Wt,l.anisotropy=4,s.associations.set(l,{textures:e}),l}).catch(function(){return null});return this.textureCache[A]=c,c}loadImageSource(e,t){const n=this,s=this.json,i=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(h=>h.clone());const a=s.images[e],r=self.URL||self.webkitURL;let A=a.uri||"",c=!1;if(a.bufferView!==void 0)A=n.getDependency("bufferView",a.bufferView).then(function(h){c=!0;const d=new Blob([h],{type:a.mimeType});return A=r.createObjectURL(d),A});else if(a.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const l=Promise.resolve(A).then(function(h){return new Promise(function(d,p){let f=d;t.isImageBitmapLoader===!0&&(f=function(b){const u=new vn(b);u.needsUpdate=!0,d(u)}),t.load(Vt.resolveURL(h,i.path),f,void 0,p)})}).then(function(h){return c===!0&&r.revokeObjectURL(A),_t(h,a),h.userData.mimeType=a.mimeType||uA(a.uri),h}).catch(function(h){throw console.error("THREE.GLTFLoader: Couldn't load texture",A),h});return this.sourceCache[e]=l,l}assignTexture(e,t,n,s){const i=this;return this.getDependency("texture",n.index).then(function(a){if(!a)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(a=a.clone(),a.channel=n.texCoord),i.extensions[ne.KHR_TEXTURE_TRANSFORM]){const r=n.extensions!==void 0?n.extensions[ne.KHR_TEXTURE_TRANSFORM]:void 0;if(r){const A=i.associations.get(a);a=i.extensions[ne.KHR_TEXTURE_TRANSFORM].extendTexture(a,r),i.associations.set(a,A)}}return s!==void 0&&(a.colorSpace=s),e[t]=a,a})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const s=t.attributes.tangent===void 0,i=t.attributes.color!==void 0,a=t.attributes.normal===void 0;if(e.isPoints){const r="PointsMaterial:"+n.uuid;let A=this.cache.get(r);A||(A=new bs,Jt.prototype.copy.call(A,n),A.color.copy(n.color),A.map=n.map,A.sizeAttenuation=!1,this.cache.add(r,A)),n=A}else if(e.isLine){const r="LineBasicMaterial:"+n.uuid;let A=this.cache.get(r);A||(A=new kt,Jt.prototype.copy.call(A,n),A.color.copy(n.color),A.map=n.map,this.cache.add(r,A)),n=A}if(s||i||a){let r="ClonedMaterial:"+n.uuid+":";s&&(r+="derivative-tangents:"),i&&(r+="vertex-colors:"),a&&(r+="flat-shading:");let A=this.cache.get(r);A||(A=n.clone(),i&&(A.vertexColors=!0),a&&(A.flatShading=!0),s&&(A.normalScale&&(A.normalScale.y*=-1),A.clearcoatNormalScale&&(A.clearcoatNormalScale.y*=-1)),this.cache.add(r,A),this.associations.set(A,this.associations.get(n))),n=A}e.material=n}getMaterialType(){return En}loadMaterial(e){const t=this,n=this.json,s=this.extensions,i=n.materials[e];let a;const r={},A=i.extensions||{},c=[];if(A[ne.KHR_MATERIALS_UNLIT]){const h=s[ne.KHR_MATERIALS_UNLIT];a=h.getMaterialType(),c.push(h.extendParams(r,i,t))}else{const h=i.pbrMetallicRoughness||{};if(r.color=new Be(1,1,1),r.opacity=1,Array.isArray(h.baseColorFactor)){const d=h.baseColorFactor;r.color.setRGB(d[0],d[1],d[2],We),r.opacity=d[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(r,"map",h.baseColorTexture,re)),r.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,r.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(r,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(r,"roughnessMap",h.metallicRoughnessTexture))),a=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,r)})))}i.doubleSided===!0&&(r.side=Cn);const l=i.alphaMode||Fn.OPAQUE;if(l===Fn.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,l===Fn.MASK&&(r.alphaTest=i.alphaCutoff!==void 0?i.alphaCutoff:.5)),i.normalTexture!==void 0&&a!==It&&(c.push(t.assignTexture(r,"normalMap",i.normalTexture)),r.normalScale=new Fe(1,1),i.normalTexture.scale!==void 0)){const h=i.normalTexture.scale;r.normalScale.set(h,h)}if(i.occlusionTexture!==void 0&&a!==It&&(c.push(t.assignTexture(r,"aoMap",i.occlusionTexture)),i.occlusionTexture.strength!==void 0&&(r.aoMapIntensity=i.occlusionTexture.strength)),i.emissiveFactor!==void 0&&a!==It){const h=i.emissiveFactor;r.emissive=new Be().setRGB(h[0],h[1],h[2],We)}return i.emissiveTexture!==void 0&&a!==It&&c.push(t.assignTexture(r,"emissiveMap",i.emissiveTexture,re)),Promise.all(c).then(function(){const h=new a(r);return i.name&&(h.name=i.name),_t(h,i),t.associations.set(h,{materials:e}),i.extensions&&$t(s,h,i),h})}createUniqueName(e){const t=pt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,s=this.primitiveCache;function i(r){return n[ne.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(r,t).then(function(A){return Xi(A,r,t)})}const a=[];for(let r=0,A=e.length;r<A;r++){const c=e[r],l=pA(c),h=s[l];if(h)a.push(h.promise);else{let d;c.extensions&&c.extensions[ne.KHR_DRACO_MESH_COMPRESSION]?d=i(c):d=Xi(new At,c,t),s[l]={primitive:c,promise:d},a.push(d)}}return Promise.all(a)}loadMesh(e){const t=this,n=this.json,s=this.extensions,i=n.meshes[e],a=i.primitives,r=[];for(let A=0,c=a.length;A<c;A++){const l=a[A].material===void 0?hA(this.cache):this.getDependency("material",a[A].material);r.push(l)}return r.push(t.loadGeometries(a)),Promise.all(r).then(function(A){const c=A.slice(0,A.length-1),l=A[A.length-1],h=[];for(let p=0,f=l.length;p<f;p++){const b=l[p],u=a[p];let I;const C=c[p];if(u.mode===ct.TRIANGLES||u.mode===ct.TRIANGLE_STRIP||u.mode===ct.TRIANGLE_FAN||u.mode===void 0)I=i.isSkinnedMesh===!0?new Bn(b,C):new O(b,C),I.isSkinnedMesh===!0&&I.normalizeSkinWeights(),u.mode===ct.TRIANGLE_STRIP?I.geometry=zi(I.geometry,yi):u.mode===ct.TRIANGLE_FAN&&(I.geometry=zi(I.geometry,mn));else if(u.mode===ct.LINES)I=new Ks(b,C);else if(u.mode===ct.LINE_STRIP)I=new ut(b,C);else if(u.mode===ct.LINE_LOOP)I=new $o(b,C);else if(u.mode===ct.POINTS)I=new Ys(b,C);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+u.mode);Object.keys(I.geometry.morphAttributes).length>0&&dA(I,i),I.name=t.createUniqueName(i.name||"mesh_"+e),_t(I,i),u.extensions&&$t(s,I,u),t.assignFinalMaterial(I),h.push(I)}for(let p=0,f=h.length;p<f;p++)t.associations.set(h[p],{meshes:e,primitives:p});if(h.length===1)return i.extensions&&$t(s,h[0],i),h[0];const d=new Xt;i.extensions&&$t(s,d,i),t.associations.set(d,{meshes:e});for(let p=0,f=h.length;p<f;p++)d.add(h[p]);return d})}loadCamera(e){let t;const n=this.json.cameras[e],s=n[n.type];if(!s){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new Hs(Ee.radToDeg(s.yfov),s.aspectRatio||1,s.znear||1,s.zfar||2e6):n.type==="orthographic"&&(t=new ki(-s.xmag,s.xmag,s.ymag,-s.ymag,s.znear,s.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),_t(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let s=0,i=t.joints.length;s<i;s++)n.push(this._loadNodeShallow(t.joints[s]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(s){const i=s.pop(),a=s,r=[],A=[];for(let c=0,l=a.length;c<l;c++){const h=a[c];if(h){r.push(h);const d=new oe;i!==null&&d.fromArray(i.array,c*16),A.push(d)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[c])}return new Mi(r,A)})}loadAnimation(e){const t=this.json,n=this,s=t.animations[e],i=s.name?s.name:"animation_"+e,a=[],r=[],A=[],c=[],l=[];let h=0,d=s.channels.length;for(h=0,d=s.channels.length;h<d;h++){const p=s.channels[h],f=s.samplers[p.sampler],b=p.target,u=b.node,I=s.parameters!==void 0?s.parameters[f.input]:f.input,C=s.parameters!==void 0?s.parameters[f.output]:f.output;b.node!==void 0&&(a.push(this.getDependency("node",u)),r.push(this.getDependency("accessor",I)),A.push(this.getDependency("accessor",C)),c.push(f),l.push(b))}return Promise.all([Promise.all(a),Promise.all(r),Promise.all(A),Promise.all(c),Promise.all(l)]).then(function(p){const f=p[0],b=p[1],u=p[2],I=p[3],C=p[4],E=[];for(h=0,d=f.length;h<d;h++){const y=f[h],w=b[h],v=u[h],T=I[h],S=C[h];if(y===void 0)continue;y.updateMatrix&&y.updateMatrix();const M=n._createAnimationTracks(y,w,v,T,S);if(M)for(let j=0;j<M.length;j++)E.push(M[j])}return new wn(i,void 0,E)})}createNodeMesh(e){const t=this.json,n=this,s=t.nodes[e];return s.mesh===void 0?null:n.getDependency("mesh",s.mesh).then(function(i){const a=n._getNodeRef(n.meshCache,s.mesh,i);return s.weights!==void 0&&a.traverse(function(r){if(r.isMesh)for(let A=0,c=s.weights.length;A<c;A++)r.morphTargetInfluences[A]=s.weights[A]}),a})}loadNode(e){const t=this.json,n=this,s=t.nodes[e],i=n._loadNodeShallow(e),a=[],r=s.children||[];for(let c=0,l=r.length;c<l;c++)a.push(n.getDependency("node",r[c]));const A=s.skin===void 0?Promise.resolve(null):n.getDependency("skin",s.skin);return Promise.all([i,Promise.all(a),A]).then(function(c){const l=c[0],h=c[1],d=c[2];d!==null&&l.traverse(function(p){p.isSkinnedMesh&&p.bind(d,fA)});for(let p=0,f=h.length;p<f;p++)l.add(h[p]);return l})}_loadNodeShallow(e){const t=this.json,n=this.extensions,s=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const i=t.nodes[e],a=i.name?s.createUniqueName(i.name):"",r=[],A=s._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});return A&&r.push(A),i.camera!==void 0&&r.push(s.getDependency("camera",i.camera).then(function(c){return s._getNodeRef(s.cameraCache,i.camera,c)})),s._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(e)}).forEach(function(c){r.push(c)}),this.nodeCache[e]=Promise.all(r).then(function(c){let l;if(i.isBone===!0?l=new yn:c.length>1?l=new Xt:c.length===1?l=c[0]:l=new Bt,l!==c[0])for(let h=0,d=c.length;h<d;h++)l.add(c[h]);if(i.name&&(l.userData.name=i.name,l.name=a),_t(l,i),i.extensions&&$t(n,l,i),i.matrix!==void 0){const h=new oe;h.fromArray(i.matrix),l.applyMatrix4(h)}else i.translation!==void 0&&l.position.fromArray(i.translation),i.rotation!==void 0&&l.quaternion.fromArray(i.rotation),i.scale!==void 0&&l.scale.fromArray(i.scale);return s.associations.has(l)||s.associations.set(l,{}),s.associations.get(l).nodes=e,l}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],s=this,i=new Xt;n.name&&(i.name=s.createUniqueName(n.name)),_t(i,n),n.extensions&&$t(t,i,n);const a=n.nodes||[],r=[];for(let A=0,c=a.length;A<c;A++)r.push(s.getDependency("node",a[A]));return Promise.all(r).then(function(A){for(let l=0,h=A.length;l<h;l++)i.add(A[l]);const c=l=>{const h=new Map;for(const[d,p]of s.associations)(d instanceof Jt||d instanceof vn)&&h.set(d,p);return l.traverse(d=>{const p=s.associations.get(d);p!=null&&h.set(d,p)}),h};return s.associations=c(i),i})}_createAnimationTracks(e,t,n,s,i){const a=[],r=e.name?e.name:e.uuid,A=[];jt[i.path]===jt.weights?e.traverse(function(d){d.morphTargetInfluences&&A.push(d.name?d.name:d.uuid)}):A.push(r);let c;switch(jt[i.path]){case jt.weights:c=Vs;break;case jt.rotation:c=Ws;break;case jt.position:case jt.scale:c=Js;break;default:switch(n.itemSize){case 1:c=Vs;break;case 2:case 3:default:c=Js;break}break}const l=s.interpolation!==void 0?lA[s.interpolation]:Is,h=this._getArrayFromAccessor(n);for(let d=0,p=A.length;d<p;d++){const f=new c(A[d]+"."+jt[i.path],t.array,h,l);s.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(f),a.push(f)}return a}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=Nn(t.constructor),s=new Float32Array(t.length);for(let i=0,a=t.length;i<a;i++)s[i]=t[i]*n;t=s}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(t){const n=this instanceof Ws?cA:Ji;return new n(this.times,this.values,this.getValueSize()/3,t)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function bA(o,e,t){const n=e.attributes,s=new Xs;if(n.POSITION!==void 0){const r=t.json.accessors[n.POSITION],A=r.min,c=r.max;if(A!==void 0&&c!==void 0){if(s.set(new N(A[0],A[1],A[2]),new N(c[0],c[1],c[2])),r.normalized){const l=Nn(hs[r.componentType]);s.min.multiplyScalar(l),s.max.multiplyScalar(l)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const i=e.targets;if(i!==void 0){const r=new N,A=new N;for(let c=0,l=i.length;c<l;c++){const h=i[c];if(h.POSITION!==void 0){const d=t.json.accessors[h.POSITION],p=d.min,f=d.max;if(p!==void 0&&f!==void 0){if(A.setX(Math.max(Math.abs(p[0]),Math.abs(f[0]))),A.setY(Math.max(Math.abs(p[1]),Math.abs(f[1]))),A.setZ(Math.max(Math.abs(p[2]),Math.abs(f[2]))),d.normalized){const b=Nn(hs[d.componentType]);A.multiplyScalar(b)}r.max(A)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}s.expandByVector(r)}o.boundingBox=s;const a=new xn;s.getCenter(a.center),a.radius=s.min.distanceTo(s.max)/2,o.boundingSphere=a}function Xi(o,e,t){const n=e.attributes,s=[];function i(a,r){return t.getDependency("accessor",a).then(function(A){o.setAttribute(r,A)})}for(const a in n){const r=_n[a]||a.toLowerCase();r in o.attributes||s.push(i(n[a],r))}if(e.indices!==void 0&&!o.index){const a=t.getDependency("accessor",e.indices).then(function(r){o.setIndex(r)});s.push(a)}return Xe.workingColorSpace!==We&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Xe.workingColorSpace}" not supported.`),_t(o,e),bA(o,e,t),Promise.all(s).then(function(){return e.targets!==void 0?gA(o,e.targets,t):o})}var IA=function(){var o="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]),n=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 s=WebAssembly.validate(t)?e:o,i,a=WebAssembly.instantiate(r(s),{}).then(function(I){i=I.instance,i.exports.__wasm_call_ctors()});function r(I){for(var C=new Uint8Array(I.length),E=0;E<I.length;++E){var y=I.charCodeAt(E);C[E]=y>96?y-97:y>64?y-39:y+4}for(var w=0,E=0;E<I.length;++E)C[w++]=C[E]<60?n[C[E]]:(C[E]-60)*64+C[++E];return C.buffer.slice(0,w)}function A(I,C,E,y,w,v){var T=i.exports.sbrk,S=E+3&-4,M=T(S*y),j=T(w.length),z=new Uint8Array(i.exports.memory.buffer);z.set(w,j);var J=I(M,E,y,j,w.length);if(J==0&&v&&v(M,S,y),C.set(z.subarray(M,M+E*y)),T(M-T(0)),J!=0)throw new Error("Malformed buffer data: "+J)}var c={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},l={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},h=[],d=0;function p(I){var C={object:new Worker(I),pending:0,requests:{}};return C.object.onmessage=function(E){var y=E.data;C.pending-=y.count,C.requests[y.id][y.action](y.value),delete C.requests[y.id]},C}function f(I){for(var C="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(r(s))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+A.toString()+u.toString(),E=new Blob([C],{type:"text/javascript"}),y=URL.createObjectURL(E),w=0;w<I;++w)h[w]=p(y);URL.revokeObjectURL(y)}function b(I,C,E,y,w){for(var v=h[0],T=1;T<h.length;++T)h[T].pending<v.pending&&(v=h[T]);return new Promise(function(S,M){var j=new Uint8Array(E),z=d++;v.pending+=I,v.requests[z]={resolve:S,reject:M},v.object.postMessage({id:z,count:I,size:C,source:j,mode:y,filter:w},[j.buffer])})}function u(I){a.then(function(){var C=I.data;try{var E=new Uint8Array(C.count*C.size);A(i.exports[C.mode],E,C.count,C.size,C.source,i.exports[C.filter]),self.postMessage({id:C.id,count:C.count,action:"resolve",value:E},[E.buffer])}catch(y){self.postMessage({id:C.id,count:C.count,action:"reject",value:y})}})}return{ready:a,supported:!0,useWorkers:function(I){f(I)},decodeVertexBuffer:function(I,C,E,y,w){A(i.exports.meshopt_decodeVertexBuffer,I,C,E,y,i.exports[c[w]])},decodeIndexBuffer:function(I,C,E,y){A(i.exports.meshopt_decodeIndexBuffer,I,C,E,y)},decodeIndexSequence:function(I,C,E,y){A(i.exports.meshopt_decodeIndexSequence,I,C,E,y)},decodeGltfBuffer:function(I,C,E,y,w,v){A(i.exports[l[w]],I,C,E,y,i.exports[c[v]])},decodeGltfBufferAsync:function(I,C,E,y,w){return h.length>0?b(I,C,E,l[y],c[w]):a.then(function(){var v=new Uint8Array(I*C);return A(i.exports[l[y]],v,I,C,E,i.exports[c[w]]),v})}}}();const Un=new WeakMap;class EA extends Dt{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,n,s){const i=new gt(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,a=>{this.parse(a,t,s)},n,s)}parse(e,t,n=()=>{}){this.decodeDracoFile(e,t,null,null,re,n).catch(n)}decodeDracoFile(e,t,n,s,i=We,a=()=>{}){const r={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:i};return this.decodeGeometry(e,r).then(t).catch(a)}decodeGeometry(e,t){const n=JSON.stringify(t);if(Un.has(e)){const A=Un.get(e);if(A.key===n)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 s;const i=this.workerNextTaskID++,a=e.byteLength,r=this._getWorker(i,a).then(A=>(s=A,new Promise((c,l)=>{s._callbacks[i]={resolve:c,reject:l},s.postMessage({type:"decode",id:i,taskConfig:t,buffer:e},[e])}))).then(A=>this._createGeometry(A.geometry));return r.catch(()=>!0).then(()=>{s&&i&&this._releaseTask(s,i)}),Un.set(e,{key:n,promise:r}),r}_createGeometry(e){const t=new At;e.index&&t.setIndex(new nt(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const s=e.attributes[n],i=s.name,a=s.array,r=s.itemSize,A=new nt(a,r);i==="color"&&(this._assignVertexColorSpace(A,s.vertexColorSpace),A.normalized=!(a instanceof Float32Array)),t.setAttribute(i,A)}return t}_assignVertexColorSpace(e,t){if(t!==re)return;const n=new Be;for(let s=0,i=e.count;s<i;s++)n.fromBufferAttribute(e,s),Xe.toWorkingColorSpace(n,re),e.setXYZ(s,n.r,n.g,n.b)}_loadLibrary(e,t){const n=new gt(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((s,i)=>{n.load(e,s,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(n=>{const s=n[0];e||(this.decoderConfig.wasmBinary=n[1]);const i=CA.toString(),a=["/* draco decoder */",s,"","/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join(`
34
- `);this.workerSourceURL=URL.createObjectURL(new Blob([a]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const s=new Worker(this.workerSourceURL);s._callbacks={},s._taskCosts={},s._taskLoad=0,s.postMessage({type:"init",decoderConfig:this.decoderConfig}),s.onmessage=function(i){const a=i.data;switch(a.type){case"decode":s._callbacks[a.id].resolve(a);break;case"error":s._callbacks[a.id].reject(a);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+a.type+'"')}},this.workerPool.push(s)}else this.workerPool.sort(function(s,i){return s._taskLoad>i._taskLoad?-1:1});const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_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 CA(){let o,e;onmessage=function(a){const r=a.data;switch(r.type){case"init":o=r.decoderConfig,e=new Promise(function(l){o.onModuleLoaded=function(h){l({draco:h})},DracoDecoderModule(o)});break;case"decode":const A=r.buffer,c=r.taskConfig;e.then(l=>{const h=l.draco,d=new h.Decoder;try{const p=t(h,d,new Int8Array(A),c),f=p.attributes.map(b=>b.array.buffer);p.index&&f.push(p.index.array.buffer),self.postMessage({type:"decode",id:r.id,geometry:p},f)}catch(p){console.error(p),self.postMessage({type:"error",id:r.id,error:p.message})}finally{h.destroy(d)}});break}};function t(a,r,A,c){const l=c.attributeIDs,h=c.attributeTypes;let d,p;const f=r.GetEncodedGeometryType(A);if(f===a.TRIANGULAR_MESH)d=new a.Mesh,p=r.DecodeArrayToMesh(A,A.byteLength,d);else if(f===a.POINT_CLOUD)d=new a.PointCloud,p=r.DecodeArrayToPointCloud(A,A.byteLength,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!p.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+p.error_msg());const b={index:null,attributes:[]};for(const u in l){const I=self[h[u]];let C,E;if(c.useUniqueIDs)E=l[u],C=r.GetAttributeByUniqueId(d,E);else{if(E=r.GetAttributeId(d,a[l[u]]),E===-1)continue;C=r.GetAttribute(d,E)}const y=s(a,r,d,u,I,C);u==="color"&&(y.vertexColorSpace=c.vertexColorSpace),b.attributes.push(y)}return f===a.TRIANGULAR_MESH&&(b.index=n(a,r,d)),a.destroy(d),b}function n(a,r,A){const c=A.num_faces()*3,l=c*4,h=a._malloc(l);r.GetTrianglesUInt32Array(A,l,h);const d=new Uint32Array(a.HEAPF32.buffer,h,c).slice();return a._free(h),{array:d,itemSize:1}}function s(a,r,A,c,l,h){const d=h.num_components(),p=A.num_points()*d,f=p*l.BYTES_PER_ELEMENT,b=i(a,l),u=a._malloc(f);r.GetAttributeDataArrayForAllPoints(A,h,b,f,u);const I=new l(a.HEAPF32.buffer,u,p).slice();return a._free(u),{name:c,array:I,itemSize:d}}function i(a,r){switch(r){case Float32Array:return a.DT_FLOAT32;case Int8Array:return a.DT_INT8;case Int16Array:return a.DT_INT16;case Int32Array:return a.DT_INT32;case Uint8Array:return a.DT_UINT8;case Uint16Array:return a.DT_UINT16;case Uint32Array:return a.DT_UINT32}}}class BA{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 n=this.workersResolve[e];if(n&&n(t),this.queue.length){const{resolve:s,msg:i,transfer:a}=this.queue.shift();this.workersResolve[e]=s,this.workers[e].postMessage(i,a)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(n=>{const s=this._getIdleWorker();s!==-1?(this._initWorker(s),this.workerStatus|=1<<s,this.workersResolve[s]=n,this.workers[s].postMessage(e,t)):this.queue.push({resolve:n,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 wA=0,Zi=2,yA=1,$i=2,QA=0,vA=1,xA=10,SA=0,ea=9,ta=15,sa=16,na=22,ia=37,aa=43,oa=76,ra=83,Aa=97,ca=100,la=103,ha=109,ga=165,da=166,pa=1000066e3;class TA{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize: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:[]}],this.keyValue={},this.globalData=null}}class xs{constructor(e,t,n,s){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=s,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){t===void 0&&(t=0);const n=this._offset;let s=0;for(;this._dataView.getUint8(this._offset)!==t&&s<e;)s++,this._offset++;return s<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,s)}}const Je=[171,75,84,88,32,50,48,187,13,10,26,10];function ua(o){return new TextDecoder().decode(o)}function RA(o){const e=new Uint8Array(o.buffer,o.byteOffset,Je.length);if(e[0]!==Je[0]||e[1]!==Je[1]||e[2]!==Je[2]||e[3]!==Je[3]||e[4]!==Je[4]||e[5]!==Je[5]||e[6]!==Je[6]||e[7]!==Je[7]||e[8]!==Je[8]||e[9]!==Je[9]||e[10]!==Je[10]||e[11]!==Je[11])throw new Error("Missing KTX 2.0 identifier.");const t=new TA,n=17*Uint32Array.BYTES_PER_ELEMENT,s=new xs(o,Je.length,n,!0);t.vkFormat=s._nextUint32(),t.typeSize=s._nextUint32(),t.pixelWidth=s._nextUint32(),t.pixelHeight=s._nextUint32(),t.pixelDepth=s._nextUint32(),t.layerCount=s._nextUint32(),t.faceCount=s._nextUint32();const i=s._nextUint32();t.supercompressionScheme=s._nextUint32();const a=s._nextUint32(),r=s._nextUint32(),A=s._nextUint32(),c=s._nextUint32(),l=s._nextUint64(),h=s._nextUint64(),d=new xs(o,Je.length+n,3*i*8,!0);for(let V=0;V<i;V++)t.levels.push({levelData:new Uint8Array(o.buffer,o.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});const p=new xs(o,a,r,!0),f={vendorId:p._skip(4)._nextUint16(),descriptorType:p._nextUint16(),versionNumber:p._nextUint16(),descriptorBlockSize:p._nextUint16(),colorModel:p._nextUint8(),colorPrimaries:p._nextUint8(),transferFunction:p._nextUint8(),flags:p._nextUint8(),texelBlockDimension:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],bytesPlane:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],samples:[]},b=(f.descriptorBlockSize/4-6)/4;for(let V=0;V<b;V++){const X={bitOffset:p._nextUint16(),bitLength:p._nextUint8(),channelType:p._nextUint8(),samplePosition:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&X.channelType?(X.sampleLower=p._nextInt32(),X.sampleUpper=p._nextInt32()):(X.sampleLower=p._nextUint32(),X.sampleUpper=p._nextUint32()),f.samples[V]=X}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(f);const u=new xs(o,A,c,!0);for(;u._offset<c;){const V=u._nextUint32(),X=u._scan(V),le=ua(X);if(t.keyValue[le]=u._nextUint8Array(V-X.byteLength-1),le.match(/^ktx/i)){const be=ua(t.keyValue[le]);t.keyValue[le]=be.substring(0,be.lastIndexOf("\0"))}u._skip(V%4?4-V%4:0)}if(h<=0)return t;const I=new xs(o,l,h,!0),C=I._nextUint16(),E=I._nextUint16(),y=I._nextUint32(),w=I._nextUint32(),v=I._nextUint32(),T=I._nextUint32(),S=[];for(let V=0;V<i;V++)S.push({imageFlags:I._nextUint32(),rgbSliceByteOffset:I._nextUint32(),rgbSliceByteLength:I._nextUint32(),alphaSliceByteOffset:I._nextUint32(),alphaSliceByteLength:I._nextUint32()});const M=l+I._offset,j=M+y,z=j+w,J=z+v,Z=new Uint8Array(o.buffer,o.byteOffset+M,y),Y=new Uint8Array(o.buffer,o.byteOffset+j,w),$=new Uint8Array(o.buffer,o.byteOffset+z,v),W=new Uint8Array(o.buffer,o.byteOffset+J,T);return t.globalData={endpointCount:C,selectorCount:E,imageDescs:S,endpointsData:Z,selectorsData:Y,tablesData:$,extendedData:W},t}let Gn,Ft,Pn;const On={env:{emscripten_notify_memory_growth:function(o){Pn=new Uint8Array(Ft.exports.memory.buffer)}}};class DA{init(){return Gn||(Gn=typeof fetch<"u"?fetch("data:application/wasm;base64,"+fa).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,On)).then(this._init):WebAssembly.instantiate(Buffer.from(fa,"base64"),On).then(this._init),Gn)}_init(e){Ft=e.instance,On.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!Ft)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,s=Ft.exports.malloc(n);Pn.set(e,s),t=t||Number(Ft.exports.ZSTD_findDecompressedSize(s,n));const i=Ft.exports.malloc(t),a=Ft.exports.ZSTD_decompress(i,t,s,n),r=Pn.slice(i,i+a);return Ft.exports.free(s),Ft.exports.free(i),r}}const fa="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/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAg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YCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQ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tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQ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Ai0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0Eo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wEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBC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gJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQ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BAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/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",Hn=new WeakMap;let jn=0,qn;class Tt extends Dt{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new BA,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"),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"),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"),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 gt(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new gt(this.manager);n.setPath(this.transcoderPath),n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials);const s=n.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,s]).then(([i,a])=>{const r=Tt.BasisWorker.toString(),A=["/* constants */","let _EngineFormat = "+JSON.stringify(Tt.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(Tt.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(Tt.BasisFormat),"/* basis_transcoder.js */",i,"/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join(`
35
- `);this.workerSourceURL=URL.createObjectURL(new Blob([A])),this.transcoderBinary=a,this.workerPool.setWorkerCreator(()=>{const c=new Worker(this.workerSourceURL),l=this.transcoderBinary.slice(0);return c.postMessage({type:"init",config:this.workerConfig,transcoderBinary:l},[l]),c})}),jn>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),jn++}return this.transcoderPending}load(e,t,n,s){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const i=new gt(this.manager);i.setResponseType("arraybuffer"),i.setWithCredentials(this.withCredentials),i.load(e,a=>{this.parse(a,t,s)},n,s)}parse(e,t,n){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(Hn.has(e))return Hn.get(e).promise.then(t).catch(n);this._createTexture(e).then(s=>t?t(s):null).catch(n)}_createTextureFrom(e,t){const{faces:n,width:s,height:i,format:a,type:r,error:A,dfdFlags:c}=e;if(r==="error")return Promise.reject(A);let l;if(t.faceCount===6)l=new cr(n,a,ft);else{const h=n[0].mipmaps;l=t.layerCount>1?new lr(h,s,i,t.layerCount,a,ft):new Es(h,s,i,a,ft)}return l.minFilter=n[0].mipmaps.length===1?dt:qs,l.magFilter=dt,l.generateMipmaps=!1,l.needsUpdate=!0,l.colorSpace=ma(t),l.premultiplyAlpha=!!(c&yA),l}async _createTexture(e,t={}){const n=RA(new Uint8Array(e));if(n.vkFormat!==SA)return MA(n);const s=t,i=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:s},[e])).then(a=>this._createTextureFrom(a.data,n));return Hn.set(e,{promise:i}),i}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),jn--,this}}Tt.BasisFormat={ETC1S:0,UASTC_4x4:1},Tt.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},Tt.EngineFormat={RGBAFormat:Pt,RGBA_ASTC_4x4_Format:Fi,RGBA_BPTC_Format:Ar,RGBA_ETC2_EAC_Format:rr,RGBA_PVRTC_4BPPV1_Format:or,RGBA_S3TC_DXT5_Format:ar,RGB_ETC1_Format:ir,RGB_ETC2_Format:nr,RGB_PVRTC_4BPPV1_Format:sr,RGBA_S3TC_DXT1_Format:tr},Tt.BasisWorker=function(){let o,e,t;const n=_EngineFormat,s=_TranscoderFormat,i=_BasisFormat;self.addEventListener("message",function(f){const b=f.data;switch(b.type){case"init":o=b.config,a(b.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:u,buffers:I,width:C,height:E,hasAlpha:y,format:w,dfdFlags:v}=r(b.buffer);self.postMessage({type:"transcode",id:b.id,faces:u,width:C,height:E,hasAlpha:y,format:w,dfdFlags:v},I)}catch(u){console.error(u),self.postMessage({type:"error",id:b.id,error:u.message})}});break}});function a(f){e=new Promise(b=>{t={wasmBinary:f,onRuntimeInitialized:b},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function r(f){const b=new t.KTX2File(new Uint8Array(f));function u(){b.close(),b.delete()}if(!b.isValid())throw u(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");const I=b.isUASTC()?i.UASTC_4x4:i.ETC1S,C=b.getWidth(),E=b.getHeight(),y=b.getLayers()||1,w=b.getLevels(),v=b.getFaces(),T=b.getHasAlpha(),S=b.getDFDFlags(),{transcoderFormat:M,engineFormat:j}=h(I,C,E,T);if(!C||!E||!w)throw u(),new Error("THREE.KTX2Loader: Invalid texture");if(!b.startTranscoding())throw u(),new Error("THREE.KTX2Loader: .startTranscoding failed");const z=[],J=[];for(let Z=0;Z<v;Z++){const Y=[];for(let $=0;$<w;$++){const W=[];let V,X;for(let be=0;be<y;be++){const ge=b.getImageLevelInfo($,be,Z);Z===0&&$===0&&be===0&&(ge.origWidth%4!==0||ge.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),w>1?(V=ge.origWidth,X=ge.origHeight):(V=ge.width,X=ge.height);const De=new Uint8Array(b.getImageTranscodedSizeInBytes($,be,0,M));if(!b.transcodeImage(De,$,be,Z,M,0,-1,-1))throw u(),new Error("THREE.KTX2Loader: .transcodeImage failed.");W.push(De)}const le=p(W);Y.push({data:le,width:V,height:X}),J.push(le.buffer)}z.push({mipmaps:Y,width:C,height:E,format:j})}return u(),{faces:z,buffers:J,width:C,height:E,hasAlpha:T,format:j,dfdFlags:S}}const A=[{if:"astcSupported",basisFormat:[i.UASTC_4x4],transcoderFormat:[s.ASTC_4x4,s.ASTC_4x4],engineFormat:[n.RGBA_ASTC_4x4_Format,n.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[i.ETC1S,i.UASTC_4x4],transcoderFormat:[s.BC7_M5,s.BC7_M5],engineFormat:[n.RGBA_BPTC_Format,n.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[i.ETC1S,i.UASTC_4x4],transcoderFormat:[s.BC1,s.BC3],engineFormat:[n.RGBA_S3TC_DXT1_Format,n.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[i.ETC1S,i.UASTC_4x4],transcoderFormat:[s.ETC1,s.ETC2],engineFormat:[n.RGB_ETC2_Format,n.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[i.ETC1S,i.UASTC_4x4],transcoderFormat:[s.ETC1],engineFormat:[n.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[i.ETC1S,i.UASTC_4x4],transcoderFormat:[s.PVRTC1_4_RGB,s.PVRTC1_4_RGBA],engineFormat:[n.RGB_PVRTC_4BPPV1_Format,n.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],c=A.sort(function(f,b){return f.priorityETC1S-b.priorityETC1S}),l=A.sort(function(f,b){return f.priorityUASTC-b.priorityUASTC});function h(f,b,u,I){let C,E;const y=f===i.ETC1S?c:l;for(let w=0;w<y.length;w++){const v=y[w];if(o[v.if]&&v.basisFormat.includes(f)&&!(I&&v.transcoderFormat.length<2)&&!(v.needsPowerOfTwo&&!(d(b)&&d(u))))return C=v.transcoderFormat[I?1:0],E=v.engineFormat[I?1:0],{transcoderFormat:C,engineFormat:E}}return console.warn("THREE.KTX2Loader: No suitable compressed texture format found. Decoding to RGBA32."),C=s.RGBA32,E=n.RGBAFormat,{transcoderFormat:C,engineFormat:E}}function d(f){return f<=2?!0:(f&f-1)===0&&f!==0}function p(f){if(f.length===1)return f[0];let b=0;for(let C=0;C<f.length;C++){const E=f[C];b+=E.byteLength}const u=new Uint8Array(b);let I=0;for(let C=0;C<f.length;C++){const E=f[C];u.set(E,I),I+=E.byteLength}return u}};const kA=new Set([Pt,Cs,rs]),zn={[ha]:Pt,[Aa]:Pt,[ia]:Pt,[aa]:Pt,[la]:Cs,[ra]:Cs,[sa]:Cs,[na]:Cs,[ca]:rs,[oa]:rs,[ta]:rs,[ea]:rs,[pa]:Fi,[da]:Li,[ga]:Li},Kn={[ha]:wt,[Aa]:it,[ia]:ft,[aa]:ft,[la]:wt,[ra]:it,[sa]:ft,[na]:ft,[ca]:wt,[oa]:it,[ta]:ft,[ea]:ft,[pa]:it,[da]:ft,[ga]:ft};async function MA(o){const{vkFormat:e}=o;if(zn[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;o.supercompressionScheme===Zi&&(qn||(qn=new Promise(async i=>{const a=new DA;await a.init(),i(a)})),t=await qn);const n=[];for(let i=0;i<o.levels.length;i++){const a=Math.max(1,o.pixelWidth>>i),r=Math.max(1,o.pixelHeight>>i),A=o.pixelDepth?Math.max(1,o.pixelDepth>>i):0,c=o.levels[i];let l;if(o.supercompressionScheme===wA)l=c.levelData;else if(o.supercompressionScheme===Zi)l=t.decode(c.levelData,c.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let h;Kn[e]===wt?h=new Float32Array(l.buffer,l.byteOffset,l.byteLength/Float32Array.BYTES_PER_ELEMENT):Kn[e]===it?h=new Uint16Array(l.buffer,l.byteOffset,l.byteLength/Uint16Array.BYTES_PER_ELEMENT):h=l,n.push({data:h,width:a,height:r,depth:A})}let s;if(kA.has(zn[e]))s=o.pixelDepth===0?new dr(n[0].data,o.pixelWidth,o.pixelHeight):new pr(n[0].data,o.pixelWidth,o.pixelHeight,o.pixelDepth);else{if(o.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");s=new Es(n,o.pixelWidth,o.pixelHeight)}return s.mipmaps=n,s.type=Kn[e],s.format=zn[e],s.colorSpace=ma(o),s.needsUpdate=!0,Promise.resolve(s)}function ma(o){const e=o.dataFormatDescriptor[0];return e.colorPrimaries===vA?e.transferFunction===$i?re:We:e.colorPrimaries===xA?e.transferFunction===$i?hr:gr:e.colorPrimaries===QA?Zs:(console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),Zs)}class _A extends ur{constructor(e,t={}){const n=t.font;if(n===void 0)super();else{const s=n.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(s,t)}this.type="TextGeometry"}}class FA extends Dt{constructor(e){super(e)}load(e,t,n,s){const i=this,a=new gt(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(r){const A=i.parse(JSON.parse(r));t&&t(A)},n,s)}parse(e){return new ba(e)}}class ba{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100){const n=[],s=LA(e,t,this.data);for(let i=0,a=s.length;i<a;i++)n.push(...s[i].toShapes());return n}}function LA(o,e,t){const n=Array.from(o),s=e/t.resolution,i=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*s,a=[];let r=0,A=0;for(let c=0;c<n.length;c++){const l=n[c];if(l===`
36
- `)r=0,A-=i;else{const h=NA(l,s,r,A,t);r+=h.offsetX,a.push(h.path)}}return a}function NA(o,e,t,n,s){const i=s.glyphs[o]||s.glyphs["?"];if(!i){console.error('THREE.Font: character "'+o+'" does not exists in font family '+s.familyName+".");return}const a=new fr;let r,A,c,l,h,d,p,f;if(i.o){const b=i._cachedOutline||(i._cachedOutline=i.o.split(" "));for(let u=0,I=b.length;u<I;)switch(b[u++]){case"m":r=b[u++]*e+t,A=b[u++]*e+n,a.moveTo(r,A);break;case"l":r=b[u++]*e+t,A=b[u++]*e+n,a.lineTo(r,A);break;case"q":c=b[u++]*e+t,l=b[u++]*e+n,h=b[u++]*e+t,d=b[u++]*e+n,a.quadraticCurveTo(h,d,c,l);break;case"b":c=b[u++]*e+t,l=b[u++]*e+n,h=b[u++]*e+t,d=b[u++]*e+n,p=b[u++]*e+t,f=b[u++]*e+n,a.bezierCurveTo(h,d,p,f,c,l);break}}return{offsetX:i.ha*e,path:a}}const es=new Sn,je=new N,qt=new N,Ce=new we,Ia={X:new N(1,0,0),Y:new N(0,1,0),Z:new N(0,0,1)},Yn={type:"change"},Ea={type:"mouseDown",mode:null},Ca={type:"mouseUp",mode:null},Ba={type:"objectChange"};class UA extends Ni{constructor(e,t=null){super(void 0,t);const n=new qA(this);this._root=n;const s=new va;this._gizmo=s,n.add(s);const i=new zA;this._plane=i,n.add(i);const a=this;function r(E,y){let w=y;Object.defineProperty(a,E,{get:function(){return w!==void 0?w:y},set:function(v){w!==v&&(w=v,i[E]=v,s[E]=v,a.dispatchEvent({type:E+"-changed",value:v}),a.dispatchEvent(Yn))}}),a[E]=y,i[E]=y,s[E]=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);const A=new N,c=new N,l=new we,h=new we,d=new N,p=new we,f=new N,b=new N,u=new N,I=0,C=new N;r("worldPosition",A),r("worldPositionStart",c),r("worldQuaternion",l),r("worldQuaternionStart",h),r("cameraPosition",d),r("cameraQuaternion",p),r("pointStart",f),r("pointEnd",b),r("rotationAxis",u),r("rotationAngle",I),r("eye",C),this._offset=new N,this._startNorm=new N,this._endNorm=new N,this._cameraScale=new N,this._parentPosition=new N,this._parentQuaternion=new we,this._parentQuaternionInv=new we,this._parentScale=new N,this._worldScaleStart=new N,this._worldQuaternionInv=new we,this._worldScale=new N,this._positionStart=new N,this._quaternionStart=new we,this._scaleStart=new N,this._getPointer=GA.bind(this),this._onPointerDown=OA.bind(this),this._onPointerHover=PA.bind(this),this._onPointerMove=HA.bind(this),this._onPointerUp=jA.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&&es.setFromCamera(e,this.camera);const t=Jn(this._gizmo.picker[this.mode],es);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&&es.setFromCamera(e,this.camera);const t=Jn(this._plane,es,!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,Ea.mode=this.mode,this.dispatchEvent(Ea)}}pointerMove(e){const t=this.axis,n=this.mode,s=this.object;let i=this.space;if(n==="scale"?i="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(i="world"),s===void 0||t===null||this.dragging===!1||e!==null&&e.button!==-1)return;e!==null&&es.setFromCamera(e,this.camera);const a=Jn(this._plane,es,!0);if(a){if(this.pointEnd.copy(a.point).sub(this.worldPositionStart),n==="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),s.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(i==="local"&&(s.position.applyQuaternion(Ce.copy(this._quaternionStart).invert()),t.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.position.applyQuaternion(this._quaternionStart)),i==="world"&&(s.parent&&s.position.add(je.setFromMatrixPosition(s.parent.matrixWorld)),t.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.parent&&s.position.sub(je.setFromMatrixPosition(s.parent.matrixWorld))));else if(n==="scale"){if(t.search("XYZ")!==-1){let r=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(r*=-1),qt.set(r,r,r)}else je.copy(this.pointStart),qt.copy(this.pointEnd),je.applyQuaternion(this._worldQuaternionInv),qt.applyQuaternion(this._worldQuaternionInv),qt.divide(je),t.search("X")===-1&&(qt.x=1),t.search("Y")===-1&&(qt.y=1),t.search("Z")===-1&&(qt.z=1);s.scale.copy(this._scaleStart).multiply(qt),this.scaleSnap&&(t.search("X")!==-1&&(s.scale.x=Math.round(s.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Y")!==-1&&(s.scale.y=Math.round(s.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Z")!==-1&&(s.scale.z=Math.round(s.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(n==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const r=20/this.worldPosition.distanceTo(je.setFromMatrixPosition(this.camera.matrixWorld));let A=!1;t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(je.copy(this.rotationAxis).cross(this.eye))*r):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(Ia[t]),je.copy(Ia[t]),i==="local"&&je.applyQuaternion(this.worldQuaternion),je.cross(this.eye),je.length()===0?A=!0:this.rotationAngle=this._offset.dot(je.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),i==="local"&&t!=="E"&&t!=="XYZE"?(s.quaternion.copy(this._quaternionStart),s.quaternion.multiply(Ce.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),s.quaternion.copy(Ce.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),s.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(Yn),this.dispatchEvent(Ba)}}pointerUp(e){e!==null&&e.button!==0||(this.dragging&&this.axis!==null&&(Ca.mode=this.mode,this.dispatchEvent(Ca)),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(Yn),this.dispatchEvent(Ba),this.pointStart.copy(this.pointEnd))}getRaycaster(){return es}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 GA(o){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:o.button};{const e=this.domElement.getBoundingClientRect();return{x:(o.clientX-e.left)/e.width*2-1,y:-(o.clientY-e.top)/e.height*2+1,button:o.button}}}function PA(o){if(this.enabled)switch(o.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(o));break}}function OA(o){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(o.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(o)),this.pointerDown(this._getPointer(o)))}function HA(o){this.enabled&&this.pointerMove(this._getPointer(o))}function jA(o){this.enabled&&(this.domElement.releasePointerCapture(o.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(o)))}function Jn(o,e,t){const n=e.intersectObject(o,!0);for(let s=0;s<n.length;s++)if(n[s].object.visible||t)return n[s];return!1}const en=new Ot,he=new N(0,1,0),wa=new N(0,0,0),ya=new oe,tn=new we,sn=new we,yt=new N,Qa=new oe,Ss=new N(1,0,0),ts=new N(0,1,0),Ts=new N(0,0,1),nn=new N,Rs=new N,Ds=new N;class qA extends Bt{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 va extends Bt{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const e=new It({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new kt({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),n=e.clone();n.opacity=.15;const s=t.clone();s.opacity=.5;const i=e.clone();i.color.setHex(16711680);const a=e.clone();a.color.setHex(65280);const r=e.clone();r.color.setHex(255);const A=e.clone();A.color.setHex(16711680),A.opacity=.5;const c=e.clone();c.color.setHex(65280),c.opacity=.5;const l=e.clone();l.color.setHex(255),l.opacity=.5;const h=e.clone();h.opacity=.25;const d=e.clone();d.color.setHex(16776960),d.opacity=.25,e.clone().color.setHex(16776960);const p=e.clone();p.color.setHex(7895160);const f=new Ze(0,.04,.1,12);f.translate(0,.05,0);const b=new Ye(.08,.08,.08);b.translate(0,.04,0);const u=new At;u.setAttribute("position",new Te([0,0,0,1,0,0],3));const I=new Ze(.0075,.0075,.5,3);I.translate(0,.25,0);function C(Y,$){const W=new Bs(Y,.0075,3,64,$*Math.PI*2);return W.rotateY(Math.PI/2),W.rotateX(Math.PI/2),W}function E(){const Y=new At;return Y.setAttribute("position",new Te([0,0,0,1,1,1],3)),Y}const y={X:[[new O(f,i),[.5,0,0],[0,0,-Math.PI/2]],[new O(f,i),[-.5,0,0],[0,0,Math.PI/2]],[new O(I,i),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new O(f,a),[0,.5,0]],[new O(f,a),[0,-.5,0],[Math.PI,0,0]],[new O(I,a)]],Z:[[new O(f,r),[0,0,.5],[Math.PI/2,0,0]],[new O(f,r),[0,0,-.5],[-Math.PI/2,0,0]],[new O(I,r),null,[Math.PI/2,0,0]]],XYZ:[[new O(new $s(.1,0),h.clone()),[0,0,0]]],XY:[[new O(new Ye(.15,.15,.01),l.clone()),[.15,.15,0]]],YZ:[[new O(new Ye(.15,.15,.01),A.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ye(.15,.15,.01),c.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},w={X:[[new O(new Ze(.2,0,.6,4),n),[.3,0,0],[0,0,-Math.PI/2]],[new O(new Ze(.2,0,.6,4),n),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new O(new Ze(.2,0,.6,4),n),[0,.3,0]],[new O(new Ze(.2,0,.6,4),n),[0,-.3,0],[0,0,Math.PI]]],Z:[[new O(new Ze(.2,0,.6,4),n),[0,0,.3],[Math.PI/2,0,0]],[new O(new Ze(.2,0,.6,4),n),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new O(new $s(.2,0),n)]],XY:[[new O(new Ye(.2,.2,.01),n),[.15,.15,0]]],YZ:[[new O(new Ye(.2,.2,.01),n),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ye(.2,.2,.01),n),[.15,0,.15],[-Math.PI/2,0,0]]]},v={START:[[new O(new $s(.01,2),s),null,null,null,"helper"]],END:[[new O(new $s(.01,2),s),null,null,null,"helper"]],DELTA:[[new ut(E(),s),null,null,null,"helper"]],X:[[new ut(u,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new ut(u,s.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new ut(u,s.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},T={XYZE:[[new O(C(.5,1),p),null,[0,Math.PI/2,0]]],X:[[new O(C(.5,.5),i)]],Y:[[new O(C(.5,.5),a),null,[0,0,-Math.PI/2]]],Z:[[new O(C(.5,.5),r),null,[0,Math.PI/2,0]]],E:[[new O(C(.75,1),d),null,[0,Math.PI/2,0]]]},S={AXIS:[[new ut(u,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},M={XYZE:[[new O(new un(.25,10,8),n)]],X:[[new O(new Bs(.5,.1,4,24),n),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new O(new Bs(.5,.1,4,24),n),[0,0,0],[Math.PI/2,0,0]]],Z:[[new O(new Bs(.5,.1,4,24),n),[0,0,0],[0,0,-Math.PI/2]]],E:[[new O(new Bs(.75,.1,2,24),n)]]},j={X:[[new O(b,i),[.5,0,0],[0,0,-Math.PI/2]],[new O(I,i),[0,0,0],[0,0,-Math.PI/2]],[new O(b,i),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new O(b,a),[0,.5,0]],[new O(I,a)],[new O(b,a),[0,-.5,0],[0,0,Math.PI]]],Z:[[new O(b,r),[0,0,.5],[Math.PI/2,0,0]],[new O(I,r),[0,0,0],[Math.PI/2,0,0]],[new O(b,r),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new O(new Ye(.15,.15,.01),l),[.15,.15,0]]],YZ:[[new O(new Ye(.15,.15,.01),A),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ye(.15,.15,.01),c),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new O(new Ye(.1,.1,.1),h.clone())]]},z={X:[[new O(new Ze(.2,0,.6,4),n),[.3,0,0],[0,0,-Math.PI/2]],[new O(new Ze(.2,0,.6,4),n),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new O(new Ze(.2,0,.6,4),n),[0,.3,0]],[new O(new Ze(.2,0,.6,4),n),[0,-.3,0],[0,0,Math.PI]]],Z:[[new O(new Ze(.2,0,.6,4),n),[0,0,.3],[Math.PI/2,0,0]],[new O(new Ze(.2,0,.6,4),n),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new O(new Ye(.2,.2,.01),n),[.15,.15,0]]],YZ:[[new O(new Ye(.2,.2,.01),n),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ye(.2,.2,.01),n),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new O(new Ye(.2,.2,.2),n),[0,0,0]]]},J={X:[[new ut(u,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new ut(u,s.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new ut(u,s.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function Z(Y){const $=new Bt;for(const W in Y)for(let V=Y[W].length;V--;){const X=Y[W][V][0].clone(),le=Y[W][V][1],be=Y[W][V][2],ge=Y[W][V][3],De=Y[W][V][4];X.name=W,X.tag=De,le&&X.position.set(le[0],le[1],le[2]),be&&X.rotation.set(be[0],be[1],be[2]),ge&&X.scale.set(ge[0],ge[1],ge[2]),X.updateMatrix();const ke=X.geometry.clone();ke.applyMatrix4(X.matrix),X.geometry=ke,X.renderOrder=1/0,X.position.set(0,0,0),X.rotation.set(0,0,0),X.scale.set(1,1,1),$.add(X)}return $}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=Z(y)),this.add(this.gizmo.rotate=Z(T)),this.add(this.gizmo.scale=Z(j)),this.add(this.picker.translate=Z(w)),this.add(this.picker.rotate=Z(M)),this.add(this.picker.scale=Z(z)),this.add(this.helper.translate=Z(v)),this.add(this.helper.rotate=Z(S)),this.add(this.helper.scale=Z(J)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){const t=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:sn;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 i=n[s];i.visible=!0,i.rotation.set(0,0,0),i.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),i.scale.set(1,1,1).multiplyScalar(a*this.size/4),i.tag==="helper"){i.visible=!1,i.name==="AXIS"?(i.visible=!!this.axis,this.axis==="X"&&(Ce.setFromEuler(en.set(0,0,0)),i.quaternion.copy(t).multiply(Ce),Math.abs(he.copy(Ss).applyQuaternion(t).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="Y"&&(Ce.setFromEuler(en.set(0,0,Math.PI/2)),i.quaternion.copy(t).multiply(Ce),Math.abs(he.copy(ts).applyQuaternion(t).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="Z"&&(Ce.setFromEuler(en.set(0,Math.PI/2,0)),i.quaternion.copy(t).multiply(Ce),Math.abs(he.copy(Ts).applyQuaternion(t).dot(this.eye))>.9&&(i.visible=!1)),this.axis==="XYZE"&&(Ce.setFromEuler(en.set(0,Math.PI/2,0)),he.copy(this.rotationAxis),i.quaternion.setFromRotationMatrix(ya.lookAt(wa,he,ts)),i.quaternion.multiply(Ce),i.visible=this.dragging),this.axis==="E"&&(i.visible=!1)):i.name==="START"?(i.position.copy(this.worldPositionStart),i.visible=this.dragging):i.name==="END"?(i.position.copy(this.worldPosition),i.visible=this.dragging):i.name==="DELTA"?(i.position.copy(this.worldPositionStart),i.quaternion.copy(this.worldQuaternionStart),je.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),je.applyQuaternion(this.worldQuaternionStart.clone().invert()),i.scale.copy(je),i.visible=this.dragging):(i.quaternion.copy(t),this.dragging?i.position.copy(this.worldPositionStart):i.position.copy(this.worldPosition),this.axis&&(i.visible=this.axis.search(i.name)!==-1));continue}i.quaternion.copy(t),this.mode==="translate"||this.mode==="scale"?(i.name==="X"&&Math.abs(he.copy(Ss).applyQuaternion(t).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="Y"&&Math.abs(he.copy(ts).applyQuaternion(t).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="Z"&&Math.abs(he.copy(Ts).applyQuaternion(t).dot(this.eye))>.99&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="XY"&&Math.abs(he.copy(Ts).applyQuaternion(t).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="YZ"&&Math.abs(he.copy(Ss).applyQuaternion(t).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),i.name==="XZ"&&Math.abs(he.copy(ts).applyQuaternion(t).dot(this.eye))<.2&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1)):this.mode==="rotate"&&(tn.copy(t),he.copy(this.eye).applyQuaternion(Ce.copy(t).invert()),i.name.search("E")!==-1&&i.quaternion.setFromRotationMatrix(ya.lookAt(this.eye,wa,ts)),i.name==="X"&&(Ce.setFromAxisAngle(Ss,Math.atan2(-he.y,he.z)),Ce.multiplyQuaternions(tn,Ce),i.quaternion.copy(Ce)),i.name==="Y"&&(Ce.setFromAxisAngle(ts,Math.atan2(he.x,he.z)),Ce.multiplyQuaternions(tn,Ce),i.quaternion.copy(Ce)),i.name==="Z"&&(Ce.setFromAxisAngle(Ts,Math.atan2(he.y,he.x)),Ce.multiplyQuaternions(tn,Ce),i.quaternion.copy(Ce))),i.visible=i.visible&&(i.name.indexOf("X")===-1||this.showX),i.visible=i.visible&&(i.name.indexOf("Y")===-1||this.showY),i.visible=i.visible&&(i.name.indexOf("Z")===-1||this.showZ),i.visible=i.visible&&(i.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),i.material._color=i.material._color||i.material.color.clone(),i.material._opacity=i.material._opacity||i.material.opacity,i.material.color.copy(i.material._color),i.material.opacity=i.material._opacity,this.enabled&&this.axis&&(i.name===this.axis||this.axis.split("").some(function(r){return i.name===r}))&&(i.material.color.setHex(16776960),i.material.opacity=1)}super.updateMatrixWorld(e)}}class zA extends O{constructor(){super(new Tn(1e5,1e5,2,2),new It({visible:!1,wireframe:!0,side:Cn,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"),nn.copy(Ss).applyQuaternion(t==="local"?this.worldQuaternion:sn),Rs.copy(ts).applyQuaternion(t==="local"?this.worldQuaternion:sn),Ds.copy(Ts).applyQuaternion(t==="local"?this.worldQuaternion:sn),he.copy(Rs),this.mode){case"translate":case"scale":switch(this.axis){case"X":he.copy(this.eye).cross(nn),yt.copy(nn).cross(he);break;case"Y":he.copy(this.eye).cross(Rs),yt.copy(Rs).cross(he);break;case"Z":he.copy(this.eye).cross(Ds),yt.copy(Ds).cross(he);break;case"XY":yt.copy(Ds);break;case"YZ":yt.copy(nn);break;case"XZ":he.copy(Ds),yt.copy(Rs);break;case"XYZ":case"E":yt.set(0,0,0);break}break;case"rotate":default:yt.set(0,0,0)}yt.length()===0?this.quaternion.copy(this.cameraQuaternion):(Qa.lookAt(je.set(0,0,0),yt,he),this.quaternion.setFromRotationMatrix(Qa)),super.updateMatrixWorld(e)}}/*!
37
- fflate - fast JavaScript compression/decompression
38
- <https://101arrowz.github.io/fflate>
39
- Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE
40
- version 0.8.2
41
- */var ve=Uint8Array,at=Uint16Array,Vn=Int32Array,an=new ve([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]),on=new ve([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]),Wn=new ve([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xa=function(o,e){for(var t=new at(31),n=0;n<31;++n)t[n]=e+=1<<o[n-1];for(var s=new Vn(t[30]),n=1;n<30;++n)for(var i=t[n];i<t[n+1];++i)s[i]=i-t[n]<<5|n;return{b:t,r:s}},Sa=xa(an,2),Ta=Sa.b,Xn=Sa.r;Ta[28]=258,Xn[258]=28;for(var Ra=xa(on,0),KA=Ra.b,Da=Ra.r,Zn=new at(32768),me=0;me<32768;++me){var zt=(me&43690)>>1|(me&21845)<<1;zt=(zt&52428)>>2|(zt&13107)<<2,zt=(zt&61680)>>4|(zt&3855)<<4,Zn[me]=((zt&65280)>>8|(zt&255)<<8)>>1}for(var Qt=function(o,e,t){for(var n=o.length,s=0,i=new at(e);s<n;++s)o[s]&&++i[o[s]-1];var a=new at(e);for(s=1;s<e;++s)a[s]=a[s-1]+i[s-1]<<1;var r;if(t){r=new at(1<<e);var A=15-e;for(s=0;s<n;++s)if(o[s])for(var c=s<<4|o[s],l=e-o[s],h=a[o[s]-1]++<<l,d=h|(1<<l)-1;h<=d;++h)r[Zn[h]>>A]=c}else for(r=new at(n),s=0;s<n;++s)o[s]&&(r[s]=Zn[a[o[s]-1]++]>>15-o[s]);return r},Kt=new ve(288),me=0;me<144;++me)Kt[me]=8;for(var me=144;me<256;++me)Kt[me]=9;for(var me=256;me<280;++me)Kt[me]=7;for(var me=280;me<288;++me)Kt[me]=8;for(var ks=new ve(32),me=0;me<32;++me)ks[me]=5;var YA=Qt(Kt,9,0),JA=Qt(Kt,9,1),VA=Qt(ks,5,0),WA=Qt(ks,5,1),$n=function(o){for(var e=o[0],t=1;t<o.length;++t)o[t]>e&&(e=o[t]);return e},mt=function(o,e,t){var n=e/8|0;return(o[n]|o[n+1]<<8)>>(e&7)&t},ei=function(o,e){var t=e/8|0;return(o[t]|o[t+1]<<8|o[t+2]<<16)>>(e&7)},ti=function(o){return(o+7)/8|0},si=function(o,e,t){return(t==null||t>o.length)&&(t=o.length),new ve(o.subarray(e,t))},XA=["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"],et=function(o,e,t){var n=new Error(e||XA[o]);if(n.code=o,Error.captureStackTrace&&Error.captureStackTrace(n,et),!t)throw n;return n},ZA=function(o,e,t,n){var s=o.length,i=0;if(!s||e.f&&!e.l)return t||new ve(0);var a=!t,r=a||e.i!=2,A=e.i;a&&(t=new ve(s*3));var c=function(Me){var Gt=t.length;if(Me>Gt){var Ke=new ve(Math.max(Gt*2,Me));Ke.set(t),t=Ke}},l=e.f||0,h=e.p||0,d=e.b||0,p=e.l,f=e.d,b=e.m,u=e.n,I=s*8;do{if(!p){l=mt(o,h,1);var C=mt(o,h+1,3);if(h+=3,C)if(C==1)p=JA,f=WA,b=9,u=5;else if(C==2){var E=mt(o,h,31)+257,y=mt(o,h+10,15)+4,w=E+mt(o,h+5,31)+1;h+=14;for(var v=new ve(w),T=new ve(19),S=0;S<y;++S)T[Wn[S]]=mt(o,h+S*3,7);h+=y*3;for(var M=$n(T),j=(1<<M)-1,z=Qt(T,M,1),S=0;S<w;){var J=z[mt(o,h,j)];h+=J&15;var Z=J>>4;if(Z<16)v[S++]=Z;else{var Y=0,$=0;for(Z==16?($=3+mt(o,h,3),h+=2,Y=v[S-1]):Z==17?($=3+mt(o,h,7),h+=3):Z==18&&($=11+mt(o,h,127),h+=7);$--;)v[S++]=Y}}var W=v.subarray(0,E),V=v.subarray(E);b=$n(W),u=$n(V),p=Qt(W,b,1),f=Qt(V,u,1)}else et(1);else{var Z=ti(h)+4,X=o[Z-4]|o[Z-3]<<8,le=Z+X;if(le>s){A&&et(0);break}r&&c(d+X),t.set(o.subarray(Z,le),d),e.b=d+=X,e.p=h=le*8,e.f=l;continue}if(h>I){A&&et(0);break}}r&&c(d+131072);for(var be=(1<<b)-1,ge=(1<<u)-1,De=h;;De=h){var Y=p[ei(o,h)&be],ke=Y>>4;if(h+=Y&15,h>I){A&&et(0);break}if(Y||et(2),ke<256)t[d++]=ke;else if(ke==256){De=h,p=null;break}else{var qe=ke-254;if(ke>264){var S=ke-257,pe=an[S];qe=mt(o,h,(1<<pe)-1)+Ta[S],h+=pe}var ze=f[ei(o,h)&ge],Nt=ze>>4;ze||et(3),h+=ze&15;var V=KA[Nt];if(Nt>3){var pe=on[Nt];V+=ei(o,h)&(1<<pe)-1,h+=pe}if(h>I){A&&et(0);break}r&&c(d+131072);var Ut=d+qe;if(d<V){var as=i-V,Le=Math.min(V,Ut);for(as+d<0&&et(3);d<Le;++d)t[d]=n[as+d]}for(;d<Ut;++d)t[d]=t[d-V]}}e.l=p,e.p=De,e.b=d,e.f=l,p&&(l=1,e.m=b,e.d=f,e.n=u)}while(!l);return d!=t.length&&a?si(t,0,d):t.subarray(0,d)},Lt=function(o,e,t){t<<=e&7;var n=e/8|0;o[n]|=t,o[n+1]|=t>>8},Ms=function(o,e,t){t<<=e&7;var n=e/8|0;o[n]|=t,o[n+1]|=t>>8,o[n+2]|=t>>16},ni=function(o,e){for(var t=[],n=0;n<o.length;++n)o[n]&&t.push({s:n,f:o[n]});var s=t.length,i=t.slice();if(!s)return{t:Fa,l:0};if(s==1){var a=new ve(t[0].s+1);return a[t[0].s]=1,{t:a,l:1}}t.sort(function(w,v){return w.f-v.f}),t.push({s:-1,f:25001});var r=t[0],A=t[1],c=0,l=1,h=2;for(t[0]={s:-1,f:r.f+A.f,l:r,r:A};l!=s-1;)r=t[t[c].f<t[h].f?c++:h++],A=t[c!=l&&t[c].f<t[h].f?c++:h++],t[l++]={s:-1,f:r.f+A.f,l:r,r:A};for(var d=i[0].s,n=1;n<s;++n)i[n].s>d&&(d=i[n].s);var p=new at(d+1),f=ii(t[l-1],p,0);if(f>e){var n=0,b=0,u=f-e,I=1<<u;for(i.sort(function(v,T){return p[T.s]-p[v.s]||v.f-T.f});n<s;++n){var C=i[n].s;if(p[C]>e)b+=I-(1<<f-p[C]),p[C]=e;else break}for(b>>=u;b>0;){var E=i[n].s;p[E]<e?b-=1<<e-p[E]++-1:++n}for(;n>=0&&b;--n){var y=i[n].s;p[y]==e&&(--p[y],++b)}f=e}return{t:new ve(p),l:f}},ii=function(o,e,t){return o.s==-1?Math.max(ii(o.l,e,t+1),ii(o.r,e,t+1)):e[o.s]=t},ka=function(o){for(var e=o.length;e&&!o[--e];);for(var t=new at(++e),n=0,s=o[0],i=1,a=function(A){t[n++]=A},r=1;r<=e;++r)if(o[r]==s&&r!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(s),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(s);i=1,s=o[r]}return{c:t.subarray(0,n),n:e}},_s=function(o,e){for(var t=0,n=0;n<e.length;++n)t+=o[n]*e[n];return t},Ma=function(o,e,t){var n=t.length,s=ti(e+2);o[s]=n&255,o[s+1]=n>>8,o[s+2]=o[s]^255,o[s+3]=o[s+1]^255;for(var i=0;i<n;++i)o[s+i+4]=t[i];return(s+4+n)*8},_a=function(o,e,t,n,s,i,a,r,A,c,l){Lt(e,l++,t),++s[256];for(var h=ni(s,15),d=h.t,p=h.l,f=ni(i,15),b=f.t,u=f.l,I=ka(d),C=I.c,E=I.n,y=ka(b),w=y.c,v=y.n,T=new at(19),S=0;S<C.length;++S)++T[C[S]&31];for(var S=0;S<w.length;++S)++T[w[S]&31];for(var M=ni(T,7),j=M.t,z=M.l,J=19;J>4&&!j[Wn[J-1]];--J);var Z=c+5<<3,Y=_s(s,Kt)+_s(i,ks)+a,$=_s(s,d)+_s(i,b)+a+14+3*J+_s(T,j)+2*T[16]+3*T[17]+7*T[18];if(A>=0&&Z<=Y&&Z<=$)return Ma(e,l,o.subarray(A,A+c));var W,V,X,le;if(Lt(e,l,1+($<Y)),l+=2,$<Y){W=Qt(d,p,0),V=d,X=Qt(b,u,0),le=b;var be=Qt(j,z,0);Lt(e,l,E-257),Lt(e,l+5,v-1),Lt(e,l+10,J-4),l+=14;for(var S=0;S<J;++S)Lt(e,l+3*S,j[Wn[S]]);l+=3*J;for(var ge=[C,w],De=0;De<2;++De)for(var ke=ge[De],S=0;S<ke.length;++S){var qe=ke[S]&31;Lt(e,l,be[qe]),l+=j[qe],qe>15&&(Lt(e,l,ke[S]>>5&127),l+=ke[S]>>12)}}else W=YA,V=Kt,X=VA,le=ks;for(var S=0;S<r;++S){var pe=n[S];if(pe>255){var qe=pe>>18&31;Ms(e,l,W[qe+257]),l+=V[qe+257],qe>7&&(Lt(e,l,pe>>23&31),l+=an[qe]);var ze=pe&31;Ms(e,l,X[ze]),l+=le[ze],ze>3&&(Ms(e,l,pe>>5&8191),l+=on[ze])}else Ms(e,l,W[pe]),l+=V[pe]}return Ms(e,l,W[256]),l+V[256]},$A=new Vn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Fa=new ve(0),ec=function(o,e,t,n,s,i){var a=i.z||o.length,r=new ve(n+a+5*(1+Math.ceil(a/7e3))+s),A=r.subarray(n,r.length-s),c=i.l,l=(i.r||0)&7;if(e){l&&(A[0]=i.r>>3);for(var h=$A[e-1],d=h>>13,p=h&8191,f=(1<<t)-1,b=i.p||new at(32768),u=i.h||new at(f+1),I=Math.ceil(t/3),C=2*I,E=function(Ne){return(o[Ne]^o[Ne+1]<<I^o[Ne+2]<<C)&f},y=new Vn(25e3),w=new at(288),v=new at(32),T=0,S=0,M=i.i||0,j=0,z=i.w||0,J=0;M+2<a;++M){var Z=E(M),Y=M&32767,$=u[Z];if(b[Y]=$,u[Z]=Y,z<=M){var W=a-M;if((T>7e3||j>24576)&&(W>423||!c)){l=_a(o,A,0,y,w,v,S,j,J,M-J,l),j=T=S=0,J=M;for(var V=0;V<286;++V)w[V]=0;for(var V=0;V<30;++V)v[V]=0}var X=2,le=0,be=p,ge=Y-$&32767;if(W>2&&Z==E(M-ge))for(var De=Math.min(d,W)-1,ke=Math.min(32767,M),qe=Math.min(258,W);ge<=ke&&--be&&Y!=$;){if(o[M+X]==o[M+X-ge]){for(var pe=0;pe<qe&&o[M+pe]==o[M+pe-ge];++pe);if(pe>X){if(X=pe,le=ge,pe>De)break;for(var ze=Math.min(ge,pe-2),Nt=0,V=0;V<ze;++V){var Ut=M-ge+V&32767,as=b[Ut],Le=Ut-as&32767;Le>Nt&&(Nt=Le,$=Ut)}}}Y=$,$=b[Y],ge+=Y-$&32767}if(le){y[j++]=268435456|Xn[X]<<18|Da[le];var Me=Xn[X]&31,Gt=Da[le]&31;S+=an[Me]+on[Gt],++w[257+Me],++v[Gt],z=M+X,++T}else y[j++]=o[M],++w[o[M]]}}for(M=Math.max(M,z);M<a;++M)y[j++]=o[M],++w[o[M]];l=_a(o,A,c,y,w,v,S,j,J,M-J,l),c||(i.r=l&7|A[l/8|0]<<3,l-=7,i.h=u,i.p=b,i.i=M,i.w=z)}else{for(var M=i.w||0;M<a+c;M+=65535){var Ke=M+65535;Ke>=a&&(A[l/8|0]=c,Ke=a),l=Ma(A,l+1,o.subarray(M,Ke))}i.i=a}return si(r,0,n+ti(l)+s)},tc=function(){for(var o=new Int32Array(256),e=0;e<256;++e){for(var t=e,n=9;--n;)t=(t&1&&-306674912)^t>>>1;o[e]=t}return o}(),sc=function(){var o=-1;return{p:function(e){for(var t=o,n=0;n<e.length;++n)t=tc[t&255^e[n]]^t>>>8;o=t},d:function(){return~o}}},nc=function(o,e,t,n,s){if(!s&&(s={l:1},e.dictionary)){var i=e.dictionary.subarray(-32768),a=new ve(i.length+o.length);a.set(i),a.set(o,i.length),o=a,s.w=i.length}return ec(o,e.level==null?6:e.level,e.mem==null?s.l?Math.ceil(Math.max(8,Math.min(13,Math.log(o.length)))*1.5):20:12+e.mem,t,n,s)},La=function(o,e){var t={};for(var n in o)t[n]=o[n];for(var n in e)t[n]=e[n];return t},Ue=function(o,e,t){for(;t;++e)o[e]=t,t>>>=8},ic=function(o,e){return((o[0]&15)!=8||o[0]>>4>7||(o[0]<<8|o[1])%31)&&et(6,"invalid zlib data"),(o[1]>>5&1)==1&&et(6,"invalid zlib data: "+(o[1]&32?"need":"unexpected")+" dictionary"),(o[1]>>3&4)+2};function ac(o,e){return nc(o,e||{},0,0)}function Fs(o,e){return ZA(o.subarray(ic(o),-4),{i:2},e,e)}var Na=function(o,e,t,n){for(var s in o){var i=o[s],a=e+s,r=n;Array.isArray(i)&&(r=La(n,i[1]),i=i[0]),i instanceof ve?t[a]=[i,r]:(t[a+="/"]=[new ve(0),r],Na(i,a,t,n))}},Ua=typeof TextEncoder<"u"&&new TextEncoder,oc=typeof TextDecoder<"u"&&new TextDecoder,rc=0;try{oc.decode(Fa,{stream:!0}),rc=1}catch{}function ai(o,e){var t;if(Ua)return Ua.encode(o);for(var n=o.length,s=new ve(o.length+(o.length>>1)),i=0,a=function(l){s[i++]=l},t=0;t<n;++t){if(i+5>s.length){var r=new ve(i+8+(n-t<<1));r.set(s),s=r}var A=o.charCodeAt(t);A<128||e?a(A):A<2048?(a(192|A>>6),a(128|A&63)):A>55295&&A<57344?(A=65536+(A&1047552)|o.charCodeAt(++t)&1023,a(240|A>>18),a(128|A>>12&63),a(128|A>>6&63),a(128|A&63)):(a(224|A>>12),a(128|A>>6&63),a(128|A&63))}return si(s,0,i)}var oi=function(o){var e=0;if(o)for(var t in o){var n=o[t].length;n>65535&&et(9),e+=n+4}return e},Ga=function(o,e,t,n,s,i,a,r){var A=n.length,c=t.extra,l=r&&r.length,h=oi(c);Ue(o,e,a!=null?33639248:67324752),e+=4,a!=null&&(o[e++]=20,o[e++]=t.os),o[e]=20,e+=2,o[e++]=t.flag<<1|(i<0&&8),o[e++]=s&&8,o[e++]=t.compression&255,o[e++]=t.compression>>8;var d=new Date(t.mtime==null?Date.now():t.mtime),p=d.getFullYear()-1980;if((p<0||p>119)&&et(10),Ue(o,e,p<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>1),e+=4,i!=-1&&(Ue(o,e,t.crc),Ue(o,e+4,i<0?-i-2:i),Ue(o,e+8,t.size)),Ue(o,e+12,A),Ue(o,e+14,h),e+=16,a!=null&&(Ue(o,e,l),Ue(o,e+6,t.attrs),Ue(o,e+10,a),e+=14),o.set(n,e),e+=A,h)for(var f in c){var b=c[f],u=b.length;Ue(o,e,+f),Ue(o,e+2,u),o.set(b,e+4),e+=4+u}return l&&(o.set(r,e),e+=l),e},Ac=function(o,e,t,n,s){Ue(o,e,101010256),Ue(o,e+8,t),Ue(o,e+10,t),Ue(o,e+12,n),Ue(o,e+16,s)};function cc(o,e){e||(e={});var t={},n=[];Na(o,"",t,e);var s=0,i=0;for(var a in t){var r=t[a],A=r[0],c=r[1],l=c.level==0?0:8,h=ai(a),d=h.length,p=c.comment,f=p&&ai(p),b=f&&f.length,u=oi(c.extra);d>65535&&et(11);var I=l?ac(A,c):A,C=I.length,E=sc();E.p(A),n.push(La(c,{size:A.length,crc:E.d(),c:I,f:h,m:f,u:d!=a.length||f&&p.length!=b,o:s,compression:l})),s+=30+d+u+C,i+=76+2*(d+u)+(b||0)+C}for(var y=new ve(i+22),w=s,v=i-s,T=0;T<n.length;++T){var h=n[T];Ga(y,h.o,h,h.f,h.u,h.c.length);var S=30+h.f.length+oi(h.extra);y.set(h.c,h.o+S),Ga(y,s,h,h.f,h.u,h.c.length,h.o,h.m),s+=16+S+(h.m?h.m.length:0)}return Ac(y,s,n.length,v,w),y}class Pa extends Ui{constructor(e){super(e),this.type=it}parse(e){const t=Math.pow(2.7182818,2.2);function n(g,m){let B=0;for(let R=0;R<65536;++R)(R==0||g[R>>3]&1<<(R&7))&&(m[B++]=R);const Q=B-1;for(;B<65536;)m[B++]=0;return Q}function s(g){for(let m=0;m<16384;m++)g[m]={},g[m].len=0,g[m].lit=0,g[m].p=null}const i={l:0,c:0,lc:0};function a(g,m,B,Q,R){for(;B<g;)m=m<<8|Gt(Q,R),B+=8;B-=g,i.l=m>>B&(1<<g)-1,i.c=m,i.lc=B}const r=new Array(59);function A(g){for(let B=0;B<=58;++B)r[B]=0;for(let B=0;B<65537;++B)r[g[B]]+=1;let m=0;for(let B=58;B>0;--B){const Q=m+r[B]>>1;r[B]=m,m=Q}for(let B=0;B<65537;++B){const Q=g[B];Q>0&&(g[B]=Q|r[Q]++<<6)}}function c(g,m,B,Q,R,x){const _=m;let L=0,F=0;for(;Q<=R;Q++){if(_.value-m.value>B)return!1;a(6,L,F,g,_);const k=i.l;if(L=i.c,F=i.lc,x[Q]=k,k==63){if(_.value-m.value>B)throw new Error("Something wrong with hufUnpackEncTable");a(8,L,F,g,_);let D=i.l+6;if(L=i.c,F=i.lc,Q+D>R+1)throw new Error("Something wrong with hufUnpackEncTable");for(;D--;)x[Q++]=0;Q--}else if(k>=59){let D=k-59+2;if(Q+D>R+1)throw new Error("Something wrong with hufUnpackEncTable");for(;D--;)x[Q++]=0;Q--}}A(x)}function l(g){return g&63}function h(g){return g>>6}function d(g,m,B,Q){for(;m<=B;m++){const R=h(g[m]),x=l(g[m]);if(R>>x)throw new Error("Invalid table entry");if(x>14){const _=Q[R>>x-14];if(_.len)throw new Error("Invalid table entry");if(_.lit++,_.p){const L=_.p;_.p=new Array(_.lit);for(let F=0;F<_.lit-1;++F)_.p[F]=L[F]}else _.p=new Array(1);_.p[_.lit-1]=m}else if(x){let _=0;for(let L=1<<14-x;L>0;L--){const F=Q[(R<<14-x)+_];if(F.len||F.p)throw new Error("Invalid table entry");F.len=x,F.lit=m,_++}}}return!0}const p={c:0,lc:0};function f(g,m,B,Q){g=g<<8|Gt(B,Q),m+=8,p.c=g,p.lc=m}const b={c:0,lc:0};function u(g,m,B,Q,R,x,_,L,F){if(g==m){Q<8&&(f(B,Q,R,x),B=p.c,Q=p.lc),Q-=8;let k=B>>Q;if(k=new Uint8Array([k])[0],L.value+k>F)return!1;const D=_[L.value-1];for(;k-- >0;)_[L.value++]=D}else if(L.value<F)_[L.value++]=g;else return!1;b.c=B,b.lc=Q}function I(g){return g&65535}function C(g){const m=I(g);return m>32767?m-65536:m}const E={a:0,b:0};function y(g,m){const B=C(g),Q=C(m),R=B+(Q&1)+(Q>>1),x=R,_=R-Q;E.a=x,E.b=_}function w(g,m){const B=I(g),Q=I(m),R=B-(Q>>1)&65535,x=Q+R-32768&65535;E.a=x,E.b=R}function v(g,m,B,Q,R,x,_){const L=_<16384,F=B>R?R:B;let k=1,D,G;for(;k<=F;)k<<=1;for(k>>=1,D=k,k>>=1;k>=1;){G=0;const U=G+x*(R-D),q=x*k,ee=x*D,P=Q*k,K=Q*D;let te,Ie,Qe,st;for(;G<=U;G+=ee){let ue=G;const ae=G+Q*(B-D);for(;ue<=ae;ue+=K){const Se=ue+P,rt=ue+q,_e=rt+P;L?(y(g[ue+m],g[rt+m]),te=E.a,Qe=E.b,y(g[Se+m],g[_e+m]),Ie=E.a,st=E.b,y(te,Ie),g[ue+m]=E.a,g[Se+m]=E.b,y(Qe,st),g[rt+m]=E.a,g[_e+m]=E.b):(w(g[ue+m],g[rt+m]),te=E.a,Qe=E.b,w(g[Se+m],g[_e+m]),Ie=E.a,st=E.b,w(te,Ie),g[ue+m]=E.a,g[Se+m]=E.b,w(Qe,st),g[rt+m]=E.a,g[_e+m]=E.b)}if(B&k){const Se=ue+q;L?y(g[ue+m],g[Se+m]):w(g[ue+m],g[Se+m]),te=E.a,g[Se+m]=E.b,g[ue+m]=te}}if(R&k){let ue=G;const ae=G+Q*(B-D);for(;ue<=ae;ue+=K){const Se=ue+P;L?y(g[ue+m],g[Se+m]):w(g[ue+m],g[Se+m]),te=E.a,g[Se+m]=E.b,g[ue+m]=te}}D=k,k>>=1}return G}function T(g,m,B,Q,R,x,_,L,F){let k=0,D=0;const G=_,U=Math.trunc(Q.value+(R+7)/8);for(;Q.value<U;)for(f(k,D,B,Q),k=p.c,D=p.lc;D>=14;){const ee=k>>D-14&16383,P=m[ee];if(P.len)D-=P.len,u(P.lit,x,k,D,B,Q,L,F,G),k=b.c,D=b.lc;else{if(!P.p)throw new Error("hufDecode issues");let K;for(K=0;K<P.lit;K++){const te=l(g[P.p[K]]);for(;D<te&&Q.value<U;)f(k,D,B,Q),k=p.c,D=p.lc;if(D>=te&&h(g[P.p[K]])==(k>>D-te&(1<<te)-1)){D-=te,u(P.p[K],x,k,D,B,Q,L,F,G),k=b.c,D=b.lc;break}}if(K==P.lit)throw new Error("hufDecode issues")}}const q=8-R&7;for(k>>=q,D-=q;D>0;){const ee=m[k<<14-D&16383];if(ee.len)D-=ee.len,u(ee.lit,x,k,D,B,Q,L,F,G),k=b.c,D=b.lc;else throw new Error("hufDecode issues")}return!0}function S(g,m,B,Q,R,x){const _={value:0},L=B.value,F=Me(m,B),k=Me(m,B);B.value+=4;const D=Me(m,B);if(B.value+=4,F<0||F>=65537||k<0||k>=65537)throw new Error("Something wrong with HUF_ENCSIZE");const G=new Array(65537),U=new Array(16384);s(U);const q=Q-(B.value-L);if(c(g,B,q,F,k,G),D>8*(Q-(B.value-L)))throw new Error("Something wrong with hufUncompress");d(G,F,k,U),T(G,U,g,B,D,k,x,R,_)}function M(g,m,B){for(let Q=0;Q<B;++Q)m[Q]=g[m[Q]]}function j(g){for(let m=1;m<g.length;m++){const B=g[m-1]+g[m]-128;g[m]=B}}function z(g,m){let B=0,Q=Math.floor((g.length+1)/2),R=0;const x=g.length-1;for(;!(R>x||(m[R++]=g[B++],R>x));)m[R++]=g[Q++]}function J(g){let m=g.byteLength;const B=new Array;let Q=0;const R=new DataView(g);for(;m>0;){const x=R.getInt8(Q++);if(x<0){const _=-x;m-=_+1;for(let L=0;L<_;L++)B.push(R.getUint8(Q++))}else{const _=x;m-=2;const L=R.getUint8(Q++);for(let F=0;F<_+1;F++)B.push(L)}}return B}function Z(g,m,B,Q,R,x){let _=new DataView(x.buffer);const L=B[g.idx[0]].width,F=B[g.idx[0]].height,k=3,D=Math.floor(L/8),G=Math.ceil(L/8),U=Math.ceil(F/8),q=L-(G-1)*8,ee=F-(U-1)*8,P={value:0},K=new Array(k),te=new Array(k),Ie=new Array(k),Qe=new Array(k),st=new Array(k);for(let ae=0;ae<k;++ae)st[ae]=m[g.idx[ae]],K[ae]=ae<1?0:K[ae-1]+G*U,te[ae]=new Float32Array(64),Ie[ae]=new Uint16Array(64),Qe[ae]=new Uint16Array(G*64);for(let ae=0;ae<U;++ae){let Se=8;ae==U-1&&(Se=ee);let rt=8;for(let ce=0;ce<G;++ce){ce==G-1&&(rt=q);for(let de=0;de<k;++de)Ie[de].fill(0),Ie[de][0]=R[K[de]++],Y(P,Q,Ie[de]),$(Ie[de],te[de]),W(te[de]);V(te);for(let de=0;de<k;++de)X(te[de],Qe[de],ce*64)}let _e=0;for(let ce=0;ce<k;++ce){const de=B[g.idx[ce]].type;for(let Rt=8*ae;Rt<8*ae+Se;++Rt){_e=st[ce][Rt];for(let fs=0;fs<D;++fs){const bt=fs*64+(Rt&7)*8;_.setUint16(_e+0*de,Qe[ce][bt+0],!0),_.setUint16(_e+2*de,Qe[ce][bt+1],!0),_.setUint16(_e+4*de,Qe[ce][bt+2],!0),_.setUint16(_e+6*de,Qe[ce][bt+3],!0),_.setUint16(_e+8*de,Qe[ce][bt+4],!0),_.setUint16(_e+10*de,Qe[ce][bt+5],!0),_.setUint16(_e+12*de,Qe[ce][bt+6],!0),_.setUint16(_e+14*de,Qe[ce][bt+7],!0),_e+=16*de}}if(D!=G)for(let Rt=8*ae;Rt<8*ae+Se;++Rt){const fs=st[ce][Rt]+8*D*2*de,bt=D*64+(Rt&7)*8;for(let Os=0;Os<rt;++Os)_.setUint16(fs+Os*2*de,Qe[ce][bt+Os],!0)}}}const ue=new Uint16Array(L);_=new DataView(x.buffer);for(let ae=0;ae<k;++ae){B[g.idx[ae]].decoded=!0;const Se=B[g.idx[ae]].type;if(B[ae].type==2)for(let rt=0;rt<F;++rt){const _e=st[ae][rt];for(let ce=0;ce<L;++ce)ue[ce]=_.getUint16(_e+ce*2*Se,!0);for(let ce=0;ce<L;++ce)_.setFloat32(_e+ce*2*Se,H(ue[ce]),!0)}}}function Y(g,m,B){let Q,R=1;for(;R<64;)Q=m[g.value],Q==65280?R=64:Q>>8==255?R+=Q&255:(B[R]=Q,R++),g.value++}function $(g,m){m[0]=H(g[0]),m[1]=H(g[1]),m[2]=H(g[5]),m[3]=H(g[6]),m[4]=H(g[14]),m[5]=H(g[15]),m[6]=H(g[27]),m[7]=H(g[28]),m[8]=H(g[2]),m[9]=H(g[4]),m[10]=H(g[7]),m[11]=H(g[13]),m[12]=H(g[16]),m[13]=H(g[26]),m[14]=H(g[29]),m[15]=H(g[42]),m[16]=H(g[3]),m[17]=H(g[8]),m[18]=H(g[12]),m[19]=H(g[17]),m[20]=H(g[25]),m[21]=H(g[30]),m[22]=H(g[41]),m[23]=H(g[43]),m[24]=H(g[9]),m[25]=H(g[11]),m[26]=H(g[18]),m[27]=H(g[24]),m[28]=H(g[31]),m[29]=H(g[40]),m[30]=H(g[44]),m[31]=H(g[53]),m[32]=H(g[10]),m[33]=H(g[19]),m[34]=H(g[23]),m[35]=H(g[32]),m[36]=H(g[39]),m[37]=H(g[45]),m[38]=H(g[52]),m[39]=H(g[54]),m[40]=H(g[20]),m[41]=H(g[22]),m[42]=H(g[33]),m[43]=H(g[38]),m[44]=H(g[46]),m[45]=H(g[51]),m[46]=H(g[55]),m[47]=H(g[60]),m[48]=H(g[21]),m[49]=H(g[34]),m[50]=H(g[37]),m[51]=H(g[47]),m[52]=H(g[50]),m[53]=H(g[56]),m[54]=H(g[59]),m[55]=H(g[61]),m[56]=H(g[35]),m[57]=H(g[36]),m[58]=H(g[48]),m[59]=H(g[49]),m[60]=H(g[57]),m[61]=H(g[58]),m[62]=H(g[62]),m[63]=H(g[63])}function W(g){const m=.5*Math.cos(.7853975),B=.5*Math.cos(3.14159/16),Q=.5*Math.cos(3.14159/8),R=.5*Math.cos(3*3.14159/16),x=.5*Math.cos(5*3.14159/16),_=.5*Math.cos(3*3.14159/8),L=.5*Math.cos(7*3.14159/16),F=new Array(4),k=new Array(4),D=new Array(4),G=new Array(4);for(let U=0;U<8;++U){const q=U*8;F[0]=Q*g[q+2],F[1]=_*g[q+2],F[2]=Q*g[q+6],F[3]=_*g[q+6],k[0]=B*g[q+1]+R*g[q+3]+x*g[q+5]+L*g[q+7],k[1]=R*g[q+1]-L*g[q+3]-B*g[q+5]-x*g[q+7],k[2]=x*g[q+1]-B*g[q+3]+L*g[q+5]+R*g[q+7],k[3]=L*g[q+1]-x*g[q+3]+R*g[q+5]-B*g[q+7],D[0]=m*(g[q+0]+g[q+4]),D[3]=m*(g[q+0]-g[q+4]),D[1]=F[0]+F[3],D[2]=F[1]-F[2],G[0]=D[0]+D[1],G[1]=D[3]+D[2],G[2]=D[3]-D[2],G[3]=D[0]-D[1],g[q+0]=G[0]+k[0],g[q+1]=G[1]+k[1],g[q+2]=G[2]+k[2],g[q+3]=G[3]+k[3],g[q+4]=G[3]-k[3],g[q+5]=G[2]-k[2],g[q+6]=G[1]-k[1],g[q+7]=G[0]-k[0]}for(let U=0;U<8;++U)F[0]=Q*g[16+U],F[1]=_*g[16+U],F[2]=Q*g[48+U],F[3]=_*g[48+U],k[0]=B*g[8+U]+R*g[24+U]+x*g[40+U]+L*g[56+U],k[1]=R*g[8+U]-L*g[24+U]-B*g[40+U]-x*g[56+U],k[2]=x*g[8+U]-B*g[24+U]+L*g[40+U]+R*g[56+U],k[3]=L*g[8+U]-x*g[24+U]+R*g[40+U]-B*g[56+U],D[0]=m*(g[U]+g[32+U]),D[3]=m*(g[U]-g[32+U]),D[1]=F[0]+F[3],D[2]=F[1]-F[2],G[0]=D[0]+D[1],G[1]=D[3]+D[2],G[2]=D[3]-D[2],G[3]=D[0]-D[1],g[0+U]=G[0]+k[0],g[8+U]=G[1]+k[1],g[16+U]=G[2]+k[2],g[24+U]=G[3]+k[3],g[32+U]=G[3]-k[3],g[40+U]=G[2]-k[2],g[48+U]=G[1]-k[1],g[56+U]=G[0]-k[0]}function V(g){for(let m=0;m<64;++m){const B=g[0][m],Q=g[1][m],R=g[2][m];g[0][m]=B+1.5747*R,g[1][m]=B-.1873*Q-.4682*R,g[2][m]=B+1.8556*Q}}function X(g,m,B){for(let Q=0;Q<64;++Q)m[B+Q]=As.toHalfFloat(le(g[Q]))}function le(g){return g<=1?Math.sign(g)*Math.pow(Math.abs(g),2.2):Math.sign(g)*Math.pow(t,Math.abs(g)-1)}function be(g){return new DataView(g.array.buffer,g.offset.value,g.size)}function ge(g){const m=g.viewer.buffer.slice(g.offset.value,g.offset.value+g.size),B=new Uint8Array(J(m)),Q=new Uint8Array(B.length);return j(B),z(B,Q),new DataView(Q.buffer)}function De(g){const m=g.array.slice(g.offset.value,g.offset.value+g.size),B=Fs(m),Q=new Uint8Array(B.length);return j(B),z(B,Q),new DataView(Q.buffer)}function ke(g){const m=g.viewer,B={value:g.offset.value},Q=new Uint16Array(g.columns*g.lines*(g.inputChannels.length*g.type)),R=new Uint8Array(8192);let x=0;const _=new Array(g.inputChannels.length);for(let ee=0,P=g.inputChannels.length;ee<P;ee++)_[ee]={},_[ee].start=x,_[ee].end=_[ee].start,_[ee].nx=g.columns,_[ee].ny=g.lines,_[ee].size=g.type,x+=_[ee].nx*_[ee].ny*_[ee].size;const L=us(m,B),F=us(m,B);if(F>=8192)throw new Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(L<=F)for(let ee=0;ee<F-L+1;ee++)R[ee+L]=Ke(m,B);const k=new Uint16Array(65536),D=n(R,k),G=Me(m,B);S(g.array,m,B,G,Q,x);for(let ee=0;ee<g.inputChannels.length;++ee){const P=_[ee];for(let K=0;K<_[ee].size;++K)v(Q,P.start+K,P.nx,P.size,P.ny,P.nx*P.size,D)}M(k,Q,x);let U=0;const q=new Uint8Array(Q.buffer.byteLength);for(let ee=0;ee<g.lines;ee++)for(let P=0;P<g.inputChannels.length;P++){const K=_[P],te=K.nx*K.size,Ie=new Uint8Array(Q.buffer,K.end*2,te*2);q.set(Ie,U),U+=te*2,K.end+=te}return new DataView(q.buffer)}function qe(g){const m=g.array.slice(g.offset.value,g.offset.value+g.size),B=Fs(m),Q=g.inputChannels.length*g.lines*g.columns*g.totalBytes,R=new ArrayBuffer(Q),x=new DataView(R);let _=0,L=0;const F=new Array(4);for(let k=0;k<g.lines;k++)for(let D=0;D<g.inputChannels.length;D++){let G=0;switch(g.inputChannels[D].pixelType){case 1:F[0]=_,F[1]=F[0]+g.columns,_=F[1]+g.columns;for(let U=0;U<g.columns;++U){const q=B[F[0]++]<<8|B[F[1]++];G+=q,x.setUint16(L,G,!0),L+=2}break;case 2:F[0]=_,F[1]=F[0]+g.columns,F[2]=F[1]+g.columns,_=F[2]+g.columns;for(let U=0;U<g.columns;++U){const q=B[F[0]++]<<24|B[F[1]++]<<16|B[F[2]++]<<8;G+=q,x.setUint32(L,G,!0),L+=4}break}}return x}function pe(g){const m=g.viewer,B={value:g.offset.value},Q=new Uint8Array(g.columns*g.lines*(g.inputChannels.length*g.type*2)),R={version:Ne(m,B),unknownUncompressedSize:Ne(m,B),unknownCompressedSize:Ne(m,B),acCompressedSize:Ne(m,B),dcCompressedSize:Ne(m,B),rleCompressedSize:Ne(m,B),rleUncompressedSize:Ne(m,B),rleRawSize:Ne(m,B),totalAcUncompressedCount:Ne(m,B),totalDcUncompressedCount:Ne(m,B),acCompression:Ne(m,B)};if(R.version<2)throw new Error("EXRLoader.parse: "+Yt.compression+" version "+R.version+" is unsupported");const x=new Array;let _=us(m,B)-2;for(;_>0;){const P=ze(m.buffer,B),K=Ke(m,B),te=K>>2&3,Ie=(K>>4)-1,Qe=new Int8Array([Ie])[0],st=Ke(m,B);x.push({name:P,index:Qe,type:st,compression:te}),_-=P.length+3}const L=Yt.channels,F=new Array(g.inputChannels.length);for(let P=0;P<g.inputChannels.length;++P){const K=F[P]={},te=L[P];K.name=te.name,K.compression=0,K.decoded=!1,K.type=te.pixelType,K.pLinear=te.pLinear,K.width=g.columns,K.height=g.lines}const k={idx:new Array(3)};for(let P=0;P<g.inputChannels.length;++P){const K=F[P];for(let te=0;te<x.length;++te){const Ie=x[te];K.name==Ie.name&&(K.compression=Ie.compression,Ie.index>=0&&(k.idx[Ie.index]=P),K.offset=P)}}let D,G,U;if(R.acCompressedSize>0)switch(R.acCompression){case 0:D=new Uint16Array(R.totalAcUncompressedCount),S(g.array,m,B,R.acCompressedSize,D,R.totalAcUncompressedCount);break;case 1:const P=g.array.slice(B.value,B.value+R.totalAcUncompressedCount),K=Fs(P);D=new Uint16Array(K.buffer),B.value+=R.totalAcUncompressedCount;break}if(R.dcCompressedSize>0){const P={array:g.array,offset:B,size:R.dcCompressedSize};G=new Uint16Array(De(P).buffer),B.value+=R.dcCompressedSize}if(R.rleRawSize>0){const P=g.array.slice(B.value,B.value+R.rleCompressedSize),K=Fs(P);U=J(K.buffer),B.value+=R.rleCompressedSize}let q=0;const ee=new Array(F.length);for(let P=0;P<ee.length;++P)ee[P]=new Array;for(let P=0;P<g.lines;++P)for(let K=0;K<F.length;++K)ee[K].push(q),q+=F[K].width*g.type*2;Z(k,ee,F,D,G,Q);for(let P=0;P<F.length;++P){const K=F[P];if(!K.decoded)switch(K.compression){case 2:let te=0,Ie=0;for(let Qe=0;Qe<g.lines;++Qe){let st=ee[P][te];for(let ue=0;ue<K.width;++ue){for(let ae=0;ae<2*K.type;++ae)Q[st++]=U[Ie+ae*K.width*K.height];Ie++}te++}break;case 1:default:throw new Error("EXRLoader.parse: unsupported channel compression")}}return new DataView(Q.buffer)}function ze(g,m){const B=new Uint8Array(g);let Q=0;for(;B[m.value+Q]!=0;)Q+=1;const R=new TextDecoder().decode(B.slice(m.value,m.value+Q));return m.value=m.value+Q+1,R}function Nt(g,m,B){const Q=new TextDecoder().decode(new Uint8Array(g).slice(m.value,m.value+B));return m.value=m.value+B,Q}function Ut(g,m){const B=Le(g,m),Q=Me(g,m);return[B,Q]}function as(g,m){const B=Me(g,m),Q=Me(g,m);return[B,Q]}function Le(g,m){const B=g.getInt32(m.value,!0);return m.value=m.value+4,B}function Me(g,m){const B=g.getUint32(m.value,!0);return m.value=m.value+4,B}function Gt(g,m){const B=g[m.value];return m.value=m.value+1,B}function Ke(g,m){const B=g.getUint8(m.value);return m.value=m.value+1,B}const Ne=function(g,m){let B;return"getBigInt64"in DataView.prototype?B=Number(g.getBigInt64(m.value,!0)):B=g.getUint32(m.value+4,!0)+Number(g.getUint32(m.value,!0)<<32),m.value+=8,B};function He(g,m){const B=g.getFloat32(m.value,!0);return m.value+=4,B}function wo(g,m){return As.toHalfFloat(He(g,m))}function H(g){const m=(g&31744)>>10,B=g&1023;return(g>>15?-1:1)*(m?m===31?B?NaN:1/0:Math.pow(2,m-15)*(1+B/1024):6103515625e-14*(B/1024))}function us(g,m){const B=g.getUint16(m.value,!0);return m.value+=2,B}function yo(g,m){return H(us(g,m))}function Qo(g,m,B,Q){const R=B.value,x=[];for(;B.value<R+Q-1;){const _=ze(m,B),L=Le(g,B),F=Ke(g,B);B.value+=3;const k=Le(g,B),D=Le(g,B);x.push({name:_,pixelType:L,pLinear:F,xSampling:k,ySampling:D})}return B.value+=1,x}function vo(g,m){const B=He(g,m),Q=He(g,m),R=He(g,m),x=He(g,m),_=He(g,m),L=He(g,m),F=He(g,m),k=He(g,m);return{redX:B,redY:Q,greenX:R,greenY:x,blueX:_,blueY:L,whiteX:F,whiteY:k}}function xo(g,m){const B=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],Q=Ke(g,m);return B[Q]}function So(g,m){const B=Le(g,m),Q=Le(g,m),R=Le(g,m),x=Le(g,m);return{xMin:B,yMin:Q,xMax:R,yMax:x}}function To(g,m){const B=["INCREASING_Y","DECREASING_Y","RANDOM_Y"],Q=Ke(g,m);return B[Q]}function Ro(g,m){const B=["ENVMAP_LATLONG","ENVMAP_CUBE"],Q=Ke(g,m);return B[Q]}function Do(g,m){const B=["ONE_LEVEL","MIPMAP_LEVELS","RIPMAP_LEVELS"],Q=["ROUND_DOWN","ROUND_UP"],R=Me(g,m),x=Me(g,m),_=Ke(g,m);return{xSize:R,ySize:x,levelMode:B[_&15],roundingMode:Q[_>>4]}}function ko(g,m){const B=He(g,m),Q=He(g,m);return[B,Q]}function Mo(g,m){const B=He(g,m),Q=He(g,m),R=He(g,m);return[B,Q,R]}function _o(g,m,B,Q,R){if(Q==="string"||Q==="stringvector"||Q==="iccProfile")return Nt(m,B,R);if(Q==="chlist")return Qo(g,m,B,R);if(Q==="chromaticities")return vo(g,B);if(Q==="compression")return xo(g,B);if(Q==="box2i")return So(g,B);if(Q==="envmap")return Ro(g,B);if(Q==="tiledesc")return Do(g,B);if(Q==="lineOrder")return To(g,B);if(Q==="float")return He(g,B);if(Q==="v2f")return ko(g,B);if(Q==="v3f")return Mo(g,B);if(Q==="int")return Le(g,B);if(Q==="rational")return Ut(g,B);if(Q==="timecode")return as(g,B);if(Q==="preview")return B.value+=R,"skipped";B.value+=R}function Fo(g,m){const B=Math.log2(g);return m=="ROUND_DOWN"?Math.floor(B):Math.ceil(B)}function Lo(g,m,B){let Q=0;switch(g.levelMode){case"ONE_LEVEL":Q=1;break;case"MIPMAP_LEVELS":Q=Fo(Math.max(m,B),g.roundingMode)+1;break;case"RIPMAP_LEVELS":throw new Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.")}return Q}function Ci(g,m,B,Q){const R=new Array(g);for(let x=0;x<g;x++){const _=1<<x;let L=m/_|0;Q=="ROUND_UP"&&L*_<m&&(L+=1);const F=Math.max(L,1);R[x]=(F+B-1)/B|0}return R}function No(){const g=this,m=g.offset,B={value:0};for(let Q=0;Q<g.tileCount;Q++){const R=Le(g.viewer,m),x=Le(g.viewer,m);m.value+=8,g.size=Me(g.viewer,m);const _=R*g.blockWidth,L=x*g.blockHeight;g.columns=_+g.blockWidth>g.width?g.width-_:g.blockWidth,g.lines=L+g.blockHeight>g.height?g.height-L:g.blockHeight;const F=g.columns*g.totalBytes,k=g.size<g.lines*F?g.uncompress(g):be(g);m.value+=g.size;for(let D=0;D<g.lines;D++){const G=D*g.columns*g.totalBytes;for(let U=0;U<g.inputChannels.length;U++){const q=Yt.channels[U].name,ee=g.channelByteOffsets[q]*g.columns,P=g.decodeChannels[q];if(P===void 0)continue;B.value=G+ee;const K=(g.height-(1+L+D))*g.outLineWidth;for(let te=0;te<g.columns;te++){const Ie=K+(te+_)*g.outputChannels+P;g.byteArray[Ie]=g.getter(k,B)}}}}}function Uo(){const g=this,m=g.offset,B={value:0};for(let Q=0;Q<g.height/g.blockHeight;Q++){const R=Le(g.viewer,m)-Yt.dataWindow.yMin;g.size=Me(g.viewer,m),g.lines=R+g.blockHeight>g.height?g.height-R:g.blockHeight;const x=g.columns*g.totalBytes,_=g.size<g.lines*x?g.uncompress(g):be(g);m.value+=g.size;for(let L=0;L<g.blockHeight;L++){const F=Q*g.blockHeight,k=L+g.scanOrder(F);if(k>=g.height)continue;const D=L*x,G=(g.height-1-k)*g.outLineWidth;for(let U=0;U<g.inputChannels.length;U++){const q=Yt.channels[U].name,ee=g.channelByteOffsets[q]*g.columns,P=g.decodeChannels[q];if(P!==void 0){B.value=D+ee;for(let K=0;K<g.columns;K++){const te=G+K*g.outputChannels+P;g.byteArray[te]=g.getter(_,B)}}}}}}function Go(g,m,B){const Q={};if(g.getUint32(0,!0)!=20000630)throw new Error("THREE.EXRLoader: Provided file doesn't appear to be in OpenEXR format.");Q.version=g.getUint8(4);const R=g.getUint8(5);Q.spec={singleTile:!!(R&2),longName:!!(R&4),deepFormat:!!(R&8),multiPart:!!(R&16)},B.value=8;let x=!0;for(;x;){const _=ze(m,B);if(_==0)x=!1;else{const L=ze(m,B),F=Me(g,B),k=_o(g,m,B,L,F);k===void 0?console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${L}'.`):Q[_]=k}}if((R&-7)!=0)throw console.error("THREE.EXRHeader:",Q),new Error("THREE.EXRLoader: Provided file is currently unsupported.");return Q}function Po(g,m,B,Q,R){const x={size:0,viewer:m,array:B,offset:Q,width:g.dataWindow.xMax-g.dataWindow.xMin+1,height:g.dataWindow.yMax-g.dataWindow.yMin+1,inputChannels:g.channels,channelByteOffsets:{},scanOrder:null,totalBytes:null,columns:null,lines:null,type:null,uncompress:null,getter:null,format:null,colorSpace:We};switch(g.compression){case"NO_COMPRESSION":x.blockHeight=1,x.uncompress=be;break;case"RLE_COMPRESSION":x.blockHeight=1,x.uncompress=ge;break;case"ZIPS_COMPRESSION":x.blockHeight=1,x.uncompress=De;break;case"ZIP_COMPRESSION":x.blockHeight=16,x.uncompress=De;break;case"PIZ_COMPRESSION":x.blockHeight=32,x.uncompress=ke;break;case"PXR24_COMPRESSION":x.blockHeight=16,x.uncompress=qe;break;case"DWAA_COMPRESSION":x.blockHeight=32,x.uncompress=pe;break;case"DWAB_COMPRESSION":x.blockHeight=256,x.uncompress=pe;break;default:throw new Error("EXRLoader.parse: "+g.compression+" is unsupported")}const _={};for(const D of g.channels)switch(D.name){case"Y":case"R":case"G":case"B":case"A":_[D.name]=!0,x.type=D.pixelType}let L=!1;if(_.R&&_.G&&_.B)L=!_.A,x.outputChannels=4,x.decodeChannels={R:0,G:1,B:2,A:3};else if(_.Y)x.outputChannels=1,x.decodeChannels={Y:0};else throw new Error("EXRLoader.parse: file contains unsupported data channels.");if(x.type==1)switch(R){case wt:x.getter=yo;break;case it:x.getter=us;break}else if(x.type==2)switch(R){case wt:x.getter=He;break;case it:x.getter=wo}else throw new Error("EXRLoader.parse: unsupported pixelType "+x.type+" for "+g.compression+".");x.columns=x.width;const F=x.width*x.height*x.outputChannels;switch(R){case wt:x.byteArray=new Float32Array(F),L&&x.byteArray.fill(1,0,F);break;case it:x.byteArray=new Uint16Array(F),L&&x.byteArray.fill(15360,0,F);break;default:console.error("THREE.EXRLoader: unsupported type: ",R);break}let k=0;for(const D of g.channels)x.decodeChannels[D.name]!==void 0&&(x.channelByteOffsets[D.name]=k),k+=D.pixelType*2;if(x.totalBytes=k,x.outLineWidth=x.width*x.outputChannels,g.lineOrder==="INCREASING_Y"?x.scanOrder=D=>D:x.scanOrder=D=>x.height-1-D,x.outputChannels==4?(x.format=Pt,x.colorSpace=We):(x.format=rs,x.colorSpace=Zs),g.spec.singleTile){x.blockHeight=g.tiles.ySize,x.blockWidth=g.tiles.xSize;const D=Lo(g.tiles,x.width,x.height),G=Ci(D,x.width,g.tiles.xSize,g.tiles.roundingMode),U=Ci(D,x.height,g.tiles.ySize,g.tiles.roundingMode);x.tileCount=G[0]*U[0];for(let q=0;q<D;q++)for(let ee=0;ee<U[q];ee++)for(let P=0;P<G[q];P++)Ne(m,Q);x.decode=No.bind(x)}else{x.blockWidth=x.width;const D=Math.ceil(x.height/x.blockHeight);for(let G=0;G<D;G++)Ne(m,Q);x.decode=Uo.bind(x)}return x}const Bi={value:0},wi=new DataView(e),Oo=new Uint8Array(e),Yt=Go(wi,e,Bi),os=Po(Yt,wi,Oo,Bi,this.type);return os.decode(),{header:Yt,width:os.width,height:os.height,data:os.byteArray,format:os.format,colorSpace:os.colorSpace,type:this.type}}setDataType(e){return this.type=e,this}load(e,t,n,s){function i(a,r){a.colorSpace=r.colorSpace,a.minFilter=dt,a.magFilter=dt,a.generateMipmaps=!1,a.flipY=!1,t&&t(a,r)}return super.load(e,i,n,s)}}const lc=Object.freeze(Object.defineProperty({__proto__:null,EXRLoader:Pa},Symbol.toStringTag,{value:"Module"}));class Oa extends Ui{constructor(e){super(e),this.type=it}parse(e){const t=function(u,I){switch(u){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(I||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(I||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(I||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(I||""))}},n=function(u,I,C){I=I||1024;let E=u.pos,y=-1,w=0,v="",T=String.fromCharCode.apply(null,new Uint16Array(u.subarray(E,E+128)));for(;0>(y=T.indexOf(`
42
- `))&&w<I&&E<u.byteLength;)v+=T,w+=T.length,E+=128,T+=String.fromCharCode.apply(null,new Uint16Array(u.subarray(E,E+128)));return-1<y?(u.pos+=w+y+1,v+T.slice(0,y)):!1},s=function(u){const I=/^#\?(\S+)/,C=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,E=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,y=/^\s*FORMAT=(\S+)\s*$/,w=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,v={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let T,S;for((u.pos>=u.byteLength||!(T=n(u)))&&t(1,"no header found"),(S=T.match(I))||t(3,"bad initial token"),v.valid|=1,v.programtype=S[1],v.string+=T+`
43
- `;T=n(u),T!==!1;){if(v.string+=T+`
44
- `,T.charAt(0)==="#"){v.comments+=T+`
45
- `;continue}if((S=T.match(C))&&(v.gamma=parseFloat(S[1])),(S=T.match(E))&&(v.exposure=parseFloat(S[1])),(S=T.match(y))&&(v.valid|=2,v.format=S[1]),(S=T.match(w))&&(v.valid|=4,v.height=parseInt(S[1],10),v.width=parseInt(S[2],10)),v.valid&2&&v.valid&4)break}return v.valid&2||t(3,"missing format specifier"),v.valid&4||t(3,"missing image size specifier"),v},i=function(u,I,C){const E=I;if(E<8||E>32767||u[0]!==2||u[1]!==2||u[2]&128)return new Uint8Array(u);E!==(u[2]<<8|u[3])&&t(3,"wrong scanline width");const y=new Uint8Array(4*I*C);y.length||t(4,"unable to allocate buffer space");let w=0,v=0;const T=4*E,S=new Uint8Array(4),M=new Uint8Array(T);let j=C;for(;j>0&&v<u.byteLength;){v+4>u.byteLength&&t(1),S[0]=u[v++],S[1]=u[v++],S[2]=u[v++],S[3]=u[v++],(S[0]!=2||S[1]!=2||(S[2]<<8|S[3])!=E)&&t(3,"bad rgbe scanline format");let z=0,J;for(;z<T&&v<u.byteLength;){J=u[v++];const Y=J>128;if(Y&&(J-=128),(J===0||z+J>T)&&t(3,"bad scanline data"),Y){const $=u[v++];for(let W=0;W<J;W++)M[z++]=$}else M.set(u.subarray(v,v+J),z),z+=J,v+=J}const Z=E;for(let Y=0;Y<Z;Y++){let $=0;y[w]=M[Y+$],$+=E,y[w+1]=M[Y+$],$+=E,y[w+2]=M[Y+$],$+=E,y[w+3]=M[Y+$],w+=4}j--}return y},a=function(u,I,C,E){const y=u[I+3],w=Math.pow(2,y-128)/255;C[E+0]=u[I+0]*w,C[E+1]=u[I+1]*w,C[E+2]=u[I+2]*w,C[E+3]=1},r=function(u,I,C,E){const y=u[I+3],w=Math.pow(2,y-128)/255;C[E+0]=As.toHalfFloat(Math.min(u[I+0]*w,65504)),C[E+1]=As.toHalfFloat(Math.min(u[I+1]*w,65504)),C[E+2]=As.toHalfFloat(Math.min(u[I+2]*w,65504)),C[E+3]=As.toHalfFloat(1)},A=new Uint8Array(e);A.pos=0;const c=s(A),l=c.width,h=c.height,d=i(A.subarray(A.pos),l,h);let p,f,b;switch(this.type){case wt:b=d.length/4;const u=new Float32Array(b*4);for(let C=0;C<b;C++)a(d,C*4,u,C*4);p=u,f=wt;break;case it:b=d.length/4;const I=new Uint16Array(b*4);for(let C=0;C<b;C++)r(d,C*4,I,C*4);p=I,f=it;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:l,height:h,data:p,header:c.string,gamma:c.gamma,exposure:c.exposure,type:f}}setDataType(e){return this.type=e,this}load(e,t,n,s){function i(a,r){switch(a.type){case wt:case it:a.colorSpace=We,a.minFilter=dt,a.magFilter=dt,a.generateMipmaps=!1,a.flipY=!0;break}t&&t(a,r)}return super.load(e,i,n,s)}}const hc=Object.freeze(Object.defineProperty({__proto__:null,RGBELoader:Oa},Symbol.toStringTag,{value:"Module"}));function Ha(o,e,t){const n=t.length-o-1;if(e>=t[n])return n-1;if(e<=t[o])return o;let s=o,i=n,a=Math.floor((s+i)/2);for(;e<t[a]||e>=t[a+1];)e<t[a]?i=a:s=a,a=Math.floor((s+i)/2);return a}function gc(o,e,t,n){const s=[],i=[],a=[];s[0]=1;for(let r=1;r<=t;++r){i[r]=e-n[o+1-r],a[r]=n[o+r]-e;let A=0;for(let c=0;c<r;++c){const l=a[c+1],h=i[r-c],d=s[c]/(l+h);s[c]=A+l*d,A=h*d}s[r]=A}return s}function dc(o,e,t,n){const s=Ha(o,n,e),i=gc(s,n,o,e),a=new Mt(0,0,0,0);for(let r=0;r<=o;++r){const A=t[s-o+r],c=i[r],l=A.w*c;a.x+=A.x*l,a.y+=A.y*l,a.z+=A.z*l,a.w+=A.w*c}return a}function pc(o,e,t,n,s){const i=[];for(let h=0;h<=t;++h)i[h]=0;const a=[];for(let h=0;h<=n;++h)a[h]=i.slice(0);const r=[];for(let h=0;h<=t;++h)r[h]=i.slice(0);r[0][0]=1;const A=i.slice(0),c=i.slice(0);for(let h=1;h<=t;++h){A[h]=e-s[o+1-h],c[h]=s[o+h]-e;let d=0;for(let p=0;p<h;++p){const f=c[p+1],b=A[h-p];r[h][p]=f+b;const u=r[p][h-1]/r[h][p];r[p][h]=d+f*u,d=b*u}r[h][h]=d}for(let h=0;h<=t;++h)a[0][h]=r[h][t];for(let h=0;h<=t;++h){let d=0,p=1;const f=[];for(let b=0;b<=t;++b)f[b]=i.slice(0);f[0][0]=1;for(let b=1;b<=n;++b){let u=0;const I=h-b,C=t-b;h>=b&&(f[p][0]=f[d][0]/r[C+1][I],u=f[p][0]*r[I][C]);const E=I>=-1?1:-I,y=h-1<=C?b-1:t-h;for(let v=E;v<=y;++v)f[p][v]=(f[d][v]-f[d][v-1])/r[C+1][I+v],u+=f[p][v]*r[I+v][C];h<=C&&(f[p][b]=-f[d][b-1]/r[C+1][h],u+=f[p][b]*r[h][C]),a[b][h]=u;const w=d;d=p,p=w}}let l=t;for(let h=1;h<=n;++h){for(let d=0;d<=t;++d)a[h][d]*=l;l*=t-h}return a}function uc(o,e,t,n,s){const i=s<o?s:o,a=[],r=Ha(o,n,e),A=pc(r,n,o,i,e),c=[];for(let l=0;l<t.length;++l){const h=t[l].clone(),d=h.w;h.x*=d,h.y*=d,h.z*=d,c[l]=h}for(let l=0;l<=i;++l){const h=c[r-o].clone().multiplyScalar(A[l][0]);for(let d=1;d<=o;++d)h.add(c[r-o+d].clone().multiplyScalar(A[l][d]));a[l]=h}for(let l=i+1;l<=s+1;++l)a[l]=new Mt(0,0,0);return a}function fc(o,e){let t=1;for(let s=2;s<=o;++s)t*=s;let n=1;for(let s=2;s<=e;++s)n*=s;for(let s=2;s<=o-e;++s)n*=s;return t/n}function mc(o){const e=o.length,t=[],n=[];for(let i=0;i<e;++i){const a=o[i];t[i]=new N(a.x,a.y,a.z),n[i]=a.w}const s=[];for(let i=0;i<e;++i){const a=t[i].clone();for(let r=1;r<=i;++r)a.sub(s[i-r].clone().multiplyScalar(fc(i,r)*n[r]));s[i]=a.divideScalar(n[0])}return s}function bc(o,e,t,n,s){const i=uc(o,e,t,n,s);return mc(i)}class Ic extends mr{constructor(e,t,n,s,i){super(),this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=s||0,this.endKnot=i||this.knots.length-1;for(let a=0;a<n.length;++a){const r=n[a];this.controlPoints[a]=new Mt(r.x,r.y,r.z,r.w)}}getPoint(e,t=new N){const n=t,s=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),i=dc(this.degree,this.knots,this.controlPoints,s);return i.w!==1&&i.divideScalar(i.w),n.set(i.x,i.y,i.z)}getTangent(e,t=new N){const n=t,s=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),i=bc(this.degree,this.knots,this.controlPoints,s,1);return n.copy(i[1]).normalize(),n}}let se,xe,Ve;class Ec extends Dt{constructor(e){super(e)}load(e,t,n,s){const i=this,a=i.path===""?Vt.extractUrlBase(e):i.path,r=new gt(this.manager);r.setPath(i.path),r.setResponseType("arraybuffer"),r.setRequestHeader(i.requestHeader),r.setWithCredentials(i.withCredentials),r.load(e,function(A){try{t(i.parse(A,a))}catch(c){s?s(c):console.error(c),i.manager.itemError(e)}},n,s)}parse(e,t){if(vc(e))se=new Qc().parse(e);else{const s=Ya(e);if(!xc(s))throw new Error("THREE.FBXLoader: Unknown format.");if(za(s)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+za(s));se=new yc().parse(s)}const n=new In(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new Cc(n,this.manager).parse(se)}getFbxTree(){return se}}class Cc{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){xe=this.parseConnections();const e=this.parseImages(),t=this.parseTextures(e),n=this.parseMaterials(t),s=this.parseDeformers(),i=new Bc().parse(s);return this.parseScene(s,i,n),Ve}parseConnections(){const e=new Map;return"Connections"in se&&se.Connections.connections.forEach(function(t){const n=t[0],s=t[1],i=t[2];e.has(n)||e.set(n,{parents:[],children:[]});const a={ID:s,relationship:i};e.get(n).parents.push(a),e.has(s)||e.set(s,{parents:[],children:[]});const r={ID:n,relationship:i};e.get(s).children.push(r)}),e}parseImages(){const e={},t={};if("Video"in se.Objects){const n=se.Objects.Video;for(const s in n){const i=n[s],a=parseInt(s);if(e[a]=i.RelativeFilename||i.Filename,"Content"in i){const r=i.Content instanceof ArrayBuffer&&i.Content.byteLength>0,A=typeof i.Content=="string"&&i.Content!=="";if(r||A){const c=this.parseImage(n[s]);t[i.RelativeFilename||i.Filename]=c}}}}for(const n in e){const s=e[n];t[s]!==void 0?e[n]=t[s]:e[n]=e[n].split("\\").pop()}return e}parseImage(e){const t=e.Content,n=e.RelativeFilename||e.Filename,s=n.slice(n.lastIndexOf(".")+1).toLowerCase();let i;switch(s){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 ",n),i="image/tga";break;default:console.warn('FBXLoader: Image type "'+s+'" is not supported.');return}if(typeof t=="string")return"data:"+i+";base64,"+t;{const a=new Uint8Array(t);return window.URL.createObjectURL(new Blob([a],{type:i}))}}parseTextures(e){const t=new Map;if("Texture"in se.Objects){const n=se.Objects.Texture;for(const s in n){const i=this.parseTexture(n[s],e);t.set(parseInt(s),i)}}return t}parseTexture(e,t){const n=this.loadTexture(e,t);n.ID=e.id,n.name=e.attrName;const s=e.WrapModeU,i=e.WrapModeV,a=s!==void 0?s.value:0,r=i!==void 0?i.value:0;if(n.wrapS=a===0?Wt:zs,n.wrapT=r===0?Wt:zs,"Scaling"in e){const A=e.Scaling.value;n.repeat.x=A[0],n.repeat.y=A[1]}if("Translation"in e){const A=e.Translation.value;n.offset.x=A[0],n.offset.y=A[1]}return n}loadTexture(e,t){const n=new Set(["tga","tif","tiff","exr","dds","hdr","ktx2"]),s=e.FileName.split(".").pop().toLowerCase(),i=n.has(s)?this.manager.getHandler(`.${s}`):this.textureLoader;if(!i)return console.warn(`FBXLoader: ${s.toUpperCase()} loader not found, creating placeholder texture for`,e.RelativeFilename),new vn;const a=i.path;a||i.setPath(this.textureLoader.path);const r=xe.get(e.id).children;let A;r!==void 0&&r.length>0&&t[r[0].ID]!==void 0&&(A=t[r[0].ID],(A.indexOf("blob:")===0||A.indexOf("data:")===0)&&i.setPath(void 0));const c=i.load(A);return i.setPath(a),c}parseMaterials(e){const t=new Map;if("Material"in se.Objects){const n=se.Objects.Material;for(const s in n){const i=this.parseMaterial(n[s],e);i!==null&&t.set(parseInt(s),i)}}return t}parseMaterial(e,t){const n=e.id,s=e.attrName;let i=e.ShadingModel;if(typeof i=="object"&&(i=i.value),!xe.has(n))return null;const a=this.parseParameters(e,t,n);let r;switch(i.toLowerCase()){case"phong":r=new ws;break;case"lambert":r=new br;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',i),r=new ws;break}return r.setValues(a),r.name=s,r}parseParameters(e,t,n){const s={};e.BumpFactor&&(s.bumpScale=e.BumpFactor.value),e.Diffuse?s.color=Xe.toWorkingColorSpace(new Be().fromArray(e.Diffuse.value),re):e.DiffuseColor&&(e.DiffuseColor.type==="Color"||e.DiffuseColor.type==="ColorRGB")&&(s.color=Xe.toWorkingColorSpace(new Be().fromArray(e.DiffuseColor.value),re)),e.DisplacementFactor&&(s.displacementScale=e.DisplacementFactor.value),e.Emissive?s.emissive=Xe.toWorkingColorSpace(new Be().fromArray(e.Emissive.value),re):e.EmissiveColor&&(e.EmissiveColor.type==="Color"||e.EmissiveColor.type==="ColorRGB")&&(s.emissive=Xe.toWorkingColorSpace(new Be().fromArray(e.EmissiveColor.value),re)),e.EmissiveFactor&&(s.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),e.Opacity&&(s.opacity=parseFloat(e.Opacity.value)),s.opacity<1&&(s.transparent=!0),e.ReflectionFactor&&(s.reflectivity=e.ReflectionFactor.value),e.Shininess&&(s.shininess=e.Shininess.value),e.Specular?s.specular=Xe.toWorkingColorSpace(new Be().fromArray(e.Specular.value),re):e.SpecularColor&&e.SpecularColor.type==="Color"&&(s.specular=Xe.toWorkingColorSpace(new Be().fromArray(e.SpecularColor.value),re));const i=this;return xe.get(n).children.forEach(function(a){const r=a.relationship;switch(r){case"Bump":s.bumpMap=i.getTexture(t,a.ID);break;case"Maya|TEX_ao_map":s.aoMap=i.getTexture(t,a.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":s.map=i.getTexture(t,a.ID),s.map!==void 0&&(s.map.colorSpace=re);break;case"DisplacementColor":s.displacementMap=i.getTexture(t,a.ID);break;case"EmissiveColor":s.emissiveMap=i.getTexture(t,a.ID),s.emissiveMap!==void 0&&(s.emissiveMap.colorSpace=re);break;case"NormalMap":case"Maya|TEX_normal_map":s.normalMap=i.getTexture(t,a.ID);break;case"ReflectionColor":s.envMap=i.getTexture(t,a.ID),s.envMap!==void 0&&(s.envMap.mapping=Ir,s.envMap.colorSpace=re);break;case"SpecularColor":s.specularMap=i.getTexture(t,a.ID),s.specularMap!==void 0&&(s.specularMap.colorSpace=re);break;case"TransparentColor":case"TransparencyFactor":s.alphaMap=i.getTexture(t,a.ID),s.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",r);break}}),s}getTexture(e,t){return"LayeredTexture"in se.Objects&&t in se.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=xe.get(t).children[0].ID),e.get(t)}parseDeformers(){const e={},t={};if("Deformer"in se.Objects){const n=se.Objects.Deformer;for(const s in n){const i=n[s],a=xe.get(parseInt(s));if(i.attrType==="Skin"){const r=this.parseSkeleton(a,n);r.ID=s,a.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),r.geometryID=a.parents[0].ID,e[s]=r}else if(i.attrType==="BlendShape"){const r={id:s};r.rawTargets=this.parseMorphTargets(a,n),r.id=s,a.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[s]=r}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){const n=[];return e.children.forEach(function(s){const i=t[s.ID];if(i.attrType!=="Cluster")return;const a={ID:s.ID,indices:[],weights:[],transformLink:new oe().fromArray(i.TransformLink.a)};"Indexes"in i&&(a.indices=i.Indexes.a,a.weights=i.Weights.a),n.push(a)}),{rawBones:n,bones:[]}}parseMorphTargets(e,t){const n=[];for(let s=0;s<e.children.length;s++){const i=e.children[s],a=t[i.ID],r={name:a.attrName,initialWeight:a.DeformPercent,id:a.id,fullWeights:a.FullWeights.a};if(a.attrType!=="BlendShapeChannel")return;r.geoID=xe.get(parseInt(i.ID)).children.filter(function(A){return A.relationship===void 0})[0].ID,n.push(r)}return n}parseScene(e,t,n){Ve=new Xt;const s=this.parseModels(e.skeletons,t,n),i=se.Objects.Model,a=this;s.forEach(function(A){const c=i[A.ID];a.setLookAtProperties(A,c),xe.get(A.ID)?.parents?.forEach(function(l){const h=s.get(l.ID);h!==void 0&&h.add(A)}),A.parent===null&&Ve.add(A)}),this.bindSkeleton(e.skeletons,t,s),this.addGlobalSceneSettings(),Ve.traverse(function(A){if(A.userData.transformData){A.parent&&(A.userData.transformData.parentMatrix=A.parent.matrix,A.userData.transformData.parentMatrixWorld=A.parent.matrixWorld);const c=Ka(A.userData.transformData);A.applyMatrix4(c),A.updateWorldMatrix()}A.isSkinnedMesh&&(A.computeBoundingBox(),A.computeBoundingSphere(),A.boundingBox.expandByScalar(3),A.boundingSphere.radius*=3)});const r=new wc().parse();Ve.children.length===1&&Ve.children[0].isGroup&&(Ve.children[0].animations=r,Ve=Ve.children[0]),Ve.animations=r}parseModels(e,t,n){const s=new Map,i=se.Objects.Model;for(const a in i){const r=parseInt(a),A=i[a],c=xe.get(r);let l=this.buildSkeleton(c,e,r,A.attrName);if(!l){switch(A.attrType){case"Camera":l=this.createCamera(c);break;case"Light":l=this.createLight(c);break;case"Mesh":l=this.createMesh(c,t,n);break;case"NurbsCurve":l=this.createCurve(c,t);break;case"LimbNode":case"Root":l=new yn;break;case"Null":default:l=new Xt;break}l.name=A.attrName?pt.sanitizeNodeName(A.attrName):"",l.userData.originalName=A.attrName,l.ID=r}this.getTransformData(l,A),s.set(r,l)}return s}buildSkeleton(e,t,n,s){let i=null;return e?.parents.forEach(function(a){for(const r in t){const A=t[r];A.rawBones.forEach(function(c,l){if(c.ID===a.ID){const h=i;i=new yn,i.matrixWorld.copy(c.transformLink),i.name=s?pt.sanitizeNodeName(s):"",i.userData.originalName=s,i.ID=n,A.bones[l]=i,h!==null&&i.add(h)}})}}),i}createCamera(e){let t,n;if(e.children.forEach(function(s){const i=se.Objects.NodeAttribute[s.ID];i!==void 0&&(n=i)}),n===void 0)t=new Bt;else{let s=0;n.CameraProjectionType!==void 0&&n.CameraProjectionType.value===1&&(s=1);let i=1;n.NearPlane!==void 0&&(i=n.NearPlane.value/1e3);let a=1e3;n.FarPlane!==void 0&&(a=n.FarPlane.value/1e3);let r=window.innerWidth,A=window.innerHeight;n.AspectWidth!==void 0&&n.AspectHeight!==void 0&&(r=n.AspectWidth.value,A=n.AspectHeight.value);const c=r/A;let l=45;n.FieldOfView!==void 0&&(l=n.FieldOfView.value);const h=n.FocalLength?n.FocalLength.value:null;switch(s){case 0:t=new Hs(l,c,i,a),h!==null&&t.setFocalLength(h);break;case 1:console.warn("THREE.FBXLoader: Orthographic cameras not supported yet."),t=new Bt;break;default:console.warn("THREE.FBXLoader: Unknown camera type "+s+"."),t=new Bt;break}}return t}createLight(e){let t,n;if(e.children.forEach(function(s){const i=se.Objects.NodeAttribute[s.ID];i!==void 0&&(n=i)}),n===void 0)t=new Bt;else{let s;n.LightType===void 0?s=0:s=n.LightType.value;let i=16777215;n.Color!==void 0&&(i=Xe.toWorkingColorSpace(new Be().fromArray(n.Color.value),re));let a=n.Intensity===void 0?1:n.Intensity.value/100;n.CastLightOnObject!==void 0&&n.CastLightOnObject.value===0&&(a=0);let r=0;n.FarAttenuationEnd!==void 0&&(n.EnableFarAttenuation!==void 0&&n.EnableFarAttenuation.value===0?r=0:r=n.FarAttenuationEnd.value);const A=1;switch(s){case 0:t=new bn(i,a,r,A);break;case 1:t=new vi(i,a);break;case 2:let c=Math.PI/3;n.InnerAngle!==void 0&&(c=Ee.degToRad(n.InnerAngle.value));let l=0;n.OuterAngle!==void 0&&(l=Ee.degToRad(n.OuterAngle.value),l=Math.max(l,1)),t=new Qi(i,a,r,c,l,A);break;default:console.warn("THREE.FBXLoader: Unknown light type "+n.LightType.value+", defaulting to a PointLight."),t=new bn(i,a);break}n.CastShadows!==void 0&&n.CastShadows.value===1&&(t.castShadow=!0)}return t}createMesh(e,t,n){let s,i=null,a=null;const r=[];if(e.children.forEach(function(A){t.has(A.ID)&&(i=t.get(A.ID)),n.has(A.ID)&&r.push(n.get(A.ID))}),r.length>1?a=r:r.length>0?a=r[0]:(a=new ws({name:Dt.DEFAULT_MATERIAL_NAME,color:13421772}),r.push(a)),"color"in i.attributes&&r.forEach(function(A){A.vertexColors=!0}),i.groups.length>0){let A=!1;for(let c=0,l=i.groups.length;c<l;c++){const h=i.groups[c];(h.materialIndex<0||h.materialIndex>=r.length)&&(h.materialIndex=r.length,A=!0)}if(A){const c=new En;r.push(c)}}return i.FBX_Deformer?(s=new Bn(i,a),s.normalizeSkinWeights()):s=new O(i,a),s}createCurve(e,t){const n=e.children.reduce(function(i,a){return t.has(a.ID)&&(i=t.get(a.ID)),i},null),s=new kt({name:Dt.DEFAULT_MATERIAL_NAME,color:3342591,linewidth:1});return new ut(n,s)}getTransformData(e,t){const n={};"InheritType"in t&&(n.inheritType=parseInt(t.InheritType.value)),"RotationOrder"in t?n.eulerOrder=Ls(t.RotationOrder.value):n.eulerOrder=Ls(0),"Lcl_Translation"in t&&(n.translation=t.Lcl_Translation.value),"PreRotation"in t&&(n.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(n.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(n.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(n.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(n.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(n.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(n.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(n.rotationPivot=t.RotationPivot.value),e.userData.transformData=n}setLookAtProperties(e,t){"LookAtProperty"in t&&xe.get(e.ID).children.forEach(function(n){if(n.relationship==="LookAtProperty"){const s=se.Objects.Model[n.ID];if("Lcl_Translation"in s){const i=s.Lcl_Translation.value;e.target!==void 0?(e.target.position.fromArray(i),Ve.add(e.target)):e.lookAt(new N().fromArray(i))}}})}bindSkeleton(e,t,n){const s=this.parsePoseNodes();for(const i in e){const a=e[i];xe.get(parseInt(a.ID)).parents.forEach(function(r){if(t.has(r.ID)){const A=r.ID;xe.get(A).parents.forEach(function(c){n.has(c.ID)&&n.get(c.ID).bind(new Mi(a.bones),s[c.ID])})}})}}parsePoseNodes(){const e={};if("Pose"in se.Objects){const t=se.Objects.Pose;for(const n in t)if(t[n].attrType==="BindPose"&&t[n].NbPoseNodes>0){const s=t[n].PoseNode;Array.isArray(s)?s.forEach(function(i){e[i.Node]=new oe().fromArray(i.Matrix.a)}):e[s.Node]=new oe().fromArray(s.Matrix.a)}}return e}addGlobalSceneSettings(){if("GlobalSettings"in se){if("AmbientColor"in se.GlobalSettings){const e=se.GlobalSettings.AmbientColor.value,t=e[0],n=e[1],s=e[2];if(t!==0||n!==0||s!==0){const i=new Be().setRGB(t,n,s,re);Ve.add(new Er(i,1))}}"UnitScaleFactor"in se.GlobalSettings&&(Ve.userData.unitScaleFactor=se.GlobalSettings.UnitScaleFactor.value)}}}class Bc{constructor(){this.negativeMaterialIndices=!1}parse(e){const t=new Map;if("Geometry"in se.Objects){const n=se.Objects.Geometry;for(const s in n){const i=xe.get(parseInt(s)),a=this.parseGeometry(i,n[s],e);t.set(parseInt(s),a)}}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,n){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,n);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,n){const s=n.skeletons,i=[],a=e.parents.map(function(h){return se.Objects.Model[h.ID]});if(a.length===0)return;const r=e.children.reduce(function(h,d){return s[d.ID]!==void 0&&(h=s[d.ID]),h},null);e.children.forEach(function(h){n.morphTargets[h.ID]!==void 0&&i.push(n.morphTargets[h.ID])});const A=a[0],c={};"RotationOrder"in A&&(c.eulerOrder=Ls(A.RotationOrder.value)),"InheritType"in A&&(c.inheritType=parseInt(A.InheritType.value)),"GeometricTranslation"in A&&(c.translation=A.GeometricTranslation.value),"GeometricRotation"in A&&(c.rotation=A.GeometricRotation.value),"GeometricScaling"in A&&(c.scale=A.GeometricScaling.value);const l=Ka(c);return this.genGeometry(t,r,i,l)}genGeometry(e,t,n,s){const i=new At;e.attrName&&(i.name=e.attrName);const a=this.parseGeoNode(e,t),r=this.genBuffers(a),A=new Te(r.vertex,3);if(A.applyMatrix4(s),i.setAttribute("position",A),r.colors.length>0&&i.setAttribute("color",new Te(r.colors,3)),t&&(i.setAttribute("skinIndex",new Cr(r.weightsIndices,4)),i.setAttribute("skinWeight",new Te(r.vertexWeights,4)),i.FBX_Deformer=t),r.normal.length>0){const c=new Gi().getNormalMatrix(s),l=new Te(r.normal,3);l.applyNormalMatrix(c),i.setAttribute("normal",l)}if(r.uvs.forEach(function(c,l){const h=l===0?"uv":`uv${l}`;i.setAttribute(h,new Te(r.uvs[l],2))}),a.material&&a.material.mappingType!=="AllSame"){let c=r.materialIndex[0],l=0;if(r.materialIndex.forEach(function(h,d){h!==c&&(i.addGroup(l,d-l,c),c=h,l=d)}),i.groups.length>0){const h=i.groups[i.groups.length-1],d=h.start+h.count;d!==r.materialIndex.length&&i.addGroup(d,r.materialIndex.length-d,c)}i.groups.length===0&&i.addGroup(0,r.materialIndex.length,r.materialIndex[0])}return this.addMorphTargets(i,e,n,s),i}parseGeoNode(e,t){const n={};if(n.vertexPositions=e.Vertices!==void 0?e.Vertices.a:[],n.vertexIndices=e.PolygonVertexIndex!==void 0?e.PolygonVertexIndex.a:[],e.LayerElementColor&&(n.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(n.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(n.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){n.uv=[];let s=0;for(;e.LayerElementUV[s];)e.LayerElementUV[s].UV&&n.uv.push(this.parseUVs(e.LayerElementUV[s])),s++}return n.weightTable={},t!==null&&(n.skeleton=t,t.rawBones.forEach(function(s,i){s.indices.forEach(function(a,r){n.weightTable[a]===void 0&&(n.weightTable[a]=[]),n.weightTable[a].push({id:i,weight:s.weights[r]})})})),n}genBuffers(e){const t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let n=0,s=0,i=!1,a=[],r=[],A=[],c=[],l=[],h=[];const d=this;return e.vertexIndices.forEach(function(p,f){let b,u=!1;p<0&&(p=p^-1,u=!0);let I=[],C=[];if(a.push(p*3,p*3+1,p*3+2),e.color){const E=rn(f,n,p,e.color);A.push(E[0],E[1],E[2])}if(e.skeleton){if(e.weightTable[p]!==void 0&&e.weightTable[p].forEach(function(E){C.push(E.weight),I.push(E.id)}),C.length>4){i||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),i=!0);const E=[0,0,0,0],y=[0,0,0,0];C.forEach(function(w,v){let T=w,S=I[v];y.forEach(function(M,j,z){if(T>M){z[j]=T,T=M;const J=E[j];E[j]=S,S=J}})}),I=E,C=y}for(;C.length<4;)C.push(0),I.push(0);for(let E=0;E<4;++E)l.push(C[E]),h.push(I[E])}if(e.normal){const E=rn(f,n,p,e.normal);r.push(E[0],E[1],E[2])}e.material&&e.material.mappingType!=="AllSame"&&(b=rn(f,n,p,e.material)[0],b<0&&(d.negativeMaterialIndices=!0,b=0)),e.uv&&e.uv.forEach(function(E,y){const w=rn(f,n,p,E);c[y]===void 0&&(c[y]=[]),c[y].push(w[0]),c[y].push(w[1])}),s++,u&&(d.genFace(t,e,a,b,r,A,c,l,h,s),n++,s=0,a=[],r=[],A=[],c=[],l=[],h=[])}),t}getNormalNewell(e){const t=new N(0,0,0);for(let n=0;n<e.length;n++){const s=e[n],i=e[(n+1)%e.length];t.x+=(s.y-i.y)*(s.z+i.z),t.y+=(s.z-i.z)*(s.x+i.x),t.z+=(s.x-i.x)*(s.y+i.y)}return t.normalize(),t}getNormalTangentAndBitangent(e){const t=this.getNormalNewell(e),n=(Math.abs(t.z)>.5?new N(0,1,0):new N(0,0,1)).cross(t).normalize(),s=t.clone().cross(n).normalize();return{normal:t,tangent:n,bitangent:s}}flattenVertex(e,t,n){return new Fe(e.dot(t),e.dot(n))}genFace(e,t,n,s,i,a,r,A,c,l){let h;if(l>3){const d=[],p=t.baseVertexPositions||t.vertexPositions;for(let I=0;I<n.length;I+=3)d.push(new N(p[n[I]],p[n[I+1]],p[n[I+2]]));const{tangent:f,bitangent:b}=this.getNormalTangentAndBitangent(d),u=[];for(const I of d)u.push(this.flattenVertex(I,f,b));h=Br.triangulateShape(u,[])}else l===2?(console.warn("THREE.FBXLoader: Edge topology detected. This is currently not supported. The resulting mesh will not be correct."),h=[[0,1,2]]):h=[[0,1,2]];for(const[d,p,f]of h)e.vertex.push(t.vertexPositions[n[d*3]]),e.vertex.push(t.vertexPositions[n[d*3+1]]),e.vertex.push(t.vertexPositions[n[d*3+2]]),e.vertex.push(t.vertexPositions[n[p*3]]),e.vertex.push(t.vertexPositions[n[p*3+1]]),e.vertex.push(t.vertexPositions[n[p*3+2]]),e.vertex.push(t.vertexPositions[n[f*3]]),e.vertex.push(t.vertexPositions[n[f*3+1]]),e.vertex.push(t.vertexPositions[n[f*3+2]]),t.skeleton&&(e.vertexWeights.push(A[d*4]),e.vertexWeights.push(A[d*4+1]),e.vertexWeights.push(A[d*4+2]),e.vertexWeights.push(A[d*4+3]),e.vertexWeights.push(A[p*4]),e.vertexWeights.push(A[p*4+1]),e.vertexWeights.push(A[p*4+2]),e.vertexWeights.push(A[p*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.weightsIndices.push(c[d*4]),e.weightsIndices.push(c[d*4+1]),e.weightsIndices.push(c[d*4+2]),e.weightsIndices.push(c[d*4+3]),e.weightsIndices.push(c[p*4]),e.weightsIndices.push(c[p*4+1]),e.weightsIndices.push(c[p*4+2]),e.weightsIndices.push(c[p*4+3]),e.weightsIndices.push(c[f*4]),e.weightsIndices.push(c[f*4+1]),e.weightsIndices.push(c[f*4+2]),e.weightsIndices.push(c[f*4+3])),t.color&&(e.colors.push(a[d*3]),e.colors.push(a[d*3+1]),e.colors.push(a[d*3+2]),e.colors.push(a[p*3]),e.colors.push(a[p*3+1]),e.colors.push(a[p*3+2]),e.colors.push(a[f*3]),e.colors.push(a[f*3+1]),e.colors.push(a[f*3+2])),t.material&&t.material.mappingType!=="AllSame"&&(e.materialIndex.push(s),e.materialIndex.push(s),e.materialIndex.push(s)),t.normal&&(e.normal.push(i[d*3]),e.normal.push(i[d*3+1]),e.normal.push(i[d*3+2]),e.normal.push(i[p*3]),e.normal.push(i[p*3+1]),e.normal.push(i[p*3+2]),e.normal.push(i[f*3]),e.normal.push(i[f*3+1]),e.normal.push(i[f*3+2])),t.uv&&t.uv.forEach(function(b,u){e.uvs[u]===void 0&&(e.uvs[u]=[]),e.uvs[u].push(r[u][d*2]),e.uvs[u].push(r[u][d*2+1]),e.uvs[u].push(r[u][p*2]),e.uvs[u].push(r[u][p*2+1]),e.uvs[u].push(r[u][f*2]),e.uvs[u].push(r[u][f*2+1])})}addMorphTargets(e,t,n,s){if(n.length===0)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];const i=this;n.forEach(function(a){a.rawTargets.forEach(function(r){const A=se.Objects.Geometry[r.geoID];A!==void 0&&i.genMorphGeometry(e,t,A,s,r.name)})})}genMorphGeometry(e,t,n,s,i){const a=t.Vertices!==void 0?t.Vertices.a:[],r=t.PolygonVertexIndex!==void 0?t.PolygonVertexIndex.a:[],A=n.Vertices!==void 0?n.Vertices.a:[],c=n.Indexes!==void 0?n.Indexes.a:[],l=e.attributes.position.count*3,h=new Float32Array(l);for(let b=0;b<c.length;b++){const u=c[b]*3;h[u]=A[b*3],h[u+1]=A[b*3+1],h[u+2]=A[b*3+2]}const d={vertexIndices:r,vertexPositions:h,baseVertexPositions:a},p=this.genBuffers(d),f=new Te(p.vertex,3);f.name=i||n.attrName,f.applyMatrix4(s),e.morphAttributes.position.push(f)}parseNormals(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,s=e.Normals.a;let i=[];return n==="IndexToDirect"&&("NormalIndex"in e?i=e.NormalIndex.a:"NormalsIndex"in e&&(i=e.NormalsIndex.a)),{dataSize:3,buffer:s,indices:i,mappingType:t,referenceType:n}}parseUVs(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,s=e.UV.a;let i=[];return n==="IndexToDirect"&&(i=e.UVIndex.a),{dataSize:2,buffer:s,indices:i,mappingType:t,referenceType:n}}parseVertexColors(e){if(!e.Colors)return;const t=e.MappingInformationType,n=e.ReferenceInformationType,s=e.Colors.a;let i=[];n==="IndexToDirect"&&(i=e.ColorIndex.a);for(let a=0,r=new Be;a<s.length;a+=4)r.fromArray(s,a),Xe.toWorkingColorSpace(r,re),r.toArray(s,a);return{dataSize:4,buffer:s,indices:i,mappingType:t,referenceType:n}}parseMaterialIndices(e){const t=e.MappingInformationType,n=e.ReferenceInformationType;if(t==="NoMappingInformation")return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:n};const s=e.Materials.a,i=[];for(let a=0;a<s.length;++a)i.push(a);return{dataSize:1,buffer:s,indices:i,mappingType:t,referenceType:n}}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 At;const n=t-1,s=e.KnotVector.a,i=[],a=e.Points.a;for(let l=0,h=a.length;l<h;l+=4)i.push(new Mt().fromArray(a,l));let r,A;if(e.Form==="Closed")i.push(i[0]);else if(e.Form==="Periodic"){r=n,A=s.length-1-r;for(let l=0;l<n;++l)i.push(i[l])}const c=new Ic(n,s,i,r,A).getPoints(i.length*12);return new At().setFromPoints(c)}}class wc{parse(){const e=[],t=this.parseClips();if(t!==void 0)for(const n in t){const s=t[n],i=this.addClip(s);e.push(i)}return e}parseClips(){if(se.Objects.AnimationCurve===void 0)return;const e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);const t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){const e=se.Objects.AnimationCurveNode,t=new Map;for(const n in e){const s=e[n];if(s.attrName.match(/S|R|T|DeformPercent/)!==null){const i={id:s.id,attr:s.attrName,curves:{}};t.set(i.id,i)}}return t}parseAnimationCurves(e){const t=se.Objects.AnimationCurve;for(const n in t){const s={id:t[n].id,times:t[n].KeyTime.a.map(Sc),values:t[n].KeyValueFloat.a},i=xe.get(s.id);if(i!==void 0){const a=i.parents[0].ID,r=i.parents[0].relationship;r.match(/X/)?e.get(a).curves.x=s:r.match(/Y/)?e.get(a).curves.y=s:r.match(/Z/)?e.get(a).curves.z=s:r.match(/DeformPercent/)&&e.has(a)&&(e.get(a).curves.morph=s)}}}parseAnimationLayers(e){const t=se.Objects.AnimationLayer,n=new Map;for(const s in t){const i=[],a=xe.get(parseInt(s));a!==void 0&&(a.children.forEach(function(r,A){if(e.has(r.ID)){const c=e.get(r.ID);if(c.curves.x!==void 0||c.curves.y!==void 0||c.curves.z!==void 0){if(i[A]===void 0){const l=xe.get(r.ID).parents.filter(function(h){return h.relationship!==void 0})[0].ID;if(l!==void 0){const h=se.Objects.Model[l.toString()];if(h===void 0){console.warn("THREE.FBXLoader: Encountered a unused curve.",r);return}const d={modelName:h.attrName?pt.sanitizeNodeName(h.attrName):"",ID:h.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};Ve.traverse(function(p){p.ID===h.id&&(d.transform=p.matrix,p.userData.transformData&&(d.eulerOrder=p.userData.transformData.eulerOrder))}),d.transform||(d.transform=new oe),"PreRotation"in h&&(d.preRotation=h.PreRotation.value),"PostRotation"in h&&(d.postRotation=h.PostRotation.value),i[A]=d}}i[A]&&(i[A][c.attr]=c)}else if(c.curves.morph!==void 0){if(i[A]===void 0){const l=xe.get(r.ID).parents.filter(function(u){return u.relationship!==void 0})[0].ID,h=xe.get(l).parents[0].ID,d=xe.get(h).parents[0].ID,p=xe.get(d).parents[0].ID,f=se.Objects.Model[p],b={modelName:f.attrName?pt.sanitizeNodeName(f.attrName):"",morphName:se.Objects.Deformer[l].attrName};i[A]=b}i[A][c.attr]=c}}}),n.set(parseInt(s),i))}return n}parseAnimStacks(e){const t=se.Objects.AnimationStack,n={};for(const s in t){const i=xe.get(parseInt(s)).children;i.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const a=e.get(i[0].ID);n[s]={name:t[s].attrName,layer:a}}return n}addClip(e){let t=[];const n=this;return e.layer.forEach(function(s){t=t.concat(n.generateTracks(s))}),new wn(e.name,-1,t)}generateTracks(e){const t=[];let n=new N,s=new N;if(e.transform&&e.transform.decompose(n,new we,s),n=n.toArray(),s=s.toArray(),e.T!==void 0&&Object.keys(e.T.curves).length>0){const i=this.generateVectorTrack(e.modelName,e.T.curves,n,"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,s,"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,n,s){const i=this.getTimesForAllAxes(t),a=this.getKeyframeTrackValues(i,t,n);return new Js(e+"."+s,i,a)}generateRotationTrack(e,t,n,s,i){let a,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 d=this.interpolateRotations(t.x,t.y,t.z,i);a=d[0],r=d[1]}const A=Ls(0);n!==void 0&&(n=n.map(Ee.degToRad),n.push(A),n=new Ot().fromArray(n),n=new we().setFromEuler(n)),s!==void 0&&(s=s.map(Ee.degToRad),s.push(A),s=new Ot().fromArray(s),s=new we().setFromEuler(s).invert());const c=new we,l=new Ot,h=[];if(!(!r||!a)){for(let d=0;d<r.length;d+=3)l.set(r[d],r[d+1],r[d+2],i),c.setFromEuler(l),n!==void 0&&c.premultiply(n),s!==void 0&&c.multiply(s),d>2&&new we().fromArray(h,(d-3)/3*4).dot(c)<0&&c.set(-c.x,-c.y,-c.z,-c.w),c.toArray(h,d/3*4);return new Ws(e+".quaternion",a,h)}}generateMorphTrack(e){const t=e.DeformPercent.curves.morph,n=t.values.map(function(i){return i/100}),s=Ve.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new Vs(e.modelName+".morphTargetInfluences["+s+"]",t.times,n)}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(n,s){return n-s}),t.length>1){let n=1,s=t[0];for(let i=1;i<t.length;i++){const a=t[i];a!==s&&(t[n]=a,s=a,n++)}t=t.slice(0,n)}return t}getKeyframeTrackValues(e,t,n){const s=n,i=[];let a=-1,r=-1,A=-1;return e.forEach(function(c){if(t.x&&(a=t.x.times.indexOf(c)),t.y&&(r=t.y.times.indexOf(c)),t.z&&(A=t.z.times.indexOf(c)),a!==-1){const l=t.x.values[a];i.push(l),s[0]=l}else i.push(s[0]);if(r!==-1){const l=t.y.values[r];i.push(l),s[1]=l}else i.push(s[1]);if(A!==-1){const l=t.z.values[A];i.push(l),s[2]=l}else i.push(s[2])}),i}interpolateRotations(e,t,n,s){const i=[],a=[];i.push(e.times[0]),a.push(Ee.degToRad(e.values[0])),a.push(Ee.degToRad(t.values[0])),a.push(Ee.degToRad(n.values[0]));for(let r=1;r<e.values.length;r++){const A=[e.values[r-1],t.values[r-1],n.values[r-1]];if(isNaN(A[0])||isNaN(A[1])||isNaN(A[2]))continue;const c=A.map(Ee.degToRad),l=[e.values[r],t.values[r],n.values[r]];if(isNaN(l[0])||isNaN(l[1])||isNaN(l[2]))continue;const h=l.map(Ee.degToRad),d=[l[0]-A[0],l[1]-A[1],l[2]-A[2]],p=[Math.abs(d[0]),Math.abs(d[1]),Math.abs(d[2])];if(p[0]>=180||p[1]>=180||p[2]>=180){const f=Math.max(...p)/180,b=new Ot(...c,s),u=new Ot(...h,s),I=new we().setFromEuler(b),C=new we().setFromEuler(u);I.dot(C)&&C.set(-C.x,-C.y,-C.z,-C.w);const E=e.times[r-1],y=e.times[r]-E,w=new we,v=new Ot;for(let T=0;T<1;T+=1/f)w.copy(I.clone().slerp(C.clone(),T)),i.push(E+T*y),v.setFromQuaternion(w,s),a.push(v.x),a.push(v.y),a.push(v.z)}else i.push(e.times[r]),a.push(Ee.degToRad(e.values[r])),a.push(Ee.degToRad(t.values[r])),a.push(Ee.degToRad(n.values[r]))}return[i,a]}}class yc{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 qa,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const t=this,n=e.split(/[\r\n]+/);return n.forEach(function(s,i){const a=s.match(/^[\s\t]*;/),r=s.match(/^[\s\t]*$/);if(a||r)return;const A=s.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),c=s.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),l=s.match("^\\t{"+(t.currentIndent-1)+"}}");A?t.parseNodeBegin(s,A):c?t.parseNodeProperty(s,c,n[++i]):l?t.popStack():s.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(s)}),this.allNodes}parseNodeBegin(e,t){const n=t[1].trim().replace(/^"/,"").replace(/"$/,""),s=t[2].split(",").map(function(A){return A.trim().replace(/^"/,"").replace(/"$/,"")}),i={name:n},a=this.parseNodeAttr(s),r=this.getCurrentNode();this.currentIndent===0?this.allNodes.add(n,i):n in r?(n==="PoseNode"?r.PoseNode.push(i):r[n].id!==void 0&&(r[n]={},r[n][r[n].id]=r[n]),a.id!==""&&(r[n][a.id]=i)):typeof a.id=="number"?(r[n]={},r[n][a.id]=i):n!=="Properties70"&&(n==="PoseNode"?r[n]=[i]:r[n]=i),typeof a.id=="number"&&(i.id=a.id),a.name!==""&&(i.attrName=a.name),a.type!==""&&(i.attrType=a.type),this.pushStack(i)}parseNodeAttr(e){let t=e[0];e[0]!==""&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let n="",s="";return e.length>1&&(n=e[1].replace(/^(\w+)::/,""),s=e[2]),{id:t,name:n,type:s}}parseNodeProperty(e,t,n){let s=t[1].replace(/^"/,"").replace(/"$/,"").trim(),i=t[2].replace(/^"/,"").replace(/"$/,"").trim();s==="Content"&&i===","&&(i=n.replace(/"/g,"").replace(/,$/,"").trim());const a=this.getCurrentNode();if(a.name==="Properties70"){this.parseNodeSpecialProperty(e,s,i);return}if(s==="C"){const r=i.split(",").slice(1),A=parseInt(r[0]),c=parseInt(r[1]);let l=i.split(",").slice(3);l=l.map(function(h){return h.trim().replace(/^"/,"")}),s="connections",i=[A,c],Rc(i,l),a[s]===void 0&&(a[s]=[])}s==="Node"&&(a.id=i),s in a&&Array.isArray(a[s])?a[s].push(i):s!=="a"?a[s]=i:a.a=i,this.setCurrentProp(a,s),s==="a"&&i.slice(-1)!==","&&(a.a=Ai(i))}parseNodePropertyContinued(e){const t=this.getCurrentNode();t.a+=e,e.slice(-1)!==","&&(t.a=Ai(t.a))}parseNodeSpecialProperty(e,t,n){const s=n.split('",').map(function(l){return l.trim().replace(/^\"/,"").replace(/\s/,"_")}),i=s[0],a=s[1],r=s[2],A=s[3];let c=s[4];switch(a){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":c=parseFloat(c);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":c=Ai(c);break}this.getPrevNode()[i]={type:a,type2:r,flag:A,value:c},this.setCurrentProp(this.getPrevNode(),i)}}class Qc{parse(e){const t=new ja(e);t.skip(23);const n=t.getUint32();if(n<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+n);const s=new qa;for(;!this.endOfContent(t);){const i=this.parseNode(t,n);i!==null&&s.add(i.name,i)}return s}endOfContent(e){return e.size()%16===0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()}parseNode(e,t){const n={},s=t>=7500?e.getUint64():e.getUint32(),i=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();const a=e.getUint8(),r=e.getString(a);if(s===0)return null;const A=[];for(let d=0;d<i;d++)A.push(this.parseProperty(e));const c=A.length>0?A[0]:"",l=A.length>1?A[1]:"",h=A.length>2?A[2]:"";for(n.singleProperty=i===1&&e.getOffset()===s;s>e.getOffset();){const d=this.parseNode(e,t);d!==null&&this.parseSubNode(r,n,d)}return n.propertyList=A,typeof c=="number"&&(n.id=c),l!==""&&(n.attrName=l),h!==""&&(n.attrType=h),r!==""&&(n.name=r),n}parseSubNode(e,t,n){if(n.singleProperty===!0){const s=n.propertyList[0];Array.isArray(s)?(t[n.name]=n,n.a=s):t[n.name]=s}else if(e==="Connections"&&n.name==="C"){const s=[];n.propertyList.forEach(function(i,a){a!==0&&s.push(i)}),t.connections===void 0&&(t.connections=[]),t.connections.push(s)}else if(n.name==="Properties70")Object.keys(n).forEach(function(s){t[s]=n[s]});else if(e==="Properties70"&&n.name==="P"){let s=n.propertyList[0],i=n.propertyList[1];const a=n.propertyList[2],r=n.propertyList[3];let A;s.indexOf("Lcl ")===0&&(s=s.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=[n.propertyList[4],n.propertyList[5],n.propertyList[6]]:A=n.propertyList[4],t[s]={type:i,type2:a,flag:r,value:A}}else t[n.name]===void 0?typeof n.id=="number"?(t[n.name]={},t[n.name][n.id]=n):t[n.name]=n:n.name==="PoseNode"?(Array.isArray(t[n.name])||(t[n.name]=[t[n.name]]),t[n.name].push(n)):t[n.name][n.id]===void 0&&(t[n.name][n.id]=n)}parseProperty(e){const t=e.getString(1);let n;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 n=e.getUint32(),e.getArrayBuffer(n);case"S":return n=e.getUint32(),e.getString(n);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const s=e.getUint32(),i=e.getUint32(),a=e.getUint32();if(i===0)switch(t){case"b":case"c":return e.getBooleanArray(s);case"d":return e.getFloat64Array(s);case"f":return e.getFloat32Array(s);case"i":return e.getInt32Array(s);case"l":return e.getInt64Array(s)}const r=Fs(new Uint8Array(e.getArrayBuffer(a))),A=new ja(r.buffer);switch(t){case"b":case"c":return A.getBooleanArray(s);case"d":return A.getFloat64Array(s);case"f":return A.getFloat32Array(s);case"i":return A.getInt32Array(s);case"l":return A.getInt64Array(s)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}class ja{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 n=0;n<e;n++)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 n=0;n<e;n++)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 n=0;n<e;n++)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 n=0;n<e;n++)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 n=0;n<e;n++)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 n=new Uint8Array(this.dv.buffer,t,e);this.skip(e);const s=n.indexOf(0);return s>=0&&(n=new Uint8Array(this.dv.buffer,t,s)),this._textDecoder.decode(n)}}class qa{add(e,t){this[e]=t}}function vc(o){const e="Kaydara FBX Binary \0";return o.byteLength>=e.length&&e===Ya(o,0,e.length)}function xc(o){const e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let t=0;function n(s){const i=o[s-1];return o=o.slice(t+s),t++,i}for(let s=0;s<e.length;++s)if(n(1)===e[s])return!1;return!0}function za(o){const e=/FBXVersion: (\d+)/,t=o.match(e);if(t)return parseInt(t[1]);throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function Sc(o){return o/46186158e3}const Tc=[];function rn(o,e,t,n){let s;switch(n.mappingType){case"ByPolygonVertex":s=o;break;case"ByPolygon":s=e;break;case"ByVertice":s=t;break;case"AllSame":s=n.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+n.mappingType)}n.referenceType==="IndexToDirect"&&(s=n.indices[s]);const i=s*n.dataSize,a=i+n.dataSize;return Dc(Tc,n.buffer,i,a)}const ri=new Ot,gs=new N;function Ka(o){const e=new oe,t=new oe,n=new oe,s=new oe,i=new oe,a=new oe,r=new oe,A=new oe,c=new oe,l=new oe,h=new oe,d=new oe,p=o.inheritType?o.inheritType:0;o.translation&&e.setPosition(gs.fromArray(o.translation));const f=Ls(0);if(o.preRotation){const z=o.preRotation.map(Ee.degToRad);z.push(f),t.makeRotationFromEuler(ri.fromArray(z))}if(o.rotation){const z=o.rotation.map(Ee.degToRad);z.push(o.eulerOrder||f),n.makeRotationFromEuler(ri.fromArray(z))}if(o.postRotation){const z=o.postRotation.map(Ee.degToRad);z.push(f),s.makeRotationFromEuler(ri.fromArray(z)),s.invert()}o.scale&&i.scale(gs.fromArray(o.scale)),o.scalingOffset&&r.setPosition(gs.fromArray(o.scalingOffset)),o.scalingPivot&&a.setPosition(gs.fromArray(o.scalingPivot)),o.rotationOffset&&A.setPosition(gs.fromArray(o.rotationOffset)),o.rotationPivot&&c.setPosition(gs.fromArray(o.rotationPivot)),o.parentMatrixWorld&&(h.copy(o.parentMatrix),l.copy(o.parentMatrixWorld));const b=t.clone().multiply(n).multiply(s),u=new oe;u.extractRotation(l);const I=new oe;I.copyPosition(l);const C=I.clone().invert().multiply(l),E=u.clone().invert().multiply(C),y=i,w=new oe;if(p===0)w.copy(u).multiply(b).multiply(E).multiply(y);else if(p===1)w.copy(u).multiply(E).multiply(b).multiply(y);else{const z=new oe().scale(new N().setFromMatrixScale(h)).clone().invert(),J=E.clone().multiply(z);w.copy(u).multiply(b).multiply(J).multiply(y)}const v=c.clone().invert(),T=a.clone().invert();let S=e.clone().multiply(A).multiply(c).multiply(t).multiply(n).multiply(s).multiply(v).multiply(r).multiply(a).multiply(i).multiply(T);const M=new oe().copyPosition(S),j=l.clone().multiply(M);return d.copyPosition(j),S=d.clone().multiply(w),S.premultiply(l.invert()),S}function Ls(o){o=o||0;const e=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return o===6?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),e[0]):e[o]}function Ai(o){return o.split(",").map(function(e){return parseFloat(e)})}function Ya(o,e,t){return e===void 0&&(e=0),t===void 0&&(t=o.byteLength),new TextDecoder().decode(new Uint8Array(o,e,t))}function Rc(o,e){for(let t=0,n=o.length,s=e.length;t<s;t++,n++)o[n]=e[t]}function Dc(o,e,t,n){for(let s=t,i=0;s<n;s++,i++)o[i]=e[s];return o}class kc extends Dt{constructor(e){super(e)}load(e,t,n,s){const i=this,a=this.path===""?Vt.extractUrlBase(e):this.path,r=new gt(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,function(A){try{t(i.parse(A,a))}catch(c){s?s(c):console.error(c),i.manager.itemError(e)}},n,s)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){const n=e.split(`
46
- `);let s={};const i=/\s+/,a={};for(let A=0;A<n.length;A++){let c=n[A];if(c=c.trim(),c.length===0||c.charAt(0)==="#")continue;const l=c.indexOf(" ");let h=l>=0?c.substring(0,l):c;h=h.toLowerCase();let d=l>=0?c.substring(l+1):"";if(d=d.trim(),h==="newmtl")s={name:d},a[d]=s;else if(h==="ka"||h==="kd"||h==="ks"||h==="ke"){const p=d.split(i,3);s[h]=[parseFloat(p[0]),parseFloat(p[1]),parseFloat(p[2])]}else s[h]=d}const r=new Mc(this.resourcePath||t,this.materialOptions);return r.setCrossOrigin(this.crossOrigin),r.setManager(this.manager),r.setMaterials(a),r}}class Mc{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:_i,this.wrap=this.options.wrap!==void 0?this.options.wrap:Wt}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 n in e){const s=e[n],i={};t[n]=i;for(const a in s){let r=!0,A=s[a];const c=a.toLowerCase();switch(c){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&&(i[c]=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,n=this.materialsInfo[e],s={name:e,side:this.side};function i(r,A){return typeof A!="string"||A===""?"":/^https?:\/\//i.test(A)?A:r+A}function a(r,A){if(s[r])return;const c=t.getTextureParams(A,s),l=t.loadTexture(i(t.baseUrl,c.url));l.repeat.copy(c.scale),l.offset.copy(c.offset),l.wrapS=t.wrap,l.wrapT=t.wrap,(r==="map"||r==="emissiveMap")&&(l.colorSpace=re),s[r]=l}for(const r in n){const A=n[r];let c;if(A!=="")switch(r.toLowerCase()){case"kd":s.color=Xe.toWorkingColorSpace(new Be().fromArray(A),re);break;case"ks":s.specular=Xe.toWorkingColorSpace(new Be().fromArray(A),re);break;case"ke":s.emissive=Xe.toWorkingColorSpace(new Be().fromArray(A),re);break;case"map_kd":a("map",A);break;case"map_ks":a("specularMap",A);break;case"map_ke":a("emissiveMap",A);break;case"norm":a("normalMap",A);break;case"map_bump":case"bump":a("bumpMap",A);break;case"map_d":a("alphaMap",A),s.transparent=!0;break;case"ns":s.shininess=parseFloat(A);break;case"d":c=parseFloat(A),c<1&&(s.opacity=c,s.transparent=!0);break;case"tr":c=parseFloat(A),this.options&&this.options.invertTrProperty&&(c=1-c),c>0&&(s.opacity=1-c,s.transparent=!0);break}}return this.materials[e]=new ws(s),this.materials[e]}getTextureParams(e,t){const n={scale:new Fe(1,1),offset:new Fe(0,0)},s=e.split(/\s+/);let i;return i=s.indexOf("-bm"),i>=0&&(t.bumpScale=parseFloat(s[i+1]),s.splice(i,2)),i=s.indexOf("-s"),i>=0&&(n.scale.set(parseFloat(s[i+1]),parseFloat(s[i+2])),s.splice(i,4)),i=s.indexOf("-o"),i>=0&&(n.offset.set(parseFloat(s[i+1]),parseFloat(s[i+2])),s.splice(i,4)),n.url=s.join(" ").trim(),n}loadTexture(e,t,n,s,i){const a=this.manager!==void 0?this.manager:wr;let r=a.getHandler(e);r===null&&(r=new In(a)),r.setCrossOrigin&&r.setCrossOrigin(this.crossOrigin);const A=r.load(e,n,s,i);return t!==void 0&&(A.mapping=t),A}}const _c=/^[og]\s*(.+)?/,Fc=/^mtllib /,Lc=/^usemtl /,Nc=/^usemap /,Ja=/\s+/,Va=new N,ci=new N,Wa=new N,Xa=new N,lt=new N,An=new Be;function Uc(){const o={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 n=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(s,i){const a=this._finalize(!1);a&&(a.inherited||a.groupCount<=0)&&this.materials.splice(a.index,1);const r={index:this.materials.length,name:s||"",mtllib:Array.isArray(i)&&i.length>0?i[i.length-1]:"",smooth:a!==void 0?a.smooth:this.smooth,groupStart:a!==void 0?a.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(A){const c={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 c.clone=this.clone.bind(c),c}};return this.materials.push(r),r},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(s){const i=this.currentMaterial();if(i&&i.groupEnd===-1&&(i.groupEnd=this.geometry.vertices.length/3,i.groupCount=i.groupEnd-i.groupStart,i.inherited=!1),s&&this.materials.length>1)for(let a=this.materials.length-1;a>=0;a--)this.materials[a].groupCount<=0&&this.materials.splice(a,1);return s&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),i}},n&&n.name&&typeof n.clone=="function"){const s=n.clone(0);s.inherited=!0,this.object.materials.push(s)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,t){const n=parseInt(e,10);return(n>=0?n-1:n+t/3)*3},parseNormalIndex:function(e,t){const n=parseInt(e,10);return(n>=0?n-1:n+t/3)*3},parseUVIndex:function(e,t){const n=parseInt(e,10);return(n>=0?n-1:n+t/2)*2},addVertex:function(e,t,n){const s=this.vertices,i=this.object.geometry.vertices;i.push(s[e+0],s[e+1],s[e+2]),i.push(s[t+0],s[t+1],s[t+2]),i.push(s[n+0],s[n+1],s[n+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,n){const s=this.normals,i=this.object.geometry.normals;i.push(s[e+0],s[e+1],s[e+2]),i.push(s[t+0],s[t+1],s[t+2]),i.push(s[n+0],s[n+1],s[n+2])},addFaceNormal:function(e,t,n){const s=this.vertices,i=this.object.geometry.normals;Va.fromArray(s,e),ci.fromArray(s,t),Wa.fromArray(s,n),lt.subVectors(Wa,ci),Xa.subVectors(Va,ci),lt.cross(Xa),lt.normalize(),i.push(lt.x,lt.y,lt.z),i.push(lt.x,lt.y,lt.z),i.push(lt.x,lt.y,lt.z)},addColor:function(e,t,n){const s=this.colors,i=this.object.geometry.colors;s[e]!==void 0&&i.push(s[e+0],s[e+1],s[e+2]),s[t]!==void 0&&i.push(s[t+0],s[t+1],s[t+2]),s[n]!==void 0&&i.push(s[n+0],s[n+1],s[n+2])},addUV:function(e,t,n){const s=this.uvs,i=this.object.geometry.uvs;i.push(s[e+0],s[e+1]),i.push(s[t+0],s[t+1]),i.push(s[n+0],s[n+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,n,s,i,a,r,A,c){const l=this.vertices.length;let h=this.parseVertexIndex(e,l),d=this.parseVertexIndex(t,l),p=this.parseVertexIndex(n,l);if(this.addVertex(h,d,p),this.addColor(h,d,p),r!==void 0&&r!==""){const f=this.normals.length;h=this.parseNormalIndex(r,f),d=this.parseNormalIndex(A,f),p=this.parseNormalIndex(c,f),this.addNormal(h,d,p)}else this.addFaceNormal(h,d,p);if(s!==void 0&&s!==""){const f=this.uvs.length;h=this.parseUVIndex(s,f),d=this.parseUVIndex(i,f),p=this.parseUVIndex(a,f),this.addUV(h,d,p),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const t=this.vertices.length;for(let n=0,s=e.length;n<s;n++){const i=this.parseVertexIndex(e[n],t);this.addVertexPoint(i),this.addColor(i)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";const n=this.vertices.length,s=this.uvs.length;for(let i=0,a=e.length;i<a;i++)this.addVertexLine(this.parseVertexIndex(e[i],n));for(let i=0,a=t.length;i<a;i++)this.addUVLine(this.parseUVIndex(t[i],s))}};return o.startObject("",!1),o}class Gc extends Dt{constructor(e){super(e),this.materials=null,this.materialsLoader=new kc(e)}load(e,t,n,s){const i=this,a=new gt(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,async function(r){try{const A=i.parse(r,!0);for(let c=0,l=A.materialLibraries.length;c<l;c++){const h=A.materialLibraries[c],d=e.startsWith("blob:")?e+"/"+h:new URL(h,e);console.debug("Loading MTL file: "+d),await new Promise((p,f)=>{i.materialsLoader.load(d.toString(),b=>{i.setMaterials(b),p()},null,f)})}t(i.createObjects(A))}catch(A){s?s(A):console.error(A),i.manager.itemError(e)}},n,s)}setMTLLoader(e){return this.materialsLoader=e,this}setMaterials(e){return this.materials=e,this}parse(e,t=!1){const n=new Uc;e.indexOf(`\r
47
- `)!==-1&&(e=e.replace(/\r\n/g,`
48
- `)),e.indexOf(`\\
49
- `)!==-1&&(e=e.replace(/\\\n/g,""));const s=e.split(`
50
- `);let i=[];for(let a=0,r=s.length;a<r;a++){const A=s[a].trimStart();if(A.length===0)continue;const c=A.charAt(0);if(c!=="#")if(c==="v"){const l=A.split(Ja);switch(l[0]){case"v":n.vertices.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])),l.length>=7?(An.setRGB(parseFloat(l[4]),parseFloat(l[5]),parseFloat(l[6]),re),n.colors.push(An.r,An.g,An.b)):n.colors.push(void 0,void 0,void 0);break;case"vn":n.normals.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3]));break;case"vt":n.uvs.push(parseFloat(l[1]),parseFloat(l[2]));break}}else if(c==="f"){const l=A.slice(1).trim().split(Ja),h=[];for(let p=0,f=l.length;p<f;p++){const b=l[p];if(b.length>0){const u=b.split("/");h.push(u)}}const d=h[0];for(let p=1,f=h.length-1;p<f;p++){const b=h[p],u=h[p+1];n.addFace(d[0],b[0],u[0],d[1],b[1],u[1],d[2],b[2],u[2])}}else if(c==="l"){const l=A.substring(1).trim().split(" ");let h=[];const d=[];if(A.indexOf("/")===-1)h=l;else for(let p=0,f=l.length;p<f;p++){const b=l[p].split("/");b[0]!==""&&h.push(b[0]),b[1]!==""&&d.push(b[1])}n.addLineGeometry(h,d)}else if(c==="p"){const l=A.slice(1).trim().split(" ");n.addPointGeometry(l)}else if((i=_c.exec(A))!==null){const l=(" "+i[0].slice(1).trim()).slice(1);n.startObject(l)}else if(Lc.test(A))n.object.startMaterial(A.substring(7).trim(),n.materialLibraries);else if(Fc.test(A))n.materialLibraries.push(A.substring(7).trim());else if(Nc.test(A))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(c==="s"){if(i=A.split(" "),i.length>1){const h=i[1].trim().toLowerCase();n.object.smooth=h!=="0"&&h!=="off"}else n.object.smooth=!0;const l=n.object.currentMaterial();l&&(l.smooth=n.object.smooth)}else{if(A==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+A+'"')}}return n.finalize(),t?n:this.createObjects(n)}createObjects(e){const t=new Xt;if(t.materialLibraries=[].concat(e.materialLibraries),!(e.objects.length===1&&e.objects[0].geometry.vertices.length===0))for(let n=0,s=e.objects.length;n<s;n++){const i=e.objects[n],a=i.geometry,r=i.materials,A=a.type==="Line",c=a.type==="Points";let l=!1;if(a.vertices.length===0)continue;const h=new At;h.setAttribute("position",new Te(a.vertices,3)),a.normals.length>0&&h.setAttribute("normal",new Te(a.normals,3)),a.colors.length>0&&(l=!0,h.setAttribute("color",new Te(a.colors,3))),a.hasUVIndices===!0&&h.setAttribute("uv",new Te(a.uvs,2));const d=[];for(let f=0,b=r.length;f<b;f++){const u=r[f],I=u.name+"_"+u.smooth+"_"+l;let C=e.materials[I];if(this.materials!==null){if(C=this.materials.create(u.name),A&&C&&!(C instanceof kt)){const E=new kt;Jt.prototype.copy.call(E,C),E.color.copy(C.color),C=E}else if(c&&C&&!(C instanceof bs)){const E=new bs({size:10,sizeAttenuation:!1});Jt.prototype.copy.call(E,C),E.color.copy(C.color),E.map=C.map,C=E}}C===void 0&&(A?C=new kt:c?C=new bs({size:1,sizeAttenuation:!1}):C=new ws,C.name=u.name,C.flatShading=!u.smooth,C.vertexColors=l,e.materials[I]=C),d.push(C)}let p;if(d.length>1){for(let f=0,b=r.length;f<b;f++){const u=r[f];h.addGroup(u.groupStart,u.groupCount,f)}A?p=new Ks(h,d):c?p=new Ys(h,d):p=new O(h,d)}else A?p=new Ks(h,d[0]):c?p=new Ys(h,d[0]):p=new O(h,d[0]);p.name=i.name,t.add(p)}else if(e.vertices.length>0){const n=new bs({size:1,sizeAttenuation:!1}),s=new At;s.setAttribute("position",new Te(e.vertices,3)),e.colors.length>0&&e.colors[0]!==void 0&&(s.setAttribute("color",new Te(e.colors,3)),n.vertexColors=!0);const i=new Ys(s,n);t.add(i)}return t}}const Za={type:"change"},li={type:"start"},$a={type:"end"},Pc={type:"endMovement"},cn=new yr,eo=new Qr,Oc=Math.cos(70*Ee.DEG2RAD),Re=new N;new N;const tt=2*Math.PI,Ae={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},ss=1e-6;let Hc=class extends Ni{constructor(o,e=null){super(o,e),this.state=Ae.NONE,this.enabled=!0,this.target=new N,this.cursor=new N,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:cs.ROTATE,MIDDLE:cs.DOLLY,RIGHT:cs.PAN},this.touches={ONE:ls.ROTATE,TWO:ls.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new N,this._lastQuaternion=new we,this._lastTargetPosition=new N,this._quat=new we().setFromUnitVectors(o.up,new N(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Pi,this._sphericalDelta=new Pi,this._scale=1,this._currentScale=1,this._panOffset=new N,this._rotateStart=new Fe,this._rotateEnd=new Fe,this._rotateDelta=new Fe,this._panStart=new Fe,this._panEnd=new Fe,this._panDelta=new Fe,this._dollyStart=new Fe,this._dollyEnd=new Fe,this._dollyDelta=new Fe,this._dollyDirection=new N,this._mouse=new Fe,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._lastIsDamping=!1,this._isDamping=!1,this._onPointerMove=qc.bind(this),this._onPointerDown=jc.bind(this),this._onPointerUp=zc.bind(this),this._onContextMenu=Zc.bind(this),this._onMouseWheel=Jc.bind(this),this._onKeyDown=Vc.bind(this),this._onTouchStart=Wc.bind(this),this._onTouchMove=Xc.bind(this),this._onMouseDown=Kc.bind(this),this._onMouseMove=Yc.bind(this),this._interceptControlDown=$c.bind(this),this._interceptControlUp=el.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(o){o.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=o}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Za),this.update(),this.state=Ae.NONE,this._isDamping=!1}update(o=null){if(this.enableDamping&&o===null)return;const e=this.object.getWorldPosition(this.object.position);Re.copy(e).sub(this.target),Re.applyQuaternion(this._quat),this._spherical.setFromVector3(Re),this.autoRotate&&this.state===Ae.NONE&&this._rotateLeft(this._getAutoRotationAngle(o)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let t=this.minAzimuthAngle,n=this.maxAzimuthAngle;isFinite(t)&&isFinite(n)&&(t<-Math.PI?t+=tt:t>Math.PI&&(t-=tt),n<-Math.PI?n+=tt:n>Math.PI&&(n-=tt),t<=n?this._spherical.theta=Math.max(t,Math.min(n,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(t+n)/2?Math.max(t,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=Ee.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 i=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._currentScale),s=Math.abs(i-this._spherical.radius)>ss*100}if(Re.setFromSpherical(this._spherical),Re.applyQuaternion(this._quatInverse),e.copy(this.target).add(Re),this.object.parent?this.object.parent.worldToLocal(e):this.object.position.copy(e),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 i=null;if(this.object.isPerspectiveCamera){const a=Re.length();i=this._clampDistance(a*this._currentScale);const r=a-i;this.object.position.addScaledVector(this._dollyDirection,r),this.object.updateMatrixWorld(),s=Math.abs(r)>ss}else if(this.object.isOrthographicCamera){const a=new N(this._mouse.x,this._mouse.y,0);a.unproject(this.object);const r=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(r-this.object.zoom)>ss;const A=new N(this._mouse.x,this._mouse.y,0);A.unproject(this.object),this.object.position.sub(A).add(a),this.object.updateMatrixWorld(),i=Re.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;i!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(i).add(this.object.position):(cn.origin.copy(this.object.position),cn.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(cn.direction))<Oc?this.object.lookAt(this.target):(eo.setFromNormalAndCoplanarPoint(this.object.up,this.target),cn.intersectPlane(eo,this.target))))}else if(this.object.isOrthographicCamera){const i=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),Math.abs(i-this.object.zoom)>ss&&(this.object.updateProjectionMatrix(),s=!0)}return this._scale=1,s||this._lastPosition.distanceToSquared(this.object.position)>ss||8*(1-this._lastQuaternion.dot(this.object.quaternion))>ss||this._lastTargetPosition.distanceToSquared(this.target)>ss?(this.dispatchEvent(Za),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===Ae.NONE&&(this._lastIsDamping=this._isDamping,this._isDamping=!1),this._lastIsDamping&&!this._isDamping&&this.state===Ae.NONE&&(this._isDamping=!1,this._lastIsDamping=!1,this.dispatchEvent(Pc)),this._performCursorZoom=!1,!1)}_getAutoRotationAngle(o){return o!==null?tt/60*this.autoRotateSpeed*o:tt/60/60*this.autoRotateSpeed}_getZoomScale(o){const e=Math.abs(o*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(o){this._sphericalDelta.theta-=o}_rotateUp(o){this._sphericalDelta.phi-=o}_panLeft(o,e){Re.setFromMatrixColumn(e,0),Re.multiplyScalar(-o),this._panOffset.add(Re)}_panUp(o,e){this.screenSpacePanning===!0?Re.setFromMatrixColumn(e,1):(Re.setFromMatrixColumn(e,0),Re.crossVectors(this.object.up,Re)),Re.multiplyScalar(o),this._panOffset.add(Re)}_pan(o,e){const t=this.domElement;if(this.object.isPerspectiveCamera){this.object.getWorldPosition(Re).sub(this.target);let n=Re.length();n*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*o*n/t.clientHeight,this.object.matrixWorld),this._panUp(2*e*n/t.clientHeight,this.object.matrixWorld)}else this.object.isOrthographicCamera?(this._panLeft(o*(this.object.right-this.object.left)/this.object.zoom/t.clientWidth,this.object.matrixWorld),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/t.clientHeight,this.object.matrixWorld)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(o){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(o){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(o,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const t=this.domElement.getBoundingClientRect(),n=o-t.left,s=e-t.top,i=t.width,a=t.height;this._mouse.x=n/i*2-1,this._mouse.y=-(s/a)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(o){return Math.max(this.minDistance,Math.min(this.maxDistance,o))}_handleMouseDownRotate(o){this._rotateStart.set(o.clientX,o.clientY)}_handleMouseDownDolly(o){this._updateZoomParameters(o.clientX,o.clientX),this._dollyStart.set(o.clientX,o.clientY)}_handleMouseDownPan(o){this._panStart.set(o.clientX,o.clientY)}_handleMouseMoveRotate(o){this._rotateEnd.set(o.clientX,o.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(tt*this._rotateDelta.x/e.clientHeight),this._rotateUp(tt*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(o){this._dollyEnd.set(o.clientX,o.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(o){this._panEnd.set(o.clientX,o.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(o){this._updateZoomParameters(o.clientX,o.clientY),o.deltaY<0?this._dollyIn(this._getZoomScale(o.deltaY)):o.deltaY>0&&this._dollyOut(this._getZoomScale(o.deltaY)),this.update()}_handleKeyDown(o){let e=!1;switch(o.code){case this.keys.UP:o.ctrlKey||o.metaKey||o.shiftKey?this._rotateUp(tt*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:o.ctrlKey||o.metaKey||o.shiftKey?this._rotateUp(-tt*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:o.ctrlKey||o.metaKey||o.shiftKey?this._rotateLeft(tt*this.rotateSpeed/this.domElement.clientHeight):this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:o.ctrlKey||o.metaKey||o.shiftKey?this._rotateLeft(-tt*this.rotateSpeed/this.domElement.clientHeight):this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(o.preventDefault(),this.update())}_handleTouchStartRotate(o){if(this._pointers.length===1)this._rotateStart.set(o.pageX,o.pageY);else{const e=this._getSecondPointerPosition(o),t=.5*(o.pageX+e.x),n=.5*(o.pageY+e.y);this._rotateStart.set(t,n)}}_handleTouchStartPan(o){if(this._pointers.length===1)this._panStart.set(o.pageX,o.pageY);else{const e=this._getSecondPointerPosition(o),t=.5*(o.pageX+e.x),n=.5*(o.pageY+e.y);this._panStart.set(t,n)}}_handleTouchStartDolly(o){const e=this._getSecondPointerPosition(o),t=o.pageX-e.x,n=o.pageY-e.y,s=Math.sqrt(t*t+n*n);this._dollyStart.set(0,s)}_handleTouchStartDollyPan(o){this.enableZoom&&this._handleTouchStartDolly(o),this.enablePan&&this._handleTouchStartPan(o)}_handleTouchStartDollyRotate(o){this.enableZoom&&this._handleTouchStartDolly(o),this.enableRotate&&this._handleTouchStartRotate(o)}_handleTouchMoveRotate(o){if(this._pointers.length==1)this._rotateEnd.set(o.pageX,o.pageY);else{const t=this._getSecondPointerPosition(o),n=.5*(o.pageX+t.x),s=.5*(o.pageY+t.y);this._rotateEnd.set(n,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(tt*this._rotateDelta.x/e.clientHeight),this._rotateUp(tt*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(o){if(this._pointers.length===1)this._panEnd.set(o.pageX,o.pageY);else{const e=this._getSecondPointerPosition(o),t=.5*(o.pageX+e.x),n=.5*(o.pageY+e.y);this._panEnd.set(t,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(o){const e=this._getSecondPointerPosition(o),t=o.pageX-e.x,n=o.pageY-e.y,s=Math.sqrt(t*t+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 i=(o.pageX+e.x)*.5,a=(o.pageY+e.y)*.5;this._updateZoomParameters(i,a)}_handleTouchMoveDollyPan(o){this.enableZoom&&this._handleTouchMoveDolly(o),this.enablePan&&this._handleTouchMovePan(o)}_handleTouchMoveDollyRotate(o){this.enableZoom&&this._handleTouchMoveDolly(o),this.enableRotate&&this._handleTouchMoveRotate(o)}_addPointer(o){this._pointers.push(o.pointerId)}_removePointer(o){delete this._pointerPositions[o.pointerId];for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==o.pointerId){this._pointers.splice(e,1);return}}_isTrackingPointer(o){for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==o.pointerId)return!0;return!1}_trackPointer(o){let e=this._pointerPositions[o.pointerId];e===void 0&&(e=new Fe,this._pointerPositions[o.pointerId]=e),e.set(o.pageX,o.pageY)}_getSecondPointerPosition(o){const e=o.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[e]}_customWheelEvent(o){const e=o.deltaMode,t={clientX:o.clientX,clientY:o.clientY,deltaY:o.deltaY};switch(e){case 1:t.deltaY*=16;break;case 2:t.deltaY*=100;break}return o.ctrlKey&&!this._controlActive&&(t.deltaY*=10),t}};function jc(o){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(o.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),window.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(o)&&(this._addPointer(o),o.pointerType==="touch"?this._onTouchStart(o):this._onMouseDown(o)))}function qc(o){this.enabled!==!1&&(o.pointerType==="touch"?this._onTouchMove(o):this._onMouseMove(o))}function zc(o){switch(this._removePointer(o),this._pointers.length){case 0:this.domElement.releasePointerCapture(o.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),window.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent($a),this.state=Ae.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 Kc(o){let e;switch(o.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 cs.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(o),this.state=Ae.DOLLY;break;case cs.ROTATE:if(o.ctrlKey||o.metaKey||o.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(o),this.state=Ae.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(o),this.state=Ae.ROTATE}break;case cs.PAN:if(o.ctrlKey||o.metaKey||o.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(o),this.state=Ae.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(o),this.state=Ae.PAN}break;default:this.state=Ae.NONE}this.state!==Ae.NONE&&this.dispatchEvent(li)}function Yc(o){switch(this.state){case Ae.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(o);break;case Ae.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(o);break;case Ae.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(o);break}}function Jc(o){this.enabled===!1||this.enableZoom===!1||this.state!==Ae.NONE||(o.preventDefault(),this.dispatchEvent(li),this._handleMouseWheel(this._customWheelEvent(o)),this.dispatchEvent($a))}function Vc(o){this.enabled===!1||this.enablePan===!1||this._handleKeyDown(o)}function Wc(o){switch(this._trackPointer(o),this._pointers.length){case 1:switch(this.touches.ONE){case ls.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(o),this.state=Ae.TOUCH_ROTATE;break;case ls.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(o),this.state=Ae.TOUCH_PAN;break;default:this.state=Ae.NONE}break;case 2:switch(this.touches.TWO){case ls.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(o),this.state=Ae.TOUCH_DOLLY_PAN;break;case ls.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(o),this.state=Ae.TOUCH_DOLLY_ROTATE;break;default:this.state=Ae.NONE}break;default:this.state=Ae.NONE}this.state!==Ae.NONE&&this.dispatchEvent(li)}function Xc(o){switch(this._trackPointer(o),this.state){case Ae.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(o),this.update();break;case Ae.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(o),this.update();break;case Ae.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(o),this.update();break;case Ae.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(o),this.update();break;default:this.state=Ae.NONE}}function Zc(o){this.enabled!==!1&&o.preventDefault()}function $c(o){o.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function el(o){o.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}class tl extends ut{constructor(e,t=1,n=16,s=2){const i=new At,a=n+s*2,r=new Float32Array((a*3+3)*3);i.setAttribute("position",new nt(r,3));const A=new kt({color:65280}),c=new kt({color:16776960});super(i,[c,A]),this.audio=e,this.range=t,this.divisionsInnerAngle=n,this.divisionsOuterAngle=s,this.type="PositionalAudioHelper",this.update()}update(){const e=this.audio,t=this.range,n=this.divisionsInnerAngle,s=this.divisionsOuterAngle,i=Ee.degToRad(e.panner.coneInnerAngle),a=Ee.degToRad(e.panner.coneOuterAngle),r=i/2,A=a/2;let c=0,l=0,h,d;const p=this.geometry,f=p.attributes.position;p.clearGroups();function b(u,I,C,E){const y=(I-u)/C;for(f.setXYZ(c,0,0,0),l++,h=u;h<I;h+=y)d=c+l,f.setXYZ(d,Math.sin(h)*t,0,Math.cos(h)*t),f.setXYZ(d+1,Math.sin(Math.min(h+y,I))*t,0,Math.cos(Math.min(h+y,I))*t),f.setXYZ(d+2,0,0,0),l+=3;p.addGroup(c,l,E),c+=l,l=0}b(-A,-r,s,0),b(-r,r,n,1),b(r,A,s,0),f.needsUpdate=!0,i===a&&(this.material[0].visible=!1)}dispose(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()}}const sl={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
51
-
52
- varying vec2 vUv;
53
-
54
- void main() {
55
-
56
- vUv = uv;
57
- gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
58
-
59
- }`,fragmentShader:`
60
-
61
- uniform sampler2D tDiffuse;
62
- uniform float h;
63
-
64
- varying vec2 vUv;
65
-
66
- void main() {
67
-
68
- vec4 sum = vec4( 0.0 );
69
-
70
- sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;
71
- sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;
72
- sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;
73
- sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;
74
- sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;
75
- sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;
76
- sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;
77
- sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;
78
- sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;
79
-
80
- gl_FragColor = sum;
81
-
82
- }`},nl={name:"VerticalBlurShader",uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:`
83
-
84
- varying vec2 vUv;
85
-
86
- void main() {
87
-
88
- vUv = uv;
89
- gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
90
-
91
- }`,fragmentShader:`
92
-
93
- uniform sampler2D tDiffuse;
94
- uniform float v;
95
-
96
- varying vec2 vUv;
97
-
98
- void main() {
99
-
100
- vec4 sum = vec4( 0.0 );
101
-
102
- sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;
103
- sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;
104
- sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;
105
- sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;
106
- sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;
107
- sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;
108
- sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;
109
- sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;
110
- sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;
111
-
112
- gl_FragColor = sum;
113
-
114
- }`};let Ns,hi,ds,ln;function gi(o,e=1/0,t=null){hi||(hi=new Tn(2,2,1,1)),ds||(ds=new Oi({uniforms:{blitTexture:new vr(o)},vertexShader:`
115
- varying vec2 vUv;
116
- void main(){
117
- vUv = uv;
118
- gl_Position = vec4(position.xy * 1.0,0.,.999999);
119
- }`,fragmentShader:`
120
- uniform sampler2D blitTexture;
121
- varying vec2 vUv;
122
-
123
- void main(){
124
- gl_FragColor = vec4(vUv.xy, 0, 1);
125
-
126
- #ifdef IS_SRGB
127
- gl_FragColor = sRGBTransferOETF( texture2D( blitTexture, vUv) );
128
- #else
129
- gl_FragColor = texture2D( blitTexture, vUv);
130
- #endif
131
- }`})),ds.uniforms.blitTexture.value=o,ds.defines.IS_SRGB=o.colorSpace==re,ds.needsUpdate=!0,ln||(ln=new O(hi,ds),ln.frustumCulled=!1);const n=new Hs,s=new Rn;s.add(ln),t===null&&(t=Ns=new xr({antialias:!1}));const i=Math.min(o.image.width,e),a=Math.min(o.image.height,e);t.setSize(i,a),t.clear(),t.render(s,n);const r=document.createElement("canvas"),A=r.getContext("2d");r.width=i,r.height=a,A.drawImage(t.domElement,0,0,i,a);const c=new Hi(r);return c.minFilter=o.minFilter,c.magFilter=o.magFilter,c.wrapS=o.wrapS,c.wrapT=o.wrapT,c.colorSpace=o.colorSpace,c.name=o.name,Ns&&(Ns.forceContextLoss(),Ns.dispose(),Ns=null),c}const to={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 di{constructor(){this.pluginCallbacks=[],this.register(function(e){return new dl(e)}),this.register(function(e){return new pl(e)}),this.register(function(e){return new bl(e)}),this.register(function(e){return new Il(e)}),this.register(function(e){return new El(e)}),this.register(function(e){return new Cl(e)}),this.register(function(e){return new ul(e)}),this.register(function(e){return new fl(e)}),this.register(function(e){return new ml(e)}),this.register(function(e){return new Bl(e)}),this.register(function(e){return new wl(e)}),this.register(function(e){return new yl(e)}),this.register(function(e){return new Ql(e)}),this.register(function(e){return new vl(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,n,s){const i=new gl,a=[];for(let r=0,A=this.pluginCallbacks.length;r<A;r++)a.push(this.pluginCallbacks[r](i));i.setPlugins(a),i.write(e,t,s).catch(n)}parseAsync(e,t){const n=this;return new Promise(function(s,i){n.parse(e,s,i,t)})}}const ie={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},pi="KHR_mesh_quantization",ot={};ot[Ri]=ie.NEAREST,ot[Ti]=ie.NEAREST_MIPMAP_NEAREST,ot[xi]=ie.NEAREST_MIPMAP_LINEAR,ot[dt]=ie.LINEAR,ot[Si]=ie.LINEAR_MIPMAP_NEAREST,ot[qs]=ie.LINEAR_MIPMAP_LINEAR,ot[zs]=ie.CLAMP_TO_EDGE,ot[Wt]=ie.REPEAT,ot[Di]=ie.MIRRORED_REPEAT;const so={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},il=new Be,no=12,al=1179937895,ol=2,io=8,rl=1313821514,Al=5130562;function Us(o,e){return o.length===e.length&&o.every(function(t,n){return t===e[n]})}function cl(o){return new TextEncoder().encode(o).buffer}function ll(o){return Us(o.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function hl(o,e,t){const n={min:new Array(o.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(o.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let s=e;s<e+t;s++)for(let i=0;i<o.itemSize;i++){let a;o.itemSize>4?a=o.array[s*o.itemSize+i]:(i===0?a=o.getX(s):i===1?a=o.getY(s):i===2?a=o.getZ(s):i===3&&(a=o.getW(s)),o.normalized===!0&&(a=Ee.normalize(a,o.array))),n.min[i]=Math.min(n.min[i],a),n.max[i]=Math.max(n.max[i],a)}return n}function ao(o){return Math.ceil(o/4)*4}function ui(o,e=0){const t=ao(o.byteLength);if(t!==o.byteLength){const n=new Uint8Array(t);if(n.set(new Uint8Array(o)),e!==0)for(let s=o.byteLength;s<t;s++)n[s]=e;return n.buffer}return o}function oo(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function ro(o,e){if(o.toBlob!==void 0)return new Promise(n=>o.toBlob(n,e));let t;return e==="image/jpeg"?t=.92:e==="image/webp"&&(t=.8),o.convertToBlob({type:e,quality:t})}class gl{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"+Sr}},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,n={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},n),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);const s=this,i=s.buffers,a=s.json;n=s.options;const r=s.extensionsUsed,A=s.extensionsRequired,c=new Blob(i,{type:"application/octet-stream"}),l=Object.keys(r),h=Object.keys(A);if(l.length>0&&(a.extensionsUsed=l),h.length>0&&(a.extensionsRequired=h),a.buffers&&a.buffers.length>0&&(a.buffers[0].byteLength=c.size),n.binary===!0){const d=new FileReader;d.readAsArrayBuffer(c),d.onloadend=function(){const p=ui(d.result),f=new DataView(new ArrayBuffer(io));f.setUint32(0,p.byteLength,!0),f.setUint32(4,Al,!0);const b=ui(cl(JSON.stringify(a)),32),u=new DataView(new ArrayBuffer(io));u.setUint32(0,b.byteLength,!0),u.setUint32(4,rl,!0);const I=new ArrayBuffer(no),C=new DataView(I);C.setUint32(0,al,!0),C.setUint32(4,ol,!0);const E=no+u.byteLength+b.byteLength+f.byteLength+p.byteLength;C.setUint32(8,E,!0);const y=new Blob([I,u,b,f,p],{type:"application/octet-stream"}),w=new FileReader;w.readAsArrayBuffer(y),w.onloadend=function(){t(w.result)}}}else if(a.buffers&&a.buffers.length>0){const d=new FileReader;d.readAsDataURL(c),d.onloadend=function(){const p=d.result;a.buffers[0].uri=p,t(a)}}else t(a)}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;const n=this.options,s=this.extensionsUsed;try{const i=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&i.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(const a in i.gltfExtensions)t.extensions[a]=i.gltfExtensions[a],s[a]=!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 t=new N;for(let n=0,s=e.count;n<s;n++)if(Math.abs(t.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 n=e.clone(),s=new N;for(let i=0,a=n.count;i<a;i++)s.fromBufferAttribute(n,i),s.x===0&&s.y===0&&s.z===0?s.setX(1):s.normalize(),n.setXYZ(i,s.x,s.y,s.z);return t.attributesNormalized.set(e,n),n}applyTextureTransform(e,t){let n=!1;const s={};(t.offset.x!==0||t.offset.y!==0)&&(s.offset=t.offset.toArray(),n=!0),t.rotation!==0&&(s.rotation=t.rotation,n=!0),(t.repeat.x!==1||t.repeat.y!==1)&&(s.scale=t.repeat.toArray(),n=!0),n&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=s,this.extensionsUsed.KHR_texture_transform=!0)}buildMetalRoughTexture(e,t){if(e===t)return e;function n(d){return d.colorSpace===re?function(p){return p<.04045?p*.0773993808:Math.pow(p*.9478672986+.0521327014,2.4)}:function(p){return p}}console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),e instanceof Es&&(e=gi(e)),t instanceof Es&&(t=gi(t));const s=e?e.image:null,i=t?t.image:null,a=Math.max(s?s.width:0,i?i.width:0),r=Math.max(s?s.height:0,i?i.height:0),A=oo();A.width=a,A.height=r;const c=A.getContext("2d",{willReadFrequently:!0});c.fillStyle="#00ffff",c.fillRect(0,0,a,r);const l=c.getImageData(0,0,a,r);if(s){c.drawImage(s,0,0,a,r);const d=n(e),p=c.getImageData(0,0,a,r).data;for(let f=2;f<p.length;f+=4)l.data[f]=d(p[f]/256)*256}if(i){c.drawImage(i,0,0,a,r);const d=n(t),p=c.getImageData(0,0,a,r).data;for(let f=1;f<p.length;f+=4)l.data[f]=d(p[f]/256)*256}c.putImageData(l,0,0);const h=(e||t).clone();return h.source=new Tr(A),h.colorSpace=Zs,h.channel=(e||t).channel,e&&t&&e.channel!==t.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),h}processBuffer(e){const t=this.json,n=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),n.push(e),0}processBufferView(e,t,n,s,i){const a=this.json;a.bufferViews||(a.bufferViews=[]);let r;switch(t){case ie.BYTE:case ie.UNSIGNED_BYTE:r=1;break;case ie.SHORT:case ie.UNSIGNED_SHORT:r=2;break;default:r=4}let A=e.itemSize*r;i===ie.ARRAY_BUFFER&&(A=Math.ceil(A/4)*4);const c=ao(s*A),l=new DataView(new ArrayBuffer(c));let h=0;for(let p=n;p<n+s;p++){for(let f=0;f<e.itemSize;f++){let b;e.itemSize>4?b=e.array[p*e.itemSize+f]:(f===0?b=e.getX(p):f===1?b=e.getY(p):f===2?b=e.getZ(p):f===3&&(b=e.getW(p)),e.normalized===!0&&(b=Ee.normalize(b,e.array))),t===ie.FLOAT?l.setFloat32(h,b,!0):t===ie.INT?l.setInt32(h,b,!0):t===ie.UNSIGNED_INT?l.setUint32(h,b,!0):t===ie.SHORT?l.setInt16(h,b,!0):t===ie.UNSIGNED_SHORT?l.setUint16(h,b,!0):t===ie.BYTE?l.setInt8(h,b):t===ie.UNSIGNED_BYTE&&l.setUint8(h,b),h+=r}h%A!==0&&(h+=A-h%A)}const d={buffer:this.processBuffer(l.buffer),byteOffset:this.byteOffset,byteLength:c};return i!==void 0&&(d.target=i),i===ie.ARRAY_BUFFER&&(d.byteStride=A),this.byteOffset+=c,a.bufferViews.push(d),{id:a.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(s){const i=new FileReader;i.readAsArrayBuffer(e),i.onloadend=function(){const a=ui(i.result),r={buffer:t.processBuffer(a),byteOffset:t.byteOffset,byteLength:a.byteLength};t.byteOffset+=a.byteLength,s(n.bufferViews.push(r)-1)}})}processAccessor(e,t,n,s){const i=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let r;if(e.array.constructor===Float32Array)r=ie.FLOAT;else if(e.array.constructor===Int32Array)r=ie.INT;else if(e.array.constructor===Uint32Array)r=ie.UNSIGNED_INT;else if(e.array.constructor===Int16Array)r=ie.SHORT;else if(e.array.constructor===Uint16Array)r=ie.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)r=ie.BYTE;else if(e.array.constructor===Uint8Array)r=ie.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(n===void 0&&(n=0),(s===void 0||s===1/0)&&(s=e.count),s===0)return null;const A=hl(e,n,s);let c;t!==void 0&&(c=e===t.index?ie.ELEMENT_ARRAY_BUFFER:ie.ARRAY_BUFFER);const l=this.processBufferView(e,r,n,s,c),h={bufferView:l.id,byteOffset:l.byteOffset,componentType:r,count:s,max:A.max,min:A.min,type:a[e.itemSize]};return e.normalized===!0&&(h.normalized=!0),i.accessors||(i.accessors=[]),i.accessors.push(h)-1}processImage(e,t,n,s="image/png"){if(e!==null){const i=this,a=i.cache,r=i.json,A=i.options,c=i.pending;a.images.has(e)||a.images.set(e,{});const l=a.images.get(e),h=s+":flipY/"+n.toString();if(l[h]!==void 0)return l[h];r.images||(r.images=[]);const d={mimeType:s},p=oo();p.width=Math.min(e.width,A.maxTextureSize),p.height=Math.min(e.height,A.maxTextureSize);const f=p.getContext("2d",{willReadFrequently:!0});if(n===!0&&(f.translate(0,p.height),f.scale(1,-1)),e.data!==void 0){t!==Pt&&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 u=new Uint8ClampedArray(e.height*e.width*4);for(let I=0;I<u.length;I+=4)u[I+0]=e.data[I+0],u[I+1]=e.data[I+1],u[I+2]=e.data[I+2],u[I+3]=e.data[I+3];f.putImageData(new ImageData(u,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)f.drawImage(e,0,0,p.width,p.height);else throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");A.binary===!0?c.push(ro(p,s).then(u=>i.processBufferViewImage(u)).then(u=>{d.bufferView=u})):p.toDataURL!==void 0?d.uri=p.toDataURL(s):c.push(ro(p,s).then(u=>new FileReader().readAsDataURL(u)).then(u=>{d.uri=u}));const b=r.images.push(d)-1;return l[h]=b,b}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 n={magFilter:ot[e.magFilter],minFilter:ot[e.minFilter],wrapS:ot[e.wrapS],wrapT:ot[e.wrapT]};return t.samplers.push(n)-1}processTexture(e){const t=this.options,n=this.cache,s=this.json;if(n.textures.has(e))return n.textures.get(e);const i={keep:!0,newTexture:null};if(this._invokeAll(function(c){c.beforeWriteTexture&&c.beforeWriteTexture(e,i)}),i.keep===!1)return null;i.newTexture!=null&&(e=i.newTexture),s.textures||(s.textures=[]),e instanceof Es&&(e=gi(e,t.maxTextureSize));let a=e.userData.mimeType;a==="image/webp"&&(a="image/png");const r={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,a)};e.name&&(r.name=e.name),this._invokeAll(function(c){c.writeTexture&&c.writeTexture(e,r)});const A=s.textures.push(r)-1;return n.textures.set(e,A),A}processMaterial(e){const t=this.cache,n=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;n.materials||(n.materials=[]);const s={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]);Us(i,[1,1,1,1])||(s.pbrMetallicRoughness.baseColorFactor=i),e.isMeshStandardMaterial?(s.pbrMetallicRoughness.metallicFactor=e.metalness,s.pbrMetallicRoughness.roughnessFactor=e.roughness):(s.pbrMetallicRoughness.metallicFactor=.5,s.pbrMetallicRoughness.roughnessFactor=.5);const a=e.metalnessMap?.image?e.metalnessMap:void 0,r=e.roughnessMap?.image?e.roughnessMap:void 0;if(a||r){const c=this.buildMetalRoughTexture(a,r),l={index:this.processTexture(c),channel:c.channel};this.applyTextureTransform(l,c),s.pbrMetallicRoughness.metallicRoughnessTexture=l}if(e.map){const c={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(c,e.map),s.pbrMetallicRoughness.baseColorTexture=c}if(e.emissive){const c=e.emissive;if(Math.max(c.r,c.g,c.b)>0&&(s.emissiveFactor=e.emissive.toArray()),e.emissiveMap?.image){const l={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(l,e.emissiveMap),s.emissiveTexture=l}}if(e.normalMap?.image){const c={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(c.scale=e.normalScale.x),this.applyTextureTransform(c,e.normalMap),s.normalTexture=c}if(e.aoMap?.image){const c={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(c.strength=e.aoMapIntensity),this.applyTextureTransform(c,e.aoMap),s.occlusionTexture=c}e.transparent?s.alphaMode="BLEND":e.alphaTest>0&&(s.alphaMode="MASK",s.alphaCutoff=e.alphaTest),e.side===Cn&&(s.doubleSided=!0),e.name!==""&&(s.name=e.name),this.serializeUserData(e,s),this._invokeAll(function(c){c.writeMaterial&&c.writeMaterial(e,s)});const A=n.materials.push(s)-1;return t.materials.set(e,A),A}processMesh(e){const t={keep:!0};if(this._invokeAll(function(w){w.beforeWriteMesh&&w.beforeWriteMesh(e,t)}),t.keep!=!0)return null;const n=this.cache,s=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let w=0,v=e.material.length;w<v;w++)i.push(e.material[w].uuid);else i.push(e.material.uuid);const a=i.join(":");if(n.meshes.has(a))return n.meshes.get(a);const r=e.geometry;let A;e.isLineSegments?A=ie.LINES:e.isLineLoop?A=ie.LINE_LOOP:e.isLine?A=ie.LINE_STRIP:e.isPoints?A=ie.POINTS:A=e.material.wireframe?ie.LINES:ie.TRIANGLES;const c={},l={},h=[],d=[],p={uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},f=r.getAttribute("normal");f!==void 0&&!this.isNormalizedNormalAttribute(f)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),r.setAttribute("normal",this.createNormalizedNormalAttribute(f)));let b=null;for(let w in r.attributes){if(w.slice(0,5)==="morph")continue;const v=r.attributes[w];if(w=p[w]||w.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(w)||(w="_"+w),n.attributes.has(this.getUID(v))){l[w]=n.attributes.get(this.getUID(v));continue}b=null;const T=v.array;w==="JOINTS_0"&&!(T instanceof Uint16Array)&&!(T instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),b=new nt(new Uint16Array(T),v.itemSize,v.normalized));const S=this.processAccessor(b||v,r);S!==null&&(w.startsWith("_")||this.detectMeshQuantization(w,v),l[w]=S,n.attributes.set(this.getUID(v),S))}if(f!==void 0&&r.setAttribute("normal",f),Object.keys(l).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const w=[],v=[],T={};if(e.morphTargetDictionary!==void 0)for(const S in e.morphTargetDictionary)T[e.morphTargetDictionary[S]]=S;for(let S=0;S<e.morphTargetInfluences.length;++S){const M={};let j=!1;for(const z in r.morphAttributes){if(z!=="position"&&z!=="normal"&&z!=="color"){j||(console.warn("GLTFExporter: Only POSITION, NORMAL and COLOR morph are supported."),j=!0);continue}const J=r.morphAttributes[z][S],Z=z.toUpperCase()+(z==="color"?"_0":""),Y=r.attributes[z];if(n.attributes.has(this.getUID(J,!0))){M[Z]=n.attributes.get(this.getUID(J,!0));continue}const $=J.clone();if(!r.morphTargetsRelative)for(let W=0,V=J.count;W<V;W++)for(let X=0;X<J.itemSize;X++)X===0&&$.setX(W,J.getX(W)-Y.getX(W)),X===1&&$.setY(W,J.getY(W)-Y.getY(W)),X===2&&$.setZ(W,J.getZ(W)-Y.getZ(W)),X===3&&$.setW(W,J.getW(W)-Y.getW(W));M[Z]=this.processAccessor($,r),n.attributes.set(this.getUID(Y,!0),M[Z])}d.push(M),w.push(e.morphTargetInfluences[S]),e.morphTargetDictionary!==void 0&&v.push(T[S])}c.weights=w,v.length>0&&(c.extras={},c.extras.targetNames=v)}const u=Array.isArray(e.material);if(u&&r.groups.length===0)return null;let I=!1;if(u&&r.index===null){const w=[];for(let v=0,T=r.attributes.position.count;v<T;v++)w[v]=v;r.setIndex(w),I=!0}const C=u?e.material:[e.material],E=u?r.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let w=0,v=E.length;w<v;w++){const T={mode:A,attributes:l};if(this.serializeUserData(r,T),d.length>0&&(T.targets=d),r.index!==null){let M=this.getUID(r.index);(E[w].start!==void 0||E[w].count!==void 0)&&(M+=":"+E[w].start+":"+E[w].count),n.attributes.has(M)?T.indices=n.attributes.get(M):(T.indices=this.processAccessor(r.index,r,E[w].start,E[w].count),n.attributes.set(M,T.indices)),T.indices===null&&delete T.indices}const S=this.processMaterial(C[E[w].materialIndex]);S!==null&&(T.material=S),h.push(T)}I===!0&&r.setIndex(null),c.primitives=h,s.meshes||(s.meshes=[]),this._invokeAll(function(w){w.writeMesh&&w.writeMesh(e,c)});const y=s.meshes.push(c)-1;return n.meshes.set(a,y),y}detectMeshQuantization(e,t){if(this.extensionsUsed[pi])return;let n;switch(t.array.constructor){case Int8Array:n="byte";break;case Uint8Array:n="unsigned byte";break;case Int16Array:n="short";break;case Uint16Array:n="unsigned short";break;default:return}t.normalized&&(n+=" normalized");const s=e.split("_",1)[0];to[s]&&to[s].includes(n)&&(this.extensionsUsed[pi]=!0,this.extensionsRequired[pi]=!0)}processCamera(e){const t=this.json;t.cameras||(t.cameras=[]);const n=e.isOrthographicCamera,s={type:n?"orthographic":"perspective"};return n?s.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:s.perspective={aspectRatio:e.aspect,yfov:Ee.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(s.name=e.type),t.cameras.push(s)-1}processAnimation(e,t){const n=this.json,s=this.nodeMap;n.animations||(n.animations=[]),e=di.Utils.mergeMorphTargetTracks(e.clone(),t);const i=e.tracks,a=[],r=[];for(let A=0;A<i.length;++A){const c=i[A],l=pt.parseTrackName(c.name);let h=pt.findNode(t,l.nodeName);const d=so[l.propertyName];if(l.objectName==="bones"&&(h.isSkinnedMesh===!0?h=h.skeleton.getBoneByName(l.objectIndex):h=void 0),!h||!d){console.warn('THREE.GLTFExporter: Could not export animation track "%s".',c.name);continue}const p=1;let f=c.values.length/c.times.length;d===so.morphTargetInfluences&&(f/=h.morphTargetInfluences.length);let b;c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(b="CUBICSPLINE",f/=3):c.getInterpolation()===Qn?b="STEP":b="LINEAR",r.push({input:this.processAccessor(new nt(c.times,p)),output:this.processAccessor(new nt(c.values,f)),interpolation:b}),a.push({sampler:r.length-1,target:{node:s.get(h),path:d}})}return n.animations.push({name:e.name||"clip_"+n.animations.length,samplers:r,channels:a}),n.animations.length-1}processSkin(e){const t=this.json,n=this.nodeMap,s=t.nodes[n.get(e)],i=e.skeleton;if(i===void 0)return null;const a=e.skeleton.bones[0];if(a===void 0)return null;const r=[],A=new Float32Array(i.bones.length*16),c=new oe;for(let l=0;l<i.bones.length;++l)r.push(n.get(i.bones[l])),c.copy(i.boneInverses[l]),c.multiply(e.bindMatrix).toArray(A,l*16);return t.skins===void 0&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new nt(A,16)),joints:r,skeleton:n.get(a)}),s.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 n=this.json,s=this.options,i=this.nodeMap;n.nodes||(n.nodes=[]);const a={};if(s.trs){const A=e.quaternion.toArray(),c=e.position.toArray(),l=e.scale.toArray();Us(A,[0,0,0,1])||(a.rotation=A),Us(c,[0,0,0])||(a.translation=c),Us(l,[1,1,1])||(a.scale=l)}else e.matrixAutoUpdate&&e.updateMatrix(),ll(e.matrix)===!1&&(a.matrix=e.matrix.elements);if(e.name!==""&&(a.name=String(e.name)),this.serializeUserData(e,a),e.isMesh||e.isLine||e.isPoints){const A=this.processMesh(e);A!==null&&(a.mesh=A)}else e.isCamera&&(a.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){const A=[];for(let c=0,l=e.children.length;c<l;c++){const h=e.children[c];if(h.visible||s.onlyVisible===!1){const d=this.processNode(h);d!==null&&A.push(d)}}A.length>0&&(a.children=A)}this._invokeAll(function(A){A.writeNode&&A.writeNode(e,a)});const r=n.nodes.push(a)-1;return i.set(e,r),r}processScene(e){const t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);const s={};e.name!==""&&(s.name=e.name),t.scenes.push(s);const i=[];for(let a=0,r=e.children.length;a<r;a++){const A=e.children[a];if(A.visible||n.onlyVisible===!1){const c=this.processNode(A);c!==null&&i.push(c)}}i.length>0&&(s.nodes=i),this.serializeUserData(e,s)}processObjects(e){const t=new Rn;t.name="AuxScene";for(let n=0;n<e.length;n++)t.children.push(e[n]);this.processScene(t)}processInput(e){const t=this.options;e=e instanceof Array?e:[e],this._invokeAll(function(s){s.beforeParse&&s.beforeParse(e)});const n=[];for(let s=0;s<e.length;s++)e[s]instanceof Rn?this.processScene(e[s]):n.push(e[s]);n.length>0&&this.processObjects(n);for(let s=0;s<this.skins.length;++s)this.processSkin(this.skins[s]);for(let s=0;s<t.animations.length;++s)this.processAnimation(t.animations[s],e[0]);this._invokeAll(function(s){s.afterParse&&s.afterParse(e)})}_invokeAll(e){for(let t=0,n=this.plugins.length;t<n;t++)e(this.plugins[t])}}class dl{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 n=this.writer,s=n.json,i=n.extensionsUsed,a={};e.name&&(a.name=e.name),a.color=e.color.toArray(),a.intensity=e.intensity,e.isDirectionalLight?a.type="directional":e.isPointLight?(a.type="point",e.distance>0&&(a.range=e.distance)):e.isSpotLight&&(a.type="spot",e.distance>0&&(a.range=e.distance),a.spot={},a.spot.innerConeAngle=(1-e.penumbra)*e.angle,a.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]||(s.extensions=s.extensions||{},s.extensions[this.name]={lights:[]},i[this.name]=!0);const r=s.extensions[this.name].lights;r.push(a),t.extensions=t.extensions||{},t.extensions[this.name]={light:r.length-1}}}class pl{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 ul{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;const n=this.writer,s=n.extensionsUsed,i={};if(i.clearcoatFactor=e.clearcoat,e.clearcoatMap){const a={index:n.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};n.applyTextureTransform(a,e.clearcoatMap),i.clearcoatTexture=a}if(i.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){const a={index:n.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};n.applyTextureTransform(a,e.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=a}if(e.clearcoatNormalMap){const a={index:n.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};e.clearcoatNormalScale.x!==1&&(a.scale=e.clearcoatNormalScale.x),n.applyTextureTransform(a,e.clearcoatNormalMap),i.clearcoatNormalTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=i,s[this.name]=!0}}class fl{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,s={};s.dispersion=e.dispersion,t.extensions=t.extensions||{},t.extensions[this.name]=s,n[this.name]=!0}}class ml{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;const n=this.writer,s=n.extensionsUsed,i={};if(i.iridescenceFactor=e.iridescence,e.iridescenceMap){const a={index:n.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};n.applyTextureTransform(a,e.iridescenceMap),i.iridescenceTexture=a}if(i.iridescenceIor=e.iridescenceIOR,i.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){const a={index:n.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};n.applyTextureTransform(a,e.iridescenceThicknessMap),i.iridescenceThicknessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=i,s[this.name]=!0}}class bl{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const n=this.writer,s=n.extensionsUsed,i={};if(i.transmissionFactor=e.transmission,e.transmissionMap){const a={index:n.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};n.applyTextureTransform(a,e.transmissionMap),i.transmissionTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=i,s[this.name]=!0}}class Il{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const n=this.writer,s=n.extensionsUsed,i={};if(i.thicknessFactor=e.thickness,e.thicknessMap){const a={index:n.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};n.applyTextureTransform(a,e.thicknessMap),i.thicknessTexture=a}e.attenuationDistance!==1/0&&(i.attenuationDistance=e.attenuationDistance),i.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,s[this.name]=!0}}class El{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,s={};s.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=s,n[this.name]=!0}}class Cl{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(il)&&!e.specularIntensityMap&&!e.specularColorMap)return;const n=this.writer,s=n.extensionsUsed,i={};if(e.specularIntensityMap){const a={index:n.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};n.applyTextureTransform(a,e.specularIntensityMap),i.specularTexture=a}if(e.specularColorMap){const a={index:n.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};n.applyTextureTransform(a,e.specularColorMap),i.specularColorTexture=a}i.specularFactor=e.specularIntensity,i.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,s[this.name]=!0}}class Bl{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;const n=this.writer,s=n.extensionsUsed,i={};if(e.sheenRoughnessMap){const a={index:n.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};n.applyTextureTransform(a,e.sheenRoughnessMap),i.sheenRoughnessTexture=a}if(e.sheenColorMap){const a={index:n.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};n.applyTextureTransform(a,e.sheenColorMap),i.sheenColorTexture=a}i.sheenRoughnessFactor=e.sheenRoughness,i.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,s[this.name]=!0}}class wl{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;const n=this.writer,s=n.extensionsUsed,i={};if(e.anisotropyMap){const a={index:n.processTexture(e.anisotropyMap)};n.applyTextureTransform(a,e.anisotropyMap),i.anisotropyTexture=a}i.anisotropyStrength=e.anisotropy,i.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=i,s[this.name]=!0}}class yl{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,s={};s.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=s,n[this.name]=!0}}class Ql{constructor(e){this.writer=e,this.name="EXT_materials_bump"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.bumpScale===1&&!e.bumpMap)return;const n=this.writer,s=n.extensionsUsed,i={};if(e.bumpMap){const a={index:n.processTexture(e.bumpMap),texCoord:e.bumpMap.channel};n.applyTextureTransform(a,e.bumpMap),i.bumpTexture=a}i.bumpFactor=e.bumpScale,t.extensions=t.extensions||{},t.extensions[this.name]=i,s[this.name]=!0}}class vl{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,t){if(!e.isInstancedMesh)return;const n=this.writer,s=e,i=new Float32Array(s.count*3),a=new Float32Array(s.count*4),r=new Float32Array(s.count*3),A=new oe,c=new N,l=new we,h=new N;for(let p=0;p<s.count;p++)s.getMatrixAt(p,A),A.decompose(c,l,h),c.toArray(i,p*3),l.toArray(a,p*4),h.toArray(r,p*3);const d={TRANSLATION:n.processAccessor(new nt(i,3)),ROTATION:n.processAccessor(new nt(a,4)),SCALE:n.processAccessor(new nt(r,3))};s.instanceColor&&(d._COLOR_0=n.processAccessor(s.instanceColor)),t.extensions=t.extensions||{},t.extensions[this.name]={attributes:d},n.extensionsUsed[this.name]=!0,n.extensionsRequired[this.name]=!0}}di.Utils={insertKeyframe:function(o,e){const t=o.getValueSize(),n=new o.TimeBufferType(o.times.length+1),s=new o.ValueBufferType(o.values.length+t),i=o.createInterpolant(new o.ValueBufferType(t));let a;if(o.times.length===0){n[0]=e;for(let r=0;r<t;r++)s[r]=0;a=0}else if(e<o.times[0]){if(Math.abs(o.times[0]-e)<.001)return 0;n[0]=e,n.set(o.times,1),s.set(i.evaluate(e),0),s.set(o.values,t),a=0}else if(e>o.times[o.times.length-1]){if(Math.abs(o.times[o.times.length-1]-e)<.001)return o.times.length-1;n[n.length-1]=e,n.set(o.times,0),s.set(o.values,0),s.set(i.evaluate(e),o.values.length),a=n.length-1}else for(let r=0;r<o.times.length;r++){if(Math.abs(o.times[r]-e)<.001)return r;if(o.times[r]<e&&o.times[r+1]>e){n.set(o.times.slice(0,r+1),0),n[r+1]=e,n.set(o.times.slice(r+1),r+2),s.set(o.values.slice(0,(r+1)*t),0),s.set(i.evaluate(e),(r+1)*t),s.set(o.values.slice((r+1)*t),(r+2)*t),a=r+1;break}}return o.times=n,o.values=s,a},mergeMorphTargetTracks:function(o,e){const t=[],n={},s=o.tracks;for(let i=0;i<s.length;++i){let a=s[i];const r=pt.parseTrackName(a.name),A=pt.findNode(e,r.nodeName);if(r.propertyName!=="morphTargetInfluences"||r.propertyIndex===void 0){t.push(a);continue}if(a.createInterpolant!==a.InterpolantFactoryMethodDiscrete&&a.createInterpolant!==a.InterpolantFactoryMethodLinear){if(a.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."),a=a.clone(),a.setInterpolation(Is)}const c=A.morphTargetInfluences.length,l=A.morphTargetDictionary[r.propertyIndex];if(l===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+r.propertyIndex);let h;if(n[A.uuid]===void 0){h=a.clone();const p=new h.ValueBufferType(c*h.times.length);for(let f=0;f<h.times.length;f++)p[f*c+l]=h.values[f];h.name=(r.nodeName||"")+".morphTargetInfluences",h.values=p,n[A.uuid]=h,t.push(h);continue}const d=a.createInterpolant(new a.ValueBufferType(1));h=n[A.uuid];for(let p=0;p<h.times.length;p++)h.values[p*c+l]=d.evaluate(h.times[p]);for(let p=0;p<a.times.length;p++){const f=this.insertKeyframe(h,a.times[p]);h.values[f*c+l]=a.values[p]}}return o.tracks=t,o}};const ye={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 Ao(o){const e=await fetch(o);if(e.ok)return e.json();throw new Error(e.statusText)}async function xl(o){if(!o)throw new Error("No basePath supplied");return await Ao(`${o}/profilesList.json`)}async function Sl(o,e,t=null,n=!0){if(!o)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No basePath supplied");const s=await xl(e);let i;if(o.profiles.some(A=>{const c=s[A];return c&&(i={profileId:A,profilePath:`${e}/${c.path}`,deprecated:!!c.deprecated}),!!i}),!i){if(!t)throw new Error("No matching profile name found");const A=s[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 a=await Ao(i.profilePath);let r;if(n){let A;if(o.handedness==="any"?A=a.layouts[Object.keys(a.layouts)[0]]:A=a.layouts[o.handedness],!A)throw new Error(`No matching handedness, ${o.handedness}, in profile ${i.profileId}`);A.assetPath&&(r=i.profilePath.replace("profile.json",A.assetPath))}return{profile:a,assetPath:r}}const Tl={xAxis:0,yAxis:0,button:0,state:ye.ComponentState.DEFAULT};function Rl(o=0,e=0){let t=o,n=e;if(Math.sqrt(o*o+e*e)>1){const s=Math.atan2(e,o);t=Math.cos(s),n=Math.sin(s)}return{normalizedXAxis:t*.5+.5,normalizedYAxis:n*.5+.5}}class Dl{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===ye.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(Tl)}updateFromComponent({xAxis:e,yAxis:t,button:n,state:s}){const{normalizedXAxis:i,normalizedYAxis:a}=Rl(e,t);switch(this.componentProperty){case ye.ComponentProperty.X_AXIS:this.value=this.states.includes(s)?i:.5;break;case ye.ComponentProperty.Y_AXIS:this.value=this.states.includes(s)?a:.5;break;case ye.ComponentProperty.BUTTON:this.value=this.states.includes(s)?n:0;break;case ye.ComponentProperty.STATE:this.valueNodeProperty===ye.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(s):this.value=this.states.includes(s)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class kl{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(n=>{const s=new Dl(t.visualResponses[n]);this.visualResponses[n]=s}),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:ye.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=ye.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=ye.ComponentState.PRESSED:(t.touched||this.values.button>ye.ButtonTouchThreshold)&&(this.values.state=ye.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===ye.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>ye.AxisTouchThreshold&&(this.values.state=ye.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===ye.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>ye.AxisTouchThreshold&&(this.values.state=ye.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(t=>{t.updateFromComponent(this.values)})}}class Ml{constructor(e,t,n){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");this.xrInputSource=e,this.assetUrl=n,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(s=>{const i=this.layoutDescription.components[s];this.components[s]=new kl(s,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 _l="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",Fl="generic-trigger";class Ll extends Bt{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(n=>{const{valueNode:s,minNode:i,maxNode:a,value:r,valueNodeProperty:A}=n;s&&(A===ye.VisualResponseProperty.VISIBILITY?s.visible=r:A===ye.VisualResponseProperty.TRANSFORM&&(s.quaternion.slerpQuaternions(i.quaternion,a.quaternion,r),s.position.lerpVectors(i.position,a.position,r)))})}))}}function Nl(o,e){Object.values(o.components).forEach(t=>{const{type:n,touchPointNodeName:s,visualResponses:i}=t;if(n===ye.ComponentType.TOUCHPAD)if(t.touchPointNode=e.getObjectByName(s),t.touchPointNode){const a=new un(.001),r=new It({color:255}),A=new O(a,r);t.touchPointNode.add(A)}else console.warn(`Could not find touch dot, ${t.touchPointNodeName}, in touchpad component ${t.id}`);Object.values(i).forEach(a=>{const{valueNodeName:r,minNodeName:A,maxNodeName:c,valueNodeProperty:l}=a;if(l===ye.VisualResponseProperty.TRANSFORM){if(a.minNode=e.getObjectByName(A),a.maxNode=e.getObjectByName(c),!a.minNode){console.warn(`Could not find ${A} in the model`);return}if(!a.maxNode){console.warn(`Could not find ${c} in the model`);return}}a.valueNode=e.getObjectByName(r),a.valueNode||console.warn(`Could not find ${r} in the model`)})})}function co(o,e){Nl(o.motionController,e),o.envMap&&e.traverse(t=>{t.isMesh&&(t.material.envMap=o.envMap,t.material.needsUpdate=!0)}),o.layers.mask!=0&&e.traverse(t=>{t.layers.mask=o.layers.mask}),o.add(e)}class Ul{constructor(e=null,t=null){this.gltfLoader=e,this.path=_l,this._assetCache={},this.onLoad=t,this.gltfLoader||(this.gltfLoader=new kn)}setPath(e){return this.path=e,this}createControllerModel(e){const t=new Ll;let n=null;return e.addEventListener("connected",s=>{const i=s.data;i.targetRayMode!=="tracked-pointer"||!i.gamepad||i.hand||Sl(i,this.path,Fl).then(({profile:a,assetPath:r})=>{t.motionController=new Ml(i,a,r);const A=this._assetCache[t.motionController.assetUrl];if(A)n=A.scene.clone(),co(t,n),this.onLoad&&this.onLoad(n);else{if(!this.gltfLoader)throw new Error("GLTFLoader not set.");this.gltfLoader.setPath(""),this.gltfLoader.load(t.motionController.assetUrl,c=>{this._assetCache[t.motionController.assetUrl]=c,n=c.scene.clone(),co(t,n),this.onLoad&&this.onLoad(n)},null,()=>{throw new Error(`Asset ${t.motionController.assetUrl} missing or malformed.`)})}}).catch(a=>{console.warn(a)})}),e.addEventListener("disconnected",()=>{t.motionController=null,t.remove(n),n=null}),t}}const Gl="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/generic-hand/";class Pl{constructor(e,t,n,s,i=null,a=null){this.controller=t,this.handModel=e,this.bones=[],i===null&&(i=new kn,i.setPath(n||Gl)),i.load(`${s}.glb`,r=>{const A=r.scene.children[0];this.handModel.add(A),A.layers.mask=this.handModel.layers.mask;const c=A.getObjectByProperty("type","SkinnedMesh");c.frustumCulled=!1,c.castShadow=!0,c.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(l=>{const h=A.getObjectByName(l);h!==void 0?h.jointName=l:console.warn(`Couldn't find ${l} in ${s} hand mesh`),this.bones.push(h)}),a&&a(A)})}updateMesh(){const e=this.controller.joints;for(let t=0;t<this.bones.length;t++){const n=this.bones[t];if(n){const s=e[n.jointName];if(s.visible){const i=s.position;n.position.copy(i),n.quaternion.copy(s.quaternion)}}}}}const lo=new Xs,hn=new N;class ho extends Rr{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],n=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(n),this.setAttribute("position",new Te(e,3)),this.setAttribute("uv",new Te(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),n.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 n=new Dn(t,6,1);return this.setAttribute("instanceStart",new Zt(n,3,0)),this.setAttribute("instanceEnd",new Zt(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new Dn(t,6,1);return this.setAttribute("instanceColorStart",new Zt(n,3,0)),this.setAttribute("instanceColorEnd",new Zt(n,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 Dr(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Xs);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),lo.setFromBufferAttribute(t),this.boundingBox.union(lo))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new xn),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let s=0;for(let i=0,a=e.count;i<a;i++)hn.fromBufferAttribute(e,i),s=Math.max(s,n.distanceToSquared(hn)),hn.fromBufferAttribute(t,i),s=Math.max(s,n.distanceToSquared(hn));this.boundingSphere.radius=Math.sqrt(s),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)}}ms.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Fe(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},Et.line={uniforms:fn.merge([ms.common,ms.fog,ms.line]),vertexShader:`
132
- #include <common>
133
- #include <color_pars_vertex>
134
- #include <fog_pars_vertex>
135
- #include <logdepthbuf_pars_vertex>
136
- #include <clipping_planes_pars_vertex>
137
-
138
- uniform float linewidth;
139
- uniform vec2 resolution;
140
-
141
- attribute vec3 instanceStart;
142
- attribute vec3 instanceEnd;
143
-
144
- attribute vec3 instanceColorStart;
145
- attribute vec3 instanceColorEnd;
146
-
147
- #ifdef WORLD_UNITS
148
-
149
- varying vec4 worldPos;
150
- varying vec3 worldStart;
151
- varying vec3 worldEnd;
152
-
153
- #ifdef USE_DASH
154
-
155
- varying vec2 vUv;
156
-
157
- #endif
158
-
159
- #else
160
-
161
- varying vec2 vUv;
162
-
163
- #endif
164
-
165
- #ifdef USE_DASH
166
-
167
- uniform float dashScale;
168
- attribute float instanceDistanceStart;
169
- attribute float instanceDistanceEnd;
170
- varying float vLineDistance;
171
-
172
- #endif
173
-
174
- void trimSegment( const in vec4 start, inout vec4 end ) {
175
-
176
- // trim end segment so it terminates between the camera plane and the near plane
177
-
178
- // conservative estimate of the near plane
179
- float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column
180
- float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column
181
- float nearEstimate = - 0.5 * b / a;
182
-
183
- float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );
184
-
185
- end.xyz = mix( start.xyz, end.xyz, alpha );
186
-
187
- }
188
-
189
- void main() {
190
-
191
- #ifdef USE_COLOR
192
-
193
- vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;
194
-
195
- #endif
196
-
197
- #ifdef USE_DASH
198
-
199
- vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
200
- vUv = uv;
201
-
202
- #endif
203
-
204
- float aspect = resolution.x / resolution.y;
205
-
206
- // camera space
207
- vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );
208
- vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );
209
-
210
- #ifdef WORLD_UNITS
211
-
212
- worldStart = start.xyz;
213
- worldEnd = end.xyz;
214
-
215
- #else
216
-
217
- vUv = uv;
218
-
219
- #endif
220
-
221
- // special case for perspective projection, and segments that terminate either in, or behind, the camera plane
222
- // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space
223
- // but we need to perform ndc-space calculations in the shader, so we must address this issue directly
224
- // perhaps there is a more elegant solution -- WestLangley
225
-
226
- bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column
227
-
228
- if ( perspective ) {
229
-
230
- if ( start.z < 0.0 && end.z >= 0.0 ) {
231
-
232
- trimSegment( start, end );
233
-
234
- } else if ( end.z < 0.0 && start.z >= 0.0 ) {
235
-
236
- trimSegment( end, start );
237
-
238
- }
239
-
240
- }
241
-
242
- // clip space
243
- vec4 clipStart = projectionMatrix * start;
244
- vec4 clipEnd = projectionMatrix * end;
245
-
246
- // ndc space
247
- vec3 ndcStart = clipStart.xyz / clipStart.w;
248
- vec3 ndcEnd = clipEnd.xyz / clipEnd.w;
249
-
250
- // direction
251
- vec2 dir = ndcEnd.xy - ndcStart.xy;
252
-
253
- // account for clip-space aspect ratio
254
- dir.x *= aspect;
255
- dir = normalize( dir );
256
-
257
- #ifdef WORLD_UNITS
258
-
259
- vec3 worldDir = normalize( end.xyz - start.xyz );
260
- vec3 tmpFwd = normalize( mix( start.xyz, end.xyz, 0.5 ) );
261
- vec3 worldUp = normalize( cross( worldDir, tmpFwd ) );
262
- vec3 worldFwd = cross( worldDir, worldUp );
263
- worldPos = position.y < 0.5 ? start: end;
264
-
265
- // height offset
266
- float hw = linewidth * 0.5;
267
- worldPos.xyz += position.x < 0.0 ? hw * worldUp : - hw * worldUp;
268
-
269
- // don't extend the line if we're rendering dashes because we
270
- // won't be rendering the endcaps
271
- #ifndef USE_DASH
272
-
273
- // cap extension
274
- worldPos.xyz += position.y < 0.5 ? - hw * worldDir : hw * worldDir;
275
-
276
- // add width to the box
277
- worldPos.xyz += worldFwd * hw;
278
-
279
- // endcaps
280
- if ( position.y > 1.0 || position.y < 0.0 ) {
281
-
282
- worldPos.xyz -= worldFwd * 2.0 * hw;
283
-
284
- }
285
-
286
- #endif
287
-
288
- // project the worldpos
289
- vec4 clip = projectionMatrix * worldPos;
290
-
291
- // shift the depth of the projected points so the line
292
- // segments overlap neatly
293
- vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;
294
- clip.z = clipPose.z * clip.w;
295
-
296
- #else
297
-
298
- vec2 offset = vec2( dir.y, - dir.x );
299
- // undo aspect ratio adjustment
300
- dir.x /= aspect;
301
- offset.x /= aspect;
302
-
303
- // sign flip
304
- if ( position.x < 0.0 ) offset *= - 1.0;
305
-
306
- // endcaps
307
- if ( position.y < 0.0 ) {
308
-
309
- offset += - dir;
310
-
311
- } else if ( position.y > 1.0 ) {
312
-
313
- offset += dir;
314
-
315
- }
316
-
317
- // adjust for linewidth
318
- offset *= linewidth;
319
-
320
- // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
321
- offset /= resolution.y;
322
-
323
- // select end
324
- vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;
325
-
326
- // back to clip space
327
- offset *= clip.w;
328
-
329
- clip.xy += offset;
330
-
331
- #endif
332
-
333
- gl_Position = clip;
334
-
335
- vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation
336
-
337
- #include <logdepthbuf_vertex>
338
- #include <clipping_planes_vertex>
339
- #include <fog_vertex>
340
-
341
- }
342
- `,fragmentShader:`
343
- uniform vec3 diffuse;
344
- uniform float opacity;
345
- uniform float linewidth;
346
-
347
- #ifdef USE_DASH
348
-
349
- uniform float dashOffset;
350
- uniform float dashSize;
351
- uniform float gapSize;
352
-
353
- #endif
354
-
355
- varying float vLineDistance;
356
-
357
- #ifdef WORLD_UNITS
358
-
359
- varying vec4 worldPos;
360
- varying vec3 worldStart;
361
- varying vec3 worldEnd;
362
-
363
- #ifdef USE_DASH
364
-
365
- varying vec2 vUv;
366
-
367
- #endif
368
-
369
- #else
370
-
371
- varying vec2 vUv;
372
-
373
- #endif
374
-
375
- #include <common>
376
- #include <color_pars_fragment>
377
- #include <fog_pars_fragment>
378
- #include <logdepthbuf_pars_fragment>
379
- #include <clipping_planes_pars_fragment>
380
-
381
- vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {
382
-
383
- float mua;
384
- float mub;
385
-
386
- vec3 p13 = p1 - p3;
387
- vec3 p43 = p4 - p3;
388
-
389
- vec3 p21 = p2 - p1;
390
-
391
- float d1343 = dot( p13, p43 );
392
- float d4321 = dot( p43, p21 );
393
- float d1321 = dot( p13, p21 );
394
- float d4343 = dot( p43, p43 );
395
- float d2121 = dot( p21, p21 );
396
-
397
- float denom = d2121 * d4343 - d4321 * d4321;
398
-
399
- float numer = d1343 * d4321 - d1321 * d4343;
400
-
401
- mua = numer / denom;
402
- mua = clamp( mua, 0.0, 1.0 );
403
- mub = ( d1343 + d4321 * ( mua ) ) / d4343;
404
- mub = clamp( mub, 0.0, 1.0 );
405
-
406
- return vec2( mua, mub );
407
-
408
- }
409
-
410
- void main() {
411
-
412
- #include <clipping_planes_fragment>
413
-
414
- #ifdef USE_DASH
415
-
416
- if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps
417
-
418
- if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX
419
-
420
- #endif
421
-
422
- float alpha = opacity;
423
-
424
- #ifdef WORLD_UNITS
425
-
426
- // Find the closest points on the view ray and the line segment
427
- vec3 rayEnd = normalize( worldPos.xyz ) * 1e5;
428
- vec3 lineDir = worldEnd - worldStart;
429
- vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );
430
-
431
- vec3 p1 = worldStart + lineDir * params.x;
432
- vec3 p2 = rayEnd * params.y;
433
- vec3 delta = p1 - p2;
434
- float len = length( delta );
435
- float norm = len / linewidth;
436
-
437
- #ifndef USE_DASH
438
-
439
- #ifdef USE_ALPHA_TO_COVERAGE
440
-
441
- float dnorm = fwidth( norm );
442
- alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );
443
-
444
- #else
445
-
446
- if ( norm > 0.5 ) {
447
-
448
- discard;
449
-
450
- }
451
-
452
- #endif
453
-
454
- #endif
455
-
456
- #else
457
-
458
- #ifdef USE_ALPHA_TO_COVERAGE
459
-
460
- // artifacts appear on some hardware if a derivative is taken within a conditional
461
- float a = vUv.x;
462
- float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
463
- float len2 = a * a + b * b;
464
- float dlen = fwidth( len2 );
465
-
466
- if ( abs( vUv.y ) > 1.0 ) {
467
-
468
- alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );
469
-
470
- }
471
-
472
- #else
473
-
474
- if ( abs( vUv.y ) > 1.0 ) {
475
-
476
- float a = vUv.x;
477
- float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
478
- float len2 = a * a + b * b;
479
-
480
- if ( len2 > 1.0 ) discard;
481
-
482
- }
483
-
484
- #endif
485
-
486
- #endif
487
-
488
- vec4 diffuseColor = vec4( diffuse, alpha );
489
-
490
- #include <logdepthbuf_fragment>
491
- #include <color_fragment>
492
-
493
- gl_FragColor = vec4( diffuseColor.rgb, alpha );
494
-
495
- #include <tonemapping_fragment>
496
- #include <colorspace_fragment>
497
- #include <fog_fragment>
498
- #include <premultiplied_alpha_fragment>
499
-
500
- }
501
- `};class fi extends Oi{constructor(e){super({type:"LineMaterial",uniforms:fn.clone(Et.line.uniforms),vertexShader:Et.line.vertexShader,fragmentShader:Et.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 mi=new Mt,go=new N,po=new N,Ge=new Mt,Pe=new Mt,vt=new Mt,bi=new N,Ii=new oe,Oe=new kr,uo=new N,gn=new Xs,dn=new xn,xt=new Mt;let St,ns;function fo(o,e,t){return xt.set(0,0,-e,1).applyMatrix4(o.projectionMatrix),xt.multiplyScalar(1/xt.w),xt.x=ns/t.width,xt.y=ns/t.height,xt.applyMatrix4(o.projectionMatrixInverse),xt.multiplyScalar(1/xt.w),Math.abs(Math.max(xt.x,xt.y))}function Ol(o,e){const t=o.matrixWorld,n=o.geometry,s=n.attributes.instanceStart,i=n.attributes.instanceEnd,a=Math.min(n.instanceCount,s.count);for(let r=0,A=a;r<A;r++){Oe.start.fromBufferAttribute(s,r),Oe.end.fromBufferAttribute(i,r),Oe.applyMatrix4(t);const c=new N,l=new N;St.distanceSqToSegment(Oe.start,Oe.end,l,c),l.distanceTo(c)<ns*.5&&e.push({point:l,pointOnLine:c,distance:St.origin.distanceTo(l),object:o,face:null,faceIndex:r,uv:null,uv1:null})}}function Hl(o,e,t){const n=e.projectionMatrix,s=o.material.resolution,i=o.matrixWorld,a=o.geometry,r=a.attributes.instanceStart,A=a.attributes.instanceEnd,c=Math.min(a.instanceCount,r.count),l=-e.near;St.at(1,vt),vt.w=1,vt.applyMatrix4(e.matrixWorldInverse),vt.applyMatrix4(n),vt.multiplyScalar(1/vt.w),vt.x*=s.x/2,vt.y*=s.y/2,vt.z=0,bi.copy(vt),Ii.multiplyMatrices(e.matrixWorldInverse,i);for(let h=0,d=c;h<d;h++){if(Ge.fromBufferAttribute(r,h),Pe.fromBufferAttribute(A,h),Ge.w=1,Pe.w=1,Ge.applyMatrix4(Ii),Pe.applyMatrix4(Ii),Ge.z>l&&Pe.z>l)continue;if(Ge.z>l){const I=Ge.z-Pe.z,C=(Ge.z-l)/I;Ge.lerp(Pe,C)}else if(Pe.z>l){const I=Pe.z-Ge.z,C=(Pe.z-l)/I;Pe.lerp(Ge,C)}Ge.applyMatrix4(n),Pe.applyMatrix4(n),Ge.multiplyScalar(1/Ge.w),Pe.multiplyScalar(1/Pe.w),Ge.x*=s.x/2,Ge.y*=s.y/2,Pe.x*=s.x/2,Pe.y*=s.y/2,Oe.start.copy(Ge),Oe.start.z=0,Oe.end.copy(Pe),Oe.end.z=0;const p=Oe.closestPointToPointParameter(bi,!0);Oe.at(p,uo);const f=Ee.lerp(Ge.z,Pe.z,p),b=f>=-1&&f<=1,u=bi.distanceTo(uo)<ns*.5;if(b&&u){Oe.start.fromBufferAttribute(r,h),Oe.end.fromBufferAttribute(A,h),Oe.start.applyMatrix4(i),Oe.end.applyMatrix4(i);const I=new N,C=new N;St.distanceSqToSegment(Oe.start,Oe.end,C,I),t.push({point:C,pointOnLine:I,distance:St.origin.distanceTo(C),object:o,face:null,faceIndex:h,uv:null,uv1:null})}}}class jl extends O{constructor(e=new ho,t=new fi({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,s=new Float32Array(2*t.count);for(let a=0,r=0,A=t.count;a<A;a++,r+=2)go.fromBufferAttribute(t,a),po.fromBufferAttribute(n,a),s[r]=r===0?0:s[r-1],s[r+1]=s[r]+go.distanceTo(po);const i=new Dn(s,2,1);return e.setAttribute("instanceDistanceStart",new Zt(i,1,0)),e.setAttribute("instanceDistanceEnd",new Zt(i,1,1)),this}raycast(e,t){const n=this.material.worldUnits,s=e.camera;s===null&&!n&&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;St=e.ray;const a=this.matrixWorld,r=this.geometry,A=this.material;ns=A.linewidth+i,r.boundingSphere===null&&r.computeBoundingSphere(),dn.copy(r.boundingSphere).applyMatrix4(a);let c;if(n)c=ns*.5;else{const h=Math.max(s.near,dn.distanceToPoint(St.origin));c=fo(s,h,A.resolution)}if(dn.radius+=c,St.intersectsSphere(dn)===!1)return;r.boundingBox===null&&r.computeBoundingBox(),gn.copy(r.boundingBox).applyMatrix4(a);let l;if(n)l=ns*.5;else{const h=Math.max(s.near,gn.distanceToPoint(St.origin));l=fo(s,h,A.resolution)}gn.expandByScalar(l),St.intersectsBox(gn)!==!1&&(n?Ol(this,t):Hl(this,s,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(mi),this.material.uniforms.resolution.value.set(mi.z,mi.w))}}class mo extends ho{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,n=new Float32Array(2*t);for(let s=0;s<t;s+=3)n[2*s]=e[s],n[2*s+1]=e[s+1],n[2*s+2]=e[s+2],n[2*s+3]=e[s+3],n[2*s+4]=e[s+4],n[2*s+5]=e[s+5];return super.setPositions(n),this}setColors(e){const t=e.length-3,n=new Float32Array(2*t);for(let s=0;s<t;s+=3)n[2*s]=e[s],n[2*s+1]=e[s+1],n[2*s+2]=e[s+2],n[2*s+3]=e[s+3],n[2*s+4]=e[s+4],n[2*s+5]=e[s+5];return super.setColors(n),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class ql extends jl{constructor(e=new mo,t=new fi({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}class zl extends O{constructor(e){const t=new Kl(e),n=new Tn(t.image.width*.001,t.image.height*.001),s=new It({map:t,toneMapped:!1,transparent:!0});super(n,s);function i(a){s.map.dispatchDOMEvent(a)}this.addEventListener("mousedown",i),this.addEventListener("mousemove",i),this.addEventListener("mouseup",i),this.addEventListener("click",i),this.dispose=function(){n.dispose(),s.dispose(),s.map.dispose(),Ei.delete(e),this.removeEventListener("mousedown",i),this.removeEventListener("mousemove",i),this.removeEventListener("mouseup",i),this.removeEventListener("click",i)}}}class Kl extends Hi{constructor(e){super(bo(e)),this.dom=e,this.anisotropy=16,this.colorSpace=re,this.minFilter=dt,this.magFilter=dt;const t=new MutationObserver(()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout(()=>this.update(),16))}),n={attributes:!0,childList:!0,subtree:!0,characterData:!0};t.observe(e,n),this.observer=t}dispatchDOMEvent(e){e.data&&Yl(this.dom,e.type,e.data.x,e.data.y)}update(){this.image=bo(this.dom),this.needsUpdate=!0,this.scheduleUpdate=null}dispose(){this.observer&&this.observer.disconnect(),this.scheduleUpdate=clearTimeout(this.scheduleUpdate),super.dispose()}}const Ei=new WeakMap;function bo(o){const e=document.createRange(),t=new Be;function n(d){const p=[];let f=!1;function b(){if(f&&(f=!1,d.restore()),p.length===0)return;let u=-1/0,I=-1/0,C=1/0,E=1/0;for(let y=0;y<p.length;y++){const w=p[y];u=Math.max(u,w.x),I=Math.max(I,w.y),C=Math.min(C,w.x+w.width),E=Math.min(E,w.y+w.height)}d.save(),d.beginPath(),d.rect(u,I,C-u,E-I),d.clip(),f=!0}return{add:function(u){p.push(u),b()},remove:function(){p.pop(),b()}}}function s(d,p,f,b){b!==""&&(d.textTransform==="uppercase"&&(b=b.toUpperCase()),l.font=d.fontWeight+" "+d.fontSize+" "+d.fontFamily,l.textBaseline="top",l.fillStyle=d.color,l.fillText(b,p,f+parseFloat(d.fontSize)*.1))}function i(d,p,f,b,u){f<2*u&&(u=f/2),b<2*u&&(u=b/2),l.beginPath(),l.moveTo(d+u,p),l.arcTo(d+f,p,d+f,p+b,u),l.arcTo(d+f,p+b,d,p+b,u),l.arcTo(d,p+b,d,p,u),l.arcTo(d,p,d+f,p,u),l.closePath()}function a(d,p,f,b,u,I){const C=d[p+"Width"],E=d[p+"Style"],y=d[p+"Color"];C!=="0px"&&E!=="none"&&y!=="transparent"&&y!=="rgba(0, 0, 0, 0)"&&(l.strokeStyle=y,l.lineWidth=parseFloat(C),l.beginPath(),l.moveTo(f,b),l.lineTo(f+u,b+I),l.stroke())}function r(d,p){if(d.nodeType===Node.COMMENT_NODE||d.nodeName==="SCRIPT"||d.style&&d.style.display==="none")return;let f=0,b=0,u=0,I=0;if(d.nodeType===Node.TEXT_NODE){e.selectNode(d);const E=e.getBoundingClientRect();f=E.left-A.left-.5,b=E.top-A.top-.5,u=E.width,I=E.height,s(p,f,b,d.nodeValue.trim())}else if(d instanceof HTMLCanvasElement){const E=d.getBoundingClientRect();f=E.left-A.left-.5,b=E.top-A.top-.5,l.save();const y=window.devicePixelRatio;l.scale(1/y,1/y),l.drawImage(d,f,b),l.restore()}else if(d instanceof HTMLImageElement){const E=d.getBoundingClientRect();f=E.left-A.left-.5,b=E.top-A.top-.5,u=E.width,I=E.height,l.drawImage(d,f,b,u,I)}else{const E=d.getBoundingClientRect();f=E.left-A.left-.5,b=E.top-A.top-.5,u=E.width,I=E.height,p=window.getComputedStyle(d),i(f,b,u,I,parseFloat(p.borderRadius));const y=p.backgroundColor;y!=="transparent"&&y!=="rgba(0, 0, 0, 0)"&&(l.fillStyle=y,l.fill());const w=["borderTop","borderLeft","borderBottom","borderRight"];let v=!0,T=null;for(const S of w){if(T!==null&&(v=p[S+"Width"]===p[T+"Width"]&&p[S+"Color"]===p[T+"Color"]&&p[S+"Style"]===p[T+"Style"]),v===!1)break;T=S}if(v===!0){const S=parseFloat(p.borderTopWidth);p.borderTopWidth!=="0px"&&p.borderTopStyle!=="none"&&p.borderTopColor!=="transparent"&&p.borderTopColor!=="rgba(0, 0, 0, 0)"&&(l.strokeStyle=p.borderTopColor,l.lineWidth=S,l.stroke())}else a(p,"borderTop",f,b,u,0),a(p,"borderLeft",f,b,0,I),a(p,"borderBottom",f,b+I,u,0),a(p,"borderRight",f+u,b,0,I);if(d instanceof HTMLInputElement){let S=p.accentColor;(S===void 0||S==="auto")&&(S=p.color),t.set(S);const M=Math.sqrt(.299*t.r**2+.587*t.g**2+.114*t.b**2)<.5?"white":"#111111";if(d.type==="radio"&&(i(f,b,u,I,I),l.fillStyle="white",l.strokeStyle=S,l.lineWidth=1,l.fill(),l.stroke(),d.checked&&(i(f+2,b+2,u-4,I-4,I),l.fillStyle=S,l.strokeStyle=M,l.lineWidth=2,l.fill(),l.stroke())),d.type==="checkbox"&&(i(f,b,u,I,2),l.fillStyle=d.checked?S:"white",l.strokeStyle=d.checked?M:S,l.lineWidth=1,l.stroke(),l.fill(),d.checked)){const j=l.textAlign;l.textAlign="center";const z={color:M,fontFamily:p.fontFamily,fontSize:I+"px",fontWeight:"bold"};s(z,f+u/2,b,"\u2714"),l.textAlign=j}if(d.type==="range"){const[j,z,J]=["min","max","value"].map(Y=>parseFloat(d[Y])),Z=(J-j)/(z-j)*(u-I);i(f,b+I/4,u,I/2,I/4),l.fillStyle=M,l.strokeStyle=S,l.lineWidth=1,l.fill(),l.stroke(),i(f,b+I/4,Z+I/2,I/2,I/4),l.fillStyle=S,l.fill(),i(f+Z,b,I,I,I/2),l.fillStyle=S,l.fill()}(d.type==="color"||d.type==="text"||d.type==="number")&&(h.add({x:f,y:b,width:u,height:I}),s(p,f+parseInt(p.paddingLeft),b+parseInt(p.paddingTop),d.value),h.remove())}}const C=p.overflow==="auto"||p.overflow==="hidden";C&&h.add({x:f,y:b,width:u,height:I});for(let E=0;E<d.childNodes.length;E++)r(d.childNodes[E],p);C&&h.remove()}const A=o.getBoundingClientRect();let c=Ei.get(o);c===void 0&&(c=document.createElement("canvas"),c.width=A.width,c.height=A.height,Ei.set(o,c));const l=c.getContext("2d"),h=new n(l);return l.clearRect(0,0,c.width,c.height),r(o),c}function Yl(o,e,t,n){const s={clientX:t*o.offsetWidth+o.offsetLeft,clientY:n*o.offsetHeight+o.offsetTop,view:o.ownerDocument.defaultView};window.dispatchEvent(new MouseEvent(e,s));const i=o.getBoundingClientRect();t=t*i.width+i.left,n=n*i.height+i.top;function a(r){if(r.nodeType!==Node.TEXT_NODE&&r.nodeType!==Node.COMMENT_NODE){const A=r.getBoundingClientRect();if(t>A.left&&t<A.right&&n>A.top&&n<A.bottom&&(r.dispatchEvent(new MouseEvent(e,s)),r instanceof HTMLInputElement&&r.type==="range"&&(e==="mousedown"||e==="click"))){const[c,l]=["min","max"].map(p=>parseFloat(r[p])),h=A.width,d=(t-A.x)/h;r.value=c+(l-c)*d,r.dispatchEvent(new InputEvent("input",{bubbles:!0}))}for(let c=0;c<r.childNodes.length;c++)a(r.childNodes[c])}}a(o)}const pn=new Fe,ps={type:"",data:pn},Io=new Sn;class Jl extends Xt{listenToPointerEvents(e,t){const n=this,s=new Sn,i=e.domElement;function a(r){r.stopPropagation();const A=e.domElement.getBoundingClientRect();pn.x=(r.clientX-A.left)/A.width*2-1,pn.y=-(r.clientY-A.top)/A.height*2+1,s.setFromCamera(pn,t);const c=s.intersectObjects(n.children,!1);if(c.length>0){const l=c[0],h=l.object,d=l.uv;ps.type=r.type,ps.data.set(d.x,1-d.y),h.dispatchEvent(ps)}}i.addEventListener("pointerdown",a),i.addEventListener("pointerup",a),i.addEventListener("pointermove",a),i.addEventListener("mousedown",a),i.addEventListener("mouseup",a),i.addEventListener("mousemove",a),i.addEventListener("click",a)}listenToXRControllerEvents(e){const t=this,n={move:"mousemove",select:"click",selectstart:"mousedown",selectend:"mouseup"};function s(i){const a=i.target;Io.setFromXRController(a);const r=Io.intersectObjects(t.children,!1);if(r.length>0){const A=r[0],c=A.object,l=A.uv;ps.type=n[i.type],ps.data.set(l.x,1-l.y),c.dispatchEvent(ps)}}e.addEventListener("move",s),e.addEventListener("select",s),e.addEventListener("selectstart",s),e.addEventListener("selectend",s)}}const Gs=new N,Ps=new N,Eo=new Gi;class Vl extends Ks{constructor(e,t=1,n=16711680){const s=new At,i=e.geometry.attributes.normal.count,a=new Te(i*2*3,3);s.setAttribute("position",a),super(s,new kt({color:n,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),Eo.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,n=this.object.geometry;if(n){const s=n.attributes.position,i=n.attributes.normal;let a=0;for(let r=0,A=s.count;r<A;r++)Gs.fromBufferAttribute(s,r).applyMatrix4(e),Ps.fromBufferAttribute(i,r),Ps.applyMatrix3(Eo).normalize().multiplyScalar(this.size).add(Gs),t.setXYZ(a,Gs.x,Gs.y,Gs.z),a=a+1,t.setXYZ(a,Ps.x,Ps.y,Ps.z),a=a+1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}class Wl{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 ki(-1,1,1,-1,0,1);class Xl extends At{constructor(){super(),this.setAttribute("position",new Te([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Te([0,2,0,0,2,0],2))}}new Xl;const ht={node:"node",material:"material",camera:"camera",light:"light"},is="KHR_animation_pointer",Zl={CUBICSPLINE:void 0,LINEAR:Is,STEP:Qn},Co=pt.findNode;let Bo=!1;class $l{constructor(e){this.parser=e,this.name=is,this.animationPointerResolver=null}setAnimationPointerResolver(e){return this.animationPointerResolver=e,this}_patchPropertyBindingFindNode(){Bo||(Bo=!0,pt.findNode=function(e,t){if(t.startsWith(".materials.")){const n=t.substring(11).substring(t.indexOf(".")),s=n.indexOf("."),i=s<0?n:n.substring(0,s);let a=null;return e.traverse(r=>{a!==null||r.type!=="Mesh"&&r.type!=="SkinnedMesh"||r.material&&(r.material.uuid===i||r.material.name===i)&&(a=r.material,a!==null&&(n.endsWith(".map")?a=a.map:n.endsWith(".emissiveMap")&&(a=a.emissiveMap)))}),a}else if(t.startsWith(".nodes.")||t.startsWith(".lights.")||t.startsWith(".cameras.")){const n=t.split(".");let s;for(let i=1;i<n.length;i++){const a=n[i];if(a.length==36)s=e.getObjectByProperty("uuid",a);else if(s&&s[a]){const r=Number.parseInt(a);let A=a;r>=0&&(A=r),s=s[A]}else{const r=e.getObjectByName(a);r&&(s=r)}}if(!s){const i=Co(e,n[2]);return i||console.warn(is+": Property binding not found",t,e,e.name,n),i}return s}return Co(e,t)})}loadAnimationTargetFromChannel(e){const t=e.target,n=t.node!==void 0?t.node:t.id;return this.parser.getDependency("node",n)}loadAnimationTargetFromChannelWithAnimationPointer(e){this._havePatchedPropertyBindings||this._patchPropertyBindingFindNode();const t=e.target,n=t.extensions&&t.extensions[is]&&t.path&&t.path==="pointer";if(!n)return null;let s,i=ht.node,a;if(n){const A=t.extensions[is];let c=A.pointer;if(!c){console.warn("Invalid path",A,t);return}if(c.startsWith("/materials/")?i=ht.material:c.startsWith("/extensions/KHR_lights_punctual/lights/")?i=ht.light:c.startsWith("/cameras/")&&(i=ht.camera),a=this._tryResolveTargetId(c,i),a===null||isNaN(a)){console.warn("Failed resolving animation node id: "+a,c);return}switch(i){case ht.material:const h=("/materials/"+a.toString()+"/").length,d=c.substring(0,h);switch(s=c.substring(h),s){case"pbrMetallicRoughness/baseColorFactor":s="color";break;case"pbrMetallicRoughness/roughnessFactor":s="roughness";break;case"pbrMetallicRoughness/metallicFactor":s="metalness";break;case"emissiveFactor":s="emissive";break;case"alphaCutoff":s="alphaTest";break;case"occlusionTexture/strength":s="aoMapIntensity";break;case"normalTexture/scale":s="normalScale";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/scale":s="map/repeat";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/offset":s="map/offset";break;case"emissiveTexture/extensions/KHR_texture_transform/scale":s="emissiveMap/repeat";break;case"emissiveTexture/extensions/KHR_texture_transform/offset":s="emissiveMap/offset";break;case"extensions/KHR_materials_emissive_strength/emissiveStrength":s="emissiveIntensity";break;case"extensions/KHR_materials_transmission/transmissionFactor":s="transmission";break;case"extensions/KHR_materials_ior/ior":s="ior";break;case"extensions/KHR_materials_volume/thicknessFactor":s="thickness";break;case"extensions/KHR_materials_volume/attenuationColor":s="attenuationColor";break;case"extensions/KHR_materials_volume/attenuationDistance":s="attenuationDistance";break;case"extensions/KHR_materials_iridescence/iridescenceFactor":s="iridescence";break;case"extensions/KHR_materials_iridescence/iridescenceIor":s="iridescenceIOR";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMinimum":s="iridescenceThicknessRange[0]";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMaximum":s="iridescenceThicknessRange[1]";break;case"extensions/KHR_materials_clearcoat/clearcoatFactor":s="clearcoat";break;case"extensions/KHR_materials_clearcoat/clearcoatRoughnessFactor":s="clearcoatRoughness";break;case"extensions/KHR_materials_sheen/sheenColorFactor":s="sheenColor";break;case"extensions/KHR_materials_sheen/sheenRoughnessFactor":s="sheenRoughness";break;case"extensions/KHR_materials_specular/specularFactor":s="specularIntensity";break;case"extensions/KHR_materials_specular/specularColorFactor":s="specularColor";break}c=d+s;break;case ht.node:const p=("/nodes/"+a.toString()+"/").length,f=c.substring(0,p);switch(s=c.substring(p),s){case"translation":s="position";break;case"rotation":s="quaternion";break;case"scale":s="scale";break;case"weights":s="morphTargetInfluences";break}c=f+s;break;case ht.light:const b=("/extensions/KHR_lights_punctual/lights/"+a.toString()+"/").length;switch(s=c.substring(b),s){case"color":break;case"intensity":break;case"spot/innerConeAngle":s="penumbra";break;case"spot/outerConeAngle":s="angle";break;case"range":s="distance";break}c="/lights/"+a.toString()+"/"+s;break;case ht.camera:const u=("/cameras/"+a.toString()+"/").length,I=c.substring(0,u);switch(s=c.substring(u),s){case"perspective/yfov":s="fov";break;case"perspective/znear":case"orthographic/znear":s="near";break;case"perspective/zfar":case"orthographic/zfar":s="far";break;case"perspective/aspect":s="aspect";break;case"orthographic/xmag":s="zoom";break;case"orthographic/ymag":s="zoom";break}c=I+s;break}const l=this.animationPointerResolver;l&&l.resolvePath&&(c=l.resolvePath(c)),t.extensions[is].pointer=c}if(a===null||isNaN(a)){console.warn("Failed resolving animation node id: "+a,t);return}let r;return i===ht.node?r=this.parser.getDependency("node",a):i===ht.material?r=this.parser.getDependency("material",a):i===ht.light?r=this.parser.getDependency("light",a):i===ht.camera?r=this.parser.getDependency("camera",a):console.error("Unhandled type",i),r}createAnimationTracksWithAnimationPointer(e,t,n,s,i){if(!(i.extensions&&i.extensions[is]&&i.path&&i.path==="pointer"))return null;let a=i.extensions[is].pointer;if(!a)return null;const r=[];a=a.replaceAll("/",".");const A=a.split(".");var c=e.name!==void 0&&e.name!==null?e.name:e.uuid;if(A[2]=c,A[3]==="morphTargetInfluences"&&e.type==="Group"){for(const h of e.children)h instanceof Bn&&h.morphTargetInfluences&&(A[3]=h.name,A[4]="morphTargetInfluences",l(this.parser));return r}l(this.parser);function l(h){a=A.join(".");let d;switch(n.itemSize){case 1:d=Vs;break;case 2:case 3:d=Js;break;case 4:a.endsWith(".quaternion")?d=Ws:d=Mr;break}const p=s.interpolation!==void 0?Zl[s.interpolation]:Is;let f=h._getArrayFromAccessor(n);a.endsWith(".fov")&&(f=f.map(u=>u/Math.PI*180));const b=new d(a,t.array,f,p);if(p==="CUBICSPLINE"&&h._createCubicSplineTrackInterpolant(b),r.push(b),a&&n.itemSize===4&&a.startsWith(".materials.")&&a.endsWith(".color")){const u=new Float32Array(f.length/4);for(let C=0,E=f.length/4;C<E;C+=1)u[C]=f[C*4+3];const I=new d(a.replace(".color",".opacity"),t.array,u,p);p==="CUBICSPLINE"&&h._createCubicSplineTrackInterpolant(b),r.push(I)}}return r}_tryResolveTargetId(e,t){let n="";return t==="node"?n=e.substring(7):t==="material"?n=e.substring(11):t==="light"?n=e.substring(39):t==="camera"&&(n=e.substring(9)),n=n.substring(0,n.indexOf("/")),Number.parseInt(n)}loadAnimation(e){const t=this,n=this.parser.json,s=this.parser,i=n.animations[e],a=i.name?i.name:"animation_"+e,r=[],A=[],c=[],l=[],h=[];for(let d=0,p=i.channels.length;d<p;d++){const f=i.channels[d],b=i.samplers[f.sampler],u=f.target,I=i.parameters!==void 0?i.parameters[b.input]:b.input,C=i.parameters!==void 0?i.parameters[b.output]:b.output;let E=t.loadAnimationTargetFromChannelWithAnimationPointer(f);E||(E=t.loadAnimationTargetFromChannel(f)),r.push(E),A.push(s.getDependency("accessor",I)),c.push(s.getDependency("accessor",C)),l.push(b),h.push(u)}return Promise.all([Promise.all(r),Promise.all(A),Promise.all(c),Promise.all(l),Promise.all(h)]).then(function(d){const p=d[0],f=d[1],b=d[2],u=d[3],I=d[4],C=[];for(let E=0,y=p.length;E<y;E++){const w=p[E],v=f[E],T=b[E],S=u[E],M=I[E];if(w===void 0)continue;w.updateMatrix&&(w.updateMatrix(),w.matrixAutoUpdate=!0);let j=t.createAnimationTracksWithAnimationPointer(w,v,T,S,M);if(j||(j=s._createAnimationTracks(w,v,T,S,M)),j)for(let z=0;z<j.length;z++)C.push(j[z])}return new wn(a,void 0,C)})}}const eh=Object.freeze(Object.defineProperty({__proto__:null,GLTFAnimationPointerExtension:$l},Symbol.toStringTag,{value:"Module"}));export{EA as DRACOLoader,Pa as EXRLoader,lc as EXRLoader$1,Ec as FBXLoader,ba as Font,FA as FontLoader,di as GLTFExporter,kn as GLTFLoader,eh as GLTFLoaderAnimationPointer,_r as GroundedSkybox,zl as HTMLMesh,sl as HorizontalBlurShader,Jl as InteractiveGroup,Tt as KTX2Loader,ql as Line2,mo as LineGeometry,fi as LineMaterial,IA as MeshoptDecoder,Gc as OBJLoader,Hc as OrbitControls,Wl as Pass,tl as PositionalAudioHelper,Oa as RGBELoader,hc as RGBELoader$1,Qs as Stats,_A as TextGeometry,UA as TransformControls,va as TransformControlsGizmo,Vl as VertexNormalsHelper,nl as VerticalBlurShader,Ul as XRControllerModelFactory,Pl as XRHandMeshModel,Ur as mergeVertices,$e as nodeFrame,ai as strToU8,cc as zipSync};