@needle-tools/engine 4.12.0-next.de80571 → 4.12.0-next.e42c144
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/components.needle.json +1 -1
- package/dist/generateMeshBVH.worker-iyfPIK6R.js +21 -0
- package/dist/{gltf-progressive-DZrY8VT6.min.js → gltf-progressive-BmSygnAC.min.js} +2 -2
- package/dist/{gltf-progressive-DgYz5BYa.js → gltf-progressive-DnLBuGK5.js} +24 -24
- package/dist/{gltf-progressive-DWcmTMCh.umd.cjs → gltf-progressive-Rs-ojtXy.umd.cjs} +1 -1
- package/dist/{loader.worker-Dip-PthR.js → loader.worker-DWzfDpAl.js} +4 -4
- package/dist/needle-engine.bundle-CW5U4a3u.umd.cjs +1647 -0
- package/dist/needle-engine.bundle-HNQiYV9e.min.js +1647 -0
- package/dist/{needle-engine.bundle-CbrIHiN8.js → needle-engine.bundle-qrrKb_xn.js} +8886 -8598
- package/dist/needle-engine.d.ts +108 -43
- package/dist/needle-engine.js +48 -48
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/{postprocessing-DYDtB188.min.js → postprocessing-B5ksn9-G.min.js} +54 -54
- package/dist/{postprocessing-CMgoN5t5.umd.cjs → postprocessing-DZtb9Nnn.umd.cjs} +81 -81
- package/dist/{postprocessing-BTW9pD_s.js → postprocessing-__7s9wON.js} +450 -441
- package/dist/{three-DfMvBzXi.js → three-BCCkyCA5.js} +1 -7
- package/dist/{three-qj71I7J3.umd.cjs → three-Bf2NBxAw.umd.cjs} +2 -2
- package/dist/{three-B7CT31Bt.min.js → three-W7zWTcfP.min.js} +1 -1
- package/dist/{three-examples-CsW4_6LI.umd.cjs → three-examples-Dho7cuu4.umd.cjs} +4 -4
- package/dist/{three-examples-D1P7eEhn.min.js → three-examples-MsJjauyk.min.js} +10 -10
- package/dist/{three-examples-D1SK93ek.js → three-examples-y2GeYlze.js} +2 -20
- package/dist/{three-mesh-ui-C_uSB5dD.js → three-mesh-ui-3nSSizT4.js} +1 -1
- package/dist/{three-mesh-ui-LQ44s0AL.min.js → three-mesh-ui-CIez6qJQ.min.js} +1 -1
- package/dist/{three-mesh-ui-DpATDXwU.umd.cjs → three-mesh-ui-zsOOA5Pq.umd.cjs} +1 -1
- package/dist/{vendor-D0zoswDa.js → vendor-DMZcbVO1.js} +3707 -3527
- package/dist/vendor-sURMCFSI.min.js +1116 -0
- package/dist/{vendor-UCpFAwt1.umd.cjs → vendor-tyBvnMF-.umd.cjs} +39 -39
- package/lib/engine/codegen/register_types.js +0 -2
- package/lib/engine/codegen/register_types.js.map +1 -1
- package/lib/engine/debug/debug_console.js +403 -1
- package/lib/engine/debug/debug_console.js.map +1 -1
- package/lib/engine/engine_components.js +3 -3
- package/lib/engine/engine_components.js.map +1 -1
- package/lib/engine/engine_context.js +2 -0
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine/engine_input.d.ts +5 -0
- package/lib/engine/engine_input.js +6 -0
- package/lib/engine/engine_input.js.map +1 -1
- package/lib/engine/engine_license.d.ts +18 -0
- package/lib/engine/engine_license.js +115 -18
- package/lib/engine/engine_license.js.map +1 -1
- package/lib/engine/engine_networking.js +5 -5
- package/lib/engine/engine_networking.js.map +1 -1
- package/lib/engine/engine_physics.js.map +1 -1
- package/lib/engine/engine_physics_rapier.js +1 -1
- package/lib/engine/engine_physics_rapier.js.map +1 -1
- package/lib/engine/engine_serialization_builtin_serializer.js +1 -1
- package/lib/engine/engine_serialization_builtin_serializer.js.map +1 -1
- package/lib/engine/engine_utils.d.ts +4 -1
- package/lib/engine/engine_utils.js +28 -4
- package/lib/engine/engine_utils.js.map +1 -1
- package/lib/engine/extensions/extensions.d.ts +29 -7
- package/lib/engine/extensions/extensions.js.map +1 -1
- package/lib/engine/webcomponents/WebXRButtons.js +13 -5
- package/lib/engine/webcomponents/WebXRButtons.js.map +1 -1
- package/lib/engine/webcomponents/needle menu/needle-menu.js +4 -5
- package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.ar-overlay.js +4 -0
- package/lib/engine/webcomponents/needle-engine.ar-overlay.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.js +1 -1
- package/lib/engine/webcomponents/needle-engine.js.map +1 -1
- package/lib/engine/xr/NeedleXRSession.d.ts +1 -1
- package/lib/engine/xr/NeedleXRSession.js +101 -22
- package/lib/engine/xr/NeedleXRSession.js.map +1 -1
- package/lib/engine/xr/TempXRContext.js +12 -2
- package/lib/engine/xr/TempXRContext.js.map +1 -1
- package/lib/engine/xr/usdz.js +6 -2
- package/lib/engine/xr/usdz.js.map +1 -1
- package/lib/engine-components/AlignmentConstraint.d.ts +1 -1
- package/lib/engine-components/AlignmentConstraint.js +1 -1
- package/lib/engine-components/Animation.d.ts +1 -1
- package/lib/engine-components/Animation.js +1 -1
- package/lib/engine-components/Animator.d.ts +1 -1
- package/lib/engine-components/Animator.js +1 -1
- package/lib/engine-components/AudioListener.d.ts +1 -1
- package/lib/engine-components/AudioListener.js +1 -1
- package/lib/engine-components/AudioSource.d.ts +1 -1
- package/lib/engine-components/AudioSource.js +1 -1
- package/lib/engine-components/Camera.d.ts +1 -1
- package/lib/engine-components/Camera.js +5 -2
- package/lib/engine-components/Camera.js.map +1 -1
- package/lib/engine-components/CharacterController.d.ts +6 -2
- package/lib/engine-components/CharacterController.js +6 -2
- package/lib/engine-components/CharacterController.js.map +1 -1
- package/lib/engine-components/Collider.d.ts +1 -1
- package/lib/engine-components/Collider.js.map +1 -1
- package/lib/engine-components/Component.d.ts +2 -1
- package/lib/engine-components/Component.js +3 -2
- package/lib/engine-components/Component.js.map +1 -1
- package/lib/engine-components/DragControls.js +4 -1
- package/lib/engine-components/DragControls.js.map +1 -1
- package/lib/engine-components/Joints.d.ts +14 -0
- package/lib/engine-components/Joints.js +14 -0
- package/lib/engine-components/Joints.js.map +1 -1
- package/lib/engine-components/LookAtConstraint.d.ts +1 -1
- package/lib/engine-components/LookAtConstraint.js +1 -1
- package/lib/engine-components/OrbitControls.d.ts +1 -1
- package/lib/engine-components/OrbitControls.js +1 -1
- package/lib/engine-components/Renderer.d.ts +6 -0
- package/lib/engine-components/Renderer.js +6 -0
- package/lib/engine-components/Renderer.js.map +1 -1
- package/lib/engine-components/RendererInstancing.js +5 -3
- package/lib/engine-components/RendererInstancing.js.map +1 -1
- package/lib/engine-components/SceneSwitcher.js +18 -14
- package/lib/engine-components/SceneSwitcher.js.map +1 -1
- package/lib/engine-components/SpectatorCamera.js +15 -7
- package/lib/engine-components/SpectatorCamera.js.map +1 -1
- package/lib/engine-components/SpriteRenderer.d.ts +2 -1
- package/lib/engine-components/SpriteRenderer.js +2 -1
- package/lib/engine-components/SpriteRenderer.js.map +1 -1
- package/lib/engine-components/api.d.ts +1 -0
- package/lib/engine-components/api.js +1 -0
- package/lib/engine-components/api.js.map +1 -1
- package/lib/engine-components/codegen/components.d.ts +0 -1
- package/lib/engine-components/codegen/components.js +0 -1
- package/lib/engine-components/codegen/components.js.map +1 -1
- package/lib/engine-components/timeline/SignalAsset.d.ts +1 -1
- package/lib/engine-components/timeline/SignalAsset.js +1 -1
- package/lib/engine-components/ui/Raycaster.d.ts +3 -2
- package/lib/engine-components/ui/Raycaster.js +3 -2
- package/lib/engine-components/ui/Raycaster.js.map +1 -1
- package/lib/engine-components/ui/RectTransform.d.ts +6 -0
- package/lib/engine-components/ui/RectTransform.js +6 -0
- package/lib/engine-components/ui/RectTransform.js.map +1 -1
- package/lib/engine-components/utils/LookAt.d.ts +2 -1
- package/lib/engine-components/utils/LookAt.js +2 -1
- package/lib/engine-components/utils/LookAt.js.map +1 -1
- package/lib/engine-components/web/CursorFollow.d.ts +1 -1
- package/lib/engine-components/web/CursorFollow.js +1 -1
- package/lib/engine-components/web/HoverAnimation.d.ts +1 -1
- package/lib/engine-components/web/HoverAnimation.js +1 -1
- package/lib/engine-components/web/ViewBox.d.ts +1 -1
- package/lib/engine-components/web/ViewBox.js +1 -1
- package/lib/engine-components/webxr/Avatar.js +2 -0
- package/lib/engine-components/webxr/Avatar.js.map +1 -1
- package/lib/engine-components/webxr/WebXR.js +18 -12
- package/lib/engine-components/webxr/WebXR.js.map +1 -1
- package/package.json +3 -3
- package/plugins/vite/poster-client.js +8 -1
- package/src/engine/codegen/register_types.ts +0 -2
- package/src/engine/debug/debug_console.ts +449 -1
- package/src/engine/engine_components.ts +4 -4
- package/src/engine/engine_context.ts +2 -0
- package/src/engine/engine_input.ts +7 -0
- package/src/engine/engine_license.ts +128 -17
- package/src/engine/engine_networking.ts +5 -5
- package/src/engine/engine_physics.ts +3 -3
- package/src/engine/engine_physics_rapier.ts +1 -1
- package/src/engine/engine_serialization_builtin_serializer.ts +1 -1
- package/src/engine/engine_utils.ts +23 -4
- package/src/engine/extensions/extensions.ts +30 -6
- package/src/engine/webcomponents/WebXRButtons.ts +15 -5
- package/src/engine/webcomponents/needle menu/needle-menu.ts +4 -5
- package/src/engine/webcomponents/needle-engine.ar-overlay.ts +6 -0
- package/src/engine/webcomponents/needle-engine.ts +2 -2
- package/src/engine/xr/NeedleXRSession.ts +114 -24
- package/src/engine/xr/TempXRContext.ts +12 -2
- package/src/engine/xr/usdz.ts +6 -1
- package/src/engine-components/AlignmentConstraint.ts +1 -1
- package/src/engine-components/Animation.ts +1 -1
- package/src/engine-components/Animator.ts +1 -1
- package/src/engine-components/AudioListener.ts +1 -1
- package/src/engine-components/AudioSource.ts +1 -1
- package/src/engine-components/Camera.ts +5 -2
- package/src/engine-components/CharacterController.ts +6 -2
- package/src/engine-components/Collider.ts +1 -1
- package/src/engine-components/Component.ts +5 -4
- package/src/engine-components/DragControls.ts +5 -1
- package/src/engine-components/Joints.ts +14 -0
- package/src/engine-components/LookAtConstraint.ts +1 -1
- package/src/engine-components/OrbitControls.ts +1 -1
- package/src/engine-components/Renderer.ts +6 -0
- package/src/engine-components/RendererInstancing.ts +6 -3
- package/src/engine-components/SceneSwitcher.ts +17 -17
- package/src/engine-components/SpectatorCamera.ts +21 -10
- package/src/engine-components/SpriteRenderer.ts +2 -1
- package/src/engine-components/api.ts +2 -1
- package/src/engine-components/codegen/components.ts +0 -1
- package/src/engine-components/timeline/SignalAsset.ts +1 -1
- package/src/engine-components/ui/Raycaster.ts +3 -2
- package/src/engine-components/ui/RectTransform.ts +6 -0
- package/src/engine-components/utils/LookAt.ts +2 -1
- package/src/engine-components/web/CursorFollow.ts +1 -1
- package/src/engine-components/web/HoverAnimation.ts +1 -1
- package/src/engine-components/web/ViewBox.ts +1 -1
- package/src/engine-components/webxr/Avatar.ts +4 -0
- package/src/engine-components/webxr/WebXR.ts +19 -11
- package/dist/generateMeshBVH.worker-mO20N_b8.js +0 -21
- package/dist/needle-engine.bundle-BGixCtrn.umd.cjs +0 -1647
- package/dist/needle-engine.bundle-S3PalR7r.min.js +0 -1647
- package/dist/vendor-BKGa4GE0.min.js +0 -1116
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Mesh as O,SphereGeometry as hi,Vector3 as N,MeshBasicMaterial as It,Node as Zo,PerspectiveCamera as Os,NodeFrame as $o,NodeBuilder as er,GLSLNodeParser as tr,ShaderLib as Et,UniformsUtils as gi,UniformsLib as us,normalView as sr,defaultShaderStages as Hs,ShaderChunk as ir,Material as Kt,TrianglesDrawMode as nr,TriangleFanDrawMode as di,TriangleStripDrawMode as xn,Matrix4 as ce,Loader as Tt,LoaderUtils as Jt,FileLoader as dt,MeshPhysicalMaterial as Ct,Vector2 as Le,Color as we,LinearSRGBColorSpace as We,SRGBColorSpace as le,SpotLight as Sn,PointLight as pi,DirectionalLight as Tn,InstancedMesh as ar,Quaternion as ye,InstancedBufferAttribute as or,Object3D as Bt,TextureLoader as ui,ImageBitmapLoader as rr,BufferAttribute as nt,InterleavedBuffer as Ar,LinearMipmapLinearFilter as fs,NearestMipmapLinearFilter as Dn,LinearMipmapNearestFilter as Rn,NearestMipmapNearestFilter as fi,LinearFilter as at,NearestFilter as js,RepeatWrapping as Vt,MirroredRepeatWrapping as Mn,ClampToEdgeWrapping as qs,PointsMaterial as ms,LineBasicMaterial as Dt,MeshStandardMaterial as mi,DoubleSide as bi,PropertyBinding as Rt,BufferGeometry as ct,SkinnedMesh as kn,LineSegments as zs,Line as pt,LineLoop as cr,Points as Ys,Group as Wt,MathUtils as Ce,OrthographicCamera as _n,Skeleton as Fn,AnimationClip as Ln,Bone as Ii,InterpolateDiscrete as Nn,InterpolateLinear as Ei,InterleavedBufferAttribute as Xt,Texture as Ci,VectorKeyframeTrack as Bi,NumberKeyframeTrack as wi,QuaternionKeyframeTrack as yi,ColorManagement as Xe,FrontSide as Un,Interpolant as lr,Box3 as Ks,Sphere as Qi,RGBA_S3TC_DXT1_Format as vi,RGB_PVRTC_4BPPV1_Format as hr,RGB_ETC2_Format as Gn,RGB_ETC1_Format as gr,RGBA_S3TC_DXT5_Format as xi,RGBA_PVRTC_4BPPV1_Format as dr,RGBA_ETC2_EAC_Format as Pn,RGBA_BPTC_Format as Si,RGB_BPTC_UNSIGNED_Format as pr,RGBA_ASTC_4x4_Format as Js,RGBAFormat as Gt,FloatType as ut,HalfFloatType as Ze,UnsignedByteType as ft,CompressedCubeTexture as ur,CompressedArrayTexture as fr,CompressedTexture as bs,NoColorSpace as Vs,RGBA_S3TC_DXT3_Format as On,RGB_S3TC_DXT1_Format as Hn,RGBA_ASTC_6x6_Format as jn,RGBFormat as Ti,RedFormat as as,RGFormat as Is,UnsignedInt101111Type as qn,UnsignedInt5999Type as zn,DataTexture as mr,Data3DTexture as br,ExtrudeGeometry as Ir,ShapePath as Er,Raycaster as Di,CylinderGeometry as $e,BoxGeometry as Ke,Float32BufferAttribute as Me,OctahedronGeometry as Ws,TorusGeometry as Es,Euler as Pt,Controls as Yn,PlaneGeometry as Ri,DataTextureLoader as Kn,DataUtils as os,Vector4 as Mt,Curve as Cr,MeshPhongMaterial as Cs,MeshLambertMaterial as Br,EquirectangularReflectionMapping as wr,AmbientLight as yr,Uint16BufferAttribute as Qr,Matrix3 as Jn,ShapeUtils as vr,DefaultLoadingManager as xr,Ray as Sr,Plane as Tr,MOUSE as rs,TOUCH as As,Spherical as Vn,ShaderMaterial as Wn,Uniform$1 as Dr,Scene as Mi,WebGLRenderer as Rr,CanvasTexture as Xn,REVISION as Mr,Source as kr,InstancedBufferGeometry as _r,InstancedInterleavedBuffer as ki,WireframeGeometry as Fr,Line3 as Lr}from"./three-B7CT31Bt.min.js";class Nr extends O{constructor(e,t,i,s=128){if(t<=0||i<=0||s<=0)throw new Error("GroundedSkybox height, radius, and resolution must be positive.");const n=new hi(i,2*s,s);n.scale(1,1,-1);const a=n.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(n,new It({map:e,depthWrite:!1}))}}class be extends Zo{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 et=new $o;et.camera=new Os;const Zn={LineBasicNodeMaterial:Et.basic,MeshBasicNodeMaterial:Et.basic,PointsNodeMaterial:Et.points,MeshStandardNodeMaterial:Et.standard,MeshPhysicalNodeMaterial:Et.physical,MeshPhongNodeMaterial:Et.phong},Ur={atan2:"atan"},Gr={low:"lowp",medium:"mediump",high:"highp"};function Ot(o){return`#include <${o}>`}function Bs(o){return`${o}Shader`}class Pr extends er{constructor(e,t,i,s=null){super(e,t,new tr,null,s),this.shader=i,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 Ur[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"),Zn[t]!==void 0){const i=Zn[t],s=this.shader;s.vertexShader=i.vertexShader,s.fragmentShader=i.fragmentShader,s.uniforms=gi.merge([i.uniforms,us.lights])}}_parseObject(){const{material:e,renderer:t}=this;this.addSlot("fragment",new be({node:sr,nodeType:"vec3",source:"void main() {",target:"vec3 TransformedNormalView = %RESULT%;",inclusionType:"append"})),t.toneMappingNode&&t.toneMappingNode.isNode===!0&&this.addSlot("fragment",new be({node:e.colorNode,nodeType:"vec4",source:Ot("tonemapping_fragment"),target:""})),e.colorNode&&e.colorNode.isNode&&this.addSlot("fragment",new be({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 be({node:e.opacityNode,nodeType:"float",source:Ot("alphatest_fragment"),target:"diffuseColor.a = %RESULT%;",inclusionType:"append"})),e.normalNode&&e.normalNode.isNode&&this.addSlot("fragment",new be({node:e.normalNode,nodeType:"vec3",source:Ot("normal_fragment_begin"),target:"normal = %RESULT%;",inclusionType:"append"})),e.emissiveNode&&e.emissiveNode.isNode&&this.addSlot("fragment",new be({node:e.emissiveNode,nodeType:"vec3",source:Ot("emissivemap_fragment"),target:"totalEmissiveRadiance = %RESULT%;",inclusionType:"append"})),e.isMeshStandardNodeMaterial&&(e.metalnessNode&&e.metalnessNode.isNode&&this.addSlot("fragment",new be({node:e.metalnessNode,nodeType:"float",source:Ot("metalnessmap_fragment"),target:"metalnessFactor = %RESULT%;",inclusionType:"append"})),e.roughnessNode&&e.roughnessNode.isNode&&this.addSlot("fragment",new be({node:e.roughnessNode,nodeType:"float",source:Ot("roughnessmap_fragment"),target:"roughnessFactor = %RESULT%;",inclusionType:"append"})),e.isMeshPhysicalNodeMaterial&&(e.clearcoatNode&&e.clearcoatNode.isNode?(this.addSlot("fragment",new be({node:e.clearcoatNode,nodeType:"float",source:"material.clearcoat = clearcoat;",target:"material.clearcoat = %RESULT%;"})),e.clearcoatRoughnessNode&&e.clearcoatRoughnessNode.isNode&&this.addSlot("fragment",new be({node:e.clearcoatRoughnessNode,nodeType:"float",source:"material.clearcoatRoughness = clearcoatRoughness;",target:"material.clearcoatRoughness = %RESULT%;"})),e.clearcoatNormalNode&&e.clearcoatNormalNode.isNode&&this.addSlot("fragment",new be({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 be({node:e.sheenNode,nodeType:"vec3",source:"material.sheenColor = sheenColor;",target:"material.sheenColor = %RESULT%;"})),e.sheenRoughnessNode&&e.sheenRoughnessNode.isNode&&this.addSlot("fragment",new be({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 be({node:e.iridescenceNode,nodeType:"float",source:"material.iridescence = iridescence;",target:"material.iridescence = %RESULT%;"})),e.iridescenceIORNode&&e.iridescenceIORNode.isNode&&this.addSlot("fragment",new be({node:e.iridescenceIORNode,nodeType:"float",source:"material.iridescenceIOR = iridescenceIOR;",target:"material.iridescenceIOR = %RESULT%;"})),e.iridescenceThicknessNode&&e.iridescenceThicknessNode.isNode&&this.addSlot("fragment",new be({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 be({node:e.iorNode,nodeType:"float",source:"material.ior = ior;",target:"material.ior = %RESULT%;"})),e.specularColorNode&&e.specularColorNode.isNode&&this.addSlot("fragment",new be({node:e.specularColorNode,nodeType:"vec3",source:"vec3 specularColorFactor = specularColor;",target:"vec3 specularColorFactor = %RESULT%;"})),e.specularIntensityNode&&e.specularIntensityNode.isNode&&this.addSlot("fragment",new be({node:e.specularIntensityNode,nodeType:"float",source:"float specularIntensityFactor = specularIntensity;",target:"float specularIntensityFactor = %RESULT%;"})),e.transmissionNode&&e.transmissionNode.isNode?(this.addSlot("fragment",new be({node:e.transmissionNode,nodeType:"float",source:"material.transmission = transmission;",target:"material.transmission = %RESULT%;"})),e.thicknessNode&&e.thicknessNode.isNode&&this.addSlot("fragment",new be({node:e.thicknessNode,nodeType:"float",source:"material.thickness = thickness;",target:"material.thickness = %RESULT%;"})),e.attenuationDistanceNode&&e.attenuationDistanceNode.isNode&&this.addSlot("fragment",new be({node:e.attenuationDistanceNode,nodeType:"float",source:"material.attenuationDistance = attenuationDistance;",target:"material.attenuationDistance = %RESULT%;"})),e.attenuationColorNode&&e.attenuationColorNode.isNode&&this.addSlot("fragment",new be({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 be({node:e.positionNode,nodeType:"vec3",source:Ot("begin_vertex"),target:"transformed = %RESULT%;",inclusionType:"append"})),e.sizeNode&&e.sizeNode.isNode&&this.addSlot("vertex",new be({node:e.sizeNode,nodeType:"float",source:"gl_PointSize = size;",target:"gl_PointSize = %RESULT%;"}))}generateTexture(e,t,i){return e.isTextureCube?`textureCube( ${t}, ${i} )`:`texture2D( ${t}, ${i} )`}generateTextureLevel(e,t,i,s){return`textureLod( ${t}, ${i}, ${s} )`}buildFunctionCode(e){const t=e.layout,i=this.flowShaderNode(e),s=[];for(const n of t.inputs)s.push(this.getType(n.type)+" "+n.name);return`${this.getType(t.type)} ${t.name}( ${s.join(", ")} ) {
|
|
1
|
+
import{Mesh as O,SphereGeometry as hi,Vector3 as N,MeshBasicMaterial as It,Node as Zo,PerspectiveCamera as Os,NodeFrame as $o,NodeBuilder as er,GLSLNodeParser as tr,ShaderLib as Et,UniformsUtils as gi,UniformsLib as us,normalView as sr,defaultShaderStages as Hs,ShaderChunk as ir,Material as Kt,TrianglesDrawMode as nr,TriangleFanDrawMode as di,TriangleStripDrawMode as xn,Matrix4 as ce,Loader as Tt,LoaderUtils as Jt,FileLoader as dt,MeshPhysicalMaterial as Ct,Vector2 as Le,Color as we,LinearSRGBColorSpace as We,SRGBColorSpace as le,SpotLight as Sn,PointLight as pi,DirectionalLight as Tn,InstancedMesh as ar,Quaternion as ye,InstancedBufferAttribute as or,Object3D as Bt,TextureLoader as ui,ImageBitmapLoader as rr,BufferAttribute as nt,InterleavedBuffer as Ar,LinearMipmapLinearFilter as fs,NearestMipmapLinearFilter as Rn,LinearMipmapNearestFilter as Dn,NearestMipmapNearestFilter as fi,LinearFilter as at,NearestFilter as js,RepeatWrapping as Vt,MirroredRepeatWrapping as Mn,ClampToEdgeWrapping as qs,PointsMaterial as ms,LineBasicMaterial as Rt,MeshStandardMaterial as mi,DoubleSide as bi,PropertyBinding as Dt,BufferGeometry as ct,SkinnedMesh as kn,LineSegments as zs,Line as pt,LineLoop as cr,Points as Ys,Group as Wt,MathUtils as Ce,OrthographicCamera as _n,Skeleton as Fn,AnimationClip as Ln,Bone as Ii,InterpolateDiscrete as Nn,InterpolateLinear as Ei,InterleavedBufferAttribute as Xt,Texture as Ci,VectorKeyframeTrack as Bi,NumberKeyframeTrack as wi,QuaternionKeyframeTrack as yi,ColorManagement as Xe,FrontSide as Un,Interpolant as lr,Box3 as Ks,Sphere as Qi,RGBA_S3TC_DXT1_Format as vi,RGB_PVRTC_4BPPV1_Format as hr,RGB_ETC2_Format as Gn,RGB_ETC1_Format as gr,RGBA_S3TC_DXT5_Format as xi,RGBA_PVRTC_4BPPV1_Format as dr,RGBA_ETC2_EAC_Format as Pn,RGBA_BPTC_Format as Si,RGB_BPTC_UNSIGNED_Format as pr,RGBA_ASTC_4x4_Format as Js,RGBAFormat as Gt,FloatType as ut,HalfFloatType as Ze,UnsignedByteType as ft,CompressedCubeTexture as ur,CompressedArrayTexture as fr,CompressedTexture as bs,NoColorSpace as Vs,RGBA_S3TC_DXT3_Format as On,RGB_S3TC_DXT1_Format as Hn,RGBA_ASTC_6x6_Format as jn,RGBFormat as Ti,RedFormat as as,RGFormat as Is,UnsignedInt101111Type as qn,UnsignedInt5999Type as zn,DataTexture as mr,Data3DTexture as br,ExtrudeGeometry as Ir,ShapePath as Er,Raycaster as Ri,CylinderGeometry as $e,BoxGeometry as Ke,Float32BufferAttribute as Me,OctahedronGeometry as Ws,TorusGeometry as Es,Euler as Pt,Controls as Yn,PlaneGeometry as Di,DataTextureLoader as Kn,DataUtils as os,Vector4 as Mt,Curve as Cr,MeshPhongMaterial as Cs,MeshLambertMaterial as Br,EquirectangularReflectionMapping as wr,AmbientLight as yr,Uint16BufferAttribute as Qr,Matrix3 as Jn,ShapeUtils as vr,DefaultLoadingManager as xr,Ray as Sr,Plane as Tr,MOUSE as rs,TOUCH as As,Spherical as Vn,ShaderMaterial as Wn,Uniform$1 as Rr,Scene as Mi,WebGLRenderer as Dr,CanvasTexture as Xn,REVISION as Mr,Source as kr,InstancedBufferGeometry as _r,InstancedInterleavedBuffer as ki,WireframeGeometry as Fr,Line3 as Lr}from"./three-W7zWTcfP.min.js";class Nr extends O{constructor(e,t,i,s=128){if(t<=0||i<=0||s<=0)throw new Error("GroundedSkybox height, radius, and resolution must be positive.");const n=new hi(i,2*s,s);n.scale(1,1,-1);const a=n.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(n,new It({map:e,depthWrite:!1}))}}class be extends Zo{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 et=new $o;et.camera=new Os;const Zn={LineBasicNodeMaterial:Et.basic,MeshBasicNodeMaterial:Et.basic,PointsNodeMaterial:Et.points,MeshStandardNodeMaterial:Et.standard,MeshPhysicalNodeMaterial:Et.physical,MeshPhongNodeMaterial:Et.phong},Ur={atan2:"atan"},Gr={low:"lowp",medium:"mediump",high:"highp"};function Ot(o){return`#include <${o}>`}function Bs(o){return`${o}Shader`}class Pr extends er{constructor(e,t,i,s=null){super(e,t,new tr,null,s),this.shader=i,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 Ur[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"),Zn[t]!==void 0){const i=Zn[t],s=this.shader;s.vertexShader=i.vertexShader,s.fragmentShader=i.fragmentShader,s.uniforms=gi.merge([i.uniforms,us.lights])}}_parseObject(){const{material:e,renderer:t}=this;this.addSlot("fragment",new be({node:sr,nodeType:"vec3",source:"void main() {",target:"vec3 TransformedNormalView = %RESULT%;",inclusionType:"append"})),t.toneMappingNode&&t.toneMappingNode.isNode===!0&&this.addSlot("fragment",new be({node:e.colorNode,nodeType:"vec4",source:Ot("tonemapping_fragment"),target:""})),e.colorNode&&e.colorNode.isNode&&this.addSlot("fragment",new be({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 be({node:e.opacityNode,nodeType:"float",source:Ot("alphatest_fragment"),target:"diffuseColor.a = %RESULT%;",inclusionType:"append"})),e.normalNode&&e.normalNode.isNode&&this.addSlot("fragment",new be({node:e.normalNode,nodeType:"vec3",source:Ot("normal_fragment_begin"),target:"normal = %RESULT%;",inclusionType:"append"})),e.emissiveNode&&e.emissiveNode.isNode&&this.addSlot("fragment",new be({node:e.emissiveNode,nodeType:"vec3",source:Ot("emissivemap_fragment"),target:"totalEmissiveRadiance = %RESULT%;",inclusionType:"append"})),e.isMeshStandardNodeMaterial&&(e.metalnessNode&&e.metalnessNode.isNode&&this.addSlot("fragment",new be({node:e.metalnessNode,nodeType:"float",source:Ot("metalnessmap_fragment"),target:"metalnessFactor = %RESULT%;",inclusionType:"append"})),e.roughnessNode&&e.roughnessNode.isNode&&this.addSlot("fragment",new be({node:e.roughnessNode,nodeType:"float",source:Ot("roughnessmap_fragment"),target:"roughnessFactor = %RESULT%;",inclusionType:"append"})),e.isMeshPhysicalNodeMaterial&&(e.clearcoatNode&&e.clearcoatNode.isNode?(this.addSlot("fragment",new be({node:e.clearcoatNode,nodeType:"float",source:"material.clearcoat = clearcoat;",target:"material.clearcoat = %RESULT%;"})),e.clearcoatRoughnessNode&&e.clearcoatRoughnessNode.isNode&&this.addSlot("fragment",new be({node:e.clearcoatRoughnessNode,nodeType:"float",source:"material.clearcoatRoughness = clearcoatRoughness;",target:"material.clearcoatRoughness = %RESULT%;"})),e.clearcoatNormalNode&&e.clearcoatNormalNode.isNode&&this.addSlot("fragment",new be({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 be({node:e.sheenNode,nodeType:"vec3",source:"material.sheenColor = sheenColor;",target:"material.sheenColor = %RESULT%;"})),e.sheenRoughnessNode&&e.sheenRoughnessNode.isNode&&this.addSlot("fragment",new be({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 be({node:e.iridescenceNode,nodeType:"float",source:"material.iridescence = iridescence;",target:"material.iridescence = %RESULT%;"})),e.iridescenceIORNode&&e.iridescenceIORNode.isNode&&this.addSlot("fragment",new be({node:e.iridescenceIORNode,nodeType:"float",source:"material.iridescenceIOR = iridescenceIOR;",target:"material.iridescenceIOR = %RESULT%;"})),e.iridescenceThicknessNode&&e.iridescenceThicknessNode.isNode&&this.addSlot("fragment",new be({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 be({node:e.iorNode,nodeType:"float",source:"material.ior = ior;",target:"material.ior = %RESULT%;"})),e.specularColorNode&&e.specularColorNode.isNode&&this.addSlot("fragment",new be({node:e.specularColorNode,nodeType:"vec3",source:"vec3 specularColorFactor = specularColor;",target:"vec3 specularColorFactor = %RESULT%;"})),e.specularIntensityNode&&e.specularIntensityNode.isNode&&this.addSlot("fragment",new be({node:e.specularIntensityNode,nodeType:"float",source:"float specularIntensityFactor = specularIntensity;",target:"float specularIntensityFactor = %RESULT%;"})),e.transmissionNode&&e.transmissionNode.isNode?(this.addSlot("fragment",new be({node:e.transmissionNode,nodeType:"float",source:"material.transmission = transmission;",target:"material.transmission = %RESULT%;"})),e.thicknessNode&&e.thicknessNode.isNode&&this.addSlot("fragment",new be({node:e.thicknessNode,nodeType:"float",source:"material.thickness = thickness;",target:"material.thickness = %RESULT%;"})),e.attenuationDistanceNode&&e.attenuationDistanceNode.isNode&&this.addSlot("fragment",new be({node:e.attenuationDistanceNode,nodeType:"float",source:"material.attenuationDistance = attenuationDistance;",target:"material.attenuationDistance = %RESULT%;"})),e.attenuationColorNode&&e.attenuationColorNode.isNode&&this.addSlot("fragment",new be({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 be({node:e.positionNode,nodeType:"vec3",source:Ot("begin_vertex"),target:"transformed = %RESULT%;",inclusionType:"append"})),e.sizeNode&&e.sizeNode.isNode&&this.addSlot("vertex",new be({node:e.sizeNode,nodeType:"float",source:"gl_PointSize = size;",target:"gl_PointSize = %RESULT%;"}))}generateTexture(e,t,i){return e.isTextureCube?`textureCube( ${t}, ${i} )`:`texture2D( ${t}, ${i} )`}generateTextureLevel(e,t,i,s){return`textureLod( ${t}, ${i}, ${s} )`}buildFunctionCode(e){const t=e.layout,i=this.flowShaderNode(e),s=[];for(const n of t.inputs)s.push(this.getType(n.type)+" "+n.name);return`${this.getType(t.type)} ${t.name}( ${s.join(", ")} ) {
|
|
2
2
|
|
|
3
3
|
${i.vars}
|
|
4
4
|
|
|
@@ -30,19 +30,19 @@ ${r}
|
|
|
30
30
|
${this.shader[Bs(t)]}
|
|
31
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 i of t){const s=Ot(i),n=ir[i],a=Bs(e);this.shader[a]=this.shader[a].replaceAll(s,n)}}_sortSlotsToFlow(){for(const e of Hs){const t=this.shader[Bs(e)],i=this.slots[e].sort((s,n)=>t.indexOf(s.source)>t.indexOf(n.source)?1:-1);for(const s of i)this.addFlow(e,s)}}_addSnippets(){for(const e of Hs){for(const t of this.slots[e]){const i=this.getFlowData(t),s=t.inclusionType,n=t.source,a=i.code+`
|
|
32
32
|
`+t.target.replace("%RESULT%",i.result);s==="append"?this.addCode(e,n,a):s==="replace"?this.replaceCode(e,n,a):console.warn(`Inclusion type "${s}" not compatible.`)}this.addCode(e,"main() {",`
|
|
33
|
-
`+this.flowCode[e])}}_addUniforms(){for(const e of Hs)for(const t of this.uniforms[e])this.shader.uniforms[t.name]=t}_updateUniforms(){et.object=this.object,et.renderer=this.renderer,et.material=this.material,et.scene=this.scene;for(const e of this.updateNodes)et.updateNode(e)}}const $n=new WeakMap;Kt.prototype.onBuild=function(o,e,t){const i=this;if(i.isNodeMaterial===!0){let s;try{s=new Pr(o,t,e,i).build(),$n.set(i,s)}catch(n){console.error("Material.prototype.onBuild: ",n)}}},Kt.prototype.onBeforeRender=function(o,e,t,i,s){const n=$n.get(this);if(n!==void 0){et.material=this,et.camera=t,et.object=s,et.renderer=o,et.scene=e,et.geometry=i;const a=n.updateNodes;if(a.length>0){o.state.useProgram(null);for(const r of a)et.updateNode(r)}}};var ws=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(),i(++o%e.children.length)},!1);function t(l){return e.appendChild(l.dom),l}function i(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(),n=s,a=0,r=t(new ws.Panel("FPS","#0ff","#002")),A=t(new ws.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=t(new ws.Panel("MB","#f08","#201"));return i(0),{REVISION:16,dom:e,addPanel:t,showPanel:i,begin:function(){s=(performance||Date).now()},end:function(){a++;var l=(performance||Date).now();if(A.update(l-s,200),l>=n+1e3&&(r.update(a*1e3/(l-n),100),n=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:i}};ws.Panel=function(o,e,t){var i=1/0,s=0,n=Math.round,a=n(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 m=b.getContext("2d");return m.font="bold "+9*a+"px Helvetica,Arial,sans-serif",m.textBaseline="top",m.fillStyle=t,m.fillRect(0,0,r,A),m.fillStyle=e,m.fillText(o,c,l),m.fillRect(h,d,p,f),m.fillStyle=t,m.globalAlpha=.9,m.fillRect(h,d,p,f),{dom:b,update:function(I,E){i=Math.min(i,I),s=Math.max(s,I),m.fillStyle=t,m.globalAlpha=1,m.fillRect(0,0,r,d),m.fillStyle=e,m.fillText(n(I)+" "+o+" ("+n(i)+"-"+n(s)+")",c,l),m.drawImage(b,h+a,d,p-a,f,h,d,p-a,f),m.fillRect(h+p-a,d,a,f),m.fillStyle=t,m.globalAlpha=.9,m.fillRect(h+p-a,d,a,n((1-I/E)*f))}}};function Or(o,e=1e-4){e=Math.max(e,Number.EPSILON);const t={},i=o.getIndex(),s=o.getAttribute("position"),n=i?i.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 E=0,C=r.length;E<C;E++){const y=r[E],w=o.attributes[y];A[y]=new w.constructor(new w.array.constructor(w.count*w.itemSize),w.itemSize,w.normalized);const x=o.morphAttributes[y];x&&(c[y]||(c[y]=[]),x.forEach((T,S)=>{const _=new T.array.constructor(T.count*T.itemSize);c[y][S]=new T.constructor(_,T.itemSize,T.normalized)}))}const p=e*.5,f=Math.log10(1/e),b=Math.pow(10,f),m=p*b;for(let E=0;E<n;E++){const C=i?i.getX(E):E;let y="";for(let w=0,x=r.length;w<x;w++){const T=r[w],S=o.getAttribute(T),_=S.itemSize;for(let Y=0;Y<_;Y++)y+=`${~~(S[h[Y]](C)*b+m)},`}if(y in t)l.push(t[y]);else{for(let w=0,x=r.length;w<x;w++){const T=r[w],S=o.getAttribute(T),_=o.morphAttributes[T],Y=S.itemSize,V=A[T],K=c[T];for(let W=0;W<Y;W++){const j=h[W],X=d[W];if(V[X](a,S[j](C)),_)for(let J=0,ee=_.length;J<ee;J++)K[J][X](a,_[J][j](C))}}t[y]=a,l.push(a),a++}}const I=o.clone();for(const E in o.attributes){const C=A[E];if(I.setAttribute(E,new C.constructor(C.array.slice(0,a*C.itemSize),C.itemSize,C.normalized)),E in c)for(let y=0;y<c[E].length;y++){const w=c[E][y];I.morphAttributes[E][y]=new w.constructor(w.array.slice(0,a*w.itemSize),w.itemSize,w.normalized)}}return I.setIndex(l),I}function ea(o,e){if(e===nr)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),o;if(e===di||e===xn){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 i=t.count-2,s=[];if(e===di)for(let a=1;a<=i;a++)s.push(t.getX(0)),s.push(t.getX(a)),s.push(t.getX(a+1));else for(let a=0;a<i;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!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const n=o.clone();return n.setIndex(s),n.clearGroups(),n}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),o}class _i extends Tt{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new Yr(t)}),this.register(function(t){return new Kr(t)}),this.register(function(t){return new sA(t)}),this.register(function(t){return new iA(t)}),this.register(function(t){return new nA(t)}),this.register(function(t){return new Vr(t)}),this.register(function(t){return new Wr(t)}),this.register(function(t){return new Xr(t)}),this.register(function(t){return new Zr(t)}),this.register(function(t){return new zr(t)}),this.register(function(t){return new $r(t)}),this.register(function(t){return new Jr(t)}),this.register(function(t){return new tA(t)}),this.register(function(t){return new eA(t)}),this.register(function(t){return new jr(t)}),this.register(function(t){return new aA(t)}),this.register(function(t){return new oA(t)})}load(e,t,i,s){const n=this;let a;if(this.resourcePath!=="")a=this.resourcePath;else if(this.path!==""){const c=Jt.extractUrlBase(e);a=Jt.resolveURL(c,this.path)}else a=Jt.extractUrlBase(e);this.manager.itemStart(e);const r=function(c){s?s(c):console.error(c),n.manager.itemError(e),n.manager.itemEnd(e)},A=new dt(this.manager);A.setPath(this.path),A.setResponseType("arraybuffer"),A.setRequestHeader(this.requestHeader),A.setWithCredentials(this.withCredentials),A.load(e,function(c){try{n.parse(c,a,function(l){t(l),n.manager.itemEnd(e)},r)}catch(l){r(l)}},i,r)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,i,s){let n,a;const r={},A={},c=new TextDecoder;if(typeof e=="string")try{n=JSON.parse(e)}catch(h){a=e,s&&s(h);return}else if(e instanceof ArrayBuffer)if(c.decode(new Uint8Array(e,0,4))===ta){try{r[ne.KHR_BINARY_GLTF]=new rA(e)}catch(h){s&&s(h);return}try{n=JSON.parse(r[ne.KHR_BINARY_GLTF].content)}catch(h){a=r[ne.KHR_BINARY_GLTF].content,s&&s(h);return}}else try{n=JSON.parse(c.decode(e))}catch(h){a=c.decode(e),s&&s(h);return}else n=e;if(n.asset===void 0||n.asset.version[0]<2){s&&s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}this.json=n,this.jsonErrorData=a;const l=new EA(n,{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(n.extensionsUsed)for(let h=0;h<n.extensionsUsed.length;++h){const d=n.extensionsUsed[h],p=n.extensionsRequired||[];switch(d){case ne.KHR_MATERIALS_UNLIT:r[d]=new qr;break;case ne.KHR_DRACO_MESH_COMPRESSION:r[d]=new AA(n,this.dracoLoader);break;case ne.KHR_TEXTURE_TRANSFORM:r[d]=new cA;break;case ne.KHR_MESH_QUANTIZATION:r[d]=new lA;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(i,s)}parseAsync(e,t){const i=this;return new Promise(function(s,n){i.parse(e,t,s,n)})}}function Hr(){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 jr{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 i=0,s=t.length;i<s;i++){const n=t[i];n.extensions&&n.extensions[this.name]&&n.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,n.extensions[this.name].light)}}_loadLight(e){const t=this.parser,i="light:"+e;let s=t.cache.get(i);if(s)return s;const n=t.json,a=((n.extensions&&n.extensions[this.name]||{}).lights||[])[e];let r;const A=new we(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 Tn(A),r.target.position.set(0,0,-1),r.add(r.target);break;case"point":r=new pi(A),r.distance=c;break;case"spot":r=new Sn(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,kt(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(i,s),s}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,i=this.parser,s=i.json.nodes[e],n=(s.extensions&&s.extensions[this.name]||{}).light;return n===void 0?null:this._loadLight(n).then(function(a){return i._getNodeRef(t.cache,n,a)})}}let qr=class{constructor(){this.name=ne.KHR_MATERIALS_UNLIT}getMaterialType(){return It}extendParams(o,e,t){const i=[];o.color=new we(1,1,1),o.opacity=1;const s=e.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const n=s.baseColorFactor;o.color.setRGB(n[0],n[1],n[2],We),o.opacity=n[3]}s.baseColorTexture!==void 0&&i.push(t.assignTexture(o,"map",s.baseColorTexture,le))}return Promise.all(i)}},zr=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 i=t.extensions[this.name].emissiveStrength;return i!==void 0&&(e.emissiveIntensity=i),Promise.resolve()}},Yr=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,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];if(n.clearcoatFactor!==void 0&&(e.clearcoat=n.clearcoatFactor),n.clearcoatTexture!==void 0&&s.push(t.assignTexture(e,"clearcoatMap",n.clearcoatTexture)),n.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=n.clearcoatRoughnessFactor),n.clearcoatRoughnessTexture!==void 0&&s.push(t.assignTexture(e,"clearcoatRoughnessMap",n.clearcoatRoughnessTexture)),n.clearcoatNormalTexture!==void 0&&(s.push(t.assignTexture(e,"clearcoatNormalMap",n.clearcoatNormalTexture)),n.clearcoatNormalTexture.scale!==void 0)){const a=n.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new Le(a,a)}return Promise.all(s)}},Kr=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 i=t.extensions[this.name];return e.dispersion=i.dispersion!==void 0?i.dispersion:0,Promise.resolve()}},Jr=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,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];return n.iridescenceFactor!==void 0&&(e.iridescence=n.iridescenceFactor),n.iridescenceTexture!==void 0&&s.push(t.assignTexture(e,"iridescenceMap",n.iridescenceTexture)),n.iridescenceIor!==void 0&&(e.iridescenceIOR=n.iridescenceIor),e.iridescenceThicknessRange===void 0&&(e.iridescenceThicknessRange=[100,400]),n.iridescenceThicknessMinimum!==void 0&&(e.iridescenceThicknessRange[0]=n.iridescenceThicknessMinimum),n.iridescenceThicknessMaximum!==void 0&&(e.iridescenceThicknessRange[1]=n.iridescenceThicknessMaximum),n.iridescenceThicknessTexture!==void 0&&s.push(t.assignTexture(e,"iridescenceThicknessMap",n.iridescenceThicknessTexture)),Promise.all(s)}},Vr=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,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[];e.sheenColor=new we(0,0,0),e.sheenRoughness=0,e.sheen=1;const n=i.extensions[this.name];if(n.sheenColorFactor!==void 0){const a=n.sheenColorFactor;e.sheenColor.setRGB(a[0],a[1],a[2],We)}return n.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=n.sheenRoughnessFactor),n.sheenColorTexture!==void 0&&s.push(t.assignTexture(e,"sheenColorMap",n.sheenColorTexture,le)),n.sheenRoughnessTexture!==void 0&&s.push(t.assignTexture(e,"sheenRoughnessMap",n.sheenRoughnessTexture)),Promise.all(s)}},Wr=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,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];return n.transmissionFactor!==void 0&&(e.transmission=n.transmissionFactor),n.transmissionTexture!==void 0&&s.push(t.assignTexture(e,"transmissionMap",n.transmissionTexture)),Promise.all(s)}},Xr=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,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];e.thickness=n.thicknessFactor!==void 0?n.thicknessFactor:0,n.thicknessTexture!==void 0&&s.push(t.assignTexture(e,"thicknessMap",n.thicknessTexture)),e.attenuationDistance=n.attenuationDistance||1/0;const a=n.attenuationColor||[1,1,1];return e.attenuationColor=new we().setRGB(a[0],a[1],a[2],We),Promise.all(s)}},Zr=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 i=t.extensions[this.name];return e.ior=i.ior!==void 0?i.ior:1.5,Promise.resolve()}},$r=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,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];e.specularIntensity=n.specularFactor!==void 0?n.specularFactor:1,n.specularTexture!==void 0&&s.push(t.assignTexture(e,"specularIntensityMap",n.specularTexture));const a=n.specularColorFactor||[1,1,1];return e.specularColor=new we().setRGB(a[0],a[1],a[2],We),n.specularColorTexture!==void 0&&s.push(t.assignTexture(e,"specularColorMap",n.specularColorTexture,le)),Promise.all(s)}},eA=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,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];return e.bumpScale=n.bumpFactor!==void 0?n.bumpFactor:1,n.bumpTexture!==void 0&&s.push(t.assignTexture(e,"bumpMap",n.bumpTexture)),Promise.all(s)}},tA=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,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];return n.anisotropyStrength!==void 0&&(e.anisotropy=n.anisotropyStrength),n.anisotropyRotation!==void 0&&(e.anisotropyRotation=n.anisotropyRotation),n.anisotropyTexture!==void 0&&s.push(t.assignTexture(e,"anisotropyMap",n.anisotropyTexture)),Promise.all(s)}};class sA{constructor(e){this.parser=e,this.name=ne.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,i=t.json,s=i.textures[e];if(!s.extensions||!s.extensions[this.name])return null;const n=s.extensions[this.name],a=t.options.ktx2Loader;if(!a){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,n.source,a)}}class iA{constructor(e){this.parser=e,this.name=ne.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,s=i.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;const a=n.extensions[t],r=s.images[a.source];let A=i.textureLoader;if(r.uri){const c=i.options.manager.getHandler(r.uri);c!==null&&(A=c)}return this.detectSupport().then(function(c){if(c)return i.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 i.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 nA{constructor(e){this.parser=e,this.name=ne.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,s=i.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;const a=n.extensions[t],r=s.images[a.source];let A=i.textureLoader;if(r.uri){const c=i.options.manager.getHandler(r.uri);c!==null&&(A=c)}return this.detectSupport().then(function(c){if(c)return i.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 i.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 aA{constructor(e){this.name=ne.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const s=i.extensions[this.name],n=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 n.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 oA=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 i=e.meshes[t.mesh];for(const r of i.primitives)if(r.mode!==lt.TRIANGLES&&r.mode!==lt.TRIANGLE_STRIP&&r.mode!==lt.TRIANGLE_FAN&&r.mode!==void 0)return null;const s=t.extensions[this.name].attributes,n=[],a={};for(const r in s)n.push(this.parser.getDependency("accessor",s[r]).then(A=>(a[r]=A,a[r])));return n.length<1?null:(n.push(this.parser.createNodeMesh(o)),Promise.all(n).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 ce,f=new N,b=new ye,m=new N(1,1,1),I=new ar(d.geometry,d.material,l);for(let E=0;E<l;E++)a.TRANSLATION&&f.fromBufferAttribute(a.TRANSLATION,E),a.ROTATION&&b.fromBufferAttribute(a.ROTATION,E),a.SCALE&&m.fromBufferAttribute(a.SCALE,E),I.setMatrixAt(E,p.compose(f,b,m));for(const E in a)if(E==="_COLOR_0"){const C=a[E];I.instanceColor=new or(C.array,C.itemSize,C.normalized)}else E!=="TRANSLATION"&&E!=="ROTATION"&&E!=="SCALE"&&d.geometry.setAttribute(E,a[E]);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 ta="glTF",ys=12,sa={JSON:1313821514,BIN:5130562};class rA{constructor(e){this.name=ne.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,ys),i=new TextDecoder;if(this.header={magic:i.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==ta)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-ys,n=new DataView(e,ys);let a=0;for(;a<s;){const r=n.getUint32(a,!0);a+=4;const A=n.getUint32(a,!0);if(a+=4,A===sa.JSON){const c=new Uint8Array(e,ys+a,r);this.content=i.decode(c)}else if(A===sa.BIN){const c=ys+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 i=this.json,s=this.dracoLoader,n=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,r={},A={},c={};for(const l in a){const h=Li[l]||l.toLowerCase();r[h]=a[l]}for(const l in e.attributes){const h=Li[l]||l.toLowerCase();if(a[l]!==void 0){const d=i.accessors[e.attributes[l]],p=cs[d.componentType];c[h]=p.name,A[h]=d.normalized===!0}}return t.getDependency("bufferView",n).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],m=A[f];m!==void 0&&(b.normalized=m)}h(p)},r,c,We,d)})})}}class cA{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 lA{constructor(){this.name=ne.KHR_MESH_QUANTIZATION}}class ia extends lr{constructor(e,t,i,s){super(e,t,i,s)}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,s=this.valueSize,n=e*s*3+s;for(let a=0;a!==s;a++)t[a]=i[n+a];return t}interpolate_(e,t,i,s){const n=this.resultBuffer,a=this.sampleValues,r=this.valueSize,A=r*2,c=r*3,l=s-t,h=(i-t)/l,d=h*h,p=d*h,f=e*c,b=f-c,m=-2*p+3*d,I=p-d,E=1-m,C=I-d+h;for(let y=0;y!==r;y++){const w=a[b+y+r],x=a[b+y+A]*l,T=a[f+y+r],S=a[f+y]*l;n[y]=E*w+C*x+m*T+I*S}return n}}const hA=new ye;class gA extends ia{interpolate_(e,t,i,s){const n=super.interpolate_(e,t,i,s);return hA.fromArray(n).normalize().toArray(n),n}}const lt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},cs={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},na={9728:js,9729:at,9984:fi,9985:Rn,9986:Dn,9987:fs},aa={33071:qs,33648:Mn,10497:Vt},Fi={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Li={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"},Ht={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},dA={CUBICSPLINE:void 0,LINEAR:Ei,STEP:Nn},Ni={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function pA(o){return o.DefaultMaterial===void 0&&(o.DefaultMaterial=new mi({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Un})),o.DefaultMaterial}function Zt(o,e,t){for(const i in t.extensions)o[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function kt(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 uA(o,e,t){let i=!1,s=!1,n=!1;for(let c=0,l=e.length;c<l;c++){const h=e[c];if(h.POSITION!==void 0&&(i=!0),h.NORMAL!==void 0&&(s=!0),h.COLOR_0!==void 0&&(n=!0),i&&s&&n)break}if(!i&&!s&&!n)return Promise.resolve(o);const a=[],r=[],A=[];for(let c=0,l=e.length;c<l;c++){const h=e[c];if(i){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(n){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 i&&(o.morphAttributes.position=l),s&&(o.morphAttributes.normal=h),n&&(o.morphAttributes.color=d),o.morphTargetsRelative=!0,o})}function fA(o,e){if(o.updateMorphTargets(),e.weights!==void 0)for(let t=0,i=e.weights.length;t<i;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 i=0,s=t.length;i<s;i++)o.morphTargetDictionary[t[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function mA(o){let e;const t=o.extensions&&o.extensions[ne.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+Ui(t.attributes):e=o.indices+":"+Ui(o.attributes)+":"+o.mode,o.targets!==void 0)for(let i=0,s=o.targets.length;i<s;i++)e+=":"+Ui(o.targets[i]);return e}function Ui(o){let e="";const t=Object.keys(o).sort();for(let i=0,s=t.length;i<s;i++)e+=t[i]+":"+o[t[i]]+";";return e}function Gi(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 bA(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 IA=new ce;class EA{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Hr,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,s=-1,n=!1,a=-1;if(typeof navigator<"u"){const r=navigator.userAgent;i=/^((?!chrome|android).)*safari/i.test(r)===!0;const A=r.match(/Version\/(\d+)/);s=i&&A?parseInt(A[1],10):-1,n=r.indexOf("Firefox")>-1,a=n?r.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&s<17||n&&a<98?this.textureLoader=new ui(this.options.manager):this.textureLoader=new rr(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new dt(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,s=this.json,n=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([i.getDependencies("scene"),i.getDependencies("animation"),i.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:i,userData:{}};return Zt(n,r,s),kt(r,s),Promise.all(i._invokeAll(function(A){return A.afterRoot&&A.afterRoot(r)})).then(function(){for(const A of r.scenes)A.updateMatrixWorld();e(r)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let s=0,n=t.length;s<n;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,n=e.length;s<n;s++){const a=e[s];a.mesh!==void 0&&(this._addNodeRef(this.meshCache,a.mesh),a.skin!==void 0&&(i[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,i){if(e.refs[t]<=1)return i;const s=i.clone(),n=(a,r)=>{const A=this.associations.get(a);A!=null&&this.associations.set(r,A);for(const[c,l]of a.children.entries())n(l,r.children[c])};return n(i,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){const s=e(t[i]);if(s)return s}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const i=[];for(let s=0;s<t.length;s++){const n=e(t[s]);n&&i.push(n)}return i}getDependency(e,t){const i=e+":"+t;let s=this.cache.get(i);if(!s){switch(e){case"scene":s=this.loadScene(t);break;case"node":s=this._invokeOne(function(n){return n.loadNode&&n.loadNode(t)});break;case"mesh":s=this._invokeOne(function(n){return n.loadMesh&&n.loadMesh(t)});break;case"accessor":s=this.loadAccessor(t);break;case"bufferView":s=this._invokeOne(function(n){return n.loadBufferView&&n.loadBufferView(t)});break;case"buffer":s=this.loadBuffer(t);break;case"material":s=this._invokeOne(function(n){return n.loadMaterial&&n.loadMaterial(t)});break;case"texture":s=this._invokeOne(function(n){return n.loadTexture&&n.loadTexture(t)});break;case"skin":s=this.loadSkin(t);break;case"animation":s=this._invokeOne(function(n){return n.loadAnimation&&n.loadAnimation(t)});break;case"camera":s=this.loadCamera(t);break;default:if(s=this._invokeOne(function(n){return n!=this&&n.getDependency&&n.getDependency(e,t)}),!s)throw new Error("Unknown type: "+e);break}this.cache.add(i,s)}return s}getDependencies(e){let t=this.cache.get(e);if(!t){const i=this,s=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(s.map(function(n,a){return i.getDependency(e,a)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],i=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[ne.KHR_BINARY_GLTF].body);const s=this.options;return new Promise(function(n,a){i.load(Jt.resolveURL(t.uri,s.path),n,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(i){const s=t.byteLength||0,n=t.byteOffset||0;return i.slice(n,n+s)})}loadAccessor(e){const t=this,i=this.json,s=this.json.accessors[e];if(s.bufferView===void 0&&s.sparse===void 0){const a=Fi[s.type],r=cs[s.componentType],A=s.normalized===!0,c=new r(s.count*a);return Promise.resolve(new nt(c,a,A))}const n=[];return s.bufferView!==void 0?n.push(this.getDependency("bufferView",s.bufferView)):n.push(null),s.sparse!==void 0&&(n.push(this.getDependency("bufferView",s.sparse.indices.bufferView)),n.push(this.getDependency("bufferView",s.sparse.values.bufferView))),Promise.all(n).then(function(a){const r=a[0],A=Fi[s.type],c=cs[s.componentType],l=c.BYTES_PER_ELEMENT,h=l*A,d=s.byteOffset||0,p=s.bufferView!==void 0?i.bufferViews[s.bufferView].byteStride:void 0,f=s.normalized===!0;let b,m;if(p&&p!==h){const I=Math.floor(d/p),E="InterleavedBuffer:"+s.bufferView+":"+s.componentType+":"+I+":"+s.count;let C=t.cache.get(E);C||(b=new c(r,I*p,s.count*p/l),C=new Ar(b,p/l),t.cache.add(E,C)),m=new Xt(C,A,d%p/l,f)}else r===null?b=new c(s.count*A):b=new c(r,d,s.count*A),m=new nt(b,A,f);if(s.sparse!==void 0){const I=Fi.SCALAR,E=cs[s.sparse.indices.componentType],C=s.sparse.indices.byteOffset||0,y=s.sparse.values.byteOffset||0,w=new E(a[1],C,s.sparse.count*I),x=new c(a[2],y,s.sparse.count*A);r!==null&&(m=new nt(m.array.slice(),m.itemSize,m.normalized)),m.normalized=!1;for(let T=0,S=w.length;T<S;T++){const _=w[T];if(m.setX(_,x[T*A]),A>=2&&m.setY(_,x[T*A+1]),A>=3&&m.setZ(_,x[T*A+2]),A>=4&&m.setW(_,x[T*A+3]),A>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}m.normalized=f}return m})}loadTexture(e){const t=this.json,i=this.options,s=t.textures[e].source,n=t.images[s];let a=this.textureLoader;if(n.uri){const r=i.manager.getHandler(n.uri);r!==null&&(a=r)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,i){const s=this,n=this.json,a=n.textures[e],r=n.images[t],A=(r.uri||r.bufferView)+":"+a.sampler;if(this.textureCache[A])return this.textureCache[A];const c=this.loadImageSource(t,i).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=(n.samplers||{})[a.sampler]||{};return l.magFilter=na[h.magFilter]||at,l.minFilter=na[h.minFilter]||fs,l.wrapS=aa[h.wrapS]||Vt,l.wrapT=aa[h.wrapT]||Vt,l.anisotropy=4,s.associations.set(l,{textures:e}),l}).catch(function(){return null});return this.textureCache[A]=c,c}loadImageSource(e,t){const i=this,s=this.json,n=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=i.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 m=new Ci(b);m.needsUpdate=!0,d(m)}),t.load(Jt.resolveURL(h,n.path),f,void 0,p)})}).then(function(h){return c===!0&&r.revokeObjectURL(A),kt(h,a),h.userData.mimeType=a.mimeType||bA(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,i,s){const n=this;return this.getDependency("texture",i.index).then(function(a){if(!a)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(a=a.clone(),a.channel=i.texCoord),n.extensions[ne.KHR_TEXTURE_TRANSFORM]){const r=i.extensions!==void 0?i.extensions[ne.KHR_TEXTURE_TRANSFORM]:void 0;if(r){const A=n.associations.get(a);a=n.extensions[ne.KHR_TEXTURE_TRANSFORM].extendTexture(a,r),n.associations.set(a,A)}}return s!==void 0&&(a.colorSpace=s),e[t]=a,a})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const s=t.attributes.tangent===void 0,n=t.attributes.color!==void 0,a=t.attributes.normal===void 0;if(e.isPoints){const r="PointsMaterial:"+i.uuid;let A=this.cache.get(r);A||(A=new ms,Kt.prototype.copy.call(A,i),A.color.copy(i.color),A.map=i.map,A.sizeAttenuation=!1,this.cache.add(r,A)),i=A}else if(e.isLine){const r="LineBasicMaterial:"+i.uuid;let A=this.cache.get(r);A||(A=new Dt,Kt.prototype.copy.call(A,i),A.color.copy(i.color),A.map=i.map,this.cache.add(r,A)),i=A}if(s||n||a){let r="ClonedMaterial:"+i.uuid+":";s&&(r+="derivative-tangents:"),n&&(r+="vertex-colors:"),a&&(r+="flat-shading:");let A=this.cache.get(r);A||(A=i.clone(),n&&(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(i))),i=A}e.material=i}getMaterialType(){return mi}loadMaterial(e){const t=this,i=this.json,s=this.extensions,n=i.materials[e];let a;const r={},A=n.extensions||{},c=[];if(A[ne.KHR_MATERIALS_UNLIT]){const h=s[ne.KHR_MATERIALS_UNLIT];a=h.getMaterialType(),c.push(h.extendParams(r,n,t))}else{const h=n.pbrMetallicRoughness||{};if(r.color=new we(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,le)),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)})))}n.doubleSided===!0&&(r.side=bi);const l=n.alphaMode||Ni.OPAQUE;if(l===Ni.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,l===Ni.MASK&&(r.alphaTest=n.alphaCutoff!==void 0?n.alphaCutoff:.5)),n.normalTexture!==void 0&&a!==It&&(c.push(t.assignTexture(r,"normalMap",n.normalTexture)),r.normalScale=new Le(1,1),n.normalTexture.scale!==void 0)){const h=n.normalTexture.scale;r.normalScale.set(h,h)}if(n.occlusionTexture!==void 0&&a!==It&&(c.push(t.assignTexture(r,"aoMap",n.occlusionTexture)),n.occlusionTexture.strength!==void 0&&(r.aoMapIntensity=n.occlusionTexture.strength)),n.emissiveFactor!==void 0&&a!==It){const h=n.emissiveFactor;r.emissive=new we().setRGB(h[0],h[1],h[2],We)}return n.emissiveTexture!==void 0&&a!==It&&c.push(t.assignTexture(r,"emissiveMap",n.emissiveTexture,le)),Promise.all(c).then(function(){const h=new a(r);return n.name&&(h.name=n.name),kt(h,n),t.associations.set(h,{materials:e}),n.extensions&&Zt(s,h,n),h})}createUniqueName(e){const t=Rt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,s=this.primitiveCache;function n(r){return i[ne.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(r,t).then(function(A){return oa(A,r,t)})}const a=[];for(let r=0,A=e.length;r<A;r++){const c=e[r],l=mA(c),h=s[l];if(h)a.push(h.promise);else{let d;c.extensions&&c.extensions[ne.KHR_DRACO_MESH_COMPRESSION]?d=n(c):d=oa(new ct,c,t),s[l]={primitive:c,promise:d},a.push(d)}}return Promise.all(a)}loadMesh(e){const t=this,i=this.json,s=this.extensions,n=i.meshes[e],a=n.primitives,r=[];for(let A=0,c=a.length;A<c;A++){const l=a[A].material===void 0?pA(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],m=a[p];let I;const E=c[p];if(m.mode===lt.TRIANGLES||m.mode===lt.TRIANGLE_STRIP||m.mode===lt.TRIANGLE_FAN||m.mode===void 0)I=n.isSkinnedMesh===!0?new kn(b,E):new O(b,E),I.isSkinnedMesh===!0&&I.normalizeSkinWeights(),m.mode===lt.TRIANGLE_STRIP?I.geometry=ea(I.geometry,xn):m.mode===lt.TRIANGLE_FAN&&(I.geometry=ea(I.geometry,di));else if(m.mode===lt.LINES)I=new zs(b,E);else if(m.mode===lt.LINE_STRIP)I=new pt(b,E);else if(m.mode===lt.LINE_LOOP)I=new cr(b,E);else if(m.mode===lt.POINTS)I=new Ys(b,E);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(I.geometry.morphAttributes).length>0&&fA(I,n),I.name=t.createUniqueName(n.name||"mesh_"+e),kt(I,n),m.extensions&&Zt(s,I,m),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 n.extensions&&Zt(s,h[0],n),h[0];const d=new Wt;n.extensions&&Zt(s,d,n),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 i=this.json.cameras[e],s=i[i.type];if(!s){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?t=new Os(Ce.radToDeg(s.yfov),s.aspectRatio||1,s.znear||1,s.zfar||2e6):i.type==="orthographic"&&(t=new _n(-s.xmag,s.xmag,s.ymag,-s.ymag,s.znear,s.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),kt(t,i),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],i=[];for(let s=0,n=t.joints.length;s<n;s++)i.push(this._loadNodeShallow(t.joints[s]));return t.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",t.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(s){const n=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 ce;n!==null&&d.fromArray(n.array,c*16),A.push(d)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[c])}return new Fn(r,A)})}loadAnimation(e){const t=this.json,i=this,s=t.animations[e],n=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,m=b.node,I=s.parameters!==void 0?s.parameters[f.input]:f.input,E=s.parameters!==void 0?s.parameters[f.output]:f.output;b.node!==void 0&&(a.push(this.getDependency("node",m)),r.push(this.getDependency("accessor",I)),A.push(this.getDependency("accessor",E)),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],m=p[2],I=p[3],E=p[4],C=[];for(h=0,d=f.length;h<d;h++){const y=f[h],w=b[h],x=m[h],T=I[h],S=E[h];if(y===void 0)continue;y.updateMatrix&&y.updateMatrix();const _=i._createAnimationTracks(y,w,x,T,S);if(_)for(let Y=0;Y<_.length;Y++)C.push(_[Y])}return new Ln(n,void 0,C)})}createNodeMesh(e){const t=this.json,i=this,s=t.nodes[e];return s.mesh===void 0?null:i.getDependency("mesh",s.mesh).then(function(n){const a=i._getNodeRef(i.meshCache,s.mesh,n);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,i=this,s=t.nodes[e],n=i._loadNodeShallow(e),a=[],r=s.children||[];for(let c=0,l=r.length;c<l;c++)a.push(i.getDependency("node",r[c]));const A=s.skin===void 0?Promise.resolve(null):i.getDependency("skin",s.skin);return Promise.all([n,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,IA)});for(let p=0,f=h.length;p<f;p++)l.add(h[p]);return l})}_loadNodeShallow(e){const t=this.json,i=this.extensions,s=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const n=t.nodes[e],a=n.name?s.createUniqueName(n.name):"",r=[],A=s._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});return A&&r.push(A),n.camera!==void 0&&r.push(s.getDependency("camera",n.camera).then(function(c){return s._getNodeRef(s.cameraCache,n.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(n.isBone===!0?l=new Ii:c.length>1?l=new Wt: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(n.name&&(l.userData.name=n.name,l.name=a),kt(l,n),n.extensions&&Zt(i,l,n),n.matrix!==void 0){const h=new ce;h.fromArray(n.matrix),l.applyMatrix4(h)}else n.translation!==void 0&&l.position.fromArray(n.translation),n.rotation!==void 0&&l.quaternion.fromArray(n.rotation),n.scale!==void 0&&l.scale.fromArray(n.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,i=this.json.scenes[e],s=this,n=new Wt;i.name&&(n.name=s.createUniqueName(i.name)),kt(n,i),i.extensions&&Zt(t,n,i);const a=i.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++)n.add(A[l]);const c=l=>{const h=new Map;for(const[d,p]of s.associations)(d instanceof Kt||d instanceof Ci)&&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(n),n})}_createAnimationTracks(e,t,i,s,n){const a=[],r=e.name?e.name:e.uuid,A=[];Ht[n.path]===Ht.weights?e.traverse(function(d){d.morphTargetInfluences&&A.push(d.name?d.name:d.uuid)}):A.push(r);let c;switch(Ht[n.path]){case Ht.weights:c=wi;break;case Ht.rotation:c=yi;break;case Ht.position:case Ht.scale:c=Bi;break;default:switch(i.itemSize){case 1:c=wi;break;case 2:case 3:default:c=Bi;break}break}const l=s.interpolation!==void 0?dA[s.interpolation]:Ei,h=this._getArrayFromAccessor(i);for(let d=0,p=A.length;d<p;d++){const f=new c(A[d]+"."+Ht[n.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 i=Gi(t.constructor),s=new Float32Array(t.length);for(let n=0,a=t.length;n<a;n++)s[n]=t[n]*i;t=s}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(t){const i=this instanceof yi?gA:ia;return new i(this.times,this.values,this.getValueSize()/3,t)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function CA(o,e,t){const i=e.attributes,s=new Ks;if(i.POSITION!==void 0){const r=t.json.accessors[i.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=Gi(cs[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 n=e.targets;if(n!==void 0){const r=new N,A=new N;for(let c=0,l=n.length;c<l;c++){const h=n[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=Gi(cs[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 Qi;s.getCenter(a.center),a.radius=s.min.distanceTo(s.max)/2,o.boundingSphere=a}function oa(o,e,t){const i=e.attributes,s=[];function n(a,r){return t.getDependency("accessor",a).then(function(A){o.setAttribute(r,A)})}for(const a in i){const r=Li[a]||a.toLowerCase();r in o.attributes||s.push(n(i[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 i&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Xe.workingColorSpace}" not supported.`),kt(o,e),CA(o,e,t),Promise.all(s).then(function(){return e.targets!==void 0?uA(o,e.targets,t):o})}var BA=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]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var s=WebAssembly.validate(t)?e:o,n,a=WebAssembly.instantiate(r(s),{}).then(function(I){n=I.instance,n.exports.__wasm_call_ctors()});function r(I){for(var E=new Uint8Array(I.length),C=0;C<I.length;++C){var y=I.charCodeAt(C);E[C]=y>96?y-97:y>64?y-39:y+4}for(var w=0,C=0;C<I.length;++C)E[w++]=E[C]<60?i[E[C]]:(E[C]-60)*64+E[++C];return E.buffer.slice(0,w)}function A(I,E,C,y,w,x){var T=n.exports.sbrk,S=C+3&-4,_=T(S*y),Y=T(w.length),V=new Uint8Array(n.exports.memory.buffer);V.set(w,Y);var K=I(_,C,y,Y,w.length);if(K==0&&x&&x(_,S,y),E.set(V.subarray(_,_+C*y)),T(_-T(0)),K!=0)throw new Error("Malformed buffer data: "+K)}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 E={object:new Worker(I),pending:0,requests:{}};return E.object.onmessage=function(C){var y=C.data;E.pending-=y.count,E.requests[y.id][y.action](y.value),delete E.requests[y.id]},E}function f(I){for(var E="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()+m.toString(),C=new Blob([E],{type:"text/javascript"}),y=URL.createObjectURL(C),w=0;w<I;++w)h[w]=p(y);URL.revokeObjectURL(y)}function b(I,E,C,y,w){for(var x=h[0],T=1;T<h.length;++T)h[T].pending<x.pending&&(x=h[T]);return new Promise(function(S,_){var Y=new Uint8Array(C),V=d++;x.pending+=I,x.requests[V]={resolve:S,reject:_},x.object.postMessage({id:V,count:I,size:E,source:Y,mode:y,filter:w},[Y.buffer])})}function m(I){a.then(function(){var E=I.data;try{var C=new Uint8Array(E.count*E.size);A(n.exports[E.mode],C,E.count,E.size,E.source,n.exports[E.filter]),self.postMessage({id:E.id,count:E.count,action:"resolve",value:C},[C.buffer])}catch(y){self.postMessage({id:E.id,count:E.count,action:"reject",value:y})}})}return{ready:a,supported:!0,useWorkers:function(I){f(I)},decodeVertexBuffer:function(I,E,C,y,w){A(n.exports.meshopt_decodeVertexBuffer,I,E,C,y,n.exports[c[w]])},decodeIndexBuffer:function(I,E,C,y){A(n.exports.meshopt_decodeIndexBuffer,I,E,C,y)},decodeIndexSequence:function(I,E,C,y){A(n.exports.meshopt_decodeIndexSequence,I,E,C,y)},decodeGltfBuffer:function(I,E,C,y,w,x){A(n.exports[l[w]],I,E,C,y,n.exports[c[x]])},decodeGltfBufferAsync:function(I,E,C,y,w){return h.length>0?b(I,E,C,l[y],c[w]):a.then(function(){var x=new Uint8Array(I*E);return A(n.exports[l[y]],x,I,E,C,n.exports[c[w]]),x})}}}();const Pi=new WeakMap;class wA extends Tt{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,i,s){const n=new dt(this.manager);n.setPath(this.path),n.setResponseType("arraybuffer"),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials),n.load(e,a=>{this.parse(a,t,s)},i,s)}parse(e,t,i=()=>{}){this.decodeDracoFile(e,t,null,null,le,i).catch(i)}decodeDracoFile(e,t,i,s,n=We,a=()=>{}){const r={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!i,vertexColorSpace:n};return this.decodeGeometry(e,r).then(t).catch(a)}decodeGeometry(e,t){const i=JSON.stringify(t);if(Pi.has(e)){const A=Pi.get(e);if(A.key===i)return A.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let s;const n=this.workerNextTaskID++,a=e.byteLength,r=this._getWorker(n,a).then(A=>(s=A,new Promise((c,l)=>{s._callbacks[n]={resolve:c,reject:l},s.postMessage({type:"decode",id:n,taskConfig:t,buffer:e},[e])}))).then(A=>this._createGeometry(A.geometry));return r.catch(()=>!0).then(()=>{s&&n&&this._releaseTask(s,n)}),Pi.set(e,{key:i,promise:r}),r}_createGeometry(e){const t=new ct;e.index&&t.setIndex(new nt(e.index.array,1));for(let i=0;i<e.attributes.length;i++){const s=e.attributes[i],n=s.name,a=s.array,r=s.itemSize,A=new nt(a,r);n==="color"&&(this._assignVertexColorSpace(A,s.vertexColorSpace),A.normalized=!(a instanceof Float32Array)),t.setAttribute(n,A)}return t}_assignVertexColorSpace(e,t){if(t!==le)return;const i=new we;for(let s=0,n=e.count;s<n;s++)i.fromBufferAttribute(e,s),Xe.toWorkingColorSpace(i,le),e.setXYZ(s,i.r,i.g,i.b)}_loadLibrary(e,t){const i=new dt(this.manager);return i.setPath(this.decoderPath),i.setResponseType(t),i.setWithCredentials(this.withCredentials),new Promise((s,n)=>{i.load(e,s,void 0,n)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(i=>{const s=i[0];e||(this.decoderConfig.wasmBinary=i[1]);const n=yA.toString(),a=["/* draco decoder */",s,"","/* worker */",n.substring(n.indexOf("{")+1,n.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(n){const a=n.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,n){return s._taskLoad>n._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function yA(){let 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 m in l){const I=self[h[m]];let E,C;if(c.useUniqueIDs)C=l[m],E=r.GetAttributeByUniqueId(d,C);else{if(C=r.GetAttributeId(d,a[l[m]]),C===-1)continue;E=r.GetAttribute(d,C)}const y=s(a,r,d,m,I,E);m==="color"&&(y.vertexColorSpace=c.vertexColorSpace),b.attributes.push(y)}return f===a.TRIANGULAR_MESH&&(b.index=i(a,r,d)),a.destroy(d),b}function i(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=n(a,l),m=a._malloc(f);r.GetAttributeDataArrayForAllPoints(A,h,b,f,m);const I=new l(a.HEAPF32.buffer,m,p).slice();return a._free(m),{name:c,array:I,itemSize:d}}function n(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 QA{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 i=this.workersResolve[e];if(i&&i(t),this.queue.length){const{resolve:s,msg:n,transfer:a}=this.queue.shift();this.workersResolve[e]=s,this.workers[e].postMessage(n,a)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(i=>{const s=this._getIdleWorker();s!==-1?(this._initWorker(s),this.workerStatus|=1<<s,this.workersResolve[s]=i,this.workers[s].postMessage(e,t)):this.queue.push({resolve:i,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const vA=0,ra=2,xA=1,Aa=2,SA=0,TA=1,DA=10,RA=0,ca=9,la=15,ha=16,ga=22,da=37,pa=43,ua=76,fa=83,ma=97,ba=100,Ia=103,Ea=109,Ca=122,Ba=123,MA=131,kA=132,_A=133,FA=134,LA=137,NA=138,UA=141,GA=142,PA=145,OA=146,wa=148,ya=152,HA=157,jA=158,Qa=165,va=166,Oi=1000066e3;class Qs{constructor(e,t,i,s){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,i),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=0){const i=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+i,s)}}const Je=[171,75,84,88,32,50,48,187,13,10,26,10];function xa(o){return new TextDecoder().decode(o)}function qA(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={vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,levelCount:0,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null},i=17*Uint32Array.BYTES_PER_ELEMENT,s=new Qs(o,Je.length,i,!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(),t.levelCount=s._nextUint32(),t.supercompressionScheme=s._nextUint32();const n=s._nextUint32(),a=s._nextUint32(),r=s._nextUint32(),A=s._nextUint32(),c=s._nextUint64(),l=s._nextUint64(),h=3*Math.max(t.levelCount,1)*8,d=new Qs(o,Je.length+i,h,!0);for(let se=0,oe=Math.max(t.levelCount,1);se<oe;se++)t.levels.push({levelData:new Uint8Array(o.buffer,o.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});const p=new Qs(o,n,a,!0);p._skip(4);const f=p._nextUint16(),b=p._nextUint16(),m=p._nextUint16(),I=p._nextUint16(),E={vendorId:f,descriptorType:b,versionNumber:m,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:[]},C=(I/4-6)/4;for(let se=0;se<C;se++){const oe={bitOffset:p._nextUint16(),bitLength:p._nextUint8(),channelType:p._nextUint8(),samplePosition:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};64&oe.channelType?(oe.sampleLower=p._nextInt32(),oe.sampleUpper=p._nextInt32()):(oe.sampleLower=p._nextUint32(),oe.sampleUpper=p._nextUint32()),E.samples[se]=oe}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(E);const y=new Qs(o,r,A,!0);for(;y._offset<A;){const se=y._nextUint32(),oe=y._scan(se),Ae=xa(oe);if(t.keyValue[Ae]=y._nextUint8Array(se-oe.byteLength-1),Ae.match(/^ktx/i)){const Te=xa(t.keyValue[Ae]);t.keyValue[Ae]=Te.substring(0,Te.lastIndexOf("\0"))}y._skip(se%4?4-se%4:0)}if(l<=0)return t;const w=new Qs(o,c,l,!0),x=w._nextUint16(),T=w._nextUint16(),S=w._nextUint32(),_=w._nextUint32(),Y=w._nextUint32(),V=w._nextUint32(),K=[];for(let se=0,oe=Math.max(t.levelCount,1);se<oe;se++)K.push({imageFlags:w._nextUint32(),rgbSliceByteOffset:w._nextUint32(),rgbSliceByteLength:w._nextUint32(),alphaSliceByteOffset:w._nextUint32(),alphaSliceByteLength:w._nextUint32()});const W=c+w._offset,j=W+S,X=j+_,J=X+Y,ee=new Uint8Array(o.buffer,o.byteOffset+W,S),$=new Uint8Array(o.buffer,o.byteOffset+j,_),ue=new Uint8Array(o.buffer,o.byteOffset+X,Y),De=new Uint8Array(o.buffer,o.byteOffset+J,V);return t.globalData={endpointCount:x,selectorCount:T,imageDescs:K,endpointsData:ee,selectorsData:$,tablesData:ue,extendedData:De},t}let Hi,_t,ji;const qi={env:{emscripten_notify_memory_growth:function(o){ji=new Uint8Array(_t.exports.memory.buffer)}}};class zA{init(){return Hi||(Hi=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Sa).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,qi)).then(this._init):WebAssembly.instantiate(Buffer.from(Sa,"base64"),qi).then(this._init),Hi)}_init(e){_t=e.instance,qi.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!_t)throw new Error("ZSTDDecoder: Await .init() before decoding.");const i=e.byteLength,s=_t.exports.malloc(i);ji.set(e,s),t=t||Number(_t.exports.ZSTD_findDecompressedSize(s,i));const n=_t.exports.malloc(t),a=_t.exports.ZSTD_decompress(n,t,s,i),r=ji.slice(n,n+a);return _t.exports.free(s),_t.exports.free(n),r}}const Sa="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9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S0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACA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AIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLy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iEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQ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3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/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",YA="display-p3",KA="display-p3-linear",zi=new WeakMap;let Yi=0,Ki;class gt extends Tt{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new QA,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return this.workerConfig={astcSupported:await e.hasFeatureAsync("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:await e.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await e.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await e.hasFeatureAsync("texture-compression-bc"),bptcSupported:await e.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await e.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:e.hasFeature("texture-compression-bptc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),astcHDRSupported:e.extensions.has("WEBGL_compressed_texture_astc")&&e.extensions.get("WEBGL_compressed_texture_astc").getSupportedProfiles().includes("hdr"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this}init(){if(!this.transcoderPending){const e=new dt(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),i=new dt(this.manager);i.setPath(this.transcoderPath),i.setResponseType("arraybuffer"),i.setWithCredentials(this.withCredentials);const s=i.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,s]).then(([n,a])=>{const r=gt.BasisWorker.toString(),A=["/* constants */","let _EngineFormat = "+JSON.stringify(gt.EngineFormat),"let _EngineType = "+JSON.stringify(gt.EngineType),"let _TranscoderFormat = "+JSON.stringify(gt.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(gt.BasisFormat),"/* basis_transcoder.js */",n,"/* 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})}),Yi>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Yi++}return this.transcoderPending}load(e,t,i,s){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const n=new dt(this.manager);n.setPath(this.path),n.setCrossOrigin(this.crossOrigin),n.setWithCredentials(this.withCredentials),n.setResponseType("arraybuffer"),n.load(e,a=>{this.parse(a,t,s)},i,s)}parse(e,t,i){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(zi.has(e))return zi.get(e).promise.then(t).catch(i);this._createTexture(e).then(s=>t?t(s):null).catch(i)}_createTextureFrom(e,t){const{type:i,error:s,data:{faces:n,width:a,height:r,format:A,type:c,dfdFlags:l}}=e;if(i==="error")return Promise.reject(s);let h;if(t.faceCount===6)h=new ur(n,A,c);else{const d=n[0].mipmaps;h=t.layerCount>1?new fr(d,a,r,t.layerCount,A,c):new bs(d,a,r,A,c)}return h.minFilter=n[0].mipmaps.length===1?at:fs,h.magFilter=at,h.generateMipmaps=!1,h.needsUpdate=!0,h.colorSpace=Ta(t),h.premultiplyAlpha=!!(l&xA),h}async _createTexture(e,t={}){const i=qA(new Uint8Array(e)),s=i.vkFormat===Oi&&i.dataFormatDescriptor[0].colorModel===167;if(!(i.vkFormat===RA||s&&!this.workerConfig.astcHDRSupported))return VA(i);const n=t,a=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:n},[e])).then(r=>this._createTextureFrom(r.data,i));return zi.set(e,{promise:a}),a}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Yi--}}gt.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2},gt.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16,BC6H:22,RGB_HALF:24,RGBA_HALF:25},gt.EngineFormat={RGBAFormat:Gt,RGBA_ASTC_4x4_Format:Js,RGB_BPTC_UNSIGNED_Format:pr,RGBA_BPTC_Format:Si,RGBA_ETC2_EAC_Format:Pn,RGBA_PVRTC_4BPPV1_Format:dr,RGBA_S3TC_DXT5_Format:xi,RGB_ETC1_Format:gr,RGB_ETC2_Format:Gn,RGB_PVRTC_4BPPV1_Format:hr,RGBA_S3TC_DXT1_Format:vi},gt.EngineType={UnsignedByteType:ft,HalfFloatType:Ze,FloatType:ut},gt.BasisWorker=function(){let o,e,t;const i=_EngineFormat,s=_EngineType,n=_TranscoderFormat,a=_BasisFormat;self.addEventListener("message",function(f){const b=f.data;switch(b.type){case"init":o=b.config,r(b.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:m,buffers:I,width:E,height:C,hasAlpha:y,format:w,type:x,dfdFlags:T}=A(b.buffer);self.postMessage({type:"transcode",id:b.id,data:{faces:m,width:E,height:C,hasAlpha:y,format:w,type:x,dfdFlags:T}},I)}catch(m){console.error(m),self.postMessage({type:"error",id:b.id,error:m.message})}});break}});function r(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 A(f){const b=new t.KTX2File(new Uint8Array(f));function m(){b.close(),b.delete()}if(!b.isValid())throw m(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let I;if(b.isUASTC())I=a.UASTC;else if(b.isETC1S())I=a.ETC1S;else if(b.isHDR())I=a.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const E=b.getWidth(),C=b.getHeight(),y=b.getLayers()||1,w=b.getLevels(),x=b.getFaces(),T=b.getHasAlpha(),S=b.getDFDFlags(),{transcoderFormat:_,engineFormat:Y,engineType:V}=h(I,E,C,T);if(!E||!C||!w)throw m(),new Error("THREE.KTX2Loader: Invalid texture");if(!b.startTranscoding())throw m(),new Error("THREE.KTX2Loader: .startTranscoding failed");const K=[],W=[];for(let j=0;j<x;j++){const X=[];for(let J=0;J<w;J++){const ee=[];let $,ue;for(let se=0;se<y;se++){const oe=b.getImageLevelInfo(J,se,j);j===0&&J===0&&se===0&&(oe.origWidth%4!==0||oe.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),w>1?($=oe.origWidth,ue=oe.origHeight):($=oe.width,ue=oe.height);let Ae=new Uint8Array(b.getImageTranscodedSizeInBytes(J,se,0,_));const Te=b.transcodeImage(Ae,J,se,j,_,0,-1,-1);if(V===s.HalfFloatType&&(Ae=new Uint16Array(Ae.buffer,Ae.byteOffset,Ae.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!Te)throw m(),new Error("THREE.KTX2Loader: .transcodeImage failed.");ee.push(Ae)}const De=p(ee);X.push({data:De,width:$,height:ue}),W.push(De.buffer)}K.push({mipmaps:X,width:E,height:C,format:Y,type:V})}return m(),{faces:K,buffers:W,width:E,height:C,hasAlpha:T,dfdFlags:S,format:Y,type:V}}const c=[{if:"astcSupported",basisFormat:[a.UASTC],transcoderFormat:[n.ASTC_4x4,n.ASTC_4x4],engineFormat:[i.RGBA_ASTC_4x4_Format,i.RGBA_ASTC_4x4_Format],engineType:[s.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.BC7_M5,n.BC7_M5],engineFormat:[i.RGBA_BPTC_Format,i.RGBA_BPTC_Format],engineType:[s.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.BC1,n.BC3],engineFormat:[i.RGBA_S3TC_DXT1_Format,i.RGBA_S3TC_DXT5_Format],engineType:[s.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.ETC1,n.ETC2],engineFormat:[i.RGB_ETC2_Format,i.RGBA_ETC2_EAC_Format],engineType:[s.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.ETC1],engineFormat:[i.RGB_ETC1_Format],engineType:[s.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.PVRTC1_4_RGB,n.PVRTC1_4_RGBA],engineFormat:[i.RGB_PVRTC_4BPPV1_Format,i.RGBA_PVRTC_4BPPV1_Format],engineType:[s.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[a.UASTC_HDR],transcoderFormat:[n.BC6H],engineFormat:[i.RGB_BPTC_UNSIGNED_Format],engineType:[s.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.RGBA32,n.RGBA32],engineFormat:[i.RGBAFormat,i.RGBAFormat],engineType:[s.UnsignedByteType,s.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[a.UASTC_HDR],transcoderFormat:[n.RGBA_HALF],engineFormat:[i.RGBAFormat],engineType:[s.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],l={[a.ETC1S]:c.filter(f=>f.basisFormat.includes(a.ETC1S)).sort((f,b)=>f.priorityUASTC-b.priorityUASTC),[a.UASTC]:c.filter(f=>f.basisFormat.includes(a.UASTC)).sort((f,b)=>f.priorityUASTC-b.priorityUASTC),[a.UASTC_HDR]:c.filter(f=>f.basisFormat.includes(a.UASTC_HDR)).sort((f,b)=>f.priorityHDR-b.priorityHDR)};function h(f,b,m,I){const E=l[f];for(let C=0;C<E.length;C++){const y=E[C];if(y.if&&!o[y.if]||!y.basisFormat.includes(f)||I&&y.transcoderFormat.length<2||y.needsPowerOfTwo&&!(d(b)&&d(m)))continue;const w=y.transcoderFormat[I?1:0],x=y.engineFormat[I?1:0],T=y.engineType[0];return{transcoderFormat:w,engineFormat:x,engineType:T}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}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 E=0;E<f.length;E++){const C=f[E];b+=C.byteLength}const m=new Uint8Array(b);let I=0;for(let E=0;E<f.length;E++){const C=f[E];m.set(C,I),I+=C.byteLength}return m}};const JA=new Set([Gt,Ti,Is,as]),Ji={[Ea]:Gt,[ma]:Gt,[da]:Gt,[pa]:Gt,[Ia]:Is,[fa]:Is,[ha]:Is,[ga]:Is,[ba]:as,[ua]:as,[la]:as,[ca]:as,[Ba]:Ti,[Ca]:Ti,[wa]:Gn,[ya]:Pn,[Oi]:Js,[jA]:Js,[HA]:Js,[va]:jn,[Qa]:jn,[_A]:vi,[FA]:vi,[MA]:Hn,[kA]:Hn,[NA]:On,[LA]:On,[GA]:xi,[UA]:xi,[OA]:Si,[PA]:Si},vs={[Ea]:ut,[ma]:Ze,[da]:ft,[pa]:ft,[Ia]:ut,[fa]:Ze,[ha]:ft,[ga]:ft,[ba]:ut,[ua]:Ze,[la]:ft,[ca]:ft,[Ba]:zn,[Ca]:qn,[wa]:ft,[ya]:ft,[Oi]:Ze,[va]:ft,[Qa]:ft};async function VA(o){const{vkFormat:e}=o;if(Ji[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;o.supercompressionScheme===ra&&(Ki||(Ki=new Promise(async a=>{const r=new zA;await r.init(),a(r)})),t=await Ki);const i=[];for(let a=0;a<o.levels.length;a++){const r=Math.max(1,o.pixelWidth>>a),A=Math.max(1,o.pixelHeight>>a),c=o.pixelDepth?Math.max(1,o.pixelDepth>>a):0,l=o.levels[a];let h;if(o.supercompressionScheme===vA)h=l.levelData;else if(o.supercompressionScheme===ra)h=t.decode(l.levelData,l.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let d;vs[e]===ut?d=new Float32Array(h.buffer,h.byteOffset,h.byteLength/Float32Array.BYTES_PER_ELEMENT):vs[e]===Ze?d=new Uint16Array(h.buffer,h.byteOffset,h.byteLength/Uint16Array.BYTES_PER_ELEMENT):vs[e]===zn||vs[e]===qn?d=new Uint32Array(h.buffer,h.byteOffset,h.byteLength/Uint32Array.BYTES_PER_ELEMENT):d=h,i.push({data:d,width:r,height:A,depth:c})}const s=o.levelCount===0||i.length>1;let n;if(JA.has(Ji[e]))n=o.pixelDepth===0?new mr(i[0].data,o.pixelWidth,o.pixelHeight):new br(i[0].data,o.pixelWidth,o.pixelHeight,o.pixelDepth),n.minFilter=s?fi:js,n.magFilter=js,n.generateMipmaps=o.levelCount===0;else{if(o.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");n=new bs(i,o.pixelWidth,o.pixelHeight),n.minFilter=s?fs:at,n.magFilter=at}return n.mipmaps=i,n.type=vs[e],n.format=Ji[e],n.colorSpace=Ta(o),n.needsUpdate=!0,Promise.resolve(n)}function Ta(o){const e=o.dataFormatDescriptor[0];return e.colorPrimaries===TA?e.transferFunction===Aa?le:We:e.colorPrimaries===DA?e.transferFunction===Aa?YA:KA:e.colorPrimaries===SA?Vs:(console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),Vs)}class WA extends Ir{constructor(e,t={}){const i=t.font;if(i===void 0)super();else{const s=i.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 XA extends Tt{constructor(e){super(e)}load(e,t,i,s){const n=this,a=new dt(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(r){const A=n.parse(JSON.parse(r));t&&t(A)},i,s)}parse(e){return new Da(e)}}class Da{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100){const i=[],s=ZA(e,t,this.data);for(let n=0,a=s.length;n<a;n++)i.push(...s[n].toShapes());return i}}function ZA(o,e,t){const i=Array.from(o),s=e/t.resolution,n=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*s,a=[];let r=0,A=0;for(let c=0;c<i.length;c++){const l=i[c];if(l===`
|
|
36
|
-
`)r=0,A-=n;else{const h=$A(l,s,r,A,t);r+=h.offsetX,a.push(h.path)}}return a}function $A(o,e,t,i,s){const n=s.glyphs[o]||s.glyphs["?"];if(!n){console.error('THREE.Font: character "'+o+'" does not exists in font family '+s.familyName+".");return}const a=new Er;let r,A,c,l,h,d,p,f;if(n.o){const b=n._cachedOutline||(n._cachedOutline=n.o.split(" "));for(let m=0,I=b.length;m<I;)switch(b[m++]){case"m":r=b[m++]*e+t,A=b[m++]*e+i,a.moveTo(r,A);break;case"l":r=b[m++]*e+t,A=b[m++]*e+i,a.lineTo(r,A);break;case"q":c=b[m++]*e+t,l=b[m++]*e+i,h=b[m++]*e+t,d=b[m++]*e+i,a.quadraticCurveTo(h,d,c,l);break;case"b":c=b[m++]*e+t,l=b[m++]*e+i,h=b[m++]*e+t,d=b[m++]*e+i,p=b[m++]*e+t,f=b[m++]*e+i,a.bezierCurveTo(h,d,p,f,c,l);break}}return{offsetX:n.ha*e,path:a}}const $t=new Di,qe=new N,jt=new N,Be=new ye,Ra={X:new N(1,0,0),Y:new N(0,1,0),Z:new N(0,0,1)},Vi={type:"change"},Ma={type:"mouseDown",mode:null},ka={type:"mouseUp",mode:null},_a={type:"objectChange"};class ec extends Yn{constructor(e,t=null){super(void 0,t);const i=new oc(this);this._root=i;const s=new Ua;this._gizmo=s,i.add(s);const n=new rc;this._plane=n,i.add(n);const a=this;function r(C,y){let w=y;Object.defineProperty(a,C,{get:function(){return w!==void 0?w:y},set:function(x){w!==x&&(w=x,n[C]=x,s[C]=x,a.dispatchEvent({type:C+"-changed",value:x}),a.dispatchEvent(Vi))}}),a[C]=y,n[C]=y,s[C]=y}r("camera",e),r("object",void 0),r("enabled",!0),r("axis",null),r("mode","translate"),r("translationSnap",null),r("rotationSnap",null),r("scaleSnap",null),r("space","world"),r("size",1),r("dragging",!1),r("showX",!0),r("showY",!0),r("showZ",!0);const A=new N,c=new N,l=new ye,h=new ye,d=new N,p=new ye,f=new N,b=new N,m=new N,I=0,E=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",m),r("rotationAngle",I),r("eye",E),this._offset=new N,this._startNorm=new N,this._endNorm=new N,this._cameraScale=new N,this._parentPosition=new N,this._parentQuaternion=new ye,this._parentQuaternionInv=new ye,this._parentScale=new N,this._worldScaleStart=new N,this._worldQuaternionInv=new ye,this._worldScale=new N,this._positionStart=new N,this._quaternionStart=new ye,this._scaleStart=new N,this._getPointer=tc.bind(this),this._onPointerDown=ic.bind(this),this._onPointerHover=sc.bind(this),this._onPointerMove=nc.bind(this),this._onPointerUp=ac.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&&$t.setFromCamera(e,this.camera);const t=Wi(this._gizmo.picker[this.mode],$t);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&&$t.setFromCamera(e,this.camera);const t=Wi(this._plane,$t,!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,Ma.mode=this.mode,this.dispatchEvent(Ma)}}pointerMove(e){const t=this.axis,i=this.mode,s=this.object;let n=this.space;if(i==="scale"?n="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(n="world"),s===void 0||t===null||this.dragging===!1||e!==null&&e.button!==-1)return;e!==null&&$t.setFromCamera(e,this.camera);const a=Wi(this._plane,$t,!0);if(a){if(this.pointEnd.copy(a.point).sub(this.worldPositionStart),i==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),n==="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),n==="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&&(n==="local"&&(s.position.applyQuaternion(Be.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)),n==="world"&&(s.parent&&s.position.add(qe.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(qe.setFromMatrixPosition(s.parent.matrixWorld))));else if(i==="scale"){if(t.search("XYZ")!==-1){let r=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(r*=-1),jt.set(r,r,r)}else qe.copy(this.pointStart),jt.copy(this.pointEnd),qe.applyQuaternion(this._worldQuaternionInv),jt.applyQuaternion(this._worldQuaternionInv),jt.divide(qe),t.search("X")===-1&&(jt.x=1),t.search("Y")===-1&&(jt.y=1),t.search("Z")===-1&&(jt.z=1);s.scale.copy(this._scaleStart).multiply(jt),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(i==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const r=20/this.worldPosition.distanceTo(qe.setFromMatrixPosition(this.camera.matrixWorld));let A=!1;t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(qe.copy(this.rotationAxis).cross(this.eye))*r):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(Ra[t]),qe.copy(Ra[t]),n==="local"&&qe.applyQuaternion(this.worldQuaternion),qe.cross(this.eye),qe.length()===0?A=!0:this.rotationAngle=this._offset.dot(qe.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),n==="local"&&t!=="E"&&t!=="XYZE"?(s.quaternion.copy(this._quaternionStart),s.quaternion.multiply(Be.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),s.quaternion.copy(Be.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),s.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(Vi),this.dispatchEvent(_a)}}pointerUp(e){e!==null&&e.button!==0||(this.dragging&&this.axis!==null&&(ka.mode=this.mode,this.dispatchEvent(ka)),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(Vi),this.dispatchEvent(_a),this.pointStart.copy(this.pointEnd))}getRaycaster(){return $t}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 tc(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 sc(o){if(this.enabled)switch(o.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(o));break}}function ic(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 nc(o){this.enabled&&this.pointerMove(this._getPointer(o))}function ac(o){this.enabled&&(this.domElement.releasePointerCapture(o.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(o)))}function Wi(o,e,t){const i=e.intersectObject(o,!0);for(let s=0;s<i.length;s++)if(i[s].object.visible||t)return i[s];return!1}const Xs=new Pt,de=new N(0,1,0),Fa=new N(0,0,0),La=new ce,Zs=new ye,$s=new ye,wt=new N,Na=new ce,xs=new N(1,0,0),es=new N(0,1,0),Ss=new N(0,0,1),ei=new N,Ts=new N,Ds=new N;class oc 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 Ua 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 Dt({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),i=e.clone();i.opacity=.15;const s=t.clone();s.opacity=.5;const n=e.clone();n.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 $e(0,.04,.1,12);f.translate(0,.05,0);const b=new Ke(.08,.08,.08);b.translate(0,.04,0);const m=new ct;m.setAttribute("position",new Me([0,0,0,1,0,0],3));const I=new $e(.0075,.0075,.5,3);I.translate(0,.25,0);function E(j,X){const J=new Es(j,.0075,3,64,X*Math.PI*2);return J.rotateY(Math.PI/2),J.rotateX(Math.PI/2),J}function C(){const j=new ct;return j.setAttribute("position",new Me([0,0,0,1,1,1],3)),j}const y={X:[[new O(f,n),[.5,0,0],[0,0,-Math.PI/2]],[new O(f,n),[-.5,0,0],[0,0,Math.PI/2]],[new O(I,n),[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 Ws(.1,0),h.clone()),[0,0,0]]],XY:[[new O(new Ke(.15,.15,.01),l.clone()),[.15,.15,0]]],YZ:[[new O(new Ke(.15,.15,.01),A.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ke(.15,.15,.01),c.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},w={X:[[new O(new $e(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new O(new $e(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new O(new $e(.2,0,.6,4),i),[0,.3,0]],[new O(new $e(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new O(new $e(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new O(new $e(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new O(new Ws(.2,0),i)]],XY:[[new O(new Ke(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new O(new Ke(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ke(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]]},x={START:[[new O(new Ws(.01,2),s),null,null,null,"helper"]],END:[[new O(new Ws(.01,2),s),null,null,null,"helper"]],DELTA:[[new pt(C(),s),null,null,null,"helper"]],X:[[new pt(m,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new pt(m,s.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new pt(m,s.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},T={XYZE:[[new O(E(.5,1),p),null,[0,Math.PI/2,0]]],X:[[new O(E(.5,.5),n)]],Y:[[new O(E(.5,.5),a),null,[0,0,-Math.PI/2]]],Z:[[new O(E(.5,.5),r),null,[0,Math.PI/2,0]]],E:[[new O(E(.75,1),d),null,[0,Math.PI/2,0]]]},S={AXIS:[[new pt(m,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},_={XYZE:[[new O(new hi(.25,10,8),i)]],X:[[new O(new Es(.5,.1,4,24),i),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new O(new Es(.5,.1,4,24),i),[0,0,0],[Math.PI/2,0,0]]],Z:[[new O(new Es(.5,.1,4,24),i),[0,0,0],[0,0,-Math.PI/2]]],E:[[new O(new Es(.75,.1,2,24),i)]]},Y={X:[[new O(b,n),[.5,0,0],[0,0,-Math.PI/2]],[new O(I,n),[0,0,0],[0,0,-Math.PI/2]],[new O(b,n),[-.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 Ke(.15,.15,.01),l),[.15,.15,0]]],YZ:[[new O(new Ke(.15,.15,.01),A),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ke(.15,.15,.01),c),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new O(new Ke(.1,.1,.1),h.clone())]]},V={X:[[new O(new $e(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new O(new $e(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new O(new $e(.2,0,.6,4),i),[0,.3,0]],[new O(new $e(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new O(new $e(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new O(new $e(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new O(new Ke(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new O(new Ke(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ke(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new O(new Ke(.2,.2,.2),i),[0,0,0]]]},K={X:[[new pt(m,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new pt(m,s.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new pt(m,s.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function W(j){const X=new Bt;for(const J in j)for(let ee=j[J].length;ee--;){const $=j[J][ee][0].clone(),ue=j[J][ee][1],De=j[J][ee][2],se=j[J][ee][3],oe=j[J][ee][4];$.name=J,$.tag=oe,ue&&$.position.set(ue[0],ue[1],ue[2]),De&&$.rotation.set(De[0],De[1],De[2]),se&&$.scale.set(se[0],se[1],se[2]),$.updateMatrix();const Ae=$.geometry.clone();Ae.applyMatrix4($.matrix),$.geometry=Ae,$.renderOrder=1/0,$.position.set(0,0,0),$.rotation.set(0,0,0),$.scale.set(1,1,1),X.add($)}return X}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=W(y)),this.add(this.gizmo.rotate=W(T)),this.add(this.gizmo.scale=W(Y)),this.add(this.picker.translate=W(w)),this.add(this.picker.rotate=W(_)),this.add(this.picker.scale=W(V)),this.add(this.helper.translate=W(x)),this.add(this.helper.rotate=W(S)),this.add(this.helper.scale=W(K)),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:$s;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 i=[];i=i.concat(this.picker[this.mode].children),i=i.concat(this.gizmo[this.mode].children),i=i.concat(this.helper[this.mode].children);for(let s=0;s<i.length;s++){const n=i[s];n.visible=!0,n.rotation.set(0,0,0),n.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),n.scale.set(1,1,1).multiplyScalar(a*this.size/4),n.tag==="helper"){n.visible=!1,n.name==="AXIS"?(n.visible=!!this.axis,this.axis==="X"&&(Be.setFromEuler(Xs.set(0,0,0)),n.quaternion.copy(t).multiply(Be),Math.abs(de.copy(xs).applyQuaternion(t).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Y"&&(Be.setFromEuler(Xs.set(0,0,Math.PI/2)),n.quaternion.copy(t).multiply(Be),Math.abs(de.copy(es).applyQuaternion(t).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Z"&&(Be.setFromEuler(Xs.set(0,Math.PI/2,0)),n.quaternion.copy(t).multiply(Be),Math.abs(de.copy(Ss).applyQuaternion(t).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="XYZE"&&(Be.setFromEuler(Xs.set(0,Math.PI/2,0)),de.copy(this.rotationAxis),n.quaternion.setFromRotationMatrix(La.lookAt(Fa,de,es)),n.quaternion.multiply(Be),n.visible=this.dragging),this.axis==="E"&&(n.visible=!1)):n.name==="START"?(n.position.copy(this.worldPositionStart),n.visible=this.dragging):n.name==="END"?(n.position.copy(this.worldPosition),n.visible=this.dragging):n.name==="DELTA"?(n.position.copy(this.worldPositionStart),n.quaternion.copy(this.worldQuaternionStart),qe.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),qe.applyQuaternion(this.worldQuaternionStart.clone().invert()),n.scale.copy(qe),n.visible=this.dragging):(n.quaternion.copy(t),this.dragging?n.position.copy(this.worldPositionStart):n.position.copy(this.worldPosition),this.axis&&(n.visible=this.axis.search(n.name)!==-1));continue}n.quaternion.copy(t),this.mode==="translate"||this.mode==="scale"?(n.name==="X"&&Math.abs(de.copy(xs).applyQuaternion(t).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Y"&&Math.abs(de.copy(es).applyQuaternion(t).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Z"&&Math.abs(de.copy(Ss).applyQuaternion(t).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XY"&&Math.abs(de.copy(Ss).applyQuaternion(t).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="YZ"&&Math.abs(de.copy(xs).applyQuaternion(t).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XZ"&&Math.abs(de.copy(es).applyQuaternion(t).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1)):this.mode==="rotate"&&(Zs.copy(t),de.copy(this.eye).applyQuaternion(Be.copy(t).invert()),n.name.search("E")!==-1&&n.quaternion.setFromRotationMatrix(La.lookAt(this.eye,Fa,es)),n.name==="X"&&(Be.setFromAxisAngle(xs,Math.atan2(-de.y,de.z)),Be.multiplyQuaternions(Zs,Be),n.quaternion.copy(Be)),n.name==="Y"&&(Be.setFromAxisAngle(es,Math.atan2(de.x,de.z)),Be.multiplyQuaternions(Zs,Be),n.quaternion.copy(Be)),n.name==="Z"&&(Be.setFromAxisAngle(Ss,Math.atan2(de.y,de.x)),Be.multiplyQuaternions(Zs,Be),n.quaternion.copy(Be))),n.visible=n.visible&&(n.name.indexOf("X")===-1||this.showX),n.visible=n.visible&&(n.name.indexOf("Y")===-1||this.showY),n.visible=n.visible&&(n.name.indexOf("Z")===-1||this.showZ),n.visible=n.visible&&(n.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),n.material._color=n.material._color||n.material.color.clone(),n.material._opacity=n.material._opacity||n.material.opacity,n.material.color.copy(n.material._color),n.material.opacity=n.material._opacity,this.enabled&&this.axis&&(n.name===this.axis||this.axis.split("").some(function(r){return n.name===r}))&&(n.material.color.setHex(16776960),n.material.opacity=1)}super.updateMatrixWorld(e)}}class rc extends O{constructor(){super(new Ri(1e5,1e5,2,2),new It({visible:!1,wireframe:!0,side:bi,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"),ei.copy(xs).applyQuaternion(t==="local"?this.worldQuaternion:$s),Ts.copy(es).applyQuaternion(t==="local"?this.worldQuaternion:$s),Ds.copy(Ss).applyQuaternion(t==="local"?this.worldQuaternion:$s),de.copy(Ts),this.mode){case"translate":case"scale":switch(this.axis){case"X":de.copy(this.eye).cross(ei),wt.copy(ei).cross(de);break;case"Y":de.copy(this.eye).cross(Ts),wt.copy(Ts).cross(de);break;case"Z":de.copy(this.eye).cross(Ds),wt.copy(Ds).cross(de);break;case"XY":wt.copy(Ds);break;case"YZ":wt.copy(ei);break;case"XZ":de.copy(Ds),wt.copy(Ts);break;case"XYZ":case"E":wt.set(0,0,0);break}break;case"rotate":default:wt.set(0,0,0)}wt.length()===0?this.quaternion.copy(this.cameraQuaternion):(Na.lookAt(qe.set(0,0,0),wt,de),this.quaternion.setFromRotationMatrix(Na)),super.updateMatrixWorld(e)}}var xe=Uint8Array,ot=Uint16Array,Xi=Int32Array,ti=new xe([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),si=new xe([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Zi=new xe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ga=function(o,e){for(var t=new ot(31),i=0;i<31;++i)t[i]=e+=1<<o[i-1];for(var s=new Xi(t[30]),i=1;i<30;++i)for(var n=t[i];n<t[i+1];++n)s[n]=n-t[i]<<5|i;return{b:t,r:s}},Pa=Ga(ti,2),Oa=Pa.b,$i=Pa.r;Oa[28]=258,$i[258]=28;for(var Ha=Ga(si,0),Ac=Ha.b,ja=Ha.r,en=new ot(32768),Ie=0;Ie<32768;++Ie){var qt=(Ie&43690)>>1|(Ie&21845)<<1;qt=(qt&52428)>>2|(qt&13107)<<2,qt=(qt&61680)>>4|(qt&3855)<<4,en[Ie]=((qt&65280)>>8|(qt&255)<<8)>>1}for(var yt=function(o,e,t){for(var i=o.length,s=0,n=new ot(e);s<i;++s)o[s]&&++n[o[s]-1];var a=new ot(e);for(s=1;s<e;++s)a[s]=a[s-1]+n[s-1]<<1;var r;if(t){r=new ot(1<<e);var A=15-e;for(s=0;s<i;++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[en[h]>>A]=c}else for(r=new ot(i),s=0;s<i;++s)o[s]&&(r[s]=en[a[o[s]-1]++]>>15-o[s]);return r},zt=new xe(288),Ie=0;Ie<144;++Ie)zt[Ie]=8;for(var Ie=144;Ie<256;++Ie)zt[Ie]=9;for(var Ie=256;Ie<280;++Ie)zt[Ie]=7;for(var Ie=280;Ie<288;++Ie)zt[Ie]=8;for(var Rs=new xe(32),Ie=0;Ie<32;++Ie)Rs[Ie]=5;var cc=yt(zt,9,0),lc=yt(zt,9,1),hc=yt(Rs,5,0),gc=yt(Rs,5,1),tn=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 i=e/8|0;return(o[i]|o[i+1]<<8)>>(e&7)&t},sn=function(o,e){var t=e/8|0;return(o[t]|o[t+1]<<8|o[t+2]<<16)>>(e&7)},nn=function(o){return(o+7)/8|0},an=function(o,e,t){return(t==null||t>o.length)&&(t=o.length),new xe(o.subarray(e,t))},dc=["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"],tt=function(o,e,t){var i=new Error(e||dc[o]);if(i.code=o,Error.captureStackTrace&&Error.captureStackTrace(i,tt),!t)throw i;return i},pc=function(o,e,t,i){var s=o.length,n=0;if(!s||e.f&&!e.l)return t||new xe(0);var a=!t,r=a||e.i!=2,A=e.i;a&&(t=new xe(s*3));var c=function(_e){var Ut=t.length;if(_e>Ut){var Ye=new xe(Math.max(Ut*2,_e));Ye.set(t),t=Ye}},l=e.f||0,h=e.p||0,d=e.b||0,p=e.l,f=e.d,b=e.m,m=e.n,I=s*8;do{if(!p){l=mt(o,h,1);var E=mt(o,h+1,3);if(h+=3,E)if(E==1)p=lc,f=gc,b=9,m=5;else if(E==2){var C=mt(o,h,31)+257,y=mt(o,h+10,15)+4,w=C+mt(o,h+5,31)+1;h+=14;for(var x=new xe(w),T=new xe(19),S=0;S<y;++S)T[Zi[S]]=mt(o,h+S*3,7);h+=y*3;for(var _=tn(T),Y=(1<<_)-1,V=yt(T,_,1),S=0;S<w;){var K=V[mt(o,h,Y)];h+=K&15;var W=K>>4;if(W<16)x[S++]=W;else{var j=0,X=0;for(W==16?(X=3+mt(o,h,3),h+=2,j=x[S-1]):W==17?(X=3+mt(o,h,7),h+=3):W==18&&(X=11+mt(o,h,127),h+=7);X--;)x[S++]=j}}var J=x.subarray(0,C),ee=x.subarray(C);b=tn(J),m=tn(ee),p=yt(J,b,1),f=yt(ee,m,1)}else tt(1);else{var W=nn(h)+4,$=o[W-4]|o[W-3]<<8,ue=W+$;if(ue>s){A&&tt(0);break}r&&c(d+$),t.set(o.subarray(W,ue),d),e.b=d+=$,e.p=h=ue*8,e.f=l;continue}if(h>I){A&&tt(0);break}}r&&c(d+131072);for(var De=(1<<b)-1,se=(1<<m)-1,oe=h;;oe=h){var j=p[sn(o,h)&De],Ae=j>>4;if(h+=j&15,h>I){A&&tt(0);break}if(j||tt(2),Ae<256)t[d++]=Ae;else if(Ae==256){oe=h,p=null;break}else{var Te=Ae-254;if(Ae>264){var S=Ae-257,fe=ti[S];Te=mt(o,h,(1<<fe)-1)+Oa[S],h+=fe}var ze=f[sn(o,h)&se],Lt=ze>>4;ze||tt(3),h+=ze&15;var ee=Ac[Lt];if(Lt>3){var fe=si[Lt];ee+=sn(o,h)&(1<<fe)-1,h+=fe}if(h>I){A&&tt(0);break}r&&c(d+131072);var Nt=d+Te;if(d<ee){var is=n-ee,Ne=Math.min(ee,Nt);for(is+d<0&&tt(3);d<Ne;++d)t[d]=i[is+d]}for(;d<Nt;++d)t[d]=t[d-ee]}}e.l=p,e.p=oe,e.b=d,e.f=l,p&&(l=1,e.m=b,e.d=f,e.n=m)}while(!l);return d!=t.length&&a?an(t,0,d):t.subarray(0,d)},Ft=function(o,e,t){t<<=e&7;var i=e/8|0;o[i]|=t,o[i+1]|=t>>8},Ms=function(o,e,t){t<<=e&7;var i=e/8|0;o[i]|=t,o[i+1]|=t>>8,o[i+2]|=t>>16},on=function(o,e){for(var t=[],i=0;i<o.length;++i)o[i]&&t.push({s:i,f:o[i]});var s=t.length,n=t.slice();if(!s)return{t:Ka,l:0};if(s==1){var a=new xe(t[0].s+1);return a[t[0].s]=1,{t:a,l:1}}t.sort(function(w,x){return w.f-x.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=n[0].s,i=1;i<s;++i)n[i].s>d&&(d=n[i].s);var p=new ot(d+1),f=rn(t[l-1],p,0);if(f>e){var i=0,b=0,m=f-e,I=1<<m;for(n.sort(function(x,T){return p[T.s]-p[x.s]||x.f-T.f});i<s;++i){var E=n[i].s;if(p[E]>e)b+=I-(1<<f-p[E]),p[E]=e;else break}for(b>>=m;b>0;){var C=n[i].s;p[C]<e?b-=1<<e-p[C]++-1:++i}for(;i>=0&&b;--i){var y=n[i].s;p[y]==e&&(--p[y],++b)}f=e}return{t:new xe(p),l:f}},rn=function(o,e,t){return o.s==-1?Math.max(rn(o.l,e,t+1),rn(o.r,e,t+1)):e[o.s]=t},qa=function(o){for(var e=o.length;e&&!o[--e];);for(var t=new ot(++e),i=0,s=o[0],n=1,a=function(A){t[i++]=A},r=1;r<=e;++r)if(o[r]==s&&r!=e)++n;else{if(!s&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(s),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(s);n=1,s=o[r]}return{c:t.subarray(0,i),n:e}},ks=function(o,e){for(var t=0,i=0;i<e.length;++i)t+=o[i]*e[i];return t},za=function(o,e,t){var i=t.length,s=nn(e+2);o[s]=i&255,o[s+1]=i>>8,o[s+2]=o[s]^255,o[s+3]=o[s+1]^255;for(var n=0;n<i;++n)o[s+n+4]=t[n];return(s+4+i)*8},Ya=function(o,e,t,i,s,n,a,r,A,c,l){Ft(e,l++,t),++s[256];for(var h=on(s,15),d=h.t,p=h.l,f=on(n,15),b=f.t,m=f.l,I=qa(d),E=I.c,C=I.n,y=qa(b),w=y.c,x=y.n,T=new ot(19),S=0;S<E.length;++S)++T[E[S]&31];for(var S=0;S<w.length;++S)++T[w[S]&31];for(var _=on(T,7),Y=_.t,V=_.l,K=19;K>4&&!Y[Zi[K-1]];--K);var W=c+5<<3,j=ks(s,zt)+ks(n,Rs)+a,X=ks(s,d)+ks(n,b)+a+14+3*K+ks(T,Y)+2*T[16]+3*T[17]+7*T[18];if(A>=0&&W<=j&&W<=X)return za(e,l,o.subarray(A,A+c));var J,ee,$,ue;if(Ft(e,l,1+(X<j)),l+=2,X<j){J=yt(d,p,0),ee=d,$=yt(b,m,0),ue=b;var De=yt(Y,V,0);Ft(e,l,C-257),Ft(e,l+5,x-1),Ft(e,l+10,K-4),l+=14;for(var S=0;S<K;++S)Ft(e,l+3*S,Y[Zi[S]]);l+=3*K;for(var se=[E,w],oe=0;oe<2;++oe)for(var Ae=se[oe],S=0;S<Ae.length;++S){var Te=Ae[S]&31;Ft(e,l,De[Te]),l+=Y[Te],Te>15&&(Ft(e,l,Ae[S]>>5&127),l+=Ae[S]>>12)}}else J=cc,ee=zt,$=hc,ue=Rs;for(var S=0;S<r;++S){var fe=i[S];if(fe>255){var Te=fe>>18&31;Ms(e,l,J[Te+257]),l+=ee[Te+257],Te>7&&(Ft(e,l,fe>>23&31),l+=ti[Te]);var ze=fe&31;Ms(e,l,$[ze]),l+=ue[ze],ze>3&&(Ms(e,l,fe>>5&8191),l+=si[ze])}else Ms(e,l,J[fe]),l+=ee[fe]}return Ms(e,l,J[256]),l+ee[256]},uc=new Xi([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ka=new xe(0),fc=function(o,e,t,i,s,n){var a=n.z||o.length,r=new xe(i+a+5*(1+Math.ceil(a/7e3))+s),A=r.subarray(i,r.length-s),c=n.l,l=(n.r||0)&7;if(e){l&&(A[0]=n.r>>3);for(var h=uc[e-1],d=h>>13,p=h&8191,f=(1<<t)-1,b=n.p||new ot(32768),m=n.h||new ot(f+1),I=Math.ceil(t/3),E=2*I,C=function(Ue){return(o[Ue]^o[Ue+1]<<I^o[Ue+2]<<E)&f},y=new Xi(25e3),w=new ot(288),x=new ot(32),T=0,S=0,_=n.i||0,Y=0,V=n.w||0,K=0;_+2<a;++_){var W=C(_),j=_&32767,X=m[W];if(b[j]=X,m[W]=j,V<=_){var J=a-_;if((T>7e3||Y>24576)&&(J>423||!c)){l=Ya(o,A,0,y,w,x,S,Y,K,_-K,l),Y=T=S=0,K=_;for(var ee=0;ee<286;++ee)w[ee]=0;for(var ee=0;ee<30;++ee)x[ee]=0}var $=2,ue=0,De=p,se=j-X&32767;if(J>2&&W==C(_-se))for(var oe=Math.min(d,J)-1,Ae=Math.min(32767,_),Te=Math.min(258,J);se<=Ae&&--De&&j!=X;){if(o[_+$]==o[_+$-se]){for(var fe=0;fe<Te&&o[_+fe]==o[_+fe-se];++fe);if(fe>$){if($=fe,ue=se,fe>oe)break;for(var ze=Math.min(se,fe-2),Lt=0,ee=0;ee<ze;++ee){var Nt=_-se+ee&32767,is=b[Nt],Ne=Nt-is&32767;Ne>Lt&&(Lt=Ne,X=Nt)}}}j=X,X=b[j],se+=j-X&32767}if(ue){y[Y++]=268435456|$i[$]<<18|ja[ue];var _e=$i[$]&31,Ut=ja[ue]&31;S+=ti[_e]+si[Ut],++w[257+_e],++x[Ut],V=_+$,++T}else y[Y++]=o[_],++w[o[_]]}}for(_=Math.max(_,V);_<a;++_)y[Y++]=o[_],++w[o[_]];l=Ya(o,A,c,y,w,x,S,Y,K,_-K,l),c||(n.r=l&7|A[l/8|0]<<3,l-=7,n.h=m,n.p=b,n.i=_,n.w=V)}else{for(var _=n.w||0;_<a+c;_+=65535){var Ye=_+65535;Ye>=a&&(A[l/8|0]=c,Ye=a),l=za(A,l+1,o.subarray(_,Ye))}n.i=a}return an(r,0,i+nn(l)+s)},mc=function(){for(var o=new Int32Array(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(t&1&&-306674912)^t>>>1;o[e]=t}return o}(),bc=function(){var o=-1;return{p:function(e){for(var t=o,i=0;i<e.length;++i)t=mc[t&255^e[i]]^t>>>8;o=t},d:function(){return~o}}},Ic=function(o,e,t,i,s){if(!s&&(s={l:1},e.dictionary)){var n=e.dictionary.subarray(-32768),a=new xe(n.length+o.length);a.set(n),a.set(o,n.length),o=a,s.w=n.length}return fc(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,i,s)},Ja=function(o,e){var t={};for(var i in o)t[i]=o[i];for(var i in e)t[i]=e[i];return t},Ge=function(o,e,t){for(;t;++e)o[e]=t,t>>>=8},Ec=function(o,e){return((o[0]&15)!=8||o[0]>>4>7||(o[0]<<8|o[1])%31)&&tt(6,"invalid zlib data"),(o[1]>>5&1)==1&&tt(6,"invalid zlib data: "+(o[1]&32?"need":"unexpected")+" dictionary"),(o[1]>>3&4)+2};function Cc(o,e){return Ic(o,e||{},0,0)}function _s(o,e){return pc(o.subarray(Ec(o),-4),{i:2},e,e)}var Va=function(o,e,t,i){for(var s in o){var n=o[s],a=e+s,r=i;Array.isArray(n)&&(r=Ja(i,n[1]),n=n[0]),n instanceof xe?t[a]=[n,r]:(t[a+="/"]=[new xe(0),r],Va(n,a,t,i))}},Wa=typeof TextEncoder<"u"&&new TextEncoder,Bc=typeof TextDecoder<"u"&&new TextDecoder,wc=0;try{Bc.decode(Ka,{stream:!0}),wc=1}catch{}function An(o,e){var t;if(Wa)return Wa.encode(o);for(var i=o.length,s=new xe(o.length+(o.length>>1)),n=0,a=function(l){s[n++]=l},t=0;t<i;++t){if(n+5>s.length){var r=new xe(n+8+(i-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 an(s,0,n)}var cn=function(o){var e=0;if(o)for(var t in o){var i=o[t].length;i>65535&&tt(9),e+=i+4}return e},Xa=function(o,e,t,i,s,n,a,r){var A=i.length,c=t.extra,l=r&&r.length,h=cn(c);Ge(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|(n<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)&&tt(10),Ge(o,e,p<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>1),e+=4,n!=-1&&(Ge(o,e,t.crc),Ge(o,e+4,n<0?-n-2:n),Ge(o,e+8,t.size)),Ge(o,e+12,A),Ge(o,e+14,h),e+=16,a!=null&&(Ge(o,e,l),Ge(o,e+6,t.attrs),Ge(o,e+10,a),e+=14),o.set(i,e),e+=A,h)for(var f in c){var b=c[f],m=b.length;Ge(o,e,+f),Ge(o,e+2,m),o.set(b,e+4),e+=4+m}return l&&(o.set(r,e),e+=l),e},yc=function(o,e,t,i,s){Ge(o,e,101010256),Ge(o,e+8,t),Ge(o,e+10,t),Ge(o,e+12,i),Ge(o,e+16,s)};function Qc(o,e){e||(e={});var t={},i=[];Va(o,"",t,e);var s=0,n=0;for(var a in t){var r=t[a],A=r[0],c=r[1],l=c.level==0?0:8,h=An(a),d=h.length,p=c.comment,f=p&&An(p),b=f&&f.length,m=cn(c.extra);d>65535&&tt(11);var I=l?Cc(A,c):A,E=I.length,C=bc();C.p(A),i.push(Ja(c,{size:A.length,crc:C.d(),c:I,f:h,m:f,u:d!=a.length||f&&p.length!=b,o:s,compression:l})),s+=30+d+m+E,n+=76+2*(d+m)+(b||0)+E}for(var y=new xe(n+22),w=s,x=n-s,T=0;T<i.length;++T){var h=i[T];Xa(y,h.o,h,h.f,h.u,h.c.length);var S=30+h.f.length+cn(h.extra);y.set(h.c,h.o+S),Xa(y,s,h,h.f,h.u,h.c.length,h.o,h.m),s+=16+S+(h.m?h.m.length:0)}return yc(y,s,i.length,x,w),y}class Za extends Kn{constructor(e){super(e),this.type=Ze}parse(e){const t=Math.pow(2.7182818,2.2);function i(g,u){let B=0;for(let D=0;D<65536;++D)(D==0||g[D>>3]&1<<(D&7))&&(u[B++]=D);const Q=B-1;for(;B<65536;)u[B++]=0;return Q}function s(g){for(let u=0;u<16384;u++)g[u]={},g[u].len=0,g[u].lit=0,g[u].p=null}const n={l:0,c:0,lc:0};function a(g,u,B,Q,D){for(;B<g;)u=u<<8|Ut(Q,D),B+=8;B-=g,n.l=u>>B&(1<<g)-1,n.c=u,n.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 u=0;for(let B=58;B>0;--B){const Q=u+r[B]>>1;r[B]=u,u=Q}for(let B=0;B<65537;++B){const Q=g[B];Q>0&&(g[B]=Q|r[Q]++<<6)}}function c(g,u,B,Q,D,v){const k=u;let L=0,F=0;for(;Q<=D;Q++){if(k.value-u.value>B)return!1;a(6,L,F,g,k);const M=n.l;if(L=n.c,F=n.lc,v[Q]=M,M==63){if(k.value-u.value>B)throw new Error("Something wrong with hufUnpackEncTable");a(8,L,F,g,k);let R=n.l+6;if(L=n.c,F=n.lc,Q+R>D+1)throw new Error("Something wrong with hufUnpackEncTable");for(;R--;)v[Q++]=0;Q--}else if(M>=59){let R=M-59+2;if(Q+R>D+1)throw new Error("Something wrong with hufUnpackEncTable");for(;R--;)v[Q++]=0;Q--}}A(v)}function l(g){return g&63}function h(g){return g>>6}function d(g,u,B,Q){for(;u<=B;u++){const D=h(g[u]),v=l(g[u]);if(D>>v)throw new Error("Invalid table entry");if(v>14){const k=Q[D>>v-14];if(k.len)throw new Error("Invalid table entry");if(k.lit++,k.p){const L=k.p;k.p=new Array(k.lit);for(let F=0;F<k.lit-1;++F)k.p[F]=L[F]}else k.p=new Array(1);k.p[k.lit-1]=u}else if(v){let k=0;for(let L=1<<14-v;L>0;L--){const F=Q[(D<<14-v)+k];if(F.len||F.p)throw new Error("Invalid table entry");F.len=v,F.lit=u,k++}}}return!0}const p={c:0,lc:0};function f(g,u,B,Q){g=g<<8|Ut(B,Q),u+=8,p.c=g,p.lc=u}const b={c:0,lc:0};function m(g,u,B,Q,D,v,k,L,F){if(g==u){Q<8&&(f(B,Q,D,v),B=p.c,Q=p.lc),Q-=8;let M=B>>Q;if(M=new Uint8Array([M])[0],L.value+M>F)return!1;const R=k[L.value-1];for(;M-- >0;)k[L.value++]=R}else if(L.value<F)k[L.value++]=g;else return!1;b.c=B,b.lc=Q}function I(g){return g&65535}function E(g){const u=I(g);return u>32767?u-65536:u}const C={a:0,b:0};function y(g,u){const B=E(g),Q=E(u),D=B+(Q&1)+(Q>>1),v=D,k=D-Q;C.a=v,C.b=k}function w(g,u){const B=I(g),Q=I(u),D=B-(Q>>1)&65535,v=Q+D-32768&65535;C.a=v,C.b=D}function x(g,u,B,Q,D,v,k){const L=k<16384,F=B>D?D:B;let M=1,R,G;for(;M<=F;)M<<=1;for(M>>=1,R=M,M>>=1;M>=1;){G=0;const U=G+v*(D-R),q=v*M,Z=v*R,P=Q*M,z=Q*R;let te,Ee,ve,it;for(;G<=U;G+=Z){let me=G;const re=G+Q*(B-R);for(;me<=re;me+=z){const Re=me+P,At=me+q,Fe=At+P;L?(y(g[me+u],g[At+u]),te=C.a,ve=C.b,y(g[Re+u],g[Fe+u]),Ee=C.a,it=C.b,y(te,Ee),g[me+u]=C.a,g[Re+u]=C.b,y(ve,it),g[At+u]=C.a,g[Fe+u]=C.b):(w(g[me+u],g[At+u]),te=C.a,ve=C.b,w(g[Re+u],g[Fe+u]),Ee=C.a,it=C.b,w(te,Ee),g[me+u]=C.a,g[Re+u]=C.b,w(ve,it),g[At+u]=C.a,g[Fe+u]=C.b)}if(B&M){const Re=me+q;L?y(g[me+u],g[Re+u]):w(g[me+u],g[Re+u]),te=C.a,g[Re+u]=C.b,g[me+u]=te}}if(D&M){let me=G;const re=G+Q*(B-R);for(;me<=re;me+=z){const Re=me+P;L?y(g[me+u],g[Re+u]):w(g[me+u],g[Re+u]),te=C.a,g[Re+u]=C.b,g[me+u]=te}}R=M,M>>=1}return G}function T(g,u,B,Q,D,v,k,L,F){let M=0,R=0;const G=k,U=Math.trunc(Q.value+(D+7)/8);for(;Q.value<U;)for(f(M,R,B,Q),M=p.c,R=p.lc;R>=14;){const Z=M>>R-14&16383,P=u[Z];if(P.len)R-=P.len,m(P.lit,v,M,R,B,Q,L,F,G),M=b.c,R=b.lc;else{if(!P.p)throw new Error("hufDecode issues");let z;for(z=0;z<P.lit;z++){const te=l(g[P.p[z]]);for(;R<te&&Q.value<U;)f(M,R,B,Q),M=p.c,R=p.lc;if(R>=te&&h(g[P.p[z]])==(M>>R-te&(1<<te)-1)){R-=te,m(P.p[z],v,M,R,B,Q,L,F,G),M=b.c,R=b.lc;break}}if(z==P.lit)throw new Error("hufDecode issues")}}const q=8-D&7;for(M>>=q,R-=q;R>0;){const Z=u[M<<14-R&16383];if(Z.len)R-=Z.len,m(Z.lit,v,M,R,B,Q,L,F,G),M=b.c,R=b.lc;else throw new Error("hufDecode issues")}return!0}function S(g,u,B,Q,D,v){const k={value:0},L=B.value,F=_e(u,B),M=_e(u,B);B.value+=4;const R=_e(u,B);if(B.value+=4,F<0||F>=65537||M<0||M>=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,M,G),R>8*(Q-(B.value-L)))throw new Error("Something wrong with hufUncompress");d(G,F,M,U),T(G,U,g,B,R,M,v,D,k)}function _(g,u,B){for(let Q=0;Q<B;++Q)u[Q]=g[u[Q]]}function Y(g){for(let u=1;u<g.length;u++){const B=g[u-1]+g[u]-128;g[u]=B}}function V(g,u){let B=0,Q=Math.floor((g.length+1)/2),D=0;const v=g.length-1;for(;!(D>v||(u[D++]=g[B++],D>v));)u[D++]=g[Q++]}function K(g){let u=g.byteLength;const B=new Array;let Q=0;const D=new DataView(g);for(;u>0;){const v=D.getInt8(Q++);if(v<0){const k=-v;u-=k+1;for(let L=0;L<k;L++)B.push(D.getUint8(Q++))}else{const k=v;u-=2;const L=D.getUint8(Q++);for(let F=0;F<k+1;F++)B.push(L)}}return B}function W(g,u,B,Q,D,v){let k=new DataView(v.buffer);const L=B[g.idx[0]].width,F=B[g.idx[0]].height,M=3,R=Math.floor(L/8),G=Math.ceil(L/8),U=Math.ceil(F/8),q=L-(G-1)*8,Z=F-(U-1)*8,P={value:0},z=new Array(M),te=new Array(M),Ee=new Array(M),ve=new Array(M),it=new Array(M);for(let re=0;re<M;++re)it[re]=u[g.idx[re]],z[re]=re<1?0:z[re-1]+G*U,te[re]=new Float32Array(64),Ee[re]=new Uint16Array(64),ve[re]=new Uint16Array(G*64);for(let re=0;re<U;++re){let Re=8;re==U-1&&(Re=Z);let At=8;for(let ge=0;ge<G;++ge){ge==G-1&&(At=q);for(let pe=0;pe<M;++pe)Ee[pe].fill(0),Ee[pe][0]=D[z[pe]++],j(P,Q,Ee[pe]),X(Ee[pe],te[pe]),J(te[pe]);ee(te);for(let pe=0;pe<M;++pe)$(te[pe],ve[pe],ge*64)}let Fe=0;for(let ge=0;ge<M;++ge){const pe=B[g.idx[ge]].type;for(let St=8*re;St<8*re+Re;++St){Fe=it[ge][St];for(let ps=0;ps<R;++ps){const bt=ps*64+(St&7)*8;k.setUint16(Fe+0*pe,ve[ge][bt+0],!0),k.setUint16(Fe+2*pe,ve[ge][bt+1],!0),k.setUint16(Fe+4*pe,ve[ge][bt+2],!0),k.setUint16(Fe+6*pe,ve[ge][bt+3],!0),k.setUint16(Fe+8*pe,ve[ge][bt+4],!0),k.setUint16(Fe+10*pe,ve[ge][bt+5],!0),k.setUint16(Fe+12*pe,ve[ge][bt+6],!0),k.setUint16(Fe+14*pe,ve[ge][bt+7],!0),Fe+=16*pe}}if(R!=G)for(let St=8*re;St<8*re+Re;++St){const ps=it[ge][St]+8*R*2*pe,bt=R*64+(St&7)*8;for(let Ps=0;Ps<At;++Ps)k.setUint16(ps+Ps*2*pe,ve[ge][bt+Ps],!0)}}}const me=new Uint16Array(L);k=new DataView(v.buffer);for(let re=0;re<M;++re){B[g.idx[re]].decoded=!0;const Re=B[g.idx[re]].type;if(B[re].type==2)for(let At=0;At<F;++At){const Fe=it[re][At];for(let ge=0;ge<L;++ge)me[ge]=k.getUint16(Fe+ge*2*Re,!0);for(let ge=0;ge<L;++ge)k.setFloat32(Fe+ge*2*Re,H(me[ge]),!0)}}}function j(g,u,B){let Q,D=1;for(;D<64;)Q=u[g.value],Q==65280?D=64:Q>>8==255?D+=Q&255:(B[D]=Q,D++),g.value++}function X(g,u){u[0]=H(g[0]),u[1]=H(g[1]),u[2]=H(g[5]),u[3]=H(g[6]),u[4]=H(g[14]),u[5]=H(g[15]),u[6]=H(g[27]),u[7]=H(g[28]),u[8]=H(g[2]),u[9]=H(g[4]),u[10]=H(g[7]),u[11]=H(g[13]),u[12]=H(g[16]),u[13]=H(g[26]),u[14]=H(g[29]),u[15]=H(g[42]),u[16]=H(g[3]),u[17]=H(g[8]),u[18]=H(g[12]),u[19]=H(g[17]),u[20]=H(g[25]),u[21]=H(g[30]),u[22]=H(g[41]),u[23]=H(g[43]),u[24]=H(g[9]),u[25]=H(g[11]),u[26]=H(g[18]),u[27]=H(g[24]),u[28]=H(g[31]),u[29]=H(g[40]),u[30]=H(g[44]),u[31]=H(g[53]),u[32]=H(g[10]),u[33]=H(g[19]),u[34]=H(g[23]),u[35]=H(g[32]),u[36]=H(g[39]),u[37]=H(g[45]),u[38]=H(g[52]),u[39]=H(g[54]),u[40]=H(g[20]),u[41]=H(g[22]),u[42]=H(g[33]),u[43]=H(g[38]),u[44]=H(g[46]),u[45]=H(g[51]),u[46]=H(g[55]),u[47]=H(g[60]),u[48]=H(g[21]),u[49]=H(g[34]),u[50]=H(g[37]),u[51]=H(g[47]),u[52]=H(g[50]),u[53]=H(g[56]),u[54]=H(g[59]),u[55]=H(g[61]),u[56]=H(g[35]),u[57]=H(g[36]),u[58]=H(g[48]),u[59]=H(g[49]),u[60]=H(g[57]),u[61]=H(g[58]),u[62]=H(g[62]),u[63]=H(g[63])}function J(g){const u=.5*Math.cos(.7853975),B=.5*Math.cos(3.14159/16),Q=.5*Math.cos(3.14159/8),D=.5*Math.cos(3*3.14159/16),v=.5*Math.cos(5*3.14159/16),k=.5*Math.cos(3*3.14159/8),L=.5*Math.cos(7*3.14159/16),F=new Array(4),M=new Array(4),R=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]=k*g[q+2],F[2]=Q*g[q+6],F[3]=k*g[q+6],M[0]=B*g[q+1]+D*g[q+3]+v*g[q+5]+L*g[q+7],M[1]=D*g[q+1]-L*g[q+3]-B*g[q+5]-v*g[q+7],M[2]=v*g[q+1]-B*g[q+3]+L*g[q+5]+D*g[q+7],M[3]=L*g[q+1]-v*g[q+3]+D*g[q+5]-B*g[q+7],R[0]=u*(g[q+0]+g[q+4]),R[3]=u*(g[q+0]-g[q+4]),R[1]=F[0]+F[3],R[2]=F[1]-F[2],G[0]=R[0]+R[1],G[1]=R[3]+R[2],G[2]=R[3]-R[2],G[3]=R[0]-R[1],g[q+0]=G[0]+M[0],g[q+1]=G[1]+M[1],g[q+2]=G[2]+M[2],g[q+3]=G[3]+M[3],g[q+4]=G[3]-M[3],g[q+5]=G[2]-M[2],g[q+6]=G[1]-M[1],g[q+7]=G[0]-M[0]}for(let U=0;U<8;++U)F[0]=Q*g[16+U],F[1]=k*g[16+U],F[2]=Q*g[48+U],F[3]=k*g[48+U],M[0]=B*g[8+U]+D*g[24+U]+v*g[40+U]+L*g[56+U],M[1]=D*g[8+U]-L*g[24+U]-B*g[40+U]-v*g[56+U],M[2]=v*g[8+U]-B*g[24+U]+L*g[40+U]+D*g[56+U],M[3]=L*g[8+U]-v*g[24+U]+D*g[40+U]-B*g[56+U],R[0]=u*(g[U]+g[32+U]),R[3]=u*(g[U]-g[32+U]),R[1]=F[0]+F[3],R[2]=F[1]-F[2],G[0]=R[0]+R[1],G[1]=R[3]+R[2],G[2]=R[3]-R[2],G[3]=R[0]-R[1],g[0+U]=G[0]+M[0],g[8+U]=G[1]+M[1],g[16+U]=G[2]+M[2],g[24+U]=G[3]+M[3],g[32+U]=G[3]-M[3],g[40+U]=G[2]-M[2],g[48+U]=G[1]-M[1],g[56+U]=G[0]-M[0]}function ee(g){for(let u=0;u<64;++u){const B=g[0][u],Q=g[1][u],D=g[2][u];g[0][u]=B+1.5747*D,g[1][u]=B-.1873*Q-.4682*D,g[2][u]=B+1.8556*Q}}function $(g,u,B){for(let Q=0;Q<64;++Q)u[B+Q]=os.toHalfFloat(ue(g[Q]))}function ue(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 De(g){return new DataView(g.array.buffer,g.offset.value,g.size)}function se(g){const u=g.viewer.buffer.slice(g.offset.value,g.offset.value+g.size),B=new Uint8Array(K(u)),Q=new Uint8Array(B.length);return Y(B),V(B,Q),new DataView(Q.buffer)}function oe(g){const u=g.array.slice(g.offset.value,g.offset.value+g.size),B=_s(u),Q=new Uint8Array(B.length);return Y(B),V(B,Q),new DataView(Q.buffer)}function Ae(g){const u=g.viewer,B={value:g.offset.value},Q=new Uint16Array(g.columns*g.lines*(g.inputChannels.length*g.type)),D=new Uint8Array(8192);let v=0;const k=new Array(g.inputChannels.length);for(let Z=0,P=g.inputChannels.length;Z<P;Z++)k[Z]={},k[Z].start=v,k[Z].end=k[Z].start,k[Z].nx=g.columns,k[Z].ny=g.lines,k[Z].size=g.type,v+=k[Z].nx*k[Z].ny*k[Z].size;const L=ds(u,B),F=ds(u,B);if(F>=8192)throw new Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(L<=F)for(let Z=0;Z<F-L+1;Z++)D[Z+L]=Ye(u,B);const M=new Uint16Array(65536),R=i(D,M),G=_e(u,B);S(g.array,u,B,G,Q,v);for(let Z=0;Z<g.inputChannels.length;++Z){const P=k[Z];for(let z=0;z<k[Z].size;++z)x(Q,P.start+z,P.nx,P.size,P.ny,P.nx*P.size,R)}_(M,Q,v);let U=0;const q=new Uint8Array(Q.buffer.byteLength);for(let Z=0;Z<g.lines;Z++)for(let P=0;P<g.inputChannels.length;P++){const z=k[P],te=z.nx*z.size,Ee=new Uint8Array(Q.buffer,z.end*2,te*2);q.set(Ee,U),U+=te*2,z.end+=te}return new DataView(q.buffer)}function Te(g){const u=g.array.slice(g.offset.value,g.offset.value+g.size),B=_s(u),Q=g.inputChannels.length*g.lines*g.columns*g.totalBytes,D=new ArrayBuffer(Q),v=new DataView(D);let k=0,L=0;const F=new Array(4);for(let M=0;M<g.lines;M++)for(let R=0;R<g.inputChannels.length;R++){let G=0;switch(g.inputChannels[R].pixelType){case 1:F[0]=k,F[1]=F[0]+g.columns,k=F[1]+g.columns;for(let U=0;U<g.columns;++U){const q=B[F[0]++]<<8|B[F[1]++];G+=q,v.setUint16(L,G,!0),L+=2}break;case 2:F[0]=k,F[1]=F[0]+g.columns,F[2]=F[1]+g.columns,k=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,v.setUint32(L,G,!0),L+=4}break}}return v}function fe(g){const u=g.viewer,B={value:g.offset.value},Q=new Uint8Array(g.columns*g.lines*(g.inputChannels.length*g.type*2)),D={version:Ue(u,B),unknownUncompressedSize:Ue(u,B),unknownCompressedSize:Ue(u,B),acCompressedSize:Ue(u,B),dcCompressedSize:Ue(u,B),rleCompressedSize:Ue(u,B),rleUncompressedSize:Ue(u,B),rleRawSize:Ue(u,B),totalAcUncompressedCount:Ue(u,B),totalDcUncompressedCount:Ue(u,B),acCompression:Ue(u,B)};if(D.version<2)throw new Error("EXRLoader.parse: "+Yt.compression+" version "+D.version+" is unsupported");const v=new Array;let k=ds(u,B)-2;for(;k>0;){const P=ze(u.buffer,B),z=Ye(u,B),te=z>>2&3,Ee=(z>>4)-1,ve=new Int8Array([Ee])[0],it=Ye(u,B);v.push({name:P,index:ve,type:it,compression:te}),k-=P.length+3}const L=Yt.channels,F=new Array(g.inputChannels.length);for(let P=0;P<g.inputChannels.length;++P){const z=F[P]={},te=L[P];z.name=te.name,z.compression=0,z.decoded=!1,z.type=te.pixelType,z.pLinear=te.pLinear,z.width=g.columns,z.height=g.lines}const M={idx:new Array(3)};for(let P=0;P<g.inputChannels.length;++P){const z=F[P];for(let te=0;te<v.length;++te){const Ee=v[te];z.name==Ee.name&&(z.compression=Ee.compression,Ee.index>=0&&(M.idx[Ee.index]=P),z.offset=P)}}let R,G,U;if(D.acCompressedSize>0)switch(D.acCompression){case 0:R=new Uint16Array(D.totalAcUncompressedCount),S(g.array,u,B,D.acCompressedSize,R,D.totalAcUncompressedCount);break;case 1:const P=g.array.slice(B.value,B.value+D.totalAcUncompressedCount),z=_s(P);R=new Uint16Array(z.buffer),B.value+=D.totalAcUncompressedCount;break}if(D.dcCompressedSize>0){const P={array:g.array,offset:B,size:D.dcCompressedSize};G=new Uint16Array(oe(P).buffer),B.value+=D.dcCompressedSize}if(D.rleRawSize>0){const P=g.array.slice(B.value,B.value+D.rleCompressedSize),z=_s(P);U=K(z.buffer),B.value+=D.rleCompressedSize}let q=0;const Z=new Array(F.length);for(let P=0;P<Z.length;++P)Z[P]=new Array;for(let P=0;P<g.lines;++P)for(let z=0;z<F.length;++z)Z[z].push(q),q+=F[z].width*g.type*2;W(M,Z,F,R,G,Q);for(let P=0;P<F.length;++P){const z=F[P];if(!z.decoded)switch(z.compression){case 2:let te=0,Ee=0;for(let ve=0;ve<g.lines;++ve){let it=Z[P][te];for(let me=0;me<z.width;++me){for(let re=0;re<2*z.type;++re)Q[it++]=U[Ee+re*z.width*z.height];Ee++}te++}break;case 1:default:throw new Error("EXRLoader.parse: unsupported channel compression")}}return new DataView(Q.buffer)}function ze(g,u){const B=new Uint8Array(g);let Q=0;for(;B[u.value+Q]!=0;)Q+=1;const D=new TextDecoder().decode(B.slice(u.value,u.value+Q));return u.value=u.value+Q+1,D}function Lt(g,u,B){const Q=new TextDecoder().decode(new Uint8Array(g).slice(u.value,u.value+B));return u.value=u.value+B,Q}function Nt(g,u){const B=Ne(g,u),Q=_e(g,u);return[B,Q]}function is(g,u){const B=_e(g,u),Q=_e(g,u);return[B,Q]}function Ne(g,u){const B=g.getInt32(u.value,!0);return u.value=u.value+4,B}function _e(g,u){const B=g.getUint32(u.value,!0);return u.value=u.value+4,B}function Ut(g,u){const B=g[u.value];return u.value=u.value+1,B}function Ye(g,u){const B=g.getUint8(u.value);return u.value=u.value+1,B}const Ue=function(g,u){let B;return"getBigInt64"in DataView.prototype?B=Number(g.getBigInt64(u.value,!0)):B=g.getUint32(u.value+4,!0)+Number(g.getUint32(u.value,!0)<<32),u.value+=8,B};function je(g,u){const B=g.getFloat32(u.value,!0);return u.value+=4,B}function ko(g,u){return os.toHalfFloat(je(g,u))}function H(g){const u=(g&31744)>>10,B=g&1023;return(g>>15?-1:1)*(u?u===31?B?NaN:1/0:Math.pow(2,u-15)*(1+B/1024):6103515625e-14*(B/1024))}function ds(g,u){const B=g.getUint16(u.value,!0);return u.value+=2,B}function _o(g,u){return H(ds(g,u))}function Fo(g,u,B,Q){const D=B.value,v=[];for(;B.value<D+Q-1;){const k=ze(u,B),L=Ne(g,B),F=Ye(g,B);B.value+=3;const M=Ne(g,B),R=Ne(g,B);v.push({name:k,pixelType:L,pLinear:F,xSampling:M,ySampling:R})}return B.value+=1,v}function Lo(g,u){const B=je(g,u),Q=je(g,u),D=je(g,u),v=je(g,u),k=je(g,u),L=je(g,u),F=je(g,u),M=je(g,u);return{redX:B,redY:Q,greenX:D,greenY:v,blueX:k,blueY:L,whiteX:F,whiteY:M}}function No(g,u){const B=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],Q=Ye(g,u);return B[Q]}function Uo(g,u){const B=Ne(g,u),Q=Ne(g,u),D=Ne(g,u),v=Ne(g,u);return{xMin:B,yMin:Q,xMax:D,yMax:v}}function Go(g,u){const B=["INCREASING_Y","DECREASING_Y","RANDOM_Y"],Q=Ye(g,u);return B[Q]}function Po(g,u){const B=["ENVMAP_LATLONG","ENVMAP_CUBE"],Q=Ye(g,u);return B[Q]}function Oo(g,u){const B=["ONE_LEVEL","MIPMAP_LEVELS","RIPMAP_LEVELS"],Q=["ROUND_DOWN","ROUND_UP"],D=_e(g,u),v=_e(g,u),k=Ye(g,u);return{xSize:D,ySize:v,levelMode:B[k&15],roundingMode:Q[k>>4]}}function Ho(g,u){const B=je(g,u),Q=je(g,u);return[B,Q]}function jo(g,u){const B=je(g,u),Q=je(g,u),D=je(g,u);return[B,Q,D]}function qo(g,u,B,Q,D){if(Q==="string"||Q==="stringvector"||Q==="iccProfile")return Lt(u,B,D);if(Q==="chlist")return Fo(g,u,B,D);if(Q==="chromaticities")return Lo(g,B);if(Q==="compression")return No(g,B);if(Q==="box2i")return Uo(g,B);if(Q==="envmap")return Po(g,B);if(Q==="tiledesc")return Oo(g,B);if(Q==="lineOrder")return Go(g,B);if(Q==="float")return je(g,B);if(Q==="v2f")return Ho(g,B);if(Q==="v3f")return jo(g,B);if(Q==="int")return Ne(g,B);if(Q==="rational")return Nt(g,B);if(Q==="timecode")return is(g,B);if(Q==="preview")return B.value+=D,"skipped";B.value+=D}function zo(g,u){const B=Math.log2(g);return u=="ROUND_DOWN"?Math.floor(B):Math.ceil(B)}function Yo(g,u,B){let Q=0;switch(g.levelMode){case"ONE_LEVEL":Q=1;break;case"MIPMAP_LEVELS":Q=zo(Math.max(u,B),g.roundingMode)+1;break;case"RIPMAP_LEVELS":throw new Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.")}return Q}function yn(g,u,B,Q){const D=new Array(g);for(let v=0;v<g;v++){const k=1<<v;let L=u/k|0;Q=="ROUND_UP"&&L*k<u&&(L+=1);const F=Math.max(L,1);D[v]=(F+B-1)/B|0}return D}function Ko(){const g=this,u=g.offset,B={value:0};for(let Q=0;Q<g.tileCount;Q++){const D=Ne(g.viewer,u),v=Ne(g.viewer,u);u.value+=8,g.size=_e(g.viewer,u);const k=D*g.blockWidth,L=v*g.blockHeight;g.columns=k+g.blockWidth>g.width?g.width-k:g.blockWidth,g.lines=L+g.blockHeight>g.height?g.height-L:g.blockHeight;const F=g.columns*g.totalBytes,M=g.size<g.lines*F?g.uncompress(g):De(g);u.value+=g.size;for(let R=0;R<g.lines;R++){const G=R*g.columns*g.totalBytes;for(let U=0;U<g.inputChannels.length;U++){const q=Yt.channels[U].name,Z=g.channelByteOffsets[q]*g.columns,P=g.decodeChannels[q];if(P===void 0)continue;B.value=G+Z;const z=(g.height-(1+L+R))*g.outLineWidth;for(let te=0;te<g.columns;te++){const Ee=z+(te+k)*g.outputChannels+P;g.byteArray[Ee]=g.getter(M,B)}}}}}function Jo(){const g=this,u=g.offset,B={value:0};for(let Q=0;Q<g.height/g.blockHeight;Q++){const D=Ne(g.viewer,u)-Yt.dataWindow.yMin;g.size=_e(g.viewer,u),g.lines=D+g.blockHeight>g.height?g.height-D:g.blockHeight;const v=g.columns*g.totalBytes,k=g.size<g.lines*v?g.uncompress(g):De(g);u.value+=g.size;for(let L=0;L<g.blockHeight;L++){const F=Q*g.blockHeight,M=L+g.scanOrder(F);if(M>=g.height)continue;const R=L*v,G=(g.height-1-M)*g.outLineWidth;for(let U=0;U<g.inputChannels.length;U++){const q=Yt.channels[U].name,Z=g.channelByteOffsets[q]*g.columns,P=g.decodeChannels[q];if(P!==void 0){B.value=R+Z;for(let z=0;z<g.columns;z++){const te=G+z*g.outputChannels+P;g.byteArray[te]=g.getter(k,B)}}}}}}function Vo(g,u,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 D=g.getUint8(5);Q.spec={singleTile:!!(D&2),longName:!!(D&4),deepFormat:!!(D&8),multiPart:!!(D&16)},B.value=8;let v=!0;for(;v;){const k=ze(u,B);if(k==0)v=!1;else{const L=ze(u,B),F=_e(g,B),M=qo(g,u,B,L,F);M===void 0?console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${L}'.`):Q[k]=M}}if((D&-7)!=0)throw console.error("THREE.EXRHeader:",Q),new Error("THREE.EXRLoader: Provided file is currently unsupported.");return Q}function Wo(g,u,B,Q,D){const v={size:0,viewer:u,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":v.blockHeight=1,v.uncompress=De;break;case"RLE_COMPRESSION":v.blockHeight=1,v.uncompress=se;break;case"ZIPS_COMPRESSION":v.blockHeight=1,v.uncompress=oe;break;case"ZIP_COMPRESSION":v.blockHeight=16,v.uncompress=oe;break;case"PIZ_COMPRESSION":v.blockHeight=32,v.uncompress=Ae;break;case"PXR24_COMPRESSION":v.blockHeight=16,v.uncompress=Te;break;case"DWAA_COMPRESSION":v.blockHeight=32,v.uncompress=fe;break;case"DWAB_COMPRESSION":v.blockHeight=256,v.uncompress=fe;break;default:throw new Error("EXRLoader.parse: "+g.compression+" is unsupported")}const k={};for(const R of g.channels)switch(R.name){case"Y":case"R":case"G":case"B":case"A":k[R.name]=!0,v.type=R.pixelType}let L=!1;if(k.R&&k.G&&k.B)L=!k.A,v.outputChannels=4,v.decodeChannels={R:0,G:1,B:2,A:3};else if(k.Y)v.outputChannels=1,v.decodeChannels={Y:0};else throw new Error("EXRLoader.parse: file contains unsupported data channels.");if(v.type==1)switch(D){case ut:v.getter=_o;break;case Ze:v.getter=ds;break}else if(v.type==2)switch(D){case ut:v.getter=je;break;case Ze:v.getter=ko}else throw new Error("EXRLoader.parse: unsupported pixelType "+v.type+" for "+g.compression+".");v.columns=v.width;const F=v.width*v.height*v.outputChannels;switch(D){case ut:v.byteArray=new Float32Array(F),L&&v.byteArray.fill(1,0,F);break;case Ze:v.byteArray=new Uint16Array(F),L&&v.byteArray.fill(15360,0,F);break;default:console.error("THREE.EXRLoader: unsupported type: ",D);break}let M=0;for(const R of g.channels)v.decodeChannels[R.name]!==void 0&&(v.channelByteOffsets[R.name]=M),M+=R.pixelType*2;if(v.totalBytes=M,v.outLineWidth=v.width*v.outputChannels,g.lineOrder==="INCREASING_Y"?v.scanOrder=R=>R:v.scanOrder=R=>v.height-1-R,v.outputChannels==4?(v.format=Gt,v.colorSpace=We):(v.format=as,v.colorSpace=Vs),g.spec.singleTile){v.blockHeight=g.tiles.ySize,v.blockWidth=g.tiles.xSize;const R=Yo(g.tiles,v.width,v.height),G=yn(R,v.width,g.tiles.xSize,g.tiles.roundingMode),U=yn(R,v.height,g.tiles.ySize,g.tiles.roundingMode);v.tileCount=G[0]*U[0];for(let q=0;q<R;q++)for(let Z=0;Z<U[q];Z++)for(let P=0;P<G[q];P++)Ue(u,Q);v.decode=Ko.bind(v)}else{v.blockWidth=v.width;const R=Math.ceil(v.height/v.blockHeight);for(let G=0;G<R;G++)Ue(u,Q);v.decode=Jo.bind(v)}return v}const Qn={value:0},vn=new DataView(e),Xo=new Uint8Array(e),Yt=Vo(vn,e,Qn),ns=Wo(Yt,vn,Xo,Qn,this.type);return ns.decode(),{header:Yt,width:ns.width,height:ns.height,data:ns.byteArray,format:ns.format,colorSpace:ns.colorSpace,type:this.type}}setDataType(e){return this.type=e,this}load(e,t,i,s){function n(a,r){a.colorSpace=r.colorSpace,a.minFilter=at,a.magFilter=at,a.generateMipmaps=!1,a.flipY=!1,t&&t(a,r)}return super.load(e,n,i,s)}}const vc=Object.freeze(Object.defineProperty({__proto__:null,EXRLoader:Za},Symbol.toStringTag,{value:"Module"}));class $a extends Kn{constructor(e){super(e),this.type=Ze}parse(e){const t=function(m,I){switch(m){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||""))}},i=function(m,I,E){I=I||1024;let C=m.pos,y=-1,w=0,x="",T=String.fromCharCode.apply(null,new Uint16Array(m.subarray(C,C+128)));for(;0>(y=T.indexOf(`
|
|
33
|
+
`+this.flowCode[e])}}_addUniforms(){for(const e of Hs)for(const t of this.uniforms[e])this.shader.uniforms[t.name]=t}_updateUniforms(){et.object=this.object,et.renderer=this.renderer,et.material=this.material,et.scene=this.scene;for(const e of this.updateNodes)et.updateNode(e)}}const $n=new WeakMap;Kt.prototype.onBuild=function(o,e,t){const i=this;if(i.isNodeMaterial===!0){let s;try{s=new Pr(o,t,e,i).build(),$n.set(i,s)}catch(n){console.error("Material.prototype.onBuild: ",n)}}},Kt.prototype.onBeforeRender=function(o,e,t,i,s){const n=$n.get(this);if(n!==void 0){et.material=this,et.camera=t,et.object=s,et.renderer=o,et.scene=e,et.geometry=i;const a=n.updateNodes;if(a.length>0){o.state.useProgram(null);for(const r of a)et.updateNode(r)}}};var ws=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(),i(++o%e.children.length)},!1);function t(l){return e.appendChild(l.dom),l}function i(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(),n=s,a=0,r=t(new ws.Panel("FPS","#0ff","#002")),A=t(new ws.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=t(new ws.Panel("MB","#f08","#201"));return i(0),{REVISION:16,dom:e,addPanel:t,showPanel:i,begin:function(){s=(performance||Date).now()},end:function(){a++;var l=(performance||Date).now();if(A.update(l-s,200),l>=n+1e3&&(r.update(a*1e3/(l-n),100),n=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:i}};ws.Panel=function(o,e,t){var i=1/0,s=0,n=Math.round,a=n(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 m=b.getContext("2d");return m.font="bold "+9*a+"px Helvetica,Arial,sans-serif",m.textBaseline="top",m.fillStyle=t,m.fillRect(0,0,r,A),m.fillStyle=e,m.fillText(o,c,l),m.fillRect(h,d,p,f),m.fillStyle=t,m.globalAlpha=.9,m.fillRect(h,d,p,f),{dom:b,update:function(I,E){i=Math.min(i,I),s=Math.max(s,I),m.fillStyle=t,m.globalAlpha=1,m.fillRect(0,0,r,d),m.fillStyle=e,m.fillText(n(I)+" "+o+" ("+n(i)+"-"+n(s)+")",c,l),m.drawImage(b,h+a,d,p-a,f,h,d,p-a,f),m.fillRect(h+p-a,d,a,f),m.fillStyle=t,m.globalAlpha=.9,m.fillRect(h+p-a,d,a,n((1-I/E)*f))}}};function Or(o,e=1e-4){e=Math.max(e,Number.EPSILON);const t={},i=o.getIndex(),s=o.getAttribute("position"),n=i?i.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 E=0,C=r.length;E<C;E++){const y=r[E],w=o.attributes[y];A[y]=new w.constructor(new w.array.constructor(w.count*w.itemSize),w.itemSize,w.normalized);const x=o.morphAttributes[y];x&&(c[y]||(c[y]=[]),x.forEach((T,S)=>{const _=new T.array.constructor(T.count*T.itemSize);c[y][S]=new T.constructor(_,T.itemSize,T.normalized)}))}const p=e*.5,f=Math.log10(1/e),b=Math.pow(10,f),m=p*b;for(let E=0;E<n;E++){const C=i?i.getX(E):E;let y="";for(let w=0,x=r.length;w<x;w++){const T=r[w],S=o.getAttribute(T),_=S.itemSize;for(let Y=0;Y<_;Y++)y+=`${~~(S[h[Y]](C)*b+m)},`}if(y in t)l.push(t[y]);else{for(let w=0,x=r.length;w<x;w++){const T=r[w],S=o.getAttribute(T),_=o.morphAttributes[T],Y=S.itemSize,V=A[T],K=c[T];for(let W=0;W<Y;W++){const j=h[W],X=d[W];if(V[X](a,S[j](C)),_)for(let J=0,ee=_.length;J<ee;J++)K[J][X](a,_[J][j](C))}}t[y]=a,l.push(a),a++}}const I=o.clone();for(const E in o.attributes){const C=A[E];if(I.setAttribute(E,new C.constructor(C.array.slice(0,a*C.itemSize),C.itemSize,C.normalized)),E in c)for(let y=0;y<c[E].length;y++){const w=c[E][y];I.morphAttributes[E][y]=new w.constructor(w.array.slice(0,a*w.itemSize),w.itemSize,w.normalized)}}return I.setIndex(l),I}function ea(o,e){if(e===nr)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),o;if(e===di||e===xn){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 i=t.count-2,s=[];if(e===di)for(let a=1;a<=i;a++)s.push(t.getX(0)),s.push(t.getX(a)),s.push(t.getX(a+1));else for(let a=0;a<i;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!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const n=o.clone();return n.setIndex(s),n.clearGroups(),n}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),o}class _i extends Tt{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new Yr(t)}),this.register(function(t){return new Kr(t)}),this.register(function(t){return new sA(t)}),this.register(function(t){return new iA(t)}),this.register(function(t){return new nA(t)}),this.register(function(t){return new Vr(t)}),this.register(function(t){return new Wr(t)}),this.register(function(t){return new Xr(t)}),this.register(function(t){return new Zr(t)}),this.register(function(t){return new zr(t)}),this.register(function(t){return new $r(t)}),this.register(function(t){return new Jr(t)}),this.register(function(t){return new tA(t)}),this.register(function(t){return new eA(t)}),this.register(function(t){return new jr(t)}),this.register(function(t){return new aA(t)}),this.register(function(t){return new oA(t)})}load(e,t,i,s){const n=this;let a;if(this.resourcePath!=="")a=this.resourcePath;else if(this.path!==""){const c=Jt.extractUrlBase(e);a=Jt.resolveURL(c,this.path)}else a=Jt.extractUrlBase(e);this.manager.itemStart(e);const r=function(c){s?s(c):console.error(c),n.manager.itemError(e),n.manager.itemEnd(e)},A=new dt(this.manager);A.setPath(this.path),A.setResponseType("arraybuffer"),A.setRequestHeader(this.requestHeader),A.setWithCredentials(this.withCredentials),A.load(e,function(c){try{n.parse(c,a,function(l){t(l),n.manager.itemEnd(e)},r)}catch(l){r(l)}},i,r)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,i,s){let n,a;const r={},A={},c=new TextDecoder;if(typeof e=="string")try{n=JSON.parse(e)}catch(h){a=e,s&&s(h);return}else if(e instanceof ArrayBuffer)if(c.decode(new Uint8Array(e,0,4))===ta){try{r[ne.KHR_BINARY_GLTF]=new rA(e)}catch(h){s&&s(h);return}try{n=JSON.parse(r[ne.KHR_BINARY_GLTF].content)}catch(h){a=r[ne.KHR_BINARY_GLTF].content,s&&s(h);return}}else try{n=JSON.parse(c.decode(e))}catch(h){a=c.decode(e),s&&s(h);return}else n=e;if(n.asset===void 0||n.asset.version[0]<2){s&&s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}this.json=n,this.jsonErrorData=a;const l=new EA(n,{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(n.extensionsUsed)for(let h=0;h<n.extensionsUsed.length;++h){const d=n.extensionsUsed[h],p=n.extensionsRequired||[];switch(d){case ne.KHR_MATERIALS_UNLIT:r[d]=new qr;break;case ne.KHR_DRACO_MESH_COMPRESSION:r[d]=new AA(n,this.dracoLoader);break;case ne.KHR_TEXTURE_TRANSFORM:r[d]=new cA;break;case ne.KHR_MESH_QUANTIZATION:r[d]=new lA;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(i,s)}parseAsync(e,t){const i=this;return new Promise(function(s,n){i.parse(e,t,s,n)})}}function Hr(){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 jr{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 i=0,s=t.length;i<s;i++){const n=t[i];n.extensions&&n.extensions[this.name]&&n.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,n.extensions[this.name].light)}}_loadLight(e){const t=this.parser,i="light:"+e;let s=t.cache.get(i);if(s)return s;const n=t.json,a=((n.extensions&&n.extensions[this.name]||{}).lights||[])[e];let r;const A=new we(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 Tn(A),r.target.position.set(0,0,-1),r.add(r.target);break;case"point":r=new pi(A),r.distance=c;break;case"spot":r=new Sn(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,kt(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(i,s),s}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,i=this.parser,s=i.json.nodes[e],n=(s.extensions&&s.extensions[this.name]||{}).light;return n===void 0?null:this._loadLight(n).then(function(a){return i._getNodeRef(t.cache,n,a)})}}let qr=class{constructor(){this.name=ne.KHR_MATERIALS_UNLIT}getMaterialType(){return It}extendParams(o,e,t){const i=[];o.color=new we(1,1,1),o.opacity=1;const s=e.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const n=s.baseColorFactor;o.color.setRGB(n[0],n[1],n[2],We),o.opacity=n[3]}s.baseColorTexture!==void 0&&i.push(t.assignTexture(o,"map",s.baseColorTexture,le))}return Promise.all(i)}},zr=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 i=t.extensions[this.name].emissiveStrength;return i!==void 0&&(e.emissiveIntensity=i),Promise.resolve()}},Yr=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,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];if(n.clearcoatFactor!==void 0&&(e.clearcoat=n.clearcoatFactor),n.clearcoatTexture!==void 0&&s.push(t.assignTexture(e,"clearcoatMap",n.clearcoatTexture)),n.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=n.clearcoatRoughnessFactor),n.clearcoatRoughnessTexture!==void 0&&s.push(t.assignTexture(e,"clearcoatRoughnessMap",n.clearcoatRoughnessTexture)),n.clearcoatNormalTexture!==void 0&&(s.push(t.assignTexture(e,"clearcoatNormalMap",n.clearcoatNormalTexture)),n.clearcoatNormalTexture.scale!==void 0)){const a=n.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new Le(a,a)}return Promise.all(s)}},Kr=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 i=t.extensions[this.name];return e.dispersion=i.dispersion!==void 0?i.dispersion:0,Promise.resolve()}},Jr=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,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];return n.iridescenceFactor!==void 0&&(e.iridescence=n.iridescenceFactor),n.iridescenceTexture!==void 0&&s.push(t.assignTexture(e,"iridescenceMap",n.iridescenceTexture)),n.iridescenceIor!==void 0&&(e.iridescenceIOR=n.iridescenceIor),e.iridescenceThicknessRange===void 0&&(e.iridescenceThicknessRange=[100,400]),n.iridescenceThicknessMinimum!==void 0&&(e.iridescenceThicknessRange[0]=n.iridescenceThicknessMinimum),n.iridescenceThicknessMaximum!==void 0&&(e.iridescenceThicknessRange[1]=n.iridescenceThicknessMaximum),n.iridescenceThicknessTexture!==void 0&&s.push(t.assignTexture(e,"iridescenceThicknessMap",n.iridescenceThicknessTexture)),Promise.all(s)}},Vr=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,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[];e.sheenColor=new we(0,0,0),e.sheenRoughness=0,e.sheen=1;const n=i.extensions[this.name];if(n.sheenColorFactor!==void 0){const a=n.sheenColorFactor;e.sheenColor.setRGB(a[0],a[1],a[2],We)}return n.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=n.sheenRoughnessFactor),n.sheenColorTexture!==void 0&&s.push(t.assignTexture(e,"sheenColorMap",n.sheenColorTexture,le)),n.sheenRoughnessTexture!==void 0&&s.push(t.assignTexture(e,"sheenRoughnessMap",n.sheenRoughnessTexture)),Promise.all(s)}},Wr=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,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];return n.transmissionFactor!==void 0&&(e.transmission=n.transmissionFactor),n.transmissionTexture!==void 0&&s.push(t.assignTexture(e,"transmissionMap",n.transmissionTexture)),Promise.all(s)}},Xr=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,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];e.thickness=n.thicknessFactor!==void 0?n.thicknessFactor:0,n.thicknessTexture!==void 0&&s.push(t.assignTexture(e,"thicknessMap",n.thicknessTexture)),e.attenuationDistance=n.attenuationDistance||1/0;const a=n.attenuationColor||[1,1,1];return e.attenuationColor=new we().setRGB(a[0],a[1],a[2],We),Promise.all(s)}},Zr=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 i=t.extensions[this.name];return e.ior=i.ior!==void 0?i.ior:1.5,Promise.resolve()}},$r=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,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];e.specularIntensity=n.specularFactor!==void 0?n.specularFactor:1,n.specularTexture!==void 0&&s.push(t.assignTexture(e,"specularIntensityMap",n.specularTexture));const a=n.specularColorFactor||[1,1,1];return e.specularColor=new we().setRGB(a[0],a[1],a[2],We),n.specularColorTexture!==void 0&&s.push(t.assignTexture(e,"specularColorMap",n.specularColorTexture,le)),Promise.all(s)}},eA=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,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];return e.bumpScale=n.bumpFactor!==void 0?n.bumpFactor:1,n.bumpTexture!==void 0&&s.push(t.assignTexture(e,"bumpMap",n.bumpTexture)),Promise.all(s)}},tA=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,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];return n.anisotropyStrength!==void 0&&(e.anisotropy=n.anisotropyStrength),n.anisotropyRotation!==void 0&&(e.anisotropyRotation=n.anisotropyRotation),n.anisotropyTexture!==void 0&&s.push(t.assignTexture(e,"anisotropyMap",n.anisotropyTexture)),Promise.all(s)}};class sA{constructor(e){this.parser=e,this.name=ne.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,i=t.json,s=i.textures[e];if(!s.extensions||!s.extensions[this.name])return null;const n=s.extensions[this.name],a=t.options.ktx2Loader;if(!a){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,n.source,a)}}class iA{constructor(e){this.parser=e,this.name=ne.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,s=i.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;const a=n.extensions[t],r=s.images[a.source];let A=i.textureLoader;if(r.uri){const c=i.options.manager.getHandler(r.uri);c!==null&&(A=c)}return this.detectSupport().then(function(c){if(c)return i.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 i.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 nA{constructor(e){this.parser=e,this.name=ne.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,s=i.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;const a=n.extensions[t],r=s.images[a.source];let A=i.textureLoader;if(r.uri){const c=i.options.manager.getHandler(r.uri);c!==null&&(A=c)}return this.detectSupport().then(function(c){if(c)return i.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 i.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 aA{constructor(e){this.name=ne.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const s=i.extensions[this.name],n=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 n.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 oA=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 i=e.meshes[t.mesh];for(const r of i.primitives)if(r.mode!==lt.TRIANGLES&&r.mode!==lt.TRIANGLE_STRIP&&r.mode!==lt.TRIANGLE_FAN&&r.mode!==void 0)return null;const s=t.extensions[this.name].attributes,n=[],a={};for(const r in s)n.push(this.parser.getDependency("accessor",s[r]).then(A=>(a[r]=A,a[r])));return n.length<1?null:(n.push(this.parser.createNodeMesh(o)),Promise.all(n).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 ce,f=new N,b=new ye,m=new N(1,1,1),I=new ar(d.geometry,d.material,l);for(let E=0;E<l;E++)a.TRANSLATION&&f.fromBufferAttribute(a.TRANSLATION,E),a.ROTATION&&b.fromBufferAttribute(a.ROTATION,E),a.SCALE&&m.fromBufferAttribute(a.SCALE,E),I.setMatrixAt(E,p.compose(f,b,m));for(const E in a)if(E==="_COLOR_0"){const C=a[E];I.instanceColor=new or(C.array,C.itemSize,C.normalized)}else E!=="TRANSLATION"&&E!=="ROTATION"&&E!=="SCALE"&&d.geometry.setAttribute(E,a[E]);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 ta="glTF",ys=12,sa={JSON:1313821514,BIN:5130562};class rA{constructor(e){this.name=ne.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,ys),i=new TextDecoder;if(this.header={magic:i.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==ta)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-ys,n=new DataView(e,ys);let a=0;for(;a<s;){const r=n.getUint32(a,!0);a+=4;const A=n.getUint32(a,!0);if(a+=4,A===sa.JSON){const c=new Uint8Array(e,ys+a,r);this.content=i.decode(c)}else if(A===sa.BIN){const c=ys+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 i=this.json,s=this.dracoLoader,n=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,r={},A={},c={};for(const l in a){const h=Li[l]||l.toLowerCase();r[h]=a[l]}for(const l in e.attributes){const h=Li[l]||l.toLowerCase();if(a[l]!==void 0){const d=i.accessors[e.attributes[l]],p=cs[d.componentType];c[h]=p.name,A[h]=d.normalized===!0}}return t.getDependency("bufferView",n).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],m=A[f];m!==void 0&&(b.normalized=m)}h(p)},r,c,We,d)})})}}class cA{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 lA{constructor(){this.name=ne.KHR_MESH_QUANTIZATION}}class ia extends lr{constructor(e,t,i,s){super(e,t,i,s)}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,s=this.valueSize,n=e*s*3+s;for(let a=0;a!==s;a++)t[a]=i[n+a];return t}interpolate_(e,t,i,s){const n=this.resultBuffer,a=this.sampleValues,r=this.valueSize,A=r*2,c=r*3,l=s-t,h=(i-t)/l,d=h*h,p=d*h,f=e*c,b=f-c,m=-2*p+3*d,I=p-d,E=1-m,C=I-d+h;for(let y=0;y!==r;y++){const w=a[b+y+r],x=a[b+y+A]*l,T=a[f+y+r],S=a[f+y]*l;n[y]=E*w+C*x+m*T+I*S}return n}}const hA=new ye;class gA extends ia{interpolate_(e,t,i,s){const n=super.interpolate_(e,t,i,s);return hA.fromArray(n).normalize().toArray(n),n}}const lt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},cs={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},na={9728:js,9729:at,9984:fi,9985:Dn,9986:Rn,9987:fs},aa={33071:qs,33648:Mn,10497:Vt},Fi={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Li={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"},Ht={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},dA={CUBICSPLINE:void 0,LINEAR:Ei,STEP:Nn},Ni={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function pA(o){return o.DefaultMaterial===void 0&&(o.DefaultMaterial=new mi({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Un})),o.DefaultMaterial}function Zt(o,e,t){for(const i in t.extensions)o[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function kt(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 uA(o,e,t){let i=!1,s=!1,n=!1;for(let c=0,l=e.length;c<l;c++){const h=e[c];if(h.POSITION!==void 0&&(i=!0),h.NORMAL!==void 0&&(s=!0),h.COLOR_0!==void 0&&(n=!0),i&&s&&n)break}if(!i&&!s&&!n)return Promise.resolve(o);const a=[],r=[],A=[];for(let c=0,l=e.length;c<l;c++){const h=e[c];if(i){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(n){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 i&&(o.morphAttributes.position=l),s&&(o.morphAttributes.normal=h),n&&(o.morphAttributes.color=d),o.morphTargetsRelative=!0,o})}function fA(o,e){if(o.updateMorphTargets(),e.weights!==void 0)for(let t=0,i=e.weights.length;t<i;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 i=0,s=t.length;i<s;i++)o.morphTargetDictionary[t[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function mA(o){let e;const t=o.extensions&&o.extensions[ne.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+Ui(t.attributes):e=o.indices+":"+Ui(o.attributes)+":"+o.mode,o.targets!==void 0)for(let i=0,s=o.targets.length;i<s;i++)e+=":"+Ui(o.targets[i]);return e}function Ui(o){let e="";const t=Object.keys(o).sort();for(let i=0,s=t.length;i<s;i++)e+=t[i]+":"+o[t[i]]+";";return e}function Gi(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 bA(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 IA=new ce;class EA{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Hr,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,s=-1,n=!1,a=-1;if(typeof navigator<"u"){const r=navigator.userAgent;i=/^((?!chrome|android).)*safari/i.test(r)===!0;const A=r.match(/Version\/(\d+)/);s=i&&A?parseInt(A[1],10):-1,n=r.indexOf("Firefox")>-1,a=n?r.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&s<17||n&&a<98?this.textureLoader=new ui(this.options.manager):this.textureLoader=new rr(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new dt(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,s=this.json,n=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([i.getDependencies("scene"),i.getDependencies("animation"),i.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:i,userData:{}};return Zt(n,r,s),kt(r,s),Promise.all(i._invokeAll(function(A){return A.afterRoot&&A.afterRoot(r)})).then(function(){for(const A of r.scenes)A.updateMatrixWorld();e(r)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let s=0,n=t.length;s<n;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,n=e.length;s<n;s++){const a=e[s];a.mesh!==void 0&&(this._addNodeRef(this.meshCache,a.mesh),a.skin!==void 0&&(i[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,i){if(e.refs[t]<=1)return i;const s=i.clone(),n=(a,r)=>{const A=this.associations.get(a);A!=null&&this.associations.set(r,A);for(const[c,l]of a.children.entries())n(l,r.children[c])};return n(i,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){const s=e(t[i]);if(s)return s}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const i=[];for(let s=0;s<t.length;s++){const n=e(t[s]);n&&i.push(n)}return i}getDependency(e,t){const i=e+":"+t;let s=this.cache.get(i);if(!s){switch(e){case"scene":s=this.loadScene(t);break;case"node":s=this._invokeOne(function(n){return n.loadNode&&n.loadNode(t)});break;case"mesh":s=this._invokeOne(function(n){return n.loadMesh&&n.loadMesh(t)});break;case"accessor":s=this.loadAccessor(t);break;case"bufferView":s=this._invokeOne(function(n){return n.loadBufferView&&n.loadBufferView(t)});break;case"buffer":s=this.loadBuffer(t);break;case"material":s=this._invokeOne(function(n){return n.loadMaterial&&n.loadMaterial(t)});break;case"texture":s=this._invokeOne(function(n){return n.loadTexture&&n.loadTexture(t)});break;case"skin":s=this.loadSkin(t);break;case"animation":s=this._invokeOne(function(n){return n.loadAnimation&&n.loadAnimation(t)});break;case"camera":s=this.loadCamera(t);break;default:if(s=this._invokeOne(function(n){return n!=this&&n.getDependency&&n.getDependency(e,t)}),!s)throw new Error("Unknown type: "+e);break}this.cache.add(i,s)}return s}getDependencies(e){let t=this.cache.get(e);if(!t){const i=this,s=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(s.map(function(n,a){return i.getDependency(e,a)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],i=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[ne.KHR_BINARY_GLTF].body);const s=this.options;return new Promise(function(n,a){i.load(Jt.resolveURL(t.uri,s.path),n,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(i){const s=t.byteLength||0,n=t.byteOffset||0;return i.slice(n,n+s)})}loadAccessor(e){const t=this,i=this.json,s=this.json.accessors[e];if(s.bufferView===void 0&&s.sparse===void 0){const a=Fi[s.type],r=cs[s.componentType],A=s.normalized===!0,c=new r(s.count*a);return Promise.resolve(new nt(c,a,A))}const n=[];return s.bufferView!==void 0?n.push(this.getDependency("bufferView",s.bufferView)):n.push(null),s.sparse!==void 0&&(n.push(this.getDependency("bufferView",s.sparse.indices.bufferView)),n.push(this.getDependency("bufferView",s.sparse.values.bufferView))),Promise.all(n).then(function(a){const r=a[0],A=Fi[s.type],c=cs[s.componentType],l=c.BYTES_PER_ELEMENT,h=l*A,d=s.byteOffset||0,p=s.bufferView!==void 0?i.bufferViews[s.bufferView].byteStride:void 0,f=s.normalized===!0;let b,m;if(p&&p!==h){const I=Math.floor(d/p),E="InterleavedBuffer:"+s.bufferView+":"+s.componentType+":"+I+":"+s.count;let C=t.cache.get(E);C||(b=new c(r,I*p,s.count*p/l),C=new Ar(b,p/l),t.cache.add(E,C)),m=new Xt(C,A,d%p/l,f)}else r===null?b=new c(s.count*A):b=new c(r,d,s.count*A),m=new nt(b,A,f);if(s.sparse!==void 0){const I=Fi.SCALAR,E=cs[s.sparse.indices.componentType],C=s.sparse.indices.byteOffset||0,y=s.sparse.values.byteOffset||0,w=new E(a[1],C,s.sparse.count*I),x=new c(a[2],y,s.sparse.count*A);r!==null&&(m=new nt(m.array.slice(),m.itemSize,m.normalized)),m.normalized=!1;for(let T=0,S=w.length;T<S;T++){const _=w[T];if(m.setX(_,x[T*A]),A>=2&&m.setY(_,x[T*A+1]),A>=3&&m.setZ(_,x[T*A+2]),A>=4&&m.setW(_,x[T*A+3]),A>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}m.normalized=f}return m})}loadTexture(e){const t=this.json,i=this.options,s=t.textures[e].source,n=t.images[s];let a=this.textureLoader;if(n.uri){const r=i.manager.getHandler(n.uri);r!==null&&(a=r)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,i){const s=this,n=this.json,a=n.textures[e],r=n.images[t],A=(r.uri||r.bufferView)+":"+a.sampler;if(this.textureCache[A])return this.textureCache[A];const c=this.loadImageSource(t,i).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=(n.samplers||{})[a.sampler]||{};return l.magFilter=na[h.magFilter]||at,l.minFilter=na[h.minFilter]||fs,l.wrapS=aa[h.wrapS]||Vt,l.wrapT=aa[h.wrapT]||Vt,l.anisotropy=4,s.associations.set(l,{textures:e}),l}).catch(function(){return null});return this.textureCache[A]=c,c}loadImageSource(e,t){const i=this,s=this.json,n=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=i.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 m=new Ci(b);m.needsUpdate=!0,d(m)}),t.load(Jt.resolveURL(h,n.path),f,void 0,p)})}).then(function(h){return c===!0&&r.revokeObjectURL(A),kt(h,a),h.userData.mimeType=a.mimeType||bA(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,i,s){const n=this;return this.getDependency("texture",i.index).then(function(a){if(!a)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(a=a.clone(),a.channel=i.texCoord),n.extensions[ne.KHR_TEXTURE_TRANSFORM]){const r=i.extensions!==void 0?i.extensions[ne.KHR_TEXTURE_TRANSFORM]:void 0;if(r){const A=n.associations.get(a);a=n.extensions[ne.KHR_TEXTURE_TRANSFORM].extendTexture(a,r),n.associations.set(a,A)}}return s!==void 0&&(a.colorSpace=s),e[t]=a,a})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const s=t.attributes.tangent===void 0,n=t.attributes.color!==void 0,a=t.attributes.normal===void 0;if(e.isPoints){const r="PointsMaterial:"+i.uuid;let A=this.cache.get(r);A||(A=new ms,Kt.prototype.copy.call(A,i),A.color.copy(i.color),A.map=i.map,A.sizeAttenuation=!1,this.cache.add(r,A)),i=A}else if(e.isLine){const r="LineBasicMaterial:"+i.uuid;let A=this.cache.get(r);A||(A=new Rt,Kt.prototype.copy.call(A,i),A.color.copy(i.color),A.map=i.map,this.cache.add(r,A)),i=A}if(s||n||a){let r="ClonedMaterial:"+i.uuid+":";s&&(r+="derivative-tangents:"),n&&(r+="vertex-colors:"),a&&(r+="flat-shading:");let A=this.cache.get(r);A||(A=i.clone(),n&&(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(i))),i=A}e.material=i}getMaterialType(){return mi}loadMaterial(e){const t=this,i=this.json,s=this.extensions,n=i.materials[e];let a;const r={},A=n.extensions||{},c=[];if(A[ne.KHR_MATERIALS_UNLIT]){const h=s[ne.KHR_MATERIALS_UNLIT];a=h.getMaterialType(),c.push(h.extendParams(r,n,t))}else{const h=n.pbrMetallicRoughness||{};if(r.color=new we(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,le)),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)})))}n.doubleSided===!0&&(r.side=bi);const l=n.alphaMode||Ni.OPAQUE;if(l===Ni.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,l===Ni.MASK&&(r.alphaTest=n.alphaCutoff!==void 0?n.alphaCutoff:.5)),n.normalTexture!==void 0&&a!==It&&(c.push(t.assignTexture(r,"normalMap",n.normalTexture)),r.normalScale=new Le(1,1),n.normalTexture.scale!==void 0)){const h=n.normalTexture.scale;r.normalScale.set(h,h)}if(n.occlusionTexture!==void 0&&a!==It&&(c.push(t.assignTexture(r,"aoMap",n.occlusionTexture)),n.occlusionTexture.strength!==void 0&&(r.aoMapIntensity=n.occlusionTexture.strength)),n.emissiveFactor!==void 0&&a!==It){const h=n.emissiveFactor;r.emissive=new we().setRGB(h[0],h[1],h[2],We)}return n.emissiveTexture!==void 0&&a!==It&&c.push(t.assignTexture(r,"emissiveMap",n.emissiveTexture,le)),Promise.all(c).then(function(){const h=new a(r);return n.name&&(h.name=n.name),kt(h,n),t.associations.set(h,{materials:e}),n.extensions&&Zt(s,h,n),h})}createUniqueName(e){const t=Dt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,s=this.primitiveCache;function n(r){return i[ne.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(r,t).then(function(A){return oa(A,r,t)})}const a=[];for(let r=0,A=e.length;r<A;r++){const c=e[r],l=mA(c),h=s[l];if(h)a.push(h.promise);else{let d;c.extensions&&c.extensions[ne.KHR_DRACO_MESH_COMPRESSION]?d=n(c):d=oa(new ct,c,t),s[l]={primitive:c,promise:d},a.push(d)}}return Promise.all(a)}loadMesh(e){const t=this,i=this.json,s=this.extensions,n=i.meshes[e],a=n.primitives,r=[];for(let A=0,c=a.length;A<c;A++){const l=a[A].material===void 0?pA(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],m=a[p];let I;const E=c[p];if(m.mode===lt.TRIANGLES||m.mode===lt.TRIANGLE_STRIP||m.mode===lt.TRIANGLE_FAN||m.mode===void 0)I=n.isSkinnedMesh===!0?new kn(b,E):new O(b,E),I.isSkinnedMesh===!0&&I.normalizeSkinWeights(),m.mode===lt.TRIANGLE_STRIP?I.geometry=ea(I.geometry,xn):m.mode===lt.TRIANGLE_FAN&&(I.geometry=ea(I.geometry,di));else if(m.mode===lt.LINES)I=new zs(b,E);else if(m.mode===lt.LINE_STRIP)I=new pt(b,E);else if(m.mode===lt.LINE_LOOP)I=new cr(b,E);else if(m.mode===lt.POINTS)I=new Ys(b,E);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(I.geometry.morphAttributes).length>0&&fA(I,n),I.name=t.createUniqueName(n.name||"mesh_"+e),kt(I,n),m.extensions&&Zt(s,I,m),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 n.extensions&&Zt(s,h[0],n),h[0];const d=new Wt;n.extensions&&Zt(s,d,n),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 i=this.json.cameras[e],s=i[i.type];if(!s){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?t=new Os(Ce.radToDeg(s.yfov),s.aspectRatio||1,s.znear||1,s.zfar||2e6):i.type==="orthographic"&&(t=new _n(-s.xmag,s.xmag,s.ymag,-s.ymag,s.znear,s.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),kt(t,i),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],i=[];for(let s=0,n=t.joints.length;s<n;s++)i.push(this._loadNodeShallow(t.joints[s]));return t.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",t.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(s){const n=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 ce;n!==null&&d.fromArray(n.array,c*16),A.push(d)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[c])}return new Fn(r,A)})}loadAnimation(e){const t=this.json,i=this,s=t.animations[e],n=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,m=b.node,I=s.parameters!==void 0?s.parameters[f.input]:f.input,E=s.parameters!==void 0?s.parameters[f.output]:f.output;b.node!==void 0&&(a.push(this.getDependency("node",m)),r.push(this.getDependency("accessor",I)),A.push(this.getDependency("accessor",E)),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],m=p[2],I=p[3],E=p[4],C=[];for(h=0,d=f.length;h<d;h++){const y=f[h],w=b[h],x=m[h],T=I[h],S=E[h];if(y===void 0)continue;y.updateMatrix&&y.updateMatrix();const _=i._createAnimationTracks(y,w,x,T,S);if(_)for(let Y=0;Y<_.length;Y++)C.push(_[Y])}return new Ln(n,void 0,C)})}createNodeMesh(e){const t=this.json,i=this,s=t.nodes[e];return s.mesh===void 0?null:i.getDependency("mesh",s.mesh).then(function(n){const a=i._getNodeRef(i.meshCache,s.mesh,n);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,i=this,s=t.nodes[e],n=i._loadNodeShallow(e),a=[],r=s.children||[];for(let c=0,l=r.length;c<l;c++)a.push(i.getDependency("node",r[c]));const A=s.skin===void 0?Promise.resolve(null):i.getDependency("skin",s.skin);return Promise.all([n,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,IA)});for(let p=0,f=h.length;p<f;p++)l.add(h[p]);return l})}_loadNodeShallow(e){const t=this.json,i=this.extensions,s=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const n=t.nodes[e],a=n.name?s.createUniqueName(n.name):"",r=[],A=s._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});return A&&r.push(A),n.camera!==void 0&&r.push(s.getDependency("camera",n.camera).then(function(c){return s._getNodeRef(s.cameraCache,n.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(n.isBone===!0?l=new Ii:c.length>1?l=new Wt: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(n.name&&(l.userData.name=n.name,l.name=a),kt(l,n),n.extensions&&Zt(i,l,n),n.matrix!==void 0){const h=new ce;h.fromArray(n.matrix),l.applyMatrix4(h)}else n.translation!==void 0&&l.position.fromArray(n.translation),n.rotation!==void 0&&l.quaternion.fromArray(n.rotation),n.scale!==void 0&&l.scale.fromArray(n.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,i=this.json.scenes[e],s=this,n=new Wt;i.name&&(n.name=s.createUniqueName(i.name)),kt(n,i),i.extensions&&Zt(t,n,i);const a=i.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++)n.add(A[l]);const c=l=>{const h=new Map;for(const[d,p]of s.associations)(d instanceof Kt||d instanceof Ci)&&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(n),n})}_createAnimationTracks(e,t,i,s,n){const a=[],r=e.name?e.name:e.uuid,A=[];Ht[n.path]===Ht.weights?e.traverse(function(d){d.morphTargetInfluences&&A.push(d.name?d.name:d.uuid)}):A.push(r);let c;switch(Ht[n.path]){case Ht.weights:c=wi;break;case Ht.rotation:c=yi;break;case Ht.position:case Ht.scale:c=Bi;break;default:i.itemSize===1?c=wi:c=Bi;break}const l=s.interpolation!==void 0?dA[s.interpolation]:Ei,h=this._getArrayFromAccessor(i);for(let d=0,p=A.length;d<p;d++){const f=new c(A[d]+"."+Ht[n.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 i=Gi(t.constructor),s=new Float32Array(t.length);for(let n=0,a=t.length;n<a;n++)s[n]=t[n]*i;t=s}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(t){const i=this instanceof yi?gA:ia;return new i(this.times,this.values,this.getValueSize()/3,t)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function CA(o,e,t){const i=e.attributes,s=new Ks;if(i.POSITION!==void 0){const r=t.json.accessors[i.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=Gi(cs[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 n=e.targets;if(n!==void 0){const r=new N,A=new N;for(let c=0,l=n.length;c<l;c++){const h=n[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=Gi(cs[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 Qi;s.getCenter(a.center),a.radius=s.min.distanceTo(s.max)/2,o.boundingSphere=a}function oa(o,e,t){const i=e.attributes,s=[];function n(a,r){return t.getDependency("accessor",a).then(function(A){o.setAttribute(r,A)})}for(const a in i){const r=Li[a]||a.toLowerCase();r in o.attributes||s.push(n(i[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 i&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Xe.workingColorSpace}" not supported.`),kt(o,e),CA(o,e,t),Promise.all(s).then(function(){return e.targets!==void 0?uA(o,e.targets,t):o})}var BA=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]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var s=WebAssembly.validate(t)?e:o,n,a=WebAssembly.instantiate(r(s),{}).then(function(I){n=I.instance,n.exports.__wasm_call_ctors()});function r(I){for(var E=new Uint8Array(I.length),C=0;C<I.length;++C){var y=I.charCodeAt(C);E[C]=y>96?y-97:y>64?y-39:y+4}for(var w=0,C=0;C<I.length;++C)E[w++]=E[C]<60?i[E[C]]:(E[C]-60)*64+E[++C];return E.buffer.slice(0,w)}function A(I,E,C,y,w,x){var T=n.exports.sbrk,S=C+3&-4,_=T(S*y),Y=T(w.length),V=new Uint8Array(n.exports.memory.buffer);V.set(w,Y);var K=I(_,C,y,Y,w.length);if(K==0&&x&&x(_,S,y),E.set(V.subarray(_,_+C*y)),T(_-T(0)),K!=0)throw new Error("Malformed buffer data: "+K)}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 E={object:new Worker(I),pending:0,requests:{}};return E.object.onmessage=function(C){var y=C.data;E.pending-=y.count,E.requests[y.id][y.action](y.value),delete E.requests[y.id]},E}function f(I){for(var E="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()+m.toString(),C=new Blob([E],{type:"text/javascript"}),y=URL.createObjectURL(C),w=0;w<I;++w)h[w]=p(y);URL.revokeObjectURL(y)}function b(I,E,C,y,w){for(var x=h[0],T=1;T<h.length;++T)h[T].pending<x.pending&&(x=h[T]);return new Promise(function(S,_){var Y=new Uint8Array(C),V=d++;x.pending+=I,x.requests[V]={resolve:S,reject:_},x.object.postMessage({id:V,count:I,size:E,source:Y,mode:y,filter:w},[Y.buffer])})}function m(I){a.then(function(){var E=I.data;try{var C=new Uint8Array(E.count*E.size);A(n.exports[E.mode],C,E.count,E.size,E.source,n.exports[E.filter]),self.postMessage({id:E.id,count:E.count,action:"resolve",value:C},[C.buffer])}catch(y){self.postMessage({id:E.id,count:E.count,action:"reject",value:y})}})}return{ready:a,supported:!0,useWorkers:function(I){f(I)},decodeVertexBuffer:function(I,E,C,y,w){A(n.exports.meshopt_decodeVertexBuffer,I,E,C,y,n.exports[c[w]])},decodeIndexBuffer:function(I,E,C,y){A(n.exports.meshopt_decodeIndexBuffer,I,E,C,y)},decodeIndexSequence:function(I,E,C,y){A(n.exports.meshopt_decodeIndexSequence,I,E,C,y)},decodeGltfBuffer:function(I,E,C,y,w,x){A(n.exports[l[w]],I,E,C,y,n.exports[c[x]])},decodeGltfBufferAsync:function(I,E,C,y,w){return h.length>0?b(I,E,C,l[y],c[w]):a.then(function(){var x=new Uint8Array(I*E);return A(n.exports[l[y]],x,I,E,C,n.exports[c[w]]),x})}}}();const Pi=new WeakMap;class wA extends Tt{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,i,s){const n=new dt(this.manager);n.setPath(this.path),n.setResponseType("arraybuffer"),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials),n.load(e,a=>{this.parse(a,t,s)},i,s)}parse(e,t,i=()=>{}){this.decodeDracoFile(e,t,null,null,le,i).catch(i)}decodeDracoFile(e,t,i,s,n=We,a=()=>{}){const r={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!i,vertexColorSpace:n};return this.decodeGeometry(e,r).then(t).catch(a)}decodeGeometry(e,t){const i=JSON.stringify(t);if(Pi.has(e)){const A=Pi.get(e);if(A.key===i)return A.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let s;const n=this.workerNextTaskID++,a=e.byteLength,r=this._getWorker(n,a).then(A=>(s=A,new Promise((c,l)=>{s._callbacks[n]={resolve:c,reject:l},s.postMessage({type:"decode",id:n,taskConfig:t,buffer:e},[e])}))).then(A=>this._createGeometry(A.geometry));return r.catch(()=>!0).then(()=>{s&&n&&this._releaseTask(s,n)}),Pi.set(e,{key:i,promise:r}),r}_createGeometry(e){const t=new ct;e.index&&t.setIndex(new nt(e.index.array,1));for(let i=0;i<e.attributes.length;i++){const s=e.attributes[i],n=s.name,a=s.array,r=s.itemSize,A=new nt(a,r);n==="color"&&(this._assignVertexColorSpace(A,s.vertexColorSpace),A.normalized=!(a instanceof Float32Array)),t.setAttribute(n,A)}return t}_assignVertexColorSpace(e,t){if(t!==le)return;const i=new we;for(let s=0,n=e.count;s<n;s++)i.fromBufferAttribute(e,s),Xe.toWorkingColorSpace(i,le),e.setXYZ(s,i.r,i.g,i.b)}_loadLibrary(e,t){const i=new dt(this.manager);return i.setPath(this.decoderPath),i.setResponseType(t),i.setWithCredentials(this.withCredentials),new Promise((s,n)=>{i.load(e,s,void 0,n)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(i=>{const s=i[0];e||(this.decoderConfig.wasmBinary=i[1]);const n=yA.toString(),a=["/* draco decoder */",s,"","/* worker */",n.substring(n.indexOf("{")+1,n.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(n){const a=n.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,n){return s._taskLoad>n._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function yA(){let 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 m in l){const I=self[h[m]];let E,C;if(c.useUniqueIDs)C=l[m],E=r.GetAttributeByUniqueId(d,C);else{if(C=r.GetAttributeId(d,a[l[m]]),C===-1)continue;E=r.GetAttribute(d,C)}const y=s(a,r,d,m,I,E);m==="color"&&(y.vertexColorSpace=c.vertexColorSpace),b.attributes.push(y)}return f===a.TRIANGULAR_MESH&&(b.index=i(a,r,d)),a.destroy(d),b}function i(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=n(a,l),m=a._malloc(f);r.GetAttributeDataArrayForAllPoints(A,h,b,f,m);const I=new l(a.HEAPF32.buffer,m,p).slice();return a._free(m),{name:c,array:I,itemSize:d}}function n(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 QA{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 i=this.workersResolve[e];if(i&&i(t),this.queue.length){const{resolve:s,msg:n,transfer:a}=this.queue.shift();this.workersResolve[e]=s,this.workers[e].postMessage(n,a)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(i=>{const s=this._getIdleWorker();s!==-1?(this._initWorker(s),this.workerStatus|=1<<s,this.workersResolve[s]=i,this.workers[s].postMessage(e,t)):this.queue.push({resolve:i,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const vA=0,ra=2,xA=1,Aa=2,SA=0,TA=1,RA=10,DA=0,ca=9,la=15,ha=16,ga=22,da=37,pa=43,ua=76,fa=83,ma=97,ba=100,Ia=103,Ea=109,Ca=122,Ba=123,MA=131,kA=132,_A=133,FA=134,LA=137,NA=138,UA=141,GA=142,PA=145,OA=146,wa=148,ya=152,HA=157,jA=158,Qa=165,va=166,Oi=1000066e3;class Qs{constructor(e,t,i,s){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,i),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=0){const i=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+i,s)}}const Je=[171,75,84,88,32,50,48,187,13,10,26,10];function xa(o){return new TextDecoder().decode(o)}function qA(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={vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,levelCount:0,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null},i=17*Uint32Array.BYTES_PER_ELEMENT,s=new Qs(o,Je.length,i,!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(),t.levelCount=s._nextUint32(),t.supercompressionScheme=s._nextUint32();const n=s._nextUint32(),a=s._nextUint32(),r=s._nextUint32(),A=s._nextUint32(),c=s._nextUint64(),l=s._nextUint64(),h=3*Math.max(t.levelCount,1)*8,d=new Qs(o,Je.length+i,h,!0);for(let se=0,oe=Math.max(t.levelCount,1);se<oe;se++)t.levels.push({levelData:new Uint8Array(o.buffer,o.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});const p=new Qs(o,n,a,!0);p._skip(4);const f=p._nextUint16(),b=p._nextUint16(),m=p._nextUint16(),I=p._nextUint16(),E={vendorId:f,descriptorType:b,versionNumber:m,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:[]},C=(I/4-6)/4;for(let se=0;se<C;se++){const oe={bitOffset:p._nextUint16(),bitLength:p._nextUint8(),channelType:p._nextUint8(),samplePosition:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};64&oe.channelType?(oe.sampleLower=p._nextInt32(),oe.sampleUpper=p._nextInt32()):(oe.sampleLower=p._nextUint32(),oe.sampleUpper=p._nextUint32()),E.samples[se]=oe}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(E);const y=new Qs(o,r,A,!0);for(;y._offset<A;){const se=y._nextUint32(),oe=y._scan(se),Ae=xa(oe);if(t.keyValue[Ae]=y._nextUint8Array(se-oe.byteLength-1),Ae.match(/^ktx/i)){const Te=xa(t.keyValue[Ae]);t.keyValue[Ae]=Te.substring(0,Te.lastIndexOf("\0"))}y._skip(se%4?4-se%4:0)}if(l<=0)return t;const w=new Qs(o,c,l,!0),x=w._nextUint16(),T=w._nextUint16(),S=w._nextUint32(),_=w._nextUint32(),Y=w._nextUint32(),V=w._nextUint32(),K=[];for(let se=0,oe=Math.max(t.levelCount,1);se<oe;se++)K.push({imageFlags:w._nextUint32(),rgbSliceByteOffset:w._nextUint32(),rgbSliceByteLength:w._nextUint32(),alphaSliceByteOffset:w._nextUint32(),alphaSliceByteLength:w._nextUint32()});const W=c+w._offset,j=W+S,X=j+_,J=X+Y,ee=new Uint8Array(o.buffer,o.byteOffset+W,S),$=new Uint8Array(o.buffer,o.byteOffset+j,_),ue=new Uint8Array(o.buffer,o.byteOffset+X,Y),Re=new Uint8Array(o.buffer,o.byteOffset+J,V);return t.globalData={endpointCount:x,selectorCount:T,imageDescs:K,endpointsData:ee,selectorsData:$,tablesData:ue,extendedData:Re},t}let Hi,_t,ji;const qi={env:{emscripten_notify_memory_growth:function(o){ji=new Uint8Array(_t.exports.memory.buffer)}}};class zA{init(){return Hi||(Hi=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Sa).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,qi)).then(this._init):WebAssembly.instantiate(Buffer.from(Sa,"base64"),qi).then(this._init),Hi)}_init(e){_t=e.instance,qi.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!_t)throw new Error("ZSTDDecoder: Await .init() before decoding.");const i=e.byteLength,s=_t.exports.malloc(i);ji.set(e,s),t=t||Number(_t.exports.ZSTD_findDecompressedSize(s,i));const n=_t.exports.malloc(t),a=_t.exports.ZSTD_decompress(n,t,s,i),r=ji.slice(n,n+a);return _t.exports.free(s),_t.exports.free(n),r}}const Sa="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/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvb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ABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHN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QAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQi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qIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOI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QCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgAC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AAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/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",YA="display-p3",KA="display-p3-linear",zi=new WeakMap;let Yi=0,Ki;class gt extends Tt{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new QA,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return this.workerConfig={astcSupported:await e.hasFeatureAsync("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:await e.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await e.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await e.hasFeatureAsync("texture-compression-bc"),bptcSupported:await e.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await e.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:e.hasFeature("texture-compression-bptc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),astcHDRSupported:e.extensions.has("WEBGL_compressed_texture_astc")&&e.extensions.get("WEBGL_compressed_texture_astc").getSupportedProfiles().includes("hdr"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this}init(){if(!this.transcoderPending){const e=new dt(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),i=new dt(this.manager);i.setPath(this.transcoderPath),i.setResponseType("arraybuffer"),i.setWithCredentials(this.withCredentials);const s=i.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,s]).then(([n,a])=>{const r=gt.BasisWorker.toString(),A=["/* constants */","let _EngineFormat = "+JSON.stringify(gt.EngineFormat),"let _EngineType = "+JSON.stringify(gt.EngineType),"let _TranscoderFormat = "+JSON.stringify(gt.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(gt.BasisFormat),"/* basis_transcoder.js */",n,"/* 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})}),Yi>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Yi++}return this.transcoderPending}load(e,t,i,s){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const n=new dt(this.manager);n.setPath(this.path),n.setCrossOrigin(this.crossOrigin),n.setWithCredentials(this.withCredentials),n.setResponseType("arraybuffer"),n.load(e,a=>{this.parse(a,t,s)},i,s)}parse(e,t,i){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(zi.has(e))return zi.get(e).promise.then(t).catch(i);this._createTexture(e).then(s=>t?t(s):null).catch(i)}_createTextureFrom(e,t){const{type:i,error:s,data:{faces:n,width:a,height:r,format:A,type:c,dfdFlags:l}}=e;if(i==="error")return Promise.reject(s);let h;if(t.faceCount===6)h=new ur(n,A,c);else{const d=n[0].mipmaps;h=t.layerCount>1?new fr(d,a,r,t.layerCount,A,c):new bs(d,a,r,A,c)}return h.minFilter=n[0].mipmaps.length===1?at:fs,h.magFilter=at,h.generateMipmaps=!1,h.needsUpdate=!0,h.colorSpace=Ta(t),h.premultiplyAlpha=!!(l&xA),h}async _createTexture(e,t={}){const i=qA(new Uint8Array(e)),s=i.vkFormat===Oi&&i.dataFormatDescriptor[0].colorModel===167;if(!(i.vkFormat===DA||s&&!this.workerConfig.astcHDRSupported))return VA(i);const n=t,a=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:n},[e])).then(r=>this._createTextureFrom(r.data,i));return zi.set(e,{promise:a}),a}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Yi--}}gt.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2},gt.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16,BC6H:22,RGB_HALF:24,RGBA_HALF:25},gt.EngineFormat={RGBAFormat:Gt,RGBA_ASTC_4x4_Format:Js,RGB_BPTC_UNSIGNED_Format:pr,RGBA_BPTC_Format:Si,RGBA_ETC2_EAC_Format:Pn,RGBA_PVRTC_4BPPV1_Format:dr,RGBA_S3TC_DXT5_Format:xi,RGB_ETC1_Format:gr,RGB_ETC2_Format:Gn,RGB_PVRTC_4BPPV1_Format:hr,RGBA_S3TC_DXT1_Format:vi},gt.EngineType={UnsignedByteType:ft,HalfFloatType:Ze,FloatType:ut},gt.BasisWorker=function(){let o,e,t;const i=_EngineFormat,s=_EngineType,n=_TranscoderFormat,a=_BasisFormat;self.addEventListener("message",function(f){const b=f.data;switch(b.type){case"init":o=b.config,r(b.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:m,buffers:I,width:E,height:C,hasAlpha:y,format:w,type:x,dfdFlags:T}=A(b.buffer);self.postMessage({type:"transcode",id:b.id,data:{faces:m,width:E,height:C,hasAlpha:y,format:w,type:x,dfdFlags:T}},I)}catch(m){console.error(m),self.postMessage({type:"error",id:b.id,error:m.message})}});break}});function r(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 A(f){const b=new t.KTX2File(new Uint8Array(f));function m(){b.close(),b.delete()}if(!b.isValid())throw m(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let I;if(b.isUASTC())I=a.UASTC;else if(b.isETC1S())I=a.ETC1S;else if(b.isHDR())I=a.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const E=b.getWidth(),C=b.getHeight(),y=b.getLayers()||1,w=b.getLevels(),x=b.getFaces(),T=b.getHasAlpha(),S=b.getDFDFlags(),{transcoderFormat:_,engineFormat:Y,engineType:V}=h(I,E,C,T);if(!E||!C||!w)throw m(),new Error("THREE.KTX2Loader: Invalid texture");if(!b.startTranscoding())throw m(),new Error("THREE.KTX2Loader: .startTranscoding failed");const K=[],W=[];for(let j=0;j<x;j++){const X=[];for(let J=0;J<w;J++){const ee=[];let $,ue;for(let se=0;se<y;se++){const oe=b.getImageLevelInfo(J,se,j);j===0&&J===0&&se===0&&(oe.origWidth%4!==0||oe.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),w>1?($=oe.origWidth,ue=oe.origHeight):($=oe.width,ue=oe.height);let Ae=new Uint8Array(b.getImageTranscodedSizeInBytes(J,se,0,_));const Te=b.transcodeImage(Ae,J,se,j,_,0,-1,-1);if(V===s.HalfFloatType&&(Ae=new Uint16Array(Ae.buffer,Ae.byteOffset,Ae.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!Te)throw m(),new Error("THREE.KTX2Loader: .transcodeImage failed.");ee.push(Ae)}const Re=p(ee);X.push({data:Re,width:$,height:ue}),W.push(Re.buffer)}K.push({mipmaps:X,width:E,height:C,format:Y,type:V})}return m(),{faces:K,buffers:W,width:E,height:C,hasAlpha:T,dfdFlags:S,format:Y,type:V}}const c=[{if:"astcSupported",basisFormat:[a.UASTC],transcoderFormat:[n.ASTC_4x4,n.ASTC_4x4],engineFormat:[i.RGBA_ASTC_4x4_Format,i.RGBA_ASTC_4x4_Format],engineType:[s.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.BC7_M5,n.BC7_M5],engineFormat:[i.RGBA_BPTC_Format,i.RGBA_BPTC_Format],engineType:[s.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.BC1,n.BC3],engineFormat:[i.RGBA_S3TC_DXT1_Format,i.RGBA_S3TC_DXT5_Format],engineType:[s.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.ETC1,n.ETC2],engineFormat:[i.RGB_ETC2_Format,i.RGBA_ETC2_EAC_Format],engineType:[s.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.ETC1],engineFormat:[i.RGB_ETC1_Format],engineType:[s.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.PVRTC1_4_RGB,n.PVRTC1_4_RGBA],engineFormat:[i.RGB_PVRTC_4BPPV1_Format,i.RGBA_PVRTC_4BPPV1_Format],engineType:[s.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[a.UASTC_HDR],transcoderFormat:[n.BC6H],engineFormat:[i.RGB_BPTC_UNSIGNED_Format],engineType:[s.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.RGBA32,n.RGBA32],engineFormat:[i.RGBAFormat,i.RGBAFormat],engineType:[s.UnsignedByteType,s.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[a.UASTC_HDR],transcoderFormat:[n.RGBA_HALF],engineFormat:[i.RGBAFormat],engineType:[s.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],l={[a.ETC1S]:c.filter(f=>f.basisFormat.includes(a.ETC1S)).sort((f,b)=>f.priorityUASTC-b.priorityUASTC),[a.UASTC]:c.filter(f=>f.basisFormat.includes(a.UASTC)).sort((f,b)=>f.priorityUASTC-b.priorityUASTC),[a.UASTC_HDR]:c.filter(f=>f.basisFormat.includes(a.UASTC_HDR)).sort((f,b)=>f.priorityHDR-b.priorityHDR)};function h(f,b,m,I){const E=l[f];for(let C=0;C<E.length;C++){const y=E[C];if(y.if&&!o[y.if]||!y.basisFormat.includes(f)||I&&y.transcoderFormat.length<2||y.needsPowerOfTwo&&!(d(b)&&d(m)))continue;const w=y.transcoderFormat[I?1:0],x=y.engineFormat[I?1:0],T=y.engineType[0];return{transcoderFormat:w,engineFormat:x,engineType:T}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}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 E=0;E<f.length;E++){const C=f[E];b+=C.byteLength}const m=new Uint8Array(b);let I=0;for(let E=0;E<f.length;E++){const C=f[E];m.set(C,I),I+=C.byteLength}return m}};const JA=new Set([Gt,Ti,Is,as]),Ji={[Ea]:Gt,[ma]:Gt,[da]:Gt,[pa]:Gt,[Ia]:Is,[fa]:Is,[ha]:Is,[ga]:Is,[ba]:as,[ua]:as,[la]:as,[ca]:as,[Ba]:Ti,[Ca]:Ti,[wa]:Gn,[ya]:Pn,[Oi]:Js,[jA]:Js,[HA]:Js,[va]:jn,[Qa]:jn,[_A]:vi,[FA]:vi,[MA]:Hn,[kA]:Hn,[NA]:On,[LA]:On,[GA]:xi,[UA]:xi,[OA]:Si,[PA]:Si},vs={[Ea]:ut,[ma]:Ze,[da]:ft,[pa]:ft,[Ia]:ut,[fa]:Ze,[ha]:ft,[ga]:ft,[ba]:ut,[ua]:Ze,[la]:ft,[ca]:ft,[Ba]:zn,[Ca]:qn,[wa]:ft,[ya]:ft,[Oi]:Ze,[va]:ft,[Qa]:ft};async function VA(o){const{vkFormat:e}=o;if(Ji[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;o.supercompressionScheme===ra&&(Ki||(Ki=new Promise(async a=>{const r=new zA;await r.init(),a(r)})),t=await Ki);const i=[];for(let a=0;a<o.levels.length;a++){const r=Math.max(1,o.pixelWidth>>a),A=Math.max(1,o.pixelHeight>>a),c=o.pixelDepth?Math.max(1,o.pixelDepth>>a):0,l=o.levels[a];let h;if(o.supercompressionScheme===vA)h=l.levelData;else if(o.supercompressionScheme===ra)h=t.decode(l.levelData,l.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let d;vs[e]===ut?d=new Float32Array(h.buffer,h.byteOffset,h.byteLength/Float32Array.BYTES_PER_ELEMENT):vs[e]===Ze?d=new Uint16Array(h.buffer,h.byteOffset,h.byteLength/Uint16Array.BYTES_PER_ELEMENT):vs[e]===zn||vs[e]===qn?d=new Uint32Array(h.buffer,h.byteOffset,h.byteLength/Uint32Array.BYTES_PER_ELEMENT):d=h,i.push({data:d,width:r,height:A,depth:c})}const s=o.levelCount===0||i.length>1;let n;if(JA.has(Ji[e]))n=o.pixelDepth===0?new mr(i[0].data,o.pixelWidth,o.pixelHeight):new br(i[0].data,o.pixelWidth,o.pixelHeight,o.pixelDepth),n.minFilter=s?fi:js,n.magFilter=js,n.generateMipmaps=o.levelCount===0;else{if(o.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");n=new bs(i,o.pixelWidth,o.pixelHeight),n.minFilter=s?fs:at,n.magFilter=at}return n.mipmaps=i,n.type=vs[e],n.format=Ji[e],n.colorSpace=Ta(o),n.needsUpdate=!0,Promise.resolve(n)}function Ta(o){const e=o.dataFormatDescriptor[0];return e.colorPrimaries===TA?e.transferFunction===Aa?le:We:e.colorPrimaries===RA?e.transferFunction===Aa?YA:KA:e.colorPrimaries===SA?Vs:(console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),Vs)}class WA extends Ir{constructor(e,t={}){const i=t.font;if(i===void 0)super();else{const s=i.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 XA extends Tt{constructor(e){super(e)}load(e,t,i,s){const n=this,a=new dt(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(r){const A=n.parse(JSON.parse(r));t&&t(A)},i,s)}parse(e){return new Ra(e)}}class Ra{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100){const i=[],s=ZA(e,t,this.data);for(let n=0,a=s.length;n<a;n++)i.push(...s[n].toShapes());return i}}function ZA(o,e,t){const i=Array.from(o),s=e/t.resolution,n=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*s,a=[];let r=0,A=0;for(let c=0;c<i.length;c++){const l=i[c];if(l===`
|
|
36
|
+
`)r=0,A-=n;else{const h=$A(l,s,r,A,t);r+=h.offsetX,a.push(h.path)}}return a}function $A(o,e,t,i,s){const n=s.glyphs[o]||s.glyphs["?"];if(!n){console.error('THREE.Font: character "'+o+'" does not exists in font family '+s.familyName+".");return}const a=new Er;let r,A,c,l,h,d,p,f;if(n.o){const b=n._cachedOutline||(n._cachedOutline=n.o.split(" "));for(let m=0,I=b.length;m<I;)switch(b[m++]){case"m":r=b[m++]*e+t,A=b[m++]*e+i,a.moveTo(r,A);break;case"l":r=b[m++]*e+t,A=b[m++]*e+i,a.lineTo(r,A);break;case"q":c=b[m++]*e+t,l=b[m++]*e+i,h=b[m++]*e+t,d=b[m++]*e+i,a.quadraticCurveTo(h,d,c,l);break;case"b":c=b[m++]*e+t,l=b[m++]*e+i,h=b[m++]*e+t,d=b[m++]*e+i,p=b[m++]*e+t,f=b[m++]*e+i,a.bezierCurveTo(h,d,p,f,c,l);break}}return{offsetX:n.ha*e,path:a}}const $t=new Ri,qe=new N,jt=new N,Be=new ye,Da={X:new N(1,0,0),Y:new N(0,1,0),Z:new N(0,0,1)},Vi={type:"change"},Ma={type:"mouseDown",mode:null},ka={type:"mouseUp",mode:null},_a={type:"objectChange"};class ec extends Yn{constructor(e,t=null){super(void 0,t);const i=new oc(this);this._root=i;const s=new Ua;this._gizmo=s,i.add(s);const n=new rc;this._plane=n,i.add(n);const a=this;function r(C,y){let w=y;Object.defineProperty(a,C,{get:function(){return w!==void 0?w:y},set:function(x){w!==x&&(w=x,n[C]=x,s[C]=x,a.dispatchEvent({type:C+"-changed",value:x}),a.dispatchEvent(Vi))}}),a[C]=y,n[C]=y,s[C]=y}r("camera",e),r("object",void 0),r("enabled",!0),r("axis",null),r("mode","translate"),r("translationSnap",null),r("rotationSnap",null),r("scaleSnap",null),r("space","world"),r("size",1),r("dragging",!1),r("showX",!0),r("showY",!0),r("showZ",!0);const A=new N,c=new N,l=new ye,h=new ye,d=new N,p=new ye,f=new N,b=new N,m=new N,I=0,E=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",m),r("rotationAngle",I),r("eye",E),this._offset=new N,this._startNorm=new N,this._endNorm=new N,this._cameraScale=new N,this._parentPosition=new N,this._parentQuaternion=new ye,this._parentQuaternionInv=new ye,this._parentScale=new N,this._worldScaleStart=new N,this._worldQuaternionInv=new ye,this._worldScale=new N,this._positionStart=new N,this._quaternionStart=new ye,this._scaleStart=new N,this._getPointer=tc.bind(this),this._onPointerDown=ic.bind(this),this._onPointerHover=sc.bind(this),this._onPointerMove=nc.bind(this),this._onPointerUp=ac.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&&$t.setFromCamera(e,this.camera);const t=Wi(this._gizmo.picker[this.mode],$t);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&&$t.setFromCamera(e,this.camera);const t=Wi(this._plane,$t,!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,Ma.mode=this.mode,this.dispatchEvent(Ma)}}pointerMove(e){const t=this.axis,i=this.mode,s=this.object;let n=this.space;if(i==="scale"?n="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(n="world"),s===void 0||t===null||this.dragging===!1||e!==null&&e.button!==-1)return;e!==null&&$t.setFromCamera(e,this.camera);const a=Wi(this._plane,$t,!0);if(a){if(this.pointEnd.copy(a.point).sub(this.worldPositionStart),i==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),n==="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),n==="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&&(n==="local"&&(s.position.applyQuaternion(Be.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)),n==="world"&&(s.parent&&s.position.add(qe.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(qe.setFromMatrixPosition(s.parent.matrixWorld))));else if(i==="scale"){if(t.search("XYZ")!==-1){let r=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(r*=-1),jt.set(r,r,r)}else qe.copy(this.pointStart),jt.copy(this.pointEnd),qe.applyQuaternion(this._worldQuaternionInv),jt.applyQuaternion(this._worldQuaternionInv),jt.divide(qe),t.search("X")===-1&&(jt.x=1),t.search("Y")===-1&&(jt.y=1),t.search("Z")===-1&&(jt.z=1);s.scale.copy(this._scaleStart).multiply(jt),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(i==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const r=20/this.worldPosition.distanceTo(qe.setFromMatrixPosition(this.camera.matrixWorld));let A=!1;t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(qe.copy(this.rotationAxis).cross(this.eye))*r):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(Da[t]),qe.copy(Da[t]),n==="local"&&qe.applyQuaternion(this.worldQuaternion),qe.cross(this.eye),qe.length()===0?A=!0:this.rotationAngle=this._offset.dot(qe.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),n==="local"&&t!=="E"&&t!=="XYZE"?(s.quaternion.copy(this._quaternionStart),s.quaternion.multiply(Be.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),s.quaternion.copy(Be.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),s.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(Vi),this.dispatchEvent(_a)}}pointerUp(e){e!==null&&e.button!==0||(this.dragging&&this.axis!==null&&(ka.mode=this.mode,this.dispatchEvent(ka)),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(Vi),this.dispatchEvent(_a),this.pointStart.copy(this.pointEnd))}getRaycaster(){return $t}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 tc(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 sc(o){if(this.enabled)switch(o.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(o));break}}function ic(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 nc(o){this.enabled&&this.pointerMove(this._getPointer(o))}function ac(o){this.enabled&&(this.domElement.releasePointerCapture(o.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(o)))}function Wi(o,e,t){const i=e.intersectObject(o,!0);for(let s=0;s<i.length;s++)if(i[s].object.visible||t)return i[s];return!1}const Xs=new Pt,de=new N(0,1,0),Fa=new N(0,0,0),La=new ce,Zs=new ye,$s=new ye,wt=new N,Na=new ce,xs=new N(1,0,0),es=new N(0,1,0),Ss=new N(0,0,1),ei=new N,Ts=new N,Rs=new N;class oc 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 Ua 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 Rt({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),i=e.clone();i.opacity=.15;const s=t.clone();s.opacity=.5;const n=e.clone();n.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 $e(0,.04,.1,12);f.translate(0,.05,0);const b=new Ke(.08,.08,.08);b.translate(0,.04,0);const m=new ct;m.setAttribute("position",new Me([0,0,0,1,0,0],3));const I=new $e(.0075,.0075,.5,3);I.translate(0,.25,0);function E(j,X){const J=new Es(j,.0075,3,64,X*Math.PI*2);return J.rotateY(Math.PI/2),J.rotateX(Math.PI/2),J}function C(){const j=new ct;return j.setAttribute("position",new Me([0,0,0,1,1,1],3)),j}const y={X:[[new O(f,n),[.5,0,0],[0,0,-Math.PI/2]],[new O(f,n),[-.5,0,0],[0,0,Math.PI/2]],[new O(I,n),[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 Ws(.1,0),h.clone()),[0,0,0]]],XY:[[new O(new Ke(.15,.15,.01),l.clone()),[.15,.15,0]]],YZ:[[new O(new Ke(.15,.15,.01),A.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ke(.15,.15,.01),c.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},w={X:[[new O(new $e(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new O(new $e(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new O(new $e(.2,0,.6,4),i),[0,.3,0]],[new O(new $e(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new O(new $e(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new O(new $e(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new O(new Ws(.2,0),i)]],XY:[[new O(new Ke(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new O(new Ke(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ke(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]]},x={START:[[new O(new Ws(.01,2),s),null,null,null,"helper"]],END:[[new O(new Ws(.01,2),s),null,null,null,"helper"]],DELTA:[[new pt(C(),s),null,null,null,"helper"]],X:[[new pt(m,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new pt(m,s.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new pt(m,s.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},T={XYZE:[[new O(E(.5,1),p),null,[0,Math.PI/2,0]]],X:[[new O(E(.5,.5),n)]],Y:[[new O(E(.5,.5),a),null,[0,0,-Math.PI/2]]],Z:[[new O(E(.5,.5),r),null,[0,Math.PI/2,0]]],E:[[new O(E(.75,1),d),null,[0,Math.PI/2,0]]]},S={AXIS:[[new pt(m,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},_={XYZE:[[new O(new hi(.25,10,8),i)]],X:[[new O(new Es(.5,.1,4,24),i),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new O(new Es(.5,.1,4,24),i),[0,0,0],[Math.PI/2,0,0]]],Z:[[new O(new Es(.5,.1,4,24),i),[0,0,0],[0,0,-Math.PI/2]]],E:[[new O(new Es(.75,.1,2,24),i)]]},Y={X:[[new O(b,n),[.5,0,0],[0,0,-Math.PI/2]],[new O(I,n),[0,0,0],[0,0,-Math.PI/2]],[new O(b,n),[-.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 Ke(.15,.15,.01),l),[.15,.15,0]]],YZ:[[new O(new Ke(.15,.15,.01),A),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ke(.15,.15,.01),c),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new O(new Ke(.1,.1,.1),h.clone())]]},V={X:[[new O(new $e(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new O(new $e(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new O(new $e(.2,0,.6,4),i),[0,.3,0]],[new O(new $e(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new O(new $e(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new O(new $e(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new O(new Ke(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new O(new Ke(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ke(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new O(new Ke(.2,.2,.2),i),[0,0,0]]]},K={X:[[new pt(m,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new pt(m,s.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new pt(m,s.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function W(j){const X=new Bt;for(const J in j)for(let ee=j[J].length;ee--;){const $=j[J][ee][0].clone(),ue=j[J][ee][1],Re=j[J][ee][2],se=j[J][ee][3],oe=j[J][ee][4];$.name=J,$.tag=oe,ue&&$.position.set(ue[0],ue[1],ue[2]),Re&&$.rotation.set(Re[0],Re[1],Re[2]),se&&$.scale.set(se[0],se[1],se[2]),$.updateMatrix();const Ae=$.geometry.clone();Ae.applyMatrix4($.matrix),$.geometry=Ae,$.renderOrder=1/0,$.position.set(0,0,0),$.rotation.set(0,0,0),$.scale.set(1,1,1),X.add($)}return X}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=W(y)),this.add(this.gizmo.rotate=W(T)),this.add(this.gizmo.scale=W(Y)),this.add(this.picker.translate=W(w)),this.add(this.picker.rotate=W(_)),this.add(this.picker.scale=W(V)),this.add(this.helper.translate=W(x)),this.add(this.helper.rotate=W(S)),this.add(this.helper.scale=W(K)),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:$s;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 i=[];i=i.concat(this.picker[this.mode].children),i=i.concat(this.gizmo[this.mode].children),i=i.concat(this.helper[this.mode].children);for(let s=0;s<i.length;s++){const n=i[s];n.visible=!0,n.rotation.set(0,0,0),n.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),n.scale.set(1,1,1).multiplyScalar(a*this.size/4),n.tag==="helper"){n.visible=!1,n.name==="AXIS"?(n.visible=!!this.axis,this.axis==="X"&&(Be.setFromEuler(Xs.set(0,0,0)),n.quaternion.copy(t).multiply(Be),Math.abs(de.copy(xs).applyQuaternion(t).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Y"&&(Be.setFromEuler(Xs.set(0,0,Math.PI/2)),n.quaternion.copy(t).multiply(Be),Math.abs(de.copy(es).applyQuaternion(t).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Z"&&(Be.setFromEuler(Xs.set(0,Math.PI/2,0)),n.quaternion.copy(t).multiply(Be),Math.abs(de.copy(Ss).applyQuaternion(t).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="XYZE"&&(Be.setFromEuler(Xs.set(0,Math.PI/2,0)),de.copy(this.rotationAxis),n.quaternion.setFromRotationMatrix(La.lookAt(Fa,de,es)),n.quaternion.multiply(Be),n.visible=this.dragging),this.axis==="E"&&(n.visible=!1)):n.name==="START"?(n.position.copy(this.worldPositionStart),n.visible=this.dragging):n.name==="END"?(n.position.copy(this.worldPosition),n.visible=this.dragging):n.name==="DELTA"?(n.position.copy(this.worldPositionStart),n.quaternion.copy(this.worldQuaternionStart),qe.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),qe.applyQuaternion(this.worldQuaternionStart.clone().invert()),n.scale.copy(qe),n.visible=this.dragging):(n.quaternion.copy(t),this.dragging?n.position.copy(this.worldPositionStart):n.position.copy(this.worldPosition),this.axis&&(n.visible=this.axis.search(n.name)!==-1));continue}n.quaternion.copy(t),this.mode==="translate"||this.mode==="scale"?(n.name==="X"&&Math.abs(de.copy(xs).applyQuaternion(t).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Y"&&Math.abs(de.copy(es).applyQuaternion(t).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Z"&&Math.abs(de.copy(Ss).applyQuaternion(t).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XY"&&Math.abs(de.copy(Ss).applyQuaternion(t).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="YZ"&&Math.abs(de.copy(xs).applyQuaternion(t).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XZ"&&Math.abs(de.copy(es).applyQuaternion(t).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1)):this.mode==="rotate"&&(Zs.copy(t),de.copy(this.eye).applyQuaternion(Be.copy(t).invert()),n.name.search("E")!==-1&&n.quaternion.setFromRotationMatrix(La.lookAt(this.eye,Fa,es)),n.name==="X"&&(Be.setFromAxisAngle(xs,Math.atan2(-de.y,de.z)),Be.multiplyQuaternions(Zs,Be),n.quaternion.copy(Be)),n.name==="Y"&&(Be.setFromAxisAngle(es,Math.atan2(de.x,de.z)),Be.multiplyQuaternions(Zs,Be),n.quaternion.copy(Be)),n.name==="Z"&&(Be.setFromAxisAngle(Ss,Math.atan2(de.y,de.x)),Be.multiplyQuaternions(Zs,Be),n.quaternion.copy(Be))),n.visible=n.visible&&(n.name.indexOf("X")===-1||this.showX),n.visible=n.visible&&(n.name.indexOf("Y")===-1||this.showY),n.visible=n.visible&&(n.name.indexOf("Z")===-1||this.showZ),n.visible=n.visible&&(n.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),n.material._color=n.material._color||n.material.color.clone(),n.material._opacity=n.material._opacity||n.material.opacity,n.material.color.copy(n.material._color),n.material.opacity=n.material._opacity,this.enabled&&this.axis&&(n.name===this.axis||this.axis.split("").some(function(r){return n.name===r}))&&(n.material.color.setHex(16776960),n.material.opacity=1)}super.updateMatrixWorld(e)}}class rc extends O{constructor(){super(new Di(1e5,1e5,2,2),new It({visible:!1,wireframe:!0,side:bi,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"),ei.copy(xs).applyQuaternion(t==="local"?this.worldQuaternion:$s),Ts.copy(es).applyQuaternion(t==="local"?this.worldQuaternion:$s),Rs.copy(Ss).applyQuaternion(t==="local"?this.worldQuaternion:$s),de.copy(Ts),this.mode){case"translate":case"scale":switch(this.axis){case"X":de.copy(this.eye).cross(ei),wt.copy(ei).cross(de);break;case"Y":de.copy(this.eye).cross(Ts),wt.copy(Ts).cross(de);break;case"Z":de.copy(this.eye).cross(Rs),wt.copy(Rs).cross(de);break;case"XY":wt.copy(Rs);break;case"YZ":wt.copy(ei);break;case"XZ":de.copy(Rs),wt.copy(Ts);break;case"XYZ":case"E":wt.set(0,0,0);break}break;default:wt.set(0,0,0)}wt.length()===0?this.quaternion.copy(this.cameraQuaternion):(Na.lookAt(qe.set(0,0,0),wt,de),this.quaternion.setFromRotationMatrix(Na)),super.updateMatrixWorld(e)}}var xe=Uint8Array,ot=Uint16Array,Xi=Int32Array,ti=new xe([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),si=new xe([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Zi=new xe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ga=function(o,e){for(var t=new ot(31),i=0;i<31;++i)t[i]=e+=1<<o[i-1];for(var s=new Xi(t[30]),i=1;i<30;++i)for(var n=t[i];n<t[i+1];++n)s[n]=n-t[i]<<5|i;return{b:t,r:s}},Pa=Ga(ti,2),Oa=Pa.b,$i=Pa.r;Oa[28]=258,$i[258]=28;for(var Ha=Ga(si,0),Ac=Ha.b,ja=Ha.r,en=new ot(32768),Ie=0;Ie<32768;++Ie){var qt=(Ie&43690)>>1|(Ie&21845)<<1;qt=(qt&52428)>>2|(qt&13107)<<2,qt=(qt&61680)>>4|(qt&3855)<<4,en[Ie]=((qt&65280)>>8|(qt&255)<<8)>>1}for(var yt=function(o,e,t){for(var i=o.length,s=0,n=new ot(e);s<i;++s)o[s]&&++n[o[s]-1];var a=new ot(e);for(s=1;s<e;++s)a[s]=a[s-1]+n[s-1]<<1;var r;if(t){r=new ot(1<<e);var A=15-e;for(s=0;s<i;++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[en[h]>>A]=c}else for(r=new ot(i),s=0;s<i;++s)o[s]&&(r[s]=en[a[o[s]-1]++]>>15-o[s]);return r},zt=new xe(288),Ie=0;Ie<144;++Ie)zt[Ie]=8;for(var Ie=144;Ie<256;++Ie)zt[Ie]=9;for(var Ie=256;Ie<280;++Ie)zt[Ie]=7;for(var Ie=280;Ie<288;++Ie)zt[Ie]=8;for(var Ds=new xe(32),Ie=0;Ie<32;++Ie)Ds[Ie]=5;var cc=yt(zt,9,0),lc=yt(zt,9,1),hc=yt(Ds,5,0),gc=yt(Ds,5,1),tn=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 i=e/8|0;return(o[i]|o[i+1]<<8)>>(e&7)&t},sn=function(o,e){var t=e/8|0;return(o[t]|o[t+1]<<8|o[t+2]<<16)>>(e&7)},nn=function(o){return(o+7)/8|0},an=function(o,e,t){return(t==null||t>o.length)&&(t=o.length),new xe(o.subarray(e,t))},dc=["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"],tt=function(o,e,t){var i=new Error(e||dc[o]);if(i.code=o,Error.captureStackTrace&&Error.captureStackTrace(i,tt),!t)throw i;return i},pc=function(o,e,t,i){var s=o.length,n=0;if(!s||e.f&&!e.l)return t||new xe(0);var a=!t,r=a||e.i!=2,A=e.i;a&&(t=new xe(s*3));var c=function(_e){var Ut=t.length;if(_e>Ut){var Ye=new xe(Math.max(Ut*2,_e));Ye.set(t),t=Ye}},l=e.f||0,h=e.p||0,d=e.b||0,p=e.l,f=e.d,b=e.m,m=e.n,I=s*8;do{if(!p){l=mt(o,h,1);var E=mt(o,h+1,3);if(h+=3,E)if(E==1)p=lc,f=gc,b=9,m=5;else if(E==2){var C=mt(o,h,31)+257,y=mt(o,h+10,15)+4,w=C+mt(o,h+5,31)+1;h+=14;for(var x=new xe(w),T=new xe(19),S=0;S<y;++S)T[Zi[S]]=mt(o,h+S*3,7);h+=y*3;for(var _=tn(T),Y=(1<<_)-1,V=yt(T,_,1),S=0;S<w;){var K=V[mt(o,h,Y)];h+=K&15;var W=K>>4;if(W<16)x[S++]=W;else{var j=0,X=0;for(W==16?(X=3+mt(o,h,3),h+=2,j=x[S-1]):W==17?(X=3+mt(o,h,7),h+=3):W==18&&(X=11+mt(o,h,127),h+=7);X--;)x[S++]=j}}var J=x.subarray(0,C),ee=x.subarray(C);b=tn(J),m=tn(ee),p=yt(J,b,1),f=yt(ee,m,1)}else tt(1);else{var W=nn(h)+4,$=o[W-4]|o[W-3]<<8,ue=W+$;if(ue>s){A&&tt(0);break}r&&c(d+$),t.set(o.subarray(W,ue),d),e.b=d+=$,e.p=h=ue*8,e.f=l;continue}if(h>I){A&&tt(0);break}}r&&c(d+131072);for(var Re=(1<<b)-1,se=(1<<m)-1,oe=h;;oe=h){var j=p[sn(o,h)&Re],Ae=j>>4;if(h+=j&15,h>I){A&&tt(0);break}if(j||tt(2),Ae<256)t[d++]=Ae;else if(Ae==256){oe=h,p=null;break}else{var Te=Ae-254;if(Ae>264){var S=Ae-257,fe=ti[S];Te=mt(o,h,(1<<fe)-1)+Oa[S],h+=fe}var ze=f[sn(o,h)&se],Lt=ze>>4;ze||tt(3),h+=ze&15;var ee=Ac[Lt];if(Lt>3){var fe=si[Lt];ee+=sn(o,h)&(1<<fe)-1,h+=fe}if(h>I){A&&tt(0);break}r&&c(d+131072);var Nt=d+Te;if(d<ee){var is=n-ee,Ne=Math.min(ee,Nt);for(is+d<0&&tt(3);d<Ne;++d)t[d]=i[is+d]}for(;d<Nt;++d)t[d]=t[d-ee]}}e.l=p,e.p=oe,e.b=d,e.f=l,p&&(l=1,e.m=b,e.d=f,e.n=m)}while(!l);return d!=t.length&&a?an(t,0,d):t.subarray(0,d)},Ft=function(o,e,t){t<<=e&7;var i=e/8|0;o[i]|=t,o[i+1]|=t>>8},Ms=function(o,e,t){t<<=e&7;var i=e/8|0;o[i]|=t,o[i+1]|=t>>8,o[i+2]|=t>>16},on=function(o,e){for(var t=[],i=0;i<o.length;++i)o[i]&&t.push({s:i,f:o[i]});var s=t.length,n=t.slice();if(!s)return{t:Ka,l:0};if(s==1){var a=new xe(t[0].s+1);return a[t[0].s]=1,{t:a,l:1}}t.sort(function(w,x){return w.f-x.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=n[0].s,i=1;i<s;++i)n[i].s>d&&(d=n[i].s);var p=new ot(d+1),f=rn(t[l-1],p,0);if(f>e){var i=0,b=0,m=f-e,I=1<<m;for(n.sort(function(x,T){return p[T.s]-p[x.s]||x.f-T.f});i<s;++i){var E=n[i].s;if(p[E]>e)b+=I-(1<<f-p[E]),p[E]=e;else break}for(b>>=m;b>0;){var C=n[i].s;p[C]<e?b-=1<<e-p[C]++-1:++i}for(;i>=0&&b;--i){var y=n[i].s;p[y]==e&&(--p[y],++b)}f=e}return{t:new xe(p),l:f}},rn=function(o,e,t){return o.s==-1?Math.max(rn(o.l,e,t+1),rn(o.r,e,t+1)):e[o.s]=t},qa=function(o){for(var e=o.length;e&&!o[--e];);for(var t=new ot(++e),i=0,s=o[0],n=1,a=function(A){t[i++]=A},r=1;r<=e;++r)if(o[r]==s&&r!=e)++n;else{if(!s&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(s),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(s);n=1,s=o[r]}return{c:t.subarray(0,i),n:e}},ks=function(o,e){for(var t=0,i=0;i<e.length;++i)t+=o[i]*e[i];return t},za=function(o,e,t){var i=t.length,s=nn(e+2);o[s]=i&255,o[s+1]=i>>8,o[s+2]=o[s]^255,o[s+3]=o[s+1]^255;for(var n=0;n<i;++n)o[s+n+4]=t[n];return(s+4+i)*8},Ya=function(o,e,t,i,s,n,a,r,A,c,l){Ft(e,l++,t),++s[256];for(var h=on(s,15),d=h.t,p=h.l,f=on(n,15),b=f.t,m=f.l,I=qa(d),E=I.c,C=I.n,y=qa(b),w=y.c,x=y.n,T=new ot(19),S=0;S<E.length;++S)++T[E[S]&31];for(var S=0;S<w.length;++S)++T[w[S]&31];for(var _=on(T,7),Y=_.t,V=_.l,K=19;K>4&&!Y[Zi[K-1]];--K);var W=c+5<<3,j=ks(s,zt)+ks(n,Ds)+a,X=ks(s,d)+ks(n,b)+a+14+3*K+ks(T,Y)+2*T[16]+3*T[17]+7*T[18];if(A>=0&&W<=j&&W<=X)return za(e,l,o.subarray(A,A+c));var J,ee,$,ue;if(Ft(e,l,1+(X<j)),l+=2,X<j){J=yt(d,p,0),ee=d,$=yt(b,m,0),ue=b;var Re=yt(Y,V,0);Ft(e,l,C-257),Ft(e,l+5,x-1),Ft(e,l+10,K-4),l+=14;for(var S=0;S<K;++S)Ft(e,l+3*S,Y[Zi[S]]);l+=3*K;for(var se=[E,w],oe=0;oe<2;++oe)for(var Ae=se[oe],S=0;S<Ae.length;++S){var Te=Ae[S]&31;Ft(e,l,Re[Te]),l+=Y[Te],Te>15&&(Ft(e,l,Ae[S]>>5&127),l+=Ae[S]>>12)}}else J=cc,ee=zt,$=hc,ue=Ds;for(var S=0;S<r;++S){var fe=i[S];if(fe>255){var Te=fe>>18&31;Ms(e,l,J[Te+257]),l+=ee[Te+257],Te>7&&(Ft(e,l,fe>>23&31),l+=ti[Te]);var ze=fe&31;Ms(e,l,$[ze]),l+=ue[ze],ze>3&&(Ms(e,l,fe>>5&8191),l+=si[ze])}else Ms(e,l,J[fe]),l+=ee[fe]}return Ms(e,l,J[256]),l+ee[256]},uc=new Xi([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ka=new xe(0),fc=function(o,e,t,i,s,n){var a=n.z||o.length,r=new xe(i+a+5*(1+Math.ceil(a/7e3))+s),A=r.subarray(i,r.length-s),c=n.l,l=(n.r||0)&7;if(e){l&&(A[0]=n.r>>3);for(var h=uc[e-1],d=h>>13,p=h&8191,f=(1<<t)-1,b=n.p||new ot(32768),m=n.h||new ot(f+1),I=Math.ceil(t/3),E=2*I,C=function(Ue){return(o[Ue]^o[Ue+1]<<I^o[Ue+2]<<E)&f},y=new Xi(25e3),w=new ot(288),x=new ot(32),T=0,S=0,_=n.i||0,Y=0,V=n.w||0,K=0;_+2<a;++_){var W=C(_),j=_&32767,X=m[W];if(b[j]=X,m[W]=j,V<=_){var J=a-_;if((T>7e3||Y>24576)&&(J>423||!c)){l=Ya(o,A,0,y,w,x,S,Y,K,_-K,l),Y=T=S=0,K=_;for(var ee=0;ee<286;++ee)w[ee]=0;for(var ee=0;ee<30;++ee)x[ee]=0}var $=2,ue=0,Re=p,se=j-X&32767;if(J>2&&W==C(_-se))for(var oe=Math.min(d,J)-1,Ae=Math.min(32767,_),Te=Math.min(258,J);se<=Ae&&--Re&&j!=X;){if(o[_+$]==o[_+$-se]){for(var fe=0;fe<Te&&o[_+fe]==o[_+fe-se];++fe);if(fe>$){if($=fe,ue=se,fe>oe)break;for(var ze=Math.min(se,fe-2),Lt=0,ee=0;ee<ze;++ee){var Nt=_-se+ee&32767,is=b[Nt],Ne=Nt-is&32767;Ne>Lt&&(Lt=Ne,X=Nt)}}}j=X,X=b[j],se+=j-X&32767}if(ue){y[Y++]=268435456|$i[$]<<18|ja[ue];var _e=$i[$]&31,Ut=ja[ue]&31;S+=ti[_e]+si[Ut],++w[257+_e],++x[Ut],V=_+$,++T}else y[Y++]=o[_],++w[o[_]]}}for(_=Math.max(_,V);_<a;++_)y[Y++]=o[_],++w[o[_]];l=Ya(o,A,c,y,w,x,S,Y,K,_-K,l),c||(n.r=l&7|A[l/8|0]<<3,l-=7,n.h=m,n.p=b,n.i=_,n.w=V)}else{for(var _=n.w||0;_<a+c;_+=65535){var Ye=_+65535;Ye>=a&&(A[l/8|0]=c,Ye=a),l=za(A,l+1,o.subarray(_,Ye))}n.i=a}return an(r,0,i+nn(l)+s)},mc=function(){for(var o=new Int32Array(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(t&1&&-306674912)^t>>>1;o[e]=t}return o}(),bc=function(){var o=-1;return{p:function(e){for(var t=o,i=0;i<e.length;++i)t=mc[t&255^e[i]]^t>>>8;o=t},d:function(){return~o}}},Ic=function(o,e,t,i,s){if(!s&&(s={l:1},e.dictionary)){var n=e.dictionary.subarray(-32768),a=new xe(n.length+o.length);a.set(n),a.set(o,n.length),o=a,s.w=n.length}return fc(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,i,s)},Ja=function(o,e){var t={};for(var i in o)t[i]=o[i];for(var i in e)t[i]=e[i];return t},Ge=function(o,e,t){for(;t;++e)o[e]=t,t>>>=8},Ec=function(o,e){return((o[0]&15)!=8||o[0]>>4>7||(o[0]<<8|o[1])%31)&&tt(6,"invalid zlib data"),(o[1]>>5&1)==1&&tt(6,"invalid zlib data: "+(o[1]&32?"need":"unexpected")+" dictionary"),(o[1]>>3&4)+2};function Cc(o,e){return Ic(o,e||{},0,0)}function _s(o,e){return pc(o.subarray(Ec(o),-4),{i:2},e,e)}var Va=function(o,e,t,i){for(var s in o){var n=o[s],a=e+s,r=i;Array.isArray(n)&&(r=Ja(i,n[1]),n=n[0]),n instanceof xe?t[a]=[n,r]:(t[a+="/"]=[new xe(0),r],Va(n,a,t,i))}},Wa=typeof TextEncoder<"u"&&new TextEncoder,Bc=typeof TextDecoder<"u"&&new TextDecoder,wc=0;try{Bc.decode(Ka,{stream:!0}),wc=1}catch{}function An(o,e){var t;if(Wa)return Wa.encode(o);for(var i=o.length,s=new xe(o.length+(o.length>>1)),n=0,a=function(l){s[n++]=l},t=0;t<i;++t){if(n+5>s.length){var r=new xe(n+8+(i-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 an(s,0,n)}var cn=function(o){var e=0;if(o)for(var t in o){var i=o[t].length;i>65535&&tt(9),e+=i+4}return e},Xa=function(o,e,t,i,s,n,a,r){var A=i.length,c=t.extra,l=r&&r.length,h=cn(c);Ge(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|(n<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)&&tt(10),Ge(o,e,p<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>1),e+=4,n!=-1&&(Ge(o,e,t.crc),Ge(o,e+4,n<0?-n-2:n),Ge(o,e+8,t.size)),Ge(o,e+12,A),Ge(o,e+14,h),e+=16,a!=null&&(Ge(o,e,l),Ge(o,e+6,t.attrs),Ge(o,e+10,a),e+=14),o.set(i,e),e+=A,h)for(var f in c){var b=c[f],m=b.length;Ge(o,e,+f),Ge(o,e+2,m),o.set(b,e+4),e+=4+m}return l&&(o.set(r,e),e+=l),e},yc=function(o,e,t,i,s){Ge(o,e,101010256),Ge(o,e+8,t),Ge(o,e+10,t),Ge(o,e+12,i),Ge(o,e+16,s)};function Qc(o,e){e||(e={});var t={},i=[];Va(o,"",t,e);var s=0,n=0;for(var a in t){var r=t[a],A=r[0],c=r[1],l=c.level==0?0:8,h=An(a),d=h.length,p=c.comment,f=p&&An(p),b=f&&f.length,m=cn(c.extra);d>65535&&tt(11);var I=l?Cc(A,c):A,E=I.length,C=bc();C.p(A),i.push(Ja(c,{size:A.length,crc:C.d(),c:I,f:h,m:f,u:d!=a.length||f&&p.length!=b,o:s,compression:l})),s+=30+d+m+E,n+=76+2*(d+m)+(b||0)+E}for(var y=new xe(n+22),w=s,x=n-s,T=0;T<i.length;++T){var h=i[T];Xa(y,h.o,h,h.f,h.u,h.c.length);var S=30+h.f.length+cn(h.extra);y.set(h.c,h.o+S),Xa(y,s,h,h.f,h.u,h.c.length,h.o,h.m),s+=16+S+(h.m?h.m.length:0)}return yc(y,s,i.length,x,w),y}class Za extends Kn{constructor(e){super(e),this.type=Ze}parse(e){const t=Math.pow(2.7182818,2.2);function i(g,u){let B=0;for(let R=0;R<65536;++R)(R==0||g[R>>3]&1<<(R&7))&&(u[B++]=R);const Q=B-1;for(;B<65536;)u[B++]=0;return Q}function s(g){for(let u=0;u<16384;u++)g[u]={},g[u].len=0,g[u].lit=0,g[u].p=null}const n={l:0,c:0,lc:0};function a(g,u,B,Q,R){for(;B<g;)u=u<<8|Ut(Q,R),B+=8;B-=g,n.l=u>>B&(1<<g)-1,n.c=u,n.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 u=0;for(let B=58;B>0;--B){const Q=u+r[B]>>1;r[B]=u,u=Q}for(let B=0;B<65537;++B){const Q=g[B];Q>0&&(g[B]=Q|r[Q]++<<6)}}function c(g,u,B,Q,R,v){const k=u;let L=0,F=0;for(;Q<=R;Q++){if(k.value-u.value>B)return!1;a(6,L,F,g,k);const M=n.l;if(L=n.c,F=n.lc,v[Q]=M,M==63){if(k.value-u.value>B)throw new Error("Something wrong with hufUnpackEncTable");a(8,L,F,g,k);let D=n.l+6;if(L=n.c,F=n.lc,Q+D>R+1)throw new Error("Something wrong with hufUnpackEncTable");for(;D--;)v[Q++]=0;Q--}else if(M>=59){let D=M-59+2;if(Q+D>R+1)throw new Error("Something wrong with hufUnpackEncTable");for(;D--;)v[Q++]=0;Q--}}A(v)}function l(g){return g&63}function h(g){return g>>6}function d(g,u,B,Q){for(;u<=B;u++){const R=h(g[u]),v=l(g[u]);if(R>>v)throw new Error("Invalid table entry");if(v>14){const k=Q[R>>v-14];if(k.len)throw new Error("Invalid table entry");if(k.lit++,k.p){const L=k.p;k.p=new Array(k.lit);for(let F=0;F<k.lit-1;++F)k.p[F]=L[F]}else k.p=new Array(1);k.p[k.lit-1]=u}else if(v){let k=0;for(let L=1<<14-v;L>0;L--){const F=Q[(R<<14-v)+k];if(F.len||F.p)throw new Error("Invalid table entry");F.len=v,F.lit=u,k++}}}return!0}const p={c:0,lc:0};function f(g,u,B,Q){g=g<<8|Ut(B,Q),u+=8,p.c=g,p.lc=u}const b={c:0,lc:0};function m(g,u,B,Q,R,v,k,L,F){if(g==u){Q<8&&(f(B,Q,R,v),B=p.c,Q=p.lc),Q-=8;let M=B>>Q;if(M=new Uint8Array([M])[0],L.value+M>F)return!1;const D=k[L.value-1];for(;M-- >0;)k[L.value++]=D}else if(L.value<F)k[L.value++]=g;else return!1;b.c=B,b.lc=Q}function I(g){return g&65535}function E(g){const u=I(g);return u>32767?u-65536:u}const C={a:0,b:0};function y(g,u){const B=E(g),Q=E(u),R=B+(Q&1)+(Q>>1),v=R,k=R-Q;C.a=v,C.b=k}function w(g,u){const B=I(g),Q=I(u),R=B-(Q>>1)&65535,v=Q+R-32768&65535;C.a=v,C.b=R}function x(g,u,B,Q,R,v,k){const L=k<16384,F=B>R?R:B;let M=1,D,G;for(;M<=F;)M<<=1;for(M>>=1,D=M,M>>=1;M>=1;){G=0;const U=G+v*(R-D),q=v*M,Z=v*D,P=Q*M,z=Q*D;let te,Ee,ve,it;for(;G<=U;G+=Z){let me=G;const re=G+Q*(B-D);for(;me<=re;me+=z){const De=me+P,At=me+q,Fe=At+P;L?(y(g[me+u],g[At+u]),te=C.a,ve=C.b,y(g[De+u],g[Fe+u]),Ee=C.a,it=C.b,y(te,Ee),g[me+u]=C.a,g[De+u]=C.b,y(ve,it),g[At+u]=C.a,g[Fe+u]=C.b):(w(g[me+u],g[At+u]),te=C.a,ve=C.b,w(g[De+u],g[Fe+u]),Ee=C.a,it=C.b,w(te,Ee),g[me+u]=C.a,g[De+u]=C.b,w(ve,it),g[At+u]=C.a,g[Fe+u]=C.b)}if(B&M){const De=me+q;L?y(g[me+u],g[De+u]):w(g[me+u],g[De+u]),te=C.a,g[De+u]=C.b,g[me+u]=te}}if(R&M){let me=G;const re=G+Q*(B-D);for(;me<=re;me+=z){const De=me+P;L?y(g[me+u],g[De+u]):w(g[me+u],g[De+u]),te=C.a,g[De+u]=C.b,g[me+u]=te}}D=M,M>>=1}return G}function T(g,u,B,Q,R,v,k,L,F){let M=0,D=0;const G=k,U=Math.trunc(Q.value+(R+7)/8);for(;Q.value<U;)for(f(M,D,B,Q),M=p.c,D=p.lc;D>=14;){const Z=M>>D-14&16383,P=u[Z];if(P.len)D-=P.len,m(P.lit,v,M,D,B,Q,L,F,G),M=b.c,D=b.lc;else{if(!P.p)throw new Error("hufDecode issues");let z;for(z=0;z<P.lit;z++){const te=l(g[P.p[z]]);for(;D<te&&Q.value<U;)f(M,D,B,Q),M=p.c,D=p.lc;if(D>=te&&h(g[P.p[z]])==(M>>D-te&(1<<te)-1)){D-=te,m(P.p[z],v,M,D,B,Q,L,F,G),M=b.c,D=b.lc;break}}if(z==P.lit)throw new Error("hufDecode issues")}}const q=8-R&7;for(M>>=q,D-=q;D>0;){const Z=u[M<<14-D&16383];if(Z.len)D-=Z.len,m(Z.lit,v,M,D,B,Q,L,F,G),M=b.c,D=b.lc;else throw new Error("hufDecode issues")}return!0}function S(g,u,B,Q,R,v){const k={value:0},L=B.value,F=_e(u,B),M=_e(u,B);B.value+=4;const D=_e(u,B);if(B.value+=4,F<0||F>=65537||M<0||M>=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,M,G),D>8*(Q-(B.value-L)))throw new Error("Something wrong with hufUncompress");d(G,F,M,U),T(G,U,g,B,D,M,v,R,k)}function _(g,u,B){for(let Q=0;Q<B;++Q)u[Q]=g[u[Q]]}function Y(g){for(let u=1;u<g.length;u++){const B=g[u-1]+g[u]-128;g[u]=B}}function V(g,u){let B=0,Q=Math.floor((g.length+1)/2),R=0;const v=g.length-1;for(;!(R>v||(u[R++]=g[B++],R>v));)u[R++]=g[Q++]}function K(g){let u=g.byteLength;const B=new Array;let Q=0;const R=new DataView(g);for(;u>0;){const v=R.getInt8(Q++);if(v<0){const k=-v;u-=k+1;for(let L=0;L<k;L++)B.push(R.getUint8(Q++))}else{const k=v;u-=2;const L=R.getUint8(Q++);for(let F=0;F<k+1;F++)B.push(L)}}return B}function W(g,u,B,Q,R,v){let k=new DataView(v.buffer);const L=B[g.idx[0]].width,F=B[g.idx[0]].height,M=3,D=Math.floor(L/8),G=Math.ceil(L/8),U=Math.ceil(F/8),q=L-(G-1)*8,Z=F-(U-1)*8,P={value:0},z=new Array(M),te=new Array(M),Ee=new Array(M),ve=new Array(M),it=new Array(M);for(let re=0;re<M;++re)it[re]=u[g.idx[re]],z[re]=re<1?0:z[re-1]+G*U,te[re]=new Float32Array(64),Ee[re]=new Uint16Array(64),ve[re]=new Uint16Array(G*64);for(let re=0;re<U;++re){let De=8;re==U-1&&(De=Z);let At=8;for(let ge=0;ge<G;++ge){ge==G-1&&(At=q);for(let pe=0;pe<M;++pe)Ee[pe].fill(0),Ee[pe][0]=R[z[pe]++],j(P,Q,Ee[pe]),X(Ee[pe],te[pe]),J(te[pe]);ee(te);for(let pe=0;pe<M;++pe)$(te[pe],ve[pe],ge*64)}let Fe=0;for(let ge=0;ge<M;++ge){const pe=B[g.idx[ge]].type;for(let St=8*re;St<8*re+De;++St){Fe=it[ge][St];for(let ps=0;ps<D;++ps){const bt=ps*64+(St&7)*8;k.setUint16(Fe+0*pe,ve[ge][bt+0],!0),k.setUint16(Fe+2*pe,ve[ge][bt+1],!0),k.setUint16(Fe+4*pe,ve[ge][bt+2],!0),k.setUint16(Fe+6*pe,ve[ge][bt+3],!0),k.setUint16(Fe+8*pe,ve[ge][bt+4],!0),k.setUint16(Fe+10*pe,ve[ge][bt+5],!0),k.setUint16(Fe+12*pe,ve[ge][bt+6],!0),k.setUint16(Fe+14*pe,ve[ge][bt+7],!0),Fe+=16*pe}}if(D!=G)for(let St=8*re;St<8*re+De;++St){const ps=it[ge][St]+8*D*2*pe,bt=D*64+(St&7)*8;for(let Ps=0;Ps<At;++Ps)k.setUint16(ps+Ps*2*pe,ve[ge][bt+Ps],!0)}}}const me=new Uint16Array(L);k=new DataView(v.buffer);for(let re=0;re<M;++re){B[g.idx[re]].decoded=!0;const De=B[g.idx[re]].type;if(B[re].type==2)for(let At=0;At<F;++At){const Fe=it[re][At];for(let ge=0;ge<L;++ge)me[ge]=k.getUint16(Fe+ge*2*De,!0);for(let ge=0;ge<L;++ge)k.setFloat32(Fe+ge*2*De,H(me[ge]),!0)}}}function j(g,u,B){let Q,R=1;for(;R<64;)Q=u[g.value],Q==65280?R=64:Q>>8==255?R+=Q&255:(B[R]=Q,R++),g.value++}function X(g,u){u[0]=H(g[0]),u[1]=H(g[1]),u[2]=H(g[5]),u[3]=H(g[6]),u[4]=H(g[14]),u[5]=H(g[15]),u[6]=H(g[27]),u[7]=H(g[28]),u[8]=H(g[2]),u[9]=H(g[4]),u[10]=H(g[7]),u[11]=H(g[13]),u[12]=H(g[16]),u[13]=H(g[26]),u[14]=H(g[29]),u[15]=H(g[42]),u[16]=H(g[3]),u[17]=H(g[8]),u[18]=H(g[12]),u[19]=H(g[17]),u[20]=H(g[25]),u[21]=H(g[30]),u[22]=H(g[41]),u[23]=H(g[43]),u[24]=H(g[9]),u[25]=H(g[11]),u[26]=H(g[18]),u[27]=H(g[24]),u[28]=H(g[31]),u[29]=H(g[40]),u[30]=H(g[44]),u[31]=H(g[53]),u[32]=H(g[10]),u[33]=H(g[19]),u[34]=H(g[23]),u[35]=H(g[32]),u[36]=H(g[39]),u[37]=H(g[45]),u[38]=H(g[52]),u[39]=H(g[54]),u[40]=H(g[20]),u[41]=H(g[22]),u[42]=H(g[33]),u[43]=H(g[38]),u[44]=H(g[46]),u[45]=H(g[51]),u[46]=H(g[55]),u[47]=H(g[60]),u[48]=H(g[21]),u[49]=H(g[34]),u[50]=H(g[37]),u[51]=H(g[47]),u[52]=H(g[50]),u[53]=H(g[56]),u[54]=H(g[59]),u[55]=H(g[61]),u[56]=H(g[35]),u[57]=H(g[36]),u[58]=H(g[48]),u[59]=H(g[49]),u[60]=H(g[57]),u[61]=H(g[58]),u[62]=H(g[62]),u[63]=H(g[63])}function J(g){const u=.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),v=.5*Math.cos(5*3.14159/16),k=.5*Math.cos(3*3.14159/8),L=.5*Math.cos(7*3.14159/16),F=new Array(4),M=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]=k*g[q+2],F[2]=Q*g[q+6],F[3]=k*g[q+6],M[0]=B*g[q+1]+R*g[q+3]+v*g[q+5]+L*g[q+7],M[1]=R*g[q+1]-L*g[q+3]-B*g[q+5]-v*g[q+7],M[2]=v*g[q+1]-B*g[q+3]+L*g[q+5]+R*g[q+7],M[3]=L*g[q+1]-v*g[q+3]+R*g[q+5]-B*g[q+7],D[0]=u*(g[q+0]+g[q+4]),D[3]=u*(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]+M[0],g[q+1]=G[1]+M[1],g[q+2]=G[2]+M[2],g[q+3]=G[3]+M[3],g[q+4]=G[3]-M[3],g[q+5]=G[2]-M[2],g[q+6]=G[1]-M[1],g[q+7]=G[0]-M[0]}for(let U=0;U<8;++U)F[0]=Q*g[16+U],F[1]=k*g[16+U],F[2]=Q*g[48+U],F[3]=k*g[48+U],M[0]=B*g[8+U]+R*g[24+U]+v*g[40+U]+L*g[56+U],M[1]=R*g[8+U]-L*g[24+U]-B*g[40+U]-v*g[56+U],M[2]=v*g[8+U]-B*g[24+U]+L*g[40+U]+R*g[56+U],M[3]=L*g[8+U]-v*g[24+U]+R*g[40+U]-B*g[56+U],D[0]=u*(g[U]+g[32+U]),D[3]=u*(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]+M[0],g[8+U]=G[1]+M[1],g[16+U]=G[2]+M[2],g[24+U]=G[3]+M[3],g[32+U]=G[3]-M[3],g[40+U]=G[2]-M[2],g[48+U]=G[1]-M[1],g[56+U]=G[0]-M[0]}function ee(g){for(let u=0;u<64;++u){const B=g[0][u],Q=g[1][u],R=g[2][u];g[0][u]=B+1.5747*R,g[1][u]=B-.1873*Q-.4682*R,g[2][u]=B+1.8556*Q}}function $(g,u,B){for(let Q=0;Q<64;++Q)u[B+Q]=os.toHalfFloat(ue(g[Q]))}function ue(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 Re(g){return new DataView(g.array.buffer,g.offset.value,g.size)}function se(g){const u=g.viewer.buffer.slice(g.offset.value,g.offset.value+g.size),B=new Uint8Array(K(u)),Q=new Uint8Array(B.length);return Y(B),V(B,Q),new DataView(Q.buffer)}function oe(g){const u=g.array.slice(g.offset.value,g.offset.value+g.size),B=_s(u),Q=new Uint8Array(B.length);return Y(B),V(B,Q),new DataView(Q.buffer)}function Ae(g){const u=g.viewer,B={value:g.offset.value},Q=new Uint16Array(g.columns*g.lines*(g.inputChannels.length*g.type)),R=new Uint8Array(8192);let v=0;const k=new Array(g.inputChannels.length);for(let Z=0,P=g.inputChannels.length;Z<P;Z++)k[Z]={},k[Z].start=v,k[Z].end=k[Z].start,k[Z].nx=g.columns,k[Z].ny=g.lines,k[Z].size=g.type,v+=k[Z].nx*k[Z].ny*k[Z].size;const L=ds(u,B),F=ds(u,B);if(F>=8192)throw new Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(L<=F)for(let Z=0;Z<F-L+1;Z++)R[Z+L]=Ye(u,B);const M=new Uint16Array(65536),D=i(R,M),G=_e(u,B);S(g.array,u,B,G,Q,v);for(let Z=0;Z<g.inputChannels.length;++Z){const P=k[Z];for(let z=0;z<k[Z].size;++z)x(Q,P.start+z,P.nx,P.size,P.ny,P.nx*P.size,D)}_(M,Q,v);let U=0;const q=new Uint8Array(Q.buffer.byteLength);for(let Z=0;Z<g.lines;Z++)for(let P=0;P<g.inputChannels.length;P++){const z=k[P],te=z.nx*z.size,Ee=new Uint8Array(Q.buffer,z.end*2,te*2);q.set(Ee,U),U+=te*2,z.end+=te}return new DataView(q.buffer)}function Te(g){const u=g.array.slice(g.offset.value,g.offset.value+g.size),B=_s(u),Q=g.inputChannels.length*g.lines*g.columns*g.totalBytes,R=new ArrayBuffer(Q),v=new DataView(R);let k=0,L=0;const F=new Array(4);for(let M=0;M<g.lines;M++)for(let D=0;D<g.inputChannels.length;D++){let G=0;switch(g.inputChannels[D].pixelType){case 1:F[0]=k,F[1]=F[0]+g.columns,k=F[1]+g.columns;for(let U=0;U<g.columns;++U){const q=B[F[0]++]<<8|B[F[1]++];G+=q,v.setUint16(L,G,!0),L+=2}break;case 2:F[0]=k,F[1]=F[0]+g.columns,F[2]=F[1]+g.columns,k=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,v.setUint32(L,G,!0),L+=4}break}}return v}function fe(g){const u=g.viewer,B={value:g.offset.value},Q=new Uint8Array(g.columns*g.lines*(g.inputChannels.length*g.type*2)),R={version:Ue(u,B),unknownUncompressedSize:Ue(u,B),unknownCompressedSize:Ue(u,B),acCompressedSize:Ue(u,B),dcCompressedSize:Ue(u,B),rleCompressedSize:Ue(u,B),rleUncompressedSize:Ue(u,B),rleRawSize:Ue(u,B),totalAcUncompressedCount:Ue(u,B),totalDcUncompressedCount:Ue(u,B),acCompression:Ue(u,B)};if(R.version<2)throw new Error("EXRLoader.parse: "+Yt.compression+" version "+R.version+" is unsupported");const v=new Array;let k=ds(u,B)-2;for(;k>0;){const P=ze(u.buffer,B),z=Ye(u,B),te=z>>2&3,Ee=(z>>4)-1,ve=new Int8Array([Ee])[0],it=Ye(u,B);v.push({name:P,index:ve,type:it,compression:te}),k-=P.length+3}const L=Yt.channels,F=new Array(g.inputChannels.length);for(let P=0;P<g.inputChannels.length;++P){const z=F[P]={},te=L[P];z.name=te.name,z.compression=0,z.decoded=!1,z.type=te.pixelType,z.pLinear=te.pLinear,z.width=g.columns,z.height=g.lines}const M={idx:new Array(3)};for(let P=0;P<g.inputChannels.length;++P){const z=F[P];for(let te=0;te<v.length;++te){const Ee=v[te];z.name==Ee.name&&(z.compression=Ee.compression,Ee.index>=0&&(M.idx[Ee.index]=P),z.offset=P)}}let D,G,U;if(R.acCompressedSize>0)switch(R.acCompression){case 0:D=new Uint16Array(R.totalAcUncompressedCount),S(g.array,u,B,R.acCompressedSize,D,R.totalAcUncompressedCount);break;case 1:const P=g.array.slice(B.value,B.value+R.totalAcUncompressedCount),z=_s(P);D=new Uint16Array(z.buffer),B.value+=R.totalAcUncompressedCount;break}if(R.dcCompressedSize>0){const P={array:g.array,offset:B,size:R.dcCompressedSize};G=new Uint16Array(oe(P).buffer),B.value+=R.dcCompressedSize}if(R.rleRawSize>0){const P=g.array.slice(B.value,B.value+R.rleCompressedSize),z=_s(P);U=K(z.buffer),B.value+=R.rleCompressedSize}let q=0;const Z=new Array(F.length);for(let P=0;P<Z.length;++P)Z[P]=new Array;for(let P=0;P<g.lines;++P)for(let z=0;z<F.length;++z)Z[z].push(q),q+=F[z].width*g.type*2;W(M,Z,F,D,G,Q);for(let P=0;P<F.length;++P){const z=F[P];if(!z.decoded)switch(z.compression){case 2:let te=0,Ee=0;for(let ve=0;ve<g.lines;++ve){let it=Z[P][te];for(let me=0;me<z.width;++me){for(let re=0;re<2*z.type;++re)Q[it++]=U[Ee+re*z.width*z.height];Ee++}te++}break;default:throw new Error("EXRLoader.parse: unsupported channel compression")}}return new DataView(Q.buffer)}function ze(g,u){const B=new Uint8Array(g);let Q=0;for(;B[u.value+Q]!=0;)Q+=1;const R=new TextDecoder().decode(B.slice(u.value,u.value+Q));return u.value=u.value+Q+1,R}function Lt(g,u,B){const Q=new TextDecoder().decode(new Uint8Array(g).slice(u.value,u.value+B));return u.value=u.value+B,Q}function Nt(g,u){const B=Ne(g,u),Q=_e(g,u);return[B,Q]}function is(g,u){const B=_e(g,u),Q=_e(g,u);return[B,Q]}function Ne(g,u){const B=g.getInt32(u.value,!0);return u.value=u.value+4,B}function _e(g,u){const B=g.getUint32(u.value,!0);return u.value=u.value+4,B}function Ut(g,u){const B=g[u.value];return u.value=u.value+1,B}function Ye(g,u){const B=g.getUint8(u.value);return u.value=u.value+1,B}const Ue=function(g,u){let B;return"getBigInt64"in DataView.prototype?B=Number(g.getBigInt64(u.value,!0)):B=g.getUint32(u.value+4,!0)+Number(g.getUint32(u.value,!0)<<32),u.value+=8,B};function je(g,u){const B=g.getFloat32(u.value,!0);return u.value+=4,B}function ko(g,u){return os.toHalfFloat(je(g,u))}function H(g){const u=(g&31744)>>10,B=g&1023;return(g>>15?-1:1)*(u?u===31?B?NaN:1/0:Math.pow(2,u-15)*(1+B/1024):6103515625e-14*(B/1024))}function ds(g,u){const B=g.getUint16(u.value,!0);return u.value+=2,B}function _o(g,u){return H(ds(g,u))}function Fo(g,u,B,Q){const R=B.value,v=[];for(;B.value<R+Q-1;){const k=ze(u,B),L=Ne(g,B),F=Ye(g,B);B.value+=3;const M=Ne(g,B),D=Ne(g,B);v.push({name:k,pixelType:L,pLinear:F,xSampling:M,ySampling:D})}return B.value+=1,v}function Lo(g,u){const B=je(g,u),Q=je(g,u),R=je(g,u),v=je(g,u),k=je(g,u),L=je(g,u),F=je(g,u),M=je(g,u);return{redX:B,redY:Q,greenX:R,greenY:v,blueX:k,blueY:L,whiteX:F,whiteY:M}}function No(g,u){const B=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],Q=Ye(g,u);return B[Q]}function Uo(g,u){const B=Ne(g,u),Q=Ne(g,u),R=Ne(g,u),v=Ne(g,u);return{xMin:B,yMin:Q,xMax:R,yMax:v}}function Go(g,u){const B=["INCREASING_Y","DECREASING_Y","RANDOM_Y"],Q=Ye(g,u);return B[Q]}function Po(g,u){const B=["ENVMAP_LATLONG","ENVMAP_CUBE"],Q=Ye(g,u);return B[Q]}function Oo(g,u){const B=["ONE_LEVEL","MIPMAP_LEVELS","RIPMAP_LEVELS"],Q=["ROUND_DOWN","ROUND_UP"],R=_e(g,u),v=_e(g,u),k=Ye(g,u);return{xSize:R,ySize:v,levelMode:B[k&15],roundingMode:Q[k>>4]}}function Ho(g,u){const B=je(g,u),Q=je(g,u);return[B,Q]}function jo(g,u){const B=je(g,u),Q=je(g,u),R=je(g,u);return[B,Q,R]}function qo(g,u,B,Q,R){if(Q==="string"||Q==="stringvector"||Q==="iccProfile")return Lt(u,B,R);if(Q==="chlist")return Fo(g,u,B,R);if(Q==="chromaticities")return Lo(g,B);if(Q==="compression")return No(g,B);if(Q==="box2i")return Uo(g,B);if(Q==="envmap")return Po(g,B);if(Q==="tiledesc")return Oo(g,B);if(Q==="lineOrder")return Go(g,B);if(Q==="float")return je(g,B);if(Q==="v2f")return Ho(g,B);if(Q==="v3f")return jo(g,B);if(Q==="int")return Ne(g,B);if(Q==="rational")return Nt(g,B);if(Q==="timecode")return is(g,B);if(Q==="preview")return B.value+=R,"skipped";B.value+=R}function zo(g,u){const B=Math.log2(g);return u=="ROUND_DOWN"?Math.floor(B):Math.ceil(B)}function Yo(g,u,B){let Q=0;switch(g.levelMode){case"ONE_LEVEL":Q=1;break;case"MIPMAP_LEVELS":Q=zo(Math.max(u,B),g.roundingMode)+1;break;case"RIPMAP_LEVELS":throw new Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.")}return Q}function yn(g,u,B,Q){const R=new Array(g);for(let v=0;v<g;v++){const k=1<<v;let L=u/k|0;Q=="ROUND_UP"&&L*k<u&&(L+=1);const F=Math.max(L,1);R[v]=(F+B-1)/B|0}return R}function Ko(){const g=this,u=g.offset,B={value:0};for(let Q=0;Q<g.tileCount;Q++){const R=Ne(g.viewer,u),v=Ne(g.viewer,u);u.value+=8,g.size=_e(g.viewer,u);const k=R*g.blockWidth,L=v*g.blockHeight;g.columns=k+g.blockWidth>g.width?g.width-k:g.blockWidth,g.lines=L+g.blockHeight>g.height?g.height-L:g.blockHeight;const F=g.columns*g.totalBytes,M=g.size<g.lines*F?g.uncompress(g):Re(g);u.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,Z=g.channelByteOffsets[q]*g.columns,P=g.decodeChannels[q];if(P===void 0)continue;B.value=G+Z;const z=(g.height-(1+L+D))*g.outLineWidth;for(let te=0;te<g.columns;te++){const Ee=z+(te+k)*g.outputChannels+P;g.byteArray[Ee]=g.getter(M,B)}}}}}function Jo(){const g=this,u=g.offset,B={value:0};for(let Q=0;Q<g.height/g.blockHeight;Q++){const R=Ne(g.viewer,u)-Yt.dataWindow.yMin;g.size=_e(g.viewer,u),g.lines=R+g.blockHeight>g.height?g.height-R:g.blockHeight;const v=g.columns*g.totalBytes,k=g.size<g.lines*v?g.uncompress(g):Re(g);u.value+=g.size;for(let L=0;L<g.blockHeight;L++){const F=Q*g.blockHeight,M=L+g.scanOrder(F);if(M>=g.height)continue;const D=L*v,G=(g.height-1-M)*g.outLineWidth;for(let U=0;U<g.inputChannels.length;U++){const q=Yt.channels[U].name,Z=g.channelByteOffsets[q]*g.columns,P=g.decodeChannels[q];if(P!==void 0){B.value=D+Z;for(let z=0;z<g.columns;z++){const te=G+z*g.outputChannels+P;g.byteArray[te]=g.getter(k,B)}}}}}}function Vo(g,u,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 v=!0;for(;v;){const k=ze(u,B);if(k==0)v=!1;else{const L=ze(u,B),F=_e(g,B),M=qo(g,u,B,L,F);M===void 0?console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${L}'.`):Q[k]=M}}if((R&-7)!=0)throw console.error("THREE.EXRHeader:",Q),new Error("THREE.EXRLoader: Provided file is currently unsupported.");return Q}function Wo(g,u,B,Q,R){const v={size:0,viewer:u,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":v.blockHeight=1,v.uncompress=Re;break;case"RLE_COMPRESSION":v.blockHeight=1,v.uncompress=se;break;case"ZIPS_COMPRESSION":v.blockHeight=1,v.uncompress=oe;break;case"ZIP_COMPRESSION":v.blockHeight=16,v.uncompress=oe;break;case"PIZ_COMPRESSION":v.blockHeight=32,v.uncompress=Ae;break;case"PXR24_COMPRESSION":v.blockHeight=16,v.uncompress=Te;break;case"DWAA_COMPRESSION":v.blockHeight=32,v.uncompress=fe;break;case"DWAB_COMPRESSION":v.blockHeight=256,v.uncompress=fe;break;default:throw new Error("EXRLoader.parse: "+g.compression+" is unsupported")}const k={};for(const D of g.channels)switch(D.name){case"Y":case"R":case"G":case"B":case"A":k[D.name]=!0,v.type=D.pixelType}let L=!1;if(k.R&&k.G&&k.B)L=!k.A,v.outputChannels=4,v.decodeChannels={R:0,G:1,B:2,A:3};else if(k.Y)v.outputChannels=1,v.decodeChannels={Y:0};else throw new Error("EXRLoader.parse: file contains unsupported data channels.");if(v.type==1)switch(R){case ut:v.getter=_o;break;case Ze:v.getter=ds;break}else if(v.type==2)switch(R){case ut:v.getter=je;break;case Ze:v.getter=ko}else throw new Error("EXRLoader.parse: unsupported pixelType "+v.type+" for "+g.compression+".");v.columns=v.width;const F=v.width*v.height*v.outputChannels;switch(R){case ut:v.byteArray=new Float32Array(F),L&&v.byteArray.fill(1,0,F);break;case Ze:v.byteArray=new Uint16Array(F),L&&v.byteArray.fill(15360,0,F);break;default:console.error("THREE.EXRLoader: unsupported type: ",R);break}let M=0;for(const D of g.channels)v.decodeChannels[D.name]!==void 0&&(v.channelByteOffsets[D.name]=M),M+=D.pixelType*2;if(v.totalBytes=M,v.outLineWidth=v.width*v.outputChannels,g.lineOrder==="INCREASING_Y"?v.scanOrder=D=>D:v.scanOrder=D=>v.height-1-D,v.outputChannels==4?(v.format=Gt,v.colorSpace=We):(v.format=as,v.colorSpace=Vs),g.spec.singleTile){v.blockHeight=g.tiles.ySize,v.blockWidth=g.tiles.xSize;const D=Yo(g.tiles,v.width,v.height),G=yn(D,v.width,g.tiles.xSize,g.tiles.roundingMode),U=yn(D,v.height,g.tiles.ySize,g.tiles.roundingMode);v.tileCount=G[0]*U[0];for(let q=0;q<D;q++)for(let Z=0;Z<U[q];Z++)for(let P=0;P<G[q];P++)Ue(u,Q);v.decode=Ko.bind(v)}else{v.blockWidth=v.width;const D=Math.ceil(v.height/v.blockHeight);for(let G=0;G<D;G++)Ue(u,Q);v.decode=Jo.bind(v)}return v}const Qn={value:0},vn=new DataView(e),Xo=new Uint8Array(e),Yt=Vo(vn,e,Qn),ns=Wo(Yt,vn,Xo,Qn,this.type);return ns.decode(),{header:Yt,width:ns.width,height:ns.height,data:ns.byteArray,format:ns.format,colorSpace:ns.colorSpace,type:this.type}}setDataType(e){return this.type=e,this}load(e,t,i,s){function n(a,r){a.colorSpace=r.colorSpace,a.minFilter=at,a.magFilter=at,a.generateMipmaps=!1,a.flipY=!1,t&&t(a,r)}return super.load(e,n,i,s)}}const vc=Object.freeze(Object.defineProperty({__proto__:null,EXRLoader:Za},Symbol.toStringTag,{value:"Module"}));class $a extends Kn{constructor(e){super(e),this.type=Ze}parse(e){const t=function(m,I){switch(m){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||""))}},i=function(m,I,E){I=I||1024;let C=m.pos,y=-1,w=0,x="",T=String.fromCharCode.apply(null,new Uint16Array(m.subarray(C,C+128)));for(;0>(y=T.indexOf(`
|
|
37
37
|
`))&&w<I&&C<m.byteLength;)x+=T,w+=T.length,C+=128,T+=String.fromCharCode.apply(null,new Uint16Array(m.subarray(C,C+128)));return-1<y?(m.pos+=w+y+1,x+T.slice(0,y)):!1},s=function(m){const I=/^#\?(\S+)/,E=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,C=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,y=/^\s*FORMAT=(\S+)\s*$/,w=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,x={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let T,S;for((m.pos>=m.byteLength||!(T=i(m)))&&t(1,"no header found"),(S=T.match(I))||t(3,"bad initial token"),x.valid|=1,x.programtype=S[1],x.string+=T+`
|
|
38
38
|
`;T=i(m),T!==!1;){if(x.string+=T+`
|
|
39
39
|
`,T.charAt(0)==="#"){x.comments+=T+`
|
|
40
|
-
`;continue}if((S=T.match(E))&&(x.gamma=parseFloat(S[1])),(S=T.match(C))&&(x.exposure=parseFloat(S[1])),(S=T.match(y))&&(x.valid|=2,x.format=S[1]),(S=T.match(w))&&(x.valid|=4,x.height=parseInt(S[1],10),x.width=parseInt(S[2],10)),x.valid&2&&x.valid&4)break}return x.valid&2||t(3,"missing format specifier"),x.valid&4||t(3,"missing image size specifier"),x},n=function(m,I,E){const C=I;if(C<8||C>32767||m[0]!==2||m[1]!==2||m[2]&128)return new Uint8Array(m);C!==(m[2]<<8|m[3])&&t(3,"wrong scanline width");const y=new Uint8Array(4*I*E);y.length||t(4,"unable to allocate buffer space");let w=0,x=0;const T=4*C,S=new Uint8Array(4),_=new Uint8Array(T);let Y=E;for(;Y>0&&x<m.byteLength;){x+4>m.byteLength&&t(1),S[0]=m[x++],S[1]=m[x++],S[2]=m[x++],S[3]=m[x++],(S[0]!=2||S[1]!=2||(S[2]<<8|S[3])!=C)&&t(3,"bad rgbe scanline format");let V=0,K;for(;V<T&&x<m.byteLength;){K=m[x++];const j=K>128;if(j&&(K-=128),(K===0||V+K>T)&&t(3,"bad scanline data"),j){const X=m[x++];for(let J=0;J<K;J++)_[V++]=X}else _.set(m.subarray(x,x+K),V),V+=K,x+=K}const W=C;for(let j=0;j<W;j++){let X=0;y[w]=_[j+X],X+=C,y[w+1]=_[j+X],X+=C,y[w+2]=_[j+X],X+=C,y[w+3]=_[j+X],w+=4}Y--}return y},a=function(m,I,E,C){const y=m[I+3],w=Math.pow(2,y-128)/255;E[C+0]=m[I+0]*w,E[C+1]=m[I+1]*w,E[C+2]=m[I+2]*w,E[C+3]=1},r=function(m,I,E,C){const y=m[I+3],w=Math.pow(2,y-128)/255;E[C+0]=os.toHalfFloat(Math.min(m[I+0]*w,65504)),E[C+1]=os.toHalfFloat(Math.min(m[I+1]*w,65504)),E[C+2]=os.toHalfFloat(Math.min(m[I+2]*w,65504)),E[C+3]=os.toHalfFloat(1)},A=new Uint8Array(e);A.pos=0;const c=s(A),l=c.width,h=c.height,d=n(A.subarray(A.pos),l,h);let p,f,b;switch(this.type){case ut:b=d.length/4;const m=new Float32Array(b*4);for(let E=0;E<b;E++)a(d,E*4,m,E*4);p=m,f=ut;break;case Ze:b=d.length/4;const I=new Uint16Array(b*4);for(let E=0;E<b;E++)r(d,E*4,I,E*4);p=I,f=Ze;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,i,s){function n(a,r){switch(a.type){case ut:case Ze:a.colorSpace=We,a.minFilter=at,a.magFilter=at,a.generateMipmaps=!1,a.flipY=!0;break}t&&t(a,r)}return super.load(e,n,i,s)}}const xc=Object.freeze(Object.defineProperty({__proto__:null,RGBELoader:$a},Symbol.toStringTag,{value:"Module"}));function eo(o,e,t){const i=t.length-o-1;if(e>=t[i])return i-1;if(e<=t[o])return o;let s=o,n=i,a=Math.floor((s+n)/2);for(;e<t[a]||e>=t[a+1];)e<t[a]?n=a:s=a,a=Math.floor((s+n)/2);return a}function Sc(o,e,t,i){const s=[],n=[],a=[];s[0]=1;for(let r=1;r<=t;++r){n[r]=e-i[o+1-r],a[r]=i[o+r]-e;let A=0;for(let c=0;c<r;++c){const l=a[c+1],h=n[r-c],d=s[c]/(l+h);s[c]=A+l*d,A=h*d}s[r]=A}return s}function Tc(o,e,t,i){const s=eo(o,i,e),n=Sc(s,i,o,e),a=new Mt(0,0,0,0);for(let r=0;r<=o;++r){const A=t[s-o+r],c=n[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 Dc(o,e,t,i,s){const n=[];for(let h=0;h<=t;++h)n[h]=0;const a=[];for(let h=0;h<=i;++h)a[h]=n.slice(0);const r=[];for(let h=0;h<=t;++h)r[h]=n.slice(0);r[0][0]=1;const A=n.slice(0),c=n.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 m=r[p][h-1]/r[h][p];r[p][h]=d+f*m,d=b*m}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]=n.slice(0);f[0][0]=1;for(let b=1;b<=i;++b){let m=0;const I=h-b,E=t-b;h>=b&&(f[p][0]=f[d][0]/r[E+1][I],m=f[p][0]*r[I][E]);const C=I>=-1?1:-I,y=h-1<=E?b-1:t-h;for(let x=C;x<=y;++x)f[p][x]=(f[d][x]-f[d][x-1])/r[E+1][I+x],m+=f[p][x]*r[I+x][E];h<=E&&(f[p][b]=-f[d][b-1]/r[E+1][h],m+=f[p][b]*r[h][E]),a[b][h]=m;const w=d;d=p,p=w}}let l=t;for(let h=1;h<=i;++h){for(let d=0;d<=t;++d)a[h][d]*=l;l*=t-h}return a}function Rc(o,e,t,i,s){const n=s<o?s:o,a=[],r=eo(o,i,e),A=Dc(r,i,o,n,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<=n;++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=n+1;l<=s+1;++l)a[l]=new Mt(0,0,0);return a}function Mc(o,e){let t=1;for(let s=2;s<=o;++s)t*=s;let i=1;for(let s=2;s<=e;++s)i*=s;for(let s=2;s<=o-e;++s)i*=s;return t/i}function kc(o){const e=o.length,t=[],i=[];for(let n=0;n<e;++n){const a=o[n];t[n]=new N(a.x,a.y,a.z),i[n]=a.w}const s=[];for(let n=0;n<e;++n){const a=t[n].clone();for(let r=1;r<=n;++r)a.sub(s[n-r].clone().multiplyScalar(Mc(n,r)*i[r]));s[n]=a.divideScalar(i[0])}return s}function _c(o,e,t,i,s){const n=Rc(o,e,t,i,s);return kc(n)}class Fc extends Cr{constructor(e,t,i,s,n){super(),this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=s||0,this.endKnot=n||this.knots.length-1;for(let a=0;a<i.length;++a){const r=i[a];this.controlPoints[a]=new Mt(r.x,r.y,r.z,r.w)}}getPoint(e,t=new N){const i=t,s=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),n=Tc(this.degree,this.knots,this.controlPoints,s);return n.w!==1&&n.divideScalar(n.w),i.set(n.x,n.y,n.z)}getTangent(e,t=new N){const i=t,s=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),n=_c(this.degree,this.knots,this.controlPoints,s,1);return i.copy(n[1]).normalize(),i}}let ie,Se,Ve;class Lc extends Tt{constructor(e){super(e)}load(e,t,i,s){const n=this,a=n.path===""?Jt.extractUrlBase(e):n.path,r=new dt(this.manager);r.setPath(n.path),r.setResponseType("arraybuffer"),r.setRequestHeader(n.requestHeader),r.setWithCredentials(n.withCredentials),r.load(e,function(A){try{t(n.parse(A,a))}catch(c){s?s(c):console.error(c),n.manager.itemError(e)}},i,s)}parse(e,t){if(Hc(e))ie=new Oc().parse(e);else{const s=ao(e);if(!jc(s))throw new Error("THREE.FBXLoader: Unknown format.");if(io(s)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+io(s));ie=new Pc().parse(s)}const i=new ui(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new Nc(i,this.manager).parse(ie)}getFbxTree(){return ie}}class Nc{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){Se=this.parseConnections();const e=this.parseImages(),t=this.parseTextures(e),i=this.parseMaterials(t),s=this.parseDeformers(),n=new Uc().parse(s);return this.parseScene(s,n,i),Ve}parseConnections(){const e=new Map;return"Connections"in ie&&ie.Connections.connections.forEach(function(t){const i=t[0],s=t[1],n=t[2];e.has(i)||e.set(i,{parents:[],children:[]});const a={ID:s,relationship:n};e.get(i).parents.push(a),e.has(s)||e.set(s,{parents:[],children:[]});const r={ID:i,relationship:n};e.get(s).children.push(r)}),e}parseImages(){const e={},t={};if("Video"in ie.Objects){const i=ie.Objects.Video;for(const s in i){const n=i[s],a=parseInt(s);if(e[a]=n.RelativeFilename||n.Filename,"Content"in n){const r=n.Content instanceof ArrayBuffer&&n.Content.byteLength>0,A=typeof n.Content=="string"&&n.Content!=="";if(r||A){const c=this.parseImage(i[s]);t[n.RelativeFilename||n.Filename]=c}}}}for(const i in e){const s=e[i];t[s]!==void 0?e[i]=t[s]:e[i]=e[i].split("\\").pop()}return e}parseImage(e){const t=e.Content,i=e.RelativeFilename||e.Filename,s=i.slice(i.lastIndexOf(".")+1).toLowerCase();let n;switch(s){case"bmp":n="image/bmp";break;case"jpg":case"jpeg":n="image/jpeg";break;case"png":n="image/png";break;case"tif":n="image/tiff";break;case"tga":this.manager.getHandler(".tga")===null&&console.warn("FBXLoader: TGA loader not found, skipping ",i),n="image/tga";break;default:console.warn('FBXLoader: Image type "'+s+'" is not supported.');return}if(typeof t=="string")return"data:"+n+";base64,"+t;{const a=new Uint8Array(t);return window.URL.createObjectURL(new Blob([a],{type:n}))}}parseTextures(e){const t=new Map;if("Texture"in ie.Objects){const i=ie.Objects.Texture;for(const s in i){const n=this.parseTexture(i[s],e);t.set(parseInt(s),n)}}return t}parseTexture(e,t){const i=this.loadTexture(e,t);i.ID=e.id,i.name=e.attrName;const s=e.WrapModeU,n=e.WrapModeV,a=s!==void 0?s.value:0,r=n!==void 0?n.value:0;if(i.wrapS=a===0?Vt:qs,i.wrapT=r===0?Vt:qs,"Scaling"in e){const A=e.Scaling.value;i.repeat.x=A[0],i.repeat.y=A[1]}if("Translation"in e){const A=e.Translation.value;i.offset.x=A[0],i.offset.y=A[1]}return i}loadTexture(e,t){const i=new Set(["tga","tif","tiff","exr","dds","hdr","ktx2"]),s=e.FileName.split(".").pop().toLowerCase(),n=i.has(s)?this.manager.getHandler(`.${s}`):this.textureLoader;if(!n)return console.warn(`FBXLoader: ${s.toUpperCase()} loader not found, creating placeholder texture for`,e.RelativeFilename),new Ci;const a=n.path;a||n.setPath(this.textureLoader.path);const r=Se.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)&&n.setPath(void 0));const c=n.load(A);return n.setPath(a),c}parseMaterials(e){const t=new Map;if("Material"in ie.Objects){const i=ie.Objects.Material;for(const s in i){const n=this.parseMaterial(i[s],e);n!==null&&t.set(parseInt(s),n)}}return t}parseMaterial(e,t){const i=e.id,s=e.attrName;let n=e.ShadingModel;if(typeof n=="object"&&(n=n.value),!Se.has(i))return null;const a=this.parseParameters(e,t,i);let r;switch(n.toLowerCase()){case"phong":r=new Cs;break;case"lambert":r=new Br;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',n),r=new Cs;break}return r.setValues(a),r.name=s,r}parseParameters(e,t,i){const s={};e.BumpFactor&&(s.bumpScale=e.BumpFactor.value),e.Diffuse?s.color=Xe.toWorkingColorSpace(new we().fromArray(e.Diffuse.value),le):e.DiffuseColor&&(e.DiffuseColor.type==="Color"||e.DiffuseColor.type==="ColorRGB")&&(s.color=Xe.toWorkingColorSpace(new we().fromArray(e.DiffuseColor.value),le)),e.DisplacementFactor&&(s.displacementScale=e.DisplacementFactor.value),e.Emissive?s.emissive=Xe.toWorkingColorSpace(new we().fromArray(e.Emissive.value),le):e.EmissiveColor&&(e.EmissiveColor.type==="Color"||e.EmissiveColor.type==="ColorRGB")&&(s.emissive=Xe.toWorkingColorSpace(new we().fromArray(e.EmissiveColor.value),le)),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 we().fromArray(e.Specular.value),le):e.SpecularColor&&e.SpecularColor.type==="Color"&&(s.specular=Xe.toWorkingColorSpace(new we().fromArray(e.SpecularColor.value),le));const n=this;return Se.get(i).children.forEach(function(a){const r=a.relationship;switch(r){case"Bump":s.bumpMap=n.getTexture(t,a.ID);break;case"Maya|TEX_ao_map":s.aoMap=n.getTexture(t,a.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":s.map=n.getTexture(t,a.ID),s.map!==void 0&&(s.map.colorSpace=le);break;case"DisplacementColor":s.displacementMap=n.getTexture(t,a.ID);break;case"EmissiveColor":s.emissiveMap=n.getTexture(t,a.ID),s.emissiveMap!==void 0&&(s.emissiveMap.colorSpace=le);break;case"NormalMap":case"Maya|TEX_normal_map":s.normalMap=n.getTexture(t,a.ID);break;case"ReflectionColor":s.envMap=n.getTexture(t,a.ID),s.envMap!==void 0&&(s.envMap.mapping=wr,s.envMap.colorSpace=le);break;case"SpecularColor":s.specularMap=n.getTexture(t,a.ID),s.specularMap!==void 0&&(s.specularMap.colorSpace=le);break;case"TransparentColor":case"TransparencyFactor":s.alphaMap=n.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 ie.Objects&&t in ie.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=Se.get(t).children[0].ID),e.get(t)}parseDeformers(){const e={},t={};if("Deformer"in ie.Objects){const i=ie.Objects.Deformer;for(const s in i){const n=i[s],a=Se.get(parseInt(s));if(n.attrType==="Skin"){const r=this.parseSkeleton(a,i);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(n.attrType==="BlendShape"){const r={id:s};r.rawTargets=this.parseMorphTargets(a,i),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 i=[];return e.children.forEach(function(s){const n=t[s.ID];if(n.attrType!=="Cluster")return;const a={ID:s.ID,indices:[],weights:[],transformLink:new ce().fromArray(n.TransformLink.a)};"Indexes"in n&&(a.indices=n.Indexes.a,a.weights=n.Weights.a),i.push(a)}),{rawBones:i,bones:[]}}parseMorphTargets(e,t){const i=[];for(let s=0;s<e.children.length;s++){const n=e.children[s],a=t[n.ID],r={name:a.attrName,initialWeight:a.DeformPercent,id:a.id,fullWeights:a.FullWeights.a};if(a.attrType!=="BlendShapeChannel")return;r.geoID=Se.get(parseInt(n.ID)).children.filter(function(A){return A.relationship===void 0})[0].ID,i.push(r)}return i}parseScene(e,t,i){Ve=new Wt;const s=this.parseModels(e.skeletons,t,i),n=ie.Objects.Model,a=this;s.forEach(function(A){const c=n[A.ID];a.setLookAtProperties(A,c),Se.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=no(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 Gc().parse();Ve.children.length===1&&Ve.children[0].isGroup&&(Ve.children[0].animations=r,Ve=Ve.children[0]),Ve.animations=r}parseModels(e,t,i){const s=new Map,n=ie.Objects.Model;for(const a in n){const r=parseInt(a),A=n[a],c=Se.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,i);break;case"NurbsCurve":l=this.createCurve(c,t);break;case"LimbNode":case"Root":l=new Ii;break;case"Null":default:l=new Wt;break}l.name=A.attrName?Rt.sanitizeNodeName(A.attrName):"",l.userData.originalName=A.attrName,l.ID=r}this.getTransformData(l,A),s.set(r,l)}return s}buildSkeleton(e,t,i,s){let n=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=n;n=new Ii,n.matrixWorld.copy(c.transformLink),n.name=s?Rt.sanitizeNodeName(s):"",n.userData.originalName=s,n.ID=i,A.bones[l]=n,h!==null&&n.add(h)}})}}),n}createCamera(e){let t,i;if(e.children.forEach(function(s){const n=ie.Objects.NodeAttribute[s.ID];n!==void 0&&(i=n)}),i===void 0)t=new Bt;else{let s=0;i.CameraProjectionType!==void 0&&i.CameraProjectionType.value===1&&(s=1);let n=1;i.NearPlane!==void 0&&(n=i.NearPlane.value/1e3);let a=1e3;i.FarPlane!==void 0&&(a=i.FarPlane.value/1e3);let r=window.innerWidth,A=window.innerHeight;i.AspectWidth!==void 0&&i.AspectHeight!==void 0&&(r=i.AspectWidth.value,A=i.AspectHeight.value);const c=r/A;let l=45;i.FieldOfView!==void 0&&(l=i.FieldOfView.value);const h=i.FocalLength?i.FocalLength.value:null;switch(s){case 0:t=new Os(l,c,n,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,i;if(e.children.forEach(function(s){const n=ie.Objects.NodeAttribute[s.ID];n!==void 0&&(i=n)}),i===void 0)t=new Bt;else{let s;i.LightType===void 0?s=0:s=i.LightType.value;let n=16777215;i.Color!==void 0&&(n=Xe.toWorkingColorSpace(new we().fromArray(i.Color.value),le));let a=i.Intensity===void 0?1:i.Intensity.value/100;i.CastLightOnObject!==void 0&&i.CastLightOnObject.value===0&&(a=0);let r=0;i.FarAttenuationEnd!==void 0&&(i.EnableFarAttenuation!==void 0&&i.EnableFarAttenuation.value===0?r=0:r=i.FarAttenuationEnd.value);const A=1;switch(s){case 0:t=new pi(n,a,r,A);break;case 1:t=new Tn(n,a);break;case 2:let c=Math.PI/3;i.InnerAngle!==void 0&&(c=Ce.degToRad(i.InnerAngle.value));let l=0;i.OuterAngle!==void 0&&(l=Ce.degToRad(i.OuterAngle.value),l=Math.max(l,1)),t=new Sn(n,a,r,c,l,A);break;default:console.warn("THREE.FBXLoader: Unknown light type "+i.LightType.value+", defaulting to a PointLight."),t=new pi(n,a);break}i.CastShadows!==void 0&&i.CastShadows.value===1&&(t.castShadow=!0)}return t}createMesh(e,t,i){let s,n=null,a=null;const r=[];if(e.children.forEach(function(A){t.has(A.ID)&&(n=t.get(A.ID)),i.has(A.ID)&&r.push(i.get(A.ID))}),r.length>1?a=r:r.length>0?a=r[0]:(a=new Cs({name:Tt.DEFAULT_MATERIAL_NAME,color:13421772}),r.push(a)),"color"in n.attributes&&r.forEach(function(A){A.vertexColors=!0}),n.groups.length>0){let A=!1;for(let c=0,l=n.groups.length;c<l;c++){const h=n.groups[c];(h.materialIndex<0||h.materialIndex>=r.length)&&(h.materialIndex=r.length,A=!0)}if(A){const c=new mi;r.push(c)}}return n.FBX_Deformer?(s=new kn(n,a),s.normalizeSkinWeights()):s=new O(n,a),s}createCurve(e,t){const i=e.children.reduce(function(n,a){return t.has(a.ID)&&(n=t.get(a.ID)),n},null),s=new Dt({name:Tt.DEFAULT_MATERIAL_NAME,color:3342591,linewidth:1});return new pt(i,s)}getTransformData(e,t){const i={};"InheritType"in t&&(i.inheritType=parseInt(t.InheritType.value)),"RotationOrder"in t?i.eulerOrder=Fs(t.RotationOrder.value):i.eulerOrder=Fs(0),"Lcl_Translation"in t&&(i.translation=t.Lcl_Translation.value),"PreRotation"in t&&(i.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(i.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(i.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(i.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(i.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(i.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(i.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(i.rotationPivot=t.RotationPivot.value),e.userData.transformData=i}setLookAtProperties(e,t){"LookAtProperty"in t&&Se.get(e.ID).children.forEach(function(i){if(i.relationship==="LookAtProperty"){const s=ie.Objects.Model[i.ID];if("Lcl_Translation"in s){const n=s.Lcl_Translation.value;e.target!==void 0?(e.target.position.fromArray(n),Ve.add(e.target)):e.lookAt(new N().fromArray(n))}}})}bindSkeleton(e,t,i){const s=this.parsePoseNodes();for(const n in e){const a=e[n];Se.get(parseInt(a.ID)).parents.forEach(function(r){if(t.has(r.ID)){const A=r.ID;Se.get(A).parents.forEach(function(c){i.has(c.ID)&&i.get(c.ID).bind(new Fn(a.bones),s[c.ID])})}})}}parsePoseNodes(){const e={};if("Pose"in ie.Objects){const t=ie.Objects.Pose;for(const i in t)if(t[i].attrType==="BindPose"&&t[i].NbPoseNodes>0){const s=t[i].PoseNode;Array.isArray(s)?s.forEach(function(n){e[n.Node]=new ce().fromArray(n.Matrix.a)}):e[s.Node]=new ce().fromArray(s.Matrix.a)}}return e}addGlobalSceneSettings(){if("GlobalSettings"in ie){if("AmbientColor"in ie.GlobalSettings){const e=ie.GlobalSettings.AmbientColor.value,t=e[0],i=e[1],s=e[2];if(t!==0||i!==0||s!==0){const n=new we().setRGB(t,i,s,le);Ve.add(new yr(n,1))}}"UnitScaleFactor"in ie.GlobalSettings&&(Ve.userData.unitScaleFactor=ie.GlobalSettings.UnitScaleFactor.value)}}}class Uc{constructor(){this.negativeMaterialIndices=!1}parse(e){const t=new Map;if("Geometry"in ie.Objects){const i=ie.Objects.Geometry;for(const s in i){const n=Se.get(parseInt(s)),a=this.parseGeometry(n,i[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,i){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,i);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,i){const s=i.skeletons,n=[],a=e.parents.map(function(h){return ie.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){i.morphTargets[h.ID]!==void 0&&n.push(i.morphTargets[h.ID])});const A=a[0],c={};"RotationOrder"in A&&(c.eulerOrder=Fs(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=no(c);return this.genGeometry(t,r,n,l)}genGeometry(e,t,i,s){const n=new ct;e.attrName&&(n.name=e.attrName);const a=this.parseGeoNode(e,t),r=this.genBuffers(a),A=new Me(r.vertex,3);if(A.applyMatrix4(s),n.setAttribute("position",A),r.colors.length>0&&n.setAttribute("color",new Me(r.colors,3)),t&&(n.setAttribute("skinIndex",new Qr(r.weightsIndices,4)),n.setAttribute("skinWeight",new Me(r.vertexWeights,4)),n.FBX_Deformer=t),r.normal.length>0){const c=new Jn().getNormalMatrix(s),l=new Me(r.normal,3);l.applyNormalMatrix(c),n.setAttribute("normal",l)}if(r.uvs.forEach(function(c,l){const h=l===0?"uv":`uv${l}`;n.setAttribute(h,new Me(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&&(n.addGroup(l,d-l,c),c=h,l=d)}),n.groups.length>0){const h=n.groups[n.groups.length-1],d=h.start+h.count;d!==r.materialIndex.length&&n.addGroup(d,r.materialIndex.length-d,c)}n.groups.length===0&&n.addGroup(0,r.materialIndex.length,r.materialIndex[0])}return this.addMorphTargets(n,e,i,s),n}parseGeoNode(e,t){const i={};if(i.vertexPositions=e.Vertices!==void 0?e.Vertices.a:[],i.vertexIndices=e.PolygonVertexIndex!==void 0?e.PolygonVertexIndex.a:[],e.LayerElementColor&&(i.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(i.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(i.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){i.uv=[];let s=0;for(;e.LayerElementUV[s];)e.LayerElementUV[s].UV&&i.uv.push(this.parseUVs(e.LayerElementUV[s])),s++}return i.weightTable={},t!==null&&(i.skeleton=t,t.rawBones.forEach(function(s,n){s.indices.forEach(function(a,r){i.weightTable[a]===void 0&&(i.weightTable[a]=[]),i.weightTable[a].push({id:n,weight:s.weights[r]})})})),i}genBuffers(e){const t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let i=0,s=0,n=!1,a=[],r=[],A=[],c=[],l=[],h=[];const d=this;return e.vertexIndices.forEach(function(p,f){let b,m=!1;p<0&&(p=p^-1,m=!0);let I=[],E=[];if(a.push(p*3,p*3+1,p*3+2),e.color){const C=ii(f,i,p,e.color);A.push(C[0],C[1],C[2])}if(e.skeleton){if(e.weightTable[p]!==void 0&&e.weightTable[p].forEach(function(C){E.push(C.weight),I.push(C.id)}),E.length>4){n||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),n=!0);const C=[0,0,0,0],y=[0,0,0,0];E.forEach(function(w,x){let T=w,S=I[x];y.forEach(function(_,Y,V){if(T>_){V[Y]=T,T=_;const K=C[Y];C[Y]=S,S=K}})}),I=C,E=y}for(;E.length<4;)E.push(0),I.push(0);for(let C=0;C<4;++C)l.push(E[C]),h.push(I[C])}if(e.normal){const C=ii(f,i,p,e.normal);r.push(C[0],C[1],C[2])}e.material&&e.material.mappingType!=="AllSame"&&(b=ii(f,i,p,e.material)[0],b<0&&(d.negativeMaterialIndices=!0,b=0)),e.uv&&e.uv.forEach(function(C,y){const w=ii(f,i,p,C);c[y]===void 0&&(c[y]=[]),c[y].push(w[0]),c[y].push(w[1])}),s++,m&&(d.genFace(t,e,a,b,r,A,c,l,h,s),i++,s=0,a=[],r=[],A=[],c=[],l=[],h=[])}),t}getNormalNewell(e){const t=new N(0,0,0);for(let i=0;i<e.length;i++){const s=e[i],n=e[(i+1)%e.length];t.x+=(s.y-n.y)*(s.z+n.z),t.y+=(s.z-n.z)*(s.x+n.x),t.z+=(s.x-n.x)*(s.y+n.y)}return t.normalize(),t}getNormalTangentAndBitangent(e){const t=this.getNormalNewell(e),i=(Math.abs(t.z)>.5?new N(0,1,0):new N(0,0,1)).cross(t).normalize(),s=t.clone().cross(i).normalize();return{normal:t,tangent:i,bitangent:s}}flattenVertex(e,t,i){return new Le(e.dot(t),e.dot(i))}genFace(e,t,i,s,n,a,r,A,c,l){let h;if(l>3){const d=[],p=t.baseVertexPositions||t.vertexPositions;for(let I=0;I<i.length;I+=3)d.push(new N(p[i[I]],p[i[I+1]],p[i[I+2]]));const{tangent:f,bitangent:b}=this.getNormalTangentAndBitangent(d),m=[];for(const I of d)m.push(this.flattenVertex(I,f,b));h=vr.triangulateShape(m,[])}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[i[d*3]]),e.vertex.push(t.vertexPositions[i[d*3+1]]),e.vertex.push(t.vertexPositions[i[d*3+2]]),e.vertex.push(t.vertexPositions[i[p*3]]),e.vertex.push(t.vertexPositions[i[p*3+1]]),e.vertex.push(t.vertexPositions[i[p*3+2]]),e.vertex.push(t.vertexPositions[i[f*3]]),e.vertex.push(t.vertexPositions[i[f*3+1]]),e.vertex.push(t.vertexPositions[i[f*3+2]]),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(n[d*3]),e.normal.push(n[d*3+1]),e.normal.push(n[d*3+2]),e.normal.push(n[p*3]),e.normal.push(n[p*3+1]),e.normal.push(n[p*3+2]),e.normal.push(n[f*3]),e.normal.push(n[f*3+1]),e.normal.push(n[f*3+2])),t.uv&&t.uv.forEach(function(b,m){e.uvs[m]===void 0&&(e.uvs[m]=[]),e.uvs[m].push(r[m][d*2]),e.uvs[m].push(r[m][d*2+1]),e.uvs[m].push(r[m][p*2]),e.uvs[m].push(r[m][p*2+1]),e.uvs[m].push(r[m][f*2]),e.uvs[m].push(r[m][f*2+1])})}addMorphTargets(e,t,i,s){if(i.length===0)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];const n=this;i.forEach(function(a){a.rawTargets.forEach(function(r){const A=ie.Objects.Geometry[r.geoID];A!==void 0&&n.genMorphGeometry(e,t,A,s,r.name)})})}genMorphGeometry(e,t,i,s,n){const a=t.Vertices!==void 0?t.Vertices.a:[],r=t.PolygonVertexIndex!==void 0?t.PolygonVertexIndex.a:[],A=i.Vertices!==void 0?i.Vertices.a:[],c=i.Indexes!==void 0?i.Indexes.a:[],l=e.attributes.position.count*3,h=new Float32Array(l);for(let b=0;b<c.length;b++){const m=c[b]*3;h[m]=A[b*3],h[m+1]=A[b*3+1],h[m+2]=A[b*3+2]}const d={vertexIndices:r,vertexPositions:h,baseVertexPositions:a},p=this.genBuffers(d),f=new Me(p.vertex,3);f.name=n||i.attrName,f.applyMatrix4(s),e.morphAttributes.position.push(f)}parseNormals(e){const t=e.MappingInformationType,i=e.ReferenceInformationType,s=e.Normals.a;let n=[];return i==="IndexToDirect"&&("NormalIndex"in e?n=e.NormalIndex.a:"NormalsIndex"in e&&(n=e.NormalsIndex.a)),{dataSize:3,buffer:s,indices:n,mappingType:t,referenceType:i}}parseUVs(e){const t=e.MappingInformationType,i=e.ReferenceInformationType,s=e.UV.a;let n=[];return i==="IndexToDirect"&&(n=e.UVIndex.a),{dataSize:2,buffer:s,indices:n,mappingType:t,referenceType:i}}parseVertexColors(e){if(!e.Colors)return;const t=e.MappingInformationType,i=e.ReferenceInformationType,s=e.Colors.a;let n=[];i==="IndexToDirect"&&(n=e.ColorIndex.a);for(let a=0,r=new we;a<s.length;a+=4)r.fromArray(s,a),Xe.toWorkingColorSpace(r,le),r.toArray(s,a);return{dataSize:4,buffer:s,indices:n,mappingType:t,referenceType:i}}parseMaterialIndices(e){const t=e.MappingInformationType,i=e.ReferenceInformationType;if(t==="NoMappingInformation")return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:i};const s=e.Materials.a,n=[];for(let a=0;a<s.length;++a)n.push(a);return{dataSize:1,buffer:s,indices:n,mappingType:t,referenceType:i}}parseNurbsGeometry(e){const t=parseInt(e.Order);if(isNaN(t))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",e.Order,e.id),new ct;const i=t-1,s=e.KnotVector.a,n=[],a=e.Points.a;for(let l=0,h=a.length;l<h;l+=4)n.push(new Mt().fromArray(a,l));let r,A;if(e.Form==="Closed")n.push(n[0]);else if(e.Form==="Periodic"){r=i,A=s.length-1-r;for(let l=0;l<i;++l)n.push(n[l])}const c=new Fc(i,s,n,r,A).getPoints(n.length*12);return new ct().setFromPoints(c)}}class Gc{parse(){const e=[],t=this.parseClips();if(t!==void 0)for(const i in t){const s=t[i],n=this.addClip(s);e.push(n)}return e}parseClips(){if(ie.Objects.AnimationCurve===void 0)return;const e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);const t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){const e=ie.Objects.AnimationCurveNode,t=new Map;for(const i in e){const s=e[i];if(s.attrName.match(/S|R|T|DeformPercent/)!==null){const n={id:s.id,attr:s.attrName,curves:{}};t.set(n.id,n)}}return t}parseAnimationCurves(e){const t=ie.Objects.AnimationCurve;for(const i in t){const s={id:t[i].id,times:t[i].KeyTime.a.map(qc),values:t[i].KeyValueFloat.a},n=Se.get(s.id);if(n!==void 0){const a=n.parents[0].ID,r=n.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=ie.Objects.AnimationLayer,i=new Map;for(const s in t){const n=[],a=Se.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(n[A]===void 0){const l=Se.get(r.ID).parents.filter(function(h){return h.relationship!==void 0})[0].ID;if(l!==void 0){const h=ie.Objects.Model[l.toString()];if(h===void 0){console.warn("THREE.FBXLoader: Encountered a unused curve.",r);return}const d={modelName:h.attrName?Rt.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 ce),"PreRotation"in h&&(d.preRotation=h.PreRotation.value),"PostRotation"in h&&(d.postRotation=h.PostRotation.value),n[A]=d}}n[A]&&(n[A][c.attr]=c)}else if(c.curves.morph!==void 0){if(n[A]===void 0){const l=Se.get(r.ID).parents.filter(function(m){return m.relationship!==void 0})[0].ID,h=Se.get(l).parents[0].ID,d=Se.get(h).parents[0].ID,p=Se.get(d).parents[0].ID,f=ie.Objects.Model[p],b={modelName:f.attrName?Rt.sanitizeNodeName(f.attrName):"",morphName:ie.Objects.Deformer[l].attrName};n[A]=b}n[A][c.attr]=c}}}),i.set(parseInt(s),n))}return i}parseAnimStacks(e){const t=ie.Objects.AnimationStack,i={};for(const s in t){const n=Se.get(parseInt(s)).children;n.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(n[0].ID);i[s]={name:t[s].attrName,layer:a}}return i}addClip(e){let t=[];const i=this;return e.layer.forEach(function(s){t=t.concat(i.generateTracks(s))}),new Ln(e.name,-1,t)}generateTracks(e){const t=[];let i=new N,s=new N;if(e.transform&&e.transform.decompose(i,new ye,s),i=i.toArray(),s=s.toArray(),e.T!==void 0&&Object.keys(e.T.curves).length>0){const n=this.generateVectorTrack(e.modelName,e.T.curves,i,"position");n!==void 0&&t.push(n)}if(e.R!==void 0&&Object.keys(e.R.curves).length>0){const n=this.generateRotationTrack(e.modelName,e.R.curves,e.preRotation,e.postRotation,e.eulerOrder);n!==void 0&&t.push(n)}if(e.S!==void 0&&Object.keys(e.S.curves).length>0){const n=this.generateVectorTrack(e.modelName,e.S.curves,s,"scale");n!==void 0&&t.push(n)}if(e.DeformPercent!==void 0){const n=this.generateMorphTrack(e);n!==void 0&&t.push(n)}return t}generateVectorTrack(e,t,i,s){const n=this.getTimesForAllAxes(t),a=this.getKeyframeTrackValues(n,t,i);return new Bi(e+"."+s,n,a)}generateRotationTrack(e,t,i,s,n){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,n);a=d[0],r=d[1]}const A=Fs(0);i!==void 0&&(i=i.map(Ce.degToRad),i.push(A),i=new Pt().fromArray(i),i=new ye().setFromEuler(i)),s!==void 0&&(s=s.map(Ce.degToRad),s.push(A),s=new Pt().fromArray(s),s=new ye().setFromEuler(s).invert());const c=new ye,l=new Pt,h=[];if(!(!r||!a)){for(let d=0;d<r.length;d+=3)l.set(r[d],r[d+1],r[d+2],n),c.setFromEuler(l),i!==void 0&&c.premultiply(i),s!==void 0&&c.multiply(s),d>2&&new ye().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 yi(e+".quaternion",a,h)}}generateMorphTrack(e){const t=e.DeformPercent.curves.morph,i=t.values.map(function(n){return n/100}),s=Ve.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new wi(e.modelName+".morphTargetInfluences["+s+"]",t.times,i)}getTimesForAllAxes(e){let t=[];if(e.x!==void 0&&(t=t.concat(e.x.times)),e.y!==void 0&&(t=t.concat(e.y.times)),e.z!==void 0&&(t=t.concat(e.z.times)),t=t.sort(function(i,s){return i-s}),t.length>1){let i=1,s=t[0];for(let n=1;n<t.length;n++){const a=t[n];a!==s&&(t[i]=a,s=a,i++)}t=t.slice(0,i)}return t}getKeyframeTrackValues(e,t,i){const s=i,n=[];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];n.push(l),s[0]=l}else n.push(s[0]);if(r!==-1){const l=t.y.values[r];n.push(l),s[1]=l}else n.push(s[1]);if(A!==-1){const l=t.z.values[A];n.push(l),s[2]=l}else n.push(s[2])}),n}interpolateRotations(e,t,i,s){const n=[],a=[];n.push(e.times[0]),a.push(Ce.degToRad(e.values[0])),a.push(Ce.degToRad(t.values[0])),a.push(Ce.degToRad(i.values[0]));for(let r=1;r<e.values.length;r++){const A=[e.values[r-1],t.values[r-1],i.values[r-1]];if(isNaN(A[0])||isNaN(A[1])||isNaN(A[2]))continue;const c=A.map(Ce.degToRad),l=[e.values[r],t.values[r],i.values[r]];if(isNaN(l[0])||isNaN(l[1])||isNaN(l[2]))continue;const h=l.map(Ce.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 Pt(...c,s),m=new Pt(...h,s),I=new ye().setFromEuler(b),E=new ye().setFromEuler(m);I.dot(E)&&E.set(-E.x,-E.y,-E.z,-E.w);const C=e.times[r-1],y=e.times[r]-C,w=new ye,x=new Pt;for(let T=0;T<1;T+=1/f)w.copy(I.clone().slerp(E.clone(),T)),n.push(C+T*y),x.setFromQuaternion(w,s),a.push(x.x),a.push(x.y),a.push(x.z)}else n.push(e.times[r]),a.push(Ce.degToRad(e.values[r])),a.push(Ce.degToRad(t.values[r])),a.push(Ce.degToRad(i.values[r]))}return[n,a]}}class Pc{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 so,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const t=this,i=e.split(/[\r\n]+/);return i.forEach(function(s,n){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,i[++n]):l?t.popStack():s.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(s)}),this.allNodes}parseNodeBegin(e,t){const i=t[1].trim().replace(/^"/,"").replace(/"$/,""),s=t[2].split(",").map(function(A){return A.trim().replace(/^"/,"").replace(/"$/,"")}),n={name:i},a=this.parseNodeAttr(s),r=this.getCurrentNode();this.currentIndent===0?this.allNodes.add(i,n):i in r?(i==="PoseNode"?r.PoseNode.push(n):r[i].id!==void 0&&(r[i]={},r[i][r[i].id]=r[i]),a.id!==""&&(r[i][a.id]=n)):typeof a.id=="number"?(r[i]={},r[i][a.id]=n):i!=="Properties70"&&(i==="PoseNode"?r[i]=[n]:r[i]=n),typeof a.id=="number"&&(n.id=a.id),a.name!==""&&(n.attrName=a.name),a.type!==""&&(n.attrType=a.type),this.pushStack(n)}parseNodeAttr(e){let t=e[0];e[0]!==""&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let i="",s="";return e.length>1&&(i=e[1].replace(/^(\w+)::/,""),s=e[2]),{id:t,name:i,type:s}}parseNodeProperty(e,t,i){let s=t[1].replace(/^"/,"").replace(/"$/,"").trim(),n=t[2].replace(/^"/,"").replace(/"$/,"").trim();s==="Content"&&n===","&&(n=i.replace(/"/g,"").replace(/,$/,"").trim());const a=this.getCurrentNode();if(a.name==="Properties70"){this.parseNodeSpecialProperty(e,s,n);return}if(s==="C"){const r=n.split(",").slice(1),A=parseInt(r[0]),c=parseInt(r[1]);let l=n.split(",").slice(3);l=l.map(function(h){return h.trim().replace(/^"/,"")}),s="connections",n=[A,c],Yc(n,l),a[s]===void 0&&(a[s]=[])}s==="Node"&&(a.id=n),s in a&&Array.isArray(a[s])?a[s].push(n):s!=="a"?a[s]=n:a.a=n,this.setCurrentProp(a,s),s==="a"&&n.slice(-1)!==","&&(a.a=hn(n))}parseNodePropertyContinued(e){const t=this.getCurrentNode();t.a+=e,e.slice(-1)!==","&&(t.a=hn(t.a))}parseNodeSpecialProperty(e,t,i){const s=i.split('",').map(function(l){return l.trim().replace(/^\"/,"").replace(/\s/,"_")}),n=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=hn(c);break}this.getPrevNode()[n]={type:a,type2:r,flag:A,value:c},this.setCurrentProp(this.getPrevNode(),n)}}class Oc{parse(e){const t=new to(e);t.skip(23);const i=t.getUint32();if(i<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+i);const s=new so;for(;!this.endOfContent(t);){const n=this.parseNode(t,i);n!==null&&s.add(n.name,n)}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 i={},s=t>=7500?e.getUint64():e.getUint32(),n=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<n;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(i.singleProperty=n===1&&e.getOffset()===s;s>e.getOffset();){const d=this.parseNode(e,t);d!==null&&this.parseSubNode(r,i,d)}return i.propertyList=A,typeof c=="number"&&(i.id=c),l!==""&&(i.attrName=l),h!==""&&(i.attrType=h),r!==""&&(i.name=r),i}parseSubNode(e,t,i){if(i.singleProperty===!0){const s=i.propertyList[0];Array.isArray(s)?(t[i.name]=i,i.a=s):t[i.name]=s}else if(e==="Connections"&&i.name==="C"){const s=[];i.propertyList.forEach(function(n,a){a!==0&&s.push(n)}),t.connections===void 0&&(t.connections=[]),t.connections.push(s)}else if(i.name==="Properties70")Object.keys(i).forEach(function(s){t[s]=i[s]});else if(e==="Properties70"&&i.name==="P"){let s=i.propertyList[0],n=i.propertyList[1];const a=i.propertyList[2],r=i.propertyList[3];let A;s.indexOf("Lcl ")===0&&(s=s.replace("Lcl ","Lcl_")),n.indexOf("Lcl ")===0&&(n=n.replace("Lcl ","Lcl_")),n==="Color"||n==="ColorRGB"||n==="Vector"||n==="Vector3D"||n.indexOf("Lcl_")===0?A=[i.propertyList[4],i.propertyList[5],i.propertyList[6]]:A=i.propertyList[4],t[s]={type:n,type2:a,flag:r,value:A}}else t[i.name]===void 0?typeof i.id=="number"?(t[i.name]={},t[i.name][i.id]=i):t[i.name]=i:i.name==="PoseNode"?(Array.isArray(t[i.name])||(t[i.name]=[t[i.name]]),t[i.name].push(i)):t[i.name][i.id]===void 0&&(t[i.name][i.id]=i)}parseProperty(e){const t=e.getString(1);let i;switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":return i=e.getUint32(),e.getArrayBuffer(i);case"S":return i=e.getUint32(),e.getString(i);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const s=e.getUint32(),n=e.getUint32(),a=e.getUint32();if(n===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=_s(new Uint8Array(e.getArrayBuffer(a))),A=new to(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 to{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=t!==void 0?t:!0,this._textDecoder=new TextDecoder}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e}getBoolean(){return(this.getUint8()&1)===1}getBooleanArray(e){const t=[];for(let i=0;i<e;i++)t.push(this.getBoolean());return t}getUint8(){const e=this.dv.getUint8(this.offset);return this.offset+=1,e}getInt16(){const e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}getInt32(){const e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}getInt32Array(e){const t=[];for(let i=0;i<e;i++)t.push(this.getInt32());return t}getUint32(){const e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}getInt64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),t&2147483648?(t=~t&4294967295,e=~e&4294967295,e===4294967295&&(t=t+1&4294967295),e=e+1&4294967295,-(t*4294967296+e)):t*4294967296+e}getInt64Array(e){const t=[];for(let i=0;i<e;i++)t.push(this.getInt64());return t}getUint64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),t*4294967296+e}getFloat32(){const e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}getFloat32Array(e){const t=[];for(let i=0;i<e;i++)t.push(this.getFloat32());return t}getFloat64(){const e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){const t=[];for(let i=0;i<e;i++)t.push(this.getFloat64());return t}getArrayBuffer(e){const t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}getString(e){const t=this.offset;let i=new Uint8Array(this.dv.buffer,t,e);this.skip(e);const s=i.indexOf(0);return s>=0&&(i=new Uint8Array(this.dv.buffer,t,s)),this._textDecoder.decode(i)}}class so{add(e,t){this[e]=t}}function Hc(o){const e="Kaydara FBX Binary \0";return o.byteLength>=e.length&&e===ao(o,0,e.length)}function jc(o){const e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let t=0;function i(s){const n=o[s-1];return o=o.slice(t+s),t++,n}for(let s=0;s<e.length;++s)if(i(1)===e[s])return!1;return!0}function io(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 qc(o){return o/46186158e3}const zc=[];function ii(o,e,t,i){let s;switch(i.mappingType){case"ByPolygonVertex":s=o;break;case"ByPolygon":s=e;break;case"ByVertice":s=t;break;case"AllSame":s=i.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+i.mappingType)}i.referenceType==="IndexToDirect"&&(s=i.indices[s]);const n=s*i.dataSize,a=n+i.dataSize;return Kc(zc,i.buffer,n,a)}const ln=new Pt,ls=new N;function no(o){const e=new ce,t=new ce,i=new ce,s=new ce,n=new ce,a=new ce,r=new ce,A=new ce,c=new ce,l=new ce,h=new ce,d=new ce,p=o.inheritType?o.inheritType:0;o.translation&&e.setPosition(ls.fromArray(o.translation));const f=Fs(0);if(o.preRotation){const V=o.preRotation.map(Ce.degToRad);V.push(f),t.makeRotationFromEuler(ln.fromArray(V))}if(o.rotation){const V=o.rotation.map(Ce.degToRad);V.push(o.eulerOrder||f),i.makeRotationFromEuler(ln.fromArray(V))}if(o.postRotation){const V=o.postRotation.map(Ce.degToRad);V.push(f),s.makeRotationFromEuler(ln.fromArray(V)),s.invert()}o.scale&&n.scale(ls.fromArray(o.scale)),o.scalingOffset&&r.setPosition(ls.fromArray(o.scalingOffset)),o.scalingPivot&&a.setPosition(ls.fromArray(o.scalingPivot)),o.rotationOffset&&A.setPosition(ls.fromArray(o.rotationOffset)),o.rotationPivot&&c.setPosition(ls.fromArray(o.rotationPivot)),o.parentMatrixWorld&&(h.copy(o.parentMatrix),l.copy(o.parentMatrixWorld));const b=t.clone().multiply(i).multiply(s),m=new ce;m.extractRotation(l);const I=new ce;I.copyPosition(l);const E=I.clone().invert().multiply(l),C=m.clone().invert().multiply(E),y=n,w=new ce;if(p===0)w.copy(m).multiply(b).multiply(C).multiply(y);else if(p===1)w.copy(m).multiply(C).multiply(b).multiply(y);else{const V=new ce().scale(new N().setFromMatrixScale(h)).clone().invert(),K=C.clone().multiply(V);w.copy(m).multiply(b).multiply(K).multiply(y)}const x=c.clone().invert(),T=a.clone().invert();let S=e.clone().multiply(A).multiply(c).multiply(t).multiply(i).multiply(s).multiply(x).multiply(r).multiply(a).multiply(n).multiply(T);const _=new ce().copyPosition(S),Y=l.clone().multiply(_);return d.copyPosition(Y),S=d.clone().multiply(w),S.premultiply(l.invert()),S}function Fs(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 hn(o){return o.split(",").map(function(e){return parseFloat(e)})}function ao(o,e,t){return e===void 0&&(e=0),t===void 0&&(t=o.byteLength),new TextDecoder().decode(new Uint8Array(o,e,t))}function Yc(o,e){for(let t=0,i=o.length,s=e.length;t<s;t++,i++)o[i]=e[t]}function Kc(o,e,t,i){for(let s=t,n=0;s<i;s++,n++)o[n]=e[s];return o}class Jc extends Tt{constructor(e){super(e)}load(e,t,i,s){const n=this,a=this.path===""?Jt.extractUrlBase(e):this.path,r=new dt(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,function(A){try{t(n.parse(A,a))}catch(c){s?s(c):console.error(c),n.manager.itemError(e)}},i,s)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){const i=e.split(`
|
|
40
|
+
`;continue}if((S=T.match(E))&&(x.gamma=parseFloat(S[1])),(S=T.match(C))&&(x.exposure=parseFloat(S[1])),(S=T.match(y))&&(x.valid|=2,x.format=S[1]),(S=T.match(w))&&(x.valid|=4,x.height=parseInt(S[1],10),x.width=parseInt(S[2],10)),x.valid&2&&x.valid&4)break}return x.valid&2||t(3,"missing format specifier"),x.valid&4||t(3,"missing image size specifier"),x},n=function(m,I,E){const C=I;if(C<8||C>32767||m[0]!==2||m[1]!==2||m[2]&128)return new Uint8Array(m);C!==(m[2]<<8|m[3])&&t(3,"wrong scanline width");const y=new Uint8Array(4*I*E);y.length||t(4,"unable to allocate buffer space");let w=0,x=0;const T=4*C,S=new Uint8Array(4),_=new Uint8Array(T);let Y=E;for(;Y>0&&x<m.byteLength;){x+4>m.byteLength&&t(1),S[0]=m[x++],S[1]=m[x++],S[2]=m[x++],S[3]=m[x++],(S[0]!=2||S[1]!=2||(S[2]<<8|S[3])!=C)&&t(3,"bad rgbe scanline format");let V=0,K;for(;V<T&&x<m.byteLength;){K=m[x++];const j=K>128;if(j&&(K-=128),(K===0||V+K>T)&&t(3,"bad scanline data"),j){const X=m[x++];for(let J=0;J<K;J++)_[V++]=X}else _.set(m.subarray(x,x+K),V),V+=K,x+=K}const W=C;for(let j=0;j<W;j++){let X=0;y[w]=_[j+X],X+=C,y[w+1]=_[j+X],X+=C,y[w+2]=_[j+X],X+=C,y[w+3]=_[j+X],w+=4}Y--}return y},a=function(m,I,E,C){const y=m[I+3],w=Math.pow(2,y-128)/255;E[C+0]=m[I+0]*w,E[C+1]=m[I+1]*w,E[C+2]=m[I+2]*w,E[C+3]=1},r=function(m,I,E,C){const y=m[I+3],w=Math.pow(2,y-128)/255;E[C+0]=os.toHalfFloat(Math.min(m[I+0]*w,65504)),E[C+1]=os.toHalfFloat(Math.min(m[I+1]*w,65504)),E[C+2]=os.toHalfFloat(Math.min(m[I+2]*w,65504)),E[C+3]=os.toHalfFloat(1)},A=new Uint8Array(e);A.pos=0;const c=s(A),l=c.width,h=c.height,d=n(A.subarray(A.pos),l,h);let p,f,b;switch(this.type){case ut:b=d.length/4;const m=new Float32Array(b*4);for(let E=0;E<b;E++)a(d,E*4,m,E*4);p=m,f=ut;break;case Ze:b=d.length/4;const I=new Uint16Array(b*4);for(let E=0;E<b;E++)r(d,E*4,I,E*4);p=I,f=Ze;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,i,s){function n(a,r){switch(a.type){case ut:case Ze:a.colorSpace=We,a.minFilter=at,a.magFilter=at,a.generateMipmaps=!1,a.flipY=!0;break}t&&t(a,r)}return super.load(e,n,i,s)}}const xc=Object.freeze(Object.defineProperty({__proto__:null,RGBELoader:$a},Symbol.toStringTag,{value:"Module"}));function eo(o,e,t){const i=t.length-o-1;if(e>=t[i])return i-1;if(e<=t[o])return o;let s=o,n=i,a=Math.floor((s+n)/2);for(;e<t[a]||e>=t[a+1];)e<t[a]?n=a:s=a,a=Math.floor((s+n)/2);return a}function Sc(o,e,t,i){const s=[],n=[],a=[];s[0]=1;for(let r=1;r<=t;++r){n[r]=e-i[o+1-r],a[r]=i[o+r]-e;let A=0;for(let c=0;c<r;++c){const l=a[c+1],h=n[r-c],d=s[c]/(l+h);s[c]=A+l*d,A=h*d}s[r]=A}return s}function Tc(o,e,t,i){const s=eo(o,i,e),n=Sc(s,i,o,e),a=new Mt(0,0,0,0);for(let r=0;r<=o;++r){const A=t[s-o+r],c=n[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 Rc(o,e,t,i,s){const n=[];for(let h=0;h<=t;++h)n[h]=0;const a=[];for(let h=0;h<=i;++h)a[h]=n.slice(0);const r=[];for(let h=0;h<=t;++h)r[h]=n.slice(0);r[0][0]=1;const A=n.slice(0),c=n.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 m=r[p][h-1]/r[h][p];r[p][h]=d+f*m,d=b*m}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]=n.slice(0);f[0][0]=1;for(let b=1;b<=i;++b){let m=0;const I=h-b,E=t-b;h>=b&&(f[p][0]=f[d][0]/r[E+1][I],m=f[p][0]*r[I][E]);const C=I>=-1?1:-I,y=h-1<=E?b-1:t-h;for(let x=C;x<=y;++x)f[p][x]=(f[d][x]-f[d][x-1])/r[E+1][I+x],m+=f[p][x]*r[I+x][E];h<=E&&(f[p][b]=-f[d][b-1]/r[E+1][h],m+=f[p][b]*r[h][E]),a[b][h]=m;const w=d;d=p,p=w}}let l=t;for(let h=1;h<=i;++h){for(let d=0;d<=t;++d)a[h][d]*=l;l*=t-h}return a}function Dc(o,e,t,i,s){const n=s<o?s:o,a=[],r=eo(o,i,e),A=Rc(r,i,o,n,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<=n;++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=n+1;l<=s+1;++l)a[l]=new Mt(0,0,0);return a}function Mc(o,e){let t=1;for(let s=2;s<=o;++s)t*=s;let i=1;for(let s=2;s<=e;++s)i*=s;for(let s=2;s<=o-e;++s)i*=s;return t/i}function kc(o){const e=o.length,t=[],i=[];for(let n=0;n<e;++n){const a=o[n];t[n]=new N(a.x,a.y,a.z),i[n]=a.w}const s=[];for(let n=0;n<e;++n){const a=t[n].clone();for(let r=1;r<=n;++r)a.sub(s[n-r].clone().multiplyScalar(Mc(n,r)*i[r]));s[n]=a.divideScalar(i[0])}return s}function _c(o,e,t,i,s){const n=Dc(o,e,t,i,s);return kc(n)}class Fc extends Cr{constructor(e,t,i,s,n){super(),this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=s||0,this.endKnot=n||this.knots.length-1;for(let a=0;a<i.length;++a){const r=i[a];this.controlPoints[a]=new Mt(r.x,r.y,r.z,r.w)}}getPoint(e,t=new N){const i=t,s=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),n=Tc(this.degree,this.knots,this.controlPoints,s);return n.w!==1&&n.divideScalar(n.w),i.set(n.x,n.y,n.z)}getTangent(e,t=new N){const i=t,s=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),n=_c(this.degree,this.knots,this.controlPoints,s,1);return i.copy(n[1]).normalize(),i}}let ie,Se,Ve;class Lc extends Tt{constructor(e){super(e)}load(e,t,i,s){const n=this,a=n.path===""?Jt.extractUrlBase(e):n.path,r=new dt(this.manager);r.setPath(n.path),r.setResponseType("arraybuffer"),r.setRequestHeader(n.requestHeader),r.setWithCredentials(n.withCredentials),r.load(e,function(A){try{t(n.parse(A,a))}catch(c){s?s(c):console.error(c),n.manager.itemError(e)}},i,s)}parse(e,t){if(Hc(e))ie=new Oc().parse(e);else{const s=ao(e);if(!jc(s))throw new Error("THREE.FBXLoader: Unknown format.");if(io(s)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+io(s));ie=new Pc().parse(s)}const i=new ui(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new Nc(i,this.manager).parse(ie)}getFbxTree(){return ie}}class Nc{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){Se=this.parseConnections();const e=this.parseImages(),t=this.parseTextures(e),i=this.parseMaterials(t),s=this.parseDeformers(),n=new Uc().parse(s);return this.parseScene(s,n,i),Ve}parseConnections(){const e=new Map;return"Connections"in ie&&ie.Connections.connections.forEach(function(t){const i=t[0],s=t[1],n=t[2];e.has(i)||e.set(i,{parents:[],children:[]});const a={ID:s,relationship:n};e.get(i).parents.push(a),e.has(s)||e.set(s,{parents:[],children:[]});const r={ID:i,relationship:n};e.get(s).children.push(r)}),e}parseImages(){const e={},t={};if("Video"in ie.Objects){const i=ie.Objects.Video;for(const s in i){const n=i[s],a=parseInt(s);if(e[a]=n.RelativeFilename||n.Filename,"Content"in n){const r=n.Content instanceof ArrayBuffer&&n.Content.byteLength>0,A=typeof n.Content=="string"&&n.Content!=="";if(r||A){const c=this.parseImage(i[s]);t[n.RelativeFilename||n.Filename]=c}}}}for(const i in e){const s=e[i];t[s]!==void 0?e[i]=t[s]:e[i]=e[i].split("\\").pop()}return e}parseImage(e){const t=e.Content,i=e.RelativeFilename||e.Filename,s=i.slice(i.lastIndexOf(".")+1).toLowerCase();let n;switch(s){case"bmp":n="image/bmp";break;case"jpg":case"jpeg":n="image/jpeg";break;case"png":n="image/png";break;case"tif":n="image/tiff";break;case"tga":this.manager.getHandler(".tga")===null&&console.warn("FBXLoader: TGA loader not found, skipping ",i),n="image/tga";break;default:console.warn('FBXLoader: Image type "'+s+'" is not supported.');return}if(typeof t=="string")return"data:"+n+";base64,"+t;{const a=new Uint8Array(t);return window.URL.createObjectURL(new Blob([a],{type:n}))}}parseTextures(e){const t=new Map;if("Texture"in ie.Objects){const i=ie.Objects.Texture;for(const s in i){const n=this.parseTexture(i[s],e);t.set(parseInt(s),n)}}return t}parseTexture(e,t){const i=this.loadTexture(e,t);i.ID=e.id,i.name=e.attrName;const s=e.WrapModeU,n=e.WrapModeV,a=s!==void 0?s.value:0,r=n!==void 0?n.value:0;if(i.wrapS=a===0?Vt:qs,i.wrapT=r===0?Vt:qs,"Scaling"in e){const A=e.Scaling.value;i.repeat.x=A[0],i.repeat.y=A[1]}if("Translation"in e){const A=e.Translation.value;i.offset.x=A[0],i.offset.y=A[1]}return i}loadTexture(e,t){const i=new Set(["tga","tif","tiff","exr","dds","hdr","ktx2"]),s=e.FileName.split(".").pop().toLowerCase(),n=i.has(s)?this.manager.getHandler(`.${s}`):this.textureLoader;if(!n)return console.warn(`FBXLoader: ${s.toUpperCase()} loader not found, creating placeholder texture for`,e.RelativeFilename),new Ci;const a=n.path;a||n.setPath(this.textureLoader.path);const r=Se.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)&&n.setPath(void 0));const c=n.load(A);return n.setPath(a),c}parseMaterials(e){const t=new Map;if("Material"in ie.Objects){const i=ie.Objects.Material;for(const s in i){const n=this.parseMaterial(i[s],e);n!==null&&t.set(parseInt(s),n)}}return t}parseMaterial(e,t){const i=e.id,s=e.attrName;let n=e.ShadingModel;if(typeof n=="object"&&(n=n.value),!Se.has(i))return null;const a=this.parseParameters(e,t,i);let r;switch(n.toLowerCase()){case"phong":r=new Cs;break;case"lambert":r=new Br;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',n),r=new Cs;break}return r.setValues(a),r.name=s,r}parseParameters(e,t,i){const s={};e.BumpFactor&&(s.bumpScale=e.BumpFactor.value),e.Diffuse?s.color=Xe.toWorkingColorSpace(new we().fromArray(e.Diffuse.value),le):e.DiffuseColor&&(e.DiffuseColor.type==="Color"||e.DiffuseColor.type==="ColorRGB")&&(s.color=Xe.toWorkingColorSpace(new we().fromArray(e.DiffuseColor.value),le)),e.DisplacementFactor&&(s.displacementScale=e.DisplacementFactor.value),e.Emissive?s.emissive=Xe.toWorkingColorSpace(new we().fromArray(e.Emissive.value),le):e.EmissiveColor&&(e.EmissiveColor.type==="Color"||e.EmissiveColor.type==="ColorRGB")&&(s.emissive=Xe.toWorkingColorSpace(new we().fromArray(e.EmissiveColor.value),le)),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 we().fromArray(e.Specular.value),le):e.SpecularColor&&e.SpecularColor.type==="Color"&&(s.specular=Xe.toWorkingColorSpace(new we().fromArray(e.SpecularColor.value),le));const n=this;return Se.get(i).children.forEach(function(a){const r=a.relationship;switch(r){case"Bump":s.bumpMap=n.getTexture(t,a.ID);break;case"Maya|TEX_ao_map":s.aoMap=n.getTexture(t,a.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":s.map=n.getTexture(t,a.ID),s.map!==void 0&&(s.map.colorSpace=le);break;case"DisplacementColor":s.displacementMap=n.getTexture(t,a.ID);break;case"EmissiveColor":s.emissiveMap=n.getTexture(t,a.ID),s.emissiveMap!==void 0&&(s.emissiveMap.colorSpace=le);break;case"NormalMap":case"Maya|TEX_normal_map":s.normalMap=n.getTexture(t,a.ID);break;case"ReflectionColor":s.envMap=n.getTexture(t,a.ID),s.envMap!==void 0&&(s.envMap.mapping=wr,s.envMap.colorSpace=le);break;case"SpecularColor":s.specularMap=n.getTexture(t,a.ID),s.specularMap!==void 0&&(s.specularMap.colorSpace=le);break;case"TransparentColor":case"TransparencyFactor":s.alphaMap=n.getTexture(t,a.ID),s.transparent=!0;break;default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",r);break}}),s}getTexture(e,t){return"LayeredTexture"in ie.Objects&&t in ie.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=Se.get(t).children[0].ID),e.get(t)}parseDeformers(){const e={},t={};if("Deformer"in ie.Objects){const i=ie.Objects.Deformer;for(const s in i){const n=i[s],a=Se.get(parseInt(s));if(n.attrType==="Skin"){const r=this.parseSkeleton(a,i);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(n.attrType==="BlendShape"){const r={id:s};r.rawTargets=this.parseMorphTargets(a,i),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 i=[];return e.children.forEach(function(s){const n=t[s.ID];if(n.attrType!=="Cluster")return;const a={ID:s.ID,indices:[],weights:[],transformLink:new ce().fromArray(n.TransformLink.a)};"Indexes"in n&&(a.indices=n.Indexes.a,a.weights=n.Weights.a),i.push(a)}),{rawBones:i,bones:[]}}parseMorphTargets(e,t){const i=[];for(let s=0;s<e.children.length;s++){const n=e.children[s],a=t[n.ID],r={name:a.attrName,initialWeight:a.DeformPercent,id:a.id,fullWeights:a.FullWeights.a};if(a.attrType!=="BlendShapeChannel")return;r.geoID=Se.get(parseInt(n.ID)).children.filter(function(A){return A.relationship===void 0})[0].ID,i.push(r)}return i}parseScene(e,t,i){Ve=new Wt;const s=this.parseModels(e.skeletons,t,i),n=ie.Objects.Model,a=this;s.forEach(function(A){const c=n[A.ID];a.setLookAtProperties(A,c),Se.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=no(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 Gc().parse();Ve.children.length===1&&Ve.children[0].isGroup&&(Ve.children[0].animations=r,Ve=Ve.children[0]),Ve.animations=r}parseModels(e,t,i){const s=new Map,n=ie.Objects.Model;for(const a in n){const r=parseInt(a),A=n[a],c=Se.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,i);break;case"NurbsCurve":l=this.createCurve(c,t);break;case"LimbNode":case"Root":l=new Ii;break;default:l=new Wt;break}l.name=A.attrName?Dt.sanitizeNodeName(A.attrName):"",l.userData.originalName=A.attrName,l.ID=r}this.getTransformData(l,A),s.set(r,l)}return s}buildSkeleton(e,t,i,s){let n=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=n;n=new Ii,n.matrixWorld.copy(c.transformLink),n.name=s?Dt.sanitizeNodeName(s):"",n.userData.originalName=s,n.ID=i,A.bones[l]=n,h!==null&&n.add(h)}})}}),n}createCamera(e){let t,i;if(e.children.forEach(function(s){const n=ie.Objects.NodeAttribute[s.ID];n!==void 0&&(i=n)}),i===void 0)t=new Bt;else{let s=0;i.CameraProjectionType!==void 0&&i.CameraProjectionType.value===1&&(s=1);let n=1;i.NearPlane!==void 0&&(n=i.NearPlane.value/1e3);let a=1e3;i.FarPlane!==void 0&&(a=i.FarPlane.value/1e3);let r=window.innerWidth,A=window.innerHeight;i.AspectWidth!==void 0&&i.AspectHeight!==void 0&&(r=i.AspectWidth.value,A=i.AspectHeight.value);const c=r/A;let l=45;i.FieldOfView!==void 0&&(l=i.FieldOfView.value);const h=i.FocalLength?i.FocalLength.value:null;switch(s){case 0:t=new Os(l,c,n,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,i;if(e.children.forEach(function(s){const n=ie.Objects.NodeAttribute[s.ID];n!==void 0&&(i=n)}),i===void 0)t=new Bt;else{let s;i.LightType===void 0?s=0:s=i.LightType.value;let n=16777215;i.Color!==void 0&&(n=Xe.toWorkingColorSpace(new we().fromArray(i.Color.value),le));let a=i.Intensity===void 0?1:i.Intensity.value/100;i.CastLightOnObject!==void 0&&i.CastLightOnObject.value===0&&(a=0);let r=0;i.FarAttenuationEnd!==void 0&&(i.EnableFarAttenuation!==void 0&&i.EnableFarAttenuation.value===0?r=0:r=i.FarAttenuationEnd.value);const A=1;switch(s){case 0:t=new pi(n,a,r,A);break;case 1:t=new Tn(n,a);break;case 2:let c=Math.PI/3;i.InnerAngle!==void 0&&(c=Ce.degToRad(i.InnerAngle.value));let l=0;i.OuterAngle!==void 0&&(l=Ce.degToRad(i.OuterAngle.value),l=Math.max(l,1)),t=new Sn(n,a,r,c,l,A);break;default:console.warn("THREE.FBXLoader: Unknown light type "+i.LightType.value+", defaulting to a PointLight."),t=new pi(n,a);break}i.CastShadows!==void 0&&i.CastShadows.value===1&&(t.castShadow=!0)}return t}createMesh(e,t,i){let s,n=null,a=null;const r=[];if(e.children.forEach(function(A){t.has(A.ID)&&(n=t.get(A.ID)),i.has(A.ID)&&r.push(i.get(A.ID))}),r.length>1?a=r:r.length>0?a=r[0]:(a=new Cs({name:Tt.DEFAULT_MATERIAL_NAME,color:13421772}),r.push(a)),"color"in n.attributes&&r.forEach(function(A){A.vertexColors=!0}),n.groups.length>0){let A=!1;for(let c=0,l=n.groups.length;c<l;c++){const h=n.groups[c];(h.materialIndex<0||h.materialIndex>=r.length)&&(h.materialIndex=r.length,A=!0)}if(A){const c=new mi;r.push(c)}}return n.FBX_Deformer?(s=new kn(n,a),s.normalizeSkinWeights()):s=new O(n,a),s}createCurve(e,t){const i=e.children.reduce(function(n,a){return t.has(a.ID)&&(n=t.get(a.ID)),n},null),s=new Rt({name:Tt.DEFAULT_MATERIAL_NAME,color:3342591,linewidth:1});return new pt(i,s)}getTransformData(e,t){const i={};"InheritType"in t&&(i.inheritType=parseInt(t.InheritType.value)),"RotationOrder"in t?i.eulerOrder=Fs(t.RotationOrder.value):i.eulerOrder=Fs(0),"Lcl_Translation"in t&&(i.translation=t.Lcl_Translation.value),"PreRotation"in t&&(i.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(i.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(i.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(i.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(i.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(i.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(i.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(i.rotationPivot=t.RotationPivot.value),e.userData.transformData=i}setLookAtProperties(e,t){"LookAtProperty"in t&&Se.get(e.ID).children.forEach(function(i){if(i.relationship==="LookAtProperty"){const s=ie.Objects.Model[i.ID];if("Lcl_Translation"in s){const n=s.Lcl_Translation.value;e.target!==void 0?(e.target.position.fromArray(n),Ve.add(e.target)):e.lookAt(new N().fromArray(n))}}})}bindSkeleton(e,t,i){const s=this.parsePoseNodes();for(const n in e){const a=e[n];Se.get(parseInt(a.ID)).parents.forEach(function(r){if(t.has(r.ID)){const A=r.ID;Se.get(A).parents.forEach(function(c){i.has(c.ID)&&i.get(c.ID).bind(new Fn(a.bones),s[c.ID])})}})}}parsePoseNodes(){const e={};if("Pose"in ie.Objects){const t=ie.Objects.Pose;for(const i in t)if(t[i].attrType==="BindPose"&&t[i].NbPoseNodes>0){const s=t[i].PoseNode;Array.isArray(s)?s.forEach(function(n){e[n.Node]=new ce().fromArray(n.Matrix.a)}):e[s.Node]=new ce().fromArray(s.Matrix.a)}}return e}addGlobalSceneSettings(){if("GlobalSettings"in ie){if("AmbientColor"in ie.GlobalSettings){const e=ie.GlobalSettings.AmbientColor.value,t=e[0],i=e[1],s=e[2];if(t!==0||i!==0||s!==0){const n=new we().setRGB(t,i,s,le);Ve.add(new yr(n,1))}}"UnitScaleFactor"in ie.GlobalSettings&&(Ve.userData.unitScaleFactor=ie.GlobalSettings.UnitScaleFactor.value)}}}class Uc{constructor(){this.negativeMaterialIndices=!1}parse(e){const t=new Map;if("Geometry"in ie.Objects){const i=ie.Objects.Geometry;for(const s in i){const n=Se.get(parseInt(s)),a=this.parseGeometry(n,i[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,i){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,i);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,i){const s=i.skeletons,n=[],a=e.parents.map(function(h){return ie.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){i.morphTargets[h.ID]!==void 0&&n.push(i.morphTargets[h.ID])});const A=a[0],c={};"RotationOrder"in A&&(c.eulerOrder=Fs(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=no(c);return this.genGeometry(t,r,n,l)}genGeometry(e,t,i,s){const n=new ct;e.attrName&&(n.name=e.attrName);const a=this.parseGeoNode(e,t),r=this.genBuffers(a),A=new Me(r.vertex,3);if(A.applyMatrix4(s),n.setAttribute("position",A),r.colors.length>0&&n.setAttribute("color",new Me(r.colors,3)),t&&(n.setAttribute("skinIndex",new Qr(r.weightsIndices,4)),n.setAttribute("skinWeight",new Me(r.vertexWeights,4)),n.FBX_Deformer=t),r.normal.length>0){const c=new Jn().getNormalMatrix(s),l=new Me(r.normal,3);l.applyNormalMatrix(c),n.setAttribute("normal",l)}if(r.uvs.forEach(function(c,l){const h=l===0?"uv":`uv${l}`;n.setAttribute(h,new Me(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&&(n.addGroup(l,d-l,c),c=h,l=d)}),n.groups.length>0){const h=n.groups[n.groups.length-1],d=h.start+h.count;d!==r.materialIndex.length&&n.addGroup(d,r.materialIndex.length-d,c)}n.groups.length===0&&n.addGroup(0,r.materialIndex.length,r.materialIndex[0])}return this.addMorphTargets(n,e,i,s),n}parseGeoNode(e,t){const i={};if(i.vertexPositions=e.Vertices!==void 0?e.Vertices.a:[],i.vertexIndices=e.PolygonVertexIndex!==void 0?e.PolygonVertexIndex.a:[],e.LayerElementColor&&(i.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(i.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(i.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){i.uv=[];let s=0;for(;e.LayerElementUV[s];)e.LayerElementUV[s].UV&&i.uv.push(this.parseUVs(e.LayerElementUV[s])),s++}return i.weightTable={},t!==null&&(i.skeleton=t,t.rawBones.forEach(function(s,n){s.indices.forEach(function(a,r){i.weightTable[a]===void 0&&(i.weightTable[a]=[]),i.weightTable[a].push({id:n,weight:s.weights[r]})})})),i}genBuffers(e){const t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let i=0,s=0,n=!1,a=[],r=[],A=[],c=[],l=[],h=[];const d=this;return e.vertexIndices.forEach(function(p,f){let b,m=!1;p<0&&(p=p^-1,m=!0);let I=[],E=[];if(a.push(p*3,p*3+1,p*3+2),e.color){const C=ii(f,i,p,e.color);A.push(C[0],C[1],C[2])}if(e.skeleton){if(e.weightTable[p]!==void 0&&e.weightTable[p].forEach(function(C){E.push(C.weight),I.push(C.id)}),E.length>4){n||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),n=!0);const C=[0,0,0,0],y=[0,0,0,0];E.forEach(function(w,x){let T=w,S=I[x];y.forEach(function(_,Y,V){if(T>_){V[Y]=T,T=_;const K=C[Y];C[Y]=S,S=K}})}),I=C,E=y}for(;E.length<4;)E.push(0),I.push(0);for(let C=0;C<4;++C)l.push(E[C]),h.push(I[C])}if(e.normal){const C=ii(f,i,p,e.normal);r.push(C[0],C[1],C[2])}e.material&&e.material.mappingType!=="AllSame"&&(b=ii(f,i,p,e.material)[0],b<0&&(d.negativeMaterialIndices=!0,b=0)),e.uv&&e.uv.forEach(function(C,y){const w=ii(f,i,p,C);c[y]===void 0&&(c[y]=[]),c[y].push(w[0]),c[y].push(w[1])}),s++,m&&(d.genFace(t,e,a,b,r,A,c,l,h,s),i++,s=0,a=[],r=[],A=[],c=[],l=[],h=[])}),t}getNormalNewell(e){const t=new N(0,0,0);for(let i=0;i<e.length;i++){const s=e[i],n=e[(i+1)%e.length];t.x+=(s.y-n.y)*(s.z+n.z),t.y+=(s.z-n.z)*(s.x+n.x),t.z+=(s.x-n.x)*(s.y+n.y)}return t.normalize(),t}getNormalTangentAndBitangent(e){const t=this.getNormalNewell(e),i=(Math.abs(t.z)>.5?new N(0,1,0):new N(0,0,1)).cross(t).normalize(),s=t.clone().cross(i).normalize();return{normal:t,tangent:i,bitangent:s}}flattenVertex(e,t,i){return new Le(e.dot(t),e.dot(i))}genFace(e,t,i,s,n,a,r,A,c,l){let h;if(l>3){const d=[],p=t.baseVertexPositions||t.vertexPositions;for(let I=0;I<i.length;I+=3)d.push(new N(p[i[I]],p[i[I+1]],p[i[I+2]]));const{tangent:f,bitangent:b}=this.getNormalTangentAndBitangent(d),m=[];for(const I of d)m.push(this.flattenVertex(I,f,b));h=vr.triangulateShape(m,[])}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[i[d*3]]),e.vertex.push(t.vertexPositions[i[d*3+1]]),e.vertex.push(t.vertexPositions[i[d*3+2]]),e.vertex.push(t.vertexPositions[i[p*3]]),e.vertex.push(t.vertexPositions[i[p*3+1]]),e.vertex.push(t.vertexPositions[i[p*3+2]]),e.vertex.push(t.vertexPositions[i[f*3]]),e.vertex.push(t.vertexPositions[i[f*3+1]]),e.vertex.push(t.vertexPositions[i[f*3+2]]),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(n[d*3]),e.normal.push(n[d*3+1]),e.normal.push(n[d*3+2]),e.normal.push(n[p*3]),e.normal.push(n[p*3+1]),e.normal.push(n[p*3+2]),e.normal.push(n[f*3]),e.normal.push(n[f*3+1]),e.normal.push(n[f*3+2])),t.uv&&t.uv.forEach(function(b,m){e.uvs[m]===void 0&&(e.uvs[m]=[]),e.uvs[m].push(r[m][d*2]),e.uvs[m].push(r[m][d*2+1]),e.uvs[m].push(r[m][p*2]),e.uvs[m].push(r[m][p*2+1]),e.uvs[m].push(r[m][f*2]),e.uvs[m].push(r[m][f*2+1])})}addMorphTargets(e,t,i,s){if(i.length===0)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];const n=this;i.forEach(function(a){a.rawTargets.forEach(function(r){const A=ie.Objects.Geometry[r.geoID];A!==void 0&&n.genMorphGeometry(e,t,A,s,r.name)})})}genMorphGeometry(e,t,i,s,n){const a=t.Vertices!==void 0?t.Vertices.a:[],r=t.PolygonVertexIndex!==void 0?t.PolygonVertexIndex.a:[],A=i.Vertices!==void 0?i.Vertices.a:[],c=i.Indexes!==void 0?i.Indexes.a:[],l=e.attributes.position.count*3,h=new Float32Array(l);for(let b=0;b<c.length;b++){const m=c[b]*3;h[m]=A[b*3],h[m+1]=A[b*3+1],h[m+2]=A[b*3+2]}const d={vertexIndices:r,vertexPositions:h,baseVertexPositions:a},p=this.genBuffers(d),f=new Me(p.vertex,3);f.name=n||i.attrName,f.applyMatrix4(s),e.morphAttributes.position.push(f)}parseNormals(e){const t=e.MappingInformationType,i=e.ReferenceInformationType,s=e.Normals.a;let n=[];return i==="IndexToDirect"&&("NormalIndex"in e?n=e.NormalIndex.a:"NormalsIndex"in e&&(n=e.NormalsIndex.a)),{dataSize:3,buffer:s,indices:n,mappingType:t,referenceType:i}}parseUVs(e){const t=e.MappingInformationType,i=e.ReferenceInformationType,s=e.UV.a;let n=[];return i==="IndexToDirect"&&(n=e.UVIndex.a),{dataSize:2,buffer:s,indices:n,mappingType:t,referenceType:i}}parseVertexColors(e){if(!e.Colors)return;const t=e.MappingInformationType,i=e.ReferenceInformationType,s=e.Colors.a;let n=[];i==="IndexToDirect"&&(n=e.ColorIndex.a);for(let a=0,r=new we;a<s.length;a+=4)r.fromArray(s,a),Xe.toWorkingColorSpace(r,le),r.toArray(s,a);return{dataSize:4,buffer:s,indices:n,mappingType:t,referenceType:i}}parseMaterialIndices(e){const t=e.MappingInformationType,i=e.ReferenceInformationType;if(t==="NoMappingInformation")return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:i};const s=e.Materials.a,n=[];for(let a=0;a<s.length;++a)n.push(a);return{dataSize:1,buffer:s,indices:n,mappingType:t,referenceType:i}}parseNurbsGeometry(e){const t=parseInt(e.Order);if(isNaN(t))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",e.Order,e.id),new ct;const i=t-1,s=e.KnotVector.a,n=[],a=e.Points.a;for(let l=0,h=a.length;l<h;l+=4)n.push(new Mt().fromArray(a,l));let r,A;if(e.Form==="Closed")n.push(n[0]);else if(e.Form==="Periodic"){r=i,A=s.length-1-r;for(let l=0;l<i;++l)n.push(n[l])}const c=new Fc(i,s,n,r,A).getPoints(n.length*12);return new ct().setFromPoints(c)}}class Gc{parse(){const e=[],t=this.parseClips();if(t!==void 0)for(const i in t){const s=t[i],n=this.addClip(s);e.push(n)}return e}parseClips(){if(ie.Objects.AnimationCurve===void 0)return;const e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);const t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){const e=ie.Objects.AnimationCurveNode,t=new Map;for(const i in e){const s=e[i];if(s.attrName.match(/S|R|T|DeformPercent/)!==null){const n={id:s.id,attr:s.attrName,curves:{}};t.set(n.id,n)}}return t}parseAnimationCurves(e){const t=ie.Objects.AnimationCurve;for(const i in t){const s={id:t[i].id,times:t[i].KeyTime.a.map(qc),values:t[i].KeyValueFloat.a},n=Se.get(s.id);if(n!==void 0){const a=n.parents[0].ID,r=n.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=ie.Objects.AnimationLayer,i=new Map;for(const s in t){const n=[],a=Se.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(n[A]===void 0){const l=Se.get(r.ID).parents.filter(function(h){return h.relationship!==void 0})[0].ID;if(l!==void 0){const h=ie.Objects.Model[l.toString()];if(h===void 0){console.warn("THREE.FBXLoader: Encountered a unused curve.",r);return}const d={modelName:h.attrName?Dt.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 ce),"PreRotation"in h&&(d.preRotation=h.PreRotation.value),"PostRotation"in h&&(d.postRotation=h.PostRotation.value),n[A]=d}}n[A]&&(n[A][c.attr]=c)}else if(c.curves.morph!==void 0){if(n[A]===void 0){const l=Se.get(r.ID).parents.filter(function(m){return m.relationship!==void 0})[0].ID,h=Se.get(l).parents[0].ID,d=Se.get(h).parents[0].ID,p=Se.get(d).parents[0].ID,f=ie.Objects.Model[p],b={modelName:f.attrName?Dt.sanitizeNodeName(f.attrName):"",morphName:ie.Objects.Deformer[l].attrName};n[A]=b}n[A][c.attr]=c}}}),i.set(parseInt(s),n))}return i}parseAnimStacks(e){const t=ie.Objects.AnimationStack,i={};for(const s in t){const n=Se.get(parseInt(s)).children;n.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(n[0].ID);i[s]={name:t[s].attrName,layer:a}}return i}addClip(e){let t=[];const i=this;return e.layer.forEach(function(s){t=t.concat(i.generateTracks(s))}),new Ln(e.name,-1,t)}generateTracks(e){const t=[];let i=new N,s=new N;if(e.transform&&e.transform.decompose(i,new ye,s),i=i.toArray(),s=s.toArray(),e.T!==void 0&&Object.keys(e.T.curves).length>0){const n=this.generateVectorTrack(e.modelName,e.T.curves,i,"position");n!==void 0&&t.push(n)}if(e.R!==void 0&&Object.keys(e.R.curves).length>0){const n=this.generateRotationTrack(e.modelName,e.R.curves,e.preRotation,e.postRotation,e.eulerOrder);n!==void 0&&t.push(n)}if(e.S!==void 0&&Object.keys(e.S.curves).length>0){const n=this.generateVectorTrack(e.modelName,e.S.curves,s,"scale");n!==void 0&&t.push(n)}if(e.DeformPercent!==void 0){const n=this.generateMorphTrack(e);n!==void 0&&t.push(n)}return t}generateVectorTrack(e,t,i,s){const n=this.getTimesForAllAxes(t),a=this.getKeyframeTrackValues(n,t,i);return new Bi(e+"."+s,n,a)}generateRotationTrack(e,t,i,s,n){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,n);a=d[0],r=d[1]}const A=Fs(0);i!==void 0&&(i=i.map(Ce.degToRad),i.push(A),i=new Pt().fromArray(i),i=new ye().setFromEuler(i)),s!==void 0&&(s=s.map(Ce.degToRad),s.push(A),s=new Pt().fromArray(s),s=new ye().setFromEuler(s).invert());const c=new ye,l=new Pt,h=[];if(!(!r||!a)){for(let d=0;d<r.length;d+=3)l.set(r[d],r[d+1],r[d+2],n),c.setFromEuler(l),i!==void 0&&c.premultiply(i),s!==void 0&&c.multiply(s),d>2&&new ye().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 yi(e+".quaternion",a,h)}}generateMorphTrack(e){const t=e.DeformPercent.curves.morph,i=t.values.map(function(n){return n/100}),s=Ve.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new wi(e.modelName+".morphTargetInfluences["+s+"]",t.times,i)}getTimesForAllAxes(e){let t=[];if(e.x!==void 0&&(t=t.concat(e.x.times)),e.y!==void 0&&(t=t.concat(e.y.times)),e.z!==void 0&&(t=t.concat(e.z.times)),t=t.sort(function(i,s){return i-s}),t.length>1){let i=1,s=t[0];for(let n=1;n<t.length;n++){const a=t[n];a!==s&&(t[i]=a,s=a,i++)}t=t.slice(0,i)}return t}getKeyframeTrackValues(e,t,i){const s=i,n=[];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];n.push(l),s[0]=l}else n.push(s[0]);if(r!==-1){const l=t.y.values[r];n.push(l),s[1]=l}else n.push(s[1]);if(A!==-1){const l=t.z.values[A];n.push(l),s[2]=l}else n.push(s[2])}),n}interpolateRotations(e,t,i,s){const n=[],a=[];n.push(e.times[0]),a.push(Ce.degToRad(e.values[0])),a.push(Ce.degToRad(t.values[0])),a.push(Ce.degToRad(i.values[0]));for(let r=1;r<e.values.length;r++){const A=[e.values[r-1],t.values[r-1],i.values[r-1]];if(isNaN(A[0])||isNaN(A[1])||isNaN(A[2]))continue;const c=A.map(Ce.degToRad),l=[e.values[r],t.values[r],i.values[r]];if(isNaN(l[0])||isNaN(l[1])||isNaN(l[2]))continue;const h=l.map(Ce.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 Pt(...c,s),m=new Pt(...h,s),I=new ye().setFromEuler(b),E=new ye().setFromEuler(m);I.dot(E)&&E.set(-E.x,-E.y,-E.z,-E.w);const C=e.times[r-1],y=e.times[r]-C,w=new ye,x=new Pt;for(let T=0;T<1;T+=1/f)w.copy(I.clone().slerp(E.clone(),T)),n.push(C+T*y),x.setFromQuaternion(w,s),a.push(x.x),a.push(x.y),a.push(x.z)}else n.push(e.times[r]),a.push(Ce.degToRad(e.values[r])),a.push(Ce.degToRad(t.values[r])),a.push(Ce.degToRad(i.values[r]))}return[n,a]}}class Pc{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 so,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const t=this,i=e.split(/[\r\n]+/);return i.forEach(function(s,n){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,i[++n]):l?t.popStack():s.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(s)}),this.allNodes}parseNodeBegin(e,t){const i=t[1].trim().replace(/^"/,"").replace(/"$/,""),s=t[2].split(",").map(function(A){return A.trim().replace(/^"/,"").replace(/"$/,"")}),n={name:i},a=this.parseNodeAttr(s),r=this.getCurrentNode();this.currentIndent===0?this.allNodes.add(i,n):i in r?(i==="PoseNode"?r.PoseNode.push(n):r[i].id!==void 0&&(r[i]={},r[i][r[i].id]=r[i]),a.id!==""&&(r[i][a.id]=n)):typeof a.id=="number"?(r[i]={},r[i][a.id]=n):i!=="Properties70"&&(i==="PoseNode"?r[i]=[n]:r[i]=n),typeof a.id=="number"&&(n.id=a.id),a.name!==""&&(n.attrName=a.name),a.type!==""&&(n.attrType=a.type),this.pushStack(n)}parseNodeAttr(e){let t=e[0];e[0]!==""&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let i="",s="";return e.length>1&&(i=e[1].replace(/^(\w+)::/,""),s=e[2]),{id:t,name:i,type:s}}parseNodeProperty(e,t,i){let s=t[1].replace(/^"/,"").replace(/"$/,"").trim(),n=t[2].replace(/^"/,"").replace(/"$/,"").trim();s==="Content"&&n===","&&(n=i.replace(/"/g,"").replace(/,$/,"").trim());const a=this.getCurrentNode();if(a.name==="Properties70"){this.parseNodeSpecialProperty(e,s,n);return}if(s==="C"){const r=n.split(",").slice(1),A=parseInt(r[0]),c=parseInt(r[1]);let l=n.split(",").slice(3);l=l.map(function(h){return h.trim().replace(/^"/,"")}),s="connections",n=[A,c],Yc(n,l),a[s]===void 0&&(a[s]=[])}s==="Node"&&(a.id=n),s in a&&Array.isArray(a[s])?a[s].push(n):s!=="a"?a[s]=n:a.a=n,this.setCurrentProp(a,s),s==="a"&&n.slice(-1)!==","&&(a.a=hn(n))}parseNodePropertyContinued(e){const t=this.getCurrentNode();t.a+=e,e.slice(-1)!==","&&(t.a=hn(t.a))}parseNodeSpecialProperty(e,t,i){const s=i.split('",').map(function(l){return l.trim().replace(/^\"/,"").replace(/\s/,"_")}),n=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=hn(c);break}this.getPrevNode()[n]={type:a,type2:r,flag:A,value:c},this.setCurrentProp(this.getPrevNode(),n)}}class Oc{parse(e){const t=new to(e);t.skip(23);const i=t.getUint32();if(i<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+i);const s=new so;for(;!this.endOfContent(t);){const n=this.parseNode(t,i);n!==null&&s.add(n.name,n)}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 i={},s=t>=7500?e.getUint64():e.getUint32(),n=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<n;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(i.singleProperty=n===1&&e.getOffset()===s;s>e.getOffset();){const d=this.parseNode(e,t);d!==null&&this.parseSubNode(r,i,d)}return i.propertyList=A,typeof c=="number"&&(i.id=c),l!==""&&(i.attrName=l),h!==""&&(i.attrType=h),r!==""&&(i.name=r),i}parseSubNode(e,t,i){if(i.singleProperty===!0){const s=i.propertyList[0];Array.isArray(s)?(t[i.name]=i,i.a=s):t[i.name]=s}else if(e==="Connections"&&i.name==="C"){const s=[];i.propertyList.forEach(function(n,a){a!==0&&s.push(n)}),t.connections===void 0&&(t.connections=[]),t.connections.push(s)}else if(i.name==="Properties70")Object.keys(i).forEach(function(s){t[s]=i[s]});else if(e==="Properties70"&&i.name==="P"){let s=i.propertyList[0],n=i.propertyList[1];const a=i.propertyList[2],r=i.propertyList[3];let A;s.indexOf("Lcl ")===0&&(s=s.replace("Lcl ","Lcl_")),n.indexOf("Lcl ")===0&&(n=n.replace("Lcl ","Lcl_")),n==="Color"||n==="ColorRGB"||n==="Vector"||n==="Vector3D"||n.indexOf("Lcl_")===0?A=[i.propertyList[4],i.propertyList[5],i.propertyList[6]]:A=i.propertyList[4],t[s]={type:n,type2:a,flag:r,value:A}}else t[i.name]===void 0?typeof i.id=="number"?(t[i.name]={},t[i.name][i.id]=i):t[i.name]=i:i.name==="PoseNode"?(Array.isArray(t[i.name])||(t[i.name]=[t[i.name]]),t[i.name].push(i)):t[i.name][i.id]===void 0&&(t[i.name][i.id]=i)}parseProperty(e){const t=e.getString(1);let i;switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":return i=e.getUint32(),e.getArrayBuffer(i);case"S":return i=e.getUint32(),e.getString(i);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const s=e.getUint32(),n=e.getUint32(),a=e.getUint32();if(n===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=_s(new Uint8Array(e.getArrayBuffer(a))),A=new to(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 to{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=t!==void 0?t:!0,this._textDecoder=new TextDecoder}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e}getBoolean(){return(this.getUint8()&1)===1}getBooleanArray(e){const t=[];for(let i=0;i<e;i++)t.push(this.getBoolean());return t}getUint8(){const e=this.dv.getUint8(this.offset);return this.offset+=1,e}getInt16(){const e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}getInt32(){const e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}getInt32Array(e){const t=[];for(let i=0;i<e;i++)t.push(this.getInt32());return t}getUint32(){const e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}getInt64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),t&2147483648?(t=~t&4294967295,e=~e&4294967295,e===4294967295&&(t=t+1&4294967295),e=e+1&4294967295,-(t*4294967296+e)):t*4294967296+e}getInt64Array(e){const t=[];for(let i=0;i<e;i++)t.push(this.getInt64());return t}getUint64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),t*4294967296+e}getFloat32(){const e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}getFloat32Array(e){const t=[];for(let i=0;i<e;i++)t.push(this.getFloat32());return t}getFloat64(){const e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){const t=[];for(let i=0;i<e;i++)t.push(this.getFloat64());return t}getArrayBuffer(e){const t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}getString(e){const t=this.offset;let i=new Uint8Array(this.dv.buffer,t,e);this.skip(e);const s=i.indexOf(0);return s>=0&&(i=new Uint8Array(this.dv.buffer,t,s)),this._textDecoder.decode(i)}}class so{add(e,t){this[e]=t}}function Hc(o){const e="Kaydara FBX Binary \0";return o.byteLength>=e.length&&e===ao(o,0,e.length)}function jc(o){const e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let t=0;function i(s){const n=o[s-1];return o=o.slice(t+s),t++,n}for(let s=0;s<e.length;++s)if(i(1)===e[s])return!1;return!0}function io(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 qc(o){return o/46186158e3}const zc=[];function ii(o,e,t,i){let s;switch(i.mappingType){case"ByPolygonVertex":s=o;break;case"ByPolygon":s=e;break;case"ByVertice":s=t;break;case"AllSame":s=i.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+i.mappingType)}i.referenceType==="IndexToDirect"&&(s=i.indices[s]);const n=s*i.dataSize,a=n+i.dataSize;return Kc(zc,i.buffer,n,a)}const ln=new Pt,ls=new N;function no(o){const e=new ce,t=new ce,i=new ce,s=new ce,n=new ce,a=new ce,r=new ce,A=new ce,c=new ce,l=new ce,h=new ce,d=new ce,p=o.inheritType?o.inheritType:0;o.translation&&e.setPosition(ls.fromArray(o.translation));const f=Fs(0);if(o.preRotation){const V=o.preRotation.map(Ce.degToRad);V.push(f),t.makeRotationFromEuler(ln.fromArray(V))}if(o.rotation){const V=o.rotation.map(Ce.degToRad);V.push(o.eulerOrder||f),i.makeRotationFromEuler(ln.fromArray(V))}if(o.postRotation){const V=o.postRotation.map(Ce.degToRad);V.push(f),s.makeRotationFromEuler(ln.fromArray(V)),s.invert()}o.scale&&n.scale(ls.fromArray(o.scale)),o.scalingOffset&&r.setPosition(ls.fromArray(o.scalingOffset)),o.scalingPivot&&a.setPosition(ls.fromArray(o.scalingPivot)),o.rotationOffset&&A.setPosition(ls.fromArray(o.rotationOffset)),o.rotationPivot&&c.setPosition(ls.fromArray(o.rotationPivot)),o.parentMatrixWorld&&(h.copy(o.parentMatrix),l.copy(o.parentMatrixWorld));const b=t.clone().multiply(i).multiply(s),m=new ce;m.extractRotation(l);const I=new ce;I.copyPosition(l);const E=I.clone().invert().multiply(l),C=m.clone().invert().multiply(E),y=n,w=new ce;if(p===0)w.copy(m).multiply(b).multiply(C).multiply(y);else if(p===1)w.copy(m).multiply(C).multiply(b).multiply(y);else{const V=new ce().scale(new N().setFromMatrixScale(h)).clone().invert(),K=C.clone().multiply(V);w.copy(m).multiply(b).multiply(K).multiply(y)}const x=c.clone().invert(),T=a.clone().invert();let S=e.clone().multiply(A).multiply(c).multiply(t).multiply(i).multiply(s).multiply(x).multiply(r).multiply(a).multiply(n).multiply(T);const _=new ce().copyPosition(S),Y=l.clone().multiply(_);return d.copyPosition(Y),S=d.clone().multiply(w),S.premultiply(l.invert()),S}function Fs(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 hn(o){return o.split(",").map(function(e){return parseFloat(e)})}function ao(o,e,t){return e===void 0&&(e=0),t===void 0&&(t=o.byteLength),new TextDecoder().decode(new Uint8Array(o,e,t))}function Yc(o,e){for(let t=0,i=o.length,s=e.length;t<s;t++,i++)o[i]=e[t]}function Kc(o,e,t,i){for(let s=t,n=0;s<i;s++,n++)o[n]=e[s];return o}class Jc extends Tt{constructor(e){super(e)}load(e,t,i,s){const n=this,a=this.path===""?Jt.extractUrlBase(e):this.path,r=new dt(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,function(A){try{t(n.parse(A,a))}catch(c){s?s(c):console.error(c),n.manager.itemError(e)}},i,s)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){const i=e.split(`
|
|
41
41
|
`);let s={};const n=/\s+/,a={};for(let A=0;A<i.length;A++){let c=i[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(n,3);s[h]=[parseFloat(p[0]),parseFloat(p[1]),parseFloat(p[2])]}else s[h]=d}const r=new Vc(this.resourcePath||t,this.materialOptions);return r.setCrossOrigin(this.crossOrigin),r.setManager(this.manager),r.setMaterials(a),r}}class Vc{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:Un,this.wrap=this.options.wrap!==void 0?this.options.wrap:Vt}setCrossOrigin(e){return this.crossOrigin=e,this}setManager(e){this.manager=e}setMaterials(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(e){if(!this.options)return e;const t={};for(const i in e){const s=e[i],n={};t[i]=n;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&&(n[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,i=this.materialsInfo[e],s={name:e,side:this.side};function n(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(n(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=le),s[r]=l}for(const r in i){const A=i[r];let c;if(A!=="")switch(r.toLowerCase()){case"kd":s.color=Xe.toWorkingColorSpace(new we().fromArray(A),le);break;case"ks":s.specular=Xe.toWorkingColorSpace(new we().fromArray(A),le);break;case"ke":s.emissive=Xe.toWorkingColorSpace(new we().fromArray(A),le);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 Cs(s),this.materials[e]}getTextureParams(e,t){const i={scale:new Le(1,1),offset:new Le(0,0)},s=e.split(/\s+/);let n;return n=s.indexOf("-bm"),n>=0&&(t.bumpScale=parseFloat(s[n+1]),s.splice(n,2)),n=s.indexOf("-s"),n>=0&&(i.scale.set(parseFloat(s[n+1]),parseFloat(s[n+2])),s.splice(n,4)),n=s.indexOf("-o"),n>=0&&(i.offset.set(parseFloat(s[n+1]),parseFloat(s[n+2])),s.splice(n,4)),i.url=s.join(" ").trim(),i}loadTexture(e,t,i,s,n){const a=this.manager!==void 0?this.manager:xr;let r=a.getHandler(e);r===null&&(r=new ui(a)),r.setCrossOrigin&&r.setCrossOrigin(this.crossOrigin);const A=r.load(e,i,s,n);return t!==void 0&&(A.mapping=t),A}}const Wc=/^[og]\s*(.+)?/,Xc=/^mtllib /,Zc=/^usemtl /,$c=/^usemap /,oo=/\s+/,ro=new N,gn=new N,Ao=new N,co=new N,ht=new N,ni=new we;function el(){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 i=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:t!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(s,n){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(n)&&n.length>0?n[n.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 n=this.currentMaterial();if(n&&n.groupEnd===-1&&(n.groupEnd=this.geometry.vertices.length/3,n.groupCount=n.groupEnd-n.groupStart,n.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}),n}},i&&i.name&&typeof i.clone=="function"){const s=i.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 i=parseInt(e,10);return(i>=0?i-1:i+t/3)*3},parseNormalIndex:function(e,t){const i=parseInt(e,10);return(i>=0?i-1:i+t/3)*3},parseUVIndex:function(e,t){const i=parseInt(e,10);return(i>=0?i-1:i+t/2)*2},addVertex:function(e,t,i){const s=this.vertices,n=this.object.geometry.vertices;n.push(s[e+0],s[e+1],s[e+2]),n.push(s[t+0],s[t+1],s[t+2]),n.push(s[i+0],s[i+1],s[i+2])},addVertexPoint:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,i){const s=this.normals,n=this.object.geometry.normals;n.push(s[e+0],s[e+1],s[e+2]),n.push(s[t+0],s[t+1],s[t+2]),n.push(s[i+0],s[i+1],s[i+2])},addFaceNormal:function(e,t,i){const s=this.vertices,n=this.object.geometry.normals;ro.fromArray(s,e),gn.fromArray(s,t),Ao.fromArray(s,i),ht.subVectors(Ao,gn),co.subVectors(ro,gn),ht.cross(co),ht.normalize(),n.push(ht.x,ht.y,ht.z),n.push(ht.x,ht.y,ht.z),n.push(ht.x,ht.y,ht.z)},addColor:function(e,t,i){const s=this.colors,n=this.object.geometry.colors;s[e]!==void 0&&n.push(s[e+0],s[e+1],s[e+2]),s[t]!==void 0&&n.push(s[t+0],s[t+1],s[t+2]),s[i]!==void 0&&n.push(s[i+0],s[i+1],s[i+2])},addUV:function(e,t,i){const s=this.uvs,n=this.object.geometry.uvs;n.push(s[e+0],s[e+1]),n.push(s[t+0],s[t+1]),n.push(s[i+0],s[i+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,i,s,n,a,r,A,c){const l=this.vertices.length;let h=this.parseVertexIndex(e,l),d=this.parseVertexIndex(t,l),p=this.parseVertexIndex(i,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(n,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 i=0,s=e.length;i<s;i++){const n=this.parseVertexIndex(e[i],t);this.addVertexPoint(n),this.addColor(n)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";const i=this.vertices.length,s=this.uvs.length;for(let n=0,a=e.length;n<a;n++)this.addVertexLine(this.parseVertexIndex(e[n],i));for(let n=0,a=t.length;n<a;n++)this.addUVLine(this.parseUVIndex(t[n],s))}};return o.startObject("",!1),o}class tl extends Tt{constructor(e){super(e),this.materials=null,this.materialsLoader=new Jc(e)}load(e,t,i,s){const n=this,a=new dt(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,async function(r){try{const A=n.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)=>{n.materialsLoader.load(d.toString(),b=>{n.setMaterials(b),p()},null,f)})}t(n.createObjects(A))}catch(A){s?s(A):console.error(A),n.manager.itemError(e)}},i,s)}setMTLLoader(e){return this.materialsLoader=e,this}setMaterials(e){return this.materials=e,this}parse(e,t=!1){const i=new el;e.indexOf(`\r
|
|
42
42
|
`)!==-1&&(e=e.replace(/\r\n/g,`
|
|
43
43
|
`)),e.indexOf(`\\
|
|
44
44
|
`)!==-1&&(e=e.replace(/\\\n/g,""));const s=e.split(`
|
|
45
|
-
`);let n=[];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(oo);switch(l[0]){case"v":i.vertices.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])),l.length>=7?(ni.setRGB(parseFloat(l[4]),parseFloat(l[5]),parseFloat(l[6]),le),i.colors.push(ni.r,ni.g,ni.b)):i.colors.push(void 0,void 0,void 0);break;case"vn":i.normals.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3]));break;case"vt":i.uvs.push(parseFloat(l[1]),parseFloat(l[2]));break}}else if(c==="f"){const l=A.slice(1).trim().split(oo),h=[];for(let p=0,f=l.length;p<f;p++){const b=l[p];if(b.length>0){const m=b.split("/");h.push(m)}}const d=h[0];for(let p=1,f=h.length-1;p<f;p++){const b=h[p],m=h[p+1];i.addFace(d[0],b[0],m[0],d[1],b[1],m[1],d[2],b[2],m[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])}i.addLineGeometry(h,d)}else if(c==="p"){const l=A.slice(1).trim().split(" ");i.addPointGeometry(l)}else if((n=Wc.exec(A))!==null){const l=(" "+n[0].slice(1).trim()).slice(1);i.startObject(l)}else if(Zc.test(A))i.object.startMaterial(A.substring(7).trim(),i.materialLibraries);else if(Xc.test(A))i.materialLibraries.push(A.substring(7).trim());else if($c.test(A))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(c==="s"){if(n=A.split(" "),n.length>1){const h=n[1].trim().toLowerCase();i.object.smooth=h!=="0"&&h!=="off"}else i.object.smooth=!0;const l=i.object.currentMaterial();l&&(l.smooth=i.object.smooth)}else{if(A==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+A+'"')}}return i.finalize(),t?i:this.createObjects(i)}createObjects(e){const t=new Wt;if(t.materialLibraries=[].concat(e.materialLibraries),!(e.objects.length===1&&e.objects[0].geometry.vertices.length===0))for(let i=0,s=e.objects.length;i<s;i++){const n=e.objects[i],a=n.geometry,r=n.materials,A=a.type==="Line",c=a.type==="Points";let l=!1;if(a.vertices.length===0)continue;const h=new ct;h.setAttribute("position",new Me(a.vertices,3)),a.normals.length>0&&h.setAttribute("normal",new Me(a.normals,3)),a.colors.length>0&&(l=!0,h.setAttribute("color",new Me(a.colors,3))),a.hasUVIndices===!0&&h.setAttribute("uv",new Me(a.uvs,2));const d=[];for(let f=0,b=r.length;f<b;f++){const m=r[f],I=m.name+"_"+m.smooth+"_"+l;let E=e.materials[I];if(this.materials!==null){if(E=this.materials.create(m.name),A&&E&&!(E instanceof Dt)){const C=new Dt;Kt.prototype.copy.call(C,E),C.color.copy(E.color),E=C}else if(c&&E&&!(E instanceof ms)){const C=new ms({size:10,sizeAttenuation:!1});Kt.prototype.copy.call(C,E),C.color.copy(E.color),C.map=E.map,E=C}}E===void 0&&(A?E=new Dt:c?E=new ms({size:1,sizeAttenuation:!1}):E=new Cs,E.name=m.name,E.flatShading=!m.smooth,E.vertexColors=l,e.materials[I]=E),d.push(E)}let p;if(d.length>1){for(let f=0,b=r.length;f<b;f++){const m=r[f];h.addGroup(m.groupStart,m.groupCount,f)}A?p=new zs(h,d):c?p=new Ys(h,d):p=new O(h,d)}else A?p=new zs(h,d[0]):c?p=new Ys(h,d[0]):p=new O(h,d[0]);p.name=n.name,t.add(p)}else if(e.vertices.length>0){const i=new ms({size:1,sizeAttenuation:!1}),s=new ct;s.setAttribute("position",new Me(e.vertices,3)),e.colors.length>0&&e.colors[0]!==void 0&&(s.setAttribute("color",new Me(e.colors,3)),i.vertexColors=!0);const n=new Ys(s,i);t.add(n)}return t}}const lo={type:"change"},dn={type:"start"},ho={type:"end"},sl={type:"endMovement"},ai=new Sr,go=new Tr,il=Math.cos(70*Ce.DEG2RAD),ke=new N;new N;const st=2*Math.PI,he={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},ts=1e-6;let nl=class extends Yn{constructor(o,e=null){super(o,e),this.state=he.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:rs.ROTATE,MIDDLE:rs.DOLLY,RIGHT:rs.PAN},this.touches={ONE:As.ROTATE,TWO:As.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 ye,this._lastTargetPosition=new N,this._quat=new ye().setFromUnitVectors(o.up,new N(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Vn,this._sphericalDelta=new Vn,this._scale=1,this._currentScale=1,this._panOffset=new N,this._rotateStart=new Le,this._rotateEnd=new Le,this._rotateDelta=new Le,this._panStart=new Le,this._panEnd=new Le,this._panDelta=new Le,this._dollyStart=new Le,this._dollyEnd=new Le,this._dollyDelta=new Le,this._dollyDirection=new N,this._mouse=new Le,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._lastIsDamping=!1,this._isDamping=!1,this._onPointerMove=ol.bind(this),this._onPointerDown=al.bind(this),this._onPointerUp=rl.bind(this),this._onContextMenu=pl.bind(this),this._onMouseWheel=ll.bind(this),this._onKeyDown=hl.bind(this),this._onTouchStart=gl.bind(this),this._onTouchMove=dl.bind(this),this._onMouseDown=Al.bind(this),this._onMouseMove=cl.bind(this),this._interceptControlDown=ul.bind(this),this._interceptControlUp=fl.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(lo),this.update(),this.state=he.NONE,this._isDamping=!1}update(o=null){if(this.enableDamping&&o===null)return;const e=this.object.getWorldPosition(this.object.position);ke.copy(e).sub(this.target),ke.applyQuaternion(this._quat),this._spherical.setFromVector3(ke),this.autoRotate&&this.state===he.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,i=this.maxAzimuthAngle;isFinite(t)&&isFinite(i)&&(t<-Math.PI?t+=st:t>Math.PI&&(t-=st),i<-Math.PI?i+=st:i>Math.PI&&(i-=st),t<=i?this._spherical.theta=Math.max(t,Math.min(i,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(t+i)/2?Math.max(t,this._spherical.theta):Math.min(i,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=Ce.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 n=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._currentScale),s=Math.abs(n-this._spherical.radius)>ts*100}if(ke.setFromSpherical(this._spherical),ke.applyQuaternion(this._quatInverse),e.copy(this.target).add(ke),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 n=null;if(this.object.isPerspectiveCamera){const a=ke.length();n=this._clampDistance(a*this._currentScale);const r=a-n;this.object.position.addScaledVector(this._dollyDirection,r),this.object.updateMatrixWorld(),s=Math.abs(r)>ts}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)>ts;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(),n=ke.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;n!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(n).add(this.object.position):(ai.origin.copy(this.object.position),ai.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(ai.direction))<il?this.object.lookAt(this.target):(go.setFromNormalAndCoplanarPoint(this.object.up,this.target),ai.intersectPlane(go,this.target))))}else if(this.object.isOrthographicCamera){const n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),Math.abs(n-this.object.zoom)>ts&&(this.object.updateProjectionMatrix(),s=!0)}return this._scale=1,s||this._lastPosition.distanceToSquared(this.object.position)>ts||8*(1-this._lastQuaternion.dot(this.object.quaternion))>ts||this._lastTargetPosition.distanceToSquared(this.target)>ts?(this.dispatchEvent(lo),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),this._lastIsDamping=!0,this._isDamping=!0,!0):(this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),this.state===he.NONE&&(this._lastIsDamping=this._isDamping,this._isDamping=!1),this._lastIsDamping&&!this._isDamping&&this.state===he.NONE&&(this._isDamping=!1,this._lastIsDamping=!1,this.dispatchEvent(sl)),this._performCursorZoom=!1,!1)}_getAutoRotationAngle(o){return o!==null?st/60*this.autoRotateSpeed*o:st/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){ke.setFromMatrixColumn(e,0),ke.multiplyScalar(-o),this._panOffset.add(ke)}_panUp(o,e){this.screenSpacePanning===!0?ke.setFromMatrixColumn(e,1):(ke.setFromMatrixColumn(e,0),ke.crossVectors(this.object.up,ke)),ke.multiplyScalar(o),this._panOffset.add(ke)}_pan(o,e){const t=this.domElement;if(this.object.isPerspectiveCamera){this.object.getWorldPosition(ke).sub(this.target);let i=ke.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*o*i/t.clientHeight,this.object.matrixWorld),this._panUp(2*e*i/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(),i=o-t.left,s=e-t.top,n=t.width,a=t.height;this._mouse.x=i/n*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(st*this._rotateDelta.x/e.clientHeight),this._rotateUp(st*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(st*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(-st*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(st*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(-st*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),i=.5*(o.pageY+e.y);this._rotateStart.set(t,i)}}_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),i=.5*(o.pageY+e.y);this._panStart.set(t,i)}}_handleTouchStartDolly(o){const e=this._getSecondPointerPosition(o),t=o.pageX-e.x,i=o.pageY-e.y,s=Math.sqrt(t*t+i*i);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),i=.5*(o.pageX+t.x),s=.5*(o.pageY+t.y);this._rotateEnd.set(i,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(st*this._rotateDelta.x/e.clientHeight),this._rotateUp(st*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),i=.5*(o.pageY+e.y);this._panEnd.set(t,i)}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,i=o.pageY-e.y,s=Math.sqrt(t*t+i*i);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 n=(o.pageX+e.x)*.5,a=(o.pageY+e.y)*.5;this._updateZoomParameters(n,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 Le,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 al(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 ol(o){this.enabled!==!1&&(o.pointerType==="touch"?this._onTouchMove(o):this._onMouseMove(o))}function rl(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(ho),this.state=he.NONE;break;case 1:const e=this._pointers[0],t=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:t.x,pageY:t.y});break}}function Al(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 rs.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(o),this.state=he.DOLLY;break;case rs.ROTATE:if(o.ctrlKey||o.metaKey||o.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(o),this.state=he.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(o),this.state=he.ROTATE}break;case rs.PAN:if(o.ctrlKey||o.metaKey||o.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(o),this.state=he.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(o),this.state=he.PAN}break;default:this.state=he.NONE}this.state!==he.NONE&&this.dispatchEvent(dn)}function cl(o){switch(this.state){case he.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(o);break;case he.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(o);break;case he.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(o);break}}function ll(o){this.enabled===!1||this.enableZoom===!1||this.state!==he.NONE||(o.preventDefault(),this.dispatchEvent(dn),this._handleMouseWheel(this._customWheelEvent(o)),this.dispatchEvent(ho))}function hl(o){this.enabled===!1||this.enablePan===!1||this._handleKeyDown(o)}function gl(o){switch(this._trackPointer(o),this._pointers.length){case 1:switch(this.touches.ONE){case As.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(o),this.state=he.TOUCH_ROTATE;break;case As.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(o),this.state=he.TOUCH_PAN;break;default:this.state=he.NONE}break;case 2:switch(this.touches.TWO){case As.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(o),this.state=he.TOUCH_DOLLY_PAN;break;case As.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(o),this.state=he.TOUCH_DOLLY_ROTATE;break;default:this.state=he.NONE}break;default:this.state=he.NONE}this.state!==he.NONE&&this.dispatchEvent(dn)}function dl(o){switch(this._trackPointer(o),this.state){case he.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(o),this.update();break;case he.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(o),this.update();break;case he.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(o),this.update();break;case he.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(o),this.update();break;default:this.state=he.NONE}}function pl(o){this.enabled!==!1&&o.preventDefault()}function ul(o){o.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function fl(o){o.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}class ml extends pt{constructor(e,t=1,i=16,s=2){const n=new ct,a=i+s*2,r=new Float32Array((a*3+3)*3);n.setAttribute("position",new nt(r,3));const A=new Dt({color:65280}),c=new Dt({color:16776960});super(n,[c,A]),this.audio=e,this.range=t,this.divisionsInnerAngle=i,this.divisionsOuterAngle=s,this.type="PositionalAudioHelper",this.update()}update(){const e=this.audio,t=this.range,i=this.divisionsInnerAngle,s=this.divisionsOuterAngle,n=Ce.degToRad(e.panner.coneInnerAngle),a=Ce.degToRad(e.panner.coneOuterAngle),r=n/2,A=a/2;let c=0,l=0,h,d;const p=this.geometry,f=p.attributes.position;p.clearGroups();function b(m,I,E,C){const y=(I-m)/E;for(f.setXYZ(c,0,0,0),l++,h=m;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,C),c+=l,l=0}b(-A,-r,s,0),b(-r,r,i,1),b(r,A,s,0),f.needsUpdate=!0,n===a&&(this.material[0].visible=!1)}dispose(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()}}const bl={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
|
|
45
|
+
`);let n=[];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(oo);switch(l[0]){case"v":i.vertices.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])),l.length>=7?(ni.setRGB(parseFloat(l[4]),parseFloat(l[5]),parseFloat(l[6]),le),i.colors.push(ni.r,ni.g,ni.b)):i.colors.push(void 0,void 0,void 0);break;case"vn":i.normals.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3]));break;case"vt":i.uvs.push(parseFloat(l[1]),parseFloat(l[2]));break}}else if(c==="f"){const l=A.slice(1).trim().split(oo),h=[];for(let p=0,f=l.length;p<f;p++){const b=l[p];if(b.length>0){const m=b.split("/");h.push(m)}}const d=h[0];for(let p=1,f=h.length-1;p<f;p++){const b=h[p],m=h[p+1];i.addFace(d[0],b[0],m[0],d[1],b[1],m[1],d[2],b[2],m[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])}i.addLineGeometry(h,d)}else if(c==="p"){const l=A.slice(1).trim().split(" ");i.addPointGeometry(l)}else if((n=Wc.exec(A))!==null){const l=(" "+n[0].slice(1).trim()).slice(1);i.startObject(l)}else if(Zc.test(A))i.object.startMaterial(A.substring(7).trim(),i.materialLibraries);else if(Xc.test(A))i.materialLibraries.push(A.substring(7).trim());else if($c.test(A))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(c==="s"){if(n=A.split(" "),n.length>1){const h=n[1].trim().toLowerCase();i.object.smooth=h!=="0"&&h!=="off"}else i.object.smooth=!0;const l=i.object.currentMaterial();l&&(l.smooth=i.object.smooth)}else{if(A==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+A+'"')}}return i.finalize(),t?i:this.createObjects(i)}createObjects(e){const t=new Wt;if(t.materialLibraries=[].concat(e.materialLibraries),!(e.objects.length===1&&e.objects[0].geometry.vertices.length===0))for(let i=0,s=e.objects.length;i<s;i++){const n=e.objects[i],a=n.geometry,r=n.materials,A=a.type==="Line",c=a.type==="Points";let l=!1;if(a.vertices.length===0)continue;const h=new ct;h.setAttribute("position",new Me(a.vertices,3)),a.normals.length>0&&h.setAttribute("normal",new Me(a.normals,3)),a.colors.length>0&&(l=!0,h.setAttribute("color",new Me(a.colors,3))),a.hasUVIndices===!0&&h.setAttribute("uv",new Me(a.uvs,2));const d=[];for(let f=0,b=r.length;f<b;f++){const m=r[f],I=m.name+"_"+m.smooth+"_"+l;let E=e.materials[I];if(this.materials!==null){if(E=this.materials.create(m.name),A&&E&&!(E instanceof Rt)){const C=new Rt;Kt.prototype.copy.call(C,E),C.color.copy(E.color),E=C}else if(c&&E&&!(E instanceof ms)){const C=new ms({size:10,sizeAttenuation:!1});Kt.prototype.copy.call(C,E),C.color.copy(E.color),C.map=E.map,E=C}}E===void 0&&(A?E=new Rt:c?E=new ms({size:1,sizeAttenuation:!1}):E=new Cs,E.name=m.name,E.flatShading=!m.smooth,E.vertexColors=l,e.materials[I]=E),d.push(E)}let p;if(d.length>1){for(let f=0,b=r.length;f<b;f++){const m=r[f];h.addGroup(m.groupStart,m.groupCount,f)}A?p=new zs(h,d):c?p=new Ys(h,d):p=new O(h,d)}else A?p=new zs(h,d[0]):c?p=new Ys(h,d[0]):p=new O(h,d[0]);p.name=n.name,t.add(p)}else if(e.vertices.length>0){const i=new ms({size:1,sizeAttenuation:!1}),s=new ct;s.setAttribute("position",new Me(e.vertices,3)),e.colors.length>0&&e.colors[0]!==void 0&&(s.setAttribute("color",new Me(e.colors,3)),i.vertexColors=!0);const n=new Ys(s,i);t.add(n)}return t}}const lo={type:"change"},dn={type:"start"},ho={type:"end"},sl={type:"endMovement"},ai=new Sr,go=new Tr,il=Math.cos(70*Ce.DEG2RAD),ke=new N;new N;const st=2*Math.PI,he={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},ts=1e-6;let nl=class extends Yn{constructor(o,e=null){super(o,e),this.state=he.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:rs.ROTATE,MIDDLE:rs.DOLLY,RIGHT:rs.PAN},this.touches={ONE:As.ROTATE,TWO:As.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 ye,this._lastTargetPosition=new N,this._quat=new ye().setFromUnitVectors(o.up,new N(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Vn,this._sphericalDelta=new Vn,this._scale=1,this._currentScale=1,this._panOffset=new N,this._rotateStart=new Le,this._rotateEnd=new Le,this._rotateDelta=new Le,this._panStart=new Le,this._panEnd=new Le,this._panDelta=new Le,this._dollyStart=new Le,this._dollyEnd=new Le,this._dollyDelta=new Le,this._dollyDirection=new N,this._mouse=new Le,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._lastIsDamping=!1,this._isDamping=!1,this._onPointerMove=ol.bind(this),this._onPointerDown=al.bind(this),this._onPointerUp=rl.bind(this),this._onContextMenu=pl.bind(this),this._onMouseWheel=ll.bind(this),this._onKeyDown=hl.bind(this),this._onTouchStart=gl.bind(this),this._onTouchMove=dl.bind(this),this._onMouseDown=Al.bind(this),this._onMouseMove=cl.bind(this),this._interceptControlDown=ul.bind(this),this._interceptControlUp=fl.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(lo),this.update(),this.state=he.NONE,this._isDamping=!1}update(o=null){if(this.enableDamping&&o===null)return;const e=this.object.getWorldPosition(this.object.position);ke.copy(e).sub(this.target),ke.applyQuaternion(this._quat),this._spherical.setFromVector3(ke),this.autoRotate&&this.state===he.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,i=this.maxAzimuthAngle;isFinite(t)&&isFinite(i)&&(t<-Math.PI?t+=st:t>Math.PI&&(t-=st),i<-Math.PI?i+=st:i>Math.PI&&(i-=st),t<=i?this._spherical.theta=Math.max(t,Math.min(i,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(t+i)/2?Math.max(t,this._spherical.theta):Math.min(i,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=Ce.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 n=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._currentScale),s=Math.abs(n-this._spherical.radius)>ts*100}if(ke.setFromSpherical(this._spherical),ke.applyQuaternion(this._quatInverse),e.copy(this.target).add(ke),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 n=null;if(this.object.isPerspectiveCamera){const a=ke.length();n=this._clampDistance(a*this._currentScale);const r=a-n;this.object.position.addScaledVector(this._dollyDirection,r),this.object.updateMatrixWorld(),s=Math.abs(r)>ts}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)>ts;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(),n=ke.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;n!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(n).add(this.object.position):(ai.origin.copy(this.object.position),ai.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(ai.direction))<il?this.object.lookAt(this.target):(go.setFromNormalAndCoplanarPoint(this.object.up,this.target),ai.intersectPlane(go,this.target))))}else if(this.object.isOrthographicCamera){const n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),Math.abs(n-this.object.zoom)>ts&&(this.object.updateProjectionMatrix(),s=!0)}return this._scale=1,s||this._lastPosition.distanceToSquared(this.object.position)>ts||8*(1-this._lastQuaternion.dot(this.object.quaternion))>ts||this._lastTargetPosition.distanceToSquared(this.target)>ts?(this.dispatchEvent(lo),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),this._lastIsDamping=!0,this._isDamping=!0,!0):(this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),this.state===he.NONE&&(this._lastIsDamping=this._isDamping,this._isDamping=!1),this._lastIsDamping&&!this._isDamping&&this.state===he.NONE&&(this._isDamping=!1,this._lastIsDamping=!1,this.dispatchEvent(sl)),this._performCursorZoom=!1,!1)}_getAutoRotationAngle(o){return o!==null?st/60*this.autoRotateSpeed*o:st/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){ke.setFromMatrixColumn(e,0),ke.multiplyScalar(-o),this._panOffset.add(ke)}_panUp(o,e){this.screenSpacePanning===!0?ke.setFromMatrixColumn(e,1):(ke.setFromMatrixColumn(e,0),ke.crossVectors(this.object.up,ke)),ke.multiplyScalar(o),this._panOffset.add(ke)}_pan(o,e){const t=this.domElement;if(this.object.isPerspectiveCamera){this.object.getWorldPosition(ke).sub(this.target);let i=ke.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*o*i/t.clientHeight,this.object.matrixWorld),this._panUp(2*e*i/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(),i=o-t.left,s=e-t.top,n=t.width,a=t.height;this._mouse.x=i/n*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(st*this._rotateDelta.x/e.clientHeight),this._rotateUp(st*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(st*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(-st*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(st*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(-st*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),i=.5*(o.pageY+e.y);this._rotateStart.set(t,i)}}_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),i=.5*(o.pageY+e.y);this._panStart.set(t,i)}}_handleTouchStartDolly(o){const e=this._getSecondPointerPosition(o),t=o.pageX-e.x,i=o.pageY-e.y,s=Math.sqrt(t*t+i*i);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),i=.5*(o.pageX+t.x),s=.5*(o.pageY+t.y);this._rotateEnd.set(i,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(st*this._rotateDelta.x/e.clientHeight),this._rotateUp(st*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),i=.5*(o.pageY+e.y);this._panEnd.set(t,i)}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,i=o.pageY-e.y,s=Math.sqrt(t*t+i*i);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 n=(o.pageX+e.x)*.5,a=(o.pageY+e.y)*.5;this._updateZoomParameters(n,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 Le,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 al(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 ol(o){this.enabled!==!1&&(o.pointerType==="touch"?this._onTouchMove(o):this._onMouseMove(o))}function rl(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(ho),this.state=he.NONE;break;case 1:const e=this._pointers[0],t=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:t.x,pageY:t.y});break}}function Al(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 rs.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(o),this.state=he.DOLLY;break;case rs.ROTATE:if(o.ctrlKey||o.metaKey||o.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(o),this.state=he.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(o),this.state=he.ROTATE}break;case rs.PAN:if(o.ctrlKey||o.metaKey||o.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(o),this.state=he.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(o),this.state=he.PAN}break;default:this.state=he.NONE}this.state!==he.NONE&&this.dispatchEvent(dn)}function cl(o){switch(this.state){case he.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(o);break;case he.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(o);break;case he.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(o);break}}function ll(o){this.enabled===!1||this.enableZoom===!1||this.state!==he.NONE||(o.preventDefault(),this.dispatchEvent(dn),this._handleMouseWheel(this._customWheelEvent(o)),this.dispatchEvent(ho))}function hl(o){this.enabled===!1||this.enablePan===!1||this._handleKeyDown(o)}function gl(o){switch(this._trackPointer(o),this._pointers.length){case 1:switch(this.touches.ONE){case As.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(o),this.state=he.TOUCH_ROTATE;break;case As.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(o),this.state=he.TOUCH_PAN;break;default:this.state=he.NONE}break;case 2:switch(this.touches.TWO){case As.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(o),this.state=he.TOUCH_DOLLY_PAN;break;case As.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(o),this.state=he.TOUCH_DOLLY_ROTATE;break;default:this.state=he.NONE}break;default:this.state=he.NONE}this.state!==he.NONE&&this.dispatchEvent(dn)}function dl(o){switch(this._trackPointer(o),this.state){case he.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(o),this.update();break;case he.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(o),this.update();break;case he.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(o),this.update();break;case he.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(o),this.update();break;default:this.state=he.NONE}}function pl(o){this.enabled!==!1&&o.preventDefault()}function ul(o){o.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function fl(o){o.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}class ml extends pt{constructor(e,t=1,i=16,s=2){const n=new ct,a=i+s*2,r=new Float32Array((a*3+3)*3);n.setAttribute("position",new nt(r,3));const A=new Rt({color:65280}),c=new Rt({color:16776960});super(n,[c,A]),this.audio=e,this.range=t,this.divisionsInnerAngle=i,this.divisionsOuterAngle=s,this.type="PositionalAudioHelper",this.update()}update(){const e=this.audio,t=this.range,i=this.divisionsInnerAngle,s=this.divisionsOuterAngle,n=Ce.degToRad(e.panner.coneInnerAngle),a=Ce.degToRad(e.panner.coneOuterAngle),r=n/2,A=a/2;let c=0,l=0,h,d;const p=this.geometry,f=p.attributes.position;p.clearGroups();function b(m,I,E,C){const y=(I-m)/E;for(f.setXYZ(c,0,0,0),l++,h=m;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,C),c+=l,l=0}b(-A,-r,s,0),b(-r,r,i,1),b(r,A,s,0),f.needsUpdate=!0,n===a&&(this.material[0].visible=!1)}dispose(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()}}const bl={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
|
|
46
46
|
|
|
47
47
|
varying vec2 vUv;
|
|
48
48
|
|
|
@@ -106,7 +106,7 @@ ${this.shader[Bs(t)]}
|
|
|
106
106
|
|
|
107
107
|
gl_FragColor = sum;
|
|
108
108
|
|
|
109
|
-
}`};let Ls,pn,hs,oi;function un(o,e=1/0,t=null){pn||(pn=new
|
|
109
|
+
}`};let Ls,pn,hs,oi;function un(o,e=1/0,t=null){pn||(pn=new Di(2,2,1,1)),hs||(hs=new Wn({uniforms:{blitTexture:new Rr(o)},vertexShader:`
|
|
110
110
|
varying vec2 vUv;
|
|
111
111
|
void main(){
|
|
112
112
|
vUv = uv;
|
|
@@ -123,7 +123,7 @@ ${this.shader[Bs(t)]}
|
|
|
123
123
|
#else
|
|
124
124
|
gl_FragColor = texture2D( blitTexture, vUv);
|
|
125
125
|
#endif
|
|
126
|
-
}`})),hs.uniforms.blitTexture.value=o,hs.defines.IS_SRGB=o.colorSpace==le,hs.needsUpdate=!0,oi||(oi=new O(pn,hs),oi.frustumCulled=!1);const i=new Os,s=new Mi;s.add(oi),t===null&&(t=Ls=new Rr({antialias:!1}));const n=Math.min(o.image.width,e),a=Math.min(o.image.height,e);t.setSize(n,a),t.clear(),t.render(s,i);const r=document.createElement("canvas"),A=r.getContext("2d");r.width=n,r.height=a,A.drawImage(t.domElement,0,0,n,a);const c=new Xn(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,Ls&&(Ls.forceContextLoss(),Ls.dispose(),Ls=null),c}const po={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 fn{constructor(){this.pluginCallbacks=[],this.register(function(e){return new Tl(e)}),this.register(function(e){return new Dl(e)}),this.register(function(e){return new _l(e)}),this.register(function(e){return new Fl(e)}),this.register(function(e){return new Ll(e)}),this.register(function(e){return new Nl(e)}),this.register(function(e){return new Rl(e)}),this.register(function(e){return new Ml(e)}),this.register(function(e){return new kl(e)}),this.register(function(e){return new Ul(e)}),this.register(function(e){return new Gl(e)}),this.register(function(e){return new Pl(e)}),this.register(function(e){return new Ol(e)}),this.register(function(e){return new Hl(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,i,s){const n=new Sl,a=[];for(let r=0,A=this.pluginCallbacks.length;r<A;r++)a.push(this.pluginCallbacks[r](n));n.setPlugins(a),n.write(e,t,s).catch(i)}parseAsync(e,t){const i=this;return new Promise(function(s,n){i.parse(e,s,n,t)})}}const ae={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},mn="KHR_mesh_quantization",rt={};rt[js]=ae.NEAREST,rt[fi]=ae.NEAREST_MIPMAP_NEAREST,rt[Dn]=ae.NEAREST_MIPMAP_LINEAR,rt[at]=ae.LINEAR,rt[Rn]=ae.LINEAR_MIPMAP_NEAREST,rt[fs]=ae.LINEAR_MIPMAP_LINEAR,rt[qs]=ae.CLAMP_TO_EDGE,rt[Vt]=ae.REPEAT,rt[Mn]=ae.MIRRORED_REPEAT;const uo={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},El=new we,fo=12,Cl=1179937895,Bl=2,mo=8,wl=1313821514,yl=5130562;function Ns(o,e){return o.length===e.length&&o.every(function(t,i){return t===e[i]})}function Ql(o){return new TextEncoder().encode(o).buffer}function vl(o){return Ns(o.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function xl(o,e,t){const i={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 n=0;n<o.itemSize;n++){let a;o.itemSize>4?a=o.array[s*o.itemSize+n]:(n===0?a=o.getX(s):n===1?a=o.getY(s):n===2?a=o.getZ(s):n===3&&(a=o.getW(s)),o.normalized===!0&&(a=Ce.normalize(a,o.array))),i.min[n]=Math.min(i.min[n],a),i.max[n]=Math.max(i.max[n],a)}return i}function bo(o){return Math.ceil(o/4)*4}function bn(o,e=0){const t=bo(o.byteLength);if(t!==o.byteLength){const i=new Uint8Array(t);if(i.set(new Uint8Array(o)),e!==0)for(let s=o.byteLength;s<t;s++)i[s]=e;return i.buffer}return o}function Io(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function Eo(o,e){if(o.toBlob!==void 0)return new Promise(i=>o.toBlob(i,e));let t;return e==="image/jpeg"?t=.92:e==="image/webp"&&(t=.8),o.convertToBlob({type:e,quality:t})}class Sl{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"+Mr}},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,i={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},i),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);const s=this,n=s.buffers,a=s.json;i=s.options;const r=s.extensionsUsed,A=s.extensionsRequired,c=new Blob(n,{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),i.binary===!0){const d=new FileReader;d.readAsArrayBuffer(c),d.onloadend=function(){const p=bn(d.result),f=new DataView(new ArrayBuffer(mo));f.setUint32(0,p.byteLength,!0),f.setUint32(4,yl,!0);const b=bn(Ql(JSON.stringify(a)),32),m=new DataView(new ArrayBuffer(mo));m.setUint32(0,b.byteLength,!0),m.setUint32(4,wl,!0);const I=new ArrayBuffer(fo),E=new DataView(I);E.setUint32(0,Cl,!0),E.setUint32(4,Bl,!0);const C=fo+m.byteLength+b.byteLength+f.byteLength+p.byteLength;E.setUint32(8,C,!0);const y=new Blob([I,m,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 i=this.options,s=this.extensionsUsed;try{const n=JSON.parse(JSON.stringify(e.userData));if(i.includeCustomExtensions&&n.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(const a in n.gltfExtensions)t.extensions[a]=n.gltfExtensions[a],s[a]=!0;delete n.gltfExtensions}Object.keys(n).length>0&&(t.extras=n)}catch(n){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+n.message)}}getUID(e,t=!1){if(this.uids.has(e)===!1){const i=new Map;i.set(!0,this.uid++),i.set(!1,this.uid++),this.uids.set(e,i)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const t=new N;for(let i=0,s=e.count;i<s;i++)if(Math.abs(t.fromBufferAttribute(e,i).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);const i=e.clone(),s=new N;for(let n=0,a=i.count;n<a;n++)s.fromBufferAttribute(i,n),s.x===0&&s.y===0&&s.z===0?s.setX(1):s.normalize(),i.setXYZ(n,s.x,s.y,s.z);return t.attributesNormalized.set(e,i),i}applyTextureTransform(e,t){let i=!1;const s={};(t.offset.x!==0||t.offset.y!==0)&&(s.offset=t.offset.toArray(),i=!0),t.rotation!==0&&(s.rotation=t.rotation,i=!0),(t.repeat.x!==1||t.repeat.y!==1)&&(s.scale=t.repeat.toArray(),i=!0),i&&(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 i(d){return d.colorSpace===le?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 bs&&(e=un(e)),t instanceof bs&&(t=un(t));const s=e?e.image:null,n=t?t.image:null,a=Math.max(s?s.width:0,n?n.width:0),r=Math.max(s?s.height:0,n?n.height:0),A=Io();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=i(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(n){c.drawImage(n,0,0,a,r);const d=i(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 kr(A),h.colorSpace=Vs,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,i=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),i.push(e),0}processBufferView(e,t,i,s,n){const a=this.json;a.bufferViews||(a.bufferViews=[]);let r;switch(t){case ae.BYTE:case ae.UNSIGNED_BYTE:r=1;break;case ae.SHORT:case ae.UNSIGNED_SHORT:r=2;break;default:r=4}let A=e.itemSize*r;n===ae.ARRAY_BUFFER&&(A=Math.ceil(A/4)*4);const c=bo(s*A),l=new DataView(new ArrayBuffer(c));let h=0;for(let p=i;p<i+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=Ce.normalize(b,e.array))),t===ae.FLOAT?l.setFloat32(h,b,!0):t===ae.INT?l.setInt32(h,b,!0):t===ae.UNSIGNED_INT?l.setUint32(h,b,!0):t===ae.SHORT?l.setInt16(h,b,!0):t===ae.UNSIGNED_SHORT?l.setUint16(h,b,!0):t===ae.BYTE?l.setInt8(h,b):t===ae.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 n!==void 0&&(d.target=n),n===ae.ARRAY_BUFFER&&(d.byteStride=A),this.byteOffset+=c,a.bufferViews.push(d),{id:a.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const t=this,i=t.json;return i.bufferViews||(i.bufferViews=[]),new Promise(function(s){const n=new FileReader;n.readAsArrayBuffer(e),n.onloadend=function(){const a=bn(n.result),r={buffer:t.processBuffer(a),byteOffset:t.byteOffset,byteLength:a.byteLength};t.byteOffset+=a.byteLength,s(i.bufferViews.push(r)-1)}})}processAccessor(e,t,i,s){const n=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let r;if(e.array.constructor===Float32Array)r=ae.FLOAT;else if(e.array.constructor===Int32Array)r=ae.INT;else if(e.array.constructor===Uint32Array)r=ae.UNSIGNED_INT;else if(e.array.constructor===Int16Array)r=ae.SHORT;else if(e.array.constructor===Uint16Array)r=ae.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)r=ae.BYTE;else if(e.array.constructor===Uint8Array)r=ae.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(i===void 0&&(i=0),(s===void 0||s===1/0)&&(s=e.count),s===0)return null;const A=xl(e,i,s);let c;t!==void 0&&(c=e===t.index?ae.ELEMENT_ARRAY_BUFFER:ae.ARRAY_BUFFER);const l=this.processBufferView(e,r,i,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),n.accessors||(n.accessors=[]),n.accessors.push(h)-1}processImage(e,t,i,s="image/png"){if(e!==null){const n=this,a=n.cache,r=n.json,A=n.options,c=n.pending;a.images.has(e)||a.images.set(e,{});const l=a.images.get(e),h=s+":flipY/"+i.toString();if(l[h]!==void 0)return l[h];r.images||(r.images=[]);const d={mimeType:s},p=Io();p.width=Math.min(e.width,A.maxTextureSize),p.height=Math.min(e.height,A.maxTextureSize);const f=p.getContext("2d",{willReadFrequently:!0});if(i===!0&&(f.translate(0,p.height),f.scale(1,-1)),e.data!==void 0){t!==Gt&&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 m=new Uint8ClampedArray(e.height*e.width*4);for(let I=0;I<m.length;I+=4)m[I+0]=e.data[I+0],m[I+1]=e.data[I+1],m[I+2]=e.data[I+2],m[I+3]=e.data[I+3];f.putImageData(new ImageData(m,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(Eo(p,s).then(m=>n.processBufferViewImage(m)).then(m=>{d.bufferView=m})):p.toDataURL!==void 0?d.uri=p.toDataURL(s):c.push(Eo(p,s).then(m=>new FileReader().readAsDataURL(m)).then(m=>{d.uri=m}));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 i={magFilter:rt[e.magFilter],minFilter:rt[e.minFilter],wrapS:rt[e.wrapS],wrapT:rt[e.wrapT]};return t.samplers.push(i)-1}processTexture(e){const t=this.options,i=this.cache,s=this.json;if(i.textures.has(e))return i.textures.get(e);const n={keep:!0,newTexture:null};if(this._invokeAll(function(c){c.beforeWriteTexture&&c.beforeWriteTexture(e,n)}),n.keep===!1)return null;n.newTexture!=null&&(e=n.newTexture),s.textures||(s.textures=[]),e instanceof bs&&(e=un(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 i.textures.set(e,A),A}processMaterial(e){const t=this.cache,i=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;i.materials||(i.materials=[]);const s={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const n=e.color.toArray().concat([e.opacity]);Ns(n,[1,1,1,1])||(s.pbrMetallicRoughness.baseColorFactor=n),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===bi&&(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=i.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 i=this.cache,s=this.json,n=[e.geometry.uuid];if(Array.isArray(e.material))for(let w=0,x=e.material.length;w<x;w++)n.push(e.material[w].uuid);else n.push(e.material.uuid);const a=n.join(":");if(i.meshes.has(a))return i.meshes.get(a);const r=e.geometry;let A;e.isLineSegments?A=ae.LINES:e.isLineLoop?A=ae.LINE_LOOP:e.isLine?A=ae.LINE_STRIP:e.isPoints?A=ae.POINTS:A=e.material.wireframe?ae.LINES:ae.TRIANGLES;const 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 x=r.attributes[w];if(w=p[w]||w.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(w)||(w="_"+w),i.attributes.has(this.getUID(x))){l[w]=i.attributes.get(this.getUID(x));continue}b=null;const T=x.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),x.itemSize,x.normalized));const S=this.processAccessor(b||x,r);S!==null&&(w.startsWith("_")||this.detectMeshQuantization(w,x),l[w]=S,i.attributes.set(this.getUID(x),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=[],x=[],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 _={};let Y=!1;for(const V in r.morphAttributes){if(V!=="position"&&V!=="normal"&&V!=="color"){Y||(console.warn("GLTFExporter: Only POSITION, NORMAL and COLOR morph are supported."),Y=!0);continue}const K=r.morphAttributes[V][S],W=V.toUpperCase()+(V==="color"?"_0":""),j=r.attributes[V];if(i.attributes.has(this.getUID(K,!0))){_[W]=i.attributes.get(this.getUID(K,!0));continue}const X=K.clone();if(!r.morphTargetsRelative)for(let J=0,ee=K.count;J<ee;J++)for(let $=0;$<K.itemSize;$++)$===0&&X.setX(J,K.getX(J)-j.getX(J)),$===1&&X.setY(J,K.getY(J)-j.getY(J)),$===2&&X.setZ(J,K.getZ(J)-j.getZ(J)),$===3&&X.setW(J,K.getW(J)-j.getW(J));_[W]=this.processAccessor(X,r),i.attributes.set(this.getUID(j,!0),_[W])}d.push(_),w.push(e.morphTargetInfluences[S]),e.morphTargetDictionary!==void 0&&x.push(T[S])}c.weights=w,x.length>0&&(c.extras={},c.extras.targetNames=x)}const m=Array.isArray(e.material);if(m&&r.groups.length===0)return null;let I=!1;if(m&&r.index===null){const w=[];for(let x=0,T=r.attributes.position.count;x<T;x++)w[x]=x;r.setIndex(w),I=!0}const E=m?e.material:[e.material],C=m?r.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let w=0,x=C.length;w<x;w++){const T={mode:A,attributes:l};if(this.serializeUserData(r,T),d.length>0&&(T.targets=d),r.index!==null){let _=this.getUID(r.index);(C[w].start!==void 0||C[w].count!==void 0)&&(_+=":"+C[w].start+":"+C[w].count),i.attributes.has(_)?T.indices=i.attributes.get(_):(T.indices=this.processAccessor(r.index,r,C[w].start,C[w].count),i.attributes.set(_,T.indices)),T.indices===null&&delete T.indices}const S=this.processMaterial(E[C[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 i.meshes.set(a,y),y}detectMeshQuantization(e,t){if(this.extensionsUsed[mn])return;let i;switch(t.array.constructor){case Int8Array:i="byte";break;case Uint8Array:i="unsigned byte";break;case Int16Array:i="short";break;case Uint16Array:i="unsigned short";break;default:return}t.normalized&&(i+=" normalized");const s=e.split("_",1)[0];po[s]&&po[s].includes(i)&&(this.extensionsUsed[mn]=!0,this.extensionsRequired[mn]=!0)}processCamera(e){const t=this.json;t.cameras||(t.cameras=[]);const i=e.isOrthographicCamera,s={type:i?"orthographic":"perspective"};return i?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:Ce.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 i=this.json,s=this.nodeMap;i.animations||(i.animations=[]),e=fn.Utils.mergeMorphTargetTracks(e.clone(),t);const n=e.tracks,a=[],r=[];for(let A=0;A<n.length;++A){const c=n[A],l=Rt.parseTrackName(c.name);let h=Rt.findNode(t,l.nodeName);const d=uo[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===uo.morphTargetInfluences&&(f/=h.morphTargetInfluences.length);let b;c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(b="CUBICSPLINE",f/=3):c.getInterpolation()===Nn?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 i.animations.push({name:e.name||"clip_"+i.animations.length,samplers:r,channels:a}),i.animations.length-1}processSkin(e){const t=this.json,i=this.nodeMap,s=t.nodes[i.get(e)],n=e.skeleton;if(n===void 0)return null;const a=e.skeleton.bones[0];if(a===void 0)return null;const r=[],A=new Float32Array(n.bones.length*16),c=new ce;for(let l=0;l<n.bones.length;++l)r.push(i.get(n.bones[l])),c.copy(n.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:i.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 i=this.json,s=this.options,n=this.nodeMap;i.nodes||(i.nodes=[]);const a={};if(s.trs){const A=e.quaternion.toArray(),c=e.position.toArray(),l=e.scale.toArray();Ns(A,[0,0,0,1])||(a.rotation=A),Ns(c,[0,0,0])||(a.translation=c),Ns(l,[1,1,1])||(a.scale=l)}else e.matrixAutoUpdate&&e.updateMatrix(),vl(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=i.nodes.push(a)-1;return n.set(e,r),r}processScene(e){const t=this.json,i=this.options;t.scenes||(t.scenes=[],t.scene=0);const s={};e.name!==""&&(s.name=e.name),t.scenes.push(s);const n=[];for(let a=0,r=e.children.length;a<r;a++){const A=e.children[a];if(A.visible||i.onlyVisible===!1){const c=this.processNode(A);c!==null&&n.push(c)}}n.length>0&&(s.nodes=n),this.serializeUserData(e,s)}processObjects(e){const t=new Mi;t.name="AuxScene";for(let i=0;i<e.length;i++)t.children.push(e[i]);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 i=[];for(let s=0;s<e.length;s++)e[s]instanceof Mi?this.processScene(e[s]):i.push(e[s]);i.length>0&&this.processObjects(i);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,i=this.plugins.length;t<i;t++)e(this.plugins[t])}}class Tl{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight){console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);return}const i=this.writer,s=i.json,n=i.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."),n[this.name]||(s.extensions=s.extensions||{},s.extensions[this.name]={lights:[]},n[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 Dl{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;const i=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},i[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}}class Rl{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;const i=this.writer,s=i.extensionsUsed,n={};if(n.clearcoatFactor=e.clearcoat,e.clearcoatMap){const a={index:i.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};i.applyTextureTransform(a,e.clearcoatMap),n.clearcoatTexture=a}if(n.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){const a={index:i.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};i.applyTextureTransform(a,e.clearcoatRoughnessMap),n.clearcoatRoughnessTexture=a}if(e.clearcoatNormalMap){const a={index:i.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};e.clearcoatNormalScale.x!==1&&(a.scale=e.clearcoatNormalScale.x),i.applyTextureTransform(a,e.clearcoatNormalMap),n.clearcoatNormalTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Ml{constructor(e){this.writer=e,this.name="KHR_materials_dispersion"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.dispersion===0)return;const i=this.writer.extensionsUsed,s={};s.dispersion=e.dispersion,t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}}class kl{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;const i=this.writer,s=i.extensionsUsed,n={};if(n.iridescenceFactor=e.iridescence,e.iridescenceMap){const a={index:i.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};i.applyTextureTransform(a,e.iridescenceMap),n.iridescenceTexture=a}if(n.iridescenceIor=e.iridescenceIOR,n.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],n.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){const a={index:i.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};i.applyTextureTransform(a,e.iridescenceThicknessMap),n.iridescenceThicknessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class _l{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const i=this.writer,s=i.extensionsUsed,n={};if(n.transmissionFactor=e.transmission,e.transmissionMap){const a={index:i.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};i.applyTextureTransform(a,e.transmissionMap),n.transmissionTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Fl{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const i=this.writer,s=i.extensionsUsed,n={};if(n.thicknessFactor=e.thickness,e.thicknessMap){const a={index:i.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};i.applyTextureTransform(a,e.thicknessMap),n.thicknessTexture=a}e.attenuationDistance!==1/0&&(n.attenuationDistance=e.attenuationDistance),n.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Ll{constructor(e){this.writer=e,this.name="KHR_materials_ior"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;const i=this.writer.extensionsUsed,s={};s.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}}class Nl{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(El)&&!e.specularIntensityMap&&!e.specularColorMap)return;const i=this.writer,s=i.extensionsUsed,n={};if(e.specularIntensityMap){const a={index:i.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};i.applyTextureTransform(a,e.specularIntensityMap),n.specularTexture=a}if(e.specularColorMap){const a={index:i.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};i.applyTextureTransform(a,e.specularColorMap),n.specularColorTexture=a}n.specularFactor=e.specularIntensity,n.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Ul{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;const i=this.writer,s=i.extensionsUsed,n={};if(e.sheenRoughnessMap){const a={index:i.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};i.applyTextureTransform(a,e.sheenRoughnessMap),n.sheenRoughnessTexture=a}if(e.sheenColorMap){const a={index:i.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};i.applyTextureTransform(a,e.sheenColorMap),n.sheenColorTexture=a}n.sheenRoughnessFactor=e.sheenRoughness,n.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Gl{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;const i=this.writer,s=i.extensionsUsed,n={};if(e.anisotropyMap){const a={index:i.processTexture(e.anisotropyMap)};i.applyTextureTransform(a,e.anisotropyMap),n.anisotropyTexture=a}n.anisotropyStrength=e.anisotropy,n.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Pl{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;const i=this.writer.extensionsUsed,s={};s.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}}class Ol{constructor(e){this.writer=e,this.name="EXT_materials_bump"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.bumpScale===1&&!e.bumpMap)return;const i=this.writer,s=i.extensionsUsed,n={};if(e.bumpMap){const a={index:i.processTexture(e.bumpMap),texCoord:e.bumpMap.channel};i.applyTextureTransform(a,e.bumpMap),n.bumpTexture=a}n.bumpFactor=e.bumpScale,t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Hl{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,t){if(!e.isInstancedMesh)return;const i=this.writer,s=e,n=new Float32Array(s.count*3),a=new Float32Array(s.count*4),r=new Float32Array(s.count*3),A=new ce,c=new N,l=new ye,h=new N;for(let p=0;p<s.count;p++)s.getMatrixAt(p,A),A.decompose(c,l,h),c.toArray(n,p*3),l.toArray(a,p*4),h.toArray(r,p*3);const d={TRANSLATION:i.processAccessor(new nt(n,3)),ROTATION:i.processAccessor(new nt(a,4)),SCALE:i.processAccessor(new nt(r,3))};s.instanceColor&&(d._COLOR_0=i.processAccessor(s.instanceColor)),t.extensions=t.extensions||{},t.extensions[this.name]={attributes:d},i.extensionsUsed[this.name]=!0,i.extensionsRequired[this.name]=!0}}fn.Utils={insertKeyframe:function(o,e){const t=o.getValueSize(),i=new o.TimeBufferType(o.times.length+1),s=new o.ValueBufferType(o.values.length+t),n=o.createInterpolant(new o.ValueBufferType(t));let a;if(o.times.length===0){i[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;i[0]=e,i.set(o.times,1),s.set(n.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;i[i.length-1]=e,i.set(o.times,0),s.set(o.values,0),s.set(n.evaluate(e),o.values.length),a=i.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){i.set(o.times.slice(0,r+1),0),i[r+1]=e,i.set(o.times.slice(r+1),r+2),s.set(o.values.slice(0,(r+1)*t),0),s.set(n.evaluate(e),(r+1)*t),s.set(o.values.slice((r+1)*t),(r+2)*t),a=r+1;break}}return o.times=i,o.values=s,a},mergeMorphTargetTracks:function(o,e){const t=[],i={},s=o.tracks;for(let n=0;n<s.length;++n){let a=s[n];const r=Rt.parseTrackName(a.name),A=Rt.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(Ei)}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(i[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,i[A.uuid]=h,t.push(h);continue}const d=a.createInterpolant(new a.ValueBufferType(1));h=i[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 Qe={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 Co(o){const e=await fetch(o);if(e.ok)return e.json();throw new Error(e.statusText)}async function jl(o){if(!o)throw new Error("No basePath supplied");return await Co(`${o}/profilesList.json`)}async function ql(o,e,t=null,i=!0){if(!o)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No basePath supplied");const s=await jl(e);let n;if(o.profiles.some(A=>{const c=s[A];return c&&(n={profileId:A,profilePath:`${e}/${c.path}`,deprecated:!!c.deprecated}),!!n}),!n){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.`);n={profileId:t,profilePath:`${e}/${A.path}`,deprecated:!!A.deprecated}}const a=await Co(n.profilePath);let r;if(i){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 ${n.profileId}`);A.assetPath&&(r=n.profilePath.replace("profile.json",A.assetPath))}return{profile:a,assetPath:r}}const zl={xAxis:0,yAxis:0,button:0,state:Qe.ComponentState.DEFAULT};function Yl(o=0,e=0){let t=o,i=e;if(Math.sqrt(o*o+e*e)>1){const s=Math.atan2(e,o);t=Math.cos(s),i=Math.sin(s)}return{normalizedXAxis:t*.5+.5,normalizedYAxis:i*.5+.5}}class Kl{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===Qe.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(zl)}updateFromComponent({xAxis:e,yAxis:t,button:i,state:s}){const{normalizedXAxis:n,normalizedYAxis:a}=Yl(e,t);switch(this.componentProperty){case Qe.ComponentProperty.X_AXIS:this.value=this.states.includes(s)?n:.5;break;case Qe.ComponentProperty.Y_AXIS:this.value=this.states.includes(s)?a:.5;break;case Qe.ComponentProperty.BUTTON:this.value=this.states.includes(s)?i:0;break;case Qe.ComponentProperty.STATE:this.valueNodeProperty===Qe.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 Jl{constructor(e,t){if(!e||!t||!t.visualResponses||!t.gamepadIndices||Object.keys(t.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach(i=>{const s=new Kl(t.visualResponses[i]);this.visualResponses[i]=s}),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:Qe.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=Qe.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=Qe.ComponentState.PRESSED:(t.touched||this.values.button>Qe.ButtonTouchThreshold)&&(this.values.state=Qe.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===Qe.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Qe.AxisTouchThreshold&&(this.values.state=Qe.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===Qe.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Qe.AxisTouchThreshold&&(this.values.state=Qe.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(t=>{t.updateFromComponent(this.values)})}}class Vl{constructor(e,t,i){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");this.xrInputSource=e,this.assetUrl=i,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(s=>{const n=this.layoutDescription.components[s];this.components[s]=new Jl(s,n)}),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 Wl="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",Xl="generic-trigger";class Zl 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(i=>{const{valueNode:s,minNode:n,maxNode:a,value:r,valueNodeProperty:A}=i;s&&(A===Qe.VisualResponseProperty.VISIBILITY?s.visible=r:A===Qe.VisualResponseProperty.TRANSFORM&&(s.quaternion.slerpQuaternions(n.quaternion,a.quaternion,r),s.position.lerpVectors(n.position,a.position,r)))})}))}}function $l(o,e){Object.values(o.components).forEach(t=>{const{type:i,touchPointNodeName:s,visualResponses:n}=t;if(i===Qe.ComponentType.TOUCHPAD)if(t.touchPointNode=e.getObjectByName(s),t.touchPointNode){const a=new hi(.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(n).forEach(a=>{const{valueNodeName:r,minNodeName:A,maxNodeName:c,valueNodeProperty:l}=a;if(l===Qe.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 Bo(o,e){$l(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 eh{constructor(e=null,t=null){this.gltfLoader=e,this.path=Wl,this._assetCache={},this.onLoad=t,this.gltfLoader||(this.gltfLoader=new _i)}setPath(e){return this.path=e,this}createControllerModel(e){const t=new Zl;let i=null;return e.addEventListener("connected",s=>{const n=s.data;n.targetRayMode!=="tracked-pointer"||!n.gamepad||n.hand||ql(n,this.path,Xl).then(({profile:a,assetPath:r})=>{t.motionController=new Vl(n,a,r);const A=this._assetCache[t.motionController.assetUrl];if(A)i=A.scene.clone(),Bo(t,i),this.onLoad&&this.onLoad(i);else{if(!this.gltfLoader)throw new Error("GLTFLoader not set.");this.gltfLoader.setPath(""),this.gltfLoader.load(t.motionController.assetUrl,c=>{this._assetCache[t.motionController.assetUrl]=c,i=c.scene.clone(),Bo(t,i),this.onLoad&&this.onLoad(i)},null,()=>{throw new Error(`Asset ${t.motionController.assetUrl} missing or malformed.`)})}}).catch(a=>{console.warn(a)})}),e.addEventListener("disconnected",()=>{t.motionController=null,t.remove(i),i=null}),t}}const th="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/generic-hand/";class sh{constructor(e,t,i,s,n=null,a=null){this.controller=t,this.handModel=e,this.bones=[],n===null&&(n=new _i,n.setPath(i||th)),n.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 i=this.bones[t];if(i){const s=e[i.jointName];if(s.visible){const n=s.position;i.position.copy(n),i.quaternion.copy(s.quaternion)}}}}}const wo=new Ks,ri=new N;class yo extends _r{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(i),this.setAttribute("position",new Me(e,3)),this.setAttribute("uv",new Me(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,i=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),i.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const i=new ki(t,6,1);return this.setAttribute("instanceStart",new Xt(i,3,0)),this.setAttribute("instanceEnd",new Xt(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const i=new ki(t,6,1);return this.setAttribute("instanceColorStart",new Xt(i,3,0)),this.setAttribute("instanceColorEnd",new Xt(i,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new Fr(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ks);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),wo.setFromBufferAttribute(t),this.boundingBox.union(wo))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Qi),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const i=this.boundingSphere.center;this.boundingBox.getCenter(i);let s=0;for(let n=0,a=e.count;n<a;n++)ri.fromBufferAttribute(e,n),s=Math.max(s,i.distanceToSquared(ri)),ri.fromBufferAttribute(t,n),s=Math.max(s,i.distanceToSquared(ri));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)}}us.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Le(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},Et.line={uniforms:gi.merge([us.common,us.fog,us.line]),vertexShader:`
|
|
126
|
+
}`})),hs.uniforms.blitTexture.value=o,hs.defines.IS_SRGB=o.colorSpace==le,hs.needsUpdate=!0,oi||(oi=new O(pn,hs),oi.frustumCulled=!1);const i=new Os,s=new Mi;s.add(oi),t===null&&(t=Ls=new Dr({antialias:!1}));const n=Math.min(o.image.width,e),a=Math.min(o.image.height,e);t.setSize(n,a),t.clear(),t.render(s,i);const r=document.createElement("canvas"),A=r.getContext("2d");r.width=n,r.height=a,A.drawImage(t.domElement,0,0,n,a);const c=new Xn(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,Ls&&(Ls.forceContextLoss(),Ls.dispose(),Ls=null),c}const po={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 fn{constructor(){this.pluginCallbacks=[],this.register(function(e){return new Tl(e)}),this.register(function(e){return new Rl(e)}),this.register(function(e){return new _l(e)}),this.register(function(e){return new Fl(e)}),this.register(function(e){return new Ll(e)}),this.register(function(e){return new Nl(e)}),this.register(function(e){return new Dl(e)}),this.register(function(e){return new Ml(e)}),this.register(function(e){return new kl(e)}),this.register(function(e){return new Ul(e)}),this.register(function(e){return new Gl(e)}),this.register(function(e){return new Pl(e)}),this.register(function(e){return new Ol(e)}),this.register(function(e){return new Hl(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,i,s){const n=new Sl,a=[];for(let r=0,A=this.pluginCallbacks.length;r<A;r++)a.push(this.pluginCallbacks[r](n));n.setPlugins(a),n.write(e,t,s).catch(i)}parseAsync(e,t){const i=this;return new Promise(function(s,n){i.parse(e,s,n,t)})}}const ae={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},mn="KHR_mesh_quantization",rt={};rt[js]=ae.NEAREST,rt[fi]=ae.NEAREST_MIPMAP_NEAREST,rt[Rn]=ae.NEAREST_MIPMAP_LINEAR,rt[at]=ae.LINEAR,rt[Dn]=ae.LINEAR_MIPMAP_NEAREST,rt[fs]=ae.LINEAR_MIPMAP_LINEAR,rt[qs]=ae.CLAMP_TO_EDGE,rt[Vt]=ae.REPEAT,rt[Mn]=ae.MIRRORED_REPEAT;const uo={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},El=new we,fo=12,Cl=1179937895,Bl=2,mo=8,wl=1313821514,yl=5130562;function Ns(o,e){return o.length===e.length&&o.every(function(t,i){return t===e[i]})}function Ql(o){return new TextEncoder().encode(o).buffer}function vl(o){return Ns(o.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function xl(o,e,t){const i={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 n=0;n<o.itemSize;n++){let a;o.itemSize>4?a=o.array[s*o.itemSize+n]:(n===0?a=o.getX(s):n===1?a=o.getY(s):n===2?a=o.getZ(s):n===3&&(a=o.getW(s)),o.normalized===!0&&(a=Ce.normalize(a,o.array))),i.min[n]=Math.min(i.min[n],a),i.max[n]=Math.max(i.max[n],a)}return i}function bo(o){return Math.ceil(o/4)*4}function bn(o,e=0){const t=bo(o.byteLength);if(t!==o.byteLength){const i=new Uint8Array(t);if(i.set(new Uint8Array(o)),e!==0)for(let s=o.byteLength;s<t;s++)i[s]=e;return i.buffer}return o}function Io(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function Eo(o,e){if(o.toBlob!==void 0)return new Promise(i=>o.toBlob(i,e));let t;return e==="image/jpeg"?t=.92:e==="image/webp"&&(t=.8),o.convertToBlob({type:e,quality:t})}class Sl{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"+Mr}},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,i={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},i),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);const s=this,n=s.buffers,a=s.json;i=s.options;const r=s.extensionsUsed,A=s.extensionsRequired,c=new Blob(n,{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),i.binary===!0){const d=new FileReader;d.readAsArrayBuffer(c),d.onloadend=function(){const p=bn(d.result),f=new DataView(new ArrayBuffer(mo));f.setUint32(0,p.byteLength,!0),f.setUint32(4,yl,!0);const b=bn(Ql(JSON.stringify(a)),32),m=new DataView(new ArrayBuffer(mo));m.setUint32(0,b.byteLength,!0),m.setUint32(4,wl,!0);const I=new ArrayBuffer(fo),E=new DataView(I);E.setUint32(0,Cl,!0),E.setUint32(4,Bl,!0);const C=fo+m.byteLength+b.byteLength+f.byteLength+p.byteLength;E.setUint32(8,C,!0);const y=new Blob([I,m,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 i=this.options,s=this.extensionsUsed;try{const n=JSON.parse(JSON.stringify(e.userData));if(i.includeCustomExtensions&&n.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(const a in n.gltfExtensions)t.extensions[a]=n.gltfExtensions[a],s[a]=!0;delete n.gltfExtensions}Object.keys(n).length>0&&(t.extras=n)}catch(n){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+n.message)}}getUID(e,t=!1){if(this.uids.has(e)===!1){const i=new Map;i.set(!0,this.uid++),i.set(!1,this.uid++),this.uids.set(e,i)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const t=new N;for(let i=0,s=e.count;i<s;i++)if(Math.abs(t.fromBufferAttribute(e,i).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);const i=e.clone(),s=new N;for(let n=0,a=i.count;n<a;n++)s.fromBufferAttribute(i,n),s.x===0&&s.y===0&&s.z===0?s.setX(1):s.normalize(),i.setXYZ(n,s.x,s.y,s.z);return t.attributesNormalized.set(e,i),i}applyTextureTransform(e,t){let i=!1;const s={};(t.offset.x!==0||t.offset.y!==0)&&(s.offset=t.offset.toArray(),i=!0),t.rotation!==0&&(s.rotation=t.rotation,i=!0),(t.repeat.x!==1||t.repeat.y!==1)&&(s.scale=t.repeat.toArray(),i=!0),i&&(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 i(d){return d.colorSpace===le?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 bs&&(e=un(e)),t instanceof bs&&(t=un(t));const s=e?e.image:null,n=t?t.image:null,a=Math.max(s?s.width:0,n?n.width:0),r=Math.max(s?s.height:0,n?n.height:0),A=Io();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=i(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(n){c.drawImage(n,0,0,a,r);const d=i(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 kr(A),h.colorSpace=Vs,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,i=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),i.push(e),0}processBufferView(e,t,i,s,n){const a=this.json;a.bufferViews||(a.bufferViews=[]);let r;switch(t){case ae.BYTE:case ae.UNSIGNED_BYTE:r=1;break;case ae.SHORT:case ae.UNSIGNED_SHORT:r=2;break;default:r=4}let A=e.itemSize*r;n===ae.ARRAY_BUFFER&&(A=Math.ceil(A/4)*4);const c=bo(s*A),l=new DataView(new ArrayBuffer(c));let h=0;for(let p=i;p<i+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=Ce.normalize(b,e.array))),t===ae.FLOAT?l.setFloat32(h,b,!0):t===ae.INT?l.setInt32(h,b,!0):t===ae.UNSIGNED_INT?l.setUint32(h,b,!0):t===ae.SHORT?l.setInt16(h,b,!0):t===ae.UNSIGNED_SHORT?l.setUint16(h,b,!0):t===ae.BYTE?l.setInt8(h,b):t===ae.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 n!==void 0&&(d.target=n),n===ae.ARRAY_BUFFER&&(d.byteStride=A),this.byteOffset+=c,a.bufferViews.push(d),{id:a.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const t=this,i=t.json;return i.bufferViews||(i.bufferViews=[]),new Promise(function(s){const n=new FileReader;n.readAsArrayBuffer(e),n.onloadend=function(){const a=bn(n.result),r={buffer:t.processBuffer(a),byteOffset:t.byteOffset,byteLength:a.byteLength};t.byteOffset+=a.byteLength,s(i.bufferViews.push(r)-1)}})}processAccessor(e,t,i,s){const n=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let r;if(e.array.constructor===Float32Array)r=ae.FLOAT;else if(e.array.constructor===Int32Array)r=ae.INT;else if(e.array.constructor===Uint32Array)r=ae.UNSIGNED_INT;else if(e.array.constructor===Int16Array)r=ae.SHORT;else if(e.array.constructor===Uint16Array)r=ae.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)r=ae.BYTE;else if(e.array.constructor===Uint8Array)r=ae.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(i===void 0&&(i=0),(s===void 0||s===1/0)&&(s=e.count),s===0)return null;const A=xl(e,i,s);let c;t!==void 0&&(c=e===t.index?ae.ELEMENT_ARRAY_BUFFER:ae.ARRAY_BUFFER);const l=this.processBufferView(e,r,i,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),n.accessors||(n.accessors=[]),n.accessors.push(h)-1}processImage(e,t,i,s="image/png"){if(e!==null){const n=this,a=n.cache,r=n.json,A=n.options,c=n.pending;a.images.has(e)||a.images.set(e,{});const l=a.images.get(e),h=s+":flipY/"+i.toString();if(l[h]!==void 0)return l[h];r.images||(r.images=[]);const d={mimeType:s},p=Io();p.width=Math.min(e.width,A.maxTextureSize),p.height=Math.min(e.height,A.maxTextureSize);const f=p.getContext("2d",{willReadFrequently:!0});if(i===!0&&(f.translate(0,p.height),f.scale(1,-1)),e.data!==void 0){t!==Gt&&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 m=new Uint8ClampedArray(e.height*e.width*4);for(let I=0;I<m.length;I+=4)m[I+0]=e.data[I+0],m[I+1]=e.data[I+1],m[I+2]=e.data[I+2],m[I+3]=e.data[I+3];f.putImageData(new ImageData(m,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(Eo(p,s).then(m=>n.processBufferViewImage(m)).then(m=>{d.bufferView=m})):p.toDataURL!==void 0?d.uri=p.toDataURL(s):c.push(Eo(p,s).then(m=>new FileReader().readAsDataURL(m)).then(m=>{d.uri=m}));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 i={magFilter:rt[e.magFilter],minFilter:rt[e.minFilter],wrapS:rt[e.wrapS],wrapT:rt[e.wrapT]};return t.samplers.push(i)-1}processTexture(e){const t=this.options,i=this.cache,s=this.json;if(i.textures.has(e))return i.textures.get(e);const n={keep:!0,newTexture:null};if(this._invokeAll(function(c){c.beforeWriteTexture&&c.beforeWriteTexture(e,n)}),n.keep===!1)return null;n.newTexture!=null&&(e=n.newTexture),s.textures||(s.textures=[]),e instanceof bs&&(e=un(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 i.textures.set(e,A),A}processMaterial(e){const t=this.cache,i=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;i.materials||(i.materials=[]);const s={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const n=e.color.toArray().concat([e.opacity]);Ns(n,[1,1,1,1])||(s.pbrMetallicRoughness.baseColorFactor=n),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===bi&&(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=i.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 i=this.cache,s=this.json,n=[e.geometry.uuid];if(Array.isArray(e.material))for(let w=0,x=e.material.length;w<x;w++)n.push(e.material[w].uuid);else n.push(e.material.uuid);const a=n.join(":");if(i.meshes.has(a))return i.meshes.get(a);const r=e.geometry;let A;e.isLineSegments?A=ae.LINES:e.isLineLoop?A=ae.LINE_LOOP:e.isLine?A=ae.LINE_STRIP:e.isPoints?A=ae.POINTS:A=e.material.wireframe?ae.LINES:ae.TRIANGLES;const 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 x=r.attributes[w];if(w=p[w]||w.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(w)||(w="_"+w),i.attributes.has(this.getUID(x))){l[w]=i.attributes.get(this.getUID(x));continue}b=null;const T=x.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),x.itemSize,x.normalized));const S=this.processAccessor(b||x,r);S!==null&&(w.startsWith("_")||this.detectMeshQuantization(w,x),l[w]=S,i.attributes.set(this.getUID(x),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=[],x=[],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 _={};let Y=!1;for(const V in r.morphAttributes){if(V!=="position"&&V!=="normal"&&V!=="color"){Y||(console.warn("GLTFExporter: Only POSITION, NORMAL and COLOR morph are supported."),Y=!0);continue}const K=r.morphAttributes[V][S],W=V.toUpperCase()+(V==="color"?"_0":""),j=r.attributes[V];if(i.attributes.has(this.getUID(K,!0))){_[W]=i.attributes.get(this.getUID(K,!0));continue}const X=K.clone();if(!r.morphTargetsRelative)for(let J=0,ee=K.count;J<ee;J++)for(let $=0;$<K.itemSize;$++)$===0&&X.setX(J,K.getX(J)-j.getX(J)),$===1&&X.setY(J,K.getY(J)-j.getY(J)),$===2&&X.setZ(J,K.getZ(J)-j.getZ(J)),$===3&&X.setW(J,K.getW(J)-j.getW(J));_[W]=this.processAccessor(X,r),i.attributes.set(this.getUID(j,!0),_[W])}d.push(_),w.push(e.morphTargetInfluences[S]),e.morphTargetDictionary!==void 0&&x.push(T[S])}c.weights=w,x.length>0&&(c.extras={},c.extras.targetNames=x)}const m=Array.isArray(e.material);if(m&&r.groups.length===0)return null;let I=!1;if(m&&r.index===null){const w=[];for(let x=0,T=r.attributes.position.count;x<T;x++)w[x]=x;r.setIndex(w),I=!0}const E=m?e.material:[e.material],C=m?r.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let w=0,x=C.length;w<x;w++){const T={mode:A,attributes:l};if(this.serializeUserData(r,T),d.length>0&&(T.targets=d),r.index!==null){let _=this.getUID(r.index);(C[w].start!==void 0||C[w].count!==void 0)&&(_+=":"+C[w].start+":"+C[w].count),i.attributes.has(_)?T.indices=i.attributes.get(_):(T.indices=this.processAccessor(r.index,r,C[w].start,C[w].count),i.attributes.set(_,T.indices)),T.indices===null&&delete T.indices}const S=this.processMaterial(E[C[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 i.meshes.set(a,y),y}detectMeshQuantization(e,t){if(this.extensionsUsed[mn])return;let i;switch(t.array.constructor){case Int8Array:i="byte";break;case Uint8Array:i="unsigned byte";break;case Int16Array:i="short";break;case Uint16Array:i="unsigned short";break;default:return}t.normalized&&(i+=" normalized");const s=e.split("_",1)[0];po[s]&&po[s].includes(i)&&(this.extensionsUsed[mn]=!0,this.extensionsRequired[mn]=!0)}processCamera(e){const t=this.json;t.cameras||(t.cameras=[]);const i=e.isOrthographicCamera,s={type:i?"orthographic":"perspective"};return i?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:Ce.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 i=this.json,s=this.nodeMap;i.animations||(i.animations=[]),e=fn.Utils.mergeMorphTargetTracks(e.clone(),t);const n=e.tracks,a=[],r=[];for(let A=0;A<n.length;++A){const c=n[A],l=Dt.parseTrackName(c.name);let h=Dt.findNode(t,l.nodeName);const d=uo[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===uo.morphTargetInfluences&&(f/=h.morphTargetInfluences.length);let b;c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(b="CUBICSPLINE",f/=3):c.getInterpolation()===Nn?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 i.animations.push({name:e.name||"clip_"+i.animations.length,samplers:r,channels:a}),i.animations.length-1}processSkin(e){const t=this.json,i=this.nodeMap,s=t.nodes[i.get(e)],n=e.skeleton;if(n===void 0)return null;const a=e.skeleton.bones[0];if(a===void 0)return null;const r=[],A=new Float32Array(n.bones.length*16),c=new ce;for(let l=0;l<n.bones.length;++l)r.push(i.get(n.bones[l])),c.copy(n.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:i.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 i=this.json,s=this.options,n=this.nodeMap;i.nodes||(i.nodes=[]);const a={};if(s.trs){const A=e.quaternion.toArray(),c=e.position.toArray(),l=e.scale.toArray();Ns(A,[0,0,0,1])||(a.rotation=A),Ns(c,[0,0,0])||(a.translation=c),Ns(l,[1,1,1])||(a.scale=l)}else e.matrixAutoUpdate&&e.updateMatrix(),vl(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=i.nodes.push(a)-1;return n.set(e,r),r}processScene(e){const t=this.json,i=this.options;t.scenes||(t.scenes=[],t.scene=0);const s={};e.name!==""&&(s.name=e.name),t.scenes.push(s);const n=[];for(let a=0,r=e.children.length;a<r;a++){const A=e.children[a];if(A.visible||i.onlyVisible===!1){const c=this.processNode(A);c!==null&&n.push(c)}}n.length>0&&(s.nodes=n),this.serializeUserData(e,s)}processObjects(e){const t=new Mi;t.name="AuxScene";for(let i=0;i<e.length;i++)t.children.push(e[i]);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 i=[];for(let s=0;s<e.length;s++)e[s]instanceof Mi?this.processScene(e[s]):i.push(e[s]);i.length>0&&this.processObjects(i);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,i=this.plugins.length;t<i;t++)e(this.plugins[t])}}class Tl{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight){console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);return}const i=this.writer,s=i.json,n=i.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."),n[this.name]||(s.extensions=s.extensions||{},s.extensions[this.name]={lights:[]},n[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 Rl{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;const i=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},i[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}}class Dl{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;const i=this.writer,s=i.extensionsUsed,n={};if(n.clearcoatFactor=e.clearcoat,e.clearcoatMap){const a={index:i.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};i.applyTextureTransform(a,e.clearcoatMap),n.clearcoatTexture=a}if(n.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){const a={index:i.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};i.applyTextureTransform(a,e.clearcoatRoughnessMap),n.clearcoatRoughnessTexture=a}if(e.clearcoatNormalMap){const a={index:i.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};e.clearcoatNormalScale.x!==1&&(a.scale=e.clearcoatNormalScale.x),i.applyTextureTransform(a,e.clearcoatNormalMap),n.clearcoatNormalTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Ml{constructor(e){this.writer=e,this.name="KHR_materials_dispersion"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.dispersion===0)return;const i=this.writer.extensionsUsed,s={};s.dispersion=e.dispersion,t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}}class kl{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;const i=this.writer,s=i.extensionsUsed,n={};if(n.iridescenceFactor=e.iridescence,e.iridescenceMap){const a={index:i.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};i.applyTextureTransform(a,e.iridescenceMap),n.iridescenceTexture=a}if(n.iridescenceIor=e.iridescenceIOR,n.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],n.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){const a={index:i.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};i.applyTextureTransform(a,e.iridescenceThicknessMap),n.iridescenceThicknessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class _l{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const i=this.writer,s=i.extensionsUsed,n={};if(n.transmissionFactor=e.transmission,e.transmissionMap){const a={index:i.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};i.applyTextureTransform(a,e.transmissionMap),n.transmissionTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Fl{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const i=this.writer,s=i.extensionsUsed,n={};if(n.thicknessFactor=e.thickness,e.thicknessMap){const a={index:i.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};i.applyTextureTransform(a,e.thicknessMap),n.thicknessTexture=a}e.attenuationDistance!==1/0&&(n.attenuationDistance=e.attenuationDistance),n.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Ll{constructor(e){this.writer=e,this.name="KHR_materials_ior"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;const i=this.writer.extensionsUsed,s={};s.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}}class Nl{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(El)&&!e.specularIntensityMap&&!e.specularColorMap)return;const i=this.writer,s=i.extensionsUsed,n={};if(e.specularIntensityMap){const a={index:i.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};i.applyTextureTransform(a,e.specularIntensityMap),n.specularTexture=a}if(e.specularColorMap){const a={index:i.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};i.applyTextureTransform(a,e.specularColorMap),n.specularColorTexture=a}n.specularFactor=e.specularIntensity,n.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Ul{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;const i=this.writer,s=i.extensionsUsed,n={};if(e.sheenRoughnessMap){const a={index:i.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};i.applyTextureTransform(a,e.sheenRoughnessMap),n.sheenRoughnessTexture=a}if(e.sheenColorMap){const a={index:i.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};i.applyTextureTransform(a,e.sheenColorMap),n.sheenColorTexture=a}n.sheenRoughnessFactor=e.sheenRoughness,n.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Gl{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;const i=this.writer,s=i.extensionsUsed,n={};if(e.anisotropyMap){const a={index:i.processTexture(e.anisotropyMap)};i.applyTextureTransform(a,e.anisotropyMap),n.anisotropyTexture=a}n.anisotropyStrength=e.anisotropy,n.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Pl{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;const i=this.writer.extensionsUsed,s={};s.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}}class Ol{constructor(e){this.writer=e,this.name="EXT_materials_bump"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.bumpScale===1&&!e.bumpMap)return;const i=this.writer,s=i.extensionsUsed,n={};if(e.bumpMap){const a={index:i.processTexture(e.bumpMap),texCoord:e.bumpMap.channel};i.applyTextureTransform(a,e.bumpMap),n.bumpTexture=a}n.bumpFactor=e.bumpScale,t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Hl{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,t){if(!e.isInstancedMesh)return;const i=this.writer,s=e,n=new Float32Array(s.count*3),a=new Float32Array(s.count*4),r=new Float32Array(s.count*3),A=new ce,c=new N,l=new ye,h=new N;for(let p=0;p<s.count;p++)s.getMatrixAt(p,A),A.decompose(c,l,h),c.toArray(n,p*3),l.toArray(a,p*4),h.toArray(r,p*3);const d={TRANSLATION:i.processAccessor(new nt(n,3)),ROTATION:i.processAccessor(new nt(a,4)),SCALE:i.processAccessor(new nt(r,3))};s.instanceColor&&(d._COLOR_0=i.processAccessor(s.instanceColor)),t.extensions=t.extensions||{},t.extensions[this.name]={attributes:d},i.extensionsUsed[this.name]=!0,i.extensionsRequired[this.name]=!0}}fn.Utils={insertKeyframe:function(o,e){const t=o.getValueSize(),i=new o.TimeBufferType(o.times.length+1),s=new o.ValueBufferType(o.values.length+t),n=o.createInterpolant(new o.ValueBufferType(t));let a;if(o.times.length===0){i[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;i[0]=e,i.set(o.times,1),s.set(n.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;i[i.length-1]=e,i.set(o.times,0),s.set(o.values,0),s.set(n.evaluate(e),o.values.length),a=i.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){i.set(o.times.slice(0,r+1),0),i[r+1]=e,i.set(o.times.slice(r+1),r+2),s.set(o.values.slice(0,(r+1)*t),0),s.set(n.evaluate(e),(r+1)*t),s.set(o.values.slice((r+1)*t),(r+2)*t),a=r+1;break}}return o.times=i,o.values=s,a},mergeMorphTargetTracks:function(o,e){const t=[],i={},s=o.tracks;for(let n=0;n<s.length;++n){let a=s[n];const r=Dt.parseTrackName(a.name),A=Dt.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(Ei)}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(i[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,i[A.uuid]=h,t.push(h);continue}const d=a.createInterpolant(new a.ValueBufferType(1));h=i[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 Qe={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 Co(o){const e=await fetch(o);if(e.ok)return e.json();throw new Error(e.statusText)}async function jl(o){if(!o)throw new Error("No basePath supplied");return await Co(`${o}/profilesList.json`)}async function ql(o,e,t=null,i=!0){if(!o)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No basePath supplied");const s=await jl(e);let n;if(o.profiles.some(A=>{const c=s[A];return c&&(n={profileId:A,profilePath:`${e}/${c.path}`,deprecated:!!c.deprecated}),!!n}),!n){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.`);n={profileId:t,profilePath:`${e}/${A.path}`,deprecated:!!A.deprecated}}const a=await Co(n.profilePath);let r;if(i){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 ${n.profileId}`);A.assetPath&&(r=n.profilePath.replace("profile.json",A.assetPath))}return{profile:a,assetPath:r}}const zl={xAxis:0,yAxis:0,button:0,state:Qe.ComponentState.DEFAULT};function Yl(o=0,e=0){let t=o,i=e;if(Math.sqrt(o*o+e*e)>1){const s=Math.atan2(e,o);t=Math.cos(s),i=Math.sin(s)}return{normalizedXAxis:t*.5+.5,normalizedYAxis:i*.5+.5}}class Kl{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===Qe.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(zl)}updateFromComponent({xAxis:e,yAxis:t,button:i,state:s}){const{normalizedXAxis:n,normalizedYAxis:a}=Yl(e,t);switch(this.componentProperty){case Qe.ComponentProperty.X_AXIS:this.value=this.states.includes(s)?n:.5;break;case Qe.ComponentProperty.Y_AXIS:this.value=this.states.includes(s)?a:.5;break;case Qe.ComponentProperty.BUTTON:this.value=this.states.includes(s)?i:0;break;case Qe.ComponentProperty.STATE:this.valueNodeProperty===Qe.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 Jl{constructor(e,t){if(!e||!t||!t.visualResponses||!t.gamepadIndices||Object.keys(t.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach(i=>{const s=new Kl(t.visualResponses[i]);this.visualResponses[i]=s}),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:Qe.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=Qe.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=Qe.ComponentState.PRESSED:(t.touched||this.values.button>Qe.ButtonTouchThreshold)&&(this.values.state=Qe.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===Qe.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Qe.AxisTouchThreshold&&(this.values.state=Qe.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===Qe.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Qe.AxisTouchThreshold&&(this.values.state=Qe.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(t=>{t.updateFromComponent(this.values)})}}class Vl{constructor(e,t,i){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");this.xrInputSource=e,this.assetUrl=i,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(s=>{const n=this.layoutDescription.components[s];this.components[s]=new Jl(s,n)}),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 Wl="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",Xl="generic-trigger";class Zl 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(i=>{const{valueNode:s,minNode:n,maxNode:a,value:r,valueNodeProperty:A}=i;s&&(A===Qe.VisualResponseProperty.VISIBILITY?s.visible=r:A===Qe.VisualResponseProperty.TRANSFORM&&(s.quaternion.slerpQuaternions(n.quaternion,a.quaternion,r),s.position.lerpVectors(n.position,a.position,r)))})}))}}function $l(o,e){Object.values(o.components).forEach(t=>{const{type:i,touchPointNodeName:s,visualResponses:n}=t;if(i===Qe.ComponentType.TOUCHPAD)if(t.touchPointNode=e.getObjectByName(s),t.touchPointNode){const a=new hi(.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(n).forEach(a=>{const{valueNodeName:r,minNodeName:A,maxNodeName:c,valueNodeProperty:l}=a;if(l===Qe.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 Bo(o,e){$l(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 eh{constructor(e=null,t=null){this.gltfLoader=e,this.path=Wl,this._assetCache={},this.onLoad=t,this.gltfLoader||(this.gltfLoader=new _i)}setPath(e){return this.path=e,this}createControllerModel(e){const t=new Zl;let i=null;return e.addEventListener("connected",s=>{const n=s.data;n.targetRayMode!=="tracked-pointer"||!n.gamepad||n.hand||ql(n,this.path,Xl).then(({profile:a,assetPath:r})=>{t.motionController=new Vl(n,a,r);const A=this._assetCache[t.motionController.assetUrl];if(A)i=A.scene.clone(),Bo(t,i),this.onLoad&&this.onLoad(i);else{if(!this.gltfLoader)throw new Error("GLTFLoader not set.");this.gltfLoader.setPath(""),this.gltfLoader.load(t.motionController.assetUrl,c=>{this._assetCache[t.motionController.assetUrl]=c,i=c.scene.clone(),Bo(t,i),this.onLoad&&this.onLoad(i)},null,()=>{throw new Error(`Asset ${t.motionController.assetUrl} missing or malformed.`)})}}).catch(a=>{console.warn(a)})}),e.addEventListener("disconnected",()=>{t.motionController=null,t.remove(i),i=null}),t}}const th="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/generic-hand/";class sh{constructor(e,t,i,s,n=null,a=null){this.controller=t,this.handModel=e,this.bones=[],n===null&&(n=new _i,n.setPath(i||th)),n.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 i=this.bones[t];if(i){const s=e[i.jointName];if(s.visible){const n=s.position;i.position.copy(n),i.quaternion.copy(s.quaternion)}}}}}const wo=new Ks,ri=new N;class yo extends _r{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(i),this.setAttribute("position",new Me(e,3)),this.setAttribute("uv",new Me(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,i=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),i.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const i=new ki(t,6,1);return this.setAttribute("instanceStart",new Xt(i,3,0)),this.setAttribute("instanceEnd",new Xt(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const i=new ki(t,6,1);return this.setAttribute("instanceColorStart",new Xt(i,3,0)),this.setAttribute("instanceColorEnd",new Xt(i,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new Fr(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ks);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),wo.setFromBufferAttribute(t),this.boundingBox.union(wo))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Qi),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const i=this.boundingSphere.center;this.boundingBox.getCenter(i);let s=0;for(let n=0,a=e.count;n<a;n++)ri.fromBufferAttribute(e,n),s=Math.max(s,i.distanceToSquared(ri)),ri.fromBufferAttribute(t,n),s=Math.max(s,i.distanceToSquared(ri));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)}}us.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Le(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},Et.line={uniforms:gi.merge([us.common,us.fog,us.line]),vertexShader:`
|
|
127
127
|
#include <common>
|
|
128
128
|
#include <color_pars_vertex>
|
|
129
129
|
#include <fog_pars_vertex>
|
|
@@ -493,4 +493,4 @@ ${this.shader[Bs(t)]}
|
|
|
493
493
|
#include <premultiplied_alpha_fragment>
|
|
494
494
|
|
|
495
495
|
}
|
|
496
|
-
`};class In extends Wn{constructor(e){super({type:"LineMaterial",uniforms:gi.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 En=new Mt,Qo=new N,vo=new N,Pe=new Mt,Oe=new Mt,Qt=new Mt,Cn=new N,Bn=new ce,He=new Lr,xo=new N,Ai=new Ks,ci=new Qi,vt=new Mt;let xt,ss;function So(o,e,t){return vt.set(0,0,-e,1).applyMatrix4(o.projectionMatrix),vt.multiplyScalar(1/vt.w),vt.x=ss/t.width,vt.y=ss/t.height,vt.applyMatrix4(o.projectionMatrixInverse),vt.multiplyScalar(1/vt.w),Math.abs(Math.max(vt.x,vt.y))}function ih(o,e){const t=o.matrixWorld,i=o.geometry,s=i.attributes.instanceStart,n=i.attributes.instanceEnd,a=Math.min(i.instanceCount,s.count);for(let r=0,A=a;r<A;r++){He.start.fromBufferAttribute(s,r),He.end.fromBufferAttribute(n,r),He.applyMatrix4(t);const c=new N,l=new N;xt.distanceSqToSegment(He.start,He.end,l,c),l.distanceTo(c)<ss*.5&&e.push({point:l,pointOnLine:c,distance:xt.origin.distanceTo(l),object:o,face:null,faceIndex:r,uv:null,uv1:null})}}function nh(o,e,t){const i=e.projectionMatrix,s=o.material.resolution,n=o.matrixWorld,a=o.geometry,r=a.attributes.instanceStart,A=a.attributes.instanceEnd,c=Math.min(a.instanceCount,r.count),l=-e.near;xt.at(1,Qt),Qt.w=1,Qt.applyMatrix4(e.matrixWorldInverse),Qt.applyMatrix4(i),Qt.multiplyScalar(1/Qt.w),Qt.x*=s.x/2,Qt.y*=s.y/2,Qt.z=0,Cn.copy(Qt),Bn.multiplyMatrices(e.matrixWorldInverse,n);for(let h=0,d=c;h<d;h++){if(Pe.fromBufferAttribute(r,h),Oe.fromBufferAttribute(A,h),Pe.w=1,Oe.w=1,Pe.applyMatrix4(Bn),Oe.applyMatrix4(Bn),Pe.z>l&&Oe.z>l)continue;if(Pe.z>l){const I=Pe.z-Oe.z,E=(Pe.z-l)/I;Pe.lerp(Oe,E)}else if(Oe.z>l){const I=Oe.z-Pe.z,E=(Oe.z-l)/I;Oe.lerp(Pe,E)}Pe.applyMatrix4(i),Oe.applyMatrix4(i),Pe.multiplyScalar(1/Pe.w),Oe.multiplyScalar(1/Oe.w),Pe.x*=s.x/2,Pe.y*=s.y/2,Oe.x*=s.x/2,Oe.y*=s.y/2,He.start.copy(Pe),He.start.z=0,He.end.copy(Oe),He.end.z=0;const p=He.closestPointToPointParameter(Cn,!0);He.at(p,xo);const f=Ce.lerp(Pe.z,Oe.z,p),b=f>=-1&&f<=1,m=Cn.distanceTo(xo)<ss*.5;if(b&&m){He.start.fromBufferAttribute(r,h),He.end.fromBufferAttribute(A,h),He.start.applyMatrix4(n),He.end.applyMatrix4(n);const I=new N,E=new N;xt.distanceSqToSegment(He.start,He.end,E,I),t.push({point:E,pointOnLine:I,distance:xt.origin.distanceTo(E),object:o,face:null,faceIndex:h,uv:null,uv1:null})}}}class ah extends O{constructor(e=new yo,t=new In({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,i=e.attributes.instanceEnd,s=new Float32Array(2*t.count);for(let a=0,r=0,A=t.count;a<A;a++,r+=2)Qo.fromBufferAttribute(t,a),vo.fromBufferAttribute(i,a),s[r]=r===0?0:s[r-1],s[r+1]=s[r]+Qo.distanceTo(vo);const n=new ki(s,2,1);return e.setAttribute("instanceDistanceStart",new Xt(n,1,0)),e.setAttribute("instanceDistanceEnd",new Xt(n,1,1)),this}raycast(e,t){const i=this.material.worldUnits,s=e.camera;s===null&&!i&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const n=e.params.Line2!==void 0&&e.params.Line2.threshold||0;xt=e.ray;const a=this.matrixWorld,r=this.geometry,A=this.material;ss=A.linewidth+n,r.boundingSphere===null&&r.computeBoundingSphere(),ci.copy(r.boundingSphere).applyMatrix4(a);let c;if(i)c=ss*.5;else{const h=Math.max(s.near,ci.distanceToPoint(xt.origin));c=So(s,h,A.resolution)}if(ci.radius+=c,xt.intersectsSphere(ci)===!1)return;r.boundingBox===null&&r.computeBoundingBox(),Ai.copy(r.boundingBox).applyMatrix4(a);let l;if(i)l=ss*.5;else{const h=Math.max(s.near,Ai.distanceToPoint(xt.origin));l=So(s,h,A.resolution)}Ai.expandByScalar(l),xt.intersectsBox(Ai)!==!1&&(i?ih(this,t):nh(this,s,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(En),this.material.uniforms.resolution.value.set(En.z,En.w))}}class To extends yo{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,i=new Float32Array(2*t);for(let s=0;s<t;s+=3)i[2*s]=e[s],i[2*s+1]=e[s+1],i[2*s+2]=e[s+2],i[2*s+3]=e[s+3],i[2*s+4]=e[s+4],i[2*s+5]=e[s+5];return super.setPositions(i),this}setColors(e){const t=e.length-3,i=new Float32Array(2*t);for(let s=0;s<t;s+=3)i[2*s]=e[s],i[2*s+1]=e[s+1],i[2*s+2]=e[s+2],i[2*s+3]=e[s+3],i[2*s+4]=e[s+4],i[2*s+5]=e[s+5];return super.setColors(i),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class oh extends ah{constructor(e=new To,t=new In({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}class rh extends O{constructor(e){const t=new Ah(e),i=new Ri(t.image.width*.001,t.image.height*.001),s=new It({map:t,toneMapped:!1,transparent:!0});super(i,s);function n(a){s.map.dispatchDOMEvent(a)}this.addEventListener("mousedown",n),this.addEventListener("mousemove",n),this.addEventListener("mouseup",n),this.addEventListener("click",n),this.dispose=function(){i.dispose(),s.dispose(),s.map.dispose(),wn.delete(e),this.removeEventListener("mousedown",n),this.removeEventListener("mousemove",n),this.removeEventListener("mouseup",n),this.removeEventListener("click",n)}}}class Ah extends Xn{constructor(e){super(Do(e)),this.dom=e,this.anisotropy=16,this.colorSpace=le,this.minFilter=at,this.magFilter=at;const t=new MutationObserver(()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout(()=>this.update(),16))}),i={attributes:!0,childList:!0,subtree:!0,characterData:!0};t.observe(e,i),this.observer=t}dispatchDOMEvent(e){e.data&&ch(this.dom,e.type,e.data.x,e.data.y)}update(){this.image=Do(this.dom),this.needsUpdate=!0,this.scheduleUpdate=null}dispose(){this.observer&&this.observer.disconnect(),this.scheduleUpdate=clearTimeout(this.scheduleUpdate),super.dispose()}}const wn=new WeakMap;function Do(o){const e=document.createRange(),t=new we;function i(d){const p=[];let f=!1;function b(){if(f&&(f=!1,d.restore()),p.length===0)return;let m=-1/0,I=-1/0,E=1/0,C=1/0;for(let y=0;y<p.length;y++){const w=p[y];m=Math.max(m,w.x),I=Math.max(I,w.y),E=Math.min(E,w.x+w.width),C=Math.min(C,w.y+w.height)}d.save(),d.beginPath(),d.rect(m,I,E-m,C-I),d.clip(),f=!0}return{add:function(m){p.push(m),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 n(d,p,f,b,m){f<2*m&&(m=f/2),b<2*m&&(m=b/2),l.beginPath(),l.moveTo(d+m,p),l.arcTo(d+f,p,d+f,p+b,m),l.arcTo(d+f,p+b,d,p+b,m),l.arcTo(d,p+b,d,p,m),l.arcTo(d,p,d+f,p,m),l.closePath()}function a(d,p,f,b,m,I){const E=d[p+"Width"],C=d[p+"Style"],y=d[p+"Color"];E!=="0px"&&C!=="none"&&y!=="transparent"&&y!=="rgba(0, 0, 0, 0)"&&(l.strokeStyle=y,l.lineWidth=parseFloat(E),l.beginPath(),l.moveTo(f,b),l.lineTo(f+m,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,m=0,I=0;if(d.nodeType===Node.TEXT_NODE){e.selectNode(d);const C=e.getBoundingClientRect();f=C.left-A.left-.5,b=C.top-A.top-.5,m=C.width,I=C.height,s(p,f,b,d.nodeValue.trim())}else if(d instanceof HTMLCanvasElement){const C=d.getBoundingClientRect();f=C.left-A.left-.5,b=C.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 C=d.getBoundingClientRect();f=C.left-A.left-.5,b=C.top-A.top-.5,m=C.width,I=C.height,l.drawImage(d,f,b,m,I)}else{const C=d.getBoundingClientRect();f=C.left-A.left-.5,b=C.top-A.top-.5,m=C.width,I=C.height,p=window.getComputedStyle(d),n(f,b,m,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 x=!0,T=null;for(const S of w){if(T!==null&&(x=p[S+"Width"]===p[T+"Width"]&&p[S+"Color"]===p[T+"Color"]&&p[S+"Style"]===p[T+"Style"]),x===!1)break;T=S}if(x===!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,m,0),a(p,"borderLeft",f,b,0,I),a(p,"borderBottom",f,b+I,m,0),a(p,"borderRight",f+m,b,0,I);if(d instanceof HTMLInputElement){let S=p.accentColor;(S===void 0||S==="auto")&&(S=p.color),t.set(S);const _=Math.sqrt(.299*t.r**2+.587*t.g**2+.114*t.b**2)<.5?"white":"#111111";if(d.type==="radio"&&(n(f,b,m,I,I),l.fillStyle="white",l.strokeStyle=S,l.lineWidth=1,l.fill(),l.stroke(),d.checked&&(n(f+2,b+2,m-4,I-4,I),l.fillStyle=S,l.strokeStyle=_,l.lineWidth=2,l.fill(),l.stroke())),d.type==="checkbox"&&(n(f,b,m,I,2),l.fillStyle=d.checked?S:"white",l.strokeStyle=d.checked?_:S,l.lineWidth=1,l.stroke(),l.fill(),d.checked)){const Y=l.textAlign;l.textAlign="center";const V={color:_,fontFamily:p.fontFamily,fontSize:I+"px",fontWeight:"bold"};s(V,f+m/2,b,"\u2714"),l.textAlign=Y}if(d.type==="range"){const[Y,V,K]=["min","max","value"].map(j=>parseFloat(d[j])),W=(K-Y)/(V-Y)*(m-I);n(f,b+I/4,m,I/2,I/4),l.fillStyle=_,l.strokeStyle=S,l.lineWidth=1,l.fill(),l.stroke(),n(f,b+I/4,W+I/2,I/2,I/4),l.fillStyle=S,l.fill(),n(f+W,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:m,height:I}),s(p,f+parseInt(p.paddingLeft),b+parseInt(p.paddingTop),d.value),h.remove())}}const E=p.overflow==="auto"||p.overflow==="hidden";E&&h.add({x:f,y:b,width:m,height:I});for(let C=0;C<d.childNodes.length;C++)r(d.childNodes[C],p);E&&h.remove()}const A=o.getBoundingClientRect();let c=wn.get(o);c===void 0&&(c=document.createElement("canvas"),c.width=A.width,c.height=A.height,wn.set(o,c));const l=c.getContext("2d"),h=new i(l);return l.clearRect(0,0,c.width,c.height),r(o),c}function ch(o,e,t,i){const s={clientX:t*o.offsetWidth+o.offsetLeft,clientY:i*o.offsetHeight+o.offsetTop,view:o.ownerDocument.defaultView};window.dispatchEvent(new MouseEvent(e,s));const n=o.getBoundingClientRect();t=t*n.width+n.left,i=i*n.height+n.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&&i>A.top&&i<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 li=new Le,gs={type:"",data:li},Ro=new Di;class lh extends Wt{listenToPointerEvents(e,t){const i=this,s=new Di,n=e.domElement;function a(r){r.stopPropagation();const A=e.domElement.getBoundingClientRect();li.x=(r.clientX-A.left)/A.width*2-1,li.y=-(r.clientY-A.top)/A.height*2+1,s.setFromCamera(li,t);const c=s.intersectObjects(i.children,!1);if(c.length>0){const l=c[0],h=l.object,d=l.uv;gs.type=r.type,gs.data.set(d.x,1-d.y),h.dispatchEvent(gs)}}n.addEventListener("pointerdown",a),n.addEventListener("pointerup",a),n.addEventListener("pointermove",a),n.addEventListener("mousedown",a),n.addEventListener("mouseup",a),n.addEventListener("mousemove",a),n.addEventListener("click",a)}listenToXRControllerEvents(e){const t=this,i={move:"mousemove",select:"click",selectstart:"mousedown",selectend:"mouseup"};function s(n){const a=n.target;Ro.setFromXRController(a);const r=Ro.intersectObjects(t.children,!1);if(r.length>0){const A=r[0],c=A.object,l=A.uv;gs.type=i[n.type],gs.data.set(l.x,1-l.y),c.dispatchEvent(gs)}}e.addEventListener("move",s),e.addEventListener("select",s),e.addEventListener("selectstart",s),e.addEventListener("selectend",s)}}const Us=new N,Gs=new N,Mo=new Jn;class hh extends zs{constructor(e,t=1,i=16711680){const s=new ct,n=e.geometry.attributes.normal.count,a=new Me(n*2*3,3);s.setAttribute("position",a),super(s,new Dt({color:i,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),Mo.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,i=this.object.geometry;if(i){const s=i.attributes.position,n=i.attributes.normal;let a=0;for(let r=0,A=s.count;r<A;r++)Us.fromBufferAttribute(s,r).applyMatrix4(e),Gs.fromBufferAttribute(n,r),Gs.applyMatrix3(Mo).normalize().multiplyScalar(this.size).add(Us),t.setXYZ(a,Us.x,Us.y,Us.z),a=a+1,t.setXYZ(a,Gs.x,Gs.y,Gs.z),a=a+1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}class gh{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 _n(-1,1,1,-1,0,1);class dh extends ct{constructor(){super(),this.setAttribute("position",new Me([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Me([0,2,0,0,2,0],2))}}new dh;export{wA as DRACOLoader,Za as EXRLoader,vc as EXRLoader$1,Lc as FBXLoader,Da as Font,XA as FontLoader,fn as GLTFExporter,_i as GLTFLoader,Nr as GroundedSkybox,rh as HTMLMesh,bl as HorizontalBlurShader,lh as InteractiveGroup,gt as KTX2Loader,oh as Line2,To as LineGeometry,In as LineMaterial,BA as MeshoptDecoder,tl as OBJLoader,nl as OrbitControls,gh as Pass,ml as PositionalAudioHelper,$a as RGBELoader,xc as RGBELoader$1,ws as Stats,WA as TextGeometry,ec as TransformControls,Ua as TransformControlsGizmo,hh as VertexNormalsHelper,Il as VerticalBlurShader,eh as XRControllerModelFactory,sh as XRHandMeshModel,Or as mergeVertices,et as nodeFrame,An as strToU8,Qc as zipSync};
|
|
496
|
+
`};class In extends Wn{constructor(e){super({type:"LineMaterial",uniforms:gi.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 En=new Mt,Qo=new N,vo=new N,Pe=new Mt,Oe=new Mt,Qt=new Mt,Cn=new N,Bn=new ce,He=new Lr,xo=new N,Ai=new Ks,ci=new Qi,vt=new Mt;let xt,ss;function So(o,e,t){return vt.set(0,0,-e,1).applyMatrix4(o.projectionMatrix),vt.multiplyScalar(1/vt.w),vt.x=ss/t.width,vt.y=ss/t.height,vt.applyMatrix4(o.projectionMatrixInverse),vt.multiplyScalar(1/vt.w),Math.abs(Math.max(vt.x,vt.y))}function ih(o,e){const t=o.matrixWorld,i=o.geometry,s=i.attributes.instanceStart,n=i.attributes.instanceEnd,a=Math.min(i.instanceCount,s.count);for(let r=0,A=a;r<A;r++){He.start.fromBufferAttribute(s,r),He.end.fromBufferAttribute(n,r),He.applyMatrix4(t);const c=new N,l=new N;xt.distanceSqToSegment(He.start,He.end,l,c),l.distanceTo(c)<ss*.5&&e.push({point:l,pointOnLine:c,distance:xt.origin.distanceTo(l),object:o,face:null,faceIndex:r,uv:null,uv1:null})}}function nh(o,e,t){const i=e.projectionMatrix,s=o.material.resolution,n=o.matrixWorld,a=o.geometry,r=a.attributes.instanceStart,A=a.attributes.instanceEnd,c=Math.min(a.instanceCount,r.count),l=-e.near;xt.at(1,Qt),Qt.w=1,Qt.applyMatrix4(e.matrixWorldInverse),Qt.applyMatrix4(i),Qt.multiplyScalar(1/Qt.w),Qt.x*=s.x/2,Qt.y*=s.y/2,Qt.z=0,Cn.copy(Qt),Bn.multiplyMatrices(e.matrixWorldInverse,n);for(let h=0,d=c;h<d;h++){if(Pe.fromBufferAttribute(r,h),Oe.fromBufferAttribute(A,h),Pe.w=1,Oe.w=1,Pe.applyMatrix4(Bn),Oe.applyMatrix4(Bn),Pe.z>l&&Oe.z>l)continue;if(Pe.z>l){const I=Pe.z-Oe.z,E=(Pe.z-l)/I;Pe.lerp(Oe,E)}else if(Oe.z>l){const I=Oe.z-Pe.z,E=(Oe.z-l)/I;Oe.lerp(Pe,E)}Pe.applyMatrix4(i),Oe.applyMatrix4(i),Pe.multiplyScalar(1/Pe.w),Oe.multiplyScalar(1/Oe.w),Pe.x*=s.x/2,Pe.y*=s.y/2,Oe.x*=s.x/2,Oe.y*=s.y/2,He.start.copy(Pe),He.start.z=0,He.end.copy(Oe),He.end.z=0;const p=He.closestPointToPointParameter(Cn,!0);He.at(p,xo);const f=Ce.lerp(Pe.z,Oe.z,p),b=f>=-1&&f<=1,m=Cn.distanceTo(xo)<ss*.5;if(b&&m){He.start.fromBufferAttribute(r,h),He.end.fromBufferAttribute(A,h),He.start.applyMatrix4(n),He.end.applyMatrix4(n);const I=new N,E=new N;xt.distanceSqToSegment(He.start,He.end,E,I),t.push({point:E,pointOnLine:I,distance:xt.origin.distanceTo(E),object:o,face:null,faceIndex:h,uv:null,uv1:null})}}}class ah extends O{constructor(e=new yo,t=new In({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,i=e.attributes.instanceEnd,s=new Float32Array(2*t.count);for(let a=0,r=0,A=t.count;a<A;a++,r+=2)Qo.fromBufferAttribute(t,a),vo.fromBufferAttribute(i,a),s[r]=r===0?0:s[r-1],s[r+1]=s[r]+Qo.distanceTo(vo);const n=new ki(s,2,1);return e.setAttribute("instanceDistanceStart",new Xt(n,1,0)),e.setAttribute("instanceDistanceEnd",new Xt(n,1,1)),this}raycast(e,t){const i=this.material.worldUnits,s=e.camera;s===null&&!i&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const n=e.params.Line2!==void 0&&e.params.Line2.threshold||0;xt=e.ray;const a=this.matrixWorld,r=this.geometry,A=this.material;ss=A.linewidth+n,r.boundingSphere===null&&r.computeBoundingSphere(),ci.copy(r.boundingSphere).applyMatrix4(a);let c;if(i)c=ss*.5;else{const h=Math.max(s.near,ci.distanceToPoint(xt.origin));c=So(s,h,A.resolution)}if(ci.radius+=c,xt.intersectsSphere(ci)===!1)return;r.boundingBox===null&&r.computeBoundingBox(),Ai.copy(r.boundingBox).applyMatrix4(a);let l;if(i)l=ss*.5;else{const h=Math.max(s.near,Ai.distanceToPoint(xt.origin));l=So(s,h,A.resolution)}Ai.expandByScalar(l),xt.intersectsBox(Ai)!==!1&&(i?ih(this,t):nh(this,s,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(En),this.material.uniforms.resolution.value.set(En.z,En.w))}}class To extends yo{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,i=new Float32Array(2*t);for(let s=0;s<t;s+=3)i[2*s]=e[s],i[2*s+1]=e[s+1],i[2*s+2]=e[s+2],i[2*s+3]=e[s+3],i[2*s+4]=e[s+4],i[2*s+5]=e[s+5];return super.setPositions(i),this}setColors(e){const t=e.length-3,i=new Float32Array(2*t);for(let s=0;s<t;s+=3)i[2*s]=e[s],i[2*s+1]=e[s+1],i[2*s+2]=e[s+2],i[2*s+3]=e[s+3],i[2*s+4]=e[s+4],i[2*s+5]=e[s+5];return super.setColors(i),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class oh extends ah{constructor(e=new To,t=new In({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}class rh extends O{constructor(e){const t=new Ah(e),i=new Di(t.image.width*.001,t.image.height*.001),s=new It({map:t,toneMapped:!1,transparent:!0});super(i,s);function n(a){s.map.dispatchDOMEvent(a)}this.addEventListener("mousedown",n),this.addEventListener("mousemove",n),this.addEventListener("mouseup",n),this.addEventListener("click",n),this.dispose=function(){i.dispose(),s.dispose(),s.map.dispose(),wn.delete(e),this.removeEventListener("mousedown",n),this.removeEventListener("mousemove",n),this.removeEventListener("mouseup",n),this.removeEventListener("click",n)}}}class Ah extends Xn{constructor(e){super(Ro(e)),this.dom=e,this.anisotropy=16,this.colorSpace=le,this.minFilter=at,this.magFilter=at;const t=new MutationObserver(()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout(()=>this.update(),16))}),i={attributes:!0,childList:!0,subtree:!0,characterData:!0};t.observe(e,i),this.observer=t}dispatchDOMEvent(e){e.data&&ch(this.dom,e.type,e.data.x,e.data.y)}update(){this.image=Ro(this.dom),this.needsUpdate=!0,this.scheduleUpdate=null}dispose(){this.observer&&this.observer.disconnect(),this.scheduleUpdate=clearTimeout(this.scheduleUpdate),super.dispose()}}const wn=new WeakMap;function Ro(o){const e=document.createRange(),t=new we;function i(d){const p=[];let f=!1;function b(){if(f&&(f=!1,d.restore()),p.length===0)return;let m=-1/0,I=-1/0,E=1/0,C=1/0;for(let y=0;y<p.length;y++){const w=p[y];m=Math.max(m,w.x),I=Math.max(I,w.y),E=Math.min(E,w.x+w.width),C=Math.min(C,w.y+w.height)}d.save(),d.beginPath(),d.rect(m,I,E-m,C-I),d.clip(),f=!0}return{add:function(m){p.push(m),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 n(d,p,f,b,m){f<2*m&&(m=f/2),b<2*m&&(m=b/2),l.beginPath(),l.moveTo(d+m,p),l.arcTo(d+f,p,d+f,p+b,m),l.arcTo(d+f,p+b,d,p+b,m),l.arcTo(d,p+b,d,p,m),l.arcTo(d,p,d+f,p,m),l.closePath()}function a(d,p,f,b,m,I){const E=d[p+"Width"],C=d[p+"Style"],y=d[p+"Color"];E!=="0px"&&C!=="none"&&y!=="transparent"&&y!=="rgba(0, 0, 0, 0)"&&(l.strokeStyle=y,l.lineWidth=parseFloat(E),l.beginPath(),l.moveTo(f,b),l.lineTo(f+m,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,m=0,I=0;if(d.nodeType===Node.TEXT_NODE){e.selectNode(d);const C=e.getBoundingClientRect();f=C.left-A.left-.5,b=C.top-A.top-.5,m=C.width,I=C.height,s(p,f,b,d.nodeValue.trim())}else if(d instanceof HTMLCanvasElement){const C=d.getBoundingClientRect();f=C.left-A.left-.5,b=C.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 C=d.getBoundingClientRect();f=C.left-A.left-.5,b=C.top-A.top-.5,m=C.width,I=C.height,l.drawImage(d,f,b,m,I)}else{const C=d.getBoundingClientRect();f=C.left-A.left-.5,b=C.top-A.top-.5,m=C.width,I=C.height,p=window.getComputedStyle(d),n(f,b,m,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 x=!0,T=null;for(const S of w){if(T!==null&&(x=p[S+"Width"]===p[T+"Width"]&&p[S+"Color"]===p[T+"Color"]&&p[S+"Style"]===p[T+"Style"]),x===!1)break;T=S}if(x===!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,m,0),a(p,"borderLeft",f,b,0,I),a(p,"borderBottom",f,b+I,m,0),a(p,"borderRight",f+m,b,0,I);if(d instanceof HTMLInputElement){let S=p.accentColor;(S===void 0||S==="auto")&&(S=p.color),t.set(S);const _=Math.sqrt(.299*t.r**2+.587*t.g**2+.114*t.b**2)<.5?"white":"#111111";if(d.type==="radio"&&(n(f,b,m,I,I),l.fillStyle="white",l.strokeStyle=S,l.lineWidth=1,l.fill(),l.stroke(),d.checked&&(n(f+2,b+2,m-4,I-4,I),l.fillStyle=S,l.strokeStyle=_,l.lineWidth=2,l.fill(),l.stroke())),d.type==="checkbox"&&(n(f,b,m,I,2),l.fillStyle=d.checked?S:"white",l.strokeStyle=d.checked?_:S,l.lineWidth=1,l.stroke(),l.fill(),d.checked)){const Y=l.textAlign;l.textAlign="center";const V={color:_,fontFamily:p.fontFamily,fontSize:I+"px",fontWeight:"bold"};s(V,f+m/2,b,"\u2714"),l.textAlign=Y}if(d.type==="range"){const[Y,V,K]=["min","max","value"].map(j=>parseFloat(d[j])),W=(K-Y)/(V-Y)*(m-I);n(f,b+I/4,m,I/2,I/4),l.fillStyle=_,l.strokeStyle=S,l.lineWidth=1,l.fill(),l.stroke(),n(f,b+I/4,W+I/2,I/2,I/4),l.fillStyle=S,l.fill(),n(f+W,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:m,height:I}),s(p,f+parseInt(p.paddingLeft),b+parseInt(p.paddingTop),d.value),h.remove())}}const E=p.overflow==="auto"||p.overflow==="hidden";E&&h.add({x:f,y:b,width:m,height:I});for(let C=0;C<d.childNodes.length;C++)r(d.childNodes[C],p);E&&h.remove()}const A=o.getBoundingClientRect();let c=wn.get(o);c===void 0&&(c=document.createElement("canvas"),c.width=A.width,c.height=A.height,wn.set(o,c));const l=c.getContext("2d"),h=new i(l);return l.clearRect(0,0,c.width,c.height),r(o),c}function ch(o,e,t,i){const s={clientX:t*o.offsetWidth+o.offsetLeft,clientY:i*o.offsetHeight+o.offsetTop,view:o.ownerDocument.defaultView};window.dispatchEvent(new MouseEvent(e,s));const n=o.getBoundingClientRect();t=t*n.width+n.left,i=i*n.height+n.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&&i>A.top&&i<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 li=new Le,gs={type:"",data:li},Do=new Ri;class lh extends Wt{listenToPointerEvents(e,t){const i=this,s=new Ri,n=e.domElement;function a(r){r.stopPropagation();const A=e.domElement.getBoundingClientRect();li.x=(r.clientX-A.left)/A.width*2-1,li.y=-(r.clientY-A.top)/A.height*2+1,s.setFromCamera(li,t);const c=s.intersectObjects(i.children,!1);if(c.length>0){const l=c[0],h=l.object,d=l.uv;gs.type=r.type,gs.data.set(d.x,1-d.y),h.dispatchEvent(gs)}}n.addEventListener("pointerdown",a),n.addEventListener("pointerup",a),n.addEventListener("pointermove",a),n.addEventListener("mousedown",a),n.addEventListener("mouseup",a),n.addEventListener("mousemove",a),n.addEventListener("click",a)}listenToXRControllerEvents(e){const t=this,i={move:"mousemove",select:"click",selectstart:"mousedown",selectend:"mouseup"};function s(n){const a=n.target;Do.setFromXRController(a);const r=Do.intersectObjects(t.children,!1);if(r.length>0){const A=r[0],c=A.object,l=A.uv;gs.type=i[n.type],gs.data.set(l.x,1-l.y),c.dispatchEvent(gs)}}e.addEventListener("move",s),e.addEventListener("select",s),e.addEventListener("selectstart",s),e.addEventListener("selectend",s)}}const Us=new N,Gs=new N,Mo=new Jn;class hh extends zs{constructor(e,t=1,i=16711680){const s=new ct,n=e.geometry.attributes.normal.count,a=new Me(n*2*3,3);s.setAttribute("position",a),super(s,new Rt({color:i,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),Mo.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,i=this.object.geometry;if(i){const s=i.attributes.position,n=i.attributes.normal;let a=0;for(let r=0,A=s.count;r<A;r++)Us.fromBufferAttribute(s,r).applyMatrix4(e),Gs.fromBufferAttribute(n,r),Gs.applyMatrix3(Mo).normalize().multiplyScalar(this.size).add(Us),t.setXYZ(a,Us.x,Us.y,Us.z),a=a+1,t.setXYZ(a,Gs.x,Gs.y,Gs.z),a=a+1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}class gh{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 _n(-1,1,1,-1,0,1);class dh extends ct{constructor(){super(),this.setAttribute("position",new Me([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Me([0,2,0,0,2,0],2))}}new dh;export{wA as DRACOLoader,Za as EXRLoader,vc as EXRLoader$1,Lc as FBXLoader,Ra as Font,XA as FontLoader,fn as GLTFExporter,_i as GLTFLoader,Nr as GroundedSkybox,rh as HTMLMesh,bl as HorizontalBlurShader,lh as InteractiveGroup,gt as KTX2Loader,oh as Line2,To as LineGeometry,In as LineMaterial,BA as MeshoptDecoder,tl as OBJLoader,nl as OrbitControls,gh as Pass,ml as PositionalAudioHelper,$a as RGBELoader,xc as RGBELoader$1,ws as Stats,WA as TextGeometry,ec as TransformControls,Ua as TransformControlsGizmo,hh as VertexNormalsHelper,Il as VerticalBlurShader,eh as XRControllerModelFactory,sh as XRHandMeshModel,Or as mergeVertices,et as nodeFrame,An as strToU8,Qc as zipSync};
|