From 89978658604ce52fabc40cb51d4c5590483f297c Mon Sep 17 00:00:00 2001 From: Mikyo King Date: Fri, 18 Nov 2022 11:59:44 -0800 Subject: [PATCH 1/4] chore: change project directory and name to phoenix --- .github/workflows/python-CI.yml | 101 ++++++++++++++++---------------- 1 file changed, 50 insertions(+), 51 deletions(-) diff --git a/.github/workflows/python-CI.yml b/.github/workflows/python-CI.yml index 583fb99099..62288e2972 100644 --- a/.github/workflows/python-CI.yml +++ b/.github/workflows/python-CI.yml @@ -1,61 +1,60 @@ name: Python CI on: - pull_request: - paths: - - "**.py" + pull_request: + paths: + - "**.py" jobs: -# Error: Dependency review is not supported on this repository. Please ensure that Dependency graph is enabled, -# see https://github.com/Arize-ai/arize-toolbox/settings/security_analysis -# -# dep-review: -# name: Dependency Review -# runs-on: ubuntu-latest -# permissions: -# contents: read -# steps: -# - name: Check out Git repository -# uses: actions/checkout@v3 -# - name: Dependency Review -# uses: actions/dependency-review-action@v1 - -# TODO(Kiko): Improve this GitHub Action -# documentation: -# name: Docstring Coverage -# runs-on: ubuntu-latest -# steps: -# - name: Checkout -# uses: actions/checkout@v3 -# - name: Set up Python 3.8 -# uses: actions/setup-python@v3 -# with: -# python-version: 3.8 -# - name: Python Interrogate Check -# uses: JackMcKew/python-interrogate-check@main -# with: -# path: 'arize_toolbox' -# fail-under: 90 + # Error: Dependency review is not supported on this repository. Please ensure that Dependency graph is enabled, + # see https://github.com/Arize-ai/arize-toolbox/settings/security_analysis + # + # dep-review: + # name: Dependency Review + # runs-on: ubuntu-latest + # permissions: + # contents: read + # steps: + # - name: Check out Git repository + # uses: actions/checkout@v3 + # - name: Dependency Review + # uses: actions/dependency-review-action@v1 - code-format: - name: Code Format - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - uses: ricardochaves/python-lint@v1.4.0 - with: - python-root-list: "." - use-pylint: false - use-pycodestyle: false - use-mypy: false - use-flake8: true - use-isort: true - use-black: true - extra-flake8-options: "--max-line-length=94 --exclude=__init__.py" - extra-black-options: "--check --diff --color" - extra-isort-options: "--profile black --check-only --diff" + # TODO(Kiko): Improve this GitHub Action + # documentation: + # name: Docstring Coverage + # runs-on: ubuntu-latest + # steps: + # - name: Checkout + # uses: actions/checkout@v3 + # - name: Set up Python 3.8 + # uses: actions/setup-python@v3 + # with: + # python-version: 3.8 + # - name: Python Interrogate Check + # uses: JackMcKew/python-interrogate-check@main + # with: + # path: 'phoenix' + # fail-under: 90 + code-format: + name: Code Format + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - uses: ricardochaves/python-lint@v1.4.0 + with: + python-root-list: "." + use-pylint: false + use-pycodestyle: false + use-mypy: false + use-flake8: true + use-isort: true + use-black: true + extra-flake8-options: "--max-line-length=94 --exclude=__init__.py" + extra-black-options: "--check --diff --color" + extra-isort-options: "--profile black --check-only --diff" # Error: Advanced Security must be enabled for this repository to use code scanning. # # code-ql: From 5f6655ec2c8613cc3b3fc98e37b3c9ab0fa682d5 Mon Sep 17 00:00:00 2001 From: Mikyo King Date: Fri, 18 Nov 2022 12:02:27 -0800 Subject: [PATCH 2/4] Change project name to phoenix --- index.html | 2 +- package.json | 2 +- {arize_toolbox => phoenix}/__init__.py | 0 {arize_toolbox => phoenix}/datasets/__init__.py | 0 {arize_toolbox => phoenix}/datasets/dataset.py | 0 {arize_toolbox => phoenix}/datasets/types.py | 0 {arize_toolbox => phoenix}/nbextension/static/index.js | 2 +- {arize_toolbox => phoenix}/umap/__init__.py | 0 {arize_toolbox => phoenix}/umap/umap.py | 0 {arize_toolbox => phoenix}/widgets/__init__.py | 1 + {arize_toolbox => phoenix}/widgets/umapWidget.py | 10 +++++----- pyproject.toml | 4 ++-- ui/src/components/canvas/DriftPointCloud.tsx | 2 +- 13 files changed, 12 insertions(+), 11 deletions(-) rename {arize_toolbox => phoenix}/__init__.py (100%) rename {arize_toolbox => phoenix}/datasets/__init__.py (100%) rename {arize_toolbox => phoenix}/datasets/dataset.py (100%) rename {arize_toolbox => phoenix}/datasets/types.py (100%) rename {arize_toolbox => phoenix}/nbextension/static/index.js (99%) rename {arize_toolbox => phoenix}/umap/__init__.py (100%) rename {arize_toolbox => phoenix}/umap/umap.py (100%) rename {arize_toolbox => phoenix}/widgets/__init__.py (50%) rename {arize_toolbox => phoenix}/widgets/umapWidget.py (85%) diff --git a/index.html b/index.html index 9fd4cab947..78143bf0c9 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ App - +
diff --git a/package.json b/package.json index d5271ef1dc..be85798073 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,6 @@ "typescript": "^4.8.4" }, "scripts": { - "build": "esbuild ui/src/index.tsx --bundle --minify --target=es2020 --format=esm --outfile=arize_toolbox/nbextension/static/index.js" + "build": "esbuild ui/src/index.tsx --bundle --minify --target=es2020 --format=esm --outfile=phoenix/nbextension/static/index.js" } } diff --git a/arize_toolbox/__init__.py b/phoenix/__init__.py similarity index 100% rename from arize_toolbox/__init__.py rename to phoenix/__init__.py diff --git a/arize_toolbox/datasets/__init__.py b/phoenix/datasets/__init__.py similarity index 100% rename from arize_toolbox/datasets/__init__.py rename to phoenix/datasets/__init__.py diff --git a/arize_toolbox/datasets/dataset.py b/phoenix/datasets/dataset.py similarity index 100% rename from arize_toolbox/datasets/dataset.py rename to phoenix/datasets/dataset.py diff --git a/arize_toolbox/datasets/types.py b/phoenix/datasets/types.py similarity index 100% rename from arize_toolbox/datasets/types.py rename to phoenix/datasets/types.py diff --git a/arize_toolbox/nbextension/static/index.js b/phoenix/nbextension/static/index.js similarity index 99% rename from arize_toolbox/nbextension/static/index.js rename to phoenix/nbextension/static/index.js index 77dc26b4c7..81eac8fea7 100644 --- a/arize_toolbox/nbextension/static/index.js +++ b/phoenix/nbextension/static/index.js @@ -3008,7 +3008,7 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function $C(n,e,t){let r=new nl,i=new oe,s=new oe,o=new Tt,u=new Ku({depthPacking:FC}),c=new $u,f={},d=t.maxTextureSize,p={0:Vr,1:Ka,2:$a},m=new br({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new oe},radius:{value:4}},vertexShader:BF,fragmentShader:UF}),g=m.clone();g.defines.HORIZONTAL_PASS=1;let x=new We;x.setAttribute("position",new mt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let y=new sn(x,m),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=aw,this.render=function(T,C,P){if(_.enabled===!1||_.autoUpdate===!1&&_.needsUpdate===!1||T.length===0)return;let D=n.getRenderTarget(),I=n.getActiveCubeFace(),G=n.getActiveMipmapLevel(),B=n.state;B.setBlending(Hs),B.buffers.color.setClear(1,1,1,1),B.buffers.depth.setTest(!0),B.setScissorTest(!1);for(let A=0,F=T.length;Ad||i.y>d)&&(i.x>d&&(s.x=Math.floor(d/Q.x),i.x=s.x*Q.x,j.mapSize.x=s.x),i.y>d&&(s.y=Math.floor(d/Q.y),i.y=s.y*Q.y,j.mapSize.y=s.y)),j.map===null&&!j.isPointLightShadow&&this.type===Uu&&(j.map=new On(i.x,i.y),j.map.texture.name=ne.name+".shadowMap",j.mapPass=new On(i.x,i.y),j.camera.updateProjectionMatrix()),j.map===null){let J={minFilter:_n,magFilter:_n,format:Hr};j.map=new On(i.x,i.y,J),j.map.texture.name=ne.name+".shadowMap",j.camera.updateProjectionMatrix()}n.setRenderTarget(j.map),n.clear();let X=j.getViewportCount();for(let J=0;J0){let F=B.uuid,ne=C.uuid,j=f[F];j===void 0&&(j={},f[F]=j);let Q=j[ne];Q===void 0&&(Q=B.clone(),j[ne]=Q),B=Q}return B.visible=C.visible,B.wireframe=C.wireframe,G===Uu?B.side=C.shadowSide!==null?C.shadowSide:C.side:B.side=C.shadowSide!==null?C.shadowSide:p[C.side],B.alphaMap=C.alphaMap,B.alphaTest=C.alphaTest,B.clipShadows=C.clipShadows,B.clippingPlanes=C.clippingPlanes,B.clipIntersection=C.clipIntersection,B.displacementMap=C.displacementMap,B.displacementScale=C.displacementScale,B.displacementBias=C.displacementBias,B.wireframeLinewidth=C.wireframeLinewidth,B.linewidth=C.linewidth,P.isPointLight===!0&&B.isMeshDistanceMaterial===!0&&(B.referencePosition.setFromMatrixPosition(P.matrixWorld),B.nearDistance=D,B.farDistance=I),B}function E(T,C,P,D,I){if(T.visible===!1)return;if(T.layers.test(C.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&I===Uu)&&(!T.frustumCulled||r.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,T.matrixWorld);let A=e.update(T),F=T.material;if(Array.isArray(F)){let ne=A.groups;for(let j=0,Q=ne.length;j=1):X.indexOf("OpenGL ES")!==-1&&(Q=parseFloat(/^OpenGL ES (\d)/.exec(X)[1]),j=Q>=2);let J=null,W={},re=n.getParameter(3088),ce=n.getParameter(2978),ge=new Tt().fromArray(re),fe=new Tt().fromArray(ce);function ze(N,le,de){let Re=new Uint8Array(4),Se=n.createTexture();n.bindTexture(N,Se),n.texParameteri(N,10241,9728),n.texParameteri(N,10240,9728);for(let Ve=0;Vepe||O.height>pe)&&(Ee=pe/Math.max(O.width,O.height)),Ee<1||L===!0)if(typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&O instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&O instanceof ImageBitmap){let Ae=L?hg:Math.floor,He=Ae(Ee*O.width),se=Ae(Ee*O.height);y===void 0&&(y=w(He,se));let Je=$?w(He,se):y;return Je.width=He,Je.height=se,Je.getContext("2d").drawImage(O,0,0,He,se),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+O.width+"x"+O.height+") to ("+He+"x"+se+")."),Je}else return"data"in O&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+O.width+"x"+O.height+")."),O;return O}function T(O){return r1(O.width)&&r1(O.height)}function C(O){return u?!1:O.wrapS!==lr||O.wrapT!==lr||O.minFilter!==_n&&O.minFilter!==hn}function P(O,L){return O.generateMipmaps&&L&&O.minFilter!==_n&&O.minFilter!==hn}function D(O){n.generateMipmap(O)}function I(O,L,$,pe,Ee=!1){if(u===!1)return L;if(O!==null){if(n[O]!==void 0)return n[O];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+O+"'")}let Ae=L;return L===6403&&($===5126&&(Ae=33326),$===5131&&(Ae=33325),$===5121&&(Ae=33321)),L===33319&&($===5126&&(Ae=33328),$===5131&&(Ae=33327),$===5121&&(Ae=33323)),L===6408&&($===5126&&(Ae=34836),$===5131&&(Ae=34842),$===5121&&(Ae=pe===Dt&&Ee===!1?35907:32856),$===32819&&(Ae=32854),$===32820&&(Ae=32855)),(Ae===33325||Ae===33326||Ae===33327||Ae===33328||Ae===34842||Ae===34836)&&e.get("EXT_color_buffer_float"),Ae}function G(O,L,$){return P(O,$)===!0||O.isFramebufferTexture&&O.minFilter!==_n&&O.minFilter!==hn?Math.log2(Math.max(L.width,L.height))+1:O.mipmaps!==void 0&&O.mipmaps.length>0?O.mipmaps.length:O.isCompressedTexture&&Array.isArray(O.image)?L.mipmaps.length:1}function B(O){return O===_n||O===cg||O===fg?9728:9729}function A(O){let L=O.target;L.removeEventListener("dispose",A),ne(L),L.isVideoTexture&&x.delete(L)}function F(O){let L=O.target;L.removeEventListener("dispose",F),Q(L)}function ne(O){let L=r.get(O);if(L.__webglInit===void 0)return;let $=O.source,pe=_.get($);if(pe){let Ee=pe[L.__cacheKey];Ee.usedTimes--,Ee.usedTimes===0&&j(O),Object.keys(pe).length===0&&_.delete($)}r.remove(O)}function j(O){let L=r.get(O);n.deleteTexture(L.__webglTexture);let $=O.source,pe=_.get($);delete pe[L.__cacheKey],o.memory.textures--}function Q(O){let L=O.texture,$=r.get(O),pe=r.get(L);if(pe.__webglTexture!==void 0&&(n.deleteTexture(pe.__webglTexture),o.memory.textures--),O.depthTexture&&O.depthTexture.dispose(),O.isWebGLCubeRenderTarget)for(let Ee=0;Ee<6;Ee++)n.deleteFramebuffer($.__webglFramebuffer[Ee]),$.__webglDepthbuffer&&n.deleteRenderbuffer($.__webglDepthbuffer[Ee]);else n.deleteFramebuffer($.__webglFramebuffer),$.__webglDepthbuffer&&n.deleteRenderbuffer($.__webglDepthbuffer),$.__webglMultisampledFramebuffer&&n.deleteFramebuffer($.__webglMultisampledFramebuffer),$.__webglColorRenderbuffer&&n.deleteRenderbuffer($.__webglColorRenderbuffer),$.__webglDepthRenderbuffer&&n.deleteRenderbuffer($.__webglDepthRenderbuffer);if(O.isWebGLMultipleRenderTargets)for(let Ee=0,Ae=L.length;Ee=c&&console.warn("THREE.WebGLTextures: Trying to use "+O+" texture units while this GPU supports only "+c),X+=1,O}function re(O){let L=[];return L.push(O.wrapS),L.push(O.wrapT),L.push(O.magFilter),L.push(O.minFilter),L.push(O.anisotropy),L.push(O.internalFormat),L.push(O.format),L.push(O.type),L.push(O.generateMipmaps),L.push(O.premultiplyAlpha),L.push(O.flipY),L.push(O.unpackAlignment),L.push(O.encoding),L.join()}function ce(O,L){let $=r.get(O);if(O.isVideoTexture&&_t(O),O.isRenderTargetTexture===!1&&O.version>0&&$.__version!==O.version){let pe=O.image;if(pe===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(pe.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Qe($,O,L);return}}t.activeTexture(33984+L),t.bindTexture(3553,$.__webglTexture)}function ge(O,L){let $=r.get(O);if(O.version>0&&$.__version!==O.version){Qe($,O,L);return}t.activeTexture(33984+L),t.bindTexture(35866,$.__webglTexture)}function fe(O,L){let $=r.get(O);if(O.version>0&&$.__version!==O.version){Qe($,O,L);return}t.activeTexture(33984+L),t.bindTexture(32879,$.__webglTexture)}function ze(O,L){let $=r.get(O);if(O.version>0&&$.__version!==O.version){qe($,O,L);return}t.activeTexture(33984+L),t.bindTexture(34067,$.__webglTexture)}let $e={[Qf]:10497,[lr]:33071,[Jf]:33648},Xe={[_n]:9728,[cg]:9984,[fg]:9986,[hn]:9729,[fw]:9985,[El]:9987};function ue(O,L,$){if($?(n.texParameteri(O,10242,$e[L.wrapS]),n.texParameteri(O,10243,$e[L.wrapT]),(O===32879||O===35866)&&n.texParameteri(O,32882,$e[L.wrapR]),n.texParameteri(O,10240,Xe[L.magFilter]),n.texParameteri(O,10241,Xe[L.minFilter])):(n.texParameteri(O,10242,33071),n.texParameteri(O,10243,33071),(O===32879||O===35866)&&n.texParameteri(O,32882,33071),(L.wrapS!==lr||L.wrapT!==lr)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(O,10240,B(L.magFilter)),n.texParameteri(O,10241,B(L.minFilter)),L.minFilter!==_n&&L.minFilter!==hn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let pe=e.get("EXT_texture_filter_anisotropic");if(L.type===Os&&e.has("OES_texture_float_linear")===!1||u===!1&&L.type===Ya&&e.has("OES_texture_half_float_linear")===!1)return;(L.anisotropy>1||r.get(L).__currentAnisotropy)&&(n.texParameterf(O,pe.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(L.anisotropy,i.getMaxAnisotropy())),r.get(L).__currentAnisotropy=L.anisotropy)}}function dt(O,L){let $=!1;O.__webglInit===void 0&&(O.__webglInit=!0,L.addEventListener("dispose",A));let pe=L.source,Ee=_.get(pe);Ee===void 0&&(Ee={},_.set(pe,Ee));let Ae=re(L);if(Ae!==O.__cacheKey){Ee[Ae]===void 0&&(Ee[Ae]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,$=!0),Ee[Ae].usedTimes++;let He=Ee[O.__cacheKey];He!==void 0&&(Ee[O.__cacheKey].usedTimes--,He.usedTimes===0&&j(L)),O.__cacheKey=Ae,O.__webglTexture=Ee[Ae].texture}return $}function Qe(O,L,$){let pe=3553;L.isDataArrayTexture&&(pe=35866),L.isData3DTexture&&(pe=32879);let Ee=dt(O,L),Ae=L.source;if(t.activeTexture(33984+$),t.bindTexture(pe,O.__webglTexture),Ae.version!==Ae.__currentVersion||Ee===!0){n.pixelStorei(37440,L.flipY),n.pixelStorei(37441,L.premultiplyAlpha),n.pixelStorei(3317,L.unpackAlignment),n.pixelStorei(37443,0);let He=C(L)&&T(L.image)===!1,se=E(L.image,He,!1,d);se=bt(L,se);let Je=T(se)||u,et=s.convert(L.format,L.encoding),U=s.convert(L.type),N=I(L.internalFormat,et,U,L.encoding,L.isVideoTexture);ue(pe,L,Je);let le,de=L.mipmaps,Re=u&&L.isVideoTexture!==!0,Se=O.__version===void 0,Ve=G(L,se,Je);if(L.isDepthTexture)N=6402,u?L.type===Os?N=36012:L.type===Gf?N=33190:L.type===Za?N=35056:N=33189:L.type===Os&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),L.format===Ho&&N===6402&&L.type!==Wu&&L.type!==Gf&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),L.type=Wu,U=s.convert(L.type)),L.format===el&&N===6402&&(N=34041,L.type!==Za&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),L.type=Za,U=s.convert(L.type))),Re&&Se?t.texStorage2D(3553,1,N,se.width,se.height):t.texImage2D(3553,0,N,se.width,se.height,0,et,U,null);else if(L.isDataTexture)if(de.length>0&&Je){Re&&Se&&t.texStorage2D(3553,Ve,N,de[0].width,de[0].height);for(let _e=0,Be=de.length;_e0&&Je){Re&&Se&&t.texStorage2D(3553,Ve,N,de[0].width,de[0].height);for(let _e=0,Be=de.length;_e0&&Se++,t.texStorage2D(34067,Se,le,se[0].width,se[0].height));for(let _e=0;_e<6;_e++)if(He){de?t.texSubImage2D(34069+_e,0,0,0,se[_e].width,se[_e].height,U,N,se[_e].data):t.texImage2D(34069+_e,0,le,se[_e].width,se[_e].height,0,U,N,se[_e].data);for(let Be=0;Be0&&Oe(O)===!1){$.__webglMultisampledFramebuffer=n.createFramebuffer(),$.__webglColorRenderbuffer=n.createRenderbuffer(),n.bindRenderbuffer(36161,$.__webglColorRenderbuffer);let se=s.convert(L.format,L.encoding),Je=s.convert(L.type),et=I(L.internalFormat,se,Je,L.encoding),U=Ue(O);n.renderbufferStorageMultisample(36161,U,et,O.width,O.height),t.bindFramebuffer(36160,$.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(36160,36064,36161,$.__webglColorRenderbuffer),n.bindRenderbuffer(36161,null),O.depthBuffer&&($.__webglDepthRenderbuffer=n.createRenderbuffer(),je($.__webglDepthRenderbuffer,O,!0)),t.bindFramebuffer(36160,null)}if(Ee){t.bindTexture(34067,pe.__webglTexture),ue(34067,L,He);for(let se=0;se<6;se++)xe($.__webglFramebuffer[se],O,L,36064,34069+se);P(L,He)&&D(34067),t.unbindTexture()}else if(Ae){let se=O.texture;for(let Je=0,et=se.length;Je0&&Oe(O)===!1){let L=O.width,$=O.height,pe=16384,Ee=[36064],Ae=O.stencilBuffer?33306:36096;O.depthBuffer&&Ee.push(Ae);let He=r.get(O),se=He.__ignoreDepthValues!==void 0?He.__ignoreDepthValues:!1;se===!1&&(O.depthBuffer&&(pe|=256),O.stencilBuffer&&(pe|=1024)),t.bindFramebuffer(36008,He.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,He.__webglFramebuffer),se===!0&&(n.invalidateFramebuffer(36008,[Ae]),n.invalidateFramebuffer(36009,[Ae])),n.blitFramebuffer(0,0,L,$,0,0,L,$,pe,9728),g&&n.invalidateFramebuffer(36008,Ee),t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,He.__webglMultisampledFramebuffer)}}function Ue(O){return Math.min(p,O.samples)}function Oe(O){let L=r.get(O);return u&&O.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&L.__useRenderToTexture!==!1}function _t(O){let L=o.render.frame;x.get(O)!==L&&(x.set(O,L),O.update())}function bt(O,L){let $=O.encoding,pe=O.format,Ee=O.type;return O.isCompressedTexture===!0||O.isVideoTexture===!0||O.format===dg||$!==vi&&($===Dt?u===!1?e.has("EXT_sRGB")===!0&&pe===Hr?(O.format=dg,O.minFilter=hn,O.generateMipmaps=!1):L=ss.sRGBToLinear(L):(pe!==Hr||Ee!==jo)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",$)),L}this.allocateTextureUnit=W,this.resetTextureUnits=J,this.setTexture2D=ce,this.setTexture2DArray=ge,this.setTexture3D=fe,this.setTextureCube=ze,this.rebindTextures=ve,this.setupRenderTarget=Ie,this.updateRenderTargetMipmap=be,this.updateMultisampleRenderTarget=Ze,this.setupDepthRenderbuffer=ie,this.setupFrameBufferTexture=xe,this.useMultisampledRTT=Oe}function eA(n,e,t){let r=t.isWebGL2;function i(s,o=null){let u;if(s===jo)return 5121;if(s===_C)return 32819;if(s===wC)return 32820;if(s===vC)return 5120;if(s===yC)return 5122;if(s===Wu)return 5123;if(s===xC)return 5124;if(s===Gf)return 5125;if(s===Os)return 5126;if(s===Ya)return r?5131:(u=e.get("OES_texture_half_float"),u!==null?u.HALF_FLOAT_OES:null);if(s===SC)return 6406;if(s===Hr)return 6408;if(s===EC)return 6409;if(s===TC)return 6410;if(s===Ho)return 6402;if(s===el)return 34041;if(s===bC)return 6403;if(s===MC)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(s===dg)return u=e.get("EXT_sRGB"),u!==null?u.SRGB_ALPHA_EXT:null;if(s===CC)return 36244;if(s===AC)return 33319;if(s===PC)return 33320;if(s===RC)return 36249;if(s===ng||s===rg||s===ig||s===sg)if(o===Dt)if(u=e.get("WEBGL_compressed_texture_s3tc_srgb"),u!==null){if(s===ng)return u.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===rg)return u.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===ig)return u.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===sg)return u.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(u=e.get("WEBGL_compressed_texture_s3tc"),u!==null){if(s===ng)return u.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===rg)return u.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===ig)return u.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===sg)return u.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===z_||s===k_||s===F_||s===O_)if(u=e.get("WEBGL_compressed_texture_pvrtc"),u!==null){if(s===z_)return u.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===k_)return u.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===F_)return u.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===O_)return u.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===LC)return u=e.get("WEBGL_compressed_texture_etc1"),u!==null?u.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===B_||s===U_)if(u=e.get("WEBGL_compressed_texture_etc"),u!==null){if(s===B_)return o===Dt?u.COMPRESSED_SRGB8_ETC2:u.COMPRESSED_RGB8_ETC2;if(s===U_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:u.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===H_||s===V_||s===G_||s===W_||s===j_||s===X_||s===q_||s===Y_||s===Z_||s===Q_||s===J_||s===K_||s===$_||s===e1)if(u=e.get("WEBGL_compressed_texture_astc"),u!==null){if(s===H_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:u.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===V_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:u.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===G_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:u.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===W_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:u.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===j_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:u.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===X_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:u.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===q_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:u.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===Y_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:u.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===Z_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:u.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===Q_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:u.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===J_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:u.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===K_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:u.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===$_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:u.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===e1)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:u.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===t1)if(u=e.get("EXT_texture_compression_bptc"),u!==null){if(s===t1)return o===Dt?u.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:u.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;if(s===Za)return r?34042:(u=e.get("WEBGL_depth_texture"),u!==null?u.UNSIGNED_INT_24_8_WEBGL:null)}return{convert:i}}var id=class extends Lt{constructor(e=[]){super(),this.cameras=e}};id.prototype.isArrayCamera=!0;var Us=class extends st{constructor(){super(),this.type="Group"}};Us.prototype.isGroup=!0;var GF={type:"move"},jf=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Us,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Us,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new R,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new R),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Us,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new R,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new R),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,r){let i=null,s=null,o=null,u=this._targetRay,c=this._grip,f=this._hand;if(e&&t.session.visibilityState!=="visible-blurred")if(u!==null&&(i=t.getPose(e.targetRaySpace,r),i!==null&&(u.matrix.fromArray(i.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),i.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(i.linearVelocity)):u.hasLinearVelocity=!1,i.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(i.angularVelocity)):u.hasAngularVelocity=!1,this.dispatchEvent(GF))),f&&e.hand){o=!0;for(let y of e.hand.values()){let _=t.getJointPose(y,r);if(f.joints[y.jointName]===void 0){let w=new Us;w.matrixAutoUpdate=!1,w.visible=!1,f.joints[y.jointName]=w,f.add(w)}let S=f.joints[y.jointName];_!==null&&(S.matrix.fromArray(_.transform.matrix),S.matrix.decompose(S.position,S.rotation,S.scale),S.jointRadius=_.radius),S.visible=_!==null}let d=f.joints["index-finger-tip"],p=f.joints["thumb-tip"],m=d.position.distanceTo(p.position),g=.02,x=.005;f.inputState.pinching&&m>g+x?(f.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!f.inputState.pinching&&m<=g-x&&(f.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,r),s!==null&&(c.matrix.fromArray(s.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),s.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(s.linearVelocity)):c.hasLinearVelocity=!1,s.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(s.angularVelocity)):c.hasAngularVelocity=!1));return u!==null&&(u.visible=i!==null),c!==null&&(c.visible=s!==null),f!==null&&(f.visible=o!==null),this}},sd=class extends Wt{constructor(e,t,r,i,s,o,u,c,f,d){if(d=d!==void 0?d:Ho,d!==Ho&&d!==el)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&d===Ho&&(r=Wu),r===void 0&&d===el&&(r=Za),super(null,i,s,o,u,c,d,r,f),this.image={width:e,height:t},this.magFilter=u!==void 0?u:_n,this.minFilter=c!==void 0?c:_n,this.flipY=!1,this.generateMipmaps=!1}};sd.prototype.isDepthTexture=!0;var a1=class extends yi{constructor(e,t){super();let r=this,i=null,s=1,o=null,u="local-floor",c=null,f=null,d=null,p=null,m=null,g=t.getContextAttributes(),x=null,y=null,_=[],S=new Map,w=new Lt;w.layers.enable(1),w.viewport=new Tt;let E=new Lt;E.layers.enable(2),E.viewport=new Tt;let T=[w,E],C=new id;C.layers.enable(1),C.layers.enable(2);let P=null,D=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(W){let re=_[W];return re===void 0&&(re=new jf,_[W]=re),re.getTargetRaySpace()},this.getControllerGrip=function(W){let re=_[W];return re===void 0&&(re=new jf,_[W]=re),re.getGripSpace()},this.getHand=function(W){let re=_[W];return re===void 0&&(re=new jf,_[W]=re),re.getHandSpace()};function I(W){let re=S.get(W.inputSource);re&&re.dispatchEvent({type:W.type,data:W.inputSource})}function G(){S.forEach(function(W,re){W.disconnect(re)}),S.clear(),P=null,D=null,e.setRenderTarget(x),p=null,d=null,f=null,i=null,y=null,J.stop(),r.isPresenting=!1,r.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(W){s=W,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(W){u=W,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o},this.getBaseLayer=function(){return d!==null?d:p},this.getBinding=function(){return f},this.getFrame=function(){return m},this.getSession=function(){return i},this.setSession=async function(W){if(i=W,i!==null){if(x=e.getRenderTarget(),i.addEventListener("select",I),i.addEventListener("selectstart",I),i.addEventListener("selectend",I),i.addEventListener("squeeze",I),i.addEventListener("squeezestart",I),i.addEventListener("squeezeend",I),i.addEventListener("end",G),i.addEventListener("inputsourceschange",B),g.xrCompatible!==!0&&await t.makeXRCompatible(),i.renderState.layers===void 0||e.capabilities.isWebGL2===!1){let re={antialias:i.renderState.layers===void 0?g.antialias:!0,alpha:g.alpha,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:s};p=new XRWebGLLayer(i,t,re),i.updateRenderState({baseLayer:p}),y=new On(p.framebufferWidth,p.framebufferHeight,{format:Hr,type:jo,encoding:e.outputEncoding})}else{let re=null,ce=null,ge=null;g.depth&&(ge=g.stencil?35056:33190,re=g.stencil?el:Ho,ce=g.stencil?Za:Wu);let fe={colorFormat:e.outputEncoding===Dt?35907:32856,depthFormat:ge,scaleFactor:s};f=new XRWebGLBinding(i,t),d=f.createProjectionLayer(fe),i.updateRenderState({layers:[d]}),y=new On(d.textureWidth,d.textureHeight,{format:Hr,type:jo,depthTexture:new sd(d.textureWidth,d.textureHeight,ce,void 0,void 0,void 0,void 0,void 0,void 0,re),stencilBuffer:g.stencil,encoding:e.outputEncoding,samples:g.antialias?4:0});let ze=e.properties.get(y);ze.__ignoreDepthValues=d.ignoreDepthValues}y.isXRRenderTarget=!0,this.setFoveation(1),o=await i.requestReferenceSpace(u),J.setContext(i),J.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}};function B(W){let re=i.inputSources;for(let ce=0;ce<_.length;ce++)S.set(re[ce],_[ce]);for(let ce=0;ce0&&(y.alphaTest.value=_.alphaTest);let S=e.get(_).envMap;if(S&&(y.envMap.value=S,y.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=_.reflectivity,y.ior.value=_.ior,y.refractionRatio.value=_.refractionRatio),_.lightMap){y.lightMap.value=_.lightMap;let T=n.physicallyCorrectLights!==!0?Math.PI:1;y.lightMapIntensity.value=_.lightMapIntensity*T}_.aoMap&&(y.aoMap.value=_.aoMap,y.aoMapIntensity.value=_.aoMapIntensity);let w;_.map?w=_.map:_.specularMap?w=_.specularMap:_.displacementMap?w=_.displacementMap:_.normalMap?w=_.normalMap:_.bumpMap?w=_.bumpMap:_.roughnessMap?w=_.roughnessMap:_.metalnessMap?w=_.metalnessMap:_.alphaMap?w=_.alphaMap:_.emissiveMap?w=_.emissiveMap:_.clearcoatMap?w=_.clearcoatMap:_.clearcoatNormalMap?w=_.clearcoatNormalMap:_.clearcoatRoughnessMap?w=_.clearcoatRoughnessMap:_.specularIntensityMap?w=_.specularIntensityMap:_.specularColorMap?w=_.specularColorMap:_.transmissionMap?w=_.transmissionMap:_.thicknessMap?w=_.thicknessMap:_.sheenColorMap?w=_.sheenColorMap:_.sheenRoughnessMap&&(w=_.sheenRoughnessMap),w!==void 0&&(w.isWebGLRenderTarget&&(w=w.texture),w.matrixAutoUpdate===!0&&w.updateMatrix(),y.uvTransform.value.copy(w.matrix));let E;_.aoMap?E=_.aoMap:_.lightMap&&(E=_.lightMap),E!==void 0&&(E.isWebGLRenderTarget&&(E=E.texture),E.matrixAutoUpdate===!0&&E.updateMatrix(),y.uv2Transform.value.copy(E.matrix))}function s(y,_){y.diffuse.value.copy(_.color),y.opacity.value=_.opacity}function o(y,_){y.dashSize.value=_.dashSize,y.totalSize.value=_.dashSize+_.gapSize,y.scale.value=_.scale}function u(y,_,S,w){y.diffuse.value.copy(_.color),y.opacity.value=_.opacity,y.size.value=_.size*S,y.scale.value=w*.5,_.map&&(y.map.value=_.map),_.alphaMap&&(y.alphaMap.value=_.alphaMap),_.alphaTest>0&&(y.alphaTest.value=_.alphaTest);let E;_.map?E=_.map:_.alphaMap&&(E=_.alphaMap),E!==void 0&&(E.matrixAutoUpdate===!0&&E.updateMatrix(),y.uvTransform.value.copy(E.matrix))}function c(y,_){y.diffuse.value.copy(_.color),y.opacity.value=_.opacity,y.rotation.value=_.rotation,_.map&&(y.map.value=_.map),_.alphaMap&&(y.alphaMap.value=_.alphaMap),_.alphaTest>0&&(y.alphaTest.value=_.alphaTest);let S;_.map?S=_.map:_.alphaMap&&(S=_.alphaMap),S!==void 0&&(S.matrixAutoUpdate===!0&&S.updateMatrix(),y.uvTransform.value.copy(S.matrix))}function f(y,_){y.specular.value.copy(_.specular),y.shininess.value=Math.max(_.shininess,1e-4)}function d(y,_){_.gradientMap&&(y.gradientMap.value=_.gradientMap)}function p(y,_){y.roughness.value=_.roughness,y.metalness.value=_.metalness,_.roughnessMap&&(y.roughnessMap.value=_.roughnessMap),_.metalnessMap&&(y.metalnessMap.value=_.metalnessMap),e.get(_).envMap&&(y.envMapIntensity.value=_.envMapIntensity)}function m(y,_,S){y.ior.value=_.ior,_.sheen>0&&(y.sheenColor.value.copy(_.sheenColor).multiplyScalar(_.sheen),y.sheenRoughness.value=_.sheenRoughness,_.sheenColorMap&&(y.sheenColorMap.value=_.sheenColorMap),_.sheenRoughnessMap&&(y.sheenRoughnessMap.value=_.sheenRoughnessMap)),_.clearcoat>0&&(y.clearcoat.value=_.clearcoat,y.clearcoatRoughness.value=_.clearcoatRoughness,_.clearcoatMap&&(y.clearcoatMap.value=_.clearcoatMap),_.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=_.clearcoatRoughnessMap),_.clearcoatNormalMap&&(y.clearcoatNormalScale.value.copy(_.clearcoatNormalScale),y.clearcoatNormalMap.value=_.clearcoatNormalMap,_.side===Vr&&y.clearcoatNormalScale.value.negate())),_.transmission>0&&(y.transmission.value=_.transmission,y.transmissionSamplerMap.value=S.texture,y.transmissionSamplerSize.value.set(S.width,S.height),_.transmissionMap&&(y.transmissionMap.value=_.transmissionMap),y.thickness.value=_.thickness,_.thicknessMap&&(y.thicknessMap.value=_.thicknessMap),y.attenuationDistance.value=_.attenuationDistance,y.attenuationColor.value.copy(_.attenuationColor)),y.specularIntensity.value=_.specularIntensity,y.specularColor.value.copy(_.specularColor),_.specularIntensityMap&&(y.specularIntensityMap.value=_.specularIntensityMap),_.specularColorMap&&(y.specularColorMap.value=_.specularColorMap)}function g(y,_){_.matcap&&(y.matcap.value=_.matcap)}function x(y,_){y.referencePosition.value.copy(_.referencePosition),y.nearDistance.value=_.nearDistance,y.farDistance.value=_.farDistance}return{refreshFogUniforms:t,refreshMaterialUniforms:r}}function jF(){let n=nd("canvas");return n.style.display="block",n}function At(n={}){let e=n.canvas!==void 0?n.canvas:jF(),t=n.context!==void 0?n.context:null,r=n.depth!==void 0?n.depth:!0,i=n.stencil!==void 0?n.stencil:!0,s=n.antialias!==void 0?n.antialias:!1,o=n.premultipliedAlpha!==void 0?n.premultipliedAlpha:!0,u=n.preserveDrawingBuffer!==void 0?n.preserveDrawingBuffer:!1,c=n.powerPreference!==void 0?n.powerPreference:"default",f=n.failIfMajorPerformanceCaveat!==void 0?n.failIfMajorPerformanceCaveat:!1,d;n.context!==void 0?d=t.getContextAttributes().alpha:d=n.alpha!==void 0?n.alpha:!1;let p=null,m=null,g=[],x=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=vi,this.physicallyCorrectLights=!1,this.toneMapping=pi,this.toneMappingExposure=1;let y=this,_=!1,S=0,w=0,E=null,T=-1,C=null,P=new Tt,D=new Tt,I=null,G=e.width,B=e.height,A=1,F=null,ne=null,j=new Tt(0,0,G,B),Q=new Tt(0,0,G,B),X=!1,J=new nl,W=!1,re=!1,ce=null,ge=new Ne,fe=new oe,ze=new R,$e={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Xe(){return E===null?A:1}let ue=t;function dt(z,q){for(let ee=0;ee0?m=x[x.length-1]:m=null,g.pop(),g.length>0?p=g[g.length-1]:p=null};function Yr(z,q,ee,Z){if(z.visible===!1)return;if(z.layers.test(q.layers)){if(z.isGroup)ee=z.renderOrder;else if(z.isLOD)z.autoUpdate===!0&&z.update(q);else if(z.isLight)m.pushLight(z),z.castShadow&&m.pushShadow(z);else if(z.isSprite){if(!z.frustumCulled||J.intersectsSprite(z)){Z&&ze.setFromMatrixPosition(z.matrixWorld).applyMatrix4(ge);let tt=Ue.update(z),ot=z.material;ot.visible&&p.push(z,tt,ot,ee,ze.z,null)}}else if((z.isMesh||z.isLine||z.isPoints)&&(z.isSkinnedMesh&&z.skeleton.frame!==je.render.frame&&(z.skeleton.update(),z.skeleton.frame=je.render.frame),!z.frustumCulled||J.intersectsObject(z))){Z&&ze.setFromMatrixPosition(z.matrixWorld).applyMatrix4(ge);let tt=Ue.update(z),ot=z.material;if(Array.isArray(ot)){let it=tt.groups;for(let Ct=0,gt=it.length;Ct0&&Jd(he,q,ee),Z&&xe.viewport(P.copy(Z)),he.length>0&&Ll(he,q,ee),Ye.length>0&&Ll(Ye,q,ee),tt.length>0&&Ll(tt,q,ee),xe.buffers.depth.setTest(!0),xe.buffers.depth.setMask(!0),xe.buffers.color.setMask(!0),xe.setPolygonOffset(!1)}function Jd(z,q,ee){let Z=qe.isWebGL2;ce===null&&(ce=new On(1,1,{generateMipmaps:!0,type:se.convert(Ya)!==null?Ya:jo,minFilter:El,samples:Z&&s===!0?4:0})),y.getDrawingBufferSize(fe),Z?ce.setSize(fe.x,fe.y):ce.setSize(hg(fe.x),hg(fe.y));let he=y.getRenderTarget();y.setRenderTarget(ce),y.clear();let Ye=y.toneMapping;y.toneMapping=pi,Ll(z,q,ee),y.toneMapping=Ye,ie.updateMultisampleRenderTarget(ce),ie.updateRenderTargetMipmap(ce),y.setRenderTarget(he)}function Ll(z,q,ee){let Z=q.isScene===!0?q.overrideMaterial:null;for(let he=0,Ye=z.length;he0&&ie.useMultisampledRTT(z)===!1?he=ae.get(z).__webglMultisampledFramebuffer:he=Ct,P.copy(z.viewport),D.copy(z.scissor),I=z.scissorTest}else P.copy(j).multiplyScalar(A).floor(),D.copy(Q).multiplyScalar(A).floor(),I=X;if(xe.bindFramebuffer(36160,he)&&qe.drawBuffers&&Z&&xe.drawBuffers(z,he),xe.viewport(P),xe.scissor(D),xe.setScissorTest(I),Ye){let it=ae.get(z.texture);ue.framebufferTexture2D(36160,36064,34069+q,it.__webglTexture,ee)}else if(tt){let it=ae.get(z.texture),Ct=q||0;ue.framebufferTextureLayer(36160,36064,it.__webglTexture,ee||0,Ct)}T=-1},this.readRenderTargetPixels=function(z,q,ee,Z,he,Ye,tt){if(!(z&&z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ot=ae.get(z).__webglFramebuffer;if(z.isWebGLCubeRenderTarget&&tt!==void 0&&(ot=ot[tt]),ot){xe.bindFramebuffer(36160,ot);try{let it=z.texture,Ct=it.format,gt=it.type;if(Ct!==Hr&&se.convert(Ct)!==ue.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let vt=gt===Ya&&(Qe.has("EXT_color_buffer_half_float")||qe.isWebGL2&&Qe.has("EXT_color_buffer_float"));if(gt!==jo&&se.convert(gt)!==ue.getParameter(35738)&&!(gt===Os&&(qe.isWebGL2||Qe.has("OES_texture_float")||Qe.has("WEBGL_color_buffer_float")))&&!vt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}q>=0&&q<=z.width-Z&&ee>=0&&ee<=z.height-he&&ue.readPixels(q,ee,Z,he,se.convert(Ct),se.convert(gt),Ye)}finally{let it=E!==null?ae.get(E).__webglFramebuffer:null;xe.bindFramebuffer(36160,it)}}},this.copyFramebufferToTexture=function(z,q,ee=0){if(q.isFramebufferTexture!==!0){console.error("THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.");return}let Z=Math.pow(2,-ee),he=Math.floor(q.image.width*Z),Ye=Math.floor(q.image.height*Z);ie.setTexture2D(q,0),ue.copyTexSubImage2D(3553,ee,0,0,z.x,z.y,he,Ye),xe.unbindTexture()},this.copyTextureToTexture=function(z,q,ee,Z=0){let he=q.image.width,Ye=q.image.height,tt=se.convert(ee.format),ot=se.convert(ee.type);ie.setTexture2D(ee,0),ue.pixelStorei(37440,ee.flipY),ue.pixelStorei(37441,ee.premultiplyAlpha),ue.pixelStorei(3317,ee.unpackAlignment),q.isDataTexture?ue.texSubImage2D(3553,Z,z.x,z.y,he,Ye,tt,ot,q.image.data):q.isCompressedTexture?ue.compressedTexSubImage2D(3553,Z,z.x,z.y,q.mipmaps[0].width,q.mipmaps[0].height,tt,q.mipmaps[0].data):ue.texSubImage2D(3553,Z,z.x,z.y,tt,ot,q.image),Z===0&&ee.generateMipmaps&&ue.generateMipmap(3553),xe.unbindTexture()},this.copyTextureToTexture3D=function(z,q,ee,Z,he=0){if(y.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Ye=z.max.x-z.min.x+1,tt=z.max.y-z.min.y+1,ot=z.max.z-z.min.z+1,it=se.convert(Z.format),Ct=se.convert(Z.type),gt;if(Z.isData3DTexture)ie.setTexture3D(Z,0),gt=32879;else if(Z.isDataArrayTexture)ie.setTexture2DArray(Z,0),gt=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}ue.pixelStorei(37440,Z.flipY),ue.pixelStorei(37441,Z.premultiplyAlpha),ue.pixelStorei(3317,Z.unpackAlignment);let vt=ue.getParameter(3314),Ht=ue.getParameter(32878),ms=ue.getParameter(3316),$s=ue.getParameter(3315),eo=ue.getParameter(32877),Zr=ee.isCompressedTexture?ee.mipmaps[0]:ee.image;ue.pixelStorei(3314,Zr.width),ue.pixelStorei(32878,Zr.height),ue.pixelStorei(3316,z.min.x),ue.pixelStorei(3315,z.min.y),ue.pixelStorei(32877,z.min.z),ee.isDataTexture||ee.isData3DTexture?ue.texSubImage3D(gt,he,q.x,q.y,q.z,Ye,tt,ot,it,Ct,Zr.data):ee.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ue.compressedTexSubImage3D(gt,he,q.x,q.y,q.z,Ye,tt,ot,it,Zr.data)):ue.texSubImage3D(gt,he,q.x,q.y,q.z,Ye,tt,ot,it,Ct,Zr),ue.pixelStorei(3314,vt),ue.pixelStorei(32878,Ht),ue.pixelStorei(3316,ms),ue.pixelStorei(3315,$s),ue.pixelStorei(32877,eo),he===0&&Z.generateMipmaps&&ue.generateMipmap(gt),xe.unbindTexture()},this.initTexture=function(z){ie.setTexture2D(z,0),xe.unbindTexture()},this.resetState=function(){S=0,w=0,E=null,xe.reset(),Je.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}At.prototype.isWebGLRenderer=!0;var Eg=class extends At{};Eg.prototype.isWebGL1Renderer=!0;var rl=class{constructor(e,t=25e-5){this.name="",this.color=new we(e),this.density=t}clone(){return new rl(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};rl.prototype.isFogExp2=!0;var il=class{constructor(e,t=1,r=1e3){this.name="",this.color=new we(e),this.near=t,this.far=r}clone(){return new il(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};il.prototype.isFog=!0;var Zo=class extends st{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};Zo.prototype.isScene=!0;var Ws=class{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=ju,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Gr()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,r){e*=this.stride,r*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:c,point:Ff.clone(),uv:Jt.getUV(Ff,zm,Bf,km,$b,__,e3,new oe),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};tc.prototype.isSprite=!0;function Fm(n,e,t,r,i,s){Bu.subVectors(n,t).addScalar(.5).multiply(r),i!==void 0?(Of.x=s*Bu.x-i*Bu.y,Of.y=i*Bu.x+s*Bu.y):Of.copy(Bu),n.copy(e),n.x+=Of.x,n.y+=Of.y,n.applyMatrix4(tA)}var Om=new R,t3=new R,Tg=class extends st{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let r=0,i=t.length;r0){let r,i;for(r=1,i=t.length;r0){Om.setFromMatrixPosition(this.matrixWorld);let i=e.ray.origin.distanceTo(Om);this.getObjectForDistance(i).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){Om.setFromMatrixPosition(e.matrixWorld),t3.setFromMatrixPosition(this.matrixWorld);let r=Om.distanceTo(t3)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;ic)continue;m.applyMatrix4(this.matrixWorld);let I=e.ray.origin.distanceTo(m);Ie.far||t.push({distance:I,point:p.clone().applyMatrix4(this.matrixWorld),index:E,face:null,faceIndex:null,object:this})}}else{let S=Math.max(0,o.start),w=Math.min(_.count,o.start+o.count);for(let E=S,T=w-1;Ec)continue;m.applyMatrix4(this.matrixWorld);let P=e.ray.origin.distanceTo(m);Pe.far||t.push({distance:P,point:p.clone().applyMatrix4(this.matrixWorld),index:E,face:null,faceIndex:null,object:this})}}}else r.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,r=Object.keys(t);if(r.length>0){let i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};xi.prototype.isLine=!0;var d3=new R,h3=new R,$n=class extends xi{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,r=[];for(let i=0,s=t.count;i0){let i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};sl.prototype.isPoints=!0;function m3(n,e,t,r,i,s,o){let u=l1.distanceSqToPoint(n);if(ui.far)return;s.push({distance:f,distanceToRay:Math.sqrt(u),point:c,index:e,face:null,object:o})}}var bg=class extends Wt{constructor(e,t,r,i,s,o,u,c,f){super(e,t,r,i,s,o,u,c,f),this.minFilter=o!==void 0?o:hn,this.magFilter=s!==void 0?s:hn,this.generateMipmaps=!1;let d=this;function p(){d.needsUpdate=!0,e.requestVideoFrameCallback(p)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(p)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};bg.prototype.isVideoTexture=!0;var Cg=class extends Wt{constructor(e,t,r){super({width:e,height:t}),this.format=r,this.magFilter=_n,this.minFilter=_n,this.generateMipmaps=!1,this.needsUpdate=!0}};Cg.prototype.isFramebufferTexture=!0;var ld=class extends Wt{constructor(e,t,r,i,s,o,u,c,f,d,p,m){super(null,o,u,c,f,d,i,s,p,m),this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}};ld.prototype.isCompressedTexture=!0;var Ag=class extends Wt{constructor(e,t,r,i,s,o,u,c,f){super(e,t,r,i,s,o,u,c,f),this.needsUpdate=!0}};Ag.prototype.isCanvasTexture=!0;var fr=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){let r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){let t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){let t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t}getLength(){let e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let t=[],r,i=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)r=this.getPoint(o/e),s+=r.distanceTo(i),t.push(s),i=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){let r=this.getLengths(),i=0,s=r.length,o;t?o=t:o=e*r[s-1];let u=0,c=s-1,f;for(;u<=c;)if(i=Math.floor(u+(c-u)/2),f=r[i]-o,f<0)u=i+1;else if(f>0)c=i-1;else{c=i;break}if(i=c,r[i]===o)return i/(s-1);let d=r[i],m=r[i+1]-d,g=(o-d)/m;return(i+g)/(s-1)}getTangent(e,t){let i=e-1e-4,s=e+1e-4;i<0&&(i=0),s>1&&(s=1);let o=this.getPoint(i),u=this.getPoint(s),c=t||(o.isVector2?new oe:new R);return c.copy(u).sub(o).normalize(),c}getTangentAt(e,t){let r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t){let r=new R,i=[],s=[],o=[],u=new R,c=new Ne;for(let g=0;g<=e;g++){let x=g/e;i[g]=this.getTangentAt(x,new R)}s[0]=new R,o[0]=new R;let f=Number.MAX_VALUE,d=Math.abs(i[0].x),p=Math.abs(i[0].y),m=Math.abs(i[0].z);d<=f&&(f=d,r.set(1,0,0)),p<=f&&(f=p,r.set(0,1,0)),m<=f&&r.set(0,0,1),u.crossVectors(i[0],r).normalize(),s[0].crossVectors(i[0],u),o[0].crossVectors(i[0],s[0]);for(let g=1;g<=e;g++){if(s[g]=s[g-1].clone(),o[g]=o[g-1].clone(),u.crossVectors(i[g-1],i[g]),u.length()>Number.EPSILON){u.normalize();let x=Math.acos(pn(i[g-1].dot(i[g]),-1,1));s[g].applyMatrix4(c.makeRotationAxis(u,x))}o[g].crossVectors(i[g],s[g])}if(t===!0){let g=Math.acos(pn(s[0].dot(s[e]),-1,1));g/=e,i[0].dot(u.crossVectors(s[0],s[e]))>0&&(g=-g);for(let x=1;x<=e;x++)s[x].applyMatrix4(c.makeRotationAxis(i[x],g*x)),o[x].crossVectors(i[x],s[x])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},ol=class extends fr{constructor(e=0,t=0,r=1,i=1,s=0,o=Math.PI*2,u=!1,c=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=u,this.aRotation=c}getPoint(e,t){let r=t||new oe,i=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(u)/s)+1)*s:c===0&&u===s-1&&(u=s-2,c=1);let f,d;this.closed||u>0?f=i[(u-1)%s]:(Gm.subVectors(i[0],i[1]).add(i[0]),f=Gm);let p=i[u%s],m=i[(u+1)%s];if(this.closed||u+2i.length-2?i.length-1:o+1],p=i[o>i.length-3?i.length-1:o+2];return r.set(g3(u,c.x,f.x,d.x,p.x),g3(u,c.y,f.y,d.y,p.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t=r){let o=i[s]-r,u=this.curves[s],c=u.getLength(),f=c===0?0:1-o/c;return u.getPointAt(f,t)}s++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let r=0,i=this.curves.length;r1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,r=e.curves.length;t0){let p=f.getPoint(0);p.equals(this.currentPoint)||this.lineTo(p.x,p.y)}this.curves.push(f);let d=f.getPoint(1);return this.currentPoint.copy(d),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},Jo=class extends We{constructor(e=[new oe(0,.5),new oe(.5,0),new oe(0,-.5)],t=12,r=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:i},t=Math.floor(t),i=pn(i,0,Math.PI*2);let s=[],o=[],u=[],c=[],f=[],d=1/t,p=new R,m=new oe,g=new R,x=new R,y=new R,_=0,S=0;for(let w=0;w<=e.length-1;w++)switch(w){case 0:_=e[w+1].x-e[w].x,S=e[w+1].y-e[w].y,g.x=S*1,g.y=-_,g.z=S*0,y.copy(g),g.normalize(),c.push(g.x,g.y,g.z);break;case e.length-1:c.push(y.x,y.y,y.z);break;default:_=e[w+1].x-e[w].x,S=e[w+1].y-e[w].y,g.x=S*1,g.y=-_,g.z=S*0,x.copy(g),g.x+=y.x,g.y+=y.y,g.z+=y.z,g.normalize(),c.push(g.x,g.y,g.z),y.copy(x)}for(let w=0;w<=t;w++){let E=r+w*d*i,T=Math.sin(E),C=Math.cos(E);for(let P=0;P<=e.length-1;P++){p.x=e[P].x*T,p.y=e[P].y,p.z=e[P].x*C,o.push(p.x,p.y,p.z),m.x=w/t,m.y=P/(e.length-1),u.push(m.x,m.y);let D=c[3*P+0]*T,I=c[3*P+1],G=c[3*P+0]*C;f.push(D,I,G)}}for(let w=0;w0&&E(!0),t>0&&E(!1)),this.setIndex(d),this.setAttribute("position",new De(p,3)),this.setAttribute("normal",new De(m,3)),this.setAttribute("uv",new De(g,2));function w(){let T=new R,C=new R,P=0,D=(t-e)/r;for(let I=0;I<=s;I++){let G=[],B=I/s,A=B*(t-e)+e;for(let F=0;F<=i;F++){let ne=F/i,j=ne*c+u,Q=Math.sin(j),X=Math.cos(j);C.x=A*Q,C.y=-B*r+_,C.z=A*X,p.push(C.x,C.y,C.z),T.set(Q,D,X).normalize(),m.push(T.x,T.y,T.z),g.push(ne,1-B),G.push(x++)}y.push(G)}for(let I=0;I.9&&D<.1&&(E<.2&&(o[w+0]+=1),T<.2&&(o[w+2]+=1),C<.2&&(o[w+4]+=1))}}function m(w){s.push(w.x,w.y,w.z)}function g(w,E){let T=w*3;E.x=e[T+0],E.y=e[T+1],E.z=e[T+2]}function x(){let w=new R,E=new R,T=new R,C=new R,P=new oe,D=new oe,I=new oe;for(let G=0,B=0;G80*t){u=f=n[0],c=d=n[1];for(let x=t;xf&&(f=p),m>d&&(d=m);g=Math.max(f-u,d-c),g=g!==0?1/g:0}return hd(s,o,t,u,c,g),o}};function nA(n,e,t,r,i){let s,o;if(i===v4(n,e,t,r)>0)for(s=e;s=e;s-=r)o=v3(s,n[s],n[s+1],o);return o&&u0(o,o.next)&&(md(o),o=o.next),o}function Ko(n,e){if(!n)return n;e||(e=n);let t=n,r;do if(r=!1,!t.steiner&&(u0(t,t.next)||Kt(t.prev,t,t.next)===0)){if(md(t),t=e=t.prev,t===t.next)break;r=!0}else t=t.next;while(r||t!==e);return e}function hd(n,e,t,r,i,s,o){if(!n)return;!o&&s&&f4(n,r,i,s);let u=n,c,f;for(;n.prev!==n.next;){if(c=n.prev,f=n.next,s?r4(n,r,i,s):n4(n)){e.push(c.i/t),e.push(n.i/t),e.push(f.i/t),md(n),n=f.next,u=f.next;continue}if(n=f,n===u){o?o===1?(n=i4(Ko(n),e,t),hd(n,e,t,r,i,s,2)):o===2&&s4(n,e,t,r,i,s):hd(Ko(n),e,t,r,i,s,1);break}}}function n4(n){let e=n.prev,t=n,r=n.next;if(Kt(e,t,r)>=0)return!1;let i=n.next.next;for(;i!==n.prev;){if(Gu(e.x,e.y,t.x,t.y,r.x,r.y,i.x,i.y)&&Kt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function r4(n,e,t,r){let i=n.prev,s=n,o=n.next;if(Kt(i,s,o)>=0)return!1;let u=i.xs.x?i.x>o.x?i.x:o.x:s.x>o.x?s.x:o.x,d=i.y>s.y?i.y>o.y?i.y:o.y:s.y>o.y?s.y:o.y,p=u1(u,c,e,t,r),m=u1(f,d,e,t,r),g=n.prevZ,x=n.nextZ;for(;g&&g.z>=p&&x&&x.z<=m;){if(g!==n.prev&&g!==n.next&&Gu(i.x,i.y,s.x,s.y,o.x,o.y,g.x,g.y)&&Kt(g.prev,g,g.next)>=0||(g=g.prevZ,x!==n.prev&&x!==n.next&&Gu(i.x,i.y,s.x,s.y,o.x,o.y,x.x,x.y)&&Kt(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;g&&g.z>=p;){if(g!==n.prev&&g!==n.next&&Gu(i.x,i.y,s.x,s.y,o.x,o.y,g.x,g.y)&&Kt(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;x&&x.z<=m;){if(x!==n.prev&&x!==n.next&&Gu(i.x,i.y,s.x,s.y,o.x,o.y,x.x,x.y)&&Kt(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function i4(n,e,t){let r=n;do{let i=r.prev,s=r.next.next;!u0(i,s)&&rA(i,r,r.next,s)&&pd(i,s)&&pd(s,i)&&(e.push(i.i/t),e.push(r.i/t),e.push(s.i/t),md(r),md(r.next),r=n=s),r=r.next}while(r!==n);return Ko(r)}function s4(n,e,t,r,i,s){let o=n;do{let u=o.next.next;for(;u!==o.prev;){if(o.i!==u.i&&p4(o,u)){let c=iA(o,u);o=Ko(o,o.next),c=Ko(c,c.next),hd(o,e,t,r,i,s),hd(c,e,t,r,i,s);return}u=u.next}o=o.next}while(o!==n)}function o4(n,e,t,r){let i=[],s,o,u,c,f;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){let m=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(m<=r&&m>s){if(s=m,m===r){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x=t.x&&t.x>=c&&r!==t.x&&Gu(io.x||t.x===o.x&&c4(o,t)))&&(o=t,d=p)),t=t.next;while(t!==u);return o}function c4(n,e){return Kt(n.prev,n,e.prev)<0&&Kt(e.next,n,n.next)<0}function f4(n,e,t,r){let i=n;do i.z===null&&(i.z=u1(i.x,i.y,e,t,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==n);i.prevZ.nextZ=null,i.prevZ=null,d4(i)}function d4(n){let e,t,r,i,s,o,u,c,f=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,r=t,u=0,e=0;e0||c>0&&r;)u!==0&&(c===0||!r||t.z<=r.z)?(i=t,t=t.nextZ,u--):(i=r,r=r.nextZ,c--),s?s.nextZ=i:n=i,i.prevZ=s,s=i;t=r}s.nextZ=null,f*=2}while(o>1);return n}function u1(n,e,t,r,i){return n=32767*(n-t)*i,e=32767*(e-r)*i,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function h4(n){let e=n,t=n;do(e.x=0&&(n-o)*(r-u)-(t-o)*(e-u)>=0&&(t-o)*(s-u)-(i-o)*(r-u)>=0}function p4(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!m4(n,e)&&(pd(n,e)&&pd(e,n)&&g4(n,e)&&(Kt(n.prev,n,e.prev)||Kt(n,e.prev,e))||u0(n,e)&&Kt(n.prev,n,n.next)>0&&Kt(e.prev,e,e.next)>0)}function Kt(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function u0(n,e){return n.x===e.x&&n.y===e.y}function rA(n,e,t,r){let i=Ym(Kt(n,e,t)),s=Ym(Kt(n,e,r)),o=Ym(Kt(t,r,n)),u=Ym(Kt(t,r,e));return!!(i!==s&&o!==u||i===0&&qm(n,t,e)||s===0&&qm(n,r,e)||o===0&&qm(t,n,r)||u===0&&qm(t,e,r))}function qm(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Ym(n){return n>0?1:n<0?-1:0}function m4(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&rA(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function pd(n,e){return Kt(n.prev,n,n.next)<0?Kt(n,e,n.next)>=0&&Kt(n,n.prev,e)>=0:Kt(n,e,n.prev)<0||Kt(n,n.next,e)<0}function g4(n,e){let t=n,r=!1,i=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==n);return r}function iA(n,e){let t=new c1(n.i,n.x,n.y),r=new c1(e.i,e.x,e.y),i=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=i,i.prev=t,r.next=t,t.prev=r,s.next=r,r.prev=s,r}function v3(n,e,t,r){let i=new c1(n,e,t);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function md(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function c1(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function v4(n,e,t,r){let i=0;for(let s=e,o=t-r;s2&&n[e-1].equals(n[0])&&n.pop()}function x3(n,e){for(let t=0;tNumber.EPSILON){let $=Math.sqrt(O),pe=Math.sqrt(_t*_t+bt*bt),Ee=ie.x-Oe/$,Ae=ie.y+Ue/$,He=ve.x-bt/pe,se=ve.y+_t/pe,Je=((He-Ee)*bt-(se-Ae)*_t)/(Ue*bt-Oe*_t);Ie=Ee+Ue*Je-ae.x,be=Ae+Oe*Je-ae.y;let et=Ie*Ie+be*be;if(et<=2)return new oe(Ie,be);Ze=Math.sqrt(et/2)}else{let $=!1;Ue>Number.EPSILON?_t>Number.EPSILON&&($=!0):Ue<-Number.EPSILON?_t<-Number.EPSILON&&($=!0):Math.sign(Oe)===Math.sign(bt)&&($=!0),$?(Ie=-Oe,be=Ue,Ze=Math.sqrt(O)):(Ie=Ue,be=Oe,Ze=Math.sqrt(O/2))}return new oe(Ie/Ze,be/Ze)}let re=[];for(let ae=0,ie=j.length,ve=ie-1,Ie=ae+1;ae=0;ae--){let ie=ae/_,ve=g*Math.cos(ie*Math.PI/2),Ie=x*Math.sin(ie*Math.PI/2)+y;for(let be=0,Ze=j.length;be=0;){let Ie=ve,be=ve-1;be<0&&(be=ae.length-1);for(let Ze=0,Ue=d+_*2;Ze0)&&g.push(E,T,P),(S!==r-1||c0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}};xd.prototype.isMeshPhysicalMaterial=!0;var _d=class extends $t{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new we(16777215),this.specular=new we(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new we(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Tl,this.normalScale=new oe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Ud,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}};_d.prototype.isMeshPhongMaterial=!0;var wd=class extends $t{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new we(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new we(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Tl,this.normalScale=new oe(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.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}};wd.prototype.isMeshToonMaterial=!0;var Sd=class extends $t{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Tl,this.normalScale=new oe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}};Sd.prototype.isMeshNormalMaterial=!0;var Md=class extends $t{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new we(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new we(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Ud,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}};Md.prototype.isMeshLambertMaterial=!0;var Ed=class extends $t{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new we(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Tl,this.normalScale=new oe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this}};Ed.prototype.isMeshMatcapMaterial=!0;var Td=class extends wn{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}};Td.prototype.isLineDashedMaterial=!0;var w4={ShadowMaterial:vd,SpriteMaterial:ec,RawShaderMaterial:yd,ShaderMaterial:br,PointsMaterial:Xs,MeshPhysicalMaterial:xd,MeshStandardMaterial:uc,MeshPhongMaterial:_d,MeshToonMaterial:wd,MeshNormalMaterial:Sd,MeshLambertMaterial:Md,MeshDepthMaterial:Ku,MeshDistanceMaterial:$u,MeshBasicMaterial:Bi,MeshMatcapMaterial:Ed,LineDashedMaterial:Td,LineBasicMaterial:wn,Material:$t};$t.fromType=function(n){return new w4[n]};var Ut={arraySlice:function(n,e,t){return Ut.isTypedArray(n)?new n.constructor(n.subarray(e,t!==void 0?t:n.length)):n.slice(e,t)},convertArray:function(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)},isTypedArray:function(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)},getKeyframeOrder:function(n){function e(i,s){return n[i]-n[s]}let t=n.length,r=new Array(t);for(let i=0;i!==t;++i)r[i]=i;return r.sort(e),r},sortedArray:function(n,e,t){let r=n.length,i=new n.constructor(r);for(let s=0,o=0;o!==r;++s){let u=t[s]*e;for(let c=0;c!==e;++c)i[o++]=n[u+c]}return i},flattenJSON:function(n,e,t,r){let i=1,s=n[0];for(;s!==void 0&&s[r]===void 0;)s=n[i++];if(s===void 0)return;let o=s[r];if(o!==void 0)if(Array.isArray(o))do o=s[r],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[i++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[r],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[i++];while(s!==void 0);else do o=s[r],o!==void 0&&(e.push(s.time),t.push(o)),s=n[i++];while(s!==void 0)},subclip:function(n,e,t,r,i=30){let s=n.clone();s.name=e;let o=[];for(let c=0;c=r)){p.push(f.times[g]);for(let y=0;ys.tracks[c].times[0]&&(u=s.tracks[c].times[0]);for(let c=0;c=u.times[x]){let S=x*p+d,w=S+p-d;y=Ut.arraySlice(u.values,S,w)}else{let S=u.createInterpolant(),w=d,E=p-d;S.evaluate(s),y=Ut.arraySlice(S.resultBuffer,w,E)}c==="quaternion"&&new on().fromArray(y).normalize().conjugate().toArray(y);let _=f.times.length;for(let S=0;S<_;++S){let w=S*g+m;if(c==="quaternion")on.multiplyQuaternionsFlat(f.values,w,y,0,f.values,w);else{let E=g-m*2;for(let T=0;T=s)){let u=t[1];e=s)break t}o=r,r=0;break n}break e}for(;r>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let u=this.getValueSize();this.times=Ut.arraySlice(r,s,o),this.values=Ut.arraySlice(this.values,s*u,o*u)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let r=this.times,i=this.values,s=r.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let u=0;u!==s;u++){let c=r[u];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,u,c),e=!1;break}if(o!==null&&o>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,u,c,o),e=!1;break}o=c}if(i!==void 0&&Ut.isTypedArray(i))for(let u=0,c=i.length;u!==c;++u){let f=i[u];if(isNaN(f)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,u,f),e=!1;break}}return e}optimize(){let e=Ut.arraySlice(this.times),t=Ut.arraySlice(this.values),r=this.getValueSize(),i=this.getInterpolation()===og,s=e.length-1,o=1;for(let u=1;u0){e[o]=e[s];for(let u=s*r,c=o*r,f=0;f!==r;++f)t[c+f]=t[u+f];++o}return o!==e.length?(this.times=Ut.arraySlice(e,0,o),this.values=Ut.arraySlice(t,0,o*r)):(this.times=e,this.values=t),this}clone(){let e=Ut.arraySlice(this.times,0),t=Ut.arraySlice(this.values,0),r=this.constructor,i=new r(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}};jr.prototype.TimeBufferType=Float32Array;jr.prototype.ValueBufferType=Float32Array;jr.prototype.DefaultInterpolation=$f;var Zs=class extends jr{};Zs.prototype.ValueTypeName="bool";Zs.prototype.ValueBufferType=Array;Zs.prototype.DefaultInterpolation=Kf;Zs.prototype.InterpolantFactoryMethodLinear=void 0;Zs.prototype.InterpolantFactoryMethodSmooth=void 0;var Cd=class extends jr{};Cd.prototype.ValueTypeName="color";var yl=class extends jr{};yl.prototype.ValueTypeName="number";var Ig=class extends Vi{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e,t,r,i){let s=this.resultBuffer,o=this.sampleValues,u=this.valueSize,c=(r-t)/(i-t),f=e*u;for(let d=f+u;f!==d;f+=4)on.slerpFlat(s,0,o,f-u,o,f,c);return s}},ta=class extends jr{InterpolantFactoryMethodLinear(e){return new Ig(this.times,this.values,this.getValueSize(),e)}};ta.prototype.ValueTypeName="quaternion";ta.prototype.DefaultInterpolation=$f;ta.prototype.InterpolantFactoryMethodSmooth=void 0;var Qs=class extends jr{};Qs.prototype.ValueTypeName="string";Qs.prototype.ValueBufferType=Array;Qs.prototype.DefaultInterpolation=Kf;Qs.prototype.InterpolantFactoryMethodLinear=void 0;Qs.prototype.InterpolantFactoryMethodSmooth=void 0;var xl=class extends jr{};xl.prototype.ValueTypeName="vector";var _l=class{constructor(e,t=-1,r,i=a0){this.name=e,this.tracks=r,this.duration=t,this.blendMode=i,this.uuid=Gr(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],r=e.tracks,i=1/(e.fps||1);for(let o=0,u=r.length;o!==u;++o)t.push(M4(r[o]).scale(i));let s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){let t=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=r.length;s!==o;++s)t.push(jr.toJSON(r[s]));return i}static CreateFromMorphTargetSequence(e,t,r,i){let s=t.length,o=[];for(let u=0;u1){let p=d[1],m=i[p];m||(i[p]=m=[]),m.push(f)}}let o=[];for(let u in i)o.push(this.CreateFromMorphTargetSequence(u,i[u],t,r));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let r=function(p,m,g,x,y){if(g.length!==0){let _=[],S=[];Ut.flattenJSON(g,_,S,x),_.length!==0&&y.push(new p(m,_,S))}},i=[],s=e.name||"default",o=e.fps||30,u=e.blendMode,c=e.length||-1,f=e.hierarchy||[];for(let p=0;p{t&&t(s),this.manager.itemEnd(e)},0),s;if(Fs[e]!==void 0){Fs[e].push({onLoad:t,onProgress:r,onError:i});return}Fs[e]=[],Fs[e].push({onLoad:t,onProgress:r,onError:i});let o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),u=this.mimeType,c=this.responseType;fetch(o).then(f=>{if(f.status===200||f.status===0){if(f.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||f.body===void 0||f.body.getReader===void 0)return f;let d=Fs[e],p=f.body.getReader(),m=f.headers.get("Content-Length"),g=m?parseInt(m):0,x=g!==0,y=0,_=new ReadableStream({start(S){w();function w(){p.read().then(({done:E,value:T})=>{if(E)S.close();else{y+=T.byteLength;let C=new ProgressEvent("progress",{lengthComputable:x,loaded:y,total:g});for(let P=0,D=d.length;P{switch(c){case"arraybuffer":return f.arrayBuffer();case"blob":return f.blob();case"document":return f.text().then(d=>new DOMParser().parseFromString(d,u));case"json":return f.json();default:if(u===void 0)return f.text();{let p=/charset="?([^;"\s]*)"?/i.exec(u),m=p&&p[1]?p[1].toLowerCase():void 0,g=new TextDecoder(m);return f.arrayBuffer().then(x=>g.decode(x))}}}).then(f=>{wl.add(e,f);let d=Fs[e];delete Fs[e];for(let p=0,m=d.length;p{let d=Fs[e];if(d===void 0)throw this.manager.itemError(e),f;delete Fs[e];for(let p=0,m=d.length;p{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}},f1=class extends Bn{constructor(e){super(e)}load(e,t,r,i){let s=this,o=new _i(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(u){try{t(s.parse(JSON.parse(u)))}catch(c){i?i(c):console.error(c),s.manager.itemError(e)}},r,i)}parse(e){let t=[];for(let r=0;r0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(let s in e.uniforms){let o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=r(o.value);break;case"c":i.uniforms[s].value=new we().setHex(o.value);break;case"v2":i.uniforms[s].value=new oe().fromArray(o.value);break;case"v3":i.uniforms[s].value=new R().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Tt().fromArray(o.value);break;case"m3":i.uniforms[s].value=new mn().fromArray(o.value);break;case"m4":i.uniforms[s].value=new Ne().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(let s in e.extensions)i.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=r(e.map)),e.matcap!==void 0&&(i.matcap=r(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=r(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=r(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=r(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new oe().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=r(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=r(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=r(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=r(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=r(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=r(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=r(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=r(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=r(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=r(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=r(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=r(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=r(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new oe().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=r(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=r(e.thicknessMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=r(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=r(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}},cc=class{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let r=0,i=e.length;r0){let c=new Ad(t);s=new Sl(c),s.setCrossOrigin(this.crossOrigin);for(let f=0,d=e.length;f0){i=new Sl(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,u=e.length;o"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let s=this,o=wl.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;let u={};u.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",u.headers=this.requestHeader,fetch(e,u).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(c){wl.add(e,c),t&&t(c),s.manager.itemEnd(e)}).catch(function(c){i&&i(c),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}};Vg.prototype.isImageBitmapLoader=!0;var Zm,vw={getContext:function(){return Zm===void 0&&(Zm=new(window.AudioContext||window.webkitAudioContext)),Zm},setContext:function(n){Zm=n}},Gg=class extends Bn{constructor(e){super(e)}load(e,t,r,i){let s=this,o=new _i(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(u){try{let c=u.slice(0);vw.getContext().decodeAudioData(c,function(d){t(d)})}catch(c){i?i(c):console.error(c),s.manager.itemError(e)}},r,i)}},Wg=class extends Ml{constructor(e,t,r=1){super(void 0,r);let i=new we().set(e),s=new we().set(t),o=new R(i.r,i.g,i.b),u=new R(s.r,s.g,s.b),c=Math.sqrt(Math.PI),f=c*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(u).multiplyScalar(c),this.sh.coefficients[1].copy(o).sub(u).multiplyScalar(f)}};Wg.prototype.isHemisphereLightProbe=!0;var jg=class extends Ml{constructor(e,t=1){super(void 0,t);let r=new we().set(e);this.sh.coefficients[0].set(r.r,r.g,r.b).multiplyScalar(2*Math.sqrt(Math.PI))}};jg.prototype.isAmbientLightProbe=!0;var A3=new Ne,P3=new Ne,Fa=new Ne,p1=class{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Lt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Lt,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(e){let t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Fa.copy(e.projectionMatrix);let i=t.eyeSep/2,s=i*t.near/t.focus,o=t.near*Math.tan(Qa*t.fov*.5)/t.zoom,u,c;P3.elements[12]=-i,A3.elements[12]=i,u=-o*t.aspect+s,c=o*t.aspect+s,Fa.elements[0]=2*t.near/(c-u),Fa.elements[8]=(c+u)/(c-u),this.cameraL.projectionMatrix.copy(Fa),u=-o*t.aspect-s,c=o*t.aspect-s,Fa.elements[0]=2*t.near/(c-u),Fa.elements[8]=(c+u)/(c-u),this.cameraR.projectionMatrix.copy(Fa)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(P3),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(A3)}},fc=class{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=R3(),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 e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let t=R3();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}};function R3(){return(typeof performance>"u"?Date:performance).now()}var Oa=new R,L3=new on,T4=new R,Ba=new R,m1=class extends st{constructor(){super(),this.type="AudioListener",this.context=vw.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new fc}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(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);let t=this.context.listener,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Oa,L3,T4),Ba.set(0,0,-1).applyQuaternion(L3),t.positionX){let i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Oa.x,i),t.positionY.linearRampToValueAtTime(Oa.y,i),t.positionZ.linearRampToValueAtTime(Oa.z,i),t.forwardX.linearRampToValueAtTime(Ba.x,i),t.forwardY.linearRampToValueAtTime(Ba.y,i),t.forwardZ.linearRampToValueAtTime(Ba.z,i),t.upX.linearRampToValueAtTime(r.x,i),t.upY.linearRampToValueAtTime(r.y,i),t.upZ.linearRampToValueAtTime(r.z,i)}else t.setPosition(Oa.x,Oa.y,Oa.z),t.setOrientation(Ba.x,Ba.y,Ba.z,r.x,r.y,r.z)}},Od=class extends st{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.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(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=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+e;let t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,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.stop(),this.source.onended=null,this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(r,i,this._addIndex*t,1,t);for(let c=t,f=t+t;c!==f;++c)if(r[c]!==r[c+t]){u.setValue(r,i);break}}saveOriginalState(){let e=this.binding,t=this.buffer,r=this.valueSize,i=r*this._origIndex;e.getValue(t,i);for(let s=r,o=i;s!==o;++s)t[s]=t[i+s%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let r=e;r=.5)for(let o=0;o!==s;++o)e[t+o]=e[r+o]}_slerp(e,t,r,i){on.slerpFlat(e,t,e,t,e,r,i)}_slerpAdditive(e,t,r,i,s){let o=this._workIndex*s;on.multiplyQuaternionsFlat(e,o,e,t,e,r),on.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,r,i,s){let o=1-i;for(let u=0;u!==s;++u){let c=t+u;e[c]=e[c]*o+e[r+u]*i}}_lerpAdditive(e,t,r,i,s){for(let o=0;o!==s;++o){let u=t+o;e[u]=e[u]+e[r+o]*i}}},yw="\\[\\]\\.:\\/",C4=new RegExp("["+yw+"]","g"),xw="[^"+yw+"]",A4="[^"+yw.replace("\\.","")+"]",P4=/((?:WC+[\/:])*)/.source.replace("WC",xw),R4=/(WCOD+)?/.source.replace("WCOD",A4),L4=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",xw),D4=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",xw),I4=new RegExp("^"+P4+R4+L4+D4+"$"),N4=["material","materials","bones"],v1=class{constructor(e,t,r){let i=r||yt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,t)}setValue(e,t){let r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=r.length;i!==s;++i)r[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}},yt=class{constructor(e,t,r){this.path=t,this.parsedPath=r||yt.parseTrackName(t),this.node=yt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new yt.Composite(e,t,r):new yt(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(C4,"")}static parseTrackName(e){let t=I4.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=r.nodeName.substring(i+1);N4.indexOf(s)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=s)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let r=e.skeleton.getBoneByName(t);if(r!==void 0)return r}if(e.children){let r=function(s){for(let o=0;o=s){let p=s++,m=e[p];t[m.uuid]=d,e[d]=m,t[f]=p,e[p]=c;for(let g=0,x=i;g!==x;++g){let y=r[g],_=y[p],S=y[d];y[d]=_,y[p]=S}}}this.nCachedObjects_=s}uncache(){let e=this._objects,t=this._indicesByUUID,r=this._bindings,i=r.length,s=this.nCachedObjects_,o=e.length;for(let u=0,c=arguments.length;u!==c;++u){let f=arguments[u],d=f.uuid,p=t[d];if(p!==void 0)if(delete t[d],p0&&(t[g.uuid]=p),e[p]=g,e.pop();for(let x=0,y=i;x!==y;++x){let _=r[x];_[p]=_[m],_.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){let r=this._bindingsIndicesByPath,i=r[e],s=this._bindings;if(i!==void 0)return s[i];let o=this._paths,u=this._parsedPaths,c=this._objects,f=c.length,d=this.nCachedObjects_,p=new Array(f);i=s.length,r[e]=i,o.push(e),u.push(t),s.push(p);for(let m=d,g=c.length;m!==g;++m){let x=c[m];p[m]=new yt(x,e,t)}return p}unsubscribe_(e){let t=this._bindingsIndicesByPath,r=t[e];if(r!==void 0){let i=this._paths,s=this._parsedPaths,o=this._bindings,u=o.length-1,c=o[u],f=e[u];t[f]=r,o[r]=c,o.pop(),s[r]=s[u],s.pop(),i[r]=i[u],i.pop()}}};Yg.prototype.isAnimationObjectGroup=!0;var y1=class{constructor(e,t,r=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=r,this.blendMode=i;let s=t.tracks,o=s.length,u=new Array(o),c={endingStart:ja,endingEnd:ja};for(let f=0;f!==o;++f){let d=s[f].createInterpolant(null);u[f]=d,d.settings=c}this._interpolantSettings=c,this._interpolants=u,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=IC,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(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,r){if(e.fadeOut(t),this.fadeIn(t),r){let i=this._clip.duration,s=e._clip.duration,o=s/i,u=i/s;e.warp(1,o,t),this.warp(u,1,t)}return this}crossFadeTo(e,t,r){return e.crossFadeFrom(this,t,r)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,r){let i=this._mixer,s=i.time,o=this.timeScale,u=this._timeScaleInterpolant;u===null&&(u=i._lendControlInterpolant(),this._timeScaleInterpolant=u);let c=u.parameterPositions,f=u.sampleValues;return c[0]=s,c[1]=s+r,f[0]=e/o,f[1]=t/o,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,r,i){if(!this.enabled){this._updateWeight(e);return}let s=this._startTime;if(s!==null){let c=(e-s)*r;if(c<0||r===0)return;this._startTime=null,t=r*c}t*=this._updateTimeScale(e);let o=this._updateTime(t),u=this._updateWeight(e);if(u>0){let c=this._interpolants,f=this._propertyBindings;switch(this.blendMode){case dw:for(let d=0,p=c.length;d!==p;++d)c[d].evaluate(o),f[d].accumulateAdditive(u);break;case a0:default:for(let d=0,p=c.length;d!==p;++d)c[d].evaluate(o),f[d].accumulate(i,u)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let r=this._weightInterpolant;if(r!==null){let i=r.evaluate(e)[0];t*=i,e>r.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let r=this._timeScaleInterpolant;if(r!==null){let i=r.evaluate(e)[0];t*=i,e>r.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,r=this.loop,i=this.time+e,s=this._loopCount,o=r===NC;if(e===0)return s===-1?i:o&&(s&1)===1?t-i:i;if(r===DC){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){let u=Math.floor(i/t);i-=t*u,s+=Math.abs(u);let c=this.repetitions-s;if(c<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(c===1){let f=e<0;this._setEndings(f,!f,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:u})}}else this.time=i;if(o&&(s&1)===1)return t-i}return i}_setEndings(e,t,r){let i=this._interpolantSettings;r?(i.endingStart=Xa,i.endingEnd=Xa):(e?i.endingStart=this.zeroSlopeAtStart?Xa:ja:i.endingStart=ed,t?i.endingEnd=this.zeroSlopeAtEnd?Xa:ja:i.endingEnd=ed)}_scheduleFading(e,t,r){let i=this._mixer,s=i.time,o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);let u=o.parameterPositions,c=o.sampleValues;return u[0]=s,c[0]=t,u[1]=s+e,c[1]=r,this}},Zg=class extends yi{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let r=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,u=e._interpolants,c=r.uuid,f=this._bindingsByRootAndName,d=f[c];d===void 0&&(d={},f[c]=d);for(let p=0;p!==s;++p){let m=i[p],g=m.name,x=d[g];if(x!==void 0)++x.referenceCount,o[p]=x;else{if(x=o[p],x!==void 0){x._cacheIndex===null&&(++x.referenceCount,this._addInactiveBinding(x,c,g));continue}let y=t&&t._propertyBindings[p].binding.parsedPath;x=new qg(yt.create(r,g,y),m.ValueTypeName,m.getValueSize()),++x.referenceCount,this._addInactiveBinding(x,c,g),o[p]=x}u[p].resultBuffer=x.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let r=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,r)}let t=e._propertyBindings;for(let r=0,i=t.length;r!==i;++r){let s=t[r];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let r=0,i=t.length;r!==i;++r){let s=t[r];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;let t=this._actions,r=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let f=0;f!==r;++f)t[f]._update(i,e,s,o);let u=this._bindings,c=this._nActiveBindings;for(let f=0;f!==c;++f)u[f].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return N3.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};na.prototype.isBox2=!0;var z3=new R,Qm=new R,Kg=class{constructor(e=new R,t=new R){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){z3.subVectors(e,this.start),Qm.subVectors(this.end,this.start);let r=Qm.dot(Qm),s=Qm.dot(z3)/r;return t&&(s=pn(s,0,1)),s}closestPointToPoint(e,t,r){let i=this.closestPointToPointParameter(e,t);return this.delta(r).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},k3=new R,w1=class extends st{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;let r=new We,i=[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 o=0,u=1,c=32;o.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{H3.set(e.z,0,-e.x).normalize();let t=Math.acos(e.y);this.quaternion.setFromAxisAngle(H3,t)}}setLength(e,t=e*.2,r=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(r,t,r),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}},n0=class extends $n{constructor(e=1){let t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new We;i.setAttribute("position",new De(t,3)),i.setAttribute("color",new De(r,3));let s=new wn({vertexColors:!0,toneMapped:!1});super(i,s),this.type="AxesHelper"}setColors(e,t,r){let i=new we,s=this.geometry.attributes.color.array;return i.set(e),i.toArray(s,0),i.toArray(s,3),i.set(t),i.toArray(s,6),i.toArray(s,9),i.set(r),i.toArray(s,12),i.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},R1=class{constructor(){this.type="ShapePath",this.color=new we,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Qo,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,r,i){return this.currentPath.quadraticCurveTo(e,t,r,i),this}bezierCurveTo(e,t,r,i,s,o){return this.currentPath.bezierCurveTo(e,t,r,i,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function r(w){let E=[];for(let T=0,C=w.length;TNumber.EPSILON){if(A<0&&(I=E[D],B=-B,G=E[P],A=-A),w.yG.y)continue;if(w.y===I.y){if(w.x===I.x)return!0}else{let F=A*(w.x-I.x)-B*(w.y-I.y);if(F===0)return!0;if(F<0)continue;C=!C}}else{if(w.y!==I.y)continue;if(G.x<=w.x&&w.x<=I.x||I.x<=w.x&&w.x<=G.x)return!0}}return C}let s=gi.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return r(o);let u,c,f,d=[];if(o.length===1)return c=o[0],f=new mi,f.curves=c.curves,d.push(f),d;let p=!s(o[0].getPoints());p=e?!p:p;let m=[],g=[],x=[],y=0,_;g[y]=void 0,x[y]=[];for(let w=0,E=o.length;w1){let w=!1,E=0;for(let T=0,C=g.length;T0&&w===!1&&(x=m)}let S;for(let w=0,E=g.length;w65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=pn(e,-65504,65504),V3[0]=e;let t=G3[0],r=t>>23&511;return ki[r]+((t&8388607)>>Fi[r])}static fromHalfFloat(e){let t=e>>10;return G3[0]=_w[lA[t]+(e&1023)]+gc[t],V3[0]}},aA=new ArrayBuffer(4),V3=new Float32Array(aA),G3=new Uint32Array(aA),ki=new Uint32Array(512),Fi=new Uint32Array(512);for(let n=0;n<256;++n){let e=n-127;e<-27?(ki[n]=0,ki[n|256]=32768,Fi[n]=24,Fi[n|256]=24):e<-14?(ki[n]=1024>>-e-14,ki[n|256]=1024>>-e-14|32768,Fi[n]=-e-1,Fi[n|256]=-e-1):e<=15?(ki[n]=e+15<<10,ki[n|256]=e+15<<10|32768,Fi[n]=13,Fi[n|256]=13):e<128?(ki[n]=31744,ki[n|256]=64512,Fi[n]=24,Fi[n|256]=24):(ki[n]=31744,ki[n|256]=64512,Fi[n]=13,Fi[n|256]=13)}var _w=new Uint32Array(2048),gc=new Uint32Array(64),lA=new Uint32Array(64);for(let n=1;n<1024;++n){let e=n<<13,t=0;for(;(e&8388608)===0;)e<<=1,t-=8388608;e&=-8388609,t+=947912704,_w[n]=e|t}for(let n=1024;n<2048;++n)_w[n]=939524096+(n-1024<<13);for(let n=1;n<31;++n)gc[n]=n<<23;gc[31]=1199570944;gc[32]=2147483648;for(let n=33;n<63;++n)gc[n]=2147483648+(n-32<<23);gc[63]=3347054592;for(let n=1;n<64;++n)n!==32&&(lA[n]=1024);var k4=0,F4=1,O4=0,B4=1,c0=2;function U4(n){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),n}function H4(n=[]){return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),n.isMultiMaterial=!0,n.materials=n,n.clone=function(){return n.slice()},n}var D1=class extends sl{constructor(e,t){console.warn("THREE.PointCloud has been renamed to THREE.Points."),super(e,t)}},I1=class extends tc{constructor(e){console.warn("THREE.Particle has been renamed to THREE.Sprite."),super(e)}},N1=class extends sl{constructor(e,t){console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),super(e,t)}},z1=class extends Xs{constructor(e){console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),super(e)}},k1=class extends Xs{constructor(e){console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),super(e)}},F1=class extends Xs{constructor(e){console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),super(e)}},O1=class extends R{constructor(e,t,r){console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),super(e,t,r)}},B1=class extends mt{constructor(e,t){console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),super(e,t),this.setUsage(Xu)}},U1=class extends vg{constructor(e,t){console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),super(e,t)}},H1=class extends yg{constructor(e,t){console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),super(e,t)}},V1=class extends xg{constructor(e,t){console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),super(e,t)}},G1=class extends _g{constructor(e,t){console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),super(e,t)}},W1=class extends qu{constructor(e,t){console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),super(e,t)}},j1=class extends wg{constructor(e,t){console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),super(e,t)}},X1=class extends Yu{constructor(e,t){console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),super(e,t)}},q1=class extends De{constructor(e,t){console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),super(e,t)}},Y1=class extends Mg{constructor(e,t){console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),super(e,t)}};fr.create=function(n,e){return console.log("THREE.Curve.create() has been deprecated"),n.prototype=Object.create(fr.prototype),n.prototype.constructor=n,n.prototype.getPoint=e,n};Qo.prototype.fromPoints=function(n){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(n)};var Z1=class extends n0{constructor(e){console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),super(e)}},Q1=class extends t0{constructor(e,t){console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),super(e,t)}},J1=class extends $n{constructor(e,t){console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),super(new dd(e.geometry),new wn({color:t!==void 0?t:16777215}))}};e0.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")};$g.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")};var K1=class extends $n{constructor(e,t){console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),super(new gd(e.geometry),new wn({color:t!==void 0?t:16777215}))}};Bn.prototype.extractUrlBase=function(n){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),cc.extractUrlBase(n)};Bn.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}};var $1=class extends _i{constructor(e){console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),super(e)}},ew=class extends zg{constructor(e){console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),super(e)}};na.prototype.center=function(n){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(n)};na.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()};na.prototype.isIntersectionBox=function(n){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)};na.prototype.size=function(n){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(n)};ur.prototype.center=function(n){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(n)};ur.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()};ur.prototype.isIntersectionBox=function(n){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)};ur.prototype.isIntersectionSphere=function(n){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(n)};ur.prototype.size=function(n){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(n)};ls.prototype.toVector3=function(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")};os.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()};nl.prototype.setFromMatrix=function(n){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(n)};Kg.prototype.center=function(n){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(n)};mn.prototype.flattenToArrayOffset=function(n,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(n,e)};mn.prototype.multiplyVector3=function(n){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),n.applyMatrix3(this)};mn.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")};mn.prototype.applyToBufferAttribute=function(n){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),n.applyMatrix3(this)};mn.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")};mn.prototype.getInverse=function(n){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(n).invert()};Ne.prototype.extractPosition=function(n){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(n)};Ne.prototype.flattenToArrayOffset=function(n,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(n,e)};Ne.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),new R().setFromMatrixColumn(this,3)};Ne.prototype.setRotationFromQuaternion=function(n){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(n)};Ne.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")};Ne.prototype.multiplyVector3=function(n){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)};Ne.prototype.multiplyVector4=function(n){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)};Ne.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")};Ne.prototype.rotateAxis=function(n){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),n.transformDirection(this)};Ne.prototype.crossVector=function(n){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)};Ne.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")};Ne.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")};Ne.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")};Ne.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")};Ne.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")};Ne.prototype.applyToBufferAttribute=function(n){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)};Ne.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")};Ne.prototype.makeFrustum=function(n,e,t,r,i,s){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(n,e,r,t,i,s)};Ne.prototype.getInverse=function(n){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(n).invert()};hi.prototype.isIntersectionLine=function(n){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(n)};on.prototype.multiplyVector3=function(n){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),n.applyQuaternion(this)};on.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()};as.prototype.isIntersectionBox=function(n){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)};as.prototype.isIntersectionPlane=function(n){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(n)};as.prototype.isIntersectionSphere=function(n){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(n)};Jt.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()};Jt.prototype.barycoordFromPoint=function(n,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(n,e)};Jt.prototype.midpoint=function(n){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(n)};Jt.prototypenormal=function(n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(n)};Jt.prototype.plane=function(n){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(n)};Jt.barycoordFromPoint=function(n,e,t,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Jt.getBarycoord(n,e,t,r,i)};Jt.normal=function(n,e,t,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Jt.getNormal(n,e,t,r)};mi.prototype.extractAllPoints=function(n){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(n)};mi.prototype.extrude=function(n){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Hi(this,n)};mi.prototype.makeGeometry=function(n){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new ea(this,n)};oe.prototype.fromAttribute=function(n,e,t){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,e,t)};oe.prototype.distanceToManhattan=function(n){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(n)};oe.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};R.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")};R.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")};R.prototype.getPositionFromMatrix=function(n){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(n)};R.prototype.getScaleFromMatrix=function(n){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(n)};R.prototype.getColumnFromMatrix=function(n,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,n)};R.prototype.applyProjection=function(n){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(n)};R.prototype.fromAttribute=function(n,e,t){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,e,t)};R.prototype.distanceToManhattan=function(n){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(n)};R.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};Tt.prototype.fromAttribute=function(n,e,t){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,e,t)};Tt.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};st.prototype.getChildByName=function(n){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(n)};st.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")};st.prototype.translate=function(n,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,n)};st.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")};st.prototype.applyMatrix=function(n){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(n)};Object.defineProperties(st.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(n){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=n}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}});sn.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")};Object.defineProperties(sn.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),zC},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}});nc.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")};Lt.prototype.setLens=function(n,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),e!==void 0&&(this.filmGauge=e),this.setFocalLength(n)};Object.defineProperties(Xr.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(n){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=n}},shadowCameraLeft:{set:function(n){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=n}},shadowCameraRight:{set:function(n){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=n}},shadowCameraTop:{set:function(n){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=n}},shadowCameraBottom:{set:function(n){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=n}},shadowCameraNear:{set:function(n){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=n}},shadowCameraFar:{set:function(n){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=n}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(n){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=n}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(n){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=n}},shadowMapHeight:{set:function(n){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=n}}});Object.defineProperties(mt.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===Xu},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Xu)}}});mt.prototype.setDynamic=function(n){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(n===!0?Xu:ju),this};mt.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},mt.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")};We.prototype.addIndex=function(n){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(n)};We.prototype.addAttribute=function(n,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),!(e&&e.isBufferAttribute)&&!(e&&e.isInterleavedBufferAttribute)?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(n,new mt(arguments[1],arguments[2]))):n==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(n,e)};We.prototype.addDrawCall=function(n,e,t){t!==void 0&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(n,e)};We.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()};We.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")};We.prototype.removeAttribute=function(n){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(n)};We.prototype.applyMatrix=function(n){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(n)};Object.defineProperties(We.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}});Ws.prototype.setDynamic=function(n){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(n===!0?Xu:ju),this};Ws.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")};Hi.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")};Hi.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")};Hi.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")};Zo.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")};dc.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this};Object.defineProperties($t.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new we}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(n){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===lw}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(n){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=n}},vertexTangents:{get:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")},set:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")}}});Object.defineProperties(br.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(n){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=n}}});At.prototype.clearTarget=function(n,e,t,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(n),this.clear(e,t,r)};At.prototype.animate=function(n){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(n)};At.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()};At.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()};At.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision};At.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()};At.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")};At.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")};At.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")};At.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")};At.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")};At.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")};At.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures};At.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")};At.prototype.enableScissorTest=function(n){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(n)};At.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};At.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};At.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};At.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};At.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")};At.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")};At.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")};At.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")};At.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")};At.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()};Object.defineProperties(At.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(n){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=n}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(n){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=n}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(n){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=n===!0?Dt:vi}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}},gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});Object.defineProperties($C.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}});var tw=class extends Ju{constructor(e,t,r){console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),super(e,r)}};Object.defineProperties(On.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(n){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=n}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(n){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=n}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(n){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=n}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(n){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=n}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(n){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=n}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(n){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=n}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(n){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=n}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(n){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=n}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(n){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=n}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(n){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=n}}});Od.prototype.load=function(n){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");let e=this;return new Gg().load(n,function(r){e.setBuffer(r)}),this};Xg.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()};Qu.prototype.updateCubeMap=function(n,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(n,e)};Qu.prototype.clear=function(n,e,t,r){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(n,e,t,r)};ss.crossOrigin=void 0;ss.loadTexture=function(n,e,t,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");let i=new kg;i.setCrossOrigin(this.crossOrigin);let s=i.load(n,t,void 0,r);return e&&(s.mapping=e),s};ss.loadTextureCube=function(n,e,t,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");let i=new Ng;i.setCrossOrigin(this.crossOrigin);let s=i.load(n,t,void 0,r);return e&&(s.mapping=e),s};ss.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")};ss.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};function V4(){console.error("THREE.CanvasRenderer has been removed")}function G4(){console.error("THREE.JSONLoader has been removed.")}var W4={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};function j4(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")}var nw=class extends We{constructor(){console.error("THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js"),super()}},rw=class extends We{constructor(){console.error("THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js"),super()}};function X4(){console.error("THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js")}function q4(){console.error("THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js")}function Y4(){console.error("THREE.ImmediateRenderObject has been removed.")}var iw=class extends On{constructor(e,t,r){console.error('THREE.WebGLMultisampleRenderTarget has been removed. Use a normal render target and set the "samples" property to greater 0 to enable multisampling.'),super(e,t,r),this.samples=4}},sw=class extends Xo{constructor(e,t,r,i){console.warn("THREE.DataTexture2DArray has been renamed to DataArrayTexture."),super(e,t,r,i)}},ow=class extends tl{constructor(e,t,r,i){console.warn("THREE.DataTexture3D has been renamed to Data3DTexture."),super(e,t,r,i)}};typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:r0}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=r0);var an=Pn(Dr()),Ks=Pn(ww());var dr=Pn(Dr(),1);function Z4(n){let e,t=new Set,r=(f,d)=>{let p=typeof f=="function"?f(e):f;if(p!==e){let m=e;e=d?p:Object.assign({},e,p),t.forEach(g=>g(e,m))}},i=()=>e,s=(f,d=i,p=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let m=d(e);function g(){let x=d(e);if(!p(m,x)){let y=m;f(m=x,y)}}return t.add(g),()=>t.delete(g)},c={setState:r,getState:i,subscribe:(f,d,p)=>d||p?s(f,d,p):(t.add(f),()=>t.delete(f)),destroy:()=>t.clear()};return e=n(r,i,c),c}var Q4=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),fA=Q4?dr.useEffect:dr.useLayoutEffect;function dA(n){let e=typeof n=="function"?Z4(n):n,t=(r=e.getState,i=Object.is)=>{let[,s]=(0,dr.useReducer)(_=>_+1,0),o=e.getState(),u=(0,dr.useRef)(o),c=(0,dr.useRef)(r),f=(0,dr.useRef)(i),d=(0,dr.useRef)(!1),p=(0,dr.useRef)();p.current===void 0&&(p.current=r(o));let m,g=!1;(u.current!==o||c.current!==r||f.current!==i||d.current)&&(m=r(o),g=!i(p.current,m)),fA(()=>{g&&(p.current=m),u.current=o,c.current=r,f.current=i,d.current=!1});let x=(0,dr.useRef)(o);fA(()=>{let _=()=>{try{let w=e.getState(),E=c.current(w);f.current(p.current,E)||(u.current=w,p.current=E,s())}catch{d.current=!0,s()}},S=e.subscribe(_);return e.getState()!==x.current&&_(),S},[]);let y=g?m:p.current;return(0,dr.useDebugValue)(y),y};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");let r=[t,e];return{next(){let i=r.length<=0;return{value:r.shift(),done:i}}}},t}var zA=Pn(Lw()),y0=Pn(v0());function CA(n,e,t=(r,i)=>r===i){if(n===e)return!0;if(!n||!e)return!1;let r=n.length;if(e.length!==r)return!1;for(let i=0;ii.response=s).then(()=>{r.lifespan&&r.lifespan>0&&setTimeout(()=>{let s=Js.indexOf(i);s!==-1&&Js.splice(s,1)},r.lifespan)}).catch(s=>i.error=s)};if(Js.push(i),!t)throw i.promise}var PA=(n,e,t)=>AA(n,e,!1,t),RA=(n,e,t)=>void AA(n,e,!0,t);var LA=n=>{if(n===void 0||n.length===0)Js.splice(0,Js.length);else{let e=Js.find(t=>CA(n,t.keys,t.equal));if(e){let t=Js.indexOf(e);t!==-1&&Js.splice(t,1)}}};var kA=n=>n&&n.isOrthographicCamera,K4=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),_c=K4?an.useEffect:an.useLayoutEffect;function Ww(n){let e=an.useRef(n);return _c(()=>void(e.current=n),[n]),e}function FA({set:n}){return _c(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}var qd=class extends an.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}};qd.getDerivedStateFromError=()=>({error:!0});var OA="__default",$4=n=>n&&!!n.memoized&&!!n.changes;function BA(n){return Array.isArray(n)?Math.min(Math.max(n[0],window.devicePixelRatio),n[1]):n}var jd=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()},jt={obj:n=>n===Object(n)&&!jt.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:r="reference",strict:i=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(jt.str(n)||jt.num(n))return n===e;let s=jt.obj(n);if(s&&r==="reference")return n===e;let o=jt.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let u;for(u in n)if(!(u in e))return!1;for(u in i?e:n)if(n[u]!==e[u])return!1;if(jt.und(u)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function eO(n){let e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function UA(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(let e in n)e.dispose==null||e.dispose(),delete n[e]}function yc(n,e){let t=n;return(e!=null&&e.primitive||!t.__r3f)&&(t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e}),n}function Uw(n,e){let t=n;if(e.includes("-")){let r=e.split("-"),i=r.pop();return t=r.reduce((s,o)=>s[o],n),{target:t,key:i}}else return{target:t,key:e}}var DA=/-\d+$/;function Dw(n,e,t){if(jt.str(t)){if(DA.test(t)){let s=t.replace(DA,""),{target:o,key:u}=Uw(n,s);Array.isArray(o[u])||(o[u]=[])}let{target:r,key:i}=Uw(n,t);e.__r3f.previousAttach=r[i],r[i]=e}else e.__r3f.previousAttach=t(n,e)}function IA(n,e,t){var r,i;if(jt.str(t)){let{target:s,key:o}=Uw(n,t);s[o]=e.__r3f.previousAttach}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(n,e);(i=e.__r3f)==null||delete i.previousAttach}function HA(n,{children:e,key:t,ref:r,...i},{children:s,key:o,ref:u,...c}={},f=!1){var d;let p=(d=n?.__r3f)!=null?d:{},m=Object.entries(i),g=[];if(f){let y=Object.keys(c);for(let _=0;_{var S;if((S=n.__r3f)!=null&&S.primitive&&y==="object"||jt.equ(_,c[y]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(y))return g.push([y,_,!0,[]]);let w=[];y.includes("-")&&(w=y.split("-")),g.push([y,_,!1,w])});let x={...i};return p.memoizedProps&&p.memoizedProps.args&&(x.args=p.memoizedProps.args),p.memoizedProps&&p.memoizedProps.attach&&(x.attach=p.memoizedProps.attach),{memoized:x,changes:g}}function Iw(n,e){var t,r;let i=(t=n?.__r3f)!=null?t:{},s=i.root,o=(r=s==null||s.getState==null?void 0:s.getState())!=null?r:{},{memoized:u,changes:c}=$4(e)?e:HA(n,e),f=i.eventCount;if(n.__r3f&&(n.__r3f.memoizedProps=u),c.forEach(([d,p,m,g])=>{let x=n,y=x[d];if(g.length&&(y=g.reduce((w,E)=>w[E],n),!(y&&y.set))){let[w,...E]=g.reverse();x=E.reverse().reduce((T,C)=>T[C],n),d=w}if(p===OA+"remove")if(y&&y.constructor){var _;p=new y.constructor(...(_=u.args)!=null?_:[])}else if(x.constructor){var S;let w=new x.constructor(...(S=x.__r3f.memoizedProps.args)!=null?S:[]);p=w[y],w.dispose&&w.dispose()}else p=0;if(m)p?i.handlers[d]=p:delete i.handlers[d],i.eventCount=Object.keys(i.handlers).length;else if(y&&y.set&&(y.copy||y instanceof us)){if(Array.isArray(p))y.fromArray?y.fromArray(p):y.set(...p);else if(y.copy&&p&&p.constructor&&y.constructor.name===p.constructor.name)y.copy(p);else if(p!==void 0){let w=y instanceof we;!w&&y.setScalar?y.setScalar(p):y instanceof us&&p instanceof us?y.mask=p.mask:y.set(p),!Jn&&!o.linear&&w&&y.convertSRGBToLinear()}}else x[d]=p,!o.linear&&x[d]instanceof Wt&&(x[d].encoding=Dt);xc(n)}),i.parent&&o.internal&&n.raycast&&f!==i.eventCount){let d=o.internal.interaction.indexOf(n);d>-1&&o.internal.interaction.splice(d,1),i.eventCount&&o.internal.interaction.push(n)}return c.length&&n.parent&&Hw(n),n}function xc(n){var e,t;let r=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();r&&r.internal.frames===0&&r.invalidate()}function Hw(n){n.onUpdate==null||n.onUpdate(n)}function tO(n,e){n.manual||(kA(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function Nw(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function nO(){var n,e;switch((n=window)==null||(e=n.event)==null?void 0:e.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Ks.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Ks.ContinuousEventPriority;default:return Ks.DefaultEventPriority}}function VA(n,e,t,r){let i=t.get(e);i&&(t.delete(e),t.size===0&&(n.delete(r),i.target.releasePointerCapture(r)))}function rO(n,e){let{events:t,internal:r}=n.getState();r.interaction=r.interaction.filter(i=>i!==e),r.initialHits=r.initialHits.filter(i=>i!==e),r.hovered.forEach((i,s)=>{(i.eventObject===e||i.object===e)&&r.hovered.delete(s)}),r.capturedMap.forEach((i,s)=>{VA(r.capturedMap,e,i,s)})}function GA(n){let e=new R;function t(f){let{internal:d}=n.getState(),p=f.offsetX-d.initialClick[0],m=f.offsetY-d.initialClick[1];return Math.round(Math.sqrt(p*p+m*m))}function r(f){return f.filter(d=>["Move","Over","Enter","Out","Leave"].some(p=>{var m;return(m=d.__r3f)==null?void 0:m.handlers["onPointer"+p]}))}function i(f,d){let p=n.getState(),m=new Set,g=[],x=d?d(p.internal.interaction):p.internal.interaction;x.forEach(S=>{let w=jd(S);w&&(w.raycaster.camera=void 0)}),p.previousRoot||p.events.compute==null||p.events.compute(f,p);let y=x.flatMap(S=>{let w=jd(S);if(!w||!w.events.enabled||w.raycaster.camera===null)return[];if(w.raycaster.camera===void 0){var E;w.events.compute==null||w.events.compute(f,w,(E=w.previousRoot)==null?void 0:E.getState()),w.raycaster.camera===void 0&&(w.raycaster.camera=null)}return w.raycaster.camera?w.raycaster.intersectObject(S,!0):[]}).sort((S,w)=>{let E=jd(S.object),T=jd(w.object);return!E||!T?0:T.events.priority-E.events.priority||S.distance-w.distance}).filter(S=>{let w=Nw(S);return m.has(w)?!1:(m.add(w),!0)});p.events.filter&&(y=p.events.filter(y,p));for(let S of y){let w=S.object;for(;w;){var _;(_=w.__r3f)!=null&&_.eventCount&&g.push({...S,eventObject:w}),w=w.parent}}if("pointerId"in f&&p.internal.capturedMap.has(f.pointerId))for(let S of p.internal.capturedMap.get(f.pointerId).values())g.push(S.intersection);return g}function s(f,d,p,m){let{raycaster:g,pointer:x,camera:y,internal:_}=n.getState();if(f.length){let S=e.set(x.x,x.y,0).unproject(y),w={stopped:!1};for(let E of f){let T=G=>{var B,A;return(B=(A=_.capturedMap.get(G))==null?void 0:A.has(E.eventObject))!=null?B:!1},C=G=>{let B={intersection:E,target:d.target};_.capturedMap.has(G)?_.capturedMap.get(G).set(E.eventObject,B):_.capturedMap.set(G,new Map([[E.eventObject,B]])),d.target.setPointerCapture(G)},P=G=>{let B=_.capturedMap.get(G);B&&VA(_.capturedMap,E.eventObject,B,G)},D={};for(let G in d){let B=d[G];typeof B!="function"&&(D[G]=B)}let I={...E,...D,pointer:x,intersections:f,stopped:w.stopped,delta:p,unprojectedPoint:S,ray:g.ray,camera:y,stopPropagation:()=>{let G="pointerId"in d&&_.capturedMap.get(d.pointerId);if((!G||G.has(E.eventObject))&&(I.stopped=w.stopped=!0,_.hovered.size&&Array.from(_.hovered.values()).find(B=>B.eventObject===E.eventObject))){let B=f.slice(0,f.indexOf(E));o([...B,E])}},target:{hasPointerCapture:T,setPointerCapture:C,releasePointerCapture:P},currentTarget:{hasPointerCapture:T,setPointerCapture:C,releasePointerCapture:P},nativeEvent:d};if(m(I),w.stopped===!0)break}}return f}function o(f){let{internal:d}=n.getState();Array.from(d.hovered.values()).forEach(p=>{if(!f.length||!f.find(m=>m.object===p.object&&m.index===p.index&&m.instanceId===p.instanceId)){let g=p.eventObject.__r3f,x=g?.handlers;if(d.hovered.delete(Nw(p)),g!=null&&g.eventCount){let y={...p,intersections:f||[]};x.onPointerOut==null||x.onPointerOut(y),x.onPointerLeave==null||x.onPointerLeave(y)}}})}let u=f=>{switch(f){case"onPointerLeave":case"onPointerCancel":return()=>o([]);case"onLostPointerCapture":return d=>{let{internal:p}=n.getState();"pointerId"in d&&!p.capturedMap.has(d.pointerId)&&(p.capturedMap.delete(d.pointerId),o([]))}}return d=>{let{onPointerMissed:p,internal:m}=n.getState();m.lastEvent.current=d;let g=f==="onPointerMove",x=f==="onClick"||f==="onContextMenu"||f==="onDoubleClick",_=i(d,g?r:void 0),S=x?t(d):0;f==="onPointerDown"&&(m.initialClick=[d.offsetX,d.offsetY],m.initialHits=_.map(w=>w.eventObject)),x&&!_.length&&S<=2&&(c(d,m.interaction),p&&p(d)),g&&o(_),s(_,d,S,w=>{let E=w.eventObject,T=E.__r3f,C=T?.handlers;if(!!(T!=null&&T.eventCount))if(g){if(C.onPointerOver||C.onPointerEnter||C.onPointerOut||C.onPointerLeave){let P=Nw(w),D=m.hovered.get(P);D?D.stopped&&w.stopPropagation():(m.hovered.set(P,w),C.onPointerOver==null||C.onPointerOver(w),C.onPointerEnter==null||C.onPointerEnter(w))}C.onPointerMove==null||C.onPointerMove(w)}else{let P=C[f];P?(!x||m.initialHits.includes(E))&&(c(d,m.interaction.filter(D=>!m.initialHits.includes(D))),P(w)):x&&m.initialHits.includes(E)&&c(d,m.interaction.filter(D=>!m.initialHits.includes(D)))}})}};function c(f,d){d.forEach(p=>{var m;return(m=p.__r3f)==null||m.handlers.onPointerMissed==null?void 0:m.handlers.onPointerMissed(f)})}return{handlePointer:u}}var Vw={},jw=n=>void(Vw={...Vw,...n});function iO(n,e){function t(f,{args:d=[],attach:p,...m},g){let x=`${f[0].toUpperCase()}${f.slice(1)}`,y;if(p===void 0&&(x.endsWith("Geometry")?p="geometry":x.endsWith("Material")&&(p="material")),f==="primitive"){if(m.object===void 0)throw"Primitives without 'object' are invalid!";let _=m.object;y=yc(_,{type:f,root:g,attach:p,primitive:!0})}else{let _=Vw[x];if(!_)throw`${x} is not part of the THREE namespace! Did you forget to extend? See: https://github.com/pmndrs/react-three-fiber/blob/master/markdown/api.md#using-3rd-party-objects-declaratively`;if(!Array.isArray(d))throw"The args prop must be an array!";y=yc(new _(...d),{type:f,root:g,attach:p,memoizedProps:{args:d}})}return x!=="inject"&&Iw(y,m),y}function r(f,d){let p=!1;if(d){var m,g;(m=d.__r3f)!=null&&m.attach?Dw(f,d,d.__r3f.attach):d.isObject3D&&f.isObject3D&&(f.add(d),p=!0),p||(g=f.__r3f)==null||g.objects.push(d),d.__r3f||yc(d,{}),d.__r3f.parent=f,Hw(d),xc(d)}}function i(f,d,p){let m=!1;if(d){var g,x;if((g=d.__r3f)!=null&&g.attach)Dw(f,d,d.__r3f.attach);else if(d.isObject3D&&f.isObject3D){d.parent=f,d.dispatchEvent({type:"added"});let y=f.children.filter(S=>S!==d),_=y.indexOf(p);f.children=[...y.slice(0,_),d,...y.slice(_)],m=!0}m||(x=f.__r3f)==null||x.objects.push(d),d.__r3f||yc(d,{}),d.__r3f.parent=f,Hw(d),xc(d)}}function s(f,d,p=!1){f&&[...f].forEach(m=>o(d,m,p))}function o(f,d,p){if(d){var m,g,x;if(d.__r3f&&(d.__r3f.parent=null),(m=f.__r3f)!=null&&m.objects&&(f.__r3f.objects=f.__r3f.objects.filter(E=>E!==d)),(g=d.__r3f)!=null&&g.attach)IA(f,d,d.__r3f.attach);else if(d.isObject3D&&f.isObject3D){var y;f.remove(d),(y=d.__r3f)!=null&&y.root&&rO(d.__r3f.root,d)}let S=(x=d.__r3f)==null?void 0:x.primitive,w=p===void 0?d.dispose!==null&&!S:p;if(!S){var _;s((_=d.__r3f)==null?void 0:_.objects,d,w),s(d.children,d,w)}d.__r3f&&(delete d.__r3f.root,delete d.__r3f.objects,delete d.__r3f.handlers,delete d.__r3f.memoizedProps,S||delete d.__r3f),w&&d.dispose&&d.type!=="Scene"&&(0,y0.unstable_scheduleCallback)(y0.unstable_IdlePriority,()=>{try{d.dispose()}catch{}}),xc(f)}}function u(f,d,p,m){var g,x;let y=(g=f.__r3f)==null?void 0:g.parent;if(!y)return;let _=t(d,p,(x=f.__r3f)==null?void 0:x.root);d!=="primitive"&&f.children&&(f.children.forEach(S=>r(_,S)),f.children=[]),f.__r3f.objects.forEach(S=>r(_,S)),f.__r3f.objects=[],o(y,f),r(y,_),_.raycast&&_.__r3f.eventCount&&_.__r3f.root.getState().internal.interaction.push(_),[m,m.alternate].forEach(S=>{S!==null&&(S.stateNode=_,S.ref&&(typeof S.ref=="function"?S.ref(_):S.ref.current=_))})}return{reconciler:(0,zA.default)({createInstance:t,removeChild:o,appendChild:r,appendInitialChild:r,insertBefore:i,supportsMicrotask:!0,warnsIfNotActing:!0,supportsMutation:!0,isPrimaryRenderer:!1,noTimeout:-1,appendChildToContainer:(f,d)=>{let p=f.getState().scene;p.__r3f.root=f,r(p,d)},removeChildFromContainer:(f,d)=>o(f.getState().scene,d),insertInContainerBefore:(f,d,p)=>i(f.getState().scene,d,p),getRootHostContext:()=>null,getChildHostContext:f=>f,finalizeInitialChildren(f){var d;return!!((d=f?.__r3f)!=null?d:{}).handlers},prepareUpdate(f,d,p,m){if(f.__r3f.primitive&&m.object&&m.object!==f)return[!0];{let{args:g=[],children:x,...y}=m,{args:_=[],children:S,...w}=p;if(!Array.isArray(g))throw"The args prop must be an array!";if(g.some((T,C)=>T!==_[C]))return[!0];let E=HA(f,y,w,!0);return E.changes.length?[!1,E]:null}},commitUpdate(f,[d,p],m,g,x,y){d?u(f,m,x,y):Iw(f,p)},commitMount(f,d,p,m){var g;let x=(g=f?.__r3f)!=null?g:{};f.raycast&&x.handlers&&x.eventCount&&f.__r3f.root.getState().internal.interaction.push(f)},getPublicInstance:f=>f,shouldDeprioritizeSubtree:()=>!1,prepareForCommit:()=>null,preparePortalMount:f=>yc(f.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,detachDeletedInstance:()=>{},createTextInstance:()=>{},hideInstance(f){var d;let{attach:p,parent:m}=(d=f?.__r3f)!=null?d:{};p&&m&&IA(m,f,p),f.isObject3D&&(f.visible=!1),xc(f)},unhideInstance(f,d){var p;let{attach:m,parent:g}=(p=f?.__r3f)!=null?p:{};m&&g&&Dw(g,f,m),(f.isObject3D&&d.visible==null||d.visible)&&(f.visible=!0),xc(f)},hideTextInstance:()=>{throw new Error("Text is not allowed in the R3F tree.")},getCurrentEventPriority:()=>e?e():Ks.DefaultEventPriority,now:typeof performance<"u"&&jt.fun(performance.now)?performance.now:jt.fun(Date.now)?Date.now:void 0,scheduleTimeout:jt.fun(setTimeout)?setTimeout:void 0,cancelTimeout:jt.fun(clearTimeout)?clearTimeout:void 0,setTimeout:jt.fun(setTimeout)?setTimeout:void 0,clearTimeout:jt.fun(clearTimeout)?clearTimeout:void 0}),applyProps:Iw}}var WA=n=>!!(n!=null&&n.render),Xw=an.createContext(null),sO=(n,e)=>{let t=dA((o,u)=>{let c=new R,f=new R,d=new R;function p(y=u().camera,_=f,S=u().size){let{width:w,height:E}=S,T=w/E;_ instanceof R?d.copy(_):d.set(..._);let C=y.getWorldPosition(c).distanceTo(d);if(kA(y))return{width:w/y.zoom,height:E/y.zoom,factor:1,distance:C,aspect:T};{let P=y.fov*Math.PI/180,D=2*Math.tan(P/2)*C,I=D*(w/E);return{width:I,height:D,factor:w/I,distance:C,aspect:T}}}let m,g=y=>o(_=>({performance:{..._.performance,current:y}})),x=new oe;return{set:o,get:u,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,invalidate:()=>n(u()),advance:(y,_)=>e(y,_,u()),legacy:!1,linear:!1,flat:!1,scene:yc(new Zo),controls:null,clock:new fc,pointer:x,mouse:x,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{let y=u();m&&clearTimeout(m),y.performance.current!==y.performance.min&&g(y.performance.min),m=setTimeout(()=>g(u().performance.max),y.performance.debounce)}},size:{width:0,height:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:y=>o(_=>({..._,events:{..._.events,...y}})),setSize:(y,_)=>{let S=u().camera,w={width:y,height:_};o(E=>({size:w,viewport:{...E.viewport,...p(S,f,w)}}))},setDpr:y=>o(_=>{let S=BA(y);return{viewport:{..._.viewport,dpr:S,initialDpr:_.viewport.initialDpr||S}}}),setFrameloop:(y="always")=>{let _=u().clock;_.stop(),_.elapsedTime=0,y!=="never"&&(_.start(),_.elapsedTime=0),o(()=>({frameloop:y}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:an.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(y,_,S)=>(o(({internal:w})=>({internal:{...w,priority:w.priority+(_>0?1:0),subscribers:[...w.subscribers,{ref:y,priority:_,store:S}].sort((E,T)=>E.priority-T.priority)}})),()=>{o(({internal:w})=>({internal:{...w,priority:w.priority-(_>0?1:0),subscribers:w.subscribers.filter(E=>E.ref!==y)}}))})}}}),r=t.getState(),i=r.size,s=r.viewport.dpr;return t.subscribe(()=>{let{camera:o,size:u,viewport:c,gl:f}=t.getState();(u!==i||c.dpr!==s)&&(tO(o,u),f.setPixelRatio(c.dpr),f.setSize(u.width,u.height),i=u,s=c.dpr)}),t.subscribe(o=>n(o)),t};var oa,zw=[],kw=[],NA=[];function Wd(n,e){for(oa=0;oa{var d;i=f.store.getState(),i.internal.active&&(i.frameloop==="always"||i.internal.frames>0)&&!((d=i.gl.xr)!=null&&d.isPresenting)&&(t+=Bw(c,i))}),kw.length&&Wd(kw,c),t===0)return NA.length&&Wd(NA,c),e=!1,cancelAnimationFrame(r)}function o(c){var f;if(!c)return n.forEach(d=>o(d.store.getState()));(f=c.gl.xr)!=null&&f.isPresenting||!c.internal.active||c.frameloop==="never"||(c.internal.frames=Math.min(60,c.internal.frames+1),e||(e=!0,requestAnimationFrame(s)))}function u(c,f=!0,d,p){f&&Wd(zw,c),d?Bw(c,d,p):n.forEach(m=>Bw(c,m.store.getState())),f&&Wd(kw,c)}return{loop:s,invalidate:o,advance:u}}function qw(){let n=an.useContext(Xw);if(!n)throw"R3F hooks can only be used within the Canvas component!";return n}function hs(n=t=>t,e){return qw()(n,e)}function Zd(n,e=0){let t=qw(),r=t.getState().internal.subscribe,i=Ww(n);return _c(()=>r(i,e,t),[e,r,t]),null}function jA(n,e){return function(t,...r){let i=new t;return n&&n(i),Promise.all(r.map(s=>new Promise((o,u)=>i.load(s,c=>{c.scene&&Object.assign(c,eO(c.scene)),o(c)},e,c=>u(`Could not load ${s}: ${c.message}`)))))}}function Yw(n,e,t,r){let i=Array.isArray(e)?e:[e],s=PA(jA(t,r),[n,...i],{equal:jt.equ});return Array.isArray(e)?s:s[0]}Yw.preload=function(n,e,t){let r=Array.isArray(e)?e:[e];return RA(jA(t),[n,...r])};Yw.clear=function(n,e){let t=Array.isArray(e)?e:[e];return LA([n,...t])};var Al=new Map,{invalidate:XA,advance:Gw}=oO(Al),{reconciler:Yd,applyProps:Xd}=iO(Al,nO),vc={objects:"shallow",strict:!1},aO=(n,e)=>{let t=typeof n=="function"?n(e):n;return WA(t)?t:new At({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function Zw(n){let e=Al.get(n),t=e?.fiber,r=e?.store;e&&console.warn("R3F.createRoot should only be called once!");let i=r||sO(XA,Gw),s=t||Yd.createContainer(i,Ks.ConcurrentRoot,!1,null);e||Al.set(n,{fiber:s,store:i});let o,u=!1;return{configure(c={}){var f,d,p,m;let{gl:g,size:x,events:y,onCreated:_,shadows:S=!1,linear:w=!1,flat:E=!1,legacy:T=!1,orthographic:C=!1,frameloop:P="always",dpr:D=[1,2],performance:I,raycaster:G,camera:B,onPointerMissed:A}=c,F=i.getState(),ne=F.gl;F.gl||F.set({gl:ne=aO(g,n)});let j=F.raycaster;j||F.set({raycaster:j=new Bd});let{params:Q,...X}=G||{};if(jt.equ(X,j,vc)||Xd(j,{...X}),jt.equ(Q,j.params,vc)||Xd(j,{params:{...j.params,...Q}}),!F.camera){let re=B instanceof Gs,ce=re?B:C?new Wr(0,0,0,0,.1,1e3):new Lt(75,0,.1,1e3);re||(ce.position.z=5,B&&Xd(ce,B),B!=null&&B.rotation||ce.lookAt(0,0,0)),F.set({camera:ce})}if(!F.xr){let re=(fe,ze)=>{let $e=i.getState();$e.frameloop!=="never"&&Gw(fe,!0,$e,ze)},ce=()=>{let fe=i.getState().gl;fe.xr.enabled=fe.xr.isPresenting,fe.xr.setAnimationLoop(fe.xr.isPresenting?re:null)},ge={connect(){let fe=i.getState().gl;fe.xr.addEventListener("sessionstart",ce),fe.xr.addEventListener("sessionend",ce)},disconnect(){let fe=i.getState().gl;fe.xr.removeEventListener("sessionstart",ce),fe.xr.removeEventListener("sessionend",ce)}};ne.xr&&ge.connect(),F.set({xr:ge})}if(ne.shadowMap){let re=jt.boo(S);if(re&&ne.shadowMap.enabled!==S||!jt.equ(S,ne.shadowMap,vc)){let ce=ne.shadowMap.enabled;ne.shadowMap.enabled=!!S,re?ne.shadowMap.type=i0:Object.assign(ne.shadowMap,S),ce!==ne.shadowMap.enabled&&(ne.shadowMap.needsUpdate=!0)}}Jn&&(Jn.legacyMode=T);let J=w?vi:Dt,W=E?pi:s0;return ne.outputEncoding!==J&&(ne.outputEncoding=J),ne.toneMapping!==W&&(ne.toneMapping=W),F.legacy!==T&&F.set(()=>({legacy:T})),F.linear!==w&&F.set(()=>({linear:w})),F.flat!==E&&F.set(()=>({flat:E})),g&&!jt.fun(g)&&!WA(g)&&!jt.equ(g,ne,vc)&&Xd(ne,g),y&&!F.events.handlers&&F.set({events:y(i)}),D&&F.viewport.dpr!==BA(D)&&F.setDpr(D),x=x||{width:(f=(d=n.parentElement)==null?void 0:d.clientWidth)!=null?f:0,height:(p=(m=n.parentElement)==null?void 0:m.clientHeight)!=null?p:0},jt.equ(x,F.size,vc)||F.setSize(x.width,x.height),F.frameloop!==P&&F.setFrameloop(P),F.onPointerMissed||F.set({onPointerMissed:A}),I&&!jt.equ(I,F.performance,vc)&&F.set(re=>({performance:{...re.performance,...I}})),o=_,u=!0,this},render(c){return u||this.configure(),Yd.updateContainer(an.createElement(lO,{store:i,children:c,onCreated:o,rootElement:n}),s,null,()=>{}),i},unmount(){x0(n)}}}function lO({store:n,children:e,onCreated:t,rootElement:r}){return _c(()=>{let i=n.getState();i.set(s=>({internal:{...s.internal,active:!0}})),t&&t(i),n.getState().events.connected||i.events.connect==null||i.events.connect(r)},[]),an.createElement(Xw.Provider,{value:n},e)}function x0(n,e){let t=Al.get(n),r=t?.fiber;if(r){let i=t?.store.getState();i&&(i.internal.active=!1),Yd.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{var s,o,u,c;i.events.disconnect==null||i.events.disconnect(),(s=i.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(u=i.gl)==null||u.forceContextLoss==null||u.forceContextLoss(),(c=i.gl)!=null&&c.xr&&i.xr.disconnect(),UA(i),Al.delete(n),e&&e(n)}catch{}},500)})}}Yd.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:"18.0.0"});function Pl(){return Pl=Object.assign?Object.assign.bind():function(n){for(var e=1;e"u"?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");let[o,u]=(0,qr.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),c=(0,qr.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),f=e?typeof e=="number"?e:e.scroll:null,d=e?typeof e=="number"?e:e.resize:null,p=(0,qr.useRef)(!1);(0,qr.useEffect)(()=>(p.current=!0,()=>void(p.current=!1)));let[m,g,x]=(0,qr.useMemo)(()=>{let w=()=>{if(!c.current.element)return;let{left:E,top:T,width:C,height:P,bottom:D,right:I,x:G,y:B}=c.current.element.getBoundingClientRect(),A={left:E,top:T,width:C,height:P,bottom:D,right:I,x:G,y:B};c.current.element instanceof HTMLElement&&i&&(A.height=c.current.element.offsetHeight,A.width=c.current.element.offsetWidth),Object.freeze(A),p.current&&!hO(c.current.lastBounds,A)&&u(c.current.lastBounds=A)};return[w,d?(0,Kw.default)(w,d):w,f?(0,Kw.default)(w,f):w]},[u,i,f,d]);function y(){c.current.scrollContainers&&(c.current.scrollContainers.forEach(w=>w.removeEventListener("scroll",x,!0)),c.current.scrollContainers=null),c.current.resizeObserver&&(c.current.resizeObserver.disconnect(),c.current.resizeObserver=null)}function _(){!c.current.element||(c.current.resizeObserver=new s(x),c.current.resizeObserver.observe(c.current.element),t&&c.current.scrollContainers&&c.current.scrollContainers.forEach(w=>w.addEventListener("scroll",x,{capture:!0,passive:!0})))}let S=w=>{!w||w===c.current.element||(y(),c.current.element=w,c.current.scrollContainers=QA(w),_())};return fO(x,Boolean(t)),cO(g),(0,qr.useEffect)(()=>{y(),_()},[t,x,g]),(0,qr.useEffect)(()=>y,[]),[S,o,m]}function cO(n){(0,qr.useEffect)(()=>{let e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function fO(n,e){(0,qr.useEffect)(()=>{if(e){let t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function QA(n){let e=[];if(!n||n===document.body)return e;let{overflow:t,overflowX:r,overflowY:i}=window.getComputedStyle(n);return[t,r,i].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...QA(n.parentElement)]}var dO=["x","y","top","bottom","left","right","width","height"],hO=(n,e)=>dO.every(t=>n[t]===e[t]);var tB=Pn(ww());var nB=Pn(Lw()),rB=Pn(v0());var $w={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function pO(n){let{handlePointer:e}=GA(n);return{priority:1,enabled:!0,compute(t,r,i){r.pointer.set(t.offsetX/r.size.width*2-1,-(t.offsetY/r.size.height)*2+1),r.raycaster.setFromCamera(r.pointer,r.camera)},connected:void 0,handlers:Object.keys($w).reduce((t,r)=>({...t,[r]:e(r)}),{}),connect:t=>{var r;let{set:i,events:s}=n.getState();s.disconnect==null||s.disconnect(),i(o=>({events:{...o.events,connected:t}})),Object.entries((r=s?.handlers)!=null?r:[]).forEach(([o,u])=>{let[c,f]=$w[o];t.addEventListener(c,u,{passive:f})})},disconnect:()=>{let{set:t,events:r}=n.getState();if(r.connected){var i;Object.entries((i=r.handlers)!=null?i:[]).forEach(([s,o])=>{if(r&&r.connected instanceof HTMLElement){let[u]=$w[s];r.connected.removeEventListener(u,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}var JA=ln.forwardRef(function({children:e,fallback:t,resize:r,style:i,gl:s,events:o=pO,shadows:u,linear:c,flat:f,legacy:d,orthographic:p,frameloop:m,dpr:g,performance:x,raycaster:y,camera:_,onPointerMissed:S,onCreated:w,...E},T){ln.useMemo(()=>jw(f0),[]);let[C,{width:P,height:D}]=ZA({scroll:!0,debounce:{scroll:50,resize:0},...r}),I=ln.useRef(null),G=ln.useRef(null),[B,A]=ln.useState(null),F=Ww(S),[ne,j]=ln.useState(!1),[Q,X]=ln.useState(!1);if(ne)throw ne;if(Q)throw Q;let J=ln.useRef(null);return P>0&&D>0&&B&&(J.current||(J.current=Zw(B)),J.current.configure({gl:s,events:o,shadows:u,linear:c,flat:f,legacy:d,orthographic:p,frameloop:m,dpr:g,performance:x,raycaster:y,camera:_,size:{width:P,height:D},onPointerMissed:(...W)=>F.current==null?void 0:F.current(...W),onCreated:W=>{W.events.connect==null||W.events.connect(G.current),w?.(W)}}),J.current.render(ln.createElement(qd,{set:X},ln.createElement(ln.Suspense,{fallback:ln.createElement(FA,{set:j})},e)))),_c(()=>{A(I.current)},[]),ln.useEffect(()=>{if(B)return()=>x0(B)},[B]),ln.createElement("div",Pl({ref:Qw([G,C]),style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",...i}},E),ln.createElement("canvas",{ref:Qw([I,T]),style:{display:"block"}},t))});function Ke(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var KA=(n,e)=>(n%e+e)%e,Qd=class extends yi{constructor(e,t){super(),Ke(this,"object",void 0),Ke(this,"domElement",void 0),Ke(this,"enabled",!0),Ke(this,"target",new R),Ke(this,"minDistance",0),Ke(this,"maxDistance",1/0),Ke(this,"minZoom",0),Ke(this,"maxZoom",1/0),Ke(this,"minPolarAngle",0),Ke(this,"maxPolarAngle",Math.PI),Ke(this,"minAzimuthAngle",-1/0),Ke(this,"maxAzimuthAngle",1/0),Ke(this,"enableDamping",!1),Ke(this,"dampingFactor",.05),Ke(this,"enableZoom",!0),Ke(this,"zoomSpeed",1),Ke(this,"enableRotate",!0),Ke(this,"rotateSpeed",1),Ke(this,"enablePan",!0),Ke(this,"panSpeed",1),Ke(this,"screenSpacePanning",!0),Ke(this,"keyPanSpeed",7),Ke(this,"autoRotate",!1),Ke(this,"autoRotateSpeed",2),Ke(this,"reverseOrbit",!1),Ke(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Ke(this,"mouseButtons",{LEFT:ra.ROTATE,MIDDLE:ra.DOLLY,RIGHT:ra.PAN}),Ke(this,"touches",{ONE:ia.ROTATE,TWO:ia.DOLLY_PAN}),Ke(this,"target0",void 0),Ke(this,"position0",void 0),Ke(this,"zoom0",void 0),Ke(this,"_domElementKeyEvents",null),Ke(this,"getPolarAngle",void 0),Ke(this,"getAzimuthalAngle",void 0),Ke(this,"setPolarAngle",void 0),Ke(this,"setAzimuthalAngle",void 0),Ke(this,"getDistance",void 0),Ke(this,"listenToKeyEvents",void 0),Ke(this,"saveState",void 0),Ke(this,"reset",void 0),Ke(this,"update",void 0),Ke(this,"connect",void 0),Ke(this,"dispose",void 0),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object instanceof Lt?this.object.zoom:1,this.getPolarAngle=()=>d.phi,this.getAzimuthalAngle=()=>d.theta,this.setPolarAngle=U=>{let N=KA(U,2*Math.PI),le=d.phi;le<0&&(le+=2*Math.PI),N<0&&(N+=2*Math.PI);let de=Math.abs(N-le);2*Math.PI-de{let N=KA(U,2*Math.PI),le=d.theta;le<0&&(le+=2*Math.PI),N<0&&(N+=2*Math.PI);let de=Math.abs(N-le);2*Math.PI-der.object.position.distanceTo(r.target),this.listenToKeyEvents=U=>{U.addEventListener("keydown",$),this._domElementKeyEvents=U},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object instanceof Lt?r.object.zoom:1},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object instanceof Lt&&(r.object.zoom=r.zoom0,r.object.updateProjectionMatrix()),r.dispatchEvent(i),r.update(),c=u.NONE},this.update=(()=>{let U=new R,N=new on().setFromUnitVectors(e.up,new R(0,1,0)),le=N.clone().invert(),de=new R,Re=new on,Se=2*Math.PI;return function(){let _e=r.object.position;U.copy(_e).sub(r.target),U.applyQuaternion(N),d.setFromVector3(U),r.autoRotate&&c===u.NONE&&F(B()),r.enableDamping?(d.theta+=p.theta*r.dampingFactor,d.phi+=p.phi*r.dampingFactor):(d.theta+=p.theta,d.phi+=p.phi);let Be=r.minAzimuthAngle,ft=r.maxAzimuthAngle;return isFinite(Be)&&isFinite(ft)&&(Be<-Math.PI?Be+=Se:Be>Math.PI&&(Be-=Se),ft<-Math.PI?ft+=Se:ft>Math.PI&&(ft-=Se),Be<=ft?d.theta=Math.max(Be,Math.min(ft,d.theta)):d.theta=d.theta>(Be+ft)/2?Math.max(Be,d.theta):Math.min(ft,d.theta)),d.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,d.phi)),d.makeSafe(),d.radius*=m,d.radius=Math.max(r.minDistance,Math.min(r.maxDistance,d.radius)),r.enableDamping===!0?r.target.addScaledVector(g,r.dampingFactor):r.target.add(g),U.setFromSpherical(d),U.applyQuaternion(le),_e.copy(r.target).add(U),r.object.lookAt(r.target),r.enableDamping===!0?(p.theta*=1-r.dampingFactor,p.phi*=1-r.dampingFactor,g.multiplyScalar(1-r.dampingFactor)):(p.set(0,0,0),g.set(0,0,0)),m=1,x||de.distanceToSquared(r.object.position)>f||8*(1-Re.dot(r.object.quaternion))>f?(r.dispatchEvent(i),de.copy(r.object.position),Re.copy(r.object.quaternion),x=!1,!0):!1}})(),this.connect=U=>{U===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),r.domElement=U,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",Ae),r.domElement.addEventListener("pointerdown",Ze),r.domElement.addEventListener("pointercancel",_t),r.domElement.addEventListener("wheel",L)},this.dispose=()=>{var U,N,le,de,Re,Se;(U=r.domElement)===null||U===void 0||U.removeEventListener("contextmenu",Ae),(N=r.domElement)===null||N===void 0||N.removeEventListener("pointerdown",Ze),(le=r.domElement)===null||le===void 0||le.removeEventListener("pointercancel",_t),(de=r.domElement)===null||de===void 0||de.removeEventListener("wheel",L),(Re=r.domElement)===null||Re===void 0||Re.ownerDocument.removeEventListener("pointermove",Ue),(Se=r.domElement)===null||Se===void 0||Se.ownerDocument.removeEventListener("pointerup",Oe),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",$)};let r=this,i={type:"change"},s={type:"start"},o={type:"end"},u={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},c=u.NONE,f=1e-6,d=new hc,p=new hc,m=1,g=new R,x=!1,y=new oe,_=new oe,S=new oe,w=new oe,E=new oe,T=new oe,C=new oe,P=new oe,D=new oe,I=[],G={};function B(){return 2*Math.PI/60/60*r.autoRotateSpeed}function A(){return Math.pow(.95,r.zoomSpeed)}function F(U){r.reverseOrbit?p.theta+=U:p.theta-=U}function ne(U){r.reverseOrbit?p.phi+=U:p.phi-=U}let j=(()=>{let U=new R;return function(le,de){U.setFromMatrixColumn(de,0),U.multiplyScalar(-le),g.add(U)}})(),Q=(()=>{let U=new R;return function(le,de){r.screenSpacePanning===!0?U.setFromMatrixColumn(de,1):(U.setFromMatrixColumn(de,0),U.crossVectors(r.object.up,U)),U.multiplyScalar(le),g.add(U)}})(),X=(()=>{let U=new R;return function(le,de){let Re=r.domElement;if(Re&&r.object instanceof Lt&&r.object.isPerspectiveCamera){let Se=r.object.position;U.copy(Se).sub(r.target);let Ve=U.length();Ve*=Math.tan(r.object.fov/2*Math.PI/180),j(2*le*Ve/Re.clientHeight,r.object.matrix),Q(2*de*Ve/Re.clientHeight,r.object.matrix)}else Re&&r.object instanceof Wr&&r.object.isOrthographicCamera?(j(le*(r.object.right-r.object.left)/r.object.zoom/Re.clientWidth,r.object.matrix),Q(de*(r.object.top-r.object.bottom)/r.object.zoom/Re.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function J(U){r.object instanceof Lt&&r.object.isPerspectiveCamera?m/=U:r.object instanceof Wr&&r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom*U)),r.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function W(U){r.object instanceof Lt&&r.object.isPerspectiveCamera?m*=U:r.object instanceof Wr&&r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/U)),r.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function re(U){y.set(U.clientX,U.clientY)}function ce(U){C.set(U.clientX,U.clientY)}function ge(U){w.set(U.clientX,U.clientY)}function fe(U){_.set(U.clientX,U.clientY),S.subVectors(_,y).multiplyScalar(r.rotateSpeed);let N=r.domElement;N&&(F(2*Math.PI*S.x/N.clientHeight),ne(2*Math.PI*S.y/N.clientHeight)),y.copy(_),r.update()}function ze(U){P.set(U.clientX,U.clientY),D.subVectors(P,C),D.y>0?J(A()):D.y<0&&W(A()),C.copy(P),r.update()}function $e(U){E.set(U.clientX,U.clientY),T.subVectors(E,w).multiplyScalar(r.panSpeed),X(T.x,T.y),w.copy(E),r.update()}function Xe(U){U.deltaY<0?W(A()):U.deltaY>0&&J(A()),r.update()}function ue(U){let N=!1;switch(U.code){case r.keys.UP:X(0,r.keyPanSpeed),N=!0;break;case r.keys.BOTTOM:X(0,-r.keyPanSpeed),N=!0;break;case r.keys.LEFT:X(r.keyPanSpeed,0),N=!0;break;case r.keys.RIGHT:X(-r.keyPanSpeed,0),N=!0;break}N&&(U.preventDefault(),r.update())}function dt(){if(I.length==1)y.set(I[0].pageX,I[0].pageY);else{let U=.5*(I[0].pageX+I[1].pageX),N=.5*(I[0].pageY+I[1].pageY);y.set(U,N)}}function Qe(){if(I.length==1)w.set(I[0].pageX,I[0].pageY);else{let U=.5*(I[0].pageX+I[1].pageX),N=.5*(I[0].pageY+I[1].pageY);w.set(U,N)}}function qe(){let U=I[0].pageX-I[1].pageX,N=I[0].pageY-I[1].pageY,le=Math.sqrt(U*U+N*N);C.set(0,le)}function xe(){r.enableZoom&&qe(),r.enablePan&&Qe()}function je(){r.enableZoom&&qe(),r.enableRotate&&dt()}function ae(U){if(I.length==1)_.set(U.pageX,U.pageY);else{let le=et(U),de=.5*(U.pageX+le.x),Re=.5*(U.pageY+le.y);_.set(de,Re)}S.subVectors(_,y).multiplyScalar(r.rotateSpeed);let N=r.domElement;N&&(F(2*Math.PI*S.x/N.clientHeight),ne(2*Math.PI*S.y/N.clientHeight)),y.copy(_)}function ie(U){if(I.length==1)E.set(U.pageX,U.pageY);else{let N=et(U),le=.5*(U.pageX+N.x),de=.5*(U.pageY+N.y);E.set(le,de)}T.subVectors(E,w).multiplyScalar(r.panSpeed),X(T.x,T.y),w.copy(E)}function ve(U){let N=et(U),le=U.pageX-N.x,de=U.pageY-N.y,Re=Math.sqrt(le*le+de*de);P.set(0,Re),D.set(0,Math.pow(P.y/C.y,r.zoomSpeed)),J(D.y),C.copy(P)}function Ie(U){r.enableZoom&&ve(U),r.enablePan&&ie(U)}function be(U){r.enableZoom&&ve(U),r.enableRotate&&ae(U)}function Ze(U){if(r.enabled!==!1){if(I.length===0){var N,le;(N=r.domElement)===null||N===void 0||N.ownerDocument.addEventListener("pointermove",Ue),(le=r.domElement)===null||le===void 0||le.ownerDocument.addEventListener("pointerup",Oe)}He(U),U.pointerType==="touch"?pe(U):bt(U)}}function Ue(U){r.enabled!==!1&&(U.pointerType==="touch"?Ee(U):O(U))}function Oe(U){if(se(U),I.length===0){var N,le,de;(N=r.domElement)===null||N===void 0||N.releasePointerCapture(U.pointerId),(le=r.domElement)===null||le===void 0||le.ownerDocument.removeEventListener("pointermove",Ue),(de=r.domElement)===null||de===void 0||de.ownerDocument.removeEventListener("pointerup",Oe)}r.dispatchEvent(o),c=u.NONE}function _t(U){se(U)}function bt(U){let N;switch(U.button){case 0:N=r.mouseButtons.LEFT;break;case 1:N=r.mouseButtons.MIDDLE;break;case 2:N=r.mouseButtons.RIGHT;break;default:N=-1}switch(N){case ra.DOLLY:if(r.enableZoom===!1)return;ce(U),c=u.DOLLY;break;case ra.ROTATE:if(U.ctrlKey||U.metaKey||U.shiftKey){if(r.enablePan===!1)return;ge(U),c=u.PAN}else{if(r.enableRotate===!1)return;re(U),c=u.ROTATE}break;case ra.PAN:if(U.ctrlKey||U.metaKey||U.shiftKey){if(r.enableRotate===!1)return;re(U),c=u.ROTATE}else{if(r.enablePan===!1)return;ge(U),c=u.PAN}break;default:c=u.NONE}c!==u.NONE&&r.dispatchEvent(s)}function O(U){if(r.enabled!==!1)switch(c){case u.ROTATE:if(r.enableRotate===!1)return;fe(U);break;case u.DOLLY:if(r.enableZoom===!1)return;ze(U);break;case u.PAN:if(r.enablePan===!1)return;$e(U);break}}function L(U){r.enabled===!1||r.enableZoom===!1||c!==u.NONE&&c!==u.ROTATE||(U.preventDefault(),r.dispatchEvent(s),Xe(U),r.dispatchEvent(o))}function $(U){r.enabled===!1||r.enablePan===!1||ue(U)}function pe(U){switch(Je(U),I.length){case 1:switch(r.touches.ONE){case ia.ROTATE:if(r.enableRotate===!1)return;dt(),c=u.TOUCH_ROTATE;break;case ia.PAN:if(r.enablePan===!1)return;Qe(),c=u.TOUCH_PAN;break;default:c=u.NONE}break;case 2:switch(r.touches.TWO){case ia.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;xe(),c=u.TOUCH_DOLLY_PAN;break;case ia.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;je(),c=u.TOUCH_DOLLY_ROTATE;break;default:c=u.NONE}break;default:c=u.NONE}c!==u.NONE&&r.dispatchEvent(s)}function Ee(U){switch(Je(U),c){case u.TOUCH_ROTATE:if(r.enableRotate===!1)return;ae(U),r.update();break;case u.TOUCH_PAN:if(r.enablePan===!1)return;ie(U),r.update();break;case u.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;Ie(U),r.update();break;case u.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;be(U),r.update();break;default:c=u.NONE}}function Ae(U){r.enabled!==!1&&U.preventDefault()}function He(U){I.push(U)}function se(U){delete G[U.pointerId];for(let N=0;N{let d=hs(T=>T.invalidate),p=hs(T=>T.camera),m=hs(T=>T.gl),g=hs(T=>T.events),x=hs(T=>T.set),y=hs(T=>T.get),_=hs(T=>T.performance),S=e||p,w=r||g.connected||m.domElement,E=ps.useMemo(()=>new Qd(S),[S]);return Zd(()=>{E.enabled&&E.update()},-1),ps.useEffect(()=>(E.connect(w),()=>void E.dispose()),[w,t,E,d]),ps.useEffect(()=>{let T=C=>{d(),t&&_.regress(),s&&s(C)};return E.addEventListener("change",T),o&&E.addEventListener("start",o),u&&E.addEventListener("end",u),()=>{o&&E.removeEventListener("start",o),u&&E.removeEventListener("end",u),E.removeEventListener("change",T)}},[s,o,u]),ps.useEffect(()=>{if(n){let T=y().controls;return x({controls:E}),()=>x({controls:T})}},[n,E]),ps.createElement("primitive",Pl({ref:f,object:E,enableDamping:i},c))});function nS(){return nS=Object.assign||function(n){for(var e=1;e=0)&&(t[i]=n[i]);return t}var mO=["children","camera","orthographic"];function eP(n){var e=n.children,t=n.camera,r=n.orthographic,i=r===void 0?!1:r,s=$A(n,mO);return en.default.createElement(JA,Object.assign({orthographic:i,camera:nS({position:[0,0,1],zoom:1,up:[0,1,0]},t)},s),e)}var gO=["enabled","zoomSpeed","enableZoom","enablePan","enableRotate","autoRotate","autoRotateSpeed"];function tP(n){var e=n.enabled,t=e===void 0?!0:e,r=n.zoomSpeed,i=r===void 0?1:r,s=n.enableZoom,o=s===void 0?!0:s,u=n.enablePan,c=u===void 0?!0:u,f=n.enableRotate,d=f===void 0?!0:f,p=n.autoRotate,m=p===void 0?!1:p,g=n.autoRotateSpeed,x=g===void 0?5:g,y=$A(n,gO);return en.default.createElement(eS,Object.assign({enabled:t,zoomSpeed:i,enableZoom:o,enablePan:c,enableRotate:d,autoRotate:m,autoRotateSpeed:x},y))}var vO={color:"blue",scale:1},_0=new st,tS=new we;function rS(n){var e=n.data,t=n.pointProps,r=t===void 0?vO:t,i=n.onPointsClicked,s=n.onPointClicked,o=n.pointShape,u=o===void 0?"sphere":o,c=n.opacity,f=c===void 0?1:c,d=n.material,p=d===void 0?"meshMatcap":d,m=(0,en.useCallback)(function(S){var w=typeof r.color=="function"?r.color(S):r.color;return w},[r.color]),g=(0,en.useMemo)(function(){return Float32Array.from(new Array(e.length).fill(null).flatMap(function(S,w){return tS.set(m(e[w])).toArray()}))},[e]),x=(0,en.useRef)(null);Zd(function(){e.forEach(function(S,w){var E=S.position;if(_0.position.set(E[0],E[1],E[2]||0),x.current){x.current.setMatrixAt(w,_0.matrix),x.current.instanceMatrix.needsUpdate=!0;var T=m(e[w]);tS.set(T),tS.toArray(g,w*3),x.current.geometry.attributes.color.needsUpdate=!0,_0.updateMatrix(),x.current.setMatrixAt(w,_0.matrix)}})});var y=(0,en.useMemo)(function(){switch(u){case"sphere":return en.default.createElement("sphereGeometry",{args:[r.radius||.02,20,20]},en.default.createElement("instancedBufferAttribute",{attach:"attributes-color",args:[g,3]}));case"cube":{var S=typeof r?.size=="number"?[r.size,r.size,r.size]:[.03,.03,.03];return en.default.createElement("boxGeometry",{args:S},en.default.createElement("instancedBufferAttribute",{attach:"attributes-color",args:[g,3]}))}case"octahedron":return en.default.createElement("octahedronGeometry",{args:[r.radius||.02,0]},en.default.createElement("instancedBufferAttribute",{attach:"attributes-color",args:[g,3]}));default:throw new Error("Unsupported point shape: "+u)}},[u,r]),_=(0,en.useMemo)(function(){switch(p){case"meshMatcap":return en.default.createElement("meshMatcapMaterial",{vertexColors:c0,opacity:f,transparent:f<1});default:return en.default.createElement("meshStandardMaterial",{vertexColors:c0,opacity:f,transparent:f<1})}},[p]);return en.default.createElement("instancedMesh",{args:[void 0,void 0,e.length],ref:x,onPointerUp:function(w){if(w.intersections){var E=w.intersections.map(function(T){return T?.instanceId}).filter(function(T){return T!=null});i&&i(E.map(function(T){return e[T]})),E.length>0&&s&&s(e[E[0]])}}},y,_)}var un={Purple:"#6e40aa",LightPurple:"#bf3caf",Pink:"#fe4b83",Orange:"#ff7847",LightOrange:"#e2b72f",Lime:"#aff05b",LightGreen:"#52f667",Green:"#1ddfa3",LightBlue:"#23abd8",Blue:"#4c6edb",White:"#ffffff"},MB={PinkLightGreen:[un.Pink,un.LightGreen],BlueOrange:[un.Blue,un.Orange],LightBlueOrange:[un.LightBlue,un.Orange],LightBlueLightOrange:[un.LightBlue,un.LightOrange],LimePurple:[un.Lime,un.Purple],LimeLightPurple:[un.Lime,un.LightPurple],BlueLime:[un.Blue,un.Lime],LightBlueLime:[un.LightBlue,un.Lime],WhiteLime:[un.White,un.Lime],WhiteLightBlue:[un.White,un.LightBlue],WhiteOrange:[un.White,un.Orange]};var iS=Pn(Dr()),w0=class extends iS.default.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){}render(){return this.state.hasError?iS.default.createElement("h1",null,"Something went wrong."):this.props.children}};function nP({primaryData:n,referenceData:e}){return Rl.default.createElement("div",null,Rl.default.createElement(w0,null,Rl.default.createElement(eP,{camera:{position:[0,0,10]}},Rl.default.createElement(tP,null),Rl.default.createElement(rS,{data:n,pointProps:{color:"#7BFFFF"}}),Rl.default.createElement(rS,{data:e,pointProps:{color:"#d57bff"}}))))}function iP(n){return rP.default.createElement(nP,{...n})}window.renderUMAPWidget=function(n){let e=document.getElementById("root");oP.default.createRoot(e).render(sP.default.createElement(iP,{...n}))}; +}`;function $C(n,e,t){let r=new nl,i=new oe,s=new oe,o=new Tt,u=new Ku({depthPacking:FC}),c=new $u,f={},d=t.maxTextureSize,p={0:Vr,1:Ka,2:$a},m=new br({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new oe},radius:{value:4}},vertexShader:BF,fragmentShader:UF}),g=m.clone();g.defines.HORIZONTAL_PASS=1;let x=new We;x.setAttribute("position",new mt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let y=new sn(x,m),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=aw,this.render=function(T,C,P){if(_.enabled===!1||_.autoUpdate===!1&&_.needsUpdate===!1||T.length===0)return;let D=n.getRenderTarget(),I=n.getActiveCubeFace(),G=n.getActiveMipmapLevel(),B=n.state;B.setBlending(Hs),B.buffers.color.setClear(1,1,1,1),B.buffers.depth.setTest(!0),B.setScissorTest(!1);for(let A=0,F=T.length;Ad||i.y>d)&&(i.x>d&&(s.x=Math.floor(d/Q.x),i.x=s.x*Q.x,j.mapSize.x=s.x),i.y>d&&(s.y=Math.floor(d/Q.y),i.y=s.y*Q.y,j.mapSize.y=s.y)),j.map===null&&!j.isPointLightShadow&&this.type===Uu&&(j.map=new On(i.x,i.y),j.map.texture.name=ne.name+".shadowMap",j.mapPass=new On(i.x,i.y),j.camera.updateProjectionMatrix()),j.map===null){let J={minFilter:_n,magFilter:_n,format:Hr};j.map=new On(i.x,i.y,J),j.map.texture.name=ne.name+".shadowMap",j.camera.updateProjectionMatrix()}n.setRenderTarget(j.map),n.clear();let X=j.getViewportCount();for(let J=0;J0){let F=B.uuid,ne=C.uuid,j=f[F];j===void 0&&(j={},f[F]=j);let Q=j[ne];Q===void 0&&(Q=B.clone(),j[ne]=Q),B=Q}return B.visible=C.visible,B.wireframe=C.wireframe,G===Uu?B.side=C.shadowSide!==null?C.shadowSide:C.side:B.side=C.shadowSide!==null?C.shadowSide:p[C.side],B.alphaMap=C.alphaMap,B.alphaTest=C.alphaTest,B.clipShadows=C.clipShadows,B.clippingPlanes=C.clippingPlanes,B.clipIntersection=C.clipIntersection,B.displacementMap=C.displacementMap,B.displacementScale=C.displacementScale,B.displacementBias=C.displacementBias,B.wireframeLinewidth=C.wireframeLinewidth,B.linewidth=C.linewidth,P.isPointLight===!0&&B.isMeshDistanceMaterial===!0&&(B.referencePosition.setFromMatrixPosition(P.matrixWorld),B.nearDistance=D,B.farDistance=I),B}function E(T,C,P,D,I){if(T.visible===!1)return;if(T.layers.test(C.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&I===Uu)&&(!T.frustumCulled||r.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,T.matrixWorld);let A=e.update(T),F=T.material;if(Array.isArray(F)){let ne=A.groups;for(let j=0,Q=ne.length;j=1):X.indexOf("OpenGL ES")!==-1&&(Q=parseFloat(/^OpenGL ES (\d)/.exec(X)[1]),j=Q>=2);let J=null,W={},re=n.getParameter(3088),ce=n.getParameter(2978),ge=new Tt().fromArray(re),fe=new Tt().fromArray(ce);function ze(N,le,de){let Re=new Uint8Array(4),Se=n.createTexture();n.bindTexture(N,Se),n.texParameteri(N,10241,9728),n.texParameteri(N,10240,9728);for(let Ve=0;Vepe||O.height>pe)&&(Ee=pe/Math.max(O.width,O.height)),Ee<1||L===!0)if(typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&O instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&O instanceof ImageBitmap){let Ae=L?hg:Math.floor,He=Ae(Ee*O.width),se=Ae(Ee*O.height);y===void 0&&(y=w(He,se));let Je=$?w(He,se):y;return Je.width=He,Je.height=se,Je.getContext("2d").drawImage(O,0,0,He,se),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+O.width+"x"+O.height+") to ("+He+"x"+se+")."),Je}else return"data"in O&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+O.width+"x"+O.height+")."),O;return O}function T(O){return r1(O.width)&&r1(O.height)}function C(O){return u?!1:O.wrapS!==lr||O.wrapT!==lr||O.minFilter!==_n&&O.minFilter!==hn}function P(O,L){return O.generateMipmaps&&L&&O.minFilter!==_n&&O.minFilter!==hn}function D(O){n.generateMipmap(O)}function I(O,L,$,pe,Ee=!1){if(u===!1)return L;if(O!==null){if(n[O]!==void 0)return n[O];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+O+"'")}let Ae=L;return L===6403&&($===5126&&(Ae=33326),$===5131&&(Ae=33325),$===5121&&(Ae=33321)),L===33319&&($===5126&&(Ae=33328),$===5131&&(Ae=33327),$===5121&&(Ae=33323)),L===6408&&($===5126&&(Ae=34836),$===5131&&(Ae=34842),$===5121&&(Ae=pe===Dt&&Ee===!1?35907:32856),$===32819&&(Ae=32854),$===32820&&(Ae=32855)),(Ae===33325||Ae===33326||Ae===33327||Ae===33328||Ae===34842||Ae===34836)&&e.get("EXT_color_buffer_float"),Ae}function G(O,L,$){return P(O,$)===!0||O.isFramebufferTexture&&O.minFilter!==_n&&O.minFilter!==hn?Math.log2(Math.max(L.width,L.height))+1:O.mipmaps!==void 0&&O.mipmaps.length>0?O.mipmaps.length:O.isCompressedTexture&&Array.isArray(O.image)?L.mipmaps.length:1}function B(O){return O===_n||O===cg||O===fg?9728:9729}function A(O){let L=O.target;L.removeEventListener("dispose",A),ne(L),L.isVideoTexture&&x.delete(L)}function F(O){let L=O.target;L.removeEventListener("dispose",F),Q(L)}function ne(O){let L=r.get(O);if(L.__webglInit===void 0)return;let $=O.source,pe=_.get($);if(pe){let Ee=pe[L.__cacheKey];Ee.usedTimes--,Ee.usedTimes===0&&j(O),Object.keys(pe).length===0&&_.delete($)}r.remove(O)}function j(O){let L=r.get(O);n.deleteTexture(L.__webglTexture);let $=O.source,pe=_.get($);delete pe[L.__cacheKey],o.memory.textures--}function Q(O){let L=O.texture,$=r.get(O),pe=r.get(L);if(pe.__webglTexture!==void 0&&(n.deleteTexture(pe.__webglTexture),o.memory.textures--),O.depthTexture&&O.depthTexture.dispose(),O.isWebGLCubeRenderTarget)for(let Ee=0;Ee<6;Ee++)n.deleteFramebuffer($.__webglFramebuffer[Ee]),$.__webglDepthbuffer&&n.deleteRenderbuffer($.__webglDepthbuffer[Ee]);else n.deleteFramebuffer($.__webglFramebuffer),$.__webglDepthbuffer&&n.deleteRenderbuffer($.__webglDepthbuffer),$.__webglMultisampledFramebuffer&&n.deleteFramebuffer($.__webglMultisampledFramebuffer),$.__webglColorRenderbuffer&&n.deleteRenderbuffer($.__webglColorRenderbuffer),$.__webglDepthRenderbuffer&&n.deleteRenderbuffer($.__webglDepthRenderbuffer);if(O.isWebGLMultipleRenderTargets)for(let Ee=0,Ae=L.length;Ee=c&&console.warn("THREE.WebGLTextures: Trying to use "+O+" texture units while this GPU supports only "+c),X+=1,O}function re(O){let L=[];return L.push(O.wrapS),L.push(O.wrapT),L.push(O.magFilter),L.push(O.minFilter),L.push(O.anisotropy),L.push(O.internalFormat),L.push(O.format),L.push(O.type),L.push(O.generateMipmaps),L.push(O.premultiplyAlpha),L.push(O.flipY),L.push(O.unpackAlignment),L.push(O.encoding),L.join()}function ce(O,L){let $=r.get(O);if(O.isVideoTexture&&_t(O),O.isRenderTargetTexture===!1&&O.version>0&&$.__version!==O.version){let pe=O.image;if(pe===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(pe.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Qe($,O,L);return}}t.activeTexture(33984+L),t.bindTexture(3553,$.__webglTexture)}function ge(O,L){let $=r.get(O);if(O.version>0&&$.__version!==O.version){Qe($,O,L);return}t.activeTexture(33984+L),t.bindTexture(35866,$.__webglTexture)}function fe(O,L){let $=r.get(O);if(O.version>0&&$.__version!==O.version){Qe($,O,L);return}t.activeTexture(33984+L),t.bindTexture(32879,$.__webglTexture)}function ze(O,L){let $=r.get(O);if(O.version>0&&$.__version!==O.version){qe($,O,L);return}t.activeTexture(33984+L),t.bindTexture(34067,$.__webglTexture)}let $e={[Qf]:10497,[lr]:33071,[Jf]:33648},Xe={[_n]:9728,[cg]:9984,[fg]:9986,[hn]:9729,[fw]:9985,[El]:9987};function ue(O,L,$){if($?(n.texParameteri(O,10242,$e[L.wrapS]),n.texParameteri(O,10243,$e[L.wrapT]),(O===32879||O===35866)&&n.texParameteri(O,32882,$e[L.wrapR]),n.texParameteri(O,10240,Xe[L.magFilter]),n.texParameteri(O,10241,Xe[L.minFilter])):(n.texParameteri(O,10242,33071),n.texParameteri(O,10243,33071),(O===32879||O===35866)&&n.texParameteri(O,32882,33071),(L.wrapS!==lr||L.wrapT!==lr)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(O,10240,B(L.magFilter)),n.texParameteri(O,10241,B(L.minFilter)),L.minFilter!==_n&&L.minFilter!==hn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let pe=e.get("EXT_texture_filter_anisotropic");if(L.type===Os&&e.has("OES_texture_float_linear")===!1||u===!1&&L.type===Ya&&e.has("OES_texture_half_float_linear")===!1)return;(L.anisotropy>1||r.get(L).__currentAnisotropy)&&(n.texParameterf(O,pe.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(L.anisotropy,i.getMaxAnisotropy())),r.get(L).__currentAnisotropy=L.anisotropy)}}function dt(O,L){let $=!1;O.__webglInit===void 0&&(O.__webglInit=!0,L.addEventListener("dispose",A));let pe=L.source,Ee=_.get(pe);Ee===void 0&&(Ee={},_.set(pe,Ee));let Ae=re(L);if(Ae!==O.__cacheKey){Ee[Ae]===void 0&&(Ee[Ae]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,$=!0),Ee[Ae].usedTimes++;let He=Ee[O.__cacheKey];He!==void 0&&(Ee[O.__cacheKey].usedTimes--,He.usedTimes===0&&j(L)),O.__cacheKey=Ae,O.__webglTexture=Ee[Ae].texture}return $}function Qe(O,L,$){let pe=3553;L.isDataArrayTexture&&(pe=35866),L.isData3DTexture&&(pe=32879);let Ee=dt(O,L),Ae=L.source;if(t.activeTexture(33984+$),t.bindTexture(pe,O.__webglTexture),Ae.version!==Ae.__currentVersion||Ee===!0){n.pixelStorei(37440,L.flipY),n.pixelStorei(37441,L.premultiplyAlpha),n.pixelStorei(3317,L.unpackAlignment),n.pixelStorei(37443,0);let He=C(L)&&T(L.image)===!1,se=E(L.image,He,!1,d);se=bt(L,se);let Je=T(se)||u,et=s.convert(L.format,L.encoding),U=s.convert(L.type),N=I(L.internalFormat,et,U,L.encoding,L.isVideoTexture);ue(pe,L,Je);let le,de=L.mipmaps,Re=u&&L.isVideoTexture!==!0,Se=O.__version===void 0,Ve=G(L,se,Je);if(L.isDepthTexture)N=6402,u?L.type===Os?N=36012:L.type===Gf?N=33190:L.type===Za?N=35056:N=33189:L.type===Os&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),L.format===Ho&&N===6402&&L.type!==Wu&&L.type!==Gf&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),L.type=Wu,U=s.convert(L.type)),L.format===el&&N===6402&&(N=34041,L.type!==Za&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),L.type=Za,U=s.convert(L.type))),Re&&Se?t.texStorage2D(3553,1,N,se.width,se.height):t.texImage2D(3553,0,N,se.width,se.height,0,et,U,null);else if(L.isDataTexture)if(de.length>0&&Je){Re&&Se&&t.texStorage2D(3553,Ve,N,de[0].width,de[0].height);for(let _e=0,Be=de.length;_e0&&Je){Re&&Se&&t.texStorage2D(3553,Ve,N,de[0].width,de[0].height);for(let _e=0,Be=de.length;_e0&&Se++,t.texStorage2D(34067,Se,le,se[0].width,se[0].height));for(let _e=0;_e<6;_e++)if(He){de?t.texSubImage2D(34069+_e,0,0,0,se[_e].width,se[_e].height,U,N,se[_e].data):t.texImage2D(34069+_e,0,le,se[_e].width,se[_e].height,0,U,N,se[_e].data);for(let Be=0;Be0&&Oe(O)===!1){$.__webglMultisampledFramebuffer=n.createFramebuffer(),$.__webglColorRenderbuffer=n.createRenderbuffer(),n.bindRenderbuffer(36161,$.__webglColorRenderbuffer);let se=s.convert(L.format,L.encoding),Je=s.convert(L.type),et=I(L.internalFormat,se,Je,L.encoding),U=Ue(O);n.renderbufferStorageMultisample(36161,U,et,O.width,O.height),t.bindFramebuffer(36160,$.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(36160,36064,36161,$.__webglColorRenderbuffer),n.bindRenderbuffer(36161,null),O.depthBuffer&&($.__webglDepthRenderbuffer=n.createRenderbuffer(),je($.__webglDepthRenderbuffer,O,!0)),t.bindFramebuffer(36160,null)}if(Ee){t.bindTexture(34067,pe.__webglTexture),ue(34067,L,He);for(let se=0;se<6;se++)xe($.__webglFramebuffer[se],O,L,36064,34069+se);P(L,He)&&D(34067),t.unbindTexture()}else if(Ae){let se=O.texture;for(let Je=0,et=se.length;Je0&&Oe(O)===!1){let L=O.width,$=O.height,pe=16384,Ee=[36064],Ae=O.stencilBuffer?33306:36096;O.depthBuffer&&Ee.push(Ae);let He=r.get(O),se=He.__ignoreDepthValues!==void 0?He.__ignoreDepthValues:!1;se===!1&&(O.depthBuffer&&(pe|=256),O.stencilBuffer&&(pe|=1024)),t.bindFramebuffer(36008,He.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,He.__webglFramebuffer),se===!0&&(n.invalidateFramebuffer(36008,[Ae]),n.invalidateFramebuffer(36009,[Ae])),n.blitFramebuffer(0,0,L,$,0,0,L,$,pe,9728),g&&n.invalidateFramebuffer(36008,Ee),t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,He.__webglMultisampledFramebuffer)}}function Ue(O){return Math.min(p,O.samples)}function Oe(O){let L=r.get(O);return u&&O.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&L.__useRenderToTexture!==!1}function _t(O){let L=o.render.frame;x.get(O)!==L&&(x.set(O,L),O.update())}function bt(O,L){let $=O.encoding,pe=O.format,Ee=O.type;return O.isCompressedTexture===!0||O.isVideoTexture===!0||O.format===dg||$!==vi&&($===Dt?u===!1?e.has("EXT_sRGB")===!0&&pe===Hr?(O.format=dg,O.minFilter=hn,O.generateMipmaps=!1):L=ss.sRGBToLinear(L):(pe!==Hr||Ee!==jo)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",$)),L}this.allocateTextureUnit=W,this.resetTextureUnits=J,this.setTexture2D=ce,this.setTexture2DArray=ge,this.setTexture3D=fe,this.setTextureCube=ze,this.rebindTextures=ve,this.setupRenderTarget=Ie,this.updateRenderTargetMipmap=be,this.updateMultisampleRenderTarget=Ze,this.setupDepthRenderbuffer=ie,this.setupFrameBufferTexture=xe,this.useMultisampledRTT=Oe}function eA(n,e,t){let r=t.isWebGL2;function i(s,o=null){let u;if(s===jo)return 5121;if(s===_C)return 32819;if(s===wC)return 32820;if(s===vC)return 5120;if(s===yC)return 5122;if(s===Wu)return 5123;if(s===xC)return 5124;if(s===Gf)return 5125;if(s===Os)return 5126;if(s===Ya)return r?5131:(u=e.get("OES_texture_half_float"),u!==null?u.HALF_FLOAT_OES:null);if(s===SC)return 6406;if(s===Hr)return 6408;if(s===EC)return 6409;if(s===TC)return 6410;if(s===Ho)return 6402;if(s===el)return 34041;if(s===bC)return 6403;if(s===MC)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(s===dg)return u=e.get("EXT_sRGB"),u!==null?u.SRGB_ALPHA_EXT:null;if(s===CC)return 36244;if(s===AC)return 33319;if(s===PC)return 33320;if(s===RC)return 36249;if(s===ng||s===rg||s===ig||s===sg)if(o===Dt)if(u=e.get("WEBGL_compressed_texture_s3tc_srgb"),u!==null){if(s===ng)return u.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===rg)return u.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===ig)return u.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===sg)return u.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(u=e.get("WEBGL_compressed_texture_s3tc"),u!==null){if(s===ng)return u.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===rg)return u.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===ig)return u.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===sg)return u.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===z_||s===k_||s===F_||s===O_)if(u=e.get("WEBGL_compressed_texture_pvrtc"),u!==null){if(s===z_)return u.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===k_)return u.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===F_)return u.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===O_)return u.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===LC)return u=e.get("WEBGL_compressed_texture_etc1"),u!==null?u.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===B_||s===U_)if(u=e.get("WEBGL_compressed_texture_etc"),u!==null){if(s===B_)return o===Dt?u.COMPRESSED_SRGB8_ETC2:u.COMPRESSED_RGB8_ETC2;if(s===U_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:u.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===H_||s===V_||s===G_||s===W_||s===j_||s===X_||s===q_||s===Y_||s===Z_||s===Q_||s===J_||s===K_||s===$_||s===e1)if(u=e.get("WEBGL_compressed_texture_astc"),u!==null){if(s===H_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:u.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===V_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:u.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===G_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:u.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===W_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:u.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===j_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:u.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===X_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:u.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===q_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:u.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===Y_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:u.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===Z_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:u.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===Q_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:u.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===J_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:u.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===K_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:u.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===$_)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:u.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===e1)return o===Dt?u.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:u.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===t1)if(u=e.get("EXT_texture_compression_bptc"),u!==null){if(s===t1)return o===Dt?u.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:u.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;if(s===Za)return r?34042:(u=e.get("WEBGL_depth_texture"),u!==null?u.UNSIGNED_INT_24_8_WEBGL:null)}return{convert:i}}var id=class extends Lt{constructor(e=[]){super(),this.cameras=e}};id.prototype.isArrayCamera=!0;var Us=class extends st{constructor(){super(),this.type="Group"}};Us.prototype.isGroup=!0;var GF={type:"move"},jf=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Us,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Us,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new R,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new R),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Us,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new R,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new R),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,r){let i=null,s=null,o=null,u=this._targetRay,c=this._grip,f=this._hand;if(e&&t.session.visibilityState!=="visible-blurred")if(u!==null&&(i=t.getPose(e.targetRaySpace,r),i!==null&&(u.matrix.fromArray(i.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),i.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(i.linearVelocity)):u.hasLinearVelocity=!1,i.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(i.angularVelocity)):u.hasAngularVelocity=!1,this.dispatchEvent(GF))),f&&e.hand){o=!0;for(let y of e.hand.values()){let _=t.getJointPose(y,r);if(f.joints[y.jointName]===void 0){let w=new Us;w.matrixAutoUpdate=!1,w.visible=!1,f.joints[y.jointName]=w,f.add(w)}let S=f.joints[y.jointName];_!==null&&(S.matrix.fromArray(_.transform.matrix),S.matrix.decompose(S.position,S.rotation,S.scale),S.jointRadius=_.radius),S.visible=_!==null}let d=f.joints["index-finger-tip"],p=f.joints["thumb-tip"],m=d.position.distanceTo(p.position),g=.02,x=.005;f.inputState.pinching&&m>g+x?(f.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!f.inputState.pinching&&m<=g-x&&(f.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,r),s!==null&&(c.matrix.fromArray(s.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),s.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(s.linearVelocity)):c.hasLinearVelocity=!1,s.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(s.angularVelocity)):c.hasAngularVelocity=!1));return u!==null&&(u.visible=i!==null),c!==null&&(c.visible=s!==null),f!==null&&(f.visible=o!==null),this}},sd=class extends Wt{constructor(e,t,r,i,s,o,u,c,f,d){if(d=d!==void 0?d:Ho,d!==Ho&&d!==el)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&d===Ho&&(r=Wu),r===void 0&&d===el&&(r=Za),super(null,i,s,o,u,c,d,r,f),this.image={width:e,height:t},this.magFilter=u!==void 0?u:_n,this.minFilter=c!==void 0?c:_n,this.flipY=!1,this.generateMipmaps=!1}};sd.prototype.isDepthTexture=!0;var a1=class extends yi{constructor(e,t){super();let r=this,i=null,s=1,o=null,u="local-floor",c=null,f=null,d=null,p=null,m=null,g=t.getContextAttributes(),x=null,y=null,_=[],S=new Map,w=new Lt;w.layers.enable(1),w.viewport=new Tt;let E=new Lt;E.layers.enable(2),E.viewport=new Tt;let T=[w,E],C=new id;C.layers.enable(1),C.layers.enable(2);let P=null,D=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(W){let re=_[W];return re===void 0&&(re=new jf,_[W]=re),re.getTargetRaySpace()},this.getControllerGrip=function(W){let re=_[W];return re===void 0&&(re=new jf,_[W]=re),re.getGripSpace()},this.getHand=function(W){let re=_[W];return re===void 0&&(re=new jf,_[W]=re),re.getHandSpace()};function I(W){let re=S.get(W.inputSource);re&&re.dispatchEvent({type:W.type,data:W.inputSource})}function G(){S.forEach(function(W,re){W.disconnect(re)}),S.clear(),P=null,D=null,e.setRenderTarget(x),p=null,d=null,f=null,i=null,y=null,J.stop(),r.isPresenting=!1,r.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(W){s=W,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(W){u=W,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o},this.getBaseLayer=function(){return d!==null?d:p},this.getBinding=function(){return f},this.getFrame=function(){return m},this.getSession=function(){return i},this.setSession=async function(W){if(i=W,i!==null){if(x=e.getRenderTarget(),i.addEventListener("select",I),i.addEventListener("selectstart",I),i.addEventListener("selectend",I),i.addEventListener("squeeze",I),i.addEventListener("squeezestart",I),i.addEventListener("squeezeend",I),i.addEventListener("end",G),i.addEventListener("inputsourceschange",B),g.xrCompatible!==!0&&await t.makeXRCompatible(),i.renderState.layers===void 0||e.capabilities.isWebGL2===!1){let re={antialias:i.renderState.layers===void 0?g.antialias:!0,alpha:g.alpha,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:s};p=new XRWebGLLayer(i,t,re),i.updateRenderState({baseLayer:p}),y=new On(p.framebufferWidth,p.framebufferHeight,{format:Hr,type:jo,encoding:e.outputEncoding})}else{let re=null,ce=null,ge=null;g.depth&&(ge=g.stencil?35056:33190,re=g.stencil?el:Ho,ce=g.stencil?Za:Wu);let fe={colorFormat:e.outputEncoding===Dt?35907:32856,depthFormat:ge,scaleFactor:s};f=new XRWebGLBinding(i,t),d=f.createProjectionLayer(fe),i.updateRenderState({layers:[d]}),y=new On(d.textureWidth,d.textureHeight,{format:Hr,type:jo,depthTexture:new sd(d.textureWidth,d.textureHeight,ce,void 0,void 0,void 0,void 0,void 0,void 0,re),stencilBuffer:g.stencil,encoding:e.outputEncoding,samples:g.antialias?4:0});let ze=e.properties.get(y);ze.__ignoreDepthValues=d.ignoreDepthValues}y.isXRRenderTarget=!0,this.setFoveation(1),o=await i.requestReferenceSpace(u),J.setContext(i),J.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}};function B(W){let re=i.inputSources;for(let ce=0;ce<_.length;ce++)S.set(re[ce],_[ce]);for(let ce=0;ce0&&(y.alphaTest.value=_.alphaTest);let S=e.get(_).envMap;if(S&&(y.envMap.value=S,y.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=_.reflectivity,y.ior.value=_.ior,y.refractionRatio.value=_.refractionRatio),_.lightMap){y.lightMap.value=_.lightMap;let T=n.physicallyCorrectLights!==!0?Math.PI:1;y.lightMapIntensity.value=_.lightMapIntensity*T}_.aoMap&&(y.aoMap.value=_.aoMap,y.aoMapIntensity.value=_.aoMapIntensity);let w;_.map?w=_.map:_.specularMap?w=_.specularMap:_.displacementMap?w=_.displacementMap:_.normalMap?w=_.normalMap:_.bumpMap?w=_.bumpMap:_.roughnessMap?w=_.roughnessMap:_.metalnessMap?w=_.metalnessMap:_.alphaMap?w=_.alphaMap:_.emissiveMap?w=_.emissiveMap:_.clearcoatMap?w=_.clearcoatMap:_.clearcoatNormalMap?w=_.clearcoatNormalMap:_.clearcoatRoughnessMap?w=_.clearcoatRoughnessMap:_.specularIntensityMap?w=_.specularIntensityMap:_.specularColorMap?w=_.specularColorMap:_.transmissionMap?w=_.transmissionMap:_.thicknessMap?w=_.thicknessMap:_.sheenColorMap?w=_.sheenColorMap:_.sheenRoughnessMap&&(w=_.sheenRoughnessMap),w!==void 0&&(w.isWebGLRenderTarget&&(w=w.texture),w.matrixAutoUpdate===!0&&w.updateMatrix(),y.uvTransform.value.copy(w.matrix));let E;_.aoMap?E=_.aoMap:_.lightMap&&(E=_.lightMap),E!==void 0&&(E.isWebGLRenderTarget&&(E=E.texture),E.matrixAutoUpdate===!0&&E.updateMatrix(),y.uv2Transform.value.copy(E.matrix))}function s(y,_){y.diffuse.value.copy(_.color),y.opacity.value=_.opacity}function o(y,_){y.dashSize.value=_.dashSize,y.totalSize.value=_.dashSize+_.gapSize,y.scale.value=_.scale}function u(y,_,S,w){y.diffuse.value.copy(_.color),y.opacity.value=_.opacity,y.size.value=_.size*S,y.scale.value=w*.5,_.map&&(y.map.value=_.map),_.alphaMap&&(y.alphaMap.value=_.alphaMap),_.alphaTest>0&&(y.alphaTest.value=_.alphaTest);let E;_.map?E=_.map:_.alphaMap&&(E=_.alphaMap),E!==void 0&&(E.matrixAutoUpdate===!0&&E.updateMatrix(),y.uvTransform.value.copy(E.matrix))}function c(y,_){y.diffuse.value.copy(_.color),y.opacity.value=_.opacity,y.rotation.value=_.rotation,_.map&&(y.map.value=_.map),_.alphaMap&&(y.alphaMap.value=_.alphaMap),_.alphaTest>0&&(y.alphaTest.value=_.alphaTest);let S;_.map?S=_.map:_.alphaMap&&(S=_.alphaMap),S!==void 0&&(S.matrixAutoUpdate===!0&&S.updateMatrix(),y.uvTransform.value.copy(S.matrix))}function f(y,_){y.specular.value.copy(_.specular),y.shininess.value=Math.max(_.shininess,1e-4)}function d(y,_){_.gradientMap&&(y.gradientMap.value=_.gradientMap)}function p(y,_){y.roughness.value=_.roughness,y.metalness.value=_.metalness,_.roughnessMap&&(y.roughnessMap.value=_.roughnessMap),_.metalnessMap&&(y.metalnessMap.value=_.metalnessMap),e.get(_).envMap&&(y.envMapIntensity.value=_.envMapIntensity)}function m(y,_,S){y.ior.value=_.ior,_.sheen>0&&(y.sheenColor.value.copy(_.sheenColor).multiplyScalar(_.sheen),y.sheenRoughness.value=_.sheenRoughness,_.sheenColorMap&&(y.sheenColorMap.value=_.sheenColorMap),_.sheenRoughnessMap&&(y.sheenRoughnessMap.value=_.sheenRoughnessMap)),_.clearcoat>0&&(y.clearcoat.value=_.clearcoat,y.clearcoatRoughness.value=_.clearcoatRoughness,_.clearcoatMap&&(y.clearcoatMap.value=_.clearcoatMap),_.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=_.clearcoatRoughnessMap),_.clearcoatNormalMap&&(y.clearcoatNormalScale.value.copy(_.clearcoatNormalScale),y.clearcoatNormalMap.value=_.clearcoatNormalMap,_.side===Vr&&y.clearcoatNormalScale.value.negate())),_.transmission>0&&(y.transmission.value=_.transmission,y.transmissionSamplerMap.value=S.texture,y.transmissionSamplerSize.value.set(S.width,S.height),_.transmissionMap&&(y.transmissionMap.value=_.transmissionMap),y.thickness.value=_.thickness,_.thicknessMap&&(y.thicknessMap.value=_.thicknessMap),y.attenuationDistance.value=_.attenuationDistance,y.attenuationColor.value.copy(_.attenuationColor)),y.specularIntensity.value=_.specularIntensity,y.specularColor.value.copy(_.specularColor),_.specularIntensityMap&&(y.specularIntensityMap.value=_.specularIntensityMap),_.specularColorMap&&(y.specularColorMap.value=_.specularColorMap)}function g(y,_){_.matcap&&(y.matcap.value=_.matcap)}function x(y,_){y.referencePosition.value.copy(_.referencePosition),y.nearDistance.value=_.nearDistance,y.farDistance.value=_.farDistance}return{refreshFogUniforms:t,refreshMaterialUniforms:r}}function jF(){let n=nd("canvas");return n.style.display="block",n}function At(n={}){let e=n.canvas!==void 0?n.canvas:jF(),t=n.context!==void 0?n.context:null,r=n.depth!==void 0?n.depth:!0,i=n.stencil!==void 0?n.stencil:!0,s=n.antialias!==void 0?n.antialias:!1,o=n.premultipliedAlpha!==void 0?n.premultipliedAlpha:!0,u=n.preserveDrawingBuffer!==void 0?n.preserveDrawingBuffer:!1,c=n.powerPreference!==void 0?n.powerPreference:"default",f=n.failIfMajorPerformanceCaveat!==void 0?n.failIfMajorPerformanceCaveat:!1,d;n.context!==void 0?d=t.getContextAttributes().alpha:d=n.alpha!==void 0?n.alpha:!1;let p=null,m=null,g=[],x=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=vi,this.physicallyCorrectLights=!1,this.toneMapping=pi,this.toneMappingExposure=1;let y=this,_=!1,S=0,w=0,E=null,T=-1,C=null,P=new Tt,D=new Tt,I=null,G=e.width,B=e.height,A=1,F=null,ne=null,j=new Tt(0,0,G,B),Q=new Tt(0,0,G,B),X=!1,J=new nl,W=!1,re=!1,ce=null,ge=new Ne,fe=new oe,ze=new R,$e={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Xe(){return E===null?A:1}let ue=t;function dt(z,q){for(let ee=0;ee0?m=x[x.length-1]:m=null,g.pop(),g.length>0?p=g[g.length-1]:p=null};function Yr(z,q,ee,Z){if(z.visible===!1)return;if(z.layers.test(q.layers)){if(z.isGroup)ee=z.renderOrder;else if(z.isLOD)z.autoUpdate===!0&&z.update(q);else if(z.isLight)m.pushLight(z),z.castShadow&&m.pushShadow(z);else if(z.isSprite){if(!z.frustumCulled||J.intersectsSprite(z)){Z&&ze.setFromMatrixPosition(z.matrixWorld).applyMatrix4(ge);let tt=Ue.update(z),ot=z.material;ot.visible&&p.push(z,tt,ot,ee,ze.z,null)}}else if((z.isMesh||z.isLine||z.isPoints)&&(z.isSkinnedMesh&&z.skeleton.frame!==je.render.frame&&(z.skeleton.update(),z.skeleton.frame=je.render.frame),!z.frustumCulled||J.intersectsObject(z))){Z&&ze.setFromMatrixPosition(z.matrixWorld).applyMatrix4(ge);let tt=Ue.update(z),ot=z.material;if(Array.isArray(ot)){let it=tt.groups;for(let Ct=0,gt=it.length;Ct0&&Jd(he,q,ee),Z&&xe.viewport(P.copy(Z)),he.length>0&&Ll(he,q,ee),Ye.length>0&&Ll(Ye,q,ee),tt.length>0&&Ll(tt,q,ee),xe.buffers.depth.setTest(!0),xe.buffers.depth.setMask(!0),xe.buffers.color.setMask(!0),xe.setPolygonOffset(!1)}function Jd(z,q,ee){let Z=qe.isWebGL2;ce===null&&(ce=new On(1,1,{generateMipmaps:!0,type:se.convert(Ya)!==null?Ya:jo,minFilter:El,samples:Z&&s===!0?4:0})),y.getDrawingBufferSize(fe),Z?ce.setSize(fe.x,fe.y):ce.setSize(hg(fe.x),hg(fe.y));let he=y.getRenderTarget();y.setRenderTarget(ce),y.clear();let Ye=y.toneMapping;y.toneMapping=pi,Ll(z,q,ee),y.toneMapping=Ye,ie.updateMultisampleRenderTarget(ce),ie.updateRenderTargetMipmap(ce),y.setRenderTarget(he)}function Ll(z,q,ee){let Z=q.isScene===!0?q.overrideMaterial:null;for(let he=0,Ye=z.length;he0&&ie.useMultisampledRTT(z)===!1?he=ae.get(z).__webglMultisampledFramebuffer:he=Ct,P.copy(z.viewport),D.copy(z.scissor),I=z.scissorTest}else P.copy(j).multiplyScalar(A).floor(),D.copy(Q).multiplyScalar(A).floor(),I=X;if(xe.bindFramebuffer(36160,he)&&qe.drawBuffers&&Z&&xe.drawBuffers(z,he),xe.viewport(P),xe.scissor(D),xe.setScissorTest(I),Ye){let it=ae.get(z.texture);ue.framebufferTexture2D(36160,36064,34069+q,it.__webglTexture,ee)}else if(tt){let it=ae.get(z.texture),Ct=q||0;ue.framebufferTextureLayer(36160,36064,it.__webglTexture,ee||0,Ct)}T=-1},this.readRenderTargetPixels=function(z,q,ee,Z,he,Ye,tt){if(!(z&&z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ot=ae.get(z).__webglFramebuffer;if(z.isWebGLCubeRenderTarget&&tt!==void 0&&(ot=ot[tt]),ot){xe.bindFramebuffer(36160,ot);try{let it=z.texture,Ct=it.format,gt=it.type;if(Ct!==Hr&&se.convert(Ct)!==ue.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let vt=gt===Ya&&(Qe.has("EXT_color_buffer_half_float")||qe.isWebGL2&&Qe.has("EXT_color_buffer_float"));if(gt!==jo&&se.convert(gt)!==ue.getParameter(35738)&&!(gt===Os&&(qe.isWebGL2||Qe.has("OES_texture_float")||Qe.has("WEBGL_color_buffer_float")))&&!vt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}q>=0&&q<=z.width-Z&&ee>=0&&ee<=z.height-he&&ue.readPixels(q,ee,Z,he,se.convert(Ct),se.convert(gt),Ye)}finally{let it=E!==null?ae.get(E).__webglFramebuffer:null;xe.bindFramebuffer(36160,it)}}},this.copyFramebufferToTexture=function(z,q,ee=0){if(q.isFramebufferTexture!==!0){console.error("THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.");return}let Z=Math.pow(2,-ee),he=Math.floor(q.image.width*Z),Ye=Math.floor(q.image.height*Z);ie.setTexture2D(q,0),ue.copyTexSubImage2D(3553,ee,0,0,z.x,z.y,he,Ye),xe.unbindTexture()},this.copyTextureToTexture=function(z,q,ee,Z=0){let he=q.image.width,Ye=q.image.height,tt=se.convert(ee.format),ot=se.convert(ee.type);ie.setTexture2D(ee,0),ue.pixelStorei(37440,ee.flipY),ue.pixelStorei(37441,ee.premultiplyAlpha),ue.pixelStorei(3317,ee.unpackAlignment),q.isDataTexture?ue.texSubImage2D(3553,Z,z.x,z.y,he,Ye,tt,ot,q.image.data):q.isCompressedTexture?ue.compressedTexSubImage2D(3553,Z,z.x,z.y,q.mipmaps[0].width,q.mipmaps[0].height,tt,q.mipmaps[0].data):ue.texSubImage2D(3553,Z,z.x,z.y,tt,ot,q.image),Z===0&&ee.generateMipmaps&&ue.generateMipmap(3553),xe.unbindTexture()},this.copyTextureToTexture3D=function(z,q,ee,Z,he=0){if(y.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Ye=z.max.x-z.min.x+1,tt=z.max.y-z.min.y+1,ot=z.max.z-z.min.z+1,it=se.convert(Z.format),Ct=se.convert(Z.type),gt;if(Z.isData3DTexture)ie.setTexture3D(Z,0),gt=32879;else if(Z.isDataArrayTexture)ie.setTexture2DArray(Z,0),gt=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}ue.pixelStorei(37440,Z.flipY),ue.pixelStorei(37441,Z.premultiplyAlpha),ue.pixelStorei(3317,Z.unpackAlignment);let vt=ue.getParameter(3314),Ht=ue.getParameter(32878),ms=ue.getParameter(3316),$s=ue.getParameter(3315),eo=ue.getParameter(32877),Zr=ee.isCompressedTexture?ee.mipmaps[0]:ee.image;ue.pixelStorei(3314,Zr.width),ue.pixelStorei(32878,Zr.height),ue.pixelStorei(3316,z.min.x),ue.pixelStorei(3315,z.min.y),ue.pixelStorei(32877,z.min.z),ee.isDataTexture||ee.isData3DTexture?ue.texSubImage3D(gt,he,q.x,q.y,q.z,Ye,tt,ot,it,Ct,Zr.data):ee.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ue.compressedTexSubImage3D(gt,he,q.x,q.y,q.z,Ye,tt,ot,it,Zr.data)):ue.texSubImage3D(gt,he,q.x,q.y,q.z,Ye,tt,ot,it,Ct,Zr),ue.pixelStorei(3314,vt),ue.pixelStorei(32878,Ht),ue.pixelStorei(3316,ms),ue.pixelStorei(3315,$s),ue.pixelStorei(32877,eo),he===0&&Z.generateMipmaps&&ue.generateMipmap(gt),xe.unbindTexture()},this.initTexture=function(z){ie.setTexture2D(z,0),xe.unbindTexture()},this.resetState=function(){S=0,w=0,E=null,xe.reset(),Je.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}At.prototype.isWebGLRenderer=!0;var Eg=class extends At{};Eg.prototype.isWebGL1Renderer=!0;var rl=class{constructor(e,t=25e-5){this.name="",this.color=new we(e),this.density=t}clone(){return new rl(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};rl.prototype.isFogExp2=!0;var il=class{constructor(e,t=1,r=1e3){this.name="",this.color=new we(e),this.near=t,this.far=r}clone(){return new il(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};il.prototype.isFog=!0;var Zo=class extends st{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};Zo.prototype.isScene=!0;var Ws=class{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=ju,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Gr()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,r){e*=this.stride,r*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:c,point:Ff.clone(),uv:Jt.getUV(Ff,zm,Bf,km,$b,__,e3,new oe),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};tc.prototype.isSprite=!0;function Fm(n,e,t,r,i,s){Bu.subVectors(n,t).addScalar(.5).multiply(r),i!==void 0?(Of.x=s*Bu.x-i*Bu.y,Of.y=i*Bu.x+s*Bu.y):Of.copy(Bu),n.copy(e),n.x+=Of.x,n.y+=Of.y,n.applyMatrix4(tA)}var Om=new R,t3=new R,Tg=class extends st{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let r=0,i=t.length;r0){let r,i;for(r=1,i=t.length;r0){Om.setFromMatrixPosition(this.matrixWorld);let i=e.ray.origin.distanceTo(Om);this.getObjectForDistance(i).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){Om.setFromMatrixPosition(e.matrixWorld),t3.setFromMatrixPosition(this.matrixWorld);let r=Om.distanceTo(t3)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;ic)continue;m.applyMatrix4(this.matrixWorld);let I=e.ray.origin.distanceTo(m);Ie.far||t.push({distance:I,point:p.clone().applyMatrix4(this.matrixWorld),index:E,face:null,faceIndex:null,object:this})}}else{let S=Math.max(0,o.start),w=Math.min(_.count,o.start+o.count);for(let E=S,T=w-1;Ec)continue;m.applyMatrix4(this.matrixWorld);let P=e.ray.origin.distanceTo(m);Pe.far||t.push({distance:P,point:p.clone().applyMatrix4(this.matrixWorld),index:E,face:null,faceIndex:null,object:this})}}}else r.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,r=Object.keys(t);if(r.length>0){let i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};xi.prototype.isLine=!0;var d3=new R,h3=new R,$n=class extends xi{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,r=[];for(let i=0,s=t.count;i0){let i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};sl.prototype.isPoints=!0;function m3(n,e,t,r,i,s,o){let u=l1.distanceSqToPoint(n);if(ui.far)return;s.push({distance:f,distanceToRay:Math.sqrt(u),point:c,index:e,face:null,object:o})}}var bg=class extends Wt{constructor(e,t,r,i,s,o,u,c,f){super(e,t,r,i,s,o,u,c,f),this.minFilter=o!==void 0?o:hn,this.magFilter=s!==void 0?s:hn,this.generateMipmaps=!1;let d=this;function p(){d.needsUpdate=!0,e.requestVideoFrameCallback(p)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(p)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};bg.prototype.isVideoTexture=!0;var Cg=class extends Wt{constructor(e,t,r){super({width:e,height:t}),this.format=r,this.magFilter=_n,this.minFilter=_n,this.generateMipmaps=!1,this.needsUpdate=!0}};Cg.prototype.isFramebufferTexture=!0;var ld=class extends Wt{constructor(e,t,r,i,s,o,u,c,f,d,p,m){super(null,o,u,c,f,d,i,s,p,m),this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}};ld.prototype.isCompressedTexture=!0;var Ag=class extends Wt{constructor(e,t,r,i,s,o,u,c,f){super(e,t,r,i,s,o,u,c,f),this.needsUpdate=!0}};Ag.prototype.isCanvasTexture=!0;var fr=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){let r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){let t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){let t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t}getLength(){let e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let t=[],r,i=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)r=this.getPoint(o/e),s+=r.distanceTo(i),t.push(s),i=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){let r=this.getLengths(),i=0,s=r.length,o;t?o=t:o=e*r[s-1];let u=0,c=s-1,f;for(;u<=c;)if(i=Math.floor(u+(c-u)/2),f=r[i]-o,f<0)u=i+1;else if(f>0)c=i-1;else{c=i;break}if(i=c,r[i]===o)return i/(s-1);let d=r[i],m=r[i+1]-d,g=(o-d)/m;return(i+g)/(s-1)}getTangent(e,t){let i=e-1e-4,s=e+1e-4;i<0&&(i=0),s>1&&(s=1);let o=this.getPoint(i),u=this.getPoint(s),c=t||(o.isVector2?new oe:new R);return c.copy(u).sub(o).normalize(),c}getTangentAt(e,t){let r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t){let r=new R,i=[],s=[],o=[],u=new R,c=new Ne;for(let g=0;g<=e;g++){let x=g/e;i[g]=this.getTangentAt(x,new R)}s[0]=new R,o[0]=new R;let f=Number.MAX_VALUE,d=Math.abs(i[0].x),p=Math.abs(i[0].y),m=Math.abs(i[0].z);d<=f&&(f=d,r.set(1,0,0)),p<=f&&(f=p,r.set(0,1,0)),m<=f&&r.set(0,0,1),u.crossVectors(i[0],r).normalize(),s[0].crossVectors(i[0],u),o[0].crossVectors(i[0],s[0]);for(let g=1;g<=e;g++){if(s[g]=s[g-1].clone(),o[g]=o[g-1].clone(),u.crossVectors(i[g-1],i[g]),u.length()>Number.EPSILON){u.normalize();let x=Math.acos(pn(i[g-1].dot(i[g]),-1,1));s[g].applyMatrix4(c.makeRotationAxis(u,x))}o[g].crossVectors(i[g],s[g])}if(t===!0){let g=Math.acos(pn(s[0].dot(s[e]),-1,1));g/=e,i[0].dot(u.crossVectors(s[0],s[e]))>0&&(g=-g);for(let x=1;x<=e;x++)s[x].applyMatrix4(c.makeRotationAxis(i[x],g*x)),o[x].crossVectors(i[x],s[x])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},ol=class extends fr{constructor(e=0,t=0,r=1,i=1,s=0,o=Math.PI*2,u=!1,c=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=u,this.aRotation=c}getPoint(e,t){let r=t||new oe,i=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(u)/s)+1)*s:c===0&&u===s-1&&(u=s-2,c=1);let f,d;this.closed||u>0?f=i[(u-1)%s]:(Gm.subVectors(i[0],i[1]).add(i[0]),f=Gm);let p=i[u%s],m=i[(u+1)%s];if(this.closed||u+2i.length-2?i.length-1:o+1],p=i[o>i.length-3?i.length-1:o+2];return r.set(g3(u,c.x,f.x,d.x,p.x),g3(u,c.y,f.y,d.y,p.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t=r){let o=i[s]-r,u=this.curves[s],c=u.getLength(),f=c===0?0:1-o/c;return u.getPointAt(f,t)}s++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let r=0,i=this.curves.length;r1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,r=e.curves.length;t0){let p=f.getPoint(0);p.equals(this.currentPoint)||this.lineTo(p.x,p.y)}this.curves.push(f);let d=f.getPoint(1);return this.currentPoint.copy(d),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},Jo=class extends We{constructor(e=[new oe(0,.5),new oe(.5,0),new oe(0,-.5)],t=12,r=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:i},t=Math.floor(t),i=pn(i,0,Math.PI*2);let s=[],o=[],u=[],c=[],f=[],d=1/t,p=new R,m=new oe,g=new R,x=new R,y=new R,_=0,S=0;for(let w=0;w<=e.length-1;w++)switch(w){case 0:_=e[w+1].x-e[w].x,S=e[w+1].y-e[w].y,g.x=S*1,g.y=-_,g.z=S*0,y.copy(g),g.normalize(),c.push(g.x,g.y,g.z);break;case e.length-1:c.push(y.x,y.y,y.z);break;default:_=e[w+1].x-e[w].x,S=e[w+1].y-e[w].y,g.x=S*1,g.y=-_,g.z=S*0,x.copy(g),g.x+=y.x,g.y+=y.y,g.z+=y.z,g.normalize(),c.push(g.x,g.y,g.z),y.copy(x)}for(let w=0;w<=t;w++){let E=r+w*d*i,T=Math.sin(E),C=Math.cos(E);for(let P=0;P<=e.length-1;P++){p.x=e[P].x*T,p.y=e[P].y,p.z=e[P].x*C,o.push(p.x,p.y,p.z),m.x=w/t,m.y=P/(e.length-1),u.push(m.x,m.y);let D=c[3*P+0]*T,I=c[3*P+1],G=c[3*P+0]*C;f.push(D,I,G)}}for(let w=0;w0&&E(!0),t>0&&E(!1)),this.setIndex(d),this.setAttribute("position",new De(p,3)),this.setAttribute("normal",new De(m,3)),this.setAttribute("uv",new De(g,2));function w(){let T=new R,C=new R,P=0,D=(t-e)/r;for(let I=0;I<=s;I++){let G=[],B=I/s,A=B*(t-e)+e;for(let F=0;F<=i;F++){let ne=F/i,j=ne*c+u,Q=Math.sin(j),X=Math.cos(j);C.x=A*Q,C.y=-B*r+_,C.z=A*X,p.push(C.x,C.y,C.z),T.set(Q,D,X).normalize(),m.push(T.x,T.y,T.z),g.push(ne,1-B),G.push(x++)}y.push(G)}for(let I=0;I.9&&D<.1&&(E<.2&&(o[w+0]+=1),T<.2&&(o[w+2]+=1),C<.2&&(o[w+4]+=1))}}function m(w){s.push(w.x,w.y,w.z)}function g(w,E){let T=w*3;E.x=e[T+0],E.y=e[T+1],E.z=e[T+2]}function x(){let w=new R,E=new R,T=new R,C=new R,P=new oe,D=new oe,I=new oe;for(let G=0,B=0;G80*t){u=f=n[0],c=d=n[1];for(let x=t;xf&&(f=p),m>d&&(d=m);g=Math.max(f-u,d-c),g=g!==0?1/g:0}return hd(s,o,t,u,c,g),o}};function nA(n,e,t,r,i){let s,o;if(i===v4(n,e,t,r)>0)for(s=e;s=e;s-=r)o=v3(s,n[s],n[s+1],o);return o&&u0(o,o.next)&&(md(o),o=o.next),o}function Ko(n,e){if(!n)return n;e||(e=n);let t=n,r;do if(r=!1,!t.steiner&&(u0(t,t.next)||Kt(t.prev,t,t.next)===0)){if(md(t),t=e=t.prev,t===t.next)break;r=!0}else t=t.next;while(r||t!==e);return e}function hd(n,e,t,r,i,s,o){if(!n)return;!o&&s&&f4(n,r,i,s);let u=n,c,f;for(;n.prev!==n.next;){if(c=n.prev,f=n.next,s?r4(n,r,i,s):n4(n)){e.push(c.i/t),e.push(n.i/t),e.push(f.i/t),md(n),n=f.next,u=f.next;continue}if(n=f,n===u){o?o===1?(n=i4(Ko(n),e,t),hd(n,e,t,r,i,s,2)):o===2&&s4(n,e,t,r,i,s):hd(Ko(n),e,t,r,i,s,1);break}}}function n4(n){let e=n.prev,t=n,r=n.next;if(Kt(e,t,r)>=0)return!1;let i=n.next.next;for(;i!==n.prev;){if(Gu(e.x,e.y,t.x,t.y,r.x,r.y,i.x,i.y)&&Kt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function r4(n,e,t,r){let i=n.prev,s=n,o=n.next;if(Kt(i,s,o)>=0)return!1;let u=i.xs.x?i.x>o.x?i.x:o.x:s.x>o.x?s.x:o.x,d=i.y>s.y?i.y>o.y?i.y:o.y:s.y>o.y?s.y:o.y,p=u1(u,c,e,t,r),m=u1(f,d,e,t,r),g=n.prevZ,x=n.nextZ;for(;g&&g.z>=p&&x&&x.z<=m;){if(g!==n.prev&&g!==n.next&&Gu(i.x,i.y,s.x,s.y,o.x,o.y,g.x,g.y)&&Kt(g.prev,g,g.next)>=0||(g=g.prevZ,x!==n.prev&&x!==n.next&&Gu(i.x,i.y,s.x,s.y,o.x,o.y,x.x,x.y)&&Kt(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;g&&g.z>=p;){if(g!==n.prev&&g!==n.next&&Gu(i.x,i.y,s.x,s.y,o.x,o.y,g.x,g.y)&&Kt(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;x&&x.z<=m;){if(x!==n.prev&&x!==n.next&&Gu(i.x,i.y,s.x,s.y,o.x,o.y,x.x,x.y)&&Kt(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function i4(n,e,t){let r=n;do{let i=r.prev,s=r.next.next;!u0(i,s)&&rA(i,r,r.next,s)&&pd(i,s)&&pd(s,i)&&(e.push(i.i/t),e.push(r.i/t),e.push(s.i/t),md(r),md(r.next),r=n=s),r=r.next}while(r!==n);return Ko(r)}function s4(n,e,t,r,i,s){let o=n;do{let u=o.next.next;for(;u!==o.prev;){if(o.i!==u.i&&p4(o,u)){let c=iA(o,u);o=Ko(o,o.next),c=Ko(c,c.next),hd(o,e,t,r,i,s),hd(c,e,t,r,i,s);return}u=u.next}o=o.next}while(o!==n)}function o4(n,e,t,r){let i=[],s,o,u,c,f;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){let m=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(m<=r&&m>s){if(s=m,m===r){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x=t.x&&t.x>=c&&r!==t.x&&Gu(io.x||t.x===o.x&&c4(o,t)))&&(o=t,d=p)),t=t.next;while(t!==u);return o}function c4(n,e){return Kt(n.prev,n,e.prev)<0&&Kt(e.next,n,n.next)<0}function f4(n,e,t,r){let i=n;do i.z===null&&(i.z=u1(i.x,i.y,e,t,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==n);i.prevZ.nextZ=null,i.prevZ=null,d4(i)}function d4(n){let e,t,r,i,s,o,u,c,f=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,r=t,u=0,e=0;e0||c>0&&r;)u!==0&&(c===0||!r||t.z<=r.z)?(i=t,t=t.nextZ,u--):(i=r,r=r.nextZ,c--),s?s.nextZ=i:n=i,i.prevZ=s,s=i;t=r}s.nextZ=null,f*=2}while(o>1);return n}function u1(n,e,t,r,i){return n=32767*(n-t)*i,e=32767*(e-r)*i,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function h4(n){let e=n,t=n;do(e.x=0&&(n-o)*(r-u)-(t-o)*(e-u)>=0&&(t-o)*(s-u)-(i-o)*(r-u)>=0}function p4(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!m4(n,e)&&(pd(n,e)&&pd(e,n)&&g4(n,e)&&(Kt(n.prev,n,e.prev)||Kt(n,e.prev,e))||u0(n,e)&&Kt(n.prev,n,n.next)>0&&Kt(e.prev,e,e.next)>0)}function Kt(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function u0(n,e){return n.x===e.x&&n.y===e.y}function rA(n,e,t,r){let i=Ym(Kt(n,e,t)),s=Ym(Kt(n,e,r)),o=Ym(Kt(t,r,n)),u=Ym(Kt(t,r,e));return!!(i!==s&&o!==u||i===0&&qm(n,t,e)||s===0&&qm(n,r,e)||o===0&&qm(t,n,r)||u===0&&qm(t,e,r))}function qm(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Ym(n){return n>0?1:n<0?-1:0}function m4(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&rA(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function pd(n,e){return Kt(n.prev,n,n.next)<0?Kt(n,e,n.next)>=0&&Kt(n,n.prev,e)>=0:Kt(n,e,n.prev)<0||Kt(n,n.next,e)<0}function g4(n,e){let t=n,r=!1,i=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==n);return r}function iA(n,e){let t=new c1(n.i,n.x,n.y),r=new c1(e.i,e.x,e.y),i=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=i,i.prev=t,r.next=t,t.prev=r,s.next=r,r.prev=s,r}function v3(n,e,t,r){let i=new c1(n,e,t);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function md(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function c1(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function v4(n,e,t,r){let i=0;for(let s=e,o=t-r;s2&&n[e-1].equals(n[0])&&n.pop()}function x3(n,e){for(let t=0;tNumber.EPSILON){let $=Math.sqrt(O),pe=Math.sqrt(_t*_t+bt*bt),Ee=ie.x-Oe/$,Ae=ie.y+Ue/$,He=ve.x-bt/pe,se=ve.y+_t/pe,Je=((He-Ee)*bt-(se-Ae)*_t)/(Ue*bt-Oe*_t);Ie=Ee+Ue*Je-ae.x,be=Ae+Oe*Je-ae.y;let et=Ie*Ie+be*be;if(et<=2)return new oe(Ie,be);Ze=Math.sqrt(et/2)}else{let $=!1;Ue>Number.EPSILON?_t>Number.EPSILON&&($=!0):Ue<-Number.EPSILON?_t<-Number.EPSILON&&($=!0):Math.sign(Oe)===Math.sign(bt)&&($=!0),$?(Ie=-Oe,be=Ue,Ze=Math.sqrt(O)):(Ie=Ue,be=Oe,Ze=Math.sqrt(O/2))}return new oe(Ie/Ze,be/Ze)}let re=[];for(let ae=0,ie=j.length,ve=ie-1,Ie=ae+1;ae=0;ae--){let ie=ae/_,ve=g*Math.cos(ie*Math.PI/2),Ie=x*Math.sin(ie*Math.PI/2)+y;for(let be=0,Ze=j.length;be=0;){let Ie=ve,be=ve-1;be<0&&(be=ae.length-1);for(let Ze=0,Ue=d+_*2;Ze0)&&g.push(E,T,P),(S!==r-1||c0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}};xd.prototype.isMeshPhysicalMaterial=!0;var _d=class extends $t{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new we(16777215),this.specular=new we(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new we(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Tl,this.normalScale=new oe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Ud,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}};_d.prototype.isMeshPhongMaterial=!0;var wd=class extends $t{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new we(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new we(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Tl,this.normalScale=new oe(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.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}};wd.prototype.isMeshToonMaterial=!0;var Sd=class extends $t{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Tl,this.normalScale=new oe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}};Sd.prototype.isMeshNormalMaterial=!0;var Md=class extends $t{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new we(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new we(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Ud,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}};Md.prototype.isMeshLambertMaterial=!0;var Ed=class extends $t{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new we(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Tl,this.normalScale=new oe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this}};Ed.prototype.isMeshMatcapMaterial=!0;var Td=class extends wn{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}};Td.prototype.isLineDashedMaterial=!0;var w4={ShadowMaterial:vd,SpriteMaterial:ec,RawShaderMaterial:yd,ShaderMaterial:br,PointsMaterial:Xs,MeshPhysicalMaterial:xd,MeshStandardMaterial:uc,MeshPhongMaterial:_d,MeshToonMaterial:wd,MeshNormalMaterial:Sd,MeshLambertMaterial:Md,MeshDepthMaterial:Ku,MeshDistanceMaterial:$u,MeshBasicMaterial:Bi,MeshMatcapMaterial:Ed,LineDashedMaterial:Td,LineBasicMaterial:wn,Material:$t};$t.fromType=function(n){return new w4[n]};var Ut={arraySlice:function(n,e,t){return Ut.isTypedArray(n)?new n.constructor(n.subarray(e,t!==void 0?t:n.length)):n.slice(e,t)},convertArray:function(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)},isTypedArray:function(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)},getKeyframeOrder:function(n){function e(i,s){return n[i]-n[s]}let t=n.length,r=new Array(t);for(let i=0;i!==t;++i)r[i]=i;return r.sort(e),r},sortedArray:function(n,e,t){let r=n.length,i=new n.constructor(r);for(let s=0,o=0;o!==r;++s){let u=t[s]*e;for(let c=0;c!==e;++c)i[o++]=n[u+c]}return i},flattenJSON:function(n,e,t,r){let i=1,s=n[0];for(;s!==void 0&&s[r]===void 0;)s=n[i++];if(s===void 0)return;let o=s[r];if(o!==void 0)if(Array.isArray(o))do o=s[r],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[i++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[r],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[i++];while(s!==void 0);else do o=s[r],o!==void 0&&(e.push(s.time),t.push(o)),s=n[i++];while(s!==void 0)},subclip:function(n,e,t,r,i=30){let s=n.clone();s.name=e;let o=[];for(let c=0;c=r)){p.push(f.times[g]);for(let y=0;ys.tracks[c].times[0]&&(u=s.tracks[c].times[0]);for(let c=0;c=u.times[x]){let S=x*p+d,w=S+p-d;y=Ut.arraySlice(u.values,S,w)}else{let S=u.createInterpolant(),w=d,E=p-d;S.evaluate(s),y=Ut.arraySlice(S.resultBuffer,w,E)}c==="quaternion"&&new on().fromArray(y).normalize().conjugate().toArray(y);let _=f.times.length;for(let S=0;S<_;++S){let w=S*g+m;if(c==="quaternion")on.multiplyQuaternionsFlat(f.values,w,y,0,f.values,w);else{let E=g-m*2;for(let T=0;T=s)){let u=t[1];e=s)break t}o=r,r=0;break n}break e}for(;r>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let u=this.getValueSize();this.times=Ut.arraySlice(r,s,o),this.values=Ut.arraySlice(this.values,s*u,o*u)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let r=this.times,i=this.values,s=r.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let u=0;u!==s;u++){let c=r[u];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,u,c),e=!1;break}if(o!==null&&o>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,u,c,o),e=!1;break}o=c}if(i!==void 0&&Ut.isTypedArray(i))for(let u=0,c=i.length;u!==c;++u){let f=i[u];if(isNaN(f)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,u,f),e=!1;break}}return e}optimize(){let e=Ut.arraySlice(this.times),t=Ut.arraySlice(this.values),r=this.getValueSize(),i=this.getInterpolation()===og,s=e.length-1,o=1;for(let u=1;u0){e[o]=e[s];for(let u=s*r,c=o*r,f=0;f!==r;++f)t[c+f]=t[u+f];++o}return o!==e.length?(this.times=Ut.arraySlice(e,0,o),this.values=Ut.arraySlice(t,0,o*r)):(this.times=e,this.values=t),this}clone(){let e=Ut.arraySlice(this.times,0),t=Ut.arraySlice(this.values,0),r=this.constructor,i=new r(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}};jr.prototype.TimeBufferType=Float32Array;jr.prototype.ValueBufferType=Float32Array;jr.prototype.DefaultInterpolation=$f;var Zs=class extends jr{};Zs.prototype.ValueTypeName="bool";Zs.prototype.ValueBufferType=Array;Zs.prototype.DefaultInterpolation=Kf;Zs.prototype.InterpolantFactoryMethodLinear=void 0;Zs.prototype.InterpolantFactoryMethodSmooth=void 0;var Cd=class extends jr{};Cd.prototype.ValueTypeName="color";var yl=class extends jr{};yl.prototype.ValueTypeName="number";var Ig=class extends Vi{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e,t,r,i){let s=this.resultBuffer,o=this.sampleValues,u=this.valueSize,c=(r-t)/(i-t),f=e*u;for(let d=f+u;f!==d;f+=4)on.slerpFlat(s,0,o,f-u,o,f,c);return s}},ta=class extends jr{InterpolantFactoryMethodLinear(e){return new Ig(this.times,this.values,this.getValueSize(),e)}};ta.prototype.ValueTypeName="quaternion";ta.prototype.DefaultInterpolation=$f;ta.prototype.InterpolantFactoryMethodSmooth=void 0;var Qs=class extends jr{};Qs.prototype.ValueTypeName="string";Qs.prototype.ValueBufferType=Array;Qs.prototype.DefaultInterpolation=Kf;Qs.prototype.InterpolantFactoryMethodLinear=void 0;Qs.prototype.InterpolantFactoryMethodSmooth=void 0;var xl=class extends jr{};xl.prototype.ValueTypeName="vector";var _l=class{constructor(e,t=-1,r,i=a0){this.name=e,this.tracks=r,this.duration=t,this.blendMode=i,this.uuid=Gr(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],r=e.tracks,i=1/(e.fps||1);for(let o=0,u=r.length;o!==u;++o)t.push(M4(r[o]).scale(i));let s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){let t=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=r.length;s!==o;++s)t.push(jr.toJSON(r[s]));return i}static CreateFromMorphTargetSequence(e,t,r,i){let s=t.length,o=[];for(let u=0;u1){let p=d[1],m=i[p];m||(i[p]=m=[]),m.push(f)}}let o=[];for(let u in i)o.push(this.CreateFromMorphTargetSequence(u,i[u],t,r));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let r=function(p,m,g,x,y){if(g.length!==0){let _=[],S=[];Ut.flattenJSON(g,_,S,x),_.length!==0&&y.push(new p(m,_,S))}},i=[],s=e.name||"default",o=e.fps||30,u=e.blendMode,c=e.length||-1,f=e.hierarchy||[];for(let p=0;p{t&&t(s),this.manager.itemEnd(e)},0),s;if(Fs[e]!==void 0){Fs[e].push({onLoad:t,onProgress:r,onError:i});return}Fs[e]=[],Fs[e].push({onLoad:t,onProgress:r,onError:i});let o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),u=this.mimeType,c=this.responseType;fetch(o).then(f=>{if(f.status===200||f.status===0){if(f.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||f.body===void 0||f.body.getReader===void 0)return f;let d=Fs[e],p=f.body.getReader(),m=f.headers.get("Content-Length"),g=m?parseInt(m):0,x=g!==0,y=0,_=new ReadableStream({start(S){w();function w(){p.read().then(({done:E,value:T})=>{if(E)S.close();else{y+=T.byteLength;let C=new ProgressEvent("progress",{lengthComputable:x,loaded:y,total:g});for(let P=0,D=d.length;P{switch(c){case"arraybuffer":return f.arrayBuffer();case"blob":return f.blob();case"document":return f.text().then(d=>new DOMParser().parseFromString(d,u));case"json":return f.json();default:if(u===void 0)return f.text();{let p=/charset="?([^;"\s]*)"?/i.exec(u),m=p&&p[1]?p[1].toLowerCase():void 0,g=new TextDecoder(m);return f.arrayBuffer().then(x=>g.decode(x))}}}).then(f=>{wl.add(e,f);let d=Fs[e];delete Fs[e];for(let p=0,m=d.length;p{let d=Fs[e];if(d===void 0)throw this.manager.itemError(e),f;delete Fs[e];for(let p=0,m=d.length;p{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}},f1=class extends Bn{constructor(e){super(e)}load(e,t,r,i){let s=this,o=new _i(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(u){try{t(s.parse(JSON.parse(u)))}catch(c){i?i(c):console.error(c),s.manager.itemError(e)}},r,i)}parse(e){let t=[];for(let r=0;r0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(let s in e.uniforms){let o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=r(o.value);break;case"c":i.uniforms[s].value=new we().setHex(o.value);break;case"v2":i.uniforms[s].value=new oe().fromArray(o.value);break;case"v3":i.uniforms[s].value=new R().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Tt().fromArray(o.value);break;case"m3":i.uniforms[s].value=new mn().fromArray(o.value);break;case"m4":i.uniforms[s].value=new Ne().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(let s in e.extensions)i.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=r(e.map)),e.matcap!==void 0&&(i.matcap=r(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=r(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=r(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=r(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new oe().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=r(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=r(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=r(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=r(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=r(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=r(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=r(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=r(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=r(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=r(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=r(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=r(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=r(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new oe().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=r(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=r(e.thicknessMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=r(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=r(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}},cc=class{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let r=0,i=e.length;r0){let c=new Ad(t);s=new Sl(c),s.setCrossOrigin(this.crossOrigin);for(let f=0,d=e.length;f0){i=new Sl(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,u=e.length;o"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let s=this,o=wl.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;let u={};u.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",u.headers=this.requestHeader,fetch(e,u).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(c){wl.add(e,c),t&&t(c),s.manager.itemEnd(e)}).catch(function(c){i&&i(c),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}};Vg.prototype.isImageBitmapLoader=!0;var Zm,vw={getContext:function(){return Zm===void 0&&(Zm=new(window.AudioContext||window.webkitAudioContext)),Zm},setContext:function(n){Zm=n}},Gg=class extends Bn{constructor(e){super(e)}load(e,t,r,i){let s=this,o=new _i(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(u){try{let c=u.slice(0);vw.getContext().decodeAudioData(c,function(d){t(d)})}catch(c){i?i(c):console.error(c),s.manager.itemError(e)}},r,i)}},Wg=class extends Ml{constructor(e,t,r=1){super(void 0,r);let i=new we().set(e),s=new we().set(t),o=new R(i.r,i.g,i.b),u=new R(s.r,s.g,s.b),c=Math.sqrt(Math.PI),f=c*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(u).multiplyScalar(c),this.sh.coefficients[1].copy(o).sub(u).multiplyScalar(f)}};Wg.prototype.isHemisphereLightProbe=!0;var jg=class extends Ml{constructor(e,t=1){super(void 0,t);let r=new we().set(e);this.sh.coefficients[0].set(r.r,r.g,r.b).multiplyScalar(2*Math.sqrt(Math.PI))}};jg.prototype.isAmbientLightProbe=!0;var A3=new Ne,P3=new Ne,Fa=new Ne,p1=class{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Lt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Lt,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(e){let t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Fa.copy(e.projectionMatrix);let i=t.eyeSep/2,s=i*t.near/t.focus,o=t.near*Math.tan(Qa*t.fov*.5)/t.zoom,u,c;P3.elements[12]=-i,A3.elements[12]=i,u=-o*t.aspect+s,c=o*t.aspect+s,Fa.elements[0]=2*t.near/(c-u),Fa.elements[8]=(c+u)/(c-u),this.cameraL.projectionMatrix.copy(Fa),u=-o*t.aspect-s,c=o*t.aspect-s,Fa.elements[0]=2*t.near/(c-u),Fa.elements[8]=(c+u)/(c-u),this.cameraR.projectionMatrix.copy(Fa)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(P3),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(A3)}},fc=class{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=R3(),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 e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let t=R3();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}};function R3(){return(typeof performance>"u"?Date:performance).now()}var Oa=new R,L3=new on,T4=new R,Ba=new R,m1=class extends st{constructor(){super(),this.type="AudioListener",this.context=vw.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new fc}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(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);let t=this.context.listener,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Oa,L3,T4),Ba.set(0,0,-1).applyQuaternion(L3),t.positionX){let i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Oa.x,i),t.positionY.linearRampToValueAtTime(Oa.y,i),t.positionZ.linearRampToValueAtTime(Oa.z,i),t.forwardX.linearRampToValueAtTime(Ba.x,i),t.forwardY.linearRampToValueAtTime(Ba.y,i),t.forwardZ.linearRampToValueAtTime(Ba.z,i),t.upX.linearRampToValueAtTime(r.x,i),t.upY.linearRampToValueAtTime(r.y,i),t.upZ.linearRampToValueAtTime(r.z,i)}else t.setPosition(Oa.x,Oa.y,Oa.z),t.setOrientation(Ba.x,Ba.y,Ba.z,r.x,r.y,r.z)}},Od=class extends st{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.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(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=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+e;let t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,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.stop(),this.source.onended=null,this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(r,i,this._addIndex*t,1,t);for(let c=t,f=t+t;c!==f;++c)if(r[c]!==r[c+t]){u.setValue(r,i);break}}saveOriginalState(){let e=this.binding,t=this.buffer,r=this.valueSize,i=r*this._origIndex;e.getValue(t,i);for(let s=r,o=i;s!==o;++s)t[s]=t[i+s%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let r=e;r=.5)for(let o=0;o!==s;++o)e[t+o]=e[r+o]}_slerp(e,t,r,i){on.slerpFlat(e,t,e,t,e,r,i)}_slerpAdditive(e,t,r,i,s){let o=this._workIndex*s;on.multiplyQuaternionsFlat(e,o,e,t,e,r),on.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,r,i,s){let o=1-i;for(let u=0;u!==s;++u){let c=t+u;e[c]=e[c]*o+e[r+u]*i}}_lerpAdditive(e,t,r,i,s){for(let o=0;o!==s;++o){let u=t+o;e[u]=e[u]+e[r+o]*i}}},yw="\\[\\]\\.:\\/",C4=new RegExp("["+yw+"]","g"),xw="[^"+yw+"]",A4="[^"+yw.replace("\\.","")+"]",P4=/((?:WC+[\/:])*)/.source.replace("WC",xw),R4=/(WCOD+)?/.source.replace("WCOD",A4),L4=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",xw),D4=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",xw),I4=new RegExp("^"+P4+R4+L4+D4+"$"),N4=["material","materials","bones"],v1=class{constructor(e,t,r){let i=r||yt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,t)}setValue(e,t){let r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=r.length;i!==s;++i)r[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}},yt=class{constructor(e,t,r){this.path=t,this.parsedPath=r||yt.parseTrackName(t),this.node=yt.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new yt.Composite(e,t,r):new yt(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(C4,"")}static parseTrackName(e){let t=I4.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=r.nodeName.substring(i+1);N4.indexOf(s)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=s)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let r=e.skeleton.getBoneByName(t);if(r!==void 0)return r}if(e.children){let r=function(s){for(let o=0;o=s){let p=s++,m=e[p];t[m.uuid]=d,e[d]=m,t[f]=p,e[p]=c;for(let g=0,x=i;g!==x;++g){let y=r[g],_=y[p],S=y[d];y[d]=_,y[p]=S}}}this.nCachedObjects_=s}uncache(){let e=this._objects,t=this._indicesByUUID,r=this._bindings,i=r.length,s=this.nCachedObjects_,o=e.length;for(let u=0,c=arguments.length;u!==c;++u){let f=arguments[u],d=f.uuid,p=t[d];if(p!==void 0)if(delete t[d],p0&&(t[g.uuid]=p),e[p]=g,e.pop();for(let x=0,y=i;x!==y;++x){let _=r[x];_[p]=_[m],_.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){let r=this._bindingsIndicesByPath,i=r[e],s=this._bindings;if(i!==void 0)return s[i];let o=this._paths,u=this._parsedPaths,c=this._objects,f=c.length,d=this.nCachedObjects_,p=new Array(f);i=s.length,r[e]=i,o.push(e),u.push(t),s.push(p);for(let m=d,g=c.length;m!==g;++m){let x=c[m];p[m]=new yt(x,e,t)}return p}unsubscribe_(e){let t=this._bindingsIndicesByPath,r=t[e];if(r!==void 0){let i=this._paths,s=this._parsedPaths,o=this._bindings,u=o.length-1,c=o[u],f=e[u];t[f]=r,o[r]=c,o.pop(),s[r]=s[u],s.pop(),i[r]=i[u],i.pop()}}};Yg.prototype.isAnimationObjectGroup=!0;var y1=class{constructor(e,t,r=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=r,this.blendMode=i;let s=t.tracks,o=s.length,u=new Array(o),c={endingStart:ja,endingEnd:ja};for(let f=0;f!==o;++f){let d=s[f].createInterpolant(null);u[f]=d,d.settings=c}this._interpolantSettings=c,this._interpolants=u,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=IC,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(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,r){if(e.fadeOut(t),this.fadeIn(t),r){let i=this._clip.duration,s=e._clip.duration,o=s/i,u=i/s;e.warp(1,o,t),this.warp(u,1,t)}return this}crossFadeTo(e,t,r){return e.crossFadeFrom(this,t,r)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,r){let i=this._mixer,s=i.time,o=this.timeScale,u=this._timeScaleInterpolant;u===null&&(u=i._lendControlInterpolant(),this._timeScaleInterpolant=u);let c=u.parameterPositions,f=u.sampleValues;return c[0]=s,c[1]=s+r,f[0]=e/o,f[1]=t/o,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,r,i){if(!this.enabled){this._updateWeight(e);return}let s=this._startTime;if(s!==null){let c=(e-s)*r;if(c<0||r===0)return;this._startTime=null,t=r*c}t*=this._updateTimeScale(e);let o=this._updateTime(t),u=this._updateWeight(e);if(u>0){let c=this._interpolants,f=this._propertyBindings;switch(this.blendMode){case dw:for(let d=0,p=c.length;d!==p;++d)c[d].evaluate(o),f[d].accumulateAdditive(u);break;case a0:default:for(let d=0,p=c.length;d!==p;++d)c[d].evaluate(o),f[d].accumulate(i,u)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let r=this._weightInterpolant;if(r!==null){let i=r.evaluate(e)[0];t*=i,e>r.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let r=this._timeScaleInterpolant;if(r!==null){let i=r.evaluate(e)[0];t*=i,e>r.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,r=this.loop,i=this.time+e,s=this._loopCount,o=r===NC;if(e===0)return s===-1?i:o&&(s&1)===1?t-i:i;if(r===DC){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){let u=Math.floor(i/t);i-=t*u,s+=Math.abs(u);let c=this.repetitions-s;if(c<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(c===1){let f=e<0;this._setEndings(f,!f,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:u})}}else this.time=i;if(o&&(s&1)===1)return t-i}return i}_setEndings(e,t,r){let i=this._interpolantSettings;r?(i.endingStart=Xa,i.endingEnd=Xa):(e?i.endingStart=this.zeroSlopeAtStart?Xa:ja:i.endingStart=ed,t?i.endingEnd=this.zeroSlopeAtEnd?Xa:ja:i.endingEnd=ed)}_scheduleFading(e,t,r){let i=this._mixer,s=i.time,o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);let u=o.parameterPositions,c=o.sampleValues;return u[0]=s,c[0]=t,u[1]=s+e,c[1]=r,this}},Zg=class extends yi{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let r=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,u=e._interpolants,c=r.uuid,f=this._bindingsByRootAndName,d=f[c];d===void 0&&(d={},f[c]=d);for(let p=0;p!==s;++p){let m=i[p],g=m.name,x=d[g];if(x!==void 0)++x.referenceCount,o[p]=x;else{if(x=o[p],x!==void 0){x._cacheIndex===null&&(++x.referenceCount,this._addInactiveBinding(x,c,g));continue}let y=t&&t._propertyBindings[p].binding.parsedPath;x=new qg(yt.create(r,g,y),m.ValueTypeName,m.getValueSize()),++x.referenceCount,this._addInactiveBinding(x,c,g),o[p]=x}u[p].resultBuffer=x.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let r=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,r)}let t=e._propertyBindings;for(let r=0,i=t.length;r!==i;++r){let s=t[r];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let r=0,i=t.length;r!==i;++r){let s=t[r];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;let t=this._actions,r=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let f=0;f!==r;++f)t[f]._update(i,e,s,o);let u=this._bindings,c=this._nActiveBindings;for(let f=0;f!==c;++f)u[f].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return N3.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};na.prototype.isBox2=!0;var z3=new R,Qm=new R,Kg=class{constructor(e=new R,t=new R){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){z3.subVectors(e,this.start),Qm.subVectors(this.end,this.start);let r=Qm.dot(Qm),s=Qm.dot(z3)/r;return t&&(s=pn(s,0,1)),s}closestPointToPoint(e,t,r){let i=this.closestPointToPointParameter(e,t);return this.delta(r).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},k3=new R,w1=class extends st{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;let r=new We,i=[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 o=0,u=1,c=32;o.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{H3.set(e.z,0,-e.x).normalize();let t=Math.acos(e.y);this.quaternion.setFromAxisAngle(H3,t)}}setLength(e,t=e*.2,r=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(r,t,r),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}},n0=class extends $n{constructor(e=1){let t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new We;i.setAttribute("position",new De(t,3)),i.setAttribute("color",new De(r,3));let s=new wn({vertexColors:!0,toneMapped:!1});super(i,s),this.type="AxesHelper"}setColors(e,t,r){let i=new we,s=this.geometry.attributes.color.array;return i.set(e),i.toArray(s,0),i.toArray(s,3),i.set(t),i.toArray(s,6),i.toArray(s,9),i.set(r),i.toArray(s,12),i.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},R1=class{constructor(){this.type="ShapePath",this.color=new we,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Qo,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,r,i){return this.currentPath.quadraticCurveTo(e,t,r,i),this}bezierCurveTo(e,t,r,i,s,o){return this.currentPath.bezierCurveTo(e,t,r,i,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function r(w){let E=[];for(let T=0,C=w.length;TNumber.EPSILON){if(A<0&&(I=E[D],B=-B,G=E[P],A=-A),w.yG.y)continue;if(w.y===I.y){if(w.x===I.x)return!0}else{let F=A*(w.x-I.x)-B*(w.y-I.y);if(F===0)return!0;if(F<0)continue;C=!C}}else{if(w.y!==I.y)continue;if(G.x<=w.x&&w.x<=I.x||I.x<=w.x&&w.x<=G.x)return!0}}return C}let s=gi.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return r(o);let u,c,f,d=[];if(o.length===1)return c=o[0],f=new mi,f.curves=c.curves,d.push(f),d;let p=!s(o[0].getPoints());p=e?!p:p;let m=[],g=[],x=[],y=0,_;g[y]=void 0,x[y]=[];for(let w=0,E=o.length;w1){let w=!1,E=0;for(let T=0,C=g.length;T0&&w===!1&&(x=m)}let S;for(let w=0,E=g.length;w65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=pn(e,-65504,65504),V3[0]=e;let t=G3[0],r=t>>23&511;return ki[r]+((t&8388607)>>Fi[r])}static fromHalfFloat(e){let t=e>>10;return G3[0]=_w[lA[t]+(e&1023)]+gc[t],V3[0]}},aA=new ArrayBuffer(4),V3=new Float32Array(aA),G3=new Uint32Array(aA),ki=new Uint32Array(512),Fi=new Uint32Array(512);for(let n=0;n<256;++n){let e=n-127;e<-27?(ki[n]=0,ki[n|256]=32768,Fi[n]=24,Fi[n|256]=24):e<-14?(ki[n]=1024>>-e-14,ki[n|256]=1024>>-e-14|32768,Fi[n]=-e-1,Fi[n|256]=-e-1):e<=15?(ki[n]=e+15<<10,ki[n|256]=e+15<<10|32768,Fi[n]=13,Fi[n|256]=13):e<128?(ki[n]=31744,ki[n|256]=64512,Fi[n]=24,Fi[n|256]=24):(ki[n]=31744,ki[n|256]=64512,Fi[n]=13,Fi[n|256]=13)}var _w=new Uint32Array(2048),gc=new Uint32Array(64),lA=new Uint32Array(64);for(let n=1;n<1024;++n){let e=n<<13,t=0;for(;(e&8388608)===0;)e<<=1,t-=8388608;e&=-8388609,t+=947912704,_w[n]=e|t}for(let n=1024;n<2048;++n)_w[n]=939524096+(n-1024<<13);for(let n=1;n<31;++n)gc[n]=n<<23;gc[31]=1199570944;gc[32]=2147483648;for(let n=33;n<63;++n)gc[n]=2147483648+(n-32<<23);gc[63]=3347054592;for(let n=1;n<64;++n)n!==32&&(lA[n]=1024);var k4=0,F4=1,O4=0,B4=1,c0=2;function U4(n){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),n}function H4(n=[]){return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),n.isMultiMaterial=!0,n.materials=n,n.clone=function(){return n.slice()},n}var D1=class extends sl{constructor(e,t){console.warn("THREE.PointCloud has been renamed to THREE.Points."),super(e,t)}},I1=class extends tc{constructor(e){console.warn("THREE.Particle has been renamed to THREE.Sprite."),super(e)}},N1=class extends sl{constructor(e,t){console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),super(e,t)}},z1=class extends Xs{constructor(e){console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),super(e)}},k1=class extends Xs{constructor(e){console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),super(e)}},F1=class extends Xs{constructor(e){console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),super(e)}},O1=class extends R{constructor(e,t,r){console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),super(e,t,r)}},B1=class extends mt{constructor(e,t){console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),super(e,t),this.setUsage(Xu)}},U1=class extends vg{constructor(e,t){console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),super(e,t)}},H1=class extends yg{constructor(e,t){console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),super(e,t)}},V1=class extends xg{constructor(e,t){console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),super(e,t)}},G1=class extends _g{constructor(e,t){console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),super(e,t)}},W1=class extends qu{constructor(e,t){console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),super(e,t)}},j1=class extends wg{constructor(e,t){console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),super(e,t)}},X1=class extends Yu{constructor(e,t){console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),super(e,t)}},q1=class extends De{constructor(e,t){console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),super(e,t)}},Y1=class extends Mg{constructor(e,t){console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),super(e,t)}};fr.create=function(n,e){return console.log("THREE.Curve.create() has been deprecated"),n.prototype=Object.create(fr.prototype),n.prototype.constructor=n,n.prototype.getPoint=e,n};Qo.prototype.fromPoints=function(n){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(n)};var Z1=class extends n0{constructor(e){console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),super(e)}},Q1=class extends t0{constructor(e,t){console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),super(e,t)}},J1=class extends $n{constructor(e,t){console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),super(new dd(e.geometry),new wn({color:t!==void 0?t:16777215}))}};e0.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")};$g.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")};var K1=class extends $n{constructor(e,t){console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),super(new gd(e.geometry),new wn({color:t!==void 0?t:16777215}))}};Bn.prototype.extractUrlBase=function(n){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),cc.extractUrlBase(n)};Bn.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}};var $1=class extends _i{constructor(e){console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),super(e)}},ew=class extends zg{constructor(e){console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),super(e)}};na.prototype.center=function(n){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(n)};na.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()};na.prototype.isIntersectionBox=function(n){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)};na.prototype.size=function(n){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(n)};ur.prototype.center=function(n){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(n)};ur.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()};ur.prototype.isIntersectionBox=function(n){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)};ur.prototype.isIntersectionSphere=function(n){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(n)};ur.prototype.size=function(n){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(n)};ls.prototype.toVector3=function(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")};os.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()};nl.prototype.setFromMatrix=function(n){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(n)};Kg.prototype.center=function(n){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(n)};mn.prototype.flattenToArrayOffset=function(n,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(n,e)};mn.prototype.multiplyVector3=function(n){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),n.applyMatrix3(this)};mn.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")};mn.prototype.applyToBufferAttribute=function(n){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),n.applyMatrix3(this)};mn.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")};mn.prototype.getInverse=function(n){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(n).invert()};Ne.prototype.extractPosition=function(n){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(n)};Ne.prototype.flattenToArrayOffset=function(n,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(n,e)};Ne.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),new R().setFromMatrixColumn(this,3)};Ne.prototype.setRotationFromQuaternion=function(n){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(n)};Ne.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")};Ne.prototype.multiplyVector3=function(n){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)};Ne.prototype.multiplyVector4=function(n){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)};Ne.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")};Ne.prototype.rotateAxis=function(n){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),n.transformDirection(this)};Ne.prototype.crossVector=function(n){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)};Ne.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")};Ne.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")};Ne.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")};Ne.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")};Ne.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")};Ne.prototype.applyToBufferAttribute=function(n){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)};Ne.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")};Ne.prototype.makeFrustum=function(n,e,t,r,i,s){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(n,e,r,t,i,s)};Ne.prototype.getInverse=function(n){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(n).invert()};hi.prototype.isIntersectionLine=function(n){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(n)};on.prototype.multiplyVector3=function(n){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),n.applyQuaternion(this)};on.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()};as.prototype.isIntersectionBox=function(n){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)};as.prototype.isIntersectionPlane=function(n){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(n)};as.prototype.isIntersectionSphere=function(n){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(n)};Jt.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()};Jt.prototype.barycoordFromPoint=function(n,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(n,e)};Jt.prototype.midpoint=function(n){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(n)};Jt.prototypenormal=function(n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(n)};Jt.prototype.plane=function(n){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(n)};Jt.barycoordFromPoint=function(n,e,t,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Jt.getBarycoord(n,e,t,r,i)};Jt.normal=function(n,e,t,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Jt.getNormal(n,e,t,r)};mi.prototype.extractAllPoints=function(n){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(n)};mi.prototype.extrude=function(n){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Hi(this,n)};mi.prototype.makeGeometry=function(n){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new ea(this,n)};oe.prototype.fromAttribute=function(n,e,t){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,e,t)};oe.prototype.distanceToManhattan=function(n){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(n)};oe.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};R.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")};R.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")};R.prototype.getPositionFromMatrix=function(n){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(n)};R.prototype.getScaleFromMatrix=function(n){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(n)};R.prototype.getColumnFromMatrix=function(n,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,n)};R.prototype.applyProjection=function(n){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(n)};R.prototype.fromAttribute=function(n,e,t){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,e,t)};R.prototype.distanceToManhattan=function(n){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(n)};R.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};Tt.prototype.fromAttribute=function(n,e,t){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,e,t)};Tt.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};st.prototype.getChildByName=function(n){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(n)};st.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")};st.prototype.translate=function(n,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,n)};st.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")};st.prototype.applyMatrix=function(n){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(n)};Object.defineProperties(st.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(n){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=n}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}});sn.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")};Object.defineProperties(sn.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),zC},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}});nc.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")};Lt.prototype.setLens=function(n,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),e!==void 0&&(this.filmGauge=e),this.setFocalLength(n)};Object.defineProperties(Xr.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(n){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=n}},shadowCameraLeft:{set:function(n){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=n}},shadowCameraRight:{set:function(n){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=n}},shadowCameraTop:{set:function(n){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=n}},shadowCameraBottom:{set:function(n){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=n}},shadowCameraNear:{set:function(n){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=n}},shadowCameraFar:{set:function(n){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=n}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(n){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=n}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(n){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=n}},shadowMapHeight:{set:function(n){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=n}}});Object.defineProperties(mt.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===Xu},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Xu)}}});mt.prototype.setDynamic=function(n){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(n===!0?Xu:ju),this};mt.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},mt.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")};We.prototype.addIndex=function(n){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(n)};We.prototype.addAttribute=function(n,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),!(e&&e.isBufferAttribute)&&!(e&&e.isInterleavedBufferAttribute)?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(n,new mt(arguments[1],arguments[2]))):n==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(n,e)};We.prototype.addDrawCall=function(n,e,t){t!==void 0&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(n,e)};We.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()};We.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")};We.prototype.removeAttribute=function(n){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(n)};We.prototype.applyMatrix=function(n){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(n)};Object.defineProperties(We.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}});Ws.prototype.setDynamic=function(n){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(n===!0?Xu:ju),this};Ws.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")};Hi.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")};Hi.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")};Hi.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")};Zo.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")};dc.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this};Object.defineProperties($t.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new we}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(n){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===lw}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(n){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=n}},vertexTangents:{get:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")},set:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")}}});Object.defineProperties(br.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(n){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=n}}});At.prototype.clearTarget=function(n,e,t,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(n),this.clear(e,t,r)};At.prototype.animate=function(n){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(n)};At.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()};At.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()};At.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision};At.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()};At.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")};At.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")};At.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")};At.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")};At.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")};At.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")};At.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures};At.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")};At.prototype.enableScissorTest=function(n){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(n)};At.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};At.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};At.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};At.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};At.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")};At.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")};At.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")};At.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")};At.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")};At.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()};Object.defineProperties(At.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(n){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=n}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(n){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=n}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(n){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=n===!0?Dt:vi}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}},gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});Object.defineProperties($C.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}});var tw=class extends Ju{constructor(e,t,r){console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),super(e,r)}};Object.defineProperties(On.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(n){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=n}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(n){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=n}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(n){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=n}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(n){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=n}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(n){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=n}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(n){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=n}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(n){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=n}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(n){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=n}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(n){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=n}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(n){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=n}}});Od.prototype.load=function(n){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");let e=this;return new Gg().load(n,function(r){e.setBuffer(r)}),this};Xg.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()};Qu.prototype.updateCubeMap=function(n,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(n,e)};Qu.prototype.clear=function(n,e,t,r){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(n,e,t,r)};ss.crossOrigin=void 0;ss.loadTexture=function(n,e,t,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");let i=new kg;i.setCrossOrigin(this.crossOrigin);let s=i.load(n,t,void 0,r);return e&&(s.mapping=e),s};ss.loadTextureCube=function(n,e,t,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");let i=new Ng;i.setCrossOrigin(this.crossOrigin);let s=i.load(n,t,void 0,r);return e&&(s.mapping=e),s};ss.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")};ss.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};function V4(){console.error("THREE.CanvasRenderer has been removed")}function G4(){console.error("THREE.JSONLoader has been removed.")}var W4={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};function j4(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")}var nw=class extends We{constructor(){console.error("THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js"),super()}},rw=class extends We{constructor(){console.error("THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js"),super()}};function X4(){console.error("THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js")}function q4(){console.error("THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js")}function Y4(){console.error("THREE.ImmediateRenderObject has been removed.")}var iw=class extends On{constructor(e,t,r){console.error('THREE.WebGLMultisampleRenderTarget has been removed. Use a normal render target and set the "samples" property to greater 0 to enable multisampling.'),super(e,t,r),this.samples=4}},sw=class extends Xo{constructor(e,t,r,i){console.warn("THREE.DataTexture2DArray has been renamed to DataArrayTexture."),super(e,t,r,i)}},ow=class extends tl{constructor(e,t,r,i){console.warn("THREE.DataTexture3D has been renamed to Data3DTexture."),super(e,t,r,i)}};typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:r0}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=r0);var an=Pn(Dr()),Ks=Pn(ww());var dr=Pn(Dr(),1);function Z4(n){let e,t=new Set,r=(f,d)=>{let p=typeof f=="function"?f(e):f;if(p!==e){let m=e;e=d?p:Object.assign({},e,p),t.forEach(g=>g(e,m))}},i=()=>e,s=(f,d=i,p=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let m=d(e);function g(){let x=d(e);if(!p(m,x)){let y=m;f(m=x,y)}}return t.add(g),()=>t.delete(g)},c={setState:r,getState:i,subscribe:(f,d,p)=>d||p?s(f,d,p):(t.add(f),()=>t.delete(f)),destroy:()=>t.clear()};return e=n(r,i,c),c}var Q4=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),fA=Q4?dr.useEffect:dr.useLayoutEffect;function dA(n){let e=typeof n=="function"?Z4(n):n,t=(r=e.getState,i=Object.is)=>{let[,s]=(0,dr.useReducer)(_=>_+1,0),o=e.getState(),u=(0,dr.useRef)(o),c=(0,dr.useRef)(r),f=(0,dr.useRef)(i),d=(0,dr.useRef)(!1),p=(0,dr.useRef)();p.current===void 0&&(p.current=r(o));let m,g=!1;(u.current!==o||c.current!==r||f.current!==i||d.current)&&(m=r(o),g=!i(p.current,m)),fA(()=>{g&&(p.current=m),u.current=o,c.current=r,f.current=i,d.current=!1});let x=(0,dr.useRef)(o);fA(()=>{let _=()=>{try{let w=e.getState(),E=c.current(w);f.current(p.current,E)||(u.current=w,p.current=E,s())}catch{d.current=!0,s()}},S=e.subscribe(_);return e.getState()!==x.current&&_(),S},[]);let y=g?m:p.current;return(0,dr.useDebugValue)(y),y};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");let r=[t,e];return{next(){let i=r.length<=0;return{value:r.shift(),done:i}}}},t}var zA=Pn(Lw()),y0=Pn(v0());function CA(n,e,t=(r,i)=>r===i){if(n===e)return!0;if(!n||!e)return!1;let r=n.length;if(e.length!==r)return!1;for(let i=0;ii.response=s).then(()=>{r.lifespan&&r.lifespan>0&&setTimeout(()=>{let s=Js.indexOf(i);s!==-1&&Js.splice(s,1)},r.lifespan)}).catch(s=>i.error=s)};if(Js.push(i),!t)throw i.promise}var PA=(n,e,t)=>AA(n,e,!1,t),RA=(n,e,t)=>void AA(n,e,!0,t);var LA=n=>{if(n===void 0||n.length===0)Js.splice(0,Js.length);else{let e=Js.find(t=>CA(n,t.keys,t.equal));if(e){let t=Js.indexOf(e);t!==-1&&Js.splice(t,1)}}};var kA=n=>n&&n.isOrthographicCamera,K4=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),_c=K4?an.useEffect:an.useLayoutEffect;function Ww(n){let e=an.useRef(n);return _c(()=>void(e.current=n),[n]),e}function FA({set:n}){return _c(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}var qd=class extends an.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}};qd.getDerivedStateFromError=()=>({error:!0});var OA="__default",$4=n=>n&&!!n.memoized&&!!n.changes;function BA(n){return Array.isArray(n)?Math.min(Math.max(n[0],window.devicePixelRatio),n[1]):n}var jd=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()},jt={obj:n=>n===Object(n)&&!jt.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:r="reference",strict:i=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(jt.str(n)||jt.num(n))return n===e;let s=jt.obj(n);if(s&&r==="reference")return n===e;let o=jt.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let u;for(u in n)if(!(u in e))return!1;for(u in i?e:n)if(n[u]!==e[u])return!1;if(jt.und(u)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function eO(n){let e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function UA(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(let e in n)e.dispose==null||e.dispose(),delete n[e]}function yc(n,e){let t=n;return(e!=null&&e.primitive||!t.__r3f)&&(t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e}),n}function Uw(n,e){let t=n;if(e.includes("-")){let r=e.split("-"),i=r.pop();return t=r.reduce((s,o)=>s[o],n),{target:t,key:i}}else return{target:t,key:e}}var DA=/-\d+$/;function Dw(n,e,t){if(jt.str(t)){if(DA.test(t)){let s=t.replace(DA,""),{target:o,key:u}=Uw(n,s);Array.isArray(o[u])||(o[u]=[])}let{target:r,key:i}=Uw(n,t);e.__r3f.previousAttach=r[i],r[i]=e}else e.__r3f.previousAttach=t(n,e)}function IA(n,e,t){var r,i;if(jt.str(t)){let{target:s,key:o}=Uw(n,t);s[o]=e.__r3f.previousAttach}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(n,e);(i=e.__r3f)==null||delete i.previousAttach}function HA(n,{children:e,key:t,ref:r,...i},{children:s,key:o,ref:u,...c}={},f=!1){var d;let p=(d=n?.__r3f)!=null?d:{},m=Object.entries(i),g=[];if(f){let y=Object.keys(c);for(let _=0;_{var S;if((S=n.__r3f)!=null&&S.primitive&&y==="object"||jt.equ(_,c[y]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(y))return g.push([y,_,!0,[]]);let w=[];y.includes("-")&&(w=y.split("-")),g.push([y,_,!1,w])});let x={...i};return p.memoizedProps&&p.memoizedProps.args&&(x.args=p.memoizedProps.args),p.memoizedProps&&p.memoizedProps.attach&&(x.attach=p.memoizedProps.attach),{memoized:x,changes:g}}function Iw(n,e){var t,r;let i=(t=n?.__r3f)!=null?t:{},s=i.root,o=(r=s==null||s.getState==null?void 0:s.getState())!=null?r:{},{memoized:u,changes:c}=$4(e)?e:HA(n,e),f=i.eventCount;if(n.__r3f&&(n.__r3f.memoizedProps=u),c.forEach(([d,p,m,g])=>{let x=n,y=x[d];if(g.length&&(y=g.reduce((w,E)=>w[E],n),!(y&&y.set))){let[w,...E]=g.reverse();x=E.reverse().reduce((T,C)=>T[C],n),d=w}if(p===OA+"remove")if(y&&y.constructor){var _;p=new y.constructor(...(_=u.args)!=null?_:[])}else if(x.constructor){var S;let w=new x.constructor(...(S=x.__r3f.memoizedProps.args)!=null?S:[]);p=w[y],w.dispose&&w.dispose()}else p=0;if(m)p?i.handlers[d]=p:delete i.handlers[d],i.eventCount=Object.keys(i.handlers).length;else if(y&&y.set&&(y.copy||y instanceof us)){if(Array.isArray(p))y.fromArray?y.fromArray(p):y.set(...p);else if(y.copy&&p&&p.constructor&&y.constructor.name===p.constructor.name)y.copy(p);else if(p!==void 0){let w=y instanceof we;!w&&y.setScalar?y.setScalar(p):y instanceof us&&p instanceof us?y.mask=p.mask:y.set(p),!Jn&&!o.linear&&w&&y.convertSRGBToLinear()}}else x[d]=p,!o.linear&&x[d]instanceof Wt&&(x[d].encoding=Dt);xc(n)}),i.parent&&o.internal&&n.raycast&&f!==i.eventCount){let d=o.internal.interaction.indexOf(n);d>-1&&o.internal.interaction.splice(d,1),i.eventCount&&o.internal.interaction.push(n)}return c.length&&n.parent&&Hw(n),n}function xc(n){var e,t;let r=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();r&&r.internal.frames===0&&r.invalidate()}function Hw(n){n.onUpdate==null||n.onUpdate(n)}function tO(n,e){n.manual||(kA(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function Nw(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function nO(){var n,e;switch((n=window)==null||(e=n.event)==null?void 0:e.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Ks.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Ks.ContinuousEventPriority;default:return Ks.DefaultEventPriority}}function VA(n,e,t,r){let i=t.get(e);i&&(t.delete(e),t.size===0&&(n.delete(r),i.target.releasePointerCapture(r)))}function rO(n,e){let{events:t,internal:r}=n.getState();r.interaction=r.interaction.filter(i=>i!==e),r.initialHits=r.initialHits.filter(i=>i!==e),r.hovered.forEach((i,s)=>{(i.eventObject===e||i.object===e)&&r.hovered.delete(s)}),r.capturedMap.forEach((i,s)=>{VA(r.capturedMap,e,i,s)})}function GA(n){let e=new R;function t(f){let{internal:d}=n.getState(),p=f.offsetX-d.initialClick[0],m=f.offsetY-d.initialClick[1];return Math.round(Math.sqrt(p*p+m*m))}function r(f){return f.filter(d=>["Move","Over","Enter","Out","Leave"].some(p=>{var m;return(m=d.__r3f)==null?void 0:m.handlers["onPointer"+p]}))}function i(f,d){let p=n.getState(),m=new Set,g=[],x=d?d(p.internal.interaction):p.internal.interaction;x.forEach(S=>{let w=jd(S);w&&(w.raycaster.camera=void 0)}),p.previousRoot||p.events.compute==null||p.events.compute(f,p);let y=x.flatMap(S=>{let w=jd(S);if(!w||!w.events.enabled||w.raycaster.camera===null)return[];if(w.raycaster.camera===void 0){var E;w.events.compute==null||w.events.compute(f,w,(E=w.previousRoot)==null?void 0:E.getState()),w.raycaster.camera===void 0&&(w.raycaster.camera=null)}return w.raycaster.camera?w.raycaster.intersectObject(S,!0):[]}).sort((S,w)=>{let E=jd(S.object),T=jd(w.object);return!E||!T?0:T.events.priority-E.events.priority||S.distance-w.distance}).filter(S=>{let w=Nw(S);return m.has(w)?!1:(m.add(w),!0)});p.events.filter&&(y=p.events.filter(y,p));for(let S of y){let w=S.object;for(;w;){var _;(_=w.__r3f)!=null&&_.eventCount&&g.push({...S,eventObject:w}),w=w.parent}}if("pointerId"in f&&p.internal.capturedMap.has(f.pointerId))for(let S of p.internal.capturedMap.get(f.pointerId).values())g.push(S.intersection);return g}function s(f,d,p,m){let{raycaster:g,pointer:x,camera:y,internal:_}=n.getState();if(f.length){let S=e.set(x.x,x.y,0).unproject(y),w={stopped:!1};for(let E of f){let T=G=>{var B,A;return(B=(A=_.capturedMap.get(G))==null?void 0:A.has(E.eventObject))!=null?B:!1},C=G=>{let B={intersection:E,target:d.target};_.capturedMap.has(G)?_.capturedMap.get(G).set(E.eventObject,B):_.capturedMap.set(G,new Map([[E.eventObject,B]])),d.target.setPointerCapture(G)},P=G=>{let B=_.capturedMap.get(G);B&&VA(_.capturedMap,E.eventObject,B,G)},D={};for(let G in d){let B=d[G];typeof B!="function"&&(D[G]=B)}let I={...E,...D,pointer:x,intersections:f,stopped:w.stopped,delta:p,unprojectedPoint:S,ray:g.ray,camera:y,stopPropagation:()=>{let G="pointerId"in d&&_.capturedMap.get(d.pointerId);if((!G||G.has(E.eventObject))&&(I.stopped=w.stopped=!0,_.hovered.size&&Array.from(_.hovered.values()).find(B=>B.eventObject===E.eventObject))){let B=f.slice(0,f.indexOf(E));o([...B,E])}},target:{hasPointerCapture:T,setPointerCapture:C,releasePointerCapture:P},currentTarget:{hasPointerCapture:T,setPointerCapture:C,releasePointerCapture:P},nativeEvent:d};if(m(I),w.stopped===!0)break}}return f}function o(f){let{internal:d}=n.getState();Array.from(d.hovered.values()).forEach(p=>{if(!f.length||!f.find(m=>m.object===p.object&&m.index===p.index&&m.instanceId===p.instanceId)){let g=p.eventObject.__r3f,x=g?.handlers;if(d.hovered.delete(Nw(p)),g!=null&&g.eventCount){let y={...p,intersections:f||[]};x.onPointerOut==null||x.onPointerOut(y),x.onPointerLeave==null||x.onPointerLeave(y)}}})}let u=f=>{switch(f){case"onPointerLeave":case"onPointerCancel":return()=>o([]);case"onLostPointerCapture":return d=>{let{internal:p}=n.getState();"pointerId"in d&&!p.capturedMap.has(d.pointerId)&&(p.capturedMap.delete(d.pointerId),o([]))}}return d=>{let{onPointerMissed:p,internal:m}=n.getState();m.lastEvent.current=d;let g=f==="onPointerMove",x=f==="onClick"||f==="onContextMenu"||f==="onDoubleClick",_=i(d,g?r:void 0),S=x?t(d):0;f==="onPointerDown"&&(m.initialClick=[d.offsetX,d.offsetY],m.initialHits=_.map(w=>w.eventObject)),x&&!_.length&&S<=2&&(c(d,m.interaction),p&&p(d)),g&&o(_),s(_,d,S,w=>{let E=w.eventObject,T=E.__r3f,C=T?.handlers;if(!!(T!=null&&T.eventCount))if(g){if(C.onPointerOver||C.onPointerEnter||C.onPointerOut||C.onPointerLeave){let P=Nw(w),D=m.hovered.get(P);D?D.stopped&&w.stopPropagation():(m.hovered.set(P,w),C.onPointerOver==null||C.onPointerOver(w),C.onPointerEnter==null||C.onPointerEnter(w))}C.onPointerMove==null||C.onPointerMove(w)}else{let P=C[f];P?(!x||m.initialHits.includes(E))&&(c(d,m.interaction.filter(D=>!m.initialHits.includes(D))),P(w)):x&&m.initialHits.includes(E)&&c(d,m.interaction.filter(D=>!m.initialHits.includes(D)))}})}};function c(f,d){d.forEach(p=>{var m;return(m=p.__r3f)==null||m.handlers.onPointerMissed==null?void 0:m.handlers.onPointerMissed(f)})}return{handlePointer:u}}var Vw={},jw=n=>void(Vw={...Vw,...n});function iO(n,e){function t(f,{args:d=[],attach:p,...m},g){let x=`${f[0].toUpperCase()}${f.slice(1)}`,y;if(p===void 0&&(x.endsWith("Geometry")?p="geometry":x.endsWith("Material")&&(p="material")),f==="primitive"){if(m.object===void 0)throw"Primitives without 'object' are invalid!";let _=m.object;y=yc(_,{type:f,root:g,attach:p,primitive:!0})}else{let _=Vw[x];if(!_)throw`${x} is not part of the THREE namespace! Did you forget to extend? See: https://github.com/pmndrs/react-three-fiber/blob/master/markdown/api.md#using-3rd-party-objects-declaratively`;if(!Array.isArray(d))throw"The args prop must be an array!";y=yc(new _(...d),{type:f,root:g,attach:p,memoizedProps:{args:d}})}return x!=="inject"&&Iw(y,m),y}function r(f,d){let p=!1;if(d){var m,g;(m=d.__r3f)!=null&&m.attach?Dw(f,d,d.__r3f.attach):d.isObject3D&&f.isObject3D&&(f.add(d),p=!0),p||(g=f.__r3f)==null||g.objects.push(d),d.__r3f||yc(d,{}),d.__r3f.parent=f,Hw(d),xc(d)}}function i(f,d,p){let m=!1;if(d){var g,x;if((g=d.__r3f)!=null&&g.attach)Dw(f,d,d.__r3f.attach);else if(d.isObject3D&&f.isObject3D){d.parent=f,d.dispatchEvent({type:"added"});let y=f.children.filter(S=>S!==d),_=y.indexOf(p);f.children=[...y.slice(0,_),d,...y.slice(_)],m=!0}m||(x=f.__r3f)==null||x.objects.push(d),d.__r3f||yc(d,{}),d.__r3f.parent=f,Hw(d),xc(d)}}function s(f,d,p=!1){f&&[...f].forEach(m=>o(d,m,p))}function o(f,d,p){if(d){var m,g,x;if(d.__r3f&&(d.__r3f.parent=null),(m=f.__r3f)!=null&&m.objects&&(f.__r3f.objects=f.__r3f.objects.filter(E=>E!==d)),(g=d.__r3f)!=null&&g.attach)IA(f,d,d.__r3f.attach);else if(d.isObject3D&&f.isObject3D){var y;f.remove(d),(y=d.__r3f)!=null&&y.root&&rO(d.__r3f.root,d)}let S=(x=d.__r3f)==null?void 0:x.primitive,w=p===void 0?d.dispose!==null&&!S:p;if(!S){var _;s((_=d.__r3f)==null?void 0:_.objects,d,w),s(d.children,d,w)}d.__r3f&&(delete d.__r3f.root,delete d.__r3f.objects,delete d.__r3f.handlers,delete d.__r3f.memoizedProps,S||delete d.__r3f),w&&d.dispose&&d.type!=="Scene"&&(0,y0.unstable_scheduleCallback)(y0.unstable_IdlePriority,()=>{try{d.dispose()}catch{}}),xc(f)}}function u(f,d,p,m){var g,x;let y=(g=f.__r3f)==null?void 0:g.parent;if(!y)return;let _=t(d,p,(x=f.__r3f)==null?void 0:x.root);d!=="primitive"&&f.children&&(f.children.forEach(S=>r(_,S)),f.children=[]),f.__r3f.objects.forEach(S=>r(_,S)),f.__r3f.objects=[],o(y,f),r(y,_),_.raycast&&_.__r3f.eventCount&&_.__r3f.root.getState().internal.interaction.push(_),[m,m.alternate].forEach(S=>{S!==null&&(S.stateNode=_,S.ref&&(typeof S.ref=="function"?S.ref(_):S.ref.current=_))})}return{reconciler:(0,zA.default)({createInstance:t,removeChild:o,appendChild:r,appendInitialChild:r,insertBefore:i,supportsMicrotask:!0,warnsIfNotActing:!0,supportsMutation:!0,isPrimaryRenderer:!1,noTimeout:-1,appendChildToContainer:(f,d)=>{let p=f.getState().scene;p.__r3f.root=f,r(p,d)},removeChildFromContainer:(f,d)=>o(f.getState().scene,d),insertInContainerBefore:(f,d,p)=>i(f.getState().scene,d,p),getRootHostContext:()=>null,getChildHostContext:f=>f,finalizeInitialChildren(f){var d;return!!((d=f?.__r3f)!=null?d:{}).handlers},prepareUpdate(f,d,p,m){if(f.__r3f.primitive&&m.object&&m.object!==f)return[!0];{let{args:g=[],children:x,...y}=m,{args:_=[],children:S,...w}=p;if(!Array.isArray(g))throw"The args prop must be an array!";if(g.some((T,C)=>T!==_[C]))return[!0];let E=HA(f,y,w,!0);return E.changes.length?[!1,E]:null}},commitUpdate(f,[d,p],m,g,x,y){d?u(f,m,x,y):Iw(f,p)},commitMount(f,d,p,m){var g;let x=(g=f?.__r3f)!=null?g:{};f.raycast&&x.handlers&&x.eventCount&&f.__r3f.root.getState().internal.interaction.push(f)},getPublicInstance:f=>f,shouldDeprioritizeSubtree:()=>!1,prepareForCommit:()=>null,preparePortalMount:f=>yc(f.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,detachDeletedInstance:()=>{},createTextInstance:()=>{},hideInstance(f){var d;let{attach:p,parent:m}=(d=f?.__r3f)!=null?d:{};p&&m&&IA(m,f,p),f.isObject3D&&(f.visible=!1),xc(f)},unhideInstance(f,d){var p;let{attach:m,parent:g}=(p=f?.__r3f)!=null?p:{};m&&g&&Dw(g,f,m),(f.isObject3D&&d.visible==null||d.visible)&&(f.visible=!0),xc(f)},hideTextInstance:()=>{throw new Error("Text is not allowed in the R3F tree.")},getCurrentEventPriority:()=>e?e():Ks.DefaultEventPriority,now:typeof performance<"u"&&jt.fun(performance.now)?performance.now:jt.fun(Date.now)?Date.now:void 0,scheduleTimeout:jt.fun(setTimeout)?setTimeout:void 0,cancelTimeout:jt.fun(clearTimeout)?clearTimeout:void 0,setTimeout:jt.fun(setTimeout)?setTimeout:void 0,clearTimeout:jt.fun(clearTimeout)?clearTimeout:void 0}),applyProps:Iw}}var WA=n=>!!(n!=null&&n.render),Xw=an.createContext(null),sO=(n,e)=>{let t=dA((o,u)=>{let c=new R,f=new R,d=new R;function p(y=u().camera,_=f,S=u().size){let{width:w,height:E}=S,T=w/E;_ instanceof R?d.copy(_):d.set(..._);let C=y.getWorldPosition(c).distanceTo(d);if(kA(y))return{width:w/y.zoom,height:E/y.zoom,factor:1,distance:C,aspect:T};{let P=y.fov*Math.PI/180,D=2*Math.tan(P/2)*C,I=D*(w/E);return{width:I,height:D,factor:w/I,distance:C,aspect:T}}}let m,g=y=>o(_=>({performance:{..._.performance,current:y}})),x=new oe;return{set:o,get:u,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,invalidate:()=>n(u()),advance:(y,_)=>e(y,_,u()),legacy:!1,linear:!1,flat:!1,scene:yc(new Zo),controls:null,clock:new fc,pointer:x,mouse:x,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{let y=u();m&&clearTimeout(m),y.performance.current!==y.performance.min&&g(y.performance.min),m=setTimeout(()=>g(u().performance.max),y.performance.debounce)}},size:{width:0,height:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:y=>o(_=>({..._,events:{..._.events,...y}})),setSize:(y,_)=>{let S=u().camera,w={width:y,height:_};o(E=>({size:w,viewport:{...E.viewport,...p(S,f,w)}}))},setDpr:y=>o(_=>{let S=BA(y);return{viewport:{..._.viewport,dpr:S,initialDpr:_.viewport.initialDpr||S}}}),setFrameloop:(y="always")=>{let _=u().clock;_.stop(),_.elapsedTime=0,y!=="never"&&(_.start(),_.elapsedTime=0),o(()=>({frameloop:y}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:an.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(y,_,S)=>(o(({internal:w})=>({internal:{...w,priority:w.priority+(_>0?1:0),subscribers:[...w.subscribers,{ref:y,priority:_,store:S}].sort((E,T)=>E.priority-T.priority)}})),()=>{o(({internal:w})=>({internal:{...w,priority:w.priority-(_>0?1:0),subscribers:w.subscribers.filter(E=>E.ref!==y)}}))})}}}),r=t.getState(),i=r.size,s=r.viewport.dpr;return t.subscribe(()=>{let{camera:o,size:u,viewport:c,gl:f}=t.getState();(u!==i||c.dpr!==s)&&(tO(o,u),f.setPixelRatio(c.dpr),f.setSize(u.width,u.height),i=u,s=c.dpr)}),t.subscribe(o=>n(o)),t};var oa,zw=[],kw=[],NA=[];function Wd(n,e){for(oa=0;oa{var d;i=f.store.getState(),i.internal.active&&(i.frameloop==="always"||i.internal.frames>0)&&!((d=i.gl.xr)!=null&&d.isPresenting)&&(t+=Bw(c,i))}),kw.length&&Wd(kw,c),t===0)return NA.length&&Wd(NA,c),e=!1,cancelAnimationFrame(r)}function o(c){var f;if(!c)return n.forEach(d=>o(d.store.getState()));(f=c.gl.xr)!=null&&f.isPresenting||!c.internal.active||c.frameloop==="never"||(c.internal.frames=Math.min(60,c.internal.frames+1),e||(e=!0,requestAnimationFrame(s)))}function u(c,f=!0,d,p){f&&Wd(zw,c),d?Bw(c,d,p):n.forEach(m=>Bw(c,m.store.getState())),f&&Wd(kw,c)}return{loop:s,invalidate:o,advance:u}}function qw(){let n=an.useContext(Xw);if(!n)throw"R3F hooks can only be used within the Canvas component!";return n}function hs(n=t=>t,e){return qw()(n,e)}function Zd(n,e=0){let t=qw(),r=t.getState().internal.subscribe,i=Ww(n);return _c(()=>r(i,e,t),[e,r,t]),null}function jA(n,e){return function(t,...r){let i=new t;return n&&n(i),Promise.all(r.map(s=>new Promise((o,u)=>i.load(s,c=>{c.scene&&Object.assign(c,eO(c.scene)),o(c)},e,c=>u(`Could not load ${s}: ${c.message}`)))))}}function Yw(n,e,t,r){let i=Array.isArray(e)?e:[e],s=PA(jA(t,r),[n,...i],{equal:jt.equ});return Array.isArray(e)?s:s[0]}Yw.preload=function(n,e,t){let r=Array.isArray(e)?e:[e];return RA(jA(t),[n,...r])};Yw.clear=function(n,e){let t=Array.isArray(e)?e:[e];return LA([n,...t])};var Al=new Map,{invalidate:XA,advance:Gw}=oO(Al),{reconciler:Yd,applyProps:Xd}=iO(Al,nO),vc={objects:"shallow",strict:!1},aO=(n,e)=>{let t=typeof n=="function"?n(e):n;return WA(t)?t:new At({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function Zw(n){let e=Al.get(n),t=e?.fiber,r=e?.store;e&&console.warn("R3F.createRoot should only be called once!");let i=r||sO(XA,Gw),s=t||Yd.createContainer(i,Ks.ConcurrentRoot,!1,null);e||Al.set(n,{fiber:s,store:i});let o,u=!1;return{configure(c={}){var f,d,p,m;let{gl:g,size:x,events:y,onCreated:_,shadows:S=!1,linear:w=!1,flat:E=!1,legacy:T=!1,orthographic:C=!1,frameloop:P="always",dpr:D=[1,2],performance:I,raycaster:G,camera:B,onPointerMissed:A}=c,F=i.getState(),ne=F.gl;F.gl||F.set({gl:ne=aO(g,n)});let j=F.raycaster;j||F.set({raycaster:j=new Bd});let{params:Q,...X}=G||{};if(jt.equ(X,j,vc)||Xd(j,{...X}),jt.equ(Q,j.params,vc)||Xd(j,{params:{...j.params,...Q}}),!F.camera){let re=B instanceof Gs,ce=re?B:C?new Wr(0,0,0,0,.1,1e3):new Lt(75,0,.1,1e3);re||(ce.position.z=5,B&&Xd(ce,B),B!=null&&B.rotation||ce.lookAt(0,0,0)),F.set({camera:ce})}if(!F.xr){let re=(fe,ze)=>{let $e=i.getState();$e.frameloop!=="never"&&Gw(fe,!0,$e,ze)},ce=()=>{let fe=i.getState().gl;fe.xr.enabled=fe.xr.isPresenting,fe.xr.setAnimationLoop(fe.xr.isPresenting?re:null)},ge={connect(){let fe=i.getState().gl;fe.xr.addEventListener("sessionstart",ce),fe.xr.addEventListener("sessionend",ce)},disconnect(){let fe=i.getState().gl;fe.xr.removeEventListener("sessionstart",ce),fe.xr.removeEventListener("sessionend",ce)}};ne.xr&&ge.connect(),F.set({xr:ge})}if(ne.shadowMap){let re=jt.boo(S);if(re&&ne.shadowMap.enabled!==S||!jt.equ(S,ne.shadowMap,vc)){let ce=ne.shadowMap.enabled;ne.shadowMap.enabled=!!S,re?ne.shadowMap.type=i0:Object.assign(ne.shadowMap,S),ce!==ne.shadowMap.enabled&&(ne.shadowMap.needsUpdate=!0)}}Jn&&(Jn.legacyMode=T);let J=w?vi:Dt,W=E?pi:s0;return ne.outputEncoding!==J&&(ne.outputEncoding=J),ne.toneMapping!==W&&(ne.toneMapping=W),F.legacy!==T&&F.set(()=>({legacy:T})),F.linear!==w&&F.set(()=>({linear:w})),F.flat!==E&&F.set(()=>({flat:E})),g&&!jt.fun(g)&&!WA(g)&&!jt.equ(g,ne,vc)&&Xd(ne,g),y&&!F.events.handlers&&F.set({events:y(i)}),D&&F.viewport.dpr!==BA(D)&&F.setDpr(D),x=x||{width:(f=(d=n.parentElement)==null?void 0:d.clientWidth)!=null?f:0,height:(p=(m=n.parentElement)==null?void 0:m.clientHeight)!=null?p:0},jt.equ(x,F.size,vc)||F.setSize(x.width,x.height),F.frameloop!==P&&F.setFrameloop(P),F.onPointerMissed||F.set({onPointerMissed:A}),I&&!jt.equ(I,F.performance,vc)&&F.set(re=>({performance:{...re.performance,...I}})),o=_,u=!0,this},render(c){return u||this.configure(),Yd.updateContainer(an.createElement(lO,{store:i,children:c,onCreated:o,rootElement:n}),s,null,()=>{}),i},unmount(){x0(n)}}}function lO({store:n,children:e,onCreated:t,rootElement:r}){return _c(()=>{let i=n.getState();i.set(s=>({internal:{...s.internal,active:!0}})),t&&t(i),n.getState().events.connected||i.events.connect==null||i.events.connect(r)},[]),an.createElement(Xw.Provider,{value:n},e)}function x0(n,e){let t=Al.get(n),r=t?.fiber;if(r){let i=t?.store.getState();i&&(i.internal.active=!1),Yd.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{var s,o,u,c;i.events.disconnect==null||i.events.disconnect(),(s=i.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(u=i.gl)==null||u.forceContextLoss==null||u.forceContextLoss(),(c=i.gl)!=null&&c.xr&&i.xr.disconnect(),UA(i),Al.delete(n),e&&e(n)}catch{}},500)})}}Yd.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:"18.0.0"});function Pl(){return Pl=Object.assign?Object.assign.bind():function(n){for(var e=1;e"u"?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");let[o,u]=(0,qr.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),c=(0,qr.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),f=e?typeof e=="number"?e:e.scroll:null,d=e?typeof e=="number"?e:e.resize:null,p=(0,qr.useRef)(!1);(0,qr.useEffect)(()=>(p.current=!0,()=>void(p.current=!1)));let[m,g,x]=(0,qr.useMemo)(()=>{let w=()=>{if(!c.current.element)return;let{left:E,top:T,width:C,height:P,bottom:D,right:I,x:G,y:B}=c.current.element.getBoundingClientRect(),A={left:E,top:T,width:C,height:P,bottom:D,right:I,x:G,y:B};c.current.element instanceof HTMLElement&&i&&(A.height=c.current.element.offsetHeight,A.width=c.current.element.offsetWidth),Object.freeze(A),p.current&&!hO(c.current.lastBounds,A)&&u(c.current.lastBounds=A)};return[w,d?(0,Kw.default)(w,d):w,f?(0,Kw.default)(w,f):w]},[u,i,f,d]);function y(){c.current.scrollContainers&&(c.current.scrollContainers.forEach(w=>w.removeEventListener("scroll",x,!0)),c.current.scrollContainers=null),c.current.resizeObserver&&(c.current.resizeObserver.disconnect(),c.current.resizeObserver=null)}function _(){!c.current.element||(c.current.resizeObserver=new s(x),c.current.resizeObserver.observe(c.current.element),t&&c.current.scrollContainers&&c.current.scrollContainers.forEach(w=>w.addEventListener("scroll",x,{capture:!0,passive:!0})))}let S=w=>{!w||w===c.current.element||(y(),c.current.element=w,c.current.scrollContainers=QA(w),_())};return fO(x,Boolean(t)),cO(g),(0,qr.useEffect)(()=>{y(),_()},[t,x,g]),(0,qr.useEffect)(()=>y,[]),[S,o,m]}function cO(n){(0,qr.useEffect)(()=>{let e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function fO(n,e){(0,qr.useEffect)(()=>{if(e){let t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function QA(n){let e=[];if(!n||n===document.body)return e;let{overflow:t,overflowX:r,overflowY:i}=window.getComputedStyle(n);return[t,r,i].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...QA(n.parentElement)]}var dO=["x","y","top","bottom","left","right","width","height"],hO=(n,e)=>dO.every(t=>n[t]===e[t]);var tB=Pn(ww());var nB=Pn(Lw()),rB=Pn(v0());var $w={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function pO(n){let{handlePointer:e}=GA(n);return{priority:1,enabled:!0,compute(t,r,i){r.pointer.set(t.offsetX/r.size.width*2-1,-(t.offsetY/r.size.height)*2+1),r.raycaster.setFromCamera(r.pointer,r.camera)},connected:void 0,handlers:Object.keys($w).reduce((t,r)=>({...t,[r]:e(r)}),{}),connect:t=>{var r;let{set:i,events:s}=n.getState();s.disconnect==null||s.disconnect(),i(o=>({events:{...o.events,connected:t}})),Object.entries((r=s?.handlers)!=null?r:[]).forEach(([o,u])=>{let[c,f]=$w[o];t.addEventListener(c,u,{passive:f})})},disconnect:()=>{let{set:t,events:r}=n.getState();if(r.connected){var i;Object.entries((i=r.handlers)!=null?i:[]).forEach(([s,o])=>{if(r&&r.connected instanceof HTMLElement){let[u]=$w[s];r.connected.removeEventListener(u,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}var JA=ln.forwardRef(function({children:e,fallback:t,resize:r,style:i,gl:s,events:o=pO,shadows:u,linear:c,flat:f,legacy:d,orthographic:p,frameloop:m,dpr:g,performance:x,raycaster:y,camera:_,onPointerMissed:S,onCreated:w,...E},T){ln.useMemo(()=>jw(f0),[]);let[C,{width:P,height:D}]=ZA({scroll:!0,debounce:{scroll:50,resize:0},...r}),I=ln.useRef(null),G=ln.useRef(null),[B,A]=ln.useState(null),F=Ww(S),[ne,j]=ln.useState(!1),[Q,X]=ln.useState(!1);if(ne)throw ne;if(Q)throw Q;let J=ln.useRef(null);return P>0&&D>0&&B&&(J.current||(J.current=Zw(B)),J.current.configure({gl:s,events:o,shadows:u,linear:c,flat:f,legacy:d,orthographic:p,frameloop:m,dpr:g,performance:x,raycaster:y,camera:_,size:{width:P,height:D},onPointerMissed:(...W)=>F.current==null?void 0:F.current(...W),onCreated:W=>{W.events.connect==null||W.events.connect(G.current),w?.(W)}}),J.current.render(ln.createElement(qd,{set:X},ln.createElement(ln.Suspense,{fallback:ln.createElement(FA,{set:j})},e)))),_c(()=>{A(I.current)},[]),ln.useEffect(()=>{if(B)return()=>x0(B)},[B]),ln.createElement("div",Pl({ref:Qw([G,C]),style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",...i}},E),ln.createElement("canvas",{ref:Qw([I,T]),style:{display:"block"}},t))});function Ke(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var KA=(n,e)=>(n%e+e)%e,Qd=class extends yi{constructor(e,t){super(),Ke(this,"object",void 0),Ke(this,"domElement",void 0),Ke(this,"enabled",!0),Ke(this,"target",new R),Ke(this,"minDistance",0),Ke(this,"maxDistance",1/0),Ke(this,"minZoom",0),Ke(this,"maxZoom",1/0),Ke(this,"minPolarAngle",0),Ke(this,"maxPolarAngle",Math.PI),Ke(this,"minAzimuthAngle",-1/0),Ke(this,"maxAzimuthAngle",1/0),Ke(this,"enableDamping",!1),Ke(this,"dampingFactor",.05),Ke(this,"enableZoom",!0),Ke(this,"zoomSpeed",1),Ke(this,"enableRotate",!0),Ke(this,"rotateSpeed",1),Ke(this,"enablePan",!0),Ke(this,"panSpeed",1),Ke(this,"screenSpacePanning",!0),Ke(this,"keyPanSpeed",7),Ke(this,"autoRotate",!1),Ke(this,"autoRotateSpeed",2),Ke(this,"reverseOrbit",!1),Ke(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Ke(this,"mouseButtons",{LEFT:ra.ROTATE,MIDDLE:ra.DOLLY,RIGHT:ra.PAN}),Ke(this,"touches",{ONE:ia.ROTATE,TWO:ia.DOLLY_PAN}),Ke(this,"target0",void 0),Ke(this,"position0",void 0),Ke(this,"zoom0",void 0),Ke(this,"_domElementKeyEvents",null),Ke(this,"getPolarAngle",void 0),Ke(this,"getAzimuthalAngle",void 0),Ke(this,"setPolarAngle",void 0),Ke(this,"setAzimuthalAngle",void 0),Ke(this,"getDistance",void 0),Ke(this,"listenToKeyEvents",void 0),Ke(this,"saveState",void 0),Ke(this,"reset",void 0),Ke(this,"update",void 0),Ke(this,"connect",void 0),Ke(this,"dispose",void 0),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object instanceof Lt?this.object.zoom:1,this.getPolarAngle=()=>d.phi,this.getAzimuthalAngle=()=>d.theta,this.setPolarAngle=U=>{let N=KA(U,2*Math.PI),le=d.phi;le<0&&(le+=2*Math.PI),N<0&&(N+=2*Math.PI);let de=Math.abs(N-le);2*Math.PI-de{let N=KA(U,2*Math.PI),le=d.theta;le<0&&(le+=2*Math.PI),N<0&&(N+=2*Math.PI);let de=Math.abs(N-le);2*Math.PI-der.object.position.distanceTo(r.target),this.listenToKeyEvents=U=>{U.addEventListener("keydown",$),this._domElementKeyEvents=U},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object instanceof Lt?r.object.zoom:1},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object instanceof Lt&&(r.object.zoom=r.zoom0,r.object.updateProjectionMatrix()),r.dispatchEvent(i),r.update(),c=u.NONE},this.update=(()=>{let U=new R,N=new on().setFromUnitVectors(e.up,new R(0,1,0)),le=N.clone().invert(),de=new R,Re=new on,Se=2*Math.PI;return function(){let _e=r.object.position;U.copy(_e).sub(r.target),U.applyQuaternion(N),d.setFromVector3(U),r.autoRotate&&c===u.NONE&&F(B()),r.enableDamping?(d.theta+=p.theta*r.dampingFactor,d.phi+=p.phi*r.dampingFactor):(d.theta+=p.theta,d.phi+=p.phi);let Be=r.minAzimuthAngle,ft=r.maxAzimuthAngle;return isFinite(Be)&&isFinite(ft)&&(Be<-Math.PI?Be+=Se:Be>Math.PI&&(Be-=Se),ft<-Math.PI?ft+=Se:ft>Math.PI&&(ft-=Se),Be<=ft?d.theta=Math.max(Be,Math.min(ft,d.theta)):d.theta=d.theta>(Be+ft)/2?Math.max(Be,d.theta):Math.min(ft,d.theta)),d.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,d.phi)),d.makeSafe(),d.radius*=m,d.radius=Math.max(r.minDistance,Math.min(r.maxDistance,d.radius)),r.enableDamping===!0?r.target.addScaledVector(g,r.dampingFactor):r.target.add(g),U.setFromSpherical(d),U.applyQuaternion(le),_e.copy(r.target).add(U),r.object.lookAt(r.target),r.enableDamping===!0?(p.theta*=1-r.dampingFactor,p.phi*=1-r.dampingFactor,g.multiplyScalar(1-r.dampingFactor)):(p.set(0,0,0),g.set(0,0,0)),m=1,x||de.distanceToSquared(r.object.position)>f||8*(1-Re.dot(r.object.quaternion))>f?(r.dispatchEvent(i),de.copy(r.object.position),Re.copy(r.object.quaternion),x=!1,!0):!1}})(),this.connect=U=>{U===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),r.domElement=U,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",Ae),r.domElement.addEventListener("pointerdown",Ze),r.domElement.addEventListener("pointercancel",_t),r.domElement.addEventListener("wheel",L)},this.dispose=()=>{var U,N,le,de,Re,Se;(U=r.domElement)===null||U===void 0||U.removeEventListener("contextmenu",Ae),(N=r.domElement)===null||N===void 0||N.removeEventListener("pointerdown",Ze),(le=r.domElement)===null||le===void 0||le.removeEventListener("pointercancel",_t),(de=r.domElement)===null||de===void 0||de.removeEventListener("wheel",L),(Re=r.domElement)===null||Re===void 0||Re.ownerDocument.removeEventListener("pointermove",Ue),(Se=r.domElement)===null||Se===void 0||Se.ownerDocument.removeEventListener("pointerup",Oe),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",$)};let r=this,i={type:"change"},s={type:"start"},o={type:"end"},u={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},c=u.NONE,f=1e-6,d=new hc,p=new hc,m=1,g=new R,x=!1,y=new oe,_=new oe,S=new oe,w=new oe,E=new oe,T=new oe,C=new oe,P=new oe,D=new oe,I=[],G={};function B(){return 2*Math.PI/60/60*r.autoRotateSpeed}function A(){return Math.pow(.95,r.zoomSpeed)}function F(U){r.reverseOrbit?p.theta+=U:p.theta-=U}function ne(U){r.reverseOrbit?p.phi+=U:p.phi-=U}let j=(()=>{let U=new R;return function(le,de){U.setFromMatrixColumn(de,0),U.multiplyScalar(-le),g.add(U)}})(),Q=(()=>{let U=new R;return function(le,de){r.screenSpacePanning===!0?U.setFromMatrixColumn(de,1):(U.setFromMatrixColumn(de,0),U.crossVectors(r.object.up,U)),U.multiplyScalar(le),g.add(U)}})(),X=(()=>{let U=new R;return function(le,de){let Re=r.domElement;if(Re&&r.object instanceof Lt&&r.object.isPerspectiveCamera){let Se=r.object.position;U.copy(Se).sub(r.target);let Ve=U.length();Ve*=Math.tan(r.object.fov/2*Math.PI/180),j(2*le*Ve/Re.clientHeight,r.object.matrix),Q(2*de*Ve/Re.clientHeight,r.object.matrix)}else Re&&r.object instanceof Wr&&r.object.isOrthographicCamera?(j(le*(r.object.right-r.object.left)/r.object.zoom/Re.clientWidth,r.object.matrix),Q(de*(r.object.top-r.object.bottom)/r.object.zoom/Re.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function J(U){r.object instanceof Lt&&r.object.isPerspectiveCamera?m/=U:r.object instanceof Wr&&r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom*U)),r.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function W(U){r.object instanceof Lt&&r.object.isPerspectiveCamera?m*=U:r.object instanceof Wr&&r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/U)),r.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function re(U){y.set(U.clientX,U.clientY)}function ce(U){C.set(U.clientX,U.clientY)}function ge(U){w.set(U.clientX,U.clientY)}function fe(U){_.set(U.clientX,U.clientY),S.subVectors(_,y).multiplyScalar(r.rotateSpeed);let N=r.domElement;N&&(F(2*Math.PI*S.x/N.clientHeight),ne(2*Math.PI*S.y/N.clientHeight)),y.copy(_),r.update()}function ze(U){P.set(U.clientX,U.clientY),D.subVectors(P,C),D.y>0?J(A()):D.y<0&&W(A()),C.copy(P),r.update()}function $e(U){E.set(U.clientX,U.clientY),T.subVectors(E,w).multiplyScalar(r.panSpeed),X(T.x,T.y),w.copy(E),r.update()}function Xe(U){U.deltaY<0?W(A()):U.deltaY>0&&J(A()),r.update()}function ue(U){let N=!1;switch(U.code){case r.keys.UP:X(0,r.keyPanSpeed),N=!0;break;case r.keys.BOTTOM:X(0,-r.keyPanSpeed),N=!0;break;case r.keys.LEFT:X(r.keyPanSpeed,0),N=!0;break;case r.keys.RIGHT:X(-r.keyPanSpeed,0),N=!0;break}N&&(U.preventDefault(),r.update())}function dt(){if(I.length==1)y.set(I[0].pageX,I[0].pageY);else{let U=.5*(I[0].pageX+I[1].pageX),N=.5*(I[0].pageY+I[1].pageY);y.set(U,N)}}function Qe(){if(I.length==1)w.set(I[0].pageX,I[0].pageY);else{let U=.5*(I[0].pageX+I[1].pageX),N=.5*(I[0].pageY+I[1].pageY);w.set(U,N)}}function qe(){let U=I[0].pageX-I[1].pageX,N=I[0].pageY-I[1].pageY,le=Math.sqrt(U*U+N*N);C.set(0,le)}function xe(){r.enableZoom&&qe(),r.enablePan&&Qe()}function je(){r.enableZoom&&qe(),r.enableRotate&&dt()}function ae(U){if(I.length==1)_.set(U.pageX,U.pageY);else{let le=et(U),de=.5*(U.pageX+le.x),Re=.5*(U.pageY+le.y);_.set(de,Re)}S.subVectors(_,y).multiplyScalar(r.rotateSpeed);let N=r.domElement;N&&(F(2*Math.PI*S.x/N.clientHeight),ne(2*Math.PI*S.y/N.clientHeight)),y.copy(_)}function ie(U){if(I.length==1)E.set(U.pageX,U.pageY);else{let N=et(U),le=.5*(U.pageX+N.x),de=.5*(U.pageY+N.y);E.set(le,de)}T.subVectors(E,w).multiplyScalar(r.panSpeed),X(T.x,T.y),w.copy(E)}function ve(U){let N=et(U),le=U.pageX-N.x,de=U.pageY-N.y,Re=Math.sqrt(le*le+de*de);P.set(0,Re),D.set(0,Math.pow(P.y/C.y,r.zoomSpeed)),J(D.y),C.copy(P)}function Ie(U){r.enableZoom&&ve(U),r.enablePan&&ie(U)}function be(U){r.enableZoom&&ve(U),r.enableRotate&&ae(U)}function Ze(U){if(r.enabled!==!1){if(I.length===0){var N,le;(N=r.domElement)===null||N===void 0||N.ownerDocument.addEventListener("pointermove",Ue),(le=r.domElement)===null||le===void 0||le.ownerDocument.addEventListener("pointerup",Oe)}He(U),U.pointerType==="touch"?pe(U):bt(U)}}function Ue(U){r.enabled!==!1&&(U.pointerType==="touch"?Ee(U):O(U))}function Oe(U){if(se(U),I.length===0){var N,le,de;(N=r.domElement)===null||N===void 0||N.releasePointerCapture(U.pointerId),(le=r.domElement)===null||le===void 0||le.ownerDocument.removeEventListener("pointermove",Ue),(de=r.domElement)===null||de===void 0||de.ownerDocument.removeEventListener("pointerup",Oe)}r.dispatchEvent(o),c=u.NONE}function _t(U){se(U)}function bt(U){let N;switch(U.button){case 0:N=r.mouseButtons.LEFT;break;case 1:N=r.mouseButtons.MIDDLE;break;case 2:N=r.mouseButtons.RIGHT;break;default:N=-1}switch(N){case ra.DOLLY:if(r.enableZoom===!1)return;ce(U),c=u.DOLLY;break;case ra.ROTATE:if(U.ctrlKey||U.metaKey||U.shiftKey){if(r.enablePan===!1)return;ge(U),c=u.PAN}else{if(r.enableRotate===!1)return;re(U),c=u.ROTATE}break;case ra.PAN:if(U.ctrlKey||U.metaKey||U.shiftKey){if(r.enableRotate===!1)return;re(U),c=u.ROTATE}else{if(r.enablePan===!1)return;ge(U),c=u.PAN}break;default:c=u.NONE}c!==u.NONE&&r.dispatchEvent(s)}function O(U){if(r.enabled!==!1)switch(c){case u.ROTATE:if(r.enableRotate===!1)return;fe(U);break;case u.DOLLY:if(r.enableZoom===!1)return;ze(U);break;case u.PAN:if(r.enablePan===!1)return;$e(U);break}}function L(U){r.enabled===!1||r.enableZoom===!1||c!==u.NONE&&c!==u.ROTATE||(U.preventDefault(),r.dispatchEvent(s),Xe(U),r.dispatchEvent(o))}function $(U){r.enabled===!1||r.enablePan===!1||ue(U)}function pe(U){switch(Je(U),I.length){case 1:switch(r.touches.ONE){case ia.ROTATE:if(r.enableRotate===!1)return;dt(),c=u.TOUCH_ROTATE;break;case ia.PAN:if(r.enablePan===!1)return;Qe(),c=u.TOUCH_PAN;break;default:c=u.NONE}break;case 2:switch(r.touches.TWO){case ia.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;xe(),c=u.TOUCH_DOLLY_PAN;break;case ia.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;je(),c=u.TOUCH_DOLLY_ROTATE;break;default:c=u.NONE}break;default:c=u.NONE}c!==u.NONE&&r.dispatchEvent(s)}function Ee(U){switch(Je(U),c){case u.TOUCH_ROTATE:if(r.enableRotate===!1)return;ae(U),r.update();break;case u.TOUCH_PAN:if(r.enablePan===!1)return;ie(U),r.update();break;case u.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;Ie(U),r.update();break;case u.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;be(U),r.update();break;default:c=u.NONE}}function Ae(U){r.enabled!==!1&&U.preventDefault()}function He(U){I.push(U)}function se(U){delete G[U.pointerId];for(let N=0;N{let d=hs(T=>T.invalidate),p=hs(T=>T.camera),m=hs(T=>T.gl),g=hs(T=>T.events),x=hs(T=>T.set),y=hs(T=>T.get),_=hs(T=>T.performance),S=e||p,w=r||g.connected||m.domElement,E=ps.useMemo(()=>new Qd(S),[S]);return Zd(()=>{E.enabled&&E.update()},-1),ps.useEffect(()=>(E.connect(w),()=>void E.dispose()),[w,t,E,d]),ps.useEffect(()=>{let T=C=>{d(),t&&_.regress(),s&&s(C)};return E.addEventListener("change",T),o&&E.addEventListener("start",o),u&&E.addEventListener("end",u),()=>{o&&E.removeEventListener("start",o),u&&E.removeEventListener("end",u),E.removeEventListener("change",T)}},[s,o,u]),ps.useEffect(()=>{if(n){let T=y().controls;return x({controls:E}),()=>x({controls:T})}},[n,E]),ps.createElement("primitive",Pl({ref:f,object:E,enableDamping:i},c))});function nS(){return nS=Object.assign||function(n){for(var e=1;e=0)&&(t[i]=n[i]);return t}var mO=["children","camera","orthographic"];function eP(n){var e=n.children,t=n.camera,r=n.orthographic,i=r===void 0?!1:r,s=$A(n,mO);return en.default.createElement(JA,Object.assign({orthographic:i,camera:nS({position:[0,0,1],zoom:1,up:[0,1,0]},t)},s),e)}var gO=["enabled","zoomSpeed","enableZoom","enablePan","enableRotate","autoRotate","autoRotateSpeed"];function tP(n){var e=n.enabled,t=e===void 0?!0:e,r=n.zoomSpeed,i=r===void 0?1:r,s=n.enableZoom,o=s===void 0?!0:s,u=n.enablePan,c=u===void 0?!0:u,f=n.enableRotate,d=f===void 0?!0:f,p=n.autoRotate,m=p===void 0?!1:p,g=n.autoRotateSpeed,x=g===void 0?5:g,y=$A(n,gO);return en.default.createElement(eS,Object.assign({enabled:t,zoomSpeed:i,enableZoom:o,enablePan:c,enableRotate:d,autoRotate:m,autoRotateSpeed:x},y))}var vO={color:"blue",scale:1},_0=new st,tS=new we;function rS(n){var e=n.data,t=n.pointProps,r=t===void 0?vO:t,i=n.onPointsClicked,s=n.onPointClicked,o=n.pointShape,u=o===void 0?"sphere":o,c=n.opacity,f=c===void 0?1:c,d=n.material,p=d===void 0?"meshMatcap":d,m=(0,en.useCallback)(function(S){var w=typeof r.color=="function"?r.color(S):r.color;return w},[r.color]),g=(0,en.useMemo)(function(){return Float32Array.from(new Array(e.length).fill(null).flatMap(function(S,w){return tS.set(m(e[w])).toArray()}))},[e]),x=(0,en.useRef)(null);Zd(function(){e.forEach(function(S,w){var E=S.position;if(_0.position.set(E[0],E[1],E[2]||0),x.current){x.current.setMatrixAt(w,_0.matrix),x.current.instanceMatrix.needsUpdate=!0;var T=m(e[w]);tS.set(T),tS.toArray(g,w*3),x.current.geometry.attributes.color.needsUpdate=!0,_0.updateMatrix(),x.current.setMatrixAt(w,_0.matrix)}})});var y=(0,en.useMemo)(function(){switch(u){case"sphere":return en.default.createElement("sphereGeometry",{args:[r.radius||.02,20,20]},en.default.createElement("instancedBufferAttribute",{attach:"attributes-color",args:[g,3]}));case"cube":{var S=typeof r?.size=="number"?[r.size,r.size,r.size]:[.03,.03,.03];return en.default.createElement("boxGeometry",{args:S},en.default.createElement("instancedBufferAttribute",{attach:"attributes-color",args:[g,3]}))}case"octahedron":return en.default.createElement("octahedronGeometry",{args:[r.radius||.02,0]},en.default.createElement("instancedBufferAttribute",{attach:"attributes-color",args:[g,3]}));default:throw new Error("Unsupported point shape: "+u)}},[u,r]),_=(0,en.useMemo)(function(){switch(p){case"meshMatcap":return en.default.createElement("meshMatcapMaterial",{vertexColors:c0,opacity:f,transparent:f<1});default:return en.default.createElement("meshStandardMaterial",{vertexColors:c0,opacity:f,transparent:f<1})}},[p]);return en.default.createElement("instancedMesh",{args:[void 0,void 0,e.length],ref:x,onPointerUp:function(w){if(w.intersections){var E=w.intersections.map(function(T){return T?.instanceId}).filter(function(T){return T!=null});i&&i(E.map(function(T){return e[T]})),E.length>0&&s&&s(e[E[0]])}}},y,_)}var un={Purple:"#6e40aa",LightPurple:"#bf3caf",Pink:"#fe4b83",Orange:"#ff7847",LightOrange:"#e2b72f",Lime:"#aff05b",LightGreen:"#52f667",Green:"#1ddfa3",LightBlue:"#23abd8",Blue:"#4c6edb",White:"#ffffff"},MB={PinkLightGreen:[un.Pink,un.LightGreen],BlueOrange:[un.Blue,un.Orange],LightBlueOrange:[un.LightBlue,un.Orange],LightBlueLightOrange:[un.LightBlue,un.LightOrange],LimePurple:[un.Lime,un.Purple],LimeLightPurple:[un.Lime,un.LightPurple],BlueLime:[un.Blue,un.Lime],LightBlueLime:[un.LightBlue,un.Lime],WhiteLime:[un.White,un.Lime],WhiteLightBlue:[un.White,un.LightBlue],WhiteOrange:[un.White,un.Orange]};var iS=Pn(Dr()),w0=class extends iS.default.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){}render(){return this.state.hasError?iS.default.createElement("h1",null,"Something went wrong."):this.props.children}};function nP({primaryData:n,referenceData:e}){return Rl.default.createElement("div",{style:{height:600}},Rl.default.createElement(w0,null,Rl.default.createElement(eP,{camera:{position:[0,0,10]}},Rl.default.createElement(tP,null),Rl.default.createElement(rS,{data:n,pointProps:{color:"#7BFFFF"}}),Rl.default.createElement(rS,{data:e,pointProps:{color:"#d57bff"}}))))}function iP(n){return rP.default.createElement(nP,{...n})}window.renderUMAPWidget=function(n){let e=document.getElementById("root");oP.default.createRoot(e).render(sP.default.createElement(iP,{...n}))}; /** * @license * Copyright 2010-2022 Three.js Authors diff --git a/arize_toolbox/umap/__init__.py b/phoenix/umap/__init__.py similarity index 100% rename from arize_toolbox/umap/__init__.py rename to phoenix/umap/__init__.py diff --git a/arize_toolbox/umap/umap.py b/phoenix/umap/umap.py similarity index 100% rename from arize_toolbox/umap/umap.py rename to phoenix/umap/umap.py diff --git a/arize_toolbox/widgets/__init__.py b/phoenix/widgets/__init__.py similarity index 50% rename from arize_toolbox/widgets/__init__.py rename to phoenix/widgets/__init__.py index a12eff3d00..cef3a19e89 100644 --- a/arize_toolbox/widgets/__init__.py +++ b/phoenix/widgets/__init__.py @@ -1 +1,2 @@ from .umapWidget import UMAPWidget +from .umapWidget import demo_json diff --git a/arize_toolbox/widgets/umapWidget.py b/phoenix/widgets/umapWidget.py similarity index 85% rename from arize_toolbox/widgets/umapWidget.py rename to phoenix/widgets/umapWidget.py index c618de864b..4322e66963 100644 --- a/arize_toolbox/widgets/umapWidget.py +++ b/phoenix/widgets/umapWidget.py @@ -4,9 +4,9 @@ from IPython.core.display import HTML, display # type: ignore -import arize_toolbox +import phoenix -BASE_PATH = arize_toolbox.__path__[0] # type: ignore +BASE_PATH = phoenix.__path__[0] # type: ignore STATIC_PATH = os.path.join(BASE_PATH, "nbextension", "static") """Loads the compiled Javascript bundle""" @@ -40,8 +40,8 @@ def demo_json(): class UMAPWidget: - def __init__(self, to_json=demo_json): - self.to_json = to_json + def __init__(self, json: str): + self.json = json def template(self, json_data: str): return f""" @@ -58,4 +58,4 @@ def template(self, json_data: str): # Temporary static json representation of UMAP Drift data def show(self): - display(HTML(self.template(self.to_json()))) + display(HTML(self.template(self.json))) diff --git a/pyproject.toml b/pyproject.toml index bf75520b0d..4c896f1f89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,10 +10,10 @@ dependencies = ["hatch-jupyter-builder"] build-function = "hatch_jupyter_builder.npm_builder" [hatch_jupyter_builder.utils.npm_builder] -build_dir = "/arize_toolbox/nbextension/static" +build_dir = "/phoenix/nbextension/static" [tool.hatch.version] [project] -name = "arize_toolbox" +name = "phoenix" version = "0.0.1" \ No newline at end of file diff --git a/ui/src/components/canvas/DriftPointCloud.tsx b/ui/src/components/canvas/DriftPointCloud.tsx index f85b4766c5..49dde63220 100644 --- a/ui/src/components/canvas/DriftPointCloud.tsx +++ b/ui/src/components/canvas/DriftPointCloud.tsx @@ -17,7 +17,7 @@ export function DriftPointCloud({ referenceData, }: DriftPointCloudProps) { return ( -
+
From 61950277b7325627dbad30898d0df20e705bd849 Mon Sep 17 00:00:00 2001 From: Mikyo King Date: Fri, 18 Nov 2022 12:06:19 -0800 Subject: [PATCH 3/4] fix import order --- phoenix/widgets/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phoenix/widgets/__init__.py b/phoenix/widgets/__init__.py index cef3a19e89..7284632b8d 100644 --- a/phoenix/widgets/__init__.py +++ b/phoenix/widgets/__init__.py @@ -1,2 +1,3 @@ -from .umapWidget import UMAPWidget from .umapWidget import demo_json +from .umapWidget import UMAPWidget + From a9635ff799c31cad11ea777d3d8ba4ae50187581 Mon Sep 17 00:00:00 2001 From: Mikyo King Date: Fri, 18 Nov 2022 12:07:16 -0800 Subject: [PATCH 4/4] Fix isort --- phoenix/widgets/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/phoenix/widgets/__init__.py b/phoenix/widgets/__init__.py index 7284632b8d..f07b420321 100644 --- a/phoenix/widgets/__init__.py +++ b/phoenix/widgets/__init__.py @@ -1,3 +1 @@ -from .umapWidget import demo_json -from .umapWidget import UMAPWidget - +from .umapWidget import UMAPWidget, demo_json