@yschindel/ara3d-webgl 1.3.3 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ara3d-webgl.umd.js
CHANGED
|
@@ -4018,7 +4018,7 @@ void main() {
|
|
|
4018
4018
|
|
|
4019
4019
|
}`;class Jb{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const n=new Vh(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new Cn({vertexShader:Kb,fragmentShader:jb,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new St(new rr(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class $b extends Qn{constructor(e,t){super();const n=this;let i=null,s=1,o=null,a="local-floor",c=1,l=null,h=null,u=null,f=null,d=null,g=null;const _=typeof XRWebGLBinding<"u",m=new Jb,p={},v=t.getContextAttributes();let y=null,x=null;const A=[],E=[],I=new he;let D=null;const b=new kt;b.viewport=new gt;const C=new kt;C.viewport=new gt;const B=[b,C],R=new Fp;let O=null,M=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(oe){let ee=A[oe];return ee===void 0&&(ee=new ac,A[oe]=ee),ee.getTargetRaySpace()},this.getControllerGrip=function(oe){let ee=A[oe];return ee===void 0&&(ee=new ac,A[oe]=ee),ee.getGripSpace()},this.getHand=function(oe){let ee=A[oe];return ee===void 0&&(ee=new ac,A[oe]=ee),ee.getHandSpace()};function z(oe){const ee=E.indexOf(oe.inputSource);if(ee===-1)return;const pe=A[ee];pe!==void 0&&(pe.update(oe.inputSource,oe.frame,l||o),pe.dispatchEvent({type:oe.type,data:oe.inputSource}))}function X(){i.removeEventListener("select",z),i.removeEventListener("selectstart",z),i.removeEventListener("selectend",z),i.removeEventListener("squeeze",z),i.removeEventListener("squeezestart",z),i.removeEventListener("squeezeend",z),i.removeEventListener("end",X),i.removeEventListener("inputsourceschange",H);for(let oe=0;oe<A.length;oe++){const ee=E[oe];ee!==null&&(E[oe]=null,A[oe].disconnect(ee))}O=null,M=null,m.reset();for(const oe in p)delete p[oe];e.setRenderTarget(y),d=null,f=null,u=null,i=null,x=null,de.stop(),n.isPresenting=!1,e.setPixelRatio(D),e.setSize(I.width,I.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(oe){s=oe,n.isPresenting===!0&&Te("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(oe){a=oe,n.isPresenting===!0&&Te("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||o},this.setReferenceSpace=function(oe){l=oe},this.getBaseLayer=function(){return f!==null?f:d},this.getBinding=function(){return u===null&&_&&(u=new XRWebGLBinding(i,t)),u},this.getFrame=function(){return g},this.getSession=function(){return i},this.setSession=async function(oe){if(i=oe,i!==null){if(y=e.getRenderTarget(),i.addEventListener("select",z),i.addEventListener("selectstart",z),i.addEventListener("selectend",z),i.addEventListener("squeeze",z),i.addEventListener("squeezestart",z),i.addEventListener("squeezeend",z),i.addEventListener("end",X),i.addEventListener("inputsourceschange",H),v.xrCompatible!==!0&&await t.makeXRCompatible(),D=e.getPixelRatio(),e.getSize(I),_&&"createProjectionLayer"in XRWebGLBinding.prototype){let pe=null,ye=null,Ae=null;v.depth&&(Ae=v.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,pe=v.stencil?xi:Yn,ye=v.stencil?Or:En);const ze={colorFormat:t.RGBA8,depthFormat:Ae,scaleFactor:s};u=this.getBinding(),f=u.createProjectionLayer(ze),i.updateRenderState({layers:[f]}),e.setPixelRatio(1),e.setSize(f.textureWidth,f.textureHeight,!1),x=new vn(f.textureWidth,f.textureHeight,{format:rn,type:ln,depthTexture:new ds(f.textureWidth,f.textureHeight,ye,void 0,void 0,void 0,void 0,void 0,void 0,pe),stencilBuffer:v.stencil,colorSpace:e.outputColorSpace,samples:v.antialias?4:0,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}else{const pe={antialias:v.antialias,alpha:!0,depth:v.depth,stencil:v.stencil,framebufferScaleFactor:s};d=new XRWebGLLayer(i,t,pe),i.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),x=new vn(d.framebufferWidth,d.framebufferHeight,{format:rn,type:ln,colorSpace:e.outputColorSpace,stencilBuffer:v.stencil,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}x.isXRRenderTarget=!0,this.setFoveation(c),l=null,o=await i.requestReferenceSpace(a),de.setContext(i),de.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return m.getDepthTexture()};function H(oe){for(let ee=0;ee<oe.removed.length;ee++){const pe=oe.removed[ee],ye=E.indexOf(pe);ye>=0&&(E[ye]=null,A[ye].disconnect(pe))}for(let ee=0;ee<oe.added.length;ee++){const pe=oe.added[ee];let ye=E.indexOf(pe);if(ye===-1){for(let ze=0;ze<A.length;ze++)if(ze>=E.length){E.push(pe),ye=ze;break}else if(E[ze]===null){E[ze]=pe,ye=ze;break}if(ye===-1)break}const Ae=A[ye];Ae&&Ae.connect(pe)}}const re=new U,J=new U;function le(oe,ee,pe){re.setFromMatrixPosition(ee.matrixWorld),J.setFromMatrixPosition(pe.matrixWorld);const ye=re.distanceTo(J),Ae=ee.projectionMatrix.elements,ze=pe.projectionMatrix.elements,je=Ae[14]/(Ae[10]-1),He=Ae[14]/(Ae[10]+1),w=(Ae[9]+1)/Ae[5],q=(Ae[9]-1)/Ae[5],k=(Ae[8]-1)/Ae[0],N=(ze[8]+1)/ze[0],S=je*k,G=je*N,K=ye/(-k+N),ie=K*-k;if(ee.matrixWorld.decompose(oe.position,oe.quaternion,oe.scale),oe.translateX(ie),oe.translateZ(K),oe.matrixWorld.compose(oe.position,oe.quaternion,oe.scale),oe.matrixWorldInverse.copy(oe.matrixWorld).invert(),Ae[10]===-1)oe.projectionMatrix.copy(ee.projectionMatrix),oe.projectionMatrixInverse.copy(ee.projectionMatrixInverse);else{const V=je+K,P=He+K,T=S-ie,F=G+(ye-ie),Q=w*He/P*V,ce=q*He/P*V;oe.projectionMatrix.makePerspective(T,F,Q,ce,V,P),oe.projectionMatrixInverse.copy(oe.projectionMatrix).invert()}}function W(oe,ee){ee===null?oe.matrixWorld.copy(oe.matrix):oe.matrixWorld.multiplyMatrices(ee.matrixWorld,oe.matrix),oe.matrixWorldInverse.copy(oe.matrixWorld).invert()}this.updateCamera=function(oe){if(i===null)return;let ee=oe.near,pe=oe.far;m.texture!==null&&(m.depthNear>0&&(ee=m.depthNear),m.depthFar>0&&(pe=m.depthFar)),R.near=C.near=b.near=ee,R.far=C.far=b.far=pe,(O!==R.near||M!==R.far)&&(i.updateRenderState({depthNear:R.near,depthFar:R.far}),O=R.near,M=R.far),R.layers.mask=oe.layers.mask|6,b.layers.mask=R.layers.mask&3,C.layers.mask=R.layers.mask&5;const ye=oe.parent,Ae=R.cameras;W(R,ye);for(let ze=0;ze<Ae.length;ze++)W(Ae[ze],ye);Ae.length===2?le(R,b,C):R.projectionMatrix.copy(b.projectionMatrix),Z(oe,R,ye)};function Z(oe,ee,pe){pe===null?oe.matrix.copy(ee.matrixWorld):(oe.matrix.copy(pe.matrixWorld),oe.matrix.invert(),oe.matrix.multiply(ee.matrixWorld)),oe.matrix.decompose(oe.position,oe.quaternion,oe.scale),oe.updateMatrixWorld(!0),oe.projectionMatrix.copy(ee.projectionMatrix),oe.projectionMatrixInverse.copy(ee.projectionMatrixInverse),oe.isPerspectiveCamera&&(oe.fov=Wr*2*Math.atan(1/oe.projectionMatrix.elements[5]),oe.zoom=1)}this.getCamera=function(){return R},this.getFoveation=function(){if(!(f===null&&d===null))return c},this.setFoveation=function(oe){c=oe,f!==null&&(f.fixedFoveation=oe),d!==null&&d.fixedFoveation!==void 0&&(d.fixedFoveation=oe)},this.hasDepthSensing=function(){return m.texture!==null},this.getDepthSensingMesh=function(){return m.getMesh(R)},this.getCameraTexture=function(oe){return p[oe]};let ge=null;function _e(oe,ee){if(h=ee.getViewerPose(l||o),g=ee,h!==null){const pe=h.views;d!==null&&(e.setRenderTargetFramebuffer(x,d.framebuffer),e.setRenderTarget(x));let ye=!1;pe.length!==R.cameras.length&&(R.cameras.length=0,ye=!0);for(let He=0;He<pe.length;He++){const w=pe[He];let q=null;if(d!==null)q=d.getViewport(w);else{const N=u.getViewSubImage(f,w);q=N.viewport,He===0&&(e.setRenderTargetTextures(x,N.colorTexture,N.depthStencilTexture),e.setRenderTarget(x))}let k=B[He];k===void 0&&(k=new kt,k.layers.enable(He),k.viewport=new gt,B[He]=k),k.matrix.fromArray(w.transform.matrix),k.matrix.decompose(k.position,k.quaternion,k.scale),k.projectionMatrix.fromArray(w.projectionMatrix),k.projectionMatrixInverse.copy(k.projectionMatrix).invert(),k.viewport.set(q.x,q.y,q.width,q.height),He===0&&(R.matrix.copy(k.matrix),R.matrix.decompose(R.position,R.quaternion,R.scale)),ye===!0&&R.cameras.push(k)}const Ae=i.enabledFeatures;if(Ae&&Ae.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&_){u=n.getBinding();const He=u.getDepthInformation(pe[0]);He&&He.isValid&&He.texture&&m.init(He,i.renderState)}if(Ae&&Ae.includes("camera-access")&&_){e.state.unbindTexture(),u=n.getBinding();for(let He=0;He<pe.length;He++){const w=pe[He].camera;if(w){let q=p[w];q||(q=new Vh,p[w]=q);const k=u.getCameraImage(w);q.sourceTexture=k}}}}for(let pe=0;pe<A.length;pe++){const ye=E[pe],Ae=A[pe];ye!==null&&Ae!==void 0&&Ae.update(ye,ee,l||o)}ge&&ge(oe,ee),ee.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:ee}),g=null}const de=new em;de.setAnimationLoop(_e),this.setAnimationLoop=function(oe){ge=oe},this.dispose=function(){}}}const xr=new Zt,ew=new We;function tw(r,e){function t(m,p){m.matrixAutoUpdate===!0&&m.updateMatrix(),p.value.copy(m.matrix)}function n(m,p){p.color.getRGB(m.fogColor.value,wd(r)),p.isFog?(m.fogNear.value=p.near,m.fogFar.value=p.far):p.isFogExp2&&(m.fogDensity.value=p.density)}function i(m,p,v,y,x){p.isMeshBasicMaterial||p.isMeshLambertMaterial?s(m,p):p.isMeshToonMaterial?(s(m,p),u(m,p)):p.isMeshPhongMaterial?(s(m,p),h(m,p)):p.isMeshStandardMaterial?(s(m,p),f(m,p),p.isMeshPhysicalMaterial&&d(m,p,x)):p.isMeshMatcapMaterial?(s(m,p),g(m,p)):p.isMeshDepthMaterial?s(m,p):p.isMeshDistanceMaterial?(s(m,p),_(m,p)):p.isMeshNormalMaterial?s(m,p):p.isLineBasicMaterial?(o(m,p),p.isLineDashedMaterial&&a(m,p)):p.isPointsMaterial?c(m,p,v,y):p.isSpriteMaterial?l(m,p):p.isShadowMaterial?(m.color.value.copy(p.color),m.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function s(m,p){m.opacity.value=p.opacity,p.color&&m.diffuse.value.copy(p.color),p.emissive&&m.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity),p.map&&(m.map.value=p.map,t(p.map,m.mapTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,t(p.alphaMap,m.alphaMapTransform)),p.bumpMap&&(m.bumpMap.value=p.bumpMap,t(p.bumpMap,m.bumpMapTransform),m.bumpScale.value=p.bumpScale,p.side===en&&(m.bumpScale.value*=-1)),p.normalMap&&(m.normalMap.value=p.normalMap,t(p.normalMap,m.normalMapTransform),m.normalScale.value.copy(p.normalScale),p.side===en&&m.normalScale.value.negate()),p.displacementMap&&(m.displacementMap.value=p.displacementMap,t(p.displacementMap,m.displacementMapTransform),m.displacementScale.value=p.displacementScale,m.displacementBias.value=p.displacementBias),p.emissiveMap&&(m.emissiveMap.value=p.emissiveMap,t(p.emissiveMap,m.emissiveMapTransform)),p.specularMap&&(m.specularMap.value=p.specularMap,t(p.specularMap,m.specularMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest);const v=e.get(p),y=v.envMap,x=v.envMapRotation;y&&(m.envMap.value=y,xr.copy(x),xr.x*=-1,xr.y*=-1,xr.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1&&(xr.y*=-1,xr.z*=-1),m.envMapRotation.value.setFromMatrix4(ew.makeRotationFromEuler(xr)),m.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=p.reflectivity,m.ior.value=p.ior,m.refractionRatio.value=p.refractionRatio),p.lightMap&&(m.lightMap.value=p.lightMap,m.lightMapIntensity.value=p.lightMapIntensity,t(p.lightMap,m.lightMapTransform)),p.aoMap&&(m.aoMap.value=p.aoMap,m.aoMapIntensity.value=p.aoMapIntensity,t(p.aoMap,m.aoMapTransform))}function o(m,p){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,p.map&&(m.map.value=p.map,t(p.map,m.mapTransform))}function a(m,p){m.dashSize.value=p.dashSize,m.totalSize.value=p.dashSize+p.gapSize,m.scale.value=p.scale}function c(m,p,v,y){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,m.size.value=p.size*v,m.scale.value=y*.5,p.map&&(m.map.value=p.map,t(p.map,m.uvTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,t(p.alphaMap,m.alphaMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest)}function l(m,p){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,m.rotation.value=p.rotation,p.map&&(m.map.value=p.map,t(p.map,m.mapTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,t(p.alphaMap,m.alphaMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest)}function h(m,p){m.specular.value.copy(p.specular),m.shininess.value=Math.max(p.shininess,1e-4)}function u(m,p){p.gradientMap&&(m.gradientMap.value=p.gradientMap)}function f(m,p){m.metalness.value=p.metalness,p.metalnessMap&&(m.metalnessMap.value=p.metalnessMap,t(p.metalnessMap,m.metalnessMapTransform)),m.roughness.value=p.roughness,p.roughnessMap&&(m.roughnessMap.value=p.roughnessMap,t(p.roughnessMap,m.roughnessMapTransform)),p.envMap&&(m.envMapIntensity.value=p.envMapIntensity)}function d(m,p,v){m.ior.value=p.ior,p.sheen>0&&(m.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),m.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(m.sheenColorMap.value=p.sheenColorMap,t(p.sheenColorMap,m.sheenColorMapTransform)),p.sheenRoughnessMap&&(m.sheenRoughnessMap.value=p.sheenRoughnessMap,t(p.sheenRoughnessMap,m.sheenRoughnessMapTransform))),p.clearcoat>0&&(m.clearcoat.value=p.clearcoat,m.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(m.clearcoatMap.value=p.clearcoatMap,t(p.clearcoatMap,m.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,t(p.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(m.clearcoatNormalMap.value=p.clearcoatNormalMap,t(p.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===en&&m.clearcoatNormalScale.value.negate())),p.dispersion>0&&(m.dispersion.value=p.dispersion),p.iridescence>0&&(m.iridescence.value=p.iridescence,m.iridescenceIOR.value=p.iridescenceIOR,m.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(m.iridescenceMap.value=p.iridescenceMap,t(p.iridescenceMap,m.iridescenceMapTransform)),p.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=p.iridescenceThicknessMap,t(p.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),p.transmission>0&&(m.transmission.value=p.transmission,m.transmissionSamplerMap.value=v.texture,m.transmissionSamplerSize.value.set(v.width,v.height),p.transmissionMap&&(m.transmissionMap.value=p.transmissionMap,t(p.transmissionMap,m.transmissionMapTransform)),m.thickness.value=p.thickness,p.thicknessMap&&(m.thicknessMap.value=p.thicknessMap,t(p.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=p.attenuationDistance,m.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(m.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(m.anisotropyMap.value=p.anisotropyMap,t(p.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=p.specularIntensity,m.specularColor.value.copy(p.specularColor),p.specularColorMap&&(m.specularColorMap.value=p.specularColorMap,t(p.specularColorMap,m.specularColorMapTransform)),p.specularIntensityMap&&(m.specularIntensityMap.value=p.specularIntensityMap,t(p.specularIntensityMap,m.specularIntensityMapTransform))}function g(m,p){p.matcap&&(m.matcap.value=p.matcap)}function _(m,p){const v=e.get(p).light;m.referencePosition.value.setFromMatrixPosition(v.matrixWorld),m.nearDistance.value=v.shadow.camera.near,m.farDistance.value=v.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function nw(r,e,t,n){let i={},s={},o=[];const a=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function c(v,y){const x=y.program;n.uniformBlockBinding(v,x)}function l(v,y){let x=i[v.id];x===void 0&&(g(v),x=h(v),i[v.id]=x,v.addEventListener("dispose",m));const A=y.program;n.updateUBOMapping(v,A);const E=e.render.frame;s[v.id]!==E&&(f(v),s[v.id]=E)}function h(v){const y=u();v.__bindingPointIndex=y;const x=r.createBuffer(),A=v.__size,E=v.usage;return r.bindBuffer(r.UNIFORM_BUFFER,x),r.bufferData(r.UNIFORM_BUFFER,A,E),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,y,x),x}function u(){for(let v=0;v<a;v++)if(o.indexOf(v)===-1)return o.push(v),v;return Ge("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function f(v){const y=i[v.id],x=v.uniforms,A=v.__cache;r.bindBuffer(r.UNIFORM_BUFFER,y);for(let E=0,I=x.length;E<I;E++){const D=Array.isArray(x[E])?x[E]:[x[E]];for(let b=0,C=D.length;b<C;b++){const B=D[b];if(d(B,E,b,A)===!0){const R=B.__offset,O=Array.isArray(B.value)?B.value:[B.value];let M=0;for(let z=0;z<O.length;z++){const X=O[z],H=_(X);typeof X=="number"||typeof X=="boolean"?(B.__data[0]=X,r.bufferSubData(r.UNIFORM_BUFFER,R+M,B.__data)):X.isMatrix3?(B.__data[0]=X.elements[0],B.__data[1]=X.elements[1],B.__data[2]=X.elements[2],B.__data[3]=0,B.__data[4]=X.elements[3],B.__data[5]=X.elements[4],B.__data[6]=X.elements[5],B.__data[7]=0,B.__data[8]=X.elements[6],B.__data[9]=X.elements[7],B.__data[10]=X.elements[8],B.__data[11]=0):(X.toArray(B.__data,M),M+=H.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,R,B.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function d(v,y,x,A){const E=v.value,I=y+"_"+x;if(A[I]===void 0)return typeof E=="number"||typeof E=="boolean"?A[I]=E:A[I]=E.clone(),!0;{const D=A[I];if(typeof E=="number"||typeof E=="boolean"){if(D!==E)return A[I]=E,!0}else if(D.equals(E)===!1)return D.copy(E),!0}return!1}function g(v){const y=v.uniforms;let x=0;const A=16;for(let I=0,D=y.length;I<D;I++){const b=Array.isArray(y[I])?y[I]:[y[I]];for(let C=0,B=b.length;C<B;C++){const R=b[C],O=Array.isArray(R.value)?R.value:[R.value];for(let M=0,z=O.length;M<z;M++){const X=O[M],H=_(X),re=x%A,J=re%H.boundary,le=re+J;x+=J,le!==0&&A-le<H.storage&&(x+=A-le),R.__data=new Float32Array(H.storage/Float32Array.BYTES_PER_ELEMENT),R.__offset=x,x+=H.storage}}}const E=x%A;return E>0&&(x+=A-E),v.__size=x,v.__cache={},this}function _(v){const y={boundary:0,storage:0};return typeof v=="number"||typeof v=="boolean"?(y.boundary=4,y.storage=4):v.isVector2?(y.boundary=8,y.storage=8):v.isVector3||v.isColor?(y.boundary=16,y.storage=12):v.isVector4?(y.boundary=16,y.storage=16):v.isMatrix3?(y.boundary=48,y.storage=48):v.isMatrix4?(y.boundary=64,y.storage=64):v.isTexture?Te("WebGLRenderer: Texture samplers can not be part of an uniforms group."):Te("WebGLRenderer: Unsupported uniform value type.",v),y}function m(v){const y=v.target;y.removeEventListener("dispose",m);const x=o.indexOf(y.__bindingPointIndex);o.splice(x,1),r.deleteBuffer(i[y.id]),delete i[y.id],delete s[y.id]}function p(){for(const v in i)r.deleteBuffer(i[v]);o=[],i={},s={}}return{bind:c,update:l,dispose:p}}const iw=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let ei=null;function rw(){return ei===null&&(ei=new Fn(iw,16,16,Gi,Zn),ei.name="DFG_LUT",ei.minFilter=pt,ei.magFilter=pt,ei.wrapS=tn,ei.wrapT=tn,ei.generateMipmaps=!1,ei.needsUpdate=!0),ei}class Cm{constructor(e={}){const{canvas:t=rd(),context:n=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:l=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1,reversedDepthBuffer:f=!1,outputBufferType:d=ln}=e;this.isWebGLRenderer=!0;let g;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");g=n.getContextAttributes().alpha}else g=o;const _=d,m=new Set([na,ta,Os]),p=new Set([ln,En,Br,Or,Jo,$o]),v=new Uint32Array(4),y=new Int32Array(4);let x=null,A=null;const E=[],I=[];let D=null;this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Nn,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const b=this;let C=!1;this._outputColorSpace=Tt;let B=0,R=0,O=null,M=-1,z=null;const X=new gt,H=new gt;let re=null;const J=new xe(0);let le=0,W=t.width,Z=t.height,ge=1,_e=null,de=null;const oe=new gt(0,0,W,Z),ee=new gt(0,0,W,Z);let pe=!1;const ye=new fs;let Ae=!1,ze=!1;const je=new We,He=new U,w=new gt,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let k=!1;function N(){return O===null?ge:1}let S=n;function G(L,j){return t.getContext(L,j)}try{const L={alpha:!0,depth:i,stencil:s,antialias:a,premultipliedAlpha:c,preserveDrawingBuffer:l,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Yt}`),t.addEventListener("webglcontextlost",$e,!1),t.addEventListener("webglcontextrestored",vt,!1),t.addEventListener("webglcontextcreationerror",ft,!1),S===null){const j="webgl2";if(S=G(j,L),S===null)throw G(j)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(L){throw Ge("WebGLRenderer: "+L.message),L}let K,ie,V,P,T,F,Q,ce,te,Re,we,Le,Xe,fe,Se,Oe,Ue,Me,it,Y,Pe,be,De,ve;function me(){K=new s1(S),K.init(),be=new Tm(S,K),ie=new KA(S,K,e,be),V=new Yb(S,K),ie.reversedDepthBuffer&&f&&V.buffers.depth.setReversed(!0),P=new c1(S),T=new Lb,F=new Qb(S,K,V,T,ie,be,P),Q=new JA(b),ce=new r1(b),te=new Xy(S),De=new YA(S,te),Re=new o1(S,te,P,De),we=new h1(S,Re,te,P),it=new l1(S,ie,F),Oe=new jA(T),Le=new Db(b,Q,ce,K,ie,De,Oe),Xe=new tw(b,T),fe=new Ub,Se=new Vb(K),Me=new ZA(b,Q,ce,V,we,g,c),Ue=new Xb(b,we,ie),ve=new nw(S,P,ie,V),Y=new QA(S,K,P),Pe=new a1(S,K,P),P.programs=Le.programs,b.capabilities=ie,b.extensions=K,b.properties=T,b.renderLists=fe,b.shadowMap=Ue,b.state=V,b.info=P}me(),_!==ln&&(D=new f1(_,t.width,t.height,i,s));const Ee=new $b(b,S);this.xr=Ee,this.getContext=function(){return S},this.getContextAttributes=function(){return S.getContextAttributes()},this.forceContextLoss=function(){const L=K.get("WEBGL_lose_context");L&&L.loseContext()},this.forceContextRestore=function(){const L=K.get("WEBGL_lose_context");L&&L.restoreContext()},this.getPixelRatio=function(){return ge},this.setPixelRatio=function(L){L!==void 0&&(ge=L,this.setSize(W,Z,!1))},this.getSize=function(L){return L.set(W,Z)},this.setSize=function(L,j,ae=!0){if(Ee.isPresenting){Te("WebGLRenderer: Can't change size while VR device is presenting.");return}W=L,Z=j,t.width=Math.floor(L*ge),t.height=Math.floor(j*ge),ae===!0&&(t.style.width=L+"px",t.style.height=j+"px"),D!==null&&D.setSize(t.width,t.height),this.setViewport(0,0,L,j)},this.getDrawingBufferSize=function(L){return L.set(W*ge,Z*ge).floor()},this.setDrawingBufferSize=function(L,j,ae){W=L,Z=j,ge=ae,t.width=Math.floor(L*ae),t.height=Math.floor(j*ae),this.setViewport(0,0,L,j)},this.setEffects=function(L){if(_===ln){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(L){for(let j=0;j<L.length;j++)if(L[j].isOutputPass===!0){console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}D.setEffects(L||[])},this.getCurrentViewport=function(L){return L.copy(X)},this.getViewport=function(L){return L.copy(oe)},this.setViewport=function(L,j,ae,se){L.isVector4?oe.set(L.x,L.y,L.z,L.w):oe.set(L,j,ae,se),V.viewport(X.copy(oe).multiplyScalar(ge).round())},this.getScissor=function(L){return L.copy(ee)},this.setScissor=function(L,j,ae,se){L.isVector4?ee.set(L.x,L.y,L.z,L.w):ee.set(L,j,ae,se),V.scissor(H.copy(ee).multiplyScalar(ge).round())},this.getScissorTest=function(){return pe},this.setScissorTest=function(L){V.setScissorTest(pe=L)},this.setOpaqueSort=function(L){_e=L},this.setTransparentSort=function(L){de=L},this.getClearColor=function(L){return L.copy(Me.getClearColor())},this.setClearColor=function(){Me.setClearColor(...arguments)},this.getClearAlpha=function(){return Me.getClearAlpha()},this.setClearAlpha=function(){Me.setClearAlpha(...arguments)},this.clear=function(L=!0,j=!0,ae=!0){let se=0;if(L){let ne=!1;if(O!==null){const Ie=O.texture.format;ne=m.has(Ie)}if(ne){const Ie=O.texture.type,Fe=p.has(Ie),Ne=Me.getClearColor(),Ve=Me.getClearAlpha(),qe=Ne.r,Je=Ne.g,Ze=Ne.b;Fe?(v[0]=qe,v[1]=Je,v[2]=Ze,v[3]=Ve,S.clearBufferuiv(S.COLOR,0,v)):(y[0]=qe,y[1]=Je,y[2]=Ze,y[3]=Ve,S.clearBufferiv(S.COLOR,0,y))}else se|=S.COLOR_BUFFER_BIT}j&&(se|=S.DEPTH_BUFFER_BIT),ae&&(se|=S.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),S.clear(se)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",$e,!1),t.removeEventListener("webglcontextrestored",vt,!1),t.removeEventListener("webglcontextcreationerror",ft,!1),Me.dispose(),fe.dispose(),Se.dispose(),T.dispose(),Q.dispose(),ce.dispose(),we.dispose(),De.dispose(),ve.dispose(),Le.dispose(),Ee.dispose(),Ee.removeEventListener("sessionstart",Jg),Ee.removeEventListener("sessionend",$g),Rr.stop()};function $e(L){L.preventDefault(),qs("WebGLRenderer: Context Lost."),C=!0}function vt(){qs("WebGLRenderer: Context Restored."),C=!1;const L=P.autoReset,j=Ue.enabled,ae=Ue.autoUpdate,se=Ue.needsUpdate,ne=Ue.type;me(),P.autoReset=L,Ue.enabled=j,Ue.autoUpdate=ae,Ue.needsUpdate=se,Ue.type=ne}function ft(L){Ge("WebGLRenderer: A WebGL context could not be created. Reason: ",L.statusMessage)}function ii(L){const j=L.target;j.removeEventListener("dispose",ii),gi(j)}function gi(L){TT(L),T.remove(L)}function TT(L){const j=T.get(L).programs;j!==void 0&&(j.forEach(function(ae){Le.releaseProgram(ae)}),L.isShaderMaterial&&Le.releaseShaderCache(L))}this.renderBufferDirect=function(L,j,ae,se,ne,Ie){j===null&&(j=q);const Fe=ne.isMesh&&ne.matrixWorld.determinant()<0,Ne=IT(L,j,ae,se,ne);V.setMaterial(se,Fe);let Ve=ae.index,qe=1;if(se.wireframe===!0){if(Ve=Re.getWireframeAttribute(ae),Ve===void 0)return;qe=2}const Je=ae.drawRange,Ze=ae.attributes.position;let st=Je.start*qe,mt=(Je.start+Je.count)*qe;Ie!==null&&(st=Math.max(st,Ie.start*qe),mt=Math.min(mt,(Ie.start+Ie.count)*qe)),Ve!==null?(st=Math.max(st,0),mt=Math.min(mt,Ve.count)):Ze!=null&&(st=Math.max(st,0),mt=Math.min(mt,Ze.count));const It=mt-st;if(It<0||It===1/0)return;De.setup(ne,se,Ne,ae,Ve);let Rt,_t=Y;if(Ve!==null&&(Rt=te.get(Ve),_t=Pe,_t.setIndex(Rt)),ne.isMesh)se.wireframe===!0?(V.setLineWidth(se.wireframeLinewidth*N()),_t.setMode(S.LINES)):_t.setMode(S.TRIANGLES);else if(ne.isLine){let Ye=se.linewidth;Ye===void 0&&(Ye=1),V.setLineWidth(Ye*N()),ne.isLineSegments?_t.setMode(S.LINES):ne.isLineLoop?_t.setMode(S.LINE_LOOP):_t.setMode(S.LINE_STRIP)}else ne.isPoints?_t.setMode(S.POINTS):ne.isSprite&&_t.setMode(S.TRIANGLES);if(ne.isBatchedMesh)if(ne._multiDrawInstances!==null)Gr("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),_t.renderMultiDrawInstances(ne._multiDrawStarts,ne._multiDrawCounts,ne._multiDrawCount,ne._multiDrawInstances);else if(K.get("WEBGL_multi_draw"))_t.renderMultiDraw(ne._multiDrawStarts,ne._multiDrawCounts,ne._multiDrawCount);else{const Ye=ne._multiDrawStarts,dt=ne._multiDrawCounts,ht=ne._multiDrawCount,bn=Ve?te.get(Ve).bytesPerElement:1,Ds=T.get(se).currentProgram.getUniforms();for(let wn=0;wn<ht;wn++)Ds.setValue(S,"_gl_DrawID",wn),_t.render(Ye[wn]/bn,dt[wn])}else if(ne.isInstancedMesh)_t.renderInstances(st,It,ne.count);else if(ae.isInstancedBufferGeometry){const Ye=ae._maxInstanceCount!==void 0?ae._maxInstanceCount:1/0,dt=Math.min(ae.instanceCount,Ye);_t.renderInstances(st,It,dt)}else _t.render(st,It)};function jg(L,j,ae){L.transparent===!0&&L.side===Sn&&L.forceSinglePass===!1?(L.side=en,L.needsUpdate=!0,Ul(L,j,ae),L.side=Wn,L.needsUpdate=!0,Ul(L,j,ae),L.side=Sn):Ul(L,j,ae)}this.compile=function(L,j,ae=null){ae===null&&(ae=L),A=Se.get(ae),A.init(j),I.push(A),ae.traverseVisible(function(ne){ne.isLight&&ne.layers.test(j.layers)&&(A.pushLight(ne),ne.castShadow&&A.pushShadow(ne))}),L!==ae&&L.traverseVisible(function(ne){ne.isLight&&ne.layers.test(j.layers)&&(A.pushLight(ne),ne.castShadow&&A.pushShadow(ne))}),A.setupLights();const se=new Set;return L.traverse(function(ne){if(!(ne.isMesh||ne.isPoints||ne.isLine||ne.isSprite))return;const Ie=ne.material;if(Ie)if(Array.isArray(Ie))for(let Fe=0;Fe<Ie.length;Fe++){const Ne=Ie[Fe];jg(Ne,ae,ne),se.add(Ne)}else jg(Ie,ae,ne),se.add(Ie)}),A=I.pop(),se},this.compileAsync=function(L,j,ae=null){const se=this.compile(L,j,ae);return new Promise(ne=>{function Ie(){if(se.forEach(function(Fe){T.get(Fe).currentProgram.isReady()&&se.delete(Fe)}),se.size===0){ne(L);return}setTimeout(Ie,10)}K.get("KHR_parallel_shader_compile")!==null?Ie():setTimeout(Ie,10)})};let _f=null;function CT(L){_f&&_f(L)}function Jg(){Rr.stop()}function $g(){Rr.start()}const Rr=new em;Rr.setAnimationLoop(CT),typeof self<"u"&&Rr.setContext(self),this.setAnimationLoop=function(L){_f=L,Ee.setAnimationLoop(L),L===null?Rr.stop():Rr.start()},Ee.addEventListener("sessionstart",Jg),Ee.addEventListener("sessionend",$g),this.render=function(L,j){if(j!==void 0&&j.isCamera!==!0){Ge("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(C===!0)return;const ae=Ee.enabled===!0&&Ee.isPresenting===!0,se=D!==null&&(O===null||ae)&&D.begin(b,O);if(L.matrixWorldAutoUpdate===!0&&L.updateMatrixWorld(),j.parent===null&&j.matrixWorldAutoUpdate===!0&&j.updateMatrixWorld(),Ee.enabled===!0&&Ee.isPresenting===!0&&(D===null||D.isCompositing()===!1)&&(Ee.cameraAutoUpdate===!0&&Ee.updateCamera(j),j=Ee.getCamera()),L.isScene===!0&&L.onBeforeRender(b,L,j,O),A=Se.get(L,I.length),A.init(j),I.push(A),je.multiplyMatrices(j.projectionMatrix,j.matrixWorldInverse),ye.setFromProjectionMatrix(je,gn,j.reversedDepth),ze=this.localClippingEnabled,Ae=Oe.init(this.clippingPlanes,ze),x=fe.get(L,E.length),x.init(),E.push(x),Ee.enabled===!0&&Ee.isPresenting===!0){const Fe=b.xr.getDepthSensingMesh();Fe!==null&&vf(Fe,j,-1/0,b.sortObjects)}vf(L,j,0,b.sortObjects),x.finish(),b.sortObjects===!0&&x.sort(_e,de),k=Ee.enabled===!1||Ee.isPresenting===!1||Ee.hasDepthSensing()===!1,k&&Me.addToRenderList(x,L),this.info.render.frame++,Ae===!0&&Oe.beginShadows();const ne=A.state.shadowsArray;if(Ue.render(ne,L,j),Ae===!0&&Oe.endShadows(),this.info.autoReset===!0&&this.info.reset(),(se&&D.hasRenderPass())===!1){const Fe=x.opaque,Ne=x.transmissive;if(A.setupLights(),j.isArrayCamera){const Ve=j.cameras;if(Ne.length>0)for(let qe=0,Je=Ve.length;qe<Je;qe++){const Ze=Ve[qe];t0(Fe,Ne,L,Ze)}k&&Me.render(L);for(let qe=0,Je=Ve.length;qe<Je;qe++){const Ze=Ve[qe];e0(x,L,Ze,Ze.viewport)}}else Ne.length>0&&t0(Fe,Ne,L,j),k&&Me.render(L),e0(x,L,j)}O!==null&&R===0&&(F.updateMultisampleRenderTarget(O),F.updateRenderTargetMipmap(O)),se&&D.end(b),L.isScene===!0&&L.onAfterRender(b,L,j),De.resetDefaultState(),M=-1,z=null,I.pop(),I.length>0?(A=I[I.length-1],Ae===!0&&Oe.setGlobalState(b.clippingPlanes,A.state.camera)):A=null,E.pop(),E.length>0?x=E[E.length-1]:x=null};function vf(L,j,ae,se){if(L.visible===!1)return;if(L.layers.test(j.layers)){if(L.isGroup)ae=L.renderOrder;else if(L.isLOD)L.autoUpdate===!0&&L.update(j);else if(L.isLight)A.pushLight(L),L.castShadow&&A.pushShadow(L);else if(L.isSprite){if(!L.frustumCulled||ye.intersectsSprite(L)){se&&w.setFromMatrixPosition(L.matrixWorld).applyMatrix4(je);const Fe=we.update(L),Ne=L.material;Ne.visible&&x.push(L,Fe,Ne,ae,w.z,null)}}else if((L.isMesh||L.isLine||L.isPoints)&&(!L.frustumCulled||ye.intersectsObject(L))){const Fe=we.update(L),Ne=L.material;if(se&&(L.boundingSphere!==void 0?(L.boundingSphere===null&&L.computeBoundingSphere(),w.copy(L.boundingSphere.center)):(Fe.boundingSphere===null&&Fe.computeBoundingSphere(),w.copy(Fe.boundingSphere.center)),w.applyMatrix4(L.matrixWorld).applyMatrix4(je)),Array.isArray(Ne)){const Ve=Fe.groups;for(let qe=0,Je=Ve.length;qe<Je;qe++){const Ze=Ve[qe],st=Ne[Ze.materialIndex];st&&st.visible&&x.push(L,Fe,st,ae,w.z,Ze)}}else Ne.visible&&x.push(L,Fe,Ne,ae,w.z,null)}}const Ie=L.children;for(let Fe=0,Ne=Ie.length;Fe<Ne;Fe++)vf(Ie[Fe],j,ae,se)}function e0(L,j,ae,se){const{opaque:ne,transmissive:Ie,transparent:Fe}=L;A.setupLightsView(ae),Ae===!0&&Oe.setGlobalState(b.clippingPlanes,ae),se&&V.viewport(X.copy(se)),ne.length>0&&Nl(ne,j,ae),Ie.length>0&&Nl(Ie,j,ae),Fe.length>0&&Nl(Fe,j,ae),V.buffers.depth.setTest(!0),V.buffers.depth.setMask(!0),V.buffers.color.setMask(!0),V.setPolygonOffset(!1)}function t0(L,j,ae,se){if((ae.isScene===!0?ae.overrideMaterial:null)!==null)return;if(A.state.transmissionRenderTarget[se.id]===void 0){const st=K.has("EXT_color_buffer_half_float")||K.has("EXT_color_buffer_float");A.state.transmissionRenderTarget[se.id]=new vn(1,1,{generateMipmaps:!0,type:st?Zn:ln,minFilter:Mn,samples:ie.samples,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:rt.workingColorSpace})}const Ie=A.state.transmissionRenderTarget[se.id],Fe=se.viewport||X;Ie.setSize(Fe.z*b.transmissionResolutionScale,Fe.w*b.transmissionResolutionScale);const Ne=b.getRenderTarget(),Ve=b.getActiveCubeFace(),qe=b.getActiveMipmapLevel();b.setRenderTarget(Ie),b.getClearColor(J),le=b.getClearAlpha(),le<1&&b.setClearColor(16777215,.5),b.clear(),k&&Me.render(ae);const Je=b.toneMapping;b.toneMapping=Nn;const Ze=se.viewport;if(se.viewport!==void 0&&(se.viewport=void 0),A.setupLightsView(se),Ae===!0&&Oe.setGlobalState(b.clippingPlanes,se),Nl(L,ae,se),F.updateMultisampleRenderTarget(Ie),F.updateRenderTargetMipmap(Ie),K.has("WEBGL_multisampled_render_to_texture")===!1){let st=!1;for(let mt=0,It=j.length;mt<It;mt++){const Rt=j[mt],{object:_t,geometry:Ye,material:dt,group:ht}=Rt;if(dt.side===Sn&&_t.layers.test(se.layers)){const bn=dt.side;dt.side=en,dt.needsUpdate=!0,n0(_t,ae,se,Ye,dt,ht),dt.side=bn,dt.needsUpdate=!0,st=!0}}st===!0&&(F.updateMultisampleRenderTarget(Ie),F.updateRenderTargetMipmap(Ie))}b.setRenderTarget(Ne,Ve,qe),b.setClearColor(J,le),Ze!==void 0&&(se.viewport=Ze),b.toneMapping=Je}function Nl(L,j,ae){const se=j.isScene===!0?j.overrideMaterial:null;for(let ne=0,Ie=L.length;ne<Ie;ne++){const Fe=L[ne],{object:Ne,geometry:Ve,group:qe}=Fe;let Je=Fe.material;Je.allowOverride===!0&&se!==null&&(Je=se),Ne.layers.test(ae.layers)&&n0(Ne,j,ae,Ve,Je,qe)}}function n0(L,j,ae,se,ne,Ie){L.onBeforeRender(b,j,ae,se,ne,Ie),L.modelViewMatrix.multiplyMatrices(ae.matrixWorldInverse,L.matrixWorld),L.normalMatrix.getNormalMatrix(L.modelViewMatrix),ne.onBeforeRender(b,j,ae,se,L,Ie),ne.transparent===!0&&ne.side===Sn&&ne.forceSinglePass===!1?(ne.side=en,ne.needsUpdate=!0,b.renderBufferDirect(ae,j,se,ne,L,Ie),ne.side=Wn,ne.needsUpdate=!0,b.renderBufferDirect(ae,j,se,ne,L,Ie),ne.side=Sn):b.renderBufferDirect(ae,j,se,ne,L,Ie),L.onAfterRender(b,j,ae,se,ne,Ie)}function Ul(L,j,ae){j.isScene!==!0&&(j=q);const se=T.get(L),ne=A.state.lights,Ie=A.state.shadowsArray,Fe=ne.state.version,Ne=Le.getParameters(L,ne.state,Ie,j,ae),Ve=Le.getProgramCacheKey(Ne);let qe=se.programs;se.environment=L.isMeshStandardMaterial?j.environment:null,se.fog=j.fog,se.envMap=(L.isMeshStandardMaterial?ce:Q).get(L.envMap||se.environment),se.envMapRotation=se.environment!==null&&L.envMap===null?j.environmentRotation:L.envMapRotation,qe===void 0&&(L.addEventListener("dispose",ii),qe=new Map,se.programs=qe);let Je=qe.get(Ve);if(Je!==void 0){if(se.currentProgram===Je&&se.lightsStateVersion===Fe)return r0(L,Ne),Je}else Ne.uniforms=Le.getUniforms(L),L.onBeforeCompile(Ne,b),Je=Le.acquireProgram(Ne,Ve),qe.set(Ve,Je),se.uniforms=Ne.uniforms;const Ze=se.uniforms;return(!L.isShaderMaterial&&!L.isRawShaderMaterial||L.clipping===!0)&&(Ze.clippingPlanes=Oe.uniform),r0(L,Ne),se.needsLights=PT(L),se.lightsStateVersion=Fe,se.needsLights&&(Ze.ambientLightColor.value=ne.state.ambient,Ze.lightProbe.value=ne.state.probe,Ze.directionalLights.value=ne.state.directional,Ze.directionalLightShadows.value=ne.state.directionalShadow,Ze.spotLights.value=ne.state.spot,Ze.spotLightShadows.value=ne.state.spotShadow,Ze.rectAreaLights.value=ne.state.rectArea,Ze.ltc_1.value=ne.state.rectAreaLTC1,Ze.ltc_2.value=ne.state.rectAreaLTC2,Ze.pointLights.value=ne.state.point,Ze.pointLightShadows.value=ne.state.pointShadow,Ze.hemisphereLights.value=ne.state.hemi,Ze.directionalShadowMap.value=ne.state.directionalShadowMap,Ze.directionalShadowMatrix.value=ne.state.directionalShadowMatrix,Ze.spotShadowMap.value=ne.state.spotShadowMap,Ze.spotLightMatrix.value=ne.state.spotLightMatrix,Ze.spotLightMap.value=ne.state.spotLightMap,Ze.pointShadowMap.value=ne.state.pointShadowMap,Ze.pointShadowMatrix.value=ne.state.pointShadowMatrix),se.currentProgram=Je,se.uniformsList=null,Je}function i0(L){if(L.uniformsList===null){const j=L.currentProgram.getUniforms();L.uniformsList=hl.seqWithValue(j.seq,L.uniforms)}return L.uniformsList}function r0(L,j){const ae=T.get(L);ae.outputColorSpace=j.outputColorSpace,ae.batching=j.batching,ae.batchingColor=j.batchingColor,ae.instancing=j.instancing,ae.instancingColor=j.instancingColor,ae.instancingMorph=j.instancingMorph,ae.skinning=j.skinning,ae.morphTargets=j.morphTargets,ae.morphNormals=j.morphNormals,ae.morphColors=j.morphColors,ae.morphTargetsCount=j.morphTargetsCount,ae.numClippingPlanes=j.numClippingPlanes,ae.numIntersection=j.numClipIntersection,ae.vertexAlphas=j.vertexAlphas,ae.vertexTangents=j.vertexTangents,ae.toneMapping=j.toneMapping}function IT(L,j,ae,se,ne){j.isScene!==!0&&(j=q),F.resetTextureUnits();const Ie=j.fog,Fe=se.isMeshStandardMaterial?j.environment:null,Ne=O===null?b.outputColorSpace:O.isXRRenderTarget===!0?O.texture.colorSpace:Xt,Ve=(se.isMeshStandardMaterial?ce:Q).get(se.envMap||Fe),qe=se.vertexColors===!0&&!!ae.attributes.color&&ae.attributes.color.itemSize===4,Je=!!ae.attributes.tangent&&(!!se.normalMap||se.anisotropy>0),Ze=!!ae.morphAttributes.position,st=!!ae.morphAttributes.normal,mt=!!ae.morphAttributes.color;let It=Nn;se.toneMapped&&(O===null||O.isXRRenderTarget===!0)&&(It=b.toneMapping);const Rt=ae.morphAttributes.position||ae.morphAttributes.normal||ae.morphAttributes.color,_t=Rt!==void 0?Rt.length:0,Ye=T.get(se),dt=A.state.lights;if(Ae===!0&&(ze===!0||L!==z)){const cn=L===z&&se.id===M;Oe.setState(se,L,cn)}let ht=!1;se.version===Ye.__version?(Ye.needsLights&&Ye.lightsStateVersion!==dt.state.version||Ye.outputColorSpace!==Ne||ne.isBatchedMesh&&Ye.batching===!1||!ne.isBatchedMesh&&Ye.batching===!0||ne.isBatchedMesh&&Ye.batchingColor===!0&&ne.colorTexture===null||ne.isBatchedMesh&&Ye.batchingColor===!1&&ne.colorTexture!==null||ne.isInstancedMesh&&Ye.instancing===!1||!ne.isInstancedMesh&&Ye.instancing===!0||ne.isSkinnedMesh&&Ye.skinning===!1||!ne.isSkinnedMesh&&Ye.skinning===!0||ne.isInstancedMesh&&Ye.instancingColor===!0&&ne.instanceColor===null||ne.isInstancedMesh&&Ye.instancingColor===!1&&ne.instanceColor!==null||ne.isInstancedMesh&&Ye.instancingMorph===!0&&ne.morphTexture===null||ne.isInstancedMesh&&Ye.instancingMorph===!1&&ne.morphTexture!==null||Ye.envMap!==Ve||se.fog===!0&&Ye.fog!==Ie||Ye.numClippingPlanes!==void 0&&(Ye.numClippingPlanes!==Oe.numPlanes||Ye.numIntersection!==Oe.numIntersection)||Ye.vertexAlphas!==qe||Ye.vertexTangents!==Je||Ye.morphTargets!==Ze||Ye.morphNormals!==st||Ye.morphColors!==mt||Ye.toneMapping!==It||Ye.morphTargetsCount!==_t)&&(ht=!0):(ht=!0,Ye.__version=se.version);let bn=Ye.currentProgram;ht===!0&&(bn=Ul(se,j,ne));let Ds=!1,wn=!1,Fo=!1;const yt=bn.getUniforms(),pn=Ye.uniforms;if(V.useProgram(bn.program)&&(Ds=!0,wn=!0,Fo=!0),se.id!==M&&(M=se.id,wn=!0),Ds||z!==L){V.buffers.depth.getReversed()&&L.reversedDepth!==!0&&(L._reversedDepth=!0,L.updateProjectionMatrix()),yt.setValue(S,"projectionMatrix",L.projectionMatrix),yt.setValue(S,"viewMatrix",L.matrixWorldInverse);const mn=yt.map.cameraPosition;mn!==void 0&&mn.setValue(S,He.setFromMatrixPosition(L.matrixWorld)),ie.logarithmicDepthBuffer&&yt.setValue(S,"logDepthBufFC",2/(Math.log(L.far+1)/Math.LN2)),(se.isMeshPhongMaterial||se.isMeshToonMaterial||se.isMeshLambertMaterial||se.isMeshBasicMaterial||se.isMeshStandardMaterial||se.isShaderMaterial)&&yt.setValue(S,"isOrthographic",L.isOrthographicCamera===!0),z!==L&&(z=L,wn=!0,Fo=!0)}if(Ye.needsLights&&(dt.state.directionalShadowMap.length>0&&yt.setValue(S,"directionalShadowMap",dt.state.directionalShadowMap,F),dt.state.spotShadowMap.length>0&&yt.setValue(S,"spotShadowMap",dt.state.spotShadowMap,F),dt.state.pointShadowMap.length>0&&yt.setValue(S,"pointShadowMap",dt.state.pointShadowMap,F)),ne.isSkinnedMesh){yt.setOptional(S,ne,"bindMatrix"),yt.setOptional(S,ne,"bindMatrixInverse");const cn=ne.skeleton;cn&&(cn.boneTexture===null&&cn.computeBoneTexture(),yt.setValue(S,"boneTexture",cn.boneTexture,F))}ne.isBatchedMesh&&(yt.setOptional(S,ne,"batchingTexture"),yt.setValue(S,"batchingTexture",ne._matricesTexture,F),yt.setOptional(S,ne,"batchingIdTexture"),yt.setValue(S,"batchingIdTexture",ne._indirectTexture,F),yt.setOptional(S,ne,"batchingColorTexture"),ne._colorsTexture!==null&&yt.setValue(S,"batchingColorTexture",ne._colorsTexture,F));const Ln=ae.morphAttributes;if((Ln.position!==void 0||Ln.normal!==void 0||Ln.color!==void 0)&&it.update(ne,ae,bn),(wn||Ye.receiveShadow!==ne.receiveShadow)&&(Ye.receiveShadow=ne.receiveShadow,yt.setValue(S,"receiveShadow",ne.receiveShadow)),se.isMeshGouraudMaterial&&se.envMap!==null&&(pn.envMap.value=Ve,pn.flipEnvMap.value=Ve.isCubeTexture&&Ve.isRenderTargetTexture===!1?-1:1),se.isMeshStandardMaterial&&se.envMap===null&&j.environment!==null&&(pn.envMapIntensity.value=j.environmentIntensity),pn.dfgLUT!==void 0&&(pn.dfgLUT.value=rw()),wn&&(yt.setValue(S,"toneMappingExposure",b.toneMappingExposure),Ye.needsLights&&RT(pn,Fo),Ie&&se.fog===!0&&Xe.refreshFogUniforms(pn,Ie),Xe.refreshMaterialUniforms(pn,se,ge,Z,A.state.transmissionRenderTarget[L.id]),hl.upload(S,i0(Ye),pn,F)),se.isShaderMaterial&&se.uniformsNeedUpdate===!0&&(hl.upload(S,i0(Ye),pn,F),se.uniformsNeedUpdate=!1),se.isSpriteMaterial&&yt.setValue(S,"center",ne.center),yt.setValue(S,"modelViewMatrix",ne.modelViewMatrix),yt.setValue(S,"normalMatrix",ne.normalMatrix),yt.setValue(S,"modelMatrix",ne.matrixWorld),se.isShaderMaterial||se.isRawShaderMaterial){const cn=se.uniformsGroups;for(let mn=0,yf=cn.length;mn<yf;mn++){const Pr=cn[mn];ve.update(Pr,bn),ve.bind(Pr,bn)}}return bn}function RT(L,j){L.ambientLightColor.needsUpdate=j,L.lightProbe.needsUpdate=j,L.directionalLights.needsUpdate=j,L.directionalLightShadows.needsUpdate=j,L.pointLights.needsUpdate=j,L.pointLightShadows.needsUpdate=j,L.spotLights.needsUpdate=j,L.spotLightShadows.needsUpdate=j,L.rectAreaLights.needsUpdate=j,L.hemisphereLights.needsUpdate=j}function PT(L){return L.isMeshLambertMaterial||L.isMeshToonMaterial||L.isMeshPhongMaterial||L.isMeshStandardMaterial||L.isShadowMaterial||L.isShaderMaterial&&L.lights===!0}this.getActiveCubeFace=function(){return B},this.getActiveMipmapLevel=function(){return R},this.getRenderTarget=function(){return O},this.setRenderTargetTextures=function(L,j,ae){const se=T.get(L);se.__autoAllocateDepthBuffer=L.resolveDepthBuffer===!1,se.__autoAllocateDepthBuffer===!1&&(se.__useRenderToTexture=!1),T.get(L.texture).__webglTexture=j,T.get(L.depthTexture).__webglTexture=se.__autoAllocateDepthBuffer?void 0:ae,se.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(L,j){const ae=T.get(L);ae.__webglFramebuffer=j,ae.__useDefaultFramebuffer=j===void 0};const DT=S.createFramebuffer();this.setRenderTarget=function(L,j=0,ae=0){O=L,B=j,R=ae;let se=null,ne=!1,Ie=!1;if(L){const Ne=T.get(L);if(Ne.__useDefaultFramebuffer!==void 0){V.bindFramebuffer(S.FRAMEBUFFER,Ne.__webglFramebuffer),X.copy(L.viewport),H.copy(L.scissor),re=L.scissorTest,V.viewport(X),V.scissor(H),V.setScissorTest(re),M=-1;return}else if(Ne.__webglFramebuffer===void 0)F.setupRenderTarget(L);else if(Ne.__hasExternalTextures)F.rebindTextures(L,T.get(L.texture).__webglTexture,T.get(L.depthTexture).__webglTexture);else if(L.depthBuffer){const Je=L.depthTexture;if(Ne.__boundDepthTexture!==Je){if(Je!==null&&T.has(Je)&&(L.width!==Je.image.width||L.height!==Je.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");F.setupDepthRenderbuffer(L)}}const Ve=L.texture;(Ve.isData3DTexture||Ve.isDataArrayTexture||Ve.isCompressedArrayTexture)&&(Ie=!0);const qe=T.get(L).__webglFramebuffer;L.isWebGLCubeRenderTarget?(Array.isArray(qe[j])?se=qe[j][ae]:se=qe[j],ne=!0):L.samples>0&&F.useMultisampledRTT(L)===!1?se=T.get(L).__webglMultisampledFramebuffer:Array.isArray(qe)?se=qe[ae]:se=qe,X.copy(L.viewport),H.copy(L.scissor),re=L.scissorTest}else X.copy(oe).multiplyScalar(ge).floor(),H.copy(ee).multiplyScalar(ge).floor(),re=pe;if(ae!==0&&(se=DT),V.bindFramebuffer(S.FRAMEBUFFER,se)&&V.drawBuffers(L,se),V.viewport(X),V.scissor(H),V.setScissorTest(re),ne){const Ne=T.get(L.texture);S.framebufferTexture2D(S.FRAMEBUFFER,S.COLOR_ATTACHMENT0,S.TEXTURE_CUBE_MAP_POSITIVE_X+j,Ne.__webglTexture,ae)}else if(Ie){const Ne=j;for(let Ve=0;Ve<L.textures.length;Ve++){const qe=T.get(L.textures[Ve]);S.framebufferTextureLayer(S.FRAMEBUFFER,S.COLOR_ATTACHMENT0+Ve,qe.__webglTexture,ae,Ne)}}else if(L!==null&&ae!==0){const Ne=T.get(L.texture);S.framebufferTexture2D(S.FRAMEBUFFER,S.COLOR_ATTACHMENT0,S.TEXTURE_2D,Ne.__webglTexture,ae)}M=-1},this.readRenderTargetPixels=function(L,j,ae,se,ne,Ie,Fe,Ne=0){if(!(L&&L.isWebGLRenderTarget)){Ge("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ve=T.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&Fe!==void 0&&(Ve=Ve[Fe]),Ve){V.bindFramebuffer(S.FRAMEBUFFER,Ve);try{const qe=L.textures[Ne],Je=qe.format,Ze=qe.type;if(!ie.textureFormatReadable(Je)){Ge("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!ie.textureTypeReadable(Ze)){Ge("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}j>=0&&j<=L.width-se&&ae>=0&&ae<=L.height-ne&&(L.textures.length>1&&S.readBuffer(S.COLOR_ATTACHMENT0+Ne),S.readPixels(j,ae,se,ne,be.convert(Je),be.convert(Ze),Ie))}finally{const qe=O!==null?T.get(O).__webglFramebuffer:null;V.bindFramebuffer(S.FRAMEBUFFER,qe)}}},this.readRenderTargetPixelsAsync=async function(L,j,ae,se,ne,Ie,Fe,Ne=0){if(!(L&&L.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ve=T.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&Fe!==void 0&&(Ve=Ve[Fe]),Ve)if(j>=0&&j<=L.width-se&&ae>=0&&ae<=L.height-ne){V.bindFramebuffer(S.FRAMEBUFFER,Ve);const qe=L.textures[Ne],Je=qe.format,Ze=qe.type;if(!ie.textureFormatReadable(Je))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!ie.textureTypeReadable(Ze))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const st=S.createBuffer();S.bindBuffer(S.PIXEL_PACK_BUFFER,st),S.bufferData(S.PIXEL_PACK_BUFFER,Ie.byteLength,S.STREAM_READ),L.textures.length>1&&S.readBuffer(S.COLOR_ATTACHMENT0+Ne),S.readPixels(j,ae,se,ne,be.convert(Je),be.convert(Ze),0);const mt=O!==null?T.get(O).__webglFramebuffer:null;V.bindFramebuffer(S.FRAMEBUFFER,mt);const It=S.fenceSync(S.SYNC_GPU_COMMANDS_COMPLETE,0);return S.flush(),await Y0(S,It,4),S.bindBuffer(S.PIXEL_PACK_BUFFER,st),S.getBufferSubData(S.PIXEL_PACK_BUFFER,0,Ie),S.deleteBuffer(st),S.deleteSync(It),Ie}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(L,j=null,ae=0){const se=Math.pow(2,-ae),ne=Math.floor(L.image.width*se),Ie=Math.floor(L.image.height*se),Fe=j!==null?j.x:0,Ne=j!==null?j.y:0;F.setTexture2D(L,0),S.copyTexSubImage2D(S.TEXTURE_2D,ae,0,0,Fe,Ne,ne,Ie),V.unbindTexture()};const LT=S.createFramebuffer(),NT=S.createFramebuffer();this.copyTextureToTexture=function(L,j,ae=null,se=null,ne=0,Ie=null){Ie===null&&(ne!==0?(Gr("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Ie=ne,ne=0):Ie=0);let Fe,Ne,Ve,qe,Je,Ze,st,mt,It;const Rt=L.isCompressedTexture?L.mipmaps[Ie]:L.image;if(ae!==null)Fe=ae.max.x-ae.min.x,Ne=ae.max.y-ae.min.y,Ve=ae.isBox3?ae.max.z-ae.min.z:1,qe=ae.min.x,Je=ae.min.y,Ze=ae.isBox3?ae.min.z:0;else{const Ln=Math.pow(2,-ne);Fe=Math.floor(Rt.width*Ln),Ne=Math.floor(Rt.height*Ln),L.isDataArrayTexture?Ve=Rt.depth:L.isData3DTexture?Ve=Math.floor(Rt.depth*Ln):Ve=1,qe=0,Je=0,Ze=0}se!==null?(st=se.x,mt=se.y,It=se.z):(st=0,mt=0,It=0);const _t=be.convert(j.format),Ye=be.convert(j.type);let dt;j.isData3DTexture?(F.setTexture3D(j,0),dt=S.TEXTURE_3D):j.isDataArrayTexture||j.isCompressedArrayTexture?(F.setTexture2DArray(j,0),dt=S.TEXTURE_2D_ARRAY):(F.setTexture2D(j,0),dt=S.TEXTURE_2D),S.pixelStorei(S.UNPACK_FLIP_Y_WEBGL,j.flipY),S.pixelStorei(S.UNPACK_PREMULTIPLY_ALPHA_WEBGL,j.premultiplyAlpha),S.pixelStorei(S.UNPACK_ALIGNMENT,j.unpackAlignment);const ht=S.getParameter(S.UNPACK_ROW_LENGTH),bn=S.getParameter(S.UNPACK_IMAGE_HEIGHT),Ds=S.getParameter(S.UNPACK_SKIP_PIXELS),wn=S.getParameter(S.UNPACK_SKIP_ROWS),Fo=S.getParameter(S.UNPACK_SKIP_IMAGES);S.pixelStorei(S.UNPACK_ROW_LENGTH,Rt.width),S.pixelStorei(S.UNPACK_IMAGE_HEIGHT,Rt.height),S.pixelStorei(S.UNPACK_SKIP_PIXELS,qe),S.pixelStorei(S.UNPACK_SKIP_ROWS,Je),S.pixelStorei(S.UNPACK_SKIP_IMAGES,Ze);const yt=L.isDataArrayTexture||L.isData3DTexture,pn=j.isDataArrayTexture||j.isData3DTexture;if(L.isDepthTexture){const Ln=T.get(L),cn=T.get(j),mn=T.get(Ln.__renderTarget),yf=T.get(cn.__renderTarget);V.bindFramebuffer(S.READ_FRAMEBUFFER,mn.__webglFramebuffer),V.bindFramebuffer(S.DRAW_FRAMEBUFFER,yf.__webglFramebuffer);for(let Pr=0;Pr<Ve;Pr++)yt&&(S.framebufferTextureLayer(S.READ_FRAMEBUFFER,S.COLOR_ATTACHMENT0,T.get(L).__webglTexture,ne,Ze+Pr),S.framebufferTextureLayer(S.DRAW_FRAMEBUFFER,S.COLOR_ATTACHMENT0,T.get(j).__webglTexture,Ie,It+Pr)),S.blitFramebuffer(qe,Je,Fe,Ne,st,mt,Fe,Ne,S.DEPTH_BUFFER_BIT,S.NEAREST);V.bindFramebuffer(S.READ_FRAMEBUFFER,null),V.bindFramebuffer(S.DRAW_FRAMEBUFFER,null)}else if(ne!==0||L.isRenderTargetTexture||T.has(L)){const Ln=T.get(L),cn=T.get(j);V.bindFramebuffer(S.READ_FRAMEBUFFER,LT),V.bindFramebuffer(S.DRAW_FRAMEBUFFER,NT);for(let mn=0;mn<Ve;mn++)yt?S.framebufferTextureLayer(S.READ_FRAMEBUFFER,S.COLOR_ATTACHMENT0,Ln.__webglTexture,ne,Ze+mn):S.framebufferTexture2D(S.READ_FRAMEBUFFER,S.COLOR_ATTACHMENT0,S.TEXTURE_2D,Ln.__webglTexture,ne),pn?S.framebufferTextureLayer(S.DRAW_FRAMEBUFFER,S.COLOR_ATTACHMENT0,cn.__webglTexture,Ie,It+mn):S.framebufferTexture2D(S.DRAW_FRAMEBUFFER,S.COLOR_ATTACHMENT0,S.TEXTURE_2D,cn.__webglTexture,Ie),ne!==0?S.blitFramebuffer(qe,Je,Fe,Ne,st,mt,Fe,Ne,S.COLOR_BUFFER_BIT,S.NEAREST):pn?S.copyTexSubImage3D(dt,Ie,st,mt,It+mn,qe,Je,Fe,Ne):S.copyTexSubImage2D(dt,Ie,st,mt,qe,Je,Fe,Ne);V.bindFramebuffer(S.READ_FRAMEBUFFER,null),V.bindFramebuffer(S.DRAW_FRAMEBUFFER,null)}else pn?L.isDataTexture||L.isData3DTexture?S.texSubImage3D(dt,Ie,st,mt,It,Fe,Ne,Ve,_t,Ye,Rt.data):j.isCompressedArrayTexture?S.compressedTexSubImage3D(dt,Ie,st,mt,It,Fe,Ne,Ve,_t,Rt.data):S.texSubImage3D(dt,Ie,st,mt,It,Fe,Ne,Ve,_t,Ye,Rt):L.isDataTexture?S.texSubImage2D(S.TEXTURE_2D,Ie,st,mt,Fe,Ne,_t,Ye,Rt.data):L.isCompressedTexture?S.compressedTexSubImage2D(S.TEXTURE_2D,Ie,st,mt,Rt.width,Rt.height,_t,Rt.data):S.texSubImage2D(S.TEXTURE_2D,Ie,st,mt,Fe,Ne,_t,Ye,Rt);S.pixelStorei(S.UNPACK_ROW_LENGTH,ht),S.pixelStorei(S.UNPACK_IMAGE_HEIGHT,bn),S.pixelStorei(S.UNPACK_SKIP_PIXELS,Ds),S.pixelStorei(S.UNPACK_SKIP_ROWS,wn),S.pixelStorei(S.UNPACK_SKIP_IMAGES,Fo),Ie===0&&j.generateMipmaps&&S.generateMipmap(dt),V.unbindTexture()},this.initRenderTarget=function(L){T.get(L).__webglFramebuffer===void 0&&F.setupRenderTarget(L)},this.initTexture=function(L){L.isCubeTexture?F.setTextureCube(L,0):L.isData3DTexture?F.setTexture3D(L,0):L.isDataArrayTexture||L.isCompressedArrayTexture?F.setTexture2DArray(L,0):F.setTexture2D(L,0),V.unbindTexture()},this.resetState=function(){B=0,R=0,O=null,V.reset(),De.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return gn}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=rt._getDrawingBufferColorSpace(e),t.unpackColorSpace=rt._getUnpackColorSpace()}}const sw=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:Yo,AddEquation:_i,AddOperation:Hf,AdditiveBlending:Ol,AgXToneMapping:Wl,AlphaFormat:jl,AlwaysCompare:td,AlwaysDepth:Ho,ArrayCamera:Fp,BackSide:en,BoxGeometry:ji,BufferAttribute:ot,BufferGeometry:Ke,ByteType:Zl,CineonToneMapping:Hl,ClampToEdgeWrapping:tn,Color:xe,ColorManagement:rt,ConstantAlphaFactor:zf,ConstantColorFactor:Of,CubeDepthTexture:Jd,CubeReflectionMapping:Xn,CubeRefractionMapping:vi,CubeTexture:Js,CubeUVReflectionMapping:Lr,CullFaceBack:Bl,CullFaceFront:Af,CullFaceNone:xf,CustomBlending:wf,CustomToneMapping:Gl,Data3DTexture:Ha,DataArrayTexture:Va,DataTexture:Fn,DepthFormat:Yn,DepthStencilFormat:xi,DepthTexture:ds,DoubleSide:Sn,DstAlphaFactor:Df,DstColorFactor:Nf,EqualCompare:Jf,EqualDepth:Wo,EquirectangularReflectionMapping:Us,EquirectangularRefractionMapping:Bs,Euler:Zt,EventDispatcher:Qn,ExternalTexture:Vh,Float32BufferAttribute:Be,FloatType:nn,FrontSide:Wn,Frustum:fs,GLSL3:nh,GreaterCompare:$f,GreaterDepth:Xo,GreaterEqualCompare:za,GreaterEqualDepth:qo,HalfFloatType:Zn,IntType:jo,Layers:Qa,LessCompare:jf,LessDepth:Go,LessEqualCompare:Fa,LessEqualDepth:Vi,LinearFilter:pt,LinearMipmapLinearFilter:Mn,LinearMipmapNearestFilter:Ur,LinearSRGBColorSpace:Xt,LinearToneMapping:kl,LinearTransfer:Gs,Matrix3:et,Matrix4:We,MaxEquation:Tf,Mesh:St,MeshBasicMaterial:un,MeshDepthMaterial:nu,MeshDistanceMaterial:iu,MinEquation:Ef,MirroredRepeatWrapping:Nr,MixOperation:Vf,MultiplyBlending:zl,MultiplyOperation:Ns,NearestFilter:Mt,NearestMipmapLinearFilter:Hi,NearestMipmapNearestFilter:Ko,NeutralToneMapping:ql,NeverCompare:Kf,NeverDepth:Vo,NoBlending:qn,NoColorSpace:ri,NoToneMapping:Nn,NormalBlending:ki,NotEqualCompare:ed,NotEqualDepth:Zo,ObjectSpaceNormalMap:Qf,OneFactor:If,OneMinusConstantAlphaFactor:kf,OneMinusConstantColorFactor:Ff,OneMinusDstAlphaFactor:Lf,OneMinusDstColorFactor:Uf,OneMinusSrcAlphaFactor:ko,OneMinusSrcColorFactor:Pf,OrthographicCamera:ur,PCFShadowMap:Ls,PCFSoftShadowMap:bf,PMREMGenerator:Lu,PerspectiveCamera:kt,Plane:Ri,PlaneGeometry:rr,R11_EAC_Format:ha,RED_GREEN_RGTC2_Format:La,RED_RGTC1_Format:Pa,REVISION:Yt,RG11_EAC_Format:fa,RGBAFormat:rn,RGBAIntegerFormat:na,RGBA_ASTC_10x10_Format:Ma,RGBA_ASTC_10x5_Format:ba,RGBA_ASTC_10x6_Format:wa,RGBA_ASTC_10x8_Format:Sa,RGBA_ASTC_12x10_Format:Ea,RGBA_ASTC_12x12_Format:Ta,RGBA_ASTC_4x4_Format:pa,RGBA_ASTC_5x4_Format:ma,RGBA_ASTC_5x5_Format:ga,RGBA_ASTC_6x5_Format:_a,RGBA_ASTC_6x6_Format:va,RGBA_ASTC_8x5_Format:ya,RGBA_ASTC_8x6_Format:xa,RGBA_ASTC_8x8_Format:Aa,RGBA_BPTC_Format:Ca,RGBA_ETC2_EAC_Format:la,RGBA_PVRTC_2BPPV1_Format:oa,RGBA_PVRTC_4BPPV1_Format:sa,RGBA_S3TC_DXT1_Format:zs,RGBA_S3TC_DXT3_Format:ks,RGBA_S3TC_DXT5_Format:Vs,RGBFormat:Jl,RGB_BPTC_SIGNED_Format:Ia,RGB_BPTC_UNSIGNED_Format:Ra,RGB_ETC1_Format:aa,RGB_ETC2_Format:ca,RGB_PVRTC_2BPPV1_Format:ra,RGB_PVRTC_4BPPV1_Format:ia,RGB_S3TC_DXT1_Format:Fs,RGFormat:Gi,RGIntegerFormat:ta,RawShaderMaterial:tu,RedFormat:ea,RedIntegerFormat:Os,ReinhardToneMapping:Vl,RepeatWrapping:yi,ReverseSubtractEquation:Mf,SIGNED_R11_EAC_Format:ua,SIGNED_RED_GREEN_RGTC2_Format:Na,SIGNED_RED_RGTC1_Format:Da,SIGNED_RG11_EAC_Format:da,SRGBColorSpace:Tt,SRGBTransfer:ut,ShaderChunk:nt,ShaderLib:Vn,ShaderMaterial:Cn,ShortType:Yl,SrcAlphaFactor:zo,SrcAlphaSaturateFactor:Bf,SrcColorFactor:Rf,SubtractEquation:Sf,SubtractiveBlending:Fl,TangentSpaceNormalMap:Ai,Texture:xt,Uint16BufferAttribute:wh,Uint32BufferAttribute:Sh,UniformsLib:Ce,UniformsUtils:Sd,UnsignedByteType:ln,UnsignedInt101111Type:Kl,UnsignedInt248Type:Or,UnsignedInt5999Type:Ql,UnsignedIntType:En,UnsignedShort4444Type:Jo,UnsignedShort5551Type:$o,UnsignedShortType:Br,VSMShadowMap:Dr,Vector2:he,Vector3:U,Vector4:gt,WebGLCoordinateSystem:gn,WebGLCubeRenderTarget:Th,WebGLRenderTarget:vn,WebGLRenderer:Cm,WebGLUtils:Tm,WebXRController:ac,ZeroFactor:Cf,createCanvasElement:rd,error:Ge,log:qs,warn:Te,warnOnce:Gr,AdditiveAnimationBlendMode:$l,AlwaysStencilFunc:th,AmbientLight:mu,AnimationAction:Hp,AnimationClip:vs,AnimationLoader:Ov,AnimationMixer:hy,AnimationObjectGroup:cy,AnimationUtils:Lv,ArcCurve:ep,ArrowHelper:Oy,AttachedBindMode:Xl,Audio:zp,AudioAnalyser:Jv,AudioContext:vu,AudioListener:Qv,AudioLoader:Xv,AxesHelper:Fy,BasicDepthPacking:Yf,BasicShadowMap:a0,BatchedMesh:Wd,Bone:mc,BooleanKeyframeTrack:or,Box2:Ay,Box3:Gt,Box3Helper:Uy,BoxHelper:Ny,BufferGeometryLoader:Dp,Cache:$n,Camera:oc,CameraHelper:Ly,CanvasTexture:nv,CapsuleGeometry:Rc,CatmullRomCurve3:tp,CircleGeometry:Pc,Clock:el,ColorKeyframeTrack:au,CompressedArrayTexture:ev,CompressedCubeTexture:tv,CompressedTexture:Ic,CompressedTextureLoader:Fv,ConeGeometry:co,Controls:ky,CubeCamera:Td,CubeTextureLoader:zv,CubicBezierCurve:Zh,CubicBezierCurve3:ip,CubicInterpolant:wp,CullFaceFrontBack:o0,Curve:zn,CurvePath:sp,CylinderGeometry:ao,Cylindrical:xy,DataTextureLoader:kv,DataUtils:M_,DecrementStencilOp:b0,DecrementWrapStencilOp:S0,DefaultLoadingManager:Ep,DetachedBindMode:Gf,DirectionalLight:jc,DirectionalLightHelper:Dy,DiscreteInterpolant:Sp,DodecahedronGeometry:Dc,DynamicCopyUsage:z0,DynamicDrawUsage:L0,DynamicReadUsage:B0,EdgesGeometry:$d,EllipseCurve:Bc,EqualStencilFunc:C0,ExtrudeGeometry:Hc,FileLoader:An,Float16BufferAttribute:D_,Fog:lc,FogExp2:cc,FramebufferTexture:$_,FrustumArray:yc,GLBufferAttribute:my,GLSL1:V0,GreaterEqualStencilFunc:D0,GreaterStencilFunc:R0,GridHelper:Ry,Group:Kn,HemisphereLight:hu,HemisphereLightHelper:Iy,IcosahedronGeometry:Gc,ImageBitmapLoader:Up,ImageLoader:_o,ImageUtils:hd,IncrementStencilOp:A0,IncrementWrapStencilOp:w0,InstancedBufferAttribute:Ji,InstancedBufferGeometry:Pp,InstancedInterleavedBuffer:py,InstancedMesh:_c,Int16BufferAttribute:R_,Int32BufferAttribute:P_,Int8BufferAttribute:T_,InterleavedBuffer:os,InterleavedBufferAttribute:fi,Interpolant:_s,InterpolateDiscrete:Fr,InterpolateLinear:zr,InterpolateSmooth:Ua,InterpolationSamplingMode:W0,InterpolationSamplingType:G0,InvertStencilOp:M0,KeepStencilOp:Xi,KeyframeTrack:Pn,LOD:Ld,LatheGeometry:Wc,LessEqualStencilFunc:I0,LessStencilFunc:T0,Light:Di,LightProbe:Rp,Line:di,Line3:Sy,LineBasicMaterial:qt,LineCurve:Yh,LineCurve3:rp,LineDashedMaterial:Ap,LineLoop:Fh,LineSegments:In,LinearInterpolant:ou,LinearMipMapLinearFilter:u0,LinearMipMapNearestFilter:h0,Loader:Jt,LoaderUtils:Li,LoadingManager:cu,LoopOnce:Wf,LoopPingPong:Xf,LoopRepeat:qf,MOUSE:zi,Material:zt,MaterialLoader:Jc,MathUtils:ka,Matrix2:Su,MeshLambertMaterial:yp,MeshMatcapMaterial:xp,MeshNormalMaterial:vp,MeshPhongMaterial:gp,MeshPhysicalMaterial:Rn,MeshStandardMaterial:gs,MeshToonMaterial:_p,NearestMipMapLinearFilter:l0,NearestMipMapNearestFilter:c0,NeverStencilFunc:E0,NoNormalPacking:g0,NormalAnimationBlendMode:Ba,NormalGAPacking:v0,NormalRGPacking:_0,NotEqualStencilFunc:P0,NumberKeyframeTrack:ar,Object3D:ct,ObjectLoader:Wv,OctahedronGeometry:go,Path:zc,PlaneHelper:By,PointLight:pu,PointLightHelper:Ty,Points:kh,PointsMaterial:Ec,PolarGridHelper:Py,PolyhedronGeometry:Pi,PositionalAudio:jv,PropertyBinding:lt,PropertyMixer:Vp,QuadraticBezierCurve:Qh,QuadraticBezierCurve3:Kh,Quaternion:wt,QuaternionKeyframeTrack:cr,QuaternionLinearInterpolant:Mp,RGBADepthPacking:d0,RGBDepthPacking:p0,RGBIntegerFormat:f0,RGDepthPacking:m0,Ray:Kr,Raycaster:gy,RectAreaLight:Ip,RenderTarget:ch,RenderTarget3D:uy,ReplaceStencilOp:x0,RingGeometry:qc,Scene:Ch,ShadowMaterial:mp,Shape:nr,ShapeGeometry:Xc,ShapePath:zy,ShapeUtils:kn,Skeleton:no,SkeletonHelper:Ey,SkinnedMesh:Lh,Source:wi,Sphere:Pt,SphereGeometry:ms,Spherical:yy,SphericalHarmonics3:gu,SplineCurve:jh,SpotLight:du,SpotLightHelper:My,Sprite:Pd,SpriteMaterial:Ih,StaticCopyUsage:F0,StaticDrawUsage:kr,StaticReadUsage:U0,StereoCamera:Zv,StreamCopyUsage:k0,StreamDrawUsage:N0,StreamReadUsage:O0,StringKeyframeTrack:lr,TOUCH:s0,TetrahedronGeometry:Zc,TextureLoader:lu,TextureUtils:qy,Timer:_y,TimestampQuery:H0,TorusGeometry:Yc,TorusKnotGeometry:Qc,Triangle:hn,TriangleFanDrawMode:Oa,TriangleStripDrawMode:eh,TrianglesDrawMode:Zf,TubeGeometry:Kc,UVMapping:Qo,Uint8BufferAttribute:C_,Uint8ClampedBufferAttribute:I_,Uniform:bu,UniformsGroup:dy,VectorKeyframeTrack:hr,VideoFrameTexture:J_,VideoTexture:jd,WebGL3DRenderTarget:m_,WebGLArrayRenderTarget:p_,WebGPUCoordinateSystem:Vr,WireframeGeometry:eu,WrapAroundEnding:Hs,ZeroCurvatureEnding:Wi,ZeroSlopeEnding:qi,ZeroStencilOp:y0,getConsoleFunction:Z0,setConsoleFunction:X0},Symbol.toStringTag,{value:"Module"}));var fl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ow=function(e){return aw(e)&&!cw(e)};function aw(r){return!!r&&typeof r=="object"}function cw(r){var e=Object.prototype.toString.call(r);return e==="[object RegExp]"||e==="[object Date]"||uw(r)}var lw=typeof Symbol=="function"&&Symbol.for,hw=lw?Symbol.for("react.element"):60103;function uw(r){return r.$$typeof===hw}function fw(r){return Array.isArray(r)?[]:{}}function Ao(r,e){return e.clone!==!1&&e.isMergeableObject(r)?Ss(fw(r),r,e):r}function dw(r,e,t){return r.concat(e).map(function(n){return Ao(n,t)})}function pw(r,e){if(!e.customMerge)return Ss;var t=e.customMerge(r);return typeof t=="function"?t:Ss}function mw(r){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r).filter(function(e){return Object.propertyIsEnumerable.call(r,e)}):[]}function Im(r){return Object.keys(r).concat(mw(r))}function Rm(r,e){try{return e in r}catch{return!1}}function gw(r,e){return Rm(r,e)&&!(Object.hasOwnProperty.call(r,e)&&Object.propertyIsEnumerable.call(r,e))}function _w(r,e,t){var n={};return t.isMergeableObject(r)&&Im(r).forEach(function(i){n[i]=Ao(r[i],t)}),Im(e).forEach(function(i){gw(r,i)||(Rm(r,i)&&t.isMergeableObject(e[i])?n[i]=pw(i,t)(r[i],e[i],t):n[i]=Ao(e[i],t))}),n}function Ss(r,e,t){t=t||{},t.arrayMerge=t.arrayMerge||dw,t.isMergeableObject=t.isMergeableObject||ow,t.cloneUnlessOtherwiseSpecified=Ao;var n=Array.isArray(e),i=Array.isArray(r),s=n===i;return s?n?t.arrayMerge(r,e,t):_w(r,e,t):Ao(e,t)}Ss.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(n,i){return Ss(n,i,t)},{})};var vw=Ss,yw=vw;const xw=`
|
|
4020
4020
|
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAYAAACAvzbMAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAGtWSURBVHhe7Z2LkiQ7jlx3JP3/H0uj9dSghevteJGMzMiqOGYwAO5g5OMWya2ulfa/Hh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHt7Nv/6THx5+DP/+979v+XP9r3/969//KR8efgTPBfLwVdz1cjjFc8k8fBPPBfJwS376RTHluVge7sizSR8+znNZrPFcKg+f5tm4D2/lCy6L6v3d+tB+LpWHd/JcIA+X8oEL4+4/02894J8L5eFKngvk4TgXXxo//Wf20gP/uVAeTvJcIA/bXHRhPD+b/+T4wf9cJg+7PJv0YYnDl8bVP4ef+jm/+oA+9vznMnlY4blAHtocvDTu9pxPc/LwPvKs50J56PBcIA8phy6N3Wf81p/TE4f41jOei+Qh47lAHv7iwKWxuv6Kn8dP/4xfcQCvPvO5TB6O8lwgDy82L41PXRg/5ed392B++4XyXCYP4LlAfjkbF8fKune+VodTz73qMN157nTt0ms9F8nv5qqN+XBj3nhpXD3PfMvP8+6he/Xl8FwmDy2+ZcM9HGDx4pismT7/6vlVotd51wF5pwti/Jmfi+T38K4N+fBBL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ZwPLQ5dJuBuz7kLJw/p59J4eAvPBfIw5uBlAq76Gbzbz/ZVB/Kx5z6XxsOU5wJ52OLwZWI8P5ea4wf8c2k87PBs1IejXHShGL/p5/WSg/25MB5O8lwgD5dy8YXi+baf5bcd5M+l8XAVzwXy8FbeeKFUnH4ftzmknwvj4V08F8jDR7nRhfKVPJfFwyd5Nu/D7XguFc1zWTzcjWejPnwNv+VieS6Kh2/huUAefgzfcsE8F8TDT+G5QB5+PTsXz3MZPDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8rPBf//V/AXz1ggk1Y/LnAAAAAElFTkSuQmCC
|
|
4021
|
-
`;class Aw{constructor(e){$(this,"size",84);$(this,"padding",4);$(this,"bubbleSizePrimary",8);$(this,"bubbleSizeSecondary",6);$(this,"lineWidth",2);$(this,"fontSize","12px");$(this,"fontFamily","arial");$(this,"fontWeight","bold");$(this,"fontColor","#222222");$(this,"className","gizmo-axis-canvas");$(this,"colorX","#f73c3c");$(this,"colorY","#6ccb26");$(this,"colorZ","#178cf0");$(this,"colorXSub","#942424");$(this,"colorYSub","#417a17");$(this,"colorZSub","#0e5490");this.size=e?.size??this.size,this.padding=e?.padding??this.padding,this.bubbleSizePrimary=e?.bubbleSizePrimary??this.bubbleSizePrimary,this.bubbleSizeSecondary=e?.bubbleSizeSecondary??this.bubbleSizeSecondary,this.lineWidth=e?.lineWidth??this.lineWidth,this.fontSize=e?.fontSize??this.fontSize,this.fontFamily=e?.fontFamily??this.fontFamily,this.fontWeight=e?.fontWeight??this.fontWeight,this.fontColor=e?.fontColor??this.fontColor,this.className=e?.className??this.className,this.colorX=e?.colorX??this.colorX,this.colorY=e?.colorY??this.colorY,this.colorZ=e?.colorZ??this.colorZ,this.colorXSub=e?.colorXSub??this.colorXSub,this.colorYSub=e?.colorYSub??this.colorYSub,this.colorZSub=e?.colorZSub??this.colorZSub}}const Pm={canvas:{id:void 0,resizeDelay:200},camera:{orthographic:!1,allowedMovement:new U(1,1,1),allowedRotation:new he(1,1),near:.01,far:15e3,fov:50,zoom:1,forward:new U(0,-.707,.707),controls:{orbit:!0,rotateSpeed:1,orbitSpeed:1,moveSpeed:1},gizmo:{enable:!1,size:.01,color:new xe(16777215),opacity:.5,opacityAlways:.125}},background:{color:new xe("#96999f")},groundPlane:{visible:!0,encoding:"base64",texture:xw,opacity:1,color:new xe(16777215),size:5},skylight:{skyColor:new xe().setHSL(.6,1,.6),groundColor:new xe().setHSL(.095,1,.75),intensity:.8},ambientLight:{color:new xe(16777215),intensity:.5},sunLights:[{position:new U(-45,40,-23),color:new xe().setHSL(.1,1,.95),intensity:.8},{position:new U(45,40,23),color:new xe().setHSL(.1,1,.95),intensity:.2}],rendering:{onDemand:!0,toneMapping:Yo,toneMappingExposure:1}};function bw(r){return r instanceof xe||r instanceof U||r instanceof he||r instanceof wt||r instanceof Zt||r instanceof We}function Ar(r){if(r instanceof xe)return r;if(r&&typeof r=="object"&&"r"in r&&"g"in r&&"b"in r){const e=r;return new xe(e.r,e.g,e.b)}return new xe(1,1,1)}function Fu(r){if(r instanceof U)return r;if(r&&typeof r=="object"&&"x"in r&&"y"in r&&"z"in r){const e=r;return new U(e.x,e.y,e.z)}return new U}function ww(r){if(r instanceof he)return r;if(r&&typeof r=="object"&&"x"in r&&"y"in r){const e=r;return new he(e.x,e.y)}return new he}function Sw(r){return r.camera.allowedMovement=Fu(r.camera.allowedMovement),r.camera.allowedRotation=ww(r.camera.allowedRotation),r.camera.forward=Fu(r.camera.forward),r.camera.gizmo.color=Ar(r.camera.gizmo.color),r.background.color=Ar(r.background.color),r.groundPlane.color=Ar(r.groundPlane.color),r.skylight.skyColor=Ar(r.skylight.skyColor),r.skylight.groundColor=Ar(r.skylight.groundColor),r.ambientLight.color=Ar(r.ambientLight.color),r.sunLights=r.sunLights.map(e=>({...e,position:Fu(e.position),color:Ar(e.color)})),r}function Dm(r){if(!r)return Pm;const e=yw(Pm,r,{isMergeableObject:t=>bw(t)?!1:t!==null&&typeof t=="object"&&!Array.isArray(t)});return Sw(e)}function Mw(r,e,t){return Math.max(e,Math.min(t,r))}var Ms={},bo={},br={},wr={},wo={};Object.defineProperty(wo,"__esModule",{value:!0}),wo.DispatcherWrapper=void 0;class Ew{constructor(e){this._subscribe=t=>e.subscribe(t),this._unsubscribe=t=>e.unsubscribe(t),this._one=t=>e.one(t),this._has=t=>e.has(t),this._clear=()=>e.clear(),this._count=()=>e.count,this._onSubscriptionChange=()=>e.onSubscriptionChange}get onSubscriptionChange(){return this._onSubscriptionChange()}get count(){return this._count()}subscribe(e){return this._subscribe(e)}sub(e){return this.subscribe(e)}unsubscribe(e){this._unsubscribe(e)}unsub(e){this.unsubscribe(e)}one(e){return this._one(e)}has(e){return this._has(e)}clear(){this._clear()}}wo.DispatcherWrapper=Ew;var So={};Object.defineProperty(So,"__esModule",{value:!0}),So.Subscription=void 0;class Tw{constructor(e,t){this.handler=e,this.isOnce=t,this.isExecuted=!1}execute(e,t,n){if(!this.isOnce||!this.isExecuted){this.isExecuted=!0;var i=this.handler;e?setTimeout(()=>{i.apply(t,n)},1):i.apply(t,n)}}}So.Subscription=Tw;var Es={};Object.defineProperty(Es,"__esModule",{value:!0}),Es.EventManagement=void 0;class Cw{constructor(e){this.unsub=e,this.propagationStopped=!1}stopPropagation(){this.propagationStopped=!0}}Es.EventManagement=Cw,Object.defineProperty(wr,"__esModule",{value:!0}),wr.SubscriptionChangeEventDispatcher=wr.DispatcherBase=void 0;const Iw=wo,Rw=So,Pw=Es;class Lm{constructor(){this._subscriptions=new Array}get count(){return this._subscriptions.length}get onSubscriptionChange(){return this._onSubscriptionChange==null&&(this._onSubscriptionChange=new Nm),this._onSubscriptionChange.asEvent()}subscribe(e){return e&&(this._subscriptions.push(this.createSubscription(e,!1)),this.triggerSubscriptionChange()),()=>{this.unsubscribe(e)}}sub(e){return this.subscribe(e)}one(e){return e&&(this._subscriptions.push(this.createSubscription(e,!0)),this.triggerSubscriptionChange()),()=>{this.unsubscribe(e)}}has(e){return e?this._subscriptions.some(t=>t.handler==e):!1}unsubscribe(e){if(!e)return;let t=!1;for(let n=0;n<this._subscriptions.length;n++)if(this._subscriptions[n].handler==e){this._subscriptions.splice(n,1),t=!0;break}t&&this.triggerSubscriptionChange()}unsub(e){this.unsubscribe(e)}_dispatch(e,t,n){for(let i of[...this._subscriptions]){let s=new Pw.EventManagement(()=>this.unsub(i.handler)),o=Array.prototype.slice.call(n);if(o.push(s),i.execute(e,t,o),this.cleanup(i),!e&&s.propagationStopped)return{propagationStopped:!0}}return e?null:{propagationStopped:!1}}createSubscription(e,t){return new Rw.Subscription(e,t)}cleanup(e){let t=!1;if(e.isOnce&&e.isExecuted){let n=this._subscriptions.indexOf(e);n>-1&&(this._subscriptions.splice(n,1),t=!0)}t&&this.triggerSubscriptionChange()}asEvent(){return this._wrap==null&&(this._wrap=new Iw.DispatcherWrapper(this)),this._wrap}clear(){this._subscriptions.length!=0&&(this._subscriptions.splice(0,this._subscriptions.length),this.triggerSubscriptionChange())}triggerSubscriptionChange(){this._onSubscriptionChange!=null&&this._onSubscriptionChange.dispatch(this.count)}}wr.DispatcherBase=Lm;class Nm extends Lm{dispatch(e){this._dispatch(!1,this,arguments)}}wr.SubscriptionChangeEventDispatcher=Nm;var Mo={};Object.defineProperty(Mo,"__esModule",{value:!0}),Mo.DispatchError=void 0;class Dw extends Error{constructor(e){super(e)}}Mo.DispatchError=Dw;var dl={};Object.defineProperty(dl,"__esModule",{value:!0}),dl.EventListBase=void 0;class Lw{constructor(){this._events={}}get(e){let t=this._events[e];return t||(t=this.createDispatcher(),this._events[e]=t,t)}remove(e){delete this._events[e]}}dl.EventListBase=Lw;var pl={};Object.defineProperty(pl,"__esModule",{value:!0}),pl.HandlingBase=void 0;class Nw{constructor(e){this.events=e}one(e,t){this.events.get(e).one(t)}has(e,t){return this.events.get(e).has(t)}subscribe(e,t){this.events.get(e).subscribe(t)}sub(e,t){this.subscribe(e,t)}unsubscribe(e,t){this.events.get(e).unsubscribe(t)}unsub(e,t){this.unsubscribe(e,t)}}pl.HandlingBase=Nw;var ml={},Eo={};Object.defineProperty(Eo,"__esModule",{value:!0}),Eo.PromiseSubscription=void 0;class Uw{constructor(e,t){this.handler=e,this.isOnce=t,this.isExecuted=!1}async execute(e,t,n){if(!this.isOnce||!this.isExecuted){this.isExecuted=!0;var i=this.handler;if(e){setTimeout(()=>{i.apply(t,n)},1);return}await i.apply(t,n)}}}Eo.PromiseSubscription=Uw,Object.defineProperty(ml,"__esModule",{value:!0}),ml.PromiseDispatcherBase=void 0;const Bw=Eo,Ow=Es,Fw=wr,zw=Mo;class kw extends Fw.DispatcherBase{_dispatch(e,t,n){throw new zw.DispatchError("_dispatch not supported. Use _dispatchAsPromise.")}createSubscription(e,t){return new Bw.PromiseSubscription(e,t)}async _dispatchAsPromise(e,t,n){for(let i of[...this._subscriptions]){let s=new Ow.EventManagement(()=>this.unsub(i.handler)),o=Array.prototype.slice.call(n);if(o.push(s),await i.execute(e,t,o),this.cleanup(i),!e&&s.propagationStopped)return{propagationStopped:!0}}return e?null:{propagationStopped:!1}}}ml.PromiseDispatcherBase=kw,function(r){/*!
|
|
4021
|
+
`;class Aw{constructor(e){$(this,"size",84);$(this,"padding",4);$(this,"bubbleSizePrimary",8);$(this,"bubbleSizeSecondary",6);$(this,"lineWidth",2);$(this,"fontSize","12px");$(this,"fontFamily","arial");$(this,"fontWeight","bold");$(this,"fontColor","#222222");$(this,"className","gizmo-axis-canvas");$(this,"colorX","#f73c3c");$(this,"colorY","#6ccb26");$(this,"colorZ","#178cf0");$(this,"colorXSub","#942424");$(this,"colorYSub","#417a17");$(this,"colorZSub","#0e5490");this.size=e?.size??this.size,this.padding=e?.padding??this.padding,this.bubbleSizePrimary=e?.bubbleSizePrimary??this.bubbleSizePrimary,this.bubbleSizeSecondary=e?.bubbleSizeSecondary??this.bubbleSizeSecondary,this.lineWidth=e?.lineWidth??this.lineWidth,this.fontSize=e?.fontSize??this.fontSize,this.fontFamily=e?.fontFamily??this.fontFamily,this.fontWeight=e?.fontWeight??this.fontWeight,this.fontColor=e?.fontColor??this.fontColor,this.className=e?.className??this.className,this.colorX=e?.colorX??this.colorX,this.colorY=e?.colorY??this.colorY,this.colorZ=e?.colorZ??this.colorZ,this.colorXSub=e?.colorXSub??this.colorXSub,this.colorYSub=e?.colorYSub??this.colorYSub,this.colorZSub=e?.colorZSub??this.colorZSub}}const Pm={canvas:{id:void 0,resizeDelay:200},camera:{orthographic:!1,allowedMovement:new U(1,1,1),allowedRotation:new he(1,1),near:.01,far:15e3,fov:50,zoom:1,forward:new U(0,-.707,.707),controls:{orbit:!0,rotateSpeed:1,orbitSpeed:1,moveSpeed:1},gizmo:{enable:!1,size:.01,color:new xe(16777215),opacity:.5,opacityAlways:.125}},background:{color:new xe("#96999f")},groundPlane:{visible:!0,encoding:"base64",texture:xw,opacity:1,color:new xe(16777215),size:5},skylight:{skyColor:new xe().setHSL(.6,1,.6),groundColor:new xe().setHSL(.095,1,.75),intensity:.8},ambientLight:{color:new xe(16777215),intensity:.5},sunLights:[{position:new U(-45,40,-23),color:new xe().setHSL(.1,1,.95),intensity:.8},{position:new U(45,40,23),color:new xe().setHSL(.1,1,.95),intensity:.2}],rendering:{onDemand:!0,toneMapping:Yo,toneMappingExposure:1}};function bw(r){return r instanceof xe||r instanceof U||r instanceof he||r instanceof wt||r instanceof Zt||r instanceof We}function Ar(r){if(r instanceof xe)return r;if(r&&typeof r=="object"&&"r"in r&&"g"in r&&"b"in r){const e=r;return new xe(e.r,e.g,e.b)}return new xe(1,1,1)}function Fu(r){if(r instanceof U)return r;if(r&&typeof r=="object"&&"x"in r&&"y"in r&&"z"in r){const e=r;return new U(e.x,e.y,e.z)}return new U}function ww(r){if(r instanceof he)return r;if(r&&typeof r=="object"&&"x"in r&&"y"in r){const e=r;return new he(e.x,e.y)}return new he}function Sw(r){return r.camera.allowedMovement=Fu(r.camera.allowedMovement),r.camera.allowedRotation=ww(r.camera.allowedRotation),r.camera.forward=Fu(r.camera.forward),r.camera.gizmo.color=Ar(r.camera.gizmo.color),r.background.color!==null&&r.background.color!==void 0&&(r.background.color=Ar(r.background.color)),r.groundPlane.color=Ar(r.groundPlane.color),r.skylight.skyColor=Ar(r.skylight.skyColor),r.skylight.groundColor=Ar(r.skylight.groundColor),r.ambientLight.color=Ar(r.ambientLight.color),r.sunLights=r.sunLights.map(e=>({...e,position:Fu(e.position),color:Ar(e.color)})),r}function Dm(r){if(!r)return Pm;const e=yw(Pm,r,{isMergeableObject:t=>bw(t)?!1:t!==null&&typeof t=="object"&&!Array.isArray(t)});return Sw(e)}function Mw(r,e,t){return Math.max(e,Math.min(t,r))}var Ms={},bo={},br={},wr={},wo={};Object.defineProperty(wo,"__esModule",{value:!0}),wo.DispatcherWrapper=void 0;class Ew{constructor(e){this._subscribe=t=>e.subscribe(t),this._unsubscribe=t=>e.unsubscribe(t),this._one=t=>e.one(t),this._has=t=>e.has(t),this._clear=()=>e.clear(),this._count=()=>e.count,this._onSubscriptionChange=()=>e.onSubscriptionChange}get onSubscriptionChange(){return this._onSubscriptionChange()}get count(){return this._count()}subscribe(e){return this._subscribe(e)}sub(e){return this.subscribe(e)}unsubscribe(e){this._unsubscribe(e)}unsub(e){this.unsubscribe(e)}one(e){return this._one(e)}has(e){return this._has(e)}clear(){this._clear()}}wo.DispatcherWrapper=Ew;var So={};Object.defineProperty(So,"__esModule",{value:!0}),So.Subscription=void 0;class Tw{constructor(e,t){this.handler=e,this.isOnce=t,this.isExecuted=!1}execute(e,t,n){if(!this.isOnce||!this.isExecuted){this.isExecuted=!0;var i=this.handler;e?setTimeout(()=>{i.apply(t,n)},1):i.apply(t,n)}}}So.Subscription=Tw;var Es={};Object.defineProperty(Es,"__esModule",{value:!0}),Es.EventManagement=void 0;class Cw{constructor(e){this.unsub=e,this.propagationStopped=!1}stopPropagation(){this.propagationStopped=!0}}Es.EventManagement=Cw,Object.defineProperty(wr,"__esModule",{value:!0}),wr.SubscriptionChangeEventDispatcher=wr.DispatcherBase=void 0;const Iw=wo,Rw=So,Pw=Es;class Lm{constructor(){this._subscriptions=new Array}get count(){return this._subscriptions.length}get onSubscriptionChange(){return this._onSubscriptionChange==null&&(this._onSubscriptionChange=new Nm),this._onSubscriptionChange.asEvent()}subscribe(e){return e&&(this._subscriptions.push(this.createSubscription(e,!1)),this.triggerSubscriptionChange()),()=>{this.unsubscribe(e)}}sub(e){return this.subscribe(e)}one(e){return e&&(this._subscriptions.push(this.createSubscription(e,!0)),this.triggerSubscriptionChange()),()=>{this.unsubscribe(e)}}has(e){return e?this._subscriptions.some(t=>t.handler==e):!1}unsubscribe(e){if(!e)return;let t=!1;for(let n=0;n<this._subscriptions.length;n++)if(this._subscriptions[n].handler==e){this._subscriptions.splice(n,1),t=!0;break}t&&this.triggerSubscriptionChange()}unsub(e){this.unsubscribe(e)}_dispatch(e,t,n){for(let i of[...this._subscriptions]){let s=new Pw.EventManagement(()=>this.unsub(i.handler)),o=Array.prototype.slice.call(n);if(o.push(s),i.execute(e,t,o),this.cleanup(i),!e&&s.propagationStopped)return{propagationStopped:!0}}return e?null:{propagationStopped:!1}}createSubscription(e,t){return new Rw.Subscription(e,t)}cleanup(e){let t=!1;if(e.isOnce&&e.isExecuted){let n=this._subscriptions.indexOf(e);n>-1&&(this._subscriptions.splice(n,1),t=!0)}t&&this.triggerSubscriptionChange()}asEvent(){return this._wrap==null&&(this._wrap=new Iw.DispatcherWrapper(this)),this._wrap}clear(){this._subscriptions.length!=0&&(this._subscriptions.splice(0,this._subscriptions.length),this.triggerSubscriptionChange())}triggerSubscriptionChange(){this._onSubscriptionChange!=null&&this._onSubscriptionChange.dispatch(this.count)}}wr.DispatcherBase=Lm;class Nm extends Lm{dispatch(e){this._dispatch(!1,this,arguments)}}wr.SubscriptionChangeEventDispatcher=Nm;var Mo={};Object.defineProperty(Mo,"__esModule",{value:!0}),Mo.DispatchError=void 0;class Dw extends Error{constructor(e){super(e)}}Mo.DispatchError=Dw;var dl={};Object.defineProperty(dl,"__esModule",{value:!0}),dl.EventListBase=void 0;class Lw{constructor(){this._events={}}get(e){let t=this._events[e];return t||(t=this.createDispatcher(),this._events[e]=t,t)}remove(e){delete this._events[e]}}dl.EventListBase=Lw;var pl={};Object.defineProperty(pl,"__esModule",{value:!0}),pl.HandlingBase=void 0;class Nw{constructor(e){this.events=e}one(e,t){this.events.get(e).one(t)}has(e,t){return this.events.get(e).has(t)}subscribe(e,t){this.events.get(e).subscribe(t)}sub(e,t){this.subscribe(e,t)}unsubscribe(e,t){this.events.get(e).unsubscribe(t)}unsub(e,t){this.unsubscribe(e,t)}}pl.HandlingBase=Nw;var ml={},Eo={};Object.defineProperty(Eo,"__esModule",{value:!0}),Eo.PromiseSubscription=void 0;class Uw{constructor(e,t){this.handler=e,this.isOnce=t,this.isExecuted=!1}async execute(e,t,n){if(!this.isOnce||!this.isExecuted){this.isExecuted=!0;var i=this.handler;if(e){setTimeout(()=>{i.apply(t,n)},1);return}await i.apply(t,n)}}}Eo.PromiseSubscription=Uw,Object.defineProperty(ml,"__esModule",{value:!0}),ml.PromiseDispatcherBase=void 0;const Bw=Eo,Ow=Es,Fw=wr,zw=Mo;class kw extends Fw.DispatcherBase{_dispatch(e,t,n){throw new zw.DispatchError("_dispatch not supported. Use _dispatchAsPromise.")}createSubscription(e,t){return new Bw.PromiseSubscription(e,t)}async _dispatchAsPromise(e,t,n){for(let i of[...this._subscriptions]){let s=new Ow.EventManagement(()=>this.unsub(i.handler)),o=Array.prototype.slice.call(n);if(o.push(s),await i.execute(e,t,o),this.cleanup(i),!e&&s.propagationStopped)return{propagationStopped:!0}}return e?null:{propagationStopped:!1}}}ml.PromiseDispatcherBase=kw,function(r){/*!
|
|
4022
4022
|
* Strongly Typed Events for TypeScript - Core
|
|
4023
4023
|
* https://github.com/KeesCBakker/StronlyTypedEvents/
|
|
4024
4024
|
* http://keestalkstech.com
|
|
@@ -4032,7 +4032,7 @@ data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAYAAACAvzbMAAAAAXNSR0IArs
|
|
|
4032
4032
|
*
|
|
4033
4033
|
* Copyright Kees C. Bakker / KeesTalksTech
|
|
4034
4034
|
* Released under the MIT license
|
|
4035
|
-
*/Object.defineProperty(r,"__esModule",{value:!0}),r.SignalList=r.SignalHandlingBase=r.SignalDispatcher=void 0;const e=bo;Object.defineProperty(r,"SignalDispatcher",{enumerable:!0,get:function(){return e.SignalDispatcher}});const t=gl;Object.defineProperty(r,"SignalHandlingBase",{enumerable:!0,get:function(){return t.SignalHandlingBase}});const n=To;Object.defineProperty(r,"SignalList",{enumerable:!0,get:function(){return n.SignalList}})}(Ms);class Yw{constructor(e){$(this,"camera");this.camera=e}applySettings(e){this.camera.fov=e.camera.fov,this.camera.zoom=e.camera.zoom,this.camera.near=e.camera.near,this.camera.far=e.camera.far,this.camera.updateProjectionMatrix()}updateProjection(e){this.camera.aspect=e,this.camera.updateProjectionMatrix()}frustrumSizeAt(e){const n=this.camera.position.distanceTo(e)*Math.tan(this.camera.fov/2*(Math.PI/180));return new he(n,n)}}class Qw{constructor(e){$(this,"camera");this.camera=e}applySettings(e){this.camera.zoom=e.camera.zoom,this.camera.near=-e.camera.far,this.camera.far=e.camera.far,this.camera.updateProjectionMatrix()}updateProjection(e,t){const n=Math.max(e.x,e.y);this.camera.left=-n*t,this.camera.right=n*t,this.camera.top=n,this.camera.bottom=-n,this.camera.updateProjectionMatrix()}}class Bm{constructor(e){$(this,"_camera");this._camera=e}move2(e,t){const n=t==="XY"?new U(-e.x,e.y,0):t==="XZ"?new U(-e.x,0,e.y):void 0;n&&this.move3(n)}move1(e,t){const n=new U(t==="X"?-e:0,t==="Y"?e:0,t==="Z"?e:0);this.move3(n)}orbitTowards(e){const t=this._camera.forward,n=t.clone().setY(0),i=e.clone().setY(0),s=n.angleTo(i)*Math.sign(n.cross(i).y),o=Math.asin(e.y)-Math.asin(t.y),a=new he(o,s);a.multiplyScalar(180/Math.PI),this.orbit(a)}frame(e,t){e instanceof Gt&&(e=e.getBoundingSphere(new Pt)),e instanceof Pt&&this.frameSphere(e,t??this._camera.forward)}frameSphere(e,t){const n=this._camera.camPerspective.camera.fov*Math.PI/180,i=e.radius*1.2/Math.tan(n/2),s=t.clone().multiplyScalar(-i).add(e.center);this.set(s,e.center)}}class Kw extends Bm{constructor(t,n){super(t);$(this,"_movement");$(this,"_clock",new el);$(this,"onProgress");$(this,"_duration",1);this._movement=n}init(t){this.cancel(),this._duration=t,this._clock.start(),this.animate()}cancel(){this._clock.stop(),this.onProgress=void 0}animate(){this._clock.running&&(this.update(),requestAnimationFrame(()=>this.animate()))}easeOutCubic(t){return 1-Math.pow(1-t,3)}update(){let t=this._clock.getElapsedTime()/this._duration;t=this.easeOutCubic(t),t>=1&&(t=1,this._clock.stop(),this.onProgress=void 0),this.onProgress?.(t)}move3(t){const n=t.clone();n.applyQuaternion(this._camera.quaternion);const i=this._camera.position.clone(),s=this._camera.position.clone().add(n),o=new U;this.onProgress=a=>{o.copy(i),o.lerp(s,a),this._movement.move3(o)}}rotate(t){const n=new Zt(0,0,0,"YXZ");n.setFromQuaternion(this._camera.quaternion),n.x+=t.x,n.y+=t.y,n.z=0;const i=Math.PI*.48;n.x=Math.max(-i,Math.min(i,n.x));const s=this._camera.quaternion.clone(),o=new wt().setFromEuler(n),a=new wt;this.onProgress=c=>{a.copy(s),a.slerp(o,c),this._movement.applyRotation(a)}}zoom(t){const n=this._camera.orbitDistance*t;this.setDistance(n)}setDistance(t){const n=this._camera.position.clone(),i=this._camera.target.clone().lerp(n,t/this._camera.orbitDistance);this.onProgress=s=>{this._camera.position.copy(n),this._camera.position.lerp(i,s)}}orbit(t){const n=this._camera.position.clone(),i=this._camera.target.clone(),s=new he;this.onProgress=o=>{s.set(0,0),s.lerp(t,o),this._movement.set(n,i),this._movement.orbit(s)}}target(t){const i=t.clone().sub(this._camera.position),s=this._camera.quaternion.clone(),o=new wt().setFromUnitVectors(new U(0,0,-1),i.normalize());this.onProgress=a=>{const c=s.clone().slerp(o,a);this._movement.applyRotation(c)}}reset(){this.set(this._camera._savedPosition,this._camera._savedTarget)}set(t,n){const i=n??this._camera.target,s=this._camera.position.clone(),o=this._camera.target.clone();this.onProgress=a=>{this._movement.set(s.clone().lerp(t,a),o.clone().lerp(i,a))}}}class jw extends Bm{zoom(e){const t=this._camera.orbitDistance*e;this.setDistance(t)}reset(){this.set(this._camera._savedPosition,this._camera._savedTarget)}setDistance(e){const t=this._camera.target.clone().sub(this._camera.forward.multiplyScalar(e));this.set(t,this._camera.target)}rotate(e){const t=e.clone().multiply(this._camera.allowedRotation),n=this.predictRotate(t);this.applyRotation(n)}applyRotation(e){this._camera.quaternion.copy(e);const t=this._camera.forward.multiplyScalar(this._camera.orbitDistance).add(this._camera.position);this.set(this._camera.position,t)}target(e){this.set(this._camera.position,e)}orbit(e){const t=e.clone().multiply(this._camera.allowedRotation),n=this.predictOrbit(t);this.set(n)}move3(e){const t=e.clone();t.applyQuaternion(this._camera.quaternion);const n=this.lockVector(t,new U),i=this._camera.position.clone().add(n),s=this._camera.target.clone().add(n);this.set(i,s)}set(e,t){const n=this.lockVector(e,this._camera.position);this._camera.position.copy(n),t=t??this._camera.target,this._camera.target.copy(t),this._camera.camPerspective.camera.lookAt(t),this._camera.camPerspective.camera.up.set(0,1,0)}lockVector(e,t){const n=this._camera.allowedMovement.x===0?t.x:e.x,i=this._camera.allowedMovement.y===0?t.y:e.y,s=this._camera.allowedMovement.z===0?t.z:e.z;return new U(n,i,s)}predictOrbit(e){const t=this.predictRotate(e),n=new U(0,0,1).applyQuaternion(t).multiplyScalar(this._camera.orbitDistance);return this._camera.target.clone().add(n)}predictRotate(e){const t=new Zt(0,0,0,"YXZ");t.setFromQuaternion(this._camera.quaternion),t.x+=e.x*Math.PI/180,t.y+=e.y*Math.PI/180,t.z=0;const n=Math.PI*.4999;return t.x=Math.max(-n,Math.min(n,t.x)),new wt().setFromEuler(t)}}class Jw{constructor(e,t){$(this,"camPerspective");$(this,"camOrthographic");$(this,"_viewport");$(this,"_lerp");$(this,"_movement");$(this,"_inputVelocity",new U);$(this,"_velocity",new U);$(this,"_speed",0);$(this,"_orthographic",!1);$(this,"_target",new U);$(this,"_lastPosition",new U);$(this,"_lastQuaternion",new wt);$(this,"_lastTarget",new U);$(this,"_savedPosition",new U(0,0,-5));$(this,"_savedTarget",new U(0,0,0));$(this,"_onValueChanged",new Ms.SignalDispatcher);$(this,"_hasMoved");$(this,"_onMoved",new Ms.SignalDispatcher);$(this,"_force",!1);$(this,"_allowedMovement",new U(1,1,1));$(this,"_allowedRotation",new he(1,1));$(this,"_defaultForward",new U(0,0,1));$(this,"_velocityBlendFactor",1e-4);$(this,"_moveSpeed",1);this.camPerspective=new Yw(new kt),this.camOrthographic=new Qw(new ur),this._movement=new jw(this),this._lerp=new Kw(this,this._movement),this._viewport=e,this.applySettings(t),this.do().orbitTowards(this._defaultForward),this.do().setDistance(-1e3)}get onValueChanged(){return this._onValueChanged.asEvent()}get hasMoved(){return this._hasMoved}get onMoved(){return this._onMoved.asEvent()}get allowedMovement(){return this._force?new U(1,1,1):this._allowedMovement}set allowedMovement(e){this._allowedMovement.copy(e),this._allowedMovement.x=this._allowedMovement.x===0?0:1,this._allowedMovement.y=this._allowedMovement.y===0?0:1,this._allowedMovement.z=this._allowedMovement.z===0?0:1}get allowedRotation(){return this._force?new he(1,1):this._allowedRotation}set allowedRotation(e){this._allowedRotation.copy(e),this._allowedRotation.x=this._allowedRotation.x===0?0:1,this._allowedRotation.y=this._allowedRotation.y===0?0:1}get defaultForward(){return this._defaultForward}set defaultForward(e){e.x===0&&e.y===0&&e.z===0?this._defaultForward.set(0,0,1):this._defaultForward.copy(e)}do(e=!1){return this._force=e,this._lerp.cancel(),this._movement}lerp(e=1,t=!1){return this.stop(),this._force=t,this._lerp.init(e),this._lerp}frustrumSizeAt(e){return this.camPerspective.frustrumSizeAt(e)}notifyMovement(){this._hasMoved=!0,this._onMoved.dispatch()}get three(){return this._orthographic?this.camOrthographic.camera:this.camPerspective.camera}get quaternion(){return this.camPerspective.camera.quaternion}get position(){return this.camPerspective.camera.position}get matrix(){return this.camPerspective.camera.updateMatrix(),this.camPerspective.camera.matrix}get forward(){return this.camPerspective.camera.getWorldDirection(new U)}get speed(){return this._speed}set speed(e){this._speed=Mw(e,-25,25),this._onValueChanged.dispatch()}get localVelocity(){const e=this._velocity.clone();return e.applyQuaternion(this.quaternion.clone().invert()),e.setZ(-e.z),e}set localVelocity(e){this._lerp.cancel(),this._inputVelocity.copy(e),this._inputVelocity.setZ(-this._inputVelocity.z)}stop(){this._inputVelocity.set(0,0,0),this._velocity.set(0,0,0)}get target(){return this._target}applySettings(e){this._defaultForward=new U().copy(e.camera.forward),this._orthographic=e.camera.orthographic,this.allowedMovement=e.camera.allowedMovement,this.allowedRotation=e.camera.allowedRotation,this.camPerspective.applySettings(e),this.camOrthographic.applySettings(e),this._moveSpeed=e.camera.controls.moveSpeed,this._onValueChanged.dispatch()}get orbitDistance(){return this.position.distanceTo(this._target)}save(){this._lerp.cancel(),this._savedPosition.copy(this.position),this._savedTarget.copy(this._target)}updateProjection(){const e=this._viewport.getAspectRatio();this.camPerspective.updateProjection(e);const t=this.camPerspective.frustrumSizeAt(this.target);this.camOrthographic.updateProjection(t,e)}get orthographic(){return this._orthographic}set orthographic(e){e!==this._orthographic&&(this._orthographic=e,this._onValueChanged.dispatch())}update(e){this.applyVelocity(e)&&this.updateOrthographic();const t=this.checkForMovement();return t&&(this.camOrthographic.camera.position.copy(this.position),this.camOrthographic.camera.quaternion.copy(this.quaternion)),this.updateProjection(),t}applyVelocity(e){if(this._inputVelocity.x===0&&this._inputVelocity.y===0&&this._inputVelocity.z===0&&this._velocity.x===0&&this._velocity.y===0&&this._velocity.z===0)return!1;const t=Math.pow(this._velocityBlendFactor,e),n=1-t;this._velocity.multiplyScalar(t);const i=this._inputVelocity.clone().multiplyScalar(n);if(this._velocity.add(i),this._velocity.lengthSq()<e/10)return this._velocity.set(0,0,0),!1;const s=this._velocity.clone().multiplyScalar(e*this.getVelocityMultiplier());return this.do().move3(s),!0}updateOrthographic(){if(this.orthographic){const t=this._lastTarget.clone().sub(this.position).dot(this.forward);this.target.copy(this.forward).multiplyScalar(t).add(this.position);const n=this._lastPosition.clone().sub(this._target),i=this.position.clone().sub(this._target);(n.dot(i)<0||i.lengthSq()<1)&&this.position.copy(this._target).add(this.forward.multiplyScalar(-1))}}getVelocityMultiplier(){const t=!this._lastQuaternion.equals(this.quaternion)?1:1.66;return Math.pow(1.25,this.speed)*this._moveSpeed*t*100}checkForMovement(){return this._hasMoved=!1,(!this._lastPosition.equals(this.position)||!this._lastQuaternion.equals(this.quaternion)||!this._lastTarget.equals(this._target))&&(this._hasMoved=!0,this._onMoved.dispatch()),this._lastPosition.copy(this.position),this._lastQuaternion.copy(this.quaternion),this._lastTarget.copy(this._target),this._hasMoved}}class zu{constructor(e){$(this,"_viewer");$(this,"_unregisters",[]);$(this,"reg",(e,t,n)=>{e.addEventListener(t,n),this._unregisters.push(()=>e.removeEventListener(t,n))});this._viewer=e}register(){this._unregisters.length>0||this.addListeners()}addListeners(){}unregister(){this._unregisters.forEach(e=>e()),this._unregisters.length=0,this.reset()}reset(){}}const At={KEY_0:48,KEY_1:49,KEY_2:50,KEY_3:51,KEY_4:52,KEY_5:53,KEY_6:54,KEY_7:55,KEY_8:56,KEY_9:57,KEY_LEFT:37,KEY_RIGHT:39,KEY_UP:38,KEY_DOWN:40,KEY_CTRL:17,KEY_SHIFT:16,KEY_ENTER:13,KEY_SPACE:32,KEY_TAB:9,KEY_ESCAPE:27,KEY_BACKSPACE:8,KEY_HOME:36,KEY_END:35,KEY_INSERT:45,KEY_DELETE:46,KEY_ALT:18,KEY_F1:112,KEY_F2:113,KEY_F3:114,KEY_F4:115,KEY_F5:116,KEY_F6:117,KEY_F7:118,KEY_F8:119,KEY_F9:120,KEY_F10:121,KEY_F11:122,KEY_F12:123,KEY_NUMPAD0:96,KEY_NUMPAD1:97,KEY_NUMPAD2:98,KEY_NUMPAD3:99,KEY_NUMPAD4:100,KEY_NUMPAD5:101,KEY_NUMPAD6:102,KEY_NUMPAD7:103,KEY_NUMPAD8:104,KEY_NUMPAD9:105,KEY_ADD:107,KEY_SUBTRACT:109,KEY_MULTIPLY:106,KEY_DIVIDE:111,KEY_SEPARATOR:108,KEY_DECIMAL:110,KEY_OEM_PLUS:187,KEY_OEM_MINUS:189,KEY_A:65,KEY_B:66,KEY_C:67,KEY_D:68,KEY_E:69,KEY_F:70,KEY_G:71,KEY_H:72,KEY_I:73,KEY_J:74,KEY_K:75,KEY_L:76,KEY_M:77,KEY_N:78,KEY_O:79,KEY_P:80,KEY_Q:81,KEY_R:82,KEY_S:83,KEY_T:84,KEY_U:85,KEY_V:86,KEY_W:87,KEY_X:88,KEY_Y:89,KEY_Z:90},$w=new Set(Object.values(At));class eS extends zu{constructor(){super(...arguments);$(this,"SHIFT_MULTIPLIER",3);$(this,"isUpPressed",!1);$(this,"isDownPressed",!1);$(this,"isLeftPressed",!1);$(this,"isRightPressed",!1);$(this,"isEPressed",!1);$(this,"isQPressed",!1);$(this,"isShiftPressed",!1);$(this,"isCtrlPressed",!1);$(this,"arrowsEnabled",!0)}addListeners(){this.reg(document,"keydown",t=>this.onKeyDown(t)),this.reg(document,"keyup",t=>this.onKeyUp(t)),this.reg(this._viewer.viewport.canvas,"focusout",()=>this.reset()),this.reg(window,"resize",()=>this.reset())}reset(){this.isUpPressed=!1,this.isDownPressed=!1,this.isLeftPressed=!1,this.isRightPressed=!1,this.isEPressed=!1,this.isQPressed=!1,this.isShiftPressed=!1,this.isCtrlPressed=!1,this.applyMove()}get camera(){return this._viewer.camera}onKeyUp(t){this.onKey(t,!1)}onKeyDown(t){this.onKey(t,!0)}onKey(t,n){switch(!n&&$w.has(t.keyCode)&&this._viewer.inputs.KeyAction(t.keyCode)&&t.preventDefault(),t.keyCode){case At.KEY_W:case At.KEY_UP:this.isUpPressed=n,this.applyMove(),t.preventDefault();break;case At.KEY_S:case At.KEY_DOWN:this.isDownPressed=n,this.applyMove(),t.preventDefault();break;case At.KEY_D:case At.KEY_RIGHT:this.isRightPressed=n,this.applyMove(),t.preventDefault();break;case At.KEY_A:case At.KEY_LEFT:this.isLeftPressed=n,this.applyMove(),t.preventDefault();break;case At.KEY_E:this.isEPressed=n,this.applyMove(),t.preventDefault();break;case At.KEY_Q:this.isQPressed=n,this.applyMove(),t.preventDefault();break;case At.KEY_SHIFT:this.isShiftPressed=n,this.applyMove(),t.preventDefault();break;case At.KEY_CTRL:this.isCtrlPressed=n,t.preventDefault();break}}applyMove(){const t=new U((this.isRightPressed?1:0)-(this.isLeftPressed?1:0),(this.isEPressed?1:0)-(this.isQPressed?1:0),(this.isUpPressed?1:0)-(this.isDownPressed?1:0)),n=this.isShiftPressed?this.SHIFT_MULTIPLIER:1;t.multiplyScalar(n),this.arrowsEnabled&&(this.camera.localVelocity=t)}}class tS extends zu{constructor(t){super(t);$(this,"TAP_DURATION_MS",500);$(this,"DOUBLE_TAP_DELAY_MS",500);$(this,"TAP_MAX_MOVE_PIXEL",5);$(this,"ZOOM_SPEED",1);$(this,"MOVE_SPEED",100);$(this,"rotateSpeed",1);$(this,"orbitSpeed",1);$(this,"_touch");$(this,"_touch1");$(this,"_touch2");$(this,"_touchStartTime");$(this,"_lastTapMs");$(this,"_touchStart");$(this,"reset",()=>{this._touch=this._touch1=this._touch2=this._touchStartTime=void 0});$(this,"onTap",t=>{const n=new Date().getTime();this._lastTapMs&&n-this._lastTapMs<this.DOUBLE_TAP_DELAY_MS,this._lastTapMs=new Date().getTime()});$(this,"onTouchStart",t=>{t.preventDefault(),!(!t||!t.touches||!t.touches.length)&&(this._touchStartTime=new Date().getTime(),t.touches.length===1?(this._touch=this.touchToVector(t.touches[0]),this._touch1=this._touch2=void 0):t.touches.length===2&&(this._touch1=this.touchToVector(t.touches[0]),this._touch2=this.touchToVector(t.touches[1]),this._touch=this.average(this._touch1,this._touch2)),this._touchStart=this._touch)});$(this,"onDrag",t=>{this._viewer.inputs.pointerActive==="orbit"?this.camera.do().orbit(this.toRotation(t,this.orbitSpeed)):this.camera.do().rotate(this.toRotation(t,this.rotateSpeed))});$(this,"onDoubleDrag",t=>{const n=t.clone().multiplyScalar(this.MOVE_SPEED);this.camera.do().move2(n,"XY")});$(this,"onPinchOrSpread",t=>{this._viewer.inputs.pointerActive==="orbit"?this.camera.do().zoom(1+t*this.ZOOM_SPEED):this.camera.do().move1(t*this.ZOOM_SPEED,"Z")});$(this,"onTouchMove",t=>{if(t.preventDefault(),!(!t||!t.touches||!t.touches.length)&&!!this._touch){if(t.touches.length===1){const n=this.touchToVector(t.touches[0]),i=this.viewport.getSize(),s=n.clone().sub(this._touch).multiply(new he(1/i.x,1/i.y));this._touch=n,this.onDrag(s);return}if(!(!this._touch1||!this._touch2)&&t.touches.length>=2){const n=this.touchToVector(t.touches[0]),i=this.touchToVector(t.touches[1]),s=this.average(n,i),o=this.viewport.getSize(),a=this._touch.clone().sub(s).multiply(new he(-1/o.x,-1/o.y)),c=n.distanceTo(i),l=this._touch1.distanceTo(this._touch2),h=Math.min(o.x,o.y),u=(c-l)/-h;this._touch=s,this._touch1=n,this._touch2=i,a.length()>Math.abs(u)?this.onDoubleDrag(a):this.onPinchOrSpread(u)}}});$(this,"onTouchEnd",t=>{if(this.isSingleTouch()&&this._touchStart&&this._touch){const n=new Date().getTime()-this._touchStartTime,i=this._touch.distanceTo(this._touchStart);n<this.TAP_DURATION_MS&&i<this.TAP_MAX_MOVE_PIXEL&&this.onTap(this._touch)}this.reset()});this.rotateSpeed=t.settings.camera.controls.rotateSpeed,this.orbitSpeed=t.settings.camera.controls.orbitSpeed}get camera(){return this._viewer.camera}get viewport(){return this._viewer.viewport}addListeners(){const t=this.viewport.canvas;this.reg(t,"touchstart",this.onTouchStart),this.reg(t,"touchend",this.onTouchEnd),this.reg(t,"touchmove",this.onTouchMove)}toRotation(t,n){const i=new he;return i.x=t.y,i.y=t.x,i.multiplyScalar(-180*n),i}isSingleTouch(){return this._touch!==void 0&&this._touchStartTime!==void 0&&this._touch1===void 0&&this._touch2===void 0}touchToVector(t){return new he(t.pageX,t.pageY)}average(t,n){return t.clone().lerp(n,.5)}}class nS extends zu{constructor(t){super(t);$(this,"_idleDelayMs",150);$(this,"zoomSpeed",1);$(this,"panSpeed",100);$(this,"rotateSpeed",1);$(this,"orbitSpeed",1);$(this,"_buttonDown");$(this,"_hasMouseMoved",!1);$(this,"_hasCameraMoved",!1);$(this,"_idleTimeout");$(this,"_idlePosition");$(this,"_lastPosition");$(this,"_downPosition");$(this,"reset",()=>{this._buttonDown=void 0,this._hasMouseMoved=!1,this._lastPosition=this._downPosition=void 0,clearTimeout(this._idleTimeout)});$(this,"onMouseOut",t=>{t.stopImmediatePropagation(),this._buttonDown=void 0,this._hasMouseMoved=!1,this._lastPosition=void 0,this.resetIdle()});$(this,"onCameraMoved",()=>{this.resetIdle(),this._hasCameraMoved=!0});$(this,"onMouseMove",t=>{t.stopImmediatePropagation(),this._lastPosition=new he(t.offsetX,t.offsetY),(!this._idlePosition||this._lastPosition.distanceTo(this._idlePosition)>5)&&this.resetIdle(),this._buttonDown&&this.onMouseDrag(t)});$(this,"onMouseDown",t=>{if(t.stopImmediatePropagation(),t.preventDefault(),this._buttonDown)return;this.inputs.ContextMenu(void 0),this._hasCameraMoved=!1,this._downPosition=new he(t.offsetX,t.offsetY),this._hasMouseMoved=!1,this.viewport.canvas.focus(),this._buttonDown=this.getButton(t);const n=this._buttonDown==="middle"?"pan":this._buttonDown==="right"?"look":void 0;this.inputs.pointerOverride=n});$(this,"onMouseWheel",t=>{t.preventDefault(),t.stopImmediatePropagation();const n=Math.sign(t.deltaY);if(t.ctrlKey)this.camera.speed-=n;else{const i=Math.pow(1.3,n);this.camera.lerp(.75).zoom(i)}});$(this,"onMouseUp",t=>{t.stopImmediatePropagation(),this.resetIdle(),this.getButton(t)!==this._buttonDown&&(t.preventDefault(),this._buttonDown&&(t.button===2&&!this._hasMouseMoved&&this.inputs.ContextMenu(new he(t.clientX,t.clientY)),this._buttonDown=void 0,this.inputs.pointerOverride=void 0))});this.rotateSpeed=t.settings.camera.controls.rotateSpeed,this.orbitSpeed=t.settings.camera.controls.orbitSpeed}get camera(){return this._viewer.camera}get viewport(){return this._viewer.viewport}get canvas(){return this.viewport.canvas}get inputs(){return this._viewer.inputs}addListeners(){this.reg(this.canvas,"mousedown",this.onMouseDown),this.reg(this.canvas,"wheel",this.onMouseWheel),this.reg(this.canvas,"mousemove",this.onMouseMove),this.reg(this.canvas,"mouseup",this.onMouseUp),this.reg(this.canvas,"mouseout",this.onMouseOut),this.reg(this.canvas,"contextmenu",t=>t.preventDefault()),this._unregisters.push(this.camera.onMoved.subscribe(()=>this.onCameraMoved()))}resetIdle(){this._idlePosition&&(this._idlePosition=void 0),clearTimeout(this._idleTimeout)}onMouseDrag(t){t.stopImmediatePropagation(),t.preventDefault();const n=t.movementX||t.mozMovementX||t.webkitMovementX||0,i=t.movementY||t.mozMovementY||t.webkitMovementY||0,s=this.viewport.getSize(),o=new he(n/s.x,i/s.y),a=new he(t.offsetX,t.offsetY);switch(this._hasMouseMoved=this._hasMouseMoved||this._downPosition&&this._downPosition?.distanceTo(a)>4,this._buttonDown){case"main":this.onMouseMainDrag(o);break;case"middle":this.onMouseMiddleDrag(o);break;case"right":this.onMouseRightDrag(o);break}}toRotation(t,n){const i=t.clone();return i.x=-t.y,i.y=-t.x,i.multiplyScalar(180*n),i}onMouseMainDrag(t){switch(this.inputs.pointerActive){case"orbit":this.camera.do().orbit(this.toRotation(t,this.orbitSpeed));break;case"look":this.camera.do().rotate(this.toRotation(t,this.rotateSpeed));break;case"pan":this.camera.do().move2(t.multiplyScalar(this.panSpeed),"XY");break;case"zoom":this.camera.do().zoom(1+t.y*this.zoomSpeed);break}}onMouseMiddleDrag(t){this.camera.do().move2(t.multiplyScalar(100),"XY")}onMouseRightDrag(t){this.camera.do().rotate(this.toRotation(t,this.rotateSpeed))}getButton(t){return t.buttons&1?"main":t.buttons&2?"right":t.buttons&4?"middle":void 0}getModifier(t){return t.ctrlKey?"ctrl":t.shiftKey?"shift":"none"}}var Om={},Ts={};Object.defineProperty(Ts,"__esModule",{value:!0}),Ts.SimpleEventDispatcher=void 0;const Fm=br;class iS extends Fm.DispatcherBase{constructor(){super()}dispatch(e){const t=this._dispatch(!1,this,arguments);if(t==null)throw new Fm.DispatchError("Got `null` back from dispatch.");return t}dispatchAsync(e){this._dispatch(!0,this,arguments)}asEvent(){return super.asEvent()}}Ts.SimpleEventDispatcher=iS;var _l={},Co={};Object.defineProperty(Co,"__esModule",{value:!0}),Co.SimpleEventList=void 0;const rS=br,sS=Ts;class oS extends rS.EventListBase{constructor(){super()}createDispatcher(){return new sS.SimpleEventDispatcher}}Co.SimpleEventList=oS,Object.defineProperty(_l,"__esModule",{value:!0}),_l.SimpleEventHandlingBase=void 0;const aS=br,cS=Co;class lS extends aS.HandlingBase{constructor(){super(new cS.SimpleEventList)}}_l.SimpleEventHandlingBase=lS;var vl={};Object.defineProperty(vl,"__esModule",{value:!0}),vl.NonUniformSimpleEventList=void 0;const hS=Ts;class uS{constructor(){this._events={}}get(e){if(this._events[e])return this._events[e];const t=this.createDispatcher();return this._events[e]=t,t}remove(e){delete this._events[e]}createDispatcher(){return new hS.SimpleEventDispatcher}}vl.NonUniformSimpleEventList=uS,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.NonUniformSimpleEventList=r.SimpleEventList=r.SimpleEventHandlingBase=r.SimpleEventDispatcher=void 0;const e=Ts;Object.defineProperty(r,"SimpleEventDispatcher",{enumerable:!0,get:function(){return e.SimpleEventDispatcher}});const t=_l;Object.defineProperty(r,"SimpleEventHandlingBase",{enumerable:!0,get:function(){return t.SimpleEventHandlingBase}});const n=vl;Object.defineProperty(r,"NonUniformSimpleEventList",{enumerable:!0,get:function(){return n.NonUniformSimpleEventList}});const i=Co;Object.defineProperty(r,"SimpleEventList",{enumerable:!0,get:function(){return i.SimpleEventList}})}(Om);class zm{constructor(e){$(this,"_viewer");this._viewer=e}onKeyAction(e){const t=this._viewer.camera;switch(e){case At.KEY_P:return t.orthographic=!t.orthographic,!0;case At.KEY_ADD:case At.KEY_OEM_PLUS:return t.speed+=1,!0;case At.KEY_SUBTRACT:case At.KEY_OEM_MINUS:return t.speed-=1,!0;case At.KEY_F8:case At.KEY_SPACE:return this._viewer.inputs.pointerActive=this._viewer.inputs.pointerFallback,!0;case At.KEY_HOME:return t.lerp(1).reset(),!0;case At.KEY_ESCAPE:return!0;case At.KEY_Z:case At.KEY_F:return t.lerp(1).frame("all"),!0;default:return!1}}}class fS{constructor(e){$(this,"_viewer");$(this,"_scheme");$(this,"touch");$(this,"mouse");$(this,"keyboard");$(this,"_pointerActive","orbit");$(this,"_pointerFallback","look");$(this,"_pointerOverride");$(this,"_onPointerModeChanged",new Ms.SignalDispatcher);$(this,"_onPointerOverrideChanged",new Ms.SignalDispatcher);$(this,"_onContextMenu",new Om.SimpleEventDispatcher);$(this,"unregisterAll",()=>{this.mouse.unregister(),this.keyboard.unregister(),this.touch.unregister()});this._viewer=e,this._scheme=new zm(e),this.keyboard=new eS(e),this.mouse=new nS(e),this.touch=new tS(e),this.pointerActive=e.settings.camera.controls.orbit?"orbit":"look",this._pointerFallback=e.settings.camera.controls.orbit?"look":"orbit"}get pointerFallback(){return this._pointerFallback}get pointerActive(){return this._pointerActive}get pointerOverride(){return this._pointerOverride}set pointerOverride(e){e!==this._pointerOverride&&(this._pointerOverride=e,this._onPointerOverrideChanged.dispatch())}set pointerActive(e){e!==this._pointerActive&&(e==="look"?this._pointerFallback="orbit":e==="orbit"&&(this._pointerFallback="look"),this._pointerActive=e,this._onPointerModeChanged.dispatch())}get onPointerModeChanged(){return this._onPointerModeChanged.asEvent()}get onPointerOverrideChanged(){return this._onPointerOverrideChanged.asEvent()}get onContextMenu(){return this._onContextMenu.asEvent()}get scheme(){return this._scheme}KeyAction(e){return this._scheme.onKeyAction(e)}ContextMenu(e){this._onContextMenu.dispatch(e)}registerAll(){this.keyboard.register(),this.mouse.register(),this.touch.register()}resetAll(){this.mouse.reset(),this.keyboard.reset(),this.touch.reset()}}class dS{constructor(){$(this,"mesh");$(this,"_source");$(this,"_size",1);$(this,"_geometry");$(this,"_material");$(this,"_texture");this._geometry=new rr,this._material=new un({transparent:!0,depthTest:!0,depthWrite:!1}),this.mesh=new St(this._geometry,this._material),this.mesh.renderOrder=-1}applyViewerSettings(e){this._size=e.groundPlane.size,this.mesh.visible=e.groundPlane.visible,this.applyTexture(e.groundPlane.encoding,e.groundPlane.texture),this._material.color.copy(e.groundPlane.color),this._material.opacity=e.groundPlane.opacity}adaptToContent(e){const t=e.getCenter(new U),n=new U(t.x,e.min.y-Math.abs(e.min.y)*.01,t.z);this.mesh.position.copy(n),this.mesh.quaternion.copy(new wt().setFromEuler(new Zt(1.5*Math.PI,0,0)));const s=(e?.getBoundingSphere(new Pt)?.radius??1)*this._size,o=new U(1,1,1).multiplyScalar(s);this.mesh.scale.copy(o)}applyTexture(e,t){if(t!==this._source&&(this._source=t,this._texture?.dispose(),this._texture=void 0,!(!t||!e))){if(e==="url"){const n=new lu;this._texture=n.load(t)}if(e==="base64"){const n=new Image;n.src=t;const i=new xt;this._texture=i,this._texture.image=n,n.onload=()=>{i.needsUpdate=!0}}if(!this._texture){console.error("Failed to load texture: "+t);return}this._material.map=this._texture}}dispose(){this._geometry?.dispose(),this._material?.dispose(),this._texture?.dispose(),this._texture=void 0}}class pS{constructor(e){$(this,"skyLight");$(this,"ambientLight");$(this,"sunLights");$(this,"_groundPlane");this._groundPlane=new dS,this.skyLight=new hu,this.ambientLight=new mu,this.sunLights=[],this.applySettings(e)}get groundPlane(){return this._groundPlane.mesh}loadGroundTexture(e,t){this._groundPlane.applyTexture(e,t)}getObjects(){return[this._groundPlane.mesh,this.skyLight,this.ambientLight,...this.sunLights]}applySettings(e){this._groundPlane.applyViewerSettings(e),this.skyLight.color.copy(e.skylight.skyColor),this.skyLight.groundColor.copy(e.skylight.groundColor),this.skyLight.intensity=e.skylight.intensity,this.ambientLight.color.copy(e.ambientLight.color),this.ambientLight.intensity=e.ambientLight.intensity;const t=e.sunLights.length;for(let n=0;n<t;n++){this.sunLights[n]||(this.sunLights[n]=new jc);const i=e.sunLights[n].color,s=e.sunLights[n].position,o=e.sunLights[n].intensity;i&&this.sunLights[n].color.copy(i),s&&this.sunLights[n].position.copy(s),o&&(this.sunLights[n].intensity=o)}}adaptToContent(e){this._groundPlane.adaptToContent(e)}dispose(){this.sunLights.forEach(e=>e.dispose()),this.skyLight.dispose(),this.ambientLight.dispose(),this._groundPlane.dispose()}}class mS{constructor(e,t,n,i){$(this,"_renderer");$(this,"_camera");$(this,"_inputs");$(this,"_size",1);$(this,"_fov",50);$(this,"_color",new xe("blue"));$(this,"_opacity",.2);$(this,"_opacityAlways",.5);$(this,"_fadeDurationMs",200);$(this,"_showDurationMs",1e3);$(this,"_box");$(this,"_wireframe");$(this,"_material");$(this,"_materialAlways");$(this,"_gizmos");$(this,"_disconnectCamera");$(this,"_timeout");$(this,"_fadeEnd",0);$(this,"_active",!0);$(this,"_animation",0);this._renderer=e,this._camera=t,this._inputs=n,this.applySettings(i),this.connect()}connect(){const e=this._inputs.onPointerModeChanged.subscribe(()=>this.onUpdate()),t=this._camera.onMoved.subscribe(()=>this.onUpdate()),n=this._camera.onValueChanged.subscribe(()=>this.onUpdate());this._disconnectCamera=()=>{e(),t(),n()}}onUpdate(){this.updateScale(),this.setPosition(this._camera.target),this.show(!0)}dispose(){cancelAnimationFrame(this._animation),clearTimeout(this._timeout),this._box?.dispose(),this._wireframe?.dispose(),this._material?.dispose(),this._materialAlways?.dispose(),this._disconnectCamera?.(),this._box=void 0,this._wireframe=void 0,this._material=void 0,this._materialAlways=void 0,this._disconnectCamera=void 0,this._gizmos&&(this._renderer.remove(this._gizmos),this._gizmos=void 0)}get enabled(){return this._active}set enabled(e){this._active=e}show(e=!0){!this._active||(this._gizmos||this.createGizmo(),clearTimeout(this._timeout),this._gizmos.visible=e,e&&(this._timeout=setTimeout(()=>this.fadeOut(),this._showDurationMs)))}fadeOut(e){const t=new Date().getTime();if(e||(this._fadeEnd=t+this._fadeDurationMs),t>this._fadeEnd)this._gizmos.visible=!1,this._material.opacity=this._opacity,this._materialAlways.opacity=this._opacityAlways;else{this._animation=requestAnimationFrame(()=>this.fadeOut(!0));const n=Math.pow((this._fadeEnd-t)/this._fadeDurationMs,4);this._material.opacity=ka.lerp(0,this._opacity,n),this._materialAlways.opacity=ka.lerp(0,this._opacityAlways,n)}this._renderer.needsUpdate=!0}setPosition(e){this._gizmos?.position.copy(e),this.updateScale()}setSize(e){this._size=e}setOpacity(e,t){this._opacity=e,this._opacityAlways=t,this._gizmos&&(this._material.opacity=e,this._materialAlways.opacity=t)}setColor(e){this._color=e,this._gizmos&&(this._material.color=e,this._materialAlways.color=e)}applySettings(e){this._active=e.camera.gizmo.enable,this._fov=e.camera.fov,this.setColor(e.camera.gizmo.color),this.setSize(e.camera.gizmo.size),this.setOpacity(e.camera.gizmo.opacity,e.camera.gizmo.opacityAlways)}updateScale(){if(!this._gizmos)return;const e=this._camera.frustrumSizeAt(this._gizmos.position),n=Math.min(e.x,e.y)*this._size;this._gizmos.scale.set(n,n,n)}createGizmo(){this._box=new ms(1),this._wireframe=new eu(this._box),this._wireframe.addGroup(0,1/0,0),this._wireframe.addGroup(0,1/0,1),this._material=new qt({depthTest:!0,opacity:this._opacity,color:this._color,transparent:!0}),this._materialAlways=new qt({depthTest:!1,opacity:this._opacityAlways,color:this._color,transparent:!0}),this._gizmos=new In(this._wireframe,[this._material,this._materialAlways]),this._renderer.add(this._gizmos),this.updateScale()}}const Cs=new U,km=new We,Vm=new We,Hm=new U,Gm=new U;class gS{constructor(e={}){const t=this;let n,i,s,o;const a={objects:new WeakMap},c=e.element!==void 0?e.element:document.createElement("div");c.style.overflow="hidden",this.domElement=c,this.sortObjects=!0,this.getSize=function(){return{width:n,height:i}},this.render=function(g,_){g.matrixWorldAutoUpdate===!0&&g.updateMatrixWorld(),_.parent===null&&_.matrixWorldAutoUpdate===!0&&_.updateMatrixWorld(),km.copy(_.matrixWorldInverse),Vm.multiplyMatrices(_.projectionMatrix,km),h(g,g,_),this.sortObjects&&d(g)},this.setSize=function(g,_){n=g,i=_,s=n/2,o=i/2,c.style.width=g+"px",c.style.height=_+"px"};function l(g){g.isCSS2DObject&&(g.element.style.display="none");for(let _=0,m=g.children.length;_<m;_++)l(g.children[_])}function h(g,_,m){if(g.visible===!1){l(g);return}if(g.isCSS2DObject){Cs.setFromMatrixPosition(g.matrixWorld),Cs.applyMatrix4(Vm);const p=Cs.z>=-1&&Cs.z<=1&&g.layers.test(m.layers)===!0,v=g.element;v.style.display=p===!0?"":"none",p===!0&&(g.onBeforeRender(t,_,m),v.style.transform="translate("+-100*g.center.x+"%,"+-100*g.center.y+"%)translate("+(Cs.x*s+s)+"px,"+(-Cs.y*o+o)+"px)",v.parentNode!==c&&c.appendChild(v),g.onAfterRender(t,_,m));const y={distanceToCameraSquared:u(m,g)};a.objects.set(g,y)}for(let p=0,v=g.children.length;p<v;p++)h(g.children[p],_,m)}function u(g,_){return Hm.setFromMatrixPosition(g.matrixWorld),Gm.setFromMatrixPosition(_.matrixWorld),Hm.distanceToSquared(Gm)}function f(g){const _=[];return g.traverseVisible(function(m){m.isCSS2DObject&&_.push(m)}),_}function d(g){const _=f(g).sort(function(p,v){if(p.renderOrder!==v.renderOrder)return v.renderOrder-p.renderOrder;const y=a.objects.get(p).distanceToCameraSquared,x=a.objects.get(v).distanceToCameraSquared;return y-x}),m=_.length;for(let p=0,v=_.length;p<v;p++)_[p].element.style.zIndex=m-p}}}class ku{constructor(e){$(this,"canvas");$(this,"text");$(this,"_unregisterResize");$(this,"_ownedCanvas");$(this,"_onResize",new Ms.SignalDispatcher);const[t,n]=ku.getOrCreateCanvas(e.canvas.id);this.canvas=t,this._ownedCanvas=n,this.watchResize(e.canvas.resizeDelay)}get onResize(){return this._onResize.asEvent()}static getOrCreateCanvas(e){let t=e?document.getElementById(e):void 0;return t?[t,!1]:(t=document.createElement("canvas"),t.className="ara3d-canvas",t.tabIndex=0,t.style.backgroundColor="black",document.body.appendChild(t),[t,!0])}createTextRenderer(){if(console.log("Creating text renderer"),!this.canvas.parentElement)throw new Error("Cannot create text renderer without a canvas");const e=this.getParentSize(),t=new gS;return t.setSize(e.x,e.y),this.text=t.domElement,this.text.className="ara3d-text-renderer",this.text.style.position="absolute",this.text.style.top="0px",this.text.style.pointerEvents="none",this.canvas.parentElement.append(this.text),t}dispose(){this._unregisterResize?.(),this._unregisterResize=void 0,this._ownedCanvas&&this.canvas.remove()}getParentSize(){return new he(this.canvas.parentElement?.clientWidth??this.canvas.clientWidth,this.canvas.parentElement?.clientHeight??this.canvas.clientHeight)}getSize(){return new he(this.canvas.clientWidth,this.canvas.clientHeight)}getAspectRatio(){const e=this.getParentSize();return e.x/e.y}ResizeToParent(){this._onResize.dispatch()}watchResize(e){let t;const n=()=>{t!==void 0&&(clearTimeout(t),t=void 0),t=setTimeout(()=>{t=void 0,this._onResize.dispatch()},e)};window.addEventListener("resize",n),this._unregisterResize=()=>window.removeEventListener("resize",n)}}class _S{constructor(e,t,n,i){$(this,"renderer");$(this,"antialias",!0);$(this,"scene");$(this,"viewport");$(this,"camera");$(this,"needsUpdate");$(this,"_lastSize",new he);$(this,"fitViewport",()=>{const e=this.viewport.getParentSize();if(e.x===this._lastSize.x&&e.y===this._lastSize.y)return;this._lastSize.copy(e);const t=1.5;this.renderer.setPixelRatio(Math.min(window.devicePixelRatio,t)),this.renderer.setSize(e.x,e.y),this.needsUpdate=!0});this.viewport=t,this.scene=e,this.camera=n,this.renderer=new Cm({canvas:t.canvas,antialias:!0,precision:"highp",alpha:!0,stencil:!1,powerPreference:"high-performance",logarithmicDepthBuffer:!0}),this.fitViewport(),this.viewport.onResize.subscribe(()=>this.fitViewport()),this.camera.onValueChanged.sub(()=>{this.needsUpdate=!0}),this.background=i.background.color,this.applyRenderingSettings(i)}applyRenderingSettings(e){this.renderer.toneMapping=e.rendering.toneMapping,this.renderer.toneMappingExposure=e.rendering.toneMappingExposure}dispose(){this.clear(),this.renderer.clear(),this.renderer.forceContextLoss(),this.renderer.dispose()}get background(){return this.scene.background}set background(e){this.scene.background=e,this.needsUpdate=!0}render(){!this.needsUpdate&&!this.camera.hasMoved||this.renderer.render(this.scene,this.camera.camPerspective.camera)}add(e){return this.scene.add(e),this.needsUpdate=!0,!0}remove(e){this.scene.remove(e),this.needsUpdate=!0}clear(){this.scene.clear(),this.needsUpdate=!0}}class vS{constructor(e){$(this,"settings");$(this,"renderer");$(this,"viewport");$(this,"inputs");$(this,"camera");$(this,"environment");$(this,"gizmoOrbit");$(this,"running",!1);$(this,"updateId",null);$(this,"clock",new el);$(this,"scene",new Ch);$(this,"animate",()=>{if(!this.running)return;this.updateId=requestAnimationFrame(this.animate);const e=this.clock.getDelta(),t=this.camera.update(e);this.renderer.needsUpdate=this.renderer.needsUpdate||t,this.renderer.render()});this.settings=Dm(e),this.viewport=new ku(this.settings),this.camera=new Jw(this.viewport,this.settings),this.renderer=new _S(this.scene,this.viewport,this.camera,this.settings),this.inputs=new fS(this),this.settings.camera.gizmo.enable&&(this.gizmoOrbit=new mS(this.renderer,this.camera,this.inputs,this.settings)),this.environment=new pS(this.settings),this.environment.getObjects().forEach(t=>this.renderer.add(t)),this.inputs.registerAll(),this.start()}start(){this.running||(this.running=!0,this.clock.start(),this.animate())}stop(){this.running=!1,this.updateId!==null&&(cancelAnimationFrame(this.updateId),this.updateId=null)}add(e,t=!0){if(console.log("Adding object"),this.renderer.needsUpdate=!0,!this.renderer.add(e))throw new Error("Could not load object")}clear(){this.renderer.clear()}dispose(){cancelAnimationFrame(this.updateId),this.environment.dispose(),this.gizmoOrbit.dispose(),this.viewport.dispose(),this.renderer.dispose(),this.inputs.unregisterAll()}}function Wm(r,e){if(e===Zf)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),r;if(e===Oa||e===eh){let t=r.getIndex();if(t===null){const o=[],a=r.getAttribute("position");if(a!==void 0){for(let c=0;c<a.count;c++)o.push(c);r.setIndex(o),t=r.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),r}const n=t.count-2,i=[];if(e===Oa)for(let o=1;o<=n;o++)i.push(t.getX(0)),i.push(t.getX(o)),i.push(t.getX(o+1));else for(let o=0;o<n;o++)o%2===0?(i.push(t.getX(o)),i.push(t.getX(o+1)),i.push(t.getX(o+2))):(i.push(t.getX(o+2)),i.push(t.getX(o+1)),i.push(t.getX(o)));i.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=r.clone();return s.setIndex(i),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),r}class yS extends Jt{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new SS(t)}),this.register(function(t){return new MS(t)}),this.register(function(t){return new NS(t)}),this.register(function(t){return new US(t)}),this.register(function(t){return new BS(t)}),this.register(function(t){return new TS(t)}),this.register(function(t){return new CS(t)}),this.register(function(t){return new IS(t)}),this.register(function(t){return new RS(t)}),this.register(function(t){return new wS(t)}),this.register(function(t){return new PS(t)}),this.register(function(t){return new ES(t)}),this.register(function(t){return new LS(t)}),this.register(function(t){return new DS(t)}),this.register(function(t){return new AS(t)}),this.register(function(t){return new OS(t)}),this.register(function(t){return new FS(t)})}load(e,t,n,i){const s=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const l=Li.extractUrlBase(e);o=Li.resolveURL(l,this.path)}else o=Li.extractUrlBase(e);this.manager.itemStart(e);const a=function(l){i?i(l):console.error(l),s.manager.itemError(e),s.manager.itemEnd(e)},c=new An(this.manager);c.setPath(this.path),c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setWithCredentials(this.withCredentials),c.load(e,function(l){try{s.parse(l,o,function(h){t(h),s.manager.itemEnd(e)},a)}catch(h){a(h)}},n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s;const o={},a={},c=new TextDecoder;if(typeof e=="string")s=JSON.parse(e);else if(e instanceof ArrayBuffer)if(c.decode(new Uint8Array(e,0,4))===qm){try{o[at.KHR_BINARY_GLTF]=new zS(e)}catch(u){i&&i(u);return}s=JSON.parse(o[at.KHR_BINARY_GLTF].content)}else s=JSON.parse(c.decode(e));else s=e;if(s.asset===void 0||s.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const l=new JS(s,{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 u=this.pluginCallbacks[h](l);u.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[u.name]=u,o[u.name]=!0}if(s.extensionsUsed)for(let h=0;h<s.extensionsUsed.length;++h){const u=s.extensionsUsed[h],f=s.extensionsRequired||[];switch(u){case at.KHR_MATERIALS_UNLIT:o[u]=new bS;break;case at.KHR_DRACO_MESH_COMPRESSION:o[u]=new kS(s,this.dracoLoader);break;case at.KHR_TEXTURE_TRANSFORM:o[u]=new VS;break;case at.KHR_MESH_QUANTIZATION:o[u]=new HS;break;default:f.indexOf(u)>=0&&a[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}l.setExtensions(o),l.setPlugins(a),l.parse(n,i)}parseAsync(e,t){const n=this;return new Promise(function(i,s){n.parse(e,t,i,s)})}}function xS(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}const at={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 AS{constructor(e){this.parser=e,this.name=at.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n<i;n++){const s=t[n];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let i=t.cache.get(n);if(i)return i;const s=t.json,c=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let l;const h=new xe(16777215);c.color!==void 0&&h.setRGB(c.color[0],c.color[1],c.color[2],Xt);const u=c.range!==void 0?c.range:0;switch(c.type){case"directional":l=new jc(h),l.target.position.set(0,0,-1),l.add(l.target);break;case"point":l=new pu(h),l.distance=u;break;case"spot":l=new du(h),l.distance=u,c.spot=c.spot||{},c.spot.innerConeAngle=c.spot.innerConeAngle!==void 0?c.spot.innerConeAngle:0,c.spot.outerConeAngle=c.spot.outerConeAngle!==void 0?c.spot.outerConeAngle:Math.PI/4,l.angle=c.spot.outerConeAngle,l.penumbra=1-c.spot.innerConeAngle/c.spot.outerConeAngle,l.target.position.set(0,0,-1),l.add(l.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+c.type)}return l.position.set(0,0,0),ti(l,c),c.intensity!==void 0&&(l.intensity=c.intensity),l.name=t.createUniqueName(c.name||"light_"+e),i=Promise.resolve(l),t.cache.add(n,i),i}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,s=n.json.nodes[e],a=(s.extensions&&s.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(c){return n._getNodeRef(t.cache,a,c)})}}class bS{constructor(){this.name=at.KHR_MATERIALS_UNLIT}getMaterialType(){return un}extendParams(e,t,n){const i=[];e.color=new xe(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const o=s.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],Xt),e.opacity=o[3]}s.baseColorTexture!==void 0&&i.push(n.assignTexture(e,"map",s.baseColorTexture,Tt))}return Promise.all(i)}}class wS{constructor(e){this.parser=e,this.name=at.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=i.extensions[this.name].emissiveStrength;return s!==void 0&&(t.emissiveIntensity=s),Promise.resolve()}}class SS{constructor(e){this.parser=e,this.name=at.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Rn}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&s.push(n.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(s.push(n.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const a=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new he(a,a)}return Promise.all(s)}}class MS{constructor(e){this.parser=e,this.name=at.KHR_MATERIALS_DISPERSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Rn}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=i.extensions[this.name];return t.dispersion=s.dispersion!==void 0?s.dispersion:0,Promise.resolve()}}class ES{constructor(e){this.parser=e,this.name=at.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Rn}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&s.push(n.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&s.push(n.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(s)}}class TS{constructor(e){this.parser=e,this.name=at.KHR_MATERIALS_SHEEN}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Rn}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[];t.sheenColor=new xe(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=i.extensions[this.name];if(o.sheenColorFactor!==void 0){const a=o.sheenColorFactor;t.sheenColor.setRGB(a[0],a[1],a[2],Xt)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&s.push(n.assignTexture(t,"sheenColorMap",o.sheenColorTexture,Tt)),o.sheenRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(s)}}class CS{constructor(e){this.parser=e,this.name=at.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Rn}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&s.push(n.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(s)}}class IS{constructor(e){this.parser=e,this.name=at.KHR_MATERIALS_VOLUME}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Rn}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&s.push(n.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const a=o.attenuationColor||[1,1,1];return t.attenuationColor=new xe().setRGB(a[0],a[1],a[2],Xt),Promise.all(s)}}class RS{constructor(e){this.parser=e,this.name=at.KHR_MATERIALS_IOR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Rn}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=i.extensions[this.name];return t.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}}class PS{constructor(e){this.parser=e,this.name=at.KHR_MATERIALS_SPECULAR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Rn}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&s.push(n.assignTexture(t,"specularIntensityMap",o.specularTexture));const a=o.specularColorFactor||[1,1,1];return t.specularColor=new xe().setRGB(a[0],a[1],a[2],Xt),o.specularColorTexture!==void 0&&s.push(n.assignTexture(t,"specularColorMap",o.specularColorTexture,Tt)),Promise.all(s)}}class DS{constructor(e){this.parser=e,this.name=at.EXT_MATERIALS_BUMP}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Rn}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&s.push(n.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(s)}}class LS{constructor(e){this.parser=e,this.name=at.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Rn}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&s.push(n.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(s)}}class NS{constructor(e){this.parser=e,this.name=at.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,i=n.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const s=i.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class US{constructor(e){this.parser=e,this.name=at.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=i.images[o.source];let c=n.textureLoader;if(a.uri){const l=n.options.manager.getHandler(a.uri);l!==null&&(c=l)}return n.loadTextureImage(e,o.source,c)}}class BS{constructor(e){this.parser=e,this.name=at.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=i.images[o.source];let c=n.textureLoader;if(a.uri){const l=n.options.manager.getHandler(a.uri);l!==null&&(c=l)}return n.loadTextureImage(e,o.source,c)}}class OS{constructor(e){this.name=at.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(a){const c=i.byteOffset||0,l=i.byteLength||0,h=i.count,u=i.byteStride,f=new Uint8Array(a,c,l);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(h,u,f,i.mode,i.filter).then(function(d){return d.buffer}):o.ready.then(function(){const d=new ArrayBuffer(h*u);return o.decodeGltfBuffer(new Uint8Array(d),h,u,f,i.mode,i.filter),d})})}else return null}}class FS{constructor(e){this.name=at.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const i=t.meshes[n.mesh];for(const l of i.primitives)if(l.mode!==Dn.TRIANGLES&&l.mode!==Dn.TRIANGLE_STRIP&&l.mode!==Dn.TRIANGLE_FAN&&l.mode!==void 0)return null;const o=n.extensions[this.name].attributes,a=[],c={};for(const l in o)a.push(this.parser.getDependency("accessor",o[l]).then(h=>(c[l]=h,c[l])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(l=>{const h=l.pop(),u=h.isGroup?h.children:[h],f=l[0].count,d=[];for(const g of u){const _=new We,m=new U,p=new wt,v=new U(1,1,1),y=new _c(g.geometry,g.material,f);for(let x=0;x<f;x++)c.TRANSLATION&&m.fromBufferAttribute(c.TRANSLATION,x),c.ROTATION&&p.fromBufferAttribute(c.ROTATION,x),c.SCALE&&v.fromBufferAttribute(c.SCALE,x),y.setMatrixAt(x,_.compose(m,p,v));for(const x in c)if(x==="_COLOR_0"){const A=c[x];y.instanceColor=new Ji(A.array,A.itemSize,A.normalized)}else x!=="TRANSLATION"&&x!=="ROTATION"&&x!=="SCALE"&&g.geometry.setAttribute(x,c[x]);ct.prototype.copy.call(y,g),this.parser.assignFinalMaterial(y),d.push(y)}return h.isGroup?(h.clear(),h.add(...d),h):d[0]}))}}const qm="glTF",Io=12,Xm={JSON:1313821514,BIN:5130562};class zS{constructor(e){this.name=at.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Io),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==qm)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-Io,s=new DataView(e,Io);let o=0;for(;o<i;){const a=s.getUint32(o,!0);o+=4;const c=s.getUint32(o,!0);if(o+=4,c===Xm.JSON){const l=new Uint8Array(e,Io+o,a);this.content=n.decode(l)}else if(c===Xm.BIN){const l=Io+o;this.body=e.slice(l,l+a)}o+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class kS{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=at.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,i=this.dracoLoader,s=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,a={},c={},l={};for(const h in o){const u=Hu[h]||h.toLowerCase();a[u]=o[h]}for(const h in e.attributes){const u=Hu[h]||h.toLowerCase();if(o[h]!==void 0){const f=n.accessors[e.attributes[h]],d=Is[f.componentType];l[u]=d.name,c[u]=f.normalized===!0}}return t.getDependency("bufferView",s).then(function(h){return new Promise(function(u,f){i.decodeDracoFile(h,function(d){for(const g in d.attributes){const _=d.attributes[g],m=c[g];m!==void 0&&(_.normalized=m)}u(d)},a,l,Xt,f)})})}}class VS{constructor(){this.name=at.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 HS{constructor(){this.name=at.KHR_MESH_QUANTIZATION}}class Zm extends _s{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=a*2,l=a*3,h=i-t,u=(n-t)/h,f=u*u,d=f*u,g=e*l,_=g-l,m=-2*d+3*f,p=d-f,v=1-m,y=p-f+u;for(let x=0;x!==a;x++){const A=o[_+x+a],E=o[_+x+c]*h,I=o[g+x+a],D=o[g+x]*h;s[x]=v*A+y*E+m*I+p*D}return s}}const GS=new wt;class WS extends Zm{interpolate_(e,t,n,i){const s=super.interpolate_(e,t,n,i);return GS.fromArray(s).normalize().toArray(s),s}}const Dn={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},Is={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Ym={9728:Mt,9729:pt,9984:Ko,9985:Ur,9986:Hi,9987:Mn},Qm={33071:tn,33648:Nr,10497:yi},Vu={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Hu={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"},Bi={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},qS={CUBICSPLINE:void 0,LINEAR:zr,STEP:Fr},Gu={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function XS(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new gs({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Wn})),r.DefaultMaterial}function Sr(r,e,t){for(const n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function ti(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function ZS(r,e,t){let n=!1,i=!1,s=!1;for(let l=0,h=e.length;l<h;l++){const u=e[l];if(u.POSITION!==void 0&&(n=!0),u.NORMAL!==void 0&&(i=!0),u.COLOR_0!==void 0&&(s=!0),n&&i&&s)break}if(!n&&!i&&!s)return Promise.resolve(r);const o=[],a=[],c=[];for(let l=0,h=e.length;l<h;l++){const u=e[l];if(n){const f=u.POSITION!==void 0?t.getDependency("accessor",u.POSITION):r.attributes.position;o.push(f)}if(i){const f=u.NORMAL!==void 0?t.getDependency("accessor",u.NORMAL):r.attributes.normal;a.push(f)}if(s){const f=u.COLOR_0!==void 0?t.getDependency("accessor",u.COLOR_0):r.attributes.color;c.push(f)}}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(c)]).then(function(l){const h=l[0],u=l[1],f=l[2];return n&&(r.morphAttributes.position=h),i&&(r.morphAttributes.normal=u),s&&(r.morphAttributes.color=f),r.morphTargetsRelative=!0,r})}function YS(r,e){if(r.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)r.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(r.morphTargetInfluences.length===t.length){r.morphTargetDictionary={};for(let n=0,i=t.length;n<i;n++)r.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function QS(r){let e;const t=r.extensions&&r.extensions[at.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+Wu(t.attributes):e=r.indices+":"+Wu(r.attributes)+":"+r.mode,r.targets!==void 0)for(let n=0,i=r.targets.length;n<i;n++)e+=":"+Wu(r.targets[n]);return e}function Wu(r){let e="";const t=Object.keys(r).sort();for(let n=0,i=t.length;n<i;n++)e+=t[n]+":"+r[t[n]]+";";return e}function qu(r){switch(r){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 KS(r){return r.search(/\.jpe?g($|\?)/i)>0||r.search(/^data\:image\/jpeg/)===0?"image/jpeg":r.search(/\.webp($|\?)/i)>0||r.search(/^data\:image\/webp/)===0?"image/webp":r.search(/\.ktx2($|\?)/i)>0||r.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const jS=new We;class JS{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new xS,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,i=-1,s=!1,o=-1;if(typeof navigator<"u"){const a=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(a)===!0;const c=a.match(/Version\/(\d+)/);i=n&&c?parseInt(c[1],10):-1,s=a.indexOf("Firefox")>-1,o=s?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&i<17||s&&o<98?this.textureLoader=new lu(this.options.manager):this.textureLoader=new Up(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new An(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,i=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(o){const a={scene:o[0][i.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:i.asset,parser:n,userData:{}};return Sr(s,a,i),ti(a,i),Promise.all(n._invokeAll(function(c){return c.afterRoot&&c.afterRoot(a)})).then(function(){for(const c of a.scenes)c.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let i=0,s=t.length;i<s;i++){const o=t[i].joints;for(let a=0,c=o.length;a<c;a++)e[o[a]].isBone=!0}for(let i=0,s=e.length;i<s;i++){const o=e[i];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(n[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const i=n.clone(),s=(o,a)=>{const c=this.associations.get(o);c!=null&&this.associations.set(a,c);for(const[l,h]of o.children.entries())s(h,a.children[l])};return s(n,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const i=e(t[n]);if(i)return i}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let i=0;i<t.length;i++){const s=e(t[i]);s&&n.push(s)}return n}getDependency(e,t){const n=e+":"+t;let i=this.cache.get(n);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this._invokeOne(function(s){return s.loadNode&&s.loadNode(t)});break;case"mesh":i=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":i=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(t)});break;case"camera":i=this.loadCamera(t);break;default:if(i=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(e,t)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(n,i)}return i}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(i.map(function(s,o){return n.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[at.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(s,o){n.load(Li.resolveURL(t.uri,i.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const i=t.byteLength||0,s=t.byteOffset||0;return n.slice(s,s+i)})}loadAccessor(e){const t=this,n=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const o=Vu[i.type],a=Is[i.componentType],c=i.normalized===!0,l=new a(i.count*o);return Promise.resolve(new ot(l,o,c))}const s=[];return i.bufferView!==void 0?s.push(this.getDependency("bufferView",i.bufferView)):s.push(null),i.sparse!==void 0&&(s.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(s).then(function(o){const a=o[0],c=Vu[i.type],l=Is[i.componentType],h=l.BYTES_PER_ELEMENT,u=h*c,f=i.byteOffset||0,d=i.bufferView!==void 0?n.bufferViews[i.bufferView].byteStride:void 0,g=i.normalized===!0;let _,m;if(d&&d!==u){const p=Math.floor(f/d),v="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+p+":"+i.count;let y=t.cache.get(v);y||(_=new l(a,p*d,i.count*d/h),y=new os(_,d/h),t.cache.add(v,y)),m=new fi(y,c,f%d/h,g)}else a===null?_=new l(i.count*c):_=new l(a,f,i.count*c),m=new ot(_,c,g);if(i.sparse!==void 0){const p=Vu.SCALAR,v=Is[i.sparse.indices.componentType],y=i.sparse.indices.byteOffset||0,x=i.sparse.values.byteOffset||0,A=new v(o[1],y,i.sparse.count*p),E=new l(o[2],x,i.sparse.count*c);a!==null&&(m=new ot(m.array.slice(),m.itemSize,m.normalized)),m.normalized=!1;for(let I=0,D=A.length;I<D;I++){const b=A[I];if(m.setX(b,E[I*c]),c>=2&&m.setY(b,E[I*c+1]),c>=3&&m.setZ(b,E[I*c+2]),c>=4&&m.setW(b,E[I*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}m.normalized=g}return m})}loadTexture(e){const t=this.json,n=this.options,s=t.textures[e].source,o=t.images[s];let a=this.textureLoader;if(o.uri){const c=n.manager.getHandler(o.uri);c!==null&&(a=c)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,n){const i=this,s=this.json,o=s.textures[e],a=s.images[t],c=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[c])return this.textureCache[c];const l=this.loadImageSource(t,n).then(function(h){h.flipY=!1,h.name=o.name||a.name||"",h.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(h.name=a.uri);const f=(s.samplers||{})[o.sampler]||{};return h.magFilter=Ym[f.magFilter]||pt,h.minFilter=Ym[f.minFilter]||Mn,h.wrapS=Qm[f.wrapS]||yi,h.wrapT=Qm[f.wrapT]||yi,h.generateMipmaps=!h.isCompressedTexture&&h.minFilter!==Mt&&h.minFilter!==pt,i.associations.set(h,{textures:e}),h}).catch(function(){return null});return this.textureCache[c]=l,l}loadImageSource(e,t){const n=this,i=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());const o=i.images[e],a=self.URL||self.webkitURL;let c=o.uri||"",l=!1;if(o.bufferView!==void 0)c=n.getDependency("bufferView",o.bufferView).then(function(u){l=!0;const f=new Blob([u],{type:o.mimeType});return c=a.createObjectURL(f),c});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const h=Promise.resolve(c).then(function(u){return new Promise(function(f,d){let g=f;t.isImageBitmapLoader===!0&&(g=function(_){const m=new xt(_);m.needsUpdate=!0,f(m)}),t.load(Li.resolveURL(u,s.path),g,void 0,d)})}).then(function(u){return l===!0&&a.revokeObjectURL(c),ti(u,o),u.userData.mimeType=o.mimeType||KS(o.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",c),u});return this.sourceCache[e]=h,h}assignTexture(e,t,n,i){const s=this;return this.getDependency("texture",n.index).then(function(o){if(!o)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(o=o.clone(),o.channel=n.texCoord),s.extensions[at.KHR_TEXTURE_TRANSFORM]){const a=n.extensions!==void 0?n.extensions[at.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const c=s.associations.get(o);o=s.extensions[at.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),s.associations.set(o,c)}}return i!==void 0&&(o.colorSpace=i),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const i=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+n.uuid;let c=this.cache.get(a);c||(c=new Ec,zt.prototype.copy.call(c,n),c.color.copy(n.color),c.map=n.map,c.sizeAttenuation=!1,this.cache.add(a,c)),n=c}else if(e.isLine){const a="LineBasicMaterial:"+n.uuid;let c=this.cache.get(a);c||(c=new qt,zt.prototype.copy.call(c,n),c.color.copy(n.color),c.map=n.map,this.cache.add(a,c)),n=c}if(i||s||o){let a="ClonedMaterial:"+n.uuid+":";i&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let c=this.cache.get(a);c||(c=n.clone(),s&&(c.vertexColors=!0),o&&(c.flatShading=!0),i&&(c.normalScale&&(c.normalScale.y*=-1),c.clearcoatNormalScale&&(c.clearcoatNormalScale.y*=-1)),this.cache.add(a,c),this.associations.set(c,this.associations.get(n))),n=c}e.material=n}getMaterialType(){return gs}loadMaterial(e){const t=this,n=this.json,i=this.extensions,s=n.materials[e];let o;const a={},c=s.extensions||{},l=[];if(c[at.KHR_MATERIALS_UNLIT]){const u=i[at.KHR_MATERIALS_UNLIT];o=u.getMaterialType(),l.push(u.extendParams(a,s,t))}else{const u=s.pbrMetallicRoughness||{};if(a.color=new xe(1,1,1),a.opacity=1,Array.isArray(u.baseColorFactor)){const f=u.baseColorFactor;a.color.setRGB(f[0],f[1],f[2],Xt),a.opacity=f[3]}u.baseColorTexture!==void 0&&l.push(t.assignTexture(a,"map",u.baseColorTexture,Tt)),a.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,a.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(l.push(t.assignTexture(a,"metalnessMap",u.metallicRoughnessTexture)),l.push(t.assignTexture(a,"roughnessMap",u.metallicRoughnessTexture))),o=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Sn);const h=s.alphaMode||Gu.OPAQUE;if(h===Gu.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,h===Gu.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==un&&(l.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new he(1,1),s.normalTexture.scale!==void 0)){const u=s.normalTexture.scale;a.normalScale.set(u,u)}if(s.occlusionTexture!==void 0&&o!==un&&(l.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==un){const u=s.emissiveFactor;a.emissive=new xe().setRGB(u[0],u[1],u[2],Xt)}return s.emissiveTexture!==void 0&&o!==un&&l.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,Tt)),Promise.all(l).then(function(){const u=new o(a);return s.name&&(u.name=s.name),ti(u,s),t.associations.set(u,{materials:e}),s.extensions&&Sr(i,u,s),u})}createUniqueName(e){const t=lt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,i=this.primitiveCache;function s(a){return n[at.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(c){return Km(c,a,t)})}const o=[];for(let a=0,c=e.length;a<c;a++){const l=e[a],h=QS(l),u=i[h];if(u)o.push(u.promise);else{let f;l.extensions&&l.extensions[at.KHR_DRACO_MESH_COMPRESSION]?f=s(l):f=Km(new Ke,l,t),i[h]={primitive:l,promise:f},o.push(f)}}return Promise.all(o)}loadMesh(e){const t=this,n=this.json,i=this.extensions,s=n.meshes[e],o=s.primitives,a=[];for(let c=0,l=o.length;c<l;c++){const h=o[c].material===void 0?XS(this.cache):this.getDependency("material",o[c].material);a.push(h)}return a.push(t.loadGeometries(o)),Promise.all(a).then(function(c){const l=c.slice(0,c.length-1),h=c[c.length-1],u=[];for(let d=0,g=h.length;d<g;d++){const _=h[d],m=o[d];let p;const v=l[d];if(m.mode===Dn.TRIANGLES||m.mode===Dn.TRIANGLE_STRIP||m.mode===Dn.TRIANGLE_FAN||m.mode===void 0)p=s.isSkinnedMesh===!0?new Lh(_,v):new St(_,v),p.isSkinnedMesh===!0&&p.normalizeSkinWeights(),m.mode===Dn.TRIANGLE_STRIP?p.geometry=Wm(p.geometry,eh):m.mode===Dn.TRIANGLE_FAN&&(p.geometry=Wm(p.geometry,Oa));else if(m.mode===Dn.LINES)p=new In(_,v);else if(m.mode===Dn.LINE_STRIP)p=new di(_,v);else if(m.mode===Dn.LINE_LOOP)p=new Fh(_,v);else if(m.mode===Dn.POINTS)p=new kh(_,v);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(p.geometry.morphAttributes).length>0&&YS(p,s),p.name=t.createUniqueName(s.name||"mesh_"+e),ti(p,s),m.extensions&&Sr(i,p,m),t.assignFinalMaterial(p),u.push(p)}for(let d=0,g=u.length;d<g;d++)t.associations.set(u[d],{meshes:e,primitives:d});if(u.length===1)return s.extensions&&Sr(i,u[0],s),u[0];const f=new Kn;s.extensions&&Sr(i,f,s),t.associations.set(f,{meshes:e});for(let d=0,g=u.length;d<g;d++)f.add(u[d]);return f})}loadCamera(e){let t;const n=this.json.cameras[e],i=n[n.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new kt(ka.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):n.type==="orthographic"&&(t=new ur(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),ti(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let i=0,s=t.joints.length;i<s;i++)n.push(this._loadNodeShallow(t.joints[i]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(i){const s=i.pop(),o=i,a=[],c=[];for(let l=0,h=o.length;l<h;l++){const u=o[l];if(u){a.push(u);const f=new We;s!==null&&f.fromArray(s.array,l*16),c.push(f)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[l])}return new no(a,c)})}loadAnimation(e){const t=this.json,n=this,i=t.animations[e],s=i.name?i.name:"animation_"+e,o=[],a=[],c=[],l=[],h=[];for(let u=0,f=i.channels.length;u<f;u++){const d=i.channels[u],g=i.samplers[d.sampler],_=d.target,m=_.node,p=i.parameters!==void 0?i.parameters[g.input]:g.input,v=i.parameters!==void 0?i.parameters[g.output]:g.output;_.node!==void 0&&(o.push(this.getDependency("node",m)),a.push(this.getDependency("accessor",p)),c.push(this.getDependency("accessor",v)),l.push(g),h.push(_))}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(c),Promise.all(l),Promise.all(h)]).then(function(u){const f=u[0],d=u[1],g=u[2],_=u[3],m=u[4],p=[];for(let y=0,x=f.length;y<x;y++){const A=f[y],E=d[y],I=g[y],D=_[y],b=m[y];if(A===void 0)continue;A.updateMatrix&&A.updateMatrix();const C=n._createAnimationTracks(A,E,I,D,b);if(C)for(let B=0;B<C.length;B++)p.push(C[B])}const v=new vs(s,void 0,p);return ti(v,i),v})}createNodeMesh(e){const t=this.json,n=this,i=t.nodes[e];return i.mesh===void 0?null:n.getDependency("mesh",i.mesh).then(function(s){const o=n._getNodeRef(n.meshCache,i.mesh,s);return i.weights!==void 0&&o.traverse(function(a){if(!!a.isMesh)for(let c=0,l=i.weights.length;c<l;c++)a.morphTargetInfluences[c]=i.weights[c]}),o})}loadNode(e){const t=this.json,n=this,i=t.nodes[e],s=n._loadNodeShallow(e),o=[],a=i.children||[];for(let l=0,h=a.length;l<h;l++)o.push(n.getDependency("node",a[l]));const c=i.skin===void 0?Promise.resolve(null):n.getDependency("skin",i.skin);return Promise.all([s,Promise.all(o),c]).then(function(l){const h=l[0],u=l[1],f=l[2];f!==null&&h.traverse(function(d){!d.isSkinnedMesh||d.bind(f,jS)});for(let d=0,g=u.length;d<g;d++)h.add(u[d]);return h})}_loadNodeShallow(e){const t=this.json,n=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const s=t.nodes[e],o=s.name?i.createUniqueName(s.name):"",a=[],c=i._invokeOne(function(l){return l.createNodeMesh&&l.createNodeMesh(e)});return c&&a.push(c),s.camera!==void 0&&a.push(i.getDependency("camera",s.camera).then(function(l){return i._getNodeRef(i.cameraCache,s.camera,l)})),i._invokeAll(function(l){return l.createNodeAttachment&&l.createNodeAttachment(e)}).forEach(function(l){a.push(l)}),this.nodeCache[e]=Promise.all(a).then(function(l){let h;if(s.isBone===!0?h=new mc:l.length>1?h=new Kn:l.length===1?h=l[0]:h=new ct,h!==l[0])for(let u=0,f=l.length;u<f;u++)h.add(l[u]);if(s.name&&(h.userData.name=s.name,h.name=o),ti(h,s),s.extensions&&Sr(n,h,s),s.matrix!==void 0){const u=new We;u.fromArray(s.matrix),h.applyMatrix4(u)}else s.translation!==void 0&&h.position.fromArray(s.translation),s.rotation!==void 0&&h.quaternion.fromArray(s.rotation),s.scale!==void 0&&h.scale.fromArray(s.scale);if(!i.associations.has(h))i.associations.set(h,{});else if(s.mesh!==void 0&&i.meshCache.refs[s.mesh]>1){const u=i.associations.get(h);i.associations.set(h,{...u})}return i.associations.get(h).nodes=e,h}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],i=this,s=new Kn;n.name&&(s.name=i.createUniqueName(n.name)),ti(s,n),n.extensions&&Sr(t,s,n);const o=n.nodes||[],a=[];for(let c=0,l=o.length;c<l;c++)a.push(i.getDependency("node",o[c]));return Promise.all(a).then(function(c){for(let h=0,u=c.length;h<u;h++)s.add(c[h]);const l=h=>{const u=new Map;for(const[f,d]of i.associations)(f instanceof zt||f instanceof xt)&&u.set(f,d);return h.traverse(f=>{const d=i.associations.get(f);d!=null&&u.set(f,d)}),u};return i.associations=l(s),s})}_createAnimationTracks(e,t,n,i,s){const o=[],a=e.name?e.name:e.uuid,c=[];Bi[s.path]===Bi.weights?e.traverse(function(f){f.morphTargetInfluences&&c.push(f.name?f.name:f.uuid)}):c.push(a);let l;switch(Bi[s.path]){case Bi.weights:l=ar;break;case Bi.rotation:l=cr;break;case Bi.translation:case Bi.scale:l=hr;break;default:switch(n.itemSize){case 1:l=ar;break;case 2:case 3:default:l=hr;break}break}const h=i.interpolation!==void 0?qS[i.interpolation]:zr,u=this._getArrayFromAccessor(n);for(let f=0,d=c.length;f<d;f++){const g=new l(c[f]+"."+Bi[s.path],t.array,u,h);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(g),o.push(g)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=qu(t.constructor),i=new Float32Array(t.length);for(let s=0,o=t.length;s<o;s++)i[s]=t[s]*n;t=i}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const i=this instanceof cr?WS:Zm;return new i(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function $S(r,e,t){const n=e.attributes,i=new Gt;if(n.POSITION!==void 0){const a=t.json.accessors[n.POSITION],c=a.min,l=a.max;if(c!==void 0&&l!==void 0){if(i.set(new U(c[0],c[1],c[2]),new U(l[0],l[1],l[2])),a.normalized){const h=qu(Is[a.componentType]);i.min.multiplyScalar(h),i.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const a=new U,c=new U;for(let l=0,h=s.length;l<h;l++){const u=s[l];if(u.POSITION!==void 0){const f=t.json.accessors[u.POSITION],d=f.min,g=f.max;if(d!==void 0&&g!==void 0){if(c.setX(Math.max(Math.abs(d[0]),Math.abs(g[0]))),c.setY(Math.max(Math.abs(d[1]),Math.abs(g[1]))),c.setZ(Math.max(Math.abs(d[2]),Math.abs(g[2]))),f.normalized){const _=qu(Is[f.componentType]);c.multiplyScalar(_)}a.max(c)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(a)}r.boundingBox=i;const o=new Pt;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,r.boundingSphere=o}function Km(r,e,t){const n=e.attributes,i=[];function s(o,a){return t.getDependency("accessor",o).then(function(c){r.setAttribute(a,c)})}for(const o in n){const a=Hu[o]||o.toLowerCase();a in r.attributes||i.push(s(n[o],a))}if(e.indices!==void 0&&!r.index){const o=t.getDependency("accessor",e.indices).then(function(a){r.setIndex(a)});i.push(o)}return rt.workingColorSpace!==Xt&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${rt.workingColorSpace}" not supported.`),ti(r,e),$S(r,e,t),Promise.all(i).then(function(){return e.targets!==void 0?ZS(r,e.targets,t):r})}const Xu=new WeakMap;class eM extends Jt{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,i){const s=new An(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,o=>{this.parse(o,t,i)},n,i)}parse(e,t,n=()=>{}){this.decodeDracoFile(e,t,null,null,Tt,n).catch(n)}decodeDracoFile(e,t,n,i,s=Xt,o=()=>{}){const a={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:s};return this.decodeGeometry(e,a).then(t).catch(o)}decodeGeometry(e,t){const n=JSON.stringify(t);if(Xu.has(e)){const c=Xu.get(e);if(c.key===n)return c.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 i;const s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(c=>(i=c,new Promise((l,h)=>{i._callbacks[s]={resolve:l,reject:h},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(c=>this._createGeometry(c.geometry));return a.catch(()=>!0).then(()=>{i&&s&&this._releaseTask(i,s)}),Xu.set(e,{key:n,promise:a}),a}_createGeometry(e){const t=new Ke;e.index&&t.setIndex(new ot(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const{name:i,array:s,itemSize:o,stride:a,vertexColorSpace:c}=e.attributes[n];let l;if(o===a)l=new ot(s,o);else{const h=new os(s,a);l=new fi(h,o,0)}i==="color"&&(this._assignVertexColorSpace(l,c),l.normalized=!(s instanceof Float32Array)),t.setAttribute(i,l)}return t}_assignVertexColorSpace(e,t){if(t!==Tt)return;const n=new xe;for(let i=0,s=e.count;i<s;i++)n.fromBufferAttribute(e,i),rt.colorSpaceToWorking(n,Tt),e.setXYZ(i,n.r,n.g,n.b)}_loadLibrary(e,t){const n=new An(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((i,s)=>{n.load(e,i,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{const i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);const s=tM.toString(),o=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(`
|
|
4035
|
+
*/Object.defineProperty(r,"__esModule",{value:!0}),r.SignalList=r.SignalHandlingBase=r.SignalDispatcher=void 0;const e=bo;Object.defineProperty(r,"SignalDispatcher",{enumerable:!0,get:function(){return e.SignalDispatcher}});const t=gl;Object.defineProperty(r,"SignalHandlingBase",{enumerable:!0,get:function(){return t.SignalHandlingBase}});const n=To;Object.defineProperty(r,"SignalList",{enumerable:!0,get:function(){return n.SignalList}})}(Ms);class Yw{constructor(e){$(this,"camera");this.camera=e}applySettings(e){this.camera.fov=e.camera.fov,this.camera.zoom=e.camera.zoom,this.camera.near=e.camera.near,this.camera.far=e.camera.far,this.camera.updateProjectionMatrix()}updateProjection(e){this.camera.aspect=e,this.camera.updateProjectionMatrix()}frustrumSizeAt(e){const n=this.camera.position.distanceTo(e)*Math.tan(this.camera.fov/2*(Math.PI/180));return new he(n,n)}}class Qw{constructor(e){$(this,"camera");this.camera=e}applySettings(e){this.camera.zoom=e.camera.zoom,this.camera.near=-e.camera.far,this.camera.far=e.camera.far,this.camera.updateProjectionMatrix()}updateProjection(e,t){const n=Math.max(e.x,e.y);this.camera.left=-n*t,this.camera.right=n*t,this.camera.top=n,this.camera.bottom=-n,this.camera.updateProjectionMatrix()}}class Bm{constructor(e){$(this,"_camera");this._camera=e}move2(e,t){const n=t==="XY"?new U(-e.x,e.y,0):t==="XZ"?new U(-e.x,0,e.y):void 0;n&&this.move3(n)}move1(e,t){const n=new U(t==="X"?-e:0,t==="Y"?e:0,t==="Z"?e:0);this.move3(n)}orbitTowards(e){const t=this._camera.forward,n=t.clone().setY(0),i=e.clone().setY(0),s=n.angleTo(i)*Math.sign(n.cross(i).y),o=Math.asin(e.y)-Math.asin(t.y),a=new he(o,s);a.multiplyScalar(180/Math.PI),this.orbit(a)}frame(e,t){e instanceof Gt&&(e=e.getBoundingSphere(new Pt)),e instanceof Pt&&this.frameSphere(e,t??this._camera.forward)}frameSphere(e,t){const n=this._camera.camPerspective.camera.fov*Math.PI/180,i=e.radius*1.2/Math.tan(n/2),s=t.clone().multiplyScalar(-i).add(e.center);this.set(s,e.center)}}class Kw extends Bm{constructor(t,n){super(t);$(this,"_movement");$(this,"_clock",new el);$(this,"onProgress");$(this,"_duration",1);this._movement=n}init(t){this.cancel(),this._duration=t,this._clock.start(),this.animate()}cancel(){this._clock.stop(),this.onProgress=void 0}animate(){this._clock.running&&(this.update(),requestAnimationFrame(()=>this.animate()))}easeOutCubic(t){return 1-Math.pow(1-t,3)}update(){let t=this._clock.getElapsedTime()/this._duration;t=this.easeOutCubic(t),t>=1&&(t=1,this._clock.stop(),this.onProgress=void 0),this.onProgress?.(t)}move3(t){const n=t.clone();n.applyQuaternion(this._camera.quaternion);const i=this._camera.position.clone(),s=this._camera.position.clone().add(n),o=new U;this.onProgress=a=>{o.copy(i),o.lerp(s,a),this._movement.move3(o)}}rotate(t){const n=new Zt(0,0,0,"YXZ");n.setFromQuaternion(this._camera.quaternion),n.x+=t.x,n.y+=t.y,n.z=0;const i=Math.PI*.48;n.x=Math.max(-i,Math.min(i,n.x));const s=this._camera.quaternion.clone(),o=new wt().setFromEuler(n),a=new wt;this.onProgress=c=>{a.copy(s),a.slerp(o,c),this._movement.applyRotation(a)}}zoom(t){const n=this._camera.orbitDistance*t;this.setDistance(n)}setDistance(t){const n=this._camera.position.clone(),i=this._camera.target.clone().lerp(n,t/this._camera.orbitDistance);this.onProgress=s=>{this._camera.position.copy(n),this._camera.position.lerp(i,s)}}orbit(t){const n=this._camera.position.clone(),i=this._camera.target.clone(),s=new he;this.onProgress=o=>{s.set(0,0),s.lerp(t,o),this._movement.set(n,i),this._movement.orbit(s)}}target(t){const i=t.clone().sub(this._camera.position),s=this._camera.quaternion.clone(),o=new wt().setFromUnitVectors(new U(0,0,-1),i.normalize());this.onProgress=a=>{const c=s.clone().slerp(o,a);this._movement.applyRotation(c)}}reset(){this.set(this._camera._savedPosition,this._camera._savedTarget)}set(t,n){const i=n??this._camera.target,s=this._camera.position.clone(),o=this._camera.target.clone();this.onProgress=a=>{this._movement.set(s.clone().lerp(t,a),o.clone().lerp(i,a))}}}class jw extends Bm{zoom(e){const t=this._camera.orbitDistance*e;this.setDistance(t)}reset(){this.set(this._camera._savedPosition,this._camera._savedTarget)}setDistance(e){const t=this._camera.target.clone().sub(this._camera.forward.multiplyScalar(e));this.set(t,this._camera.target)}rotate(e){const t=e.clone().multiply(this._camera.allowedRotation),n=this.predictRotate(t);this.applyRotation(n)}applyRotation(e){this._camera.quaternion.copy(e);const t=this._camera.forward.multiplyScalar(this._camera.orbitDistance).add(this._camera.position);this.set(this._camera.position,t)}target(e){this.set(this._camera.position,e)}orbit(e){const t=e.clone().multiply(this._camera.allowedRotation),n=this.predictOrbit(t);this.set(n)}move3(e){const t=e.clone();t.applyQuaternion(this._camera.quaternion);const n=this.lockVector(t,new U),i=this._camera.position.clone().add(n),s=this._camera.target.clone().add(n);this.set(i,s)}set(e,t){const n=this.lockVector(e,this._camera.position);this._camera.position.copy(n),t=t??this._camera.target,this._camera.target.copy(t),this._camera.camPerspective.camera.lookAt(t),this._camera.camPerspective.camera.up.set(0,1,0)}lockVector(e,t){const n=this._camera.allowedMovement.x===0?t.x:e.x,i=this._camera.allowedMovement.y===0?t.y:e.y,s=this._camera.allowedMovement.z===0?t.z:e.z;return new U(n,i,s)}predictOrbit(e){const t=this.predictRotate(e),n=new U(0,0,1).applyQuaternion(t).multiplyScalar(this._camera.orbitDistance);return this._camera.target.clone().add(n)}predictRotate(e){const t=new Zt(0,0,0,"YXZ");t.setFromQuaternion(this._camera.quaternion),t.x+=e.x*Math.PI/180,t.y+=e.y*Math.PI/180,t.z=0;const n=Math.PI*.4999;return t.x=Math.max(-n,Math.min(n,t.x)),new wt().setFromEuler(t)}}class Jw{constructor(e,t){$(this,"camPerspective");$(this,"camOrthographic");$(this,"_viewport");$(this,"_lerp");$(this,"_movement");$(this,"_inputVelocity",new U);$(this,"_velocity",new U);$(this,"_speed",0);$(this,"_orthographic",!1);$(this,"_target",new U);$(this,"_lastPosition",new U);$(this,"_lastQuaternion",new wt);$(this,"_lastTarget",new U);$(this,"_savedPosition",new U(0,0,-5));$(this,"_savedTarget",new U(0,0,0));$(this,"_onValueChanged",new Ms.SignalDispatcher);$(this,"_hasMoved");$(this,"_onMoved",new Ms.SignalDispatcher);$(this,"_force",!1);$(this,"_allowedMovement",new U(1,1,1));$(this,"_allowedRotation",new he(1,1));$(this,"_defaultForward",new U(0,0,1));$(this,"_velocityBlendFactor",1e-4);$(this,"_moveSpeed",1);this.camPerspective=new Yw(new kt),this.camOrthographic=new Qw(new ur),this._movement=new jw(this),this._lerp=new Kw(this,this._movement),this._viewport=e,this.applySettings(t),this.do().orbitTowards(this._defaultForward),this.do().setDistance(-1e3)}get onValueChanged(){return this._onValueChanged.asEvent()}get hasMoved(){return this._hasMoved}get onMoved(){return this._onMoved.asEvent()}get allowedMovement(){return this._force?new U(1,1,1):this._allowedMovement}set allowedMovement(e){this._allowedMovement.copy(e),this._allowedMovement.x=this._allowedMovement.x===0?0:1,this._allowedMovement.y=this._allowedMovement.y===0?0:1,this._allowedMovement.z=this._allowedMovement.z===0?0:1}get allowedRotation(){return this._force?new he(1,1):this._allowedRotation}set allowedRotation(e){this._allowedRotation.copy(e),this._allowedRotation.x=this._allowedRotation.x===0?0:1,this._allowedRotation.y=this._allowedRotation.y===0?0:1}get defaultForward(){return this._defaultForward}set defaultForward(e){e.x===0&&e.y===0&&e.z===0?this._defaultForward.set(0,0,1):this._defaultForward.copy(e)}do(e=!1){return this._force=e,this._lerp.cancel(),this._movement}lerp(e=1,t=!1){return this.stop(),this._force=t,this._lerp.init(e),this._lerp}frustrumSizeAt(e){return this.camPerspective.frustrumSizeAt(e)}notifyMovement(){this._hasMoved=!0,this._onMoved.dispatch()}get three(){return this._orthographic?this.camOrthographic.camera:this.camPerspective.camera}get quaternion(){return this.camPerspective.camera.quaternion}get position(){return this.camPerspective.camera.position}get matrix(){return this.camPerspective.camera.updateMatrix(),this.camPerspective.camera.matrix}get forward(){return this.camPerspective.camera.getWorldDirection(new U)}get speed(){return this._speed}set speed(e){this._speed=Mw(e,-25,25),this._onValueChanged.dispatch()}get localVelocity(){const e=this._velocity.clone();return e.applyQuaternion(this.quaternion.clone().invert()),e.setZ(-e.z),e}set localVelocity(e){this._lerp.cancel(),this._inputVelocity.copy(e),this._inputVelocity.setZ(-this._inputVelocity.z)}stop(){this._inputVelocity.set(0,0,0),this._velocity.set(0,0,0)}get target(){return this._target}applySettings(e){this._defaultForward=new U().copy(e.camera.forward),this._orthographic=e.camera.orthographic,this.allowedMovement=e.camera.allowedMovement,this.allowedRotation=e.camera.allowedRotation,this.camPerspective.applySettings(e),this.camOrthographic.applySettings(e),this._moveSpeed=e.camera.controls.moveSpeed,this._onValueChanged.dispatch()}get orbitDistance(){return this.position.distanceTo(this._target)}save(){this._lerp.cancel(),this._savedPosition.copy(this.position),this._savedTarget.copy(this._target)}updateProjection(){const e=this._viewport.getAspectRatio();this.camPerspective.updateProjection(e);const t=this.camPerspective.frustrumSizeAt(this.target);this.camOrthographic.updateProjection(t,e)}get orthographic(){return this._orthographic}set orthographic(e){e!==this._orthographic&&(this._orthographic=e,this._onValueChanged.dispatch())}update(e){this.applyVelocity(e)&&this.updateOrthographic();const t=this.checkForMovement();return t&&(this.camOrthographic.camera.position.copy(this.position),this.camOrthographic.camera.quaternion.copy(this.quaternion)),this.updateProjection(),t}applyVelocity(e){if(this._inputVelocity.x===0&&this._inputVelocity.y===0&&this._inputVelocity.z===0&&this._velocity.x===0&&this._velocity.y===0&&this._velocity.z===0)return!1;const t=Math.pow(this._velocityBlendFactor,e),n=1-t;this._velocity.multiplyScalar(t);const i=this._inputVelocity.clone().multiplyScalar(n);if(this._velocity.add(i),this._velocity.lengthSq()<e/10)return this._velocity.set(0,0,0),!1;const s=this._velocity.clone().multiplyScalar(e*this.getVelocityMultiplier());return this.do().move3(s),!0}updateOrthographic(){if(this.orthographic){const t=this._lastTarget.clone().sub(this.position).dot(this.forward);this.target.copy(this.forward).multiplyScalar(t).add(this.position);const n=this._lastPosition.clone().sub(this._target),i=this.position.clone().sub(this._target);(n.dot(i)<0||i.lengthSq()<1)&&this.position.copy(this._target).add(this.forward.multiplyScalar(-1))}}getVelocityMultiplier(){const t=!this._lastQuaternion.equals(this.quaternion)?1:1.66;return Math.pow(1.25,this.speed)*this._moveSpeed*t*100}checkForMovement(){return this._hasMoved=!1,(!this._lastPosition.equals(this.position)||!this._lastQuaternion.equals(this.quaternion)||!this._lastTarget.equals(this._target))&&(this._hasMoved=!0,this._onMoved.dispatch()),this._lastPosition.copy(this.position),this._lastQuaternion.copy(this.quaternion),this._lastTarget.copy(this._target),this._hasMoved}}class zu{constructor(e){$(this,"_viewer");$(this,"_unregisters",[]);$(this,"reg",(e,t,n)=>{e.addEventListener(t,n),this._unregisters.push(()=>e.removeEventListener(t,n))});this._viewer=e}register(){this._unregisters.length>0||this.addListeners()}addListeners(){}unregister(){this._unregisters.forEach(e=>e()),this._unregisters.length=0,this.reset()}reset(){}}const At={KEY_0:48,KEY_1:49,KEY_2:50,KEY_3:51,KEY_4:52,KEY_5:53,KEY_6:54,KEY_7:55,KEY_8:56,KEY_9:57,KEY_LEFT:37,KEY_RIGHT:39,KEY_UP:38,KEY_DOWN:40,KEY_CTRL:17,KEY_SHIFT:16,KEY_ENTER:13,KEY_SPACE:32,KEY_TAB:9,KEY_ESCAPE:27,KEY_BACKSPACE:8,KEY_HOME:36,KEY_END:35,KEY_INSERT:45,KEY_DELETE:46,KEY_ALT:18,KEY_F1:112,KEY_F2:113,KEY_F3:114,KEY_F4:115,KEY_F5:116,KEY_F6:117,KEY_F7:118,KEY_F8:119,KEY_F9:120,KEY_F10:121,KEY_F11:122,KEY_F12:123,KEY_NUMPAD0:96,KEY_NUMPAD1:97,KEY_NUMPAD2:98,KEY_NUMPAD3:99,KEY_NUMPAD4:100,KEY_NUMPAD5:101,KEY_NUMPAD6:102,KEY_NUMPAD7:103,KEY_NUMPAD8:104,KEY_NUMPAD9:105,KEY_ADD:107,KEY_SUBTRACT:109,KEY_MULTIPLY:106,KEY_DIVIDE:111,KEY_SEPARATOR:108,KEY_DECIMAL:110,KEY_OEM_PLUS:187,KEY_OEM_MINUS:189,KEY_A:65,KEY_B:66,KEY_C:67,KEY_D:68,KEY_E:69,KEY_F:70,KEY_G:71,KEY_H:72,KEY_I:73,KEY_J:74,KEY_K:75,KEY_L:76,KEY_M:77,KEY_N:78,KEY_O:79,KEY_P:80,KEY_Q:81,KEY_R:82,KEY_S:83,KEY_T:84,KEY_U:85,KEY_V:86,KEY_W:87,KEY_X:88,KEY_Y:89,KEY_Z:90},$w=new Set(Object.values(At));class eS extends zu{constructor(){super(...arguments);$(this,"SHIFT_MULTIPLIER",3);$(this,"isUpPressed",!1);$(this,"isDownPressed",!1);$(this,"isLeftPressed",!1);$(this,"isRightPressed",!1);$(this,"isEPressed",!1);$(this,"isQPressed",!1);$(this,"isShiftPressed",!1);$(this,"isCtrlPressed",!1);$(this,"arrowsEnabled",!0)}addListeners(){this.reg(document,"keydown",t=>this.onKeyDown(t)),this.reg(document,"keyup",t=>this.onKeyUp(t)),this.reg(this._viewer.viewport.canvas,"focusout",()=>this.reset()),this.reg(window,"resize",()=>this.reset())}reset(){this.isUpPressed=!1,this.isDownPressed=!1,this.isLeftPressed=!1,this.isRightPressed=!1,this.isEPressed=!1,this.isQPressed=!1,this.isShiftPressed=!1,this.isCtrlPressed=!1,this.applyMove()}get camera(){return this._viewer.camera}onKeyUp(t){this.onKey(t,!1)}onKeyDown(t){this.onKey(t,!0)}onKey(t,n){switch(!n&&$w.has(t.keyCode)&&this._viewer.inputs.KeyAction(t.keyCode)&&t.preventDefault(),t.keyCode){case At.KEY_W:case At.KEY_UP:this.isUpPressed=n,this.applyMove(),t.preventDefault();break;case At.KEY_S:case At.KEY_DOWN:this.isDownPressed=n,this.applyMove(),t.preventDefault();break;case At.KEY_D:case At.KEY_RIGHT:this.isRightPressed=n,this.applyMove(),t.preventDefault();break;case At.KEY_A:case At.KEY_LEFT:this.isLeftPressed=n,this.applyMove(),t.preventDefault();break;case At.KEY_E:this.isEPressed=n,this.applyMove(),t.preventDefault();break;case At.KEY_Q:this.isQPressed=n,this.applyMove(),t.preventDefault();break;case At.KEY_SHIFT:this.isShiftPressed=n,this.applyMove(),t.preventDefault();break;case At.KEY_CTRL:this.isCtrlPressed=n,t.preventDefault();break}}applyMove(){const t=new U((this.isRightPressed?1:0)-(this.isLeftPressed?1:0),(this.isEPressed?1:0)-(this.isQPressed?1:0),(this.isUpPressed?1:0)-(this.isDownPressed?1:0)),n=this.isShiftPressed?this.SHIFT_MULTIPLIER:1;t.multiplyScalar(n),this.arrowsEnabled&&(this.camera.localVelocity=t)}}class tS extends zu{constructor(t){super(t);$(this,"TAP_DURATION_MS",500);$(this,"DOUBLE_TAP_DELAY_MS",500);$(this,"TAP_MAX_MOVE_PIXEL",5);$(this,"ZOOM_SPEED",1);$(this,"MOVE_SPEED",100);$(this,"rotateSpeed",1);$(this,"orbitSpeed",1);$(this,"_touch");$(this,"_touch1");$(this,"_touch2");$(this,"_touchStartTime");$(this,"_lastTapMs");$(this,"_touchStart");$(this,"reset",()=>{this._touch=this._touch1=this._touch2=this._touchStartTime=void 0});$(this,"onTap",t=>{const n=new Date().getTime();this._lastTapMs&&n-this._lastTapMs<this.DOUBLE_TAP_DELAY_MS,this._lastTapMs=new Date().getTime()});$(this,"onTouchStart",t=>{t.preventDefault(),!(!t||!t.touches||!t.touches.length)&&(this._touchStartTime=new Date().getTime(),t.touches.length===1?(this._touch=this.touchToVector(t.touches[0]),this._touch1=this._touch2=void 0):t.touches.length===2&&(this._touch1=this.touchToVector(t.touches[0]),this._touch2=this.touchToVector(t.touches[1]),this._touch=this.average(this._touch1,this._touch2)),this._touchStart=this._touch)});$(this,"onDrag",t=>{this._viewer.inputs.pointerActive==="orbit"?this.camera.do().orbit(this.toRotation(t,this.orbitSpeed)):this.camera.do().rotate(this.toRotation(t,this.rotateSpeed))});$(this,"onDoubleDrag",t=>{const n=t.clone().multiplyScalar(this.MOVE_SPEED);this.camera.do().move2(n,"XY")});$(this,"onPinchOrSpread",t=>{this._viewer.inputs.pointerActive==="orbit"?this.camera.do().zoom(1+t*this.ZOOM_SPEED):this.camera.do().move1(t*this.ZOOM_SPEED,"Z")});$(this,"onTouchMove",t=>{if(t.preventDefault(),!(!t||!t.touches||!t.touches.length)&&!!this._touch){if(t.touches.length===1){const n=this.touchToVector(t.touches[0]),i=this.viewport.getSize(),s=n.clone().sub(this._touch).multiply(new he(1/i.x,1/i.y));this._touch=n,this.onDrag(s);return}if(!(!this._touch1||!this._touch2)&&t.touches.length>=2){const n=this.touchToVector(t.touches[0]),i=this.touchToVector(t.touches[1]),s=this.average(n,i),o=this.viewport.getSize(),a=this._touch.clone().sub(s).multiply(new he(-1/o.x,-1/o.y)),c=n.distanceTo(i),l=this._touch1.distanceTo(this._touch2),h=Math.min(o.x,o.y),u=(c-l)/-h;this._touch=s,this._touch1=n,this._touch2=i,a.length()>Math.abs(u)?this.onDoubleDrag(a):this.onPinchOrSpread(u)}}});$(this,"onTouchEnd",t=>{if(this.isSingleTouch()&&this._touchStart&&this._touch){const n=new Date().getTime()-this._touchStartTime,i=this._touch.distanceTo(this._touchStart);n<this.TAP_DURATION_MS&&i<this.TAP_MAX_MOVE_PIXEL&&this.onTap(this._touch)}this.reset()});this.rotateSpeed=t.settings.camera.controls.rotateSpeed,this.orbitSpeed=t.settings.camera.controls.orbitSpeed}get camera(){return this._viewer.camera}get viewport(){return this._viewer.viewport}addListeners(){const t=this.viewport.canvas;this.reg(t,"touchstart",this.onTouchStart),this.reg(t,"touchend",this.onTouchEnd),this.reg(t,"touchmove",this.onTouchMove)}toRotation(t,n){const i=new he;return i.x=t.y,i.y=t.x,i.multiplyScalar(-180*n),i}isSingleTouch(){return this._touch!==void 0&&this._touchStartTime!==void 0&&this._touch1===void 0&&this._touch2===void 0}touchToVector(t){return new he(t.pageX,t.pageY)}average(t,n){return t.clone().lerp(n,.5)}}class nS extends zu{constructor(t){super(t);$(this,"_idleDelayMs",150);$(this,"zoomSpeed",1);$(this,"panSpeed",100);$(this,"rotateSpeed",1);$(this,"orbitSpeed",1);$(this,"_buttonDown");$(this,"_hasMouseMoved",!1);$(this,"_hasCameraMoved",!1);$(this,"_idleTimeout");$(this,"_idlePosition");$(this,"_lastPosition");$(this,"_downPosition");$(this,"reset",()=>{this._buttonDown=void 0,this._hasMouseMoved=!1,this._lastPosition=this._downPosition=void 0,clearTimeout(this._idleTimeout)});$(this,"onMouseOut",t=>{t.stopImmediatePropagation(),this._buttonDown=void 0,this._hasMouseMoved=!1,this._lastPosition=void 0,this.resetIdle()});$(this,"onCameraMoved",()=>{this.resetIdle(),this._hasCameraMoved=!0});$(this,"onMouseMove",t=>{t.stopImmediatePropagation(),this._lastPosition=new he(t.offsetX,t.offsetY),(!this._idlePosition||this._lastPosition.distanceTo(this._idlePosition)>5)&&this.resetIdle(),this._buttonDown&&this.onMouseDrag(t)});$(this,"onMouseDown",t=>{if(t.stopImmediatePropagation(),t.preventDefault(),this._buttonDown)return;this.inputs.ContextMenu(void 0),this._hasCameraMoved=!1,this._downPosition=new he(t.offsetX,t.offsetY),this._hasMouseMoved=!1,this.viewport.canvas.focus(),this._buttonDown=this.getButton(t);const n=this._buttonDown==="middle"?"pan":this._buttonDown==="right"?"look":void 0;this.inputs.pointerOverride=n});$(this,"onMouseWheel",t=>{t.preventDefault(),t.stopImmediatePropagation();const n=Math.sign(t.deltaY);if(t.ctrlKey)this.camera.speed-=n;else{const i=Math.pow(1.3,n);this.camera.lerp(.75).zoom(i)}});$(this,"onMouseUp",t=>{t.stopImmediatePropagation(),this.resetIdle(),this.getButton(t)!==this._buttonDown&&(t.preventDefault(),this._buttonDown&&(t.button===2&&!this._hasMouseMoved&&this.inputs.ContextMenu(new he(t.clientX,t.clientY)),this._buttonDown=void 0,this.inputs.pointerOverride=void 0))});this.rotateSpeed=t.settings.camera.controls.rotateSpeed,this.orbitSpeed=t.settings.camera.controls.orbitSpeed}get camera(){return this._viewer.camera}get viewport(){return this._viewer.viewport}get canvas(){return this.viewport.canvas}get inputs(){return this._viewer.inputs}addListeners(){this.reg(this.canvas,"mousedown",this.onMouseDown),this.reg(this.canvas,"wheel",this.onMouseWheel),this.reg(this.canvas,"mousemove",this.onMouseMove),this.reg(this.canvas,"mouseup",this.onMouseUp),this.reg(this.canvas,"mouseout",this.onMouseOut),this.reg(this.canvas,"contextmenu",t=>t.preventDefault()),this._unregisters.push(this.camera.onMoved.subscribe(()=>this.onCameraMoved()))}resetIdle(){this._idlePosition&&(this._idlePosition=void 0),clearTimeout(this._idleTimeout)}onMouseDrag(t){t.stopImmediatePropagation(),t.preventDefault();const n=t.movementX||t.mozMovementX||t.webkitMovementX||0,i=t.movementY||t.mozMovementY||t.webkitMovementY||0,s=this.viewport.getSize(),o=new he(n/s.x,i/s.y),a=new he(t.offsetX,t.offsetY);switch(this._hasMouseMoved=this._hasMouseMoved||this._downPosition&&this._downPosition?.distanceTo(a)>4,this._buttonDown){case"main":this.onMouseMainDrag(o);break;case"middle":this.onMouseMiddleDrag(o);break;case"right":this.onMouseRightDrag(o);break}}toRotation(t,n){const i=t.clone();return i.x=-t.y,i.y=-t.x,i.multiplyScalar(180*n),i}onMouseMainDrag(t){switch(this.inputs.pointerActive){case"orbit":this.camera.do().orbit(this.toRotation(t,this.orbitSpeed));break;case"look":this.camera.do().rotate(this.toRotation(t,this.rotateSpeed));break;case"pan":this.camera.do().move2(t.multiplyScalar(this.panSpeed),"XY");break;case"zoom":this.camera.do().zoom(1+t.y*this.zoomSpeed);break}}onMouseMiddleDrag(t){this.camera.do().move2(t.multiplyScalar(100),"XY")}onMouseRightDrag(t){this.camera.do().rotate(this.toRotation(t,this.rotateSpeed))}getButton(t){return t.buttons&1?"main":t.buttons&2?"right":t.buttons&4?"middle":void 0}getModifier(t){return t.ctrlKey?"ctrl":t.shiftKey?"shift":"none"}}var Om={},Ts={};Object.defineProperty(Ts,"__esModule",{value:!0}),Ts.SimpleEventDispatcher=void 0;const Fm=br;class iS extends Fm.DispatcherBase{constructor(){super()}dispatch(e){const t=this._dispatch(!1,this,arguments);if(t==null)throw new Fm.DispatchError("Got `null` back from dispatch.");return t}dispatchAsync(e){this._dispatch(!0,this,arguments)}asEvent(){return super.asEvent()}}Ts.SimpleEventDispatcher=iS;var _l={},Co={};Object.defineProperty(Co,"__esModule",{value:!0}),Co.SimpleEventList=void 0;const rS=br,sS=Ts;class oS extends rS.EventListBase{constructor(){super()}createDispatcher(){return new sS.SimpleEventDispatcher}}Co.SimpleEventList=oS,Object.defineProperty(_l,"__esModule",{value:!0}),_l.SimpleEventHandlingBase=void 0;const aS=br,cS=Co;class lS extends aS.HandlingBase{constructor(){super(new cS.SimpleEventList)}}_l.SimpleEventHandlingBase=lS;var vl={};Object.defineProperty(vl,"__esModule",{value:!0}),vl.NonUniformSimpleEventList=void 0;const hS=Ts;class uS{constructor(){this._events={}}get(e){if(this._events[e])return this._events[e];const t=this.createDispatcher();return this._events[e]=t,t}remove(e){delete this._events[e]}createDispatcher(){return new hS.SimpleEventDispatcher}}vl.NonUniformSimpleEventList=uS,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.NonUniformSimpleEventList=r.SimpleEventList=r.SimpleEventHandlingBase=r.SimpleEventDispatcher=void 0;const e=Ts;Object.defineProperty(r,"SimpleEventDispatcher",{enumerable:!0,get:function(){return e.SimpleEventDispatcher}});const t=_l;Object.defineProperty(r,"SimpleEventHandlingBase",{enumerable:!0,get:function(){return t.SimpleEventHandlingBase}});const n=vl;Object.defineProperty(r,"NonUniformSimpleEventList",{enumerable:!0,get:function(){return n.NonUniformSimpleEventList}});const i=Co;Object.defineProperty(r,"SimpleEventList",{enumerable:!0,get:function(){return i.SimpleEventList}})}(Om);class zm{constructor(e){$(this,"_viewer");this._viewer=e}onKeyAction(e){const t=this._viewer.camera;switch(e){case At.KEY_P:return t.orthographic=!t.orthographic,!0;case At.KEY_ADD:case At.KEY_OEM_PLUS:return t.speed+=1,!0;case At.KEY_SUBTRACT:case At.KEY_OEM_MINUS:return t.speed-=1,!0;case At.KEY_F8:case At.KEY_SPACE:return this._viewer.inputs.pointerActive=this._viewer.inputs.pointerFallback,!0;case At.KEY_HOME:return t.lerp(1).reset(),!0;case At.KEY_ESCAPE:return!0;case At.KEY_Z:case At.KEY_F:return t.lerp(1).frame("all"),!0;default:return!1}}}class fS{constructor(e){$(this,"_viewer");$(this,"_scheme");$(this,"touch");$(this,"mouse");$(this,"keyboard");$(this,"_pointerActive","orbit");$(this,"_pointerFallback","look");$(this,"_pointerOverride");$(this,"_onPointerModeChanged",new Ms.SignalDispatcher);$(this,"_onPointerOverrideChanged",new Ms.SignalDispatcher);$(this,"_onContextMenu",new Om.SimpleEventDispatcher);$(this,"unregisterAll",()=>{this.mouse.unregister(),this.keyboard.unregister(),this.touch.unregister()});this._viewer=e,this._scheme=new zm(e),this.keyboard=new eS(e),this.mouse=new nS(e),this.touch=new tS(e),this.pointerActive=e.settings.camera.controls.orbit?"orbit":"look",this._pointerFallback=e.settings.camera.controls.orbit?"look":"orbit"}get pointerFallback(){return this._pointerFallback}get pointerActive(){return this._pointerActive}get pointerOverride(){return this._pointerOverride}set pointerOverride(e){e!==this._pointerOverride&&(this._pointerOverride=e,this._onPointerOverrideChanged.dispatch())}set pointerActive(e){e!==this._pointerActive&&(e==="look"?this._pointerFallback="orbit":e==="orbit"&&(this._pointerFallback="look"),this._pointerActive=e,this._onPointerModeChanged.dispatch())}get onPointerModeChanged(){return this._onPointerModeChanged.asEvent()}get onPointerOverrideChanged(){return this._onPointerOverrideChanged.asEvent()}get onContextMenu(){return this._onContextMenu.asEvent()}get scheme(){return this._scheme}KeyAction(e){return this._scheme.onKeyAction(e)}ContextMenu(e){this._onContextMenu.dispatch(e)}registerAll(){this.keyboard.register(),this.mouse.register(),this.touch.register()}resetAll(){this.mouse.reset(),this.keyboard.reset(),this.touch.reset()}}class dS{constructor(){$(this,"mesh");$(this,"_source");$(this,"_size",1);$(this,"_geometry");$(this,"_material");$(this,"_texture");this._geometry=new rr,this._material=new un({transparent:!0,depthTest:!0,depthWrite:!1}),this.mesh=new St(this._geometry,this._material),this.mesh.renderOrder=-1}applyViewerSettings(e){this._size=e.groundPlane.size,this.mesh.visible=e.groundPlane.visible,this.applyTexture(e.groundPlane.encoding,e.groundPlane.texture),this._material.color.copy(e.groundPlane.color),this._material.opacity=e.groundPlane.opacity}adaptToContent(e){const t=e.getCenter(new U),n=new U(t.x,e.min.y-Math.abs(e.min.y)*.01,t.z);this.mesh.position.copy(n),this.mesh.quaternion.copy(new wt().setFromEuler(new Zt(1.5*Math.PI,0,0)));const s=(e?.getBoundingSphere(new Pt)?.radius??1)*this._size,o=new U(1,1,1).multiplyScalar(s);this.mesh.scale.copy(o)}applyTexture(e,t){if(t!==this._source&&(this._source=t,this._texture?.dispose(),this._texture=void 0,!(!t||!e))){if(e==="url"){const n=new lu;this._texture=n.load(t)}if(e==="base64"){const n=new Image;n.src=t;const i=new xt;this._texture=i,this._texture.image=n,n.onload=()=>{i.needsUpdate=!0}}if(!this._texture){console.error("Failed to load texture: "+t);return}this._material.map=this._texture}}dispose(){this._geometry?.dispose(),this._material?.dispose(),this._texture?.dispose(),this._texture=void 0}}class pS{constructor(e){$(this,"skyLight");$(this,"ambientLight");$(this,"sunLights");$(this,"_groundPlane");this._groundPlane=new dS,this.skyLight=new hu,this.ambientLight=new mu,this.sunLights=[],this.applySettings(e)}get groundPlane(){return this._groundPlane.mesh}loadGroundTexture(e,t){this._groundPlane.applyTexture(e,t)}getObjects(){return[this._groundPlane.mesh,this.skyLight,this.ambientLight,...this.sunLights]}applySettings(e){this._groundPlane.applyViewerSettings(e),this.skyLight.color.copy(e.skylight.skyColor),this.skyLight.groundColor.copy(e.skylight.groundColor),this.skyLight.intensity=e.skylight.intensity,this.ambientLight.color.copy(e.ambientLight.color),this.ambientLight.intensity=e.ambientLight.intensity;const t=e.sunLights.length;for(let n=0;n<t;n++){this.sunLights[n]||(this.sunLights[n]=new jc);const i=e.sunLights[n].color,s=e.sunLights[n].position,o=e.sunLights[n].intensity;i&&this.sunLights[n].color.copy(i),s&&this.sunLights[n].position.copy(s),o&&(this.sunLights[n].intensity=o)}}adaptToContent(e){this._groundPlane.adaptToContent(e)}dispose(){this.sunLights.forEach(e=>e.dispose()),this.skyLight.dispose(),this.ambientLight.dispose(),this._groundPlane.dispose()}}class mS{constructor(e,t,n,i){$(this,"_renderer");$(this,"_camera");$(this,"_inputs");$(this,"_size",1);$(this,"_fov",50);$(this,"_color",new xe("blue"));$(this,"_opacity",.2);$(this,"_opacityAlways",.5);$(this,"_fadeDurationMs",200);$(this,"_showDurationMs",1e3);$(this,"_box");$(this,"_wireframe");$(this,"_material");$(this,"_materialAlways");$(this,"_gizmos");$(this,"_disconnectCamera");$(this,"_timeout");$(this,"_fadeEnd",0);$(this,"_active",!0);$(this,"_animation",0);this._renderer=e,this._camera=t,this._inputs=n,this.applySettings(i),this.connect()}connect(){const e=this._inputs.onPointerModeChanged.subscribe(()=>this.onUpdate()),t=this._camera.onMoved.subscribe(()=>this.onUpdate()),n=this._camera.onValueChanged.subscribe(()=>this.onUpdate());this._disconnectCamera=()=>{e(),t(),n()}}onUpdate(){this.updateScale(),this.setPosition(this._camera.target),this.show(!0)}dispose(){cancelAnimationFrame(this._animation),clearTimeout(this._timeout),this._box?.dispose(),this._wireframe?.dispose(),this._material?.dispose(),this._materialAlways?.dispose(),this._disconnectCamera?.(),this._box=void 0,this._wireframe=void 0,this._material=void 0,this._materialAlways=void 0,this._disconnectCamera=void 0,this._gizmos&&(this._renderer.remove(this._gizmos),this._gizmos=void 0)}get enabled(){return this._active}set enabled(e){this._active=e}show(e=!0){!this._active||(this._gizmos||this.createGizmo(),clearTimeout(this._timeout),this._gizmos.visible=e,e&&(this._timeout=setTimeout(()=>this.fadeOut(),this._showDurationMs)))}fadeOut(e){const t=new Date().getTime();if(e||(this._fadeEnd=t+this._fadeDurationMs),t>this._fadeEnd)this._gizmos.visible=!1,this._material.opacity=this._opacity,this._materialAlways.opacity=this._opacityAlways;else{this._animation=requestAnimationFrame(()=>this.fadeOut(!0));const n=Math.pow((this._fadeEnd-t)/this._fadeDurationMs,4);this._material.opacity=ka.lerp(0,this._opacity,n),this._materialAlways.opacity=ka.lerp(0,this._opacityAlways,n)}this._renderer.needsUpdate=!0}setPosition(e){this._gizmos?.position.copy(e),this.updateScale()}setSize(e){this._size=e}setOpacity(e,t){this._opacity=e,this._opacityAlways=t,this._gizmos&&(this._material.opacity=e,this._materialAlways.opacity=t)}setColor(e){this._color=e,this._gizmos&&(this._material.color=e,this._materialAlways.color=e)}applySettings(e){this._active=e.camera.gizmo.enable,this._fov=e.camera.fov,this.setColor(e.camera.gizmo.color),this.setSize(e.camera.gizmo.size),this.setOpacity(e.camera.gizmo.opacity,e.camera.gizmo.opacityAlways)}updateScale(){if(!this._gizmos)return;const e=this._camera.frustrumSizeAt(this._gizmos.position),n=Math.min(e.x,e.y)*this._size;this._gizmos.scale.set(n,n,n)}createGizmo(){this._box=new ms(1),this._wireframe=new eu(this._box),this._wireframe.addGroup(0,1/0,0),this._wireframe.addGroup(0,1/0,1),this._material=new qt({depthTest:!0,opacity:this._opacity,color:this._color,transparent:!0}),this._materialAlways=new qt({depthTest:!1,opacity:this._opacityAlways,color:this._color,transparent:!0}),this._gizmos=new In(this._wireframe,[this._material,this._materialAlways]),this._renderer.add(this._gizmos),this.updateScale()}}const Cs=new U,km=new We,Vm=new We,Hm=new U,Gm=new U;class gS{constructor(e={}){const t=this;let n,i,s,o;const a={objects:new WeakMap},c=e.element!==void 0?e.element:document.createElement("div");c.style.overflow="hidden",this.domElement=c,this.sortObjects=!0,this.getSize=function(){return{width:n,height:i}},this.render=function(g,_){g.matrixWorldAutoUpdate===!0&&g.updateMatrixWorld(),_.parent===null&&_.matrixWorldAutoUpdate===!0&&_.updateMatrixWorld(),km.copy(_.matrixWorldInverse),Vm.multiplyMatrices(_.projectionMatrix,km),h(g,g,_),this.sortObjects&&d(g)},this.setSize=function(g,_){n=g,i=_,s=n/2,o=i/2,c.style.width=g+"px",c.style.height=_+"px"};function l(g){g.isCSS2DObject&&(g.element.style.display="none");for(let _=0,m=g.children.length;_<m;_++)l(g.children[_])}function h(g,_,m){if(g.visible===!1){l(g);return}if(g.isCSS2DObject){Cs.setFromMatrixPosition(g.matrixWorld),Cs.applyMatrix4(Vm);const p=Cs.z>=-1&&Cs.z<=1&&g.layers.test(m.layers)===!0,v=g.element;v.style.display=p===!0?"":"none",p===!0&&(g.onBeforeRender(t,_,m),v.style.transform="translate("+-100*g.center.x+"%,"+-100*g.center.y+"%)translate("+(Cs.x*s+s)+"px,"+(-Cs.y*o+o)+"px)",v.parentNode!==c&&c.appendChild(v),g.onAfterRender(t,_,m));const y={distanceToCameraSquared:u(m,g)};a.objects.set(g,y)}for(let p=0,v=g.children.length;p<v;p++)h(g.children[p],_,m)}function u(g,_){return Hm.setFromMatrixPosition(g.matrixWorld),Gm.setFromMatrixPosition(_.matrixWorld),Hm.distanceToSquared(Gm)}function f(g){const _=[];return g.traverseVisible(function(m){m.isCSS2DObject&&_.push(m)}),_}function d(g){const _=f(g).sort(function(p,v){if(p.renderOrder!==v.renderOrder)return v.renderOrder-p.renderOrder;const y=a.objects.get(p).distanceToCameraSquared,x=a.objects.get(v).distanceToCameraSquared;return y-x}),m=_.length;for(let p=0,v=_.length;p<v;p++)_[p].element.style.zIndex=m-p}}}class ku{constructor(e){$(this,"canvas");$(this,"text");$(this,"_unregisterResize");$(this,"_ownedCanvas");$(this,"_onResize",new Ms.SignalDispatcher);const[t,n]=ku.getOrCreateCanvas(e.canvas.id);this.canvas=t,this._ownedCanvas=n,this.watchResize(e.canvas.resizeDelay)}get onResize(){return this._onResize.asEvent()}static getOrCreateCanvas(e){let t=e?document.getElementById(e):void 0;return t?[t,!1]:(t=document.createElement("canvas"),t.className="ara3d-canvas",t.tabIndex=0,t.style.backgroundColor="black",document.body.appendChild(t),[t,!0])}createTextRenderer(){if(console.log("Creating text renderer"),!this.canvas.parentElement)throw new Error("Cannot create text renderer without a canvas");const e=this.getParentSize(),t=new gS;return t.setSize(e.x,e.y),this.text=t.domElement,this.text.className="ara3d-text-renderer",this.text.style.position="absolute",this.text.style.top="0px",this.text.style.pointerEvents="none",this.canvas.parentElement.append(this.text),t}dispose(){this._unregisterResize?.(),this._unregisterResize=void 0,this._ownedCanvas&&this.canvas.remove()}getParentSize(){return new he(this.canvas.parentElement?.clientWidth??this.canvas.clientWidth,this.canvas.parentElement?.clientHeight??this.canvas.clientHeight)}getSize(){return new he(this.canvas.clientWidth,this.canvas.clientHeight)}getAspectRatio(){const e=this.getParentSize();return e.x/e.y}ResizeToParent(){this._onResize.dispatch()}watchResize(e){let t;const n=()=>{t!==void 0&&(clearTimeout(t),t=void 0),t=setTimeout(()=>{t=void 0,this._onResize.dispatch()},e)};window.addEventListener("resize",n),this._unregisterResize=()=>window.removeEventListener("resize",n)}}class _S{constructor(e,t,n,i){$(this,"renderer");$(this,"antialias",!0);$(this,"scene");$(this,"viewport");$(this,"camera");$(this,"needsUpdate");$(this,"_lastSize",new he);$(this,"fitViewport",()=>{const e=this.viewport.getParentSize();if(e.x===this._lastSize.x&&e.y===this._lastSize.y)return;this._lastSize.copy(e);const t=1.5;this.renderer.setPixelRatio(Math.min(window.devicePixelRatio,t)),this.renderer.setSize(e.x,e.y),this.needsUpdate=!0});this.viewport=t,this.scene=e,this.camera=n,this.renderer=new Cm({canvas:t.canvas,antialias:!0,precision:"highp",alpha:!0,stencil:!1,powerPreference:"high-performance",logarithmicDepthBuffer:!0}),this.fitViewport(),this.viewport.onResize.subscribe(()=>this.fitViewport()),this.camera.onValueChanged.sub(()=>{this.needsUpdate=!0}),this.background=i.background.color,this.applyRenderingSettings(i)}applyRenderingSettings(e){this.renderer.toneMapping=e.rendering.toneMapping,this.renderer.toneMappingExposure=e.rendering.toneMappingExposure}dispose(){this.clear(),this.renderer.clear(),this.renderer.forceContextLoss(),this.renderer.dispose()}get background(){return this.scene.background}set background(e){this.scene.background=e,e===null?this.renderer.setClearColor(0,0):this.renderer.setClearColor(0,1),this.needsUpdate=!0}render(){!this.needsUpdate&&!this.camera.hasMoved||this.renderer.render(this.scene,this.camera.camPerspective.camera)}add(e){return this.scene.add(e),this.needsUpdate=!0,!0}remove(e){this.scene.remove(e),this.needsUpdate=!0}clear(){this.scene.clear(),this.needsUpdate=!0}}class vS{constructor(e){$(this,"settings");$(this,"renderer");$(this,"viewport");$(this,"inputs");$(this,"camera");$(this,"environment");$(this,"gizmoOrbit");$(this,"running",!1);$(this,"updateId",null);$(this,"clock",new el);$(this,"scene",new Ch);$(this,"animate",()=>{if(!this.running)return;this.updateId=requestAnimationFrame(this.animate);const e=this.clock.getDelta(),t=this.camera.update(e);this.renderer.needsUpdate=this.renderer.needsUpdate||t,this.renderer.render()});this.settings=Dm(e),this.viewport=new ku(this.settings),this.camera=new Jw(this.viewport,this.settings),this.renderer=new _S(this.scene,this.viewport,this.camera,this.settings),this.inputs=new fS(this),this.settings.camera.gizmo.enable&&(this.gizmoOrbit=new mS(this.renderer,this.camera,this.inputs,this.settings)),this.environment=new pS(this.settings),this.environment.getObjects().forEach(t=>this.renderer.add(t)),this.inputs.registerAll(),this.start()}start(){this.running||(this.running=!0,this.clock.start(),this.animate())}stop(){this.running=!1,this.updateId!==null&&(cancelAnimationFrame(this.updateId),this.updateId=null)}add(e,t=!0){if(console.log("Adding object"),this.renderer.needsUpdate=!0,!this.renderer.add(e))throw new Error("Could not load object")}clear(){this.renderer.clear()}dispose(){cancelAnimationFrame(this.updateId),this.environment.dispose(),this.gizmoOrbit.dispose(),this.viewport.dispose(),this.renderer.dispose(),this.inputs.unregisterAll()}}function Wm(r,e){if(e===Zf)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),r;if(e===Oa||e===eh){let t=r.getIndex();if(t===null){const o=[],a=r.getAttribute("position");if(a!==void 0){for(let c=0;c<a.count;c++)o.push(c);r.setIndex(o),t=r.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),r}const n=t.count-2,i=[];if(e===Oa)for(let o=1;o<=n;o++)i.push(t.getX(0)),i.push(t.getX(o)),i.push(t.getX(o+1));else for(let o=0;o<n;o++)o%2===0?(i.push(t.getX(o)),i.push(t.getX(o+1)),i.push(t.getX(o+2))):(i.push(t.getX(o+2)),i.push(t.getX(o+1)),i.push(t.getX(o)));i.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=r.clone();return s.setIndex(i),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),r}class yS extends Jt{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new SS(t)}),this.register(function(t){return new MS(t)}),this.register(function(t){return new NS(t)}),this.register(function(t){return new US(t)}),this.register(function(t){return new BS(t)}),this.register(function(t){return new TS(t)}),this.register(function(t){return new CS(t)}),this.register(function(t){return new IS(t)}),this.register(function(t){return new RS(t)}),this.register(function(t){return new wS(t)}),this.register(function(t){return new PS(t)}),this.register(function(t){return new ES(t)}),this.register(function(t){return new LS(t)}),this.register(function(t){return new DS(t)}),this.register(function(t){return new AS(t)}),this.register(function(t){return new OS(t)}),this.register(function(t){return new FS(t)})}load(e,t,n,i){const s=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const l=Li.extractUrlBase(e);o=Li.resolveURL(l,this.path)}else o=Li.extractUrlBase(e);this.manager.itemStart(e);const a=function(l){i?i(l):console.error(l),s.manager.itemError(e),s.manager.itemEnd(e)},c=new An(this.manager);c.setPath(this.path),c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setWithCredentials(this.withCredentials),c.load(e,function(l){try{s.parse(l,o,function(h){t(h),s.manager.itemEnd(e)},a)}catch(h){a(h)}},n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s;const o={},a={},c=new TextDecoder;if(typeof e=="string")s=JSON.parse(e);else if(e instanceof ArrayBuffer)if(c.decode(new Uint8Array(e,0,4))===qm){try{o[at.KHR_BINARY_GLTF]=new zS(e)}catch(u){i&&i(u);return}s=JSON.parse(o[at.KHR_BINARY_GLTF].content)}else s=JSON.parse(c.decode(e));else s=e;if(s.asset===void 0||s.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const l=new JS(s,{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 u=this.pluginCallbacks[h](l);u.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[u.name]=u,o[u.name]=!0}if(s.extensionsUsed)for(let h=0;h<s.extensionsUsed.length;++h){const u=s.extensionsUsed[h],f=s.extensionsRequired||[];switch(u){case at.KHR_MATERIALS_UNLIT:o[u]=new bS;break;case at.KHR_DRACO_MESH_COMPRESSION:o[u]=new kS(s,this.dracoLoader);break;case at.KHR_TEXTURE_TRANSFORM:o[u]=new VS;break;case at.KHR_MESH_QUANTIZATION:o[u]=new HS;break;default:f.indexOf(u)>=0&&a[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}l.setExtensions(o),l.setPlugins(a),l.parse(n,i)}parseAsync(e,t){const n=this;return new Promise(function(i,s){n.parse(e,t,i,s)})}}function xS(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}const at={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 AS{constructor(e){this.parser=e,this.name=at.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n<i;n++){const s=t[n];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let i=t.cache.get(n);if(i)return i;const s=t.json,c=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let l;const h=new xe(16777215);c.color!==void 0&&h.setRGB(c.color[0],c.color[1],c.color[2],Xt);const u=c.range!==void 0?c.range:0;switch(c.type){case"directional":l=new jc(h),l.target.position.set(0,0,-1),l.add(l.target);break;case"point":l=new pu(h),l.distance=u;break;case"spot":l=new du(h),l.distance=u,c.spot=c.spot||{},c.spot.innerConeAngle=c.spot.innerConeAngle!==void 0?c.spot.innerConeAngle:0,c.spot.outerConeAngle=c.spot.outerConeAngle!==void 0?c.spot.outerConeAngle:Math.PI/4,l.angle=c.spot.outerConeAngle,l.penumbra=1-c.spot.innerConeAngle/c.spot.outerConeAngle,l.target.position.set(0,0,-1),l.add(l.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+c.type)}return l.position.set(0,0,0),ti(l,c),c.intensity!==void 0&&(l.intensity=c.intensity),l.name=t.createUniqueName(c.name||"light_"+e),i=Promise.resolve(l),t.cache.add(n,i),i}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,s=n.json.nodes[e],a=(s.extensions&&s.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(c){return n._getNodeRef(t.cache,a,c)})}}class bS{constructor(){this.name=at.KHR_MATERIALS_UNLIT}getMaterialType(){return un}extendParams(e,t,n){const i=[];e.color=new xe(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const o=s.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],Xt),e.opacity=o[3]}s.baseColorTexture!==void 0&&i.push(n.assignTexture(e,"map",s.baseColorTexture,Tt))}return Promise.all(i)}}class wS{constructor(e){this.parser=e,this.name=at.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=i.extensions[this.name].emissiveStrength;return s!==void 0&&(t.emissiveIntensity=s),Promise.resolve()}}class SS{constructor(e){this.parser=e,this.name=at.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Rn}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&s.push(n.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(s.push(n.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const a=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new he(a,a)}return Promise.all(s)}}class MS{constructor(e){this.parser=e,this.name=at.KHR_MATERIALS_DISPERSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Rn}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=i.extensions[this.name];return t.dispersion=s.dispersion!==void 0?s.dispersion:0,Promise.resolve()}}class ES{constructor(e){this.parser=e,this.name=at.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Rn}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&s.push(n.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&s.push(n.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(s)}}class TS{constructor(e){this.parser=e,this.name=at.KHR_MATERIALS_SHEEN}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Rn}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[];t.sheenColor=new xe(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=i.extensions[this.name];if(o.sheenColorFactor!==void 0){const a=o.sheenColorFactor;t.sheenColor.setRGB(a[0],a[1],a[2],Xt)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&s.push(n.assignTexture(t,"sheenColorMap",o.sheenColorTexture,Tt)),o.sheenRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(s)}}class CS{constructor(e){this.parser=e,this.name=at.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Rn}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&s.push(n.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(s)}}class IS{constructor(e){this.parser=e,this.name=at.KHR_MATERIALS_VOLUME}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Rn}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&s.push(n.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const a=o.attenuationColor||[1,1,1];return t.attenuationColor=new xe().setRGB(a[0],a[1],a[2],Xt),Promise.all(s)}}class RS{constructor(e){this.parser=e,this.name=at.KHR_MATERIALS_IOR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Rn}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=i.extensions[this.name];return t.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}}class PS{constructor(e){this.parser=e,this.name=at.KHR_MATERIALS_SPECULAR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Rn}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&s.push(n.assignTexture(t,"specularIntensityMap",o.specularTexture));const a=o.specularColorFactor||[1,1,1];return t.specularColor=new xe().setRGB(a[0],a[1],a[2],Xt),o.specularColorTexture!==void 0&&s.push(n.assignTexture(t,"specularColorMap",o.specularColorTexture,Tt)),Promise.all(s)}}class DS{constructor(e){this.parser=e,this.name=at.EXT_MATERIALS_BUMP}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Rn}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&s.push(n.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(s)}}class LS{constructor(e){this.parser=e,this.name=at.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:Rn}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&s.push(n.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(s)}}class NS{constructor(e){this.parser=e,this.name=at.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,i=n.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const s=i.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class US{constructor(e){this.parser=e,this.name=at.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=i.images[o.source];let c=n.textureLoader;if(a.uri){const l=n.options.manager.getHandler(a.uri);l!==null&&(c=l)}return n.loadTextureImage(e,o.source,c)}}class BS{constructor(e){this.parser=e,this.name=at.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=i.images[o.source];let c=n.textureLoader;if(a.uri){const l=n.options.manager.getHandler(a.uri);l!==null&&(c=l)}return n.loadTextureImage(e,o.source,c)}}class OS{constructor(e){this.name=at.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(a){const c=i.byteOffset||0,l=i.byteLength||0,h=i.count,u=i.byteStride,f=new Uint8Array(a,c,l);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(h,u,f,i.mode,i.filter).then(function(d){return d.buffer}):o.ready.then(function(){const d=new ArrayBuffer(h*u);return o.decodeGltfBuffer(new Uint8Array(d),h,u,f,i.mode,i.filter),d})})}else return null}}class FS{constructor(e){this.name=at.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const i=t.meshes[n.mesh];for(const l of i.primitives)if(l.mode!==Dn.TRIANGLES&&l.mode!==Dn.TRIANGLE_STRIP&&l.mode!==Dn.TRIANGLE_FAN&&l.mode!==void 0)return null;const o=n.extensions[this.name].attributes,a=[],c={};for(const l in o)a.push(this.parser.getDependency("accessor",o[l]).then(h=>(c[l]=h,c[l])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(l=>{const h=l.pop(),u=h.isGroup?h.children:[h],f=l[0].count,d=[];for(const g of u){const _=new We,m=new U,p=new wt,v=new U(1,1,1),y=new _c(g.geometry,g.material,f);for(let x=0;x<f;x++)c.TRANSLATION&&m.fromBufferAttribute(c.TRANSLATION,x),c.ROTATION&&p.fromBufferAttribute(c.ROTATION,x),c.SCALE&&v.fromBufferAttribute(c.SCALE,x),y.setMatrixAt(x,_.compose(m,p,v));for(const x in c)if(x==="_COLOR_0"){const A=c[x];y.instanceColor=new Ji(A.array,A.itemSize,A.normalized)}else x!=="TRANSLATION"&&x!=="ROTATION"&&x!=="SCALE"&&g.geometry.setAttribute(x,c[x]);ct.prototype.copy.call(y,g),this.parser.assignFinalMaterial(y),d.push(y)}return h.isGroup?(h.clear(),h.add(...d),h):d[0]}))}}const qm="glTF",Io=12,Xm={JSON:1313821514,BIN:5130562};class zS{constructor(e){this.name=at.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Io),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==qm)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-Io,s=new DataView(e,Io);let o=0;for(;o<i;){const a=s.getUint32(o,!0);o+=4;const c=s.getUint32(o,!0);if(o+=4,c===Xm.JSON){const l=new Uint8Array(e,Io+o,a);this.content=n.decode(l)}else if(c===Xm.BIN){const l=Io+o;this.body=e.slice(l,l+a)}o+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class kS{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=at.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,i=this.dracoLoader,s=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,a={},c={},l={};for(const h in o){const u=Hu[h]||h.toLowerCase();a[u]=o[h]}for(const h in e.attributes){const u=Hu[h]||h.toLowerCase();if(o[h]!==void 0){const f=n.accessors[e.attributes[h]],d=Is[f.componentType];l[u]=d.name,c[u]=f.normalized===!0}}return t.getDependency("bufferView",s).then(function(h){return new Promise(function(u,f){i.decodeDracoFile(h,function(d){for(const g in d.attributes){const _=d.attributes[g],m=c[g];m!==void 0&&(_.normalized=m)}u(d)},a,l,Xt,f)})})}}class VS{constructor(){this.name=at.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 HS{constructor(){this.name=at.KHR_MESH_QUANTIZATION}}class Zm extends _s{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=a*2,l=a*3,h=i-t,u=(n-t)/h,f=u*u,d=f*u,g=e*l,_=g-l,m=-2*d+3*f,p=d-f,v=1-m,y=p-f+u;for(let x=0;x!==a;x++){const A=o[_+x+a],E=o[_+x+c]*h,I=o[g+x+a],D=o[g+x]*h;s[x]=v*A+y*E+m*I+p*D}return s}}const GS=new wt;class WS extends Zm{interpolate_(e,t,n,i){const s=super.interpolate_(e,t,n,i);return GS.fromArray(s).normalize().toArray(s),s}}const Dn={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},Is={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Ym={9728:Mt,9729:pt,9984:Ko,9985:Ur,9986:Hi,9987:Mn},Qm={33071:tn,33648:Nr,10497:yi},Vu={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Hu={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"},Bi={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},qS={CUBICSPLINE:void 0,LINEAR:zr,STEP:Fr},Gu={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function XS(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new gs({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Wn})),r.DefaultMaterial}function Sr(r,e,t){for(const n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function ti(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function ZS(r,e,t){let n=!1,i=!1,s=!1;for(let l=0,h=e.length;l<h;l++){const u=e[l];if(u.POSITION!==void 0&&(n=!0),u.NORMAL!==void 0&&(i=!0),u.COLOR_0!==void 0&&(s=!0),n&&i&&s)break}if(!n&&!i&&!s)return Promise.resolve(r);const o=[],a=[],c=[];for(let l=0,h=e.length;l<h;l++){const u=e[l];if(n){const f=u.POSITION!==void 0?t.getDependency("accessor",u.POSITION):r.attributes.position;o.push(f)}if(i){const f=u.NORMAL!==void 0?t.getDependency("accessor",u.NORMAL):r.attributes.normal;a.push(f)}if(s){const f=u.COLOR_0!==void 0?t.getDependency("accessor",u.COLOR_0):r.attributes.color;c.push(f)}}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(c)]).then(function(l){const h=l[0],u=l[1],f=l[2];return n&&(r.morphAttributes.position=h),i&&(r.morphAttributes.normal=u),s&&(r.morphAttributes.color=f),r.morphTargetsRelative=!0,r})}function YS(r,e){if(r.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)r.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(r.morphTargetInfluences.length===t.length){r.morphTargetDictionary={};for(let n=0,i=t.length;n<i;n++)r.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function QS(r){let e;const t=r.extensions&&r.extensions[at.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+Wu(t.attributes):e=r.indices+":"+Wu(r.attributes)+":"+r.mode,r.targets!==void 0)for(let n=0,i=r.targets.length;n<i;n++)e+=":"+Wu(r.targets[n]);return e}function Wu(r){let e="";const t=Object.keys(r).sort();for(let n=0,i=t.length;n<i;n++)e+=t[n]+":"+r[t[n]]+";";return e}function qu(r){switch(r){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 KS(r){return r.search(/\.jpe?g($|\?)/i)>0||r.search(/^data\:image\/jpeg/)===0?"image/jpeg":r.search(/\.webp($|\?)/i)>0||r.search(/^data\:image\/webp/)===0?"image/webp":r.search(/\.ktx2($|\?)/i)>0||r.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const jS=new We;class JS{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new xS,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,i=-1,s=!1,o=-1;if(typeof navigator<"u"){const a=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(a)===!0;const c=a.match(/Version\/(\d+)/);i=n&&c?parseInt(c[1],10):-1,s=a.indexOf("Firefox")>-1,o=s?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&i<17||s&&o<98?this.textureLoader=new lu(this.options.manager):this.textureLoader=new Up(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new An(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,i=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(o){const a={scene:o[0][i.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:i.asset,parser:n,userData:{}};return Sr(s,a,i),ti(a,i),Promise.all(n._invokeAll(function(c){return c.afterRoot&&c.afterRoot(a)})).then(function(){for(const c of a.scenes)c.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let i=0,s=t.length;i<s;i++){const o=t[i].joints;for(let a=0,c=o.length;a<c;a++)e[o[a]].isBone=!0}for(let i=0,s=e.length;i<s;i++){const o=e[i];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(n[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const i=n.clone(),s=(o,a)=>{const c=this.associations.get(o);c!=null&&this.associations.set(a,c);for(const[l,h]of o.children.entries())s(h,a.children[l])};return s(n,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const i=e(t[n]);if(i)return i}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let i=0;i<t.length;i++){const s=e(t[i]);s&&n.push(s)}return n}getDependency(e,t){const n=e+":"+t;let i=this.cache.get(n);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this._invokeOne(function(s){return s.loadNode&&s.loadNode(t)});break;case"mesh":i=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":i=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(t)});break;case"camera":i=this.loadCamera(t);break;default:if(i=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(e,t)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(n,i)}return i}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(i.map(function(s,o){return n.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[at.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(s,o){n.load(Li.resolveURL(t.uri,i.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const i=t.byteLength||0,s=t.byteOffset||0;return n.slice(s,s+i)})}loadAccessor(e){const t=this,n=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const o=Vu[i.type],a=Is[i.componentType],c=i.normalized===!0,l=new a(i.count*o);return Promise.resolve(new ot(l,o,c))}const s=[];return i.bufferView!==void 0?s.push(this.getDependency("bufferView",i.bufferView)):s.push(null),i.sparse!==void 0&&(s.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(s).then(function(o){const a=o[0],c=Vu[i.type],l=Is[i.componentType],h=l.BYTES_PER_ELEMENT,u=h*c,f=i.byteOffset||0,d=i.bufferView!==void 0?n.bufferViews[i.bufferView].byteStride:void 0,g=i.normalized===!0;let _,m;if(d&&d!==u){const p=Math.floor(f/d),v="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+p+":"+i.count;let y=t.cache.get(v);y||(_=new l(a,p*d,i.count*d/h),y=new os(_,d/h),t.cache.add(v,y)),m=new fi(y,c,f%d/h,g)}else a===null?_=new l(i.count*c):_=new l(a,f,i.count*c),m=new ot(_,c,g);if(i.sparse!==void 0){const p=Vu.SCALAR,v=Is[i.sparse.indices.componentType],y=i.sparse.indices.byteOffset||0,x=i.sparse.values.byteOffset||0,A=new v(o[1],y,i.sparse.count*p),E=new l(o[2],x,i.sparse.count*c);a!==null&&(m=new ot(m.array.slice(),m.itemSize,m.normalized)),m.normalized=!1;for(let I=0,D=A.length;I<D;I++){const b=A[I];if(m.setX(b,E[I*c]),c>=2&&m.setY(b,E[I*c+1]),c>=3&&m.setZ(b,E[I*c+2]),c>=4&&m.setW(b,E[I*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}m.normalized=g}return m})}loadTexture(e){const t=this.json,n=this.options,s=t.textures[e].source,o=t.images[s];let a=this.textureLoader;if(o.uri){const c=n.manager.getHandler(o.uri);c!==null&&(a=c)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,n){const i=this,s=this.json,o=s.textures[e],a=s.images[t],c=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[c])return this.textureCache[c];const l=this.loadImageSource(t,n).then(function(h){h.flipY=!1,h.name=o.name||a.name||"",h.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(h.name=a.uri);const f=(s.samplers||{})[o.sampler]||{};return h.magFilter=Ym[f.magFilter]||pt,h.minFilter=Ym[f.minFilter]||Mn,h.wrapS=Qm[f.wrapS]||yi,h.wrapT=Qm[f.wrapT]||yi,h.generateMipmaps=!h.isCompressedTexture&&h.minFilter!==Mt&&h.minFilter!==pt,i.associations.set(h,{textures:e}),h}).catch(function(){return null});return this.textureCache[c]=l,l}loadImageSource(e,t){const n=this,i=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());const o=i.images[e],a=self.URL||self.webkitURL;let c=o.uri||"",l=!1;if(o.bufferView!==void 0)c=n.getDependency("bufferView",o.bufferView).then(function(u){l=!0;const f=new Blob([u],{type:o.mimeType});return c=a.createObjectURL(f),c});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const h=Promise.resolve(c).then(function(u){return new Promise(function(f,d){let g=f;t.isImageBitmapLoader===!0&&(g=function(_){const m=new xt(_);m.needsUpdate=!0,f(m)}),t.load(Li.resolveURL(u,s.path),g,void 0,d)})}).then(function(u){return l===!0&&a.revokeObjectURL(c),ti(u,o),u.userData.mimeType=o.mimeType||KS(o.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",c),u});return this.sourceCache[e]=h,h}assignTexture(e,t,n,i){const s=this;return this.getDependency("texture",n.index).then(function(o){if(!o)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(o=o.clone(),o.channel=n.texCoord),s.extensions[at.KHR_TEXTURE_TRANSFORM]){const a=n.extensions!==void 0?n.extensions[at.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const c=s.associations.get(o);o=s.extensions[at.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),s.associations.set(o,c)}}return i!==void 0&&(o.colorSpace=i),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const i=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+n.uuid;let c=this.cache.get(a);c||(c=new Ec,zt.prototype.copy.call(c,n),c.color.copy(n.color),c.map=n.map,c.sizeAttenuation=!1,this.cache.add(a,c)),n=c}else if(e.isLine){const a="LineBasicMaterial:"+n.uuid;let c=this.cache.get(a);c||(c=new qt,zt.prototype.copy.call(c,n),c.color.copy(n.color),c.map=n.map,this.cache.add(a,c)),n=c}if(i||s||o){let a="ClonedMaterial:"+n.uuid+":";i&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let c=this.cache.get(a);c||(c=n.clone(),s&&(c.vertexColors=!0),o&&(c.flatShading=!0),i&&(c.normalScale&&(c.normalScale.y*=-1),c.clearcoatNormalScale&&(c.clearcoatNormalScale.y*=-1)),this.cache.add(a,c),this.associations.set(c,this.associations.get(n))),n=c}e.material=n}getMaterialType(){return gs}loadMaterial(e){const t=this,n=this.json,i=this.extensions,s=n.materials[e];let o;const a={},c=s.extensions||{},l=[];if(c[at.KHR_MATERIALS_UNLIT]){const u=i[at.KHR_MATERIALS_UNLIT];o=u.getMaterialType(),l.push(u.extendParams(a,s,t))}else{const u=s.pbrMetallicRoughness||{};if(a.color=new xe(1,1,1),a.opacity=1,Array.isArray(u.baseColorFactor)){const f=u.baseColorFactor;a.color.setRGB(f[0],f[1],f[2],Xt),a.opacity=f[3]}u.baseColorTexture!==void 0&&l.push(t.assignTexture(a,"map",u.baseColorTexture,Tt)),a.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,a.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(l.push(t.assignTexture(a,"metalnessMap",u.metallicRoughnessTexture)),l.push(t.assignTexture(a,"roughnessMap",u.metallicRoughnessTexture))),o=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Sn);const h=s.alphaMode||Gu.OPAQUE;if(h===Gu.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,h===Gu.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==un&&(l.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new he(1,1),s.normalTexture.scale!==void 0)){const u=s.normalTexture.scale;a.normalScale.set(u,u)}if(s.occlusionTexture!==void 0&&o!==un&&(l.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==un){const u=s.emissiveFactor;a.emissive=new xe().setRGB(u[0],u[1],u[2],Xt)}return s.emissiveTexture!==void 0&&o!==un&&l.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,Tt)),Promise.all(l).then(function(){const u=new o(a);return s.name&&(u.name=s.name),ti(u,s),t.associations.set(u,{materials:e}),s.extensions&&Sr(i,u,s),u})}createUniqueName(e){const t=lt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,i=this.primitiveCache;function s(a){return n[at.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(c){return Km(c,a,t)})}const o=[];for(let a=0,c=e.length;a<c;a++){const l=e[a],h=QS(l),u=i[h];if(u)o.push(u.promise);else{let f;l.extensions&&l.extensions[at.KHR_DRACO_MESH_COMPRESSION]?f=s(l):f=Km(new Ke,l,t),i[h]={primitive:l,promise:f},o.push(f)}}return Promise.all(o)}loadMesh(e){const t=this,n=this.json,i=this.extensions,s=n.meshes[e],o=s.primitives,a=[];for(let c=0,l=o.length;c<l;c++){const h=o[c].material===void 0?XS(this.cache):this.getDependency("material",o[c].material);a.push(h)}return a.push(t.loadGeometries(o)),Promise.all(a).then(function(c){const l=c.slice(0,c.length-1),h=c[c.length-1],u=[];for(let d=0,g=h.length;d<g;d++){const _=h[d],m=o[d];let p;const v=l[d];if(m.mode===Dn.TRIANGLES||m.mode===Dn.TRIANGLE_STRIP||m.mode===Dn.TRIANGLE_FAN||m.mode===void 0)p=s.isSkinnedMesh===!0?new Lh(_,v):new St(_,v),p.isSkinnedMesh===!0&&p.normalizeSkinWeights(),m.mode===Dn.TRIANGLE_STRIP?p.geometry=Wm(p.geometry,eh):m.mode===Dn.TRIANGLE_FAN&&(p.geometry=Wm(p.geometry,Oa));else if(m.mode===Dn.LINES)p=new In(_,v);else if(m.mode===Dn.LINE_STRIP)p=new di(_,v);else if(m.mode===Dn.LINE_LOOP)p=new Fh(_,v);else if(m.mode===Dn.POINTS)p=new kh(_,v);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(p.geometry.morphAttributes).length>0&&YS(p,s),p.name=t.createUniqueName(s.name||"mesh_"+e),ti(p,s),m.extensions&&Sr(i,p,m),t.assignFinalMaterial(p),u.push(p)}for(let d=0,g=u.length;d<g;d++)t.associations.set(u[d],{meshes:e,primitives:d});if(u.length===1)return s.extensions&&Sr(i,u[0],s),u[0];const f=new Kn;s.extensions&&Sr(i,f,s),t.associations.set(f,{meshes:e});for(let d=0,g=u.length;d<g;d++)f.add(u[d]);return f})}loadCamera(e){let t;const n=this.json.cameras[e],i=n[n.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new kt(ka.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):n.type==="orthographic"&&(t=new ur(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),ti(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let i=0,s=t.joints.length;i<s;i++)n.push(this._loadNodeShallow(t.joints[i]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(i){const s=i.pop(),o=i,a=[],c=[];for(let l=0,h=o.length;l<h;l++){const u=o[l];if(u){a.push(u);const f=new We;s!==null&&f.fromArray(s.array,l*16),c.push(f)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[l])}return new no(a,c)})}loadAnimation(e){const t=this.json,n=this,i=t.animations[e],s=i.name?i.name:"animation_"+e,o=[],a=[],c=[],l=[],h=[];for(let u=0,f=i.channels.length;u<f;u++){const d=i.channels[u],g=i.samplers[d.sampler],_=d.target,m=_.node,p=i.parameters!==void 0?i.parameters[g.input]:g.input,v=i.parameters!==void 0?i.parameters[g.output]:g.output;_.node!==void 0&&(o.push(this.getDependency("node",m)),a.push(this.getDependency("accessor",p)),c.push(this.getDependency("accessor",v)),l.push(g),h.push(_))}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(c),Promise.all(l),Promise.all(h)]).then(function(u){const f=u[0],d=u[1],g=u[2],_=u[3],m=u[4],p=[];for(let y=0,x=f.length;y<x;y++){const A=f[y],E=d[y],I=g[y],D=_[y],b=m[y];if(A===void 0)continue;A.updateMatrix&&A.updateMatrix();const C=n._createAnimationTracks(A,E,I,D,b);if(C)for(let B=0;B<C.length;B++)p.push(C[B])}const v=new vs(s,void 0,p);return ti(v,i),v})}createNodeMesh(e){const t=this.json,n=this,i=t.nodes[e];return i.mesh===void 0?null:n.getDependency("mesh",i.mesh).then(function(s){const o=n._getNodeRef(n.meshCache,i.mesh,s);return i.weights!==void 0&&o.traverse(function(a){if(!!a.isMesh)for(let c=0,l=i.weights.length;c<l;c++)a.morphTargetInfluences[c]=i.weights[c]}),o})}loadNode(e){const t=this.json,n=this,i=t.nodes[e],s=n._loadNodeShallow(e),o=[],a=i.children||[];for(let l=0,h=a.length;l<h;l++)o.push(n.getDependency("node",a[l]));const c=i.skin===void 0?Promise.resolve(null):n.getDependency("skin",i.skin);return Promise.all([s,Promise.all(o),c]).then(function(l){const h=l[0],u=l[1],f=l[2];f!==null&&h.traverse(function(d){!d.isSkinnedMesh||d.bind(f,jS)});for(let d=0,g=u.length;d<g;d++)h.add(u[d]);return h})}_loadNodeShallow(e){const t=this.json,n=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const s=t.nodes[e],o=s.name?i.createUniqueName(s.name):"",a=[],c=i._invokeOne(function(l){return l.createNodeMesh&&l.createNodeMesh(e)});return c&&a.push(c),s.camera!==void 0&&a.push(i.getDependency("camera",s.camera).then(function(l){return i._getNodeRef(i.cameraCache,s.camera,l)})),i._invokeAll(function(l){return l.createNodeAttachment&&l.createNodeAttachment(e)}).forEach(function(l){a.push(l)}),this.nodeCache[e]=Promise.all(a).then(function(l){let h;if(s.isBone===!0?h=new mc:l.length>1?h=new Kn:l.length===1?h=l[0]:h=new ct,h!==l[0])for(let u=0,f=l.length;u<f;u++)h.add(l[u]);if(s.name&&(h.userData.name=s.name,h.name=o),ti(h,s),s.extensions&&Sr(n,h,s),s.matrix!==void 0){const u=new We;u.fromArray(s.matrix),h.applyMatrix4(u)}else s.translation!==void 0&&h.position.fromArray(s.translation),s.rotation!==void 0&&h.quaternion.fromArray(s.rotation),s.scale!==void 0&&h.scale.fromArray(s.scale);if(!i.associations.has(h))i.associations.set(h,{});else if(s.mesh!==void 0&&i.meshCache.refs[s.mesh]>1){const u=i.associations.get(h);i.associations.set(h,{...u})}return i.associations.get(h).nodes=e,h}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],i=this,s=new Kn;n.name&&(s.name=i.createUniqueName(n.name)),ti(s,n),n.extensions&&Sr(t,s,n);const o=n.nodes||[],a=[];for(let c=0,l=o.length;c<l;c++)a.push(i.getDependency("node",o[c]));return Promise.all(a).then(function(c){for(let h=0,u=c.length;h<u;h++)s.add(c[h]);const l=h=>{const u=new Map;for(const[f,d]of i.associations)(f instanceof zt||f instanceof xt)&&u.set(f,d);return h.traverse(f=>{const d=i.associations.get(f);d!=null&&u.set(f,d)}),u};return i.associations=l(s),s})}_createAnimationTracks(e,t,n,i,s){const o=[],a=e.name?e.name:e.uuid,c=[];Bi[s.path]===Bi.weights?e.traverse(function(f){f.morphTargetInfluences&&c.push(f.name?f.name:f.uuid)}):c.push(a);let l;switch(Bi[s.path]){case Bi.weights:l=ar;break;case Bi.rotation:l=cr;break;case Bi.translation:case Bi.scale:l=hr;break;default:switch(n.itemSize){case 1:l=ar;break;case 2:case 3:default:l=hr;break}break}const h=i.interpolation!==void 0?qS[i.interpolation]:zr,u=this._getArrayFromAccessor(n);for(let f=0,d=c.length;f<d;f++){const g=new l(c[f]+"."+Bi[s.path],t.array,u,h);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(g),o.push(g)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=qu(t.constructor),i=new Float32Array(t.length);for(let s=0,o=t.length;s<o;s++)i[s]=t[s]*n;t=i}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const i=this instanceof cr?WS:Zm;return new i(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function $S(r,e,t){const n=e.attributes,i=new Gt;if(n.POSITION!==void 0){const a=t.json.accessors[n.POSITION],c=a.min,l=a.max;if(c!==void 0&&l!==void 0){if(i.set(new U(c[0],c[1],c[2]),new U(l[0],l[1],l[2])),a.normalized){const h=qu(Is[a.componentType]);i.min.multiplyScalar(h),i.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const a=new U,c=new U;for(let l=0,h=s.length;l<h;l++){const u=s[l];if(u.POSITION!==void 0){const f=t.json.accessors[u.POSITION],d=f.min,g=f.max;if(d!==void 0&&g!==void 0){if(c.setX(Math.max(Math.abs(d[0]),Math.abs(g[0]))),c.setY(Math.max(Math.abs(d[1]),Math.abs(g[1]))),c.setZ(Math.max(Math.abs(d[2]),Math.abs(g[2]))),f.normalized){const _=qu(Is[f.componentType]);c.multiplyScalar(_)}a.max(c)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(a)}r.boundingBox=i;const o=new Pt;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,r.boundingSphere=o}function Km(r,e,t){const n=e.attributes,i=[];function s(o,a){return t.getDependency("accessor",o).then(function(c){r.setAttribute(a,c)})}for(const o in n){const a=Hu[o]||o.toLowerCase();a in r.attributes||i.push(s(n[o],a))}if(e.indices!==void 0&&!r.index){const o=t.getDependency("accessor",e.indices).then(function(a){r.setIndex(a)});i.push(o)}return rt.workingColorSpace!==Xt&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${rt.workingColorSpace}" not supported.`),ti(r,e),$S(r,e,t),Promise.all(i).then(function(){return e.targets!==void 0?ZS(r,e.targets,t):r})}const Xu=new WeakMap;class eM extends Jt{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,i){const s=new An(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,o=>{this.parse(o,t,i)},n,i)}parse(e,t,n=()=>{}){this.decodeDracoFile(e,t,null,null,Tt,n).catch(n)}decodeDracoFile(e,t,n,i,s=Xt,o=()=>{}){const a={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:s};return this.decodeGeometry(e,a).then(t).catch(o)}decodeGeometry(e,t){const n=JSON.stringify(t);if(Xu.has(e)){const c=Xu.get(e);if(c.key===n)return c.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 i;const s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(c=>(i=c,new Promise((l,h)=>{i._callbacks[s]={resolve:l,reject:h},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(c=>this._createGeometry(c.geometry));return a.catch(()=>!0).then(()=>{i&&s&&this._releaseTask(i,s)}),Xu.set(e,{key:n,promise:a}),a}_createGeometry(e){const t=new Ke;e.index&&t.setIndex(new ot(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const{name:i,array:s,itemSize:o,stride:a,vertexColorSpace:c}=e.attributes[n];let l;if(o===a)l=new ot(s,o);else{const h=new os(s,a);l=new fi(h,o,0)}i==="color"&&(this._assignVertexColorSpace(l,c),l.normalized=!(s instanceof Float32Array)),t.setAttribute(i,l)}return t}_assignVertexColorSpace(e,t){if(t!==Tt)return;const n=new xe;for(let i=0,s=e.count;i<s;i++)n.fromBufferAttribute(e,i),rt.colorSpaceToWorking(n,Tt),e.setXYZ(i,n.r,n.g,n.b)}_loadLibrary(e,t){const n=new An(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((i,s)=>{n.load(e,i,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{const i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);const s=tM.toString(),o=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(`
|
|
4036
4036
|
`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const i=new Worker(this.workerSourceURL);i._callbacks={},i._taskCosts={},i._taskLoad=0,i.postMessage({type:"init",decoderConfig:this.decoderConfig}),i.onmessage=function(s){const o=s.data;switch(o.type){case"decode":i._callbacks[o.id].resolve(o);break;case"error":i._callbacks[o.id].reject(o);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+o.type+'"')}},this.workerPool.push(i)}else this.workerPool.sort(function(i,s){return i._taskLoad>s._taskLoad?-1:1});const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function tM(){let r,e;onmessage=function(o){const a=o.data;switch(a.type){case"init":r=a.decoderConfig,e=new Promise(function(h){r.onModuleLoaded=function(u){h({draco:u})},DracoDecoderModule(r)});break;case"decode":const c=a.buffer,l=a.taskConfig;e.then(h=>{const u=h.draco,f=new u.Decoder;try{const d=t(u,f,new Int8Array(c),l),g=d.attributes.map(_=>_.array.buffer);d.index&&g.push(d.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:d},g)}catch(d){console.error(d),self.postMessage({type:"error",id:a.id,error:d.message})}finally{u.destroy(f)}});break}};function t(o,a,c,l){const h=l.attributeIDs,u=l.attributeTypes;let f,d;const g=a.GetEncodedGeometryType(c);if(g===o.TRIANGULAR_MESH)f=new o.Mesh,d=a.DecodeArrayToMesh(c,c.byteLength,f);else if(g===o.POINT_CLOUD)f=new o.PointCloud,d=a.DecodeArrayToPointCloud(c,c.byteLength,f);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!d.ok()||f.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+d.error_msg());const _={index:null,attributes:[]};for(const m in h){const p=self[u[m]];let v,y;if(l.useUniqueIDs)y=h[m],v=a.GetAttributeByUniqueId(f,y);else{if(y=a.GetAttributeId(f,o[h[m]]),y===-1)continue;v=a.GetAttribute(f,y)}const x=i(o,a,f,m,p,v);m==="color"&&(x.vertexColorSpace=l.vertexColorSpace),_.attributes.push(x)}return g===o.TRIANGULAR_MESH&&(_.index=n(o,a,f)),o.destroy(f),_}function n(o,a,c){const h=c.num_faces()*3,u=h*4,f=o._malloc(u);a.GetTrianglesUInt32Array(c,u,f);const d=new Uint32Array(o.HEAPF32.buffer,f,h).slice();return o._free(f),{array:d,itemSize:1}}function i(o,a,c,l,h,u){const f=c.num_points(),d=u.num_components(),g=s(o,h),_=d*h.BYTES_PER_ELEMENT,m=Math.ceil(_/4)*4,p=m/h.BYTES_PER_ELEMENT,v=f*_,y=f*m,x=o._malloc(v);a.GetAttributeDataArrayForAllPoints(c,u,g,v,x);const A=new h(o.HEAPF32.buffer,x,v/h.BYTES_PER_ELEMENT);let E;if(_===m)E=A.slice();else{E=new h(y/h.BYTES_PER_ELEMENT);let I=0;for(let D=0,b=A.length;D<b;D++){for(let C=0;C<d;C++)E[I+C]=A[D*d+C];I+=p}}return o._free(x),{name:l,count:f,itemSize:d,array:E,stride:p}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}class nM{constructor(){$(this,"loader");this.loader=new yS;const e=new eM;e.setDecoderPath("/draco/"),this.loader.setDRACOLoader(e)}async load(e){return this.loadFromUrlOrZip(e)}async loadFromUrlOrZip(e){return e.toLowerCase().endsWith(".zip")?this.loadFromZipUrl(e):new Promise((t,n)=>{this.loader.load(e,i=>{const s=i.scene||i.scenes[0];if(!s)return n(new Error("Model contains no scene and cannot be viewed."));t(s)},void 0,n)})}async loadFromZipUrl(e){throw new Error("Not implemented")}}function yl(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var jm={exports:{}};/*!
|
|
4037
4037
|
|
|
4038
4038
|
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
|