@epigraph/configurator 2.0.2 → 2.0.3
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/README.md +98 -98
- package/dist/index.js +3 -3
- package/package.json +87 -88
package/dist/index.js
CHANGED
|
@@ -8810,12 +8810,12 @@ void main() {
|
|
|
8810
8810
|
|
|
8811
8811
|
}
|
|
8812
8812
|
|
|
8813
|
-
}`;class WebXRDepthSensing{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(s,a,b){if(this.texture===null){const _e=new Texture,Kt=s.properties.get(_e);Kt.__webglTexture=a.texture,(a.depthNear!=b.depthNear||a.depthFar!=b.depthFar)&&(this.depthNear=a.depthNear,this.depthFar=a.depthFar),this.texture=_e}}render(s,a){if(this.texture!==null){if(this.mesh===null){const b=a.cameras[0].viewport,_e=new ShaderMaterial({vertexShader:_occlusion_vertex,fragmentShader:_occlusion_fragment,uniforms:{depthColor:{value:this.texture},depthWidth:{value:b.z},depthHeight:{value:b.w}}});this.mesh=new Mesh(new PlaneGeometry(20,20),_e)}s.render(this.mesh,a)}}reset(){this.texture=null,this.mesh=null}}class WebXRManager extends EventDispatcher$2{constructor(s,a){super();const b=this;let _e=null,Kt=1,an=null,_n="local-floor",On=1,$n=null,dr=null,fr=null,pr=null,Ar=null,Or=null;const Xr=new WebXRDepthSensing,ss=a.getContextAttributes();let kr=null,us=null;const hs=[],ds=[],fs=new Vector2;let Gs=null;const ga=new PerspectiveCamera;ga.layers.enable(1),ga.viewport=new Vector4;const So=new PerspectiveCamera;So.layers.enable(2),So.viewport=new Vector4;const go=[ga,So],xo=new ArrayCamera;xo.layers.enable(1),xo.layers.enable(2);let Mo=null,yl=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Py){let Ny=hs[Py];return Ny===void 0&&(Ny=new WebXRController,hs[Py]=Ny),Ny.getTargetRaySpace()},this.getControllerGrip=function(Py){let Ny=hs[Py];return Ny===void 0&&(Ny=new WebXRController,hs[Py]=Ny),Ny.getGripSpace()},this.getHand=function(Py){let Ny=hs[Py];return Ny===void 0&&(Ny=new WebXRController,hs[Py]=Ny),Ny.getHandSpace()};function Al(Py){const Ny=ds.indexOf(Py.inputSource);if(Ny===-1)return;const wy=hs[Ny];wy!==void 0&&(wy.update(Py.inputSource,Py.frame,$n||an),wy.dispatchEvent({type:Py.type,data:Py.inputSource}))}function xl(){_e.removeEventListener("select",Al),_e.removeEventListener("selectstart",Al),_e.removeEventListener("selectend",Al),_e.removeEventListener("squeeze",Al),_e.removeEventListener("squeezestart",Al),_e.removeEventListener("squeezeend",Al),_e.removeEventListener("end",xl),_e.removeEventListener("inputsourceschange",ep);for(let Py=0;Py<hs.length;Py++){const Ny=ds[Py];Ny!==null&&(ds[Py]=null,hs[Py].disconnect(Ny))}Mo=null,yl=null,Xr.reset(),s.setRenderTarget(kr),Ar=null,pr=null,fr=null,_e=null,us=null,My.stop(),b.isPresenting=!1,s.setPixelRatio(Gs),s.setSize(fs.width,fs.height,!1),b.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Py){Kt=Py,b.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Py){_n=Py,b.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return $n||an},this.setReferenceSpace=function(Py){$n=Py},this.getBaseLayer=function(){return pr!==null?pr:Ar},this.getBinding=function(){return fr},this.getFrame=function(){return Or},this.getSession=function(){return _e},this.setSession=async function(Py){if(_e=Py,_e!==null){if(kr=s.getRenderTarget(),_e.addEventListener("select",Al),_e.addEventListener("selectstart",Al),_e.addEventListener("selectend",Al),_e.addEventListener("squeeze",Al),_e.addEventListener("squeezestart",Al),_e.addEventListener("squeezeend",Al),_e.addEventListener("end",xl),_e.addEventListener("inputsourceschange",ep),ss.xrCompatible!==!0&&await a.makeXRCompatible(),Gs=s.getPixelRatio(),s.getSize(fs),_e.renderState.layers===void 0){const Ny={antialias:ss.antialias,alpha:!0,depth:ss.depth,stencil:ss.stencil,framebufferScaleFactor:Kt};Ar=new XRWebGLLayer(_e,a,Ny),_e.updateRenderState({baseLayer:Ar}),s.setPixelRatio(1),s.setSize(Ar.framebufferWidth,Ar.framebufferHeight,!1),us=new WebGLRenderTarget(Ar.framebufferWidth,Ar.framebufferHeight,{format:RGBAFormat,type:UnsignedByteType,colorSpace:s.outputColorSpace,stencilBuffer:ss.stencil})}else{let Ny=null,wy=null,Wy=null;ss.depth&&(Wy=ss.stencil?a.DEPTH24_STENCIL8:a.DEPTH_COMPONENT24,Ny=ss.stencil?DepthStencilFormat:DepthFormat,wy=ss.stencil?UnsignedInt248Type:UnsignedIntType);const DA={colorFormat:a.RGBA8,depthFormat:Wy,scaleFactor:Kt};fr=new XRWebGLBinding(_e,a),pr=fr.createProjectionLayer(DA),_e.updateRenderState({layers:[pr]}),s.setPixelRatio(1),s.setSize(pr.textureWidth,pr.textureHeight,!1),us=new WebGLRenderTarget(pr.textureWidth,pr.textureHeight,{format:RGBAFormat,type:UnsignedByteType,depthTexture:new DepthTexture(pr.textureWidth,pr.textureHeight,wy,void 0,void 0,void 0,void 0,void 0,void 0,Ny),stencilBuffer:ss.stencil,colorSpace:s.outputColorSpace,samples:ss.antialias?4:0});const UA=s.properties.get(us);UA.__ignoreDepthValues=pr.ignoreDepthValues}us.isXRRenderTarget=!0,this.setFoveation(On),$n=null,an=await _e.requestReferenceSpace(_n),My.setContext(_e),My.start(),b.isPresenting=!0,b.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(_e!==null)return _e.environmentBlendMode};function ep(Py){for(let Ny=0;Ny<Py.removed.length;Ny++){const wy=Py.removed[Ny],Wy=ds.indexOf(wy);Wy>=0&&(ds[Wy]=null,hs[Wy].disconnect(wy))}for(let Ny=0;Ny<Py.added.length;Ny++){const wy=Py.added[Ny];let Wy=ds.indexOf(wy);if(Wy===-1){for(let UA=0;UA<hs.length;UA++)if(UA>=ds.length){ds.push(wy),Wy=UA;break}else if(ds[UA]===null){ds[UA]=wy,Wy=UA;break}if(Wy===-1)break}const DA=hs[Wy];DA&&DA.connect(wy)}}const _f=new Vector3,np=new Vector3;function _l(Py,Ny,wy){_f.setFromMatrixPosition(Ny.matrixWorld),np.setFromMatrixPosition(wy.matrixWorld);const Wy=_f.distanceTo(np),DA=Ny.projectionMatrix.elements,UA=wy.projectionMatrix.elements,jA=DA[14]/(DA[10]-1),PA=DA[14]/(DA[10]+1),mA=(DA[9]+1)/DA[5],FA=(DA[9]-1)/DA[5],GA=(DA[8]-1)/DA[0],aE=(UA[8]+1)/UA[0],YA=jA*GA,pA=jA*aE,Ry=Wy/(-GA+aE),LA=Ry*-GA;Ny.matrixWorld.decompose(Py.position,Py.quaternion,Py.scale),Py.translateX(LA),Py.translateZ(Ry),Py.matrixWorld.compose(Py.position,Py.quaternion,Py.scale),Py.matrixWorldInverse.copy(Py.matrixWorld).invert();const $A=jA+Ry,KA=PA+Ry,qA=YA-LA,AA=pA+(Wy-LA),Dy=mA*PA/KA*$A,WA=FA*PA/KA*$A;Py.projectionMatrix.makePerspective(qA,AA,Dy,WA,$A,KA),Py.projectionMatrixInverse.copy(Py.projectionMatrix).invert()}function Ml(Py,Ny){Ny===null?Py.matrixWorld.copy(Py.matrix):Py.matrixWorld.multiplyMatrices(Ny.matrixWorld,Py.matrix),Py.matrixWorldInverse.copy(Py.matrixWorld).invert()}this.updateCamera=function(Py){if(_e===null)return;Xr.texture!==null&&(Py.near=Xr.depthNear,Py.far=Xr.depthFar),xo.near=So.near=ga.near=Py.near,xo.far=So.far=ga.far=Py.far,(Mo!==xo.near||yl!==xo.far)&&(_e.updateRenderState({depthNear:xo.near,depthFar:xo.far}),Mo=xo.near,yl=xo.far,ga.near=Mo,ga.far=yl,So.near=Mo,So.far=yl,ga.updateProjectionMatrix(),So.updateProjectionMatrix(),Py.updateProjectionMatrix());const Ny=Py.parent,wy=xo.cameras;Ml(xo,Ny);for(let Wy=0;Wy<wy.length;Wy++)Ml(wy[Wy],Ny);wy.length===2?_l(xo,ga,So):xo.projectionMatrix.copy(ga.projectionMatrix),tp(Py,xo,Ny)};function tp(Py,Ny,wy){wy===null?Py.matrix.copy(Ny.matrixWorld):(Py.matrix.copy(wy.matrixWorld),Py.matrix.invert(),Py.matrix.multiply(Ny.matrixWorld)),Py.matrix.decompose(Py.position,Py.quaternion,Py.scale),Py.updateMatrixWorld(!0),Py.projectionMatrix.copy(Ny.projectionMatrix),Py.projectionMatrixInverse.copy(Ny.projectionMatrixInverse),Py.isPerspectiveCamera&&(Py.fov=RAD2DEG*2*Math.atan(1/Py.projectionMatrix.elements[5]),Py.zoom=1)}this.getCamera=function(){return xo},this.getFoveation=function(){if(!(pr===null&&Ar===null))return On},this.setFoveation=function(Py){On=Py,pr!==null&&(pr.fixedFoveation=Py),Ar!==null&&Ar.fixedFoveation!==void 0&&(Ar.fixedFoveation=Py)},this.hasDepthSensing=function(){return Xr.texture!==null};let El=null;function sp(Py,Ny){if(dr=Ny.getViewerPose($n||an),Or=Ny,dr!==null){const wy=dr.views;Ar!==null&&(s.setRenderTargetFramebuffer(us,Ar.framebuffer),s.setRenderTarget(us));let Wy=!1;wy.length!==xo.cameras.length&&(xo.cameras.length=0,Wy=!0);for(let UA=0;UA<wy.length;UA++){const jA=wy[UA];let PA=null;if(Ar!==null)PA=Ar.getViewport(jA);else{const FA=fr.getViewSubImage(pr,jA);PA=FA.viewport,UA===0&&(s.setRenderTargetTextures(us,FA.colorTexture,pr.ignoreDepthValues?void 0:FA.depthStencilTexture),s.setRenderTarget(us))}let mA=go[UA];mA===void 0&&(mA=new PerspectiveCamera,mA.layers.enable(UA),mA.viewport=new Vector4,go[UA]=mA),mA.matrix.fromArray(jA.transform.matrix),mA.matrix.decompose(mA.position,mA.quaternion,mA.scale),mA.projectionMatrix.fromArray(jA.projectionMatrix),mA.projectionMatrixInverse.copy(mA.projectionMatrix).invert(),mA.viewport.set(PA.x,PA.y,PA.width,PA.height),UA===0&&(xo.matrix.copy(mA.matrix),xo.matrix.decompose(xo.position,xo.quaternion,xo.scale)),Wy===!0&&xo.cameras.push(mA)}const DA=_e.enabledFeatures;if(DA&&DA.includes("depth-sensing")){const UA=fr.getDepthInformation(wy[0]);UA&&UA.isValid&&UA.texture&&Xr.init(s,UA,_e.renderState)}}for(let wy=0;wy<hs.length;wy++){const Wy=ds[wy],DA=hs[wy];Wy!==null&&DA!==void 0&&DA.update(Wy,Ny,$n||an)}Xr.render(s,xo),El&&El(Py,Ny),Ny.detectedPlanes&&b.dispatchEvent({type:"planesdetected",data:Ny}),Or=null}const My=new WebGLAnimation;My.setAnimationLoop(sp),this.setAnimationLoop=function(Py){El=Py},this.dispose=function(){}}}const _e1=new Euler,_m1=new Matrix4;function WebGLMaterials(o,s){function a(ss,kr){ss.matrixAutoUpdate===!0&&ss.updateMatrix(),kr.value.copy(ss.matrix)}function b(ss,kr){kr.color.getRGB(ss.fogColor.value,getUnlitUniformColorSpace(o)),kr.isFog?(ss.fogNear.value=kr.near,ss.fogFar.value=kr.far):kr.isFogExp2&&(ss.fogDensity.value=kr.density)}function _e(ss,kr,us,hs,ds){kr.isMeshBasicMaterial||kr.isMeshLambertMaterial?Kt(ss,kr):kr.isMeshToonMaterial?(Kt(ss,kr),fr(ss,kr)):kr.isMeshPhongMaterial?(Kt(ss,kr),dr(ss,kr)):kr.isMeshStandardMaterial?(Kt(ss,kr),pr(ss,kr),kr.isMeshPhysicalMaterial&&Ar(ss,kr,ds)):kr.isMeshMatcapMaterial?(Kt(ss,kr),Or(ss,kr)):kr.isMeshDepthMaterial?Kt(ss,kr):kr.isMeshDistanceMaterial?(Kt(ss,kr),Xr(ss,kr)):kr.isMeshNormalMaterial?Kt(ss,kr):kr.isLineBasicMaterial?(an(ss,kr),kr.isLineDashedMaterial&&_n(ss,kr)):kr.isPointsMaterial?On(ss,kr,us,hs):kr.isSpriteMaterial?$n(ss,kr):kr.isShadowMaterial?(ss.color.value.copy(kr.color),ss.opacity.value=kr.opacity):kr.isShaderMaterial&&(kr.uniformsNeedUpdate=!1)}function Kt(ss,kr){ss.opacity.value=kr.opacity,kr.color&&ss.diffuse.value.copy(kr.color),kr.emissive&&ss.emissive.value.copy(kr.emissive).multiplyScalar(kr.emissiveIntensity),kr.map&&(ss.map.value=kr.map,a(kr.map,ss.mapTransform)),kr.alphaMap&&(ss.alphaMap.value=kr.alphaMap,a(kr.alphaMap,ss.alphaMapTransform)),kr.bumpMap&&(ss.bumpMap.value=kr.bumpMap,a(kr.bumpMap,ss.bumpMapTransform),ss.bumpScale.value=kr.bumpScale,kr.side===BackSide&&(ss.bumpScale.value*=-1)),kr.normalMap&&(ss.normalMap.value=kr.normalMap,a(kr.normalMap,ss.normalMapTransform),ss.normalScale.value.copy(kr.normalScale),kr.side===BackSide&&ss.normalScale.value.negate()),kr.displacementMap&&(ss.displacementMap.value=kr.displacementMap,a(kr.displacementMap,ss.displacementMapTransform),ss.displacementScale.value=kr.displacementScale,ss.displacementBias.value=kr.displacementBias),kr.emissiveMap&&(ss.emissiveMap.value=kr.emissiveMap,a(kr.emissiveMap,ss.emissiveMapTransform)),kr.specularMap&&(ss.specularMap.value=kr.specularMap,a(kr.specularMap,ss.specularMapTransform)),kr.alphaTest>0&&(ss.alphaTest.value=kr.alphaTest);const us=s.get(kr),hs=us.envMap,ds=us.envMapRotation;if(hs&&(ss.envMap.value=hs,_e1.copy(ds),_e1.x*=-1,_e1.y*=-1,_e1.z*=-1,hs.isCubeTexture&&hs.isRenderTargetTexture===!1&&(_e1.y*=-1,_e1.z*=-1),ss.envMapRotation.value.setFromMatrix4(_m1.makeRotationFromEuler(_e1)),ss.flipEnvMap.value=hs.isCubeTexture&&hs.isRenderTargetTexture===!1?-1:1,ss.reflectivity.value=kr.reflectivity,ss.ior.value=kr.ior,ss.refractionRatio.value=kr.refractionRatio),kr.lightMap){ss.lightMap.value=kr.lightMap;const fs=o._useLegacyLights===!0?Math.PI:1;ss.lightMapIntensity.value=kr.lightMapIntensity*fs,a(kr.lightMap,ss.lightMapTransform)}kr.aoMap&&(ss.aoMap.value=kr.aoMap,ss.aoMapIntensity.value=kr.aoMapIntensity,a(kr.aoMap,ss.aoMapTransform))}function an(ss,kr){ss.diffuse.value.copy(kr.color),ss.opacity.value=kr.opacity,kr.map&&(ss.map.value=kr.map,a(kr.map,ss.mapTransform))}function _n(ss,kr){ss.dashSize.value=kr.dashSize,ss.totalSize.value=kr.dashSize+kr.gapSize,ss.scale.value=kr.scale}function On(ss,kr,us,hs){ss.diffuse.value.copy(kr.color),ss.opacity.value=kr.opacity,ss.size.value=kr.size*us,ss.scale.value=hs*.5,kr.map&&(ss.map.value=kr.map,a(kr.map,ss.uvTransform)),kr.alphaMap&&(ss.alphaMap.value=kr.alphaMap,a(kr.alphaMap,ss.alphaMapTransform)),kr.alphaTest>0&&(ss.alphaTest.value=kr.alphaTest)}function $n(ss,kr){ss.diffuse.value.copy(kr.color),ss.opacity.value=kr.opacity,ss.rotation.value=kr.rotation,kr.map&&(ss.map.value=kr.map,a(kr.map,ss.mapTransform)),kr.alphaMap&&(ss.alphaMap.value=kr.alphaMap,a(kr.alphaMap,ss.alphaMapTransform)),kr.alphaTest>0&&(ss.alphaTest.value=kr.alphaTest)}function dr(ss,kr){ss.specular.value.copy(kr.specular),ss.shininess.value=Math.max(kr.shininess,1e-4)}function fr(ss,kr){kr.gradientMap&&(ss.gradientMap.value=kr.gradientMap)}function pr(ss,kr){ss.metalness.value=kr.metalness,kr.metalnessMap&&(ss.metalnessMap.value=kr.metalnessMap,a(kr.metalnessMap,ss.metalnessMapTransform)),ss.roughness.value=kr.roughness,kr.roughnessMap&&(ss.roughnessMap.value=kr.roughnessMap,a(kr.roughnessMap,ss.roughnessMapTransform)),kr.envMap&&(ss.envMapIntensity.value=kr.envMapIntensity)}function Ar(ss,kr,us){ss.ior.value=kr.ior,kr.sheen>0&&(ss.sheenColor.value.copy(kr.sheenColor).multiplyScalar(kr.sheen),ss.sheenRoughness.value=kr.sheenRoughness,kr.sheenColorMap&&(ss.sheenColorMap.value=kr.sheenColorMap,a(kr.sheenColorMap,ss.sheenColorMapTransform)),kr.sheenRoughnessMap&&(ss.sheenRoughnessMap.value=kr.sheenRoughnessMap,a(kr.sheenRoughnessMap,ss.sheenRoughnessMapTransform))),kr.clearcoat>0&&(ss.clearcoat.value=kr.clearcoat,ss.clearcoatRoughness.value=kr.clearcoatRoughness,kr.clearcoatMap&&(ss.clearcoatMap.value=kr.clearcoatMap,a(kr.clearcoatMap,ss.clearcoatMapTransform)),kr.clearcoatRoughnessMap&&(ss.clearcoatRoughnessMap.value=kr.clearcoatRoughnessMap,a(kr.clearcoatRoughnessMap,ss.clearcoatRoughnessMapTransform)),kr.clearcoatNormalMap&&(ss.clearcoatNormalMap.value=kr.clearcoatNormalMap,a(kr.clearcoatNormalMap,ss.clearcoatNormalMapTransform),ss.clearcoatNormalScale.value.copy(kr.clearcoatNormalScale),kr.side===BackSide&&ss.clearcoatNormalScale.value.negate())),kr.iridescence>0&&(ss.iridescence.value=kr.iridescence,ss.iridescenceIOR.value=kr.iridescenceIOR,ss.iridescenceThicknessMinimum.value=kr.iridescenceThicknessRange[0],ss.iridescenceThicknessMaximum.value=kr.iridescenceThicknessRange[1],kr.iridescenceMap&&(ss.iridescenceMap.value=kr.iridescenceMap,a(kr.iridescenceMap,ss.iridescenceMapTransform)),kr.iridescenceThicknessMap&&(ss.iridescenceThicknessMap.value=kr.iridescenceThicknessMap,a(kr.iridescenceThicknessMap,ss.iridescenceThicknessMapTransform))),kr.transmission>0&&(ss.transmission.value=kr.transmission,ss.transmissionSamplerMap.value=us.texture,ss.transmissionSamplerSize.value.set(us.width,us.height),kr.transmissionMap&&(ss.transmissionMap.value=kr.transmissionMap,a(kr.transmissionMap,ss.transmissionMapTransform)),ss.thickness.value=kr.thickness,kr.thicknessMap&&(ss.thicknessMap.value=kr.thicknessMap,a(kr.thicknessMap,ss.thicknessMapTransform)),ss.attenuationDistance.value=kr.attenuationDistance,ss.attenuationColor.value.copy(kr.attenuationColor)),kr.anisotropy>0&&(ss.anisotropyVector.value.set(kr.anisotropy*Math.cos(kr.anisotropyRotation),kr.anisotropy*Math.sin(kr.anisotropyRotation)),kr.anisotropyMap&&(ss.anisotropyMap.value=kr.anisotropyMap,a(kr.anisotropyMap,ss.anisotropyMapTransform))),ss.specularIntensity.value=kr.specularIntensity,ss.specularColor.value.copy(kr.specularColor),kr.specularColorMap&&(ss.specularColorMap.value=kr.specularColorMap,a(kr.specularColorMap,ss.specularColorMapTransform)),kr.specularIntensityMap&&(ss.specularIntensityMap.value=kr.specularIntensityMap,a(kr.specularIntensityMap,ss.specularIntensityMapTransform))}function Or(ss,kr){kr.matcap&&(ss.matcap.value=kr.matcap)}function Xr(ss,kr){const us=s.get(kr).light;ss.referencePosition.value.setFromMatrixPosition(us.matrixWorld),ss.nearDistance.value=us.shadow.camera.near,ss.farDistance.value=us.shadow.camera.far}return{refreshFogUniforms:b,refreshMaterialUniforms:_e}}function WebGLUniformsGroups(o,s,a,b){let _e={},Kt={},an=[];const _n=o.getParameter(o.MAX_UNIFORM_BUFFER_BINDINGS);function On(us,hs){const ds=hs.program;b.uniformBlockBinding(us,ds)}function $n(us,hs){let ds=_e[us.id];ds===void 0&&(Or(us),ds=dr(us),_e[us.id]=ds,us.addEventListener("dispose",ss));const fs=hs.program;b.updateUBOMapping(us,fs);const Gs=s.render.frame;Kt[us.id]!==Gs&&(pr(us),Kt[us.id]=Gs)}function dr(us){const hs=fr();us.__bindingPointIndex=hs;const ds=o.createBuffer(),fs=us.__size,Gs=us.usage;return o.bindBuffer(o.UNIFORM_BUFFER,ds),o.bufferData(o.UNIFORM_BUFFER,fs,Gs),o.bindBuffer(o.UNIFORM_BUFFER,null),o.bindBufferBase(o.UNIFORM_BUFFER,hs,ds),ds}function fr(){for(let us=0;us<_n;us++)if(an.indexOf(us)===-1)return an.push(us),us;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function pr(us){const hs=_e[us.id],ds=us.uniforms,fs=us.__cache;o.bindBuffer(o.UNIFORM_BUFFER,hs);for(let Gs=0,ga=ds.length;Gs<ga;Gs++){const So=Array.isArray(ds[Gs])?ds[Gs]:[ds[Gs]];for(let go=0,xo=So.length;go<xo;go++){const Mo=So[go];if(Ar(Mo,Gs,go,fs)===!0){const yl=Mo.__offset,Al=Array.isArray(Mo.value)?Mo.value:[Mo.value];let xl=0;for(let ep=0;ep<Al.length;ep++){const _f=Al[ep],np=Xr(_f);typeof _f=="number"||typeof _f=="boolean"?(Mo.__data[0]=_f,o.bufferSubData(o.UNIFORM_BUFFER,yl+xl,Mo.__data)):_f.isMatrix3?(Mo.__data[0]=_f.elements[0],Mo.__data[1]=_f.elements[1],Mo.__data[2]=_f.elements[2],Mo.__data[3]=0,Mo.__data[4]=_f.elements[3],Mo.__data[5]=_f.elements[4],Mo.__data[6]=_f.elements[5],Mo.__data[7]=0,Mo.__data[8]=_f.elements[6],Mo.__data[9]=_f.elements[7],Mo.__data[10]=_f.elements[8],Mo.__data[11]=0):(_f.toArray(Mo.__data,xl),xl+=np.storage/Float32Array.BYTES_PER_ELEMENT)}o.bufferSubData(o.UNIFORM_BUFFER,yl,Mo.__data)}}}o.bindBuffer(o.UNIFORM_BUFFER,null)}function Ar(us,hs,ds,fs){const Gs=us.value,ga=hs+"_"+ds;if(fs[ga]===void 0)return typeof Gs=="number"||typeof Gs=="boolean"?fs[ga]=Gs:fs[ga]=Gs.clone(),!0;{const So=fs[ga];if(typeof Gs=="number"||typeof Gs=="boolean"){if(So!==Gs)return fs[ga]=Gs,!0}else if(So.equals(Gs)===!1)return So.copy(Gs),!0}return!1}function Or(us){const hs=us.uniforms;let ds=0;const fs=16;for(let ga=0,So=hs.length;ga<So;ga++){const go=Array.isArray(hs[ga])?hs[ga]:[hs[ga]];for(let xo=0,Mo=go.length;xo<Mo;xo++){const yl=go[xo],Al=Array.isArray(yl.value)?yl.value:[yl.value];for(let xl=0,ep=Al.length;xl<ep;xl++){const _f=Al[xl],np=Xr(_f),_l=ds%fs;_l!==0&&fs-_l<np.boundary&&(ds+=fs-_l),yl.__data=new Float32Array(np.storage/Float32Array.BYTES_PER_ELEMENT),yl.__offset=ds,ds+=np.storage}}}const Gs=ds%fs;return Gs>0&&(ds+=fs-Gs),us.__size=ds,us.__cache={},this}function Xr(us){const hs={boundary:0,storage:0};return typeof us=="number"||typeof us=="boolean"?(hs.boundary=4,hs.storage=4):us.isVector2?(hs.boundary=8,hs.storage=8):us.isVector3||us.isColor?(hs.boundary=16,hs.storage=12):us.isVector4?(hs.boundary=16,hs.storage=16):us.isMatrix3?(hs.boundary=48,hs.storage=48):us.isMatrix4?(hs.boundary=64,hs.storage=64):us.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",us),hs}function ss(us){const hs=us.target;hs.removeEventListener("dispose",ss);const ds=an.indexOf(hs.__bindingPointIndex);an.splice(ds,1),o.deleteBuffer(_e[hs.id]),delete _e[hs.id],delete Kt[hs.id]}function kr(){for(const us in _e)o.deleteBuffer(_e[us]);an=[],_e={},Kt={}}return{bind:On,update:$n,dispose:kr}}class WebGLRenderer{constructor(s={}){const{canvas:a=createCanvasElement(),context:b=null,depth:_e=!0,stencil:Kt=!1,alpha:an=!1,antialias:_n=!1,premultipliedAlpha:On=!0,preserveDrawingBuffer:$n=!1,powerPreference:dr="default",failIfMajorPerformanceCaveat:fr=!1}=s;this.isWebGLRenderer=!0;let pr;if(b!==null){if(typeof WebGLRenderingContext<"u"&&b instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");pr=b.getContextAttributes().alpha}else pr=an;const Ar=new Uint32Array(4),Or=new Int32Array(4);let Xr=null,ss=null;const kr=[],us=[];this.domElement=a,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._outputColorSpace=SRGBColorSpace$1,this._useLegacyLights=!1,this.toneMapping=NoToneMapping,this.toneMappingExposure=1;const hs=this;let ds=!1,fs=0,Gs=0,ga=null,So=-1,go=null;const xo=new Vector4,Mo=new Vector4;let yl=null;const Al=new Color$1(0);let xl=0,ep=a.width,_f=a.height,np=1,_l=null,Ml=null;const tp=new Vector4(0,0,ep,_f),El=new Vector4(0,0,ep,_f);let sp=!1;const My=new Frustum;let Py=!1,Ny=!1;const wy=new Matrix4,Wy=new Vector2,DA=new Vector3,UA={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function jA(){return ga===null?np:1}let PA=b;function mA(em,Fy){const Uy=a.getContext(em,Fy);return Uy!==null?Uy:null}try{const em={alpha:!0,depth:_e,stencil:Kt,antialias:_n,premultipliedAlpha:On,preserveDrawingBuffer:$n,powerPreference:dr,failIfMajorPerformanceCaveat:fr};if("setAttribute"in a&&a.setAttribute("data-engine",`three.js r${REVISION}`),a.addEventListener("webglcontextlost",zA,!1),a.addEventListener("webglcontextrestored",ZA,!1),a.addEventListener("webglcontextcreationerror",E_,!1),PA===null){const Fy="webgl2";if(PA=mA(Fy,em),PA===null)throw mA(Fy)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(em){throw console.error("THREE.WebGLRenderer: "+em.message),em}let FA,GA,aE,YA,pA,Ry,LA,$A,KA,qA,AA,Dy,WA,LC,lE,RC,$C,DC,cE,KC,YC,QC,WC,qC;function zC(){FA=new WebGLExtensions(PA),FA.init(),GA=new WebGLCapabilities(PA,FA,s),QC=new WebGLUtils(PA,FA),aE=new WebGLState(PA),YA=new WebGLInfo(PA),pA=new WebGLProperties,Ry=new WebGLTextures(PA,FA,aE,pA,GA,QC,YA),LA=new WebGLCubeMaps(hs),$A=new WebGLCubeUVMaps(hs),KA=new WebGLAttributes(PA),WC=new WebGLBindingStates(PA,KA),qA=new WebGLGeometries(PA,KA,YA,WC),AA=new WebGLObjects(PA,qA,KA,YA),cE=new WebGLMorphtargets(PA,GA,Ry),RC=new WebGLClipping(pA),Dy=new WebGLPrograms(hs,LA,$A,FA,GA,WC,RC),WA=new WebGLMaterials(hs,pA),LC=new WebGLRenderLists,lE=new WebGLRenderStates(FA),DC=new WebGLBackground(hs,LA,$A,aE,AA,pr,On),$C=new WebGLShadowMap(hs,AA,GA),qC=new WebGLUniformsGroups(PA,YA,GA,aE),KC=new WebGLBufferRenderer(PA,FA,YA),YC=new WebGLIndexedBufferRenderer(PA,FA,YA),YA.programs=Dy.programs,hs.capabilities=GA,hs.extensions=FA,hs.properties=pA,hs.renderLists=LC,hs.shadowMap=$C,hs.state=aE,hs.info=YA}zC();const VA=new WebXRManager(hs,PA);this.xr=VA,this.getContext=function(){return PA},this.getContextAttributes=function(){return PA.getContextAttributes()},this.forceContextLoss=function(){const em=FA.get("WEBGL_lose_context");em&&em.loseContext()},this.forceContextRestore=function(){const em=FA.get("WEBGL_lose_context");em&&em.restoreContext()},this.getPixelRatio=function(){return np},this.setPixelRatio=function(em){em!==void 0&&(np=em,this.setSize(ep,_f,!1))},this.getSize=function(em){return em.set(ep,_f)},this.setSize=function(em,Fy,Uy=!0){if(VA.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}ep=em,_f=Fy,a.width=Math.floor(em*np),a.height=Math.floor(Fy*np),Uy===!0&&(a.style.width=em+"px",a.style.height=Fy+"px"),this.setViewport(0,0,em,Fy)},this.getDrawingBufferSize=function(em){return em.set(ep*np,_f*np).floor()},this.setDrawingBufferSize=function(em,Fy,Uy){ep=em,_f=Fy,np=Uy,a.width=Math.floor(em*Uy),a.height=Math.floor(Fy*Uy),this.setViewport(0,0,em,Fy)},this.getCurrentViewport=function(em){return em.copy(xo)},this.getViewport=function(em){return em.copy(tp)},this.setViewport=function(em,Fy,Uy,Zy){em.isVector4?tp.set(em.x,em.y,em.z,em.w):tp.set(em,Fy,Uy,Zy),aE.viewport(xo.copy(tp).multiplyScalar(np).round())},this.getScissor=function(em){return em.copy(El)},this.setScissor=function(em,Fy,Uy,Zy){em.isVector4?El.set(em.x,em.y,em.z,em.w):El.set(em,Fy,Uy,Zy),aE.scissor(Mo.copy(El).multiplyScalar(np).round())},this.getScissorTest=function(){return sp},this.setScissorTest=function(em){aE.setScissorTest(sp=em)},this.setOpaqueSort=function(em){_l=em},this.setTransparentSort=function(em){Ml=em},this.getClearColor=function(em){return em.copy(DC.getClearColor())},this.setClearColor=function(){DC.setClearColor.apply(DC,arguments)},this.getClearAlpha=function(){return DC.getClearAlpha()},this.setClearAlpha=function(){DC.setClearAlpha.apply(DC,arguments)},this.clear=function(em=!0,Fy=!0,Uy=!0){let Zy=0;if(em){let NA=!1;if(ga!==null){const JA=ga.texture.format;NA=JA===RGBAIntegerFormat||JA===RGIntegerFormat||JA===RedIntegerFormat}if(NA){const JA=ga.texture.type,hE=JA===UnsignedByteType||JA===UnsignedIntType||JA===UnsignedShortType||JA===UnsignedInt248Type||JA===UnsignedShort4444Type||JA===UnsignedShort5551Type,MC=DC.getClearColor(),OC=DC.getClearAlpha(),PC=MC.r,VC=MC.g,UC=MC.b;hE?(Ar[0]=PC,Ar[1]=VC,Ar[2]=UC,Ar[3]=OC,PA.clearBufferuiv(PA.COLOR,0,Ar)):(Or[0]=PC,Or[1]=VC,Or[2]=UC,Or[3]=OC,PA.clearBufferiv(PA.COLOR,0,Or))}else Zy|=PA.COLOR_BUFFER_BIT}Fy&&(Zy|=PA.DEPTH_BUFFER_BIT),Uy&&(Zy|=PA.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),PA.clear(Zy)},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(){a.removeEventListener("webglcontextlost",zA,!1),a.removeEventListener("webglcontextrestored",ZA,!1),a.removeEventListener("webglcontextcreationerror",E_,!1),LC.dispose(),lE.dispose(),pA.dispose(),LA.dispose(),$A.dispose(),AA.dispose(),WC.dispose(),qC.dispose(),Dy.dispose(),VA.dispose(),VA.removeEventListener("sessionstart",bI),VA.removeEventListener("sessionend",VR),GR.stop()};function zA(em){em.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),ds=!0}function ZA(){console.log("THREE.WebGLRenderer: Context Restored."),ds=!1;const em=YA.autoReset,Fy=$C.enabled,Uy=$C.autoUpdate,Zy=$C.needsUpdate,NA=$C.type;zC(),YA.autoReset=em,$C.enabled=Fy,$C.autoUpdate=Uy,$C.needsUpdate=Zy,$C.type=NA}function E_(em){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",em.statusMessage)}function kC(em){const Fy=em.target;Fy.removeEventListener("dispose",kC),HC(Fy)}function HC(em){cI(em),pA.remove(em)}function cI(em){const Fy=pA.get(em).programs;Fy!==void 0&&(Fy.forEach(function(Uy){Dy.releaseProgram(Uy)}),em.isShaderMaterial&&Dy.releaseShaderCache(em))}this.renderBufferDirect=function(em,Fy,Uy,Zy,NA,JA){Fy===null&&(Fy=UA);const hE=NA.isMesh&&NA.matrixWorld.determinant()<0,MC=XR(em,Fy,Uy,Zy,NA);aE.setMaterial(Zy,hE);let OC=Uy.index,PC=1;if(Zy.wireframe===!0){if(OC=qA.getWireframeAttribute(Uy),OC===void 0)return;PC=2}const VC=Uy.drawRange,UC=Uy.attributes.position;let jC=VC.start*PC,rI=(VC.start+VC.count)*PC;JA!==null&&(jC=Math.max(jC,JA.start*PC),rI=Math.min(rI,(JA.start+JA.count)*PC)),OC!==null?(jC=Math.max(jC,0),rI=Math.min(rI,OC.count)):UC!=null&&(jC=Math.max(jC,0),rI=Math.min(rI,UC.count));const nI=rI-jC;if(nI<0||nI===1/0)return;WC.setup(NA,Zy,MC,Uy,OC);let sI,XC=KC;if(OC!==null&&(sI=KA.get(OC),XC=YC,XC.setIndex(sI)),NA.isMesh)Zy.wireframe===!0?(aE.setLineWidth(Zy.wireframeLinewidth*jA()),XC.setMode(PA.LINES)):XC.setMode(PA.TRIANGLES);else if(NA.isLine){let ZC=Zy.linewidth;ZC===void 0&&(ZC=1),aE.setLineWidth(ZC*jA()),NA.isLineSegments?XC.setMode(PA.LINES):NA.isLineLoop?XC.setMode(PA.LINE_LOOP):XC.setMode(PA.LINE_STRIP)}else NA.isPoints?XC.setMode(PA.POINTS):NA.isSprite&&XC.setMode(PA.TRIANGLES);if(NA.isBatchedMesh)XC.renderMultiDraw(NA._multiDrawStarts,NA._multiDrawCounts,NA._multiDrawCount);else if(NA.isInstancedMesh)XC.renderInstances(jC,nI,NA.count);else if(Uy.isInstancedBufferGeometry){const ZC=Uy._maxInstanceCount!==void 0?Uy._maxInstanceCount:1/0,dI=Math.min(Uy.instanceCount,ZC);XC.renderInstances(jC,nI,dI)}else XC.render(jC,nI)};function uI(em,Fy,Uy){em.transparent===!0&&em.side===DoubleSide&&em.forceSinglePass===!1?(em.side=BackSide,em.needsUpdate=!0,qR(em,Fy,Uy),em.side=FrontSide,em.needsUpdate=!0,qR(em,Fy,Uy),em.side=DoubleSide):qR(em,Fy,Uy)}this.compile=function(em,Fy,Uy=null){Uy===null&&(Uy=em),ss=lE.get(Uy),ss.init(),us.push(ss),Uy.traverseVisible(function(NA){NA.isLight&&NA.layers.test(Fy.layers)&&(ss.pushLight(NA),NA.castShadow&&ss.pushShadow(NA))}),em!==Uy&&em.traverseVisible(function(NA){NA.isLight&&NA.layers.test(Fy.layers)&&(ss.pushLight(NA),NA.castShadow&&ss.pushShadow(NA))}),ss.setupLights(hs._useLegacyLights);const Zy=new Set;return em.traverse(function(NA){const JA=NA.material;if(JA)if(Array.isArray(JA))for(let hE=0;hE<JA.length;hE++){const MC=JA[hE];uI(MC,Uy,NA),Zy.add(MC)}else uI(JA,Uy,NA),Zy.add(JA)}),us.pop(),ss=null,Zy},this.compileAsync=function(em,Fy,Uy=null){const Zy=this.compile(em,Fy,Uy);return new Promise(NA=>{function JA(){if(Zy.forEach(function(hE){pA.get(hE).currentProgram.isReady()&&Zy.delete(hE)}),Zy.size===0){NA(em);return}setTimeout(JA,10)}FA.get("KHR_parallel_shader_compile")!==null?JA():setTimeout(JA,10)})};let gI=null;function AI(em){gI&&gI(em)}function bI(){GR.stop()}function VR(){GR.start()}const GR=new WebGLAnimation;GR.setAnimationLoop(AI),typeof self<"u"&&GR.setContext(self),this.setAnimationLoop=function(em){gI=em,VA.setAnimationLoop(em),em===null?GR.stop():GR.start()},VA.addEventListener("sessionstart",bI),VA.addEventListener("sessionend",VR),this.render=function(em,Fy){if(Fy!==void 0&&Fy.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(ds===!0)return;em.matrixWorldAutoUpdate===!0&&em.updateMatrixWorld(),Fy.parent===null&&Fy.matrixWorldAutoUpdate===!0&&Fy.updateMatrixWorld(),VA.enabled===!0&&VA.isPresenting===!0&&(VA.cameraAutoUpdate===!0&&VA.updateCamera(Fy),Fy=VA.getCamera()),em.isScene===!0&&em.onBeforeRender(hs,em,Fy,ga),ss=lE.get(em,us.length),ss.init(),us.push(ss),wy.multiplyMatrices(Fy.projectionMatrix,Fy.matrixWorldInverse),My.setFromProjectionMatrix(wy),Ny=this.localClippingEnabled,Py=RC.init(this.clippingPlanes,Ny),Xr=LC.get(em,kr.length),Xr.init(),kr.push(Xr),PP(em,Fy,0,hs.sortObjects),Xr.finish(),hs.sortObjects===!0&&Xr.sort(_l,Ml),this.info.render.frame++,Py===!0&&RC.beginShadows();const Uy=ss.state.shadowsArray;if($C.render(Uy,em,Fy),Py===!0&&RC.endShadows(),this.info.autoReset===!0&&this.info.reset(),(VA.enabled===!1||VA.isPresenting===!1||VA.hasDepthSensing()===!1)&&DC.render(Xr,em),ss.setupLights(hs._useLegacyLights),Fy.isArrayCamera){const Zy=Fy.cameras;for(let NA=0,JA=Zy.length;NA<JA;NA++){const hE=Zy[NA];LP(Xr,em,hE,hE.viewport)}}else LP(Xr,em,Fy);ga!==null&&(Ry.updateMultisampleRenderTarget(ga),Ry.updateRenderTargetMipmap(ga)),em.isScene===!0&&em.onAfterRender(hs,em,Fy),WC.resetDefaultState(),So=-1,go=null,us.pop(),us.length>0?ss=us[us.length-1]:ss=null,kr.pop(),kr.length>0?Xr=kr[kr.length-1]:Xr=null};function PP(em,Fy,Uy,Zy){if(em.visible===!1)return;if(em.layers.test(Fy.layers)){if(em.isGroup)Uy=em.renderOrder;else if(em.isLOD)em.autoUpdate===!0&&em.update(Fy);else if(em.isLight)ss.pushLight(em),em.castShadow&&ss.pushShadow(em);else if(em.isSprite){if(!em.frustumCulled||My.intersectsSprite(em)){Zy&&DA.setFromMatrixPosition(em.matrixWorld).applyMatrix4(wy);const hE=AA.update(em),MC=em.material;MC.visible&&Xr.push(em,hE,MC,Uy,DA.z,null)}}else if((em.isMesh||em.isLine||em.isPoints)&&(!em.frustumCulled||My.intersectsObject(em))){const hE=AA.update(em),MC=em.material;if(Zy&&(em.boundingSphere!==void 0?(em.boundingSphere===null&&em.computeBoundingSphere(),DA.copy(em.boundingSphere.center)):(hE.boundingSphere===null&&hE.computeBoundingSphere(),DA.copy(hE.boundingSphere.center)),DA.applyMatrix4(em.matrixWorld).applyMatrix4(wy)),Array.isArray(MC)){const OC=hE.groups;for(let PC=0,VC=OC.length;PC<VC;PC++){const UC=OC[PC],jC=MC[UC.materialIndex];jC&&jC.visible&&Xr.push(em,hE,jC,Uy,DA.z,UC)}}else MC.visible&&Xr.push(em,hE,MC,Uy,DA.z,null)}}const JA=em.children;for(let hE=0,MC=JA.length;hE<MC;hE++)PP(JA[hE],Fy,Uy,Zy)}function LP(em,Fy,Uy,Zy){const NA=em.opaque,JA=em.transmissive,hE=em.transparent;ss.setupLightsView(Uy),Py===!0&&RC.setGlobalState(hs.clippingPlanes,Uy),JA.length>0&&mP(NA,JA,Fy,Uy),Zy&&aE.viewport(xo.copy(Zy)),NA.length>0&&sP(NA,Fy,Uy),JA.length>0&&sP(JA,Fy,Uy),hE.length>0&&sP(hE,Fy,Uy),aE.buffers.depth.setTest(!0),aE.buffers.depth.setMask(!0),aE.buffers.color.setMask(!0),aE.setPolygonOffset(!1)}function mP(em,Fy,Uy,Zy){if((Uy.isScene===!0?Uy.overrideMaterial:null)!==null)return;if(ss.state.transmissionRenderTarget===null){ss.state.transmissionRenderTarget=new WebGLRenderTarget(1,1,{generateMipmaps:!0,type:FA.has("EXT_color_buffer_half_float")||FA.has("EXT_color_buffer_float")?HalfFloatType:UnsignedByteType,minFilter:LinearMipmapLinearFilter,samples:4,stencilBuffer:Kt});const PC=pA.get(ss.state.transmissionRenderTarget);PC.__isTransmissionRenderTarget=!0}const JA=ss.state.transmissionRenderTarget;hs.getDrawingBufferSize(Wy),JA.setSize(Wy.x,Wy.y);const hE=hs.getRenderTarget();hs.setRenderTarget(JA),hs.getClearColor(Al),xl=hs.getClearAlpha(),xl<1&&hs.setClearColor(16777215,.5),hs.clear();const MC=hs.toneMapping;hs.toneMapping=NoToneMapping,sP(em,Uy,Zy),Ry.updateMultisampleRenderTarget(JA),Ry.updateRenderTargetMipmap(JA);let OC=!1;for(let PC=0,VC=Fy.length;PC<VC;PC++){const UC=Fy[PC],jC=UC.object,rI=UC.geometry,nI=UC.material,sI=UC.group;if(nI.side===DoubleSide&&jC.layers.test(Zy.layers)){const XC=nI.side;nI.side=BackSide,nI.needsUpdate=!0,hP(jC,Uy,Zy,rI,nI,sI),nI.side=XC,nI.needsUpdate=!0,OC=!0}}OC===!0&&(Ry.updateMultisampleRenderTarget(JA),Ry.updateRenderTargetMipmap(JA)),hs.setRenderTarget(hE),hs.setClearColor(Al,xl),hs.toneMapping=MC}function sP(em,Fy,Uy){const Zy=Fy.isScene===!0?Fy.overrideMaterial:null;for(let NA=0,JA=em.length;NA<JA;NA++){const hE=em[NA],MC=hE.object,OC=hE.geometry,PC=Zy===null?hE.material:Zy,VC=hE.group;MC.layers.test(Uy.layers)&&hP(MC,Fy,Uy,OC,PC,VC)}}function hP(em,Fy,Uy,Zy,NA,JA){em.onBeforeRender(hs,Fy,Uy,Zy,NA,JA),em.modelViewMatrix.multiplyMatrices(Uy.matrixWorldInverse,em.matrixWorld),em.normalMatrix.getNormalMatrix(em.modelViewMatrix),NA.onBeforeRender(hs,Fy,Uy,Zy,em,JA),NA.transparent===!0&&NA.side===DoubleSide&&NA.forceSinglePass===!1?(NA.side=BackSide,NA.needsUpdate=!0,hs.renderBufferDirect(Uy,Fy,Zy,NA,em,JA),NA.side=FrontSide,NA.needsUpdate=!0,hs.renderBufferDirect(Uy,Fy,Zy,NA,em,JA),NA.side=DoubleSide):hs.renderBufferDirect(Uy,Fy,Zy,NA,em,JA),em.onAfterRender(hs,Fy,Uy,Zy,NA,JA)}function qR(em,Fy,Uy){Fy.isScene!==!0&&(Fy=UA);const Zy=pA.get(em),NA=ss.state.lights,JA=ss.state.shadowsArray,hE=NA.state.version,MC=Dy.getParameters(em,NA.state,JA,Fy,Uy),OC=Dy.getProgramCacheKey(MC);let PC=Zy.programs;Zy.environment=em.isMeshStandardMaterial?Fy.environment:null,Zy.fog=Fy.fog,Zy.envMap=(em.isMeshStandardMaterial?$A:LA).get(em.envMap||Zy.environment),Zy.envMapRotation=Zy.environment!==null&&em.envMap===null?Fy.environmentRotation:em.envMapRotation,PC===void 0&&(em.addEventListener("dispose",kC),PC=new Map,Zy.programs=PC);let VC=PC.get(OC);if(VC!==void 0){if(Zy.currentProgram===VC&&Zy.lightsStateVersion===hE)return jR(em,MC),VC}else MC.uniforms=Dy.getUniforms(em),em.onBuild(Uy,MC,hs),em.onBeforeCompile(MC,hs),VC=Dy.acquireProgram(MC,OC),PC.set(OC,VC),Zy.uniforms=MC.uniforms;const UC=Zy.uniforms;return(!em.isShaderMaterial&&!em.isRawShaderMaterial||em.clipping===!0)&&(UC.clippingPlanes=RC.uniform),jR(em,MC),Zy.needsLights=nm(em),Zy.lightsStateVersion=hE,Zy.needsLights&&(UC.ambientLightColor.value=NA.state.ambient,UC.lightProbe.value=NA.state.probe,UC.directionalLights.value=NA.state.directional,UC.directionalLightShadows.value=NA.state.directionalShadow,UC.spotLights.value=NA.state.spot,UC.spotLightShadows.value=NA.state.spotShadow,UC.rectAreaLights.value=NA.state.rectArea,UC.ltc_1.value=NA.state.rectAreaLTC1,UC.ltc_2.value=NA.state.rectAreaLTC2,UC.pointLights.value=NA.state.point,UC.pointLightShadows.value=NA.state.pointShadow,UC.hemisphereLights.value=NA.state.hemi,UC.directionalShadowMap.value=NA.state.directionalShadowMap,UC.directionalShadowMatrix.value=NA.state.directionalShadowMatrix,UC.spotShadowMap.value=NA.state.spotShadowMap,UC.spotLightMatrix.value=NA.state.spotLightMatrix,UC.spotLightMap.value=NA.state.spotLightMap,UC.pointShadowMap.value=NA.state.pointShadowMap,UC.pointShadowMatrix.value=NA.state.pointShadowMatrix),Zy.currentProgram=VC,Zy.uniformsList=null,VC}function GC(em){if(em.uniformsList===null){const Fy=em.currentProgram.getUniforms();em.uniformsList=WebGLUniforms.seqWithValue(Fy.seq,em.uniforms)}return em.uniformsList}function jR(em,Fy){const Uy=pA.get(em);Uy.outputColorSpace=Fy.outputColorSpace,Uy.batching=Fy.batching,Uy.instancing=Fy.instancing,Uy.instancingColor=Fy.instancingColor,Uy.instancingMorph=Fy.instancingMorph,Uy.skinning=Fy.skinning,Uy.morphTargets=Fy.morphTargets,Uy.morphNormals=Fy.morphNormals,Uy.morphColors=Fy.morphColors,Uy.morphTargetsCount=Fy.morphTargetsCount,Uy.numClippingPlanes=Fy.numClippingPlanes,Uy.numIntersection=Fy.numClipIntersection,Uy.vertexAlphas=Fy.vertexAlphas,Uy.vertexTangents=Fy.vertexTangents,Uy.toneMapping=Fy.toneMapping}function XR(em,Fy,Uy,Zy,NA){Fy.isScene!==!0&&(Fy=UA),Ry.resetTextureUnits();const JA=Fy.fog,hE=Zy.isMeshStandardMaterial?Fy.environment:null,MC=ga===null?hs.outputColorSpace:ga.isXRRenderTarget===!0?ga.texture.colorSpace:LinearSRGBColorSpace$1,OC=(Zy.isMeshStandardMaterial?$A:LA).get(Zy.envMap||hE),PC=Zy.vertexColors===!0&&!!Uy.attributes.color&&Uy.attributes.color.itemSize===4,VC=!!Uy.attributes.tangent&&(!!Zy.normalMap||Zy.anisotropy>0),UC=!!Uy.morphAttributes.position,jC=!!Uy.morphAttributes.normal,rI=!!Uy.morphAttributes.color;let nI=NoToneMapping;Zy.toneMapped&&(ga===null||ga.isXRRenderTarget===!0)&&(nI=hs.toneMapping);const sI=Uy.morphAttributes.position||Uy.morphAttributes.normal||Uy.morphAttributes.color,XC=sI!==void 0?sI.length:0,ZC=pA.get(Zy),dI=ss.state.lights;if(Py===!0&&(Ny===!0||em!==go)){const GI=em===go&&Zy.id===So;RC.setState(Zy,em,GI)}let iI=!1;Zy.version===ZC.__version?(ZC.needsLights&&ZC.lightsStateVersion!==dI.state.version||ZC.outputColorSpace!==MC||NA.isBatchedMesh&&ZC.batching===!1||!NA.isBatchedMesh&&ZC.batching===!0||NA.isInstancedMesh&&ZC.instancing===!1||!NA.isInstancedMesh&&ZC.instancing===!0||NA.isSkinnedMesh&&ZC.skinning===!1||!NA.isSkinnedMesh&&ZC.skinning===!0||NA.isInstancedMesh&&ZC.instancingColor===!0&&NA.instanceColor===null||NA.isInstancedMesh&&ZC.instancingColor===!1&&NA.instanceColor!==null||NA.isInstancedMesh&&ZC.instancingMorph===!0&&NA.morphTexture===null||NA.isInstancedMesh&&ZC.instancingMorph===!1&&NA.morphTexture!==null||ZC.envMap!==OC||Zy.fog===!0&&ZC.fog!==JA||ZC.numClippingPlanes!==void 0&&(ZC.numClippingPlanes!==RC.numPlanes||ZC.numIntersection!==RC.numIntersection)||ZC.vertexAlphas!==PC||ZC.vertexTangents!==VC||ZC.morphTargets!==UC||ZC.morphNormals!==jC||ZC.morphColors!==rI||ZC.toneMapping!==nI||ZC.morphTargetsCount!==XC)&&(iI=!0):(iI=!0,ZC.__version=Zy.version);let NI=ZC.currentProgram;iI===!0&&(NI=qR(Zy,Fy,NA));let fI=!1,FI=!1,UI=!1;const mI=NI.getUniforms(),$R=ZC.uniforms;if(aE.useProgram(NI.program)&&(fI=!0,FI=!0,UI=!0),Zy.id!==So&&(So=Zy.id,FI=!0),fI||go!==em){mI.setValue(PA,"projectionMatrix",em.projectionMatrix),mI.setValue(PA,"viewMatrix",em.matrixWorldInverse);const GI=mI.map.cameraPosition;GI!==void 0&&GI.setValue(PA,DA.setFromMatrixPosition(em.matrixWorld)),GA.logarithmicDepthBuffer&&mI.setValue(PA,"logDepthBufFC",2/(Math.log(em.far+1)/Math.LN2)),(Zy.isMeshPhongMaterial||Zy.isMeshToonMaterial||Zy.isMeshLambertMaterial||Zy.isMeshBasicMaterial||Zy.isMeshStandardMaterial||Zy.isShaderMaterial)&&mI.setValue(PA,"isOrthographic",em.isOrthographicCamera===!0),go!==em&&(go=em,FI=!0,UI=!0)}if(NA.isSkinnedMesh){mI.setOptional(PA,NA,"bindMatrix"),mI.setOptional(PA,NA,"bindMatrixInverse");const GI=NA.skeleton;GI&&(GI.boneTexture===null&&GI.computeBoneTexture(),mI.setValue(PA,"boneTexture",GI.boneTexture,Ry))}NA.isBatchedMesh&&(mI.setOptional(PA,NA,"batchingTexture"),mI.setValue(PA,"batchingTexture",NA._matricesTexture,Ry));const pI=Uy.morphAttributes;if((pI.position!==void 0||pI.normal!==void 0||pI.color!==void 0)&&cE.update(NA,Uy,NI),(FI||ZC.receiveShadow!==NA.receiveShadow)&&(ZC.receiveShadow=NA.receiveShadow,mI.setValue(PA,"receiveShadow",NA.receiveShadow)),Zy.isMeshGouraudMaterial&&Zy.envMap!==null&&($R.envMap.value=OC,$R.flipEnvMap.value=OC.isCubeTexture&&OC.isRenderTargetTexture===!1?-1:1),Zy.isMeshStandardMaterial&&Zy.envMap===null&&Fy.environment!==null&&($R.envMapIntensity.value=Fy.environmentIntensity),FI&&(mI.setValue(PA,"toneMappingExposure",hs.toneMappingExposure),ZC.needsLights&&Vy($R,UI),JA&&Zy.fog===!0&&WA.refreshFogUniforms($R,JA),WA.refreshMaterialUniforms($R,Zy,np,_f,ss.state.transmissionRenderTarget),WebGLUniforms.upload(PA,GC(ZC),$R,Ry)),Zy.isShaderMaterial&&Zy.uniformsNeedUpdate===!0&&(WebGLUniforms.upload(PA,GC(ZC),$R,Ry),Zy.uniformsNeedUpdate=!1),Zy.isSpriteMaterial&&mI.setValue(PA,"center",NA.center),mI.setValue(PA,"modelViewMatrix",NA.modelViewMatrix),mI.setValue(PA,"normalMatrix",NA.normalMatrix),mI.setValue(PA,"modelMatrix",NA.matrixWorld),Zy.isShaderMaterial||Zy.isRawShaderMaterial){const GI=Zy.uniformsGroups;for(let HI=0,kI=GI.length;HI<kI;HI++){const zR=GI[HI];qC.update(zR,NI),qC.bind(zR,NI)}}return NI}function Vy(em,Fy){em.ambientLightColor.needsUpdate=Fy,em.lightProbe.needsUpdate=Fy,em.directionalLights.needsUpdate=Fy,em.directionalLightShadows.needsUpdate=Fy,em.pointLights.needsUpdate=Fy,em.pointLightShadows.needsUpdate=Fy,em.spotLights.needsUpdate=Fy,em.spotLightShadows.needsUpdate=Fy,em.rectAreaLights.needsUpdate=Fy,em.hemisphereLights.needsUpdate=Fy}function nm(em){return em.isMeshLambertMaterial||em.isMeshToonMaterial||em.isMeshPhongMaterial||em.isMeshStandardMaterial||em.isShadowMaterial||em.isShaderMaterial&&em.lights===!0}this.getActiveCubeFace=function(){return fs},this.getActiveMipmapLevel=function(){return Gs},this.getRenderTarget=function(){return ga},this.setRenderTargetTextures=function(em,Fy,Uy){pA.get(em.texture).__webglTexture=Fy,pA.get(em.depthTexture).__webglTexture=Uy;const Zy=pA.get(em);Zy.__hasExternalTextures=!0,Zy.__autoAllocateDepthBuffer=Uy===void 0,Zy.__autoAllocateDepthBuffer||FA.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),Zy.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(em,Fy){const Uy=pA.get(em);Uy.__webglFramebuffer=Fy,Uy.__useDefaultFramebuffer=Fy===void 0},this.setRenderTarget=function(em,Fy=0,Uy=0){ga=em,fs=Fy,Gs=Uy;let Zy=!0,NA=null,JA=!1,hE=!1;if(em){const OC=pA.get(em);OC.__useDefaultFramebuffer!==void 0?(aE.bindFramebuffer(PA.FRAMEBUFFER,null),Zy=!1):OC.__webglFramebuffer===void 0?Ry.setupRenderTarget(em):OC.__hasExternalTextures&&Ry.rebindTextures(em,pA.get(em.texture).__webglTexture,pA.get(em.depthTexture).__webglTexture);const PC=em.texture;(PC.isData3DTexture||PC.isDataArrayTexture||PC.isCompressedArrayTexture)&&(hE=!0);const VC=pA.get(em).__webglFramebuffer;em.isWebGLCubeRenderTarget?(Array.isArray(VC[Fy])?NA=VC[Fy][Uy]:NA=VC[Fy],JA=!0):em.samples>0&&Ry.useMultisampledRTT(em)===!1?NA=pA.get(em).__webglMultisampledFramebuffer:Array.isArray(VC)?NA=VC[Uy]:NA=VC,xo.copy(em.viewport),Mo.copy(em.scissor),yl=em.scissorTest}else xo.copy(tp).multiplyScalar(np).floor(),Mo.copy(El).multiplyScalar(np).floor(),yl=sp;if(aE.bindFramebuffer(PA.FRAMEBUFFER,NA)&&Zy&&aE.drawBuffers(em,NA),aE.viewport(xo),aE.scissor(Mo),aE.setScissorTest(yl),JA){const OC=pA.get(em.texture);PA.framebufferTexture2D(PA.FRAMEBUFFER,PA.COLOR_ATTACHMENT0,PA.TEXTURE_CUBE_MAP_POSITIVE_X+Fy,OC.__webglTexture,Uy)}else if(hE){const OC=pA.get(em.texture),PC=Fy||0;PA.framebufferTextureLayer(PA.FRAMEBUFFER,PA.COLOR_ATTACHMENT0,OC.__webglTexture,Uy||0,PC)}So=-1},this.readRenderTargetPixels=function(em,Fy,Uy,Zy,NA,JA,hE){if(!(em&&em.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let MC=pA.get(em).__webglFramebuffer;if(em.isWebGLCubeRenderTarget&&hE!==void 0&&(MC=MC[hE]),MC){aE.bindFramebuffer(PA.FRAMEBUFFER,MC);try{const OC=em.texture,PC=OC.format,VC=OC.type;if(PC!==RGBAFormat&&QC.convert(PC)!==PA.getParameter(PA.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const UC=VC===HalfFloatType&&(FA.has("EXT_color_buffer_half_float")||FA.has("EXT_color_buffer_float"));if(VC!==UnsignedByteType&&QC.convert(VC)!==PA.getParameter(PA.IMPLEMENTATION_COLOR_READ_TYPE)&&VC!==FloatType&&!UC){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Fy>=0&&Fy<=em.width-Zy&&Uy>=0&&Uy<=em.height-NA&&PA.readPixels(Fy,Uy,Zy,NA,QC.convert(PC),QC.convert(VC),JA)}finally{const OC=ga!==null?pA.get(ga).__webglFramebuffer:null;aE.bindFramebuffer(PA.FRAMEBUFFER,OC)}}},this.copyFramebufferToTexture=function(em,Fy,Uy=0){const Zy=Math.pow(2,-Uy),NA=Math.floor(Fy.image.width*Zy),JA=Math.floor(Fy.image.height*Zy);Ry.setTexture2D(Fy,0),PA.copyTexSubImage2D(PA.TEXTURE_2D,Uy,0,0,em.x,em.y,NA,JA),aE.unbindTexture()},this.copyTextureToTexture=function(em,Fy,Uy,Zy=0){const NA=Fy.image.width,JA=Fy.image.height,hE=QC.convert(Uy.format),MC=QC.convert(Uy.type);Ry.setTexture2D(Uy,0),PA.pixelStorei(PA.UNPACK_FLIP_Y_WEBGL,Uy.flipY),PA.pixelStorei(PA.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Uy.premultiplyAlpha),PA.pixelStorei(PA.UNPACK_ALIGNMENT,Uy.unpackAlignment),Fy.isDataTexture?PA.texSubImage2D(PA.TEXTURE_2D,Zy,em.x,em.y,NA,JA,hE,MC,Fy.image.data):Fy.isCompressedTexture?PA.compressedTexSubImage2D(PA.TEXTURE_2D,Zy,em.x,em.y,Fy.mipmaps[0].width,Fy.mipmaps[0].height,hE,Fy.mipmaps[0].data):PA.texSubImage2D(PA.TEXTURE_2D,Zy,em.x,em.y,hE,MC,Fy.image),Zy===0&&Uy.generateMipmaps&&PA.generateMipmap(PA.TEXTURE_2D),aE.unbindTexture()},this.copyTextureToTexture3D=function(em,Fy,Uy,Zy,NA=0){const JA=Math.round(em.max.x-em.min.x),hE=Math.round(em.max.y-em.min.y),MC=em.max.z-em.min.z+1,OC=QC.convert(Zy.format),PC=QC.convert(Zy.type);let VC;if(Zy.isData3DTexture)Ry.setTexture3D(Zy,0),VC=PA.TEXTURE_3D;else if(Zy.isDataArrayTexture||Zy.isCompressedArrayTexture)Ry.setTexture2DArray(Zy,0),VC=PA.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}PA.pixelStorei(PA.UNPACK_FLIP_Y_WEBGL,Zy.flipY),PA.pixelStorei(PA.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Zy.premultiplyAlpha),PA.pixelStorei(PA.UNPACK_ALIGNMENT,Zy.unpackAlignment);const UC=PA.getParameter(PA.UNPACK_ROW_LENGTH),jC=PA.getParameter(PA.UNPACK_IMAGE_HEIGHT),rI=PA.getParameter(PA.UNPACK_SKIP_PIXELS),nI=PA.getParameter(PA.UNPACK_SKIP_ROWS),sI=PA.getParameter(PA.UNPACK_SKIP_IMAGES),XC=Uy.isCompressedTexture?Uy.mipmaps[NA]:Uy.image;PA.pixelStorei(PA.UNPACK_ROW_LENGTH,XC.width),PA.pixelStorei(PA.UNPACK_IMAGE_HEIGHT,XC.height),PA.pixelStorei(PA.UNPACK_SKIP_PIXELS,em.min.x),PA.pixelStorei(PA.UNPACK_SKIP_ROWS,em.min.y),PA.pixelStorei(PA.UNPACK_SKIP_IMAGES,em.min.z),Uy.isDataTexture||Uy.isData3DTexture?PA.texSubImage3D(VC,NA,Fy.x,Fy.y,Fy.z,JA,hE,MC,OC,PC,XC.data):Zy.isCompressedArrayTexture?PA.compressedTexSubImage3D(VC,NA,Fy.x,Fy.y,Fy.z,JA,hE,MC,OC,XC.data):PA.texSubImage3D(VC,NA,Fy.x,Fy.y,Fy.z,JA,hE,MC,OC,PC,XC),PA.pixelStorei(PA.UNPACK_ROW_LENGTH,UC),PA.pixelStorei(PA.UNPACK_IMAGE_HEIGHT,jC),PA.pixelStorei(PA.UNPACK_SKIP_PIXELS,rI),PA.pixelStorei(PA.UNPACK_SKIP_ROWS,nI),PA.pixelStorei(PA.UNPACK_SKIP_IMAGES,sI),NA===0&&Zy.generateMipmaps&&PA.generateMipmap(VC),aE.unbindTexture()},this.initTexture=function(em){em.isCubeTexture?Ry.setTextureCube(em,0):em.isData3DTexture?Ry.setTexture3D(em,0):em.isDataArrayTexture||em.isCompressedArrayTexture?Ry.setTexture2DArray(em,0):Ry.setTexture2D(em,0),aE.unbindTexture()},this.resetState=function(){fs=0,Gs=0,ga=null,aE.reset(),WC.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return WebGLCoordinateSystem}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(s){this._outputColorSpace=s;const a=this.getContext();a.drawingBufferColorSpace=s===DisplayP3ColorSpace?"display-p3":"srgb",a.unpackColorSpace=ColorManagement.workingColorSpace===LinearDisplayP3ColorSpace?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(s){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=s}}class FogExp2{constructor(s,a=25e-5){this.isFogExp2=!0,this.name="",this.color=new Color$1(s),this.density=a}clone(){return new FogExp2(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Fog{constructor(s,a=1,b=1e3){this.isFog=!0,this.name="",this.color=new Color$1(s),this.near=a,this.far=b}clone(){return new Fog(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Scene extends Object3D{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Euler,this.environmentIntensity=1,this.environmentRotation=new Euler,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(s,a){return super.copy(s,a),s.background!==null&&(this.background=s.background.clone()),s.environment!==null&&(this.environment=s.environment.clone()),s.fog!==null&&(this.fog=s.fog.clone()),this.backgroundBlurriness=s.backgroundBlurriness,this.backgroundIntensity=s.backgroundIntensity,this.backgroundRotation.copy(s.backgroundRotation),this.environmentIntensity=s.environmentIntensity,this.environmentRotation.copy(s.environmentRotation),s.overrideMaterial!==null&&(this.overrideMaterial=s.overrideMaterial.clone()),this.matrixAutoUpdate=s.matrixAutoUpdate,this}toJSON(s){const a=super.toJSON(s);return this.fog!==null&&(a.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(a.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(a.object.backgroundIntensity=this.backgroundIntensity),a.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(a.object.environmentIntensity=this.environmentIntensity),a.object.environmentRotation=this.environmentRotation.toArray(),a}}class InterleavedBuffer{constructor(s,a){this.isInterleavedBuffer=!0,this.array=s,this.stride=a,this.count=s!==void 0?s.length/a:0,this.usage=StaticDrawUsage,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=generateUUID()}onUploadCallback(){}set needsUpdate(s){s===!0&&this.version++}get updateRange(){return warnOnce("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(s){return this.usage=s,this}addUpdateRange(s,a){this.updateRanges.push({start:s,count:a})}clearUpdateRanges(){this.updateRanges.length=0}copy(s){return this.array=new s.array.constructor(s.array),this.count=s.count,this.stride=s.stride,this.usage=s.usage,this}copyAt(s,a,b){s*=this.stride,b*=a.stride;for(let _e=0,Kt=this.stride;_e<Kt;_e++)this.array[s+_e]=a.array[b+_e];return this}set(s,a=0){return this.array.set(s,a),this}clone(s){s.arrayBuffers===void 0&&(s.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=generateUUID()),s.arrayBuffers[this.array.buffer._uuid]===void 0&&(s.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const a=new this.array.constructor(s.arrayBuffers[this.array.buffer._uuid]),b=new this.constructor(a,this.stride);return b.setUsage(this.usage),b}onUpload(s){return this.onUploadCallback=s,this}toJSON(s){return s.arrayBuffers===void 0&&(s.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=generateUUID()),s.arrayBuffers[this.array.buffer._uuid]===void 0&&(s.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const _vector$6=new Vector3;class InterleavedBufferAttribute{constructor(s,a,b,_e=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=s,this.itemSize=a,this.offset=b,this.normalized=_e}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(s){this.data.needsUpdate=s}applyMatrix4(s){for(let a=0,b=this.data.count;a<b;a++)_vector$6.fromBufferAttribute(this,a),_vector$6.applyMatrix4(s),this.setXYZ(a,_vector$6.x,_vector$6.y,_vector$6.z);return this}applyNormalMatrix(s){for(let a=0,b=this.count;a<b;a++)_vector$6.fromBufferAttribute(this,a),_vector$6.applyNormalMatrix(s),this.setXYZ(a,_vector$6.x,_vector$6.y,_vector$6.z);return this}transformDirection(s){for(let a=0,b=this.count;a<b;a++)_vector$6.fromBufferAttribute(this,a),_vector$6.transformDirection(s),this.setXYZ(a,_vector$6.x,_vector$6.y,_vector$6.z);return this}getComponent(s,a){let b=this.array[s*this.data.stride+this.offset+a];return this.normalized&&(b=denormalize(b,this.array)),b}setComponent(s,a,b){return this.normalized&&(b=normalize(b,this.array)),this.data.array[s*this.data.stride+this.offset+a]=b,this}setX(s,a){return this.normalized&&(a=normalize(a,this.array)),this.data.array[s*this.data.stride+this.offset]=a,this}setY(s,a){return this.normalized&&(a=normalize(a,this.array)),this.data.array[s*this.data.stride+this.offset+1]=a,this}setZ(s,a){return this.normalized&&(a=normalize(a,this.array)),this.data.array[s*this.data.stride+this.offset+2]=a,this}setW(s,a){return this.normalized&&(a=normalize(a,this.array)),this.data.array[s*this.data.stride+this.offset+3]=a,this}getX(s){let a=this.data.array[s*this.data.stride+this.offset];return this.normalized&&(a=denormalize(a,this.array)),a}getY(s){let a=this.data.array[s*this.data.stride+this.offset+1];return this.normalized&&(a=denormalize(a,this.array)),a}getZ(s){let a=this.data.array[s*this.data.stride+this.offset+2];return this.normalized&&(a=denormalize(a,this.array)),a}getW(s){let a=this.data.array[s*this.data.stride+this.offset+3];return this.normalized&&(a=denormalize(a,this.array)),a}setXY(s,a,b){return s=s*this.data.stride+this.offset,this.normalized&&(a=normalize(a,this.array),b=normalize(b,this.array)),this.data.array[s+0]=a,this.data.array[s+1]=b,this}setXYZ(s,a,b,_e){return s=s*this.data.stride+this.offset,this.normalized&&(a=normalize(a,this.array),b=normalize(b,this.array),_e=normalize(_e,this.array)),this.data.array[s+0]=a,this.data.array[s+1]=b,this.data.array[s+2]=_e,this}setXYZW(s,a,b,_e,Kt){return s=s*this.data.stride+this.offset,this.normalized&&(a=normalize(a,this.array),b=normalize(b,this.array),_e=normalize(_e,this.array),Kt=normalize(Kt,this.array)),this.data.array[s+0]=a,this.data.array[s+1]=b,this.data.array[s+2]=_e,this.data.array[s+3]=Kt,this}clone(s){if(s===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const a=[];for(let b=0;b<this.count;b++){const _e=b*this.data.stride+this.offset;for(let Kt=0;Kt<this.itemSize;Kt++)a.push(this.data.array[_e+Kt])}return new BufferAttribute(new this.array.constructor(a),this.itemSize,this.normalized)}else return s.interleavedBuffers===void 0&&(s.interleavedBuffers={}),s.interleavedBuffers[this.data.uuid]===void 0&&(s.interleavedBuffers[this.data.uuid]=this.data.clone(s)),new InterleavedBufferAttribute(s.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(s){if(s===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const a=[];for(let b=0;b<this.count;b++){const _e=b*this.data.stride+this.offset;for(let Kt=0;Kt<this.itemSize;Kt++)a.push(this.data.array[_e+Kt])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:a,normalized:this.normalized}}else return s.interleavedBuffers===void 0&&(s.interleavedBuffers={}),s.interleavedBuffers[this.data.uuid]===void 0&&(s.interleavedBuffers[this.data.uuid]=this.data.toJSON(s)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class SpriteMaterial extends Material{constructor(s){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Color$1(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(s)}copy(s){return super.copy(s),this.color.copy(s.color),this.map=s.map,this.alphaMap=s.alphaMap,this.rotation=s.rotation,this.sizeAttenuation=s.sizeAttenuation,this.fog=s.fog,this}}let _geometry;const _intersectPoint=new Vector3,_worldScale=new Vector3,_mvPosition=new Vector3,_alignedPosition=new Vector2,_rotatedPosition=new Vector2,_viewWorldMatrix=new Matrix4,_vA=new Vector3,_vB=new Vector3,_vC=new Vector3,_uvA=new Vector2,_uvB=new Vector2,_uvC=new Vector2;class Sprite extends Object3D{constructor(s=new SpriteMaterial){if(super(),this.isSprite=!0,this.type="Sprite",_geometry===void 0){_geometry=new BufferGeometry;const a=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),b=new InterleavedBuffer(a,5);_geometry.setIndex([0,1,2,0,2,3]),_geometry.setAttribute("position",new InterleavedBufferAttribute(b,3,0,!1)),_geometry.setAttribute("uv",new InterleavedBufferAttribute(b,2,3,!1))}this.geometry=_geometry,this.material=s,this.center=new Vector2(.5,.5)}raycast(s,a){s.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),_worldScale.setFromMatrixScale(this.matrixWorld),_viewWorldMatrix.copy(s.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(s.camera.matrixWorldInverse,this.matrixWorld),_mvPosition.setFromMatrixPosition(this.modelViewMatrix),s.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&_worldScale.multiplyScalar(-_mvPosition.z);const b=this.material.rotation;let _e,Kt;b!==0&&(Kt=Math.cos(b),_e=Math.sin(b));const an=this.center;transformVertex(_vA.set(-.5,-.5,0),_mvPosition,an,_worldScale,_e,Kt),transformVertex(_vB.set(.5,-.5,0),_mvPosition,an,_worldScale,_e,Kt),transformVertex(_vC.set(.5,.5,0),_mvPosition,an,_worldScale,_e,Kt),_uvA.set(0,0),_uvB.set(1,0),_uvC.set(1,1);let _n=s.ray.intersectTriangle(_vA,_vB,_vC,!1,_intersectPoint);if(_n===null&&(transformVertex(_vB.set(-.5,.5,0),_mvPosition,an,_worldScale,_e,Kt),_uvB.set(0,1),_n=s.ray.intersectTriangle(_vA,_vC,_vB,!1,_intersectPoint),_n===null))return;const On=s.ray.origin.distanceTo(_intersectPoint);On<s.near||On>s.far||a.push({distance:On,point:_intersectPoint.clone(),uv:Triangle.getInterpolation(_intersectPoint,_vA,_vB,_vC,_uvA,_uvB,_uvC,new Vector2),face:null,object:this})}copy(s,a){return super.copy(s,a),s.center!==void 0&&this.center.copy(s.center),this.material=s.material,this}}function transformVertex(o,s,a,b,_e,Kt){_alignedPosition.subVectors(o,a).addScalar(.5).multiply(b),_e!==void 0?(_rotatedPosition.x=Kt*_alignedPosition.x-_e*_alignedPosition.y,_rotatedPosition.y=_e*_alignedPosition.x+Kt*_alignedPosition.y):_rotatedPosition.copy(_alignedPosition),o.copy(s),o.x+=_rotatedPosition.x,o.y+=_rotatedPosition.y,o.applyMatrix4(_viewWorldMatrix)}const _v1$2=new Vector3,_v2$1=new Vector3;class LOD extends Object3D{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(s){super.copy(s,!1);const a=s.levels;for(let b=0,_e=a.length;b<_e;b++){const Kt=a[b];this.addLevel(Kt.object.clone(),Kt.distance,Kt.hysteresis)}return this.autoUpdate=s.autoUpdate,this}addLevel(s,a=0,b=0){a=Math.abs(a);const _e=this.levels;let Kt;for(Kt=0;Kt<_e.length&&!(a<_e[Kt].distance);Kt++);return _e.splice(Kt,0,{distance:a,hysteresis:b,object:s}),this.add(s),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(s){const a=this.levels;if(a.length>0){let b,_e;for(b=1,_e=a.length;b<_e;b++){let Kt=a[b].distance;if(a[b].object.visible&&(Kt-=Kt*a[b].hysteresis),s<Kt)break}return a[b-1].object}return null}raycast(s,a){if(this.levels.length>0){_v1$2.setFromMatrixPosition(this.matrixWorld);const _e=s.ray.origin.distanceTo(_v1$2);this.getObjectForDistance(_e).raycast(s,a)}}update(s){const a=this.levels;if(a.length>1){_v1$2.setFromMatrixPosition(s.matrixWorld),_v2$1.setFromMatrixPosition(this.matrixWorld);const b=_v1$2.distanceTo(_v2$1)/s.zoom;a[0].object.visible=!0;let _e,Kt;for(_e=1,Kt=a.length;_e<Kt;_e++){let an=a[_e].distance;if(a[_e].object.visible&&(an-=an*a[_e].hysteresis),b>=an)a[_e-1].object.visible=!1,a[_e].object.visible=!0;else break}for(this._currentLevel=_e-1;_e<Kt;_e++)a[_e].object.visible=!1}}toJSON(s){const a=super.toJSON(s);this.autoUpdate===!1&&(a.object.autoUpdate=!1),a.object.levels=[];const b=this.levels;for(let _e=0,Kt=b.length;_e<Kt;_e++){const an=b[_e];a.object.levels.push({object:an.object.uuid,distance:an.distance,hysteresis:an.hysteresis})}return a}}const _basePosition=new Vector3,_skinIndex=new Vector4,_skinWeight=new Vector4,_vector3=new Vector3,_matrix4=new Matrix4,_vertex=new Vector3,_sphere$4=new Sphere,_inverseMatrix$2=new Matrix4,_ray$2=new Ray;class SkinnedMesh extends Mesh{constructor(s,a){super(s,a),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=AttachedBindMode,this.bindMatrix=new Matrix4,this.bindMatrixInverse=new Matrix4,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const s=this.geometry;this.boundingBox===null&&(this.boundingBox=new Box3),this.boundingBox.makeEmpty();const a=s.getAttribute("position");for(let b=0;b<a.count;b++)this.getVertexPosition(b,_vertex),this.boundingBox.expandByPoint(_vertex)}computeBoundingSphere(){const s=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Sphere),this.boundingSphere.makeEmpty();const a=s.getAttribute("position");for(let b=0;b<a.count;b++)this.getVertexPosition(b,_vertex),this.boundingSphere.expandByPoint(_vertex)}copy(s,a){return super.copy(s,a),this.bindMode=s.bindMode,this.bindMatrix.copy(s.bindMatrix),this.bindMatrixInverse.copy(s.bindMatrixInverse),this.skeleton=s.skeleton,s.boundingBox!==null&&(this.boundingBox=s.boundingBox.clone()),s.boundingSphere!==null&&(this.boundingSphere=s.boundingSphere.clone()),this}raycast(s,a){const b=this.material,_e=this.matrixWorld;b!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),_sphere$4.copy(this.boundingSphere),_sphere$4.applyMatrix4(_e),s.ray.intersectsSphere(_sphere$4)!==!1&&(_inverseMatrix$2.copy(_e).invert(),_ray$2.copy(s.ray).applyMatrix4(_inverseMatrix$2),!(this.boundingBox!==null&&_ray$2.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(s,a,_ray$2)))}getVertexPosition(s,a){return super.getVertexPosition(s,a),this.applyBoneTransform(s,a),a}bind(s,a){this.skeleton=s,a===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),a=this.matrixWorld),this.bindMatrix.copy(a),this.bindMatrixInverse.copy(a).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const s=new Vector4,a=this.geometry.attributes.skinWeight;for(let b=0,_e=a.count;b<_e;b++){s.fromBufferAttribute(a,b);const Kt=1/s.manhattanLength();Kt!==1/0?s.multiplyScalar(Kt):s.set(1,0,0,0),a.setXYZW(b,s.x,s.y,s.z,s.w)}}updateMatrixWorld(s){super.updateMatrixWorld(s),this.bindMode===AttachedBindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===DetachedBindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(s,a){const b=this.skeleton,_e=this.geometry;_skinIndex.fromBufferAttribute(_e.attributes.skinIndex,s),_skinWeight.fromBufferAttribute(_e.attributes.skinWeight,s),_basePosition.copy(a).applyMatrix4(this.bindMatrix),a.set(0,0,0);for(let Kt=0;Kt<4;Kt++){const an=_skinWeight.getComponent(Kt);if(an!==0){const _n=_skinIndex.getComponent(Kt);_matrix4.multiplyMatrices(b.bones[_n].matrixWorld,b.boneInverses[_n]),a.addScaledVector(_vector3.copy(_basePosition).applyMatrix4(_matrix4),an)}}return a.applyMatrix4(this.bindMatrixInverse)}}class Bone extends Object3D{constructor(){super(),this.isBone=!0,this.type="Bone"}}class DataTexture extends Texture{constructor(s=null,a=1,b=1,_e,Kt,an,_n,On,$n=NearestFilter,dr=NearestFilter,fr,pr){super(null,an,_n,On,$n,dr,_e,Kt,fr,pr),this.isDataTexture=!0,this.image={data:s,width:a,height:b},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const _offsetMatrix=new Matrix4,_identityMatrix$1=new Matrix4;class Skeleton{constructor(s=[],a=[]){this.uuid=generateUUID(),this.bones=s.slice(0),this.boneInverses=a,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const s=this.bones,a=this.boneInverses;if(this.boneMatrices=new Float32Array(s.length*16),a.length===0)this.calculateInverses();else if(s.length!==a.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let b=0,_e=this.bones.length;b<_e;b++)this.boneInverses.push(new Matrix4)}}calculateInverses(){this.boneInverses.length=0;for(let s=0,a=this.bones.length;s<a;s++){const b=new Matrix4;this.bones[s]&&b.copy(this.bones[s].matrixWorld).invert(),this.boneInverses.push(b)}}pose(){for(let s=0,a=this.bones.length;s<a;s++){const b=this.bones[s];b&&b.matrixWorld.copy(this.boneInverses[s]).invert()}for(let s=0,a=this.bones.length;s<a;s++){const b=this.bones[s];b&&(b.parent&&b.parent.isBone?(b.matrix.copy(b.parent.matrixWorld).invert(),b.matrix.multiply(b.matrixWorld)):b.matrix.copy(b.matrixWorld),b.matrix.decompose(b.position,b.quaternion,b.scale))}}update(){const s=this.bones,a=this.boneInverses,b=this.boneMatrices,_e=this.boneTexture;for(let Kt=0,an=s.length;Kt<an;Kt++){const _n=s[Kt]?s[Kt].matrixWorld:_identityMatrix$1;_offsetMatrix.multiplyMatrices(_n,a[Kt]),_offsetMatrix.toArray(b,Kt*16)}_e!==null&&(_e.needsUpdate=!0)}clone(){return new Skeleton(this.bones,this.boneInverses)}computeBoneTexture(){let s=Math.sqrt(this.bones.length*4);s=Math.ceil(s/4)*4,s=Math.max(s,4);const a=new Float32Array(s*s*4);a.set(this.boneMatrices);const b=new DataTexture(a,s,s,RGBAFormat,FloatType);return b.needsUpdate=!0,this.boneMatrices=a,this.boneTexture=b,this}getBoneByName(s){for(let a=0,b=this.bones.length;a<b;a++){const _e=this.bones[a];if(_e.name===s)return _e}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(s,a){this.uuid=s.uuid;for(let b=0,_e=s.bones.length;b<_e;b++){const Kt=s.bones[b];let an=a[Kt];an===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",Kt),an=new Bone),this.bones.push(an),this.boneInverses.push(new Matrix4().fromArray(s.boneInverses[b]))}return this.init(),this}toJSON(){const s={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};s.uuid=this.uuid;const a=this.bones,b=this.boneInverses;for(let _e=0,Kt=a.length;_e<Kt;_e++){const an=a[_e];s.bones.push(an.uuid);const _n=b[_e];s.boneInverses.push(_n.toArray())}return s}}class InstancedBufferAttribute extends BufferAttribute{constructor(s,a,b,_e=1){super(s,a,b),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=_e}copy(s){return super.copy(s),this.meshPerAttribute=s.meshPerAttribute,this}toJSON(){const s=super.toJSON();return s.meshPerAttribute=this.meshPerAttribute,s.isInstancedBufferAttribute=!0,s}}const _instanceLocalMatrix=new Matrix4,_instanceWorldMatrix=new Matrix4,_instanceIntersects=[],_box3=new Box3,_identity=new Matrix4,_mesh$1=new Mesh,_sphere$3=new Sphere;class InstancedMesh extends Mesh{constructor(s,a,b){super(s,a),this.isInstancedMesh=!0,this.instanceMatrix=new InstancedBufferAttribute(new Float32Array(b*16),16),this.instanceColor=null,this.morphTexture=null,this.count=b,this.boundingBox=null,this.boundingSphere=null;for(let _e=0;_e<b;_e++)this.setMatrixAt(_e,_identity)}computeBoundingBox(){const s=this.geometry,a=this.count;this.boundingBox===null&&(this.boundingBox=new Box3),s.boundingBox===null&&s.computeBoundingBox(),this.boundingBox.makeEmpty();for(let b=0;b<a;b++)this.getMatrixAt(b,_instanceLocalMatrix),_box3.copy(s.boundingBox).applyMatrix4(_instanceLocalMatrix),this.boundingBox.union(_box3)}computeBoundingSphere(){const s=this.geometry,a=this.count;this.boundingSphere===null&&(this.boundingSphere=new Sphere),s.boundingSphere===null&&s.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let b=0;b<a;b++)this.getMatrixAt(b,_instanceLocalMatrix),_sphere$3.copy(s.boundingSphere).applyMatrix4(_instanceLocalMatrix),this.boundingSphere.union(_sphere$3)}copy(s,a){return super.copy(s,a),this.instanceMatrix.copy(s.instanceMatrix),s.morphTexture!==null&&(this.morphTexture=s.morphTexture.clone()),s.instanceColor!==null&&(this.instanceColor=s.instanceColor.clone()),this.count=s.count,s.boundingBox!==null&&(this.boundingBox=s.boundingBox.clone()),s.boundingSphere!==null&&(this.boundingSphere=s.boundingSphere.clone()),this}getColorAt(s,a){a.fromArray(this.instanceColor.array,s*3)}getMatrixAt(s,a){a.fromArray(this.instanceMatrix.array,s*16)}getMorphAt(s,a){const b=a.morphTargetInfluences,_e=this.morphTexture.source.data.data,Kt=b.length+1,an=s*Kt+1;for(let _n=0;_n<b.length;_n++)b[_n]=_e[an+_n]}raycast(s,a){const b=this.matrixWorld,_e=this.count;if(_mesh$1.geometry=this.geometry,_mesh$1.material=this.material,_mesh$1.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),_sphere$3.copy(this.boundingSphere),_sphere$3.applyMatrix4(b),s.ray.intersectsSphere(_sphere$3)!==!1))for(let Kt=0;Kt<_e;Kt++){this.getMatrixAt(Kt,_instanceLocalMatrix),_instanceWorldMatrix.multiplyMatrices(b,_instanceLocalMatrix),_mesh$1.matrixWorld=_instanceWorldMatrix,_mesh$1.raycast(s,_instanceIntersects);for(let an=0,_n=_instanceIntersects.length;an<_n;an++){const On=_instanceIntersects[an];On.instanceId=Kt,On.object=this,a.push(On)}_instanceIntersects.length=0}}setColorAt(s,a){this.instanceColor===null&&(this.instanceColor=new InstancedBufferAttribute(new Float32Array(this.instanceMatrix.count*3),3)),a.toArray(this.instanceColor.array,s*3)}setMatrixAt(s,a){a.toArray(this.instanceMatrix.array,s*16)}setMorphAt(s,a){const b=a.morphTargetInfluences,_e=b.length+1;this.morphTexture===null&&(this.morphTexture=new DataTexture(new Float32Array(_e*this.count),_e,this.count,RedFormat,FloatType));const Kt=this.morphTexture.source.data.data;let an=0;for(let $n=0;$n<b.length;$n++)an+=b[$n];const _n=this.geometry.morphTargetsRelative?1:1-an,On=_e*s;Kt[On]=_n,Kt.set(b,On+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}}function sortOpaque(o,s){return o.z-s.z}function sortTransparent(o,s){return s.z-o.z}class MultiDrawRenderList{constructor(){this.index=0,this.pool=[],this.list=[]}push(s,a){const b=this.pool,_e=this.list;this.index>=b.length&&b.push({start:-1,count:-1,z:-1});const Kt=b[this.index];_e.push(Kt),this.index++,Kt.start=s.start,Kt.count=s.count,Kt.z=a}reset(){this.list.length=0,this.index=0}}const ID_ATTR_NAME="batchId",_matrix$1=new Matrix4,_invMatrixWorld=new Matrix4,_identityMatrix$2=new Matrix4,_projScreenMatrix$2=new Matrix4,_frustum=new Frustum,_box$1=new Box3,_sphere$2=new Sphere,_vector$5=new Vector3,_renderList=new MultiDrawRenderList,_mesh=new Mesh,_batchIntersects=[];function copyAttributeData(o,s,a=0){const b=s.itemSize;if(o.isInterleavedBufferAttribute||o.array.constructor!==s.array.constructor){const _e=o.count;for(let Kt=0;Kt<_e;Kt++)for(let an=0;an<b;an++)s.setComponent(Kt+a,an,o.getComponent(Kt,an))}else s.array.set(o.array,a*b);s.needsUpdate=!0}class BatchedMesh extends Mesh{get maxGeometryCount(){return this._maxGeometryCount}constructor(s,a,b=a*2,_e){super(new BufferGeometry,_e),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._drawRanges=[],this._reservedRanges=[],this._visibility=[],this._active=[],this._bounds=[],this._maxGeometryCount=s,this._maxVertexCount=a,this._maxIndexCount=b,this._geometryInitialized=!1,this._geometryCount=0,this._multiDrawCounts=new Int32Array(s),this._multiDrawStarts=new Int32Array(s),this._multiDrawCount=0,this._visibilityChanged=!0,this._matricesTexture=null,this._initMatricesTexture()}_initMatricesTexture(){let s=Math.sqrt(this._maxGeometryCount*4);s=Math.ceil(s/4)*4,s=Math.max(s,4);const a=new Float32Array(s*s*4),b=new DataTexture(a,s,s,RGBAFormat,FloatType);this._matricesTexture=b}_initializeGeometry(s){const a=this.geometry,b=this._maxVertexCount,_e=this._maxGeometryCount,Kt=this._maxIndexCount;if(this._geometryInitialized===!1){for(const _n in s.attributes){const On=s.getAttribute(_n),{array:$n,itemSize:dr,normalized:fr}=On,pr=new $n.constructor(b*dr),Ar=new BufferAttribute(pr,dr,fr);a.setAttribute(_n,Ar)}if(s.getIndex()!==null){const _n=b>65536?new Uint32Array(Kt):new Uint16Array(Kt);a.setIndex(new BufferAttribute(_n,1))}const an=_e>65536?new Uint32Array(b):new Uint16Array(b);a.setAttribute(ID_ATTR_NAME,new BufferAttribute(an,1)),this._geometryInitialized=!0}}_validateGeometry(s){if(s.getAttribute(ID_ATTR_NAME))throw new Error(`BatchedMesh: Geometry cannot use attribute "${ID_ATTR_NAME}"`);const a=this.geometry;if(!!s.getIndex()!=!!a.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const b in a.attributes){if(b===ID_ATTR_NAME)continue;if(!s.hasAttribute(b))throw new Error(`BatchedMesh: Added geometry missing "${b}". All geometries must have consistent attributes.`);const _e=s.getAttribute(b),Kt=a.getAttribute(b);if(_e.itemSize!==Kt.itemSize||_e.normalized!==Kt.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(s){return this.customSort=s,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Box3);const s=this._geometryCount,a=this.boundingBox,b=this._active;a.makeEmpty();for(let _e=0;_e<s;_e++)b[_e]!==!1&&(this.getMatrixAt(_e,_matrix$1),this.getBoundingBoxAt(_e,_box$1).applyMatrix4(_matrix$1),a.union(_box$1))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Sphere);const s=this._geometryCount,a=this.boundingSphere,b=this._active;a.makeEmpty();for(let _e=0;_e<s;_e++)b[_e]!==!1&&(this.getMatrixAt(_e,_matrix$1),this.getBoundingSphereAt(_e,_sphere$2).applyMatrix4(_matrix$1),a.union(_sphere$2))}addGeometry(s,a=-1,b=-1){if(this._initializeGeometry(s),this._validateGeometry(s),this._geometryCount>=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const _e={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let Kt=null;const an=this._reservedRanges,_n=this._drawRanges,On=this._bounds;this._geometryCount!==0&&(Kt=an[an.length-1]),a===-1?_e.vertexCount=s.getAttribute("position").count:_e.vertexCount=a,Kt===null?_e.vertexStart=0:_e.vertexStart=Kt.vertexStart+Kt.vertexCount;const $n=s.getIndex(),dr=$n!==null;if(dr&&(b===-1?_e.indexCount=$n.count:_e.indexCount=b,Kt===null?_e.indexStart=0:_e.indexStart=Kt.indexStart+Kt.indexCount),_e.indexStart!==-1&&_e.indexStart+_e.indexCount>this._maxIndexCount||_e.vertexStart+_e.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const fr=this._visibility,pr=this._active,Ar=this._matricesTexture,Or=this._matricesTexture.image.data;fr.push(!0),pr.push(!0);const Xr=this._geometryCount;this._geometryCount++,_identityMatrix$2.toArray(Or,Xr*16),Ar.needsUpdate=!0,an.push(_e),_n.push({start:dr?_e.indexStart:_e.vertexStart,count:-1}),On.push({boxInitialized:!1,box:new Box3,sphereInitialized:!1,sphere:new Sphere});const ss=this.geometry.getAttribute(ID_ATTR_NAME);for(let kr=0;kr<_e.vertexCount;kr++)ss.setX(_e.vertexStart+kr,Xr);return ss.needsUpdate=!0,this.setGeometryAt(Xr,s),Xr}setGeometryAt(s,a){if(s>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(a);const b=this.geometry,_e=b.getIndex()!==null,Kt=b.getIndex(),an=a.getIndex(),_n=this._reservedRanges[s];if(_e&&an.count>_n.indexCount||a.attributes.position.count>_n.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const On=_n.vertexStart,$n=_n.vertexCount;for(const Ar in b.attributes){if(Ar===ID_ATTR_NAME)continue;const Or=a.getAttribute(Ar),Xr=b.getAttribute(Ar);copyAttributeData(Or,Xr,On);const ss=Or.itemSize;for(let kr=Or.count,us=$n;kr<us;kr++){const hs=On+kr;for(let ds=0;ds<ss;ds++)Xr.setComponent(hs,ds,0)}Xr.needsUpdate=!0,Xr.addUpdateRange(On*ss,$n*ss)}if(_e){const Ar=_n.indexStart;for(let Or=0;Or<an.count;Or++)Kt.setX(Ar+Or,On+an.getX(Or));for(let Or=an.count,Xr=_n.indexCount;Or<Xr;Or++)Kt.setX(Ar+Or,On);Kt.needsUpdate=!0,Kt.addUpdateRange(Ar,_n.indexCount)}const dr=this._bounds[s];a.boundingBox!==null?(dr.box.copy(a.boundingBox),dr.boxInitialized=!0):dr.boxInitialized=!1,a.boundingSphere!==null?(dr.sphere.copy(a.boundingSphere),dr.sphereInitialized=!0):dr.sphereInitialized=!1;const fr=this._drawRanges[s],pr=a.getAttribute("position");return fr.count=_e?an.count:pr.count,this._visibilityChanged=!0,s}deleteGeometry(s){const a=this._active;return s>=a.length||a[s]===!1?this:(a[s]=!1,this._visibilityChanged=!0,this)}getBoundingBoxAt(s,a){if(this._active[s]===!1)return null;const _e=this._bounds[s],Kt=_e.box,an=this.geometry;if(_e.boxInitialized===!1){Kt.makeEmpty();const _n=an.index,On=an.attributes.position,$n=this._drawRanges[s];for(let dr=$n.start,fr=$n.start+$n.count;dr<fr;dr++){let pr=dr;_n&&(pr=_n.getX(pr)),Kt.expandByPoint(_vector$5.fromBufferAttribute(On,pr))}_e.boxInitialized=!0}return a.copy(Kt),a}getBoundingSphereAt(s,a){if(this._active[s]===!1)return null;const _e=this._bounds[s],Kt=_e.sphere,an=this.geometry;if(_e.sphereInitialized===!1){Kt.makeEmpty(),this.getBoundingBoxAt(s,_box$1),_box$1.getCenter(Kt.center);const _n=an.index,On=an.attributes.position,$n=this._drawRanges[s];let dr=0;for(let fr=$n.start,pr=$n.start+$n.count;fr<pr;fr++){let Ar=fr;_n&&(Ar=_n.getX(Ar)),_vector$5.fromBufferAttribute(On,Ar),dr=Math.max(dr,Kt.center.distanceToSquared(_vector$5))}Kt.radius=Math.sqrt(dr),_e.sphereInitialized=!0}return a.copy(Kt),a}setMatrixAt(s,a){const b=this._active,_e=this._matricesTexture,Kt=this._matricesTexture.image.data,an=this._geometryCount;return s>=an||b[s]===!1?this:(a.toArray(Kt,s*16),_e.needsUpdate=!0,this)}getMatrixAt(s,a){const b=this._active,_e=this._matricesTexture.image.data,Kt=this._geometryCount;return s>=Kt||b[s]===!1?null:a.fromArray(_e,s*16)}setVisibleAt(s,a){const b=this._visibility,_e=this._active,Kt=this._geometryCount;return s>=Kt||_e[s]===!1||b[s]===a?this:(b[s]=a,this._visibilityChanged=!0,this)}getVisibleAt(s){const a=this._visibility,b=this._active,_e=this._geometryCount;return s>=_e||b[s]===!1?!1:a[s]}raycast(s,a){const b=this._visibility,_e=this._active,Kt=this._drawRanges,an=this._geometryCount,_n=this.matrixWorld,On=this.geometry;_mesh.material=this.material,_mesh.geometry.index=On.index,_mesh.geometry.attributes=On.attributes,_mesh.geometry.boundingBox===null&&(_mesh.geometry.boundingBox=new Box3),_mesh.geometry.boundingSphere===null&&(_mesh.geometry.boundingSphere=new Sphere);for(let $n=0;$n<an;$n++){if(!b[$n]||!_e[$n])continue;const dr=Kt[$n];_mesh.geometry.setDrawRange(dr.start,dr.count),this.getMatrixAt($n,_mesh.matrixWorld).premultiply(_n),this.getBoundingBoxAt($n,_mesh.geometry.boundingBox),this.getBoundingSphereAt($n,_mesh.geometry.boundingSphere),_mesh.raycast(s,_batchIntersects);for(let fr=0,pr=_batchIntersects.length;fr<pr;fr++){const Ar=_batchIntersects[fr];Ar.object=this,Ar.batchId=$n,a.push(Ar)}_batchIntersects.length=0}_mesh.material=null,_mesh.geometry.index=null,_mesh.geometry.attributes={},_mesh.geometry.setDrawRange(0,1/0)}copy(s){return super.copy(s),this.geometry=s.geometry.clone(),this.perObjectFrustumCulled=s.perObjectFrustumCulled,this.sortObjects=s.sortObjects,this.boundingBox=s.boundingBox!==null?s.boundingBox.clone():null,this.boundingSphere=s.boundingSphere!==null?s.boundingSphere.clone():null,this._drawRanges=s._drawRanges.map(a=>({...a})),this._reservedRanges=s._reservedRanges.map(a=>({...a})),this._visibility=s._visibility.slice(),this._active=s._active.slice(),this._bounds=s._bounds.map(a=>({boxInitialized:a.boxInitialized,box:a.box.clone(),sphereInitialized:a.sphereInitialized,sphere:a.sphere.clone()})),this._maxGeometryCount=s._maxGeometryCount,this._maxVertexCount=s._maxVertexCount,this._maxIndexCount=s._maxIndexCount,this._geometryInitialized=s._geometryInitialized,this._geometryCount=s._geometryCount,this._multiDrawCounts=s._multiDrawCounts.slice(),this._multiDrawStarts=s._multiDrawStarts.slice(),this._matricesTexture=s._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(s,a,b,_e,Kt){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const an=_e.getIndex(),_n=an===null?1:an.array.BYTES_PER_ELEMENT,On=this._active,$n=this._visibility,dr=this._multiDrawStarts,fr=this._multiDrawCounts,pr=this._drawRanges,Ar=this.perObjectFrustumCulled;Ar&&(_projScreenMatrix$2.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse).multiply(this.matrixWorld),_frustum.setFromProjectionMatrix(_projScreenMatrix$2,s.coordinateSystem));let Or=0;if(this.sortObjects){_invMatrixWorld.copy(this.matrixWorld).invert(),_vector$5.setFromMatrixPosition(b.matrixWorld).applyMatrix4(_invMatrixWorld);for(let kr=0,us=$n.length;kr<us;kr++)if($n[kr]&&On[kr]){this.getMatrixAt(kr,_matrix$1),this.getBoundingSphereAt(kr,_sphere$2).applyMatrix4(_matrix$1);let hs=!1;if(Ar&&(hs=!_frustum.intersectsSphere(_sphere$2)),!hs){const ds=_vector$5.distanceTo(_sphere$2.center);_renderList.push(pr[kr],ds)}}const Xr=_renderList.list,ss=this.customSort;ss===null?Xr.sort(Kt.transparent?sortTransparent:sortOpaque):ss.call(this,Xr,b);for(let kr=0,us=Xr.length;kr<us;kr++){const hs=Xr[kr];dr[Or]=hs.start*_n,fr[Or]=hs.count,Or++}_renderList.reset()}else for(let Xr=0,ss=$n.length;Xr<ss;Xr++)if($n[Xr]&&On[Xr]){let kr=!1;if(Ar&&(this.getMatrixAt(Xr,_matrix$1),this.getBoundingSphereAt(Xr,_sphere$2).applyMatrix4(_matrix$1),kr=!_frustum.intersectsSphere(_sphere$2)),!kr){const us=pr[Xr];dr[Or]=us.start*_n,fr[Or]=us.count,Or++}}this._multiDrawCount=Or,this._visibilityChanged=!1}onBeforeShadow(s,a,b,_e,Kt,an){this.onBeforeRender(s,null,_e,Kt,an)}}class LineBasicMaterial extends Material{constructor(s){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Color$1(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(s)}copy(s){return super.copy(s),this.color.copy(s.color),this.map=s.map,this.linewidth=s.linewidth,this.linecap=s.linecap,this.linejoin=s.linejoin,this.fog=s.fog,this}}const _start$1=new Vector3,_end$1=new Vector3,_inverseMatrix$1=new Matrix4,_ray$1=new Ray,_sphere$1=new Sphere;class Line extends Object3D{constructor(s=new BufferGeometry,a=new LineBasicMaterial){super(),this.isLine=!0,this.type="Line",this.geometry=s,this.material=a,this.updateMorphTargets()}copy(s,a){return super.copy(s,a),this.material=Array.isArray(s.material)?s.material.slice():s.material,this.geometry=s.geometry,this}computeLineDistances(){const s=this.geometry;if(s.index===null){const a=s.attributes.position,b=[0];for(let _e=1,Kt=a.count;_e<Kt;_e++)_start$1.fromBufferAttribute(a,_e-1),_end$1.fromBufferAttribute(a,_e),b[_e]=b[_e-1],b[_e]+=_start$1.distanceTo(_end$1);s.setAttribute("lineDistance",new Float32BufferAttribute(b,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(s,a){const b=this.geometry,_e=this.matrixWorld,Kt=s.params.Line.threshold,an=b.drawRange;if(b.boundingSphere===null&&b.computeBoundingSphere(),_sphere$1.copy(b.boundingSphere),_sphere$1.applyMatrix4(_e),_sphere$1.radius+=Kt,s.ray.intersectsSphere(_sphere$1)===!1)return;_inverseMatrix$1.copy(_e).invert(),_ray$1.copy(s.ray).applyMatrix4(_inverseMatrix$1);const _n=Kt/((this.scale.x+this.scale.y+this.scale.z)/3),On=_n*_n,$n=new Vector3,dr=new Vector3,fr=new Vector3,pr=new Vector3,Ar=this.isLineSegments?2:1,Or=b.index,ss=b.attributes.position;if(Or!==null){const kr=Math.max(0,an.start),us=Math.min(Or.count,an.start+an.count);for(let hs=kr,ds=us-1;hs<ds;hs+=Ar){const fs=Or.getX(hs),Gs=Or.getX(hs+1);if($n.fromBufferAttribute(ss,fs),dr.fromBufferAttribute(ss,Gs),_ray$1.distanceSqToSegment($n,dr,pr,fr)>On)continue;pr.applyMatrix4(this.matrixWorld);const So=s.ray.origin.distanceTo(pr);So<s.near||So>s.far||a.push({distance:So,point:fr.clone().applyMatrix4(this.matrixWorld),index:hs,face:null,faceIndex:null,object:this})}}else{const kr=Math.max(0,an.start),us=Math.min(ss.count,an.start+an.count);for(let hs=kr,ds=us-1;hs<ds;hs+=Ar){if($n.fromBufferAttribute(ss,hs),dr.fromBufferAttribute(ss,hs+1),_ray$1.distanceSqToSegment($n,dr,pr,fr)>On)continue;pr.applyMatrix4(this.matrixWorld);const Gs=s.ray.origin.distanceTo(pr);Gs<s.near||Gs>s.far||a.push({distance:Gs,point:fr.clone().applyMatrix4(this.matrixWorld),index:hs,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const a=this.geometry.morphAttributes,b=Object.keys(a);if(b.length>0){const _e=a[b[0]];if(_e!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let Kt=0,an=_e.length;Kt<an;Kt++){const _n=_e[Kt].name||String(Kt);this.morphTargetInfluences.push(0),this.morphTargetDictionary[_n]=Kt}}}}}const _start=new Vector3,_end=new Vector3;class LineSegments extends Line{constructor(s,a){super(s,a),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const s=this.geometry;if(s.index===null){const a=s.attributes.position,b=[];for(let _e=0,Kt=a.count;_e<Kt;_e+=2)_start.fromBufferAttribute(a,_e),_end.fromBufferAttribute(a,_e+1),b[_e]=_e===0?0:b[_e-1],b[_e+1]=b[_e]+_start.distanceTo(_end);s.setAttribute("lineDistance",new Float32BufferAttribute(b,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class LineLoop extends Line{constructor(s,a){super(s,a),this.isLineLoop=!0,this.type="LineLoop"}}class PointsMaterial extends Material{constructor(s){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Color$1(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(s)}copy(s){return super.copy(s),this.color.copy(s.color),this.map=s.map,this.alphaMap=s.alphaMap,this.size=s.size,this.sizeAttenuation=s.sizeAttenuation,this.fog=s.fog,this}}const _inverseMatrix=new Matrix4,_ray=new Ray,_sphere$7=new Sphere,_position$2=new Vector3;class Points extends Object3D{constructor(s=new BufferGeometry,a=new PointsMaterial){super(),this.isPoints=!0,this.type="Points",this.geometry=s,this.material=a,this.updateMorphTargets()}copy(s,a){return super.copy(s,a),this.material=Array.isArray(s.material)?s.material.slice():s.material,this.geometry=s.geometry,this}raycast(s,a){const b=this.geometry,_e=this.matrixWorld,Kt=s.params.Points.threshold,an=b.drawRange;if(b.boundingSphere===null&&b.computeBoundingSphere(),_sphere$7.copy(b.boundingSphere),_sphere$7.applyMatrix4(_e),_sphere$7.radius+=Kt,s.ray.intersectsSphere(_sphere$7)===!1)return;_inverseMatrix.copy(_e).invert(),_ray.copy(s.ray).applyMatrix4(_inverseMatrix);const _n=Kt/((this.scale.x+this.scale.y+this.scale.z)/3),On=_n*_n,$n=b.index,fr=b.attributes.position;if($n!==null){const pr=Math.max(0,an.start),Ar=Math.min($n.count,an.start+an.count);for(let Or=pr,Xr=Ar;Or<Xr;Or++){const ss=$n.getX(Or);_position$2.fromBufferAttribute(fr,ss),testPoint(_position$2,ss,On,_e,s,a,this)}}else{const pr=Math.max(0,an.start),Ar=Math.min(fr.count,an.start+an.count);for(let Or=pr,Xr=Ar;Or<Xr;Or++)_position$2.fromBufferAttribute(fr,Or),testPoint(_position$2,Or,On,_e,s,a,this)}}updateMorphTargets(){const a=this.geometry.morphAttributes,b=Object.keys(a);if(b.length>0){const _e=a[b[0]];if(_e!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let Kt=0,an=_e.length;Kt<an;Kt++){const _n=_e[Kt].name||String(Kt);this.morphTargetInfluences.push(0),this.morphTargetDictionary[_n]=Kt}}}}}function testPoint(o,s,a,b,_e,Kt,an){const _n=_ray.distanceSqToPoint(o);if(_n<a){const On=new Vector3;_ray.closestPointToPoint(o,On),On.applyMatrix4(b);const $n=_e.ray.origin.distanceTo(On);if($n<_e.near||$n>_e.far)return;Kt.push({distance:$n,distanceToRay:Math.sqrt(_n),point:On,index:s,face:null,object:an})}}class VideoTexture extends Texture{constructor(s,a,b,_e,Kt,an,_n,On,$n){super(s,a,b,_e,Kt,an,_n,On,$n),this.isVideoTexture=!0,this.minFilter=an!==void 0?an:LinearFilter,this.magFilter=Kt!==void 0?Kt:LinearFilter,this.generateMipmaps=!1;const dr=this;function fr(){dr.needsUpdate=!0,s.requestVideoFrameCallback(fr)}"requestVideoFrameCallback"in s&&s.requestVideoFrameCallback(fr)}clone(){return new this.constructor(this.image).copy(this)}update(){const s=this.image;"requestVideoFrameCallback"in s===!1&&s.readyState>=s.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class FramebufferTexture extends Texture{constructor(s,a){super({width:s,height:a}),this.isFramebufferTexture=!0,this.magFilter=NearestFilter,this.minFilter=NearestFilter,this.generateMipmaps=!1,this.needsUpdate=!0}}class CompressedTexture extends Texture{constructor(s,a,b,_e,Kt,an,_n,On,$n,dr,fr,pr){super(null,an,_n,On,$n,dr,_e,Kt,fr,pr),this.isCompressedTexture=!0,this.image={width:a,height:b},this.mipmaps=s,this.flipY=!1,this.generateMipmaps=!1}}class CompressedArrayTexture extends CompressedTexture{constructor(s,a,b,_e,Kt,an){super(s,a,b,Kt,an),this.isCompressedArrayTexture=!0,this.image.depth=_e,this.wrapR=ClampToEdgeWrapping}}class CompressedCubeTexture extends CompressedTexture{constructor(s,a,b){super(void 0,s[0].width,s[0].height,a,b,CubeReflectionMapping),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=s}}class CanvasTexture extends Texture{constructor(s,a,b,_e,Kt,an,_n,On,$n){super(s,a,b,_e,Kt,an,_n,On,$n),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Curve{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(s,a){const b=this.getUtoTmapping(s);return this.getPoint(b,a)}getPoints(s=5){const a=[];for(let b=0;b<=s;b++)a.push(this.getPoint(b/s));return a}getSpacedPoints(s=5){const a=[];for(let b=0;b<=s;b++)a.push(this.getPointAt(b/s));return a}getLength(){const s=this.getLengths();return s[s.length-1]}getLengths(s=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===s+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const a=[];let b,_e=this.getPoint(0),Kt=0;a.push(0);for(let an=1;an<=s;an++)b=this.getPoint(an/s),Kt+=b.distanceTo(_e),a.push(Kt),_e=b;return this.cacheArcLengths=a,a}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(s,a){const b=this.getLengths();let _e=0;const Kt=b.length;let an;a?an=a:an=s*b[Kt-1];let _n=0,On=Kt-1,$n;for(;_n<=On;)if(_e=Math.floor(_n+(On-_n)/2),$n=b[_e]-an,$n<0)_n=_e+1;else if($n>0)On=_e-1;else{On=_e;break}if(_e=On,b[_e]===an)return _e/(Kt-1);const dr=b[_e],pr=b[_e+1]-dr,Ar=(an-dr)/pr;return(_e+Ar)/(Kt-1)}getTangent(s,a){let _e=s-1e-4,Kt=s+1e-4;_e<0&&(_e=0),Kt>1&&(Kt=1);const an=this.getPoint(_e),_n=this.getPoint(Kt),On=a||(an.isVector2?new Vector2:new Vector3);return On.copy(_n).sub(an).normalize(),On}getTangentAt(s,a){const b=this.getUtoTmapping(s);return this.getTangent(b,a)}computeFrenetFrames(s,a){const b=new Vector3,_e=[],Kt=[],an=[],_n=new Vector3,On=new Matrix4;for(let Ar=0;Ar<=s;Ar++){const Or=Ar/s;_e[Ar]=this.getTangentAt(Or,new Vector3)}Kt[0]=new Vector3,an[0]=new Vector3;let $n=Number.MAX_VALUE;const dr=Math.abs(_e[0].x),fr=Math.abs(_e[0].y),pr=Math.abs(_e[0].z);dr<=$n&&($n=dr,b.set(1,0,0)),fr<=$n&&($n=fr,b.set(0,1,0)),pr<=$n&&b.set(0,0,1),_n.crossVectors(_e[0],b).normalize(),Kt[0].crossVectors(_e[0],_n),an[0].crossVectors(_e[0],Kt[0]);for(let Ar=1;Ar<=s;Ar++){if(Kt[Ar]=Kt[Ar-1].clone(),an[Ar]=an[Ar-1].clone(),_n.crossVectors(_e[Ar-1],_e[Ar]),_n.length()>Number.EPSILON){_n.normalize();const Or=Math.acos(clamp$2(_e[Ar-1].dot(_e[Ar]),-1,1));Kt[Ar].applyMatrix4(On.makeRotationAxis(_n,Or))}an[Ar].crossVectors(_e[Ar],Kt[Ar])}if(a===!0){let Ar=Math.acos(clamp$2(Kt[0].dot(Kt[s]),-1,1));Ar/=s,_e[0].dot(_n.crossVectors(Kt[0],Kt[s]))>0&&(Ar=-Ar);for(let Or=1;Or<=s;Or++)Kt[Or].applyMatrix4(On.makeRotationAxis(_e[Or],Ar*Or)),an[Or].crossVectors(_e[Or],Kt[Or])}return{tangents:_e,normals:Kt,binormals:an}}clone(){return new this.constructor().copy(this)}copy(s){return this.arcLengthDivisions=s.arcLengthDivisions,this}toJSON(){const s={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return s.arcLengthDivisions=this.arcLengthDivisions,s.type=this.type,s}fromJSON(s){return this.arcLengthDivisions=s.arcLengthDivisions,this}}class EllipseCurve extends Curve{constructor(s=0,a=0,b=1,_e=1,Kt=0,an=Math.PI*2,_n=!1,On=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=s,this.aY=a,this.xRadius=b,this.yRadius=_e,this.aStartAngle=Kt,this.aEndAngle=an,this.aClockwise=_n,this.aRotation=On}getPoint(s,a=new Vector2){const b=a,_e=Math.PI*2;let Kt=this.aEndAngle-this.aStartAngle;const an=Math.abs(Kt)<Number.EPSILON;for(;Kt<0;)Kt+=_e;for(;Kt>_e;)Kt-=_e;Kt<Number.EPSILON&&(an?Kt=0:Kt=_e),this.aClockwise===!0&&!an&&(Kt===_e?Kt=-_e:Kt=Kt-_e);const _n=this.aStartAngle+s*Kt;let On=this.aX+this.xRadius*Math.cos(_n),$n=this.aY+this.yRadius*Math.sin(_n);if(this.aRotation!==0){const dr=Math.cos(this.aRotation),fr=Math.sin(this.aRotation),pr=On-this.aX,Ar=$n-this.aY;On=pr*dr-Ar*fr+this.aX,$n=pr*fr+Ar*dr+this.aY}return b.set(On,$n)}copy(s){return super.copy(s),this.aX=s.aX,this.aY=s.aY,this.xRadius=s.xRadius,this.yRadius=s.yRadius,this.aStartAngle=s.aStartAngle,this.aEndAngle=s.aEndAngle,this.aClockwise=s.aClockwise,this.aRotation=s.aRotation,this}toJSON(){const s=super.toJSON();return s.aX=this.aX,s.aY=this.aY,s.xRadius=this.xRadius,s.yRadius=this.yRadius,s.aStartAngle=this.aStartAngle,s.aEndAngle=this.aEndAngle,s.aClockwise=this.aClockwise,s.aRotation=this.aRotation,s}fromJSON(s){return super.fromJSON(s),this.aX=s.aX,this.aY=s.aY,this.xRadius=s.xRadius,this.yRadius=s.yRadius,this.aStartAngle=s.aStartAngle,this.aEndAngle=s.aEndAngle,this.aClockwise=s.aClockwise,this.aRotation=s.aRotation,this}}class ArcCurve extends EllipseCurve{constructor(s,a,b,_e,Kt,an){super(s,a,b,b,_e,Kt,an),this.isArcCurve=!0,this.type="ArcCurve"}}function CubicPoly(){let o=0,s=0,a=0,b=0;function _e(Kt,an,_n,On){o=Kt,s=_n,a=-3*Kt+3*an-2*_n-On,b=2*Kt-2*an+_n+On}return{initCatmullRom:function(Kt,an,_n,On,$n){_e(an,_n,$n*(_n-Kt),$n*(On-an))},initNonuniformCatmullRom:function(Kt,an,_n,On,$n,dr,fr){let pr=(an-Kt)/$n-(_n-Kt)/($n+dr)+(_n-an)/dr,Ar=(_n-an)/dr-(On-an)/(dr+fr)+(On-_n)/fr;pr*=dr,Ar*=dr,_e(an,_n,pr,Ar)},calc:function(Kt){const an=Kt*Kt,_n=an*Kt;return o+s*Kt+a*an+b*_n}}}const tmp=new Vector3,px=new CubicPoly,py=new CubicPoly,pz=new CubicPoly;class CatmullRomCurve3 extends Curve{constructor(s=[],a=!1,b="centripetal",_e=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=s,this.closed=a,this.curveType=b,this.tension=_e}getPoint(s,a=new Vector3){const b=a,_e=this.points,Kt=_e.length,an=(Kt-(this.closed?0:1))*s;let _n=Math.floor(an),On=an-_n;this.closed?_n+=_n>0?0:(Math.floor(Math.abs(_n)/Kt)+1)*Kt:On===0&&_n===Kt-1&&(_n=Kt-2,On=1);let $n,dr;this.closed||_n>0?$n=_e[(_n-1)%Kt]:(tmp.subVectors(_e[0],_e[1]).add(_e[0]),$n=tmp);const fr=_e[_n%Kt],pr=_e[(_n+1)%Kt];if(this.closed||_n+2<Kt?dr=_e[(_n+2)%Kt]:(tmp.subVectors(_e[Kt-1],_e[Kt-2]).add(_e[Kt-1]),dr=tmp),this.curveType==="centripetal"||this.curveType==="chordal"){const Ar=this.curveType==="chordal"?.5:.25;let Or=Math.pow($n.distanceToSquared(fr),Ar),Xr=Math.pow(fr.distanceToSquared(pr),Ar),ss=Math.pow(pr.distanceToSquared(dr),Ar);Xr<1e-4&&(Xr=1),Or<1e-4&&(Or=Xr),ss<1e-4&&(ss=Xr),px.initNonuniformCatmullRom($n.x,fr.x,pr.x,dr.x,Or,Xr,ss),py.initNonuniformCatmullRom($n.y,fr.y,pr.y,dr.y,Or,Xr,ss),pz.initNonuniformCatmullRom($n.z,fr.z,pr.z,dr.z,Or,Xr,ss)}else this.curveType==="catmullrom"&&(px.initCatmullRom($n.x,fr.x,pr.x,dr.x,this.tension),py.initCatmullRom($n.y,fr.y,pr.y,dr.y,this.tension),pz.initCatmullRom($n.z,fr.z,pr.z,dr.z,this.tension));return b.set(px.calc(On),py.calc(On),pz.calc(On)),b}copy(s){super.copy(s),this.points=[];for(let a=0,b=s.points.length;a<b;a++){const _e=s.points[a];this.points.push(_e.clone())}return this.closed=s.closed,this.curveType=s.curveType,this.tension=s.tension,this}toJSON(){const s=super.toJSON();s.points=[];for(let a=0,b=this.points.length;a<b;a++){const _e=this.points[a];s.points.push(_e.toArray())}return s.closed=this.closed,s.curveType=this.curveType,s.tension=this.tension,s}fromJSON(s){super.fromJSON(s),this.points=[];for(let a=0,b=s.points.length;a<b;a++){const _e=s.points[a];this.points.push(new Vector3().fromArray(_e))}return this.closed=s.closed,this.curveType=s.curveType,this.tension=s.tension,this}}function CatmullRom(o,s,a,b,_e){const Kt=(b-s)*.5,an=(_e-a)*.5,_n=o*o,On=o*_n;return(2*a-2*b+Kt+an)*On+(-3*a+3*b-2*Kt-an)*_n+Kt*o+a}function QuadraticBezierP0(o,s){const a=1-o;return a*a*s}function QuadraticBezierP1(o,s){return 2*(1-o)*o*s}function QuadraticBezierP2(o,s){return o*o*s}function QuadraticBezier(o,s,a,b){return QuadraticBezierP0(o,s)+QuadraticBezierP1(o,a)+QuadraticBezierP2(o,b)}function CubicBezierP0(o,s){const a=1-o;return a*a*a*s}function CubicBezierP1(o,s){const a=1-o;return 3*a*a*o*s}function CubicBezierP2(o,s){return 3*(1-o)*o*o*s}function CubicBezierP3(o,s){return o*o*o*s}function CubicBezier(o,s,a,b,_e){return CubicBezierP0(o,s)+CubicBezierP1(o,a)+CubicBezierP2(o,b)+CubicBezierP3(o,_e)}class CubicBezierCurve extends Curve{constructor(s=new Vector2,a=new Vector2,b=new Vector2,_e=new Vector2){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=s,this.v1=a,this.v2=b,this.v3=_e}getPoint(s,a=new Vector2){const b=a,_e=this.v0,Kt=this.v1,an=this.v2,_n=this.v3;return b.set(CubicBezier(s,_e.x,Kt.x,an.x,_n.x),CubicBezier(s,_e.y,Kt.y,an.y,_n.y)),b}copy(s){return super.copy(s),this.v0.copy(s.v0),this.v1.copy(s.v1),this.v2.copy(s.v2),this.v3.copy(s.v3),this}toJSON(){const s=super.toJSON();return s.v0=this.v0.toArray(),s.v1=this.v1.toArray(),s.v2=this.v2.toArray(),s.v3=this.v3.toArray(),s}fromJSON(s){return super.fromJSON(s),this.v0.fromArray(s.v0),this.v1.fromArray(s.v1),this.v2.fromArray(s.v2),this.v3.fromArray(s.v3),this}}class CubicBezierCurve3 extends Curve{constructor(s=new Vector3,a=new Vector3,b=new Vector3,_e=new Vector3){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=s,this.v1=a,this.v2=b,this.v3=_e}getPoint(s,a=new Vector3){const b=a,_e=this.v0,Kt=this.v1,an=this.v2,_n=this.v3;return b.set(CubicBezier(s,_e.x,Kt.x,an.x,_n.x),CubicBezier(s,_e.y,Kt.y,an.y,_n.y),CubicBezier(s,_e.z,Kt.z,an.z,_n.z)),b}copy(s){return super.copy(s),this.v0.copy(s.v0),this.v1.copy(s.v1),this.v2.copy(s.v2),this.v3.copy(s.v3),this}toJSON(){const s=super.toJSON();return s.v0=this.v0.toArray(),s.v1=this.v1.toArray(),s.v2=this.v2.toArray(),s.v3=this.v3.toArray(),s}fromJSON(s){return super.fromJSON(s),this.v0.fromArray(s.v0),this.v1.fromArray(s.v1),this.v2.fromArray(s.v2),this.v3.fromArray(s.v3),this}}class LineCurve extends Curve{constructor(s=new Vector2,a=new Vector2){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=s,this.v2=a}getPoint(s,a=new Vector2){const b=a;return s===1?b.copy(this.v2):(b.copy(this.v2).sub(this.v1),b.multiplyScalar(s).add(this.v1)),b}getPointAt(s,a){return this.getPoint(s,a)}getTangent(s,a=new Vector2){return a.subVectors(this.v2,this.v1).normalize()}getTangentAt(s,a){return this.getTangent(s,a)}copy(s){return super.copy(s),this.v1.copy(s.v1),this.v2.copy(s.v2),this}toJSON(){const s=super.toJSON();return s.v1=this.v1.toArray(),s.v2=this.v2.toArray(),s}fromJSON(s){return super.fromJSON(s),this.v1.fromArray(s.v1),this.v2.fromArray(s.v2),this}}class LineCurve3 extends Curve{constructor(s=new Vector3,a=new Vector3){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=s,this.v2=a}getPoint(s,a=new Vector3){const b=a;return s===1?b.copy(this.v2):(b.copy(this.v2).sub(this.v1),b.multiplyScalar(s).add(this.v1)),b}getPointAt(s,a){return this.getPoint(s,a)}getTangent(s,a=new Vector3){return a.subVectors(this.v2,this.v1).normalize()}getTangentAt(s,a){return this.getTangent(s,a)}copy(s){return super.copy(s),this.v1.copy(s.v1),this.v2.copy(s.v2),this}toJSON(){const s=super.toJSON();return s.v1=this.v1.toArray(),s.v2=this.v2.toArray(),s}fromJSON(s){return super.fromJSON(s),this.v1.fromArray(s.v1),this.v2.fromArray(s.v2),this}}class QuadraticBezierCurve extends Curve{constructor(s=new Vector2,a=new Vector2,b=new Vector2){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=s,this.v1=a,this.v2=b}getPoint(s,a=new Vector2){const b=a,_e=this.v0,Kt=this.v1,an=this.v2;return b.set(QuadraticBezier(s,_e.x,Kt.x,an.x),QuadraticBezier(s,_e.y,Kt.y,an.y)),b}copy(s){return super.copy(s),this.v0.copy(s.v0),this.v1.copy(s.v1),this.v2.copy(s.v2),this}toJSON(){const s=super.toJSON();return s.v0=this.v0.toArray(),s.v1=this.v1.toArray(),s.v2=this.v2.toArray(),s}fromJSON(s){return super.fromJSON(s),this.v0.fromArray(s.v0),this.v1.fromArray(s.v1),this.v2.fromArray(s.v2),this}}class QuadraticBezierCurve3 extends Curve{constructor(s=new Vector3,a=new Vector3,b=new Vector3){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=s,this.v1=a,this.v2=b}getPoint(s,a=new Vector3){const b=a,_e=this.v0,Kt=this.v1,an=this.v2;return b.set(QuadraticBezier(s,_e.x,Kt.x,an.x),QuadraticBezier(s,_e.y,Kt.y,an.y),QuadraticBezier(s,_e.z,Kt.z,an.z)),b}copy(s){return super.copy(s),this.v0.copy(s.v0),this.v1.copy(s.v1),this.v2.copy(s.v2),this}toJSON(){const s=super.toJSON();return s.v0=this.v0.toArray(),s.v1=this.v1.toArray(),s.v2=this.v2.toArray(),s}fromJSON(s){return super.fromJSON(s),this.v0.fromArray(s.v0),this.v1.fromArray(s.v1),this.v2.fromArray(s.v2),this}}class SplineCurve extends Curve{constructor(s=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=s}getPoint(s,a=new Vector2){const b=a,_e=this.points,Kt=(_e.length-1)*s,an=Math.floor(Kt),_n=Kt-an,On=_e[an===0?an:an-1],$n=_e[an],dr=_e[an>_e.length-2?_e.length-1:an+1],fr=_e[an>_e.length-3?_e.length-1:an+2];return b.set(CatmullRom(_n,On.x,$n.x,dr.x,fr.x),CatmullRom(_n,On.y,$n.y,dr.y,fr.y)),b}copy(s){super.copy(s),this.points=[];for(let a=0,b=s.points.length;a<b;a++){const _e=s.points[a];this.points.push(_e.clone())}return this}toJSON(){const s=super.toJSON();s.points=[];for(let a=0,b=this.points.length;a<b;a++){const _e=this.points[a];s.points.push(_e.toArray())}return s}fromJSON(s){super.fromJSON(s),this.points=[];for(let a=0,b=s.points.length;a<b;a++){const _e=s.points[a];this.points.push(new Vector2().fromArray(_e))}return this}}var Curves=Object.freeze({__proto__:null,ArcCurve,CatmullRomCurve3,CubicBezierCurve,CubicBezierCurve3,EllipseCurve,LineCurve,LineCurve3,QuadraticBezierCurve,QuadraticBezierCurve3,SplineCurve});class CurvePath extends Curve{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(s){this.curves.push(s)}closePath(){const s=this.curves[0].getPoint(0),a=this.curves[this.curves.length-1].getPoint(1);if(!s.equals(a)){const b=s.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new Curves[b](a,s))}return this}getPoint(s,a){const b=s*this.getLength(),_e=this.getCurveLengths();let Kt=0;for(;Kt<_e.length;){if(_e[Kt]>=b){const an=_e[Kt]-b,_n=this.curves[Kt],On=_n.getLength(),$n=On===0?0:1-an/On;return _n.getPointAt($n,a)}Kt++}return null}getLength(){const s=this.getCurveLengths();return s[s.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const s=[];let a=0;for(let b=0,_e=this.curves.length;b<_e;b++)a+=this.curves[b].getLength(),s.push(a);return this.cacheLengths=s,s}getSpacedPoints(s=40){const a=[];for(let b=0;b<=s;b++)a.push(this.getPoint(b/s));return this.autoClose&&a.push(a[0]),a}getPoints(s=12){const a=[];let b;for(let _e=0,Kt=this.curves;_e<Kt.length;_e++){const an=Kt[_e],_n=an.isEllipseCurve?s*2:an.isLineCurve||an.isLineCurve3?1:an.isSplineCurve?s*an.points.length:s,On=an.getPoints(_n);for(let $n=0;$n<On.length;$n++){const dr=On[$n];b&&b.equals(dr)||(a.push(dr),b=dr)}}return this.autoClose&&a.length>1&&!a[a.length-1].equals(a[0])&&a.push(a[0]),a}copy(s){super.copy(s),this.curves=[];for(let a=0,b=s.curves.length;a<b;a++){const _e=s.curves[a];this.curves.push(_e.clone())}return this.autoClose=s.autoClose,this}toJSON(){const s=super.toJSON();s.autoClose=this.autoClose,s.curves=[];for(let a=0,b=this.curves.length;a<b;a++){const _e=this.curves[a];s.curves.push(_e.toJSON())}return s}fromJSON(s){super.fromJSON(s),this.autoClose=s.autoClose,this.curves=[];for(let a=0,b=s.curves.length;a<b;a++){const _e=s.curves[a];this.curves.push(new Curves[_e.type]().fromJSON(_e))}return this}}class Path extends CurvePath{constructor(s){super(),this.type="Path",this.currentPoint=new Vector2,s&&this.setFromPoints(s)}setFromPoints(s){this.moveTo(s[0].x,s[0].y);for(let a=1,b=s.length;a<b;a++)this.lineTo(s[a].x,s[a].y);return this}moveTo(s,a){return this.currentPoint.set(s,a),this}lineTo(s,a){const b=new LineCurve(this.currentPoint.clone(),new Vector2(s,a));return this.curves.push(b),this.currentPoint.set(s,a),this}quadraticCurveTo(s,a,b,_e){const Kt=new QuadraticBezierCurve(this.currentPoint.clone(),new Vector2(s,a),new Vector2(b,_e));return this.curves.push(Kt),this.currentPoint.set(b,_e),this}bezierCurveTo(s,a,b,_e,Kt,an){const _n=new CubicBezierCurve(this.currentPoint.clone(),new Vector2(s,a),new Vector2(b,_e),new Vector2(Kt,an));return this.curves.push(_n),this.currentPoint.set(Kt,an),this}splineThru(s){const a=[this.currentPoint.clone()].concat(s),b=new SplineCurve(a);return this.curves.push(b),this.currentPoint.copy(s[s.length-1]),this}arc(s,a,b,_e,Kt,an){const _n=this.currentPoint.x,On=this.currentPoint.y;return this.absarc(s+_n,a+On,b,_e,Kt,an),this}absarc(s,a,b,_e,Kt,an){return this.absellipse(s,a,b,b,_e,Kt,an),this}ellipse(s,a,b,_e,Kt,an,_n,On){const $n=this.currentPoint.x,dr=this.currentPoint.y;return this.absellipse(s+$n,a+dr,b,_e,Kt,an,_n,On),this}absellipse(s,a,b,_e,Kt,an,_n,On){const $n=new EllipseCurve(s,a,b,_e,Kt,an,_n,On);if(this.curves.length>0){const fr=$n.getPoint(0);fr.equals(this.currentPoint)||this.lineTo(fr.x,fr.y)}this.curves.push($n);const dr=$n.getPoint(1);return this.currentPoint.copy(dr),this}copy(s){return super.copy(s),this.currentPoint.copy(s.currentPoint),this}toJSON(){const s=super.toJSON();return s.currentPoint=this.currentPoint.toArray(),s}fromJSON(s){return super.fromJSON(s),this.currentPoint.fromArray(s.currentPoint),this}}class LatheGeometry extends BufferGeometry{constructor(s=[new Vector2(0,-.5),new Vector2(.5,0),new Vector2(0,.5)],a=12,b=0,_e=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:s,segments:a,phiStart:b,phiLength:_e},a=Math.floor(a),_e=clamp$2(_e,0,Math.PI*2);const Kt=[],an=[],_n=[],On=[],$n=[],dr=1/a,fr=new Vector3,pr=new Vector2,Ar=new Vector3,Or=new Vector3,Xr=new Vector3;let ss=0,kr=0;for(let us=0;us<=s.length-1;us++)switch(us){case 0:ss=s[us+1].x-s[us].x,kr=s[us+1].y-s[us].y,Ar.x=kr*1,Ar.y=-ss,Ar.z=kr*0,Xr.copy(Ar),Ar.normalize(),On.push(Ar.x,Ar.y,Ar.z);break;case s.length-1:On.push(Xr.x,Xr.y,Xr.z);break;default:ss=s[us+1].x-s[us].x,kr=s[us+1].y-s[us].y,Ar.x=kr*1,Ar.y=-ss,Ar.z=kr*0,Or.copy(Ar),Ar.x+=Xr.x,Ar.y+=Xr.y,Ar.z+=Xr.z,Ar.normalize(),On.push(Ar.x,Ar.y,Ar.z),Xr.copy(Or)}for(let us=0;us<=a;us++){const hs=b+us*dr*_e,ds=Math.sin(hs),fs=Math.cos(hs);for(let Gs=0;Gs<=s.length-1;Gs++){fr.x=s[Gs].x*ds,fr.y=s[Gs].y,fr.z=s[Gs].x*fs,an.push(fr.x,fr.y,fr.z),pr.x=us/a,pr.y=Gs/(s.length-1),_n.push(pr.x,pr.y);const ga=On[3*Gs+0]*ds,So=On[3*Gs+1],go=On[3*Gs+0]*fs;$n.push(ga,So,go)}}for(let us=0;us<a;us++)for(let hs=0;hs<s.length-1;hs++){const ds=hs+us*s.length,fs=ds,Gs=ds+s.length,ga=ds+s.length+1,So=ds+1;Kt.push(fs,Gs,So),Kt.push(ga,So,Gs)}this.setIndex(Kt),this.setAttribute("position",new Float32BufferAttribute(an,3)),this.setAttribute("uv",new Float32BufferAttribute(_n,2)),this.setAttribute("normal",new Float32BufferAttribute($n,3))}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}static fromJSON(s){return new LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength)}}class CapsuleGeometry extends LatheGeometry{constructor(s=1,a=1,b=4,_e=8){const Kt=new Path;Kt.absarc(0,-a/2,s,Math.PI*1.5,0),Kt.absarc(0,a/2,s,0,Math.PI*.5),super(Kt.getPoints(b),_e),this.type="CapsuleGeometry",this.parameters={radius:s,length:a,capSegments:b,radialSegments:_e}}static fromJSON(s){return new CapsuleGeometry(s.radius,s.length,s.capSegments,s.radialSegments)}}class CircleGeometry extends BufferGeometry{constructor(s=1,a=32,b=0,_e=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:s,segments:a,thetaStart:b,thetaLength:_e},a=Math.max(3,a);const Kt=[],an=[],_n=[],On=[],$n=new Vector3,dr=new Vector2;an.push(0,0,0),_n.push(0,0,1),On.push(.5,.5);for(let fr=0,pr=3;fr<=a;fr++,pr+=3){const Ar=b+fr/a*_e;$n.x=s*Math.cos(Ar),$n.y=s*Math.sin(Ar),an.push($n.x,$n.y,$n.z),_n.push(0,0,1),dr.x=(an[pr]/s+1)/2,dr.y=(an[pr+1]/s+1)/2,On.push(dr.x,dr.y)}for(let fr=1;fr<=a;fr++)Kt.push(fr,fr+1,0);this.setIndex(Kt),this.setAttribute("position",new Float32BufferAttribute(an,3)),this.setAttribute("normal",new Float32BufferAttribute(_n,3)),this.setAttribute("uv",new Float32BufferAttribute(On,2))}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}static fromJSON(s){return new CircleGeometry(s.radius,s.segments,s.thetaStart,s.thetaLength)}}class CylinderGeometry extends BufferGeometry{constructor(s=1,a=1,b=1,_e=32,Kt=1,an=!1,_n=0,On=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:s,radiusBottom:a,height:b,radialSegments:_e,heightSegments:Kt,openEnded:an,thetaStart:_n,thetaLength:On};const $n=this;_e=Math.floor(_e),Kt=Math.floor(Kt);const dr=[],fr=[],pr=[],Ar=[];let Or=0;const Xr=[],ss=b/2;let kr=0;us(),an===!1&&(s>0&&hs(!0),a>0&&hs(!1)),this.setIndex(dr),this.setAttribute("position",new Float32BufferAttribute(fr,3)),this.setAttribute("normal",new Float32BufferAttribute(pr,3)),this.setAttribute("uv",new Float32BufferAttribute(Ar,2));function us(){const ds=new Vector3,fs=new Vector3;let Gs=0;const ga=(a-s)/b;for(let So=0;So<=Kt;So++){const go=[],xo=So/Kt,Mo=xo*(a-s)+s;for(let yl=0;yl<=_e;yl++){const Al=yl/_e,xl=Al*On+_n,ep=Math.sin(xl),_f=Math.cos(xl);fs.x=Mo*ep,fs.y=-xo*b+ss,fs.z=Mo*_f,fr.push(fs.x,fs.y,fs.z),ds.set(ep,ga,_f).normalize(),pr.push(ds.x,ds.y,ds.z),Ar.push(Al,1-xo),go.push(Or++)}Xr.push(go)}for(let So=0;So<_e;So++)for(let go=0;go<Kt;go++){const xo=Xr[go][So],Mo=Xr[go+1][So],yl=Xr[go+1][So+1],Al=Xr[go][So+1];dr.push(xo,Mo,Al),dr.push(Mo,yl,Al),Gs+=6}$n.addGroup(kr,Gs,0),kr+=Gs}function hs(ds){const fs=Or,Gs=new Vector2,ga=new Vector3;let So=0;const go=ds===!0?s:a,xo=ds===!0?1:-1;for(let yl=1;yl<=_e;yl++)fr.push(0,ss*xo,0),pr.push(0,xo,0),Ar.push(.5,.5),Or++;const Mo=Or;for(let yl=0;yl<=_e;yl++){const xl=yl/_e*On+_n,ep=Math.cos(xl),_f=Math.sin(xl);ga.x=go*_f,ga.y=ss*xo,ga.z=go*ep,fr.push(ga.x,ga.y,ga.z),pr.push(0,xo,0),Gs.x=ep*.5+.5,Gs.y=_f*.5*xo+.5,Ar.push(Gs.x,Gs.y),Or++}for(let yl=0;yl<_e;yl++){const Al=fs+yl,xl=Mo+yl;ds===!0?dr.push(xl,xl+1,Al):dr.push(xl+1,xl,Al),So+=3}$n.addGroup(kr,So,ds===!0?1:2),kr+=So}}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}static fromJSON(s){return new CylinderGeometry(s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength)}}class ConeGeometry extends CylinderGeometry{constructor(s=1,a=1,b=32,_e=1,Kt=!1,an=0,_n=Math.PI*2){super(0,s,a,b,_e,Kt,an,_n),this.type="ConeGeometry",this.parameters={radius:s,height:a,radialSegments:b,heightSegments:_e,openEnded:Kt,thetaStart:an,thetaLength:_n}}static fromJSON(s){return new ConeGeometry(s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength)}}class PolyhedronGeometry extends BufferGeometry{constructor(s=[],a=[],b=1,_e=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:s,indices:a,radius:b,detail:_e};const Kt=[],an=[];_n(_e),$n(b),dr(),this.setAttribute("position",new Float32BufferAttribute(Kt,3)),this.setAttribute("normal",new Float32BufferAttribute(Kt.slice(),3)),this.setAttribute("uv",new Float32BufferAttribute(an,2)),_e===0?this.computeVertexNormals():this.normalizeNormals();function _n(us){const hs=new Vector3,ds=new Vector3,fs=new Vector3;for(let Gs=0;Gs<a.length;Gs+=3)Ar(a[Gs+0],hs),Ar(a[Gs+1],ds),Ar(a[Gs+2],fs),On(hs,ds,fs,us)}function On(us,hs,ds,fs){const Gs=fs+1,ga=[];for(let So=0;So<=Gs;So++){ga[So]=[];const go=us.clone().lerp(ds,So/Gs),xo=hs.clone().lerp(ds,So/Gs),Mo=Gs-So;for(let yl=0;yl<=Mo;yl++)yl===0&&So===Gs?ga[So][yl]=go:ga[So][yl]=go.clone().lerp(xo,yl/Mo)}for(let So=0;So<Gs;So++)for(let go=0;go<2*(Gs-So)-1;go++){const xo=Math.floor(go/2);go%2===0?(pr(ga[So][xo+1]),pr(ga[So+1][xo]),pr(ga[So][xo])):(pr(ga[So][xo+1]),pr(ga[So+1][xo+1]),pr(ga[So+1][xo]))}}function $n(us){const hs=new Vector3;for(let ds=0;ds<Kt.length;ds+=3)hs.x=Kt[ds+0],hs.y=Kt[ds+1],hs.z=Kt[ds+2],hs.normalize().multiplyScalar(us),Kt[ds+0]=hs.x,Kt[ds+1]=hs.y,Kt[ds+2]=hs.z}function dr(){const us=new Vector3;for(let hs=0;hs<Kt.length;hs+=3){us.x=Kt[hs+0],us.y=Kt[hs+1],us.z=Kt[hs+2];const ds=ss(us)/2/Math.PI+.5,fs=kr(us)/Math.PI+.5;an.push(ds,1-fs)}Or(),fr()}function fr(){for(let us=0;us<an.length;us+=6){const hs=an[us+0],ds=an[us+2],fs=an[us+4],Gs=Math.max(hs,ds,fs),ga=Math.min(hs,ds,fs);Gs>.9&&ga<.1&&(hs<.2&&(an[us+0]+=1),ds<.2&&(an[us+2]+=1),fs<.2&&(an[us+4]+=1))}}function pr(us){Kt.push(us.x,us.y,us.z)}function Ar(us,hs){const ds=us*3;hs.x=s[ds+0],hs.y=s[ds+1],hs.z=s[ds+2]}function Or(){const us=new Vector3,hs=new Vector3,ds=new Vector3,fs=new Vector3,Gs=new Vector2,ga=new Vector2,So=new Vector2;for(let go=0,xo=0;go<Kt.length;go+=9,xo+=6){us.set(Kt[go+0],Kt[go+1],Kt[go+2]),hs.set(Kt[go+3],Kt[go+4],Kt[go+5]),ds.set(Kt[go+6],Kt[go+7],Kt[go+8]),Gs.set(an[xo+0],an[xo+1]),ga.set(an[xo+2],an[xo+3]),So.set(an[xo+4],an[xo+5]),fs.copy(us).add(hs).add(ds).divideScalar(3);const Mo=ss(fs);Xr(Gs,xo+0,us,Mo),Xr(ga,xo+2,hs,Mo),Xr(So,xo+4,ds,Mo)}}function Xr(us,hs,ds,fs){fs<0&&us.x===1&&(an[hs]=us.x-1),ds.x===0&&ds.z===0&&(an[hs]=fs/2/Math.PI+.5)}function ss(us){return Math.atan2(us.z,-us.x)}function kr(us){return Math.atan2(-us.y,Math.sqrt(us.x*us.x+us.z*us.z))}}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}static fromJSON(s){return new PolyhedronGeometry(s.vertices,s.indices,s.radius,s.details)}}class DodecahedronGeometry extends PolyhedronGeometry{constructor(s=1,a=0){const b=(1+Math.sqrt(5))/2,_e=1/b,Kt=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-_e,-b,0,-_e,b,0,_e,-b,0,_e,b,-_e,-b,0,-_e,b,0,_e,-b,0,_e,b,0,-b,0,-_e,b,0,-_e,-b,0,_e,b,0,_e],an=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(Kt,an,s,a),this.type="DodecahedronGeometry",this.parameters={radius:s,detail:a}}static fromJSON(s){return new DodecahedronGeometry(s.radius,s.detail)}}const _v0=new Vector3,_v1$1=new Vector3,_normal=new Vector3,_triangle=new Triangle;class EdgesGeometry extends BufferGeometry{constructor(s=null,a=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:s,thresholdAngle:a},s!==null){const _e=Math.pow(10,4),Kt=Math.cos(DEG2RAD$1*a),an=s.getIndex(),_n=s.getAttribute("position"),On=an?an.count:_n.count,$n=[0,0,0],dr=["a","b","c"],fr=new Array(3),pr={},Ar=[];for(let Or=0;Or<On;Or+=3){an?($n[0]=an.getX(Or),$n[1]=an.getX(Or+1),$n[2]=an.getX(Or+2)):($n[0]=Or,$n[1]=Or+1,$n[2]=Or+2);const{a:Xr,b:ss,c:kr}=_triangle;if(Xr.fromBufferAttribute(_n,$n[0]),ss.fromBufferAttribute(_n,$n[1]),kr.fromBufferAttribute(_n,$n[2]),_triangle.getNormal(_normal),fr[0]=`${Math.round(Xr.x*_e)},${Math.round(Xr.y*_e)},${Math.round(Xr.z*_e)}`,fr[1]=`${Math.round(ss.x*_e)},${Math.round(ss.y*_e)},${Math.round(ss.z*_e)}`,fr[2]=`${Math.round(kr.x*_e)},${Math.round(kr.y*_e)},${Math.round(kr.z*_e)}`,!(fr[0]===fr[1]||fr[1]===fr[2]||fr[2]===fr[0]))for(let us=0;us<3;us++){const hs=(us+1)%3,ds=fr[us],fs=fr[hs],Gs=_triangle[dr[us]],ga=_triangle[dr[hs]],So=`${ds}_${fs}`,go=`${fs}_${ds}`;go in pr&&pr[go]?(_normal.dot(pr[go].normal)<=Kt&&(Ar.push(Gs.x,Gs.y,Gs.z),Ar.push(ga.x,ga.y,ga.z)),pr[go]=null):So in pr||(pr[So]={index0:$n[us],index1:$n[hs],normal:_normal.clone()})}}for(const Or in pr)if(pr[Or]){const{index0:Xr,index1:ss}=pr[Or];_v0.fromBufferAttribute(_n,Xr),_v1$1.fromBufferAttribute(_n,ss),Ar.push(_v0.x,_v0.y,_v0.z),Ar.push(_v1$1.x,_v1$1.y,_v1$1.z)}this.setAttribute("position",new Float32BufferAttribute(Ar,3))}}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}}class Shape extends Path{constructor(s){super(s),this.uuid=generateUUID(),this.type="Shape",this.holes=[]}getPointsHoles(s){const a=[];for(let b=0,_e=this.holes.length;b<_e;b++)a[b]=this.holes[b].getPoints(s);return a}extractPoints(s){return{shape:this.getPoints(s),holes:this.getPointsHoles(s)}}copy(s){super.copy(s),this.holes=[];for(let a=0,b=s.holes.length;a<b;a++){const _e=s.holes[a];this.holes.push(_e.clone())}return this}toJSON(){const s=super.toJSON();s.uuid=this.uuid,s.holes=[];for(let a=0,b=this.holes.length;a<b;a++){const _e=this.holes[a];s.holes.push(_e.toJSON())}return s}fromJSON(s){super.fromJSON(s),this.uuid=s.uuid,this.holes=[];for(let a=0,b=s.holes.length;a<b;a++){const _e=s.holes[a];this.holes.push(new Path().fromJSON(_e))}return this}}const Earcut={triangulate:function(o,s,a=2){const b=s&&s.length,_e=b?s[0]*a:o.length;let Kt=linkedList(o,0,_e,a,!0);const an=[];if(!Kt||Kt.next===Kt.prev)return an;let _n,On,$n,dr,fr,pr,Ar;if(b&&(Kt=eliminateHoles(o,s,Kt,a)),o.length>80*a){_n=$n=o[0],On=dr=o[1];for(let Or=a;Or<_e;Or+=a)fr=o[Or],pr=o[Or+1],fr<_n&&(_n=fr),pr<On&&(On=pr),fr>$n&&($n=fr),pr>dr&&(dr=pr);Ar=Math.max($n-_n,dr-On),Ar=Ar!==0?32767/Ar:0}return earcutLinked(Kt,an,a,_n,On,Ar,0),an}};function linkedList(o,s,a,b,_e){let Kt,an;if(_e===signedArea(o,s,a,b)>0)for(Kt=s;Kt<a;Kt+=b)an=insertNode(Kt,o[Kt],o[Kt+1],an);else for(Kt=a-b;Kt>=s;Kt-=b)an=insertNode(Kt,o[Kt],o[Kt+1],an);return an&&equals(an,an.next)&&(removeNode(an),an=an.next),an}function filterPoints(o,s){if(!o)return o;s||(s=o);let a=o,b;do if(b=!1,!a.steiner&&(equals(a,a.next)||area$1(a.prev,a,a.next)===0)){if(removeNode(a),a=s=a.prev,a===a.next)break;b=!0}else a=a.next;while(b||a!==s);return s}function earcutLinked(o,s,a,b,_e,Kt,an){if(!o)return;!an&&Kt&&indexCurve(o,b,_e,Kt);let _n=o,On,$n;for(;o.prev!==o.next;){if(On=o.prev,$n=o.next,Kt?isEarHashed(o,b,_e,Kt):isEar(o)){s.push(On.i/a|0),s.push(o.i/a|0),s.push($n.i/a|0),removeNode(o),o=$n.next,_n=$n.next;continue}if(o=$n,o===_n){an?an===1?(o=cureLocalIntersections(filterPoints(o),s,a),earcutLinked(o,s,a,b,_e,Kt,2)):an===2&&splitEarcut(o,s,a,b,_e,Kt):earcutLinked(filterPoints(o),s,a,b,_e,Kt,1);break}}}function isEar(o){const s=o.prev,a=o,b=o.next;if(area$1(s,a,b)>=0)return!1;const _e=s.x,Kt=a.x,an=b.x,_n=s.y,On=a.y,$n=b.y,dr=_e<Kt?_e<an?_e:an:Kt<an?Kt:an,fr=_n<On?_n<$n?_n:$n:On<$n?On:$n,pr=_e>Kt?_e>an?_e:an:Kt>an?Kt:an,Ar=_n>On?_n>$n?_n:$n:On>$n?On:$n;let Or=b.next;for(;Or!==s;){if(Or.x>=dr&&Or.x<=pr&&Or.y>=fr&&Or.y<=Ar&&pointInTriangle(_e,_n,Kt,On,an,$n,Or.x,Or.y)&&area$1(Or.prev,Or,Or.next)>=0)return!1;Or=Or.next}return!0}function isEarHashed(o,s,a,b){const _e=o.prev,Kt=o,an=o.next;if(area$1(_e,Kt,an)>=0)return!1;const _n=_e.x,On=Kt.x,$n=an.x,dr=_e.y,fr=Kt.y,pr=an.y,Ar=_n<On?_n<$n?_n:$n:On<$n?On:$n,Or=dr<fr?dr<pr?dr:pr:fr<pr?fr:pr,Xr=_n>On?_n>$n?_n:$n:On>$n?On:$n,ss=dr>fr?dr>pr?dr:pr:fr>pr?fr:pr,kr=zOrder(Ar,Or,s,a,b),us=zOrder(Xr,ss,s,a,b);let hs=o.prevZ,ds=o.nextZ;for(;hs&&hs.z>=kr&&ds&&ds.z<=us;){if(hs.x>=Ar&&hs.x<=Xr&&hs.y>=Or&&hs.y<=ss&&hs!==_e&&hs!==an&&pointInTriangle(_n,dr,On,fr,$n,pr,hs.x,hs.y)&&area$1(hs.prev,hs,hs.next)>=0||(hs=hs.prevZ,ds.x>=Ar&&ds.x<=Xr&&ds.y>=Or&&ds.y<=ss&&ds!==_e&&ds!==an&&pointInTriangle(_n,dr,On,fr,$n,pr,ds.x,ds.y)&&area$1(ds.prev,ds,ds.next)>=0))return!1;ds=ds.nextZ}for(;hs&&hs.z>=kr;){if(hs.x>=Ar&&hs.x<=Xr&&hs.y>=Or&&hs.y<=ss&&hs!==_e&&hs!==an&&pointInTriangle(_n,dr,On,fr,$n,pr,hs.x,hs.y)&&area$1(hs.prev,hs,hs.next)>=0)return!1;hs=hs.prevZ}for(;ds&&ds.z<=us;){if(ds.x>=Ar&&ds.x<=Xr&&ds.y>=Or&&ds.y<=ss&&ds!==_e&&ds!==an&&pointInTriangle(_n,dr,On,fr,$n,pr,ds.x,ds.y)&&area$1(ds.prev,ds,ds.next)>=0)return!1;ds=ds.nextZ}return!0}function cureLocalIntersections(o,s,a){let b=o;do{const _e=b.prev,Kt=b.next.next;!equals(_e,Kt)&&intersects(_e,b,b.next,Kt)&&locallyInside(_e,Kt)&&locallyInside(Kt,_e)&&(s.push(_e.i/a|0),s.push(b.i/a|0),s.push(Kt.i/a|0),removeNode(b),removeNode(b.next),b=o=Kt),b=b.next}while(b!==o);return filterPoints(b)}function splitEarcut(o,s,a,b,_e,Kt){let an=o;do{let _n=an.next.next;for(;_n!==an.prev;){if(an.i!==_n.i&&isValidDiagonal(an,_n)){let On=splitPolygon(an,_n);an=filterPoints(an,an.next),On=filterPoints(On,On.next),earcutLinked(an,s,a,b,_e,Kt,0),earcutLinked(On,s,a,b,_e,Kt,0);return}_n=_n.next}an=an.next}while(an!==o)}function eliminateHoles(o,s,a,b){const _e=[];let Kt,an,_n,On,$n;for(Kt=0,an=s.length;Kt<an;Kt++)_n=s[Kt]*b,On=Kt<an-1?s[Kt+1]*b:o.length,$n=linkedList(o,_n,On,b,!1),$n===$n.next&&($n.steiner=!0),_e.push(getLeftmost($n));for(_e.sort(compareX),Kt=0;Kt<_e.length;Kt++)a=eliminateHole(_e[Kt],a);return a}function compareX(o,s){return o.x-s.x}function eliminateHole(o,s){const a=findHoleBridge(o,s);if(!a)return s;const b=splitPolygon(a,o);return filterPoints(b,b.next),filterPoints(a,a.next)}function findHoleBridge(o,s){let a=s,b=-1/0,_e;const Kt=o.x,an=o.y;do{if(an<=a.y&&an>=a.next.y&&a.next.y!==a.y){const pr=a.x+(an-a.y)*(a.next.x-a.x)/(a.next.y-a.y);if(pr<=Kt&&pr>b&&(b=pr,_e=a.x<a.next.x?a:a.next,pr===Kt))return _e}a=a.next}while(a!==s);if(!_e)return null;const _n=_e,On=_e.x,$n=_e.y;let dr=1/0,fr;a=_e;do Kt>=a.x&&a.x>=On&&Kt!==a.x&&pointInTriangle(an<$n?Kt:b,an,On,$n,an<$n?b:Kt,an,a.x,a.y)&&(fr=Math.abs(an-a.y)/(Kt-a.x),locallyInside(a,o)&&(fr<dr||fr===dr&&(a.x>_e.x||a.x===_e.x&§orContainsSector(_e,a)))&&(_e=a,dr=fr)),a=a.next;while(a!==_n);return _e}function sectorContainsSector(o,s){return area$1(o.prev,o,s.prev)<0&&area$1(s.next,o,o.next)<0}function indexCurve(o,s,a,b){let _e=o;do _e.z===0&&(_e.z=zOrder(_e.x,_e.y,s,a,b)),_e.prevZ=_e.prev,_e.nextZ=_e.next,_e=_e.next;while(_e!==o);_e.prevZ.nextZ=null,_e.prevZ=null,sortLinked(_e)}function sortLinked(o){let s,a,b,_e,Kt,an,_n,On,$n=1;do{for(a=o,o=null,Kt=null,an=0;a;){for(an++,b=a,_n=0,s=0;s<$n&&(_n++,b=b.nextZ,!!b);s++);for(On=$n;_n>0||On>0&&b;)_n!==0&&(On===0||!b||a.z<=b.z)?(_e=a,a=a.nextZ,_n--):(_e=b,b=b.nextZ,On--),Kt?Kt.nextZ=_e:o=_e,_e.prevZ=Kt,Kt=_e;a=b}Kt.nextZ=null,$n*=2}while(an>1);return o}function zOrder(o,s,a,b,_e){return o=(o-a)*_e|0,s=(s-b)*_e|0,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,o|s<<1}function getLeftmost(o){let s=o,a=o;do(s.x<a.x||s.x===a.x&&s.y<a.y)&&(a=s),s=s.next;while(s!==o);return a}function pointInTriangle(o,s,a,b,_e,Kt,an,_n){return(_e-an)*(s-_n)>=(o-an)*(Kt-_n)&&(o-an)*(b-_n)>=(a-an)*(s-_n)&&(a-an)*(Kt-_n)>=(_e-an)*(b-_n)}function isValidDiagonal(o,s){return o.next.i!==s.i&&o.prev.i!==s.i&&!intersectsPolygon(o,s)&&(locallyInside(o,s)&&locallyInside(s,o)&&middleInside(o,s)&&(area$1(o.prev,o,s.prev)||area$1(o,s.prev,s))||equals(o,s)&&area$1(o.prev,o,o.next)>0&&area$1(s.prev,s,s.next)>0)}function area$1(o,s,a){return(s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y)}function equals(o,s){return o.x===s.x&&o.y===s.y}function intersects(o,s,a,b){const _e=sign(area$1(o,s,a)),Kt=sign(area$1(o,s,b)),an=sign(area$1(a,b,o)),_n=sign(area$1(a,b,s));return!!(_e!==Kt&&an!==_n||_e===0&&onSegment(o,a,s)||Kt===0&&onSegment(o,b,s)||an===0&&onSegment(a,o,b)||_n===0&&onSegment(a,s,b))}function onSegment(o,s,a){return s.x<=Math.max(o.x,a.x)&&s.x>=Math.min(o.x,a.x)&&s.y<=Math.max(o.y,a.y)&&s.y>=Math.min(o.y,a.y)}function sign(o){return o>0?1:o<0?-1:0}function intersectsPolygon(o,s){let a=o;do{if(a.i!==o.i&&a.next.i!==o.i&&a.i!==s.i&&a.next.i!==s.i&&intersects(a,a.next,o,s))return!0;a=a.next}while(a!==o);return!1}function locallyInside(o,s){return area$1(o.prev,o,o.next)<0?area$1(o,s,o.next)>=0&&area$1(o,o.prev,s)>=0:area$1(o,s,o.prev)<0||area$1(o,o.next,s)<0}function middleInside(o,s){let a=o,b=!1;const _e=(o.x+s.x)/2,Kt=(o.y+s.y)/2;do a.y>Kt!=a.next.y>Kt&&a.next.y!==a.y&&_e<(a.next.x-a.x)*(Kt-a.y)/(a.next.y-a.y)+a.x&&(b=!b),a=a.next;while(a!==o);return b}function splitPolygon(o,s){const a=new Node$2(o.i,o.x,o.y),b=new Node$2(s.i,s.x,s.y),_e=o.next,Kt=s.prev;return o.next=s,s.prev=o,a.next=_e,_e.prev=a,b.next=a,a.prev=b,Kt.next=b,b.prev=Kt,b}function insertNode(o,s,a,b){const _e=new Node$2(o,s,a);return b?(_e.next=b.next,_e.prev=b,b.next.prev=_e,b.next=_e):(_e.prev=_e,_e.next=_e),_e}function removeNode(o){o.next.prev=o.prev,o.prev.next=o.next,o.prevZ&&(o.prevZ.nextZ=o.nextZ),o.nextZ&&(o.nextZ.prevZ=o.prevZ)}function Node$2(o,s,a){this.i=o,this.x=s,this.y=a,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function signedArea(o,s,a,b){let _e=0;for(let Kt=s,an=a-b;Kt<a;Kt+=b)_e+=(o[an]-o[Kt])*(o[Kt+1]+o[an+1]),an=Kt;return _e}class ShapeUtils{static area(s){const a=s.length;let b=0;for(let _e=a-1,Kt=0;Kt<a;_e=Kt++)b+=s[_e].x*s[Kt].y-s[Kt].x*s[_e].y;return b*.5}static isClockWise(s){return ShapeUtils.area(s)<0}static triangulateShape(s,a){const b=[],_e=[],Kt=[];removeDupEndPts(s),addContour(b,s);let an=s.length;a.forEach(removeDupEndPts);for(let On=0;On<a.length;On++)_e.push(an),an+=a[On].length,addContour(b,a[On]);const _n=Earcut.triangulate(b,_e);for(let On=0;On<_n.length;On+=3)Kt.push(_n.slice(On,On+3));return Kt}}function removeDupEndPts(o){const s=o.length;s>2&&o[s-1].equals(o[0])&&o.pop()}function addContour(o,s){for(let a=0;a<s.length;a++)o.push(s[a].x),o.push(s[a].y)}class ExtrudeGeometry extends BufferGeometry{constructor(s=new Shape([new Vector2(.5,.5),new Vector2(-.5,.5),new Vector2(-.5,-.5),new Vector2(.5,-.5)]),a={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:s,options:a},s=Array.isArray(s)?s:[s];const b=this,_e=[],Kt=[];for(let _n=0,On=s.length;_n<On;_n++){const $n=s[_n];an($n)}this.setAttribute("position",new Float32BufferAttribute(_e,3)),this.setAttribute("uv",new Float32BufferAttribute(Kt,2)),this.computeVertexNormals();function an(_n){const On=[],$n=a.curveSegments!==void 0?a.curveSegments:12,dr=a.steps!==void 0?a.steps:1,fr=a.depth!==void 0?a.depth:1;let pr=a.bevelEnabled!==void 0?a.bevelEnabled:!0,Ar=a.bevelThickness!==void 0?a.bevelThickness:.2,Or=a.bevelSize!==void 0?a.bevelSize:Ar-.1,Xr=a.bevelOffset!==void 0?a.bevelOffset:0,ss=a.bevelSegments!==void 0?a.bevelSegments:3;const kr=a.extrudePath,us=a.UVGenerator!==void 0?a.UVGenerator:WorldUVGenerator;let hs,ds=!1,fs,Gs,ga,So;kr&&(hs=kr.getSpacedPoints(dr),ds=!0,pr=!1,fs=kr.computeFrenetFrames(dr,!1),Gs=new Vector3,ga=new Vector3,So=new Vector3),pr||(ss=0,Ar=0,Or=0,Xr=0);const go=_n.extractPoints($n);let xo=go.shape;const Mo=go.holes;if(!ShapeUtils.isClockWise(xo)){xo=xo.reverse();for(let mA=0,FA=Mo.length;mA<FA;mA++){const GA=Mo[mA];ShapeUtils.isClockWise(GA)&&(Mo[mA]=GA.reverse())}}const Al=ShapeUtils.triangulateShape(xo,Mo),xl=xo;for(let mA=0,FA=Mo.length;mA<FA;mA++){const GA=Mo[mA];xo=xo.concat(GA)}function ep(mA,FA,GA){return FA||console.error("THREE.ExtrudeGeometry: vec does not exist"),mA.clone().addScaledVector(FA,GA)}const _f=xo.length,np=Al.length;function _l(mA,FA,GA){let aE,YA,pA;const Ry=mA.x-FA.x,LA=mA.y-FA.y,$A=GA.x-mA.x,KA=GA.y-mA.y,qA=Ry*Ry+LA*LA,AA=Ry*KA-LA*$A;if(Math.abs(AA)>Number.EPSILON){const Dy=Math.sqrt(qA),WA=Math.sqrt($A*$A+KA*KA),LC=FA.x-LA/Dy,lE=FA.y+Ry/Dy,RC=GA.x-KA/WA,$C=GA.y+$A/WA,DC=((RC-LC)*KA-($C-lE)*$A)/(Ry*KA-LA*$A);aE=LC+Ry*DC-mA.x,YA=lE+LA*DC-mA.y;const cE=aE*aE+YA*YA;if(cE<=2)return new Vector2(aE,YA);pA=Math.sqrt(cE/2)}else{let Dy=!1;Ry>Number.EPSILON?$A>Number.EPSILON&&(Dy=!0):Ry<-Number.EPSILON?$A<-Number.EPSILON&&(Dy=!0):Math.sign(LA)===Math.sign(KA)&&(Dy=!0),Dy?(aE=-LA,YA=Ry,pA=Math.sqrt(qA)):(aE=Ry,YA=LA,pA=Math.sqrt(qA/2))}return new Vector2(aE/pA,YA/pA)}const Ml=[];for(let mA=0,FA=xl.length,GA=FA-1,aE=mA+1;mA<FA;mA++,GA++,aE++)GA===FA&&(GA=0),aE===FA&&(aE=0),Ml[mA]=_l(xl[mA],xl[GA],xl[aE]);const tp=[];let El,sp=Ml.concat();for(let mA=0,FA=Mo.length;mA<FA;mA++){const GA=Mo[mA];El=[];for(let aE=0,YA=GA.length,pA=YA-1,Ry=aE+1;aE<YA;aE++,pA++,Ry++)pA===YA&&(pA=0),Ry===YA&&(Ry=0),El[aE]=_l(GA[aE],GA[pA],GA[Ry]);tp.push(El),sp=sp.concat(El)}for(let mA=0;mA<ss;mA++){const FA=mA/ss,GA=Ar*Math.cos(FA*Math.PI/2),aE=Or*Math.sin(FA*Math.PI/2)+Xr;for(let YA=0,pA=xl.length;YA<pA;YA++){const Ry=ep(xl[YA],Ml[YA],aE);Wy(Ry.x,Ry.y,-GA)}for(let YA=0,pA=Mo.length;YA<pA;YA++){const Ry=Mo[YA];El=tp[YA];for(let LA=0,$A=Ry.length;LA<$A;LA++){const KA=ep(Ry[LA],El[LA],aE);Wy(KA.x,KA.y,-GA)}}}const My=Or+Xr;for(let mA=0;mA<_f;mA++){const FA=pr?ep(xo[mA],sp[mA],My):xo[mA];ds?(ga.copy(fs.normals[0]).multiplyScalar(FA.x),Gs.copy(fs.binormals[0]).multiplyScalar(FA.y),So.copy(hs[0]).add(ga).add(Gs),Wy(So.x,So.y,So.z)):Wy(FA.x,FA.y,0)}for(let mA=1;mA<=dr;mA++)for(let FA=0;FA<_f;FA++){const GA=pr?ep(xo[FA],sp[FA],My):xo[FA];ds?(ga.copy(fs.normals[mA]).multiplyScalar(GA.x),Gs.copy(fs.binormals[mA]).multiplyScalar(GA.y),So.copy(hs[mA]).add(ga).add(Gs),Wy(So.x,So.y,So.z)):Wy(GA.x,GA.y,fr/dr*mA)}for(let mA=ss-1;mA>=0;mA--){const FA=mA/ss,GA=Ar*Math.cos(FA*Math.PI/2),aE=Or*Math.sin(FA*Math.PI/2)+Xr;for(let YA=0,pA=xl.length;YA<pA;YA++){const Ry=ep(xl[YA],Ml[YA],aE);Wy(Ry.x,Ry.y,fr+GA)}for(let YA=0,pA=Mo.length;YA<pA;YA++){const Ry=Mo[YA];El=tp[YA];for(let LA=0,$A=Ry.length;LA<$A;LA++){const KA=ep(Ry[LA],El[LA],aE);ds?Wy(KA.x,KA.y+hs[dr-1].y,hs[dr-1].x+GA):Wy(KA.x,KA.y,fr+GA)}}}Py(),Ny();function Py(){const mA=_e.length/3;if(pr){let FA=0,GA=_f*FA;for(let aE=0;aE<np;aE++){const YA=Al[aE];DA(YA[2]+GA,YA[1]+GA,YA[0]+GA)}FA=dr+ss*2,GA=_f*FA;for(let aE=0;aE<np;aE++){const YA=Al[aE];DA(YA[0]+GA,YA[1]+GA,YA[2]+GA)}}else{for(let FA=0;FA<np;FA++){const GA=Al[FA];DA(GA[2],GA[1],GA[0])}for(let FA=0;FA<np;FA++){const GA=Al[FA];DA(GA[0]+_f*dr,GA[1]+_f*dr,GA[2]+_f*dr)}}b.addGroup(mA,_e.length/3-mA,0)}function Ny(){const mA=_e.length/3;let FA=0;wy(xl,FA),FA+=xl.length;for(let GA=0,aE=Mo.length;GA<aE;GA++){const YA=Mo[GA];wy(YA,FA),FA+=YA.length}b.addGroup(mA,_e.length/3-mA,1)}function wy(mA,FA){let GA=mA.length;for(;--GA>=0;){const aE=GA;let YA=GA-1;YA<0&&(YA=mA.length-1);for(let pA=0,Ry=dr+ss*2;pA<Ry;pA++){const LA=_f*pA,$A=_f*(pA+1),KA=FA+aE+LA,qA=FA+YA+LA,AA=FA+YA+$A,Dy=FA+aE+$A;UA(KA,qA,AA,Dy)}}}function Wy(mA,FA,GA){On.push(mA),On.push(FA),On.push(GA)}function DA(mA,FA,GA){jA(mA),jA(FA),jA(GA);const aE=_e.length/3,YA=us.generateTopUV(b,_e,aE-3,aE-2,aE-1);PA(YA[0]),PA(YA[1]),PA(YA[2])}function UA(mA,FA,GA,aE){jA(mA),jA(FA),jA(aE),jA(FA),jA(GA),jA(aE);const YA=_e.length/3,pA=us.generateSideWallUV(b,_e,YA-6,YA-3,YA-2,YA-1);PA(pA[0]),PA(pA[1]),PA(pA[3]),PA(pA[1]),PA(pA[2]),PA(pA[3])}function jA(mA){_e.push(On[mA*3+0]),_e.push(On[mA*3+1]),_e.push(On[mA*3+2])}function PA(mA){Kt.push(mA.x),Kt.push(mA.y)}}}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}toJSON(){const s=super.toJSON(),a=this.parameters.shapes,b=this.parameters.options;return toJSON$1(a,b,s)}static fromJSON(s,a){const b=[];for(let Kt=0,an=s.shapes.length;Kt<an;Kt++){const _n=a[s.shapes[Kt]];b.push(_n)}const _e=s.options.extrudePath;return _e!==void 0&&(s.options.extrudePath=new Curves[_e.type]().fromJSON(_e)),new ExtrudeGeometry(b,s.options)}}const WorldUVGenerator={generateTopUV:function(o,s,a,b,_e){const Kt=s[a*3],an=s[a*3+1],_n=s[b*3],On=s[b*3+1],$n=s[_e*3],dr=s[_e*3+1];return[new Vector2(Kt,an),new Vector2(_n,On),new Vector2($n,dr)]},generateSideWallUV:function(o,s,a,b,_e,Kt){const an=s[a*3],_n=s[a*3+1],On=s[a*3+2],$n=s[b*3],dr=s[b*3+1],fr=s[b*3+2],pr=s[_e*3],Ar=s[_e*3+1],Or=s[_e*3+2],Xr=s[Kt*3],ss=s[Kt*3+1],kr=s[Kt*3+2];return Math.abs(_n-dr)<Math.abs(an-$n)?[new Vector2(an,1-On),new Vector2($n,1-fr),new Vector2(pr,1-Or),new Vector2(Xr,1-kr)]:[new Vector2(_n,1-On),new Vector2(dr,1-fr),new Vector2(Ar,1-Or),new Vector2(ss,1-kr)]}};function toJSON$1(o,s,a){if(a.shapes=[],Array.isArray(o))for(let b=0,_e=o.length;b<_e;b++){const Kt=o[b];a.shapes.push(Kt.uuid)}else a.shapes.push(o.uuid);return a.options=Object.assign({},s),s.extrudePath!==void 0&&(a.options.extrudePath=s.extrudePath.toJSON()),a}class IcosahedronGeometry extends PolyhedronGeometry{constructor(s=1,a=0){const b=(1+Math.sqrt(5))/2,_e=[-1,b,0,1,b,0,-1,-b,0,1,-b,0,0,-1,b,0,1,b,0,-1,-b,0,1,-b,b,0,-1,b,0,1,-b,0,-1,-b,0,1],Kt=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(_e,Kt,s,a),this.type="IcosahedronGeometry",this.parameters={radius:s,detail:a}}static fromJSON(s){return new IcosahedronGeometry(s.radius,s.detail)}}class OctahedronGeometry extends PolyhedronGeometry{constructor(s=1,a=0){const b=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],_e=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(b,_e,s,a),this.type="OctahedronGeometry",this.parameters={radius:s,detail:a}}static fromJSON(s){return new OctahedronGeometry(s.radius,s.detail)}}class RingGeometry extends BufferGeometry{constructor(s=.5,a=1,b=32,_e=1,Kt=0,an=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:s,outerRadius:a,thetaSegments:b,phiSegments:_e,thetaStart:Kt,thetaLength:an},b=Math.max(3,b),_e=Math.max(1,_e);const _n=[],On=[],$n=[],dr=[];let fr=s;const pr=(a-s)/_e,Ar=new Vector3,Or=new Vector2;for(let Xr=0;Xr<=_e;Xr++){for(let ss=0;ss<=b;ss++){const kr=Kt+ss/b*an;Ar.x=fr*Math.cos(kr),Ar.y=fr*Math.sin(kr),On.push(Ar.x,Ar.y,Ar.z),$n.push(0,0,1),Or.x=(Ar.x/a+1)/2,Or.y=(Ar.y/a+1)/2,dr.push(Or.x,Or.y)}fr+=pr}for(let Xr=0;Xr<_e;Xr++){const ss=Xr*(b+1);for(let kr=0;kr<b;kr++){const us=kr+ss,hs=us,ds=us+b+1,fs=us+b+2,Gs=us+1;_n.push(hs,ds,Gs),_n.push(ds,fs,Gs)}}this.setIndex(_n),this.setAttribute("position",new Float32BufferAttribute(On,3)),this.setAttribute("normal",new Float32BufferAttribute($n,3)),this.setAttribute("uv",new Float32BufferAttribute(dr,2))}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}static fromJSON(s){return new RingGeometry(s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength)}}class ShapeGeometry extends BufferGeometry{constructor(s=new Shape([new Vector2(0,.5),new Vector2(-.5,-.5),new Vector2(.5,-.5)]),a=12){super(),this.type="ShapeGeometry",this.parameters={shapes:s,curveSegments:a};const b=[],_e=[],Kt=[],an=[];let _n=0,On=0;if(Array.isArray(s)===!1)$n(s);else for(let dr=0;dr<s.length;dr++)$n(s[dr]),this.addGroup(_n,On,dr),_n+=On,On=0;this.setIndex(b),this.setAttribute("position",new Float32BufferAttribute(_e,3)),this.setAttribute("normal",new Float32BufferAttribute(Kt,3)),this.setAttribute("uv",new Float32BufferAttribute(an,2));function $n(dr){const fr=_e.length/3,pr=dr.extractPoints(a);let Ar=pr.shape;const Or=pr.holes;ShapeUtils.isClockWise(Ar)===!1&&(Ar=Ar.reverse());for(let ss=0,kr=Or.length;ss<kr;ss++){const us=Or[ss];ShapeUtils.isClockWise(us)===!0&&(Or[ss]=us.reverse())}const Xr=ShapeUtils.triangulateShape(Ar,Or);for(let ss=0,kr=Or.length;ss<kr;ss++){const us=Or[ss];Ar=Ar.concat(us)}for(let ss=0,kr=Ar.length;ss<kr;ss++){const us=Ar[ss];_e.push(us.x,us.y,0),Kt.push(0,0,1),an.push(us.x,us.y)}for(let ss=0,kr=Xr.length;ss<kr;ss++){const us=Xr[ss],hs=us[0]+fr,ds=us[1]+fr,fs=us[2]+fr;b.push(hs,ds,fs),On+=3}}}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}toJSON(){const s=super.toJSON(),a=this.parameters.shapes;return toJSON(a,s)}static fromJSON(s,a){const b=[];for(let _e=0,Kt=s.shapes.length;_e<Kt;_e++){const an=a[s.shapes[_e]];b.push(an)}return new ShapeGeometry(b,s.curveSegments)}}function toJSON(o,s){if(s.shapes=[],Array.isArray(o))for(let a=0,b=o.length;a<b;a++){const _e=o[a];s.shapes.push(_e.uuid)}else s.shapes.push(o.uuid);return s}class SphereGeometry extends BufferGeometry{constructor(s=1,a=32,b=16,_e=0,Kt=Math.PI*2,an=0,_n=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:s,widthSegments:a,heightSegments:b,phiStart:_e,phiLength:Kt,thetaStart:an,thetaLength:_n},a=Math.max(3,Math.floor(a)),b=Math.max(2,Math.floor(b));const On=Math.min(an+_n,Math.PI);let $n=0;const dr=[],fr=new Vector3,pr=new Vector3,Ar=[],Or=[],Xr=[],ss=[];for(let kr=0;kr<=b;kr++){const us=[],hs=kr/b;let ds=0;kr===0&&an===0?ds=.5/a:kr===b&&On===Math.PI&&(ds=-.5/a);for(let fs=0;fs<=a;fs++){const Gs=fs/a;fr.x=-s*Math.cos(_e+Gs*Kt)*Math.sin(an+hs*_n),fr.y=s*Math.cos(an+hs*_n),fr.z=s*Math.sin(_e+Gs*Kt)*Math.sin(an+hs*_n),Or.push(fr.x,fr.y,fr.z),pr.copy(fr).normalize(),Xr.push(pr.x,pr.y,pr.z),ss.push(Gs+ds,1-hs),us.push($n++)}dr.push(us)}for(let kr=0;kr<b;kr++)for(let us=0;us<a;us++){const hs=dr[kr][us+1],ds=dr[kr][us],fs=dr[kr+1][us],Gs=dr[kr+1][us+1];(kr!==0||an>0)&&Ar.push(hs,ds,Gs),(kr!==b-1||On<Math.PI)&&Ar.push(ds,fs,Gs)}this.setIndex(Ar),this.setAttribute("position",new Float32BufferAttribute(Or,3)),this.setAttribute("normal",new Float32BufferAttribute(Xr,3)),this.setAttribute("uv",new Float32BufferAttribute(ss,2))}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}static fromJSON(s){return new SphereGeometry(s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength)}}class TetrahedronGeometry extends PolyhedronGeometry{constructor(s=1,a=0){const b=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],_e=[2,1,0,0,3,2,1,3,0,2,3,1];super(b,_e,s,a),this.type="TetrahedronGeometry",this.parameters={radius:s,detail:a}}static fromJSON(s){return new TetrahedronGeometry(s.radius,s.detail)}}class TorusGeometry extends BufferGeometry{constructor(s=1,a=.4,b=12,_e=48,Kt=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:s,tube:a,radialSegments:b,tubularSegments:_e,arc:Kt},b=Math.floor(b),_e=Math.floor(_e);const an=[],_n=[],On=[],$n=[],dr=new Vector3,fr=new Vector3,pr=new Vector3;for(let Ar=0;Ar<=b;Ar++)for(let Or=0;Or<=_e;Or++){const Xr=Or/_e*Kt,ss=Ar/b*Math.PI*2;fr.x=(s+a*Math.cos(ss))*Math.cos(Xr),fr.y=(s+a*Math.cos(ss))*Math.sin(Xr),fr.z=a*Math.sin(ss),_n.push(fr.x,fr.y,fr.z),dr.x=s*Math.cos(Xr),dr.y=s*Math.sin(Xr),pr.subVectors(fr,dr).normalize(),On.push(pr.x,pr.y,pr.z),$n.push(Or/_e),$n.push(Ar/b)}for(let Ar=1;Ar<=b;Ar++)for(let Or=1;Or<=_e;Or++){const Xr=(_e+1)*Ar+Or-1,ss=(_e+1)*(Ar-1)+Or-1,kr=(_e+1)*(Ar-1)+Or,us=(_e+1)*Ar+Or;an.push(Xr,ss,us),an.push(ss,kr,us)}this.setIndex(an),this.setAttribute("position",new Float32BufferAttribute(_n,3)),this.setAttribute("normal",new Float32BufferAttribute(On,3)),this.setAttribute("uv",new Float32BufferAttribute($n,2))}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}static fromJSON(s){return new TorusGeometry(s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc)}}class TorusKnotGeometry extends BufferGeometry{constructor(s=1,a=.4,b=64,_e=8,Kt=2,an=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:s,tube:a,tubularSegments:b,radialSegments:_e,p:Kt,q:an},b=Math.floor(b),_e=Math.floor(_e);const _n=[],On=[],$n=[],dr=[],fr=new Vector3,pr=new Vector3,Ar=new Vector3,Or=new Vector3,Xr=new Vector3,ss=new Vector3,kr=new Vector3;for(let hs=0;hs<=b;++hs){const ds=hs/b*Kt*Math.PI*2;us(ds,Kt,an,s,Ar),us(ds+.01,Kt,an,s,Or),ss.subVectors(Or,Ar),kr.addVectors(Or,Ar),Xr.crossVectors(ss,kr),kr.crossVectors(Xr,ss),Xr.normalize(),kr.normalize();for(let fs=0;fs<=_e;++fs){const Gs=fs/_e*Math.PI*2,ga=-a*Math.cos(Gs),So=a*Math.sin(Gs);fr.x=Ar.x+(ga*kr.x+So*Xr.x),fr.y=Ar.y+(ga*kr.y+So*Xr.y),fr.z=Ar.z+(ga*kr.z+So*Xr.z),On.push(fr.x,fr.y,fr.z),pr.subVectors(fr,Ar).normalize(),$n.push(pr.x,pr.y,pr.z),dr.push(hs/b),dr.push(fs/_e)}}for(let hs=1;hs<=b;hs++)for(let ds=1;ds<=_e;ds++){const fs=(_e+1)*(hs-1)+(ds-1),Gs=(_e+1)*hs+(ds-1),ga=(_e+1)*hs+ds,So=(_e+1)*(hs-1)+ds;_n.push(fs,Gs,So),_n.push(Gs,ga,So)}this.setIndex(_n),this.setAttribute("position",new Float32BufferAttribute(On,3)),this.setAttribute("normal",new Float32BufferAttribute($n,3)),this.setAttribute("uv",new Float32BufferAttribute(dr,2));function us(hs,ds,fs,Gs,ga){const So=Math.cos(hs),go=Math.sin(hs),xo=fs/ds*hs,Mo=Math.cos(xo);ga.x=Gs*(2+Mo)*.5*So,ga.y=Gs*(2+Mo)*go*.5,ga.z=Gs*Math.sin(xo)*.5}}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}static fromJSON(s){return new TorusKnotGeometry(s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q)}}class TubeGeometry extends BufferGeometry{constructor(s=new QuadraticBezierCurve3(new Vector3(-1,-1,0),new Vector3(-1,1,0),new Vector3(1,1,0)),a=64,b=1,_e=8,Kt=!1){super(),this.type="TubeGeometry",this.parameters={path:s,tubularSegments:a,radius:b,radialSegments:_e,closed:Kt};const an=s.computeFrenetFrames(a,Kt);this.tangents=an.tangents,this.normals=an.normals,this.binormals=an.binormals;const _n=new Vector3,On=new Vector3,$n=new Vector2;let dr=new Vector3;const fr=[],pr=[],Ar=[],Or=[];Xr(),this.setIndex(Or),this.setAttribute("position",new Float32BufferAttribute(fr,3)),this.setAttribute("normal",new Float32BufferAttribute(pr,3)),this.setAttribute("uv",new Float32BufferAttribute(Ar,2));function Xr(){for(let hs=0;hs<a;hs++)ss(hs);ss(Kt===!1?a:0),us(),kr()}function ss(hs){dr=s.getPointAt(hs/a,dr);const ds=an.normals[hs],fs=an.binormals[hs];for(let Gs=0;Gs<=_e;Gs++){const ga=Gs/_e*Math.PI*2,So=Math.sin(ga),go=-Math.cos(ga);On.x=go*ds.x+So*fs.x,On.y=go*ds.y+So*fs.y,On.z=go*ds.z+So*fs.z,On.normalize(),pr.push(On.x,On.y,On.z),_n.x=dr.x+b*On.x,_n.y=dr.y+b*On.y,_n.z=dr.z+b*On.z,fr.push(_n.x,_n.y,_n.z)}}function kr(){for(let hs=1;hs<=a;hs++)for(let ds=1;ds<=_e;ds++){const fs=(_e+1)*(hs-1)+(ds-1),Gs=(_e+1)*hs+(ds-1),ga=(_e+1)*hs+ds,So=(_e+1)*(hs-1)+ds;Or.push(fs,Gs,So),Or.push(Gs,ga,So)}}function us(){for(let hs=0;hs<=a;hs++)for(let ds=0;ds<=_e;ds++)$n.x=hs/a,$n.y=ds/_e,Ar.push($n.x,$n.y)}}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}toJSON(){const s=super.toJSON();return s.path=this.parameters.path.toJSON(),s}static fromJSON(s){return new TubeGeometry(new Curves[s.path.type]().fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed)}}class WireframeGeometry extends BufferGeometry{constructor(s=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:s},s!==null){const a=[],b=new Set,_e=new Vector3,Kt=new Vector3;if(s.index!==null){const an=s.attributes.position,_n=s.index;let On=s.groups;On.length===0&&(On=[{start:0,count:_n.count,materialIndex:0}]);for(let $n=0,dr=On.length;$n<dr;++$n){const fr=On[$n],pr=fr.start,Ar=fr.count;for(let Or=pr,Xr=pr+Ar;Or<Xr;Or+=3)for(let ss=0;ss<3;ss++){const kr=_n.getX(Or+ss),us=_n.getX(Or+(ss+1)%3);_e.fromBufferAttribute(an,kr),Kt.fromBufferAttribute(an,us),isUniqueEdge(_e,Kt,b)===!0&&(a.push(_e.x,_e.y,_e.z),a.push(Kt.x,Kt.y,Kt.z))}}}else{const an=s.attributes.position;for(let _n=0,On=an.count/3;_n<On;_n++)for(let $n=0;$n<3;$n++){const dr=3*_n+$n,fr=3*_n+($n+1)%3;_e.fromBufferAttribute(an,dr),Kt.fromBufferAttribute(an,fr),isUniqueEdge(_e,Kt,b)===!0&&(a.push(_e.x,_e.y,_e.z),a.push(Kt.x,Kt.y,Kt.z))}}this.setAttribute("position",new Float32BufferAttribute(a,3))}}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}}function isUniqueEdge(o,s,a){const b=`${o.x},${o.y},${o.z}-${s.x},${s.y},${s.z}`,_e=`${s.x},${s.y},${s.z}-${o.x},${o.y},${o.z}`;return a.has(b)===!0||a.has(_e)===!0?!1:(a.add(b),a.add(_e),!0)}var Geometries=Object.freeze({__proto__:null,BoxGeometry,CapsuleGeometry,CircleGeometry,ConeGeometry,CylinderGeometry,DodecahedronGeometry,EdgesGeometry,ExtrudeGeometry,IcosahedronGeometry,LatheGeometry,OctahedronGeometry,PlaneGeometry,PolyhedronGeometry,RingGeometry,ShapeGeometry,SphereGeometry,TetrahedronGeometry,TorusGeometry,TorusKnotGeometry,TubeGeometry,WireframeGeometry});class ShadowMaterial extends Material{constructor(s){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Color$1(0),this.transparent=!0,this.fog=!0,this.setValues(s)}copy(s){return super.copy(s),this.color.copy(s.color),this.fog=s.fog,this}}class RawShaderMaterial extends ShaderMaterial{constructor(s){super(s),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class MeshStandardMaterial extends Material{constructor(s){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Color$1(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color$1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Euler,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(s)}copy(s){return super.copy(s),this.defines={STANDARD:""},this.color.copy(s.color),this.roughness=s.roughness,this.metalness=s.metalness,this.map=s.map,this.lightMap=s.lightMap,this.lightMapIntensity=s.lightMapIntensity,this.aoMap=s.aoMap,this.aoMapIntensity=s.aoMapIntensity,this.emissive.copy(s.emissive),this.emissiveMap=s.emissiveMap,this.emissiveIntensity=s.emissiveIntensity,this.bumpMap=s.bumpMap,this.bumpScale=s.bumpScale,this.normalMap=s.normalMap,this.normalMapType=s.normalMapType,this.normalScale.copy(s.normalScale),this.displacementMap=s.displacementMap,this.displacementScale=s.displacementScale,this.displacementBias=s.displacementBias,this.roughnessMap=s.roughnessMap,this.metalnessMap=s.metalnessMap,this.alphaMap=s.alphaMap,this.envMap=s.envMap,this.envMapRotation.copy(s.envMapRotation),this.envMapIntensity=s.envMapIntensity,this.wireframe=s.wireframe,this.wireframeLinewidth=s.wireframeLinewidth,this.wireframeLinecap=s.wireframeLinecap,this.wireframeLinejoin=s.wireframeLinejoin,this.flatShading=s.flatShading,this.fog=s.fog,this}}class MeshPhysicalMaterial extends MeshStandardMaterial{constructor(s){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Vector2(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return clamp$2(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(a){this.ior=(1+.4*a)/(1-.4*a)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Color$1(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Color$1(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Color$1(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(s)}get anisotropy(){return this._anisotropy}set anisotropy(s){this._anisotropy>0!=s>0&&this.version++,this._anisotropy=s}get clearcoat(){return this._clearcoat}set clearcoat(s){this._clearcoat>0!=s>0&&this.version++,this._clearcoat=s}get iridescence(){return this._iridescence}set iridescence(s){this._iridescence>0!=s>0&&this.version++,this._iridescence=s}get sheen(){return this._sheen}set sheen(s){this._sheen>0!=s>0&&this.version++,this._sheen=s}get transmission(){return this._transmission}set transmission(s){this._transmission>0!=s>0&&this.version++,this._transmission=s}copy(s){return super.copy(s),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=s.anisotropy,this.anisotropyRotation=s.anisotropyRotation,this.anisotropyMap=s.anisotropyMap,this.clearcoat=s.clearcoat,this.clearcoatMap=s.clearcoatMap,this.clearcoatRoughness=s.clearcoatRoughness,this.clearcoatRoughnessMap=s.clearcoatRoughnessMap,this.clearcoatNormalMap=s.clearcoatNormalMap,this.clearcoatNormalScale.copy(s.clearcoatNormalScale),this.ior=s.ior,this.iridescence=s.iridescence,this.iridescenceMap=s.iridescenceMap,this.iridescenceIOR=s.iridescenceIOR,this.iridescenceThicknessRange=[...s.iridescenceThicknessRange],this.iridescenceThicknessMap=s.iridescenceThicknessMap,this.sheen=s.sheen,this.sheenColor.copy(s.sheenColor),this.sheenColorMap=s.sheenColorMap,this.sheenRoughness=s.sheenRoughness,this.sheenRoughnessMap=s.sheenRoughnessMap,this.transmission=s.transmission,this.transmissionMap=s.transmissionMap,this.thickness=s.thickness,this.thicknessMap=s.thicknessMap,this.attenuationDistance=s.attenuationDistance,this.attenuationColor.copy(s.attenuationColor),this.specularIntensity=s.specularIntensity,this.specularIntensityMap=s.specularIntensityMap,this.specularColor.copy(s.specularColor),this.specularColorMap=s.specularColorMap,this}}class MeshPhongMaterial extends Material{constructor(s){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Color$1(16777215),this.specular=new Color$1(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color$1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Euler,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(s)}copy(s){return super.copy(s),this.color.copy(s.color),this.specular.copy(s.specular),this.shininess=s.shininess,this.map=s.map,this.lightMap=s.lightMap,this.lightMapIntensity=s.lightMapIntensity,this.aoMap=s.aoMap,this.aoMapIntensity=s.aoMapIntensity,this.emissive.copy(s.emissive),this.emissiveMap=s.emissiveMap,this.emissiveIntensity=s.emissiveIntensity,this.bumpMap=s.bumpMap,this.bumpScale=s.bumpScale,this.normalMap=s.normalMap,this.normalMapType=s.normalMapType,this.normalScale.copy(s.normalScale),this.displacementMap=s.displacementMap,this.displacementScale=s.displacementScale,this.displacementBias=s.displacementBias,this.specularMap=s.specularMap,this.alphaMap=s.alphaMap,this.envMap=s.envMap,this.envMapRotation.copy(s.envMapRotation),this.combine=s.combine,this.reflectivity=s.reflectivity,this.refractionRatio=s.refractionRatio,this.wireframe=s.wireframe,this.wireframeLinewidth=s.wireframeLinewidth,this.wireframeLinecap=s.wireframeLinecap,this.wireframeLinejoin=s.wireframeLinejoin,this.flatShading=s.flatShading,this.fog=s.fog,this}}class MeshToonMaterial extends Material{constructor(s){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Color$1(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color$1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(s)}copy(s){return super.copy(s),this.color.copy(s.color),this.map=s.map,this.gradientMap=s.gradientMap,this.lightMap=s.lightMap,this.lightMapIntensity=s.lightMapIntensity,this.aoMap=s.aoMap,this.aoMapIntensity=s.aoMapIntensity,this.emissive.copy(s.emissive),this.emissiveMap=s.emissiveMap,this.emissiveIntensity=s.emissiveIntensity,this.bumpMap=s.bumpMap,this.bumpScale=s.bumpScale,this.normalMap=s.normalMap,this.normalMapType=s.normalMapType,this.normalScale.copy(s.normalScale),this.displacementMap=s.displacementMap,this.displacementScale=s.displacementScale,this.displacementBias=s.displacementBias,this.alphaMap=s.alphaMap,this.wireframe=s.wireframe,this.wireframeLinewidth=s.wireframeLinewidth,this.wireframeLinecap=s.wireframeLinecap,this.wireframeLinejoin=s.wireframeLinejoin,this.fog=s.fog,this}}class MeshNormalMaterial extends Material{constructor(s){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(s)}copy(s){return super.copy(s),this.bumpMap=s.bumpMap,this.bumpScale=s.bumpScale,this.normalMap=s.normalMap,this.normalMapType=s.normalMapType,this.normalScale.copy(s.normalScale),this.displacementMap=s.displacementMap,this.displacementScale=s.displacementScale,this.displacementBias=s.displacementBias,this.wireframe=s.wireframe,this.wireframeLinewidth=s.wireframeLinewidth,this.flatShading=s.flatShading,this}}class MeshLambertMaterial extends Material{constructor(s){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Color$1(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color$1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Euler,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(s)}copy(s){return super.copy(s),this.color.copy(s.color),this.map=s.map,this.lightMap=s.lightMap,this.lightMapIntensity=s.lightMapIntensity,this.aoMap=s.aoMap,this.aoMapIntensity=s.aoMapIntensity,this.emissive.copy(s.emissive),this.emissiveMap=s.emissiveMap,this.emissiveIntensity=s.emissiveIntensity,this.bumpMap=s.bumpMap,this.bumpScale=s.bumpScale,this.normalMap=s.normalMap,this.normalMapType=s.normalMapType,this.normalScale.copy(s.normalScale),this.displacementMap=s.displacementMap,this.displacementScale=s.displacementScale,this.displacementBias=s.displacementBias,this.specularMap=s.specularMap,this.alphaMap=s.alphaMap,this.envMap=s.envMap,this.envMapRotation.copy(s.envMapRotation),this.combine=s.combine,this.reflectivity=s.reflectivity,this.refractionRatio=s.refractionRatio,this.wireframe=s.wireframe,this.wireframeLinewidth=s.wireframeLinewidth,this.wireframeLinecap=s.wireframeLinecap,this.wireframeLinejoin=s.wireframeLinejoin,this.flatShading=s.flatShading,this.fog=s.fog,this}}class MeshMatcapMaterial extends Material{constructor(s){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Color$1(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(s)}copy(s){return super.copy(s),this.defines={MATCAP:""},this.color.copy(s.color),this.matcap=s.matcap,this.map=s.map,this.bumpMap=s.bumpMap,this.bumpScale=s.bumpScale,this.normalMap=s.normalMap,this.normalMapType=s.normalMapType,this.normalScale.copy(s.normalScale),this.displacementMap=s.displacementMap,this.displacementScale=s.displacementScale,this.displacementBias=s.displacementBias,this.alphaMap=s.alphaMap,this.flatShading=s.flatShading,this.fog=s.fog,this}}class LineDashedMaterial extends LineBasicMaterial{constructor(s){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(s)}copy(s){return super.copy(s),this.scale=s.scale,this.dashSize=s.dashSize,this.gapSize=s.gapSize,this}}function convertArray(o,s,a){return!o||!a&&o.constructor===s?o:typeof s.BYTES_PER_ELEMENT=="number"?new s(o):Array.prototype.slice.call(o)}function isTypedArray(o){return ArrayBuffer.isView(o)&&!(o instanceof DataView)}function getKeyframeOrder(o){function s(_e,Kt){return o[_e]-o[Kt]}const a=o.length,b=new Array(a);for(let _e=0;_e!==a;++_e)b[_e]=_e;return b.sort(s),b}function sortedArray(o,s,a){const b=o.length,_e=new o.constructor(b);for(let Kt=0,an=0;an!==b;++Kt){const _n=a[Kt]*s;for(let On=0;On!==s;++On)_e[an++]=o[_n+On]}return _e}function flattenJSON(o,s,a,b){let _e=1,Kt=o[0];for(;Kt!==void 0&&Kt[b]===void 0;)Kt=o[_e++];if(Kt===void 0)return;let an=Kt[b];if(an!==void 0)if(Array.isArray(an))do an=Kt[b],an!==void 0&&(s.push(Kt.time),a.push.apply(a,an)),Kt=o[_e++];while(Kt!==void 0);else if(an.toArray!==void 0)do an=Kt[b],an!==void 0&&(s.push(Kt.time),an.toArray(a,a.length)),Kt=o[_e++];while(Kt!==void 0);else do an=Kt[b],an!==void 0&&(s.push(Kt.time),a.push(an)),Kt=o[_e++];while(Kt!==void 0)}function subclip(o,s,a,b,_e=30){const Kt=o.clone();Kt.name=s;const an=[];for(let On=0;On<Kt.tracks.length;++On){const $n=Kt.tracks[On],dr=$n.getValueSize(),fr=[],pr=[];for(let Ar=0;Ar<$n.times.length;++Ar){const Or=$n.times[Ar]*_e;if(!(Or<a||Or>=b)){fr.push($n.times[Ar]);for(let Xr=0;Xr<dr;++Xr)pr.push($n.values[Ar*dr+Xr])}}fr.length!==0&&($n.times=convertArray(fr,$n.times.constructor),$n.values=convertArray(pr,$n.values.constructor),an.push($n))}Kt.tracks=an;let _n=1/0;for(let On=0;On<Kt.tracks.length;++On)_n>Kt.tracks[On].times[0]&&(_n=Kt.tracks[On].times[0]);for(let On=0;On<Kt.tracks.length;++On)Kt.tracks[On].shift(-1*_n);return Kt.resetDuration(),Kt}function makeClipAdditive(o,s=0,a=o,b=30){b<=0&&(b=30);const _e=a.tracks.length,Kt=s/b;for(let an=0;an<_e;++an){const _n=a.tracks[an],On=_n.ValueTypeName;if(On==="bool"||On==="string")continue;const $n=o.tracks.find(function(kr){return kr.name===_n.name&&kr.ValueTypeName===On});if($n===void 0)continue;let dr=0;const fr=_n.getValueSize();_n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(dr=fr/3);let pr=0;const Ar=$n.getValueSize();$n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(pr=Ar/3);const Or=_n.times.length-1;let Xr;if(Kt<=_n.times[0]){const kr=dr,us=fr-dr;Xr=_n.values.slice(kr,us)}else if(Kt>=_n.times[Or]){const kr=Or*fr+dr,us=kr+fr-dr;Xr=_n.values.slice(kr,us)}else{const kr=_n.createInterpolant(),us=dr,hs=fr-dr;kr.evaluate(Kt),Xr=kr.resultBuffer.slice(us,hs)}On==="quaternion"&&new Quaternion().fromArray(Xr).normalize().conjugate().toArray(Xr);const ss=$n.times.length;for(let kr=0;kr<ss;++kr){const us=kr*Ar+pr;if(On==="quaternion")Quaternion.multiplyQuaternionsFlat($n.values,us,Xr,0,$n.values,us);else{const hs=Ar-pr*2;for(let ds=0;ds<hs;++ds)$n.values[us+ds]-=Xr[ds]}}}return o.blendMode=AdditiveAnimationBlendMode,o}const AnimationUtils={convertArray,isTypedArray,getKeyframeOrder,sortedArray,flattenJSON,subclip,makeClipAdditive};class Interpolant{constructor(s,a,b,_e){this.parameterPositions=s,this._cachedIndex=0,this.resultBuffer=_e!==void 0?_e:new a.constructor(b),this.sampleValues=a,this.valueSize=b,this.settings=null,this.DefaultSettings_={}}evaluate(s){const a=this.parameterPositions;let b=this._cachedIndex,_e=a[b],Kt=a[b-1];e:{t:{let an;n:{r:if(!(s<_e)){for(let _n=b+2;;){if(_e===void 0){if(s<Kt)break r;return b=a.length,this._cachedIndex=b,this.copySampleValue_(b-1)}if(b===_n)break;if(Kt=_e,_e=a[++b],s<_e)break t}an=a.length;break n}if(!(s>=Kt)){const _n=a[1];s<_n&&(b=2,Kt=_n);for(let On=b-2;;){if(Kt===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(b===On)break;if(_e=Kt,Kt=a[--b-1],s>=Kt)break t}an=b,b=0;break n}break e}for(;b<an;){const _n=b+an>>>1;s<a[_n]?an=_n:b=_n+1}if(_e=a[b],Kt=a[b-1],Kt===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(_e===void 0)return b=a.length,this._cachedIndex=b,this.copySampleValue_(b-1)}this._cachedIndex=b,this.intervalChanged_(b,Kt,_e)}return this.interpolate_(b,Kt,s,_e)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(s){const a=this.resultBuffer,b=this.sampleValues,_e=this.valueSize,Kt=s*_e;for(let an=0;an!==_e;++an)a[an]=b[Kt+an];return a}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class CubicInterpolant extends Interpolant{constructor(s,a,b,_e){super(s,a,b,_e),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:ZeroCurvatureEnding,endingEnd:ZeroCurvatureEnding}}intervalChanged_(s,a,b){const _e=this.parameterPositions;let Kt=s-2,an=s+1,_n=_e[Kt],On=_e[an];if(_n===void 0)switch(this.getSettings_().endingStart){case ZeroSlopeEnding:Kt=s,_n=2*a-b;break;case WrapAroundEnding:Kt=_e.length-2,_n=a+_e[Kt]-_e[Kt+1];break;default:Kt=s,_n=b}if(On===void 0)switch(this.getSettings_().endingEnd){case ZeroSlopeEnding:an=s,On=2*b-a;break;case WrapAroundEnding:an=1,On=b+_e[1]-_e[0];break;default:an=s-1,On=a}const $n=(b-a)*.5,dr=this.valueSize;this._weightPrev=$n/(a-_n),this._weightNext=$n/(On-b),this._offsetPrev=Kt*dr,this._offsetNext=an*dr}interpolate_(s,a,b,_e){const Kt=this.resultBuffer,an=this.sampleValues,_n=this.valueSize,On=s*_n,$n=On-_n,dr=this._offsetPrev,fr=this._offsetNext,pr=this._weightPrev,Ar=this._weightNext,Or=(b-a)/(_e-a),Xr=Or*Or,ss=Xr*Or,kr=-pr*ss+2*pr*Xr-pr*Or,us=(1+pr)*ss+(-1.5-2*pr)*Xr+(-.5+pr)*Or+1,hs=(-1-Ar)*ss+(1.5+Ar)*Xr+.5*Or,ds=Ar*ss-Ar*Xr;for(let fs=0;fs!==_n;++fs)Kt[fs]=kr*an[dr+fs]+us*an[$n+fs]+hs*an[On+fs]+ds*an[fr+fs];return Kt}}class LinearInterpolant extends Interpolant{constructor(s,a,b,_e){super(s,a,b,_e)}interpolate_(s,a,b,_e){const Kt=this.resultBuffer,an=this.sampleValues,_n=this.valueSize,On=s*_n,$n=On-_n,dr=(b-a)/(_e-a),fr=1-dr;for(let pr=0;pr!==_n;++pr)Kt[pr]=an[$n+pr]*fr+an[On+pr]*dr;return Kt}}class DiscreteInterpolant extends Interpolant{constructor(s,a,b,_e){super(s,a,b,_e)}interpolate_(s){return this.copySampleValue_(s-1)}}class KeyframeTrack{constructor(s,a,b,_e){if(s===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(a===void 0||a.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+s);this.name=s,this.times=convertArray(a,this.TimeBufferType),this.values=convertArray(b,this.ValueBufferType),this.setInterpolation(_e||this.DefaultInterpolation)}static toJSON(s){const a=s.constructor;let b;if(a.toJSON!==this.toJSON)b=a.toJSON(s);else{b={name:s.name,times:convertArray(s.times,Array),values:convertArray(s.values,Array)};const _e=s.getInterpolation();_e!==s.DefaultInterpolation&&(b.interpolation=_e)}return b.type=s.ValueTypeName,b}InterpolantFactoryMethodDiscrete(s){return new DiscreteInterpolant(this.times,this.values,this.getValueSize(),s)}InterpolantFactoryMethodLinear(s){return new LinearInterpolant(this.times,this.values,this.getValueSize(),s)}InterpolantFactoryMethodSmooth(s){return new CubicInterpolant(this.times,this.values,this.getValueSize(),s)}setInterpolation(s){let a;switch(s){case InterpolateDiscrete:a=this.InterpolantFactoryMethodDiscrete;break;case InterpolateLinear:a=this.InterpolantFactoryMethodLinear;break;case InterpolateSmooth:a=this.InterpolantFactoryMethodSmooth;break}if(a===void 0){const b="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(s!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(b);return console.warn("THREE.KeyframeTrack:",b),this}return this.createInterpolant=a,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return InterpolateDiscrete;case this.InterpolantFactoryMethodLinear:return InterpolateLinear;case this.InterpolantFactoryMethodSmooth:return InterpolateSmooth}}getValueSize(){return this.values.length/this.times.length}shift(s){if(s!==0){const a=this.times;for(let b=0,_e=a.length;b!==_e;++b)a[b]+=s}return this}scale(s){if(s!==1){const a=this.times;for(let b=0,_e=a.length;b!==_e;++b)a[b]*=s}return this}trim(s,a){const b=this.times,_e=b.length;let Kt=0,an=_e-1;for(;Kt!==_e&&b[Kt]<s;)++Kt;for(;an!==-1&&b[an]>a;)--an;if(++an,Kt!==0||an!==_e){Kt>=an&&(an=Math.max(an,1),Kt=an-1);const _n=this.getValueSize();this.times=b.slice(Kt,an),this.values=this.values.slice(Kt*_n,an*_n)}return this}validate(){let s=!0;const a=this.getValueSize();a-Math.floor(a)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),s=!1);const b=this.times,_e=this.values,Kt=b.length;Kt===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),s=!1);let an=null;for(let _n=0;_n!==Kt;_n++){const On=b[_n];if(typeof On=="number"&&isNaN(On)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,_n,On),s=!1;break}if(an!==null&&an>On){console.error("THREE.KeyframeTrack: Out of order keys.",this,_n,On,an),s=!1;break}an=On}if(_e!==void 0&&isTypedArray(_e))for(let _n=0,On=_e.length;_n!==On;++_n){const $n=_e[_n];if(isNaN($n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,_n,$n),s=!1;break}}return s}optimize(){const s=this.times.slice(),a=this.values.slice(),b=this.getValueSize(),_e=this.getInterpolation()===InterpolateSmooth,Kt=s.length-1;let an=1;for(let _n=1;_n<Kt;++_n){let On=!1;const $n=s[_n],dr=s[_n+1];if($n!==dr&&(_n!==1||$n!==s[0]))if(_e)On=!0;else{const fr=_n*b,pr=fr-b,Ar=fr+b;for(let Or=0;Or!==b;++Or){const Xr=a[fr+Or];if(Xr!==a[pr+Or]||Xr!==a[Ar+Or]){On=!0;break}}}if(On){if(_n!==an){s[an]=s[_n];const fr=_n*b,pr=an*b;for(let Ar=0;Ar!==b;++Ar)a[pr+Ar]=a[fr+Ar]}++an}}if(Kt>0){s[an]=s[Kt];for(let _n=Kt*b,On=an*b,$n=0;$n!==b;++$n)a[On+$n]=a[_n+$n];++an}return an!==s.length?(this.times=s.slice(0,an),this.values=a.slice(0,an*b)):(this.times=s,this.values=a),this}clone(){const s=this.times.slice(),a=this.values.slice(),b=this.constructor,_e=new b(this.name,s,a);return _e.createInterpolant=this.createInterpolant,_e}}KeyframeTrack.prototype.TimeBufferType=Float32Array;KeyframeTrack.prototype.ValueBufferType=Float32Array;KeyframeTrack.prototype.DefaultInterpolation=InterpolateLinear;class BooleanKeyframeTrack extends KeyframeTrack{}BooleanKeyframeTrack.prototype.ValueTypeName="bool";BooleanKeyframeTrack.prototype.ValueBufferType=Array;BooleanKeyframeTrack.prototype.DefaultInterpolation=InterpolateDiscrete;BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0;BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class ColorKeyframeTrack extends KeyframeTrack{}ColorKeyframeTrack.prototype.ValueTypeName="color";class NumberKeyframeTrack extends KeyframeTrack{}NumberKeyframeTrack.prototype.ValueTypeName="number";class QuaternionLinearInterpolant extends Interpolant{constructor(s,a,b,_e){super(s,a,b,_e)}interpolate_(s,a,b,_e){const Kt=this.resultBuffer,an=this.sampleValues,_n=this.valueSize,On=(b-a)/(_e-a);let $n=s*_n;for(let dr=$n+_n;$n!==dr;$n+=4)Quaternion.slerpFlat(Kt,0,an,$n-_n,an,$n,On);return Kt}}class QuaternionKeyframeTrack extends KeyframeTrack{InterpolantFactoryMethodLinear(s){return new QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),s)}}QuaternionKeyframeTrack.prototype.ValueTypeName="quaternion";QuaternionKeyframeTrack.prototype.DefaultInterpolation=InterpolateLinear;QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class StringKeyframeTrack extends KeyframeTrack{}StringKeyframeTrack.prototype.ValueTypeName="string";StringKeyframeTrack.prototype.ValueBufferType=Array;StringKeyframeTrack.prototype.DefaultInterpolation=InterpolateDiscrete;StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0;StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class VectorKeyframeTrack extends KeyframeTrack{}VectorKeyframeTrack.prototype.ValueTypeName="vector";class AnimationClip{constructor(s="",a=-1,b=[],_e=NormalAnimationBlendMode){this.name=s,this.tracks=b,this.duration=a,this.blendMode=_e,this.uuid=generateUUID(),this.duration<0&&this.resetDuration()}static parse(s){const a=[],b=s.tracks,_e=1/(s.fps||1);for(let an=0,_n=b.length;an!==_n;++an)a.push(parseKeyframeTrack(b[an]).scale(_e));const Kt=new this(s.name,s.duration,a,s.blendMode);return Kt.uuid=s.uuid,Kt}static toJSON(s){const a=[],b=s.tracks,_e={name:s.name,duration:s.duration,tracks:a,uuid:s.uuid,blendMode:s.blendMode};for(let Kt=0,an=b.length;Kt!==an;++Kt)a.push(KeyframeTrack.toJSON(b[Kt]));return _e}static CreateFromMorphTargetSequence(s,a,b,_e){const Kt=a.length,an=[];for(let _n=0;_n<Kt;_n++){let On=[],$n=[];On.push((_n+Kt-1)%Kt,_n,(_n+1)%Kt),$n.push(0,1,0);const dr=getKeyframeOrder(On);On=sortedArray(On,1,dr),$n=sortedArray($n,1,dr),!_e&&On[0]===0&&(On.push(Kt),$n.push($n[0])),an.push(new NumberKeyframeTrack(".morphTargetInfluences["+a[_n].name+"]",On,$n).scale(1/b))}return new this(s,-1,an)}static findByName(s,a){let b=s;if(!Array.isArray(s)){const _e=s;b=_e.geometry&&_e.geometry.animations||_e.animations}for(let _e=0;_e<b.length;_e++)if(b[_e].name===a)return b[_e];return null}static CreateClipsFromMorphTargetSequences(s,a,b){const _e={},Kt=/^([\w-]*?)([\d]+)$/;for(let _n=0,On=s.length;_n<On;_n++){const $n=s[_n],dr=$n.name.match(Kt);if(dr&&dr.length>1){const fr=dr[1];let pr=_e[fr];pr||(_e[fr]=pr=[]),pr.push($n)}}const an=[];for(const _n in _e)an.push(this.CreateFromMorphTargetSequence(_n,_e[_n],a,b));return an}static parseAnimation(s,a){if(!s)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const b=function(fr,pr,Ar,Or,Xr){if(Ar.length!==0){const ss=[],kr=[];flattenJSON(Ar,ss,kr,Or),ss.length!==0&&Xr.push(new fr(pr,ss,kr))}},_e=[],Kt=s.name||"default",an=s.fps||30,_n=s.blendMode;let On=s.length||-1;const $n=s.hierarchy||[];for(let fr=0;fr<$n.length;fr++){const pr=$n[fr].keys;if(!(!pr||pr.length===0))if(pr[0].morphTargets){const Ar={};let Or;for(Or=0;Or<pr.length;Or++)if(pr[Or].morphTargets)for(let Xr=0;Xr<pr[Or].morphTargets.length;Xr++)Ar[pr[Or].morphTargets[Xr]]=-1;for(const Xr in Ar){const ss=[],kr=[];for(let us=0;us!==pr[Or].morphTargets.length;++us){const hs=pr[Or];ss.push(hs.time),kr.push(hs.morphTarget===Xr?1:0)}_e.push(new NumberKeyframeTrack(".morphTargetInfluence["+Xr+"]",ss,kr))}On=Ar.length*an}else{const Ar=".bones["+a[fr].name+"]";b(VectorKeyframeTrack,Ar+".position",pr,"pos",_e),b(QuaternionKeyframeTrack,Ar+".quaternion",pr,"rot",_e),b(VectorKeyframeTrack,Ar+".scale",pr,"scl",_e)}}return _e.length===0?null:new this(Kt,On,_e,_n)}resetDuration(){const s=this.tracks;let a=0;for(let b=0,_e=s.length;b!==_e;++b){const Kt=this.tracks[b];a=Math.max(a,Kt.times[Kt.times.length-1])}return this.duration=a,this}trim(){for(let s=0;s<this.tracks.length;s++)this.tracks[s].trim(0,this.duration);return this}validate(){let s=!0;for(let a=0;a<this.tracks.length;a++)s=s&&this.tracks[a].validate();return s}optimize(){for(let s=0;s<this.tracks.length;s++)this.tracks[s].optimize();return this}clone(){const s=[];for(let a=0;a<this.tracks.length;a++)s.push(this.tracks[a].clone());return new this.constructor(this.name,this.duration,s,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function getTrackTypeForValueTypeName(o){switch(o.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return NumberKeyframeTrack;case"vector":case"vector2":case"vector3":case"vector4":return VectorKeyframeTrack;case"color":return ColorKeyframeTrack;case"quaternion":return QuaternionKeyframeTrack;case"bool":case"boolean":return BooleanKeyframeTrack;case"string":return StringKeyframeTrack}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+o)}function parseKeyframeTrack(o){if(o.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const s=getTrackTypeForValueTypeName(o.type);if(o.times===void 0){const a=[],b=[];flattenJSON(o.keys,a,b,"value"),o.times=a,o.values=b}return s.parse!==void 0?s.parse(o):new s(o.name,o.times,o.values,o.interpolation)}const Cache={enabled:!1,files:{},add:function(o,s){this.enabled!==!1&&(this.files[o]=s)},get:function(o){if(this.enabled!==!1)return this.files[o]},remove:function(o){delete this.files[o]},clear:function(){this.files={}}};class LoadingManager{constructor(s,a,b){const _e=this;let Kt=!1,an=0,_n=0,On;const $n=[];this.onStart=void 0,this.onLoad=s,this.onProgress=a,this.onError=b,this.itemStart=function(dr){_n++,Kt===!1&&_e.onStart!==void 0&&_e.onStart(dr,an,_n),Kt=!0},this.itemEnd=function(dr){an++,_e.onProgress!==void 0&&_e.onProgress(dr,an,_n),an===_n&&(Kt=!1,_e.onLoad!==void 0&&_e.onLoad())},this.itemError=function(dr){_e.onError!==void 0&&_e.onError(dr)},this.resolveURL=function(dr){return On?On(dr):dr},this.setURLModifier=function(dr){return On=dr,this},this.addHandler=function(dr,fr){return $n.push(dr,fr),this},this.removeHandler=function(dr){const fr=$n.indexOf(dr);return fr!==-1&&$n.splice(fr,2),this},this.getHandler=function(dr){for(let fr=0,pr=$n.length;fr<pr;fr+=2){const Ar=$n[fr],Or=$n[fr+1];if(Ar.global&&(Ar.lastIndex=0),Ar.test(dr))return Or}return null}}}const DefaultLoadingManager=new LoadingManager;class Loader{constructor(s){this.manager=s!==void 0?s:DefaultLoadingManager,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(s,a){const b=this;return new Promise(function(_e,Kt){b.load(s,_e,a,Kt)})}parse(){}setCrossOrigin(s){return this.crossOrigin=s,this}setWithCredentials(s){return this.withCredentials=s,this}setPath(s){return this.path=s,this}setResourcePath(s){return this.resourcePath=s,this}setRequestHeader(s){return this.requestHeader=s,this}}Loader.DEFAULT_MATERIAL_NAME="__DEFAULT";const loading={};class HttpError extends Error{constructor(s,a){super(s),this.response=a}}class FileLoader extends Loader{constructor(s){super(s)}load(s,a,b,_e){s===void 0&&(s=""),this.path!==void 0&&(s=this.path+s),s=this.manager.resolveURL(s);const Kt=Cache.get(s);if(Kt!==void 0)return this.manager.itemStart(s),setTimeout(()=>{a&&a(Kt),this.manager.itemEnd(s)},0),Kt;if(loading[s]!==void 0){loading[s].push({onLoad:a,onProgress:b,onError:_e});return}loading[s]=[],loading[s].push({onLoad:a,onProgress:b,onError:_e});const an=new Request(s,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),_n=this.mimeType,On=this.responseType;fetch(an).then($n=>{if($n.status===200||$n.status===0){if($n.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||$n.body===void 0||$n.body.getReader===void 0)return $n;const dr=loading[s],fr=$n.body.getReader(),pr=$n.headers.get("Content-Length")||$n.headers.get("X-File-Size"),Ar=pr?parseInt(pr):0,Or=Ar!==0;let Xr=0;const ss=new ReadableStream({start(kr){us();function us(){fr.read().then(({done:hs,value:ds})=>{if(hs)kr.close();else{Xr+=ds.byteLength;const fs=new ProgressEvent("progress",{lengthComputable:Or,loaded:Xr,total:Ar});for(let Gs=0,ga=dr.length;Gs<ga;Gs++){const So=dr[Gs];So.onProgress&&So.onProgress(fs)}kr.enqueue(ds),us()}})}}});return new Response(ss)}else throw new HttpError(`fetch for "${$n.url}" responded with ${$n.status}: ${$n.statusText}`,$n)}).then($n=>{switch(On){case"arraybuffer":return $n.arrayBuffer();case"blob":return $n.blob();case"document":return $n.text().then(dr=>new DOMParser().parseFromString(dr,_n));case"json":return $n.json();default:if(_n===void 0)return $n.text();{const fr=/charset="?([^;"\s]*)"?/i.exec(_n),pr=fr&&fr[1]?fr[1].toLowerCase():void 0,Ar=new TextDecoder(pr);return $n.arrayBuffer().then(Or=>Ar.decode(Or))}}}).then($n=>{Cache.add(s,$n);const dr=loading[s];delete loading[s];for(let fr=0,pr=dr.length;fr<pr;fr++){const Ar=dr[fr];Ar.onLoad&&Ar.onLoad($n)}}).catch($n=>{const dr=loading[s];if(dr===void 0)throw this.manager.itemError(s),$n;delete loading[s];for(let fr=0,pr=dr.length;fr<pr;fr++){const Ar=dr[fr];Ar.onError&&Ar.onError($n)}this.manager.itemError(s)}).finally(()=>{this.manager.itemEnd(s)}),this.manager.itemStart(s)}setResponseType(s){return this.responseType=s,this}setMimeType(s){return this.mimeType=s,this}}class AnimationLoader extends Loader{constructor(s){super(s)}load(s,a,b,_e){const Kt=this,an=new FileLoader(this.manager);an.setPath(this.path),an.setRequestHeader(this.requestHeader),an.setWithCredentials(this.withCredentials),an.load(s,function(_n){try{a(Kt.parse(JSON.parse(_n)))}catch(On){_e?_e(On):console.error(On),Kt.manager.itemError(s)}},b,_e)}parse(s){const a=[];for(let b=0;b<s.length;b++){const _e=AnimationClip.parse(s[b]);a.push(_e)}return a}}class CompressedTextureLoader extends Loader{constructor(s){super(s)}load(s,a,b,_e){const Kt=this,an=[],_n=new CompressedTexture,On=new FileLoader(this.manager);On.setPath(this.path),On.setResponseType("arraybuffer"),On.setRequestHeader(this.requestHeader),On.setWithCredentials(Kt.withCredentials);let $n=0;function dr(fr){On.load(s[fr],function(pr){const Ar=Kt.parse(pr,!0);an[fr]={width:Ar.width,height:Ar.height,format:Ar.format,mipmaps:Ar.mipmaps},$n+=1,$n===6&&(Ar.mipmapCount===1&&(_n.minFilter=LinearFilter),_n.image=an,_n.format=Ar.format,_n.needsUpdate=!0,a&&a(_n))},b,_e)}if(Array.isArray(s))for(let fr=0,pr=s.length;fr<pr;++fr)dr(fr);else On.load(s,function(fr){const pr=Kt.parse(fr,!0);if(pr.isCubemap){const Ar=pr.mipmaps.length/pr.mipmapCount;for(let Or=0;Or<Ar;Or++){an[Or]={mipmaps:[]};for(let Xr=0;Xr<pr.mipmapCount;Xr++)an[Or].mipmaps.push(pr.mipmaps[Or*pr.mipmapCount+Xr]),an[Or].format=pr.format,an[Or].width=pr.width,an[Or].height=pr.height}_n.image=an}else _n.image.width=pr.width,_n.image.height=pr.height,_n.mipmaps=pr.mipmaps;pr.mipmapCount===1&&(_n.minFilter=LinearFilter),_n.format=pr.format,_n.needsUpdate=!0,a&&a(_n)},b,_e);return _n}}class ImageLoader extends Loader{constructor(s){super(s)}load(s,a,b,_e){this.path!==void 0&&(s=this.path+s),s=this.manager.resolveURL(s);const Kt=this,an=Cache.get(s);if(an!==void 0)return Kt.manager.itemStart(s),setTimeout(function(){a&&a(an),Kt.manager.itemEnd(s)},0),an;const _n=createElementNS("img");function On(){dr(),Cache.add(s,this),a&&a(this),Kt.manager.itemEnd(s)}function $n(fr){dr(),_e&&_e(fr),Kt.manager.itemError(s),Kt.manager.itemEnd(s)}function dr(){_n.removeEventListener("load",On,!1),_n.removeEventListener("error",$n,!1)}return _n.addEventListener("load",On,!1),_n.addEventListener("error",$n,!1),s.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(_n.crossOrigin=this.crossOrigin),Kt.manager.itemStart(s),_n.src=s,_n}}class CubeTextureLoader extends Loader{constructor(s){super(s)}load(s,a,b,_e){const Kt=new CubeTexture;Kt.colorSpace=SRGBColorSpace$1;const an=new ImageLoader(this.manager);an.setCrossOrigin(this.crossOrigin),an.setPath(this.path);let _n=0;function On($n){an.load(s[$n],function(dr){Kt.images[$n]=dr,_n++,_n===6&&(Kt.needsUpdate=!0,a&&a(Kt))},void 0,_e)}for(let $n=0;$n<s.length;++$n)On($n);return Kt}}class DataTextureLoader extends Loader{constructor(s){super(s)}load(s,a,b,_e){const Kt=this,an=new DataTexture,_n=new FileLoader(this.manager);return _n.setResponseType("arraybuffer"),_n.setRequestHeader(this.requestHeader),_n.setPath(this.path),_n.setWithCredentials(Kt.withCredentials),_n.load(s,function(On){let $n;try{$n=Kt.parse(On)}catch(dr){if(_e!==void 0)_e(dr);else{console.error(dr);return}}$n.image!==void 0?an.image=$n.image:$n.data!==void 0&&(an.image.width=$n.width,an.image.height=$n.height,an.image.data=$n.data),an.wrapS=$n.wrapS!==void 0?$n.wrapS:ClampToEdgeWrapping,an.wrapT=$n.wrapT!==void 0?$n.wrapT:ClampToEdgeWrapping,an.magFilter=$n.magFilter!==void 0?$n.magFilter:LinearFilter,an.minFilter=$n.minFilter!==void 0?$n.minFilter:LinearFilter,an.anisotropy=$n.anisotropy!==void 0?$n.anisotropy:1,$n.colorSpace!==void 0&&(an.colorSpace=$n.colorSpace),$n.flipY!==void 0&&(an.flipY=$n.flipY),$n.format!==void 0&&(an.format=$n.format),$n.type!==void 0&&(an.type=$n.type),$n.mipmaps!==void 0&&(an.mipmaps=$n.mipmaps,an.minFilter=LinearMipmapLinearFilter),$n.mipmapCount===1&&(an.minFilter=LinearFilter),$n.generateMipmaps!==void 0&&(an.generateMipmaps=$n.generateMipmaps),an.needsUpdate=!0,a&&a(an,$n)},b,_e),an}}class TextureLoader extends Loader{constructor(s){super(s)}load(s,a,b,_e){const Kt=new Texture,an=new ImageLoader(this.manager);return an.setCrossOrigin(this.crossOrigin),an.setPath(this.path),an.load(s,function(_n){Kt.image=_n,Kt.needsUpdate=!0,a!==void 0&&a(Kt)},b,_e),Kt}}class Light extends Object3D{constructor(s,a=1){super(),this.isLight=!0,this.type="Light",this.color=new Color$1(s),this.intensity=a}dispose(){}copy(s,a){return super.copy(s,a),this.color.copy(s.color),this.intensity=s.intensity,this}toJSON(s){const a=super.toJSON(s);return a.object.color=this.color.getHex(),a.object.intensity=this.intensity,this.groundColor!==void 0&&(a.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(a.object.distance=this.distance),this.angle!==void 0&&(a.object.angle=this.angle),this.decay!==void 0&&(a.object.decay=this.decay),this.penumbra!==void 0&&(a.object.penumbra=this.penumbra),this.shadow!==void 0&&(a.object.shadow=this.shadow.toJSON()),a}}class HemisphereLight extends Light{constructor(s,a,b){super(s,b),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Object3D.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Color$1(a)}copy(s,a){return super.copy(s,a),this.groundColor.copy(s.groundColor),this}}const _projScreenMatrix$1=new Matrix4,_lightPositionWorld$1=new Vector3,_lookTarget$1=new Vector3;class LightShadow{constructor(s){this.camera=s,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Vector2(512,512),this.map=null,this.mapPass=null,this.matrix=new Matrix4,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Frustum,this._frameExtents=new Vector2(1,1),this._viewportCount=1,this._viewports=[new Vector4(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(s){const a=this.camera,b=this.matrix;_lightPositionWorld$1.setFromMatrixPosition(s.matrixWorld),a.position.copy(_lightPositionWorld$1),_lookTarget$1.setFromMatrixPosition(s.target.matrixWorld),a.lookAt(_lookTarget$1),a.updateMatrixWorld(),_projScreenMatrix$1.multiplyMatrices(a.projectionMatrix,a.matrixWorldInverse),this._frustum.setFromProjectionMatrix(_projScreenMatrix$1),b.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),b.multiply(_projScreenMatrix$1)}getViewport(s){return this._viewports[s]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(s){return this.camera=s.camera.clone(),this.bias=s.bias,this.radius=s.radius,this.mapSize.copy(s.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const s={};return this.bias!==0&&(s.bias=this.bias),this.normalBias!==0&&(s.normalBias=this.normalBias),this.radius!==1&&(s.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(s.mapSize=this.mapSize.toArray()),s.camera=this.camera.toJSON(!1).object,delete s.camera.matrix,s}}class SpotLightShadow extends LightShadow{constructor(){super(new PerspectiveCamera(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(s){const a=this.camera,b=RAD2DEG*2*s.angle*this.focus,_e=this.mapSize.width/this.mapSize.height,Kt=s.distance||a.far;(b!==a.fov||_e!==a.aspect||Kt!==a.far)&&(a.fov=b,a.aspect=_e,a.far=Kt,a.updateProjectionMatrix()),super.updateMatrices(s)}copy(s){return super.copy(s),this.focus=s.focus,this}}class SpotLight extends Light{constructor(s,a,b=0,_e=Math.PI/3,Kt=0,an=2){super(s,a),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Object3D.DEFAULT_UP),this.updateMatrix(),this.target=new Object3D,this.distance=b,this.angle=_e,this.penumbra=Kt,this.decay=an,this.map=null,this.shadow=new SpotLightShadow}get power(){return this.intensity*Math.PI}set power(s){this.intensity=s/Math.PI}dispose(){this.shadow.dispose()}copy(s,a){return super.copy(s,a),this.distance=s.distance,this.angle=s.angle,this.penumbra=s.penumbra,this.decay=s.decay,this.target=s.target.clone(),this.shadow=s.shadow.clone(),this}}const _projScreenMatrix=new Matrix4,_lightPositionWorld=new Vector3,_lookTarget=new Vector3;class PointLightShadow extends LightShadow{constructor(){super(new PerspectiveCamera(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Vector2(4,2),this._viewportCount=6,this._viewports=[new Vector4(2,1,1,1),new Vector4(0,1,1,1),new Vector4(3,1,1,1),new Vector4(1,1,1,1),new Vector4(3,0,1,1),new Vector4(1,0,1,1)],this._cubeDirections=[new Vector3(1,0,0),new Vector3(-1,0,0),new Vector3(0,0,1),new Vector3(0,0,-1),new Vector3(0,1,0),new Vector3(0,-1,0)],this._cubeUps=[new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,0,1),new Vector3(0,0,-1)]}updateMatrices(s,a=0){const b=this.camera,_e=this.matrix,Kt=s.distance||b.far;Kt!==b.far&&(b.far=Kt,b.updateProjectionMatrix()),_lightPositionWorld.setFromMatrixPosition(s.matrixWorld),b.position.copy(_lightPositionWorld),_lookTarget.copy(b.position),_lookTarget.add(this._cubeDirections[a]),b.up.copy(this._cubeUps[a]),b.lookAt(_lookTarget),b.updateMatrixWorld(),_e.makeTranslation(-_lightPositionWorld.x,-_lightPositionWorld.y,-_lightPositionWorld.z),_projScreenMatrix.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse),this._frustum.setFromProjectionMatrix(_projScreenMatrix)}}class PointLight extends Light{constructor(s,a,b=0,_e=2){super(s,a),this.isPointLight=!0,this.type="PointLight",this.distance=b,this.decay=_e,this.shadow=new PointLightShadow}get power(){return this.intensity*4*Math.PI}set power(s){this.intensity=s/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(s,a){return super.copy(s,a),this.distance=s.distance,this.decay=s.decay,this.shadow=s.shadow.clone(),this}}class DirectionalLightShadow extends LightShadow{constructor(){super(new OrthographicCamera(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class DirectionalLight extends Light{constructor(s,a){super(s,a),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Object3D.DEFAULT_UP),this.updateMatrix(),this.target=new Object3D,this.shadow=new DirectionalLightShadow}dispose(){this.shadow.dispose()}copy(s){return super.copy(s),this.target=s.target.clone(),this.shadow=s.shadow.clone(),this}}class AmbientLight extends Light{constructor(s,a){super(s,a),this.isAmbientLight=!0,this.type="AmbientLight"}}class RectAreaLight extends Light{constructor(s,a,b=10,_e=10){super(s,a),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=b,this.height=_e}get power(){return this.intensity*this.width*this.height*Math.PI}set power(s){this.intensity=s/(this.width*this.height*Math.PI)}copy(s){return super.copy(s),this.width=s.width,this.height=s.height,this}toJSON(s){const a=super.toJSON(s);return a.object.width=this.width,a.object.height=this.height,a}}class SphericalHarmonics3{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let s=0;s<9;s++)this.coefficients.push(new Vector3)}set(s){for(let a=0;a<9;a++)this.coefficients[a].copy(s[a]);return this}zero(){for(let s=0;s<9;s++)this.coefficients[s].set(0,0,0);return this}getAt(s,a){const b=s.x,_e=s.y,Kt=s.z,an=this.coefficients;return a.copy(an[0]).multiplyScalar(.282095),a.addScaledVector(an[1],.488603*_e),a.addScaledVector(an[2],.488603*Kt),a.addScaledVector(an[3],.488603*b),a.addScaledVector(an[4],1.092548*(b*_e)),a.addScaledVector(an[5],1.092548*(_e*Kt)),a.addScaledVector(an[6],.315392*(3*Kt*Kt-1)),a.addScaledVector(an[7],1.092548*(b*Kt)),a.addScaledVector(an[8],.546274*(b*b-_e*_e)),a}getIrradianceAt(s,a){const b=s.x,_e=s.y,Kt=s.z,an=this.coefficients;return a.copy(an[0]).multiplyScalar(.886227),a.addScaledVector(an[1],2*.511664*_e),a.addScaledVector(an[2],2*.511664*Kt),a.addScaledVector(an[3],2*.511664*b),a.addScaledVector(an[4],2*.429043*b*_e),a.addScaledVector(an[5],2*.429043*_e*Kt),a.addScaledVector(an[6],.743125*Kt*Kt-.247708),a.addScaledVector(an[7],2*.429043*b*Kt),a.addScaledVector(an[8],.429043*(b*b-_e*_e)),a}add(s){for(let a=0;a<9;a++)this.coefficients[a].add(s.coefficients[a]);return this}addScaledSH(s,a){for(let b=0;b<9;b++)this.coefficients[b].addScaledVector(s.coefficients[b],a);return this}scale(s){for(let a=0;a<9;a++)this.coefficients[a].multiplyScalar(s);return this}lerp(s,a){for(let b=0;b<9;b++)this.coefficients[b].lerp(s.coefficients[b],a);return this}equals(s){for(let a=0;a<9;a++)if(!this.coefficients[a].equals(s.coefficients[a]))return!1;return!0}copy(s){return this.set(s.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(s,a=0){const b=this.coefficients;for(let _e=0;_e<9;_e++)b[_e].fromArray(s,a+_e*3);return this}toArray(s=[],a=0){const b=this.coefficients;for(let _e=0;_e<9;_e++)b[_e].toArray(s,a+_e*3);return s}static getBasisAt(s,a){const b=s.x,_e=s.y,Kt=s.z;a[0]=.282095,a[1]=.488603*_e,a[2]=.488603*Kt,a[3]=.488603*b,a[4]=1.092548*b*_e,a[5]=1.092548*_e*Kt,a[6]=.315392*(3*Kt*Kt-1),a[7]=1.092548*b*Kt,a[8]=.546274*(b*b-_e*_e)}}class LightProbe extends Light{constructor(s=new SphericalHarmonics3,a=1){super(void 0,a),this.isLightProbe=!0,this.sh=s}copy(s){return super.copy(s),this.sh.copy(s.sh),this}fromJSON(s){return this.intensity=s.intensity,this.sh.fromArray(s.sh),this}toJSON(s){const a=super.toJSON(s);return a.object.sh=this.sh.toArray(),a}}class MaterialLoader extends Loader{constructor(s){super(s),this.textures={}}load(s,a,b,_e){const Kt=this,an=new FileLoader(Kt.manager);an.setPath(Kt.path),an.setRequestHeader(Kt.requestHeader),an.setWithCredentials(Kt.withCredentials),an.load(s,function(_n){try{a(Kt.parse(JSON.parse(_n)))}catch(On){_e?_e(On):console.error(On),Kt.manager.itemError(s)}},b,_e)}parse(s){const a=this.textures;function b(Kt){return a[Kt]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",Kt),a[Kt]}const _e=MaterialLoader.createMaterialFromType(s.type);if(s.uuid!==void 0&&(_e.uuid=s.uuid),s.name!==void 0&&(_e.name=s.name),s.color!==void 0&&_e.color!==void 0&&_e.color.setHex(s.color),s.roughness!==void 0&&(_e.roughness=s.roughness),s.metalness!==void 0&&(_e.metalness=s.metalness),s.sheen!==void 0&&(_e.sheen=s.sheen),s.sheenColor!==void 0&&(_e.sheenColor=new Color$1().setHex(s.sheenColor)),s.sheenRoughness!==void 0&&(_e.sheenRoughness=s.sheenRoughness),s.emissive!==void 0&&_e.emissive!==void 0&&_e.emissive.setHex(s.emissive),s.specular!==void 0&&_e.specular!==void 0&&_e.specular.setHex(s.specular),s.specularIntensity!==void 0&&(_e.specularIntensity=s.specularIntensity),s.specularColor!==void 0&&_e.specularColor!==void 0&&_e.specularColor.setHex(s.specularColor),s.shininess!==void 0&&(_e.shininess=s.shininess),s.clearcoat!==void 0&&(_e.clearcoat=s.clearcoat),s.clearcoatRoughness!==void 0&&(_e.clearcoatRoughness=s.clearcoatRoughness),s.iridescence!==void 0&&(_e.iridescence=s.iridescence),s.iridescenceIOR!==void 0&&(_e.iridescenceIOR=s.iridescenceIOR),s.iridescenceThicknessRange!==void 0&&(_e.iridescenceThicknessRange=s.iridescenceThicknessRange),s.transmission!==void 0&&(_e.transmission=s.transmission),s.thickness!==void 0&&(_e.thickness=s.thickness),s.attenuationDistance!==void 0&&(_e.attenuationDistance=s.attenuationDistance),s.attenuationColor!==void 0&&_e.attenuationColor!==void 0&&_e.attenuationColor.setHex(s.attenuationColor),s.anisotropy!==void 0&&(_e.anisotropy=s.anisotropy),s.anisotropyRotation!==void 0&&(_e.anisotropyRotation=s.anisotropyRotation),s.fog!==void 0&&(_e.fog=s.fog),s.flatShading!==void 0&&(_e.flatShading=s.flatShading),s.blending!==void 0&&(_e.blending=s.blending),s.combine!==void 0&&(_e.combine=s.combine),s.side!==void 0&&(_e.side=s.side),s.shadowSide!==void 0&&(_e.shadowSide=s.shadowSide),s.opacity!==void 0&&(_e.opacity=s.opacity),s.transparent!==void 0&&(_e.transparent=s.transparent),s.alphaTest!==void 0&&(_e.alphaTest=s.alphaTest),s.alphaHash!==void 0&&(_e.alphaHash=s.alphaHash),s.depthFunc!==void 0&&(_e.depthFunc=s.depthFunc),s.depthTest!==void 0&&(_e.depthTest=s.depthTest),s.depthWrite!==void 0&&(_e.depthWrite=s.depthWrite),s.colorWrite!==void 0&&(_e.colorWrite=s.colorWrite),s.blendSrc!==void 0&&(_e.blendSrc=s.blendSrc),s.blendDst!==void 0&&(_e.blendDst=s.blendDst),s.blendEquation!==void 0&&(_e.blendEquation=s.blendEquation),s.blendSrcAlpha!==void 0&&(_e.blendSrcAlpha=s.blendSrcAlpha),s.blendDstAlpha!==void 0&&(_e.blendDstAlpha=s.blendDstAlpha),s.blendEquationAlpha!==void 0&&(_e.blendEquationAlpha=s.blendEquationAlpha),s.blendColor!==void 0&&_e.blendColor!==void 0&&_e.blendColor.setHex(s.blendColor),s.blendAlpha!==void 0&&(_e.blendAlpha=s.blendAlpha),s.stencilWriteMask!==void 0&&(_e.stencilWriteMask=s.stencilWriteMask),s.stencilFunc!==void 0&&(_e.stencilFunc=s.stencilFunc),s.stencilRef!==void 0&&(_e.stencilRef=s.stencilRef),s.stencilFuncMask!==void 0&&(_e.stencilFuncMask=s.stencilFuncMask),s.stencilFail!==void 0&&(_e.stencilFail=s.stencilFail),s.stencilZFail!==void 0&&(_e.stencilZFail=s.stencilZFail),s.stencilZPass!==void 0&&(_e.stencilZPass=s.stencilZPass),s.stencilWrite!==void 0&&(_e.stencilWrite=s.stencilWrite),s.wireframe!==void 0&&(_e.wireframe=s.wireframe),s.wireframeLinewidth!==void 0&&(_e.wireframeLinewidth=s.wireframeLinewidth),s.wireframeLinecap!==void 0&&(_e.wireframeLinecap=s.wireframeLinecap),s.wireframeLinejoin!==void 0&&(_e.wireframeLinejoin=s.wireframeLinejoin),s.rotation!==void 0&&(_e.rotation=s.rotation),s.linewidth!==void 0&&(_e.linewidth=s.linewidth),s.dashSize!==void 0&&(_e.dashSize=s.dashSize),s.gapSize!==void 0&&(_e.gapSize=s.gapSize),s.scale!==void 0&&(_e.scale=s.scale),s.polygonOffset!==void 0&&(_e.polygonOffset=s.polygonOffset),s.polygonOffsetFactor!==void 0&&(_e.polygonOffsetFactor=s.polygonOffsetFactor),s.polygonOffsetUnits!==void 0&&(_e.polygonOffsetUnits=s.polygonOffsetUnits),s.dithering!==void 0&&(_e.dithering=s.dithering),s.alphaToCoverage!==void 0&&(_e.alphaToCoverage=s.alphaToCoverage),s.premultipliedAlpha!==void 0&&(_e.premultipliedAlpha=s.premultipliedAlpha),s.forceSinglePass!==void 0&&(_e.forceSinglePass=s.forceSinglePass),s.visible!==void 0&&(_e.visible=s.visible),s.toneMapped!==void 0&&(_e.toneMapped=s.toneMapped),s.userData!==void 0&&(_e.userData=s.userData),s.vertexColors!==void 0&&(typeof s.vertexColors=="number"?_e.vertexColors=s.vertexColors>0:_e.vertexColors=s.vertexColors),s.uniforms!==void 0)for(const Kt in s.uniforms){const an=s.uniforms[Kt];switch(_e.uniforms[Kt]={},an.type){case"t":_e.uniforms[Kt].value=b(an.value);break;case"c":_e.uniforms[Kt].value=new Color$1().setHex(an.value);break;case"v2":_e.uniforms[Kt].value=new Vector2().fromArray(an.value);break;case"v3":_e.uniforms[Kt].value=new Vector3().fromArray(an.value);break;case"v4":_e.uniforms[Kt].value=new Vector4().fromArray(an.value);break;case"m3":_e.uniforms[Kt].value=new Matrix3().fromArray(an.value);break;case"m4":_e.uniforms[Kt].value=new Matrix4().fromArray(an.value);break;default:_e.uniforms[Kt].value=an.value}}if(s.defines!==void 0&&(_e.defines=s.defines),s.vertexShader!==void 0&&(_e.vertexShader=s.vertexShader),s.fragmentShader!==void 0&&(_e.fragmentShader=s.fragmentShader),s.glslVersion!==void 0&&(_e.glslVersion=s.glslVersion),s.extensions!==void 0)for(const Kt in s.extensions)_e.extensions[Kt]=s.extensions[Kt];if(s.lights!==void 0&&(_e.lights=s.lights),s.clipping!==void 0&&(_e.clipping=s.clipping),s.size!==void 0&&(_e.size=s.size),s.sizeAttenuation!==void 0&&(_e.sizeAttenuation=s.sizeAttenuation),s.map!==void 0&&(_e.map=b(s.map)),s.matcap!==void 0&&(_e.matcap=b(s.matcap)),s.alphaMap!==void 0&&(_e.alphaMap=b(s.alphaMap)),s.bumpMap!==void 0&&(_e.bumpMap=b(s.bumpMap)),s.bumpScale!==void 0&&(_e.bumpScale=s.bumpScale),s.normalMap!==void 0&&(_e.normalMap=b(s.normalMap)),s.normalMapType!==void 0&&(_e.normalMapType=s.normalMapType),s.normalScale!==void 0){let Kt=s.normalScale;Array.isArray(Kt)===!1&&(Kt=[Kt,Kt]),_e.normalScale=new Vector2().fromArray(Kt)}return s.displacementMap!==void 0&&(_e.displacementMap=b(s.displacementMap)),s.displacementScale!==void 0&&(_e.displacementScale=s.displacementScale),s.displacementBias!==void 0&&(_e.displacementBias=s.displacementBias),s.roughnessMap!==void 0&&(_e.roughnessMap=b(s.roughnessMap)),s.metalnessMap!==void 0&&(_e.metalnessMap=b(s.metalnessMap)),s.emissiveMap!==void 0&&(_e.emissiveMap=b(s.emissiveMap)),s.emissiveIntensity!==void 0&&(_e.emissiveIntensity=s.emissiveIntensity),s.specularMap!==void 0&&(_e.specularMap=b(s.specularMap)),s.specularIntensityMap!==void 0&&(_e.specularIntensityMap=b(s.specularIntensityMap)),s.specularColorMap!==void 0&&(_e.specularColorMap=b(s.specularColorMap)),s.envMap!==void 0&&(_e.envMap=b(s.envMap)),s.envMapRotation!==void 0&&_e.envMapRotation.fromArray(s.envMapRotation),s.envMapIntensity!==void 0&&(_e.envMapIntensity=s.envMapIntensity),s.reflectivity!==void 0&&(_e.reflectivity=s.reflectivity),s.refractionRatio!==void 0&&(_e.refractionRatio=s.refractionRatio),s.lightMap!==void 0&&(_e.lightMap=b(s.lightMap)),s.lightMapIntensity!==void 0&&(_e.lightMapIntensity=s.lightMapIntensity),s.aoMap!==void 0&&(_e.aoMap=b(s.aoMap)),s.aoMapIntensity!==void 0&&(_e.aoMapIntensity=s.aoMapIntensity),s.gradientMap!==void 0&&(_e.gradientMap=b(s.gradientMap)),s.clearcoatMap!==void 0&&(_e.clearcoatMap=b(s.clearcoatMap)),s.clearcoatRoughnessMap!==void 0&&(_e.clearcoatRoughnessMap=b(s.clearcoatRoughnessMap)),s.clearcoatNormalMap!==void 0&&(_e.clearcoatNormalMap=b(s.clearcoatNormalMap)),s.clearcoatNormalScale!==void 0&&(_e.clearcoatNormalScale=new Vector2().fromArray(s.clearcoatNormalScale)),s.iridescenceMap!==void 0&&(_e.iridescenceMap=b(s.iridescenceMap)),s.iridescenceThicknessMap!==void 0&&(_e.iridescenceThicknessMap=b(s.iridescenceThicknessMap)),s.transmissionMap!==void 0&&(_e.transmissionMap=b(s.transmissionMap)),s.thicknessMap!==void 0&&(_e.thicknessMap=b(s.thicknessMap)),s.anisotropyMap!==void 0&&(_e.anisotropyMap=b(s.anisotropyMap)),s.sheenColorMap!==void 0&&(_e.sheenColorMap=b(s.sheenColorMap)),s.sheenRoughnessMap!==void 0&&(_e.sheenRoughnessMap=b(s.sheenRoughnessMap)),_e}setTextures(s){return this.textures=s,this}static createMaterialFromType(s){const a={ShadowMaterial,SpriteMaterial,RawShaderMaterial,ShaderMaterial,PointsMaterial,MeshPhysicalMaterial,MeshStandardMaterial,MeshPhongMaterial,MeshToonMaterial,MeshNormalMaterial,MeshLambertMaterial,MeshDepthMaterial,MeshDistanceMaterial,MeshBasicMaterial,MeshMatcapMaterial,LineDashedMaterial,LineBasicMaterial,Material};return new a[s]}}class LoaderUtils{static decodeText(s){if(typeof TextDecoder<"u")return new TextDecoder().decode(s);let a="";for(let b=0,_e=s.length;b<_e;b++)a+=String.fromCharCode(s[b]);try{return decodeURIComponent(escape(a))}catch{return a}}static extractUrlBase(s){const a=s.lastIndexOf("/");return a===-1?"./":s.slice(0,a+1)}static resolveURL(s,a){return typeof s!="string"||s===""?"":(/^https?:\/\//i.test(a)&&/^\//.test(s)&&(a=a.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(s)||/^data:.*,.*$/i.test(s)||/^blob:.*$/i.test(s)?s:a+s)}}class InstancedBufferGeometry extends BufferGeometry{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(s){return super.copy(s),this.instanceCount=s.instanceCount,this}toJSON(){const s=super.toJSON();return s.instanceCount=this.instanceCount,s.isInstancedBufferGeometry=!0,s}}class BufferGeometryLoader extends Loader{constructor(s){super(s)}load(s,a,b,_e){const Kt=this,an=new FileLoader(Kt.manager);an.setPath(Kt.path),an.setRequestHeader(Kt.requestHeader),an.setWithCredentials(Kt.withCredentials),an.load(s,function(_n){try{a(Kt.parse(JSON.parse(_n)))}catch(On){_e?_e(On):console.error(On),Kt.manager.itemError(s)}},b,_e)}parse(s){const a={},b={};function _e(Ar,Or){if(a[Or]!==void 0)return a[Or];const ss=Ar.interleavedBuffers[Or],kr=Kt(Ar,ss.buffer),us=getTypedArray(ss.type,kr),hs=new InterleavedBuffer(us,ss.stride);return hs.uuid=ss.uuid,a[Or]=hs,hs}function Kt(Ar,Or){if(b[Or]!==void 0)return b[Or];const ss=Ar.arrayBuffers[Or],kr=new Uint32Array(ss).buffer;return b[Or]=kr,kr}const an=s.isInstancedBufferGeometry?new InstancedBufferGeometry:new BufferGeometry,_n=s.data.index;if(_n!==void 0){const Ar=getTypedArray(_n.type,_n.array);an.setIndex(new BufferAttribute(Ar,1))}const On=s.data.attributes;for(const Ar in On){const Or=On[Ar];let Xr;if(Or.isInterleavedBufferAttribute){const ss=_e(s.data,Or.data);Xr=new InterleavedBufferAttribute(ss,Or.itemSize,Or.offset,Or.normalized)}else{const ss=getTypedArray(Or.type,Or.array),kr=Or.isInstancedBufferAttribute?InstancedBufferAttribute:BufferAttribute;Xr=new kr(ss,Or.itemSize,Or.normalized)}Or.name!==void 0&&(Xr.name=Or.name),Or.usage!==void 0&&Xr.setUsage(Or.usage),an.setAttribute(Ar,Xr)}const $n=s.data.morphAttributes;if($n)for(const Ar in $n){const Or=$n[Ar],Xr=[];for(let ss=0,kr=Or.length;ss<kr;ss++){const us=Or[ss];let hs;if(us.isInterleavedBufferAttribute){const ds=_e(s.data,us.data);hs=new InterleavedBufferAttribute(ds,us.itemSize,us.offset,us.normalized)}else{const ds=getTypedArray(us.type,us.array);hs=new BufferAttribute(ds,us.itemSize,us.normalized)}us.name!==void 0&&(hs.name=us.name),Xr.push(hs)}an.morphAttributes[Ar]=Xr}s.data.morphTargetsRelative&&(an.morphTargetsRelative=!0);const fr=s.data.groups||s.data.drawcalls||s.data.offsets;if(fr!==void 0)for(let Ar=0,Or=fr.length;Ar!==Or;++Ar){const Xr=fr[Ar];an.addGroup(Xr.start,Xr.count,Xr.materialIndex)}const pr=s.data.boundingSphere;if(pr!==void 0){const Ar=new Vector3;pr.center!==void 0&&Ar.fromArray(pr.center),an.boundingSphere=new Sphere(Ar,pr.radius)}return s.name&&(an.name=s.name),s.userData&&(an.userData=s.userData),an}}class ObjectLoader extends Loader{constructor(s){super(s)}load(s,a,b,_e){const Kt=this,an=this.path===""?LoaderUtils.extractUrlBase(s):this.path;this.resourcePath=this.resourcePath||an;const _n=new FileLoader(this.manager);_n.setPath(this.path),_n.setRequestHeader(this.requestHeader),_n.setWithCredentials(this.withCredentials),_n.load(s,function(On){let $n=null;try{$n=JSON.parse(On)}catch(fr){_e!==void 0&&_e(fr),console.error("THREE:ObjectLoader: Can't parse "+s+".",fr.message);return}const dr=$n.metadata;if(dr===void 0||dr.type===void 0||dr.type.toLowerCase()==="geometry"){_e!==void 0&&_e(new Error("THREE.ObjectLoader: Can't load "+s)),console.error("THREE.ObjectLoader: Can't load "+s);return}Kt.parse($n,a)},b,_e)}async loadAsync(s,a){const b=this,_e=this.path===""?LoaderUtils.extractUrlBase(s):this.path;this.resourcePath=this.resourcePath||_e;const Kt=new FileLoader(this.manager);Kt.setPath(this.path),Kt.setRequestHeader(this.requestHeader),Kt.setWithCredentials(this.withCredentials);const an=await Kt.loadAsync(s,a),_n=JSON.parse(an),On=_n.metadata;if(On===void 0||On.type===void 0||On.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+s);return await b.parseAsync(_n)}parse(s,a){const b=this.parseAnimations(s.animations),_e=this.parseShapes(s.shapes),Kt=this.parseGeometries(s.geometries,_e),an=this.parseImages(s.images,function(){a!==void 0&&a($n)}),_n=this.parseTextures(s.textures,an),On=this.parseMaterials(s.materials,_n),$n=this.parseObject(s.object,Kt,On,_n,b),dr=this.parseSkeletons(s.skeletons,$n);if(this.bindSkeletons($n,dr),a!==void 0){let fr=!1;for(const pr in an)if(an[pr].data instanceof HTMLImageElement){fr=!0;break}fr===!1&&a($n)}return $n}async parseAsync(s){const a=this.parseAnimations(s.animations),b=this.parseShapes(s.shapes),_e=this.parseGeometries(s.geometries,b),Kt=await this.parseImagesAsync(s.images),an=this.parseTextures(s.textures,Kt),_n=this.parseMaterials(s.materials,an),On=this.parseObject(s.object,_e,_n,an,a),$n=this.parseSkeletons(s.skeletons,On);return this.bindSkeletons(On,$n),On}parseShapes(s){const a={};if(s!==void 0)for(let b=0,_e=s.length;b<_e;b++){const Kt=new Shape().fromJSON(s[b]);a[Kt.uuid]=Kt}return a}parseSkeletons(s,a){const b={},_e={};if(a.traverse(function(Kt){Kt.isBone&&(_e[Kt.uuid]=Kt)}),s!==void 0)for(let Kt=0,an=s.length;Kt<an;Kt++){const _n=new Skeleton().fromJSON(s[Kt],_e);b[_n.uuid]=_n}return b}parseGeometries(s,a){const b={};if(s!==void 0){const _e=new BufferGeometryLoader;for(let Kt=0,an=s.length;Kt<an;Kt++){let _n;const On=s[Kt];switch(On.type){case"BufferGeometry":case"InstancedBufferGeometry":_n=_e.parse(On);break;default:On.type in Geometries?_n=Geometries[On.type].fromJSON(On,a):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${On.type}"`)}_n.uuid=On.uuid,On.name!==void 0&&(_n.name=On.name),On.userData!==void 0&&(_n.userData=On.userData),b[On.uuid]=_n}}return b}parseMaterials(s,a){const b={},_e={};if(s!==void 0){const Kt=new MaterialLoader;Kt.setTextures(a);for(let an=0,_n=s.length;an<_n;an++){const On=s[an];b[On.uuid]===void 0&&(b[On.uuid]=Kt.parse(On)),_e[On.uuid]=b[On.uuid]}}return _e}parseAnimations(s){const a={};if(s!==void 0)for(let b=0;b<s.length;b++){const _e=s[b],Kt=AnimationClip.parse(_e);a[Kt.uuid]=Kt}return a}parseImages(s,a){const b=this,_e={};let Kt;function an(On){return b.manager.itemStart(On),Kt.load(On,function(){b.manager.itemEnd(On)},void 0,function(){b.manager.itemError(On),b.manager.itemEnd(On)})}function _n(On){if(typeof On=="string"){const $n=On,dr=/^(\/\/)|([a-z]+:(\/\/)?)/i.test($n)?$n:b.resourcePath+$n;return an(dr)}else return On.data?{data:getTypedArray(On.type,On.data),width:On.width,height:On.height}:null}if(s!==void 0&&s.length>0){const On=new LoadingManager(a);Kt=new ImageLoader(On),Kt.setCrossOrigin(this.crossOrigin);for(let $n=0,dr=s.length;$n<dr;$n++){const fr=s[$n],pr=fr.url;if(Array.isArray(pr)){const Ar=[];for(let Or=0,Xr=pr.length;Or<Xr;Or++){const ss=pr[Or],kr=_n(ss);kr!==null&&(kr instanceof HTMLImageElement?Ar.push(kr):Ar.push(new DataTexture(kr.data,kr.width,kr.height)))}_e[fr.uuid]=new Source(Ar)}else{const Ar=_n(fr.url);_e[fr.uuid]=new Source(Ar)}}}return _e}async parseImagesAsync(s){const a=this,b={};let _e;async function Kt(an){if(typeof an=="string"){const _n=an,On=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(_n)?_n:a.resourcePath+_n;return await _e.loadAsync(On)}else return an.data?{data:getTypedArray(an.type,an.data),width:an.width,height:an.height}:null}if(s!==void 0&&s.length>0){_e=new ImageLoader(this.manager),_e.setCrossOrigin(this.crossOrigin);for(let an=0,_n=s.length;an<_n;an++){const On=s[an],$n=On.url;if(Array.isArray($n)){const dr=[];for(let fr=0,pr=$n.length;fr<pr;fr++){const Ar=$n[fr],Or=await Kt(Ar);Or!==null&&(Or instanceof HTMLImageElement?dr.push(Or):dr.push(new DataTexture(Or.data,Or.width,Or.height)))}b[On.uuid]=new Source(dr)}else{const dr=await Kt(On.url);b[On.uuid]=new Source(dr)}}}return b}parseTextures(s,a){function b(Kt,an){return typeof Kt=="number"?Kt:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",Kt),an[Kt])}const _e={};if(s!==void 0)for(let Kt=0,an=s.length;Kt<an;Kt++){const _n=s[Kt];_n.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',_n.uuid),a[_n.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",_n.image);const On=a[_n.image],$n=On.data;let dr;Array.isArray($n)?(dr=new CubeTexture,$n.length===6&&(dr.needsUpdate=!0)):($n&&$n.data?dr=new DataTexture:dr=new Texture,$n&&(dr.needsUpdate=!0)),dr.source=On,dr.uuid=_n.uuid,_n.name!==void 0&&(dr.name=_n.name),_n.mapping!==void 0&&(dr.mapping=b(_n.mapping,TEXTURE_MAPPING)),_n.channel!==void 0&&(dr.channel=_n.channel),_n.offset!==void 0&&dr.offset.fromArray(_n.offset),_n.repeat!==void 0&&dr.repeat.fromArray(_n.repeat),_n.center!==void 0&&dr.center.fromArray(_n.center),_n.rotation!==void 0&&(dr.rotation=_n.rotation),_n.wrap!==void 0&&(dr.wrapS=b(_n.wrap[0],TEXTURE_WRAPPING),dr.wrapT=b(_n.wrap[1],TEXTURE_WRAPPING)),_n.format!==void 0&&(dr.format=_n.format),_n.internalFormat!==void 0&&(dr.internalFormat=_n.internalFormat),_n.type!==void 0&&(dr.type=_n.type),_n.colorSpace!==void 0&&(dr.colorSpace=_n.colorSpace),_n.minFilter!==void 0&&(dr.minFilter=b(_n.minFilter,TEXTURE_FILTER)),_n.magFilter!==void 0&&(dr.magFilter=b(_n.magFilter,TEXTURE_FILTER)),_n.anisotropy!==void 0&&(dr.anisotropy=_n.anisotropy),_n.flipY!==void 0&&(dr.flipY=_n.flipY),_n.generateMipmaps!==void 0&&(dr.generateMipmaps=_n.generateMipmaps),_n.premultiplyAlpha!==void 0&&(dr.premultiplyAlpha=_n.premultiplyAlpha),_n.unpackAlignment!==void 0&&(dr.unpackAlignment=_n.unpackAlignment),_n.compareFunction!==void 0&&(dr.compareFunction=_n.compareFunction),_n.userData!==void 0&&(dr.userData=_n.userData),_e[_n.uuid]=dr}return _e}parseObject(s,a,b,_e,Kt){let an;function _n(pr){return a[pr]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",pr),a[pr]}function On(pr){if(pr!==void 0){if(Array.isArray(pr)){const Ar=[];for(let Or=0,Xr=pr.length;Or<Xr;Or++){const ss=pr[Or];b[ss]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",ss),Ar.push(b[ss])}return Ar}return b[pr]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",pr),b[pr]}}function $n(pr){return _e[pr]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",pr),_e[pr]}let dr,fr;switch(s.type){case"Scene":an=new Scene,s.background!==void 0&&(Number.isInteger(s.background)?an.background=new Color$1(s.background):an.background=$n(s.background)),s.environment!==void 0&&(an.environment=$n(s.environment)),s.fog!==void 0&&(s.fog.type==="Fog"?an.fog=new Fog(s.fog.color,s.fog.near,s.fog.far):s.fog.type==="FogExp2"&&(an.fog=new FogExp2(s.fog.color,s.fog.density)),s.fog.name!==""&&(an.fog.name=s.fog.name)),s.backgroundBlurriness!==void 0&&(an.backgroundBlurriness=s.backgroundBlurriness),s.backgroundIntensity!==void 0&&(an.backgroundIntensity=s.backgroundIntensity),s.backgroundRotation!==void 0&&an.backgroundRotation.fromArray(s.backgroundRotation),s.environmentIntensity!==void 0&&(an.environmentIntensity=s.environmentIntensity),s.environmentRotation!==void 0&&an.environmentRotation.fromArray(s.environmentRotation);break;case"PerspectiveCamera":an=new PerspectiveCamera(s.fov,s.aspect,s.near,s.far),s.focus!==void 0&&(an.focus=s.focus),s.zoom!==void 0&&(an.zoom=s.zoom),s.filmGauge!==void 0&&(an.filmGauge=s.filmGauge),s.filmOffset!==void 0&&(an.filmOffset=s.filmOffset),s.view!==void 0&&(an.view=Object.assign({},s.view));break;case"OrthographicCamera":an=new OrthographicCamera(s.left,s.right,s.top,s.bottom,s.near,s.far),s.zoom!==void 0&&(an.zoom=s.zoom),s.view!==void 0&&(an.view=Object.assign({},s.view));break;case"AmbientLight":an=new AmbientLight(s.color,s.intensity);break;case"DirectionalLight":an=new DirectionalLight(s.color,s.intensity);break;case"PointLight":an=new PointLight(s.color,s.intensity,s.distance,s.decay);break;case"RectAreaLight":an=new RectAreaLight(s.color,s.intensity,s.width,s.height);break;case"SpotLight":an=new SpotLight(s.color,s.intensity,s.distance,s.angle,s.penumbra,s.decay);break;case"HemisphereLight":an=new HemisphereLight(s.color,s.groundColor,s.intensity);break;case"LightProbe":an=new LightProbe().fromJSON(s);break;case"SkinnedMesh":dr=_n(s.geometry),fr=On(s.material),an=new SkinnedMesh(dr,fr),s.bindMode!==void 0&&(an.bindMode=s.bindMode),s.bindMatrix!==void 0&&an.bindMatrix.fromArray(s.bindMatrix),s.skeleton!==void 0&&(an.skeleton=s.skeleton);break;case"Mesh":dr=_n(s.geometry),fr=On(s.material),an=new Mesh(dr,fr);break;case"InstancedMesh":dr=_n(s.geometry),fr=On(s.material);const pr=s.count,Ar=s.instanceMatrix,Or=s.instanceColor;an=new InstancedMesh(dr,fr,pr),an.instanceMatrix=new InstancedBufferAttribute(new Float32Array(Ar.array),16),Or!==void 0&&(an.instanceColor=new InstancedBufferAttribute(new Float32Array(Or.array),Or.itemSize));break;case"BatchedMesh":dr=_n(s.geometry),fr=On(s.material),an=new BatchedMesh(s.maxGeometryCount,s.maxVertexCount,s.maxIndexCount,fr),an.geometry=dr,an.perObjectFrustumCulled=s.perObjectFrustumCulled,an.sortObjects=s.sortObjects,an._drawRanges=s.drawRanges,an._reservedRanges=s.reservedRanges,an._visibility=s.visibility,an._active=s.active,an._bounds=s.bounds.map(Xr=>{const ss=new Box3;ss.min.fromArray(Xr.boxMin),ss.max.fromArray(Xr.boxMax);const kr=new Sphere;return kr.radius=Xr.sphereRadius,kr.center.fromArray(Xr.sphereCenter),{boxInitialized:Xr.boxInitialized,box:ss,sphereInitialized:Xr.sphereInitialized,sphere:kr}}),an._maxGeometryCount=s.maxGeometryCount,an._maxVertexCount=s.maxVertexCount,an._maxIndexCount=s.maxIndexCount,an._geometryInitialized=s.geometryInitialized,an._geometryCount=s.geometryCount,an._matricesTexture=$n(s.matricesTexture.uuid);break;case"LOD":an=new LOD;break;case"Line":an=new Line(_n(s.geometry),On(s.material));break;case"LineLoop":an=new LineLoop(_n(s.geometry),On(s.material));break;case"LineSegments":an=new LineSegments(_n(s.geometry),On(s.material));break;case"PointCloud":case"Points":an=new Points(_n(s.geometry),On(s.material));break;case"Sprite":an=new Sprite(On(s.material));break;case"Group":an=new Group;break;case"Bone":an=new Bone;break;default:an=new Object3D}if(an.uuid=s.uuid,s.name!==void 0&&(an.name=s.name),s.matrix!==void 0?(an.matrix.fromArray(s.matrix),s.matrixAutoUpdate!==void 0&&(an.matrixAutoUpdate=s.matrixAutoUpdate),an.matrixAutoUpdate&&an.matrix.decompose(an.position,an.quaternion,an.scale)):(s.position!==void 0&&an.position.fromArray(s.position),s.rotation!==void 0&&an.rotation.fromArray(s.rotation),s.quaternion!==void 0&&an.quaternion.fromArray(s.quaternion),s.scale!==void 0&&an.scale.fromArray(s.scale)),s.up!==void 0&&an.up.fromArray(s.up),s.castShadow!==void 0&&(an.castShadow=s.castShadow),s.receiveShadow!==void 0&&(an.receiveShadow=s.receiveShadow),s.shadow&&(s.shadow.bias!==void 0&&(an.shadow.bias=s.shadow.bias),s.shadow.normalBias!==void 0&&(an.shadow.normalBias=s.shadow.normalBias),s.shadow.radius!==void 0&&(an.shadow.radius=s.shadow.radius),s.shadow.mapSize!==void 0&&an.shadow.mapSize.fromArray(s.shadow.mapSize),s.shadow.camera!==void 0&&(an.shadow.camera=this.parseObject(s.shadow.camera))),s.visible!==void 0&&(an.visible=s.visible),s.frustumCulled!==void 0&&(an.frustumCulled=s.frustumCulled),s.renderOrder!==void 0&&(an.renderOrder=s.renderOrder),s.userData!==void 0&&(an.userData=s.userData),s.layers!==void 0&&(an.layers.mask=s.layers),s.children!==void 0){const pr=s.children;for(let Ar=0;Ar<pr.length;Ar++)an.add(this.parseObject(pr[Ar],a,b,_e,Kt))}if(s.animations!==void 0){const pr=s.animations;for(let Ar=0;Ar<pr.length;Ar++){const Or=pr[Ar];an.animations.push(Kt[Or])}}if(s.type==="LOD"){s.autoUpdate!==void 0&&(an.autoUpdate=s.autoUpdate);const pr=s.levels;for(let Ar=0;Ar<pr.length;Ar++){const Or=pr[Ar],Xr=an.getObjectByProperty("uuid",Or.object);Xr!==void 0&&an.addLevel(Xr,Or.distance,Or.hysteresis)}}return an}bindSkeletons(s,a){Object.keys(a).length!==0&&s.traverse(function(b){if(b.isSkinnedMesh===!0&&b.skeleton!==void 0){const _e=a[b.skeleton];_e===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",b.skeleton):b.bind(_e,b.bindMatrix)}})}}const TEXTURE_MAPPING={UVMapping,CubeReflectionMapping,CubeRefractionMapping,EquirectangularReflectionMapping,EquirectangularRefractionMapping,CubeUVReflectionMapping},TEXTURE_WRAPPING={RepeatWrapping,ClampToEdgeWrapping,MirroredRepeatWrapping},TEXTURE_FILTER={NearestFilter,NearestMipmapNearestFilter,NearestMipmapLinearFilter,LinearFilter,LinearMipmapNearestFilter,LinearMipmapLinearFilter};class ImageBitmapLoader extends Loader{constructor(s){super(s),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(s){return this.options=s,this}load(s,a,b,_e){s===void 0&&(s=""),this.path!==void 0&&(s=this.path+s),s=this.manager.resolveURL(s);const Kt=this,an=Cache.get(s);if(an!==void 0){if(Kt.manager.itemStart(s),an.then){an.then($n=>{a&&a($n),Kt.manager.itemEnd(s)}).catch($n=>{_e&&_e($n)});return}return setTimeout(function(){a&&a(an),Kt.manager.itemEnd(s)},0),an}const _n={};_n.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",_n.headers=this.requestHeader;const On=fetch(s,_n).then(function($n){return $n.blob()}).then(function($n){return createImageBitmap($n,Object.assign(Kt.options,{colorSpaceConversion:"none"}))}).then(function($n){return Cache.add(s,$n),a&&a($n),Kt.manager.itemEnd(s),$n}).catch(function($n){_e&&_e($n),Cache.remove(s),Kt.manager.itemError(s),Kt.manager.itemEnd(s)});Cache.add(s,On),Kt.manager.itemStart(s)}}let _context;class AudioContext{static getContext(){return _context===void 0&&(_context=new(window.AudioContext||window.webkitAudioContext)),_context}static setContext(s){_context=s}}class AudioLoader extends Loader{constructor(s){super(s)}load(s,a,b,_e){const Kt=this,an=new FileLoader(this.manager);an.setResponseType("arraybuffer"),an.setPath(this.path),an.setRequestHeader(this.requestHeader),an.setWithCredentials(this.withCredentials),an.load(s,function(On){try{const $n=On.slice(0);AudioContext.getContext().decodeAudioData($n,function(fr){a(fr)}).catch(_n)}catch($n){_n($n)}},b,_e);function _n(On){_e?_e(On):console.error(On),Kt.manager.itemError(s)}}}const _eyeRight=new Matrix4,_eyeLeft=new Matrix4,_projectionMatrix=new Matrix4;class StereoCamera{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(s){const a=this._cache;if(a.focus!==s.focus||a.fov!==s.fov||a.aspect!==s.aspect*this.aspect||a.near!==s.near||a.far!==s.far||a.zoom!==s.zoom||a.eyeSep!==this.eyeSep){a.focus=s.focus,a.fov=s.fov,a.aspect=s.aspect*this.aspect,a.near=s.near,a.far=s.far,a.zoom=s.zoom,a.eyeSep=this.eyeSep,_projectionMatrix.copy(s.projectionMatrix);const _e=a.eyeSep/2,Kt=_e*a.near/a.focus,an=a.near*Math.tan(DEG2RAD$1*a.fov*.5)/a.zoom;let _n,On;_eyeLeft.elements[12]=-_e,_eyeRight.elements[12]=_e,_n=-an*a.aspect+Kt,On=an*a.aspect+Kt,_projectionMatrix.elements[0]=2*a.near/(On-_n),_projectionMatrix.elements[8]=(On+_n)/(On-_n),this.cameraL.projectionMatrix.copy(_projectionMatrix),_n=-an*a.aspect-Kt,On=an*a.aspect-Kt,_projectionMatrix.elements[0]=2*a.near/(On-_n),_projectionMatrix.elements[8]=(On+_n)/(On-_n),this.cameraR.projectionMatrix.copy(_projectionMatrix)}this.cameraL.matrixWorld.copy(s.matrixWorld).multiply(_eyeLeft),this.cameraR.matrixWorld.copy(s.matrixWorld).multiply(_eyeRight)}}class Clock{constructor(s=!0){this.autoStart=s,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let s=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const a=now();s=(a-this.oldTime)/1e3,this.oldTime=a,this.elapsedTime+=s}return s}}function now(){return(typeof performance>"u"?Date:performance).now()}const _position$1=new Vector3,_quaternion$1=new Quaternion,_scale$1=new Vector3,_orientation$1=new Vector3;class AudioListener extends Object3D{constructor(){super(),this.type="AudioListener",this.context=AudioContext.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Clock}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(s){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=s,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(s){return this.gain.gain.setTargetAtTime(s,this.context.currentTime,.01),this}updateMatrixWorld(s){super.updateMatrixWorld(s);const a=this.context.listener,b=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(_position$1,_quaternion$1,_scale$1),_orientation$1.set(0,0,-1).applyQuaternion(_quaternion$1),a.positionX){const _e=this.context.currentTime+this.timeDelta;a.positionX.linearRampToValueAtTime(_position$1.x,_e),a.positionY.linearRampToValueAtTime(_position$1.y,_e),a.positionZ.linearRampToValueAtTime(_position$1.z,_e),a.forwardX.linearRampToValueAtTime(_orientation$1.x,_e),a.forwardY.linearRampToValueAtTime(_orientation$1.y,_e),a.forwardZ.linearRampToValueAtTime(_orientation$1.z,_e),a.upX.linearRampToValueAtTime(b.x,_e),a.upY.linearRampToValueAtTime(b.y,_e),a.upZ.linearRampToValueAtTime(b.z,_e)}else a.setPosition(_position$1.x,_position$1.y,_position$1.z),a.setOrientation(_orientation$1.x,_orientation$1.y,_orientation$1.z,b.x,b.y,b.z)}}class Audio extends Object3D{constructor(s){super(),this.type="Audio",this.listener=s,this.context=s.context,this.gain=this.context.createGain(),this.gain.connect(s.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(s){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=s,this.connect(),this}setMediaElementSource(s){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(s),this.connect(),this}setMediaStreamSource(s){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(s),this.connect(),this}setBuffer(s){return this.buffer=s,this.sourceType="buffer",this.autoplay&&this.play(),this}play(s=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+s;const a=this.context.createBufferSource();return a.buffer=this.buffer,a.loop=this.loop,a.loopStart=this.loopStart,a.loopEnd=this.loopEnd,a.onended=this.onEnded.bind(this),a.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=a,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let s=1,a=this.filters.length;s<a;s++)this.filters[s-1].connect(this.filters[s]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this._connected!==!1){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let s=1,a=this.filters.length;s<a;s++)this.filters[s-1].disconnect(this.filters[s]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(s){return s||(s=[]),this._connected===!0?(this.disconnect(),this.filters=s.slice(),this.connect()):this.filters=s.slice(),this}setDetune(s){return this.detune=s,this.isPlaying===!0&&this.source.detune!==void 0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(s){return this.setFilters(s?[s]:[])}setPlaybackRate(s){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=s,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(s){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=s,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(s){return this.loopStart=s,this}setLoopEnd(s){return this.loopEnd=s,this}getVolume(){return this.gain.gain.value}setVolume(s){return this.gain.gain.setTargetAtTime(s,this.context.currentTime,.01),this}}const _position=new Vector3,_quaternion=new Quaternion,_scale=new Vector3,_orientation=new Vector3;class PositionalAudio extends Audio{constructor(s){super(s),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){super.connect(),this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(s){return this.panner.refDistance=s,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(s){return this.panner.rolloffFactor=s,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(s){return this.panner.distanceModel=s,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(s){return this.panner.maxDistance=s,this}setDirectionalCone(s,a,b){return this.panner.coneInnerAngle=s,this.panner.coneOuterAngle=a,this.panner.coneOuterGain=b,this}updateMatrixWorld(s){if(super.updateMatrixWorld(s),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(_position,_quaternion,_scale),_orientation.set(0,0,1).applyQuaternion(_quaternion);const a=this.panner;if(a.positionX){const b=this.context.currentTime+this.listener.timeDelta;a.positionX.linearRampToValueAtTime(_position.x,b),a.positionY.linearRampToValueAtTime(_position.y,b),a.positionZ.linearRampToValueAtTime(_position.z,b),a.orientationX.linearRampToValueAtTime(_orientation.x,b),a.orientationY.linearRampToValueAtTime(_orientation.y,b),a.orientationZ.linearRampToValueAtTime(_orientation.z,b)}else a.setPosition(_position.x,_position.y,_position.z),a.setOrientation(_orientation.x,_orientation.y,_orientation.z)}}class AudioAnalyser{constructor(s,a=2048){this.analyser=s.context.createAnalyser(),this.analyser.fftSize=a,this.data=new Uint8Array(this.analyser.frequencyBinCount),s.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let s=0;const a=this.getFrequencyData();for(let b=0;b<a.length;b++)s+=a[b];return s/a.length}}class PropertyMixer{constructor(s,a,b){this.binding=s,this.valueSize=b;let _e,Kt,an;switch(a){case"quaternion":_e=this._slerp,Kt=this._slerpAdditive,an=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(b*6),this._workIndex=5;break;case"string":case"bool":_e=this._select,Kt=this._select,an=this._setAdditiveIdentityOther,this.buffer=new Array(b*5);break;default:_e=this._lerp,Kt=this._lerpAdditive,an=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(b*5)}this._mixBufferRegion=_e,this._mixBufferRegionAdditive=Kt,this._setIdentity=an,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(s,a){const b=this.buffer,_e=this.valueSize,Kt=s*_e+_e;let an=this.cumulativeWeight;if(an===0){for(let _n=0;_n!==_e;++_n)b[Kt+_n]=b[_n];an=a}else{an+=a;const _n=a/an;this._mixBufferRegion(b,Kt,0,_n,_e)}this.cumulativeWeight=an}accumulateAdditive(s){const a=this.buffer,b=this.valueSize,_e=b*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(a,_e,0,s,b),this.cumulativeWeightAdditive+=s}apply(s){const a=this.valueSize,b=this.buffer,_e=s*a+a,Kt=this.cumulativeWeight,an=this.cumulativeWeightAdditive,_n=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,Kt<1){const On=a*this._origIndex;this._mixBufferRegion(b,_e,On,1-Kt,a)}an>0&&this._mixBufferRegionAdditive(b,_e,this._addIndex*a,1,a);for(let On=a,$n=a+a;On!==$n;++On)if(b[On]!==b[On+a]){_n.setValue(b,_e);break}}saveOriginalState(){const s=this.binding,a=this.buffer,b=this.valueSize,_e=b*this._origIndex;s.getValue(a,_e);for(let Kt=b,an=_e;Kt!==an;++Kt)a[Kt]=a[_e+Kt%b];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const s=this.valueSize*3;this.binding.setValue(this.buffer,s)}_setAdditiveIdentityNumeric(){const s=this._addIndex*this.valueSize,a=s+this.valueSize;for(let b=s;b<a;b++)this.buffer[b]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const s=this._origIndex*this.valueSize,a=this._addIndex*this.valueSize;for(let b=0;b<this.valueSize;b++)this.buffer[a+b]=this.buffer[s+b]}_select(s,a,b,_e,Kt){if(_e>=.5)for(let an=0;an!==Kt;++an)s[a+an]=s[b+an]}_slerp(s,a,b,_e){Quaternion.slerpFlat(s,a,s,a,s,b,_e)}_slerpAdditive(s,a,b,_e,Kt){const an=this._workIndex*Kt;Quaternion.multiplyQuaternionsFlat(s,an,s,a,s,b),Quaternion.slerpFlat(s,a,s,a,s,an,_e)}_lerp(s,a,b,_e,Kt){const an=1-_e;for(let _n=0;_n!==Kt;++_n){const On=a+_n;s[On]=s[On]*an+s[b+_n]*_e}}_lerpAdditive(s,a,b,_e,Kt){for(let an=0;an!==Kt;++an){const _n=a+an;s[_n]=s[_n]+s[b+an]*_e}}}const _RESERVED_CHARS_RE="\\[\\]\\.:\\/",_reservedRe=new RegExp("["+_RESERVED_CHARS_RE+"]","g"),_wordChar="[^"+_RESERVED_CHARS_RE+"]",_wordCharOrDot="[^"+_RESERVED_CHARS_RE.replace("\\.","")+"]",_directoryRe=/((?:WC+[\/:])*)/.source.replace("WC",_wordChar),_nodeRe=/(WCOD+)?/.source.replace("WCOD",_wordCharOrDot),_objectRe=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",_wordChar),_propertyRe=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",_wordChar),_trackRe=new RegExp("^"+_directoryRe+_nodeRe+_objectRe+_propertyRe+"$"),_supportedObjectNames=["material","materials","bones","map"];class Composite{constructor(s,a,b){const _e=b||PropertyBinding.parseTrackName(a);this._targetGroup=s,this._bindings=s.subscribe_(a,_e)}getValue(s,a){this.bind();const b=this._targetGroup.nCachedObjects_,_e=this._bindings[b];_e!==void 0&&_e.getValue(s,a)}setValue(s,a){const b=this._bindings;for(let _e=this._targetGroup.nCachedObjects_,Kt=b.length;_e!==Kt;++_e)b[_e].setValue(s,a)}bind(){const s=this._bindings;for(let a=this._targetGroup.nCachedObjects_,b=s.length;a!==b;++a)s[a].bind()}unbind(){const s=this._bindings;for(let a=this._targetGroup.nCachedObjects_,b=s.length;a!==b;++a)s[a].unbind()}}class PropertyBinding{constructor(s,a,b){this.path=a,this.parsedPath=b||PropertyBinding.parseTrackName(a),this.node=PropertyBinding.findNode(s,this.parsedPath.nodeName),this.rootNode=s,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(s,a,b){return s&&s.isAnimationObjectGroup?new PropertyBinding.Composite(s,a,b):new PropertyBinding(s,a,b)}static sanitizeNodeName(s){return s.replace(/\s/g,"_").replace(_reservedRe,"")}static parseTrackName(s){const a=_trackRe.exec(s);if(a===null)throw new Error("PropertyBinding: Cannot parse trackName: "+s);const b={nodeName:a[2],objectName:a[3],objectIndex:a[4],propertyName:a[5],propertyIndex:a[6]},_e=b.nodeName&&b.nodeName.lastIndexOf(".");if(_e!==void 0&&_e!==-1){const Kt=b.nodeName.substring(_e+1);_supportedObjectNames.indexOf(Kt)!==-1&&(b.nodeName=b.nodeName.substring(0,_e),b.objectName=Kt)}if(b.propertyName===null||b.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+s);return b}static findNode(s,a){if(a===void 0||a===""||a==="."||a===-1||a===s.name||a===s.uuid)return s;if(s.skeleton){const b=s.skeleton.getBoneByName(a);if(b!==void 0)return b}if(s.children){const b=function(Kt){for(let an=0;an<Kt.length;an++){const _n=Kt[an];if(_n.name===a||_n.uuid===a)return _n;const On=b(_n.children);if(On)return On}return null},_e=b(s.children);if(_e)return _e}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(s,a){s[a]=this.targetObject[this.propertyName]}_getValue_array(s,a){const b=this.resolvedProperty;for(let _e=0,Kt=b.length;_e!==Kt;++_e)s[a++]=b[_e]}_getValue_arrayElement(s,a){s[a]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(s,a){this.resolvedProperty.toArray(s,a)}_setValue_direct(s,a){this.targetObject[this.propertyName]=s[a]}_setValue_direct_setNeedsUpdate(s,a){this.targetObject[this.propertyName]=s[a],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(s,a){this.targetObject[this.propertyName]=s[a],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(s,a){const b=this.resolvedProperty;for(let _e=0,Kt=b.length;_e!==Kt;++_e)b[_e]=s[a++]}_setValue_array_setNeedsUpdate(s,a){const b=this.resolvedProperty;for(let _e=0,Kt=b.length;_e!==Kt;++_e)b[_e]=s[a++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(s,a){const b=this.resolvedProperty;for(let _e=0,Kt=b.length;_e!==Kt;++_e)b[_e]=s[a++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(s,a){this.resolvedProperty[this.propertyIndex]=s[a]}_setValue_arrayElement_setNeedsUpdate(s,a){this.resolvedProperty[this.propertyIndex]=s[a],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(s,a){this.resolvedProperty[this.propertyIndex]=s[a],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(s,a){this.resolvedProperty.fromArray(s,a)}_setValue_fromArray_setNeedsUpdate(s,a){this.resolvedProperty.fromArray(s,a),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(s,a){this.resolvedProperty.fromArray(s,a),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(s,a){this.bind(),this.getValue(s,a)}_setValue_unbound(s,a){this.bind(),this.setValue(s,a)}bind(){let s=this.node;const a=this.parsedPath,b=a.objectName,_e=a.propertyName;let Kt=a.propertyIndex;if(s||(s=PropertyBinding.findNode(this.rootNode,a.nodeName),this.node=s),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!s){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(b){let $n=a.objectIndex;switch(b){case"materials":if(!s.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!s.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}s=s.material.materials;break;case"bones":if(!s.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}s=s.skeleton.bones;for(let dr=0;dr<s.length;dr++)if(s[dr].name===$n){$n=dr;break}break;case"map":if("map"in s){s=s.map;break}if(!s.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!s.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}s=s.material.map;break;default:if(s[b]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}s=s[b]}if($n!==void 0){if(s[$n]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,s);return}s=s[$n]}}const an=s[_e];if(an===void 0){const $n=a.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+$n+"."+_e+" but it wasn't found.",s);return}let _n=this.Versioning.None;this.targetObject=s,s.needsUpdate!==void 0?_n=this.Versioning.NeedsUpdate:s.matrixWorldNeedsUpdate!==void 0&&(_n=this.Versioning.MatrixWorldNeedsUpdate);let On=this.BindingType.Direct;if(Kt!==void 0){if(_e==="morphTargetInfluences"){if(!s.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!s.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}s.morphTargetDictionary[Kt]!==void 0&&(Kt=s.morphTargetDictionary[Kt])}On=this.BindingType.ArrayElement,this.resolvedProperty=an,this.propertyIndex=Kt}else an.fromArray!==void 0&&an.toArray!==void 0?(On=this.BindingType.HasFromToArray,this.resolvedProperty=an):Array.isArray(an)?(On=this.BindingType.EntireArray,this.resolvedProperty=an):this.propertyName=_e;this.getValue=this.GetterByBindingType[On],this.setValue=this.SetterByBindingTypeAndVersioning[On][_n]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}PropertyBinding.Composite=Composite;PropertyBinding.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};PropertyBinding.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};PropertyBinding.prototype.GetterByBindingType=[PropertyBinding.prototype._getValue_direct,PropertyBinding.prototype._getValue_array,PropertyBinding.prototype._getValue_arrayElement,PropertyBinding.prototype._getValue_toArray];PropertyBinding.prototype.SetterByBindingTypeAndVersioning=[[PropertyBinding.prototype._setValue_direct,PropertyBinding.prototype._setValue_direct_setNeedsUpdate,PropertyBinding.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[PropertyBinding.prototype._setValue_array,PropertyBinding.prototype._setValue_array_setNeedsUpdate,PropertyBinding.prototype._setValue_array_setMatrixWorldNeedsUpdate],[PropertyBinding.prototype._setValue_arrayElement,PropertyBinding.prototype._setValue_arrayElement_setNeedsUpdate,PropertyBinding.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[PropertyBinding.prototype._setValue_fromArray,PropertyBinding.prototype._setValue_fromArray_setNeedsUpdate,PropertyBinding.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class AnimationObjectGroup{constructor(){this.isAnimationObjectGroup=!0,this.uuid=generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const s={};this._indicesByUUID=s;for(let b=0,_e=arguments.length;b!==_e;++b)s[arguments[b].uuid]=b;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const a=this;this.stats={objects:{get total(){return a._objects.length},get inUse(){return this.total-a.nCachedObjects_}},get bindingsPerObject(){return a._bindings.length}}}add(){const s=this._objects,a=this._indicesByUUID,b=this._paths,_e=this._parsedPaths,Kt=this._bindings,an=Kt.length;let _n,On=s.length,$n=this.nCachedObjects_;for(let dr=0,fr=arguments.length;dr!==fr;++dr){const pr=arguments[dr],Ar=pr.uuid;let Or=a[Ar];if(Or===void 0){Or=On++,a[Ar]=Or,s.push(pr);for(let Xr=0,ss=an;Xr!==ss;++Xr)Kt[Xr].push(new PropertyBinding(pr,b[Xr],_e[Xr]))}else if(Or<$n){_n=s[Or];const Xr=--$n,ss=s[Xr];a[ss.uuid]=Or,s[Or]=ss,a[Ar]=Xr,s[Xr]=pr;for(let kr=0,us=an;kr!==us;++kr){const hs=Kt[kr],ds=hs[Xr];let fs=hs[Or];hs[Or]=ds,fs===void 0&&(fs=new PropertyBinding(pr,b[kr],_e[kr])),hs[Xr]=fs}}else s[Or]!==_n&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=$n}remove(){const s=this._objects,a=this._indicesByUUID,b=this._bindings,_e=b.length;let Kt=this.nCachedObjects_;for(let an=0,_n=arguments.length;an!==_n;++an){const On=arguments[an],$n=On.uuid,dr=a[$n];if(dr!==void 0&&dr>=Kt){const fr=Kt++,pr=s[fr];a[pr.uuid]=dr,s[dr]=pr,a[$n]=fr,s[fr]=On;for(let Ar=0,Or=_e;Ar!==Or;++Ar){const Xr=b[Ar],ss=Xr[fr],kr=Xr[dr];Xr[dr]=ss,Xr[fr]=kr}}}this.nCachedObjects_=Kt}uncache(){const s=this._objects,a=this._indicesByUUID,b=this._bindings,_e=b.length;let Kt=this.nCachedObjects_,an=s.length;for(let _n=0,On=arguments.length;_n!==On;++_n){const $n=arguments[_n],dr=$n.uuid,fr=a[dr];if(fr!==void 0)if(delete a[dr],fr<Kt){const pr=--Kt,Ar=s[pr],Or=--an,Xr=s[Or];a[Ar.uuid]=fr,s[fr]=Ar,a[Xr.uuid]=pr,s[pr]=Xr,s.pop();for(let ss=0,kr=_e;ss!==kr;++ss){const us=b[ss],hs=us[pr],ds=us[Or];us[fr]=hs,us[pr]=ds,us.pop()}}else{const pr=--an,Ar=s[pr];pr>0&&(a[Ar.uuid]=fr),s[fr]=Ar,s.pop();for(let Or=0,Xr=_e;Or!==Xr;++Or){const ss=b[Or];ss[fr]=ss[pr],ss.pop()}}}this.nCachedObjects_=Kt}subscribe_(s,a){const b=this._bindingsIndicesByPath;let _e=b[s];const Kt=this._bindings;if(_e!==void 0)return Kt[_e];const an=this._paths,_n=this._parsedPaths,On=this._objects,$n=On.length,dr=this.nCachedObjects_,fr=new Array($n);_e=Kt.length,b[s]=_e,an.push(s),_n.push(a),Kt.push(fr);for(let pr=dr,Ar=On.length;pr!==Ar;++pr){const Or=On[pr];fr[pr]=new PropertyBinding(Or,s,a)}return fr}unsubscribe_(s){const a=this._bindingsIndicesByPath,b=a[s];if(b!==void 0){const _e=this._paths,Kt=this._parsedPaths,an=this._bindings,_n=an.length-1,On=an[_n],$n=s[_n];a[$n]=b,an[b]=On,an.pop(),Kt[b]=Kt[_n],Kt.pop(),_e[b]=_e[_n],_e.pop()}}}class AnimationAction{constructor(s,a,b=null,_e=a.blendMode){this._mixer=s,this._clip=a,this._localRoot=b,this.blendMode=_e;const Kt=a.tracks,an=Kt.length,_n=new Array(an),On={endingStart:ZeroCurvatureEnding,endingEnd:ZeroCurvatureEnding};for(let $n=0;$n!==an;++$n){const dr=Kt[$n].createInterpolant(null);_n[$n]=dr,dr.settings=On}this._interpolantSettings=On,this._interpolants=_n,this._propertyBindings=new Array(an),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=LoopRepeat$1,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(s){return this._startTime=s,this}setLoop(s,a){return this.loop=s,this.repetitions=a,this}setEffectiveWeight(s){return this.weight=s,this._effectiveWeight=this.enabled?s:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(s){return this._scheduleFading(s,0,1)}fadeOut(s){return this._scheduleFading(s,1,0)}crossFadeFrom(s,a,b){if(s.fadeOut(a),this.fadeIn(a),b){const _e=this._clip.duration,Kt=s._clip.duration,an=Kt/_e,_n=_e/Kt;s.warp(1,an,a),this.warp(_n,1,a)}return this}crossFadeTo(s,a,b){return s.crossFadeFrom(this,a,b)}stopFading(){const s=this._weightInterpolant;return s!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(s)),this}setEffectiveTimeScale(s){return this.timeScale=s,this._effectiveTimeScale=this.paused?0:s,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(s){return this.timeScale=this._clip.duration/s,this.stopWarping()}syncWith(s){return this.time=s.time,this.timeScale=s.timeScale,this.stopWarping()}halt(s){return this.warp(this._effectiveTimeScale,0,s)}warp(s,a,b){const _e=this._mixer,Kt=_e.time,an=this.timeScale;let _n=this._timeScaleInterpolant;_n===null&&(_n=_e._lendControlInterpolant(),this._timeScaleInterpolant=_n);const On=_n.parameterPositions,$n=_n.sampleValues;return On[0]=Kt,On[1]=Kt+b,$n[0]=s/an,$n[1]=a/an,this}stopWarping(){const s=this._timeScaleInterpolant;return s!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(s)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(s,a,b,_e){if(!this.enabled){this._updateWeight(s);return}const Kt=this._startTime;if(Kt!==null){const On=(s-Kt)*b;On<0||b===0?a=0:(this._startTime=null,a=b*On)}a*=this._updateTimeScale(s);const an=this._updateTime(a),_n=this._updateWeight(s);if(_n>0){const On=this._interpolants,$n=this._propertyBindings;switch(this.blendMode){case AdditiveAnimationBlendMode:for(let dr=0,fr=On.length;dr!==fr;++dr)On[dr].evaluate(an),$n[dr].accumulateAdditive(_n);break;case NormalAnimationBlendMode:default:for(let dr=0,fr=On.length;dr!==fr;++dr)On[dr].evaluate(an),$n[dr].accumulate(_e,_n)}}}_updateWeight(s){let a=0;if(this.enabled){a=this.weight;const b=this._weightInterpolant;if(b!==null){const _e=b.evaluate(s)[0];a*=_e,s>b.parameterPositions[1]&&(this.stopFading(),_e===0&&(this.enabled=!1))}}return this._effectiveWeight=a,a}_updateTimeScale(s){let a=0;if(!this.paused){a=this.timeScale;const b=this._timeScaleInterpolant;if(b!==null){const _e=b.evaluate(s)[0];a*=_e,s>b.parameterPositions[1]&&(this.stopWarping(),a===0?this.paused=!0:this.timeScale=a)}}return this._effectiveTimeScale=a,a}_updateTime(s){const a=this._clip.duration,b=this.loop;let _e=this.time+s,Kt=this._loopCount;const an=b===LoopPingPong;if(s===0)return Kt===-1?_e:an&&(Kt&1)===1?a-_e:_e;if(b===LoopOnce$1){Kt===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(_e>=a)_e=a;else if(_e<0)_e=0;else{this.time=_e;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=_e,this._mixer.dispatchEvent({type:"finished",action:this,direction:s<0?-1:1})}}else{if(Kt===-1&&(s>=0?(Kt=0,this._setEndings(!0,this.repetitions===0,an)):this._setEndings(this.repetitions===0,!0,an)),_e>=a||_e<0){const _n=Math.floor(_e/a);_e-=a*_n,Kt+=Math.abs(_n);const On=this.repetitions-Kt;if(On<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,_e=s>0?a:0,this.time=_e,this._mixer.dispatchEvent({type:"finished",action:this,direction:s>0?1:-1});else{if(On===1){const $n=s<0;this._setEndings($n,!$n,an)}else this._setEndings(!1,!1,an);this._loopCount=Kt,this.time=_e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:_n})}}else this.time=_e;if(an&&(Kt&1)===1)return a-_e}return _e}_setEndings(s,a,b){const _e=this._interpolantSettings;b?(_e.endingStart=ZeroSlopeEnding,_e.endingEnd=ZeroSlopeEnding):(s?_e.endingStart=this.zeroSlopeAtStart?ZeroSlopeEnding:ZeroCurvatureEnding:_e.endingStart=WrapAroundEnding,a?_e.endingEnd=this.zeroSlopeAtEnd?ZeroSlopeEnding:ZeroCurvatureEnding:_e.endingEnd=WrapAroundEnding)}_scheduleFading(s,a,b){const _e=this._mixer,Kt=_e.time;let an=this._weightInterpolant;an===null&&(an=_e._lendControlInterpolant(),this._weightInterpolant=an);const _n=an.parameterPositions,On=an.sampleValues;return _n[0]=Kt,On[0]=a,_n[1]=Kt+s,On[1]=b,this}}const _controlInterpolantsResultBuffer=new Float32Array(1);class AnimationMixer extends EventDispatcher$2{constructor(s){super(),this._root=s,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(s,a){const b=s._localRoot||this._root,_e=s._clip.tracks,Kt=_e.length,an=s._propertyBindings,_n=s._interpolants,On=b.uuid,$n=this._bindingsByRootAndName;let dr=$n[On];dr===void 0&&(dr={},$n[On]=dr);for(let fr=0;fr!==Kt;++fr){const pr=_e[fr],Ar=pr.name;let Or=dr[Ar];if(Or!==void 0)++Or.referenceCount,an[fr]=Or;else{if(Or=an[fr],Or!==void 0){Or._cacheIndex===null&&(++Or.referenceCount,this._addInactiveBinding(Or,On,Ar));continue}const Xr=a&&a._propertyBindings[fr].binding.parsedPath;Or=new PropertyMixer(PropertyBinding.create(b,Ar,Xr),pr.ValueTypeName,pr.getValueSize()),++Or.referenceCount,this._addInactiveBinding(Or,On,Ar),an[fr]=Or}_n[fr].resultBuffer=Or.buffer}}_activateAction(s){if(!this._isActiveAction(s)){if(s._cacheIndex===null){const b=(s._localRoot||this._root).uuid,_e=s._clip.uuid,Kt=this._actionsByClip[_e];this._bindAction(s,Kt&&Kt.knownActions[0]),this._addInactiveAction(s,_e,b)}const a=s._propertyBindings;for(let b=0,_e=a.length;b!==_e;++b){const Kt=a[b];Kt.useCount++===0&&(this._lendBinding(Kt),Kt.saveOriginalState())}this._lendAction(s)}}_deactivateAction(s){if(this._isActiveAction(s)){const a=s._propertyBindings;for(let b=0,_e=a.length;b!==_e;++b){const Kt=a[b];--Kt.useCount===0&&(Kt.restoreOriginalState(),this._takeBackBinding(Kt))}this._takeBackAction(s)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const s=this;this.stats={actions:{get total(){return s._actions.length},get inUse(){return s._nActiveActions}},bindings:{get total(){return s._bindings.length},get inUse(){return s._nActiveBindings}},controlInterpolants:{get total(){return s._controlInterpolants.length},get inUse(){return s._nActiveControlInterpolants}}}}_isActiveAction(s){const a=s._cacheIndex;return a!==null&&a<this._nActiveActions}_addInactiveAction(s,a,b){const _e=this._actions,Kt=this._actionsByClip;let an=Kt[a];if(an===void 0)an={knownActions:[s],actionByRoot:{}},s._byClipCacheIndex=0,Kt[a]=an;else{const _n=an.knownActions;s._byClipCacheIndex=_n.length,_n.push(s)}s._cacheIndex=_e.length,_e.push(s),an.actionByRoot[b]=s}_removeInactiveAction(s){const a=this._actions,b=a[a.length-1],_e=s._cacheIndex;b._cacheIndex=_e,a[_e]=b,a.pop(),s._cacheIndex=null;const Kt=s._clip.uuid,an=this._actionsByClip,_n=an[Kt],On=_n.knownActions,$n=On[On.length-1],dr=s._byClipCacheIndex;$n._byClipCacheIndex=dr,On[dr]=$n,On.pop(),s._byClipCacheIndex=null;const fr=_n.actionByRoot,pr=(s._localRoot||this._root).uuid;delete fr[pr],On.length===0&&delete an[Kt],this._removeInactiveBindingsForAction(s)}_removeInactiveBindingsForAction(s){const a=s._propertyBindings;for(let b=0,_e=a.length;b!==_e;++b){const Kt=a[b];--Kt.referenceCount===0&&this._removeInactiveBinding(Kt)}}_lendAction(s){const a=this._actions,b=s._cacheIndex,_e=this._nActiveActions++,Kt=a[_e];s._cacheIndex=_e,a[_e]=s,Kt._cacheIndex=b,a[b]=Kt}_takeBackAction(s){const a=this._actions,b=s._cacheIndex,_e=--this._nActiveActions,Kt=a[_e];s._cacheIndex=_e,a[_e]=s,Kt._cacheIndex=b,a[b]=Kt}_addInactiveBinding(s,a,b){const _e=this._bindingsByRootAndName,Kt=this._bindings;let an=_e[a];an===void 0&&(an={},_e[a]=an),an[b]=s,s._cacheIndex=Kt.length,Kt.push(s)}_removeInactiveBinding(s){const a=this._bindings,b=s.binding,_e=b.rootNode.uuid,Kt=b.path,an=this._bindingsByRootAndName,_n=an[_e],On=a[a.length-1],$n=s._cacheIndex;On._cacheIndex=$n,a[$n]=On,a.pop(),delete _n[Kt],Object.keys(_n).length===0&&delete an[_e]}_lendBinding(s){const a=this._bindings,b=s._cacheIndex,_e=this._nActiveBindings++,Kt=a[_e];s._cacheIndex=_e,a[_e]=s,Kt._cacheIndex=b,a[b]=Kt}_takeBackBinding(s){const a=this._bindings,b=s._cacheIndex,_e=--this._nActiveBindings,Kt=a[_e];s._cacheIndex=_e,a[_e]=s,Kt._cacheIndex=b,a[b]=Kt}_lendControlInterpolant(){const s=this._controlInterpolants,a=this._nActiveControlInterpolants++;let b=s[a];return b===void 0&&(b=new LinearInterpolant(new Float32Array(2),new Float32Array(2),1,_controlInterpolantsResultBuffer),b.__cacheIndex=a,s[a]=b),b}_takeBackControlInterpolant(s){const a=this._controlInterpolants,b=s.__cacheIndex,_e=--this._nActiveControlInterpolants,Kt=a[_e];s.__cacheIndex=_e,a[_e]=s,Kt.__cacheIndex=b,a[b]=Kt}clipAction(s,a,b){const _e=a||this._root,Kt=_e.uuid;let an=typeof s=="string"?AnimationClip.findByName(_e,s):s;const _n=an!==null?an.uuid:s,On=this._actionsByClip[_n];let $n=null;if(b===void 0&&(an!==null?b=an.blendMode:b=NormalAnimationBlendMode),On!==void 0){const fr=On.actionByRoot[Kt];if(fr!==void 0&&fr.blendMode===b)return fr;$n=On.knownActions[0],an===null&&(an=$n._clip)}if(an===null)return null;const dr=new AnimationAction(this,an,a,b);return this._bindAction(dr,$n),this._addInactiveAction(dr,_n,Kt),dr}existingAction(s,a){const b=a||this._root,_e=b.uuid,Kt=typeof s=="string"?AnimationClip.findByName(b,s):s,an=Kt?Kt.uuid:s,_n=this._actionsByClip[an];return _n!==void 0&&_n.actionByRoot[_e]||null}stopAllAction(){const s=this._actions,a=this._nActiveActions;for(let b=a-1;b>=0;--b)s[b].stop();return this}update(s){s*=this.timeScale;const a=this._actions,b=this._nActiveActions,_e=this.time+=s,Kt=Math.sign(s),an=this._accuIndex^=1;for(let $n=0;$n!==b;++$n)a[$n]._update(_e,s,Kt,an);const _n=this._bindings,On=this._nActiveBindings;for(let $n=0;$n!==On;++$n)_n[$n].apply(an);return this}setTime(s){this.time=0;for(let a=0;a<this._actions.length;a++)this._actions[a].time=0;return this.update(s)}getRoot(){return this._root}uncacheClip(s){const a=this._actions,b=s.uuid,_e=this._actionsByClip,Kt=_e[b];if(Kt!==void 0){const an=Kt.knownActions;for(let _n=0,On=an.length;_n!==On;++_n){const $n=an[_n];this._deactivateAction($n);const dr=$n._cacheIndex,fr=a[a.length-1];$n._cacheIndex=null,$n._byClipCacheIndex=null,fr._cacheIndex=dr,a[dr]=fr,a.pop(),this._removeInactiveBindingsForAction($n)}delete _e[b]}}uncacheRoot(s){const a=s.uuid,b=this._actionsByClip;for(const an in b){const _n=b[an].actionByRoot,On=_n[a];On!==void 0&&(this._deactivateAction(On),this._removeInactiveAction(On))}const _e=this._bindingsByRootAndName,Kt=_e[a];if(Kt!==void 0)for(const an in Kt){const _n=Kt[an];_n.restoreOriginalState(),this._removeInactiveBinding(_n)}}uncacheAction(s,a){const b=this.existingAction(s,a);b!==null&&(this._deactivateAction(b),this._removeInactiveAction(b))}}class Uniform{constructor(s){this.value=s}clone(){return new Uniform(this.value.clone===void 0?this.value:this.value.clone())}}let _id=0;class UniformsGroup extends EventDispatcher$2{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:_id++}),this.name="",this.usage=StaticDrawUsage,this.uniforms=[]}add(s){return this.uniforms.push(s),this}remove(s){const a=this.uniforms.indexOf(s);return a!==-1&&this.uniforms.splice(a,1),this}setName(s){return this.name=s,this}setUsage(s){return this.usage=s,this}dispose(){return this.dispatchEvent({type:"dispose"}),this}copy(s){this.name=s.name,this.usage=s.usage;const a=s.uniforms;this.uniforms.length=0;for(let b=0,_e=a.length;b<_e;b++){const Kt=Array.isArray(a[b])?a[b]:[a[b]];for(let an=0;an<Kt.length;an++)this.uniforms.push(Kt[an].clone())}return this}clone(){return new this.constructor().copy(this)}}class InstancedInterleavedBuffer extends InterleavedBuffer{constructor(s,a,b=1){super(s,a),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=b}copy(s){return super.copy(s),this.meshPerAttribute=s.meshPerAttribute,this}clone(s){const a=super.clone(s);return a.meshPerAttribute=this.meshPerAttribute,a}toJSON(s){const a=super.toJSON(s);return a.isInstancedInterleavedBuffer=!0,a.meshPerAttribute=this.meshPerAttribute,a}}class GLBufferAttribute{constructor(s,a,b,_e,Kt){this.isGLBufferAttribute=!0,this.name="",this.buffer=s,this.type=a,this.itemSize=b,this.elementSize=_e,this.count=Kt,this.version=0}set needsUpdate(s){s===!0&&this.version++}setBuffer(s){return this.buffer=s,this}setType(s,a){return this.type=s,this.elementSize=a,this}setItemSize(s){return this.itemSize=s,this}setCount(s){return this.count=s,this}}const _matrix=new Matrix4;class Raycaster{constructor(s,a,b=0,_e=1/0){this.ray=new Ray(s,a),this.near=b,this.far=_e,this.camera=null,this.layers=new Layers,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(s,a){this.ray.set(s,a)}setFromCamera(s,a){a.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(a.matrixWorld),this.ray.direction.set(s.x,s.y,.5).unproject(a).sub(this.ray.origin).normalize(),this.camera=a):a.isOrthographicCamera?(this.ray.origin.set(s.x,s.y,(a.near+a.far)/(a.near-a.far)).unproject(a),this.ray.direction.set(0,0,-1).transformDirection(a.matrixWorld),this.camera=a):console.error("THREE.Raycaster: Unsupported camera type: "+a.type)}setFromXRController(s){return _matrix.identity().extractRotation(s.matrixWorld),this.ray.origin.setFromMatrixPosition(s.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(_matrix),this}intersectObject(s,a=!0,b=[]){return intersect(s,this,b,a),b.sort(ascSort),b}intersectObjects(s,a=!0,b=[]){for(let _e=0,Kt=s.length;_e<Kt;_e++)intersect(s[_e],this,b,a);return b.sort(ascSort),b}}function ascSort(o,s){return o.distance-s.distance}function intersect(o,s,a,b){if(o.layers.test(s.layers)&&o.raycast(s,a),b===!0){const _e=o.children;for(let Kt=0,an=_e.length;Kt<an;Kt++)intersect(_e[Kt],s,a,!0)}}class Spherical{constructor(s=1,a=0,b=0){return this.radius=s,this.phi=a,this.theta=b,this}set(s,a,b){return this.radius=s,this.phi=a,this.theta=b,this}copy(s){return this.radius=s.radius,this.phi=s.phi,this.theta=s.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(s){return this.setFromCartesianCoords(s.x,s.y,s.z)}setFromCartesianCoords(s,a,b){return this.radius=Math.sqrt(s*s+a*a+b*b),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(s,b),this.phi=Math.acos(clamp$2(a/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class Cylindrical{constructor(s=1,a=0,b=0){return this.radius=s,this.theta=a,this.y=b,this}set(s,a,b){return this.radius=s,this.theta=a,this.y=b,this}copy(s){return this.radius=s.radius,this.theta=s.theta,this.y=s.y,this}setFromVector3(s){return this.setFromCartesianCoords(s.x,s.y,s.z)}setFromCartesianCoords(s,a,b){return this.radius=Math.sqrt(s*s+b*b),this.theta=Math.atan2(s,b),this.y=a,this}clone(){return new this.constructor().copy(this)}}const _vector$4=new Vector2;class Box2{constructor(s=new Vector2(1/0,1/0),a=new Vector2(-1/0,-1/0)){this.isBox2=!0,this.min=s,this.max=a}set(s,a){return this.min.copy(s),this.max.copy(a),this}setFromPoints(s){this.makeEmpty();for(let a=0,b=s.length;a<b;a++)this.expandByPoint(s[a]);return this}setFromCenterAndSize(s,a){const b=_vector$4.copy(a).multiplyScalar(.5);return this.min.copy(s).sub(b),this.max.copy(s).add(b),this}clone(){return new this.constructor().copy(this)}copy(s){return this.min.copy(s.min),this.max.copy(s.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(s){return this.isEmpty()?s.set(0,0):s.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(s){return this.isEmpty()?s.set(0,0):s.subVectors(this.max,this.min)}expandByPoint(s){return this.min.min(s),this.max.max(s),this}expandByVector(s){return this.min.sub(s),this.max.add(s),this}expandByScalar(s){return this.min.addScalar(-s),this.max.addScalar(s),this}containsPoint(s){return!(s.x<this.min.x||s.x>this.max.x||s.y<this.min.y||s.y>this.max.y)}containsBox(s){return this.min.x<=s.min.x&&s.max.x<=this.max.x&&this.min.y<=s.min.y&&s.max.y<=this.max.y}getParameter(s,a){return a.set((s.x-this.min.x)/(this.max.x-this.min.x),(s.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(s){return!(s.max.x<this.min.x||s.min.x>this.max.x||s.max.y<this.min.y||s.min.y>this.max.y)}clampPoint(s,a){return a.copy(s).clamp(this.min,this.max)}distanceToPoint(s){return this.clampPoint(s,_vector$4).distanceTo(s)}intersect(s){return this.min.max(s.min),this.max.min(s.max),this.isEmpty()&&this.makeEmpty(),this}union(s){return this.min.min(s.min),this.max.max(s.max),this}translate(s){return this.min.add(s),this.max.add(s),this}equals(s){return s.min.equals(this.min)&&s.max.equals(this.max)}}const _startP=new Vector3,_startEnd=new Vector3;class Line3{constructor(s=new Vector3,a=new Vector3){this.start=s,this.end=a}set(s,a){return this.start.copy(s),this.end.copy(a),this}copy(s){return this.start.copy(s.start),this.end.copy(s.end),this}getCenter(s){return s.addVectors(this.start,this.end).multiplyScalar(.5)}delta(s){return s.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(s,a){return this.delta(a).multiplyScalar(s).add(this.start)}closestPointToPointParameter(s,a){_startP.subVectors(s,this.start),_startEnd.subVectors(this.end,this.start);const b=_startEnd.dot(_startEnd);let Kt=_startEnd.dot(_startP)/b;return a&&(Kt=clamp$2(Kt,0,1)),Kt}closestPointToPoint(s,a,b){const _e=this.closestPointToPointParameter(s,a);return this.delta(b).multiplyScalar(_e).add(this.start)}applyMatrix4(s){return this.start.applyMatrix4(s),this.end.applyMatrix4(s),this}equals(s){return s.start.equals(this.start)&&s.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const _vector$3=new Vector3;class SpotLightHelper extends Object3D{constructor(s,a){super(),this.light=s,this.matrixAutoUpdate=!1,this.color=a,this.type="SpotLightHelper";const b=new BufferGeometry,_e=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let an=0,_n=1,On=32;an<On;an++,_n++){const $n=an/On*Math.PI*2,dr=_n/On*Math.PI*2;_e.push(Math.cos($n),Math.sin($n),1,Math.cos(dr),Math.sin(dr),1)}b.setAttribute("position",new Float32BufferAttribute(_e,3));const Kt=new LineBasicMaterial({fog:!1,toneMapped:!1});this.cone=new LineSegments(b,Kt),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);const s=this.light.distance?this.light.distance:1e3,a=s*Math.tan(this.light.angle);this.cone.scale.set(a,a,s),_vector$3.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(_vector$3),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const _vector$2=new Vector3,_boneMatrix=new Matrix4,_matrixWorldInv=new Matrix4;class SkeletonHelper extends LineSegments{constructor(s){const a=getBoneList(s),b=new BufferGeometry,_e=[],Kt=[],an=new Color$1(0,0,1),_n=new Color$1(0,1,0);for(let $n=0;$n<a.length;$n++){const dr=a[$n];dr.parent&&dr.parent.isBone&&(_e.push(0,0,0),_e.push(0,0,0),Kt.push(an.r,an.g,an.b),Kt.push(_n.r,_n.g,_n.b))}b.setAttribute("position",new Float32BufferAttribute(_e,3)),b.setAttribute("color",new Float32BufferAttribute(Kt,3));const On=new LineBasicMaterial({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(b,On),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=s,this.bones=a,this.matrix=s.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(s){const a=this.bones,b=this.geometry,_e=b.getAttribute("position");_matrixWorldInv.copy(this.root.matrixWorld).invert();for(let Kt=0,an=0;Kt<a.length;Kt++){const _n=a[Kt];_n.parent&&_n.parent.isBone&&(_boneMatrix.multiplyMatrices(_matrixWorldInv,_n.matrixWorld),_vector$2.setFromMatrixPosition(_boneMatrix),_e.setXYZ(an,_vector$2.x,_vector$2.y,_vector$2.z),_boneMatrix.multiplyMatrices(_matrixWorldInv,_n.parent.matrixWorld),_vector$2.setFromMatrixPosition(_boneMatrix),_e.setXYZ(an+1,_vector$2.x,_vector$2.y,_vector$2.z),an+=2)}b.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(s)}dispose(){this.geometry.dispose(),this.material.dispose()}}function getBoneList(o){const s=[];o.isBone===!0&&s.push(o);for(let a=0;a<o.children.length;a++)s.push.apply(s,getBoneList(o.children[a]));return s}class PointLightHelper extends Mesh{constructor(s,a,b){const _e=new SphereGeometry(a,4,2),Kt=new MeshBasicMaterial({wireframe:!0,fog:!1,toneMapped:!1});super(_e,Kt),this.light=s,this.color=b,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const _vector$1=new Vector3,_color1=new Color$1,_color2=new Color$1;class HemisphereLightHelper extends Object3D{constructor(s,a,b){super(),this.light=s,this.matrix=s.matrixWorld,this.matrixAutoUpdate=!1,this.color=b,this.type="HemisphereLightHelper";const _e=new OctahedronGeometry(a);_e.rotateY(Math.PI*.5),this.material=new MeshBasicMaterial({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const Kt=_e.getAttribute("position"),an=new Float32Array(Kt.count*3);_e.setAttribute("color",new BufferAttribute(an,3)),this.add(new Mesh(_e,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const s=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const a=s.geometry.getAttribute("color");_color1.copy(this.light.color),_color2.copy(this.light.groundColor);for(let b=0,_e=a.count;b<_e;b++){const Kt=b<_e/2?_color1:_color2;a.setXYZ(b,Kt.r,Kt.g,Kt.b)}a.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),s.lookAt(_vector$1.setFromMatrixPosition(this.light.matrixWorld).negate())}}class GridHelper extends LineSegments{constructor(s=10,a=10,b=4473924,_e=8947848){b=new Color$1(b),_e=new Color$1(_e);const Kt=a/2,an=s/a,_n=s/2,On=[],$n=[];for(let pr=0,Ar=0,Or=-_n;pr<=a;pr++,Or+=an){On.push(-_n,0,Or,_n,0,Or),On.push(Or,0,-_n,Or,0,_n);const Xr=pr===Kt?b:_e;Xr.toArray($n,Ar),Ar+=3,Xr.toArray($n,Ar),Ar+=3,Xr.toArray($n,Ar),Ar+=3,Xr.toArray($n,Ar),Ar+=3}const dr=new BufferGeometry;dr.setAttribute("position",new Float32BufferAttribute(On,3)),dr.setAttribute("color",new Float32BufferAttribute($n,3));const fr=new LineBasicMaterial({vertexColors:!0,toneMapped:!1});super(dr,fr),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class PolarGridHelper extends LineSegments{constructor(s=10,a=16,b=8,_e=64,Kt=4473924,an=8947848){Kt=new Color$1(Kt),an=new Color$1(an);const _n=[],On=[];if(a>1)for(let fr=0;fr<a;fr++){const pr=fr/a*(Math.PI*2),Ar=Math.sin(pr)*s,Or=Math.cos(pr)*s;_n.push(0,0,0),_n.push(Ar,0,Or);const Xr=fr&1?Kt:an;On.push(Xr.r,Xr.g,Xr.b),On.push(Xr.r,Xr.g,Xr.b)}for(let fr=0;fr<b;fr++){const pr=fr&1?Kt:an,Ar=s-s/b*fr;for(let Or=0;Or<_e;Or++){let Xr=Or/_e*(Math.PI*2),ss=Math.sin(Xr)*Ar,kr=Math.cos(Xr)*Ar;_n.push(ss,0,kr),On.push(pr.r,pr.g,pr.b),Xr=(Or+1)/_e*(Math.PI*2),ss=Math.sin(Xr)*Ar,kr=Math.cos(Xr)*Ar,_n.push(ss,0,kr),On.push(pr.r,pr.g,pr.b)}}const $n=new BufferGeometry;$n.setAttribute("position",new Float32BufferAttribute(_n,3)),$n.setAttribute("color",new Float32BufferAttribute(On,3));const dr=new LineBasicMaterial({vertexColors:!0,toneMapped:!1});super($n,dr),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const _v1=new Vector3,_v2$5=new Vector3,_v3=new Vector3;class DirectionalLightHelper extends Object3D{constructor(s,a,b){super(),this.light=s,this.matrix=s.matrixWorld,this.matrixAutoUpdate=!1,this.color=b,this.type="DirectionalLightHelper",a===void 0&&(a=1);let _e=new BufferGeometry;_e.setAttribute("position",new Float32BufferAttribute([-a,a,0,a,a,0,a,-a,0,-a,-a,0,-a,a,0],3));const Kt=new LineBasicMaterial({fog:!1,toneMapped:!1});this.lightPlane=new Line(_e,Kt),this.add(this.lightPlane),_e=new BufferGeometry,_e.setAttribute("position",new Float32BufferAttribute([0,0,0,0,0,1],3)),this.targetLine=new Line(_e,Kt),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),_v1.setFromMatrixPosition(this.light.matrixWorld),_v2$5.setFromMatrixPosition(this.light.target.matrixWorld),_v3.subVectors(_v2$5,_v1),this.lightPlane.lookAt(_v2$5),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(_v2$5),this.targetLine.scale.z=_v3.length()}}const _vector=new Vector3,_camera=new Camera;class CameraHelper extends LineSegments{constructor(s){const a=new BufferGeometry,b=new LineBasicMaterial({color:16777215,vertexColors:!0,toneMapped:!1}),_e=[],Kt=[],an={};_n("n1","n2"),_n("n2","n4"),_n("n4","n3"),_n("n3","n1"),_n("f1","f2"),_n("f2","f4"),_n("f4","f3"),_n("f3","f1"),_n("n1","f1"),_n("n2","f2"),_n("n3","f3"),_n("n4","f4"),_n("p","n1"),_n("p","n2"),_n("p","n3"),_n("p","n4"),_n("u1","u2"),_n("u2","u3"),_n("u3","u1"),_n("c","t"),_n("p","c"),_n("cn1","cn2"),_n("cn3","cn4"),_n("cf1","cf2"),_n("cf3","cf4");function _n(Or,Xr){On(Or),On(Xr)}function On(Or){_e.push(0,0,0),Kt.push(0,0,0),an[Or]===void 0&&(an[Or]=[]),an[Or].push(_e.length/3-1)}a.setAttribute("position",new Float32BufferAttribute(_e,3)),a.setAttribute("color",new Float32BufferAttribute(Kt,3)),super(a,b),this.type="CameraHelper",this.camera=s,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=s.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=an,this.update();const $n=new Color$1(16755200),dr=new Color$1(16711680),fr=new Color$1(43775),pr=new Color$1(16777215),Ar=new Color$1(3355443);this.setColors($n,dr,fr,pr,Ar)}setColors(s,a,b,_e,Kt){const _n=this.geometry.getAttribute("color");_n.setXYZ(0,s.r,s.g,s.b),_n.setXYZ(1,s.r,s.g,s.b),_n.setXYZ(2,s.r,s.g,s.b),_n.setXYZ(3,s.r,s.g,s.b),_n.setXYZ(4,s.r,s.g,s.b),_n.setXYZ(5,s.r,s.g,s.b),_n.setXYZ(6,s.r,s.g,s.b),_n.setXYZ(7,s.r,s.g,s.b),_n.setXYZ(8,s.r,s.g,s.b),_n.setXYZ(9,s.r,s.g,s.b),_n.setXYZ(10,s.r,s.g,s.b),_n.setXYZ(11,s.r,s.g,s.b),_n.setXYZ(12,s.r,s.g,s.b),_n.setXYZ(13,s.r,s.g,s.b),_n.setXYZ(14,s.r,s.g,s.b),_n.setXYZ(15,s.r,s.g,s.b),_n.setXYZ(16,s.r,s.g,s.b),_n.setXYZ(17,s.r,s.g,s.b),_n.setXYZ(18,s.r,s.g,s.b),_n.setXYZ(19,s.r,s.g,s.b),_n.setXYZ(20,s.r,s.g,s.b),_n.setXYZ(21,s.r,s.g,s.b),_n.setXYZ(22,s.r,s.g,s.b),_n.setXYZ(23,s.r,s.g,s.b),_n.setXYZ(24,a.r,a.g,a.b),_n.setXYZ(25,a.r,a.g,a.b),_n.setXYZ(26,a.r,a.g,a.b),_n.setXYZ(27,a.r,a.g,a.b),_n.setXYZ(28,a.r,a.g,a.b),_n.setXYZ(29,a.r,a.g,a.b),_n.setXYZ(30,a.r,a.g,a.b),_n.setXYZ(31,a.r,a.g,a.b),_n.setXYZ(32,b.r,b.g,b.b),_n.setXYZ(33,b.r,b.g,b.b),_n.setXYZ(34,b.r,b.g,b.b),_n.setXYZ(35,b.r,b.g,b.b),_n.setXYZ(36,b.r,b.g,b.b),_n.setXYZ(37,b.r,b.g,b.b),_n.setXYZ(38,_e.r,_e.g,_e.b),_n.setXYZ(39,_e.r,_e.g,_e.b),_n.setXYZ(40,Kt.r,Kt.g,Kt.b),_n.setXYZ(41,Kt.r,Kt.g,Kt.b),_n.setXYZ(42,Kt.r,Kt.g,Kt.b),_n.setXYZ(43,Kt.r,Kt.g,Kt.b),_n.setXYZ(44,Kt.r,Kt.g,Kt.b),_n.setXYZ(45,Kt.r,Kt.g,Kt.b),_n.setXYZ(46,Kt.r,Kt.g,Kt.b),_n.setXYZ(47,Kt.r,Kt.g,Kt.b),_n.setXYZ(48,Kt.r,Kt.g,Kt.b),_n.setXYZ(49,Kt.r,Kt.g,Kt.b),_n.needsUpdate=!0}update(){const s=this.geometry,a=this.pointMap,b=1,_e=1;_camera.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),setPoint("c",a,s,_camera,0,0,-1),setPoint("t",a,s,_camera,0,0,1),setPoint("n1",a,s,_camera,-b,-_e,-1),setPoint("n2",a,s,_camera,b,-_e,-1),setPoint("n3",a,s,_camera,-b,_e,-1),setPoint("n4",a,s,_camera,b,_e,-1),setPoint("f1",a,s,_camera,-b,-_e,1),setPoint("f2",a,s,_camera,b,-_e,1),setPoint("f3",a,s,_camera,-b,_e,1),setPoint("f4",a,s,_camera,b,_e,1),setPoint("u1",a,s,_camera,b*.7,_e*1.1,-1),setPoint("u2",a,s,_camera,-b*.7,_e*1.1,-1),setPoint("u3",a,s,_camera,0,_e*2,-1),setPoint("cf1",a,s,_camera,-b,0,1),setPoint("cf2",a,s,_camera,b,0,1),setPoint("cf3",a,s,_camera,0,-_e,1),setPoint("cf4",a,s,_camera,0,_e,1),setPoint("cn1",a,s,_camera,-b,0,-1),setPoint("cn2",a,s,_camera,b,0,-1),setPoint("cn3",a,s,_camera,0,-_e,-1),setPoint("cn4",a,s,_camera,0,_e,-1),s.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function setPoint(o,s,a,b,_e,Kt,an){_vector.set(_e,Kt,an).unproject(b);const _n=s[o];if(_n!==void 0){const On=a.getAttribute("position");for(let $n=0,dr=_n.length;$n<dr;$n++)On.setXYZ(_n[$n],_vector.x,_vector.y,_vector.z)}}const _box=new Box3;class BoxHelper extends LineSegments{constructor(s,a=16776960){const b=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),_e=new Float32Array(8*3),Kt=new BufferGeometry;Kt.setIndex(new BufferAttribute(b,1)),Kt.setAttribute("position",new BufferAttribute(_e,3)),super(Kt,new LineBasicMaterial({color:a,toneMapped:!1})),this.object=s,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(s){if(s!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&_box.setFromObject(this.object),_box.isEmpty())return;const a=_box.min,b=_box.max,_e=this.geometry.attributes.position,Kt=_e.array;Kt[0]=b.x,Kt[1]=b.y,Kt[2]=b.z,Kt[3]=a.x,Kt[4]=b.y,Kt[5]=b.z,Kt[6]=a.x,Kt[7]=a.y,Kt[8]=b.z,Kt[9]=b.x,Kt[10]=a.y,Kt[11]=b.z,Kt[12]=b.x,Kt[13]=b.y,Kt[14]=a.z,Kt[15]=a.x,Kt[16]=b.y,Kt[17]=a.z,Kt[18]=a.x,Kt[19]=a.y,Kt[20]=a.z,Kt[21]=b.x,Kt[22]=a.y,Kt[23]=a.z,_e.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(s){return this.object=s,this.update(),this}copy(s,a){return super.copy(s,a),this.object=s.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Box3Helper extends LineSegments{constructor(s,a=16776960){const b=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),_e=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],Kt=new BufferGeometry;Kt.setIndex(new BufferAttribute(b,1)),Kt.setAttribute("position",new Float32BufferAttribute(_e,3)),super(Kt,new LineBasicMaterial({color:a,toneMapped:!1})),this.box=s,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(s){const a=this.box;a.isEmpty()||(a.getCenter(this.position),a.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(s))}dispose(){this.geometry.dispose(),this.material.dispose()}}class PlaneHelper extends Line{constructor(s,a=1,b=16776960){const _e=b,Kt=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],an=new BufferGeometry;an.setAttribute("position",new Float32BufferAttribute(Kt,3)),an.computeBoundingSphere(),super(an,new LineBasicMaterial({color:_e,toneMapped:!1})),this.type="PlaneHelper",this.plane=s,this.size=a;const _n=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],On=new BufferGeometry;On.setAttribute("position",new Float32BufferAttribute(_n,3)),On.computeBoundingSphere(),this.add(new Mesh(On,new MeshBasicMaterial({color:_e,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(s){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(s)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const _axis=new Vector3;let _lineGeometry,_coneGeometry;class ArrowHelper extends Object3D{constructor(s=new Vector3(0,0,1),a=new Vector3(0,0,0),b=1,_e=16776960,Kt=b*.2,an=Kt*.2){super(),this.type="ArrowHelper",_lineGeometry===void 0&&(_lineGeometry=new BufferGeometry,_lineGeometry.setAttribute("position",new Float32BufferAttribute([0,0,0,0,1,0],3)),_coneGeometry=new CylinderGeometry(0,.5,1,5,1),_coneGeometry.translate(0,-.5,0)),this.position.copy(a),this.line=new Line(_lineGeometry,new LineBasicMaterial({color:_e,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Mesh(_coneGeometry,new MeshBasicMaterial({color:_e,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(s),this.setLength(b,Kt,an)}setDirection(s){if(s.y>.99999)this.quaternion.set(0,0,0,1);else if(s.y<-.99999)this.quaternion.set(1,0,0,0);else{_axis.set(s.z,0,-s.x).normalize();const a=Math.acos(s.y);this.quaternion.setFromAxisAngle(_axis,a)}}setLength(s,a=s*.2,b=a*.2){this.line.scale.set(1,Math.max(1e-4,s-a),1),this.line.updateMatrix(),this.cone.scale.set(b,a,b),this.cone.position.y=s,this.cone.updateMatrix()}setColor(s){this.line.material.color.set(s),this.cone.material.color.set(s)}copy(s){return super.copy(s,!1),this.line.copy(s.line),this.cone.copy(s.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class AxesHelper extends LineSegments{constructor(s=1){const a=[0,0,0,s,0,0,0,0,0,0,s,0,0,0,0,0,0,s],b=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],_e=new BufferGeometry;_e.setAttribute("position",new Float32BufferAttribute(a,3)),_e.setAttribute("color",new Float32BufferAttribute(b,3));const Kt=new LineBasicMaterial({vertexColors:!0,toneMapped:!1});super(_e,Kt),this.type="AxesHelper"}setColors(s,a,b){const _e=new Color$1,Kt=this.geometry.attributes.color.array;return _e.set(s),_e.toArray(Kt,0),_e.toArray(Kt,3),_e.set(a),_e.toArray(Kt,6),_e.toArray(Kt,9),_e.set(b),_e.toArray(Kt,12),_e.toArray(Kt,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class ShapePath{constructor(){this.type="ShapePath",this.color=new Color$1,this.subPaths=[],this.currentPath=null}moveTo(s,a){return this.currentPath=new Path,this.subPaths.push(this.currentPath),this.currentPath.moveTo(s,a),this}lineTo(s,a){return this.currentPath.lineTo(s,a),this}quadraticCurveTo(s,a,b,_e){return this.currentPath.quadraticCurveTo(s,a,b,_e),this}bezierCurveTo(s,a,b,_e,Kt,an){return this.currentPath.bezierCurveTo(s,a,b,_e,Kt,an),this}splineThru(s){return this.currentPath.splineThru(s),this}toShapes(s){function a(kr){const us=[];for(let hs=0,ds=kr.length;hs<ds;hs++){const fs=kr[hs],Gs=new Shape;Gs.curves=fs.curves,us.push(Gs)}return us}function b(kr,us){const hs=us.length;let ds=!1;for(let fs=hs-1,Gs=0;Gs<hs;fs=Gs++){let ga=us[fs],So=us[Gs],go=So.x-ga.x,xo=So.y-ga.y;if(Math.abs(xo)>Number.EPSILON){if(xo<0&&(ga=us[Gs],go=-go,So=us[fs],xo=-xo),kr.y<ga.y||kr.y>So.y)continue;if(kr.y===ga.y){if(kr.x===ga.x)return!0}else{const Mo=xo*(kr.x-ga.x)-go*(kr.y-ga.y);if(Mo===0)return!0;if(Mo<0)continue;ds=!ds}}else{if(kr.y!==ga.y)continue;if(So.x<=kr.x&&kr.x<=ga.x||ga.x<=kr.x&&kr.x<=So.x)return!0}}return ds}const _e=ShapeUtils.isClockWise,Kt=this.subPaths;if(Kt.length===0)return[];let an,_n,On;const $n=[];if(Kt.length===1)return _n=Kt[0],On=new Shape,On.curves=_n.curves,$n.push(On),$n;let dr=!_e(Kt[0].getPoints());dr=s?!dr:dr;const fr=[],pr=[];let Ar=[],Or=0,Xr;pr[Or]=void 0,Ar[Or]=[];for(let kr=0,us=Kt.length;kr<us;kr++)_n=Kt[kr],Xr=_n.getPoints(),an=_e(Xr),an=s?!an:an,an?(!dr&&pr[Or]&&Or++,pr[Or]={s:new Shape,p:Xr},pr[Or].s.curves=_n.curves,dr&&Or++,Ar[Or]=[]):Ar[Or].push({h:_n,p:Xr[0]});if(!pr[0])return a(Kt);if(pr.length>1){let kr=!1,us=0;for(let hs=0,ds=pr.length;hs<ds;hs++)fr[hs]=[];for(let hs=0,ds=pr.length;hs<ds;hs++){const fs=Ar[hs];for(let Gs=0;Gs<fs.length;Gs++){const ga=fs[Gs];let So=!0;for(let go=0;go<pr.length;go++)b(ga.p,pr[go].p)&&(hs!==go&&us++,So?(So=!1,fr[go].push(ga)):kr=!0);So&&fr[hs].push(ga)}}us>0&&kr===!1&&(Ar=fr)}let ss;for(let kr=0,us=pr.length;kr<us;kr++){On=pr[kr].s,$n.push(On),ss=Ar[kr];for(let hs=0,ds=ss.length;hs<ds;hs++)On.holes.push(ss[hs].h)}return $n}}class WebGLMultipleRenderTargets extends WebGLRenderTarget{constructor(s=1,a=1,b=1,_e={}){console.warn('THREE.WebGLMultipleRenderTargets has been deprecated and will be removed in r172. Use THREE.WebGLRenderTarget and set the "count" parameter to enable MRT.'),super(s,a,{..._e,count:b}),this.isWebGLMultipleRenderTargets=!0}get texture(){return this.textures}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:REVISION}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=REVISION);const THREE$1=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping,AddEquation,AddOperation,AdditiveAnimationBlendMode,AdditiveBlending,AgXToneMapping,AlphaFormat,AlwaysCompare,AlwaysDepth,AlwaysStencilFunc,AmbientLight,AnimationAction,AnimationClip,AnimationLoader,AnimationMixer,AnimationObjectGroup,AnimationUtils,ArcCurve,ArrayCamera,ArrowHelper,AttachedBindMode,Audio,AudioAnalyser,AudioContext,AudioListener,AudioLoader,AxesHelper,BackSide,BasicDepthPacking,BasicShadowMap,BatchedMesh,Bone,BooleanKeyframeTrack,Box2,Box3,Box3Helper,BoxGeometry,BoxHelper,BufferAttribute,BufferGeometry,BufferGeometryLoader,ByteType,Cache,Camera,CameraHelper,CanvasTexture,CapsuleGeometry,CatmullRomCurve3,CineonToneMapping,CircleGeometry,ClampToEdgeWrapping,Clock,Color:Color$1,ColorKeyframeTrack,ColorManagement,CompressedArrayTexture,CompressedCubeTexture,CompressedTexture,CompressedTextureLoader,ConeGeometry,ConstantAlphaFactor,ConstantColorFactor,CubeCamera,CubeReflectionMapping,CubeRefractionMapping,CubeTexture,CubeTextureLoader,CubeUVReflectionMapping,CubicBezierCurve,CubicBezierCurve3,CubicInterpolant,CullFaceBack,CullFaceFront,CullFaceFrontBack,CullFaceNone,Curve,CurvePath,CustomBlending,CustomToneMapping,CylinderGeometry,Cylindrical,Data3DTexture,DataArrayTexture,DataTexture,DataTextureLoader,DataUtils,DecrementStencilOp,DecrementWrapStencilOp,DefaultLoadingManager,DepthFormat,DepthStencilFormat,DepthTexture,DetachedBindMode,DirectionalLight,DirectionalLightHelper,DiscreteInterpolant,DisplayP3ColorSpace,DodecahedronGeometry,DoubleSide,DstAlphaFactor,DstColorFactor,DynamicCopyUsage,DynamicDrawUsage,DynamicReadUsage,EdgesGeometry,EllipseCurve,EqualCompare,EqualDepth,EqualStencilFunc,EquirectangularReflectionMapping,EquirectangularRefractionMapping,Euler,EventDispatcher:EventDispatcher$2,ExtrudeGeometry,FileLoader,Float16BufferAttribute,Float32BufferAttribute,FloatType,Fog,FogExp2,FramebufferTexture,FrontSide,Frustum,GLBufferAttribute,GLSL1,GLSL3,GreaterCompare,GreaterDepth,GreaterEqualCompare,GreaterEqualDepth,GreaterEqualStencilFunc,GreaterStencilFunc,GridHelper,Group,HalfFloatType,HemisphereLight,HemisphereLightHelper,IcosahedronGeometry,ImageBitmapLoader,ImageLoader,ImageUtils,IncrementStencilOp,IncrementWrapStencilOp,InstancedBufferAttribute,InstancedBufferGeometry,InstancedInterleavedBuffer,InstancedMesh,Int16BufferAttribute,Int32BufferAttribute,Int8BufferAttribute,IntType,InterleavedBuffer,InterleavedBufferAttribute,Interpolant,InterpolateDiscrete,InterpolateLinear,InterpolateSmooth,InvertStencilOp,KeepStencilOp,KeyframeTrack,LOD,LatheGeometry,Layers,LessCompare,LessDepth,LessEqualCompare,LessEqualDepth,LessEqualStencilFunc,LessStencilFunc,Light,LightProbe,Line,Line3,LineBasicMaterial,LineCurve,LineCurve3,LineDashedMaterial,LineLoop,LineSegments,LinearDisplayP3ColorSpace,LinearFilter,LinearInterpolant,LinearMipMapLinearFilter,LinearMipMapNearestFilter,LinearMipmapLinearFilter,LinearMipmapNearestFilter,LinearSRGBColorSpace:LinearSRGBColorSpace$1,LinearToneMapping,LinearTransfer,Loader,LoaderUtils,LoadingManager,LoopOnce:LoopOnce$1,LoopPingPong,LoopRepeat:LoopRepeat$1,LuminanceAlphaFormat,LuminanceFormat,MOUSE,Material,MaterialLoader,MathUtils,Matrix3,Matrix4,MaxEquation,Mesh,MeshBasicMaterial,MeshDepthMaterial,MeshDistanceMaterial,MeshLambertMaterial,MeshMatcapMaterial,MeshNormalMaterial,MeshPhongMaterial,MeshPhysicalMaterial,MeshStandardMaterial,MeshToonMaterial,MinEquation,MirroredRepeatWrapping,MixOperation,MultiplyBlending,MultiplyOperation,NearestFilter,NearestMipMapLinearFilter,NearestMipMapNearestFilter,NearestMipmapLinearFilter,NearestMipmapNearestFilter,NeutralToneMapping,NeverCompare,NeverDepth,NeverStencilFunc,NoBlending,NoColorSpace,NoToneMapping,NormalAnimationBlendMode,NormalBlending,NotEqualCompare,NotEqualDepth,NotEqualStencilFunc,NumberKeyframeTrack,Object3D,ObjectLoader,ObjectSpaceNormalMap,OctahedronGeometry,OneFactor,OneMinusConstantAlphaFactor,OneMinusConstantColorFactor,OneMinusDstAlphaFactor,OneMinusDstColorFactor,OneMinusSrcAlphaFactor,OneMinusSrcColorFactor,OrthographicCamera,P3Primaries,PCFShadowMap,PCFSoftShadowMap,PMREMGenerator,Path,PerspectiveCamera,Plane,PlaneGeometry,PlaneHelper,PointLight,PointLightHelper,Points,PointsMaterial,PolarGridHelper,PolyhedronGeometry,PositionalAudio,PropertyBinding,PropertyMixer,QuadraticBezierCurve,QuadraticBezierCurve3,Quaternion,QuaternionKeyframeTrack,QuaternionLinearInterpolant,RED_GREEN_RGTC2_Format,RED_RGTC1_Format,REVISION,RGBADepthPacking,RGBAFormat,RGBAIntegerFormat,RGBA_ASTC_10x10_Format,RGBA_ASTC_10x5_Format,RGBA_ASTC_10x6_Format,RGBA_ASTC_10x8_Format,RGBA_ASTC_12x10_Format,RGBA_ASTC_12x12_Format,RGBA_ASTC_4x4_Format,RGBA_ASTC_5x4_Format,RGBA_ASTC_5x5_Format,RGBA_ASTC_6x5_Format,RGBA_ASTC_6x6_Format,RGBA_ASTC_8x5_Format,RGBA_ASTC_8x6_Format,RGBA_ASTC_8x8_Format,RGBA_BPTC_Format,RGBA_ETC2_EAC_Format,RGBA_PVRTC_2BPPV1_Format,RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format,RGBA_S3TC_DXT3_Format,RGBA_S3TC_DXT5_Format,RGBFormat,RGB_BPTC_SIGNED_Format,RGB_BPTC_UNSIGNED_Format,RGB_ETC1_Format,RGB_ETC2_Format,RGB_PVRTC_2BPPV1_Format,RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format,RGFormat,RGIntegerFormat,RawShaderMaterial,Ray,Raycaster,Rec709Primaries,RectAreaLight,RedFormat,RedIntegerFormat,ReinhardToneMapping,RenderTarget,RepeatWrapping,ReplaceStencilOp,ReverseSubtractEquation,RingGeometry,SIGNED_RED_GREEN_RGTC2_Format,SIGNED_RED_RGTC1_Format,SRGBColorSpace:SRGBColorSpace$1,SRGBTransfer,Scene,ShaderChunk,ShaderLib,ShaderMaterial,ShadowMaterial,Shape,ShapeGeometry,ShapePath,ShapeUtils,ShortType,Skeleton,SkeletonHelper,SkinnedMesh,Source,Sphere,SphereGeometry,Spherical,SphericalHarmonics3,SplineCurve,SpotLight,SpotLightHelper,Sprite,SpriteMaterial,SrcAlphaFactor,SrcAlphaSaturateFactor,SrcColorFactor,StaticCopyUsage,StaticDrawUsage,StaticReadUsage,StereoCamera,StreamCopyUsage,StreamDrawUsage,StreamReadUsage,StringKeyframeTrack,SubtractEquation,SubtractiveBlending,TOUCH,TangentSpaceNormalMap,TetrahedronGeometry,Texture,TextureLoader,TorusGeometry,TorusKnotGeometry,Triangle,TriangleFanDrawMode,TriangleStripDrawMode,TrianglesDrawMode,TubeGeometry,UVMapping,Uint16BufferAttribute,Uint32BufferAttribute,Uint8BufferAttribute,Uint8ClampedBufferAttribute,Uniform,UniformsGroup,UniformsLib,UniformsUtils,UnsignedByteType,UnsignedInt248Type,UnsignedInt5999Type,UnsignedIntType,UnsignedShort4444Type,UnsignedShort5551Type,UnsignedShortType,VSMShadowMap,Vector2,Vector3,Vector4,VectorKeyframeTrack,VideoTexture,WebGL3DRenderTarget,WebGLArrayRenderTarget,WebGLCoordinateSystem,WebGLCubeRenderTarget,WebGLMultipleRenderTargets,WebGLRenderTarget,WebGLRenderer,WebGLUtils,WebGPUCoordinateSystem,WireframeGeometry,WrapAroundEnding,ZeroCurvatureEnding,ZeroFactor,ZeroSlopeEnding,ZeroStencilOp,createCanvasElement},Symbol.toStringTag,{value:"Module"})),hotspotIdPrefix="rd",hotspotIdSeparator="_";function generateHotspotAbsoluteID(o,s){return`${hotspotIdPrefix}${hotspotIdSeparator}${o}${hotspotIdSeparator}${s}`}async function wait(o){return LOGGER.info({title:`Waiting for ${o}ms`}),new Promise((s,a)=>{setTimeout(()=>{s(!0)},o)})}function compareObjects(o,s){if(o===null||s===null)return!1;for(let a in o)if(o.hasOwnProperty(a)&&s.hasOwnProperty(a)&&o[a]!==s[a])return!1;return Object.keys(o).length===Object.keys(s).length}const saveStructureToCMS=(o,s,a)=>{try{const b={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({save_data:JSON.stringify(a)})};let _e=o+`/${s}/save/`;return SAVE_CONFIG_ENDPOINT!=null&&(_e=SAVE_CONFIG_ENDPOINT),fetch(_e,b)}catch(b){return LOGGER.error({title:b}),null}},capitalize$1=o=>o&&o[0].toUpperCase()+o.slice(1)||"",mobileCheck=function(){let o=!1;return function(s){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(s)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(s.substr(0,4)))&&(o=!0)}(navigator.userAgent||navigator.vendor||window.opera),o};function isIpadOS(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)}function tabletCheck(){const o=navigator.userAgent.toLowerCase(),s=/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/.test(o);return s||isIpadOS()}function touchDeviceCheck(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}async function validateAndGetJSONFromNexus(o,s,a,b=""){let _e={data:null,report:"",success:!1};try{let Kt="";a!=""?Kt=o+"/configurator/experience_id/"+a+"?version_id="+b:Kt=o+"/configurator/client_access_key/"+s+"?version_id="+b;const an=await fetch(Kt),_n=await an.text();let On=JSON.parse(_n);if(an.status!=200)throw On.message;_e.data=On,_e.success=!0,_e.report="Successfully fetched JSON data."}catch(Kt){_e.success=!1,_e.report=Kt}return _e}async function getJSONFromEndpoint(o){let s={data:null,report:"",success:!1};try{const b=await(await fetch(o)).text();s.data=JSON.parse(b),s.success=!0,s.report="Successfully fetched JSON data."}catch(a){s.report=a,s.success=!1}return s}const addVector=(o,s)=>new Vector3(o[0]+s[0],o[1]+s[1],o[2]+s[2]),Vec3ToArr=o=>[o.x,o.y,o.z],ArrToVec3=o=>new Vector3(o[0],o[1],o[2]),numberWithCommas=o=>o.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),findMeshAndCloneMatFromScene=(o,s,a=!0)=>{let b=[];const _e=o.coreSceneStore.getState().sceneSettings.outOfStock_EmissiveColor,Kt=o.coreSceneStore.getState().sceneSettings.outOfStock_EmissiveIntensity;return s.traverse(an=>{an.isMesh&&(an.material.userData.cloned?an.material.userData.inStock!==a&&(a?(an.material.emissive.set(new Color$1(255,255,255)),an.material.emissiveIntensity=0):(an.material.emissive.set(new Color$1(_e.r,_e.g,_e.b)),an.material.emissiveIntensity=Kt),an.material.userData.inStock=a):(an.material=an.material.clone(),an.material.userData.inStock=a,an.material.userData.cloned=!0,a?(an.material.emissive.set(new Color$1(255,255,255)),an.material.emissiveIntensity=0):(an.material.emissive.set(new Color$1(_e.r,_e.g,_e.b)),an.material.emissiveIntensity=Kt)),b.push(an))}),b},filterArrWithCondition=(o,s)=>{let a=0,b=[];for(let _e=0;_e<o.length;_e++){const Kt=o[_e];s(Kt)?o[a++]=Kt:b.push(o[_e])}return o.length=a,b},degToRad=o=>o*Math.PI/180,resolveAssetUrl=o=>{if(!o)return;if(new RegExp("^(?:[a-z+]+:)?//","i").test(o))return o;let b=o;return b=b.replaceAll("<@all-projects@>",ALL_PROJECTS_ASSET_DATA_ROOT_URL),b=b.replaceAll("<@generic-project@>",GENERIC_PROJECT_ASSET_DATA_ROOT_URL),b};function componentToHex(o){let s=o.toString(16);return s.length==1?"0"+s:s}function rgbToHex(o,s,a){return"#"+componentToHex(o)+componentToHex(s)+componentToHex(a)}function getUrlParameterByName(o,s=window.location.search){const a=new URLSearchParams(s);return Object.fromEntries(a.entries())[o]}function _dispose3(o){o.geometry&&o.geometry.dispose(),o.material&&(Array.isArray(o.material)?o.material.forEach(s=>s.dispose()):o.material.dispose()),o.texture&&o.texture.dispose()}function dispose3(o){o.traverse(s=>{_dispose3(s)}),_dispose3(o)}const findVariantForGUID=(o,s)=>{const a=o.attachmentStore.getState().attachmentSystem,_e=o.itemStore.getState().itemsSpawned[s];let Kt=a.currentStructure.getNodeByGUID(s);if(!Kt)return;let an="";if(Kt.overrideVariant)an=Kt.overrideVariant,o.coreSceneStore.getState().CORE_API.fireEvent(o.coreSceneStore.getState().CORE_API.EVENTS.SCENE.MaterialOverrides_Exists,!0);else{const _n=a.globalVariants;if(!_n||_n.Count<=0)return;let On=[];Object.keys(_n).map(($n,dr)=>{On.push(_n[$n])}),_e.itemData.looks?.map($n=>{On.includes($n)&&(an=$n)}),an||(an=_e.itemData.looks[0])}return an};function hasCommonElement(o,s){for(let a of o)if(s.includes(a))return!0;return!1}const InfoDrawer=({stores:o,open:s,dismissDrawer:a})=>{const b=o.uiSceneStore(_n=>_n.CORE_API),_e=o.uiSceneStore(_n=>_n.isScreenPortrait),Kt=reactExports.useRef(null),an=o.infoStore(_n=>_n.infoObject);return reactExports.useEffect(()=>{b.isMobile&&o.uiSceneStore.setState({dialogPopupOpen:s})},[s]),reactExports.useEffect(()=>{const{current:_n}=Kt;if(!_n)return;const On=()=>{a()};return _n.addEventListener("drawerClosed",On),()=>{_n.removeEventListener("drawerClosed",On)}},[Kt]),jsxRuntimeExports.jsx(BottomDrawer,{stores:o,ref:Kt,id:"bottomDrawer",open:`${s}`,"initial-screen-coverage":"0%",children:jsxRuntimeExports.jsx("div",{tabIndex:s&&_e?0:-1,"aria-hidden":!s||!_e,className:"infoDrawer epigraphDrawer",slot:"bottom-drawer-content",children:jsxRuntimeExports.jsxs("div",{className:"drawerContent",children:[jsxRuntimeExports.jsxs("a",{href:an?.productPageUrl,className:"categoryLink",role:"button","aria-label":"Link to Product",target:"_blank",style:an?.productPageUrl?{pointerEvents:"all"}:{pointerEvents:"none"},children:[jsxRuntimeExports.jsxs("h2",{className:"categoryTitle",children:[an?.productCategory?.label,an.subheading&&jsxRuntimeExports.jsx("div",{className:"modalSubHeading",children:an.subheading})]}),an.productPageUrl&&jsxRuntimeExports.jsx("img",{alt:"Open Product Page",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/OpenTab.svg",onError:_n=>{_n.target.src="https://placehold.co/150"}})]}),jsxRuntimeExports.jsx("div",{className:"infoDrawerImageContainer",children:jsxRuntimeExports.jsx("img",{className:"itemImage",alt:an?.title?"An image of "+an.title:"A placeholder image used in the Information Modal","aria-label":an?.title?"An image of "+an.title:"A placeholder image used in the Information Modal",src:an?.thumbnails?.high?b.getResolvedAssetUrl(an.thumbnails.high):"https://placehold.co/150",onError:_n=>{_n.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("h2",{className:"itemTitle",children:an.title}),jsxRuntimeExports.jsx("pre",{className:"itemDescription",children:an.description}),an.boundingBoxSize?jsxRuntimeExports.jsxs("p",{className:"infoModalDimensions",children:[an.boundingBoxSize.x.toFixed(1),"” W x"," ",an.boundingBoxSize.y.toFixed(1),"” D x"," ",an.boundingBoxSize.z.toFixed(1),"” H"]}):"",jsxRuntimeExports.jsx("div",{className:"infoModalActions",children:an.price&&jsxRuntimeExports.jsxs("button",{className:"item-price",disabled:!0,children:["`$$",numberWithCommas(parseFloat(an.price).toFixed(2)),"`"]})})]})})})},UtilityMenuButton=({stores:o,buttonAction:s,buttonLabel:a,hoverLabel:b,icon:_e,activeCondition:Kt})=>{const[an,_n]=reactExports.useState(Kt),On=o.uiSceneStore(fr=>fr.dialogPopupOpen),$n=o.uiSceneStore(fr=>fr.isScreenPortrait),dr=o.cartStore(fr=>fr.previewCartModalOpen);return reactExports.useEffect(()=>(_n(Kt),()=>{}),[Kt]),jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:!On&&($n&&!dr||!$n)?0:-1,"aria-hidden":On||$n&&dr,className:an!==void 0&&an?"shellButtonContainer active":"shellButtonContainer","aria-label":a,onClick:()=>{s()},children:[jsxRuntimeExports.jsxs("div",{className:"buttonContent",children:[jsxRuntimeExports.jsx("img",{className:"button",src:_e,alt:"An icon indicating "+a+" action.",onError:fr=>{fr.target.src="https://placehold.co/150"}}),jsxRuntimeExports.jsx("span",{children:a})]}),jsxRuntimeExports.jsx("div",{className:"hoverDescriptor",children:jsxRuntimeExports.jsx("span",{children:b})})]})},UtilityMenu=({stores:o,handleShareButtonTrigger:s,handleSaveButtonTrigger:a,handleRestartButtonClick:b,handleShowHotspots:_e,handleDimensionClick:Kt,handleInstructionButtonClick:an,utilityMenuVisible:_n,hotspotsVisibility:On,viewInYourSpaceMenuBtnVisible:$n,restartMenuBtnVisible:dr,saveMenuBtnVisible:fr,hotspotsMenuBtnVisible:pr,instructionsMenuBtnVisible:Ar,dimensionsMenuBtnVisible:Or,shareMenuBtnVisible:Xr,dimensionsVisible:ss,position:kr,CORE_API:us})=>{const[hs,ds]=reactExports.useState("bottom"),fs=o.productDataStore(So=>So.assetsData),Gs=o.coreSceneStore(So=>So.sceneSettings),ga={ar:"https://storage.googleapis.com/gsc-epigraph-design/product-assets/Icon/AR.svg",restart:"https://storage.googleapis.com/gsc-epigraph-design/product-assets/Icon/Restart.svg",save:"https://storage.googleapis.com/gsc-epigraph-design/product-assets/Icon/save.svg",share:"https://storage.googleapis.com/gsc-epigraph-design/product-assets/Icon/Share.svg",dimensions:"https://storage.googleapis.com/gsc-epigraph-design/product-assets/Icon/Ruler.svg",hotspots:"https://storage.googleapis.com/gsc-epigraph-design/product-assets/Icon/Eye.svg",instructions:"https://storage.googleapis.com/gsc-epigraph-design/product-assets/Icon/Info.svg"};return reactExports.useEffect(()=>{switch(kr){case"top":ds("top");break;case"bottom":ds("bottom");break;case"left":ds("left");break;case"right":ds("right");break}return()=>{}},[kr]),jsxRuntimeExports.jsx("div",{className:"shellCanvasContainerParent",id:hs,children:jsxRuntimeExports.jsxs("div",{className:(_n&&(Xr||$n||dr||Or||pr||Ar))==!0?"shellCanvasContainer":"shellCanvasContainer shellCanvasContainerInactive",children:[$n&&jsxRuntimeExports.jsx(UtilityMenuButton,{stores:o,buttonAction:()=>{us.viewInYourSpace()},buttonLabel:Gs.textSettings.arButtonLabel,hoverLabel:Gs.textSettings.arHoverLabel,icon:fs?.icons?.utilityMenu?.viewInYourSpace?us.getResolvedAssetUrl(fs?.icons?.utilityMenu?.viewInYourSpace):ga.ar}),dr&&jsxRuntimeExports.jsx(UtilityMenuButton,{stores:o,buttonAction:()=>{b()},buttonLabel:Gs.textSettings.restartButtonLabel,hoverLabel:Gs.textSettings.restartHoverLabel,icon:fs?.icons?.utilityMenu?.restart?us.getResolvedAssetUrl(fs?.icons?.utilityMenu?.restart):ga.restart}),fr&&jsxRuntimeExports.jsx(UtilityMenuButton,{stores:o,buttonAction:()=>{a()},buttonLabel:Gs.textSettings.saveButtonLabel,hoverLabel:Gs.textSettings.saveHoverLabel,icon:fs?.icons?.utilityMenu?.save?us.getResolvedAssetUrl(fs?.icons?.utilityMenu?.save):ga.save}),Xr&&jsxRuntimeExports.jsx(UtilityMenuButton,{stores:o,buttonAction:()=>{s()},buttonLabel:Gs.textSettings.shareButtonLabel,hoverLabel:Gs.textSettings.shareHoverLabel,icon:fs?.icons?.utilityMenu?.share?us.getResolvedAssetUrl(fs?.icons?.utilityMenu?.share):ga.share}),Or&&jsxRuntimeExports.jsx(UtilityMenuButton,{stores:o,buttonAction:()=>{Kt()},buttonLabel:Gs.textSettings.sizeButtonLabel,hoverLabel:Gs.textSettings.sizeHoverLabel,icon:fs?.icons?.utilityMenu?.dimensions?us.getResolvedAssetUrl(fs?.icons?.utilityMenu?.dimensions):ga.dimensions,activeCondition:ss}),pr&&jsxRuntimeExports.jsx(UtilityMenuButton,{stores:o,buttonAction:()=>{_e()},buttonLabel:Gs.textSettings.hotspotsButtonLabel,hoverLabel:Gs.textSettings.hotspotsHoverLabel,icon:fs?.icons?.utilityMenu?.hotspots?us.getResolvedAssetUrl(fs?.icons?.utilityMenu?.hotspots):ga.hotspots,activeCondition:On}),Ar&&jsxRuntimeExports.jsx(UtilityMenuButton,{stores:o,buttonAction:()=>{an()},buttonLabel:Gs.textSettings.instructionsButtonLabel,hoverLabel:Gs.textSettings.instructionsHoverLabel,icon:fs?.icons?.utilityMenu?.instructions?us.getResolvedAssetUrl(fs?.icons?.utilityMenu?.instructions):ga.instructions})]})})};function makeTypeChecker(o){return s=>!!s.type&&s.type.tabsRole===o}const isTab=makeTypeChecker("Tab"),isTabList=makeTypeChecker("TabList"),isTabPanel=makeTypeChecker("TabPanel");function isTabChild(o){return isTab(o)||isTabList(o)||isTabPanel(o)}function deepMap(o,s){return reactExports.Children.map(o,a=>a===null?null:isTabChild(a)?s(a):a.props&&a.props.children&&typeof a.props.children=="object"?reactExports.cloneElement(a,{...a.props,children:deepMap(a.props.children,s)}):a)}function deepForEach(o,s){return reactExports.Children.forEach(o,a=>{a!==null&&(isTab(a)||isTabPanel(a)?s(a):a.props&&a.props.children&&typeof a.props.children=="object"&&(isTabList(a)&&s(a),deepForEach(a.props.children,s)))})}function r$2(o){var s,a,b="";if(typeof o=="string"||typeof o=="number")b+=o;else if(typeof o=="object")if(Array.isArray(o)){var _e=o.length;for(s=0;s<_e;s++)o[s]&&(a=r$2(o[s]))&&(b&&(b+=" "),b+=a)}else for(a in o)o[a]&&(b&&(b+=" "),b+=a);return b}function clsx(){for(var o,s,a=0,b="",_e=arguments.length;a<_e;a++)(o=arguments[a])&&(s=r$2(o))&&(b&&(b+=" "),b+=s);return b}function getTabsCount(o){let s=0;return deepForEach(o,a=>{isTab(a)&&s++}),s}function isNode(o){return o&&"getAttribute"in o}function isTabNode(o){return isNode(o)&&o.getAttribute("data-rttab")}function isTabDisabled(o){return isNode(o)&&o.getAttribute("aria-disabled")==="true"}let canUseActiveElement;function determineCanUseActiveElement(o){const s=o||(typeof window<"u"?window:void 0);try{canUseActiveElement=!!(typeof s<"u"&&s.document&&s.document.activeElement)}catch{canUseActiveElement=!1}}const defaultProps$4={className:"react-tabs",focus:!1},UncontrolledTabs=o=>{let s=reactExports.useRef([]),a=reactExports.useRef([]);const b=reactExports.useRef();function _e(Al,xl){if(Al<0||Al>=$n())return;const{onSelect:ep,selectedIndex:_f}=o;ep(Al,_f,xl)}function Kt(Al){const xl=$n();for(let ep=Al+1;ep<xl;ep++)if(!isTabDisabled(dr(ep)))return ep;for(let ep=0;ep<Al;ep++)if(!isTabDisabled(dr(ep)))return ep;return Al}function an(Al){let xl=Al;for(;xl--;)if(!isTabDisabled(dr(xl)))return xl;for(xl=$n();xl-- >Al;)if(!isTabDisabled(dr(xl)))return xl;return Al}function _n(){const Al=$n();for(let xl=0;xl<Al;xl++)if(!isTabDisabled(dr(xl)))return xl;return null}function On(){let Al=$n();for(;Al--;)if(!isTabDisabled(dr(Al)))return Al;return null}function $n(){const{children:Al}=o;return getTabsCount(Al)}function dr(Al){return s.current[`tabs-${Al}`]}function fr(){let Al=0;const{children:xl,disabledTabClassName:ep,focus:_f,forceRenderTabPanel:np,selectedIndex:_l,selectedTabClassName:Ml,selectedTabPanelClassName:tp,environment:El}=o;a.current=a.current||[];let sp=a.current.length-$n();const My=reactExports.useId();for(;sp++<0;)a.current.push(`${My}${a.current.length}`);return deepMap(xl,Py=>{let Ny=Py;if(isTabList(Py)){let wy=0,Wy=!1;canUseActiveElement==null&&determineCanUseActiveElement(El);const DA=El||(typeof window<"u"?window:void 0);canUseActiveElement&&DA&&(Wy=React.Children.toArray(Py.props.children).filter(isTab).some((UA,jA)=>DA.document.activeElement===dr(jA))),Ny=reactExports.cloneElement(Py,{children:deepMap(Py.props.children,UA=>{const jA=`tabs-${wy}`,PA=_l===wy,mA={tabRef:FA=>{s.current[jA]=FA},id:a.current[wy],selected:PA,focus:PA&&(_f||Wy)};return Ml&&(mA.selectedClassName=Ml),ep&&(mA.disabledClassName=ep),wy++,reactExports.cloneElement(UA,mA)})})}else if(isTabPanel(Py)){const wy={id:a.current[Al],selected:_l===Al};np&&(wy.forceRender=np),tp&&(wy.selectedClassName=tp),Al++,Ny=reactExports.cloneElement(Py,wy)}return Ny})}function pr(Al){const{direction:xl,disableUpDownKeys:ep,disableLeftRightKeys:_f}=o;if(Or(Al.target)){let{selectedIndex:np}=o,_l=!1,Ml=!1;(Al.code==="Space"||Al.keyCode===32||Al.code==="Enter"||Al.keyCode===13)&&(_l=!0,Ml=!1,Ar(Al)),!_f&&(Al.keyCode===37||Al.code==="ArrowLeft")||!ep&&(Al.keyCode===38||Al.code==="ArrowUp")?(xl==="rtl"?np=Kt(np):np=an(np),_l=!0,Ml=!0):!_f&&(Al.keyCode===39||Al.code==="ArrowRight")||!ep&&(Al.keyCode===40||Al.code==="ArrowDown")?(xl==="rtl"?np=an(np):np=Kt(np),_l=!0,Ml=!0):Al.keyCode===35||Al.code==="End"?(np=On(),_l=!0,Ml=!0):(Al.keyCode===36||Al.code==="Home")&&(np=_n(),_l=!0,Ml=!0),_l&&Al.preventDefault(),Ml&&_e(np,Al)}}function Ar(Al){let xl=Al.target;do if(Or(xl)){if(isTabDisabled(xl))return;const ep=[].slice.call(xl.parentNode.children).filter(isTabNode).indexOf(xl);_e(ep,Al);return}while((xl=xl.parentNode)!=null)}function Or(Al){if(!isTabNode(Al))return!1;let xl=Al.parentElement;do{if(xl===b.current)return!0;if(xl.getAttribute("data-rttabs"))break;xl=xl.parentElement}while(xl);return!1}const{children:Xr,className:ss,disabledTabClassName:kr,domRef:us,focus:hs,forceRenderTabPanel:ds,onSelect:fs,selectedIndex:Gs,selectedTabClassName:ga,selectedTabPanelClassName:So,environment:go,disableUpDownKeys:xo,disableLeftRightKeys:Mo,...yl}={...defaultProps$4,...o};return React.createElement("div",Object.assign({},yl,{className:clsx(ss),onClick:Ar,onKeyDown:pr,ref:Al=>{b.current=Al,us&&us(Al)},"data-rttabs":!0}),fr())};UncontrolledTabs.propTypes={};const MODE_CONTROLLED=0,MODE_UNCONTROLLED=1,defaultProps$3={defaultFocus:!1,focusTabOnClick:!0,forceRenderTabPanel:!1,selectedIndex:null,defaultIndex:null,environment:null,disableUpDownKeys:!1,disableLeftRightKeys:!1},getModeFromProps=o=>o.selectedIndex===null?MODE_UNCONTROLLED:MODE_CONTROLLED,Tabs=o=>{const{children:s,defaultFocus:a,defaultIndex:b,focusTabOnClick:_e,onSelect:Kt,...an}={...defaultProps$3,...o},[_n,On]=reactExports.useState(a),[$n]=reactExports.useState(getModeFromProps(an)),[dr,fr]=reactExports.useState($n===MODE_UNCONTROLLED?b||0:null);if(reactExports.useEffect(()=>{On(!1)},[]),$n===MODE_UNCONTROLLED){const Or=getTabsCount(s);reactExports.useEffect(()=>{if(dr!=null){const Xr=Math.max(0,Or-1);fr(Math.min(dr,Xr))}},[Or])}const pr=(Or,Xr,ss)=>{typeof Kt=="function"&&Kt(Or,Xr,ss)===!1||(_e&&On(!0),$n===MODE_UNCONTROLLED&&fr(Or))};let Ar={...o,...an};return Ar.focus=_n,Ar.onSelect=pr,dr!=null&&(Ar.selectedIndex=dr),delete Ar.defaultFocus,delete Ar.defaultIndex,delete Ar.focusTabOnClick,React.createElement(UncontrolledTabs,Ar,s)};Tabs.propTypes={};Tabs.tabsRole="Tabs";const defaultProps$2={className:"react-tabs__tab-list"},TabList=o=>{const{children:s,className:a,...b}={...defaultProps$2,...o};return React.createElement("ul",Object.assign({},b,{className:clsx(a),role:"tablist"}),s)};TabList.tabsRole="TabList";TabList.propTypes={};const DEFAULT_CLASS$1="react-tabs__tab",defaultProps$1={className:DEFAULT_CLASS$1,disabledClassName:`${DEFAULT_CLASS$1}--disabled`,focus:!1,id:null,selected:!1,selectedClassName:`${DEFAULT_CLASS$1}--selected`},Tab$1=o=>{let s=reactExports.useRef();const{children:a,className:b,disabled:_e,disabledClassName:Kt,focus:an,id:_n,selected:On,selectedClassName:$n,tabIndex:dr,tabRef:fr,...pr}={...defaultProps$1,...o};return reactExports.useEffect(()=>{On&&an&&s.current.focus()},[On,an]),React.createElement("li",Object.assign({},pr,{className:clsx(b,{[$n]:On,[Kt]:_e}),ref:Ar=>{s.current=Ar,fr&&fr(Ar)},role:"tab",id:`tab${_n}`,"aria-selected":On?"true":"false","aria-disabled":_e?"true":"false","aria-controls":`panel${_n}`,tabIndex:dr||(On?"0":null),"data-rttab":!0}),a)};Tab$1.propTypes={};Tab$1.tabsRole="Tab";const DEFAULT_CLASS="react-tabs__tab-panel",defaultProps={className:DEFAULT_CLASS,forceRender:!1,selectedClassName:`${DEFAULT_CLASS}--selected`},TabPanel=o=>{const{children:s,className:a,forceRender:b,id:_e,selected:Kt,selectedClassName:an,..._n}={...defaultProps,...o};return React.createElement("div",Object.assign({},_n,{className:clsx(a,{[an]:Kt}),role:"tabpanel",id:`panel${_e}`,"aria-labelledby":`tab${_e}`}),b||Kt?s:null)};TabPanel.tabsRole="TabPanel";TabPanel.propTypes={};const ItemCard=({stores:o,sideMenuOpen:s,spawnGhosts:a,accordionActive:b=!0,spawnItem:_e,removeAllGhosts:Kt,isMouseUsed:an,skuId:_n,active:On})=>{const $n=o.uiSceneStore(YA=>YA.CORE_API),dr=o.infoStore(YA=>YA.infoModalOpen),fr=reactExports.useRef(null),pr=o.infoStore(YA=>YA.populateInfoObject),Ar=o.uiSceneStore(YA=>YA.dialogPopupOpen),Or=o.cartStore(YA=>YA.previewCartModalOpen),Xr=o.infoStore(YA=>YA.updateInfoModalOpen),[ss,kr]=reactExports.useState("default"),[us,hs]=reactExports.useState(!0),ds=o.colorStore(YA=>YA.allActiveVariants),fs=o.productDataStore(YA=>YA.productData),Gs=o.itemStore(YA=>YA.fittingSkuIds),[ga,So]=reactExports.useState(fs[_n].incrementDecrementControl?fs[_n].incrementDecrementControl:!1),[go,xo]=reactExports.useState(fs[_n]?fs[_n]:{}),[Mo,yl]=reactExports.useState(fs[_n].name?fs[_n].name:"Not Set"),[Al,xl]=reactExports.useState(fs[_n].subheading?fs[_n].subheading:""),[ep,_f]=reactExports.useState(fs[_n].lookDetails.default.thumbnails.low?fs[_n].lookDetails.default.thumbnails.low:""),[np,_l]=reactExports.useState(fs[_n].draggableUI!=null?fs[_n].draggableUI:o.uiSceneStore.getState().CORE_API.sceneSettings.draggableUI),[Ml,tp]=reactExports.useState(null),[El,sp]=reactExports.useState(!1),[My,Py]=reactExports.useState(!1),[Ny,wy]=reactExports.useState(0),Wy=reactExports.useCallback(()=>{Ny<=0||$n.removeLastItemBySkuId(_n)},[Ny]),DA=()=>{let YA=0;const pA=o.itemStore.getState().itemsSpawned,Ry=Object.keys(pA);for(let LA=Ry.length-1;LA>=0;LA--){const $A=Ry[LA];pA[$A].itemData.skuID===_n&&YA++}wy(YA)};reactExports.useEffect(()=>{DA()},[]),addCoreEventListener(o,$n.EVENTS.SCENE.Items_Updated,DA),reactExports.useEffect(()=>{Gs.includes(_n)?sp(!0):sp(!1)},[Gs]),reactExports.useEffect(()=>{Object.keys(fs).length!=0},[fs]),reactExports.useEffect(()=>{go.looks.length<=1&&hs(!1)},[go]);const UA=reactExports.useCallback(()=>{const YA=go.looks;let pA="default";for(const[Ry,LA]of Object.entries(ds))if(YA.includes(LA)){pA=LA;break}kr(pA)},[go,ds]);reactExports.useEffect(()=>{_f(go.lookDetails[ss].thumbnails.low)},[go,ss]),reactExports.useEffect(()=>{us===!0&&UA()},[ds]);const jA=reactExports.useCallback(YA=>{if(YA.stopPropagation(),!(!o.uiSceneStore.getState().CORE_API.sceneSettings.clickToAddUi&&!ga)){if(El===!1||Ml){$n.alert({alertMsg:"Unable to add item to the scene.",alertTime:4e3,alertType:"warn",alertLabel:"Action Unavailable"});return}_e(_n,!0)}},[El,Ml]),PA=reactExports.useCallback(async()=>{const YA=$n.sceneSettings?.showDependencyOnHover;if(YA===void 0||YA===!1)return;let pA=$n.getSpawningRequirementForSkuID(_n);if(pA.length<=0)return;let Ry="";const LA=await $n.getCartItemsAsync();let $A=!1;if(LA.cartItems.map(KA=>{pA.includes(KA.skuID)&&($A=!0)}),pA.includes("Root")&&pA.length==1&&($A=!0,pA=[]),$A)Ry="No space available to spawn the item.";else{Ry=`This item requires a dependency to be added to the scene first.
|
|
8813
|
+
}`;class WebXRDepthSensing{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(s,a,b){if(this.texture===null){const _e=new Texture,Kt=s.properties.get(_e);Kt.__webglTexture=a.texture,(a.depthNear!=b.depthNear||a.depthFar!=b.depthFar)&&(this.depthNear=a.depthNear,this.depthFar=a.depthFar),this.texture=_e}}render(s,a){if(this.texture!==null){if(this.mesh===null){const b=a.cameras[0].viewport,_e=new ShaderMaterial({vertexShader:_occlusion_vertex,fragmentShader:_occlusion_fragment,uniforms:{depthColor:{value:this.texture},depthWidth:{value:b.z},depthHeight:{value:b.w}}});this.mesh=new Mesh(new PlaneGeometry(20,20),_e)}s.render(this.mesh,a)}}reset(){this.texture=null,this.mesh=null}}class WebXRManager extends EventDispatcher$2{constructor(s,a){super();const b=this;let _e=null,Kt=1,an=null,_n="local-floor",On=1,$n=null,dr=null,fr=null,pr=null,Ar=null,Or=null;const Xr=new WebXRDepthSensing,ss=a.getContextAttributes();let kr=null,us=null;const hs=[],ds=[],fs=new Vector2;let Gs=null;const ga=new PerspectiveCamera;ga.layers.enable(1),ga.viewport=new Vector4;const So=new PerspectiveCamera;So.layers.enable(2),So.viewport=new Vector4;const go=[ga,So],xo=new ArrayCamera;xo.layers.enable(1),xo.layers.enable(2);let Mo=null,yl=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Py){let Ny=hs[Py];return Ny===void 0&&(Ny=new WebXRController,hs[Py]=Ny),Ny.getTargetRaySpace()},this.getControllerGrip=function(Py){let Ny=hs[Py];return Ny===void 0&&(Ny=new WebXRController,hs[Py]=Ny),Ny.getGripSpace()},this.getHand=function(Py){let Ny=hs[Py];return Ny===void 0&&(Ny=new WebXRController,hs[Py]=Ny),Ny.getHandSpace()};function Al(Py){const Ny=ds.indexOf(Py.inputSource);if(Ny===-1)return;const wy=hs[Ny];wy!==void 0&&(wy.update(Py.inputSource,Py.frame,$n||an),wy.dispatchEvent({type:Py.type,data:Py.inputSource}))}function xl(){_e.removeEventListener("select",Al),_e.removeEventListener("selectstart",Al),_e.removeEventListener("selectend",Al),_e.removeEventListener("squeeze",Al),_e.removeEventListener("squeezestart",Al),_e.removeEventListener("squeezeend",Al),_e.removeEventListener("end",xl),_e.removeEventListener("inputsourceschange",ep);for(let Py=0;Py<hs.length;Py++){const Ny=ds[Py];Ny!==null&&(ds[Py]=null,hs[Py].disconnect(Ny))}Mo=null,yl=null,Xr.reset(),s.setRenderTarget(kr),Ar=null,pr=null,fr=null,_e=null,us=null,My.stop(),b.isPresenting=!1,s.setPixelRatio(Gs),s.setSize(fs.width,fs.height,!1),b.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Py){Kt=Py,b.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Py){_n=Py,b.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return $n||an},this.setReferenceSpace=function(Py){$n=Py},this.getBaseLayer=function(){return pr!==null?pr:Ar},this.getBinding=function(){return fr},this.getFrame=function(){return Or},this.getSession=function(){return _e},this.setSession=async function(Py){if(_e=Py,_e!==null){if(kr=s.getRenderTarget(),_e.addEventListener("select",Al),_e.addEventListener("selectstart",Al),_e.addEventListener("selectend",Al),_e.addEventListener("squeeze",Al),_e.addEventListener("squeezestart",Al),_e.addEventListener("squeezeend",Al),_e.addEventListener("end",xl),_e.addEventListener("inputsourceschange",ep),ss.xrCompatible!==!0&&await a.makeXRCompatible(),Gs=s.getPixelRatio(),s.getSize(fs),_e.renderState.layers===void 0){const Ny={antialias:ss.antialias,alpha:!0,depth:ss.depth,stencil:ss.stencil,framebufferScaleFactor:Kt};Ar=new XRWebGLLayer(_e,a,Ny),_e.updateRenderState({baseLayer:Ar}),s.setPixelRatio(1),s.setSize(Ar.framebufferWidth,Ar.framebufferHeight,!1),us=new WebGLRenderTarget(Ar.framebufferWidth,Ar.framebufferHeight,{format:RGBAFormat,type:UnsignedByteType,colorSpace:s.outputColorSpace,stencilBuffer:ss.stencil})}else{let Ny=null,wy=null,Wy=null;ss.depth&&(Wy=ss.stencil?a.DEPTH24_STENCIL8:a.DEPTH_COMPONENT24,Ny=ss.stencil?DepthStencilFormat:DepthFormat,wy=ss.stencil?UnsignedInt248Type:UnsignedIntType);const DA={colorFormat:a.RGBA8,depthFormat:Wy,scaleFactor:Kt};fr=new XRWebGLBinding(_e,a),pr=fr.createProjectionLayer(DA),_e.updateRenderState({layers:[pr]}),s.setPixelRatio(1),s.setSize(pr.textureWidth,pr.textureHeight,!1),us=new WebGLRenderTarget(pr.textureWidth,pr.textureHeight,{format:RGBAFormat,type:UnsignedByteType,depthTexture:new DepthTexture(pr.textureWidth,pr.textureHeight,wy,void 0,void 0,void 0,void 0,void 0,void 0,Ny),stencilBuffer:ss.stencil,colorSpace:s.outputColorSpace,samples:ss.antialias?4:0});const UA=s.properties.get(us);UA.__ignoreDepthValues=pr.ignoreDepthValues}us.isXRRenderTarget=!0,this.setFoveation(On),$n=null,an=await _e.requestReferenceSpace(_n),My.setContext(_e),My.start(),b.isPresenting=!0,b.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(_e!==null)return _e.environmentBlendMode};function ep(Py){for(let Ny=0;Ny<Py.removed.length;Ny++){const wy=Py.removed[Ny],Wy=ds.indexOf(wy);Wy>=0&&(ds[Wy]=null,hs[Wy].disconnect(wy))}for(let Ny=0;Ny<Py.added.length;Ny++){const wy=Py.added[Ny];let Wy=ds.indexOf(wy);if(Wy===-1){for(let UA=0;UA<hs.length;UA++)if(UA>=ds.length){ds.push(wy),Wy=UA;break}else if(ds[UA]===null){ds[UA]=wy,Wy=UA;break}if(Wy===-1)break}const DA=hs[Wy];DA&&DA.connect(wy)}}const _f=new Vector3,np=new Vector3;function _l(Py,Ny,wy){_f.setFromMatrixPosition(Ny.matrixWorld),np.setFromMatrixPosition(wy.matrixWorld);const Wy=_f.distanceTo(np),DA=Ny.projectionMatrix.elements,UA=wy.projectionMatrix.elements,jA=DA[14]/(DA[10]-1),PA=DA[14]/(DA[10]+1),mA=(DA[9]+1)/DA[5],FA=(DA[9]-1)/DA[5],GA=(DA[8]-1)/DA[0],aE=(UA[8]+1)/UA[0],YA=jA*GA,pA=jA*aE,Ry=Wy/(-GA+aE),LA=Ry*-GA;Ny.matrixWorld.decompose(Py.position,Py.quaternion,Py.scale),Py.translateX(LA),Py.translateZ(Ry),Py.matrixWorld.compose(Py.position,Py.quaternion,Py.scale),Py.matrixWorldInverse.copy(Py.matrixWorld).invert();const $A=jA+Ry,KA=PA+Ry,qA=YA-LA,AA=pA+(Wy-LA),Dy=mA*PA/KA*$A,WA=FA*PA/KA*$A;Py.projectionMatrix.makePerspective(qA,AA,Dy,WA,$A,KA),Py.projectionMatrixInverse.copy(Py.projectionMatrix).invert()}function Ml(Py,Ny){Ny===null?Py.matrixWorld.copy(Py.matrix):Py.matrixWorld.multiplyMatrices(Ny.matrixWorld,Py.matrix),Py.matrixWorldInverse.copy(Py.matrixWorld).invert()}this.updateCamera=function(Py){if(_e===null)return;Xr.texture!==null&&(Py.near=Xr.depthNear,Py.far=Xr.depthFar),xo.near=So.near=ga.near=Py.near,xo.far=So.far=ga.far=Py.far,(Mo!==xo.near||yl!==xo.far)&&(_e.updateRenderState({depthNear:xo.near,depthFar:xo.far}),Mo=xo.near,yl=xo.far,ga.near=Mo,ga.far=yl,So.near=Mo,So.far=yl,ga.updateProjectionMatrix(),So.updateProjectionMatrix(),Py.updateProjectionMatrix());const Ny=Py.parent,wy=xo.cameras;Ml(xo,Ny);for(let Wy=0;Wy<wy.length;Wy++)Ml(wy[Wy],Ny);wy.length===2?_l(xo,ga,So):xo.projectionMatrix.copy(ga.projectionMatrix),tp(Py,xo,Ny)};function tp(Py,Ny,wy){wy===null?Py.matrix.copy(Ny.matrixWorld):(Py.matrix.copy(wy.matrixWorld),Py.matrix.invert(),Py.matrix.multiply(Ny.matrixWorld)),Py.matrix.decompose(Py.position,Py.quaternion,Py.scale),Py.updateMatrixWorld(!0),Py.projectionMatrix.copy(Ny.projectionMatrix),Py.projectionMatrixInverse.copy(Ny.projectionMatrixInverse),Py.isPerspectiveCamera&&(Py.fov=RAD2DEG*2*Math.atan(1/Py.projectionMatrix.elements[5]),Py.zoom=1)}this.getCamera=function(){return xo},this.getFoveation=function(){if(!(pr===null&&Ar===null))return On},this.setFoveation=function(Py){On=Py,pr!==null&&(pr.fixedFoveation=Py),Ar!==null&&Ar.fixedFoveation!==void 0&&(Ar.fixedFoveation=Py)},this.hasDepthSensing=function(){return Xr.texture!==null};let El=null;function sp(Py,Ny){if(dr=Ny.getViewerPose($n||an),Or=Ny,dr!==null){const wy=dr.views;Ar!==null&&(s.setRenderTargetFramebuffer(us,Ar.framebuffer),s.setRenderTarget(us));let Wy=!1;wy.length!==xo.cameras.length&&(xo.cameras.length=0,Wy=!0);for(let UA=0;UA<wy.length;UA++){const jA=wy[UA];let PA=null;if(Ar!==null)PA=Ar.getViewport(jA);else{const FA=fr.getViewSubImage(pr,jA);PA=FA.viewport,UA===0&&(s.setRenderTargetTextures(us,FA.colorTexture,pr.ignoreDepthValues?void 0:FA.depthStencilTexture),s.setRenderTarget(us))}let mA=go[UA];mA===void 0&&(mA=new PerspectiveCamera,mA.layers.enable(UA),mA.viewport=new Vector4,go[UA]=mA),mA.matrix.fromArray(jA.transform.matrix),mA.matrix.decompose(mA.position,mA.quaternion,mA.scale),mA.projectionMatrix.fromArray(jA.projectionMatrix),mA.projectionMatrixInverse.copy(mA.projectionMatrix).invert(),mA.viewport.set(PA.x,PA.y,PA.width,PA.height),UA===0&&(xo.matrix.copy(mA.matrix),xo.matrix.decompose(xo.position,xo.quaternion,xo.scale)),Wy===!0&&xo.cameras.push(mA)}const DA=_e.enabledFeatures;if(DA&&DA.includes("depth-sensing")){const UA=fr.getDepthInformation(wy[0]);UA&&UA.isValid&&UA.texture&&Xr.init(s,UA,_e.renderState)}}for(let wy=0;wy<hs.length;wy++){const Wy=ds[wy],DA=hs[wy];Wy!==null&&DA!==void 0&&DA.update(Wy,Ny,$n||an)}Xr.render(s,xo),El&&El(Py,Ny),Ny.detectedPlanes&&b.dispatchEvent({type:"planesdetected",data:Ny}),Or=null}const My=new WebGLAnimation;My.setAnimationLoop(sp),this.setAnimationLoop=function(Py){El=Py},this.dispose=function(){}}}const _e1=new Euler,_m1=new Matrix4;function WebGLMaterials(o,s){function a(ss,kr){ss.matrixAutoUpdate===!0&&ss.updateMatrix(),kr.value.copy(ss.matrix)}function b(ss,kr){kr.color.getRGB(ss.fogColor.value,getUnlitUniformColorSpace(o)),kr.isFog?(ss.fogNear.value=kr.near,ss.fogFar.value=kr.far):kr.isFogExp2&&(ss.fogDensity.value=kr.density)}function _e(ss,kr,us,hs,ds){kr.isMeshBasicMaterial||kr.isMeshLambertMaterial?Kt(ss,kr):kr.isMeshToonMaterial?(Kt(ss,kr),fr(ss,kr)):kr.isMeshPhongMaterial?(Kt(ss,kr),dr(ss,kr)):kr.isMeshStandardMaterial?(Kt(ss,kr),pr(ss,kr),kr.isMeshPhysicalMaterial&&Ar(ss,kr,ds)):kr.isMeshMatcapMaterial?(Kt(ss,kr),Or(ss,kr)):kr.isMeshDepthMaterial?Kt(ss,kr):kr.isMeshDistanceMaterial?(Kt(ss,kr),Xr(ss,kr)):kr.isMeshNormalMaterial?Kt(ss,kr):kr.isLineBasicMaterial?(an(ss,kr),kr.isLineDashedMaterial&&_n(ss,kr)):kr.isPointsMaterial?On(ss,kr,us,hs):kr.isSpriteMaterial?$n(ss,kr):kr.isShadowMaterial?(ss.color.value.copy(kr.color),ss.opacity.value=kr.opacity):kr.isShaderMaterial&&(kr.uniformsNeedUpdate=!1)}function Kt(ss,kr){ss.opacity.value=kr.opacity,kr.color&&ss.diffuse.value.copy(kr.color),kr.emissive&&ss.emissive.value.copy(kr.emissive).multiplyScalar(kr.emissiveIntensity),kr.map&&(ss.map.value=kr.map,a(kr.map,ss.mapTransform)),kr.alphaMap&&(ss.alphaMap.value=kr.alphaMap,a(kr.alphaMap,ss.alphaMapTransform)),kr.bumpMap&&(ss.bumpMap.value=kr.bumpMap,a(kr.bumpMap,ss.bumpMapTransform),ss.bumpScale.value=kr.bumpScale,kr.side===BackSide&&(ss.bumpScale.value*=-1)),kr.normalMap&&(ss.normalMap.value=kr.normalMap,a(kr.normalMap,ss.normalMapTransform),ss.normalScale.value.copy(kr.normalScale),kr.side===BackSide&&ss.normalScale.value.negate()),kr.displacementMap&&(ss.displacementMap.value=kr.displacementMap,a(kr.displacementMap,ss.displacementMapTransform),ss.displacementScale.value=kr.displacementScale,ss.displacementBias.value=kr.displacementBias),kr.emissiveMap&&(ss.emissiveMap.value=kr.emissiveMap,a(kr.emissiveMap,ss.emissiveMapTransform)),kr.specularMap&&(ss.specularMap.value=kr.specularMap,a(kr.specularMap,ss.specularMapTransform)),kr.alphaTest>0&&(ss.alphaTest.value=kr.alphaTest);const us=s.get(kr),hs=us.envMap,ds=us.envMapRotation;if(hs&&(ss.envMap.value=hs,_e1.copy(ds),_e1.x*=-1,_e1.y*=-1,_e1.z*=-1,hs.isCubeTexture&&hs.isRenderTargetTexture===!1&&(_e1.y*=-1,_e1.z*=-1),ss.envMapRotation.value.setFromMatrix4(_m1.makeRotationFromEuler(_e1)),ss.flipEnvMap.value=hs.isCubeTexture&&hs.isRenderTargetTexture===!1?-1:1,ss.reflectivity.value=kr.reflectivity,ss.ior.value=kr.ior,ss.refractionRatio.value=kr.refractionRatio),kr.lightMap){ss.lightMap.value=kr.lightMap;const fs=o._useLegacyLights===!0?Math.PI:1;ss.lightMapIntensity.value=kr.lightMapIntensity*fs,a(kr.lightMap,ss.lightMapTransform)}kr.aoMap&&(ss.aoMap.value=kr.aoMap,ss.aoMapIntensity.value=kr.aoMapIntensity,a(kr.aoMap,ss.aoMapTransform))}function an(ss,kr){ss.diffuse.value.copy(kr.color),ss.opacity.value=kr.opacity,kr.map&&(ss.map.value=kr.map,a(kr.map,ss.mapTransform))}function _n(ss,kr){ss.dashSize.value=kr.dashSize,ss.totalSize.value=kr.dashSize+kr.gapSize,ss.scale.value=kr.scale}function On(ss,kr,us,hs){ss.diffuse.value.copy(kr.color),ss.opacity.value=kr.opacity,ss.size.value=kr.size*us,ss.scale.value=hs*.5,kr.map&&(ss.map.value=kr.map,a(kr.map,ss.uvTransform)),kr.alphaMap&&(ss.alphaMap.value=kr.alphaMap,a(kr.alphaMap,ss.alphaMapTransform)),kr.alphaTest>0&&(ss.alphaTest.value=kr.alphaTest)}function $n(ss,kr){ss.diffuse.value.copy(kr.color),ss.opacity.value=kr.opacity,ss.rotation.value=kr.rotation,kr.map&&(ss.map.value=kr.map,a(kr.map,ss.mapTransform)),kr.alphaMap&&(ss.alphaMap.value=kr.alphaMap,a(kr.alphaMap,ss.alphaMapTransform)),kr.alphaTest>0&&(ss.alphaTest.value=kr.alphaTest)}function dr(ss,kr){ss.specular.value.copy(kr.specular),ss.shininess.value=Math.max(kr.shininess,1e-4)}function fr(ss,kr){kr.gradientMap&&(ss.gradientMap.value=kr.gradientMap)}function pr(ss,kr){ss.metalness.value=kr.metalness,kr.metalnessMap&&(ss.metalnessMap.value=kr.metalnessMap,a(kr.metalnessMap,ss.metalnessMapTransform)),ss.roughness.value=kr.roughness,kr.roughnessMap&&(ss.roughnessMap.value=kr.roughnessMap,a(kr.roughnessMap,ss.roughnessMapTransform)),kr.envMap&&(ss.envMapIntensity.value=kr.envMapIntensity)}function Ar(ss,kr,us){ss.ior.value=kr.ior,kr.sheen>0&&(ss.sheenColor.value.copy(kr.sheenColor).multiplyScalar(kr.sheen),ss.sheenRoughness.value=kr.sheenRoughness,kr.sheenColorMap&&(ss.sheenColorMap.value=kr.sheenColorMap,a(kr.sheenColorMap,ss.sheenColorMapTransform)),kr.sheenRoughnessMap&&(ss.sheenRoughnessMap.value=kr.sheenRoughnessMap,a(kr.sheenRoughnessMap,ss.sheenRoughnessMapTransform))),kr.clearcoat>0&&(ss.clearcoat.value=kr.clearcoat,ss.clearcoatRoughness.value=kr.clearcoatRoughness,kr.clearcoatMap&&(ss.clearcoatMap.value=kr.clearcoatMap,a(kr.clearcoatMap,ss.clearcoatMapTransform)),kr.clearcoatRoughnessMap&&(ss.clearcoatRoughnessMap.value=kr.clearcoatRoughnessMap,a(kr.clearcoatRoughnessMap,ss.clearcoatRoughnessMapTransform)),kr.clearcoatNormalMap&&(ss.clearcoatNormalMap.value=kr.clearcoatNormalMap,a(kr.clearcoatNormalMap,ss.clearcoatNormalMapTransform),ss.clearcoatNormalScale.value.copy(kr.clearcoatNormalScale),kr.side===BackSide&&ss.clearcoatNormalScale.value.negate())),kr.iridescence>0&&(ss.iridescence.value=kr.iridescence,ss.iridescenceIOR.value=kr.iridescenceIOR,ss.iridescenceThicknessMinimum.value=kr.iridescenceThicknessRange[0],ss.iridescenceThicknessMaximum.value=kr.iridescenceThicknessRange[1],kr.iridescenceMap&&(ss.iridescenceMap.value=kr.iridescenceMap,a(kr.iridescenceMap,ss.iridescenceMapTransform)),kr.iridescenceThicknessMap&&(ss.iridescenceThicknessMap.value=kr.iridescenceThicknessMap,a(kr.iridescenceThicknessMap,ss.iridescenceThicknessMapTransform))),kr.transmission>0&&(ss.transmission.value=kr.transmission,ss.transmissionSamplerMap.value=us.texture,ss.transmissionSamplerSize.value.set(us.width,us.height),kr.transmissionMap&&(ss.transmissionMap.value=kr.transmissionMap,a(kr.transmissionMap,ss.transmissionMapTransform)),ss.thickness.value=kr.thickness,kr.thicknessMap&&(ss.thicknessMap.value=kr.thicknessMap,a(kr.thicknessMap,ss.thicknessMapTransform)),ss.attenuationDistance.value=kr.attenuationDistance,ss.attenuationColor.value.copy(kr.attenuationColor)),kr.anisotropy>0&&(ss.anisotropyVector.value.set(kr.anisotropy*Math.cos(kr.anisotropyRotation),kr.anisotropy*Math.sin(kr.anisotropyRotation)),kr.anisotropyMap&&(ss.anisotropyMap.value=kr.anisotropyMap,a(kr.anisotropyMap,ss.anisotropyMapTransform))),ss.specularIntensity.value=kr.specularIntensity,ss.specularColor.value.copy(kr.specularColor),kr.specularColorMap&&(ss.specularColorMap.value=kr.specularColorMap,a(kr.specularColorMap,ss.specularColorMapTransform)),kr.specularIntensityMap&&(ss.specularIntensityMap.value=kr.specularIntensityMap,a(kr.specularIntensityMap,ss.specularIntensityMapTransform))}function Or(ss,kr){kr.matcap&&(ss.matcap.value=kr.matcap)}function Xr(ss,kr){const us=s.get(kr).light;ss.referencePosition.value.setFromMatrixPosition(us.matrixWorld),ss.nearDistance.value=us.shadow.camera.near,ss.farDistance.value=us.shadow.camera.far}return{refreshFogUniforms:b,refreshMaterialUniforms:_e}}function WebGLUniformsGroups(o,s,a,b){let _e={},Kt={},an=[];const _n=o.getParameter(o.MAX_UNIFORM_BUFFER_BINDINGS);function On(us,hs){const ds=hs.program;b.uniformBlockBinding(us,ds)}function $n(us,hs){let ds=_e[us.id];ds===void 0&&(Or(us),ds=dr(us),_e[us.id]=ds,us.addEventListener("dispose",ss));const fs=hs.program;b.updateUBOMapping(us,fs);const Gs=s.render.frame;Kt[us.id]!==Gs&&(pr(us),Kt[us.id]=Gs)}function dr(us){const hs=fr();us.__bindingPointIndex=hs;const ds=o.createBuffer(),fs=us.__size,Gs=us.usage;return o.bindBuffer(o.UNIFORM_BUFFER,ds),o.bufferData(o.UNIFORM_BUFFER,fs,Gs),o.bindBuffer(o.UNIFORM_BUFFER,null),o.bindBufferBase(o.UNIFORM_BUFFER,hs,ds),ds}function fr(){for(let us=0;us<_n;us++)if(an.indexOf(us)===-1)return an.push(us),us;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function pr(us){const hs=_e[us.id],ds=us.uniforms,fs=us.__cache;o.bindBuffer(o.UNIFORM_BUFFER,hs);for(let Gs=0,ga=ds.length;Gs<ga;Gs++){const So=Array.isArray(ds[Gs])?ds[Gs]:[ds[Gs]];for(let go=0,xo=So.length;go<xo;go++){const Mo=So[go];if(Ar(Mo,Gs,go,fs)===!0){const yl=Mo.__offset,Al=Array.isArray(Mo.value)?Mo.value:[Mo.value];let xl=0;for(let ep=0;ep<Al.length;ep++){const _f=Al[ep],np=Xr(_f);typeof _f=="number"||typeof _f=="boolean"?(Mo.__data[0]=_f,o.bufferSubData(o.UNIFORM_BUFFER,yl+xl,Mo.__data)):_f.isMatrix3?(Mo.__data[0]=_f.elements[0],Mo.__data[1]=_f.elements[1],Mo.__data[2]=_f.elements[2],Mo.__data[3]=0,Mo.__data[4]=_f.elements[3],Mo.__data[5]=_f.elements[4],Mo.__data[6]=_f.elements[5],Mo.__data[7]=0,Mo.__data[8]=_f.elements[6],Mo.__data[9]=_f.elements[7],Mo.__data[10]=_f.elements[8],Mo.__data[11]=0):(_f.toArray(Mo.__data,xl),xl+=np.storage/Float32Array.BYTES_PER_ELEMENT)}o.bufferSubData(o.UNIFORM_BUFFER,yl,Mo.__data)}}}o.bindBuffer(o.UNIFORM_BUFFER,null)}function Ar(us,hs,ds,fs){const Gs=us.value,ga=hs+"_"+ds;if(fs[ga]===void 0)return typeof Gs=="number"||typeof Gs=="boolean"?fs[ga]=Gs:fs[ga]=Gs.clone(),!0;{const So=fs[ga];if(typeof Gs=="number"||typeof Gs=="boolean"){if(So!==Gs)return fs[ga]=Gs,!0}else if(So.equals(Gs)===!1)return So.copy(Gs),!0}return!1}function Or(us){const hs=us.uniforms;let ds=0;const fs=16;for(let ga=0,So=hs.length;ga<So;ga++){const go=Array.isArray(hs[ga])?hs[ga]:[hs[ga]];for(let xo=0,Mo=go.length;xo<Mo;xo++){const yl=go[xo],Al=Array.isArray(yl.value)?yl.value:[yl.value];for(let xl=0,ep=Al.length;xl<ep;xl++){const _f=Al[xl],np=Xr(_f),_l=ds%fs;_l!==0&&fs-_l<np.boundary&&(ds+=fs-_l),yl.__data=new Float32Array(np.storage/Float32Array.BYTES_PER_ELEMENT),yl.__offset=ds,ds+=np.storage}}}const Gs=ds%fs;return Gs>0&&(ds+=fs-Gs),us.__size=ds,us.__cache={},this}function Xr(us){const hs={boundary:0,storage:0};return typeof us=="number"||typeof us=="boolean"?(hs.boundary=4,hs.storage=4):us.isVector2?(hs.boundary=8,hs.storage=8):us.isVector3||us.isColor?(hs.boundary=16,hs.storage=12):us.isVector4?(hs.boundary=16,hs.storage=16):us.isMatrix3?(hs.boundary=48,hs.storage=48):us.isMatrix4?(hs.boundary=64,hs.storage=64):us.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",us),hs}function ss(us){const hs=us.target;hs.removeEventListener("dispose",ss);const ds=an.indexOf(hs.__bindingPointIndex);an.splice(ds,1),o.deleteBuffer(_e[hs.id]),delete _e[hs.id],delete Kt[hs.id]}function kr(){for(const us in _e)o.deleteBuffer(_e[us]);an=[],_e={},Kt={}}return{bind:On,update:$n,dispose:kr}}class WebGLRenderer{constructor(s={}){const{canvas:a=createCanvasElement(),context:b=null,depth:_e=!0,stencil:Kt=!1,alpha:an=!1,antialias:_n=!1,premultipliedAlpha:On=!0,preserveDrawingBuffer:$n=!1,powerPreference:dr="default",failIfMajorPerformanceCaveat:fr=!1}=s;this.isWebGLRenderer=!0;let pr;if(b!==null){if(typeof WebGLRenderingContext<"u"&&b instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");pr=b.getContextAttributes().alpha}else pr=an;const Ar=new Uint32Array(4),Or=new Int32Array(4);let Xr=null,ss=null;const kr=[],us=[];this.domElement=a,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._outputColorSpace=SRGBColorSpace$1,this._useLegacyLights=!1,this.toneMapping=NoToneMapping,this.toneMappingExposure=1;const hs=this;let ds=!1,fs=0,Gs=0,ga=null,So=-1,go=null;const xo=new Vector4,Mo=new Vector4;let yl=null;const Al=new Color$1(0);let xl=0,ep=a.width,_f=a.height,np=1,_l=null,Ml=null;const tp=new Vector4(0,0,ep,_f),El=new Vector4(0,0,ep,_f);let sp=!1;const My=new Frustum;let Py=!1,Ny=!1;const wy=new Matrix4,Wy=new Vector2,DA=new Vector3,UA={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function jA(){return ga===null?np:1}let PA=b;function mA(em,Fy){const Uy=a.getContext(em,Fy);return Uy!==null?Uy:null}try{const em={alpha:!0,depth:_e,stencil:Kt,antialias:_n,premultipliedAlpha:On,preserveDrawingBuffer:$n,powerPreference:dr,failIfMajorPerformanceCaveat:fr};if("setAttribute"in a&&a.setAttribute("data-engine",`three.js r${REVISION}`),a.addEventListener("webglcontextlost",zA,!1),a.addEventListener("webglcontextrestored",ZA,!1),a.addEventListener("webglcontextcreationerror",E_,!1),PA===null){const Fy="webgl2";if(PA=mA(Fy,em),PA===null)throw mA(Fy)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(em){throw console.error("THREE.WebGLRenderer: "+em.message),em}let FA,GA,aE,YA,pA,Ry,LA,$A,KA,qA,AA,Dy,WA,LC,lE,RC,$C,DC,cE,KC,YC,QC,WC,qC;function zC(){FA=new WebGLExtensions(PA),FA.init(),GA=new WebGLCapabilities(PA,FA,s),QC=new WebGLUtils(PA,FA),aE=new WebGLState(PA),YA=new WebGLInfo(PA),pA=new WebGLProperties,Ry=new WebGLTextures(PA,FA,aE,pA,GA,QC,YA),LA=new WebGLCubeMaps(hs),$A=new WebGLCubeUVMaps(hs),KA=new WebGLAttributes(PA),WC=new WebGLBindingStates(PA,KA),qA=new WebGLGeometries(PA,KA,YA,WC),AA=new WebGLObjects(PA,qA,KA,YA),cE=new WebGLMorphtargets(PA,GA,Ry),RC=new WebGLClipping(pA),Dy=new WebGLPrograms(hs,LA,$A,FA,GA,WC,RC),WA=new WebGLMaterials(hs,pA),LC=new WebGLRenderLists,lE=new WebGLRenderStates(FA),DC=new WebGLBackground(hs,LA,$A,aE,AA,pr,On),$C=new WebGLShadowMap(hs,AA,GA),qC=new WebGLUniformsGroups(PA,YA,GA,aE),KC=new WebGLBufferRenderer(PA,FA,YA),YC=new WebGLIndexedBufferRenderer(PA,FA,YA),YA.programs=Dy.programs,hs.capabilities=GA,hs.extensions=FA,hs.properties=pA,hs.renderLists=LC,hs.shadowMap=$C,hs.state=aE,hs.info=YA}zC();const VA=new WebXRManager(hs,PA);this.xr=VA,this.getContext=function(){return PA},this.getContextAttributes=function(){return PA.getContextAttributes()},this.forceContextLoss=function(){const em=FA.get("WEBGL_lose_context");em&&em.loseContext()},this.forceContextRestore=function(){const em=FA.get("WEBGL_lose_context");em&&em.restoreContext()},this.getPixelRatio=function(){return np},this.setPixelRatio=function(em){em!==void 0&&(np=em,this.setSize(ep,_f,!1))},this.getSize=function(em){return em.set(ep,_f)},this.setSize=function(em,Fy,Uy=!0){if(VA.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}ep=em,_f=Fy,a.width=Math.floor(em*np),a.height=Math.floor(Fy*np),Uy===!0&&(a.style.width=em+"px",a.style.height=Fy+"px"),this.setViewport(0,0,em,Fy)},this.getDrawingBufferSize=function(em){return em.set(ep*np,_f*np).floor()},this.setDrawingBufferSize=function(em,Fy,Uy){ep=em,_f=Fy,np=Uy,a.width=Math.floor(em*Uy),a.height=Math.floor(Fy*Uy),this.setViewport(0,0,em,Fy)},this.getCurrentViewport=function(em){return em.copy(xo)},this.getViewport=function(em){return em.copy(tp)},this.setViewport=function(em,Fy,Uy,Zy){em.isVector4?tp.set(em.x,em.y,em.z,em.w):tp.set(em,Fy,Uy,Zy),aE.viewport(xo.copy(tp).multiplyScalar(np).round())},this.getScissor=function(em){return em.copy(El)},this.setScissor=function(em,Fy,Uy,Zy){em.isVector4?El.set(em.x,em.y,em.z,em.w):El.set(em,Fy,Uy,Zy),aE.scissor(Mo.copy(El).multiplyScalar(np).round())},this.getScissorTest=function(){return sp},this.setScissorTest=function(em){aE.setScissorTest(sp=em)},this.setOpaqueSort=function(em){_l=em},this.setTransparentSort=function(em){Ml=em},this.getClearColor=function(em){return em.copy(DC.getClearColor())},this.setClearColor=function(){DC.setClearColor.apply(DC,arguments)},this.getClearAlpha=function(){return DC.getClearAlpha()},this.setClearAlpha=function(){DC.setClearAlpha.apply(DC,arguments)},this.clear=function(em=!0,Fy=!0,Uy=!0){let Zy=0;if(em){let NA=!1;if(ga!==null){const JA=ga.texture.format;NA=JA===RGBAIntegerFormat||JA===RGIntegerFormat||JA===RedIntegerFormat}if(NA){const JA=ga.texture.type,hE=JA===UnsignedByteType||JA===UnsignedIntType||JA===UnsignedShortType||JA===UnsignedInt248Type||JA===UnsignedShort4444Type||JA===UnsignedShort5551Type,MC=DC.getClearColor(),OC=DC.getClearAlpha(),PC=MC.r,VC=MC.g,UC=MC.b;hE?(Ar[0]=PC,Ar[1]=VC,Ar[2]=UC,Ar[3]=OC,PA.clearBufferuiv(PA.COLOR,0,Ar)):(Or[0]=PC,Or[1]=VC,Or[2]=UC,Or[3]=OC,PA.clearBufferiv(PA.COLOR,0,Or))}else Zy|=PA.COLOR_BUFFER_BIT}Fy&&(Zy|=PA.DEPTH_BUFFER_BIT),Uy&&(Zy|=PA.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),PA.clear(Zy)},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(){a.removeEventListener("webglcontextlost",zA,!1),a.removeEventListener("webglcontextrestored",ZA,!1),a.removeEventListener("webglcontextcreationerror",E_,!1),LC.dispose(),lE.dispose(),pA.dispose(),LA.dispose(),$A.dispose(),AA.dispose(),WC.dispose(),qC.dispose(),Dy.dispose(),VA.dispose(),VA.removeEventListener("sessionstart",bI),VA.removeEventListener("sessionend",VR),GR.stop()};function zA(em){em.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),ds=!0}function ZA(){console.log("THREE.WebGLRenderer: Context Restored."),ds=!1;const em=YA.autoReset,Fy=$C.enabled,Uy=$C.autoUpdate,Zy=$C.needsUpdate,NA=$C.type;zC(),YA.autoReset=em,$C.enabled=Fy,$C.autoUpdate=Uy,$C.needsUpdate=Zy,$C.type=NA}function E_(em){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",em.statusMessage)}function kC(em){const Fy=em.target;Fy.removeEventListener("dispose",kC),HC(Fy)}function HC(em){cI(em),pA.remove(em)}function cI(em){const Fy=pA.get(em).programs;Fy!==void 0&&(Fy.forEach(function(Uy){Dy.releaseProgram(Uy)}),em.isShaderMaterial&&Dy.releaseShaderCache(em))}this.renderBufferDirect=function(em,Fy,Uy,Zy,NA,JA){Fy===null&&(Fy=UA);const hE=NA.isMesh&&NA.matrixWorld.determinant()<0,MC=XR(em,Fy,Uy,Zy,NA);aE.setMaterial(Zy,hE);let OC=Uy.index,PC=1;if(Zy.wireframe===!0){if(OC=qA.getWireframeAttribute(Uy),OC===void 0)return;PC=2}const VC=Uy.drawRange,UC=Uy.attributes.position;let jC=VC.start*PC,rI=(VC.start+VC.count)*PC;JA!==null&&(jC=Math.max(jC,JA.start*PC),rI=Math.min(rI,(JA.start+JA.count)*PC)),OC!==null?(jC=Math.max(jC,0),rI=Math.min(rI,OC.count)):UC!=null&&(jC=Math.max(jC,0),rI=Math.min(rI,UC.count));const nI=rI-jC;if(nI<0||nI===1/0)return;WC.setup(NA,Zy,MC,Uy,OC);let sI,XC=KC;if(OC!==null&&(sI=KA.get(OC),XC=YC,XC.setIndex(sI)),NA.isMesh)Zy.wireframe===!0?(aE.setLineWidth(Zy.wireframeLinewidth*jA()),XC.setMode(PA.LINES)):XC.setMode(PA.TRIANGLES);else if(NA.isLine){let ZC=Zy.linewidth;ZC===void 0&&(ZC=1),aE.setLineWidth(ZC*jA()),NA.isLineSegments?XC.setMode(PA.LINES):NA.isLineLoop?XC.setMode(PA.LINE_LOOP):XC.setMode(PA.LINE_STRIP)}else NA.isPoints?XC.setMode(PA.POINTS):NA.isSprite&&XC.setMode(PA.TRIANGLES);if(NA.isBatchedMesh)XC.renderMultiDraw(NA._multiDrawStarts,NA._multiDrawCounts,NA._multiDrawCount);else if(NA.isInstancedMesh)XC.renderInstances(jC,nI,NA.count);else if(Uy.isInstancedBufferGeometry){const ZC=Uy._maxInstanceCount!==void 0?Uy._maxInstanceCount:1/0,dI=Math.min(Uy.instanceCount,ZC);XC.renderInstances(jC,nI,dI)}else XC.render(jC,nI)};function uI(em,Fy,Uy){em.transparent===!0&&em.side===DoubleSide&&em.forceSinglePass===!1?(em.side=BackSide,em.needsUpdate=!0,qR(em,Fy,Uy),em.side=FrontSide,em.needsUpdate=!0,qR(em,Fy,Uy),em.side=DoubleSide):qR(em,Fy,Uy)}this.compile=function(em,Fy,Uy=null){Uy===null&&(Uy=em),ss=lE.get(Uy),ss.init(),us.push(ss),Uy.traverseVisible(function(NA){NA.isLight&&NA.layers.test(Fy.layers)&&(ss.pushLight(NA),NA.castShadow&&ss.pushShadow(NA))}),em!==Uy&&em.traverseVisible(function(NA){NA.isLight&&NA.layers.test(Fy.layers)&&(ss.pushLight(NA),NA.castShadow&&ss.pushShadow(NA))}),ss.setupLights(hs._useLegacyLights);const Zy=new Set;return em.traverse(function(NA){const JA=NA.material;if(JA)if(Array.isArray(JA))for(let hE=0;hE<JA.length;hE++){const MC=JA[hE];uI(MC,Uy,NA),Zy.add(MC)}else uI(JA,Uy,NA),Zy.add(JA)}),us.pop(),ss=null,Zy},this.compileAsync=function(em,Fy,Uy=null){const Zy=this.compile(em,Fy,Uy);return new Promise(NA=>{function JA(){if(Zy.forEach(function(hE){pA.get(hE).currentProgram.isReady()&&Zy.delete(hE)}),Zy.size===0){NA(em);return}setTimeout(JA,10)}FA.get("KHR_parallel_shader_compile")!==null?JA():setTimeout(JA,10)})};let gI=null;function AI(em){gI&&gI(em)}function bI(){GR.stop()}function VR(){GR.start()}const GR=new WebGLAnimation;GR.setAnimationLoop(AI),typeof self<"u"&&GR.setContext(self),this.setAnimationLoop=function(em){gI=em,VA.setAnimationLoop(em),em===null?GR.stop():GR.start()},VA.addEventListener("sessionstart",bI),VA.addEventListener("sessionend",VR),this.render=function(em,Fy){if(Fy!==void 0&&Fy.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(ds===!0)return;em.matrixWorldAutoUpdate===!0&&em.updateMatrixWorld(),Fy.parent===null&&Fy.matrixWorldAutoUpdate===!0&&Fy.updateMatrixWorld(),VA.enabled===!0&&VA.isPresenting===!0&&(VA.cameraAutoUpdate===!0&&VA.updateCamera(Fy),Fy=VA.getCamera()),em.isScene===!0&&em.onBeforeRender(hs,em,Fy,ga),ss=lE.get(em,us.length),ss.init(),us.push(ss),wy.multiplyMatrices(Fy.projectionMatrix,Fy.matrixWorldInverse),My.setFromProjectionMatrix(wy),Ny=this.localClippingEnabled,Py=RC.init(this.clippingPlanes,Ny),Xr=LC.get(em,kr.length),Xr.init(),kr.push(Xr),PP(em,Fy,0,hs.sortObjects),Xr.finish(),hs.sortObjects===!0&&Xr.sort(_l,Ml),this.info.render.frame++,Py===!0&&RC.beginShadows();const Uy=ss.state.shadowsArray;if($C.render(Uy,em,Fy),Py===!0&&RC.endShadows(),this.info.autoReset===!0&&this.info.reset(),(VA.enabled===!1||VA.isPresenting===!1||VA.hasDepthSensing()===!1)&&DC.render(Xr,em),ss.setupLights(hs._useLegacyLights),Fy.isArrayCamera){const Zy=Fy.cameras;for(let NA=0,JA=Zy.length;NA<JA;NA++){const hE=Zy[NA];LP(Xr,em,hE,hE.viewport)}}else LP(Xr,em,Fy);ga!==null&&(Ry.updateMultisampleRenderTarget(ga),Ry.updateRenderTargetMipmap(ga)),em.isScene===!0&&em.onAfterRender(hs,em,Fy),WC.resetDefaultState(),So=-1,go=null,us.pop(),us.length>0?ss=us[us.length-1]:ss=null,kr.pop(),kr.length>0?Xr=kr[kr.length-1]:Xr=null};function PP(em,Fy,Uy,Zy){if(em.visible===!1)return;if(em.layers.test(Fy.layers)){if(em.isGroup)Uy=em.renderOrder;else if(em.isLOD)em.autoUpdate===!0&&em.update(Fy);else if(em.isLight)ss.pushLight(em),em.castShadow&&ss.pushShadow(em);else if(em.isSprite){if(!em.frustumCulled||My.intersectsSprite(em)){Zy&&DA.setFromMatrixPosition(em.matrixWorld).applyMatrix4(wy);const hE=AA.update(em),MC=em.material;MC.visible&&Xr.push(em,hE,MC,Uy,DA.z,null)}}else if((em.isMesh||em.isLine||em.isPoints)&&(!em.frustumCulled||My.intersectsObject(em))){const hE=AA.update(em),MC=em.material;if(Zy&&(em.boundingSphere!==void 0?(em.boundingSphere===null&&em.computeBoundingSphere(),DA.copy(em.boundingSphere.center)):(hE.boundingSphere===null&&hE.computeBoundingSphere(),DA.copy(hE.boundingSphere.center)),DA.applyMatrix4(em.matrixWorld).applyMatrix4(wy)),Array.isArray(MC)){const OC=hE.groups;for(let PC=0,VC=OC.length;PC<VC;PC++){const UC=OC[PC],jC=MC[UC.materialIndex];jC&&jC.visible&&Xr.push(em,hE,jC,Uy,DA.z,UC)}}else MC.visible&&Xr.push(em,hE,MC,Uy,DA.z,null)}}const JA=em.children;for(let hE=0,MC=JA.length;hE<MC;hE++)PP(JA[hE],Fy,Uy,Zy)}function LP(em,Fy,Uy,Zy){const NA=em.opaque,JA=em.transmissive,hE=em.transparent;ss.setupLightsView(Uy),Py===!0&&RC.setGlobalState(hs.clippingPlanes,Uy),JA.length>0&&mP(NA,JA,Fy,Uy),Zy&&aE.viewport(xo.copy(Zy)),NA.length>0&&sP(NA,Fy,Uy),JA.length>0&&sP(JA,Fy,Uy),hE.length>0&&sP(hE,Fy,Uy),aE.buffers.depth.setTest(!0),aE.buffers.depth.setMask(!0),aE.buffers.color.setMask(!0),aE.setPolygonOffset(!1)}function mP(em,Fy,Uy,Zy){if((Uy.isScene===!0?Uy.overrideMaterial:null)!==null)return;if(ss.state.transmissionRenderTarget===null){ss.state.transmissionRenderTarget=new WebGLRenderTarget(1,1,{generateMipmaps:!0,type:FA.has("EXT_color_buffer_half_float")||FA.has("EXT_color_buffer_float")?HalfFloatType:UnsignedByteType,minFilter:LinearMipmapLinearFilter,samples:4,stencilBuffer:Kt});const PC=pA.get(ss.state.transmissionRenderTarget);PC.__isTransmissionRenderTarget=!0}const JA=ss.state.transmissionRenderTarget;hs.getDrawingBufferSize(Wy),JA.setSize(Wy.x,Wy.y);const hE=hs.getRenderTarget();hs.setRenderTarget(JA),hs.getClearColor(Al),xl=hs.getClearAlpha(),xl<1&&hs.setClearColor(16777215,.5),hs.clear();const MC=hs.toneMapping;hs.toneMapping=NoToneMapping,sP(em,Uy,Zy),Ry.updateMultisampleRenderTarget(JA),Ry.updateRenderTargetMipmap(JA);let OC=!1;for(let PC=0,VC=Fy.length;PC<VC;PC++){const UC=Fy[PC],jC=UC.object,rI=UC.geometry,nI=UC.material,sI=UC.group;if(nI.side===DoubleSide&&jC.layers.test(Zy.layers)){const XC=nI.side;nI.side=BackSide,nI.needsUpdate=!0,hP(jC,Uy,Zy,rI,nI,sI),nI.side=XC,nI.needsUpdate=!0,OC=!0}}OC===!0&&(Ry.updateMultisampleRenderTarget(JA),Ry.updateRenderTargetMipmap(JA)),hs.setRenderTarget(hE),hs.setClearColor(Al,xl),hs.toneMapping=MC}function sP(em,Fy,Uy){const Zy=Fy.isScene===!0?Fy.overrideMaterial:null;for(let NA=0,JA=em.length;NA<JA;NA++){const hE=em[NA],MC=hE.object,OC=hE.geometry,PC=Zy===null?hE.material:Zy,VC=hE.group;MC.layers.test(Uy.layers)&&hP(MC,Fy,Uy,OC,PC,VC)}}function hP(em,Fy,Uy,Zy,NA,JA){em.onBeforeRender(hs,Fy,Uy,Zy,NA,JA),em.modelViewMatrix.multiplyMatrices(Uy.matrixWorldInverse,em.matrixWorld),em.normalMatrix.getNormalMatrix(em.modelViewMatrix),NA.onBeforeRender(hs,Fy,Uy,Zy,em,JA),NA.transparent===!0&&NA.side===DoubleSide&&NA.forceSinglePass===!1?(NA.side=BackSide,NA.needsUpdate=!0,hs.renderBufferDirect(Uy,Fy,Zy,NA,em,JA),NA.side=FrontSide,NA.needsUpdate=!0,hs.renderBufferDirect(Uy,Fy,Zy,NA,em,JA),NA.side=DoubleSide):hs.renderBufferDirect(Uy,Fy,Zy,NA,em,JA),em.onAfterRender(hs,Fy,Uy,Zy,NA,JA)}function qR(em,Fy,Uy){Fy.isScene!==!0&&(Fy=UA);const Zy=pA.get(em),NA=ss.state.lights,JA=ss.state.shadowsArray,hE=NA.state.version,MC=Dy.getParameters(em,NA.state,JA,Fy,Uy),OC=Dy.getProgramCacheKey(MC);let PC=Zy.programs;Zy.environment=em.isMeshStandardMaterial?Fy.environment:null,Zy.fog=Fy.fog,Zy.envMap=(em.isMeshStandardMaterial?$A:LA).get(em.envMap||Zy.environment),Zy.envMapRotation=Zy.environment!==null&&em.envMap===null?Fy.environmentRotation:em.envMapRotation,PC===void 0&&(em.addEventListener("dispose",kC),PC=new Map,Zy.programs=PC);let VC=PC.get(OC);if(VC!==void 0){if(Zy.currentProgram===VC&&Zy.lightsStateVersion===hE)return jR(em,MC),VC}else MC.uniforms=Dy.getUniforms(em),em.onBuild(Uy,MC,hs),em.onBeforeCompile(MC,hs),VC=Dy.acquireProgram(MC,OC),PC.set(OC,VC),Zy.uniforms=MC.uniforms;const UC=Zy.uniforms;return(!em.isShaderMaterial&&!em.isRawShaderMaterial||em.clipping===!0)&&(UC.clippingPlanes=RC.uniform),jR(em,MC),Zy.needsLights=nm(em),Zy.lightsStateVersion=hE,Zy.needsLights&&(UC.ambientLightColor.value=NA.state.ambient,UC.lightProbe.value=NA.state.probe,UC.directionalLights.value=NA.state.directional,UC.directionalLightShadows.value=NA.state.directionalShadow,UC.spotLights.value=NA.state.spot,UC.spotLightShadows.value=NA.state.spotShadow,UC.rectAreaLights.value=NA.state.rectArea,UC.ltc_1.value=NA.state.rectAreaLTC1,UC.ltc_2.value=NA.state.rectAreaLTC2,UC.pointLights.value=NA.state.point,UC.pointLightShadows.value=NA.state.pointShadow,UC.hemisphereLights.value=NA.state.hemi,UC.directionalShadowMap.value=NA.state.directionalShadowMap,UC.directionalShadowMatrix.value=NA.state.directionalShadowMatrix,UC.spotShadowMap.value=NA.state.spotShadowMap,UC.spotLightMatrix.value=NA.state.spotLightMatrix,UC.spotLightMap.value=NA.state.spotLightMap,UC.pointShadowMap.value=NA.state.pointShadowMap,UC.pointShadowMatrix.value=NA.state.pointShadowMatrix),Zy.currentProgram=VC,Zy.uniformsList=null,VC}function GC(em){if(em.uniformsList===null){const Fy=em.currentProgram.getUniforms();em.uniformsList=WebGLUniforms.seqWithValue(Fy.seq,em.uniforms)}return em.uniformsList}function jR(em,Fy){const Uy=pA.get(em);Uy.outputColorSpace=Fy.outputColorSpace,Uy.batching=Fy.batching,Uy.instancing=Fy.instancing,Uy.instancingColor=Fy.instancingColor,Uy.instancingMorph=Fy.instancingMorph,Uy.skinning=Fy.skinning,Uy.morphTargets=Fy.morphTargets,Uy.morphNormals=Fy.morphNormals,Uy.morphColors=Fy.morphColors,Uy.morphTargetsCount=Fy.morphTargetsCount,Uy.numClippingPlanes=Fy.numClippingPlanes,Uy.numIntersection=Fy.numClipIntersection,Uy.vertexAlphas=Fy.vertexAlphas,Uy.vertexTangents=Fy.vertexTangents,Uy.toneMapping=Fy.toneMapping}function XR(em,Fy,Uy,Zy,NA){Fy.isScene!==!0&&(Fy=UA),Ry.resetTextureUnits();const JA=Fy.fog,hE=Zy.isMeshStandardMaterial?Fy.environment:null,MC=ga===null?hs.outputColorSpace:ga.isXRRenderTarget===!0?ga.texture.colorSpace:LinearSRGBColorSpace$1,OC=(Zy.isMeshStandardMaterial?$A:LA).get(Zy.envMap||hE),PC=Zy.vertexColors===!0&&!!Uy.attributes.color&&Uy.attributes.color.itemSize===4,VC=!!Uy.attributes.tangent&&(!!Zy.normalMap||Zy.anisotropy>0),UC=!!Uy.morphAttributes.position,jC=!!Uy.morphAttributes.normal,rI=!!Uy.morphAttributes.color;let nI=NoToneMapping;Zy.toneMapped&&(ga===null||ga.isXRRenderTarget===!0)&&(nI=hs.toneMapping);const sI=Uy.morphAttributes.position||Uy.morphAttributes.normal||Uy.morphAttributes.color,XC=sI!==void 0?sI.length:0,ZC=pA.get(Zy),dI=ss.state.lights;if(Py===!0&&(Ny===!0||em!==go)){const GI=em===go&&Zy.id===So;RC.setState(Zy,em,GI)}let iI=!1;Zy.version===ZC.__version?(ZC.needsLights&&ZC.lightsStateVersion!==dI.state.version||ZC.outputColorSpace!==MC||NA.isBatchedMesh&&ZC.batching===!1||!NA.isBatchedMesh&&ZC.batching===!0||NA.isInstancedMesh&&ZC.instancing===!1||!NA.isInstancedMesh&&ZC.instancing===!0||NA.isSkinnedMesh&&ZC.skinning===!1||!NA.isSkinnedMesh&&ZC.skinning===!0||NA.isInstancedMesh&&ZC.instancingColor===!0&&NA.instanceColor===null||NA.isInstancedMesh&&ZC.instancingColor===!1&&NA.instanceColor!==null||NA.isInstancedMesh&&ZC.instancingMorph===!0&&NA.morphTexture===null||NA.isInstancedMesh&&ZC.instancingMorph===!1&&NA.morphTexture!==null||ZC.envMap!==OC||Zy.fog===!0&&ZC.fog!==JA||ZC.numClippingPlanes!==void 0&&(ZC.numClippingPlanes!==RC.numPlanes||ZC.numIntersection!==RC.numIntersection)||ZC.vertexAlphas!==PC||ZC.vertexTangents!==VC||ZC.morphTargets!==UC||ZC.morphNormals!==jC||ZC.morphColors!==rI||ZC.toneMapping!==nI||ZC.morphTargetsCount!==XC)&&(iI=!0):(iI=!0,ZC.__version=Zy.version);let NI=ZC.currentProgram;iI===!0&&(NI=qR(Zy,Fy,NA));let fI=!1,FI=!1,UI=!1;const mI=NI.getUniforms(),$R=ZC.uniforms;if(aE.useProgram(NI.program)&&(fI=!0,FI=!0,UI=!0),Zy.id!==So&&(So=Zy.id,FI=!0),fI||go!==em){mI.setValue(PA,"projectionMatrix",em.projectionMatrix),mI.setValue(PA,"viewMatrix",em.matrixWorldInverse);const GI=mI.map.cameraPosition;GI!==void 0&&GI.setValue(PA,DA.setFromMatrixPosition(em.matrixWorld)),GA.logarithmicDepthBuffer&&mI.setValue(PA,"logDepthBufFC",2/(Math.log(em.far+1)/Math.LN2)),(Zy.isMeshPhongMaterial||Zy.isMeshToonMaterial||Zy.isMeshLambertMaterial||Zy.isMeshBasicMaterial||Zy.isMeshStandardMaterial||Zy.isShaderMaterial)&&mI.setValue(PA,"isOrthographic",em.isOrthographicCamera===!0),go!==em&&(go=em,FI=!0,UI=!0)}if(NA.isSkinnedMesh){mI.setOptional(PA,NA,"bindMatrix"),mI.setOptional(PA,NA,"bindMatrixInverse");const GI=NA.skeleton;GI&&(GI.boneTexture===null&&GI.computeBoneTexture(),mI.setValue(PA,"boneTexture",GI.boneTexture,Ry))}NA.isBatchedMesh&&(mI.setOptional(PA,NA,"batchingTexture"),mI.setValue(PA,"batchingTexture",NA._matricesTexture,Ry));const pI=Uy.morphAttributes;if((pI.position!==void 0||pI.normal!==void 0||pI.color!==void 0)&&cE.update(NA,Uy,NI),(FI||ZC.receiveShadow!==NA.receiveShadow)&&(ZC.receiveShadow=NA.receiveShadow,mI.setValue(PA,"receiveShadow",NA.receiveShadow)),Zy.isMeshGouraudMaterial&&Zy.envMap!==null&&($R.envMap.value=OC,$R.flipEnvMap.value=OC.isCubeTexture&&OC.isRenderTargetTexture===!1?-1:1),Zy.isMeshStandardMaterial&&Zy.envMap===null&&Fy.environment!==null&&($R.envMapIntensity.value=Fy.environmentIntensity),FI&&(mI.setValue(PA,"toneMappingExposure",hs.toneMappingExposure),ZC.needsLights&&Vy($R,UI),JA&&Zy.fog===!0&&WA.refreshFogUniforms($R,JA),WA.refreshMaterialUniforms($R,Zy,np,_f,ss.state.transmissionRenderTarget),WebGLUniforms.upload(PA,GC(ZC),$R,Ry)),Zy.isShaderMaterial&&Zy.uniformsNeedUpdate===!0&&(WebGLUniforms.upload(PA,GC(ZC),$R,Ry),Zy.uniformsNeedUpdate=!1),Zy.isSpriteMaterial&&mI.setValue(PA,"center",NA.center),mI.setValue(PA,"modelViewMatrix",NA.modelViewMatrix),mI.setValue(PA,"normalMatrix",NA.normalMatrix),mI.setValue(PA,"modelMatrix",NA.matrixWorld),Zy.isShaderMaterial||Zy.isRawShaderMaterial){const GI=Zy.uniformsGroups;for(let HI=0,kI=GI.length;HI<kI;HI++){const zR=GI[HI];qC.update(zR,NI),qC.bind(zR,NI)}}return NI}function Vy(em,Fy){em.ambientLightColor.needsUpdate=Fy,em.lightProbe.needsUpdate=Fy,em.directionalLights.needsUpdate=Fy,em.directionalLightShadows.needsUpdate=Fy,em.pointLights.needsUpdate=Fy,em.pointLightShadows.needsUpdate=Fy,em.spotLights.needsUpdate=Fy,em.spotLightShadows.needsUpdate=Fy,em.rectAreaLights.needsUpdate=Fy,em.hemisphereLights.needsUpdate=Fy}function nm(em){return em.isMeshLambertMaterial||em.isMeshToonMaterial||em.isMeshPhongMaterial||em.isMeshStandardMaterial||em.isShadowMaterial||em.isShaderMaterial&&em.lights===!0}this.getActiveCubeFace=function(){return fs},this.getActiveMipmapLevel=function(){return Gs},this.getRenderTarget=function(){return ga},this.setRenderTargetTextures=function(em,Fy,Uy){pA.get(em.texture).__webglTexture=Fy,pA.get(em.depthTexture).__webglTexture=Uy;const Zy=pA.get(em);Zy.__hasExternalTextures=!0,Zy.__autoAllocateDepthBuffer=Uy===void 0,Zy.__autoAllocateDepthBuffer||FA.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),Zy.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(em,Fy){const Uy=pA.get(em);Uy.__webglFramebuffer=Fy,Uy.__useDefaultFramebuffer=Fy===void 0},this.setRenderTarget=function(em,Fy=0,Uy=0){ga=em,fs=Fy,Gs=Uy;let Zy=!0,NA=null,JA=!1,hE=!1;if(em){const OC=pA.get(em);OC.__useDefaultFramebuffer!==void 0?(aE.bindFramebuffer(PA.FRAMEBUFFER,null),Zy=!1):OC.__webglFramebuffer===void 0?Ry.setupRenderTarget(em):OC.__hasExternalTextures&&Ry.rebindTextures(em,pA.get(em.texture).__webglTexture,pA.get(em.depthTexture).__webglTexture);const PC=em.texture;(PC.isData3DTexture||PC.isDataArrayTexture||PC.isCompressedArrayTexture)&&(hE=!0);const VC=pA.get(em).__webglFramebuffer;em.isWebGLCubeRenderTarget?(Array.isArray(VC[Fy])?NA=VC[Fy][Uy]:NA=VC[Fy],JA=!0):em.samples>0&&Ry.useMultisampledRTT(em)===!1?NA=pA.get(em).__webglMultisampledFramebuffer:Array.isArray(VC)?NA=VC[Uy]:NA=VC,xo.copy(em.viewport),Mo.copy(em.scissor),yl=em.scissorTest}else xo.copy(tp).multiplyScalar(np).floor(),Mo.copy(El).multiplyScalar(np).floor(),yl=sp;if(aE.bindFramebuffer(PA.FRAMEBUFFER,NA)&&Zy&&aE.drawBuffers(em,NA),aE.viewport(xo),aE.scissor(Mo),aE.setScissorTest(yl),JA){const OC=pA.get(em.texture);PA.framebufferTexture2D(PA.FRAMEBUFFER,PA.COLOR_ATTACHMENT0,PA.TEXTURE_CUBE_MAP_POSITIVE_X+Fy,OC.__webglTexture,Uy)}else if(hE){const OC=pA.get(em.texture),PC=Fy||0;PA.framebufferTextureLayer(PA.FRAMEBUFFER,PA.COLOR_ATTACHMENT0,OC.__webglTexture,Uy||0,PC)}So=-1},this.readRenderTargetPixels=function(em,Fy,Uy,Zy,NA,JA,hE){if(!(em&&em.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let MC=pA.get(em).__webglFramebuffer;if(em.isWebGLCubeRenderTarget&&hE!==void 0&&(MC=MC[hE]),MC){aE.bindFramebuffer(PA.FRAMEBUFFER,MC);try{const OC=em.texture,PC=OC.format,VC=OC.type;if(PC!==RGBAFormat&&QC.convert(PC)!==PA.getParameter(PA.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const UC=VC===HalfFloatType&&(FA.has("EXT_color_buffer_half_float")||FA.has("EXT_color_buffer_float"));if(VC!==UnsignedByteType&&QC.convert(VC)!==PA.getParameter(PA.IMPLEMENTATION_COLOR_READ_TYPE)&&VC!==FloatType&&!UC){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Fy>=0&&Fy<=em.width-Zy&&Uy>=0&&Uy<=em.height-NA&&PA.readPixels(Fy,Uy,Zy,NA,QC.convert(PC),QC.convert(VC),JA)}finally{const OC=ga!==null?pA.get(ga).__webglFramebuffer:null;aE.bindFramebuffer(PA.FRAMEBUFFER,OC)}}},this.copyFramebufferToTexture=function(em,Fy,Uy=0){const Zy=Math.pow(2,-Uy),NA=Math.floor(Fy.image.width*Zy),JA=Math.floor(Fy.image.height*Zy);Ry.setTexture2D(Fy,0),PA.copyTexSubImage2D(PA.TEXTURE_2D,Uy,0,0,em.x,em.y,NA,JA),aE.unbindTexture()},this.copyTextureToTexture=function(em,Fy,Uy,Zy=0){const NA=Fy.image.width,JA=Fy.image.height,hE=QC.convert(Uy.format),MC=QC.convert(Uy.type);Ry.setTexture2D(Uy,0),PA.pixelStorei(PA.UNPACK_FLIP_Y_WEBGL,Uy.flipY),PA.pixelStorei(PA.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Uy.premultiplyAlpha),PA.pixelStorei(PA.UNPACK_ALIGNMENT,Uy.unpackAlignment),Fy.isDataTexture?PA.texSubImage2D(PA.TEXTURE_2D,Zy,em.x,em.y,NA,JA,hE,MC,Fy.image.data):Fy.isCompressedTexture?PA.compressedTexSubImage2D(PA.TEXTURE_2D,Zy,em.x,em.y,Fy.mipmaps[0].width,Fy.mipmaps[0].height,hE,Fy.mipmaps[0].data):PA.texSubImage2D(PA.TEXTURE_2D,Zy,em.x,em.y,hE,MC,Fy.image),Zy===0&&Uy.generateMipmaps&&PA.generateMipmap(PA.TEXTURE_2D),aE.unbindTexture()},this.copyTextureToTexture3D=function(em,Fy,Uy,Zy,NA=0){const JA=Math.round(em.max.x-em.min.x),hE=Math.round(em.max.y-em.min.y),MC=em.max.z-em.min.z+1,OC=QC.convert(Zy.format),PC=QC.convert(Zy.type);let VC;if(Zy.isData3DTexture)Ry.setTexture3D(Zy,0),VC=PA.TEXTURE_3D;else if(Zy.isDataArrayTexture||Zy.isCompressedArrayTexture)Ry.setTexture2DArray(Zy,0),VC=PA.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}PA.pixelStorei(PA.UNPACK_FLIP_Y_WEBGL,Zy.flipY),PA.pixelStorei(PA.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Zy.premultiplyAlpha),PA.pixelStorei(PA.UNPACK_ALIGNMENT,Zy.unpackAlignment);const UC=PA.getParameter(PA.UNPACK_ROW_LENGTH),jC=PA.getParameter(PA.UNPACK_IMAGE_HEIGHT),rI=PA.getParameter(PA.UNPACK_SKIP_PIXELS),nI=PA.getParameter(PA.UNPACK_SKIP_ROWS),sI=PA.getParameter(PA.UNPACK_SKIP_IMAGES),XC=Uy.isCompressedTexture?Uy.mipmaps[NA]:Uy.image;PA.pixelStorei(PA.UNPACK_ROW_LENGTH,XC.width),PA.pixelStorei(PA.UNPACK_IMAGE_HEIGHT,XC.height),PA.pixelStorei(PA.UNPACK_SKIP_PIXELS,em.min.x),PA.pixelStorei(PA.UNPACK_SKIP_ROWS,em.min.y),PA.pixelStorei(PA.UNPACK_SKIP_IMAGES,em.min.z),Uy.isDataTexture||Uy.isData3DTexture?PA.texSubImage3D(VC,NA,Fy.x,Fy.y,Fy.z,JA,hE,MC,OC,PC,XC.data):Zy.isCompressedArrayTexture?PA.compressedTexSubImage3D(VC,NA,Fy.x,Fy.y,Fy.z,JA,hE,MC,OC,XC.data):PA.texSubImage3D(VC,NA,Fy.x,Fy.y,Fy.z,JA,hE,MC,OC,PC,XC),PA.pixelStorei(PA.UNPACK_ROW_LENGTH,UC),PA.pixelStorei(PA.UNPACK_IMAGE_HEIGHT,jC),PA.pixelStorei(PA.UNPACK_SKIP_PIXELS,rI),PA.pixelStorei(PA.UNPACK_SKIP_ROWS,nI),PA.pixelStorei(PA.UNPACK_SKIP_IMAGES,sI),NA===0&&Zy.generateMipmaps&&PA.generateMipmap(VC),aE.unbindTexture()},this.initTexture=function(em){em.isCubeTexture?Ry.setTextureCube(em,0):em.isData3DTexture?Ry.setTexture3D(em,0):em.isDataArrayTexture||em.isCompressedArrayTexture?Ry.setTexture2DArray(em,0):Ry.setTexture2D(em,0),aE.unbindTexture()},this.resetState=function(){fs=0,Gs=0,ga=null,aE.reset(),WC.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return WebGLCoordinateSystem}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(s){this._outputColorSpace=s;const a=this.getContext();a.drawingBufferColorSpace=s===DisplayP3ColorSpace?"display-p3":"srgb",a.unpackColorSpace=ColorManagement.workingColorSpace===LinearDisplayP3ColorSpace?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(s){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=s}}class FogExp2{constructor(s,a=25e-5){this.isFogExp2=!0,this.name="",this.color=new Color$1(s),this.density=a}clone(){return new FogExp2(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Fog{constructor(s,a=1,b=1e3){this.isFog=!0,this.name="",this.color=new Color$1(s),this.near=a,this.far=b}clone(){return new Fog(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Scene extends Object3D{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Euler,this.environmentIntensity=1,this.environmentRotation=new Euler,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(s,a){return super.copy(s,a),s.background!==null&&(this.background=s.background.clone()),s.environment!==null&&(this.environment=s.environment.clone()),s.fog!==null&&(this.fog=s.fog.clone()),this.backgroundBlurriness=s.backgroundBlurriness,this.backgroundIntensity=s.backgroundIntensity,this.backgroundRotation.copy(s.backgroundRotation),this.environmentIntensity=s.environmentIntensity,this.environmentRotation.copy(s.environmentRotation),s.overrideMaterial!==null&&(this.overrideMaterial=s.overrideMaterial.clone()),this.matrixAutoUpdate=s.matrixAutoUpdate,this}toJSON(s){const a=super.toJSON(s);return this.fog!==null&&(a.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(a.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(a.object.backgroundIntensity=this.backgroundIntensity),a.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(a.object.environmentIntensity=this.environmentIntensity),a.object.environmentRotation=this.environmentRotation.toArray(),a}}class InterleavedBuffer{constructor(s,a){this.isInterleavedBuffer=!0,this.array=s,this.stride=a,this.count=s!==void 0?s.length/a:0,this.usage=StaticDrawUsage,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=generateUUID()}onUploadCallback(){}set needsUpdate(s){s===!0&&this.version++}get updateRange(){return warnOnce("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(s){return this.usage=s,this}addUpdateRange(s,a){this.updateRanges.push({start:s,count:a})}clearUpdateRanges(){this.updateRanges.length=0}copy(s){return this.array=new s.array.constructor(s.array),this.count=s.count,this.stride=s.stride,this.usage=s.usage,this}copyAt(s,a,b){s*=this.stride,b*=a.stride;for(let _e=0,Kt=this.stride;_e<Kt;_e++)this.array[s+_e]=a.array[b+_e];return this}set(s,a=0){return this.array.set(s,a),this}clone(s){s.arrayBuffers===void 0&&(s.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=generateUUID()),s.arrayBuffers[this.array.buffer._uuid]===void 0&&(s.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const a=new this.array.constructor(s.arrayBuffers[this.array.buffer._uuid]),b=new this.constructor(a,this.stride);return b.setUsage(this.usage),b}onUpload(s){return this.onUploadCallback=s,this}toJSON(s){return s.arrayBuffers===void 0&&(s.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=generateUUID()),s.arrayBuffers[this.array.buffer._uuid]===void 0&&(s.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const _vector$6=new Vector3;class InterleavedBufferAttribute{constructor(s,a,b,_e=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=s,this.itemSize=a,this.offset=b,this.normalized=_e}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(s){this.data.needsUpdate=s}applyMatrix4(s){for(let a=0,b=this.data.count;a<b;a++)_vector$6.fromBufferAttribute(this,a),_vector$6.applyMatrix4(s),this.setXYZ(a,_vector$6.x,_vector$6.y,_vector$6.z);return this}applyNormalMatrix(s){for(let a=0,b=this.count;a<b;a++)_vector$6.fromBufferAttribute(this,a),_vector$6.applyNormalMatrix(s),this.setXYZ(a,_vector$6.x,_vector$6.y,_vector$6.z);return this}transformDirection(s){for(let a=0,b=this.count;a<b;a++)_vector$6.fromBufferAttribute(this,a),_vector$6.transformDirection(s),this.setXYZ(a,_vector$6.x,_vector$6.y,_vector$6.z);return this}getComponent(s,a){let b=this.array[s*this.data.stride+this.offset+a];return this.normalized&&(b=denormalize(b,this.array)),b}setComponent(s,a,b){return this.normalized&&(b=normalize(b,this.array)),this.data.array[s*this.data.stride+this.offset+a]=b,this}setX(s,a){return this.normalized&&(a=normalize(a,this.array)),this.data.array[s*this.data.stride+this.offset]=a,this}setY(s,a){return this.normalized&&(a=normalize(a,this.array)),this.data.array[s*this.data.stride+this.offset+1]=a,this}setZ(s,a){return this.normalized&&(a=normalize(a,this.array)),this.data.array[s*this.data.stride+this.offset+2]=a,this}setW(s,a){return this.normalized&&(a=normalize(a,this.array)),this.data.array[s*this.data.stride+this.offset+3]=a,this}getX(s){let a=this.data.array[s*this.data.stride+this.offset];return this.normalized&&(a=denormalize(a,this.array)),a}getY(s){let a=this.data.array[s*this.data.stride+this.offset+1];return this.normalized&&(a=denormalize(a,this.array)),a}getZ(s){let a=this.data.array[s*this.data.stride+this.offset+2];return this.normalized&&(a=denormalize(a,this.array)),a}getW(s){let a=this.data.array[s*this.data.stride+this.offset+3];return this.normalized&&(a=denormalize(a,this.array)),a}setXY(s,a,b){return s=s*this.data.stride+this.offset,this.normalized&&(a=normalize(a,this.array),b=normalize(b,this.array)),this.data.array[s+0]=a,this.data.array[s+1]=b,this}setXYZ(s,a,b,_e){return s=s*this.data.stride+this.offset,this.normalized&&(a=normalize(a,this.array),b=normalize(b,this.array),_e=normalize(_e,this.array)),this.data.array[s+0]=a,this.data.array[s+1]=b,this.data.array[s+2]=_e,this}setXYZW(s,a,b,_e,Kt){return s=s*this.data.stride+this.offset,this.normalized&&(a=normalize(a,this.array),b=normalize(b,this.array),_e=normalize(_e,this.array),Kt=normalize(Kt,this.array)),this.data.array[s+0]=a,this.data.array[s+1]=b,this.data.array[s+2]=_e,this.data.array[s+3]=Kt,this}clone(s){if(s===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const a=[];for(let b=0;b<this.count;b++){const _e=b*this.data.stride+this.offset;for(let Kt=0;Kt<this.itemSize;Kt++)a.push(this.data.array[_e+Kt])}return new BufferAttribute(new this.array.constructor(a),this.itemSize,this.normalized)}else return s.interleavedBuffers===void 0&&(s.interleavedBuffers={}),s.interleavedBuffers[this.data.uuid]===void 0&&(s.interleavedBuffers[this.data.uuid]=this.data.clone(s)),new InterleavedBufferAttribute(s.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(s){if(s===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const a=[];for(let b=0;b<this.count;b++){const _e=b*this.data.stride+this.offset;for(let Kt=0;Kt<this.itemSize;Kt++)a.push(this.data.array[_e+Kt])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:a,normalized:this.normalized}}else return s.interleavedBuffers===void 0&&(s.interleavedBuffers={}),s.interleavedBuffers[this.data.uuid]===void 0&&(s.interleavedBuffers[this.data.uuid]=this.data.toJSON(s)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class SpriteMaterial extends Material{constructor(s){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Color$1(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(s)}copy(s){return super.copy(s),this.color.copy(s.color),this.map=s.map,this.alphaMap=s.alphaMap,this.rotation=s.rotation,this.sizeAttenuation=s.sizeAttenuation,this.fog=s.fog,this}}let _geometry;const _intersectPoint=new Vector3,_worldScale=new Vector3,_mvPosition=new Vector3,_alignedPosition=new Vector2,_rotatedPosition=new Vector2,_viewWorldMatrix=new Matrix4,_vA=new Vector3,_vB=new Vector3,_vC=new Vector3,_uvA=new Vector2,_uvB=new Vector2,_uvC=new Vector2;class Sprite extends Object3D{constructor(s=new SpriteMaterial){if(super(),this.isSprite=!0,this.type="Sprite",_geometry===void 0){_geometry=new BufferGeometry;const a=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),b=new InterleavedBuffer(a,5);_geometry.setIndex([0,1,2,0,2,3]),_geometry.setAttribute("position",new InterleavedBufferAttribute(b,3,0,!1)),_geometry.setAttribute("uv",new InterleavedBufferAttribute(b,2,3,!1))}this.geometry=_geometry,this.material=s,this.center=new Vector2(.5,.5)}raycast(s,a){s.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),_worldScale.setFromMatrixScale(this.matrixWorld),_viewWorldMatrix.copy(s.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(s.camera.matrixWorldInverse,this.matrixWorld),_mvPosition.setFromMatrixPosition(this.modelViewMatrix),s.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&_worldScale.multiplyScalar(-_mvPosition.z);const b=this.material.rotation;let _e,Kt;b!==0&&(Kt=Math.cos(b),_e=Math.sin(b));const an=this.center;transformVertex(_vA.set(-.5,-.5,0),_mvPosition,an,_worldScale,_e,Kt),transformVertex(_vB.set(.5,-.5,0),_mvPosition,an,_worldScale,_e,Kt),transformVertex(_vC.set(.5,.5,0),_mvPosition,an,_worldScale,_e,Kt),_uvA.set(0,0),_uvB.set(1,0),_uvC.set(1,1);let _n=s.ray.intersectTriangle(_vA,_vB,_vC,!1,_intersectPoint);if(_n===null&&(transformVertex(_vB.set(-.5,.5,0),_mvPosition,an,_worldScale,_e,Kt),_uvB.set(0,1),_n=s.ray.intersectTriangle(_vA,_vC,_vB,!1,_intersectPoint),_n===null))return;const On=s.ray.origin.distanceTo(_intersectPoint);On<s.near||On>s.far||a.push({distance:On,point:_intersectPoint.clone(),uv:Triangle.getInterpolation(_intersectPoint,_vA,_vB,_vC,_uvA,_uvB,_uvC,new Vector2),face:null,object:this})}copy(s,a){return super.copy(s,a),s.center!==void 0&&this.center.copy(s.center),this.material=s.material,this}}function transformVertex(o,s,a,b,_e,Kt){_alignedPosition.subVectors(o,a).addScalar(.5).multiply(b),_e!==void 0?(_rotatedPosition.x=Kt*_alignedPosition.x-_e*_alignedPosition.y,_rotatedPosition.y=_e*_alignedPosition.x+Kt*_alignedPosition.y):_rotatedPosition.copy(_alignedPosition),o.copy(s),o.x+=_rotatedPosition.x,o.y+=_rotatedPosition.y,o.applyMatrix4(_viewWorldMatrix)}const _v1$2=new Vector3,_v2$1=new Vector3;class LOD extends Object3D{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(s){super.copy(s,!1);const a=s.levels;for(let b=0,_e=a.length;b<_e;b++){const Kt=a[b];this.addLevel(Kt.object.clone(),Kt.distance,Kt.hysteresis)}return this.autoUpdate=s.autoUpdate,this}addLevel(s,a=0,b=0){a=Math.abs(a);const _e=this.levels;let Kt;for(Kt=0;Kt<_e.length&&!(a<_e[Kt].distance);Kt++);return _e.splice(Kt,0,{distance:a,hysteresis:b,object:s}),this.add(s),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(s){const a=this.levels;if(a.length>0){let b,_e;for(b=1,_e=a.length;b<_e;b++){let Kt=a[b].distance;if(a[b].object.visible&&(Kt-=Kt*a[b].hysteresis),s<Kt)break}return a[b-1].object}return null}raycast(s,a){if(this.levels.length>0){_v1$2.setFromMatrixPosition(this.matrixWorld);const _e=s.ray.origin.distanceTo(_v1$2);this.getObjectForDistance(_e).raycast(s,a)}}update(s){const a=this.levels;if(a.length>1){_v1$2.setFromMatrixPosition(s.matrixWorld),_v2$1.setFromMatrixPosition(this.matrixWorld);const b=_v1$2.distanceTo(_v2$1)/s.zoom;a[0].object.visible=!0;let _e,Kt;for(_e=1,Kt=a.length;_e<Kt;_e++){let an=a[_e].distance;if(a[_e].object.visible&&(an-=an*a[_e].hysteresis),b>=an)a[_e-1].object.visible=!1,a[_e].object.visible=!0;else break}for(this._currentLevel=_e-1;_e<Kt;_e++)a[_e].object.visible=!1}}toJSON(s){const a=super.toJSON(s);this.autoUpdate===!1&&(a.object.autoUpdate=!1),a.object.levels=[];const b=this.levels;for(let _e=0,Kt=b.length;_e<Kt;_e++){const an=b[_e];a.object.levels.push({object:an.object.uuid,distance:an.distance,hysteresis:an.hysteresis})}return a}}const _basePosition=new Vector3,_skinIndex=new Vector4,_skinWeight=new Vector4,_vector3=new Vector3,_matrix4=new Matrix4,_vertex=new Vector3,_sphere$4=new Sphere,_inverseMatrix$2=new Matrix4,_ray$2=new Ray;class SkinnedMesh extends Mesh{constructor(s,a){super(s,a),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=AttachedBindMode,this.bindMatrix=new Matrix4,this.bindMatrixInverse=new Matrix4,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const s=this.geometry;this.boundingBox===null&&(this.boundingBox=new Box3),this.boundingBox.makeEmpty();const a=s.getAttribute("position");for(let b=0;b<a.count;b++)this.getVertexPosition(b,_vertex),this.boundingBox.expandByPoint(_vertex)}computeBoundingSphere(){const s=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Sphere),this.boundingSphere.makeEmpty();const a=s.getAttribute("position");for(let b=0;b<a.count;b++)this.getVertexPosition(b,_vertex),this.boundingSphere.expandByPoint(_vertex)}copy(s,a){return super.copy(s,a),this.bindMode=s.bindMode,this.bindMatrix.copy(s.bindMatrix),this.bindMatrixInverse.copy(s.bindMatrixInverse),this.skeleton=s.skeleton,s.boundingBox!==null&&(this.boundingBox=s.boundingBox.clone()),s.boundingSphere!==null&&(this.boundingSphere=s.boundingSphere.clone()),this}raycast(s,a){const b=this.material,_e=this.matrixWorld;b!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),_sphere$4.copy(this.boundingSphere),_sphere$4.applyMatrix4(_e),s.ray.intersectsSphere(_sphere$4)!==!1&&(_inverseMatrix$2.copy(_e).invert(),_ray$2.copy(s.ray).applyMatrix4(_inverseMatrix$2),!(this.boundingBox!==null&&_ray$2.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(s,a,_ray$2)))}getVertexPosition(s,a){return super.getVertexPosition(s,a),this.applyBoneTransform(s,a),a}bind(s,a){this.skeleton=s,a===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),a=this.matrixWorld),this.bindMatrix.copy(a),this.bindMatrixInverse.copy(a).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const s=new Vector4,a=this.geometry.attributes.skinWeight;for(let b=0,_e=a.count;b<_e;b++){s.fromBufferAttribute(a,b);const Kt=1/s.manhattanLength();Kt!==1/0?s.multiplyScalar(Kt):s.set(1,0,0,0),a.setXYZW(b,s.x,s.y,s.z,s.w)}}updateMatrixWorld(s){super.updateMatrixWorld(s),this.bindMode===AttachedBindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===DetachedBindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(s,a){const b=this.skeleton,_e=this.geometry;_skinIndex.fromBufferAttribute(_e.attributes.skinIndex,s),_skinWeight.fromBufferAttribute(_e.attributes.skinWeight,s),_basePosition.copy(a).applyMatrix4(this.bindMatrix),a.set(0,0,0);for(let Kt=0;Kt<4;Kt++){const an=_skinWeight.getComponent(Kt);if(an!==0){const _n=_skinIndex.getComponent(Kt);_matrix4.multiplyMatrices(b.bones[_n].matrixWorld,b.boneInverses[_n]),a.addScaledVector(_vector3.copy(_basePosition).applyMatrix4(_matrix4),an)}}return a.applyMatrix4(this.bindMatrixInverse)}}class Bone extends Object3D{constructor(){super(),this.isBone=!0,this.type="Bone"}}class DataTexture extends Texture{constructor(s=null,a=1,b=1,_e,Kt,an,_n,On,$n=NearestFilter,dr=NearestFilter,fr,pr){super(null,an,_n,On,$n,dr,_e,Kt,fr,pr),this.isDataTexture=!0,this.image={data:s,width:a,height:b},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const _offsetMatrix=new Matrix4,_identityMatrix$1=new Matrix4;class Skeleton{constructor(s=[],a=[]){this.uuid=generateUUID(),this.bones=s.slice(0),this.boneInverses=a,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const s=this.bones,a=this.boneInverses;if(this.boneMatrices=new Float32Array(s.length*16),a.length===0)this.calculateInverses();else if(s.length!==a.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let b=0,_e=this.bones.length;b<_e;b++)this.boneInverses.push(new Matrix4)}}calculateInverses(){this.boneInverses.length=0;for(let s=0,a=this.bones.length;s<a;s++){const b=new Matrix4;this.bones[s]&&b.copy(this.bones[s].matrixWorld).invert(),this.boneInverses.push(b)}}pose(){for(let s=0,a=this.bones.length;s<a;s++){const b=this.bones[s];b&&b.matrixWorld.copy(this.boneInverses[s]).invert()}for(let s=0,a=this.bones.length;s<a;s++){const b=this.bones[s];b&&(b.parent&&b.parent.isBone?(b.matrix.copy(b.parent.matrixWorld).invert(),b.matrix.multiply(b.matrixWorld)):b.matrix.copy(b.matrixWorld),b.matrix.decompose(b.position,b.quaternion,b.scale))}}update(){const s=this.bones,a=this.boneInverses,b=this.boneMatrices,_e=this.boneTexture;for(let Kt=0,an=s.length;Kt<an;Kt++){const _n=s[Kt]?s[Kt].matrixWorld:_identityMatrix$1;_offsetMatrix.multiplyMatrices(_n,a[Kt]),_offsetMatrix.toArray(b,Kt*16)}_e!==null&&(_e.needsUpdate=!0)}clone(){return new Skeleton(this.bones,this.boneInverses)}computeBoneTexture(){let s=Math.sqrt(this.bones.length*4);s=Math.ceil(s/4)*4,s=Math.max(s,4);const a=new Float32Array(s*s*4);a.set(this.boneMatrices);const b=new DataTexture(a,s,s,RGBAFormat,FloatType);return b.needsUpdate=!0,this.boneMatrices=a,this.boneTexture=b,this}getBoneByName(s){for(let a=0,b=this.bones.length;a<b;a++){const _e=this.bones[a];if(_e.name===s)return _e}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(s,a){this.uuid=s.uuid;for(let b=0,_e=s.bones.length;b<_e;b++){const Kt=s.bones[b];let an=a[Kt];an===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",Kt),an=new Bone),this.bones.push(an),this.boneInverses.push(new Matrix4().fromArray(s.boneInverses[b]))}return this.init(),this}toJSON(){const s={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};s.uuid=this.uuid;const a=this.bones,b=this.boneInverses;for(let _e=0,Kt=a.length;_e<Kt;_e++){const an=a[_e];s.bones.push(an.uuid);const _n=b[_e];s.boneInverses.push(_n.toArray())}return s}}class InstancedBufferAttribute extends BufferAttribute{constructor(s,a,b,_e=1){super(s,a,b),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=_e}copy(s){return super.copy(s),this.meshPerAttribute=s.meshPerAttribute,this}toJSON(){const s=super.toJSON();return s.meshPerAttribute=this.meshPerAttribute,s.isInstancedBufferAttribute=!0,s}}const _instanceLocalMatrix=new Matrix4,_instanceWorldMatrix=new Matrix4,_instanceIntersects=[],_box3=new Box3,_identity=new Matrix4,_mesh$1=new Mesh,_sphere$3=new Sphere;class InstancedMesh extends Mesh{constructor(s,a,b){super(s,a),this.isInstancedMesh=!0,this.instanceMatrix=new InstancedBufferAttribute(new Float32Array(b*16),16),this.instanceColor=null,this.morphTexture=null,this.count=b,this.boundingBox=null,this.boundingSphere=null;for(let _e=0;_e<b;_e++)this.setMatrixAt(_e,_identity)}computeBoundingBox(){const s=this.geometry,a=this.count;this.boundingBox===null&&(this.boundingBox=new Box3),s.boundingBox===null&&s.computeBoundingBox(),this.boundingBox.makeEmpty();for(let b=0;b<a;b++)this.getMatrixAt(b,_instanceLocalMatrix),_box3.copy(s.boundingBox).applyMatrix4(_instanceLocalMatrix),this.boundingBox.union(_box3)}computeBoundingSphere(){const s=this.geometry,a=this.count;this.boundingSphere===null&&(this.boundingSphere=new Sphere),s.boundingSphere===null&&s.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let b=0;b<a;b++)this.getMatrixAt(b,_instanceLocalMatrix),_sphere$3.copy(s.boundingSphere).applyMatrix4(_instanceLocalMatrix),this.boundingSphere.union(_sphere$3)}copy(s,a){return super.copy(s,a),this.instanceMatrix.copy(s.instanceMatrix),s.morphTexture!==null&&(this.morphTexture=s.morphTexture.clone()),s.instanceColor!==null&&(this.instanceColor=s.instanceColor.clone()),this.count=s.count,s.boundingBox!==null&&(this.boundingBox=s.boundingBox.clone()),s.boundingSphere!==null&&(this.boundingSphere=s.boundingSphere.clone()),this}getColorAt(s,a){a.fromArray(this.instanceColor.array,s*3)}getMatrixAt(s,a){a.fromArray(this.instanceMatrix.array,s*16)}getMorphAt(s,a){const b=a.morphTargetInfluences,_e=this.morphTexture.source.data.data,Kt=b.length+1,an=s*Kt+1;for(let _n=0;_n<b.length;_n++)b[_n]=_e[an+_n]}raycast(s,a){const b=this.matrixWorld,_e=this.count;if(_mesh$1.geometry=this.geometry,_mesh$1.material=this.material,_mesh$1.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),_sphere$3.copy(this.boundingSphere),_sphere$3.applyMatrix4(b),s.ray.intersectsSphere(_sphere$3)!==!1))for(let Kt=0;Kt<_e;Kt++){this.getMatrixAt(Kt,_instanceLocalMatrix),_instanceWorldMatrix.multiplyMatrices(b,_instanceLocalMatrix),_mesh$1.matrixWorld=_instanceWorldMatrix,_mesh$1.raycast(s,_instanceIntersects);for(let an=0,_n=_instanceIntersects.length;an<_n;an++){const On=_instanceIntersects[an];On.instanceId=Kt,On.object=this,a.push(On)}_instanceIntersects.length=0}}setColorAt(s,a){this.instanceColor===null&&(this.instanceColor=new InstancedBufferAttribute(new Float32Array(this.instanceMatrix.count*3),3)),a.toArray(this.instanceColor.array,s*3)}setMatrixAt(s,a){a.toArray(this.instanceMatrix.array,s*16)}setMorphAt(s,a){const b=a.morphTargetInfluences,_e=b.length+1;this.morphTexture===null&&(this.morphTexture=new DataTexture(new Float32Array(_e*this.count),_e,this.count,RedFormat,FloatType));const Kt=this.morphTexture.source.data.data;let an=0;for(let $n=0;$n<b.length;$n++)an+=b[$n];const _n=this.geometry.morphTargetsRelative?1:1-an,On=_e*s;Kt[On]=_n,Kt.set(b,On+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}}function sortOpaque(o,s){return o.z-s.z}function sortTransparent(o,s){return s.z-o.z}class MultiDrawRenderList{constructor(){this.index=0,this.pool=[],this.list=[]}push(s,a){const b=this.pool,_e=this.list;this.index>=b.length&&b.push({start:-1,count:-1,z:-1});const Kt=b[this.index];_e.push(Kt),this.index++,Kt.start=s.start,Kt.count=s.count,Kt.z=a}reset(){this.list.length=0,this.index=0}}const ID_ATTR_NAME="batchId",_matrix$1=new Matrix4,_invMatrixWorld=new Matrix4,_identityMatrix$2=new Matrix4,_projScreenMatrix$2=new Matrix4,_frustum=new Frustum,_box$1=new Box3,_sphere$2=new Sphere,_vector$5=new Vector3,_renderList=new MultiDrawRenderList,_mesh=new Mesh,_batchIntersects=[];function copyAttributeData(o,s,a=0){const b=s.itemSize;if(o.isInterleavedBufferAttribute||o.array.constructor!==s.array.constructor){const _e=o.count;for(let Kt=0;Kt<_e;Kt++)for(let an=0;an<b;an++)s.setComponent(Kt+a,an,o.getComponent(Kt,an))}else s.array.set(o.array,a*b);s.needsUpdate=!0}class BatchedMesh extends Mesh{get maxGeometryCount(){return this._maxGeometryCount}constructor(s,a,b=a*2,_e){super(new BufferGeometry,_e),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._drawRanges=[],this._reservedRanges=[],this._visibility=[],this._active=[],this._bounds=[],this._maxGeometryCount=s,this._maxVertexCount=a,this._maxIndexCount=b,this._geometryInitialized=!1,this._geometryCount=0,this._multiDrawCounts=new Int32Array(s),this._multiDrawStarts=new Int32Array(s),this._multiDrawCount=0,this._visibilityChanged=!0,this._matricesTexture=null,this._initMatricesTexture()}_initMatricesTexture(){let s=Math.sqrt(this._maxGeometryCount*4);s=Math.ceil(s/4)*4,s=Math.max(s,4);const a=new Float32Array(s*s*4),b=new DataTexture(a,s,s,RGBAFormat,FloatType);this._matricesTexture=b}_initializeGeometry(s){const a=this.geometry,b=this._maxVertexCount,_e=this._maxGeometryCount,Kt=this._maxIndexCount;if(this._geometryInitialized===!1){for(const _n in s.attributes){const On=s.getAttribute(_n),{array:$n,itemSize:dr,normalized:fr}=On,pr=new $n.constructor(b*dr),Ar=new BufferAttribute(pr,dr,fr);a.setAttribute(_n,Ar)}if(s.getIndex()!==null){const _n=b>65536?new Uint32Array(Kt):new Uint16Array(Kt);a.setIndex(new BufferAttribute(_n,1))}const an=_e>65536?new Uint32Array(b):new Uint16Array(b);a.setAttribute(ID_ATTR_NAME,new BufferAttribute(an,1)),this._geometryInitialized=!0}}_validateGeometry(s){if(s.getAttribute(ID_ATTR_NAME))throw new Error(`BatchedMesh: Geometry cannot use attribute "${ID_ATTR_NAME}"`);const a=this.geometry;if(!!s.getIndex()!=!!a.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const b in a.attributes){if(b===ID_ATTR_NAME)continue;if(!s.hasAttribute(b))throw new Error(`BatchedMesh: Added geometry missing "${b}". All geometries must have consistent attributes.`);const _e=s.getAttribute(b),Kt=a.getAttribute(b);if(_e.itemSize!==Kt.itemSize||_e.normalized!==Kt.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(s){return this.customSort=s,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Box3);const s=this._geometryCount,a=this.boundingBox,b=this._active;a.makeEmpty();for(let _e=0;_e<s;_e++)b[_e]!==!1&&(this.getMatrixAt(_e,_matrix$1),this.getBoundingBoxAt(_e,_box$1).applyMatrix4(_matrix$1),a.union(_box$1))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Sphere);const s=this._geometryCount,a=this.boundingSphere,b=this._active;a.makeEmpty();for(let _e=0;_e<s;_e++)b[_e]!==!1&&(this.getMatrixAt(_e,_matrix$1),this.getBoundingSphereAt(_e,_sphere$2).applyMatrix4(_matrix$1),a.union(_sphere$2))}addGeometry(s,a=-1,b=-1){if(this._initializeGeometry(s),this._validateGeometry(s),this._geometryCount>=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const _e={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let Kt=null;const an=this._reservedRanges,_n=this._drawRanges,On=this._bounds;this._geometryCount!==0&&(Kt=an[an.length-1]),a===-1?_e.vertexCount=s.getAttribute("position").count:_e.vertexCount=a,Kt===null?_e.vertexStart=0:_e.vertexStart=Kt.vertexStart+Kt.vertexCount;const $n=s.getIndex(),dr=$n!==null;if(dr&&(b===-1?_e.indexCount=$n.count:_e.indexCount=b,Kt===null?_e.indexStart=0:_e.indexStart=Kt.indexStart+Kt.indexCount),_e.indexStart!==-1&&_e.indexStart+_e.indexCount>this._maxIndexCount||_e.vertexStart+_e.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const fr=this._visibility,pr=this._active,Ar=this._matricesTexture,Or=this._matricesTexture.image.data;fr.push(!0),pr.push(!0);const Xr=this._geometryCount;this._geometryCount++,_identityMatrix$2.toArray(Or,Xr*16),Ar.needsUpdate=!0,an.push(_e),_n.push({start:dr?_e.indexStart:_e.vertexStart,count:-1}),On.push({boxInitialized:!1,box:new Box3,sphereInitialized:!1,sphere:new Sphere});const ss=this.geometry.getAttribute(ID_ATTR_NAME);for(let kr=0;kr<_e.vertexCount;kr++)ss.setX(_e.vertexStart+kr,Xr);return ss.needsUpdate=!0,this.setGeometryAt(Xr,s),Xr}setGeometryAt(s,a){if(s>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(a);const b=this.geometry,_e=b.getIndex()!==null,Kt=b.getIndex(),an=a.getIndex(),_n=this._reservedRanges[s];if(_e&&an.count>_n.indexCount||a.attributes.position.count>_n.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const On=_n.vertexStart,$n=_n.vertexCount;for(const Ar in b.attributes){if(Ar===ID_ATTR_NAME)continue;const Or=a.getAttribute(Ar),Xr=b.getAttribute(Ar);copyAttributeData(Or,Xr,On);const ss=Or.itemSize;for(let kr=Or.count,us=$n;kr<us;kr++){const hs=On+kr;for(let ds=0;ds<ss;ds++)Xr.setComponent(hs,ds,0)}Xr.needsUpdate=!0,Xr.addUpdateRange(On*ss,$n*ss)}if(_e){const Ar=_n.indexStart;for(let Or=0;Or<an.count;Or++)Kt.setX(Ar+Or,On+an.getX(Or));for(let Or=an.count,Xr=_n.indexCount;Or<Xr;Or++)Kt.setX(Ar+Or,On);Kt.needsUpdate=!0,Kt.addUpdateRange(Ar,_n.indexCount)}const dr=this._bounds[s];a.boundingBox!==null?(dr.box.copy(a.boundingBox),dr.boxInitialized=!0):dr.boxInitialized=!1,a.boundingSphere!==null?(dr.sphere.copy(a.boundingSphere),dr.sphereInitialized=!0):dr.sphereInitialized=!1;const fr=this._drawRanges[s],pr=a.getAttribute("position");return fr.count=_e?an.count:pr.count,this._visibilityChanged=!0,s}deleteGeometry(s){const a=this._active;return s>=a.length||a[s]===!1?this:(a[s]=!1,this._visibilityChanged=!0,this)}getBoundingBoxAt(s,a){if(this._active[s]===!1)return null;const _e=this._bounds[s],Kt=_e.box,an=this.geometry;if(_e.boxInitialized===!1){Kt.makeEmpty();const _n=an.index,On=an.attributes.position,$n=this._drawRanges[s];for(let dr=$n.start,fr=$n.start+$n.count;dr<fr;dr++){let pr=dr;_n&&(pr=_n.getX(pr)),Kt.expandByPoint(_vector$5.fromBufferAttribute(On,pr))}_e.boxInitialized=!0}return a.copy(Kt),a}getBoundingSphereAt(s,a){if(this._active[s]===!1)return null;const _e=this._bounds[s],Kt=_e.sphere,an=this.geometry;if(_e.sphereInitialized===!1){Kt.makeEmpty(),this.getBoundingBoxAt(s,_box$1),_box$1.getCenter(Kt.center);const _n=an.index,On=an.attributes.position,$n=this._drawRanges[s];let dr=0;for(let fr=$n.start,pr=$n.start+$n.count;fr<pr;fr++){let Ar=fr;_n&&(Ar=_n.getX(Ar)),_vector$5.fromBufferAttribute(On,Ar),dr=Math.max(dr,Kt.center.distanceToSquared(_vector$5))}Kt.radius=Math.sqrt(dr),_e.sphereInitialized=!0}return a.copy(Kt),a}setMatrixAt(s,a){const b=this._active,_e=this._matricesTexture,Kt=this._matricesTexture.image.data,an=this._geometryCount;return s>=an||b[s]===!1?this:(a.toArray(Kt,s*16),_e.needsUpdate=!0,this)}getMatrixAt(s,a){const b=this._active,_e=this._matricesTexture.image.data,Kt=this._geometryCount;return s>=Kt||b[s]===!1?null:a.fromArray(_e,s*16)}setVisibleAt(s,a){const b=this._visibility,_e=this._active,Kt=this._geometryCount;return s>=Kt||_e[s]===!1||b[s]===a?this:(b[s]=a,this._visibilityChanged=!0,this)}getVisibleAt(s){const a=this._visibility,b=this._active,_e=this._geometryCount;return s>=_e||b[s]===!1?!1:a[s]}raycast(s,a){const b=this._visibility,_e=this._active,Kt=this._drawRanges,an=this._geometryCount,_n=this.matrixWorld,On=this.geometry;_mesh.material=this.material,_mesh.geometry.index=On.index,_mesh.geometry.attributes=On.attributes,_mesh.geometry.boundingBox===null&&(_mesh.geometry.boundingBox=new Box3),_mesh.geometry.boundingSphere===null&&(_mesh.geometry.boundingSphere=new Sphere);for(let $n=0;$n<an;$n++){if(!b[$n]||!_e[$n])continue;const dr=Kt[$n];_mesh.geometry.setDrawRange(dr.start,dr.count),this.getMatrixAt($n,_mesh.matrixWorld).premultiply(_n),this.getBoundingBoxAt($n,_mesh.geometry.boundingBox),this.getBoundingSphereAt($n,_mesh.geometry.boundingSphere),_mesh.raycast(s,_batchIntersects);for(let fr=0,pr=_batchIntersects.length;fr<pr;fr++){const Ar=_batchIntersects[fr];Ar.object=this,Ar.batchId=$n,a.push(Ar)}_batchIntersects.length=0}_mesh.material=null,_mesh.geometry.index=null,_mesh.geometry.attributes={},_mesh.geometry.setDrawRange(0,1/0)}copy(s){return super.copy(s),this.geometry=s.geometry.clone(),this.perObjectFrustumCulled=s.perObjectFrustumCulled,this.sortObjects=s.sortObjects,this.boundingBox=s.boundingBox!==null?s.boundingBox.clone():null,this.boundingSphere=s.boundingSphere!==null?s.boundingSphere.clone():null,this._drawRanges=s._drawRanges.map(a=>({...a})),this._reservedRanges=s._reservedRanges.map(a=>({...a})),this._visibility=s._visibility.slice(),this._active=s._active.slice(),this._bounds=s._bounds.map(a=>({boxInitialized:a.boxInitialized,box:a.box.clone(),sphereInitialized:a.sphereInitialized,sphere:a.sphere.clone()})),this._maxGeometryCount=s._maxGeometryCount,this._maxVertexCount=s._maxVertexCount,this._maxIndexCount=s._maxIndexCount,this._geometryInitialized=s._geometryInitialized,this._geometryCount=s._geometryCount,this._multiDrawCounts=s._multiDrawCounts.slice(),this._multiDrawStarts=s._multiDrawStarts.slice(),this._matricesTexture=s._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(s,a,b,_e,Kt){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const an=_e.getIndex(),_n=an===null?1:an.array.BYTES_PER_ELEMENT,On=this._active,$n=this._visibility,dr=this._multiDrawStarts,fr=this._multiDrawCounts,pr=this._drawRanges,Ar=this.perObjectFrustumCulled;Ar&&(_projScreenMatrix$2.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse).multiply(this.matrixWorld),_frustum.setFromProjectionMatrix(_projScreenMatrix$2,s.coordinateSystem));let Or=0;if(this.sortObjects){_invMatrixWorld.copy(this.matrixWorld).invert(),_vector$5.setFromMatrixPosition(b.matrixWorld).applyMatrix4(_invMatrixWorld);for(let kr=0,us=$n.length;kr<us;kr++)if($n[kr]&&On[kr]){this.getMatrixAt(kr,_matrix$1),this.getBoundingSphereAt(kr,_sphere$2).applyMatrix4(_matrix$1);let hs=!1;if(Ar&&(hs=!_frustum.intersectsSphere(_sphere$2)),!hs){const ds=_vector$5.distanceTo(_sphere$2.center);_renderList.push(pr[kr],ds)}}const Xr=_renderList.list,ss=this.customSort;ss===null?Xr.sort(Kt.transparent?sortTransparent:sortOpaque):ss.call(this,Xr,b);for(let kr=0,us=Xr.length;kr<us;kr++){const hs=Xr[kr];dr[Or]=hs.start*_n,fr[Or]=hs.count,Or++}_renderList.reset()}else for(let Xr=0,ss=$n.length;Xr<ss;Xr++)if($n[Xr]&&On[Xr]){let kr=!1;if(Ar&&(this.getMatrixAt(Xr,_matrix$1),this.getBoundingSphereAt(Xr,_sphere$2).applyMatrix4(_matrix$1),kr=!_frustum.intersectsSphere(_sphere$2)),!kr){const us=pr[Xr];dr[Or]=us.start*_n,fr[Or]=us.count,Or++}}this._multiDrawCount=Or,this._visibilityChanged=!1}onBeforeShadow(s,a,b,_e,Kt,an){this.onBeforeRender(s,null,_e,Kt,an)}}class LineBasicMaterial extends Material{constructor(s){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Color$1(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(s)}copy(s){return super.copy(s),this.color.copy(s.color),this.map=s.map,this.linewidth=s.linewidth,this.linecap=s.linecap,this.linejoin=s.linejoin,this.fog=s.fog,this}}const _start$1=new Vector3,_end$1=new Vector3,_inverseMatrix$1=new Matrix4,_ray$1=new Ray,_sphere$1=new Sphere;class Line extends Object3D{constructor(s=new BufferGeometry,a=new LineBasicMaterial){super(),this.isLine=!0,this.type="Line",this.geometry=s,this.material=a,this.updateMorphTargets()}copy(s,a){return super.copy(s,a),this.material=Array.isArray(s.material)?s.material.slice():s.material,this.geometry=s.geometry,this}computeLineDistances(){const s=this.geometry;if(s.index===null){const a=s.attributes.position,b=[0];for(let _e=1,Kt=a.count;_e<Kt;_e++)_start$1.fromBufferAttribute(a,_e-1),_end$1.fromBufferAttribute(a,_e),b[_e]=b[_e-1],b[_e]+=_start$1.distanceTo(_end$1);s.setAttribute("lineDistance",new Float32BufferAttribute(b,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(s,a){const b=this.geometry,_e=this.matrixWorld,Kt=s.params.Line.threshold,an=b.drawRange;if(b.boundingSphere===null&&b.computeBoundingSphere(),_sphere$1.copy(b.boundingSphere),_sphere$1.applyMatrix4(_e),_sphere$1.radius+=Kt,s.ray.intersectsSphere(_sphere$1)===!1)return;_inverseMatrix$1.copy(_e).invert(),_ray$1.copy(s.ray).applyMatrix4(_inverseMatrix$1);const _n=Kt/((this.scale.x+this.scale.y+this.scale.z)/3),On=_n*_n,$n=new Vector3,dr=new Vector3,fr=new Vector3,pr=new Vector3,Ar=this.isLineSegments?2:1,Or=b.index,ss=b.attributes.position;if(Or!==null){const kr=Math.max(0,an.start),us=Math.min(Or.count,an.start+an.count);for(let hs=kr,ds=us-1;hs<ds;hs+=Ar){const fs=Or.getX(hs),Gs=Or.getX(hs+1);if($n.fromBufferAttribute(ss,fs),dr.fromBufferAttribute(ss,Gs),_ray$1.distanceSqToSegment($n,dr,pr,fr)>On)continue;pr.applyMatrix4(this.matrixWorld);const So=s.ray.origin.distanceTo(pr);So<s.near||So>s.far||a.push({distance:So,point:fr.clone().applyMatrix4(this.matrixWorld),index:hs,face:null,faceIndex:null,object:this})}}else{const kr=Math.max(0,an.start),us=Math.min(ss.count,an.start+an.count);for(let hs=kr,ds=us-1;hs<ds;hs+=Ar){if($n.fromBufferAttribute(ss,hs),dr.fromBufferAttribute(ss,hs+1),_ray$1.distanceSqToSegment($n,dr,pr,fr)>On)continue;pr.applyMatrix4(this.matrixWorld);const Gs=s.ray.origin.distanceTo(pr);Gs<s.near||Gs>s.far||a.push({distance:Gs,point:fr.clone().applyMatrix4(this.matrixWorld),index:hs,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const a=this.geometry.morphAttributes,b=Object.keys(a);if(b.length>0){const _e=a[b[0]];if(_e!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let Kt=0,an=_e.length;Kt<an;Kt++){const _n=_e[Kt].name||String(Kt);this.morphTargetInfluences.push(0),this.morphTargetDictionary[_n]=Kt}}}}}const _start=new Vector3,_end=new Vector3;class LineSegments extends Line{constructor(s,a){super(s,a),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const s=this.geometry;if(s.index===null){const a=s.attributes.position,b=[];for(let _e=0,Kt=a.count;_e<Kt;_e+=2)_start.fromBufferAttribute(a,_e),_end.fromBufferAttribute(a,_e+1),b[_e]=_e===0?0:b[_e-1],b[_e+1]=b[_e]+_start.distanceTo(_end);s.setAttribute("lineDistance",new Float32BufferAttribute(b,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class LineLoop extends Line{constructor(s,a){super(s,a),this.isLineLoop=!0,this.type="LineLoop"}}class PointsMaterial extends Material{constructor(s){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Color$1(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(s)}copy(s){return super.copy(s),this.color.copy(s.color),this.map=s.map,this.alphaMap=s.alphaMap,this.size=s.size,this.sizeAttenuation=s.sizeAttenuation,this.fog=s.fog,this}}const _inverseMatrix=new Matrix4,_ray=new Ray,_sphere$7=new Sphere,_position$2=new Vector3;class Points extends Object3D{constructor(s=new BufferGeometry,a=new PointsMaterial){super(),this.isPoints=!0,this.type="Points",this.geometry=s,this.material=a,this.updateMorphTargets()}copy(s,a){return super.copy(s,a),this.material=Array.isArray(s.material)?s.material.slice():s.material,this.geometry=s.geometry,this}raycast(s,a){const b=this.geometry,_e=this.matrixWorld,Kt=s.params.Points.threshold,an=b.drawRange;if(b.boundingSphere===null&&b.computeBoundingSphere(),_sphere$7.copy(b.boundingSphere),_sphere$7.applyMatrix4(_e),_sphere$7.radius+=Kt,s.ray.intersectsSphere(_sphere$7)===!1)return;_inverseMatrix.copy(_e).invert(),_ray.copy(s.ray).applyMatrix4(_inverseMatrix);const _n=Kt/((this.scale.x+this.scale.y+this.scale.z)/3),On=_n*_n,$n=b.index,fr=b.attributes.position;if($n!==null){const pr=Math.max(0,an.start),Ar=Math.min($n.count,an.start+an.count);for(let Or=pr,Xr=Ar;Or<Xr;Or++){const ss=$n.getX(Or);_position$2.fromBufferAttribute(fr,ss),testPoint(_position$2,ss,On,_e,s,a,this)}}else{const pr=Math.max(0,an.start),Ar=Math.min(fr.count,an.start+an.count);for(let Or=pr,Xr=Ar;Or<Xr;Or++)_position$2.fromBufferAttribute(fr,Or),testPoint(_position$2,Or,On,_e,s,a,this)}}updateMorphTargets(){const a=this.geometry.morphAttributes,b=Object.keys(a);if(b.length>0){const _e=a[b[0]];if(_e!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let Kt=0,an=_e.length;Kt<an;Kt++){const _n=_e[Kt].name||String(Kt);this.morphTargetInfluences.push(0),this.morphTargetDictionary[_n]=Kt}}}}}function testPoint(o,s,a,b,_e,Kt,an){const _n=_ray.distanceSqToPoint(o);if(_n<a){const On=new Vector3;_ray.closestPointToPoint(o,On),On.applyMatrix4(b);const $n=_e.ray.origin.distanceTo(On);if($n<_e.near||$n>_e.far)return;Kt.push({distance:$n,distanceToRay:Math.sqrt(_n),point:On,index:s,face:null,object:an})}}class VideoTexture extends Texture{constructor(s,a,b,_e,Kt,an,_n,On,$n){super(s,a,b,_e,Kt,an,_n,On,$n),this.isVideoTexture=!0,this.minFilter=an!==void 0?an:LinearFilter,this.magFilter=Kt!==void 0?Kt:LinearFilter,this.generateMipmaps=!1;const dr=this;function fr(){dr.needsUpdate=!0,s.requestVideoFrameCallback(fr)}"requestVideoFrameCallback"in s&&s.requestVideoFrameCallback(fr)}clone(){return new this.constructor(this.image).copy(this)}update(){const s=this.image;"requestVideoFrameCallback"in s===!1&&s.readyState>=s.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class FramebufferTexture extends Texture{constructor(s,a){super({width:s,height:a}),this.isFramebufferTexture=!0,this.magFilter=NearestFilter,this.minFilter=NearestFilter,this.generateMipmaps=!1,this.needsUpdate=!0}}class CompressedTexture extends Texture{constructor(s,a,b,_e,Kt,an,_n,On,$n,dr,fr,pr){super(null,an,_n,On,$n,dr,_e,Kt,fr,pr),this.isCompressedTexture=!0,this.image={width:a,height:b},this.mipmaps=s,this.flipY=!1,this.generateMipmaps=!1}}class CompressedArrayTexture extends CompressedTexture{constructor(s,a,b,_e,Kt,an){super(s,a,b,Kt,an),this.isCompressedArrayTexture=!0,this.image.depth=_e,this.wrapR=ClampToEdgeWrapping}}class CompressedCubeTexture extends CompressedTexture{constructor(s,a,b){super(void 0,s[0].width,s[0].height,a,b,CubeReflectionMapping),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=s}}class CanvasTexture extends Texture{constructor(s,a,b,_e,Kt,an,_n,On,$n){super(s,a,b,_e,Kt,an,_n,On,$n),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Curve{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(s,a){const b=this.getUtoTmapping(s);return this.getPoint(b,a)}getPoints(s=5){const a=[];for(let b=0;b<=s;b++)a.push(this.getPoint(b/s));return a}getSpacedPoints(s=5){const a=[];for(let b=0;b<=s;b++)a.push(this.getPointAt(b/s));return a}getLength(){const s=this.getLengths();return s[s.length-1]}getLengths(s=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===s+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const a=[];let b,_e=this.getPoint(0),Kt=0;a.push(0);for(let an=1;an<=s;an++)b=this.getPoint(an/s),Kt+=b.distanceTo(_e),a.push(Kt),_e=b;return this.cacheArcLengths=a,a}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(s,a){const b=this.getLengths();let _e=0;const Kt=b.length;let an;a?an=a:an=s*b[Kt-1];let _n=0,On=Kt-1,$n;for(;_n<=On;)if(_e=Math.floor(_n+(On-_n)/2),$n=b[_e]-an,$n<0)_n=_e+1;else if($n>0)On=_e-1;else{On=_e;break}if(_e=On,b[_e]===an)return _e/(Kt-1);const dr=b[_e],pr=b[_e+1]-dr,Ar=(an-dr)/pr;return(_e+Ar)/(Kt-1)}getTangent(s,a){let _e=s-1e-4,Kt=s+1e-4;_e<0&&(_e=0),Kt>1&&(Kt=1);const an=this.getPoint(_e),_n=this.getPoint(Kt),On=a||(an.isVector2?new Vector2:new Vector3);return On.copy(_n).sub(an).normalize(),On}getTangentAt(s,a){const b=this.getUtoTmapping(s);return this.getTangent(b,a)}computeFrenetFrames(s,a){const b=new Vector3,_e=[],Kt=[],an=[],_n=new Vector3,On=new Matrix4;for(let Ar=0;Ar<=s;Ar++){const Or=Ar/s;_e[Ar]=this.getTangentAt(Or,new Vector3)}Kt[0]=new Vector3,an[0]=new Vector3;let $n=Number.MAX_VALUE;const dr=Math.abs(_e[0].x),fr=Math.abs(_e[0].y),pr=Math.abs(_e[0].z);dr<=$n&&($n=dr,b.set(1,0,0)),fr<=$n&&($n=fr,b.set(0,1,0)),pr<=$n&&b.set(0,0,1),_n.crossVectors(_e[0],b).normalize(),Kt[0].crossVectors(_e[0],_n),an[0].crossVectors(_e[0],Kt[0]);for(let Ar=1;Ar<=s;Ar++){if(Kt[Ar]=Kt[Ar-1].clone(),an[Ar]=an[Ar-1].clone(),_n.crossVectors(_e[Ar-1],_e[Ar]),_n.length()>Number.EPSILON){_n.normalize();const Or=Math.acos(clamp$2(_e[Ar-1].dot(_e[Ar]),-1,1));Kt[Ar].applyMatrix4(On.makeRotationAxis(_n,Or))}an[Ar].crossVectors(_e[Ar],Kt[Ar])}if(a===!0){let Ar=Math.acos(clamp$2(Kt[0].dot(Kt[s]),-1,1));Ar/=s,_e[0].dot(_n.crossVectors(Kt[0],Kt[s]))>0&&(Ar=-Ar);for(let Or=1;Or<=s;Or++)Kt[Or].applyMatrix4(On.makeRotationAxis(_e[Or],Ar*Or)),an[Or].crossVectors(_e[Or],Kt[Or])}return{tangents:_e,normals:Kt,binormals:an}}clone(){return new this.constructor().copy(this)}copy(s){return this.arcLengthDivisions=s.arcLengthDivisions,this}toJSON(){const s={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return s.arcLengthDivisions=this.arcLengthDivisions,s.type=this.type,s}fromJSON(s){return this.arcLengthDivisions=s.arcLengthDivisions,this}}class EllipseCurve extends Curve{constructor(s=0,a=0,b=1,_e=1,Kt=0,an=Math.PI*2,_n=!1,On=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=s,this.aY=a,this.xRadius=b,this.yRadius=_e,this.aStartAngle=Kt,this.aEndAngle=an,this.aClockwise=_n,this.aRotation=On}getPoint(s,a=new Vector2){const b=a,_e=Math.PI*2;let Kt=this.aEndAngle-this.aStartAngle;const an=Math.abs(Kt)<Number.EPSILON;for(;Kt<0;)Kt+=_e;for(;Kt>_e;)Kt-=_e;Kt<Number.EPSILON&&(an?Kt=0:Kt=_e),this.aClockwise===!0&&!an&&(Kt===_e?Kt=-_e:Kt=Kt-_e);const _n=this.aStartAngle+s*Kt;let On=this.aX+this.xRadius*Math.cos(_n),$n=this.aY+this.yRadius*Math.sin(_n);if(this.aRotation!==0){const dr=Math.cos(this.aRotation),fr=Math.sin(this.aRotation),pr=On-this.aX,Ar=$n-this.aY;On=pr*dr-Ar*fr+this.aX,$n=pr*fr+Ar*dr+this.aY}return b.set(On,$n)}copy(s){return super.copy(s),this.aX=s.aX,this.aY=s.aY,this.xRadius=s.xRadius,this.yRadius=s.yRadius,this.aStartAngle=s.aStartAngle,this.aEndAngle=s.aEndAngle,this.aClockwise=s.aClockwise,this.aRotation=s.aRotation,this}toJSON(){const s=super.toJSON();return s.aX=this.aX,s.aY=this.aY,s.xRadius=this.xRadius,s.yRadius=this.yRadius,s.aStartAngle=this.aStartAngle,s.aEndAngle=this.aEndAngle,s.aClockwise=this.aClockwise,s.aRotation=this.aRotation,s}fromJSON(s){return super.fromJSON(s),this.aX=s.aX,this.aY=s.aY,this.xRadius=s.xRadius,this.yRadius=s.yRadius,this.aStartAngle=s.aStartAngle,this.aEndAngle=s.aEndAngle,this.aClockwise=s.aClockwise,this.aRotation=s.aRotation,this}}class ArcCurve extends EllipseCurve{constructor(s,a,b,_e,Kt,an){super(s,a,b,b,_e,Kt,an),this.isArcCurve=!0,this.type="ArcCurve"}}function CubicPoly(){let o=0,s=0,a=0,b=0;function _e(Kt,an,_n,On){o=Kt,s=_n,a=-3*Kt+3*an-2*_n-On,b=2*Kt-2*an+_n+On}return{initCatmullRom:function(Kt,an,_n,On,$n){_e(an,_n,$n*(_n-Kt),$n*(On-an))},initNonuniformCatmullRom:function(Kt,an,_n,On,$n,dr,fr){let pr=(an-Kt)/$n-(_n-Kt)/($n+dr)+(_n-an)/dr,Ar=(_n-an)/dr-(On-an)/(dr+fr)+(On-_n)/fr;pr*=dr,Ar*=dr,_e(an,_n,pr,Ar)},calc:function(Kt){const an=Kt*Kt,_n=an*Kt;return o+s*Kt+a*an+b*_n}}}const tmp=new Vector3,px=new CubicPoly,py=new CubicPoly,pz=new CubicPoly;class CatmullRomCurve3 extends Curve{constructor(s=[],a=!1,b="centripetal",_e=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=s,this.closed=a,this.curveType=b,this.tension=_e}getPoint(s,a=new Vector3){const b=a,_e=this.points,Kt=_e.length,an=(Kt-(this.closed?0:1))*s;let _n=Math.floor(an),On=an-_n;this.closed?_n+=_n>0?0:(Math.floor(Math.abs(_n)/Kt)+1)*Kt:On===0&&_n===Kt-1&&(_n=Kt-2,On=1);let $n,dr;this.closed||_n>0?$n=_e[(_n-1)%Kt]:(tmp.subVectors(_e[0],_e[1]).add(_e[0]),$n=tmp);const fr=_e[_n%Kt],pr=_e[(_n+1)%Kt];if(this.closed||_n+2<Kt?dr=_e[(_n+2)%Kt]:(tmp.subVectors(_e[Kt-1],_e[Kt-2]).add(_e[Kt-1]),dr=tmp),this.curveType==="centripetal"||this.curveType==="chordal"){const Ar=this.curveType==="chordal"?.5:.25;let Or=Math.pow($n.distanceToSquared(fr),Ar),Xr=Math.pow(fr.distanceToSquared(pr),Ar),ss=Math.pow(pr.distanceToSquared(dr),Ar);Xr<1e-4&&(Xr=1),Or<1e-4&&(Or=Xr),ss<1e-4&&(ss=Xr),px.initNonuniformCatmullRom($n.x,fr.x,pr.x,dr.x,Or,Xr,ss),py.initNonuniformCatmullRom($n.y,fr.y,pr.y,dr.y,Or,Xr,ss),pz.initNonuniformCatmullRom($n.z,fr.z,pr.z,dr.z,Or,Xr,ss)}else this.curveType==="catmullrom"&&(px.initCatmullRom($n.x,fr.x,pr.x,dr.x,this.tension),py.initCatmullRom($n.y,fr.y,pr.y,dr.y,this.tension),pz.initCatmullRom($n.z,fr.z,pr.z,dr.z,this.tension));return b.set(px.calc(On),py.calc(On),pz.calc(On)),b}copy(s){super.copy(s),this.points=[];for(let a=0,b=s.points.length;a<b;a++){const _e=s.points[a];this.points.push(_e.clone())}return this.closed=s.closed,this.curveType=s.curveType,this.tension=s.tension,this}toJSON(){const s=super.toJSON();s.points=[];for(let a=0,b=this.points.length;a<b;a++){const _e=this.points[a];s.points.push(_e.toArray())}return s.closed=this.closed,s.curveType=this.curveType,s.tension=this.tension,s}fromJSON(s){super.fromJSON(s),this.points=[];for(let a=0,b=s.points.length;a<b;a++){const _e=s.points[a];this.points.push(new Vector3().fromArray(_e))}return this.closed=s.closed,this.curveType=s.curveType,this.tension=s.tension,this}}function CatmullRom(o,s,a,b,_e){const Kt=(b-s)*.5,an=(_e-a)*.5,_n=o*o,On=o*_n;return(2*a-2*b+Kt+an)*On+(-3*a+3*b-2*Kt-an)*_n+Kt*o+a}function QuadraticBezierP0(o,s){const a=1-o;return a*a*s}function QuadraticBezierP1(o,s){return 2*(1-o)*o*s}function QuadraticBezierP2(o,s){return o*o*s}function QuadraticBezier(o,s,a,b){return QuadraticBezierP0(o,s)+QuadraticBezierP1(o,a)+QuadraticBezierP2(o,b)}function CubicBezierP0(o,s){const a=1-o;return a*a*a*s}function CubicBezierP1(o,s){const a=1-o;return 3*a*a*o*s}function CubicBezierP2(o,s){return 3*(1-o)*o*o*s}function CubicBezierP3(o,s){return o*o*o*s}function CubicBezier(o,s,a,b,_e){return CubicBezierP0(o,s)+CubicBezierP1(o,a)+CubicBezierP2(o,b)+CubicBezierP3(o,_e)}class CubicBezierCurve extends Curve{constructor(s=new Vector2,a=new Vector2,b=new Vector2,_e=new Vector2){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=s,this.v1=a,this.v2=b,this.v3=_e}getPoint(s,a=new Vector2){const b=a,_e=this.v0,Kt=this.v1,an=this.v2,_n=this.v3;return b.set(CubicBezier(s,_e.x,Kt.x,an.x,_n.x),CubicBezier(s,_e.y,Kt.y,an.y,_n.y)),b}copy(s){return super.copy(s),this.v0.copy(s.v0),this.v1.copy(s.v1),this.v2.copy(s.v2),this.v3.copy(s.v3),this}toJSON(){const s=super.toJSON();return s.v0=this.v0.toArray(),s.v1=this.v1.toArray(),s.v2=this.v2.toArray(),s.v3=this.v3.toArray(),s}fromJSON(s){return super.fromJSON(s),this.v0.fromArray(s.v0),this.v1.fromArray(s.v1),this.v2.fromArray(s.v2),this.v3.fromArray(s.v3),this}}class CubicBezierCurve3 extends Curve{constructor(s=new Vector3,a=new Vector3,b=new Vector3,_e=new Vector3){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=s,this.v1=a,this.v2=b,this.v3=_e}getPoint(s,a=new Vector3){const b=a,_e=this.v0,Kt=this.v1,an=this.v2,_n=this.v3;return b.set(CubicBezier(s,_e.x,Kt.x,an.x,_n.x),CubicBezier(s,_e.y,Kt.y,an.y,_n.y),CubicBezier(s,_e.z,Kt.z,an.z,_n.z)),b}copy(s){return super.copy(s),this.v0.copy(s.v0),this.v1.copy(s.v1),this.v2.copy(s.v2),this.v3.copy(s.v3),this}toJSON(){const s=super.toJSON();return s.v0=this.v0.toArray(),s.v1=this.v1.toArray(),s.v2=this.v2.toArray(),s.v3=this.v3.toArray(),s}fromJSON(s){return super.fromJSON(s),this.v0.fromArray(s.v0),this.v1.fromArray(s.v1),this.v2.fromArray(s.v2),this.v3.fromArray(s.v3),this}}class LineCurve extends Curve{constructor(s=new Vector2,a=new Vector2){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=s,this.v2=a}getPoint(s,a=new Vector2){const b=a;return s===1?b.copy(this.v2):(b.copy(this.v2).sub(this.v1),b.multiplyScalar(s).add(this.v1)),b}getPointAt(s,a){return this.getPoint(s,a)}getTangent(s,a=new Vector2){return a.subVectors(this.v2,this.v1).normalize()}getTangentAt(s,a){return this.getTangent(s,a)}copy(s){return super.copy(s),this.v1.copy(s.v1),this.v2.copy(s.v2),this}toJSON(){const s=super.toJSON();return s.v1=this.v1.toArray(),s.v2=this.v2.toArray(),s}fromJSON(s){return super.fromJSON(s),this.v1.fromArray(s.v1),this.v2.fromArray(s.v2),this}}class LineCurve3 extends Curve{constructor(s=new Vector3,a=new Vector3){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=s,this.v2=a}getPoint(s,a=new Vector3){const b=a;return s===1?b.copy(this.v2):(b.copy(this.v2).sub(this.v1),b.multiplyScalar(s).add(this.v1)),b}getPointAt(s,a){return this.getPoint(s,a)}getTangent(s,a=new Vector3){return a.subVectors(this.v2,this.v1).normalize()}getTangentAt(s,a){return this.getTangent(s,a)}copy(s){return super.copy(s),this.v1.copy(s.v1),this.v2.copy(s.v2),this}toJSON(){const s=super.toJSON();return s.v1=this.v1.toArray(),s.v2=this.v2.toArray(),s}fromJSON(s){return super.fromJSON(s),this.v1.fromArray(s.v1),this.v2.fromArray(s.v2),this}}class QuadraticBezierCurve extends Curve{constructor(s=new Vector2,a=new Vector2,b=new Vector2){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=s,this.v1=a,this.v2=b}getPoint(s,a=new Vector2){const b=a,_e=this.v0,Kt=this.v1,an=this.v2;return b.set(QuadraticBezier(s,_e.x,Kt.x,an.x),QuadraticBezier(s,_e.y,Kt.y,an.y)),b}copy(s){return super.copy(s),this.v0.copy(s.v0),this.v1.copy(s.v1),this.v2.copy(s.v2),this}toJSON(){const s=super.toJSON();return s.v0=this.v0.toArray(),s.v1=this.v1.toArray(),s.v2=this.v2.toArray(),s}fromJSON(s){return super.fromJSON(s),this.v0.fromArray(s.v0),this.v1.fromArray(s.v1),this.v2.fromArray(s.v2),this}}class QuadraticBezierCurve3 extends Curve{constructor(s=new Vector3,a=new Vector3,b=new Vector3){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=s,this.v1=a,this.v2=b}getPoint(s,a=new Vector3){const b=a,_e=this.v0,Kt=this.v1,an=this.v2;return b.set(QuadraticBezier(s,_e.x,Kt.x,an.x),QuadraticBezier(s,_e.y,Kt.y,an.y),QuadraticBezier(s,_e.z,Kt.z,an.z)),b}copy(s){return super.copy(s),this.v0.copy(s.v0),this.v1.copy(s.v1),this.v2.copy(s.v2),this}toJSON(){const s=super.toJSON();return s.v0=this.v0.toArray(),s.v1=this.v1.toArray(),s.v2=this.v2.toArray(),s}fromJSON(s){return super.fromJSON(s),this.v0.fromArray(s.v0),this.v1.fromArray(s.v1),this.v2.fromArray(s.v2),this}}class SplineCurve extends Curve{constructor(s=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=s}getPoint(s,a=new Vector2){const b=a,_e=this.points,Kt=(_e.length-1)*s,an=Math.floor(Kt),_n=Kt-an,On=_e[an===0?an:an-1],$n=_e[an],dr=_e[an>_e.length-2?_e.length-1:an+1],fr=_e[an>_e.length-3?_e.length-1:an+2];return b.set(CatmullRom(_n,On.x,$n.x,dr.x,fr.x),CatmullRom(_n,On.y,$n.y,dr.y,fr.y)),b}copy(s){super.copy(s),this.points=[];for(let a=0,b=s.points.length;a<b;a++){const _e=s.points[a];this.points.push(_e.clone())}return this}toJSON(){const s=super.toJSON();s.points=[];for(let a=0,b=this.points.length;a<b;a++){const _e=this.points[a];s.points.push(_e.toArray())}return s}fromJSON(s){super.fromJSON(s),this.points=[];for(let a=0,b=s.points.length;a<b;a++){const _e=s.points[a];this.points.push(new Vector2().fromArray(_e))}return this}}var Curves=Object.freeze({__proto__:null,ArcCurve,CatmullRomCurve3,CubicBezierCurve,CubicBezierCurve3,EllipseCurve,LineCurve,LineCurve3,QuadraticBezierCurve,QuadraticBezierCurve3,SplineCurve});class CurvePath extends Curve{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(s){this.curves.push(s)}closePath(){const s=this.curves[0].getPoint(0),a=this.curves[this.curves.length-1].getPoint(1);if(!s.equals(a)){const b=s.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new Curves[b](a,s))}return this}getPoint(s,a){const b=s*this.getLength(),_e=this.getCurveLengths();let Kt=0;for(;Kt<_e.length;){if(_e[Kt]>=b){const an=_e[Kt]-b,_n=this.curves[Kt],On=_n.getLength(),$n=On===0?0:1-an/On;return _n.getPointAt($n,a)}Kt++}return null}getLength(){const s=this.getCurveLengths();return s[s.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const s=[];let a=0;for(let b=0,_e=this.curves.length;b<_e;b++)a+=this.curves[b].getLength(),s.push(a);return this.cacheLengths=s,s}getSpacedPoints(s=40){const a=[];for(let b=0;b<=s;b++)a.push(this.getPoint(b/s));return this.autoClose&&a.push(a[0]),a}getPoints(s=12){const a=[];let b;for(let _e=0,Kt=this.curves;_e<Kt.length;_e++){const an=Kt[_e],_n=an.isEllipseCurve?s*2:an.isLineCurve||an.isLineCurve3?1:an.isSplineCurve?s*an.points.length:s,On=an.getPoints(_n);for(let $n=0;$n<On.length;$n++){const dr=On[$n];b&&b.equals(dr)||(a.push(dr),b=dr)}}return this.autoClose&&a.length>1&&!a[a.length-1].equals(a[0])&&a.push(a[0]),a}copy(s){super.copy(s),this.curves=[];for(let a=0,b=s.curves.length;a<b;a++){const _e=s.curves[a];this.curves.push(_e.clone())}return this.autoClose=s.autoClose,this}toJSON(){const s=super.toJSON();s.autoClose=this.autoClose,s.curves=[];for(let a=0,b=this.curves.length;a<b;a++){const _e=this.curves[a];s.curves.push(_e.toJSON())}return s}fromJSON(s){super.fromJSON(s),this.autoClose=s.autoClose,this.curves=[];for(let a=0,b=s.curves.length;a<b;a++){const _e=s.curves[a];this.curves.push(new Curves[_e.type]().fromJSON(_e))}return this}}class Path extends CurvePath{constructor(s){super(),this.type="Path",this.currentPoint=new Vector2,s&&this.setFromPoints(s)}setFromPoints(s){this.moveTo(s[0].x,s[0].y);for(let a=1,b=s.length;a<b;a++)this.lineTo(s[a].x,s[a].y);return this}moveTo(s,a){return this.currentPoint.set(s,a),this}lineTo(s,a){const b=new LineCurve(this.currentPoint.clone(),new Vector2(s,a));return this.curves.push(b),this.currentPoint.set(s,a),this}quadraticCurveTo(s,a,b,_e){const Kt=new QuadraticBezierCurve(this.currentPoint.clone(),new Vector2(s,a),new Vector2(b,_e));return this.curves.push(Kt),this.currentPoint.set(b,_e),this}bezierCurveTo(s,a,b,_e,Kt,an){const _n=new CubicBezierCurve(this.currentPoint.clone(),new Vector2(s,a),new Vector2(b,_e),new Vector2(Kt,an));return this.curves.push(_n),this.currentPoint.set(Kt,an),this}splineThru(s){const a=[this.currentPoint.clone()].concat(s),b=new SplineCurve(a);return this.curves.push(b),this.currentPoint.copy(s[s.length-1]),this}arc(s,a,b,_e,Kt,an){const _n=this.currentPoint.x,On=this.currentPoint.y;return this.absarc(s+_n,a+On,b,_e,Kt,an),this}absarc(s,a,b,_e,Kt,an){return this.absellipse(s,a,b,b,_e,Kt,an),this}ellipse(s,a,b,_e,Kt,an,_n,On){const $n=this.currentPoint.x,dr=this.currentPoint.y;return this.absellipse(s+$n,a+dr,b,_e,Kt,an,_n,On),this}absellipse(s,a,b,_e,Kt,an,_n,On){const $n=new EllipseCurve(s,a,b,_e,Kt,an,_n,On);if(this.curves.length>0){const fr=$n.getPoint(0);fr.equals(this.currentPoint)||this.lineTo(fr.x,fr.y)}this.curves.push($n);const dr=$n.getPoint(1);return this.currentPoint.copy(dr),this}copy(s){return super.copy(s),this.currentPoint.copy(s.currentPoint),this}toJSON(){const s=super.toJSON();return s.currentPoint=this.currentPoint.toArray(),s}fromJSON(s){return super.fromJSON(s),this.currentPoint.fromArray(s.currentPoint),this}}class LatheGeometry extends BufferGeometry{constructor(s=[new Vector2(0,-.5),new Vector2(.5,0),new Vector2(0,.5)],a=12,b=0,_e=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:s,segments:a,phiStart:b,phiLength:_e},a=Math.floor(a),_e=clamp$2(_e,0,Math.PI*2);const Kt=[],an=[],_n=[],On=[],$n=[],dr=1/a,fr=new Vector3,pr=new Vector2,Ar=new Vector3,Or=new Vector3,Xr=new Vector3;let ss=0,kr=0;for(let us=0;us<=s.length-1;us++)switch(us){case 0:ss=s[us+1].x-s[us].x,kr=s[us+1].y-s[us].y,Ar.x=kr*1,Ar.y=-ss,Ar.z=kr*0,Xr.copy(Ar),Ar.normalize(),On.push(Ar.x,Ar.y,Ar.z);break;case s.length-1:On.push(Xr.x,Xr.y,Xr.z);break;default:ss=s[us+1].x-s[us].x,kr=s[us+1].y-s[us].y,Ar.x=kr*1,Ar.y=-ss,Ar.z=kr*0,Or.copy(Ar),Ar.x+=Xr.x,Ar.y+=Xr.y,Ar.z+=Xr.z,Ar.normalize(),On.push(Ar.x,Ar.y,Ar.z),Xr.copy(Or)}for(let us=0;us<=a;us++){const hs=b+us*dr*_e,ds=Math.sin(hs),fs=Math.cos(hs);for(let Gs=0;Gs<=s.length-1;Gs++){fr.x=s[Gs].x*ds,fr.y=s[Gs].y,fr.z=s[Gs].x*fs,an.push(fr.x,fr.y,fr.z),pr.x=us/a,pr.y=Gs/(s.length-1),_n.push(pr.x,pr.y);const ga=On[3*Gs+0]*ds,So=On[3*Gs+1],go=On[3*Gs+0]*fs;$n.push(ga,So,go)}}for(let us=0;us<a;us++)for(let hs=0;hs<s.length-1;hs++){const ds=hs+us*s.length,fs=ds,Gs=ds+s.length,ga=ds+s.length+1,So=ds+1;Kt.push(fs,Gs,So),Kt.push(ga,So,Gs)}this.setIndex(Kt),this.setAttribute("position",new Float32BufferAttribute(an,3)),this.setAttribute("uv",new Float32BufferAttribute(_n,2)),this.setAttribute("normal",new Float32BufferAttribute($n,3))}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}static fromJSON(s){return new LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength)}}class CapsuleGeometry extends LatheGeometry{constructor(s=1,a=1,b=4,_e=8){const Kt=new Path;Kt.absarc(0,-a/2,s,Math.PI*1.5,0),Kt.absarc(0,a/2,s,0,Math.PI*.5),super(Kt.getPoints(b),_e),this.type="CapsuleGeometry",this.parameters={radius:s,length:a,capSegments:b,radialSegments:_e}}static fromJSON(s){return new CapsuleGeometry(s.radius,s.length,s.capSegments,s.radialSegments)}}class CircleGeometry extends BufferGeometry{constructor(s=1,a=32,b=0,_e=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:s,segments:a,thetaStart:b,thetaLength:_e},a=Math.max(3,a);const Kt=[],an=[],_n=[],On=[],$n=new Vector3,dr=new Vector2;an.push(0,0,0),_n.push(0,0,1),On.push(.5,.5);for(let fr=0,pr=3;fr<=a;fr++,pr+=3){const Ar=b+fr/a*_e;$n.x=s*Math.cos(Ar),$n.y=s*Math.sin(Ar),an.push($n.x,$n.y,$n.z),_n.push(0,0,1),dr.x=(an[pr]/s+1)/2,dr.y=(an[pr+1]/s+1)/2,On.push(dr.x,dr.y)}for(let fr=1;fr<=a;fr++)Kt.push(fr,fr+1,0);this.setIndex(Kt),this.setAttribute("position",new Float32BufferAttribute(an,3)),this.setAttribute("normal",new Float32BufferAttribute(_n,3)),this.setAttribute("uv",new Float32BufferAttribute(On,2))}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}static fromJSON(s){return new CircleGeometry(s.radius,s.segments,s.thetaStart,s.thetaLength)}}class CylinderGeometry extends BufferGeometry{constructor(s=1,a=1,b=1,_e=32,Kt=1,an=!1,_n=0,On=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:s,radiusBottom:a,height:b,radialSegments:_e,heightSegments:Kt,openEnded:an,thetaStart:_n,thetaLength:On};const $n=this;_e=Math.floor(_e),Kt=Math.floor(Kt);const dr=[],fr=[],pr=[],Ar=[];let Or=0;const Xr=[],ss=b/2;let kr=0;us(),an===!1&&(s>0&&hs(!0),a>0&&hs(!1)),this.setIndex(dr),this.setAttribute("position",new Float32BufferAttribute(fr,3)),this.setAttribute("normal",new Float32BufferAttribute(pr,3)),this.setAttribute("uv",new Float32BufferAttribute(Ar,2));function us(){const ds=new Vector3,fs=new Vector3;let Gs=0;const ga=(a-s)/b;for(let So=0;So<=Kt;So++){const go=[],xo=So/Kt,Mo=xo*(a-s)+s;for(let yl=0;yl<=_e;yl++){const Al=yl/_e,xl=Al*On+_n,ep=Math.sin(xl),_f=Math.cos(xl);fs.x=Mo*ep,fs.y=-xo*b+ss,fs.z=Mo*_f,fr.push(fs.x,fs.y,fs.z),ds.set(ep,ga,_f).normalize(),pr.push(ds.x,ds.y,ds.z),Ar.push(Al,1-xo),go.push(Or++)}Xr.push(go)}for(let So=0;So<_e;So++)for(let go=0;go<Kt;go++){const xo=Xr[go][So],Mo=Xr[go+1][So],yl=Xr[go+1][So+1],Al=Xr[go][So+1];dr.push(xo,Mo,Al),dr.push(Mo,yl,Al),Gs+=6}$n.addGroup(kr,Gs,0),kr+=Gs}function hs(ds){const fs=Or,Gs=new Vector2,ga=new Vector3;let So=0;const go=ds===!0?s:a,xo=ds===!0?1:-1;for(let yl=1;yl<=_e;yl++)fr.push(0,ss*xo,0),pr.push(0,xo,0),Ar.push(.5,.5),Or++;const Mo=Or;for(let yl=0;yl<=_e;yl++){const xl=yl/_e*On+_n,ep=Math.cos(xl),_f=Math.sin(xl);ga.x=go*_f,ga.y=ss*xo,ga.z=go*ep,fr.push(ga.x,ga.y,ga.z),pr.push(0,xo,0),Gs.x=ep*.5+.5,Gs.y=_f*.5*xo+.5,Ar.push(Gs.x,Gs.y),Or++}for(let yl=0;yl<_e;yl++){const Al=fs+yl,xl=Mo+yl;ds===!0?dr.push(xl,xl+1,Al):dr.push(xl+1,xl,Al),So+=3}$n.addGroup(kr,So,ds===!0?1:2),kr+=So}}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}static fromJSON(s){return new CylinderGeometry(s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength)}}class ConeGeometry extends CylinderGeometry{constructor(s=1,a=1,b=32,_e=1,Kt=!1,an=0,_n=Math.PI*2){super(0,s,a,b,_e,Kt,an,_n),this.type="ConeGeometry",this.parameters={radius:s,height:a,radialSegments:b,heightSegments:_e,openEnded:Kt,thetaStart:an,thetaLength:_n}}static fromJSON(s){return new ConeGeometry(s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength)}}class PolyhedronGeometry extends BufferGeometry{constructor(s=[],a=[],b=1,_e=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:s,indices:a,radius:b,detail:_e};const Kt=[],an=[];_n(_e),$n(b),dr(),this.setAttribute("position",new Float32BufferAttribute(Kt,3)),this.setAttribute("normal",new Float32BufferAttribute(Kt.slice(),3)),this.setAttribute("uv",new Float32BufferAttribute(an,2)),_e===0?this.computeVertexNormals():this.normalizeNormals();function _n(us){const hs=new Vector3,ds=new Vector3,fs=new Vector3;for(let Gs=0;Gs<a.length;Gs+=3)Ar(a[Gs+0],hs),Ar(a[Gs+1],ds),Ar(a[Gs+2],fs),On(hs,ds,fs,us)}function On(us,hs,ds,fs){const Gs=fs+1,ga=[];for(let So=0;So<=Gs;So++){ga[So]=[];const go=us.clone().lerp(ds,So/Gs),xo=hs.clone().lerp(ds,So/Gs),Mo=Gs-So;for(let yl=0;yl<=Mo;yl++)yl===0&&So===Gs?ga[So][yl]=go:ga[So][yl]=go.clone().lerp(xo,yl/Mo)}for(let So=0;So<Gs;So++)for(let go=0;go<2*(Gs-So)-1;go++){const xo=Math.floor(go/2);go%2===0?(pr(ga[So][xo+1]),pr(ga[So+1][xo]),pr(ga[So][xo])):(pr(ga[So][xo+1]),pr(ga[So+1][xo+1]),pr(ga[So+1][xo]))}}function $n(us){const hs=new Vector3;for(let ds=0;ds<Kt.length;ds+=3)hs.x=Kt[ds+0],hs.y=Kt[ds+1],hs.z=Kt[ds+2],hs.normalize().multiplyScalar(us),Kt[ds+0]=hs.x,Kt[ds+1]=hs.y,Kt[ds+2]=hs.z}function dr(){const us=new Vector3;for(let hs=0;hs<Kt.length;hs+=3){us.x=Kt[hs+0],us.y=Kt[hs+1],us.z=Kt[hs+2];const ds=ss(us)/2/Math.PI+.5,fs=kr(us)/Math.PI+.5;an.push(ds,1-fs)}Or(),fr()}function fr(){for(let us=0;us<an.length;us+=6){const hs=an[us+0],ds=an[us+2],fs=an[us+4],Gs=Math.max(hs,ds,fs),ga=Math.min(hs,ds,fs);Gs>.9&&ga<.1&&(hs<.2&&(an[us+0]+=1),ds<.2&&(an[us+2]+=1),fs<.2&&(an[us+4]+=1))}}function pr(us){Kt.push(us.x,us.y,us.z)}function Ar(us,hs){const ds=us*3;hs.x=s[ds+0],hs.y=s[ds+1],hs.z=s[ds+2]}function Or(){const us=new Vector3,hs=new Vector3,ds=new Vector3,fs=new Vector3,Gs=new Vector2,ga=new Vector2,So=new Vector2;for(let go=0,xo=0;go<Kt.length;go+=9,xo+=6){us.set(Kt[go+0],Kt[go+1],Kt[go+2]),hs.set(Kt[go+3],Kt[go+4],Kt[go+5]),ds.set(Kt[go+6],Kt[go+7],Kt[go+8]),Gs.set(an[xo+0],an[xo+1]),ga.set(an[xo+2],an[xo+3]),So.set(an[xo+4],an[xo+5]),fs.copy(us).add(hs).add(ds).divideScalar(3);const Mo=ss(fs);Xr(Gs,xo+0,us,Mo),Xr(ga,xo+2,hs,Mo),Xr(So,xo+4,ds,Mo)}}function Xr(us,hs,ds,fs){fs<0&&us.x===1&&(an[hs]=us.x-1),ds.x===0&&ds.z===0&&(an[hs]=fs/2/Math.PI+.5)}function ss(us){return Math.atan2(us.z,-us.x)}function kr(us){return Math.atan2(-us.y,Math.sqrt(us.x*us.x+us.z*us.z))}}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}static fromJSON(s){return new PolyhedronGeometry(s.vertices,s.indices,s.radius,s.details)}}class DodecahedronGeometry extends PolyhedronGeometry{constructor(s=1,a=0){const b=(1+Math.sqrt(5))/2,_e=1/b,Kt=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-_e,-b,0,-_e,b,0,_e,-b,0,_e,b,-_e,-b,0,-_e,b,0,_e,-b,0,_e,b,0,-b,0,-_e,b,0,-_e,-b,0,_e,b,0,_e],an=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(Kt,an,s,a),this.type="DodecahedronGeometry",this.parameters={radius:s,detail:a}}static fromJSON(s){return new DodecahedronGeometry(s.radius,s.detail)}}const _v0=new Vector3,_v1$1=new Vector3,_normal=new Vector3,_triangle=new Triangle;class EdgesGeometry extends BufferGeometry{constructor(s=null,a=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:s,thresholdAngle:a},s!==null){const _e=Math.pow(10,4),Kt=Math.cos(DEG2RAD$1*a),an=s.getIndex(),_n=s.getAttribute("position"),On=an?an.count:_n.count,$n=[0,0,0],dr=["a","b","c"],fr=new Array(3),pr={},Ar=[];for(let Or=0;Or<On;Or+=3){an?($n[0]=an.getX(Or),$n[1]=an.getX(Or+1),$n[2]=an.getX(Or+2)):($n[0]=Or,$n[1]=Or+1,$n[2]=Or+2);const{a:Xr,b:ss,c:kr}=_triangle;if(Xr.fromBufferAttribute(_n,$n[0]),ss.fromBufferAttribute(_n,$n[1]),kr.fromBufferAttribute(_n,$n[2]),_triangle.getNormal(_normal),fr[0]=`${Math.round(Xr.x*_e)},${Math.round(Xr.y*_e)},${Math.round(Xr.z*_e)}`,fr[1]=`${Math.round(ss.x*_e)},${Math.round(ss.y*_e)},${Math.round(ss.z*_e)}`,fr[2]=`${Math.round(kr.x*_e)},${Math.round(kr.y*_e)},${Math.round(kr.z*_e)}`,!(fr[0]===fr[1]||fr[1]===fr[2]||fr[2]===fr[0]))for(let us=0;us<3;us++){const hs=(us+1)%3,ds=fr[us],fs=fr[hs],Gs=_triangle[dr[us]],ga=_triangle[dr[hs]],So=`${ds}_${fs}`,go=`${fs}_${ds}`;go in pr&&pr[go]?(_normal.dot(pr[go].normal)<=Kt&&(Ar.push(Gs.x,Gs.y,Gs.z),Ar.push(ga.x,ga.y,ga.z)),pr[go]=null):So in pr||(pr[So]={index0:$n[us],index1:$n[hs],normal:_normal.clone()})}}for(const Or in pr)if(pr[Or]){const{index0:Xr,index1:ss}=pr[Or];_v0.fromBufferAttribute(_n,Xr),_v1$1.fromBufferAttribute(_n,ss),Ar.push(_v0.x,_v0.y,_v0.z),Ar.push(_v1$1.x,_v1$1.y,_v1$1.z)}this.setAttribute("position",new Float32BufferAttribute(Ar,3))}}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}}class Shape extends Path{constructor(s){super(s),this.uuid=generateUUID(),this.type="Shape",this.holes=[]}getPointsHoles(s){const a=[];for(let b=0,_e=this.holes.length;b<_e;b++)a[b]=this.holes[b].getPoints(s);return a}extractPoints(s){return{shape:this.getPoints(s),holes:this.getPointsHoles(s)}}copy(s){super.copy(s),this.holes=[];for(let a=0,b=s.holes.length;a<b;a++){const _e=s.holes[a];this.holes.push(_e.clone())}return this}toJSON(){const s=super.toJSON();s.uuid=this.uuid,s.holes=[];for(let a=0,b=this.holes.length;a<b;a++){const _e=this.holes[a];s.holes.push(_e.toJSON())}return s}fromJSON(s){super.fromJSON(s),this.uuid=s.uuid,this.holes=[];for(let a=0,b=s.holes.length;a<b;a++){const _e=s.holes[a];this.holes.push(new Path().fromJSON(_e))}return this}}const Earcut={triangulate:function(o,s,a=2){const b=s&&s.length,_e=b?s[0]*a:o.length;let Kt=linkedList(o,0,_e,a,!0);const an=[];if(!Kt||Kt.next===Kt.prev)return an;let _n,On,$n,dr,fr,pr,Ar;if(b&&(Kt=eliminateHoles(o,s,Kt,a)),o.length>80*a){_n=$n=o[0],On=dr=o[1];for(let Or=a;Or<_e;Or+=a)fr=o[Or],pr=o[Or+1],fr<_n&&(_n=fr),pr<On&&(On=pr),fr>$n&&($n=fr),pr>dr&&(dr=pr);Ar=Math.max($n-_n,dr-On),Ar=Ar!==0?32767/Ar:0}return earcutLinked(Kt,an,a,_n,On,Ar,0),an}};function linkedList(o,s,a,b,_e){let Kt,an;if(_e===signedArea(o,s,a,b)>0)for(Kt=s;Kt<a;Kt+=b)an=insertNode(Kt,o[Kt],o[Kt+1],an);else for(Kt=a-b;Kt>=s;Kt-=b)an=insertNode(Kt,o[Kt],o[Kt+1],an);return an&&equals(an,an.next)&&(removeNode(an),an=an.next),an}function filterPoints(o,s){if(!o)return o;s||(s=o);let a=o,b;do if(b=!1,!a.steiner&&(equals(a,a.next)||area$1(a.prev,a,a.next)===0)){if(removeNode(a),a=s=a.prev,a===a.next)break;b=!0}else a=a.next;while(b||a!==s);return s}function earcutLinked(o,s,a,b,_e,Kt,an){if(!o)return;!an&&Kt&&indexCurve(o,b,_e,Kt);let _n=o,On,$n;for(;o.prev!==o.next;){if(On=o.prev,$n=o.next,Kt?isEarHashed(o,b,_e,Kt):isEar(o)){s.push(On.i/a|0),s.push(o.i/a|0),s.push($n.i/a|0),removeNode(o),o=$n.next,_n=$n.next;continue}if(o=$n,o===_n){an?an===1?(o=cureLocalIntersections(filterPoints(o),s,a),earcutLinked(o,s,a,b,_e,Kt,2)):an===2&&splitEarcut(o,s,a,b,_e,Kt):earcutLinked(filterPoints(o),s,a,b,_e,Kt,1);break}}}function isEar(o){const s=o.prev,a=o,b=o.next;if(area$1(s,a,b)>=0)return!1;const _e=s.x,Kt=a.x,an=b.x,_n=s.y,On=a.y,$n=b.y,dr=_e<Kt?_e<an?_e:an:Kt<an?Kt:an,fr=_n<On?_n<$n?_n:$n:On<$n?On:$n,pr=_e>Kt?_e>an?_e:an:Kt>an?Kt:an,Ar=_n>On?_n>$n?_n:$n:On>$n?On:$n;let Or=b.next;for(;Or!==s;){if(Or.x>=dr&&Or.x<=pr&&Or.y>=fr&&Or.y<=Ar&&pointInTriangle(_e,_n,Kt,On,an,$n,Or.x,Or.y)&&area$1(Or.prev,Or,Or.next)>=0)return!1;Or=Or.next}return!0}function isEarHashed(o,s,a,b){const _e=o.prev,Kt=o,an=o.next;if(area$1(_e,Kt,an)>=0)return!1;const _n=_e.x,On=Kt.x,$n=an.x,dr=_e.y,fr=Kt.y,pr=an.y,Ar=_n<On?_n<$n?_n:$n:On<$n?On:$n,Or=dr<fr?dr<pr?dr:pr:fr<pr?fr:pr,Xr=_n>On?_n>$n?_n:$n:On>$n?On:$n,ss=dr>fr?dr>pr?dr:pr:fr>pr?fr:pr,kr=zOrder(Ar,Or,s,a,b),us=zOrder(Xr,ss,s,a,b);let hs=o.prevZ,ds=o.nextZ;for(;hs&&hs.z>=kr&&ds&&ds.z<=us;){if(hs.x>=Ar&&hs.x<=Xr&&hs.y>=Or&&hs.y<=ss&&hs!==_e&&hs!==an&&pointInTriangle(_n,dr,On,fr,$n,pr,hs.x,hs.y)&&area$1(hs.prev,hs,hs.next)>=0||(hs=hs.prevZ,ds.x>=Ar&&ds.x<=Xr&&ds.y>=Or&&ds.y<=ss&&ds!==_e&&ds!==an&&pointInTriangle(_n,dr,On,fr,$n,pr,ds.x,ds.y)&&area$1(ds.prev,ds,ds.next)>=0))return!1;ds=ds.nextZ}for(;hs&&hs.z>=kr;){if(hs.x>=Ar&&hs.x<=Xr&&hs.y>=Or&&hs.y<=ss&&hs!==_e&&hs!==an&&pointInTriangle(_n,dr,On,fr,$n,pr,hs.x,hs.y)&&area$1(hs.prev,hs,hs.next)>=0)return!1;hs=hs.prevZ}for(;ds&&ds.z<=us;){if(ds.x>=Ar&&ds.x<=Xr&&ds.y>=Or&&ds.y<=ss&&ds!==_e&&ds!==an&&pointInTriangle(_n,dr,On,fr,$n,pr,ds.x,ds.y)&&area$1(ds.prev,ds,ds.next)>=0)return!1;ds=ds.nextZ}return!0}function cureLocalIntersections(o,s,a){let b=o;do{const _e=b.prev,Kt=b.next.next;!equals(_e,Kt)&&intersects(_e,b,b.next,Kt)&&locallyInside(_e,Kt)&&locallyInside(Kt,_e)&&(s.push(_e.i/a|0),s.push(b.i/a|0),s.push(Kt.i/a|0),removeNode(b),removeNode(b.next),b=o=Kt),b=b.next}while(b!==o);return filterPoints(b)}function splitEarcut(o,s,a,b,_e,Kt){let an=o;do{let _n=an.next.next;for(;_n!==an.prev;){if(an.i!==_n.i&&isValidDiagonal(an,_n)){let On=splitPolygon(an,_n);an=filterPoints(an,an.next),On=filterPoints(On,On.next),earcutLinked(an,s,a,b,_e,Kt,0),earcutLinked(On,s,a,b,_e,Kt,0);return}_n=_n.next}an=an.next}while(an!==o)}function eliminateHoles(o,s,a,b){const _e=[];let Kt,an,_n,On,$n;for(Kt=0,an=s.length;Kt<an;Kt++)_n=s[Kt]*b,On=Kt<an-1?s[Kt+1]*b:o.length,$n=linkedList(o,_n,On,b,!1),$n===$n.next&&($n.steiner=!0),_e.push(getLeftmost($n));for(_e.sort(compareX),Kt=0;Kt<_e.length;Kt++)a=eliminateHole(_e[Kt],a);return a}function compareX(o,s){return o.x-s.x}function eliminateHole(o,s){const a=findHoleBridge(o,s);if(!a)return s;const b=splitPolygon(a,o);return filterPoints(b,b.next),filterPoints(a,a.next)}function findHoleBridge(o,s){let a=s,b=-1/0,_e;const Kt=o.x,an=o.y;do{if(an<=a.y&&an>=a.next.y&&a.next.y!==a.y){const pr=a.x+(an-a.y)*(a.next.x-a.x)/(a.next.y-a.y);if(pr<=Kt&&pr>b&&(b=pr,_e=a.x<a.next.x?a:a.next,pr===Kt))return _e}a=a.next}while(a!==s);if(!_e)return null;const _n=_e,On=_e.x,$n=_e.y;let dr=1/0,fr;a=_e;do Kt>=a.x&&a.x>=On&&Kt!==a.x&&pointInTriangle(an<$n?Kt:b,an,On,$n,an<$n?b:Kt,an,a.x,a.y)&&(fr=Math.abs(an-a.y)/(Kt-a.x),locallyInside(a,o)&&(fr<dr||fr===dr&&(a.x>_e.x||a.x===_e.x&§orContainsSector(_e,a)))&&(_e=a,dr=fr)),a=a.next;while(a!==_n);return _e}function sectorContainsSector(o,s){return area$1(o.prev,o,s.prev)<0&&area$1(s.next,o,o.next)<0}function indexCurve(o,s,a,b){let _e=o;do _e.z===0&&(_e.z=zOrder(_e.x,_e.y,s,a,b)),_e.prevZ=_e.prev,_e.nextZ=_e.next,_e=_e.next;while(_e!==o);_e.prevZ.nextZ=null,_e.prevZ=null,sortLinked(_e)}function sortLinked(o){let s,a,b,_e,Kt,an,_n,On,$n=1;do{for(a=o,o=null,Kt=null,an=0;a;){for(an++,b=a,_n=0,s=0;s<$n&&(_n++,b=b.nextZ,!!b);s++);for(On=$n;_n>0||On>0&&b;)_n!==0&&(On===0||!b||a.z<=b.z)?(_e=a,a=a.nextZ,_n--):(_e=b,b=b.nextZ,On--),Kt?Kt.nextZ=_e:o=_e,_e.prevZ=Kt,Kt=_e;a=b}Kt.nextZ=null,$n*=2}while(an>1);return o}function zOrder(o,s,a,b,_e){return o=(o-a)*_e|0,s=(s-b)*_e|0,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,o|s<<1}function getLeftmost(o){let s=o,a=o;do(s.x<a.x||s.x===a.x&&s.y<a.y)&&(a=s),s=s.next;while(s!==o);return a}function pointInTriangle(o,s,a,b,_e,Kt,an,_n){return(_e-an)*(s-_n)>=(o-an)*(Kt-_n)&&(o-an)*(b-_n)>=(a-an)*(s-_n)&&(a-an)*(Kt-_n)>=(_e-an)*(b-_n)}function isValidDiagonal(o,s){return o.next.i!==s.i&&o.prev.i!==s.i&&!intersectsPolygon(o,s)&&(locallyInside(o,s)&&locallyInside(s,o)&&middleInside(o,s)&&(area$1(o.prev,o,s.prev)||area$1(o,s.prev,s))||equals(o,s)&&area$1(o.prev,o,o.next)>0&&area$1(s.prev,s,s.next)>0)}function area$1(o,s,a){return(s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y)}function equals(o,s){return o.x===s.x&&o.y===s.y}function intersects(o,s,a,b){const _e=sign(area$1(o,s,a)),Kt=sign(area$1(o,s,b)),an=sign(area$1(a,b,o)),_n=sign(area$1(a,b,s));return!!(_e!==Kt&&an!==_n||_e===0&&onSegment(o,a,s)||Kt===0&&onSegment(o,b,s)||an===0&&onSegment(a,o,b)||_n===0&&onSegment(a,s,b))}function onSegment(o,s,a){return s.x<=Math.max(o.x,a.x)&&s.x>=Math.min(o.x,a.x)&&s.y<=Math.max(o.y,a.y)&&s.y>=Math.min(o.y,a.y)}function sign(o){return o>0?1:o<0?-1:0}function intersectsPolygon(o,s){let a=o;do{if(a.i!==o.i&&a.next.i!==o.i&&a.i!==s.i&&a.next.i!==s.i&&intersects(a,a.next,o,s))return!0;a=a.next}while(a!==o);return!1}function locallyInside(o,s){return area$1(o.prev,o,o.next)<0?area$1(o,s,o.next)>=0&&area$1(o,o.prev,s)>=0:area$1(o,s,o.prev)<0||area$1(o,o.next,s)<0}function middleInside(o,s){let a=o,b=!1;const _e=(o.x+s.x)/2,Kt=(o.y+s.y)/2;do a.y>Kt!=a.next.y>Kt&&a.next.y!==a.y&&_e<(a.next.x-a.x)*(Kt-a.y)/(a.next.y-a.y)+a.x&&(b=!b),a=a.next;while(a!==o);return b}function splitPolygon(o,s){const a=new Node$2(o.i,o.x,o.y),b=new Node$2(s.i,s.x,s.y),_e=o.next,Kt=s.prev;return o.next=s,s.prev=o,a.next=_e,_e.prev=a,b.next=a,a.prev=b,Kt.next=b,b.prev=Kt,b}function insertNode(o,s,a,b){const _e=new Node$2(o,s,a);return b?(_e.next=b.next,_e.prev=b,b.next.prev=_e,b.next=_e):(_e.prev=_e,_e.next=_e),_e}function removeNode(o){o.next.prev=o.prev,o.prev.next=o.next,o.prevZ&&(o.prevZ.nextZ=o.nextZ),o.nextZ&&(o.nextZ.prevZ=o.prevZ)}function Node$2(o,s,a){this.i=o,this.x=s,this.y=a,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function signedArea(o,s,a,b){let _e=0;for(let Kt=s,an=a-b;Kt<a;Kt+=b)_e+=(o[an]-o[Kt])*(o[Kt+1]+o[an+1]),an=Kt;return _e}class ShapeUtils{static area(s){const a=s.length;let b=0;for(let _e=a-1,Kt=0;Kt<a;_e=Kt++)b+=s[_e].x*s[Kt].y-s[Kt].x*s[_e].y;return b*.5}static isClockWise(s){return ShapeUtils.area(s)<0}static triangulateShape(s,a){const b=[],_e=[],Kt=[];removeDupEndPts(s),addContour(b,s);let an=s.length;a.forEach(removeDupEndPts);for(let On=0;On<a.length;On++)_e.push(an),an+=a[On].length,addContour(b,a[On]);const _n=Earcut.triangulate(b,_e);for(let On=0;On<_n.length;On+=3)Kt.push(_n.slice(On,On+3));return Kt}}function removeDupEndPts(o){const s=o.length;s>2&&o[s-1].equals(o[0])&&o.pop()}function addContour(o,s){for(let a=0;a<s.length;a++)o.push(s[a].x),o.push(s[a].y)}class ExtrudeGeometry extends BufferGeometry{constructor(s=new Shape([new Vector2(.5,.5),new Vector2(-.5,.5),new Vector2(-.5,-.5),new Vector2(.5,-.5)]),a={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:s,options:a},s=Array.isArray(s)?s:[s];const b=this,_e=[],Kt=[];for(let _n=0,On=s.length;_n<On;_n++){const $n=s[_n];an($n)}this.setAttribute("position",new Float32BufferAttribute(_e,3)),this.setAttribute("uv",new Float32BufferAttribute(Kt,2)),this.computeVertexNormals();function an(_n){const On=[],$n=a.curveSegments!==void 0?a.curveSegments:12,dr=a.steps!==void 0?a.steps:1,fr=a.depth!==void 0?a.depth:1;let pr=a.bevelEnabled!==void 0?a.bevelEnabled:!0,Ar=a.bevelThickness!==void 0?a.bevelThickness:.2,Or=a.bevelSize!==void 0?a.bevelSize:Ar-.1,Xr=a.bevelOffset!==void 0?a.bevelOffset:0,ss=a.bevelSegments!==void 0?a.bevelSegments:3;const kr=a.extrudePath,us=a.UVGenerator!==void 0?a.UVGenerator:WorldUVGenerator;let hs,ds=!1,fs,Gs,ga,So;kr&&(hs=kr.getSpacedPoints(dr),ds=!0,pr=!1,fs=kr.computeFrenetFrames(dr,!1),Gs=new Vector3,ga=new Vector3,So=new Vector3),pr||(ss=0,Ar=0,Or=0,Xr=0);const go=_n.extractPoints($n);let xo=go.shape;const Mo=go.holes;if(!ShapeUtils.isClockWise(xo)){xo=xo.reverse();for(let mA=0,FA=Mo.length;mA<FA;mA++){const GA=Mo[mA];ShapeUtils.isClockWise(GA)&&(Mo[mA]=GA.reverse())}}const Al=ShapeUtils.triangulateShape(xo,Mo),xl=xo;for(let mA=0,FA=Mo.length;mA<FA;mA++){const GA=Mo[mA];xo=xo.concat(GA)}function ep(mA,FA,GA){return FA||console.error("THREE.ExtrudeGeometry: vec does not exist"),mA.clone().addScaledVector(FA,GA)}const _f=xo.length,np=Al.length;function _l(mA,FA,GA){let aE,YA,pA;const Ry=mA.x-FA.x,LA=mA.y-FA.y,$A=GA.x-mA.x,KA=GA.y-mA.y,qA=Ry*Ry+LA*LA,AA=Ry*KA-LA*$A;if(Math.abs(AA)>Number.EPSILON){const Dy=Math.sqrt(qA),WA=Math.sqrt($A*$A+KA*KA),LC=FA.x-LA/Dy,lE=FA.y+Ry/Dy,RC=GA.x-KA/WA,$C=GA.y+$A/WA,DC=((RC-LC)*KA-($C-lE)*$A)/(Ry*KA-LA*$A);aE=LC+Ry*DC-mA.x,YA=lE+LA*DC-mA.y;const cE=aE*aE+YA*YA;if(cE<=2)return new Vector2(aE,YA);pA=Math.sqrt(cE/2)}else{let Dy=!1;Ry>Number.EPSILON?$A>Number.EPSILON&&(Dy=!0):Ry<-Number.EPSILON?$A<-Number.EPSILON&&(Dy=!0):Math.sign(LA)===Math.sign(KA)&&(Dy=!0),Dy?(aE=-LA,YA=Ry,pA=Math.sqrt(qA)):(aE=Ry,YA=LA,pA=Math.sqrt(qA/2))}return new Vector2(aE/pA,YA/pA)}const Ml=[];for(let mA=0,FA=xl.length,GA=FA-1,aE=mA+1;mA<FA;mA++,GA++,aE++)GA===FA&&(GA=0),aE===FA&&(aE=0),Ml[mA]=_l(xl[mA],xl[GA],xl[aE]);const tp=[];let El,sp=Ml.concat();for(let mA=0,FA=Mo.length;mA<FA;mA++){const GA=Mo[mA];El=[];for(let aE=0,YA=GA.length,pA=YA-1,Ry=aE+1;aE<YA;aE++,pA++,Ry++)pA===YA&&(pA=0),Ry===YA&&(Ry=0),El[aE]=_l(GA[aE],GA[pA],GA[Ry]);tp.push(El),sp=sp.concat(El)}for(let mA=0;mA<ss;mA++){const FA=mA/ss,GA=Ar*Math.cos(FA*Math.PI/2),aE=Or*Math.sin(FA*Math.PI/2)+Xr;for(let YA=0,pA=xl.length;YA<pA;YA++){const Ry=ep(xl[YA],Ml[YA],aE);Wy(Ry.x,Ry.y,-GA)}for(let YA=0,pA=Mo.length;YA<pA;YA++){const Ry=Mo[YA];El=tp[YA];for(let LA=0,$A=Ry.length;LA<$A;LA++){const KA=ep(Ry[LA],El[LA],aE);Wy(KA.x,KA.y,-GA)}}}const My=Or+Xr;for(let mA=0;mA<_f;mA++){const FA=pr?ep(xo[mA],sp[mA],My):xo[mA];ds?(ga.copy(fs.normals[0]).multiplyScalar(FA.x),Gs.copy(fs.binormals[0]).multiplyScalar(FA.y),So.copy(hs[0]).add(ga).add(Gs),Wy(So.x,So.y,So.z)):Wy(FA.x,FA.y,0)}for(let mA=1;mA<=dr;mA++)for(let FA=0;FA<_f;FA++){const GA=pr?ep(xo[FA],sp[FA],My):xo[FA];ds?(ga.copy(fs.normals[mA]).multiplyScalar(GA.x),Gs.copy(fs.binormals[mA]).multiplyScalar(GA.y),So.copy(hs[mA]).add(ga).add(Gs),Wy(So.x,So.y,So.z)):Wy(GA.x,GA.y,fr/dr*mA)}for(let mA=ss-1;mA>=0;mA--){const FA=mA/ss,GA=Ar*Math.cos(FA*Math.PI/2),aE=Or*Math.sin(FA*Math.PI/2)+Xr;for(let YA=0,pA=xl.length;YA<pA;YA++){const Ry=ep(xl[YA],Ml[YA],aE);Wy(Ry.x,Ry.y,fr+GA)}for(let YA=0,pA=Mo.length;YA<pA;YA++){const Ry=Mo[YA];El=tp[YA];for(let LA=0,$A=Ry.length;LA<$A;LA++){const KA=ep(Ry[LA],El[LA],aE);ds?Wy(KA.x,KA.y+hs[dr-1].y,hs[dr-1].x+GA):Wy(KA.x,KA.y,fr+GA)}}}Py(),Ny();function Py(){const mA=_e.length/3;if(pr){let FA=0,GA=_f*FA;for(let aE=0;aE<np;aE++){const YA=Al[aE];DA(YA[2]+GA,YA[1]+GA,YA[0]+GA)}FA=dr+ss*2,GA=_f*FA;for(let aE=0;aE<np;aE++){const YA=Al[aE];DA(YA[0]+GA,YA[1]+GA,YA[2]+GA)}}else{for(let FA=0;FA<np;FA++){const GA=Al[FA];DA(GA[2],GA[1],GA[0])}for(let FA=0;FA<np;FA++){const GA=Al[FA];DA(GA[0]+_f*dr,GA[1]+_f*dr,GA[2]+_f*dr)}}b.addGroup(mA,_e.length/3-mA,0)}function Ny(){const mA=_e.length/3;let FA=0;wy(xl,FA),FA+=xl.length;for(let GA=0,aE=Mo.length;GA<aE;GA++){const YA=Mo[GA];wy(YA,FA),FA+=YA.length}b.addGroup(mA,_e.length/3-mA,1)}function wy(mA,FA){let GA=mA.length;for(;--GA>=0;){const aE=GA;let YA=GA-1;YA<0&&(YA=mA.length-1);for(let pA=0,Ry=dr+ss*2;pA<Ry;pA++){const LA=_f*pA,$A=_f*(pA+1),KA=FA+aE+LA,qA=FA+YA+LA,AA=FA+YA+$A,Dy=FA+aE+$A;UA(KA,qA,AA,Dy)}}}function Wy(mA,FA,GA){On.push(mA),On.push(FA),On.push(GA)}function DA(mA,FA,GA){jA(mA),jA(FA),jA(GA);const aE=_e.length/3,YA=us.generateTopUV(b,_e,aE-3,aE-2,aE-1);PA(YA[0]),PA(YA[1]),PA(YA[2])}function UA(mA,FA,GA,aE){jA(mA),jA(FA),jA(aE),jA(FA),jA(GA),jA(aE);const YA=_e.length/3,pA=us.generateSideWallUV(b,_e,YA-6,YA-3,YA-2,YA-1);PA(pA[0]),PA(pA[1]),PA(pA[3]),PA(pA[1]),PA(pA[2]),PA(pA[3])}function jA(mA){_e.push(On[mA*3+0]),_e.push(On[mA*3+1]),_e.push(On[mA*3+2])}function PA(mA){Kt.push(mA.x),Kt.push(mA.y)}}}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}toJSON(){const s=super.toJSON(),a=this.parameters.shapes,b=this.parameters.options;return toJSON$1(a,b,s)}static fromJSON(s,a){const b=[];for(let Kt=0,an=s.shapes.length;Kt<an;Kt++){const _n=a[s.shapes[Kt]];b.push(_n)}const _e=s.options.extrudePath;return _e!==void 0&&(s.options.extrudePath=new Curves[_e.type]().fromJSON(_e)),new ExtrudeGeometry(b,s.options)}}const WorldUVGenerator={generateTopUV:function(o,s,a,b,_e){const Kt=s[a*3],an=s[a*3+1],_n=s[b*3],On=s[b*3+1],$n=s[_e*3],dr=s[_e*3+1];return[new Vector2(Kt,an),new Vector2(_n,On),new Vector2($n,dr)]},generateSideWallUV:function(o,s,a,b,_e,Kt){const an=s[a*3],_n=s[a*3+1],On=s[a*3+2],$n=s[b*3],dr=s[b*3+1],fr=s[b*3+2],pr=s[_e*3],Ar=s[_e*3+1],Or=s[_e*3+2],Xr=s[Kt*3],ss=s[Kt*3+1],kr=s[Kt*3+2];return Math.abs(_n-dr)<Math.abs(an-$n)?[new Vector2(an,1-On),new Vector2($n,1-fr),new Vector2(pr,1-Or),new Vector2(Xr,1-kr)]:[new Vector2(_n,1-On),new Vector2(dr,1-fr),new Vector2(Ar,1-Or),new Vector2(ss,1-kr)]}};function toJSON$1(o,s,a){if(a.shapes=[],Array.isArray(o))for(let b=0,_e=o.length;b<_e;b++){const Kt=o[b];a.shapes.push(Kt.uuid)}else a.shapes.push(o.uuid);return a.options=Object.assign({},s),s.extrudePath!==void 0&&(a.options.extrudePath=s.extrudePath.toJSON()),a}class IcosahedronGeometry extends PolyhedronGeometry{constructor(s=1,a=0){const b=(1+Math.sqrt(5))/2,_e=[-1,b,0,1,b,0,-1,-b,0,1,-b,0,0,-1,b,0,1,b,0,-1,-b,0,1,-b,b,0,-1,b,0,1,-b,0,-1,-b,0,1],Kt=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(_e,Kt,s,a),this.type="IcosahedronGeometry",this.parameters={radius:s,detail:a}}static fromJSON(s){return new IcosahedronGeometry(s.radius,s.detail)}}class OctahedronGeometry extends PolyhedronGeometry{constructor(s=1,a=0){const b=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],_e=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(b,_e,s,a),this.type="OctahedronGeometry",this.parameters={radius:s,detail:a}}static fromJSON(s){return new OctahedronGeometry(s.radius,s.detail)}}class RingGeometry extends BufferGeometry{constructor(s=.5,a=1,b=32,_e=1,Kt=0,an=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:s,outerRadius:a,thetaSegments:b,phiSegments:_e,thetaStart:Kt,thetaLength:an},b=Math.max(3,b),_e=Math.max(1,_e);const _n=[],On=[],$n=[],dr=[];let fr=s;const pr=(a-s)/_e,Ar=new Vector3,Or=new Vector2;for(let Xr=0;Xr<=_e;Xr++){for(let ss=0;ss<=b;ss++){const kr=Kt+ss/b*an;Ar.x=fr*Math.cos(kr),Ar.y=fr*Math.sin(kr),On.push(Ar.x,Ar.y,Ar.z),$n.push(0,0,1),Or.x=(Ar.x/a+1)/2,Or.y=(Ar.y/a+1)/2,dr.push(Or.x,Or.y)}fr+=pr}for(let Xr=0;Xr<_e;Xr++){const ss=Xr*(b+1);for(let kr=0;kr<b;kr++){const us=kr+ss,hs=us,ds=us+b+1,fs=us+b+2,Gs=us+1;_n.push(hs,ds,Gs),_n.push(ds,fs,Gs)}}this.setIndex(_n),this.setAttribute("position",new Float32BufferAttribute(On,3)),this.setAttribute("normal",new Float32BufferAttribute($n,3)),this.setAttribute("uv",new Float32BufferAttribute(dr,2))}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}static fromJSON(s){return new RingGeometry(s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength)}}class ShapeGeometry extends BufferGeometry{constructor(s=new Shape([new Vector2(0,.5),new Vector2(-.5,-.5),new Vector2(.5,-.5)]),a=12){super(),this.type="ShapeGeometry",this.parameters={shapes:s,curveSegments:a};const b=[],_e=[],Kt=[],an=[];let _n=0,On=0;if(Array.isArray(s)===!1)$n(s);else for(let dr=0;dr<s.length;dr++)$n(s[dr]),this.addGroup(_n,On,dr),_n+=On,On=0;this.setIndex(b),this.setAttribute("position",new Float32BufferAttribute(_e,3)),this.setAttribute("normal",new Float32BufferAttribute(Kt,3)),this.setAttribute("uv",new Float32BufferAttribute(an,2));function $n(dr){const fr=_e.length/3,pr=dr.extractPoints(a);let Ar=pr.shape;const Or=pr.holes;ShapeUtils.isClockWise(Ar)===!1&&(Ar=Ar.reverse());for(let ss=0,kr=Or.length;ss<kr;ss++){const us=Or[ss];ShapeUtils.isClockWise(us)===!0&&(Or[ss]=us.reverse())}const Xr=ShapeUtils.triangulateShape(Ar,Or);for(let ss=0,kr=Or.length;ss<kr;ss++){const us=Or[ss];Ar=Ar.concat(us)}for(let ss=0,kr=Ar.length;ss<kr;ss++){const us=Ar[ss];_e.push(us.x,us.y,0),Kt.push(0,0,1),an.push(us.x,us.y)}for(let ss=0,kr=Xr.length;ss<kr;ss++){const us=Xr[ss],hs=us[0]+fr,ds=us[1]+fr,fs=us[2]+fr;b.push(hs,ds,fs),On+=3}}}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}toJSON(){const s=super.toJSON(),a=this.parameters.shapes;return toJSON(a,s)}static fromJSON(s,a){const b=[];for(let _e=0,Kt=s.shapes.length;_e<Kt;_e++){const an=a[s.shapes[_e]];b.push(an)}return new ShapeGeometry(b,s.curveSegments)}}function toJSON(o,s){if(s.shapes=[],Array.isArray(o))for(let a=0,b=o.length;a<b;a++){const _e=o[a];s.shapes.push(_e.uuid)}else s.shapes.push(o.uuid);return s}class SphereGeometry extends BufferGeometry{constructor(s=1,a=32,b=16,_e=0,Kt=Math.PI*2,an=0,_n=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:s,widthSegments:a,heightSegments:b,phiStart:_e,phiLength:Kt,thetaStart:an,thetaLength:_n},a=Math.max(3,Math.floor(a)),b=Math.max(2,Math.floor(b));const On=Math.min(an+_n,Math.PI);let $n=0;const dr=[],fr=new Vector3,pr=new Vector3,Ar=[],Or=[],Xr=[],ss=[];for(let kr=0;kr<=b;kr++){const us=[],hs=kr/b;let ds=0;kr===0&&an===0?ds=.5/a:kr===b&&On===Math.PI&&(ds=-.5/a);for(let fs=0;fs<=a;fs++){const Gs=fs/a;fr.x=-s*Math.cos(_e+Gs*Kt)*Math.sin(an+hs*_n),fr.y=s*Math.cos(an+hs*_n),fr.z=s*Math.sin(_e+Gs*Kt)*Math.sin(an+hs*_n),Or.push(fr.x,fr.y,fr.z),pr.copy(fr).normalize(),Xr.push(pr.x,pr.y,pr.z),ss.push(Gs+ds,1-hs),us.push($n++)}dr.push(us)}for(let kr=0;kr<b;kr++)for(let us=0;us<a;us++){const hs=dr[kr][us+1],ds=dr[kr][us],fs=dr[kr+1][us],Gs=dr[kr+1][us+1];(kr!==0||an>0)&&Ar.push(hs,ds,Gs),(kr!==b-1||On<Math.PI)&&Ar.push(ds,fs,Gs)}this.setIndex(Ar),this.setAttribute("position",new Float32BufferAttribute(Or,3)),this.setAttribute("normal",new Float32BufferAttribute(Xr,3)),this.setAttribute("uv",new Float32BufferAttribute(ss,2))}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}static fromJSON(s){return new SphereGeometry(s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength)}}class TetrahedronGeometry extends PolyhedronGeometry{constructor(s=1,a=0){const b=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],_e=[2,1,0,0,3,2,1,3,0,2,3,1];super(b,_e,s,a),this.type="TetrahedronGeometry",this.parameters={radius:s,detail:a}}static fromJSON(s){return new TetrahedronGeometry(s.radius,s.detail)}}class TorusGeometry extends BufferGeometry{constructor(s=1,a=.4,b=12,_e=48,Kt=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:s,tube:a,radialSegments:b,tubularSegments:_e,arc:Kt},b=Math.floor(b),_e=Math.floor(_e);const an=[],_n=[],On=[],$n=[],dr=new Vector3,fr=new Vector3,pr=new Vector3;for(let Ar=0;Ar<=b;Ar++)for(let Or=0;Or<=_e;Or++){const Xr=Or/_e*Kt,ss=Ar/b*Math.PI*2;fr.x=(s+a*Math.cos(ss))*Math.cos(Xr),fr.y=(s+a*Math.cos(ss))*Math.sin(Xr),fr.z=a*Math.sin(ss),_n.push(fr.x,fr.y,fr.z),dr.x=s*Math.cos(Xr),dr.y=s*Math.sin(Xr),pr.subVectors(fr,dr).normalize(),On.push(pr.x,pr.y,pr.z),$n.push(Or/_e),$n.push(Ar/b)}for(let Ar=1;Ar<=b;Ar++)for(let Or=1;Or<=_e;Or++){const Xr=(_e+1)*Ar+Or-1,ss=(_e+1)*(Ar-1)+Or-1,kr=(_e+1)*(Ar-1)+Or,us=(_e+1)*Ar+Or;an.push(Xr,ss,us),an.push(ss,kr,us)}this.setIndex(an),this.setAttribute("position",new Float32BufferAttribute(_n,3)),this.setAttribute("normal",new Float32BufferAttribute(On,3)),this.setAttribute("uv",new Float32BufferAttribute($n,2))}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}static fromJSON(s){return new TorusGeometry(s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc)}}class TorusKnotGeometry extends BufferGeometry{constructor(s=1,a=.4,b=64,_e=8,Kt=2,an=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:s,tube:a,tubularSegments:b,radialSegments:_e,p:Kt,q:an},b=Math.floor(b),_e=Math.floor(_e);const _n=[],On=[],$n=[],dr=[],fr=new Vector3,pr=new Vector3,Ar=new Vector3,Or=new Vector3,Xr=new Vector3,ss=new Vector3,kr=new Vector3;for(let hs=0;hs<=b;++hs){const ds=hs/b*Kt*Math.PI*2;us(ds,Kt,an,s,Ar),us(ds+.01,Kt,an,s,Or),ss.subVectors(Or,Ar),kr.addVectors(Or,Ar),Xr.crossVectors(ss,kr),kr.crossVectors(Xr,ss),Xr.normalize(),kr.normalize();for(let fs=0;fs<=_e;++fs){const Gs=fs/_e*Math.PI*2,ga=-a*Math.cos(Gs),So=a*Math.sin(Gs);fr.x=Ar.x+(ga*kr.x+So*Xr.x),fr.y=Ar.y+(ga*kr.y+So*Xr.y),fr.z=Ar.z+(ga*kr.z+So*Xr.z),On.push(fr.x,fr.y,fr.z),pr.subVectors(fr,Ar).normalize(),$n.push(pr.x,pr.y,pr.z),dr.push(hs/b),dr.push(fs/_e)}}for(let hs=1;hs<=b;hs++)for(let ds=1;ds<=_e;ds++){const fs=(_e+1)*(hs-1)+(ds-1),Gs=(_e+1)*hs+(ds-1),ga=(_e+1)*hs+ds,So=(_e+1)*(hs-1)+ds;_n.push(fs,Gs,So),_n.push(Gs,ga,So)}this.setIndex(_n),this.setAttribute("position",new Float32BufferAttribute(On,3)),this.setAttribute("normal",new Float32BufferAttribute($n,3)),this.setAttribute("uv",new Float32BufferAttribute(dr,2));function us(hs,ds,fs,Gs,ga){const So=Math.cos(hs),go=Math.sin(hs),xo=fs/ds*hs,Mo=Math.cos(xo);ga.x=Gs*(2+Mo)*.5*So,ga.y=Gs*(2+Mo)*go*.5,ga.z=Gs*Math.sin(xo)*.5}}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}static fromJSON(s){return new TorusKnotGeometry(s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q)}}class TubeGeometry extends BufferGeometry{constructor(s=new QuadraticBezierCurve3(new Vector3(-1,-1,0),new Vector3(-1,1,0),new Vector3(1,1,0)),a=64,b=1,_e=8,Kt=!1){super(),this.type="TubeGeometry",this.parameters={path:s,tubularSegments:a,radius:b,radialSegments:_e,closed:Kt};const an=s.computeFrenetFrames(a,Kt);this.tangents=an.tangents,this.normals=an.normals,this.binormals=an.binormals;const _n=new Vector3,On=new Vector3,$n=new Vector2;let dr=new Vector3;const fr=[],pr=[],Ar=[],Or=[];Xr(),this.setIndex(Or),this.setAttribute("position",new Float32BufferAttribute(fr,3)),this.setAttribute("normal",new Float32BufferAttribute(pr,3)),this.setAttribute("uv",new Float32BufferAttribute(Ar,2));function Xr(){for(let hs=0;hs<a;hs++)ss(hs);ss(Kt===!1?a:0),us(),kr()}function ss(hs){dr=s.getPointAt(hs/a,dr);const ds=an.normals[hs],fs=an.binormals[hs];for(let Gs=0;Gs<=_e;Gs++){const ga=Gs/_e*Math.PI*2,So=Math.sin(ga),go=-Math.cos(ga);On.x=go*ds.x+So*fs.x,On.y=go*ds.y+So*fs.y,On.z=go*ds.z+So*fs.z,On.normalize(),pr.push(On.x,On.y,On.z),_n.x=dr.x+b*On.x,_n.y=dr.y+b*On.y,_n.z=dr.z+b*On.z,fr.push(_n.x,_n.y,_n.z)}}function kr(){for(let hs=1;hs<=a;hs++)for(let ds=1;ds<=_e;ds++){const fs=(_e+1)*(hs-1)+(ds-1),Gs=(_e+1)*hs+(ds-1),ga=(_e+1)*hs+ds,So=(_e+1)*(hs-1)+ds;Or.push(fs,Gs,So),Or.push(Gs,ga,So)}}function us(){for(let hs=0;hs<=a;hs++)for(let ds=0;ds<=_e;ds++)$n.x=hs/a,$n.y=ds/_e,Ar.push($n.x,$n.y)}}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}toJSON(){const s=super.toJSON();return s.path=this.parameters.path.toJSON(),s}static fromJSON(s){return new TubeGeometry(new Curves[s.path.type]().fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed)}}class WireframeGeometry extends BufferGeometry{constructor(s=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:s},s!==null){const a=[],b=new Set,_e=new Vector3,Kt=new Vector3;if(s.index!==null){const an=s.attributes.position,_n=s.index;let On=s.groups;On.length===0&&(On=[{start:0,count:_n.count,materialIndex:0}]);for(let $n=0,dr=On.length;$n<dr;++$n){const fr=On[$n],pr=fr.start,Ar=fr.count;for(let Or=pr,Xr=pr+Ar;Or<Xr;Or+=3)for(let ss=0;ss<3;ss++){const kr=_n.getX(Or+ss),us=_n.getX(Or+(ss+1)%3);_e.fromBufferAttribute(an,kr),Kt.fromBufferAttribute(an,us),isUniqueEdge(_e,Kt,b)===!0&&(a.push(_e.x,_e.y,_e.z),a.push(Kt.x,Kt.y,Kt.z))}}}else{const an=s.attributes.position;for(let _n=0,On=an.count/3;_n<On;_n++)for(let $n=0;$n<3;$n++){const dr=3*_n+$n,fr=3*_n+($n+1)%3;_e.fromBufferAttribute(an,dr),Kt.fromBufferAttribute(an,fr),isUniqueEdge(_e,Kt,b)===!0&&(a.push(_e.x,_e.y,_e.z),a.push(Kt.x,Kt.y,Kt.z))}}this.setAttribute("position",new Float32BufferAttribute(a,3))}}copy(s){return super.copy(s),this.parameters=Object.assign({},s.parameters),this}}function isUniqueEdge(o,s,a){const b=`${o.x},${o.y},${o.z}-${s.x},${s.y},${s.z}`,_e=`${s.x},${s.y},${s.z}-${o.x},${o.y},${o.z}`;return a.has(b)===!0||a.has(_e)===!0?!1:(a.add(b),a.add(_e),!0)}var Geometries=Object.freeze({__proto__:null,BoxGeometry,CapsuleGeometry,CircleGeometry,ConeGeometry,CylinderGeometry,DodecahedronGeometry,EdgesGeometry,ExtrudeGeometry,IcosahedronGeometry,LatheGeometry,OctahedronGeometry,PlaneGeometry,PolyhedronGeometry,RingGeometry,ShapeGeometry,SphereGeometry,TetrahedronGeometry,TorusGeometry,TorusKnotGeometry,TubeGeometry,WireframeGeometry});class ShadowMaterial extends Material{constructor(s){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Color$1(0),this.transparent=!0,this.fog=!0,this.setValues(s)}copy(s){return super.copy(s),this.color.copy(s.color),this.fog=s.fog,this}}class RawShaderMaterial extends ShaderMaterial{constructor(s){super(s),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class MeshStandardMaterial extends Material{constructor(s){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Color$1(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color$1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Euler,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(s)}copy(s){return super.copy(s),this.defines={STANDARD:""},this.color.copy(s.color),this.roughness=s.roughness,this.metalness=s.metalness,this.map=s.map,this.lightMap=s.lightMap,this.lightMapIntensity=s.lightMapIntensity,this.aoMap=s.aoMap,this.aoMapIntensity=s.aoMapIntensity,this.emissive.copy(s.emissive),this.emissiveMap=s.emissiveMap,this.emissiveIntensity=s.emissiveIntensity,this.bumpMap=s.bumpMap,this.bumpScale=s.bumpScale,this.normalMap=s.normalMap,this.normalMapType=s.normalMapType,this.normalScale.copy(s.normalScale),this.displacementMap=s.displacementMap,this.displacementScale=s.displacementScale,this.displacementBias=s.displacementBias,this.roughnessMap=s.roughnessMap,this.metalnessMap=s.metalnessMap,this.alphaMap=s.alphaMap,this.envMap=s.envMap,this.envMapRotation.copy(s.envMapRotation),this.envMapIntensity=s.envMapIntensity,this.wireframe=s.wireframe,this.wireframeLinewidth=s.wireframeLinewidth,this.wireframeLinecap=s.wireframeLinecap,this.wireframeLinejoin=s.wireframeLinejoin,this.flatShading=s.flatShading,this.fog=s.fog,this}}class MeshPhysicalMaterial extends MeshStandardMaterial{constructor(s){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Vector2(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return clamp$2(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(a){this.ior=(1+.4*a)/(1-.4*a)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Color$1(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Color$1(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Color$1(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(s)}get anisotropy(){return this._anisotropy}set anisotropy(s){this._anisotropy>0!=s>0&&this.version++,this._anisotropy=s}get clearcoat(){return this._clearcoat}set clearcoat(s){this._clearcoat>0!=s>0&&this.version++,this._clearcoat=s}get iridescence(){return this._iridescence}set iridescence(s){this._iridescence>0!=s>0&&this.version++,this._iridescence=s}get sheen(){return this._sheen}set sheen(s){this._sheen>0!=s>0&&this.version++,this._sheen=s}get transmission(){return this._transmission}set transmission(s){this._transmission>0!=s>0&&this.version++,this._transmission=s}copy(s){return super.copy(s),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=s.anisotropy,this.anisotropyRotation=s.anisotropyRotation,this.anisotropyMap=s.anisotropyMap,this.clearcoat=s.clearcoat,this.clearcoatMap=s.clearcoatMap,this.clearcoatRoughness=s.clearcoatRoughness,this.clearcoatRoughnessMap=s.clearcoatRoughnessMap,this.clearcoatNormalMap=s.clearcoatNormalMap,this.clearcoatNormalScale.copy(s.clearcoatNormalScale),this.ior=s.ior,this.iridescence=s.iridescence,this.iridescenceMap=s.iridescenceMap,this.iridescenceIOR=s.iridescenceIOR,this.iridescenceThicknessRange=[...s.iridescenceThicknessRange],this.iridescenceThicknessMap=s.iridescenceThicknessMap,this.sheen=s.sheen,this.sheenColor.copy(s.sheenColor),this.sheenColorMap=s.sheenColorMap,this.sheenRoughness=s.sheenRoughness,this.sheenRoughnessMap=s.sheenRoughnessMap,this.transmission=s.transmission,this.transmissionMap=s.transmissionMap,this.thickness=s.thickness,this.thicknessMap=s.thicknessMap,this.attenuationDistance=s.attenuationDistance,this.attenuationColor.copy(s.attenuationColor),this.specularIntensity=s.specularIntensity,this.specularIntensityMap=s.specularIntensityMap,this.specularColor.copy(s.specularColor),this.specularColorMap=s.specularColorMap,this}}class MeshPhongMaterial extends Material{constructor(s){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Color$1(16777215),this.specular=new Color$1(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color$1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Euler,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(s)}copy(s){return super.copy(s),this.color.copy(s.color),this.specular.copy(s.specular),this.shininess=s.shininess,this.map=s.map,this.lightMap=s.lightMap,this.lightMapIntensity=s.lightMapIntensity,this.aoMap=s.aoMap,this.aoMapIntensity=s.aoMapIntensity,this.emissive.copy(s.emissive),this.emissiveMap=s.emissiveMap,this.emissiveIntensity=s.emissiveIntensity,this.bumpMap=s.bumpMap,this.bumpScale=s.bumpScale,this.normalMap=s.normalMap,this.normalMapType=s.normalMapType,this.normalScale.copy(s.normalScale),this.displacementMap=s.displacementMap,this.displacementScale=s.displacementScale,this.displacementBias=s.displacementBias,this.specularMap=s.specularMap,this.alphaMap=s.alphaMap,this.envMap=s.envMap,this.envMapRotation.copy(s.envMapRotation),this.combine=s.combine,this.reflectivity=s.reflectivity,this.refractionRatio=s.refractionRatio,this.wireframe=s.wireframe,this.wireframeLinewidth=s.wireframeLinewidth,this.wireframeLinecap=s.wireframeLinecap,this.wireframeLinejoin=s.wireframeLinejoin,this.flatShading=s.flatShading,this.fog=s.fog,this}}class MeshToonMaterial extends Material{constructor(s){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Color$1(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color$1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(s)}copy(s){return super.copy(s),this.color.copy(s.color),this.map=s.map,this.gradientMap=s.gradientMap,this.lightMap=s.lightMap,this.lightMapIntensity=s.lightMapIntensity,this.aoMap=s.aoMap,this.aoMapIntensity=s.aoMapIntensity,this.emissive.copy(s.emissive),this.emissiveMap=s.emissiveMap,this.emissiveIntensity=s.emissiveIntensity,this.bumpMap=s.bumpMap,this.bumpScale=s.bumpScale,this.normalMap=s.normalMap,this.normalMapType=s.normalMapType,this.normalScale.copy(s.normalScale),this.displacementMap=s.displacementMap,this.displacementScale=s.displacementScale,this.displacementBias=s.displacementBias,this.alphaMap=s.alphaMap,this.wireframe=s.wireframe,this.wireframeLinewidth=s.wireframeLinewidth,this.wireframeLinecap=s.wireframeLinecap,this.wireframeLinejoin=s.wireframeLinejoin,this.fog=s.fog,this}}class MeshNormalMaterial extends Material{constructor(s){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(s)}copy(s){return super.copy(s),this.bumpMap=s.bumpMap,this.bumpScale=s.bumpScale,this.normalMap=s.normalMap,this.normalMapType=s.normalMapType,this.normalScale.copy(s.normalScale),this.displacementMap=s.displacementMap,this.displacementScale=s.displacementScale,this.displacementBias=s.displacementBias,this.wireframe=s.wireframe,this.wireframeLinewidth=s.wireframeLinewidth,this.flatShading=s.flatShading,this}}class MeshLambertMaterial extends Material{constructor(s){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Color$1(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color$1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Euler,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(s)}copy(s){return super.copy(s),this.color.copy(s.color),this.map=s.map,this.lightMap=s.lightMap,this.lightMapIntensity=s.lightMapIntensity,this.aoMap=s.aoMap,this.aoMapIntensity=s.aoMapIntensity,this.emissive.copy(s.emissive),this.emissiveMap=s.emissiveMap,this.emissiveIntensity=s.emissiveIntensity,this.bumpMap=s.bumpMap,this.bumpScale=s.bumpScale,this.normalMap=s.normalMap,this.normalMapType=s.normalMapType,this.normalScale.copy(s.normalScale),this.displacementMap=s.displacementMap,this.displacementScale=s.displacementScale,this.displacementBias=s.displacementBias,this.specularMap=s.specularMap,this.alphaMap=s.alphaMap,this.envMap=s.envMap,this.envMapRotation.copy(s.envMapRotation),this.combine=s.combine,this.reflectivity=s.reflectivity,this.refractionRatio=s.refractionRatio,this.wireframe=s.wireframe,this.wireframeLinewidth=s.wireframeLinewidth,this.wireframeLinecap=s.wireframeLinecap,this.wireframeLinejoin=s.wireframeLinejoin,this.flatShading=s.flatShading,this.fog=s.fog,this}}class MeshMatcapMaterial extends Material{constructor(s){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Color$1(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(s)}copy(s){return super.copy(s),this.defines={MATCAP:""},this.color.copy(s.color),this.matcap=s.matcap,this.map=s.map,this.bumpMap=s.bumpMap,this.bumpScale=s.bumpScale,this.normalMap=s.normalMap,this.normalMapType=s.normalMapType,this.normalScale.copy(s.normalScale),this.displacementMap=s.displacementMap,this.displacementScale=s.displacementScale,this.displacementBias=s.displacementBias,this.alphaMap=s.alphaMap,this.flatShading=s.flatShading,this.fog=s.fog,this}}class LineDashedMaterial extends LineBasicMaterial{constructor(s){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(s)}copy(s){return super.copy(s),this.scale=s.scale,this.dashSize=s.dashSize,this.gapSize=s.gapSize,this}}function convertArray(o,s,a){return!o||!a&&o.constructor===s?o:typeof s.BYTES_PER_ELEMENT=="number"?new s(o):Array.prototype.slice.call(o)}function isTypedArray(o){return ArrayBuffer.isView(o)&&!(o instanceof DataView)}function getKeyframeOrder(o){function s(_e,Kt){return o[_e]-o[Kt]}const a=o.length,b=new Array(a);for(let _e=0;_e!==a;++_e)b[_e]=_e;return b.sort(s),b}function sortedArray(o,s,a){const b=o.length,_e=new o.constructor(b);for(let Kt=0,an=0;an!==b;++Kt){const _n=a[Kt]*s;for(let On=0;On!==s;++On)_e[an++]=o[_n+On]}return _e}function flattenJSON(o,s,a,b){let _e=1,Kt=o[0];for(;Kt!==void 0&&Kt[b]===void 0;)Kt=o[_e++];if(Kt===void 0)return;let an=Kt[b];if(an!==void 0)if(Array.isArray(an))do an=Kt[b],an!==void 0&&(s.push(Kt.time),a.push.apply(a,an)),Kt=o[_e++];while(Kt!==void 0);else if(an.toArray!==void 0)do an=Kt[b],an!==void 0&&(s.push(Kt.time),an.toArray(a,a.length)),Kt=o[_e++];while(Kt!==void 0);else do an=Kt[b],an!==void 0&&(s.push(Kt.time),a.push(an)),Kt=o[_e++];while(Kt!==void 0)}function subclip(o,s,a,b,_e=30){const Kt=o.clone();Kt.name=s;const an=[];for(let On=0;On<Kt.tracks.length;++On){const $n=Kt.tracks[On],dr=$n.getValueSize(),fr=[],pr=[];for(let Ar=0;Ar<$n.times.length;++Ar){const Or=$n.times[Ar]*_e;if(!(Or<a||Or>=b)){fr.push($n.times[Ar]);for(let Xr=0;Xr<dr;++Xr)pr.push($n.values[Ar*dr+Xr])}}fr.length!==0&&($n.times=convertArray(fr,$n.times.constructor),$n.values=convertArray(pr,$n.values.constructor),an.push($n))}Kt.tracks=an;let _n=1/0;for(let On=0;On<Kt.tracks.length;++On)_n>Kt.tracks[On].times[0]&&(_n=Kt.tracks[On].times[0]);for(let On=0;On<Kt.tracks.length;++On)Kt.tracks[On].shift(-1*_n);return Kt.resetDuration(),Kt}function makeClipAdditive(o,s=0,a=o,b=30){b<=0&&(b=30);const _e=a.tracks.length,Kt=s/b;for(let an=0;an<_e;++an){const _n=a.tracks[an],On=_n.ValueTypeName;if(On==="bool"||On==="string")continue;const $n=o.tracks.find(function(kr){return kr.name===_n.name&&kr.ValueTypeName===On});if($n===void 0)continue;let dr=0;const fr=_n.getValueSize();_n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(dr=fr/3);let pr=0;const Ar=$n.getValueSize();$n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(pr=Ar/3);const Or=_n.times.length-1;let Xr;if(Kt<=_n.times[0]){const kr=dr,us=fr-dr;Xr=_n.values.slice(kr,us)}else if(Kt>=_n.times[Or]){const kr=Or*fr+dr,us=kr+fr-dr;Xr=_n.values.slice(kr,us)}else{const kr=_n.createInterpolant(),us=dr,hs=fr-dr;kr.evaluate(Kt),Xr=kr.resultBuffer.slice(us,hs)}On==="quaternion"&&new Quaternion().fromArray(Xr).normalize().conjugate().toArray(Xr);const ss=$n.times.length;for(let kr=0;kr<ss;++kr){const us=kr*Ar+pr;if(On==="quaternion")Quaternion.multiplyQuaternionsFlat($n.values,us,Xr,0,$n.values,us);else{const hs=Ar-pr*2;for(let ds=0;ds<hs;++ds)$n.values[us+ds]-=Xr[ds]}}}return o.blendMode=AdditiveAnimationBlendMode,o}const AnimationUtils={convertArray,isTypedArray,getKeyframeOrder,sortedArray,flattenJSON,subclip,makeClipAdditive};class Interpolant{constructor(s,a,b,_e){this.parameterPositions=s,this._cachedIndex=0,this.resultBuffer=_e!==void 0?_e:new a.constructor(b),this.sampleValues=a,this.valueSize=b,this.settings=null,this.DefaultSettings_={}}evaluate(s){const a=this.parameterPositions;let b=this._cachedIndex,_e=a[b],Kt=a[b-1];e:{t:{let an;n:{r:if(!(s<_e)){for(let _n=b+2;;){if(_e===void 0){if(s<Kt)break r;return b=a.length,this._cachedIndex=b,this.copySampleValue_(b-1)}if(b===_n)break;if(Kt=_e,_e=a[++b],s<_e)break t}an=a.length;break n}if(!(s>=Kt)){const _n=a[1];s<_n&&(b=2,Kt=_n);for(let On=b-2;;){if(Kt===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(b===On)break;if(_e=Kt,Kt=a[--b-1],s>=Kt)break t}an=b,b=0;break n}break e}for(;b<an;){const _n=b+an>>>1;s<a[_n]?an=_n:b=_n+1}if(_e=a[b],Kt=a[b-1],Kt===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(_e===void 0)return b=a.length,this._cachedIndex=b,this.copySampleValue_(b-1)}this._cachedIndex=b,this.intervalChanged_(b,Kt,_e)}return this.interpolate_(b,Kt,s,_e)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(s){const a=this.resultBuffer,b=this.sampleValues,_e=this.valueSize,Kt=s*_e;for(let an=0;an!==_e;++an)a[an]=b[Kt+an];return a}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class CubicInterpolant extends Interpolant{constructor(s,a,b,_e){super(s,a,b,_e),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:ZeroCurvatureEnding,endingEnd:ZeroCurvatureEnding}}intervalChanged_(s,a,b){const _e=this.parameterPositions;let Kt=s-2,an=s+1,_n=_e[Kt],On=_e[an];if(_n===void 0)switch(this.getSettings_().endingStart){case ZeroSlopeEnding:Kt=s,_n=2*a-b;break;case WrapAroundEnding:Kt=_e.length-2,_n=a+_e[Kt]-_e[Kt+1];break;default:Kt=s,_n=b}if(On===void 0)switch(this.getSettings_().endingEnd){case ZeroSlopeEnding:an=s,On=2*b-a;break;case WrapAroundEnding:an=1,On=b+_e[1]-_e[0];break;default:an=s-1,On=a}const $n=(b-a)*.5,dr=this.valueSize;this._weightPrev=$n/(a-_n),this._weightNext=$n/(On-b),this._offsetPrev=Kt*dr,this._offsetNext=an*dr}interpolate_(s,a,b,_e){const Kt=this.resultBuffer,an=this.sampleValues,_n=this.valueSize,On=s*_n,$n=On-_n,dr=this._offsetPrev,fr=this._offsetNext,pr=this._weightPrev,Ar=this._weightNext,Or=(b-a)/(_e-a),Xr=Or*Or,ss=Xr*Or,kr=-pr*ss+2*pr*Xr-pr*Or,us=(1+pr)*ss+(-1.5-2*pr)*Xr+(-.5+pr)*Or+1,hs=(-1-Ar)*ss+(1.5+Ar)*Xr+.5*Or,ds=Ar*ss-Ar*Xr;for(let fs=0;fs!==_n;++fs)Kt[fs]=kr*an[dr+fs]+us*an[$n+fs]+hs*an[On+fs]+ds*an[fr+fs];return Kt}}class LinearInterpolant extends Interpolant{constructor(s,a,b,_e){super(s,a,b,_e)}interpolate_(s,a,b,_e){const Kt=this.resultBuffer,an=this.sampleValues,_n=this.valueSize,On=s*_n,$n=On-_n,dr=(b-a)/(_e-a),fr=1-dr;for(let pr=0;pr!==_n;++pr)Kt[pr]=an[$n+pr]*fr+an[On+pr]*dr;return Kt}}class DiscreteInterpolant extends Interpolant{constructor(s,a,b,_e){super(s,a,b,_e)}interpolate_(s){return this.copySampleValue_(s-1)}}class KeyframeTrack{constructor(s,a,b,_e){if(s===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(a===void 0||a.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+s);this.name=s,this.times=convertArray(a,this.TimeBufferType),this.values=convertArray(b,this.ValueBufferType),this.setInterpolation(_e||this.DefaultInterpolation)}static toJSON(s){const a=s.constructor;let b;if(a.toJSON!==this.toJSON)b=a.toJSON(s);else{b={name:s.name,times:convertArray(s.times,Array),values:convertArray(s.values,Array)};const _e=s.getInterpolation();_e!==s.DefaultInterpolation&&(b.interpolation=_e)}return b.type=s.ValueTypeName,b}InterpolantFactoryMethodDiscrete(s){return new DiscreteInterpolant(this.times,this.values,this.getValueSize(),s)}InterpolantFactoryMethodLinear(s){return new LinearInterpolant(this.times,this.values,this.getValueSize(),s)}InterpolantFactoryMethodSmooth(s){return new CubicInterpolant(this.times,this.values,this.getValueSize(),s)}setInterpolation(s){let a;switch(s){case InterpolateDiscrete:a=this.InterpolantFactoryMethodDiscrete;break;case InterpolateLinear:a=this.InterpolantFactoryMethodLinear;break;case InterpolateSmooth:a=this.InterpolantFactoryMethodSmooth;break}if(a===void 0){const b="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(s!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(b);return console.warn("THREE.KeyframeTrack:",b),this}return this.createInterpolant=a,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return InterpolateDiscrete;case this.InterpolantFactoryMethodLinear:return InterpolateLinear;case this.InterpolantFactoryMethodSmooth:return InterpolateSmooth}}getValueSize(){return this.values.length/this.times.length}shift(s){if(s!==0){const a=this.times;for(let b=0,_e=a.length;b!==_e;++b)a[b]+=s}return this}scale(s){if(s!==1){const a=this.times;for(let b=0,_e=a.length;b!==_e;++b)a[b]*=s}return this}trim(s,a){const b=this.times,_e=b.length;let Kt=0,an=_e-1;for(;Kt!==_e&&b[Kt]<s;)++Kt;for(;an!==-1&&b[an]>a;)--an;if(++an,Kt!==0||an!==_e){Kt>=an&&(an=Math.max(an,1),Kt=an-1);const _n=this.getValueSize();this.times=b.slice(Kt,an),this.values=this.values.slice(Kt*_n,an*_n)}return this}validate(){let s=!0;const a=this.getValueSize();a-Math.floor(a)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),s=!1);const b=this.times,_e=this.values,Kt=b.length;Kt===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),s=!1);let an=null;for(let _n=0;_n!==Kt;_n++){const On=b[_n];if(typeof On=="number"&&isNaN(On)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,_n,On),s=!1;break}if(an!==null&&an>On){console.error("THREE.KeyframeTrack: Out of order keys.",this,_n,On,an),s=!1;break}an=On}if(_e!==void 0&&isTypedArray(_e))for(let _n=0,On=_e.length;_n!==On;++_n){const $n=_e[_n];if(isNaN($n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,_n,$n),s=!1;break}}return s}optimize(){const s=this.times.slice(),a=this.values.slice(),b=this.getValueSize(),_e=this.getInterpolation()===InterpolateSmooth,Kt=s.length-1;let an=1;for(let _n=1;_n<Kt;++_n){let On=!1;const $n=s[_n],dr=s[_n+1];if($n!==dr&&(_n!==1||$n!==s[0]))if(_e)On=!0;else{const fr=_n*b,pr=fr-b,Ar=fr+b;for(let Or=0;Or!==b;++Or){const Xr=a[fr+Or];if(Xr!==a[pr+Or]||Xr!==a[Ar+Or]){On=!0;break}}}if(On){if(_n!==an){s[an]=s[_n];const fr=_n*b,pr=an*b;for(let Ar=0;Ar!==b;++Ar)a[pr+Ar]=a[fr+Ar]}++an}}if(Kt>0){s[an]=s[Kt];for(let _n=Kt*b,On=an*b,$n=0;$n!==b;++$n)a[On+$n]=a[_n+$n];++an}return an!==s.length?(this.times=s.slice(0,an),this.values=a.slice(0,an*b)):(this.times=s,this.values=a),this}clone(){const s=this.times.slice(),a=this.values.slice(),b=this.constructor,_e=new b(this.name,s,a);return _e.createInterpolant=this.createInterpolant,_e}}KeyframeTrack.prototype.TimeBufferType=Float32Array;KeyframeTrack.prototype.ValueBufferType=Float32Array;KeyframeTrack.prototype.DefaultInterpolation=InterpolateLinear;class BooleanKeyframeTrack extends KeyframeTrack{}BooleanKeyframeTrack.prototype.ValueTypeName="bool";BooleanKeyframeTrack.prototype.ValueBufferType=Array;BooleanKeyframeTrack.prototype.DefaultInterpolation=InterpolateDiscrete;BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0;BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class ColorKeyframeTrack extends KeyframeTrack{}ColorKeyframeTrack.prototype.ValueTypeName="color";class NumberKeyframeTrack extends KeyframeTrack{}NumberKeyframeTrack.prototype.ValueTypeName="number";class QuaternionLinearInterpolant extends Interpolant{constructor(s,a,b,_e){super(s,a,b,_e)}interpolate_(s,a,b,_e){const Kt=this.resultBuffer,an=this.sampleValues,_n=this.valueSize,On=(b-a)/(_e-a);let $n=s*_n;for(let dr=$n+_n;$n!==dr;$n+=4)Quaternion.slerpFlat(Kt,0,an,$n-_n,an,$n,On);return Kt}}class QuaternionKeyframeTrack extends KeyframeTrack{InterpolantFactoryMethodLinear(s){return new QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),s)}}QuaternionKeyframeTrack.prototype.ValueTypeName="quaternion";QuaternionKeyframeTrack.prototype.DefaultInterpolation=InterpolateLinear;QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class StringKeyframeTrack extends KeyframeTrack{}StringKeyframeTrack.prototype.ValueTypeName="string";StringKeyframeTrack.prototype.ValueBufferType=Array;StringKeyframeTrack.prototype.DefaultInterpolation=InterpolateDiscrete;StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0;StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class VectorKeyframeTrack extends KeyframeTrack{}VectorKeyframeTrack.prototype.ValueTypeName="vector";class AnimationClip{constructor(s="",a=-1,b=[],_e=NormalAnimationBlendMode){this.name=s,this.tracks=b,this.duration=a,this.blendMode=_e,this.uuid=generateUUID(),this.duration<0&&this.resetDuration()}static parse(s){const a=[],b=s.tracks,_e=1/(s.fps||1);for(let an=0,_n=b.length;an!==_n;++an)a.push(parseKeyframeTrack(b[an]).scale(_e));const Kt=new this(s.name,s.duration,a,s.blendMode);return Kt.uuid=s.uuid,Kt}static toJSON(s){const a=[],b=s.tracks,_e={name:s.name,duration:s.duration,tracks:a,uuid:s.uuid,blendMode:s.blendMode};for(let Kt=0,an=b.length;Kt!==an;++Kt)a.push(KeyframeTrack.toJSON(b[Kt]));return _e}static CreateFromMorphTargetSequence(s,a,b,_e){const Kt=a.length,an=[];for(let _n=0;_n<Kt;_n++){let On=[],$n=[];On.push((_n+Kt-1)%Kt,_n,(_n+1)%Kt),$n.push(0,1,0);const dr=getKeyframeOrder(On);On=sortedArray(On,1,dr),$n=sortedArray($n,1,dr),!_e&&On[0]===0&&(On.push(Kt),$n.push($n[0])),an.push(new NumberKeyframeTrack(".morphTargetInfluences["+a[_n].name+"]",On,$n).scale(1/b))}return new this(s,-1,an)}static findByName(s,a){let b=s;if(!Array.isArray(s)){const _e=s;b=_e.geometry&&_e.geometry.animations||_e.animations}for(let _e=0;_e<b.length;_e++)if(b[_e].name===a)return b[_e];return null}static CreateClipsFromMorphTargetSequences(s,a,b){const _e={},Kt=/^([\w-]*?)([\d]+)$/;for(let _n=0,On=s.length;_n<On;_n++){const $n=s[_n],dr=$n.name.match(Kt);if(dr&&dr.length>1){const fr=dr[1];let pr=_e[fr];pr||(_e[fr]=pr=[]),pr.push($n)}}const an=[];for(const _n in _e)an.push(this.CreateFromMorphTargetSequence(_n,_e[_n],a,b));return an}static parseAnimation(s,a){if(!s)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const b=function(fr,pr,Ar,Or,Xr){if(Ar.length!==0){const ss=[],kr=[];flattenJSON(Ar,ss,kr,Or),ss.length!==0&&Xr.push(new fr(pr,ss,kr))}},_e=[],Kt=s.name||"default",an=s.fps||30,_n=s.blendMode;let On=s.length||-1;const $n=s.hierarchy||[];for(let fr=0;fr<$n.length;fr++){const pr=$n[fr].keys;if(!(!pr||pr.length===0))if(pr[0].morphTargets){const Ar={};let Or;for(Or=0;Or<pr.length;Or++)if(pr[Or].morphTargets)for(let Xr=0;Xr<pr[Or].morphTargets.length;Xr++)Ar[pr[Or].morphTargets[Xr]]=-1;for(const Xr in Ar){const ss=[],kr=[];for(let us=0;us!==pr[Or].morphTargets.length;++us){const hs=pr[Or];ss.push(hs.time),kr.push(hs.morphTarget===Xr?1:0)}_e.push(new NumberKeyframeTrack(".morphTargetInfluence["+Xr+"]",ss,kr))}On=Ar.length*an}else{const Ar=".bones["+a[fr].name+"]";b(VectorKeyframeTrack,Ar+".position",pr,"pos",_e),b(QuaternionKeyframeTrack,Ar+".quaternion",pr,"rot",_e),b(VectorKeyframeTrack,Ar+".scale",pr,"scl",_e)}}return _e.length===0?null:new this(Kt,On,_e,_n)}resetDuration(){const s=this.tracks;let a=0;for(let b=0,_e=s.length;b!==_e;++b){const Kt=this.tracks[b];a=Math.max(a,Kt.times[Kt.times.length-1])}return this.duration=a,this}trim(){for(let s=0;s<this.tracks.length;s++)this.tracks[s].trim(0,this.duration);return this}validate(){let s=!0;for(let a=0;a<this.tracks.length;a++)s=s&&this.tracks[a].validate();return s}optimize(){for(let s=0;s<this.tracks.length;s++)this.tracks[s].optimize();return this}clone(){const s=[];for(let a=0;a<this.tracks.length;a++)s.push(this.tracks[a].clone());return new this.constructor(this.name,this.duration,s,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function getTrackTypeForValueTypeName(o){switch(o.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return NumberKeyframeTrack;case"vector":case"vector2":case"vector3":case"vector4":return VectorKeyframeTrack;case"color":return ColorKeyframeTrack;case"quaternion":return QuaternionKeyframeTrack;case"bool":case"boolean":return BooleanKeyframeTrack;case"string":return StringKeyframeTrack}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+o)}function parseKeyframeTrack(o){if(o.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const s=getTrackTypeForValueTypeName(o.type);if(o.times===void 0){const a=[],b=[];flattenJSON(o.keys,a,b,"value"),o.times=a,o.values=b}return s.parse!==void 0?s.parse(o):new s(o.name,o.times,o.values,o.interpolation)}const Cache={enabled:!1,files:{},add:function(o,s){this.enabled!==!1&&(this.files[o]=s)},get:function(o){if(this.enabled!==!1)return this.files[o]},remove:function(o){delete this.files[o]},clear:function(){this.files={}}};class LoadingManager{constructor(s,a,b){const _e=this;let Kt=!1,an=0,_n=0,On;const $n=[];this.onStart=void 0,this.onLoad=s,this.onProgress=a,this.onError=b,this.itemStart=function(dr){_n++,Kt===!1&&_e.onStart!==void 0&&_e.onStart(dr,an,_n),Kt=!0},this.itemEnd=function(dr){an++,_e.onProgress!==void 0&&_e.onProgress(dr,an,_n),an===_n&&(Kt=!1,_e.onLoad!==void 0&&_e.onLoad())},this.itemError=function(dr){_e.onError!==void 0&&_e.onError(dr)},this.resolveURL=function(dr){return On?On(dr):dr},this.setURLModifier=function(dr){return On=dr,this},this.addHandler=function(dr,fr){return $n.push(dr,fr),this},this.removeHandler=function(dr){const fr=$n.indexOf(dr);return fr!==-1&&$n.splice(fr,2),this},this.getHandler=function(dr){for(let fr=0,pr=$n.length;fr<pr;fr+=2){const Ar=$n[fr],Or=$n[fr+1];if(Ar.global&&(Ar.lastIndex=0),Ar.test(dr))return Or}return null}}}const DefaultLoadingManager=new LoadingManager;class Loader{constructor(s){this.manager=s!==void 0?s:DefaultLoadingManager,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(s,a){const b=this;return new Promise(function(_e,Kt){b.load(s,_e,a,Kt)})}parse(){}setCrossOrigin(s){return this.crossOrigin=s,this}setWithCredentials(s){return this.withCredentials=s,this}setPath(s){return this.path=s,this}setResourcePath(s){return this.resourcePath=s,this}setRequestHeader(s){return this.requestHeader=s,this}}Loader.DEFAULT_MATERIAL_NAME="__DEFAULT";const loading={};class HttpError extends Error{constructor(s,a){super(s),this.response=a}}class FileLoader extends Loader{constructor(s){super(s)}load(s,a,b,_e){s===void 0&&(s=""),this.path!==void 0&&(s=this.path+s),s=this.manager.resolveURL(s);const Kt=Cache.get(s);if(Kt!==void 0)return this.manager.itemStart(s),setTimeout(()=>{a&&a(Kt),this.manager.itemEnd(s)},0),Kt;if(loading[s]!==void 0){loading[s].push({onLoad:a,onProgress:b,onError:_e});return}loading[s]=[],loading[s].push({onLoad:a,onProgress:b,onError:_e});const an=new Request(s,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),_n=this.mimeType,On=this.responseType;fetch(an).then($n=>{if($n.status===200||$n.status===0){if($n.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||$n.body===void 0||$n.body.getReader===void 0)return $n;const dr=loading[s],fr=$n.body.getReader(),pr=$n.headers.get("Content-Length")||$n.headers.get("X-File-Size"),Ar=pr?parseInt(pr):0,Or=Ar!==0;let Xr=0;const ss=new ReadableStream({start(kr){us();function us(){fr.read().then(({done:hs,value:ds})=>{if(hs)kr.close();else{Xr+=ds.byteLength;const fs=new ProgressEvent("progress",{lengthComputable:Or,loaded:Xr,total:Ar});for(let Gs=0,ga=dr.length;Gs<ga;Gs++){const So=dr[Gs];So.onProgress&&So.onProgress(fs)}kr.enqueue(ds),us()}})}}});return new Response(ss)}else throw new HttpError(`fetch for "${$n.url}" responded with ${$n.status}: ${$n.statusText}`,$n)}).then($n=>{switch(On){case"arraybuffer":return $n.arrayBuffer();case"blob":return $n.blob();case"document":return $n.text().then(dr=>new DOMParser().parseFromString(dr,_n));case"json":return $n.json();default:if(_n===void 0)return $n.text();{const fr=/charset="?([^;"\s]*)"?/i.exec(_n),pr=fr&&fr[1]?fr[1].toLowerCase():void 0,Ar=new TextDecoder(pr);return $n.arrayBuffer().then(Or=>Ar.decode(Or))}}}).then($n=>{Cache.add(s,$n);const dr=loading[s];delete loading[s];for(let fr=0,pr=dr.length;fr<pr;fr++){const Ar=dr[fr];Ar.onLoad&&Ar.onLoad($n)}}).catch($n=>{const dr=loading[s];if(dr===void 0)throw this.manager.itemError(s),$n;delete loading[s];for(let fr=0,pr=dr.length;fr<pr;fr++){const Ar=dr[fr];Ar.onError&&Ar.onError($n)}this.manager.itemError(s)}).finally(()=>{this.manager.itemEnd(s)}),this.manager.itemStart(s)}setResponseType(s){return this.responseType=s,this}setMimeType(s){return this.mimeType=s,this}}class AnimationLoader extends Loader{constructor(s){super(s)}load(s,a,b,_e){const Kt=this,an=new FileLoader(this.manager);an.setPath(this.path),an.setRequestHeader(this.requestHeader),an.setWithCredentials(this.withCredentials),an.load(s,function(_n){try{a(Kt.parse(JSON.parse(_n)))}catch(On){_e?_e(On):console.error(On),Kt.manager.itemError(s)}},b,_e)}parse(s){const a=[];for(let b=0;b<s.length;b++){const _e=AnimationClip.parse(s[b]);a.push(_e)}return a}}class CompressedTextureLoader extends Loader{constructor(s){super(s)}load(s,a,b,_e){const Kt=this,an=[],_n=new CompressedTexture,On=new FileLoader(this.manager);On.setPath(this.path),On.setResponseType("arraybuffer"),On.setRequestHeader(this.requestHeader),On.setWithCredentials(Kt.withCredentials);let $n=0;function dr(fr){On.load(s[fr],function(pr){const Ar=Kt.parse(pr,!0);an[fr]={width:Ar.width,height:Ar.height,format:Ar.format,mipmaps:Ar.mipmaps},$n+=1,$n===6&&(Ar.mipmapCount===1&&(_n.minFilter=LinearFilter),_n.image=an,_n.format=Ar.format,_n.needsUpdate=!0,a&&a(_n))},b,_e)}if(Array.isArray(s))for(let fr=0,pr=s.length;fr<pr;++fr)dr(fr);else On.load(s,function(fr){const pr=Kt.parse(fr,!0);if(pr.isCubemap){const Ar=pr.mipmaps.length/pr.mipmapCount;for(let Or=0;Or<Ar;Or++){an[Or]={mipmaps:[]};for(let Xr=0;Xr<pr.mipmapCount;Xr++)an[Or].mipmaps.push(pr.mipmaps[Or*pr.mipmapCount+Xr]),an[Or].format=pr.format,an[Or].width=pr.width,an[Or].height=pr.height}_n.image=an}else _n.image.width=pr.width,_n.image.height=pr.height,_n.mipmaps=pr.mipmaps;pr.mipmapCount===1&&(_n.minFilter=LinearFilter),_n.format=pr.format,_n.needsUpdate=!0,a&&a(_n)},b,_e);return _n}}class ImageLoader extends Loader{constructor(s){super(s)}load(s,a,b,_e){this.path!==void 0&&(s=this.path+s),s=this.manager.resolveURL(s);const Kt=this,an=Cache.get(s);if(an!==void 0)return Kt.manager.itemStart(s),setTimeout(function(){a&&a(an),Kt.manager.itemEnd(s)},0),an;const _n=createElementNS("img");function On(){dr(),Cache.add(s,this),a&&a(this),Kt.manager.itemEnd(s)}function $n(fr){dr(),_e&&_e(fr),Kt.manager.itemError(s),Kt.manager.itemEnd(s)}function dr(){_n.removeEventListener("load",On,!1),_n.removeEventListener("error",$n,!1)}return _n.addEventListener("load",On,!1),_n.addEventListener("error",$n,!1),s.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(_n.crossOrigin=this.crossOrigin),Kt.manager.itemStart(s),_n.src=s,_n}}class CubeTextureLoader extends Loader{constructor(s){super(s)}load(s,a,b,_e){const Kt=new CubeTexture;Kt.colorSpace=SRGBColorSpace$1;const an=new ImageLoader(this.manager);an.setCrossOrigin(this.crossOrigin),an.setPath(this.path);let _n=0;function On($n){an.load(s[$n],function(dr){Kt.images[$n]=dr,_n++,_n===6&&(Kt.needsUpdate=!0,a&&a(Kt))},void 0,_e)}for(let $n=0;$n<s.length;++$n)On($n);return Kt}}class DataTextureLoader extends Loader{constructor(s){super(s)}load(s,a,b,_e){const Kt=this,an=new DataTexture,_n=new FileLoader(this.manager);return _n.setResponseType("arraybuffer"),_n.setRequestHeader(this.requestHeader),_n.setPath(this.path),_n.setWithCredentials(Kt.withCredentials),_n.load(s,function(On){let $n;try{$n=Kt.parse(On)}catch(dr){if(_e!==void 0)_e(dr);else{console.error(dr);return}}$n.image!==void 0?an.image=$n.image:$n.data!==void 0&&(an.image.width=$n.width,an.image.height=$n.height,an.image.data=$n.data),an.wrapS=$n.wrapS!==void 0?$n.wrapS:ClampToEdgeWrapping,an.wrapT=$n.wrapT!==void 0?$n.wrapT:ClampToEdgeWrapping,an.magFilter=$n.magFilter!==void 0?$n.magFilter:LinearFilter,an.minFilter=$n.minFilter!==void 0?$n.minFilter:LinearFilter,an.anisotropy=$n.anisotropy!==void 0?$n.anisotropy:1,$n.colorSpace!==void 0&&(an.colorSpace=$n.colorSpace),$n.flipY!==void 0&&(an.flipY=$n.flipY),$n.format!==void 0&&(an.format=$n.format),$n.type!==void 0&&(an.type=$n.type),$n.mipmaps!==void 0&&(an.mipmaps=$n.mipmaps,an.minFilter=LinearMipmapLinearFilter),$n.mipmapCount===1&&(an.minFilter=LinearFilter),$n.generateMipmaps!==void 0&&(an.generateMipmaps=$n.generateMipmaps),an.needsUpdate=!0,a&&a(an,$n)},b,_e),an}}class TextureLoader extends Loader{constructor(s){super(s)}load(s,a,b,_e){const Kt=new Texture,an=new ImageLoader(this.manager);return an.setCrossOrigin(this.crossOrigin),an.setPath(this.path),an.load(s,function(_n){Kt.image=_n,Kt.needsUpdate=!0,a!==void 0&&a(Kt)},b,_e),Kt}}class Light extends Object3D{constructor(s,a=1){super(),this.isLight=!0,this.type="Light",this.color=new Color$1(s),this.intensity=a}dispose(){}copy(s,a){return super.copy(s,a),this.color.copy(s.color),this.intensity=s.intensity,this}toJSON(s){const a=super.toJSON(s);return a.object.color=this.color.getHex(),a.object.intensity=this.intensity,this.groundColor!==void 0&&(a.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(a.object.distance=this.distance),this.angle!==void 0&&(a.object.angle=this.angle),this.decay!==void 0&&(a.object.decay=this.decay),this.penumbra!==void 0&&(a.object.penumbra=this.penumbra),this.shadow!==void 0&&(a.object.shadow=this.shadow.toJSON()),a}}class HemisphereLight extends Light{constructor(s,a,b){super(s,b),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Object3D.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Color$1(a)}copy(s,a){return super.copy(s,a),this.groundColor.copy(s.groundColor),this}}const _projScreenMatrix$1=new Matrix4,_lightPositionWorld$1=new Vector3,_lookTarget$1=new Vector3;class LightShadow{constructor(s){this.camera=s,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Vector2(512,512),this.map=null,this.mapPass=null,this.matrix=new Matrix4,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Frustum,this._frameExtents=new Vector2(1,1),this._viewportCount=1,this._viewports=[new Vector4(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(s){const a=this.camera,b=this.matrix;_lightPositionWorld$1.setFromMatrixPosition(s.matrixWorld),a.position.copy(_lightPositionWorld$1),_lookTarget$1.setFromMatrixPosition(s.target.matrixWorld),a.lookAt(_lookTarget$1),a.updateMatrixWorld(),_projScreenMatrix$1.multiplyMatrices(a.projectionMatrix,a.matrixWorldInverse),this._frustum.setFromProjectionMatrix(_projScreenMatrix$1),b.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),b.multiply(_projScreenMatrix$1)}getViewport(s){return this._viewports[s]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(s){return this.camera=s.camera.clone(),this.bias=s.bias,this.radius=s.radius,this.mapSize.copy(s.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const s={};return this.bias!==0&&(s.bias=this.bias),this.normalBias!==0&&(s.normalBias=this.normalBias),this.radius!==1&&(s.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(s.mapSize=this.mapSize.toArray()),s.camera=this.camera.toJSON(!1).object,delete s.camera.matrix,s}}class SpotLightShadow extends LightShadow{constructor(){super(new PerspectiveCamera(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(s){const a=this.camera,b=RAD2DEG*2*s.angle*this.focus,_e=this.mapSize.width/this.mapSize.height,Kt=s.distance||a.far;(b!==a.fov||_e!==a.aspect||Kt!==a.far)&&(a.fov=b,a.aspect=_e,a.far=Kt,a.updateProjectionMatrix()),super.updateMatrices(s)}copy(s){return super.copy(s),this.focus=s.focus,this}}class SpotLight extends Light{constructor(s,a,b=0,_e=Math.PI/3,Kt=0,an=2){super(s,a),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Object3D.DEFAULT_UP),this.updateMatrix(),this.target=new Object3D,this.distance=b,this.angle=_e,this.penumbra=Kt,this.decay=an,this.map=null,this.shadow=new SpotLightShadow}get power(){return this.intensity*Math.PI}set power(s){this.intensity=s/Math.PI}dispose(){this.shadow.dispose()}copy(s,a){return super.copy(s,a),this.distance=s.distance,this.angle=s.angle,this.penumbra=s.penumbra,this.decay=s.decay,this.target=s.target.clone(),this.shadow=s.shadow.clone(),this}}const _projScreenMatrix=new Matrix4,_lightPositionWorld=new Vector3,_lookTarget=new Vector3;class PointLightShadow extends LightShadow{constructor(){super(new PerspectiveCamera(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Vector2(4,2),this._viewportCount=6,this._viewports=[new Vector4(2,1,1,1),new Vector4(0,1,1,1),new Vector4(3,1,1,1),new Vector4(1,1,1,1),new Vector4(3,0,1,1),new Vector4(1,0,1,1)],this._cubeDirections=[new Vector3(1,0,0),new Vector3(-1,0,0),new Vector3(0,0,1),new Vector3(0,0,-1),new Vector3(0,1,0),new Vector3(0,-1,0)],this._cubeUps=[new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,0,1),new Vector3(0,0,-1)]}updateMatrices(s,a=0){const b=this.camera,_e=this.matrix,Kt=s.distance||b.far;Kt!==b.far&&(b.far=Kt,b.updateProjectionMatrix()),_lightPositionWorld.setFromMatrixPosition(s.matrixWorld),b.position.copy(_lightPositionWorld),_lookTarget.copy(b.position),_lookTarget.add(this._cubeDirections[a]),b.up.copy(this._cubeUps[a]),b.lookAt(_lookTarget),b.updateMatrixWorld(),_e.makeTranslation(-_lightPositionWorld.x,-_lightPositionWorld.y,-_lightPositionWorld.z),_projScreenMatrix.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse),this._frustum.setFromProjectionMatrix(_projScreenMatrix)}}class PointLight extends Light{constructor(s,a,b=0,_e=2){super(s,a),this.isPointLight=!0,this.type="PointLight",this.distance=b,this.decay=_e,this.shadow=new PointLightShadow}get power(){return this.intensity*4*Math.PI}set power(s){this.intensity=s/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(s,a){return super.copy(s,a),this.distance=s.distance,this.decay=s.decay,this.shadow=s.shadow.clone(),this}}class DirectionalLightShadow extends LightShadow{constructor(){super(new OrthographicCamera(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class DirectionalLight extends Light{constructor(s,a){super(s,a),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Object3D.DEFAULT_UP),this.updateMatrix(),this.target=new Object3D,this.shadow=new DirectionalLightShadow}dispose(){this.shadow.dispose()}copy(s){return super.copy(s),this.target=s.target.clone(),this.shadow=s.shadow.clone(),this}}class AmbientLight extends Light{constructor(s,a){super(s,a),this.isAmbientLight=!0,this.type="AmbientLight"}}class RectAreaLight extends Light{constructor(s,a,b=10,_e=10){super(s,a),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=b,this.height=_e}get power(){return this.intensity*this.width*this.height*Math.PI}set power(s){this.intensity=s/(this.width*this.height*Math.PI)}copy(s){return super.copy(s),this.width=s.width,this.height=s.height,this}toJSON(s){const a=super.toJSON(s);return a.object.width=this.width,a.object.height=this.height,a}}class SphericalHarmonics3{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let s=0;s<9;s++)this.coefficients.push(new Vector3)}set(s){for(let a=0;a<9;a++)this.coefficients[a].copy(s[a]);return this}zero(){for(let s=0;s<9;s++)this.coefficients[s].set(0,0,0);return this}getAt(s,a){const b=s.x,_e=s.y,Kt=s.z,an=this.coefficients;return a.copy(an[0]).multiplyScalar(.282095),a.addScaledVector(an[1],.488603*_e),a.addScaledVector(an[2],.488603*Kt),a.addScaledVector(an[3],.488603*b),a.addScaledVector(an[4],1.092548*(b*_e)),a.addScaledVector(an[5],1.092548*(_e*Kt)),a.addScaledVector(an[6],.315392*(3*Kt*Kt-1)),a.addScaledVector(an[7],1.092548*(b*Kt)),a.addScaledVector(an[8],.546274*(b*b-_e*_e)),a}getIrradianceAt(s,a){const b=s.x,_e=s.y,Kt=s.z,an=this.coefficients;return a.copy(an[0]).multiplyScalar(.886227),a.addScaledVector(an[1],2*.511664*_e),a.addScaledVector(an[2],2*.511664*Kt),a.addScaledVector(an[3],2*.511664*b),a.addScaledVector(an[4],2*.429043*b*_e),a.addScaledVector(an[5],2*.429043*_e*Kt),a.addScaledVector(an[6],.743125*Kt*Kt-.247708),a.addScaledVector(an[7],2*.429043*b*Kt),a.addScaledVector(an[8],.429043*(b*b-_e*_e)),a}add(s){for(let a=0;a<9;a++)this.coefficients[a].add(s.coefficients[a]);return this}addScaledSH(s,a){for(let b=0;b<9;b++)this.coefficients[b].addScaledVector(s.coefficients[b],a);return this}scale(s){for(let a=0;a<9;a++)this.coefficients[a].multiplyScalar(s);return this}lerp(s,a){for(let b=0;b<9;b++)this.coefficients[b].lerp(s.coefficients[b],a);return this}equals(s){for(let a=0;a<9;a++)if(!this.coefficients[a].equals(s.coefficients[a]))return!1;return!0}copy(s){return this.set(s.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(s,a=0){const b=this.coefficients;for(let _e=0;_e<9;_e++)b[_e].fromArray(s,a+_e*3);return this}toArray(s=[],a=0){const b=this.coefficients;for(let _e=0;_e<9;_e++)b[_e].toArray(s,a+_e*3);return s}static getBasisAt(s,a){const b=s.x,_e=s.y,Kt=s.z;a[0]=.282095,a[1]=.488603*_e,a[2]=.488603*Kt,a[3]=.488603*b,a[4]=1.092548*b*_e,a[5]=1.092548*_e*Kt,a[6]=.315392*(3*Kt*Kt-1),a[7]=1.092548*b*Kt,a[8]=.546274*(b*b-_e*_e)}}class LightProbe extends Light{constructor(s=new SphericalHarmonics3,a=1){super(void 0,a),this.isLightProbe=!0,this.sh=s}copy(s){return super.copy(s),this.sh.copy(s.sh),this}fromJSON(s){return this.intensity=s.intensity,this.sh.fromArray(s.sh),this}toJSON(s){const a=super.toJSON(s);return a.object.sh=this.sh.toArray(),a}}class MaterialLoader extends Loader{constructor(s){super(s),this.textures={}}load(s,a,b,_e){const Kt=this,an=new FileLoader(Kt.manager);an.setPath(Kt.path),an.setRequestHeader(Kt.requestHeader),an.setWithCredentials(Kt.withCredentials),an.load(s,function(_n){try{a(Kt.parse(JSON.parse(_n)))}catch(On){_e?_e(On):console.error(On),Kt.manager.itemError(s)}},b,_e)}parse(s){const a=this.textures;function b(Kt){return a[Kt]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",Kt),a[Kt]}const _e=MaterialLoader.createMaterialFromType(s.type);if(s.uuid!==void 0&&(_e.uuid=s.uuid),s.name!==void 0&&(_e.name=s.name),s.color!==void 0&&_e.color!==void 0&&_e.color.setHex(s.color),s.roughness!==void 0&&(_e.roughness=s.roughness),s.metalness!==void 0&&(_e.metalness=s.metalness),s.sheen!==void 0&&(_e.sheen=s.sheen),s.sheenColor!==void 0&&(_e.sheenColor=new Color$1().setHex(s.sheenColor)),s.sheenRoughness!==void 0&&(_e.sheenRoughness=s.sheenRoughness),s.emissive!==void 0&&_e.emissive!==void 0&&_e.emissive.setHex(s.emissive),s.specular!==void 0&&_e.specular!==void 0&&_e.specular.setHex(s.specular),s.specularIntensity!==void 0&&(_e.specularIntensity=s.specularIntensity),s.specularColor!==void 0&&_e.specularColor!==void 0&&_e.specularColor.setHex(s.specularColor),s.shininess!==void 0&&(_e.shininess=s.shininess),s.clearcoat!==void 0&&(_e.clearcoat=s.clearcoat),s.clearcoatRoughness!==void 0&&(_e.clearcoatRoughness=s.clearcoatRoughness),s.iridescence!==void 0&&(_e.iridescence=s.iridescence),s.iridescenceIOR!==void 0&&(_e.iridescenceIOR=s.iridescenceIOR),s.iridescenceThicknessRange!==void 0&&(_e.iridescenceThicknessRange=s.iridescenceThicknessRange),s.transmission!==void 0&&(_e.transmission=s.transmission),s.thickness!==void 0&&(_e.thickness=s.thickness),s.attenuationDistance!==void 0&&(_e.attenuationDistance=s.attenuationDistance),s.attenuationColor!==void 0&&_e.attenuationColor!==void 0&&_e.attenuationColor.setHex(s.attenuationColor),s.anisotropy!==void 0&&(_e.anisotropy=s.anisotropy),s.anisotropyRotation!==void 0&&(_e.anisotropyRotation=s.anisotropyRotation),s.fog!==void 0&&(_e.fog=s.fog),s.flatShading!==void 0&&(_e.flatShading=s.flatShading),s.blending!==void 0&&(_e.blending=s.blending),s.combine!==void 0&&(_e.combine=s.combine),s.side!==void 0&&(_e.side=s.side),s.shadowSide!==void 0&&(_e.shadowSide=s.shadowSide),s.opacity!==void 0&&(_e.opacity=s.opacity),s.transparent!==void 0&&(_e.transparent=s.transparent),s.alphaTest!==void 0&&(_e.alphaTest=s.alphaTest),s.alphaHash!==void 0&&(_e.alphaHash=s.alphaHash),s.depthFunc!==void 0&&(_e.depthFunc=s.depthFunc),s.depthTest!==void 0&&(_e.depthTest=s.depthTest),s.depthWrite!==void 0&&(_e.depthWrite=s.depthWrite),s.colorWrite!==void 0&&(_e.colorWrite=s.colorWrite),s.blendSrc!==void 0&&(_e.blendSrc=s.blendSrc),s.blendDst!==void 0&&(_e.blendDst=s.blendDst),s.blendEquation!==void 0&&(_e.blendEquation=s.blendEquation),s.blendSrcAlpha!==void 0&&(_e.blendSrcAlpha=s.blendSrcAlpha),s.blendDstAlpha!==void 0&&(_e.blendDstAlpha=s.blendDstAlpha),s.blendEquationAlpha!==void 0&&(_e.blendEquationAlpha=s.blendEquationAlpha),s.blendColor!==void 0&&_e.blendColor!==void 0&&_e.blendColor.setHex(s.blendColor),s.blendAlpha!==void 0&&(_e.blendAlpha=s.blendAlpha),s.stencilWriteMask!==void 0&&(_e.stencilWriteMask=s.stencilWriteMask),s.stencilFunc!==void 0&&(_e.stencilFunc=s.stencilFunc),s.stencilRef!==void 0&&(_e.stencilRef=s.stencilRef),s.stencilFuncMask!==void 0&&(_e.stencilFuncMask=s.stencilFuncMask),s.stencilFail!==void 0&&(_e.stencilFail=s.stencilFail),s.stencilZFail!==void 0&&(_e.stencilZFail=s.stencilZFail),s.stencilZPass!==void 0&&(_e.stencilZPass=s.stencilZPass),s.stencilWrite!==void 0&&(_e.stencilWrite=s.stencilWrite),s.wireframe!==void 0&&(_e.wireframe=s.wireframe),s.wireframeLinewidth!==void 0&&(_e.wireframeLinewidth=s.wireframeLinewidth),s.wireframeLinecap!==void 0&&(_e.wireframeLinecap=s.wireframeLinecap),s.wireframeLinejoin!==void 0&&(_e.wireframeLinejoin=s.wireframeLinejoin),s.rotation!==void 0&&(_e.rotation=s.rotation),s.linewidth!==void 0&&(_e.linewidth=s.linewidth),s.dashSize!==void 0&&(_e.dashSize=s.dashSize),s.gapSize!==void 0&&(_e.gapSize=s.gapSize),s.scale!==void 0&&(_e.scale=s.scale),s.polygonOffset!==void 0&&(_e.polygonOffset=s.polygonOffset),s.polygonOffsetFactor!==void 0&&(_e.polygonOffsetFactor=s.polygonOffsetFactor),s.polygonOffsetUnits!==void 0&&(_e.polygonOffsetUnits=s.polygonOffsetUnits),s.dithering!==void 0&&(_e.dithering=s.dithering),s.alphaToCoverage!==void 0&&(_e.alphaToCoverage=s.alphaToCoverage),s.premultipliedAlpha!==void 0&&(_e.premultipliedAlpha=s.premultipliedAlpha),s.forceSinglePass!==void 0&&(_e.forceSinglePass=s.forceSinglePass),s.visible!==void 0&&(_e.visible=s.visible),s.toneMapped!==void 0&&(_e.toneMapped=s.toneMapped),s.userData!==void 0&&(_e.userData=s.userData),s.vertexColors!==void 0&&(typeof s.vertexColors=="number"?_e.vertexColors=s.vertexColors>0:_e.vertexColors=s.vertexColors),s.uniforms!==void 0)for(const Kt in s.uniforms){const an=s.uniforms[Kt];switch(_e.uniforms[Kt]={},an.type){case"t":_e.uniforms[Kt].value=b(an.value);break;case"c":_e.uniforms[Kt].value=new Color$1().setHex(an.value);break;case"v2":_e.uniforms[Kt].value=new Vector2().fromArray(an.value);break;case"v3":_e.uniforms[Kt].value=new Vector3().fromArray(an.value);break;case"v4":_e.uniforms[Kt].value=new Vector4().fromArray(an.value);break;case"m3":_e.uniforms[Kt].value=new Matrix3().fromArray(an.value);break;case"m4":_e.uniforms[Kt].value=new Matrix4().fromArray(an.value);break;default:_e.uniforms[Kt].value=an.value}}if(s.defines!==void 0&&(_e.defines=s.defines),s.vertexShader!==void 0&&(_e.vertexShader=s.vertexShader),s.fragmentShader!==void 0&&(_e.fragmentShader=s.fragmentShader),s.glslVersion!==void 0&&(_e.glslVersion=s.glslVersion),s.extensions!==void 0)for(const Kt in s.extensions)_e.extensions[Kt]=s.extensions[Kt];if(s.lights!==void 0&&(_e.lights=s.lights),s.clipping!==void 0&&(_e.clipping=s.clipping),s.size!==void 0&&(_e.size=s.size),s.sizeAttenuation!==void 0&&(_e.sizeAttenuation=s.sizeAttenuation),s.map!==void 0&&(_e.map=b(s.map)),s.matcap!==void 0&&(_e.matcap=b(s.matcap)),s.alphaMap!==void 0&&(_e.alphaMap=b(s.alphaMap)),s.bumpMap!==void 0&&(_e.bumpMap=b(s.bumpMap)),s.bumpScale!==void 0&&(_e.bumpScale=s.bumpScale),s.normalMap!==void 0&&(_e.normalMap=b(s.normalMap)),s.normalMapType!==void 0&&(_e.normalMapType=s.normalMapType),s.normalScale!==void 0){let Kt=s.normalScale;Array.isArray(Kt)===!1&&(Kt=[Kt,Kt]),_e.normalScale=new Vector2().fromArray(Kt)}return s.displacementMap!==void 0&&(_e.displacementMap=b(s.displacementMap)),s.displacementScale!==void 0&&(_e.displacementScale=s.displacementScale),s.displacementBias!==void 0&&(_e.displacementBias=s.displacementBias),s.roughnessMap!==void 0&&(_e.roughnessMap=b(s.roughnessMap)),s.metalnessMap!==void 0&&(_e.metalnessMap=b(s.metalnessMap)),s.emissiveMap!==void 0&&(_e.emissiveMap=b(s.emissiveMap)),s.emissiveIntensity!==void 0&&(_e.emissiveIntensity=s.emissiveIntensity),s.specularMap!==void 0&&(_e.specularMap=b(s.specularMap)),s.specularIntensityMap!==void 0&&(_e.specularIntensityMap=b(s.specularIntensityMap)),s.specularColorMap!==void 0&&(_e.specularColorMap=b(s.specularColorMap)),s.envMap!==void 0&&(_e.envMap=b(s.envMap)),s.envMapRotation!==void 0&&_e.envMapRotation.fromArray(s.envMapRotation),s.envMapIntensity!==void 0&&(_e.envMapIntensity=s.envMapIntensity),s.reflectivity!==void 0&&(_e.reflectivity=s.reflectivity),s.refractionRatio!==void 0&&(_e.refractionRatio=s.refractionRatio),s.lightMap!==void 0&&(_e.lightMap=b(s.lightMap)),s.lightMapIntensity!==void 0&&(_e.lightMapIntensity=s.lightMapIntensity),s.aoMap!==void 0&&(_e.aoMap=b(s.aoMap)),s.aoMapIntensity!==void 0&&(_e.aoMapIntensity=s.aoMapIntensity),s.gradientMap!==void 0&&(_e.gradientMap=b(s.gradientMap)),s.clearcoatMap!==void 0&&(_e.clearcoatMap=b(s.clearcoatMap)),s.clearcoatRoughnessMap!==void 0&&(_e.clearcoatRoughnessMap=b(s.clearcoatRoughnessMap)),s.clearcoatNormalMap!==void 0&&(_e.clearcoatNormalMap=b(s.clearcoatNormalMap)),s.clearcoatNormalScale!==void 0&&(_e.clearcoatNormalScale=new Vector2().fromArray(s.clearcoatNormalScale)),s.iridescenceMap!==void 0&&(_e.iridescenceMap=b(s.iridescenceMap)),s.iridescenceThicknessMap!==void 0&&(_e.iridescenceThicknessMap=b(s.iridescenceThicknessMap)),s.transmissionMap!==void 0&&(_e.transmissionMap=b(s.transmissionMap)),s.thicknessMap!==void 0&&(_e.thicknessMap=b(s.thicknessMap)),s.anisotropyMap!==void 0&&(_e.anisotropyMap=b(s.anisotropyMap)),s.sheenColorMap!==void 0&&(_e.sheenColorMap=b(s.sheenColorMap)),s.sheenRoughnessMap!==void 0&&(_e.sheenRoughnessMap=b(s.sheenRoughnessMap)),_e}setTextures(s){return this.textures=s,this}static createMaterialFromType(s){const a={ShadowMaterial,SpriteMaterial,RawShaderMaterial,ShaderMaterial,PointsMaterial,MeshPhysicalMaterial,MeshStandardMaterial,MeshPhongMaterial,MeshToonMaterial,MeshNormalMaterial,MeshLambertMaterial,MeshDepthMaterial,MeshDistanceMaterial,MeshBasicMaterial,MeshMatcapMaterial,LineDashedMaterial,LineBasicMaterial,Material};return new a[s]}}class LoaderUtils{static decodeText(s){if(typeof TextDecoder<"u")return new TextDecoder().decode(s);let a="";for(let b=0,_e=s.length;b<_e;b++)a+=String.fromCharCode(s[b]);try{return decodeURIComponent(escape(a))}catch{return a}}static extractUrlBase(s){const a=s.lastIndexOf("/");return a===-1?"./":s.slice(0,a+1)}static resolveURL(s,a){return typeof s!="string"||s===""?"":(/^https?:\/\//i.test(a)&&/^\//.test(s)&&(a=a.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(s)||/^data:.*,.*$/i.test(s)||/^blob:.*$/i.test(s)?s:a+s)}}class InstancedBufferGeometry extends BufferGeometry{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(s){return super.copy(s),this.instanceCount=s.instanceCount,this}toJSON(){const s=super.toJSON();return s.instanceCount=this.instanceCount,s.isInstancedBufferGeometry=!0,s}}class BufferGeometryLoader extends Loader{constructor(s){super(s)}load(s,a,b,_e){const Kt=this,an=new FileLoader(Kt.manager);an.setPath(Kt.path),an.setRequestHeader(Kt.requestHeader),an.setWithCredentials(Kt.withCredentials),an.load(s,function(_n){try{a(Kt.parse(JSON.parse(_n)))}catch(On){_e?_e(On):console.error(On),Kt.manager.itemError(s)}},b,_e)}parse(s){const a={},b={};function _e(Ar,Or){if(a[Or]!==void 0)return a[Or];const ss=Ar.interleavedBuffers[Or],kr=Kt(Ar,ss.buffer),us=getTypedArray(ss.type,kr),hs=new InterleavedBuffer(us,ss.stride);return hs.uuid=ss.uuid,a[Or]=hs,hs}function Kt(Ar,Or){if(b[Or]!==void 0)return b[Or];const ss=Ar.arrayBuffers[Or],kr=new Uint32Array(ss).buffer;return b[Or]=kr,kr}const an=s.isInstancedBufferGeometry?new InstancedBufferGeometry:new BufferGeometry,_n=s.data.index;if(_n!==void 0){const Ar=getTypedArray(_n.type,_n.array);an.setIndex(new BufferAttribute(Ar,1))}const On=s.data.attributes;for(const Ar in On){const Or=On[Ar];let Xr;if(Or.isInterleavedBufferAttribute){const ss=_e(s.data,Or.data);Xr=new InterleavedBufferAttribute(ss,Or.itemSize,Or.offset,Or.normalized)}else{const ss=getTypedArray(Or.type,Or.array),kr=Or.isInstancedBufferAttribute?InstancedBufferAttribute:BufferAttribute;Xr=new kr(ss,Or.itemSize,Or.normalized)}Or.name!==void 0&&(Xr.name=Or.name),Or.usage!==void 0&&Xr.setUsage(Or.usage),an.setAttribute(Ar,Xr)}const $n=s.data.morphAttributes;if($n)for(const Ar in $n){const Or=$n[Ar],Xr=[];for(let ss=0,kr=Or.length;ss<kr;ss++){const us=Or[ss];let hs;if(us.isInterleavedBufferAttribute){const ds=_e(s.data,us.data);hs=new InterleavedBufferAttribute(ds,us.itemSize,us.offset,us.normalized)}else{const ds=getTypedArray(us.type,us.array);hs=new BufferAttribute(ds,us.itemSize,us.normalized)}us.name!==void 0&&(hs.name=us.name),Xr.push(hs)}an.morphAttributes[Ar]=Xr}s.data.morphTargetsRelative&&(an.morphTargetsRelative=!0);const fr=s.data.groups||s.data.drawcalls||s.data.offsets;if(fr!==void 0)for(let Ar=0,Or=fr.length;Ar!==Or;++Ar){const Xr=fr[Ar];an.addGroup(Xr.start,Xr.count,Xr.materialIndex)}const pr=s.data.boundingSphere;if(pr!==void 0){const Ar=new Vector3;pr.center!==void 0&&Ar.fromArray(pr.center),an.boundingSphere=new Sphere(Ar,pr.radius)}return s.name&&(an.name=s.name),s.userData&&(an.userData=s.userData),an}}class ObjectLoader extends Loader{constructor(s){super(s)}load(s,a,b,_e){const Kt=this,an=this.path===""?LoaderUtils.extractUrlBase(s):this.path;this.resourcePath=this.resourcePath||an;const _n=new FileLoader(this.manager);_n.setPath(this.path),_n.setRequestHeader(this.requestHeader),_n.setWithCredentials(this.withCredentials),_n.load(s,function(On){let $n=null;try{$n=JSON.parse(On)}catch(fr){_e!==void 0&&_e(fr),console.error("THREE:ObjectLoader: Can't parse "+s+".",fr.message);return}const dr=$n.metadata;if(dr===void 0||dr.type===void 0||dr.type.toLowerCase()==="geometry"){_e!==void 0&&_e(new Error("THREE.ObjectLoader: Can't load "+s)),console.error("THREE.ObjectLoader: Can't load "+s);return}Kt.parse($n,a)},b,_e)}async loadAsync(s,a){const b=this,_e=this.path===""?LoaderUtils.extractUrlBase(s):this.path;this.resourcePath=this.resourcePath||_e;const Kt=new FileLoader(this.manager);Kt.setPath(this.path),Kt.setRequestHeader(this.requestHeader),Kt.setWithCredentials(this.withCredentials);const an=await Kt.loadAsync(s,a),_n=JSON.parse(an),On=_n.metadata;if(On===void 0||On.type===void 0||On.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+s);return await b.parseAsync(_n)}parse(s,a){const b=this.parseAnimations(s.animations),_e=this.parseShapes(s.shapes),Kt=this.parseGeometries(s.geometries,_e),an=this.parseImages(s.images,function(){a!==void 0&&a($n)}),_n=this.parseTextures(s.textures,an),On=this.parseMaterials(s.materials,_n),$n=this.parseObject(s.object,Kt,On,_n,b),dr=this.parseSkeletons(s.skeletons,$n);if(this.bindSkeletons($n,dr),a!==void 0){let fr=!1;for(const pr in an)if(an[pr].data instanceof HTMLImageElement){fr=!0;break}fr===!1&&a($n)}return $n}async parseAsync(s){const a=this.parseAnimations(s.animations),b=this.parseShapes(s.shapes),_e=this.parseGeometries(s.geometries,b),Kt=await this.parseImagesAsync(s.images),an=this.parseTextures(s.textures,Kt),_n=this.parseMaterials(s.materials,an),On=this.parseObject(s.object,_e,_n,an,a),$n=this.parseSkeletons(s.skeletons,On);return this.bindSkeletons(On,$n),On}parseShapes(s){const a={};if(s!==void 0)for(let b=0,_e=s.length;b<_e;b++){const Kt=new Shape().fromJSON(s[b]);a[Kt.uuid]=Kt}return a}parseSkeletons(s,a){const b={},_e={};if(a.traverse(function(Kt){Kt.isBone&&(_e[Kt.uuid]=Kt)}),s!==void 0)for(let Kt=0,an=s.length;Kt<an;Kt++){const _n=new Skeleton().fromJSON(s[Kt],_e);b[_n.uuid]=_n}return b}parseGeometries(s,a){const b={};if(s!==void 0){const _e=new BufferGeometryLoader;for(let Kt=0,an=s.length;Kt<an;Kt++){let _n;const On=s[Kt];switch(On.type){case"BufferGeometry":case"InstancedBufferGeometry":_n=_e.parse(On);break;default:On.type in Geometries?_n=Geometries[On.type].fromJSON(On,a):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${On.type}"`)}_n.uuid=On.uuid,On.name!==void 0&&(_n.name=On.name),On.userData!==void 0&&(_n.userData=On.userData),b[On.uuid]=_n}}return b}parseMaterials(s,a){const b={},_e={};if(s!==void 0){const Kt=new MaterialLoader;Kt.setTextures(a);for(let an=0,_n=s.length;an<_n;an++){const On=s[an];b[On.uuid]===void 0&&(b[On.uuid]=Kt.parse(On)),_e[On.uuid]=b[On.uuid]}}return _e}parseAnimations(s){const a={};if(s!==void 0)for(let b=0;b<s.length;b++){const _e=s[b],Kt=AnimationClip.parse(_e);a[Kt.uuid]=Kt}return a}parseImages(s,a){const b=this,_e={};let Kt;function an(On){return b.manager.itemStart(On),Kt.load(On,function(){b.manager.itemEnd(On)},void 0,function(){b.manager.itemError(On),b.manager.itemEnd(On)})}function _n(On){if(typeof On=="string"){const $n=On,dr=/^(\/\/)|([a-z]+:(\/\/)?)/i.test($n)?$n:b.resourcePath+$n;return an(dr)}else return On.data?{data:getTypedArray(On.type,On.data),width:On.width,height:On.height}:null}if(s!==void 0&&s.length>0){const On=new LoadingManager(a);Kt=new ImageLoader(On),Kt.setCrossOrigin(this.crossOrigin);for(let $n=0,dr=s.length;$n<dr;$n++){const fr=s[$n],pr=fr.url;if(Array.isArray(pr)){const Ar=[];for(let Or=0,Xr=pr.length;Or<Xr;Or++){const ss=pr[Or],kr=_n(ss);kr!==null&&(kr instanceof HTMLImageElement?Ar.push(kr):Ar.push(new DataTexture(kr.data,kr.width,kr.height)))}_e[fr.uuid]=new Source(Ar)}else{const Ar=_n(fr.url);_e[fr.uuid]=new Source(Ar)}}}return _e}async parseImagesAsync(s){const a=this,b={};let _e;async function Kt(an){if(typeof an=="string"){const _n=an,On=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(_n)?_n:a.resourcePath+_n;return await _e.loadAsync(On)}else return an.data?{data:getTypedArray(an.type,an.data),width:an.width,height:an.height}:null}if(s!==void 0&&s.length>0){_e=new ImageLoader(this.manager),_e.setCrossOrigin(this.crossOrigin);for(let an=0,_n=s.length;an<_n;an++){const On=s[an],$n=On.url;if(Array.isArray($n)){const dr=[];for(let fr=0,pr=$n.length;fr<pr;fr++){const Ar=$n[fr],Or=await Kt(Ar);Or!==null&&(Or instanceof HTMLImageElement?dr.push(Or):dr.push(new DataTexture(Or.data,Or.width,Or.height)))}b[On.uuid]=new Source(dr)}else{const dr=await Kt(On.url);b[On.uuid]=new Source(dr)}}}return b}parseTextures(s,a){function b(Kt,an){return typeof Kt=="number"?Kt:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",Kt),an[Kt])}const _e={};if(s!==void 0)for(let Kt=0,an=s.length;Kt<an;Kt++){const _n=s[Kt];_n.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',_n.uuid),a[_n.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",_n.image);const On=a[_n.image],$n=On.data;let dr;Array.isArray($n)?(dr=new CubeTexture,$n.length===6&&(dr.needsUpdate=!0)):($n&&$n.data?dr=new DataTexture:dr=new Texture,$n&&(dr.needsUpdate=!0)),dr.source=On,dr.uuid=_n.uuid,_n.name!==void 0&&(dr.name=_n.name),_n.mapping!==void 0&&(dr.mapping=b(_n.mapping,TEXTURE_MAPPING)),_n.channel!==void 0&&(dr.channel=_n.channel),_n.offset!==void 0&&dr.offset.fromArray(_n.offset),_n.repeat!==void 0&&dr.repeat.fromArray(_n.repeat),_n.center!==void 0&&dr.center.fromArray(_n.center),_n.rotation!==void 0&&(dr.rotation=_n.rotation),_n.wrap!==void 0&&(dr.wrapS=b(_n.wrap[0],TEXTURE_WRAPPING),dr.wrapT=b(_n.wrap[1],TEXTURE_WRAPPING)),_n.format!==void 0&&(dr.format=_n.format),_n.internalFormat!==void 0&&(dr.internalFormat=_n.internalFormat),_n.type!==void 0&&(dr.type=_n.type),_n.colorSpace!==void 0&&(dr.colorSpace=_n.colorSpace),_n.minFilter!==void 0&&(dr.minFilter=b(_n.minFilter,TEXTURE_FILTER)),_n.magFilter!==void 0&&(dr.magFilter=b(_n.magFilter,TEXTURE_FILTER)),_n.anisotropy!==void 0&&(dr.anisotropy=_n.anisotropy),_n.flipY!==void 0&&(dr.flipY=_n.flipY),_n.generateMipmaps!==void 0&&(dr.generateMipmaps=_n.generateMipmaps),_n.premultiplyAlpha!==void 0&&(dr.premultiplyAlpha=_n.premultiplyAlpha),_n.unpackAlignment!==void 0&&(dr.unpackAlignment=_n.unpackAlignment),_n.compareFunction!==void 0&&(dr.compareFunction=_n.compareFunction),_n.userData!==void 0&&(dr.userData=_n.userData),_e[_n.uuid]=dr}return _e}parseObject(s,a,b,_e,Kt){let an;function _n(pr){return a[pr]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",pr),a[pr]}function On(pr){if(pr!==void 0){if(Array.isArray(pr)){const Ar=[];for(let Or=0,Xr=pr.length;Or<Xr;Or++){const ss=pr[Or];b[ss]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",ss),Ar.push(b[ss])}return Ar}return b[pr]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",pr),b[pr]}}function $n(pr){return _e[pr]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",pr),_e[pr]}let dr,fr;switch(s.type){case"Scene":an=new Scene,s.background!==void 0&&(Number.isInteger(s.background)?an.background=new Color$1(s.background):an.background=$n(s.background)),s.environment!==void 0&&(an.environment=$n(s.environment)),s.fog!==void 0&&(s.fog.type==="Fog"?an.fog=new Fog(s.fog.color,s.fog.near,s.fog.far):s.fog.type==="FogExp2"&&(an.fog=new FogExp2(s.fog.color,s.fog.density)),s.fog.name!==""&&(an.fog.name=s.fog.name)),s.backgroundBlurriness!==void 0&&(an.backgroundBlurriness=s.backgroundBlurriness),s.backgroundIntensity!==void 0&&(an.backgroundIntensity=s.backgroundIntensity),s.backgroundRotation!==void 0&&an.backgroundRotation.fromArray(s.backgroundRotation),s.environmentIntensity!==void 0&&(an.environmentIntensity=s.environmentIntensity),s.environmentRotation!==void 0&&an.environmentRotation.fromArray(s.environmentRotation);break;case"PerspectiveCamera":an=new PerspectiveCamera(s.fov,s.aspect,s.near,s.far),s.focus!==void 0&&(an.focus=s.focus),s.zoom!==void 0&&(an.zoom=s.zoom),s.filmGauge!==void 0&&(an.filmGauge=s.filmGauge),s.filmOffset!==void 0&&(an.filmOffset=s.filmOffset),s.view!==void 0&&(an.view=Object.assign({},s.view));break;case"OrthographicCamera":an=new OrthographicCamera(s.left,s.right,s.top,s.bottom,s.near,s.far),s.zoom!==void 0&&(an.zoom=s.zoom),s.view!==void 0&&(an.view=Object.assign({},s.view));break;case"AmbientLight":an=new AmbientLight(s.color,s.intensity);break;case"DirectionalLight":an=new DirectionalLight(s.color,s.intensity);break;case"PointLight":an=new PointLight(s.color,s.intensity,s.distance,s.decay);break;case"RectAreaLight":an=new RectAreaLight(s.color,s.intensity,s.width,s.height);break;case"SpotLight":an=new SpotLight(s.color,s.intensity,s.distance,s.angle,s.penumbra,s.decay);break;case"HemisphereLight":an=new HemisphereLight(s.color,s.groundColor,s.intensity);break;case"LightProbe":an=new LightProbe().fromJSON(s);break;case"SkinnedMesh":dr=_n(s.geometry),fr=On(s.material),an=new SkinnedMesh(dr,fr),s.bindMode!==void 0&&(an.bindMode=s.bindMode),s.bindMatrix!==void 0&&an.bindMatrix.fromArray(s.bindMatrix),s.skeleton!==void 0&&(an.skeleton=s.skeleton);break;case"Mesh":dr=_n(s.geometry),fr=On(s.material),an=new Mesh(dr,fr);break;case"InstancedMesh":dr=_n(s.geometry),fr=On(s.material);const pr=s.count,Ar=s.instanceMatrix,Or=s.instanceColor;an=new InstancedMesh(dr,fr,pr),an.instanceMatrix=new InstancedBufferAttribute(new Float32Array(Ar.array),16),Or!==void 0&&(an.instanceColor=new InstancedBufferAttribute(new Float32Array(Or.array),Or.itemSize));break;case"BatchedMesh":dr=_n(s.geometry),fr=On(s.material),an=new BatchedMesh(s.maxGeometryCount,s.maxVertexCount,s.maxIndexCount,fr),an.geometry=dr,an.perObjectFrustumCulled=s.perObjectFrustumCulled,an.sortObjects=s.sortObjects,an._drawRanges=s.drawRanges,an._reservedRanges=s.reservedRanges,an._visibility=s.visibility,an._active=s.active,an._bounds=s.bounds.map(Xr=>{const ss=new Box3;ss.min.fromArray(Xr.boxMin),ss.max.fromArray(Xr.boxMax);const kr=new Sphere;return kr.radius=Xr.sphereRadius,kr.center.fromArray(Xr.sphereCenter),{boxInitialized:Xr.boxInitialized,box:ss,sphereInitialized:Xr.sphereInitialized,sphere:kr}}),an._maxGeometryCount=s.maxGeometryCount,an._maxVertexCount=s.maxVertexCount,an._maxIndexCount=s.maxIndexCount,an._geometryInitialized=s.geometryInitialized,an._geometryCount=s.geometryCount,an._matricesTexture=$n(s.matricesTexture.uuid);break;case"LOD":an=new LOD;break;case"Line":an=new Line(_n(s.geometry),On(s.material));break;case"LineLoop":an=new LineLoop(_n(s.geometry),On(s.material));break;case"LineSegments":an=new LineSegments(_n(s.geometry),On(s.material));break;case"PointCloud":case"Points":an=new Points(_n(s.geometry),On(s.material));break;case"Sprite":an=new Sprite(On(s.material));break;case"Group":an=new Group;break;case"Bone":an=new Bone;break;default:an=new Object3D}if(an.uuid=s.uuid,s.name!==void 0&&(an.name=s.name),s.matrix!==void 0?(an.matrix.fromArray(s.matrix),s.matrixAutoUpdate!==void 0&&(an.matrixAutoUpdate=s.matrixAutoUpdate),an.matrixAutoUpdate&&an.matrix.decompose(an.position,an.quaternion,an.scale)):(s.position!==void 0&&an.position.fromArray(s.position),s.rotation!==void 0&&an.rotation.fromArray(s.rotation),s.quaternion!==void 0&&an.quaternion.fromArray(s.quaternion),s.scale!==void 0&&an.scale.fromArray(s.scale)),s.up!==void 0&&an.up.fromArray(s.up),s.castShadow!==void 0&&(an.castShadow=s.castShadow),s.receiveShadow!==void 0&&(an.receiveShadow=s.receiveShadow),s.shadow&&(s.shadow.bias!==void 0&&(an.shadow.bias=s.shadow.bias),s.shadow.normalBias!==void 0&&(an.shadow.normalBias=s.shadow.normalBias),s.shadow.radius!==void 0&&(an.shadow.radius=s.shadow.radius),s.shadow.mapSize!==void 0&&an.shadow.mapSize.fromArray(s.shadow.mapSize),s.shadow.camera!==void 0&&(an.shadow.camera=this.parseObject(s.shadow.camera))),s.visible!==void 0&&(an.visible=s.visible),s.frustumCulled!==void 0&&(an.frustumCulled=s.frustumCulled),s.renderOrder!==void 0&&(an.renderOrder=s.renderOrder),s.userData!==void 0&&(an.userData=s.userData),s.layers!==void 0&&(an.layers.mask=s.layers),s.children!==void 0){const pr=s.children;for(let Ar=0;Ar<pr.length;Ar++)an.add(this.parseObject(pr[Ar],a,b,_e,Kt))}if(s.animations!==void 0){const pr=s.animations;for(let Ar=0;Ar<pr.length;Ar++){const Or=pr[Ar];an.animations.push(Kt[Or])}}if(s.type==="LOD"){s.autoUpdate!==void 0&&(an.autoUpdate=s.autoUpdate);const pr=s.levels;for(let Ar=0;Ar<pr.length;Ar++){const Or=pr[Ar],Xr=an.getObjectByProperty("uuid",Or.object);Xr!==void 0&&an.addLevel(Xr,Or.distance,Or.hysteresis)}}return an}bindSkeletons(s,a){Object.keys(a).length!==0&&s.traverse(function(b){if(b.isSkinnedMesh===!0&&b.skeleton!==void 0){const _e=a[b.skeleton];_e===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",b.skeleton):b.bind(_e,b.bindMatrix)}})}}const TEXTURE_MAPPING={UVMapping,CubeReflectionMapping,CubeRefractionMapping,EquirectangularReflectionMapping,EquirectangularRefractionMapping,CubeUVReflectionMapping},TEXTURE_WRAPPING={RepeatWrapping,ClampToEdgeWrapping,MirroredRepeatWrapping},TEXTURE_FILTER={NearestFilter,NearestMipmapNearestFilter,NearestMipmapLinearFilter,LinearFilter,LinearMipmapNearestFilter,LinearMipmapLinearFilter};class ImageBitmapLoader extends Loader{constructor(s){super(s),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(s){return this.options=s,this}load(s,a,b,_e){s===void 0&&(s=""),this.path!==void 0&&(s=this.path+s),s=this.manager.resolveURL(s);const Kt=this,an=Cache.get(s);if(an!==void 0){if(Kt.manager.itemStart(s),an.then){an.then($n=>{a&&a($n),Kt.manager.itemEnd(s)}).catch($n=>{_e&&_e($n)});return}return setTimeout(function(){a&&a(an),Kt.manager.itemEnd(s)},0),an}const _n={};_n.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",_n.headers=this.requestHeader;const On=fetch(s,_n).then(function($n){return $n.blob()}).then(function($n){return createImageBitmap($n,Object.assign(Kt.options,{colorSpaceConversion:"none"}))}).then(function($n){return Cache.add(s,$n),a&&a($n),Kt.manager.itemEnd(s),$n}).catch(function($n){_e&&_e($n),Cache.remove(s),Kt.manager.itemError(s),Kt.manager.itemEnd(s)});Cache.add(s,On),Kt.manager.itemStart(s)}}let _context;class AudioContext{static getContext(){return _context===void 0&&(_context=new(window.AudioContext||window.webkitAudioContext)),_context}static setContext(s){_context=s}}class AudioLoader extends Loader{constructor(s){super(s)}load(s,a,b,_e){const Kt=this,an=new FileLoader(this.manager);an.setResponseType("arraybuffer"),an.setPath(this.path),an.setRequestHeader(this.requestHeader),an.setWithCredentials(this.withCredentials),an.load(s,function(On){try{const $n=On.slice(0);AudioContext.getContext().decodeAudioData($n,function(fr){a(fr)}).catch(_n)}catch($n){_n($n)}},b,_e);function _n(On){_e?_e(On):console.error(On),Kt.manager.itemError(s)}}}const _eyeRight=new Matrix4,_eyeLeft=new Matrix4,_projectionMatrix=new Matrix4;class StereoCamera{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(s){const a=this._cache;if(a.focus!==s.focus||a.fov!==s.fov||a.aspect!==s.aspect*this.aspect||a.near!==s.near||a.far!==s.far||a.zoom!==s.zoom||a.eyeSep!==this.eyeSep){a.focus=s.focus,a.fov=s.fov,a.aspect=s.aspect*this.aspect,a.near=s.near,a.far=s.far,a.zoom=s.zoom,a.eyeSep=this.eyeSep,_projectionMatrix.copy(s.projectionMatrix);const _e=a.eyeSep/2,Kt=_e*a.near/a.focus,an=a.near*Math.tan(DEG2RAD$1*a.fov*.5)/a.zoom;let _n,On;_eyeLeft.elements[12]=-_e,_eyeRight.elements[12]=_e,_n=-an*a.aspect+Kt,On=an*a.aspect+Kt,_projectionMatrix.elements[0]=2*a.near/(On-_n),_projectionMatrix.elements[8]=(On+_n)/(On-_n),this.cameraL.projectionMatrix.copy(_projectionMatrix),_n=-an*a.aspect-Kt,On=an*a.aspect-Kt,_projectionMatrix.elements[0]=2*a.near/(On-_n),_projectionMatrix.elements[8]=(On+_n)/(On-_n),this.cameraR.projectionMatrix.copy(_projectionMatrix)}this.cameraL.matrixWorld.copy(s.matrixWorld).multiply(_eyeLeft),this.cameraR.matrixWorld.copy(s.matrixWorld).multiply(_eyeRight)}}class Clock{constructor(s=!0){this.autoStart=s,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let s=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const a=now();s=(a-this.oldTime)/1e3,this.oldTime=a,this.elapsedTime+=s}return s}}function now(){return(typeof performance>"u"?Date:performance).now()}const _position$1=new Vector3,_quaternion$1=new Quaternion,_scale$1=new Vector3,_orientation$1=new Vector3;class AudioListener extends Object3D{constructor(){super(),this.type="AudioListener",this.context=AudioContext.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Clock}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(s){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=s,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(s){return this.gain.gain.setTargetAtTime(s,this.context.currentTime,.01),this}updateMatrixWorld(s){super.updateMatrixWorld(s);const a=this.context.listener,b=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(_position$1,_quaternion$1,_scale$1),_orientation$1.set(0,0,-1).applyQuaternion(_quaternion$1),a.positionX){const _e=this.context.currentTime+this.timeDelta;a.positionX.linearRampToValueAtTime(_position$1.x,_e),a.positionY.linearRampToValueAtTime(_position$1.y,_e),a.positionZ.linearRampToValueAtTime(_position$1.z,_e),a.forwardX.linearRampToValueAtTime(_orientation$1.x,_e),a.forwardY.linearRampToValueAtTime(_orientation$1.y,_e),a.forwardZ.linearRampToValueAtTime(_orientation$1.z,_e),a.upX.linearRampToValueAtTime(b.x,_e),a.upY.linearRampToValueAtTime(b.y,_e),a.upZ.linearRampToValueAtTime(b.z,_e)}else a.setPosition(_position$1.x,_position$1.y,_position$1.z),a.setOrientation(_orientation$1.x,_orientation$1.y,_orientation$1.z,b.x,b.y,b.z)}}class Audio extends Object3D{constructor(s){super(),this.type="Audio",this.listener=s,this.context=s.context,this.gain=this.context.createGain(),this.gain.connect(s.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(s){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=s,this.connect(),this}setMediaElementSource(s){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(s),this.connect(),this}setMediaStreamSource(s){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(s),this.connect(),this}setBuffer(s){return this.buffer=s,this.sourceType="buffer",this.autoplay&&this.play(),this}play(s=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+s;const a=this.context.createBufferSource();return a.buffer=this.buffer,a.loop=this.loop,a.loopStart=this.loopStart,a.loopEnd=this.loopEnd,a.onended=this.onEnded.bind(this),a.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=a,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let s=1,a=this.filters.length;s<a;s++)this.filters[s-1].connect(this.filters[s]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this._connected!==!1){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let s=1,a=this.filters.length;s<a;s++)this.filters[s-1].disconnect(this.filters[s]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(s){return s||(s=[]),this._connected===!0?(this.disconnect(),this.filters=s.slice(),this.connect()):this.filters=s.slice(),this}setDetune(s){return this.detune=s,this.isPlaying===!0&&this.source.detune!==void 0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(s){return this.setFilters(s?[s]:[])}setPlaybackRate(s){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=s,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(s){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=s,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(s){return this.loopStart=s,this}setLoopEnd(s){return this.loopEnd=s,this}getVolume(){return this.gain.gain.value}setVolume(s){return this.gain.gain.setTargetAtTime(s,this.context.currentTime,.01),this}}const _position=new Vector3,_quaternion=new Quaternion,_scale=new Vector3,_orientation=new Vector3;class PositionalAudio extends Audio{constructor(s){super(s),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){super.connect(),this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(s){return this.panner.refDistance=s,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(s){return this.panner.rolloffFactor=s,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(s){return this.panner.distanceModel=s,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(s){return this.panner.maxDistance=s,this}setDirectionalCone(s,a,b){return this.panner.coneInnerAngle=s,this.panner.coneOuterAngle=a,this.panner.coneOuterGain=b,this}updateMatrixWorld(s){if(super.updateMatrixWorld(s),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(_position,_quaternion,_scale),_orientation.set(0,0,1).applyQuaternion(_quaternion);const a=this.panner;if(a.positionX){const b=this.context.currentTime+this.listener.timeDelta;a.positionX.linearRampToValueAtTime(_position.x,b),a.positionY.linearRampToValueAtTime(_position.y,b),a.positionZ.linearRampToValueAtTime(_position.z,b),a.orientationX.linearRampToValueAtTime(_orientation.x,b),a.orientationY.linearRampToValueAtTime(_orientation.y,b),a.orientationZ.linearRampToValueAtTime(_orientation.z,b)}else a.setPosition(_position.x,_position.y,_position.z),a.setOrientation(_orientation.x,_orientation.y,_orientation.z)}}class AudioAnalyser{constructor(s,a=2048){this.analyser=s.context.createAnalyser(),this.analyser.fftSize=a,this.data=new Uint8Array(this.analyser.frequencyBinCount),s.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let s=0;const a=this.getFrequencyData();for(let b=0;b<a.length;b++)s+=a[b];return s/a.length}}class PropertyMixer{constructor(s,a,b){this.binding=s,this.valueSize=b;let _e,Kt,an;switch(a){case"quaternion":_e=this._slerp,Kt=this._slerpAdditive,an=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(b*6),this._workIndex=5;break;case"string":case"bool":_e=this._select,Kt=this._select,an=this._setAdditiveIdentityOther,this.buffer=new Array(b*5);break;default:_e=this._lerp,Kt=this._lerpAdditive,an=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(b*5)}this._mixBufferRegion=_e,this._mixBufferRegionAdditive=Kt,this._setIdentity=an,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(s,a){const b=this.buffer,_e=this.valueSize,Kt=s*_e+_e;let an=this.cumulativeWeight;if(an===0){for(let _n=0;_n!==_e;++_n)b[Kt+_n]=b[_n];an=a}else{an+=a;const _n=a/an;this._mixBufferRegion(b,Kt,0,_n,_e)}this.cumulativeWeight=an}accumulateAdditive(s){const a=this.buffer,b=this.valueSize,_e=b*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(a,_e,0,s,b),this.cumulativeWeightAdditive+=s}apply(s){const a=this.valueSize,b=this.buffer,_e=s*a+a,Kt=this.cumulativeWeight,an=this.cumulativeWeightAdditive,_n=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,Kt<1){const On=a*this._origIndex;this._mixBufferRegion(b,_e,On,1-Kt,a)}an>0&&this._mixBufferRegionAdditive(b,_e,this._addIndex*a,1,a);for(let On=a,$n=a+a;On!==$n;++On)if(b[On]!==b[On+a]){_n.setValue(b,_e);break}}saveOriginalState(){const s=this.binding,a=this.buffer,b=this.valueSize,_e=b*this._origIndex;s.getValue(a,_e);for(let Kt=b,an=_e;Kt!==an;++Kt)a[Kt]=a[_e+Kt%b];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const s=this.valueSize*3;this.binding.setValue(this.buffer,s)}_setAdditiveIdentityNumeric(){const s=this._addIndex*this.valueSize,a=s+this.valueSize;for(let b=s;b<a;b++)this.buffer[b]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const s=this._origIndex*this.valueSize,a=this._addIndex*this.valueSize;for(let b=0;b<this.valueSize;b++)this.buffer[a+b]=this.buffer[s+b]}_select(s,a,b,_e,Kt){if(_e>=.5)for(let an=0;an!==Kt;++an)s[a+an]=s[b+an]}_slerp(s,a,b,_e){Quaternion.slerpFlat(s,a,s,a,s,b,_e)}_slerpAdditive(s,a,b,_e,Kt){const an=this._workIndex*Kt;Quaternion.multiplyQuaternionsFlat(s,an,s,a,s,b),Quaternion.slerpFlat(s,a,s,a,s,an,_e)}_lerp(s,a,b,_e,Kt){const an=1-_e;for(let _n=0;_n!==Kt;++_n){const On=a+_n;s[On]=s[On]*an+s[b+_n]*_e}}_lerpAdditive(s,a,b,_e,Kt){for(let an=0;an!==Kt;++an){const _n=a+an;s[_n]=s[_n]+s[b+an]*_e}}}const _RESERVED_CHARS_RE="\\[\\]\\.:\\/",_reservedRe=new RegExp("["+_RESERVED_CHARS_RE+"]","g"),_wordChar="[^"+_RESERVED_CHARS_RE+"]",_wordCharOrDot="[^"+_RESERVED_CHARS_RE.replace("\\.","")+"]",_directoryRe=/((?:WC+[\/:])*)/.source.replace("WC",_wordChar),_nodeRe=/(WCOD+)?/.source.replace("WCOD",_wordCharOrDot),_objectRe=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",_wordChar),_propertyRe=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",_wordChar),_trackRe=new RegExp("^"+_directoryRe+_nodeRe+_objectRe+_propertyRe+"$"),_supportedObjectNames=["material","materials","bones","map"];class Composite{constructor(s,a,b){const _e=b||PropertyBinding.parseTrackName(a);this._targetGroup=s,this._bindings=s.subscribe_(a,_e)}getValue(s,a){this.bind();const b=this._targetGroup.nCachedObjects_,_e=this._bindings[b];_e!==void 0&&_e.getValue(s,a)}setValue(s,a){const b=this._bindings;for(let _e=this._targetGroup.nCachedObjects_,Kt=b.length;_e!==Kt;++_e)b[_e].setValue(s,a)}bind(){const s=this._bindings;for(let a=this._targetGroup.nCachedObjects_,b=s.length;a!==b;++a)s[a].bind()}unbind(){const s=this._bindings;for(let a=this._targetGroup.nCachedObjects_,b=s.length;a!==b;++a)s[a].unbind()}}class PropertyBinding{constructor(s,a,b){this.path=a,this.parsedPath=b||PropertyBinding.parseTrackName(a),this.node=PropertyBinding.findNode(s,this.parsedPath.nodeName),this.rootNode=s,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(s,a,b){return s&&s.isAnimationObjectGroup?new PropertyBinding.Composite(s,a,b):new PropertyBinding(s,a,b)}static sanitizeNodeName(s){return s.replace(/\s/g,"_").replace(_reservedRe,"")}static parseTrackName(s){const a=_trackRe.exec(s);if(a===null)throw new Error("PropertyBinding: Cannot parse trackName: "+s);const b={nodeName:a[2],objectName:a[3],objectIndex:a[4],propertyName:a[5],propertyIndex:a[6]},_e=b.nodeName&&b.nodeName.lastIndexOf(".");if(_e!==void 0&&_e!==-1){const Kt=b.nodeName.substring(_e+1);_supportedObjectNames.indexOf(Kt)!==-1&&(b.nodeName=b.nodeName.substring(0,_e),b.objectName=Kt)}if(b.propertyName===null||b.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+s);return b}static findNode(s,a){if(a===void 0||a===""||a==="."||a===-1||a===s.name||a===s.uuid)return s;if(s.skeleton){const b=s.skeleton.getBoneByName(a);if(b!==void 0)return b}if(s.children){const b=function(Kt){for(let an=0;an<Kt.length;an++){const _n=Kt[an];if(_n.name===a||_n.uuid===a)return _n;const On=b(_n.children);if(On)return On}return null},_e=b(s.children);if(_e)return _e}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(s,a){s[a]=this.targetObject[this.propertyName]}_getValue_array(s,a){const b=this.resolvedProperty;for(let _e=0,Kt=b.length;_e!==Kt;++_e)s[a++]=b[_e]}_getValue_arrayElement(s,a){s[a]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(s,a){this.resolvedProperty.toArray(s,a)}_setValue_direct(s,a){this.targetObject[this.propertyName]=s[a]}_setValue_direct_setNeedsUpdate(s,a){this.targetObject[this.propertyName]=s[a],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(s,a){this.targetObject[this.propertyName]=s[a],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(s,a){const b=this.resolvedProperty;for(let _e=0,Kt=b.length;_e!==Kt;++_e)b[_e]=s[a++]}_setValue_array_setNeedsUpdate(s,a){const b=this.resolvedProperty;for(let _e=0,Kt=b.length;_e!==Kt;++_e)b[_e]=s[a++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(s,a){const b=this.resolvedProperty;for(let _e=0,Kt=b.length;_e!==Kt;++_e)b[_e]=s[a++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(s,a){this.resolvedProperty[this.propertyIndex]=s[a]}_setValue_arrayElement_setNeedsUpdate(s,a){this.resolvedProperty[this.propertyIndex]=s[a],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(s,a){this.resolvedProperty[this.propertyIndex]=s[a],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(s,a){this.resolvedProperty.fromArray(s,a)}_setValue_fromArray_setNeedsUpdate(s,a){this.resolvedProperty.fromArray(s,a),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(s,a){this.resolvedProperty.fromArray(s,a),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(s,a){this.bind(),this.getValue(s,a)}_setValue_unbound(s,a){this.bind(),this.setValue(s,a)}bind(){let s=this.node;const a=this.parsedPath,b=a.objectName,_e=a.propertyName;let Kt=a.propertyIndex;if(s||(s=PropertyBinding.findNode(this.rootNode,a.nodeName),this.node=s),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!s){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(b){let $n=a.objectIndex;switch(b){case"materials":if(!s.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!s.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}s=s.material.materials;break;case"bones":if(!s.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}s=s.skeleton.bones;for(let dr=0;dr<s.length;dr++)if(s[dr].name===$n){$n=dr;break}break;case"map":if("map"in s){s=s.map;break}if(!s.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!s.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}s=s.material.map;break;default:if(s[b]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}s=s[b]}if($n!==void 0){if(s[$n]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,s);return}s=s[$n]}}const an=s[_e];if(an===void 0){const $n=a.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+$n+"."+_e+" but it wasn't found.",s);return}let _n=this.Versioning.None;this.targetObject=s,s.needsUpdate!==void 0?_n=this.Versioning.NeedsUpdate:s.matrixWorldNeedsUpdate!==void 0&&(_n=this.Versioning.MatrixWorldNeedsUpdate);let On=this.BindingType.Direct;if(Kt!==void 0){if(_e==="morphTargetInfluences"){if(!s.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!s.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}s.morphTargetDictionary[Kt]!==void 0&&(Kt=s.morphTargetDictionary[Kt])}On=this.BindingType.ArrayElement,this.resolvedProperty=an,this.propertyIndex=Kt}else an.fromArray!==void 0&&an.toArray!==void 0?(On=this.BindingType.HasFromToArray,this.resolvedProperty=an):Array.isArray(an)?(On=this.BindingType.EntireArray,this.resolvedProperty=an):this.propertyName=_e;this.getValue=this.GetterByBindingType[On],this.setValue=this.SetterByBindingTypeAndVersioning[On][_n]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}PropertyBinding.Composite=Composite;PropertyBinding.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};PropertyBinding.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};PropertyBinding.prototype.GetterByBindingType=[PropertyBinding.prototype._getValue_direct,PropertyBinding.prototype._getValue_array,PropertyBinding.prototype._getValue_arrayElement,PropertyBinding.prototype._getValue_toArray];PropertyBinding.prototype.SetterByBindingTypeAndVersioning=[[PropertyBinding.prototype._setValue_direct,PropertyBinding.prototype._setValue_direct_setNeedsUpdate,PropertyBinding.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[PropertyBinding.prototype._setValue_array,PropertyBinding.prototype._setValue_array_setNeedsUpdate,PropertyBinding.prototype._setValue_array_setMatrixWorldNeedsUpdate],[PropertyBinding.prototype._setValue_arrayElement,PropertyBinding.prototype._setValue_arrayElement_setNeedsUpdate,PropertyBinding.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[PropertyBinding.prototype._setValue_fromArray,PropertyBinding.prototype._setValue_fromArray_setNeedsUpdate,PropertyBinding.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class AnimationObjectGroup{constructor(){this.isAnimationObjectGroup=!0,this.uuid=generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const s={};this._indicesByUUID=s;for(let b=0,_e=arguments.length;b!==_e;++b)s[arguments[b].uuid]=b;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const a=this;this.stats={objects:{get total(){return a._objects.length},get inUse(){return this.total-a.nCachedObjects_}},get bindingsPerObject(){return a._bindings.length}}}add(){const s=this._objects,a=this._indicesByUUID,b=this._paths,_e=this._parsedPaths,Kt=this._bindings,an=Kt.length;let _n,On=s.length,$n=this.nCachedObjects_;for(let dr=0,fr=arguments.length;dr!==fr;++dr){const pr=arguments[dr],Ar=pr.uuid;let Or=a[Ar];if(Or===void 0){Or=On++,a[Ar]=Or,s.push(pr);for(let Xr=0,ss=an;Xr!==ss;++Xr)Kt[Xr].push(new PropertyBinding(pr,b[Xr],_e[Xr]))}else if(Or<$n){_n=s[Or];const Xr=--$n,ss=s[Xr];a[ss.uuid]=Or,s[Or]=ss,a[Ar]=Xr,s[Xr]=pr;for(let kr=0,us=an;kr!==us;++kr){const hs=Kt[kr],ds=hs[Xr];let fs=hs[Or];hs[Or]=ds,fs===void 0&&(fs=new PropertyBinding(pr,b[kr],_e[kr])),hs[Xr]=fs}}else s[Or]!==_n&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=$n}remove(){const s=this._objects,a=this._indicesByUUID,b=this._bindings,_e=b.length;let Kt=this.nCachedObjects_;for(let an=0,_n=arguments.length;an!==_n;++an){const On=arguments[an],$n=On.uuid,dr=a[$n];if(dr!==void 0&&dr>=Kt){const fr=Kt++,pr=s[fr];a[pr.uuid]=dr,s[dr]=pr,a[$n]=fr,s[fr]=On;for(let Ar=0,Or=_e;Ar!==Or;++Ar){const Xr=b[Ar],ss=Xr[fr],kr=Xr[dr];Xr[dr]=ss,Xr[fr]=kr}}}this.nCachedObjects_=Kt}uncache(){const s=this._objects,a=this._indicesByUUID,b=this._bindings,_e=b.length;let Kt=this.nCachedObjects_,an=s.length;for(let _n=0,On=arguments.length;_n!==On;++_n){const $n=arguments[_n],dr=$n.uuid,fr=a[dr];if(fr!==void 0)if(delete a[dr],fr<Kt){const pr=--Kt,Ar=s[pr],Or=--an,Xr=s[Or];a[Ar.uuid]=fr,s[fr]=Ar,a[Xr.uuid]=pr,s[pr]=Xr,s.pop();for(let ss=0,kr=_e;ss!==kr;++ss){const us=b[ss],hs=us[pr],ds=us[Or];us[fr]=hs,us[pr]=ds,us.pop()}}else{const pr=--an,Ar=s[pr];pr>0&&(a[Ar.uuid]=fr),s[fr]=Ar,s.pop();for(let Or=0,Xr=_e;Or!==Xr;++Or){const ss=b[Or];ss[fr]=ss[pr],ss.pop()}}}this.nCachedObjects_=Kt}subscribe_(s,a){const b=this._bindingsIndicesByPath;let _e=b[s];const Kt=this._bindings;if(_e!==void 0)return Kt[_e];const an=this._paths,_n=this._parsedPaths,On=this._objects,$n=On.length,dr=this.nCachedObjects_,fr=new Array($n);_e=Kt.length,b[s]=_e,an.push(s),_n.push(a),Kt.push(fr);for(let pr=dr,Ar=On.length;pr!==Ar;++pr){const Or=On[pr];fr[pr]=new PropertyBinding(Or,s,a)}return fr}unsubscribe_(s){const a=this._bindingsIndicesByPath,b=a[s];if(b!==void 0){const _e=this._paths,Kt=this._parsedPaths,an=this._bindings,_n=an.length-1,On=an[_n],$n=s[_n];a[$n]=b,an[b]=On,an.pop(),Kt[b]=Kt[_n],Kt.pop(),_e[b]=_e[_n],_e.pop()}}}class AnimationAction{constructor(s,a,b=null,_e=a.blendMode){this._mixer=s,this._clip=a,this._localRoot=b,this.blendMode=_e;const Kt=a.tracks,an=Kt.length,_n=new Array(an),On={endingStart:ZeroCurvatureEnding,endingEnd:ZeroCurvatureEnding};for(let $n=0;$n!==an;++$n){const dr=Kt[$n].createInterpolant(null);_n[$n]=dr,dr.settings=On}this._interpolantSettings=On,this._interpolants=_n,this._propertyBindings=new Array(an),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=LoopRepeat$1,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(s){return this._startTime=s,this}setLoop(s,a){return this.loop=s,this.repetitions=a,this}setEffectiveWeight(s){return this.weight=s,this._effectiveWeight=this.enabled?s:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(s){return this._scheduleFading(s,0,1)}fadeOut(s){return this._scheduleFading(s,1,0)}crossFadeFrom(s,a,b){if(s.fadeOut(a),this.fadeIn(a),b){const _e=this._clip.duration,Kt=s._clip.duration,an=Kt/_e,_n=_e/Kt;s.warp(1,an,a),this.warp(_n,1,a)}return this}crossFadeTo(s,a,b){return s.crossFadeFrom(this,a,b)}stopFading(){const s=this._weightInterpolant;return s!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(s)),this}setEffectiveTimeScale(s){return this.timeScale=s,this._effectiveTimeScale=this.paused?0:s,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(s){return this.timeScale=this._clip.duration/s,this.stopWarping()}syncWith(s){return this.time=s.time,this.timeScale=s.timeScale,this.stopWarping()}halt(s){return this.warp(this._effectiveTimeScale,0,s)}warp(s,a,b){const _e=this._mixer,Kt=_e.time,an=this.timeScale;let _n=this._timeScaleInterpolant;_n===null&&(_n=_e._lendControlInterpolant(),this._timeScaleInterpolant=_n);const On=_n.parameterPositions,$n=_n.sampleValues;return On[0]=Kt,On[1]=Kt+b,$n[0]=s/an,$n[1]=a/an,this}stopWarping(){const s=this._timeScaleInterpolant;return s!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(s)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(s,a,b,_e){if(!this.enabled){this._updateWeight(s);return}const Kt=this._startTime;if(Kt!==null){const On=(s-Kt)*b;On<0||b===0?a=0:(this._startTime=null,a=b*On)}a*=this._updateTimeScale(s);const an=this._updateTime(a),_n=this._updateWeight(s);if(_n>0){const On=this._interpolants,$n=this._propertyBindings;switch(this.blendMode){case AdditiveAnimationBlendMode:for(let dr=0,fr=On.length;dr!==fr;++dr)On[dr].evaluate(an),$n[dr].accumulateAdditive(_n);break;case NormalAnimationBlendMode:default:for(let dr=0,fr=On.length;dr!==fr;++dr)On[dr].evaluate(an),$n[dr].accumulate(_e,_n)}}}_updateWeight(s){let a=0;if(this.enabled){a=this.weight;const b=this._weightInterpolant;if(b!==null){const _e=b.evaluate(s)[0];a*=_e,s>b.parameterPositions[1]&&(this.stopFading(),_e===0&&(this.enabled=!1))}}return this._effectiveWeight=a,a}_updateTimeScale(s){let a=0;if(!this.paused){a=this.timeScale;const b=this._timeScaleInterpolant;if(b!==null){const _e=b.evaluate(s)[0];a*=_e,s>b.parameterPositions[1]&&(this.stopWarping(),a===0?this.paused=!0:this.timeScale=a)}}return this._effectiveTimeScale=a,a}_updateTime(s){const a=this._clip.duration,b=this.loop;let _e=this.time+s,Kt=this._loopCount;const an=b===LoopPingPong;if(s===0)return Kt===-1?_e:an&&(Kt&1)===1?a-_e:_e;if(b===LoopOnce$1){Kt===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(_e>=a)_e=a;else if(_e<0)_e=0;else{this.time=_e;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=_e,this._mixer.dispatchEvent({type:"finished",action:this,direction:s<0?-1:1})}}else{if(Kt===-1&&(s>=0?(Kt=0,this._setEndings(!0,this.repetitions===0,an)):this._setEndings(this.repetitions===0,!0,an)),_e>=a||_e<0){const _n=Math.floor(_e/a);_e-=a*_n,Kt+=Math.abs(_n);const On=this.repetitions-Kt;if(On<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,_e=s>0?a:0,this.time=_e,this._mixer.dispatchEvent({type:"finished",action:this,direction:s>0?1:-1});else{if(On===1){const $n=s<0;this._setEndings($n,!$n,an)}else this._setEndings(!1,!1,an);this._loopCount=Kt,this.time=_e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:_n})}}else this.time=_e;if(an&&(Kt&1)===1)return a-_e}return _e}_setEndings(s,a,b){const _e=this._interpolantSettings;b?(_e.endingStart=ZeroSlopeEnding,_e.endingEnd=ZeroSlopeEnding):(s?_e.endingStart=this.zeroSlopeAtStart?ZeroSlopeEnding:ZeroCurvatureEnding:_e.endingStart=WrapAroundEnding,a?_e.endingEnd=this.zeroSlopeAtEnd?ZeroSlopeEnding:ZeroCurvatureEnding:_e.endingEnd=WrapAroundEnding)}_scheduleFading(s,a,b){const _e=this._mixer,Kt=_e.time;let an=this._weightInterpolant;an===null&&(an=_e._lendControlInterpolant(),this._weightInterpolant=an);const _n=an.parameterPositions,On=an.sampleValues;return _n[0]=Kt,On[0]=a,_n[1]=Kt+s,On[1]=b,this}}const _controlInterpolantsResultBuffer=new Float32Array(1);class AnimationMixer extends EventDispatcher$2{constructor(s){super(),this._root=s,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(s,a){const b=s._localRoot||this._root,_e=s._clip.tracks,Kt=_e.length,an=s._propertyBindings,_n=s._interpolants,On=b.uuid,$n=this._bindingsByRootAndName;let dr=$n[On];dr===void 0&&(dr={},$n[On]=dr);for(let fr=0;fr!==Kt;++fr){const pr=_e[fr],Ar=pr.name;let Or=dr[Ar];if(Or!==void 0)++Or.referenceCount,an[fr]=Or;else{if(Or=an[fr],Or!==void 0){Or._cacheIndex===null&&(++Or.referenceCount,this._addInactiveBinding(Or,On,Ar));continue}const Xr=a&&a._propertyBindings[fr].binding.parsedPath;Or=new PropertyMixer(PropertyBinding.create(b,Ar,Xr),pr.ValueTypeName,pr.getValueSize()),++Or.referenceCount,this._addInactiveBinding(Or,On,Ar),an[fr]=Or}_n[fr].resultBuffer=Or.buffer}}_activateAction(s){if(!this._isActiveAction(s)){if(s._cacheIndex===null){const b=(s._localRoot||this._root).uuid,_e=s._clip.uuid,Kt=this._actionsByClip[_e];this._bindAction(s,Kt&&Kt.knownActions[0]),this._addInactiveAction(s,_e,b)}const a=s._propertyBindings;for(let b=0,_e=a.length;b!==_e;++b){const Kt=a[b];Kt.useCount++===0&&(this._lendBinding(Kt),Kt.saveOriginalState())}this._lendAction(s)}}_deactivateAction(s){if(this._isActiveAction(s)){const a=s._propertyBindings;for(let b=0,_e=a.length;b!==_e;++b){const Kt=a[b];--Kt.useCount===0&&(Kt.restoreOriginalState(),this._takeBackBinding(Kt))}this._takeBackAction(s)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const s=this;this.stats={actions:{get total(){return s._actions.length},get inUse(){return s._nActiveActions}},bindings:{get total(){return s._bindings.length},get inUse(){return s._nActiveBindings}},controlInterpolants:{get total(){return s._controlInterpolants.length},get inUse(){return s._nActiveControlInterpolants}}}}_isActiveAction(s){const a=s._cacheIndex;return a!==null&&a<this._nActiveActions}_addInactiveAction(s,a,b){const _e=this._actions,Kt=this._actionsByClip;let an=Kt[a];if(an===void 0)an={knownActions:[s],actionByRoot:{}},s._byClipCacheIndex=0,Kt[a]=an;else{const _n=an.knownActions;s._byClipCacheIndex=_n.length,_n.push(s)}s._cacheIndex=_e.length,_e.push(s),an.actionByRoot[b]=s}_removeInactiveAction(s){const a=this._actions,b=a[a.length-1],_e=s._cacheIndex;b._cacheIndex=_e,a[_e]=b,a.pop(),s._cacheIndex=null;const Kt=s._clip.uuid,an=this._actionsByClip,_n=an[Kt],On=_n.knownActions,$n=On[On.length-1],dr=s._byClipCacheIndex;$n._byClipCacheIndex=dr,On[dr]=$n,On.pop(),s._byClipCacheIndex=null;const fr=_n.actionByRoot,pr=(s._localRoot||this._root).uuid;delete fr[pr],On.length===0&&delete an[Kt],this._removeInactiveBindingsForAction(s)}_removeInactiveBindingsForAction(s){const a=s._propertyBindings;for(let b=0,_e=a.length;b!==_e;++b){const Kt=a[b];--Kt.referenceCount===0&&this._removeInactiveBinding(Kt)}}_lendAction(s){const a=this._actions,b=s._cacheIndex,_e=this._nActiveActions++,Kt=a[_e];s._cacheIndex=_e,a[_e]=s,Kt._cacheIndex=b,a[b]=Kt}_takeBackAction(s){const a=this._actions,b=s._cacheIndex,_e=--this._nActiveActions,Kt=a[_e];s._cacheIndex=_e,a[_e]=s,Kt._cacheIndex=b,a[b]=Kt}_addInactiveBinding(s,a,b){const _e=this._bindingsByRootAndName,Kt=this._bindings;let an=_e[a];an===void 0&&(an={},_e[a]=an),an[b]=s,s._cacheIndex=Kt.length,Kt.push(s)}_removeInactiveBinding(s){const a=this._bindings,b=s.binding,_e=b.rootNode.uuid,Kt=b.path,an=this._bindingsByRootAndName,_n=an[_e],On=a[a.length-1],$n=s._cacheIndex;On._cacheIndex=$n,a[$n]=On,a.pop(),delete _n[Kt],Object.keys(_n).length===0&&delete an[_e]}_lendBinding(s){const a=this._bindings,b=s._cacheIndex,_e=this._nActiveBindings++,Kt=a[_e];s._cacheIndex=_e,a[_e]=s,Kt._cacheIndex=b,a[b]=Kt}_takeBackBinding(s){const a=this._bindings,b=s._cacheIndex,_e=--this._nActiveBindings,Kt=a[_e];s._cacheIndex=_e,a[_e]=s,Kt._cacheIndex=b,a[b]=Kt}_lendControlInterpolant(){const s=this._controlInterpolants,a=this._nActiveControlInterpolants++;let b=s[a];return b===void 0&&(b=new LinearInterpolant(new Float32Array(2),new Float32Array(2),1,_controlInterpolantsResultBuffer),b.__cacheIndex=a,s[a]=b),b}_takeBackControlInterpolant(s){const a=this._controlInterpolants,b=s.__cacheIndex,_e=--this._nActiveControlInterpolants,Kt=a[_e];s.__cacheIndex=_e,a[_e]=s,Kt.__cacheIndex=b,a[b]=Kt}clipAction(s,a,b){const _e=a||this._root,Kt=_e.uuid;let an=typeof s=="string"?AnimationClip.findByName(_e,s):s;const _n=an!==null?an.uuid:s,On=this._actionsByClip[_n];let $n=null;if(b===void 0&&(an!==null?b=an.blendMode:b=NormalAnimationBlendMode),On!==void 0){const fr=On.actionByRoot[Kt];if(fr!==void 0&&fr.blendMode===b)return fr;$n=On.knownActions[0],an===null&&(an=$n._clip)}if(an===null)return null;const dr=new AnimationAction(this,an,a,b);return this._bindAction(dr,$n),this._addInactiveAction(dr,_n,Kt),dr}existingAction(s,a){const b=a||this._root,_e=b.uuid,Kt=typeof s=="string"?AnimationClip.findByName(b,s):s,an=Kt?Kt.uuid:s,_n=this._actionsByClip[an];return _n!==void 0&&_n.actionByRoot[_e]||null}stopAllAction(){const s=this._actions,a=this._nActiveActions;for(let b=a-1;b>=0;--b)s[b].stop();return this}update(s){s*=this.timeScale;const a=this._actions,b=this._nActiveActions,_e=this.time+=s,Kt=Math.sign(s),an=this._accuIndex^=1;for(let $n=0;$n!==b;++$n)a[$n]._update(_e,s,Kt,an);const _n=this._bindings,On=this._nActiveBindings;for(let $n=0;$n!==On;++$n)_n[$n].apply(an);return this}setTime(s){this.time=0;for(let a=0;a<this._actions.length;a++)this._actions[a].time=0;return this.update(s)}getRoot(){return this._root}uncacheClip(s){const a=this._actions,b=s.uuid,_e=this._actionsByClip,Kt=_e[b];if(Kt!==void 0){const an=Kt.knownActions;for(let _n=0,On=an.length;_n!==On;++_n){const $n=an[_n];this._deactivateAction($n);const dr=$n._cacheIndex,fr=a[a.length-1];$n._cacheIndex=null,$n._byClipCacheIndex=null,fr._cacheIndex=dr,a[dr]=fr,a.pop(),this._removeInactiveBindingsForAction($n)}delete _e[b]}}uncacheRoot(s){const a=s.uuid,b=this._actionsByClip;for(const an in b){const _n=b[an].actionByRoot,On=_n[a];On!==void 0&&(this._deactivateAction(On),this._removeInactiveAction(On))}const _e=this._bindingsByRootAndName,Kt=_e[a];if(Kt!==void 0)for(const an in Kt){const _n=Kt[an];_n.restoreOriginalState(),this._removeInactiveBinding(_n)}}uncacheAction(s,a){const b=this.existingAction(s,a);b!==null&&(this._deactivateAction(b),this._removeInactiveAction(b))}}class Uniform{constructor(s){this.value=s}clone(){return new Uniform(this.value.clone===void 0?this.value:this.value.clone())}}let _id=0;class UniformsGroup extends EventDispatcher$2{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:_id++}),this.name="",this.usage=StaticDrawUsage,this.uniforms=[]}add(s){return this.uniforms.push(s),this}remove(s){const a=this.uniforms.indexOf(s);return a!==-1&&this.uniforms.splice(a,1),this}setName(s){return this.name=s,this}setUsage(s){return this.usage=s,this}dispose(){return this.dispatchEvent({type:"dispose"}),this}copy(s){this.name=s.name,this.usage=s.usage;const a=s.uniforms;this.uniforms.length=0;for(let b=0,_e=a.length;b<_e;b++){const Kt=Array.isArray(a[b])?a[b]:[a[b]];for(let an=0;an<Kt.length;an++)this.uniforms.push(Kt[an].clone())}return this}clone(){return new this.constructor().copy(this)}}class InstancedInterleavedBuffer extends InterleavedBuffer{constructor(s,a,b=1){super(s,a),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=b}copy(s){return super.copy(s),this.meshPerAttribute=s.meshPerAttribute,this}clone(s){const a=super.clone(s);return a.meshPerAttribute=this.meshPerAttribute,a}toJSON(s){const a=super.toJSON(s);return a.isInstancedInterleavedBuffer=!0,a.meshPerAttribute=this.meshPerAttribute,a}}class GLBufferAttribute{constructor(s,a,b,_e,Kt){this.isGLBufferAttribute=!0,this.name="",this.buffer=s,this.type=a,this.itemSize=b,this.elementSize=_e,this.count=Kt,this.version=0}set needsUpdate(s){s===!0&&this.version++}setBuffer(s){return this.buffer=s,this}setType(s,a){return this.type=s,this.elementSize=a,this}setItemSize(s){return this.itemSize=s,this}setCount(s){return this.count=s,this}}const _matrix=new Matrix4;class Raycaster{constructor(s,a,b=0,_e=1/0){this.ray=new Ray(s,a),this.near=b,this.far=_e,this.camera=null,this.layers=new Layers,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(s,a){this.ray.set(s,a)}setFromCamera(s,a){a.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(a.matrixWorld),this.ray.direction.set(s.x,s.y,.5).unproject(a).sub(this.ray.origin).normalize(),this.camera=a):a.isOrthographicCamera?(this.ray.origin.set(s.x,s.y,(a.near+a.far)/(a.near-a.far)).unproject(a),this.ray.direction.set(0,0,-1).transformDirection(a.matrixWorld),this.camera=a):console.error("THREE.Raycaster: Unsupported camera type: "+a.type)}setFromXRController(s){return _matrix.identity().extractRotation(s.matrixWorld),this.ray.origin.setFromMatrixPosition(s.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(_matrix),this}intersectObject(s,a=!0,b=[]){return intersect(s,this,b,a),b.sort(ascSort),b}intersectObjects(s,a=!0,b=[]){for(let _e=0,Kt=s.length;_e<Kt;_e++)intersect(s[_e],this,b,a);return b.sort(ascSort),b}}function ascSort(o,s){return o.distance-s.distance}function intersect(o,s,a,b){if(o.layers.test(s.layers)&&o.raycast(s,a),b===!0){const _e=o.children;for(let Kt=0,an=_e.length;Kt<an;Kt++)intersect(_e[Kt],s,a,!0)}}class Spherical{constructor(s=1,a=0,b=0){return this.radius=s,this.phi=a,this.theta=b,this}set(s,a,b){return this.radius=s,this.phi=a,this.theta=b,this}copy(s){return this.radius=s.radius,this.phi=s.phi,this.theta=s.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(s){return this.setFromCartesianCoords(s.x,s.y,s.z)}setFromCartesianCoords(s,a,b){return this.radius=Math.sqrt(s*s+a*a+b*b),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(s,b),this.phi=Math.acos(clamp$2(a/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class Cylindrical{constructor(s=1,a=0,b=0){return this.radius=s,this.theta=a,this.y=b,this}set(s,a,b){return this.radius=s,this.theta=a,this.y=b,this}copy(s){return this.radius=s.radius,this.theta=s.theta,this.y=s.y,this}setFromVector3(s){return this.setFromCartesianCoords(s.x,s.y,s.z)}setFromCartesianCoords(s,a,b){return this.radius=Math.sqrt(s*s+b*b),this.theta=Math.atan2(s,b),this.y=a,this}clone(){return new this.constructor().copy(this)}}const _vector$4=new Vector2;class Box2{constructor(s=new Vector2(1/0,1/0),a=new Vector2(-1/0,-1/0)){this.isBox2=!0,this.min=s,this.max=a}set(s,a){return this.min.copy(s),this.max.copy(a),this}setFromPoints(s){this.makeEmpty();for(let a=0,b=s.length;a<b;a++)this.expandByPoint(s[a]);return this}setFromCenterAndSize(s,a){const b=_vector$4.copy(a).multiplyScalar(.5);return this.min.copy(s).sub(b),this.max.copy(s).add(b),this}clone(){return new this.constructor().copy(this)}copy(s){return this.min.copy(s.min),this.max.copy(s.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(s){return this.isEmpty()?s.set(0,0):s.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(s){return this.isEmpty()?s.set(0,0):s.subVectors(this.max,this.min)}expandByPoint(s){return this.min.min(s),this.max.max(s),this}expandByVector(s){return this.min.sub(s),this.max.add(s),this}expandByScalar(s){return this.min.addScalar(-s),this.max.addScalar(s),this}containsPoint(s){return!(s.x<this.min.x||s.x>this.max.x||s.y<this.min.y||s.y>this.max.y)}containsBox(s){return this.min.x<=s.min.x&&s.max.x<=this.max.x&&this.min.y<=s.min.y&&s.max.y<=this.max.y}getParameter(s,a){return a.set((s.x-this.min.x)/(this.max.x-this.min.x),(s.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(s){return!(s.max.x<this.min.x||s.min.x>this.max.x||s.max.y<this.min.y||s.min.y>this.max.y)}clampPoint(s,a){return a.copy(s).clamp(this.min,this.max)}distanceToPoint(s){return this.clampPoint(s,_vector$4).distanceTo(s)}intersect(s){return this.min.max(s.min),this.max.min(s.max),this.isEmpty()&&this.makeEmpty(),this}union(s){return this.min.min(s.min),this.max.max(s.max),this}translate(s){return this.min.add(s),this.max.add(s),this}equals(s){return s.min.equals(this.min)&&s.max.equals(this.max)}}const _startP=new Vector3,_startEnd=new Vector3;class Line3{constructor(s=new Vector3,a=new Vector3){this.start=s,this.end=a}set(s,a){return this.start.copy(s),this.end.copy(a),this}copy(s){return this.start.copy(s.start),this.end.copy(s.end),this}getCenter(s){return s.addVectors(this.start,this.end).multiplyScalar(.5)}delta(s){return s.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(s,a){return this.delta(a).multiplyScalar(s).add(this.start)}closestPointToPointParameter(s,a){_startP.subVectors(s,this.start),_startEnd.subVectors(this.end,this.start);const b=_startEnd.dot(_startEnd);let Kt=_startEnd.dot(_startP)/b;return a&&(Kt=clamp$2(Kt,0,1)),Kt}closestPointToPoint(s,a,b){const _e=this.closestPointToPointParameter(s,a);return this.delta(b).multiplyScalar(_e).add(this.start)}applyMatrix4(s){return this.start.applyMatrix4(s),this.end.applyMatrix4(s),this}equals(s){return s.start.equals(this.start)&&s.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const _vector$3=new Vector3;class SpotLightHelper extends Object3D{constructor(s,a){super(),this.light=s,this.matrixAutoUpdate=!1,this.color=a,this.type="SpotLightHelper";const b=new BufferGeometry,_e=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let an=0,_n=1,On=32;an<On;an++,_n++){const $n=an/On*Math.PI*2,dr=_n/On*Math.PI*2;_e.push(Math.cos($n),Math.sin($n),1,Math.cos(dr),Math.sin(dr),1)}b.setAttribute("position",new Float32BufferAttribute(_e,3));const Kt=new LineBasicMaterial({fog:!1,toneMapped:!1});this.cone=new LineSegments(b,Kt),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);const s=this.light.distance?this.light.distance:1e3,a=s*Math.tan(this.light.angle);this.cone.scale.set(a,a,s),_vector$3.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(_vector$3),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const _vector$2=new Vector3,_boneMatrix=new Matrix4,_matrixWorldInv=new Matrix4;class SkeletonHelper extends LineSegments{constructor(s){const a=getBoneList(s),b=new BufferGeometry,_e=[],Kt=[],an=new Color$1(0,0,1),_n=new Color$1(0,1,0);for(let $n=0;$n<a.length;$n++){const dr=a[$n];dr.parent&&dr.parent.isBone&&(_e.push(0,0,0),_e.push(0,0,0),Kt.push(an.r,an.g,an.b),Kt.push(_n.r,_n.g,_n.b))}b.setAttribute("position",new Float32BufferAttribute(_e,3)),b.setAttribute("color",new Float32BufferAttribute(Kt,3));const On=new LineBasicMaterial({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(b,On),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=s,this.bones=a,this.matrix=s.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(s){const a=this.bones,b=this.geometry,_e=b.getAttribute("position");_matrixWorldInv.copy(this.root.matrixWorld).invert();for(let Kt=0,an=0;Kt<a.length;Kt++){const _n=a[Kt];_n.parent&&_n.parent.isBone&&(_boneMatrix.multiplyMatrices(_matrixWorldInv,_n.matrixWorld),_vector$2.setFromMatrixPosition(_boneMatrix),_e.setXYZ(an,_vector$2.x,_vector$2.y,_vector$2.z),_boneMatrix.multiplyMatrices(_matrixWorldInv,_n.parent.matrixWorld),_vector$2.setFromMatrixPosition(_boneMatrix),_e.setXYZ(an+1,_vector$2.x,_vector$2.y,_vector$2.z),an+=2)}b.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(s)}dispose(){this.geometry.dispose(),this.material.dispose()}}function getBoneList(o){const s=[];o.isBone===!0&&s.push(o);for(let a=0;a<o.children.length;a++)s.push.apply(s,getBoneList(o.children[a]));return s}class PointLightHelper extends Mesh{constructor(s,a,b){const _e=new SphereGeometry(a,4,2),Kt=new MeshBasicMaterial({wireframe:!0,fog:!1,toneMapped:!1});super(_e,Kt),this.light=s,this.color=b,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const _vector$1=new Vector3,_color1=new Color$1,_color2=new Color$1;class HemisphereLightHelper extends Object3D{constructor(s,a,b){super(),this.light=s,this.matrix=s.matrixWorld,this.matrixAutoUpdate=!1,this.color=b,this.type="HemisphereLightHelper";const _e=new OctahedronGeometry(a);_e.rotateY(Math.PI*.5),this.material=new MeshBasicMaterial({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const Kt=_e.getAttribute("position"),an=new Float32Array(Kt.count*3);_e.setAttribute("color",new BufferAttribute(an,3)),this.add(new Mesh(_e,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const s=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const a=s.geometry.getAttribute("color");_color1.copy(this.light.color),_color2.copy(this.light.groundColor);for(let b=0,_e=a.count;b<_e;b++){const Kt=b<_e/2?_color1:_color2;a.setXYZ(b,Kt.r,Kt.g,Kt.b)}a.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),s.lookAt(_vector$1.setFromMatrixPosition(this.light.matrixWorld).negate())}}class GridHelper extends LineSegments{constructor(s=10,a=10,b=4473924,_e=8947848){b=new Color$1(b),_e=new Color$1(_e);const Kt=a/2,an=s/a,_n=s/2,On=[],$n=[];for(let pr=0,Ar=0,Or=-_n;pr<=a;pr++,Or+=an){On.push(-_n,0,Or,_n,0,Or),On.push(Or,0,-_n,Or,0,_n);const Xr=pr===Kt?b:_e;Xr.toArray($n,Ar),Ar+=3,Xr.toArray($n,Ar),Ar+=3,Xr.toArray($n,Ar),Ar+=3,Xr.toArray($n,Ar),Ar+=3}const dr=new BufferGeometry;dr.setAttribute("position",new Float32BufferAttribute(On,3)),dr.setAttribute("color",new Float32BufferAttribute($n,3));const fr=new LineBasicMaterial({vertexColors:!0,toneMapped:!1});super(dr,fr),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class PolarGridHelper extends LineSegments{constructor(s=10,a=16,b=8,_e=64,Kt=4473924,an=8947848){Kt=new Color$1(Kt),an=new Color$1(an);const _n=[],On=[];if(a>1)for(let fr=0;fr<a;fr++){const pr=fr/a*(Math.PI*2),Ar=Math.sin(pr)*s,Or=Math.cos(pr)*s;_n.push(0,0,0),_n.push(Ar,0,Or);const Xr=fr&1?Kt:an;On.push(Xr.r,Xr.g,Xr.b),On.push(Xr.r,Xr.g,Xr.b)}for(let fr=0;fr<b;fr++){const pr=fr&1?Kt:an,Ar=s-s/b*fr;for(let Or=0;Or<_e;Or++){let Xr=Or/_e*(Math.PI*2),ss=Math.sin(Xr)*Ar,kr=Math.cos(Xr)*Ar;_n.push(ss,0,kr),On.push(pr.r,pr.g,pr.b),Xr=(Or+1)/_e*(Math.PI*2),ss=Math.sin(Xr)*Ar,kr=Math.cos(Xr)*Ar,_n.push(ss,0,kr),On.push(pr.r,pr.g,pr.b)}}const $n=new BufferGeometry;$n.setAttribute("position",new Float32BufferAttribute(_n,3)),$n.setAttribute("color",new Float32BufferAttribute(On,3));const dr=new LineBasicMaterial({vertexColors:!0,toneMapped:!1});super($n,dr),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const _v1=new Vector3,_v2$5=new Vector3,_v3=new Vector3;class DirectionalLightHelper extends Object3D{constructor(s,a,b){super(),this.light=s,this.matrix=s.matrixWorld,this.matrixAutoUpdate=!1,this.color=b,this.type="DirectionalLightHelper",a===void 0&&(a=1);let _e=new BufferGeometry;_e.setAttribute("position",new Float32BufferAttribute([-a,a,0,a,a,0,a,-a,0,-a,-a,0,-a,a,0],3));const Kt=new LineBasicMaterial({fog:!1,toneMapped:!1});this.lightPlane=new Line(_e,Kt),this.add(this.lightPlane),_e=new BufferGeometry,_e.setAttribute("position",new Float32BufferAttribute([0,0,0,0,0,1],3)),this.targetLine=new Line(_e,Kt),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),_v1.setFromMatrixPosition(this.light.matrixWorld),_v2$5.setFromMatrixPosition(this.light.target.matrixWorld),_v3.subVectors(_v2$5,_v1),this.lightPlane.lookAt(_v2$5),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(_v2$5),this.targetLine.scale.z=_v3.length()}}const _vector=new Vector3,_camera=new Camera;class CameraHelper extends LineSegments{constructor(s){const a=new BufferGeometry,b=new LineBasicMaterial({color:16777215,vertexColors:!0,toneMapped:!1}),_e=[],Kt=[],an={};_n("n1","n2"),_n("n2","n4"),_n("n4","n3"),_n("n3","n1"),_n("f1","f2"),_n("f2","f4"),_n("f4","f3"),_n("f3","f1"),_n("n1","f1"),_n("n2","f2"),_n("n3","f3"),_n("n4","f4"),_n("p","n1"),_n("p","n2"),_n("p","n3"),_n("p","n4"),_n("u1","u2"),_n("u2","u3"),_n("u3","u1"),_n("c","t"),_n("p","c"),_n("cn1","cn2"),_n("cn3","cn4"),_n("cf1","cf2"),_n("cf3","cf4");function _n(Or,Xr){On(Or),On(Xr)}function On(Or){_e.push(0,0,0),Kt.push(0,0,0),an[Or]===void 0&&(an[Or]=[]),an[Or].push(_e.length/3-1)}a.setAttribute("position",new Float32BufferAttribute(_e,3)),a.setAttribute("color",new Float32BufferAttribute(Kt,3)),super(a,b),this.type="CameraHelper",this.camera=s,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=s.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=an,this.update();const $n=new Color$1(16755200),dr=new Color$1(16711680),fr=new Color$1(43775),pr=new Color$1(16777215),Ar=new Color$1(3355443);this.setColors($n,dr,fr,pr,Ar)}setColors(s,a,b,_e,Kt){const _n=this.geometry.getAttribute("color");_n.setXYZ(0,s.r,s.g,s.b),_n.setXYZ(1,s.r,s.g,s.b),_n.setXYZ(2,s.r,s.g,s.b),_n.setXYZ(3,s.r,s.g,s.b),_n.setXYZ(4,s.r,s.g,s.b),_n.setXYZ(5,s.r,s.g,s.b),_n.setXYZ(6,s.r,s.g,s.b),_n.setXYZ(7,s.r,s.g,s.b),_n.setXYZ(8,s.r,s.g,s.b),_n.setXYZ(9,s.r,s.g,s.b),_n.setXYZ(10,s.r,s.g,s.b),_n.setXYZ(11,s.r,s.g,s.b),_n.setXYZ(12,s.r,s.g,s.b),_n.setXYZ(13,s.r,s.g,s.b),_n.setXYZ(14,s.r,s.g,s.b),_n.setXYZ(15,s.r,s.g,s.b),_n.setXYZ(16,s.r,s.g,s.b),_n.setXYZ(17,s.r,s.g,s.b),_n.setXYZ(18,s.r,s.g,s.b),_n.setXYZ(19,s.r,s.g,s.b),_n.setXYZ(20,s.r,s.g,s.b),_n.setXYZ(21,s.r,s.g,s.b),_n.setXYZ(22,s.r,s.g,s.b),_n.setXYZ(23,s.r,s.g,s.b),_n.setXYZ(24,a.r,a.g,a.b),_n.setXYZ(25,a.r,a.g,a.b),_n.setXYZ(26,a.r,a.g,a.b),_n.setXYZ(27,a.r,a.g,a.b),_n.setXYZ(28,a.r,a.g,a.b),_n.setXYZ(29,a.r,a.g,a.b),_n.setXYZ(30,a.r,a.g,a.b),_n.setXYZ(31,a.r,a.g,a.b),_n.setXYZ(32,b.r,b.g,b.b),_n.setXYZ(33,b.r,b.g,b.b),_n.setXYZ(34,b.r,b.g,b.b),_n.setXYZ(35,b.r,b.g,b.b),_n.setXYZ(36,b.r,b.g,b.b),_n.setXYZ(37,b.r,b.g,b.b),_n.setXYZ(38,_e.r,_e.g,_e.b),_n.setXYZ(39,_e.r,_e.g,_e.b),_n.setXYZ(40,Kt.r,Kt.g,Kt.b),_n.setXYZ(41,Kt.r,Kt.g,Kt.b),_n.setXYZ(42,Kt.r,Kt.g,Kt.b),_n.setXYZ(43,Kt.r,Kt.g,Kt.b),_n.setXYZ(44,Kt.r,Kt.g,Kt.b),_n.setXYZ(45,Kt.r,Kt.g,Kt.b),_n.setXYZ(46,Kt.r,Kt.g,Kt.b),_n.setXYZ(47,Kt.r,Kt.g,Kt.b),_n.setXYZ(48,Kt.r,Kt.g,Kt.b),_n.setXYZ(49,Kt.r,Kt.g,Kt.b),_n.needsUpdate=!0}update(){const s=this.geometry,a=this.pointMap,b=1,_e=1;_camera.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),setPoint("c",a,s,_camera,0,0,-1),setPoint("t",a,s,_camera,0,0,1),setPoint("n1",a,s,_camera,-b,-_e,-1),setPoint("n2",a,s,_camera,b,-_e,-1),setPoint("n3",a,s,_camera,-b,_e,-1),setPoint("n4",a,s,_camera,b,_e,-1),setPoint("f1",a,s,_camera,-b,-_e,1),setPoint("f2",a,s,_camera,b,-_e,1),setPoint("f3",a,s,_camera,-b,_e,1),setPoint("f4",a,s,_camera,b,_e,1),setPoint("u1",a,s,_camera,b*.7,_e*1.1,-1),setPoint("u2",a,s,_camera,-b*.7,_e*1.1,-1),setPoint("u3",a,s,_camera,0,_e*2,-1),setPoint("cf1",a,s,_camera,-b,0,1),setPoint("cf2",a,s,_camera,b,0,1),setPoint("cf3",a,s,_camera,0,-_e,1),setPoint("cf4",a,s,_camera,0,_e,1),setPoint("cn1",a,s,_camera,-b,0,-1),setPoint("cn2",a,s,_camera,b,0,-1),setPoint("cn3",a,s,_camera,0,-_e,-1),setPoint("cn4",a,s,_camera,0,_e,-1),s.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function setPoint(o,s,a,b,_e,Kt,an){_vector.set(_e,Kt,an).unproject(b);const _n=s[o];if(_n!==void 0){const On=a.getAttribute("position");for(let $n=0,dr=_n.length;$n<dr;$n++)On.setXYZ(_n[$n],_vector.x,_vector.y,_vector.z)}}const _box=new Box3;class BoxHelper extends LineSegments{constructor(s,a=16776960){const b=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),_e=new Float32Array(8*3),Kt=new BufferGeometry;Kt.setIndex(new BufferAttribute(b,1)),Kt.setAttribute("position",new BufferAttribute(_e,3)),super(Kt,new LineBasicMaterial({color:a,toneMapped:!1})),this.object=s,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(s){if(s!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&_box.setFromObject(this.object),_box.isEmpty())return;const a=_box.min,b=_box.max,_e=this.geometry.attributes.position,Kt=_e.array;Kt[0]=b.x,Kt[1]=b.y,Kt[2]=b.z,Kt[3]=a.x,Kt[4]=b.y,Kt[5]=b.z,Kt[6]=a.x,Kt[7]=a.y,Kt[8]=b.z,Kt[9]=b.x,Kt[10]=a.y,Kt[11]=b.z,Kt[12]=b.x,Kt[13]=b.y,Kt[14]=a.z,Kt[15]=a.x,Kt[16]=b.y,Kt[17]=a.z,Kt[18]=a.x,Kt[19]=a.y,Kt[20]=a.z,Kt[21]=b.x,Kt[22]=a.y,Kt[23]=a.z,_e.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(s){return this.object=s,this.update(),this}copy(s,a){return super.copy(s,a),this.object=s.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Box3Helper extends LineSegments{constructor(s,a=16776960){const b=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),_e=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],Kt=new BufferGeometry;Kt.setIndex(new BufferAttribute(b,1)),Kt.setAttribute("position",new Float32BufferAttribute(_e,3)),super(Kt,new LineBasicMaterial({color:a,toneMapped:!1})),this.box=s,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(s){const a=this.box;a.isEmpty()||(a.getCenter(this.position),a.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(s))}dispose(){this.geometry.dispose(),this.material.dispose()}}class PlaneHelper extends Line{constructor(s,a=1,b=16776960){const _e=b,Kt=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],an=new BufferGeometry;an.setAttribute("position",new Float32BufferAttribute(Kt,3)),an.computeBoundingSphere(),super(an,new LineBasicMaterial({color:_e,toneMapped:!1})),this.type="PlaneHelper",this.plane=s,this.size=a;const _n=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],On=new BufferGeometry;On.setAttribute("position",new Float32BufferAttribute(_n,3)),On.computeBoundingSphere(),this.add(new Mesh(On,new MeshBasicMaterial({color:_e,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(s){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(s)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const _axis=new Vector3;let _lineGeometry,_coneGeometry;class ArrowHelper extends Object3D{constructor(s=new Vector3(0,0,1),a=new Vector3(0,0,0),b=1,_e=16776960,Kt=b*.2,an=Kt*.2){super(),this.type="ArrowHelper",_lineGeometry===void 0&&(_lineGeometry=new BufferGeometry,_lineGeometry.setAttribute("position",new Float32BufferAttribute([0,0,0,0,1,0],3)),_coneGeometry=new CylinderGeometry(0,.5,1,5,1),_coneGeometry.translate(0,-.5,0)),this.position.copy(a),this.line=new Line(_lineGeometry,new LineBasicMaterial({color:_e,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Mesh(_coneGeometry,new MeshBasicMaterial({color:_e,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(s),this.setLength(b,Kt,an)}setDirection(s){if(s.y>.99999)this.quaternion.set(0,0,0,1);else if(s.y<-.99999)this.quaternion.set(1,0,0,0);else{_axis.set(s.z,0,-s.x).normalize();const a=Math.acos(s.y);this.quaternion.setFromAxisAngle(_axis,a)}}setLength(s,a=s*.2,b=a*.2){this.line.scale.set(1,Math.max(1e-4,s-a),1),this.line.updateMatrix(),this.cone.scale.set(b,a,b),this.cone.position.y=s,this.cone.updateMatrix()}setColor(s){this.line.material.color.set(s),this.cone.material.color.set(s)}copy(s){return super.copy(s,!1),this.line.copy(s.line),this.cone.copy(s.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class AxesHelper extends LineSegments{constructor(s=1){const a=[0,0,0,s,0,0,0,0,0,0,s,0,0,0,0,0,0,s],b=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],_e=new BufferGeometry;_e.setAttribute("position",new Float32BufferAttribute(a,3)),_e.setAttribute("color",new Float32BufferAttribute(b,3));const Kt=new LineBasicMaterial({vertexColors:!0,toneMapped:!1});super(_e,Kt),this.type="AxesHelper"}setColors(s,a,b){const _e=new Color$1,Kt=this.geometry.attributes.color.array;return _e.set(s),_e.toArray(Kt,0),_e.toArray(Kt,3),_e.set(a),_e.toArray(Kt,6),_e.toArray(Kt,9),_e.set(b),_e.toArray(Kt,12),_e.toArray(Kt,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class ShapePath{constructor(){this.type="ShapePath",this.color=new Color$1,this.subPaths=[],this.currentPath=null}moveTo(s,a){return this.currentPath=new Path,this.subPaths.push(this.currentPath),this.currentPath.moveTo(s,a),this}lineTo(s,a){return this.currentPath.lineTo(s,a),this}quadraticCurveTo(s,a,b,_e){return this.currentPath.quadraticCurveTo(s,a,b,_e),this}bezierCurveTo(s,a,b,_e,Kt,an){return this.currentPath.bezierCurveTo(s,a,b,_e,Kt,an),this}splineThru(s){return this.currentPath.splineThru(s),this}toShapes(s){function a(kr){const us=[];for(let hs=0,ds=kr.length;hs<ds;hs++){const fs=kr[hs],Gs=new Shape;Gs.curves=fs.curves,us.push(Gs)}return us}function b(kr,us){const hs=us.length;let ds=!1;for(let fs=hs-1,Gs=0;Gs<hs;fs=Gs++){let ga=us[fs],So=us[Gs],go=So.x-ga.x,xo=So.y-ga.y;if(Math.abs(xo)>Number.EPSILON){if(xo<0&&(ga=us[Gs],go=-go,So=us[fs],xo=-xo),kr.y<ga.y||kr.y>So.y)continue;if(kr.y===ga.y){if(kr.x===ga.x)return!0}else{const Mo=xo*(kr.x-ga.x)-go*(kr.y-ga.y);if(Mo===0)return!0;if(Mo<0)continue;ds=!ds}}else{if(kr.y!==ga.y)continue;if(So.x<=kr.x&&kr.x<=ga.x||ga.x<=kr.x&&kr.x<=So.x)return!0}}return ds}const _e=ShapeUtils.isClockWise,Kt=this.subPaths;if(Kt.length===0)return[];let an,_n,On;const $n=[];if(Kt.length===1)return _n=Kt[0],On=new Shape,On.curves=_n.curves,$n.push(On),$n;let dr=!_e(Kt[0].getPoints());dr=s?!dr:dr;const fr=[],pr=[];let Ar=[],Or=0,Xr;pr[Or]=void 0,Ar[Or]=[];for(let kr=0,us=Kt.length;kr<us;kr++)_n=Kt[kr],Xr=_n.getPoints(),an=_e(Xr),an=s?!an:an,an?(!dr&&pr[Or]&&Or++,pr[Or]={s:new Shape,p:Xr},pr[Or].s.curves=_n.curves,dr&&Or++,Ar[Or]=[]):Ar[Or].push({h:_n,p:Xr[0]});if(!pr[0])return a(Kt);if(pr.length>1){let kr=!1,us=0;for(let hs=0,ds=pr.length;hs<ds;hs++)fr[hs]=[];for(let hs=0,ds=pr.length;hs<ds;hs++){const fs=Ar[hs];for(let Gs=0;Gs<fs.length;Gs++){const ga=fs[Gs];let So=!0;for(let go=0;go<pr.length;go++)b(ga.p,pr[go].p)&&(hs!==go&&us++,So?(So=!1,fr[go].push(ga)):kr=!0);So&&fr[hs].push(ga)}}us>0&&kr===!1&&(Ar=fr)}let ss;for(let kr=0,us=pr.length;kr<us;kr++){On=pr[kr].s,$n.push(On),ss=Ar[kr];for(let hs=0,ds=ss.length;hs<ds;hs++)On.holes.push(ss[hs].h)}return $n}}class WebGLMultipleRenderTargets extends WebGLRenderTarget{constructor(s=1,a=1,b=1,_e={}){console.warn('THREE.WebGLMultipleRenderTargets has been deprecated and will be removed in r172. Use THREE.WebGLRenderTarget and set the "count" parameter to enable MRT.'),super(s,a,{..._e,count:b}),this.isWebGLMultipleRenderTargets=!0}get texture(){return this.textures}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:REVISION}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=REVISION);const THREE$1=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping,AddEquation,AddOperation,AdditiveAnimationBlendMode,AdditiveBlending,AgXToneMapping,AlphaFormat,AlwaysCompare,AlwaysDepth,AlwaysStencilFunc,AmbientLight,AnimationAction,AnimationClip,AnimationLoader,AnimationMixer,AnimationObjectGroup,AnimationUtils,ArcCurve,ArrayCamera,ArrowHelper,AttachedBindMode,Audio,AudioAnalyser,AudioContext,AudioListener,AudioLoader,AxesHelper,BackSide,BasicDepthPacking,BasicShadowMap,BatchedMesh,Bone,BooleanKeyframeTrack,Box2,Box3,Box3Helper,BoxGeometry,BoxHelper,BufferAttribute,BufferGeometry,BufferGeometryLoader,ByteType,Cache,Camera,CameraHelper,CanvasTexture,CapsuleGeometry,CatmullRomCurve3,CineonToneMapping,CircleGeometry,ClampToEdgeWrapping,Clock,Color:Color$1,ColorKeyframeTrack,ColorManagement,CompressedArrayTexture,CompressedCubeTexture,CompressedTexture,CompressedTextureLoader,ConeGeometry,ConstantAlphaFactor,ConstantColorFactor,CubeCamera,CubeReflectionMapping,CubeRefractionMapping,CubeTexture,CubeTextureLoader,CubeUVReflectionMapping,CubicBezierCurve,CubicBezierCurve3,CubicInterpolant,CullFaceBack,CullFaceFront,CullFaceFrontBack,CullFaceNone,Curve,CurvePath,CustomBlending,CustomToneMapping,CylinderGeometry,Cylindrical,Data3DTexture,DataArrayTexture,DataTexture,DataTextureLoader,DataUtils,DecrementStencilOp,DecrementWrapStencilOp,DefaultLoadingManager,DepthFormat,DepthStencilFormat,DepthTexture,DetachedBindMode,DirectionalLight,DirectionalLightHelper,DiscreteInterpolant,DisplayP3ColorSpace,DodecahedronGeometry,DoubleSide,DstAlphaFactor,DstColorFactor,DynamicCopyUsage,DynamicDrawUsage,DynamicReadUsage,EdgesGeometry,EllipseCurve,EqualCompare,EqualDepth,EqualStencilFunc,EquirectangularReflectionMapping,EquirectangularRefractionMapping,Euler,EventDispatcher:EventDispatcher$2,ExtrudeGeometry,FileLoader,Float16BufferAttribute,Float32BufferAttribute,FloatType,Fog,FogExp2,FramebufferTexture,FrontSide,Frustum,GLBufferAttribute,GLSL1,GLSL3,GreaterCompare,GreaterDepth,GreaterEqualCompare,GreaterEqualDepth,GreaterEqualStencilFunc,GreaterStencilFunc,GridHelper,Group,HalfFloatType,HemisphereLight,HemisphereLightHelper,IcosahedronGeometry,ImageBitmapLoader,ImageLoader,ImageUtils,IncrementStencilOp,IncrementWrapStencilOp,InstancedBufferAttribute,InstancedBufferGeometry,InstancedInterleavedBuffer,InstancedMesh,Int16BufferAttribute,Int32BufferAttribute,Int8BufferAttribute,IntType,InterleavedBuffer,InterleavedBufferAttribute,Interpolant,InterpolateDiscrete,InterpolateLinear,InterpolateSmooth,InvertStencilOp,KeepStencilOp,KeyframeTrack,LOD,LatheGeometry,Layers,LessCompare,LessDepth,LessEqualCompare,LessEqualDepth,LessEqualStencilFunc,LessStencilFunc,Light,LightProbe,Line,Line3,LineBasicMaterial,LineCurve,LineCurve3,LineDashedMaterial,LineLoop,LineSegments,LinearDisplayP3ColorSpace,LinearFilter,LinearInterpolant,LinearMipMapLinearFilter,LinearMipMapNearestFilter,LinearMipmapLinearFilter,LinearMipmapNearestFilter,LinearSRGBColorSpace:LinearSRGBColorSpace$1,LinearToneMapping,LinearTransfer,Loader,LoaderUtils,LoadingManager,LoopOnce:LoopOnce$1,LoopPingPong,LoopRepeat:LoopRepeat$1,LuminanceAlphaFormat,LuminanceFormat,MOUSE,Material,MaterialLoader,MathUtils,Matrix3,Matrix4,MaxEquation,Mesh,MeshBasicMaterial,MeshDepthMaterial,MeshDistanceMaterial,MeshLambertMaterial,MeshMatcapMaterial,MeshNormalMaterial,MeshPhongMaterial,MeshPhysicalMaterial,MeshStandardMaterial,MeshToonMaterial,MinEquation,MirroredRepeatWrapping,MixOperation,MultiplyBlending,MultiplyOperation,NearestFilter,NearestMipMapLinearFilter,NearestMipMapNearestFilter,NearestMipmapLinearFilter,NearestMipmapNearestFilter,NeutralToneMapping,NeverCompare,NeverDepth,NeverStencilFunc,NoBlending,NoColorSpace,NoToneMapping,NormalAnimationBlendMode,NormalBlending,NotEqualCompare,NotEqualDepth,NotEqualStencilFunc,NumberKeyframeTrack,Object3D,ObjectLoader,ObjectSpaceNormalMap,OctahedronGeometry,OneFactor,OneMinusConstantAlphaFactor,OneMinusConstantColorFactor,OneMinusDstAlphaFactor,OneMinusDstColorFactor,OneMinusSrcAlphaFactor,OneMinusSrcColorFactor,OrthographicCamera,P3Primaries,PCFShadowMap,PCFSoftShadowMap,PMREMGenerator,Path,PerspectiveCamera,Plane,PlaneGeometry,PlaneHelper,PointLight,PointLightHelper,Points,PointsMaterial,PolarGridHelper,PolyhedronGeometry,PositionalAudio,PropertyBinding,PropertyMixer,QuadraticBezierCurve,QuadraticBezierCurve3,Quaternion,QuaternionKeyframeTrack,QuaternionLinearInterpolant,RED_GREEN_RGTC2_Format,RED_RGTC1_Format,REVISION,RGBADepthPacking,RGBAFormat,RGBAIntegerFormat,RGBA_ASTC_10x10_Format,RGBA_ASTC_10x5_Format,RGBA_ASTC_10x6_Format,RGBA_ASTC_10x8_Format,RGBA_ASTC_12x10_Format,RGBA_ASTC_12x12_Format,RGBA_ASTC_4x4_Format,RGBA_ASTC_5x4_Format,RGBA_ASTC_5x5_Format,RGBA_ASTC_6x5_Format,RGBA_ASTC_6x6_Format,RGBA_ASTC_8x5_Format,RGBA_ASTC_8x6_Format,RGBA_ASTC_8x8_Format,RGBA_BPTC_Format,RGBA_ETC2_EAC_Format,RGBA_PVRTC_2BPPV1_Format,RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format,RGBA_S3TC_DXT3_Format,RGBA_S3TC_DXT5_Format,RGBFormat,RGB_BPTC_SIGNED_Format,RGB_BPTC_UNSIGNED_Format,RGB_ETC1_Format,RGB_ETC2_Format,RGB_PVRTC_2BPPV1_Format,RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format,RGFormat,RGIntegerFormat,RawShaderMaterial,Ray,Raycaster,Rec709Primaries,RectAreaLight,RedFormat,RedIntegerFormat,ReinhardToneMapping,RenderTarget,RepeatWrapping,ReplaceStencilOp,ReverseSubtractEquation,RingGeometry,SIGNED_RED_GREEN_RGTC2_Format,SIGNED_RED_RGTC1_Format,SRGBColorSpace:SRGBColorSpace$1,SRGBTransfer,Scene,ShaderChunk,ShaderLib,ShaderMaterial,ShadowMaterial,Shape,ShapeGeometry,ShapePath,ShapeUtils,ShortType,Skeleton,SkeletonHelper,SkinnedMesh,Source,Sphere,SphereGeometry,Spherical,SphericalHarmonics3,SplineCurve,SpotLight,SpotLightHelper,Sprite,SpriteMaterial,SrcAlphaFactor,SrcAlphaSaturateFactor,SrcColorFactor,StaticCopyUsage,StaticDrawUsage,StaticReadUsage,StereoCamera,StreamCopyUsage,StreamDrawUsage,StreamReadUsage,StringKeyframeTrack,SubtractEquation,SubtractiveBlending,TOUCH,TangentSpaceNormalMap,TetrahedronGeometry,Texture,TextureLoader,TorusGeometry,TorusKnotGeometry,Triangle,TriangleFanDrawMode,TriangleStripDrawMode,TrianglesDrawMode,TubeGeometry,UVMapping,Uint16BufferAttribute,Uint32BufferAttribute,Uint8BufferAttribute,Uint8ClampedBufferAttribute,Uniform,UniformsGroup,UniformsLib,UniformsUtils,UnsignedByteType,UnsignedInt248Type,UnsignedInt5999Type,UnsignedIntType,UnsignedShort4444Type,UnsignedShort5551Type,UnsignedShortType,VSMShadowMap,Vector2,Vector3,Vector4,VectorKeyframeTrack,VideoTexture,WebGL3DRenderTarget,WebGLArrayRenderTarget,WebGLCoordinateSystem,WebGLCubeRenderTarget,WebGLMultipleRenderTargets,WebGLRenderTarget,WebGLRenderer,WebGLUtils,WebGPUCoordinateSystem,WireframeGeometry,WrapAroundEnding,ZeroCurvatureEnding,ZeroFactor,ZeroSlopeEnding,ZeroStencilOp,createCanvasElement},Symbol.toStringTag,{value:"Module"})),hotspotIdPrefix="rd",hotspotIdSeparator="_";function generateHotspotAbsoluteID(o,s){return`${hotspotIdPrefix}${hotspotIdSeparator}${o}${hotspotIdSeparator}${s}`}async function wait(o){return LOGGER.info({title:`Waiting for ${o}ms`}),new Promise((s,a)=>{setTimeout(()=>{s(!0)},o)})}function compareObjects(o,s){if(o===null||s===null)return!1;for(let a in o)if(o.hasOwnProperty(a)&&s.hasOwnProperty(a)&&o[a]!==s[a])return!1;return Object.keys(o).length===Object.keys(s).length}const saveStructureToCMS=(o,s,a)=>{try{const b={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({save_data:JSON.stringify(a)})};let _e=o+`/${s}/save/`;return SAVE_CONFIG_ENDPOINT!=null&&(_e=SAVE_CONFIG_ENDPOINT),fetch(_e,b)}catch(b){return LOGGER.error({title:b}),null}},capitalize$1=o=>o&&o[0].toUpperCase()+o.slice(1)||"",mobileCheck=function(){let o=!1;return function(s){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(s)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(s.substr(0,4)))&&(o=!0)}(navigator.userAgent||navigator.vendor||window.opera),o};function isIpadOS(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)}function tabletCheck(){const o=navigator.userAgent.toLowerCase(),s=/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/.test(o);return s||isIpadOS()}function touchDeviceCheck(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}async function validateAndGetJSONFromNexus(o,s,a,b=""){let _e={data:null,report:"",success:!1};try{let Kt="";a!=""?Kt=o+"/configurator/experience_id/"+a+"?version_id="+b:Kt=o+"/configurator/client_access_key/"+s+"?version_id="+b;const an=await fetch(Kt),_n=await an.text();let On=JSON.parse(_n);if(an.status!=200)throw On.message;_e.data=On,_e.success=!0,_e.report="Successfully fetched JSON data."}catch(Kt){_e.success=!1,_e.report=Kt}return _e}async function getJSONFromEndpoint(o){let s={data:null,report:"",success:!1};try{const b=await(await fetch(o)).text();s.data=JSON.parse(b),s.success=!0,s.report="Successfully fetched JSON data."}catch(a){s.report=a,s.success=!1}return s}const addVector=(o,s)=>new Vector3(o[0]+s[0],o[1]+s[1],o[2]+s[2]),Vec3ToArr=o=>[o.x,o.y,o.z],ArrToVec3=o=>new Vector3(o[0],o[1],o[2]),numberWithCommas=o=>o.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),findMeshAndCloneMatFromScene=(o,s,a=!0)=>{let b=[];const _e=o.coreSceneStore.getState().sceneSettings.outOfStock_EmissiveColor,Kt=o.coreSceneStore.getState().sceneSettings.outOfStock_EmissiveIntensity;return s.traverse(an=>{an.isMesh&&(an.material.userData.cloned?an.material.userData.inStock!==a&&(a?(an.material.emissive.set(new Color$1(255,255,255)),an.material.emissiveIntensity=0):(an.material.emissive.set(new Color$1(_e.r,_e.g,_e.b)),an.material.emissiveIntensity=Kt),an.material.userData.inStock=a):(an.material=an.material.clone(),an.material.userData.inStock=a,an.material.userData.cloned=!0,a?(an.material.emissive.set(new Color$1(255,255,255)),an.material.emissiveIntensity=0):(an.material.emissive.set(new Color$1(_e.r,_e.g,_e.b)),an.material.emissiveIntensity=Kt)),b.push(an))}),b},filterArrWithCondition=(o,s)=>{let a=0,b=[];for(let _e=0;_e<o.length;_e++){const Kt=o[_e];s(Kt)?o[a++]=Kt:b.push(o[_e])}return o.length=a,b},degToRad=o=>o*Math.PI/180,resolveAssetUrl=o=>{if(!o)return;if(new RegExp("^(?:[a-z+]+:)?//","i").test(o))return o;let b=o;return b=b.replaceAll("<@all-projects@>",ALL_PROJECTS_ASSET_DATA_ROOT_URL),b=b.replaceAll("<@generic-project@>",GENERIC_PROJECT_ASSET_DATA_ROOT_URL),b};function componentToHex(o){let s=o.toString(16);return s.length==1?"0"+s:s}function rgbToHex(o,s,a){return"#"+componentToHex(o)+componentToHex(s)+componentToHex(a)}function getUrlParameterByName(o,s=window.location.search){const a=new URLSearchParams(s);return Object.fromEntries(a.entries())[o]}function _dispose3(o){o.geometry&&o.geometry.dispose(),o.material&&(Array.isArray(o.material)?o.material.forEach(s=>s.dispose()):o.material.dispose()),o.texture&&o.texture.dispose()}function dispose3(o){o.traverse(s=>{_dispose3(s)}),_dispose3(o)}const findVariantForGUID=(o,s)=>{const a=o.attachmentStore.getState().attachmentSystem,_e=o.itemStore.getState().itemsSpawned[s];let Kt=a.currentStructure.getNodeByGUID(s);if(!Kt)return;let an="";if(Kt.overrideVariant)an=Kt.overrideVariant,o.coreSceneStore.getState().CORE_API.fireEvent(o.coreSceneStore.getState().CORE_API.EVENTS.SCENE.MaterialOverrides_Exists,!0);else{const _n=a.globalVariants;if(!_n||_n.Count<=0)return;let On=[];Object.keys(_n).map(($n,dr)=>{On.push(_n[$n])}),_e.itemData.looks?.map($n=>{On.includes($n)&&(an=$n)}),an||(an=_e.itemData.looks[0])}return an};function hasCommonElement(o,s){for(let a of o)if(s.includes(a))return!0;return!1}const InfoDrawer=({stores:o,open:s,dismissDrawer:a})=>{const b=o.uiSceneStore(_n=>_n.CORE_API),_e=o.uiSceneStore(_n=>_n.isScreenPortrait),Kt=reactExports.useRef(null),an=o.infoStore(_n=>_n.infoObject);return reactExports.useEffect(()=>{b.isMobile&&o.uiSceneStore.setState({dialogPopupOpen:s})},[s]),reactExports.useEffect(()=>{const{current:_n}=Kt;if(!_n)return;const On=()=>{a()};return _n.addEventListener("drawerClosed",On),()=>{_n.removeEventListener("drawerClosed",On)}},[Kt]),jsxRuntimeExports.jsx(BottomDrawer,{stores:o,ref:Kt,id:"bottomDrawer",open:`${s}`,"initial-screen-coverage":"0%",children:jsxRuntimeExports.jsx("div",{tabIndex:s&&_e?0:-1,"aria-hidden":!s||!_e,className:"infoDrawer epigraphDrawer",slot:"bottom-drawer-content",children:jsxRuntimeExports.jsxs("div",{className:"drawerContent",children:[jsxRuntimeExports.jsxs("a",{href:an?.productPageUrl,className:"categoryLink",role:"button","aria-label":"Link to Product",target:"_blank",style:an?.productPageUrl?{pointerEvents:"all"}:{pointerEvents:"none"},children:[jsxRuntimeExports.jsxs("h2",{className:"categoryTitle",children:[an?.productCategory?.label,an.subheading&&jsxRuntimeExports.jsx("div",{className:"modalSubHeading",children:an.subheading})]}),an.productPageUrl&&jsxRuntimeExports.jsx("img",{alt:"Open Product Page",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/OpenTab.svg",onError:_n=>{_n.target.src="https://placehold.co/150"}})]}),jsxRuntimeExports.jsx("div",{className:"infoDrawerImageContainer",children:jsxRuntimeExports.jsx("img",{className:"itemImage",alt:an?.title?"An image of "+an.title:"A placeholder image used in the Information Modal","aria-label":an?.title?"An image of "+an.title:"A placeholder image used in the Information Modal",src:an?.thumbnails?.high?b.getResolvedAssetUrl(an.thumbnails.high):"https://placehold.co/150",onError:_n=>{_n.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("h2",{className:"itemTitle",children:an.title}),jsxRuntimeExports.jsx("pre",{className:"itemDescription",children:an.description}),an.boundingBoxSize?jsxRuntimeExports.jsxs("p",{className:"infoModalDimensions",children:[an.boundingBoxSize.x.toFixed(1),"” W x"," ",an.boundingBoxSize.y.toFixed(1),"” D x"," ",an.boundingBoxSize.z.toFixed(1),"” H"]}):"",jsxRuntimeExports.jsx("div",{className:"infoModalActions",children:an.price&&jsxRuntimeExports.jsxs("button",{className:"item-price",disabled:!0,children:["$",numberWithCommas(parseFloat(an.price).toFixed(2))]})})]})})})},UtilityMenuButton=({stores:o,buttonAction:s,buttonLabel:a,hoverLabel:b,icon:_e,activeCondition:Kt})=>{const[an,_n]=reactExports.useState(Kt),On=o.uiSceneStore(fr=>fr.dialogPopupOpen),$n=o.uiSceneStore(fr=>fr.isScreenPortrait),dr=o.cartStore(fr=>fr.previewCartModalOpen);return reactExports.useEffect(()=>(_n(Kt),()=>{}),[Kt]),jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:!On&&($n&&!dr||!$n)?0:-1,"aria-hidden":On||$n&&dr,className:an!==void 0&&an?"shellButtonContainer active":"shellButtonContainer","aria-label":a,onClick:()=>{s()},children:[jsxRuntimeExports.jsxs("div",{className:"buttonContent",children:[jsxRuntimeExports.jsx("img",{className:"button",src:_e,alt:"An icon indicating "+a+" action.",onError:fr=>{fr.target.src="https://placehold.co/150"}}),jsxRuntimeExports.jsx("span",{children:a})]}),jsxRuntimeExports.jsx("div",{className:"hoverDescriptor",children:jsxRuntimeExports.jsx("span",{children:b})})]})},UtilityMenu=({stores:o,handleShareButtonTrigger:s,handleSaveButtonTrigger:a,handleRestartButtonClick:b,handleShowHotspots:_e,handleDimensionClick:Kt,handleInstructionButtonClick:an,utilityMenuVisible:_n,hotspotsVisibility:On,viewInYourSpaceMenuBtnVisible:$n,restartMenuBtnVisible:dr,saveMenuBtnVisible:fr,hotspotsMenuBtnVisible:pr,instructionsMenuBtnVisible:Ar,dimensionsMenuBtnVisible:Or,shareMenuBtnVisible:Xr,dimensionsVisible:ss,position:kr,CORE_API:us})=>{const[hs,ds]=reactExports.useState("bottom"),fs=o.productDataStore(So=>So.assetsData),Gs=o.coreSceneStore(So=>So.sceneSettings),ga={ar:"https://storage.googleapis.com/gsc-epigraph-design/product-assets/Icon/AR.svg",restart:"https://storage.googleapis.com/gsc-epigraph-design/product-assets/Icon/Restart.svg",save:"https://storage.googleapis.com/gsc-epigraph-design/product-assets/Icon/save.svg",share:"https://storage.googleapis.com/gsc-epigraph-design/product-assets/Icon/Share.svg",dimensions:"https://storage.googleapis.com/gsc-epigraph-design/product-assets/Icon/Ruler.svg",hotspots:"https://storage.googleapis.com/gsc-epigraph-design/product-assets/Icon/Eye.svg",instructions:"https://storage.googleapis.com/gsc-epigraph-design/product-assets/Icon/Info.svg"};return reactExports.useEffect(()=>{switch(kr){case"top":ds("top");break;case"bottom":ds("bottom");break;case"left":ds("left");break;case"right":ds("right");break}return()=>{}},[kr]),jsxRuntimeExports.jsx("div",{className:"shellCanvasContainerParent",id:hs,children:jsxRuntimeExports.jsxs("div",{className:(_n&&(Xr||$n||dr||Or||pr||Ar))==!0?"shellCanvasContainer":"shellCanvasContainer shellCanvasContainerInactive",children:[$n&&jsxRuntimeExports.jsx(UtilityMenuButton,{stores:o,buttonAction:()=>{us.viewInYourSpace()},buttonLabel:Gs.textSettings.arButtonLabel,hoverLabel:Gs.textSettings.arHoverLabel,icon:fs?.icons?.utilityMenu?.viewInYourSpace?us.getResolvedAssetUrl(fs?.icons?.utilityMenu?.viewInYourSpace):ga.ar}),dr&&jsxRuntimeExports.jsx(UtilityMenuButton,{stores:o,buttonAction:()=>{b()},buttonLabel:Gs.textSettings.restartButtonLabel,hoverLabel:Gs.textSettings.restartHoverLabel,icon:fs?.icons?.utilityMenu?.restart?us.getResolvedAssetUrl(fs?.icons?.utilityMenu?.restart):ga.restart}),fr&&jsxRuntimeExports.jsx(UtilityMenuButton,{stores:o,buttonAction:()=>{a()},buttonLabel:Gs.textSettings.saveButtonLabel,hoverLabel:Gs.textSettings.saveHoverLabel,icon:fs?.icons?.utilityMenu?.save?us.getResolvedAssetUrl(fs?.icons?.utilityMenu?.save):ga.save}),Xr&&jsxRuntimeExports.jsx(UtilityMenuButton,{stores:o,buttonAction:()=>{s()},buttonLabel:Gs.textSettings.shareButtonLabel,hoverLabel:Gs.textSettings.shareHoverLabel,icon:fs?.icons?.utilityMenu?.share?us.getResolvedAssetUrl(fs?.icons?.utilityMenu?.share):ga.share}),Or&&jsxRuntimeExports.jsx(UtilityMenuButton,{stores:o,buttonAction:()=>{Kt()},buttonLabel:Gs.textSettings.sizeButtonLabel,hoverLabel:Gs.textSettings.sizeHoverLabel,icon:fs?.icons?.utilityMenu?.dimensions?us.getResolvedAssetUrl(fs?.icons?.utilityMenu?.dimensions):ga.dimensions,activeCondition:ss}),pr&&jsxRuntimeExports.jsx(UtilityMenuButton,{stores:o,buttonAction:()=>{_e()},buttonLabel:Gs.textSettings.hotspotsButtonLabel,hoverLabel:Gs.textSettings.hotspotsHoverLabel,icon:fs?.icons?.utilityMenu?.hotspots?us.getResolvedAssetUrl(fs?.icons?.utilityMenu?.hotspots):ga.hotspots,activeCondition:On}),Ar&&jsxRuntimeExports.jsx(UtilityMenuButton,{stores:o,buttonAction:()=>{an()},buttonLabel:Gs.textSettings.instructionsButtonLabel,hoverLabel:Gs.textSettings.instructionsHoverLabel,icon:fs?.icons?.utilityMenu?.instructions?us.getResolvedAssetUrl(fs?.icons?.utilityMenu?.instructions):ga.instructions})]})})};function makeTypeChecker(o){return s=>!!s.type&&s.type.tabsRole===o}const isTab=makeTypeChecker("Tab"),isTabList=makeTypeChecker("TabList"),isTabPanel=makeTypeChecker("TabPanel");function isTabChild(o){return isTab(o)||isTabList(o)||isTabPanel(o)}function deepMap(o,s){return reactExports.Children.map(o,a=>a===null?null:isTabChild(a)?s(a):a.props&&a.props.children&&typeof a.props.children=="object"?reactExports.cloneElement(a,{...a.props,children:deepMap(a.props.children,s)}):a)}function deepForEach(o,s){return reactExports.Children.forEach(o,a=>{a!==null&&(isTab(a)||isTabPanel(a)?s(a):a.props&&a.props.children&&typeof a.props.children=="object"&&(isTabList(a)&&s(a),deepForEach(a.props.children,s)))})}function r$2(o){var s,a,b="";if(typeof o=="string"||typeof o=="number")b+=o;else if(typeof o=="object")if(Array.isArray(o)){var _e=o.length;for(s=0;s<_e;s++)o[s]&&(a=r$2(o[s]))&&(b&&(b+=" "),b+=a)}else for(a in o)o[a]&&(b&&(b+=" "),b+=a);return b}function clsx(){for(var o,s,a=0,b="",_e=arguments.length;a<_e;a++)(o=arguments[a])&&(s=r$2(o))&&(b&&(b+=" "),b+=s);return b}function getTabsCount(o){let s=0;return deepForEach(o,a=>{isTab(a)&&s++}),s}function isNode(o){return o&&"getAttribute"in o}function isTabNode(o){return isNode(o)&&o.getAttribute("data-rttab")}function isTabDisabled(o){return isNode(o)&&o.getAttribute("aria-disabled")==="true"}let canUseActiveElement;function determineCanUseActiveElement(o){const s=o||(typeof window<"u"?window:void 0);try{canUseActiveElement=!!(typeof s<"u"&&s.document&&s.document.activeElement)}catch{canUseActiveElement=!1}}const defaultProps$4={className:"react-tabs",focus:!1},UncontrolledTabs=o=>{let s=reactExports.useRef([]),a=reactExports.useRef([]);const b=reactExports.useRef();function _e(Al,xl){if(Al<0||Al>=$n())return;const{onSelect:ep,selectedIndex:_f}=o;ep(Al,_f,xl)}function Kt(Al){const xl=$n();for(let ep=Al+1;ep<xl;ep++)if(!isTabDisabled(dr(ep)))return ep;for(let ep=0;ep<Al;ep++)if(!isTabDisabled(dr(ep)))return ep;return Al}function an(Al){let xl=Al;for(;xl--;)if(!isTabDisabled(dr(xl)))return xl;for(xl=$n();xl-- >Al;)if(!isTabDisabled(dr(xl)))return xl;return Al}function _n(){const Al=$n();for(let xl=0;xl<Al;xl++)if(!isTabDisabled(dr(xl)))return xl;return null}function On(){let Al=$n();for(;Al--;)if(!isTabDisabled(dr(Al)))return Al;return null}function $n(){const{children:Al}=o;return getTabsCount(Al)}function dr(Al){return s.current[`tabs-${Al}`]}function fr(){let Al=0;const{children:xl,disabledTabClassName:ep,focus:_f,forceRenderTabPanel:np,selectedIndex:_l,selectedTabClassName:Ml,selectedTabPanelClassName:tp,environment:El}=o;a.current=a.current||[];let sp=a.current.length-$n();const My=reactExports.useId();for(;sp++<0;)a.current.push(`${My}${a.current.length}`);return deepMap(xl,Py=>{let Ny=Py;if(isTabList(Py)){let wy=0,Wy=!1;canUseActiveElement==null&&determineCanUseActiveElement(El);const DA=El||(typeof window<"u"?window:void 0);canUseActiveElement&&DA&&(Wy=React.Children.toArray(Py.props.children).filter(isTab).some((UA,jA)=>DA.document.activeElement===dr(jA))),Ny=reactExports.cloneElement(Py,{children:deepMap(Py.props.children,UA=>{const jA=`tabs-${wy}`,PA=_l===wy,mA={tabRef:FA=>{s.current[jA]=FA},id:a.current[wy],selected:PA,focus:PA&&(_f||Wy)};return Ml&&(mA.selectedClassName=Ml),ep&&(mA.disabledClassName=ep),wy++,reactExports.cloneElement(UA,mA)})})}else if(isTabPanel(Py)){const wy={id:a.current[Al],selected:_l===Al};np&&(wy.forceRender=np),tp&&(wy.selectedClassName=tp),Al++,Ny=reactExports.cloneElement(Py,wy)}return Ny})}function pr(Al){const{direction:xl,disableUpDownKeys:ep,disableLeftRightKeys:_f}=o;if(Or(Al.target)){let{selectedIndex:np}=o,_l=!1,Ml=!1;(Al.code==="Space"||Al.keyCode===32||Al.code==="Enter"||Al.keyCode===13)&&(_l=!0,Ml=!1,Ar(Al)),!_f&&(Al.keyCode===37||Al.code==="ArrowLeft")||!ep&&(Al.keyCode===38||Al.code==="ArrowUp")?(xl==="rtl"?np=Kt(np):np=an(np),_l=!0,Ml=!0):!_f&&(Al.keyCode===39||Al.code==="ArrowRight")||!ep&&(Al.keyCode===40||Al.code==="ArrowDown")?(xl==="rtl"?np=an(np):np=Kt(np),_l=!0,Ml=!0):Al.keyCode===35||Al.code==="End"?(np=On(),_l=!0,Ml=!0):(Al.keyCode===36||Al.code==="Home")&&(np=_n(),_l=!0,Ml=!0),_l&&Al.preventDefault(),Ml&&_e(np,Al)}}function Ar(Al){let xl=Al.target;do if(Or(xl)){if(isTabDisabled(xl))return;const ep=[].slice.call(xl.parentNode.children).filter(isTabNode).indexOf(xl);_e(ep,Al);return}while((xl=xl.parentNode)!=null)}function Or(Al){if(!isTabNode(Al))return!1;let xl=Al.parentElement;do{if(xl===b.current)return!0;if(xl.getAttribute("data-rttabs"))break;xl=xl.parentElement}while(xl);return!1}const{children:Xr,className:ss,disabledTabClassName:kr,domRef:us,focus:hs,forceRenderTabPanel:ds,onSelect:fs,selectedIndex:Gs,selectedTabClassName:ga,selectedTabPanelClassName:So,environment:go,disableUpDownKeys:xo,disableLeftRightKeys:Mo,...yl}={...defaultProps$4,...o};return React.createElement("div",Object.assign({},yl,{className:clsx(ss),onClick:Ar,onKeyDown:pr,ref:Al=>{b.current=Al,us&&us(Al)},"data-rttabs":!0}),fr())};UncontrolledTabs.propTypes={};const MODE_CONTROLLED=0,MODE_UNCONTROLLED=1,defaultProps$3={defaultFocus:!1,focusTabOnClick:!0,forceRenderTabPanel:!1,selectedIndex:null,defaultIndex:null,environment:null,disableUpDownKeys:!1,disableLeftRightKeys:!1},getModeFromProps=o=>o.selectedIndex===null?MODE_UNCONTROLLED:MODE_CONTROLLED,Tabs=o=>{const{children:s,defaultFocus:a,defaultIndex:b,focusTabOnClick:_e,onSelect:Kt,...an}={...defaultProps$3,...o},[_n,On]=reactExports.useState(a),[$n]=reactExports.useState(getModeFromProps(an)),[dr,fr]=reactExports.useState($n===MODE_UNCONTROLLED?b||0:null);if(reactExports.useEffect(()=>{On(!1)},[]),$n===MODE_UNCONTROLLED){const Or=getTabsCount(s);reactExports.useEffect(()=>{if(dr!=null){const Xr=Math.max(0,Or-1);fr(Math.min(dr,Xr))}},[Or])}const pr=(Or,Xr,ss)=>{typeof Kt=="function"&&Kt(Or,Xr,ss)===!1||(_e&&On(!0),$n===MODE_UNCONTROLLED&&fr(Or))};let Ar={...o,...an};return Ar.focus=_n,Ar.onSelect=pr,dr!=null&&(Ar.selectedIndex=dr),delete Ar.defaultFocus,delete Ar.defaultIndex,delete Ar.focusTabOnClick,React.createElement(UncontrolledTabs,Ar,s)};Tabs.propTypes={};Tabs.tabsRole="Tabs";const defaultProps$2={className:"react-tabs__tab-list"},TabList=o=>{const{children:s,className:a,...b}={...defaultProps$2,...o};return React.createElement("ul",Object.assign({},b,{className:clsx(a),role:"tablist"}),s)};TabList.tabsRole="TabList";TabList.propTypes={};const DEFAULT_CLASS$1="react-tabs__tab",defaultProps$1={className:DEFAULT_CLASS$1,disabledClassName:`${DEFAULT_CLASS$1}--disabled`,focus:!1,id:null,selected:!1,selectedClassName:`${DEFAULT_CLASS$1}--selected`},Tab$1=o=>{let s=reactExports.useRef();const{children:a,className:b,disabled:_e,disabledClassName:Kt,focus:an,id:_n,selected:On,selectedClassName:$n,tabIndex:dr,tabRef:fr,...pr}={...defaultProps$1,...o};return reactExports.useEffect(()=>{On&&an&&s.current.focus()},[On,an]),React.createElement("li",Object.assign({},pr,{className:clsx(b,{[$n]:On,[Kt]:_e}),ref:Ar=>{s.current=Ar,fr&&fr(Ar)},role:"tab",id:`tab${_n}`,"aria-selected":On?"true":"false","aria-disabled":_e?"true":"false","aria-controls":`panel${_n}`,tabIndex:dr||(On?"0":null),"data-rttab":!0}),a)};Tab$1.propTypes={};Tab$1.tabsRole="Tab";const DEFAULT_CLASS="react-tabs__tab-panel",defaultProps={className:DEFAULT_CLASS,forceRender:!1,selectedClassName:`${DEFAULT_CLASS}--selected`},TabPanel=o=>{const{children:s,className:a,forceRender:b,id:_e,selected:Kt,selectedClassName:an,..._n}={...defaultProps,...o};return React.createElement("div",Object.assign({},_n,{className:clsx(a,{[an]:Kt}),role:"tabpanel",id:`panel${_e}`,"aria-labelledby":`tab${_e}`}),b||Kt?s:null)};TabPanel.tabsRole="TabPanel";TabPanel.propTypes={};const ItemCard=({stores:o,sideMenuOpen:s,spawnGhosts:a,accordionActive:b=!0,spawnItem:_e,removeAllGhosts:Kt,isMouseUsed:an,skuId:_n,active:On})=>{const $n=o.uiSceneStore(YA=>YA.CORE_API),dr=o.infoStore(YA=>YA.infoModalOpen),fr=reactExports.useRef(null),pr=o.infoStore(YA=>YA.populateInfoObject),Ar=o.uiSceneStore(YA=>YA.dialogPopupOpen),Or=o.cartStore(YA=>YA.previewCartModalOpen),Xr=o.infoStore(YA=>YA.updateInfoModalOpen),[ss,kr]=reactExports.useState("default"),[us,hs]=reactExports.useState(!0),ds=o.colorStore(YA=>YA.allActiveVariants),fs=o.productDataStore(YA=>YA.productData),Gs=o.itemStore(YA=>YA.fittingSkuIds),[ga,So]=reactExports.useState(fs[_n].incrementDecrementControl?fs[_n].incrementDecrementControl:!1),[go,xo]=reactExports.useState(fs[_n]?fs[_n]:{}),[Mo,yl]=reactExports.useState(fs[_n].name?fs[_n].name:"Not Set"),[Al,xl]=reactExports.useState(fs[_n].subheading?fs[_n].subheading:""),[ep,_f]=reactExports.useState(fs[_n].lookDetails.default.thumbnails.low?fs[_n].lookDetails.default.thumbnails.low:""),[np,_l]=reactExports.useState(fs[_n].draggableUI!=null?fs[_n].draggableUI:o.uiSceneStore.getState().CORE_API.sceneSettings.draggableUI),[Ml,tp]=reactExports.useState(null),[El,sp]=reactExports.useState(!1),[My,Py]=reactExports.useState(!1),[Ny,wy]=reactExports.useState(0),Wy=reactExports.useCallback(()=>{Ny<=0||$n.removeLastItemBySkuId(_n)},[Ny]),DA=()=>{let YA=0;const pA=o.itemStore.getState().itemsSpawned,Ry=Object.keys(pA);for(let LA=Ry.length-1;LA>=0;LA--){const $A=Ry[LA];pA[$A].itemData.skuID===_n&&YA++}wy(YA)};reactExports.useEffect(()=>{DA()},[]),addCoreEventListener(o,$n.EVENTS.SCENE.Items_Updated,DA),reactExports.useEffect(()=>{Gs.includes(_n)?sp(!0):sp(!1)},[Gs]),reactExports.useEffect(()=>{Object.keys(fs).length!=0},[fs]),reactExports.useEffect(()=>{go.looks.length<=1&&hs(!1)},[go]);const UA=reactExports.useCallback(()=>{const YA=go.looks;let pA="default";for(const[Ry,LA]of Object.entries(ds))if(YA.includes(LA)){pA=LA;break}kr(pA)},[go,ds]);reactExports.useEffect(()=>{_f(go.lookDetails[ss].thumbnails.low)},[go,ss]),reactExports.useEffect(()=>{us===!0&&UA()},[ds]);const jA=reactExports.useCallback(YA=>{if(YA.stopPropagation(),!(!o.uiSceneStore.getState().CORE_API.sceneSettings.clickToAddUi&&!ga)){if(El===!1||Ml){$n.alert({alertMsg:"Unable to add item to the scene.",alertTime:4e3,alertType:"warn",alertLabel:"Action Unavailable"});return}_e(_n,!0)}},[El,Ml]),PA=reactExports.useCallback(async()=>{const YA=$n.sceneSettings?.showDependencyOnHover;if(YA===void 0||YA===!1)return;let pA=$n.getSpawningRequirementForSkuID(_n);if(pA.length<=0)return;let Ry="";const LA=await $n.getCartItemsAsync();let $A=!1;if(LA.cartItems.map(KA=>{pA.includes(KA.skuID)&&($A=!0)}),pA.includes("Root")&&pA.length==1&&($A=!0,pA=[]),$A)Ry="No space available to spawn the item.";else{Ry=`This item requires a dependency to be added to the scene first.
|
|
8814
8814
|
|
|
8815
8815
|
Dependency:
|
|
8816
8816
|
`;for(const KA of pA)Ry+=`- ${KA}
|
|
8817
8817
|
`}for(const KA of pA)Ry+=`- ${KA}
|
|
8818
|
-
`;tp(Ry)},[Ml]),mA=reactExports.useCallback(()=>{$n.isMobile!==!0&&My!==!0&&(Py(!0),!(!o.uiSceneStore.getState().CORE_API.sceneSettings.clickToAddUi&&!ga)&&(El===!0?(tp(null),a(_n)):PA()))},[El,My,Ml]),FA=reactExports.useCallback(()=>{$n.isMobile===!0||(Py(!1),!o.uiSceneStore.getState().CORE_API.sceneSettings.clickToAddUi&&!ga)||o.coreSceneStore.getState().mouseDragging||El===!0&&Kt&&Kt()},[El,My]),GA=reactExports.useCallback(YA=>{El!==!1&&(YA.defaultPrevented===!0&&YA.preventDefault(),YA.stopPropagation(),o.coreSceneStore.setState({pointerDownPos:YA.touches&&YA.touches.length>0?YA.touches[0].clientX-o.wcRef.offsetLeft:YA.clientX,mouseDragging:!1,mouseDownImgSrc:$n.getResolvedAssetUrl(ep),mouseDownSkuID:_n,moveThreshold:10}))},[El,ep,np]),aE=reactExports.useCallback(YA=>{const pA=go.lookDetails[ss];pA.skuID=_n,pA.productCategory={id:go.categoryID,label:go.categoryLabel},$n.isMobile===!0?(pr(pA),Xr(!0)):(YA.stopPropagation(),El&&Kt&&Kt(),pr(pA),Xr(!0))},[El,ss,go]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("nav",{role:"none",className:On?"imageContainer active":"imageContainer",draggable:!1,children:[ga?jsxRuntimeExports.jsxs("div",{className:"incrementContentContainer",children:[jsxRuntimeExports.jsx("div",{id:"itemCard"+_n,className:"incrementContentOverlay ".concat(`${(El===!0||Ny>0)&&My===!0?"enabled-item-overlay":"disabled-item-overlay"}`),ref:fr}),jsxRuntimeExports.jsx("img",{alt:Mo,className:"incrementSkuIcon",tabIndex:-1,"aria-hidden":!0,src:$n.getResolvedAssetUrl(ep),onError:YA=>{YA.target.src="https://placehold.co/150"}}),jsxRuntimeExports.jsxs("div",{className:"incrementDecrementPanel",children:[jsxRuntimeExports.jsx("div",{role:"button","aria-label":"Decrement Button","aria-hidden":!s||Ny==0||Ar||dr||Or||!b||!El,tabIndex:s&&Ny!==0&&!Ar&&!dr&&!Or&&b==!0&&El?0:-1,className:"incrementMinusSign ".concat(`${Ny===0?"incrementSignDisable":""}`),onClick:Wy,onMouseEnter:YA=>Py(!0),onMouseLeave:YA=>Py(!1),children:jsxRuntimeExports.jsx("img",{alt:"Decrement",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Minus.svg",onError:YA=>{YA.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("div",{className:"incrementCount",children:Ny}),jsxRuntimeExports.jsx("div",{role:"button","aria-label":"Increment","aria-hidden":!s||Ar||dr||Or||!b||!El,tabIndex:s&&!Ar&&!dr&&!Or&&b==!0&&El?0:-1,className:"incrementPlusSign ".concat(`${El===!0?"":"incrementSignDisable"}`),onClick:jA,onMouseEnter:mA,onMouseLeave:FA,children:jsxRuntimeExports.jsx("img",{alt:"Increment",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Plus.svg",onError:YA=>{YA.target.src="https://placehold.co/150"}})})]}),jsxRuntimeExports.jsx("div",{className:"spawning-requirements-container",hidden:!(El===!1&&My===!0&&Ml),children:jsxRuntimeExports.jsx("p",{className:"spawning-requirements-text",children:Ml})})]}):jsxRuntimeExports.jsxs("div",{className:"contentContainer",role:"button","aria-label":"Add Button",tabIndex:s&&!Ar&&!dr&&!Or&&b==!0&&El?0:-1,"aria-hidden":!s||Ar||dr||Or||!b||!El,style:{pointerEvents:El?"all":"none"},onFocus:YA=>{an||mA(YA)},onBlur:YA=>{an||FA(YA)},onClick:jA,children:[jsxRuntimeExports.jsx("div",{id:"itemCard"+_n,className:"contentOverlay ".concat(`${El===!0&&My===!0?"enabled-item-overlay":"disabled-item-overlay"}`),ref:fr,onTouchStart:GA,onMouseEnter:mA,onMouseLeave:FA,onMouseDown:YA=>{np!==!1&&GA(YA)},children:jsxRuntimeExports.jsx("img",{alt:"Add "+Mo,draggable:!1,className:"addIcon",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Plus.svg",onError:YA=>{YA.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("img",{className:"product-image product-image-default-state ".concat(`${El===!1?"product-image-disabled":""}`),draggable:!1,alt:Mo,src:$n.getResolvedAssetUrl(ep),onError:YA=>{YA.target.src="https://placehold.co/150"}}),jsxRuntimeExports.jsx("div",{className:"spawning-requirements-container",hidden:!(El===!1&&My===!0&&Ml),children:jsxRuntimeExports.jsx("p",{className:"spawning-requirements-text",children:Ml})})]}),jsxRuntimeExports.jsxs("div",{role:"button","aria-label":"Info Button","aria-hidden":!s||Ar||dr||Or||!b,tabIndex:s&&!Ar&&!dr&&!Or&&b==!0?0:-1,className:$n.isMobile?"showAlways itemDetails":"itemDetails",onClick:aE,children:[jsxRuntimeExports.jsx("div",{className:"item-details-icon"}),jsxRuntimeExports.jsxs("div",{className:"item-card-text-parent",children:[Mo&&jsxRuntimeExports.jsx("p",{className:"skuName truncate",children:Mo}),Al&&jsxRuntimeExports.jsx("p",{className:"skuSubheading",children:Al})]})]})]})})},PreconfigCard=({stores:o,sideMenuOpen:s,onClick:a,configId:b,name:_e,thumbnailURL:Kt,accordionActive:an})=>{const _n=o.uiSceneStore(Or=>Or.CORE_API),On=o.infoStore(Or=>Or.infoModalOpen),$n=o.uiSceneStore(Or=>Or.dialogPopupOpen),dr=o.cartStore(Or=>Or.previewCartModalOpen),[fr,pr]=reactExports.useState(!1),Ar=reactExports.useCallback(Or=>{Or.stopPropagation(),a(b)},[]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"imageContainer",draggable:!1,children:[jsxRuntimeExports.jsxs("div",{className:Kt?"contentContainer preconfig":"contentContainer preconfig contentDisabled",children:[jsxRuntimeExports.jsx("div",{role:"button","aria-label":"Load Preconfiguration Button","aria-hidden":!s||$n||On||dr||!an,tabIndex:s&&!$n&&!On&&!dr&&an==!0?0:-1,id:"itemCard"+b,className:"contentOverlay ".concat(`${fr===!0?"enabled-item-overlay":"disabled-item-overlay"}`),onClick:Or=>Ar(Or),onFocus:()=>pr(!0),onBlur:()=>pr(!1),onMouseEnter:()=>pr(!0),onMouseLeave:()=>pr(!1),children:jsxRuntimeExports.jsx("img",{alt:"Add "+_e,draggable:!1,className:"addIcon",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Plus.svg"})}),jsxRuntimeExports.jsx("img",{className:"product-image product-image-default-state",draggable:!1,alt:_e,src:Kt,tabIndex:-1,"aria-hidden":!0})]}),jsxRuntimeExports.jsx("div",{className:_n.isMobile?"showAlways itemDetails":"itemDetails",children:jsxRuntimeExports.jsx("p",{className:"truncate",children:_e})})]})})};function BuildTabItemRow({stores:o,sideMenuOpen:s,element:a,index:b,visible:_e,elementsLength:Kt,spawnGhosts:an,spawnItem:_n,removeAllGhosts:On,infoModalOpen:$n,isMouseUsed:dr,setItemAllowed:fr,activeItems:pr}){const Ar=o.coreSceneStore(fs=>fs.sceneSettings),Or=reactExports.useRef(null),Xr=reactExports.useRef(null),ss=o.uiSceneStore(fs=>fs.dialogPopupOpen),kr=o.cartStore(fs=>fs.previewCartModalOpen),[us,hs]=reactExports.useState(!1),ds=reactExports.useCallback(()=>{if(!(!Xr.current||!Or.current)){if(Xr.current.style.maxHeight)Xr.current.style.maxHeight=null;else{if(a.skus.length>0&&Xr.current.scrollHeight<100)return;Xr.current.style.maxHeight=Xr.current.scrollHeight+"px"}Or.current.classList.toggle("buildUiAccordionActive"),Xr.current.classList.toggle("buildUiContentAccordionActive"),hs(!us)}},[Or,Xr,us]);return reactExports.useEffect(()=>{!Xr.current||!Or.current||b==0&&ds()},[Or,Xr]),jsxRuntimeExports.jsxs("div",{className:"subContainer topContainer",children:[Ar.accordionInBuildUi?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{role:"button","aria-label":"Toggle Accordion Button",onClick:ds,"aria-hidden":!s||ss||$n||kr||!_e,tabIndex:s&&!ss&&!$n&&!kr&&_e?0:-1,ref:Or,className:"buildUiAccordion",children:[jsxRuntimeExports.jsx("div",{className:"arrowUp",children:jsxRuntimeExports.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{x:"0.75",y:"0.6875",width:"28.7343",height:"28.7343",rx:"14.3672",stroke:"#CCCCCC",strokeWidth:"0.5"}),jsxRuntimeExports.jsx("path",{d:"M20.5029 12.8984L15.1172 18.2842L9.73145 12.8984",stroke:"#222222",strokeLinecap:"round",strokeLinejoin:"round"})]})}),jsxRuntimeExports.jsx("div",{className:"arrowDown",children:jsxRuntimeExports.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{x:"0.881836",y:"0.957031",width:"28.7343",height:"28.7343",rx:"14.3672",stroke:"#CCCCCC",strokeWidth:"0.5"}),jsxRuntimeExports.jsx("path",{d:"M9.86328 17.4795L15.249 12.0938L20.6347 17.4795",stroke:"#222222",strokeLinecap:"round",strokeLinejoin:"round"})]})}),jsxRuntimeExports.jsx("h4",{children:a.label})]}),jsxRuntimeExports.jsx("div",{ref:Xr,className:"sidemenuContent buildUiAccordionContent",children:jsxRuntimeExports.jsx("div",{className:"item-grid",children:a.skus.map(fs=>jsxRuntimeExports.jsx(ItemCard,{stores:o,skuId:fs,sideMenuOpen:s,accordionActive:_e&&us,categoryID:a.categoryID,spawnGhosts:an,spawnItem:_n,removeAllGhosts:On,modalOpen:$n,isMouseUsed:dr,categoryDataIndex:b,setItemAllowed:fr,active:pr.includes(fs)},"itemCardB"+fs))})})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h4",{className:"subheading",children:a.label}),jsxRuntimeExports.jsx("div",{className:"sidemenuContent",children:jsxRuntimeExports.jsx("div",{className:"item-grid",children:a.skus.map(fs=>jsxRuntimeExports.jsx(ItemCard,{stores:o,skuId:fs,sideMenuOpen:s,categoryID:a.categoryID,accordionActive:_e,spawnGhosts:an,spawnItem:_n,removeAllGhosts:On,isMouseUsed:dr,modalOpen:$n,categoryDataIndex:b,setItemAllowed:fr,active:pr.includes(fs)},"itemCardB"+fs))})})]}),b!==Kt-1?jsxRuntimeExports.jsx("div",{className:"itemGridDivider"}):""]})}function BuildTabItemRow_PreConfig({stores:o,sideMenuOpen:s,index:a,elementsLength:b,visible:_e,configsData:Kt,infoModalOpen:an,isMouseUsed:_n,onClick:On,label:$n}){const dr=o.coreSceneStore(hs=>hs.sceneSettings),fr=reactExports.useRef(null),pr=reactExports.useRef(null),Ar=o.uiSceneStore(hs=>hs.dialogPopupOpen),Or=o.cartStore(hs=>hs.previewCartModalOpen),Xr=o.uiSceneStore(hs=>hs.CORE_API),[ss,kr]=reactExports.useState(!1),us=reactExports.useCallback(()=>{!pr.current||!fr.current||(fr.current.classList.toggle("buildUiAccordionActive"),pr.current.classList.toggle("buildUiContentAccordionActive"),kr(!ss),pr.current.style.maxHeight?pr.current.style.maxHeight=null:pr.current.style.maxHeight=pr.current.scrollHeight+"px")},[fr,pr,ss]);return jsxRuntimeExports.jsxs("div",{className:"subContainer topContainer",children:[dr.accordionInBuildUi?jsxRuntimeExports.jsxs("nav",{children:[jsxRuntimeExports.jsxs("div",{role:"button","aria-label":"Toggle Accordion Button","aria-hidden":!s||Ar||an||Or||!_e,onClick:us,tabIndex:s&&!Ar&&!an&&!Or&&_e?0:-1,ref:fr,className:"buildUiAccordion",children:[jsxRuntimeExports.jsx("div",{className:"arrowUp",children:jsxRuntimeExports.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{x:"0.75",y:"0.6875",width:"28.7343",height:"28.7343",rx:"14.3672",stroke:"#CCCCCC",strokeWidth:"0.5"}),jsxRuntimeExports.jsx("path",{d:"M20.5029 12.8984L15.1172 18.2842L9.73145 12.8984",stroke:"#222222",strokeLinecap:"round",strokeLinejoin:"round"})]})}),jsxRuntimeExports.jsx("div",{className:"arrowDown",children:jsxRuntimeExports.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{x:"0.881836",y:"0.957031",width:"28.7343",height:"28.7343",rx:"14.3672",stroke:"#CCCCCC",strokeWidth:"0.5"}),jsxRuntimeExports.jsx("path",{d:"M9.86328 17.4795L15.249 12.0938L20.6347 17.4795",stroke:"#222222",strokeLinecap:"round",strokeLinejoin:"round"})]})}),jsxRuntimeExports.jsx("h4",{children:$n})]}),jsxRuntimeExports.jsx("div",{ref:pr,className:"sidemenuContent buildUiAccordionContent",children:jsxRuntimeExports.jsx("div",{className:"item-grid",children:Kt.map(hs=>jsxRuntimeExports.jsx(PreconfigCard,{stores:o,onClick:On,sideMenuOpen:s,accordionActive:_e&&ss,configId:hs.epgsharedconfigid,name:hs.name,thumbnailURL:Xr.getResolvedAssetUrl(hs.thumbnails.low)},"itemCardB"+hs.epgsharedconfigid))})})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h4",{className:"subheading",children:$n}),jsxRuntimeExports.jsx("div",{className:"sidemenuContent",children:jsxRuntimeExports.jsx("div",{className:"item-grid",children:Kt.map(hs=>jsxRuntimeExports.jsx(PreconfigCard,{stores:o,sideMenuOpen:s,onClick:On,accordionActive:_e,configId:hs.epgsharedconfigid,name:hs.name,thumbnailURL:Xr.getResolvedAssetUrl(hs.thumbnails.low)},"itemCardB"+hs.epgsharedconfigid))})})]}),a!==b-1?jsxRuntimeExports.jsx("div",{className:"itemGridDivider"}):""]})}function SecondMobileTabsHandler({stores:o,sideMenuOpen:s,index:a,label:b,activeTab:_e,tabsRef:Kt,mobileGrid:an}){const _n=reactExports.useCallback(On=>{if(an.current.scrollLeft===On)return;let $n,dr,fr,pr=!1;function Ar(Or){$n===void 0&&($n=Or);const Xr=Or-$n;if(dr!==Or){const ss=Xr/200;an.current.scrollLeft>On?(fr=(an.current.scrollLeft-On)*Math.min(ss,1),an.current.scrollLeft-=fr,an.current.scrollLeft===On&&(pr=!0)):an.current.scrollLeft<On&&(fr=(On-an.current.scrollLeft)*Math.min(ss,1),an.current.scrollLeft+=fr,an.current.scrollLeft===On&&(pr=!0))}Xr<200&&(dr=Or,!pr&&window.requestAnimationFrame(Ar))}window.requestAnimationFrame(Ar)},[]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("a",{className:_e===a?"mobileTab scrolled":"mobileTab",onClick:()=>_n(Kt.current[a].offsetLeft-15),role:"button",tabIndex:s?0:-1,"aria-hidden":!s,"aria-label":b+" Button",children:b})})}function MobileGrid({stores:o,sideMenuOpen:s,element:a,index:b,elementsLength:_e,spawnGhosts:Kt,spawnItem:an,removeAllGhosts:_n,infoModalOpen:On,setItemAllowed:$n,activeItems:dr,tabsRef:fr}){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("section",{id:`section-${a.categoryID}`,className:"mobileGridSection",ref:pr=>fr.current[b]=pr,children:a.skus.map(pr=>jsxRuntimeExports.jsx(ItemCard,{stores:o,skuId:pr,sideMenuOpen:s,categoryID:a.categoryID,spawnGhosts:Kt,spawnItem:an,removeAllGhosts:_n,modalOpen:On,setItemAllowed:$n,active:dr.includes(pr)},"itemCardB"+pr))},"mobileGridSection"+b),b!==_e-1?jsxRuntimeExports.jsx("div",{className:"itemGridDivider"}):""]})}function MobileGrid_PreConfig({stores:o,sideMenuOpen:s,index:a,elementsLength:b,tabsRef:_e,configsData:Kt,onClick:an}){const _n=o.uiSceneStore(On=>On.CORE_API);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("section",{id:"section-preconfig",className:"mobileGridSection",ref:On=>_e.current[a]=On,children:[Kt.map(On=>jsxRuntimeExports.jsx(PreconfigCard,{stores:o,sideMenuOpen:s,onClick:an,configId:On.epgsharedconfigid,name:On.name,thumbnailURL:_n.getResolvedAssetUrl(On.thumbnails.low)},"itemCardB"+On.epgsharedconfigid)),[...Array(5)].map((On,$n)=>$n<5-Kt.length?jsxRuntimeExports.jsx(PreconfigCard,{stores:o,sideMenuOpen:s,onClick:()=>{}},"emptyCard"+$n):null)]},"mobileGridSection"+a),a!==b-1?jsxRuntimeExports.jsx("div",{className:"itemGridDivider"}):""]})}const BuildUI=({stores:o,sideMenuOpen:s,visible:a,identifier:b})=>{const _e=o.productDataStore(_f=>_f.categoryData),[Kt,an]=reactExports.useState([]),[_n,On]=reactExports.useState(void 0),$n=o.uiSceneStore(_f=>_f.isScreenPortrait),dr=o.infoStore(_f=>_f.infoModalOpen),[fr,pr]=reactExports.useState(0),[Ar,Or]=reactExports.useState(!1),[Xr,ss]=reactExports.useState([]),kr=o.infoStore(_f=>_f.populateInfoObject),us=o.infoStore(_f=>_f.updateInfoModalOpen),hs=o.uiSceneStore(_f=>_f.CORE_API),ds=o.itemStore(_f=>_f.itemsSpawned),fs=o.itemStore(_f=>_f.defaultSceneItemCount),Gs=reactExports.useRef(null),[ga,So]=reactExports.useState(!1);reactExports.useEffect(()=>{const _f=()=>So(!0),np=()=>So(!1);return document.addEventListener("mousedown",_f),document.addEventListener("keydown",np),()=>{document.removeEventListener("mousedown",_f),document.removeEventListener("keydown",np)}},[]);const go=reactExports.useCallback(_f=>{let np=[];for(const[_l,Ml]of Object.entries(_f))np.push(Ml);ss(np)},[]);addCoreEventListener(o,hs.EVENTS.UI.ContextMenu_InfoBtnClicked,_f=>{const np=_f.itemData.lookDetails[_f.currentVariant],_l=np;_l.price=np.price,_l.id=_f.currentVariant,_l.productCategory={id:_f.itemData.categoryID,label:_f.itemData.categoryLabel},kr(_l),us(!0)}),addCoreEventListener(o,hs.EVENTS.SCENE.ReplaceableCategory_Updated,go),reactExports.useEffect(()=>{const _f=hs.getCurrentItemsInReplaceableCategory();return go(_f),()=>{}},[hs]),reactExports.useEffect(()=>{Object.keys(_e).length!==0&&(an(_e.build),_e.preconfiguration!==void 0&&_e.preconfiguration.configsData!=null&&On(_e.preconfiguration))},[_e]);const xo=reactExports.useCallback((_f,np)=>{o.uiSceneStore.getState().CORE_API.spawnItemBySkuID(_f,np)},[]),Mo=reactExports.useCallback(_f=>{_n.openConfirmationPopup===!1||Object.keys(ds).length<=fs?o.uiSceneStore.getState().CORE_API.loadSceneFromConfigurationID(_f,!1):(o.uiSceneStore.setState({loadConfigId:_f}),o.uiSceneStore.getState().setLoadConfigModalOpen(!0))},[_n,fs,ds]),yl=reactExports.useCallback(_f=>{o.uiSceneStore.getState().CORE_API.spawnGhostsForSkuID(_f,!1,1)},[]),Al=reactExports.useCallback(_f=>{dr||o.uiSceneStore.getState().CORE_API.removeAllGhosts(_f)},[dr]),xl=reactExports.useRef([]);reactExports.useEffect(()=>{if(!Kt)return;let _f=Kt.length;_n!==void 0&&(_f+=1),xl.current=xl.current.slice(0,_f)},[Kt,_n]);const ep=reactExports.useCallback(()=>{let _f=-3e3,np=-1,_l=Kt.length;_n!==void 0&&(_l+=1);for(let Ml=0;Ml<_l;Ml++){let tp=xl.current[Ml].getBoundingClientRect().left;tp<28&&_f<tp&&(_f=tp,np=Ml)}np!==-1&&pr(np)},[xl,Kt,_n]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"mobileTabContent",hidden:!a,tabIndex:$n?0:-1,"aria-hidden":!$n,children:jsxRuntimeExports.jsxs("div",{className:"scrollSpyTabs",children:[jsxRuntimeExports.jsxs("div",{className:"secondMobileTabs",children:[Object.keys(Kt).map((_f,np)=>jsxRuntimeExports.jsx(SecondMobileTabsHandler,{stores:o,sideMenuOpen:s,index:np,label:Kt[_f].label,activeTab:fr,tabsRef:xl,mobileGrid:Gs},"mobileTabs"+_f)),_n!==void 0&&jsxRuntimeExports.jsx(SecondMobileTabsHandler,{stores:o,sideMenuOpen:s,index:Kt.length,label:_n.label,activeTab:fr,tabsRef:xl,mobileGrid:Gs},"preconfiguration_mobileTabs")]}),jsxRuntimeExports.jsxs("div",{className:"mobileGrid",ref:Gs,onScroll:ep,children:[Kt.map((_f,np)=>jsxRuntimeExports.jsx(MobileGrid,{stores:o,sideMenuOpen:s,element:_f,index:np,spawnGhosts:yl,spawnItem:xo,removeAllGhosts:Al,infoModalOpen:dr,setItemAllowed:Or,activeItems:Xr,tabsRef:xl,elementsLength:_n!==void 0?Kt.length+1:Kt.length},"mobileGrid"+np)),_n!==void 0&&jsxRuntimeExports.jsx(MobileGrid_PreConfig,{stores:o,sideMenuOpen:s,onClick:Mo,configsData:_n.configsData,tabsRef:xl,index:Kt.length,elementsLength:Kt.length+1},"preconfiguration_mobileGrid")]})]})}),jsxRuntimeExports.jsxs("div",{className:"container desktop",hidden:!a,tabIndex:$n?-1:0,"aria-hidden":$n,children:[Kt.map((_f,np)=>jsxRuntimeExports.jsx(BuildTabItemRow,{stores:o,sideMenuOpen:s,element:_f,index:np,visible:a,spawnGhosts:yl,spawnItem:xo,removeAllGhosts:Al,infoModalOpen:dr,isMouseUsed:ga,setItemAllowed:Or,activeItems:Xr,elementsLength:Kt.length},`category_${_f.categoryID}_${np}`)),_n!==void 0&&jsxRuntimeExports.jsx(BuildTabItemRow_PreConfig,{stores:o,sideMenuOpen:s,onClick:Mo,visible:a,configsData:_n.configsData,infoModalOpen:dr,isMouseUsed:ga,label:_n.label,index:Kt.length,elementsLength:Kt.length+1},"preconfiguration_desktopCategory")]})]})},handleGlobalVariantSwitch=(o,s,a)=>{o.uiSceneStore.getState().CORE_API.switchGlobalVariant(s,a)};function Divider$1(o,s){return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:o!==s.length-1?jsxRuntimeExports.jsx("div",{className:"itemGridDivider"}):""})}const Color=({stores:o,visible:s})=>{const a=o.productDataStore($n=>$n.categoryData),b=o.colorStore($n=>$n.allActiveVariants),_e=o.uiSceneStore($n=>$n.materialOverrideExists),Kt=o.uiSceneStore($n=>$n.CORE_API),an=o.cartStore($n=>$n.previewCartModalOpen),_n=o.uiSceneStore($n=>$n.dialogPopupOpen),On=reactExports.useCallback(()=>{o.uiSceneStore.getState().CORE_API.removeAllVariantOverrides()},[]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"container desktop",style:{height:"auto"},hidden:!s,children:[_e&&jsxRuntimeExports.jsx("button",{tabIndex:!_n&&!an&&_e&&s?0:-1,className:"removeAllColorOverridesButton",role:"button","aria-hidden":!_e||_n||an||!s,"aria-label":"Remove All Overrides Button",onClick:On,disabled:!_e,children:"Remove all overrides"}),a.color.map(($n,dr)=>jsxRuntimeExports.jsxs("div",{className:"subContainer topContainer",children:[jsxRuntimeExports.jsx("h4",{className:"subheading",children:$n.label}),jsxRuntimeExports.jsx("div",{className:"sidemenuContent",children:jsxRuntimeExports.jsx("div",{className:"color-grid color-variants-selection",children:$n.looks.map((fr,pr)=>jsxRuntimeExports.jsxs("div",{tabIndex:!_n&&!an&&s?0:-1,onClick:()=>handleGlobalVariantSwitch(o,$n.id,fr),role:"button","aria-hidden":_n||an||!s,"aria-label":o.productDataStore.getState().lookData[fr]?.label+" Button",className:b[$n.id]==fr?"colorSelector selected":"colorSelector",children:[jsxRuntimeExports.jsx("div",{className:"colorThumbnailContainer",children:jsxRuntimeExports.jsxs("div",{className:"colorThumbnail",children:[jsxRuntimeExports.jsx("div",{className:"checkMark",children:jsxRuntimeExports.jsx("img",{alt:"Check",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Check.svg",onError:Ar=>{Ar.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("img",{alt:o.productDataStore.getState().lookData[fr]?.label,className:"contextColorThumbnail",src:Kt.getResolvedAssetUrl(o.productDataStore.getState().lookData[fr]?.thumbnail),onError:Ar=>{Ar.target.src="https://placehold.co/150"}})]})}),jsxRuntimeExports.jsxs("div",{className:"colorDetails",children:[jsxRuntimeExports.jsx("p",{className:"truncate colorDetailsLabel",children:capitalize$1(o.productDataStore.getState().lookData[fr]?.label)}),jsxRuntimeExports.jsx("p",{className:"truncate colorDetailsLabel",children:capitalize$1(o.productDataStore.getState().lookData[fr]?.accent)})]})]},"Color-"+pr))})}),jsxRuntimeExports.jsx(Divider$1,{})]},`${$n.label}-${dr}`))]})})};function scrollToTop(o,s,a){let b=s.clientHeight,_e=b*a;if(o.current.scrollTop===_e)return;let Kt=null;const an=500,_n=o.current.scrollTop;function On(dr){b=s.clientHeight,_e=b*a;let fr=_e-_n;Kt||(Kt=dr);const pr=dr-Kt,Ar=Math.min(pr/an,1);o.current.scrollTop=_n+fr*$n(Ar),Ar<1&&window.requestAnimationFrame(On)}function $n(dr){return dr<.5?2*dr*dr:-1+(4-2*dr)*dr}window.requestAnimationFrame(On)}function CarouselItem({stores:o,carouselTabKey:s,hotspotContentRef:a,defaultAltText:b}){const _e=reactExports.useRef(null),Kt=o.uiSceneStore(_n=>_n.CORE_API),an=_n=>{_n.target.style.width="100%"};return jsxRuntimeExports.jsx(SplideSlide,{children:jsxRuntimeExports.jsxs("div",{className:"carouselTabParent",ref:_e,children:[s.type==="img"&&jsxRuntimeExports.jsx("img",{src:Kt.getResolvedAssetUrl(s.link),alt:s.alt?s.alt:b,onLoad:_n=>an(_n),onError:_n=>{_n.target.src="https://placehold.co/150"}}),s.type==="video"&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("p",{className:"carouselVideoPlaceholderText",children:s.alt?s.alt:b}),jsxRuntimeExports.jsx("video",{src:Kt.getResolvedAssetUrl(s.link),muted:!0,loop:!0,autoPlay:!0,playsInline:!0,controls:!1,onLoad:_n=>an(_n)})]}),s.title&&jsxRuntimeExports.jsx("p",{className:"carouselTitle",children:s.title})]})},"SplideSlide-"+s.link)}function Tab({stores:o,sideMenuOpen:s,tabs:a,tabKey:b,index:_e,activeFeatureID:Kt}){const[an,_n]=reactExports.useState([]),On=reactExports.useRef(null),$n=reactExports.useRef(null),dr=reactExports.useRef(null),fr=o.cartStore(us=>us.previewCartModalOpen),pr=o.uiSceneStore(us=>us.dialogPopupOpen),[Ar,Or]=reactExports.useState(!1),Xr=reactExports.useCallback(us=>{o.uiSceneStore.getState().CORE_API.clickHotspot("hotspot3D_"+us,{ignoreUI:!0})},[Kt]);reactExports.useEffect(()=>{let us=[],hs=b.hotspotData;for(let ds=0;ds<hs.carousel.length;ds++)hs.carousel[ds].type!==""&&hs.carousel[ds].link!==""&&(us=[...us,{...hs.carousel[ds],index:ds}]);_n(us)},[b]),reactExports.useEffect(()=>{const{current:us}=$n;us&&(Kt===us.id?(ss(us),Or(!0)):(kr(us),Or(!1)))},[Kt]);const ss=reactExports.useCallback(us=>{us.checked=!0,us.nextElementSibling.nextElementSibling.setAttribute("style","max-height: 800px;"),scrollToTop(a,us.nextElementSibling,_e)},[]),kr=reactExports.useCallback(us=>{us.nextElementSibling.nextElementSibling.setAttribute("style","max-height: 0px;"),us.checked=!1},[]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:b.hotspotData&&jsxRuntimeExports.jsxs("div",{className:"accordionTab",children:[jsxRuntimeExports.jsx("input",{tabIndex:s&&!pr&&!fr?0:-1,"aria-hidden":!s||pr||fr,type:"checkbox",name:"accordion",id:"rd_"+b.itemData.skuID+"_"+b.hotspotData.hotspotID,defaultChecked:!1,ref:$n,"aria-label":"Toggle Accordion for "+b.hotspotData.title,onClick:us=>{Xr(b.itemData.skuID+"_"+b.hotspotData.hotspotID,{ignoreUI:!1})}}),jsxRuntimeExports.jsxs("label",{className:"tab-label",htmlFor:"rd_"+b.itemData.skuID+"_"+b.hotspotData.hotspotID,children:[jsxRuntimeExports.jsx("span",{children:b.hotspotData.title}),jsxRuntimeExports.jsx("img",{alt:"Open Image for title "+b.hotspotData.title,className:"accordion-closed",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Plus.svg",onError:us=>{us.target.src="https://placehold.co/150"}}),jsxRuntimeExports.jsx("img",{alt:"Close Image for title "+b.hotspotData.title,className:"accordion-open",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Minus.svg",onError:us=>{us.target.src="https://placehold.co/150"}})]}),jsxRuntimeExports.jsx("div",{className:"tab-content",children:jsxRuntimeExports.jsx("div",{className:"hotspot-content",ref:dr,children:Ar&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ReactQuill$1,{className:"ignore",modules:{toolbar:!1},theme:"bubble",readOnly:!0,value:b.hotspotData.description}),an.length==1&&an[0].type!=""&&an[0].link!=""&&jsxRuntimeExports.jsx("ul",{children:jsxRuntimeExports.jsx(CarouselItem,{stores:o,carouselTabKey:an[0],index:0,defaultAltText:b.itemData.name?b.itemData.name:b.itemData.skuID,hotspotContentRef:dr},"carouselTabs_"+b.itemData.skuID+"_"+b.hotspotData.hotspotID+"_0")}),an.length>1&&jsxRuntimeExports.jsx("div",{className:"carousel",children:jsxRuntimeExports.jsx(Splide2,{options:{perPage:1,preloadPages:3},role:"none",ref:On,children:an.map((us,hs)=>us.type!=""&&us.link!=""&&jsxRuntimeExports.jsx(CarouselItem,{stores:o,carouselTabKey:us,defaultAltText:b.itemData.name?b.itemData.name:b.itemData.skuID,index:hs,hotspotContentRef:dr},"carouselTabs_"+b.itemData.skuID+"_"+b.hotspotData.hotspotID+"_"+us.index))})})]})})})]})})}const ProductFeaturesUI=({stores:o,sideMenuOpen:s,visible:a,identifier:b})=>{const _e=o.uiSceneStore(On=>On.tabSpawnCount),Kt=o.uiSceneStore(On=>On.isScreenPortrait),an=reactExports.useRef(null),_n=o.uiHotspotStore(On=>On.activeFeatureID);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"col desktop productFeatureUIDic",hidden:!a,tabIndex:a&&b=="featuresTab-mobile"&&Kt||b=="featuresTab-desktop"&&!Kt?0:-1,"aria-hidden":!a||b=="featuresTab-mobile"&&!Kt||b=="featuresTab-desktop"&&Kt,children:jsxRuntimeExports.jsxs("div",{className:"tabs",ref:an,children:[_e.length==0&&jsxRuntimeExports.jsx("div",{className:"tabEmptyText",children:"*Please add an item to the scene to see the features"}),_e.map((On,$n)=>jsxRuntimeExports.jsx(Tab,{stores:o,sideMenuOpen:s,tabs:an,activeFeatureID:_n,tabKey:On,index:$n},"tabs_"+On.itemData.skuID+"_"+On.hotspotData.hotspotID))]})})})},CartItem=({stores:o,itemObject:s})=>{const a=o.uiSceneStore(an=>an.CORE_API),b=o.uiSceneStore(an=>an.disableCart),[_e,Kt]=reactExports.useState(a.sceneSettings.currency);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:s.countUnavailable=="0"||b?"cartItem":"cartItem cartItemOutOfStock",draggable:!1,style:{display:s?"":"none"},children:[jsxRuntimeExports.jsx("div",{className:"cartItemImage",children:jsxRuntimeExports.jsx("img",{draggable:!1,src:a.getResolvedAssetUrl(s.thumbnails.review?s.thumbnails.review:s.thumbnails.low),alt:s.title,"aria-label":s.title,onError:an=>{an.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsxs("div",{className:"cartItemDetails",children:[jsxRuntimeExports.jsx("h4",{children:s.title}),s.subtitle?jsxRuntimeExports.jsx("h5",{children:s.subtitle}):jsxRuntimeExports.jsx("h5",{children:s.subheading}),jsxRuntimeExports.jsxs("div",{className:"cartRow",children:[jsxRuntimeExports.jsxs("span",{className:"itemCount",children:[a.sceneSettings.textSettings.cartQuantityText,":"," ",s.count]}),jsxRuntimeExports.jsxs("h3",{className:"itemPrice".concat(b===!0?" hide":""),children:[_e,parseFloat(s.price).toFixed(2)]}),s.compareAtPrice!=0&&s.compareAtPrice>s.price&&jsxRuntimeExports.jsxs("h3",{className:"itemCompareAtPrice".concat(b===!0?" hide":""),children:[_e,parseFloat(s.compareAtPrice).toFixed(2)]})]}),s.actionButton&&jsxRuntimeExports.jsx("span",{className:"actionButton",role:"button","aria-label":"Action Button",onClick:()=>a.actionButtonClicked(s),children:s.actionButton.text}),jsxRuntimeExports.jsxs("div",{className:"cartRow".concat(b===!0||s.countUnavailable=="0"?" hide":""),tabIndex:b===!0||s.countUnavailable=="0"?-1:0,"aria-hidden":b===!0||s.countUnavailable=="0",children:[jsxRuntimeExports.jsx("img",{className:"cartRowImage",alt:"Info",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Info_red.png",onError:an=>{an.target.src="https://placehold.co/150"}}),jsxRuntimeExports.jsxs("h3",{className:"itemAvailable",children:[s.countAvailable," IN STOCK"]}),jsxRuntimeExports.jsx("span",{className:"itemCount",children:"- quantities requested not available"})]})]})]})})},PreviewCart=({stores:o})=>{const s=o.cartStore(dr=>dr.cart),a=o.cartStore(dr=>dr.previewCartModalOpen),b=o.cartStore(dr=>dr.togglePreviewCartModal),_e=o.uiSceneStore(dr=>dr.CORE_API),Kt=o.uiSceneStore(dr=>dr.disableCart),an=o.uiSceneStore(dr=>dr.cartMessage),_n=o.uiSceneStore(dr=>dr.dialogPopupOpen),On=reactExports.useRef(null),$n=reactExports.useCallback(async()=>{await _e.checkoutAsync()},[]);return reactExports.useEffect(()=>{On.current&&a&&On.current.focus()},[a]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:a?"previewCartModal open":"previewCartModal",tabIndex:!_n&&a?0:-1,"aria-hidden":_n||!a,children:[jsxRuntimeExports.jsxs("div",{className:"previewCartModalChild",children:[jsxRuntimeExports.jsx("div",{role:"button",ref:On,className:"closeButton","aria-label":"Close Button",onClick:()=>{b()},children:jsxRuntimeExports.jsx("img",{alt:"Close",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/X.svg",onError:dr=>{dr.target.src="https://placehold.co/150"}})}),s.length<=0&&jsxRuntimeExports.jsx("h3",{className:"cartEmptyText",children:"Your cart is currently empty"}),s.length>0&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h2",{className:"cartTitle",children:_e.sceneSettings.textSettings.cartHeadingText}),jsxRuntimeExports.jsx("div",{className:"previewCartContentParentDiv",children:jsxRuntimeExports.jsx("div",{className:"previewCartContent",children:s.map((dr,fr)=>jsxRuntimeExports.jsx(CartItem,{stores:o,itemObject:dr,index:fr},`Cart Item-${fr}`))})})]})]}),jsxRuntimeExports.jsxs("div",{className:"checkButtonParentDiv".concat(Kt===!0?" hide":""),children:[an&&jsxRuntimeExports.jsx("div",{className:"cartMessageDiv",children:jsxRuntimeExports.jsx("span",{children:an})}),jsxRuntimeExports.jsx("div",{role:"button","aria-label":"Click to checkout the cart","aria-hidden":!a,tabIndex:a?0:-1,className:"checkoutButton",onClick:$n,children:jsxRuntimeExports.jsx("span",{children:_e.sceneSettings.addToCartCTAText})})]})]})})},InfoModal=({stores:o,visible:s})=>{const a=o.productDataStore(xl=>xl.categoryData),b=o.uiSceneStore(xl=>xl.dialogPopupOpen),_e=o.uiSceneStore(xl=>xl.isScreenPortrait),Kt=o.colorStore(xl=>xl.allActiveVariants),an=o.infoStore(xl=>xl.infoObject),_n=o.infoStore(xl=>xl.infoModalOpen),On=o.itemStore(xl=>xl.itemsSpawned),$n=o.infoStore(xl=>xl.updateInfoModalOpen),[dr,fr]=reactExports.useState(""),[pr,Ar]=reactExports.useState([]),[Or,Xr]=reactExports.useState(!1),ss=o.uiSceneStore(xl=>xl.CORE_API),kr=o.productDataStore(xl=>xl.productData),us=o.itemStore(xl=>xl.fittingSkuIds),[hs,ds]=reactExports.useState(!1),[fs,Gs]=reactExports.useState(0),ga=o.coreSceneStore(xl=>xl.sceneSettings),So=reactExports.useRef(null),go=reactExports.useCallback(()=>{fs<=0||!an.skuID||ss.removeLastItemBySkuId(an.skuID)},[fs,an]),xo=()=>{if(!On||!an.skuID)return;let xl=0;const ep=Object.keys(On);for(let _f=ep.length-1;_f>=0;_f--){const np=ep[_f];On[np].itemData.skuID===an.skuID&&xl++}Gs(xl)};reactExports.useEffect(()=>{xo()},[On,an]),reactExports.useEffect(()=>{Object.keys(a).length!=0&&Ar(a.build)},[a]),reactExports.useEffect(()=>(fr(Kt[Object.keys(Kt)[0]]),()=>{}),[Kt]),reactExports.useEffect(()=>{us.includes(an.skuID)?Xr(!0):Xr(!1)},[us,an]),reactExports.useEffect(()=>{if(!kr||!an.skuID)return;const xl=kr[an.skuID].incrementDecrementControl?kr[an.skuID].incrementDecrementControl:!1;ds(xl)},[kr,an]);const Mo=reactExports.useCallback(()=>{Or&&ss.spawnGhostsForSkuID(an.skuID,!1,1)},[an,Or]),yl=reactExports.useCallback(()=>{Or&&ss.removeAllGhosts(an.skuID)},[an,Or]),Al=reactExports.useCallback(()=>{Or&&ss.spawnItemBySkuID(an.skuID,!0)},[an,Or]);return reactExports.useEffect(()=>{So.current&&s&&_n&&So.current.focus()},[_n,s]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:_n&&s?"infoModal open":"infoModal",tabIndex:_n&&!_e?0:-1,"aria-hidden":!_n||_e,children:[jsxRuntimeExports.jsxs("a",{role:"button","aria-label":"Product Page Link Button","aria-hidden":b||!s||!_n||!an?.productPageUrl,tabIndex:!b&&s&&_n&&an?.productPageUrl?0:-1,ref:So,href:an.productPageUrl,className:"categoryLink",target:"_blank",style:an?.productPageUrl&&_n?{pointerEvents:"all"}:{pointerEvents:"none"},children:[jsxRuntimeExports.jsxs("h2",{className:"categoryTitle",children:[an?.productCategory?.label,an.subheading&&jsxRuntimeExports.jsx("div",{className:"modalSubHeading",children:an.subheading})]}),an.productPageUrl&&jsxRuntimeExports.jsx("img",{alt:"Open Product Page",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/OpenTab.svg",onError:xl=>{xl.target.src="https://placehold.co/150"}})]}),jsxRuntimeExports.jsx("div",{role:"button","aria-hidden":b||!s||!_n,tabIndex:!b&&s&&_n?0:-1,className:"closeButton","aria-label":"Close Button",onClick:()=>{$n(!1)},children:jsxRuntimeExports.jsx("img",{alt:"Close",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/X.svg",onError:xl=>{xl.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("div",{className:"infoModalImageContainer",children:an?.thumbnails?.high?jsxRuntimeExports.jsx("img",{alt:an.title,className:"itemImage","aria-label":an.title,src:ss.getResolvedAssetUrl(an.thumbnails.high),onError:xl=>{xl.target.src="https://placehold.co/150"}}):""}),jsxRuntimeExports.jsxs("div",{className:"infoModalTextContainer",children:[jsxRuntimeExports.jsx("h2",{className:"itemTitle",children:an.title}),jsxRuntimeExports.jsx("pre",{className:"itemDescription",children:an.description}),an.boundingBoxSize?jsxRuntimeExports.jsxs("p",{className:"infoModalDimensions",children:[an.boundingBoxSize.x.toFixed(1),"” W x"," ",an.boundingBoxSize.y.toFixed(1),"” D x"," ",an.boundingBoxSize.z.toFixed(1),"” H"]}):""]}),ga.addFromInfoModal&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:hs?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"infoModalIncrementDecrementParent incrementDecrementPanel",children:[jsxRuntimeExports.jsx("div",{role:"button","aria-label":"Decrement Button","aria-hidden":fs==0||b||!_n,tabIndex:fs!==0&&!b&&_n?0:-1,className:"incrementMinusSign ".concat(`${fs===0?"incrementSignDisable":""}`),onClick:go,children:jsxRuntimeExports.jsx("img",{alt:"Decrement",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Minus.svg",onError:xl=>{xl.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("div",{className:"incrementCount",children:fs}),jsxRuntimeExports.jsx("div",{role:"button","aria-label":"Increment Button","aria-hidden":b||!_n||!Or,tabIndex:!b&&_n&&Or?0:-1,className:"incrementPlusSign ".concat(`${Or===!0?"":"incrementSignDisable"}`),onClick:Al,onMouseEnter:Mo,onMouseLeave:yl,children:jsxRuntimeExports.jsx("img",{alt:"Increment",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Plus.svg",onError:xl=>{xl.target.src="https://placehold.co/150"}})})]})}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{role:"button","aria-label":"Add Button","aria-hidden":!Or||b||!_n,tabIndex:!b&&_n&&Or?0:-1,className:"infoModalAddButton ".concat(`${Or===!0?"enabledInfoModalAddButton":"disabledInfoModalAddButton"}`),onFocus:Mo,onBlur:yl,onMouseEnter:Mo,onMouseLeave:yl,onClick:Al,children:"Add"})})}),jsxRuntimeExports.jsx("div",{className:"infoModalActions",children:an.price&&jsxRuntimeExports.jsxs("button",{className:"item-price",disabled:!0,children:["`$$",numberWithCommas(parseFloat(an.price).toFixed(2)),"`"]})})]})})},handleGlobalGeometryVariantSwitch=(o,s,a)=>{o.uiSceneStore.getState().CORE_API.switchGlobalGeometryVariant(s,a)};function Divider(o,s){return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:o!==s.length-1?jsxRuntimeExports.jsx("div",{className:"itemGridDivider"}):""})}const GeometryVariants=({stores:o,visible:s})=>{const a=o.productDataStore(On=>On.categoryData),b=o.colorStore(On=>On.allActiveGeometryVariants),_e=o.uiSceneStore(On=>On.CORE_API),Kt=o.uiSceneStore(On=>On.isScreenPortrait),an=o.cartStore(On=>On.previewCartModalOpen),_n=o.uiSceneStore(On=>On.dialogPopupOpen);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"container desktop",style:{height:"auto"},hidden:!s,tabIndex:s&&!Kt?0:-1,"aria-hidden":!s||Kt,children:a.geometryVariants.map((On,$n)=>jsxRuntimeExports.jsxs("div",{className:"subContainer topContainer",children:[jsxRuntimeExports.jsx("h4",{className:"subheading",children:On.label}),jsxRuntimeExports.jsx("div",{className:"sidemenuContent",children:jsxRuntimeExports.jsx("div",{className:"color-grid geometry-variants-selection",children:Object.keys(On.variants).map((dr,fr)=>jsxRuntimeExports.jsxs("div",{tabIndex:!_n&&!an?0:-1,onClick:()=>handleGlobalGeometryVariantSwitch(o,On.id,dr),role:"button","aria-hidden":_n||an,"aria-label":On.variants[dr].label+" Button",className:b[On.id]==dr?"colorSelector selected":"colorSelector",children:[jsxRuntimeExports.jsx("div",{className:"colorThumbnailContainer",children:jsxRuntimeExports.jsxs("div",{className:"colorThumbnail",style:{borderRadius:"0%"},children:[jsxRuntimeExports.jsx("div",{className:"checkMark",children:jsxRuntimeExports.jsx("img",{alt:"Check",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Check.svg",onError:pr=>{pr.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("img",{alt:On.variants[dr].label,className:"contextColorThumbnail",src:_e.getResolvedAssetUrl(On.variants[dr].thumbnail),onError:pr=>{pr.target.src="https://placehold.co/150"}})]})}),jsxRuntimeExports.jsx("div",{className:"colorDetails",children:jsxRuntimeExports.jsx("p",{className:"truncate colorDetailsLabel",children:capitalize$1(On.variants[dr].label)})})]},"Color-"+fr))})}),jsxRuntimeExports.jsx(Divider,{})]},`${On.label}-${$n}`))})})},VariantMobile=({stores:o,sideMenuOpen:s,sortedVariantsTabOrder:a})=>{const b=o.productDataStore(go=>go.categoryData),_e=o.productDataStore(go=>go.lookData),Kt=o.colorStore(go=>go.allActiveVariants),an=o.uiSceneStore(go=>go.isScreenPortrait),_n=o.colorStore(go=>go.allActiveGeometryVariants),On=o.uiSceneStore(go=>go.materialOverrideExists),[$n,dr]=reactExports.useState(0),[fr,pr]=reactExports.useState(0);reactExports.useEffect(()=>{let go=0;a.includes("color")===!0&&(go+=b.color.length),a.includes("geometryVariants")===!0&&(go+=b.geometryVariants.length),pr(go)},[b]);const Ar=(go,xo,Mo)=>{go.uiSceneStore.getState().CORE_API.switchGlobalGeometryVariant(xo,Mo)},Or=(go,xo,Mo)=>{go.uiSceneStore.getState().CORE_API.switchGlobalVariant(xo,Mo)};function Xr({color:go,index:xo,elementId:Mo,allActiveVariants:yl}){return jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:s?0:-1,"aria-hidden":!s,"aria-label":_e[go]?.label+" Button",onClick:()=>Or(o,Mo,go),className:yl[Mo]==go?"colorSelector selected":"colorSelector",children:[jsxRuntimeExports.jsx("div",{className:"colorThumbnailContainer",children:jsxRuntimeExports.jsxs("div",{className:"colorThumbnail",children:[jsxRuntimeExports.jsx("div",{className:"checkMark",children:jsxRuntimeExports.jsx("img",{alt:"Check",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Check.svg",onError:Al=>{Al.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("img",{alt:_e[go]?.label,className:"contextColorThumbnail",src:o.uiSceneStore.getState().CORE_API.getResolvedAssetUrl(_e[go]?.thumbnail),onError:Al=>{Al.target.src="https://placehold.co/150"}})]})}),jsxRuntimeExports.jsx("div",{className:"colorDetails",children:jsxRuntimeExports.jsx("p",{className:"truncate-mobile colorDetailsLabel",children:capitalize$1(_e[go]?.label)})})]},"Color-"+xo)}function ss({variant:go,variantId:xo,index:Mo,elementId:yl,allActiveGeometryVariants:Al}){return jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:s?0:-1,"aria-hidden":!s,"aria-label":go.label+" Button",onClick:()=>Ar(o,yl,xo),className:Al[yl]==xo?"colorSelector selected":"colorSelector",children:[jsxRuntimeExports.jsx("div",{className:"colorThumbnailContainer",children:jsxRuntimeExports.jsxs("div",{className:"colorThumbnail",children:[jsxRuntimeExports.jsx("div",{className:"checkMark",children:jsxRuntimeExports.jsx("img",{alt:"Check",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Check.svg",onError:xl=>{xl.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("img",{alt:go.label,className:"contextColorThumbnail",src:o.uiSceneStore.getState().CORE_API.getResolvedAssetUrl(go.thumbnail),onError:xl=>{xl.target.src="https://placehold.co/150"}})]})}),jsxRuntimeExports.jsx("div",{className:"colorDetails",children:jsxRuntimeExports.jsx("p",{className:"truncate-mobile colorDetailsLabel",children:capitalize$1(go.label)})})]},"GeometryVariant-"+Mo)}function kr({variantType:go,element:xo,allActiveVariants:Mo,startIndex:yl}){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[go=="color"&&xo.looks.map((Al,xl)=>jsxRuntimeExports.jsx(Xr,{color:Al,index:xl,elementId:xo.id,allActiveVariants:Mo},"MobileGridInternal_"+xl)),go=="geometry"&&Object.keys(xo.variants).map((Al,xl)=>jsxRuntimeExports.jsx(ss,{variant:xo.variants[Al],index:xl,elementId:xo.id,variantId:Al,allActiveGeometryVariants:Mo},"MobileGridVariantInternal_"+xl))]})}const us=reactExports.useCallback(({index:go})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:go!==fr-1?jsxRuntimeExports.jsx("div",{className:"itemGridDivider"}):jsxRuntimeExports.jsx("div",{className:"itemGridPlaceholder"})}),[b,fr]),hs=reactExports.useCallback(()=>{o.uiSceneStore.getState().CORE_API.removeAllVariantOverrides()},[]),ds=reactExports.useCallback(go=>{if(Gs.current.scrollLeft===go)return;let xo,Mo,yl,Al=!1;function xl(ep){xo===void 0&&(xo=ep);const _f=ep-xo;if(Mo!==ep){const np=_f/200;Gs.current.scrollLeft>go?(yl=(Gs.current.scrollLeft-go)*Math.min(np,1),Gs.current.scrollLeft-=yl,Gs.current.scrollLeft===go&&(Al=!0)):Gs.current.scrollLeft<go&&(yl=(go-Gs.current.scrollLeft)*Math.min(np,1),Gs.current.scrollLeft+=yl,Gs.current.scrollLeft===go&&(Al=!0))}_f<200&&(Mo=ep,!Al&&window.requestAnimationFrame(xl))}window.requestAnimationFrame(xl)},[]),fs=reactExports.useRef([]);reactExports.useEffect(()=>{fs.current=fs.current.slice(0,fr)},[fr]);const Gs=reactExports.useRef(null),ga=reactExports.useCallback(({sideMenuOpen:go,categoryID:xo,label:Mo,index:yl,totalLength:Al})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("a",{role:"button",tabIndex:go?0:-1,"aria-hidden":!go,"aria-label":Mo+" Button",className:$n===yl?"mobileTab scrolled":"mobileTab",onClick:()=>{for(let xl=0;xl<Al;xl++)xl===yl&&ds(fs.current[xl].offsetLeft)},children:Mo})}),[$n,fs]),So=reactExports.useCallback(()=>{let go=-3e3,xo=-1;for(let Mo=0;Mo<fr;Mo++){let yl=fs.current[Mo].getBoundingClientRect().left;yl<28&&go<yl&&(go=yl,xo=Mo)}xo!==-1&&dr(xo)},[fs,b,fr]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"mobileTabContent",tabIndex:an?0:-1,"aria-hidden":!an,children:jsxRuntimeExports.jsxs("div",{className:"scrollSpyTabs",children:[jsxRuntimeExports.jsx("div",{className:"secondMobileTabs",children:a.map((go,xo)=>{if(go=="color")return b.color.map((Mo,yl)=>jsxRuntimeExports.jsx(ga,{sideMenuOpen:s,categoryID:Mo.id,label:Mo.label,index:xo==0?yl:a.includes("geometryVariants")?b.geometryVariants.length+yl:yl,totalLength:fr},"mobileTabsColors"+Mo.id));if(go=="geometryVariants")return b.geometryVariants.map((Mo,yl)=>jsxRuntimeExports.jsx(ga,{categoryID:Mo.id,label:Mo.label,index:xo==0?yl:a.includes("color")?b.color.length+yl:yl,totalLength:fr},"mobileTabsVariants"+Mo.id))})}),jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("div",{className:"mobileGrid mobileGridCenter",ref:Gs,onScroll:So,children:jsxRuntimeExports.jsxs("section",{className:"mobileGridSection",children:[On&&jsxRuntimeExports.jsxs("button",{role:"button",tabIndex:an&&On&&s?0:-1,"aria-label":"Remove All Overrides Button","aria-hidden":!an||!On||!s,onClick:hs,className:"removeAllColorOverridesButton",disabled:!On,children:[jsxRuntimeExports.jsx("div",{className:"iconContainer",children:jsxRuntimeExports.jsx("img",{src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/TrashSimple.svg",alt:"Remove",onError:go=>{go.target.src="https://placehold.co/150"}})}),"Remove all",jsxRuntimeExports.jsx("br",{}),"overrides"]}),a.map((go,xo)=>{if(go=="color")return b.color.map((Mo,yl)=>jsxRuntimeExports.jsxs("section",{className:"mobileGridCategorySection color-variants-selection",id:`section-${Mo.categoryID}`,ref:Al=>fs.current[xo==0?yl:a.includes("geometryVariants")?b.geometryVariants.length+yl:yl]=Al,children:[jsxRuntimeExports.jsx(kr,{variantType:"color",element:Mo,allActiveVariants:Kt},`mobileGrid-${Mo.categoryID}`),jsxRuntimeExports.jsx(us,{index:xo==0?yl:a.includes("geometryVariants")?b.geometryVariants.length+yl:yl},"divider"+Mo.categoryID)]},`sectionz-${Mo.categoryID}-${yl}`));if(go=="geometryVariants")return b.geometryVariants.map((Mo,yl)=>jsxRuntimeExports.jsxs("section",{className:"mobileGridCategorySection geometry-variants-selection",id:`section-${Mo.id}`,ref:Al=>fs.current[xo==0?yl:a.includes("color")?b.color.length+yl:yl]=Al,children:[jsxRuntimeExports.jsx(kr,{variantType:"geometry",element:Mo,allActiveVariants:_n},`mobileGrid-variants-${Mo.id}`),jsxRuntimeExports.jsx(us,{index:xo==0?yl:a.includes("color")?b.color.length+yl:yl},"divider-variants-"+Mo.id)]},`sectionz-variants-${Mo.id}-${yl}`))})]})})})]})})})},SideMenu=({stores:o,sideMenuOpen:s,sideMenuRef:a,toggleSideMenuOpen:b,configuratorWcRef:_e,PUBLIC_DESIGN_ASSETS_ENDPOINT:Kt,handleSideButtonClick:an,useTabIcon:_n,GENERIC_PROJECT_ASSET_DATA_ROOT_URL:On,sideMenuState:$n,togglePreviewCartModal:dr,getItemCount:fr,currency:pr})=>{const Ar=o.productDataStore(Gs=>Gs.hotspotsData),Or=o.cartStore(Gs=>Gs.previewCartModalOpen),Xr=o.uiSceneStore(Gs=>Gs.dialogPopupOpen),ss=o.productDataStore(Gs=>Gs.categoryData),kr=o.uiSceneStore(Gs=>Gs.disableCart),us=o.uiSceneStore(Gs=>Gs.CORE_API),hs=o.uiSceneStore(Gs=>Gs.isScreenPortrait),[ds,fs]=reactExports.useState([]);return reactExports.useEffect(()=>{const Gs=us.sceneSettings.variantsTabOrder,ga=Object.entries(Gs);ga.sort(([,go],[,xo])=>go.priority-xo.priority);const So=[];ga.forEach(([go,xo])=>{xo.enabled&&So.push(go)}),fs(So)},[us]),reactExports.useEffect(()=>{if(!o.uiSceneStore.getState().CORE_API.isMobile)return;const{current:Gs}=a;!Gs||_e.shadowRoot.getElementById("_leftShell")},[s,a]),jsxRuntimeExports.jsxs("div",{className:`sideMenu interactable ${s===!0?"":"side-menu-collapsed"}`,ref:a,children:[jsxRuntimeExports.jsxs("div",{className:s?"mobileExpandButton sideMenuOpen":"mobileExpandButton",tabIndex:hs?0:-1,"aria-hidden":!hs,children:[jsxRuntimeExports.jsx("span",{children:"Expand Configurator"}),jsxRuntimeExports.jsx("div",{role:"button",tabIndex:!s&&!Xr&&!Or?0:-1,"aria-hidden":s||Xr||Or,"aria-label":"Expand Menu",onClick:b,children:jsxRuntimeExports.jsx("img",{alt:"Down",src:Kt+"/Icon/ArrowDown.svg",onError:Gs=>{Gs.target.src="https://placehold.co/150"}})},"expandSideMenuButton")]}),jsxRuntimeExports.jsx("div",{className:s===!0?"sideMenuTabContainer":"sideMenuTabContainer side-menu-container-hide",tabIndex:hs?0:-1,"aria-hidden":!hs,children:jsxRuntimeExports.jsxs(Tabs,{className:"firstMobileTab",children:[jsxRuntimeExports.jsxs(TabList,{className:"firstMobileTabs","aria-label":"Mobile Tab List",children:[jsxRuntimeExports.jsx(Tab$1,{children:jsxRuntimeExports.jsxs("div",{className:"mobileTab",role:"button",tabIndex:!Or&&!Xr&&s?0:-1,"aria-hidden":Or||!s||Xr,"aria-label":"A button to select the "+us.sceneSettings.textSettings.buildTabHeadingText+" Tab",onClick:()=>{an(0)},children:[_n?jsxRuntimeExports.jsx("img",{className:"icon",alt:"Build",src:On+"/thumbnails/common-ui/BuildTabIcon.svg",onError:Gs=>{Gs.target.src="https://placehold.co/150"}}):"",us.sceneSettings.textSettings.buildTabHeadingText]})}),(ss.color.length>0||ss.geometryVariants.length>0)&&jsxRuntimeExports.jsx(Tab$1,{children:jsxRuntimeExports.jsxs("div",{className:"mobileTab",role:"button",tabIndex:!Or&&!Xr&&s?0:-1,"aria-hidden":Or||Xr||!s,"aria-label":us.sceneSettings.textSettings.colorTabHeadingText+" Button",onClick:()=>{an(1)},children:[_n?jsxRuntimeExports.jsx("img",{className:"icon",alt:"Color",src:On+"/thumbnails/common-ui/ColorTabIcon.svg",onError:Gs=>{Gs.target.src="https://placehold.co/150"}}):"",us.sceneSettings.textSettings.colorTabHeadingText]})}),Object.keys(Ar).length>0&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Tab$1,{children:jsxRuntimeExports.jsxs("div",{className:"mobileTab",role:"button",tabIndex:!Or&&!Xr&&s?0:-1,"aria-hidden":!s||Xr||Or,"aria-label":us.sceneSettings.textSettings.featuresTabHeadingText+" Button",onClick:()=>{an(2)},children:[_n?jsxRuntimeExports.jsx("img",{className:"icon",alt:"Features",src:On+"/thumbnails/common-ui/ProductFeaturesTabIcon.png",onError:Gs=>{Gs.target.src="https://placehold.co/150"}}):"",us.sceneSettings.textSettings.featuresTabHeadingText]})})}),jsxRuntimeExports.jsx("div",{role:"tab",className:"collapse-side-menu-button-parent",children:jsxRuntimeExports.jsx("div",{className:`collapse-side-menu-button ${s===!0?"":"set-display-none"}`,role:"button",tabIndex:!Or&&!Xr&&s?0:-1,"aria-hidden":Or||Xr||!s,"aria-label":"Collapse Menu",onClick:b,children:jsxRuntimeExports.jsx("img",{alt:"Down",src:Kt+"/Icon/ArrowDown.svg",onError:Gs=>{Gs.target.src="https://placehold.co/150"}})},"collapseSideMenuButton")})]}),jsxRuntimeExports.jsx(TabPanel,{children:jsxRuntimeExports.jsx(BuildUI,{stores:o,sideMenuOpen:s,identifier:"buildUI-mobile",sideMenuState:0})}),(ss.color.length>0||ss.geometryVariants.length>0)&&jsxRuntimeExports.jsx(TabPanel,{children:jsxRuntimeExports.jsx("div",{className:"variantContainer",children:jsxRuntimeExports.jsx(VariantMobile,{stores:o,sideMenuOpen:s,sortedVariantsTabOrder:ds})})}),Object.keys(Ar).length>0&&jsxRuntimeExports.jsx(TabPanel,{children:jsxRuntimeExports.jsx("div",{className:"featuresContainer",children:jsxRuntimeExports.jsx(ProductFeaturesUI,{stores:o,sideMenuOpen:s,identifier:"featuresTab-mobile",visible:$n===2})})})]})}),jsxRuntimeExports.jsxs("div",{className:"desktopSideMenu",tabIndex:hs?-1:0,"aria-hidden":hs,children:[jsxRuntimeExports.jsxs("nav",{className:"sideMenuTabs",children:[jsxRuntimeExports.jsxs("div",{role:"button","aria-hidden":!s||Xr||Or,tabIndex:s&&!Xr&&!Or?0:-1,className:$n===0?"activeSideMenuTab rightTopBarButton button":"inactiveSideMenuTab rightTopBarButton button","aria-label":us.sceneSettings.textSettings.buildTabHeadingText+" Button",onClick:()=>{an(0)},children:[_n?jsxRuntimeExports.jsx("img",{className:"icon",alt:"Build",src:On+"BuildTabIcon.png",onError:Gs=>{Gs.target.src="https://placehold.co/150"}}):"",jsxRuntimeExports.jsx("span",{children:us.sceneSettings.textSettings.buildTabHeadingText})]}),(ss.color.length>0||ss.geometryVariants.length>0)&&jsxRuntimeExports.jsxs("div",{role:"button","aria-hidden":!s||Xr||Or,tabIndex:s&&!Xr&&!Or?0:-1,className:$n===1?"activeSideMenuTab rightTopBarButton button":"inactiveSideMenuTab rightTopBarButton button","aria-label":us.sceneSettings.textSettings.colorTabHeadingText+" Button",onClick:()=>{an(1)},children:[_n?jsxRuntimeExports.jsx("img",{className:"icon",alt:"Color",src:On+"/thumbnails/common-ui/ColorTabIcon.svg",onError:Gs=>{Gs.target.src="https://placehold.co/150"}}):"",jsxRuntimeExports.jsx("span",{children:us.sceneSettings.textSettings.colorTabHeadingText})]}),Object.keys(Ar).length>0&&jsxRuntimeExports.jsxs("div",{role:"button","aria-label":us.sceneSettings.textSettings.featuresTabHeadingText+" Button","aria-hidden":!s||Xr||Or,tabIndex:s&&!Xr&&!Or?0:-1,className:$n===2?"activeSideMenuTab rightTopBarButton button":"inactiveSideMenuTab rightTopBarButton button",onClick:()=>{an(2)},children:[_n?jsxRuntimeExports.jsx("img",{className:"icon",alt:"Features",src:On+"/thumbnails/common-ui/ProductFeaturesTabIcon.png",onError:Gs=>{Gs.target.src="https://placehold.co/150"}}):"",jsxRuntimeExports.jsx("span",{children:us.sceneSettings.textSettings.featuresTabHeadingText})]})]}),jsxRuntimeExports.jsxs("div",{className:"sideMenuContent",children:[jsxRuntimeExports.jsx(PreviewCart,{stores:o}),jsxRuntimeExports.jsx(InfoModal,{stores:o,visible:$n===0}),jsxRuntimeExports.jsx(BuildUI,{stores:o,sideMenuOpen:!0,identifier:"buildUI-desktop",visible:$n===0}),jsxRuntimeExports.jsx("div",{className:"variantContainer",children:ds.map(Gs=>{if(Gs=="color"){if(ss.color.length>0)return jsxRuntimeExports.jsx(Color,{stores:o,visible:$n===1},"colourTab-desktop")}else if(Gs=="geometryVariants"&&ss.geometryVariants.length>0)return jsxRuntimeExports.jsx(GeometryVariants,{stores:o,visible:$n===1},"geometryVariantsTab-desktop")})}),jsxRuntimeExports.jsx(ProductFeaturesUI,{stores:o,sideMenuOpen:!0,identifier:"featuresTab-desktop",visible:$n===2})]})]}),jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:Xr?-1:0,"aria-hidden":Xr,className:"bottomBar right button","aria-label":"Toggle Preview Cart Button",onClick:()=>{dr()},children:[jsxRuntimeExports.jsxs("div",{className:"bottomBarChildDiv",children:[jsxRuntimeExports.jsx("span",{children:us.sceneSettings.textSettings.reviewButtonText}),jsxRuntimeExports.jsx("div",{className:"cartNumber",children:fr()})]}),jsxRuntimeExports.jsx("div",{className:"reviewButtonParentDiv",children:jsxRuntimeExports.jsx("div",{className:"button reviewButton".concat(kr===!0?" hide":""),children:jsxRuntimeExports.jsxs("div",{className:"cartTotalText",children:[`${pr}${numberWithCommas(o.cartStore.getState().cartTotalPrice)}`,o.cartStore.getState().cartTotalCompareAtPrice!=0&&o.cartStore.getState().cartTotalCompareAtPrice>o.cartStore.getState().cartTotalPrice&&jsxRuntimeExports.jsx("strike",{children:`${pr}${numberWithCommas(o.cartStore.getState().cartTotalCompareAtPrice)}`})]})})})]}),jsxRuntimeExports.jsx("div",{className:"reviewButtonSibling"})]})},PreviewCartMobile=({stores:o,previewCartModalOpen:s,togglePreviewCartModal:a,PUBLIC_DESIGN_ASSETS_ENDPOINT:b,cart:_e})=>{const Kt=o.uiSceneStore(dr=>dr.disableCart),an=o.uiSceneStore(dr=>dr.CORE_API),_n=o.uiSceneStore(dr=>dr.cartMessage),On=o.uiSceneStore(dr=>dr.isScreenPortrait),$n=reactExports.useCallback(async()=>{await an.checkoutAsync()},[]);return jsxRuntimeExports.jsxs("div",{className:s?"previewCartModal mobile open":"previewCartModal mobile",tabIndex:On?0:-1,"aria-hidden":!On,children:[jsxRuntimeExports.jsx("div",{className:"closeButton",role:"button",tabIndex:s?0:-1,"aria-hidden":!s,"aria-label":"Close Button",onClick:()=>{a()},children:jsxRuntimeExports.jsx("img",{alt:"Close",src:b+"/Icon/X.svg",onError:dr=>{dr.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("h2",{className:"cartTitle",children:an.sceneSettings.textSettings.cartHeadingText}),_e.length>0?jsxRuntimeExports.jsxs("div",{className:"previewCartContentParentDiv",children:[jsxRuntimeExports.jsx("div",{className:"previewCartContent",children:_e.map(function(dr,fr){return jsxRuntimeExports.jsx(CartItem,{stores:o,itemObject:dr,index:fr},`Cart Item - ${fr}`)})}),jsxRuntimeExports.jsxs("div",{className:"previewCartButtonContainer".concat(Kt===!0?" hide":""),children:[_n&&jsxRuntimeExports.jsx("div",{className:"cartMessageDiv",children:jsxRuntimeExports.jsx("span",{children:_n})}),jsxRuntimeExports.jsxs("button",{className:"checkoutButton",role:"button",tabIndex:Kt?-1:0,"aria-hidden":Kt,"aria-label":"Click to checkout the cart",onClick:$n,children:[jsxRuntimeExports.jsx("span",{children:an.sceneSettings.addToCartCTAText}),jsxRuntimeExports.jsx("img",{alt:"Right",src:b+"/Icon/ArrowRight.svg",onError:dr=>{dr.target.src="https://placehold.co/150"}})]})]})]}):jsxRuntimeExports.jsx("h3",{className:"cartEmptyText",children:"Your cart is currently empty"})]})},ContextMenuDesktop=({stores:o,selectedItemData:s,colors:a,colorsCategoryName:b})=>{const _e=o.uiSceneStore(us=>us.CORE_API),[Kt,an]=reactExports.useState(null),[_n,On]=reactExports.useState(0),[$n,dr]=reactExports.useState(0),[fr,pr]=reactExports.useState(null),Ar=reactExports.useRef(null),Or=reactExports.useRef(null),Xr=o.uiSceneStore(us=>us.dialogPopupOpen),ss=o.uiSceneStore(us=>us.isScreenPortrait),kr=reactExports.useCallback(()=>{_e.fireEvent(_e.EVENTS.UI.ContextMenu_InfoBtnClicked,s)},[s]);return reactExports.useEffect(()=>{pr(null),s&&(pr({...s}),s.overrideVariant?an(s.overrideVariant):an(s.currentVariant))},[s]),reactExports.useEffect(()=>{if(!fr||!Or.current||!s||!Ar.current)return;const us=_e.getCanvasSize();let hs=s.offsetX+Ar.current.children[0].clientWidth,ds=s.offsetY+Ar.current.children[0].clientHeight,fs=us.width-hs;fs<0?On(s.offsetX+fs-10):On(s.offsetX);let Gs=us.height-ds;Gs<0?dr(s.offsetY+Gs-10):dr(s.offsetY),Or.current.focus()},[fr,s,Ar]),jsxRuntimeExports.jsx("div",{ref:Ar,tabIndex:ss?-1:0,"aria-hidden":ss,children:s!==null&&jsxRuntimeExports.jsx("div",{className:"contextMenuParent interactable",style:{left:_n+"px",top:$n+"px"},children:jsxRuntimeExports.jsx("div",{className:"contextContentDiv",children:jsxRuntimeExports.jsxs("div",{className:"contextContent",children:[jsxRuntimeExports.jsxs("div",{className:"contextContentChildDiv",children:[jsxRuntimeExports.jsxs("div",{className:"contextNameContent",children:[jsxRuntimeExports.jsx("h3",{children:s.itemData.name}),jsxRuntimeExports.jsx("img",{ref:Or,role:"button","aria-hidden":Xr,tabIndex:Xr?-1:0,className:"infoButton",alt:"Info","aria-label":"Info",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Info.svg",onClick:()=>kr(),onError:us=>{us.target.src="https://placehold.co/150"}})]}),jsxRuntimeExports.jsx("div",{role:"button",tabIndex:Xr?-1:0,"aria-hidden":Xr,"aria-label":"Close",className:"closeContainer closeButton",onClick:()=>_e.exitSelectedItem(),children:jsxRuntimeExports.jsx("img",{alt:"Close",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/X.svg",onError:us=>{us.target.src="https://placehold.co/150"}})})]}),a.length>0&&_e.sceneSettings.disableLocalColorOverride===!1&&jsxRuntimeExports.jsxs("div",{className:"contextColorContent",children:[jsxRuntimeExports.jsxs("span",{className:"colorSwatchTitle",children:["Select ",b]}),jsxRuntimeExports.jsx("div",{className:"color-grid color-variants-selection",children:a.map((us,hs)=>jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:Xr?-1:0,"aria-hidden":Xr,"aria-label":"Select "+us.label,onClick:async()=>{await _e.overrideSelectedItemMaterial(us.id),an(us.id)},className:Kt==us.id?"colorSelector selected":"colorSelector",children:[jsxRuntimeExports.jsx("div",{className:"colorThumbnailContainer",children:jsxRuntimeExports.jsxs("div",{className:"colorThumbnail",children:[jsxRuntimeExports.jsx("div",{className:"checkMark",children:jsxRuntimeExports.jsx("img",{alt:"Checkmark",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Check.svg",onError:ds=>{ds.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("img",{alt:us.label,className:"contextColorThumbnail",src:_e.getResolvedAssetUrl(us.thumbnail),onError:ds=>{ds.target.src="https://placehold.co/150"}})]})}),jsxRuntimeExports.jsx("div",{className:"colorDetails",children:jsxRuntimeExports.jsxs("p",{className:"truncate colorDetailsLabel",children:[capitalize$1(us.label),jsxRuntimeExports.jsx("br",{}),jsxRuntimeExports.jsx("span",{className:"redText",children:us.outOfStock?"OUT OF STOCK":jsxRuntimeExports.jsx("br",{})})]})})]},"Color-"+hs))})]}),jsxRuntimeExports.jsxs("div",{className:"contextButtons",children:[_e.canSelectedItemDrag()&&jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:Xr?-1:0,"aria-hidden":Xr,"aria-label":"Remove Button",onClick:()=>{_e.doesSelectedItemHasAttachedDependency()?_e.triggerItemRemoveModal(s.itemData.guid):_e.removeSelectedItem()},children:[jsxRuntimeExports.jsx("img",{src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/TrashSimple.svg",alt:"Remove",onError:us=>{us.target.src="https://placehold.co/150"}}),jsxRuntimeExports.jsx("span",{children:"Remove"})]}),_e.canSelectedItemRotate()&&jsxRuntimeExports.jsxs("div",{role:"button","aria-label":"Rotate Button",tabIndex:Xr?-1:0,"aria-hidden":Xr,onClick:()=>_e.rotateSelectedItem(),children:[jsxRuntimeExports.jsx("img",{alt:"Rotate",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Rotate.svg",onError:us=>{us.target.src="https://placehold.co/150"}}),jsxRuntimeExports.jsx("span",{children:"Rotate"})]})]})]})})})})},ContextMenuMobile=({stores:o,selectedItemData:s,contextMenuDrawerOpen:a,dismissContextMenuDrawer:b,colors:_e,colorsCategoryName:Kt})=>{const[an,_n]=reactExports.useState(a),On=reactExports.useRef(null),$n=o.uiSceneStore(Or=>Or.CORE_API),dr=o.uiSceneStore(Or=>Or.isScreenPortrait),[fr,pr]=reactExports.useState(null);reactExports.useEffect(()=>{On.current&&On.current.addEventListener("drawerClosed",()=>{b()})},[On]),reactExports.useEffect(()=>(_n(a),()=>{}),[a]),reactExports.useEffect(()=>{$n.isMobile&&o.uiSceneStore.setState({dialogPopupOpen:an})},[an]),reactExports.useEffect(()=>{!s||!s.itemData||(s.overrideVariant?pr(s.overrideVariant):pr(s.currentVariant))},[s]);async function Ar(){$n.doesSelectedItemHasAttachedDependency()?$n.triggerItemRemoveModal(s.itemData.guid):(await $n.removeSelectedItem(),b())}return jsxRuntimeExports.jsx(BottomDrawer,{stores:o,id:"contextDrawer",ref:On,open:`${an}`,"initial-screen-coverage":"60%",children:jsxRuntimeExports.jsx("div",{className:"contextMenuDrawer epigraphDrawer",slot:"bottom-drawer-content",tabIndex:dr?0:-1,"aria-hidden":!dr,children:jsxRuntimeExports.jsxs("div",{className:"contextMenuParent interactable",children:[jsxRuntimeExports.jsx("div",{className:"contextContent",children:s&&s.itemData?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"contextContentNameDiv",children:jsxRuntimeExports.jsx("h3",{children:s.itemData.name})})}):""}),_e.length>0&&$n.sceneSettings.disableLocalColorOverride===!1&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("p",{className:"colorSwatchTitle",children:["Select ",Kt]}),jsxRuntimeExports.jsx("div",{className:"color-grid color-variants-selection",children:_e.map((Or,Xr)=>jsxRuntimeExports.jsxs("div",{role:"button","aria-label":"Select "+Or.label,tabIndex:an?0:-1,"aria-hidden":!an,onClick:async()=>{await o.uiSceneStore.getState().CORE_API.overrideSelectedItemMaterial(Or.id),pr(Or.id)},className:fr==Or.id?"colorSelector selected":"colorSelector",children:[jsxRuntimeExports.jsxs("div",{className:"colorThumbnailContainer",children:[jsxRuntimeExports.jsx("div",{className:"colorThumbnail",children:jsxRuntimeExports.jsx("img",{alt:Or.label,className:"colorThumbnailImg",src:$n.getResolvedAssetUrl(Or.thumbnail),onError:ss=>{ss.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("div",{className:"checkMark",children:jsxRuntimeExports.jsx("img",{alt:"Check",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Check.svg",onError:ss=>{ss.target.src="https://placehold.co/150"}})})]}),jsxRuntimeExports.jsx("div",{className:"colorDetails",children:jsxRuntimeExports.jsxs("p",{className:"truncate colorDetailsLabel",children:[capitalize$1(Or.label),jsxRuntimeExports.jsx("br",{}),jsxRuntimeExports.jsx("span",{className:"redText",children:Or.outOfStock?"OUT OF STOCK":jsxRuntimeExports.jsx("br",{})})]})})]},"Color-"+Xr))})]}),jsxRuntimeExports.jsxs("div",{className:"contextButtons",children:[$n.canSelectedItemBeRemoved()&&jsxRuntimeExports.jsxs("button",{role:"button",tabIndex:an?0:-1,"aria-hidden":!an,"aria-label":"Remove Button",onClick:()=>Ar(),children:[jsxRuntimeExports.jsx("img",{alt:"Remove",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Trash.svg",onError:Or=>{Or.target.src="https://placehold.co/150"}}),jsxRuntimeExports.jsx("span",{children:"Remove"})]}),$n.canSelectedItemRotate()&&jsxRuntimeExports.jsxs("button",{role:"button",tabIndex:an?0:-1,"aria-hidden":!an,"aria-label":"Rotate Button",onClick:()=>$n.rotateSelectedItem(),children:[jsxRuntimeExports.jsx("img",{alt:"Rotate",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Rotate.svg",onError:Or=>{Or.target.src="https://placehold.co/150"}}),jsxRuntimeExports.jsx("span",{children:"Rotate"})]})]})]})})})},ContextMenu=({stores:o,selectedItemData:s,contextMenuOpen:a,dismissContextMenuDrawer:b})=>{const _e=o.uiSceneStore(Ar=>Ar.CORE_API),[Kt,an]=reactExports.useState(!1),[_n,On]=reactExports.useState([]),[$n,dr]=reactExports.useState(""),fr=o.uiSceneStore(Ar=>Ar.inventoryData);reactExports.useEffect(()=>(an(a),()=>{}),[a]),reactExports.useEffect(()=>{if(On([]),s===void 0||!s.itemData||_e===null)return;const Ar=_e.getSelectedItemColors(),Or=_e.getInventoryInfo()[s.itemData.skuID];if(Ar.map(ss=>{ss.outOfStock=!1,Or[ss.id].countAvailable==0&&(ss.outOfStock=!0)}),On(Ar),Ar.length===0)return;const Xr=_e.categoryData;Xr.color&&Xr.color.map(ss=>{ss.looks.map(kr=>{kr===Ar[0].id&&dr(ss.label)})})},[s]),reactExports.useEffect(()=>{fr!=null&&pr(fr)},[fr]);const pr=reactExports.useCallback(Ar=>{const Or=_e.getSelectedItemData();if(Or==null)return;const Xr=_e.getSelectedItemColors(),ss=Ar[Or.itemData.skuID];Xr.map(kr=>{kr.outOfStock=!1,ss[kr.id].countAvailable==0&&(kr.outOfStock=!0)}),On(Xr)},[s]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:_e.isMobile&&window.innerWidth<=768?jsxRuntimeExports.jsx(ContextMenuMobile,{stores:o,selectedItemData:s,contextMenuDrawerOpen:Kt,dismissContextMenuDrawer:b,colors:_n,colorsCategoryName:$n}):Kt&&jsxRuntimeExports.jsx(ContextMenuDesktop,{stores:o,contextMenuDesktopOpen:Kt,selectedItemData:s,colors:_n,colorsCategoryName:$n})})},FullScreenModal=reactExports.forwardRef((o,s)=>{const a=reactExports.useRef(null),b=reactExports.useRef(null);reactExports.useEffect(()=>{s.current&&b.current&&a.current&&(s.current.show=_n=>Kt(),s.current.hide=_n=>an(),s.current.mainContainer=a.current,s.current.closeButton=b.current,_e())},[s,b,a]);const _e=()=>{b.current.addEventListener("click",()=>{o.onExit&&o.onExit(),an()})},Kt=()=>{a.current.classList.add("show"),o.stores.uiSceneStore.setState({dialogPopupOpen:!0}),b.current.focus()},an=()=>{o.stores.uiSceneStore.setState({dialogPopupOpen:!1}),a.current.classList.remove("show")};return jsxRuntimeExports.jsx("div",{id:o.id,ref:s,className:o.className,children:jsxRuntimeExports.jsx("div",{"aria-hidden":!o.open,ref:a,className:"full-screen-modal-container",children:jsxRuntimeExports.jsxs("div",{className:"modal-content-container",children:[jsxRuntimeExports.jsx("div",{role:"button","aria-hidden":!o.open,"aria-label":"Close Button",tabIndex:o.open?0:-1,ref:b,className:"close-button",children:jsxRuntimeExports.jsx("img",{alt:"Close",src:"https://storage.googleapis.com/gsc-epigraph-design/product-assets/Icon/X.svg",onError:_n=>{_n.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("slot",{name:"full-screen-dialog-content",children:o.children})]})})})});var lottie$1={exports:{}};(function(module,exports){typeof navigator<"u"&&function(o,s){module.exports=s()}(commonjsGlobal,function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(s){_useWebWorker=!!s},getWebWorker=function(){return _useWebWorker},setLocationHref=function(s){locationHref=s},getLocationHref=function(){return locationHref};function createTag(o){return document.createElement(o)}function extendPrototype(o,s){var a,b=o.length,_e;for(a=0;a<b;a+=1){_e=o[a].prototype;for(var Kt in _e)Object.prototype.hasOwnProperty.call(_e,Kt)&&(s.prototype[Kt]=_e[Kt])}}function getDescriptor(o,s){return Object.getOwnPropertyDescriptor(o,s)}function createProxyFunction(o){function s(){}return s.prototype=o,s}var audioControllerFactory=function(){function o(s){this.audios=[],this.audioFactory=s,this._volume=1,this._isMuted=!1}return o.prototype={addAudio:function(a){this.audios.push(a)},pause:function(){var a,b=this.audios.length;for(a=0;a<b;a+=1)this.audios[a].pause()},resume:function(){var a,b=this.audios.length;for(a=0;a<b;a+=1)this.audios[a].resume()},setRate:function(a){var b,_e=this.audios.length;for(b=0;b<_e;b+=1)this.audios[b].setRate(a)},createAudio:function(a){return this.audioFactory?this.audioFactory(a):window.Howl?new window.Howl({src:[a]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(a){this.audioFactory=a},setVolume:function(a){this._volume=a,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var a,b=this.audios.length;for(a=0;a<b;a+=1)this.audios[a].volume(this._volume*(this._isMuted?0:1))}},function(){return new o}}(),createTypedArray=function(){function o(a,b){var _e=0,Kt=[],an;switch(a){case"int16":case"uint8c":an=1;break;default:an=1.1;break}for(_e=0;_e<b;_e+=1)Kt.push(an);return Kt}function s(a,b){return a==="float32"?new Float32Array(b):a==="int16"?new Int16Array(b):a==="uint8c"?new Uint8ClampedArray(b):o(a,b)}return typeof Uint8ClampedArray=="function"&&typeof Float32Array=="function"?s:o}();function createSizedArray(o){return Array.apply(null,{length:o})}function _typeof$6(o){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$6=function(a){return typeof a}:_typeof$6=function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof$6(o)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};(function(){var o=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],s,a=o.length;for(s=0;s<a;s+=1)BMMath[o[s]]=Math[o[s]]})(),BMMath.random=Math.random,BMMath.abs=function(o){var s=_typeof$6(o);if(s==="object"&&o.length){var a=createSizedArray(o.length),b,_e=o.length;for(b=0;b<_e;b+=1)a[b]=Math.abs(o[b]);return a}return Math.abs(o)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function styleDiv(o){o.style.position="absolute",o.style.top=0,o.style.left=0,o.style.display="block",o.style.transformOrigin="0 0",o.style.webkitTransformOrigin="0 0",o.style.backfaceVisibility="visible",o.style.webkitBackfaceVisibility="visible",o.style.transformStyle="preserve-3d",o.style.webkitTransformStyle="preserve-3d",o.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(o,s,a,b){this.type=o,this.currentTime=s,this.totalTime=a,this.direction=b<0?-1:1}function BMCompleteEvent(o,s){this.type=o,this.direction=s<0?-1:1}function BMCompleteLoopEvent(o,s,a,b){this.type=o,this.currentLoop=a,this.totalLoops=s,this.direction=b<0?-1:1}function BMSegmentStartEvent(o,s,a){this.type=o,this.firstFrame=s,this.totalFrames=a}function BMDestroyEvent(o,s){this.type=o,this.target=s}function BMRenderFrameErrorEvent(o,s){this.type="renderFrameError",this.nativeError=o,this.currentTime=s}function BMConfigErrorEvent(o){this.type="configError",this.nativeError=o}var createElementID=function(){var o=0;return function(){return o+=1,idPrefix$1+"__lottie_element_"+o}}();function HSVtoRGB(o,s,a){var b,_e,Kt,an,_n,On,$n,dr;switch(an=Math.floor(o*6),_n=o*6-an,On=a*(1-s),$n=a*(1-_n*s),dr=a*(1-(1-_n)*s),an%6){case 0:b=a,_e=dr,Kt=On;break;case 1:b=$n,_e=a,Kt=On;break;case 2:b=On,_e=a,Kt=dr;break;case 3:b=On,_e=$n,Kt=a;break;case 4:b=dr,_e=On,Kt=a;break;case 5:b=a,_e=On,Kt=$n;break}return[b,_e,Kt]}function RGBtoHSV(o,s,a){var b=Math.max(o,s,a),_e=Math.min(o,s,a),Kt=b-_e,an,_n=b===0?0:Kt/b,On=b/255;switch(b){case _e:an=0;break;case o:an=s-a+Kt*(s<a?6:0),an/=6*Kt;break;case s:an=a-o+Kt*2,an/=6*Kt;break;case a:an=o-s+Kt*4,an/=6*Kt;break}return[an,_n,On]}function addSaturationToRGB(o,s){var a=RGBtoHSV(o[0]*255,o[1]*255,o[2]*255);return a[1]+=s,a[1]>1?a[1]=1:a[1]<=0&&(a[1]=0),HSVtoRGB(a[0],a[1],a[2])}function addBrightnessToRGB(o,s){var a=RGBtoHSV(o[0]*255,o[1]*255,o[2]*255);return a[2]+=s,a[2]>1?a[2]=1:a[2]<0&&(a[2]=0),HSVtoRGB(a[0],a[1],a[2])}function addHueToRGB(o,s){var a=RGBtoHSV(o[0]*255,o[1]*255,o[2]*255);return a[0]+=s/360,a[0]>1?a[0]-=1:a[0]<0&&(a[0]+=1),HSVtoRGB(a[0],a[1],a[2])}var rgbToHex=function(){var o=[],s,a;for(s=0;s<256;s+=1)a=s.toString(16),o[s]=a.length===1?"0"+a:a;return function(b,_e,Kt){return b<0&&(b=0),_e<0&&(_e=0),Kt<0&&(Kt=0),"#"+o[b]+o[_e]+o[Kt]}}(),setSubframeEnabled=function(s){subframeEnabled=!!s},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(s){expressionsPlugin=s},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(s){expressionsInterfaces=s},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(s){defaultCurveSegments=s},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(s){idPrefix$1=s};function createNS(o){return document.createElementNS(svgNS,o)}function _typeof$5(o){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$5=function(a){return typeof a}:_typeof$5=function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof$5(o)}var dataManager=function(){var o=1,s=[],a,b,_e={onmessage:function(){},postMessage:function(Ar){a({data:Ar})}},Kt={postMessage:function(Ar){_e.onmessage({data:Ar})}};function an(pr){if(window.Worker&&window.Blob&&getWebWorker()){var Ar=new Blob(["var _workerSelf = self; self.onmessage = ",pr.toString()],{type:"text/javascript"}),Or=URL.createObjectURL(Ar);return new Worker(Or)}return a=pr,_e}function _n(){b||(b=an(function(Ar){function Or(){function ss(ep,_f){var np,_l,Ml=ep.length,tp,El,sp,My;for(_l=0;_l<Ml;_l+=1)if(np=ep[_l],"ks"in np&&!np.completed){if(np.completed=!0,np.hasMask){var Py=np.masksProperties;for(El=Py.length,tp=0;tp<El;tp+=1)if(Py[tp].pt.k.i)fs(Py[tp].pt.k);else for(My=Py[tp].pt.k.length,sp=0;sp<My;sp+=1)Py[tp].pt.k[sp].s&&fs(Py[tp].pt.k[sp].s[0]),Py[tp].pt.k[sp].e&&fs(Py[tp].pt.k[sp].e[0])}np.ty===0?(np.layers=hs(np.refId,_f),ss(np.layers,_f)):np.ty===4?ds(np.shapes):np.ty===5&&Al(np)}}function kr(ep,_f){if(ep){var np=0,_l=ep.length;for(np=0;np<_l;np+=1)ep[np].t===1&&(ep[np].data.layers=hs(ep[np].data.refId,_f),ss(ep[np].data.layers,_f))}}function us(ep,_f){for(var np=0,_l=_f.length;np<_l;){if(_f[np].id===ep)return _f[np];np+=1}return null}function hs(ep,_f){var np=us(ep,_f);return np?np.layers.__used?JSON.parse(JSON.stringify(np.layers)):(np.layers.__used=!0,np.layers):null}function ds(ep){var _f,np=ep.length,_l,Ml;for(_f=np-1;_f>=0;_f-=1)if(ep[_f].ty==="sh")if(ep[_f].ks.k.i)fs(ep[_f].ks.k);else for(Ml=ep[_f].ks.k.length,_l=0;_l<Ml;_l+=1)ep[_f].ks.k[_l].s&&fs(ep[_f].ks.k[_l].s[0]),ep[_f].ks.k[_l].e&&fs(ep[_f].ks.k[_l].e[0]);else ep[_f].ty==="gr"&&ds(ep[_f].it)}function fs(ep){var _f,np=ep.i.length;for(_f=0;_f<np;_f+=1)ep.i[_f][0]+=ep.v[_f][0],ep.i[_f][1]+=ep.v[_f][1],ep.o[_f][0]+=ep.v[_f][0],ep.o[_f][1]+=ep.v[_f][1]}function Gs(ep,_f){var np=_f?_f.split("."):[100,100,100];return ep[0]>np[0]?!0:np[0]>ep[0]?!1:ep[1]>np[1]?!0:np[1]>ep[1]?!1:ep[2]>np[2]?!0:np[2]>ep[2]?!1:null}var ga=function(){var ep=[4,4,14];function _f(_l){var Ml=_l.t.d;_l.t.d={k:[{s:Ml,t:0}]}}function np(_l){var Ml,tp=_l.length;for(Ml=0;Ml<tp;Ml+=1)_l[Ml].ty===5&&_f(_l[Ml])}return function(_l){if(Gs(ep,_l.v)&&(np(_l.layers),_l.assets)){var Ml,tp=_l.assets.length;for(Ml=0;Ml<tp;Ml+=1)_l.assets[Ml].layers&&np(_l.assets[Ml].layers)}}}(),So=function(){var ep=[4,7,99];return function(_f){if(_f.chars&&!Gs(ep,_f.v)){var np,_l=_f.chars.length;for(np=0;np<_l;np+=1){var Ml=_f.chars[np];Ml.data&&Ml.data.shapes&&(ds(Ml.data.shapes),Ml.data.ip=0,Ml.data.op=99999,Ml.data.st=0,Ml.data.sr=1,Ml.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},_f.chars[np].t||(Ml.data.shapes.push({ty:"no"}),Ml.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}}(),go=function(){var ep=[5,7,15];function _f(_l){var Ml=_l.t.p;typeof Ml.a=="number"&&(Ml.a={a:0,k:Ml.a}),typeof Ml.p=="number"&&(Ml.p={a:0,k:Ml.p}),typeof Ml.r=="number"&&(Ml.r={a:0,k:Ml.r})}function np(_l){var Ml,tp=_l.length;for(Ml=0;Ml<tp;Ml+=1)_l[Ml].ty===5&&_f(_l[Ml])}return function(_l){if(Gs(ep,_l.v)&&(np(_l.layers),_l.assets)){var Ml,tp=_l.assets.length;for(Ml=0;Ml<tp;Ml+=1)_l.assets[Ml].layers&&np(_l.assets[Ml].layers)}}}(),xo=function(){var ep=[4,1,9];function _f(_l){var Ml,tp=_l.length,El,sp;for(Ml=0;Ml<tp;Ml+=1)if(_l[Ml].ty==="gr")_f(_l[Ml].it);else if(_l[Ml].ty==="fl"||_l[Ml].ty==="st")if(_l[Ml].c.k&&_l[Ml].c.k[0].i)for(sp=_l[Ml].c.k.length,El=0;El<sp;El+=1)_l[Ml].c.k[El].s&&(_l[Ml].c.k[El].s[0]/=255,_l[Ml].c.k[El].s[1]/=255,_l[Ml].c.k[El].s[2]/=255,_l[Ml].c.k[El].s[3]/=255),_l[Ml].c.k[El].e&&(_l[Ml].c.k[El].e[0]/=255,_l[Ml].c.k[El].e[1]/=255,_l[Ml].c.k[El].e[2]/=255,_l[Ml].c.k[El].e[3]/=255);else _l[Ml].c.k[0]/=255,_l[Ml].c.k[1]/=255,_l[Ml].c.k[2]/=255,_l[Ml].c.k[3]/=255}function np(_l){var Ml,tp=_l.length;for(Ml=0;Ml<tp;Ml+=1)_l[Ml].ty===4&&_f(_l[Ml].shapes)}return function(_l){if(Gs(ep,_l.v)&&(np(_l.layers),_l.assets)){var Ml,tp=_l.assets.length;for(Ml=0;Ml<tp;Ml+=1)_l.assets[Ml].layers&&np(_l.assets[Ml].layers)}}}(),Mo=function(){var ep=[4,4,18];function _f(_l){var Ml,tp=_l.length,El,sp;for(Ml=tp-1;Ml>=0;Ml-=1)if(_l[Ml].ty==="sh")if(_l[Ml].ks.k.i)_l[Ml].ks.k.c=_l[Ml].closed;else for(sp=_l[Ml].ks.k.length,El=0;El<sp;El+=1)_l[Ml].ks.k[El].s&&(_l[Ml].ks.k[El].s[0].c=_l[Ml].closed),_l[Ml].ks.k[El].e&&(_l[Ml].ks.k[El].e[0].c=_l[Ml].closed);else _l[Ml].ty==="gr"&&_f(_l[Ml].it)}function np(_l){var Ml,tp,El=_l.length,sp,My,Py,Ny;for(tp=0;tp<El;tp+=1){if(Ml=_l[tp],Ml.hasMask){var wy=Ml.masksProperties;for(My=wy.length,sp=0;sp<My;sp+=1)if(wy[sp].pt.k.i)wy[sp].pt.k.c=wy[sp].cl;else for(Ny=wy[sp].pt.k.length,Py=0;Py<Ny;Py+=1)wy[sp].pt.k[Py].s&&(wy[sp].pt.k[Py].s[0].c=wy[sp].cl),wy[sp].pt.k[Py].e&&(wy[sp].pt.k[Py].e[0].c=wy[sp].cl)}Ml.ty===4&&_f(Ml.shapes)}}return function(_l){if(Gs(ep,_l.v)&&(np(_l.layers),_l.assets)){var Ml,tp=_l.assets.length;for(Ml=0;Ml<tp;Ml+=1)_l.assets[Ml].layers&&np(_l.assets[Ml].layers)}}}();function yl(ep){ep.__complete||(xo(ep),ga(ep),So(ep),go(ep),Mo(ep),ss(ep.layers,ep.assets),kr(ep.chars,ep.assets),ep.__complete=!0)}function Al(ep){ep.t.a.length===0&&"m"in ep.t.p}var xl={};return xl.completeData=yl,xl.checkColors=xo,xl.checkChars=So,xl.checkPathProperties=go,xl.checkShapes=Mo,xl.completeLayers=ss,xl}if(Kt.dataManager||(Kt.dataManager=Or()),Kt.assetLoader||(Kt.assetLoader=function(){function ss(us){var hs=us.getResponseHeader("content-type");return hs&&us.responseType==="json"&&hs.indexOf("json")!==-1||us.response&&_typeof$5(us.response)==="object"?us.response:us.response&&typeof us.response=="string"?JSON.parse(us.response):us.responseText?JSON.parse(us.responseText):null}function kr(us,hs,ds,fs){var Gs,ga=new XMLHttpRequest;try{ga.responseType="json"}catch{}ga.onreadystatechange=function(){if(ga.readyState===4)if(ga.status===200)Gs=ss(ga),ds(Gs);else try{Gs=ss(ga),ds(Gs)}catch(So){fs&&fs(So)}};try{ga.open(["G","E","T"].join(""),us,!0)}catch{ga.open(["G","E","T"].join(""),hs+"/"+us,!0)}ga.send()}return{load:kr}}()),Ar.data.type==="loadAnimation")Kt.assetLoader.load(Ar.data.path,Ar.data.fullPath,function(ss){Kt.dataManager.completeData(ss),Kt.postMessage({id:Ar.data.id,payload:ss,status:"success"})},function(){Kt.postMessage({id:Ar.data.id,status:"error"})});else if(Ar.data.type==="complete"){var Xr=Ar.data.animation;Kt.dataManager.completeData(Xr),Kt.postMessage({id:Ar.data.id,payload:Xr,status:"success"})}else Ar.data.type==="loadData"&&Kt.assetLoader.load(Ar.data.path,Ar.data.fullPath,function(ss){Kt.postMessage({id:Ar.data.id,payload:ss,status:"success"})},function(){Kt.postMessage({id:Ar.data.id,status:"error"})})}),b.onmessage=function(pr){var Ar=pr.data,Or=Ar.id,Xr=s[Or];s[Or]=null,Ar.status==="success"?Xr.onComplete(Ar.payload):Xr.onError&&Xr.onError()})}function On(pr,Ar){o+=1;var Or="processId_"+o;return s[Or]={onComplete:pr,onError:Ar},Or}function $n(pr,Ar,Or){_n();var Xr=On(Ar,Or);b.postMessage({type:"loadAnimation",path:pr,fullPath:window.location.origin+window.location.pathname,id:Xr})}function dr(pr,Ar,Or){_n();var Xr=On(Ar,Or);b.postMessage({type:"loadData",path:pr,fullPath:window.location.origin+window.location.pathname,id:Xr})}function fr(pr,Ar,Or){_n();var Xr=On(Ar,Or);b.postMessage({type:"complete",animation:pr,id:Xr})}return{loadAnimation:$n,loadData:dr,completeAnimation:fr}}(),ImagePreloader=function(){var o=function(){var kr=createTag("canvas");kr.width=1,kr.height=1;var us=kr.getContext("2d");return us.fillStyle="rgba(0,0,0,0)",us.fillRect(0,0,1,1),kr}();function s(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function a(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function b(kr,us,hs){var ds="";if(kr.e)ds=kr.p;else if(us){var fs=kr.p;fs.indexOf("images/")!==-1&&(fs=fs.split("/")[1]),ds=us+fs}else ds=hs,ds+=kr.u?kr.u:"",ds+=kr.p;return ds}function _e(kr){var us=0,hs=setInterval(function(){var ds=kr.getBBox();(ds.width||us>500)&&(this._imageLoaded(),clearInterval(hs)),us+=1}.bind(this),50)}function Kt(kr){var us=b(kr,this.assetsPath,this.path),hs=createNS("image");isSafari?this.testImageLoaded(hs):hs.addEventListener("load",this._imageLoaded,!1),hs.addEventListener("error",function(){ds.img=o,this._imageLoaded()}.bind(this),!1),hs.setAttributeNS("http://www.w3.org/1999/xlink","href",us),this._elementHelper.append?this._elementHelper.append(hs):this._elementHelper.appendChild(hs);var ds={img:hs,assetData:kr};return ds}function an(kr){var us=b(kr,this.assetsPath,this.path),hs=createTag("img");hs.crossOrigin="anonymous",hs.addEventListener("load",this._imageLoaded,!1),hs.addEventListener("error",function(){ds.img=o,this._imageLoaded()}.bind(this),!1),hs.src=us;var ds={img:hs,assetData:kr};return ds}function _n(kr){var us={assetData:kr},hs=b(kr,this.assetsPath,this.path);return dataManager.loadData(hs,function(ds){us.img=ds,this._footageLoaded()}.bind(this),function(){us.img={},this._footageLoaded()}.bind(this)),us}function On(kr,us){this.imagesLoadedCb=us;var hs,ds=kr.length;for(hs=0;hs<ds;hs+=1)kr[hs].layers||(!kr[hs].t||kr[hs].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(kr[hs]))):kr[hs].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(kr[hs]))))}function $n(kr){this.path=kr||""}function dr(kr){this.assetsPath=kr||""}function fr(kr){for(var us=0,hs=this.images.length;us<hs;){if(this.images[us].assetData===kr)return this.images[us].img;us+=1}return null}function pr(){this.imagesLoadedCb=null,this.images.length=0}function Ar(){return this.totalImages===this.loadedAssets}function Or(){return this.totalFootages===this.loadedFootagesCount}function Xr(kr,us){kr==="svg"?(this._elementHelper=us,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}function ss(){this._imageLoaded=s.bind(this),this._footageLoaded=a.bind(this),this.testImageLoaded=_e.bind(this),this.createFootageData=_n.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return ss.prototype={loadAssets:On,setAssetsPath:dr,setPath:$n,loadedImages:Ar,loadedFootages:Or,destroy:pr,getAsset:fr,createImgData:an,createImageData:Kt,imageLoaded:s,footageLoaded:a,setCacheType:Xr},ss}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(s,a){if(this._cbs[s])for(var b=this._cbs[s],_e=0;_e<b.length;_e+=1)b[_e](a)},addEventListener:function(s,a){return this._cbs[s]||(this._cbs[s]=[]),this._cbs[s].push(a),function(){this.removeEventListener(s,a)}.bind(this)},removeEventListener:function(s,a){if(!a)this._cbs[s]=null;else if(this._cbs[s]){for(var b=0,_e=this._cbs[s].length;b<_e;)this._cbs[s][b]===a&&(this._cbs[s].splice(b,1),b-=1,_e-=1),b+=1;this._cbs[s].length||(this._cbs[s]=null)}}};var markerParser=function(){function o(s){for(var a=s.split(`\r
|
|
8818
|
+
`;tp(Ry)},[Ml]),mA=reactExports.useCallback(()=>{$n.isMobile!==!0&&My!==!0&&(Py(!0),!(!o.uiSceneStore.getState().CORE_API.sceneSettings.clickToAddUi&&!ga)&&(El===!0?(tp(null),a(_n)):PA()))},[El,My,Ml]),FA=reactExports.useCallback(()=>{$n.isMobile===!0||(Py(!1),!o.uiSceneStore.getState().CORE_API.sceneSettings.clickToAddUi&&!ga)||o.coreSceneStore.getState().mouseDragging||El===!0&&Kt&&Kt()},[El,My]),GA=reactExports.useCallback(YA=>{El!==!1&&(YA.defaultPrevented===!0&&YA.preventDefault(),YA.stopPropagation(),o.coreSceneStore.setState({pointerDownPos:YA.touches&&YA.touches.length>0?YA.touches[0].clientX-o.wcRef.offsetLeft:YA.clientX,mouseDragging:!1,mouseDownImgSrc:$n.getResolvedAssetUrl(ep),mouseDownSkuID:_n,moveThreshold:10}))},[El,ep,np]),aE=reactExports.useCallback(YA=>{const pA=go.lookDetails[ss];pA.skuID=_n,pA.productCategory={id:go.categoryID,label:go.categoryLabel},$n.isMobile===!0?(pr(pA),Xr(!0)):(YA.stopPropagation(),El&&Kt&&Kt(),pr(pA),Xr(!0))},[El,ss,go]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("nav",{role:"none",className:On?"imageContainer active":"imageContainer",draggable:!1,children:[ga?jsxRuntimeExports.jsxs("div",{className:"incrementContentContainer",children:[jsxRuntimeExports.jsx("div",{id:"itemCard"+_n,className:"incrementContentOverlay ".concat(`${(El===!0||Ny>0)&&My===!0?"enabled-item-overlay":"disabled-item-overlay"}`),ref:fr}),jsxRuntimeExports.jsx("img",{alt:Mo,className:"incrementSkuIcon",tabIndex:-1,"aria-hidden":!0,src:$n.getResolvedAssetUrl(ep),onError:YA=>{YA.target.src="https://placehold.co/150"}}),jsxRuntimeExports.jsxs("div",{className:"incrementDecrementPanel",children:[jsxRuntimeExports.jsx("div",{role:"button","aria-label":"Decrement Button","aria-hidden":!s||Ny==0||Ar||dr||Or||!b||!El,tabIndex:s&&Ny!==0&&!Ar&&!dr&&!Or&&b==!0&&El?0:-1,className:"incrementMinusSign ".concat(`${Ny===0?"incrementSignDisable":""}`),onClick:Wy,onMouseEnter:YA=>Py(!0),onMouseLeave:YA=>Py(!1),children:jsxRuntimeExports.jsx("img",{alt:"Decrement",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Minus.svg",onError:YA=>{YA.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("div",{className:"incrementCount",children:Ny}),jsxRuntimeExports.jsx("div",{role:"button","aria-label":"Increment","aria-hidden":!s||Ar||dr||Or||!b||!El,tabIndex:s&&!Ar&&!dr&&!Or&&b==!0&&El?0:-1,className:"incrementPlusSign ".concat(`${El===!0?"":"incrementSignDisable"}`),onClick:jA,onMouseEnter:mA,onMouseLeave:FA,children:jsxRuntimeExports.jsx("img",{alt:"Increment",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Plus.svg",onError:YA=>{YA.target.src="https://placehold.co/150"}})})]}),jsxRuntimeExports.jsx("div",{className:"spawning-requirements-container",hidden:!(El===!1&&My===!0&&Ml),children:jsxRuntimeExports.jsx("p",{className:"spawning-requirements-text",children:Ml})})]}):jsxRuntimeExports.jsxs("div",{className:"contentContainer",role:"button","aria-label":"Add Button",tabIndex:s&&!Ar&&!dr&&!Or&&b==!0&&El?0:-1,"aria-hidden":!s||Ar||dr||Or||!b||!El,style:{pointerEvents:El?"all":"none"},onFocus:YA=>{an||mA(YA)},onBlur:YA=>{an||FA(YA)},onClick:jA,children:[jsxRuntimeExports.jsx("div",{id:"itemCard"+_n,className:"contentOverlay ".concat(`${El===!0&&My===!0?"enabled-item-overlay":"disabled-item-overlay"}`),ref:fr,onTouchStart:GA,onMouseEnter:mA,onMouseLeave:FA,onMouseDown:YA=>{np!==!1&&GA(YA)},children:jsxRuntimeExports.jsx("img",{alt:"Add "+Mo,draggable:!1,className:"addIcon",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Plus.svg",onError:YA=>{YA.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("img",{className:"product-image product-image-default-state ".concat(`${El===!1?"product-image-disabled":""}`),draggable:!1,alt:Mo,src:$n.getResolvedAssetUrl(ep),onError:YA=>{YA.target.src="https://placehold.co/150"}}),jsxRuntimeExports.jsx("div",{className:"spawning-requirements-container",hidden:!(El===!1&&My===!0&&Ml),children:jsxRuntimeExports.jsx("p",{className:"spawning-requirements-text",children:Ml})})]}),jsxRuntimeExports.jsxs("div",{role:"button","aria-label":"Info Button","aria-hidden":!s||Ar||dr||Or||!b,tabIndex:s&&!Ar&&!dr&&!Or&&b==!0?0:-1,className:$n.isMobile?"showAlways itemDetails":"itemDetails",onClick:aE,children:[jsxRuntimeExports.jsx("div",{className:"item-details-icon"}),jsxRuntimeExports.jsxs("div",{className:"item-card-text-parent",children:[Mo&&jsxRuntimeExports.jsx("p",{className:"skuName truncate",children:Mo}),Al&&jsxRuntimeExports.jsx("p",{className:"skuSubheading",children:Al})]})]})]})})},PreconfigCard=({stores:o,sideMenuOpen:s,onClick:a,configId:b,name:_e,thumbnailURL:Kt,accordionActive:an})=>{const _n=o.uiSceneStore(Or=>Or.CORE_API),On=o.infoStore(Or=>Or.infoModalOpen),$n=o.uiSceneStore(Or=>Or.dialogPopupOpen),dr=o.cartStore(Or=>Or.previewCartModalOpen),[fr,pr]=reactExports.useState(!1),Ar=reactExports.useCallback(Or=>{Or.stopPropagation(),a(b)},[]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"imageContainer",draggable:!1,children:[jsxRuntimeExports.jsxs("div",{className:Kt?"contentContainer preconfig":"contentContainer preconfig contentDisabled",children:[jsxRuntimeExports.jsx("div",{role:"button","aria-label":"Load Preconfiguration Button","aria-hidden":!s||$n||On||dr||!an,tabIndex:s&&!$n&&!On&&!dr&&an==!0?0:-1,id:"itemCard"+b,className:"contentOverlay ".concat(`${fr===!0?"enabled-item-overlay":"disabled-item-overlay"}`),onClick:Or=>Ar(Or),onFocus:()=>pr(!0),onBlur:()=>pr(!1),onMouseEnter:()=>pr(!0),onMouseLeave:()=>pr(!1),children:jsxRuntimeExports.jsx("img",{alt:"Add "+_e,draggable:!1,className:"addIcon",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Plus.svg"})}),jsxRuntimeExports.jsx("img",{className:"product-image product-image-default-state",draggable:!1,alt:_e,src:Kt,tabIndex:-1,"aria-hidden":!0})]}),jsxRuntimeExports.jsx("div",{className:_n.isMobile?"showAlways itemDetails":"itemDetails",children:jsxRuntimeExports.jsx("p",{className:"truncate",children:_e})})]})})};function BuildTabItemRow({stores:o,sideMenuOpen:s,element:a,index:b,visible:_e,elementsLength:Kt,spawnGhosts:an,spawnItem:_n,removeAllGhosts:On,infoModalOpen:$n,isMouseUsed:dr,setItemAllowed:fr,activeItems:pr}){const Ar=o.coreSceneStore(fs=>fs.sceneSettings),Or=reactExports.useRef(null),Xr=reactExports.useRef(null),ss=o.uiSceneStore(fs=>fs.dialogPopupOpen),kr=o.cartStore(fs=>fs.previewCartModalOpen),[us,hs]=reactExports.useState(!1),ds=reactExports.useCallback(()=>{if(!(!Xr.current||!Or.current)){if(Xr.current.style.maxHeight)Xr.current.style.maxHeight=null;else{if(a.skus.length>0&&Xr.current.scrollHeight<100)return;Xr.current.style.maxHeight=Xr.current.scrollHeight+"px"}Or.current.classList.toggle("buildUiAccordionActive"),Xr.current.classList.toggle("buildUiContentAccordionActive"),hs(!us)}},[Or,Xr,us]);return reactExports.useEffect(()=>{!Xr.current||!Or.current||b==0&&ds()},[Or,Xr]),jsxRuntimeExports.jsxs("div",{className:"subContainer topContainer",children:[Ar.accordionInBuildUi?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{role:"button","aria-label":"Toggle Accordion Button",onClick:ds,"aria-hidden":!s||ss||$n||kr||!_e,tabIndex:s&&!ss&&!$n&&!kr&&_e?0:-1,ref:Or,className:"buildUiAccordion",children:[jsxRuntimeExports.jsx("div",{className:"arrowUp",children:jsxRuntimeExports.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{x:"0.75",y:"0.6875",width:"28.7343",height:"28.7343",rx:"14.3672",stroke:"#CCCCCC",strokeWidth:"0.5"}),jsxRuntimeExports.jsx("path",{d:"M20.5029 12.8984L15.1172 18.2842L9.73145 12.8984",stroke:"#222222",strokeLinecap:"round",strokeLinejoin:"round"})]})}),jsxRuntimeExports.jsx("div",{className:"arrowDown",children:jsxRuntimeExports.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{x:"0.881836",y:"0.957031",width:"28.7343",height:"28.7343",rx:"14.3672",stroke:"#CCCCCC",strokeWidth:"0.5"}),jsxRuntimeExports.jsx("path",{d:"M9.86328 17.4795L15.249 12.0938L20.6347 17.4795",stroke:"#222222",strokeLinecap:"round",strokeLinejoin:"round"})]})}),jsxRuntimeExports.jsx("h4",{children:a.label})]}),jsxRuntimeExports.jsx("div",{ref:Xr,className:"sidemenuContent buildUiAccordionContent",children:jsxRuntimeExports.jsx("div",{className:"item-grid",children:a.skus.map(fs=>jsxRuntimeExports.jsx(ItemCard,{stores:o,skuId:fs,sideMenuOpen:s,accordionActive:_e&&us,categoryID:a.categoryID,spawnGhosts:an,spawnItem:_n,removeAllGhosts:On,modalOpen:$n,isMouseUsed:dr,categoryDataIndex:b,setItemAllowed:fr,active:pr.includes(fs)},"itemCardB"+fs))})})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h4",{className:"subheading",children:a.label}),jsxRuntimeExports.jsx("div",{className:"sidemenuContent",children:jsxRuntimeExports.jsx("div",{className:"item-grid",children:a.skus.map(fs=>jsxRuntimeExports.jsx(ItemCard,{stores:o,skuId:fs,sideMenuOpen:s,categoryID:a.categoryID,accordionActive:_e,spawnGhosts:an,spawnItem:_n,removeAllGhosts:On,isMouseUsed:dr,modalOpen:$n,categoryDataIndex:b,setItemAllowed:fr,active:pr.includes(fs)},"itemCardB"+fs))})})]}),b!==Kt-1?jsxRuntimeExports.jsx("div",{className:"itemGridDivider"}):""]})}function BuildTabItemRow_PreConfig({stores:o,sideMenuOpen:s,index:a,elementsLength:b,visible:_e,configsData:Kt,infoModalOpen:an,isMouseUsed:_n,onClick:On,label:$n}){const dr=o.coreSceneStore(hs=>hs.sceneSettings),fr=reactExports.useRef(null),pr=reactExports.useRef(null),Ar=o.uiSceneStore(hs=>hs.dialogPopupOpen),Or=o.cartStore(hs=>hs.previewCartModalOpen),Xr=o.uiSceneStore(hs=>hs.CORE_API),[ss,kr]=reactExports.useState(!1),us=reactExports.useCallback(()=>{!pr.current||!fr.current||(fr.current.classList.toggle("buildUiAccordionActive"),pr.current.classList.toggle("buildUiContentAccordionActive"),kr(!ss),pr.current.style.maxHeight?pr.current.style.maxHeight=null:pr.current.style.maxHeight=pr.current.scrollHeight+"px")},[fr,pr,ss]);return jsxRuntimeExports.jsxs("div",{className:"subContainer topContainer",children:[dr.accordionInBuildUi?jsxRuntimeExports.jsxs("nav",{children:[jsxRuntimeExports.jsxs("div",{role:"button","aria-label":"Toggle Accordion Button","aria-hidden":!s||Ar||an||Or||!_e,onClick:us,tabIndex:s&&!Ar&&!an&&!Or&&_e?0:-1,ref:fr,className:"buildUiAccordion",children:[jsxRuntimeExports.jsx("div",{className:"arrowUp",children:jsxRuntimeExports.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{x:"0.75",y:"0.6875",width:"28.7343",height:"28.7343",rx:"14.3672",stroke:"#CCCCCC",strokeWidth:"0.5"}),jsxRuntimeExports.jsx("path",{d:"M20.5029 12.8984L15.1172 18.2842L9.73145 12.8984",stroke:"#222222",strokeLinecap:"round",strokeLinejoin:"round"})]})}),jsxRuntimeExports.jsx("div",{className:"arrowDown",children:jsxRuntimeExports.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{x:"0.881836",y:"0.957031",width:"28.7343",height:"28.7343",rx:"14.3672",stroke:"#CCCCCC",strokeWidth:"0.5"}),jsxRuntimeExports.jsx("path",{d:"M9.86328 17.4795L15.249 12.0938L20.6347 17.4795",stroke:"#222222",strokeLinecap:"round",strokeLinejoin:"round"})]})}),jsxRuntimeExports.jsx("h4",{children:$n})]}),jsxRuntimeExports.jsx("div",{ref:pr,className:"sidemenuContent buildUiAccordionContent",children:jsxRuntimeExports.jsx("div",{className:"item-grid",children:Kt.map(hs=>jsxRuntimeExports.jsx(PreconfigCard,{stores:o,onClick:On,sideMenuOpen:s,accordionActive:_e&&ss,configId:hs.epgsharedconfigid,name:hs.name,thumbnailURL:Xr.getResolvedAssetUrl(hs.thumbnails.low)},"itemCardB"+hs.epgsharedconfigid))})})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h4",{className:"subheading",children:$n}),jsxRuntimeExports.jsx("div",{className:"sidemenuContent",children:jsxRuntimeExports.jsx("div",{className:"item-grid",children:Kt.map(hs=>jsxRuntimeExports.jsx(PreconfigCard,{stores:o,sideMenuOpen:s,onClick:On,accordionActive:_e,configId:hs.epgsharedconfigid,name:hs.name,thumbnailURL:Xr.getResolvedAssetUrl(hs.thumbnails.low)},"itemCardB"+hs.epgsharedconfigid))})})]}),a!==b-1?jsxRuntimeExports.jsx("div",{className:"itemGridDivider"}):""]})}function SecondMobileTabsHandler({stores:o,sideMenuOpen:s,index:a,label:b,activeTab:_e,tabsRef:Kt,mobileGrid:an}){const _n=reactExports.useCallback(On=>{if(an.current.scrollLeft===On)return;let $n,dr,fr,pr=!1;function Ar(Or){$n===void 0&&($n=Or);const Xr=Or-$n;if(dr!==Or){const ss=Xr/200;an.current.scrollLeft>On?(fr=(an.current.scrollLeft-On)*Math.min(ss,1),an.current.scrollLeft-=fr,an.current.scrollLeft===On&&(pr=!0)):an.current.scrollLeft<On&&(fr=(On-an.current.scrollLeft)*Math.min(ss,1),an.current.scrollLeft+=fr,an.current.scrollLeft===On&&(pr=!0))}Xr<200&&(dr=Or,!pr&&window.requestAnimationFrame(Ar))}window.requestAnimationFrame(Ar)},[]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("a",{className:_e===a?"mobileTab scrolled":"mobileTab",onClick:()=>_n(Kt.current[a].offsetLeft-15),role:"button",tabIndex:s?0:-1,"aria-hidden":!s,"aria-label":b+" Button",children:b})})}function MobileGrid({stores:o,sideMenuOpen:s,element:a,index:b,elementsLength:_e,spawnGhosts:Kt,spawnItem:an,removeAllGhosts:_n,infoModalOpen:On,setItemAllowed:$n,activeItems:dr,tabsRef:fr}){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("section",{id:`section-${a.categoryID}`,className:"mobileGridSection",ref:pr=>fr.current[b]=pr,children:a.skus.map(pr=>jsxRuntimeExports.jsx(ItemCard,{stores:o,skuId:pr,sideMenuOpen:s,categoryID:a.categoryID,spawnGhosts:Kt,spawnItem:an,removeAllGhosts:_n,modalOpen:On,setItemAllowed:$n,active:dr.includes(pr)},"itemCardB"+pr))},"mobileGridSection"+b),b!==_e-1?jsxRuntimeExports.jsx("div",{className:"itemGridDivider"}):""]})}function MobileGrid_PreConfig({stores:o,sideMenuOpen:s,index:a,elementsLength:b,tabsRef:_e,configsData:Kt,onClick:an}){const _n=o.uiSceneStore(On=>On.CORE_API);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("section",{id:"section-preconfig",className:"mobileGridSection",ref:On=>_e.current[a]=On,children:[Kt.map(On=>jsxRuntimeExports.jsx(PreconfigCard,{stores:o,sideMenuOpen:s,onClick:an,configId:On.epgsharedconfigid,name:On.name,thumbnailURL:_n.getResolvedAssetUrl(On.thumbnails.low)},"itemCardB"+On.epgsharedconfigid)),[...Array(5)].map((On,$n)=>$n<5-Kt.length?jsxRuntimeExports.jsx(PreconfigCard,{stores:o,sideMenuOpen:s,onClick:()=>{}},"emptyCard"+$n):null)]},"mobileGridSection"+a),a!==b-1?jsxRuntimeExports.jsx("div",{className:"itemGridDivider"}):""]})}const BuildUI=({stores:o,sideMenuOpen:s,visible:a,identifier:b})=>{const _e=o.productDataStore(_f=>_f.categoryData),[Kt,an]=reactExports.useState([]),[_n,On]=reactExports.useState(void 0),$n=o.uiSceneStore(_f=>_f.isScreenPortrait),dr=o.infoStore(_f=>_f.infoModalOpen),[fr,pr]=reactExports.useState(0),[Ar,Or]=reactExports.useState(!1),[Xr,ss]=reactExports.useState([]),kr=o.infoStore(_f=>_f.populateInfoObject),us=o.infoStore(_f=>_f.updateInfoModalOpen),hs=o.uiSceneStore(_f=>_f.CORE_API),ds=o.itemStore(_f=>_f.itemsSpawned),fs=o.itemStore(_f=>_f.defaultSceneItemCount),Gs=reactExports.useRef(null),[ga,So]=reactExports.useState(!1);reactExports.useEffect(()=>{const _f=()=>So(!0),np=()=>So(!1);return document.addEventListener("mousedown",_f),document.addEventListener("keydown",np),()=>{document.removeEventListener("mousedown",_f),document.removeEventListener("keydown",np)}},[]);const go=reactExports.useCallback(_f=>{let np=[];for(const[_l,Ml]of Object.entries(_f))np.push(Ml);ss(np)},[]);addCoreEventListener(o,hs.EVENTS.UI.ContextMenu_InfoBtnClicked,_f=>{const np=_f.itemData.lookDetails[_f.currentVariant],_l=np;_l.price=np.price,_l.id=_f.currentVariant,_l.productCategory={id:_f.itemData.categoryID,label:_f.itemData.categoryLabel},kr(_l),us(!0)}),addCoreEventListener(o,hs.EVENTS.SCENE.ReplaceableCategory_Updated,go),reactExports.useEffect(()=>{const _f=hs.getCurrentItemsInReplaceableCategory();return go(_f),()=>{}},[hs]),reactExports.useEffect(()=>{Object.keys(_e).length!==0&&(an(_e.build),_e.preconfiguration!==void 0&&_e.preconfiguration.configsData!=null&&On(_e.preconfiguration))},[_e]);const xo=reactExports.useCallback((_f,np)=>{o.uiSceneStore.getState().CORE_API.spawnItemBySkuID(_f,np)},[]),Mo=reactExports.useCallback(_f=>{_n.openConfirmationPopup===!1||Object.keys(ds).length<=fs?o.uiSceneStore.getState().CORE_API.loadSceneFromConfigurationID(_f,!1):(o.uiSceneStore.setState({loadConfigId:_f}),o.uiSceneStore.getState().setLoadConfigModalOpen(!0))},[_n,fs,ds]),yl=reactExports.useCallback(_f=>{o.uiSceneStore.getState().CORE_API.spawnGhostsForSkuID(_f,!1,1)},[]),Al=reactExports.useCallback(_f=>{dr||o.uiSceneStore.getState().CORE_API.removeAllGhosts(_f)},[dr]),xl=reactExports.useRef([]);reactExports.useEffect(()=>{if(!Kt)return;let _f=Kt.length;_n!==void 0&&(_f+=1),xl.current=xl.current.slice(0,_f)},[Kt,_n]);const ep=reactExports.useCallback(()=>{let _f=-3e3,np=-1,_l=Kt.length;_n!==void 0&&(_l+=1);for(let Ml=0;Ml<_l;Ml++){let tp=xl.current[Ml].getBoundingClientRect().left;tp<28&&_f<tp&&(_f=tp,np=Ml)}np!==-1&&pr(np)},[xl,Kt,_n]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"mobileTabContent",hidden:!a,tabIndex:$n?0:-1,"aria-hidden":!$n,children:jsxRuntimeExports.jsxs("div",{className:"scrollSpyTabs",children:[jsxRuntimeExports.jsxs("div",{className:"secondMobileTabs",children:[Object.keys(Kt).map((_f,np)=>jsxRuntimeExports.jsx(SecondMobileTabsHandler,{stores:o,sideMenuOpen:s,index:np,label:Kt[_f].label,activeTab:fr,tabsRef:xl,mobileGrid:Gs},"mobileTabs"+_f)),_n!==void 0&&jsxRuntimeExports.jsx(SecondMobileTabsHandler,{stores:o,sideMenuOpen:s,index:Kt.length,label:_n.label,activeTab:fr,tabsRef:xl,mobileGrid:Gs},"preconfiguration_mobileTabs")]}),jsxRuntimeExports.jsxs("div",{className:"mobileGrid",ref:Gs,onScroll:ep,children:[Kt.map((_f,np)=>jsxRuntimeExports.jsx(MobileGrid,{stores:o,sideMenuOpen:s,element:_f,index:np,spawnGhosts:yl,spawnItem:xo,removeAllGhosts:Al,infoModalOpen:dr,setItemAllowed:Or,activeItems:Xr,tabsRef:xl,elementsLength:_n!==void 0?Kt.length+1:Kt.length},"mobileGrid"+np)),_n!==void 0&&jsxRuntimeExports.jsx(MobileGrid_PreConfig,{stores:o,sideMenuOpen:s,onClick:Mo,configsData:_n.configsData,tabsRef:xl,index:Kt.length,elementsLength:Kt.length+1},"preconfiguration_mobileGrid")]})]})}),jsxRuntimeExports.jsxs("div",{className:"container desktop",hidden:!a,tabIndex:$n?-1:0,"aria-hidden":$n,children:[Kt.map((_f,np)=>jsxRuntimeExports.jsx(BuildTabItemRow,{stores:o,sideMenuOpen:s,element:_f,index:np,visible:a,spawnGhosts:yl,spawnItem:xo,removeAllGhosts:Al,infoModalOpen:dr,isMouseUsed:ga,setItemAllowed:Or,activeItems:Xr,elementsLength:Kt.length},`category_${_f.categoryID}_${np}`)),_n!==void 0&&jsxRuntimeExports.jsx(BuildTabItemRow_PreConfig,{stores:o,sideMenuOpen:s,onClick:Mo,visible:a,configsData:_n.configsData,infoModalOpen:dr,isMouseUsed:ga,label:_n.label,index:Kt.length,elementsLength:Kt.length+1},"preconfiguration_desktopCategory")]})]})},handleGlobalVariantSwitch=(o,s,a)=>{o.uiSceneStore.getState().CORE_API.switchGlobalVariant(s,a)};function Divider$1(o,s){return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:o!==s.length-1?jsxRuntimeExports.jsx("div",{className:"itemGridDivider"}):""})}const Color=({stores:o,visible:s})=>{const a=o.productDataStore($n=>$n.categoryData),b=o.colorStore($n=>$n.allActiveVariants),_e=o.uiSceneStore($n=>$n.materialOverrideExists),Kt=o.uiSceneStore($n=>$n.CORE_API),an=o.cartStore($n=>$n.previewCartModalOpen),_n=o.uiSceneStore($n=>$n.dialogPopupOpen),On=reactExports.useCallback(()=>{o.uiSceneStore.getState().CORE_API.removeAllVariantOverrides()},[]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"container desktop",style:{height:"auto"},hidden:!s,children:[_e&&jsxRuntimeExports.jsx("button",{tabIndex:!_n&&!an&&_e&&s?0:-1,className:"removeAllColorOverridesButton",role:"button","aria-hidden":!_e||_n||an||!s,"aria-label":"Remove All Overrides Button",onClick:On,disabled:!_e,children:"Remove all overrides"}),a.color.map(($n,dr)=>jsxRuntimeExports.jsxs("div",{className:"subContainer topContainer",children:[jsxRuntimeExports.jsx("h4",{className:"subheading",children:$n.label}),jsxRuntimeExports.jsx("div",{className:"sidemenuContent",children:jsxRuntimeExports.jsx("div",{className:"color-grid color-variants-selection",children:$n.looks.map((fr,pr)=>jsxRuntimeExports.jsxs("div",{tabIndex:!_n&&!an&&s?0:-1,onClick:()=>handleGlobalVariantSwitch(o,$n.id,fr),role:"button","aria-hidden":_n||an||!s,"aria-label":o.productDataStore.getState().lookData[fr]?.label+" Button",className:b[$n.id]==fr?"colorSelector selected":"colorSelector",children:[jsxRuntimeExports.jsx("div",{className:"colorThumbnailContainer",children:jsxRuntimeExports.jsxs("div",{className:"colorThumbnail",children:[jsxRuntimeExports.jsx("div",{className:"checkMark",children:jsxRuntimeExports.jsx("img",{alt:"Check",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Check.svg",onError:Ar=>{Ar.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("img",{alt:o.productDataStore.getState().lookData[fr]?.label,className:"contextColorThumbnail",src:Kt.getResolvedAssetUrl(o.productDataStore.getState().lookData[fr]?.thumbnail),onError:Ar=>{Ar.target.src="https://placehold.co/150"}})]})}),jsxRuntimeExports.jsxs("div",{className:"colorDetails",children:[jsxRuntimeExports.jsx("p",{className:"truncate colorDetailsLabel",children:capitalize$1(o.productDataStore.getState().lookData[fr]?.label)}),jsxRuntimeExports.jsx("p",{className:"truncate colorDetailsLabel",children:capitalize$1(o.productDataStore.getState().lookData[fr]?.accent)})]})]},"Color-"+pr))})}),jsxRuntimeExports.jsx(Divider$1,{})]},`${$n.label}-${dr}`))]})})};function scrollToTop(o,s,a){let b=s.clientHeight,_e=b*a;if(o.current.scrollTop===_e)return;let Kt=null;const an=500,_n=o.current.scrollTop;function On(dr){b=s.clientHeight,_e=b*a;let fr=_e-_n;Kt||(Kt=dr);const pr=dr-Kt,Ar=Math.min(pr/an,1);o.current.scrollTop=_n+fr*$n(Ar),Ar<1&&window.requestAnimationFrame(On)}function $n(dr){return dr<.5?2*dr*dr:-1+(4-2*dr)*dr}window.requestAnimationFrame(On)}function CarouselItem({stores:o,carouselTabKey:s,hotspotContentRef:a,defaultAltText:b}){const _e=reactExports.useRef(null),Kt=o.uiSceneStore(_n=>_n.CORE_API),an=_n=>{_n.target.style.width="100%"};return jsxRuntimeExports.jsx(SplideSlide,{children:jsxRuntimeExports.jsxs("div",{className:"carouselTabParent",ref:_e,children:[s.type==="img"&&jsxRuntimeExports.jsx("img",{src:Kt.getResolvedAssetUrl(s.link),alt:s.alt?s.alt:b,onLoad:_n=>an(_n),onError:_n=>{_n.target.src="https://placehold.co/150"}}),s.type==="video"&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("p",{className:"carouselVideoPlaceholderText",children:s.alt?s.alt:b}),jsxRuntimeExports.jsx("video",{src:Kt.getResolvedAssetUrl(s.link),muted:!0,loop:!0,autoPlay:!0,playsInline:!0,controls:!1,onLoad:_n=>an(_n)})]}),s.title&&jsxRuntimeExports.jsx("p",{className:"carouselTitle",children:s.title})]})},"SplideSlide-"+s.link)}function Tab({stores:o,sideMenuOpen:s,tabs:a,tabKey:b,index:_e,activeFeatureID:Kt}){const[an,_n]=reactExports.useState([]),On=reactExports.useRef(null),$n=reactExports.useRef(null),dr=reactExports.useRef(null),fr=o.cartStore(us=>us.previewCartModalOpen),pr=o.uiSceneStore(us=>us.dialogPopupOpen),[Ar,Or]=reactExports.useState(!1),Xr=reactExports.useCallback(us=>{o.uiSceneStore.getState().CORE_API.clickHotspot("hotspot3D_"+us,{ignoreUI:!0})},[Kt]);reactExports.useEffect(()=>{let us=[],hs=b.hotspotData;for(let ds=0;ds<hs.carousel.length;ds++)hs.carousel[ds].type!==""&&hs.carousel[ds].link!==""&&(us=[...us,{...hs.carousel[ds],index:ds}]);_n(us)},[b]),reactExports.useEffect(()=>{const{current:us}=$n;us&&(Kt===us.id?(ss(us),Or(!0)):(kr(us),Or(!1)))},[Kt]);const ss=reactExports.useCallback(us=>{us.checked=!0,us.nextElementSibling.nextElementSibling.setAttribute("style","max-height: 800px;"),scrollToTop(a,us.nextElementSibling,_e)},[]),kr=reactExports.useCallback(us=>{us.nextElementSibling.nextElementSibling.setAttribute("style","max-height: 0px;"),us.checked=!1},[]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:b.hotspotData&&jsxRuntimeExports.jsxs("div",{className:"accordionTab",children:[jsxRuntimeExports.jsx("input",{tabIndex:s&&!pr&&!fr?0:-1,"aria-hidden":!s||pr||fr,type:"checkbox",name:"accordion",id:"rd_"+b.itemData.skuID+"_"+b.hotspotData.hotspotID,defaultChecked:!1,ref:$n,"aria-label":"Toggle Accordion for "+b.hotspotData.title,onClick:us=>{Xr(b.itemData.skuID+"_"+b.hotspotData.hotspotID,{ignoreUI:!1})}}),jsxRuntimeExports.jsxs("label",{className:"tab-label",htmlFor:"rd_"+b.itemData.skuID+"_"+b.hotspotData.hotspotID,children:[jsxRuntimeExports.jsx("span",{children:b.hotspotData.title}),jsxRuntimeExports.jsx("img",{alt:"Open Image for title "+b.hotspotData.title,className:"accordion-closed",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Plus.svg",onError:us=>{us.target.src="https://placehold.co/150"}}),jsxRuntimeExports.jsx("img",{alt:"Close Image for title "+b.hotspotData.title,className:"accordion-open",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Minus.svg",onError:us=>{us.target.src="https://placehold.co/150"}})]}),jsxRuntimeExports.jsx("div",{className:"tab-content",children:jsxRuntimeExports.jsx("div",{className:"hotspot-content",ref:dr,children:Ar&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ReactQuill$1,{className:"ignore",modules:{toolbar:!1},theme:"bubble",readOnly:!0,value:b.hotspotData.description}),an.length==1&&an[0].type!=""&&an[0].link!=""&&jsxRuntimeExports.jsx("ul",{children:jsxRuntimeExports.jsx(CarouselItem,{stores:o,carouselTabKey:an[0],index:0,defaultAltText:b.itemData.name?b.itemData.name:b.itemData.skuID,hotspotContentRef:dr},"carouselTabs_"+b.itemData.skuID+"_"+b.hotspotData.hotspotID+"_0")}),an.length>1&&jsxRuntimeExports.jsx("div",{className:"carousel",children:jsxRuntimeExports.jsx(Splide2,{options:{perPage:1,preloadPages:3},role:"none",ref:On,children:an.map((us,hs)=>us.type!=""&&us.link!=""&&jsxRuntimeExports.jsx(CarouselItem,{stores:o,carouselTabKey:us,defaultAltText:b.itemData.name?b.itemData.name:b.itemData.skuID,index:hs,hotspotContentRef:dr},"carouselTabs_"+b.itemData.skuID+"_"+b.hotspotData.hotspotID+"_"+us.index))})})]})})})]})})}const ProductFeaturesUI=({stores:o,sideMenuOpen:s,visible:a,identifier:b})=>{const _e=o.uiSceneStore(On=>On.tabSpawnCount),Kt=o.uiSceneStore(On=>On.isScreenPortrait),an=reactExports.useRef(null),_n=o.uiHotspotStore(On=>On.activeFeatureID);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"col desktop productFeatureUIDic",hidden:!a,tabIndex:a&&b=="featuresTab-mobile"&&Kt||b=="featuresTab-desktop"&&!Kt?0:-1,"aria-hidden":!a||b=="featuresTab-mobile"&&!Kt||b=="featuresTab-desktop"&&Kt,children:jsxRuntimeExports.jsxs("div",{className:"tabs",ref:an,children:[_e.length==0&&jsxRuntimeExports.jsx("div",{className:"tabEmptyText",children:"*Please add an item to the scene to see the features"}),_e.map((On,$n)=>jsxRuntimeExports.jsx(Tab,{stores:o,sideMenuOpen:s,tabs:an,activeFeatureID:_n,tabKey:On,index:$n},"tabs_"+On.itemData.skuID+"_"+On.hotspotData.hotspotID))]})})})},CartItem=({stores:o,itemObject:s})=>{const a=o.uiSceneStore(an=>an.CORE_API),b=o.uiSceneStore(an=>an.disableCart),[_e,Kt]=reactExports.useState(a.sceneSettings.currency);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:s.countUnavailable=="0"||b?"cartItem":"cartItem cartItemOutOfStock",draggable:!1,style:{display:s?"":"none"},children:[jsxRuntimeExports.jsx("div",{className:"cartItemImage",children:jsxRuntimeExports.jsx("img",{draggable:!1,src:a.getResolvedAssetUrl(s.thumbnails.review?s.thumbnails.review:s.thumbnails.low),alt:s.title,"aria-label":s.title,onError:an=>{an.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsxs("div",{className:"cartItemDetails",children:[jsxRuntimeExports.jsx("h4",{children:s.title}),s.subtitle?jsxRuntimeExports.jsx("h5",{children:s.subtitle}):jsxRuntimeExports.jsx("h5",{children:s.subheading}),jsxRuntimeExports.jsxs("div",{className:"cartRow",children:[jsxRuntimeExports.jsxs("span",{className:"itemCount",children:[a.sceneSettings.textSettings.cartQuantityText,":"," ",s.count]}),jsxRuntimeExports.jsxs("h3",{className:"itemPrice".concat(b===!0?" hide":""),children:[_e,parseFloat(s.price).toFixed(2)]}),s.compareAtPrice!=0&&s.compareAtPrice>s.price&&jsxRuntimeExports.jsxs("h3",{className:"itemCompareAtPrice".concat(b===!0?" hide":""),children:[_e,parseFloat(s.compareAtPrice).toFixed(2)]})]}),s.actionButton&&jsxRuntimeExports.jsx("span",{className:"actionButton",role:"button","aria-label":"Action Button",onClick:()=>a.actionButtonClicked(s),children:s.actionButton.text}),jsxRuntimeExports.jsxs("div",{className:"cartRow".concat(b===!0||s.countUnavailable=="0"?" hide":""),tabIndex:b===!0||s.countUnavailable=="0"?-1:0,"aria-hidden":b===!0||s.countUnavailable=="0",children:[jsxRuntimeExports.jsx("img",{className:"cartRowImage",alt:"Info",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Info_red.png",onError:an=>{an.target.src="https://placehold.co/150"}}),jsxRuntimeExports.jsxs("h3",{className:"itemAvailable",children:[s.countAvailable," IN STOCK"]}),jsxRuntimeExports.jsx("span",{className:"itemCount",children:"- quantities requested not available"})]})]})]})})},PreviewCart=({stores:o})=>{const s=o.cartStore(dr=>dr.cart),a=o.cartStore(dr=>dr.previewCartModalOpen),b=o.cartStore(dr=>dr.togglePreviewCartModal),_e=o.uiSceneStore(dr=>dr.CORE_API),Kt=o.uiSceneStore(dr=>dr.disableCart),an=o.uiSceneStore(dr=>dr.cartMessage),_n=o.uiSceneStore(dr=>dr.dialogPopupOpen),On=reactExports.useRef(null),$n=reactExports.useCallback(async()=>{await _e.checkoutAsync()},[]);return reactExports.useEffect(()=>{On.current&&a&&On.current.focus()},[a]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:a?"previewCartModal open":"previewCartModal",tabIndex:!_n&&a?0:-1,"aria-hidden":_n||!a,children:[jsxRuntimeExports.jsxs("div",{className:"previewCartModalChild",children:[jsxRuntimeExports.jsx("div",{role:"button",ref:On,className:"closeButton","aria-label":"Close Button",onClick:()=>{b()},children:jsxRuntimeExports.jsx("img",{alt:"Close",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/X.svg",onError:dr=>{dr.target.src="https://placehold.co/150"}})}),s.length<=0&&jsxRuntimeExports.jsx("h3",{className:"cartEmptyText",children:"Your cart is currently empty"}),s.length>0&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h2",{className:"cartTitle",children:_e.sceneSettings.textSettings.cartHeadingText}),jsxRuntimeExports.jsx("div",{className:"previewCartContentParentDiv",children:jsxRuntimeExports.jsx("div",{className:"previewCartContent",children:s.map((dr,fr)=>jsxRuntimeExports.jsx(CartItem,{stores:o,itemObject:dr,index:fr},`Cart Item-${fr}`))})})]})]}),jsxRuntimeExports.jsxs("div",{className:"checkButtonParentDiv".concat(Kt===!0?" hide":""),children:[an&&jsxRuntimeExports.jsx("div",{className:"cartMessageDiv",children:jsxRuntimeExports.jsx("span",{children:an})}),jsxRuntimeExports.jsx("div",{role:"button","aria-label":"Click to checkout the cart","aria-hidden":!a,tabIndex:a?0:-1,className:"checkoutButton",onClick:$n,children:jsxRuntimeExports.jsx("span",{children:_e.sceneSettings.addToCartCTAText})})]})]})})},InfoModal=({stores:o,visible:s})=>{const a=o.productDataStore(xl=>xl.categoryData),b=o.uiSceneStore(xl=>xl.dialogPopupOpen),_e=o.uiSceneStore(xl=>xl.isScreenPortrait),Kt=o.colorStore(xl=>xl.allActiveVariants),an=o.infoStore(xl=>xl.infoObject),_n=o.infoStore(xl=>xl.infoModalOpen),On=o.itemStore(xl=>xl.itemsSpawned),$n=o.infoStore(xl=>xl.updateInfoModalOpen),[dr,fr]=reactExports.useState(""),[pr,Ar]=reactExports.useState([]),[Or,Xr]=reactExports.useState(!1),ss=o.uiSceneStore(xl=>xl.CORE_API),kr=o.productDataStore(xl=>xl.productData),us=o.itemStore(xl=>xl.fittingSkuIds),[hs,ds]=reactExports.useState(!1),[fs,Gs]=reactExports.useState(0),ga=o.coreSceneStore(xl=>xl.sceneSettings),So=reactExports.useRef(null),go=reactExports.useCallback(()=>{fs<=0||!an.skuID||ss.removeLastItemBySkuId(an.skuID)},[fs,an]),xo=()=>{if(!On||!an.skuID)return;let xl=0;const ep=Object.keys(On);for(let _f=ep.length-1;_f>=0;_f--){const np=ep[_f];On[np].itemData.skuID===an.skuID&&xl++}Gs(xl)};reactExports.useEffect(()=>{xo()},[On,an]),reactExports.useEffect(()=>{Object.keys(a).length!=0&&Ar(a.build)},[a]),reactExports.useEffect(()=>(fr(Kt[Object.keys(Kt)[0]]),()=>{}),[Kt]),reactExports.useEffect(()=>{us.includes(an.skuID)?Xr(!0):Xr(!1)},[us,an]),reactExports.useEffect(()=>{if(!kr||!an.skuID)return;const xl=kr[an.skuID].incrementDecrementControl?kr[an.skuID].incrementDecrementControl:!1;ds(xl)},[kr,an]);const Mo=reactExports.useCallback(()=>{Or&&ss.spawnGhostsForSkuID(an.skuID,!1,1)},[an,Or]),yl=reactExports.useCallback(()=>{Or&&ss.removeAllGhosts(an.skuID)},[an,Or]),Al=reactExports.useCallback(()=>{Or&&ss.spawnItemBySkuID(an.skuID,!0)},[an,Or]);return reactExports.useEffect(()=>{So.current&&s&&_n&&So.current.focus()},[_n,s]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:_n&&s?"infoModal open":"infoModal",tabIndex:_n&&!_e?0:-1,"aria-hidden":!_n||_e,children:[jsxRuntimeExports.jsxs("a",{role:"button","aria-label":"Product Page Link Button","aria-hidden":b||!s||!_n||!an?.productPageUrl,tabIndex:!b&&s&&_n&&an?.productPageUrl?0:-1,ref:So,href:an.productPageUrl,className:"categoryLink",target:"_blank",style:an?.productPageUrl&&_n?{pointerEvents:"all"}:{pointerEvents:"none"},children:[jsxRuntimeExports.jsxs("h2",{className:"categoryTitle",children:[an?.productCategory?.label,an.subheading&&jsxRuntimeExports.jsx("div",{className:"modalSubHeading",children:an.subheading})]}),an.productPageUrl&&jsxRuntimeExports.jsx("img",{alt:"Open Product Page",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/OpenTab.svg",onError:xl=>{xl.target.src="https://placehold.co/150"}})]}),jsxRuntimeExports.jsx("div",{role:"button","aria-hidden":b||!s||!_n,tabIndex:!b&&s&&_n?0:-1,className:"closeButton","aria-label":"Close Button",onClick:()=>{$n(!1)},children:jsxRuntimeExports.jsx("img",{alt:"Close",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/X.svg",onError:xl=>{xl.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("div",{className:"infoModalImageContainer",children:an?.thumbnails?.high?jsxRuntimeExports.jsx("img",{alt:an.title,className:"itemImage","aria-label":an.title,src:ss.getResolvedAssetUrl(an.thumbnails.high),onError:xl=>{xl.target.src="https://placehold.co/150"}}):""}),jsxRuntimeExports.jsxs("div",{className:"infoModalTextContainer",children:[jsxRuntimeExports.jsx("h2",{className:"itemTitle",children:an.title}),jsxRuntimeExports.jsx("pre",{className:"itemDescription",children:an.description}),an.boundingBoxSize?jsxRuntimeExports.jsxs("p",{className:"infoModalDimensions",children:[an.boundingBoxSize.x.toFixed(1),"” W x"," ",an.boundingBoxSize.y.toFixed(1),"” D x"," ",an.boundingBoxSize.z.toFixed(1),"” H"]}):""]}),ga.addFromInfoModal&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:hs?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"infoModalIncrementDecrementParent incrementDecrementPanel",children:[jsxRuntimeExports.jsx("div",{role:"button","aria-label":"Decrement Button","aria-hidden":fs==0||b||!_n,tabIndex:fs!==0&&!b&&_n?0:-1,className:"incrementMinusSign ".concat(`${fs===0?"incrementSignDisable":""}`),onClick:go,children:jsxRuntimeExports.jsx("img",{alt:"Decrement",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Minus.svg",onError:xl=>{xl.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("div",{className:"incrementCount",children:fs}),jsxRuntimeExports.jsx("div",{role:"button","aria-label":"Increment Button","aria-hidden":b||!_n||!Or,tabIndex:!b&&_n&&Or?0:-1,className:"incrementPlusSign ".concat(`${Or===!0?"":"incrementSignDisable"}`),onClick:Al,onMouseEnter:Mo,onMouseLeave:yl,children:jsxRuntimeExports.jsx("img",{alt:"Increment",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Plus.svg",onError:xl=>{xl.target.src="https://placehold.co/150"}})})]})}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{role:"button","aria-label":"Add Button","aria-hidden":!Or||b||!_n,tabIndex:!b&&_n&&Or?0:-1,className:"infoModalAddButton ".concat(`${Or===!0?"enabledInfoModalAddButton":"disabledInfoModalAddButton"}`),onFocus:Mo,onBlur:yl,onMouseEnter:Mo,onMouseLeave:yl,onClick:Al,children:"Add"})})}),jsxRuntimeExports.jsx("div",{className:"infoModalActions",children:an.price&&jsxRuntimeExports.jsxs("button",{className:"item-price",disabled:!0,children:["$",numberWithCommas(parseFloat(an.price).toFixed(2))]})})]})})},handleGlobalGeometryVariantSwitch=(o,s,a)=>{o.uiSceneStore.getState().CORE_API.switchGlobalGeometryVariant(s,a)};function Divider(o,s){return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:o!==s.length-1?jsxRuntimeExports.jsx("div",{className:"itemGridDivider"}):""})}const GeometryVariants=({stores:o,visible:s})=>{const a=o.productDataStore(On=>On.categoryData),b=o.colorStore(On=>On.allActiveGeometryVariants),_e=o.uiSceneStore(On=>On.CORE_API),Kt=o.uiSceneStore(On=>On.isScreenPortrait),an=o.cartStore(On=>On.previewCartModalOpen),_n=o.uiSceneStore(On=>On.dialogPopupOpen);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"container desktop",style:{height:"auto"},hidden:!s,tabIndex:s&&!Kt?0:-1,"aria-hidden":!s||Kt,children:a.geometryVariants.map((On,$n)=>jsxRuntimeExports.jsxs("div",{className:"subContainer topContainer",children:[jsxRuntimeExports.jsx("h4",{className:"subheading",children:On.label}),jsxRuntimeExports.jsx("div",{className:"sidemenuContent",children:jsxRuntimeExports.jsx("div",{className:"color-grid geometry-variants-selection",children:Object.keys(On.variants).map((dr,fr)=>jsxRuntimeExports.jsxs("div",{tabIndex:!_n&&!an?0:-1,onClick:()=>handleGlobalGeometryVariantSwitch(o,On.id,dr),role:"button","aria-hidden":_n||an,"aria-label":On.variants[dr].label+" Button",className:b[On.id]==dr?"colorSelector selected":"colorSelector",children:[jsxRuntimeExports.jsx("div",{className:"colorThumbnailContainer",children:jsxRuntimeExports.jsxs("div",{className:"colorThumbnail",style:{borderRadius:"0%"},children:[jsxRuntimeExports.jsx("div",{className:"checkMark",children:jsxRuntimeExports.jsx("img",{alt:"Check",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Check.svg",onError:pr=>{pr.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("img",{alt:On.variants[dr].label,className:"contextColorThumbnail",src:_e.getResolvedAssetUrl(On.variants[dr].thumbnail),onError:pr=>{pr.target.src="https://placehold.co/150"}})]})}),jsxRuntimeExports.jsx("div",{className:"colorDetails",children:jsxRuntimeExports.jsx("p",{className:"truncate colorDetailsLabel",children:capitalize$1(On.variants[dr].label)})})]},"Color-"+fr))})}),jsxRuntimeExports.jsx(Divider,{})]},`${On.label}-${$n}`))})})},VariantMobile=({stores:o,sideMenuOpen:s,sortedVariantsTabOrder:a})=>{const b=o.productDataStore(go=>go.categoryData),_e=o.productDataStore(go=>go.lookData),Kt=o.colorStore(go=>go.allActiveVariants),an=o.uiSceneStore(go=>go.isScreenPortrait),_n=o.colorStore(go=>go.allActiveGeometryVariants),On=o.uiSceneStore(go=>go.materialOverrideExists),[$n,dr]=reactExports.useState(0),[fr,pr]=reactExports.useState(0);reactExports.useEffect(()=>{let go=0;a.includes("color")===!0&&(go+=b.color.length),a.includes("geometryVariants")===!0&&(go+=b.geometryVariants.length),pr(go)},[b]);const Ar=(go,xo,Mo)=>{go.uiSceneStore.getState().CORE_API.switchGlobalGeometryVariant(xo,Mo)},Or=(go,xo,Mo)=>{go.uiSceneStore.getState().CORE_API.switchGlobalVariant(xo,Mo)};function Xr({color:go,index:xo,elementId:Mo,allActiveVariants:yl}){return jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:s?0:-1,"aria-hidden":!s,"aria-label":_e[go]?.label+" Button",onClick:()=>Or(o,Mo,go),className:yl[Mo]==go?"colorSelector selected":"colorSelector",children:[jsxRuntimeExports.jsx("div",{className:"colorThumbnailContainer",children:jsxRuntimeExports.jsxs("div",{className:"colorThumbnail",children:[jsxRuntimeExports.jsx("div",{className:"checkMark",children:jsxRuntimeExports.jsx("img",{alt:"Check",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Check.svg",onError:Al=>{Al.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("img",{alt:_e[go]?.label,className:"contextColorThumbnail",src:o.uiSceneStore.getState().CORE_API.getResolvedAssetUrl(_e[go]?.thumbnail),onError:Al=>{Al.target.src="https://placehold.co/150"}})]})}),jsxRuntimeExports.jsx("div",{className:"colorDetails",children:jsxRuntimeExports.jsx("p",{className:"truncate-mobile colorDetailsLabel",children:capitalize$1(_e[go]?.label)})})]},"Color-"+xo)}function ss({variant:go,variantId:xo,index:Mo,elementId:yl,allActiveGeometryVariants:Al}){return jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:s?0:-1,"aria-hidden":!s,"aria-label":go.label+" Button",onClick:()=>Ar(o,yl,xo),className:Al[yl]==xo?"colorSelector selected":"colorSelector",children:[jsxRuntimeExports.jsx("div",{className:"colorThumbnailContainer",children:jsxRuntimeExports.jsxs("div",{className:"colorThumbnail",children:[jsxRuntimeExports.jsx("div",{className:"checkMark",children:jsxRuntimeExports.jsx("img",{alt:"Check",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Check.svg",onError:xl=>{xl.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("img",{alt:go.label,className:"contextColorThumbnail",src:o.uiSceneStore.getState().CORE_API.getResolvedAssetUrl(go.thumbnail),onError:xl=>{xl.target.src="https://placehold.co/150"}})]})}),jsxRuntimeExports.jsx("div",{className:"colorDetails",children:jsxRuntimeExports.jsx("p",{className:"truncate-mobile colorDetailsLabel",children:capitalize$1(go.label)})})]},"GeometryVariant-"+Mo)}function kr({variantType:go,element:xo,allActiveVariants:Mo,startIndex:yl}){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[go=="color"&&xo.looks.map((Al,xl)=>jsxRuntimeExports.jsx(Xr,{color:Al,index:xl,elementId:xo.id,allActiveVariants:Mo},"MobileGridInternal_"+xl)),go=="geometry"&&Object.keys(xo.variants).map((Al,xl)=>jsxRuntimeExports.jsx(ss,{variant:xo.variants[Al],index:xl,elementId:xo.id,variantId:Al,allActiveGeometryVariants:Mo},"MobileGridVariantInternal_"+xl))]})}const us=reactExports.useCallback(({index:go})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:go!==fr-1?jsxRuntimeExports.jsx("div",{className:"itemGridDivider"}):jsxRuntimeExports.jsx("div",{className:"itemGridPlaceholder"})}),[b,fr]),hs=reactExports.useCallback(()=>{o.uiSceneStore.getState().CORE_API.removeAllVariantOverrides()},[]),ds=reactExports.useCallback(go=>{if(Gs.current.scrollLeft===go)return;let xo,Mo,yl,Al=!1;function xl(ep){xo===void 0&&(xo=ep);const _f=ep-xo;if(Mo!==ep){const np=_f/200;Gs.current.scrollLeft>go?(yl=(Gs.current.scrollLeft-go)*Math.min(np,1),Gs.current.scrollLeft-=yl,Gs.current.scrollLeft===go&&(Al=!0)):Gs.current.scrollLeft<go&&(yl=(go-Gs.current.scrollLeft)*Math.min(np,1),Gs.current.scrollLeft+=yl,Gs.current.scrollLeft===go&&(Al=!0))}_f<200&&(Mo=ep,!Al&&window.requestAnimationFrame(xl))}window.requestAnimationFrame(xl)},[]),fs=reactExports.useRef([]);reactExports.useEffect(()=>{fs.current=fs.current.slice(0,fr)},[fr]);const Gs=reactExports.useRef(null),ga=reactExports.useCallback(({sideMenuOpen:go,categoryID:xo,label:Mo,index:yl,totalLength:Al})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("a",{role:"button",tabIndex:go?0:-1,"aria-hidden":!go,"aria-label":Mo+" Button",className:$n===yl?"mobileTab scrolled":"mobileTab",onClick:()=>{for(let xl=0;xl<Al;xl++)xl===yl&&ds(fs.current[xl].offsetLeft)},children:Mo})}),[$n,fs]),So=reactExports.useCallback(()=>{let go=-3e3,xo=-1;for(let Mo=0;Mo<fr;Mo++){let yl=fs.current[Mo].getBoundingClientRect().left;yl<28&&go<yl&&(go=yl,xo=Mo)}xo!==-1&&dr(xo)},[fs,b,fr]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"mobileTabContent",tabIndex:an?0:-1,"aria-hidden":!an,children:jsxRuntimeExports.jsxs("div",{className:"scrollSpyTabs",children:[jsxRuntimeExports.jsx("div",{className:"secondMobileTabs",children:a.map((go,xo)=>{if(go=="color")return b.color.map((Mo,yl)=>jsxRuntimeExports.jsx(ga,{sideMenuOpen:s,categoryID:Mo.id,label:Mo.label,index:xo==0?yl:a.includes("geometryVariants")?b.geometryVariants.length+yl:yl,totalLength:fr},"mobileTabsColors"+Mo.id));if(go=="geometryVariants")return b.geometryVariants.map((Mo,yl)=>jsxRuntimeExports.jsx(ga,{categoryID:Mo.id,label:Mo.label,index:xo==0?yl:a.includes("color")?b.color.length+yl:yl,totalLength:fr},"mobileTabsVariants"+Mo.id))})}),jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("div",{className:"mobileGrid mobileGridCenter",ref:Gs,onScroll:So,children:jsxRuntimeExports.jsxs("section",{className:"mobileGridSection",children:[On&&jsxRuntimeExports.jsxs("button",{role:"button",tabIndex:an&&On&&s?0:-1,"aria-label":"Remove All Overrides Button","aria-hidden":!an||!On||!s,onClick:hs,className:"removeAllColorOverridesButton",disabled:!On,children:[jsxRuntimeExports.jsx("div",{className:"iconContainer",children:jsxRuntimeExports.jsx("img",{src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/TrashSimple.svg",alt:"Remove",onError:go=>{go.target.src="https://placehold.co/150"}})}),"Remove all",jsxRuntimeExports.jsx("br",{}),"overrides"]}),a.map((go,xo)=>{if(go=="color")return b.color.map((Mo,yl)=>jsxRuntimeExports.jsxs("section",{className:"mobileGridCategorySection color-variants-selection",id:`section-${Mo.categoryID}`,ref:Al=>fs.current[xo==0?yl:a.includes("geometryVariants")?b.geometryVariants.length+yl:yl]=Al,children:[jsxRuntimeExports.jsx(kr,{variantType:"color",element:Mo,allActiveVariants:Kt},`mobileGrid-${Mo.categoryID}`),jsxRuntimeExports.jsx(us,{index:xo==0?yl:a.includes("geometryVariants")?b.geometryVariants.length+yl:yl},"divider"+Mo.categoryID)]},`sectionz-${Mo.categoryID}-${yl}`));if(go=="geometryVariants")return b.geometryVariants.map((Mo,yl)=>jsxRuntimeExports.jsxs("section",{className:"mobileGridCategorySection geometry-variants-selection",id:`section-${Mo.id}`,ref:Al=>fs.current[xo==0?yl:a.includes("color")?b.color.length+yl:yl]=Al,children:[jsxRuntimeExports.jsx(kr,{variantType:"geometry",element:Mo,allActiveVariants:_n},`mobileGrid-variants-${Mo.id}`),jsxRuntimeExports.jsx(us,{index:xo==0?yl:a.includes("color")?b.color.length+yl:yl},"divider-variants-"+Mo.id)]},`sectionz-variants-${Mo.id}-${yl}`))})]})})})]})})})},SideMenu=({stores:o,sideMenuOpen:s,sideMenuRef:a,toggleSideMenuOpen:b,configuratorWcRef:_e,PUBLIC_DESIGN_ASSETS_ENDPOINT:Kt,handleSideButtonClick:an,useTabIcon:_n,GENERIC_PROJECT_ASSET_DATA_ROOT_URL:On,sideMenuState:$n,togglePreviewCartModal:dr,getItemCount:fr,currency:pr})=>{const Ar=o.productDataStore(Gs=>Gs.hotspotsData),Or=o.cartStore(Gs=>Gs.previewCartModalOpen),Xr=o.uiSceneStore(Gs=>Gs.dialogPopupOpen),ss=o.productDataStore(Gs=>Gs.categoryData),kr=o.uiSceneStore(Gs=>Gs.disableCart),us=o.uiSceneStore(Gs=>Gs.CORE_API),hs=o.uiSceneStore(Gs=>Gs.isScreenPortrait),[ds,fs]=reactExports.useState([]);return reactExports.useEffect(()=>{const Gs=us.sceneSettings.variantsTabOrder,ga=Object.entries(Gs);ga.sort(([,go],[,xo])=>go.priority-xo.priority);const So=[];ga.forEach(([go,xo])=>{xo.enabled&&So.push(go)}),fs(So)},[us]),reactExports.useEffect(()=>{if(!o.uiSceneStore.getState().CORE_API.isMobile)return;const{current:Gs}=a;!Gs||_e.shadowRoot.getElementById("_leftShell")},[s,a]),jsxRuntimeExports.jsxs("div",{className:`sideMenu interactable ${s===!0?"":"side-menu-collapsed"}`,ref:a,children:[jsxRuntimeExports.jsxs("div",{className:s?"mobileExpandButton sideMenuOpen":"mobileExpandButton",tabIndex:hs?0:-1,"aria-hidden":!hs,children:[jsxRuntimeExports.jsx("span",{children:"Expand Configurator"}),jsxRuntimeExports.jsx("div",{role:"button",tabIndex:!s&&!Xr&&!Or?0:-1,"aria-hidden":s||Xr||Or,"aria-label":"Expand Menu",onClick:b,children:jsxRuntimeExports.jsx("img",{alt:"Down",src:Kt+"/Icon/ArrowDown.svg",onError:Gs=>{Gs.target.src="https://placehold.co/150"}})},"expandSideMenuButton")]}),jsxRuntimeExports.jsx("div",{className:s===!0?"sideMenuTabContainer":"sideMenuTabContainer side-menu-container-hide",tabIndex:hs?0:-1,"aria-hidden":!hs,children:jsxRuntimeExports.jsxs(Tabs,{className:"firstMobileTab",children:[jsxRuntimeExports.jsxs(TabList,{className:"firstMobileTabs","aria-label":"Mobile Tab List",children:[jsxRuntimeExports.jsx(Tab$1,{children:jsxRuntimeExports.jsxs("div",{className:"mobileTab",role:"button",tabIndex:!Or&&!Xr&&s?0:-1,"aria-hidden":Or||!s||Xr,"aria-label":"A button to select the "+us.sceneSettings.textSettings.buildTabHeadingText+" Tab",onClick:()=>{an(0)},children:[_n?jsxRuntimeExports.jsx("img",{className:"icon",alt:"Build",src:On+"/thumbnails/common-ui/BuildTabIcon.svg",onError:Gs=>{Gs.target.src="https://placehold.co/150"}}):"",us.sceneSettings.textSettings.buildTabHeadingText]})}),(ss.color.length>0||ss.geometryVariants.length>0)&&jsxRuntimeExports.jsx(Tab$1,{children:jsxRuntimeExports.jsxs("div",{className:"mobileTab",role:"button",tabIndex:!Or&&!Xr&&s?0:-1,"aria-hidden":Or||Xr||!s,"aria-label":us.sceneSettings.textSettings.colorTabHeadingText+" Button",onClick:()=>{an(1)},children:[_n?jsxRuntimeExports.jsx("img",{className:"icon",alt:"Color",src:On+"/thumbnails/common-ui/ColorTabIcon.svg",onError:Gs=>{Gs.target.src="https://placehold.co/150"}}):"",us.sceneSettings.textSettings.colorTabHeadingText]})}),Object.keys(Ar).length>0&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Tab$1,{children:jsxRuntimeExports.jsxs("div",{className:"mobileTab",role:"button",tabIndex:!Or&&!Xr&&s?0:-1,"aria-hidden":!s||Xr||Or,"aria-label":us.sceneSettings.textSettings.featuresTabHeadingText+" Button",onClick:()=>{an(2)},children:[_n?jsxRuntimeExports.jsx("img",{className:"icon",alt:"Features",src:On+"/thumbnails/common-ui/ProductFeaturesTabIcon.png",onError:Gs=>{Gs.target.src="https://placehold.co/150"}}):"",us.sceneSettings.textSettings.featuresTabHeadingText]})})}),jsxRuntimeExports.jsx("div",{role:"tab",className:"collapse-side-menu-button-parent",children:jsxRuntimeExports.jsx("div",{className:`collapse-side-menu-button ${s===!0?"":"set-display-none"}`,role:"button",tabIndex:!Or&&!Xr&&s?0:-1,"aria-hidden":Or||Xr||!s,"aria-label":"Collapse Menu",onClick:b,children:jsxRuntimeExports.jsx("img",{alt:"Down",src:Kt+"/Icon/ArrowDown.svg",onError:Gs=>{Gs.target.src="https://placehold.co/150"}})},"collapseSideMenuButton")})]}),jsxRuntimeExports.jsx(TabPanel,{children:jsxRuntimeExports.jsx(BuildUI,{stores:o,sideMenuOpen:s,identifier:"buildUI-mobile",sideMenuState:0})}),(ss.color.length>0||ss.geometryVariants.length>0)&&jsxRuntimeExports.jsx(TabPanel,{children:jsxRuntimeExports.jsx("div",{className:"variantContainer",children:jsxRuntimeExports.jsx(VariantMobile,{stores:o,sideMenuOpen:s,sortedVariantsTabOrder:ds})})}),Object.keys(Ar).length>0&&jsxRuntimeExports.jsx(TabPanel,{children:jsxRuntimeExports.jsx("div",{className:"featuresContainer",children:jsxRuntimeExports.jsx(ProductFeaturesUI,{stores:o,sideMenuOpen:s,identifier:"featuresTab-mobile",visible:$n===2})})})]})}),jsxRuntimeExports.jsxs("div",{className:"desktopSideMenu",tabIndex:hs?-1:0,"aria-hidden":hs,children:[jsxRuntimeExports.jsxs("nav",{className:"sideMenuTabs",children:[jsxRuntimeExports.jsxs("div",{role:"button","aria-hidden":!s||Xr||Or,tabIndex:s&&!Xr&&!Or?0:-1,className:$n===0?"activeSideMenuTab rightTopBarButton button":"inactiveSideMenuTab rightTopBarButton button","aria-label":us.sceneSettings.textSettings.buildTabHeadingText+" Button",onClick:()=>{an(0)},children:[_n?jsxRuntimeExports.jsx("img",{className:"icon",alt:"Build",src:On+"BuildTabIcon.png",onError:Gs=>{Gs.target.src="https://placehold.co/150"}}):"",jsxRuntimeExports.jsx("span",{children:us.sceneSettings.textSettings.buildTabHeadingText})]}),(ss.color.length>0||ss.geometryVariants.length>0)&&jsxRuntimeExports.jsxs("div",{role:"button","aria-hidden":!s||Xr||Or,tabIndex:s&&!Xr&&!Or?0:-1,className:$n===1?"activeSideMenuTab rightTopBarButton button":"inactiveSideMenuTab rightTopBarButton button","aria-label":us.sceneSettings.textSettings.colorTabHeadingText+" Button",onClick:()=>{an(1)},children:[_n?jsxRuntimeExports.jsx("img",{className:"icon",alt:"Color",src:On+"/thumbnails/common-ui/ColorTabIcon.svg",onError:Gs=>{Gs.target.src="https://placehold.co/150"}}):"",jsxRuntimeExports.jsx("span",{children:us.sceneSettings.textSettings.colorTabHeadingText})]}),Object.keys(Ar).length>0&&jsxRuntimeExports.jsxs("div",{role:"button","aria-label":us.sceneSettings.textSettings.featuresTabHeadingText+" Button","aria-hidden":!s||Xr||Or,tabIndex:s&&!Xr&&!Or?0:-1,className:$n===2?"activeSideMenuTab rightTopBarButton button":"inactiveSideMenuTab rightTopBarButton button",onClick:()=>{an(2)},children:[_n?jsxRuntimeExports.jsx("img",{className:"icon",alt:"Features",src:On+"/thumbnails/common-ui/ProductFeaturesTabIcon.png",onError:Gs=>{Gs.target.src="https://placehold.co/150"}}):"",jsxRuntimeExports.jsx("span",{children:us.sceneSettings.textSettings.featuresTabHeadingText})]})]}),jsxRuntimeExports.jsxs("div",{className:"sideMenuContent",children:[jsxRuntimeExports.jsx(PreviewCart,{stores:o}),jsxRuntimeExports.jsx(InfoModal,{stores:o,visible:$n===0}),jsxRuntimeExports.jsx(BuildUI,{stores:o,sideMenuOpen:!0,identifier:"buildUI-desktop",visible:$n===0}),jsxRuntimeExports.jsx("div",{className:"variantContainer",children:ds.map(Gs=>{if(Gs=="color"){if(ss.color.length>0)return jsxRuntimeExports.jsx(Color,{stores:o,visible:$n===1},"colourTab-desktop")}else if(Gs=="geometryVariants"&&ss.geometryVariants.length>0)return jsxRuntimeExports.jsx(GeometryVariants,{stores:o,visible:$n===1},"geometryVariantsTab-desktop")})}),jsxRuntimeExports.jsx(ProductFeaturesUI,{stores:o,sideMenuOpen:!0,identifier:"featuresTab-desktop",visible:$n===2})]})]}),jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:Xr?-1:0,"aria-hidden":Xr,className:"bottomBar right button","aria-label":"Toggle Preview Cart Button",onClick:()=>{dr()},children:[jsxRuntimeExports.jsxs("div",{className:"bottomBarChildDiv",children:[jsxRuntimeExports.jsx("span",{children:us.sceneSettings.textSettings.reviewButtonText}),jsxRuntimeExports.jsx("div",{className:"cartNumber",children:fr()})]}),jsxRuntimeExports.jsx("div",{className:"reviewButtonParentDiv",children:jsxRuntimeExports.jsx("div",{className:"button reviewButton".concat(kr===!0?" hide":""),children:jsxRuntimeExports.jsxs("div",{className:"cartTotalText",children:[`${pr}${numberWithCommas(o.cartStore.getState().cartTotalPrice)}`,o.cartStore.getState().cartTotalCompareAtPrice!=0&&o.cartStore.getState().cartTotalCompareAtPrice>o.cartStore.getState().cartTotalPrice&&jsxRuntimeExports.jsx("strike",{children:`${pr}${numberWithCommas(o.cartStore.getState().cartTotalCompareAtPrice)}`})]})})})]}),jsxRuntimeExports.jsx("div",{className:"reviewButtonSibling"})]})},PreviewCartMobile=({stores:o,previewCartModalOpen:s,togglePreviewCartModal:a,PUBLIC_DESIGN_ASSETS_ENDPOINT:b,cart:_e})=>{const Kt=o.uiSceneStore(dr=>dr.disableCart),an=o.uiSceneStore(dr=>dr.CORE_API),_n=o.uiSceneStore(dr=>dr.cartMessage),On=o.uiSceneStore(dr=>dr.isScreenPortrait),$n=reactExports.useCallback(async()=>{await an.checkoutAsync()},[]);return jsxRuntimeExports.jsxs("div",{className:s?"previewCartModal mobile open":"previewCartModal mobile",tabIndex:On?0:-1,"aria-hidden":!On,children:[jsxRuntimeExports.jsx("div",{className:"closeButton",role:"button",tabIndex:s?0:-1,"aria-hidden":!s,"aria-label":"Close Button",onClick:()=>{a()},children:jsxRuntimeExports.jsx("img",{alt:"Close",src:b+"/Icon/X.svg",onError:dr=>{dr.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("h2",{className:"cartTitle",children:an.sceneSettings.textSettings.cartHeadingText}),_e.length>0?jsxRuntimeExports.jsxs("div",{className:"previewCartContentParentDiv",children:[jsxRuntimeExports.jsx("div",{className:"previewCartContent",children:_e.map(function(dr,fr){return jsxRuntimeExports.jsx(CartItem,{stores:o,itemObject:dr,index:fr},`Cart Item - ${fr}`)})}),jsxRuntimeExports.jsxs("div",{className:"previewCartButtonContainer".concat(Kt===!0?" hide":""),children:[_n&&jsxRuntimeExports.jsx("div",{className:"cartMessageDiv",children:jsxRuntimeExports.jsx("span",{children:_n})}),jsxRuntimeExports.jsxs("button",{className:"checkoutButton",role:"button",tabIndex:Kt?-1:0,"aria-hidden":Kt,"aria-label":"Click to checkout the cart",onClick:$n,children:[jsxRuntimeExports.jsx("span",{children:an.sceneSettings.addToCartCTAText}),jsxRuntimeExports.jsx("img",{alt:"Right",src:b+"/Icon/ArrowRight.svg",onError:dr=>{dr.target.src="https://placehold.co/150"}})]})]})]}):jsxRuntimeExports.jsx("h3",{className:"cartEmptyText",children:"Your cart is currently empty"})]})},ContextMenuDesktop=({stores:o,selectedItemData:s,colors:a,colorsCategoryName:b})=>{const _e=o.uiSceneStore(us=>us.CORE_API),[Kt,an]=reactExports.useState(null),[_n,On]=reactExports.useState(0),[$n,dr]=reactExports.useState(0),[fr,pr]=reactExports.useState(null),Ar=reactExports.useRef(null),Or=reactExports.useRef(null),Xr=o.uiSceneStore(us=>us.dialogPopupOpen),ss=o.uiSceneStore(us=>us.isScreenPortrait),kr=reactExports.useCallback(()=>{_e.fireEvent(_e.EVENTS.UI.ContextMenu_InfoBtnClicked,s)},[s]);return reactExports.useEffect(()=>{pr(null),s&&(pr({...s}),s.overrideVariant?an(s.overrideVariant):an(s.currentVariant))},[s]),reactExports.useEffect(()=>{if(!fr||!Or.current||!s||!Ar.current)return;const us=_e.getCanvasSize();let hs=s.offsetX+Ar.current.children[0].clientWidth,ds=s.offsetY+Ar.current.children[0].clientHeight,fs=us.width-hs;fs<0?On(s.offsetX+fs-10):On(s.offsetX);let Gs=us.height-ds;Gs<0?dr(s.offsetY+Gs-10):dr(s.offsetY),Or.current.focus()},[fr,s,Ar]),jsxRuntimeExports.jsx("div",{ref:Ar,tabIndex:ss?-1:0,"aria-hidden":ss,children:s!==null&&jsxRuntimeExports.jsx("div",{className:"contextMenuParent interactable",style:{left:_n+"px",top:$n+"px"},children:jsxRuntimeExports.jsx("div",{className:"contextContentDiv",children:jsxRuntimeExports.jsxs("div",{className:"contextContent",children:[jsxRuntimeExports.jsxs("div",{className:"contextContentChildDiv",children:[jsxRuntimeExports.jsxs("div",{className:"contextNameContent",children:[jsxRuntimeExports.jsx("h3",{children:s.itemData.name}),jsxRuntimeExports.jsx("img",{ref:Or,role:"button","aria-hidden":Xr,tabIndex:Xr?-1:0,className:"infoButton",alt:"Info","aria-label":"Info",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Info.svg",onClick:()=>kr(),onError:us=>{us.target.src="https://placehold.co/150"}})]}),jsxRuntimeExports.jsx("div",{role:"button",tabIndex:Xr?-1:0,"aria-hidden":Xr,"aria-label":"Close",className:"closeContainer closeButton",onClick:()=>_e.exitSelectedItem(),children:jsxRuntimeExports.jsx("img",{alt:"Close",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/X.svg",onError:us=>{us.target.src="https://placehold.co/150"}})})]}),a.length>0&&_e.sceneSettings.disableLocalColorOverride===!1&&jsxRuntimeExports.jsxs("div",{className:"contextColorContent",children:[jsxRuntimeExports.jsxs("span",{className:"colorSwatchTitle",children:["Select ",b]}),jsxRuntimeExports.jsx("div",{className:"color-grid color-variants-selection",children:a.map((us,hs)=>jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:Xr?-1:0,"aria-hidden":Xr,"aria-label":"Select "+us.label,onClick:async()=>{await _e.overrideSelectedItemMaterial(us.id),an(us.id)},className:Kt==us.id?"colorSelector selected":"colorSelector",children:[jsxRuntimeExports.jsx("div",{className:"colorThumbnailContainer",children:jsxRuntimeExports.jsxs("div",{className:"colorThumbnail",children:[jsxRuntimeExports.jsx("div",{className:"checkMark",children:jsxRuntimeExports.jsx("img",{alt:"Checkmark",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Check.svg",onError:ds=>{ds.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("img",{alt:us.label,className:"contextColorThumbnail",src:_e.getResolvedAssetUrl(us.thumbnail),onError:ds=>{ds.target.src="https://placehold.co/150"}})]})}),jsxRuntimeExports.jsx("div",{className:"colorDetails",children:jsxRuntimeExports.jsxs("p",{className:"truncate colorDetailsLabel",children:[capitalize$1(us.label),jsxRuntimeExports.jsx("br",{}),jsxRuntimeExports.jsx("span",{className:"redText",children:us.outOfStock?"OUT OF STOCK":jsxRuntimeExports.jsx("br",{})})]})})]},"Color-"+hs))})]}),jsxRuntimeExports.jsxs("div",{className:"contextButtons",children:[_e.canSelectedItemDrag()&&jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:Xr?-1:0,"aria-hidden":Xr,"aria-label":"Remove Button",onClick:()=>{_e.doesSelectedItemHasAttachedDependency()?_e.triggerItemRemoveModal(s.itemData.guid):_e.removeSelectedItem()},children:[jsxRuntimeExports.jsx("img",{src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/TrashSimple.svg",alt:"Remove",onError:us=>{us.target.src="https://placehold.co/150"}}),jsxRuntimeExports.jsx("span",{children:"Remove"})]}),_e.canSelectedItemRotate()&&jsxRuntimeExports.jsxs("div",{role:"button","aria-label":"Rotate Button",tabIndex:Xr?-1:0,"aria-hidden":Xr,onClick:()=>_e.rotateSelectedItem(),children:[jsxRuntimeExports.jsx("img",{alt:"Rotate",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Rotate.svg",onError:us=>{us.target.src="https://placehold.co/150"}}),jsxRuntimeExports.jsx("span",{children:"Rotate"})]})]})]})})})})},ContextMenuMobile=({stores:o,selectedItemData:s,contextMenuDrawerOpen:a,dismissContextMenuDrawer:b,colors:_e,colorsCategoryName:Kt})=>{const[an,_n]=reactExports.useState(a),On=reactExports.useRef(null),$n=o.uiSceneStore(Or=>Or.CORE_API),dr=o.uiSceneStore(Or=>Or.isScreenPortrait),[fr,pr]=reactExports.useState(null);reactExports.useEffect(()=>{On.current&&On.current.addEventListener("drawerClosed",()=>{b()})},[On]),reactExports.useEffect(()=>(_n(a),()=>{}),[a]),reactExports.useEffect(()=>{$n.isMobile&&o.uiSceneStore.setState({dialogPopupOpen:an})},[an]),reactExports.useEffect(()=>{!s||!s.itemData||(s.overrideVariant?pr(s.overrideVariant):pr(s.currentVariant))},[s]);async function Ar(){$n.doesSelectedItemHasAttachedDependency()?$n.triggerItemRemoveModal(s.itemData.guid):(await $n.removeSelectedItem(),b())}return jsxRuntimeExports.jsx(BottomDrawer,{stores:o,id:"contextDrawer",ref:On,open:`${an}`,"initial-screen-coverage":"60%",children:jsxRuntimeExports.jsx("div",{className:"contextMenuDrawer epigraphDrawer",slot:"bottom-drawer-content",tabIndex:dr?0:-1,"aria-hidden":!dr,children:jsxRuntimeExports.jsxs("div",{className:"contextMenuParent interactable",children:[jsxRuntimeExports.jsx("div",{className:"contextContent",children:s&&s.itemData?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"contextContentNameDiv",children:jsxRuntimeExports.jsx("h3",{children:s.itemData.name})})}):""}),_e.length>0&&$n.sceneSettings.disableLocalColorOverride===!1&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("p",{className:"colorSwatchTitle",children:["Select ",Kt]}),jsxRuntimeExports.jsx("div",{className:"color-grid color-variants-selection",children:_e.map((Or,Xr)=>jsxRuntimeExports.jsxs("div",{role:"button","aria-label":"Select "+Or.label,tabIndex:an?0:-1,"aria-hidden":!an,onClick:async()=>{await o.uiSceneStore.getState().CORE_API.overrideSelectedItemMaterial(Or.id),pr(Or.id)},className:fr==Or.id?"colorSelector selected":"colorSelector",children:[jsxRuntimeExports.jsxs("div",{className:"colorThumbnailContainer",children:[jsxRuntimeExports.jsx("div",{className:"colorThumbnail",children:jsxRuntimeExports.jsx("img",{alt:Or.label,className:"colorThumbnailImg",src:$n.getResolvedAssetUrl(Or.thumbnail),onError:ss=>{ss.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("div",{className:"checkMark",children:jsxRuntimeExports.jsx("img",{alt:"Check",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Check.svg",onError:ss=>{ss.target.src="https://placehold.co/150"}})})]}),jsxRuntimeExports.jsx("div",{className:"colorDetails",children:jsxRuntimeExports.jsxs("p",{className:"truncate colorDetailsLabel",children:[capitalize$1(Or.label),jsxRuntimeExports.jsx("br",{}),jsxRuntimeExports.jsx("span",{className:"redText",children:Or.outOfStock?"OUT OF STOCK":jsxRuntimeExports.jsx("br",{})})]})})]},"Color-"+Xr))})]}),jsxRuntimeExports.jsxs("div",{className:"contextButtons",children:[$n.canSelectedItemBeRemoved()&&jsxRuntimeExports.jsxs("button",{role:"button",tabIndex:an?0:-1,"aria-hidden":!an,"aria-label":"Remove Button",onClick:()=>Ar(),children:[jsxRuntimeExports.jsx("img",{alt:"Remove",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Trash.svg",onError:Or=>{Or.target.src="https://placehold.co/150"}}),jsxRuntimeExports.jsx("span",{children:"Remove"})]}),$n.canSelectedItemRotate()&&jsxRuntimeExports.jsxs("button",{role:"button",tabIndex:an?0:-1,"aria-hidden":!an,"aria-label":"Rotate Button",onClick:()=>$n.rotateSelectedItem(),children:[jsxRuntimeExports.jsx("img",{alt:"Rotate",src:PUBLIC_DESIGN_ASSETS_ENDPOINT+"/Icon/Rotate.svg",onError:Or=>{Or.target.src="https://placehold.co/150"}}),jsxRuntimeExports.jsx("span",{children:"Rotate"})]})]})]})})})},ContextMenu=({stores:o,selectedItemData:s,contextMenuOpen:a,dismissContextMenuDrawer:b})=>{const _e=o.uiSceneStore(Ar=>Ar.CORE_API),[Kt,an]=reactExports.useState(!1),[_n,On]=reactExports.useState([]),[$n,dr]=reactExports.useState(""),fr=o.uiSceneStore(Ar=>Ar.inventoryData);reactExports.useEffect(()=>(an(a),()=>{}),[a]),reactExports.useEffect(()=>{if(On([]),s===void 0||!s.itemData||_e===null)return;const Ar=_e.getSelectedItemColors(),Or=_e.getInventoryInfo()[s.itemData.skuID];if(Ar.map(ss=>{ss.outOfStock=!1,Or[ss.id].countAvailable==0&&(ss.outOfStock=!0)}),On(Ar),Ar.length===0)return;const Xr=_e.categoryData;Xr.color&&Xr.color.map(ss=>{ss.looks.map(kr=>{kr===Ar[0].id&&dr(ss.label)})})},[s]),reactExports.useEffect(()=>{fr!=null&&pr(fr)},[fr]);const pr=reactExports.useCallback(Ar=>{const Or=_e.getSelectedItemData();if(Or==null)return;const Xr=_e.getSelectedItemColors(),ss=Ar[Or.itemData.skuID];Xr.map(kr=>{kr.outOfStock=!1,ss[kr.id].countAvailable==0&&(kr.outOfStock=!0)}),On(Xr)},[s]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:_e.isMobile&&window.innerWidth<=768?jsxRuntimeExports.jsx(ContextMenuMobile,{stores:o,selectedItemData:s,contextMenuDrawerOpen:Kt,dismissContextMenuDrawer:b,colors:_n,colorsCategoryName:$n}):Kt&&jsxRuntimeExports.jsx(ContextMenuDesktop,{stores:o,contextMenuDesktopOpen:Kt,selectedItemData:s,colors:_n,colorsCategoryName:$n})})},FullScreenModal=reactExports.forwardRef((o,s)=>{const a=reactExports.useRef(null),b=reactExports.useRef(null);reactExports.useEffect(()=>{s.current&&b.current&&a.current&&(s.current.show=_n=>Kt(),s.current.hide=_n=>an(),s.current.mainContainer=a.current,s.current.closeButton=b.current,_e())},[s,b,a]);const _e=()=>{b.current.addEventListener("click",()=>{o.onExit&&o.onExit(),an()})},Kt=()=>{a.current.classList.add("show"),o.stores.uiSceneStore.setState({dialogPopupOpen:!0}),b.current.focus()},an=()=>{o.stores.uiSceneStore.setState({dialogPopupOpen:!1}),a.current.classList.remove("show")};return jsxRuntimeExports.jsx("div",{id:o.id,ref:s,className:o.className,children:jsxRuntimeExports.jsx("div",{"aria-hidden":!o.open,ref:a,className:"full-screen-modal-container",children:jsxRuntimeExports.jsxs("div",{className:"modal-content-container",children:[jsxRuntimeExports.jsx("div",{role:"button","aria-hidden":!o.open,"aria-label":"Close Button",tabIndex:o.open?0:-1,ref:b,className:"close-button",children:jsxRuntimeExports.jsx("img",{alt:"Close",src:"https://storage.googleapis.com/gsc-epigraph-design/product-assets/Icon/X.svg",onError:_n=>{_n.target.src="https://placehold.co/150"}})}),jsxRuntimeExports.jsx("slot",{name:"full-screen-dialog-content",children:o.children})]})})})});var lottie$1={exports:{}};(function(module,exports){typeof navigator<"u"&&function(o,s){module.exports=s()}(commonjsGlobal,function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(s){_useWebWorker=!!s},getWebWorker=function(){return _useWebWorker},setLocationHref=function(s){locationHref=s},getLocationHref=function(){return locationHref};function createTag(o){return document.createElement(o)}function extendPrototype(o,s){var a,b=o.length,_e;for(a=0;a<b;a+=1){_e=o[a].prototype;for(var Kt in _e)Object.prototype.hasOwnProperty.call(_e,Kt)&&(s.prototype[Kt]=_e[Kt])}}function getDescriptor(o,s){return Object.getOwnPropertyDescriptor(o,s)}function createProxyFunction(o){function s(){}return s.prototype=o,s}var audioControllerFactory=function(){function o(s){this.audios=[],this.audioFactory=s,this._volume=1,this._isMuted=!1}return o.prototype={addAudio:function(a){this.audios.push(a)},pause:function(){var a,b=this.audios.length;for(a=0;a<b;a+=1)this.audios[a].pause()},resume:function(){var a,b=this.audios.length;for(a=0;a<b;a+=1)this.audios[a].resume()},setRate:function(a){var b,_e=this.audios.length;for(b=0;b<_e;b+=1)this.audios[b].setRate(a)},createAudio:function(a){return this.audioFactory?this.audioFactory(a):window.Howl?new window.Howl({src:[a]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(a){this.audioFactory=a},setVolume:function(a){this._volume=a,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var a,b=this.audios.length;for(a=0;a<b;a+=1)this.audios[a].volume(this._volume*(this._isMuted?0:1))}},function(){return new o}}(),createTypedArray=function(){function o(a,b){var _e=0,Kt=[],an;switch(a){case"int16":case"uint8c":an=1;break;default:an=1.1;break}for(_e=0;_e<b;_e+=1)Kt.push(an);return Kt}function s(a,b){return a==="float32"?new Float32Array(b):a==="int16"?new Int16Array(b):a==="uint8c"?new Uint8ClampedArray(b):o(a,b)}return typeof Uint8ClampedArray=="function"&&typeof Float32Array=="function"?s:o}();function createSizedArray(o){return Array.apply(null,{length:o})}function _typeof$6(o){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$6=function(a){return typeof a}:_typeof$6=function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof$6(o)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};(function(){var o=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],s,a=o.length;for(s=0;s<a;s+=1)BMMath[o[s]]=Math[o[s]]})(),BMMath.random=Math.random,BMMath.abs=function(o){var s=_typeof$6(o);if(s==="object"&&o.length){var a=createSizedArray(o.length),b,_e=o.length;for(b=0;b<_e;b+=1)a[b]=Math.abs(o[b]);return a}return Math.abs(o)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function styleDiv(o){o.style.position="absolute",o.style.top=0,o.style.left=0,o.style.display="block",o.style.transformOrigin="0 0",o.style.webkitTransformOrigin="0 0",o.style.backfaceVisibility="visible",o.style.webkitBackfaceVisibility="visible",o.style.transformStyle="preserve-3d",o.style.webkitTransformStyle="preserve-3d",o.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(o,s,a,b){this.type=o,this.currentTime=s,this.totalTime=a,this.direction=b<0?-1:1}function BMCompleteEvent(o,s){this.type=o,this.direction=s<0?-1:1}function BMCompleteLoopEvent(o,s,a,b){this.type=o,this.currentLoop=a,this.totalLoops=s,this.direction=b<0?-1:1}function BMSegmentStartEvent(o,s,a){this.type=o,this.firstFrame=s,this.totalFrames=a}function BMDestroyEvent(o,s){this.type=o,this.target=s}function BMRenderFrameErrorEvent(o,s){this.type="renderFrameError",this.nativeError=o,this.currentTime=s}function BMConfigErrorEvent(o){this.type="configError",this.nativeError=o}var createElementID=function(){var o=0;return function(){return o+=1,idPrefix$1+"__lottie_element_"+o}}();function HSVtoRGB(o,s,a){var b,_e,Kt,an,_n,On,$n,dr;switch(an=Math.floor(o*6),_n=o*6-an,On=a*(1-s),$n=a*(1-_n*s),dr=a*(1-(1-_n)*s),an%6){case 0:b=a,_e=dr,Kt=On;break;case 1:b=$n,_e=a,Kt=On;break;case 2:b=On,_e=a,Kt=dr;break;case 3:b=On,_e=$n,Kt=a;break;case 4:b=dr,_e=On,Kt=a;break;case 5:b=a,_e=On,Kt=$n;break}return[b,_e,Kt]}function RGBtoHSV(o,s,a){var b=Math.max(o,s,a),_e=Math.min(o,s,a),Kt=b-_e,an,_n=b===0?0:Kt/b,On=b/255;switch(b){case _e:an=0;break;case o:an=s-a+Kt*(s<a?6:0),an/=6*Kt;break;case s:an=a-o+Kt*2,an/=6*Kt;break;case a:an=o-s+Kt*4,an/=6*Kt;break}return[an,_n,On]}function addSaturationToRGB(o,s){var a=RGBtoHSV(o[0]*255,o[1]*255,o[2]*255);return a[1]+=s,a[1]>1?a[1]=1:a[1]<=0&&(a[1]=0),HSVtoRGB(a[0],a[1],a[2])}function addBrightnessToRGB(o,s){var a=RGBtoHSV(o[0]*255,o[1]*255,o[2]*255);return a[2]+=s,a[2]>1?a[2]=1:a[2]<0&&(a[2]=0),HSVtoRGB(a[0],a[1],a[2])}function addHueToRGB(o,s){var a=RGBtoHSV(o[0]*255,o[1]*255,o[2]*255);return a[0]+=s/360,a[0]>1?a[0]-=1:a[0]<0&&(a[0]+=1),HSVtoRGB(a[0],a[1],a[2])}var rgbToHex=function(){var o=[],s,a;for(s=0;s<256;s+=1)a=s.toString(16),o[s]=a.length===1?"0"+a:a;return function(b,_e,Kt){return b<0&&(b=0),_e<0&&(_e=0),Kt<0&&(Kt=0),"#"+o[b]+o[_e]+o[Kt]}}(),setSubframeEnabled=function(s){subframeEnabled=!!s},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(s){expressionsPlugin=s},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(s){expressionsInterfaces=s},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(s){defaultCurveSegments=s},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(s){idPrefix$1=s};function createNS(o){return document.createElementNS(svgNS,o)}function _typeof$5(o){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$5=function(a){return typeof a}:_typeof$5=function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof$5(o)}var dataManager=function(){var o=1,s=[],a,b,_e={onmessage:function(){},postMessage:function(Ar){a({data:Ar})}},Kt={postMessage:function(Ar){_e.onmessage({data:Ar})}};function an(pr){if(window.Worker&&window.Blob&&getWebWorker()){var Ar=new Blob(["var _workerSelf = self; self.onmessage = ",pr.toString()],{type:"text/javascript"}),Or=URL.createObjectURL(Ar);return new Worker(Or)}return a=pr,_e}function _n(){b||(b=an(function(Ar){function Or(){function ss(ep,_f){var np,_l,Ml=ep.length,tp,El,sp,My;for(_l=0;_l<Ml;_l+=1)if(np=ep[_l],"ks"in np&&!np.completed){if(np.completed=!0,np.hasMask){var Py=np.masksProperties;for(El=Py.length,tp=0;tp<El;tp+=1)if(Py[tp].pt.k.i)fs(Py[tp].pt.k);else for(My=Py[tp].pt.k.length,sp=0;sp<My;sp+=1)Py[tp].pt.k[sp].s&&fs(Py[tp].pt.k[sp].s[0]),Py[tp].pt.k[sp].e&&fs(Py[tp].pt.k[sp].e[0])}np.ty===0?(np.layers=hs(np.refId,_f),ss(np.layers,_f)):np.ty===4?ds(np.shapes):np.ty===5&&Al(np)}}function kr(ep,_f){if(ep){var np=0,_l=ep.length;for(np=0;np<_l;np+=1)ep[np].t===1&&(ep[np].data.layers=hs(ep[np].data.refId,_f),ss(ep[np].data.layers,_f))}}function us(ep,_f){for(var np=0,_l=_f.length;np<_l;){if(_f[np].id===ep)return _f[np];np+=1}return null}function hs(ep,_f){var np=us(ep,_f);return np?np.layers.__used?JSON.parse(JSON.stringify(np.layers)):(np.layers.__used=!0,np.layers):null}function ds(ep){var _f,np=ep.length,_l,Ml;for(_f=np-1;_f>=0;_f-=1)if(ep[_f].ty==="sh")if(ep[_f].ks.k.i)fs(ep[_f].ks.k);else for(Ml=ep[_f].ks.k.length,_l=0;_l<Ml;_l+=1)ep[_f].ks.k[_l].s&&fs(ep[_f].ks.k[_l].s[0]),ep[_f].ks.k[_l].e&&fs(ep[_f].ks.k[_l].e[0]);else ep[_f].ty==="gr"&&ds(ep[_f].it)}function fs(ep){var _f,np=ep.i.length;for(_f=0;_f<np;_f+=1)ep.i[_f][0]+=ep.v[_f][0],ep.i[_f][1]+=ep.v[_f][1],ep.o[_f][0]+=ep.v[_f][0],ep.o[_f][1]+=ep.v[_f][1]}function Gs(ep,_f){var np=_f?_f.split("."):[100,100,100];return ep[0]>np[0]?!0:np[0]>ep[0]?!1:ep[1]>np[1]?!0:np[1]>ep[1]?!1:ep[2]>np[2]?!0:np[2]>ep[2]?!1:null}var ga=function(){var ep=[4,4,14];function _f(_l){var Ml=_l.t.d;_l.t.d={k:[{s:Ml,t:0}]}}function np(_l){var Ml,tp=_l.length;for(Ml=0;Ml<tp;Ml+=1)_l[Ml].ty===5&&_f(_l[Ml])}return function(_l){if(Gs(ep,_l.v)&&(np(_l.layers),_l.assets)){var Ml,tp=_l.assets.length;for(Ml=0;Ml<tp;Ml+=1)_l.assets[Ml].layers&&np(_l.assets[Ml].layers)}}}(),So=function(){var ep=[4,7,99];return function(_f){if(_f.chars&&!Gs(ep,_f.v)){var np,_l=_f.chars.length;for(np=0;np<_l;np+=1){var Ml=_f.chars[np];Ml.data&&Ml.data.shapes&&(ds(Ml.data.shapes),Ml.data.ip=0,Ml.data.op=99999,Ml.data.st=0,Ml.data.sr=1,Ml.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},_f.chars[np].t||(Ml.data.shapes.push({ty:"no"}),Ml.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}}(),go=function(){var ep=[5,7,15];function _f(_l){var Ml=_l.t.p;typeof Ml.a=="number"&&(Ml.a={a:0,k:Ml.a}),typeof Ml.p=="number"&&(Ml.p={a:0,k:Ml.p}),typeof Ml.r=="number"&&(Ml.r={a:0,k:Ml.r})}function np(_l){var Ml,tp=_l.length;for(Ml=0;Ml<tp;Ml+=1)_l[Ml].ty===5&&_f(_l[Ml])}return function(_l){if(Gs(ep,_l.v)&&(np(_l.layers),_l.assets)){var Ml,tp=_l.assets.length;for(Ml=0;Ml<tp;Ml+=1)_l.assets[Ml].layers&&np(_l.assets[Ml].layers)}}}(),xo=function(){var ep=[4,1,9];function _f(_l){var Ml,tp=_l.length,El,sp;for(Ml=0;Ml<tp;Ml+=1)if(_l[Ml].ty==="gr")_f(_l[Ml].it);else if(_l[Ml].ty==="fl"||_l[Ml].ty==="st")if(_l[Ml].c.k&&_l[Ml].c.k[0].i)for(sp=_l[Ml].c.k.length,El=0;El<sp;El+=1)_l[Ml].c.k[El].s&&(_l[Ml].c.k[El].s[0]/=255,_l[Ml].c.k[El].s[1]/=255,_l[Ml].c.k[El].s[2]/=255,_l[Ml].c.k[El].s[3]/=255),_l[Ml].c.k[El].e&&(_l[Ml].c.k[El].e[0]/=255,_l[Ml].c.k[El].e[1]/=255,_l[Ml].c.k[El].e[2]/=255,_l[Ml].c.k[El].e[3]/=255);else _l[Ml].c.k[0]/=255,_l[Ml].c.k[1]/=255,_l[Ml].c.k[2]/=255,_l[Ml].c.k[3]/=255}function np(_l){var Ml,tp=_l.length;for(Ml=0;Ml<tp;Ml+=1)_l[Ml].ty===4&&_f(_l[Ml].shapes)}return function(_l){if(Gs(ep,_l.v)&&(np(_l.layers),_l.assets)){var Ml,tp=_l.assets.length;for(Ml=0;Ml<tp;Ml+=1)_l.assets[Ml].layers&&np(_l.assets[Ml].layers)}}}(),Mo=function(){var ep=[4,4,18];function _f(_l){var Ml,tp=_l.length,El,sp;for(Ml=tp-1;Ml>=0;Ml-=1)if(_l[Ml].ty==="sh")if(_l[Ml].ks.k.i)_l[Ml].ks.k.c=_l[Ml].closed;else for(sp=_l[Ml].ks.k.length,El=0;El<sp;El+=1)_l[Ml].ks.k[El].s&&(_l[Ml].ks.k[El].s[0].c=_l[Ml].closed),_l[Ml].ks.k[El].e&&(_l[Ml].ks.k[El].e[0].c=_l[Ml].closed);else _l[Ml].ty==="gr"&&_f(_l[Ml].it)}function np(_l){var Ml,tp,El=_l.length,sp,My,Py,Ny;for(tp=0;tp<El;tp+=1){if(Ml=_l[tp],Ml.hasMask){var wy=Ml.masksProperties;for(My=wy.length,sp=0;sp<My;sp+=1)if(wy[sp].pt.k.i)wy[sp].pt.k.c=wy[sp].cl;else for(Ny=wy[sp].pt.k.length,Py=0;Py<Ny;Py+=1)wy[sp].pt.k[Py].s&&(wy[sp].pt.k[Py].s[0].c=wy[sp].cl),wy[sp].pt.k[Py].e&&(wy[sp].pt.k[Py].e[0].c=wy[sp].cl)}Ml.ty===4&&_f(Ml.shapes)}}return function(_l){if(Gs(ep,_l.v)&&(np(_l.layers),_l.assets)){var Ml,tp=_l.assets.length;for(Ml=0;Ml<tp;Ml+=1)_l.assets[Ml].layers&&np(_l.assets[Ml].layers)}}}();function yl(ep){ep.__complete||(xo(ep),ga(ep),So(ep),go(ep),Mo(ep),ss(ep.layers,ep.assets),kr(ep.chars,ep.assets),ep.__complete=!0)}function Al(ep){ep.t.a.length===0&&"m"in ep.t.p}var xl={};return xl.completeData=yl,xl.checkColors=xo,xl.checkChars=So,xl.checkPathProperties=go,xl.checkShapes=Mo,xl.completeLayers=ss,xl}if(Kt.dataManager||(Kt.dataManager=Or()),Kt.assetLoader||(Kt.assetLoader=function(){function ss(us){var hs=us.getResponseHeader("content-type");return hs&&us.responseType==="json"&&hs.indexOf("json")!==-1||us.response&&_typeof$5(us.response)==="object"?us.response:us.response&&typeof us.response=="string"?JSON.parse(us.response):us.responseText?JSON.parse(us.responseText):null}function kr(us,hs,ds,fs){var Gs,ga=new XMLHttpRequest;try{ga.responseType="json"}catch{}ga.onreadystatechange=function(){if(ga.readyState===4)if(ga.status===200)Gs=ss(ga),ds(Gs);else try{Gs=ss(ga),ds(Gs)}catch(So){fs&&fs(So)}};try{ga.open(["G","E","T"].join(""),us,!0)}catch{ga.open(["G","E","T"].join(""),hs+"/"+us,!0)}ga.send()}return{load:kr}}()),Ar.data.type==="loadAnimation")Kt.assetLoader.load(Ar.data.path,Ar.data.fullPath,function(ss){Kt.dataManager.completeData(ss),Kt.postMessage({id:Ar.data.id,payload:ss,status:"success"})},function(){Kt.postMessage({id:Ar.data.id,status:"error"})});else if(Ar.data.type==="complete"){var Xr=Ar.data.animation;Kt.dataManager.completeData(Xr),Kt.postMessage({id:Ar.data.id,payload:Xr,status:"success"})}else Ar.data.type==="loadData"&&Kt.assetLoader.load(Ar.data.path,Ar.data.fullPath,function(ss){Kt.postMessage({id:Ar.data.id,payload:ss,status:"success"})},function(){Kt.postMessage({id:Ar.data.id,status:"error"})})}),b.onmessage=function(pr){var Ar=pr.data,Or=Ar.id,Xr=s[Or];s[Or]=null,Ar.status==="success"?Xr.onComplete(Ar.payload):Xr.onError&&Xr.onError()})}function On(pr,Ar){o+=1;var Or="processId_"+o;return s[Or]={onComplete:pr,onError:Ar},Or}function $n(pr,Ar,Or){_n();var Xr=On(Ar,Or);b.postMessage({type:"loadAnimation",path:pr,fullPath:window.location.origin+window.location.pathname,id:Xr})}function dr(pr,Ar,Or){_n();var Xr=On(Ar,Or);b.postMessage({type:"loadData",path:pr,fullPath:window.location.origin+window.location.pathname,id:Xr})}function fr(pr,Ar,Or){_n();var Xr=On(Ar,Or);b.postMessage({type:"complete",animation:pr,id:Xr})}return{loadAnimation:$n,loadData:dr,completeAnimation:fr}}(),ImagePreloader=function(){var o=function(){var kr=createTag("canvas");kr.width=1,kr.height=1;var us=kr.getContext("2d");return us.fillStyle="rgba(0,0,0,0)",us.fillRect(0,0,1,1),kr}();function s(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function a(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function b(kr,us,hs){var ds="";if(kr.e)ds=kr.p;else if(us){var fs=kr.p;fs.indexOf("images/")!==-1&&(fs=fs.split("/")[1]),ds=us+fs}else ds=hs,ds+=kr.u?kr.u:"",ds+=kr.p;return ds}function _e(kr){var us=0,hs=setInterval(function(){var ds=kr.getBBox();(ds.width||us>500)&&(this._imageLoaded(),clearInterval(hs)),us+=1}.bind(this),50)}function Kt(kr){var us=b(kr,this.assetsPath,this.path),hs=createNS("image");isSafari?this.testImageLoaded(hs):hs.addEventListener("load",this._imageLoaded,!1),hs.addEventListener("error",function(){ds.img=o,this._imageLoaded()}.bind(this),!1),hs.setAttributeNS("http://www.w3.org/1999/xlink","href",us),this._elementHelper.append?this._elementHelper.append(hs):this._elementHelper.appendChild(hs);var ds={img:hs,assetData:kr};return ds}function an(kr){var us=b(kr,this.assetsPath,this.path),hs=createTag("img");hs.crossOrigin="anonymous",hs.addEventListener("load",this._imageLoaded,!1),hs.addEventListener("error",function(){ds.img=o,this._imageLoaded()}.bind(this),!1),hs.src=us;var ds={img:hs,assetData:kr};return ds}function _n(kr){var us={assetData:kr},hs=b(kr,this.assetsPath,this.path);return dataManager.loadData(hs,function(ds){us.img=ds,this._footageLoaded()}.bind(this),function(){us.img={},this._footageLoaded()}.bind(this)),us}function On(kr,us){this.imagesLoadedCb=us;var hs,ds=kr.length;for(hs=0;hs<ds;hs+=1)kr[hs].layers||(!kr[hs].t||kr[hs].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(kr[hs]))):kr[hs].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(kr[hs]))))}function $n(kr){this.path=kr||""}function dr(kr){this.assetsPath=kr||""}function fr(kr){for(var us=0,hs=this.images.length;us<hs;){if(this.images[us].assetData===kr)return this.images[us].img;us+=1}return null}function pr(){this.imagesLoadedCb=null,this.images.length=0}function Ar(){return this.totalImages===this.loadedAssets}function Or(){return this.totalFootages===this.loadedFootagesCount}function Xr(kr,us){kr==="svg"?(this._elementHelper=us,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}function ss(){this._imageLoaded=s.bind(this),this._footageLoaded=a.bind(this),this.testImageLoaded=_e.bind(this),this.createFootageData=_n.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return ss.prototype={loadAssets:On,setAssetsPath:dr,setPath:$n,loadedImages:Ar,loadedFootages:Or,destroy:pr,getAsset:fr,createImgData:an,createImageData:Kt,imageLoaded:s,footageLoaded:a,setCacheType:Xr},ss}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(s,a){if(this._cbs[s])for(var b=this._cbs[s],_e=0;_e<b.length;_e+=1)b[_e](a)},addEventListener:function(s,a){return this._cbs[s]||(this._cbs[s]=[]),this._cbs[s].push(a),function(){this.removeEventListener(s,a)}.bind(this)},removeEventListener:function(s,a){if(!a)this._cbs[s]=null;else if(this._cbs[s]){for(var b=0,_e=this._cbs[s].length;b<_e;)this._cbs[s][b]===a&&(this._cbs[s].splice(b,1),b-=1,_e-=1),b+=1;this._cbs[s].length||(this._cbs[s]=null)}}};var markerParser=function(){function o(s){for(var a=s.split(`\r
|
|
8819
8819
|
`),b={},_e,Kt=0,an=0;an<a.length;an+=1)_e=a[an].split(":"),_e.length===2&&(b[_e[0]]=_e[1].trim(),Kt+=1);if(Kt===0)throw new Error;return b}return function(s){for(var a=[],b=0;b<s.length;b+=1){var _e=s[b],Kt={time:_e.tm,duration:_e.dr};try{Kt.payload=JSON.parse(s[b].cm)}catch{try{Kt.payload=o(s[b].cm)}catch{Kt.payload={name:s[b].cm}}}a.push(Kt)}return a}}(),ProjectInterface=function(){function o(s){this.compositions.push(s)}return function(){function s(a){for(var b=0,_e=this.compositions.length;b<_e;){if(this.compositions[b].data&&this.compositions[b].data.nm===a)return this.compositions[b].prepareFrame&&this.compositions[b].data.xt&&this.compositions[b].prepareFrame(this.currentFrame),this.compositions[b].compInterface;b+=1}return null}return s.compositions=[],s.currentFrame=0,s.registerComposition=o,s}}(),renderers={},registerRenderer=function(s,a){renderers[s]=a};function getRenderer(o){return renderers[o]}function getRegisteredRenderer(){if(renderers.canvas)return"canvas";for(var o in renderers)if(renderers[o])return o;return""}function _typeof$4(o){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$4=function(a){return typeof a}:_typeof$4=function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof$4(o)}var AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=getSubframeEnabled(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new BMEnterFrameEvent("drawnFrame",0,0,0),this.expressionsPlugin=getExpressionsPlugin()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(o){(o.wrapper||o.container)&&(this.wrapper=o.wrapper||o.container);var s="svg";o.animType?s=o.animType:o.renderer&&(s=o.renderer);var a=getRenderer(s);this.renderer=new a(this,o.rendererSettings),this.imagePreloader.setCacheType(s,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=s,o.loop===""||o.loop===null||o.loop===void 0||o.loop===!0?this.loop=!0:o.loop===!1?this.loop=!1:this.loop=parseInt(o.loop,10),this.autoplay="autoplay"in o?o.autoplay:!0,this.name=o.name?o.name:"",this.autoloadSegments=Object.prototype.hasOwnProperty.call(o,"autoloadSegments")?o.autoloadSegments:!0,this.assetsPath=o.assetsPath,this.initialSegment=o.initialSegment,o.audioFactory&&this.audioController.setAudioFactory(o.audioFactory),o.animationData?this.setupAnimation(o.animationData):o.path&&(o.path.lastIndexOf("\\")!==-1?this.path=o.path.substr(0,o.path.lastIndexOf("\\")+1):this.path=o.path.substr(0,o.path.lastIndexOf("/")+1),this.fileName=o.path.substr(o.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),dataManager.loadAnimation(o.path,this.configAnimation,this.onSetupError))},AnimationItem.prototype.onSetupError=function(){this.trigger("data_failed")},AnimationItem.prototype.setupAnimation=function(o){dataManager.completeAnimation(o,this.configAnimation)},AnimationItem.prototype.setData=function(o,s){s&&_typeof$4(s)!=="object"&&(s=JSON.parse(s));var a={wrapper:o,animationData:s},b=o.attributes;a.path=b.getNamedItem("data-animation-path")?b.getNamedItem("data-animation-path").value:b.getNamedItem("data-bm-path")?b.getNamedItem("data-bm-path").value:b.getNamedItem("bm-path")?b.getNamedItem("bm-path").value:"",a.animType=b.getNamedItem("data-anim-type")?b.getNamedItem("data-anim-type").value:b.getNamedItem("data-bm-type")?b.getNamedItem("data-bm-type").value:b.getNamedItem("bm-type")?b.getNamedItem("bm-type").value:b.getNamedItem("data-bm-renderer")?b.getNamedItem("data-bm-renderer").value:b.getNamedItem("bm-renderer")?b.getNamedItem("bm-renderer").value:getRegisteredRenderer()||"canvas";var _e=b.getNamedItem("data-anim-loop")?b.getNamedItem("data-anim-loop").value:b.getNamedItem("data-bm-loop")?b.getNamedItem("data-bm-loop").value:b.getNamedItem("bm-loop")?b.getNamedItem("bm-loop").value:"";_e==="false"?a.loop=!1:_e==="true"?a.loop=!0:_e!==""&&(a.loop=parseInt(_e,10));var Kt=b.getNamedItem("data-anim-autoplay")?b.getNamedItem("data-anim-autoplay").value:b.getNamedItem("data-bm-autoplay")?b.getNamedItem("data-bm-autoplay").value:b.getNamedItem("bm-autoplay")?b.getNamedItem("bm-autoplay").value:!0;a.autoplay=Kt!=="false",a.name=b.getNamedItem("data-name")?b.getNamedItem("data-name").value:b.getNamedItem("data-bm-name")?b.getNamedItem("data-bm-name").value:b.getNamedItem("bm-name")?b.getNamedItem("bm-name").value:"";var an=b.getNamedItem("data-anim-prerender")?b.getNamedItem("data-anim-prerender").value:b.getNamedItem("data-bm-prerender")?b.getNamedItem("data-bm-prerender").value:b.getNamedItem("bm-prerender")?b.getNamedItem("bm-prerender").value:"";an==="false"&&(a.prerender=!1),a.path?this.setParams(a):this.trigger("destroy")},AnimationItem.prototype.includeLayers=function(o){o.op>this.animationData.op&&(this.animationData.op=o.op,this.totalFrames=Math.floor(o.op-this.animationData.ip));var s=this.animationData.layers,a,b=s.length,_e=o.layers,Kt,an=_e.length;for(Kt=0;Kt<an;Kt+=1)for(a=0;a<b;){if(s[a].id===_e[Kt].id){s[a]=_e[Kt];break}a+=1}if((o.chars||o.fonts)&&(this.renderer.globalData.fontManager.addChars(o.chars),this.renderer.globalData.fontManager.addFonts(o.fonts,this.renderer.globalData.defs)),o.assets)for(b=o.assets.length,a=0;a<b;a+=1)this.animationData.assets.push(o.assets[a]);this.animationData.__complete=!1,dataManager.completeAnimation(this.animationData,this.onSegmentComplete)},AnimationItem.prototype.onSegmentComplete=function(o){this.animationData=o;var s=getExpressionsPlugin();s&&s.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var o=this.animationData.segments;if(!o||o.length===0||!this.autoloadSegments){this.trigger("data_ready"),this.timeCompleted=this.totalFrames;return}var s=o.shift();this.timeCompleted=s.time*this.frameRate;var a=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,dataManager.loadData(a,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},AnimationItem.prototype.loadSegments=function(){var o=this.animationData.segments;o||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(o){if(this.renderer)try{this.animationData=o,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(o),o.assets||(o.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(o.assets),this.markers=markerParser(o.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(s){this.triggerConfigError(s)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||this.renderer.rendererType!=="canvas")&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var o=getExpressionsPlugin();o&&o.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},AnimationItem.prototype.resize=function(o,s){var a=typeof o=="number"?o:void 0,b=typeof s=="number"?s:void 0;this.renderer.updateContainerSize(a,b)},AnimationItem.prototype.setSubframe=function(o){this.isSubframeEnabled=!!o},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(o){this.triggerRenderFrameError(o)}},AnimationItem.prototype.play=function(o){o&&this.name!==o||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(o){o&&this.name!==o||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(o){o&&this.name!==o||(this.isPaused===!0?this.play():this.pause())},AnimationItem.prototype.stop=function(o){o&&this.name!==o||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(o){for(var s,a=0;a<this.markers.length;a+=1)if(s=this.markers[a],s.payload&&s.payload.name===o)return s;return null},AnimationItem.prototype.goToAndStop=function(o,s,a){if(!(a&&this.name!==a)){var b=Number(o);if(isNaN(b)){var _e=this.getMarkerData(o);_e&&this.goToAndStop(_e.time,!0)}else s?this.setCurrentRawFrameValue(o):this.setCurrentRawFrameValue(o*this.frameModifier);this.pause()}},AnimationItem.prototype.goToAndPlay=function(o,s,a){if(!(a&&this.name!==a)){var b=Number(o);if(isNaN(b)){var _e=this.getMarkerData(o);_e&&(_e.duration?this.playSegments([_e.time,_e.time+_e.duration],!0):this.goToAndStop(_e.time,!0))}else this.goToAndStop(b,s,a);this.play()}},AnimationItem.prototype.advanceTime=function(o){if(!(this.isPaused===!0||this.isLoaded===!1)){var s=this.currentRawFrame+o*this.frameModifier,a=!1;s>=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(s>this.totalFrames?s%this.totalFrames:0)||(a=!0,s=this.totalFrames-1):s>=this.totalFrames?(this.playCount+=1,this.checkSegments(s%this.totalFrames)||(this.setCurrentRawFrameValue(s%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(s):s<0?this.checkSegments(s%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+s%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(a=!0,s=0)):this.setCurrentRawFrameValue(s),a&&(this.setCurrentRawFrameValue(s),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(o,s){this.playCount=0,o[1]<o[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=o[0]-o[1],this.timeCompleted=this.totalFrames,this.firstFrame=o[1],this.setCurrentRawFrameValue(this.totalFrames-.001-s)):o[1]>o[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=o[1]-o[0],this.timeCompleted=this.totalFrames,this.firstFrame=o[0],this.setCurrentRawFrameValue(.001+s)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(o,s){var a=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<o?a=o:this.currentRawFrame+this.firstFrame>s&&(a=s-o)),this.firstFrame=o,this.totalFrames=s-o,this.timeCompleted=this.totalFrames,a!==-1&&this.goToAndStop(a,!0)},AnimationItem.prototype.playSegments=function(o,s){if(s&&(this.segments.length=0),_typeof$4(o[0])==="object"){var a,b=o.length;for(a=0;a<b;a+=1)this.segments.push(o[a])}else this.segments.push(o);this.segments.length&&s&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(o){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),o&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(o){return this.segments.length?(this.adjustSegment(this.segments.shift(),o),!0):!1},AnimationItem.prototype.destroy=function(o){o&&this.name!==o||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(o){this.currentRawFrame=o,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(o){this.playSpeed=o,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(o){this.playDirection=o<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setLoop=function(o){this.loop=o},AnimationItem.prototype.setVolume=function(o,s){s&&this.name!==s||this.audioController.setVolume(o)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(o){o&&this.name!==o||this.audioController.mute()},AnimationItem.prototype.unmute=function(o){o&&this.name!==o||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(o){var s="";if(o.e)s=o.p;else if(this.assetsPath){var a=o.p;a.indexOf("images/")!==-1&&(a=a.split("/")[1]),s=this.assetsPath+a}else s=this.path,s+=o.u?o.u:"",s+=o.p;return s},AnimationItem.prototype.getAssetData=function(o){for(var s=0,a=this.assets.length;s<a;){if(o===this.assets[s].id)return this.assets[s];s+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(o){return o?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.updateDocumentData=function(o,s,a){try{var b=this.renderer.getElementByPath(o);b.updateDocumentData(s,a)}catch{}},AnimationItem.prototype.trigger=function(o){if(this._cbs&&this._cbs[o])switch(o){case"enterFrame":this.triggerEvent(o,new BMEnterFrameEvent(o,this.currentFrame,this.totalFrames,this.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(o,this.drawnFrameEvent);break;case"loopComplete":this.triggerEvent(o,new BMCompleteLoopEvent(o,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(o,new BMCompleteEvent(o,this.frameMult));break;case"segmentStart":this.triggerEvent(o,new BMSegmentStartEvent(o,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(o,new BMDestroyEvent(o,this));break;default:this.triggerEvent(o)}o==="enterFrame"&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(o,this.currentFrame,this.totalFrames,this.frameMult)),o==="loopComplete"&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(o,this.loop,this.playCount,this.frameMult)),o==="complete"&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(o,this.frameMult)),o==="segmentStart"&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(o,this.firstFrame,this.totalFrames)),o==="destroy"&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(o,this))},AnimationItem.prototype.triggerRenderFrameError=function(o){var s=new BMRenderFrameErrorEvent(o,this.currentFrame);this.triggerEvent("error",s),this.onError&&this.onError.call(this,s)},AnimationItem.prototype.triggerConfigError=function(o){var s=new BMConfigErrorEvent(o,this.currentFrame);this.triggerEvent("error",s),this.onError&&this.onError.call(this,s)};var animationManager=function(){var o={},s=[],a=0,b=0,_e=0,Kt=!0,an=!1;function _n(_f){for(var np=0,_l=_f.target;np<b;)s[np].animation===_l&&(s.splice(np,1),np-=1,b-=1,_l.isPaused||fr()),np+=1}function On(_f,np){if(!_f)return null;for(var _l=0;_l<b;){if(s[_l].elem===_f&&s[_l].elem!==null)return s[_l].animation;_l+=1}var Ml=new AnimationItem;return pr(Ml,_f),Ml.setData(_f,np),Ml}function $n(){var _f,np=s.length,_l=[];for(_f=0;_f<np;_f+=1)_l.push(s[_f].animation);return _l}function dr(){_e+=1,xo()}function fr(){_e-=1}function pr(_f,np){_f.addEventListener("destroy",_n),_f.addEventListener("_active",dr),_f.addEventListener("_idle",fr),s.push({elem:np,animation:_f}),b+=1}function Ar(_f){var np=new AnimationItem;return pr(np,null),np.setParams(_f),np}function Or(_f,np){var _l;for(_l=0;_l<b;_l+=1)s[_l].animation.setSpeed(_f,np)}function Xr(_f,np){var _l;for(_l=0;_l<b;_l+=1)s[_l].animation.setDirection(_f,np)}function ss(_f){var np;for(np=0;np<b;np+=1)s[np].animation.play(_f)}function kr(_f){var np=_f-a,_l;for(_l=0;_l<b;_l+=1)s[_l].animation.advanceTime(np);a=_f,_e&&!an?window.requestAnimationFrame(kr):Kt=!0}function us(_f){a=_f,window.requestAnimationFrame(kr)}function hs(_f){var np;for(np=0;np<b;np+=1)s[np].animation.pause(_f)}function ds(_f,np,_l){var Ml;for(Ml=0;Ml<b;Ml+=1)s[Ml].animation.goToAndStop(_f,np,_l)}function fs(_f){var np;for(np=0;np<b;np+=1)s[np].animation.stop(_f)}function Gs(_f){var np;for(np=0;np<b;np+=1)s[np].animation.togglePause(_f)}function ga(_f){var np;for(np=b-1;np>=0;np-=1)s[np].animation.destroy(_f)}function So(_f,np,_l){var Ml=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),tp,El=Ml.length;for(tp=0;tp<El;tp+=1)_l&&Ml[tp].setAttribute("data-bm-type",_l),On(Ml[tp],_f);if(np&&El===0){_l||(_l="svg");var sp=document.getElementsByTagName("body")[0];sp.innerText="";var My=createTag("div");My.style.width="100%",My.style.height="100%",My.setAttribute("data-bm-type",_l),sp.appendChild(My),On(My,_f)}}function go(){var _f;for(_f=0;_f<b;_f+=1)s[_f].animation.resize()}function xo(){!an&&_e&&Kt&&(window.requestAnimationFrame(us),Kt=!1)}function Mo(){an=!0}function yl(){an=!1,xo()}function Al(_f,np){var _l;for(_l=0;_l<b;_l+=1)s[_l].animation.setVolume(_f,np)}function xl(_f){var np;for(np=0;np<b;np+=1)s[np].animation.mute(_f)}function ep(_f){var np;for(np=0;np<b;np+=1)s[np].animation.unmute(_f)}return o.registerAnimation=On,o.loadAnimation=Ar,o.setSpeed=Or,o.setDirection=Xr,o.play=ss,o.pause=hs,o.stop=fs,o.togglePause=Gs,o.searchAnimations=So,o.resize=go,o.goToAndStop=ds,o.destroy=ga,o.freeze=Mo,o.unfreeze=yl,o.setVolume=Al,o.mute=xl,o.unmute=ep,o.getRegisteredAnimations=$n,o}(),BezierFactory=function(){var o={};o.getBezierEasing=a;var s={};function a(us,hs,ds,fs,Gs){var ga=Gs||("bez_"+us+"_"+hs+"_"+ds+"_"+fs).replace(/\./g,"p");if(s[ga])return s[ga];var So=new kr([us,hs,ds,fs]);return s[ga]=So,So}var b=4,_e=.001,Kt=1e-7,an=10,_n=11,On=1/(_n-1),$n=typeof Float32Array=="function";function dr(us,hs){return 1-3*hs+3*us}function fr(us,hs){return 3*hs-6*us}function pr(us){return 3*us}function Ar(us,hs,ds){return((dr(hs,ds)*us+fr(hs,ds))*us+pr(hs))*us}function Or(us,hs,ds){return 3*dr(hs,ds)*us*us+2*fr(hs,ds)*us+pr(hs)}function Xr(us,hs,ds,fs,Gs){var ga,So,go=0;do So=hs+(ds-hs)/2,ga=Ar(So,fs,Gs)-us,ga>0?ds=So:hs=So;while(Math.abs(ga)>Kt&&++go<an);return So}function ss(us,hs,ds,fs){for(var Gs=0;Gs<b;++Gs){var ga=Or(hs,ds,fs);if(ga===0)return hs;var So=Ar(hs,ds,fs)-us;hs-=So/ga}return hs}function kr(us){this._p=us,this._mSampleValues=$n?new Float32Array(_n):new Array(_n),this._precomputed=!1,this.get=this.get.bind(this)}return kr.prototype={get:function(hs){var ds=this._p[0],fs=this._p[1],Gs=this._p[2],ga=this._p[3];return this._precomputed||this._precompute(),ds===fs&&Gs===ga?hs:hs===0?0:hs===1?1:Ar(this._getTForX(hs),fs,ga)},_precompute:function(){var hs=this._p[0],ds=this._p[1],fs=this._p[2],Gs=this._p[3];this._precomputed=!0,(hs!==ds||fs!==Gs)&&this._calcSampleValues()},_calcSampleValues:function(){for(var hs=this._p[0],ds=this._p[2],fs=0;fs<_n;++fs)this._mSampleValues[fs]=Ar(fs*On,hs,ds)},_getTForX:function(hs){for(var ds=this._p[0],fs=this._p[2],Gs=this._mSampleValues,ga=0,So=1,go=_n-1;So!==go&&Gs[So]<=hs;++So)ga+=On;--So;var xo=(hs-Gs[So])/(Gs[So+1]-Gs[So]),Mo=ga+xo*On,yl=Or(Mo,ds,fs);return yl>=_e?ss(hs,Mo,ds,fs):yl===0?Mo:Xr(hs,ga,ga+On,ds,fs)}},o}(),pooling=function(){function o(s){return s.concat(createSizedArray(s.length))}return{double:o}}(),poolFactory=function(){return function(o,s,a){var b=0,_e=o,Kt=createSizedArray(_e),an={newElement:_n,release:On};function _n(){var $n;return b?(b-=1,$n=Kt[b]):$n=s(),$n}function On($n){b===_e&&(Kt=pooling.double(Kt),_e*=2),a&&a($n),Kt[b]=$n,b+=1}return an}}(),bezierLengthPool=function(){function o(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,o)}(),segmentsLengthPool=function(){function o(){return{lengths:[],totalLength:0}}function s(a){var b,_e=a.lengths.length;for(b=0;b<_e;b+=1)bezierLengthPool.release(a.lengths[b]);a.lengths.length=0}return poolFactory(8,o,s)}();function bezFunction(){var o=Math;function s(pr,Ar,Or,Xr,ss,kr){var us=pr*Xr+Ar*ss+Or*kr-ss*Xr-kr*pr-Or*Ar;return us>-.001&&us<.001}function a(pr,Ar,Or,Xr,ss,kr,us,hs,ds){if(Or===0&&kr===0&&ds===0)return s(pr,Ar,Xr,ss,us,hs);var fs=o.sqrt(o.pow(Xr-pr,2)+o.pow(ss-Ar,2)+o.pow(kr-Or,2)),Gs=o.sqrt(o.pow(us-pr,2)+o.pow(hs-Ar,2)+o.pow(ds-Or,2)),ga=o.sqrt(o.pow(us-Xr,2)+o.pow(hs-ss,2)+o.pow(ds-kr,2)),So;return fs>Gs?fs>ga?So=fs-Gs-ga:So=ga-Gs-fs:ga>Gs?So=ga-Gs-fs:So=Gs-fs-ga,So>-1e-4&&So<1e-4}var b=function(){return function(pr,Ar,Or,Xr){var ss=getDefaultCurveSegments(),kr,us,hs,ds,fs,Gs=0,ga,So=[],go=[],xo=bezierLengthPool.newElement();for(hs=Or.length,kr=0;kr<ss;kr+=1){for(fs=kr/(ss-1),ga=0,us=0;us<hs;us+=1)ds=bmPow(1-fs,3)*pr[us]+3*bmPow(1-fs,2)*fs*Or[us]+3*(1-fs)*bmPow(fs,2)*Xr[us]+bmPow(fs,3)*Ar[us],So[us]=ds,go[us]!==null&&(ga+=bmPow(So[us]-go[us],2)),go[us]=So[us];ga&&(ga=bmSqrt(ga),Gs+=ga),xo.percents[kr]=fs,xo.lengths[kr]=Gs}return xo.addedLength=Gs,xo}}();function _e(pr){var Ar=segmentsLengthPool.newElement(),Or=pr.c,Xr=pr.v,ss=pr.o,kr=pr.i,us,hs=pr._length,ds=Ar.lengths,fs=0;for(us=0;us<hs-1;us+=1)ds[us]=b(Xr[us],Xr[us+1],ss[us],kr[us+1]),fs+=ds[us].addedLength;return Or&&hs&&(ds[us]=b(Xr[us],Xr[0],ss[us],kr[0]),fs+=ds[us].addedLength),Ar.totalLength=fs,Ar}function Kt(pr){this.segmentLength=0,this.points=new Array(pr)}function an(pr,Ar){this.partialLength=pr,this.point=Ar}var _n=function(){var pr={};return function(Ar,Or,Xr,ss){var kr=(Ar[0]+"_"+Ar[1]+"_"+Or[0]+"_"+Or[1]+"_"+Xr[0]+"_"+Xr[1]+"_"+ss[0]+"_"+ss[1]).replace(/\./g,"p");if(!pr[kr]){var us=getDefaultCurveSegments(),hs,ds,fs,Gs,ga,So=0,go,xo,Mo=null;Ar.length===2&&(Ar[0]!==Or[0]||Ar[1]!==Or[1])&&s(Ar[0],Ar[1],Or[0],Or[1],Ar[0]+Xr[0],Ar[1]+Xr[1])&&s(Ar[0],Ar[1],Or[0],Or[1],Or[0]+ss[0],Or[1]+ss[1])&&(us=2);var yl=new Kt(us);for(fs=Xr.length,hs=0;hs<us;hs+=1){for(xo=createSizedArray(fs),ga=hs/(us-1),go=0,ds=0;ds<fs;ds+=1)Gs=bmPow(1-ga,3)*Ar[ds]+3*bmPow(1-ga,2)*ga*(Ar[ds]+Xr[ds])+3*(1-ga)*bmPow(ga,2)*(Or[ds]+ss[ds])+bmPow(ga,3)*Or[ds],xo[ds]=Gs,Mo!==null&&(go+=bmPow(xo[ds]-Mo[ds],2));go=bmSqrt(go),So+=go,yl.points[hs]=new an(go,xo),Mo=xo}yl.segmentLength=So,pr[kr]=yl}return pr[kr]}}();function On(pr,Ar){var Or=Ar.percents,Xr=Ar.lengths,ss=Or.length,kr=bmFloor((ss-1)*pr),us=pr*Ar.addedLength,hs=0;if(kr===ss-1||kr===0||us===Xr[kr])return Or[kr];for(var ds=Xr[kr]>us?-1:1,fs=!0;fs;)if(Xr[kr]<=us&&Xr[kr+1]>us?(hs=(us-Xr[kr])/(Xr[kr+1]-Xr[kr]),fs=!1):kr+=ds,kr<0||kr>=ss-1){if(kr===ss-1)return Or[kr];fs=!1}return Or[kr]+(Or[kr+1]-Or[kr])*hs}function $n(pr,Ar,Or,Xr,ss,kr){var us=On(ss,kr),hs=1-us,ds=o.round((hs*hs*hs*pr[0]+(us*hs*hs+hs*us*hs+hs*hs*us)*Or[0]+(us*us*hs+hs*us*us+us*hs*us)*Xr[0]+us*us*us*Ar[0])*1e3)/1e3,fs=o.round((hs*hs*hs*pr[1]+(us*hs*hs+hs*us*hs+hs*hs*us)*Or[1]+(us*us*hs+hs*us*us+us*hs*us)*Xr[1]+us*us*us*Ar[1])*1e3)/1e3;return[ds,fs]}var dr=createTypedArray("float32",8);function fr(pr,Ar,Or,Xr,ss,kr,us){ss<0?ss=0:ss>1&&(ss=1);var hs=On(ss,us);kr=kr>1?1:kr;var ds=On(kr,us),fs,Gs=pr.length,ga=1-hs,So=1-ds,go=ga*ga*ga,xo=hs*ga*ga*3,Mo=hs*hs*ga*3,yl=hs*hs*hs,Al=ga*ga*So,xl=hs*ga*So+ga*hs*So+ga*ga*ds,ep=hs*hs*So+ga*hs*ds+hs*ga*ds,_f=hs*hs*ds,np=ga*So*So,_l=hs*So*So+ga*ds*So+ga*So*ds,Ml=hs*ds*So+ga*ds*ds+hs*So*ds,tp=hs*ds*ds,El=So*So*So,sp=ds*So*So+So*ds*So+So*So*ds,My=ds*ds*So+So*ds*ds+ds*So*ds,Py=ds*ds*ds;for(fs=0;fs<Gs;fs+=1)dr[fs*4]=o.round((go*pr[fs]+xo*Or[fs]+Mo*Xr[fs]+yl*Ar[fs])*1e3)/1e3,dr[fs*4+1]=o.round((Al*pr[fs]+xl*Or[fs]+ep*Xr[fs]+_f*Ar[fs])*1e3)/1e3,dr[fs*4+2]=o.round((np*pr[fs]+_l*Or[fs]+Ml*Xr[fs]+tp*Ar[fs])*1e3)/1e3,dr[fs*4+3]=o.round((El*pr[fs]+sp*Or[fs]+My*Xr[fs]+Py*Ar[fs])*1e3)/1e3;return dr}return{getSegmentsLength:_e,getNewSegment:fr,getPointInSegment:$n,buildBezierData:_n,pointOnLine2D:s,pointOnLine3D:a}}var bez=bezFunction(),initFrame=initialDefaultFrame,mathAbs=Math.abs;function interpolateValue(o,s){var a=this.offsetTime,b;this.propType==="multidimensional"&&(b=createTypedArray("float32",this.pv.length));for(var _e=s.lastIndex,Kt=_e,an=this.keyframes.length-1,_n=!0,On,$n,dr;_n;){if(On=this.keyframes[Kt],$n=this.keyframes[Kt+1],Kt===an-1&&o>=$n.t-a){On.h&&(On=$n),_e=0;break}if($n.t-a>o){_e=Kt;break}Kt<an-1?Kt+=1:(_e=0,_n=!1)}dr=this.keyframesMetadata[Kt]||{};var fr,pr,Ar,Or,Xr,ss,kr=$n.t-a,us=On.t-a,hs;if(On.to){dr.bezierData||(dr.bezierData=bez.buildBezierData(On.s,$n.s||On.e,On.to,On.ti));var ds=dr.bezierData;if(o>=kr||o<us){var fs=o>=kr?ds.points.length-1:0;for(pr=ds.points[fs].point.length,fr=0;fr<pr;fr+=1)b[fr]=ds.points[fs].point[fr]}else{dr.__fnct?ss=dr.__fnct:(ss=BezierFactory.getBezierEasing(On.o.x,On.o.y,On.i.x,On.i.y,On.n).get,dr.__fnct=ss),Ar=ss((o-us)/(kr-us));var Gs=ds.segmentLength*Ar,ga,So=s.lastFrame<o&&s._lastKeyframeIndex===Kt?s._lastAddedLength:0;for(Xr=s.lastFrame<o&&s._lastKeyframeIndex===Kt?s._lastPoint:0,_n=!0,Or=ds.points.length;_n;){if(So+=ds.points[Xr].partialLength,Gs===0||Ar===0||Xr===ds.points.length-1){for(pr=ds.points[Xr].point.length,fr=0;fr<pr;fr+=1)b[fr]=ds.points[Xr].point[fr];break}else if(Gs>=So&&Gs<So+ds.points[Xr+1].partialLength){for(ga=(Gs-So)/ds.points[Xr+1].partialLength,pr=ds.points[Xr].point.length,fr=0;fr<pr;fr+=1)b[fr]=ds.points[Xr].point[fr]+(ds.points[Xr+1].point[fr]-ds.points[Xr].point[fr])*ga;break}Xr<Or-1?Xr+=1:_n=!1}s._lastPoint=Xr,s._lastAddedLength=So-ds.points[Xr].partialLength,s._lastKeyframeIndex=Kt}}else{var go,xo,Mo,yl,Al;if(an=On.s.length,hs=$n.s||On.e,this.sh&&On.h!==1)if(o>=kr)b[0]=hs[0],b[1]=hs[1],b[2]=hs[2];else if(o<=us)b[0]=On.s[0],b[1]=On.s[1],b[2]=On.s[2];else{var xl=createQuaternion(On.s),ep=createQuaternion(hs),_f=(o-us)/(kr-us);quaternionToEuler(b,slerp(xl,ep,_f))}else for(Kt=0;Kt<an;Kt+=1)On.h!==1&&(o>=kr?Ar=1:o<us?Ar=0:(On.o.x.constructor===Array?(dr.__fnct||(dr.__fnct=[]),dr.__fnct[Kt]?ss=dr.__fnct[Kt]:(go=On.o.x[Kt]===void 0?On.o.x[0]:On.o.x[Kt],xo=On.o.y[Kt]===void 0?On.o.y[0]:On.o.y[Kt],Mo=On.i.x[Kt]===void 0?On.i.x[0]:On.i.x[Kt],yl=On.i.y[Kt]===void 0?On.i.y[0]:On.i.y[Kt],ss=BezierFactory.getBezierEasing(go,xo,Mo,yl).get,dr.__fnct[Kt]=ss)):dr.__fnct?ss=dr.__fnct:(go=On.o.x,xo=On.o.y,Mo=On.i.x,yl=On.i.y,ss=BezierFactory.getBezierEasing(go,xo,Mo,yl).get,On.keyframeMetadata=ss),Ar=ss((o-us)/(kr-us)))),hs=$n.s||On.e,Al=On.h===1?On.s[Kt]:On.s[Kt]+(hs[Kt]-On.s[Kt])*Ar,this.propType==="multidimensional"?b[Kt]=Al:b=Al}return s.lastIndex=_e,b}function slerp(o,s,a){var b=[],_e=o[0],Kt=o[1],an=o[2],_n=o[3],On=s[0],$n=s[1],dr=s[2],fr=s[3],pr,Ar,Or,Xr,ss;return Ar=_e*On+Kt*$n+an*dr+_n*fr,Ar<0&&(Ar=-Ar,On=-On,$n=-$n,dr=-dr,fr=-fr),1-Ar>1e-6?(pr=Math.acos(Ar),Or=Math.sin(pr),Xr=Math.sin((1-a)*pr)/Or,ss=Math.sin(a*pr)/Or):(Xr=1-a,ss=a),b[0]=Xr*_e+ss*On,b[1]=Xr*Kt+ss*$n,b[2]=Xr*an+ss*dr,b[3]=Xr*_n+ss*fr,b}function quaternionToEuler(o,s){var a=s[0],b=s[1],_e=s[2],Kt=s[3],an=Math.atan2(2*b*Kt-2*a*_e,1-2*b*b-2*_e*_e),_n=Math.asin(2*a*b+2*_e*Kt),On=Math.atan2(2*a*Kt-2*b*_e,1-2*a*a-2*_e*_e);o[0]=an/degToRads,o[1]=_n/degToRads,o[2]=On/degToRads}function createQuaternion(o){var s=o[0]*degToRads,a=o[1]*degToRads,b=o[2]*degToRads,_e=Math.cos(s/2),Kt=Math.cos(a/2),an=Math.cos(b/2),_n=Math.sin(s/2),On=Math.sin(a/2),$n=Math.sin(b/2),dr=_e*Kt*an-_n*On*$n,fr=_n*On*an+_e*Kt*$n,pr=_n*Kt*an+_e*On*$n,Ar=_e*On*an-_n*Kt*$n;return[fr,pr,Ar,dr]}function getValueAtCurrentTime(){var o=this.comp.renderedFrame-this.offsetTime,s=this.keyframes[0].t-this.offsetTime,a=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(o===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=a&&o>=a||this._caching.lastFrame<s&&o<s))){this._caching.lastFrame>=o&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var b=this.interpolateValue(o,this._caching);this.pv=b}return this._caching.lastFrame=o,this.pv}function setVValue(o){var s;if(this.propType==="unidimensional")s=o*this.mult,mathAbs(this.v-s)>1e-5&&(this.v=s,this._mdf=!0);else for(var a=0,b=this.v.length;a<b;)s=o[a]*this.mult,mathAbs(this.v[a]-s)>1e-5&&(this.v[a]=s,this._mdf=!0),a+=1}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var o,s=this.effectsSequence.length,a=this.kf?this.pv:this.data.k;for(o=0;o<s;o+=1)a=this.effectsSequence[o](a);this.setVValue(a),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function addEffect(o){this.effectsSequence.push(o),this.container.addDynamicProperty(this)}function ValueProperty(o,s,a,b){this.propType="unidimensional",this.mult=a||1,this.data=s,this.v=a?s.k*a:s.k,this.pv=s.k,this._mdf=!1,this.elem=o,this.container=b,this.comp=o.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function MultiDimensionalProperty(o,s,a,b){this.propType="multidimensional",this.mult=a||1,this.data=s,this._mdf=!1,this.elem=o,this.container=b,this.comp=o.comp,this.k=!1,this.kf=!1,this.frameId=-1;var _e,Kt=s.k.length;for(this.v=createTypedArray("float32",Kt),this.pv=createTypedArray("float32",Kt),this.vel=createTypedArray("float32",Kt),_e=0;_e<Kt;_e+=1)this.v[_e]=s.k[_e]*this.mult,this.pv[_e]=s.k[_e];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function KeyframedValueProperty(o,s,a,b){this.propType="unidimensional",this.keyframes=s.k,this.keyframesMetadata=[],this.offsetTime=o.data.st,this.frameId=-1,this._caching={lastFrame:initFrame,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=s,this.mult=a||1,this.elem=o,this.container=b,this.comp=o.comp,this.v=initFrame,this.pv=initFrame,this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.addEffect=addEffect}function KeyframedMultidimensionalProperty(o,s,a,b){this.propType="multidimensional";var _e,Kt=s.k.length,an,_n,On,$n;for(_e=0;_e<Kt-1;_e+=1)s.k[_e].to&&s.k[_e].s&&s.k[_e+1]&&s.k[_e+1].s&&(an=s.k[_e].s,_n=s.k[_e+1].s,On=s.k[_e].to,$n=s.k[_e].ti,(an.length===2&&!(an[0]===_n[0]&&an[1]===_n[1])&&bez.pointOnLine2D(an[0],an[1],_n[0],_n[1],an[0]+On[0],an[1]+On[1])&&bez.pointOnLine2D(an[0],an[1],_n[0],_n[1],_n[0]+$n[0],_n[1]+$n[1])||an.length===3&&!(an[0]===_n[0]&&an[1]===_n[1]&&an[2]===_n[2])&&bez.pointOnLine3D(an[0],an[1],an[2],_n[0],_n[1],_n[2],an[0]+On[0],an[1]+On[1],an[2]+On[2])&&bez.pointOnLine3D(an[0],an[1],an[2],_n[0],_n[1],_n[2],_n[0]+$n[0],_n[1]+$n[1],_n[2]+$n[2]))&&(s.k[_e].to=null,s.k[_e].ti=null),an[0]===_n[0]&&an[1]===_n[1]&&On[0]===0&&On[1]===0&&$n[0]===0&&$n[1]===0&&(an.length===2||an[2]===_n[2]&&On[2]===0&&$n[2]===0)&&(s.k[_e].to=null,s.k[_e].ti=null));this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.data=s,this.keyframes=s.k,this.keyframesMetadata=[],this.offsetTime=o.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=a||1,this.elem=o,this.container=b,this.comp=o.comp,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.frameId=-1;var dr=s.k[0].s.length;for(this.v=createTypedArray("float32",dr),this.pv=createTypedArray("float32",dr),_e=0;_e<dr;_e+=1)this.v[_e]=initFrame,this.pv[_e]=initFrame;this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray("float32",dr)},this.addEffect=addEffect}var PropertyFactory=function(){function o(a,b,_e,Kt,an){b.sid&&(b=a.globalData.slotManager.getProp(b));var _n;if(!b.k.length)_n=new ValueProperty(a,b,Kt,an);else if(typeof b.k[0]=="number")_n=new MultiDimensionalProperty(a,b,Kt,an);else switch(_e){case 0:_n=new KeyframedValueProperty(a,b,Kt,an);break;case 1:_n=new KeyframedMultidimensionalProperty(a,b,Kt,an);break}return _n.effectsSequence.length&&an.addDynamicProperty(_n),_n}var s={getProp:o};return s}();function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(s){this.dynamicProperties.indexOf(s)===-1&&(this.dynamicProperties.push(s),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){this._mdf=!1;var s,a=this.dynamicProperties.length;for(s=0;s<a;s+=1)this.dynamicProperties[s].getValue(),this.dynamicProperties[s]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(s){this.container=s,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var pointPool=function(){function o(){return createTypedArray("float32",2)}return poolFactory(8,o)}();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(o,s){this.c=o,this.setLength(s);for(var a=0;a<s;)this.v[a]=pointPool.newElement(),this.o[a]=pointPool.newElement(),this.i[a]=pointPool.newElement(),a+=1},ShapePath.prototype.setLength=function(o){for(;this._maxLength<o;)this.doubleArrayLength();this._length=o},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(o,s,a,b,_e){var Kt;switch(this._length=Math.max(this._length,b+1),this._length>=this._maxLength&&this.doubleArrayLength(),a){case"v":Kt=this.v;break;case"i":Kt=this.i;break;case"o":Kt=this.o;break;default:Kt=[];break}(!Kt[b]||Kt[b]&&!_e)&&(Kt[b]=pointPool.newElement()),Kt[b][0]=o,Kt[b][1]=s},ShapePath.prototype.setTripleAt=function(o,s,a,b,_e,Kt,an,_n){this.setXYAt(o,s,"v",an,_n),this.setXYAt(a,b,"o",an,_n),this.setXYAt(_e,Kt,"i",an,_n)},ShapePath.prototype.reverse=function(){var o=new ShapePath;o.setPathData(this.c,this._length);var s=this.v,a=this.o,b=this.i,_e=0;this.c&&(o.setTripleAt(s[0][0],s[0][1],b[0][0],b[0][1],a[0][0],a[0][1],0,!1),_e=1);var Kt=this._length-1,an=this._length,_n;for(_n=_e;_n<an;_n+=1)o.setTripleAt(s[Kt][0],s[Kt][1],b[Kt][0],b[Kt][1],a[Kt][0],a[Kt][1],_n,!1),Kt-=1;return o},ShapePath.prototype.length=function(){return this._length};var shapePool=function(){function o(){return new ShapePath}function s(_e){var Kt=_e._length,an;for(an=0;an<Kt;an+=1)pointPool.release(_e.v[an]),pointPool.release(_e.i[an]),pointPool.release(_e.o[an]),_e.v[an]=null,_e.i[an]=null,_e.o[an]=null;_e._length=0,_e.c=!1}function a(_e){var Kt=b.newElement(),an,_n=_e._length===void 0?_e.v.length:_e._length;for(Kt.setLength(_n),Kt.c=_e.c,an=0;an<_n;an+=1)Kt.setTripleAt(_e.v[an][0],_e.v[an][1],_e.o[an][0],_e.o[an][1],_e.i[an][0],_e.i[an][1],an);return Kt}var b=poolFactory(4,o,s);return b.clone=a,b}();function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}ShapeCollection.prototype.addShape=function(o){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=o,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var o;for(o=0;o<this._length;o+=1)shapePool.release(this.shapes[o]);this._length=0};var shapeCollectionPool=function(){var o={newShapeCollection:_e,release:Kt},s=0,a=4,b=createSizedArray(a);function _e(){var an;return s?(s-=1,an=b[s]):an=new ShapeCollection,an}function Kt(an){var _n,On=an._length;for(_n=0;_n<On;_n+=1)shapePool.release(an.shapes[_n]);an._length=0,s===a&&(b=pooling.double(b),a*=2),b[s]=an,s+=1}return o}(),ShapePropertyFactory=function(){var o=-999999;function s(kr,us,hs){var ds=hs.lastIndex,fs,Gs,ga,So,go,xo,Mo,yl,Al,xl=this.keyframes;if(kr<xl[0].t-this.offsetTime)fs=xl[0].s[0],ga=!0,ds=0;else if(kr>=xl[xl.length-1].t-this.offsetTime)fs=xl[xl.length-1].s?xl[xl.length-1].s[0]:xl[xl.length-2].e[0],ga=!0;else{for(var ep=ds,_f=xl.length-1,np=!0,_l,Ml,tp;np&&(_l=xl[ep],Ml=xl[ep+1],!(Ml.t-this.offsetTime>kr));)ep<_f-1?ep+=1:np=!1;if(tp=this.keyframesMetadata[ep]||{},ga=_l.h===1,ds=ep,!ga){if(kr>=Ml.t-this.offsetTime)yl=1;else if(kr<_l.t-this.offsetTime)yl=0;else{var El;tp.__fnct?El=tp.__fnct:(El=BezierFactory.getBezierEasing(_l.o.x,_l.o.y,_l.i.x,_l.i.y).get,tp.__fnct=El),yl=El((kr-(_l.t-this.offsetTime))/(Ml.t-this.offsetTime-(_l.t-this.offsetTime)))}Gs=Ml.s?Ml.s[0]:_l.e[0]}fs=_l.s[0]}for(xo=us._length,Mo=fs.i[0].length,hs.lastIndex=ds,So=0;So<xo;So+=1)for(go=0;go<Mo;go+=1)Al=ga?fs.i[So][go]:fs.i[So][go]+(Gs.i[So][go]-fs.i[So][go])*yl,us.i[So][go]=Al,Al=ga?fs.o[So][go]:fs.o[So][go]+(Gs.o[So][go]-fs.o[So][go])*yl,us.o[So][go]=Al,Al=ga?fs.v[So][go]:fs.v[So][go]+(Gs.v[So][go]-fs.v[So][go])*yl,us.v[So][go]=Al}function a(){var kr=this.comp.renderedFrame-this.offsetTime,us=this.keyframes[0].t-this.offsetTime,hs=this.keyframes[this.keyframes.length-1].t-this.offsetTime,ds=this._caching.lastFrame;return ds!==o&&(ds<us&&kr<us||ds>hs&&kr>hs)||(this._caching.lastIndex=ds<kr?this._caching.lastIndex:0,this.interpolateShape(kr,this.pv,this._caching)),this._caching.lastFrame=kr,this.pv}function b(){this.paths=this.localShapeCollection}function _e(kr,us){if(kr._length!==us._length||kr.c!==us.c)return!1;var hs,ds=kr._length;for(hs=0;hs<ds;hs+=1)if(kr.v[hs][0]!==us.v[hs][0]||kr.v[hs][1]!==us.v[hs][1]||kr.o[hs][0]!==us.o[hs][0]||kr.o[hs][1]!==us.o[hs][1]||kr.i[hs][0]!==us.i[hs][0]||kr.i[hs][1]!==us.i[hs][1])return!1;return!0}function Kt(kr){_e(this.v,kr)||(this.v=shapePool.clone(kr),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function an(){if(this.elem.globalData.frameId!==this.frameId){if(!this.effectsSequence.length){this._mdf=!1;return}if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=!1;var kr;this.kf?kr=this.pv:this.data.ks?kr=this.data.ks.k:kr=this.data.pt.k;var us,hs=this.effectsSequence.length;for(us=0;us<hs;us+=1)kr=this.effectsSequence[us](kr);this.setVValue(kr),this.lock=!1,this.frameId=this.elem.globalData.frameId}}function _n(kr,us,hs){this.propType="shape",this.comp=kr.comp,this.container=kr,this.elem=kr,this.data=us,this.k=!1,this.kf=!1,this._mdf=!1;var ds=hs===3?us.pt.k:us.ks.k;this.v=shapePool.clone(ds),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=b,this.effectsSequence=[]}function On(kr){this.effectsSequence.push(kr),this.container.addDynamicProperty(this)}_n.prototype.interpolateShape=s,_n.prototype.getValue=an,_n.prototype.setVValue=Kt,_n.prototype.addEffect=On;function $n(kr,us,hs){this.propType="shape",this.comp=kr.comp,this.elem=kr,this.container=kr,this.offsetTime=kr.data.st,this.keyframes=hs===3?us.pt.k:us.ks.k,this.keyframesMetadata=[],this.k=!0,this.kf=!0;var ds=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,ds),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=o,this.reset=b,this._caching={lastFrame:o,lastIndex:0},this.effectsSequence=[a.bind(this)]}$n.prototype.getValue=an,$n.prototype.interpolateShape=s,$n.prototype.setVValue=Kt,$n.prototype.addEffect=On;var dr=function(){var kr=roundCorner;function us(hs,ds){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=ds.d,this.elem=hs,this.comp=hs.comp,this.frameId=-1,this.initDynamicPropertyContainer(hs),this.p=PropertyFactory.getProp(hs,ds.p,1,0,this),this.s=PropertyFactory.getProp(hs,ds.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return us.prototype={reset:b,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var ds=this.p.v[0],fs=this.p.v[1],Gs=this.s.v[0]/2,ga=this.s.v[1]/2,So=this.d!==3,go=this.v;go.v[0][0]=ds,go.v[0][1]=fs-ga,go.v[1][0]=So?ds+Gs:ds-Gs,go.v[1][1]=fs,go.v[2][0]=ds,go.v[2][1]=fs+ga,go.v[3][0]=So?ds-Gs:ds+Gs,go.v[3][1]=fs,go.i[0][0]=So?ds-Gs*kr:ds+Gs*kr,go.i[0][1]=fs-ga,go.i[1][0]=So?ds+Gs:ds-Gs,go.i[1][1]=fs-ga*kr,go.i[2][0]=So?ds+Gs*kr:ds-Gs*kr,go.i[2][1]=fs+ga,go.i[3][0]=So?ds-Gs:ds+Gs,go.i[3][1]=fs+ga*kr,go.o[0][0]=So?ds+Gs*kr:ds-Gs*kr,go.o[0][1]=fs-ga,go.o[1][0]=So?ds+Gs:ds-Gs,go.o[1][1]=fs+ga*kr,go.o[2][0]=So?ds-Gs*kr:ds+Gs*kr,go.o[2][1]=fs+ga,go.o[3][0]=So?ds-Gs:ds+Gs,go.o[3][1]=fs-ga*kr}},extendPrototype([DynamicPropertyContainer],us),us}(),fr=function(){function kr(us,hs){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=us,this.comp=us.comp,this.data=hs,this.frameId=-1,this.d=hs.d,this.initDynamicPropertyContainer(us),hs.sy===1?(this.ir=PropertyFactory.getProp(us,hs.ir,0,0,this),this.is=PropertyFactory.getProp(us,hs.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(us,hs.pt,0,0,this),this.p=PropertyFactory.getProp(us,hs.p,1,0,this),this.r=PropertyFactory.getProp(us,hs.r,0,degToRads,this),this.or=PropertyFactory.getProp(us,hs.or,0,0,this),this.os=PropertyFactory.getProp(us,hs.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return kr.prototype={reset:b,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var hs=Math.floor(this.pt.v)*2,ds=Math.PI*2/hs,fs=!0,Gs=this.or.v,ga=this.ir.v,So=this.os.v,go=this.is.v,xo=2*Math.PI*Gs/(hs*2),Mo=2*Math.PI*ga/(hs*2),yl,Al,xl,ep,_f=-Math.PI/2;_f+=this.r.v;var np=this.data.d===3?-1:1;for(this.v._length=0,yl=0;yl<hs;yl+=1){Al=fs?Gs:ga,xl=fs?So:go,ep=fs?xo:Mo;var _l=Al*Math.cos(_f),Ml=Al*Math.sin(_f),tp=_l===0&&Ml===0?0:Ml/Math.sqrt(_l*_l+Ml*Ml),El=_l===0&&Ml===0?0:-_l/Math.sqrt(_l*_l+Ml*Ml);_l+=+this.p.v[0],Ml+=+this.p.v[1],this.v.setTripleAt(_l,Ml,_l-tp*ep*xl*np,Ml-El*ep*xl*np,_l+tp*ep*xl*np,Ml+El*ep*xl*np,yl,!0),fs=!fs,_f+=ds*np}},convertPolygonToPath:function(){var hs=Math.floor(this.pt.v),ds=Math.PI*2/hs,fs=this.or.v,Gs=this.os.v,ga=2*Math.PI*fs/(hs*4),So,go=-Math.PI*.5,xo=this.data.d===3?-1:1;for(go+=this.r.v,this.v._length=0,So=0;So<hs;So+=1){var Mo=fs*Math.cos(go),yl=fs*Math.sin(go),Al=Mo===0&&yl===0?0:yl/Math.sqrt(Mo*Mo+yl*yl),xl=Mo===0&&yl===0?0:-Mo/Math.sqrt(Mo*Mo+yl*yl);Mo+=+this.p.v[0],yl+=+this.p.v[1],this.v.setTripleAt(Mo,yl,Mo-Al*ga*Gs*xo,yl-xl*ga*Gs*xo,Mo+Al*ga*Gs*xo,yl+xl*ga*Gs*xo,So,!0),go+=ds*xo}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],kr),kr}(),pr=function(){function kr(us,hs){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=us,this.comp=us.comp,this.frameId=-1,this.d=hs.d,this.initDynamicPropertyContainer(us),this.p=PropertyFactory.getProp(us,hs.p,1,0,this),this.s=PropertyFactory.getProp(us,hs.s,1,0,this),this.r=PropertyFactory.getProp(us,hs.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return kr.prototype={convertRectToPath:function(){var hs=this.p.v[0],ds=this.p.v[1],fs=this.s.v[0]/2,Gs=this.s.v[1]/2,ga=bmMin(fs,Gs,this.r.v),So=ga*(1-roundCorner);this.v._length=0,this.d===2||this.d===1?(this.v.setTripleAt(hs+fs,ds-Gs+ga,hs+fs,ds-Gs+ga,hs+fs,ds-Gs+So,0,!0),this.v.setTripleAt(hs+fs,ds+Gs-ga,hs+fs,ds+Gs-So,hs+fs,ds+Gs-ga,1,!0),ga!==0?(this.v.setTripleAt(hs+fs-ga,ds+Gs,hs+fs-ga,ds+Gs,hs+fs-So,ds+Gs,2,!0),this.v.setTripleAt(hs-fs+ga,ds+Gs,hs-fs+So,ds+Gs,hs-fs+ga,ds+Gs,3,!0),this.v.setTripleAt(hs-fs,ds+Gs-ga,hs-fs,ds+Gs-ga,hs-fs,ds+Gs-So,4,!0),this.v.setTripleAt(hs-fs,ds-Gs+ga,hs-fs,ds-Gs+So,hs-fs,ds-Gs+ga,5,!0),this.v.setTripleAt(hs-fs+ga,ds-Gs,hs-fs+ga,ds-Gs,hs-fs+So,ds-Gs,6,!0),this.v.setTripleAt(hs+fs-ga,ds-Gs,hs+fs-So,ds-Gs,hs+fs-ga,ds-Gs,7,!0)):(this.v.setTripleAt(hs-fs,ds+Gs,hs-fs+So,ds+Gs,hs-fs,ds+Gs,2),this.v.setTripleAt(hs-fs,ds-Gs,hs-fs,ds-Gs+So,hs-fs,ds-Gs,3))):(this.v.setTripleAt(hs+fs,ds-Gs+ga,hs+fs,ds-Gs+So,hs+fs,ds-Gs+ga,0,!0),ga!==0?(this.v.setTripleAt(hs+fs-ga,ds-Gs,hs+fs-ga,ds-Gs,hs+fs-So,ds-Gs,1,!0),this.v.setTripleAt(hs-fs+ga,ds-Gs,hs-fs+So,ds-Gs,hs-fs+ga,ds-Gs,2,!0),this.v.setTripleAt(hs-fs,ds-Gs+ga,hs-fs,ds-Gs+ga,hs-fs,ds-Gs+So,3,!0),this.v.setTripleAt(hs-fs,ds+Gs-ga,hs-fs,ds+Gs-So,hs-fs,ds+Gs-ga,4,!0),this.v.setTripleAt(hs-fs+ga,ds+Gs,hs-fs+ga,ds+Gs,hs-fs+So,ds+Gs,5,!0),this.v.setTripleAt(hs+fs-ga,ds+Gs,hs+fs-So,ds+Gs,hs+fs-ga,ds+Gs,6,!0),this.v.setTripleAt(hs+fs,ds+Gs-ga,hs+fs,ds+Gs-ga,hs+fs,ds+Gs-So,7,!0)):(this.v.setTripleAt(hs-fs,ds-Gs,hs-fs+So,ds-Gs,hs-fs,ds-Gs,1,!0),this.v.setTripleAt(hs-fs,ds+Gs,hs-fs,ds+Gs-So,hs-fs,ds+Gs,2,!0),this.v.setTripleAt(hs+fs,ds+Gs,hs+fs-So,ds+Gs,hs+fs,ds+Gs,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:b},extendPrototype([DynamicPropertyContainer],kr),kr}();function Ar(kr,us,hs){var ds;if(hs===3||hs===4){var fs=hs===3?us.pt:us.ks,Gs=fs.k;Gs.length?ds=new $n(kr,us,hs):ds=new _n(kr,us,hs)}else hs===5?ds=new pr(kr,us):hs===6?ds=new dr(kr,us):hs===7&&(ds=new fr(kr,us));return ds.k&&kr.addDynamicProperty(ds),ds}function Or(){return _n}function Xr(){return $n}var ss={};return ss.getShapeProp=Ar,ss.getConstructorFunction=Or,ss.getKeyframedConstructorFunction=Xr,ss}();/*!
|
|
8820
8820
|
Transformation Matrix v2.0
|
|
8821
8821
|
(c) Epistemex 2014-2015
|
|
@@ -8841,7 +8841,7 @@ b.goToAndStop(Xr-b.firstFrame-1,!0)}Or.type==="loop"&&(dr===null||dr!==Or.frames
|
|
|
8841
8841
|
`,SideMenuContentStyles=`.hide{display:none!important}.container{padding:28px 46px;padding-bottom:2.5rem;height:100%;overflow-y:scroll}.variantContainer{height:100%;overflow-y:scroll}.col{padding:0;height:100%;overflow-y:scroll}.container .subheading{font-size:.75rem;font-weight:700;text-transform:uppercase;margin-top:0;margin-bottom:1.5rem}.buildUiAccordion{cursor:pointer;transition:.4s;width:100%;border:none;background:#00000000;text-align:left;display:flex;align-items:center;margin-bottom:.5rem}.buildUiAccordion .arrowUp{display:block}.buildUiAccordionActive .arrowUp,.buildUiAccordion .arrowDown{display:none}.buildUiAccordionActive .arrowDown{display:block}.buildUiAccordionContent{max-height:0;overflow:hidden;transition:max-height .2s ease-out}.buildUiAccordion h4{padding-left:.5rem;font-size:.75rem;font-weight:700;text-transform:uppercase}.item-grid{display:flex;justify-content:flex-start;column-gap:1.25rem;align-items:flex-start;position:relative;flex-wrap:wrap}.item-grid .imageContainer{width:6rem;height:fit-content;position:relative;cursor:pointer;border-radius:.6rem;background:#fff;box-sizing:border-box;margin-bottom:2rem;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;transition:.2s ease}.item-grid .imageContainer .contentContainer{left:0;top:0;width:6rem;height:6rem;transition:.2s ease;background:var(--item-card-background-color);padding:8px;display:flex;flex-direction:column;justify-content:center;align-items:center;box-shadow:0 2px 8px #0000001a;-webkit-box-shadow:0px 2px 8px rgb(0 0 0 / 10%);border-radius:.6rem;margin:0}.incrementContentContainer{left:0;top:0;width:6rem;height:6rem;transition:.2s ease;background:var(--item-card-background-color);padding:8px;display:flex;flex-direction:column;justify-content:space-around;align-items:center;box-shadow:0 2px 8px #0000001a;-webkit-box-shadow:0px 2px 8px rgb(0 0 0 / 10%);border-radius:.6rem;margin:0;background:white}.splide__arrow{pointer-events:all;cursor:pointer}.item-grid .imageContainer .addCartButton{width:100%;height:auto;line-height:.75rem;justify-content:center;align-items:center;background:var(--primary-color);cursor:pointer;display:none;position:absolute;bottom:0;left:0;border:none;border-bottom-left-radius:.6rem;border-bottom-right-radius:.6rem;font-size:.625rem;color:#fff;text-transform:uppercase;font-weight:600;padding:.5rem;transition:.2s all ease;-webkit-transition:.2s all ease}.item-grid .imageContainer .addCartButton.added{background:var(--brand-dark)}.item-grid .imageContainer .infoButton{position:absolute;right:.25rem;top:.25rem;z-index:8;background:none;padding:0;margin:0;border:0;cursor:pointer;opacity:0;pointer-events:none;transition:.2s all ease;-webkit-transition:.2s all ease}.incrementContentOverlay{pointer-events:none;position:absolute;left:0;top:0;width:6rem;height:6rem;display:flex;justify-content:center;align-items:center;opacity:0;transition:.5s;border-radius:.6rem;z-index:3}.item-grid .imageContainer .contentOverlay{position:absolute;left:0;top:0;width:6rem;height:6rem;display:flex;justify-content:center;align-items:center;opacity:0;transition:.5s;background:rgba(51,51,51,.2);border-radius:.6rem;z-index:3;pointer-events:all}.enabled-item-overlay{opacity:1!important;cursor:pointer!important}.disabled-item-overlay{cursor:not-allowed!important}.item-grid .imageContainer .contentOverlay img{filter:invert(96%) sepia(3%) saturate(312%) hue-rotate(315deg) brightness(114%) contrast(100%);width:1.875rem;pointer-events:all}.item-grid .imageContainer .itemDetails{opacity:0;font-size:.685rem;justify-content:center;width:100%;height:fit-content;margin-top:.8rem;display:flex;align-items:center}.showAlways{opacity:1!important}.incrementDecrementPanel{width:100%;display:flex;align-items:center;justify-content:center}.incrementCount{cursor:auto;background:#f5f5f5;border:solid .5px #cccccc;padding:0rem .5rem;height:100%;border-right:none;border-left:none;font-size:.7rem;display:flex;align-items:center}.incrementPlusSign{cursor:pointer;height:100%;background:#f5f5f5;border-radius:0 1rem 1rem 0;border:solid .5px #cccccc;display:flex;justify-content:center;align-items:center;padding:0rem .3rem}.incrementPlusSign:hover{background:rgb(232,232,232)}.incrementMinusSign{cursor:pointer;height:100%;background:#f5f5f5;border-radius:1rem 0 0 1rem;border:solid .5px #cccccc;display:flex;justify-content:center;align-items:center;padding:0rem .3rem}.incrementMinusSign:hover{background:rgb(232,232,232)}.infoModalIncrementDecrementParent .incrementCount{padding:.25rem 1.25rem;font-size:.9rem}.infoModalIncrementDecrementParent .incrementPlusSign,.infoModalIncrementDecrementParent .incrementMinusSign{padding:.25rem .5rem}.incrementSignDisable{pointer-events:none;cursor:not-allowed}.incrementSignDisable img{opacity:.2}.item-details-icon:before{content:none;vertical-align:middle}.item-card-text-parent{display:flex;flex-direction:column;align-items:center;justify-content:center}.item-card-text-parent .skuName{margin-bottom:.2rem}.item-card-text-parent .skuSubheading{color:#707070;font-size:.6rem}.container .item-grid .imageContainer .itemDetails:hover{opacity:1;text-decoration:underline}.item-grid .imageContainer .itemDetails:focus-within{opacity:1;text-decoration:underline}.item-grid .imageContainer:hover .itemDetails{opacity:1;transition:.5s}.item-grid .imageContainer:focus-within .itemDetails{opacity:1;transition:.5s}.item-grid .contentContainer img{max-width:100%;max-height:100%}.incrementSkuIcon{max-width:70%;max-height:70%;margin-bottom:.25rem}.splide__sr{display:none}.container .subContainer{border-bottom:.5px solid #c4c4c4;margin-bottom:2rem}.container .subContainer:nth-child(1){margin-top:0}.container .subContainer:nth-last-child(1){margin-bottom:0;border-bottom:0}.bottomBar .cartButton img{width:2rem}.sideMenu .sideMenuTabContainer,.mobileTabContent,.mobileElementsModal{display:none}.infoModal{position:absolute;width:100%;height:100%;left:0;top:0;z-index:8;background:#fff;box-shadow:0 -5px 8px #00000005;border-radius:.75rem .75rem 0 0;display:flex;flex-direction:column;justify-content:flex-start;align-items:center;text-align:center;opacity:0;pointer-events:none;transition:.2s all ease;-webkit-transition:.2s all ease;padding-bottom:1rem;padding-top:2rem;overflow-y:auto}.infoModal.open{opacity:1;pointer-events:all}.infoModal .categoryLink{display:flex;align-items:center;color:var(--brand-dark);gap:.75rem;text-decoration:none;align-self:flex-start;align-items:flex-start;margin-left:4rem;margin-bottom:2rem}.infoModal .categoryLink img{margin-top:.5rem}.infoModal .categoryLink:hover{text-decoration:underline}.reviewButtonSibling{display:none}.infoModal .categoryLink .categoryTitle{font-size:1.25rem;font-weight:700;text-align:left;margin:auto;display:flex;flex-direction:column}.categoryTitle .modalSubHeading{font-size:.8rem;font-weight:300;margin-top:.5rem;color:#8f8f8f}.infoModal .infoModalImageContainer{position:relative;width:auto;height:12.5rem;display:flex;flex-direction:column;justify-content:center;align-items:center;background:#fff;border-radius:.8rem}.infoModal .itemImage{width:auto;height:100%}.infoModal .closeButton{cursor:pointer;position:absolute;right:1.5rem;top:1.5rem}.infoModal .closeButton img{width:1.5rem}.infoModal .openNewTab{position:relative;margin-top:1rem;color:var(--brand-dark);font-size:.75rem;text-decoration:underline}.infoModal .itemTitle{font-weight:400;max-width:60%;font-size:1.25rem;margin-top:1rem;margin-bottom:1rem}.infoModal .infoModalAddButton{background:var(--primary-color);color:#000;width:93%;font-size:.8rem;padding:.7rem 0;cursor:pointer;margin-top:1rem;transition:.2s}.infoModal .infoModalAddButton:hover{background:white;border:2px solid black}.disabledInfoModalAddButton{pointer-events:none;opacity:.5;background:#c7c7c7!important}.infoModal .itemDescription{max-width:70%;font-size:1rem;line-height:1.25rem;display:-webkit-box;-webkit-box-orient:vertical;white-space:pre-wrap;text-align:-webkit-left}.infoModal .infoModalDimensions{color:var(--brand-dark);opacity:.4;font-weight:700;font-size:.875rem;margin-top:1rem}.infoModal .infoModalActions{width:100%;margin-top:2rem}.infoModal .infoModalActions button{width:65%;padding:.6875rem;text-align:center;color:var(--brand-dark);pointer-events:none;font-size:1.25rem;font-weight:700;background:#f8f8f8}.addToCartDisabled{background:#00000057!important;opacity:.75;cursor:not-allowed!important}.previewCartModal{position:absolute;width:100%;height:calc(100% + 5rem);left:0;top:-5rem;z-index:9;background:#fff;box-shadow:0 4.96px 19.84px #0000001a;border-radius:.75rem .75rem 0 0;display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;opacity:0;pointer-events:none;transition:.2s all ease;-webkit-transition:.2s all ease;overflow:hidden;padding-top:5.75rem}.previewCartModal .cartTitle{font-size:1.25rem;font-weight:700;position:absolute;left:2rem;top:2.5rem}.previewCartModal.open{opacity:1;pointer-events:all}.previewCartModal.mobile{display:none}.previewCartModal .previewCartContent{overflow:auto;padding:0 1.5rem;width:100%;height:100%;position:absolute}.previewCartModal .checkoutButton{position:relative;width:20.625rem;height:2.5rem;background:var(--primary-color);color:#fff;display:flex;align-items:center;text-align:center;padding:.6875rem 1rem;border-radius:.25rem;justify-content:center;cursor:pointer}.previewCartModal .checkoutButton:focus{padding:2px;border:2px solid rgb(0,132,255)!important}.previewCartModal .checkoutButton:disabled{background:#00000057!important;opacity:.75;cursor:not-allowed!important}.previewCartModal .checkoutButton img{margin-left:.25rem}.previewCartModal .checkoutButton span{font-size:.6875rem;text-transform:uppercase;font-weight:700}.previewCartModal button{background:transparent;border:none;outline:none;cursor:pointer}.previewCartModal .closeButton{position:absolute;right:1.5rem;top:1.5rem}.previewCartModal .closeButton img{width:1.5rem}.cartItem{display:flex;align-items:flex-start;max-width:100%}.cartItemOutOfStock{border:1px solid #d0342c;border-radius:5px}.cartItem:nth-child(n+1){margin-bottom:1rem}.cartItem .cartItemImage{width:6.25rem;height:6.25rem;padding:.5rem;background:#ffffff;box-shadow:0 2px 8px #0000001a;border-radius:.25rem;margin-right:1rem;display:flex;justify-content:center;align-items:center}.cartItem .cartItemImage img{width:100%;height:auto;max-width:100%;max-height:100%}.cartItem .cartItemDetails{display:flex;flex-direction:column;width:calc(100% - 6.25rem);justify-content:flex-start;padding-top:.75rem}.cartItem .cartItemDetails h4{font-size:.75rem;font-weight:400;padding-top:.25rem;white-space:pre-line}.cartItem .cartItemDetails h5{font-size:.7rem;font-weight:400;padding-top:.25rem;white-space:pre-line}.cartRowImage{height:.8rem}.cartItem .cartRow{margin-top:1rem;width:100%;display:flex;justify-content:flex-start;align-items:center;color:red;gap:.25rem}.cartItem .itemCount{font-size:.7rem}.cartItem .qtyContainer{display:flex;gap:.5rem;color:var(--primary-color);margin-right:1.75rem}.cartItem .qtyContainer span{display:none}.cartItem .qtyContainer button{color:var(--primary-color)}.cartItem .qtyContainer input{color:#333;width:1.7rem;padding:.25rem .5rem;border-radius:3px;background:#eeeeee;border:none}.cartItem .deleteCartButton{font-size:.6875rem;text-decoration:underline;color:#333;display:flex;margin-top:.5rem}.cartItem .deleteCartButton:hover{color:var(--primary-color)}.cartItem .itemPrice{font-size:.7rem}.cartTotalText{display:flex;gap:.5rem}.cartItem .itemCompareAtPrice{font-size:.7rem;text-decoration:line-through;color:gray}.cartItem .itemAvailable{font-size:.5rem}.cartItem .actionButton{margin-top:.2rem;font-weight:600;font-size:.9rem;cursor:pointer}.color-grid{display:flex;gap:1rem;margin-top:.5rem;flex-wrap:wrap;align-items:flex-start}.colorSelector{cursor:pointer;display:flex;flex-direction:column;align-items:center}.colorSelector .colorThumbnailContainer{position:relative}.colorSelector .colorThumbnailContainer .colorThumbnail{width:5rem;height:5rem;position:relative;overflow:hidden}.colorSelector .colorThumbnailContainer .checkMark{width:100%;height:100%;display:flex;justify-content:center;align-items:center;position:absolute;left:0;top:0}.colorSelector .colorThumbnailContainer .checkMark img{opacity:0;transition:.1s all ease;width:45%;filter:invert(100%) sepia(100%) saturate(2%) hue-rotate(188deg) brightness(101%)}.colorSelector.selected .colorThumbnailContainer .checkMark img{opacity:1}.colorSelector .colorDetails{margin-top:.5rem;text-align:center}.colorDetails .colorDetailsLabel{width:100px}.colorSelector .colorDetails p{margin:0;font-size:.75rem;color:var(--brand-dark)}.colorDetails .redText{color:#d0342c!important;font-size:.6rem!important;font-weight:800}.colorSelector .colorDetails p:nth-child(1){font-weight:600}.colorSelector .colorDetails p:nth-child(2){font-weight:400}
|
|
8842
8842
|
`,MobileStyles$1=`@media only screen and (orientation: portrait){.overlayUI{z-index:3;flex-direction:column;padding:0;align-content:flex-start;align-items:flex-start;justify-content:flex-start;top:0;height:100%;border:none;pointer-events:none}.uiContainer{flex-direction:column;justify-content:flex-end}.leftShell{width:100%;height:100%!important;padding:0;position:relative;flex-direction:column;align-items:flex-start;justify-content:flex-start;align-content:flex-start;z-index:2;transition:.5s ease-out;flex-shrink:2}.expanded-left-shell,.disabledLeftShell{height:100%!important}.desktopSideMenu{display:none}.sideMenu{width:100%;height:100%!important;display:flex;z-index:1;bottom:0;flex-direction:column;align-items:flex-start;justify-content:space-between;align-content:flex-end;padding:0;border:none;background:#f5f5f5;border-radius:12px;max-width:unset;min-width:unset;box-shadow:0 -2px 12px #0000001a!important;transition:.5s;min-height:300px;max-height:300px;flex-shrink:1}.side-menu-collapsed{min-height:110px;max-height:110px}.collapse-side-menu-button-parent{display:flex}.collapse-side-menu-button{opacity:1;border:none;box-shadow:none;background:transparent;display:flex;align-items:center;position:absolute;right:6%;top:5%}.set-display-none,.sideMenuContent,.sideMenu .desktop,.sideMenuTabs{display:none}.featuresContainer{height:11.75rem}.featuresContainer .productFeatureUIDic{display:block}.featuresContainer .tabs{position:inherit}.featuresContainer .tab-label{height:3.5rem}.sideMenu .viewInSpaceButton{width:9rem}.sideMenu .bottomBar{z-index:4;width:100%;position:absolute}.bottomBar .reviewButton{font-size:.875rem;margin-right:.5rem}.bottomBar .cartButton img{width:1.25rem}.mobileExpandButton{justify-content:center;align-items:center;display:flex;flex-direction:column-reverse;background:#f5f5f5;font-size:.75rem;width:100%;border-top-left-radius:.75rem;border-top-right-radius:.75rem;transition:none;opacity:1;text-transform:uppercase}.mobileExpandButton.sideMenuOpen{padding:0;height:0%;opacity:0;background:#f8f8f8;pointer-events:none}.mobileExpandButton img{transform:rotate(180deg)}.mobileExpandButton button{position:relative;width:100%;top:0;right:auto;border:none;box-shadow:none;background:transparent;display:flex;justify-content:center;align-items:center;z-index:5;transition:none}.mobileExpandButton button img{transform:rotate(180deg)}#epigraphConfiguratorCore{width:100%;height:100%}epigraph-configurator{position:fixed!important;top:0;left:0;width:100%!important;height:100%!important}.sideMenu .sideMenuTabContainer{display:flex;width:100%;height:100%;transition:none;align-items:flex-start;min-height:300px;max-height:300px}.side-menu-tab-container-open{height:100%}.side-menu-container-hide{height:0%!important}.sideMenu.open .sideMenuTabContainer{height:100%}.sideMenu.open{height:100%;max-height:310px}.sideMenu .sideMenuTabContainer .mobileTab{display:flex}.sideMenu .sideMenuTabContainer .firstMobileTabs img{height:auto}.sideMenu .sideMenuTabContainer .firstMobileTab{width:100%}.sideMenu .firstMobileTabs{width:100%;height:auto;display:flex;justify-content:center;padding:0 2.5rem;margin:0;border-bottom:.25px solid #c4c4c4}.sideMenu .firstMobileTabs .mobileTab{display:flex;align-items:center;justify-content:flex-end;flex-direction:column;font-weight:600;color:var(--brand-dark);width:6rem;height:3rem;text-transform:uppercase;font-size:1rem;background:transparent;border-radius:0;padding:.75rem 0rem;opacity:.5}.sideMenu .react-tabs__tab--selected{background:none;border:none;border-radius:0}.react-tabs__tab{padding:0!important}.react-tabs__tab-panel{height:auto}.sideMenu .firstMobileTabs .react-tabs__tab--selected .mobileTab{border-bottom:2px solid var(--brand-dark);opacity:1}.sideMenu .secondMobileTabs{-ms-overflow-style:none;scrollbar-width:none;width:100%;height:auto;display:flex;justify-content:flex-start;margin:0;gap:1rem;padding:0 1rem;margin-top:1.5rem;margin-bottom:1.25rem;overflow:auto}.sideMenu .secondMobileTabs::-webkit-scrollbar{display:none}.sideMenu .secondMobileTabs .mobileTab{padding:0;font-weight:500;font-size:.75rem;text-transform:uppercase;color:#c4c4c4;text-decoration:none;white-space:nowrap}.sideMenu .secondMobileTabs .mobileTab.scrolled{font-weight:700;color:var(--brand-dark)}.sideMenu .secondMobileTabs .react-tabs__tab{padding:0;width:100%}.sideMenu .secondMobileTabs .react-tabs__tab--selected .mobileTab{border-bottom:1px solid var(--brand-dark)}.imageContainer{width:100%;height:8rem;cursor:pointer;padding:0;display:flex;flex-direction:column;justify-content:flex-start;align-items:center;border-radius:.375rem;background:transparent;position:relative}.imageContainer .contentContainer,.imageContainer:hover .contentContainer{width:4.5rem;height:4.5rem;left:0%;top:0;border-radius:.375rem;background:#fff;display:flex;justify-content:center;align-items:center;flex-direction:column;margin-top:2px}.imageContainer .itemDetails{display:flex;text-align:start;font-size:.75rem;margin-top:.5rem;text-decoration:none}.truncate{width:70px;display:-webkit-box;-webkit-box-orient:vertical;line-clamp:2;-webkit-line-clamp:2;overflow:hidden;text-align:center}.truncate-mobile{text-align:center}.product-image{margin-right:0;border-radius:0rem;padding:.5rem;max-width:100%;max-height:100%}.mobileGrid{-ms-overflow-style:none;scrollbar-width:none;display:flex;flex-direction:row;grid-template-columns:none;align-items:flex-start;justify-items:flex-start;justify-content:flex-start;padding-left:1rem;padding-right:1rem;width:100%;gap:1rem;overflow-x:auto;overflow-y:hidden;margin-bottom:10px}.incrementContentContainer,.incrementContentOverlay{width:4.5rem;height:4.5rem}.incrementSkuIcon{max-width:60%;max-height:60%}.incrementCount{font-size:.5rem;padding:.1rem .3rem}.incrementMinusSign{padding:.1rem .3rem}.incrementMinusSign img{height:.7rem}.incrementPlusSign{padding:.1rem .3rem}.incrementPlusSign img{height:.7rem}.mobileGridCenter{align-items:center}.mobileGrid .mobileGridSection,.mobileGrid .mobileGridSection .mobileGridCategorySection{display:flex;align-items:flex-start;gap:.75rem}.mobileGrid::-webkit-scrollbar{display:none}.mobileGrid .imageContainer .contentContainer .contentOverlay{transition:none;opacity:1;pointer-events:all;background:transparent}.mobileGrid .imageContainer .contentContainer .contentOverlay img{display:none}.mobileGrid .imageContainer .contentOverlay{position:absolute;left:0;top:0;width:100%;height:5rem;display:flex;justify-content:center;align-items:center;opacity:0;transition:none;background:rgba(51,51,51,.2);border-radius:.6rem;z-index:3}.mobileGrid .imageContainer .contentOverlay img{filter:invert(96%) sepia(3%) saturate(312%) hue-rotate(315deg) brightness(114%) contrast(100%);width:3rem;background:none}.imageContainer .infoButton{display:none}.imageContainer:hover .itemDetails,.imageContainer:hover .addCartButton{display:flex}.mobileTabContent{display:block;padding-bottom:0}.mobileElementsModal{opacity:0;position:absolute;width:100%;height:100%;top:0;left:0;display:flex;align-items:center;justify-content:center;pointer-events:none}.mobileElementsModal.open{pointer-events:all;opacity:1}.mobileElementsModal .overlay{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(31,31,31,.7);z-index:2}.mobileElementsModal .modalContent{position:relative;width:8.9rem;height:auto;background:#fff;box-shadow:0 1.89333px 7.57333px #0000001a;border-radius:.75rem;z-index:4;display:flex;flex-direction:column;overflow:hidden;margin-top:-25%}.mobileElementsModal .modalContent .contentContainer{padding:.5rem}.mobileElementsModal .modalContent .thumbnailImage{max-height:6.4rem;width:100%;display:flex;justify-content:center}.mobileElementsModal .modalContent .thumbnailImage img{max-height:100%;max-width:100%}.mobileElementsModal .addCartButton{width:2rem;height:2rem;justify-content:center;align-items:center;background:#ffffff;box-shadow:0 1px 3px #0000000d;display:block;position:absolute;right:1.25rem;top:.875rem;border:none;border-radius:50%;font-size:1.25rem;color:var(--brand-dark)}.mobileElementsModal .itemDetails{display:block;max-width:100%;font-size:.85rem;align-items:flex-start;margin-top:.25rem;display:flex;flex-direction:row}.mobileElementsModal .itemDetails p{max-width:50%}.mobileElementsModal .itemDetails img{width:.7rem;margin-left:.25rem;margin-top:.25rem}.mobileElementsModal .cartOptions{display:flex;justify-content:space-between;align-items:center;width:calc(100% - 1rem);background:white;position:relative;top:.5rem;left:.5rem;border-radius:2.6rem;overflow:hidden}.mobileElementsModal .cartOptions button{background:#ffffff;box-shadow:0 .946667px 2.84px #0000000d;width:1.75rem;height:1.75rem;font-size:1.125rem;border:none;outline:none}.mobileElementsModal .cartOptions .cartCount{color:#e52438;font-size:1rem}.mobileElementsModal .confirmCartButton{width:100%;padding:.5rem;display:flex;justify-content:center;align-items:center;background:#e52438;font-weight:900;color:#fff;border:none;font-size:.6875rem;margin-top:.25rem}.mobileGridSection{display:flex;width:auto;gap:1rem}.itemGridDivider{background:transparent;width:1px;height:5rem;border-right:.5px solid #c4c4c4;margin:0}.itemGridPlaceholder{width:calc(100vw - 8rem)}.previewCartModal.mobile{display:flex;box-shadow:none}.previewCartModal{height:calc(100% - 4rem);z-index:9;top:0}.previewCartModal .checkoutButton{position:relative;width:100%;margin:auto;text-align:center;bottom:0;left:0}.previewCartModal .checkoutButton img{filter:invert(100%) sepia(100%) saturate(2%) hue-rotate(188deg) brightness(101%)}.previewCartModal .checkoutButton:disabled{opacity:.75}.previewCartModal .previewCartButtonContainer{position:absolute;width:100%;display:flex;flex-direction:column;gap:.75rem;left:0;bottom:0;align-items:center;padding:.6875rem .9rem;box-shadow:0 -4px 12px #0000000d}.cartMessageDiv{margin:0;padding-bottom:.2rem}.removeAllColorOverridesButton{margin:0;cursor:pointer;width:auto;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:.25rem;background:transparent!important;border:none;font-size:11px;text-transform:capitalize;color:var(--brand-dark)!important}.removeAllColorOverridesButton .iconContainer{background:white;padding:.5rem;box-shadow:1.28889px 1.28889px 7.73333px #0000000d;border-radius:50%}.removeAllColorOverridesButton .iconContainer img{width:1.25rem;height:auto}.removeAllColorOverridesButton:disabled{opacity:.25;cursor:not-allowed}.uiModalDrawer .modalDialog{background:#fff;width:100%;padding:1.5rem;border-radius:0;position:relative;z-index:8;display:flex;flex-direction:column;justify-content:center;align-items:flex-start}.uiModalDrawer .modalDialog .modalHeading{font-size:1.25rem;font-weight:700;color:var(--brand-dark);text-transform:capitalize;margin:0;margin-bottom:2.25rem;position:relative;width:100%}.uiModalDrawer .modalDialog .modalHeading:after{content:"";position:absolute;width:100%;height:.25px;background:#a0a0a0;left:0rem;bottom:-1rem}.uiModalDrawer .modalDialog button{border-radius:2px;background:var(--primary-color);color:#fff;text-align:center;font-size:.875rem;font-weight:500;padding:.75rem 1.875rem;outline:none;border:none;box-shadow:none;margin:0;cursor:pointer;width:100%}.uiModalDrawer .shareModal{position:relative;width:100%}.uiModalDrawer .shareModalChildDiv,.uiModalDrawer .shareModalLoaderImg{height:100%}.uiModalDrawer .shareModalRelative{position:relative;width:100%}.UIModalButtonParentDiv{display:flex;gap:10px;width:100%}.uiModalDrawer .shareModal button{position:absolute;text-transform:uppercase;right:.25rem;margin:0;top:.25rem;font-size:1rem;padding:0;width:2.3125rem;height:2.3125rem;display:flex;justify-content:center;align-items:center}.shellCanvasContainer{-ms-overflow-style:none;scrollbar-width:none;padding:0!important;box-shadow:none!important;flex-direction:row!important;gap:.75rem!important;overflow-x:scroll!important;background:#ffffff!important;box-shadow:0 2px 12px #0000001a!important;align-items:flex-start!important;justify-content:flex-start!important;width:100%!important;padding:.5rem!important;position:absolute;top:0}.shellCanvasContainer::-webkit-scrollbar{display:none}.shellCanvasContainerParent{align-items:flex-start!important;width:100%!important;height:calc(0% + 4.5rem)!important;transition:.5s ease-in-out;-webkit-transition:.5s ease-in-out;-moz-transition:.5s ease-in-out;top:0!important;position:relative}.shellButtonContainer{padding:.5rem .75rem!important;margin:0!important;background:#f8f8f8!important;border-radius:1.5rem!important;gap:.25rem!important}.shellButtonContainer .buttonContent{gap:.25rem!important;display:flex!important;align-items:center!important;flex-direction:row!important;min-width:auto!important;max-width:none!important;min-height:auto!important;max-height:none!important;height:auto!important;width:auto!important;background:transparent!important}.shellButtonContainer .buttonContent span{display:flex;font-size:.6875rem}.contextMenuParent{display:none}.shellButtonContainer.active{border-left:none;background:#f1f1f1!important}.shellButtonContainer.active .buttonContent{background:transparent}.shellButtonContainer .hoverDescriptor,.infoModal{display:none}.epigraphDrawer .contextMenuParent{position:relative;max-width:none;width:100%;top:0;left:0;z-index:1005;background:#ffffff;box-shadow:none;border:black;border-radius:3%;display:flex;gap:1rem;justify-content:center;padding:1rem 1rem 1.5rem;flex-direction:column;align-content:center;border-radius:.625rem;min-width:200px}#contextDrawer{z-index:3}.epigraphDrawer .contextMenuParent .closeContainer{width:100%;display:flex;justify-content:flex-end}.epigraphDrawer .contextMenuParent .closeContainer button{cursor:pointer;border:none;outline:none;box-shadow:none;background:transparent}.epigraphDrawer .contextMenuParent .closeContainer button img{width:.75rem}.epigraphDrawer .contextMenuParent .contextContent h3{font-size:.875rem;font-weight:700;text-transform:uppercase;margin:0}.epigraphDrawer .contextMenuParent .contextContentNameDiv{display:flex;align-items:center;gap:.5rem}.epigraphDrawer .contextMenuParent .selectColorLabel{font-weight:300;font-size:.75rem;margin-top:1rem;text-transform:uppercase}.epigraphDrawer .contextMenuParent .colorSwatchTitle{margin-top:1rem}.epigraphDrawer .contextMenuParent .contextContent p{font-size:.75rem;font-weight:300;margin:0}.epigraphDrawer .contextMenuParent .contextButtons{display:flex;flex-direction:row;gap:.75rem;margin-top:.05rem}.epigraphDrawer .contextMenuParent .contextButtons button{border-radius:.25rem;padding:.75rem 2rem;background:transparent;display:flex;flex-direction:row;align-items:center;gap:.25rem;cursor:pointer;text-transform:uppercase;font-size:.75rem;font-weight:700;border:1px solid var(--primary-color);outline:none;background:#fff;box-shadow:none;justify-content:center}.epigraphDrawer .contextMenuParent .contextButtons button img{width:1rem}.epigraphDrawer .contextMenuParent .contextButtons button{color:var(--primary-color);width:100%}.epigraphDrawer .contextMenuParent .contextButtons button:nth-child(1) img{filter:invert(52%) sepia(97%) saturate(5241%) hue-rotate(347deg) brightness(94%) contrast(93%)}.epigraphDrawer .contextMenuParent .contextButtons button svg path{fill:var(--primary-color)}.epigraphDrawer .color-grid{display:flex;gap:1rem}.epigraphDrawer .colorSelector{cursor:pointer;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:.25rem}.epigraphDrawer .colorSelector .colorThumbnailContainer{position:relative}.epigraphDrawer .colorSelector .colorThumbnailContainer .colorThumbnail{width:2.625rem;height:2.625rem;border-radius:50%}.epigraphDrawer .colorSelector .colorThumbnailContainer .colorThumbnail .colorThumbnailImg{height:100%;width:100%;opacity:1}.epigraphDrawer .colorSelector .colorThumbnailContainer .checkMark{width:100%;height:100%;display:flex;justify-content:center;align-items:center;position:absolute;left:0;top:0}.epigraphDrawer .colorSelector .colorThumbnailContainer .checkMark img{opacity:0;transition:none;width:45%;filter:invert(100%) sepia(100%) saturate(2%) hue-rotate(188deg) brightness(101%)}.epigraphDrawer .colorSelector.selected .colorThumbnailContainer .checkMark img{opacity:1}.epigraphDrawer .colorSelector .colorDetails{text-align:center;opacity:.75;pointer-events:none;margin-top:0}.epigraphDrawer .colorSelector:hover .colorDetails,.epigraphDrawer .colorSelector.selected .colorDetails{opacity:1;pointer-events:all}.epigraphDrawer .colorSelector .colorDetails p{margin:0;font-size:.75rem;color:var(--brand-dark)}.epigraphDrawer .colorSelector .colorDetails p:nth-child(1){font-weight:600;text-align:center}.epigraphDrawer .colorSelector .colorDetails p:nth-child(2){font-weight:400}.epigraphDrawer p,.epigraphDrawer span,.epigraphDrawer h1,.epigraphDrawer h2,.epigraphDrawer h3,.epigraphDrawer h4,.epigraphDrawer h5,.epigraphDrawer pre{font-family:Inter,helvetica,sans-serif}.infoDrawer{padding-top:2rem;padding-bottom:3rem;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;position:relative}.infoDrawer .drawerContent{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;overflow-y:unset}.infoDrawer .infoDrawerImageContainer{position:relative;width:100%}.infoDrawer button{background:transparent;border:none;outline:none;cursor:pointer}.infoDrawer .closeButton{position:absolute;right:1.5rem;top:1.5rem}.infoDrawer .closeButton img{width:.75rem}.infoDrawer .openNewTab{position:relative;margin-top:1rem;display:flex;align-items:center;color:var(--brand-dark);gap:.5rem;outline:none}.infoDrawer .itemImage{max-width:60%;width:50%}.infoDrawer .itemTitle{font-weight:400;max-width:100%;font-size:1.25rem;margin-top:1rem;margin-bottom:1rem;text-align:left}.infoDrawer .infoDrawerActions{margin-top:1.5rem}.infoDrawer .infoDrawerActions button{width:65%;padding:.6875rem;text-align:center;color:#fff}.infoDrawer .infoDrawerActions .removeFromCart{background:var(--brand-dark)}.infoDrawer .itemDescription{max-width:100%;font-size:1rem;line-height:1.25rem;display:-webkit-box;-webkit-box-orient:vertical;white-space:pre-wrap;text-align:-webkit-left}.infoDrawer .infoDrawerDimensions{color:var(--brand-dark);opacity:.4;font-weight:700;font-size:.875rem;margin-top:1rem}.infoDrawer .infoDrawerActions{margin-top:3.75rem}.infoDrawer .infoModalActions button{width:100%;padding:.6875rem;text-align:center;color:var(--brand-dark);pointer-events:none;font-size:1.25rem;font-weight:700;background:#f8f8f8;margin-top:1rem}.infoDrawer .categoryLink{display:flex;align-items:center;color:var(--brand-dark);gap:.75rem;text-decoration:none;position:relative;width:100%;outline:none;margin-bottom:2rem;justify-content:space-between}.infoDrawer .categoryLink .categoryTitle{font-size:1.25rem;font-weight:700;text-align:left}.addToCartDisabled{background:#00000057!important;opacity:.75;cursor:not-allowed!important}.epigraphDrawer.hotspotDrawer .drawerContent{padding:unset;height:100%;overflow-y:unset}.epigraphDrawer.hotspotDrawer h2{font-size:1.25rem;text-transform:uppercase;margin:0;margin-bottom:2rem}.epigraphDrawer.hotspotDrawer .quill p{margin:0;margin-top:.5rem}.uiModalDrawer.open{opacity:1;pointer-events:all}.uiModalDrawer .modalOverlay{background:rgba(51,51,51,.4);position:absolute;top:0;left:0;width:100%;height:100%}.uiModalDrawer .modalDialog{background:#fff;width:100%;padding:0;border-radius:0;position:relative;z-index:32;display:flex;flex-direction:column;justify-content:center;align-items:flex-start}.uiModalDrawer .modalText{white-space:pre-wrap;font-size:.75rem;font-weight:300;color:#222;margin-bottom:1rem}.uiModalDrawer .modalDialog input{font-weight:300;color:var(--brand-dark);border:.5px solid var(--brand-dark);border-radius:2px;padding:1rem;width:100%}.uiModalDrawer .shareModal{width:100%;display:flex}.uiModalDrawer .shareModal button{position:absolute;text-transform:uppercase;right:0;margin:0;top:0;font-size:1rem;padding:0;width:3rem;height:100%;display:flex;justify-content:center;align-items:center}.uiModalDrawer .shareModal button:before{position:absolute;content:"";background:white;height:calc(100% - 2px);right:3rem;top:1px;width:12px}.uiModalDrawer .shareModal button img{width:1.75rem;filter:invert(100%) sepia(100%) saturate(2%) hue-rotate(188deg) brightness(101%)}.uiModalDrawer .modalDialog .modalCloseContainer{display:none}.uiModalDrawer .modalDialog .modalCloseContainer button{cursor:pointer;outline:none;background:transparent;border:none;margin:0;padding:0}.uiModalDrawer .modalDialog .modalCloseContainer button img{width:1.5rem}}
|
|
8843
8843
|
`,ViewInYourSpaceStyles=`model-viewer{width:100vw;height:100vh;display:block}.viewInYourSpaceButton{width:100%;height:100%;background-color:transparent;border:2px solid black;display:flex;align-items:center;justify-content:center;gap:20px;display:none}.viewInYourSpaceButton img{height:50%}.viewInYourSpaceButton:disabled{display:none;pointer-events:none}.viewInYourSpaceButton:hover img{filter:invert()}.viewInYourSpaceButton:hover{background-color:#000;color:#fff;cursor:pointer}.qrModalContainer{--qrModalMargin: 50px;--qrModalPadding: 200px;display:flex;flex-direction:column;width:100vw;height:100vh;position:fixed;top:0;left:0;background-color:#3336;margin:0;z-index:999;opacity:1;transition:opacity .5s}.qr-code-container{display:flex;position:relative;width:100%;min-width:300px;height:100%;min-height:300px;justify-content:center;align-items:center}.qr-code-image{height:100%;width:100%;transform:scale(1)}.qr-code-image canvas{width:100%!important;height:100%!important}.qrModal{background-color:#fff;display:flex;flex-direction:row;justify-content:space-between;align-items:center;position:absolute;width:90%;min-width:500px;max-width:620px;height:90%;min-height:300px;max-height:315px;left:50%;top:50%;transform:translate(-50%,-50%);padding:30px;box-shadow:7px 7px 20px #0000000d}.qrModalHide{pointer-events:none;opacity:0;transition:opacity .5s}.qrModal>img{align-self:center;aspect-ratio:1;min-width:300px;min-height:300px;max-width:100%;max-height:100%;opacity:1;transition:1s}.img-hide{display:none;opacity:0}.instructions-container{display:flex;flex-direction:column;height:80%;gap:10px;justify-content:space-between}.done-button{width:90%;height:25%;background-color:var(--view-in-your-space-done-button-bg-color);color:#fff;font-weight:700;font-size:18px;border:2px solid var(--view-in-your-space-done-button-bg-color);transition:.5s;text-transform:uppercase}.done-button:hover{background-color:var(--view-in-your-space-done-button-hover-bg-color);color:var(--view-in-your-space-done-button-hover-color);cursor:pointer;transition:.5s}.qr-modal-title{font-size:25px;font-style:normal;font-weight:700;line-height:30px;text-transform:none;color:var(--qr-modal-title-color);font-family:var( --view-in-your-space-modal-heading-font-family, Inter, helvetica, sans-serif )}.qr-modal-instruction{font-family:var(--font-family);font-style:normal;font-weight:400;font-size:12px;line-height:18px;color:var(--qr-modal-instruction-color)}.qr-modal-requirement{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-style:normal;font-weight:400;font-size:10px;line-height:19px;color:var(--qr-modal-requirement-color)}.qr-modal-close-button{width:50px;height:50px;font-size:x-large;position:absolute;top:21px;align-self:flex-start;border:0px;right:21px;background-color:transparent}.qr-modal-close-button:hover{cursor:pointer}.loader-hide{opacity:0!important}.spinner-loader{width:64px;height:64px;position:absolute;z-index:1;opacity:1;transition:.25s ease-in-out;pointer-events:none}.qr-ar-modal-title{font-family:var(--configurator-font-family, sans-serif);font-size:20px;font-style:normal;font-weight:700;line-height:24.2px;text-transform:none;color:var(--qr-modal-title-color);font-family:var( --view-in-your-space-modal-heading-font-family, Inter, helvetica, sans-serif )}.launch-ar-modal-title{font-family:var(--configurator-font-family, sans-serif);font-size:20px;font-style:normal;font-weight:700;line-height:24.2px;text-transform:none;color:var(--qr-modal-title-color);align-self:center;font-family:var( --view-in-your-space-modal-heading-font-family, Inter, helvetica, sans-serif )}.qr-ar-modal-instruction,.launch-ar-modal-instruction{font-family:var(--configurator-font-family, sans-serif);font-style:normal;font-weight:400;font-size:12px;line-height:18px;text-align:center;color:var(--qr-modal-instruction-color);align-self:flex-start;text-align:left}.launch-ar-modal-error{font-family:var(--configurator-font-family, sans-serif);font-size:15px;color:red}.launch-ar-modal-error-hide{display:none}.qr-ar-modal-requirement,.launch-ar-modal-requirement{font-family:var(--configurator-font-family, sans-serif);font-style:normal;font-weight:400;font-size:10px;line-height:19.2px;color:var(--qr-modal-requirement-color, black)}.launch-ar-modal-handle{height:5px;width:50%;background-color:#000;border-radius:99px;margin:0 20px}.QR-Parent{height:200px;width:200px;min-width:200px;min-height:200px;display:flex;justify-content:center;align-items:center}.QR-Content-Parent{height:100%;width:200px;display:flex;flex-direction:column;align-items:flex-start}.qr-content-container{display:flex;flex-direction:row;height:100%;margin:0 24px 24px;gap:7%;align-items:center;justify-content:space-around}.launch-ar-content-container{display:flex;flex-direction:column;height:260px;margin:24px 20px 24px 24px;padding-bottom:2rem;gap:7%;align-items:center;justify-content:flex-start}.launch-ar-button-container{width:100%;height:48px;display:flex;justify-content:center;align-items:center;position:relative}.qr-ar-bottom-content-container{height:100%;gap:5px;display:flex;flex-direction:column;justify-content:space-evenly;align-items:center}.launch-ar-bottom-content-container{height:100%;display:flex;flex-direction:column;justify-content:space-evenly;align-items:center}.launch-ar-button{width:100%;height:100%;opacity:1;position:absolute;transition:1s;background-color:var(--primary-color, black);color:#fff;border:0;display:flex;justify-content:center;align-items:center;cursor:pointer}.launch-ar-button:disabled{opacity:.6;transition:1s}.lds-ellipsis{display:inline-block;position:absolute;width:80px;height:80px;opacity:1;transition:1s;z-index:9999;pointer-events:none}@media only screen and (orientation: portrait){.qr-code-image{transform:scale(.8)!important}.qr-ar-modal-title{align-self:center;font-family:var(--configurator-font-family, sans-serif);font-size:20px;font-style:normal;font-weight:700;line-height:24.2px;text-transform:none;color:var(--qr-modal-title-color);font-family:var( --view-in-your-space-modal-heading-font-family, Inter, helvetica, sans-serif )}.qr-ar-modal-instruction{font-family:var(--configurator-font-family, sans-serif);font-style:normal;font-weight:400;font-size:12px;line-height:18px;color:var(--qr-modal-instruction-color);align-self:flex-start;text-align:center}.QR-Parent{width:150px;height:150px;min-height:150px;min-width:150px;display:flex;justify-content:center;align-items:center}.qr-content-container{display:flex;flex-direction:column;height:auto;margin:0 24px 35px;gap:7%;align-items:center;justify-content:flex-start}.QR-Content-Parent{text-align:left;height:100%;width:100%;display:flex;flex-direction:column;align-items:flex-start}.qr-ar-modal-requirement{text-align:center;font-family:var(--configurator-font-family, sans-serif);font-style:normal;font-weight:400;font-size:10px;line-height:19.2px;color:var(--qr-modal-requirement-color, black)}}
|
|
8844
|
-
`,BottomDrawerStyles=`.drawer{display:none;position:absolute;top:0;left:0;width:100%;height:100%;touch-action:none;user-select:none;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;overscroll-behavior:none;pointer-events:none;z-index:30}.drawer .drawerDialog{z-index:9;-ms-scroll-chaining:none;overscroll-behavior:none;touch-action:none;position:absolute;right:0;left:0;bottom:0;width:100%;height:90%;background:white;border-top-left-radius:1rem;border-top-right-radius:1rem;display:flex;flex-direction:column;pointer-events:all}.drawer .drawerDialog .drawerContainer{width:100%}.drawer .draggableBar{box-shadow:none;height:50px;pointer-events:all;display:flex;align-items:center;justify-content:center}.drawer .draggableBar .icon{content:"";display:block;width:40%;height:4px;border-radius:12px;background-color:#0009}.drawer .drawerOverlay{background-color:#0009;will-change:opacity;opacity:0;position:absolute;left:0;height:100%;width:100%;z-index:6;pointer-events:none;transition:.3s ease-out}.drawerContent{height:100%;overflow-y:scroll;padding:1rem;padding-top:0;box-sizing:content-box}@media only screen and (orientation: portrait){.drawer{display:block}}
|
|
8844
|
+
`,BottomDrawerStyles=`.drawer{display:none;position:absolute;top:0;left:0;width:100%;height:100%;touch-action:none;user-select:none;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;overscroll-behavior:none;pointer-events:none;z-index:30}.drawer .drawerDialog{z-index:9;-ms-scroll-chaining:none;overscroll-behavior:none;touch-action:none;position:absolute;right:0;left:0;bottom:0;width:100%;height:90%;background:white;border-top-left-radius:1rem;border-top-right-radius:1rem;display:flex;flex-direction:column;pointer-events:all}.drawer .drawerDialog .drawerContainer{width:100%}.drawer .draggableBar{box-shadow:none;height:50px;pointer-events:all;display:flex;align-items:center;justify-content:center}.drawer .draggableBar .icon{content:"";display:block;width:40%;height:4px;border-radius:12px;background-color:#0009}.drawer .drawerOverlay{background-color:#0009;will-change:opacity;opacity:0;position:absolute;left:0;height:100%;width:100%;z-index:6;pointer-events:none;transition:.3s ease-out}.drawerContent{height:100%;overflow-y:scroll;padding:1rem;padding-top:0;box-sizing:content-box}.drawerContent .infoModalActions{width:100%}@media only screen and (orientation: portrait){.drawer{display:block}}
|
|
8845
8845
|
`,FullScreenModalStyles=`.full-screen-modal-container{width:100%;height:100%;background-color:#3336;display:flex;flex-direction:column;padding:20px;box-sizing:border-box;opacity:0;transition:opacity .5s;pointer-events:none;justify-content:center;align-items:center;position:absolute;top:0;left:0;z-index:999999}.full-screen-modal-container.show{opacity:1;pointer-events:all}.full-screen-modal-container .close-button{height:24px!important;cursor:pointer;align-self:flex-end}.full-screen-modal-container .close-button img{height:100%}.modal-content-container{width:80%;background-color:#fff;display:flex;flex-direction:column;padding:20px;border-radius:10px;box-sizing:content-box;max-width:500px}
|
|
8846
8846
|
`,InstructionsModalStyles=`.instructionsModalFSModal .modal-content-container{width:450px;height:400px;background-color:#fff;display:flex;flex-direction:column;padding:0;border-radius:4.57px;box-sizing:content-box;max-width:450px;max-height:400px;overflow:hidden;position:relative}.instructionsModalFSModal .close-button{position:absolute;top:16px;right:16px;z-index:1}.ins-panel{height:100%;width:100%;background:#fff;flex-direction:column;display:flex;justify-content:center;align-items:center;transition:right .5s ease-in-out}.lottie-anim-ins{width:450px;height:217px;border:1px solid #f1f1f1}.ins-instructions{height:183px;width:100%;background:white;padding:32px;display:flex;flex-direction:column;justify-content:space-between;font-family:Inter,helvetica,sans-serif;text-align:center}.ins-dots{display:flex;justify-content:center;margin:20px}.ins-active{background:var(--brand-dark)!important}.ins-dot{width:10px;height:10px;background:#333;border-radius:50%;margin:0 5px}.ins-nextButton{margin-top:10px;width:100%;padding:10px 20px;background:var(--brand-dark);color:#fff;border:none;cursor:pointer}.ins-header{font-size:14px;font-weight:700;line-height:14px;text-transform:uppercase}.ins-description{font-size:19px;font-weight:300;line-height:21px;padding:0 32px}.lottie-anim-loader{width:450px;height:217px;display:flex;justify-content:center;align-items:center;border:1px solid #f1f1f1}@media only screen and (orientation: portrait){.instructionsModalFSModal .modal-content-container{transform:scale(.7)}}
|
|
8847
8847
|
`;var constants={exports:{}},reactReconcilerConstants_production_min={};/**
|