From 780b22257acc5149c23488dd03b427d3190e5ecd Mon Sep 17 00:00:00 2001 From: wheattoast11 Date: Sat, 30 Nov 2024 18:40:03 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20wheattoa?= =?UTF-8?q?st11/wheattoast11.github.io@7ab3d3a75b22f5a71a7b68131f94f7d5758?= =?UTF-8?q?9bd97=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404.html | 6 +- assets/Home-CIdzXA5l.js | 1 + assets/Manifesto-Dax6b0Cd.js | 1 + assets/Scene-Bgu4qmls.js | 1 + assets/animation-6CpB2BtV.js | 1 + assets/index-Be1QyJmn.css | 1 - assets/index-BeBtB0Xr.js | 2 + assets/index-Du2sDgkR.css | 1 + assets/index-qu0Y7vr3.js | 3918 ---------------------------------- assets/three-CHXrHHRv.js | 6 + assets/vendor-CJ7Qk68r.js | 51 + index.html | 6 +- 12 files changed, 72 insertions(+), 3923 deletions(-) create mode 100644 assets/Home-CIdzXA5l.js create mode 100644 assets/Manifesto-Dax6b0Cd.js create mode 100644 assets/Scene-Bgu4qmls.js create mode 100644 assets/animation-6CpB2BtV.js delete mode 100644 assets/index-Be1QyJmn.css create mode 100644 assets/index-BeBtB0Xr.js create mode 100644 assets/index-Du2sDgkR.css delete mode 100644 assets/index-qu0Y7vr3.js create mode 100644 assets/three-CHXrHHRv.js create mode 100644 assets/vendor-CJ7Qk68r.js diff --git a/404.html b/404.html index b0347e8..21bb4bd 100644 --- a/404.html +++ b/404.html @@ -20,8 +20,10 @@ } }(window.location)) - - + + + +
diff --git a/assets/Home-CIdzXA5l.js b/assets/Home-CIdzXA5l.js new file mode 100644 index 0000000..75fa85c --- /dev/null +++ b/assets/Home-CIdzXA5l.js @@ -0,0 +1 @@ +import{j as e,m as i}from"./animation-6CpB2BtV.js";import{r as s,L as n}from"./vendor-CJ7Qk68r.js";function a({onMount:a}){const[t,r]=s.useState(!1);s.useEffect((()=>{null==a||a(),r(!0)}),[a]);const l={hidden:{y:20,opacity:0},visible:{y:0,opacity:1,transition:{duration:.6,ease:[.23,1,.32,1]}}};return e.jsxs(i.div,{className:"home-container",initial:"hidden",animate:t?"visible":"hidden",variants:{hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1,delayChildren:.2}}},children:[e.jsxs(i.section,{className:"hero-section",variants:l,children:[e.jsx("h1",{className:"gradient-text",children:"Intuition Labs"}),e.jsx("p",{className:"tagline",children:"Pioneering the future of AI through intuitive design"}),e.jsxs("div",{className:"cta-container",children:[e.jsx(i.a,{href:"https://zcal.co/terminals",className:"cta-button primary",whileHover:{scale:1.05},whileTap:{scale:.95},children:"Schedule Consultation"}),e.jsx(i.div,{whileHover:{scale:1.05},whileTap:{scale:.95},children:e.jsx(n,{to:"/manifesto",className:"cta-button secondary",children:"Read Our Manifesto"})})]})]}),e.jsxs(i.section,{className:"section solutions-grid",variants:l,"data-parallax":"0.2",children:[e.jsx("h2",{children:"Featured Solutions"}),e.jsxs("div",{className:"grid",children:[e.jsxs(i.div,{className:"card",whileHover:{scale:1.02,y:-5},transition:{duration:.2},children:[e.jsx("h3",{children:"Enterprise AI Strategy"}),e.jsx("p",{children:"Comprehensive AI implementation and transformation roadmaps"}),e.jsx("div",{className:"card-content",children:e.jsxs("ul",{children:[e.jsx("li",{children:"Enterprise AI Implementation Strategy"}),e.jsx("li",{children:"LLM & Agent System Architecture"}),e.jsx("li",{children:"GTM Strategy Development"}),e.jsx("li",{children:"Complex System Integration"})]})})]}),e.jsxs(i.div,{className:"card",whileHover:{scale:1.02,y:-5},transition:{duration:.2},children:[e.jsx("h3",{children:"LLM Systems"}),e.jsx("p",{children:"Custom language model development and integration"}),e.jsx("div",{className:"card-content",children:e.jsxs("ul",{children:[e.jsx("li",{children:"Custom AI Agent Development"}),e.jsx("li",{children:"Advanced Prompt Engineering"}),e.jsx("li",{children:"Multi-modal System Design"}),e.jsx("li",{children:"Process Automation & Optimization"})]})})]})]})]}),e.jsx(i.section,{className:"section vision-section",variants:l,"data-parallax":"0.4",children:e.jsxs("div",{className:"vision-content",children:[e.jsx("h2",{children:"Our Vision"}),e.jsx("p",{children:"Transforming enterprises through cutting-edge AI solutions and polymathic expertise"}),e.jsx(i.div,{className:"tech-stack",initial:{opacity:0},animate:{opacity:1},transition:{delay:.5}})]})})]})}export{a as default}; diff --git a/assets/Manifesto-Dax6b0Cd.js b/assets/Manifesto-Dax6b0Cd.js new file mode 100644 index 0000000..2dcc18d --- /dev/null +++ b/assets/Manifesto-Dax6b0Cd.js @@ -0,0 +1 @@ +import{j as e}from"./animation-6CpB2BtV.js";import{r as i,L as n}from"./vendor-CJ7Qk68r.js";function s({onMount:s}){return i.useEffect((()=>{s()}),[s]),e.jsxs("div",{id:"app",children:[e.jsx("canvas",{id:"bg"}),e.jsxs("header",{children:[e.jsx(n,{to:"/",className:"back-link",children:"← Back to Home"}),e.jsx("h1",{children:"Our Manifesto"}),e.jsx("p",{className:"tagline",children:"Shaping the future of AI with purpose and responsibility"})]}),e.jsxs("section",{className:"section manifesto-content",children:[e.jsxs("div",{className:"manifesto-grid",children:[e.jsxs("div",{className:"manifesto-item",children:[e.jsx("h2",{children:"Purpose"}),e.jsx("p",{children:"We believe AI should augment human capabilities, not replace them. Our mission is to create AI systems that enhance human potential while maintaining ethical boundaries and promoting sustainable innovation."})]}),e.jsxs("div",{className:"manifesto-item",children:[e.jsx("h2",{children:"Innovation"}),e.jsx("p",{children:"True innovation comes from understanding both the technical and human aspects of AI. We combine cutting-edge technology with deep industry knowledge to create solutions that matter."})]}),e.jsxs("div",{className:"manifesto-item",children:[e.jsx("h2",{children:"Ethics"}),e.jsx("p",{children:"We are committed to developing AI systems that are transparent, fair, and accountable. Our ethical framework ensures that every solution we create considers its impact on society and individuals."})]}),e.jsxs("div",{className:"manifesto-item",children:[e.jsx("h2",{children:"Collaboration"}),e.jsx("p",{children:"The best solutions emerge from diverse perspectives. We work closely with our clients, fostering partnerships that drive meaningful transformation and sustainable growth."})]})]}),e.jsxs("div",{className:"principles",children:[e.jsx("h2",{children:"Our Guiding Principles"}),e.jsxs("ul",{className:"experience-list",children:[e.jsx("li",{children:"Human-centered AI development that prioritizes user needs and experiences"}),e.jsx("li",{children:"Continuous learning and adaptation to emerging technologies and methodologies"}),e.jsx("li",{children:"Transparent communication and collaboration with stakeholders"}),e.jsx("li",{children:"Sustainable and responsible AI implementation practices"}),e.jsx("li",{children:"Commitment to diversity, equity, and inclusion in AI development"})]})]})]}),e.jsxs("footer",{children:[e.jsxs("div",{className:"social-links",children:[e.jsx("a",{href:"https://www.linkedin.com/company/intuition-labs",children:"LinkedIn"}),e.jsx("a",{href:"https://github.com/wheattoast11",children:"GitHub"}),e.jsx("a",{href:"https://www.youtube.com/@IntuitionLabsLLC",children:"YouTube"})]}),e.jsx("p",{className:"copyright",children:"© 2024 Intuition Labs LLC. Pioneering the future of AI."})]})]})}export{s as default}; diff --git a/assets/Scene-Bgu4qmls.js b/assets/Scene-Bgu4qmls.js new file mode 100644 index 0000000..bd7dfa2 --- /dev/null +++ b/assets/Scene-Bgu4qmls.js @@ -0,0 +1 @@ +import{G as t,L as e,A as s,B as r,V as i,a,I as n,M as o,D as l,b as h,O as u,F as d,S as c,U as m,c as f,W as p,H as g,N as v,C as w,d as x,e as M,f as T,P as b,g as S,h as C,i as y,j as P,k as _}from"./three-CHXrHHRv.js";const D=Math.sqrt(5),R=(D-1)/4,B=(5-D)/20,U=t=>0|Math.floor(t),z=new Float64Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]);function F(t=Math.random){const e=function(t){const e=512,s=new Uint8Array(e);for(let r=0;rz[t%32*4])),r=new Float64Array(e).map((t=>z[t%32*4+1])),i=new Float64Array(e).map((t=>z[t%32*4+2])),a=new Float64Array(e).map((t=>z[t%32*4+3]));return function(t,n,o,l){let h,u,d,c,m;const f=(t+n+o+l)*R,p=U(t+f),g=U(n+f),v=U(o+f),w=U(l+f),x=(p+g+v+w)*B,M=t-(p-x),T=n-(g-x),b=o-(v-x),S=l-(w-x);let C=0,y=0,P=0,_=0;M>T?C++:y++,M>b?C++:P++,M>S?C++:_++,T>b?y++:P++,T>S?y++:_++,b>S?P++:_++;const D=C>=3?1:0,z=y>=3?1:0,F=P>=3?1:0,E=_>=3?1:0,A=C>=2?1:0,L=y>=2?1:0,Q=P>=2?1:0,H=_>=2?1:0,I=C>=1?1:0,V=y>=1?1:0,k=P>=1?1:0,O=_>=1?1:0,W=M-D+B,j=T-z+B,N=b-F+B,K=S-E+B,Y=M-A+2*B,G=T-L+2*B,q=b-Q+2*B,X=S-H+2*B,Z=M-I+3*B,J=T-V+3*B,$=b-k+3*B,tt=S-O+3*B,et=M-1+4*B,st=T-1+4*B,rt=b-1+4*B,it=S-1+4*B,at=255&p,nt=255&g,ot=255&v,lt=255&w;let ht=.6-M*M-T*T-b*b-S*S;if(ht<0)h=0;else{const t=at+e[nt+e[ot+e[lt]]];ht*=ht,h=ht*ht*(s[t]*M+r[t]*T+i[t]*b+a[t]*S)}let ut=.6-W*W-j*j-N*N-K*K;if(ut<0)u=0;else{const t=at+D+e[nt+z+e[ot+F+e[lt+E]]];ut*=ut,u=ut*ut*(s[t]*W+r[t]*j+i[t]*N+a[t]*K)}let dt=.6-Y*Y-G*G-q*q-X*X;if(dt<0)d=0;else{const t=at+A+e[nt+L+e[ot+Q+e[lt+H]]];dt*=dt,d=dt*dt*(s[t]*Y+r[t]*G+i[t]*q+a[t]*X)}let ct=.6-Z*Z-J*J-$*$-tt*tt;if(ct<0)c=0;else{const t=at+I+e[nt+V+e[ot+k+e[lt+O]]];ct*=ct,c=ct*ct*(s[t]*Z+r[t]*J+i[t]*$+a[t]*tt)}let mt=.6-et*et-st*st-rt*rt-it*it;if(mt<0)m=0;else{const t=at+1+e[nt+1+e[ot+1+e[lt+1]]];mt*=mt,m=mt*mt*(s[t]*et+r[t]*st+i[t]*rt+a[t]*it)}return 27*(h+u+d+c+m)}}class E{constructor(){this.noise4D=F(),this.group=new t,this.lines=[],this.particleCount=150,this.segmentCount=100,this.material=new e({color:8035999,transparent:!0,opacity:.3,blending:s}),this.init()}createFlowLine(){const t=[],e=new r,s=new i(100*(Math.random()-.5),100*(Math.random()-.5),100*(Math.random()-.5));t.push(s.clone());for(let r=1;rt.clone()))}}init(){for(let t=0;t{const r=e.points.map(((e,r)=>{const a=this.noise4D(.02*e.x,.02*e.y,.02*e.z,t+.1*s);return new i(e.x+.1*Math.cos(a*Math.PI*2),e.y+.1*Math.sin(a*Math.PI*2),e.z+.05*(Math.cos(a*Math.PI)+Math.sin(a*Math.PI)))}));e.line.geometry.setFromPoints(r),e.line.geometry.computeBoundingSphere()})),this.group.rotation.x+=1e-4,this.group.rotation.y+=1e-4}}class A{constructor(){this.noise4D=F(),this.spheres=[],this.materials=[],this.baseGeometry=new n(1,3),this.createMaterials(),this.init()}createMaterials(){[5270655,8035999,4217967].forEach((t=>{this.materials.push(new o({color:t,transparent:!0,opacity:.2,shininess:100,specular:8035999,side:l,wireframe:Math.random()>.7}))}))}init(){for(let t=0;t<20;t++){const t=new h(this.baseGeometry,this.materials[Math.floor(Math.random()*this.materials.length)]),e=30+30*Math.random(),s=Math.random()*Math.PI*2,r=Math.random()*Math.PI;t.position.set(e*Math.sin(r)*Math.cos(s),e*Math.sin(r)*Math.sin(s),e*Math.cos(r)),t.scale.setScalar(2*Math.random()+.5),t.userData={originalPosition:t.position.clone(),rotationSpeed:.002*(Math.random()-.5),pulseSpeed:.002*Math.random()+.001,pulseOffset:Math.random()*Math.PI*2},this.spheres.push(t)}}update(t){this.spheres.forEach(((e,s)=>{const r=this.noise4D(.02*e.position.x,.02*e.position.y,.02*e.position.z,t),i=e.userData.originalPosition;e.position.x=i.x+2*Math.cos(t+s)*r,e.position.y=i.y+2*Math.sin(t+s)*r,e.position.z=i.z+2*Math.cos(.5*t+s)*r,e.rotation.x+=e.userData.rotationSpeed,e.rotation.y+=1.2*e.userData.rotationSpeed;const a=.1*Math.sin(t*e.userData.pulseSpeed+e.userData.pulseOffset)+1,n=e.userData.originalScale||1;e.scale.setScalar(n*a),e.material.transparent&&(e.material.opacity=.2+.1*Math.sin(2*t+s))}))}dispose(){this.baseGeometry.dispose(),this.materials.forEach((t=>t.dispose()))}}const L={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float opacity;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\t\tgl_FragColor = opacity * texel;\n\n\n\t\t}"};class Q{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){}dispose(){}}const H=new u(-1,1,1,-1,0,1);const I=new class extends r{constructor(){super(),this.setAttribute("position",new d([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new d([0,2,0,0,2,0],2))}};class V{constructor(t){this._mesh=new h(I,t)}dispose(){this._mesh.geometry.dispose()}render(t){t.render(this._mesh,H)}get material(){return this._mesh.material}set material(t){this._mesh.material=t}}class k extends Q{constructor(t,e){super(),this.textureID=void 0!==e?e:"tDiffuse",t instanceof c?(this.uniforms=t.uniforms,this.material=t):t&&(this.uniforms=m.clone(t.uniforms),this.material=new c({name:void 0!==t.name?t.name:"unspecified",defines:Object.assign({},t.defines),uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader})),this.fsQuad=new V(this.material)}render(t,e,s){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=s.texture),this.fsQuad.material=this.material,this.renderToScreen?(t.setRenderTarget(null),this.fsQuad.render(t)):(t.setRenderTarget(e),this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),this.fsQuad.render(t))}dispose(){this.material.dispose(),this.fsQuad.dispose()}}class O extends Q{constructor(t,e){super(),this.scene=t,this.camera=e,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(t,e,s){const r=t.getContext(),i=t.state;let a,n;i.buffers.color.setMask(!1),i.buffers.depth.setMask(!1),i.buffers.color.setLocked(!0),i.buffers.depth.setLocked(!0),this.inverse?(a=0,n=1):(a=1,n=0),i.buffers.stencil.setTest(!0),i.buffers.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),i.buffers.stencil.setFunc(r.ALWAYS,a,4294967295),i.buffers.stencil.setClear(n),i.buffers.stencil.setLocked(!0),t.setRenderTarget(s),this.clear&&t.clear(),t.render(this.scene,this.camera),t.setRenderTarget(e),this.clear&&t.clear(),t.render(this.scene,this.camera),i.buffers.color.setLocked(!1),i.buffers.depth.setLocked(!1),i.buffers.color.setMask(!0),i.buffers.depth.setMask(!0),i.buffers.stencil.setLocked(!1),i.buffers.stencil.setFunc(r.EQUAL,1,4294967295),i.buffers.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),i.buffers.stencil.setLocked(!0)}}class W extends Q{constructor(){super(),this.needsSwap=!1}render(t){t.state.buffers.stencil.setLocked(!1),t.state.buffers.stencil.setTest(!1)}}class j{constructor(t,e){if(this.renderer=t,this._pixelRatio=t.getPixelRatio(),void 0===e){const s=t.getSize(new f);this._width=s.width,this._height=s.height,(e=new p(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:g})).texture.name="EffectComposer.rt1"}else this._width=e.width,this._height=e.height;this.renderTarget1=e,this.renderTarget2=e.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new k(L),this.copyPass.material.blending=v,this.clock=new w}swapBuffers(){const t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t}addPass(t){this.passes.push(t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(t,e){this.passes.splice(e,0,t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(t){const e=this.passes.indexOf(t);-1!==e&&this.passes.splice(e,1)}isLastEnabledPass(t){for(let e=t+1;e\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 invSize;\n\t\t\t\tuniform vec2 direction;\n\t\t\t\tuniform float gaussianCoefficients[KERNEL_RADIUS];\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tfloat weightSum = gaussianCoefficients[0];\n\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv ).rgb * weightSum;\n\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\n\t\t\t\t\t\tfloat x = float(i);\n\t\t\t\t\t\tfloat w = gaussianCoefficients[i];\n\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\n\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset ).rgb;\n\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset ).rgb;\n\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\n\t\t\t\t\t\tweightSum += 2.0 * w;\n\t\t\t\t\t}\n\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})}getCompositeMaterial(t){return new c({defines:{NUM_MIPS:t},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\t\t\t\tuniform sampler2D blurTexture1;\n\t\t\t\tuniform sampler2D blurTexture2;\n\t\t\t\tuniform sampler2D blurTexture3;\n\t\t\t\tuniform sampler2D blurTexture4;\n\t\t\t\tuniform sampler2D blurTexture5;\n\t\t\t\tuniform float bloomStrength;\n\t\t\t\tuniform float bloomRadius;\n\t\t\t\tuniform float bloomFactors[NUM_MIPS];\n\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\n\n\t\t\t\tfloat lerpBloomFactor(const in float factor) {\n\t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\n\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\n\t\t\t\t}"})}}Y.BlurDirectionX=new f(1,0),Y.BlurDirectionY=new f(0,1);class G{constructor(){this.scene=new T,this.camera=new b(75,window.innerWidth/window.innerHeight,.1,1e3),this.renderer=new S({canvas:document.querySelector("#bg"),antialias:!0,alpha:!0}),this.composer=null,this.flowField=new E,this.spheres=new A,this.time=0,this.mouse=new f,this.targetRotation=new f,this.init(),this.setupLights(),this.setupPostProcessing(),this.setupEventListeners()}init(){this.renderer.setPixelRatio(Math.min(window.devicePixelRatio,2)),this.renderer.setSize(window.innerWidth,window.innerHeight),this.renderer.toneMapping=C,this.renderer.toneMappingExposure=1,this.camera.position.setZ(30),this.camera.position.setY(5),this.scene.fog=new y(0,.01),this.scene.add(this.flowField.group),this.spheres.spheres.forEach((t=>this.scene.add(t)))}setupPostProcessing(){this.composer=new j(this.renderer);const t=new N(this.scene,this.camera);this.composer.addPass(t);const e=new Y(new f(window.innerWidth,window.innerHeight),.5,.4,.85);this.composer.addPass(e)}setupLights(){const t=new P(4210752,.8),e=new _(8035999,2);e.position.set(10,10,10);const s=new _(5270655,1.5);s.position.set(-10,-10,-10),this.scene.add(t,e,s)}setupEventListeners(){window.addEventListener("resize",(()=>{this.camera.aspect=window.innerWidth/window.innerHeight,this.camera.updateProjectionMatrix(),this.renderer.setSize(window.innerWidth,window.innerHeight),this.composer.setSize(window.innerWidth,window.innerHeight)})),document.addEventListener("mousemove",(t=>{this.mouse.x=t.clientX/window.innerWidth*2-1,this.mouse.y=-t.clientY/window.innerHeight*2+1,this.targetRotation.x=.1*this.mouse.y,this.targetRotation.y=.1*this.mouse.x}))}animate(){requestAnimationFrame(this.animate.bind(this)),this.time+=.001,this.camera.rotation.x+=.05*(this.targetRotation.x-this.camera.rotation.x),this.camera.rotation.y+=.05*(this.targetRotation.y-this.camera.rotation.y),this.flowField.update(this.time),this.spheres.update(this.time),this.composer.render()}dispose(){this.renderer.dispose(),this.scene.traverse((t=>{t.geometry&&t.geometry.dispose(),t.material&&(Array.isArray(t.material)?t.material.forEach((t=>t.dispose())):t.material.dispose())}))}}export{G as Scene}; diff --git a/assets/animation-6CpB2BtV.js b/assets/animation-6CpB2BtV.js new file mode 100644 index 0000000..98b3a5a --- /dev/null +++ b/assets/animation-6CpB2BtV.js @@ -0,0 +1 @@ +import{r as t}from"./vendor-CJ7Qk68r.js";var e={exports:{}},n={},i=t,s=Symbol.for("react.element"),o=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function u(t,e,n){var i,o={},u=null,h=null;for(i in void 0!==n&&(u=""+n),void 0!==e.key&&(u=""+e.key),void 0!==e.ref&&(h=e.ref),e)r.call(e,i)&&!l.hasOwnProperty(i)&&(o[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps)void 0===o[i]&&(o[i]=e[i]);return{$$typeof:s,type:t,key:u,ref:h,props:o,_owner:a.current}}n.Fragment=o,n.jsx=u,n.jsxs=u,e.exports=n;var h=e.exports;function c(t){if("undefined"==typeof Proxy)return t;const e=new Map;return new Proxy(((...e)=>t(...e)),{get:(n,i)=>"create"===i?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}function d(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}const p=t=>Array.isArray(t);function m(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i{e[0][n]=t.get(),e[1][n]=t.getVelocity()})),e}function g(t,e,n,i){if("function"==typeof e){const[s,o]=v(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=v(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function y(t,e,n){const i=t.getProps();return g(i,e,void 0!==n?n:i.custom,t)}const x=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],P=["initial",...x],T=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],w=new Set(T),S=t=>1e3*t,b=t=>t/1e3,A={type:"spring",stiffness:500,damping:25,restSpeed:10},V={type:"keyframes",duration:.8},E={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},C=(t,{keyframes:e})=>e.length>2?V:w.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:A:E;function M(t,e){return t?t[e]||t.default||t:void 0}const D=!1,R=t=>null!==t;function k(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(R),o=e&&"loop"!==n&&e%2==1?0:s.length-1;return o&&void 0!==i?i:s[o]}const L=t=>t;const j=["read","resolveKeyframes","update","preRender","render","postRender"];function F(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=j.reduce(((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(l.schedule(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{r=t,i?s=!0:(i=!0,[e,n]=[n,e],n.clear(),e.forEach(a),i=!1,s&&(s=!1,l.process(t)))}};return l}(o),t)),{}),{read:a,resolveKeyframes:l,update:u,preRender:h,render:c,postRender:d}=r,p=()=>{const o=performance.now();n=!1,s.delta=i?1e3/60:Math.max(Math.min(o-s.timestamp,40),1),s.timestamp=o,s.isProcessing=!0,a.process(s),l.process(s),u.process(s),h.process(s),c.process(s),d.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(p))};return{schedule:j.reduce(((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(p)),a.schedule(e,o,r)),e}),{}),cancel:t=>{for(let e=0;e(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function $(t,e,n,i){if(t===e&&n===i)return L;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=N(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:N(s(t),e,i)}const W=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Y=t=>e=>1-t(1-e),K=$(.33,1.53,.69,.99),z=Y(K),X=W(z),H=t=>(t*=2)<1?.5*z(t):.5*(2-Math.pow(2,-10*(t-1))),G=t=>1-Math.sin(Math.acos(t)),_=Y(G),q=W(G),Z=t=>/^0[^.\s]+$/u.test(t);let J=L;const Q=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),tt=t=>e=>"string"==typeof e&&e.startsWith(t),et=tt("--"),nt=tt("var(--"),it=t=>!!nt(t)&&st.test(t.split("/*")[0].trim()),st=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ot=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function rt(t,e,n=1){const[i,s]=function(t){const e=ot.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${null!=n?n:i}`,s]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return Q(t)?parseFloat(t):t}return it(s)?rt(s,e,n+1):s}const at=(t,e,n)=>n>e?e:n"number"==typeof t,parse:parseFloat,transform:t=>t},ut={...lt,transform:t=>at(0,1,t)},ht={...lt,default:1},ct=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),dt=ct("deg"),pt=ct("%"),mt=ct("px"),ft=ct("vh"),vt=ct("vw"),gt={...pt,parse:t=>pt.parse(t)/100,transform:t=>pt.transform(100*t)},yt=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),xt=t=>t===lt||t===mt,Pt=(t,e)=>parseFloat(t.split(", ")[e]),Tt=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const s=i.match(/^matrix3d\((.+)\)$/u);if(s)return Pt(s[1],e);{const e=i.match(/^matrix\((.+)\)$/u);return e?Pt(e[1],t):0}},wt=new Set(["x","y","z"]),St=T.filter((t=>!wt.has(t)));const bt={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Tt(4,13),y:Tt(5,14)};bt.translateX=bt.x,bt.translateY=bt.y;const At=t=>e=>e.test(t),Vt=[lt,mt,pt,dt,vt,ft,{test:t=>"auto"===t,parse:t=>t}],Et=t=>Vt.find(At(t)),Ct=new Set;let Mt=!1,Dt=!1;function Rt(){if(Dt){const t=Array.from(Ct).filter((t=>t.needsMeasurement)),e=new Set(t.map((t=>t.element))),n=new Map;e.forEach((t=>{const e=function(t){const e=[];return St.forEach((n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))})),e}(t);e.length&&(n.set(t,e),t.render())})),t.forEach((t=>t.measureInitialState())),e.forEach((t=>{t.render();const e=n.get(t);e&&e.forEach((([e,n])=>{var i;null===(i=t.getValue(e))||void 0===i||i.set(n)}))})),t.forEach((t=>t.measureEndState())),t.forEach((t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)}))}Dt=!1,Mt=!1,Ct.forEach((t=>t.complete())),Ct.clear()}function kt(){Ct.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(Dt=!0)}))}class Lt{constructor(t,e,n,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ct.add(this),Mt||(Mt=!0,B.read(kt),B.resolveKeyframes(Rt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;for(let s=0;sMath.round(1e5*t)/1e5,Ft=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Bt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ot=(t,e)=>n=>Boolean("string"==typeof n&&Bt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),It=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(Ft);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Ut={...lt,transform:t=>Math.round((t=>at(0,255,t))(t))},Nt={test:Ot("rgb","red"),parse:It("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Ut.transform(t)+", "+Ut.transform(e)+", "+Ut.transform(n)+", "+jt(ut.transform(i))+")"};const $t={test:Ot("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:Nt.transform},Wt={test:Ot("hsl","hue"),parse:It("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+pt.transform(jt(e))+", "+pt.transform(jt(n))+", "+jt(ut.transform(i))+")"},Yt={test:t=>Nt.test(t)||$t.test(t)||Wt.test(t),parse:t=>Nt.test(t)?Nt.parse(t):Wt.test(t)?Wt.parse(t):$t.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Nt.transform(t):Wt.transform(t)},Kt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const zt="number",Xt="color",Ht=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Gt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(Ht,(t=>(Yt.test(t)?(i.color.push(o),s.push(Xt),n.push(Yt.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(zt),n.push(parseFloat(t))),++o,"${}"))).split("${}");return{values:n,split:r,indexes:i,types:s}}function _t(t){return Gt(t).values}function qt(t){const{split:e,types:n}=Gt(t),i=e.length;return t=>{let s="";for(let o=0;o"number"==typeof t?0:t;const Jt={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(Ft))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(Kt))||void 0===n?void 0:n.length)||0)>0},parse:_t,createTransformer:qt,getAnimatableNone:function(t){const e=_t(t);return qt(t)(e.map(Zt))}},Qt=new Set(["brightness","contrast","saturate","opacity"]);function te(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Ft)||[];if(!i)return t;const s=n.replace(i,"");let o=Qt.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const ee=/\b([a-z-]*)\(.*?\)/gu,ne={...Jt,getAnimatableNone:t=>{const e=t.match(ee);return e?e.map(te).join(" "):t}},ie={borderWidth:mt,borderTopWidth:mt,borderRightWidth:mt,borderBottomWidth:mt,borderLeftWidth:mt,borderRadius:mt,radius:mt,borderTopLeftRadius:mt,borderTopRightRadius:mt,borderBottomRightRadius:mt,borderBottomLeftRadius:mt,width:mt,maxWidth:mt,height:mt,maxHeight:mt,top:mt,right:mt,bottom:mt,left:mt,padding:mt,paddingTop:mt,paddingRight:mt,paddingBottom:mt,paddingLeft:mt,margin:mt,marginTop:mt,marginRight:mt,marginBottom:mt,marginLeft:mt,backgroundPositionX:mt,backgroundPositionY:mt},se={rotate:dt,rotateX:dt,rotateY:dt,rotateZ:dt,scale:ht,scaleX:ht,scaleY:ht,scaleZ:ht,skew:dt,skewX:dt,skewY:dt,distance:mt,translateX:mt,translateY:mt,translateZ:mt,x:mt,y:mt,z:mt,perspective:mt,transformPerspective:mt,opacity:ut,originX:gt,originY:gt,originZ:mt},oe={...lt,transform:Math.round},re={...ie,...se,zIndex:oe,size:mt,fillOpacity:ut,strokeOpacity:ut,numOctaves:oe},ae={...re,color:Yt,backgroundColor:Yt,outlineColor:Yt,fill:Yt,stroke:Yt,borderColor:Yt,borderTopColor:Yt,borderRightColor:Yt,borderBottomColor:Yt,borderLeftColor:Yt,filter:ne,WebkitFilter:ne},le=t=>ae[t];function ue(t,e){let n=le(t);return n!==ne&&(n=Jt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const he=new Set(["auto","none","0"]);class ce extends Lt{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let a=0;a{e.getValue(t).set(n)})),this.resolveNoneKeyframes()}}function de(t){return"function"==typeof t}let pe;function me(){pe=void 0}const fe={now:()=>(void 0===pe&&fe.set(I.isProcessing||D?I.timestamp:performance.now()),pe),set:t=>{pe=t,queueMicrotask(me)}},ve=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Jt.test(t)&&"0"!==t||t.startsWith("url(")));class ge{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...r}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=fe.now(),this.options={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,...r},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(kt(),Rt()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=fe.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:s,delay:o,onComplete:r,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=ve(s,e),a=ve(o,e);return!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n{this.resolveFinishedPromise=t}))}}const ye=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},xe=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let o=0;o{const i=e*r,s=i*t,o=i-n,a=Ie(e,r),l=Math.exp(-s);return Fe-o/a*l},o=e=>{const i=e*r*t,o=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=Ie(Math.pow(e,2),r);return(-s(e)+Fe>0?-1:1)*((o-a)*l)/u}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let s=1;s=Ue?1/0:e}const $e=["duration","bounce"],We=["stiffness","damping","mass"];function Ye(t,e){return e.some((e=>void 0!==t[e]))}function Ke(t=Ce,e=Ee){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:u,mass:h,duration:c,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:Ae,stiffness:we,damping:Se,mass:be,isResolvedFromDuration:!1,...t};if(!Ye(t,We)&&Ye(t,$e))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,o=2*at(.05,1,1-t.bounce)*Math.sqrt(s);e={...e,mass:be,stiffness:s,damping:o}}else{const n=Be(t);e={...e,...n,mass:be},e.isResolvedFromDuration=!0}return e}({...n,velocity:-b(n.velocity||0)}),m=d||0,f=u/(2*Math.sqrt(l*h)),v=r-o,g=b(Math.sqrt(l/h)),y=Math.abs(v)<5;let x;if(i||(i=y?Me.granular:Me.default),s||(s=y?De.granular:De.default),f<1){const t=Ie(g,f);x=e=>{const n=Math.exp(-f*g*e);return r-n*((m+f*g*v)/t*Math.sin(t*e)+v*Math.cos(t*e))}}else if(1===f)x=t=>r-Math.exp(-g*t)*(v+(m+g*v)*t);else{const t=g*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*g*e),i=Math.min(t*e,300);return r-n*((m+f*g*v)*Math.sinh(i)+t*v*Math.cosh(i))/t}}const P={calculatedDuration:p&&c||null,next:t=>{const e=x(t);if(p)a.done=t>=c;else{let n=0;f<1&&(n=0===t?S(m):Te(x,t,e));const o=Math.abs(n)<=i,l=Math.abs(r-e)<=s;a.done=o&&l}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(Ne(P),Ue),e=xe((e=>P.next(t*e).value),t,30);return t+"ms "+e}};return P}function ze({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:h}){const c=t[0],d={done:!1,value:c},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)-m*Math.exp(-t/i),y=t=>v+g(t),x=t=>{const e=g(t),n=y(t);d.done=Math.abs(e)<=u,d.value=d.done?v:n};let P,T;const w=t=>{var e;(e=d.value,void 0!==a&&el)&&(P=t,T=Ke({keyframes:[d.value,p(d.value)],velocity:Te(y,t,d.value),damping:s,stiffness:o,restDelta:u,restSpeed:h}))};return w(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==P||(e=!0,x(t),w(t)),void 0!==P&&t>=P?T.next(t-P):(!e&&x(t),d)}}}const Xe=$(.42,0,1,1),He=$(0,0,.58,1),Ge=$(.42,0,.58,1),_e=t=>Array.isArray(t)&&"number"==typeof t[0],qe={linear:L,easeIn:Xe,easeInOut:Ge,easeOut:He,circIn:G,circInOut:q,circOut:_,backIn:z,backInOut:X,backOut:K,anticipate:H},Ze=t=>{if(_e(t)){J(4===t.length);const[e,n,i,s]=t;return $(e,n,i,s)}return"string"==typeof t?(J(void 0!==qe[t]),qe[t]):t},Je=(t,e)=>n=>e(t(n)),Qe=(...t)=>t.reduce(Je),tn=(t,e,n)=>t+(e-t)*n;function en(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function nn(t,e){return n=>n>0?e:t}const sn=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},on=[$t,Nt,Wt];function rn(t){const e=(n=t,on.find((t=>t.test(n))));var n;if(!Boolean(e))return!1;let i=e.parse(t);return e===Wt&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=en(a,i,t+1/3),o=en(a,i,t),r=en(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}(i)),i}const an=(t,e)=>{const n=rn(t),i=rn(e);if(!n||!i)return nn(t,e);const s={...n};return t=>(s.red=sn(n.red,i.red,t),s.green=sn(n.green,i.green,t),s.blue=sn(n.blue,i.blue,t),s.alpha=tn(n.alpha,i.alpha,t),Nt.transform(s))},ln=new Set(["none","hidden"]);function un(t,e){return n=>tn(t,e,n)}function hn(t){return"number"==typeof t?un:"string"==typeof t?it(t)?nn:Yt.test(t)?an:pn:Array.isArray(t)?cn:"object"==typeof t?Yt.test(t)?an:dn:nn}function cn(t,e){const n=[...t],i=n.length,s=t.map(((t,n)=>hn(t)(t,e[n])));return t=>{for(let e=0;e{for(const e in i)n[e]=i[e](t);return n}}const pn=(t,e)=>{const n=Jt.createTransformer(e),i=Gt(t),s=Gt(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?ln.has(t)&&!s.values.length||ln.has(e)&&!i.values.length?function(t,e){return ln.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):Qe(cn(function(t,e){var n;const i=[],s={color:0,var:0,number:0};for(let o=0;oe[0];if(2===o&&t[0]===t[1])return()=>e[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const r=function(t,e,n){const i=[],s=n||mn,o=t.length-1;for(let r=0;r{let n=0;if(a>1)for(;nl(at(t[0],t[o-1],e)):l}function vn(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=ye(0,e,i);t.push(tn(n,1,s))}}(e,t.length-1),e}function gn({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(Ze):Ze(i),o={done:!1,value:e[0]},r=function(t,e){return t.map((t=>t*e))}(n&&n.length===e.length?n:vn(e),t),a=fn(r,e,{ease:Array.isArray(s)?s:(l=e,u=s,l.map((()=>u||Ge)).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}const yn=t=>{const e=({timestamp:e})=>t(e);return{start:()=>B.update(e,!0),stop:()=>O(e),now:()=>I.isProcessing?I.timestamp:fe.now()}},xn={decay:ze,inertia:ze,tween:gn,keyframes:gn,spring:Ke},Pn=t=>t/100;class Tn extends ge{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:n,element:i,keyframes:s}=this.options,o=(null==i?void 0:i.KeyframeResolver)||Lt;this.resolver=new o(s,((t,e)=>this.onKeyframesResolved(t,e)),e,n,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,r=de(e)?e:xn[e]||gn;let a,l;r!==gn&&"number"!=typeof t[0]&&(a=Qe(Pn,mn(t[0],t[1])),t=[0,100]);const u=r({...this.options,keyframes:t});"mirror"===s&&(l=r({...this.options,keyframes:[...t].reverse(),velocity:-o})),null===u.calculatedDuration&&(u.calculatedDuration=Ne(u));const{calculatedDuration:h}=u,c=h+i;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:h,resolvedDuration:c,totalDuration:c*(n+1)-i}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:r,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:h}=n;if(null===this.startTime)return s.next(0);const{delay:c,repeat:d,repeatType:p,repeatDelay:m,onUpdate:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const v=this.currentTime-c*(this.speed>=0?1:-1),g=this.speed>=0?v<0:v>u;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let y=this.currentTime,x=s;if(d){const t=Math.min(this.currentTime,u)/h;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,m&&(n-=m/h)):"mirror"===p&&(x=o)),y=at(0,1,n)*h}const P=g?{done:!1,value:a[0]}:x.next(y);r&&(P.value=r(P.value));let{done:T}=P;g||null===l||(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const w=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return w&&void 0!==i&&(P.value=k(a,this.options,i)),f&&f(P.value),w&&this.finish(),P}get duration(){const{resolved:t}=this;return t?b(t.calculatedDuration):0}get time(){return b(this.currentTime)}set time(t){t=S(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=b(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=yn,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t((t=>this.tick(t)))),e&&e();const i=this.driver.now();null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=i):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const wn=new Set(["opacity","clipPath","filter","transform"]);function Sn(t){let e;return()=>(void 0===e&&(e=t()),e)}const bn={linearEasing:void 0};function An(t,e){const n=Sn(t);return()=>{var t;return null!==(t=bn[e])&&void 0!==t?t:n()}}const Vn=An((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}),"linearEasing");function En(t){return Boolean("function"==typeof t&&Vn()||!t||"string"==typeof t&&(t in Mn||Vn())||_e(t)||Array.isArray(t)&&t.every(En))}const Cn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Mn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Cn([0,.65,.55,1]),circOut:Cn([.55,0,1,.45]),backIn:Cn([.31,.01,.66,-.59]),backOut:Cn([.33,1.53,.69,.99])};function Dn(t,e){return t?"function"==typeof t&&Vn()?xe(t,e):_e(t)?Cn(t):Array.isArray(t)?t.map((t=>Dn(t,e)||Mn.easeOut)):Mn[t]:void 0}function Rn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeInOut",times:l}={}){const u={[e]:n};l&&(u.offset=l);const h=Dn(a,s);return Array.isArray(h)&&(u.easing=h),t.animate(u,{delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"})}function kn(t,e){t.timeline=e,t.onfinish=null}const Ln=Sn((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));const jn={anticipate:H,backInOut:X,circInOut:q};class Fn extends ge{constructor(t){super(t);const{name:e,motionValue:n,element:i,keyframes:s}=this.options;this.resolver=new ce(s,((t,e)=>this.onKeyframesResolved(t,e)),e,n,i),this.resolver.scheduleResolve()}initPlayback(t,e){var n;let{duration:i=300,times:s,ease:o,type:r,motionValue:a,name:l,startTime:u}=this.options;if(!(null===(n=a.owner)||void 0===n?void 0:n.current))return!1;var h;if("string"==typeof o&&Vn()&&o in jn&&(o=jn[o]),de((h=this.options).type)||"spring"===h.type||!En(h.ease)){const{onComplete:e,onUpdate:n,motionValue:a,element:l,...u}=this.options,h=function(t,e){const n=new Tn({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:t[0]};const s=[];let o=0;for(;!i.done&&o<2e4;)i=n.sample(o),s.push(i.value),o+=10;return{times:void 0,keyframes:s,duration:o-10,ease:"linear"}}(t,u);1===(t=h.keyframes).length&&(t[1]=t[0]),i=h.duration,s=h.times,o=h.ease,r="keyframes"}const c=Rn(a.owner.current,l,t,{...this.options,duration:i,times:s,ease:o});return c.startTime=null!=u?u:this.calcStartTime(),this.pendingTimeline?(kn(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;a.set(k(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:i,times:s,type:r,ease:o,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return b(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return b(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=S(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:e}=this;if(!e)return L;const{animation:n}=e;kn(n,t)}else this.pendingTimeline=t;return L}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n,duration:i,type:s,ease:o,times:r}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,element:l,...u}=this.options,h=new Tn({...u,keyframes:n,duration:i,type:s,ease:o,times:r,isGenerator:!0}),c=S(this.time);t.setWithVelocity(h.sample(c-10).value,h.sample(c).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r}=t;return Ln()&&n&&wn.has(n)&&e&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}}const Bn=Sn((()=>void 0!==window.ScrollTimeline));class On{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,e){return Promise.all(this.animations).then(t).catch(e)}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;nBn()&&n.attachTimeline?n.attachTimeline(t):e(n)));return()=>{n.forEach(((t,e)=>{t&&t(),this.animations[e].stop()}))}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;ee[t]()))}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const In=(t,e,n,i={},s,o)=>r=>{const a=M(i,t)||{},l=a.delay||i.delay||0;let{elapsed:u=0}=i;u-=S(l);let h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...h}){return!!Object.keys(h).length})(a)||(h={...h,...C(t,h)}),h.duration&&(h.duration=S(h.duration)),h.repeatDelay&&(h.repeatDelay=S(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let c=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(h.duration=0,0===h.delay&&(c=!0)),c&&!o&&void 0!==e.get()){const t=k(h.keyframes,a);if(void 0!==t)return B.update((()=>{h.onUpdate(t),h.onComplete()})),new On([])}return!o&&Fn.supports(h)?new Fn(h):new Tn(h)};function Un(t,e){-1===t.indexOf(e)&&t.push(e)}function Nn(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class $n{constructor(){this.subscriptions=[]}add(t){return Un(this.subscriptions,t),()=>Nn(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s{const n=fe.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=fe.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new $n);const n=this.events[t].add(e);return"change"===t?()=>{n(),B.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=fe.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Pe(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise((e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Yn(t,e){return new Wn(t,e)}function Kn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Yn(n))}const zn=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Xn="data-"+zn("framerAppearId");function Hn(t){return t.props[Xn]}const Gn=t=>Boolean(t&&t.getVelocity);function _n(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Gn(i)&&i.add))return n.add(e);var i}function qn({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function Zn(t,e,{delay:n=0,transitionOverride:i,type:s}={}){var o;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=e;i&&(r=i);const u=[],h=s&&t.animationState&&t.animationState.getState()[s];for(const c in l){const e=t.getValue(c,null!==(o=t.latestValues[c])&&void 0!==o?o:null),i=l[c];if(void 0===i||h&&qn(h,c))continue;const s={delay:n,...M(r||{},c)};let a=!1;if(window.MotionHandoffAnimation){const e=Hn(t);if(e){const t=window.MotionHandoffAnimation(e,c,B);null!==t&&(s.startTime=t,a=!0)}}_n(t,c),e.start(In(c,e,i,t.shouldReduceMotion&&w.has(c)?{type:!1}:s,t,a));const d=e.animation;d&&u.push(d)}return a&&Promise.all(u).then((()=>{B.update((()=>{a&&function(t,e){const n=y(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const a in o)Kn(t,a,(r=o[a],p(r)?r[r.length-1]||0:r));var r}(t,a)}))})),u}function Jn(t,e,n={}){var i;const s=y(t,e,"exit"===n.type?null===(i=t.presenceContext)||void 0===i?void 0:i.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(o=n.transitionOverride);const r=s?()=>Promise.all(Zn(t,s,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:s=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,n=0,i=0,s=1,o){const r=[],a=(t.variantChildren.size-1)*i,l=1===s?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(Qn).forEach(((t,i)=>{t.notify("AnimationStart",e),r.push(Jn(t,e,{...o,delay:n+l(i)}).then((()=>t.notify("AnimationComplete",e))))})),Promise.all(r)}(t,e,s+i,r,a,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then((()=>e()))}return Promise.all([r(),a(n.delay)])}function Qn(t,e){return t.sortNodePosition(e)}const ti=P.length;function ei(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&ei(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;nPromise.all(e.map((({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map((e=>Jn(t,e,n)));i=Promise.all(s)}else if("string"==typeof e)i=Jn(t,e,n);else{const s="function"==typeof e?y(t,e,n.custom):e;i=Promise.all(Zn(t,s,n))}return i.then((()=>{t.notify("AnimationComplete",e)}))}(t,e,n))))}function oi(t){let e=si(t),n=li(),i=!0;const s=e=>(n,i)=>{var s;const o=y(t,i,"exit"===e?null===(s=t.presenceContext)||void 0===s?void 0:s.custom:void 0);if(o){const{transition:t,transitionEnd:e,...i}=o;n={...n,...i,...e}}return n};function o(o){const{props:r}=t,a=ei(t.parent)||{},l=[],u=new Set;let h={},c=1/0;for(let e=0;ec&&x,b=!1;const A=Array.isArray(y)?y:[y];let V=A.reduce(s(v),{});!1===P&&(V={});const{prevResolvedValues:E={}}=g,C={...E,...V},M=e=>{S=!0,u.has(e)&&(b=!0,u.delete(e)),g.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in C){const e=V[t],n=E[t];if(h.hasOwnProperty(t))continue;let i=!1;i=p(e)&&p(n)?!m(e,n):e!==n,i?null!=e?M(t):u.add(t):void 0!==e&&u.has(t)?M(t):g.protectedKeys[t]=!0}g.prevProp=y,g.prevResolvedValues=V,g.isActive&&(h={...h,...V}),i&&t.blockInitialAnimation&&(S=!1);S&&(!(T&&w)||b)&&l.push(...A.map((t=>({animation:t,options:{type:v}}))))}if(u.size){const e={};u.forEach((n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=null!=i?i:null})),l.push({animation:e})}let v=Boolean(l.length);return!i||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(v=!1),i=!1,v?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){var s;if(n[e].isActive===i)return Promise.resolve();null===(s=t.variantChildren)||void 0===s||s.forEach((t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,i)})),n[e].isActive=i;const r=o(e);for(const t in n)n[t].protectedKeys={};return r},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=li(),i=!0}}}function ri(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!m(e,t)}function ai(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function li(){return{animate:ai(!0),whileInView:ai(),whileHover:ai(),whileTap:ai(),whileDrag:ai(),whileFocus:ai(),exit:ai()}}class ui{constructor(t){this.isMounted=!1,this.node=t}update(){}}let hi=0;const ci={animation:{Feature:class extends ui{constructor(t){super(t),t.animationState||(t.animationState=oi(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();d(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),null===(t=this.unmountControls)||void 0===t||t.call(this)}}},exit:{Feature:class extends ui{constructor(){super(...arguments),this.id=hi++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then((()=>e(this.id)))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}},di=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function pi(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}function mi(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function fi(t,e,n,i){return mi(t,e,(t=>e=>di(e)&&t(e,pi(e)))(n),i)}const vi=(t,e)=>Math.abs(t-e);class gi{constructor(t,e,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=Pi(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=vi(t.x,e.x),i=vi(t.y,e.y);return Math.sqrt(n**2+i**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:s}=I;this.history.push({...i,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=yi(e,this.transformPagePoint),B.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(this.dragSnapToOrigin&&s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Pi("pointercancel"===t.type?this.lastMoveEventInfo:yi(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!di(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.contextWindow=i||window;const o=yi(pi(t),this.transformPagePoint),{point:r}=o,{timestamp:a}=I;this.history=[{...r,timestamp:a}];const{onSessionStart:l}=e;l&&l(t,Pi(o,this.history)),this.removeListeners=Qe(fi(this.contextWindow,"pointermove",this.handlePointerMove),fi(this.contextWindow,"pointerup",this.handlePointerUp),fi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),O(this.updatePoint)}}function yi(t,e){return e?{point:e(t.point)}:t}function xi(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Pi({point:t},e){return{point:t,delta:xi(t,wi(e)),offset:xi(t,Ti(e)),velocity:Si(e,.1)}}function Ti(t){return t[0]}function wi(t){return t[t.length-1]}function Si(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=wi(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>S(e)));)n--;if(!i)return{x:0,y:0};const o=b(s.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function bi(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const Ai=bi("dragHorizontal"),Vi=bi("dragVertical");function Ei(t){let e=!1;if("y"===t)e=Vi();else if("x"===t)e=Ai();else{const t=Ai(),n=Vi();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Ci(){const t=Ei(!0);return!t||(t(),!1)}function Mi(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function Di(t){return t.max-t.min}function Ri(t,e,n,i=.5){t.origin=i,t.originPoint=tn(e.min,e.max,t.origin),t.scale=Di(n)/Di(e),t.translate=tn(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function ki(t,e,n,i){Ri(t.x,e.x,n.x,i?i.originX:void 0),Ri(t.y,e.y,n.y,i?i.originY:void 0)}function Li(t,e,n){t.min=n.min+e.min,t.max=t.min+Di(e)}function ji(t,e,n){t.min=e.min-n.min,t.max=t.min+Di(e)}function Fi(t,e,n){ji(t.x,e.x,n.x),ji(t.y,e.y,n.y)}function Bi(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Oi(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min({x:{min:0,max:0},y:{min:0,max:0}});function Wi(t){return[t("x"),t("y")]}function Yi({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Ki(t){return void 0===t||1===t}function zi({scale:t,scaleX:e,scaleY:n}){return!Ki(t)||!Ki(e)||!Ki(n)}function Xi(t){return zi(t)||Hi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Hi(t){return Gi(t.x)||Gi(t.y)}function Gi(t){return t&&"0%"!==t}function _i(t,e,n){return n+e*(t-n)}function qi(t,e,n,i,s){return void 0!==s&&(t=_i(t,s,i)),_i(t,n,i)+e}function Zi(t,e=0,n=1,i,s){t.min=qi(t.min,e,n,i,s),t.max=qi(t.max,e,n,i,s)}function Ji(t,{x:e,y:n}){Zi(t.x,e.translate,e.scale,e.originPoint),Zi(t.y,n.translate,n.scale,n.originPoint)}const Qi=.999999999999,ts=1.0000000000001;function es(t,e){t.min=t.min+e,t.max=t.max+e}function ns(t,e,n,i,s=.5){Zi(t,e,n,tn(t.min,t.max,s),i)}function is(t,e){ns(t.x,e.x,e.scaleX,e.scale,e.originX),ns(t.y,e.y,e.scaleY,e.scale,e.originY)}function ss(t,e){return Yi(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const os=({current:t})=>t?t.ownerDocument.defaultView:null,rs=new WeakMap;class as{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:i}=this.getProps();this.panSession=new gi(t,{onSessionStart:t=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(pi(t,"page").point)},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Ei(n),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Wi((t=>{let e=this.getAxisMotionValue(t).get()||0;if(pt.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=Di(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e})),s&&B.postRender((()=>s(t,e))),_n(this.visualElement,"transform");const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:s,onDrag:o}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>Wi((t=>{var e;return"paused"===this.getAnimationState(t)&&(null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.play())}))},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,contextWindow:os(this.visualElement)})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=e;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&B.postRender((()=>s(t,e)))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!ls(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},i){return void 0!==e&&tn&&(t=i?tn(n,t,i.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout,s=this.constraints;e&&Mi(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!i)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:Bi(t.x,n,s),y:Bi(t.y,e,i)}}(i.layoutBox,e),this.elastic=function(t=Ii){return!1===t?t=0:!0===t&&(t=Ii),{x:Ui(t,"left","right"),y:Ui(t,"top","bottom")}}(n),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Wi((t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(i.layoutBox[t],this.constraints[t]))}))}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!Mi(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=function(t,e,n){const i=ss(t,n),{scroll:s}=e;return s&&(es(i.x,s.offset.x),es(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:Oi(t.x,e.x),y:Oi(t.y,e.y)}}(i.layout.layoutBox,s);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=Yi(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Wi((r=>{if(!ls(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const u=i?200:1e6,h=i?40:1e7,c={type:"inertia",velocity:n?t[r]:0,bounceStiffness:u,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,c)}));return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return _n(this.visualElement,t),n.start(In(t,n,0,e,this.visualElement,!1))}stopAnimation(){Wi((t=>this.getAxisMotionValue(t).stop()))}pauseAnimation(){Wi((t=>{var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.pause()}))}getAnimationState(t){var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),i=n[e];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Wi((e=>{const{drag:n}=this.getProps();if(!ls(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:o}=i.layout.layoutBox[e];s.set(t[e]-tn(n,o,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Mi(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Wi((t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const n=e.get();i[t]=function(t,e){let n=.5;const i=Di(t),s=Di(e);return s>i?n=ye(e.min,e.max-i,t.min):i>s&&(n=ye(t.min,t.max-s,e.min)),at(0,1,n)}({min:n,max:n},this.constraints[t])}}));const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Wi((e=>{if(!ls(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];n.set(tn(s,o,i[e]))}))}addListeners(){if(!this.visualElement.current)return;rs.set(this.visualElement,this);const t=fi(this.visualElement.current,"pointerdown",(t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)})),e=()=>{const{dragConstraints:t}=this.getProps();Mi(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),B.read(e);const s=mi(window,"resize",(()=>this.scalePositionWithinConstraints())),o=n.addEventListener("didUpdate",(({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Wi((e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))})),this.visualElement.render())}));return()=>{s(),t(),i(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Ii,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function ls(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const us=t=>(e,n)=>{t&&B.postRender((()=>t(e,n)))};const hs=t.createContext(null);const cs=t.createContext({}),ds=t.createContext({}),ps={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ms(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const fs={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!mt.test(t))return t;t=parseFloat(t)}return`${ms(t,e.target.x)}% ${ms(t,e.target.y)}%`}},vs={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Jt.parse(t);if(s.length>5)return i;const o=Jt.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const u=tn(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=u),"number"==typeof s[3+r]&&(s[3+r]/=u),o(s)}},gs={};const{schedule:ys,cancel:xs}=F(queueMicrotask,!1);class Ps extends t.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;var o;o=ws,Object.assign(gs,o),s&&(e.group&&e.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",(()=>{this.safeToRemove()})),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),ps.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o?(o.isPresent=s,i||t.layoutDependency!==e||void 0===e?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||B.postRender((()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),ys.postRender((()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()})))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Ts(e){const[n,i]=function(){const e=t.useContext(hs);if(null===e)return[!0,null];const{isPresent:n,onExitComplete:i,register:s}=e,o=t.useId();t.useEffect((()=>s(o)),[]);const r=t.useCallback((()=>i&&i(o)),[o,i]);return!n&&i?[!1,r]:[!0]}(),s=t.useContext(cs);return h.jsx(Ps,{...e,layoutGroup:s,switchLayoutGroup:t.useContext(ds),isPresent:n,safeToRemove:i})}const ws={borderRadius:{...fs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:fs,borderTopRightRadius:fs,borderBottomLeftRadius:fs,borderBottomRightRadius:fs,boxShadow:vs},Ss=["TopLeft","TopRight","BottomLeft","BottomRight"],bs=Ss.length,As=t=>"string"==typeof t?parseFloat(t):t,Vs=t=>"number"==typeof t||mt.test(t);function Es(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Cs=Ds(0,.5,_),Ms=Ds(.5,.95,L);function Ds(t,e,n){return i=>ie?1:n(ye(t,e,i))}function Rs(t,e){t.min=e.min,t.max=e.max}function ks(t,e){Rs(t.x,e.x),Rs(t.y,e.y)}function Ls(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function js(t,e,n,i,s){return t=_i(t-=e,1/n,i),void 0!==s&&(t=_i(t,1/s,i)),t}function Fs(t,e,[n,i,s],o,r){!function(t,e=0,n=1,i=.5,s,o=t,r=t){pt.test(e)&&(e=parseFloat(e),e=tn(r.min,r.max,e/100)-r.min);if("number"!=typeof e)return;let a=tn(o.min,o.max,i);t===o&&(a-=e),t.min=js(t.min,e,n,a,s),t.max=js(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const Bs=["x","scaleX","originX"],Os=["y","scaleY","originY"];function Is(t,e,n,i){Fs(t.x,e,Bs,n?n.x:void 0,i?i.x:void 0),Fs(t.y,e,Os,n?n.y:void 0,i?i.y:void 0)}function Us(t){return 0===t.translate&&1===t.scale}function Ns(t){return Us(t.x)&&Us(t.y)}function $s(t,e){return t.min===e.min&&t.max===e.max}function Ws(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Ys(t,e){return Ws(t.x,e.x)&&Ws(t.y,e.y)}function Ks(t){return Di(t.x)/Di(t.y)}function zs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Xs{constructor(){this.members=[]}add(t){Un(this.members,t),t.scheduleRender()}remove(t){if(Nn(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex((e=>t===e));if(0===e)return!1;let n;for(let i=e;i>=0;i--){const t=this.members[i];if(!1!==t.isPresent){n=t;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&n.hide()}}exitAnimationComplete(){this.members.forEach((t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()}))}scheduleRender(){this.members.forEach((t=>{t.instance&&t.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Hs=(t,e)=>t.depth-e.depth;class Gs{constructor(){this.children=[],this.isDirty=!1}add(t){Un(this.children,t),this.isDirty=!0}remove(t){Nn(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Hs),this.isDirty=!1,this.children.forEach(t)}}function _s(t){const e=Gn(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const qs={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Zs="undefined"!=typeof window&&void 0!==window.MotionDebug,Js=["","X","Y","Z"],Qs={visibility:"hidden"};let to=0;function eo(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function no(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Hn(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",B,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&no(i)}function io({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t={},n=(null==e?void 0:e())){this.id=to++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Zs&&(qs.totalNodes=qs.resolvedTargetDeltas=qs.recalculatedProjection=0),this.nodes.forEach(ro),this.nodes.forEach(mo),this.nodes.forEach(fo),this.nodes.forEach(ao),Zs&&window.MotionDebug.record(qs)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;t(e,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(t,e){const n=fe.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(O(i),t(o-e))};return B.read(i,!0),()=>O(i)}(i,250),ps.hasAnimatedSinceResize&&(ps.hasAnimatedSinceResize=!1,this.nodes.forEach(po))}))}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&r&&(s||o)&&this.addEventListener("didUpdate",(({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||r.getDefaultTransition()||To,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=r.getProps(),l=!this.targetLayout||!Ys(this.targetLayout,i)||n,u=!e&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||u||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,u);const e={...M(s,"layout"),onPlay:o,onComplete:a};(r.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||po(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,O(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(vo),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&no(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let s=0;s{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let n=0;nQi&&(e.x=1),e.yQi&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox,e.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=e;l?(this.projectionDelta&&this.prevProjectionDelta?(Ls(this.prevProjectionDelta.x,this.projectionDelta.x),Ls(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),ki(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===r&&this.treeScale.y===a&&zs(this.projectionDelta.x,this.prevProjectionDelta.x)&&zs(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),Zs&&qs.recalculatedProjection++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e;if(null===(e=this.options.visualElement)||void 0===e||e.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1){const n=this.snapshot,i=n?n.latestValues:{},s={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const r={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,h=Boolean(a&&!u&&!0===this.options.crossfade&&!this.path.some(Po));let c;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,d,p,m,f,v;yo(o.x,t.x,n),yo(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Fi(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,m=this.relativeTargetOrigin,f=r,v=n,xo(p.x,m.x,f.x,v),xo(p.y,m.y,f.y,v),c&&(l=this.relativeTarget,d=c,$s(l.x,d.x)&&$s(l.y,d.y))&&(this.isProjectionDirty=!1),c||(c={x:{min:0,max:0},y:{min:0,max:0}}),ks(c,this.relativeTarget)),a&&(this.animationValues=s,function(t,e,n,i,s,o){s?(t.opacity=tn(0,void 0!==n.opacity?n.opacity:1,Cs(i)),t.opacityExit=tn(void 0!==e.opacity?e.opacity:1,0,Ms(i))):o&&(t.opacity=tn(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,i));for(let r=0;r{ps.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n){const i=Gn(t)?t:Yn(t);return i.start(In("",i,e,n)),i.animation}(0,1e3,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0}))}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&Ao(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Di(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Di(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}ks(e,n),is(e,s),ki(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Xs);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&eo("z",t,i,this.animationValues);for(let s=0;s{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()})),this.root.nodes.forEach(uo),this.root.sharedNodes.clear()}}}function so(t){t.updateLayout()}function oo(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:i}=t.layout,{animationType:s}=t.options,o=n.source!==t.layout.source;"size"===s?Wi((t=>{const i=o?n.measuredBox[t]:n.layoutBox[t],s=Di(i);i.min=e[t].min,i.max=i.min+s})):Ao(s,n.layoutBox,e)&&Wi((i=>{const s=o?n.measuredBox[i]:n.layoutBox[i],r=Di(e[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)}));const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};ki(r,e,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?ki(a,t.applyTransform(i,!0),n.measuredBox):ki(a,e,n.layoutBox);const l=!Ns(r);let u=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};Fi(r,n.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Fi(a,e,o.layoutBox),Ys(r,a)||(u=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function ro(t){Zs&&qs.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function ao(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function lo(t){t.clearSnapshot()}function uo(t){t.clearMeasurements()}function ho(t){t.isLayoutDirty=!1}function co(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function po(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function mo(t){t.resolveTargetDelta()}function fo(t){t.calcProjection()}function vo(t){t.resetSkewAndRotation()}function go(t){t.removeLeadSnapshot()}function yo(t,e,n){t.translate=tn(e.translate,0,n),t.scale=tn(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function xo(t,e,n,i){t.min=tn(e.min,n.min,i),t.max=tn(e.max,n.max,i)}function Po(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const To={duration:.45,ease:[.4,0,.1,1]},wo=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),So=wo("applewebkit/")&&!wo("chrome/")?Math.round:L;function bo(t){t.min=So(t.min),t.max=So(t.max)}function Ao(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=Ks(e),s=Ks(n),o=.2,!(Math.abs(i-s)<=o));var i,s,o}function Vo(t){var e;return t!==t.root&&(null===(e=t.scroll)||void 0===e?void 0:e.wasRoot)}const Eo=io({attachResizeListener:(t,e)=>mi(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Co={current:void 0},Mo=io({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Co.current){const t=new Eo({});t.mount(window),t.setOptions({layoutScroll:!0}),Co.current=t}return Co.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Do={pan:{Feature:class extends ui{constructor(){super(...arguments),this.removePointerDownListener=L}onPointerDown(t){this.session=new gi(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:os(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:us(t),onStart:us(e),onMove:n,onEnd:(t,e)=>{delete this.session,i&&B.postRender((()=>i(t,e)))}}}mount(){this.removePointerDownListener=fi(this.node.current,"pointerdown",(t=>this.onPointerDown(t)))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends ui{constructor(t){super(t),this.removeGroupControls=L,this.removeListeners=L,this.controls=new as(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||L}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Mo,MeasureLayout:Ts}};function Ro(t,e){const n=e?"pointerenter":"pointerleave",i=e?"onHoverStart":"onHoverEnd";return fi(t.current,n,((n,s)=>{if("touch"===n.pointerType||Ci())return;const o=t.getProps();t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",e);const r=o[i];r&&B.postRender((()=>r(n,s)))}),{passive:!t.getProps()[i]})}const ko=(t,e)=>!!e&&(t===e||ko(t,e.parentElement));function Lo(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,pi(n))}const jo=new WeakMap,Fo=new WeakMap,Bo=t=>{const e=jo.get(t.target);e&&e(t)},Oo=t=>{t.forEach(Bo)};function Io(t,e,n){const i=function({root:t,...e}){const n=t||document;Fo.has(n)||Fo.set(n,{});const i=Fo.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(Oo,{root:t,...e})),i[s]}(e);return jo.set(t,n),i.observe(t),()=>{jo.delete(t),i.unobserve(t)}}const Uo={some:0,all:1};const No={inView:{Feature:class extends ui{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Uo[i]};return Io(this.node.current,o,(t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=e?n:i;o&&o(t)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends ui{constructor(){super(...arguments),this.removeStartListeners=L,this.removeEndListeners=L,this.removeAccessibleListeners=L,this.startPointerPress=(t,e)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),i=fi(window,"pointerup",((t,e)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:i,globalTapTarget:s}=this.node.getProps(),o=s||ko(this.node.current,t.target)?n:i;o&&B.update((()=>o(t,e)))}),{passive:!(n.onTap||n.onPointerUp)}),s=fi(window,"pointercancel",((t,e)=>this.cancelPress(t,e)),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Qe(i,s),this.startPress(t,e)},this.startAccessiblePress=()=>{const t=mi(this.node.current,"keydown",(t=>{if("Enter"!==t.key||this.isPressing)return;this.removeEndListeners(),this.removeEndListeners=mi(this.node.current,"keyup",(t=>{"Enter"===t.key&&this.checkPressEnd()&&Lo("up",((t,e)=>{const{onTap:n}=this.node.getProps();n&&B.postRender((()=>n(t,e)))}))})),Lo("down",((t,e)=>{this.startPress(t,e)}))})),e=mi(this.node.current,"blur",(()=>{this.isPressing&&Lo("cancel",((t,e)=>this.cancelPress(t,e)))}));this.removeAccessibleListeners=Qe(t,e)}}startPress(t,e){this.isPressing=!0;const{onTapStart:n,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&B.postRender((()=>n(t,e)))}checkPressEnd(){this.removeEndListeners(),this.isPressing=!1;return this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Ci()}cancelPress(t,e){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&B.postRender((()=>n(t,e)))}mount(){const t=this.node.getProps(),e=fi(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=mi(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Qe(e,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends ui{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Qe(mi(this.node.current,"focus",(()=>this.onFocus())),mi(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends ui{mount(){this.unmount=Qe(Ro(this.node,!0),Ro(this.node,!1))}unmount(){}}}},$o={layout:{ProjectionNode:Mo,MeasureLayout:Ts}},Wo=t.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Yo=t.createContext({}),Ko="undefined"!=typeof window,zo=Ko?t.useLayoutEffect:t.useEffect,Xo=t.createContext({strict:!1});function Ho(e,n,i,s,o){var r,a;const{visualElement:l}=t.useContext(Yo),u=t.useContext(Xo),h=t.useContext(hs),c=t.useContext(Wo).reducedMotion,d=t.useRef();s=s||u.renderer,!d.current&&s&&(d.current=s(e,{visualState:n,parent:l,props:i,presenceContext:h,blockInitialAnimation:!!h&&!1===h.initial,reducedMotionConfig:c}));const p=d.current,m=t.useContext(ds);!p||p.projection||!o||"html"!==p.type&&"svg"!==p.type||function(t,e,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Go(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&Mi(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,layoutScroll:l,layoutRoot:u})}(d.current,i,o,m);const f=t.useRef(!1);t.useInsertionEffect((()=>{p&&f.current&&p.update(i,h)}));const v=i[Xn],g=t.useRef(Boolean(v)&&!(null===(r=window.MotionHandoffIsComplete)||void 0===r?void 0:r.call(window,v))&&(null===(a=window.MotionHasOptimisedAnimation)||void 0===a?void 0:a.call(window,v)));return zo((()=>{p&&(f.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),ys.render(p.render),g.current&&p.animationState&&p.animationState.animateChanges())})),t.useEffect((()=>{p&&(!g.current&&p.animationState&&p.animationState.animateChanges(),g.current&&(queueMicrotask((()=>{var t;null===(t=window.MotionHandoffMarkAsComplete)||void 0===t||t.call(window,v)})),g.current=!1))})),p}function Go(t){if(t)return!1!==t.options.allowProjection?t.projection:Go(t.parent)}function _o(e,n,i){return t.useCallback((t=>{t&&e.mount&&e.mount(t),n&&(t?n.mount(t):n.unmount()),i&&("function"==typeof i?i(t):Mi(i)&&(i.current=t))}),[n])}function qo(t){return d(t.animate)||P.some((e=>f(t[e])))}function Zo(t){return Boolean(qo(t)||t.variants)}function Jo(e){const{initial:n,animate:i}=function(t,e){if(qo(t)){const{initial:e,animate:n}=t;return{initial:!1===e||f(e)?e:void 0,animate:f(n)?n:void 0}}return!1!==t.inherit?e:{}}(e,t.useContext(Yo));return t.useMemo((()=>({initial:n,animate:i})),[Qo(n),Qo(i)])}function Qo(t){return Array.isArray(t)?t.join(" "):t}const tr={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},er={};for(const _r in tr)er[_r]={isEnabled:t=>tr[_r].some((e=>!!t[e]))};const nr=Symbol.for("motionComponentSymbol");function ir({preloadedFeatures:e,createVisualElement:n,useRender:i,useVisualState:s,Component:o}){e&&function(t){for(const e in t)er[e]={...er[e],...t[e]}}(e);const r=t.forwardRef((function(e,r){let a;const l={...t.useContext(Wo),...e,layoutId:sr(e)},{isStatic:u}=l,c=Jo(e),d=s(e,u);if(!u&&Ko){t.useContext(Xo).strict;const e=function(t){const{drag:e,layout:n}=er;if(!e&&!n)return{};const i={...e,...n};return{MeasureLayout:(null==e?void 0:e.isEnabled(t))||(null==n?void 0:n.isEnabled(t))?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(l);a=e.MeasureLayout,c.visualElement=Ho(o,d,l,n,e.ProjectionNode)}return h.jsxs(Yo.Provider,{value:c,children:[a&&c.visualElement?h.jsx(a,{visualElement:c.visualElement,...l}):null,i(o,e,_o(d,c.visualElement,r),d,u,c.visualElement)]})}));return r[nr]=o,r}function sr({layoutId:e}){const n=t.useContext(cs).id;return n&&void 0!==e?n+"-"+e:e}const or=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function rr(t){return"string"==typeof t&&!t.includes("-")&&!!(or.indexOf(t)>-1||/[A-Z]/u.test(t))}function ar(t,{style:e,vars:n},i,s){Object.assign(t.style,e,s&&s.getProjectionStyles(i));for(const o in n)t.style.setProperty(o,n[o])}const lr=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function ur(t,e,n,i){ar(t,e,void 0,i);for(const s in e.attrs)t.setAttribute(lr.has(s)?s:zn(s),e.attrs[s])}function hr(t,{layout:e,layoutId:n}){return w.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!gs[t]||"opacity"===t)}function cr(t,e,n){var i;const{style:s}=t,o={};for(const r in s)(Gn(s[r])||e.style&&Gn(e.style[r])||hr(r,t)||void 0!==(null===(i=null==n?void 0:n.getValue(r))||void 0===i?void 0:i.liveStyle))&&(o[r]=s[r]);return o}function dr(t,e,n){const i=cr(t,e,n);for(const s in t)if(Gn(t[s])||Gn(e[s])){i[-1!==T.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return i}const pr=e=>(n,i)=>{const s=t.useContext(Yo),o=t.useContext(hs),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},i,s,o){const r={latestValues:mr(i,s,o,t),renderState:e()};return n&&(r.mount=t=>n(i,t,r)),r}(e,n,s,o);return i?r():function(e){const n=t.useRef(null);return null===n.current&&(n.current=e()),n.current}(r)};function mr(t,e,n,i){const s={},o=i(t,{});for(const d in o)s[d]=_s(o[d]);let{initial:r,animate:a}=t;const l=qo(t),u=Zo(t);e&&u&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let h=!!n&&!1===n.initial;h=h||!1===r;const c=h?a:r;if(c&&"boolean"!=typeof c&&!d(c)){const e=Array.isArray(c)?c:[c];for(let n=0;n({style:{},transform:{},transformOrigin:{},vars:{}}),vr=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),gr=(t,e)=>e&&"number"==typeof t?e.transform(t):t,yr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},xr=T.length;function Pr(t,e,n){const{style:i,vars:s,transformOrigin:o}=t;let r=!1,a=!1;for(const l in e){const t=e[l];if(w.has(l))r=!0;else if(et(l))s[l]=t;else{const e=gr(t,re[l]);l.startsWith("origin")?(a=!0,o[l]=e):i[l]=e}}if(e.transform||(r||n?i.transform=function(t,e,n){let i="",s=!0;for(let o=0;o"string"==typeof t&&"svg"===t.toLowerCase(),Vr={useVisualState:pr({scrapeMotionValuesFromProps:dr,createRenderState:vr,onMount:(t,e,{renderState:n,latestValues:i})=>{B.read((()=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}})),B.render((()=>{br(n,i,Ar(e.tagName),t.transformTemplate),ur(e,n)}))}})},Er={useVisualState:pr({scrapeMotionValuesFromProps:cr,createRenderState:fr})};function Cr(t,e,n){for(const i in e)Gn(e[i])||hr(i,n)||(t[i]=e[i])}function Mr(e,n){const i={};return Cr(i,e.style||{},e),Object.assign(i,function({transformTemplate:e},n){return t.useMemo((()=>{const t={style:{},transform:{},transformOrigin:{},vars:{}};return Pr(t,n,e),Object.assign({},t.vars,t.style)}),[n])}(e,n)),i}function Dr(t,e){const n={},i=Mr(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const Rr=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function kr(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Rr.has(t)}let Lr=t=>!kr(t);try{(jr=require("@emotion/is-prop-valid").default)&&(Lr=t=>t.startsWith("on")?!kr(t):jr(t))}catch(Gr){}var jr;function Fr(e,n,i,s){const o=t.useMemo((()=>{const t={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return br(t,n,Ar(s),e.transformTemplate),{...t.attrs,style:{...t.style}}}),[n]);if(e.style){const t={};Cr(t,e.style,e),o.style={...t,...o.style}}return o}function Br(e=!1){return(n,i,s,{latestValues:o},r)=>{const a=(rr(n)?Fr:Dr)(i,o,r,n),l=function(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||(Lr(s)||!0===n&&kr(s)||!e&&!kr(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}(i,"string"==typeof n,e),u=n!==t.Fragment?{...l,...a,ref:s}:{},{children:h}=i,c=t.useMemo((()=>Gn(h)?h.get():h),[h]);return t.createElement(n,{...u,children:c})}}function Or(t,e){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){return ir({...rr(n)?Vr:Er,preloadedFeatures:t,useRender:Br(i),createVisualElement:e,Component:n})}}const Ir={current:null},Ur={current:!1};const Nr=new WeakMap,$r=[...Vt,Yt,Jt],Wr=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Yr{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},r={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Lt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=fe.now();this.renderScheduledAtthis.bindToMotionValue(e,t))),Ur.current||function(){if(Ur.current=!0,Ko)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ir.current=t.matches;t.addListener(e),e()}else Ir.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Ir.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Nr.delete(this.current),this.projection&&this.projection.unmount(),O(this.notifyUpdate),O(this.render),this.valueSubscriptions.forEach((t=>t())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=w.has(t),i=e.on("change",(e=>{this.latestValues[t]=e,this.props.onUpdate&&B.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),s=e.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,(()=>{i(),s(),o&&o(),e.owner&&e.stop()}))}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in er){const e=er[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let n=0;ne.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Yn(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let i=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var s;return null!=i&&("string"==typeof i&&(Q(i)||Z(i))?i=parseFloat(i):(s=i,!$r.find(At(s))&&Jt.test(e)&&(i=ue(t,e))),this.setBaseTarget(t,Gn(i)?i.get():i)),Gn(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props;let i;if("string"==typeof n||"object"==typeof n){const s=g(this.props,n,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);s&&(i=s[t])}if(n&&void 0!==i)return i;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||Gn(s)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new $n),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class Kr extends Yr{constructor(){super(...arguments),this.KeyframeResolver=ce}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}}class zr extends Kr{constructor(){super(...arguments),this.type="html",this.renderInstance=ar}readValueFromInstance(t,e){if(w.has(e)){const t=le(e);return t&&t.default||0}{const i=(n=t,window.getComputedStyle(n)),s=(et(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return ss(t,e)}build(t,e,n){Pr(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return cr(t,e,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Gn(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}}class Xr extends Kr{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=$i}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(w.has(e)){const t=le(e);return t&&t.default||0}return e=lr.has(e)?e:zn(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return dr(t,e,n)}build(t,e,n){br(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,i){ur(t,e,0,i)}mount(t){this.isSVGTag=Ar(t.tagName),super.mount(t)}}const Hr=c(Or({...ci,...No,...Do,...$o},((e,n)=>rr(e)?new Xr(n):new zr(n,{allowProjection:e!==t.Fragment}))));export{h as j,Hr as m}; diff --git a/assets/index-Be1QyJmn.css b/assets/index-Be1QyJmn.css deleted file mode 100644 index a5b6b43..0000000 --- a/assets/index-Be1QyJmn.css +++ /dev/null @@ -1 +0,0 @@ -:root{--primary: #2A2B2E;--accent: #506C7F;--glow: #7A9E9F;--background: #030303;--text: #E4E4E4;--card-bg: rgba(255, 255, 255, .03);--hover: rgba(122, 158, 159, .08);--font-display: "Garnett", system-ui, -apple-system;--font-body: "Aeonik", sans-serif}@font-face{font-family:Garnett;src:url(/fonts/Garnett-Regular.woff2) format("woff2");font-weight:400;font-display:swap}@font-face{font-family:Aeonik;src:url(/fonts/Aeonik-Regular.woff2) format("woff2");font-weight:400;font-display:swap}@font-face{font-family:Space Mono;src:url(https://fonts.gstatic.com/s/spacemono/v12/i7dPIFZifjKcF5UAWdDRYEF8RQ.woff2) format("woff2");font-display:swap}@font-face{font-family:Syncopate;src:url(https://fonts.gstatic.com/s/syncopate/v19/pe0sMIuPIYBCpEV5eFdCBfe_.woff2) format("woff2");font-display:swap}@font-face{font-family:Cinzel;src:url(https://fonts.gstatic.com/s/cinzel/v23/8vIU7ww63mVu7gtR-kwKxNvkNOjw-tbnfYPlDX5Z.woff2) format("woff2");font-display:swap}@font-face{font-family:Audiowide;src:url(https://fonts.gstatic.com/s/audiowide/v16/l7gdbjpo0cum0ckerWCdlg_O.woff2) format("woff2");font-display:swap}@font-face{font-family:Cormorant Garamond;src:url(https://fonts.gstatic.com/s/cormorantgaramond/v16/co3WmX5slCNuHLi8bLeY9MK7whWMhyjYrEPjuw-N.woff2) format("woff2");font-display:swap}*{margin:0;padding:0;box-sizing:border-box}body{font-family:var(--font-body);color:var(--text);line-height:1.6;overflow-x:hidden;background:var(--background);letter-spacing:-.01em}canvas{position:fixed;top:0;left:0;z-index:-1;opacity:.6}#app{position:relative;max-width:1200px;margin:0 auto;padding:4rem 2rem}header{margin-bottom:8rem;opacity:0;transform:translateY(20px);animation:fadeIn 1s ease forwards}h1{font-family:var(--font-display);font-size:5.5rem;font-weight:500;margin-bottom:1.5rem;line-height:.9;letter-spacing:-.05em;position:relative;background:linear-gradient(135deg,var(--text) 0%,var(--glow) 50%,var(--accent) 100%);-webkit-background-clip:text;background-clip:text;color:transparent;text-shadow:0 0 30px rgba(122,158,159,.1)}h1:after{content:"";position:absolute;bottom:-10px;left:0;width:60px;height:1px;background:linear-gradient(90deg,var(--accent),transparent);opacity:.5}h2{font-family:var(--font-display);font-size:2.5rem;font-weight:500;margin-bottom:2rem;letter-spacing:-.03em;position:relative;background:linear-gradient(135deg,var(--accent) 0%,var(--glow) 100%);-webkit-background-clip:text;background-clip:text;color:transparent}h2:before{content:"";position:absolute;top:-20px;left:-40px;width:200%;height:200%;background:radial-gradient(circle at 50% 50%,var(--glow) 0%,transparent 70%);opacity:.05;pointer-events:none;z-index:-1}.platforms-marquee{position:relative;width:110%;left:-5%;overflow:hidden;padding:2rem 0;margin:4rem 0;background:linear-gradient(to right,transparent,var(--card-bg) 20%,var(--card-bg) 80%,transparent)}.platforms-track{display:flex;gap:4rem;animation:scroll 30s linear infinite;white-space:nowrap;will-change:transform;width:fit-content;padding-left:4rem;-webkit-mask-image:linear-gradient(to right,transparent 0%,black 10%,black 90%,transparent 100%);mask-image:linear-gradient(to right,transparent 0%,black 10%,black 90%,transparent 100%)}.platform-name{font-size:2.5rem;opacity:.7;transition:all .3s ease;cursor:pointer;padding:.5rem 2rem;position:relative;display:inline-block}.platform-name:hover{opacity:1;transform:scale(1.05)}.platform-terminals{font-family:Space Mono,monospace;letter-spacing:-.05em;color:var(--glow);text-shadow:0 0 10px rgba(122,158,159,.3)}.platform-radical{font-family:var(--font-display);font-weight:700;background:linear-gradient(135deg,var(--accent),var(--glow));-webkit-background-clip:text;background-clip:text;color:transparent;letter-spacing:.1em}.platform-pathfinder{font-family:"Syncopate",var(--font-display);letter-spacing:-.02em;color:var(--text);border-bottom:2px solid var(--glow)}.platform-wuji{font-family:Cinzel,serif;letter-spacing:.2em;color:var(--accent);text-shadow:0 0 20px rgba(80,108,127,.2)}.platform-boom{font-family:"Audiowide",var(--font-display);color:var(--glow);text-shadow:0 0 15px rgba(122,158,159,.4);transform:skew(-5deg)}.platform-journey{font-family:Cormorant Garamond,serif;font-style:italic;color:var(--text);letter-spacing:.05em}@keyframes scroll{0%{transform:translate(0)}to{transform:translate(calc(-50% - 2rem))}}.tagline{font-size:1.75rem;line-height:1.4;max-width:650px;font-weight:400;color:var(--text);opacity:.8;letter-spacing:-.02em}.section{margin:8rem 0;opacity:0;transform:translateY(20px);transition:opacity .8s ease,transform .8s ease}.section.visible{opacity:1;transform:translateY(0)}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:3rem;margin-top:4rem}.card{background:var(--card-bg);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);padding:2.5rem;border-radius:2px;border:1px solid rgba(255,255,255,.03);transition:all .6s cubic-bezier(.23,1,.32,1);position:relative;overflow:hidden}.card:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background:radial-gradient(circle at var(--x, 50%) var(--y, 50%),rgba(122,158,159,.1) 0%,transparent 50%);opacity:0;transition:opacity .3s ease}.card:hover:before{opacity:1}.learn-more-content{max-height:0;opacity:0;overflow:hidden;transition:all .4s cubic-bezier(.23,1,.32,1);margin:0;padding:0}.card:hover .learn-more-content{max-height:300px;opacity:1;margin-top:1.5rem}.learn-more-content ul{list-style:none;padding:0;margin:0}.learn-more-content li{position:relative;padding-left:1.5rem;margin-bottom:.75rem;font-size:.95rem;opacity:.8;transform:translateY(10px);transition:all .3s ease}.learn-more-content li:before{content:"/";position:absolute;left:0;color:var(--glow);opacity:.6}.card:hover .learn-more-content li{transform:translateY(0);opacity:1}.experience-list{list-style:none;padding:0;margin:1.5rem 0 0}.experience-list li{position:relative;padding-left:1.5rem;margin-bottom:1rem;font-size:.95rem;opacity:.8;line-height:1.5}.experience-list li:before{content:"/";position:absolute;left:0;color:var(--glow);opacity:.6}.card h3{font-family:var(--font-display);color:var(--glow);margin-bottom:1.25rem;font-size:1.5rem;letter-spacing:-.02em;font-weight:500}.card p{font-size:1rem;line-height:1.7;opacity:.8;letter-spacing:-.01em}.learn-more{display:inline-flex;align-items:center;margin-top:1.5rem;color:var(--accent);text-decoration:none;font-size:.95rem;transition:all .3s ease;font-weight:500;letter-spacing:.02em}.learn-more:hover{color:var(--glow);transform:translate(3px)}.cta-container{display:flex;flex-direction:column;gap:1rem;margin-top:3rem;align-items:flex-start}.zcal-inline-widget{margin:2rem 0;width:100%;max-width:600px}.cta-button{background:transparent;color:var(--text);border:1px solid var(--accent);padding:1rem 2.5rem;font-size:.95rem;font-weight:500;cursor:pointer;transition:all .4s cubic-bezier(.23,1,.32,1);font-family:var(--font-body);letter-spacing:.02em;position:relative;overflow:hidden;width:100%;max-width:600px;text-align:center}.cta-button:before{content:"";position:absolute;top:50%;left:50%;width:150%;height:150%;background:var(--accent);transform:translate(-50%,-50%) scale(0);opacity:0;transition:transform .6s ease,opacity .4s ease;z-index:-1}.cta-button:hover{border-color:var(--glow)}.cta-button:hover:before{transform:translate(-50%,-50%) scale(1);opacity:.1}.text-link{color:var(--text);text-decoration:none;opacity:.8;transition:all .3s ease;font-weight:500;letter-spacing:.02em}.text-link:hover{opacity:1;color:var(--glow)}footer{margin-top:12rem;padding:3rem 0;border-top:1px solid rgba(255,255,255,.03)}.social-links{display:flex;gap:3rem;margin-bottom:1.5rem}.social-links a{color:var(--text);text-decoration:none;opacity:.7;transition:all .3s ease;font-size:.95rem;font-weight:500;letter-spacing:.02em}.social-links a:hover{opacity:1;color:var(--glow)}.copyright{opacity:.5;font-size:.9rem;letter-spacing:.01em}.back-link{display:inline-block;color:var(--text);text-decoration:none;opacity:.8;margin-bottom:2rem;font-size:1rem;transition:all .3s ease;letter-spacing:.02em}.back-link:hover{opacity:1;color:var(--glow);transform:translate(-3px)}.manifesto-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(400px,1fr));gap:4rem;margin-bottom:6rem}.manifesto-item{position:relative;padding:2rem;background:var(--card-bg);border:1px solid rgba(255,255,255,.03);border-radius:2px;transition:all .6s cubic-bezier(.23,1,.32,1)}.manifesto-item:hover{transform:translateY(-3px);background:var(--hover);border-color:var(--glow)}.manifesto-item h2{font-size:2rem;margin-bottom:1.5rem}.manifesto-item p{font-size:1.1rem;line-height:1.7;opacity:.9;letter-spacing:-.01em}.principles{margin-top:8rem;padding:3rem;background:var(--card-bg);border:1px solid rgba(255,255,255,.03);border-radius:2px}.principles h2{margin-bottom:3rem}@media (max-width: 768px){.manifesto-grid{grid-template-columns:1fr;gap:2rem}.manifesto-item{padding:1.5rem}.manifesto-item h2{font-size:1.75rem}.principles{padding:1.5rem;margin-top:4rem}}@keyframes fadeIn{to{opacity:1;transform:translateY(0)}}@media (max-width: 768px){#app{padding:2rem 1rem}h1{font-size:3.5rem}.tagline{font-size:1.3rem}.cta-container{flex-direction:column;align-items:flex-start;gap:1.5rem}} diff --git a/assets/index-BeBtB0Xr.js b/assets/index-BeBtB0Xr.js new file mode 100644 index 0000000..beed74f --- /dev/null +++ b/assets/index-BeBtB0Xr.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-CIdzXA5l.js","assets/animation-6CpB2BtV.js","assets/vendor-CJ7Qk68r.js","assets/Manifesto-Dax6b0Cd.js","assets/Scene-Bgu4qmls.js","assets/three-CHXrHHRv.js"])))=>i.map(i=>d[i]); +import{j as e,m as t}from"./animation-6CpB2BtV.js";import{a as n,r,B as o,R as i,b as s,c as a}from"./vendor-CJ7Qk68r.js";var l;!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver((e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)})).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();var c=n;l=c.createRoot,c.hydrateRoot;const d={},u=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const e=document.querySelector("meta[property=csp-nonce]"),n=(null==e?void 0:e.nonce)||(null==e?void 0:e.getAttribute("nonce"));r=Promise.allSettled(t.map((e=>{if((e=function(e){return"/"+e}(e))in d)return;d[e]=!0;const t=e.endsWith(".css"),r=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${r}`))return;const o=document.createElement("link");return o.rel=t?"stylesheet":"modulepreload",t||(o.as="script"),o.crossOrigin="",o.href=e,n&&o.setAttribute("nonce",n),document.head.appendChild(o),t?new Promise(((t,n)=>{o.addEventListener("load",t),o.addEventListener("error",(()=>n(new Error(`Unable to preload CSS for ${e}`))))})):void 0})))}function o(e){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then((t=>{for(const e of t||[])"rejected"===e.status&&o(e.reason);return e().catch(o)}))},m=()=>e.jsx(t.div,{className:"loading-container",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:e.jsxs("div",{className:"loading-content",children:[e.jsx(t.div,{className:"loading-logo",animate:{scale:[1,1.2,1],opacity:[.5,1,.5]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},children:e.jsx("svg",{width:"50",height:"50",viewBox:"0 0 50 50",fill:"none",children:e.jsx("circle",{cx:"25",cy:"25",r:"20",stroke:"currentColor",strokeWidth:"2"})})}),e.jsx(t.div,{className:"loading-dots",initial:"hidden",animate:"visible",children:[0,1,2].map(((n,r)=>e.jsx(t.span,{className:"dot",animate:{y:["0%","-50%","0%"],opacity:[.5,1,.5]},transition:{duration:1,repeat:1/0,delay:.2*r,ease:"easeInOut"}},r)))})]})}),f=r.lazy((()=>u((()=>import("./Home-CIdzXA5l.js")),__vite__mapDeps([0,1,2])))),p=r.lazy((()=>u((()=>import("./Manifesto-Dax6b0Cd.js")),__vite__mapDeps([3,1,2])))),h=r.lazy((()=>u((()=>import("./Scene-Bgu4qmls.js")),__vite__mapDeps([4,5])).then((e=>({default:e.Scene})))));function y(){const[t,n]=r.useState(null),[a,l]=r.useState(!0);return r.useEffect((()=>((async()=>{try{const e=new h;await e.init(),n(e),await new Promise((e=>setTimeout(e,1e3))),l(!1)}catch(e){l(!1)}})(),()=>{t&&t.dispose()})),[]),r.useEffect((()=>{let e;const n=()=>{clearTimeout(e),e=setTimeout((()=>{t&&t.handleResize()}),250)};return window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n),clearTimeout(e)}}),[t]),a?e.jsx(m,{}):e.jsx(o,{children:e.jsx(r.Suspense,{fallback:e.jsx(m,{}),children:e.jsxs(i,{children:[e.jsx(s,{path:"/",element:e.jsx(f,{onMount:()=>null==t?void 0:t.animate()})}),e.jsx(s,{path:"/manifesto",element:e.jsx(p,{onMount:()=>null==t?void 0:t.animate()})})]})})})}l(document.getElementById("root")).render(e.jsx(a.StrictMode,{children:e.jsx(y,{})})); diff --git a/assets/index-Du2sDgkR.css b/assets/index-Du2sDgkR.css new file mode 100644 index 0000000..05290b4 --- /dev/null +++ b/assets/index-Du2sDgkR.css @@ -0,0 +1 @@ +:root{--primary: #2A2B2E;--accent: #506C7F;--glow: #7A9E9F;--background: #030303;--text: #E4E4E4;--card-bg: rgba(255, 255, 255, .03);--hover: rgba(122, 158, 159, .08);--font-display: "Garnett", system-ui, -apple-system;--font-body: "Aeonik", sans-serif}@font-face{font-family:Garnett;src:url(/fonts/Garnett-Regular.woff2) format("woff2");font-weight:400;font-display:swap}@font-face{font-family:Aeonik;src:url(/fonts/Aeonik-Regular.woff2) format("woff2");font-weight:400;font-display:swap}@font-face{font-family:Space Mono;src:url(https://fonts.gstatic.com/s/spacemono/v12/i7dPIFZifjKcF5UAWdDRYEF8RQ.woff2) format("woff2");font-display:swap}@font-face{font-family:Syncopate;src:url(https://fonts.gstatic.com/s/syncopate/v19/pe0sMIuPIYBCpEV5eFdCBfe_.woff2) format("woff2");font-display:swap}@font-face{font-family:Cinzel;src:url(https://fonts.gstatic.com/s/cinzel/v23/8vIU7ww63mVu7gtR-kwKxNvkNOjw-tbnfYPlDX5Z.woff2) format("woff2");font-display:swap}@font-face{font-family:Audiowide;src:url(https://fonts.gstatic.com/s/audiowide/v16/l7gdbjpo0cum0ckerWCdlg_O.woff2) format("woff2");font-display:swap}@font-face{font-family:Cormorant Garamond;src:url(https://fonts.gstatic.com/s/cormorantgaramond/v16/co3WmX5slCNuHLi8bLeY9MK7whWMhyjYrEPjuw-N.woff2) format("woff2");font-display:swap}*{margin:0;padding:0;box-sizing:border-box}body{font-family:var(--font-body);color:var(--text);line-height:1.6;overflow-x:hidden;background:var(--background);letter-spacing:-.01em}canvas{position:fixed;top:0;left:0;z-index:-1;opacity:.6}#app{position:relative;max-width:1200px;margin:0 auto;padding:4rem 2rem}header{margin-bottom:8rem;opacity:0;transform:translateY(20px);animation:fadeIn 1s ease forwards}h1{font-family:var(--font-display);font-size:5.5rem;font-weight:500;margin-bottom:1.5rem;line-height:.9;letter-spacing:-.05em;position:relative;background:linear-gradient(135deg,var(--text) 0%,var(--glow) 50%,var(--accent) 100%);-webkit-background-clip:text;background-clip:text;color:transparent;text-shadow:0 0 30px rgba(122,158,159,.1)}h1:after{content:"";position:absolute;bottom:-10px;left:0;width:60px;height:1px;background:linear-gradient(90deg,var(--accent),transparent);opacity:.5}h2{font-family:var(--font-display);font-size:2.5rem;font-weight:500;margin-bottom:2rem;letter-spacing:-.03em;position:relative;background:linear-gradient(135deg,var(--accent) 0%,var(--glow) 100%);-webkit-background-clip:text;background-clip:text;color:transparent}h2:before{content:"";position:absolute;top:-20px;left:-40px;width:200%;height:200%;background:radial-gradient(circle at 50% 50%,var(--glow) 0%,transparent 70%);opacity:.05;pointer-events:none;z-index:-1}.platforms-marquee{position:relative;width:110%;left:-5%;overflow:hidden;padding:2rem 0;margin:4rem 0;background:linear-gradient(to right,transparent,var(--card-bg) 20%,var(--card-bg) 80%,transparent)}.platforms-track{display:flex;gap:4rem;animation:scroll 30s linear infinite;white-space:nowrap;will-change:transform;width:fit-content;padding-left:4rem;-webkit-mask-image:linear-gradient(to right,transparent 0%,black 10%,black 90%,transparent 100%);mask-image:linear-gradient(to right,transparent 0%,black 10%,black 90%,transparent 100%)}.platform-name{font-size:2.5rem;opacity:.7;transition:all .3s ease;cursor:pointer;padding:.5rem 2rem;position:relative;display:inline-block}.platform-name:hover{opacity:1;transform:scale(1.05)}.platform-terminals{font-family:Space Mono,monospace;letter-spacing:-.05em;color:var(--glow);text-shadow:0 0 10px rgba(122,158,159,.3)}.platform-radical{font-family:var(--font-display);font-weight:700;background:linear-gradient(135deg,var(--accent),var(--glow));-webkit-background-clip:text;background-clip:text;color:transparent;letter-spacing:.1em}.platform-pathfinder{font-family:"Syncopate",var(--font-display);letter-spacing:-.02em;color:var(--text);border-bottom:2px solid var(--glow)}.platform-wuji{font-family:Cinzel,serif;letter-spacing:.2em;color:var(--accent);text-shadow:0 0 20px rgba(80,108,127,.2)}.platform-boom{font-family:"Audiowide",var(--font-display);color:var(--glow);text-shadow:0 0 15px rgba(122,158,159,.4);transform:skew(-5deg)}.platform-journey{font-family:Cormorant Garamond,serif;font-style:italic;color:var(--text);letter-spacing:.05em}@keyframes scroll{0%{transform:translate(0)}to{transform:translate(calc(-50% - 2rem))}}.tagline{font-size:1.75rem;line-height:1.4;max-width:650px;font-weight:400;color:var(--text);opacity:.8;letter-spacing:-.02em}.section{margin:8rem 0;opacity:0;transform:translateY(20px);transition:opacity .8s ease,transform .8s ease}.section.visible{opacity:1;transform:translateY(0)}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:3rem;margin-top:4rem}.card{background:var(--card-bg);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);padding:2.5rem;border-radius:2px;border:1px solid rgba(255,255,255,.03);transition:transform .6s cubic-bezier(.23,1,.32,1),box-shadow .6s cubic-bezier(.23,1,.32,1);transform-style:preserve-3d;will-change:transform;position:relative;overflow:hidden}.card:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background:radial-gradient(circle at var(--x, 50%) var(--y, 50%),rgba(122,158,159,.1) 0%,transparent 50%);opacity:0;transition:opacity .3s ease}.card:hover:before{opacity:1}.learn-more-content{max-height:0;opacity:0;overflow:hidden;transition:all .4s cubic-bezier(.23,1,.32,1);margin:0;padding:0}.card:hover .learn-more-content{max-height:300px;opacity:1;margin-top:1.5rem}.learn-more-content ul{list-style:none;padding:0;margin:0}.learn-more-content li{position:relative;padding-left:1.5rem;margin-bottom:.75rem;font-size:.95rem;opacity:.8;transform:translateY(10px);transition:all .3s ease}.learn-more-content li:before{content:"/";position:absolute;left:0;color:var(--glow);opacity:.6}.card:hover .learn-more-content li{transform:translateY(0);opacity:1}.experience-list{list-style:none;padding:0;margin:1.5rem 0 0}.experience-list li{position:relative;padding-left:1.5rem;margin-bottom:1rem;font-size:.95rem;opacity:.8;line-height:1.5}.experience-list li:before{content:"/";position:absolute;left:0;color:var(--glow);opacity:.6}.card h3{font-family:var(--font-display);color:var(--glow);margin-bottom:1.25rem;font-size:1.5rem;letter-spacing:-.02em;font-weight:500}.card p{font-size:1rem;line-height:1.7;opacity:.8;letter-spacing:-.01em}.learn-more{display:inline-flex;align-items:center;margin-top:1.5rem;color:var(--accent);text-decoration:none;font-size:.95rem;transition:all .3s ease;font-weight:500;letter-spacing:.02em}.learn-more:hover{color:var(--glow);transform:translate(3px)}.cta-container{display:flex;flex-direction:column;gap:1rem;margin-top:3rem;align-items:flex-start}.zcal-inline-widget{margin:2rem 0;width:100%;max-width:600px}.cta-button{background:transparent;color:var(--text);border:1px solid var(--accent);padding:1rem 2.5rem;font-size:.95rem;font-weight:500;cursor:pointer;transition:all .4s cubic-bezier(.23,1,.32,1);font-family:var(--font-body);letter-spacing:.02em;position:relative;overflow:hidden;width:100%;max-width:600px;text-align:center}.cta-button:before{content:"";position:absolute;top:50%;left:50%;width:150%;height:150%;background:var(--accent);transform:translate(-50%,-50%) scale(0);opacity:0;transition:transform .6s ease,opacity .4s ease;z-index:-1}.cta-button:hover{border-color:var(--glow)}.cta-button:hover:before{transform:translate(-50%,-50%) scale(1);opacity:.1}.text-link{color:var(--text);text-decoration:none;opacity:.8;transition:all .3s ease;font-weight:500;letter-spacing:.02em}.text-link:hover{opacity:1;color:var(--glow)}footer{margin-top:12rem;padding:3rem 0;border-top:1px solid rgba(255,255,255,.03)}.social-links{display:flex;gap:3rem;margin-bottom:1.5rem}.social-links a{color:var(--text);text-decoration:none;opacity:.7;transition:all .3s ease;font-size:.95rem;font-weight:500;letter-spacing:.02em}.social-links a:hover{opacity:1;color:var(--glow)}.copyright{opacity:.5;font-size:.9rem;letter-spacing:.01em}.back-link{display:inline-block;color:var(--text);text-decoration:none;opacity:.8;margin-bottom:2rem;font-size:1rem;transition:all .3s ease;letter-spacing:.02em}.back-link:hover{opacity:1;color:var(--glow);transform:translate(-3px)}.manifesto-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(400px,1fr));gap:4rem;margin-bottom:6rem}.manifesto-item{position:relative;padding:2rem;background:var(--card-bg);border:1px solid rgba(255,255,255,.03);border-radius:2px;transition:transform .6s cubic-bezier(.23,1,.32,1),background .3s ease,border-color .3s ease;transform-style:preserve-3d}.manifesto-item:hover{transform:translateY(-5px) scale(1.02);background:var(--hover)}.manifesto-item h2{font-size:2rem;margin-bottom:1.5rem}.manifesto-item p{font-size:1.1rem;line-height:1.7;opacity:.9;letter-spacing:-.01em}.principles{margin-top:8rem;padding:3rem;background:var(--card-bg);border:1px solid rgba(255,255,255,.03);border-radius:2px}.principles h2{margin-bottom:3rem}@media (max-width: 768px){.manifesto-grid{grid-template-columns:1fr;gap:2rem}.manifesto-item{padding:1.5rem}.manifesto-item h2{font-size:1.75rem}.principles{padding:1.5rem;margin-top:4rem}}@media (max-width: 768px){#app{padding:2rem 1rem}h1{font-size:3.5rem}.tagline{font-size:1.3rem}.cta-container{flex-direction:column;align-items:flex-start;gap:1.5rem}}.platforms-track{animation:scroll 40s linear infinite;filter:blur(0);transition:filter .3s ease}.platforms-track:hover{animation-play-state:paused;filter:blur(0)}.platform-name{transition:transform .3s ease,opacity .3s ease,color .3s ease}.platform-name:hover{transform:scale(1.1);opacity:1;color:var(--glow)}@keyframes fadeIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.section{animation:fadeIn .8s ease-out forwards;animation-play-state:paused}.section.visible{animation-play-state:running}.loading-container{position:fixed;top:0;left:0;width:100%;height:100%;background:#000;display:flex;justify-content:center;align-items:center;z-index:1000}.loading-content{display:flex;flex-direction:column;align-items:center;gap:2rem}.loading-logo{color:#7a9e9f;width:50px;height:50px}.loading-dots{display:flex;gap:.5rem}.dot{width:8px;height:8px;background-color:#7a9e9f;border-radius:50%;display:inline-block}.gradient-text{background:linear-gradient(135deg,#7a9e9f,#506c7f);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}.hero-section{min-height:100vh;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:2rem}.solutions-grid{padding:4rem 2rem}.vision-section{padding:6rem 2rem;background:linear-gradient(to bottom,transparent,rgba(122,158,159,.1))}.tech-stack{display:flex;gap:2rem;flex-wrap:wrap;justify-content:center;margin-top:2rem} diff --git a/assets/index-qu0Y7vr3.js b/assets/index-qu0Y7vr3.js deleted file mode 100644 index 21b6b78..0000000 --- a/assets/index-qu0Y7vr3.js +++ /dev/null @@ -1,3918 +0,0 @@ -var Jx=Object.defineProperty;var Qx=(t,e,n)=>e in t?Jx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ta=(t,e,n)=>Qx(t,typeof e!="symbol"?e+"":e,n);function eS(t,e){for(var n=0;ni[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();function tS(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Gv={exports:{}},vu={},Wv={exports:{}},qe={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var la=Symbol.for("react.element"),nS=Symbol.for("react.portal"),iS=Symbol.for("react.fragment"),rS=Symbol.for("react.strict_mode"),oS=Symbol.for("react.profiler"),sS=Symbol.for("react.provider"),aS=Symbol.for("react.context"),lS=Symbol.for("react.forward_ref"),uS=Symbol.for("react.suspense"),cS=Symbol.for("react.memo"),dS=Symbol.for("react.lazy"),vp=Symbol.iterator;function fS(t){return t===null||typeof t!="object"?null:(t=vp&&t[vp]||t["@@iterator"],typeof t=="function"?t:null)}var jv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$v=Object.assign,Xv={};function qo(t,e,n){this.props=t,this.context=e,this.refs=Xv,this.updater=n||jv}qo.prototype.isReactComponent={};qo.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};qo.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Yv(){}Yv.prototype=qo.prototype;function Ff(t,e,n){this.props=t,this.context=e,this.refs=Xv,this.updater=n||jv}var Of=Ff.prototype=new Yv;Of.constructor=Ff;$v(Of,qo.prototype);Of.isPureReactComponent=!0;var _p=Array.isArray,qv=Object.prototype.hasOwnProperty,kf={current:null},Kv={key:!0,ref:!0,__self:!0,__source:!0};function Zv(t,e,n){var i,r={},o=null,s=null;if(e!=null)for(i in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)qv.call(e,i)&&!Kv.hasOwnProperty(i)&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=n;else if(1>>1,Q=U[X];if(0>>1;Xr(K,H))ner(de,K)?(U[X]=de,U[ne]=H,X=ne):(U[X]=K,U[j]=H,X=j);else if(ner(de,H))U[X]=de,U[ne]=H,X=ne;else break e}}return O}function r(U,O){var H=U.sortIndex-O.sortIndex;return H!==0?H:U.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();t.unstable_now=function(){return s.now()-a}}var l=[],u=[],c=1,d=null,h=3,g=!1,_=!1,S=!1,p=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(U){for(var O=n(u);O!==null;){if(O.callback===null)i(u);else if(O.startTime<=U)i(u),O.sortIndex=O.expirationTime,e(l,O);else break;O=n(u)}}function E(U){if(S=!1,v(U),!_)if(n(l)!==null)_=!0,F(M);else{var O=n(u);O!==null&&Z(E,O.startTime-U)}}function M(U,O){_=!1,S&&(S=!1,f(L),L=-1),g=!0;var H=h;try{for(v(O),d=n(l);d!==null&&(!(d.expirationTime>O)||U&&!A());){var X=d.callback;if(typeof X=="function"){d.callback=null,h=d.priorityLevel;var Q=X(d.expirationTime<=O);O=t.unstable_now(),typeof Q=="function"?d.callback=Q:d===n(l)&&i(l),v(O)}else i(l);d=n(l)}if(d!==null)var ge=!0;else{var j=n(u);j!==null&&Z(E,j.startTime-O),ge=!1}return ge}finally{d=null,h=H,g=!1}}var w=!1,T=null,L=-1,B=5,x=-1;function A(){return!(t.unstable_now()-xU||125X?(U.sortIndex=H,e(u,U),n(l)===null&&U===n(u)&&(S?(f(L),L=-1):S=!0,Z(E,H-X))):(U.sortIndex=Q,e(l,U),_||g||(_=!0,F(M))),U},t.unstable_shouldYield=A,t.unstable_wrapCallback=function(U){var O=h;return function(){var H=h;h=O;try{return U.apply(this,arguments)}finally{h=H}}}})(n0);t0.exports=n0;var MS=t0.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var TS=y,Mn=MS;function oe(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hd=Object.prototype.hasOwnProperty,CS=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,xp={},Sp={};function AS(t){return hd.call(Sp,t)?!0:hd.call(xp,t)?!1:CS.test(t)?Sp[t]=!0:(xp[t]=!0,!1)}function bS(t,e,n,i){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function RS(t,e,n,i){if(e===null||typeof e>"u"||bS(t,e,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function on(t,e,n,i,r,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var Ht={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Ht[t]=new on(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Ht[e]=new on(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Ht[t]=new on(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Ht[t]=new on(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Ht[t]=new on(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Ht[t]=new on(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Ht[t]=new on(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Ht[t]=new on(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Ht[t]=new on(t,5,!1,t.toLowerCase(),null,!1,!1)});var zf=/[\-:]([a-z])/g;function Vf(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(zf,Vf);Ht[e]=new on(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(zf,Vf);Ht[e]=new on(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(zf,Vf);Ht[e]=new on(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Ht[t]=new on(t,1,!1,t.toLowerCase(),null,!1,!1)});Ht.xlinkHref=new on("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Ht[t]=new on(t,1,!1,t.toLowerCase(),null,!0,!0)});function Hf(t,e,n,i){var r=Ht.hasOwnProperty(e)?Ht[e]:null;(r!==null?r.type!==0:i||!(2a||r[s]!==o[a]){var l=` -`+r[s].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{nc=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?bs(t):""}function PS(t){switch(t.tag){case 5:return bs(t.type);case 16:return bs("Lazy");case 13:return bs("Suspense");case 19:return bs("SuspenseList");case 0:case 2:case 15:return t=ic(t.type,!1),t;case 11:return t=ic(t.type.render,!1),t;case 1:return t=ic(t.type,!0),t;default:return""}}function vd(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case mo:return"Fragment";case po:return"Portal";case pd:return"Profiler";case Gf:return"StrictMode";case md:return"Suspense";case gd:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case o0:return(t.displayName||"Context")+".Consumer";case r0:return(t._context.displayName||"Context")+".Provider";case Wf:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case jf:return e=t.displayName||null,e!==null?e:vd(t.type)||"Memo";case Fi:e=t._payload,t=t._init;try{return vd(t(e))}catch{}}return null}function LS(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return vd(e);case 8:return e===Gf?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function nr(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function a0(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function NS(t){var e=a0(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),i=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(s){i=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(s){i=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function ba(t){t._valueTracker||(t._valueTracker=NS(t))}function l0(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=a0(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function Ul(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function _d(t,e){var n=e.checked;return gt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function wp(t,e){var n=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;n=nr(e.value!=null?e.value:n),t._wrapperState={initialChecked:i,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function u0(t,e){e=e.checked,e!=null&&Hf(t,"checked",e,!1)}function yd(t,e){u0(t,e);var n=nr(e.value),i=e.type;if(n!=null)i==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(i==="submit"||i==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?xd(t,e.type,n):e.hasOwnProperty("defaultValue")&&xd(t,e.type,nr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Mp(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function xd(t,e,n){(e!=="number"||Ul(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Rs=Array.isArray;function Ro(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r"+e.valueOf().toString()+"",e=Ra.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Gs(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Ds={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},DS=["Webkit","ms","Moz","O"];Object.keys(Ds).forEach(function(t){DS.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Ds[e]=Ds[t]})});function h0(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Ds.hasOwnProperty(t)&&Ds[t]?(""+e).trim():e+"px"}function p0(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var i=n.indexOf("--")===0,r=h0(n,e[n],i);n==="float"&&(n="cssFloat"),i?t.setProperty(n,r):t[n]=r}}var IS=gt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function wd(t,e){if(e){if(IS[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(oe(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(oe(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(oe(61))}if(e.style!=null&&typeof e.style!="object")throw Error(oe(62))}}function Md(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Td=null;function $f(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Cd=null,Po=null,Lo=null;function Ap(t){if(t=da(t)){if(typeof Cd!="function")throw Error(oe(280));var e=t.stateNode;e&&(e=Eu(e),Cd(t.stateNode,t.type,e))}}function m0(t){Po?Lo?Lo.push(t):Lo=[t]:Po=t}function g0(){if(Po){var t=Po,e=Lo;if(Lo=Po=null,Ap(t),e)for(t=0;t>>=0,t===0?32:31-(jS(t)/$S|0)|0}var Pa=64,La=4194304;function Ps(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Bl(t,e){var n=t.pendingLanes;if(n===0)return 0;var i=0,r=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~r;a!==0?i=Ps(a):(o&=s,o!==0&&(i=Ps(o)))}else s=n&~r,s!==0?i=Ps(s):o!==0&&(i=Ps(o));if(i===0)return 0;if(e!==0&&e!==i&&!(e&r)&&(r=i&-i,o=e&-e,r>=o||r===16&&(o&4194240)!==0))return e;if(i&4&&(i|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=i;0n;n++)e.push(t);return e}function ua(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Xn(e),t[e]=n}function KS(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var i=t.eventTimes;for(t=t.expirationTimes;0=Us),Fp=" ",Op=!1;function F0(t,e){switch(t){case"keyup":return ME.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function O0(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var go=!1;function CE(t,e){switch(t){case"compositionend":return O0(e);case"keypress":return e.which!==32?null:(Op=!0,Fp);case"textInput":return t=e.data,t===Fp&&Op?null:t;default:return null}}function AE(t,e){if(go)return t==="compositionend"||!eh&&F0(t,e)?(t=I0(),Sl=Zf=zi=null,go=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Vp(n)}}function V0(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?V0(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function H0(){for(var t=window,e=Ul();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ul(t.document)}return e}function th(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function FE(t){var e=H0(),n=t.focusedElem,i=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&V0(n.ownerDocument.documentElement,n)){if(i!==null&&th(n)){if(e=i.start,t=i.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var r=n.textContent.length,o=Math.min(i.start,r);i=i.end===void 0?o:Math.min(i.end,r),!t.extend&&o>i&&(r=i,i=o,o=r),r=Hp(n,o);var s=Hp(n,i);r&&s&&(t.rangeCount!==1||t.anchorNode!==r.node||t.anchorOffset!==r.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),t.removeAllRanges(),o>i?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,vo=null,Nd=null,Os=null,Dd=!1;function Gp(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Dd||vo==null||vo!==Ul(i)||(i=vo,"selectionStart"in i&&th(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Os&&qs(Os,i)||(Os=i,i=Hl(Nd,"onSelect"),0xo||(t.current=Bd[xo],Bd[xo]=null,xo--)}function at(t,e){xo++,Bd[xo]=t.current,t.current=e}var ir={},qt=ar(ir),dn=ar(!1),Fr=ir;function Bo(t,e){var n=t.type.contextTypes;if(!n)return ir;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},o;for(o in n)r[o]=e[o];return i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=r),r}function fn(t){return t=t.childContextTypes,t!=null}function Wl(){ct(dn),ct(qt)}function Kp(t,e,n){if(qt.current!==ir)throw Error(oe(168));at(qt,e),at(dn,n)}function Z0(t,e,n){var i=t.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(oe(108,LS(t)||"Unknown",r));return gt({},n,i)}function jl(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ir,Fr=qt.current,at(qt,t),at(dn,dn.current),!0}function Zp(t,e,n){var i=t.stateNode;if(!i)throw Error(oe(169));n?(t=Z0(t,e,Fr),i.__reactInternalMemoizedMergedChildContext=t,ct(dn),ct(qt),at(qt,t)):ct(dn),at(dn,n)}var gi=null,wu=!1,vc=!1;function J0(t){gi===null?gi=[t]:gi.push(t)}function YE(t){wu=!0,J0(t)}function lr(){if(!vc&&gi!==null){vc=!0;var t=0,e=rt;try{var n=gi;for(rt=1;t>=s,r-=s,yi=1<<32-Xn(e)+r|n<L?(B=T,T=null):B=T.sibling;var x=h(f,T,v[L],E);if(x===null){T===null&&(T=B);break}t&&T&&x.alternate===null&&e(f,T),m=o(x,m,L),w===null?M=x:w.sibling=x,w=x,T=B}if(L===v.length)return n(f,T),dt&&yr(f,L),M;if(T===null){for(;LL?(B=T,T=null):B=T.sibling;var A=h(f,T,x.value,E);if(A===null){T===null&&(T=B);break}t&&T&&A.alternate===null&&e(f,T),m=o(A,m,L),w===null?M=A:w.sibling=A,w=A,T=B}if(x.done)return n(f,T),dt&&yr(f,L),M;if(T===null){for(;!x.done;L++,x=v.next())x=d(f,x.value,E),x!==null&&(m=o(x,m,L),w===null?M=x:w.sibling=x,w=x);return dt&&yr(f,L),M}for(T=i(f,T);!x.done;L++,x=v.next())x=g(T,f,L,x.value,E),x!==null&&(t&&x.alternate!==null&&T.delete(x.key===null?L:x.key),m=o(x,m,L),w===null?M=x:w.sibling=x,w=x);return t&&T.forEach(function(k){return e(f,k)}),dt&&yr(f,L),M}function p(f,m,v,E){if(typeof v=="object"&&v!==null&&v.type===mo&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Aa:e:{for(var M=v.key,w=m;w!==null;){if(w.key===M){if(M=v.type,M===mo){if(w.tag===7){n(f,w.sibling),m=r(w,v.props.children),m.return=f,f=m;break e}}else if(w.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===Fi&&em(M)===w.type){n(f,w.sibling),m=r(w,v.props),m.ref=vs(f,w,v),m.return=f,f=m;break e}n(f,w);break}else e(f,w);w=w.sibling}v.type===mo?(m=Nr(v.props.children,f.mode,E,v.key),m.return=f,f=m):(E=Rl(v.type,v.key,v.props,null,f.mode,E),E.ref=vs(f,m,v),E.return=f,f=E)}return s(f);case po:e:{for(w=v.key;m!==null;){if(m.key===w)if(m.tag===4&&m.stateNode.containerInfo===v.containerInfo&&m.stateNode.implementation===v.implementation){n(f,m.sibling),m=r(m,v.children||[]),m.return=f,f=m;break e}else{n(f,m);break}else e(f,m);m=m.sibling}m=Tc(v,f.mode,E),m.return=f,f=m}return s(f);case Fi:return w=v._init,p(f,m,w(v._payload),E)}if(Rs(v))return _(f,m,v,E);if(fs(v))return S(f,m,v,E);ka(f,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,m!==null&&m.tag===6?(n(f,m.sibling),m=r(m,v),m.return=f,f=m):(n(f,m),m=Mc(v,f.mode,E),m.return=f,f=m),s(f)):n(f,m)}return p}var Vo=n_(!0),i_=n_(!1),Yl=ar(null),ql=null,wo=null,oh=null;function sh(){oh=wo=ql=null}function ah(t){var e=Yl.current;ct(Yl),t._currentValue=e}function Hd(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function Do(t,e){ql=t,oh=wo=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(cn=!0),t.firstContext=null)}function Un(t){var e=t._currentValue;if(oh!==t)if(t={context:t,memoizedValue:e,next:null},wo===null){if(ql===null)throw Error(oe(308));wo=t,ql.dependencies={lanes:0,firstContext:t}}else wo=wo.next=t;return e}var Ar=null;function lh(t){Ar===null?Ar=[t]:Ar.push(t)}function r_(t,e,n,i){var r=e.interleaved;return r===null?(n.next=n,lh(e)):(n.next=r.next,r.next=n),e.interleaved=n,Ti(t,i)}function Ti(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Oi=!1;function uh(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function o_(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Ei(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Yi(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,Je&2){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,Ti(t,n)}return r=i.interleaved,r===null?(e.next=e,lh(i)):(e.next=r.next,r.next=e),i.interleaved=e,Ti(t,n)}function wl(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,Yf(t,n)}}function tm(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?r=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?r=o=e:o=o.next=e}else r=o=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:i.shared,effects:i.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Kl(t,e,n,i){var r=t.updateQueue;Oi=!1;var o=r.firstBaseUpdate,s=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?o=u:s.next=u,s=l;var c=t.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==s&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(o!==null){var d=r.baseState;s=0,c=u=l=null,a=o;do{var h=a.lane,g=a.eventTime;if((i&h)===h){c!==null&&(c=c.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var _=t,S=a;switch(h=e,g=n,S.tag){case 1:if(_=S.payload,typeof _=="function"){d=_.call(g,d,h);break e}d=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=S.payload,h=typeof _=="function"?_.call(g,d,h):_,h==null)break e;d=gt({},d,h);break e;case 2:Oi=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,h=r.effects,h===null?r.effects=[a]:h.push(a))}else g={eventTime:g,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=g,l=d):c=c.next=g,s|=h;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;h=a,a=h.next,h.next=null,r.lastBaseUpdate=h,r.shared.pending=null}}while(!0);if(c===null&&(l=d),r.baseState=l,r.firstBaseUpdate=u,r.lastBaseUpdate=c,e=r.shared.interleaved,e!==null){r=e;do s|=r.lane,r=r.next;while(r!==e)}else o===null&&(r.shared.lanes=0);Br|=s,t.lanes=s,t.memoizedState=d}}function nm(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var i=yc.transition;yc.transition={};try{t(!1),e()}finally{rt=n,yc.transition=i}}function E_(){return Fn().memoizedState}function JE(t,e,n){var i=Ki(t);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},w_(t))M_(e,n);else if(n=r_(t,e,n,i),n!==null){var r=en();Yn(n,t,i,r),T_(n,e,i)}}function QE(t,e,n){var i=Ki(t),r={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(w_(t))M_(e,r);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,n);if(r.hasEagerState=!0,r.eagerState=a,qn(a,s)){var l=e.interleaved;l===null?(r.next=r,lh(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}n=r_(t,e,r,i),n!==null&&(r=en(),Yn(n,t,i,r),T_(n,e,i))}}function w_(t){var e=t.alternate;return t===mt||e!==null&&e===mt}function M_(t,e){ks=Jl=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function T_(t,e,n){if(n&4194240){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,Yf(t,n)}}var Ql={readContext:Un,useCallback:Wt,useContext:Wt,useEffect:Wt,useImperativeHandle:Wt,useInsertionEffect:Wt,useLayoutEffect:Wt,useMemo:Wt,useReducer:Wt,useRef:Wt,useState:Wt,useDebugValue:Wt,useDeferredValue:Wt,useTransition:Wt,useMutableSource:Wt,useSyncExternalStore:Wt,useId:Wt,unstable_isNewReconciler:!1},ew={readContext:Un,useCallback:function(t,e){return Jn().memoizedState=[t,e===void 0?null:e],t},useContext:Un,useEffect:rm,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Tl(4194308,4,v_.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Tl(4194308,4,t,e)},useInsertionEffect:function(t,e){return Tl(4,2,t,e)},useMemo:function(t,e){var n=Jn();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var i=Jn();return e=n!==void 0?n(e):e,i.memoizedState=i.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},i.queue=t,t=t.dispatch=JE.bind(null,mt,t),[i.memoizedState,t]},useRef:function(t){var e=Jn();return t={current:t},e.memoizedState=t},useState:im,useDebugValue:vh,useDeferredValue:function(t){return Jn().memoizedState=t},useTransition:function(){var t=im(!1),e=t[0];return t=ZE.bind(null,t[1]),Jn().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var i=mt,r=Jn();if(dt){if(n===void 0)throw Error(oe(407));n=n()}else{if(n=e(),Ft===null)throw Error(oe(349));kr&30||u_(i,e,n)}r.memoizedState=n;var o={value:n,getSnapshot:e};return r.queue=o,rm(d_.bind(null,i,o,t),[t]),i.flags|=2048,ia(9,c_.bind(null,i,o,n,e),void 0,null),n},useId:function(){var t=Jn(),e=Ft.identifierPrefix;if(dt){var n=xi,i=yi;n=(i&~(1<<32-Xn(i)-1)).toString(32)+n,e=":"+e+"R"+n,n=ta++,0<\/script>",t=t.removeChild(t.firstChild)):typeof i.is=="string"?t=s.createElement(n,{is:i.is}):(t=s.createElement(n),n==="select"&&(s=t,i.multiple?s.multiple=!0:i.size&&(s.size=i.size))):t=s.createElementNS(t,n),t[ei]=e,t[Js]=i,U_(t,e,!1,!1),e.stateNode=t;e:{switch(s=Md(n,i),n){case"dialog":lt("cancel",t),lt("close",t),r=i;break;case"iframe":case"object":case"embed":lt("load",t),r=i;break;case"video":case"audio":for(r=0;rWo&&(e.flags|=128,i=!0,_s(o,!1),e.lanes=4194304)}else{if(!i)if(t=Zl(s),t!==null){if(e.flags|=128,i=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),_s(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!dt)return jt(e),null}else 2*St()-o.renderingStartTime>Wo&&n!==1073741824&&(e.flags|=128,i=!0,_s(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=St(),e.sibling=null,n=pt.current,at(pt,i?n&1|2:n&1),e):(jt(e),null);case 22:case 23:return wh(),i=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?xn&1073741824&&(jt(e),e.subtreeFlags&6&&(e.flags|=8192)):jt(e),null;case 24:return null;case 25:return null}throw Error(oe(156,e.tag))}function lw(t,e){switch(ih(e),e.tag){case 1:return fn(e.type)&&Wl(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ho(),ct(dn),ct(qt),fh(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return dh(e),null;case 13:if(ct(pt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(oe(340));zo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ct(pt),null;case 4:return Ho(),null;case 10:return ah(e.type._context),null;case 22:case 23:return wh(),null;case 24:return null;default:return null}}var za=!1,Yt=!1,uw=typeof WeakSet=="function"?WeakSet:Set,me=null;function Mo(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){yt(t,e,i)}else n.current=null}function Zd(t,e,n){try{n()}catch(i){yt(t,e,i)}}var mm=!1;function cw(t,e){if(Id=zl,t=H0(),th(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,c=0,d=t,h=null;t:for(;;){for(var g;d!==n||r!==0&&d.nodeType!==3||(a=s+r),d!==o||i!==0&&d.nodeType!==3||(l=s+i),d.nodeType===3&&(s+=d.nodeValue.length),(g=d.firstChild)!==null;)h=d,d=g;for(;;){if(d===t)break t;if(h===n&&++u===r&&(a=s),h===o&&++c===i&&(l=s),(g=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=g}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ud={focusedElem:t,selectionRange:n},zl=!1,me=e;me!==null;)if(e=me,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,me=t;else for(;me!==null;){e=me;try{var _=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var S=_.memoizedProps,p=_.memoizedState,f=e.stateNode,m=f.getSnapshotBeforeUpdate(e.elementType===e.type?S:Hn(e.type,S),p);f.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var v=e.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(oe(163))}}catch(E){yt(e,e.return,E)}if(t=e.sibling,t!==null){t.return=e.return,me=t;break}me=e.return}return _=mm,mm=!1,_}function Bs(t,e,n){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&t)===t){var o=r.destroy;r.destroy=void 0,o!==void 0&&Zd(e,n,o)}r=r.next}while(r!==i)}}function Cu(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var i=n.create;n.destroy=i()}n=n.next}while(n!==e)}}function Jd(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function k_(t){var e=t.alternate;e!==null&&(t.alternate=null,k_(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[ei],delete e[Js],delete e[kd],delete e[$E],delete e[XE])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function B_(t){return t.tag===5||t.tag===3||t.tag===4}function gm(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||B_(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Qd(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Gl));else if(i!==4&&(t=t.child,t!==null))for(Qd(t,e,n),t=t.sibling;t!==null;)Qd(t,e,n),t=t.sibling}function ef(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(t=t.child,t!==null))for(ef(t,e,n),t=t.sibling;t!==null;)ef(t,e,n),t=t.sibling}var kt=null,Gn=!1;function Ri(t,e,n){for(n=n.child;n!==null;)z_(t,e,n),n=n.sibling}function z_(t,e,n){if(ii&&typeof ii.onCommitFiberUnmount=="function")try{ii.onCommitFiberUnmount(_u,n)}catch{}switch(n.tag){case 5:Yt||Mo(n,e);case 6:var i=kt,r=Gn;kt=null,Ri(t,e,n),kt=i,Gn=r,kt!==null&&(Gn?(t=kt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):kt.removeChild(n.stateNode));break;case 18:kt!==null&&(Gn?(t=kt,n=n.stateNode,t.nodeType===8?gc(t.parentNode,n):t.nodeType===1&&gc(t,n),Xs(t)):gc(kt,n.stateNode));break;case 4:i=kt,r=Gn,kt=n.stateNode.containerInfo,Gn=!0,Ri(t,e,n),kt=i,Gn=r;break;case 0:case 11:case 14:case 15:if(!Yt&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var o=r,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&Zd(n,e,s),r=r.next}while(r!==i)}Ri(t,e,n);break;case 1:if(!Yt&&(Mo(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(a){yt(n,e,a)}Ri(t,e,n);break;case 21:Ri(t,e,n);break;case 22:n.mode&1?(Yt=(i=Yt)||n.memoizedState!==null,Ri(t,e,n),Yt=i):Ri(t,e,n);break;default:Ri(t,e,n)}}function vm(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new uw),e.forEach(function(i){var r=yw.bind(null,t,i);n.has(i)||(n.add(i),i.then(r,r))})}}function On(t,e){var n=e.deletions;if(n!==null)for(var i=0;ir&&(r=s),i&=~o}if(i=r,i=St()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*fw(i/1960))-i,10t?16:t,Vi===null)var i=!1;else{if(t=Vi,Vi=null,nu=0,Je&6)throw Error(oe(331));var r=Je;for(Je|=4,me=t.current;me!==null;){var o=me,s=o.child;if(me.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lSt()-Sh?Lr(t,0):xh|=n),hn(t,e)}function Y_(t,e){e===0&&(t.mode&1?(e=La,La<<=1,!(La&130023424)&&(La=4194304)):e=1);var n=en();t=Ti(t,e),t!==null&&(ua(t,e,n),hn(t,n))}function _w(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),Y_(t,n)}function yw(t,e){var n=0;switch(t.tag){case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(oe(314))}i!==null&&i.delete(e),Y_(t,n)}var q_;q_=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||dn.current)cn=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return cn=!1,sw(t,e,n);cn=!!(t.flags&131072)}else cn=!1,dt&&e.flags&1048576&&Q0(e,Xl,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;Cl(t,e),t=e.pendingProps;var r=Bo(e,qt.current);Do(e,n),r=ph(null,e,i,t,r,n);var o=mh();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,fn(i)?(o=!0,jl(e)):o=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,uh(e),r.updater=Tu,e.stateNode=r,r._reactInternals=e,Wd(e,i,t,n),e=Xd(null,e,i,!0,o,n)):(e.tag=0,dt&&o&&nh(e),Jt(null,e,r,n),e=e.child),e;case 16:i=e.elementType;e:{switch(Cl(t,e),t=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=Sw(i),t=Hn(i,t),r){case 0:e=$d(null,e,i,t,n);break e;case 1:e=fm(null,e,i,t,n);break e;case 11:e=cm(null,e,i,t,n);break e;case 14:e=dm(null,e,i,Hn(i.type,t),n);break e}throw Error(oe(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Hn(i,r),$d(t,e,i,r,n);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Hn(i,r),fm(t,e,i,r,n);case 3:e:{if(N_(e),t===null)throw Error(oe(387));i=e.pendingProps,o=e.memoizedState,r=o.element,o_(t,e),Kl(e,i,null,n);var s=e.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){r=Go(Error(oe(423)),e),e=hm(t,e,i,n,r);break e}else if(i!==r){r=Go(Error(oe(424)),e),e=hm(t,e,i,n,r);break e}else for(En=Xi(e.stateNode.containerInfo.firstChild),wn=e,dt=!0,Wn=null,n=i_(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(zo(),i===r){e=Ci(t,e,n);break e}Jt(t,e,i,n)}e=e.child}return e;case 5:return s_(e),t===null&&Vd(e),i=e.type,r=e.pendingProps,o=t!==null?t.memoizedProps:null,s=r.children,Fd(i,r)?s=null:o!==null&&Fd(i,o)&&(e.flags|=32),L_(t,e),Jt(t,e,s,n),e.child;case 6:return t===null&&Vd(e),null;case 13:return D_(t,e,n);case 4:return ch(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=Vo(e,null,i,n):Jt(t,e,i,n),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Hn(i,r),cm(t,e,i,r,n);case 7:return Jt(t,e,e.pendingProps,n),e.child;case 8:return Jt(t,e,e.pendingProps.children,n),e.child;case 12:return Jt(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(i=e.type._context,r=e.pendingProps,o=e.memoizedProps,s=r.value,at(Yl,i._currentValue),i._currentValue=s,o!==null)if(qn(o.value,s)){if(o.children===r.children&&!dn.current){e=Ci(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=Ei(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Hd(o.return,n,e),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(oe(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Hd(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Jt(t,e,r.children,n),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,Do(e,n),r=Un(r),i=i(r),e.flags|=1,Jt(t,e,i,n),e.child;case 14:return i=e.type,r=Hn(i,e.pendingProps),r=Hn(i.type,r),dm(t,e,i,r,n);case 15:return R_(t,e,e.type,e.pendingProps,n);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Hn(i,r),Cl(t,e),e.tag=1,fn(i)?(t=!0,jl(e)):t=!1,Do(e,n),C_(e,i,r),Wd(e,i,r,n),Xd(null,e,i,!0,t,n);case 19:return I_(t,e,n);case 22:return P_(t,e,n)}throw Error(oe(156,e.tag))};function K_(t,e){return w0(t,e)}function xw(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nn(t,e,n,i){return new xw(t,e,n,i)}function Th(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Sw(t){if(typeof t=="function")return Th(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Wf)return 11;if(t===jf)return 14}return 2}function Zi(t,e){var n=t.alternate;return n===null?(n=Nn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Rl(t,e,n,i,r,o){var s=2;if(i=t,typeof t=="function")Th(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case mo:return Nr(n.children,r,o,e);case Gf:s=8,r|=8;break;case pd:return t=Nn(12,n,e,r|2),t.elementType=pd,t.lanes=o,t;case md:return t=Nn(13,n,e,r),t.elementType=md,t.lanes=o,t;case gd:return t=Nn(19,n,e,r),t.elementType=gd,t.lanes=o,t;case s0:return bu(n,r,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case r0:s=10;break e;case o0:s=9;break e;case Wf:s=11;break e;case jf:s=14;break e;case Fi:s=16,i=null;break e}throw Error(oe(130,t==null?t:typeof t,""))}return e=Nn(s,n,e,r),e.elementType=t,e.type=i,e.lanes=o,e}function Nr(t,e,n,i){return t=Nn(7,t,i,e),t.lanes=n,t}function bu(t,e,n,i){return t=Nn(22,t,i,e),t.elementType=s0,t.lanes=n,t.stateNode={isHidden:!1},t}function Mc(t,e,n){return t=Nn(6,t,null,e),t.lanes=n,t}function Tc(t,e,n){return e=Nn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Ew(t,e,n,i,r){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=oc(0),this.expirationTimes=oc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=oc(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function Ch(t,e,n,i,r,o,s,a,l){return t=new Ew(t,e,n,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Nn(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},uh(o),t}function ww(t,e,n){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ey)}catch(t){console.error(t)}}ey(),e0.exports=Tn;var sf=e0.exports,Ph,Tm=sf;Ph=Tm.createRoot,Tm.hydrateRoot;/** - * @remix-run/router v1.21.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function oa(){return oa=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function ty(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Rw(){return Math.random().toString(36).substr(2,8)}function Am(t,e){return{usr:t.state,key:t.key,idx:e}}function af(t,e,n,i){return n===void 0&&(n=null),oa({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Jo(e):e,{state:n,key:e&&e.key||i||Rw()})}function ou(t){let{pathname:e="/",search:n="",hash:i=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function Jo(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let i=t.indexOf("?");i>=0&&(e.search=t.substr(i),t=t.substr(0,i)),t&&(e.pathname=t)}return e}function Pw(t,e,n,i){i===void 0&&(i={});let{window:r=document.defaultView,v5Compat:o=!1}=i,s=r.history,a=Hi.Pop,l=null,u=c();u==null&&(u=0,s.replaceState(oa({},s.state,{idx:u}),""));function c(){return(s.state||{idx:null}).idx}function d(){a=Hi.Pop;let p=c(),f=p==null?null:p-u;u=p,l&&l({action:a,location:S.location,delta:f})}function h(p,f){a=Hi.Push;let m=af(S.location,p,f);u=c()+1;let v=Am(m,u),E=S.createHref(m);try{s.pushState(v,"",E)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;r.location.assign(E)}o&&l&&l({action:a,location:S.location,delta:1})}function g(p,f){a=Hi.Replace;let m=af(S.location,p,f);u=c();let v=Am(m,u),E=S.createHref(m);s.replaceState(v,"",E),o&&l&&l({action:a,location:S.location,delta:0})}function _(p){let f=r.location.origin!=="null"?r.location.origin:r.location.href,m=typeof p=="string"?p:ou(p);return m=m.replace(/ $/,"%20"),Et(f,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,f)}let S={get action(){return a},get location(){return t(r,s)},listen(p){if(l)throw new Error("A history only accepts one active listener");return r.addEventListener(Cm,d),l=p,()=>{r.removeEventListener(Cm,d),l=null}},createHref(p){return e(r,p)},createURL:_,encodeLocation(p){let f=_(p);return{pathname:f.pathname,search:f.search,hash:f.hash}},push:h,replace:g,go(p){return s.go(p)}};return S}var bm;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(bm||(bm={}));function Lw(t,e,n){return n===void 0&&(n="/"),Nw(t,e,n,!1)}function Nw(t,e,n,i){let r=typeof e=="string"?Jo(e):e,o=Lh(r.pathname||"/",n);if(o==null)return null;let s=ny(t);Dw(s);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};l.relativePath.startsWith("/")&&(Et(l.relativePath.startsWith(i),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(i.length));let u=Ji([i,l.relativePath]),c=n.concat(l);o.children&&o.children.length>0&&(Et(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),ny(o.children,e,c,u)),!(o.path==null&&!o.index)&&e.push({path:u,score:zw(u,o.index),routesMeta:c})};return t.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))r(o,s);else for(let l of iy(o.path))r(o,s,l)}),e}function iy(t){let e=t.split("/");if(e.length===0)return[];let[n,...i]=e,r=n.endsWith("?"),o=n.replace(/\?$/,"");if(i.length===0)return r?[o,""]:[o];let s=iy(i.join("/")),a=[];return a.push(...s.map(l=>l===""?o:[o,l].join("/"))),r&&a.push(...s),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function Dw(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:Vw(e.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}const Iw=/^:[\w-]+$/,Uw=3,Fw=2,Ow=1,kw=10,Bw=-2,Rm=t=>t==="*";function zw(t,e){let n=t.split("/"),i=n.length;return n.some(Rm)&&(i+=Bw),e&&(i+=Fw),n.filter(r=>!Rm(r)).reduce((r,o)=>r+(Iw.test(o)?Uw:o===""?Ow:kw),i)}function Vw(t,e){return t.length===e.length&&t.slice(0,-1).every((i,r)=>i===e[r])?t[t.length-1]-e[e.length-1]:0}function Hw(t,e,n){let{routesMeta:i}=t,r={},o="/",s=[];for(let a=0;a{let{paramName:h,isOptional:g}=c;if(h==="*"){let S=a[d]||"";s=o.slice(0,o.length-S.length).replace(/(.)\/+$/,"$1")}const _=a[d];return g&&!_?u[h]=void 0:u[h]=(_||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:s,pattern:t}}function Gw(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),ty(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let i=[],r="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(i.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(i.push({paramName:"*"}),r+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":t!==""&&t!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function Ww(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return ty(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Lh(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,i=t.charAt(n);return i&&i!=="/"?null:t.slice(n)||"/"}function jw(t,e){e===void 0&&(e="/");let{pathname:n,search:i="",hash:r=""}=typeof t=="string"?Jo(t):t;return{pathname:n?n.startsWith("/")?n:$w(n,e):e,search:qw(i),hash:Kw(r)}}function $w(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function Cc(t,e,n,i){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Xw(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Nh(t,e){let n=Xw(t);return e?n.map((i,r)=>r===n.length-1?i.pathname:i.pathnameBase):n.map(i=>i.pathnameBase)}function Dh(t,e,n,i){i===void 0&&(i=!1);let r;typeof t=="string"?r=Jo(t):(r=oa({},t),Et(!r.pathname||!r.pathname.includes("?"),Cc("?","pathname","search",r)),Et(!r.pathname||!r.pathname.includes("#"),Cc("#","pathname","hash",r)),Et(!r.search||!r.search.includes("#"),Cc("#","search","hash",r)));let o=t===""||r.pathname==="",s=o?"/":r.pathname,a;if(s==null)a=n;else{let d=e.length-1;if(!i&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),d-=1;r.pathname=h.join("/")}a=d>=0?e[d]:"/"}let l=jw(r,a),u=s&&s!=="/"&&s.endsWith("/"),c=(o||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Ji=t=>t.join("/").replace(/\/\/+/g,"/"),Yw=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),qw=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Kw=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function Zw(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const ry=["post","put","patch","delete"];new Set(ry);const Jw=["get",...ry];new Set(Jw);/** - * React Router v6.28.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function sa(){return sa=Object.assign?Object.assign.bind():function(t){for(var e=1;e{a.current=!0}),y.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){i.go(u);return}let d=Dh(u,JSON.parse(s),o,c.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:Ji([e,d.pathname])),(c.replace?i.replace:i.push)(d,c.state,c)},[e,i,s,o,t])}function ly(t,e){let{relative:n}=e===void 0?{}:e,{future:i}=y.useContext(ur),{matches:r}=y.useContext(cr),{pathname:o}=ha(),s=JSON.stringify(Nh(r,i.v7_relativeSplatPath));return y.useMemo(()=>Dh(t,JSON.parse(s),o,n==="path"),[t,s,o,n])}function nM(t,e){return iM(t,e)}function iM(t,e,n,i){Qo()||Et(!1);let{navigator:r}=y.useContext(ur),{matches:o}=y.useContext(cr),s=o[o.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let u=ha(),c;if(e){var d;let p=typeof e=="string"?Jo(e):e;l==="/"||(d=p.pathname)!=null&&d.startsWith(l)||Et(!1),c=p}else c=u;let h=c.pathname||"/",g=h;if(l!=="/"){let p=l.replace(/^\//,"").split("/");g="/"+h.replace(/^\//,"").split("/").slice(p.length).join("/")}let _=Lw(t,{pathname:g}),S=lM(_&&_.map(p=>Object.assign({},p,{params:Object.assign({},a,p.params),pathname:Ji([l,r.encodeLocation?r.encodeLocation(p.pathname).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?l:Ji([l,r.encodeLocation?r.encodeLocation(p.pathnameBase).pathname:p.pathnameBase])})),o,n,i);return e&&S?y.createElement(Du.Provider,{value:{location:sa({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Hi.Pop}},S):S}function rM(){let t=fM(),e=Zw(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},e),n?y.createElement("pre",{style:r},n):null,null)}const oM=y.createElement(rM,null);class sM extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?y.createElement(cr.Provider,{value:this.props.routeContext},y.createElement(oy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function aM(t){let{routeContext:e,match:n,children:i}=t,r=y.useContext(Ih);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(cr.Provider,{value:e},i)}function lM(t,e,n,i){var r;if(e===void 0&&(e=[]),n===void 0&&(n=null),i===void 0&&(i=null),t==null){var o;if(!n)return null;if(n.errors)t=n.matches;else if((o=i)!=null&&o.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let s=t,a=(r=n)==null?void 0:r.errors;if(a!=null){let c=s.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);c>=0||Et(!1),s=s.slice(0,Math.min(s.length,c+1))}let l=!1,u=-1;if(n&&i&&i.v7_partialHydration)for(let c=0;c=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((c,d,h)=>{let g,_=!1,S=null,p=null;n&&(g=a&&d.route.id?a[d.route.id]:void 0,S=d.route.errorElement||oM,l&&(u<0&&h===0?(_=!0,p=null):u===h&&(_=!0,p=d.route.hydrateFallbackElement||null)));let f=e.concat(s.slice(0,h+1)),m=()=>{let v;return g?v=S:_?v=p:d.route.Component?v=y.createElement(d.route.Component,null):d.route.element?v=d.route.element:v=c,y.createElement(aM,{match:d,routeContext:{outlet:c,matches:f,isDataRoute:n!=null},children:v})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?y.createElement(sM,{location:n.location,revalidation:n.revalidation,component:S,error:g,children:m(),routeContext:{outlet:null,matches:f,isDataRoute:!0}}):m()},null)}var uy=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(uy||{}),su=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(su||{});function uM(t){let e=y.useContext(Ih);return e||Et(!1),e}function cM(t){let e=y.useContext(Qw);return e||Et(!1),e}function dM(t){let e=y.useContext(cr);return e||Et(!1),e}function cy(t){let e=dM(),n=e.matches[e.matches.length-1];return n.route.id||Et(!1),n.route.id}function fM(){var t;let e=y.useContext(oy),n=cM(su.UseRouteError),i=cy(su.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[i]}function hM(){let{router:t}=uM(uy.UseNavigateStable),e=cy(su.UseNavigateStable),n=y.useRef(!1);return sy(()=>{n.current=!0}),y.useCallback(function(r,o){o===void 0&&(o={}),n.current&&(typeof r=="number"?t.navigate(r):t.navigate(r,sa({fromRouteId:e},o)))},[t,e])}const Lm={};function pM(t,e){Lm[e]||(Lm[e]=!0,console.warn(e))}const Nm=(t,e,n)=>pM(t,"⚠️ React Router Future Flag Warning: "+e+". "+("You can use the `"+t+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function mM(t,e){t!=null&&t.v7_startTransition||Nm("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),!(t!=null&&t.v7_relativeSplatPath)&&!e&&Nm("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath")}function gM(t){let{to:e,replace:n,state:i,relative:r}=t;Qo()||Et(!1);let{future:o,static:s}=y.useContext(ur),{matches:a}=y.useContext(cr),{pathname:l}=ha(),u=ay(),c=Dh(e,Nh(a,o.v7_relativeSplatPath),l,r==="path"),d=JSON.stringify(c);return y.useEffect(()=>u(JSON.parse(d),{replace:n,state:i,relative:r}),[u,d,r,n,i]),null}function Pl(t){Et(!1)}function vM(t){let{basename:e="/",children:n=null,location:i,navigationType:r=Hi.Pop,navigator:o,static:s=!1,future:a}=t;Qo()&&Et(!1);let l=e.replace(/^\/*/,"/"),u=y.useMemo(()=>({basename:l,navigator:o,static:s,future:sa({v7_relativeSplatPath:!1},a)}),[l,a,o,s]);typeof i=="string"&&(i=Jo(i));let{pathname:c="/",search:d="",hash:h="",state:g=null,key:_="default"}=i,S=y.useMemo(()=>{let p=Lh(c,l);return p==null?null:{location:{pathname:p,search:d,hash:h,state:g,key:_},navigationType:r}},[l,c,d,h,g,_,r]);return S==null?null:y.createElement(ur.Provider,{value:u},y.createElement(Du.Provider,{children:n,value:S}))}function _M(t){let{children:e,location:n}=t;return nM(lf(e),n)}new Promise(()=>{});function lf(t,e){e===void 0&&(e=[]);let n=[];return y.Children.forEach(t,(i,r)=>{if(!y.isValidElement(i))return;let o=[...e,r];if(i.type===y.Fragment){n.push.apply(n,lf(i.props.children,o));return}i.type!==Pl&&Et(!1),!i.props.index||!i.props.children||Et(!1);let s={id:i.props.id||o.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(s.children=lf(i.props.children,o)),n.push(s)}),n}/** - * React Router DOM v6.28.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function uf(){return uf=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[r]=t[r]);return n}function xM(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function SM(t,e){return t.button===0&&(!e||e==="_self")&&!xM(t)}const EM=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],wM="6";try{window.__reactRouterVersion=wM}catch{}const MM="startTransition",Dm=vS[MM];function TM(t){let{basename:e,children:n,future:i,window:r}=t,o=y.useRef();o.current==null&&(o.current=bw({window:r,v5Compat:!0}));let s=o.current,[a,l]=y.useState({action:s.action,location:s.location}),{v7_startTransition:u}=i||{},c=y.useCallback(d=>{u&&Dm?Dm(()=>l(d)):l(d)},[l,u]);return y.useLayoutEffect(()=>s.listen(c),[s,c]),y.useEffect(()=>mM(i),[i]),y.createElement(vM,{basename:e,children:n,location:a.location,navigationType:a.action,navigator:s,future:i})}const CM=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",AM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,dy=y.forwardRef(function(e,n){let{onClick:i,relative:r,reloadDocument:o,replace:s,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d}=e,h=yM(e,EM),{basename:g}=y.useContext(ur),_,S=!1;if(typeof u=="string"&&AM.test(u)&&(_=u,CM))try{let v=new URL(window.location.href),E=u.startsWith("//")?new URL(v.protocol+u):new URL(u),M=Lh(E.pathname,g);E.origin===v.origin&&M!=null?u=M+E.search+E.hash:S=!0}catch{}let p=eM(u,{relative:r}),f=bM(u,{replace:s,state:a,target:l,preventScrollReset:c,relative:r,viewTransition:d});function m(v){i&&i(v),v.defaultPrevented||f(v)}return y.createElement("a",uf({},h,{href:_||p,onClick:S||o?i:m,ref:n,target:l}))});var Im;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Im||(Im={}));var Um;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Um||(Um={}));function bM(t,e){let{target:n,replace:i,state:r,preventScrollReset:o,relative:s,viewTransition:a}=e===void 0?{}:e,l=ay(),u=ha(),c=ly(t,{relative:s});return y.useCallback(d=>{if(SM(d,n)){d.preventDefault();let h=i!==void 0?i:ou(u)===ou(c);l(t,{replace:h,state:r,preventScrollReset:o,relative:s,viewTransition:a})}},[u,l,c,i,r,n,t,o,s,a])}function RM({onMount:t}){return y.useEffect(()=>{t()},[t]),b.jsxs("div",{id:"app",children:[b.jsx("canvas",{id:"bg"}),b.jsxs("header",{children:[b.jsx("h1",{children:"Intuition Labs"}),b.jsx("p",{className:"tagline",children:"Pioneering the future of AI through research and strategic innovation"})]}),b.jsx("div",{className:"platforms-marquee",children:b.jsxs("div",{className:"platforms-track",children:[b.jsx("span",{className:"platform-name platform-terminals",children:"terminals"}),b.jsx("span",{className:"platform-name platform-radical",children:"radical"}),b.jsx("span",{className:"platform-name platform-pathfinder",children:"pathfinder"}),b.jsx("span",{className:"platform-name platform-wuji",children:"wuji"}),b.jsx("span",{className:"platform-name platform-boom",children:"boom"}),b.jsx("span",{className:"platform-name platform-journey",children:"journey"}),b.jsx("span",{className:"platform-name platform-terminals",children:"terminals"}),b.jsx("span",{className:"platform-name platform-radical",children:"radical"}),b.jsx("span",{className:"platform-name platform-pathfinder",children:"pathfinder"}),b.jsx("span",{className:"platform-name platform-wuji",children:"wuji"}),b.jsx("span",{className:"platform-name platform-boom",children:"boom"}),b.jsx("span",{className:"platform-name platform-journey",children:"journey"})]})}),b.jsxs("section",{className:"section",children:[b.jsx("h2",{children:"Our Vision"}),b.jsx("p",{children:"Transforming enterprises through cutting-edge AI solutions and polymathic expertise"}),b.jsxs("div",{className:"cta-container",children:[b.jsx("a",{href:"https://zcal.co/terminals",className:"cta-button",children:"Schedule Consultation"}),b.jsx(dy,{to:"/manifesto",className:"text-link",children:"Read Our Manifesto"})]})]}),b.jsxs("section",{className:"section apps-grid",children:[b.jsx("h2",{children:"Featured Solutions"}),b.jsxs("div",{className:"grid",children:[b.jsxs("div",{className:"card",children:[b.jsx("h3",{children:"Enterprise AI Strategy"}),b.jsx("p",{children:"Comprehensive AI implementation and transformation roadmaps"}),b.jsx("a",{href:"#strategy",className:"learn-more",children:"Learn More →"}),b.jsx("div",{className:"learn-more-content",children:b.jsxs("ul",{children:[b.jsx("li",{children:"Enterprise AI Implementation Strategy"}),b.jsx("li",{children:"LLM & Agent System Architecture"}),b.jsx("li",{children:"GTM Strategy Development"}),b.jsx("li",{children:"Complex System Integration"})]})})]}),b.jsxs("div",{className:"card",children:[b.jsx("h3",{children:"LLM Systems"}),b.jsx("p",{children:"Custom language model development and integration"}),b.jsx("a",{href:"#llm",className:"learn-more",children:"Learn More →"}),b.jsx("div",{className:"learn-more-content",children:b.jsxs("ul",{children:[b.jsx("li",{children:"Custom AI Agent Development"}),b.jsx("li",{children:"Advanced Prompt Engineering"}),b.jsx("li",{children:"Multi-modal System Design"}),b.jsx("li",{children:"Process Automation & Optimization"})]})})]}),b.jsxs("div",{className:"card",children:[b.jsx("h3",{children:"AI Agents"}),b.jsx("p",{children:"Autonomous agent systems for process automation"}),b.jsx("a",{href:"#agents",className:"learn-more",children:"Learn More →"}),b.jsx("div",{className:"learn-more-content",children:b.jsxs("ul",{children:[b.jsx("li",{children:"30k+ hours annual productivity improvement"}),b.jsx("li",{children:"Enterprise systems architecture across industries"}),b.jsx("li",{children:"Performance management for mega-cap enterprises"}),b.jsx("li",{children:"Cloud-wide tech stack transformation"})]})})]})]})]}),b.jsxs("footer",{children:[b.jsxs("div",{className:"social-links",children:[b.jsx("a",{href:"https://www.linkedin.com/company/intuition-labs",children:"LinkedIn"}),b.jsx("a",{href:"https://github.com/wheattoast11",children:"GitHub"}),b.jsx("a",{href:"https://www.youtube.com/@IntuitionLabsLLC",children:"YouTube"})]}),b.jsx("p",{className:"copyright",children:"© 2024 Intuition Labs LLC. Pioneering the future of AI."})]})]})}function PM({onMount:t}){return y.useEffect(()=>{t()},[t]),b.jsxs("div",{id:"app",children:[b.jsx("canvas",{id:"bg"}),b.jsxs("header",{children:[b.jsx(dy,{to:"/",className:"back-link",children:"← Back to Home"}),b.jsx("h1",{children:"Our Manifesto"}),b.jsx("p",{className:"tagline",children:"Shaping the future of AI with purpose and responsibility"})]}),b.jsxs("section",{className:"section manifesto-content",children:[b.jsxs("div",{className:"manifesto-grid",children:[b.jsxs("div",{className:"manifesto-item",children:[b.jsx("h2",{children:"Purpose"}),b.jsx("p",{children:"We believe AI should augment human capabilities, not replace them. Our mission is to create AI systems that enhance human potential while maintaining ethical boundaries and promoting sustainable innovation."})]}),b.jsxs("div",{className:"manifesto-item",children:[b.jsx("h2",{children:"Innovation"}),b.jsx("p",{children:"True innovation comes from understanding both the technical and human aspects of AI. We combine cutting-edge technology with deep industry knowledge to create solutions that matter."})]}),b.jsxs("div",{className:"manifesto-item",children:[b.jsx("h2",{children:"Ethics"}),b.jsx("p",{children:"We are committed to developing AI systems that are transparent, fair, and accountable. Our ethical framework ensures that every solution we create considers its impact on society and individuals."})]}),b.jsxs("div",{className:"manifesto-item",children:[b.jsx("h2",{children:"Collaboration"}),b.jsx("p",{children:"The best solutions emerge from diverse perspectives. We work closely with our clients, fostering partnerships that drive meaningful transformation and sustainable growth."})]})]}),b.jsxs("div",{className:"principles",children:[b.jsx("h2",{children:"Our Guiding Principles"}),b.jsxs("ul",{className:"experience-list",children:[b.jsx("li",{children:"Human-centered AI development that prioritizes user needs and experiences"}),b.jsx("li",{children:"Continuous learning and adaptation to emerging technologies and methodologies"}),b.jsx("li",{children:"Transparent communication and collaboration with stakeholders"}),b.jsx("li",{children:"Sustainable and responsible AI implementation practices"}),b.jsx("li",{children:"Commitment to diversity, equity, and inclusion in AI development"})]})]})]}),b.jsxs("footer",{children:[b.jsxs("div",{className:"social-links",children:[b.jsx("a",{href:"https://www.linkedin.com/company/intuition-labs",children:"LinkedIn"}),b.jsx("a",{href:"https://github.com/wheattoast11",children:"GitHub"}),b.jsx("a",{href:"https://www.youtube.com/@IntuitionLabsLLC",children:"YouTube"})]}),b.jsx("p",{className:"copyright",children:"© 2024 Intuition Labs LLC. Pioneering the future of AI."})]})]})}/** - * @license - * Copyright 2010-2023 Three.js Authors - * SPDX-License-Identifier: MIT - */const Uh="161",LM=0,Fm=1,NM=2,fy=1,DM=2,pi=3,rr=0,pn=1,vi=2,Qi=0,Uo=1,Om=2,km=3,Bm=4,IM=5,Mr=100,UM=101,FM=102,zm=103,Vm=104,OM=200,kM=201,BM=202,zM=203,cf=204,df=205,VM=206,HM=207,GM=208,WM=209,jM=210,$M=211,XM=212,YM=213,qM=214,KM=0,ZM=1,JM=2,au=3,QM=4,e1=5,t1=6,n1=7,Fh=0,i1=1,r1=2,er=0,o1=1,s1=2,a1=3,l1=4,u1=5,c1=6,hy=300,jo=301,$o=302,ff=303,hf=304,Iu=306,pf=1e3,jn=1001,mf=1002,Qt=1003,Hm=1004,xs=1005,an=1006,Ac=1007,Rr=1008,tr=1009,d1=1010,f1=1011,Oh=1012,py=1013,Gi=1014,_i=1015,aa=1016,my=1017,gy=1018,Dr=1020,h1=1021,$n=1023,p1=1024,m1=1025,Ir=1026,Xo=1027,g1=1028,vy=1029,v1=1030,_y=1031,yy=1033,bc=33776,Rc=33777,Pc=33778,Lc=33779,Gm=35840,Wm=35841,jm=35842,$m=35843,xy=36196,Xm=37492,Ym=37496,qm=37808,Km=37809,Zm=37810,Jm=37811,Qm=37812,eg=37813,tg=37814,ng=37815,ig=37816,rg=37817,og=37818,sg=37819,ag=37820,lg=37821,Nc=36492,ug=36494,cg=36495,_1=36283,dg=36284,fg=36285,hg=36286,Sy=3e3,Ur=3001,y1=3200,x1=3201,Ey=0,S1=1,Ln="",Bt="srgb",Ai="srgb-linear",kh="display-p3",Uu="display-p3-linear",lu="linear",ut="srgb",uu="rec709",cu="p3",qr=7680,pg=519,E1=512,w1=513,M1=514,wy=515,T1=516,C1=517,A1=518,b1=519,mg=35044,gg="300 es",gf=1035,Si=2e3,du=2001;class es{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(n)===-1&&i[e].push(n)}hasEventListener(e,n){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(n)!==-1}removeEventListener(e,n){if(this._listeners===void 0)return;const r=this._listeners[e];if(r!==void 0){const o=r.indexOf(n);o!==-1&&r.splice(o,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let o=0,s=r.length;o>8&255]+$t[t>>16&255]+$t[t>>24&255]+"-"+$t[e&255]+$t[e>>8&255]+"-"+$t[e>>16&15|64]+$t[e>>24&255]+"-"+$t[n&63|128]+$t[n>>8&255]+"-"+$t[n>>16&255]+$t[n>>24&255]+$t[i&255]+$t[i>>8&255]+$t[i>>16&255]+$t[i>>24&255]).toLowerCase()}function un(t,e,n){return Math.max(e,Math.min(n,t))}function R1(t,e){return(t%e+e)%e}function Ic(t,e,n){return(1-n)*t+n*e}function vg(t){return(t&t-1)===0&&t!==0}function _f(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function Ss(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function sn(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}class Ye{constructor(e=0,n=0){Ye.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,i=this.y,r=e.elements;return this.x=r[0]*n+r[3]*i+r[6],this.y=r[1]*n+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(n,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(un(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y;return n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const i=Math.cos(n),r=Math.sin(n),o=this.x-e.x,s=this.y-e.y;return this.x=o*i-s*r+e.x,this.y=o*r+s*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Xe{constructor(e,n,i,r,o,s,a,l,u){Xe.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,i,r,o,s,a,l,u)}set(e,n,i,r,o,s,a,l,u){const c=this.elements;return c[0]=e,c[1]=r,c[2]=a,c[3]=n,c[4]=o,c[5]=l,c[6]=i,c[7]=s,c[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],this}extractBasis(e,n,i){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,o=this.elements,s=i[0],a=i[3],l=i[6],u=i[1],c=i[4],d=i[7],h=i[2],g=i[5],_=i[8],S=r[0],p=r[3],f=r[6],m=r[1],v=r[4],E=r[7],M=r[2],w=r[5],T=r[8];return o[0]=s*S+a*m+l*M,o[3]=s*p+a*v+l*w,o[6]=s*f+a*E+l*T,o[1]=u*S+c*m+d*M,o[4]=u*p+c*v+d*w,o[7]=u*f+c*E+d*T,o[2]=h*S+g*m+_*M,o[5]=h*p+g*v+_*w,o[8]=h*f+g*E+_*T,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8];return n*s*c-n*a*u-i*o*c+i*a*l+r*o*u-r*s*l}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8],d=c*s-a*u,h=a*l-c*o,g=u*o-s*l,_=n*d+i*h+r*g;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);const S=1/_;return e[0]=d*S,e[1]=(r*u-c*i)*S,e[2]=(a*i-r*s)*S,e[3]=h*S,e[4]=(c*n-r*l)*S,e[5]=(r*o-a*n)*S,e[6]=g*S,e[7]=(i*l-u*n)*S,e[8]=(s*n-i*o)*S,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,i,r,o,s,a){const l=Math.cos(o),u=Math.sin(o);return this.set(i*l,i*u,-i*(l*s+u*a)+s+e,-r*u,r*l,-r*(-u*s+l*a)+a+n,0,0,1),this}scale(e,n){return this.premultiply(Uc.makeScale(e,n)),this}rotate(e){return this.premultiply(Uc.makeRotation(-e)),this}translate(e,n){return this.premultiply(Uc.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,i,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<9;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<9;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Uc=new Xe;function My(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function fu(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function P1(){const t=fu("canvas");return t.style.display="block",t}const _g={};function Fo(t){t in _g||(_g[t]=!0,console.warn(t))}const yg=new Xe().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),xg=new Xe().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Ga={[Ai]:{transfer:lu,primaries:uu,toReference:t=>t,fromReference:t=>t},[Bt]:{transfer:ut,primaries:uu,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[Uu]:{transfer:lu,primaries:cu,toReference:t=>t.applyMatrix3(xg),fromReference:t=>t.applyMatrix3(yg)},[kh]:{transfer:ut,primaries:cu,toReference:t=>t.convertSRGBToLinear().applyMatrix3(xg),fromReference:t=>t.applyMatrix3(yg).convertLinearToSRGB()}},L1=new Set([Ai,Uu]),ot={enabled:!0,_workingColorSpace:Ai,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!L1.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(this.enabled===!1||e===n||!e||!n)return t;const i=Ga[e].toReference,r=Ga[n].fromReference;return r(i(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return Ga[t].primaries},getTransfer:function(t){return t===Ln?lu:Ga[t].transfer}};function Oo(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function Fc(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let Kr;class Ty{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Kr===void 0&&(Kr=fu("canvas")),Kr.width=e.width,Kr.height=e.height;const i=Kr.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),n=Kr}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=fu("canvas");n.width=e.width,n.height=e.height;const i=n.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),o=r.data;for(let s=0;s0&&(i.userData=this.userData),n||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==hy)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case pf:e.x=e.x-Math.floor(e.x);break;case jn:e.x=e.x<0?0:1;break;case mf:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case pf:e.y=e.y-Math.floor(e.y);break;case jn:e.y=e.y<0?0:1;break;case mf:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return Fo("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Bt?Ur:Sy}set encoding(e){Fo("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===Ur?Bt:Ln}}mn.DEFAULT_IMAGE=null;mn.DEFAULT_MAPPING=hy;mn.DEFAULT_ANISOTROPY=1;class ft{constructor(e=0,n=0,i=0,r=1){ft.prototype.isVector4=!0,this.x=e,this.y=n,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,i,r){return this.x=e,this.y=n,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,o=this.w,s=e.elements;return this.x=s[0]*n+s[4]*i+s[8]*r+s[12]*o,this.y=s[1]*n+s[5]*i+s[9]*r+s[13]*o,this.z=s[2]*n+s[6]*i+s[10]*r+s[14]*o,this.w=s[3]*n+s[7]*i+s[11]*r+s[15]*o,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,i,r,o;const l=e.elements,u=l[0],c=l[4],d=l[8],h=l[1],g=l[5],_=l[9],S=l[2],p=l[6],f=l[10];if(Math.abs(c-h)<.01&&Math.abs(d-S)<.01&&Math.abs(_-p)<.01){if(Math.abs(c+h)<.1&&Math.abs(d+S)<.1&&Math.abs(_+p)<.1&&Math.abs(u+g+f-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const v=(u+1)/2,E=(g+1)/2,M=(f+1)/2,w=(c+h)/4,T=(d+S)/4,L=(_+p)/4;return v>E&&v>M?v<.01?(i=0,r=.707106781,o=.707106781):(i=Math.sqrt(v),r=w/i,o=T/i):E>M?E<.01?(i=.707106781,r=0,o=.707106781):(r=Math.sqrt(E),i=w/r,o=L/r):M<.01?(i=.707106781,r=.707106781,o=0):(o=Math.sqrt(M),i=T/o,r=L/o),this.set(i,r,o,n),this}let m=Math.sqrt((p-_)*(p-_)+(d-S)*(d-S)+(h-c)*(h-c));return Math.abs(m)<.001&&(m=1),this.x=(p-_)/m,this.y=(d-S)/m,this.z=(h-c)/m,this.w=Math.acos((u+g+f-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(n,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this.w=e.w+(n.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class I1 extends es{constructor(e=1,n=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new ft(0,0,e,n),this.scissorTest=!1,this.viewport=new ft(0,0,e,n);const r={width:e,height:n,depth:1};i.encoding!==void 0&&(Fo("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace=i.encoding===Ur?Bt:Ln),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:an,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},i),this.texture=new mn(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=i.generateMipmaps,this.texture.internalFormat=i.internalFormat,this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.depthTexture=i.depthTexture,this.samples=i.samples}setSize(e,n,i=1){(this.width!==e||this.height!==n||this.depth!==i)&&(this.width=e,this.height=n,this.depth=i,this.texture.image.width=e,this.texture.image.height=n,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const n=Object.assign({},e.texture.image);return this.texture.source=new Cy(n),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Vr extends I1{constructor(e=1,n=1,i={}){super(e,n,i),this.isWebGLRenderTarget=!0}}class Ay extends mn{constructor(e=null,n=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:i,depth:r},this.magFilter=Qt,this.minFilter=Qt,this.wrapR=jn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class U1 extends mn{constructor(e=null,n=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:i,depth:r},this.magFilter=Qt,this.minFilter=Qt,this.wrapR=jn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ma{constructor(e=0,n=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=i,this._w=r}static slerpFlat(e,n,i,r,o,s,a){let l=i[r+0],u=i[r+1],c=i[r+2],d=i[r+3];const h=o[s+0],g=o[s+1],_=o[s+2],S=o[s+3];if(a===0){e[n+0]=l,e[n+1]=u,e[n+2]=c,e[n+3]=d;return}if(a===1){e[n+0]=h,e[n+1]=g,e[n+2]=_,e[n+3]=S;return}if(d!==S||l!==h||u!==g||c!==_){let p=1-a;const f=l*h+u*g+c*_+d*S,m=f>=0?1:-1,v=1-f*f;if(v>Number.EPSILON){const M=Math.sqrt(v),w=Math.atan2(M,f*m);p=Math.sin(p*w)/M,a=Math.sin(a*w)/M}const E=a*m;if(l=l*p+h*E,u=u*p+g*E,c=c*p+_*E,d=d*p+S*E,p===1-a){const M=1/Math.sqrt(l*l+u*u+c*c+d*d);l*=M,u*=M,c*=M,d*=M}}e[n]=l,e[n+1]=u,e[n+2]=c,e[n+3]=d}static multiplyQuaternionsFlat(e,n,i,r,o,s){const a=i[r],l=i[r+1],u=i[r+2],c=i[r+3],d=o[s],h=o[s+1],g=o[s+2],_=o[s+3];return e[n]=a*_+c*d+l*g-u*h,e[n+1]=l*_+c*h+u*d-a*g,e[n+2]=u*_+c*g+a*h-l*d,e[n+3]=c*_-a*d-l*h-u*g,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,i,r){return this._x=e,this._y=n,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const i=e._x,r=e._y,o=e._z,s=e._order,a=Math.cos,l=Math.sin,u=a(i/2),c=a(r/2),d=a(o/2),h=l(i/2),g=l(r/2),_=l(o/2);switch(s){case"XYZ":this._x=h*c*d+u*g*_,this._y=u*g*d-h*c*_,this._z=u*c*_+h*g*d,this._w=u*c*d-h*g*_;break;case"YXZ":this._x=h*c*d+u*g*_,this._y=u*g*d-h*c*_,this._z=u*c*_-h*g*d,this._w=u*c*d+h*g*_;break;case"ZXY":this._x=h*c*d-u*g*_,this._y=u*g*d+h*c*_,this._z=u*c*_+h*g*d,this._w=u*c*d-h*g*_;break;case"ZYX":this._x=h*c*d-u*g*_,this._y=u*g*d+h*c*_,this._z=u*c*_-h*g*d,this._w=u*c*d+h*g*_;break;case"YZX":this._x=h*c*d+u*g*_,this._y=u*g*d+h*c*_,this._z=u*c*_-h*g*d,this._w=u*c*d-h*g*_;break;case"XZY":this._x=h*c*d-u*g*_,this._y=u*g*d-h*c*_,this._z=u*c*_+h*g*d,this._w=u*c*d+h*g*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const i=n/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,i=n[0],r=n[4],o=n[8],s=n[1],a=n[5],l=n[9],u=n[2],c=n[6],d=n[10],h=i+a+d;if(h>0){const g=.5/Math.sqrt(h+1);this._w=.25/g,this._x=(c-l)*g,this._y=(o-u)*g,this._z=(s-r)*g}else if(i>a&&i>d){const g=2*Math.sqrt(1+i-a-d);this._w=(c-l)/g,this._x=.25*g,this._y=(r+s)/g,this._z=(o+u)/g}else if(a>d){const g=2*Math.sqrt(1+a-i-d);this._w=(o-u)/g,this._x=(r+s)/g,this._y=.25*g,this._z=(l+c)/g}else{const g=2*Math.sqrt(1+d-i-a);this._w=(s-r)/g,this._x=(o+u)/g,this._y=(l+c)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let i=e.dot(n)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(un(this.dot(e),-1,1)))}rotateTowards(e,n){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,n/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const i=e._x,r=e._y,o=e._z,s=e._w,a=n._x,l=n._y,u=n._z,c=n._w;return this._x=i*c+s*a+r*u-o*l,this._y=r*c+s*l+o*a-i*u,this._z=o*c+s*u+i*l-r*a,this._w=s*c-i*a-r*l-o*u,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const i=this._x,r=this._y,o=this._z,s=this._w;let a=s*e._w+i*e._x+r*e._y+o*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=s,this._x=i,this._y=r,this._z=o,this;const l=1-a*a;if(l<=Number.EPSILON){const g=1-n;return this._w=g*s+n*this._w,this._x=g*i+n*this._x,this._y=g*r+n*this._y,this._z=g*o+n*this._z,this.normalize(),this}const u=Math.sqrt(l),c=Math.atan2(u,a),d=Math.sin((1-n)*c)/u,h=Math.sin(n*c)/u;return this._w=s*d+this._w*h,this._x=i*d+this._x*h,this._y=r*d+this._y*h,this._z=o*d+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,n,i){return this.copy(e).slerp(n,i)}random(){const e=Math.random(),n=Math.sqrt(1-e),i=Math.sqrt(e),r=2*Math.PI*Math.random(),o=2*Math.PI*Math.random();return this.set(n*Math.cos(r),i*Math.sin(o),i*Math.cos(o),n*Math.sin(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class V{constructor(e=0,n=0,i=0){V.prototype.isVector3=!0,this.x=e,this.y=n,this.z=i}set(e,n,i){return i===void 0&&(i=this.z),this.x=e,this.y=n,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(Sg.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(Sg.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,i=this.y,r=this.z,o=e.elements;return this.x=o[0]*n+o[3]*i+o[6]*r,this.y=o[1]*n+o[4]*i+o[7]*r,this.z=o[2]*n+o[5]*i+o[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,o=e.elements,s=1/(o[3]*n+o[7]*i+o[11]*r+o[15]);return this.x=(o[0]*n+o[4]*i+o[8]*r+o[12])*s,this.y=(o[1]*n+o[5]*i+o[9]*r+o[13])*s,this.z=(o[2]*n+o[6]*i+o[10]*r+o[14])*s,this}applyQuaternion(e){const n=this.x,i=this.y,r=this.z,o=e.x,s=e.y,a=e.z,l=e.w,u=2*(s*r-a*i),c=2*(a*n-o*r),d=2*(o*i-s*n);return this.x=n+l*u+s*d-a*c,this.y=i+l*c+a*u-o*d,this.z=r+l*d+o*c-s*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,i=this.y,r=this.z,o=e.elements;return this.x=o[0]*n+o[4]*i+o[8]*r,this.y=o[1]*n+o[5]*i+o[9]*r,this.z=o[2]*n+o[6]*i+o[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(n,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const i=e.x,r=e.y,o=e.z,s=n.x,a=n.y,l=n.z;return this.x=r*l-o*a,this.y=o*s-i*l,this.z=i*a-r*s,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const i=e.dot(this)/n;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return kc.copy(this).projectOnVector(e),this.sub(kc)}reflect(e){return this.sub(kc.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(un(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return n*n+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,i){const r=Math.sin(n)*e;return this.x=r*Math.sin(i),this.y=Math.cos(n)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,i){return this.x=e*Math.sin(n),this.y=i,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=i,this.z=r,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,n=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(n),this.y=i*Math.sin(n),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const kc=new V,Sg=new ma;class ga{constructor(e=new V(1/0,1/0,1/0),n=new V(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,i=e.length;nthis.max.x||e.ythis.max.y||e.zthis.max.z)}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&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,kn),kn.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,i;return e.normal.x>0?(n=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),n<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Es),ja.subVectors(this.max,Es),Zr.subVectors(e.a,Es),Jr.subVectors(e.b,Es),Qr.subVectors(e.c,Es),Pi.subVectors(Jr,Zr),Li.subVectors(Qr,Jr),mr.subVectors(Zr,Qr);let n=[0,-Pi.z,Pi.y,0,-Li.z,Li.y,0,-mr.z,mr.y,Pi.z,0,-Pi.x,Li.z,0,-Li.x,mr.z,0,-mr.x,-Pi.y,Pi.x,0,-Li.y,Li.x,0,-mr.y,mr.x,0];return!Bc(n,Zr,Jr,Qr,ja)||(n=[1,0,0,0,1,0,0,0,1],!Bc(n,Zr,Jr,Qr,ja))?!1:($a.crossVectors(Pi,Li),n=[$a.x,$a.y,$a.z],Bc(n,Zr,Jr,Qr,ja))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,kn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(kn).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(ui[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ui[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ui[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ui[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ui[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ui[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ui[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ui[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ui),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)}}const ui=[new V,new V,new V,new V,new V,new V,new V,new V],kn=new V,Wa=new ga,Zr=new V,Jr=new V,Qr=new V,Pi=new V,Li=new V,mr=new V,Es=new V,ja=new V,$a=new V,gr=new V;function Bc(t,e,n,i,r){for(let o=0,s=t.length-3;o<=s;o+=3){gr.fromArray(t,o);const a=r.x*Math.abs(gr.x)+r.y*Math.abs(gr.y)+r.z*Math.abs(gr.z),l=e.dot(gr),u=n.dot(gr),c=i.dot(gr);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>a)return!1}return!0}const F1=new ga,ws=new V,zc=new V;class Fu{constructor(e=new V,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const i=this.center;n!==void 0?i.copy(n):F1.setFromPoints(e).getCenter(i);let r=0;for(let o=0,s=e.length;othis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;ws.subVectors(e,this.center);const n=ws.lengthSq();if(n>this.radius*this.radius){const i=Math.sqrt(n),r=(i-this.radius)*.5;this.center.addScaledVector(ws,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(zc.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ws.copy(e.center).add(zc)),this.expandByPoint(ws.copy(e.center).sub(zc))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const ci=new V,Vc=new V,Xa=new V,Ni=new V,Hc=new V,Ya=new V,Gc=new V;class by{constructor(e=new V,n=new V(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ci)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const i=n.dot(this.direction);return i<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=ci.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(ci.copy(this.origin).addScaledVector(this.direction,n),ci.distanceToSquared(e))}distanceSqToSegment(e,n,i,r){Vc.copy(e).add(n).multiplyScalar(.5),Xa.copy(n).sub(e).normalize(),Ni.copy(this.origin).sub(Vc);const o=e.distanceTo(n)*.5,s=-this.direction.dot(Xa),a=Ni.dot(this.direction),l=-Ni.dot(Xa),u=Ni.lengthSq(),c=Math.abs(1-s*s);let d,h,g,_;if(c>0)if(d=s*l-a,h=s*a-l,_=o*c,d>=0)if(h>=-_)if(h<=_){const S=1/c;d*=S,h*=S,g=d*(d+s*h+2*a)+h*(s*d+h+2*l)+u}else h=o,d=Math.max(0,-(s*h+a)),g=-d*d+h*(h+2*l)+u;else h=-o,d=Math.max(0,-(s*h+a)),g=-d*d+h*(h+2*l)+u;else h<=-_?(d=Math.max(0,-(-s*o+a)),h=d>0?-o:Math.min(Math.max(-o,-l),o),g=-d*d+h*(h+2*l)+u):h<=_?(d=0,h=Math.min(Math.max(-o,-l),o),g=h*(h+2*l)+u):(d=Math.max(0,-(s*o+a)),h=d>0?o:Math.min(Math.max(-o,-l),o),g=-d*d+h*(h+2*l)+u);else h=s>0?-o:o,d=Math.max(0,-(s*h+a)),g=-d*d+h*(h+2*l)+u;return i&&i.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(Vc).addScaledVector(Xa,h),g}intersectSphere(e,n){ci.subVectors(e.center,this.origin);const i=ci.dot(this.direction),r=ci.dot(ci)-i*i,o=e.radius*e.radius;if(r>o)return null;const s=Math.sqrt(o-r),a=i-s,l=i+s;return l<0?null:a<0?this.at(l,n):this.at(a,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/n;return i>=0?i:null}intersectPlane(e,n){const i=this.distanceToPlane(e);return i===null?null:this.at(i,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let i,r,o,s,a,l;const u=1/this.direction.x,c=1/this.direction.y,d=1/this.direction.z,h=this.origin;return u>=0?(i=(e.min.x-h.x)*u,r=(e.max.x-h.x)*u):(i=(e.max.x-h.x)*u,r=(e.min.x-h.x)*u),c>=0?(o=(e.min.y-h.y)*c,s=(e.max.y-h.y)*c):(o=(e.max.y-h.y)*c,s=(e.min.y-h.y)*c),i>s||o>r||((o>i||isNaN(i))&&(i=o),(s=0?(a=(e.min.z-h.z)*d,l=(e.max.z-h.z)*d):(a=(e.max.z-h.z)*d,l=(e.min.z-h.z)*d),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,n)}intersectsBox(e){return this.intersectBox(e,ci)!==null}intersectTriangle(e,n,i,r,o){Hc.subVectors(n,e),Ya.subVectors(i,e),Gc.crossVectors(Hc,Ya);let s=this.direction.dot(Gc),a;if(s>0){if(r)return null;a=1}else if(s<0)a=-1,s=-s;else return null;Ni.subVectors(this.origin,e);const l=a*this.direction.dot(Ya.crossVectors(Ni,Ya));if(l<0)return null;const u=a*this.direction.dot(Hc.cross(Ni));if(u<0||l+u>s)return null;const c=-a*Ni.dot(Gc);return c<0?null:this.at(c/s,o)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class wt{constructor(e,n,i,r,o,s,a,l,u,c,d,h,g,_,S,p){wt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,i,r,o,s,a,l,u,c,d,h,g,_,S,p)}set(e,n,i,r,o,s,a,l,u,c,d,h,g,_,S,p){const f=this.elements;return f[0]=e,f[4]=n,f[8]=i,f[12]=r,f[1]=o,f[5]=s,f[9]=a,f[13]=l,f[2]=u,f[6]=c,f[10]=d,f[14]=h,f[3]=g,f[7]=_,f[11]=S,f[15]=p,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new wt().fromArray(this.elements)}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],n[9]=i[9],n[10]=i[10],n[11]=i[11],n[12]=i[12],n[13]=i[13],n[14]=i[14],n[15]=i[15],this}copyPosition(e){const n=this.elements,i=e.elements;return n[12]=i[12],n[13]=i[13],n[14]=i[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,i){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,n,i){return this.set(e.x,n.x,i.x,0,e.y,n.y,i.y,0,e.z,n.z,i.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,i=e.elements,r=1/eo.setFromMatrixColumn(e,0).length(),o=1/eo.setFromMatrixColumn(e,1).length(),s=1/eo.setFromMatrixColumn(e,2).length();return n[0]=i[0]*r,n[1]=i[1]*r,n[2]=i[2]*r,n[3]=0,n[4]=i[4]*o,n[5]=i[5]*o,n[6]=i[6]*o,n[7]=0,n[8]=i[8]*s,n[9]=i[9]*s,n[10]=i[10]*s,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,i=e.x,r=e.y,o=e.z,s=Math.cos(i),a=Math.sin(i),l=Math.cos(r),u=Math.sin(r),c=Math.cos(o),d=Math.sin(o);if(e.order==="XYZ"){const h=s*c,g=s*d,_=a*c,S=a*d;n[0]=l*c,n[4]=-l*d,n[8]=u,n[1]=g+_*u,n[5]=h-S*u,n[9]=-a*l,n[2]=S-h*u,n[6]=_+g*u,n[10]=s*l}else if(e.order==="YXZ"){const h=l*c,g=l*d,_=u*c,S=u*d;n[0]=h+S*a,n[4]=_*a-g,n[8]=s*u,n[1]=s*d,n[5]=s*c,n[9]=-a,n[2]=g*a-_,n[6]=S+h*a,n[10]=s*l}else if(e.order==="ZXY"){const h=l*c,g=l*d,_=u*c,S=u*d;n[0]=h-S*a,n[4]=-s*d,n[8]=_+g*a,n[1]=g+_*a,n[5]=s*c,n[9]=S-h*a,n[2]=-s*u,n[6]=a,n[10]=s*l}else if(e.order==="ZYX"){const h=s*c,g=s*d,_=a*c,S=a*d;n[0]=l*c,n[4]=_*u-g,n[8]=h*u+S,n[1]=l*d,n[5]=S*u+h,n[9]=g*u-_,n[2]=-u,n[6]=a*l,n[10]=s*l}else if(e.order==="YZX"){const h=s*l,g=s*u,_=a*l,S=a*u;n[0]=l*c,n[4]=S-h*d,n[8]=_*d+g,n[1]=d,n[5]=s*c,n[9]=-a*c,n[2]=-u*c,n[6]=g*d+_,n[10]=h-S*d}else if(e.order==="XZY"){const h=s*l,g=s*u,_=a*l,S=a*u;n[0]=l*c,n[4]=-d,n[8]=u*c,n[1]=h*d+S,n[5]=s*c,n[9]=g*d-_,n[2]=_*d-g,n[6]=a*c,n[10]=S*d+h}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(O1,e,k1)}lookAt(e,n,i){const r=this.elements;return vn.subVectors(e,n),vn.lengthSq()===0&&(vn.z=1),vn.normalize(),Di.crossVectors(i,vn),Di.lengthSq()===0&&(Math.abs(i.z)===1?vn.x+=1e-4:vn.z+=1e-4,vn.normalize(),Di.crossVectors(i,vn)),Di.normalize(),qa.crossVectors(vn,Di),r[0]=Di.x,r[4]=qa.x,r[8]=vn.x,r[1]=Di.y,r[5]=qa.y,r[9]=vn.y,r[2]=Di.z,r[6]=qa.z,r[10]=vn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,o=this.elements,s=i[0],a=i[4],l=i[8],u=i[12],c=i[1],d=i[5],h=i[9],g=i[13],_=i[2],S=i[6],p=i[10],f=i[14],m=i[3],v=i[7],E=i[11],M=i[15],w=r[0],T=r[4],L=r[8],B=r[12],x=r[1],A=r[5],k=r[9],z=r[13],D=r[2],G=r[6],F=r[10],Z=r[14],U=r[3],O=r[7],H=r[11],X=r[15];return o[0]=s*w+a*x+l*D+u*U,o[4]=s*T+a*A+l*G+u*O,o[8]=s*L+a*k+l*F+u*H,o[12]=s*B+a*z+l*Z+u*X,o[1]=c*w+d*x+h*D+g*U,o[5]=c*T+d*A+h*G+g*O,o[9]=c*L+d*k+h*F+g*H,o[13]=c*B+d*z+h*Z+g*X,o[2]=_*w+S*x+p*D+f*U,o[6]=_*T+S*A+p*G+f*O,o[10]=_*L+S*k+p*F+f*H,o[14]=_*B+S*z+p*Z+f*X,o[3]=m*w+v*x+E*D+M*U,o[7]=m*T+v*A+E*G+M*O,o[11]=m*L+v*k+E*F+M*H,o[15]=m*B+v*z+E*Z+M*X,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[4],r=e[8],o=e[12],s=e[1],a=e[5],l=e[9],u=e[13],c=e[2],d=e[6],h=e[10],g=e[14],_=e[3],S=e[7],p=e[11],f=e[15];return _*(+o*l*d-r*u*d-o*a*h+i*u*h+r*a*g-i*l*g)+S*(+n*l*g-n*u*h+o*s*h-r*s*g+r*u*c-o*l*c)+p*(+n*u*d-n*a*g-o*s*d+i*s*g+o*a*c-i*u*c)+f*(-r*a*c-n*l*d+n*a*h+r*s*d-i*s*h+i*l*c)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=n,r[14]=i),this}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8],d=e[9],h=e[10],g=e[11],_=e[12],S=e[13],p=e[14],f=e[15],m=d*p*u-S*h*u+S*l*g-a*p*g-d*l*f+a*h*f,v=_*h*u-c*p*u-_*l*g+s*p*g+c*l*f-s*h*f,E=c*S*u-_*d*u+_*a*g-s*S*g-c*a*f+s*d*f,M=_*d*l-c*S*l-_*a*h+s*S*h+c*a*p-s*d*p,w=n*m+i*v+r*E+o*M;if(w===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/w;return e[0]=m*T,e[1]=(S*h*o-d*p*o-S*r*g+i*p*g+d*r*f-i*h*f)*T,e[2]=(a*p*o-S*l*o+S*r*u-i*p*u-a*r*f+i*l*f)*T,e[3]=(d*l*o-a*h*o-d*r*u+i*h*u+a*r*g-i*l*g)*T,e[4]=v*T,e[5]=(c*p*o-_*h*o+_*r*g-n*p*g-c*r*f+n*h*f)*T,e[6]=(_*l*o-s*p*o-_*r*u+n*p*u+s*r*f-n*l*f)*T,e[7]=(s*h*o-c*l*o+c*r*u-n*h*u-s*r*g+n*l*g)*T,e[8]=E*T,e[9]=(_*d*o-c*S*o-_*i*g+n*S*g+c*i*f-n*d*f)*T,e[10]=(s*S*o-_*a*o+_*i*u-n*S*u-s*i*f+n*a*f)*T,e[11]=(c*a*o-s*d*o-c*i*u+n*d*u+s*i*g-n*a*g)*T,e[12]=M*T,e[13]=(c*S*r-_*d*r+_*i*h-n*S*h-c*i*p+n*d*p)*T,e[14]=(_*a*r-s*S*r-_*i*l+n*S*l+s*i*p-n*a*p)*T,e[15]=(s*d*r-c*a*r+c*i*l-n*d*l-s*i*h+n*a*h)*T,this}scale(e){const n=this.elements,i=e.x,r=e.y,o=e.z;return n[0]*=i,n[4]*=r,n[8]*=o,n[1]*=i,n[5]*=r,n[9]*=o,n[2]*=i,n[6]*=r,n[10]*=o,n[3]*=i,n[7]*=r,n[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,i,r))}makeTranslation(e,n,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,i,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const i=Math.cos(n),r=Math.sin(n),o=1-i,s=e.x,a=e.y,l=e.z,u=o*s,c=o*a;return this.set(u*s+i,u*a-r*l,u*l+r*a,0,u*a+r*l,c*a+i,c*l-r*s,0,u*l-r*a,c*l+r*s,o*l*l+i,0,0,0,0,1),this}makeScale(e,n,i){return this.set(e,0,0,0,0,n,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,n,i,r,o,s){return this.set(1,i,o,0,e,1,s,0,n,r,1,0,0,0,0,1),this}compose(e,n,i){const r=this.elements,o=n._x,s=n._y,a=n._z,l=n._w,u=o+o,c=s+s,d=a+a,h=o*u,g=o*c,_=o*d,S=s*c,p=s*d,f=a*d,m=l*u,v=l*c,E=l*d,M=i.x,w=i.y,T=i.z;return r[0]=(1-(S+f))*M,r[1]=(g+E)*M,r[2]=(_-v)*M,r[3]=0,r[4]=(g-E)*w,r[5]=(1-(h+f))*w,r[6]=(p+m)*w,r[7]=0,r[8]=(_+v)*T,r[9]=(p-m)*T,r[10]=(1-(h+S))*T,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,n,i){const r=this.elements;let o=eo.set(r[0],r[1],r[2]).length();const s=eo.set(r[4],r[5],r[6]).length(),a=eo.set(r[8],r[9],r[10]).length();this.determinant()<0&&(o=-o),e.x=r[12],e.y=r[13],e.z=r[14],Bn.copy(this);const u=1/o,c=1/s,d=1/a;return Bn.elements[0]*=u,Bn.elements[1]*=u,Bn.elements[2]*=u,Bn.elements[4]*=c,Bn.elements[5]*=c,Bn.elements[6]*=c,Bn.elements[8]*=d,Bn.elements[9]*=d,Bn.elements[10]*=d,n.setFromRotationMatrix(Bn),i.x=o,i.y=s,i.z=a,this}makePerspective(e,n,i,r,o,s,a=Si){const l=this.elements,u=2*o/(n-e),c=2*o/(i-r),d=(n+e)/(n-e),h=(i+r)/(i-r);let g,_;if(a===Si)g=-(s+o)/(s-o),_=-2*s*o/(s-o);else if(a===du)g=-s/(s-o),_=-s*o/(s-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=u,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=c,l[9]=h,l[13]=0,l[2]=0,l[6]=0,l[10]=g,l[14]=_,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,n,i,r,o,s,a=Si){const l=this.elements,u=1/(n-e),c=1/(i-r),d=1/(s-o),h=(n+e)*u,g=(i+r)*c;let _,S;if(a===Si)_=(s+o)*d,S=-2*d;else if(a===du)_=o*d,S=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-h,l[1]=0,l[5]=2*c,l[9]=0,l[13]=-g,l[2]=0,l[6]=0,l[10]=S,l[14]=-_,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<16;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<16;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e[n+9]=i[9],e[n+10]=i[10],e[n+11]=i[11],e[n+12]=i[12],e[n+13]=i[13],e[n+14]=i[14],e[n+15]=i[15],e}}const eo=new V,Bn=new wt,O1=new V(0,0,0),k1=new V(1,1,1),Di=new V,qa=new V,vn=new V,Eg=new wt,wg=new ma;class Ou{constructor(e=0,n=0,i=0,r=Ou.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,i,r=this._order){return this._x=e,this._y=n,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,i=!0){const r=e.elements,o=r[0],s=r[4],a=r[8],l=r[1],u=r[5],c=r[9],d=r[2],h=r[6],g=r[10];switch(n){case"XYZ":this._y=Math.asin(un(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,g),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(h,u),this._z=0);break;case"YXZ":this._x=Math.asin(-un(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,g),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-d,o),this._z=0);break;case"ZXY":this._x=Math.asin(un(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-d,g),this._z=Math.atan2(-s,u)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-un(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(h,g),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-s,u));break;case"YZX":this._z=Math.asin(un(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-c,u),this._y=Math.atan2(-d,o)):(this._x=0,this._y=Math.atan2(a,g));break;case"XZY":this._z=Math.asin(-un(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(h,u),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-c,g),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,i){return Eg.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Eg,n,i)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return wg.setFromEuler(this),this.setFromQuaternion(wg,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Ou.DEFAULT_ORDER="XYZ";class Ry{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),r.maxGeometryCount=this._maxGeometryCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function o(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=o(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let u=0,c=l.length;u0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),u.length>0&&(i.textures=u),c.length>0&&(i.images=c),d.length>0&&(i.shapes=d),h.length>0&&(i.skeletons=h),g.length>0&&(i.animations=g),_.length>0&&(i.nodes=_)}return i.object=r,i;function s(a){const l=[];for(const u in a){const c=a[u];delete c.metadata,l.push(c)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(o)):r.set(0,0,0)}static getBarycoord(e,n,i,r,o){zn.subVectors(r,n),fi.subVectors(i,n),Wc.subVectors(e,n);const s=zn.dot(zn),a=zn.dot(fi),l=zn.dot(Wc),u=fi.dot(fi),c=fi.dot(Wc),d=s*u-a*a;if(d===0)return o.set(0,0,0),null;const h=1/d,g=(u*l-a*c)*h,_=(s*c-a*l)*h;return o.set(1-g-_,_,g)}static containsPoint(e,n,i,r){return this.getBarycoord(e,n,i,r,hi)===null?!1:hi.x>=0&&hi.y>=0&&hi.x+hi.y<=1}static getInterpolation(e,n,i,r,o,s,a,l){return this.getBarycoord(e,n,i,r,hi)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(o,hi.x),l.addScaledVector(s,hi.y),l.addScaledVector(a,hi.z),l)}static isFrontFacing(e,n,i,r){return zn.subVectors(i,n),fi.subVectors(e,n),zn.cross(fi).dot(r)<0}set(e,n,i){return this.a.copy(e),this.b.copy(n),this.c.copy(i),this}setFromPointsAndIndices(e,n,i,r){return this.a.copy(e[n]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,n,i,r){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return zn.subVectors(this.c,this.b),fi.subVectors(this.a,this.b),zn.cross(fi).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return ti.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return ti.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,i,r,o){return ti.getInterpolation(e,this.a,this.b,this.c,n,i,r,o)}containsPoint(e){return ti.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return ti.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const i=this.a,r=this.b,o=this.c;let s,a;no.subVectors(r,i),io.subVectors(o,i),jc.subVectors(e,i);const l=no.dot(jc),u=io.dot(jc);if(l<=0&&u<=0)return n.copy(i);$c.subVectors(e,r);const c=no.dot($c),d=io.dot($c);if(c>=0&&d<=c)return n.copy(r);const h=l*d-c*u;if(h<=0&&l>=0&&c<=0)return s=l/(l-c),n.copy(i).addScaledVector(no,s);Xc.subVectors(e,o);const g=no.dot(Xc),_=io.dot(Xc);if(_>=0&&g<=_)return n.copy(o);const S=g*u-l*_;if(S<=0&&u>=0&&_<=0)return a=u/(u-_),n.copy(i).addScaledVector(io,a);const p=c*_-g*d;if(p<=0&&d-c>=0&&g-_>=0)return bg.subVectors(o,r),a=(d-c)/(d-c+(g-_)),n.copy(r).addScaledVector(bg,a);const f=1/(p+S+h);return s=S*f,a=h*f,n.copy(i).addScaledVector(no,s).addScaledVector(io,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Py={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ii={h:0,s:0,l:0},Za={h:0,s:0,l:0};function Yc(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}class Ze{constructor(e,n,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,i)}set(e,n,i){if(n===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,n,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Bt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,ot.toWorkingColorSpace(this,n),this}setRGB(e,n,i,r=ot.workingColorSpace){return this.r=e,this.g=n,this.b=i,ot.toWorkingColorSpace(this,r),this}setHSL(e,n,i,r=ot.workingColorSpace){if(e=R1(e,1),n=un(n,0,1),i=un(i,0,1),n===0)this.r=this.g=this.b=i;else{const o=i<=.5?i*(1+n):i+n-i*n,s=2*i-o;this.r=Yc(s,o,e+1/3),this.g=Yc(s,o,e),this.b=Yc(s,o,e-1/3)}return ot.toWorkingColorSpace(this,r),this}setStyle(e,n=Bt){function i(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let o;const s=r[1],a=r[2];switch(s){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,n);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,n);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=r[1],s=o.length;if(s===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,n);if(s===6)return this.setHex(parseInt(o,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=Bt){const i=Py[e.toLowerCase()];return i!==void 0?this.setHex(i,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Oo(e.r),this.g=Oo(e.g),this.b=Oo(e.b),this}copyLinearToSRGB(e){return this.r=Fc(e.r),this.g=Fc(e.g),this.b=Fc(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Bt){return ot.fromWorkingColorSpace(Xt.copy(this),e),Math.round(un(Xt.r*255,0,255))*65536+Math.round(un(Xt.g*255,0,255))*256+Math.round(un(Xt.b*255,0,255))}getHexString(e=Bt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=ot.workingColorSpace){ot.fromWorkingColorSpace(Xt.copy(this),n);const i=Xt.r,r=Xt.g,o=Xt.b,s=Math.max(i,r,o),a=Math.min(i,r,o);let l,u;const c=(a+s)/2;if(a===s)l=0,u=0;else{const d=s-a;switch(u=c<=.5?d/(s+a):d/(2-s-a),s){case i:l=(r-o)/d+(r0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const i=e[n];if(i===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Uo&&(i.blending=this.blending),this.side!==rr&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==cf&&(i.blendSrc=this.blendSrc),this.blendDst!==df&&(i.blendDst=this.blendDst),this.blendEquation!==Mr&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==au&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==pg&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==qr&&(i.stencilFail=this.stencilFail),this.stencilZFail!==qr&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==qr&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(o){const s=[];for(const a in o){const l=o[a];delete l.metadata,s.push(l)}return s}if(n){const o=r(e.textures),s=r(e.images);o.length>0&&(i.textures=o),s.length>0&&(i.images=s)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let i=null;if(n!==null){const r=n.length;i=new Array(r);for(let o=0;o!==r;++o)i[o]=n[o].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Ly extends ts{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ze(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Fh,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,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.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.fog=e.fog,this}}const Mt=new V,Ja=new Ye;class oi{constructor(e,n,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=i,this.usage=mg,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=_i,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return Fo("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,i){e*=this.itemSize,i*=n.itemSize;for(let r=0,o=this.itemSize;r0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const i=this.attributes;for(const l in i){const u=i[l];e.data.attributes[l]=u.toJSON(e.data)}const r={};let o=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],c=[];for(let d=0,h=u.length;d0&&(r[l]=c,o=!0)}o&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(n));const r=e.attributes;for(const u in r){const c=r[u];this.setAttribute(u,c.clone(n))}const o=e.morphAttributes;for(const u in o){const c=[],d=o[u];for(let h=0,g=d.length;h0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=r.length;o(e.far-e.near)**2))&&(Rg.copy(o).invert(),vr.copy(e.ray).applyMatrix4(Rg),!(i.boundingBox!==null&&vr.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,n,vr)))}_computeIntersections(e,n,i){let r;const o=this.geometry,s=this.material,a=o.index,l=o.attributes.position,u=o.attributes.uv,c=o.attributes.uv1,d=o.attributes.normal,h=o.groups,g=o.drawRange;if(a!==null)if(Array.isArray(s))for(let _=0,S=h.length;_n.far?null:{distance:u,point:ol.clone(),object:t}}function sl(t,e,n,i,r,o,s,a,l,u){t.getVertexPosition(a,oo),t.getVertexPosition(l,so),t.getVertexPosition(u,ao);const c=$1(t,e,n,i,oo,so,ao,rl);if(c){r&&(tl.fromBufferAttribute(r,a),nl.fromBufferAttribute(r,l),il.fromBufferAttribute(r,u),c.uv=ti.getInterpolation(rl,oo,so,ao,tl,nl,il,new Ye)),o&&(tl.fromBufferAttribute(o,a),nl.fromBufferAttribute(o,l),il.fromBufferAttribute(o,u),c.uv1=ti.getInterpolation(rl,oo,so,ao,tl,nl,il,new Ye),c.uv2=c.uv1),s&&(Lg.fromBufferAttribute(s,a),Ng.fromBufferAttribute(s,l),Dg.fromBufferAttribute(s,u),c.normal=ti.getInterpolation(rl,oo,so,ao,Lg,Ng,Dg,new V),c.normal.dot(i.direction)>0&&c.normal.multiplyScalar(-1));const d={a,b:l,c:u,normal:new V,materialIndex:0};ti.getNormal(oo,so,ao,d.normal),c.face=d}return c}class va extends si{constructor(e=1,n=1,i=1,r=1,o=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:i,widthSegments:r,heightSegments:o,depthSegments:s};const a=this;r=Math.floor(r),o=Math.floor(o),s=Math.floor(s);const l=[],u=[],c=[],d=[];let h=0,g=0;_("z","y","x",-1,-1,i,n,e,s,o,0),_("z","y","x",1,-1,i,n,-e,s,o,1),_("x","z","y",1,1,e,i,n,r,s,2),_("x","z","y",1,-1,e,i,-n,r,s,3),_("x","y","z",1,-1,e,n,i,r,o,4),_("x","y","z",-1,-1,e,n,-i,r,o,5),this.setIndex(l),this.setAttribute("position",new In(u,3)),this.setAttribute("normal",new In(c,3)),this.setAttribute("uv",new In(d,2));function _(S,p,f,m,v,E,M,w,T,L,B){const x=E/T,A=M/L,k=E/2,z=M/2,D=w/2,G=T+1,F=L+1;let Z=0,U=0;const O=new V;for(let H=0;H0?1:-1,c.push(O.x,O.y,O.z),d.push(Q/T),d.push(1-H/L),Z+=1}}for(let H=0;H0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(n.extensions=i),n}}class Uy extends tn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new wt,this.projectionMatrix=new wt,this.projectionMatrixInverse=new wt,this.coordinateSystem=Si}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Ui=new V,Ig=new Ye,Ug=new Ye;class Sn extends Uy{constructor(e=50,n=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=vf*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Dc*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return vf*2*Math.atan(Math.tan(Dc*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,i){Ui.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Ui.x,Ui.y).multiplyScalar(-e/Ui.z),Ui.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Ui.x,Ui.y).multiplyScalar(-e/Ui.z)}getViewSize(e,n){return this.getViewBounds(e,Ig,Ug),n.subVectors(Ug,Ig)}setViewOffset(e,n,i,r,o,s){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=r,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(Dc*.5*this.fov)/this.zoom,i=2*n,r=this.aspect*i,o=-.5*r;const s=this.view;if(this.view!==null&&this.view.enabled){const l=s.fullWidth,u=s.fullHeight;o+=s.offsetX*r/l,n-=s.offsetY*i/u,r*=s.width/l,i*=s.height/u}const a=this.filmOffset;a!==0&&(o+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+r,n,n-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const lo=-90,uo=1;class Z1 extends tn{constructor(e,n,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Sn(lo,uo,e,n);r.layers=this.layers,this.add(r);const o=new Sn(lo,uo,e,n);o.layers=this.layers,this.add(o);const s=new Sn(lo,uo,e,n);s.layers=this.layers,this.add(s);const a=new Sn(lo,uo,e,n);a.layers=this.layers,this.add(a);const l=new Sn(lo,uo,e,n);l.layers=this.layers,this.add(l);const u=new Sn(lo,uo,e,n);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[i,r,o,s,a,l]=n;for(const u of n)this.remove(u);if(e===Si)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),o.up.set(0,0,-1),o.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===du)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),o.up.set(0,0,1),o.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const u of n)this.add(u),u.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[o,s,a,l,u,c]=this.children,d=e.getRenderTarget(),h=e.getActiveCubeFace(),g=e.getActiveMipmapLevel(),_=e.xr.enabled;e.xr.enabled=!1;const S=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(n,o),e.setRenderTarget(i,1,r),e.render(n,s),e.setRenderTarget(i,2,r),e.render(n,a),e.setRenderTarget(i,3,r),e.render(n,l),e.setRenderTarget(i,4,r),e.render(n,u),i.texture.generateMipmaps=S,e.setRenderTarget(i,5,r),e.render(n,c),e.setRenderTarget(d,h,g),e.xr.enabled=_,i.texture.needsPMREMUpdate=!0}}class Fy extends mn{constructor(e,n,i,r,o,s,a,l,u,c){e=e!==void 0?e:[],n=n!==void 0?n:jo,super(e,n,i,r,o,s,a,l,u,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class J1 extends Vr{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];n.encoding!==void 0&&(Fo("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===Ur?Bt:Ln),this.texture=new Fy(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:an}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},r=new va(5,5,5),o=new or({name:"CubemapFromEquirect",uniforms:Yo(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:pn,blending:Qi});o.uniforms.tEquirect.value=n;const s=new ni(r,o),a=n.minFilter;return n.minFilter===Rr&&(n.minFilter=an),new Z1(1,10,this).update(e,s),n.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(e,n,i,r){const o=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(n,i,r);e.setRenderTarget(o)}}const Zc=new V,Q1=new V,eT=new Xe;class Sr{constructor(e=new V(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,i,r){return this.normal.set(e,n,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,i){const r=Zc.subVectors(i,n).cross(Q1.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const i=e.delta(Zc),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const o=-(e.start.dot(this.normal)+this.constant)/r;return o<0||o>1?null:n.copy(e.start).addScaledVector(i,o)}intersectsLine(e){const n=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return n<0&&i>0||i<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const i=n||eT.getNormalMatrix(e),r=this.coplanarPoint(Zc).applyMatrix4(e),o=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const _r=new Fu,al=new V;class Bh{constructor(e=new Sr,n=new Sr,i=new Sr,r=new Sr,o=new Sr,s=new Sr){this.planes=[e,n,i,r,o,s]}set(e,n,i,r,o,s){const a=this.planes;return a[0].copy(e),a[1].copy(n),a[2].copy(i),a[3].copy(r),a[4].copy(o),a[5].copy(s),this}copy(e){const n=this.planes;for(let i=0;i<6;i++)n[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,n=Si){const i=this.planes,r=e.elements,o=r[0],s=r[1],a=r[2],l=r[3],u=r[4],c=r[5],d=r[6],h=r[7],g=r[8],_=r[9],S=r[10],p=r[11],f=r[12],m=r[13],v=r[14],E=r[15];if(i[0].setComponents(l-o,h-u,p-g,E-f).normalize(),i[1].setComponents(l+o,h+u,p+g,E+f).normalize(),i[2].setComponents(l+s,h+c,p+_,E+m).normalize(),i[3].setComponents(l-s,h-c,p-_,E-m).normalize(),i[4].setComponents(l-a,h-d,p-S,E-v).normalize(),n===Si)i[5].setComponents(l+a,h+d,p+S,E+v).normalize();else if(n===du)i[5].setComponents(a,d,S,v).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),_r.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),_r.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(_r)}intersectsSprite(e){return _r.center.set(0,0,0),_r.radius=.7071067811865476,_r.applyMatrix4(e.matrixWorld),this.intersectsSphere(_r)}intersectsSphere(e){const n=this.planes,i=e.center,r=-e.radius;for(let o=0;o<6;o++)if(n[o].distanceToPoint(i)0?e.max.x:e.min.x,al.y=r.normal.y>0?e.max.y:e.min.y,al.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(al)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let i=0;i<6;i++)if(n[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function Oy(){let t=null,e=!1,n=null,i=null;function r(o,s){n(o,s),i=t.requestAnimationFrame(r)}return{start:function(){e!==!0&&n!==null&&(i=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(o){n=o},setContext:function(o){t=o}}}function tT(t,e){const n=e.isWebGL2,i=new WeakMap;function r(u,c){const d=u.array,h=u.usage,g=d.byteLength,_=t.createBuffer();t.bindBuffer(c,_),t.bufferData(c,d,h),u.onUploadCallback();let S;if(d instanceof Float32Array)S=t.FLOAT;else if(d instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(n)S=t.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else S=t.UNSIGNED_SHORT;else if(d instanceof Int16Array)S=t.SHORT;else if(d instanceof Uint32Array)S=t.UNSIGNED_INT;else if(d instanceof Int32Array)S=t.INT;else if(d instanceof Int8Array)S=t.BYTE;else if(d instanceof Uint8Array)S=t.UNSIGNED_BYTE;else if(d instanceof Uint8ClampedArray)S=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+d);return{buffer:_,type:S,bytesPerElement:d.BYTES_PER_ELEMENT,version:u.version,size:g}}function o(u,c,d){const h=c.array,g=c._updateRange,_=c.updateRanges;if(t.bindBuffer(d,u),g.count===-1&&_.length===0&&t.bufferSubData(d,0,h),_.length!==0){for(let S=0,p=_.length;S 0 - vec4 plane; - #ifdef ALPHA_TO_COVERAGE - float distanceToPlane, distanceGradient; - float clipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - if ( clipOpacity == 0.0 ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - float unionClipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - } - #pragma unroll_loop_end - clipOpacity *= 1.0 - unionClipOpacity; - #endif - diffuseColor.a *= clipOpacity; - if ( diffuseColor.a == 0.0 ) discard; - #else - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif - #endif -#endif`,_T=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,yT=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,xT=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,ST=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,ET=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,wT=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,MT=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif`,TT=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement( a ) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -vec3 pow2( const in vec3 x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } -float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract( sin( sn ) * c ); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -#ifdef USE_ALPHAHASH - varying vec3 vPosition; -#endif -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -float luminance( const in vec3 rgb ) { - const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); - return dot( weights, rgb ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -} -vec3 BRDF_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { - float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); - return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} -float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { - float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); - return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} // validated`,CT=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_minMipLevel 4.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - uv.x += filterInt * 3.0 * cubeUV_minTileSize; - uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); - uv.x *= CUBEUV_TEXEL_WIDTH; - uv.y *= CUBEUV_TEXEL_HEIGHT; - #ifdef texture2DGradEXT - return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; - #else - return texture2D( envMap, uv ).rgb; - #endif - } - #define cubeUV_r0 1.0 - #define cubeUV_m0 - 2.0 - #define cubeUV_r1 0.8 - #define cubeUV_m1 - 1.0 - #define cubeUV_r4 0.4 - #define cubeUV_m4 2.0 - #define cubeUV_r5 0.305 - #define cubeUV_m5 3.0 - #define cubeUV_r6 0.21 - #define cubeUV_m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= cubeUV_r1 ) { - mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; - } else if ( roughness >= cubeUV_r4 ) { - mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; - } else if ( roughness >= cubeUV_r5 ) { - mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; - } else if ( roughness >= cubeUV_r6 ) { - mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,AT=`vec3 transformedNormal = objectNormal; -#ifdef USE_TANGENT - vec3 transformedTangent = objectTangent; -#endif -#ifdef USE_BATCHING - mat3 bm = mat3( batchingMatrix ); - transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); - transformedNormal = bm * transformedNormal; - #ifdef USE_TANGENT - transformedTangent = bm * transformedTangent; - #endif -#endif -#ifdef USE_INSTANCING - mat3 im = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); - transformedNormal = im * transformedNormal; - #ifdef USE_TANGENT - transformedTangent = im * transformedTangent; - #endif -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,bT=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,RT=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,PT=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,LT=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,NT="gl_FragColor = linearToOutputTexel( gl_FragColor );",DT=` -const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( - vec3( 0.8224621, 0.177538, 0.0 ), - vec3( 0.0331941, 0.9668058, 0.0 ), - vec3( 0.0170827, 0.0723974, 0.9105199 ) -); -const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( - vec3( 1.2249401, - 0.2249404, 0.0 ), - vec3( - 0.0420569, 1.0420571, 0.0 ), - vec3( - 0.0196376, - 0.0786361, 1.0982735 ) -); -vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { - return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); -} -vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { - return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); -} -vec4 LinearTransferOETF( in vec4 value ) { - return value; -} -vec4 sRGBTransferOETF( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -} -vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 LinearTosRGB( in vec4 value ) { - return sRGBTransferOETF( value ); -}`,IT=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,UT=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,FT=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,OT=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,kT=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,BT=`#ifdef USE_FOG - vFogDepth = - mvPosition.z; -#endif`,zT=`#ifdef USE_FOG - varying float vFogDepth; -#endif`,VT=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,HT=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float vFogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,GT=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return vec3( texture2D( gradientMap, coord ).r ); - #else - vec2 fw = fwidth( coord ) * 0.5; - return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); - #endif -}`,WT=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; - reflectedLight.indirectDiffuse += lightMapIrradiance; -#endif`,jT=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,$T=`LambertMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,XT=`varying vec3 vViewPosition; -struct LambertMaterial { - vec3 diffuseColor; - float specularStrength; -}; -void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,YT=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -#if defined( USE_LIGHT_PROBES ) - uniform vec3 lightProbe[ 9 ]; -#endif -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - return irradiance; -} -float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { - #if defined ( LEGACY_LIGHTS ) - if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); - } - return 1.0; - #else - float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); - if ( cutoffDistance > 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; - #endif -} -float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { - return smoothstep( coneCosine, penumbraCosine, angleCosine ); -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { - light.color = directionalLight.color; - light.direction = directionalLight.direction; - light.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { - vec3 lVector = pointLight.position - geometryPosition; - light.direction = normalize( lVector ); - float lightDistance = length( lVector ); - light.color = pointLight.color; - light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { - vec3 lVector = spotLight.position - geometryPosition; - light.direction = normalize( lVector ); - float angleCos = dot( light.direction, spotLight.direction ); - float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - if ( spotAttenuation > 0.0 ) { - float lightDistance = length( lVector ); - light.color = spotLight.color * spotAttenuation; - light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } else { - light.color = vec3( 0.0 ); - light.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { - float dotNL = dot( normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - return irradiance; - } -#endif`,qT=`#ifdef USE_ENVMAP - vec3 getIBLIrradiance( const in vec3 normal ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); - return PI * envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 reflectVec = reflect( - viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); - return envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - #ifdef USE_ANISOTROPY - vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 bentNormal = cross( bitangent, viewDir ); - bentNormal = normalize( cross( bentNormal, bitangent ) ); - bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); - return getIBLRadiance( viewDir, bentNormal, roughness ); - #else - return vec3( 0.0 ); - #endif - } - #endif -#endif`,KT=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,ZT=`varying vec3 vViewPosition; -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,JT=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,QT=`varying vec3 vViewPosition; -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,eC=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; -material.roughness = min( material.roughness, 1.0 ); -#ifdef IOR - material.ior = ior; - #ifdef USE_SPECULAR - float specularIntensityFactor = specularIntensity; - vec3 specularColorFactor = specularColor; - #ifdef USE_SPECULAR_COLORMAP - specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; - #endif - #ifdef USE_SPECULAR_INTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; - #endif - material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); - #else - float specularIntensityFactor = 1.0; - vec3 specularColorFactor = vec3( 1.0 ); - material.specularF90 = 1.0; - #endif - material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); - material.specularF90 = 1.0; -#endif -#ifdef USE_CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - material.clearcoatF0 = vec3( 0.04 ); - material.clearcoatF90 = 1.0; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_IRIDESCENCE - material.iridescence = iridescence; - material.iridescenceIOR = iridescenceIOR; - #ifdef USE_IRIDESCENCEMAP - material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; - #endif - #ifdef USE_IRIDESCENCE_THICKNESSMAP - material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; - #else - material.iridescenceThickness = iridescenceThicknessMaximum; - #endif -#endif -#ifdef USE_SHEEN - material.sheenColor = sheenColor; - #ifdef USE_SHEEN_COLORMAP - material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; - #endif - material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); - #ifdef USE_SHEEN_ROUGHNESSMAP - material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; - #endif -#endif -#ifdef USE_ANISOTROPY - #ifdef USE_ANISOTROPYMAP - mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); - vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; - vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; - #else - vec2 anisotropyV = anisotropyVector; - #endif - material.anisotropy = length( anisotropyV ); - if( material.anisotropy == 0.0 ) { - anisotropyV = vec2( 1.0, 0.0 ); - } else { - anisotropyV /= material.anisotropy; - material.anisotropy = saturate( material.anisotropy ); - } - material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); - material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; - material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; -#endif`,tC=`struct PhysicalMaterial { - vec3 diffuseColor; - float roughness; - vec3 specularColor; - float specularF90; - #ifdef USE_CLEARCOAT - float clearcoat; - float clearcoatRoughness; - vec3 clearcoatF0; - float clearcoatF90; - #endif - #ifdef USE_IRIDESCENCE - float iridescence; - float iridescenceIOR; - float iridescenceThickness; - vec3 iridescenceFresnel; - vec3 iridescenceF0; - #endif - #ifdef USE_SHEEN - vec3 sheenColor; - float sheenRoughness; - #endif - #ifdef IOR - float ior; - #endif - #ifdef USE_TRANSMISSION - float transmission; - float transmissionAlpha; - float thickness; - float attenuationDistance; - vec3 attenuationColor; - #endif - #ifdef USE_ANISOTROPY - float anisotropy; - float alphaT; - vec3 anisotropyT; - vec3 anisotropyB; - #endif -}; -vec3 clearcoatSpecularDirect = vec3( 0.0 ); -vec3 clearcoatSpecularIndirect = vec3( 0.0 ); -vec3 sheenSpecularDirect = vec3( 0.0 ); -vec3 sheenSpecularIndirect = vec3(0.0 ); -vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { - float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); - float x2 = x * x; - float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); - return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); -} -float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -#ifdef USE_ANISOTROPY - float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { - float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); - float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); - float v = 0.5 / ( gv + gl ); - return saturate(v); - } - float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { - float a2 = alphaT * alphaB; - highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); - highp float v2 = dot( v, v ); - float w2 = a2 / v2; - return RECIPROCAL_PI * a2 * pow2 ( w2 ); - } -#endif -#ifdef USE_CLEARCOAT - vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { - vec3 f0 = material.clearcoatF0; - float f90 = material.clearcoatF90; - float roughness = material.clearcoatRoughness; - float alpha = pow2( roughness ); - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotVH ); - float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( V * D ); - } -#endif -vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { - vec3 f0 = material.specularColor; - float f90 = material.specularF90; - float roughness = material.roughness; - float alpha = pow2( roughness ); - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotVH ); - #ifdef USE_IRIDESCENCE - F = mix( F, material.iridescenceFresnel, material.iridescence ); - #endif - #ifdef USE_ANISOTROPY - float dotTL = dot( material.anisotropyT, lightDir ); - float dotTV = dot( material.anisotropyT, viewDir ); - float dotTH = dot( material.anisotropyT, halfDir ); - float dotBL = dot( material.anisotropyB, lightDir ); - float dotBV = dot( material.anisotropyB, viewDir ); - float dotBH = dot( material.anisotropyB, halfDir ); - float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); - float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); - #else - float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - #endif - return F * ( V * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -#if defined( USE_SHEEN ) -float D_Charlie( float roughness, float dotNH ) { - float alpha = pow2( roughness ); - float invAlpha = 1.0 / alpha; - float cos2h = dotNH * dotNH; - float sin2h = max( 1.0 - cos2h, 0.0078125 ); - return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); -} -float V_Neubelt( float dotNV, float dotNL ) { - return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); -} -vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float D = D_Charlie( sheenRoughness, dotNH ); - float V = V_Neubelt( dotNV, dotNL ); - return sheenColor * ( D * V ); -} -#endif -float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - float r2 = roughness * roughness; - float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; - float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; - float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); - return saturate( DG * RECIPROCAL_PI ); -} -vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); - const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); - vec4 r = roughness * c0 + c1; - float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; - vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; - return fab; -} -vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { - vec2 fab = DFGApprox( normal, viewDir, roughness ); - return specularColor * fab.x + specularF90 * fab.y; -} -#ifdef USE_IRIDESCENCE -void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#else -void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#endif - vec2 fab = DFGApprox( normal, viewDir, roughness ); - #ifdef USE_IRIDESCENCE - vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); - #else - vec3 Fr = specularColor; - #endif - vec3 FssEss = Fr * fab.x + specularF90 * fab.y; - float Ess = fab.x + fab.y; - float Ems = 1.0 - Ess; - vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometryNormal; - vec3 viewDir = geometryViewDir; - vec3 position = geometryPosition; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.roughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifdef USE_CLEARCOAT - float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = dotNLcc * directLight.color; - clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); - #endif - #ifdef USE_SHEEN - sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); - #endif - reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef USE_CLEARCOAT - clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); - #endif - #ifdef USE_SHEEN - sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); - #endif - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - #ifdef USE_IRIDESCENCE - computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); - #else - computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); - #endif - vec3 totalScattering = singleScattering + multiScattering; - vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); - reflectedLight.indirectSpecular += radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,nC=` -vec3 geometryPosition = - vViewPosition; -vec3 geometryNormal = normal; -vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -vec3 geometryClearcoatNormal = vec3( 0.0 ); -#ifdef USE_CLEARCOAT - geometryClearcoatNormal = clearcoatNormal; -#endif -#ifdef USE_IRIDESCENCE - float dotNVi = saturate( dot( normal, geometryViewDir ) ); - if ( material.iridescenceThickness == 0.0 ) { - material.iridescence = 0.0; - } else { - material.iridescence = saturate( material.iridescence ); - } - if ( material.iridescence > 0.0 ) { - material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); - material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); - } -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointLightInfo( pointLight, geometryPosition, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - vec4 spotColor; - vec3 spotLightCoord; - bool inSpotLightMap; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotLightInfo( spotLight, geometryPosition, directLight ); - #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX - #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS - #else - #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #endif - #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) - spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; - inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); - spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); - directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; - #endif - #undef SPOT_LIGHT_MAP_INDEX - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalLightInfo( directionalLight, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - #if defined( USE_LIGHT_PROBES ) - irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); - #endif - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,iC=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getIBLIrradiance( geometryNormal ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - #ifdef USE_ANISOTROPY - radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); - #else - radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); - #endif - #ifdef USE_CLEARCOAT - clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); - #endif -#endif`,rC=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif`,oC=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,sC=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,aC=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,lC=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); - #else - if ( isPerspectiveMatrix( projectionMatrix ) ) { - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - gl_Position.z *= gl_Position.w; - } - #endif -#endif`,uC=`#ifdef USE_MAP - vec4 sampledDiffuseColor = texture2D( map, vMapUv ); - #ifdef DECODE_VIDEO_TEXTURE - sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); - - #endif - diffuseColor *= sampledDiffuseColor; -#endif`,cC=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,dC=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - #if defined( USE_POINTS_UV ) - vec2 uv = vUv; - #else - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; - #endif -#endif -#ifdef USE_MAP - diffuseColor *= texture2D( map, uv ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,fC=`#if defined( USE_POINTS_UV ) - varying vec2 vUv; -#else - #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; - #endif -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,hC=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); - metalnessFactor *= texelMetalness.b; -#endif`,pC=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,mC=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) - vColor *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - #if defined( USE_COLOR_ALPHA ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; - #elif defined( USE_COLOR ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; - #endif - } -#endif`,gC=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - #ifdef MORPHTARGETS_TEXTURE - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; - } - #else - objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; - objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; - objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; - objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; - #endif -#endif`,vC=`#ifdef USE_MORPHTARGETS - uniform float morphTargetBaseInfluence; - #ifdef MORPHTARGETS_TEXTURE - uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; - uniform sampler2DArray morphTargetsTexture; - uniform ivec2 morphTargetsTextureSize; - vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { - int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; - int y = texelIndex / morphTargetsTextureSize.x; - int x = texelIndex - y * morphTargetsTextureSize.x; - ivec3 morphUV = ivec3( x, y, morphTargetIndex ); - return texelFetch( morphTargetsTexture, morphUV, 0 ); - } - #else - #ifndef USE_MORPHNORMALS - uniform float morphTargetInfluences[ 8 ]; - #else - uniform float morphTargetInfluences[ 4 ]; - #endif - #endif -#endif`,_C=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - #ifdef MORPHTARGETS_TEXTURE - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; - } - #else - transformed += morphTarget0 * morphTargetInfluences[ 0 ]; - transformed += morphTarget1 * morphTargetInfluences[ 1 ]; - transformed += morphTarget2 * morphTargetInfluences[ 2 ]; - transformed += morphTarget3 * morphTargetInfluences[ 3 ]; - #ifndef USE_MORPHNORMALS - transformed += morphTarget4 * morphTargetInfluences[ 4 ]; - transformed += morphTarget5 * morphTargetInfluences[ 5 ]; - transformed += morphTarget6 * morphTargetInfluences[ 6 ]; - transformed += morphTarget7 * morphTargetInfluences[ 7 ]; - #endif - #endif -#endif`,yC=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = dFdx( vViewPosition ); - vec3 fdy = dFdy( vViewPosition ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal *= faceDirection; - #endif -#endif -#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) - #ifdef USE_TANGENT - mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - #else - mat3 tbn = getTangentFrame( - vViewPosition, normal, - #if defined( USE_NORMALMAP ) - vNormalMapUv - #elif defined( USE_CLEARCOAT_NORMALMAP ) - vClearcoatNormalMapUv - #else - vUv - #endif - ); - #endif - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - tbn[0] *= faceDirection; - tbn[1] *= faceDirection; - #endif -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - #ifdef USE_TANGENT - mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - #else - mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); - #endif - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - tbn2[0] *= faceDirection; - tbn2[1] *= faceDirection; - #endif -#endif -vec3 nonPerturbedNormal = normal;`,xC=`#ifdef USE_NORMALMAP_OBJECTSPACE - normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( USE_NORMALMAP_TANGENTSPACE ) - vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - normal = normalize( tbn * mapN ); -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,SC=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,EC=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,wC=`#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif`,MC=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef USE_NORMALMAP_OBJECTSPACE - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) - mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { - vec3 q0 = dFdx( eye_pos.xyz ); - vec3 q1 = dFdy( eye_pos.xyz ); - vec2 st0 = dFdx( uv.st ); - vec2 st1 = dFdy( uv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); - return mat3( T * scale, B * scale, N ); - } -#endif`,TC=`#ifdef USE_CLEARCOAT - vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,CC=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,AC=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif`,bC=`#ifdef USE_IRIDESCENCEMAP - uniform sampler2D iridescenceMap; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform sampler2D iridescenceThicknessMap; -#endif`,RC=`#ifdef OPAQUE -diffuseColor.a = 1.0; -#endif -#ifdef USE_TRANSMISSION -diffuseColor.a *= material.transmissionAlpha; -#endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,PC=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; -const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); -const float ShiftRight8 = 1. / 256.; -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} -vec2 packDepthToRG( in highp float v ) { - return packDepthToRGBA( v ).yx; -} -float unpackRGToDepth( const in highp vec2 v ) { - return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); -} -vec4 pack2HalfToRGBA( vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); -} -vec2 unpackRGBATo2Half( vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { - return depth * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * depth - far ); -}`,LC=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,NC=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_BATCHING - mvPosition = batchingMatrix * mvPosition; -#endif -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,DC=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,IC=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,UC=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); - roughnessFactor *= texelRoughness.g; -#endif`,FC=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,OC=`#if NUM_SPOT_LIGHT_COORDS > 0 - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#if NUM_SPOT_LIGHT_MAPS > 0 - uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; - bool frustumTest = inFrustum && shadowCoord.z <= 1.0; - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return shadow; - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - vec3 lightToPosition = shadowCoord.xyz; - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } -#endif`,kC=`#if NUM_SPOT_LIGHT_COORDS > 0 - uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,BC=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; -#endif -#if defined( USE_SHADOWMAP ) - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif -#if NUM_SPOT_LIGHT_COORDS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { - shadowWorldPosition = worldPosition; - #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; - #endif - vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end -#endif`,zC=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,VC=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,HC=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - uniform highp sampler2D boneTexture; - mat4 getBoneMatrix( const in float i ) { - int size = textureSize( boneTexture, 0 ).x; - int j = int( i ) * 4; - int x = j % size; - int y = j / size; - vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); - vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); - vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); - vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); - return mat4( v1, v2, v3, v4 ); - } -#endif`,GC=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,WC=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,jC=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,$C=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,XC=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,YC=`#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return saturate( toneMappingExposure * color ); -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 OptimizedCineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( - vec3( 1.6605, - 0.1246, - 0.0182 ), - vec3( - 0.5876, 1.1329, - 0.1006 ), - vec3( - 0.0728, - 0.0083, 1.1187 ) -); -const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( - vec3( 0.6274, 0.0691, 0.0164 ), - vec3( 0.3293, 0.9195, 0.0880 ), - vec3( 0.0433, 0.0113, 0.8956 ) -); -vec3 agxDefaultContrastApprox( vec3 x ) { - vec3 x2 = x * x; - vec3 x4 = x2 * x2; - return + 15.5 * x4 * x2 - - 40.14 * x4 * x - + 31.96 * x4 - - 6.868 * x2 * x - + 0.4298 * x2 - + 0.1191 * x - - 0.00232; -} -vec3 AgXToneMapping( vec3 color ) { - const mat3 AgXInsetMatrix = mat3( - vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), - vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), - vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) - ); - const mat3 AgXOutsetMatrix = mat3( - vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), - vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), - vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) - ); - const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; - color *= toneMappingExposure; - color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; - color = AgXInsetMatrix * color; - color = max( color, 1e-10 ); color = log2( color ); - color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); - color = clamp( color, 0.0, 1.0 ); - color = agxDefaultContrastApprox( color ); - color = AgXOutsetMatrix * color; - color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); - color = LINEAR_REC2020_TO_LINEAR_SRGB * color; - color = clamp( color, 0.0, 1.0 ); - return color; -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,qC=`#ifdef USE_TRANSMISSION - material.transmission = transmission; - material.transmissionAlpha = 1.0; - material.thickness = thickness; - material.attenuationDistance = attenuationDistance; - material.attenuationColor = attenuationColor; - #ifdef USE_TRANSMISSIONMAP - material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; - #endif - #ifdef USE_THICKNESSMAP - material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; - #endif - vec3 pos = vWorldPosition; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - vec4 transmitted = getIBLVolumeRefraction( - n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, - pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness, - material.attenuationColor, material.attenuationDistance ); - material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); - totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,KC=`#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationColor; - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec3 vWorldPosition; - float w0( float a ) { - return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); - } - float w1( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); - } - float w2( float a ){ - return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); - } - float w3( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * a ); - } - float g0( float a ) { - return w0( a ) + w1( a ); - } - float g1( float a ) { - return w2( a ) + w3( a ); - } - float h0( float a ) { - return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); - } - float h1( float a ) { - return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); - } - vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { - uv = uv * texelSize.zw + 0.5; - vec2 iuv = floor( uv ); - vec2 fuv = fract( uv ); - float g0x = g0( fuv.x ); - float g1x = g1( fuv.x ); - float h0x = h0( fuv.x ); - float h1x = h1( fuv.x ); - float h0y = h0( fuv.y ); - float h1y = h1( fuv.y ); - vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + - g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); - } - vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { - vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); - vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); - vec2 fLodSizeInv = 1.0 / fLodSize; - vec2 cLodSizeInv = 1.0 / cLodSize; - vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); - vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); - return mix( fSample, cSample, fract( lod ) ); - } - vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { - vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - return normalize( refractionVector ) * thickness * modelScale; - } - float applyIorToRoughness( const in float roughness, const in float ior ) { - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } - vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { - float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); - } - vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { - if ( isinf( attenuationDistance ) ) { - return vec3( 1.0 ); - } else { - vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; - vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; - } - } - vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, - const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, - const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness, - const in vec3 attenuationColor, const in float attenuationDistance ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); - vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); - vec3 attenuatedColor = transmittance * transmittedLight.rgb; - vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); - float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; - return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); - } -#endif`,ZC=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - varying vec2 vUv; -#endif -#ifdef USE_MAP - varying vec2 vMapUv; -#endif -#ifdef USE_ALPHAMAP - varying vec2 vAlphaMapUv; -#endif -#ifdef USE_LIGHTMAP - varying vec2 vLightMapUv; -#endif -#ifdef USE_AOMAP - varying vec2 vAoMapUv; -#endif -#ifdef USE_BUMPMAP - varying vec2 vBumpMapUv; -#endif -#ifdef USE_NORMALMAP - varying vec2 vNormalMapUv; -#endif -#ifdef USE_EMISSIVEMAP - varying vec2 vEmissiveMapUv; -#endif -#ifdef USE_METALNESSMAP - varying vec2 vMetalnessMapUv; -#endif -#ifdef USE_ROUGHNESSMAP - varying vec2 vRoughnessMapUv; -#endif -#ifdef USE_ANISOTROPYMAP - varying vec2 vAnisotropyMapUv; -#endif -#ifdef USE_CLEARCOATMAP - varying vec2 vClearcoatMapUv; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - varying vec2 vClearcoatNormalMapUv; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - varying vec2 vClearcoatRoughnessMapUv; -#endif -#ifdef USE_IRIDESCENCEMAP - varying vec2 vIridescenceMapUv; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - varying vec2 vIridescenceThicknessMapUv; -#endif -#ifdef USE_SHEEN_COLORMAP - varying vec2 vSheenColorMapUv; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - varying vec2 vSheenRoughnessMapUv; -#endif -#ifdef USE_SPECULARMAP - varying vec2 vSpecularMapUv; -#endif -#ifdef USE_SPECULAR_COLORMAP - varying vec2 vSpecularColorMapUv; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - varying vec2 vSpecularIntensityMapUv; -#endif -#ifdef USE_TRANSMISSIONMAP - uniform mat3 transmissionMapTransform; - varying vec2 vTransmissionMapUv; -#endif -#ifdef USE_THICKNESSMAP - uniform mat3 thicknessMapTransform; - varying vec2 vThicknessMapUv; -#endif`,JC=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - varying vec2 vUv; -#endif -#ifdef USE_MAP - uniform mat3 mapTransform; - varying vec2 vMapUv; -#endif -#ifdef USE_ALPHAMAP - uniform mat3 alphaMapTransform; - varying vec2 vAlphaMapUv; -#endif -#ifdef USE_LIGHTMAP - uniform mat3 lightMapTransform; - varying vec2 vLightMapUv; -#endif -#ifdef USE_AOMAP - uniform mat3 aoMapTransform; - varying vec2 vAoMapUv; -#endif -#ifdef USE_BUMPMAP - uniform mat3 bumpMapTransform; - varying vec2 vBumpMapUv; -#endif -#ifdef USE_NORMALMAP - uniform mat3 normalMapTransform; - varying vec2 vNormalMapUv; -#endif -#ifdef USE_DISPLACEMENTMAP - uniform mat3 displacementMapTransform; - varying vec2 vDisplacementMapUv; -#endif -#ifdef USE_EMISSIVEMAP - uniform mat3 emissiveMapTransform; - varying vec2 vEmissiveMapUv; -#endif -#ifdef USE_METALNESSMAP - uniform mat3 metalnessMapTransform; - varying vec2 vMetalnessMapUv; -#endif -#ifdef USE_ROUGHNESSMAP - uniform mat3 roughnessMapTransform; - varying vec2 vRoughnessMapUv; -#endif -#ifdef USE_ANISOTROPYMAP - uniform mat3 anisotropyMapTransform; - varying vec2 vAnisotropyMapUv; -#endif -#ifdef USE_CLEARCOATMAP - uniform mat3 clearcoatMapTransform; - varying vec2 vClearcoatMapUv; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform mat3 clearcoatNormalMapTransform; - varying vec2 vClearcoatNormalMapUv; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform mat3 clearcoatRoughnessMapTransform; - varying vec2 vClearcoatRoughnessMapUv; -#endif -#ifdef USE_SHEEN_COLORMAP - uniform mat3 sheenColorMapTransform; - varying vec2 vSheenColorMapUv; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - uniform mat3 sheenRoughnessMapTransform; - varying vec2 vSheenRoughnessMapUv; -#endif -#ifdef USE_IRIDESCENCEMAP - uniform mat3 iridescenceMapTransform; - varying vec2 vIridescenceMapUv; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform mat3 iridescenceThicknessMapTransform; - varying vec2 vIridescenceThicknessMapUv; -#endif -#ifdef USE_SPECULARMAP - uniform mat3 specularMapTransform; - varying vec2 vSpecularMapUv; -#endif -#ifdef USE_SPECULAR_COLORMAP - uniform mat3 specularColorMapTransform; - varying vec2 vSpecularColorMapUv; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - uniform mat3 specularIntensityMapTransform; - varying vec2 vSpecularIntensityMapUv; -#endif -#ifdef USE_TRANSMISSIONMAP - uniform mat3 transmissionMapTransform; - varying vec2 vTransmissionMapUv; -#endif -#ifdef USE_THICKNESSMAP - uniform mat3 thicknessMapTransform; - varying vec2 vThicknessMapUv; -#endif`,QC=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - vUv = vec3( uv, 1 ).xy; -#endif -#ifdef USE_MAP - vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ALPHAMAP - vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_LIGHTMAP - vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_AOMAP - vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_BUMPMAP - vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_NORMALMAP - vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_DISPLACEMENTMAP - vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_EMISSIVEMAP - vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_METALNESSMAP - vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ROUGHNESSMAP - vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ANISOTROPYMAP - vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOATMAP - vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_IRIDESCENCEMAP - vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SHEEN_COLORMAP - vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULARMAP - vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULAR_COLORMAP - vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_TRANSMISSIONMAP - vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_THICKNESSMAP - vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,eA=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_BATCHING - worldPosition = batchingMatrix * worldPosition; - #endif - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`;const tA=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,nA=`uniform sampler2D t2D; -uniform float backgroundIntensity; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - #ifdef DECODE_VIDEO_TEXTURE - texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,iA=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,rA=`#ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; -#elif defined( ENVMAP_TYPE_CUBE_UV ) - uniform sampler2D envMap; -#endif -uniform float flipEnvMap; -uniform float backgroundBlurriness; -uniform float backgroundIntensity; -varying vec3 vWorldDirection; -#include -void main() { - #ifdef ENVMAP_TYPE_CUBE - vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness ); - #else - vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,oA=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,sA=`uniform samplerCube tCube; -uniform float tFlip; -uniform float opacity; -varying vec3 vWorldDirection; -void main() { - vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); - gl_FragColor = texColor; - gl_FragColor.a *= opacity; - #include - #include -}`,aA=`#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,lA=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - vec4 diffuseColor = vec4( 1.0 ); - #include - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #endif -}`,uA=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,cA=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -#include -void main () { - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,dA=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,fA=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - gl_FragColor = texture2D( tEquirect, sampleUV ); - #include - #include -}`,hA=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,pA=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,mA=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,gA=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - #include - #include - #include - #include - #include - #include -}`,vA=`#define LAMBERT -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,_A=`#define LAMBERT -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,yA=`#define MATCAP -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,xA=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - #else - vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - #include - #include - #include - #include - #include - #include -}`,SA=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - vViewPosition = - mvPosition.xyz; -#endif -}`,EA=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); - #ifdef OPAQUE - gl_FragColor.a = 1.0; - #endif -}`,wA=`#define PHONG -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,MA=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,TA=`#define STANDARD -varying vec3 vViewPosition; -#ifdef USE_TRANSMISSION - varying vec3 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition.xyz; -#endif -}`,CA=`#define STANDARD -#ifdef PHYSICAL - #define IOR - #define USE_SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef IOR - uniform float ior; -#endif -#ifdef USE_SPECULAR - uniform float specularIntensity; - uniform vec3 specularColor; - #ifdef USE_SPECULAR_COLORMAP - uniform sampler2D specularColorMap; - #endif - #ifdef USE_SPECULAR_INTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif -#endif -#ifdef USE_CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_IRIDESCENCE - uniform float iridescence; - uniform float iridescenceIOR; - uniform float iridescenceThicknessMinimum; - uniform float iridescenceThicknessMaximum; -#endif -#ifdef USE_SHEEN - uniform vec3 sheenColor; - uniform float sheenRoughness; - #ifdef USE_SHEEN_COLORMAP - uniform sampler2D sheenColorMap; - #endif - #ifdef USE_SHEEN_ROUGHNESSMAP - uniform sampler2D sheenRoughnessMap; - #endif -#endif -#ifdef USE_ANISOTROPY - uniform vec2 anisotropyVector; - #ifdef USE_ANISOTROPYMAP - uniform sampler2D anisotropyMap; - #endif -#endif -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - #ifdef USE_SHEEN - float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); - outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; - #endif - #ifdef USE_CLEARCOAT - float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); - vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); - outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; - #endif - #include - #include - #include - #include - #include - #include -}`,AA=`#define TOON -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,bA=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include -}`,RA=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -#ifdef USE_POINTS_UV - varying vec2 vUv; - uniform mat3 uvTransform; -#endif -void main() { - #ifdef USE_POINTS_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - #endif - #include - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,PA=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,LA=`#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,NA=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,DA=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,IA=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include -}`,We={alphahash_fragment:nT,alphahash_pars_fragment:iT,alphamap_fragment:rT,alphamap_pars_fragment:oT,alphatest_fragment:sT,alphatest_pars_fragment:aT,aomap_fragment:lT,aomap_pars_fragment:uT,batching_pars_vertex:cT,batching_vertex:dT,begin_vertex:fT,beginnormal_vertex:hT,bsdfs:pT,iridescence_fragment:mT,bumpmap_pars_fragment:gT,clipping_planes_fragment:vT,clipping_planes_pars_fragment:_T,clipping_planes_pars_vertex:yT,clipping_planes_vertex:xT,color_fragment:ST,color_pars_fragment:ET,color_pars_vertex:wT,color_vertex:MT,common:TT,cube_uv_reflection_fragment:CT,defaultnormal_vertex:AT,displacementmap_pars_vertex:bT,displacementmap_vertex:RT,emissivemap_fragment:PT,emissivemap_pars_fragment:LT,colorspace_fragment:NT,colorspace_pars_fragment:DT,envmap_fragment:IT,envmap_common_pars_fragment:UT,envmap_pars_fragment:FT,envmap_pars_vertex:OT,envmap_physical_pars_fragment:qT,envmap_vertex:kT,fog_vertex:BT,fog_pars_vertex:zT,fog_fragment:VT,fog_pars_fragment:HT,gradientmap_pars_fragment:GT,lightmap_fragment:WT,lightmap_pars_fragment:jT,lights_lambert_fragment:$T,lights_lambert_pars_fragment:XT,lights_pars_begin:YT,lights_toon_fragment:KT,lights_toon_pars_fragment:ZT,lights_phong_fragment:JT,lights_phong_pars_fragment:QT,lights_physical_fragment:eC,lights_physical_pars_fragment:tC,lights_fragment_begin:nC,lights_fragment_maps:iC,lights_fragment_end:rC,logdepthbuf_fragment:oC,logdepthbuf_pars_fragment:sC,logdepthbuf_pars_vertex:aC,logdepthbuf_vertex:lC,map_fragment:uC,map_pars_fragment:cC,map_particle_fragment:dC,map_particle_pars_fragment:fC,metalnessmap_fragment:hC,metalnessmap_pars_fragment:pC,morphcolor_vertex:mC,morphnormal_vertex:gC,morphtarget_pars_vertex:vC,morphtarget_vertex:_C,normal_fragment_begin:yC,normal_fragment_maps:xC,normal_pars_fragment:SC,normal_pars_vertex:EC,normal_vertex:wC,normalmap_pars_fragment:MC,clearcoat_normal_fragment_begin:TC,clearcoat_normal_fragment_maps:CC,clearcoat_pars_fragment:AC,iridescence_pars_fragment:bC,opaque_fragment:RC,packing:PC,premultiplied_alpha_fragment:LC,project_vertex:NC,dithering_fragment:DC,dithering_pars_fragment:IC,roughnessmap_fragment:UC,roughnessmap_pars_fragment:FC,shadowmap_pars_fragment:OC,shadowmap_pars_vertex:kC,shadowmap_vertex:BC,shadowmask_pars_fragment:zC,skinbase_vertex:VC,skinning_pars_vertex:HC,skinning_vertex:GC,skinnormal_vertex:WC,specularmap_fragment:jC,specularmap_pars_fragment:$C,tonemapping_fragment:XC,tonemapping_pars_fragment:YC,transmission_fragment:qC,transmission_pars_fragment:KC,uv_pars_fragment:ZC,uv_pars_vertex:JC,uv_vertex:QC,worldpos_vertex:eA,background_vert:tA,background_frag:nA,backgroundCube_vert:iA,backgroundCube_frag:rA,cube_vert:oA,cube_frag:sA,depth_vert:aA,depth_frag:lA,distanceRGBA_vert:uA,distanceRGBA_frag:cA,equirect_vert:dA,equirect_frag:fA,linedashed_vert:hA,linedashed_frag:pA,meshbasic_vert:mA,meshbasic_frag:gA,meshlambert_vert:vA,meshlambert_frag:_A,meshmatcap_vert:yA,meshmatcap_frag:xA,meshnormal_vert:SA,meshnormal_frag:EA,meshphong_vert:wA,meshphong_frag:MA,meshphysical_vert:TA,meshphysical_frag:CA,meshtoon_vert:AA,meshtoon_frag:bA,points_vert:RA,points_frag:PA,shadow_vert:LA,shadow_frag:NA,sprite_vert:DA,sprite_frag:IA},ce={common:{diffuse:{value:new Ze(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Xe},alphaMap:{value:null},alphaMapTransform:{value:new Xe},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Xe}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Xe}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Xe}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Xe},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Xe},normalScale:{value:new Ye(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Xe},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Xe}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Xe}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Xe}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ze(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ze(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Xe},alphaTest:{value:0},uvTransform:{value:new Xe}},sprite:{diffuse:{value:new Ze(16777215)},opacity:{value:1},center:{value:new Ye(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Xe},alphaMap:{value:null},alphaMapTransform:{value:new Xe},alphaTest:{value:0}}},Qn={basic:{uniforms:Zt([ce.common,ce.specularmap,ce.envmap,ce.aomap,ce.lightmap,ce.fog]),vertexShader:We.meshbasic_vert,fragmentShader:We.meshbasic_frag},lambert:{uniforms:Zt([ce.common,ce.specularmap,ce.envmap,ce.aomap,ce.lightmap,ce.emissivemap,ce.bumpmap,ce.normalmap,ce.displacementmap,ce.fog,ce.lights,{emissive:{value:new Ze(0)}}]),vertexShader:We.meshlambert_vert,fragmentShader:We.meshlambert_frag},phong:{uniforms:Zt([ce.common,ce.specularmap,ce.envmap,ce.aomap,ce.lightmap,ce.emissivemap,ce.bumpmap,ce.normalmap,ce.displacementmap,ce.fog,ce.lights,{emissive:{value:new Ze(0)},specular:{value:new Ze(1118481)},shininess:{value:30}}]),vertexShader:We.meshphong_vert,fragmentShader:We.meshphong_frag},standard:{uniforms:Zt([ce.common,ce.envmap,ce.aomap,ce.lightmap,ce.emissivemap,ce.bumpmap,ce.normalmap,ce.displacementmap,ce.roughnessmap,ce.metalnessmap,ce.fog,ce.lights,{emissive:{value:new Ze(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:We.meshphysical_vert,fragmentShader:We.meshphysical_frag},toon:{uniforms:Zt([ce.common,ce.aomap,ce.lightmap,ce.emissivemap,ce.bumpmap,ce.normalmap,ce.displacementmap,ce.gradientmap,ce.fog,ce.lights,{emissive:{value:new Ze(0)}}]),vertexShader:We.meshtoon_vert,fragmentShader:We.meshtoon_frag},matcap:{uniforms:Zt([ce.common,ce.bumpmap,ce.normalmap,ce.displacementmap,ce.fog,{matcap:{value:null}}]),vertexShader:We.meshmatcap_vert,fragmentShader:We.meshmatcap_frag},points:{uniforms:Zt([ce.points,ce.fog]),vertexShader:We.points_vert,fragmentShader:We.points_frag},dashed:{uniforms:Zt([ce.common,ce.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:We.linedashed_vert,fragmentShader:We.linedashed_frag},depth:{uniforms:Zt([ce.common,ce.displacementmap]),vertexShader:We.depth_vert,fragmentShader:We.depth_frag},normal:{uniforms:Zt([ce.common,ce.bumpmap,ce.normalmap,ce.displacementmap,{opacity:{value:1}}]),vertexShader:We.meshnormal_vert,fragmentShader:We.meshnormal_frag},sprite:{uniforms:Zt([ce.sprite,ce.fog]),vertexShader:We.sprite_vert,fragmentShader:We.sprite_frag},background:{uniforms:{uvTransform:{value:new Xe},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:We.background_vert,fragmentShader:We.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:We.backgroundCube_vert,fragmentShader:We.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:We.cube_vert,fragmentShader:We.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:We.equirect_vert,fragmentShader:We.equirect_frag},distanceRGBA:{uniforms:Zt([ce.common,ce.displacementmap,{referencePosition:{value:new V},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:We.distanceRGBA_vert,fragmentShader:We.distanceRGBA_frag},shadow:{uniforms:Zt([ce.lights,ce.fog,{color:{value:new Ze(0)},opacity:{value:1}}]),vertexShader:We.shadow_vert,fragmentShader:We.shadow_frag}};Qn.physical={uniforms:Zt([Qn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Xe},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Xe},clearcoatNormalScale:{value:new Ye(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Xe},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Xe},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Xe},sheen:{value:0},sheenColor:{value:new Ze(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Xe},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Xe},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Xe},transmissionSamplerSize:{value:new Ye},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Xe},attenuationDistance:{value:0},attenuationColor:{value:new Ze(0)},specularColor:{value:new Ze(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Xe},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Xe},anisotropyVector:{value:new Ye},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Xe}}]),vertexShader:We.meshphysical_vert,fragmentShader:We.meshphysical_frag};const ll={r:0,b:0,g:0};function UA(t,e,n,i,r,o,s){const a=new Ze(0);let l=o===!0?0:1,u,c,d=null,h=0,g=null;function _(p,f){let m=!1,v=f.isScene===!0?f.background:null;v&&v.isTexture&&(v=(f.backgroundBlurriness>0?n:e).get(v)),v===null?S(a,l):v&&v.isColor&&(S(v,1),m=!0);const E=t.xr.getEnvironmentBlendMode();E==="additive"?i.buffers.color.setClear(0,0,0,1,s):E==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,s),(t.autoClear||m)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),v&&(v.isCubeTexture||v.mapping===Iu)?(c===void 0&&(c=new ni(new va(1,1,1),new or({name:"BackgroundCubeMaterial",uniforms:Yo(Qn.backgroundCube.uniforms),vertexShader:Qn.backgroundCube.vertexShader,fragmentShader:Qn.backgroundCube.fragmentShader,side:pn,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(M,w,T){this.matrixWorld.copyPosition(T.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(c)),c.material.uniforms.envMap.value=v,c.material.uniforms.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,c.material.uniforms.backgroundBlurriness.value=f.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=f.backgroundIntensity,c.material.toneMapped=ot.getTransfer(v.colorSpace)!==ut,(d!==v||h!==v.version||g!==t.toneMapping)&&(c.material.needsUpdate=!0,d=v,h=v.version,g=t.toneMapping),c.layers.enableAll(),p.unshift(c,c.geometry,c.material,0,0,null)):v&&v.isTexture&&(u===void 0&&(u=new ni(new ku(2,2),new or({name:"BackgroundMaterial",uniforms:Yo(Qn.background.uniforms),vertexShader:Qn.background.vertexShader,fragmentShader:Qn.background.fragmentShader,side:rr,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(u)),u.material.uniforms.t2D.value=v,u.material.uniforms.backgroundIntensity.value=f.backgroundIntensity,u.material.toneMapped=ot.getTransfer(v.colorSpace)!==ut,v.matrixAutoUpdate===!0&&v.updateMatrix(),u.material.uniforms.uvTransform.value.copy(v.matrix),(d!==v||h!==v.version||g!==t.toneMapping)&&(u.material.needsUpdate=!0,d=v,h=v.version,g=t.toneMapping),u.layers.enableAll(),p.unshift(u,u.geometry,u.material,0,0,null))}function S(p,f){p.getRGB(ll,Iy(t)),i.buffers.color.setClear(ll.r,ll.g,ll.b,f,s)}return{getClearColor:function(){return a},setClearColor:function(p,f=1){a.set(p),l=f,S(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(p){l=p,S(a,l)},render:_}}function FA(t,e,n,i){const r=t.getParameter(t.MAX_VERTEX_ATTRIBS),o=i.isWebGL2?null:e.get("OES_vertex_array_object"),s=i.isWebGL2||o!==null,a={},l=p(null);let u=l,c=!1;function d(D,G,F,Z,U){let O=!1;if(s){const H=S(Z,F,G);u!==H&&(u=H,g(u.object)),O=f(D,Z,F,U),O&&m(D,Z,F,U)}else{const H=G.wireframe===!0;(u.geometry!==Z.id||u.program!==F.id||u.wireframe!==H)&&(u.geometry=Z.id,u.program=F.id,u.wireframe=H,O=!0)}U!==null&&n.update(U,t.ELEMENT_ARRAY_BUFFER),(O||c)&&(c=!1,L(D,G,F,Z),U!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n.get(U).buffer))}function h(){return i.isWebGL2?t.createVertexArray():o.createVertexArrayOES()}function g(D){return i.isWebGL2?t.bindVertexArray(D):o.bindVertexArrayOES(D)}function _(D){return i.isWebGL2?t.deleteVertexArray(D):o.deleteVertexArrayOES(D)}function S(D,G,F){const Z=F.wireframe===!0;let U=a[D.id];U===void 0&&(U={},a[D.id]=U);let O=U[G.id];O===void 0&&(O={},U[G.id]=O);let H=O[Z];return H===void 0&&(H=p(h()),O[Z]=H),H}function p(D){const G=[],F=[],Z=[];for(let U=0;U=0){const j=U[Q];let K=O[Q];if(K===void 0&&(Q==="instanceMatrix"&&D.instanceMatrix&&(K=D.instanceMatrix),Q==="instanceColor"&&D.instanceColor&&(K=D.instanceColor)),j===void 0||j.attribute!==K||K&&j.data!==K.data)return!0;H++}return u.attributesNum!==H||u.index!==Z}function m(D,G,F,Z){const U={},O=G.attributes;let H=0;const X=F.getAttributes();for(const Q in X)if(X[Q].location>=0){let j=O[Q];j===void 0&&(Q==="instanceMatrix"&&D.instanceMatrix&&(j=D.instanceMatrix),Q==="instanceColor"&&D.instanceColor&&(j=D.instanceColor));const K={};K.attribute=j,j&&j.data&&(K.data=j.data),U[Q]=K,H++}u.attributes=U,u.attributesNum=H,u.index=Z}function v(){const D=u.newAttributes;for(let G=0,F=D.length;G=0){let ge=U[X];if(ge===void 0&&(X==="instanceMatrix"&&D.instanceMatrix&&(ge=D.instanceMatrix),X==="instanceColor"&&D.instanceColor&&(ge=D.instanceColor)),ge!==void 0){const j=ge.normalized,K=ge.itemSize,ne=n.get(ge);if(ne===void 0)continue;const de=ne.buffer,ye=ne.type,ve=ne.bytesPerElement,ze=i.isWebGL2===!0&&(ye===t.INT||ye===t.UNSIGNED_INT||ge.gpuType===py);if(ge.isInterleavedBufferAttribute){const be=ge.data,I=be.stride,nt=ge.offset;if(be.isInstancedInterleavedBuffer){for(let _e=0;_e0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const s=typeof WebGL2RenderingContext<"u"&&t.constructor.name==="WebGL2RenderingContext";let a=n.precision!==void 0?n.precision:"highp";const l=o(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const u=s||e.has("WEBGL_draw_buffers"),c=n.logarithmicDepthBuffer===!0,d=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),h=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),g=t.getParameter(t.MAX_TEXTURE_SIZE),_=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),S=t.getParameter(t.MAX_VERTEX_ATTRIBS),p=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),f=t.getParameter(t.MAX_VARYING_VECTORS),m=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),v=h>0,E=s||e.has("OES_texture_float"),M=v&&E,w=s?t.getParameter(t.MAX_SAMPLES):0;return{isWebGL2:s,drawBuffers:u,getMaxAnisotropy:r,getMaxPrecision:o,precision:a,logarithmicDepthBuffer:c,maxTextures:d,maxVertexTextures:h,maxTextureSize:g,maxCubemapSize:_,maxAttributes:S,maxVertexUniforms:p,maxVaryings:f,maxFragmentUniforms:m,vertexTextures:v,floatFragmentTextures:E,floatVertexTextures:M,maxSamples:w}}function BA(t){const e=this;let n=null,i=0,r=!1,o=!1;const s=new Sr,a=new Xe,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,h){const g=d.length!==0||h||i!==0||r;return r=h,i=d.length,g},this.beginShadows=function(){o=!0,c(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(d,h){n=c(d,h,0)},this.setState=function(d,h,g){const _=d.clippingPlanes,S=d.clipIntersection,p=d.clipShadows,f=t.get(d);if(!r||_===null||_.length===0||o&&!p)o?c(null):u();else{const m=o?0:i,v=m*4;let E=f.clippingState||null;l.value=E,E=c(_,h,v,g);for(let M=0;M!==v;++M)E[M]=n[M];f.clippingState=E,this.numIntersection=S?this.numPlanes:0,this.numPlanes+=m}};function u(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function c(d,h,g,_){const S=d!==null?d.length:0;let p=null;if(S!==0){if(p=l.value,_!==!0||p===null){const f=g+S*4,m=h.matrixWorldInverse;a.getNormalMatrix(m),(p===null||p.length0){const u=new J1(l.height);return u.fromEquirectangularTexture(t,s),e.set(s,u),s.addEventListener("dispose",r),n(u.texture,s.mapping)}else return null}}return s}function r(s){const a=s.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function o(){e=new WeakMap}return{get:i,dispose:o}}class VA extends Uy{constructor(e=-1,n=1,i=1,r=-1,o=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=i,this.bottom=r,this.near=o,this.far=s,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,i,r,o,s){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=r,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let o=i-e,s=i+e,a=r+n,l=r-n;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=u*this.view.offsetX,s=o+u*this.view.width,a-=c*this.view.offsetY,l=a-c*this.view.height}this.projectionMatrix.makeOrthographic(o,s,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}const Co=4,Fg=[.125,.215,.35,.446,.526,.582],Tr=20,Jc=new VA,Og=new Ze;let Qc=null,ed=0,td=0;const Er=(1+Math.sqrt(5))/2,co=1/Er,kg=[new V(1,1,1),new V(-1,1,1),new V(1,1,-1),new V(-1,1,-1),new V(0,Er,co),new V(0,Er,-co),new V(co,0,Er),new V(-co,0,Er),new V(Er,co,0),new V(-Er,co,0)];class Bg{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,n=0,i=.1,r=100){Qc=this._renderer.getRenderTarget(),ed=this._renderer.getActiveCubeFace(),td=this._renderer.getActiveMipmapLevel(),this._setSize(256);const o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,i,r,o),n>0&&this._blur(o,0,0,n),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Hg(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Vg(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?v:0,v,v),c.setRenderTarget(r),S&&c.render(_,a),c.render(e,a)}_.geometry.dispose(),_.material.dispose(),c.toneMapping=h,c.autoClear=d,e.background=p}_textureToCubeUV(e,n){const i=this._renderer,r=e.mapping===jo||e.mapping===$o;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=Hg()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Vg());const o=r?this._cubemapMaterial:this._equirectMaterial,s=new ni(this._lodPlanes[0],o),a=o.uniforms;a.envMap.value=e;const l=this._cubeSize;ul(n,0,0,3*l,2*l),i.setRenderTarget(n),i.render(s,Jc)}_applyPMREM(e){const n=this._renderer,i=n.autoClear;n.autoClear=!1;for(let r=1;rTr&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${p} samples when the maximum is set to ${Tr}`);const f=[];let m=0;for(let T=0;Tv-Co?r-v+Co:0),w=4*(this._cubeSize-E);ul(n,M,w,3*E,2*E),l.setRenderTarget(n),l.render(d,Jc)}}function HA(t){const e=[],n=[],i=[];let r=t;const o=t-Co+1+Fg.length;for(let s=0;st-Co?l=Fg[s-t+Co-1]:s===0&&(l=0),i.push(l);const u=1/(a-2),c=-u,d=1+u,h=[c,c,d,c,d,d,c,c,d,d,c,d],g=6,_=6,S=3,p=2,f=1,m=new Float32Array(S*_*g),v=new Float32Array(p*_*g),E=new Float32Array(f*_*g);for(let w=0;w2?0:-1,B=[T,L,0,T+2/3,L,0,T+2/3,L+1,0,T,L,0,T+2/3,L+1,0,T,L+1,0];m.set(B,S*_*w),v.set(h,p*_*w);const x=[w,w,w,w,w,w];E.set(x,f*_*w)}const M=new si;M.setAttribute("position",new oi(m,S)),M.setAttribute("uv",new oi(v,p)),M.setAttribute("faceIndex",new oi(E,f)),e.push(M),r>Co&&r--}return{lodPlanes:e,sizeLods:n,sigmas:i}}function zg(t,e,n){const i=new Vr(t,e,n);return i.texture.mapping=Iu,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function ul(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function GA(t,e,n){const i=new Float32Array(Tr),r=new V(0,1,0);return new or({name:"SphericalGaussianBlur",defines:{n:Tr,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:zh(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - } - `,blending:Qi,depthTest:!1,depthWrite:!1})}function Vg(){return new or({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:zh(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - - #include - - void main() { - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); - - } - `,blending:Qi,depthTest:!1,depthWrite:!1})}function Hg(){return new or({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:zh(),fragmentShader:` - - precision mediump float; - precision mediump int; - - uniform float flipEnvMap; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - void main() { - - gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); - - } - `,blending:Qi,depthTest:!1,depthWrite:!1})}function zh(){return` - - precision mediump float; - precision mediump int; - - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function WA(t){let e=new WeakMap,n=null;function i(a){if(a&&a.isTexture){const l=a.mapping,u=l===ff||l===hf,c=l===jo||l===$o;if(u||c)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let d=e.get(a);return n===null&&(n=new Bg(t)),d=u?n.fromEquirectangular(a,d):n.fromCubemap(a,d),e.set(a,d),d.texture}else{if(e.has(a))return e.get(a).texture;{const d=a.image;if(u&&d&&d.height>0||c&&d&&r(d)){n===null&&(n=new Bg(t));const h=u?n.fromEquirectangular(a):n.fromCubemap(a);return e.set(a,h),a.addEventListener("dispose",o),h.texture}else return null}}}return a}function r(a){let l=0;const u=6;for(let c=0;ce.maxTextureSize&&(A=Math.ceil(x/e.maxTextureSize),x=e.maxTextureSize);const k=new Float32Array(x*A*4*S),z=new Ay(k,x,A,S);z.type=_i,z.needsUpdate=!0;const D=B*4;for(let F=0;F0)return t;const r=e*n;let o=Gg[r];if(o===void 0&&(o=new Float32Array(r),Gg[r]=o),e!==0){i.toArray(o,0);for(let s=1,a=0;s!==e;++s)a+=n,t[s].toArray(o,a)}return o}function Pt(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n":" "} ${a}: ${n[s]}`)}return i.join(` -`)}function $b(t){const e=ot.getPrimaries(ot.workingColorSpace),n=ot.getPrimaries(t);let i;switch(e===n?i="":e===cu&&n===uu?i="LinearDisplayP3ToLinearSRGB":e===uu&&n===cu&&(i="LinearSRGBToLinearDisplayP3"),t){case Ai:case Uu:return[i,"LinearTransferOETF"];case Bt:case kh:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[i,"LinearTransferOETF"]}}function Kg(t,e,n){const i=t.getShaderParameter(e,t.COMPILE_STATUS),r=t.getShaderInfoLog(e).trim();if(i&&r==="")return"";const o=/ERROR: 0:(\d+)/.exec(r);if(o){const s=parseInt(o[1]);return n.toUpperCase()+` - -`+r+` - -`+jb(t.getShaderSource(e),s)}else return r}function Xb(t,e){const n=$b(e);return`vec4 ${t}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function Yb(t,e){let n;switch(e){case o1:n="Linear";break;case s1:n="Reinhard";break;case a1:n="OptimizedCineon";break;case l1:n="ACESFilmic";break;case c1:n="AgX";break;case u1:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function qb(t){return[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.normalMapTangentSpace||t.clearcoatNormalMap||t.flatShading||t.alphaToCoverage||t.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Ao).join(` -`)}function Kb(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Ao).join(` -`)}function Zb(t){const e=[];for(const n in t){const i=t[n];i!==!1&&e.push("#define "+n+" "+i)}return e.join(` -`)}function Jb(t,e){const n={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function yf(t){return t.replace(Qb,tR)}const eR=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function tR(t,e){let n=We[e];if(n===void 0){const i=eR.get(e);if(i!==void 0)n=We[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return yf(n)}const nR=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Qg(t){return t.replace(nR,iR)}function iR(t,e,n,i){let r="";for(let o=parseInt(e);o0&&(f+=` -`),m=[g,"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,S].filter(Ao).join(` -`),m.length>0&&(m+=` -`)):(f=[ev(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,S,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(Ao).join(` -`),m=[g,ev(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,S,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+c:"",n.envMap?"#define "+d:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==er?"#define TONE_MAPPING":"",n.toneMapping!==er?We.tonemapping_pars_fragment:"",n.toneMapping!==er?Yb("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",We.colorspace_pars_fragment,Xb("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` -`].filter(Ao).join(` -`)),s=yf(s),s=Zg(s,n),s=Jg(s,n),a=yf(a),a=Zg(a,n),a=Jg(a,n),s=Qg(s),a=Qg(a),n.isWebGL2&&n.isRawShaderMaterial!==!0&&(v=`#version 300 es -`,f=[_,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+f,m=["precision mediump sampler2DArray;","#define varying in",n.glslVersion===gg?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===gg?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+m);const E=v+f+s,M=v+m+a,w=qg(r,r.VERTEX_SHADER,E),T=qg(r,r.FRAGMENT_SHADER,M);r.attachShader(p,w),r.attachShader(p,T),n.index0AttributeName!==void 0?r.bindAttribLocation(p,0,n.index0AttributeName):n.morphTargets===!0&&r.bindAttribLocation(p,0,"position"),r.linkProgram(p);function L(k){if(t.debug.checkShaderErrors){const z=r.getProgramInfoLog(p).trim(),D=r.getShaderInfoLog(w).trim(),G=r.getShaderInfoLog(T).trim();let F=!0,Z=!0;if(r.getProgramParameter(p,r.LINK_STATUS)===!1)if(F=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(r,p,w,T);else{const U=Kg(r,w,"vertex"),O=Kg(r,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(p,r.VALIDATE_STATUS)+` - -Material Name: `+k.name+` -Material Type: `+k.type+` - -Program Info Log: `+z+` -`+U+` -`+O)}else z!==""?console.warn("THREE.WebGLProgram: Program Info Log:",z):(D===""||G==="")&&(Z=!1);Z&&(k.diagnostics={runnable:F,programLog:z,vertexShader:{log:D,prefix:f},fragmentShader:{log:G,prefix:m}})}r.deleteShader(w),r.deleteShader(T),B=new Ll(r,p),x=Jb(r,p)}let B;this.getUniforms=function(){return B===void 0&&L(this),B};let x;this.getAttributes=function(){return x===void 0&&L(this),x};let A=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return A===!1&&(A=r.getProgramParameter(p,Gb)),A},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(p),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=Wb++,this.cacheKey=e,this.usedTimes=1,this.program=p,this.vertexShader=w,this.fragmentShader=T,this}let cR=0;class dR{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(n),o=this._getShaderStage(i),s=this._getShaderCacheForMaterial(e);return s.has(r)===!1&&(s.add(r),r.usedTimes++),s.has(o)===!1&&(s.add(o),o.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const i of n)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let i=n.get(e);return i===void 0&&(i=new Set,n.set(e,i)),i}_getShaderStage(e){const n=this.shaderCache;let i=n.get(e);return i===void 0&&(i=new fR(e),n.set(e,i)),i}}class fR{constructor(e){this.id=cR++,this.code=e,this.usedTimes=0}}function hR(t,e,n,i,r,o,s){const a=new Ry,l=new dR,u=new Set,c=[],d=r.isWebGL2,h=r.logarithmicDepthBuffer,g=r.vertexTextures;let _=r.precision;const S={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function p(x){return u.add(x),x===0?"uv":`uv${x}`}function f(x,A,k,z,D){const G=z.fog,F=D.geometry,Z=x.isMeshStandardMaterial?z.environment:null,U=(x.isMeshStandardMaterial?n:e).get(x.envMap||Z),O=U&&U.mapping===Iu?U.image.height:null,H=S[x.type];x.precision!==null&&(_=r.getMaxPrecision(x.precision),_!==x.precision&&console.warn("THREE.WebGLProgram.getParameters:",x.precision,"not supported, using",_,"instead."));const X=F.morphAttributes.position||F.morphAttributes.normal||F.morphAttributes.color,Q=X!==void 0?X.length:0;let ge=0;F.morphAttributes.position!==void 0&&(ge=1),F.morphAttributes.normal!==void 0&&(ge=2),F.morphAttributes.color!==void 0&&(ge=3);let j,K,ne,de;if(H){const st=Qn[H];j=st.vertexShader,K=st.fragmentShader}else j=x.vertexShader,K=x.fragmentShader,l.update(x),ne=l.getVertexShaderID(x),de=l.getFragmentShaderID(x);const ye=t.getRenderTarget(),ve=D.isInstancedMesh===!0,ze=D.isBatchedMesh===!0,be=!!x.map,I=!!x.matcap,nt=!!U,_e=!!x.aoMap,Ce=!!x.lightMap,xe=!!x.bumpMap,Oe=!!x.normalMap,Me=!!x.displacementMap,P=!!x.emissiveMap,C=!!x.metalnessMap,$=!!x.roughnessMap,ie=x.anisotropy>0,ee=x.clearcoat>0,re=x.iridescence>0,he=x.sheen>0,ue=x.transmission>0,fe=ie&&!!x.anisotropyMap,Se=ee&&!!x.clearcoatMap,Le=ee&&!!x.clearcoatNormalMap,te=ee&&!!x.clearcoatRoughnessMap,Ke=re&&!!x.iridescenceMap,Ie=re&&!!x.iridescenceThicknessMap,Re=he&&!!x.sheenColorMap,Ee=he&&!!x.sheenRoughnessMap,se=!!x.specularMap,ke=!!x.specularColorMap,Qe=!!x.specularIntensityMap,et=ue&&!!x.transmissionMap,Ve=ue&&!!x.thicknessMap,it=!!x.gradientMap,N=!!x.alphaMap,ae=x.alphaTest>0,le=!!x.alphaHash,we=!!x.extensions;let Pe=er;x.toneMapped&&(ye===null||ye.isXRRenderTarget===!0)&&(Pe=t.toneMapping);const tt={isWebGL2:d,shaderID:H,shaderType:x.type,shaderName:x.name,vertexShader:j,fragmentShader:K,defines:x.defines,customVertexShaderID:ne,customFragmentShaderID:de,isRawShaderMaterial:x.isRawShaderMaterial===!0,glslVersion:x.glslVersion,precision:_,batching:ze,instancing:ve,instancingColor:ve&&D.instanceColor!==null,supportsVertexTextures:g,outputColorSpace:ye===null?t.outputColorSpace:ye.isXRRenderTarget===!0?ye.texture.colorSpace:Ai,alphaToCoverage:!!x.alphaToCoverage,map:be,matcap:I,envMap:nt,envMapMode:nt&&U.mapping,envMapCubeUVHeight:O,aoMap:_e,lightMap:Ce,bumpMap:xe,normalMap:Oe,displacementMap:g&&Me,emissiveMap:P,normalMapObjectSpace:Oe&&x.normalMapType===S1,normalMapTangentSpace:Oe&&x.normalMapType===Ey,metalnessMap:C,roughnessMap:$,anisotropy:ie,anisotropyMap:fe,clearcoat:ee,clearcoatMap:Se,clearcoatNormalMap:Le,clearcoatRoughnessMap:te,iridescence:re,iridescenceMap:Ke,iridescenceThicknessMap:Ie,sheen:he,sheenColorMap:Re,sheenRoughnessMap:Ee,specularMap:se,specularColorMap:ke,specularIntensityMap:Qe,transmission:ue,transmissionMap:et,thicknessMap:Ve,gradientMap:it,opaque:x.transparent===!1&&x.blending===Uo&&x.alphaToCoverage===!1,alphaMap:N,alphaTest:ae,alphaHash:le,combine:x.combine,mapUv:be&&p(x.map.channel),aoMapUv:_e&&p(x.aoMap.channel),lightMapUv:Ce&&p(x.lightMap.channel),bumpMapUv:xe&&p(x.bumpMap.channel),normalMapUv:Oe&&p(x.normalMap.channel),displacementMapUv:Me&&p(x.displacementMap.channel),emissiveMapUv:P&&p(x.emissiveMap.channel),metalnessMapUv:C&&p(x.metalnessMap.channel),roughnessMapUv:$&&p(x.roughnessMap.channel),anisotropyMapUv:fe&&p(x.anisotropyMap.channel),clearcoatMapUv:Se&&p(x.clearcoatMap.channel),clearcoatNormalMapUv:Le&&p(x.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:te&&p(x.clearcoatRoughnessMap.channel),iridescenceMapUv:Ke&&p(x.iridescenceMap.channel),iridescenceThicknessMapUv:Ie&&p(x.iridescenceThicknessMap.channel),sheenColorMapUv:Re&&p(x.sheenColorMap.channel),sheenRoughnessMapUv:Ee&&p(x.sheenRoughnessMap.channel),specularMapUv:se&&p(x.specularMap.channel),specularColorMapUv:ke&&p(x.specularColorMap.channel),specularIntensityMapUv:Qe&&p(x.specularIntensityMap.channel),transmissionMapUv:et&&p(x.transmissionMap.channel),thicknessMapUv:Ve&&p(x.thicknessMap.channel),alphaMapUv:N&&p(x.alphaMap.channel),vertexTangents:!!F.attributes.tangent&&(Oe||ie),vertexColors:x.vertexColors,vertexAlphas:x.vertexColors===!0&&!!F.attributes.color&&F.attributes.color.itemSize===4,pointsUvs:D.isPoints===!0&&!!F.attributes.uv&&(be||N),fog:!!G,useFog:x.fog===!0,fogExp2:!!G&&G.isFogExp2,flatShading:x.flatShading===!0,sizeAttenuation:x.sizeAttenuation===!0,logarithmicDepthBuffer:h,skinning:D.isSkinnedMesh===!0,morphTargets:F.morphAttributes.position!==void 0,morphNormals:F.morphAttributes.normal!==void 0,morphColors:F.morphAttributes.color!==void 0,morphTargetsCount:Q,morphTextureStride:ge,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numSpotLightMaps:A.spotLightMap.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numSpotLightShadowsWithMaps:A.numSpotLightShadowsWithMaps,numLightProbes:A.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:x.dithering,shadowMapEnabled:t.shadowMap.enabled&&k.length>0,shadowMapType:t.shadowMap.type,toneMapping:Pe,useLegacyLights:t._useLegacyLights,decodeVideoTexture:be&&x.map.isVideoTexture===!0&&ot.getTransfer(x.map.colorSpace)===ut,premultipliedAlpha:x.premultipliedAlpha,doubleSided:x.side===vi,flipSided:x.side===pn,useDepthPacking:x.depthPacking>=0,depthPacking:x.depthPacking||0,index0AttributeName:x.index0AttributeName,extensionDerivatives:we&&x.extensions.derivatives===!0,extensionFragDepth:we&&x.extensions.fragDepth===!0,extensionDrawBuffers:we&&x.extensions.drawBuffers===!0,extensionShaderTextureLOD:we&&x.extensions.shaderTextureLOD===!0,extensionClipCullDistance:we&&x.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:we&&x.extensions.multiDraw===!0&&i.has("WEBGL_multi_draw"),rendererExtensionFragDepth:d||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:d||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:d||i.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:x.customProgramCacheKey()};return tt.vertexUv1s=u.has(1),tt.vertexUv2s=u.has(2),tt.vertexUv3s=u.has(3),u.clear(),tt}function m(x){const A=[];if(x.shaderID?A.push(x.shaderID):(A.push(x.customVertexShaderID),A.push(x.customFragmentShaderID)),x.defines!==void 0)for(const k in x.defines)A.push(k),A.push(x.defines[k]);return x.isRawShaderMaterial===!1&&(v(A,x),E(A,x),A.push(t.outputColorSpace)),A.push(x.customProgramCacheKey),A.join()}function v(x,A){x.push(A.precision),x.push(A.outputColorSpace),x.push(A.envMapMode),x.push(A.envMapCubeUVHeight),x.push(A.mapUv),x.push(A.alphaMapUv),x.push(A.lightMapUv),x.push(A.aoMapUv),x.push(A.bumpMapUv),x.push(A.normalMapUv),x.push(A.displacementMapUv),x.push(A.emissiveMapUv),x.push(A.metalnessMapUv),x.push(A.roughnessMapUv),x.push(A.anisotropyMapUv),x.push(A.clearcoatMapUv),x.push(A.clearcoatNormalMapUv),x.push(A.clearcoatRoughnessMapUv),x.push(A.iridescenceMapUv),x.push(A.iridescenceThicknessMapUv),x.push(A.sheenColorMapUv),x.push(A.sheenRoughnessMapUv),x.push(A.specularMapUv),x.push(A.specularColorMapUv),x.push(A.specularIntensityMapUv),x.push(A.transmissionMapUv),x.push(A.thicknessMapUv),x.push(A.combine),x.push(A.fogExp2),x.push(A.sizeAttenuation),x.push(A.morphTargetsCount),x.push(A.morphAttributeCount),x.push(A.numDirLights),x.push(A.numPointLights),x.push(A.numSpotLights),x.push(A.numSpotLightMaps),x.push(A.numHemiLights),x.push(A.numRectAreaLights),x.push(A.numDirLightShadows),x.push(A.numPointLightShadows),x.push(A.numSpotLightShadows),x.push(A.numSpotLightShadowsWithMaps),x.push(A.numLightProbes),x.push(A.shadowMapType),x.push(A.toneMapping),x.push(A.numClippingPlanes),x.push(A.numClipIntersection),x.push(A.depthPacking)}function E(x,A){a.disableAll(),A.isWebGL2&&a.enable(0),A.supportsVertexTextures&&a.enable(1),A.instancing&&a.enable(2),A.instancingColor&&a.enable(3),A.matcap&&a.enable(4),A.envMap&&a.enable(5),A.normalMapObjectSpace&&a.enable(6),A.normalMapTangentSpace&&a.enable(7),A.clearcoat&&a.enable(8),A.iridescence&&a.enable(9),A.alphaTest&&a.enable(10),A.vertexColors&&a.enable(11),A.vertexAlphas&&a.enable(12),A.vertexUv1s&&a.enable(13),A.vertexUv2s&&a.enable(14),A.vertexUv3s&&a.enable(15),A.vertexTangents&&a.enable(16),A.anisotropy&&a.enable(17),A.alphaHash&&a.enable(18),A.batching&&a.enable(19),x.push(a.mask),a.disableAll(),A.fog&&a.enable(0),A.useFog&&a.enable(1),A.flatShading&&a.enable(2),A.logarithmicDepthBuffer&&a.enable(3),A.skinning&&a.enable(4),A.morphTargets&&a.enable(5),A.morphNormals&&a.enable(6),A.morphColors&&a.enable(7),A.premultipliedAlpha&&a.enable(8),A.shadowMapEnabled&&a.enable(9),A.useLegacyLights&&a.enable(10),A.doubleSided&&a.enable(11),A.flipSided&&a.enable(12),A.useDepthPacking&&a.enable(13),A.dithering&&a.enable(14),A.transmission&&a.enable(15),A.sheen&&a.enable(16),A.opaque&&a.enable(17),A.pointsUvs&&a.enable(18),A.decodeVideoTexture&&a.enable(19),A.alphaToCoverage&&a.enable(20),x.push(a.mask)}function M(x){const A=S[x.type];let k;if(A){const z=Qn[A];k=Y1.clone(z.uniforms)}else k=x.uniforms;return k}function w(x,A){let k;for(let z=0,D=c.length;z0?i.push(f):g.transparent===!0?r.push(f):n.push(f)}function l(d,h,g,_,S,p){const f=s(d,h,g,_,S,p);g.transmission>0?i.unshift(f):g.transparent===!0?r.unshift(f):n.unshift(f)}function u(d,h){n.length>1&&n.sort(d||mR),i.length>1&&i.sort(h||tv),r.length>1&&r.sort(h||tv)}function c(){for(let d=e,h=t.length;d=o.length?(s=new nv,o.push(s)):s=o[r],s}function n(){t=new WeakMap}return{get:e,dispose:n}}function vR(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new V,color:new Ze};break;case"SpotLight":n={position:new V,direction:new V,color:new Ze,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new V,color:new Ze,distance:0,decay:0};break;case"HemisphereLight":n={direction:new V,skyColor:new Ze,groundColor:new Ze};break;case"RectAreaLight":n={color:new Ze,position:new V,halfWidth:new V,halfHeight:new V};break}return t[e.id]=n,n}}}function _R(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ye};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ye};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ye,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let yR=0;function xR(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function SR(t,e){const n=new vR,i=_R(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)r.probe.push(new V);const o=new V,s=new wt,a=new wt;function l(c,d){let h=0,g=0,_=0;for(let k=0;k<9;k++)r.probe[k].set(0,0,0);let S=0,p=0,f=0,m=0,v=0,E=0,M=0,w=0,T=0,L=0,B=0;c.sort(xR);const x=d===!0?Math.PI:1;for(let k=0,z=c.length;k0&&(e.isWebGL2?t.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=ce.LTC_FLOAT_1,r.rectAreaLTC2=ce.LTC_FLOAT_2):(r.rectAreaLTC1=ce.LTC_HALF_1,r.rectAreaLTC2=ce.LTC_HALF_2):t.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=ce.LTC_FLOAT_1,r.rectAreaLTC2=ce.LTC_FLOAT_2):t.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=ce.LTC_HALF_1,r.rectAreaLTC2=ce.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=h,r.ambient[1]=g,r.ambient[2]=_;const A=r.hash;(A.directionalLength!==S||A.pointLength!==p||A.spotLength!==f||A.rectAreaLength!==m||A.hemiLength!==v||A.numDirectionalShadows!==E||A.numPointShadows!==M||A.numSpotShadows!==w||A.numSpotMaps!==T||A.numLightProbes!==B)&&(r.directional.length=S,r.spot.length=f,r.rectArea.length=m,r.point.length=p,r.hemi.length=v,r.directionalShadow.length=E,r.directionalShadowMap.length=E,r.pointShadow.length=M,r.pointShadowMap.length=M,r.spotShadow.length=w,r.spotShadowMap.length=w,r.directionalShadowMatrix.length=E,r.pointShadowMatrix.length=M,r.spotLightMatrix.length=w+T-L,r.spotLightMap.length=T,r.numSpotLightShadowsWithMaps=L,r.numLightProbes=B,A.directionalLength=S,A.pointLength=p,A.spotLength=f,A.rectAreaLength=m,A.hemiLength=v,A.numDirectionalShadows=E,A.numPointShadows=M,A.numSpotShadows=w,A.numSpotMaps=T,A.numLightProbes=B,r.version=yR++)}function u(c,d){let h=0,g=0,_=0,S=0,p=0;const f=d.matrixWorldInverse;for(let m=0,v=c.length;m=a.length?(l=new iv(t,e),a.push(l)):l=a[s],l}function r(){n=new WeakMap}return{get:i,dispose:r}}class wR extends ts{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=y1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class MR extends ts{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const TR=`void main() { - gl_Position = vec4( position, 1.0 ); -}`,CR=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - const float samples = float( VSM_SAMPLES ); - float mean = 0.0; - float squared_mean = 0.0; - float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); - float uvStart = samples <= 1.0 ? 0.0 : - 1.0; - for ( float i = 0.0; i < samples; i ++ ) { - float uvOffset = uvStart + i * uvStride; - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean / samples; - squared_mean = squared_mean / samples; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function AR(t,e,n){let i=new Bh;const r=new Ye,o=new Ye,s=new ft,a=new wR({depthPacking:x1}),l=new MR,u={},c=n.maxTextureSize,d={[rr]:pn,[pn]:rr,[vi]:vi},h=new or({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ye},radius:{value:4}},vertexShader:TR,fragmentShader:CR}),g=h.clone();g.defines.HORIZONTAL_PASS=1;const _=new si;_.setAttribute("position",new oi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const S=new ni(_,h),p=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=fy;let f=this.type;this.render=function(w,T,L){if(p.enabled===!1||p.autoUpdate===!1&&p.needsUpdate===!1||w.length===0)return;const B=t.getRenderTarget(),x=t.getActiveCubeFace(),A=t.getActiveMipmapLevel(),k=t.state;k.setBlending(Qi),k.buffers.color.setClear(1,1,1,1),k.buffers.depth.setTest(!0),k.setScissorTest(!1);const z=f!==pi&&this.type===pi,D=f===pi&&this.type!==pi;for(let G=0,F=w.length;Gc||r.y>c)&&(r.x>c&&(o.x=Math.floor(c/O.x),r.x=o.x*O.x,U.mapSize.x=o.x),r.y>c&&(o.y=Math.floor(c/O.y),r.y=o.y*O.y,U.mapSize.y=o.y)),U.map===null||z===!0||D===!0){const X=this.type!==pi?{minFilter:Qt,magFilter:Qt}:{};U.map!==null&&U.map.dispose(),U.map=new Vr(r.x,r.y,X),U.map.texture.name=Z.name+".shadowMap",U.camera.updateProjectionMatrix()}t.setRenderTarget(U.map),t.clear();const H=U.getViewportCount();for(let X=0;X0||T.map&&T.alphaTest>0){const k=x.uuid,z=T.uuid;let D=u[k];D===void 0&&(D={},u[k]=D);let G=D[z];G===void 0&&(G=x.clone(),D[z]=G,T.addEventListener("dispose",M)),x=G}if(x.visible=T.visible,x.wireframe=T.wireframe,B===pi?x.side=T.shadowSide!==null?T.shadowSide:T.side:x.side=T.shadowSide!==null?T.shadowSide:d[T.side],x.alphaMap=T.alphaMap,x.alphaTest=T.alphaTest,x.map=T.map,x.clipShadows=T.clipShadows,x.clippingPlanes=T.clippingPlanes,x.clipIntersection=T.clipIntersection,x.displacementMap=T.displacementMap,x.displacementScale=T.displacementScale,x.displacementBias=T.displacementBias,x.wireframeLinewidth=T.wireframeLinewidth,x.linewidth=T.linewidth,L.isPointLight===!0&&x.isMeshDistanceMaterial===!0){const k=t.properties.get(x);k.light=L}return x}function E(w,T,L,B,x){if(w.visible===!1)return;if(w.layers.test(T.layers)&&(w.isMesh||w.isLine||w.isPoints)&&(w.castShadow||w.receiveShadow&&x===pi)&&(!w.frustumCulled||i.intersectsObject(w))){w.modelViewMatrix.multiplyMatrices(L.matrixWorldInverse,w.matrixWorld);const z=e.update(w),D=w.material;if(Array.isArray(D)){const G=z.groups;for(let F=0,Z=G.length;F=1):H.indexOf("OpenGL ES")!==-1&&(O=parseFloat(/^OpenGL ES (\d)/.exec(H)[1]),U=O>=2);let X=null,Q={};const ge=t.getParameter(t.SCISSOR_BOX),j=t.getParameter(t.VIEWPORT),K=new ft().fromArray(ge),ne=new ft().fromArray(j);function de(N,ae,le,we){const Pe=new Uint8Array(4),tt=t.createTexture();t.bindTexture(N,tt),t.texParameteri(N,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(N,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let st=0;st"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new WeakMap;let d;const h=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(P,C){return g?new OffscreenCanvas(P,C):fu("canvas")}function S(P,C,$,ie){let ee=1;if((P.width>ie||P.height>ie)&&(ee=ie/Math.max(P.width,P.height)),ee<1||C===!0)if(typeof HTMLImageElement<"u"&&P instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&P instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&P instanceof ImageBitmap){const re=C?_f:Math.floor,he=re(ee*P.width),ue=re(ee*P.height);d===void 0&&(d=_(he,ue));const fe=$?_(he,ue):d;return fe.width=he,fe.height=ue,fe.getContext("2d").drawImage(P,0,0,he,ue),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+P.width+"x"+P.height+") to ("+he+"x"+ue+")."),fe}else return"data"in P&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+P.width+"x"+P.height+")."),P;return P}function p(P){return vg(P.width)&&vg(P.height)}function f(P){return a?!1:P.wrapS!==jn||P.wrapT!==jn||P.minFilter!==Qt&&P.minFilter!==an}function m(P,C){return P.generateMipmaps&&C&&P.minFilter!==Qt&&P.minFilter!==an}function v(P){t.generateMipmap(P)}function E(P,C,$,ie,ee=!1){if(a===!1)return C;if(P!==null){if(t[P]!==void 0)return t[P];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+P+"'")}let re=C;if(C===t.RED&&($===t.FLOAT&&(re=t.R32F),$===t.HALF_FLOAT&&(re=t.R16F),$===t.UNSIGNED_BYTE&&(re=t.R8)),C===t.RED_INTEGER&&($===t.UNSIGNED_BYTE&&(re=t.R8UI),$===t.UNSIGNED_SHORT&&(re=t.R16UI),$===t.UNSIGNED_INT&&(re=t.R32UI),$===t.BYTE&&(re=t.R8I),$===t.SHORT&&(re=t.R16I),$===t.INT&&(re=t.R32I)),C===t.RG&&($===t.FLOAT&&(re=t.RG32F),$===t.HALF_FLOAT&&(re=t.RG16F),$===t.UNSIGNED_BYTE&&(re=t.RG8)),C===t.RGBA){const he=ee?lu:ot.getTransfer(ie);$===t.FLOAT&&(re=t.RGBA32F),$===t.HALF_FLOAT&&(re=t.RGBA16F),$===t.UNSIGNED_BYTE&&(re=he===ut?t.SRGB8_ALPHA8:t.RGBA8),$===t.UNSIGNED_SHORT_4_4_4_4&&(re=t.RGBA4),$===t.UNSIGNED_SHORT_5_5_5_1&&(re=t.RGB5_A1)}return(re===t.R16F||re===t.R32F||re===t.RG16F||re===t.RG32F||re===t.RGBA16F||re===t.RGBA32F)&&e.get("EXT_color_buffer_float"),re}function M(P,C,$){return m(P,$)===!0||P.isFramebufferTexture&&P.minFilter!==Qt&&P.minFilter!==an?Math.log2(Math.max(C.width,C.height))+1:P.mipmaps!==void 0&&P.mipmaps.length>0?P.mipmaps.length:P.isCompressedTexture&&Array.isArray(P.image)?C.mipmaps.length:1}function w(P){return P===Qt||P===Hm||P===xs?t.NEAREST:t.LINEAR}function T(P){const C=P.target;C.removeEventListener("dispose",T),B(C),C.isVideoTexture&&c.delete(C)}function L(P){const C=P.target;C.removeEventListener("dispose",L),A(C)}function B(P){const C=i.get(P);if(C.__webglInit===void 0)return;const $=P.source,ie=h.get($);if(ie){const ee=ie[C.__cacheKey];ee.usedTimes--,ee.usedTimes===0&&x(P),Object.keys(ie).length===0&&h.delete($)}i.remove(P)}function x(P){const C=i.get(P);t.deleteTexture(C.__webglTexture);const $=P.source,ie=h.get($);delete ie[C.__cacheKey],s.memory.textures--}function A(P){const C=P.texture,$=i.get(P),ie=i.get(C);if(ie.__webglTexture!==void 0&&(t.deleteTexture(ie.__webglTexture),s.memory.textures--),P.depthTexture&&P.depthTexture.dispose(),P.isWebGLCubeRenderTarget)for(let ee=0;ee<6;ee++){if(Array.isArray($.__webglFramebuffer[ee]))for(let re=0;re<$.__webglFramebuffer[ee].length;re++)t.deleteFramebuffer($.__webglFramebuffer[ee][re]);else t.deleteFramebuffer($.__webglFramebuffer[ee]);$.__webglDepthbuffer&&t.deleteRenderbuffer($.__webglDepthbuffer[ee])}else{if(Array.isArray($.__webglFramebuffer))for(let ee=0;ee<$.__webglFramebuffer.length;ee++)t.deleteFramebuffer($.__webglFramebuffer[ee]);else t.deleteFramebuffer($.__webglFramebuffer);if($.__webglDepthbuffer&&t.deleteRenderbuffer($.__webglDepthbuffer),$.__webglMultisampledFramebuffer&&t.deleteFramebuffer($.__webglMultisampledFramebuffer),$.__webglColorRenderbuffer)for(let ee=0;ee<$.__webglColorRenderbuffer.length;ee++)$.__webglColorRenderbuffer[ee]&&t.deleteRenderbuffer($.__webglColorRenderbuffer[ee]);$.__webglDepthRenderbuffer&&t.deleteRenderbuffer($.__webglDepthRenderbuffer)}if(P.isWebGLMultipleRenderTargets)for(let ee=0,re=C.length;ee=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+P+" texture units while this GPU supports only "+r.maxTextures),k+=1,P}function G(P){const C=[];return C.push(P.wrapS),C.push(P.wrapT),C.push(P.wrapR||0),C.push(P.magFilter),C.push(P.minFilter),C.push(P.anisotropy),C.push(P.internalFormat),C.push(P.format),C.push(P.type),C.push(P.generateMipmaps),C.push(P.premultiplyAlpha),C.push(P.flipY),C.push(P.unpackAlignment),C.push(P.colorSpace),C.join()}function F(P,C){const $=i.get(P);if(P.isVideoTexture&&Oe(P),P.isRenderTargetTexture===!1&&P.version>0&&$.__version!==P.version){const ie=P.image;if(ie===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ie.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{K($,P,C);return}}n.bindTexture(t.TEXTURE_2D,$.__webglTexture,t.TEXTURE0+C)}function Z(P,C){const $=i.get(P);if(P.version>0&&$.__version!==P.version){K($,P,C);return}n.bindTexture(t.TEXTURE_2D_ARRAY,$.__webglTexture,t.TEXTURE0+C)}function U(P,C){const $=i.get(P);if(P.version>0&&$.__version!==P.version){K($,P,C);return}n.bindTexture(t.TEXTURE_3D,$.__webglTexture,t.TEXTURE0+C)}function O(P,C){const $=i.get(P);if(P.version>0&&$.__version!==P.version){ne($,P,C);return}n.bindTexture(t.TEXTURE_CUBE_MAP,$.__webglTexture,t.TEXTURE0+C)}const H={[pf]:t.REPEAT,[jn]:t.CLAMP_TO_EDGE,[mf]:t.MIRRORED_REPEAT},X={[Qt]:t.NEAREST,[Hm]:t.NEAREST_MIPMAP_NEAREST,[xs]:t.NEAREST_MIPMAP_LINEAR,[an]:t.LINEAR,[Ac]:t.LINEAR_MIPMAP_NEAREST,[Rr]:t.LINEAR_MIPMAP_LINEAR},Q={[E1]:t.NEVER,[b1]:t.ALWAYS,[w1]:t.LESS,[wy]:t.LEQUAL,[M1]:t.EQUAL,[A1]:t.GEQUAL,[T1]:t.GREATER,[C1]:t.NOTEQUAL};function ge(P,C,$){if(C.type===_i&&e.has("OES_texture_float_linear")===!1&&(C.magFilter===an||C.magFilter===Ac||C.magFilter===xs||C.magFilter===Rr||C.minFilter===an||C.minFilter===Ac||C.minFilter===xs||C.minFilter===Rr)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),$?(t.texParameteri(P,t.TEXTURE_WRAP_S,H[C.wrapS]),t.texParameteri(P,t.TEXTURE_WRAP_T,H[C.wrapT]),(P===t.TEXTURE_3D||P===t.TEXTURE_2D_ARRAY)&&t.texParameteri(P,t.TEXTURE_WRAP_R,H[C.wrapR]),t.texParameteri(P,t.TEXTURE_MAG_FILTER,X[C.magFilter]),t.texParameteri(P,t.TEXTURE_MIN_FILTER,X[C.minFilter])):(t.texParameteri(P,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(P,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),(P===t.TEXTURE_3D||P===t.TEXTURE_2D_ARRAY)&&t.texParameteri(P,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),(C.wrapS!==jn||C.wrapT!==jn)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(P,t.TEXTURE_MAG_FILTER,w(C.magFilter)),t.texParameteri(P,t.TEXTURE_MIN_FILTER,w(C.minFilter)),C.minFilter!==Qt&&C.minFilter!==an&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),C.compareFunction&&(t.texParameteri(P,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(P,t.TEXTURE_COMPARE_FUNC,Q[C.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const ie=e.get("EXT_texture_filter_anisotropic");if(C.magFilter===Qt||C.minFilter!==xs&&C.minFilter!==Rr||C.type===_i&&e.has("OES_texture_float_linear")===!1||a===!1&&C.type===aa&&e.has("OES_texture_half_float_linear")===!1)return;(C.anisotropy>1||i.get(C).__currentAnisotropy)&&(t.texParameterf(P,ie.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(C.anisotropy,r.getMaxAnisotropy())),i.get(C).__currentAnisotropy=C.anisotropy)}}function j(P,C){let $=!1;P.__webglInit===void 0&&(P.__webglInit=!0,C.addEventListener("dispose",T));const ie=C.source;let ee=h.get(ie);ee===void 0&&(ee={},h.set(ie,ee));const re=G(C);if(re!==P.__cacheKey){ee[re]===void 0&&(ee[re]={texture:t.createTexture(),usedTimes:0},s.memory.textures++,$=!0),ee[re].usedTimes++;const he=ee[P.__cacheKey];he!==void 0&&(ee[P.__cacheKey].usedTimes--,he.usedTimes===0&&x(C)),P.__cacheKey=re,P.__webglTexture=ee[re].texture}return $}function K(P,C,$){let ie=t.TEXTURE_2D;(C.isDataArrayTexture||C.isCompressedArrayTexture)&&(ie=t.TEXTURE_2D_ARRAY),C.isData3DTexture&&(ie=t.TEXTURE_3D);const ee=j(P,C),re=C.source;n.bindTexture(ie,P.__webglTexture,t.TEXTURE0+$);const he=i.get(re);if(re.version!==he.__version||ee===!0){n.activeTexture(t.TEXTURE0+$);const ue=ot.getPrimaries(ot.workingColorSpace),fe=C.colorSpace===Ln?null:ot.getPrimaries(C.colorSpace),Se=C.colorSpace===Ln||ue===fe?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,C.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,C.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,C.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Se);const Le=f(C)&&p(C.image)===!1;let te=S(C.image,Le,!1,r.maxTextureSize);te=Me(C,te);const Ke=p(te)||a,Ie=o.convert(C.format,C.colorSpace);let Re=o.convert(C.type),Ee=E(C.internalFormat,Ie,Re,C.colorSpace,C.isVideoTexture);ge(ie,C,Ke);let se;const ke=C.mipmaps,Qe=a&&C.isVideoTexture!==!0&&Ee!==xy,et=he.__version===void 0||ee===!0,Ve=re.dataReady,it=M(C,te,Ke);if(C.isDepthTexture)Ee=t.DEPTH_COMPONENT,a?C.type===_i?Ee=t.DEPTH_COMPONENT32F:C.type===Gi?Ee=t.DEPTH_COMPONENT24:C.type===Dr?Ee=t.DEPTH24_STENCIL8:Ee=t.DEPTH_COMPONENT16:C.type===_i&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),C.format===Ir&&Ee===t.DEPTH_COMPONENT&&C.type!==Oh&&C.type!==Gi&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),C.type=Gi,Re=o.convert(C.type)),C.format===Xo&&Ee===t.DEPTH_COMPONENT&&(Ee=t.DEPTH_STENCIL,C.type!==Dr&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),C.type=Dr,Re=o.convert(C.type))),et&&(Qe?n.texStorage2D(t.TEXTURE_2D,1,Ee,te.width,te.height):n.texImage2D(t.TEXTURE_2D,0,Ee,te.width,te.height,0,Ie,Re,null));else if(C.isDataTexture)if(ke.length>0&&Ke){Qe&&et&&n.texStorage2D(t.TEXTURE_2D,it,Ee,ke[0].width,ke[0].height);for(let N=0,ae=ke.length;N>=1,ae>>=1}}else if(ke.length>0&&Ke){Qe&&et&&n.texStorage2D(t.TEXTURE_2D,it,Ee,ke[0].width,ke[0].height);for(let N=0,ae=ke.length;N0&&Ve++,n.texStorage2D(t.TEXTURE_CUBE_MAP,Ve,se,te[0].width,te[0].height));for(let N=0;N<6;N++)if(Le){ke?et&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+N,0,0,0,te[N].width,te[N].height,Re,Ee,te[N].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+N,0,se,te[N].width,te[N].height,0,Re,Ee,te[N].data);for(let ae=0;ae>re),te=Math.max(1,C.height>>re);ee===t.TEXTURE_3D||ee===t.TEXTURE_2D_ARRAY?n.texImage3D(ee,re,fe,Le,te,C.depth,0,he,ue,null):n.texImage2D(ee,re,fe,Le,te,0,he,ue,null)}n.bindFramebuffer(t.FRAMEBUFFER,P),xe(C)?l.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,ie,ee,i.get($).__webglTexture,0,Ce(C)):(ee===t.TEXTURE_2D||ee>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&ee<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,ie,ee,i.get($).__webglTexture,re),n.bindFramebuffer(t.FRAMEBUFFER,null)}function ye(P,C,$){if(t.bindRenderbuffer(t.RENDERBUFFER,P),C.depthBuffer&&!C.stencilBuffer){let ie=a===!0?t.DEPTH_COMPONENT24:t.DEPTH_COMPONENT16;if($||xe(C)){const ee=C.depthTexture;ee&&ee.isDepthTexture&&(ee.type===_i?ie=t.DEPTH_COMPONENT32F:ee.type===Gi&&(ie=t.DEPTH_COMPONENT24));const re=Ce(C);xe(C)?l.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,re,ie,C.width,C.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,re,ie,C.width,C.height)}else t.renderbufferStorage(t.RENDERBUFFER,ie,C.width,C.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,P)}else if(C.depthBuffer&&C.stencilBuffer){const ie=Ce(C);$&&xe(C)===!1?t.renderbufferStorageMultisample(t.RENDERBUFFER,ie,t.DEPTH24_STENCIL8,C.width,C.height):xe(C)?l.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,ie,t.DEPTH24_STENCIL8,C.width,C.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,C.width,C.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,P)}else{const ie=C.isWebGLMultipleRenderTargets===!0?C.texture:[C.texture];for(let ee=0;ee0){$.__webglFramebuffer[ue]=[];for(let fe=0;fe0){$.__webglFramebuffer=[];for(let ue=0;ue0&&xe(P)===!1){const ue=re?C:[C];$.__webglMultisampledFramebuffer=t.createFramebuffer(),$.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,$.__webglMultisampledFramebuffer);for(let fe=0;fe0)for(let fe=0;fe0)for(let fe=0;fe0&&xe(P)===!1){const C=P.isWebGLMultipleRenderTargets?P.texture:[P.texture],$=P.width,ie=P.height;let ee=t.COLOR_BUFFER_BIT;const re=[],he=P.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,ue=i.get(P),fe=P.isWebGLMultipleRenderTargets===!0;if(fe)for(let Se=0;Se0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&C.__useRenderToTexture!==!1}function Oe(P){const C=s.render.frame;c.get(P)!==C&&(c.set(P,C),P.update())}function Me(P,C){const $=P.colorSpace,ie=P.format,ee=P.type;return P.isCompressedTexture===!0||P.isVideoTexture===!0||P.format===gf||$!==Ai&&$!==Ln&&(ot.getTransfer($)===ut?a===!1?e.has("EXT_sRGB")===!0&&ie===$n?(P.format=gf,P.minFilter=an,P.generateMipmaps=!1):C=Ty.sRGBToLinear(C):(ie!==$n||ee!==tr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",$)),C}this.allocateTextureUnit=D,this.resetTextureUnits=z,this.setTexture2D=F,this.setTexture2DArray=Z,this.setTexture3D=U,this.setTextureCube=O,this.rebindTextures=be,this.setupRenderTarget=I,this.updateRenderTargetMipmap=nt,this.updateMultisampleRenderTarget=_e,this.setupDepthRenderbuffer=ze,this.setupFrameBufferTexture=de,this.useMultisampledRTT=xe}function PR(t,e,n){const i=n.isWebGL2;function r(o,s=Ln){let a;const l=ot.getTransfer(s);if(o===tr)return t.UNSIGNED_BYTE;if(o===my)return t.UNSIGNED_SHORT_4_4_4_4;if(o===gy)return t.UNSIGNED_SHORT_5_5_5_1;if(o===d1)return t.BYTE;if(o===f1)return t.SHORT;if(o===Oh)return t.UNSIGNED_SHORT;if(o===py)return t.INT;if(o===Gi)return t.UNSIGNED_INT;if(o===_i)return t.FLOAT;if(o===aa)return i?t.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(o===h1)return t.ALPHA;if(o===$n)return t.RGBA;if(o===p1)return t.LUMINANCE;if(o===m1)return t.LUMINANCE_ALPHA;if(o===Ir)return t.DEPTH_COMPONENT;if(o===Xo)return t.DEPTH_STENCIL;if(o===gf)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(o===g1)return t.RED;if(o===vy)return t.RED_INTEGER;if(o===v1)return t.RG;if(o===_y)return t.RG_INTEGER;if(o===yy)return t.RGBA_INTEGER;if(o===bc||o===Rc||o===Pc||o===Lc)if(l===ut)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(o===bc)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===Rc)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===Pc)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===Lc)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(o===bc)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===Rc)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===Pc)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===Lc)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===Gm||o===Wm||o===jm||o===$m)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(o===Gm)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===Wm)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===jm)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===$m)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===xy)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(o===Xm||o===Ym)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(o===Xm)return l===ut?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(o===Ym)return l===ut?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===qm||o===Km||o===Zm||o===Jm||o===Qm||o===eg||o===tg||o===ng||o===ig||o===rg||o===og||o===sg||o===ag||o===lg)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(o===qm)return l===ut?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===Km)return l===ut?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===Zm)return l===ut?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===Jm)return l===ut?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===Qm)return l===ut?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===eg)return l===ut?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===tg)return l===ut?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===ng)return l===ut?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===ig)return l===ut?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===rg)return l===ut?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===og)return l===ut?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===sg)return l===ut?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===ag)return l===ut?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===lg)return l===ut?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===Nc||o===ug||o===cg)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(o===Nc)return l===ut?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(o===ug)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(o===cg)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(o===_1||o===dg||o===fg||o===hg)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(o===Nc)return a.COMPRESSED_RED_RGTC1_EXT;if(o===dg)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(o===fg)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(o===hg)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return o===Dr?i?t.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):t[o]!==void 0?t[o]:null}return{convert:r}}class LR extends Sn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Ns extends tn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const NR={type:"move"};class id{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Ns,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 Ns,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new V,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new V),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Ns,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new V,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new V),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}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const i of e.hand.values())this._getHandJoint(n,i)}return this.dispatchEvent({type:"connected",data: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,n,i){let r=null,o=null,s=null;const a=this._targetRay,l=this._grip,u=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(u&&e.hand){s=!0;for(const S of e.hand.values()){const p=n.getJointPose(S,i),f=this._getHandJoint(u,S);p!==null&&(f.matrix.fromArray(p.transform.matrix),f.matrix.decompose(f.position,f.rotation,f.scale),f.matrixWorldNeedsUpdate=!0,f.jointRadius=p.radius),f.visible=p!==null}const c=u.joints["index-finger-tip"],d=u.joints["thumb-tip"],h=c.position.distanceTo(d.position),g=.02,_=.005;u.inputState.pinching&&h>g+_?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&h<=g-_&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(o=n.getPose(e.gripSpace,i),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=n.getPose(e.targetRaySpace,i),r===null&&o!==null&&(r=o),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(NR)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=o!==null),u!==null&&(u.visible=s!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const i=new Ns;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[n.jointName]=i,e.add(i)}return e.joints[n.jointName]}}const DR=` -void main() { - - gl_Position = vec4( position, 1.0 ); - -}`,IR=` -uniform sampler2DArray depthColor; -uniform float depthWidth; -uniform float depthHeight; - -void main() { - - vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); - - if ( coord.x >= 1.0 ) { - - gl_FragDepthEXT = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; - - } else { - - gl_FragDepthEXT = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; - - } - -}`;class UR{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n,i){if(this.texture===null){const r=new mn,o=e.properties.get(r);o.__webglTexture=n.texture,(n.depthNear!=i.depthNear||n.depthFar!=i.depthFar)&&(this.depthNear=n.depthNear,this.depthFar=n.depthFar),this.texture=r}}render(e,n){if(this.texture!==null){if(this.mesh===null){const i=n.cameras[0].viewport,r=new or({extensions:{fragDepth:!0},vertexShader:DR,fragmentShader:IR,uniforms:{depthColor:{value:this.texture},depthWidth:{value:i.z},depthHeight:{value:i.w}}});this.mesh=new ni(new ku(20,20),r)}e.render(this.mesh,n)}}reset(){this.texture=null,this.mesh=null}}class FR extends es{constructor(e,n){super();const i=this;let r=null,o=1,s=null,a="local-floor",l=1,u=null,c=null,d=null,h=null,g=null,_=null;const S=new UR,p=n.getContextAttributes();let f=null,m=null;const v=[],E=[],M=new Ye;let w=null;const T=new Sn;T.layers.enable(1),T.viewport=new ft;const L=new Sn;L.layers.enable(2),L.viewport=new ft;const B=[T,L],x=new LR;x.layers.enable(1),x.layers.enable(2);let A=null,k=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(j){let K=v[j];return K===void 0&&(K=new id,v[j]=K),K.getTargetRaySpace()},this.getControllerGrip=function(j){let K=v[j];return K===void 0&&(K=new id,v[j]=K),K.getGripSpace()},this.getHand=function(j){let K=v[j];return K===void 0&&(K=new id,v[j]=K),K.getHandSpace()};function z(j){const K=E.indexOf(j.inputSource);if(K===-1)return;const ne=v[K];ne!==void 0&&(ne.update(j.inputSource,j.frame,u||s),ne.dispatchEvent({type:j.type,data:j.inputSource}))}function D(){r.removeEventListener("select",z),r.removeEventListener("selectstart",z),r.removeEventListener("selectend",z),r.removeEventListener("squeeze",z),r.removeEventListener("squeezestart",z),r.removeEventListener("squeezeend",z),r.removeEventListener("end",D),r.removeEventListener("inputsourceschange",G);for(let j=0;j=0&&(E[de]=null,v[de].disconnect(ne))}for(let K=0;K=E.length){E.push(ne),de=ve;break}else if(E[ve]===null){E[ve]=ne,de=ve;break}if(de===-1)break}const ye=v[de];ye&&ye.connect(ne)}}const F=new V,Z=new V;function U(j,K,ne){F.setFromMatrixPosition(K.matrixWorld),Z.setFromMatrixPosition(ne.matrixWorld);const de=F.distanceTo(Z),ye=K.projectionMatrix.elements,ve=ne.projectionMatrix.elements,ze=ye[14]/(ye[10]-1),be=ye[14]/(ye[10]+1),I=(ye[9]+1)/ye[5],nt=(ye[9]-1)/ye[5],_e=(ye[8]-1)/ye[0],Ce=(ve[8]+1)/ve[0],xe=ze*_e,Oe=ze*Ce,Me=de/(-_e+Ce),P=Me*-_e;K.matrixWorld.decompose(j.position,j.quaternion,j.scale),j.translateX(P),j.translateZ(Me),j.matrixWorld.compose(j.position,j.quaternion,j.scale),j.matrixWorldInverse.copy(j.matrixWorld).invert();const C=ze+Me,$=be+Me,ie=xe-P,ee=Oe+(de-P),re=I*be/$*C,he=nt*be/$*C;j.projectionMatrix.makePerspective(ie,ee,re,he,C,$),j.projectionMatrixInverse.copy(j.projectionMatrix).invert()}function O(j,K){K===null?j.matrixWorld.copy(j.matrix):j.matrixWorld.multiplyMatrices(K.matrixWorld,j.matrix),j.matrixWorldInverse.copy(j.matrixWorld).invert()}this.updateCamera=function(j){if(r===null)return;S.texture!==null&&(j.near=S.depthNear,j.far=S.depthFar),x.near=L.near=T.near=j.near,x.far=L.far=T.far=j.far,(A!==x.near||k!==x.far)&&(r.updateRenderState({depthNear:x.near,depthFar:x.far}),A=x.near,k=x.far,T.near=A,T.far=k,L.near=A,L.far=k,T.updateProjectionMatrix(),L.updateProjectionMatrix(),j.updateProjectionMatrix());const K=j.parent,ne=x.cameras;O(x,K);for(let de=0;de0&&(p.alphaTest.value=f.alphaTest);const m=e.get(f).envMap;if(m&&(p.envMap.value=m,p.flipEnvMap.value=m.isCubeTexture&&m.isRenderTargetTexture===!1?-1:1,p.reflectivity.value=f.reflectivity,p.ior.value=f.ior,p.refractionRatio.value=f.refractionRatio),f.lightMap){p.lightMap.value=f.lightMap;const v=t._useLegacyLights===!0?Math.PI:1;p.lightMapIntensity.value=f.lightMapIntensity*v,n(f.lightMap,p.lightMapTransform)}f.aoMap&&(p.aoMap.value=f.aoMap,p.aoMapIntensity.value=f.aoMapIntensity,n(f.aoMap,p.aoMapTransform))}function s(p,f){p.diffuse.value.copy(f.color),p.opacity.value=f.opacity,f.map&&(p.map.value=f.map,n(f.map,p.mapTransform))}function a(p,f){p.dashSize.value=f.dashSize,p.totalSize.value=f.dashSize+f.gapSize,p.scale.value=f.scale}function l(p,f,m,v){p.diffuse.value.copy(f.color),p.opacity.value=f.opacity,p.size.value=f.size*m,p.scale.value=v*.5,f.map&&(p.map.value=f.map,n(f.map,p.uvTransform)),f.alphaMap&&(p.alphaMap.value=f.alphaMap,n(f.alphaMap,p.alphaMapTransform)),f.alphaTest>0&&(p.alphaTest.value=f.alphaTest)}function u(p,f){p.diffuse.value.copy(f.color),p.opacity.value=f.opacity,p.rotation.value=f.rotation,f.map&&(p.map.value=f.map,n(f.map,p.mapTransform)),f.alphaMap&&(p.alphaMap.value=f.alphaMap,n(f.alphaMap,p.alphaMapTransform)),f.alphaTest>0&&(p.alphaTest.value=f.alphaTest)}function c(p,f){p.specular.value.copy(f.specular),p.shininess.value=Math.max(f.shininess,1e-4)}function d(p,f){f.gradientMap&&(p.gradientMap.value=f.gradientMap)}function h(p,f){p.metalness.value=f.metalness,f.metalnessMap&&(p.metalnessMap.value=f.metalnessMap,n(f.metalnessMap,p.metalnessMapTransform)),p.roughness.value=f.roughness,f.roughnessMap&&(p.roughnessMap.value=f.roughnessMap,n(f.roughnessMap,p.roughnessMapTransform)),e.get(f).envMap&&(p.envMapIntensity.value=f.envMapIntensity)}function g(p,f,m){p.ior.value=f.ior,f.sheen>0&&(p.sheenColor.value.copy(f.sheenColor).multiplyScalar(f.sheen),p.sheenRoughness.value=f.sheenRoughness,f.sheenColorMap&&(p.sheenColorMap.value=f.sheenColorMap,n(f.sheenColorMap,p.sheenColorMapTransform)),f.sheenRoughnessMap&&(p.sheenRoughnessMap.value=f.sheenRoughnessMap,n(f.sheenRoughnessMap,p.sheenRoughnessMapTransform))),f.clearcoat>0&&(p.clearcoat.value=f.clearcoat,p.clearcoatRoughness.value=f.clearcoatRoughness,f.clearcoatMap&&(p.clearcoatMap.value=f.clearcoatMap,n(f.clearcoatMap,p.clearcoatMapTransform)),f.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=f.clearcoatRoughnessMap,n(f.clearcoatRoughnessMap,p.clearcoatRoughnessMapTransform)),f.clearcoatNormalMap&&(p.clearcoatNormalMap.value=f.clearcoatNormalMap,n(f.clearcoatNormalMap,p.clearcoatNormalMapTransform),p.clearcoatNormalScale.value.copy(f.clearcoatNormalScale),f.side===pn&&p.clearcoatNormalScale.value.negate())),f.iridescence>0&&(p.iridescence.value=f.iridescence,p.iridescenceIOR.value=f.iridescenceIOR,p.iridescenceThicknessMinimum.value=f.iridescenceThicknessRange[0],p.iridescenceThicknessMaximum.value=f.iridescenceThicknessRange[1],f.iridescenceMap&&(p.iridescenceMap.value=f.iridescenceMap,n(f.iridescenceMap,p.iridescenceMapTransform)),f.iridescenceThicknessMap&&(p.iridescenceThicknessMap.value=f.iridescenceThicknessMap,n(f.iridescenceThicknessMap,p.iridescenceThicknessMapTransform))),f.transmission>0&&(p.transmission.value=f.transmission,p.transmissionSamplerMap.value=m.texture,p.transmissionSamplerSize.value.set(m.width,m.height),f.transmissionMap&&(p.transmissionMap.value=f.transmissionMap,n(f.transmissionMap,p.transmissionMapTransform)),p.thickness.value=f.thickness,f.thicknessMap&&(p.thicknessMap.value=f.thicknessMap,n(f.thicknessMap,p.thicknessMapTransform)),p.attenuationDistance.value=f.attenuationDistance,p.attenuationColor.value.copy(f.attenuationColor)),f.anisotropy>0&&(p.anisotropyVector.value.set(f.anisotropy*Math.cos(f.anisotropyRotation),f.anisotropy*Math.sin(f.anisotropyRotation)),f.anisotropyMap&&(p.anisotropyMap.value=f.anisotropyMap,n(f.anisotropyMap,p.anisotropyMapTransform))),p.specularIntensity.value=f.specularIntensity,p.specularColor.value.copy(f.specularColor),f.specularColorMap&&(p.specularColorMap.value=f.specularColorMap,n(f.specularColorMap,p.specularColorMapTransform)),f.specularIntensityMap&&(p.specularIntensityMap.value=f.specularIntensityMap,n(f.specularIntensityMap,p.specularIntensityMapTransform))}function _(p,f){f.matcap&&(p.matcap.value=f.matcap)}function S(p,f){const m=e.get(f).light;p.referencePosition.value.setFromMatrixPosition(m.matrixWorld),p.nearDistance.value=m.shadow.camera.near,p.farDistance.value=m.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function kR(t,e,n,i){let r={},o={},s=[];const a=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(m,v){const E=v.program;i.uniformBlockBinding(m,E)}function u(m,v){let E=r[m.id];E===void 0&&(_(m),E=c(m),r[m.id]=E,m.addEventListener("dispose",p));const M=v.program;i.updateUBOMapping(m,M);const w=e.render.frame;o[m.id]!==w&&(h(m),o[m.id]=w)}function c(m){const v=d();m.__bindingPointIndex=v;const E=t.createBuffer(),M=m.__size,w=m.usage;return t.bindBuffer(t.UNIFORM_BUFFER,E),t.bufferData(t.UNIFORM_BUFFER,M,w),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,v,E),E}function d(){for(let m=0;m0&&(E+=M-w),m.__size=E,m.__cache={},this}function S(m){const v={boundary:0,storage:0};return typeof m=="number"||typeof m=="boolean"?(v.boundary=4,v.storage=4):m.isVector2?(v.boundary=8,v.storage=8):m.isVector3||m.isColor?(v.boundary=16,v.storage=12):m.isVector4?(v.boundary=16,v.storage=16):m.isMatrix3?(v.boundary=48,v.storage=48):m.isMatrix4?(v.boundary=64,v.storage=64):m.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",m),v}function p(m){const v=m.target;v.removeEventListener("dispose",p);const E=s.indexOf(v.__bindingPointIndex);s.splice(E,1),t.deleteBuffer(r[v.id]),delete r[v.id],delete o[v.id]}function f(){for(const m in r)t.deleteBuffer(r[m]);s=[],r={},o={}}return{bind:l,update:u,dispose:f}}class Wy{constructor(e={}){const{canvas:n=P1(),context:i=null,depth:r=!0,stencil:o=!0,alpha:s=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:d=!1}=e;this.isWebGLRenderer=!0;let h;i!==null?h=i.getContextAttributes().alpha:h=s;const g=new Uint32Array(4),_=new Int32Array(4);let S=null,p=null;const f=[],m=[];this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Bt,this._useLegacyLights=!1,this.toneMapping=er,this.toneMappingExposure=1;const v=this;let E=!1,M=0,w=0,T=null,L=-1,B=null;const x=new ft,A=new ft;let k=null;const z=new Ze(0);let D=0,G=n.width,F=n.height,Z=1,U=null,O=null;const H=new ft(0,0,G,F),X=new ft(0,0,G,F);let Q=!1;const ge=new Bh;let j=!1,K=!1,ne=null;const de=new wt,ye=new Ye,ve=new V,ze={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function be(){return T===null?Z:1}let I=i;function nt(R,W){for(let q=0;q{function pe(){if(J.forEach(function(Ae){Me.get(Ae).currentProgram.isReady()&&J.delete(Ae)}),J.size===0){Y(R);return}setTimeout(pe,10)}_e.get("KHR_parallel_shader_compile")!==null?pe():setTimeout(pe,10)})};let st=null;function Ct(R){st&&st(R)}function Kt(){Ue.stop()}function Te(){Ue.start()}const Ue=new Oy;Ue.setAnimationLoop(Ct),typeof self<"u"&&Ue.setContext(self),this.setAnimationLoop=function(R){st=R,Ve.setAnimationLoop(R),R===null?Ue.stop():Ue.start()},Ve.addEventListener("sessionstart",Kt),Ve.addEventListener("sessionend",Te),this.render=function(R,W){if(W!==void 0&&W.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(E===!0)return;R.matrixWorldAutoUpdate===!0&&R.updateMatrixWorld(),W.parent===null&&W.matrixWorldAutoUpdate===!0&&W.updateMatrixWorld(),Ve.enabled===!0&&Ve.isPresenting===!0&&(Ve.cameraAutoUpdate===!0&&Ve.updateCamera(W),W=Ve.getCamera()),R.isScene===!0&&R.onBeforeRender(v,R,W,T),p=Se.get(R,m.length),p.init(),m.push(p),de.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),ge.setFromProjectionMatrix(de),K=this.localClippingEnabled,j=Le.init(this.clippingPlanes,K),S=fe.get(R,f.length),S.init(),f.push(S),vt(R,W,0,v.sortObjects),S.finish(),v.sortObjects===!0&&S.sort(U,O),this.info.render.frame++,j===!0&&Le.beginShadows();const q=p.state.shadowsArray;if(te.render(q,R,W),j===!0&&Le.endShadows(),this.info.autoReset===!0&&this.info.reset(),(Ve.enabled===!1||Ve.isPresenting===!1||Ve.hasDepthSensing()===!1)&&Ke.render(S,R),p.setupLights(v._useLegacyLights),W.isArrayCamera){const J=W.cameras;for(let Y=0,pe=J.length;Y0?p=m[m.length-1]:p=null,f.pop(),f.length>0?S=f[f.length-1]:S=null};function vt(R,W,q,J){if(R.visible===!1)return;if(R.layers.test(W.layers)){if(R.isGroup)q=R.renderOrder;else if(R.isLOD)R.autoUpdate===!0&&R.update(W);else if(R.isLight)p.pushLight(R),R.castShadow&&p.pushShadow(R);else if(R.isSprite){if(!R.frustumCulled||ge.intersectsSprite(R)){J&&ve.setFromMatrixPosition(R.matrixWorld).applyMatrix4(de);const Ae=re.update(R),Ne=R.material;Ne.visible&&S.push(R,Ae,Ne,q,ve.z,null)}}else if((R.isMesh||R.isLine||R.isPoints)&&(!R.frustumCulled||ge.intersectsObject(R))){const Ae=re.update(R),Ne=R.material;if(J&&(R.boundingSphere!==void 0?(R.boundingSphere===null&&R.computeBoundingSphere(),ve.copy(R.boundingSphere.center)):(Ae.boundingSphere===null&&Ae.computeBoundingSphere(),ve.copy(Ae.boundingSphere.center)),ve.applyMatrix4(R.matrixWorld).applyMatrix4(de)),Array.isArray(Ne)){const Fe=Ae.groups;for(let je=0,Be=Fe.length;je0&&dp(Y,pe,W,q),J&&xe.viewport(x.copy(J)),Y.length>0&&wa(Y,W,q),pe.length>0&&wa(pe,W,q),Ae.length>0&&wa(Ae,W,q),xe.buffers.depth.setTest(!0),xe.buffers.depth.setMask(!0),xe.buffers.color.setMask(!0),xe.setPolygonOffset(!1)}function dp(R,W,q,J){if((q.isScene===!0?q.overrideMaterial:null)!==null)return;const pe=Ce.isWebGL2;ne===null&&(ne=new Vr(1,1,{generateMipmaps:!0,type:_e.has("EXT_color_buffer_half_float")?aa:tr,minFilter:Rr,samples:pe?4:0})),v.getDrawingBufferSize(ye),pe?ne.setSize(ye.x,ye.y):ne.setSize(_f(ye.x),_f(ye.y));const Ae=v.getRenderTarget();v.setRenderTarget(ne),v.getClearColor(z),D=v.getClearAlpha(),D<1&&v.setClearColor(16777215,.5),v.clear();const Ne=v.toneMapping;v.toneMapping=er,wa(R,q,J),P.updateMultisampleRenderTarget(ne),P.updateRenderTargetMipmap(ne);let Fe=!1;for(let je=0,Be=W.length;je0),He=!!q.morphAttributes.position,xt=!!q.morphAttributes.normal,gn=!!q.morphAttributes.color;let Dt=er;J.toneMapped&&(T===null||T.isXRRenderTarget===!0)&&(Dt=v.toneMapping);const li=q.morphAttributes.position||q.morphAttributes.normal||q.morphAttributes.color,ht=li!==void 0?li.length:0,$e=Me.get(J),Ku=p.state.lights;if(j===!0&&(K===!0||R!==B)){const An=R===B&&J.id===L;Le.setState(J,R,An)}let _t=!1;J.version===$e.__version?($e.needsLights&&$e.lightsStateVersion!==Ku.state.version||$e.outputColorSpace!==Ne||Y.isBatchedMesh&&$e.batching===!1||!Y.isBatchedMesh&&$e.batching===!0||Y.isInstancedMesh&&$e.instancing===!1||!Y.isInstancedMesh&&$e.instancing===!0||Y.isSkinnedMesh&&$e.skinning===!1||!Y.isSkinnedMesh&&$e.skinning===!0||Y.isInstancedMesh&&$e.instancingColor===!0&&Y.instanceColor===null||Y.isInstancedMesh&&$e.instancingColor===!1&&Y.instanceColor!==null||$e.envMap!==Fe||J.fog===!0&&$e.fog!==pe||$e.numClippingPlanes!==void 0&&($e.numClippingPlanes!==Le.numPlanes||$e.numIntersection!==Le.numIntersection)||$e.vertexAlphas!==je||$e.vertexTangents!==Be||$e.morphTargets!==He||$e.morphNormals!==xt||$e.morphColors!==gn||$e.toneMapping!==Dt||Ce.isWebGL2===!0&&$e.morphTargetsCount!==ht)&&(_t=!0):(_t=!0,$e.__version=J.version);let hr=$e.currentProgram;_t===!0&&(hr=Ma(J,W,Y));let mp=!1,ds=!1,Zu=!1;const Gt=hr.getUniforms(),pr=$e.uniforms;if(xe.useProgram(hr.program)&&(mp=!0,ds=!0,Zu=!0),J.id!==L&&(L=J.id,ds=!0),mp||B!==R){Gt.setValue(I,"projectionMatrix",R.projectionMatrix),Gt.setValue(I,"viewMatrix",R.matrixWorldInverse);const An=Gt.map.cameraPosition;An!==void 0&&An.setValue(I,ve.setFromMatrixPosition(R.matrixWorld)),Ce.logarithmicDepthBuffer&&Gt.setValue(I,"logDepthBufFC",2/(Math.log(R.far+1)/Math.LN2)),(J.isMeshPhongMaterial||J.isMeshToonMaterial||J.isMeshLambertMaterial||J.isMeshBasicMaterial||J.isMeshStandardMaterial||J.isShaderMaterial)&&Gt.setValue(I,"isOrthographic",R.isOrthographicCamera===!0),B!==R&&(B=R,ds=!0,Zu=!0)}if(Y.isSkinnedMesh){Gt.setOptional(I,Y,"bindMatrix"),Gt.setOptional(I,Y,"bindMatrixInverse");const An=Y.skeleton;An&&(Ce.floatVertexTextures?(An.boneTexture===null&&An.computeBoneTexture(),Gt.setValue(I,"boneTexture",An.boneTexture,P)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}Y.isBatchedMesh&&(Gt.setOptional(I,Y,"batchingTexture"),Gt.setValue(I,"batchingTexture",Y._matricesTexture,P));const Ju=q.morphAttributes;if((Ju.position!==void 0||Ju.normal!==void 0||Ju.color!==void 0&&Ce.isWebGL2===!0)&&Ie.update(Y,q,hr),(ds||$e.receiveShadow!==Y.receiveShadow)&&($e.receiveShadow=Y.receiveShadow,Gt.setValue(I,"receiveShadow",Y.receiveShadow)),J.isMeshGouraudMaterial&&J.envMap!==null&&(pr.envMap.value=Fe,pr.flipEnvMap.value=Fe.isCubeTexture&&Fe.isRenderTargetTexture===!1?-1:1),ds&&(Gt.setValue(I,"toneMappingExposure",v.toneMappingExposure),$e.needsLights&&qx(pr,Zu),pe&&J.fog===!0&&ue.refreshFogUniforms(pr,pe),ue.refreshMaterialUniforms(pr,J,Z,F,ne),Ll.upload(I,hp($e),pr,P)),J.isShaderMaterial&&J.uniformsNeedUpdate===!0&&(Ll.upload(I,hp($e),pr,P),J.uniformsNeedUpdate=!1),J.isSpriteMaterial&&Gt.setValue(I,"center",Y.center),Gt.setValue(I,"modelViewMatrix",Y.modelViewMatrix),Gt.setValue(I,"normalMatrix",Y.normalMatrix),Gt.setValue(I,"modelMatrix",Y.matrixWorld),J.isShaderMaterial||J.isRawShaderMaterial){const An=J.uniformsGroups;for(let Qu=0,Zx=An.length;Qu0&&P.useMultisampledRTT(R)===!1?Y=Me.get(R).__webglMultisampledFramebuffer:Array.isArray(Be)?Y=Be[q]:Y=Be,x.copy(R.viewport),A.copy(R.scissor),k=R.scissorTest}else x.copy(H).multiplyScalar(Z).floor(),A.copy(X).multiplyScalar(Z).floor(),k=Q;if(xe.bindFramebuffer(I.FRAMEBUFFER,Y)&&Ce.drawBuffers&&J&&xe.drawBuffers(R,Y),xe.viewport(x),xe.scissor(A),xe.setScissorTest(k),pe){const Fe=Me.get(R.texture);I.framebufferTexture2D(I.FRAMEBUFFER,I.COLOR_ATTACHMENT0,I.TEXTURE_CUBE_MAP_POSITIVE_X+W,Fe.__webglTexture,q)}else if(Ae){const Fe=Me.get(R.texture),je=W||0;I.framebufferTextureLayer(I.FRAMEBUFFER,I.COLOR_ATTACHMENT0,Fe.__webglTexture,q||0,je)}L=-1},this.readRenderTargetPixels=function(R,W,q,J,Y,pe,Ae){if(!(R&&R.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ne=Me.get(R).__webglFramebuffer;if(R.isWebGLCubeRenderTarget&&Ae!==void 0&&(Ne=Ne[Ae]),Ne){xe.bindFramebuffer(I.FRAMEBUFFER,Ne);try{const Fe=R.texture,je=Fe.format,Be=Fe.type;if(je!==$n&&se.convert(je)!==I.getParameter(I.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const He=Be===aa&&(_e.has("EXT_color_buffer_half_float")||Ce.isWebGL2&&_e.has("EXT_color_buffer_float"));if(Be!==tr&&se.convert(Be)!==I.getParameter(I.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Be===_i&&(Ce.isWebGL2||_e.has("OES_texture_float")||_e.has("WEBGL_color_buffer_float")))&&!He){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}W>=0&&W<=R.width-J&&q>=0&&q<=R.height-Y&&I.readPixels(W,q,J,Y,se.convert(je),se.convert(Be),pe)}finally{const Fe=T!==null?Me.get(T).__webglFramebuffer:null;xe.bindFramebuffer(I.FRAMEBUFFER,Fe)}}},this.copyFramebufferToTexture=function(R,W,q=0){const J=Math.pow(2,-q),Y=Math.floor(W.image.width*J),pe=Math.floor(W.image.height*J);P.setTexture2D(W,0),I.copyTexSubImage2D(I.TEXTURE_2D,q,0,0,R.x,R.y,Y,pe),xe.unbindTexture()},this.copyTextureToTexture=function(R,W,q,J=0){const Y=W.image.width,pe=W.image.height,Ae=se.convert(q.format),Ne=se.convert(q.type);P.setTexture2D(q,0),I.pixelStorei(I.UNPACK_FLIP_Y_WEBGL,q.flipY),I.pixelStorei(I.UNPACK_PREMULTIPLY_ALPHA_WEBGL,q.premultiplyAlpha),I.pixelStorei(I.UNPACK_ALIGNMENT,q.unpackAlignment),W.isDataTexture?I.texSubImage2D(I.TEXTURE_2D,J,R.x,R.y,Y,pe,Ae,Ne,W.image.data):W.isCompressedTexture?I.compressedTexSubImage2D(I.TEXTURE_2D,J,R.x,R.y,W.mipmaps[0].width,W.mipmaps[0].height,Ae,W.mipmaps[0].data):I.texSubImage2D(I.TEXTURE_2D,J,R.x,R.y,Ae,Ne,W.image),J===0&&q.generateMipmaps&&I.generateMipmap(I.TEXTURE_2D),xe.unbindTexture()},this.copyTextureToTexture3D=function(R,W,q,J,Y=0){if(v.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const pe=R.max.x-R.min.x+1,Ae=R.max.y-R.min.y+1,Ne=R.max.z-R.min.z+1,Fe=se.convert(J.format),je=se.convert(J.type);let Be;if(J.isData3DTexture)P.setTexture3D(J,0),Be=I.TEXTURE_3D;else if(J.isDataArrayTexture||J.isCompressedArrayTexture)P.setTexture2DArray(J,0),Be=I.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}I.pixelStorei(I.UNPACK_FLIP_Y_WEBGL,J.flipY),I.pixelStorei(I.UNPACK_PREMULTIPLY_ALPHA_WEBGL,J.premultiplyAlpha),I.pixelStorei(I.UNPACK_ALIGNMENT,J.unpackAlignment);const He=I.getParameter(I.UNPACK_ROW_LENGTH),xt=I.getParameter(I.UNPACK_IMAGE_HEIGHT),gn=I.getParameter(I.UNPACK_SKIP_PIXELS),Dt=I.getParameter(I.UNPACK_SKIP_ROWS),li=I.getParameter(I.UNPACK_SKIP_IMAGES),ht=q.isCompressedTexture?q.mipmaps[Y]:q.image;I.pixelStorei(I.UNPACK_ROW_LENGTH,ht.width),I.pixelStorei(I.UNPACK_IMAGE_HEIGHT,ht.height),I.pixelStorei(I.UNPACK_SKIP_PIXELS,R.min.x),I.pixelStorei(I.UNPACK_SKIP_ROWS,R.min.y),I.pixelStorei(I.UNPACK_SKIP_IMAGES,R.min.z),q.isDataTexture||q.isData3DTexture?I.texSubImage3D(Be,Y,W.x,W.y,W.z,pe,Ae,Ne,Fe,je,ht.data):q.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),I.compressedTexSubImage3D(Be,Y,W.x,W.y,W.z,pe,Ae,Ne,Fe,ht.data)):I.texSubImage3D(Be,Y,W.x,W.y,W.z,pe,Ae,Ne,Fe,je,ht),I.pixelStorei(I.UNPACK_ROW_LENGTH,He),I.pixelStorei(I.UNPACK_IMAGE_HEIGHT,xt),I.pixelStorei(I.UNPACK_SKIP_PIXELS,gn),I.pixelStorei(I.UNPACK_SKIP_ROWS,Dt),I.pixelStorei(I.UNPACK_SKIP_IMAGES,li),Y===0&&J.generateMipmaps&&I.generateMipmap(Be),xe.unbindTexture()},this.initTexture=function(R){R.isCubeTexture?P.setTextureCube(R,0):R.isData3DTexture?P.setTexture3D(R,0):R.isDataArrayTexture||R.isCompressedArrayTexture?P.setTexture2DArray(R,0):P.setTexture2D(R,0),xe.unbindTexture()},this.resetState=function(){M=0,w=0,T=null,xe.reset(),ke.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Si}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=e===kh?"display-p3":"srgb",n.unpackColorSpace=ot.workingColorSpace===Uu?"display-p3":"srgb"}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Bt?Ur:Sy}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Ur?Bt:Ai}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class BR extends Wy{}BR.prototype.isWebGL1Renderer=!0;let zR=class extends tn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n}};class jy extends ts{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ze(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const rv=new V,ov=new V,sv=new wt,rd=new by,cl=new Fu;class VR extends tn{constructor(e=new si,n=new jy){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=n,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,i=[0];for(let r=1,o=n.count;rl)continue;h.applyMatrix4(this.matrixWorld);const L=e.ray.origin.distanceTo(h);Le.far||n.push({distance:L,point:d.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}else{const f=Math.max(0,s.start),m=Math.min(p.count,s.start+s.count);for(let v=f,E=m-1;vl)continue;h.applyMatrix4(this.matrixWorld);const w=e.ray.origin.distanceTo(h);we.far||n.push({distance:w,point:d.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const n=this.geometry.morphAttributes,i=Object.keys(n);if(i.length>0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=r.length;o.9&&T<.1&&(v<.2&&(s[m+0]+=1),E<.2&&(s[m+2]+=1),M<.2&&(s[m+4]+=1))}}function h(m){o.push(m.x,m.y,m.z)}function g(m,v){const E=m*3;v.x=e[E+0],v.y=e[E+1],v.z=e[E+2]}function _(){const m=new V,v=new V,E=new V,M=new V,w=new Ye,T=new Ye,L=new Ye;for(let B=0,x=0;BMath.floor(t)|0,fl=new Float64Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]);function Yy(t=Math.random){const e=qR(t),n=new Float64Array(e).map(s=>fl[s%32*4]),i=new Float64Array(e).map(s=>fl[s%32*4+1]),r=new Float64Array(e).map(s=>fl[s%32*4+2]),o=new Float64Array(e).map(s=>fl[s%32*4+3]);return function(a,l,u,c){let d,h,g,_,S;const p=(a+l+u+c)*YR,f=dl(a+p),m=dl(l+p),v=dl(u+p),E=dl(c+p),M=(f+m+v+E)*Ot,w=f-M,T=m-M,L=v-M,B=E-M,x=a-w,A=l-T,k=u-L,z=c-B;let D=0,G=0,F=0,Z=0;x>A?D++:G++,x>k?D++:F++,x>z?D++:Z++,A>k?G++:F++,A>z?G++:Z++,k>z?F++:Z++;const U=D>=3?1:0,O=G>=3?1:0,H=F>=3?1:0,X=Z>=3?1:0,Q=D>=2?1:0,ge=G>=2?1:0,j=F>=2?1:0,K=Z>=2?1:0,ne=D>=1?1:0,de=G>=1?1:0,ye=F>=1?1:0,ve=Z>=1?1:0,ze=x-U+Ot,be=A-O+Ot,I=k-H+Ot,nt=z-X+Ot,_e=x-Q+2*Ot,Ce=A-ge+2*Ot,xe=k-j+2*Ot,Oe=z-K+2*Ot,Me=x-ne+3*Ot,P=A-de+3*Ot,C=k-ye+3*Ot,$=z-ve+3*Ot,ie=x-1+4*Ot,ee=A-1+4*Ot,re=k-1+4*Ot,he=z-1+4*Ot,ue=f&255,fe=m&255,Se=v&255,Le=E&255;let te=.6-x*x-A*A-k*k-z*z;if(te<0)d=0;else{const se=ue+e[fe+e[Se+e[Le]]];te*=te,d=te*te*(n[se]*x+i[se]*A+r[se]*k+o[se]*z)}let Ke=.6-ze*ze-be*be-I*I-nt*nt;if(Ke<0)h=0;else{const se=ue+U+e[fe+O+e[Se+H+e[Le+X]]];Ke*=Ke,h=Ke*Ke*(n[se]*ze+i[se]*be+r[se]*I+o[se]*nt)}let Ie=.6-_e*_e-Ce*Ce-xe*xe-Oe*Oe;if(Ie<0)g=0;else{const se=ue+Q+e[fe+ge+e[Se+j+e[Le+K]]];Ie*=Ie,g=Ie*Ie*(n[se]*_e+i[se]*Ce+r[se]*xe+o[se]*Oe)}let Re=.6-Me*Me-P*P-C*C-$*$;if(Re<0)_=0;else{const se=ue+ne+e[fe+de+e[Se+ye+e[Le+ve]]];Re*=Re,_=Re*Re*(n[se]*Me+i[se]*P+r[se]*C+o[se]*$)}let Ee=.6-ie*ie-ee*ee-re*re-he*he;if(Ee<0)S=0;else{const se=ue+1+e[fe+1+e[Se+1+e[Le+1]]];Ee*=Ee,S=Ee*Ee*(n[se]*ie+i[se]*ee+r[se]*re+o[se]*he)}return 27*(d+h+g+_+S)}}function qR(t){const n=new Uint8Array(512);for(let i=0;i<512/2;i++)n[i]=i;for(let i=0;i<512/2-1;i++){const r=i+~~(t()*(256-i)),o=n[i];n[i]=n[r],n[r]=o}for(let i=256;i<512;i++)n[i]=n[i-256];return n}class KR{constructor(){this.noise4D=Yy(),this.group=new Ns,this.geometry=new si,this.material=new jy({color:8035999,transparent:!0,opacity:.3}),this.init()}init(){const e=[];for(let o=0;o<100;o++){let s=(Math.random()-.5)*100,a=(Math.random()-.5)*100,l=(Math.random()-.5)*100;for(let u=0;u<75;u++){e.push(new V(s,a,l));const c=.015,d=this.noise4D(s*c,a*c,l*c,Date.now()*3e-5);s+=Math.cos(d*Math.PI*2)*.4,a+=Math.sin(d*Math.PI*2)*.4,l+=(Math.cos(d*Math.PI)+Math.sin(d*Math.PI))*.2}}this.geometry.setFromPoints(e);const r=new HR(this.geometry,this.material);this.group.add(r)}update(e){this.group.rotation.x+=1e-4,this.group.rotation.y+=1e-4;const n=this.geometry.attributes.position.array;for(let i=0;i{n.position.y+=Math.sin(e+i)*.004,n.rotation.x+=.001,n.rotation.y+=.001})}}class JR{constructor(){this.scene=new zR,this.camera=new Sn(75,window.innerWidth/window.innerHeight,.1,1e3),this.renderer=new Wy({canvas:document.querySelector("#bg"),antialias:!0,alpha:!0}),this.flowField=new KR,this.spheres=new ZR,this.time=0,this.init(),this.setupLights(),this.setupEventListeners()}init(){this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(window.innerWidth,window.innerHeight),this.camera.position.setZ(30),this.scene.add(this.flowField.group),this.spheres.spheres.forEach(e=>this.scene.add(e))}setupLights(){const e=new XR(4210752,.8),n=new $R(8035999,1);n.position.set(10,10,10),this.scene.add(e),this.scene.add(n)}setupEventListeners(){window.addEventListener("resize",()=>{this.camera.aspect=window.innerWidth/window.innerHeight,this.camera.updateProjectionMatrix(),this.renderer.setSize(window.innerWidth,window.innerHeight)}),document.addEventListener("mousemove",e=>{const n=(e.clientX-window.innerWidth/2)*4e-5,i=(e.clientY-window.innerHeight/2)*4e-5;this.flowField.group.rotation.y+=n,this.flowField.group.rotation.x+=i})}animate(){requestAnimationFrame(()=>this.animate()),this.time+=3e-4,this.flowField.update(this.time),this.spheres.update(this.time),this.renderer.render(this.scene,this.camera)}dispose(){window.removeEventListener("resize",this.handleResize),document.removeEventListener("mousemove",this.handleMouseMove),this.scene.traverse(e=>{e.geometry&&e.geometry.dispose(),e.material&&(Array.isArray(e.material)?e.material.forEach(n=>n.dispose()):e.material.dispose())}),this.renderer.dispose()}}class QR{constructor(){this.init()}init(){document.querySelectorAll(".card").forEach(n=>{n.addEventListener("mousemove",r=>{const o=n.getBoundingClientRect(),s=(r.clientX-o.left)/o.width*100,a=(r.clientY-o.top)/o.height*100;n.style.setProperty("--x",`${s}%`),n.style.setProperty("--y",`${a}%`)}),n.querySelectorAll(".learn-more-content li").forEach((r,o)=>{r.style.transitionDelay=`${o*50}ms`})})}}class eP{constructor(){this.init()}init(){const e=document.querySelectorAll(".section"),n=new IntersectionObserver(i=>{i.forEach(r=>{r.isIntersecting&&r.target.classList.add("visible")})},{threshold:.1});e.forEach(i=>n.observe(i))}}var tP=Object.defineProperty,qy=(t,e)=>{for(var n in e)tP(t,n,{get:e[n],enumerable:!0,configurable:!0,set:i=>e[n]=()=>i})};if(typeof y.createContext!="function"){const t=['Remotion requires React.createContext, but it is "undefined".','If you are in a React Server Component, turn it into a client component by adding "use client" at the top of the file.',"","Before:",' import {useCurrentFrame} from "remotion";',"","After:",' "use client";',' import {useCurrentFrame} from "remotion";'];throw new Error(t.join(` -`))}function fv(){return["NOD","E_EN","V"].join("")}var hv=()=>["e","nv"].join(""),Nt=()=>{const t=typeof window<"u"&&window.remotion_isPlayer,e=typeof window<"u"&&typeof window.process<"u"&&typeof window.process.env<"u"&&(window.process[hv()][fv()]==="test"||window.process[hv()][fv()]==="production"&&typeof window<"u"&&typeof window.remotion_puppeteerTimeout<"u");return{isStudio:typeof window<"u"&&window.remotion_isStudio,isRendering:e,isPlayer:t}},nP=Ge.createElement,Ky=[],Zy=()=>{if(!Nt().isStudio)return;const t=new Proxy(nP,{apply(e,n,i){if(Ky.includes(i[0])){const[r,o,...s]=i,a={...o??{},stack:new Error().stack};return Reflect.apply(e,n,[r,a,...s])}return Reflect.apply(e,n,i)}});Ge.createElement=t},_a=t=>{Ky.push(t),Zy()},Jy=y.createContext(!1),iP=({children:t})=>b.jsx(Jy.Provider,{value:!0,children:t}),Gh=()=>y.useContext(Jy);function Wh(t){return!!t}var hl="4.0.230",rP=()=>{if(typeof globalThis>"u")return;const t=globalThis.remotion_imported||typeof window<"u"&&window.remotion_imported;if(t){if(t===hl)return;throw new TypeError(`🚨 Multiple versions of Remotion detected: ${[hl,typeof t=="string"?t:"an older version"].filter(Wh).join(" and ")}. This will cause things to break in an unexpected way. -Check that all your Remotion packages are on the same version. If your dependencies depend on Remotion, make them peer dependencies. You can also run \`npx remotion versions\` from your terminal to see which versions are mismatching.`)}globalThis.remotion_imported=hl,typeof window<"u"&&(window.remotion_imported=hl)},oP=(t,e)=>{const{style:n,...i}=t,r=y.useMemo(()=>({position:"absolute",top:0,left:0,right:0,bottom:0,width:"100%",height:"100%",display:"flex",flexDirection:"column",...n}),[n]);return b.jsx("div",{ref:e,style:r,...i})},jh=y.forwardRef(oP),nn=y.createContext(null),is=Ge.createContext({registerSequence:()=>{throw new Error("SequenceManagerContext not initialized")},unregisterSequence:()=>{throw new Error("SequenceManagerContext not initialized")},sequences:[]}),ya=Ge.createContext({hidden:{},setHidden:()=>{throw new Error("SequenceVisibilityToggle not initialized")}}),sP=({children:t})=>{const[e,n]=y.useState([]),[i,r]=y.useState({}),o=y.useCallback(u=>{n(c=>[...c,u])},[]),s=y.useCallback(u=>{n(c=>c.filter(d=>d.id!==u))},[]),a=y.useMemo(()=>({registerSequence:o,sequences:e,unregisterSequence:s}),[o,e,s]),l=y.useMemo(()=>({hidden:i,setHidden:r}),[i]);return b.jsx(is.Provider,{value:a,children:b.jsx(ya.Provider,{value:l,children:t})})},rs=y.createContext({getNonce:()=>0,fastRefreshes:0}),$h=()=>{const t=y.useContext(rs),[e,n]=y.useState(()=>t.getNonce()),i=y.useRef(t);return y.useEffect(()=>{i.current!==t&&(i.current=t,n(t.getNonce))},[t]),e},Qy={};qy(Qy,{useTimelineSetFrame:()=>hx,useTimelinePosition:()=>ss,usePlayingState:()=>Kh,persistCurrentFrame:()=>cx,getInitialFrameState:()=>dx,getFrameForComposition:()=>fx,TimelineContext:()=>Kn,SetTimelineContext:()=>os});var dr=y.createContext({compositions:[],registerComposition:()=>{},unregisterComposition:()=>{},registerFolder:()=>{},unregisterFolder:()=>{},setCurrentCompositionMetadata:()=>{},updateCompositionDefaultProps:()=>{},folders:[],currentCompositionMetadata:null,canvasContent:null,setCanvasContent:()=>{}}),zu=y.createContext({props:{},updateProps:()=>{throw new Error("Not implemented")},resetUnsaved:()=>{throw new Error("Not implemented")}}),ex=Ge.createRef(),tx=({children:t})=>{const[e,n]=Ge.useState({}),i=y.useCallback(({defaultProps:s,id:a,newProps:l})=>{n(u=>({...u,[a]:typeof l=="function"?l(u[a]??s):l}))},[]),r=y.useCallback(()=>{n({})},[]);y.useImperativeHandle(ex,()=>({getProps:()=>e,setProps:n}),[e]);const o=y.useMemo(()=>({props:e,updateProps:i,resetUnsaved:r}),[e,r,i]);return b.jsx(zu.Provider,{value:o,children:t})},aP={"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";"},pv={},lP=t=>{pv[t]||(console.warn(t),pv[t]=!0)},uP=t=>{for(const e of Object.keys(aP))if(t.includes(e))return{containsHex:!0,hexCode:e};return{containsHex:!1}},xf=t=>t.startsWith("/")?xf(t.substring(1)):t,cP=t=>{if(typeof window<"u"&&window.remotion_staticBase){if(t.startsWith(window.remotion_staticBase))throw new Error(`The value "${t}" is already prefixed with the static base ${window.remotion_staticBase}. You don't need to call staticFile() on it.`);return`${window.remotion_staticBase}/${xf(t)}`}return`/${xf(t)}`},dP=t=>t.split("/").map(r=>encodeURIComponent(r)).join("/"),fP=t=>{if(t===null)throw new TypeError("null was passed to staticFile()");if(typeof t>"u")throw new TypeError("undefined was passed to staticFile()");if(t.startsWith("http://")||t.startsWith("https://"))throw new TypeError(`staticFile() does not support remote URLs - got "${t}". Instead, pass the URL without wrapping it in staticFile(). See: https://remotion.dev/docs/staticfile-remote-urls`);if(t.startsWith("..")||t.startsWith("./"))throw new TypeError(`staticFile() does not support relative paths - got "${t}". Instead, pass the name of a file that is inside the public/ folder. See: https://remotion.dev/docs/staticfile-relative-paths`);if(t.startsWith("/Users")||t.startsWith("/home")||t.startsWith("/tmp")||t.startsWith("/etc")||t.startsWith("/opt")||t.startsWith("/var")||t.startsWith("C:")||t.startsWith("D:")||t.startsWith("E:"))throw new TypeError(`staticFile() does not support absolute paths - got "${t}". Instead, pass the name of a file that is inside the public/ folder. See: https://remotion.dev/docs/staticfile-relative-paths`);if(t.startsWith("public/"))throw new TypeError(`Do not include the public/ prefix when using staticFile() - got "${t}". See: https://remotion.dev/docs/staticfile-relative-paths`);const e=uP(t);e.containsHex&&lP(`WARNING: You seem to pass an already encoded path (path contains ${e.hexCode}). Since Remotion 4.0, the encoding is done by staticFile() itself. You may want to remove a encodeURIComponent() wrapping.`);const n=dP(t),i=cP(n);return i.startsWith("/")?i:`/${i}`},Sf="remotion-date:",Ef="remotion-file:",hP=({data:t,indent:e,staticBase:n})=>{let i=!1,r=!1,o=!1,s=!1;try{return{serializedString:JSON.stringify(t,function(l,u){const c=this[l];return c instanceof Date?(i=!0,`${Sf}${c.toISOString()}`):c instanceof Map?(o=!0,u):c instanceof Set?(s=!0,u):typeof c=="string"&&n!==null&&c.startsWith(n)?(r=!0,`${Ef}${c.replace(n+"/","")}`):u},e),customDateUsed:i,customFileUsed:r,mapUsed:o,setUsed:s}}catch(a){throw new Error("Could not serialize the passed input props to JSON: "+a.message)}},nx=t=>JSON.parse(t,(e,n)=>typeof n=="string"&&n.startsWith(Sf)?new Date(n.replace(Sf,"")):typeof n=="string"&&n.startsWith(Ef)?fP(n.replace(Ef,"")):n),wr=t=>Nt().isStudio?nx(hP({data:t,indent:2,staticBase:window.remotion_staticBase}).serializedString):t,mv=!1,pP=()=>{mv||(mv=!0,console.warn("Called `getInputProps()` on the server. This function is not available server-side and has returned an empty object."),console.warn("To hide this warning, don't call this function on the server:"),console.warn(" typeof window === 'undefined' ? {} : getInputProps()"))},ix=()=>{if(typeof window>"u")return pP(),{};if(Nt().isPlayer)throw new Error("You cannot call `getInputProps()` from a . Instead, the props are available as React props from component that you passed as `component` prop.");const t=window.remotion_inputProps;return t?nx(t):{}},gv=["h264","h265","vp8","vp9","mp3","aac","wav","prores","h264-mkv","h264-ts","gif"];function mP(t,e){if(!(typeof t>"u")){if(typeof t!="string")throw new TypeError(`The "defaultCodec" prop ${e} must be a string, but you passed a value of type ${typeof t}.`);if(!gv.includes(t))throw new Error(`The "defaultCodec" prop ${e} must be one of ${gv.join(", ")}, but you passed ${t}.`)}}function hu(t,e,n){if(typeof t!="number")throw new Error(`The "${e}" prop ${n} must be a number, but you passed a value of type ${typeof t}`);if(isNaN(t))throw new TypeError(`The "${e}" prop ${n} must not be NaN, but is NaN.`);if(!Number.isFinite(t))throw new TypeError(`The "${e}" prop ${n} must be finite, but is ${t}.`);if(t%1!==0)throw new TypeError(`The "${e}" prop ${n} must be an integer, but is ${t}.`);if(t<=0)throw new TypeError(`The "${e}" prop ${n} must be positive, but got ${t}.`)}function Xh(t,e){const{allowFloats:n,component:i}=e;if(typeof t>"u")throw new Error(`The "durationInFrames" prop ${i} is missing.`);if(typeof t!="number")throw new Error(`The "durationInFrames" prop ${i} must be a number, but you passed a value of type ${typeof t}`);if(t<=0)throw new TypeError(`The "durationInFrames" prop ${i} must be positive, but got ${t}.`);if(!n&&t%1!==0)throw new TypeError(`The "durationInFrames" prop ${i} must be an integer, but got ${t}.`);if(!Number.isFinite(t))throw new TypeError(`The "durationInFrames" prop ${i} must be finite, but got ${t}.`)}function rx(t,e,n){if(typeof t!="number")throw new Error(`"fps" must be a number, but you passed a value of type ${typeof t} ${e}`);if(!Number.isFinite(t))throw new Error(`"fps" must be a finite, but you passed ${t} ${e}`);if(isNaN(t))throw new Error(`"fps" must not be NaN, but got ${t} ${e}`);if(t<=0)throw new TypeError(`"fps" must be positive, but got ${t} ${e}`)}var vv=({calculated:t,compositionId:e,compositionFps:n,compositionHeight:i,compositionWidth:r,compositionDurationInFrames:o})=>{const s=`calculated by calculateMetadata() for the composition "${e}"`,a=`of the "" component with the id "${e}"`,l=(t==null?void 0:t.width)??r??void 0;hu(l,"width",t!=null&&t.width?s:a);const u=(t==null?void 0:t.height)??i??void 0;hu(u,"height",t!=null&&t.height?s:a);const c=(t==null?void 0:t.fps)??n??null;rx(c,t!=null&&t.fps?s:a);const d=(t==null?void 0:t.durationInFrames)??o??null;Xh(d,{allowFloats:!1,component:`of the "" component with the id "${e}"`});const h=t==null?void 0:t.defaultCodec;return mP(h,s),{width:l,height:u,fps:c,durationInFrames:d,defaultCodec:h}},ox=({calculateMetadata:t,signal:e,defaultProps:n,originalProps:i,compositionId:r,compositionDurationInFrames:o,compositionFps:s,compositionHeight:a,compositionWidth:l})=>{const u=t?t({defaultProps:n,props:i,abortSignal:e,compositionId:r}):null;if(u!==null&&typeof u=="object"&&"then"in u)return u.then(d=>{const{height:h,width:g,durationInFrames:_,fps:S,defaultCodec:p}=vv({calculated:d,compositionDurationInFrames:o,compositionFps:s,compositionHeight:a,compositionWidth:l,compositionId:r});return{width:g,height:h,fps:S,durationInFrames:_,id:r,defaultProps:wr(n),props:wr(d.props??i),defaultCodec:p??null}});const c=vv({calculated:u,compositionDurationInFrames:o,compositionFps:s,compositionHeight:a,compositionWidth:l,compositionId:r});return u===null?{...c,id:r,defaultProps:wr(n??{}),props:wr(i),defaultCodec:null}:{...c,id:r,defaultProps:wr(n??{}),props:wr(u.props??i),defaultCodec:u.defaultCodec??null}},gP=t=>{try{return{type:"success",result:ox(t)}}catch(e){return{type:"error",error:e}}},Vu=y.createContext(null),sx=y.createRef(),ax=t=>!!t.calculateMetadata,lx="remotion.propsUpdatedExternally",ux=({children:t})=>{const[e,n]=y.useState(null),{compositions:i,canvasContent:r,currentCompositionMetadata:o}=y.useContext(dr),{fastRefreshes:s}=y.useContext(rs),a=y.useMemo(()=>i.find(L=>r&&r.type==="composition"&&r.compositionId===L.id),[r,i]),l=i.find(L=>L.id===e),{props:u}=y.useContext(zu),c=y.useMemo(()=>typeof window>"u"||Nt().isPlayer?{}:ix()??{},[]),[d,h]=y.useState({}),g=y.useMemo(()=>a?u[a.id]??{}:{},[u,a]),_=y.useMemo(()=>l?u[l.id]??{}:{},[u,l]),S=!!o,p=y.useCallback(({calculateMetadata:L,combinedProps:B,compositionDurationInFrames:x,compositionFps:A,compositionHeight:k,compositionId:z,compositionWidth:D,defaultProps:G})=>{const F=new AbortController;if(S)return F;const{signal:Z}=F,U=gP({compositionId:z,calculateMetadata:L,originalProps:B,signal:Z,defaultProps:G,compositionDurationInFrames:x,compositionFps:A,compositionHeight:k,compositionWidth:D});if(U.type==="error")return h(H=>({...H,[z]:{type:"error",error:U.error}})),F;const O=U.result;return typeof O=="object"&&"then"in O?(h(H=>{const X=H[z];return(X==null?void 0:X.type)==="success"||(X==null?void 0:X.type)==="success-and-refreshing"?{...H,[z]:{type:"success-and-refreshing",result:X.result}}:{...H,[z]:{type:"loading"}}}),O.then(H=>{F.signal.aborted||h(X=>({...X,[z]:{type:"success",result:H}}))}).catch(H=>{F.signal.aborted||h(X=>({...X,[z]:{type:"error",error:H}}))})):h(H=>({...H,[z]:{type:"success",result:O}})),F},[S]),f=(r==null?void 0:r.type)==="composition"?r.compositionId:null;y.useImperativeHandle(sx,()=>({setCurrentRenderModalComposition:L=>{n(L)},reloadCurrentlySelectedComposition:()=>{if(!f)return;const L=i.find(k=>k.id===f);if(!L)throw new Error(`Could not find composition with id ${f}`);const B=u[f]??{},x={...L.defaultProps??{},...B??{}},A={...x,...c??{}};p({defaultProps:x,calculateMetadata:L.calculateMetadata,combinedProps:A,compositionDurationInFrames:L.durationInFrames??null,compositionFps:L.fps??null,compositionHeight:L.height??null,compositionWidth:L.width??null,compositionId:L.id})}}),[u,i,f,p,c]);const m=(a==null?void 0:a.id)===(l==null?void 0:l.id),v=y.useMemo(()=>({...(a==null?void 0:a.defaultProps)??{},...g??{}}),[a==null?void 0:a.defaultProps,g]),E=y.useMemo(()=>({...v,...c??{}}),[v,c]),M=a&&ax(a),w=typeof window<"u"&&window.remotion_ignoreFastRefreshUpdate&&s<=window.remotion_ignoreFastRefreshUpdate;y.useEffect(()=>{if(!w&&M){const L=p({calculateMetadata:a.calculateMetadata,combinedProps:E,compositionDurationInFrames:a.durationInFrames??null,compositionFps:a.fps??null,compositionHeight:a.height??null,compositionWidth:a.width??null,defaultProps:v,compositionId:a.id});return()=>{L.abort()}}},[M,v,p,E,a==null?void 0:a.calculateMetadata,a==null?void 0:a.durationInFrames,a==null?void 0:a.fps,a==null?void 0:a.height,a==null?void 0:a.id,a==null?void 0:a.width,w]),y.useEffect(()=>{w||window.dispatchEvent(new CustomEvent(lx,{detail:{resetUnsaved:!0}}))},[s]),y.useEffect(()=>{if(l&&!m){const L={...l.defaultProps??{},..._??{},...c??{}},B=p({calculateMetadata:l.calculateMetadata,compositionDurationInFrames:l.durationInFrames??null,compositionFps:l.fps??null,compositionHeight:l.height??null,compositionId:l.id,compositionWidth:l.width??null,defaultProps:v,combinedProps:L});return()=>{B.abort()}}},[v,p,c,m,l,_]);const T=y.useMemo(()=>{const L=i.filter(B=>B.calculateMetadata===null);return{...d,...L.reduce((B,x)=>({...B,[x.id]:{type:"success",result:{...x,defaultProps:x.defaultProps??{}}}}),{})}},[i,d]);return b.jsx(Vu.Provider,{value:T,children:t})},Yh=t=>{const e=y.useContext(Vu),{props:n}=y.useContext(zu),{compositions:i,canvasContent:r,currentCompositionMetadata:o}=y.useContext(dr),s=(r==null?void 0:r.type)==="composition"?r.compositionId:null,a=t??s,l=i.find(c=>c.id===a),u=y.useMemo(()=>l?n[l.id]??{}:{},[n,l]);return y.useMemo(()=>l?o?{type:"success",result:{...o,id:l.id,props:o.props,defaultProps:l.defaultProps??{},defaultCodec:o.defaultCodec}}:ax(l)?e[l.id]?e[l.id]:null:(Xh(l.durationInFrames,{allowFloats:!1,component:`in `}),rx(l.fps,`in `),hu(l.width,"width",`in `),hu(l.height,"height",`in `),{type:"success",result:{width:l.width,height:l.height,fps:l.fps,id:l.id,durationInFrames:l.durationInFrames,defaultProps:l.defaultProps??{},props:{...l.defaultProps??{},...u??{},...typeof window>"u"||Nt().isPlayer?{}:ix()??{}},defaultCodec:null}}):null,[l,e,o,u])},Hu=()=>{const{canvasContent:t,compositions:e,currentCompositionMetadata:n}=y.useContext(dr),i=e.find(o=>(t==null?void 0:t.type)==="composition"&&o.id===t.compositionId),r=Yh((i==null?void 0:i.id)??null);return y.useMemo(()=>!r||r.type==="error"||r.type==="loading"||!i?null:{...r.result,defaultProps:i.defaultProps??{},id:i.id,...n??{},component:i.component},[n,r,i])},Kn=y.createContext({frame:{},playing:!1,playbackRate:1,rootId:"",imperativePlaying:{current:!1},setPlaybackRate:()=>{throw new Error("default")},audioAndVideoTags:{current:[]}}),os=y.createContext({setFrame:()=>{throw new Error("default")},setPlaying:()=>{throw new Error("default")}}),qh=()=>"remotion.time-all",cx=t=>{localStorage.setItem(qh(),JSON.stringify(t))},dx=()=>{const t=localStorage.getItem(qh())??"{}";return JSON.parse(t)},fx=t=>{const e=localStorage.getItem(qh())??"{}",n=JSON.parse(e);return n[t]!==void 0?Number(n[t]):typeof window>"u"?0:window.remotion_initialFrame??0},ss=()=>{const t=Hu(),e=y.useContext(Kn);if(!t)return typeof window>"u"?0:window.remotion_initialFrame??0;const n=e.frame[t.id]??(Nt().isPlayer?0:fx(t.id));return Math.min(t.durationInFrames-1,n)},hx=()=>{const{setFrame:t}=y.useContext(os);return t},Kh=()=>{const{playing:t,imperativePlaying:e}=y.useContext(Kn),{setPlaying:n}=y.useContext(os);return y.useMemo(()=>[t,n,e],[e,t,n])},$r=y.createContext(!1),wf=({children:t})=>b.jsx($r.Provider,{value:!0,children:t}),Zh=()=>{const t=y.useContext(nn),e=(t==null?void 0:t.width)??null,n=(t==null?void 0:t.height)??null,i=(t==null?void 0:t.durationInFrames)??null,r=Hu();return y.useMemo(()=>{if(!r)return null;const{id:o,durationInFrames:s,fps:a,height:l,width:u,defaultProps:c,props:d,defaultCodec:h}=r;return{id:o,width:e??u,height:n??l,fps:a,durationInFrames:i??s,defaultProps:c,props:d,defaultCodec:h}},[i,n,e,r])},fr=()=>{const t=Zh(),e=y.useContext($r),n=Gh();if(!t)throw typeof window<"u"&&window.remotion_isPlayer||n?new Error(["No video config found. Likely reasons:","- You are probably calling useVideoConfig() from outside the component passed to . See https://www.remotion.dev/docs/player/examples for how to set up the Player correctly.","- You have multiple versions of Remotion installed which causes the React context to get lost."].join("-")):new Error("No video config found. You are probably calling useVideoConfig() from a component which has not been registered as a . See https://www.remotion.dev/docs/the-fundamentals#defining-compositions for more information.");if(!e)throw new Error("Called useVideoConfig() outside a Remotion composition.");return t},Xr=()=>{if(!y.useContext($r))throw Nt().isPlayer?new Error("useCurrentFrame can only be called inside a component that was passed to . See: https://www.remotion.dev/docs/player/examples"):new Error("useCurrentFrame() can only be called inside a component that was registered as a composition. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions");const e=ss(),n=y.useContext(nn),i=n?n.cumulatedFrom+n.relativeFrom:0;return e-i},vP=({frame:t,children:e,active:n=!0})=>{const i=Xr(),r=fr();if(typeof t>"u")throw new Error("The component requires a 'frame' prop, but none was passed.");if(typeof t!="number")throw new Error(`The 'frame' prop of must be a number, but is of type ${typeof t}`);if(Number.isNaN(t))throw new Error("The 'frame' prop of must be a real number, but it is NaN.");if(!Number.isFinite(t))throw new Error(`The 'frame' prop of must be a finite number, but it is ${t}.`);const o=y.useMemo(()=>{if(typeof n=="boolean")return n;if(typeof n=="function")return n(i)},[n,i]),s=y.useContext(Kn),a=y.useContext(nn),l=(a==null?void 0:a.relativeFrom)??0,u=y.useMemo(()=>o?{...s,playing:!1,imperativePlaying:{current:!1},frame:{[r.id]:t+l}}:s,[o,s,r.id,t,l]);return b.jsx(Kn.Provider,{value:u,children:e})},_P=({from:t=0,durationInFrames:e=1/0,children:n,name:i,height:r,width:o,showInTimeline:s=!0,_remotionInternalLoopDisplay:a,_remotionInternalStack:l,_remotionInternalPremountDisplay:u,...c},d)=>{const{layout:h="absolute-fill"}=c,[g]=y.useState(()=>String(Math.random())),_=y.useContext(nn),{rootId:S}=y.useContext(Kn),p=_?_.cumulatedFrom+_.relativeFrom:0,f=$h();if(h!=="absolute-fill"&&h!=="none")throw new TypeError(`The layout prop of expects either "absolute-fill" or "none", but you passed: ${h}`);if(h==="none"&&typeof c.style<"u")throw new TypeError('If layout="none", you may not pass a style.');if(typeof e!="number")throw new TypeError(`You passed to durationInFrames an argument of type ${typeof e}, but it must be a number.`);if(e<=0)throw new TypeError(`durationInFrames must be positive, but got ${e}`);if(typeof t!="number")throw new TypeError(`You passed to the "from" props of your an argument of type ${typeof t}, but it must be a number.`);if(!Number.isFinite(t))throw new TypeError(`The "from" prop of a sequence must be finite, but got ${t}.`);const m=ss(),v=fr(),E=_?Math.min(_.durationInFrames-t,e):e,M=Math.max(0,Math.min(v.durationInFrames-t,E)),{registerSequence:w,unregisterSequence:T}=y.useContext(is),{hidden:L}=y.useContext(ya),B=y.useMemo(()=>(_==null?void 0:_.premounting)??!!c._remotionInternalIsPremounting,[c._remotionInternalIsPremounting,_==null?void 0:_.premounting]),x=y.useMemo(()=>({cumulatedFrom:p,relativeFrom:t,durationInFrames:M,parentFrom:(_==null?void 0:_.relativeFrom)??0,id:g,height:r??(_==null?void 0:_.height)??null,width:o??(_==null?void 0:_.width)??null,premounting:B}),[p,t,M,_,g,r,o,B]),A=y.useMemo(()=>i??"",[i]);y.useEffect(()=>{if(Nt().isStudio)return w({from:t,duration:M,id:g,displayName:A,parent:(_==null?void 0:_.id)??null,type:"sequence",rootId:S,showInTimeline:s,nonce:f,loopDisplay:a,stack:l??null,premountDisplay:u??null}),()=>{T(g)}},[e,g,i,w,A,T,_==null?void 0:_.id,M,S,t,s,f,a,l,u]);const k=Math.ceil(p+t+e-1),z=mk?null:n,D=c.layout==="none"?void 0:c.style,G=y.useMemo(()=>({flexDirection:void 0,...o?{width:o}:{},...r?{height:r}:{},...D??{}}),[r,D,o]);if(d!==null&&h==="none")throw new TypeError('It is not supported to pass both a `ref` and `layout="none"` to .');return L[g]??!1?null:b.jsx(nn.Provider,{value:x,children:z===null?null:c.layout==="none"?z:b.jsx(jh,{ref:d,style:G,className:c.className,children:z})})},yP=y.forwardRef(_P),xP=(t,e)=>{const n=Xr();if(t.layout==="none")throw new Error('`` with `premountFor` prop does not support layout="none"');const{style:i,from:r=0,premountFor:o=0,...s}=t,a=n=r-o,l=y.useMemo(()=>({...i,opacity:a?0:1,pointerEvents:a?"none":(i==null?void 0:i.pointerEvents)??void 0}),[a,i]);return b.jsx(vP,{frame:r,active:a,children:b.jsx(xa,{ref:e,from:r,style:l,_remotionInternalPremountDisplay:o,_remotionInternalIsPremounting:a,...s})})},SP=y.forwardRef(xP),EP=(t,e)=>t.layout!=="none"&&t.premountFor&&!Nt().isRendering?b.jsx(SP,{...t,ref:e}):b.jsx(yP,{...t,ref:e}),xa=y.forwardRef(EP),wP=t=>{if(typeof t!="string")throw new TypeError(`The "filename" must be a string, but you passed a value of type ${typeof t}`);if(t.trim()==="")throw new Error("The `filename` must not be empty");if(!t.match(/^([0-9a-zA-Z-!_.*'()/:&$@=;+,?]+)/g))throw new Error('The `filename` must match "/^([0-9a-zA-Z-!_.*\'()/:&$@=;+,?]+)/g". Use forward slashes only, even on Windows.')},MP=t=>{if(typeof t!="string"&&!(t instanceof Uint8Array))throw new TypeError(`The "content" must be a string or Uint8Array, but you passed a value of type ${typeof t}`);if(typeof t=="string"&&t.trim()==="")throw new Error("The `content` must not be empty")},px=t=>{t.type==="artifact"&&(wP(t.filename),MP(t.content))},as=y.createContext({registerRenderAsset:()=>{},unregisterRenderAsset:()=>{},renderAssets:[]}),TP=({children:t})=>{const[e,n]=y.useState([]),i=y.useCallback(s=>{px(s),n(a=>[...a,s])},[]),r=y.useCallback(s=>{n(a=>a.filter(l=>l.id!==s))},[]);y.useLayoutEffect(()=>{typeof window<"u"&&(window.remotion_collectAssets=()=>(n([]),e))},[e]);const o=y.useMemo(()=>({registerRenderAsset:i,unregisterRenderAsset:r,renderAssets:e}),[e,i,r]);return b.jsx(as.Provider,{value:o,children:t})},Hr=t=>typeof window>"u"?t:new URL(t,window.origin).href,mx=({endAt:t,mediaDuration:e,playbackRate:n,startFrom:i})=>{let r=e;typeof t<"u"&&(r=t),typeof i<"u"&&(r-=i);const o=r/n;return Math.floor(o)};function Jh(t){let e;throw CP(t)?(e=t,e.stack||(e.stack=new Error(e.message).stack)):typeof t=="string"?e=Error(t):e=Error("Rendering was cancelled"),window.remotion_cancelledError=e.stack,e}var CP=t=>t instanceof Error?!0:!(t===null||typeof t!="object"||!("stack"in t)||typeof t.stack!="string"||!("message"in t)||typeof t.message!="string"),gx=y.createContext(null),AP=()=>Ge.useContext(gx),Gu=({durationInFrames:t,times:e=1/0,children:n,name:i,...r})=>{const o=Xr(),{durationInFrames:s}=fr();if(Xh(t,{component:"of the component",allowFloats:!0}),typeof e!="number")throw new TypeError(`You passed to "times" an argument of type ${typeof e}, but it must be a number.`);if(e!==1/0&&e%1!==0)throw new TypeError(`The "times" prop of a loop must be an integer, but got ${e}.`);if(e<0)throw new TypeError(`The "times" prop of a loop must be at least 0, but got ${e}`);const a=Math.ceil(s/t),l=Math.min(a,e),u=r.layout==="none"?void 0:r.style,c=t*(l-1),h=Math.floor(o/t)*t,g=Math.min(h,c),_=y.useMemo(()=>({numberOfTimes:l,startOffset:-g,durationInFrames:t}),[l,t,g]),S=y.useMemo(()=>({iteration:Math.floor(o/t),durationInFrames:t}),[o,t]);return b.jsx(gx.Provider,{value:S,children:b.jsx(xa,{durationInFrames:t,from:g,name:i??"",_remotionInternalLoopDisplay:_,layout:r.layout,style:u,children:n})})};Gu.useLoop=AP;var Wu=y.createContext({}),_v={},ad=[],vx=({children:t})=>{const[e,n]=y.useState(()=>_v);return y.useEffect(()=>{const i=()=>{n(_v)};return ad.push(i),()=>{ad=ad.filter(r=>r!==i)}},[]),b.jsx(Wu.Provider,{value:e,children:t})},ls=t=>y.useContext(Wu)[t]??t,_x=(t,e)=>{if(typeof t.volume!="number"&&typeof t.volume!="function"&&typeof t.volume<"u")throw new TypeError(`You have passed a volume of type ${typeof t.volume} to your <${e} /> component. Volume must be a number or a function with the signature '(frame: number) => number' undefined.`);if(typeof t.volume=="number"&&t.volume<0)throw new TypeError(`You have passed a volume below 0 to your <${e} /> component. Volume must be between 0 and 1`);if(typeof t.playbackRate!="number"&&typeof t.playbackRate<"u")throw new TypeError(`You have passed a playbackRate of type ${typeof t.playbackRate} to your <${e} /> component. Playback rate must a real number or undefined.`);if(typeof t.playbackRate=="number"&&(isNaN(t.playbackRate)||!Number.isFinite(t.playbackRate)||t.playbackRate<=0))throw new TypeError(`You have passed a playbackRate of ${t.playbackRate} to your <${e} /> component. Playback rate must be a real number above 0.`)},yx=(t,e)=>{if(typeof t<"u"){if(typeof t!="number")throw new TypeError(`type of startFrom prop must be a number, instead got type ${typeof t}.`);if(isNaN(t)||t===1/0)throw new TypeError("startFrom prop can not be NaN or Infinity.");if(t<0)throw new TypeError(`startFrom must be greater than equal to 0 instead got ${t}.`)}if(typeof e<"u"){if(typeof e!="number")throw new TypeError(`type of endAt prop must be a number, instead got type ${typeof e}.`);if(isNaN(e))throw new TypeError("endAt prop can not be NaN.");if(e<=0)throw new TypeError(`endAt must be a positive number, instead got ${e}.`)}if(e{switch(e.type){case"got-duration":{const n=Hr(e.src);return t[n]===e.durationInSeconds?t:{...t,[n]:e.durationInSeconds}}default:return t}},Qh=y.createContext({durations:{},setDurations:()=>{throw new Error("context missing")}}),xx=({children:t})=>{const[e,n]=y.useReducer(bP,{}),i=y.useMemo(()=>({durations:e,setDurations:n}),[e]);return b.jsx(Qh.Provider,{value:i,children:t})};function yv(t){let e=t+1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function RP(t){let e=0,n=0,i=0;for(e=0;e{if(t===null)return Math.random();if(typeof t=="string")return yv(RP(t));if(typeof t=="number")return yv(t*1e10);throw new Error("random() argument must be a number or a string")},Sa=()=>{const t=y.useContext(nn);return Math.min(0,(t==null?void 0:t.relativeFrom)??0)},ju=t=>{const e=Gu.useLoop(),n=Xr(),i=Sa();return t==="repeat"||e===null?n+i:n+i+e.durationInFrames*e.iteration},PP=t=>{if(/data:|blob:/.test(t.substring(0,5)))return"Data URL";const e=t.split("/").map(n=>n.split("\\")).flat(1);return e[e.length-1]},pu=(t,e,n)=>{const{current:i}=t;if(!i)return;const r=i.play();r.catch&&r.catch(o=>{if(i&&!o.message.includes("request was interrupted by a call to pause")&&!o.message.includes("The operation was aborted.")&&!o.message.includes("The fetching process for the media resource was aborted by the user agent")&&!o.message.includes("request was interrupted by a new load request")&&!o.message.includes("because the media was removed from the document")&&!(o.message.includes("user didn't interact with the document")&&i.muted)&&(console.log(`Could not play ${e} due to following error: `,o),!i.muted)){if(n){n();return}console.log("The video will be muted and we'll retry playing it."),e==="video"&&Nt().isPlayer&&console.log("Use onAutoPlayError() to handle this error yourself."),i.muted=!0,i.play()}})},Ea=({frame:t,volume:e,mediaVolume:n=1,allowAmplificationDuringRender:i})=>{const r=i?1/0:1;if(typeof e=="number")return Math.min(r,e*n);if(typeof e>"u")return Number(n);const o=e(t)*n;if(typeof o!="number")throw new TypeError(`You passed in a a function to the volume prop but it did not return a number but a value of type ${typeof o} for frame ${t}`);if(Number.isNaN(o))throw new TypeError(`You passed in a function to the volume prop but it returned NaN for frame ${t}.`);if(!Number.isFinite(o))throw new TypeError(`You passed in a function to the volume prop but it returned a non-finite number for frame ${t}.`);return Math.max(0,Math.min(r,o))},xv={},LP=t=>{xv[t]||(console.warn(t),xv[t]=!0)},Sx=({volume:t,mediaVolume:e,mediaRef:n,src:i,mediaType:r,playbackRate:o,displayName:s,id:a,stack:l,showInTimeline:u,premountDisplay:c,onAutoPlayError:d})=>{const h=fr(),{rootId:g,audioAndVideoTags:_}=y.useContext(Kn),S=y.useContext(nn),p=S?S.relativeFrom+S.cumulatedFrom:0,[f]=Kh(),m=Sa(),{registerSequence:v,unregisterSequence:E}=y.useContext(is),[M]=y.useState(()=>t),w=$h(),T=S?Math.min(S.durationInFrames,h.durationInFrames):h.durationInFrames,L=typeof t=="function",B=y.useMemo(()=>typeof t=="number"?t:new Array(Math.floor(Math.max(0,T+m))).fill(!0).map((x,A)=>Ea({frame:A+m,volume:t,mediaVolume:e,allowAmplificationDuringRender:!1})).join(","),[T,m,t,e]);y.useEffect(()=>{typeof t=="number"&&t!==M&&LP(`Remotion: The ${r} with src ${i} has changed it's volume. Prefer the callback syntax for setting volume to get better timeline display: https://www.remotion.dev/docs/using-audio/#controlling-volume`)},[M,r,i,t]),y.useEffect(()=>{var x,A;if(n.current){if(!i)throw new Error("No src passed");if(!(!Nt().isStudio&&((A=(x=window.process)==null?void 0:x.env)==null?void 0:A.NODE_ENV)!=="test")&&u)return v({type:r,src:i,id:a,duration:T,from:0,parent:(S==null?void 0:S.id)??null,displayName:s??PP(i),rootId:g,volume:B,showInTimeline:!0,nonce:w,startMediaFrom:0-m,doesVolumeChange:L,loopDisplay:void 0,playbackRate:o,stack:l,premountDisplay:c}),()=>{E(a)}}},[p,T,a,S,i,v,g,E,h,B,L,w,n,r,m,o,s,l,u,c]),y.useEffect(()=>{const x={id:a,play:()=>{if(f)return pu(n,r,d)}};return _.current.push(x),()=>{_.current=_.current.filter(A=>A.id!==a)}},[_,a,n,r,d,f])},NP=()=>{const[t,e]=y.useState([]),[n,i]=y.useState([]),[r,o]=y.useState([]),s=y.useRef(!1),a=y.useCallback(c=>(e(d=>[...d,c]),{unblock:()=>{e(d=>{const h=d.filter(g=>g!==c);return h.length===d.length?d:h})}}),[]),l=y.useCallback(c=>(i(d=>[...d,c]),{remove:()=>{i(d=>d.filter(h=>h!==c))}}),[]),u=y.useCallback(c=>(o(d=>[...d,c]),{remove:()=>{o(d=>d.filter(h=>h!==c))}}),[]);return y.useEffect(()=>{t.length>0&&n.forEach(c=>c())},[t]),y.useEffect(()=>{t.length===0&&r.forEach(c=>c())},[t]),y.useMemo(()=>({addBlock:a,listenForBuffering:l,listenForResume:u,buffering:s}),[a,s,l,u])},cs=Ge.createContext(null),Ex=({children:t})=>{const e=NP();return b.jsx(cs.Provider,{value:e,children:t})},DP=t=>{const[e,n]=y.useState(t.buffering.current);return y.useEffect(()=>{const i=()=>{n(!0)},r=()=>{n(!1)};return t.listenForBuffering(i),t.listenForResume(r),()=>{t.listenForBuffering(()=>{}),t.listenForResume(()=>{})}},[t]),e},ep=()=>{const t=y.useContext(cs),e=t?t.addBlock:null;return y.useMemo(()=>({delayPlayback:()=>{if(!e)throw new Error("Tried to enable the buffering state, but a Remotion context was not found. This API can only be called in a component that was passed to the Remotion Player or a . Or you might have experienced a version mismatch - run `npx remotion versions` and ensure all packages have the same version. This error is thrown by the buffer state https://remotion.dev/docs/player/buffer-state");const{unblock:n}=e({id:String(Math.random())});return{unblock:n}}}),[e])},IP=({mediaRef:t,mediaType:e,onVariableFpsVideoDetected:n,pauseWhenBuffering:i})=>{const r=y.useRef(!1),{delayPlayback:o}=ep(),s=y.useCallback(a=>{if(e!=="video"||!i)return;const l=t.current;if(!l||!l.requestVideoFrameCallback)return;r.current=!0;const u=o(),c=()=>{u.unblock(),l.removeEventListener("ended",c,{once:!0}),l.removeEventListener("pause",c,{once:!0}),r.current=!1},d=()=>{c()};l.requestVideoFrameCallback((h,g)=>{Math.abs(g.mediaTime-a)>.5&&n(),c()}),l.addEventListener("ended",d,{once:!0}),l.addEventListener("pause",d,{once:!0}),l.addEventListener("canplay",d,{once:!0})},[o,t,e,n,i]);return y.useMemo(()=>({isBuffering:()=>r.current,bufferUntilFirstFrame:s}),[s])},UP=({element:t,shouldBuffer:e,isPremounting:n})=>{const i=ep(),[r,o]=y.useState(!1);return y.useEffect(()=>{let s=[];const{current:a}=t;if(!a||!e||n)return;const l=()=>{s.forEach(d=>d()),s=[],o(!1)},u=()=>{o(!0);const{unblock:d}=i.delayPlayback(),h=()=>{l(),c()},g=()=>{l(),c()};a.addEventListener("canplay",h,{once:!0}),s.push(()=>{a.removeEventListener("canplay",h)}),a.addEventListener("error",g,{once:!0}),s.push(()=>{a.removeEventListener("error",g)}),s.push(()=>{d()})},c=()=>{a.readyState{a.removeEventListener("waiting",u)}))};return c(),()=>{l()}},[i,t,n,e]),r},FP=({mediaRef:t,mediaType:e,lastSeek:n,onVariableFpsVideoDetected:i})=>{const r=y.useRef(null);return y.useEffect(()=>{const{current:o}=t;if(o)r.current=o.currentTime;else{r.current=null;return}if(e!=="video"){r.current=null;return}const s=o;if(!s.requestVideoFrameCallback)return;let a=()=>{};const l=()=>{if(!s)return;const u=s.requestVideoFrameCallback((c,d)=>{if(r.current!==null){const h=Math.abs(r.current-d.mediaTime),g=Math.abs(n.current===null?1/0:d.mediaTime-n.current);h>.5&&g>.5&&d.mediaTime>r.current&&i()}r.current=d.mediaTime,l()});a=()=>{s.cancelVideoFrameCallback(u),a=()=>{}}};return l(),()=>{a()}},[n,t,e,i]),r};function OP(t,e,n,i){const{extrapolateLeft:r,extrapolateRight:o,easing:s}=i;let a=t;const[l,u]=e,[c,d]=n;if(au){if(o==="identity")return a;if(o==="clamp")a=u;else if(o==="wrap"){const h=u-l;a=((a-l)%h+h)%h+l}}return c===d?c:(a=(a-l)/(u-l),a=s(a),a=a*(d-c)+c,a)}function kP(t,e){let n;for(n=1;n=t);++n);return n-1}function BP(t){for(let e=1;et[e-1]))throw new Error(`inputRange must be strictly monotonically increasing but got [${t.join(",")}]`)}function Sv(t,e){if(e.length<2)throw new Error(t+" must have at least 2 elements");for(const n of e){if(typeof n!="number")throw new Error(`${t} must contain only numbers`);if(!Number.isFinite(n))throw new Error(`${t} must contain only finite numbers, but got [${e.join(",")}]`)}}function wx(t,e,n,i){if(typeof t>"u")throw new Error("input can not be undefined");if(typeof e>"u")throw new Error("inputRange can not be undefined");if(typeof n>"u")throw new Error("outputRange can not be undefined");if(e.length!==n.length)throw new Error("inputRange ("+e.length+") and outputRange ("+n.length+") must have the same length");Sv("inputRange",e),Sv("outputRange",n),BP(e);const r=(i==null?void 0:i.easing)??(l=>l);let o="extend";(i==null?void 0:i.extrapolateLeft)!==void 0&&(o=i.extrapolateLeft);let s="extend";if((i==null?void 0:i.extrapolateRight)!==void 0&&(s=i.extrapolateRight),typeof t!="number")throw new TypeError("Cannot interpolate an input which is not a number");const a=kP(t,e);return OP(t,[e[a],e[a+1]],[n[a],n[a+1]],{easing:r,extrapolateLeft:o,extrapolateRight:s})}var zP=({frame:t,playbackRate:e,startFrom:n})=>wx(t,[-1,n,n+1],[-1,n,n+e]),Mx=({fps:t,frame:e,playbackRate:n,startFrom:i})=>{const r=zP({frame:e,playbackRate:n,startFrom:i}),o=1e3/t;return r*o/1e3},Tx=(t,e)=>Math.round(t/e*100)/100,$u=()=>{if(typeof window>"u")return!1;const t=/iP(ad|od|hone)/i.test(window.navigator.userAgent),e=/AppleWebKit/.test(window.navigator.userAgent);return t&&e},VP=t=>$u()&&t.startsWith("blob:"),Mf=({actualFrom:t,fps:e})=>Tx(Math.max(0,-t),e),Tf=({duration:t,fps:e})=>Tx(t,e),HP=({actualSrc:t,actualFrom:e,duration:n,fps:i})=>{if(VP(t)||t.startsWith("data:")||!!new URL(t,(typeof window>"u"?null:window.location.href)??"http://localhost:3000").hash||!Number.isFinite(e))return t;const o=`${t}#t=${Mf({actualFrom:e,fps:i})}`;return Number.isFinite(n)?`${o},${Tf({duration:n,fps:i})}`:o},GP=({prevStartFrom:t,newStartFrom:e,prevDuration:n,newDuration:i,fps:r})=>{const o=Mf({actualFrom:t,fps:r}),s=Mf({actualFrom:e,fps:r}),a=Tf({duration:n,fps:r}),l=Tf({duration:i,fps:r});return!(sa)},WP=({actualSrc:t,actualFrom:e,duration:n,fps:i})=>{const r=y.useRef(e),o=y.useRef(n),s=y.useRef(t);return(!GP({prevStartFrom:r.current,newStartFrom:e,prevDuration:o.current,newDuration:n,fps:i})||t!==s.current)&&(r.current=e,o.current=n,s.current=t),HP({actualSrc:s.current,actualFrom:r.current,duration:o.current,fps:i})},Ev={},jP=(t,e)=>{if(t===null||t.seekable.length===0||t.seekable.length>1||Ev[t.src])return;const n={start:t.seekable.start(0),end:t.seekable.end(0)};if(n.start===0&&n.end===0){const i=[`The media ${t.src} cannot be seeked. This could be one of few reasons:`,"1) The media resource was replaced while the video is playing but it was not loaded yet.","2) The media does not support seeking.","3) The media was loaded with security headers prventing it from being included.","Please see https://remotion.dev/docs/non-seekable-media for assistance."].join(` -`);if(e==="console-error")console.error(i);else if(e==="console-warning")console.warn(`The media ${t.src} does not support seeking. The video will render fine, but may not play correctly in the Remotion Studio and in the . See https://remotion.dev/docs/non-seekable-media for an explanation.`);else throw new Error(i);Ev[t.src]=!0}},tp=.45,ld=(t,e)=>{if(!t.current)return;const n=$u()?Number(e.toFixed(1)):e;t.current.currentTime=n},Cx=({mediaRef:t,src:e,mediaType:n,playbackRate:i,onlyWarnForMediaSeekingError:r,acceptableTimeshift:o,pauseWhenBuffering:s,isPremounting:a,debugSeeking:l,onAutoPlayError:u})=>{const{playbackRate:c}=y.useContext(Kn),d=Xr(),h=ss(),[g]=Kh(),_=y.useContext(cs),{fps:S}=fr(),p=Sa(),f=y.useRef(null),m=y.useRef(null);if(!_)throw new Error("useMediaPlayback must be used inside a ");const v=y.useRef({}),E=y.useCallback(()=>{e&&(l&&console.log(`Detected ${e} as a variable FPS video. Disabling buffering while seeking.`),v.current[e]=!0)},[l,e]),M=FP({mediaRef:t,mediaType:n,lastSeek:m,onVariableFpsVideoDetected:E}),w=Mx({frame:d,playbackRate:i,startFrom:-p,fps:S}),T=UP({element:t,shouldBuffer:s,isPremounting:a}),{bufferUntilFirstFrame:L,isBuffering:B}=IP({mediaRef:t,mediaType:n,onVariableFpsVideoDetected:E,pauseWhenBuffering:s}),x=i*c,A=(()=>{var z;return(z=t.current)!=null&&z.duration?Math.min(t.current.duration,o??tp):o})(),k=DP(_);y.useEffect(()=>{var D,G;if(!g){(D=t.current)==null||D.pause();return}const z=T||B();k&&!z&&((G=t.current)==null||G.pause())},[B,T,k,t,g]),y.useEffect(()=>{const z=n==="audio"?"