diff --git a/assets/Noise-108969e2.js b/assets/Noise-e2defa57.js similarity index 99% rename from assets/Noise-108969e2.js rename to assets/Noise-e2defa57.js index a2d5c356..f7bdc83b 100644 --- a/assets/Noise-108969e2.js +++ b/assets/Noise-e2defa57.js @@ -1,4 +1,4 @@ -import{W as U,N as ee,F as Ve,l as L,U as A,m as We,n as Be,o as M,D as Ke,p as Ze,q as je,s as Xe,t as q,v as Y,w as D,x as qe,y as fe,z as u,A as N,P as Re,R as de,I as pe,J as Ye,L as te,K as Ce,O as be,X as ye,Y as _e,Z as me,_ as $e,$ as Qe,a0 as $,r as H,a1 as ue,a2 as we,a as Je,a3 as et,j as ce,a4 as tt,a5 as st}from"./index-cf06fcba.js";let Z;function it(){var e;if(Z!==void 0)return Z;try{let t;const s=document.createElement("canvas");return Z=!!(window.WebGL2RenderingContext&&(t=s.getContext("webgl2"))),t&&((e=t.getExtension("WEBGL_lose_context"))==null||e.loseContext()),Z}catch{return Z=!1}}/** +import{W as U,N as ee,F as Ve,l as L,U as A,m as We,n as Be,o as M,D as Ke,p as Ze,q as je,s as Xe,t as q,v as Y,w as D,x as qe,y as fe,z as u,A as N,P as Re,R as de,I as pe,J as Ye,L as te,K as Ce,O as be,X as ye,Y as _e,Z as me,_ as $e,$ as Qe,a0 as $,r as H,a1 as ue,a2 as we,a as Je,a3 as et,j as ce,a4 as tt,a5 as st}from"./index-bce4be0d.js";let Z;function it(){var e;if(Z!==void 0)return Z;try{let t;const s=document.createElement("canvas");return Z=!!(window.WebGL2RenderingContext&&(t=s.getContext("webgl2"))),t&&((e=t.getExtension("WEBGL_lose_context"))==null||e.loseContext()),Z}catch{return Z=!1}}/** * postprocessing v6.34.2 build Sat Feb 03 2024 * https://github.com/pmndrs/postprocessing * Copyright 2015-2024 Raoul van Rüschen diff --git a/assets/easing-a3fe9c65.js b/assets/easing-a3fe9c65.js new file mode 100644 index 00000000..64e46e73 --- /dev/null +++ b/assets/easing-a3fe9c65.js @@ -0,0 +1 @@ +const I={LINEAR:"LINEAR",QUADRATIC:"QUADRATIC",BEZIER:"BEZIER",PARAMETRIC:"PARAMETRIC"},R=(e,A=I.BEZIER)=>{switch(A){case"LINEAR":return e;case"QUADRATIC":return e<=.5?2*e*e:2*(e-.5)*(1-(e-.5))+.5;case"BEZIER":return e*e*(3-2*e);case"PARAMETRIC":return e*e/(2*(e*e-e)+1);default:return A}},r=(e,A=0,E=1)=>Math.min(E,Math.max(A,e)),s=(e,A,E)=>e+E*(A-e);export{I as E,r as c,R as e,s as l}; diff --git a/assets/horse-bebaa4a6.png b/assets/horse-bebaa4a6.png new file mode 100644 index 00000000..66fb3026 Binary files /dev/null and b/assets/horse-bebaa4a6.png differ diff --git a/assets/index-cf06fcba.js b/assets/index-bce4be0d.js similarity index 67% rename from assets/index-cf06fcba.js rename to assets/index-bce4be0d.js index c87a6dbc..01a8a3a5 100644 --- a/assets/index-cf06fcba.js +++ b/assets/index-bce4be0d.js @@ -1,4 +1,4 @@ -var tF=Object.defineProperty;var nF=(n,e,t)=>e in n?tF(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var at=(n,e,t)=>(nF(n,typeof e!="symbol"?e+"":e,t),t),t_=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)};var ee=(n,e,t)=>(t_(n,e,"read from private field"),t?t.call(n):e.get(n)),ct=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Ye=(n,e,t,r)=>(t_(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t);var Qm=(n,e,t,r)=>({set _(i){Ye(n,e,i,t)},get _(){return ee(n,e,r)}}),Gt=(n,e,t)=>(t_(n,e,"access private method"),t);function rF(n,e){for(var t=0;tr[i]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=t(i);fetch(i.href,s)}})();function Dp(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var _P={exports:{}},G0={},SP={exports:{}},qt={};/** +var aF=Object.defineProperty;var lF=(n,e,t)=>e in n?aF(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var at=(n,e,t)=>(lF(n,typeof e!="symbol"?e+"":e,t),t),r_=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)};var ee=(n,e,t)=>(r_(n,e,"read from private field"),t?t.call(n):e.get(n)),ct=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Ye=(n,e,t,r)=>(r_(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t);var eg=(n,e,t,r)=>({set _(i){Ye(n,e,i,t)},get _(){return ee(n,e,r)}}),Gt=(n,e,t)=>(r_(n,e,"access private method"),t);function cF(n,e){for(var t=0;tr[i]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=t(i);fetch(i.href,s)}})();function Op(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var SP={exports:{}},X0={},wP={exports:{}},qt={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var tF=Object.defineProperty;var nF=(n,e,t)=>e in n?tF(n,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Np=Symbol.for("react.element"),iF=Symbol.for("react.portal"),sF=Symbol.for("react.fragment"),oF=Symbol.for("react.strict_mode"),aF=Symbol.for("react.profiler"),lF=Symbol.for("react.provider"),cF=Symbol.for("react.context"),uF=Symbol.for("react.forward_ref"),dF=Symbol.for("react.suspense"),fF=Symbol.for("react.memo"),hF=Symbol.for("react.lazy"),cC=Symbol.iterator;function pF(n){return n===null||typeof n!="object"?null:(n=cC&&n[cC]||n["@@iterator"],typeof n=="function"?n:null)}var wP={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},EP=Object.assign,MP={};function Vd(n,e,t){this.props=n,this.context=e,this.refs=MP,this.updater=t||wP}Vd.prototype.isReactComponent={};Vd.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=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,n,e,"setState")};Vd.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function bP(){}bP.prototype=Vd.prototype;function iE(n,e,t){this.props=n,this.context=e,this.refs=MP,this.updater=t||wP}var sE=iE.prototype=new bP;sE.constructor=iE;EP(sE,Vd.prototype);sE.isPureReactComponent=!0;var uC=Array.isArray,TP=Object.prototype.hasOwnProperty,oE={current:null},CP={key:!0,ref:!0,__self:!0,__source:!0};function AP(n,e,t){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)TP.call(e,r)&&!CP.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=t;else if(1e in n?tF(n,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var _F=M,SF=Symbol.for("react.element"),wF=Symbol.for("react.fragment"),EF=Object.prototype.hasOwnProperty,MF=_F.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,bF={key:!0,ref:!0,__self:!0,__source:!0};function RP(n,e,t){var r,i={},s=null,o=null;t!==void 0&&(s=""+t),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)EF.call(e,r)&&!bF.hasOwnProperty(r)&&(i[r]=e[r]);if(n&&n.defaultProps)for(r in e=n.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:SF,type:n,key:s,ref:o,props:i,_owner:MF.current}}G0.Fragment=wF;G0.jsx=RP;G0.jsxs=RP;_P.exports=G0;var N=_P.exports;const lE=M.createContext(null),TF=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.amplitude)??1),[i,s]=M.useState((n==null?void 0:n.octaveBandMode)??2),[o,a]=M.useState((n==null?void 0:n.energyMeasure)??"bass");return N.jsx(lE.Provider,{value:{config:{amplitude:t,octaveBandMode:i,energyMeasure:o},setters:{setAmplitude:r,setOctaveBand:s,setEnergyMeasure:a}},children:e})};function cE(){const n=M.useContext(lE);if(!n)throw new Error("useFFTAnalyzerContext must be used within a FFTAnalyzerContextProvider");return n.config}function CF(){const n=M.useContext(lE);if(!n)throw new Error("useFFTAnalyzerContext must be used within a FFTAnalyzerContextProvider");return n.setters}const fC=n=>{let e;const t=new Set,r=(f,h)=>{const p=typeof f=="function"?f(e):f;if(!Object.is(p,e)){const m=e;e=h??(typeof p!="object"||p===null)?p:Object.assign({},e,p),t.forEach(v=>v(e,m))}},i=()=>e,l={setState:r,getState:i,getInitialState:()=>u,subscribe:f=>(t.add(f),()=>t.delete(f)),destroy:()=>{t.clear()}},u=e=n(r,i,l);return l},AF=n=>n?fC(n):fC;var PP={exports:{}},IP={},LP={exports:{}},DP={};/** + */var TF=M,CF=Symbol.for("react.element"),AF=Symbol.for("react.fragment"),RF=Object.prototype.hasOwnProperty,PF=TF.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,IF={key:!0,ref:!0,__self:!0,__source:!0};function PP(n,e,t){var r,i={},s=null,o=null;t!==void 0&&(s=""+t),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)RF.call(e,r)&&!IF.hasOwnProperty(r)&&(i[r]=e[r]);if(n&&n.defaultProps)for(r in e=n.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:CF,type:n,key:s,ref:o,props:i,_owner:PF.current}}X0.Fragment=AF;X0.jsx=PP;X0.jsxs=PP;SP.exports=X0;var N=SP.exports;const uE=M.createContext(null),LF=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.amplitude)??1),[i,s]=M.useState((n==null?void 0:n.octaveBandMode)??2),[o,a]=M.useState((n==null?void 0:n.energyMeasure)??"bass");return N.jsx(uE.Provider,{value:{config:{amplitude:t,octaveBandMode:i,energyMeasure:o},setters:{setAmplitude:r,setOctaveBand:s,setEnergyMeasure:a}},children:e})};function dE(){const n=M.useContext(uE);if(!n)throw new Error("useFFTAnalyzerContext must be used within a FFTAnalyzerContextProvider");return n.config}function DF(){const n=M.useContext(uE);if(!n)throw new Error("useFFTAnalyzerContext must be used within a FFTAnalyzerContextProvider");return n.setters}const fC=n=>{let e;const t=new Set,r=(f,h)=>{const p=typeof f=="function"?f(e):f;if(!Object.is(p,e)){const m=e;e=h??(typeof p!="object"||p===null)?p:Object.assign({},e,p),t.forEach(v=>v(e,m))}},i=()=>e,l={setState:r,getState:i,getInitialState:()=>u,subscribe:f=>(t.add(f),()=>t.delete(f)),destroy:()=>{t.clear()}},u=e=n(r,i,l);return l},NF=n=>n?fC(n):fC;var IP={exports:{}},LP={},DP={exports:{}},NP={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -22,7 +22,7 @@ var tF=Object.defineProperty;var nF=(n,e,t)=>e in n?tF(n,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Ed=M;function RF(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var PF=typeof Object.is=="function"?Object.is:RF,IF=Ed.useState,LF=Ed.useEffect,DF=Ed.useLayoutEffect,NF=Ed.useDebugValue;function OF(n,e){var t=e(),r=IF({inst:{value:t,getSnapshot:e}}),i=r[0].inst,s=r[1];return DF(function(){i.value=t,i.getSnapshot=e,r_(i)&&s({inst:i})},[n,t,e]),LF(function(){return r_(i)&&s({inst:i}),n(function(){r_(i)&&s({inst:i})})},[n]),NF(t),t}function r_(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!PF(n,t)}catch{return!0}}function kF(n,e){return e()}var UF=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?kF:OF;DP.useSyncExternalStore=Ed.useSyncExternalStore!==void 0?Ed.useSyncExternalStore:UF;LP.exports=DP;var FF=LP.exports;/** + */var bd=M;function OF(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var kF=typeof Object.is=="function"?Object.is:OF,UF=bd.useState,FF=bd.useEffect,zF=bd.useLayoutEffect,BF=bd.useDebugValue;function VF(n,e){var t=e(),r=UF({inst:{value:t,getSnapshot:e}}),i=r[0].inst,s=r[1];return zF(function(){i.value=t,i.getSnapshot=e,s_(i)&&s({inst:i})},[n,t,e]),FF(function(){return s_(i)&&s({inst:i}),n(function(){s_(i)&&s({inst:i})})},[n]),BF(t),t}function s_(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!kF(n,t)}catch{return!0}}function HF(n,e){return e()}var $F=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?HF:VF;NP.useSyncExternalStore=bd.useSyncExternalStore!==void 0?bd.useSyncExternalStore:$F;DP.exports=NP;var WF=DP.exports;/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * @@ -30,15 +30,15 @@ var tF=Object.defineProperty;var nF=(n,e,t)=>e in n?tF(n,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var j0=M,zF=FF;function BF(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var VF=typeof Object.is=="function"?Object.is:BF,HF=zF.useSyncExternalStore,$F=j0.useRef,WF=j0.useEffect,GF=j0.useMemo,jF=j0.useDebugValue;IP.useSyncExternalStoreWithSelector=function(n,e,t,r,i){var s=$F(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=GF(function(){function l(m){if(!u){if(u=!0,f=m,m=r(m),i!==void 0&&o.hasValue){var v=o.value;if(i(v,m))return h=v}return h=m}if(v=h,VF(f,m))return v;var w=r(m);return i!==void 0&&i(v,w)?v:(f=m,h=w)}var u=!1,f,h,p=t===void 0?null:t;return[function(){return l(e())},p===null?void 0:function(){return l(p())}]},[e,t,r,i]);var a=HF(n,s[0],s[1]);return WF(function(){o.hasValue=!0,o.value=a},[a]),jF(a),a};PP.exports=IP;var XF=PP.exports;const qF=Dp(XF),{useDebugValue:YF}=Ki,{useSyncExternalStoreWithSelector:ZF}=qF;const KF=n=>n;function QF(n,e=KF,t){const r=ZF(n.subscribe,n.getState,n.getServerState||n.getInitialState,e,t);return YF(r),r}const hC=n=>{const e=typeof n=="function"?AF(n):n,t=(r,i)=>QF(e,r,i);return Object.assign(t,e),t},JF=n=>n?hC(n):hC;/** + */var q0=M,GF=WF;function jF(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var XF=typeof Object.is=="function"?Object.is:jF,qF=GF.useSyncExternalStore,YF=q0.useRef,ZF=q0.useEffect,KF=q0.useMemo,QF=q0.useDebugValue;LP.useSyncExternalStoreWithSelector=function(n,e,t,r,i){var s=YF(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=KF(function(){function l(m){if(!u){if(u=!0,f=m,m=r(m),i!==void 0&&o.hasValue){var v=o.value;if(i(v,m))return h=v}return h=m}if(v=h,XF(f,m))return v;var w=r(m);return i!==void 0&&i(v,w)?v:(f=m,h=w)}var u=!1,f,h,p=t===void 0?null:t;return[function(){return l(e())},p===null?void 0:function(){return l(p())}]},[e,t,r,i]);var a=qF(n,s[0],s[1]);return ZF(function(){o.hasValue=!0,o.value=a},[a]),QF(a),a};IP.exports=LP;var JF=IP.exports;const e4=Op(JF),{useDebugValue:t4}=Ki,{useSyncExternalStoreWithSelector:n4}=e4;const r4=n=>n;function i4(n,e=r4,t){const r=n4(n.subscribe,n.getState,n.getServerState||n.getInitialState,e,t);return t4(r),r}const hC=n=>{const e=typeof n=="function"?NF(n):n,t=(r,i)=>i4(e,r,i);return Object.assign(t,e),t},s4=n=>n?hC(n):hC;/** * @license * Copyright 2010-2023 Three.js Authors * SPDX-License-Identifier: MIT - */const Op="161",Ul={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Fl={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},NP=0,zS=1,OP=2,e4=3,kP=0,X0=1,th=2,_s=3,$o=0,Kr=1,Js=2,io=0,ac=1,BS=2,VS=3,HS=4,UP=5,Ra=100,FP=101,zP=102,$S=103,WS=104,BP=200,VP=201,HP=202,$P=203,Wv=204,Gv=205,WP=206,GP=207,jP=208,XP=209,qP=210,YP=211,ZP=212,KP=213,QP=214,JP=0,e3=1,t3=2,vh=3,n3=4,r3=5,i3=6,s3=7,kp=0,o3=1,a3=2,so=0,l3=1,c3=2,u3=3,uE=4,d3=5,f3=6,GS="attached",h3="detached",q0=300,Wo=301,el=302,yh=303,xh=304,Hd=306,_h=1e3,Ur=1001,Sh=1002,Gn=1003,jv=1004,t4=1004,$l=1005,n4=1005,fn=1006,nh=1007,r4=1007,no=1008,i4=1008,oo=1009,p3=1010,m3=1011,Up=1012,dE=1013,No=1014,is=1015,tl=1016,fE=1017,hE=1018,Ha=1020,g3=1021,Fr=1023,v3=1024,y3=1025,Bo=1026,gc=1027,x3=1028,pE=1029,_3=1030,mE=1031,gE=1033,Sv=33776,wv=33777,Ev=33778,Mv=33779,jS=35840,XS=35841,qS=35842,YS=35843,vE=36196,ZS=37492,KS=37496,QS=37808,JS=37809,e1=37810,t1=37811,n1=37812,r1=37813,i1=37814,s1=37815,o1=37816,a1=37817,l1=37818,c1=37819,u1=37820,d1=37821,bv=36492,f1=36494,h1=36495,S3=36283,p1=36284,m1=36285,g1=36286,w3=2200,E3=2201,M3=2202,wh=2300,Eh=2301,Tv=2302,Gl=2400,jl=2401,Mh=2402,Y0=2500,yE=2501,s4=0,o4=1,a4=2,xE=3e3,$a=3001,b3=3200,T3=3201,dl=0,C3=1,Ri="",Fn="srgb",di="srgb-linear",Z0="display-p3",Fp="display-p3-linear",bh="linear",pn="srgb",Th="rec709",Ch="p3",l4=0,zl=7680,c4=7681,u4=7682,d4=7683,f4=34055,h4=34056,p4=5386,m4=512,g4=513,v4=514,y4=515,x4=516,_4=517,S4=518,v1=519,A3=512,R3=513,P3=514,_E=515,I3=516,L3=517,D3=518,N3=519,Ah=35044,w4=35048,E4=35040,M4=35045,b4=35049,T4=35041,C4=35046,A4=35050,R4=35042,P4="100",y1="300 es",Xv=1035,ro=2e3,Rh=2001;class po{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(t)===-1&&r[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const r=this._listeners;return r[e]!==void 0&&r[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const r=this._listeners[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let s=0,o=i.length;s>8&255]+Pr[n>>16&255]+Pr[n>>24&255]+"-"+Pr[e&255]+Pr[e>>8&255]+"-"+Pr[e>>16&15|64]+Pr[e>>24&255]+"-"+Pr[t&63|128]+Pr[t>>8&255]+"-"+Pr[t>>16&255]+Pr[t>>24&255]+Pr[r&255]+Pr[r>>8&255]+Pr[r>>16&255]+Pr[r>>24&255]).toLowerCase()}function zn(n,e,t){return Math.max(e,Math.min(t,n))}function SE(n,e){return(n%e+e)%e}function I4(n,e,t,r,i){return r+(n-e)*(i-r)/(t-e)}function L4(n,e,t){return n!==e?(t-n)/(e-n):0}function rh(n,e,t){return(1-t)*n+t*e}function D4(n,e,t,r){return rh(n,e,1-Math.exp(-t*r))}function N4(n,e=1){return e-Math.abs(SE(n,e*2)-e)}function O4(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function k4(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function U4(n,e){return n+Math.floor(Math.random()*(e-n+1))}function F4(n,e){return n+Math.random()*(e-n)}function z4(n){return n*(.5-Math.random())}function B4(n){n!==void 0&&(pC=n);let e=pC+=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 V4(n){return n*lc}function H4(n){return n*Md}function x1(n){return(n&n-1)===0&&n!==0}function $4(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function qv(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function W4(n,e,t,r,i){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),u=s((e+r)/2),f=o((e+r)/2),h=s((e-r)/2),p=o((e-r)/2),m=s((r-e)/2),v=o((r-e)/2);switch(i){case"XYX":n.set(a*f,l*h,l*p,a*u);break;case"YZY":n.set(l*p,a*f,l*h,a*u);break;case"ZXZ":n.set(l*h,l*p,a*f,a*u);break;case"XZX":n.set(a*f,l*v,l*m,a*u);break;case"YXY":n.set(l*m,a*f,l*v,a*u);break;case"ZYZ":n.set(l*v,l*m,a*f,a*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Zr(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Ot(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const O3={DEG2RAD:lc,RAD2DEG:Md,generateUUID:Li,clamp:zn,euclideanModulo:SE,mapLinear:I4,inverseLerp:L4,lerp:rh,damp:D4,pingpong:N4,smoothstep:O4,smootherstep:k4,randInt:U4,randFloat:F4,randFloatSpread:z4,seededRandom:B4,degToRad:V4,radToDeg:H4,isPowerOfTwo:x1,ceilPowerOfTwo:$4,floorPowerOfTwo:qv,setQuaternionFromProperEuler:W4,normalize:Ot,denormalize:Zr};class ge{constructor(e=0,t=0){ge.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,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,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;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,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,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,t){return this.x=e.x-t.x,this.y=e.y-t.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 t=this.x,r=this.y,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6],this.y=i[1]*t+i[4]*r+i[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,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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 t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(zn(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const r=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*r-o*i+e.x,this.y=s*i+o*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Vt{constructor(e,t,r,i,s,o,a,l,u){Vt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,r,i,s,o,a,l,u)}set(e,t,r,i,s,o,a,l,u){const f=this.elements;return f[0]=e,f[1]=i,f[2]=a,f[3]=t,f[4]=s,f[5]=l,f[6]=r,f[7]=o,f[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,i=t.elements,s=this.elements,o=r[0],a=r[3],l=r[6],u=r[1],f=r[4],h=r[7],p=r[2],m=r[5],v=r[8],w=i[0],x=i[3],g=i[6],S=i[1],_=i[4],b=i[7],A=i[2],R=i[5],P=i[8];return s[0]=o*w+a*S+l*A,s[3]=o*x+a*_+l*R,s[6]=o*g+a*b+l*P,s[1]=u*w+f*S+h*A,s[4]=u*x+f*_+h*R,s[7]=u*g+f*b+h*P,s[2]=p*w+m*S+v*A,s[5]=p*x+m*_+v*R,s[8]=p*g+m*b+v*P,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],f=e[8];return t*o*f-t*a*u-r*s*f+r*a*l+i*s*u-i*o*l}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],f=e[8],h=f*o-a*u,p=a*l-f*s,m=u*s-o*l,v=t*h+r*p+i*m;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const w=1/v;return e[0]=h*w,e[1]=(i*u-f*r)*w,e[2]=(a*r-i*o)*w,e[3]=p*w,e[4]=(f*t-i*l)*w,e[5]=(i*s-a*t)*w,e[6]=m*w,e[7]=(r*l-u*t)*w,e[8]=(o*t-r*s)*w,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,r,i,s,o,a){const l=Math.cos(s),u=Math.sin(s);return this.set(r*l,r*u,-r*(l*o+u*a)+o+e,-i*u,i*l,-i*(-u*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(i_.makeScale(e,t)),this}rotate(e){return this.premultiply(i_.makeRotation(-e)),this}translate(e,t){return this.premultiply(i_.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,r,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,r=e.elements;for(let i=0;i<9;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const i_=new Vt;function k3(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const G4={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Ou(n,e){return new G4[n](e)}function Ph(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function U3(){const n=Ph("canvas");return n.style.display="block",n}const mC={};function cc(n){n in mC||(mC[n]=!0,console.warn(n))}const gC=new Vt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),vC=new Vt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),eg={[di]:{transfer:bh,primaries:Th,toReference:n=>n,fromReference:n=>n},[Fn]:{transfer:pn,primaries:Th,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[Fp]:{transfer:bh,primaries:Ch,toReference:n=>n.applyMatrix3(vC),fromReference:n=>n.applyMatrix3(gC)},[Z0]:{transfer:pn,primaries:Ch,toReference:n=>n.convertSRGBToLinear().applyMatrix3(vC),fromReference:n=>n.applyMatrix3(gC).convertLinearToSRGB()}},j4=new Set([di,Fp]),cn={enabled:!0,_workingColorSpace:di,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!j4.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const r=eg[e].toReference,i=eg[t].fromReference;return i(r(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return eg[n].primaries},getTransfer:function(n){return n===Ri?bh:eg[n].transfer}};function Ju(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function s_(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let su;class wE{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{su===void 0&&(su=Ph("canvas")),su.width=e.width,su.height=e.height;const r=su.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),t=su}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.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 t=Ph("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),s=i.data;for(let o=0;o0&&(r.userData=this.userData),t||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==q0)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case _h:e.x=e.x-Math.floor(e.x);break;case Ur:e.x=e.x<0?0:1;break;case Sh: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 _h:e.y=e.y-Math.floor(e.y);break;case Ur:e.y=e.y<0?0:1;break;case Sh: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 cc("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Fn?$a:xE}set encoding(e){cc("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===$a?Fn:Ri}}In.DEFAULT_IMAGE=null;In.DEFAULT_MAPPING=q0;In.DEFAULT_ANISOTROPY=1;class on{constructor(e=0,t=0,r=0,i=1){on.prototype.isVector4=!0,this.x=e,this.y=t,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,r,i){return this.x=e,this.y=t,this.z=r,this.w=i,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,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;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,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,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,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.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 t=this.x,r=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*r+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*r+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*r+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*r+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,r,i,s;const l=e.elements,u=l[0],f=l[4],h=l[8],p=l[1],m=l[5],v=l[9],w=l[2],x=l[6],g=l[10];if(Math.abs(f-p)<.01&&Math.abs(h-w)<.01&&Math.abs(v-x)<.01){if(Math.abs(f+p)<.1&&Math.abs(h+w)<.1&&Math.abs(v+x)<.1&&Math.abs(u+m+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const _=(u+1)/2,b=(m+1)/2,A=(g+1)/2,R=(f+p)/4,P=(h+w)/4,D=(v+x)/4;return _>b&&_>A?_<.01?(r=0,i=.707106781,s=.707106781):(r=Math.sqrt(_),i=R/r,s=P/r):b>A?b<.01?(r=.707106781,i=0,s=.707106781):(i=Math.sqrt(b),r=R/i,s=D/i):A<.01?(r=.707106781,i=.707106781,s=0):(s=Math.sqrt(A),r=P/s,i=D/s),this.set(r,i,s,t),this}let S=Math.sqrt((x-v)*(x-v)+(h-w)*(h-w)+(p-f)*(p-f));return Math.abs(S)<.001&&(S=1),this.x=(x-v)/S,this.y=(h-w)/S,this.z=(p-f)/S,this.w=Math.acos((u+m+g-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,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this.w=e.w+(t.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),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 F3 extends po{constructor(e=1,t=1,r={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new on(0,0,e,t),this.scissorTest=!1,this.viewport=new on(0,0,e,t);const i={width:e,height:t,depth:1};r.encoding!==void 0&&(cc("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),r.colorSpace=r.encoding===$a?Fn:Ri),r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:fn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},r),this.texture=new In(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps,this.texture.internalFormat=r.internalFormat,this.depthBuffer=r.depthBuffer,this.stencilBuffer=r.stencilBuffer,this.depthTexture=r.depthTexture,this.samples=r.samples}setSize(e,t,r=1){(this.width!==e||this.height!==t||this.depth!==r)&&(this.width=e,this.height=t,this.depth=r,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}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 t=Object.assign({},e.texture.image);return this.texture.source=new Xl(t),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 gi extends F3{constructor(e=1,t=1,r={}){super(e,t,r),this.isWebGLRenderTarget=!0}}class K0 extends In{constructor(e=null,t=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=Gn,this.minFilter=Gn,this.wrapR=Ur,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Y4 extends gi{constructor(e=1,t=1,r=1,i={}){super(e,t,i),this.isWebGLArrayRenderTarget=!0,this.depth=r,this.texture=new K0(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class EE extends In{constructor(e=null,t=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=Gn,this.minFilter=Gn,this.wrapR=Ur,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Z4 extends gi{constructor(e=1,t=1,r=1,i={}){super(e,t,i),this.isWebGL3DRenderTarget=!0,this.depth=r,this.texture=new EE(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class K4 extends gi{constructor(e=1,t=1,r=1,i={}){super(e,t,i),this.isWebGLMultipleRenderTargets=!0;const s=this.texture;this.texture=[];for(let o=0;o=0?1:-1,_=1-g*g;if(_>Number.EPSILON){const A=Math.sqrt(_),R=Math.atan2(A,g*S);x=Math.sin(x*R)/A,a=Math.sin(a*R)/A}const b=a*S;if(l=l*x+p*b,u=u*x+m*b,f=f*x+v*b,h=h*x+w*b,x===1-a){const A=1/Math.sqrt(l*l+u*u+f*f+h*h);l*=A,u*=A,f*=A,h*=A}}e[t]=l,e[t+1]=u,e[t+2]=f,e[t+3]=h}static multiplyQuaternionsFlat(e,t,r,i,s,o){const a=r[i],l=r[i+1],u=r[i+2],f=r[i+3],h=s[o],p=s[o+1],m=s[o+2],v=s[o+3];return e[t]=a*v+f*h+l*m-u*p,e[t+1]=l*v+f*p+u*h-a*m,e[t+2]=u*v+f*m+a*p-l*h,e[t+3]=f*v-a*h-l*p-u*m,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,t,r,i){return this._x=e,this._y=t,this._z=r,this._w=i,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,t=!0){const r=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,u=a(r/2),f=a(i/2),h=a(s/2),p=l(r/2),m=l(i/2),v=l(s/2);switch(o){case"XYZ":this._x=p*f*h+u*m*v,this._y=u*m*h-p*f*v,this._z=u*f*v+p*m*h,this._w=u*f*h-p*m*v;break;case"YXZ":this._x=p*f*h+u*m*v,this._y=u*m*h-p*f*v,this._z=u*f*v-p*m*h,this._w=u*f*h+p*m*v;break;case"ZXY":this._x=p*f*h-u*m*v,this._y=u*m*h+p*f*v,this._z=u*f*v+p*m*h,this._w=u*f*h-p*m*v;break;case"ZYX":this._x=p*f*h-u*m*v,this._y=u*m*h+p*f*v,this._z=u*f*v-p*m*h,this._w=u*f*h+p*m*v;break;case"YZX":this._x=p*f*h+u*m*v,this._y=u*m*h+p*f*v,this._z=u*f*v-p*m*h,this._w=u*f*h-p*m*v;break;case"XZY":this._x=p*f*h-u*m*v,this._y=u*m*h-p*f*v,this._z=u*f*v+p*m*h,this._w=u*f*h+p*m*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const r=t/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,r=t[0],i=t[4],s=t[8],o=t[1],a=t[5],l=t[9],u=t[2],f=t[6],h=t[10],p=r+a+h;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(f-l)*m,this._y=(s-u)*m,this._z=(o-i)*m}else if(r>a&&r>h){const m=2*Math.sqrt(1+r-a-h);this._w=(f-l)/m,this._x=.25*m,this._y=(i+o)/m,this._z=(s+u)/m}else if(a>h){const m=2*Math.sqrt(1+a-r-h);this._w=(s-u)/m,this._x=(i+o)/m,this._y=.25*m,this._z=(l+f)/m}else{const m=2*Math.sqrt(1+h-r-a);this._w=(o-i)/m,this._x=(s+u)/m,this._y=(l+f)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(zn(this.dot(e),-1,1)))}rotateTowards(e,t){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,t/r);return this.slerp(e,i),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,t){const r=e._x,i=e._y,s=e._z,o=e._w,a=t._x,l=t._y,u=t._z,f=t._w;return this._x=r*f+o*a+i*u-s*l,this._y=i*f+o*l+s*a-r*u,this._z=s*f+o*u+r*l-i*a,this._w=o*f-r*a-i*l-s*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const r=this._x,i=this._y,s=this._z,o=this._w;let a=o*e._w+r*e._x+i*e._y+s*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=o,this._x=r,this._y=i,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-t;return this._w=m*o+t*this._w,this._x=m*r+t*this._x,this._y=m*i+t*this._y,this._z=m*s+t*this._z,this.normalize(),this}const u=Math.sqrt(l),f=Math.atan2(u,a),h=Math.sin((1-t)*f)/u,p=Math.sin(t*f)/u;return this._w=o*h+this._w*p,this._x=r*h+this._x*p,this._y=i*h+this._y*p,this._z=s*h+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){const e=Math.random(),t=Math.sqrt(1-e),r=Math.sqrt(e),i=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(i),r*Math.sin(s),r*Math.cos(s),t*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),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 F{constructor(e=0,t=0,r=0){F.prototype.isVector3=!0,this.x=e,this.y=t,this.z=r}set(e,t,r){return r===void 0&&(r=this.z),this.x=e,this.y=t,this.z=r,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,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;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,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,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,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.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,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(yC.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(yC.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*r+s[6]*i,this.y=s[1]*t+s[4]*r+s[7]*i,this.z=s[2]*t+s[5]*r+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,r=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*r+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*r+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*r+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*r+s[10]*i+s[14])*o,this}applyQuaternion(e){const t=this.x,r=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,u=2*(o*i-a*r),f=2*(a*t-s*i),h=2*(s*r-o*t);return this.x=t+l*u+o*h-a*f,this.y=r+l*f+a*u-s*h,this.z=i+l*h+s*f-o*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 t=this.x,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*r+s[8]*i,this.y=s[1]*t+s[5]*r+s[9]*i,this.z=s[2]*t+s[6]*r+s[10]*i,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,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const r=e.x,i=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-s*a,this.y=s*o-r*l,this.z=r*a-i*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return a_.copy(this).projectOnVector(e),this.sub(a_)}reflect(e){return this.sub(a_.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(zn(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return t*t+r*r+i*i}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,t,r){const i=Math.sin(t)*e;return this.x=i*Math.sin(r),this.y=Math.cos(t)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*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,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,r=Math.sqrt(1-e**2);return this.x=r*Math.cos(t),this.y=r*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const a_=new F,yC=new Br;class Qr{constructor(e=new F(1/0,1/0,1/0),t=new F(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,r=e.length;tthis.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,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(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,ms),ms.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Mf),ng.subVectors(this.max,Mf),ou.subVectors(e.a,Mf),au.subVectors(e.b,Mf),lu.subVectors(e.c,Mf),pa.subVectors(au,ou),ma.subVectors(lu,au),Cl.subVectors(ou,lu);let t=[0,-pa.z,pa.y,0,-ma.z,ma.y,0,-Cl.z,Cl.y,pa.z,0,-pa.x,ma.z,0,-ma.x,Cl.z,0,-Cl.x,-pa.y,pa.x,0,-ma.y,ma.x,0,-Cl.y,Cl.x,0];return!l_(t,ou,au,lu,ng)||(t=[1,0,0,0,1,0,0,0,1],!l_(t,ou,au,lu,ng))?!1:(rg.crossVectors(pa,ma),t=[rg.x,rg.y,rg.z],l_(t,ou,au,lu,ng))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ms).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(ms).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:(wo[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),wo[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),wo[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),wo[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),wo[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),wo[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),wo[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),wo[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(wo),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 wo=[new F,new F,new F,new F,new F,new F,new F,new F],ms=new F,tg=new Qr,ou=new F,au=new F,lu=new F,pa=new F,ma=new F,Cl=new F,Mf=new F,ng=new F,rg=new F,Al=new F;function l_(n,e,t,r,i){for(let s=0,o=n.length-3;s<=o;s+=3){Al.fromArray(n,s);const a=i.x*Math.abs(Al.x)+i.y*Math.abs(Al.y)+i.z*Math.abs(Al.z),l=e.dot(Al),u=t.dot(Al),f=r.dot(Al);if(Math.max(-Math.max(l,u,f),Math.min(l,u,f))>a)return!1}return!0}const Q4=new Qr,bf=new F,c_=new F;class Vr{constructor(e=new F,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const r=this.center;t!==void 0?r.copy(t):Q4.setFromPoints(e).getCenter(r);let i=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}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;bf.subVectors(e,this.center);const t=bf.lengthSq();if(t>this.radius*this.radius){const r=Math.sqrt(t),i=(r-this.radius)*.5;this.center.addScaledVector(bf,i/r),this.radius+=i}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):(c_.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(bf.copy(e.center).add(c_)),this.expandByPoint(bf.copy(e.center).sub(c_))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Eo=new F,u_=new F,ig=new F,ga=new F,d_=new F,sg=new F,f_=new F;class Pc{constructor(e=new F,t=new F(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.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,Eo)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Eo.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Eo.copy(this.origin).addScaledVector(this.direction,t),Eo.distanceToSquared(e))}distanceSqToSegment(e,t,r,i){u_.copy(e).add(t).multiplyScalar(.5),ig.copy(t).sub(e).normalize(),ga.copy(this.origin).sub(u_);const s=e.distanceTo(t)*.5,o=-this.direction.dot(ig),a=ga.dot(this.direction),l=-ga.dot(ig),u=ga.lengthSq(),f=Math.abs(1-o*o);let h,p,m,v;if(f>0)if(h=o*l-a,p=o*a-l,v=s*f,h>=0)if(p>=-v)if(p<=v){const w=1/f;h*=w,p*=w,m=h*(h+o*p+2*a)+p*(o*h+p+2*l)+u}else p=s,h=Math.max(0,-(o*p+a)),m=-h*h+p*(p+2*l)+u;else p=-s,h=Math.max(0,-(o*p+a)),m=-h*h+p*(p+2*l)+u;else p<=-v?(h=Math.max(0,-(-o*s+a)),p=h>0?-s:Math.min(Math.max(-s,-l),s),m=-h*h+p*(p+2*l)+u):p<=v?(h=0,p=Math.min(Math.max(-s,-l),s),m=p*(p+2*l)+u):(h=Math.max(0,-(o*s+a)),p=h>0?s:Math.min(Math.max(-s,-l),s),m=-h*h+p*(p+2*l)+u);else p=o>0?-s:s,h=Math.max(0,-(o*p+a)),m=-h*h+p*(p+2*l)+u;return r&&r.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(u_).addScaledVector(ig,p),m}intersectSphere(e,t){Eo.subVectors(e.center,this.origin);const r=Eo.dot(this.direction),i=Eo.dot(Eo)-r*r,s=e.radius*e.radius;if(i>s)return null;const o=Math.sqrt(s-i),a=r-o,l=r+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){const r=this.distanceToPlane(e);return r===null?null:this.at(r,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let r,i,s,o,a,l;const u=1/this.direction.x,f=1/this.direction.y,h=1/this.direction.z,p=this.origin;return u>=0?(r=(e.min.x-p.x)*u,i=(e.max.x-p.x)*u):(r=(e.max.x-p.x)*u,i=(e.min.x-p.x)*u),f>=0?(s=(e.min.y-p.y)*f,o=(e.max.y-p.y)*f):(s=(e.max.y-p.y)*f,o=(e.min.y-p.y)*f),r>o||s>i||((s>r||isNaN(r))&&(r=s),(o=0?(a=(e.min.z-p.z)*h,l=(e.max.z-p.z)*h):(a=(e.max.z-p.z)*h,l=(e.min.z-p.z)*h),r>l||a>i)||((a>r||r!==r)&&(r=a),(l=0?r:i,t)}intersectsBox(e){return this.intersectBox(e,Eo)!==null}intersectTriangle(e,t,r,i,s){d_.subVectors(t,e),sg.subVectors(r,e),f_.crossVectors(d_,sg);let o=this.direction.dot(f_),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ga.subVectors(this.origin,e);const l=a*this.direction.dot(sg.crossVectors(ga,sg));if(l<0)return null;const u=a*this.direction.dot(d_.cross(ga));if(u<0||l+u>o)return null;const f=-a*ga.dot(f_);return f<0?null:this.at(f/o,s)}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 _t{constructor(e,t,r,i,s,o,a,l,u,f,h,p,m,v,w,x){_t.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,t,r,i,s,o,a,l,u,f,h,p,m,v,w,x)}set(e,t,r,i,s,o,a,l,u,f,h,p,m,v,w,x){const g=this.elements;return g[0]=e,g[4]=t,g[8]=r,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=u,g[6]=f,g[10]=h,g[14]=p,g[3]=m,g[7]=v,g[11]=w,g[15]=x,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 _t().fromArray(this.elements)}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){const t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,r=e.elements,i=1/cu.setFromMatrixColumn(e,0).length(),s=1/cu.setFromMatrixColumn(e,1).length(),o=1/cu.setFromMatrixColumn(e,2).length();return t[0]=r[0]*i,t[1]=r[1]*i,t[2]=r[2]*i,t[3]=0,t[4]=r[4]*s,t[5]=r[5]*s,t[6]=r[6]*s,t[7]=0,t[8]=r[8]*o,t[9]=r[9]*o,t[10]=r[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,r=e.x,i=e.y,s=e.z,o=Math.cos(r),a=Math.sin(r),l=Math.cos(i),u=Math.sin(i),f=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const p=o*f,m=o*h,v=a*f,w=a*h;t[0]=l*f,t[4]=-l*h,t[8]=u,t[1]=m+v*u,t[5]=p-w*u,t[9]=-a*l,t[2]=w-p*u,t[6]=v+m*u,t[10]=o*l}else if(e.order==="YXZ"){const p=l*f,m=l*h,v=u*f,w=u*h;t[0]=p+w*a,t[4]=v*a-m,t[8]=o*u,t[1]=o*h,t[5]=o*f,t[9]=-a,t[2]=m*a-v,t[6]=w+p*a,t[10]=o*l}else if(e.order==="ZXY"){const p=l*f,m=l*h,v=u*f,w=u*h;t[0]=p-w*a,t[4]=-o*h,t[8]=v+m*a,t[1]=m+v*a,t[5]=o*f,t[9]=w-p*a,t[2]=-o*u,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const p=o*f,m=o*h,v=a*f,w=a*h;t[0]=l*f,t[4]=v*u-m,t[8]=p*u+w,t[1]=l*h,t[5]=w*u+p,t[9]=m*u-v,t[2]=-u,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const p=o*l,m=o*u,v=a*l,w=a*u;t[0]=l*f,t[4]=w-p*h,t[8]=v*h+m,t[1]=h,t[5]=o*f,t[9]=-a*f,t[2]=-u*f,t[6]=m*h+v,t[10]=p-w*h}else if(e.order==="XZY"){const p=o*l,m=o*u,v=a*l,w=a*u;t[0]=l*f,t[4]=-h,t[8]=u*f,t[1]=p*h+w,t[5]=o*f,t[9]=m*h-v,t[2]=v*h-m,t[6]=a*f,t[10]=w*h+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(J4,e,e5)}lookAt(e,t,r){const i=this.elements;return Ei.subVectors(e,t),Ei.lengthSq()===0&&(Ei.z=1),Ei.normalize(),va.crossVectors(r,Ei),va.lengthSq()===0&&(Math.abs(r.z)===1?Ei.x+=1e-4:Ei.z+=1e-4,Ei.normalize(),va.crossVectors(r,Ei)),va.normalize(),og.crossVectors(Ei,va),i[0]=va.x,i[4]=og.x,i[8]=Ei.x,i[1]=va.y,i[5]=og.y,i[9]=Ei.y,i[2]=va.z,i[6]=og.z,i[10]=Ei.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,i=t.elements,s=this.elements,o=r[0],a=r[4],l=r[8],u=r[12],f=r[1],h=r[5],p=r[9],m=r[13],v=r[2],w=r[6],x=r[10],g=r[14],S=r[3],_=r[7],b=r[11],A=r[15],R=i[0],P=i[4],D=i[8],V=i[12],C=i[1],L=i[5],W=i[9],Q=i[13],z=i[2],j=i[6],Y=i[10],re=i[14],U=i[3],X=i[7],q=i[11],K=i[15];return s[0]=o*R+a*C+l*z+u*U,s[4]=o*P+a*L+l*j+u*X,s[8]=o*D+a*W+l*Y+u*q,s[12]=o*V+a*Q+l*re+u*K,s[1]=f*R+h*C+p*z+m*U,s[5]=f*P+h*L+p*j+m*X,s[9]=f*D+h*W+p*Y+m*q,s[13]=f*V+h*Q+p*re+m*K,s[2]=v*R+w*C+x*z+g*U,s[6]=v*P+w*L+x*j+g*X,s[10]=v*D+w*W+x*Y+g*q,s[14]=v*V+w*Q+x*re+g*K,s[3]=S*R+_*C+b*z+A*U,s[7]=S*P+_*L+b*j+A*X,s[11]=S*D+_*W+b*Y+A*q,s[15]=S*V+_*Q+b*re+A*K,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],u=e[13],f=e[2],h=e[6],p=e[10],m=e[14],v=e[3],w=e[7],x=e[11],g=e[15];return v*(+s*l*h-i*u*h-s*a*p+r*u*p+i*a*m-r*l*m)+w*(+t*l*m-t*u*p+s*o*p-i*o*m+i*u*f-s*l*f)+x*(+t*u*h-t*a*m-s*o*h+r*o*m+s*a*f-r*u*f)+g*(-i*a*f-t*l*h+t*a*p+i*o*h-r*o*p+r*l*f)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=r),this}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],f=e[8],h=e[9],p=e[10],m=e[11],v=e[12],w=e[13],x=e[14],g=e[15],S=h*x*u-w*p*u+w*l*m-a*x*m-h*l*g+a*p*g,_=v*p*u-f*x*u-v*l*m+o*x*m+f*l*g-o*p*g,b=f*w*u-v*h*u+v*a*m-o*w*m-f*a*g+o*h*g,A=v*h*l-f*w*l-v*a*p+o*w*p+f*a*x-o*h*x,R=t*S+r*_+i*b+s*A;if(R===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/R;return e[0]=S*P,e[1]=(w*p*s-h*x*s-w*i*m+r*x*m+h*i*g-r*p*g)*P,e[2]=(a*x*s-w*l*s+w*i*u-r*x*u-a*i*g+r*l*g)*P,e[3]=(h*l*s-a*p*s-h*i*u+r*p*u+a*i*m-r*l*m)*P,e[4]=_*P,e[5]=(f*x*s-v*p*s+v*i*m-t*x*m-f*i*g+t*p*g)*P,e[6]=(v*l*s-o*x*s-v*i*u+t*x*u+o*i*g-t*l*g)*P,e[7]=(o*p*s-f*l*s+f*i*u-t*p*u-o*i*m+t*l*m)*P,e[8]=b*P,e[9]=(v*h*s-f*w*s-v*r*m+t*w*m+f*r*g-t*h*g)*P,e[10]=(o*w*s-v*a*s+v*r*u-t*w*u-o*r*g+t*a*g)*P,e[11]=(f*a*s-o*h*s-f*r*u+t*h*u+o*r*m-t*a*m)*P,e[12]=A*P,e[13]=(f*w*i-v*h*i+v*r*p-t*w*p-f*r*x+t*h*x)*P,e[14]=(v*a*i-o*w*i-v*r*l+t*w*l+o*r*x-t*a*x)*P,e[15]=(o*h*i-f*a*i+f*r*l-t*h*l-o*r*p+t*a*p)*P,this}scale(e){const t=this.elements,r=e.x,i=e.y,s=e.z;return t[0]*=r,t[4]*=i,t[8]*=s,t[1]*=r,t[5]*=i,t[9]*=s,t[2]*=r,t[6]*=i,t[10]*=s,t[3]*=r,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,i))}makeTranslation(e,t,r){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,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const r=Math.cos(t),i=Math.sin(t),s=1-r,o=e.x,a=e.y,l=e.z,u=s*o,f=s*a;return this.set(u*o+r,u*a-i*l,u*l+i*a,0,u*a+i*l,f*a+r,f*l-i*o,0,u*l-i*a,f*l+i*o,s*l*l+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,i,s,o){return this.set(1,r,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,r){const i=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,u=s+s,f=o+o,h=a+a,p=s*u,m=s*f,v=s*h,w=o*f,x=o*h,g=a*h,S=l*u,_=l*f,b=l*h,A=r.x,R=r.y,P=r.z;return i[0]=(1-(w+g))*A,i[1]=(m+b)*A,i[2]=(v-_)*A,i[3]=0,i[4]=(m-b)*R,i[5]=(1-(p+g))*R,i[6]=(x+S)*R,i[7]=0,i[8]=(v+_)*P,i[9]=(x-S)*P,i[10]=(1-(p+w))*P,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,r){const i=this.elements;let s=cu.set(i[0],i[1],i[2]).length();const o=cu.set(i[4],i[5],i[6]).length(),a=cu.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],gs.copy(this);const u=1/s,f=1/o,h=1/a;return gs.elements[0]*=u,gs.elements[1]*=u,gs.elements[2]*=u,gs.elements[4]*=f,gs.elements[5]*=f,gs.elements[6]*=f,gs.elements[8]*=h,gs.elements[9]*=h,gs.elements[10]*=h,t.setFromRotationMatrix(gs),r.x=s,r.y=o,r.z=a,this}makePerspective(e,t,r,i,s,o,a=ro){const l=this.elements,u=2*s/(t-e),f=2*s/(r-i),h=(t+e)/(t-e),p=(r+i)/(r-i);let m,v;if(a===ro)m=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===Rh)m=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=u,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=f,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=v,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,r,i,s,o,a=ro){const l=this.elements,u=1/(t-e),f=1/(r-i),h=1/(o-s),p=(t+e)*u,m=(r+i)*f;let v,w;if(a===ro)v=(o+s)*h,w=-2*h;else if(a===Rh)v=s*h,w=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-p,l[1]=0,l[5]=2*f,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=w,l[14]=-v,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,r=e.elements;for(let i=0;i<16;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}const cu=new F,gs=new _t,J4=new F(0,0,0),e5=new F(1,1,1),va=new F,og=new F,Ei=new F,xC=new _t,_C=new Br;class zp{constructor(e=0,t=0,r=0,i=zp.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=r,this._order=i}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,t,r,i=this._order){return this._x=e,this._y=t,this._z=r,this._order=i,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,t=this._order,r=!0){const i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],u=i[5],f=i[9],h=i[2],p=i[6],m=i[10];switch(t){case"XYZ":this._y=Math.asin(zn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-f,m),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-zn(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(zn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-h,m),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-zn(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(zn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-f,u),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-zn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-f,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return xC.makeRotationFromQuaternion(e),this.setFromRotationMatrix(xC,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return _C.setFromEuler(this),this.setFromQuaternion(_C,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=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+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}}zp.DEFAULT_ORDER="XYZ";class uc{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let r=0;r0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.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()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(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,f=l.length;u0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(r.geometries=a),l.length>0&&(r.materials=l),u.length>0&&(r.textures=u),f.length>0&&(r.images=f),h.length>0&&(r.shapes=h),p.length>0&&(r.skeletons=p),m.length>0&&(r.animations=m),v.length>0&&(r.nodes=v)}return r.object=i,r;function o(a){const l=[];for(const u in a){const f=a[u];delete f.metadata,l.push(f)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!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)),t===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,r,i,s){vs.subVectors(i,t),bo.subVectors(r,t),h_.subVectors(e,t);const o=vs.dot(vs),a=vs.dot(bo),l=vs.dot(h_),u=bo.dot(bo),f=bo.dot(h_),h=o*u-a*a;if(h===0)return s.set(0,0,0),null;const p=1/h,m=(u*l-a*f)*p,v=(o*f-a*l)*p;return s.set(1-m-v,v,m)}static containsPoint(e,t,r,i){return this.getBarycoord(e,t,r,i,To)===null?!1:To.x>=0&&To.y>=0&&To.x+To.y<=1}static getInterpolation(e,t,r,i,s,o,a,l){return this.getBarycoord(e,t,r,i,To)===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(s,To.x),l.addScaledVector(o,To.y),l.addScaledVector(a,To.z),l)}static isFrontFacing(e,t,r,i){return vs.subVectors(r,t),bo.subVectors(e,t),vs.cross(bo).dot(i)<0}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,i){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,r,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),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 vs.subVectors(this.c,this.b),bo.subVectors(this.a,this.b),vs.cross(bo).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Pi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Pi.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,r,i,s){return Pi.getInterpolation(e,this.a,this.b,this.c,t,r,i,s)}containsPoint(e){return Pi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Pi.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const r=this.a,i=this.b,s=this.c;let o,a;du.subVectors(i,r),fu.subVectors(s,r),p_.subVectors(e,r);const l=du.dot(p_),u=fu.dot(p_);if(l<=0&&u<=0)return t.copy(r);m_.subVectors(e,i);const f=du.dot(m_),h=fu.dot(m_);if(f>=0&&h<=f)return t.copy(i);const p=l*h-f*u;if(p<=0&&l>=0&&f<=0)return o=l/(l-f),t.copy(r).addScaledVector(du,o);g_.subVectors(e,s);const m=du.dot(g_),v=fu.dot(g_);if(v>=0&&m<=v)return t.copy(s);const w=m*u-l*v;if(w<=0&&u>=0&&v<=0)return a=u/(u-v),t.copy(r).addScaledVector(fu,a);const x=f*v-m*h;if(x<=0&&h-f>=0&&m-v>=0)return bC.subVectors(s,i),a=(h-f)/(h-f+(m-v)),t.copy(i).addScaledVector(bC,a);const g=1/(x+w+p);return o=w*g,a=p*g,t.copy(r).addScaledVector(du,o).addScaledVector(fu,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const z3={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},ya={h:0,s:0,l:0},lg={h:0,s:0,l:0};function v_(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class Be{constructor(e,t,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,r)}set(e,t,r){if(t===void 0&&r===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Fn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,cn.toWorkingColorSpace(this,t),this}setRGB(e,t,r,i=cn.workingColorSpace){return this.r=e,this.g=t,this.b=r,cn.toWorkingColorSpace(this,i),this}setHSL(e,t,r,i=cn.workingColorSpace){if(e=SE(e,1),t=zn(t,0,1),r=zn(r,0,1),t===0)this.r=this.g=this.b=r;else{const s=r<=.5?r*(1+t):r+t-r*t,o=2*r-s;this.r=v_(o,s,e+1/3),this.g=v_(o,s,e),this.b=v_(o,s,e-1/3)}return cn.toWorkingColorSpace(this,i),this}setStyle(e,t=Fn){function r(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=i[1],a=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Fn){const r=z3[e.toLowerCase()];return r!==void 0?this.setHex(r,t):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=Ju(e.r),this.g=Ju(e.g),this.b=Ju(e.b),this}copyLinearToSRGB(e){return this.r=s_(e.r),this.g=s_(e.g),this.b=s_(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Fn){return cn.fromWorkingColorSpace(Ir.copy(this),e),Math.round(zn(Ir.r*255,0,255))*65536+Math.round(zn(Ir.g*255,0,255))*256+Math.round(zn(Ir.b*255,0,255))}getHexString(e=Fn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=cn.workingColorSpace){cn.fromWorkingColorSpace(Ir.copy(this),t);const r=Ir.r,i=Ir.g,s=Ir.b,o=Math.max(r,i,s),a=Math.min(r,i,s);let l,u;const f=(a+o)/2;if(a===o)l=0,u=0;else{const h=o-a;switch(u=f<=.5?h/(o+a):h/(2-o-a),o){case r:l=(i-s)/h+(i0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const r=e[t];if(r===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[t]=r}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const r={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==ac&&(r.blending=this.blending),this.side!==$o&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==Wv&&(r.blendSrc=this.blendSrc),this.blendDst!==Gv&&(r.blendDst=this.blendDst),this.blendEquation!==Ra&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==vh&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==v1&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==zl&&(r.stencilFail=this.stencilFail),this.stencilZFail!==zl&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==zl&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.wireframe===!0&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=i(e.textures),o=i(e.images);s.length>0&&(r.textures=s),o.length>0&&(r.images=o)}return r}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 t=e.clippingPlanes;let r=null;if(t!==null){const i=t.length;r=new Array(i);for(let s=0;s!==i;++s)r[s]=t[s].clone()}return this.clippingPlanes=r,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 fl extends br{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Be(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=kp,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 Do=a5();function a5(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),r=new Uint32Array(512),i=new Uint32Array(512);for(let l=0;l<256;++l){const u=l-127;u<-27?(r[l]=0,r[l|256]=32768,i[l]=24,i[l|256]=24):u<-14?(r[l]=1024>>-u-14,r[l|256]=1024>>-u-14|32768,i[l]=-u-1,i[l|256]=-u-1):u<=15?(r[l]=u+15<<10,r[l|256]=u+15<<10|32768,i[l]=13,i[l|256]=13):u<128?(r[l]=31744,r[l|256]=64512,i[l]=24,i[l|256]=24):(r[l]=31744,r[l|256]=64512,i[l]=13,i[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let u=l<<13,f=0;for(;!(u&8388608);)u<<=1,f-=8388608;u&=-8388609,f+=947912704,s[l]=u|f}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:r,shiftTable:i,mantissaTable:s,exponentTable:o,offsetTable:a}}function ai(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=zn(n,-65504,65504),Do.floatView[0]=n;const e=Do.uint32View[0],t=e>>23&511;return Do.baseTable[t]+((e&8388607)>>Do.shiftTable[t])}function Yf(n){const e=n>>10;return Do.uint32View[0]=Do.mantissaTable[Do.offsetTable[e]+(n&1023)]+Do.exponentTable[e],Do.floatView[0]}const l5={toHalfFloat:ai,fromHalfFloat:Yf},Kn=new F,cg=new ge;class an{constructor(e,t,r=!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=t,this.count=e!==void 0?e.length/t:0,this.normalized=r,this.usage=Ah,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=is,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return cc("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,t){this.updateRanges.push({start:e,count:t})}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,t,r){e*=this.itemSize,r*=t.itemSize;for(let i=0,s=this.itemSize;i0&&(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 t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const r=this.attributes;for(const l in r){const u=r[l];e.data.attributes[l]=u.toJSON(e.data)}const i={};let s=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],f=[];for(let h=0,p=u.length;h0&&(i[l]=f,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));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 t={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone(t));const i=e.attributes;for(const u in i){const f=i[u];this.setAttribute(u,f.clone(t))}const s=e.morphAttributes;for(const u in s){const f=[],h=s[u];for(let p=0,m=h.length;p0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s(e.far-e.near)**2))&&(TC.copy(s).invert(),Rl.copy(e.ray).applyMatrix4(TC),!(r.boundingBox!==null&&Rl.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,t,Rl)))}_computeIntersections(e,t,r){let i;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,u=s.attributes.uv,f=s.attributes.uv1,h=s.attributes.normal,p=s.groups,m=s.drawRange;if(a!==null)if(Array.isArray(o))for(let v=0,w=p.length;vt.far?null:{distance:u,point:gg.clone(),object:n}}function vg(n,e,t,r,i,s,o,a,l,u){n.getVertexPosition(a,pu),n.getVertexPosition(l,mu),n.getVertexPosition(u,gu);const f=v5(n,e,t,r,pu,mu,gu,mg);if(f){i&&(fg.fromBufferAttribute(i,a),hg.fromBufferAttribute(i,l),pg.fromBufferAttribute(i,u),f.uv=Pi.getInterpolation(mg,pu,mu,gu,fg,hg,pg,new ge)),s&&(fg.fromBufferAttribute(s,a),hg.fromBufferAttribute(s,l),pg.fromBufferAttribute(s,u),f.uv1=Pi.getInterpolation(mg,pu,mu,gu,fg,hg,pg,new ge),f.uv2=f.uv1),o&&(AC.fromBufferAttribute(o,a),RC.fromBufferAttribute(o,l),PC.fromBufferAttribute(o,u),f.normal=Pi.getInterpolation(mg,pu,mu,gu,AC,RC,PC,new F),f.normal.dot(r.direction)>0&&f.normal.multiplyScalar(-1));const h={a,b:l,c:u,normal:new F,materialIndex:0};Pi.getNormal(pu,mu,gu,h.normal),f.face=h}return f}class Ic extends Ut{constructor(e=1,t=1,r=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:r,widthSegments:i,heightSegments:s,depthSegments:o};const a=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);const l=[],u=[],f=[],h=[];let p=0,m=0;v("z","y","x",-1,-1,r,t,e,o,s,0),v("z","y","x",1,-1,r,t,-e,o,s,1),v("x","z","y",1,1,e,r,t,i,o,2),v("x","z","y",1,-1,e,r,-t,i,o,3),v("x","y","z",1,-1,e,t,r,i,s,4),v("x","y","z",-1,-1,e,t,-r,i,s,5),this.setIndex(l),this.setAttribute("position",new ot(u,3)),this.setAttribute("normal",new ot(f,3)),this.setAttribute("uv",new ot(h,2));function v(w,x,g,S,_,b,A,R,P,D,V){const C=b/P,L=A/D,W=b/2,Q=A/2,z=R/2,j=P+1,Y=D+1;let re=0,U=0;const X=new F;for(let q=0;q0?1:-1,f.push(X.x,X.y,X.z),h.push(se/P),h.push(1-q/D),re+=1}}for(let q=0;q>8&255]+Pr[n>>16&255]+Pr[n>>24&255]+"-"+Pr[e&255]+Pr[e>>8&255]+"-"+Pr[e>>16&15|64]+Pr[e>>24&255]+"-"+Pr[t&63|128]+Pr[t>>8&255]+"-"+Pr[t>>16&255]+Pr[t>>24&255]+Pr[r&255]+Pr[r>>8&255]+Pr[r>>16&255]+Pr[r>>24&255]).toLowerCase()}function zn(n,e,t){return Math.max(e,Math.min(t,n))}function EE(n,e){return(n%e+e)%e}function U4(n,e,t,r,i){return r+(n-e)*(i-r)/(t-e)}function F4(n,e,t){return n!==e?(t-n)/(e-n):0}function sh(n,e,t){return(1-t)*n+t*e}function z4(n,e,t,r){return sh(n,e,1-Math.exp(-t*r))}function B4(n,e=1){return e-Math.abs(EE(n,e*2)-e)}function V4(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function H4(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function $4(n,e){return n+Math.floor(Math.random()*(e-n+1))}function W4(n,e){return n+Math.random()*(e-n)}function G4(n){return n*(.5-Math.random())}function j4(n){n!==void 0&&(pC=n);let e=pC+=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 X4(n){return n*uc}function q4(n){return n*Td}function S1(n){return(n&n-1)===0&&n!==0}function Y4(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Zv(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function Z4(n,e,t,r,i){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),u=s((e+r)/2),f=o((e+r)/2),h=s((e-r)/2),p=o((e-r)/2),m=s((r-e)/2),v=o((r-e)/2);switch(i){case"XYX":n.set(a*f,l*h,l*p,a*u);break;case"YZY":n.set(l*p,a*f,l*h,a*u);break;case"ZXZ":n.set(l*h,l*p,a*f,a*u);break;case"XZX":n.set(a*f,l*v,l*m,a*u);break;case"YXY":n.set(l*m,a*f,l*v,a*u);break;case"ZYZ":n.set(l*v,l*m,a*f,a*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Zr(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Ot(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const k3={DEG2RAD:uc,RAD2DEG:Td,generateUUID:Li,clamp:zn,euclideanModulo:EE,mapLinear:U4,inverseLerp:F4,lerp:sh,damp:z4,pingpong:B4,smoothstep:V4,smootherstep:H4,randInt:$4,randFloat:W4,randFloatSpread:G4,seededRandom:j4,degToRad:X4,radToDeg:q4,isPowerOfTwo:S1,ceilPowerOfTwo:Y4,floorPowerOfTwo:Zv,setQuaternionFromProperEuler:Z4,normalize:Ot,denormalize:Zr};class ge{constructor(e=0,t=0){ge.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,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,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;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,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,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,t){return this.x=e.x-t.x,this.y=e.y-t.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 t=this.x,r=this.y,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6],this.y=i[1]*t+i[4]*r+i[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,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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 t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(zn(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const r=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*r-o*i+e.x,this.y=s*i+o*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Vt{constructor(e,t,r,i,s,o,a,l,u){Vt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,r,i,s,o,a,l,u)}set(e,t,r,i,s,o,a,l,u){const f=this.elements;return f[0]=e,f[1]=i,f[2]=a,f[3]=t,f[4]=s,f[5]=l,f[6]=r,f[7]=o,f[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,i=t.elements,s=this.elements,o=r[0],a=r[3],l=r[6],u=r[1],f=r[4],h=r[7],p=r[2],m=r[5],v=r[8],w=i[0],x=i[3],g=i[6],S=i[1],_=i[4],b=i[7],A=i[2],R=i[5],P=i[8];return s[0]=o*w+a*S+l*A,s[3]=o*x+a*_+l*R,s[6]=o*g+a*b+l*P,s[1]=u*w+f*S+h*A,s[4]=u*x+f*_+h*R,s[7]=u*g+f*b+h*P,s[2]=p*w+m*S+v*A,s[5]=p*x+m*_+v*R,s[8]=p*g+m*b+v*P,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],f=e[8];return t*o*f-t*a*u-r*s*f+r*a*l+i*s*u-i*o*l}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],f=e[8],h=f*o-a*u,p=a*l-f*s,m=u*s-o*l,v=t*h+r*p+i*m;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const w=1/v;return e[0]=h*w,e[1]=(i*u-f*r)*w,e[2]=(a*r-i*o)*w,e[3]=p*w,e[4]=(f*t-i*l)*w,e[5]=(i*s-a*t)*w,e[6]=m*w,e[7]=(r*l-u*t)*w,e[8]=(o*t-r*s)*w,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,r,i,s,o,a){const l=Math.cos(s),u=Math.sin(s);return this.set(r*l,r*u,-r*(l*o+u*a)+o+e,-i*u,i*l,-i*(-u*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(o_.makeScale(e,t)),this}rotate(e){return this.premultiply(o_.makeRotation(-e)),this}translate(e,t){return this.premultiply(o_.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,r,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,r=e.elements;for(let i=0;i<9;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const o_=new Vt;function U3(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const K4={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Uu(n,e){return new K4[n](e)}function Lh(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function F3(){const n=Lh("canvas");return n.style.display="block",n}const mC={};function dc(n){n in mC||(mC[n]=!0,console.warn(n))}const gC=new Vt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),vC=new Vt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),ng={[di]:{transfer:Ch,primaries:Ah,toReference:n=>n,fromReference:n=>n},[Fn]:{transfer:hn,primaries:Ah,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[Bp]:{transfer:Ch,primaries:Rh,toReference:n=>n.applyMatrix3(vC),fromReference:n=>n.applyMatrix3(gC)},[Q0]:{transfer:hn,primaries:Rh,toReference:n=>n.convertSRGBToLinear().applyMatrix3(vC),fromReference:n=>n.applyMatrix3(gC).convertLinearToSRGB()}},Q4=new Set([di,Bp]),ln={enabled:!0,_workingColorSpace:di,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!Q4.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const r=ng[e].toReference,i=ng[t].fromReference;return i(r(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return ng[n].primaries},getTransfer:function(n){return n===Ri?Ch:ng[n].transfer}};function td(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function a_(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let au;class ME{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{au===void 0&&(au=Lh("canvas")),au.width=e.width,au.height=e.height;const r=au.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),t=au}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.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 t=Lh("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),s=i.data;for(let o=0;o0&&(r.userData=this.userData),t||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Z0)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case wh:e.x=e.x-Math.floor(e.x);break;case Ur:e.x=e.x<0?0:1;break;case Eh: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 wh:e.y=e.y-Math.floor(e.y);break;case Ur:e.y=e.y<0?0:1;break;case Eh: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 dc("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Fn?Wa:SE}set encoding(e){dc("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===Wa?Fn:Ri}}In.DEFAULT_IMAGE=null;In.DEFAULT_MAPPING=Z0;In.DEFAULT_ANISOTROPY=1;class on{constructor(e=0,t=0,r=0,i=1){on.prototype.isVector4=!0,this.x=e,this.y=t,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,r,i){return this.x=e,this.y=t,this.z=r,this.w=i,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,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;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,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,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,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.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 t=this.x,r=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*r+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*r+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*r+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*r+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,r,i,s;const l=e.elements,u=l[0],f=l[4],h=l[8],p=l[1],m=l[5],v=l[9],w=l[2],x=l[6],g=l[10];if(Math.abs(f-p)<.01&&Math.abs(h-w)<.01&&Math.abs(v-x)<.01){if(Math.abs(f+p)<.1&&Math.abs(h+w)<.1&&Math.abs(v+x)<.1&&Math.abs(u+m+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const _=(u+1)/2,b=(m+1)/2,A=(g+1)/2,R=(f+p)/4,P=(h+w)/4,D=(v+x)/4;return _>b&&_>A?_<.01?(r=0,i=.707106781,s=.707106781):(r=Math.sqrt(_),i=R/r,s=P/r):b>A?b<.01?(r=.707106781,i=0,s=.707106781):(i=Math.sqrt(b),r=R/i,s=D/i):A<.01?(r=.707106781,i=.707106781,s=0):(s=Math.sqrt(A),r=P/s,i=D/s),this.set(r,i,s,t),this}let S=Math.sqrt((x-v)*(x-v)+(h-w)*(h-w)+(p-f)*(p-f));return Math.abs(S)<.001&&(S=1),this.x=(x-v)/S,this.y=(h-w)/S,this.z=(p-f)/S,this.w=Math.acos((u+m+g-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,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this.w=e.w+(t.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),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 z3 extends mo{constructor(e=1,t=1,r={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new on(0,0,e,t),this.scissorTest=!1,this.viewport=new on(0,0,e,t);const i={width:e,height:t,depth:1};r.encoding!==void 0&&(dc("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),r.colorSpace=r.encoding===Wa?Fn:Ri),r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:dn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},r),this.texture=new In(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps,this.texture.internalFormat=r.internalFormat,this.depthBuffer=r.depthBuffer,this.stencilBuffer=r.stencilBuffer,this.depthTexture=r.depthTexture,this.samples=r.samples}setSize(e,t,r=1){(this.width!==e||this.height!==t||this.depth!==r)&&(this.width=e,this.height=t,this.depth=r,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}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 t=Object.assign({},e.texture.image);return this.texture.source=new ql(t),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 gi extends z3{constructor(e=1,t=1,r={}){super(e,t,r),this.isWebGLRenderTarget=!0}}class J0 extends In{constructor(e=null,t=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=Gn,this.minFilter=Gn,this.wrapR=Ur,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class t5 extends gi{constructor(e=1,t=1,r=1,i={}){super(e,t,i),this.isWebGLArrayRenderTarget=!0,this.depth=r,this.texture=new J0(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class bE extends In{constructor(e=null,t=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=Gn,this.minFilter=Gn,this.wrapR=Ur,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class n5 extends gi{constructor(e=1,t=1,r=1,i={}){super(e,t,i),this.isWebGL3DRenderTarget=!0,this.depth=r,this.texture=new bE(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class r5 extends gi{constructor(e=1,t=1,r=1,i={}){super(e,t,i),this.isWebGLMultipleRenderTargets=!0;const s=this.texture;this.texture=[];for(let o=0;o=0?1:-1,_=1-g*g;if(_>Number.EPSILON){const A=Math.sqrt(_),R=Math.atan2(A,g*S);x=Math.sin(x*R)/A,a=Math.sin(a*R)/A}const b=a*S;if(l=l*x+p*b,u=u*x+m*b,f=f*x+v*b,h=h*x+w*b,x===1-a){const A=1/Math.sqrt(l*l+u*u+f*f+h*h);l*=A,u*=A,f*=A,h*=A}}e[t]=l,e[t+1]=u,e[t+2]=f,e[t+3]=h}static multiplyQuaternionsFlat(e,t,r,i,s,o){const a=r[i],l=r[i+1],u=r[i+2],f=r[i+3],h=s[o],p=s[o+1],m=s[o+2],v=s[o+3];return e[t]=a*v+f*h+l*m-u*p,e[t+1]=l*v+f*p+u*h-a*m,e[t+2]=u*v+f*m+a*p-l*h,e[t+3]=f*v-a*h-l*p-u*m,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,t,r,i){return this._x=e,this._y=t,this._z=r,this._w=i,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,t=!0){const r=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,u=a(r/2),f=a(i/2),h=a(s/2),p=l(r/2),m=l(i/2),v=l(s/2);switch(o){case"XYZ":this._x=p*f*h+u*m*v,this._y=u*m*h-p*f*v,this._z=u*f*v+p*m*h,this._w=u*f*h-p*m*v;break;case"YXZ":this._x=p*f*h+u*m*v,this._y=u*m*h-p*f*v,this._z=u*f*v-p*m*h,this._w=u*f*h+p*m*v;break;case"ZXY":this._x=p*f*h-u*m*v,this._y=u*m*h+p*f*v,this._z=u*f*v+p*m*h,this._w=u*f*h-p*m*v;break;case"ZYX":this._x=p*f*h-u*m*v,this._y=u*m*h+p*f*v,this._z=u*f*v-p*m*h,this._w=u*f*h+p*m*v;break;case"YZX":this._x=p*f*h+u*m*v,this._y=u*m*h+p*f*v,this._z=u*f*v-p*m*h,this._w=u*f*h-p*m*v;break;case"XZY":this._x=p*f*h-u*m*v,this._y=u*m*h-p*f*v,this._z=u*f*v+p*m*h,this._w=u*f*h+p*m*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const r=t/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,r=t[0],i=t[4],s=t[8],o=t[1],a=t[5],l=t[9],u=t[2],f=t[6],h=t[10],p=r+a+h;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(f-l)*m,this._y=(s-u)*m,this._z=(o-i)*m}else if(r>a&&r>h){const m=2*Math.sqrt(1+r-a-h);this._w=(f-l)/m,this._x=.25*m,this._y=(i+o)/m,this._z=(s+u)/m}else if(a>h){const m=2*Math.sqrt(1+a-r-h);this._w=(s-u)/m,this._x=(i+o)/m,this._y=.25*m,this._z=(l+f)/m}else{const m=2*Math.sqrt(1+h-r-a);this._w=(o-i)/m,this._x=(s+u)/m,this._y=(l+f)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(zn(this.dot(e),-1,1)))}rotateTowards(e,t){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,t/r);return this.slerp(e,i),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,t){const r=e._x,i=e._y,s=e._z,o=e._w,a=t._x,l=t._y,u=t._z,f=t._w;return this._x=r*f+o*a+i*u-s*l,this._y=i*f+o*l+s*a-r*u,this._z=s*f+o*u+r*l-i*a,this._w=o*f-r*a-i*l-s*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const r=this._x,i=this._y,s=this._z,o=this._w;let a=o*e._w+r*e._x+i*e._y+s*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=o,this._x=r,this._y=i,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-t;return this._w=m*o+t*this._w,this._x=m*r+t*this._x,this._y=m*i+t*this._y,this._z=m*s+t*this._z,this.normalize(),this}const u=Math.sqrt(l),f=Math.atan2(u,a),h=Math.sin((1-t)*f)/u,p=Math.sin(t*f)/u;return this._w=o*h+this._w*p,this._x=r*h+this._x*p,this._y=i*h+this._y*p,this._z=s*h+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){const e=Math.random(),t=Math.sqrt(1-e),r=Math.sqrt(e),i=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(i),r*Math.sin(s),r*Math.cos(s),t*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),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 F{constructor(e=0,t=0,r=0){F.prototype.isVector3=!0,this.x=e,this.y=t,this.z=r}set(e,t,r){return r===void 0&&(r=this.z),this.x=e,this.y=t,this.z=r,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,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;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,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,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,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.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,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(yC.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(yC.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*r+s[6]*i,this.y=s[1]*t+s[4]*r+s[7]*i,this.z=s[2]*t+s[5]*r+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,r=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*r+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*r+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*r+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*r+s[10]*i+s[14])*o,this}applyQuaternion(e){const t=this.x,r=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,u=2*(o*i-a*r),f=2*(a*t-s*i),h=2*(s*r-o*t);return this.x=t+l*u+o*h-a*f,this.y=r+l*f+a*u-s*h,this.z=i+l*h+s*f-o*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 t=this.x,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*r+s[8]*i,this.y=s[1]*t+s[5]*r+s[9]*i,this.z=s[2]*t+s[6]*r+s[10]*i,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,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const r=e.x,i=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-s*a,this.y=s*o-r*l,this.z=r*a-i*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return c_.copy(this).projectOnVector(e),this.sub(c_)}reflect(e){return this.sub(c_.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(zn(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return t*t+r*r+i*i}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,t,r){const i=Math.sin(t)*e;return this.x=i*Math.sin(r),this.y=Math.cos(t)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*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,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,r=Math.sqrt(1-e**2);return this.x=r*Math.cos(t),this.y=r*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const c_=new F,yC=new Br;class Qr{constructor(e=new F(1/0,1/0,1/0),t=new F(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,r=e.length;tthis.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,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(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,ms),ms.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Tf),ig.subVectors(this.max,Tf),lu.subVectors(e.a,Tf),cu.subVectors(e.b,Tf),uu.subVectors(e.c,Tf),ma.subVectors(cu,lu),ga.subVectors(uu,cu),Al.subVectors(lu,uu);let t=[0,-ma.z,ma.y,0,-ga.z,ga.y,0,-Al.z,Al.y,ma.z,0,-ma.x,ga.z,0,-ga.x,Al.z,0,-Al.x,-ma.y,ma.x,0,-ga.y,ga.x,0,-Al.y,Al.x,0];return!u_(t,lu,cu,uu,ig)||(t=[1,0,0,0,1,0,0,0,1],!u_(t,lu,cu,uu,ig))?!1:(sg.crossVectors(ma,ga),t=[sg.x,sg.y,sg.z],u_(t,lu,cu,uu,ig))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ms).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(ms).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:(Eo[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Eo[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Eo[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Eo[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Eo[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Eo[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Eo[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Eo[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Eo),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 Eo=[new F,new F,new F,new F,new F,new F,new F,new F],ms=new F,rg=new Qr,lu=new F,cu=new F,uu=new F,ma=new F,ga=new F,Al=new F,Tf=new F,ig=new F,sg=new F,Rl=new F;function u_(n,e,t,r,i){for(let s=0,o=n.length-3;s<=o;s+=3){Rl.fromArray(n,s);const a=i.x*Math.abs(Rl.x)+i.y*Math.abs(Rl.y)+i.z*Math.abs(Rl.z),l=e.dot(Rl),u=t.dot(Rl),f=r.dot(Rl);if(Math.max(-Math.max(l,u,f),Math.min(l,u,f))>a)return!1}return!0}const i5=new Qr,Cf=new F,d_=new F;class Vr{constructor(e=new F,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const r=this.center;t!==void 0?r.copy(t):i5.setFromPoints(e).getCenter(r);let i=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}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;Cf.subVectors(e,this.center);const t=Cf.lengthSq();if(t>this.radius*this.radius){const r=Math.sqrt(t),i=(r-this.radius)*.5;this.center.addScaledVector(Cf,i/r),this.radius+=i}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):(d_.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Cf.copy(e.center).add(d_)),this.expandByPoint(Cf.copy(e.center).sub(d_))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Mo=new F,f_=new F,og=new F,va=new F,h_=new F,ag=new F,p_=new F;class Lc{constructor(e=new F,t=new F(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.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,Mo)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Mo.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Mo.copy(this.origin).addScaledVector(this.direction,t),Mo.distanceToSquared(e))}distanceSqToSegment(e,t,r,i){f_.copy(e).add(t).multiplyScalar(.5),og.copy(t).sub(e).normalize(),va.copy(this.origin).sub(f_);const s=e.distanceTo(t)*.5,o=-this.direction.dot(og),a=va.dot(this.direction),l=-va.dot(og),u=va.lengthSq(),f=Math.abs(1-o*o);let h,p,m,v;if(f>0)if(h=o*l-a,p=o*a-l,v=s*f,h>=0)if(p>=-v)if(p<=v){const w=1/f;h*=w,p*=w,m=h*(h+o*p+2*a)+p*(o*h+p+2*l)+u}else p=s,h=Math.max(0,-(o*p+a)),m=-h*h+p*(p+2*l)+u;else p=-s,h=Math.max(0,-(o*p+a)),m=-h*h+p*(p+2*l)+u;else p<=-v?(h=Math.max(0,-(-o*s+a)),p=h>0?-s:Math.min(Math.max(-s,-l),s),m=-h*h+p*(p+2*l)+u):p<=v?(h=0,p=Math.min(Math.max(-s,-l),s),m=p*(p+2*l)+u):(h=Math.max(0,-(o*s+a)),p=h>0?s:Math.min(Math.max(-s,-l),s),m=-h*h+p*(p+2*l)+u);else p=o>0?-s:s,h=Math.max(0,-(o*p+a)),m=-h*h+p*(p+2*l)+u;return r&&r.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(f_).addScaledVector(og,p),m}intersectSphere(e,t){Mo.subVectors(e.center,this.origin);const r=Mo.dot(this.direction),i=Mo.dot(Mo)-r*r,s=e.radius*e.radius;if(i>s)return null;const o=Math.sqrt(s-i),a=r-o,l=r+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){const r=this.distanceToPlane(e);return r===null?null:this.at(r,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let r,i,s,o,a,l;const u=1/this.direction.x,f=1/this.direction.y,h=1/this.direction.z,p=this.origin;return u>=0?(r=(e.min.x-p.x)*u,i=(e.max.x-p.x)*u):(r=(e.max.x-p.x)*u,i=(e.min.x-p.x)*u),f>=0?(s=(e.min.y-p.y)*f,o=(e.max.y-p.y)*f):(s=(e.max.y-p.y)*f,o=(e.min.y-p.y)*f),r>o||s>i||((s>r||isNaN(r))&&(r=s),(o=0?(a=(e.min.z-p.z)*h,l=(e.max.z-p.z)*h):(a=(e.max.z-p.z)*h,l=(e.min.z-p.z)*h),r>l||a>i)||((a>r||r!==r)&&(r=a),(l=0?r:i,t)}intersectsBox(e){return this.intersectBox(e,Mo)!==null}intersectTriangle(e,t,r,i,s){h_.subVectors(t,e),ag.subVectors(r,e),p_.crossVectors(h_,ag);let o=this.direction.dot(p_),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;va.subVectors(this.origin,e);const l=a*this.direction.dot(ag.crossVectors(va,ag));if(l<0)return null;const u=a*this.direction.dot(h_.cross(va));if(u<0||l+u>o)return null;const f=-a*va.dot(p_);return f<0?null:this.at(f/o,s)}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 _t{constructor(e,t,r,i,s,o,a,l,u,f,h,p,m,v,w,x){_t.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,t,r,i,s,o,a,l,u,f,h,p,m,v,w,x)}set(e,t,r,i,s,o,a,l,u,f,h,p,m,v,w,x){const g=this.elements;return g[0]=e,g[4]=t,g[8]=r,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=u,g[6]=f,g[10]=h,g[14]=p,g[3]=m,g[7]=v,g[11]=w,g[15]=x,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 _t().fromArray(this.elements)}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){const t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,r=e.elements,i=1/du.setFromMatrixColumn(e,0).length(),s=1/du.setFromMatrixColumn(e,1).length(),o=1/du.setFromMatrixColumn(e,2).length();return t[0]=r[0]*i,t[1]=r[1]*i,t[2]=r[2]*i,t[3]=0,t[4]=r[4]*s,t[5]=r[5]*s,t[6]=r[6]*s,t[7]=0,t[8]=r[8]*o,t[9]=r[9]*o,t[10]=r[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,r=e.x,i=e.y,s=e.z,o=Math.cos(r),a=Math.sin(r),l=Math.cos(i),u=Math.sin(i),f=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const p=o*f,m=o*h,v=a*f,w=a*h;t[0]=l*f,t[4]=-l*h,t[8]=u,t[1]=m+v*u,t[5]=p-w*u,t[9]=-a*l,t[2]=w-p*u,t[6]=v+m*u,t[10]=o*l}else if(e.order==="YXZ"){const p=l*f,m=l*h,v=u*f,w=u*h;t[0]=p+w*a,t[4]=v*a-m,t[8]=o*u,t[1]=o*h,t[5]=o*f,t[9]=-a,t[2]=m*a-v,t[6]=w+p*a,t[10]=o*l}else if(e.order==="ZXY"){const p=l*f,m=l*h,v=u*f,w=u*h;t[0]=p-w*a,t[4]=-o*h,t[8]=v+m*a,t[1]=m+v*a,t[5]=o*f,t[9]=w-p*a,t[2]=-o*u,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const p=o*f,m=o*h,v=a*f,w=a*h;t[0]=l*f,t[4]=v*u-m,t[8]=p*u+w,t[1]=l*h,t[5]=w*u+p,t[9]=m*u-v,t[2]=-u,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const p=o*l,m=o*u,v=a*l,w=a*u;t[0]=l*f,t[4]=w-p*h,t[8]=v*h+m,t[1]=h,t[5]=o*f,t[9]=-a*f,t[2]=-u*f,t[6]=m*h+v,t[10]=p-w*h}else if(e.order==="XZY"){const p=o*l,m=o*u,v=a*l,w=a*u;t[0]=l*f,t[4]=-h,t[8]=u*f,t[1]=p*h+w,t[5]=o*f,t[9]=m*h-v,t[2]=v*h-m,t[6]=a*f,t[10]=w*h+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(s5,e,o5)}lookAt(e,t,r){const i=this.elements;return Ei.subVectors(e,t),Ei.lengthSq()===0&&(Ei.z=1),Ei.normalize(),ya.crossVectors(r,Ei),ya.lengthSq()===0&&(Math.abs(r.z)===1?Ei.x+=1e-4:Ei.z+=1e-4,Ei.normalize(),ya.crossVectors(r,Ei)),ya.normalize(),lg.crossVectors(Ei,ya),i[0]=ya.x,i[4]=lg.x,i[8]=Ei.x,i[1]=ya.y,i[5]=lg.y,i[9]=Ei.y,i[2]=ya.z,i[6]=lg.z,i[10]=Ei.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,i=t.elements,s=this.elements,o=r[0],a=r[4],l=r[8],u=r[12],f=r[1],h=r[5],p=r[9],m=r[13],v=r[2],w=r[6],x=r[10],g=r[14],S=r[3],_=r[7],b=r[11],A=r[15],R=i[0],P=i[4],D=i[8],V=i[12],C=i[1],L=i[5],W=i[9],Q=i[13],z=i[2],j=i[6],Y=i[10],re=i[14],U=i[3],X=i[7],q=i[11],K=i[15];return s[0]=o*R+a*C+l*z+u*U,s[4]=o*P+a*L+l*j+u*X,s[8]=o*D+a*W+l*Y+u*q,s[12]=o*V+a*Q+l*re+u*K,s[1]=f*R+h*C+p*z+m*U,s[5]=f*P+h*L+p*j+m*X,s[9]=f*D+h*W+p*Y+m*q,s[13]=f*V+h*Q+p*re+m*K,s[2]=v*R+w*C+x*z+g*U,s[6]=v*P+w*L+x*j+g*X,s[10]=v*D+w*W+x*Y+g*q,s[14]=v*V+w*Q+x*re+g*K,s[3]=S*R+_*C+b*z+A*U,s[7]=S*P+_*L+b*j+A*X,s[11]=S*D+_*W+b*Y+A*q,s[15]=S*V+_*Q+b*re+A*K,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],u=e[13],f=e[2],h=e[6],p=e[10],m=e[14],v=e[3],w=e[7],x=e[11],g=e[15];return v*(+s*l*h-i*u*h-s*a*p+r*u*p+i*a*m-r*l*m)+w*(+t*l*m-t*u*p+s*o*p-i*o*m+i*u*f-s*l*f)+x*(+t*u*h-t*a*m-s*o*h+r*o*m+s*a*f-r*u*f)+g*(-i*a*f-t*l*h+t*a*p+i*o*h-r*o*p+r*l*f)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=r),this}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],f=e[8],h=e[9],p=e[10],m=e[11],v=e[12],w=e[13],x=e[14],g=e[15],S=h*x*u-w*p*u+w*l*m-a*x*m-h*l*g+a*p*g,_=v*p*u-f*x*u-v*l*m+o*x*m+f*l*g-o*p*g,b=f*w*u-v*h*u+v*a*m-o*w*m-f*a*g+o*h*g,A=v*h*l-f*w*l-v*a*p+o*w*p+f*a*x-o*h*x,R=t*S+r*_+i*b+s*A;if(R===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/R;return e[0]=S*P,e[1]=(w*p*s-h*x*s-w*i*m+r*x*m+h*i*g-r*p*g)*P,e[2]=(a*x*s-w*l*s+w*i*u-r*x*u-a*i*g+r*l*g)*P,e[3]=(h*l*s-a*p*s-h*i*u+r*p*u+a*i*m-r*l*m)*P,e[4]=_*P,e[5]=(f*x*s-v*p*s+v*i*m-t*x*m-f*i*g+t*p*g)*P,e[6]=(v*l*s-o*x*s-v*i*u+t*x*u+o*i*g-t*l*g)*P,e[7]=(o*p*s-f*l*s+f*i*u-t*p*u-o*i*m+t*l*m)*P,e[8]=b*P,e[9]=(v*h*s-f*w*s-v*r*m+t*w*m+f*r*g-t*h*g)*P,e[10]=(o*w*s-v*a*s+v*r*u-t*w*u-o*r*g+t*a*g)*P,e[11]=(f*a*s-o*h*s-f*r*u+t*h*u+o*r*m-t*a*m)*P,e[12]=A*P,e[13]=(f*w*i-v*h*i+v*r*p-t*w*p-f*r*x+t*h*x)*P,e[14]=(v*a*i-o*w*i-v*r*l+t*w*l+o*r*x-t*a*x)*P,e[15]=(o*h*i-f*a*i+f*r*l-t*h*l-o*r*p+t*a*p)*P,this}scale(e){const t=this.elements,r=e.x,i=e.y,s=e.z;return t[0]*=r,t[4]*=i,t[8]*=s,t[1]*=r,t[5]*=i,t[9]*=s,t[2]*=r,t[6]*=i,t[10]*=s,t[3]*=r,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,i))}makeTranslation(e,t,r){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,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const r=Math.cos(t),i=Math.sin(t),s=1-r,o=e.x,a=e.y,l=e.z,u=s*o,f=s*a;return this.set(u*o+r,u*a-i*l,u*l+i*a,0,u*a+i*l,f*a+r,f*l-i*o,0,u*l-i*a,f*l+i*o,s*l*l+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,i,s,o){return this.set(1,r,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,r){const i=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,u=s+s,f=o+o,h=a+a,p=s*u,m=s*f,v=s*h,w=o*f,x=o*h,g=a*h,S=l*u,_=l*f,b=l*h,A=r.x,R=r.y,P=r.z;return i[0]=(1-(w+g))*A,i[1]=(m+b)*A,i[2]=(v-_)*A,i[3]=0,i[4]=(m-b)*R,i[5]=(1-(p+g))*R,i[6]=(x+S)*R,i[7]=0,i[8]=(v+_)*P,i[9]=(x-S)*P,i[10]=(1-(p+w))*P,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,r){const i=this.elements;let s=du.set(i[0],i[1],i[2]).length();const o=du.set(i[4],i[5],i[6]).length(),a=du.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],gs.copy(this);const u=1/s,f=1/o,h=1/a;return gs.elements[0]*=u,gs.elements[1]*=u,gs.elements[2]*=u,gs.elements[4]*=f,gs.elements[5]*=f,gs.elements[6]*=f,gs.elements[8]*=h,gs.elements[9]*=h,gs.elements[10]*=h,t.setFromRotationMatrix(gs),r.x=s,r.y=o,r.z=a,this}makePerspective(e,t,r,i,s,o,a=io){const l=this.elements,u=2*s/(t-e),f=2*s/(r-i),h=(t+e)/(t-e),p=(r+i)/(r-i);let m,v;if(a===io)m=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===Ih)m=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=u,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=f,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=v,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,r,i,s,o,a=io){const l=this.elements,u=1/(t-e),f=1/(r-i),h=1/(o-s),p=(t+e)*u,m=(r+i)*f;let v,w;if(a===io)v=(o+s)*h,w=-2*h;else if(a===Ih)v=s*h,w=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-p,l[1]=0,l[5]=2*f,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=w,l[14]=-v,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,r=e.elements;for(let i=0;i<16;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}const du=new F,gs=new _t,s5=new F(0,0,0),o5=new F(1,1,1),ya=new F,lg=new F,Ei=new F,xC=new _t,_C=new Br;class Vp{constructor(e=0,t=0,r=0,i=Vp.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=r,this._order=i}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,t,r,i=this._order){return this._x=e,this._y=t,this._z=r,this._order=i,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,t=this._order,r=!0){const i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],u=i[5],f=i[9],h=i[2],p=i[6],m=i[10];switch(t){case"XYZ":this._y=Math.asin(zn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-f,m),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-zn(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(zn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-h,m),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-zn(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(zn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-f,u),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-zn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-f,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return xC.makeRotationFromQuaternion(e),this.setFromRotationMatrix(xC,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return _C.setFromEuler(this),this.setFromQuaternion(_C,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=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+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}}Vp.DEFAULT_ORDER="XYZ";class fc{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let r=0;r0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.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()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(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,f=l.length;u0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(r.geometries=a),l.length>0&&(r.materials=l),u.length>0&&(r.textures=u),f.length>0&&(r.images=f),h.length>0&&(r.shapes=h),p.length>0&&(r.skeletons=p),m.length>0&&(r.animations=m),v.length>0&&(r.nodes=v)}return r.object=i,r;function o(a){const l=[];for(const u in a){const f=a[u];delete f.metadata,l.push(f)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!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)),t===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,r,i,s){vs.subVectors(i,t),To.subVectors(r,t),m_.subVectors(e,t);const o=vs.dot(vs),a=vs.dot(To),l=vs.dot(m_),u=To.dot(To),f=To.dot(m_),h=o*u-a*a;if(h===0)return s.set(0,0,0),null;const p=1/h,m=(u*l-a*f)*p,v=(o*f-a*l)*p;return s.set(1-m-v,v,m)}static containsPoint(e,t,r,i){return this.getBarycoord(e,t,r,i,Co)===null?!1:Co.x>=0&&Co.y>=0&&Co.x+Co.y<=1}static getInterpolation(e,t,r,i,s,o,a,l){return this.getBarycoord(e,t,r,i,Co)===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(s,Co.x),l.addScaledVector(o,Co.y),l.addScaledVector(a,Co.z),l)}static isFrontFacing(e,t,r,i){return vs.subVectors(r,t),To.subVectors(e,t),vs.cross(To).dot(i)<0}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,i){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,r,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),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 vs.subVectors(this.c,this.b),To.subVectors(this.a,this.b),vs.cross(To).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Pi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Pi.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,r,i,s){return Pi.getInterpolation(e,this.a,this.b,this.c,t,r,i,s)}containsPoint(e){return Pi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Pi.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const r=this.a,i=this.b,s=this.c;let o,a;hu.subVectors(i,r),pu.subVectors(s,r),g_.subVectors(e,r);const l=hu.dot(g_),u=pu.dot(g_);if(l<=0&&u<=0)return t.copy(r);v_.subVectors(e,i);const f=hu.dot(v_),h=pu.dot(v_);if(f>=0&&h<=f)return t.copy(i);const p=l*h-f*u;if(p<=0&&l>=0&&f<=0)return o=l/(l-f),t.copy(r).addScaledVector(hu,o);y_.subVectors(e,s);const m=hu.dot(y_),v=pu.dot(y_);if(v>=0&&m<=v)return t.copy(s);const w=m*u-l*v;if(w<=0&&u>=0&&v<=0)return a=u/(u-v),t.copy(r).addScaledVector(pu,a);const x=f*v-m*h;if(x<=0&&h-f>=0&&m-v>=0)return bC.subVectors(s,i),a=(h-f)/(h-f+(m-v)),t.copy(i).addScaledVector(bC,a);const g=1/(x+w+p);return o=w*g,a=p*g,t.copy(r).addScaledVector(hu,o).addScaledVector(pu,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const B3={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},xa={h:0,s:0,l:0},ug={h:0,s:0,l:0};function x_(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class Be{constructor(e,t,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,r)}set(e,t,r){if(t===void 0&&r===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Fn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,ln.toWorkingColorSpace(this,t),this}setRGB(e,t,r,i=ln.workingColorSpace){return this.r=e,this.g=t,this.b=r,ln.toWorkingColorSpace(this,i),this}setHSL(e,t,r,i=ln.workingColorSpace){if(e=EE(e,1),t=zn(t,0,1),r=zn(r,0,1),t===0)this.r=this.g=this.b=r;else{const s=r<=.5?r*(1+t):r+t-r*t,o=2*r-s;this.r=x_(o,s,e+1/3),this.g=x_(o,s,e),this.b=x_(o,s,e-1/3)}return ln.toWorkingColorSpace(this,i),this}setStyle(e,t=Fn){function r(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=i[1],a=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Fn){const r=B3[e.toLowerCase()];return r!==void 0?this.setHex(r,t):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=td(e.r),this.g=td(e.g),this.b=td(e.b),this}copyLinearToSRGB(e){return this.r=a_(e.r),this.g=a_(e.g),this.b=a_(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Fn){return ln.fromWorkingColorSpace(Ir.copy(this),e),Math.round(zn(Ir.r*255,0,255))*65536+Math.round(zn(Ir.g*255,0,255))*256+Math.round(zn(Ir.b*255,0,255))}getHexString(e=Fn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=ln.workingColorSpace){ln.fromWorkingColorSpace(Ir.copy(this),t);const r=Ir.r,i=Ir.g,s=Ir.b,o=Math.max(r,i,s),a=Math.min(r,i,s);let l,u;const f=(a+o)/2;if(a===o)l=0,u=0;else{const h=o-a;switch(u=f<=.5?h/(o+a):h/(2-o-a),o){case r:l=(i-s)/h+(i0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const r=e[t];if(r===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[t]=r}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const r={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==cc&&(r.blending=this.blending),this.side!==Wo&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==jv&&(r.blendSrc=this.blendSrc),this.blendDst!==Xv&&(r.blendDst=this.blendDst),this.blendEquation!==Pa&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==xh&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==x1&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Bl&&(r.stencilFail=this.stencilFail),this.stencilZFail!==Bl&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==Bl&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.wireframe===!0&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=i(e.textures),o=i(e.images);s.length>0&&(r.textures=s),o.length>0&&(r.images=o)}return r}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 t=e.clippingPlanes;let r=null;if(t!==null){const i=t.length;r=new Array(i);for(let s=0;s!==i;++s)r[s]=t[s].clone()}return this.clippingPlanes=r,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 hl extends br{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Be(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=Fp,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 No=h5();function h5(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),r=new Uint32Array(512),i=new Uint32Array(512);for(let l=0;l<256;++l){const u=l-127;u<-27?(r[l]=0,r[l|256]=32768,i[l]=24,i[l|256]=24):u<-14?(r[l]=1024>>-u-14,r[l|256]=1024>>-u-14|32768,i[l]=-u-1,i[l|256]=-u-1):u<=15?(r[l]=u+15<<10,r[l|256]=u+15<<10|32768,i[l]=13,i[l|256]=13):u<128?(r[l]=31744,r[l|256]=64512,i[l]=24,i[l|256]=24):(r[l]=31744,r[l|256]=64512,i[l]=13,i[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let u=l<<13,f=0;for(;!(u&8388608);)u<<=1,f-=8388608;u&=-8388609,f+=947912704,s[l]=u|f}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:r,shiftTable:i,mantissaTable:s,exponentTable:o,offsetTable:a}}function ai(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=zn(n,-65504,65504),No.floatView[0]=n;const e=No.uint32View[0],t=e>>23&511;return No.baseTable[t]+((e&8388607)>>No.shiftTable[t])}function Kf(n){const e=n>>10;return No.uint32View[0]=No.mantissaTable[No.offsetTable[e]+(n&1023)]+No.exponentTable[e],No.floatView[0]}const p5={toHalfFloat:ai,fromHalfFloat:Kf},Kn=new F,dg=new ge;class an{constructor(e,t,r=!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=t,this.count=e!==void 0?e.length/t:0,this.normalized=r,this.usage=Ph,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=is,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return dc("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,t){this.updateRanges.push({start:e,count:t})}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,t,r){e*=this.itemSize,r*=t.itemSize;for(let i=0,s=this.itemSize;i0&&(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 t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const r=this.attributes;for(const l in r){const u=r[l];e.data.attributes[l]=u.toJSON(e.data)}const i={};let s=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],f=[];for(let h=0,p=u.length;h0&&(i[l]=f,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));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 t={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone(t));const i=e.attributes;for(const u in i){const f=i[u];this.setAttribute(u,f.clone(t))}const s=e.morphAttributes;for(const u in s){const f=[],h=s[u];for(let p=0,m=h.length;p0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s(e.far-e.near)**2))&&(TC.copy(s).invert(),Pl.copy(e.ray).applyMatrix4(TC),!(r.boundingBox!==null&&Pl.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,t,Pl)))}_computeIntersections(e,t,r){let i;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,u=s.attributes.uv,f=s.attributes.uv1,h=s.attributes.normal,p=s.groups,m=s.drawRange;if(a!==null)if(Array.isArray(o))for(let v=0,w=p.length;vt.far?null:{distance:u,point:yg.clone(),object:n}}function xg(n,e,t,r,i,s,o,a,l,u){n.getVertexPosition(a,gu),n.getVertexPosition(l,vu),n.getVertexPosition(u,yu);const f=E5(n,e,t,r,gu,vu,yu,vg);if(f){i&&(pg.fromBufferAttribute(i,a),mg.fromBufferAttribute(i,l),gg.fromBufferAttribute(i,u),f.uv=Pi.getInterpolation(vg,gu,vu,yu,pg,mg,gg,new ge)),s&&(pg.fromBufferAttribute(s,a),mg.fromBufferAttribute(s,l),gg.fromBufferAttribute(s,u),f.uv1=Pi.getInterpolation(vg,gu,vu,yu,pg,mg,gg,new ge),f.uv2=f.uv1),o&&(AC.fromBufferAttribute(o,a),RC.fromBufferAttribute(o,l),PC.fromBufferAttribute(o,u),f.normal=Pi.getInterpolation(vg,gu,vu,yu,AC,RC,PC,new F),f.normal.dot(r.direction)>0&&f.normal.multiplyScalar(-1));const h={a,b:l,c:u,normal:new F,materialIndex:0};Pi.getNormal(gu,vu,yu,h.normal),f.face=h}return f}class Dc extends Ut{constructor(e=1,t=1,r=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:r,widthSegments:i,heightSegments:s,depthSegments:o};const a=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);const l=[],u=[],f=[],h=[];let p=0,m=0;v("z","y","x",-1,-1,r,t,e,o,s,0),v("z","y","x",1,-1,r,t,-e,o,s,1),v("x","z","y",1,1,e,r,t,i,o,2),v("x","z","y",1,-1,e,r,-t,i,o,3),v("x","y","z",1,-1,e,t,r,i,s,4),v("x","y","z",-1,-1,e,t,-r,i,s,5),this.setIndex(l),this.setAttribute("position",new ot(u,3)),this.setAttribute("normal",new ot(f,3)),this.setAttribute("uv",new ot(h,2));function v(w,x,g,S,_,b,A,R,P,D,V){const C=b/P,L=A/D,W=b/2,Q=A/2,z=R/2,j=P+1,Y=D+1;let re=0,U=0;const X=new F;for(let q=0;q0?1:-1,f.push(X.x,X.y,X.z),h.push(se/P),h.push(1-q/D),re+=1}}for(let q=0;q0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(t.extensions=r),t}}class $d extends sn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new _t,this.projectionMatrix=new _t,this.projectionMatrixInverse=new _t,this.coordinateSystem=ro}copy(e,t){return super.copy(e,t),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,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const xa=new F,IC=new ge,LC=new ge;class Rn extends $d{constructor(e=50,t=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),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 t=.5*this.getFilmHeight()/e;this.fov=Md*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(lc*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Md*2*Math.atan(Math.tan(lc*.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,t,r){xa.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(xa.x,xa.y).multiplyScalar(-e/xa.z),xa.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(xa.x,xa.y).multiplyScalar(-e/xa.z)}getViewSize(e,t){return this.getViewBounds(e,IC,LC),t.subVectors(LC,IC)}setViewOffset(e,t,r,i,s,o){this.aspect=e/t,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=t,this.view.offsetX=r,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(lc*.5*this.fov)/this.zoom,r=2*t,i=this.aspect*r,s=-.5*i;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,u=o.fullHeight;s+=o.offsetX*i/l,t-=o.offsetY*r/u,i*=o.width/l,r*=o.height/u}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const vu=-90,yu=1;class H3 extends sn{constructor(e,t,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Rn(vu,yu,e,t);i.layers=this.layers,this.add(i);const s=new Rn(vu,yu,e,t);s.layers=this.layers,this.add(s);const o=new Rn(vu,yu,e,t);o.layers=this.layers,this.add(o);const a=new Rn(vu,yu,e,t);a.layers=this.layers,this.add(a);const l=new Rn(vu,yu,e,t);l.layers=this.layers,this.add(l);const u=new Rn(vu,yu,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[r,i,s,o,a,l]=t;for(const u of t)this.remove(u);if(e===ro)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.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===Rh)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.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 t)this.add(u),u.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,u,f]=this.children,h=e.getRenderTarget(),p=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),v=e.xr.enabled;e.xr.enabled=!1;const w=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(t,s),e.setRenderTarget(r,1,i),e.render(t,o),e.setRenderTarget(r,2,i),e.render(t,a),e.setRenderTarget(r,3,i),e.render(t,l),e.setRenderTarget(r,4,i),e.render(t,u),r.texture.generateMipmaps=w,e.setRenderTarget(r,5,i),e.render(t,f),e.setRenderTarget(h,p,m),e.xr.enabled=v,r.texture.needsPMREMUpdate=!0}}class Bp extends In{constructor(e,t,r,i,s,o,a,l,u,f){e=e!==void 0?e:[],t=t!==void 0?t:Wo,super(e,t,r,i,s,o,a,l,u,f),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class $3 extends gi{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];t.encoding!==void 0&&(cc("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===$a?Fn:Ri),this.texture=new Bp(i,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:fn}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class as extends br{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=b5,this.fragmentShader=T5,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1,clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Cd(e.uniforms),this.uniformsGroups=M5(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const o=this.uniforms[i].value;o&&o.isTexture?t.uniforms[i]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[i]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[i]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[i]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[i]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[i]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[i]={type:"m4",value:o.toArray()}:t.uniforms[i]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(t.extensions=r),t}}class Gd extends sn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new _t,this.projectionMatrix=new _t,this.projectionMatrixInverse=new _t,this.coordinateSystem=io}copy(e,t){return super.copy(e,t),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,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const _a=new F,IC=new ge,LC=new ge;class Rn extends Gd{constructor(e=50,t=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),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 t=.5*this.getFilmHeight()/e;this.fov=Td*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(uc*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Td*2*Math.atan(Math.tan(uc*.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,t,r){_a.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(_a.x,_a.y).multiplyScalar(-e/_a.z),_a.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(_a.x,_a.y).multiplyScalar(-e/_a.z)}getViewSize(e,t){return this.getViewBounds(e,IC,LC),t.subVectors(LC,IC)}setViewOffset(e,t,r,i,s,o){this.aspect=e/t,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=t,this.view.offsetX=r,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(uc*.5*this.fov)/this.zoom,r=2*t,i=this.aspect*r,s=-.5*i;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,u=o.fullHeight;s+=o.offsetX*i/l,t-=o.offsetY*r/u,i*=o.width/l,r*=o.height/u}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const xu=-90,_u=1;class $3 extends sn{constructor(e,t,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Rn(xu,_u,e,t);i.layers=this.layers,this.add(i);const s=new Rn(xu,_u,e,t);s.layers=this.layers,this.add(s);const o=new Rn(xu,_u,e,t);o.layers=this.layers,this.add(o);const a=new Rn(xu,_u,e,t);a.layers=this.layers,this.add(a);const l=new Rn(xu,_u,e,t);l.layers=this.layers,this.add(l);const u=new Rn(xu,_u,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[r,i,s,o,a,l]=t;for(const u of t)this.remove(u);if(e===io)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.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===Ih)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.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 t)this.add(u),u.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,u,f]=this.children,h=e.getRenderTarget(),p=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),v=e.xr.enabled;e.xr.enabled=!1;const w=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(t,s),e.setRenderTarget(r,1,i),e.render(t,o),e.setRenderTarget(r,2,i),e.render(t,a),e.setRenderTarget(r,3,i),e.render(t,l),e.setRenderTarget(r,4,i),e.render(t,u),r.texture.generateMipmaps=w,e.setRenderTarget(r,5,i),e.render(t,f),e.setRenderTarget(h,p,m),e.xr.enabled=v,r.texture.needsPMREMUpdate=!0}}class Hp extends In{constructor(e,t,r,i,s,o,a,l,u,f){e=e!==void 0?e:[],t=t!==void 0?t:Go,super(e,t,r,i,s,o,a,l,u,f),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class W3 extends gi{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];t.encoding!==void 0&&(dc("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===Wa?Fn:Ri),this.texture=new Hp(i,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:dn}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -73,9 +73,9 @@ var tF=Object.defineProperty;var nF=(n,e,t)=>e in n?tF(n,e,{enumerable:!0,config gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},i=new Ic(5,5,5),s=new as({name:"CubemapFromEquirect",uniforms:bd(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:Kr,blending:io});s.uniforms.tEquirect.value=t;const o=new qn(i,s),a=t.minFilter;return t.minFilter===no&&(t.minFilter=fn),new H3(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,r,i){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,r,i);e.setRenderTarget(s)}}const __=new F,S5=new F,w5=new Vt;class Qs{constructor(e=new F(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,r,i){return this.normal.set(e,t,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){const i=__.subVectors(r,t).cross(S5.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,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,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const r=e.delta(__),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(e.start).addScaledVector(r,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>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,t){const r=t||w5.getNormalMatrix(e),i=this.coplanarPoint(__).applyMatrix4(e),s=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(s),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 Pl=new Vr,yg=new F;class Vp{constructor(e=new Qs,t=new Qs,r=new Qs,i=new Qs,s=new Qs,o=new Qs){this.planes=[e,t,r,i,s,o]}set(e,t,r,i,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(r),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,t=ro){const r=this.planes,i=e.elements,s=i[0],o=i[1],a=i[2],l=i[3],u=i[4],f=i[5],h=i[6],p=i[7],m=i[8],v=i[9],w=i[10],x=i[11],g=i[12],S=i[13],_=i[14],b=i[15];if(r[0].setComponents(l-s,p-u,x-m,b-g).normalize(),r[1].setComponents(l+s,p+u,x+m,b+g).normalize(),r[2].setComponents(l+o,p+f,x+v,b+S).normalize(),r[3].setComponents(l-o,p-f,x-v,b-S).normalize(),r[4].setComponents(l-a,p-h,x-w,b-_).normalize(),t===ro)r[5].setComponents(l+a,p+h,x+w,b+_).normalize();else if(t===Rh)r[5].setComponents(a,h,w,_).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Pl.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Pl.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Pl)}intersectsSprite(e){return Pl.center.set(0,0,0),Pl.radius=.7071067811865476,Pl.applyMatrix4(e.matrixWorld),this.intersectsSphere(Pl)}intersectsSphere(e){const t=this.planes,r=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(r)0?e.max.x:e.min.x,yg.y=i.normal.y>0?e.max.y:e.min.y,yg.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(yg)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function W3(){let n=null,e=!1,t=null,r=null;function i(s,o){t(s,o),r=n.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(r=n.requestAnimationFrame(i),e=!0)},stop:function(){n.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function E5(n,e){const t=e.isWebGL2,r=new WeakMap;function i(u,f){const h=u.array,p=u.usage,m=h.byteLength,v=n.createBuffer();n.bindBuffer(f,v),n.bufferData(f,h,p),u.onUploadCallback();let w;if(h instanceof Float32Array)w=n.FLOAT;else if(h instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(t)w=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else w=n.UNSIGNED_SHORT;else if(h instanceof Int16Array)w=n.SHORT;else if(h instanceof Uint32Array)w=n.UNSIGNED_INT;else if(h instanceof Int32Array)w=n.INT;else if(h instanceof Int8Array)w=n.BYTE;else if(h instanceof Uint8Array)w=n.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)w=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);return{buffer:v,type:w,bytesPerElement:h.BYTES_PER_ELEMENT,version:u.version,size:m}}function s(u,f,h){const p=f.array,m=f._updateRange,v=f.updateRanges;if(n.bindBuffer(h,u),m.count===-1&&v.length===0&&n.bufferSubData(h,0,p),v.length!==0){for(let w=0,x=v.length;w1?null:t.copy(e.start).addScaledVector(r,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>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,t){const r=t||A5.getNormalMatrix(e),i=this.coplanarPoint(w_).applyMatrix4(e),s=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(s),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 Il=new Vr,_g=new F;class $p{constructor(e=new Js,t=new Js,r=new Js,i=new Js,s=new Js,o=new Js){this.planes=[e,t,r,i,s,o]}set(e,t,r,i,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(r),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,t=io){const r=this.planes,i=e.elements,s=i[0],o=i[1],a=i[2],l=i[3],u=i[4],f=i[5],h=i[6],p=i[7],m=i[8],v=i[9],w=i[10],x=i[11],g=i[12],S=i[13],_=i[14],b=i[15];if(r[0].setComponents(l-s,p-u,x-m,b-g).normalize(),r[1].setComponents(l+s,p+u,x+m,b+g).normalize(),r[2].setComponents(l+o,p+f,x+v,b+S).normalize(),r[3].setComponents(l-o,p-f,x-v,b-S).normalize(),r[4].setComponents(l-a,p-h,x-w,b-_).normalize(),t===io)r[5].setComponents(l+a,p+h,x+w,b+_).normalize();else if(t===Ih)r[5].setComponents(a,h,w,_).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Il.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Il.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Il)}intersectsSprite(e){return Il.center.set(0,0,0),Il.radius=.7071067811865476,Il.applyMatrix4(e.matrixWorld),this.intersectsSphere(Il)}intersectsSphere(e){const t=this.planes,r=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(r)0?e.max.x:e.min.x,_g.y=i.normal.y>0?e.max.y:e.min.y,_g.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(_g)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function G3(){let n=null,e=!1,t=null,r=null;function i(s,o){t(s,o),r=n.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(r=n.requestAnimationFrame(i),e=!0)},stop:function(){n.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function R5(n,e){const t=e.isWebGL2,r=new WeakMap;function i(u,f){const h=u.array,p=u.usage,m=h.byteLength,v=n.createBuffer();n.bindBuffer(f,v),n.bufferData(f,h,p),u.onUploadCallback();let w;if(h instanceof Float32Array)w=n.FLOAT;else if(h instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(t)w=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else w=n.UNSIGNED_SHORT;else if(h instanceof Int16Array)w=n.SHORT;else if(h instanceof Uint32Array)w=n.UNSIGNED_INT;else if(h instanceof Int32Array)w=n.INT;else if(h instanceof Int8Array)w=n.BYTE;else if(h instanceof Uint8Array)w=n.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)w=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);return{buffer:v,type:w,bytesPerElement:h.BYTES_PER_ELEMENT,version:u.version,size:m}}function s(u,f,h){const p=f.array,m=f._updateRange,v=f.updateRanges;if(n.bindBuffer(h,u),m.count===-1&&v.length===0&&n.bufferSubData(h,0,p),v.length!==0){for(let w=0,x=v.length;we in n?tF(n,e,{enumerable:!0,config : cases.z; return clamp( threshold , 1.0e-6, 1.0 ); } -#endif`,T5=`#ifdef USE_ALPHAMAP +#endif`,L5=`#ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g; -#endif`,C5=`#ifdef USE_ALPHAMAP +#endif`,D5=`#ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,A5=`#ifdef USE_ALPHATEST +#endif`,N5=`#ifdef USE_ALPHATEST #ifdef ALPHA_TO_COVERAGE diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a ); if ( diffuseColor.a == 0.0 ) discard; #else if ( diffuseColor.a < alphaTest ) discard; #endif -#endif`,R5=`#ifdef USE_ALPHATEST +#endif`,O5=`#ifdef USE_ALPHATEST uniform float alphaTest; -#endif`,P5=`#ifdef USE_AOMAP +#endif`,k5=`#ifdef USE_AOMAP float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0; reflectedLight.indirectDiffuse *= ambientOcclusion; #if defined( USE_CLEARCOAT ) @@ -136,10 +136,10 @@ var tF=Object.defineProperty;var nF=(n,e,t)=>e in n?tF(n,e,{enumerable:!0,config float dotNV = saturate( dot( geometryNormal, geometryViewDir ) ); reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness ); #endif -#endif`,I5=`#ifdef USE_AOMAP +#endif`,U5=`#ifdef USE_AOMAP uniform sampler2D aoMap; uniform float aoMapIntensity; -#endif`,L5=`#ifdef USE_BATCHING +#endif`,F5=`#ifdef USE_BATCHING attribute float batchId; uniform highp sampler2D batchingTexture; mat4 getBatchingMatrix( const in float i ) { @@ -153,15 +153,15 @@ var tF=Object.defineProperty;var nF=(n,e,t)=>e in n?tF(n,e,{enumerable:!0,config vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } -#endif`,D5=`#ifdef USE_BATCHING +#endif`,z5=`#ifdef USE_BATCHING mat4 batchingMatrix = getBatchingMatrix( batchId ); -#endif`,N5=`vec3 transformed = vec3( position ); +#endif`,B5=`vec3 transformed = vec3( position ); #ifdef USE_ALPHAHASH vPosition = vec3( position ); -#endif`,O5=`vec3 objectNormal = vec3( normal ); +#endif`,V5=`vec3 objectNormal = vec3( normal ); #ifdef USE_TANGENT vec3 objectTangent = vec3( tangent.xyz ); -#endif`,k5=`float G_BlinnPhong_Implicit( ) { +#endif`,H5=`float G_BlinnPhong_Implicit( ) { return 0.25; } float D_BlinnPhong( const in float shininess, const in float dotNH ) { @@ -175,7 +175,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve float G = G_BlinnPhong_Implicit( ); float D = D_BlinnPhong( shininess, dotNH ); return F * ( G * D ); -} // validated`,U5=`#ifdef USE_IRIDESCENCE +} // validated`,$5=`#ifdef USE_IRIDESCENCE const mat3 XYZ_TO_REC709 = mat3( 3.2404542, -0.9692660, 0.0556434, -1.5371385, 1.8760108, -0.2040259, @@ -238,7 +238,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve } return max( I, vec3( 0.0 ) ); } -#endif`,F5=`#ifdef USE_BUMPMAP +#endif`,W5=`#ifdef USE_BUMPMAP uniform sampler2D bumpMap; uniform float bumpScale; vec2 dHdxy_fwd() { @@ -259,7 +259,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); return normalize( abs( fDet ) * surf_norm - vGrad ); } -#endif`,z5=`#if NUM_CLIPPING_PLANES > 0 +#endif`,G5=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #ifdef ALPHA_TO_COVERAGE float distanceToPlane, distanceGradient; @@ -305,26 +305,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve if ( clipped ) discard; #endif #endif -#endif`,B5=`#if NUM_CLIPPING_PLANES > 0 +#endif`,j5=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,V5=`#if NUM_CLIPPING_PLANES > 0 +#endif`,X5=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; -#endif`,H5=`#if NUM_CLIPPING_PLANES > 0 +#endif`,q5=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; -#endif`,$5=`#if defined( USE_COLOR_ALPHA ) +#endif`,Y5=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; -#endif`,W5=`#if defined( USE_COLOR_ALPHA ) +#endif`,Z5=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; -#endif`,G5=`#if defined( USE_COLOR_ALPHA ) +#endif`,K5=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; -#endif`,j5=`#if defined( USE_COLOR_ALPHA ) +#endif`,Q5=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) vColor = vec3( 1.0 ); @@ -334,7 +334,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve #endif #ifdef USE_INSTANCING_COLOR vColor.xyz *= instanceColor.xyz; -#endif`,X5=`#define PI 3.141592653589793 +#endif`,J5=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 @@ -412,7 +412,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { 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`,q5=`#ifdef ENVMAP_TYPE_CUBE_UV +} // validated`,ez=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { @@ -505,7 +505,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { return vec4( mix( color0, color1, mipF ), 1.0 ); } } -#endif`,Y5=`vec3 transformedNormal = objectNormal; +#endif`,tz=`vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT vec3 transformedTangent = objectTangent; #endif @@ -534,18 +534,18 @@ transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif -#endif`,Z5=`#ifdef USE_DISPLACEMENTMAP +#endif`,nz=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; -#endif`,K5=`#ifdef USE_DISPLACEMENTMAP +#endif`,rz=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,Q5=`#ifdef USE_EMISSIVEMAP +#endif`,iz=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,J5=`#ifdef USE_EMISSIVEMAP +#endif`,sz=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; -#endif`,ez="gl_FragColor = linearToOutputTexel( gl_FragColor );",tz=` +#endif`,oz="gl_FragColor = linearToOutputTexel( gl_FragColor );",az=` const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( vec3( 0.8224621, 0.177538, 0.0 ), vec3( 0.0331941, 0.9668058, 0.0 ), @@ -573,7 +573,7 @@ vec4 LinearToLinear( in vec4 value ) { } vec4 LinearTosRGB( in vec4 value ) { return sRGBTransferOETF( value ); -}`,nz=`#ifdef USE_ENVMAP +}`,lz=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -602,7 +602,7 @@ vec4 LinearTosRGB( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`,rz=`#ifdef USE_ENVMAP +#endif`,cz=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; #ifdef ENVMAP_TYPE_CUBE @@ -611,7 +611,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform sampler2D envMap; #endif -#endif`,iz=`#ifdef USE_ENVMAP +#endif`,uz=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS @@ -622,7 +622,7 @@ vec4 LinearTosRGB( in vec4 value ) { #else varying vec3 vReflect; #endif -#endif`,sz=`#ifdef USE_ENVMAP +#endif`,dz=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif @@ -633,7 +633,7 @@ vec4 LinearTosRGB( in vec4 value ) { varying vec3 vReflect; uniform float refractionRatio; #endif -#endif`,oz=`#ifdef USE_ENVMAP +#endif`,fz=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else @@ -650,18 +650,18 @@ vec4 LinearTosRGB( in vec4 value ) { vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif -#endif`,az=`#ifdef USE_FOG +#endif`,hz=`#ifdef USE_FOG vFogDepth = - mvPosition.z; -#endif`,lz=`#ifdef USE_FOG +#endif`,pz=`#ifdef USE_FOG varying float vFogDepth; -#endif`,cz=`#ifdef USE_FOG +#endif`,mz=`#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`,uz=`#ifdef USE_FOG +#endif`,gz=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 @@ -670,7 +670,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,dz=`#ifdef USE_GRADIENTMAP +#endif`,vz=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { @@ -682,16 +682,16 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { 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 -}`,fz=`#ifdef USE_LIGHTMAP +}`,yz=`#ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; reflectedLight.indirectDiffuse += lightMapIrradiance; -#endif`,hz=`#ifdef USE_LIGHTMAP +#endif`,xz=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,pz=`LambertMaterial material; +#endif`,_z=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,mz=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,Sz=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; @@ -705,7 +705,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometr reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,gz=`uniform bool receiveShadow; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,wz=`uniform bool receiveShadow; uniform vec3 ambientLightColor; #if defined( USE_LIGHT_PROBES ) uniform vec3 lightProbe[ 9 ]; @@ -828,7 +828,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } -#endif`,vz=`#ifdef USE_ENVMAP +#endif`,Ez=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -861,8 +861,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi #endif } #endif -#endif`,yz=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,xz=`varying vec3 vViewPosition; +#endif`,Mz=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,bz=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; @@ -874,11 +874,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPo reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,_z=`BlinnPhongMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Tz=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; -material.specularStrength = specularStrength;`,Sz=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,Cz=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; @@ -895,7 +895,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geom reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,wz=`PhysicalMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Az=`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 ); @@ -978,7 +978,7 @@ material.roughness = min( material.roughness, 1.0 ); 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`,Ez=`struct PhysicalMaterial { +#endif`,Rz=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; @@ -1278,7 +1278,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia #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 ); -}`,Mz=` +}`,Pz=` vec3 geometryPosition = - vViewPosition; vec3 geometryNormal = normal; vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); @@ -1393,7 +1393,7 @@ IncidentLight directLight; #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,bz=`#if defined( RE_IndirectDiffuse ) +#endif`,Iz=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; @@ -1412,25 +1412,25 @@ IncidentLight directLight; #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); #endif -#endif`,Tz=`#if defined( RE_IndirectDiffuse ) +#endif`,Lz=`#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`,Cz=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,Dz=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,Az=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,Nz=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; -#endif`,Rz=`#ifdef USE_LOGDEPTHBUF +#endif`,Oz=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif -#endif`,Pz=`#ifdef USE_LOGDEPTHBUF +#endif`,kz=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); @@ -1440,16 +1440,16 @@ IncidentLight directLight; gl_Position.z *= gl_Position.w; } #endif -#endif`,Iz=`#ifdef USE_MAP +#endif`,Uz=`#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`,Lz=`#ifdef USE_MAP +#endif`,Fz=`#ifdef USE_MAP uniform sampler2D map; -#endif`,Dz=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,zz=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else @@ -1461,7 +1461,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,Nz=`#if defined( USE_POINTS_UV ) +#endif`,Bz=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) @@ -1473,13 +1473,13 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,Oz=`float metalnessFactor = metalness; +#endif`,Vz=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; -#endif`,kz=`#ifdef USE_METALNESSMAP +#endif`,Hz=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,Uz=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) +#endif`,$z=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) @@ -1488,7 +1488,7 @@ IncidentLight directLight; if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } -#endif`,Fz=`#ifdef USE_MORPHNORMALS +#endif`,Wz=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1500,7 +1500,7 @@ IncidentLight directLight; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif -#endif`,zz=`#ifdef USE_MORPHTARGETS +#endif`,Gz=`#ifdef USE_MORPHTARGETS uniform float morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; @@ -1520,7 +1520,7 @@ IncidentLight directLight; uniform float morphTargetInfluences[ 4 ]; #endif #endif -#endif`,Bz=`#ifdef USE_MORPHTARGETS +#endif`,jz=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1538,7 +1538,7 @@ IncidentLight directLight; transformed += morphTarget7 * morphTargetInfluences[ 7 ]; #endif #endif -#endif`,Vz=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,Xz=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); @@ -1579,7 +1579,7 @@ IncidentLight directLight; tbn2[1] *= faceDirection; #endif #endif -vec3 nonPerturbedNormal = normal;`,Hz=`#ifdef USE_NORMALMAP_OBJECTSPACE +vec3 nonPerturbedNormal = normal;`,qz=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -1594,25 +1594,25 @@ vec3 nonPerturbedNormal = normal;`,Hz=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,$z=`#ifndef FLAT_SHADED +#endif`,Yz=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,Wz=`#ifndef FLAT_SHADED +#endif`,Zz=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,Gz=`#ifndef FLAT_SHADED +#endif`,Kz=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,jz=`#ifdef USE_NORMALMAP +#endif`,Qz=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -1634,13 +1634,13 @@ vec3 nonPerturbedNormal = normal;`,Hz=`#ifdef USE_NORMALMAP_OBJECTSPACE float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } -#endif`,Xz=`#ifdef USE_CLEARCOAT +#endif`,Jz=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,qz=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,eB=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,Yz=`#ifdef USE_CLEARCOATMAP +#endif`,tB=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP @@ -1649,18 +1649,18 @@ vec3 nonPerturbedNormal = normal;`,Hz=`#ifdef USE_NORMALMAP_OBJECTSPACE #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; -#endif`,Zz=`#ifdef USE_IRIDESCENCEMAP +#endif`,nB=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; -#endif`,Kz=`#ifdef OPAQUE +#endif`,rB=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Qz=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,iB=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -1701,9 +1701,9 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const } float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * depth - far ); -}`,Jz=`#ifdef PREMULTIPLIED_ALPHA +}`,sB=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,eB=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,oB=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif @@ -1711,22 +1711,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,tB=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,aB=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,nB=`#ifdef DITHERING +#endif`,lB=`#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`,rB=`float roughnessFactor = roughness; +#endif`,cB=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; -#endif`,iB=`#ifdef USE_ROUGHNESSMAP +#endif`,uB=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,sB=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,dB=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -1903,7 +1903,7 @@ gl_Position = projectionMatrix * mvPosition;`,tB=`#ifdef DITHERING return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } -#endif`,oB=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,fB=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -1941,7 +1941,7 @@ gl_Position = projectionMatrix * mvPosition;`,tB=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,aB=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,hB=`#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 @@ -1973,7 +1973,7 @@ gl_Position = projectionMatrix * mvPosition;`,tB=`#ifdef DITHERING vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end -#endif`,lB=`float getShadowMask() { +#endif`,pB=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -2005,12 +2005,12 @@ gl_Position = projectionMatrix * mvPosition;`,tB=`#ifdef DITHERING #endif #endif return shadow; -}`,cB=`#ifdef USE_SKINNING +}`,mB=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,uB=`#ifdef USE_SKINNING +#endif`,gB=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -2025,7 +2025,7 @@ gl_Position = projectionMatrix * mvPosition;`,tB=`#ifdef DITHERING vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } -#endif`,dB=`#ifdef USE_SKINNING +#endif`,vB=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -2033,7 +2033,7 @@ gl_Position = projectionMatrix * mvPosition;`,tB=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,fB=`#ifdef USE_SKINNING +#endif`,yB=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -2044,17 +2044,17 @@ gl_Position = projectionMatrix * mvPosition;`,tB=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,hB=`float specularStrength; +#endif`,xB=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,pB=`#ifdef USE_SPECULARMAP +#endif`,_B=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,mB=`#if defined( TONE_MAPPING ) +#endif`,SB=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,gB=`#ifndef saturate +#endif`,wB=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -2136,7 +2136,7 @@ vec3 AgXToneMapping( vec3 color ) { color = clamp( color, 0.0, 1.0 ); return color; } -vec3 CustomToneMapping( vec3 color ) { return color; }`,vB=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,EB=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -2157,7 +2157,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,vB=`#ifdef USE_TRANSMISS material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,yB=`#ifdef USE_TRANSMISSION +#endif`,MB=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -2263,7 +2263,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,vB=`#ifdef USE_TRANSMISS float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); } -#endif`,xB=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,bB=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2333,7 +2333,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,vB=`#ifdef USE_TRANSMISS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,_B=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,TB=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2427,7 +2427,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,vB=`#ifdef USE_TRANSMISS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,SB=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,CB=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP @@ -2498,7 +2498,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,vB=`#ifdef USE_TRANSMISS #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,wB=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,AB=`#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; @@ -2507,12 +2507,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,vB=`#ifdef USE_TRANSMISS worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`;const EB=`varying vec2 vUv; +#endif`;const RB=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,MB=`uniform sampler2D t2D; +}`,PB=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { @@ -2524,14 +2524,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,bB=`varying vec3 vWorldDirection; +}`,IB=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,TB=`#ifdef ENVMAP_TYPE_CUBE +}`,LB=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; @@ -2553,14 +2553,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,CB=`varying vec3 vWorldDirection; +}`,DB=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,AB=`uniform samplerCube tCube; +}`,NB=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; @@ -2570,7 +2570,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,RB=`#include +}`,OB=`#include #include #include #include @@ -2596,7 +2596,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,PB=`#if DEPTH_PACKING == 3200 +}`,kB=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -2626,7 +2626,7 @@ void main() { #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #endif -}`,IB=`#define DISTANCE +}`,UB=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -2652,7 +2652,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,LB=`#define DISTANCE +}`,FB=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -2676,13 +2676,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,DB=`varying vec3 vWorldDirection; +}`,zB=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,NB=`uniform sampler2D tEquirect; +}`,BB=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -2691,7 +2691,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,OB=`uniform float scale; +}`,VB=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -2712,7 +2712,7 @@ void main() { #include #include #include -}`,kB=`uniform vec3 diffuse; +}`,HB=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -2740,7 +2740,7 @@ void main() { #include #include #include -}`,UB=`#include +}`,$B=`#include #include #include #include @@ -2771,7 +2771,7 @@ void main() { #include #include #include -}`,FB=`uniform vec3 diffuse; +}`,WB=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2819,7 +2819,7 @@ void main() { #include #include #include -}`,zB=`#define LAMBERT +}`,GB=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -2857,7 +2857,7 @@ void main() { #include #include #include -}`,BB=`#define LAMBERT +}`,jB=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -2914,7 +2914,7 @@ void main() { #include #include #include -}`,VB=`#define MATCAP +}`,XB=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -2947,7 +2947,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,HB=`#define MATCAP +}`,qB=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -2993,7 +2993,7 @@ void main() { #include #include #include -}`,$B=`#define NORMAL +}`,YB=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif @@ -3025,7 +3025,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif -}`,WB=`#define NORMAL +}`,ZB=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; @@ -3047,7 +3047,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,GB=`#define PHONG +}`,KB=`#define PHONG varying vec3 vViewPosition; #include #include @@ -3085,7 +3085,7 @@ void main() { #include #include #include -}`,jB=`#define PHONG +}`,QB=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -3144,7 +3144,7 @@ void main() { #include #include #include -}`,XB=`#define STANDARD +}`,JB=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -3186,7 +3186,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,qB=`#define STANDARD +}`,e6=`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR @@ -3308,7 +3308,7 @@ void main() { #include #include #include -}`,YB=`#define TOON +}`,t6=`#define TOON varying vec3 vViewPosition; #include #include @@ -3344,7 +3344,7 @@ void main() { #include #include #include -}`,ZB=`#define TOON +}`,n6=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3397,7 +3397,7 @@ void main() { #include #include #include -}`,KB=`uniform float size; +}`,r6=`uniform float size; uniform float scale; #include #include @@ -3427,7 +3427,7 @@ void main() { #include #include #include -}`,QB=`uniform vec3 diffuse; +}`,i6=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3452,7 +3452,7 @@ void main() { #include #include #include -}`,JB=`#include +}`,s6=`#include #include #include #include @@ -3474,7 +3474,7 @@ void main() { #include #include #include -}`,e6=`uniform vec3 color; +}`,o6=`uniform vec3 color; uniform float opacity; #include #include @@ -3490,7 +3490,7 @@ void main() { #include #include #include -}`,t6=`uniform float rotation; +}`,a6=`uniform float rotation; uniform vec2 center; #include #include @@ -3516,7 +3516,7 @@ void main() { #include #include #include -}`,n6=`uniform vec3 diffuse; +}`,l6=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3541,7 +3541,7 @@ void main() { #include #include #include -}`,zt={alphahash_fragment:M5,alphahash_pars_fragment:b5,alphamap_fragment:T5,alphamap_pars_fragment:C5,alphatest_fragment:A5,alphatest_pars_fragment:R5,aomap_fragment:P5,aomap_pars_fragment:I5,batching_pars_vertex:L5,batching_vertex:D5,begin_vertex:N5,beginnormal_vertex:O5,bsdfs:k5,iridescence_fragment:U5,bumpmap_pars_fragment:F5,clipping_planes_fragment:z5,clipping_planes_pars_fragment:B5,clipping_planes_pars_vertex:V5,clipping_planes_vertex:H5,color_fragment:$5,color_pars_fragment:W5,color_pars_vertex:G5,color_vertex:j5,common:X5,cube_uv_reflection_fragment:q5,defaultnormal_vertex:Y5,displacementmap_pars_vertex:Z5,displacementmap_vertex:K5,emissivemap_fragment:Q5,emissivemap_pars_fragment:J5,colorspace_fragment:ez,colorspace_pars_fragment:tz,envmap_fragment:nz,envmap_common_pars_fragment:rz,envmap_pars_fragment:iz,envmap_pars_vertex:sz,envmap_physical_pars_fragment:vz,envmap_vertex:oz,fog_vertex:az,fog_pars_vertex:lz,fog_fragment:cz,fog_pars_fragment:uz,gradientmap_pars_fragment:dz,lightmap_fragment:fz,lightmap_pars_fragment:hz,lights_lambert_fragment:pz,lights_lambert_pars_fragment:mz,lights_pars_begin:gz,lights_toon_fragment:yz,lights_toon_pars_fragment:xz,lights_phong_fragment:_z,lights_phong_pars_fragment:Sz,lights_physical_fragment:wz,lights_physical_pars_fragment:Ez,lights_fragment_begin:Mz,lights_fragment_maps:bz,lights_fragment_end:Tz,logdepthbuf_fragment:Cz,logdepthbuf_pars_fragment:Az,logdepthbuf_pars_vertex:Rz,logdepthbuf_vertex:Pz,map_fragment:Iz,map_pars_fragment:Lz,map_particle_fragment:Dz,map_particle_pars_fragment:Nz,metalnessmap_fragment:Oz,metalnessmap_pars_fragment:kz,morphcolor_vertex:Uz,morphnormal_vertex:Fz,morphtarget_pars_vertex:zz,morphtarget_vertex:Bz,normal_fragment_begin:Vz,normal_fragment_maps:Hz,normal_pars_fragment:$z,normal_pars_vertex:Wz,normal_vertex:Gz,normalmap_pars_fragment:jz,clearcoat_normal_fragment_begin:Xz,clearcoat_normal_fragment_maps:qz,clearcoat_pars_fragment:Yz,iridescence_pars_fragment:Zz,opaque_fragment:Kz,packing:Qz,premultiplied_alpha_fragment:Jz,project_vertex:eB,dithering_fragment:tB,dithering_pars_fragment:nB,roughnessmap_fragment:rB,roughnessmap_pars_fragment:iB,shadowmap_pars_fragment:sB,shadowmap_pars_vertex:oB,shadowmap_vertex:aB,shadowmask_pars_fragment:lB,skinbase_vertex:cB,skinning_pars_vertex:uB,skinning_vertex:dB,skinnormal_vertex:fB,specularmap_fragment:hB,specularmap_pars_fragment:pB,tonemapping_fragment:mB,tonemapping_pars_fragment:gB,transmission_fragment:vB,transmission_pars_fragment:yB,uv_pars_fragment:xB,uv_pars_vertex:_B,uv_vertex:SB,worldpos_vertex:wB,background_vert:EB,background_frag:MB,backgroundCube_vert:bB,backgroundCube_frag:TB,cube_vert:CB,cube_frag:AB,depth_vert:RB,depth_frag:PB,distanceRGBA_vert:IB,distanceRGBA_frag:LB,equirect_vert:DB,equirect_frag:NB,linedashed_vert:OB,linedashed_frag:kB,meshbasic_vert:UB,meshbasic_frag:FB,meshlambert_vert:zB,meshlambert_frag:BB,meshmatcap_vert:VB,meshmatcap_frag:HB,meshnormal_vert:$B,meshnormal_frag:WB,meshphong_vert:GB,meshphong_frag:jB,meshphysical_vert:XB,meshphysical_frag:qB,meshtoon_vert:YB,meshtoon_frag:ZB,points_vert:KB,points_frag:QB,shadow_vert:JB,shadow_frag:e6,sprite_vert:t6,sprite_frag:n6},Ve={common:{diffuse:{value:new Be(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Vt},alphaMap:{value:null},alphaMapTransform:{value:new Vt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Vt}},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 Vt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Vt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Vt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Vt},normalScale:{value:new ge(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Vt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Vt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Vt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Vt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Be(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 Be(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Vt},alphaTest:{value:0},uvTransform:{value:new Vt}},sprite:{diffuse:{value:new Be(16777215)},opacity:{value:1},center:{value:new ge(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Vt},alphaMap:{value:null},alphaMapTransform:{value:new Vt},alphaTest:{value:0}}},Ms={basic:{uniforms:Xr([Ve.common,Ve.specularmap,Ve.envmap,Ve.aomap,Ve.lightmap,Ve.fog]),vertexShader:zt.meshbasic_vert,fragmentShader:zt.meshbasic_frag},lambert:{uniforms:Xr([Ve.common,Ve.specularmap,Ve.envmap,Ve.aomap,Ve.lightmap,Ve.emissivemap,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,Ve.fog,Ve.lights,{emissive:{value:new Be(0)}}]),vertexShader:zt.meshlambert_vert,fragmentShader:zt.meshlambert_frag},phong:{uniforms:Xr([Ve.common,Ve.specularmap,Ve.envmap,Ve.aomap,Ve.lightmap,Ve.emissivemap,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,Ve.fog,Ve.lights,{emissive:{value:new Be(0)},specular:{value:new Be(1118481)},shininess:{value:30}}]),vertexShader:zt.meshphong_vert,fragmentShader:zt.meshphong_frag},standard:{uniforms:Xr([Ve.common,Ve.envmap,Ve.aomap,Ve.lightmap,Ve.emissivemap,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,Ve.roughnessmap,Ve.metalnessmap,Ve.fog,Ve.lights,{emissive:{value:new Be(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:zt.meshphysical_vert,fragmentShader:zt.meshphysical_frag},toon:{uniforms:Xr([Ve.common,Ve.aomap,Ve.lightmap,Ve.emissivemap,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,Ve.gradientmap,Ve.fog,Ve.lights,{emissive:{value:new Be(0)}}]),vertexShader:zt.meshtoon_vert,fragmentShader:zt.meshtoon_frag},matcap:{uniforms:Xr([Ve.common,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,Ve.fog,{matcap:{value:null}}]),vertexShader:zt.meshmatcap_vert,fragmentShader:zt.meshmatcap_frag},points:{uniforms:Xr([Ve.points,Ve.fog]),vertexShader:zt.points_vert,fragmentShader:zt.points_frag},dashed:{uniforms:Xr([Ve.common,Ve.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:zt.linedashed_vert,fragmentShader:zt.linedashed_frag},depth:{uniforms:Xr([Ve.common,Ve.displacementmap]),vertexShader:zt.depth_vert,fragmentShader:zt.depth_frag},normal:{uniforms:Xr([Ve.common,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,{opacity:{value:1}}]),vertexShader:zt.meshnormal_vert,fragmentShader:zt.meshnormal_frag},sprite:{uniforms:Xr([Ve.sprite,Ve.fog]),vertexShader:zt.sprite_vert,fragmentShader:zt.sprite_frag},background:{uniforms:{uvTransform:{value:new Vt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:zt.background_vert,fragmentShader:zt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:zt.backgroundCube_vert,fragmentShader:zt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:zt.cube_vert,fragmentShader:zt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:zt.equirect_vert,fragmentShader:zt.equirect_frag},distanceRGBA:{uniforms:Xr([Ve.common,Ve.displacementmap,{referencePosition:{value:new F},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:zt.distanceRGBA_vert,fragmentShader:zt.distanceRGBA_frag},shadow:{uniforms:Xr([Ve.lights,Ve.fog,{color:{value:new Be(0)},opacity:{value:1}}]),vertexShader:zt.shadow_vert,fragmentShader:zt.shadow_frag}};Ms.physical={uniforms:Xr([Ms.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Vt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Vt},clearcoatNormalScale:{value:new ge(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Vt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Vt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Vt},sheen:{value:0},sheenColor:{value:new Be(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Vt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Vt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Vt},transmissionSamplerSize:{value:new ge},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Vt},attenuationDistance:{value:0},attenuationColor:{value:new Be(0)},specularColor:{value:new Be(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Vt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Vt},anisotropyVector:{value:new ge},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Vt}}]),vertexShader:zt.meshphysical_vert,fragmentShader:zt.meshphysical_frag};const xg={r:0,b:0,g:0};function r6(n,e,t,r,i,s,o){const a=new Be(0);let l=s===!0?0:1,u,f,h=null,p=0,m=null;function v(x,g){let S=!1,_=g.isScene===!0?g.background:null;_&&_.isTexture&&(_=(g.backgroundBlurriness>0?t:e).get(_)),_===null?w(a,l):_&&_.isColor&&(w(_,1),S=!0);const b=n.xr.getEnvironmentBlendMode();b==="additive"?r.buffers.color.setClear(0,0,0,1,o):b==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,o),(n.autoClear||S)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),_&&(_.isCubeTexture||_.mapping===Hd)?(f===void 0&&(f=new qn(new Ic(1,1,1),new as({name:"BackgroundCubeMaterial",uniforms:bd(Ms.backgroundCube.uniforms),vertexShader:Ms.backgroundCube.vertexShader,fragmentShader:Ms.backgroundCube.fragmentShader,side:Kr,depthTest:!1,depthWrite:!1,fog:!1})),f.geometry.deleteAttribute("normal"),f.geometry.deleteAttribute("uv"),f.onBeforeRender=function(A,R,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(f.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(f)),f.material.uniforms.envMap.value=_,f.material.uniforms.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,f.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,f.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,f.material.toneMapped=cn.getTransfer(_.colorSpace)!==pn,(h!==_||p!==_.version||m!==n.toneMapping)&&(f.material.needsUpdate=!0,h=_,p=_.version,m=n.toneMapping),f.layers.enableAll(),x.unshift(f,f.geometry,f.material,0,0,null)):_&&_.isTexture&&(u===void 0&&(u=new qn(new Wd(2,2),new as({name:"BackgroundMaterial",uniforms:bd(Ms.background.uniforms),vertexShader:Ms.background.vertexShader,fragmentShader:Ms.background.fragmentShader,side:$o,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=_,u.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,u.material.toneMapped=cn.getTransfer(_.colorSpace)!==pn,_.matrixAutoUpdate===!0&&_.updateMatrix(),u.material.uniforms.uvTransform.value.copy(_.matrix),(h!==_||p!==_.version||m!==n.toneMapping)&&(u.material.needsUpdate=!0,h=_,p=_.version,m=n.toneMapping),u.layers.enableAll(),x.unshift(u,u.geometry,u.material,0,0,null))}function w(x,g){x.getRGB(xg,B3(n)),r.buffers.color.setClear(xg.r,xg.g,xg.b,g,o)}return{getClearColor:function(){return a},setClearColor:function(x,g=1){a.set(x),l=g,w(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(x){l=x,w(a,l)},render:v}}function i6(n,e,t,r){const i=n.getParameter(n.MAX_VERTEX_ATTRIBS),s=r.isWebGL2?null:e.get("OES_vertex_array_object"),o=r.isWebGL2||s!==null,a={},l=x(null);let u=l,f=!1;function h(z,j,Y,re,U){let X=!1;if(o){const q=w(re,Y,j);u!==q&&(u=q,m(u.object)),X=g(z,re,Y,U),X&&S(z,re,Y,U)}else{const q=j.wireframe===!0;(u.geometry!==re.id||u.program!==Y.id||u.wireframe!==q)&&(u.geometry=re.id,u.program=Y.id,u.wireframe=q,X=!0)}U!==null&&t.update(U,n.ELEMENT_ARRAY_BUFFER),(X||f)&&(f=!1,D(z,j,Y,re),U!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(U).buffer))}function p(){return r.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function m(z){return r.isWebGL2?n.bindVertexArray(z):s.bindVertexArrayOES(z)}function v(z){return r.isWebGL2?n.deleteVertexArray(z):s.deleteVertexArrayOES(z)}function w(z,j,Y){const re=Y.wireframe===!0;let U=a[z.id];U===void 0&&(U={},a[z.id]=U);let X=U[j.id];X===void 0&&(X={},U[j.id]=X);let q=X[re];return q===void 0&&(q=x(p()),X[re]=q),q}function x(z){const j=[],Y=[],re=[];for(let U=0;U=0){const te=U[se];let le=X[se];if(le===void 0&&(se==="instanceMatrix"&&z.instanceMatrix&&(le=z.instanceMatrix),se==="instanceColor"&&z.instanceColor&&(le=z.instanceColor)),te===void 0||te.attribute!==le||le&&te.data!==le.data)return!0;q++}return u.attributesNum!==q||u.index!==re}function S(z,j,Y,re){const U={},X=j.attributes;let q=0;const K=Y.getAttributes();for(const se in K)if(K[se].location>=0){let te=X[se];te===void 0&&(se==="instanceMatrix"&&z.instanceMatrix&&(te=z.instanceMatrix),se==="instanceColor"&&z.instanceColor&&(te=z.instanceColor));const le={};le.attribute=te,te&&te.data&&(le.data=te.data),U[se]=le,q++}u.attributes=U,u.attributesNum=q,u.index=re}function _(){const z=u.newAttributes;for(let j=0,Y=z.length;j=0){let ve=U[K];if(ve===void 0&&(K==="instanceMatrix"&&z.instanceMatrix&&(ve=z.instanceMatrix),K==="instanceColor"&&z.instanceColor&&(ve=z.instanceColor)),ve!==void 0){const te=ve.normalized,le=ve.itemSize,Me=t.get(ve);if(Me===void 0)continue;const pe=Me.buffer,Ae=Me.type,De=Me.bytesPerElement,Re=r.isWebGL2===!0&&(Ae===n.INT||Ae===n.UNSIGNED_INT||ve.gpuType===dE);if(ve.isInterleavedBufferAttribute){const Ce=ve.data,H=Ce.stride,xe=ve.offset;if(Ce.isInstancedInterleavedBuffer){for(let de=0;de0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";P="mediump"}return P==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n.constructor.name==="WebGL2RenderingContext";let a=t.precision!==void 0?t.precision:"highp";const l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const u=o||e.has("WEBGL_draw_buffers"),f=t.logarithmicDepthBuffer===!0,h=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),p=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),m=n.getParameter(n.MAX_TEXTURE_SIZE),v=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),w=n.getParameter(n.MAX_VERTEX_ATTRIBS),x=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),g=n.getParameter(n.MAX_VARYING_VECTORS),S=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),_=p>0,b=o||e.has("OES_texture_float"),A=_&&b,R=o?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:f,maxTextures:h,maxVertexTextures:p,maxTextureSize:m,maxCubemapSize:v,maxAttributes:w,maxVertexUniforms:x,maxVaryings:g,maxFragmentUniforms:S,vertexTextures:_,floatFragmentTextures:b,floatVertexTextures:A,maxSamples:R}}function a6(n){const e=this;let t=null,r=0,i=!1,s=!1;const o=new Qs,a=new Vt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,p){const m=h.length!==0||p||r!==0||i;return i=p,r=h.length,m},this.beginShadows=function(){s=!0,f(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(h,p){t=f(h,p,0)},this.setState=function(h,p,m){const v=h.clippingPlanes,w=h.clipIntersection,x=h.clipShadows,g=n.get(h);if(!i||v===null||v.length===0||s&&!x)s?f(null):u();else{const S=s?0:r,_=S*4;let b=g.clippingState||null;l.value=b,b=f(v,p,_,m);for(let A=0;A!==_;++A)b[A]=t[A];g.clippingState=b,this.numIntersection=w?this.numPlanes:0,this.numPlanes+=S}};function u(){l.value!==t&&(l.value=t,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function f(h,p,m,v){const w=h!==null?h.length:0;let x=null;if(w!==0){if(x=l.value,v!==!0||x===null){const g=m+w*4,S=p.matrixWorldInverse;a.getNormalMatrix(S),(x===null||x.length0){const u=new $3(l.height);return u.fromEquirectangularTexture(n,o),e.set(o,u),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){const a=o.target;a.removeEventListener("dispose",i);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:r,dispose:s}}class Oo extends $d{constructor(e=-1,t=1,r=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=r,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),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,t,r,i,s,o){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=t,this.view.offsetX=r,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=r-e,o=r+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,f=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=u*this.view.offsetX,o=s+u*this.view.width,a-=f*this.view.offsetY,l=a-f*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const ku=4,DC=[.125,.215,.35,.446,.526,.582],Wl=20,S_=new Oo,NC=new Be;let w_=null,E_=0,M_=0;const Bl=(1+Math.sqrt(5))/2,xu=1/Bl,OC=[new F(1,1,1),new F(-1,1,1),new F(1,1,-1),new F(-1,1,-1),new F(0,Bl,xu),new F(0,Bl,-xu),new F(xu,0,Bl),new F(-xu,0,Bl),new F(Bl,xu,0),new F(-Bl,xu,0)];class _1{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,t=0,r=.1,i=100){w_=this._renderer.getRenderTarget(),E_=this._renderer.getActiveCubeFace(),M_=this._renderer.getActiveMipmapLevel(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,r,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=FC(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=UC(),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?_:0,_,_),f.setRenderTarget(i),w&&f.render(v,a),f.render(e,a)}v.geometry.dispose(),v.material.dispose(),f.toneMapping=p,f.autoClear=h,e.background=x}_textureToCubeUV(e,t){const r=this._renderer,i=e.mapping===Wo||e.mapping===el;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=FC()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=UC());const s=i?this._cubemapMaterial:this._equirectMaterial,o=new qn(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;_g(t,0,0,3*l,2*l),r.setRenderTarget(t),r.render(o,S_)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;for(let i=1;iWl&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${Wl}`);const g=[];let S=0;for(let P=0;P_-ku?i-_+ku:0),R=4*(this._cubeSize-b);_g(t,A,R,3*b,2*b),l.setRenderTarget(t),l.render(h,S_)}}function c6(n){const e=[],t=[],r=[];let i=n;const s=n-ku+1+DC.length;for(let o=0;on-ku?l=DC[o-n+ku-1]:o===0&&(l=0),r.push(l);const u=1/(a-2),f=-u,h=1+u,p=[f,f,h,f,h,h,f,f,h,h,f,h],m=6,v=6,w=3,x=2,g=1,S=new Float32Array(w*v*m),_=new Float32Array(x*v*m),b=new Float32Array(g*v*m);for(let R=0;R2?0:-1,V=[P,D,0,P+2/3,D,0,P+2/3,D+1,0,P,D,0,P+2/3,D+1,0,P,D+1,0];S.set(V,w*v*R),_.set(p,x*v*R);const C=[R,R,R,R,R,R];b.set(C,g*v*R)}const A=new Ut;A.setAttribute("position",new an(S,w)),A.setAttribute("uv",new an(_,x)),A.setAttribute("faceIndex",new an(b,g)),e.push(A),i>ku&&i--}return{lodPlanes:e,sizeLods:t,sigmas:r}}function kC(n,e,t){const r=new gi(n,e,t);return r.texture.mapping=Hd,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function _g(n,e,t,r,i){n.viewport.set(e,t,r,i),n.scissor.set(e,t,r,i)}function u6(n,e,t){const r=new Float32Array(Wl),i=new F(0,1,0);return new as({name:"SphericalGaussianBlur",defines:{n:Wl,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:TE(),fragmentShader:` +}`,zt={alphahash_fragment:P5,alphahash_pars_fragment:I5,alphamap_fragment:L5,alphamap_pars_fragment:D5,alphatest_fragment:N5,alphatest_pars_fragment:O5,aomap_fragment:k5,aomap_pars_fragment:U5,batching_pars_vertex:F5,batching_vertex:z5,begin_vertex:B5,beginnormal_vertex:V5,bsdfs:H5,iridescence_fragment:$5,bumpmap_pars_fragment:W5,clipping_planes_fragment:G5,clipping_planes_pars_fragment:j5,clipping_planes_pars_vertex:X5,clipping_planes_vertex:q5,color_fragment:Y5,color_pars_fragment:Z5,color_pars_vertex:K5,color_vertex:Q5,common:J5,cube_uv_reflection_fragment:ez,defaultnormal_vertex:tz,displacementmap_pars_vertex:nz,displacementmap_vertex:rz,emissivemap_fragment:iz,emissivemap_pars_fragment:sz,colorspace_fragment:oz,colorspace_pars_fragment:az,envmap_fragment:lz,envmap_common_pars_fragment:cz,envmap_pars_fragment:uz,envmap_pars_vertex:dz,envmap_physical_pars_fragment:Ez,envmap_vertex:fz,fog_vertex:hz,fog_pars_vertex:pz,fog_fragment:mz,fog_pars_fragment:gz,gradientmap_pars_fragment:vz,lightmap_fragment:yz,lightmap_pars_fragment:xz,lights_lambert_fragment:_z,lights_lambert_pars_fragment:Sz,lights_pars_begin:wz,lights_toon_fragment:Mz,lights_toon_pars_fragment:bz,lights_phong_fragment:Tz,lights_phong_pars_fragment:Cz,lights_physical_fragment:Az,lights_physical_pars_fragment:Rz,lights_fragment_begin:Pz,lights_fragment_maps:Iz,lights_fragment_end:Lz,logdepthbuf_fragment:Dz,logdepthbuf_pars_fragment:Nz,logdepthbuf_pars_vertex:Oz,logdepthbuf_vertex:kz,map_fragment:Uz,map_pars_fragment:Fz,map_particle_fragment:zz,map_particle_pars_fragment:Bz,metalnessmap_fragment:Vz,metalnessmap_pars_fragment:Hz,morphcolor_vertex:$z,morphnormal_vertex:Wz,morphtarget_pars_vertex:Gz,morphtarget_vertex:jz,normal_fragment_begin:Xz,normal_fragment_maps:qz,normal_pars_fragment:Yz,normal_pars_vertex:Zz,normal_vertex:Kz,normalmap_pars_fragment:Qz,clearcoat_normal_fragment_begin:Jz,clearcoat_normal_fragment_maps:eB,clearcoat_pars_fragment:tB,iridescence_pars_fragment:nB,opaque_fragment:rB,packing:iB,premultiplied_alpha_fragment:sB,project_vertex:oB,dithering_fragment:aB,dithering_pars_fragment:lB,roughnessmap_fragment:cB,roughnessmap_pars_fragment:uB,shadowmap_pars_fragment:dB,shadowmap_pars_vertex:fB,shadowmap_vertex:hB,shadowmask_pars_fragment:pB,skinbase_vertex:mB,skinning_pars_vertex:gB,skinning_vertex:vB,skinnormal_vertex:yB,specularmap_fragment:xB,specularmap_pars_fragment:_B,tonemapping_fragment:SB,tonemapping_pars_fragment:wB,transmission_fragment:EB,transmission_pars_fragment:MB,uv_pars_fragment:bB,uv_pars_vertex:TB,uv_vertex:CB,worldpos_vertex:AB,background_vert:RB,background_frag:PB,backgroundCube_vert:IB,backgroundCube_frag:LB,cube_vert:DB,cube_frag:NB,depth_vert:OB,depth_frag:kB,distanceRGBA_vert:UB,distanceRGBA_frag:FB,equirect_vert:zB,equirect_frag:BB,linedashed_vert:VB,linedashed_frag:HB,meshbasic_vert:$B,meshbasic_frag:WB,meshlambert_vert:GB,meshlambert_frag:jB,meshmatcap_vert:XB,meshmatcap_frag:qB,meshnormal_vert:YB,meshnormal_frag:ZB,meshphong_vert:KB,meshphong_frag:QB,meshphysical_vert:JB,meshphysical_frag:e6,meshtoon_vert:t6,meshtoon_frag:n6,points_vert:r6,points_frag:i6,shadow_vert:s6,shadow_frag:o6,sprite_vert:a6,sprite_frag:l6},Ve={common:{diffuse:{value:new Be(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Vt},alphaMap:{value:null},alphaMapTransform:{value:new Vt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Vt}},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 Vt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Vt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Vt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Vt},normalScale:{value:new ge(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Vt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Vt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Vt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Vt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Be(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 Be(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Vt},alphaTest:{value:0},uvTransform:{value:new Vt}},sprite:{diffuse:{value:new Be(16777215)},opacity:{value:1},center:{value:new ge(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Vt},alphaMap:{value:null},alphaMapTransform:{value:new Vt},alphaTest:{value:0}}},bs={basic:{uniforms:Xr([Ve.common,Ve.specularmap,Ve.envmap,Ve.aomap,Ve.lightmap,Ve.fog]),vertexShader:zt.meshbasic_vert,fragmentShader:zt.meshbasic_frag},lambert:{uniforms:Xr([Ve.common,Ve.specularmap,Ve.envmap,Ve.aomap,Ve.lightmap,Ve.emissivemap,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,Ve.fog,Ve.lights,{emissive:{value:new Be(0)}}]),vertexShader:zt.meshlambert_vert,fragmentShader:zt.meshlambert_frag},phong:{uniforms:Xr([Ve.common,Ve.specularmap,Ve.envmap,Ve.aomap,Ve.lightmap,Ve.emissivemap,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,Ve.fog,Ve.lights,{emissive:{value:new Be(0)},specular:{value:new Be(1118481)},shininess:{value:30}}]),vertexShader:zt.meshphong_vert,fragmentShader:zt.meshphong_frag},standard:{uniforms:Xr([Ve.common,Ve.envmap,Ve.aomap,Ve.lightmap,Ve.emissivemap,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,Ve.roughnessmap,Ve.metalnessmap,Ve.fog,Ve.lights,{emissive:{value:new Be(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:zt.meshphysical_vert,fragmentShader:zt.meshphysical_frag},toon:{uniforms:Xr([Ve.common,Ve.aomap,Ve.lightmap,Ve.emissivemap,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,Ve.gradientmap,Ve.fog,Ve.lights,{emissive:{value:new Be(0)}}]),vertexShader:zt.meshtoon_vert,fragmentShader:zt.meshtoon_frag},matcap:{uniforms:Xr([Ve.common,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,Ve.fog,{matcap:{value:null}}]),vertexShader:zt.meshmatcap_vert,fragmentShader:zt.meshmatcap_frag},points:{uniforms:Xr([Ve.points,Ve.fog]),vertexShader:zt.points_vert,fragmentShader:zt.points_frag},dashed:{uniforms:Xr([Ve.common,Ve.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:zt.linedashed_vert,fragmentShader:zt.linedashed_frag},depth:{uniforms:Xr([Ve.common,Ve.displacementmap]),vertexShader:zt.depth_vert,fragmentShader:zt.depth_frag},normal:{uniforms:Xr([Ve.common,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,{opacity:{value:1}}]),vertexShader:zt.meshnormal_vert,fragmentShader:zt.meshnormal_frag},sprite:{uniforms:Xr([Ve.sprite,Ve.fog]),vertexShader:zt.sprite_vert,fragmentShader:zt.sprite_frag},background:{uniforms:{uvTransform:{value:new Vt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:zt.background_vert,fragmentShader:zt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:zt.backgroundCube_vert,fragmentShader:zt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:zt.cube_vert,fragmentShader:zt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:zt.equirect_vert,fragmentShader:zt.equirect_frag},distanceRGBA:{uniforms:Xr([Ve.common,Ve.displacementmap,{referencePosition:{value:new F},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:zt.distanceRGBA_vert,fragmentShader:zt.distanceRGBA_frag},shadow:{uniforms:Xr([Ve.lights,Ve.fog,{color:{value:new Be(0)},opacity:{value:1}}]),vertexShader:zt.shadow_vert,fragmentShader:zt.shadow_frag}};bs.physical={uniforms:Xr([bs.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Vt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Vt},clearcoatNormalScale:{value:new ge(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Vt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Vt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Vt},sheen:{value:0},sheenColor:{value:new Be(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Vt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Vt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Vt},transmissionSamplerSize:{value:new ge},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Vt},attenuationDistance:{value:0},attenuationColor:{value:new Be(0)},specularColor:{value:new Be(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Vt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Vt},anisotropyVector:{value:new ge},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Vt}}]),vertexShader:zt.meshphysical_vert,fragmentShader:zt.meshphysical_frag};const Sg={r:0,b:0,g:0};function c6(n,e,t,r,i,s,o){const a=new Be(0);let l=s===!0?0:1,u,f,h=null,p=0,m=null;function v(x,g){let S=!1,_=g.isScene===!0?g.background:null;_&&_.isTexture&&(_=(g.backgroundBlurriness>0?t:e).get(_)),_===null?w(a,l):_&&_.isColor&&(w(_,1),S=!0);const b=n.xr.getEnvironmentBlendMode();b==="additive"?r.buffers.color.setClear(0,0,0,1,o):b==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,o),(n.autoClear||S)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),_&&(_.isCubeTexture||_.mapping===Wd)?(f===void 0&&(f=new qn(new Dc(1,1,1),new as({name:"BackgroundCubeMaterial",uniforms:Cd(bs.backgroundCube.uniforms),vertexShader:bs.backgroundCube.vertexShader,fragmentShader:bs.backgroundCube.fragmentShader,side:Kr,depthTest:!1,depthWrite:!1,fog:!1})),f.geometry.deleteAttribute("normal"),f.geometry.deleteAttribute("uv"),f.onBeforeRender=function(A,R,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(f.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(f)),f.material.uniforms.envMap.value=_,f.material.uniforms.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,f.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,f.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,f.material.toneMapped=ln.getTransfer(_.colorSpace)!==hn,(h!==_||p!==_.version||m!==n.toneMapping)&&(f.material.needsUpdate=!0,h=_,p=_.version,m=n.toneMapping),f.layers.enableAll(),x.unshift(f,f.geometry,f.material,0,0,null)):_&&_.isTexture&&(u===void 0&&(u=new qn(new jd(2,2),new as({name:"BackgroundMaterial",uniforms:Cd(bs.background.uniforms),vertexShader:bs.background.vertexShader,fragmentShader:bs.background.fragmentShader,side:Wo,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=_,u.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,u.material.toneMapped=ln.getTransfer(_.colorSpace)!==hn,_.matrixAutoUpdate===!0&&_.updateMatrix(),u.material.uniforms.uvTransform.value.copy(_.matrix),(h!==_||p!==_.version||m!==n.toneMapping)&&(u.material.needsUpdate=!0,h=_,p=_.version,m=n.toneMapping),u.layers.enableAll(),x.unshift(u,u.geometry,u.material,0,0,null))}function w(x,g){x.getRGB(Sg,V3(n)),r.buffers.color.setClear(Sg.r,Sg.g,Sg.b,g,o)}return{getClearColor:function(){return a},setClearColor:function(x,g=1){a.set(x),l=g,w(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(x){l=x,w(a,l)},render:v}}function u6(n,e,t,r){const i=n.getParameter(n.MAX_VERTEX_ATTRIBS),s=r.isWebGL2?null:e.get("OES_vertex_array_object"),o=r.isWebGL2||s!==null,a={},l=x(null);let u=l,f=!1;function h(z,j,Y,re,U){let X=!1;if(o){const q=w(re,Y,j);u!==q&&(u=q,m(u.object)),X=g(z,re,Y,U),X&&S(z,re,Y,U)}else{const q=j.wireframe===!0;(u.geometry!==re.id||u.program!==Y.id||u.wireframe!==q)&&(u.geometry=re.id,u.program=Y.id,u.wireframe=q,X=!0)}U!==null&&t.update(U,n.ELEMENT_ARRAY_BUFFER),(X||f)&&(f=!1,D(z,j,Y,re),U!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(U).buffer))}function p(){return r.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function m(z){return r.isWebGL2?n.bindVertexArray(z):s.bindVertexArrayOES(z)}function v(z){return r.isWebGL2?n.deleteVertexArray(z):s.deleteVertexArrayOES(z)}function w(z,j,Y){const re=Y.wireframe===!0;let U=a[z.id];U===void 0&&(U={},a[z.id]=U);let X=U[j.id];X===void 0&&(X={},U[j.id]=X);let q=X[re];return q===void 0&&(q=x(p()),X[re]=q),q}function x(z){const j=[],Y=[],re=[];for(let U=0;U=0){const te=U[se];let le=X[se];if(le===void 0&&(se==="instanceMatrix"&&z.instanceMatrix&&(le=z.instanceMatrix),se==="instanceColor"&&z.instanceColor&&(le=z.instanceColor)),te===void 0||te.attribute!==le||le&&te.data!==le.data)return!0;q++}return u.attributesNum!==q||u.index!==re}function S(z,j,Y,re){const U={},X=j.attributes;let q=0;const K=Y.getAttributes();for(const se in K)if(K[se].location>=0){let te=X[se];te===void 0&&(se==="instanceMatrix"&&z.instanceMatrix&&(te=z.instanceMatrix),se==="instanceColor"&&z.instanceColor&&(te=z.instanceColor));const le={};le.attribute=te,te&&te.data&&(le.data=te.data),U[se]=le,q++}u.attributes=U,u.attributesNum=q,u.index=re}function _(){const z=u.newAttributes;for(let j=0,Y=z.length;j=0){let ve=U[K];if(ve===void 0&&(K==="instanceMatrix"&&z.instanceMatrix&&(ve=z.instanceMatrix),K==="instanceColor"&&z.instanceColor&&(ve=z.instanceColor)),ve!==void 0){const te=ve.normalized,le=ve.itemSize,Me=t.get(ve);if(Me===void 0)continue;const pe=Me.buffer,Ae=Me.type,De=Me.bytesPerElement,Re=r.isWebGL2===!0&&(Ae===n.INT||Ae===n.UNSIGNED_INT||ve.gpuType===hE);if(ve.isInterleavedBufferAttribute){const Ce=ve.data,H=Ce.stride,xe=ve.offset;if(Ce.isInstancedInterleavedBuffer){for(let de=0;de0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";P="mediump"}return P==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n.constructor.name==="WebGL2RenderingContext";let a=t.precision!==void 0?t.precision:"highp";const l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const u=o||e.has("WEBGL_draw_buffers"),f=t.logarithmicDepthBuffer===!0,h=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),p=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),m=n.getParameter(n.MAX_TEXTURE_SIZE),v=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),w=n.getParameter(n.MAX_VERTEX_ATTRIBS),x=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),g=n.getParameter(n.MAX_VARYING_VECTORS),S=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),_=p>0,b=o||e.has("OES_texture_float"),A=_&&b,R=o?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:f,maxTextures:h,maxVertexTextures:p,maxTextureSize:m,maxCubemapSize:v,maxAttributes:w,maxVertexUniforms:x,maxVaryings:g,maxFragmentUniforms:S,vertexTextures:_,floatFragmentTextures:b,floatVertexTextures:A,maxSamples:R}}function h6(n){const e=this;let t=null,r=0,i=!1,s=!1;const o=new Js,a=new Vt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,p){const m=h.length!==0||p||r!==0||i;return i=p,r=h.length,m},this.beginShadows=function(){s=!0,f(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(h,p){t=f(h,p,0)},this.setState=function(h,p,m){const v=h.clippingPlanes,w=h.clipIntersection,x=h.clipShadows,g=n.get(h);if(!i||v===null||v.length===0||s&&!x)s?f(null):u();else{const S=s?0:r,_=S*4;let b=g.clippingState||null;l.value=b,b=f(v,p,_,m);for(let A=0;A!==_;++A)b[A]=t[A];g.clippingState=b,this.numIntersection=w?this.numPlanes:0,this.numPlanes+=S}};function u(){l.value!==t&&(l.value=t,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function f(h,p,m,v){const w=h!==null?h.length:0;let x=null;if(w!==0){if(x=l.value,v!==!0||x===null){const g=m+w*4,S=p.matrixWorldInverse;a.getNormalMatrix(S),(x===null||x.length0){const u=new W3(l.height);return u.fromEquirectangularTexture(n,o),e.set(o,u),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){const a=o.target;a.removeEventListener("dispose",i);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:r,dispose:s}}class ko extends Gd{constructor(e=-1,t=1,r=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=r,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),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,t,r,i,s,o){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=t,this.view.offsetX=r,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=r-e,o=r+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,f=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=u*this.view.offsetX,o=s+u*this.view.width,a-=f*this.view.offsetY,l=a-f*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Fu=4,DC=[.125,.215,.35,.446,.526,.582],Gl=20,E_=new ko,NC=new Be;let M_=null,b_=0,T_=0;const Vl=(1+Math.sqrt(5))/2,Su=1/Vl,OC=[new F(1,1,1),new F(-1,1,1),new F(1,1,-1),new F(-1,1,-1),new F(0,Vl,Su),new F(0,Vl,-Su),new F(Su,0,Vl),new F(-Su,0,Vl),new F(Vl,Su,0),new F(-Vl,Su,0)];class w1{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,t=0,r=.1,i=100){M_=this._renderer.getRenderTarget(),b_=this._renderer.getActiveCubeFace(),T_=this._renderer.getActiveMipmapLevel(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,r,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=FC(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=UC(),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?_:0,_,_),f.setRenderTarget(i),w&&f.render(v,a),f.render(e,a)}v.geometry.dispose(),v.material.dispose(),f.toneMapping=p,f.autoClear=h,e.background=x}_textureToCubeUV(e,t){const r=this._renderer,i=e.mapping===Go||e.mapping===tl;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=FC()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=UC());const s=i?this._cubemapMaterial:this._equirectMaterial,o=new qn(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;wg(t,0,0,3*l,2*l),r.setRenderTarget(t),r.render(o,E_)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;for(let i=1;iGl&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${Gl}`);const g=[];let S=0;for(let P=0;P_-Fu?i-_+Fu:0),R=4*(this._cubeSize-b);wg(t,A,R,3*b,2*b),l.setRenderTarget(t),l.render(h,E_)}}function m6(n){const e=[],t=[],r=[];let i=n;const s=n-Fu+1+DC.length;for(let o=0;on-Fu?l=DC[o-n+Fu-1]:o===0&&(l=0),r.push(l);const u=1/(a-2),f=-u,h=1+u,p=[f,f,h,f,h,h,f,f,h,h,f,h],m=6,v=6,w=3,x=2,g=1,S=new Float32Array(w*v*m),_=new Float32Array(x*v*m),b=new Float32Array(g*v*m);for(let R=0;R2?0:-1,V=[P,D,0,P+2/3,D,0,P+2/3,D+1,0,P,D,0,P+2/3,D+1,0,P,D+1,0];S.set(V,w*v*R),_.set(p,x*v*R);const C=[R,R,R,R,R,R];b.set(C,g*v*R)}const A=new Ut;A.setAttribute("position",new an(S,w)),A.setAttribute("uv",new an(_,x)),A.setAttribute("faceIndex",new an(b,g)),e.push(A),i>Fu&&i--}return{lodPlanes:e,sizeLods:t,sigmas:r}}function kC(n,e,t){const r=new gi(n,e,t);return r.texture.mapping=Wd,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function wg(n,e,t,r,i){n.viewport.set(e,t,r,i),n.scissor.set(e,t,r,i)}function g6(n,e,t){const r=new Float32Array(Gl),i=new F(0,1,0);return new as({name:"SphericalGaussianBlur",defines:{n:Gl,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:AE(),fragmentShader:` precision mediump float; precision mediump int; @@ -3601,7 +3601,7 @@ void main() { } } - `,blending:io,depthTest:!1,depthWrite:!1})}function UC(){return new as({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:TE(),fragmentShader:` + `,blending:so,depthTest:!1,depthWrite:!1})}function UC(){return new as({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:AE(),fragmentShader:` precision mediump float; precision mediump int; @@ -3620,7 +3620,7 @@ void main() { gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } - `,blending:io,depthTest:!1,depthWrite:!1})}function FC(){return new as({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:TE(),fragmentShader:` + `,blending:so,depthTest:!1,depthWrite:!1})}function FC(){return new as({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:AE(),fragmentShader:` precision mediump float; precision mediump int; @@ -3636,7 +3636,7 @@ void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } - `,blending:io,depthTest:!1,depthWrite:!1})}function TE(){return` + `,blending:so,depthTest:!1,depthWrite:!1})}function AE(){return` precision mediump float; precision mediump int; @@ -3691,16 +3691,16 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function d6(n){let e=new WeakMap,t=null;function r(a){if(a&&a.isTexture){const l=a.mapping,u=l===yh||l===xh,f=l===Wo||l===el;if(u||f)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let h=e.get(a);return t===null&&(t=new _1(n)),h=u?t.fromEquirectangular(a,h):t.fromCubemap(a,h),e.set(a,h),h.texture}else{if(e.has(a))return e.get(a).texture;{const h=a.image;if(u&&h&&h.height>0||f&&h&&i(h)){t===null&&(t=new _1(n));const p=u?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,p),a.addEventListener("dispose",s),p.texture}else return null}}}return a}function i(a){let l=0;const u=6;for(let f=0;fe.maxTextureSize&&(C=Math.ceil(V/e.maxTextureSize),V=e.maxTextureSize);const L=new Float32Array(V*C*4*v),W=new K0(L,V,C,v);W.type=is,W.needsUpdate=!0;const Q=D*4;for(let j=0;j0)return n;const i=e*t;let s=zC[i];if(s===void 0&&(s=new Float32Array(i),zC[i]=s),e!==0){r.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function ir(n,e){if(n.length!==e.length)return!1;for(let t=0,r=n.length;t0||f&&h&&i(h)){t===null&&(t=new w1(n));const p=u?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,p),a.addEventListener("dispose",s),p.texture}else return null}}}return a}function i(a){let l=0;const u=6;for(let f=0;fe.maxTextureSize&&(C=Math.ceil(V/e.maxTextureSize),V=e.maxTextureSize);const L=new Float32Array(V*C*4*v),W=new J0(L,V,C,v);W.type=is,W.needsUpdate=!0;const Q=D*4;for(let j=0;j0)return n;const i=e*t;let s=zC[i];if(s===void 0&&(s=new Float32Array(i),zC[i]=s),e!==0){r.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function ir(n,e){if(n.length!==e.length)return!1;for(let t=0,r=n.length;t":" "} ${a}: ${t[o]}`)}return r.join(` -`)}function hV(n){const e=cn.getPrimaries(cn.workingColorSpace),t=cn.getPrimaries(n);let r;switch(e===t?r="":e===Ch&&t===Th?r="LinearDisplayP3ToLinearSRGB":e===Th&&t===Ch&&(r="LinearSRGBToLinearDisplayP3"),n){case di:case Fp:return[r,"LinearTransferOETF"];case Fn:case Z0:return[r,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[r,"LinearTransferOETF"]}}function jC(n,e,t){const r=n.getShaderParameter(e,n.COMPILE_STATUS),i=n.getShaderInfoLog(e).trim();if(r&&i==="")return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` +`)}function xV(n){const e=ln.getPrimaries(ln.workingColorSpace),t=ln.getPrimaries(n);let r;switch(e===t?r="":e===Rh&&t===Ah?r="LinearDisplayP3ToLinearSRGB":e===Ah&&t===Rh&&(r="LinearSRGBToLinearDisplayP3"),n){case di:case Bp:return[r,"LinearTransferOETF"];case Fn:case Q0:return[r,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[r,"LinearTransferOETF"]}}function jC(n,e,t){const r=n.getShaderParameter(e,n.COMPILE_STATUS),i=n.getShaderInfoLog(e).trim();if(r&&i==="")return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` `+i+` -`+fV(n.getShaderSource(e),o)}else return i}function pV(n,e){const t=hV(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function mV(n,e){let t;switch(e){case l3:t="Linear";break;case c3:t="Reinhard";break;case u3:t="OptimizedCineon";break;case uE:t="ACESFilmic";break;case f3:t="AgX";break;case d3:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function gV(n){return[n.extensionDerivatives||n.envMapCubeUVHeight||n.bumpMap||n.normalMapTangentSpace||n.clearcoatNormalMap||n.flatShading||n.alphaToCoverage||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Uu).join(` -`)}function vV(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Uu).join(` -`)}function yV(n){const e=[];for(const t in n){const r=n[t];r!==!1&&e.push("#define "+t+" "+r)}return e.join(` -`)}function xV(n,e){const t={},r=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function S1(n){return n.replace(_V,wV)}const SV=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function wV(n,e){let t=zt[e];if(t===void 0){const r=SV.get(e);if(r!==void 0)t=zt[r],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,r);else throw new Error("Can not resolve #include <"+e+">")}return S1(t)}const EV=/#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 YC(n){return n.replace(EV,MV)}function MV(n,e,t,r){let i="";for(let s=parseInt(e);s/gm;function E1(n){return n.replace(TV,AV)}const CV=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function AV(n,e){let t=zt[e];if(t===void 0){const r=CV.get(e);if(r!==void 0)t=zt[r],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,r);else throw new Error("Can not resolve #include <"+e+">")}return E1(t)}const RV=/#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 YC(n){return n.replace(RV,PV)}function PV(n,e,t,r){let i="";for(let s=parseInt(e);s0&&(g+=` -`),S=[m,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,w].filter(Uu).join(` +`),S=[m,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,w].filter(zu).join(` `),S.length>0&&(S+=` `)):(g=[ZC(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,w,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+f:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.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(Uu).join(` -`),S=[m,ZC(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,w,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.envMap?"#define "+f:"",t.envMap?"#define "+h:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==so?"#define TONE_MAPPING":"",t.toneMapping!==so?zt.tonemapping_pars_fragment:"",t.toneMapping!==so?mV("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",zt.colorspace_pars_fragment,pV("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(Uu).join(` -`)),o=S1(o),o=XC(o,t),o=qC(o,t),a=S1(a),a=XC(a,t),a=qC(a,t),o=YC(o),a=YC(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(_=`#version 300 es +`].filter(zu).join(` +`),S=[m,ZC(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,w,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.envMap?"#define "+f:"",t.envMap?"#define "+h:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==oo?"#define TONE_MAPPING":"",t.toneMapping!==oo?zt.tonemapping_pars_fragment:"",t.toneMapping!==oo?SV("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",zt.colorspace_pars_fragment,_V("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`].filter(zu).join(` +`)),o=E1(o),o=XC(o,t),o=qC(o,t),a=E1(a),a=XC(a,t),a=qC(a,t),o=YC(o),a=YC(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(_=`#version 300 es `,g=[v,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` -`+g,S=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===y1?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===y1?"":"#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(` +`+g,S=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===_1?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===_1?"":"#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(` `)+` `+S);const b=_+g+o,A=_+S+a,R=GC(i,i.VERTEX_SHADER,b),P=GC(i,i.FRAGMENT_SHADER,A);i.attachShader(x,R),i.attachShader(x,P),t.index0AttributeName!==void 0?i.bindAttribLocation(x,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(x,0,"position"),i.linkProgram(x);function D(W){if(n.debug.checkShaderErrors){const Q=i.getProgramInfoLog(x).trim(),z=i.getShaderInfoLog(R).trim(),j=i.getShaderInfoLog(P).trim();let Y=!0,re=!0;if(i.getProgramParameter(x,i.LINK_STATUS)===!1)if(Y=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(i,x,R,P);else{const U=jC(i,R,"vertex"),X=jC(i,P,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(x,i.VALIDATE_STATUS)+` @@ -3741,9 +3741,9 @@ Material Type: `+W.type+` Program Info Log: `+Q+` `+U+` -`+X)}else Q!==""?console.warn("THREE.WebGLProgram: Program Info Log:",Q):(z===""||j==="")&&(re=!1);re&&(W.diagnostics={runnable:Y,programLog:Q,vertexShader:{log:z,prefix:g},fragmentShader:{log:j,prefix:S}})}i.deleteShader(R),i.deleteShader(P),V=new Cv(i,x),C=xV(i,x)}let V;this.getUniforms=function(){return V===void 0&&D(this),V};let C;this.getAttributes=function(){return C===void 0&&D(this),C};let L=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return L===!1&&(L=i.getProgramParameter(x,uV)),L},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(x),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=dV++,this.cacheKey=e,this.usedTimes=1,this.program=x,this.vertexShader=R,this.fragmentShader=P,this}let IV=0;class LV{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(r),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const r of t)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.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 t=this.materialCache;let r=t.get(e);return r===void 0&&(r=new Set,t.set(e,r)),r}_getShaderStage(e){const t=this.shaderCache;let r=t.get(e);return r===void 0&&(r=new DV(e),t.set(e,r)),r}}class DV{constructor(e){this.id=IV++,this.code=e,this.usedTimes=0}}function NV(n,e,t,r,i,s,o){const a=new uc,l=new LV,u=new Set,f=[],h=i.isWebGL2,p=i.logarithmicDepthBuffer,m=i.vertexTextures;let v=i.precision;const w={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 x(C){return u.add(C),C===0?"uv":`uv${C}`}function g(C,L,W,Q,z){const j=Q.fog,Y=z.geometry,re=C.isMeshStandardMaterial?Q.environment:null,U=(C.isMeshStandardMaterial?t:e).get(C.envMap||re),X=U&&U.mapping===Hd?U.image.height:null,q=w[C.type];C.precision!==null&&(v=i.getMaxPrecision(C.precision),v!==C.precision&&console.warn("THREE.WebGLProgram.getParameters:",C.precision,"not supported, using",v,"instead."));const K=Y.morphAttributes.position||Y.morphAttributes.normal||Y.morphAttributes.color,se=K!==void 0?K.length:0;let ve=0;Y.morphAttributes.position!==void 0&&(ve=1),Y.morphAttributes.normal!==void 0&&(ve=2),Y.morphAttributes.color!==void 0&&(ve=3);let te,le,Me,pe;if(q){const Yt=Ms[q];te=Yt.vertexShader,le=Yt.fragmentShader}else te=C.vertexShader,le=C.fragmentShader,l.update(C),Me=l.getVertexShaderID(C),pe=l.getFragmentShaderID(C);const Ae=n.getRenderTarget(),De=z.isInstancedMesh===!0,Re=z.isBatchedMesh===!0,Ce=!!C.map,H=!!C.matcap,xe=!!U,de=!!C.aoMap,Te=!!C.lightMap,ye=!!C.bumpMap,Xe=!!C.normalMap,ze=!!C.displacementMap,k=!!C.emissiveMap,O=!!C.metalnessMap,ie=!!C.roughnessMap,be=C.anisotropy>0,we=C.clearcoat>0,_e=C.iridescence>0,Ke=C.sheen>0,Fe=C.transmission>0,He=be&&!!C.anisotropyMap,st=we&&!!C.clearcoatMap,mt=we&&!!C.clearcoatNormalMap,Ee=we&&!!C.clearcoatRoughnessMap,Nt=_e&&!!C.iridescenceMap,wt=_e&&!!C.iridescenceThicknessMap,ft=Ke&&!!C.sheenColorMap,it=Ke&&!!C.sheenRoughnessMap,Le=!!C.specularMap,Z=!!C.specularColorMap,Se=!!C.specularIntensityMap,$e=Fe&&!!C.transmissionMap,je=Fe&&!!C.thicknessMap,St=!!C.gradientMap,G=!!C.alphaMap,Pe=C.alphaTest>0,ke=!!C.alphaHash,nt=!!C.extensions;let rt=so;C.toneMapped&&(Ae===null||Ae.isXRRenderTarget===!0)&&(rt=n.toneMapping);const Ft={isWebGL2:h,shaderID:q,shaderType:C.type,shaderName:C.name,vertexShader:te,fragmentShader:le,defines:C.defines,customVertexShaderID:Me,customFragmentShaderID:pe,isRawShaderMaterial:C.isRawShaderMaterial===!0,glslVersion:C.glslVersion,precision:v,batching:Re,instancing:De,instancingColor:De&&z.instanceColor!==null,supportsVertexTextures:m,outputColorSpace:Ae===null?n.outputColorSpace:Ae.isXRRenderTarget===!0?Ae.texture.colorSpace:di,alphaToCoverage:!!C.alphaToCoverage,map:Ce,matcap:H,envMap:xe,envMapMode:xe&&U.mapping,envMapCubeUVHeight:X,aoMap:de,lightMap:Te,bumpMap:ye,normalMap:Xe,displacementMap:m&&ze,emissiveMap:k,normalMapObjectSpace:Xe&&C.normalMapType===C3,normalMapTangentSpace:Xe&&C.normalMapType===dl,metalnessMap:O,roughnessMap:ie,anisotropy:be,anisotropyMap:He,clearcoat:we,clearcoatMap:st,clearcoatNormalMap:mt,clearcoatRoughnessMap:Ee,iridescence:_e,iridescenceMap:Nt,iridescenceThicknessMap:wt,sheen:Ke,sheenColorMap:ft,sheenRoughnessMap:it,specularMap:Le,specularColorMap:Z,specularIntensityMap:Se,transmission:Fe,transmissionMap:$e,thicknessMap:je,gradientMap:St,opaque:C.transparent===!1&&C.blending===ac&&C.alphaToCoverage===!1,alphaMap:G,alphaTest:Pe,alphaHash:ke,combine:C.combine,mapUv:Ce&&x(C.map.channel),aoMapUv:de&&x(C.aoMap.channel),lightMapUv:Te&&x(C.lightMap.channel),bumpMapUv:ye&&x(C.bumpMap.channel),normalMapUv:Xe&&x(C.normalMap.channel),displacementMapUv:ze&&x(C.displacementMap.channel),emissiveMapUv:k&&x(C.emissiveMap.channel),metalnessMapUv:O&&x(C.metalnessMap.channel),roughnessMapUv:ie&&x(C.roughnessMap.channel),anisotropyMapUv:He&&x(C.anisotropyMap.channel),clearcoatMapUv:st&&x(C.clearcoatMap.channel),clearcoatNormalMapUv:mt&&x(C.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ee&&x(C.clearcoatRoughnessMap.channel),iridescenceMapUv:Nt&&x(C.iridescenceMap.channel),iridescenceThicknessMapUv:wt&&x(C.iridescenceThicknessMap.channel),sheenColorMapUv:ft&&x(C.sheenColorMap.channel),sheenRoughnessMapUv:it&&x(C.sheenRoughnessMap.channel),specularMapUv:Le&&x(C.specularMap.channel),specularColorMapUv:Z&&x(C.specularColorMap.channel),specularIntensityMapUv:Se&&x(C.specularIntensityMap.channel),transmissionMapUv:$e&&x(C.transmissionMap.channel),thicknessMapUv:je&&x(C.thicknessMap.channel),alphaMapUv:G&&x(C.alphaMap.channel),vertexTangents:!!Y.attributes.tangent&&(Xe||be),vertexColors:C.vertexColors,vertexAlphas:C.vertexColors===!0&&!!Y.attributes.color&&Y.attributes.color.itemSize===4,pointsUvs:z.isPoints===!0&&!!Y.attributes.uv&&(Ce||G),fog:!!j,useFog:C.fog===!0,fogExp2:!!j&&j.isFogExp2,flatShading:C.flatShading===!0,sizeAttenuation:C.sizeAttenuation===!0,logarithmicDepthBuffer:p,skinning:z.isSkinnedMesh===!0,morphTargets:Y.morphAttributes.position!==void 0,morphNormals:Y.morphAttributes.normal!==void 0,morphColors:Y.morphAttributes.color!==void 0,morphTargetsCount:se,morphTextureStride:ve,numDirLights:L.directional.length,numPointLights:L.point.length,numSpotLights:L.spot.length,numSpotLightMaps:L.spotLightMap.length,numRectAreaLights:L.rectArea.length,numHemiLights:L.hemi.length,numDirLightShadows:L.directionalShadowMap.length,numPointLightShadows:L.pointShadowMap.length,numSpotLightShadows:L.spotShadowMap.length,numSpotLightShadowsWithMaps:L.numSpotLightShadowsWithMaps,numLightProbes:L.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:C.dithering,shadowMapEnabled:n.shadowMap.enabled&&W.length>0,shadowMapType:n.shadowMap.type,toneMapping:rt,useLegacyLights:n._useLegacyLights,decodeVideoTexture:Ce&&C.map.isVideoTexture===!0&&cn.getTransfer(C.map.colorSpace)===pn,premultipliedAlpha:C.premultipliedAlpha,doubleSided:C.side===Js,flipSided:C.side===Kr,useDepthPacking:C.depthPacking>=0,depthPacking:C.depthPacking||0,index0AttributeName:C.index0AttributeName,extensionDerivatives:nt&&C.extensions.derivatives===!0,extensionFragDepth:nt&&C.extensions.fragDepth===!0,extensionDrawBuffers:nt&&C.extensions.drawBuffers===!0,extensionShaderTextureLOD:nt&&C.extensions.shaderTextureLOD===!0,extensionClipCullDistance:nt&&C.extensions.clipCullDistance===!0&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:nt&&C.extensions.multiDraw===!0&&r.has("WEBGL_multi_draw"),rendererExtensionFragDepth:h||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||r.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:C.customProgramCacheKey()};return Ft.vertexUv1s=u.has(1),Ft.vertexUv2s=u.has(2),Ft.vertexUv3s=u.has(3),u.clear(),Ft}function S(C){const L=[];if(C.shaderID?L.push(C.shaderID):(L.push(C.customVertexShaderID),L.push(C.customFragmentShaderID)),C.defines!==void 0)for(const W in C.defines)L.push(W),L.push(C.defines[W]);return C.isRawShaderMaterial===!1&&(_(L,C),b(L,C),L.push(n.outputColorSpace)),L.push(C.customProgramCacheKey),L.join()}function _(C,L){C.push(L.precision),C.push(L.outputColorSpace),C.push(L.envMapMode),C.push(L.envMapCubeUVHeight),C.push(L.mapUv),C.push(L.alphaMapUv),C.push(L.lightMapUv),C.push(L.aoMapUv),C.push(L.bumpMapUv),C.push(L.normalMapUv),C.push(L.displacementMapUv),C.push(L.emissiveMapUv),C.push(L.metalnessMapUv),C.push(L.roughnessMapUv),C.push(L.anisotropyMapUv),C.push(L.clearcoatMapUv),C.push(L.clearcoatNormalMapUv),C.push(L.clearcoatRoughnessMapUv),C.push(L.iridescenceMapUv),C.push(L.iridescenceThicknessMapUv),C.push(L.sheenColorMapUv),C.push(L.sheenRoughnessMapUv),C.push(L.specularMapUv),C.push(L.specularColorMapUv),C.push(L.specularIntensityMapUv),C.push(L.transmissionMapUv),C.push(L.thicknessMapUv),C.push(L.combine),C.push(L.fogExp2),C.push(L.sizeAttenuation),C.push(L.morphTargetsCount),C.push(L.morphAttributeCount),C.push(L.numDirLights),C.push(L.numPointLights),C.push(L.numSpotLights),C.push(L.numSpotLightMaps),C.push(L.numHemiLights),C.push(L.numRectAreaLights),C.push(L.numDirLightShadows),C.push(L.numPointLightShadows),C.push(L.numSpotLightShadows),C.push(L.numSpotLightShadowsWithMaps),C.push(L.numLightProbes),C.push(L.shadowMapType),C.push(L.toneMapping),C.push(L.numClippingPlanes),C.push(L.numClipIntersection),C.push(L.depthPacking)}function b(C,L){a.disableAll(),L.isWebGL2&&a.enable(0),L.supportsVertexTextures&&a.enable(1),L.instancing&&a.enable(2),L.instancingColor&&a.enable(3),L.matcap&&a.enable(4),L.envMap&&a.enable(5),L.normalMapObjectSpace&&a.enable(6),L.normalMapTangentSpace&&a.enable(7),L.clearcoat&&a.enable(8),L.iridescence&&a.enable(9),L.alphaTest&&a.enable(10),L.vertexColors&&a.enable(11),L.vertexAlphas&&a.enable(12),L.vertexUv1s&&a.enable(13),L.vertexUv2s&&a.enable(14),L.vertexUv3s&&a.enable(15),L.vertexTangents&&a.enable(16),L.anisotropy&&a.enable(17),L.alphaHash&&a.enable(18),L.batching&&a.enable(19),C.push(a.mask),a.disableAll(),L.fog&&a.enable(0),L.useFog&&a.enable(1),L.flatShading&&a.enable(2),L.logarithmicDepthBuffer&&a.enable(3),L.skinning&&a.enable(4),L.morphTargets&&a.enable(5),L.morphNormals&&a.enable(6),L.morphColors&&a.enable(7),L.premultipliedAlpha&&a.enable(8),L.shadowMapEnabled&&a.enable(9),L.useLegacyLights&&a.enable(10),L.doubleSided&&a.enable(11),L.flipSided&&a.enable(12),L.useDepthPacking&&a.enable(13),L.dithering&&a.enable(14),L.transmission&&a.enable(15),L.sheen&&a.enable(16),L.opaque&&a.enable(17),L.pointsUvs&&a.enable(18),L.decodeVideoTexture&&a.enable(19),L.alphaToCoverage&&a.enable(20),C.push(a.mask)}function A(C){const L=w[C.type];let W;if(L){const Q=Ms[L];W=V3.clone(Q.uniforms)}else W=C.uniforms;return W}function R(C,L){let W;for(let Q=0,z=f.length;Q0?r.push(g):m.transparent===!0?i.push(g):t.push(g)}function l(h,p,m,v,w,x){const g=o(h,p,m,v,w,x);m.transmission>0?r.unshift(g):m.transparent===!0?i.unshift(g):t.unshift(g)}function u(h,p){t.length>1&&t.sort(h||kV),r.length>1&&r.sort(p||KC),i.length>1&&i.sort(p||KC)}function f(){for(let h=e,p=n.length;h=s.length?(o=new QC,s.push(o)):o=s[i],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function FV(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new F,color:new Be};break;case"SpotLight":t={position:new F,direction:new F,color:new Be,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new F,color:new Be,distance:0,decay:0};break;case"HemisphereLight":t={direction:new F,skyColor:new Be,groundColor:new Be};break;case"RectAreaLight":t={color:new Be,position:new F,halfWidth:new F,halfHeight:new F};break}return n[e.id]=t,t}}}function zV(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ge};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ge};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ge,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let BV=0;function VV(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function HV(n,e){const t=new FV,r=zV(),i={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 f=0;f<9;f++)i.probe.push(new F);const s=new F,o=new _t,a=new _t;function l(f,h){let p=0,m=0,v=0;for(let W=0;W<9;W++)i.probe[W].set(0,0,0);let w=0,x=0,g=0,S=0,_=0,b=0,A=0,R=0,P=0,D=0,V=0;f.sort(VV);const C=h===!0?Math.PI:1;for(let W=0,Q=f.length;W0&&(e.isWebGL2?n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Ve.LTC_FLOAT_1,i.rectAreaLTC2=Ve.LTC_FLOAT_2):(i.rectAreaLTC1=Ve.LTC_HALF_1,i.rectAreaLTC2=Ve.LTC_HALF_2):n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Ve.LTC_FLOAT_1,i.rectAreaLTC2=Ve.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=Ve.LTC_HALF_1,i.rectAreaLTC2=Ve.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=p,i.ambient[1]=m,i.ambient[2]=v;const L=i.hash;(L.directionalLength!==w||L.pointLength!==x||L.spotLength!==g||L.rectAreaLength!==S||L.hemiLength!==_||L.numDirectionalShadows!==b||L.numPointShadows!==A||L.numSpotShadows!==R||L.numSpotMaps!==P||L.numLightProbes!==V)&&(i.directional.length=w,i.spot.length=g,i.rectArea.length=S,i.point.length=x,i.hemi.length=_,i.directionalShadow.length=b,i.directionalShadowMap.length=b,i.pointShadow.length=A,i.pointShadowMap.length=A,i.spotShadow.length=R,i.spotShadowMap.length=R,i.directionalShadowMatrix.length=b,i.pointShadowMatrix.length=A,i.spotLightMatrix.length=R+P-D,i.spotLightMap.length=P,i.numSpotLightShadowsWithMaps=D,i.numLightProbes=V,L.directionalLength=w,L.pointLength=x,L.spotLength=g,L.rectAreaLength=S,L.hemiLength=_,L.numDirectionalShadows=b,L.numPointShadows=A,L.numSpotShadows=R,L.numSpotMaps=P,L.numLightProbes=V,i.version=BV++)}function u(f,h){let p=0,m=0,v=0,w=0,x=0;const g=h.matrixWorldInverse;for(let S=0,_=f.length;S<_;S++){const b=f[S];if(b.isDirectionalLight){const A=i.directional[p];A.direction.setFromMatrixPosition(b.matrixWorld),s.setFromMatrixPosition(b.target.matrixWorld),A.direction.sub(s),A.direction.transformDirection(g),p++}else if(b.isSpotLight){const A=i.spot[v];A.position.setFromMatrixPosition(b.matrixWorld),A.position.applyMatrix4(g),A.direction.setFromMatrixPosition(b.matrixWorld),s.setFromMatrixPosition(b.target.matrixWorld),A.direction.sub(s),A.direction.transformDirection(g),v++}else if(b.isRectAreaLight){const A=i.rectArea[w];A.position.setFromMatrixPosition(b.matrixWorld),A.position.applyMatrix4(g),a.identity(),o.copy(b.matrixWorld),o.premultiply(g),a.extractRotation(o),A.halfWidth.set(b.width*.5,0,0),A.halfHeight.set(0,b.height*.5,0),A.halfWidth.applyMatrix4(a),A.halfHeight.applyMatrix4(a),w++}else if(b.isPointLight){const A=i.point[m];A.position.setFromMatrixPosition(b.matrixWorld),A.position.applyMatrix4(g),m++}else if(b.isHemisphereLight){const A=i.hemi[x];A.direction.setFromMatrixPosition(b.matrixWorld),A.direction.transformDirection(g),x++}}}return{setup:l,setupView:u,state:i}}function JC(n,e){const t=new HV(n,e),r=[],i=[];function s(){r.length=0,i.length=0}function o(h){r.push(h)}function a(h){i.push(h)}function l(h){t.setup(r,h)}function u(h){t.setupView(r,h)}return{init:s,state:{lightsArray:r,shadowsArray:i,lights:t},setupLights:l,setupLightsView:u,pushLight:o,pushShadow:a}}function $V(n,e){let t=new WeakMap;function r(s,o=0){const a=t.get(s);let l;return a===void 0?(l=new JC(n,e),t.set(s,[l])):o>=a.length?(l=new JC(n,e),a.push(l)):l=a[o],l}function i(){t=new WeakMap}return{get:r,dispose:i}}class CE extends br{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=b3,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 AE extends br{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 WV=`void main() { +`+X)}else Q!==""?console.warn("THREE.WebGLProgram: Program Info Log:",Q):(z===""||j==="")&&(re=!1);re&&(W.diagnostics={runnable:Y,programLog:Q,vertexShader:{log:z,prefix:g},fragmentShader:{log:j,prefix:S}})}i.deleteShader(R),i.deleteShader(P),V=new Rv(i,x),C=bV(i,x)}let V;this.getUniforms=function(){return V===void 0&&D(this),V};let C;this.getAttributes=function(){return C===void 0&&D(this),C};let L=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return L===!1&&(L=i.getProgramParameter(x,gV)),L},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(x),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=vV++,this.cacheKey=e,this.usedTimes=1,this.program=x,this.vertexShader=R,this.fragmentShader=P,this}let UV=0;class FV{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(r),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const r of t)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.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 t=this.materialCache;let r=t.get(e);return r===void 0&&(r=new Set,t.set(e,r)),r}_getShaderStage(e){const t=this.shaderCache;let r=t.get(e);return r===void 0&&(r=new zV(e),t.set(e,r)),r}}class zV{constructor(e){this.id=UV++,this.code=e,this.usedTimes=0}}function BV(n,e,t,r,i,s,o){const a=new fc,l=new FV,u=new Set,f=[],h=i.isWebGL2,p=i.logarithmicDepthBuffer,m=i.vertexTextures;let v=i.precision;const w={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 x(C){return u.add(C),C===0?"uv":`uv${C}`}function g(C,L,W,Q,z){const j=Q.fog,Y=z.geometry,re=C.isMeshStandardMaterial?Q.environment:null,U=(C.isMeshStandardMaterial?t:e).get(C.envMap||re),X=U&&U.mapping===Wd?U.image.height:null,q=w[C.type];C.precision!==null&&(v=i.getMaxPrecision(C.precision),v!==C.precision&&console.warn("THREE.WebGLProgram.getParameters:",C.precision,"not supported, using",v,"instead."));const K=Y.morphAttributes.position||Y.morphAttributes.normal||Y.morphAttributes.color,se=K!==void 0?K.length:0;let ve=0;Y.morphAttributes.position!==void 0&&(ve=1),Y.morphAttributes.normal!==void 0&&(ve=2),Y.morphAttributes.color!==void 0&&(ve=3);let te,le,Me,pe;if(q){const Yt=bs[q];te=Yt.vertexShader,le=Yt.fragmentShader}else te=C.vertexShader,le=C.fragmentShader,l.update(C),Me=l.getVertexShaderID(C),pe=l.getFragmentShaderID(C);const Ae=n.getRenderTarget(),De=z.isInstancedMesh===!0,Re=z.isBatchedMesh===!0,Ce=!!C.map,H=!!C.matcap,xe=!!U,de=!!C.aoMap,Te=!!C.lightMap,ye=!!C.bumpMap,Xe=!!C.normalMap,ze=!!C.displacementMap,k=!!C.emissiveMap,O=!!C.metalnessMap,ie=!!C.roughnessMap,be=C.anisotropy>0,we=C.clearcoat>0,_e=C.iridescence>0,Ke=C.sheen>0,Fe=C.transmission>0,He=be&&!!C.anisotropyMap,st=we&&!!C.clearcoatMap,mt=we&&!!C.clearcoatNormalMap,Ee=we&&!!C.clearcoatRoughnessMap,Nt=_e&&!!C.iridescenceMap,wt=_e&&!!C.iridescenceThicknessMap,ft=Ke&&!!C.sheenColorMap,it=Ke&&!!C.sheenRoughnessMap,Le=!!C.specularMap,Z=!!C.specularColorMap,Se=!!C.specularIntensityMap,$e=Fe&&!!C.transmissionMap,je=Fe&&!!C.thicknessMap,St=!!C.gradientMap,G=!!C.alphaMap,Pe=C.alphaTest>0,ke=!!C.alphaHash,nt=!!C.extensions;let rt=oo;C.toneMapped&&(Ae===null||Ae.isXRRenderTarget===!0)&&(rt=n.toneMapping);const Ft={isWebGL2:h,shaderID:q,shaderType:C.type,shaderName:C.name,vertexShader:te,fragmentShader:le,defines:C.defines,customVertexShaderID:Me,customFragmentShaderID:pe,isRawShaderMaterial:C.isRawShaderMaterial===!0,glslVersion:C.glslVersion,precision:v,batching:Re,instancing:De,instancingColor:De&&z.instanceColor!==null,supportsVertexTextures:m,outputColorSpace:Ae===null?n.outputColorSpace:Ae.isXRRenderTarget===!0?Ae.texture.colorSpace:di,alphaToCoverage:!!C.alphaToCoverage,map:Ce,matcap:H,envMap:xe,envMapMode:xe&&U.mapping,envMapCubeUVHeight:X,aoMap:de,lightMap:Te,bumpMap:ye,normalMap:Xe,displacementMap:m&&ze,emissiveMap:k,normalMapObjectSpace:Xe&&C.normalMapType===A3,normalMapTangentSpace:Xe&&C.normalMapType===fl,metalnessMap:O,roughnessMap:ie,anisotropy:be,anisotropyMap:He,clearcoat:we,clearcoatMap:st,clearcoatNormalMap:mt,clearcoatRoughnessMap:Ee,iridescence:_e,iridescenceMap:Nt,iridescenceThicknessMap:wt,sheen:Ke,sheenColorMap:ft,sheenRoughnessMap:it,specularMap:Le,specularColorMap:Z,specularIntensityMap:Se,transmission:Fe,transmissionMap:$e,thicknessMap:je,gradientMap:St,opaque:C.transparent===!1&&C.blending===cc&&C.alphaToCoverage===!1,alphaMap:G,alphaTest:Pe,alphaHash:ke,combine:C.combine,mapUv:Ce&&x(C.map.channel),aoMapUv:de&&x(C.aoMap.channel),lightMapUv:Te&&x(C.lightMap.channel),bumpMapUv:ye&&x(C.bumpMap.channel),normalMapUv:Xe&&x(C.normalMap.channel),displacementMapUv:ze&&x(C.displacementMap.channel),emissiveMapUv:k&&x(C.emissiveMap.channel),metalnessMapUv:O&&x(C.metalnessMap.channel),roughnessMapUv:ie&&x(C.roughnessMap.channel),anisotropyMapUv:He&&x(C.anisotropyMap.channel),clearcoatMapUv:st&&x(C.clearcoatMap.channel),clearcoatNormalMapUv:mt&&x(C.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ee&&x(C.clearcoatRoughnessMap.channel),iridescenceMapUv:Nt&&x(C.iridescenceMap.channel),iridescenceThicknessMapUv:wt&&x(C.iridescenceThicknessMap.channel),sheenColorMapUv:ft&&x(C.sheenColorMap.channel),sheenRoughnessMapUv:it&&x(C.sheenRoughnessMap.channel),specularMapUv:Le&&x(C.specularMap.channel),specularColorMapUv:Z&&x(C.specularColorMap.channel),specularIntensityMapUv:Se&&x(C.specularIntensityMap.channel),transmissionMapUv:$e&&x(C.transmissionMap.channel),thicknessMapUv:je&&x(C.thicknessMap.channel),alphaMapUv:G&&x(C.alphaMap.channel),vertexTangents:!!Y.attributes.tangent&&(Xe||be),vertexColors:C.vertexColors,vertexAlphas:C.vertexColors===!0&&!!Y.attributes.color&&Y.attributes.color.itemSize===4,pointsUvs:z.isPoints===!0&&!!Y.attributes.uv&&(Ce||G),fog:!!j,useFog:C.fog===!0,fogExp2:!!j&&j.isFogExp2,flatShading:C.flatShading===!0,sizeAttenuation:C.sizeAttenuation===!0,logarithmicDepthBuffer:p,skinning:z.isSkinnedMesh===!0,morphTargets:Y.morphAttributes.position!==void 0,morphNormals:Y.morphAttributes.normal!==void 0,morphColors:Y.morphAttributes.color!==void 0,morphTargetsCount:se,morphTextureStride:ve,numDirLights:L.directional.length,numPointLights:L.point.length,numSpotLights:L.spot.length,numSpotLightMaps:L.spotLightMap.length,numRectAreaLights:L.rectArea.length,numHemiLights:L.hemi.length,numDirLightShadows:L.directionalShadowMap.length,numPointLightShadows:L.pointShadowMap.length,numSpotLightShadows:L.spotShadowMap.length,numSpotLightShadowsWithMaps:L.numSpotLightShadowsWithMaps,numLightProbes:L.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:C.dithering,shadowMapEnabled:n.shadowMap.enabled&&W.length>0,shadowMapType:n.shadowMap.type,toneMapping:rt,useLegacyLights:n._useLegacyLights,decodeVideoTexture:Ce&&C.map.isVideoTexture===!0&&ln.getTransfer(C.map.colorSpace)===hn,premultipliedAlpha:C.premultipliedAlpha,doubleSided:C.side===eo,flipSided:C.side===Kr,useDepthPacking:C.depthPacking>=0,depthPacking:C.depthPacking||0,index0AttributeName:C.index0AttributeName,extensionDerivatives:nt&&C.extensions.derivatives===!0,extensionFragDepth:nt&&C.extensions.fragDepth===!0,extensionDrawBuffers:nt&&C.extensions.drawBuffers===!0,extensionShaderTextureLOD:nt&&C.extensions.shaderTextureLOD===!0,extensionClipCullDistance:nt&&C.extensions.clipCullDistance===!0&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:nt&&C.extensions.multiDraw===!0&&r.has("WEBGL_multi_draw"),rendererExtensionFragDepth:h||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||r.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:C.customProgramCacheKey()};return Ft.vertexUv1s=u.has(1),Ft.vertexUv2s=u.has(2),Ft.vertexUv3s=u.has(3),u.clear(),Ft}function S(C){const L=[];if(C.shaderID?L.push(C.shaderID):(L.push(C.customVertexShaderID),L.push(C.customFragmentShaderID)),C.defines!==void 0)for(const W in C.defines)L.push(W),L.push(C.defines[W]);return C.isRawShaderMaterial===!1&&(_(L,C),b(L,C),L.push(n.outputColorSpace)),L.push(C.customProgramCacheKey),L.join()}function _(C,L){C.push(L.precision),C.push(L.outputColorSpace),C.push(L.envMapMode),C.push(L.envMapCubeUVHeight),C.push(L.mapUv),C.push(L.alphaMapUv),C.push(L.lightMapUv),C.push(L.aoMapUv),C.push(L.bumpMapUv),C.push(L.normalMapUv),C.push(L.displacementMapUv),C.push(L.emissiveMapUv),C.push(L.metalnessMapUv),C.push(L.roughnessMapUv),C.push(L.anisotropyMapUv),C.push(L.clearcoatMapUv),C.push(L.clearcoatNormalMapUv),C.push(L.clearcoatRoughnessMapUv),C.push(L.iridescenceMapUv),C.push(L.iridescenceThicknessMapUv),C.push(L.sheenColorMapUv),C.push(L.sheenRoughnessMapUv),C.push(L.specularMapUv),C.push(L.specularColorMapUv),C.push(L.specularIntensityMapUv),C.push(L.transmissionMapUv),C.push(L.thicknessMapUv),C.push(L.combine),C.push(L.fogExp2),C.push(L.sizeAttenuation),C.push(L.morphTargetsCount),C.push(L.morphAttributeCount),C.push(L.numDirLights),C.push(L.numPointLights),C.push(L.numSpotLights),C.push(L.numSpotLightMaps),C.push(L.numHemiLights),C.push(L.numRectAreaLights),C.push(L.numDirLightShadows),C.push(L.numPointLightShadows),C.push(L.numSpotLightShadows),C.push(L.numSpotLightShadowsWithMaps),C.push(L.numLightProbes),C.push(L.shadowMapType),C.push(L.toneMapping),C.push(L.numClippingPlanes),C.push(L.numClipIntersection),C.push(L.depthPacking)}function b(C,L){a.disableAll(),L.isWebGL2&&a.enable(0),L.supportsVertexTextures&&a.enable(1),L.instancing&&a.enable(2),L.instancingColor&&a.enable(3),L.matcap&&a.enable(4),L.envMap&&a.enable(5),L.normalMapObjectSpace&&a.enable(6),L.normalMapTangentSpace&&a.enable(7),L.clearcoat&&a.enable(8),L.iridescence&&a.enable(9),L.alphaTest&&a.enable(10),L.vertexColors&&a.enable(11),L.vertexAlphas&&a.enable(12),L.vertexUv1s&&a.enable(13),L.vertexUv2s&&a.enable(14),L.vertexUv3s&&a.enable(15),L.vertexTangents&&a.enable(16),L.anisotropy&&a.enable(17),L.alphaHash&&a.enable(18),L.batching&&a.enable(19),C.push(a.mask),a.disableAll(),L.fog&&a.enable(0),L.useFog&&a.enable(1),L.flatShading&&a.enable(2),L.logarithmicDepthBuffer&&a.enable(3),L.skinning&&a.enable(4),L.morphTargets&&a.enable(5),L.morphNormals&&a.enable(6),L.morphColors&&a.enable(7),L.premultipliedAlpha&&a.enable(8),L.shadowMapEnabled&&a.enable(9),L.useLegacyLights&&a.enable(10),L.doubleSided&&a.enable(11),L.flipSided&&a.enable(12),L.useDepthPacking&&a.enable(13),L.dithering&&a.enable(14),L.transmission&&a.enable(15),L.sheen&&a.enable(16),L.opaque&&a.enable(17),L.pointsUvs&&a.enable(18),L.decodeVideoTexture&&a.enable(19),L.alphaToCoverage&&a.enable(20),C.push(a.mask)}function A(C){const L=w[C.type];let W;if(L){const Q=bs[L];W=H3.clone(Q.uniforms)}else W=C.uniforms;return W}function R(C,L){let W;for(let Q=0,z=f.length;Q0?r.push(g):m.transparent===!0?i.push(g):t.push(g)}function l(h,p,m,v,w,x){const g=o(h,p,m,v,w,x);m.transmission>0?r.unshift(g):m.transparent===!0?i.unshift(g):t.unshift(g)}function u(h,p){t.length>1&&t.sort(h||HV),r.length>1&&r.sort(p||KC),i.length>1&&i.sort(p||KC)}function f(){for(let h=e,p=n.length;h=s.length?(o=new QC,s.push(o)):o=s[i],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function WV(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new F,color:new Be};break;case"SpotLight":t={position:new F,direction:new F,color:new Be,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new F,color:new Be,distance:0,decay:0};break;case"HemisphereLight":t={direction:new F,skyColor:new Be,groundColor:new Be};break;case"RectAreaLight":t={color:new Be,position:new F,halfWidth:new F,halfHeight:new F};break}return n[e.id]=t,t}}}function GV(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ge};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ge};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ge,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let jV=0;function XV(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function qV(n,e){const t=new WV,r=GV(),i={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 f=0;f<9;f++)i.probe.push(new F);const s=new F,o=new _t,a=new _t;function l(f,h){let p=0,m=0,v=0;for(let W=0;W<9;W++)i.probe[W].set(0,0,0);let w=0,x=0,g=0,S=0,_=0,b=0,A=0,R=0,P=0,D=0,V=0;f.sort(XV);const C=h===!0?Math.PI:1;for(let W=0,Q=f.length;W0&&(e.isWebGL2?n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Ve.LTC_FLOAT_1,i.rectAreaLTC2=Ve.LTC_FLOAT_2):(i.rectAreaLTC1=Ve.LTC_HALF_1,i.rectAreaLTC2=Ve.LTC_HALF_2):n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Ve.LTC_FLOAT_1,i.rectAreaLTC2=Ve.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=Ve.LTC_HALF_1,i.rectAreaLTC2=Ve.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=p,i.ambient[1]=m,i.ambient[2]=v;const L=i.hash;(L.directionalLength!==w||L.pointLength!==x||L.spotLength!==g||L.rectAreaLength!==S||L.hemiLength!==_||L.numDirectionalShadows!==b||L.numPointShadows!==A||L.numSpotShadows!==R||L.numSpotMaps!==P||L.numLightProbes!==V)&&(i.directional.length=w,i.spot.length=g,i.rectArea.length=S,i.point.length=x,i.hemi.length=_,i.directionalShadow.length=b,i.directionalShadowMap.length=b,i.pointShadow.length=A,i.pointShadowMap.length=A,i.spotShadow.length=R,i.spotShadowMap.length=R,i.directionalShadowMatrix.length=b,i.pointShadowMatrix.length=A,i.spotLightMatrix.length=R+P-D,i.spotLightMap.length=P,i.numSpotLightShadowsWithMaps=D,i.numLightProbes=V,L.directionalLength=w,L.pointLength=x,L.spotLength=g,L.rectAreaLength=S,L.hemiLength=_,L.numDirectionalShadows=b,L.numPointShadows=A,L.numSpotShadows=R,L.numSpotMaps=P,L.numLightProbes=V,i.version=jV++)}function u(f,h){let p=0,m=0,v=0,w=0,x=0;const g=h.matrixWorldInverse;for(let S=0,_=f.length;S<_;S++){const b=f[S];if(b.isDirectionalLight){const A=i.directional[p];A.direction.setFromMatrixPosition(b.matrixWorld),s.setFromMatrixPosition(b.target.matrixWorld),A.direction.sub(s),A.direction.transformDirection(g),p++}else if(b.isSpotLight){const A=i.spot[v];A.position.setFromMatrixPosition(b.matrixWorld),A.position.applyMatrix4(g),A.direction.setFromMatrixPosition(b.matrixWorld),s.setFromMatrixPosition(b.target.matrixWorld),A.direction.sub(s),A.direction.transformDirection(g),v++}else if(b.isRectAreaLight){const A=i.rectArea[w];A.position.setFromMatrixPosition(b.matrixWorld),A.position.applyMatrix4(g),a.identity(),o.copy(b.matrixWorld),o.premultiply(g),a.extractRotation(o),A.halfWidth.set(b.width*.5,0,0),A.halfHeight.set(0,b.height*.5,0),A.halfWidth.applyMatrix4(a),A.halfHeight.applyMatrix4(a),w++}else if(b.isPointLight){const A=i.point[m];A.position.setFromMatrixPosition(b.matrixWorld),A.position.applyMatrix4(g),m++}else if(b.isHemisphereLight){const A=i.hemi[x];A.direction.setFromMatrixPosition(b.matrixWorld),A.direction.transformDirection(g),x++}}}return{setup:l,setupView:u,state:i}}function JC(n,e){const t=new qV(n,e),r=[],i=[];function s(){r.length=0,i.length=0}function o(h){r.push(h)}function a(h){i.push(h)}function l(h){t.setup(r,h)}function u(h){t.setupView(r,h)}return{init:s,state:{lightsArray:r,shadowsArray:i,lights:t},setupLights:l,setupLightsView:u,pushLight:o,pushShadow:a}}function YV(n,e){let t=new WeakMap;function r(s,o=0){const a=t.get(s);let l;return a===void 0?(l=new JC(n,e),t.set(s,[l])):o>=a.length?(l=new JC(n,e),a.push(l)):l=a[o],l}function i(){t=new WeakMap}return{get:r,dispose:i}}class RE extends br{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=T3,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 PE extends br{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 ZV=`void main() { gl_Position = vec4( position, 1.0 ); -}`,GV=`uniform sampler2D shadow_pass; +}`,KV=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include @@ -3769,12 +3769,12 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function jV(n,e,t){let r=new Vp;const i=new ge,s=new ge,o=new on,a=new CE({depthPacking:T3}),l=new AE,u={},f=t.maxTextureSize,h={[$o]:Kr,[Kr]:$o,[Js]:Js},p=new as({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ge},radius:{value:4}},vertexShader:WV,fragmentShader:GV}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const v=new Ut;v.setAttribute("position",new an(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const w=new qn(v,p),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=X0;let g=this.type;this.render=function(R,P,D){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||R.length===0)return;const V=n.getRenderTarget(),C=n.getActiveCubeFace(),L=n.getActiveMipmapLevel(),W=n.state;W.setBlending(io),W.buffers.color.setClear(1,1,1,1),W.buffers.depth.setTest(!0),W.setScissorTest(!1);const Q=g!==_s&&this.type===_s,z=g===_s&&this.type!==_s;for(let j=0,Y=R.length;jf||i.y>f)&&(i.x>f&&(s.x=Math.floor(f/X.x),i.x=s.x*X.x,U.mapSize.x=s.x),i.y>f&&(s.y=Math.floor(f/X.y),i.y=s.y*X.y,U.mapSize.y=s.y)),U.map===null||Q===!0||z===!0){const K=this.type!==_s?{minFilter:Gn,magFilter:Gn}:{};U.map!==null&&U.map.dispose(),U.map=new gi(i.x,i.y,K),U.map.texture.name=re.name+".shadowMap",U.camera.updateProjectionMatrix()}n.setRenderTarget(U.map),n.clear();const q=U.getViewportCount();for(let K=0;K0||P.map&&P.alphaTest>0){const W=C.uuid,Q=P.uuid;let z=u[W];z===void 0&&(z={},u[W]=z);let j=z[Q];j===void 0&&(j=C.clone(),z[Q]=j,P.addEventListener("dispose",A)),C=j}if(C.visible=P.visible,C.wireframe=P.wireframe,V===_s?C.side=P.shadowSide!==null?P.shadowSide:P.side:C.side=P.shadowSide!==null?P.shadowSide:h[P.side],C.alphaMap=P.alphaMap,C.alphaTest=P.alphaTest,C.map=P.map,C.clipShadows=P.clipShadows,C.clippingPlanes=P.clippingPlanes,C.clipIntersection=P.clipIntersection,C.displacementMap=P.displacementMap,C.displacementScale=P.displacementScale,C.displacementBias=P.displacementBias,C.wireframeLinewidth=P.wireframeLinewidth,C.linewidth=P.linewidth,D.isPointLight===!0&&C.isMeshDistanceMaterial===!0){const W=n.properties.get(C);W.light=D}return C}function b(R,P,D,V,C){if(R.visible===!1)return;if(R.layers.test(P.layers)&&(R.isMesh||R.isLine||R.isPoints)&&(R.castShadow||R.receiveShadow&&C===_s)&&(!R.frustumCulled||r.intersectsObject(R))){R.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,R.matrixWorld);const Q=e.update(R),z=R.material;if(Array.isArray(z)){const j=Q.groups;for(let Y=0,re=j.length;Y=1):q.indexOf("OpenGL ES")!==-1&&(X=parseFloat(/^OpenGL ES (\d)/.exec(q)[1]),U=X>=2);let K=null,se={};const ve=n.getParameter(n.SCISSOR_BOX),te=n.getParameter(n.VIEWPORT),le=new on().fromArray(ve),Me=new on().fromArray(te);function pe(G,Pe,ke,nt){const rt=new Uint8Array(4),Ft=n.createTexture();n.bindTexture(G,Ft),n.texParameteri(G,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(G,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Yt=0;Yt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),f=new WeakMap;let h;const p=new WeakMap;let m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(k,O){return m?new OffscreenCanvas(k,O):Ph("canvas")}function w(k,O,ie,be){let we=1;if((k.width>be||k.height>be)&&(we=be/Math.max(k.width,k.height)),we<1||O===!0)if(typeof HTMLImageElement<"u"&&k instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&k instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&k instanceof ImageBitmap){const _e=O?qv:Math.floor,Ke=_e(we*k.width),Fe=_e(we*k.height);h===void 0&&(h=v(Ke,Fe));const He=ie?v(Ke,Fe):h;return He.width=Ke,He.height=Fe,He.getContext("2d").drawImage(k,0,0,Ke,Fe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+k.width+"x"+k.height+") to ("+Ke+"x"+Fe+")."),He}else return"data"in k&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+k.width+"x"+k.height+")."),k;return k}function x(k){return x1(k.width)&&x1(k.height)}function g(k){return a?!1:k.wrapS!==Ur||k.wrapT!==Ur||k.minFilter!==Gn&&k.minFilter!==fn}function S(k,O){return k.generateMipmaps&&O&&k.minFilter!==Gn&&k.minFilter!==fn}function _(k){n.generateMipmap(k)}function b(k,O,ie,be,we=!1){if(a===!1)return O;if(k!==null){if(n[k]!==void 0)return n[k];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+k+"'")}let _e=O;if(O===n.RED&&(ie===n.FLOAT&&(_e=n.R32F),ie===n.HALF_FLOAT&&(_e=n.R16F),ie===n.UNSIGNED_BYTE&&(_e=n.R8)),O===n.RED_INTEGER&&(ie===n.UNSIGNED_BYTE&&(_e=n.R8UI),ie===n.UNSIGNED_SHORT&&(_e=n.R16UI),ie===n.UNSIGNED_INT&&(_e=n.R32UI),ie===n.BYTE&&(_e=n.R8I),ie===n.SHORT&&(_e=n.R16I),ie===n.INT&&(_e=n.R32I)),O===n.RG&&(ie===n.FLOAT&&(_e=n.RG32F),ie===n.HALF_FLOAT&&(_e=n.RG16F),ie===n.UNSIGNED_BYTE&&(_e=n.RG8)),O===n.RGBA){const Ke=we?bh:cn.getTransfer(be);ie===n.FLOAT&&(_e=n.RGBA32F),ie===n.HALF_FLOAT&&(_e=n.RGBA16F),ie===n.UNSIGNED_BYTE&&(_e=Ke===pn?n.SRGB8_ALPHA8:n.RGBA8),ie===n.UNSIGNED_SHORT_4_4_4_4&&(_e=n.RGBA4),ie===n.UNSIGNED_SHORT_5_5_5_1&&(_e=n.RGB5_A1)}return(_e===n.R16F||_e===n.R32F||_e===n.RG16F||_e===n.RG32F||_e===n.RGBA16F||_e===n.RGBA32F)&&e.get("EXT_color_buffer_float"),_e}function A(k,O,ie){return S(k,ie)===!0||k.isFramebufferTexture&&k.minFilter!==Gn&&k.minFilter!==fn?Math.log2(Math.max(O.width,O.height))+1:k.mipmaps!==void 0&&k.mipmaps.length>0?k.mipmaps.length:k.isCompressedTexture&&Array.isArray(k.image)?O.mipmaps.length:1}function R(k){return k===Gn||k===jv||k===$l?n.NEAREST:n.LINEAR}function P(k){const O=k.target;O.removeEventListener("dispose",P),V(O),O.isVideoTexture&&f.delete(O)}function D(k){const O=k.target;O.removeEventListener("dispose",D),L(O)}function V(k){const O=r.get(k);if(O.__webglInit===void 0)return;const ie=k.source,be=p.get(ie);if(be){const we=be[O.__cacheKey];we.usedTimes--,we.usedTimes===0&&C(k),Object.keys(be).length===0&&p.delete(ie)}r.remove(k)}function C(k){const O=r.get(k);n.deleteTexture(O.__webglTexture);const ie=k.source,be=p.get(ie);delete be[O.__cacheKey],o.memory.textures--}function L(k){const O=k.texture,ie=r.get(k),be=r.get(O);if(be.__webglTexture!==void 0&&(n.deleteTexture(be.__webglTexture),o.memory.textures--),k.depthTexture&&k.depthTexture.dispose(),k.isWebGLCubeRenderTarget)for(let we=0;we<6;we++){if(Array.isArray(ie.__webglFramebuffer[we]))for(let _e=0;_e=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+k+" texture units while this GPU supports only "+i.maxTextures),W+=1,k}function j(k){const O=[];return O.push(k.wrapS),O.push(k.wrapT),O.push(k.wrapR||0),O.push(k.magFilter),O.push(k.minFilter),O.push(k.anisotropy),O.push(k.internalFormat),O.push(k.format),O.push(k.type),O.push(k.generateMipmaps),O.push(k.premultiplyAlpha),O.push(k.flipY),O.push(k.unpackAlignment),O.push(k.colorSpace),O.join()}function Y(k,O){const ie=r.get(k);if(k.isVideoTexture&&Xe(k),k.isRenderTargetTexture===!1&&k.version>0&&ie.__version!==k.version){const be=k.image;if(be===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(be.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{le(ie,k,O);return}}t.bindTexture(n.TEXTURE_2D,ie.__webglTexture,n.TEXTURE0+O)}function re(k,O){const ie=r.get(k);if(k.version>0&&ie.__version!==k.version){le(ie,k,O);return}t.bindTexture(n.TEXTURE_2D_ARRAY,ie.__webglTexture,n.TEXTURE0+O)}function U(k,O){const ie=r.get(k);if(k.version>0&&ie.__version!==k.version){le(ie,k,O);return}t.bindTexture(n.TEXTURE_3D,ie.__webglTexture,n.TEXTURE0+O)}function X(k,O){const ie=r.get(k);if(k.version>0&&ie.__version!==k.version){Me(ie,k,O);return}t.bindTexture(n.TEXTURE_CUBE_MAP,ie.__webglTexture,n.TEXTURE0+O)}const q={[_h]:n.REPEAT,[Ur]:n.CLAMP_TO_EDGE,[Sh]:n.MIRRORED_REPEAT},K={[Gn]:n.NEAREST,[jv]:n.NEAREST_MIPMAP_NEAREST,[$l]:n.NEAREST_MIPMAP_LINEAR,[fn]:n.LINEAR,[nh]:n.LINEAR_MIPMAP_NEAREST,[no]:n.LINEAR_MIPMAP_LINEAR},se={[A3]:n.NEVER,[N3]:n.ALWAYS,[R3]:n.LESS,[_E]:n.LEQUAL,[P3]:n.EQUAL,[D3]:n.GEQUAL,[I3]:n.GREATER,[L3]:n.NOTEQUAL};function ve(k,O,ie){if(O.type===is&&e.has("OES_texture_float_linear")===!1&&(O.magFilter===fn||O.magFilter===nh||O.magFilter===$l||O.magFilter===no||O.minFilter===fn||O.minFilter===nh||O.minFilter===$l||O.minFilter===no)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),ie?(n.texParameteri(k,n.TEXTURE_WRAP_S,q[O.wrapS]),n.texParameteri(k,n.TEXTURE_WRAP_T,q[O.wrapT]),(k===n.TEXTURE_3D||k===n.TEXTURE_2D_ARRAY)&&n.texParameteri(k,n.TEXTURE_WRAP_R,q[O.wrapR]),n.texParameteri(k,n.TEXTURE_MAG_FILTER,K[O.magFilter]),n.texParameteri(k,n.TEXTURE_MIN_FILTER,K[O.minFilter])):(n.texParameteri(k,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(k,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(k===n.TEXTURE_3D||k===n.TEXTURE_2D_ARRAY)&&n.texParameteri(k,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(O.wrapS!==Ur||O.wrapT!==Ur)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(k,n.TEXTURE_MAG_FILTER,R(O.magFilter)),n.texParameteri(k,n.TEXTURE_MIN_FILTER,R(O.minFilter)),O.minFilter!==Gn&&O.minFilter!==fn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),O.compareFunction&&(n.texParameteri(k,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(k,n.TEXTURE_COMPARE_FUNC,se[O.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const be=e.get("EXT_texture_filter_anisotropic");if(O.magFilter===Gn||O.minFilter!==$l&&O.minFilter!==no||O.type===is&&e.has("OES_texture_float_linear")===!1||a===!1&&O.type===tl&&e.has("OES_texture_half_float_linear")===!1)return;(O.anisotropy>1||r.get(O).__currentAnisotropy)&&(n.texParameterf(k,be.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(O.anisotropy,i.getMaxAnisotropy())),r.get(O).__currentAnisotropy=O.anisotropy)}}function te(k,O){let ie=!1;k.__webglInit===void 0&&(k.__webglInit=!0,O.addEventListener("dispose",P));const be=O.source;let we=p.get(be);we===void 0&&(we={},p.set(be,we));const _e=j(O);if(_e!==k.__cacheKey){we[_e]===void 0&&(we[_e]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,ie=!0),we[_e].usedTimes++;const Ke=we[k.__cacheKey];Ke!==void 0&&(we[k.__cacheKey].usedTimes--,Ke.usedTimes===0&&C(O)),k.__cacheKey=_e,k.__webglTexture=we[_e].texture}return ie}function le(k,O,ie){let be=n.TEXTURE_2D;(O.isDataArrayTexture||O.isCompressedArrayTexture)&&(be=n.TEXTURE_2D_ARRAY),O.isData3DTexture&&(be=n.TEXTURE_3D);const we=te(k,O),_e=O.source;t.bindTexture(be,k.__webglTexture,n.TEXTURE0+ie);const Ke=r.get(_e);if(_e.version!==Ke.__version||we===!0){t.activeTexture(n.TEXTURE0+ie);const Fe=cn.getPrimaries(cn.workingColorSpace),He=O.colorSpace===Ri?null:cn.getPrimaries(O.colorSpace),st=O.colorSpace===Ri||Fe===He?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,O.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,O.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,O.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,st);const mt=g(O)&&x(O.image)===!1;let Ee=w(O.image,mt,!1,i.maxTextureSize);Ee=ze(O,Ee);const Nt=x(Ee)||a,wt=s.convert(O.format,O.colorSpace);let ft=s.convert(O.type),it=b(O.internalFormat,wt,ft,O.colorSpace,O.isVideoTexture);ve(be,O,Nt);let Le;const Z=O.mipmaps,Se=a&&O.isVideoTexture!==!0&&it!==vE,$e=Ke.__version===void 0||we===!0,je=_e.dataReady,St=A(O,Ee,Nt);if(O.isDepthTexture)it=n.DEPTH_COMPONENT,a?O.type===is?it=n.DEPTH_COMPONENT32F:O.type===No?it=n.DEPTH_COMPONENT24:O.type===Ha?it=n.DEPTH24_STENCIL8:it=n.DEPTH_COMPONENT16:O.type===is&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),O.format===Bo&&it===n.DEPTH_COMPONENT&&O.type!==Up&&O.type!==No&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),O.type=No,ft=s.convert(O.type)),O.format===gc&&it===n.DEPTH_COMPONENT&&(it=n.DEPTH_STENCIL,O.type!==Ha&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),O.type=Ha,ft=s.convert(O.type))),$e&&(Se?t.texStorage2D(n.TEXTURE_2D,1,it,Ee.width,Ee.height):t.texImage2D(n.TEXTURE_2D,0,it,Ee.width,Ee.height,0,wt,ft,null));else if(O.isDataTexture)if(Z.length>0&&Nt){Se&&$e&&t.texStorage2D(n.TEXTURE_2D,St,it,Z[0].width,Z[0].height);for(let G=0,Pe=Z.length;G>=1,Pe>>=1}}else if(Z.length>0&&Nt){Se&&$e&&t.texStorage2D(n.TEXTURE_2D,St,it,Z[0].width,Z[0].height);for(let G=0,Pe=Z.length;G0&&je++,t.texStorage2D(n.TEXTURE_CUBE_MAP,je,Le,Ee[0].width,Ee[0].height));for(let G=0;G<6;G++)if(mt){Z?$e&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+G,0,0,0,Ee[G].width,Ee[G].height,ft,it,Ee[G].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+G,0,Le,Ee[G].width,Ee[G].height,0,ft,it,Ee[G].data);for(let Pe=0;Pe>_e),Ee=Math.max(1,O.height>>_e);we===n.TEXTURE_3D||we===n.TEXTURE_2D_ARRAY?t.texImage3D(we,_e,He,mt,Ee,O.depth,0,Ke,Fe,null):t.texImage2D(we,_e,He,mt,Ee,0,Ke,Fe,null)}t.bindFramebuffer(n.FRAMEBUFFER,k),ye(O)?l.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,be,we,r.get(ie).__webglTexture,0,Te(O)):(we===n.TEXTURE_2D||we>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&we<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,be,we,r.get(ie).__webglTexture,_e),t.bindFramebuffer(n.FRAMEBUFFER,null)}function Ae(k,O,ie){if(n.bindRenderbuffer(n.RENDERBUFFER,k),O.depthBuffer&&!O.stencilBuffer){let be=a===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if(ie||ye(O)){const we=O.depthTexture;we&&we.isDepthTexture&&(we.type===is?be=n.DEPTH_COMPONENT32F:we.type===No&&(be=n.DEPTH_COMPONENT24));const _e=Te(O);ye(O)?l.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,_e,be,O.width,O.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,_e,be,O.width,O.height)}else n.renderbufferStorage(n.RENDERBUFFER,be,O.width,O.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,k)}else if(O.depthBuffer&&O.stencilBuffer){const be=Te(O);ie&&ye(O)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,be,n.DEPTH24_STENCIL8,O.width,O.height):ye(O)?l.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,be,n.DEPTH24_STENCIL8,O.width,O.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,O.width,O.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,k)}else{const be=O.isWebGLMultipleRenderTargets===!0?O.texture:[O.texture];for(let we=0;we0){ie.__webglFramebuffer[Fe]=[];for(let He=0;He0){ie.__webglFramebuffer=[];for(let Fe=0;Fe0&&ye(k)===!1){const Fe=_e?O:[O];ie.__webglMultisampledFramebuffer=n.createFramebuffer(),ie.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,ie.__webglMultisampledFramebuffer);for(let He=0;He0)for(let He=0;He0)for(let He=0;He0&&ye(k)===!1){const O=k.isWebGLMultipleRenderTargets?k.texture:[k.texture],ie=k.width,be=k.height;let we=n.COLOR_BUFFER_BIT;const _e=[],Ke=k.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Fe=r.get(k),He=k.isWebGLMultipleRenderTargets===!0;if(He)for(let st=0;st0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&O.__useRenderToTexture!==!1}function Xe(k){const O=o.render.frame;f.get(k)!==O&&(f.set(k,O),k.update())}function ze(k,O){const ie=k.colorSpace,be=k.format,we=k.type;return k.isCompressedTexture===!0||k.isVideoTexture===!0||k.format===Xv||ie!==di&&ie!==Ri&&(cn.getTransfer(ie)===pn?a===!1?e.has("EXT_sRGB")===!0&&be===Fr?(k.format=Xv,k.minFilter=fn,k.generateMipmaps=!1):O=wE.sRGBToLinear(O):(be!==Fr||we!==oo)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ie)),O}this.allocateTextureUnit=z,this.resetTextureUnits=Q,this.setTexture2D=Y,this.setTexture2DArray=re,this.setTexture3D=U,this.setTextureCube=X,this.rebindTextures=Ce,this.setupRenderTarget=H,this.updateRenderTargetMipmap=xe,this.updateMultisampleRenderTarget=de,this.setupDepthRenderbuffer=Re,this.setupFrameBufferTexture=pe,this.useMultisampledRTT=ye}function Z3(n,e,t){const r=t.isWebGL2;function i(s,o=Ri){let a;const l=cn.getTransfer(o);if(s===oo)return n.UNSIGNED_BYTE;if(s===fE)return n.UNSIGNED_SHORT_4_4_4_4;if(s===hE)return n.UNSIGNED_SHORT_5_5_5_1;if(s===p3)return n.BYTE;if(s===m3)return n.SHORT;if(s===Up)return n.UNSIGNED_SHORT;if(s===dE)return n.INT;if(s===No)return n.UNSIGNED_INT;if(s===is)return n.FLOAT;if(s===tl)return r?n.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===g3)return n.ALPHA;if(s===Fr)return n.RGBA;if(s===v3)return n.LUMINANCE;if(s===y3)return n.LUMINANCE_ALPHA;if(s===Bo)return n.DEPTH_COMPONENT;if(s===gc)return n.DEPTH_STENCIL;if(s===Xv)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===x3)return n.RED;if(s===pE)return n.RED_INTEGER;if(s===_3)return n.RG;if(s===mE)return n.RG_INTEGER;if(s===gE)return n.RGBA_INTEGER;if(s===Sv||s===wv||s===Ev||s===Mv)if(l===pn)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===Sv)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===wv)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===Ev)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===Mv)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===Sv)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===wv)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===Ev)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===Mv)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===jS||s===XS||s===qS||s===YS)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===jS)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===XS)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===qS)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===YS)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===vE)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===ZS||s===KS)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===ZS)return l===pn?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===KS)return l===pn?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===QS||s===JS||s===e1||s===t1||s===n1||s===r1||s===i1||s===s1||s===o1||s===a1||s===l1||s===c1||s===u1||s===d1)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===QS)return l===pn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===JS)return l===pn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===e1)return l===pn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===t1)return l===pn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===n1)return l===pn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===r1)return l===pn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===i1)return l===pn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===s1)return l===pn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===o1)return l===pn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===a1)return l===pn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===l1)return l===pn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===c1)return l===pn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===u1)return l===pn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===d1)return l===pn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===bv||s===f1||s===h1)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===bv)return l===pn?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===f1)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===h1)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===S3||s===p1||s===m1||s===g1)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(s===bv)return a.COMPRESSED_RED_RGTC1_EXT;if(s===p1)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===m1)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===g1)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===Ha?r?n.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[s]!==void 0?n[s]:null}return{convert:i}}class K3 extends Rn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Fu extends sn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const YV={type:"move"};class T_{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Fu,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 Fu,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new F,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new F),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Fu,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new F,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new F),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 t=this._hand;if(t)for(const r of e.hand.values())this._getHandJoint(t,r)}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,t,r){let i=null,s=null,o=null;const a=this._targetRay,l=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(const w of e.hand.values()){const x=t.getJointPose(w,r),g=this._getHandJoint(u,w);x!==null&&(g.matrix.fromArray(x.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=x.radius),g.visible=x!==null}const f=u.joints["index-finger-tip"],h=u.joints["thumb-tip"],p=f.position.distanceTo(h.position),m=.02,v=.005;u.inputState.pinching&&p>m+v?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&p<=m-v&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,r),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=t.getPose(e.targetRaySpace,r),i===null&&s!==null&&(i=s),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(YV)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const r=new Fu;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[t.jointName]=r,e.add(r)}return e.joints[t.jointName]}}const ZV=` +}`;function QV(n,e,t){let r=new $p;const i=new ge,s=new ge,o=new on,a=new RE({depthPacking:C3}),l=new PE,u={},f=t.maxTextureSize,h={[Wo]:Kr,[Kr]:Wo,[eo]:eo},p=new as({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ge},radius:{value:4}},vertexShader:ZV,fragmentShader:KV}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const v=new Ut;v.setAttribute("position",new an(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const w=new qn(v,p),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Y0;let g=this.type;this.render=function(R,P,D){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||R.length===0)return;const V=n.getRenderTarget(),C=n.getActiveCubeFace(),L=n.getActiveMipmapLevel(),W=n.state;W.setBlending(so),W.buffers.color.setClear(1,1,1,1),W.buffers.depth.setTest(!0),W.setScissorTest(!1);const Q=g!==Ss&&this.type===Ss,z=g===Ss&&this.type!==Ss;for(let j=0,Y=R.length;jf||i.y>f)&&(i.x>f&&(s.x=Math.floor(f/X.x),i.x=s.x*X.x,U.mapSize.x=s.x),i.y>f&&(s.y=Math.floor(f/X.y),i.y=s.y*X.y,U.mapSize.y=s.y)),U.map===null||Q===!0||z===!0){const K=this.type!==Ss?{minFilter:Gn,magFilter:Gn}:{};U.map!==null&&U.map.dispose(),U.map=new gi(i.x,i.y,K),U.map.texture.name=re.name+".shadowMap",U.camera.updateProjectionMatrix()}n.setRenderTarget(U.map),n.clear();const q=U.getViewportCount();for(let K=0;K0||P.map&&P.alphaTest>0){const W=C.uuid,Q=P.uuid;let z=u[W];z===void 0&&(z={},u[W]=z);let j=z[Q];j===void 0&&(j=C.clone(),z[Q]=j,P.addEventListener("dispose",A)),C=j}if(C.visible=P.visible,C.wireframe=P.wireframe,V===Ss?C.side=P.shadowSide!==null?P.shadowSide:P.side:C.side=P.shadowSide!==null?P.shadowSide:h[P.side],C.alphaMap=P.alphaMap,C.alphaTest=P.alphaTest,C.map=P.map,C.clipShadows=P.clipShadows,C.clippingPlanes=P.clippingPlanes,C.clipIntersection=P.clipIntersection,C.displacementMap=P.displacementMap,C.displacementScale=P.displacementScale,C.displacementBias=P.displacementBias,C.wireframeLinewidth=P.wireframeLinewidth,C.linewidth=P.linewidth,D.isPointLight===!0&&C.isMeshDistanceMaterial===!0){const W=n.properties.get(C);W.light=D}return C}function b(R,P,D,V,C){if(R.visible===!1)return;if(R.layers.test(P.layers)&&(R.isMesh||R.isLine||R.isPoints)&&(R.castShadow||R.receiveShadow&&C===Ss)&&(!R.frustumCulled||r.intersectsObject(R))){R.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,R.matrixWorld);const Q=e.update(R),z=R.material;if(Array.isArray(z)){const j=Q.groups;for(let Y=0,re=j.length;Y=1):q.indexOf("OpenGL ES")!==-1&&(X=parseFloat(/^OpenGL ES (\d)/.exec(q)[1]),U=X>=2);let K=null,se={};const ve=n.getParameter(n.SCISSOR_BOX),te=n.getParameter(n.VIEWPORT),le=new on().fromArray(ve),Me=new on().fromArray(te);function pe(G,Pe,ke,nt){const rt=new Uint8Array(4),Ft=n.createTexture();n.bindTexture(G,Ft),n.texParameteri(G,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(G,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Yt=0;Yt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),f=new WeakMap;let h;const p=new WeakMap;let m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(k,O){return m?new OffscreenCanvas(k,O):Lh("canvas")}function w(k,O,ie,be){let we=1;if((k.width>be||k.height>be)&&(we=be/Math.max(k.width,k.height)),we<1||O===!0)if(typeof HTMLImageElement<"u"&&k instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&k instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&k instanceof ImageBitmap){const _e=O?Zv:Math.floor,Ke=_e(we*k.width),Fe=_e(we*k.height);h===void 0&&(h=v(Ke,Fe));const He=ie?v(Ke,Fe):h;return He.width=Ke,He.height=Fe,He.getContext("2d").drawImage(k,0,0,Ke,Fe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+k.width+"x"+k.height+") to ("+Ke+"x"+Fe+")."),He}else return"data"in k&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+k.width+"x"+k.height+")."),k;return k}function x(k){return S1(k.width)&&S1(k.height)}function g(k){return a?!1:k.wrapS!==Ur||k.wrapT!==Ur||k.minFilter!==Gn&&k.minFilter!==dn}function S(k,O){return k.generateMipmaps&&O&&k.minFilter!==Gn&&k.minFilter!==dn}function _(k){n.generateMipmap(k)}function b(k,O,ie,be,we=!1){if(a===!1)return O;if(k!==null){if(n[k]!==void 0)return n[k];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+k+"'")}let _e=O;if(O===n.RED&&(ie===n.FLOAT&&(_e=n.R32F),ie===n.HALF_FLOAT&&(_e=n.R16F),ie===n.UNSIGNED_BYTE&&(_e=n.R8)),O===n.RED_INTEGER&&(ie===n.UNSIGNED_BYTE&&(_e=n.R8UI),ie===n.UNSIGNED_SHORT&&(_e=n.R16UI),ie===n.UNSIGNED_INT&&(_e=n.R32UI),ie===n.BYTE&&(_e=n.R8I),ie===n.SHORT&&(_e=n.R16I),ie===n.INT&&(_e=n.R32I)),O===n.RG&&(ie===n.FLOAT&&(_e=n.RG32F),ie===n.HALF_FLOAT&&(_e=n.RG16F),ie===n.UNSIGNED_BYTE&&(_e=n.RG8)),O===n.RGBA){const Ke=we?Ch:ln.getTransfer(be);ie===n.FLOAT&&(_e=n.RGBA32F),ie===n.HALF_FLOAT&&(_e=n.RGBA16F),ie===n.UNSIGNED_BYTE&&(_e=Ke===hn?n.SRGB8_ALPHA8:n.RGBA8),ie===n.UNSIGNED_SHORT_4_4_4_4&&(_e=n.RGBA4),ie===n.UNSIGNED_SHORT_5_5_5_1&&(_e=n.RGB5_A1)}return(_e===n.R16F||_e===n.R32F||_e===n.RG16F||_e===n.RG32F||_e===n.RGBA16F||_e===n.RGBA32F)&&e.get("EXT_color_buffer_float"),_e}function A(k,O,ie){return S(k,ie)===!0||k.isFramebufferTexture&&k.minFilter!==Gn&&k.minFilter!==dn?Math.log2(Math.max(O.width,O.height))+1:k.mipmaps!==void 0&&k.mipmaps.length>0?k.mipmaps.length:k.isCompressedTexture&&Array.isArray(k.image)?O.mipmaps.length:1}function R(k){return k===Gn||k===qv||k===Wl?n.NEAREST:n.LINEAR}function P(k){const O=k.target;O.removeEventListener("dispose",P),V(O),O.isVideoTexture&&f.delete(O)}function D(k){const O=k.target;O.removeEventListener("dispose",D),L(O)}function V(k){const O=r.get(k);if(O.__webglInit===void 0)return;const ie=k.source,be=p.get(ie);if(be){const we=be[O.__cacheKey];we.usedTimes--,we.usedTimes===0&&C(k),Object.keys(be).length===0&&p.delete(ie)}r.remove(k)}function C(k){const O=r.get(k);n.deleteTexture(O.__webglTexture);const ie=k.source,be=p.get(ie);delete be[O.__cacheKey],o.memory.textures--}function L(k){const O=k.texture,ie=r.get(k),be=r.get(O);if(be.__webglTexture!==void 0&&(n.deleteTexture(be.__webglTexture),o.memory.textures--),k.depthTexture&&k.depthTexture.dispose(),k.isWebGLCubeRenderTarget)for(let we=0;we<6;we++){if(Array.isArray(ie.__webglFramebuffer[we]))for(let _e=0;_e=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+k+" texture units while this GPU supports only "+i.maxTextures),W+=1,k}function j(k){const O=[];return O.push(k.wrapS),O.push(k.wrapT),O.push(k.wrapR||0),O.push(k.magFilter),O.push(k.minFilter),O.push(k.anisotropy),O.push(k.internalFormat),O.push(k.format),O.push(k.type),O.push(k.generateMipmaps),O.push(k.premultiplyAlpha),O.push(k.flipY),O.push(k.unpackAlignment),O.push(k.colorSpace),O.join()}function Y(k,O){const ie=r.get(k);if(k.isVideoTexture&&Xe(k),k.isRenderTargetTexture===!1&&k.version>0&&ie.__version!==k.version){const be=k.image;if(be===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(be.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{le(ie,k,O);return}}t.bindTexture(n.TEXTURE_2D,ie.__webglTexture,n.TEXTURE0+O)}function re(k,O){const ie=r.get(k);if(k.version>0&&ie.__version!==k.version){le(ie,k,O);return}t.bindTexture(n.TEXTURE_2D_ARRAY,ie.__webglTexture,n.TEXTURE0+O)}function U(k,O){const ie=r.get(k);if(k.version>0&&ie.__version!==k.version){le(ie,k,O);return}t.bindTexture(n.TEXTURE_3D,ie.__webglTexture,n.TEXTURE0+O)}function X(k,O){const ie=r.get(k);if(k.version>0&&ie.__version!==k.version){Me(ie,k,O);return}t.bindTexture(n.TEXTURE_CUBE_MAP,ie.__webglTexture,n.TEXTURE0+O)}const q={[wh]:n.REPEAT,[Ur]:n.CLAMP_TO_EDGE,[Eh]:n.MIRRORED_REPEAT},K={[Gn]:n.NEAREST,[qv]:n.NEAREST_MIPMAP_NEAREST,[Wl]:n.NEAREST_MIPMAP_LINEAR,[dn]:n.LINEAR,[ih]:n.LINEAR_MIPMAP_NEAREST,[ro]:n.LINEAR_MIPMAP_LINEAR},se={[R3]:n.NEVER,[O3]:n.ALWAYS,[P3]:n.LESS,[wE]:n.LEQUAL,[I3]:n.EQUAL,[N3]:n.GEQUAL,[L3]:n.GREATER,[D3]:n.NOTEQUAL};function ve(k,O,ie){if(O.type===is&&e.has("OES_texture_float_linear")===!1&&(O.magFilter===dn||O.magFilter===ih||O.magFilter===Wl||O.magFilter===ro||O.minFilter===dn||O.minFilter===ih||O.minFilter===Wl||O.minFilter===ro)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),ie?(n.texParameteri(k,n.TEXTURE_WRAP_S,q[O.wrapS]),n.texParameteri(k,n.TEXTURE_WRAP_T,q[O.wrapT]),(k===n.TEXTURE_3D||k===n.TEXTURE_2D_ARRAY)&&n.texParameteri(k,n.TEXTURE_WRAP_R,q[O.wrapR]),n.texParameteri(k,n.TEXTURE_MAG_FILTER,K[O.magFilter]),n.texParameteri(k,n.TEXTURE_MIN_FILTER,K[O.minFilter])):(n.texParameteri(k,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(k,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(k===n.TEXTURE_3D||k===n.TEXTURE_2D_ARRAY)&&n.texParameteri(k,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(O.wrapS!==Ur||O.wrapT!==Ur)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(k,n.TEXTURE_MAG_FILTER,R(O.magFilter)),n.texParameteri(k,n.TEXTURE_MIN_FILTER,R(O.minFilter)),O.minFilter!==Gn&&O.minFilter!==dn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),O.compareFunction&&(n.texParameteri(k,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(k,n.TEXTURE_COMPARE_FUNC,se[O.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const be=e.get("EXT_texture_filter_anisotropic");if(O.magFilter===Gn||O.minFilter!==Wl&&O.minFilter!==ro||O.type===is&&e.has("OES_texture_float_linear")===!1||a===!1&&O.type===nl&&e.has("OES_texture_half_float_linear")===!1)return;(O.anisotropy>1||r.get(O).__currentAnisotropy)&&(n.texParameterf(k,be.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(O.anisotropy,i.getMaxAnisotropy())),r.get(O).__currentAnisotropy=O.anisotropy)}}function te(k,O){let ie=!1;k.__webglInit===void 0&&(k.__webglInit=!0,O.addEventListener("dispose",P));const be=O.source;let we=p.get(be);we===void 0&&(we={},p.set(be,we));const _e=j(O);if(_e!==k.__cacheKey){we[_e]===void 0&&(we[_e]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,ie=!0),we[_e].usedTimes++;const Ke=we[k.__cacheKey];Ke!==void 0&&(we[k.__cacheKey].usedTimes--,Ke.usedTimes===0&&C(O)),k.__cacheKey=_e,k.__webglTexture=we[_e].texture}return ie}function le(k,O,ie){let be=n.TEXTURE_2D;(O.isDataArrayTexture||O.isCompressedArrayTexture)&&(be=n.TEXTURE_2D_ARRAY),O.isData3DTexture&&(be=n.TEXTURE_3D);const we=te(k,O),_e=O.source;t.bindTexture(be,k.__webglTexture,n.TEXTURE0+ie);const Ke=r.get(_e);if(_e.version!==Ke.__version||we===!0){t.activeTexture(n.TEXTURE0+ie);const Fe=ln.getPrimaries(ln.workingColorSpace),He=O.colorSpace===Ri?null:ln.getPrimaries(O.colorSpace),st=O.colorSpace===Ri||Fe===He?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,O.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,O.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,O.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,st);const mt=g(O)&&x(O.image)===!1;let Ee=w(O.image,mt,!1,i.maxTextureSize);Ee=ze(O,Ee);const Nt=x(Ee)||a,wt=s.convert(O.format,O.colorSpace);let ft=s.convert(O.type),it=b(O.internalFormat,wt,ft,O.colorSpace,O.isVideoTexture);ve(be,O,Nt);let Le;const Z=O.mipmaps,Se=a&&O.isVideoTexture!==!0&&it!==xE,$e=Ke.__version===void 0||we===!0,je=_e.dataReady,St=A(O,Ee,Nt);if(O.isDepthTexture)it=n.DEPTH_COMPONENT,a?O.type===is?it=n.DEPTH_COMPONENT32F:O.type===Oo?it=n.DEPTH_COMPONENT24:O.type===$a?it=n.DEPTH24_STENCIL8:it=n.DEPTH_COMPONENT16:O.type===is&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),O.format===Vo&&it===n.DEPTH_COMPONENT&&O.type!==zp&&O.type!==Oo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),O.type=Oo,ft=s.convert(O.type)),O.format===yc&&it===n.DEPTH_COMPONENT&&(it=n.DEPTH_STENCIL,O.type!==$a&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),O.type=$a,ft=s.convert(O.type))),$e&&(Se?t.texStorage2D(n.TEXTURE_2D,1,it,Ee.width,Ee.height):t.texImage2D(n.TEXTURE_2D,0,it,Ee.width,Ee.height,0,wt,ft,null));else if(O.isDataTexture)if(Z.length>0&&Nt){Se&&$e&&t.texStorage2D(n.TEXTURE_2D,St,it,Z[0].width,Z[0].height);for(let G=0,Pe=Z.length;G>=1,Pe>>=1}}else if(Z.length>0&&Nt){Se&&$e&&t.texStorage2D(n.TEXTURE_2D,St,it,Z[0].width,Z[0].height);for(let G=0,Pe=Z.length;G0&&je++,t.texStorage2D(n.TEXTURE_CUBE_MAP,je,Le,Ee[0].width,Ee[0].height));for(let G=0;G<6;G++)if(mt){Z?$e&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+G,0,0,0,Ee[G].width,Ee[G].height,ft,it,Ee[G].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+G,0,Le,Ee[G].width,Ee[G].height,0,ft,it,Ee[G].data);for(let Pe=0;Pe>_e),Ee=Math.max(1,O.height>>_e);we===n.TEXTURE_3D||we===n.TEXTURE_2D_ARRAY?t.texImage3D(we,_e,He,mt,Ee,O.depth,0,Ke,Fe,null):t.texImage2D(we,_e,He,mt,Ee,0,Ke,Fe,null)}t.bindFramebuffer(n.FRAMEBUFFER,k),ye(O)?l.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,be,we,r.get(ie).__webglTexture,0,Te(O)):(we===n.TEXTURE_2D||we>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&we<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,be,we,r.get(ie).__webglTexture,_e),t.bindFramebuffer(n.FRAMEBUFFER,null)}function Ae(k,O,ie){if(n.bindRenderbuffer(n.RENDERBUFFER,k),O.depthBuffer&&!O.stencilBuffer){let be=a===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if(ie||ye(O)){const we=O.depthTexture;we&&we.isDepthTexture&&(we.type===is?be=n.DEPTH_COMPONENT32F:we.type===Oo&&(be=n.DEPTH_COMPONENT24));const _e=Te(O);ye(O)?l.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,_e,be,O.width,O.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,_e,be,O.width,O.height)}else n.renderbufferStorage(n.RENDERBUFFER,be,O.width,O.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,k)}else if(O.depthBuffer&&O.stencilBuffer){const be=Te(O);ie&&ye(O)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,be,n.DEPTH24_STENCIL8,O.width,O.height):ye(O)?l.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,be,n.DEPTH24_STENCIL8,O.width,O.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,O.width,O.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,k)}else{const be=O.isWebGLMultipleRenderTargets===!0?O.texture:[O.texture];for(let we=0;we0){ie.__webglFramebuffer[Fe]=[];for(let He=0;He0){ie.__webglFramebuffer=[];for(let Fe=0;Fe0&&ye(k)===!1){const Fe=_e?O:[O];ie.__webglMultisampledFramebuffer=n.createFramebuffer(),ie.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,ie.__webglMultisampledFramebuffer);for(let He=0;He0)for(let He=0;He0)for(let He=0;He0&&ye(k)===!1){const O=k.isWebGLMultipleRenderTargets?k.texture:[k.texture],ie=k.width,be=k.height;let we=n.COLOR_BUFFER_BIT;const _e=[],Ke=k.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Fe=r.get(k),He=k.isWebGLMultipleRenderTargets===!0;if(He)for(let st=0;st0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&O.__useRenderToTexture!==!1}function Xe(k){const O=o.render.frame;f.get(k)!==O&&(f.set(k,O),k.update())}function ze(k,O){const ie=k.colorSpace,be=k.format,we=k.type;return k.isCompressedTexture===!0||k.isVideoTexture===!0||k.format===Yv||ie!==di&&ie!==Ri&&(ln.getTransfer(ie)===hn?a===!1?e.has("EXT_sRGB")===!0&&be===Fr?(k.format=Yv,k.minFilter=dn,k.generateMipmaps=!1):O=ME.sRGBToLinear(O):(be!==Fr||we!==ao)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ie)),O}this.allocateTextureUnit=z,this.resetTextureUnits=Q,this.setTexture2D=Y,this.setTexture2DArray=re,this.setTexture3D=U,this.setTextureCube=X,this.rebindTextures=Ce,this.setupRenderTarget=H,this.updateRenderTargetMipmap=xe,this.updateMultisampleRenderTarget=de,this.setupDepthRenderbuffer=Re,this.setupFrameBufferTexture=pe,this.useMultisampledRTT=ye}function K3(n,e,t){const r=t.isWebGL2;function i(s,o=Ri){let a;const l=ln.getTransfer(o);if(s===ao)return n.UNSIGNED_BYTE;if(s===pE)return n.UNSIGNED_SHORT_4_4_4_4;if(s===mE)return n.UNSIGNED_SHORT_5_5_5_1;if(s===m3)return n.BYTE;if(s===g3)return n.SHORT;if(s===zp)return n.UNSIGNED_SHORT;if(s===hE)return n.INT;if(s===Oo)return n.UNSIGNED_INT;if(s===is)return n.FLOAT;if(s===nl)return r?n.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===v3)return n.ALPHA;if(s===Fr)return n.RGBA;if(s===y3)return n.LUMINANCE;if(s===x3)return n.LUMINANCE_ALPHA;if(s===Vo)return n.DEPTH_COMPONENT;if(s===yc)return n.DEPTH_STENCIL;if(s===Yv)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===_3)return n.RED;if(s===gE)return n.RED_INTEGER;if(s===S3)return n.RG;if(s===vE)return n.RG_INTEGER;if(s===yE)return n.RGBA_INTEGER;if(s===Ev||s===Mv||s===bv||s===Tv)if(l===hn)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===Ev)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===Mv)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===bv)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===Tv)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===Ev)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===Mv)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===bv)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===Tv)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===qS||s===YS||s===ZS||s===KS)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===qS)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===YS)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===ZS)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===KS)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===xE)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===QS||s===JS)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===QS)return l===hn?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===JS)return l===hn?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===e1||s===t1||s===n1||s===r1||s===i1||s===s1||s===o1||s===a1||s===l1||s===c1||s===u1||s===d1||s===f1||s===h1)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===e1)return l===hn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===t1)return l===hn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===n1)return l===hn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===r1)return l===hn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===i1)return l===hn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===s1)return l===hn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===o1)return l===hn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===a1)return l===hn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===l1)return l===hn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===c1)return l===hn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===u1)return l===hn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===d1)return l===hn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===f1)return l===hn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===h1)return l===hn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===Cv||s===p1||s===m1)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===Cv)return l===hn?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===p1)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===m1)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===w3||s===g1||s===v1||s===y1)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(s===Cv)return a.COMPRESSED_RED_RGTC1_EXT;if(s===g1)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===v1)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===y1)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===$a?r?n.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[s]!==void 0?n[s]:null}return{convert:i}}class Q3 extends Rn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Bu extends sn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const t8={type:"move"};class A_{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Bu,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 Bu,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new F,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new F),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Bu,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new F,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new F),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 t=this._hand;if(t)for(const r of e.hand.values())this._getHandJoint(t,r)}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,t,r){let i=null,s=null,o=null;const a=this._targetRay,l=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(const w of e.hand.values()){const x=t.getJointPose(w,r),g=this._getHandJoint(u,w);x!==null&&(g.matrix.fromArray(x.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=x.radius),g.visible=x!==null}const f=u.joints["index-finger-tip"],h=u.joints["thumb-tip"],p=f.position.distanceTo(h.position),m=.02,v=.005;u.inputState.pinching&&p>m+v?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&p<=m-v&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,r),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=t.getPose(e.targetRaySpace,r),i===null&&s!==null&&(i=s),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(t8)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const r=new Bu;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[t.jointName]=r,e.add(r)}return e.joints[t.jointName]}}const n8=` void main() { gl_Position = vec4( position, 1.0 ); -}`,KV=` +}`,r8=` uniform sampler2DArray depthColor; uniform float depthWidth; uniform float depthHeight; @@ -3793,142 +3793,147 @@ void main() { } -}`;class QV{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,r){if(this.texture===null){const i=new In,s=e.properties.get(i);s.__webglTexture=t.texture,(t.depthNear!=r.depthNear||t.depthFar!=r.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}render(e,t){if(this.texture!==null){if(this.mesh===null){const r=t.cameras[0].viewport,i=new as({extensions:{fragDepth:!0},vertexShader:ZV,fragmentShader:KV,uniforms:{depthColor:{value:this.texture},depthWidth:{value:r.z},depthHeight:{value:r.w}}});this.mesh=new qn(new Wd(20,20),i)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}}class JV extends po{constructor(e,t){super();const r=this;let i=null,s=1,o=null,a="local-floor",l=1,u=null,f=null,h=null,p=null,m=null,v=null;const w=new QV,x=t.getContextAttributes();let g=null,S=null;const _=[],b=[],A=new ge;let R=null;const P=new Rn;P.layers.enable(1),P.viewport=new on;const D=new Rn;D.layers.enable(2),D.viewport=new on;const V=[P,D],C=new K3;C.layers.enable(1),C.layers.enable(2);let L=null,W=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(te){let le=_[te];return le===void 0&&(le=new T_,_[te]=le),le.getTargetRaySpace()},this.getControllerGrip=function(te){let le=_[te];return le===void 0&&(le=new T_,_[te]=le),le.getGripSpace()},this.getHand=function(te){let le=_[te];return le===void 0&&(le=new T_,_[te]=le),le.getHandSpace()};function Q(te){const le=b.indexOf(te.inputSource);if(le===-1)return;const Me=_[le];Me!==void 0&&(Me.update(te.inputSource,te.frame,u||o),Me.dispatchEvent({type:te.type,data:te.inputSource}))}function z(){i.removeEventListener("select",Q),i.removeEventListener("selectstart",Q),i.removeEventListener("selectend",Q),i.removeEventListener("squeeze",Q),i.removeEventListener("squeezestart",Q),i.removeEventListener("squeezeend",Q),i.removeEventListener("end",z),i.removeEventListener("inputsourceschange",j);for(let te=0;te<_.length;te++){const le=b[te];le!==null&&(b[te]=null,_[te].disconnect(le))}L=null,W=null,w.reset(),e.setRenderTarget(g),m=null,p=null,h=null,i=null,S=null,ve.stop(),r.isPresenting=!1,e.setPixelRatio(R),e.setSize(A.width,A.height,!1),r.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(te){s=te,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(te){a=te,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||o},this.setReferenceSpace=function(te){u=te},this.getBaseLayer=function(){return p!==null?p:m},this.getBinding=function(){return h},this.getFrame=function(){return v},this.getSession=function(){return i},this.setSession=async function(te){if(i=te,i!==null){if(g=e.getRenderTarget(),i.addEventListener("select",Q),i.addEventListener("selectstart",Q),i.addEventListener("selectend",Q),i.addEventListener("squeeze",Q),i.addEventListener("squeezestart",Q),i.addEventListener("squeezeend",Q),i.addEventListener("end",z),i.addEventListener("inputsourceschange",j),x.xrCompatible!==!0&&await t.makeXRCompatible(),R=e.getPixelRatio(),e.getSize(A),i.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const le={antialias:i.renderState.layers===void 0?x.antialias:!0,alpha:!0,depth:x.depth,stencil:x.stencil,framebufferScaleFactor:s};m=new XRWebGLLayer(i,t,le),i.updateRenderState({baseLayer:m}),e.setPixelRatio(1),e.setSize(m.framebufferWidth,m.framebufferHeight,!1),S=new gi(m.framebufferWidth,m.framebufferHeight,{format:Fr,type:oo,colorSpace:e.outputColorSpace,stencilBuffer:x.stencil})}else{let le=null,Me=null,pe=null;x.depth&&(pe=x.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,le=x.stencil?gc:Bo,Me=x.stencil?Ha:No);const Ae={colorFormat:t.RGBA8,depthFormat:pe,scaleFactor:s};h=new XRWebGLBinding(i,t),p=h.createProjectionLayer(Ae),i.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),S=new gi(p.textureWidth,p.textureHeight,{format:Fr,type:oo,depthTexture:new Q0(p.textureWidth,p.textureHeight,Me,void 0,void 0,void 0,void 0,void 0,void 0,le),stencilBuffer:x.stencil,colorSpace:e.outputColorSpace,samples:x.antialias?4:0});const De=e.properties.get(S);De.__ignoreDepthValues=p.ignoreDepthValues}S.isXRRenderTarget=!0,this.setFoveation(l),u=null,o=await i.requestReferenceSpace(a),ve.setContext(i),ve.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function j(te){for(let le=0;le=0&&(b[pe]=null,_[pe].disconnect(Me))}for(let le=0;le=b.length){b.push(Me),pe=De;break}else if(b[De]===null){b[De]=Me,pe=De;break}if(pe===-1)break}const Ae=_[pe];Ae&&Ae.connect(Me)}}const Y=new F,re=new F;function U(te,le,Me){Y.setFromMatrixPosition(le.matrixWorld),re.setFromMatrixPosition(Me.matrixWorld);const pe=Y.distanceTo(re),Ae=le.projectionMatrix.elements,De=Me.projectionMatrix.elements,Re=Ae[14]/(Ae[10]-1),Ce=Ae[14]/(Ae[10]+1),H=(Ae[9]+1)/Ae[5],xe=(Ae[9]-1)/Ae[5],de=(Ae[8]-1)/Ae[0],Te=(De[8]+1)/De[0],ye=Re*de,Xe=Re*Te,ze=pe/(-de+Te),k=ze*-de;le.matrixWorld.decompose(te.position,te.quaternion,te.scale),te.translateX(k),te.translateZ(ze),te.matrixWorld.compose(te.position,te.quaternion,te.scale),te.matrixWorldInverse.copy(te.matrixWorld).invert();const O=Re+ze,ie=Ce+ze,be=ye-k,we=Xe+(pe-k),_e=H*Ce/ie*O,Ke=xe*Ce/ie*O;te.projectionMatrix.makePerspective(be,we,_e,Ke,O,ie),te.projectionMatrixInverse.copy(te.projectionMatrix).invert()}function X(te,le){le===null?te.matrixWorld.copy(te.matrix):te.matrixWorld.multiplyMatrices(le.matrixWorld,te.matrix),te.matrixWorldInverse.copy(te.matrixWorld).invert()}this.updateCamera=function(te){if(i===null)return;w.texture!==null&&(te.near=w.depthNear,te.far=w.depthFar),C.near=D.near=P.near=te.near,C.far=D.far=P.far=te.far,(L!==C.near||W!==C.far)&&(i.updateRenderState({depthNear:C.near,depthFar:C.far}),L=C.near,W=C.far,P.near=L,P.far=W,D.near=L,D.far=W,P.updateProjectionMatrix(),D.updateProjectionMatrix(),te.updateProjectionMatrix());const le=te.parent,Me=C.cameras;X(C,le);for(let pe=0;pe0&&(x.alphaTest.value=g.alphaTest);const S=e.get(g).envMap;if(S&&(x.envMap.value=S,x.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,x.reflectivity.value=g.reflectivity,x.ior.value=g.ior,x.refractionRatio.value=g.refractionRatio),g.lightMap){x.lightMap.value=g.lightMap;const _=n._useLegacyLights===!0?Math.PI:1;x.lightMapIntensity.value=g.lightMapIntensity*_,t(g.lightMap,x.lightMapTransform)}g.aoMap&&(x.aoMap.value=g.aoMap,x.aoMapIntensity.value=g.aoMapIntensity,t(g.aoMap,x.aoMapTransform))}function o(x,g){x.diffuse.value.copy(g.color),x.opacity.value=g.opacity,g.map&&(x.map.value=g.map,t(g.map,x.mapTransform))}function a(x,g){x.dashSize.value=g.dashSize,x.totalSize.value=g.dashSize+g.gapSize,x.scale.value=g.scale}function l(x,g,S,_){x.diffuse.value.copy(g.color),x.opacity.value=g.opacity,x.size.value=g.size*S,x.scale.value=_*.5,g.map&&(x.map.value=g.map,t(g.map,x.uvTransform)),g.alphaMap&&(x.alphaMap.value=g.alphaMap,t(g.alphaMap,x.alphaMapTransform)),g.alphaTest>0&&(x.alphaTest.value=g.alphaTest)}function u(x,g){x.diffuse.value.copy(g.color),x.opacity.value=g.opacity,x.rotation.value=g.rotation,g.map&&(x.map.value=g.map,t(g.map,x.mapTransform)),g.alphaMap&&(x.alphaMap.value=g.alphaMap,t(g.alphaMap,x.alphaMapTransform)),g.alphaTest>0&&(x.alphaTest.value=g.alphaTest)}function f(x,g){x.specular.value.copy(g.specular),x.shininess.value=Math.max(g.shininess,1e-4)}function h(x,g){g.gradientMap&&(x.gradientMap.value=g.gradientMap)}function p(x,g){x.metalness.value=g.metalness,g.metalnessMap&&(x.metalnessMap.value=g.metalnessMap,t(g.metalnessMap,x.metalnessMapTransform)),x.roughness.value=g.roughness,g.roughnessMap&&(x.roughnessMap.value=g.roughnessMap,t(g.roughnessMap,x.roughnessMapTransform)),e.get(g).envMap&&(x.envMapIntensity.value=g.envMapIntensity)}function m(x,g,S){x.ior.value=g.ior,g.sheen>0&&(x.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),x.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(x.sheenColorMap.value=g.sheenColorMap,t(g.sheenColorMap,x.sheenColorMapTransform)),g.sheenRoughnessMap&&(x.sheenRoughnessMap.value=g.sheenRoughnessMap,t(g.sheenRoughnessMap,x.sheenRoughnessMapTransform))),g.clearcoat>0&&(x.clearcoat.value=g.clearcoat,x.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(x.clearcoatMap.value=g.clearcoatMap,t(g.clearcoatMap,x.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(x.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,t(g.clearcoatRoughnessMap,x.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(x.clearcoatNormalMap.value=g.clearcoatNormalMap,t(g.clearcoatNormalMap,x.clearcoatNormalMapTransform),x.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===Kr&&x.clearcoatNormalScale.value.negate())),g.iridescence>0&&(x.iridescence.value=g.iridescence,x.iridescenceIOR.value=g.iridescenceIOR,x.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],x.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(x.iridescenceMap.value=g.iridescenceMap,t(g.iridescenceMap,x.iridescenceMapTransform)),g.iridescenceThicknessMap&&(x.iridescenceThicknessMap.value=g.iridescenceThicknessMap,t(g.iridescenceThicknessMap,x.iridescenceThicknessMapTransform))),g.transmission>0&&(x.transmission.value=g.transmission,x.transmissionSamplerMap.value=S.texture,x.transmissionSamplerSize.value.set(S.width,S.height),g.transmissionMap&&(x.transmissionMap.value=g.transmissionMap,t(g.transmissionMap,x.transmissionMapTransform)),x.thickness.value=g.thickness,g.thicknessMap&&(x.thicknessMap.value=g.thicknessMap,t(g.thicknessMap,x.thicknessMapTransform)),x.attenuationDistance.value=g.attenuationDistance,x.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(x.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(x.anisotropyMap.value=g.anisotropyMap,t(g.anisotropyMap,x.anisotropyMapTransform))),x.specularIntensity.value=g.specularIntensity,x.specularColor.value.copy(g.specularColor),g.specularColorMap&&(x.specularColorMap.value=g.specularColorMap,t(g.specularColorMap,x.specularColorMapTransform)),g.specularIntensityMap&&(x.specularIntensityMap.value=g.specularIntensityMap,t(g.specularIntensityMap,x.specularIntensityMapTransform))}function v(x,g){g.matcap&&(x.matcap.value=g.matcap)}function w(x,g){const S=e.get(g).light;x.referencePosition.value.setFromMatrixPosition(S.matrixWorld),x.nearDistance.value=S.shadow.camera.near,x.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function t8(n,e,t,r){let i={},s={},o=[];const a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(S,_){const b=_.program;r.uniformBlockBinding(S,b)}function u(S,_){let b=i[S.id];b===void 0&&(v(S),b=f(S),i[S.id]=b,S.addEventListener("dispose",x));const A=_.program;r.updateUBOMapping(S,A);const R=e.render.frame;s[S.id]!==R&&(p(S),s[S.id]=R)}function f(S){const _=h();S.__bindingPointIndex=_;const b=n.createBuffer(),A=S.__size,R=S.usage;return n.bindBuffer(n.UNIFORM_BUFFER,b),n.bufferData(n.UNIFORM_BUFFER,A,R),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,_,b),b}function h(){for(let S=0;S0&&(b+=A-R),S.__size=b,S.__cache={},this}function w(S){const _={boundary:0,storage:0};return typeof S=="number"||typeof S=="boolean"?(_.boundary=4,_.storage=4):S.isVector2?(_.boundary=8,_.storage=8):S.isVector3||S.isColor?(_.boundary=16,_.storage=12):S.isVector4?(_.boundary=16,_.storage=16):S.isMatrix3?(_.boundary=48,_.storage=48):S.isMatrix4?(_.boundary=64,_.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),_}function x(S){const _=S.target;_.removeEventListener("dispose",x);const b=o.indexOf(_.__bindingPointIndex);o.splice(b,1),n.deleteBuffer(i[_.id]),delete i[_.id],delete s[_.id]}function g(){for(const S in i)n.deleteBuffer(i[S]);o=[],i={},s={}}return{bind:l,update:u,dispose:g}}class RE{constructor(e={}){const{canvas:t=U3(),context:r=null,depth:i=!0,stencil:s=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:f="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let p;r!==null?p=r.getContextAttributes().alpha:p=o;const m=new Uint32Array(4),v=new Int32Array(4);let w=null,x=null;const g=[],S=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Fn,this._useLegacyLights=!1,this.toneMapping=so,this.toneMappingExposure=1;const _=this;let b=!1,A=0,R=0,P=null,D=-1,V=null;const C=new on,L=new on;let W=null;const Q=new Be(0);let z=0,j=t.width,Y=t.height,re=1,U=null,X=null;const q=new on(0,0,j,Y),K=new on(0,0,j,Y);let se=!1;const ve=new Vp;let te=!1,le=!1,Me=null;const pe=new _t,Ae=new ge,De=new F,Re={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Ce(){return P===null?re:1}let H=r;function xe(B,oe){for(let ue=0;ue{function qe(){if(fe.forEach(function(ut){ze.get(ut).currentProgram.isReady()&&fe.delete(ut)}),fe.size===0){ce(B);return}setTimeout(qe,10)}de.get("KHR_parallel_shader_compile")!==null?qe():setTimeout(qe,10)})};let Yt=null;function hn(B){Yt&&Yt(B)}function Bn(){mr.stop()}function Kt(){mr.start()}const mr=new W3;mr.setAnimationLoop(hn),typeof self<"u"&&mr.setContext(self),this.setAnimationLoop=function(B){Yt=B,je.setAnimationLoop(B),B===null?mr.stop():mr.start()},je.addEventListener("sessionstart",Bn),je.addEventListener("sessionend",Kt),this.render=function(B,oe){if(oe!==void 0&&oe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(b===!0)return;B.matrixWorldAutoUpdate===!0&&B.updateMatrixWorld(),oe.parent===null&&oe.matrixWorldAutoUpdate===!0&&oe.updateMatrixWorld(),je.enabled===!0&&je.isPresenting===!0&&(je.cameraAutoUpdate===!0&&je.updateCamera(oe),oe=je.getCamera()),B.isScene===!0&&B.onBeforeRender(_,B,oe,P),x=st.get(B,S.length),x.init(),S.push(x),pe.multiplyMatrices(oe.projectionMatrix,oe.matrixWorldInverse),ve.setFromProjectionMatrix(pe),le=this.localClippingEnabled,te=mt.init(this.clippingPlanes,le),w=He.get(B,g.length),w.init(),g.push(w),zi(B,oe,0,_.sortObjects),w.finish(),_.sortObjects===!0&&w.sort(U,X),this.info.render.frame++,te===!0&&mt.beginShadows();const ue=x.state.shadowsArray;if(Ee.render(ue,B,oe),te===!0&&mt.endShadows(),this.info.autoReset===!0&&this.info.reset(),(je.enabled===!1||je.isPresenting===!1||je.hasDepthSensing()===!1)&&Nt.render(w,B),x.setupLights(_._useLegacyLights),oe.isArrayCamera){const fe=oe.cameras;for(let ce=0,qe=fe.length;ce0?x=S[S.length-1]:x=null,g.pop(),g.length>0?w=g[g.length-1]:w=null};function zi(B,oe,ue,fe){if(B.visible===!1)return;if(B.layers.test(oe.layers)){if(B.isGroup)ue=B.renderOrder;else if(B.isLOD)B.autoUpdate===!0&&B.update(oe);else if(B.isLight)x.pushLight(B),B.castShadow&&x.pushShadow(B);else if(B.isSprite){if(!B.frustumCulled||ve.intersectsSprite(B)){fe&&De.setFromMatrixPosition(B.matrixWorld).applyMatrix4(pe);const ut=_e.update(B),gt=B.material;gt.visible&&w.push(B,ut,gt,ue,De.z,null)}}else if((B.isMesh||B.isLine||B.isPoints)&&(!B.frustumCulled||ve.intersectsObject(B))){const ut=_e.update(B),gt=B.material;if(fe&&(B.boundingSphere!==void 0?(B.boundingSphere===null&&B.computeBoundingSphere(),De.copy(B.boundingSphere.center)):(ut.boundingSphere===null&&ut.computeBoundingSphere(),De.copy(ut.boundingSphere.center)),De.applyMatrix4(B.matrixWorld).applyMatrix4(pe)),Array.isArray(gt)){const vt=ut.groups;for(let Tt=0,Mt=vt.length;Tt0&&rf(ce,qe,oe,ue),fe&&ye.viewport(C.copy(fe)),ce.length>0&&$c(ce,oe,ue),qe.length>0&&$c(qe,oe,ue),ut.length>0&&$c(ut,oe,ue),ye.buffers.depth.setTest(!0),ye.buffers.depth.setMask(!0),ye.buffers.color.setMask(!0),ye.setPolygonOffset(!1)}function rf(B,oe,ue,fe){if((ue.isScene===!0?ue.overrideMaterial:null)!==null)return;const qe=Te.isWebGL2;Me===null&&(Me=new gi(1,1,{generateMipmaps:!0,type:de.has("EXT_color_buffer_half_float")?tl:oo,minFilter:no,samples:qe?4:0})),_.getDrawingBufferSize(Ae),qe?Me.setSize(Ae.x,Ae.y):Me.setSize(qv(Ae.x),qv(Ae.y));const ut=_.getRenderTarget();_.setRenderTarget(Me),_.getClearColor(Q),z=_.getClearAlpha(),z<1&&_.setClearColor(16777215,.5),_.clear();const gt=_.toneMapping;_.toneMapping=so,$c(B,ue,fe),k.updateMultisampleRenderTarget(Me),k.updateRenderTargetMipmap(Me);let vt=!1;for(let Tt=0,Mt=oe.length;Tt0),Ct=!!ue.morphAttributes.position,bn=!!ue.morphAttributes.normal,gr=!!ue.morphAttributes.color;let gn=so;fe.toneMapped&&(P===null||P.isXRRenderTarget===!0)&&(gn=_.toneMapping);const or=ue.morphAttributes.position||ue.morphAttributes.normal||ue.morphAttributes.color,yt=or!==void 0?or.length:0,et=ze.get(fe),Bi=x.state.lights;if(te===!0&&(le===!0||B!==V)){const vr=B===V&&fe.id===D;mt.setState(fe,B,vr)}let $t=!1;fe.version===et.__version?(et.needsLights&&et.lightsStateVersion!==Bi.state.version||et.outputColorSpace!==gt||ce.isBatchedMesh&&et.batching===!1||!ce.isBatchedMesh&&et.batching===!0||ce.isInstancedMesh&&et.instancing===!1||!ce.isInstancedMesh&&et.instancing===!0||ce.isSkinnedMesh&&et.skinning===!1||!ce.isSkinnedMesh&&et.skinning===!0||ce.isInstancedMesh&&et.instancingColor===!0&&ce.instanceColor===null||ce.isInstancedMesh&&et.instancingColor===!1&&ce.instanceColor!==null||et.envMap!==vt||fe.fog===!0&&et.fog!==qe||et.numClippingPlanes!==void 0&&(et.numClippingPlanes!==mt.numPlanes||et.numIntersection!==mt.numIntersection)||et.vertexAlphas!==Tt||et.vertexTangents!==Mt||et.morphTargets!==Ct||et.morphNormals!==bn||et.morphColors!==gr||et.toneMapping!==gn||Te.isWebGL2===!0&&et.morphTargetsCount!==yt)&&($t=!0):($t=!0,et.__version=fe.version);let Nn=et.currentProgram;$t===!0&&(Nn=Wc(fe,oe,ce));let ks=!1,Vi=!1,ar=!1;const Vn=Nn.getUniforms(),Us=et.uniforms;if(ye.useProgram(Nn.program)&&(ks=!0,Vi=!0,ar=!0),fe.id!==D&&(D=fe.id,Vi=!0),ks||V!==B){Vn.setValue(H,"projectionMatrix",B.projectionMatrix),Vn.setValue(H,"viewMatrix",B.matrixWorldInverse);const vr=Vn.map.cameraPosition;vr!==void 0&&vr.setValue(H,De.setFromMatrixPosition(B.matrixWorld)),Te.logarithmicDepthBuffer&&Vn.setValue(H,"logDepthBufFC",2/(Math.log(B.far+1)/Math.LN2)),(fe.isMeshPhongMaterial||fe.isMeshToonMaterial||fe.isMeshLambertMaterial||fe.isMeshBasicMaterial||fe.isMeshStandardMaterial||fe.isShaderMaterial)&&Vn.setValue(H,"isOrthographic",B.isOrthographicCamera===!0),V!==B&&(V=B,Vi=!0,ar=!0)}if(ce.isSkinnedMesh){Vn.setOptional(H,ce,"bindMatrix"),Vn.setOptional(H,ce,"bindMatrixInverse");const vr=ce.skeleton;vr&&(Te.floatVertexTextures?(vr.boneTexture===null&&vr.computeBoneTexture(),Vn.setValue(H,"boneTexture",vr.boneTexture,k)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}ce.isBatchedMesh&&(Vn.setOptional(H,ce,"batchingTexture"),Vn.setValue(H,"batchingTexture",ce._matricesTexture,k));const Gc=ue.morphAttributes;if((Gc.position!==void 0||Gc.normal!==void 0||Gc.color!==void 0&&Te.isWebGL2===!0)&&wt.update(ce,ue,Nn),(Vi||et.receiveShadow!==ce.receiveShadow)&&(et.receiveShadow=ce.receiveShadow,Vn.setValue(H,"receiveShadow",ce.receiveShadow)),fe.isMeshGouraudMaterial&&fe.envMap!==null&&(Us.envMap.value=vt,Us.flipEnvMap.value=vt.isCubeTexture&&vt.isRenderTargetTexture===!1?-1:1),Vi&&(Vn.setValue(H,"toneMappingExposure",_.toneMappingExposure),et.needsLights&&Yy(Us,ar),qe&&fe.fog===!0&&Fe.refreshFogUniforms(Us,qe),Fe.refreshMaterialUniforms(Us,fe,re,Y,Me),Cv.upload(H,rm(et),Us,k)),fe.isShaderMaterial&&fe.uniformsNeedUpdate===!0&&(Cv.upload(H,rm(et),Us,k),fe.uniformsNeedUpdate=!1),fe.isSpriteMaterial&&Vn.setValue(H,"center",ce.center),Vn.setValue(H,"modelViewMatrix",ce.modelViewMatrix),Vn.setValue(H,"normalMatrix",ce.normalMatrix),Vn.setValue(H,"modelMatrix",ce.matrixWorld),fe.isShaderMaterial||fe.isRawShaderMaterial){const vr=fe.uniformsGroups;for(let jc=0,yi=vr.length;jc0&&k.useMultisampledRTT(B)===!1?ce=ze.get(B).__webglMultisampledFramebuffer:Array.isArray(Mt)?ce=Mt[ue]:ce=Mt,C.copy(B.viewport),L.copy(B.scissor),W=B.scissorTest}else C.copy(q).multiplyScalar(re).floor(),L.copy(K).multiplyScalar(re).floor(),W=se;if(ye.bindFramebuffer(H.FRAMEBUFFER,ce)&&Te.drawBuffers&&fe&&ye.drawBuffers(B,ce),ye.viewport(C),ye.scissor(L),ye.setScissorTest(W),qe){const vt=ze.get(B.texture);H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_CUBE_MAP_POSITIVE_X+oe,vt.__webglTexture,ue)}else if(ut){const vt=ze.get(B.texture),Tt=oe||0;H.framebufferTextureLayer(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,vt.__webglTexture,ue||0,Tt)}D=-1},this.readRenderTargetPixels=function(B,oe,ue,fe,ce,qe,ut){if(!(B&&B.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let gt=ze.get(B).__webglFramebuffer;if(B.isWebGLCubeRenderTarget&&ut!==void 0&&(gt=gt[ut]),gt){ye.bindFramebuffer(H.FRAMEBUFFER,gt);try{const vt=B.texture,Tt=vt.format,Mt=vt.type;if(Tt!==Fr&&Le.convert(Tt)!==H.getParameter(H.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Ct=Mt===tl&&(de.has("EXT_color_buffer_half_float")||Te.isWebGL2&&de.has("EXT_color_buffer_float"));if(Mt!==oo&&Le.convert(Mt)!==H.getParameter(H.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Mt===is&&(Te.isWebGL2||de.has("OES_texture_float")||de.has("WEBGL_color_buffer_float")))&&!Ct){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}oe>=0&&oe<=B.width-fe&&ue>=0&&ue<=B.height-ce&&H.readPixels(oe,ue,fe,ce,Le.convert(Tt),Le.convert(Mt),qe)}finally{const vt=P!==null?ze.get(P).__webglFramebuffer:null;ye.bindFramebuffer(H.FRAMEBUFFER,vt)}}},this.copyFramebufferToTexture=function(B,oe,ue=0){const fe=Math.pow(2,-ue),ce=Math.floor(oe.image.width*fe),qe=Math.floor(oe.image.height*fe);k.setTexture2D(oe,0),H.copyTexSubImage2D(H.TEXTURE_2D,ue,0,0,B.x,B.y,ce,qe),ye.unbindTexture()},this.copyTextureToTexture=function(B,oe,ue,fe=0){const ce=oe.image.width,qe=oe.image.height,ut=Le.convert(ue.format),gt=Le.convert(ue.type);k.setTexture2D(ue,0),H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,ue.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ue.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,ue.unpackAlignment),oe.isDataTexture?H.texSubImage2D(H.TEXTURE_2D,fe,B.x,B.y,ce,qe,ut,gt,oe.image.data):oe.isCompressedTexture?H.compressedTexSubImage2D(H.TEXTURE_2D,fe,B.x,B.y,oe.mipmaps[0].width,oe.mipmaps[0].height,ut,oe.mipmaps[0].data):H.texSubImage2D(H.TEXTURE_2D,fe,B.x,B.y,ut,gt,oe.image),fe===0&&ue.generateMipmaps&&H.generateMipmap(H.TEXTURE_2D),ye.unbindTexture()},this.copyTextureToTexture3D=function(B,oe,ue,fe,ce=0){if(_.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const qe=B.max.x-B.min.x+1,ut=B.max.y-B.min.y+1,gt=B.max.z-B.min.z+1,vt=Le.convert(fe.format),Tt=Le.convert(fe.type);let Mt;if(fe.isData3DTexture)k.setTexture3D(fe,0),Mt=H.TEXTURE_3D;else if(fe.isDataArrayTexture||fe.isCompressedArrayTexture)k.setTexture2DArray(fe,0),Mt=H.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,fe.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,fe.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,fe.unpackAlignment);const Ct=H.getParameter(H.UNPACK_ROW_LENGTH),bn=H.getParameter(H.UNPACK_IMAGE_HEIGHT),gr=H.getParameter(H.UNPACK_SKIP_PIXELS),gn=H.getParameter(H.UNPACK_SKIP_ROWS),or=H.getParameter(H.UNPACK_SKIP_IMAGES),yt=ue.isCompressedTexture?ue.mipmaps[ce]:ue.image;H.pixelStorei(H.UNPACK_ROW_LENGTH,yt.width),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,yt.height),H.pixelStorei(H.UNPACK_SKIP_PIXELS,B.min.x),H.pixelStorei(H.UNPACK_SKIP_ROWS,B.min.y),H.pixelStorei(H.UNPACK_SKIP_IMAGES,B.min.z),ue.isDataTexture||ue.isData3DTexture?H.texSubImage3D(Mt,ce,oe.x,oe.y,oe.z,qe,ut,gt,vt,Tt,yt.data):ue.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),H.compressedTexSubImage3D(Mt,ce,oe.x,oe.y,oe.z,qe,ut,gt,vt,yt.data)):H.texSubImage3D(Mt,ce,oe.x,oe.y,oe.z,qe,ut,gt,vt,Tt,yt),H.pixelStorei(H.UNPACK_ROW_LENGTH,Ct),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,bn),H.pixelStorei(H.UNPACK_SKIP_PIXELS,gr),H.pixelStorei(H.UNPACK_SKIP_ROWS,gn),H.pixelStorei(H.UNPACK_SKIP_IMAGES,or),ce===0&&fe.generateMipmaps&&H.generateMipmap(Mt),ye.unbindTexture()},this.initTexture=function(B){B.isCubeTexture?k.setTextureCube(B,0):B.isData3DTexture?k.setTexture3D(B,0):B.isDataArrayTexture||B.isCompressedArrayTexture?k.setTexture2DArray(B,0):k.setTexture2D(B,0),ye.unbindTexture()},this.resetState=function(){A=0,R=0,P=null,ye.reset(),Z.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return ro}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===Z0?"display-p3":"srgb",t.unpackColorSpace=cn.workingColorSpace===Fp?"display-p3":"srgb"}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Fn?$a:xE}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===$a?Fn:di}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 Q3 extends RE{}Q3.prototype.isWebGL1Renderer=!0;class ey{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Be(e),this.density=t}clone(){return new ey(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class ty{constructor(e,t=1,r=1e3){this.isFog=!0,this.name="",this.color=new Be(e),this.near=t,this.far=r}clone(){return new ty(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Ih extends sn{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,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class ny{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Ah,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Li()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return cc("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,r){e*=this.stride,r*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:Af.clone(),uv:Pi.getInterpolation(Af,Sg,Pf,wg,eA,C_,tA,new ge),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Eg(n,e,t,r,i,s){Eu.subVectors(n,t).addScalar(.5).multiply(r),i!==void 0?(Rf.x=s*Eu.x-i*Eu.y,Rf.y=i*Eu.x+s*Eu.y):Rf.copy(Eu),n.copy(e),n.x+=Rf.x,n.y+=Rf.y,n.applyMatrix4(J3)}const Mg=new F,nA=new F;class tI extends sn{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let r=0,i=t.length;r0){let r,i;for(r=1,i=t.length;r0){Mg.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(Mg);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Mg.setFromMatrixPosition(e.matrixWorld),nA.setFromMatrixPosition(this.matrixWorld);const r=Mg.distanceTo(nA)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=o)t[i-1].object.visible=!1,t[i].object.visible=!0;else break}for(this._currentLevel=i-1;i=r.length&&r.push({start:-1,count:-1,z:-1});const s=r[this.index];i.push(s),this.index++,s.start=e.start,s.count=e.count,s.z=t}reset(){this.list.length=0,this.index=0}}const bu="batchId",_a=new _t,dA=new _t,l8=new _t,fA=new _t,P_=new Vp,Cg=new Qr,Il=new Vr,Df=new F,I_=new a8,Lr=new qn,Ag=[];function c8(n,e,t=0){const r=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const i=n.count;for(let s=0;s65536?new Uint32Array(s):new Uint16Array(s);t.setIndex(new an(a,1))}const o=i>65536?new Uint32Array(r):new Uint16Array(r);t.setAttribute(bu,new an(o,1)),this._geometryInitialized=!0}}_validateGeometry(e){if(e.getAttribute(bu))throw new Error(`BatchedMesh: Geometry cannot use attribute "${bu}"`);const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const r in t.attributes){if(r===bu)continue;if(!e.hasAttribute(r))throw new Error(`BatchedMesh: Added geometry missing "${r}". All geometries must have consistent attributes.`);const i=e.getAttribute(r),s=t.getAttribute(r);if(i.itemSize!==s.itemSize||i.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Qr);const e=this._geometryCount,t=this.boundingBox,r=this._active;t.makeEmpty();for(let i=0;i=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const i={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let s=null;const o=this._reservedRanges,a=this._drawRanges,l=this._bounds;this._geometryCount!==0&&(s=o[o.length-1]),t===-1?i.vertexCount=e.getAttribute("position").count:i.vertexCount=t,s===null?i.vertexStart=0:i.vertexStart=s.vertexStart+s.vertexCount;const u=e.getIndex(),f=u!==null;if(f&&(r===-1?i.indexCount=u.count:i.indexCount=r,s===null?i.indexStart=0:i.indexStart=s.indexStart+s.indexCount),i.indexStart!==-1&&i.indexStart+i.indexCount>this._maxIndexCount||i.vertexStart+i.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const h=this._visibility,p=this._active,m=this._matricesTexture,v=this._matricesTexture.image.data;h.push(!0),p.push(!0);const w=this._geometryCount;this._geometryCount++,l8.toArray(v,w*16),m.needsUpdate=!0,o.push(i),a.push({start:f?i.indexStart:i.vertexStart,count:-1}),l.push({boxInitialized:!1,box:new Qr,sphereInitialized:!1,sphere:new Vr});const x=this.geometry.getAttribute(bu);for(let g=0;g=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const r=this.geometry,i=r.getIndex()!==null,s=r.getIndex(),o=t.getIndex(),a=this._reservedRanges[e];if(i&&o.count>a.indexCount||t.attributes.position.count>a.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,u=a.vertexCount;for(const m in r.attributes){if(m===bu)continue;const v=t.getAttribute(m),w=r.getAttribute(m);c8(v,w,l);const x=v.itemSize;for(let g=v.count,S=u;g=t.length||t[e]===!1?this:(t[e]=!1,this._visibilityChanged=!0,this)}getBoundingBoxAt(e,t){if(this._active[e]===!1)return null;const i=this._bounds[e],s=i.box,o=this.geometry;if(i.boxInitialized===!1){s.makeEmpty();const a=o.index,l=o.attributes.position,u=this._drawRanges[e];for(let f=u.start,h=u.start+u.count;f=o||r[e]===!1?this:(t.toArray(s,e*16),i.needsUpdate=!0,this)}getMatrixAt(e,t){const r=this._active,i=this._matricesTexture.image.data,s=this._geometryCount;return e>=s||r[e]===!1?null:t.fromArray(i,e*16)}setVisibleAt(e,t){const r=this._visibility,i=this._active,s=this._geometryCount;return e>=s||i[e]===!1||r[e]===t?this:(r[e]=t,this._visibilityChanged=!0,this)}getVisibleAt(e){const t=this._visibility,r=this._active,i=this._geometryCount;return e>=i||r[e]===!1?!1:t[e]}raycast(e,t){const r=this._visibility,i=this._active,s=this._drawRanges,o=this._geometryCount,a=this.matrixWorld,l=this.geometry;Lr.material=this.material,Lr.geometry.index=l.index,Lr.geometry.attributes=l.attributes,Lr.geometry.boundingBox===null&&(Lr.geometry.boundingBox=new Qr),Lr.geometry.boundingSphere===null&&(Lr.geometry.boundingSphere=new Vr);for(let u=0;u({...t})),this._reservedRanges=e._reservedRanges.map(t=>({...t})),this._visibility=e._visibility.slice(),this._active=e._active.slice(),this._bounds=e._bounds.map(t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()})),this._maxGeometryCount=e._maxGeometryCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(e,t,r,i,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=i.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._active,u=this._visibility,f=this._multiDrawStarts,h=this._multiDrawCounts,p=this._drawRanges,m=this.perObjectFrustumCulled;m&&(fA.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse).multiply(this.matrixWorld),P_.setFromProjectionMatrix(fA,e.coordinateSystem));let v=0;if(this.sortObjects){dA.copy(this.matrixWorld).invert(),Df.setFromMatrixPosition(r.matrixWorld).applyMatrix4(dA);for(let g=0,S=u.length;gl)continue;p.applyMatrix4(this.matrixWorld);const D=e.ray.origin.distanceTo(p);De.far||t.push({distance:D,point:h.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this})}}else{const g=Math.max(0,o.start),S=Math.min(x.count,o.start+o.count);for(let _=g,b=S-1;_l)continue;p.applyMatrix4(this.matrixWorld);const R=e.ray.origin.distanceTo(p);Re.far||t.push({distance:R,point:h.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;si.far)return;s.push({distance:u,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class u8 extends In{constructor(e,t,r,i,s,o,a,l,u){super(e,t,r,i,s,o,a,l,u),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:fn,this.magFilter=s!==void 0?s:fn,this.generateMipmaps=!1;const f=this;function h(){f.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class d8 extends In{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Gn,this.minFilter=Gn,this.generateMipmaps=!1,this.needsUpdate=!0}}class iy extends In{constructor(e,t,r,i,s,o,a,l,u,f,h,p){super(null,o,a,l,u,f,i,s,h,p),this.isCompressedTexture=!0,this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class f8 extends iy{constructor(e,t,r,i,s,o){super(e,t,r,s,o),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Ur}}class h8 extends iy{constructor(e,t,r){super(void 0,e[0].width,e[0].height,t,r,Wo),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class p8 extends In{constructor(e,t,r,i,s,o,a,l,u){super(e,t,r,i,s,o,a,l,u),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Ds{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let r,i=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)r=this.getPoint(o/e),s+=r.distanceTo(i),t.push(s),i=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const r=this.getLengths();let i=0;const s=r.length;let o;t?o=t:o=e*r[s-1];let a=0,l=s-1,u;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),u=r[i]-o,u<0)a=i+1;else if(u>0)l=i-1;else{l=i;break}if(i=l,r[i]===o)return i/(s-1);const f=r[i],p=r[i+1]-f,m=(o-f)/p;return(i+m)/(s-1)}getTangent(e,t){let i=e-1e-4,s=e+1e-4;i<0&&(i=0),s>1&&(s=1);const o=this.getPoint(i),a=this.getPoint(s),l=t||(o.isVector2?new ge:new F);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t){const r=new F,i=[],s=[],o=[],a=new F,l=new _t;for(let m=0;m<=e;m++){const v=m/e;i[m]=this.getTangentAt(v,new F)}s[0]=new F,o[0]=new F;let u=Number.MAX_VALUE;const f=Math.abs(i[0].x),h=Math.abs(i[0].y),p=Math.abs(i[0].z);f<=u&&(u=f,r.set(1,0,0)),h<=u&&(u=h,r.set(0,1,0)),p<=u&&r.set(0,0,1),a.crossVectors(i[0],r).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let m=1;m<=e;m++){if(s[m]=s[m-1].clone(),o[m]=o[m-1].clone(),a.crossVectors(i[m-1],i[m]),a.length()>Number.EPSILON){a.normalize();const v=Math.acos(zn(i[m-1].dot(i[m]),-1,1));s[m].applyMatrix4(l.makeRotationAxis(a,v))}o[m].crossVectors(i[m],s[m])}if(t===!0){let m=Math.acos(zn(s[0].dot(s[e]),-1,1));m/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(m=-m);for(let v=1;v<=e;v++)s[v].applyMatrix4(l.makeRotationAxis(i[v],m*v)),o[v].crossVectors(i[v],s[v])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class sy extends Ds{constructor(e=0,t=0,r=1,i=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){const r=t||new ge,i=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let u,f;this.closed||a>0?u=i[(a-1)%s]:(Lg.subVectors(i[0],i[1]).add(i[0]),u=Lg);const h=i[a%s],p=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return r.set(_A(a,l.x,u.x,f.x,h.x),_A(a,l.y,u.y,f.y,h.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t=r){const o=i[s]-r,a=this.curves[s],l=a.getLength(),u=l===0?0:1-o/l;return a.getPointAt(u,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let r=0,i=this.curves.length;r1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,r=e.curves.length;t0){const h=u.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(u);const f=u.getPoint(1);return this.currentPoint.copy(f),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Hp extends Ut{constructor(e=[new ge(0,-.5),new ge(.5,0),new ge(0,.5)],t=12,r=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:i},t=Math.floor(t),i=zn(i,0,Math.PI*2);const s=[],o=[],a=[],l=[],u=[],f=1/t,h=new F,p=new ge,m=new F,v=new F,w=new F;let x=0,g=0;for(let S=0;S<=e.length-1;S++)switch(S){case 0:x=e[S+1].x-e[S].x,g=e[S+1].y-e[S].y,m.x=g*1,m.y=-x,m.z=g*0,w.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case e.length-1:l.push(w.x,w.y,w.z);break;default:x=e[S+1].x-e[S].x,g=e[S+1].y-e[S].y,m.x=g*1,m.y=-x,m.z=g*0,v.copy(m),m.x+=w.x,m.y+=w.y,m.z+=w.z,m.normalize(),l.push(m.x,m.y,m.z),w.copy(v)}for(let S=0;S<=t;S++){const _=r+S*f*i,b=Math.sin(_),A=Math.cos(_);for(let R=0;R<=e.length-1;R++){h.x=e[R].x*b,h.y=e[R].y,h.z=e[R].x*A,o.push(h.x,h.y,h.z),p.x=S/t,p.y=R/(e.length-1),a.push(p.x,p.y);const P=l[3*R+0]*b,D=l[3*R+1],V=l[3*R+0]*A;u.push(P,D,V)}}for(let S=0;S0&&_(!0),t>0&&_(!1)),this.setIndex(f),this.setAttribute("position",new ot(h,3)),this.setAttribute("normal",new ot(p,3)),this.setAttribute("uv",new ot(m,2));function S(){const b=new F,A=new F;let R=0;const P=(t-e)/r;for(let D=0;D<=s;D++){const V=[],C=D/s,L=C*(t-e)+e;for(let W=0;W<=i;W++){const Q=W/i,z=Q*l+a,j=Math.sin(z),Y=Math.cos(z);A.x=L*j,A.y=-C*r+x,A.z=L*Y,h.push(A.x,A.y,A.z),b.set(j,P,Y).normalize(),p.push(b.x,b.y,b.z),m.push(Q,1-C),V.push(v++)}w.push(V)}for(let D=0;D.9&&P<.1&&(_<.2&&(o[S+0]+=1),b<.2&&(o[S+2]+=1),A<.2&&(o[S+4]+=1))}}function p(S){s.push(S.x,S.y,S.z)}function m(S,_){const b=S*3;_.x=e[b+0],_.y=e[b+1],_.z=e[b+2]}function v(){const S=new F,_=new F,b=new F,A=new F,R=new ge,P=new ge,D=new ge;for(let V=0,C=0;V80*t){a=u=n[0],l=f=n[1];for(let v=t;vu&&(u=h),p>f&&(f=p);m=Math.max(u-a,f-l),m=m!==0?32767/m:0}return Dh(s,o,t,a,l,m,0),o}};function hI(n,e,t,r,i){let s,o;if(i===F8(n,e,t,r)>0)for(s=e;s=e;s-=r)o=SA(s,n[s],n[s+1],o);return o&&uy(o,o.next)&&(Oh(o),o=o.next),o}function yc(n,e){if(!n)return n;e||(e=n);let t=n,r;do if(r=!1,!t.steiner&&(uy(t,t.next)||Pn(t.prev,t,t.next)===0)){if(Oh(t),t=e=t.prev,t===t.next)break;r=!0}else t=t.next;while(r||t!==e);return e}function Dh(n,e,t,r,i,s,o){if(!n)return;!o&&s&&L8(n,r,i,s);let a=n,l,u;for(;n.prev!==n.next;){if(l=n.prev,u=n.next,s?M8(n,r,i,s):E8(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(u.i/t|0),Oh(n),n=u.next,a=u.next;continue}if(n=u,n===a){o?o===1?(n=b8(yc(n),e,t),Dh(n,e,t,r,i,s,2)):o===2&&T8(n,e,t,r,i,s):Dh(yc(n),e,t,r,i,s,1);break}}}function E8(n){const e=n.prev,t=n,r=n.next;if(Pn(e,t,r)>=0)return!1;const i=e.x,s=t.x,o=r.x,a=e.y,l=t.y,u=r.y,f=is?i>o?i:o:s>o?s:o,m=a>l?a>u?a:u:l>u?l:u;let v=r.next;for(;v!==e;){if(v.x>=f&&v.x<=p&&v.y>=h&&v.y<=m&&zu(i,a,s,l,o,u,v.x,v.y)&&Pn(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function M8(n,e,t,r){const i=n.prev,s=n,o=n.next;if(Pn(i,s,o)>=0)return!1;const a=i.x,l=s.x,u=o.x,f=i.y,h=s.y,p=o.y,m=al?a>u?a:u:l>u?l:u,x=f>h?f>p?f:p:h>p?h:p,g=E1(m,v,e,t,r),S=E1(w,x,e,t,r);let _=n.prevZ,b=n.nextZ;for(;_&&_.z>=g&&b&&b.z<=S;){if(_.x>=m&&_.x<=w&&_.y>=v&&_.y<=x&&_!==i&&_!==o&&zu(a,f,l,h,u,p,_.x,_.y)&&Pn(_.prev,_,_.next)>=0||(_=_.prevZ,b.x>=m&&b.x<=w&&b.y>=v&&b.y<=x&&b!==i&&b!==o&&zu(a,f,l,h,u,p,b.x,b.y)&&Pn(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;_&&_.z>=g;){if(_.x>=m&&_.x<=w&&_.y>=v&&_.y<=x&&_!==i&&_!==o&&zu(a,f,l,h,u,p,_.x,_.y)&&Pn(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;b&&b.z<=S;){if(b.x>=m&&b.x<=w&&b.y>=v&&b.y<=x&&b!==i&&b!==o&&zu(a,f,l,h,u,p,b.x,b.y)&&Pn(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function b8(n,e,t){let r=n;do{const i=r.prev,s=r.next.next;!uy(i,s)&&pI(i,r,r.next,s)&&Nh(i,s)&&Nh(s,i)&&(e.push(i.i/t|0),e.push(r.i/t|0),e.push(s.i/t|0),Oh(r),Oh(r.next),r=n=s),r=r.next}while(r!==n);return yc(r)}function T8(n,e,t,r,i,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&O8(o,a)){let l=mI(o,a);o=yc(o,o.next),l=yc(l,l.next),Dh(o,e,t,r,i,s,0),Dh(l,e,t,r,i,s,0);return}a=a.next}o=o.next}while(o!==n)}function C8(n,e,t,r){const i=[];let s,o,a,l,u;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const p=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=s&&p>r&&(r=p,i=t.x=t.x&&t.x>=l&&s!==t.x&&zu(oi.x||t.x===i.x&&I8(i,t)))&&(i=t,f=h)),t=t.next;while(t!==a);return i}function I8(n,e){return Pn(n.prev,n,e.prev)<0&&Pn(e.next,n,n.next)<0}function L8(n,e,t,r){let i=n;do i.z===0&&(i.z=E1(i.x,i.y,e,t,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==n);i.prevZ.nextZ=null,i.prevZ=null,D8(i)}function D8(n){let e,t,r,i,s,o,a,l,u=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,r=t,a=0,e=0;e0||l>0&&r;)a!==0&&(l===0||!r||t.z<=r.z)?(i=t,t=t.nextZ,a--):(i=r,r=r.nextZ,l--),s?s.nextZ=i:n=i,i.prevZ=s,s=i;t=r}s.nextZ=null,u*=2}while(o>1);return n}function E1(n,e,t,r,i){return n=(n-t)*i|0,e=(e-r)*i|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function N8(n){let e=n,t=n;do(e.x=(n-o)*(s-a)&&(n-o)*(r-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(i-o)*(r-a)}function O8(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!k8(n,e)&&(Nh(n,e)&&Nh(e,n)&&U8(n,e)&&(Pn(n.prev,n,e.prev)||Pn(n,e.prev,e))||uy(n,e)&&Pn(n.prev,n,n.next)>0&&Pn(e.prev,e,e.next)>0)}function Pn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function uy(n,e){return n.x===e.x&&n.y===e.y}function pI(n,e,t,r){const i=Ug(Pn(n,e,t)),s=Ug(Pn(n,e,r)),o=Ug(Pn(t,r,n)),a=Ug(Pn(t,r,e));return!!(i!==s&&o!==a||i===0&&kg(n,t,e)||s===0&&kg(n,r,e)||o===0&&kg(t,n,r)||a===0&&kg(t,e,r))}function kg(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Ug(n){return n>0?1:n<0?-1:0}function k8(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&pI(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function Nh(n,e){return Pn(n.prev,n,n.next)<0?Pn(n,e,n.next)>=0&&Pn(n,n.prev,e)>=0:Pn(n,e,n.prev)<0||Pn(n,n.next,e)<0}function U8(n,e){let t=n,r=!1;const i=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==n);return r}function mI(n,e){const t=new M1(n.i,n.x,n.y),r=new M1(e.i,e.x,e.y),i=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=i,i.prev=t,r.next=t,t.prev=r,s.next=r,r.prev=s,r}function SA(n,e,t,r){const i=new M1(n,e,t);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Oh(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function M1(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function F8(n,e,t,r){let i=0;for(let s=e,o=t-r;s2&&n[e-1].equals(n[0])&&n.pop()}function EA(n,e){for(let t=0;tNumber.EPSILON){const _e=Math.sqrt(be),Ke=Math.sqrt(O*O+ie*ie),Fe=xe.x-k/_e,He=xe.y+ze/_e,st=de.x-ie/Ke,mt=de.y+O/Ke,Ee=((st-Fe)*ie-(mt-He)*O)/(ze*ie-k*O);Te=Fe+ze*Ee-H.x,ye=He+k*Ee-H.y;const Nt=Te*Te+ye*ye;if(Nt<=2)return new ge(Te,ye);Xe=Math.sqrt(Nt/2)}else{let _e=!1;ze>Number.EPSILON?O>Number.EPSILON&&(_e=!0):ze<-Number.EPSILON?O<-Number.EPSILON&&(_e=!0):Math.sign(k)===Math.sign(ie)&&(_e=!0),_e?(Te=-k,ye=ze,Xe=Math.sqrt(be)):(Te=ze,ye=k,Xe=Math.sqrt(be/2))}return new ge(Te/Xe,ye/Xe)}const X=[];for(let H=0,xe=z.length,de=xe-1,Te=H+1;H=0;H--){const xe=H/x,de=m*Math.cos(xe*Math.PI/2),Te=v*Math.sin(xe*Math.PI/2)+w;for(let ye=0,Xe=z.length;ye=0;){const Te=de;let ye=de-1;ye<0&&(ye=H.length-1);for(let Xe=0,ze=f+x*2;Xe0)&&m.push(_,b,R),(g!==r-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class _I extends br{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Be(16777215),this.specular=new Be(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Be(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=dl,this.normalScale=new ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=kp,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class SI extends br{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Be(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Be(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=dl,this.normalScale=new ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class wI extends br{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=dl,this.normalScale=new ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class EI extends br{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Be(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Be(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=dl,this.normalScale=new ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=kp,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class MI extends br{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Be(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=dl,this.normalScale=new ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class bI extends ni{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function ql(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function TI(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function CI(n){function e(i,s){return n[i]-n[s]}const t=n.length,r=new Array(t);for(let i=0;i!==t;++i)r[i]=i;return r.sort(e),r}function b1(n,e,t){const r=n.length,i=new n.constructor(r);for(let s=0,o=0;o!==r;++s){const a=t[s]*e;for(let l=0;l!==e;++l)i[o++]=n[a+l]}return i}function zE(n,e,t,r){let i=1,s=n[0];for(;s!==void 0&&s[r]===void 0;)s=n[i++];if(s===void 0)return;let o=s[r];if(o!==void 0)if(Array.isArray(o))do o=s[r],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[i++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[r],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[i++];while(s!==void 0);else do o=s[r],o!==void 0&&(e.push(s.time),t.push(o)),s=n[i++];while(s!==void 0)}function H8(n,e,t,r,i=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l=r)){h.push(u.times[m]);for(let w=0;ws.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[v]){const g=v*h+f,S=g+h-f;w=a.values.slice(g,S)}else{const g=a.createInterpolant(),S=f,_=h-f;g.evaluate(s),w=g.resultBuffer.slice(S,_)}l==="quaternion"&&new Br().fromArray(w).normalize().conjugate().toArray(w);const x=u.times.length;for(let g=0;g=s)){const a=t[1];e=s)break t}o=r,r=0;break n}break e}for(;r>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=r.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,s=r.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=r[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&TI(i))for(let a=0,l=i.length;a!==l;++a){const u=i[a];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===Tv,s=e.length-1;let o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*r,l=o*r,u=0;u!==r;++u)t[l+u]=t[a+u];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*r)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),r=this.constructor,i=new r(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}Ns.prototype.TimeBufferType=Float32Array;Ns.prototype.ValueBufferType=Float32Array;Ns.prototype.DefaultInterpolation=Eh;class Lc extends Ns{}Lc.prototype.ValueTypeName="bool";Lc.prototype.ValueBufferType=Array;Lc.prototype.DefaultInterpolation=wh;Lc.prototype.InterpolantFactoryMethodLinear=void 0;Lc.prototype.InterpolantFactoryMethodSmooth=void 0;class VE extends Ns{}VE.prototype.ValueTypeName="color";class kh extends Ns{}kh.prototype.ValueTypeName="number";class PI extends Gp{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e,t,r,i){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(r-t)/(i-t);let u=e*a;for(let f=u+a;u!==f;u+=4)Br.slerpFlat(s,0,o,u-a,o,u,l);return s}}class Xd extends Ns{InterpolantFactoryMethodLinear(e){return new PI(this.times,this.values,this.getValueSize(),e)}}Xd.prototype.ValueTypeName="quaternion";Xd.prototype.DefaultInterpolation=Eh;Xd.prototype.InterpolantFactoryMethodSmooth=void 0;class Dc extends Ns{}Dc.prototype.ValueTypeName="string";Dc.prototype.ValueBufferType=Array;Dc.prototype.DefaultInterpolation=wh;Dc.prototype.InterpolantFactoryMethodLinear=void 0;Dc.prototype.InterpolantFactoryMethodSmooth=void 0;class Uh extends Ns{}Uh.prototype.ValueTypeName="vector";class Fh{constructor(e,t=-1,r,i=Y0){this.name=e,this.tracks=r,this.duration=t,this.blendMode=i,this.uuid=Li(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],r=e.tracks,i=1/(e.fps||1);for(let o=0,a=r.length;o!==a;++o)t.push(j8(r[o]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=r.length;s!==o;++s)t.push(Ns.toJSON(r[s]));return i}static CreateFromMorphTargetSequence(e,t,r,i){const s=t.length,o=[];for(let a=0;a1){const h=f[1];let p=i[h];p||(i[h]=p=[]),p.push(u)}}const o=[];for(const a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,r));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(h,p,m,v,w){if(m.length!==0){const x=[],g=[];zE(m,x,g,v),x.length!==0&&w.push(new h(p,x,g))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let h=0;h{t&&t(s),this.manager.itemEnd(e)},0),s;if(Co[e]!==void 0){Co[e].push({onLoad:t,onProgress:r,onError:i});return}Co[e]=[],Co[e].push({onLoad:t,onProgress:r,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const f=Co[e],h=u.body.getReader(),p=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),m=p?parseInt(p):0,v=m!==0;let w=0;const x=new ReadableStream({start(g){S();function S(){h.read().then(({done:_,value:b})=>{if(_)g.close();else{w+=b.byteLength;const A=new ProgressEvent("progress",{lengthComputable:v,loaded:w,total:m});for(let R=0,P=f.length;R{switch(l){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(f=>new DOMParser().parseFromString(f,a));case"json":return u.json();default:if(a===void 0)return u.text();{const h=/charset="?([^;"\s]*)"?/i.exec(a),p=h&&h[1]?h[1].toLowerCase():void 0,m=new TextDecoder(p);return u.arrayBuffer().then(v=>m.decode(v))}}}).then(u=>{ko.add(e,u);const f=Co[e];delete Co[e];for(let h=0,p=f.length;h{const f=Co[e];if(f===void 0)throw this.manager.itemError(e),u;delete Co[e];for(let h=0,p=f.length;h{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class q8 extends vi{constructor(e){super(e)}load(e,t,r,i){const s=this,o=new Go(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},r,i)}parse(e){const t=[];for(let r=0;r0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=r(o.value);break;case"c":i.uniforms[s].value=new Be().setHex(o.value);break;case"v2":i.uniforms[s].value=new ge().fromArray(o.value);break;case"v3":i.uniforms[s].value=new F().fromArray(o.value);break;case"v4":i.uniforms[s].value=new on().fromArray(o.value);break;case"m3":i.uniforms[s].value=new Vt().fromArray(o.value);break;case"m4":i.uniforms[s].value=new _t().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(i.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)i.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(i.lights=e.lights),e.clipping!==void 0&&(i.clipping=e.clipping),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=r(e.map)),e.matcap!==void 0&&(i.matcap=r(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=r(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=r(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=r(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new ge().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=r(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=r(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=r(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=r(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=r(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=r(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=r(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=r(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=r(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=r(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=r(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=r(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=r(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new ge().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(i.iridescenceMap=r(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=r(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(i.transmissionMap=r(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=r(e.thicknessMap)),e.anisotropyMap!==void 0&&(i.anisotropyMap=r(e.anisotropyMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=r(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=r(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:vI,SpriteMaterial:PE,RawShaderMaterial:yI,ShaderMaterial:as,PointsMaterial:LE,MeshPhysicalMaterial:xI,MeshStandardMaterial:xy,MeshPhongMaterial:_I,MeshToonMaterial:SI,MeshNormalMaterial:wI,MeshLambertMaterial:EI,MeshDepthMaterial:CE,MeshDistanceMaterial:AE,MeshBasicMaterial:fl,MeshMatcapMaterial:MI,LineDashedMaterial:bI,LineBasicMaterial:ni,Material:br};return new t[e]}}class T1{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let r=0,i=e.length;r0){const l=new HE(t);s=new zh(l),s.setCrossOrigin(this.crossOrigin);for(let u=0,f=e.length;u0){i=new zh(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const x=new Qr;x.min.fromArray(w.boxMin),x.max.fromArray(w.boxMax);const g=new Vr;return g.radius=w.sphereRadius,g.center.fromArray(w.sphereCenter),{boxInitialized:w.boxInitialized,box:x,sphereInitialized:w.sphereInitialized,sphere:g}}),o._maxGeometryCount=e.maxGeometryCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=u(e.matricesTexture.uuid);break;case"LOD":o=new tI;break;case"Line":o=new nl(a(e.geometry),l(e.material));break;case"LineLoop":o=new sI(a(e.geometry),l(e.material));break;case"LineSegments":o=new mo(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new oI(a(e.geometry),l(e.material));break;case"Sprite":o=new eI(l(e.material));break;case"Group":o=new Fu;break;case"Bone":o=new IE;break;default:o=new sn}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const p=e.children;for(let m=0;m"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=ko.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(u=>{t&&t(u),s.manager.itemEnd(e)}).catch(u=>{i&&i(u)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){return ko.add(e,u),t&&t(u),s.manager.itemEnd(e),u}).catch(function(u){i&&i(u),ko.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});ko.add(e,l),s.manager.itemStart(e)}}let Fg;class WE{static getContext(){return Fg===void 0&&(Fg=new(window.AudioContext||window.webkitAudioContext)),Fg}static setContext(e){Fg=e}}class sH extends vi{constructor(e){super(e)}load(e,t,r,i){const s=this,o=new Go(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const u=l.slice(0);WE.getContext().decodeAudioData(u,function(h){t(h)}).catch(a)}catch(u){a(u)}},r,i);function a(l){i?i(l):console.error(l),s.manager.itemError(e)}}}const IA=new _t,LA=new _t,Ll=new _t;class oH{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Rn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Rn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Ll.copy(e.projectionMatrix);const i=t.eyeSep/2,s=i*t.near/t.focus,o=t.near*Math.tan(lc*t.fov*.5)/t.zoom;let a,l;LA.elements[12]=-i,IA.elements[12]=i,a=-o*t.aspect+s,l=o*t.aspect+s,Ll.elements[0]=2*t.near/(l-a),Ll.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Ll),a=-o*t.aspect-s,l=o*t.aspect-s,Ll.elements[0]=2*t.near/(l-a),Ll.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Ll)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(LA),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(IA)}}class jp{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=DA(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=DA();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function DA(){return(typeof performance>"u"?Date:performance).now()}const Dl=new F,NA=new Br,aH=new F,Nl=new F;class lH extends sn{constructor(){super(),this.type="AudioListener",this.context=WE.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new jp}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Dl,NA,aH),Nl.set(0,0,-1).applyQuaternion(NA),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Dl.x,i),t.positionY.linearRampToValueAtTime(Dl.y,i),t.positionZ.linearRampToValueAtTime(Dl.z,i),t.forwardX.linearRampToValueAtTime(Nl.x,i),t.forwardY.linearRampToValueAtTime(Nl.y,i),t.forwardZ.linearRampToValueAtTime(Nl.z,i),t.upX.linearRampToValueAtTime(r.x,i),t.upY.linearRampToValueAtTime(r.y,i),t.upZ.linearRampToValueAtTime(r.z,i)}else t.setPosition(Dl.x,Dl.y,Dl.z),t.setOrientation(Nl.x,Nl.y,Nl.z,r.x,r.y,r.z)}}let HI=class extends sn{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(r,i,this._addIndex*t,1,t);for(let l=t,u=t+t;l!==u;++l)if(r[l]!==r[l+t]){a.setValue(r,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,r=this.valueSize,i=r*this._origIndex;e.getValue(t,i);for(let s=r,o=i;s!==o;++s)t[s]=t[i+s%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let r=e;r=.5)for(let o=0;o!==s;++o)e[t+o]=e[r+o]}_slerp(e,t,r,i){Br.slerpFlat(e,t,e,t,e,r,i)}_slerpAdditive(e,t,r,i,s){const o=this._workIndex*s;Br.multiplyQuaternionsFlat(e,o,e,t,e,r),Br.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,r,i,s){const o=1-i;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[r+a]*i}}_lerpAdditive(e,t,r,i,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[r+o]*i}}}const GE="\\[\\]\\.:\\/",fH=new RegExp("["+GE+"]","g"),jE="[^"+GE+"]",hH="[^"+GE.replace("\\.","")+"]",pH=/((?:WC+[\/:])*)/.source.replace("WC",jE),mH=/(WCOD+)?/.source.replace("WCOD",hH),gH=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",jE),vH=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",jE),yH=new RegExp("^"+pH+mH+gH+vH+"$"),xH=["material","materials","bones","map"];class _H{constructor(e,t,r){const i=r||Qt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,t)}setValue(e,t){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=r.length;i!==s;++i)r[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}}class Qt{constructor(e,t,r){this.path=t,this.parsedPath=r||Qt.parseTrackName(t),this.node=Qt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new Qt.Composite(e,t,r):new Qt(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(fH,"")}static parseTrackName(e){const t=yH.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=r.nodeName.substring(i+1);xH.indexOf(s)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=s)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(t);if(r!==void 0)return r}if(e.children){const r=function(s){for(let o=0;o=s){const h=s++,p=e[h];t[p.uuid]=f,e[f]=p,t[u]=h,e[h]=l;for(let m=0,v=i;m!==v;++m){const w=r[m],x=w[h],g=w[f];w[f]=x,w[h]=g}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,r=this._bindings,i=r.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const u=arguments[a],f=u.uuid,h=t[f];if(h!==void 0)if(delete t[f],h0&&(t[m.uuid]=h),e[h]=m,e.pop();for(let v=0,w=i;v!==w;++v){const x=r[v];x[h]=x[p],x.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const r=this._bindingsIndicesByPath;let i=r[e];const s=this._bindings;if(i!==void 0)return s[i];const o=this._paths,a=this._parsedPaths,l=this._objects,u=l.length,f=this.nCachedObjects_,h=new Array(u);i=s.length,r[e]=i,o.push(e),a.push(t),s.push(h);for(let p=f,m=l.length;p!==m;++p){const v=l[p];h[p]=new Qt(v,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,r=t[e];if(r!==void 0){const i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],u=e[a];t[u]=r,o[r]=l,o.pop(),s[r]=s[a],s.pop(),i[r]=i[a],i.pop()}}}class WI{constructor(e,t,r=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=r,this.blendMode=i;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:Gl,endingEnd:Gl};for(let u=0;u!==o;++u){const f=s[u].createInterpolant(null);a[u]=f,f.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=E3,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,r){if(e.fadeOut(t),this.fadeIn(t),r){const i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,r){return e.crossFadeFrom(this,t,r)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,r){const i=this._mixer,s=i.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,u=a.sampleValues;return l[0]=s,l[1]=s+r,u[0]=e/o,u[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,r,i){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*r;l<0||r===0?t=0:(this._startTime=null,t=r*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case yE:for(let f=0,h=l.length;f!==h;++f)l[f].evaluate(o),u[f].accumulateAdditive(a);break;case Y0:default:for(let f=0,h=l.length;f!==h;++f)l[f].evaluate(o),u[f].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const r=this._weightInterpolant;if(r!==null){const i=r.evaluate(e)[0];t*=i,e>r.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const r=this._timeScaleInterpolant;if(r!==null){const i=r.evaluate(e)[0];t*=i,e>r.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,r=this.loop;let i=this.time+e,s=this._loopCount;const o=r===M3;if(e===0)return s===-1?i:o&&(s&1)===1?t-i:i;if(r===w3){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){const a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const u=e<0;this._setEndings(u,!u,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)===1)return t-i}return i}_setEndings(e,t,r){const i=this._interpolantSettings;r?(i.endingStart=jl,i.endingEnd=jl):(e?i.endingStart=this.zeroSlopeAtStart?jl:Gl:i.endingStart=Mh,t?i.endingEnd=this.zeroSlopeAtEnd?jl:Gl:i.endingEnd=Mh)}_scheduleFading(e,t,r){const i=this._mixer,s=i.time;let o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=r,this}}const wH=new Float32Array(1);class EH extends po{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const r=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,l=r.uuid,u=this._bindingsByRootAndName;let f=u[l];f===void 0&&(f={},u[l]=f);for(let h=0;h!==s;++h){const p=i[h],m=p.name;let v=f[m];if(v!==void 0)++v.referenceCount,o[h]=v;else{if(v=o[h],v!==void 0){v._cacheIndex===null&&(++v.referenceCount,this._addInactiveBinding(v,l,m));continue}const w=t&&t._propertyBindings[h].binding.parsedPath;v=new $I(Qt.create(r,m,w),p.ValueTypeName,p.getValueSize()),++v.referenceCount,this._addInactiveBinding(v,l,m),o[h]=v}a[h].resultBuffer=v.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const r=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,r)}const t=e._propertyBindings;for(let r=0,i=t.length;r!==i;++r){const s=t[r];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let r=0,i=t.length;r!==i;++r){const s=t[r];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;const t=this._actions,r=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let u=0;u!==r;++u)t[u]._update(i,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let u=0;u!==l;++u)a[u].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,UA).distanceTo(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}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 FA=new F,zg=new F;class PH{constructor(e=new F,t=new F){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){FA.subVectors(e,this.start),zg.subVectors(this.end,this.start);const r=zg.dot(zg);let s=zg.dot(FA)/r;return t&&(s=zn(s,0,1)),s}closestPointToPoint(e,t,r){const i=this.closestPointToPointParameter(e,t);return this.delta(r).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const zA=new F;class IH extends sn{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const r=new Ut,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let h=0;h.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{WA.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(WA,t)}}setLength(e,t=e*.2,r=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(r,t,r),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class WH extends mo{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new Ut;i.setAttribute("position",new ot(t,3)),i.setAttribute("color",new ot(r,3));const s=new ni({vertexColors:!0,toneMapped:!1});super(i,s),this.type="AxesHelper"}setColors(e,t,r){const i=new Be,s=this.geometry.attributes.color.array;return i.set(e),i.toArray(s,0),i.toArray(s,3),i.set(t),i.toArray(s,6),i.toArray(s,9),i.set(r),i.toArray(s,12),i.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class GH{constructor(){this.type="ShapePath",this.color=new Be,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Lh,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,r,i){return this.currentPath.quadraticCurveTo(e,t,r,i),this}bezierCurveTo(e,t,r,i,s,o){return this.currentPath.bezierCurveTo(e,t,r,i,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(g){const S=[];for(let _=0,b=g.length;_Number.EPSILON){if(C<0&&(P=S[R],V=-V,D=S[A],C=-C),g.yD.y)continue;if(g.y===P.y){if(g.x===P.x)return!0}else{const L=C*(g.x-P.x)-V*(g.y-P.y);if(L===0)return!0;if(L<0)continue;b=!b}}else{if(g.y!==P.y)continue;if(D.x<=g.x&&g.x<=P.x||P.x<=g.x&&g.x<=D.x)return!0}}return b}const i=ao.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const u=[];if(s.length===1)return a=s[0],l=new dc,l.curves=a.curves,u.push(l),u;let f=!i(s[0].getPoints());f=e?!f:f;const h=[],p=[];let m=[],v=0,w;p[v]=void 0,m[v]=[];for(let g=0,S=s.length;g1){let g=!1,S=0;for(let _=0,b=p.length;_0&&g===!1&&(m=h)}let x;for(let g=0,S=p.length;gthis.map[l][0]&&a<=this.map[l+1][0]){const u=this.map[l][0],f=this.map[l+1][0];i.setHex(this.map[l][1],di),s.setHex(this.map[l+1][1],di);const h=new Be().lerpColors(i,s,(a-u)/(f-u));this.lut.push(h)}}return this.lut.push(new Be(this.map[this.map.length-1][1])),this}copy(e){return this.lut=e.lut,this.map=e.map,this.n=e.n,this.minV=e.minV,this.maxV=e.maxV,this}getColor(e){e=O3.clamp(e,this.minV,this.maxV),e=(e-this.minV)/(this.maxV-this.minV);const t=Math.round(e*this.n);return this.lut[t]}addColorMap(e,t){return V_[e]=t,this}createCanvas(){const e=document.createElement("canvas");return e.width=1,e.height=this.n,this.updateCanvas(e),e}updateCanvas(e){const t=e.getContext("2d",{alpha:!1}),r=t.getImageData(0,0,1,this.n),i=r.data;let s=0;const o=1/this.n,a=new Be,l=new Be,u=new Be;for(let f=1;f>=0;f-=o)for(let h=this.map.length-1;h>=0;h--)if(f=this.map[h-1][0]){const p=this.map[h-1][0],m=this.map[h][0];a.setHex(this.map[h-1][1],di),l.setHex(this.map[h][1],di),u.lerpColors(a,l,(f-p)/(m-p)),i[s*4]=Math.round(u.r*255),i[s*4+1]=Math.round(u.g*255),i[s*4+2]=Math.round(u.b*255),i[s*4+3]=255,s+=1}return t.putImageData(r,0,0),e}}const V_={rainbow:[[0,255],[.2,65535],[.5,65280],[.8,16776960],[1,16711680]],cooltowarm:[[0,3952322],[.2,10206463],[.5,14474460],[.8,16163717],[1,11797542]],blackbody:[[0,0],[.2,7864320],[.5,15086080],[.8,16776960],[1,16777215]],grayscale:[[0,0],[.2,4210752],[.5,8355712],[.8,12566463],[1,16777215]]},At={THREE_RAINBOW:"rainbow",THREE_COOL_TO_WARM:"cooltowarm",WARM:"Warm",WARM_2:"Warm_2",WARM_3:"Warm_3",SAND:"Sand",SAND_2:"Sand_2",SAND_3:"Sand_3",SAND_4:"Sand_4",SAND_5:"Sand_5",NATURAL:"Natural",NATURAL_2:"Natural_2",CIRCUS:"Circus",SEASIDE:"Seaside",DRAGON:"Dragon"},oh=[At.THREE_COOL_TO_WARM,At.THREE_RAINBOW,At.WARM,At.WARM_2,At.WARM_3,At.SAND,At.SAND_2,At.SAND_3,At.SAND_4,At.SAND_5,At.NATURAL,At.NATURAL_2,At.CIRCUS,At.SEASIDE,At.DRAGON],H_=(n,e,t)=>t<=0?n:t>=1?e:n+t*(e-n);class GA{constructor(e){at(this,"colors");at(this,"getAt",e=>{e=Math.min(1,Math.max(0,e));const t=Math.floor(e*this.colors.length*.9999),r=Math.min(this.colors.length-1,Math.max(0,t+1)),i=this.colors[t],s=this.colors[r],o=(e-t/this.colors.length)/(1/this.colors.length);return new Be().setRGB(H_(i.r,s.r,o),H_(i.g,s.g,o),H_(i.b,s.b,o),Fn)});this.colors=e.colors.map(t=>new Be(t))}}class Wn{constructor(e,t){at(this,"name");at(this,"colors");at(this,"buildLut",()=>{const e=new qH;return e.addColorMap(this.name,this.colorsHex.map((t,r)=>[r/(this.nColors-1),t])),e.setColorMap(this.name),e});at(this,"calcBackgroundColor",(e=.5)=>{const r=new GA(this).getAt(e),i={h:0,s:0,l:0};return r.getHSL(i,Fn),i.s=Math.min(i.s,.5),r.setHSL(i.h,i.s,i.l,Fn),r});at(this,"lerpColor",e=>{const t=Math.min(1,Math.max(0,e));return new GA(this).getAt(t)});if(this.name=e,t.length<2)throw new Error("Not enough colors");this.colors=[...t]}get colorsHex(){return this.colors.map(e=>new Be(e).getHex())}get nColors(){return this.colors.length}static getPalette(e){switch(e){case At.WARM:return new Wn(At.WARM,["#FF2000","#FF5900","#FE9100","#FEFDFC","#FEC194","#FE9F5B"]);case At.WARM_2:return new Wn("Warm_2",["#FFFEFE","#0D0211","#FBCEA0","#FFAD5D","#530E1D","#FE9232","#B93810","#907996"]);case At.WARM_3:return new Wn(At.WARM_3,["#EDEBE7","#13595A","#DE1408","#161814","#E1610A","#B7BDB3","#9F9772"]);case At.SAND:return new Wn(At.SAND,["#b8987a","#caa87f","#dfb98a","#ebc99c","#f3ddb0","#f9e6c1","#fff3d7"]);case At.SAND_2:return new Wn(At.SAND_2,["#f2ead6","#327172","#2d3e58","#f47e72","#f2cab1"]);case At.SAND_3:return new Wn(At.SAND_3,["#f1e2c3","#8595a4","#8d4f2a","#d86b28","#eca956"]);case At.SAND_4:return new Wn(At.SAND_4,["#242112","#684f27","#9a733a","#ac8f56","#e5a752","#fdbe6e","#ffd28f"]);case At.SAND_5:return new Wn(At.SAND_5,["#44200a","#75380c","#9e5922","#b96525","#da863d","#f5ad63","#fec37d"]);case At.NATURAL:return new Wn(At.NATURAL,["#FF6D00","#FBF8EB","#008B99","#F8E1A6","#FDA81F","#B80A01","#480D07"]);case At.NATURAL_2:return new Wn(At.NATURAL_2,["#EF2006","#350000","#A11104","#ED5910","#F1B52E","#7B5614","#F7F1AC"]);case At.CIRCUS:return new Wn(At.CIRCUS,["#F62D62","#FFFFFF","#FDB600","#F42D2D","#544C98","#ECACBC"]);case At.SEASIDE:return new Wn(At.SEASIDE,["#FEB019","#F46002","#E1E7F1","#0A1D69","#138FE2","#0652C4","#D23401","#B0A12F"]);case At.DRAGON:return new Wn(At.DRAGON,["#F2E9D9","#101010","#EA4B04","#B6AC9E","#5A5754","#837F7A","#E78E36","#552509"]);case At.THREE_RAINBOW:return new Wn(At.THREE_RAINBOW,["#0000FF","#00FFFF","#00FF00","#FFFF00","#FF0000"]);case At.THREE_COOL_TO_WARM:return new Wn(At.THREE_COOL_TO_WARM,["#3c4ec2","#9bbcff","#dcdcdc","#f6a385","#b40426"]);default:return e}}static random(e=oh){return Wn.getPalette(e[Math.floor(Math.random()*e.length)])}}const qd=JF((n,e)=>({user:{canvasInteractionEventTracker:new XH},visual:{palette:At.THREE_COOL_TO_WARM},visualSourceData:{x:new Float32Array(121).fill(0),y:new Float32Array(121).fill(0)},energyInfo:{current:0},actions:{noteCanvasInteraction:()=>n(t=>(t.user.canvasInteractionEventTracker.addEvent(),{user:{canvasInteractionEventTracker:t.user.canvasInteractionEventTracker}})),setPalette:t=>n(r=>({visual:{palette:t}})),nextPalette:()=>n(t=>{const i=((oh.indexOf(t.visual.palette)??0)+1)%oh.length;return{visual:{palette:oh[i]}}}),resizeVisualSourceData:t=>n(r=>({visualSourceData:{x:new Float32Array(t).fill(0),y:new Float32Array(t).fill(0)}}))}})),YH=()=>qd(n=>n.user),XE=()=>qd(n=>n.visual.palette),Sy=()=>qd(n=>n.visualSourceData.x),XI=()=>qd(n=>n.visualSourceData.y),qE=()=>qd(n=>n.energyInfo),Yd=()=>qd(n=>n.actions),qI=({analyzer:n})=>{const{octaveBandMode:e,energyMeasure:t}=cE(),r=Sy(),i=qE(),{resizeVisualSourceData:s}=Yd(),o=M.useRef(null),a=M.useCallback(()=>{const l=n.getBars();if(r.length!=l.length){console.log(`Resizing ${l.length}`),s(l.length);return}i.current=n.getEnergy(t),l.forEach(({value:u},f)=>{r[f]=u})},[r,n,s,i,t]);return M.useEffect(()=>{o.current&&cancelAnimationFrame(o.current);const l=()=>{a(),o.current=requestAnimationFrame(l)};return o.current=requestAnimationFrame(l),()=>cancelAnimationFrame(o.current)},[r,t,a]),M.useEffect(()=>{n.mode=e},[e,n]),N.jsx(N.Fragment,{})},Jn={FILE_UPLOAD:"FILE_UPLOAD",MICROPHONE:"MICROPHONE",SOUNDCLOUD:"SOUNDCLOUD",SCREEN_SHARE:"SCREEN_SHARE"},YI=()=>{var n;return navigator.platform.toLowerCase().startsWith("ip")?!0:((n=navigator.userAgent)==null?void 0:n.toLowerCase().startsWith("mac"))&&"ontouchend"in document},ZI=()=>[Jn.SOUNDCLOUD,Jn.MICROPHONE,Jn.FILE_UPLOAD,Jn.SCREEN_SHARE],KI=()=>{console.log("Building audio...");const n=new Audio;return n.crossOrigin="anonymous",n},ZH=n=>new Promise(function(e,t){const r=["mousedown","touchstart","touchend"];if(n.state==="suspended"&&"ontouchstart"in window){const i=function(){n.resume().then(function(){r.forEach(s=>{document.body.removeEventListener(s,i)}),e(!0)},function(s){t(s)})};r.forEach(s=>{document.body.addEventListener(s,i,!1)})}else e(!1)}),QI=()=>{console.log("Building audioCtx...");const n=new window.AudioContext;return YI()&&(console.log("Attempting to unlock AudioContext"),ZH(n).then(function(e){console.log(e?"Successfully unlocked AudioContext!":"No need to unlock AudioContext.")},function(e){console.error(e)})),n};const KH=n=>{const[e,t]=M.useState(!1),[r,i]=M.useState(!1),s=null,o=M.useCallback(()=>{},[n,s]);return M.useEffect(()=>{console.log("Syncing, start w/ pause..."),n.pause(),t(!1);{i(!1);return}},[n,s,o]),{loaded:r,isPlaying:e,playAudio:o}},QH=({audio:n})=>{const{loaded:e,isPlaying:t,playAudio:r}=KH(n);return YI()?N.jsx("div",{id:"info",style:{top:"1rem",left:"1rem"},hidden:t,children:e?N.jsx("button",{disabled:!e||t,onClick:r,children:"Play Audio"}):N.jsxs(N.Fragment,{children:[N.jsx("h2",{children:"Load a file"}),N.jsx("p",{children:"Use the controls panel to upload an audio file."})]})}):N.jsx(N.Fragment,{})},Rt={WAVE_FORM:"WAVE_FORM",NOISE:"NOISE",AUDIO:"AUDIO",AUDIO_SCOPE:"AUDIO_SCOPE",PARTICLE_NOISE:"PARTICLE_NOISE"},JH=n=>{switch(n){case Rt.WAVE_FORM:case Rt.NOISE:case Rt.PARTICLE_NOISE:return!1;case Rt.AUDIO:case Rt.AUDIO_SCOPE:return!0;default:return n}},e$=()=>[Rt.WAVE_FORM,Rt.NOISE,Rt.AUDIO],t$=n=>{switch(n){case Rt.WAVE_FORM:case Rt.NOISE:case Rt.AUDIO:case Rt.PARTICLE_NOISE:return!0;case Rt.AUDIO_SCOPE:return!1;default:return n}},YE=M.createContext(null),n$=({children:n})=>{const[e,t]=M.useState(Rt.WAVE_FORM),[r,i]=M.useState(!0);return N.jsx(YE.Provider,{value:{config:{mode:e,showUI:r},setters:{setMode:t,setShowUI:i}},children:n})};function Nc(){const n=M.useContext(YE);if(!n)throw new Error("useModeContext must be used within a ModeContextProvider");return n.config}function JI(){const n=M.useContext(YE);if(!n)throw new Error("useModeContext must be used within a ModeContextProvider");return n.setters}const ZE=M.createContext(null),r$=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.track)??null);return N.jsx(ZE.Provider,{value:{config:{track:t},setters:{setTrack:r}},children:e})};function i$(){const n=M.useContext(ZE);if(!n)throw new Error("useSoundcloudContext must be used within a SoundcloudContextProvider");return n.config}function s$(){const n=M.useContext(ZE);if(!n)throw new Error("useSoundcloudContext must be used within a SoundcloudContextProvider");return n.setters}var rn;(function(n){n.assertEqual=i=>i;function e(i){}n.assertIs=e;function t(i){throw new Error}n.assertNever=t,n.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},n.getValidEnumValues=i=>{const s=n.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return n.objectValues(o)},n.objectValues=i=>n.objectKeys(i).map(function(s){return i[s]}),n.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},n.find=(i,s)=>{for(const o of i)if(s(o))return o},n.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}n.joinValues=r,n.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(rn||(rn={}));var A1;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(A1||(A1={}));const Ze=rn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Pa=n=>{switch(typeof n){case"undefined":return Ze.undefined;case"string":return Ze.string;case"number":return isNaN(n)?Ze.nan:Ze.number;case"boolean":return Ze.boolean;case"function":return Ze.function;case"bigint":return Ze.bigint;case"symbol":return Ze.symbol;case"object":return Array.isArray(n)?Ze.array:n===null?Ze.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?Ze.promise:typeof Map<"u"&&n instanceof Map?Ze.map:typeof Set<"u"&&n instanceof Set?Ze.set:typeof Date<"u"&&n instanceof Date?Ze.date:Ze.object;default:return Ze.unknown}},Oe=rn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),o$=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class Cs extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(t(o));else{let a=r,l=0;for(;lt.message){const t={},r=[];for(const i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}Cs.create=n=>new Cs(n);const Bh=(n,e)=>{let t;switch(n.code){case Oe.invalid_type:n.received===Ze.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case Oe.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,rn.jsonStringifyReplacer)}`;break;case Oe.unrecognized_keys:t=`Unrecognized key(s) in object: ${rn.joinValues(n.keys,", ")}`;break;case Oe.invalid_union:t="Invalid input";break;case Oe.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${rn.joinValues(n.options)}`;break;case Oe.invalid_enum_value:t=`Invalid enum value. Expected ${rn.joinValues(n.options)}, received '${n.received}'`;break;case Oe.invalid_arguments:t="Invalid function arguments";break;case Oe.invalid_return_type:t="Invalid function return type";break;case Oe.invalid_date:t="Invalid date";break;case Oe.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:rn.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case Oe.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case Oe.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case Oe.custom:t="Invalid input";break;case Oe.invalid_intersection_types:t="Intersection results could not be merged";break;case Oe.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case Oe.not_finite:t="Number must be finite";break;default:t=e.defaultError,rn.assertNever(n)}return{message:t}};let eL=Bh;function a$(n){eL=n}function Kv(){return eL}const Qv=n=>{const{data:e,path:t,errorMaps:r,issueData:i}=n,s=[...t,...i.path||[]],o={...i,path:s};let a="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)a=u(o,{data:e,defaultError:a}).message;return{...i,path:s,message:i.message||a}},l$=[];function Qe(n,e){const t=Qv({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Kv(),Bh].filter(r=>!!r)});n.common.issues.push(t)}class Hr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const i of t){if(i.status==="aborted")return Pt;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const i of t)r.push({key:await i.key,value:await i.value});return Hr.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const i of t){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Pt;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:e.value,value:r}}}const Pt=Object.freeze({status:"aborted"}),tL=n=>({status:"dirty",value:n}),ei=n=>({status:"valid",value:n}),R1=n=>n.status==="aborted",P1=n=>n.status==="dirty",Vh=n=>n.status==="valid",Jv=n=>typeof Promise<"u"&&n instanceof Promise;var ht;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ht||(ht={}));class uo{constructor(e,t,r,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const jA=(n,e)=>{if(Vh(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Cs(n.common.issues);return this._error=t,this._error}}};function kt(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:i}=n;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:t??a.defaultError},description:i}}class Ht{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Pa(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Pa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Hr,ctx:{common:e.parent.common,data:e.data,parsedType:Pa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Jv(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const i={common:{issues:[],async:(r=t==null?void 0:t.async)!==null&&r!==void 0?r:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pa(e)},s=this._parseSync({data:e,path:i.path,parent:i});return jA(i,s)}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pa(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(Jv(i)?i:Promise.resolve(i));return jA(r,s)}refine(e,t){const r=i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t;return this._refinement((i,s)=>{const o=e(i),a=()=>s.addIssue({code:Oe.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,t){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof t=="function"?t(r,i):t),!1))}_refinement(e){return new Is({schema:this,typeName:xt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Vo.create(this,this._def)}nullable(){return Sc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return As.create(this,this._def)}promise(){return Ad.create(this,this._def)}or(e){return Gh.create([this,e],this._def)}and(e){return jh.create(this,e,this._def)}transform(e){return new Is({...kt(this._def),schema:this,typeName:xt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Kh({...kt(this._def),innerType:this,defaultValue:t,typeName:xt.ZodDefault})}brand(){return new rL({typeName:xt.ZodBranded,type:this,...kt(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new r0({...kt(this._def),innerType:this,catchValue:t,typeName:xt.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Xp.create(this,e)}readonly(){return s0.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const c$=/^c[^\s-]{8,}$/i,u$=/^[a-z][a-z0-9]*$/,d$=/^[0-9A-HJKMNP-TV-Z]{26}$/,f$=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,h$=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,p$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let $_;const m$=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,g$=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,v$=n=>n.precision?n.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${n.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${n.precision}}Z$`):n.precision===0?n.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):n.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function y$(n,e){return!!((e==="v4"||!e)&&m$.test(n)||(e==="v6"||!e)&&g$.test(n))}class Ts extends Ht{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ze.string){const s=this._getOrReturnCtx(e);return Qe(s,{code:Oe.invalid_type,expected:Ze.string,received:s.parsedType}),Pt}const r=new Hr;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.lengths.value&&(i=this._getOrReturnCtx(e,i),Qe(i,{code:Oe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,a=e.data.lengthe.test(i),{validation:t,code:Oe.invalid_string,...ht.errToObj(r)})}_addCheck(e){return new Ts({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ht.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ht.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ht.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ht.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ht.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ht.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ht.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ht.errToObj(e)})}datetime(e){var t;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,...ht.errToObj(e==null?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...ht.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...ht.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...ht.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...ht.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...ht.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...ht.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...ht.errToObj(t)})}nonempty(e){return this.min(1,ht.errToObj(e))}trim(){return new Ts({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ts({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ts({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new Ts({checks:[],typeName:xt.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...kt(n)})};function x$(n,e){const t=(n.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=t>r?t:r,s=parseInt(n.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class rl extends Ht{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Ze.number){const s=this._getOrReturnCtx(e);return Qe(s,{code:Oe.invalid_type,expected:Ze.number,received:s.parsedType}),Pt}let r;const i=new Hr;for(const s of this._def.checks)s.kind==="int"?rn.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Qe(r,{code:Oe.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.datas.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),Qe(r,{code:Oe.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?x$(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),Qe(r,{code:Oe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Qe(r,{code:Oe.not_finite,message:s.message}),i.dirty()):rn.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,ht.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ht.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ht.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ht.toString(t))}setLimit(e,t,r,i){return new rl({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ht.toString(i)}]})}_addCheck(e){return new rl({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ht.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ht.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ht.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ht.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ht.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ht.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:ht.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ht.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ht.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&rn.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.valuenew rl({checks:[],typeName:xt.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...kt(n)});class il extends Ht{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Ze.bigint){const s=this._getOrReturnCtx(e);return Qe(s,{code:Oe.invalid_type,expected:Ze.bigint,received:s.parsedType}),Pt}let r;const i=new Hr;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.datas.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),Qe(r,{code:Oe.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Qe(r,{code:Oe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):rn.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,ht.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ht.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ht.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ht.toString(t))}setLimit(e,t,r,i){return new il({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ht.toString(i)}]})}_addCheck(e){return new il({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ht.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ht.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ht.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ht.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ht.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new il({checks:[],typeName:xt.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...kt(n)})};class Hh extends Ht{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ze.boolean){const r=this._getOrReturnCtx(e);return Qe(r,{code:Oe.invalid_type,expected:Ze.boolean,received:r.parsedType}),Pt}return ei(e.data)}}Hh.create=n=>new Hh({typeName:xt.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...kt(n)});class xc extends Ht{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ze.date){const s=this._getOrReturnCtx(e);return Qe(s,{code:Oe.invalid_type,expected:Ze.date,received:s.parsedType}),Pt}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return Qe(s,{code:Oe.invalid_date}),Pt}const r=new Hr;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()s.value&&(i=this._getOrReturnCtx(e,i),Qe(i,{code:Oe.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):rn.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new xc({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:ht.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:ht.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew xc({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:xt.ZodDate,...kt(n)});class e0 extends Ht{_parse(e){if(this._getType(e)!==Ze.symbol){const r=this._getOrReturnCtx(e);return Qe(r,{code:Oe.invalid_type,expected:Ze.symbol,received:r.parsedType}),Pt}return ei(e.data)}}e0.create=n=>new e0({typeName:xt.ZodSymbol,...kt(n)});class $h extends Ht{_parse(e){if(this._getType(e)!==Ze.undefined){const r=this._getOrReturnCtx(e);return Qe(r,{code:Oe.invalid_type,expected:Ze.undefined,received:r.parsedType}),Pt}return ei(e.data)}}$h.create=n=>new $h({typeName:xt.ZodUndefined,...kt(n)});class Wh extends Ht{_parse(e){if(this._getType(e)!==Ze.null){const r=this._getOrReturnCtx(e);return Qe(r,{code:Oe.invalid_type,expected:Ze.null,received:r.parsedType}),Pt}return ei(e.data)}}Wh.create=n=>new Wh({typeName:xt.ZodNull,...kt(n)});class Cd extends Ht{constructor(){super(...arguments),this._any=!0}_parse(e){return ei(e.data)}}Cd.create=n=>new Cd({typeName:xt.ZodAny,...kt(n)});class fc extends Ht{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ei(e.data)}}fc.create=n=>new fc({typeName:xt.ZodUnknown,...kt(n)});class jo extends Ht{_parse(e){const t=this._getOrReturnCtx(e);return Qe(t,{code:Oe.invalid_type,expected:Ze.never,received:t.parsedType}),Pt}}jo.create=n=>new jo({typeName:xt.ZodNever,...kt(n)});class t0 extends Ht{_parse(e){if(this._getType(e)!==Ze.undefined){const r=this._getOrReturnCtx(e);return Qe(r,{code:Oe.invalid_type,expected:Ze.void,received:r.parsedType}),Pt}return ei(e.data)}}t0.create=n=>new t0({typeName:xt.ZodVoid,...kt(n)});class As extends Ht{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),i=this._def;if(t.parsedType!==Ze.array)return Qe(t,{code:Oe.invalid_type,expected:Ze.array,received:t.parsedType}),Pt;if(i.exactLength!==null){const o=t.data.length>i.exactLength.value,a=t.data.lengthi.maxLength.value&&(Qe(t,{code:Oe.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((o,a)=>i.type._parseAsync(new uo(t,o,t.path,a)))).then(o=>Hr.mergeArray(r,o));const s=[...t.data].map((o,a)=>i.type._parseSync(new uo(t,o,t.path,a)));return Hr.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new As({...this._def,minLength:{value:e,message:ht.toString(t)}})}max(e,t){return new As({...this._def,maxLength:{value:e,message:ht.toString(t)}})}length(e,t){return new As({...this._def,exactLength:{value:e,message:ht.toString(t)}})}nonempty(e){return this.min(1,e)}}As.create=(n,e)=>new As({type:n,minLength:null,maxLength:null,exactLength:null,typeName:xt.ZodArray,...kt(e)});function Lu(n){if(n instanceof Cn){const e={};for(const t in n.shape){const r=n.shape[t];e[t]=Vo.create(Lu(r))}return new Cn({...n._def,shape:()=>e})}else return n instanceof As?new As({...n._def,type:Lu(n.element)}):n instanceof Vo?Vo.create(Lu(n.unwrap())):n instanceof Sc?Sc.create(Lu(n.unwrap())):n instanceof fo?fo.create(n.items.map(e=>Lu(e))):n}class Cn extends Ht{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=rn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Ze.object){const u=this._getOrReturnCtx(e);return Qe(u,{code:Oe.invalid_type,expected:Ze.object,received:u.parsedType}),Pt}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof jo&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||a.push(u);const l=[];for(const u of o){const f=s[u],h=i.data[u];l.push({key:{status:"valid",value:u},value:f._parse(new uo(i,h,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof jo){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of a)l.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(u==="strict")a.length>0&&(Qe(i,{code:Oe.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of a){const h=i.data[f];l.push({key:{status:"valid",value:f},value:u._parse(new uo(i,h,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of l){const h=await f.key;u.push({key:h,value:await f.value,alwaysSet:f.alwaysSet})}return u}).then(u=>Hr.mergeObjectSync(r,u)):Hr.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return ht.errToObj,new Cn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var i,s,o,a;const l=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,t,r).message)!==null&&o!==void 0?o:r.defaultError;return t.code==="unrecognized_keys"?{message:(a=ht.errToObj(e).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Cn({...this._def,unknownKeys:"strip"})}passthrough(){return new Cn({...this._def,unknownKeys:"passthrough"})}extend(e){return new Cn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Cn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:xt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Cn({...this._def,catchall:e})}pick(e){const t={};return rn.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new Cn({...this._def,shape:()=>t})}omit(e){const t={};return rn.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new Cn({...this._def,shape:()=>t})}deepPartial(){return Lu(this)}partial(e){const t={};return rn.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?t[r]=i:t[r]=i.optional()}),new Cn({...this._def,shape:()=>t})}required(e){const t={};return rn.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Vo;)s=s._def.innerType;t[r]=s}}),new Cn({...this._def,shape:()=>t})}keyof(){return nL(rn.objectKeys(this.shape))}}Cn.create=(n,e)=>new Cn({shape:()=>n,unknownKeys:"strip",catchall:jo.create(),typeName:xt.ZodObject,...kt(e)});Cn.strictCreate=(n,e)=>new Cn({shape:()=>n,unknownKeys:"strict",catchall:jo.create(),typeName:xt.ZodObject,...kt(e)});Cn.lazycreate=(n,e)=>new Cn({shape:n,unknownKeys:"strip",catchall:jo.create(),typeName:xt.ZodObject,...kt(e)});class Gh extends Ht{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Cs(a.ctx.common.issues));return Qe(t,{code:Oe.invalid_union,unionErrors:o}),Pt}if(t.common.async)return Promise.all(r.map(async s=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const l of r){const u={...t,common:{...t.common,issues:[]},parent:null},f=l._parseSync({data:t.data,path:t.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(l=>new Cs(l));return Qe(t,{code:Oe.invalid_union,unionErrors:a}),Pt}}get options(){return this._def.options}}Gh.create=(n,e)=>new Gh({options:n,typeName:xt.ZodUnion,...kt(e)});const Av=n=>n instanceof qh?Av(n.schema):n instanceof Is?Av(n.innerType()):n instanceof Yh?[n.value]:n instanceof sl?n.options:n instanceof Zh?Object.keys(n.enum):n instanceof Kh?Av(n._def.innerType):n instanceof $h?[void 0]:n instanceof Wh?[null]:null;class wy extends Ht{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ze.object)return Qe(t,{code:Oe.invalid_type,expected:Ze.object,received:t.parsedType}),Pt;const r=this.discriminator,i=t.data[r],s=this.optionsMap.get(i);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(Qe(t,{code:Oe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Pt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const i=new Map;for(const s of t){const o=Av(s.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new wy({typeName:xt.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...kt(r)})}}function I1(n,e){const t=Pa(n),r=Pa(e);if(n===e)return{valid:!0,data:n};if(t===Ze.object&&r===Ze.object){const i=rn.objectKeys(e),s=rn.objectKeys(n).filter(a=>i.indexOf(a)!==-1),o={...n,...e};for(const a of s){const l=I1(n[a],e[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(t===Ze.array&&r===Ze.array){if(n.length!==e.length)return{valid:!1};const i=[];for(let s=0;s{if(R1(s)||R1(o))return Pt;const a=I1(s.value,o.value);return a.valid?((P1(s)||P1(o))&&t.dirty(),{status:t.value,value:a.data}):(Qe(r,{code:Oe.invalid_intersection_types}),Pt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}jh.create=(n,e,t)=>new jh({left:n,right:e,typeName:xt.ZodIntersection,...kt(t)});class fo extends Ht{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.array)return Qe(r,{code:Oe.invalid_type,expected:Ze.array,received:r.parsedType}),Pt;if(r.data.lengththis._def.items.length&&(Qe(r,{code:Oe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...r.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new uo(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>Hr.mergeArray(t,o)):Hr.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new fo({...this._def,rest:e})}}fo.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fo({items:n,typeName:xt.ZodTuple,rest:null,...kt(e)})};class Xh extends Ht{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.object)return Qe(r,{code:Oe.invalid_type,expected:Ze.object,received:r.parsedType}),Pt;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new uo(r,a,r.path,a)),value:o._parse(new uo(r,r.data[a],r.path,a))});return r.common.async?Hr.mergeObjectAsync(t,i):Hr.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof Ht?new Xh({keyType:e,valueType:t,typeName:xt.ZodRecord,...kt(r)}):new Xh({keyType:Ts.create(),valueType:e,typeName:xt.ZodRecord,...kt(t)})}}class n0 extends Ht{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.map)return Qe(r,{code:Oe.invalid_type,expected:Ze.map,received:r.parsedType}),Pt;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,l],u)=>({key:i._parse(new uo(r,a,r.path,[u,"key"])),value:s._parse(new uo(r,l,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,f=await l.value;if(u.status==="aborted"||f.status==="aborted")return Pt;(u.status==="dirty"||f.status==="dirty")&&t.dirty(),a.set(u.value,f.value)}return{status:t.value,value:a}})}else{const a=new Map;for(const l of o){const u=l.key,f=l.value;if(u.status==="aborted"||f.status==="aborted")return Pt;(u.status==="dirty"||f.status==="dirty")&&t.dirty(),a.set(u.value,f.value)}return{status:t.value,value:a}}}}n0.create=(n,e,t)=>new n0({valueType:e,keyType:n,typeName:xt.ZodMap,...kt(t)});class _c extends Ht{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.set)return Qe(r,{code:Oe.invalid_type,expected:Ze.set,received:r.parsedType}),Pt;const i=this._def;i.minSize!==null&&r.data.sizei.maxSize.value&&(Qe(r,{code:Oe.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());const s=this._def.valueType;function o(l){const u=new Set;for(const f of l){if(f.status==="aborted")return Pt;f.status==="dirty"&&t.dirty(),u.add(f.value)}return{status:t.value,value:u}}const a=[...r.data.values()].map((l,u)=>s._parse(new uo(r,l,r.path,u)));return r.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(e,t){return new _c({...this._def,minSize:{value:e,message:ht.toString(t)}})}max(e,t){return new _c({...this._def,maxSize:{value:e,message:ht.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}_c.create=(n,e)=>new _c({valueType:n,minSize:null,maxSize:null,typeName:xt.ZodSet,...kt(e)});class ed extends Ht{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ze.function)return Qe(t,{code:Oe.invalid_type,expected:Ze.function,received:t.parsedType}),Pt;function r(a,l){return Qv({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Kv(),Bh].filter(u=>!!u),issueData:{code:Oe.invalid_arguments,argumentsError:l}})}function i(a,l){return Qv({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Kv(),Bh].filter(u=>!!u),issueData:{code:Oe.invalid_return_type,returnTypeError:l}})}const s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Ad){const a=this;return ei(async function(...l){const u=new Cs([]),f=await a._def.args.parseAsync(l,s).catch(m=>{throw u.addIssue(r(l,m)),u}),h=await Reflect.apply(o,this,f);return await a._def.returns._def.type.parseAsync(h,s).catch(m=>{throw u.addIssue(i(h,m)),u})})}else{const a=this;return ei(function(...l){const u=a._def.args.safeParse(l,s);if(!u.success)throw new Cs([r(l,u.error)]);const f=Reflect.apply(o,this,u.data),h=a._def.returns.safeParse(f,s);if(!h.success)throw new Cs([i(f,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ed({...this._def,args:fo.create(e).rest(fc.create())})}returns(e){return new ed({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new ed({args:e||fo.create([]).rest(fc.create()),returns:t||fc.create(),typeName:xt.ZodFunction,...kt(r)})}}class qh extends Ht{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}qh.create=(n,e)=>new qh({getter:n,typeName:xt.ZodLazy,...kt(e)});class Yh extends Ht{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Qe(t,{received:t.data,code:Oe.invalid_literal,expected:this._def.value}),Pt}return{status:"valid",value:e.data}}get value(){return this._def.value}}Yh.create=(n,e)=>new Yh({value:n,typeName:xt.ZodLiteral,...kt(e)});function nL(n,e){return new sl({values:n,typeName:xt.ZodEnum,...kt(e)})}class sl extends Ht{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return Qe(t,{expected:rn.joinValues(r),received:t.parsedType,code:Oe.invalid_type}),Pt}if(this._def.values.indexOf(e.data)===-1){const t=this._getOrReturnCtx(e),r=this._def.values;return Qe(t,{received:t.data,code:Oe.invalid_enum_value,options:r}),Pt}return ei(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return sl.create(e)}exclude(e){return sl.create(this.options.filter(t=>!e.includes(t)))}}sl.create=nL;class Zh extends Ht{_parse(e){const t=rn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Ze.string&&r.parsedType!==Ze.number){const i=rn.objectValues(t);return Qe(r,{expected:rn.joinValues(i),received:r.parsedType,code:Oe.invalid_type}),Pt}if(t.indexOf(e.data)===-1){const i=rn.objectValues(t);return Qe(r,{received:r.data,code:Oe.invalid_enum_value,options:i}),Pt}return ei(e.data)}get enum(){return this._def.values}}Zh.create=(n,e)=>new Zh({values:n,typeName:xt.ZodNativeEnum,...kt(e)});class Ad extends Ht{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ze.promise&&t.common.async===!1)return Qe(t,{code:Oe.invalid_type,expected:Ze.promise,received:t.parsedType}),Pt;const r=t.parsedType===Ze.promise?t.data:Promise.resolve(t.data);return ei(r.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Ad.create=(n,e)=>new Ad({type:n,typeName:xt.ZodPromise,...kt(e)});class Is extends Ht{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{Qe(r,o),o.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:o,path:r.path,parent:r})}if(i.type==="refinement"){const o=a=>{const l=i.refinement(a,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Pt:(a.status==="dirty"&&t.dirty(),o(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Pt:(a.status==="dirty"&&t.dirty(),o(a.value).then(()=>({status:t.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Vh(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Vh(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:t.value,value:a})):o);rn.assertNever(i)}}Is.create=(n,e,t)=>new Is({schema:n,typeName:xt.ZodEffects,effect:e,...kt(t)});Is.createWithPreprocess=(n,e,t)=>new Is({schema:e,effect:{type:"preprocess",transform:n},typeName:xt.ZodEffects,...kt(t)});class Vo extends Ht{_parse(e){return this._getType(e)===Ze.undefined?ei(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Vo.create=(n,e)=>new Vo({innerType:n,typeName:xt.ZodOptional,...kt(e)});class Sc extends Ht{_parse(e){return this._getType(e)===Ze.null?ei(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Sc.create=(n,e)=>new Sc({innerType:n,typeName:xt.ZodNullable,...kt(e)});class Kh extends Ht{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===Ze.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Kh.create=(n,e)=>new Kh({innerType:n,typeName:xt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...kt(e)});class r0 extends Ht{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Jv(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Cs(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Cs(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}r0.create=(n,e)=>new r0({innerType:n,typeName:xt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...kt(e)});class i0 extends Ht{_parse(e){if(this._getType(e)!==Ze.nan){const r=this._getOrReturnCtx(e);return Qe(r,{code:Oe.invalid_type,expected:Ze.nan,received:r.parsedType}),Pt}return{status:"valid",value:e.data}}}i0.create=n=>new i0({typeName:xt.ZodNaN,...kt(n)});const _$=Symbol("zod_brand");class rL extends Ht{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class Xp extends Ht{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Pt:s.status==="dirty"?(t.dirty(),tL(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Pt:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,t){return new Xp({in:e,out:t,typeName:xt.ZodPipeline})}}class s0 extends Ht{_parse(e){const t=this._def.innerType._parse(e);return Vh(t)&&(t.value=Object.freeze(t.value)),t}}s0.create=(n,e)=>new s0({innerType:n,typeName:xt.ZodReadonly,...kt(e)});const iL=(n,e={},t)=>n?Cd.create().superRefine((r,i)=>{var s,o;if(!n(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,l=(o=(s=a.fatal)!==null&&s!==void 0?s:t)!==null&&o!==void 0?o:!0,u=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...u,fatal:l})}}):Cd.create(),S$={object:Cn.lazycreate};var xt;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(xt||(xt={}));const w$=(n,e={message:`Input not instance of ${n.name}`})=>iL(t=>t instanceof n,e),sL=Ts.create,oL=rl.create,E$=i0.create,M$=il.create,aL=Hh.create,b$=xc.create,T$=e0.create,C$=$h.create,A$=Wh.create,R$=Cd.create,P$=fc.create,I$=jo.create,L$=t0.create,D$=As.create,N$=Cn.create,O$=Cn.strictCreate,k$=Gh.create,U$=wy.create,F$=jh.create,z$=fo.create,B$=Xh.create,V$=n0.create,H$=_c.create,$$=ed.create,W$=qh.create,G$=Yh.create,j$=sl.create,X$=Zh.create,q$=Ad.create,XA=Is.create,Y$=Vo.create,Z$=Sc.create,K$=Is.createWithPreprocess,Q$=Xp.create,J$=()=>sL().optional(),e7=()=>oL().optional(),t7=()=>aL().optional(),n7={string:n=>Ts.create({...n,coerce:!0}),number:n=>rl.create({...n,coerce:!0}),boolean:n=>Hh.create({...n,coerce:!0}),bigint:n=>il.create({...n,coerce:!0}),date:n=>xc.create({...n,coerce:!0})},r7=Pt;var ui=Object.freeze({__proto__:null,defaultErrorMap:Bh,setErrorMap:a$,getErrorMap:Kv,makeIssue:Qv,EMPTY_PATH:l$,addIssueToContext:Qe,ParseStatus:Hr,INVALID:Pt,DIRTY:tL,OK:ei,isAborted:R1,isDirty:P1,isValid:Vh,isAsync:Jv,get util(){return rn},get objectUtil(){return A1},ZodParsedType:Ze,getParsedType:Pa,ZodType:Ht,ZodString:Ts,ZodNumber:rl,ZodBigInt:il,ZodBoolean:Hh,ZodDate:xc,ZodSymbol:e0,ZodUndefined:$h,ZodNull:Wh,ZodAny:Cd,ZodUnknown:fc,ZodNever:jo,ZodVoid:t0,ZodArray:As,ZodObject:Cn,ZodUnion:Gh,ZodDiscriminatedUnion:wy,ZodIntersection:jh,ZodTuple:fo,ZodRecord:Xh,ZodMap:n0,ZodSet:_c,ZodFunction:ed,ZodLazy:qh,ZodLiteral:Yh,ZodEnum:sl,ZodNativeEnum:Zh,ZodPromise:Ad,ZodEffects:Is,ZodTransformer:Is,ZodOptional:Vo,ZodNullable:Sc,ZodDefault:Kh,ZodCatch:r0,ZodNaN:i0,BRAND:_$,ZodBranded:rL,ZodPipeline:Xp,ZodReadonly:s0,custom:iL,Schema:Ht,ZodSchema:Ht,late:S$,get ZodFirstPartyTypeKind(){return xt},coerce:n7,any:R$,array:D$,bigint:M$,boolean:aL,date:b$,discriminatedUnion:U$,effect:XA,enum:j$,function:$$,instanceof:w$,intersection:F$,lazy:W$,literal:G$,map:V$,nan:E$,nativeEnum:X$,never:I$,null:A$,nullable:Z$,number:oL,object:N$,oboolean:t7,onumber:e7,optional:Y$,ostring:J$,pipeline:Q$,preprocess:K$,promise:q$,record:B$,set:H$,strictObject:O$,string:sL,symbol:T$,transformer:XA,tuple:z$,undefined:C$,union:k$,unknown:P$,void:L$,NEVER:r7,ZodIssueCode:Oe,quotelessJson:o$,ZodError:Cs}),i7=async(...n)=>{const e=await fetch(...n);if(!e.ok)throw new Error(`Request failed with status ${e.status}`);return e.json()};function s7(n=i7){return async(e,...t)=>{const r=await n(...t);return e.parse(r)}}const lL=ui.object({avatar_url:ui.string().nullable(),id:ui.number(),username:ui.string(),track_count:ui.number().optional().nullable()}),o7=ui.object({id:ui.number(),title:ui.string(),artwork_url:ui.string().nullable(),playback_count:ui.number().nullable(),user:lL.optional()}),KE="https://soundcloud-api-proxy.fly.dev/proxy",QE=s7(),a7=async({query:n,limit:e=5})=>{const t=`${KE}/users?${new URLSearchParams({q:n,limit:e.toString()}).toString()}`;return await QE(ui.array(lL),t,{method:"GET"})},l7=async({userId:n,limit:e=50})=>{const t=`${KE}/users/${n}/tracks?${new URLSearchParams({access:"playable",limit:e.toString()}).toString()}`;return(await QE(ui.array(o7),t,{method:"GET"})).sort((i,s)=>(s.playback_count??Number.POSITIVE_INFINITY)-(i.playback_count??Number.POSITIVE_INFINITY))},c7=async n=>{const{http_mp3_128_url:e}=await QE(ui.object({http_mp3_128_url:ui.string()}),`${KE}/tracks/${n}/streams`,{method:"GET"});return e};function cL(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;en&&(e=0,r=t,t=new Map)}return{get:function(o){var a=t.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set:function(o,a){t.has(o)?t.set(o,a):i(o,a)}}}var fL="!";function y7(n){var e=n.separator||":",t=e.length===1,r=e[0],i=e.length;return function(o){for(var a=[],l=0,u=0,f,h=0;hu?f-u:void 0;return{modifiers:a,hasImportantModifier:v,baseClassName:w,maybePostfixModifierPosition:x}}}function x7(n){if(n.length<=1)return n;var e=[],t=[];return n.forEach(function(r){var i=r[0]==="[";i?(e.push.apply(e,t.sort().concat([r])),t=[]):t.push(r)}),e.push.apply(e,t.sort()),e}function _7(n){return{cache:v7(n.cacheSize),splitModifiers:y7(n),...f7(n)}}var S7=/\s+/;function w7(n,e){var t=e.splitModifiers,r=e.getClassGroupId,i=e.getConflictingClassGroupIds,s=new Set;return n.trim().split(S7).map(function(o){var a=t(o),l=a.modifiers,u=a.hasImportantModifier,f=a.baseClassName,h=a.maybePostfixModifierPosition,p=r(h?f.substring(0,h):f),m=!!h;if(!p){if(!h)return{isTailwindClass:!1,originalClassName:o};if(p=r(f),!p)return{isTailwindClass:!1,originalClassName:o};m=!1}var v=x7(l).join(":"),w=u?v+fL:v;return{isTailwindClass:!0,modifierId:w,classGroupId:p,originalClassName:o,hasPostfixModifier:m}}).reverse().filter(function(o){if(!o.isTailwindClass)return!0;var a=o.modifierId,l=o.classGroupId,u=o.hasPostfixModifier,f=a+l;return s.has(f)?!1:(s.add(f),i(l,u).forEach(function(h){return s.add(a+h)}),!0)}).reverse().map(function(o){return o.originalClassName}).join(" ")}function E7(){for(var n=arguments.length,e=new Array(n),t=0;t{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Rd=typeof window>"u"||"Deno"in window;function ts(){}function z7(n,e){return typeof n=="function"?n(e):n}function N1(n){return typeof n=="number"&&n>=0&&n!==1/0}function mL(n,e){return Math.max(n+(e||0)-Date.now(),0)}function KA(n,e){const{type:t="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=n;if(o){if(r){if(e.queryHash!==eM(o,e.options))return!1}else if(!Jh(e.queryKey,o))return!1}if(t!=="all"){const l=e.isActive();if(t==="active"&&!l||t==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||typeof i<"u"&&i!==e.state.fetchStatus||s&&!s(e))}function QA(n,e){const{exact:t,status:r,predicate:i,mutationKey:s}=n;if(s){if(!e.options.mutationKey)return!1;if(t){if(Qh(e.options.mutationKey)!==Qh(s))return!1}else if(!Jh(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function eM(n,e){return((e==null?void 0:e.queryKeyHashFn)||Qh)(n)}function Qh(n){return JSON.stringify(n,(e,t)=>k1(t)?Object.keys(t).sort().reduce((r,i)=>(r[i]=t[i],r),{}):t)}function Jh(n,e){return n===e?!0:typeof n!=typeof e?!1:n&&e&&typeof n=="object"&&typeof e=="object"?!Object.keys(e).some(t=>!Jh(n[t],e[t])):!1}function gL(n,e){if(n===e)return n;const t=JA(n)&&JA(e);if(t||k1(n)&&k1(e)){const r=t?n:Object.keys(n),i=r.length,s=t?e:Object.keys(e),o=s.length,a=t?[]:{};let l=0;for(let u=0;u"u")return!0;const t=e.prototype;return!(!e2(t)||!t.hasOwnProperty("isPrototypeOf"))}function e2(n){return Object.prototype.toString.call(n)==="[object Object]"}function B7(n){return new Promise(e=>{setTimeout(e,n)})}function U1(n,e,t){return typeof t.structuralSharing=="function"?t.structuralSharing(n,e):t.structuralSharing!==!1?gL(n,e):e}function V7(n,e,t=0){const r=[...n,e];return t&&r.length>t?r.slice(1):r}function H7(n,e,t=0){const r=[e,...n];return t&&r.length>t?r.slice(0,-1):r}var Jl,Da,ld,dP,$7=(dP=class extends qp{constructor(){super();ct(this,Jl,void 0);ct(this,Da,void 0);ct(this,ld,void 0);Ye(this,ld,e=>{if(!Rd&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){ee(this,Da)||this.setEventListener(ee(this,ld))}onUnsubscribe(){var e;this.hasListeners()||((e=ee(this,Da))==null||e.call(this),Ye(this,Da,void 0))}setEventListener(e){var t;Ye(this,ld,e),(t=ee(this,Da))==null||t.call(this),Ye(this,Da,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){ee(this,Jl)!==e&&(Ye(this,Jl,e),this.onFocus())}onFocus(){this.listeners.forEach(e=>{e()})}isFocused(){var e;return typeof ee(this,Jl)=="boolean"?ee(this,Jl):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Jl=new WeakMap,Da=new WeakMap,ld=new WeakMap,dP),o0=new $7,cd,Na,ud,fP,W7=(fP=class extends qp{constructor(){super();ct(this,cd,!0);ct(this,Na,void 0);ct(this,ud,void 0);Ye(this,ud,e=>{if(!Rd&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){ee(this,Na)||this.setEventListener(ee(this,ud))}onUnsubscribe(){var e;this.hasListeners()||((e=ee(this,Na))==null||e.call(this),Ye(this,Na,void 0))}setEventListener(e){var t;Ye(this,ud,e),(t=ee(this,Na))==null||t.call(this),Ye(this,Na,e(this.setOnline.bind(this)))}setOnline(e){ee(this,cd)!==e&&(Ye(this,cd,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return ee(this,cd)}},cd=new WeakMap,Na=new WeakMap,ud=new WeakMap,fP),a0=new W7;function G7(n){return Math.min(1e3*2**n,3e4)}function Ey(n){return(n??"online")==="online"?a0.isOnline():!0}var vL=class{constructor(n){this.revert=n==null?void 0:n.revert,this.silent=n==null?void 0:n.silent}};function W_(n){return n instanceof vL}function yL(n){let e=!1,t=0,r=!1,i,s,o;const a=new Promise((x,g)=>{s=x,o=g}),l=x=>{var g;r||(m(new vL(x)),(g=n.abort)==null||g.call(n))},u=()=>{e=!0},f=()=>{e=!1},h=()=>!o0.isFocused()||n.networkMode!=="always"&&!a0.isOnline(),p=x=>{var g;r||(r=!0,(g=n.onSuccess)==null||g.call(n,x),i==null||i(),s(x))},m=x=>{var g;r||(r=!0,(g=n.onError)==null||g.call(n,x),i==null||i(),o(x))},v=()=>new Promise(x=>{var g;i=S=>{const _=r||!h();return _&&x(S),_},(g=n.onPause)==null||g.call(n)}).then(()=>{var x;i=void 0,r||(x=n.onContinue)==null||x.call(n)}),w=()=>{if(r)return;let x;try{x=n.fn()}catch(g){x=Promise.reject(g)}Promise.resolve(x).then(p).catch(g=>{var R;if(r)return;const S=n.retry??(Rd?0:3),_=n.retryDelay??G7,b=typeof _=="function"?_(t,g):_,A=S===!0||typeof S=="number"&&t{if(h())return v()}).then(()=>{e?m(g):w()})})};return Ey(n.networkMode)?w():v().then(w),{promise:a,cancel:l,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:u,continueRetry:f}}function j7(){let n=[],e=0,t=p=>{p()},r=p=>{p()},i=p=>setTimeout(p,0);const s=p=>{i=p},o=p=>{let m;e++;try{m=p()}finally{e--,e||u()}return m},a=p=>{e?n.push(p):i(()=>{t(p)})},l=p=>(...m)=>{a(()=>{p(...m)})},u=()=>{const p=n;n=[],p.length&&i(()=>{r(()=>{p.forEach(m=>{t(m)})})})};return{batch:o,batchCalls:l,schedule:a,setNotifyFunction:p=>{t=p},setBatchNotifyFunction:p=>{r=p},setScheduler:s}}var Sr=j7(),ec,hP,xL=(hP=class{constructor(){ct(this,ec,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),N1(this.gcTime)&&Ye(this,ec,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(Rd?1/0:5*60*1e3))}clearGcTimeout(){ee(this,ec)&&(clearTimeout(ee(this,ec)),Ye(this,ec,void 0))}},ec=new WeakMap,hP),dd,fd,Qi,Oa,Ji,fr,Sp,tc,hd,Rv,ws,Ao,pP,X7=(pP=class extends xL{constructor(e){super();ct(this,hd);ct(this,ws);ct(this,dd,void 0);ct(this,fd,void 0);ct(this,Qi,void 0);ct(this,Oa,void 0);ct(this,Ji,void 0);ct(this,fr,void 0);ct(this,Sp,void 0);ct(this,tc,void 0);Ye(this,tc,!1),Ye(this,Sp,e.defaultOptions),Gt(this,hd,Rv).call(this,e.options),Ye(this,fr,[]),Ye(this,Qi,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Ye(this,dd,e.state||q7(this.options)),this.state=ee(this,dd),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!ee(this,fr).length&&this.state.fetchStatus==="idle"&&ee(this,Qi).remove(this)}setData(e,t){const r=U1(this.state.data,e,this.options);return Gt(this,ws,Ao).call(this,{data:r,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),r}setState(e,t){Gt(this,ws,Ao).call(this,{type:"setState",state:e,setStateOptions:t})}cancel(e){var r;const t=ee(this,Oa);return(r=ee(this,Ji))==null||r.cancel(e),t?t.then(ts).catch(ts):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ee(this,dd))}isActive(){return ee(this,fr).some(e=>e.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||ee(this,fr).some(e=>e.getCurrentResult().isStale)}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!mL(this.state.dataUpdatedAt,e)}onFocus(){var t;const e=ee(this,fr).find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(t=ee(this,Ji))==null||t.continue()}onOnline(){var t;const e=ee(this,fr).find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(t=ee(this,Ji))==null||t.continue()}addObserver(e){ee(this,fr).includes(e)||(ee(this,fr).push(e),this.clearGcTimeout(),ee(this,Qi).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){ee(this,fr).includes(e)&&(Ye(this,fr,ee(this,fr).filter(t=>t!==e)),ee(this,fr).length||(ee(this,Ji)&&(ee(this,tc)?ee(this,Ji).cancel({revert:!0}):ee(this,Ji).cancelRetry()),this.scheduleGc()),ee(this,Qi).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return ee(this,fr).length}invalidate(){this.state.isInvalidated||Gt(this,ws,Ao).call(this,{type:"invalidate"})}fetch(e,t){var u,f,h,p;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(ee(this,Oa))return(u=ee(this,Ji))==null||u.continueRetry(),ee(this,Oa)}if(e&&Gt(this,hd,Rv).call(this,e),!this.options.queryFn){const m=ee(this,fr).find(v=>v.options.queryFn);m&&Gt(this,hd,Rv).call(this,m.options)}const r=new AbortController,i={queryKey:this.queryKey,meta:this.meta},s=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(Ye(this,tc,!0),r.signal)})};s(i);const o=()=>this.options.queryFn?(Ye(this,tc,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};s(a),(f=this.options.behavior)==null||f.onFetch(a,this),Ye(this,fd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=a.fetchOptions)==null?void 0:h.meta))&&Gt(this,ws,Ao).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const l=m=>{var v,w,x,g;W_(m)&&m.silent||Gt(this,ws,Ao).call(this,{type:"error",error:m}),W_(m)||((w=(v=ee(this,Qi).config).onError)==null||w.call(v,m,this),(g=(x=ee(this,Qi).config).onSettled)==null||g.call(x,this.state.data,m,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ye(this,Ji,yL({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:m=>{var v,w,x,g;if(typeof m>"u"){l(new Error(`${this.queryHash} data is undefined`));return}this.setData(m),(w=(v=ee(this,Qi).config).onSuccess)==null||w.call(v,m,this),(g=(x=ee(this,Qi).config).onSettled)==null||g.call(x,m,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(m,v)=>{Gt(this,ws,Ao).call(this,{type:"failed",failureCount:m,error:v})},onPause:()=>{Gt(this,ws,Ao).call(this,{type:"pause"})},onContinue:()=>{Gt(this,ws,Ao).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ye(this,Oa,ee(this,Ji).promise),ee(this,Oa)}},dd=new WeakMap,fd=new WeakMap,Qi=new WeakMap,Oa=new WeakMap,Ji=new WeakMap,fr=new WeakMap,Sp=new WeakMap,tc=new WeakMap,hd=new WeakSet,Rv=function(e){this.options={...ee(this,Sp),...e},this.updateGcTime(this.options.gcTime)},ws=new WeakSet,Ao=function(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:e.meta??null,fetchStatus:Ey(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return W_(i)&&i.revert&&ee(this,fd)?{...ee(this,fd),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),Sr.batch(()=>{ee(this,fr).forEach(r=>{r.onQueryUpdate()}),ee(this,Qi).notify({query:this,type:"updated",action:e})})},pP);function q7(n){const e=typeof n.initialData=="function"?n.initialData():n.initialData,t=typeof e<"u",r=t?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:t?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var qs,mP,Y7=(mP=class extends qp{constructor(e={}){super();ct(this,qs,void 0);this.config=e,Ye(this,qs,new Map)}build(e,t,r){const i=t.queryKey,s=t.queryHash??eM(i,t);let o=this.get(s);return o||(o=new X7({cache:this,queryKey:i,queryHash:s,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){ee(this,qs).has(e.queryHash)||(ee(this,qs).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=ee(this,qs).get(e.queryHash);t&&(e.destroy(),t===e&&ee(this,qs).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Sr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return ee(this,qs).get(e)}getAll(){return[...ee(this,qs).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>KA(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>KA(e,r)):t}notify(e){Sr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Sr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Sr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},qs=new WeakMap,mP),Ys,wp,bi,pd,Zs,Ma,gP,Z7=(gP=class extends xL{constructor(e){super();ct(this,Zs);ct(this,Ys,void 0);ct(this,wp,void 0);ct(this,bi,void 0);ct(this,pd,void 0);this.mutationId=e.mutationId,Ye(this,wp,e.defaultOptions),Ye(this,bi,e.mutationCache),Ye(this,Ys,[]),this.state=e.state||K7(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...ee(this,wp),...e},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){ee(this,Ys).includes(e)||(ee(this,Ys).push(e),this.clearGcTimeout(),ee(this,bi).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Ye(this,Ys,ee(this,Ys).filter(t=>t!==e)),this.scheduleGc(),ee(this,bi).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){ee(this,Ys).length||(this.state.status==="pending"?this.scheduleGc():ee(this,bi).remove(this))}continue(){var e;return((e=ee(this,pd))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,s,o,a,l,u,f,h,p,m,v,w,x,g,S,_,b,A,R,P;const t=()=>(Ye(this,pd,yL({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(D,V)=>{Gt(this,Zs,Ma).call(this,{type:"failed",failureCount:D,error:V})},onPause:()=>{Gt(this,Zs,Ma).call(this,{type:"pause"})},onContinue:()=>{Gt(this,Zs,Ma).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),ee(this,pd).promise),r=this.state.status==="pending";try{if(!r){Gt(this,Zs,Ma).call(this,{type:"pending",variables:e}),await((s=(i=ee(this,bi).config).onMutate)==null?void 0:s.call(i,e,this));const V=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e));V!==this.state.context&&Gt(this,Zs,Ma).call(this,{type:"pending",context:V,variables:e})}const D=await t();return await((u=(l=ee(this,bi).config).onSuccess)==null?void 0:u.call(l,D,e,this.state.context,this)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,D,e,this.state.context)),await((m=(p=ee(this,bi).config).onSettled)==null?void 0:m.call(p,D,null,this.state.variables,this.state.context,this)),await((w=(v=this.options).onSettled)==null?void 0:w.call(v,D,null,e,this.state.context)),Gt(this,Zs,Ma).call(this,{type:"success",data:D}),D}catch(D){try{throw await((g=(x=ee(this,bi).config).onError)==null?void 0:g.call(x,D,e,this.state.context,this)),await((_=(S=this.options).onError)==null?void 0:_.call(S,D,e,this.state.context)),await((A=(b=ee(this,bi).config).onSettled)==null?void 0:A.call(b,void 0,D,this.state.variables,this.state.context,this)),await((P=(R=this.options).onSettled)==null?void 0:P.call(R,void 0,D,e,this.state.context)),D}finally{Gt(this,Zs,Ma).call(this,{type:"error",error:D})}}}},Ys=new WeakMap,wp=new WeakMap,bi=new WeakMap,pd=new WeakMap,Zs=new WeakSet,Ma=function(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Ey(this.options.networkMode),status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Sr.batch(()=>{ee(this,Ys).forEach(r=>{r.onMutationUpdate(e)}),ee(this,bi).notify({mutation:this,type:"updated",action:e})})},gP);function K7(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var es,Ep,nc,vP,Q7=(vP=class extends qp{constructor(e={}){super();ct(this,es,void 0);ct(this,Ep,void 0);ct(this,nc,void 0);this.config=e,Ye(this,es,[]),Ye(this,Ep,0)}build(e,t,r){const i=new Z7({mutationCache:this,mutationId:++Qm(this,Ep)._,options:e.defaultMutationOptions(t),state:r});return this.add(i),i}add(e){ee(this,es).push(e),this.notify({type:"added",mutation:e})}remove(e){Ye(this,es,ee(this,es).filter(t=>t!==e)),this.notify({type:"removed",mutation:e})}clear(){Sr.batch(()=>{ee(this,es).forEach(e=>{this.remove(e)})})}getAll(){return ee(this,es)}find(e){const t={exact:!0,...e};return ee(this,es).find(r=>QA(t,r))}findAll(e={}){return ee(this,es).filter(t=>QA(e,t))}notify(e){Sr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){return Ye(this,nc,(ee(this,nc)??Promise.resolve()).then(()=>{const e=ee(this,es).filter(t=>t.state.isPaused);return Sr.batch(()=>e.reduce((t,r)=>t.then(()=>r.continue().catch(ts)),Promise.resolve()))}).then(()=>{Ye(this,nc,void 0)})),ee(this,nc)}},es=new WeakMap,Ep=new WeakMap,nc=new WeakMap,vP);function J7(n){return{onFetch:(e,t)=>{const r=async()=>{var v,w,x,g,S;const i=e.options,s=(x=(w=(v=e.fetchOptions)==null?void 0:v.meta)==null?void 0:w.fetchMore)==null?void 0:x.direction,o=((g=e.state.data)==null?void 0:g.pages)||[],a=((S=e.state.data)==null?void 0:S.pageParams)||[],l={pages:[],pageParams:[]};let u=!1;const f=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(e.signal.aborted?u=!0:e.signal.addEventListener("abort",()=>{u=!0}),e.signal)})},h=e.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${e.options.queryHash}'`))),p=async(_,b,A)=>{if(u)return Promise.reject();if(b==null&&_.pages.length)return Promise.resolve(_);const R={queryKey:e.queryKey,pageParam:b,direction:A?"backward":"forward",meta:e.options.meta};f(R);const P=await h(R),{maxPages:D}=e.options,V=A?H7:V7;return{pages:V(_.pages,P,D),pageParams:V(_.pageParams,b,D)}};let m;if(s&&o.length){const _=s==="backward",b=_?eW:t2,A={pages:o,pageParams:a},R=b(i,A);m=await p(A,R,_)}else{m=await p(l,a[0]??i.initialPageParam);const _=n??o.length;for(let b=1;b<_;b++){const A=t2(i,m);m=await p(m,A)}}return m};e.options.persister?e.fetchFn=()=>{var i,s;return(s=(i=e.options).persister)==null?void 0:s.call(i,r,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},t)}:e.fetchFn=r}}}function t2(n,{pages:e,pageParams:t}){const r=e.length-1;return n.getNextPageParam(e[r],e,t[r],t)}function eW(n,{pages:e,pageParams:t}){var r;return(r=n.getPreviousPageParam)==null?void 0:r.call(n,e[0],e,t[0],t)}var tr,ka,Ua,md,gd,Fa,vd,yd,yP,tW=(yP=class{constructor(n={}){ct(this,tr,void 0);ct(this,ka,void 0);ct(this,Ua,void 0);ct(this,md,void 0);ct(this,gd,void 0);ct(this,Fa,void 0);ct(this,vd,void 0);ct(this,yd,void 0);Ye(this,tr,n.queryCache||new Y7),Ye(this,ka,n.mutationCache||new Q7),Ye(this,Ua,n.defaultOptions||{}),Ye(this,md,new Map),Ye(this,gd,new Map),Ye(this,Fa,0)}mount(){Qm(this,Fa)._++,ee(this,Fa)===1&&(Ye(this,vd,o0.subscribe(()=>{o0.isFocused()&&(this.resumePausedMutations(),ee(this,tr).onFocus())})),Ye(this,yd,a0.subscribe(()=>{a0.isOnline()&&(this.resumePausedMutations(),ee(this,tr).onOnline())})))}unmount(){var n,e;Qm(this,Fa)._--,ee(this,Fa)===0&&((n=ee(this,vd))==null||n.call(this),Ye(this,vd,void 0),(e=ee(this,yd))==null||e.call(this),Ye(this,yd,void 0))}isFetching(n){return ee(this,tr).findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return ee(this,ka).findAll({...n,status:"pending"}).length}getQueryData(n){var e;return(e=ee(this,tr).find({queryKey:n}))==null?void 0:e.state.data}ensureQueryData(n){const e=this.getQueryData(n.queryKey);return e!==void 0?Promise.resolve(e):this.fetchQuery(n)}getQueriesData(n){return this.getQueryCache().findAll(n).map(({queryKey:e,state:t})=>{const r=t.data;return[e,r]})}setQueryData(n,e,t){const r=ee(this,tr).find({queryKey:n}),i=r==null?void 0:r.state.data,s=z7(e,i);if(typeof s>"u")return;const o=this.defaultQueryOptions({queryKey:n});return ee(this,tr).build(this,o).setData(s,{...t,manual:!0})}setQueriesData(n,e,t){return Sr.batch(()=>this.getQueryCache().findAll(n).map(({queryKey:r})=>[r,this.setQueryData(r,e,t)]))}getQueryState(n){var e;return(e=ee(this,tr).find({queryKey:n}))==null?void 0:e.state}removeQueries(n){const e=ee(this,tr);Sr.batch(()=>{e.findAll(n).forEach(t=>{e.remove(t)})})}resetQueries(n,e){const t=ee(this,tr),r={type:"active",...n};return Sr.batch(()=>(t.findAll(n).forEach(i=>{i.reset()}),this.refetchQueries(r,e)))}cancelQueries(n={},e={}){const t={revert:!0,...e},r=Sr.batch(()=>ee(this,tr).findAll(n).map(i=>i.cancel(t)));return Promise.all(r).then(ts).catch(ts)}invalidateQueries(n={},e={}){return Sr.batch(()=>{if(ee(this,tr).findAll(n).forEach(r=>{r.invalidate()}),n.refetchType==="none")return Promise.resolve();const t={...n,type:n.refetchType??n.type??"active"};return this.refetchQueries(t,e)})}refetchQueries(n={},e){const t={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},r=Sr.batch(()=>ee(this,tr).findAll(n).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,t);return t.throwOnError||(s=s.catch(ts)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(ts)}fetchQuery(n){const e=this.defaultQueryOptions(n);typeof e.retry>"u"&&(e.retry=!1);const t=ee(this,tr).build(this,e);return t.isStaleByTime(e.staleTime)?t.fetch(e):Promise.resolve(t.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(ts).catch(ts)}fetchInfiniteQuery(n){return n.behavior=J7(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(ts).catch(ts)}resumePausedMutations(){return ee(this,ka).resumePausedMutations()}getQueryCache(){return ee(this,tr)}getMutationCache(){return ee(this,ka)}getDefaultOptions(){return ee(this,Ua)}setDefaultOptions(n){Ye(this,Ua,n)}setQueryDefaults(n,e){ee(this,md).set(Qh(n),{queryKey:n,defaultOptions:e})}getQueryDefaults(n){const e=[...ee(this,md).values()];let t={};return e.forEach(r=>{Jh(n,r.queryKey)&&(t={...t,...r.defaultOptions})}),t}setMutationDefaults(n,e){ee(this,gd).set(Qh(n),{mutationKey:n,defaultOptions:e})}getMutationDefaults(n){const e=[...ee(this,gd).values()];let t={};return e.forEach(r=>{Jh(n,r.mutationKey)&&(t={...t,...r.defaultOptions})}),t}defaultQueryOptions(n){if(n!=null&&n._defaulted)return n;const e={...ee(this,Ua).queries,...(n==null?void 0:n.queryKey)&&this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return e.queryHash||(e.queryHash=eM(e.queryKey,e)),typeof e.refetchOnReconnect>"u"&&(e.refetchOnReconnect=e.networkMode!=="always"),typeof e.throwOnError>"u"&&(e.throwOnError=!!e.suspense),typeof e.networkMode>"u"&&e.persister&&(e.networkMode="offlineFirst"),e}defaultMutationOptions(n){return n!=null&&n._defaulted?n:{...ee(this,Ua).mutations,...(n==null?void 0:n.mutationKey)&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){ee(this,tr).clear(),ee(this,ka).clear()}},tr=new WeakMap,ka=new WeakMap,Ua=new WeakMap,md=new WeakMap,gd=new WeakMap,Fa=new WeakMap,vd=new WeakMap,yd=new WeakMap,yP),li,xn,Mp,qr,rc,xd,Ks,bp,_d,Sd,ic,sc,za,wd,oc,Zf,Tp,F1,Cp,z1,Ap,B1,Rp,V1,Pp,H1,Ip,$1,Lp,W1,W0,_L,xP,nW=(xP=class extends qp{constructor(e,t){super();ct(this,oc);ct(this,Tp);ct(this,Cp);ct(this,Ap);ct(this,Rp);ct(this,Pp);ct(this,Ip);ct(this,Lp);ct(this,W0);ct(this,li,void 0);ct(this,xn,void 0);ct(this,Mp,void 0);ct(this,qr,void 0);ct(this,rc,void 0);ct(this,xd,void 0);ct(this,Ks,void 0);ct(this,bp,void 0);ct(this,_d,void 0);ct(this,Sd,void 0);ct(this,ic,void 0);ct(this,sc,void 0);ct(this,za,void 0);ct(this,wd,new Set);this.options=t,Ye(this,li,e),Ye(this,Ks,null),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ee(this,xn).addObserver(this),n2(ee(this,xn),this.options)?Gt(this,oc,Zf).call(this):this.updateResult(),Gt(this,Rp,V1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return G1(ee(this,xn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return G1(ee(this,xn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Gt(this,Pp,H1).call(this),Gt(this,Ip,$1).call(this),ee(this,xn).removeObserver(this)}setOptions(e,t){const r=this.options,i=ee(this,xn);if(this.options=ee(this,li).defaultQueryOptions(e),O1(r,this.options)||ee(this,li).getQueryCache().notify({type:"observerOptionsUpdated",query:ee(this,xn),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),Gt(this,Lp,W1).call(this);const s=this.hasListeners();s&&r2(ee(this,xn),i,this.options,r)&&Gt(this,oc,Zf).call(this),this.updateResult(t),s&&(ee(this,xn)!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Gt(this,Tp,F1).call(this);const o=Gt(this,Cp,z1).call(this);s&&(ee(this,xn)!==i||this.options.enabled!==r.enabled||o!==ee(this,za))&&Gt(this,Ap,B1).call(this,o)}getOptimisticResult(e){const t=ee(this,li).getQueryCache().build(ee(this,li),e),r=this.createResult(t,e);return iW(this,r)&&(Ye(this,qr,r),Ye(this,xd,this.options),Ye(this,rc,ee(this,xn).state)),r}getCurrentResult(){return ee(this,qr)}trackResult(e){const t={};return Object.keys(e).forEach(r=>{Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:()=>(ee(this,wd).add(r),e[r])})}),t}getCurrentQuery(){return ee(this,xn)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=ee(this,li).defaultQueryOptions(e),r=ee(this,li).getQueryCache().build(ee(this,li),t);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,t))}fetch(e){return Gt(this,oc,Zf).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),ee(this,qr)))}createResult(e,t){var R;const r=ee(this,xn),i=this.options,s=ee(this,qr),o=ee(this,rc),a=ee(this,xd),u=e!==r?e.state:ee(this,Mp),{state:f}=e;let{error:h,errorUpdatedAt:p,fetchStatus:m,status:v}=f,w=!1,x;if(t._optimisticResults){const P=this.hasListeners(),D=!P&&n2(e,t),V=P&&r2(e,r,t,i);(D||V)&&(m=Ey(e.options.networkMode)?"fetching":"paused",f.dataUpdatedAt||(v="pending")),t._optimisticResults==="isRestoring"&&(m="idle")}if(t.select&&typeof f.data<"u")if(s&&f.data===(o==null?void 0:o.data)&&t.select===ee(this,bp))x=ee(this,_d);else try{Ye(this,bp,t.select),x=t.select(f.data),x=U1(s==null?void 0:s.data,x,t),Ye(this,_d,x),Ye(this,Ks,null)}catch(P){Ye(this,Ks,P)}else x=f.data;if(typeof t.placeholderData<"u"&&typeof x>"u"&&v==="pending"){let P;if(s!=null&&s.isPlaceholderData&&t.placeholderData===(a==null?void 0:a.placeholderData))P=s.data;else if(P=typeof t.placeholderData=="function"?t.placeholderData((R=ee(this,Sd))==null?void 0:R.state.data,ee(this,Sd)):t.placeholderData,t.select&&typeof P<"u")try{P=t.select(P),Ye(this,Ks,null)}catch(D){Ye(this,Ks,D)}typeof P<"u"&&(v="success",x=U1(s==null?void 0:s.data,P,t),w=!0)}ee(this,Ks)&&(h=ee(this,Ks),x=ee(this,_d),p=Date.now(),v="error");const g=m==="fetching",S=v==="pending",_=v==="error",b=S&&g;return{status:v,fetchStatus:m,isPending:S,isSuccess:v==="success",isError:_,isInitialLoading:b,isLoading:b,data:x,dataUpdatedAt:f.dataUpdatedAt,error:h,errorUpdatedAt:p,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:g,isRefetching:g&&!S,isLoadingError:_&&f.dataUpdatedAt===0,isPaused:m==="paused",isPlaceholderData:w,isRefetchError:_&&f.dataUpdatedAt!==0,isStale:tM(e,t),refetch:this.refetch}}updateResult(e){const t=ee(this,qr),r=this.createResult(ee(this,xn),this.options);if(Ye(this,rc,ee(this,xn).state),Ye(this,xd,this.options),ee(this,rc).data!==void 0&&Ye(this,Sd,ee(this,xn)),O1(r,t))return;Ye(this,qr,r);const i={},s=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!ee(this,wd).size)return!0;const l=new Set(a??ee(this,wd));return this.options.throwOnError&&l.add("error"),Object.keys(ee(this,qr)).some(u=>{const f=u;return ee(this,qr)[f]!==t[f]&&l.has(f)})};(e==null?void 0:e.listeners)!==!1&&s()&&(i.listeners=!0),Gt(this,W0,_L).call(this,{...i,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Gt(this,Rp,V1).call(this)}},li=new WeakMap,xn=new WeakMap,Mp=new WeakMap,qr=new WeakMap,rc=new WeakMap,xd=new WeakMap,Ks=new WeakMap,bp=new WeakMap,_d=new WeakMap,Sd=new WeakMap,ic=new WeakMap,sc=new WeakMap,za=new WeakMap,wd=new WeakMap,oc=new WeakSet,Zf=function(e){Gt(this,Lp,W1).call(this);let t=ee(this,xn).fetch(this.options,e);return e!=null&&e.throwOnError||(t=t.catch(ts)),t},Tp=new WeakSet,F1=function(){if(Gt(this,Pp,H1).call(this),Rd||ee(this,qr).isStale||!N1(this.options.staleTime))return;const t=mL(ee(this,qr).dataUpdatedAt,this.options.staleTime)+1;Ye(this,ic,setTimeout(()=>{ee(this,qr).isStale||this.updateResult()},t))},Cp=new WeakSet,z1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ee(this,xn)):this.options.refetchInterval)??!1},Ap=new WeakSet,B1=function(e){Gt(this,Ip,$1).call(this),Ye(this,za,e),!(Rd||this.options.enabled===!1||!N1(ee(this,za))||ee(this,za)===0)&&Ye(this,sc,setInterval(()=>{(this.options.refetchIntervalInBackground||o0.isFocused())&&Gt(this,oc,Zf).call(this)},ee(this,za)))},Rp=new WeakSet,V1=function(){Gt(this,Tp,F1).call(this),Gt(this,Ap,B1).call(this,Gt(this,Cp,z1).call(this))},Pp=new WeakSet,H1=function(){ee(this,ic)&&(clearTimeout(ee(this,ic)),Ye(this,ic,void 0))},Ip=new WeakSet,$1=function(){ee(this,sc)&&(clearInterval(ee(this,sc)),Ye(this,sc,void 0))},Lp=new WeakSet,W1=function(){const e=ee(this,li).getQueryCache().build(ee(this,li),this.options);if(e===ee(this,xn))return;const t=ee(this,xn);Ye(this,xn,e),Ye(this,Mp,e.state),this.hasListeners()&&(t==null||t.removeObserver(this),e.addObserver(this))},W0=new WeakSet,_L=function(e){Sr.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(ee(this,qr))}),ee(this,li).getQueryCache().notify({query:ee(this,xn),type:"observerResultsUpdated"})})},xP);function rW(n,e){return e.enabled!==!1&&!n.state.dataUpdatedAt&&!(n.state.status==="error"&&e.retryOnMount===!1)}function n2(n,e){return rW(n,e)||n.state.dataUpdatedAt>0&&G1(n,e,e.refetchOnMount)}function G1(n,e,t){if(e.enabled!==!1){const r=typeof t=="function"?t(n):t;return r==="always"||r!==!1&&tM(n,e)}return!1}function r2(n,e,t,r){return t.enabled!==!1&&(n!==e||r.enabled===!1)&&(!t.suspense||n.state.status!=="error")&&tM(n,t)}function tM(n,e){return n.isStaleByTime(e.staleTime)}function iW(n,e){return!O1(n.getCurrentResult(),e)}var SL=M.createContext(void 0),sW=n=>{const e=M.useContext(SL);if(n)return n;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},oW=({client:n,children:e})=>(M.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),M.createElement(SL.Provider,{value:n},e)),wL=M.createContext(!1),aW=()=>M.useContext(wL);wL.Provider;function lW(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var cW=M.createContext(lW()),uW=()=>M.useContext(cW);function dW(n,e){return typeof n=="function"?n(...e):!!n}var fW=(n,e)=>{(n.suspense||n.throwOnError)&&(e.isReset()||(n.retryOnMount=!1))},hW=n=>{M.useEffect(()=>{n.clearReset()},[n])},pW=({result:n,errorResetBoundary:e,throwOnError:t,query:r})=>n.isError&&!e.isReset()&&!n.isFetching&&r&&dW(t,[n.error,r]),mW=(n,e)=>typeof e.state.data>"u",gW=n=>{n.suspense&&typeof n.staleTime!="number"&&(n.staleTime=1e3)},vW=(n,e)=>(n==null?void 0:n.suspense)&&e.isPending,yW=(n,e,t)=>e.fetchOptimistic(n).catch(()=>{t.clearReset()});function xW(n,e,t){const r=sW(t),i=aW(),s=uW(),o=r.defaultQueryOptions(n);o._optimisticResults=i?"isRestoring":"optimistic",gW(o),fW(o,s),hW(s);const[a]=M.useState(()=>new e(r,o)),l=a.getOptimisticResult(o);if(M.useSyncExternalStore(M.useCallback(u=>{const f=i?()=>{}:a.subscribe(Sr.batchCalls(u));return a.updateResult(),f},[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),M.useEffect(()=>{a.setOptions(o,{listeners:!1})},[o,a]),vW(o,l))throw yW(o,a,s);if(pW({result:l,errorResetBoundary:s,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw l.error;return o.notifyOnChangeProps?l:a.trackResult(l)}function nM(n,e){return xW({...n,enabled:!0,suspense:!0,throwOnError:mW},nW,e)}/** +}`;class i8{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,r){if(this.texture===null){const i=new In,s=e.properties.get(i);s.__webglTexture=t.texture,(t.depthNear!=r.depthNear||t.depthFar!=r.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}render(e,t){if(this.texture!==null){if(this.mesh===null){const r=t.cameras[0].viewport,i=new as({extensions:{fragDepth:!0},vertexShader:n8,fragmentShader:r8,uniforms:{depthColor:{value:this.texture},depthWidth:{value:r.z},depthHeight:{value:r.w}}});this.mesh=new qn(new jd(20,20),i)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}}class s8 extends mo{constructor(e,t){super();const r=this;let i=null,s=1,o=null,a="local-floor",l=1,u=null,f=null,h=null,p=null,m=null,v=null;const w=new i8,x=t.getContextAttributes();let g=null,S=null;const _=[],b=[],A=new ge;let R=null;const P=new Rn;P.layers.enable(1),P.viewport=new on;const D=new Rn;D.layers.enable(2),D.viewport=new on;const V=[P,D],C=new Q3;C.layers.enable(1),C.layers.enable(2);let L=null,W=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(te){let le=_[te];return le===void 0&&(le=new A_,_[te]=le),le.getTargetRaySpace()},this.getControllerGrip=function(te){let le=_[te];return le===void 0&&(le=new A_,_[te]=le),le.getGripSpace()},this.getHand=function(te){let le=_[te];return le===void 0&&(le=new A_,_[te]=le),le.getHandSpace()};function Q(te){const le=b.indexOf(te.inputSource);if(le===-1)return;const Me=_[le];Me!==void 0&&(Me.update(te.inputSource,te.frame,u||o),Me.dispatchEvent({type:te.type,data:te.inputSource}))}function z(){i.removeEventListener("select",Q),i.removeEventListener("selectstart",Q),i.removeEventListener("selectend",Q),i.removeEventListener("squeeze",Q),i.removeEventListener("squeezestart",Q),i.removeEventListener("squeezeend",Q),i.removeEventListener("end",z),i.removeEventListener("inputsourceschange",j);for(let te=0;te<_.length;te++){const le=b[te];le!==null&&(b[te]=null,_[te].disconnect(le))}L=null,W=null,w.reset(),e.setRenderTarget(g),m=null,p=null,h=null,i=null,S=null,ve.stop(),r.isPresenting=!1,e.setPixelRatio(R),e.setSize(A.width,A.height,!1),r.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(te){s=te,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(te){a=te,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||o},this.setReferenceSpace=function(te){u=te},this.getBaseLayer=function(){return p!==null?p:m},this.getBinding=function(){return h},this.getFrame=function(){return v},this.getSession=function(){return i},this.setSession=async function(te){if(i=te,i!==null){if(g=e.getRenderTarget(),i.addEventListener("select",Q),i.addEventListener("selectstart",Q),i.addEventListener("selectend",Q),i.addEventListener("squeeze",Q),i.addEventListener("squeezestart",Q),i.addEventListener("squeezeend",Q),i.addEventListener("end",z),i.addEventListener("inputsourceschange",j),x.xrCompatible!==!0&&await t.makeXRCompatible(),R=e.getPixelRatio(),e.getSize(A),i.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const le={antialias:i.renderState.layers===void 0?x.antialias:!0,alpha:!0,depth:x.depth,stencil:x.stencil,framebufferScaleFactor:s};m=new XRWebGLLayer(i,t,le),i.updateRenderState({baseLayer:m}),e.setPixelRatio(1),e.setSize(m.framebufferWidth,m.framebufferHeight,!1),S=new gi(m.framebufferWidth,m.framebufferHeight,{format:Fr,type:ao,colorSpace:e.outputColorSpace,stencilBuffer:x.stencil})}else{let le=null,Me=null,pe=null;x.depth&&(pe=x.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,le=x.stencil?yc:Vo,Me=x.stencil?$a:Oo);const Ae={colorFormat:t.RGBA8,depthFormat:pe,scaleFactor:s};h=new XRWebGLBinding(i,t),p=h.createProjectionLayer(Ae),i.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),S=new gi(p.textureWidth,p.textureHeight,{format:Fr,type:ao,depthTexture:new ey(p.textureWidth,p.textureHeight,Me,void 0,void 0,void 0,void 0,void 0,void 0,le),stencilBuffer:x.stencil,colorSpace:e.outputColorSpace,samples:x.antialias?4:0});const De=e.properties.get(S);De.__ignoreDepthValues=p.ignoreDepthValues}S.isXRRenderTarget=!0,this.setFoveation(l),u=null,o=await i.requestReferenceSpace(a),ve.setContext(i),ve.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function j(te){for(let le=0;le=0&&(b[pe]=null,_[pe].disconnect(Me))}for(let le=0;le=b.length){b.push(Me),pe=De;break}else if(b[De]===null){b[De]=Me,pe=De;break}if(pe===-1)break}const Ae=_[pe];Ae&&Ae.connect(Me)}}const Y=new F,re=new F;function U(te,le,Me){Y.setFromMatrixPosition(le.matrixWorld),re.setFromMatrixPosition(Me.matrixWorld);const pe=Y.distanceTo(re),Ae=le.projectionMatrix.elements,De=Me.projectionMatrix.elements,Re=Ae[14]/(Ae[10]-1),Ce=Ae[14]/(Ae[10]+1),H=(Ae[9]+1)/Ae[5],xe=(Ae[9]-1)/Ae[5],de=(Ae[8]-1)/Ae[0],Te=(De[8]+1)/De[0],ye=Re*de,Xe=Re*Te,ze=pe/(-de+Te),k=ze*-de;le.matrixWorld.decompose(te.position,te.quaternion,te.scale),te.translateX(k),te.translateZ(ze),te.matrixWorld.compose(te.position,te.quaternion,te.scale),te.matrixWorldInverse.copy(te.matrixWorld).invert();const O=Re+ze,ie=Ce+ze,be=ye-k,we=Xe+(pe-k),_e=H*Ce/ie*O,Ke=xe*Ce/ie*O;te.projectionMatrix.makePerspective(be,we,_e,Ke,O,ie),te.projectionMatrixInverse.copy(te.projectionMatrix).invert()}function X(te,le){le===null?te.matrixWorld.copy(te.matrix):te.matrixWorld.multiplyMatrices(le.matrixWorld,te.matrix),te.matrixWorldInverse.copy(te.matrixWorld).invert()}this.updateCamera=function(te){if(i===null)return;w.texture!==null&&(te.near=w.depthNear,te.far=w.depthFar),C.near=D.near=P.near=te.near,C.far=D.far=P.far=te.far,(L!==C.near||W!==C.far)&&(i.updateRenderState({depthNear:C.near,depthFar:C.far}),L=C.near,W=C.far,P.near=L,P.far=W,D.near=L,D.far=W,P.updateProjectionMatrix(),D.updateProjectionMatrix(),te.updateProjectionMatrix());const le=te.parent,Me=C.cameras;X(C,le);for(let pe=0;pe0&&(x.alphaTest.value=g.alphaTest);const S=e.get(g).envMap;if(S&&(x.envMap.value=S,x.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,x.reflectivity.value=g.reflectivity,x.ior.value=g.ior,x.refractionRatio.value=g.refractionRatio),g.lightMap){x.lightMap.value=g.lightMap;const _=n._useLegacyLights===!0?Math.PI:1;x.lightMapIntensity.value=g.lightMapIntensity*_,t(g.lightMap,x.lightMapTransform)}g.aoMap&&(x.aoMap.value=g.aoMap,x.aoMapIntensity.value=g.aoMapIntensity,t(g.aoMap,x.aoMapTransform))}function o(x,g){x.diffuse.value.copy(g.color),x.opacity.value=g.opacity,g.map&&(x.map.value=g.map,t(g.map,x.mapTransform))}function a(x,g){x.dashSize.value=g.dashSize,x.totalSize.value=g.dashSize+g.gapSize,x.scale.value=g.scale}function l(x,g,S,_){x.diffuse.value.copy(g.color),x.opacity.value=g.opacity,x.size.value=g.size*S,x.scale.value=_*.5,g.map&&(x.map.value=g.map,t(g.map,x.uvTransform)),g.alphaMap&&(x.alphaMap.value=g.alphaMap,t(g.alphaMap,x.alphaMapTransform)),g.alphaTest>0&&(x.alphaTest.value=g.alphaTest)}function u(x,g){x.diffuse.value.copy(g.color),x.opacity.value=g.opacity,x.rotation.value=g.rotation,g.map&&(x.map.value=g.map,t(g.map,x.mapTransform)),g.alphaMap&&(x.alphaMap.value=g.alphaMap,t(g.alphaMap,x.alphaMapTransform)),g.alphaTest>0&&(x.alphaTest.value=g.alphaTest)}function f(x,g){x.specular.value.copy(g.specular),x.shininess.value=Math.max(g.shininess,1e-4)}function h(x,g){g.gradientMap&&(x.gradientMap.value=g.gradientMap)}function p(x,g){x.metalness.value=g.metalness,g.metalnessMap&&(x.metalnessMap.value=g.metalnessMap,t(g.metalnessMap,x.metalnessMapTransform)),x.roughness.value=g.roughness,g.roughnessMap&&(x.roughnessMap.value=g.roughnessMap,t(g.roughnessMap,x.roughnessMapTransform)),e.get(g).envMap&&(x.envMapIntensity.value=g.envMapIntensity)}function m(x,g,S){x.ior.value=g.ior,g.sheen>0&&(x.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),x.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(x.sheenColorMap.value=g.sheenColorMap,t(g.sheenColorMap,x.sheenColorMapTransform)),g.sheenRoughnessMap&&(x.sheenRoughnessMap.value=g.sheenRoughnessMap,t(g.sheenRoughnessMap,x.sheenRoughnessMapTransform))),g.clearcoat>0&&(x.clearcoat.value=g.clearcoat,x.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(x.clearcoatMap.value=g.clearcoatMap,t(g.clearcoatMap,x.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(x.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,t(g.clearcoatRoughnessMap,x.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(x.clearcoatNormalMap.value=g.clearcoatNormalMap,t(g.clearcoatNormalMap,x.clearcoatNormalMapTransform),x.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===Kr&&x.clearcoatNormalScale.value.negate())),g.iridescence>0&&(x.iridescence.value=g.iridescence,x.iridescenceIOR.value=g.iridescenceIOR,x.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],x.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(x.iridescenceMap.value=g.iridescenceMap,t(g.iridescenceMap,x.iridescenceMapTransform)),g.iridescenceThicknessMap&&(x.iridescenceThicknessMap.value=g.iridescenceThicknessMap,t(g.iridescenceThicknessMap,x.iridescenceThicknessMapTransform))),g.transmission>0&&(x.transmission.value=g.transmission,x.transmissionSamplerMap.value=S.texture,x.transmissionSamplerSize.value.set(S.width,S.height),g.transmissionMap&&(x.transmissionMap.value=g.transmissionMap,t(g.transmissionMap,x.transmissionMapTransform)),x.thickness.value=g.thickness,g.thicknessMap&&(x.thicknessMap.value=g.thicknessMap,t(g.thicknessMap,x.thicknessMapTransform)),x.attenuationDistance.value=g.attenuationDistance,x.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(x.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(x.anisotropyMap.value=g.anisotropyMap,t(g.anisotropyMap,x.anisotropyMapTransform))),x.specularIntensity.value=g.specularIntensity,x.specularColor.value.copy(g.specularColor),g.specularColorMap&&(x.specularColorMap.value=g.specularColorMap,t(g.specularColorMap,x.specularColorMapTransform)),g.specularIntensityMap&&(x.specularIntensityMap.value=g.specularIntensityMap,t(g.specularIntensityMap,x.specularIntensityMapTransform))}function v(x,g){g.matcap&&(x.matcap.value=g.matcap)}function w(x,g){const S=e.get(g).light;x.referencePosition.value.setFromMatrixPosition(S.matrixWorld),x.nearDistance.value=S.shadow.camera.near,x.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function a8(n,e,t,r){let i={},s={},o=[];const a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(S,_){const b=_.program;r.uniformBlockBinding(S,b)}function u(S,_){let b=i[S.id];b===void 0&&(v(S),b=f(S),i[S.id]=b,S.addEventListener("dispose",x));const A=_.program;r.updateUBOMapping(S,A);const R=e.render.frame;s[S.id]!==R&&(p(S),s[S.id]=R)}function f(S){const _=h();S.__bindingPointIndex=_;const b=n.createBuffer(),A=S.__size,R=S.usage;return n.bindBuffer(n.UNIFORM_BUFFER,b),n.bufferData(n.UNIFORM_BUFFER,A,R),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,_,b),b}function h(){for(let S=0;S0&&(b+=A-R),S.__size=b,S.__cache={},this}function w(S){const _={boundary:0,storage:0};return typeof S=="number"||typeof S=="boolean"?(_.boundary=4,_.storage=4):S.isVector2?(_.boundary=8,_.storage=8):S.isVector3||S.isColor?(_.boundary=16,_.storage=12):S.isVector4?(_.boundary=16,_.storage=16):S.isMatrix3?(_.boundary=48,_.storage=48):S.isMatrix4?(_.boundary=64,_.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),_}function x(S){const _=S.target;_.removeEventListener("dispose",x);const b=o.indexOf(_.__bindingPointIndex);o.splice(b,1),n.deleteBuffer(i[_.id]),delete i[_.id],delete s[_.id]}function g(){for(const S in i)n.deleteBuffer(i[S]);o=[],i={},s={}}return{bind:l,update:u,dispose:g}}class IE{constructor(e={}){const{canvas:t=F3(),context:r=null,depth:i=!0,stencil:s=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:f="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let p;r!==null?p=r.getContextAttributes().alpha:p=o;const m=new Uint32Array(4),v=new Int32Array(4);let w=null,x=null;const g=[],S=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Fn,this._useLegacyLights=!1,this.toneMapping=oo,this.toneMappingExposure=1;const _=this;let b=!1,A=0,R=0,P=null,D=-1,V=null;const C=new on,L=new on;let W=null;const Q=new Be(0);let z=0,j=t.width,Y=t.height,re=1,U=null,X=null;const q=new on(0,0,j,Y),K=new on(0,0,j,Y);let se=!1;const ve=new $p;let te=!1,le=!1,Me=null;const pe=new _t,Ae=new ge,De=new F,Re={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Ce(){return P===null?re:1}let H=r;function xe(B,oe){for(let ue=0;ue{function qe(){if(fe.forEach(function(ut){ze.get(ut).currentProgram.isReady()&&fe.delete(ut)}),fe.size===0){ce(B);return}setTimeout(qe,10)}de.get("KHR_parallel_shader_compile")!==null?qe():setTimeout(qe,10)})};let Yt=null;function fn(B){Yt&&Yt(B)}function Bn(){mr.stop()}function Kt(){mr.start()}const mr=new G3;mr.setAnimationLoop(fn),typeof self<"u"&&mr.setContext(self),this.setAnimationLoop=function(B){Yt=B,je.setAnimationLoop(B),B===null?mr.stop():mr.start()},je.addEventListener("sessionstart",Bn),je.addEventListener("sessionend",Kt),this.render=function(B,oe){if(oe!==void 0&&oe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(b===!0)return;B.matrixWorldAutoUpdate===!0&&B.updateMatrixWorld(),oe.parent===null&&oe.matrixWorldAutoUpdate===!0&&oe.updateMatrixWorld(),je.enabled===!0&&je.isPresenting===!0&&(je.cameraAutoUpdate===!0&&je.updateCamera(oe),oe=je.getCamera()),B.isScene===!0&&B.onBeforeRender(_,B,oe,P),x=st.get(B,S.length),x.init(),S.push(x),pe.multiplyMatrices(oe.projectionMatrix,oe.matrixWorldInverse),ve.setFromProjectionMatrix(pe),le=this.localClippingEnabled,te=mt.init(this.clippingPlanes,le),w=He.get(B,g.length),w.init(),g.push(w),zi(B,oe,0,_.sortObjects),w.finish(),_.sortObjects===!0&&w.sort(U,X),this.info.render.frame++,te===!0&&mt.beginShadows();const ue=x.state.shadowsArray;if(Ee.render(ue,B,oe),te===!0&&mt.endShadows(),this.info.autoReset===!0&&this.info.reset(),(je.enabled===!1||je.isPresenting===!1||je.hasDepthSensing()===!1)&&Nt.render(w,B),x.setupLights(_._useLegacyLights),oe.isArrayCamera){const fe=oe.cameras;for(let ce=0,qe=fe.length;ce0?x=S[S.length-1]:x=null,g.pop(),g.length>0?w=g[g.length-1]:w=null};function zi(B,oe,ue,fe){if(B.visible===!1)return;if(B.layers.test(oe.layers)){if(B.isGroup)ue=B.renderOrder;else if(B.isLOD)B.autoUpdate===!0&&B.update(oe);else if(B.isLight)x.pushLight(B),B.castShadow&&x.pushShadow(B);else if(B.isSprite){if(!B.frustumCulled||ve.intersectsSprite(B)){fe&&De.setFromMatrixPosition(B.matrixWorld).applyMatrix4(pe);const ut=_e.update(B),gt=B.material;gt.visible&&w.push(B,ut,gt,ue,De.z,null)}}else if((B.isMesh||B.isLine||B.isPoints)&&(!B.frustumCulled||ve.intersectsObject(B))){const ut=_e.update(B),gt=B.material;if(fe&&(B.boundingSphere!==void 0?(B.boundingSphere===null&&B.computeBoundingSphere(),De.copy(B.boundingSphere.center)):(ut.boundingSphere===null&&ut.computeBoundingSphere(),De.copy(ut.boundingSphere.center)),De.applyMatrix4(B.matrixWorld).applyMatrix4(pe)),Array.isArray(gt)){const vt=ut.groups;for(let Tt=0,Mt=vt.length;Tt0&&of(ce,qe,oe,ue),fe&&ye.viewport(C.copy(fe)),ce.length>0&&Gc(ce,oe,ue),qe.length>0&&Gc(qe,oe,ue),ut.length>0&&Gc(ut,oe,ue),ye.buffers.depth.setTest(!0),ye.buffers.depth.setMask(!0),ye.buffers.color.setMask(!0),ye.setPolygonOffset(!1)}function of(B,oe,ue,fe){if((ue.isScene===!0?ue.overrideMaterial:null)!==null)return;const qe=Te.isWebGL2;Me===null&&(Me=new gi(1,1,{generateMipmaps:!0,type:de.has("EXT_color_buffer_half_float")?nl:ao,minFilter:ro,samples:qe?4:0})),_.getDrawingBufferSize(Ae),qe?Me.setSize(Ae.x,Ae.y):Me.setSize(Zv(Ae.x),Zv(Ae.y));const ut=_.getRenderTarget();_.setRenderTarget(Me),_.getClearColor(Q),z=_.getClearAlpha(),z<1&&_.setClearColor(16777215,.5),_.clear();const gt=_.toneMapping;_.toneMapping=oo,Gc(B,ue,fe),k.updateMultisampleRenderTarget(Me),k.updateRenderTargetMipmap(Me);let vt=!1;for(let Tt=0,Mt=oe.length;Tt0),Ct=!!ue.morphAttributes.position,bn=!!ue.morphAttributes.normal,gr=!!ue.morphAttributes.color;let vn=oo;fe.toneMapped&&(P===null||P.isXRRenderTarget===!0)&&(vn=_.toneMapping);const or=ue.morphAttributes.position||ue.morphAttributes.normal||ue.morphAttributes.color,yt=or!==void 0?or.length:0,et=ze.get(fe),Bi=x.state.lights;if(te===!0&&(le===!0||B!==V)){const vr=B===V&&fe.id===D;mt.setState(fe,B,vr)}let $t=!1;fe.version===et.__version?(et.needsLights&&et.lightsStateVersion!==Bi.state.version||et.outputColorSpace!==gt||ce.isBatchedMesh&&et.batching===!1||!ce.isBatchedMesh&&et.batching===!0||ce.isInstancedMesh&&et.instancing===!1||!ce.isInstancedMesh&&et.instancing===!0||ce.isSkinnedMesh&&et.skinning===!1||!ce.isSkinnedMesh&&et.skinning===!0||ce.isInstancedMesh&&et.instancingColor===!0&&ce.instanceColor===null||ce.isInstancedMesh&&et.instancingColor===!1&&ce.instanceColor!==null||et.envMap!==vt||fe.fog===!0&&et.fog!==qe||et.numClippingPlanes!==void 0&&(et.numClippingPlanes!==mt.numPlanes||et.numIntersection!==mt.numIntersection)||et.vertexAlphas!==Tt||et.vertexTangents!==Mt||et.morphTargets!==Ct||et.morphNormals!==bn||et.morphColors!==gr||et.toneMapping!==vn||Te.isWebGL2===!0&&et.morphTargetsCount!==yt)&&($t=!0):($t=!0,et.__version=fe.version);let Nn=et.currentProgram;$t===!0&&(Nn=jc(fe,oe,ce));let Us=!1,Vi=!1,ar=!1;const Vn=Nn.getUniforms(),Fs=et.uniforms;if(ye.useProgram(Nn.program)&&(Us=!0,Vi=!0,ar=!0),fe.id!==D&&(D=fe.id,Vi=!0),Us||V!==B){Vn.setValue(H,"projectionMatrix",B.projectionMatrix),Vn.setValue(H,"viewMatrix",B.matrixWorldInverse);const vr=Vn.map.cameraPosition;vr!==void 0&&vr.setValue(H,De.setFromMatrixPosition(B.matrixWorld)),Te.logarithmicDepthBuffer&&Vn.setValue(H,"logDepthBufFC",2/(Math.log(B.far+1)/Math.LN2)),(fe.isMeshPhongMaterial||fe.isMeshToonMaterial||fe.isMeshLambertMaterial||fe.isMeshBasicMaterial||fe.isMeshStandardMaterial||fe.isShaderMaterial)&&Vn.setValue(H,"isOrthographic",B.isOrthographicCamera===!0),V!==B&&(V=B,Vi=!0,ar=!0)}if(ce.isSkinnedMesh){Vn.setOptional(H,ce,"bindMatrix"),Vn.setOptional(H,ce,"bindMatrixInverse");const vr=ce.skeleton;vr&&(Te.floatVertexTextures?(vr.boneTexture===null&&vr.computeBoneTexture(),Vn.setValue(H,"boneTexture",vr.boneTexture,k)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}ce.isBatchedMesh&&(Vn.setOptional(H,ce,"batchingTexture"),Vn.setValue(H,"batchingTexture",ce._matricesTexture,k));const Xc=ue.morphAttributes;if((Xc.position!==void 0||Xc.normal!==void 0||Xc.color!==void 0&&Te.isWebGL2===!0)&&wt.update(ce,ue,Nn),(Vi||et.receiveShadow!==ce.receiveShadow)&&(et.receiveShadow=ce.receiveShadow,Vn.setValue(H,"receiveShadow",ce.receiveShadow)),fe.isMeshGouraudMaterial&&fe.envMap!==null&&(Fs.envMap.value=vt,Fs.flipEnvMap.value=vt.isCubeTexture&&vt.isRenderTargetTexture===!1?-1:1),Vi&&(Vn.setValue(H,"toneMappingExposure",_.toneMappingExposure),et.needsLights&&Ky(Fs,ar),qe&&fe.fog===!0&&Fe.refreshFogUniforms(Fs,qe),Fe.refreshMaterialUniforms(Fs,fe,re,Y,Me),Rv.upload(H,sm(et),Fs,k)),fe.isShaderMaterial&&fe.uniformsNeedUpdate===!0&&(Rv.upload(H,sm(et),Fs,k),fe.uniformsNeedUpdate=!1),fe.isSpriteMaterial&&Vn.setValue(H,"center",ce.center),Vn.setValue(H,"modelViewMatrix",ce.modelViewMatrix),Vn.setValue(H,"normalMatrix",ce.normalMatrix),Vn.setValue(H,"modelMatrix",ce.matrixWorld),fe.isShaderMaterial||fe.isRawShaderMaterial){const vr=fe.uniformsGroups;for(let qc=0,yi=vr.length;qc0&&k.useMultisampledRTT(B)===!1?ce=ze.get(B).__webglMultisampledFramebuffer:Array.isArray(Mt)?ce=Mt[ue]:ce=Mt,C.copy(B.viewport),L.copy(B.scissor),W=B.scissorTest}else C.copy(q).multiplyScalar(re).floor(),L.copy(K).multiplyScalar(re).floor(),W=se;if(ye.bindFramebuffer(H.FRAMEBUFFER,ce)&&Te.drawBuffers&&fe&&ye.drawBuffers(B,ce),ye.viewport(C),ye.scissor(L),ye.setScissorTest(W),qe){const vt=ze.get(B.texture);H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_CUBE_MAP_POSITIVE_X+oe,vt.__webglTexture,ue)}else if(ut){const vt=ze.get(B.texture),Tt=oe||0;H.framebufferTextureLayer(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,vt.__webglTexture,ue||0,Tt)}D=-1},this.readRenderTargetPixels=function(B,oe,ue,fe,ce,qe,ut){if(!(B&&B.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let gt=ze.get(B).__webglFramebuffer;if(B.isWebGLCubeRenderTarget&&ut!==void 0&&(gt=gt[ut]),gt){ye.bindFramebuffer(H.FRAMEBUFFER,gt);try{const vt=B.texture,Tt=vt.format,Mt=vt.type;if(Tt!==Fr&&Le.convert(Tt)!==H.getParameter(H.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Ct=Mt===nl&&(de.has("EXT_color_buffer_half_float")||Te.isWebGL2&&de.has("EXT_color_buffer_float"));if(Mt!==ao&&Le.convert(Mt)!==H.getParameter(H.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Mt===is&&(Te.isWebGL2||de.has("OES_texture_float")||de.has("WEBGL_color_buffer_float")))&&!Ct){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}oe>=0&&oe<=B.width-fe&&ue>=0&&ue<=B.height-ce&&H.readPixels(oe,ue,fe,ce,Le.convert(Tt),Le.convert(Mt),qe)}finally{const vt=P!==null?ze.get(P).__webglFramebuffer:null;ye.bindFramebuffer(H.FRAMEBUFFER,vt)}}},this.copyFramebufferToTexture=function(B,oe,ue=0){const fe=Math.pow(2,-ue),ce=Math.floor(oe.image.width*fe),qe=Math.floor(oe.image.height*fe);k.setTexture2D(oe,0),H.copyTexSubImage2D(H.TEXTURE_2D,ue,0,0,B.x,B.y,ce,qe),ye.unbindTexture()},this.copyTextureToTexture=function(B,oe,ue,fe=0){const ce=oe.image.width,qe=oe.image.height,ut=Le.convert(ue.format),gt=Le.convert(ue.type);k.setTexture2D(ue,0),H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,ue.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ue.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,ue.unpackAlignment),oe.isDataTexture?H.texSubImage2D(H.TEXTURE_2D,fe,B.x,B.y,ce,qe,ut,gt,oe.image.data):oe.isCompressedTexture?H.compressedTexSubImage2D(H.TEXTURE_2D,fe,B.x,B.y,oe.mipmaps[0].width,oe.mipmaps[0].height,ut,oe.mipmaps[0].data):H.texSubImage2D(H.TEXTURE_2D,fe,B.x,B.y,ut,gt,oe.image),fe===0&&ue.generateMipmaps&&H.generateMipmap(H.TEXTURE_2D),ye.unbindTexture()},this.copyTextureToTexture3D=function(B,oe,ue,fe,ce=0){if(_.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const qe=B.max.x-B.min.x+1,ut=B.max.y-B.min.y+1,gt=B.max.z-B.min.z+1,vt=Le.convert(fe.format),Tt=Le.convert(fe.type);let Mt;if(fe.isData3DTexture)k.setTexture3D(fe,0),Mt=H.TEXTURE_3D;else if(fe.isDataArrayTexture||fe.isCompressedArrayTexture)k.setTexture2DArray(fe,0),Mt=H.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,fe.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,fe.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,fe.unpackAlignment);const Ct=H.getParameter(H.UNPACK_ROW_LENGTH),bn=H.getParameter(H.UNPACK_IMAGE_HEIGHT),gr=H.getParameter(H.UNPACK_SKIP_PIXELS),vn=H.getParameter(H.UNPACK_SKIP_ROWS),or=H.getParameter(H.UNPACK_SKIP_IMAGES),yt=ue.isCompressedTexture?ue.mipmaps[ce]:ue.image;H.pixelStorei(H.UNPACK_ROW_LENGTH,yt.width),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,yt.height),H.pixelStorei(H.UNPACK_SKIP_PIXELS,B.min.x),H.pixelStorei(H.UNPACK_SKIP_ROWS,B.min.y),H.pixelStorei(H.UNPACK_SKIP_IMAGES,B.min.z),ue.isDataTexture||ue.isData3DTexture?H.texSubImage3D(Mt,ce,oe.x,oe.y,oe.z,qe,ut,gt,vt,Tt,yt.data):ue.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),H.compressedTexSubImage3D(Mt,ce,oe.x,oe.y,oe.z,qe,ut,gt,vt,yt.data)):H.texSubImage3D(Mt,ce,oe.x,oe.y,oe.z,qe,ut,gt,vt,Tt,yt),H.pixelStorei(H.UNPACK_ROW_LENGTH,Ct),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,bn),H.pixelStorei(H.UNPACK_SKIP_PIXELS,gr),H.pixelStorei(H.UNPACK_SKIP_ROWS,vn),H.pixelStorei(H.UNPACK_SKIP_IMAGES,or),ce===0&&fe.generateMipmaps&&H.generateMipmap(Mt),ye.unbindTexture()},this.initTexture=function(B){B.isCubeTexture?k.setTextureCube(B,0):B.isData3DTexture?k.setTexture3D(B,0):B.isDataArrayTexture||B.isCompressedArrayTexture?k.setTexture2DArray(B,0):k.setTexture2D(B,0),ye.unbindTexture()},this.resetState=function(){A=0,R=0,P=null,ye.reset(),Z.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return io}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===Q0?"display-p3":"srgb",t.unpackColorSpace=ln.workingColorSpace===Bp?"display-p3":"srgb"}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Fn?Wa:SE}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Wa?Fn:di}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 J3 extends IE{}J3.prototype.isWebGL1Renderer=!0;class ny{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Be(e),this.density=t}clone(){return new ny(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class ry{constructor(e,t=1,r=1e3){this.isFog=!0,this.name="",this.color=new Be(e),this.near=t,this.far=r}clone(){return new ry(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Dh extends sn{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,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class iy{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Ph,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Li()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return dc("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,r){e*=this.stride,r*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:Pf.clone(),uv:Pi.getInterpolation(Pf,Eg,Lf,Mg,eA,R_,tA,new ge),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function bg(n,e,t,r,i,s){bu.subVectors(n,t).addScalar(.5).multiply(r),i!==void 0?(If.x=s*bu.x-i*bu.y,If.y=i*bu.x+s*bu.y):If.copy(bu),n.copy(e),n.x+=If.x,n.y+=If.y,n.applyMatrix4(eI)}const Tg=new F,nA=new F;class nI extends sn{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let r=0,i=t.length;r0){let r,i;for(r=1,i=t.length;r0){Tg.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(Tg);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Tg.setFromMatrixPosition(e.matrixWorld),nA.setFromMatrixPosition(this.matrixWorld);const r=Tg.distanceTo(nA)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=o)t[i-1].object.visible=!1,t[i].object.visible=!0;else break}for(this._currentLevel=i-1;i=r.length&&r.push({start:-1,count:-1,z:-1});const s=r[this.index];i.push(s),this.index++,s.start=e.start,s.count=e.count,s.z=t}reset(){this.list.length=0,this.index=0}}const Cu="batchId",Sa=new _t,dA=new _t,p8=new _t,fA=new _t,L_=new $p,Rg=new Qr,Ll=new Vr,Of=new F,D_=new h8,Lr=new qn,Pg=[];function m8(n,e,t=0){const r=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const i=n.count;for(let s=0;s65536?new Uint32Array(s):new Uint16Array(s);t.setIndex(new an(a,1))}const o=i>65536?new Uint32Array(r):new Uint16Array(r);t.setAttribute(Cu,new an(o,1)),this._geometryInitialized=!0}}_validateGeometry(e){if(e.getAttribute(Cu))throw new Error(`BatchedMesh: Geometry cannot use attribute "${Cu}"`);const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const r in t.attributes){if(r===Cu)continue;if(!e.hasAttribute(r))throw new Error(`BatchedMesh: Added geometry missing "${r}". All geometries must have consistent attributes.`);const i=e.getAttribute(r),s=t.getAttribute(r);if(i.itemSize!==s.itemSize||i.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Qr);const e=this._geometryCount,t=this.boundingBox,r=this._active;t.makeEmpty();for(let i=0;i=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const i={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let s=null;const o=this._reservedRanges,a=this._drawRanges,l=this._bounds;this._geometryCount!==0&&(s=o[o.length-1]),t===-1?i.vertexCount=e.getAttribute("position").count:i.vertexCount=t,s===null?i.vertexStart=0:i.vertexStart=s.vertexStart+s.vertexCount;const u=e.getIndex(),f=u!==null;if(f&&(r===-1?i.indexCount=u.count:i.indexCount=r,s===null?i.indexStart=0:i.indexStart=s.indexStart+s.indexCount),i.indexStart!==-1&&i.indexStart+i.indexCount>this._maxIndexCount||i.vertexStart+i.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const h=this._visibility,p=this._active,m=this._matricesTexture,v=this._matricesTexture.image.data;h.push(!0),p.push(!0);const w=this._geometryCount;this._geometryCount++,p8.toArray(v,w*16),m.needsUpdate=!0,o.push(i),a.push({start:f?i.indexStart:i.vertexStart,count:-1}),l.push({boxInitialized:!1,box:new Qr,sphereInitialized:!1,sphere:new Vr});const x=this.geometry.getAttribute(Cu);for(let g=0;g=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const r=this.geometry,i=r.getIndex()!==null,s=r.getIndex(),o=t.getIndex(),a=this._reservedRanges[e];if(i&&o.count>a.indexCount||t.attributes.position.count>a.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,u=a.vertexCount;for(const m in r.attributes){if(m===Cu)continue;const v=t.getAttribute(m),w=r.getAttribute(m);m8(v,w,l);const x=v.itemSize;for(let g=v.count,S=u;g=t.length||t[e]===!1?this:(t[e]=!1,this._visibilityChanged=!0,this)}getBoundingBoxAt(e,t){if(this._active[e]===!1)return null;const i=this._bounds[e],s=i.box,o=this.geometry;if(i.boxInitialized===!1){s.makeEmpty();const a=o.index,l=o.attributes.position,u=this._drawRanges[e];for(let f=u.start,h=u.start+u.count;f=o||r[e]===!1?this:(t.toArray(s,e*16),i.needsUpdate=!0,this)}getMatrixAt(e,t){const r=this._active,i=this._matricesTexture.image.data,s=this._geometryCount;return e>=s||r[e]===!1?null:t.fromArray(i,e*16)}setVisibleAt(e,t){const r=this._visibility,i=this._active,s=this._geometryCount;return e>=s||i[e]===!1||r[e]===t?this:(r[e]=t,this._visibilityChanged=!0,this)}getVisibleAt(e){const t=this._visibility,r=this._active,i=this._geometryCount;return e>=i||r[e]===!1?!1:t[e]}raycast(e,t){const r=this._visibility,i=this._active,s=this._drawRanges,o=this._geometryCount,a=this.matrixWorld,l=this.geometry;Lr.material=this.material,Lr.geometry.index=l.index,Lr.geometry.attributes=l.attributes,Lr.geometry.boundingBox===null&&(Lr.geometry.boundingBox=new Qr),Lr.geometry.boundingSphere===null&&(Lr.geometry.boundingSphere=new Vr);for(let u=0;u({...t})),this._reservedRanges=e._reservedRanges.map(t=>({...t})),this._visibility=e._visibility.slice(),this._active=e._active.slice(),this._bounds=e._bounds.map(t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()})),this._maxGeometryCount=e._maxGeometryCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(e,t,r,i,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=i.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._active,u=this._visibility,f=this._multiDrawStarts,h=this._multiDrawCounts,p=this._drawRanges,m=this.perObjectFrustumCulled;m&&(fA.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse).multiply(this.matrixWorld),L_.setFromProjectionMatrix(fA,e.coordinateSystem));let v=0;if(this.sortObjects){dA.copy(this.matrixWorld).invert(),Of.setFromMatrixPosition(r.matrixWorld).applyMatrix4(dA);for(let g=0,S=u.length;gl)continue;p.applyMatrix4(this.matrixWorld);const D=e.ray.origin.distanceTo(p);De.far||t.push({distance:D,point:h.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this})}}else{const g=Math.max(0,o.start),S=Math.min(x.count,o.start+o.count);for(let _=g,b=S-1;_l)continue;p.applyMatrix4(this.matrixWorld);const R=e.ray.origin.distanceTo(p);Re.far||t.push({distance:R,point:h.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;si.far)return;s.push({distance:u,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class g8 extends In{constructor(e,t,r,i,s,o,a,l,u){super(e,t,r,i,s,o,a,l,u),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:dn,this.magFilter=s!==void 0?s:dn,this.generateMipmaps=!1;const f=this;function h(){f.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class v8 extends In{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Gn,this.minFilter=Gn,this.generateMipmaps=!1,this.needsUpdate=!0}}class oy extends In{constructor(e,t,r,i,s,o,a,l,u,f,h,p){super(null,o,a,l,u,f,i,s,h,p),this.isCompressedTexture=!0,this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class y8 extends oy{constructor(e,t,r,i,s,o){super(e,t,r,s,o),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Ur}}class x8 extends oy{constructor(e,t,r){super(void 0,e[0].width,e[0].height,t,r,Go),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class _8 extends In{constructor(e,t,r,i,s,o,a,l,u){super(e,t,r,i,s,o,a,l,u),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Ns{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let r,i=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)r=this.getPoint(o/e),s+=r.distanceTo(i),t.push(s),i=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const r=this.getLengths();let i=0;const s=r.length;let o;t?o=t:o=e*r[s-1];let a=0,l=s-1,u;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),u=r[i]-o,u<0)a=i+1;else if(u>0)l=i-1;else{l=i;break}if(i=l,r[i]===o)return i/(s-1);const f=r[i],p=r[i+1]-f,m=(o-f)/p;return(i+m)/(s-1)}getTangent(e,t){let i=e-1e-4,s=e+1e-4;i<0&&(i=0),s>1&&(s=1);const o=this.getPoint(i),a=this.getPoint(s),l=t||(o.isVector2?new ge:new F);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t){const r=new F,i=[],s=[],o=[],a=new F,l=new _t;for(let m=0;m<=e;m++){const v=m/e;i[m]=this.getTangentAt(v,new F)}s[0]=new F,o[0]=new F;let u=Number.MAX_VALUE;const f=Math.abs(i[0].x),h=Math.abs(i[0].y),p=Math.abs(i[0].z);f<=u&&(u=f,r.set(1,0,0)),h<=u&&(u=h,r.set(0,1,0)),p<=u&&r.set(0,0,1),a.crossVectors(i[0],r).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let m=1;m<=e;m++){if(s[m]=s[m-1].clone(),o[m]=o[m-1].clone(),a.crossVectors(i[m-1],i[m]),a.length()>Number.EPSILON){a.normalize();const v=Math.acos(zn(i[m-1].dot(i[m]),-1,1));s[m].applyMatrix4(l.makeRotationAxis(a,v))}o[m].crossVectors(i[m],s[m])}if(t===!0){let m=Math.acos(zn(s[0].dot(s[e]),-1,1));m/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(m=-m);for(let v=1;v<=e;v++)s[v].applyMatrix4(l.makeRotationAxis(i[v],m*v)),o[v].crossVectors(i[v],s[v])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class ay extends Ns{constructor(e=0,t=0,r=1,i=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){const r=t||new ge,i=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let u,f;this.closed||a>0?u=i[(a-1)%s]:(Ng.subVectors(i[0],i[1]).add(i[0]),u=Ng);const h=i[a%s],p=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return r.set(_A(a,l.x,u.x,f.x,h.x),_A(a,l.y,u.y,f.y,h.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t=r){const o=i[s]-r,a=this.curves[s],l=a.getLength(),u=l===0?0:1-o/l;return a.getPointAt(u,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let r=0,i=this.curves.length;r1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,r=e.curves.length;t0){const h=u.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(u);const f=u.getPoint(1);return this.currentPoint.copy(f),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Wp extends Ut{constructor(e=[new ge(0,-.5),new ge(.5,0),new ge(0,.5)],t=12,r=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:i},t=Math.floor(t),i=zn(i,0,Math.PI*2);const s=[],o=[],a=[],l=[],u=[],f=1/t,h=new F,p=new ge,m=new F,v=new F,w=new F;let x=0,g=0;for(let S=0;S<=e.length-1;S++)switch(S){case 0:x=e[S+1].x-e[S].x,g=e[S+1].y-e[S].y,m.x=g*1,m.y=-x,m.z=g*0,w.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case e.length-1:l.push(w.x,w.y,w.z);break;default:x=e[S+1].x-e[S].x,g=e[S+1].y-e[S].y,m.x=g*1,m.y=-x,m.z=g*0,v.copy(m),m.x+=w.x,m.y+=w.y,m.z+=w.z,m.normalize(),l.push(m.x,m.y,m.z),w.copy(v)}for(let S=0;S<=t;S++){const _=r+S*f*i,b=Math.sin(_),A=Math.cos(_);for(let R=0;R<=e.length-1;R++){h.x=e[R].x*b,h.y=e[R].y,h.z=e[R].x*A,o.push(h.x,h.y,h.z),p.x=S/t,p.y=R/(e.length-1),a.push(p.x,p.y);const P=l[3*R+0]*b,D=l[3*R+1],V=l[3*R+0]*A;u.push(P,D,V)}}for(let S=0;S0&&_(!0),t>0&&_(!1)),this.setIndex(f),this.setAttribute("position",new ot(h,3)),this.setAttribute("normal",new ot(p,3)),this.setAttribute("uv",new ot(m,2));function S(){const b=new F,A=new F;let R=0;const P=(t-e)/r;for(let D=0;D<=s;D++){const V=[],C=D/s,L=C*(t-e)+e;for(let W=0;W<=i;W++){const Q=W/i,z=Q*l+a,j=Math.sin(z),Y=Math.cos(z);A.x=L*j,A.y=-C*r+x,A.z=L*Y,h.push(A.x,A.y,A.z),b.set(j,P,Y).normalize(),p.push(b.x,b.y,b.z),m.push(Q,1-C),V.push(v++)}w.push(V)}for(let D=0;D.9&&P<.1&&(_<.2&&(o[S+0]+=1),b<.2&&(o[S+2]+=1),A<.2&&(o[S+4]+=1))}}function p(S){s.push(S.x,S.y,S.z)}function m(S,_){const b=S*3;_.x=e[b+0],_.y=e[b+1],_.z=e[b+2]}function v(){const S=new F,_=new F,b=new F,A=new F,R=new ge,P=new ge,D=new ge;for(let V=0,C=0;V80*t){a=u=n[0],l=f=n[1];for(let v=t;vu&&(u=h),p>f&&(f=p);m=Math.max(u-a,f-l),m=m!==0?32767/m:0}return Oh(s,o,t,a,l,m,0),o}};function pI(n,e,t,r,i){let s,o;if(i===W8(n,e,t,r)>0)for(s=e;s=e;s-=r)o=SA(s,n[s],n[s+1],o);return o&&fy(o,o.next)&&(Uh(o),o=o.next),o}function _c(n,e){if(!n)return n;e||(e=n);let t=n,r;do if(r=!1,!t.steiner&&(fy(t,t.next)||Pn(t.prev,t,t.next)===0)){if(Uh(t),t=e=t.prev,t===t.next)break;r=!0}else t=t.next;while(r||t!==e);return e}function Oh(n,e,t,r,i,s,o){if(!n)return;!o&&s&&F8(n,r,i,s);let a=n,l,u;for(;n.prev!==n.next;){if(l=n.prev,u=n.next,s?P8(n,r,i,s):R8(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(u.i/t|0),Uh(n),n=u.next,a=u.next;continue}if(n=u,n===a){o?o===1?(n=I8(_c(n),e,t),Oh(n,e,t,r,i,s,2)):o===2&&L8(n,e,t,r,i,s):Oh(_c(n),e,t,r,i,s,1);break}}}function R8(n){const e=n.prev,t=n,r=n.next;if(Pn(e,t,r)>=0)return!1;const i=e.x,s=t.x,o=r.x,a=e.y,l=t.y,u=r.y,f=is?i>o?i:o:s>o?s:o,m=a>l?a>u?a:u:l>u?l:u;let v=r.next;for(;v!==e;){if(v.x>=f&&v.x<=p&&v.y>=h&&v.y<=m&&Vu(i,a,s,l,o,u,v.x,v.y)&&Pn(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function P8(n,e,t,r){const i=n.prev,s=n,o=n.next;if(Pn(i,s,o)>=0)return!1;const a=i.x,l=s.x,u=o.x,f=i.y,h=s.y,p=o.y,m=al?a>u?a:u:l>u?l:u,x=f>h?f>p?f:p:h>p?h:p,g=b1(m,v,e,t,r),S=b1(w,x,e,t,r);let _=n.prevZ,b=n.nextZ;for(;_&&_.z>=g&&b&&b.z<=S;){if(_.x>=m&&_.x<=w&&_.y>=v&&_.y<=x&&_!==i&&_!==o&&Vu(a,f,l,h,u,p,_.x,_.y)&&Pn(_.prev,_,_.next)>=0||(_=_.prevZ,b.x>=m&&b.x<=w&&b.y>=v&&b.y<=x&&b!==i&&b!==o&&Vu(a,f,l,h,u,p,b.x,b.y)&&Pn(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;_&&_.z>=g;){if(_.x>=m&&_.x<=w&&_.y>=v&&_.y<=x&&_!==i&&_!==o&&Vu(a,f,l,h,u,p,_.x,_.y)&&Pn(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;b&&b.z<=S;){if(b.x>=m&&b.x<=w&&b.y>=v&&b.y<=x&&b!==i&&b!==o&&Vu(a,f,l,h,u,p,b.x,b.y)&&Pn(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function I8(n,e,t){let r=n;do{const i=r.prev,s=r.next.next;!fy(i,s)&&mI(i,r,r.next,s)&&kh(i,s)&&kh(s,i)&&(e.push(i.i/t|0),e.push(r.i/t|0),e.push(s.i/t|0),Uh(r),Uh(r.next),r=n=s),r=r.next}while(r!==n);return _c(r)}function L8(n,e,t,r,i,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&V8(o,a)){let l=gI(o,a);o=_c(o,o.next),l=_c(l,l.next),Oh(o,e,t,r,i,s,0),Oh(l,e,t,r,i,s,0);return}a=a.next}o=o.next}while(o!==n)}function D8(n,e,t,r){const i=[];let s,o,a,l,u;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const p=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=s&&p>r&&(r=p,i=t.x=t.x&&t.x>=l&&s!==t.x&&Vu(oi.x||t.x===i.x&&U8(i,t)))&&(i=t,f=h)),t=t.next;while(t!==a);return i}function U8(n,e){return Pn(n.prev,n,e.prev)<0&&Pn(e.next,n,n.next)<0}function F8(n,e,t,r){let i=n;do i.z===0&&(i.z=b1(i.x,i.y,e,t,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==n);i.prevZ.nextZ=null,i.prevZ=null,z8(i)}function z8(n){let e,t,r,i,s,o,a,l,u=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,r=t,a=0,e=0;e0||l>0&&r;)a!==0&&(l===0||!r||t.z<=r.z)?(i=t,t=t.nextZ,a--):(i=r,r=r.nextZ,l--),s?s.nextZ=i:n=i,i.prevZ=s,s=i;t=r}s.nextZ=null,u*=2}while(o>1);return n}function b1(n,e,t,r,i){return n=(n-t)*i|0,e=(e-r)*i|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function B8(n){let e=n,t=n;do(e.x=(n-o)*(s-a)&&(n-o)*(r-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(i-o)*(r-a)}function V8(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!H8(n,e)&&(kh(n,e)&&kh(e,n)&&$8(n,e)&&(Pn(n.prev,n,e.prev)||Pn(n,e.prev,e))||fy(n,e)&&Pn(n.prev,n,n.next)>0&&Pn(e.prev,e,e.next)>0)}function Pn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function fy(n,e){return n.x===e.x&&n.y===e.y}function mI(n,e,t,r){const i=zg(Pn(n,e,t)),s=zg(Pn(n,e,r)),o=zg(Pn(t,r,n)),a=zg(Pn(t,r,e));return!!(i!==s&&o!==a||i===0&&Fg(n,t,e)||s===0&&Fg(n,r,e)||o===0&&Fg(t,n,r)||a===0&&Fg(t,e,r))}function Fg(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function zg(n){return n>0?1:n<0?-1:0}function H8(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&mI(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function kh(n,e){return Pn(n.prev,n,n.next)<0?Pn(n,e,n.next)>=0&&Pn(n,n.prev,e)>=0:Pn(n,e,n.prev)<0||Pn(n,n.next,e)<0}function $8(n,e){let t=n,r=!1;const i=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==n);return r}function gI(n,e){const t=new T1(n.i,n.x,n.y),r=new T1(e.i,e.x,e.y),i=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=i,i.prev=t,r.next=t,t.prev=r,s.next=r,r.prev=s,r}function SA(n,e,t,r){const i=new T1(n,e,t);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Uh(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function T1(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function W8(n,e,t,r){let i=0;for(let s=e,o=t-r;s2&&n[e-1].equals(n[0])&&n.pop()}function EA(n,e){for(let t=0;tNumber.EPSILON){const _e=Math.sqrt(be),Ke=Math.sqrt(O*O+ie*ie),Fe=xe.x-k/_e,He=xe.y+ze/_e,st=de.x-ie/Ke,mt=de.y+O/Ke,Ee=((st-Fe)*ie-(mt-He)*O)/(ze*ie-k*O);Te=Fe+ze*Ee-H.x,ye=He+k*Ee-H.y;const Nt=Te*Te+ye*ye;if(Nt<=2)return new ge(Te,ye);Xe=Math.sqrt(Nt/2)}else{let _e=!1;ze>Number.EPSILON?O>Number.EPSILON&&(_e=!0):ze<-Number.EPSILON?O<-Number.EPSILON&&(_e=!0):Math.sign(k)===Math.sign(ie)&&(_e=!0),_e?(Te=-k,ye=ze,Xe=Math.sqrt(be)):(Te=ze,ye=k,Xe=Math.sqrt(be/2))}return new ge(Te/Xe,ye/Xe)}const X=[];for(let H=0,xe=z.length,de=xe-1,Te=H+1;H=0;H--){const xe=H/x,de=m*Math.cos(xe*Math.PI/2),Te=v*Math.sin(xe*Math.PI/2)+w;for(let ye=0,Xe=z.length;ye=0;){const Te=de;let ye=de-1;ye<0&&(ye=H.length-1);for(let Xe=0,ze=f+x*2;Xe0)&&m.push(_,b,R),(g!==r-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class SI extends br{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Be(16777215),this.specular=new Be(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Be(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fl,this.normalScale=new ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Fp,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class wI extends br{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Be(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Be(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fl,this.normalScale=new ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class EI extends br{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fl,this.normalScale=new ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class MI extends br{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Be(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Be(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fl,this.normalScale=new ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Fp,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class bI extends br{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Be(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fl,this.normalScale=new ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class TI extends ni{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function Yl(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function CI(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function AI(n){function e(i,s){return n[i]-n[s]}const t=n.length,r=new Array(t);for(let i=0;i!==t;++i)r[i]=i;return r.sort(e),r}function C1(n,e,t){const r=n.length,i=new n.constructor(r);for(let s=0,o=0;o!==r;++s){const a=t[s]*e;for(let l=0;l!==e;++l)i[o++]=n[a+l]}return i}function VE(n,e,t,r){let i=1,s=n[0];for(;s!==void 0&&s[r]===void 0;)s=n[i++];if(s===void 0)return;let o=s[r];if(o!==void 0)if(Array.isArray(o))do o=s[r],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[i++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[r],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[i++];while(s!==void 0);else do o=s[r],o!==void 0&&(e.push(s.time),t.push(o)),s=n[i++];while(s!==void 0)}function q8(n,e,t,r,i=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l=r)){h.push(u.times[m]);for(let w=0;ws.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[v]){const g=v*h+f,S=g+h-f;w=a.values.slice(g,S)}else{const g=a.createInterpolant(),S=f,_=h-f;g.evaluate(s),w=g.resultBuffer.slice(S,_)}l==="quaternion"&&new Br().fromArray(w).normalize().conjugate().toArray(w);const x=u.times.length;for(let g=0;g=s)){const a=t[1];e=s)break t}o=r,r=0;break n}break e}for(;r>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=r.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,s=r.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=r[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&CI(i))for(let a=0,l=i.length;a!==l;++a){const u=i[a];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===Av,s=e.length-1;let o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*r,l=o*r,u=0;u!==r;++u)t[l+u]=t[a+u];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*r)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),r=this.constructor,i=new r(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}Os.prototype.TimeBufferType=Float32Array;Os.prototype.ValueBufferType=Float32Array;Os.prototype.DefaultInterpolation=bh;class Nc extends Os{}Nc.prototype.ValueTypeName="bool";Nc.prototype.ValueBufferType=Array;Nc.prototype.DefaultInterpolation=Mh;Nc.prototype.InterpolantFactoryMethodLinear=void 0;Nc.prototype.InterpolantFactoryMethodSmooth=void 0;class $E extends Os{}$E.prototype.ValueTypeName="color";class Fh extends Os{}Fh.prototype.ValueTypeName="number";class II extends Xp{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e,t,r,i){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(r-t)/(i-t);let u=e*a;for(let f=u+a;u!==f;u+=4)Br.slerpFlat(s,0,o,u-a,o,u,l);return s}}class Yd extends Os{InterpolantFactoryMethodLinear(e){return new II(this.times,this.values,this.getValueSize(),e)}}Yd.prototype.ValueTypeName="quaternion";Yd.prototype.DefaultInterpolation=bh;Yd.prototype.InterpolantFactoryMethodSmooth=void 0;class Oc extends Os{}Oc.prototype.ValueTypeName="string";Oc.prototype.ValueBufferType=Array;Oc.prototype.DefaultInterpolation=Mh;Oc.prototype.InterpolantFactoryMethodLinear=void 0;Oc.prototype.InterpolantFactoryMethodSmooth=void 0;class zh extends Os{}zh.prototype.ValueTypeName="vector";class Bh{constructor(e,t=-1,r,i=K0){this.name=e,this.tracks=r,this.duration=t,this.blendMode=i,this.uuid=Li(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],r=e.tracks,i=1/(e.fps||1);for(let o=0,a=r.length;o!==a;++o)t.push(Q8(r[o]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=r.length;s!==o;++s)t.push(Os.toJSON(r[s]));return i}static CreateFromMorphTargetSequence(e,t,r,i){const s=t.length,o=[];for(let a=0;a1){const h=f[1];let p=i[h];p||(i[h]=p=[]),p.push(u)}}const o=[];for(const a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,r));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(h,p,m,v,w){if(m.length!==0){const x=[],g=[];VE(m,x,g,v),x.length!==0&&w.push(new h(p,x,g))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let h=0;h{t&&t(s),this.manager.itemEnd(e)},0),s;if(Ao[e]!==void 0){Ao[e].push({onLoad:t,onProgress:r,onError:i});return}Ao[e]=[],Ao[e].push({onLoad:t,onProgress:r,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const f=Ao[e],h=u.body.getReader(),p=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),m=p?parseInt(p):0,v=m!==0;let w=0;const x=new ReadableStream({start(g){S();function S(){h.read().then(({done:_,value:b})=>{if(_)g.close();else{w+=b.byteLength;const A=new ProgressEvent("progress",{lengthComputable:v,loaded:w,total:m});for(let R=0,P=f.length;R{switch(l){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(f=>new DOMParser().parseFromString(f,a));case"json":return u.json();default:if(a===void 0)return u.text();{const h=/charset="?([^;"\s]*)"?/i.exec(a),p=h&&h[1]?h[1].toLowerCase():void 0,m=new TextDecoder(p);return u.arrayBuffer().then(v=>m.decode(v))}}}).then(u=>{Uo.add(e,u);const f=Ao[e];delete Ao[e];for(let h=0,p=f.length;h{const f=Ao[e];if(f===void 0)throw this.manager.itemError(e),u;delete Ao[e];for(let h=0,p=f.length;h{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class eH extends vi{constructor(e){super(e)}load(e,t,r,i){const s=this,o=new jo(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},r,i)}parse(e){const t=[];for(let r=0;r0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=r(o.value);break;case"c":i.uniforms[s].value=new Be().setHex(o.value);break;case"v2":i.uniforms[s].value=new ge().fromArray(o.value);break;case"v3":i.uniforms[s].value=new F().fromArray(o.value);break;case"v4":i.uniforms[s].value=new on().fromArray(o.value);break;case"m3":i.uniforms[s].value=new Vt().fromArray(o.value);break;case"m4":i.uniforms[s].value=new _t().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(i.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)i.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(i.lights=e.lights),e.clipping!==void 0&&(i.clipping=e.clipping),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=r(e.map)),e.matcap!==void 0&&(i.matcap=r(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=r(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=r(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=r(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new ge().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=r(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=r(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=r(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=r(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=r(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=r(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=r(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=r(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=r(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=r(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=r(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=r(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=r(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new ge().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(i.iridescenceMap=r(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=r(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(i.transmissionMap=r(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=r(e.thicknessMap)),e.anisotropyMap!==void 0&&(i.anisotropyMap=r(e.anisotropyMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=r(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=r(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:yI,SpriteMaterial:LE,RawShaderMaterial:xI,ShaderMaterial:as,PointsMaterial:NE,MeshPhysicalMaterial:_I,MeshStandardMaterial:Sy,MeshPhongMaterial:SI,MeshToonMaterial:wI,MeshNormalMaterial:EI,MeshLambertMaterial:MI,MeshDepthMaterial:RE,MeshDistanceMaterial:PE,MeshBasicMaterial:hl,MeshMatcapMaterial:bI,LineDashedMaterial:TI,LineBasicMaterial:ni,Material:br};return new t[e]}}class A1{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let r=0,i=e.length;r0){const l=new WE(t);s=new Vh(l),s.setCrossOrigin(this.crossOrigin);for(let u=0,f=e.length;u0){i=new Vh(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const x=new Qr;x.min.fromArray(w.boxMin),x.max.fromArray(w.boxMax);const g=new Vr;return g.radius=w.sphereRadius,g.center.fromArray(w.sphereCenter),{boxInitialized:w.boxInitialized,box:x,sphereInitialized:w.sphereInitialized,sphere:g}}),o._maxGeometryCount=e.maxGeometryCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=u(e.matricesTexture.uuid);break;case"LOD":o=new nI;break;case"Line":o=new rl(a(e.geometry),l(e.material));break;case"LineLoop":o=new oI(a(e.geometry),l(e.material));break;case"LineSegments":o=new go(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new aI(a(e.geometry),l(e.material));break;case"Sprite":o=new tI(l(e.material));break;case"Group":o=new Bu;break;case"Bone":o=new DE;break;default:o=new sn}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const p=e.children;for(let m=0;m"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Uo.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(u=>{t&&t(u),s.manager.itemEnd(e)}).catch(u=>{i&&i(u)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){return Uo.add(e,u),t&&t(u),s.manager.itemEnd(e),u}).catch(function(u){i&&i(u),Uo.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});Uo.add(e,l),s.manager.itemStart(e)}}let Bg;class jE{static getContext(){return Bg===void 0&&(Bg=new(window.AudioContext||window.webkitAudioContext)),Bg}static setContext(e){Bg=e}}class dH extends vi{constructor(e){super(e)}load(e,t,r,i){const s=this,o=new jo(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const u=l.slice(0);jE.getContext().decodeAudioData(u,function(h){t(h)}).catch(a)}catch(u){a(u)}},r,i);function a(l){i?i(l):console.error(l),s.manager.itemError(e)}}}const IA=new _t,LA=new _t,Dl=new _t;class fH{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Rn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Rn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Dl.copy(e.projectionMatrix);const i=t.eyeSep/2,s=i*t.near/t.focus,o=t.near*Math.tan(uc*t.fov*.5)/t.zoom;let a,l;LA.elements[12]=-i,IA.elements[12]=i,a=-o*t.aspect+s,l=o*t.aspect+s,Dl.elements[0]=2*t.near/(l-a),Dl.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Dl),a=-o*t.aspect-s,l=o*t.aspect-s,Dl.elements[0]=2*t.near/(l-a),Dl.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Dl)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(LA),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(IA)}}class qp{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=DA(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=DA();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function DA(){return(typeof performance>"u"?Date:performance).now()}const Nl=new F,NA=new Br,hH=new F,Ol=new F;class pH extends sn{constructor(){super(),this.type="AudioListener",this.context=jE.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new qp}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Nl,NA,hH),Ol.set(0,0,-1).applyQuaternion(NA),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Nl.x,i),t.positionY.linearRampToValueAtTime(Nl.y,i),t.positionZ.linearRampToValueAtTime(Nl.z,i),t.forwardX.linearRampToValueAtTime(Ol.x,i),t.forwardY.linearRampToValueAtTime(Ol.y,i),t.forwardZ.linearRampToValueAtTime(Ol.z,i),t.upX.linearRampToValueAtTime(r.x,i),t.upY.linearRampToValueAtTime(r.y,i),t.upZ.linearRampToValueAtTime(r.z,i)}else t.setPosition(Nl.x,Nl.y,Nl.z),t.setOrientation(Ol.x,Ol.y,Ol.z,r.x,r.y,r.z)}}let $I=class extends sn{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(r,i,this._addIndex*t,1,t);for(let l=t,u=t+t;l!==u;++l)if(r[l]!==r[l+t]){a.setValue(r,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,r=this.valueSize,i=r*this._origIndex;e.getValue(t,i);for(let s=r,o=i;s!==o;++s)t[s]=t[i+s%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let r=e;r=.5)for(let o=0;o!==s;++o)e[t+o]=e[r+o]}_slerp(e,t,r,i){Br.slerpFlat(e,t,e,t,e,r,i)}_slerpAdditive(e,t,r,i,s){const o=this._workIndex*s;Br.multiplyQuaternionsFlat(e,o,e,t,e,r),Br.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,r,i,s){const o=1-i;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[r+a]*i}}_lerpAdditive(e,t,r,i,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[r+o]*i}}}const XE="\\[\\]\\.:\\/",yH=new RegExp("["+XE+"]","g"),qE="[^"+XE+"]",xH="[^"+XE.replace("\\.","")+"]",_H=/((?:WC+[\/:])*)/.source.replace("WC",qE),SH=/(WCOD+)?/.source.replace("WCOD",xH),wH=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",qE),EH=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",qE),MH=new RegExp("^"+_H+SH+wH+EH+"$"),bH=["material","materials","bones","map"];class TH{constructor(e,t,r){const i=r||Qt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,t)}setValue(e,t){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=r.length;i!==s;++i)r[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}}class Qt{constructor(e,t,r){this.path=t,this.parsedPath=r||Qt.parseTrackName(t),this.node=Qt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new Qt.Composite(e,t,r):new Qt(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(yH,"")}static parseTrackName(e){const t=MH.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=r.nodeName.substring(i+1);bH.indexOf(s)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=s)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(t);if(r!==void 0)return r}if(e.children){const r=function(s){for(let o=0;o=s){const h=s++,p=e[h];t[p.uuid]=f,e[f]=p,t[u]=h,e[h]=l;for(let m=0,v=i;m!==v;++m){const w=r[m],x=w[h],g=w[f];w[f]=x,w[h]=g}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,r=this._bindings,i=r.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const u=arguments[a],f=u.uuid,h=t[f];if(h!==void 0)if(delete t[f],h0&&(t[m.uuid]=h),e[h]=m,e.pop();for(let v=0,w=i;v!==w;++v){const x=r[v];x[h]=x[p],x.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const r=this._bindingsIndicesByPath;let i=r[e];const s=this._bindings;if(i!==void 0)return s[i];const o=this._paths,a=this._parsedPaths,l=this._objects,u=l.length,f=this.nCachedObjects_,h=new Array(u);i=s.length,r[e]=i,o.push(e),a.push(t),s.push(h);for(let p=f,m=l.length;p!==m;++p){const v=l[p];h[p]=new Qt(v,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,r=t[e];if(r!==void 0){const i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],u=e[a];t[u]=r,o[r]=l,o.pop(),s[r]=s[a],s.pop(),i[r]=i[a],i.pop()}}}class GI{constructor(e,t,r=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=r,this.blendMode=i;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:jl,endingEnd:jl};for(let u=0;u!==o;++u){const f=s[u].createInterpolant(null);a[u]=f,f.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=M3,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,r){if(e.fadeOut(t),this.fadeIn(t),r){const i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,r){return e.crossFadeFrom(this,t,r)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,r){const i=this._mixer,s=i.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,u=a.sampleValues;return l[0]=s,l[1]=s+r,u[0]=e/o,u[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,r,i){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*r;l<0||r===0?t=0:(this._startTime=null,t=r*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case _E:for(let f=0,h=l.length;f!==h;++f)l[f].evaluate(o),u[f].accumulateAdditive(a);break;case K0:default:for(let f=0,h=l.length;f!==h;++f)l[f].evaluate(o),u[f].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const r=this._weightInterpolant;if(r!==null){const i=r.evaluate(e)[0];t*=i,e>r.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const r=this._timeScaleInterpolant;if(r!==null){const i=r.evaluate(e)[0];t*=i,e>r.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,r=this.loop;let i=this.time+e,s=this._loopCount;const o=r===b3;if(e===0)return s===-1?i:o&&(s&1)===1?t-i:i;if(r===E3){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){const a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const u=e<0;this._setEndings(u,!u,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)===1)return t-i}return i}_setEndings(e,t,r){const i=this._interpolantSettings;r?(i.endingStart=Xl,i.endingEnd=Xl):(e?i.endingStart=this.zeroSlopeAtStart?Xl:jl:i.endingStart=Th,t?i.endingEnd=this.zeroSlopeAtEnd?Xl:jl:i.endingEnd=Th)}_scheduleFading(e,t,r){const i=this._mixer,s=i.time;let o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=r,this}}const AH=new Float32Array(1);class RH extends mo{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const r=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,l=r.uuid,u=this._bindingsByRootAndName;let f=u[l];f===void 0&&(f={},u[l]=f);for(let h=0;h!==s;++h){const p=i[h],m=p.name;let v=f[m];if(v!==void 0)++v.referenceCount,o[h]=v;else{if(v=o[h],v!==void 0){v._cacheIndex===null&&(++v.referenceCount,this._addInactiveBinding(v,l,m));continue}const w=t&&t._propertyBindings[h].binding.parsedPath;v=new WI(Qt.create(r,m,w),p.ValueTypeName,p.getValueSize()),++v.referenceCount,this._addInactiveBinding(v,l,m),o[h]=v}a[h].resultBuffer=v.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const r=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,r)}const t=e._propertyBindings;for(let r=0,i=t.length;r!==i;++r){const s=t[r];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let r=0,i=t.length;r!==i;++r){const s=t[r];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;const t=this._actions,r=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let u=0;u!==r;++u)t[u]._update(i,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let u=0;u!==l;++u)a[u].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,UA).distanceTo(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}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 FA=new F,Vg=new F;class kH{constructor(e=new F,t=new F){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){FA.subVectors(e,this.start),Vg.subVectors(this.end,this.start);const r=Vg.dot(Vg);let s=Vg.dot(FA)/r;return t&&(s=zn(s,0,1)),s}closestPointToPoint(e,t,r){const i=this.closestPointToPointParameter(e,t);return this.delta(r).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const zA=new F;class UH extends sn{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const r=new Ut,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let h=0;h.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{WA.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(WA,t)}}setLength(e,t=e*.2,r=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(r,t,r),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class ZH extends go{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new Ut;i.setAttribute("position",new ot(t,3)),i.setAttribute("color",new ot(r,3));const s=new ni({vertexColors:!0,toneMapped:!1});super(i,s),this.type="AxesHelper"}setColors(e,t,r){const i=new Be,s=this.geometry.attributes.color.array;return i.set(e),i.toArray(s,0),i.toArray(s,3),i.set(t),i.toArray(s,6),i.toArray(s,9),i.set(r),i.toArray(s,12),i.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class KH{constructor(){this.type="ShapePath",this.color=new Be,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Nh,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,r,i){return this.currentPath.quadraticCurveTo(e,t,r,i),this}bezierCurveTo(e,t,r,i,s,o){return this.currentPath.bezierCurveTo(e,t,r,i,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(g){const S=[];for(let _=0,b=g.length;_Number.EPSILON){if(C<0&&(P=S[R],V=-V,D=S[A],C=-C),g.yD.y)continue;if(g.y===P.y){if(g.x===P.x)return!0}else{const L=C*(g.x-P.x)-V*(g.y-P.y);if(L===0)return!0;if(L<0)continue;b=!b}}else{if(g.y!==P.y)continue;if(D.x<=g.x&&g.x<=P.x||P.x<=g.x&&g.x<=D.x)return!0}}return b}const i=lo.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const u=[];if(s.length===1)return a=s[0],l=new hc,l.curves=a.curves,u.push(l),u;let f=!i(s[0].getPoints());f=e?!f:f;const h=[],p=[];let m=[],v=0,w;p[v]=void 0,m[v]=[];for(let g=0,S=s.length;g1){let g=!1,S=0;for(let _=0,b=p.length;_0&&g===!1&&(m=h)}let x;for(let g=0,S=p.length;gthis.map[l][0]&&a<=this.map[l+1][0]){const u=this.map[l][0],f=this.map[l+1][0];i.setHex(this.map[l][1],di),s.setHex(this.map[l+1][1],di);const h=new Be().lerpColors(i,s,(a-u)/(f-u));this.lut.push(h)}}return this.lut.push(new Be(this.map[this.map.length-1][1])),this}copy(e){return this.lut=e.lut,this.map=e.map,this.n=e.n,this.minV=e.minV,this.maxV=e.maxV,this}getColor(e){e=k3.clamp(e,this.minV,this.maxV),e=(e-this.minV)/(this.maxV-this.minV);const t=Math.round(e*this.n);return this.lut[t]}addColorMap(e,t){return $_[e]=t,this}createCanvas(){const e=document.createElement("canvas");return e.width=1,e.height=this.n,this.updateCanvas(e),e}updateCanvas(e){const t=e.getContext("2d",{alpha:!1}),r=t.getImageData(0,0,1,this.n),i=r.data;let s=0;const o=1/this.n,a=new Be,l=new Be,u=new Be;for(let f=1;f>=0;f-=o)for(let h=this.map.length-1;h>=0;h--)if(f=this.map[h-1][0]){const p=this.map[h-1][0],m=this.map[h][0];a.setHex(this.map[h-1][1],di),l.setHex(this.map[h][1],di),u.lerpColors(a,l,(f-p)/(m-p)),i[s*4]=Math.round(u.r*255),i[s*4+1]=Math.round(u.g*255),i[s*4+2]=Math.round(u.b*255),i[s*4+3]=255,s+=1}return t.putImageData(r,0,0),e}}const $_={rainbow:[[0,255],[.2,65535],[.5,65280],[.8,16776960],[1,16711680]],cooltowarm:[[0,3952322],[.2,10206463],[.5,14474460],[.8,16163717],[1,11797542]],blackbody:[[0,0],[.2,7864320],[.5,15086080],[.8,16776960],[1,16777215]],grayscale:[[0,0],[.2,4210752],[.5,8355712],[.8,12566463],[1,16777215]]},At={THREE_RAINBOW:"rainbow",THREE_COOL_TO_WARM:"cooltowarm",WARM:"Warm",WARM_2:"Warm_2",WARM_3:"Warm_3",SAND:"Sand",SAND_2:"Sand_2",SAND_3:"Sand_3",SAND_4:"Sand_4",SAND_5:"Sand_5",NATURAL:"Natural",NATURAL_2:"Natural_2",CIRCUS:"Circus",SEASIDE:"Seaside",DRAGON:"Dragon"},lh=[At.THREE_COOL_TO_WARM,At.THREE_RAINBOW,At.WARM,At.WARM_2,At.WARM_3,At.SAND,At.SAND_2,At.SAND_3,At.SAND_4,At.SAND_5,At.NATURAL,At.NATURAL_2,At.CIRCUS,At.SEASIDE,At.DRAGON],W_=(n,e,t)=>t<=0?n:t>=1?e:n+t*(e-n);class GA{constructor(e){at(this,"colors");at(this,"getAt",e=>{e=Math.min(1,Math.max(0,e));const t=Math.floor(e*this.colors.length*.9999),r=Math.min(this.colors.length-1,Math.max(0,t+1)),i=this.colors[t],s=this.colors[r],o=(e-t/this.colors.length)/(1/this.colors.length);return new Be().setRGB(W_(i.r,s.r,o),W_(i.g,s.g,o),W_(i.b,s.b,o),Fn)});this.colors=e.colors.map(t=>new Be(t))}}class Wn{constructor(e,t){at(this,"name");at(this,"colors");at(this,"buildLut",()=>{const e=new e$;return e.addColorMap(this.name,this.colorsHex.map((t,r)=>[r/(this.nColors-1),t])),e.setColorMap(this.name),e});at(this,"calcBackgroundColor",(e=.5)=>{const r=new GA(this).getAt(e),i={h:0,s:0,l:0};return r.getHSL(i,Fn),i.s=Math.min(i.s,.5),r.setHSL(i.h,i.s,i.l,Fn),r});at(this,"lerpColor",e=>{const t=Math.min(1,Math.max(0,e));return new GA(this).getAt(t)});if(this.name=e,t.length<2)throw new Error("Not enough colors");this.colors=[...t]}get colorsHex(){return this.colors.map(e=>new Be(e).getHex())}get nColors(){return this.colors.length}static getPalette(e){switch(e){case At.WARM:return new Wn(At.WARM,["#FF2000","#FF5900","#FE9100","#FEFDFC","#FEC194","#FE9F5B"]);case At.WARM_2:return new Wn("Warm_2",["#FFFEFE","#0D0211","#FBCEA0","#FFAD5D","#530E1D","#FE9232","#B93810","#907996"]);case At.WARM_3:return new Wn(At.WARM_3,["#EDEBE7","#13595A","#DE1408","#161814","#E1610A","#B7BDB3","#9F9772"]);case At.SAND:return new Wn(At.SAND,["#b8987a","#caa87f","#dfb98a","#ebc99c","#f3ddb0","#f9e6c1","#fff3d7"]);case At.SAND_2:return new Wn(At.SAND_2,["#f2ead6","#327172","#2d3e58","#f47e72","#f2cab1"]);case At.SAND_3:return new Wn(At.SAND_3,["#f1e2c3","#8595a4","#8d4f2a","#d86b28","#eca956"]);case At.SAND_4:return new Wn(At.SAND_4,["#242112","#684f27","#9a733a","#ac8f56","#e5a752","#fdbe6e","#ffd28f"]);case At.SAND_5:return new Wn(At.SAND_5,["#44200a","#75380c","#9e5922","#b96525","#da863d","#f5ad63","#fec37d"]);case At.NATURAL:return new Wn(At.NATURAL,["#FF6D00","#FBF8EB","#008B99","#F8E1A6","#FDA81F","#B80A01","#480D07"]);case At.NATURAL_2:return new Wn(At.NATURAL_2,["#EF2006","#350000","#A11104","#ED5910","#F1B52E","#7B5614","#F7F1AC"]);case At.CIRCUS:return new Wn(At.CIRCUS,["#F62D62","#FFFFFF","#FDB600","#F42D2D","#544C98","#ECACBC"]);case At.SEASIDE:return new Wn(At.SEASIDE,["#FEB019","#F46002","#E1E7F1","#0A1D69","#138FE2","#0652C4","#D23401","#B0A12F"]);case At.DRAGON:return new Wn(At.DRAGON,["#F2E9D9","#101010","#EA4B04","#B6AC9E","#5A5754","#837F7A","#E78E36","#552509"]);case At.THREE_RAINBOW:return new Wn(At.THREE_RAINBOW,["#0000FF","#00FFFF","#00FF00","#FFFF00","#FF0000"]);case At.THREE_COOL_TO_WARM:return new Wn(At.THREE_COOL_TO_WARM,["#3c4ec2","#9bbcff","#dcdcdc","#f6a385","#b40426"]);default:return e}}static random(e=lh){return Wn.getPalette(e[Math.floor(Math.random()*e.length)])}}const Zd=s4((n,e)=>({user:{canvasInteractionEventTracker:new JH},visual:{palette:At.THREE_COOL_TO_WARM},visualSourceData:{x:new Float32Array(121).fill(0),y:new Float32Array(121).fill(0)},energyInfo:{current:0},actions:{noteCanvasInteraction:()=>n(t=>(t.user.canvasInteractionEventTracker.addEvent(),{user:{canvasInteractionEventTracker:t.user.canvasInteractionEventTracker}})),setPalette:t=>n(r=>({visual:{palette:t}})),nextPalette:()=>n(t=>{const i=((lh.indexOf(t.visual.palette)??0)+1)%lh.length;return{visual:{palette:lh[i]}}}),resizeVisualSourceData:t=>n(r=>({visualSourceData:{x:new Float32Array(t).fill(0),y:new Float32Array(t).fill(0)}}))}})),t$=()=>Zd(n=>n.user),YE=()=>Zd(n=>n.visual.palette),Ey=()=>Zd(n=>n.visualSourceData.x),qI=()=>Zd(n=>n.visualSourceData.y),ZE=()=>Zd(n=>n.energyInfo),Kd=()=>Zd(n=>n.actions),YI=({analyzer:n})=>{const{octaveBandMode:e,energyMeasure:t}=dE(),r=Ey(),i=ZE(),{resizeVisualSourceData:s}=Kd(),o=M.useRef(null),a=M.useCallback(()=>{const l=n.getBars();if(r.length!=l.length){console.log(`Resizing ${l.length}`),s(l.length);return}i.current=n.getEnergy(t),l.forEach(({value:u},f)=>{r[f]=u})},[r,n,s,i,t]);return M.useEffect(()=>{o.current&&cancelAnimationFrame(o.current);const l=()=>{a(),o.current=requestAnimationFrame(l)};return o.current=requestAnimationFrame(l),()=>cancelAnimationFrame(o.current)},[r,t,a]),M.useEffect(()=>{n.mode=e},[e,n]),N.jsx(N.Fragment,{})},Jn={FILE_UPLOAD:"FILE_UPLOAD",MICROPHONE:"MICROPHONE",SOUNDCLOUD:"SOUNDCLOUD",SCREEN_SHARE:"SCREEN_SHARE"},ZI=()=>{var n;return navigator.platform.toLowerCase().startsWith("ip")?!0:((n=navigator.userAgent)==null?void 0:n.toLowerCase().startsWith("mac"))&&"ontouchend"in document},KI=()=>[Jn.SOUNDCLOUD,Jn.MICROPHONE,Jn.FILE_UPLOAD,Jn.SCREEN_SHARE],QI=()=>{console.log("Building audio...");const n=new Audio;return n.crossOrigin="anonymous",n},n$=n=>new Promise(function(e,t){const r=["mousedown","touchstart","touchend"];if(n.state==="suspended"&&"ontouchstart"in window){const i=function(){n.resume().then(function(){r.forEach(s=>{document.body.removeEventListener(s,i)}),e(!0)},function(s){t(s)})};r.forEach(s=>{document.body.addEventListener(s,i,!1)})}else e(!1)}),JI=()=>{console.log("Building audioCtx...");const n=new window.AudioContext;return ZI()&&(console.log("Attempting to unlock AudioContext"),n$(n).then(function(e){console.log(e?"Successfully unlocked AudioContext!":"No need to unlock AudioContext.")},function(e){console.error(e)})),n};const r$=n=>{const[e,t]=M.useState(!1),[r,i]=M.useState(!1),s=null,o=M.useCallback(()=>{},[n,s]);return M.useEffect(()=>{console.log("Syncing, start w/ pause..."),n.pause(),t(!1);{i(!1);return}},[n,s,o]),{loaded:r,isPlaying:e,playAudio:o}},i$=({audio:n})=>{const{loaded:e,isPlaying:t,playAudio:r}=r$(n);return ZI()?N.jsx("div",{id:"info",style:{top:"1rem",left:"1rem"},hidden:t,children:e?N.jsx("button",{disabled:!e||t,onClick:r,children:"Play Audio"}):N.jsxs(N.Fragment,{children:[N.jsx("h2",{children:"Load a file"}),N.jsx("p",{children:"Use the controls panel to upload an audio file."})]})}):N.jsx(N.Fragment,{})},Rt={WAVE_FORM:"WAVE_FORM",NOISE:"NOISE",AUDIO:"AUDIO",AUDIO_SCOPE:"AUDIO_SCOPE",PARTICLE_NOISE:"PARTICLE_NOISE"},s$=n=>{switch(n){case Rt.WAVE_FORM:case Rt.NOISE:case Rt.PARTICLE_NOISE:return!1;case Rt.AUDIO:case Rt.AUDIO_SCOPE:return!0;default:return n}},o$=()=>[Rt.WAVE_FORM,Rt.NOISE,Rt.AUDIO],a$=n=>{switch(n){case Rt.WAVE_FORM:case Rt.NOISE:case Rt.AUDIO:case Rt.PARTICLE_NOISE:return!0;case Rt.AUDIO_SCOPE:return!1;default:return n}},KE=M.createContext(null),l$=({children:n})=>{const[e,t]=M.useState(Rt.WAVE_FORM),[r,i]=M.useState(!0);return N.jsx(KE.Provider,{value:{config:{mode:e,showUI:r},setters:{setMode:t,setShowUI:i}},children:n})};function kc(){const n=M.useContext(KE);if(!n)throw new Error("useModeContext must be used within a ModeContextProvider");return n.config}function eL(){const n=M.useContext(KE);if(!n)throw new Error("useModeContext must be used within a ModeContextProvider");return n.setters}const QE=M.createContext(null),c$=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.track)??null);return N.jsx(QE.Provider,{value:{config:{track:t},setters:{setTrack:r}},children:e})};function u$(){const n=M.useContext(QE);if(!n)throw new Error("useSoundcloudContext must be used within a SoundcloudContextProvider");return n.config}function d$(){const n=M.useContext(QE);if(!n)throw new Error("useSoundcloudContext must be used within a SoundcloudContextProvider");return n.setters}var rn;(function(n){n.assertEqual=i=>i;function e(i){}n.assertIs=e;function t(i){throw new Error}n.assertNever=t,n.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},n.getValidEnumValues=i=>{const s=n.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return n.objectValues(o)},n.objectValues=i=>n.objectKeys(i).map(function(s){return i[s]}),n.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},n.find=(i,s)=>{for(const o of i)if(s(o))return o},n.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}n.joinValues=r,n.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(rn||(rn={}));var P1;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(P1||(P1={}));const Ze=rn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ia=n=>{switch(typeof n){case"undefined":return Ze.undefined;case"string":return Ze.string;case"number":return isNaN(n)?Ze.nan:Ze.number;case"boolean":return Ze.boolean;case"function":return Ze.function;case"bigint":return Ze.bigint;case"symbol":return Ze.symbol;case"object":return Array.isArray(n)?Ze.array:n===null?Ze.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?Ze.promise:typeof Map<"u"&&n instanceof Map?Ze.map:typeof Set<"u"&&n instanceof Set?Ze.set:typeof Date<"u"&&n instanceof Date?Ze.date:Ze.object;default:return Ze.unknown}},Oe=rn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),f$=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class As extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(t(o));else{let a=r,l=0;for(;lt.message){const t={},r=[];for(const i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}As.create=n=>new As(n);const Hh=(n,e)=>{let t;switch(n.code){case Oe.invalid_type:n.received===Ze.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case Oe.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,rn.jsonStringifyReplacer)}`;break;case Oe.unrecognized_keys:t=`Unrecognized key(s) in object: ${rn.joinValues(n.keys,", ")}`;break;case Oe.invalid_union:t="Invalid input";break;case Oe.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${rn.joinValues(n.options)}`;break;case Oe.invalid_enum_value:t=`Invalid enum value. Expected ${rn.joinValues(n.options)}, received '${n.received}'`;break;case Oe.invalid_arguments:t="Invalid function arguments";break;case Oe.invalid_return_type:t="Invalid function return type";break;case Oe.invalid_date:t="Invalid date";break;case Oe.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:rn.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case Oe.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case Oe.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case Oe.custom:t="Invalid input";break;case Oe.invalid_intersection_types:t="Intersection results could not be merged";break;case Oe.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case Oe.not_finite:t="Number must be finite";break;default:t=e.defaultError,rn.assertNever(n)}return{message:t}};let tL=Hh;function h$(n){tL=n}function Jv(){return tL}const e0=n=>{const{data:e,path:t,errorMaps:r,issueData:i}=n,s=[...t,...i.path||[]],o={...i,path:s};let a="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)a=u(o,{data:e,defaultError:a}).message;return{...i,path:s,message:i.message||a}},p$=[];function Qe(n,e){const t=e0({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Jv(),Hh].filter(r=>!!r)});n.common.issues.push(t)}class Hr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const i of t){if(i.status==="aborted")return Pt;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const i of t)r.push({key:await i.key,value:await i.value});return Hr.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const i of t){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Pt;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:e.value,value:r}}}const Pt=Object.freeze({status:"aborted"}),nL=n=>({status:"dirty",value:n}),ei=n=>({status:"valid",value:n}),I1=n=>n.status==="aborted",L1=n=>n.status==="dirty",$h=n=>n.status==="valid",t0=n=>typeof Promise<"u"&&n instanceof Promise;var ht;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ht||(ht={}));class fo{constructor(e,t,r,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const jA=(n,e)=>{if($h(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new As(n.common.issues);return this._error=t,this._error}}};function kt(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:i}=n;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:t??a.defaultError},description:i}}class Ht{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Ia(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Ia(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Hr,ctx:{common:e.parent.common,data:e.data,parsedType:Ia(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(t0(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const i={common:{issues:[],async:(r=t==null?void 0:t.async)!==null&&r!==void 0?r:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ia(e)},s=this._parseSync({data:e,path:i.path,parent:i});return jA(i,s)}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ia(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(t0(i)?i:Promise.resolve(i));return jA(r,s)}refine(e,t){const r=i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t;return this._refinement((i,s)=>{const o=e(i),a=()=>s.addIssue({code:Oe.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,t){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof t=="function"?t(r,i):t),!1))}_refinement(e){return new Ls({schema:this,typeName:xt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ho.create(this,this._def)}nullable(){return Ec.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Rs.create(this,this._def)}promise(){return Pd.create(this,this._def)}or(e){return Xh.create([this,e],this._def)}and(e){return qh.create(this,e,this._def)}transform(e){return new Ls({...kt(this._def),schema:this,typeName:xt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Jh({...kt(this._def),innerType:this,defaultValue:t,typeName:xt.ZodDefault})}brand(){return new iL({typeName:xt.ZodBranded,type:this,...kt(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new s0({...kt(this._def),innerType:this,catchValue:t,typeName:xt.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Yp.create(this,e)}readonly(){return a0.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const m$=/^c[^\s-]{8,}$/i,g$=/^[a-z][a-z0-9]*$/,v$=/^[0-9A-HJKMNP-TV-Z]{26}$/,y$=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,x$=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let G_;const S$=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,w$=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,E$=n=>n.precision?n.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${n.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${n.precision}}Z$`):n.precision===0?n.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):n.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function M$(n,e){return!!((e==="v4"||!e)&&S$.test(n)||(e==="v6"||!e)&&w$.test(n))}class Cs extends Ht{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ze.string){const s=this._getOrReturnCtx(e);return Qe(s,{code:Oe.invalid_type,expected:Ze.string,received:s.parsedType}),Pt}const r=new Hr;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.lengths.value&&(i=this._getOrReturnCtx(e,i),Qe(i,{code:Oe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,a=e.data.lengthe.test(i),{validation:t,code:Oe.invalid_string,...ht.errToObj(r)})}_addCheck(e){return new Cs({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ht.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ht.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ht.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ht.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ht.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ht.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ht.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ht.errToObj(e)})}datetime(e){var t;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,...ht.errToObj(e==null?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...ht.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...ht.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...ht.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...ht.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...ht.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...ht.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...ht.errToObj(t)})}nonempty(e){return this.min(1,ht.errToObj(e))}trim(){return new Cs({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Cs({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Cs({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new Cs({checks:[],typeName:xt.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...kt(n)})};function b$(n,e){const t=(n.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=t>r?t:r,s=parseInt(n.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class il extends Ht{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Ze.number){const s=this._getOrReturnCtx(e);return Qe(s,{code:Oe.invalid_type,expected:Ze.number,received:s.parsedType}),Pt}let r;const i=new Hr;for(const s of this._def.checks)s.kind==="int"?rn.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Qe(r,{code:Oe.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.datas.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),Qe(r,{code:Oe.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?b$(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),Qe(r,{code:Oe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Qe(r,{code:Oe.not_finite,message:s.message}),i.dirty()):rn.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,ht.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ht.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ht.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ht.toString(t))}setLimit(e,t,r,i){return new il({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ht.toString(i)}]})}_addCheck(e){return new il({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ht.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ht.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ht.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ht.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ht.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ht.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:ht.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ht.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ht.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&rn.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.valuenew il({checks:[],typeName:xt.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...kt(n)});class sl extends Ht{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Ze.bigint){const s=this._getOrReturnCtx(e);return Qe(s,{code:Oe.invalid_type,expected:Ze.bigint,received:s.parsedType}),Pt}let r;const i=new Hr;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.datas.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),Qe(r,{code:Oe.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Qe(r,{code:Oe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):rn.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,ht.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ht.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ht.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ht.toString(t))}setLimit(e,t,r,i){return new sl({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ht.toString(i)}]})}_addCheck(e){return new sl({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ht.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ht.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ht.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ht.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ht.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new sl({checks:[],typeName:xt.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...kt(n)})};class Wh extends Ht{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ze.boolean){const r=this._getOrReturnCtx(e);return Qe(r,{code:Oe.invalid_type,expected:Ze.boolean,received:r.parsedType}),Pt}return ei(e.data)}}Wh.create=n=>new Wh({typeName:xt.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...kt(n)});class Sc extends Ht{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ze.date){const s=this._getOrReturnCtx(e);return Qe(s,{code:Oe.invalid_type,expected:Ze.date,received:s.parsedType}),Pt}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return Qe(s,{code:Oe.invalid_date}),Pt}const r=new Hr;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()s.value&&(i=this._getOrReturnCtx(e,i),Qe(i,{code:Oe.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):rn.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Sc({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:ht.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:ht.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew Sc({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:xt.ZodDate,...kt(n)});class n0 extends Ht{_parse(e){if(this._getType(e)!==Ze.symbol){const r=this._getOrReturnCtx(e);return Qe(r,{code:Oe.invalid_type,expected:Ze.symbol,received:r.parsedType}),Pt}return ei(e.data)}}n0.create=n=>new n0({typeName:xt.ZodSymbol,...kt(n)});class Gh extends Ht{_parse(e){if(this._getType(e)!==Ze.undefined){const r=this._getOrReturnCtx(e);return Qe(r,{code:Oe.invalid_type,expected:Ze.undefined,received:r.parsedType}),Pt}return ei(e.data)}}Gh.create=n=>new Gh({typeName:xt.ZodUndefined,...kt(n)});class jh extends Ht{_parse(e){if(this._getType(e)!==Ze.null){const r=this._getOrReturnCtx(e);return Qe(r,{code:Oe.invalid_type,expected:Ze.null,received:r.parsedType}),Pt}return ei(e.data)}}jh.create=n=>new jh({typeName:xt.ZodNull,...kt(n)});class Rd extends Ht{constructor(){super(...arguments),this._any=!0}_parse(e){return ei(e.data)}}Rd.create=n=>new Rd({typeName:xt.ZodAny,...kt(n)});class pc extends Ht{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ei(e.data)}}pc.create=n=>new pc({typeName:xt.ZodUnknown,...kt(n)});class Xo extends Ht{_parse(e){const t=this._getOrReturnCtx(e);return Qe(t,{code:Oe.invalid_type,expected:Ze.never,received:t.parsedType}),Pt}}Xo.create=n=>new Xo({typeName:xt.ZodNever,...kt(n)});class r0 extends Ht{_parse(e){if(this._getType(e)!==Ze.undefined){const r=this._getOrReturnCtx(e);return Qe(r,{code:Oe.invalid_type,expected:Ze.void,received:r.parsedType}),Pt}return ei(e.data)}}r0.create=n=>new r0({typeName:xt.ZodVoid,...kt(n)});class Rs extends Ht{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),i=this._def;if(t.parsedType!==Ze.array)return Qe(t,{code:Oe.invalid_type,expected:Ze.array,received:t.parsedType}),Pt;if(i.exactLength!==null){const o=t.data.length>i.exactLength.value,a=t.data.lengthi.maxLength.value&&(Qe(t,{code:Oe.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((o,a)=>i.type._parseAsync(new fo(t,o,t.path,a)))).then(o=>Hr.mergeArray(r,o));const s=[...t.data].map((o,a)=>i.type._parseSync(new fo(t,o,t.path,a)));return Hr.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new Rs({...this._def,minLength:{value:e,message:ht.toString(t)}})}max(e,t){return new Rs({...this._def,maxLength:{value:e,message:ht.toString(t)}})}length(e,t){return new Rs({...this._def,exactLength:{value:e,message:ht.toString(t)}})}nonempty(e){return this.min(1,e)}}Rs.create=(n,e)=>new Rs({type:n,minLength:null,maxLength:null,exactLength:null,typeName:xt.ZodArray,...kt(e)});function Nu(n){if(n instanceof Cn){const e={};for(const t in n.shape){const r=n.shape[t];e[t]=Ho.create(Nu(r))}return new Cn({...n._def,shape:()=>e})}else return n instanceof Rs?new Rs({...n._def,type:Nu(n.element)}):n instanceof Ho?Ho.create(Nu(n.unwrap())):n instanceof Ec?Ec.create(Nu(n.unwrap())):n instanceof ho?ho.create(n.items.map(e=>Nu(e))):n}class Cn extends Ht{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=rn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Ze.object){const u=this._getOrReturnCtx(e);return Qe(u,{code:Oe.invalid_type,expected:Ze.object,received:u.parsedType}),Pt}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Xo&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||a.push(u);const l=[];for(const u of o){const f=s[u],h=i.data[u];l.push({key:{status:"valid",value:u},value:f._parse(new fo(i,h,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Xo){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of a)l.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(u==="strict")a.length>0&&(Qe(i,{code:Oe.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of a){const h=i.data[f];l.push({key:{status:"valid",value:f},value:u._parse(new fo(i,h,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of l){const h=await f.key;u.push({key:h,value:await f.value,alwaysSet:f.alwaysSet})}return u}).then(u=>Hr.mergeObjectSync(r,u)):Hr.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return ht.errToObj,new Cn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var i,s,o,a;const l=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,t,r).message)!==null&&o!==void 0?o:r.defaultError;return t.code==="unrecognized_keys"?{message:(a=ht.errToObj(e).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Cn({...this._def,unknownKeys:"strip"})}passthrough(){return new Cn({...this._def,unknownKeys:"passthrough"})}extend(e){return new Cn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Cn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:xt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Cn({...this._def,catchall:e})}pick(e){const t={};return rn.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new Cn({...this._def,shape:()=>t})}omit(e){const t={};return rn.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new Cn({...this._def,shape:()=>t})}deepPartial(){return Nu(this)}partial(e){const t={};return rn.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?t[r]=i:t[r]=i.optional()}),new Cn({...this._def,shape:()=>t})}required(e){const t={};return rn.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Ho;)s=s._def.innerType;t[r]=s}}),new Cn({...this._def,shape:()=>t})}keyof(){return rL(rn.objectKeys(this.shape))}}Cn.create=(n,e)=>new Cn({shape:()=>n,unknownKeys:"strip",catchall:Xo.create(),typeName:xt.ZodObject,...kt(e)});Cn.strictCreate=(n,e)=>new Cn({shape:()=>n,unknownKeys:"strict",catchall:Xo.create(),typeName:xt.ZodObject,...kt(e)});Cn.lazycreate=(n,e)=>new Cn({shape:n,unknownKeys:"strip",catchall:Xo.create(),typeName:xt.ZodObject,...kt(e)});class Xh extends Ht{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new As(a.ctx.common.issues));return Qe(t,{code:Oe.invalid_union,unionErrors:o}),Pt}if(t.common.async)return Promise.all(r.map(async s=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const l of r){const u={...t,common:{...t.common,issues:[]},parent:null},f=l._parseSync({data:t.data,path:t.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(l=>new As(l));return Qe(t,{code:Oe.invalid_union,unionErrors:a}),Pt}}get options(){return this._def.options}}Xh.create=(n,e)=>new Xh({options:n,typeName:xt.ZodUnion,...kt(e)});const Pv=n=>n instanceof Zh?Pv(n.schema):n instanceof Ls?Pv(n.innerType()):n instanceof Kh?[n.value]:n instanceof ol?n.options:n instanceof Qh?Object.keys(n.enum):n instanceof Jh?Pv(n._def.innerType):n instanceof Gh?[void 0]:n instanceof jh?[null]:null;class My extends Ht{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ze.object)return Qe(t,{code:Oe.invalid_type,expected:Ze.object,received:t.parsedType}),Pt;const r=this.discriminator,i=t.data[r],s=this.optionsMap.get(i);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(Qe(t,{code:Oe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Pt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const i=new Map;for(const s of t){const o=Pv(s.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new My({typeName:xt.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...kt(r)})}}function D1(n,e){const t=Ia(n),r=Ia(e);if(n===e)return{valid:!0,data:n};if(t===Ze.object&&r===Ze.object){const i=rn.objectKeys(e),s=rn.objectKeys(n).filter(a=>i.indexOf(a)!==-1),o={...n,...e};for(const a of s){const l=D1(n[a],e[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(t===Ze.array&&r===Ze.array){if(n.length!==e.length)return{valid:!1};const i=[];for(let s=0;s{if(I1(s)||I1(o))return Pt;const a=D1(s.value,o.value);return a.valid?((L1(s)||L1(o))&&t.dirty(),{status:t.value,value:a.data}):(Qe(r,{code:Oe.invalid_intersection_types}),Pt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}qh.create=(n,e,t)=>new qh({left:n,right:e,typeName:xt.ZodIntersection,...kt(t)});class ho extends Ht{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.array)return Qe(r,{code:Oe.invalid_type,expected:Ze.array,received:r.parsedType}),Pt;if(r.data.lengththis._def.items.length&&(Qe(r,{code:Oe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...r.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new fo(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>Hr.mergeArray(t,o)):Hr.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new ho({...this._def,rest:e})}}ho.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ho({items:n,typeName:xt.ZodTuple,rest:null,...kt(e)})};class Yh extends Ht{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.object)return Qe(r,{code:Oe.invalid_type,expected:Ze.object,received:r.parsedType}),Pt;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new fo(r,a,r.path,a)),value:o._parse(new fo(r,r.data[a],r.path,a))});return r.common.async?Hr.mergeObjectAsync(t,i):Hr.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof Ht?new Yh({keyType:e,valueType:t,typeName:xt.ZodRecord,...kt(r)}):new Yh({keyType:Cs.create(),valueType:e,typeName:xt.ZodRecord,...kt(t)})}}class i0 extends Ht{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.map)return Qe(r,{code:Oe.invalid_type,expected:Ze.map,received:r.parsedType}),Pt;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,l],u)=>({key:i._parse(new fo(r,a,r.path,[u,"key"])),value:s._parse(new fo(r,l,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,f=await l.value;if(u.status==="aborted"||f.status==="aborted")return Pt;(u.status==="dirty"||f.status==="dirty")&&t.dirty(),a.set(u.value,f.value)}return{status:t.value,value:a}})}else{const a=new Map;for(const l of o){const u=l.key,f=l.value;if(u.status==="aborted"||f.status==="aborted")return Pt;(u.status==="dirty"||f.status==="dirty")&&t.dirty(),a.set(u.value,f.value)}return{status:t.value,value:a}}}}i0.create=(n,e,t)=>new i0({valueType:e,keyType:n,typeName:xt.ZodMap,...kt(t)});class wc extends Ht{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.set)return Qe(r,{code:Oe.invalid_type,expected:Ze.set,received:r.parsedType}),Pt;const i=this._def;i.minSize!==null&&r.data.sizei.maxSize.value&&(Qe(r,{code:Oe.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());const s=this._def.valueType;function o(l){const u=new Set;for(const f of l){if(f.status==="aborted")return Pt;f.status==="dirty"&&t.dirty(),u.add(f.value)}return{status:t.value,value:u}}const a=[...r.data.values()].map((l,u)=>s._parse(new fo(r,l,r.path,u)));return r.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(e,t){return new wc({...this._def,minSize:{value:e,message:ht.toString(t)}})}max(e,t){return new wc({...this._def,maxSize:{value:e,message:ht.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}wc.create=(n,e)=>new wc({valueType:n,minSize:null,maxSize:null,typeName:xt.ZodSet,...kt(e)});class nd extends Ht{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ze.function)return Qe(t,{code:Oe.invalid_type,expected:Ze.function,received:t.parsedType}),Pt;function r(a,l){return e0({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Jv(),Hh].filter(u=>!!u),issueData:{code:Oe.invalid_arguments,argumentsError:l}})}function i(a,l){return e0({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Jv(),Hh].filter(u=>!!u),issueData:{code:Oe.invalid_return_type,returnTypeError:l}})}const s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Pd){const a=this;return ei(async function(...l){const u=new As([]),f=await a._def.args.parseAsync(l,s).catch(m=>{throw u.addIssue(r(l,m)),u}),h=await Reflect.apply(o,this,f);return await a._def.returns._def.type.parseAsync(h,s).catch(m=>{throw u.addIssue(i(h,m)),u})})}else{const a=this;return ei(function(...l){const u=a._def.args.safeParse(l,s);if(!u.success)throw new As([r(l,u.error)]);const f=Reflect.apply(o,this,u.data),h=a._def.returns.safeParse(f,s);if(!h.success)throw new As([i(f,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new nd({...this._def,args:ho.create(e).rest(pc.create())})}returns(e){return new nd({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new nd({args:e||ho.create([]).rest(pc.create()),returns:t||pc.create(),typeName:xt.ZodFunction,...kt(r)})}}class Zh extends Ht{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Zh.create=(n,e)=>new Zh({getter:n,typeName:xt.ZodLazy,...kt(e)});class Kh extends Ht{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Qe(t,{received:t.data,code:Oe.invalid_literal,expected:this._def.value}),Pt}return{status:"valid",value:e.data}}get value(){return this._def.value}}Kh.create=(n,e)=>new Kh({value:n,typeName:xt.ZodLiteral,...kt(e)});function rL(n,e){return new ol({values:n,typeName:xt.ZodEnum,...kt(e)})}class ol extends Ht{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return Qe(t,{expected:rn.joinValues(r),received:t.parsedType,code:Oe.invalid_type}),Pt}if(this._def.values.indexOf(e.data)===-1){const t=this._getOrReturnCtx(e),r=this._def.values;return Qe(t,{received:t.data,code:Oe.invalid_enum_value,options:r}),Pt}return ei(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return ol.create(e)}exclude(e){return ol.create(this.options.filter(t=>!e.includes(t)))}}ol.create=rL;class Qh extends Ht{_parse(e){const t=rn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Ze.string&&r.parsedType!==Ze.number){const i=rn.objectValues(t);return Qe(r,{expected:rn.joinValues(i),received:r.parsedType,code:Oe.invalid_type}),Pt}if(t.indexOf(e.data)===-1){const i=rn.objectValues(t);return Qe(r,{received:r.data,code:Oe.invalid_enum_value,options:i}),Pt}return ei(e.data)}get enum(){return this._def.values}}Qh.create=(n,e)=>new Qh({values:n,typeName:xt.ZodNativeEnum,...kt(e)});class Pd extends Ht{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ze.promise&&t.common.async===!1)return Qe(t,{code:Oe.invalid_type,expected:Ze.promise,received:t.parsedType}),Pt;const r=t.parsedType===Ze.promise?t.data:Promise.resolve(t.data);return ei(r.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Pd.create=(n,e)=>new Pd({type:n,typeName:xt.ZodPromise,...kt(e)});class Ls extends Ht{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{Qe(r,o),o.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:o,path:r.path,parent:r})}if(i.type==="refinement"){const o=a=>{const l=i.refinement(a,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Pt:(a.status==="dirty"&&t.dirty(),o(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Pt:(a.status==="dirty"&&t.dirty(),o(a.value).then(()=>({status:t.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!$h(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>$h(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:t.value,value:a})):o);rn.assertNever(i)}}Ls.create=(n,e,t)=>new Ls({schema:n,typeName:xt.ZodEffects,effect:e,...kt(t)});Ls.createWithPreprocess=(n,e,t)=>new Ls({schema:e,effect:{type:"preprocess",transform:n},typeName:xt.ZodEffects,...kt(t)});class Ho extends Ht{_parse(e){return this._getType(e)===Ze.undefined?ei(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ho.create=(n,e)=>new Ho({innerType:n,typeName:xt.ZodOptional,...kt(e)});class Ec extends Ht{_parse(e){return this._getType(e)===Ze.null?ei(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ec.create=(n,e)=>new Ec({innerType:n,typeName:xt.ZodNullable,...kt(e)});class Jh extends Ht{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===Ze.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Jh.create=(n,e)=>new Jh({innerType:n,typeName:xt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...kt(e)});class s0 extends Ht{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return t0(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new As(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new As(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}s0.create=(n,e)=>new s0({innerType:n,typeName:xt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...kt(e)});class o0 extends Ht{_parse(e){if(this._getType(e)!==Ze.nan){const r=this._getOrReturnCtx(e);return Qe(r,{code:Oe.invalid_type,expected:Ze.nan,received:r.parsedType}),Pt}return{status:"valid",value:e.data}}}o0.create=n=>new o0({typeName:xt.ZodNaN,...kt(n)});const T$=Symbol("zod_brand");class iL extends Ht{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class Yp extends Ht{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Pt:s.status==="dirty"?(t.dirty(),nL(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Pt:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,t){return new Yp({in:e,out:t,typeName:xt.ZodPipeline})}}class a0 extends Ht{_parse(e){const t=this._def.innerType._parse(e);return $h(t)&&(t.value=Object.freeze(t.value)),t}}a0.create=(n,e)=>new a0({innerType:n,typeName:xt.ZodReadonly,...kt(e)});const sL=(n,e={},t)=>n?Rd.create().superRefine((r,i)=>{var s,o;if(!n(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,l=(o=(s=a.fatal)!==null&&s!==void 0?s:t)!==null&&o!==void 0?o:!0,u=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...u,fatal:l})}}):Rd.create(),C$={object:Cn.lazycreate};var xt;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(xt||(xt={}));const A$=(n,e={message:`Input not instance of ${n.name}`})=>sL(t=>t instanceof n,e),oL=Cs.create,aL=il.create,R$=o0.create,P$=sl.create,lL=Wh.create,I$=Sc.create,L$=n0.create,D$=Gh.create,N$=jh.create,O$=Rd.create,k$=pc.create,U$=Xo.create,F$=r0.create,z$=Rs.create,B$=Cn.create,V$=Cn.strictCreate,H$=Xh.create,$$=My.create,W$=qh.create,G$=ho.create,j$=Yh.create,X$=i0.create,q$=wc.create,Y$=nd.create,Z$=Zh.create,K$=Kh.create,Q$=ol.create,J$=Qh.create,e7=Pd.create,XA=Ls.create,t7=Ho.create,n7=Ec.create,r7=Ls.createWithPreprocess,i7=Yp.create,s7=()=>oL().optional(),o7=()=>aL().optional(),a7=()=>lL().optional(),l7={string:n=>Cs.create({...n,coerce:!0}),number:n=>il.create({...n,coerce:!0}),boolean:n=>Wh.create({...n,coerce:!0}),bigint:n=>sl.create({...n,coerce:!0}),date:n=>Sc.create({...n,coerce:!0})},c7=Pt;var ui=Object.freeze({__proto__:null,defaultErrorMap:Hh,setErrorMap:h$,getErrorMap:Jv,makeIssue:e0,EMPTY_PATH:p$,addIssueToContext:Qe,ParseStatus:Hr,INVALID:Pt,DIRTY:nL,OK:ei,isAborted:I1,isDirty:L1,isValid:$h,isAsync:t0,get util(){return rn},get objectUtil(){return P1},ZodParsedType:Ze,getParsedType:Ia,ZodType:Ht,ZodString:Cs,ZodNumber:il,ZodBigInt:sl,ZodBoolean:Wh,ZodDate:Sc,ZodSymbol:n0,ZodUndefined:Gh,ZodNull:jh,ZodAny:Rd,ZodUnknown:pc,ZodNever:Xo,ZodVoid:r0,ZodArray:Rs,ZodObject:Cn,ZodUnion:Xh,ZodDiscriminatedUnion:My,ZodIntersection:qh,ZodTuple:ho,ZodRecord:Yh,ZodMap:i0,ZodSet:wc,ZodFunction:nd,ZodLazy:Zh,ZodLiteral:Kh,ZodEnum:ol,ZodNativeEnum:Qh,ZodPromise:Pd,ZodEffects:Ls,ZodTransformer:Ls,ZodOptional:Ho,ZodNullable:Ec,ZodDefault:Jh,ZodCatch:s0,ZodNaN:o0,BRAND:T$,ZodBranded:iL,ZodPipeline:Yp,ZodReadonly:a0,custom:sL,Schema:Ht,ZodSchema:Ht,late:C$,get ZodFirstPartyTypeKind(){return xt},coerce:l7,any:O$,array:z$,bigint:P$,boolean:lL,date:I$,discriminatedUnion:$$,effect:XA,enum:Q$,function:Y$,instanceof:A$,intersection:W$,lazy:Z$,literal:K$,map:X$,nan:R$,nativeEnum:J$,never:U$,null:N$,nullable:n7,number:aL,object:B$,oboolean:a7,onumber:o7,optional:t7,ostring:s7,pipeline:i7,preprocess:r7,promise:e7,record:j$,set:q$,strictObject:V$,string:oL,symbol:L$,transformer:XA,tuple:G$,undefined:D$,union:H$,unknown:k$,void:F$,NEVER:c7,ZodIssueCode:Oe,quotelessJson:f$,ZodError:As}),u7=async(...n)=>{const e=await fetch(...n);if(!e.ok)throw new Error(`Request failed with status ${e.status}`);return e.json()};function d7(n=u7){return async(e,...t)=>{const r=await n(...t);return e.parse(r)}}const cL=ui.object({avatar_url:ui.string().nullable(),id:ui.number(),username:ui.string(),track_count:ui.number().optional().nullable()}),f7=ui.object({id:ui.number(),title:ui.string(),artwork_url:ui.string().nullable(),playback_count:ui.number().nullable(),user:cL.optional()}),JE="https://soundcloud-api-proxy.fly.dev/proxy",eM=d7(),h7=async({query:n,limit:e=5})=>{const t=`${JE}/users?${new URLSearchParams({q:n,limit:e.toString()}).toString()}`;return await eM(ui.array(cL),t,{method:"GET"})},p7=async({userId:n,limit:e=50})=>{const t=`${JE}/users/${n}/tracks?${new URLSearchParams({access:"playable",limit:e.toString()}).toString()}`;return(await eM(ui.array(f7),t,{method:"GET"})).sort((i,s)=>(s.playback_count??Number.POSITIVE_INFINITY)-(i.playback_count??Number.POSITIVE_INFINITY))},m7=async n=>{const{http_mp3_128_url:e}=await eM(ui.object({http_mp3_128_url:ui.string()}),`${JE}/tracks/${n}/streams`,{method:"GET"});return e};function uL(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;en&&(e=0,r=t,t=new Map)}return{get:function(o){var a=t.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set:function(o,a){t.has(o)?t.set(o,a):i(o,a)}}}var hL="!";function M7(n){var e=n.separator||":",t=e.length===1,r=e[0],i=e.length;return function(o){for(var a=[],l=0,u=0,f,h=0;hu?f-u:void 0;return{modifiers:a,hasImportantModifier:v,baseClassName:w,maybePostfixModifierPosition:x}}}function b7(n){if(n.length<=1)return n;var e=[],t=[];return n.forEach(function(r){var i=r[0]==="[";i?(e.push.apply(e,t.sort().concat([r])),t=[]):t.push(r)}),e.push.apply(e,t.sort()),e}function T7(n){return{cache:E7(n.cacheSize),splitModifiers:M7(n),...y7(n)}}var C7=/\s+/;function A7(n,e){var t=e.splitModifiers,r=e.getClassGroupId,i=e.getConflictingClassGroupIds,s=new Set;return n.trim().split(C7).map(function(o){var a=t(o),l=a.modifiers,u=a.hasImportantModifier,f=a.baseClassName,h=a.maybePostfixModifierPosition,p=r(h?f.substring(0,h):f),m=!!h;if(!p){if(!h)return{isTailwindClass:!1,originalClassName:o};if(p=r(f),!p)return{isTailwindClass:!1,originalClassName:o};m=!1}var v=b7(l).join(":"),w=u?v+hL:v;return{isTailwindClass:!0,modifierId:w,classGroupId:p,originalClassName:o,hasPostfixModifier:m}}).reverse().filter(function(o){if(!o.isTailwindClass)return!0;var a=o.modifierId,l=o.classGroupId,u=o.hasPostfixModifier,f=a+l;return s.has(f)?!1:(s.add(f),i(l,u).forEach(function(h){return s.add(a+h)}),!0)}).reverse().map(function(o){return o.originalClassName}).join(" ")}function R7(){for(var n=arguments.length,e=new Array(n),t=0;t{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Id=typeof window>"u"||"Deno"in window;function ts(){}function G7(n,e){return typeof n=="function"?n(e):n}function k1(n){return typeof n=="number"&&n>=0&&n!==1/0}function gL(n,e){return Math.max(n+(e||0)-Date.now(),0)}function KA(n,e){const{type:t="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=n;if(o){if(r){if(e.queryHash!==nM(o,e.options))return!1}else if(!tp(e.queryKey,o))return!1}if(t!=="all"){const l=e.isActive();if(t==="active"&&!l||t==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||typeof i<"u"&&i!==e.state.fetchStatus||s&&!s(e))}function QA(n,e){const{exact:t,status:r,predicate:i,mutationKey:s}=n;if(s){if(!e.options.mutationKey)return!1;if(t){if(ep(e.options.mutationKey)!==ep(s))return!1}else if(!tp(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function nM(n,e){return((e==null?void 0:e.queryKeyHashFn)||ep)(n)}function ep(n){return JSON.stringify(n,(e,t)=>F1(t)?Object.keys(t).sort().reduce((r,i)=>(r[i]=t[i],r),{}):t)}function tp(n,e){return n===e?!0:typeof n!=typeof e?!1:n&&e&&typeof n=="object"&&typeof e=="object"?!Object.keys(e).some(t=>!tp(n[t],e[t])):!1}function vL(n,e){if(n===e)return n;const t=JA(n)&&JA(e);if(t||F1(n)&&F1(e)){const r=t?n:Object.keys(n),i=r.length,s=t?e:Object.keys(e),o=s.length,a=t?[]:{};let l=0;for(let u=0;u"u")return!0;const t=e.prototype;return!(!e2(t)||!t.hasOwnProperty("isPrototypeOf"))}function e2(n){return Object.prototype.toString.call(n)==="[object Object]"}function j7(n){return new Promise(e=>{setTimeout(e,n)})}function z1(n,e,t){return typeof t.structuralSharing=="function"?t.structuralSharing(n,e):t.structuralSharing!==!1?vL(n,e):e}function X7(n,e,t=0){const r=[...n,e];return t&&r.length>t?r.slice(1):r}function q7(n,e,t=0){const r=[e,...n];return t&&r.length>t?r.slice(0,-1):r}var tc,Na,ud,fP,Y7=(fP=class extends Zp{constructor(){super();ct(this,tc,void 0);ct(this,Na,void 0);ct(this,ud,void 0);Ye(this,ud,e=>{if(!Id&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){ee(this,Na)||this.setEventListener(ee(this,ud))}onUnsubscribe(){var e;this.hasListeners()||((e=ee(this,Na))==null||e.call(this),Ye(this,Na,void 0))}setEventListener(e){var t;Ye(this,ud,e),(t=ee(this,Na))==null||t.call(this),Ye(this,Na,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){ee(this,tc)!==e&&(Ye(this,tc,e),this.onFocus())}onFocus(){this.listeners.forEach(e=>{e()})}isFocused(){var e;return typeof ee(this,tc)=="boolean"?ee(this,tc):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},tc=new WeakMap,Na=new WeakMap,ud=new WeakMap,fP),l0=new Y7,dd,Oa,fd,hP,Z7=(hP=class extends Zp{constructor(){super();ct(this,dd,!0);ct(this,Oa,void 0);ct(this,fd,void 0);Ye(this,fd,e=>{if(!Id&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){ee(this,Oa)||this.setEventListener(ee(this,fd))}onUnsubscribe(){var e;this.hasListeners()||((e=ee(this,Oa))==null||e.call(this),Ye(this,Oa,void 0))}setEventListener(e){var t;Ye(this,fd,e),(t=ee(this,Oa))==null||t.call(this),Ye(this,Oa,e(this.setOnline.bind(this)))}setOnline(e){ee(this,dd)!==e&&(Ye(this,dd,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return ee(this,dd)}},dd=new WeakMap,Oa=new WeakMap,fd=new WeakMap,hP),c0=new Z7;function K7(n){return Math.min(1e3*2**n,3e4)}function by(n){return(n??"online")==="online"?c0.isOnline():!0}var yL=class{constructor(n){this.revert=n==null?void 0:n.revert,this.silent=n==null?void 0:n.silent}};function j_(n){return n instanceof yL}function xL(n){let e=!1,t=0,r=!1,i,s,o;const a=new Promise((x,g)=>{s=x,o=g}),l=x=>{var g;r||(m(new yL(x)),(g=n.abort)==null||g.call(n))},u=()=>{e=!0},f=()=>{e=!1},h=()=>!l0.isFocused()||n.networkMode!=="always"&&!c0.isOnline(),p=x=>{var g;r||(r=!0,(g=n.onSuccess)==null||g.call(n,x),i==null||i(),s(x))},m=x=>{var g;r||(r=!0,(g=n.onError)==null||g.call(n,x),i==null||i(),o(x))},v=()=>new Promise(x=>{var g;i=S=>{const _=r||!h();return _&&x(S),_},(g=n.onPause)==null||g.call(n)}).then(()=>{var x;i=void 0,r||(x=n.onContinue)==null||x.call(n)}),w=()=>{if(r)return;let x;try{x=n.fn()}catch(g){x=Promise.reject(g)}Promise.resolve(x).then(p).catch(g=>{var R;if(r)return;const S=n.retry??(Id?0:3),_=n.retryDelay??K7,b=typeof _=="function"?_(t,g):_,A=S===!0||typeof S=="number"&&t{if(h())return v()}).then(()=>{e?m(g):w()})})};return by(n.networkMode)?w():v().then(w),{promise:a,cancel:l,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:u,continueRetry:f}}function Q7(){let n=[],e=0,t=p=>{p()},r=p=>{p()},i=p=>setTimeout(p,0);const s=p=>{i=p},o=p=>{let m;e++;try{m=p()}finally{e--,e||u()}return m},a=p=>{e?n.push(p):i(()=>{t(p)})},l=p=>(...m)=>{a(()=>{p(...m)})},u=()=>{const p=n;n=[],p.length&&i(()=>{r(()=>{p.forEach(m=>{t(m)})})})};return{batch:o,batchCalls:l,schedule:a,setNotifyFunction:p=>{t=p},setBatchNotifyFunction:p=>{r=p},setScheduler:s}}var Sr=Q7(),nc,pP,_L=(pP=class{constructor(){ct(this,nc,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),k1(this.gcTime)&&Ye(this,nc,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(Id?1/0:5*60*1e3))}clearGcTimeout(){ee(this,nc)&&(clearTimeout(ee(this,nc)),Ye(this,nc,void 0))}},nc=new WeakMap,pP),hd,pd,Qi,ka,Ji,fr,Ep,rc,md,Iv,Es,Ro,mP,J7=(mP=class extends _L{constructor(e){super();ct(this,md);ct(this,Es);ct(this,hd,void 0);ct(this,pd,void 0);ct(this,Qi,void 0);ct(this,ka,void 0);ct(this,Ji,void 0);ct(this,fr,void 0);ct(this,Ep,void 0);ct(this,rc,void 0);Ye(this,rc,!1),Ye(this,Ep,e.defaultOptions),Gt(this,md,Iv).call(this,e.options),Ye(this,fr,[]),Ye(this,Qi,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Ye(this,hd,e.state||eW(this.options)),this.state=ee(this,hd),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!ee(this,fr).length&&this.state.fetchStatus==="idle"&&ee(this,Qi).remove(this)}setData(e,t){const r=z1(this.state.data,e,this.options);return Gt(this,Es,Ro).call(this,{data:r,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),r}setState(e,t){Gt(this,Es,Ro).call(this,{type:"setState",state:e,setStateOptions:t})}cancel(e){var r;const t=ee(this,ka);return(r=ee(this,Ji))==null||r.cancel(e),t?t.then(ts).catch(ts):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ee(this,hd))}isActive(){return ee(this,fr).some(e=>e.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||ee(this,fr).some(e=>e.getCurrentResult().isStale)}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!gL(this.state.dataUpdatedAt,e)}onFocus(){var t;const e=ee(this,fr).find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(t=ee(this,Ji))==null||t.continue()}onOnline(){var t;const e=ee(this,fr).find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(t=ee(this,Ji))==null||t.continue()}addObserver(e){ee(this,fr).includes(e)||(ee(this,fr).push(e),this.clearGcTimeout(),ee(this,Qi).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){ee(this,fr).includes(e)&&(Ye(this,fr,ee(this,fr).filter(t=>t!==e)),ee(this,fr).length||(ee(this,Ji)&&(ee(this,rc)?ee(this,Ji).cancel({revert:!0}):ee(this,Ji).cancelRetry()),this.scheduleGc()),ee(this,Qi).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return ee(this,fr).length}invalidate(){this.state.isInvalidated||Gt(this,Es,Ro).call(this,{type:"invalidate"})}fetch(e,t){var u,f,h,p;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(ee(this,ka))return(u=ee(this,Ji))==null||u.continueRetry(),ee(this,ka)}if(e&&Gt(this,md,Iv).call(this,e),!this.options.queryFn){const m=ee(this,fr).find(v=>v.options.queryFn);m&&Gt(this,md,Iv).call(this,m.options)}const r=new AbortController,i={queryKey:this.queryKey,meta:this.meta},s=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(Ye(this,rc,!0),r.signal)})};s(i);const o=()=>this.options.queryFn?(Ye(this,rc,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};s(a),(f=this.options.behavior)==null||f.onFetch(a,this),Ye(this,pd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=a.fetchOptions)==null?void 0:h.meta))&&Gt(this,Es,Ro).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const l=m=>{var v,w,x,g;j_(m)&&m.silent||Gt(this,Es,Ro).call(this,{type:"error",error:m}),j_(m)||((w=(v=ee(this,Qi).config).onError)==null||w.call(v,m,this),(g=(x=ee(this,Qi).config).onSettled)==null||g.call(x,this.state.data,m,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ye(this,Ji,xL({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:m=>{var v,w,x,g;if(typeof m>"u"){l(new Error(`${this.queryHash} data is undefined`));return}this.setData(m),(w=(v=ee(this,Qi).config).onSuccess)==null||w.call(v,m,this),(g=(x=ee(this,Qi).config).onSettled)==null||g.call(x,m,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(m,v)=>{Gt(this,Es,Ro).call(this,{type:"failed",failureCount:m,error:v})},onPause:()=>{Gt(this,Es,Ro).call(this,{type:"pause"})},onContinue:()=>{Gt(this,Es,Ro).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ye(this,ka,ee(this,Ji).promise),ee(this,ka)}},hd=new WeakMap,pd=new WeakMap,Qi=new WeakMap,ka=new WeakMap,Ji=new WeakMap,fr=new WeakMap,Ep=new WeakMap,rc=new WeakMap,md=new WeakSet,Iv=function(e){this.options={...ee(this,Ep),...e},this.updateGcTime(this.options.gcTime)},Es=new WeakSet,Ro=function(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:e.meta??null,fetchStatus:by(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return j_(i)&&i.revert&&ee(this,pd)?{...ee(this,pd),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),Sr.batch(()=>{ee(this,fr).forEach(r=>{r.onQueryUpdate()}),ee(this,Qi).notify({query:this,type:"updated",action:e})})},mP);function eW(n){const e=typeof n.initialData=="function"?n.initialData():n.initialData,t=typeof e<"u",r=t?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:t?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var Ys,gP,tW=(gP=class extends Zp{constructor(e={}){super();ct(this,Ys,void 0);this.config=e,Ye(this,Ys,new Map)}build(e,t,r){const i=t.queryKey,s=t.queryHash??nM(i,t);let o=this.get(s);return o||(o=new J7({cache:this,queryKey:i,queryHash:s,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){ee(this,Ys).has(e.queryHash)||(ee(this,Ys).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=ee(this,Ys).get(e.queryHash);t&&(e.destroy(),t===e&&ee(this,Ys).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Sr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return ee(this,Ys).get(e)}getAll(){return[...ee(this,Ys).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>KA(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>KA(e,r)):t}notify(e){Sr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Sr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Sr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ys=new WeakMap,gP),Zs,Mp,bi,gd,Ks,ba,vP,nW=(vP=class extends _L{constructor(e){super();ct(this,Ks);ct(this,Zs,void 0);ct(this,Mp,void 0);ct(this,bi,void 0);ct(this,gd,void 0);this.mutationId=e.mutationId,Ye(this,Mp,e.defaultOptions),Ye(this,bi,e.mutationCache),Ye(this,Zs,[]),this.state=e.state||rW(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...ee(this,Mp),...e},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){ee(this,Zs).includes(e)||(ee(this,Zs).push(e),this.clearGcTimeout(),ee(this,bi).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Ye(this,Zs,ee(this,Zs).filter(t=>t!==e)),this.scheduleGc(),ee(this,bi).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){ee(this,Zs).length||(this.state.status==="pending"?this.scheduleGc():ee(this,bi).remove(this))}continue(){var e;return((e=ee(this,gd))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,s,o,a,l,u,f,h,p,m,v,w,x,g,S,_,b,A,R,P;const t=()=>(Ye(this,gd,xL({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(D,V)=>{Gt(this,Ks,ba).call(this,{type:"failed",failureCount:D,error:V})},onPause:()=>{Gt(this,Ks,ba).call(this,{type:"pause"})},onContinue:()=>{Gt(this,Ks,ba).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),ee(this,gd).promise),r=this.state.status==="pending";try{if(!r){Gt(this,Ks,ba).call(this,{type:"pending",variables:e}),await((s=(i=ee(this,bi).config).onMutate)==null?void 0:s.call(i,e,this));const V=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e));V!==this.state.context&&Gt(this,Ks,ba).call(this,{type:"pending",context:V,variables:e})}const D=await t();return await((u=(l=ee(this,bi).config).onSuccess)==null?void 0:u.call(l,D,e,this.state.context,this)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,D,e,this.state.context)),await((m=(p=ee(this,bi).config).onSettled)==null?void 0:m.call(p,D,null,this.state.variables,this.state.context,this)),await((w=(v=this.options).onSettled)==null?void 0:w.call(v,D,null,e,this.state.context)),Gt(this,Ks,ba).call(this,{type:"success",data:D}),D}catch(D){try{throw await((g=(x=ee(this,bi).config).onError)==null?void 0:g.call(x,D,e,this.state.context,this)),await((_=(S=this.options).onError)==null?void 0:_.call(S,D,e,this.state.context)),await((A=(b=ee(this,bi).config).onSettled)==null?void 0:A.call(b,void 0,D,this.state.variables,this.state.context,this)),await((P=(R=this.options).onSettled)==null?void 0:P.call(R,void 0,D,e,this.state.context)),D}finally{Gt(this,Ks,ba).call(this,{type:"error",error:D})}}}},Zs=new WeakMap,Mp=new WeakMap,bi=new WeakMap,gd=new WeakMap,Ks=new WeakSet,ba=function(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!by(this.options.networkMode),status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Sr.batch(()=>{ee(this,Zs).forEach(r=>{r.onMutationUpdate(e)}),ee(this,bi).notify({mutation:this,type:"updated",action:e})})},vP);function rW(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var es,bp,ic,yP,iW=(yP=class extends Zp{constructor(e={}){super();ct(this,es,void 0);ct(this,bp,void 0);ct(this,ic,void 0);this.config=e,Ye(this,es,[]),Ye(this,bp,0)}build(e,t,r){const i=new nW({mutationCache:this,mutationId:++eg(this,bp)._,options:e.defaultMutationOptions(t),state:r});return this.add(i),i}add(e){ee(this,es).push(e),this.notify({type:"added",mutation:e})}remove(e){Ye(this,es,ee(this,es).filter(t=>t!==e)),this.notify({type:"removed",mutation:e})}clear(){Sr.batch(()=>{ee(this,es).forEach(e=>{this.remove(e)})})}getAll(){return ee(this,es)}find(e){const t={exact:!0,...e};return ee(this,es).find(r=>QA(t,r))}findAll(e={}){return ee(this,es).filter(t=>QA(e,t))}notify(e){Sr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){return Ye(this,ic,(ee(this,ic)??Promise.resolve()).then(()=>{const e=ee(this,es).filter(t=>t.state.isPaused);return Sr.batch(()=>e.reduce((t,r)=>t.then(()=>r.continue().catch(ts)),Promise.resolve()))}).then(()=>{Ye(this,ic,void 0)})),ee(this,ic)}},es=new WeakMap,bp=new WeakMap,ic=new WeakMap,yP);function sW(n){return{onFetch:(e,t)=>{const r=async()=>{var v,w,x,g,S;const i=e.options,s=(x=(w=(v=e.fetchOptions)==null?void 0:v.meta)==null?void 0:w.fetchMore)==null?void 0:x.direction,o=((g=e.state.data)==null?void 0:g.pages)||[],a=((S=e.state.data)==null?void 0:S.pageParams)||[],l={pages:[],pageParams:[]};let u=!1;const f=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(e.signal.aborted?u=!0:e.signal.addEventListener("abort",()=>{u=!0}),e.signal)})},h=e.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${e.options.queryHash}'`))),p=async(_,b,A)=>{if(u)return Promise.reject();if(b==null&&_.pages.length)return Promise.resolve(_);const R={queryKey:e.queryKey,pageParam:b,direction:A?"backward":"forward",meta:e.options.meta};f(R);const P=await h(R),{maxPages:D}=e.options,V=A?q7:X7;return{pages:V(_.pages,P,D),pageParams:V(_.pageParams,b,D)}};let m;if(s&&o.length){const _=s==="backward",b=_?oW:t2,A={pages:o,pageParams:a},R=b(i,A);m=await p(A,R,_)}else{m=await p(l,a[0]??i.initialPageParam);const _=n??o.length;for(let b=1;b<_;b++){const A=t2(i,m);m=await p(m,A)}}return m};e.options.persister?e.fetchFn=()=>{var i,s;return(s=(i=e.options).persister)==null?void 0:s.call(i,r,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},t)}:e.fetchFn=r}}}function t2(n,{pages:e,pageParams:t}){const r=e.length-1;return n.getNextPageParam(e[r],e,t[r],t)}function oW(n,{pages:e,pageParams:t}){var r;return(r=n.getPreviousPageParam)==null?void 0:r.call(n,e[0],e,t[0],t)}var tr,Ua,Fa,vd,yd,za,xd,_d,xP,aW=(xP=class{constructor(n={}){ct(this,tr,void 0);ct(this,Ua,void 0);ct(this,Fa,void 0);ct(this,vd,void 0);ct(this,yd,void 0);ct(this,za,void 0);ct(this,xd,void 0);ct(this,_d,void 0);Ye(this,tr,n.queryCache||new tW),Ye(this,Ua,n.mutationCache||new iW),Ye(this,Fa,n.defaultOptions||{}),Ye(this,vd,new Map),Ye(this,yd,new Map),Ye(this,za,0)}mount(){eg(this,za)._++,ee(this,za)===1&&(Ye(this,xd,l0.subscribe(()=>{l0.isFocused()&&(this.resumePausedMutations(),ee(this,tr).onFocus())})),Ye(this,_d,c0.subscribe(()=>{c0.isOnline()&&(this.resumePausedMutations(),ee(this,tr).onOnline())})))}unmount(){var n,e;eg(this,za)._--,ee(this,za)===0&&((n=ee(this,xd))==null||n.call(this),Ye(this,xd,void 0),(e=ee(this,_d))==null||e.call(this),Ye(this,_d,void 0))}isFetching(n){return ee(this,tr).findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return ee(this,Ua).findAll({...n,status:"pending"}).length}getQueryData(n){var e;return(e=ee(this,tr).find({queryKey:n}))==null?void 0:e.state.data}ensureQueryData(n){const e=this.getQueryData(n.queryKey);return e!==void 0?Promise.resolve(e):this.fetchQuery(n)}getQueriesData(n){return this.getQueryCache().findAll(n).map(({queryKey:e,state:t})=>{const r=t.data;return[e,r]})}setQueryData(n,e,t){const r=ee(this,tr).find({queryKey:n}),i=r==null?void 0:r.state.data,s=G7(e,i);if(typeof s>"u")return;const o=this.defaultQueryOptions({queryKey:n});return ee(this,tr).build(this,o).setData(s,{...t,manual:!0})}setQueriesData(n,e,t){return Sr.batch(()=>this.getQueryCache().findAll(n).map(({queryKey:r})=>[r,this.setQueryData(r,e,t)]))}getQueryState(n){var e;return(e=ee(this,tr).find({queryKey:n}))==null?void 0:e.state}removeQueries(n){const e=ee(this,tr);Sr.batch(()=>{e.findAll(n).forEach(t=>{e.remove(t)})})}resetQueries(n,e){const t=ee(this,tr),r={type:"active",...n};return Sr.batch(()=>(t.findAll(n).forEach(i=>{i.reset()}),this.refetchQueries(r,e)))}cancelQueries(n={},e={}){const t={revert:!0,...e},r=Sr.batch(()=>ee(this,tr).findAll(n).map(i=>i.cancel(t)));return Promise.all(r).then(ts).catch(ts)}invalidateQueries(n={},e={}){return Sr.batch(()=>{if(ee(this,tr).findAll(n).forEach(r=>{r.invalidate()}),n.refetchType==="none")return Promise.resolve();const t={...n,type:n.refetchType??n.type??"active"};return this.refetchQueries(t,e)})}refetchQueries(n={},e){const t={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},r=Sr.batch(()=>ee(this,tr).findAll(n).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,t);return t.throwOnError||(s=s.catch(ts)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(ts)}fetchQuery(n){const e=this.defaultQueryOptions(n);typeof e.retry>"u"&&(e.retry=!1);const t=ee(this,tr).build(this,e);return t.isStaleByTime(e.staleTime)?t.fetch(e):Promise.resolve(t.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(ts).catch(ts)}fetchInfiniteQuery(n){return n.behavior=sW(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(ts).catch(ts)}resumePausedMutations(){return ee(this,Ua).resumePausedMutations()}getQueryCache(){return ee(this,tr)}getMutationCache(){return ee(this,Ua)}getDefaultOptions(){return ee(this,Fa)}setDefaultOptions(n){Ye(this,Fa,n)}setQueryDefaults(n,e){ee(this,vd).set(ep(n),{queryKey:n,defaultOptions:e})}getQueryDefaults(n){const e=[...ee(this,vd).values()];let t={};return e.forEach(r=>{tp(n,r.queryKey)&&(t={...t,...r.defaultOptions})}),t}setMutationDefaults(n,e){ee(this,yd).set(ep(n),{mutationKey:n,defaultOptions:e})}getMutationDefaults(n){const e=[...ee(this,yd).values()];let t={};return e.forEach(r=>{tp(n,r.mutationKey)&&(t={...t,...r.defaultOptions})}),t}defaultQueryOptions(n){if(n!=null&&n._defaulted)return n;const e={...ee(this,Fa).queries,...(n==null?void 0:n.queryKey)&&this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return e.queryHash||(e.queryHash=nM(e.queryKey,e)),typeof e.refetchOnReconnect>"u"&&(e.refetchOnReconnect=e.networkMode!=="always"),typeof e.throwOnError>"u"&&(e.throwOnError=!!e.suspense),typeof e.networkMode>"u"&&e.persister&&(e.networkMode="offlineFirst"),e}defaultMutationOptions(n){return n!=null&&n._defaulted?n:{...ee(this,Fa).mutations,...(n==null?void 0:n.mutationKey)&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){ee(this,tr).clear(),ee(this,Ua).clear()}},tr=new WeakMap,Ua=new WeakMap,Fa=new WeakMap,vd=new WeakMap,yd=new WeakMap,za=new WeakMap,xd=new WeakMap,_d=new WeakMap,xP),li,_n,Tp,qr,sc,Sd,Qs,Cp,wd,Ed,oc,ac,Ba,Md,lc,Qf,Ap,B1,Rp,V1,Pp,H1,Ip,$1,Lp,W1,Dp,G1,Np,j1,j0,SL,_P,lW=(_P=class extends Zp{constructor(e,t){super();ct(this,lc);ct(this,Ap);ct(this,Rp);ct(this,Pp);ct(this,Ip);ct(this,Lp);ct(this,Dp);ct(this,Np);ct(this,j0);ct(this,li,void 0);ct(this,_n,void 0);ct(this,Tp,void 0);ct(this,qr,void 0);ct(this,sc,void 0);ct(this,Sd,void 0);ct(this,Qs,void 0);ct(this,Cp,void 0);ct(this,wd,void 0);ct(this,Ed,void 0);ct(this,oc,void 0);ct(this,ac,void 0);ct(this,Ba,void 0);ct(this,Md,new Set);this.options=t,Ye(this,li,e),Ye(this,Qs,null),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ee(this,_n).addObserver(this),n2(ee(this,_n),this.options)?Gt(this,lc,Qf).call(this):this.updateResult(),Gt(this,Ip,$1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return X1(ee(this,_n),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return X1(ee(this,_n),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Gt(this,Lp,W1).call(this),Gt(this,Dp,G1).call(this),ee(this,_n).removeObserver(this)}setOptions(e,t){const r=this.options,i=ee(this,_n);if(this.options=ee(this,li).defaultQueryOptions(e),U1(r,this.options)||ee(this,li).getQueryCache().notify({type:"observerOptionsUpdated",query:ee(this,_n),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),Gt(this,Np,j1).call(this);const s=this.hasListeners();s&&r2(ee(this,_n),i,this.options,r)&&Gt(this,lc,Qf).call(this),this.updateResult(t),s&&(ee(this,_n)!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Gt(this,Ap,B1).call(this);const o=Gt(this,Rp,V1).call(this);s&&(ee(this,_n)!==i||this.options.enabled!==r.enabled||o!==ee(this,Ba))&&Gt(this,Pp,H1).call(this,o)}getOptimisticResult(e){const t=ee(this,li).getQueryCache().build(ee(this,li),e),r=this.createResult(t,e);return uW(this,r)&&(Ye(this,qr,r),Ye(this,Sd,this.options),Ye(this,sc,ee(this,_n).state)),r}getCurrentResult(){return ee(this,qr)}trackResult(e){const t={};return Object.keys(e).forEach(r=>{Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:()=>(ee(this,Md).add(r),e[r])})}),t}getCurrentQuery(){return ee(this,_n)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=ee(this,li).defaultQueryOptions(e),r=ee(this,li).getQueryCache().build(ee(this,li),t);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,t))}fetch(e){return Gt(this,lc,Qf).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),ee(this,qr)))}createResult(e,t){var R;const r=ee(this,_n),i=this.options,s=ee(this,qr),o=ee(this,sc),a=ee(this,Sd),u=e!==r?e.state:ee(this,Tp),{state:f}=e;let{error:h,errorUpdatedAt:p,fetchStatus:m,status:v}=f,w=!1,x;if(t._optimisticResults){const P=this.hasListeners(),D=!P&&n2(e,t),V=P&&r2(e,r,t,i);(D||V)&&(m=by(e.options.networkMode)?"fetching":"paused",f.dataUpdatedAt||(v="pending")),t._optimisticResults==="isRestoring"&&(m="idle")}if(t.select&&typeof f.data<"u")if(s&&f.data===(o==null?void 0:o.data)&&t.select===ee(this,Cp))x=ee(this,wd);else try{Ye(this,Cp,t.select),x=t.select(f.data),x=z1(s==null?void 0:s.data,x,t),Ye(this,wd,x),Ye(this,Qs,null)}catch(P){Ye(this,Qs,P)}else x=f.data;if(typeof t.placeholderData<"u"&&typeof x>"u"&&v==="pending"){let P;if(s!=null&&s.isPlaceholderData&&t.placeholderData===(a==null?void 0:a.placeholderData))P=s.data;else if(P=typeof t.placeholderData=="function"?t.placeholderData((R=ee(this,Ed))==null?void 0:R.state.data,ee(this,Ed)):t.placeholderData,t.select&&typeof P<"u")try{P=t.select(P),Ye(this,Qs,null)}catch(D){Ye(this,Qs,D)}typeof P<"u"&&(v="success",x=z1(s==null?void 0:s.data,P,t),w=!0)}ee(this,Qs)&&(h=ee(this,Qs),x=ee(this,wd),p=Date.now(),v="error");const g=m==="fetching",S=v==="pending",_=v==="error",b=S&&g;return{status:v,fetchStatus:m,isPending:S,isSuccess:v==="success",isError:_,isInitialLoading:b,isLoading:b,data:x,dataUpdatedAt:f.dataUpdatedAt,error:h,errorUpdatedAt:p,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:g,isRefetching:g&&!S,isLoadingError:_&&f.dataUpdatedAt===0,isPaused:m==="paused",isPlaceholderData:w,isRefetchError:_&&f.dataUpdatedAt!==0,isStale:rM(e,t),refetch:this.refetch}}updateResult(e){const t=ee(this,qr),r=this.createResult(ee(this,_n),this.options);if(Ye(this,sc,ee(this,_n).state),Ye(this,Sd,this.options),ee(this,sc).data!==void 0&&Ye(this,Ed,ee(this,_n)),U1(r,t))return;Ye(this,qr,r);const i={},s=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!ee(this,Md).size)return!0;const l=new Set(a??ee(this,Md));return this.options.throwOnError&&l.add("error"),Object.keys(ee(this,qr)).some(u=>{const f=u;return ee(this,qr)[f]!==t[f]&&l.has(f)})};(e==null?void 0:e.listeners)!==!1&&s()&&(i.listeners=!0),Gt(this,j0,SL).call(this,{...i,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Gt(this,Ip,$1).call(this)}},li=new WeakMap,_n=new WeakMap,Tp=new WeakMap,qr=new WeakMap,sc=new WeakMap,Sd=new WeakMap,Qs=new WeakMap,Cp=new WeakMap,wd=new WeakMap,Ed=new WeakMap,oc=new WeakMap,ac=new WeakMap,Ba=new WeakMap,Md=new WeakMap,lc=new WeakSet,Qf=function(e){Gt(this,Np,j1).call(this);let t=ee(this,_n).fetch(this.options,e);return e!=null&&e.throwOnError||(t=t.catch(ts)),t},Ap=new WeakSet,B1=function(){if(Gt(this,Lp,W1).call(this),Id||ee(this,qr).isStale||!k1(this.options.staleTime))return;const t=gL(ee(this,qr).dataUpdatedAt,this.options.staleTime)+1;Ye(this,oc,setTimeout(()=>{ee(this,qr).isStale||this.updateResult()},t))},Rp=new WeakSet,V1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ee(this,_n)):this.options.refetchInterval)??!1},Pp=new WeakSet,H1=function(e){Gt(this,Dp,G1).call(this),Ye(this,Ba,e),!(Id||this.options.enabled===!1||!k1(ee(this,Ba))||ee(this,Ba)===0)&&Ye(this,ac,setInterval(()=>{(this.options.refetchIntervalInBackground||l0.isFocused())&&Gt(this,lc,Qf).call(this)},ee(this,Ba)))},Ip=new WeakSet,$1=function(){Gt(this,Ap,B1).call(this),Gt(this,Pp,H1).call(this,Gt(this,Rp,V1).call(this))},Lp=new WeakSet,W1=function(){ee(this,oc)&&(clearTimeout(ee(this,oc)),Ye(this,oc,void 0))},Dp=new WeakSet,G1=function(){ee(this,ac)&&(clearInterval(ee(this,ac)),Ye(this,ac,void 0))},Np=new WeakSet,j1=function(){const e=ee(this,li).getQueryCache().build(ee(this,li),this.options);if(e===ee(this,_n))return;const t=ee(this,_n);Ye(this,_n,e),Ye(this,Tp,e.state),this.hasListeners()&&(t==null||t.removeObserver(this),e.addObserver(this))},j0=new WeakSet,SL=function(e){Sr.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(ee(this,qr))}),ee(this,li).getQueryCache().notify({query:ee(this,_n),type:"observerResultsUpdated"})})},_P);function cW(n,e){return e.enabled!==!1&&!n.state.dataUpdatedAt&&!(n.state.status==="error"&&e.retryOnMount===!1)}function n2(n,e){return cW(n,e)||n.state.dataUpdatedAt>0&&X1(n,e,e.refetchOnMount)}function X1(n,e,t){if(e.enabled!==!1){const r=typeof t=="function"?t(n):t;return r==="always"||r!==!1&&rM(n,e)}return!1}function r2(n,e,t,r){return t.enabled!==!1&&(n!==e||r.enabled===!1)&&(!t.suspense||n.state.status!=="error")&&rM(n,t)}function rM(n,e){return n.isStaleByTime(e.staleTime)}function uW(n,e){return!U1(n.getCurrentResult(),e)}var wL=M.createContext(void 0),dW=n=>{const e=M.useContext(wL);if(n)return n;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},fW=({client:n,children:e})=>(M.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),M.createElement(wL.Provider,{value:n},e)),EL=M.createContext(!1),hW=()=>M.useContext(EL);EL.Provider;function pW(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var mW=M.createContext(pW()),gW=()=>M.useContext(mW);function vW(n,e){return typeof n=="function"?n(...e):!!n}var yW=(n,e)=>{(n.suspense||n.throwOnError)&&(e.isReset()||(n.retryOnMount=!1))},xW=n=>{M.useEffect(()=>{n.clearReset()},[n])},_W=({result:n,errorResetBoundary:e,throwOnError:t,query:r})=>n.isError&&!e.isReset()&&!n.isFetching&&r&&vW(t,[n.error,r]),SW=(n,e)=>typeof e.state.data>"u",wW=n=>{n.suspense&&typeof n.staleTime!="number"&&(n.staleTime=1e3)},EW=(n,e)=>(n==null?void 0:n.suspense)&&e.isPending,MW=(n,e,t)=>e.fetchOptimistic(n).catch(()=>{t.clearReset()});function bW(n,e,t){const r=dW(t),i=hW(),s=gW(),o=r.defaultQueryOptions(n);o._optimisticResults=i?"isRestoring":"optimistic",wW(o),yW(o,s),xW(s);const[a]=M.useState(()=>new e(r,o)),l=a.getOptimisticResult(o);if(M.useSyncExternalStore(M.useCallback(u=>{const f=i?()=>{}:a.subscribe(Sr.batchCalls(u));return a.updateResult(),f},[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),M.useEffect(()=>{a.setOptions(o,{listeners:!1})},[o,a]),EW(o,l))throw MW(o,a,s);if(_W({result:l,errorResetBoundary:s,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw l.error;return o.notifyOnChangeProps?l:a.trackResult(l)}function iM(n,e){return bW({...n,enabled:!0,suspense:!0,throwOnError:SW},lW,e)}/** + * @license lucide-react v0.323.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var TW={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var _W={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + */const CW=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),gn=(n,e)=>{const t=M.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:a="",children:l,...u},f)=>M.createElement("svg",{ref:f,...TW,width:i,height:i,stroke:r,strokeWidth:o?Number(s)*24/Number(i):s,className:["lucide",`lucide-${CW(n)}`,a].join(" "),...u},[...e.map(([h,p])=>M.createElement(h,p)),...Array.isArray(l)?l:[l]]));return t.displayName=`${n}`,t};/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const SW=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Sn=(n,e)=>{const t=M.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:a="",children:l,...u},f)=>M.createElement("svg",{ref:f,..._W,width:i,height:i,stroke:r,strokeWidth:o?Number(s)*24/Number(i):s,className:["lucide",`lucide-${SW(n)}`,a].join(" "),...u},[...e.map(([h,p])=>M.createElement(h,p)),...Array.isArray(l)?l:[l]]));return t.displayName=`${n}`,t};/** + */const AW=gn("AudioWaveform",[["path",{d:"M2 13a2 2 0 0 0 2-2V7a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0V4a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0v-4a2 2 0 0 1 2-2",key:"57tc96"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wW=Sn("AudioWaveform",[["path",{d:"M2 13a2 2 0 0 0 2-2V7a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0V4a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0v-4a2 2 0 0 1 2-2",key:"57tc96"}]]);/** + */const RW=gn("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const EW=Sn("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** + */const PW=gn("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const MW=Sn("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** + */const IW=gn("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bW=Sn("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + */const LW=gn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const TW=Sn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const DW=gn("CircleDashed",[["path",{d:"M10.1 2.18a9.93 9.93 0 0 1 3.8 0",key:"1qdqn0"}],["path",{d:"M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7",key:"1bq7p6"}],["path",{d:"M21.82 10.1a9.93 9.93 0 0 1 0 3.8",key:"1rlaqf"}],["path",{d:"M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69",key:"1xk03u"}],["path",{d:"M13.9 21.82a9.94 9.94 0 0 1-3.8 0",key:"l7re25"}],["path",{d:"M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7",key:"1v18p6"}],["path",{d:"M2.18 13.9a9.93 9.93 0 0 1 0-3.8",key:"xdo6bj"}],["path",{d:"M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69",key:"1jjmaz"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const CW=Sn("CircleDashed",[["path",{d:"M10.1 2.18a9.93 9.93 0 0 1 3.8 0",key:"1qdqn0"}],["path",{d:"M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7",key:"1bq7p6"}],["path",{d:"M21.82 10.1a9.93 9.93 0 0 1 0 3.8",key:"1rlaqf"}],["path",{d:"M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69",key:"1xk03u"}],["path",{d:"M13.9 21.82a9.94 9.94 0 0 1-3.8 0",key:"l7re25"}],["path",{d:"M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7",key:"1v18p6"}],["path",{d:"M2.18 13.9a9.93 9.93 0 0 1 0-3.8",key:"xdo6bj"}],["path",{d:"M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69",key:"1jjmaz"}]]);/** + */const NW=gn("Dna",[["path",{d:"M2 15c6.667-6 13.333 0 20-6",key:"1pyr53"}],["path",{d:"M9 22c1.798-1.998 2.518-3.995 2.807-5.993",key:"q3hbxp"}],["path",{d:"M15 2c-1.798 1.998-2.518 3.995-2.807 5.993",key:"80uv8i"}],["path",{d:"m17 6-2.5-2.5",key:"5cdfhj"}],["path",{d:"m14 8-1-1",key:"15nbz5"}],["path",{d:"m7 18 2.5 2.5",key:"16tu1a"}],["path",{d:"m3.5 14.5.5.5",key:"hapbhd"}],["path",{d:"m20 9 .5.5",key:"1n7z02"}],["path",{d:"m6.5 12.5 1 1",key:"cs35ky"}],["path",{d:"m16.5 10.5 1 1",key:"696xn5"}],["path",{d:"m10 16 1.5 1.5",key:"11lckj"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const AW=Sn("Dna",[["path",{d:"M2 15c6.667-6 13.333 0 20-6",key:"1pyr53"}],["path",{d:"M9 22c1.798-1.998 2.518-3.995 2.807-5.993",key:"q3hbxp"}],["path",{d:"M15 2c-1.798 1.998-2.518 3.995-2.807 5.993",key:"80uv8i"}],["path",{d:"m17 6-2.5-2.5",key:"5cdfhj"}],["path",{d:"m14 8-1-1",key:"15nbz5"}],["path",{d:"m7 18 2.5 2.5",key:"16tu1a"}],["path",{d:"m3.5 14.5.5.5",key:"hapbhd"}],["path",{d:"m20 9 .5.5",key:"1n7z02"}],["path",{d:"m6.5 12.5 1 1",key:"cs35ky"}],["path",{d:"m16.5 10.5 1 1",key:"696xn5"}],["path",{d:"m10 16 1.5 1.5",key:"11lckj"}]]);/** + */const OW=gn("Drum",[["path",{d:"m2 2 8 8",key:"1v6059"}],["path",{d:"m22 2-8 8",key:"173r8a"}],["ellipse",{cx:"12",cy:"9",rx:"10",ry:"5",key:"liohsx"}],["path",{d:"M7 13.4v7.9",key:"1yi6u9"}],["path",{d:"M12 14v8",key:"1tn2tj"}],["path",{d:"M17 13.4v7.9",key:"eqz2v3"}],["path",{d:"M2 9v8a10 5 0 0 0 20 0V9",key:"1750ul"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const RW=Sn("Drum",[["path",{d:"m2 2 8 8",key:"1v6059"}],["path",{d:"m22 2-8 8",key:"173r8a"}],["ellipse",{cx:"12",cy:"9",rx:"10",ry:"5",key:"liohsx"}],["path",{d:"M7 13.4v7.9",key:"1yi6u9"}],["path",{d:"M12 14v8",key:"1tn2tj"}],["path",{d:"M17 13.4v7.9",key:"eqz2v3"}],["path",{d:"M2 9v8a10 5 0 0 0 20 0V9",key:"1750ul"}]]);/** + */const kW=gn("FileUp",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const PW=Sn("FileUp",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);/** + */const UW=gn("Footprints",[["path",{d:"M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z",key:"1dudjm"}],["path",{d:"M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z",key:"l2t8xc"}],["path",{d:"M16 17h4",key:"1dejxt"}],["path",{d:"M4 13h4",key:"1bwh8b"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const IW=Sn("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** + */const FW=gn("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const LW=Sn("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/** + */const zW=gn("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const DW=Sn("HelpCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const ML=gn("HelpCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const EL=Sn("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** + */const bL=gn("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const NW=Sn("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/** + */const BW=gn("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ML=Sn("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/** + */const TL=gn("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const OW=Sn("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** + */const VW=gn("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kW=Sn("PauseCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);/** + */const HW=gn("PauseCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const UW=Sn("PlayCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/** + */const $W=gn("PlayCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bL=Sn("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);/** + */const CL=gn("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const FW=Sn("Ribbon",[["path",{d:"M17.75 9.01c-.52 2.08-1.83 3.64-3.18 5.49l-2.6 3.54-2.97 4-3.5-2.54 3.85-4.97c-1.86-2.61-2.8-3.77-3.16-5.44",key:"1njedg"}],["path",{d:"M17.75 9.01A7 7 0 0 0 6.2 9.1C6.06 8.5 6 7.82 6 7c0-3.5 2.83-5 5.98-5C15.24 2 18 3.5 18 7c0 .73-.09 1.4-.25 2.01Z",key:"10len7"}],["path",{d:"m9.35 14.53 2.64-3.31",key:"1wfi09"}],["path",{d:"m11.97 18.04 2.99 4 3.54-2.54-3.93-5",key:"1ezyge"}],["path",{d:"M14 8c0 1-1 2-2.01 3.22C11 10 10 9 10 8a2 2 0 1 1 4 0",key:"aw0zq5"}]]);/** + */const WW=gn("Ribbon",[["path",{d:"M17.75 9.01c-.52 2.08-1.83 3.64-3.18 5.49l-2.6 3.54-2.97 4-3.5-2.54 3.85-4.97c-1.86-2.61-2.8-3.77-3.16-5.44",key:"1njedg"}],["path",{d:"M17.75 9.01A7 7 0 0 0 6.2 9.1C6.06 8.5 6 7.82 6 7c0-3.5 2.83-5 5.98-5C15.24 2 18 3.5 18 7c0 .73-.09 1.4-.25 2.01Z",key:"10len7"}],["path",{d:"m9.35 14.53 2.64-3.31",key:"1wfi09"}],["path",{d:"m11.97 18.04 2.99 4 3.54-2.54-3.93-5",key:"1ezyge"}],["path",{d:"M14 8c0 1-1 2-2.01 3.22C11 10 10 9 10 8a2 2 0 1 1 4 0",key:"aw0zq5"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zW=Sn("ScreenShare",[["path",{d:"M13 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-3",key:"i8wdob"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m17 8 5-5",key:"fqif7o"}],["path",{d:"M17 3h5v5",key:"1o3tu8"}]]);/** + */const GW=gn("ScreenShare",[["path",{d:"M13 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-3",key:"i8wdob"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m17 8 5-5",key:"fqif7o"}],["path",{d:"M17 3h5v5",key:"1o3tu8"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const BW=Sn("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + */const jW=gn("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const VW=Sn("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const XW=gn("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const HW=Sn("Shell",[["path",{d:"M14 11a2 2 0 1 1-4 0 4 4 0 0 1 8 0 6 6 0 0 1-12 0 8 8 0 0 1 16 0 10 10 0 1 1-20 0 11.93 11.93 0 0 1 2.42-7.22 2 2 0 1 1 3.16 2.44",key:"1cn552"}]]);/** + */const qW=gn("Shell",[["path",{d:"M14 11a2 2 0 1 1-4 0 4 4 0 0 1 8 0 6 6 0 0 1-12 0 8 8 0 0 1 16 0 10 10 0 1 1-20 0 11.93 11.93 0 0 1 2.42-7.22 2 2 0 1 1 3.16 2.44",key:"1cn552"}]]);/** * @license lucide-react v0.323.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $W=Sn("Waves",[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]]),WW=({audio:n,track:e,className:t,...r})=>{var l;const{showUI:i}=Nc(),{data:s}=nM({queryKey:["soundcloud-stream-url",e.id],queryFn:async()=>await c7(e.id)}),[o,a]=M.useState(!0);return M.useEffect(()=>{if(!s)n.pause();else{n.src=s;const u=n.play();u!==void 0&&u.then(()=>console.log(`Playing ${e.title}`)).catch(f=>{console.error(`Error playing ${e.title}`)})}return()=>{n.pause()}},[n,s,e]),M.useEffect(()=>{if(o){const u=n.play();u!==void 0&&u.then(()=>console.log("Playing...")).catch(f=>{console.error("Error playing!")})}else n.pause();return()=>{n.pause()}},[n,o]),N.jsxs("div",{className:jt("flex w-fit max-w-xs flex-row items-center justify-start gap-2 rounded-lg p-4 sm:bg-black/25",t,!i&&"hidden"),...r,children:[N.jsx("div",{className:"pointer-events-auto cursor-pointer rounded-full p-2 hover:scale-110",onClick:()=>a(u=>!u),children:o?N.jsx(kW,{}):N.jsx(UW,{})}),N.jsxs("div",{className:"hidden flex-col items-start justify-center gap-1 sm:flex",children:[N.jsx("span",{className:"w-64 max-w-64 truncate text-sm text-foreground",children:e.title}),N.jsx("span",{className:"truncate text-xs text-foreground/50",children:((l=e.user)==null?void 0:l.username)??"Unknown Artist"})]})]})},GW=({...n})=>{const{track:e}=i$();return e?N.jsx(WW,{track:e,...n}):N.jsx(N.Fragment,{})},jW=({audio:n,audioSource:e})=>{switch(e){case Jn.SOUNDCLOUD:return N.jsx(GW,{audio:n});case Jn.FILE_UPLOAD:return N.jsx(QH,{audio:n});default:return e}},XW=({audio:n,onDisabled:e,onStreamCreated:t})=>{const r=M.useRef(null);return M.useEffect(()=>(console.log("Disabling mic..."),e(),r!=null&&r.current&&(r.current=null),console.log("Enabling mic..."),navigator.mediaDevices?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(t).catch(i=>{console.error(i),alert("Microphone access denied by user")}):alert("User mediaDevices not available"),()=>{n.pause(),r!=null&&r.current&&(r.current=null)}),[n,e,t]),N.jsx(N.Fragment,{})},qW=({audio:n,onDisabled:e,onStreamCreated:t})=>{const r=M.useRef(null);return M.useEffect(()=>(console.log("Disabling share..."),e(),r!=null&&r.current&&(r.current=null),console.log("Enabling share..."),navigator.mediaDevices?navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",width:1},audio:!0}).then(i=>{console.log(i.getAudioTracks()),t(i)}).catch(i=>{console.error(i),alert("Share access denied by user")}):alert("User mediaDevices not available"),()=>{n.pause(),r!=null&&r.current&&(r.current=null)}),[n,e,t]),N.jsx(N.Fragment,{})},rM=M.createContext(null),YW=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.audioSource)??ZI()[0]);return N.jsx(rM.Provider,{value:{config:{audioSource:t},setters:{setAudioSource:r}},children:e})};function iM(){const n=M.useContext(rM);if(!n)throw new Error("useAudioSourceContext must be used within a AudioSourceContextProvider");return n.config}function ZW(){const n=M.useContext(rM);if(!n)throw new Error("useAudioSourceContext must be used within a AudioSourceContextProvider");return n.setters}function KW(n,e){return{onDisabled:()=>{e.disconnectInputs()},onStreamCreated:t=>{n.pause();const r=e._audioCtx.createMediaStreamSource(t);e.connectInput(r),e.volume=0}}}const i2={1:"1/24th octave bands",2:"1/12th octave bands",3:"1/8th octave bands",4:"1/6th octave bands",5:"1/4th octave bands",6:"1/3rd octave bands",7:"Half octave bands",8:"Full octave bands"},QW=["overall","peak","bass","lowMid","mid","highMid","treble"],TL=2**(1/24),JW=440*TL**-114;class l0{constructor(e,t=void 0,r=1){at(this,"_analyzer");at(this,"_input");at(this,"_output");at(this,"_audioCtx");at(this,"_sources");at(this,"_outNodes");at(this,"_fftData");at(this,"_freqBinInfos",[]);at(this,"_energy",{val:0,peak:0,hold:0});at(this,"_minFreq",20);at(this,"_maxFreq",22e3);at(this,"_mode",2);at(this,"_runId");if(t===void 0?this._audioCtx=new window.AudioContext:this._audioCtx=t,!this._audioCtx.createGain)throw new Error("Provided audio context is not valid");this._analyzer=this._audioCtx.createAnalyser(),this._input=this._audioCtx.createGain(),this._output=this._audioCtx.createGain(),this._sources=[],this.connectInput(this._audioCtx.createMediaElementSource(e)),this._input.connect(this._analyzer),this._analyzer.connect(this._output),this._outNodes=[this._audioCtx.destination],this._output.connect(this._outNodes[0]),this._analyzer.smoothingTimeConstant=.5,this._analyzer.minDecibels=-85,this._analyzer.maxDecibels=-25,this._analyzer.fftSize=8192,this._fftData=new Uint8Array(this._analyzer.frequencyBinCount),this._updateFreqBins(),this.toggleAnalyzer(!0),this.volume=r}getBars(){return this._freqBinInfos}get mode(){return this._mode}set mode(e){this._mode=e,this._updateFreqBins()}get volume(){return this._output.gain.value}set volume(e){this._output.gain.value=e}get isOn(){return this._runId!==void 0}_updateFreqBins(){const e=[],t=o=>o*this._audioCtx.sampleRate/this._analyzer.fftSize||1,r=(o,a,l,u,f,h)=>e.push({binLo:o,binHi:a,freqLo:l,freqHi:u,ratioLo:f,ratioHi:h,value:0}),i=[];for(let o=0;o<11;o++)for(let a=0;a<24;a++){const l=JW*TL**(o*24+a),u=this._freqToBin(l,!1),f=t(u),h=t(u+1),p=(l-f)/(h-f);i.push({freq:l,bin:u,ratio:p})}const s=[0,1,2,3,4,6,8,12,24][this._mode];for(let o=0;othis._maxFreq||h>=this._analyzer.fftSize/2){v.binHi++,v.ratioHi=0,v.freqHi=t(v.binHi);break}if(a>=this._minFreq){if(m>0){const w=l-v.binHi;w>1&&(v.binHi=l-(w>>1),v.ratioHi=0,v.freqHi=t(v.binHi),m>1&&v.binHi>v.binLo&&v.binLo>e[m-2].binHi&&(v.ratioLo=0,v.freqLo=t(v.binLo)),l=v.binHi+1),h>l&&l>v.binHi&&(u=0,a=t(l))}r(l,h,a,f,u,p)}}this._freqBinInfos=e}_freqToBin(e,t=!0){const r=this._analyzer.frequencyBinCount-1,i=(t?Math.round:Math.floor)(e*this._analyzer.fftSize/this._audioCtx.sampleRate);return it[s]+(t[s+1]-t[s])*o;let i=0;for(let s=0;sh&&(h=t[p]);h/=255,o.value=h,i+=h}this._energy.val=i/e,this._energy.val>=this._energy.peak?(this._energy.peak=this._energy.val,this._energy.hold=30):this._energy.hold>0?this._energy.hold--:this._energy.peak>0&&(this._energy.peak*=(30+this._energy.hold--)/30),this._runId=requestAnimationFrame(s=>this._analyze())}toggleAnalyzer(e=void 0){const t=this.isOn;return e===void 0&&(e=!t),t&&!e&&this._runId!==void 0?cancelAnimationFrame(this._runId):!t&&e&&(this._runId=requestAnimationFrame(r=>this._analyze())),this.isOn}getEnergy(e="overall"){if(e==="overall")return this._energy.val;if(e=="peak")return this._energy.peak;const t={bass:[20,250],lowMid:[250,500],mid:[500,2e3],highMid:[2e3,4e3],treble:[4e3,16e3]},[r,i]=t[e],s=this._freqToBin(r),o=i?this._freqToBin(i):s;let a=0;for(let l=s;l<=o;l++)a+=this._fftData[l];return a/(o-s+1)/1/255}connectInput(e){if(!e.connect)throw new Error("Audio source must be an instance of AudioNode");this._sources.includes(e)||(e.connect(this._input),this._sources.push(e))}disconnectInputs(){for(const e of Array.from(this._sources)){const t=this._sources.indexOf(e);t>=0&&(e.disconnect(this._input),this._sources.splice(t,1))}}}function s2(n,e){const t=n.createScriptProcessor(e.length,1,1);return t.onaudioprocess=r=>{r.inputBuffer.copyFromChannel(e,0)},t}function eG(n,e){e%2===0&&(e-=1);const t=new Float32Array(e),r=(e-1)/2|0;for(let l=0;l<=r;l++){const u=.53836+.46164*Math.cos(l*Math.PI/(r+1));if(l%2===1){const f=2/Math.PI/l;t[r+l]=u*f,t[r-l]=u*-f}}const i=n.createBuffer(2,e,n.sampleRate);i.copyToChannel(t,0),i.copyToChannel(t,1);const s=n.createConvolver();s.normalize=!1,s.buffer=i;const o=r/n.sampleRate,a=n.createDelay(o);return a.delayTime.value=o,[a,s]}class c0{constructor(e,t=void 0,r=512,i=1024){at(this,"_audioCtx");at(this,"timeSamples");at(this,"quadSamples");at(this,"_sources");at(this,"_inputs");at(this,"volume",1);t===void 0?this._audioCtx=new window.AudioContext:this._audioCtx=t,this.timeSamples=new Float32Array(r),this.quadSamples=new Float32Array(r);const[s,o]=eG(this._audioCtx,i-r);this._inputs=[s,o];const a=s2(this._audioCtx,this.timeSamples),l=s2(this._audioCtx,this.quadSamples),u=this._audioCtx.createMediaElementSource(e);this._sources=[],this.connectInput(u),o.connect(a),s.connect(l),a.connect(this._audioCtx.destination),l.connect(this._audioCtx.destination),u.connect(this._audioCtx.destination)}disconnectInputs(){for(const e of Array.from(this._sources)){const t=this._sources.indexOf(e);if(t>=0){for(const r of this._inputs)e.disconnect(r);this._sources.splice(t,1)}}}connectInput(e){if(!e.connect)throw new Error("Audio source must be an instance of AudioNode");if(!this._sources.includes(e)){for(const t of this._inputs)e.connect(t);this._sources.push(e)}}}const CL=({analyzer:n})=>{const e=Sy(),t=XI(),{resizeVisualSourceData:r}=Yd(),i=M.useRef(null),s=M.useCallback(()=>{const o=n.quadSamples.length;if(e.length!==o||t.length!==o){console.log(`Resizing ${o}`),r(o);return}n.timeSamples.forEach((a,l)=>{e[l]=a}),n.quadSamples.forEach((a,l)=>{t[l]=a})},[e,t,n,r]);return M.useEffect(()=>{i.current&&cancelAnimationFrame(i.current);const o=()=>{s(),i.current=requestAnimationFrame(o)};return i.current=requestAnimationFrame(o),()=>cancelAnimationFrame(i.current)},[e,t,s]),N.jsx(N.Fragment,{})},tG=({mode:n,audioSource:e})=>{const t=M.useMemo(()=>QI(),[]),r=M.useMemo(()=>KI(),[]),i=M.useMemo(()=>{switch(console.log("Creating analyzer..."),n){case Rt.AUDIO:return new l0(r,t,1);case Rt.AUDIO_SCOPE:return new c0(r,t);default:return n}},[n,r,t]);return N.jsxs(N.Fragment,{children:[N.jsx(jW,{audio:r,audioSource:e}),i instanceof l0?N.jsx(qI,{analyzer:i}):i instanceof c0?N.jsx(CL,{analyzer:i}):i]})},nG=({mode:n,audioSource:e})=>{const t=M.useMemo(()=>QI(),[]),r=M.useMemo(()=>KI(),[]),i=M.useMemo(()=>{switch(console.log("Creating analyzer..."),n){case Rt.AUDIO:return new l0(r,t,0);case Rt.AUDIO_SCOPE:return new c0(r,t);default:return n}},[r,t,n]),{onDisabled:s,onStreamCreated:o}=KW(r,i);return N.jsxs(N.Fragment,{children:[e===Jn.MICROPHONE?N.jsx(XW,{audio:r,onDisabled:s,onStreamCreated:o}):e===Jn.SCREEN_SHARE?N.jsx(qW,{audio:r,onDisabled:s,onStreamCreated:o}):e,i instanceof l0?N.jsx(qI,{analyzer:i}):i instanceof c0?N.jsx(CL,{analyzer:i}):i]})},rG=({mode:n})=>{const{audioSource:e}=iM();switch(e){case Jn.SOUNDCLOUD:case Jn.FILE_UPLOAD:return N.jsx(tG,{mode:n,audioSource:e});case Jn.MICROPHONE:case Jn.SCREEN_SHARE:return N.jsx(nG,{mode:n,audioSource:e});default:return e}},AL=["grid","sphere","cube","diffusedRing","dna","boxes","ribbons"],sM=M.createContext(null),iG=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.nPerSide)??10),[i,s]=M.useState((n==null?void 0:n.unitSideLength)??.5),[o,a]=M.useState((n==null?void 0:n.unitSpacingScalar)??.1),[l,u]=M.useState((n==null?void 0:n.volume)??!0);return N.jsx(sM.Provider,{value:{config:{nPerSide:t,unitSideLength:i,unitSpacingScalar:o,volume:l},setters:{setNPerSide:r,setUnitSideLength:s,setUnitSpacingScalar:a,setVolume:u,reset:()=>{r((n==null?void 0:n.nPerSide)??10),s((n==null?void 0:n.unitSideLength)??.5),a((n==null?void 0:n.unitSpacingScalar)??.1),u((n==null?void 0:n.volume)??!0)}}},children:e})};function sG(){const n=M.useContext(sM);if(!n)throw new Error("useCubeVisualConfigContext must be used within a CubeVisualConfigContextProvider");return n.config}function oG(){const n=M.useContext(sM);if(!n)throw new Error("useCubeVisualConfigContextSetters must be used within a CubeVisualConfigContextProvider");return n.setters}const oM=M.createContext(null),aG=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.radius)??2),[i,s]=M.useState((n==null?void 0:n.pointSize)??.2),[o,a]=M.useState((n==null?void 0:n.mirrorEffects)??!1);return N.jsx(oM.Provider,{value:{config:{radius:t,pointSize:i,mirrorEffects:o},setters:{setRadius:r,setPointSize:s,setMirrorEffects:a}},children:e})};function lG(){const n=M.useContext(oM);if(!n)throw new Error("useRingVisualConfigContext must be used within a RingVisualConfigContextProvider");return n.config}function cG(){const n=M.useContext(oM);if(!n)throw new Error("useRingVisualConfigContextSetters must be used within a RingVisualConfigContextProvider");return n.setters}const RL=M.createContext(null),uG=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.multi)??!0),[i,s]=M.useState((n==null?void 0:n.helixLength)??50),[o,a]=M.useState((n==null?void 0:n.helixRadius)??1),[l,u]=M.useState((n==null?void 0:n.helixWindingSeparation)??10),[f,h]=M.useState((n==null?void 0:n.strandRadius)??.1),[p,m]=M.useState((n==null?void 0:n.baseSpacing)??.35),[v,w]=M.useState((n==null?void 0:n.strandOffsetRad)??Math.PI/2),[x,g]=M.useState((n==null?void 0:n.mirrorEffects)??!0),[S,_]=M.useState((n==null?void 0:n.fixedBaseGap)??!1);return N.jsx(RL.Provider,{value:{config:{multi:t,helixLength:i,helixRadius:o,helixWindingSeparation:l,strandRadius:f,baseSpacing:p,strandOffsetRad:v,mirrorEffects:x,fixedBaseGap:S},setters:{setMulti:r,setHelixLength:s,setHelixRadius:a,setHelixWindingSeparation:u,setStrandRadius:h,setBaseSpacing:m,setStrandOffsetRad:w,setMirrorEffects:g,setFixedBaseGap:_}},children:e})};function dee(){const n=M.useContext(RL);if(!n)throw new Error("useDnaVisualConfigContext must be used within a DnaVisualConfigContextProvider");return n.config}const aM=M.createContext(null),dG=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.nCols)??100),[i,s]=M.useState((n==null?void 0:n.nRows)??100),[o,a]=M.useState((n==null?void 0:n.unitSideLength)??.025),[l,u]=M.useState((n==null?void 0:n.unitSpacingScalar)??5);return N.jsx(aM.Provider,{value:{config:{nCols:t,nRows:i,unitSideLength:o,unitSpacingScalar:l},setters:{setNCols:r,setNRows:s,setUnitSideLength:a,setUnitSpacingScalar:u,reset:()=>{r((n==null?void 0:n.nCols)??100),s((n==null?void 0:n.nRows)??100),a((n==null?void 0:n.unitSideLength)??.025),u((n==null?void 0:n.unitSpacingScalar)??5)}}},children:e})};function fG(){const n=M.useContext(aM);if(!n)throw new Error("useGridVisualConfigContext must be used within a GridVisualConfigContextProvider");return n.config}function hG(){const n=M.useContext(aM);if(!n)throw new Error("useGridVisualConfigContextSetters must be used within a GridVisualConfigContextProvider");return n.setters}const pG=M.createContext(null),mG=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.nRibbons)??5);return N.jsx(pG.Provider,{value:{config:{nRibbons:t},setters:{setNRibbons:r,reset:()=>{r((n==null?void 0:n.nRibbons)??5)}}},children:e})},lM=M.createContext(null),gG=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.radius)??2),[i,s]=M.useState((n==null?void 0:n.nPoints)??800),[o,a]=M.useState((n==null?void 0:n.unitSideLength)??.05);return N.jsx(lM.Provider,{value:{config:{radius:t,nPoints:i,unitSideLength:o},setters:{setRadius:r,setNPoints:s,setUnitSideLength:a}},children:e})};function vG(){const n=M.useContext(lM);if(!n)throw new Error("useSphereVisualConfigContext must be used within a SphereVisualConfigContextProvider");return n.config}function yG(){const n=M.useContext(lM);if(!n)throw new Error("useSphereVisualConfigContextSetters must be used within a SphereVisualConfigContextProvider");return n.setters}const cM=M.createContext(null),xG=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.maxAmplitude)??1),[i,s]=M.useState((n==null?void 0:n.waveformFrequenciesHz)??[2]),[o,a]=M.useState((n==null?void 0:n.amplitudeSplitRatio)??.75);return N.jsx(cM.Provider,{value:{config:{maxAmplitude:t,waveformFrequenciesHz:[...i],amplitudeSplitRatio:o},setters:{setMaxAmplitude:r,setWaveformFrequenciesHz:s,setAmplitudeSplitRatio:a,reset:()=>{r((n==null?void 0:n.maxAmplitude)??1),s((n==null?void 0:n.waveformFrequenciesHz)??[2]),a((n==null?void 0:n.amplitudeSplitRatio)??.75)}}},children:e})};function PL(){const n=M.useContext(cM);if(!n)throw new Error("useWaveGeneratorContext must be used within a WaveGeneratorContextProvider");return n.config}function IL(){const n=M.useContext(cM);if(!n)throw new Error("useWaveGeneratorContext must be used within a WaveGeneratorContextProvider");return n.setters}const uM=M.createContext(null),_G=({initial:n,children:e})=>{const{mode:t}=Nc(),[r,i]=M.useState((n==null?void 0:n.visual)??AL[0]),[s,o]=M.useState((n==null?void 0:n.colorBackground)??!0),[a,l]=M.useState((n==null?void 0:n.paletteTrackEnergy)??!1),{setWaveformFrequenciesHz:u,setMaxAmplitude:f}=IL();return M.useEffect(()=>{if(t===Rt.WAVE_FORM)switch(r){case"diffusedRing":u([2,10]),f(1);break;default:u([2]),f(1);break}},[r,t,u,f]),M.useEffect(()=>{switch(t){case Rt.WAVE_FORM:case Rt.NOISE:case Rt.AUDIO_SCOPE:case Rt.PARTICLE_NOISE:l(!1);break;case Rt.AUDIO:l(!0);break;default:return t}},[t,l]),N.jsx(uM.Provider,{value:{config:{visual:r,colorBackground:s,paletteTrackEnergy:a},setters:{setVisual:i,setColorBackground:o,setPaletteTrackEnergy:l}},children:N.jsx(iG,{children:N.jsx(dG,{children:N.jsx(aG,{children:N.jsx(uG,{children:N.jsx(gG,{children:N.jsx(mG,{children:e})})})})})})})};function kc(){const n=M.useContext(uM);if(!n)throw new Error("useVisualContext must be used within a VisualContextProvider");return n.config}function dM(){const n=M.useContext(uM);if(!n)throw new Error("useVisualContext must be used within a VisualContextProvider");return n.setters}const LL=()=>{const{colorBackground:n}=kc(),e=XE();return n?Wn.getPalette(e).calcBackgroundColor(0):"#010204"},DL=()=>{const n=LL();return N.jsx("color",{attach:"background",args:[n]})},SG=()=>{const n=LL();return N.jsx("fog",{attach:"fog",args:[n,0,100]})};var NL={exports:{}},Uc={};/** + */const YW=gn("Waves",[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]]),ZW=({audio:n,track:e,className:t,...r})=>{var l;const{showUI:i}=kc(),{data:s}=iM({queryKey:["soundcloud-stream-url",e.id],queryFn:async()=>await m7(e.id)}),[o,a]=M.useState(!0);return M.useEffect(()=>{if(!s)n.pause();else{n.src=s;const u=n.play();u!==void 0&&u.then(()=>console.log(`Playing ${e.title}`)).catch(f=>{console.error(`Error playing ${e.title}`)})}return()=>{n.pause()}},[n,s,e]),M.useEffect(()=>{if(o){const u=n.play();u!==void 0&&u.then(()=>console.log("Playing...")).catch(f=>{console.error("Error playing!")})}else n.pause();return()=>{n.pause()}},[n,o]),N.jsxs("div",{className:jt("flex w-fit max-w-xs flex-row items-center justify-start gap-2 rounded-lg p-4 sm:bg-black/25",t,!i&&"hidden"),...r,children:[N.jsx("div",{className:"pointer-events-auto cursor-pointer rounded-full p-2 hover:scale-110",onClick:()=>a(u=>!u),children:o?N.jsx(HW,{}):N.jsx($W,{})}),N.jsxs("div",{className:"hidden flex-col items-start justify-center gap-1 sm:flex",children:[N.jsx("span",{className:"w-64 max-w-64 truncate text-sm text-foreground",children:e.title}),N.jsx("span",{className:"truncate text-xs text-foreground/50",children:((l=e.user)==null?void 0:l.username)??"Unknown Artist"})]})]})},KW=({...n})=>{const{track:e}=u$();return e?N.jsx(ZW,{track:e,...n}):N.jsx(N.Fragment,{})},QW=({audio:n,audioSource:e})=>{switch(e){case Jn.SOUNDCLOUD:return N.jsx(KW,{audio:n});case Jn.FILE_UPLOAD:return N.jsx(i$,{audio:n});default:return e}},JW=({audio:n,onDisabled:e,onStreamCreated:t})=>{const r=M.useRef(null);return M.useEffect(()=>(console.log("Disabling mic..."),e(),r!=null&&r.current&&(r.current=null),console.log("Enabling mic..."),navigator.mediaDevices?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(t).catch(i=>{console.error(i),alert("Microphone access denied by user")}):alert("User mediaDevices not available"),()=>{n.pause(),r!=null&&r.current&&(r.current=null)}),[n,e,t]),N.jsx(N.Fragment,{})},eG=({audio:n,onDisabled:e,onStreamCreated:t})=>{const r=M.useRef(null);return M.useEffect(()=>(console.log("Disabling share..."),e(),r!=null&&r.current&&(r.current=null),console.log("Enabling share..."),navigator.mediaDevices?navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",width:1},audio:!0}).then(i=>{console.log(i.getAudioTracks()),t(i)}).catch(i=>{console.error(i),alert("Share access denied by user")}):alert("User mediaDevices not available"),()=>{n.pause(),r!=null&&r.current&&(r.current=null)}),[n,e,t]),N.jsx(N.Fragment,{})},sM=M.createContext(null),tG=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.audioSource)??KI()[0]);return N.jsx(sM.Provider,{value:{config:{audioSource:t},setters:{setAudioSource:r}},children:e})};function oM(){const n=M.useContext(sM);if(!n)throw new Error("useAudioSourceContext must be used within a AudioSourceContextProvider");return n.config}function nG(){const n=M.useContext(sM);if(!n)throw new Error("useAudioSourceContext must be used within a AudioSourceContextProvider");return n.setters}function rG(n,e){return{onDisabled:()=>{e.disconnectInputs()},onStreamCreated:t=>{n.pause();const r=e._audioCtx.createMediaStreamSource(t);e.connectInput(r),e.volume=0}}}const i2={1:"1/24th octave bands",2:"1/12th octave bands",3:"1/8th octave bands",4:"1/6th octave bands",5:"1/4th octave bands",6:"1/3rd octave bands",7:"Half octave bands",8:"Full octave bands"},iG=["overall","peak","bass","lowMid","mid","highMid","treble"],AL=2**(1/24),sG=440*AL**-114;class u0{constructor(e,t=void 0,r=1){at(this,"_analyzer");at(this,"_input");at(this,"_output");at(this,"_audioCtx");at(this,"_sources");at(this,"_outNodes");at(this,"_fftData");at(this,"_freqBinInfos",[]);at(this,"_energy",{val:0,peak:0,hold:0});at(this,"_minFreq",20);at(this,"_maxFreq",22e3);at(this,"_mode",2);at(this,"_runId");if(t===void 0?this._audioCtx=new window.AudioContext:this._audioCtx=t,!this._audioCtx.createGain)throw new Error("Provided audio context is not valid");this._analyzer=this._audioCtx.createAnalyser(),this._input=this._audioCtx.createGain(),this._output=this._audioCtx.createGain(),this._sources=[],this.connectInput(this._audioCtx.createMediaElementSource(e)),this._input.connect(this._analyzer),this._analyzer.connect(this._output),this._outNodes=[this._audioCtx.destination],this._output.connect(this._outNodes[0]),this._analyzer.smoothingTimeConstant=.5,this._analyzer.minDecibels=-85,this._analyzer.maxDecibels=-25,this._analyzer.fftSize=8192,this._fftData=new Uint8Array(this._analyzer.frequencyBinCount),this._updateFreqBins(),this.toggleAnalyzer(!0),this.volume=r}getBars(){return this._freqBinInfos}get mode(){return this._mode}set mode(e){this._mode=e,this._updateFreqBins()}get volume(){return this._output.gain.value}set volume(e){this._output.gain.value=e}get isOn(){return this._runId!==void 0}_updateFreqBins(){const e=[],t=o=>o*this._audioCtx.sampleRate/this._analyzer.fftSize||1,r=(o,a,l,u,f,h)=>e.push({binLo:o,binHi:a,freqLo:l,freqHi:u,ratioLo:f,ratioHi:h,value:0}),i=[];for(let o=0;o<11;o++)for(let a=0;a<24;a++){const l=sG*AL**(o*24+a),u=this._freqToBin(l,!1),f=t(u),h=t(u+1),p=(l-f)/(h-f);i.push({freq:l,bin:u,ratio:p})}const s=[0,1,2,3,4,6,8,12,24][this._mode];for(let o=0;othis._maxFreq||h>=this._analyzer.fftSize/2){v.binHi++,v.ratioHi=0,v.freqHi=t(v.binHi);break}if(a>=this._minFreq){if(m>0){const w=l-v.binHi;w>1&&(v.binHi=l-(w>>1),v.ratioHi=0,v.freqHi=t(v.binHi),m>1&&v.binHi>v.binLo&&v.binLo>e[m-2].binHi&&(v.ratioLo=0,v.freqLo=t(v.binLo)),l=v.binHi+1),h>l&&l>v.binHi&&(u=0,a=t(l))}r(l,h,a,f,u,p)}}this._freqBinInfos=e}_freqToBin(e,t=!0){const r=this._analyzer.frequencyBinCount-1,i=(t?Math.round:Math.floor)(e*this._analyzer.fftSize/this._audioCtx.sampleRate);return it[s]+(t[s+1]-t[s])*o;let i=0;for(let s=0;sh&&(h=t[p]);h/=255,o.value=h,i+=h}this._energy.val=i/e,this._energy.val>=this._energy.peak?(this._energy.peak=this._energy.val,this._energy.hold=30):this._energy.hold>0?this._energy.hold--:this._energy.peak>0&&(this._energy.peak*=(30+this._energy.hold--)/30),this._runId=requestAnimationFrame(s=>this._analyze())}toggleAnalyzer(e=void 0){const t=this.isOn;return e===void 0&&(e=!t),t&&!e&&this._runId!==void 0?cancelAnimationFrame(this._runId):!t&&e&&(this._runId=requestAnimationFrame(r=>this._analyze())),this.isOn}getEnergy(e="overall"){if(e==="overall")return this._energy.val;if(e=="peak")return this._energy.peak;const t={bass:[20,250],lowMid:[250,500],mid:[500,2e3],highMid:[2e3,4e3],treble:[4e3,16e3]},[r,i]=t[e],s=this._freqToBin(r),o=i?this._freqToBin(i):s;let a=0;for(let l=s;l<=o;l++)a+=this._fftData[l];return a/(o-s+1)/1/255}connectInput(e){if(!e.connect)throw new Error("Audio source must be an instance of AudioNode");this._sources.includes(e)||(e.connect(this._input),this._sources.push(e))}disconnectInputs(){for(const e of Array.from(this._sources)){const t=this._sources.indexOf(e);t>=0&&(e.disconnect(this._input),this._sources.splice(t,1))}}}function s2(n,e){const t=n.createScriptProcessor(e.length,1,1);return t.onaudioprocess=r=>{r.inputBuffer.copyFromChannel(e,0)},t}function oG(n,e){e%2===0&&(e-=1);const t=new Float32Array(e),r=(e-1)/2|0;for(let l=0;l<=r;l++){const u=.53836+.46164*Math.cos(l*Math.PI/(r+1));if(l%2===1){const f=2/Math.PI/l;t[r+l]=u*f,t[r-l]=u*-f}}const i=n.createBuffer(2,e,n.sampleRate);i.copyToChannel(t,0),i.copyToChannel(t,1);const s=n.createConvolver();s.normalize=!1,s.buffer=i;const o=r/n.sampleRate,a=n.createDelay(o);return a.delayTime.value=o,[a,s]}class d0{constructor(e,t=void 0,r=512,i=1024){at(this,"_audioCtx");at(this,"timeSamples");at(this,"quadSamples");at(this,"_sources");at(this,"_inputs");at(this,"volume",1);t===void 0?this._audioCtx=new window.AudioContext:this._audioCtx=t,this.timeSamples=new Float32Array(r),this.quadSamples=new Float32Array(r);const[s,o]=oG(this._audioCtx,i-r);this._inputs=[s,o];const a=s2(this._audioCtx,this.timeSamples),l=s2(this._audioCtx,this.quadSamples),u=this._audioCtx.createMediaElementSource(e);this._sources=[],this.connectInput(u),o.connect(a),s.connect(l),a.connect(this._audioCtx.destination),l.connect(this._audioCtx.destination),u.connect(this._audioCtx.destination)}disconnectInputs(){for(const e of Array.from(this._sources)){const t=this._sources.indexOf(e);if(t>=0){for(const r of this._inputs)e.disconnect(r);this._sources.splice(t,1)}}}connectInput(e){if(!e.connect)throw new Error("Audio source must be an instance of AudioNode");if(!this._sources.includes(e)){for(const t of this._inputs)e.connect(t);this._sources.push(e)}}}const RL=({analyzer:n})=>{const e=Ey(),t=qI(),{resizeVisualSourceData:r}=Kd(),i=M.useRef(null),s=M.useCallback(()=>{const o=n.quadSamples.length;if(e.length!==o||t.length!==o){console.log(`Resizing ${o}`),r(o);return}n.timeSamples.forEach((a,l)=>{e[l]=a}),n.quadSamples.forEach((a,l)=>{t[l]=a})},[e,t,n,r]);return M.useEffect(()=>{i.current&&cancelAnimationFrame(i.current);const o=()=>{s(),i.current=requestAnimationFrame(o)};return i.current=requestAnimationFrame(o),()=>cancelAnimationFrame(i.current)},[e,t,s]),N.jsx(N.Fragment,{})},aG=({mode:n,audioSource:e})=>{const t=M.useMemo(()=>JI(),[]),r=M.useMemo(()=>QI(),[]),i=M.useMemo(()=>{switch(console.log("Creating analyzer..."),n){case Rt.AUDIO:return new u0(r,t,1);case Rt.AUDIO_SCOPE:return new d0(r,t);default:return n}},[n,r,t]);return N.jsxs(N.Fragment,{children:[N.jsx(QW,{audio:r,audioSource:e}),i instanceof u0?N.jsx(YI,{analyzer:i}):i instanceof d0?N.jsx(RL,{analyzer:i}):i]})},lG=({mode:n,audioSource:e})=>{const t=M.useMemo(()=>JI(),[]),r=M.useMemo(()=>QI(),[]),i=M.useMemo(()=>{switch(console.log("Creating analyzer..."),n){case Rt.AUDIO:return new u0(r,t,0);case Rt.AUDIO_SCOPE:return new d0(r,t);default:return n}},[r,t,n]),{onDisabled:s,onStreamCreated:o}=rG(r,i);return N.jsxs(N.Fragment,{children:[e===Jn.MICROPHONE?N.jsx(JW,{audio:r,onDisabled:s,onStreamCreated:o}):e===Jn.SCREEN_SHARE?N.jsx(eG,{audio:r,onDisabled:s,onStreamCreated:o}):e,i instanceof u0?N.jsx(YI,{analyzer:i}):i instanceof d0?N.jsx(RL,{analyzer:i}):i]})},cG=({mode:n})=>{const{audioSource:e}=oM();switch(e){case Jn.SOUNDCLOUD:case Jn.FILE_UPLOAD:return N.jsx(aG,{mode:n,audioSource:e});case Jn.MICROPHONE:case Jn.SCREEN_SHARE:return N.jsx(lG,{mode:n,audioSource:e});default:return e}},pn={GRID:"grid",SPHERE:"sphere",CUBE:"cube",DIFFUSED_RING:"diffusedRing",DNA:"dna",BOXES:"boxes",RIBBONS:"ribbons",WALK:"walk"},PL=Object.values(pn),aM=M.createContext(null),uG=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.nPerSide)??10),[i,s]=M.useState((n==null?void 0:n.unitSideLength)??.5),[o,a]=M.useState((n==null?void 0:n.unitSpacingScalar)??.1),[l,u]=M.useState((n==null?void 0:n.volume)??!0);return N.jsx(aM.Provider,{value:{config:{nPerSide:t,unitSideLength:i,unitSpacingScalar:o,volume:l},setters:{setNPerSide:r,setUnitSideLength:s,setUnitSpacingScalar:a,setVolume:u,reset:()=>{r((n==null?void 0:n.nPerSide)??10),s((n==null?void 0:n.unitSideLength)??.5),a((n==null?void 0:n.unitSpacingScalar)??.1),u((n==null?void 0:n.volume)??!0)}}},children:e})};function dG(){const n=M.useContext(aM);if(!n)throw new Error("useCubeVisualConfigContext must be used within a CubeVisualConfigContextProvider");return n.config}function fG(){const n=M.useContext(aM);if(!n)throw new Error("useCubeVisualConfigContextSetters must be used within a CubeVisualConfigContextProvider");return n.setters}const lM=M.createContext(null),hG=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.radius)??2),[i,s]=M.useState((n==null?void 0:n.pointSize)??.2),[o,a]=M.useState((n==null?void 0:n.mirrorEffects)??!1);return N.jsx(lM.Provider,{value:{config:{radius:t,pointSize:i,mirrorEffects:o},setters:{setRadius:r,setPointSize:s,setMirrorEffects:a}},children:e})};function pG(){const n=M.useContext(lM);if(!n)throw new Error("useRingVisualConfigContext must be used within a RingVisualConfigContextProvider");return n.config}function mG(){const n=M.useContext(lM);if(!n)throw new Error("useRingVisualConfigContextSetters must be used within a RingVisualConfigContextProvider");return n.setters}const IL=M.createContext(null),gG=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.multi)??!0),[i,s]=M.useState((n==null?void 0:n.helixLength)??50),[o,a]=M.useState((n==null?void 0:n.helixRadius)??1),[l,u]=M.useState((n==null?void 0:n.helixWindingSeparation)??10),[f,h]=M.useState((n==null?void 0:n.strandRadius)??.1),[p,m]=M.useState((n==null?void 0:n.baseSpacing)??.35),[v,w]=M.useState((n==null?void 0:n.strandOffsetRad)??Math.PI/2),[x,g]=M.useState((n==null?void 0:n.mirrorEffects)??!0),[S,_]=M.useState((n==null?void 0:n.fixedBaseGap)??!1);return N.jsx(IL.Provider,{value:{config:{multi:t,helixLength:i,helixRadius:o,helixWindingSeparation:l,strandRadius:f,baseSpacing:p,strandOffsetRad:v,mirrorEffects:x,fixedBaseGap:S},setters:{setMulti:r,setHelixLength:s,setHelixRadius:a,setHelixWindingSeparation:u,setStrandRadius:h,setBaseSpacing:m,setStrandOffsetRad:w,setMirrorEffects:g,setFixedBaseGap:_}},children:e})};function Tee(){const n=M.useContext(IL);if(!n)throw new Error("useDnaVisualConfigContext must be used within a DnaVisualConfigContextProvider");return n.config}const cM=M.createContext(null),vG=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.nCols)??100),[i,s]=M.useState((n==null?void 0:n.nRows)??100),[o,a]=M.useState((n==null?void 0:n.unitSideLength)??.025),[l,u]=M.useState((n==null?void 0:n.unitSpacingScalar)??5);return N.jsx(cM.Provider,{value:{config:{nCols:t,nRows:i,unitSideLength:o,unitSpacingScalar:l},setters:{setNCols:r,setNRows:s,setUnitSideLength:a,setUnitSpacingScalar:u,reset:()=>{r((n==null?void 0:n.nCols)??100),s((n==null?void 0:n.nRows)??100),a((n==null?void 0:n.unitSideLength)??.025),u((n==null?void 0:n.unitSpacingScalar)??5)}}},children:e})};function yG(){const n=M.useContext(cM);if(!n)throw new Error("useGridVisualConfigContext must be used within a GridVisualConfigContextProvider");return n.config}function xG(){const n=M.useContext(cM);if(!n)throw new Error("useGridVisualConfigContextSetters must be used within a GridVisualConfigContextProvider");return n.setters}const _G=M.createContext(null),SG=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.nRibbons)??5);return N.jsx(_G.Provider,{value:{config:{nRibbons:t},setters:{setNRibbons:r,reset:()=>{r((n==null?void 0:n.nRibbons)??5)}}},children:e})},uM=M.createContext(null),wG=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.radius)??2),[i,s]=M.useState((n==null?void 0:n.nPoints)??800),[o,a]=M.useState((n==null?void 0:n.unitSideLength)??.05);return N.jsx(uM.Provider,{value:{config:{radius:t,nPoints:i,unitSideLength:o},setters:{setRadius:r,setNPoints:s,setUnitSideLength:a}},children:e})};function EG(){const n=M.useContext(uM);if(!n)throw new Error("useSphereVisualConfigContext must be used within a SphereVisualConfigContextProvider");return n.config}function MG(){const n=M.useContext(uM);if(!n)throw new Error("useSphereVisualConfigContextSetters must be used within a SphereVisualConfigContextProvider");return n.setters}const dM=M.createContext(null),bG=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.maxAmplitude)??1),[i,s]=M.useState((n==null?void 0:n.waveformFrequenciesHz)??[2]),[o,a]=M.useState((n==null?void 0:n.amplitudeSplitRatio)??.75);return N.jsx(dM.Provider,{value:{config:{maxAmplitude:t,waveformFrequenciesHz:[...i],amplitudeSplitRatio:o},setters:{setMaxAmplitude:r,setWaveformFrequenciesHz:s,setAmplitudeSplitRatio:a,reset:()=>{r((n==null?void 0:n.maxAmplitude)??1),s((n==null?void 0:n.waveformFrequenciesHz)??[2]),a((n==null?void 0:n.amplitudeSplitRatio)??.75)}}},children:e})};function LL(){const n=M.useContext(dM);if(!n)throw new Error("useWaveGeneratorContext must be used within a WaveGeneratorContextProvider");return n.config}function DL(){const n=M.useContext(dM);if(!n)throw new Error("useWaveGeneratorContext must be used within a WaveGeneratorContextProvider");return n.setters}const fM=M.createContext(null),TG=({initial:n,children:e})=>{const{mode:t}=kc(),[r,i]=M.useState((n==null?void 0:n.visual)??PL[0]),[s,o]=M.useState((n==null?void 0:n.colorBackground)??!0),[a,l]=M.useState((n==null?void 0:n.paletteTrackEnergy)??!1),{setWaveformFrequenciesHz:u,setMaxAmplitude:f}=DL();return M.useEffect(()=>{if(t===Rt.WAVE_FORM)switch(r){case pn.DIFFUSED_RING:u([2,10]),f(1);break;default:u([2]),f(1);break}},[r,t,u,f]),M.useEffect(()=>{switch(t){case Rt.WAVE_FORM:case Rt.NOISE:case Rt.AUDIO_SCOPE:case Rt.PARTICLE_NOISE:l(!1);break;case Rt.AUDIO:l(!0);break;default:return t}},[t,l]),N.jsx(fM.Provider,{value:{config:{visual:r,colorBackground:s,paletteTrackEnergy:a},setters:{setVisual:i,setColorBackground:o,setPaletteTrackEnergy:l}},children:N.jsx(uG,{children:N.jsx(vG,{children:N.jsx(hG,{children:N.jsx(gG,{children:N.jsx(wG,{children:N.jsx(SG,{children:e})})})})})})})};function Fc(){const n=M.useContext(fM);if(!n)throw new Error("useVisualContext must be used within a VisualContextProvider");return n.config}function hM(){const n=M.useContext(fM);if(!n)throw new Error("useVisualContext must be used within a VisualContextProvider");return n.setters}const NL=()=>{const{colorBackground:n}=Fc(),e=YE();return n?Wn.getPalette(e).calcBackgroundColor(0):"#010204"},OL=()=>{const n=NL();return N.jsx("color",{attach:"background",args:[n]})},CG=()=>{const n=NL();return N.jsx("fog",{attach:"fog",args:[n,0,100]})};var kL={exports:{}},zc={};/** * @license React * react-reconciler-constants.production.min.js * @@ -3936,7 +3941,7 @@ void main() { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */Uc.ConcurrentRoot=1;Uc.ContinuousEventPriority=4;Uc.DefaultEventPriority=16;Uc.DiscreteEventPriority=1;Uc.IdleEventPriority=536870912;Uc.LegacyRoot=0;NL.exports=Uc;var Bu=NL.exports;function wG(n){let e;const t=new Set,r=(u,f)=>{const h=typeof u=="function"?u(e):u;if(h!==e){const p=e;e=f?h:Object.assign({},e,h),t.forEach(m=>m(e,p))}},i=()=>e,s=(u,f=i,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=f(e);function m(){const v=f(e);if(!h(p,v)){const w=p;u(p=v,w)}}return t.add(m),()=>t.delete(m)},l={setState:r,getState:i,subscribe:(u,f,h)=>f||h?s(u,f,h):(t.add(u),()=>t.delete(u)),destroy:()=>t.clear()};return e=n(r,i,l),l}const EG=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),o2=EG?M.useEffect:M.useLayoutEffect;function MG(n){const e=typeof n=="function"?wG(n):n,t=(r=e.getState,i=Object.is)=>{const[,s]=M.useReducer(x=>x+1,0),o=e.getState(),a=M.useRef(o),l=M.useRef(r),u=M.useRef(i),f=M.useRef(!1),h=M.useRef();h.current===void 0&&(h.current=r(o));let p,m=!1;(a.current!==o||l.current!==r||u.current!==i||f.current)&&(p=r(o),m=!i(h.current,p)),o2(()=>{m&&(h.current=p),a.current=o,l.current=r,u.current=i,f.current=!1});const v=M.useRef(o);o2(()=>{const x=()=>{try{const S=e.getState(),_=l.current(S);u.current(h.current,_)||(a.current=S,h.current=_,s())}catch{f.current=!0,s()}},g=e.subscribe(x);return e.getState()!==v.current&&x(),g},[]);const w=m?p:h.current;return M.useDebugValue(w),w};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const r=[t,e];return{next(){const i=r.length<=0;return{value:r.shift(),done:i}}}},t}var OL={exports:{}},kL={exports:{}},UL={};/** + */zc.ConcurrentRoot=1;zc.ContinuousEventPriority=4;zc.DefaultEventPriority=16;zc.DiscreteEventPriority=1;zc.IdleEventPriority=536870912;zc.LegacyRoot=0;kL.exports=zc;var Hu=kL.exports;function AG(n){let e;const t=new Set,r=(u,f)=>{const h=typeof u=="function"?u(e):u;if(h!==e){const p=e;e=f?h:Object.assign({},e,h),t.forEach(m=>m(e,p))}},i=()=>e,s=(u,f=i,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=f(e);function m(){const v=f(e);if(!h(p,v)){const w=p;u(p=v,w)}}return t.add(m),()=>t.delete(m)},l={setState:r,getState:i,subscribe:(u,f,h)=>f||h?s(u,f,h):(t.add(u),()=>t.delete(u)),destroy:()=>t.clear()};return e=n(r,i,l),l}const RG=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),o2=RG?M.useEffect:M.useLayoutEffect;function PG(n){const e=typeof n=="function"?AG(n):n,t=(r=e.getState,i=Object.is)=>{const[,s]=M.useReducer(x=>x+1,0),o=e.getState(),a=M.useRef(o),l=M.useRef(r),u=M.useRef(i),f=M.useRef(!1),h=M.useRef();h.current===void 0&&(h.current=r(o));let p,m=!1;(a.current!==o||l.current!==r||u.current!==i||f.current)&&(p=r(o),m=!i(h.current,p)),o2(()=>{m&&(h.current=p),a.current=o,l.current=r,u.current=i,f.current=!1});const v=M.useRef(o);o2(()=>{const x=()=>{try{const S=e.getState(),_=l.current(S);u.current(h.current,_)||(a.current=S,h.current=_,s())}catch{f.current=!0,s()}},g=e.subscribe(x);return e.getState()!==v.current&&x(),g},[]);const w=m?p:h.current;return M.useDebugValue(w),w};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const r=[t,e];return{next(){const i=r.length<=0;return{value:r.shift(),done:i}}}},t}var UL={exports:{}},FL={exports:{}},zL={};/** * @license React * scheduler.production.min.js * @@ -3944,7 +3949,7 @@ void main() { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(n){function e(U,X){var q=U.length;U.push(X);e:for(;0>>1,se=U[K];if(0>>1;Ki(le,q))Mei(pe,le)?(U[K]=pe,U[Me]=q,K=Me):(U[K]=le,U[te]=q,K=te);else if(Mei(pe,q))U[K]=pe,U[Me]=q,K=Me;else break e}}return X}function i(U,X){var q=U.sortIndex-X.sortIndex;return q!==0?q:U.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],u=[],f=1,h=null,p=3,m=!1,v=!1,w=!1,x=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(U){for(var X=t(u);X!==null;){if(X.callback===null)r(u);else if(X.startTime<=U)r(u),X.sortIndex=X.expirationTime,e(l,X);else break;X=t(u)}}function b(U){if(w=!1,_(U),!v)if(t(l)!==null)v=!0,Y(A);else{var X=t(u);X!==null&&re(b,X.startTime-U)}}function A(U,X){v=!1,w&&(w=!1,g(D),D=-1),m=!0;var q=p;try{for(_(X),h=t(l);h!==null&&(!(h.expirationTime>X)||U&&!L());){var K=h.callback;if(typeof K=="function"){h.callback=null,p=h.priorityLevel;var se=K(h.expirationTime<=X);X=n.unstable_now(),typeof se=="function"?h.callback=se:h===t(l)&&r(l),_(X)}else r(l);h=t(l)}if(h!==null)var ve=!0;else{var te=t(u);te!==null&&re(b,te.startTime-X),ve=!1}return ve}finally{h=null,p=q,m=!1}}var R=!1,P=null,D=-1,V=5,C=-1;function L(){return!(n.unstable_now()-CU||125K?(U.sortIndex=q,e(u,U),t(l)===null&&U===t(u)&&(w?(g(D),D=-1):w=!0,re(b,q-K))):(U.sortIndex=se,e(l,U),v||m||(v=!0,Y(A))),U},n.unstable_shouldYield=L,n.unstable_wrapCallback=function(U){var X=p;return function(){var q=p;p=X;try{return U.apply(this,arguments)}finally{p=q}}}})(UL);kL.exports=UL;var j1=kL.exports;/** + */(function(n){function e(U,X){var q=U.length;U.push(X);e:for(;0>>1,se=U[K];if(0>>1;Ki(le,q))Mei(pe,le)?(U[K]=pe,U[Me]=q,K=Me):(U[K]=le,U[te]=q,K=te);else if(Mei(pe,q))U[K]=pe,U[Me]=q,K=Me;else break e}}return X}function i(U,X){var q=U.sortIndex-X.sortIndex;return q!==0?q:U.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],u=[],f=1,h=null,p=3,m=!1,v=!1,w=!1,x=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(U){for(var X=t(u);X!==null;){if(X.callback===null)r(u);else if(X.startTime<=U)r(u),X.sortIndex=X.expirationTime,e(l,X);else break;X=t(u)}}function b(U){if(w=!1,_(U),!v)if(t(l)!==null)v=!0,Y(A);else{var X=t(u);X!==null&&re(b,X.startTime-U)}}function A(U,X){v=!1,w&&(w=!1,g(D),D=-1),m=!0;var q=p;try{for(_(X),h=t(l);h!==null&&(!(h.expirationTime>X)||U&&!L());){var K=h.callback;if(typeof K=="function"){h.callback=null,p=h.priorityLevel;var se=K(h.expirationTime<=X);X=n.unstable_now(),typeof se=="function"?h.callback=se:h===t(l)&&r(l),_(X)}else r(l);h=t(l)}if(h!==null)var ve=!0;else{var te=t(u);te!==null&&re(b,te.startTime-X),ve=!1}return ve}finally{h=null,p=q,m=!1}}var R=!1,P=null,D=-1,V=5,C=-1;function L(){return!(n.unstable_now()-CU||125K?(U.sortIndex=q,e(u,U),t(l)===null&&U===t(u)&&(w?(g(D),D=-1):w=!0,re(b,q-K))):(U.sortIndex=se,e(l,U),v||m||(v=!0,Y(A))),U},n.unstable_shouldYield=L,n.unstable_wrapCallback=function(U){var X=p;return function(){var q=p;p=X;try{return U.apply(this,arguments)}finally{p=q}}}})(zL);FL.exports=zL;var q1=FL.exports;/** * @license React * react-reconciler.production.min.js * @@ -3952,24 +3957,24 @@ void main() { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var bG=function(e){var t={},r=M,i=j1,s=Object.assign;function o(c){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+c,y=1;yJ||T[$]!==I[J]){var me=` -`+T[$].replace(" at new "," at ");return c.displayName&&me.includes("")&&(me=me.replace("",c.displayName)),me}while(1<=$&&0<=J);break}}}finally{Mt=!1,Error.prepareStackTrace=y}return(c=c?c.displayName||c.name:"")?Tt(c):""}var bn=Object.prototype.hasOwnProperty,gr=[],gn=-1;function or(c){return{current:c}}function yt(c){0>gn||(c.current=gr[gn],gr[gn]=null,gn--)}function et(c,d){gn++,gr[gn]=c.current,c.current=d}var Bi={},$t=or(Bi),Nn=or(!1),ks=Bi;function Vi(c,d){var y=c.type.contextTypes;if(!y)return Bi;var E=c.stateNode;if(E&&E.__reactInternalMemoizedUnmaskedChildContext===d)return E.__reactInternalMemoizedMaskedChildContext;var T={},I;for(I in y)T[I]=d[I];return E&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=d,c.__reactInternalMemoizedMaskedChildContext=T),T}function ar(c){return c=c.childContextTypes,c!=null}function Vn(){yt(Nn),yt($t)}function Us(c,d,y){if($t.current!==Bi)throw Error(o(168));et($t,d),et(Nn,y)}function Gc(c,d,y){var E=c.stateNode;if(d=d.childContextTypes,typeof E.getChildContext!="function")return y;E=E.getChildContext();for(var T in E)if(!(T in d))throw Error(o(108,D(c)||"Unknown",T));return s({},y,E)}function vr(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||Bi,ks=$t.current,et($t,c),et(Nn,Nn.current),!0}function jc(c,d,y){var E=c.stateNode;if(!E)throw Error(o(169));y?(c=Gc(c,d,ks),E.__reactInternalMemoizedMergedChildContext=c,yt(Nn),yt($t),et($t,c)):yt(Nn),et(Nn,y)}var yi=Math.clz32?Math.clz32:fU,sm=Math.log,dU=Math.LN2;function fU(c){return c>>>=0,c===0?32:31-(sm(c)/dU|0)|0}var om=64,am=4194304;function sf(c){switch(c&-c){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 c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function lm(c,d){var y=c.pendingLanes;if(y===0)return 0;var E=0,T=c.suspendedLanes,I=c.pingedLanes,$=y&268435455;if($!==0){var J=$&~T;J!==0?E=sf(J):(I&=$,I!==0&&(E=sf(I)))}else $=y&~T,$!==0?E=sf($):I!==0&&(E=sf(I));if(E===0)return 0;if(d!==0&&d!==E&&!(d&T)&&(T=E&-E,I=d&-d,T>=I||T===16&&(I&4194240)!==0))return d;if(E&4&&(E|=y&16),d=c.entangledLanes,d!==0)for(c=c.entanglements,d&=E;0y;y++)d.push(c);return d}function of(c,d,y){c.pendingLanes|=d,d!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,d=31-yi(d),c[d]=y}function mU(c,d){var y=c.pendingLanes&~d;c.pendingLanes=d,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=d,c.mutableReadLanes&=d,c.entangledLanes&=d,d=c.entanglements;var E=c.eventTimes;for(c=c.expirationTimes;0>=$,T-=$,yo=1<<32-yi(d)+T|y<tn?(ur=Lt,Lt=null):ur=Lt.sibling;var nn=pt(ae,Lt,he[tn],Ge);if(nn===null){Lt===null&&(Lt=ur);break}c&&Lt&&nn.alternate===null&&d(ae,Lt),ne=I(nn,ne,tn),Bt===null?lt=nn:Bt.sibling=nn,Bt=nn,Lt=ur}if(tn===he.length)return y(ae,Lt),wn&&xl(ae,tn),lt;if(Lt===null){for(;tntn?(ur=Lt,Lt=null):ur=Lt.sibling;var ha=pt(ae,Lt,nn.value,Ge);if(ha===null){Lt===null&&(Lt=ur);break}c&&Lt&&ha.alternate===null&&d(ae,Lt),ne=I(ha,ne,tn),Bt===null?lt=ha:Bt.sibling=ha,Bt=ha,Lt=ur}if(nn.done)return y(ae,Lt),wn&&xl(ae,tn),lt;if(Lt===null){for(;!nn.done;tn++,nn=he.next())nn=It(ae,nn.value,Ge),nn!==null&&(ne=I(nn,ne,tn),Bt===null?lt=nn:Bt.sibling=nn,Bt=nn);return wn&&xl(ae,tn),lt}for(Lt=E(ae,Lt);!nn.done;tn++,nn=he.next())nn=dn(Lt,ae,tn,nn.value,Ge),nn!==null&&(c&&nn.alternate!==null&&Lt.delete(nn.key===null?tn:nn.key),ne=I(nn,ne,tn),Bt===null?lt=nn:Bt.sibling=nn,Bt=nn);return c&&Lt.forEach(function(eF){return d(ae,eF)}),wn&&xl(ae,tn),lt}function Yi(ae,ne,he,Ge){if(typeof he=="object"&&he!==null&&he.type===f&&he.key===null&&(he=he.props.children),typeof he=="object"&&he!==null){switch(he.$$typeof){case l:e:{for(var lt=he.key,Bt=ne;Bt!==null;){if(Bt.key===lt){if(lt=he.type,lt===f){if(Bt.tag===7){y(ae,Bt.sibling),ne=T(Bt,he.props.children),ne.return=ae,ae=ne;break e}}else if(Bt.elementType===lt||typeof lt=="object"&<!==null&<.$$typeof===_&&Xb(lt)===Bt.type){y(ae,Bt.sibling),ne=T(Bt,he.props),ne.ref=cf(ae,Bt,he),ne.return=ae,ae=ne;break e}y(ae,Bt);break}else d(ae,Bt);Bt=Bt.sibling}he.type===f?(ne=Tl(he.props.children,ae.mode,Ge,he.key),ne.return=ae,ae=ne):(Ge=Zm(he.type,he.key,he.props,null,ae.mode,Ge),Ge.ref=cf(ae,ne,he),Ge.return=ae,ae=Ge)}return $(ae);case u:e:{for(Bt=he.key;ne!==null;){if(ne.key===Bt)if(ne.tag===4&&ne.stateNode.containerInfo===he.containerInfo&&ne.stateNode.implementation===he.implementation){y(ae,ne.sibling),ne=T(ne,he.children||[]),ne.return=ae,ae=ne;break e}else{y(ae,ne);break}else d(ae,ne);ne=ne.sibling}ne=Jx(he,ae.mode,Ge),ne.return=ae,ae=ne}return $(ae);case _:return Bt=he._init,Yi(ae,ne,Bt(he._payload),Ge)}if(j(he))return dt(ae,ne,he,Ge);if(R(he))return Rr(ae,ne,he,Ge);xm(ae,he)}return typeof he=="string"&&he!==""||typeof he=="number"?(he=""+he,ne!==null&&ne.tag===6?(y(ae,ne.sibling),ne=T(ne,he),ne.return=ae,ae=ne):(y(ae,ne),ne=Qx(he,ae.mode,Ge),ne.return=ae,ae=ne),$(ae)):y(ae,ne)}return Yi}var Qc=qb(!0),Yb=qb(!1),uf={},Gi=or(uf),df=or(uf),Jc=or(uf);function Hs(c){if(c===uf)throw Error(o(174));return c}function gx(c,d){et(Jc,d),et(df,c),et(Gi,uf),c=re(d),yt(Gi),et(Gi,c)}function eu(){yt(Gi),yt(df),yt(Jc)}function Zb(c){var d=Hs(Jc.current),y=Hs(Gi.current);d=U(y,c.type,d),y!==d&&(et(df,c),et(Gi,d))}function vx(c){df.current===c&&(yt(Gi),yt(df))}var Tn=or(0);function _m(c){for(var d=c;d!==null;){if(d.tag===13){var y=d.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||nf(y)||rf(y)))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if(d.flags&128)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var yx=[];function xx(){for(var c=0;cy?y:4,c(!0);var E=ji.transition;ji.transition={};try{c(!1),d()}finally{en=y,ji.transition=E}}function uT(){return $s().memoizedState}function CU(c,d,y){var E=ua(c);y={lane:E,action:y,hasEagerState:!1,eagerState:null,next:null},dT(c)?fT(d,y):(hT(c,d,y),y=Gr(),c=Xi(c,E,y),c!==null&&pT(c,d,E))}function AU(c,d,y){var E=ua(c),T={lane:E,action:y,hasEagerState:!1,eagerState:null,next:null};if(dT(c))fT(d,T);else{hT(c,d,T);var I=c.alternate;if(c.lanes===0&&(I===null||I.lanes===0)&&(I=d.lastRenderedReducer,I!==null))try{var $=d.lastRenderedState,J=I($,y);if(T.hasEagerState=!0,T.eagerState=J,zs(J,$))return}catch{}finally{}y=Gr(),c=Xi(c,E,y),c!==null&&pT(c,d,E)}}function dT(c){var d=c.alternate;return c===On||d!==null&&d===On}function fT(c,d){ff=wm=!0;var y=c.pending;y===null?d.next=d:(d.next=y.next,y.next=d),c.pending=d}function hT(c,d,y){Yn!==null&&c.mode&1&&!(Wt&2)?(c=d.interleaved,c===null?(y.next=y,Vs===null?Vs=[d]:Vs.push(d)):(y.next=c.next,c.next=y),d.interleaved=y):(c=d.pending,c===null?y.next=y:(y.next=c.next,c.next=y),d.pending=y)}function pT(c,d,y){if(y&4194240){var E=d.lanes;E&=c.pendingLanes,y|=E,d.lanes=y,Jy(c,y)}}var Cm={readContext:Hi,useCallback:Cr,useContext:Cr,useEffect:Cr,useImperativeHandle:Cr,useInsertionEffect:Cr,useLayoutEffect:Cr,useMemo:Cr,useReducer:Cr,useRef:Cr,useState:Cr,useDebugValue:Cr,useDeferredValue:Cr,useTransition:Cr,useMutableSource:Cr,useSyncExternalStore:Cr,useId:Cr,unstable_isNewReconciler:!1},RU={readContext:Hi,useCallback:function(c,d){return _o().memoizedState=[c,d===void 0?null:d],c},useContext:Hi,useEffect:Mx,useImperativeHandle:function(c,d,y){return y=y!=null?y.concat([c]):null,bm(4194308,4,oT.bind(null,d,c),y)},useLayoutEffect:function(c,d){return bm(4194308,4,c,d)},useInsertionEffect:function(c,d){return bm(4,2,c,d)},useMemo:function(c,d){var y=_o();return d=d===void 0?null:d,c=c(),y.memoizedState=[c,d],c},useReducer:function(c,d,y){var E=_o();return d=y!==void 0?y(d):d,E.memoizedState=E.baseState=d,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:d},E.queue=c,c=c.dispatch=CU.bind(null,On,c),[E.memoizedState,c]},useRef:function(c){var d=_o();return c={current:c},d.memoizedState=c},useState:Ex,useDebugValue:bx,useDeferredValue:function(c){var d=Ex(c),y=d[0],E=d[1];return Mx(function(){var T=ji.transition;ji.transition={};try{E(c)}finally{ji.transition=T}},[c]),y},useTransition:function(){var c=Ex(!1),d=c[0];return c=TU.bind(null,c[1]),_o().memoizedState=c,[d,c]},useMutableSource:function(){},useSyncExternalStore:function(c,d,y){var E=On,T=_o();if(wn){if(y===void 0)throw Error(o(407));y=y()}else{if(y=d(),Yn===null)throw Error(o(349));tu&30||Jb(E,d,y)}T.memoizedState=y;var I={value:y,getSnapshot:d};return T.queue=I,Mx(tT.bind(null,E,I,c),[c]),E.flags|=2048,pf(9,eT.bind(null,E,I,y,d),void 0,null),y},useId:function(){var c=_o(),d=Yn.identifierPrefix;if(wn){var y=xo,E=yo;y=(E&~(1<<32-yi(E)-1)).toString(32)+y,d=":"+d+"R"+y,y=hf++,0")&&(me=me.replace("",c.displayName)),me}while(1<=$&&0<=J);break}}}finally{Mt=!1,Error.prepareStackTrace=y}return(c=c?c.displayName||c.name:"")?Tt(c):""}var bn=Object.prototype.hasOwnProperty,gr=[],vn=-1;function or(c){return{current:c}}function yt(c){0>vn||(c.current=gr[vn],gr[vn]=null,vn--)}function et(c,d){vn++,gr[vn]=c.current,c.current=d}var Bi={},$t=or(Bi),Nn=or(!1),Us=Bi;function Vi(c,d){var y=c.type.contextTypes;if(!y)return Bi;var E=c.stateNode;if(E&&E.__reactInternalMemoizedUnmaskedChildContext===d)return E.__reactInternalMemoizedMaskedChildContext;var T={},I;for(I in y)T[I]=d[I];return E&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=d,c.__reactInternalMemoizedMaskedChildContext=T),T}function ar(c){return c=c.childContextTypes,c!=null}function Vn(){yt(Nn),yt($t)}function Fs(c,d,y){if($t.current!==Bi)throw Error(o(168));et($t,d),et(Nn,y)}function Xc(c,d,y){var E=c.stateNode;if(d=d.childContextTypes,typeof E.getChildContext!="function")return y;E=E.getChildContext();for(var T in E)if(!(T in d))throw Error(o(108,D(c)||"Unknown",T));return s({},y,E)}function vr(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||Bi,Us=$t.current,et($t,c),et(Nn,Nn.current),!0}function qc(c,d,y){var E=c.stateNode;if(!E)throw Error(o(169));y?(c=Xc(c,d,Us),E.__reactInternalMemoizedMergedChildContext=c,yt(Nn),yt($t),et($t,c)):yt(Nn),et(Nn,y)}var yi=Math.clz32?Math.clz32:yU,am=Math.log,vU=Math.LN2;function yU(c){return c>>>=0,c===0?32:31-(am(c)/vU|0)|0}var lm=64,cm=4194304;function af(c){switch(c&-c){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 c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function um(c,d){var y=c.pendingLanes;if(y===0)return 0;var E=0,T=c.suspendedLanes,I=c.pingedLanes,$=y&268435455;if($!==0){var J=$&~T;J!==0?E=af(J):(I&=$,I!==0&&(E=af(I)))}else $=y&~T,$!==0?E=af($):I!==0&&(E=af(I));if(E===0)return 0;if(d!==0&&d!==E&&!(d&T)&&(T=E&-E,I=d&-d,T>=I||T===16&&(I&4194240)!==0))return d;if(E&4&&(E|=y&16),d=c.entangledLanes,d!==0)for(c=c.entanglements,d&=E;0y;y++)d.push(c);return d}function lf(c,d,y){c.pendingLanes|=d,d!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,d=31-yi(d),c[d]=y}function SU(c,d){var y=c.pendingLanes&~d;c.pendingLanes=d,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=d,c.mutableReadLanes&=d,c.entangledLanes&=d,d=c.entanglements;var E=c.eventTimes;for(c=c.expirationTimes;0>=$,T-=$,xo=1<<32-yi(d)+T|y<tn?(ur=Lt,Lt=null):ur=Lt.sibling;var nn=pt(ae,Lt,he[tn],Ge);if(nn===null){Lt===null&&(Lt=ur);break}c&&Lt&&nn.alternate===null&&d(ae,Lt),ne=I(nn,ne,tn),Bt===null?lt=nn:Bt.sibling=nn,Bt=nn,Lt=ur}if(tn===he.length)return y(ae,Lt),En&&_l(ae,tn),lt;if(Lt===null){for(;tntn?(ur=Lt,Lt=null):ur=Lt.sibling;var pa=pt(ae,Lt,nn.value,Ge);if(pa===null){Lt===null&&(Lt=ur);break}c&&Lt&&pa.alternate===null&&d(ae,Lt),ne=I(pa,ne,tn),Bt===null?lt=pa:Bt.sibling=pa,Bt=pa,Lt=ur}if(nn.done)return y(ae,Lt),En&&_l(ae,tn),lt;if(Lt===null){for(;!nn.done;tn++,nn=he.next())nn=It(ae,nn.value,Ge),nn!==null&&(ne=I(nn,ne,tn),Bt===null?lt=nn:Bt.sibling=nn,Bt=nn);return En&&_l(ae,tn),lt}for(Lt=E(ae,Lt);!nn.done;tn++,nn=he.next())nn=un(Lt,ae,tn,nn.value,Ge),nn!==null&&(c&&nn.alternate!==null&&Lt.delete(nn.key===null?tn:nn.key),ne=I(nn,ne,tn),Bt===null?lt=nn:Bt.sibling=nn,Bt=nn);return c&&Lt.forEach(function(oF){return d(ae,oF)}),En&&_l(ae,tn),lt}function Yi(ae,ne,he,Ge){if(typeof he=="object"&&he!==null&&he.type===f&&he.key===null&&(he=he.props.children),typeof he=="object"&&he!==null){switch(he.$$typeof){case l:e:{for(var lt=he.key,Bt=ne;Bt!==null;){if(Bt.key===lt){if(lt=he.type,lt===f){if(Bt.tag===7){y(ae,Bt.sibling),ne=T(Bt,he.props.children),ne.return=ae,ae=ne;break e}}else if(Bt.elementType===lt||typeof lt=="object"&<!==null&<.$$typeof===_&&Xb(lt)===Bt.type){y(ae,Bt.sibling),ne=T(Bt,he.props),ne.ref=df(ae,Bt,he),ne.return=ae,ae=ne;break e}y(ae,Bt);break}else d(ae,Bt);Bt=Bt.sibling}he.type===f?(ne=Cl(he.props.children,ae.mode,Ge,he.key),ne.return=ae,ae=ne):(Ge=Qm(he.type,he.key,he.props,null,ae.mode,Ge),Ge.ref=df(ae,ne,he),Ge.return=ae,ae=Ge)}return $(ae);case u:e:{for(Bt=he.key;ne!==null;){if(ne.key===Bt)if(ne.tag===4&&ne.stateNode.containerInfo===he.containerInfo&&ne.stateNode.implementation===he.implementation){y(ae,ne.sibling),ne=T(ne,he.children||[]),ne.return=ae,ae=ne;break e}else{y(ae,ne);break}else d(ae,ne);ne=ne.sibling}ne=t_(he,ae.mode,Ge),ne.return=ae,ae=ne}return $(ae);case _:return Bt=he._init,Yi(ae,ne,Bt(he._payload),Ge)}if(j(he))return dt(ae,ne,he,Ge);if(R(he))return Rr(ae,ne,he,Ge);Sm(ae,he)}return typeof he=="string"&&he!==""||typeof he=="number"?(he=""+he,ne!==null&&ne.tag===6?(y(ae,ne.sibling),ne=T(ne,he),ne.return=ae,ae=ne):(y(ae,ne),ne=e_(he,ae.mode,Ge),ne.return=ae,ae=ne),$(ae)):y(ae,ne)}return Yi}var eu=qb(!0),Yb=qb(!1),ff={},Gi=or(ff),hf=or(ff),tu=or(ff);function $s(c){if(c===ff)throw Error(o(174));return c}function yx(c,d){et(tu,d),et(hf,c),et(Gi,ff),c=re(d),yt(Gi),et(Gi,c)}function nu(){yt(Gi),yt(hf),yt(tu)}function Zb(c){var d=$s(tu.current),y=$s(Gi.current);d=U(y,c.type,d),y!==d&&(et(hf,c),et(Gi,d))}function xx(c){hf.current===c&&(yt(Gi),yt(hf))}var Tn=or(0);function wm(c){for(var d=c;d!==null;){if(d.tag===13){var y=d.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||sf(y)||of(y)))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if(d.flags&128)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var _x=[];function Sx(){for(var c=0;c<_x.length;c++){var d=_x[c];Re?d._workInProgressVersionPrimary=null:d._workInProgressVersionSecondary=null}_x.length=0}var Em=a.ReactCurrentDispatcher,ji=a.ReactCurrentBatchConfig,ru=0,On=null,Tr=null,cr=null,Mm=!1,pf=!1,mf=0,IU=0;function Cr(){throw Error(o(321))}function wx(c,d){if(d===null)return!1;for(var y=0;yy?y:4,c(!0);var E=ji.transition;ji.transition={};try{c(!1),d()}finally{en=y,ji.transition=E}}function uT(){return Ws().memoizedState}function DU(c,d,y){var E=da(c);y={lane:E,action:y,hasEagerState:!1,eagerState:null,next:null},dT(c)?fT(d,y):(hT(c,d,y),y=Gr(),c=Xi(c,E,y),c!==null&&pT(c,d,E))}function NU(c,d,y){var E=da(c),T={lane:E,action:y,hasEagerState:!1,eagerState:null,next:null};if(dT(c))fT(d,T);else{hT(c,d,T);var I=c.alternate;if(c.lanes===0&&(I===null||I.lanes===0)&&(I=d.lastRenderedReducer,I!==null))try{var $=d.lastRenderedState,J=I($,y);if(T.hasEagerState=!0,T.eagerState=J,Bs(J,$))return}catch{}finally{}y=Gr(),c=Xi(c,E,y),c!==null&&pT(c,d,E)}}function dT(c){var d=c.alternate;return c===On||d!==null&&d===On}function fT(c,d){pf=Mm=!0;var y=c.pending;y===null?d.next=d:(d.next=y.next,y.next=d),c.pending=d}function hT(c,d,y){Yn!==null&&c.mode&1&&!(Wt&2)?(c=d.interleaved,c===null?(y.next=y,Hs===null?Hs=[d]:Hs.push(d)):(y.next=c.next,c.next=y),d.interleaved=y):(c=d.pending,c===null?y.next=y:(y.next=c.next,c.next=y),d.pending=y)}function pT(c,d,y){if(y&4194240){var E=d.lanes;E&=c.pendingLanes,y|=E,d.lanes=y,tx(c,y)}}var Rm={readContext:Hi,useCallback:Cr,useContext:Cr,useEffect:Cr,useImperativeHandle:Cr,useInsertionEffect:Cr,useLayoutEffect:Cr,useMemo:Cr,useReducer:Cr,useRef:Cr,useState:Cr,useDebugValue:Cr,useDeferredValue:Cr,useTransition:Cr,useMutableSource:Cr,useSyncExternalStore:Cr,useId:Cr,unstable_isNewReconciler:!1},OU={readContext:Hi,useCallback:function(c,d){return So().memoizedState=[c,d===void 0?null:d],c},useContext:Hi,useEffect:Tx,useImperativeHandle:function(c,d,y){return y=y!=null?y.concat([c]):null,Cm(4194308,4,oT.bind(null,d,c),y)},useLayoutEffect:function(c,d){return Cm(4194308,4,c,d)},useInsertionEffect:function(c,d){return Cm(4,2,c,d)},useMemo:function(c,d){var y=So();return d=d===void 0?null:d,c=c(),y.memoizedState=[c,d],c},useReducer:function(c,d,y){var E=So();return d=y!==void 0?y(d):d,E.memoizedState=E.baseState=d,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:d},E.queue=c,c=c.dispatch=DU.bind(null,On,c),[E.memoizedState,c]},useRef:function(c){var d=So();return c={current:c},d.memoizedState=c},useState:bx,useDebugValue:Cx,useDeferredValue:function(c){var d=bx(c),y=d[0],E=d[1];return Tx(function(){var T=ji.transition;ji.transition={};try{E(c)}finally{ji.transition=T}},[c]),y},useTransition:function(){var c=bx(!1),d=c[0];return c=LU.bind(null,c[1]),So().memoizedState=c,[d,c]},useMutableSource:function(){},useSyncExternalStore:function(c,d,y){var E=On,T=So();if(En){if(y===void 0)throw Error(o(407));y=y()}else{if(y=d(),Yn===null)throw Error(o(349));ru&30||Jb(E,d,y)}T.memoizedState=y;var I={value:y,getSnapshot:d};return T.queue=I,Tx(tT.bind(null,E,I,c),[c]),E.flags|=2048,gf(9,eT.bind(null,E,I,y,d),void 0,null),y},useId:function(){var c=So(),d=Yn.identifierPrefix;if(En){var y=_o,E=xo;y=(E&~(1<<32-yi(E)-1)).toString(32)+y,d=":"+d+"R"+y,y=mf++,0Wx&&(d.flags|=128,E=!0,yf(T,!1),d.lanes=4194304)}else{if(!E)if(c=_m(I),c!==null){if(d.flags|=128,E=!0,c=c.updateQueue,c!==null&&(d.updateQueue=c,d.flags|=4),yf(T,!0),T.tail===null&&T.tailMode==="hidden"&&!I.alternate&&!wn)return Ar(d),null}else 2*lr()-T.renderingStartTime>Wx&&y!==1073741824&&(d.flags|=128,E=!0,yf(T,!1),d.lanes=4194304);T.isBackwards?(I.sibling=d.child,d.child=I):(c=T.last,c!==null?c.sibling=I:d.child=I,T.last=I)}return T.tail!==null?(d=T.tail,T.rendering=d,T.tail=d.sibling,T.renderingStartTime=lr(),d.sibling=null,c=Tn.current,et(Tn,E?c&1|2:c&1),d):(Ar(d),null);case 22:case 23:return Yx(),E=d.memoizedState!==null,c!==null&&c.memoizedState!==null!==E&&(d.flags|=8192),E&&d.mode&1?wi&1073741824&&(Ar(d),Ce&&d.subtreeFlags&6&&(d.flags|=8192)):Ar(d),null;case 24:return null;case 25:return null}throw Error(o(156,d.tag))}var NU=a.ReactCurrentOwner,Si=!1;function Wr(c,d,y,E){d.child=c===null?Yb(d,null,y,E):Qc(d,c.child,y,E)}function wT(c,d,y,E,T){y=y.render;var I=d.ref;return qc(d,T),E=Sx(c,d,y,E,I,T),y=wx(),c!==null&&!Si?(d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~T,So(c,d,T)):(wn&&y&&dx(d),d.flags|=1,Wr(c,d,E,T),d.child)}function ET(c,d,y,E,T){if(c===null){var I=y.type;return typeof I=="function"&&!Kx(I)&&I.defaultProps===void 0&&y.compare===null&&y.defaultProps===void 0?(d.tag=15,d.type=I,MT(c,d,I,E,T)):(c=Zm(y.type,null,E,d,d.mode,T),c.ref=d.ref,c.return=d,d.child=c)}if(I=c.child,!(c.lanes&T)){var $=I.memoizedProps;if(y=y.compare,y=y!==null?y:dm,y($,E)&&c.ref===d.ref)return So(c,d,T)}return d.flags|=1,c=fa(I,E),c.ref=d.ref,c.return=d,d.child=c}function MT(c,d,y,E,T){if(c!==null&&dm(c.memoizedProps,E)&&c.ref===d.ref)if(Si=!1,(c.lanes&T)!==0)c.flags&131072&&(Si=!0);else return d.lanes=c.lanes,So(c,d,T);return Ax(c,d,y,E,T)}function bT(c,d,y){var E=d.pendingProps,T=E.children,I=c!==null?c.memoizedState:null;if(E.mode==="hidden")if(!(d.mode&1))d.memoizedState={baseLanes:0,cachePool:null},et(nu,wi),wi|=y;else if(y&1073741824)d.memoizedState={baseLanes:0,cachePool:null},E=I!==null?I.baseLanes:y,et(nu,wi),wi|=E;else return c=I!==null?I.baseLanes|y:y,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:c,cachePool:null},d.updateQueue=null,et(nu,wi),wi|=c,null;else I!==null?(E=I.baseLanes|y,d.memoizedState=null):E=y,et(nu,wi),wi|=E;return Wr(c,d,T,y),d.child}function TT(c,d){var y=d.ref;(c===null&&y!==null||c!==null&&c.ref!==y)&&(d.flags|=512,d.flags|=2097152)}function Ax(c,d,y,E,T){var I=ar(y)?ks:$t.current;return I=Vi(d,I),qc(d,T),y=Sx(c,d,y,E,I,T),E=wx(),c!==null&&!Si?(d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~T,So(c,d,T)):(wn&&E&&dx(d),d.flags|=1,Wr(c,d,y,T),d.child)}function CT(c,d,y,E,T){if(ar(y)){var I=!0;vr(d)}else I=!1;if(qc(d,T),d.stateNode===null)c!==null&&(c.alternate=null,d.alternate=null,d.flags|=2),Vb(d,y,E),ux(d,y,E,T),E=!0;else if(c===null){var $=d.stateNode,J=d.memoizedProps;$.props=J;var me=$.context,Ne=y.contextType;typeof Ne=="object"&&Ne!==null?Ne=Hi(Ne):(Ne=ar(y)?ks:$t.current,Ne=Vi(d,Ne));var tt=y.getDerivedStateFromProps,It=typeof tt=="function"||typeof $.getSnapshotBeforeUpdate=="function";It||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(J!==E||me!==Ne)&&Hb(d,$,E,Ne),oa=!1;var pt=d.memoizedState;$.state=pt,mm(d,E,$,T),me=d.memoizedState,J!==E||pt!==me||Nn.current||oa?(typeof tt=="function"&&(cx(d,y,tt,E),me=d.memoizedState),(J=oa||Bb(d,y,J,E,pt,me,Ne))?(It||typeof $.UNSAFE_componentWillMount!="function"&&typeof $.componentWillMount!="function"||(typeof $.componentWillMount=="function"&&$.componentWillMount(),typeof $.UNSAFE_componentWillMount=="function"&&$.UNSAFE_componentWillMount()),typeof $.componentDidMount=="function"&&(d.flags|=4194308)):(typeof $.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=E,d.memoizedState=me),$.props=E,$.state=me,$.context=Ne,E=J):(typeof $.componentDidMount=="function"&&(d.flags|=4194308),E=!1)}else{$=d.stateNode,kb(c,d),J=d.memoizedProps,Ne=d.type===d.elementType?J:hs(d.type,J),$.props=Ne,It=d.pendingProps,pt=$.context,me=y.contextType,typeof me=="object"&&me!==null?me=Hi(me):(me=ar(y)?ks:$t.current,me=Vi(d,me));var dn=y.getDerivedStateFromProps;(tt=typeof dn=="function"||typeof $.getSnapshotBeforeUpdate=="function")||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(J!==It||pt!==me)&&Hb(d,$,E,me),oa=!1,pt=d.memoizedState,$.state=pt,mm(d,E,$,T);var dt=d.memoizedState;J!==It||pt!==dt||Nn.current||oa?(typeof dn=="function"&&(cx(d,y,dn,E),dt=d.memoizedState),(Ne=oa||Bb(d,y,Ne,E,pt,dt,me)||!1)?(tt||typeof $.UNSAFE_componentWillUpdate!="function"&&typeof $.componentWillUpdate!="function"||(typeof $.componentWillUpdate=="function"&&$.componentWillUpdate(E,dt,me),typeof $.UNSAFE_componentWillUpdate=="function"&&$.UNSAFE_componentWillUpdate(E,dt,me)),typeof $.componentDidUpdate=="function"&&(d.flags|=4),typeof $.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof $.componentDidUpdate!="function"||J===c.memoizedProps&&pt===c.memoizedState||(d.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||J===c.memoizedProps&&pt===c.memoizedState||(d.flags|=1024),d.memoizedProps=E,d.memoizedState=dt),$.props=E,$.state=dt,$.context=me,E=Ne):(typeof $.componentDidUpdate!="function"||J===c.memoizedProps&&pt===c.memoizedState||(d.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||J===c.memoizedProps&&pt===c.memoizedState||(d.flags|=1024),E=!1)}return Rx(c,d,y,E,I,T)}function Rx(c,d,y,E,T,I){TT(c,d);var $=(d.flags&128)!==0;if(!E&&!$)return T&&jc(d,y,!1),So(c,d,I);E=d.stateNode,NU.current=d;var J=$&&typeof y.getDerivedStateFromError!="function"?null:E.render();return d.flags|=1,c!==null&&$?(d.child=Qc(d,c.child,null,I),d.child=Qc(d,null,J,I)):Wr(c,d,J,I),d.memoizedState=E.state,T&&jc(d,y,!0),d.child}function AT(c){var d=c.stateNode;d.pendingContext?Us(c,d.pendingContext,d.pendingContext!==d.context):d.context&&Us(c,d.context,!1),gx(c,d.containerInfo)}function RT(c,d,y,E,T){return Kc(),mx(T),d.flags|=256,Wr(c,d,y,E),d.child}var Pm={dehydrated:null,treeContext:null,retryLane:0};function Im(c){return{baseLanes:c,cachePool:null}}function PT(c,d,y){var E=d.pendingProps,T=Tn.current,I=!1,$=(d.flags&128)!==0,J;if((J=$)||(J=c!==null&&c.memoizedState===null?!1:(T&2)!==0),J?(I=!0,d.flags&=-129):(c===null||c.memoizedState!==null)&&(T|=1),et(Tn,T&1),c===null)return px(d),c=d.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(d.mode&1?rf(c)?d.lanes=8:d.lanes=1073741824:d.lanes=1,null):(T=E.children,c=E.fallback,I?(E=d.mode,I=d.child,T={mode:"hidden",children:T},!(E&1)&&I!==null?(I.childLanes=0,I.pendingProps=T):I=Km(T,E,0,null),c=Tl(c,E,y,null),I.return=d,c.return=d,I.sibling=c,d.child=I,d.child.memoizedState=Im(y),d.memoizedState=Pm,c):Px(d,T));if(T=c.memoizedState,T!==null){if(J=T.dehydrated,J!==null){if($)return d.flags&256?(d.flags&=-257,Lm(c,d,y,Error(o(422)))):d.memoizedState!==null?(d.child=c.child,d.flags|=128,null):(I=E.fallback,T=d.mode,E=Km({mode:"visible",children:E.children},T,0,null),I=Tl(I,T,y,null),I.flags|=2,E.return=d,I.return=d,E.sibling=I,d.child=E,d.mode&1&&Qc(d,c.child,null,y),d.child.memoizedState=Im(y),d.memoizedState=Pm,I);if(!(d.mode&1))d=Lm(c,d,y,null);else if(rf(J))d=Lm(c,d,y,Error(o(419)));else if(E=(y&c.childLanes)!==0,Si||E){if(E=Yn,E!==null){switch(y&-y){case 4:I=2;break;case 16:I=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:I=32;break;case 536870912:I=268435456;break;default:I=0}E=I&(E.suspendedLanes|y)?0:I,E!==0&&E!==T.retryLane&&(T.retryLane=E,Xi(c,E,-1))}Zx(),d=Lm(c,d,y,Error(o(421)))}else nf(J)?(d.flags|=128,d.child=c.child,d=XU.bind(null,c),$c(J,d),d=null):(y=T.treeContext,xe&&(_i=im(J),xi=d,wn=!0,ps=null,af=!1,y!==null&&($i[Wi++]=yo,$i[Wi++]=xo,$i[Wi++]=yl,yo=y.id,xo=y.overflow,yl=d)),d=Px(d,d.pendingProps.children),d.flags|=4096);return d}return I?(E=LT(c,d,E.children,E.fallback,y),I=d.child,T=c.child.memoizedState,I.memoizedState=T===null?Im(y):{baseLanes:T.baseLanes|y,cachePool:null},I.childLanes=c.childLanes&~y,d.memoizedState=Pm,E):(y=IT(c,d,E.children,y),d.memoizedState=null,y)}return I?(E=LT(c,d,E.children,E.fallback,y),I=d.child,T=c.child.memoizedState,I.memoizedState=T===null?Im(y):{baseLanes:T.baseLanes|y,cachePool:null},I.childLanes=c.childLanes&~y,d.memoizedState=Pm,E):(y=IT(c,d,E.children,y),d.memoizedState=null,y)}function Px(c,d){return d=Km({mode:"visible",children:d},c.mode,0,null),d.return=c,c.child=d}function IT(c,d,y,E){var T=c.child;return c=T.sibling,y=fa(T,{mode:"visible",children:y}),!(d.mode&1)&&(y.lanes=E),y.return=d,y.sibling=null,c!==null&&(E=d.deletions,E===null?(d.deletions=[c],d.flags|=16):E.push(c)),d.child=y}function LT(c,d,y,E,T){var I=d.mode;c=c.child;var $=c.sibling,J={mode:"hidden",children:y};return!(I&1)&&d.child!==c?(y=d.child,y.childLanes=0,y.pendingProps=J,d.deletions=null):(y=fa(c,J),y.subtreeFlags=c.subtreeFlags&14680064),$!==null?E=fa($,E):(E=Tl(E,I,T,null),E.flags|=2),E.return=d,y.return=d,y.sibling=E,d.child=y,E}function Lm(c,d,y,E){return E!==null&&mx(E),Qc(d,c.child,null,y),c=Px(d,d.pendingProps.children),c.flags|=2,d.memoizedState=null,c}function DT(c,d,y){c.lanes|=d;var E=c.alternate;E!==null&&(E.lanes|=d),ax(c.return,d,y)}function Ix(c,d,y,E,T){var I=c.memoizedState;I===null?c.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:E,tail:y,tailMode:T}:(I.isBackwards=d,I.rendering=null,I.renderingStartTime=0,I.last=E,I.tail=y,I.tailMode=T)}function NT(c,d,y){var E=d.pendingProps,T=E.revealOrder,I=E.tail;if(Wr(c,d,E.children,y),E=Tn.current,E&2)E=E&1|2,d.flags|=128;else{if(c!==null&&c.flags&128)e:for(c=d.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&DT(c,y,d);else if(c.tag===19)DT(c,y,d);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===d)break e;for(;c.sibling===null;){if(c.return===null||c.return===d)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}E&=1}if(et(Tn,E),!(d.mode&1))d.memoizedState=null;else switch(T){case"forwards":for(y=d.child,T=null;y!==null;)c=y.alternate,c!==null&&_m(c)===null&&(T=y),y=y.sibling;y=T,y===null?(T=d.child,d.child=null):(T=y.sibling,y.sibling=null),Ix(d,!1,T,y,I);break;case"backwards":for(y=null,T=d.child,d.child=null;T!==null;){if(c=T.alternate,c!==null&&_m(c)===null){d.child=T;break}c=T.sibling,T.sibling=y,y=T,T=c}Ix(d,!0,y,null,I);break;case"together":Ix(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function So(c,d,y){if(c!==null&&(d.dependencies=c.dependencies),ru|=d.lanes,!(y&d.childLanes))return null;if(c!==null&&d.child!==c.child)throw Error(o(153));if(d.child!==null){for(c=d.child,y=fa(c,c.pendingProps),d.child=y,y.return=d;c.sibling!==null;)c=c.sibling,y=y.sibling=fa(c,c.pendingProps),y.return=d;y.sibling=null}return d.child}function OU(c,d,y){switch(d.tag){case 3:AT(d),Kc();break;case 5:Zb(d);break;case 1:ar(d.type)&&vr(d);break;case 4:gx(d,d.stateNode.containerInfo);break;case 10:Ob(d,d.type._context,d.memoizedProps.value);break;case 13:var E=d.memoizedState;if(E!==null)return E.dehydrated!==null?(et(Tn,Tn.current&1),d.flags|=128,null):y&d.child.childLanes?PT(c,d,y):(et(Tn,Tn.current&1),c=So(c,d,y),c!==null?c.sibling:null);et(Tn,Tn.current&1);break;case 19:if(E=(y&d.childLanes)!==0,c.flags&128){if(E)return NT(c,d,y);d.flags|=128}var T=d.memoizedState;if(T!==null&&(T.rendering=null,T.tail=null,T.lastEffect=null),et(Tn,Tn.current),E)break;return null;case 22:case 23:return d.lanes=0,bT(c,d,y)}return So(c,d,y)}function kU(c,d){switch(fx(d),d.tag){case 1:return ar(d.type)&&Vn(),c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 3:return eu(),yt(Nn),yt($t),xx(),c=d.flags,c&65536&&!(c&128)?(d.flags=c&-65537|128,d):null;case 5:return vx(d),null;case 13:if(yt(Tn),c=d.memoizedState,c!==null&&c.dehydrated!==null){if(d.alternate===null)throw Error(o(340));Kc()}return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 19:return yt(Tn),null;case 4:return eu(),null;case 10:return ox(d.type._context),null;case 22:case 23:return Yx(),null;case 24:return null;default:return null}}var Dm=!1,Sl=!1,UU=typeof WeakSet=="function"?WeakSet:Set,We=null;function Nm(c,d){var y=c.ref;if(y!==null)if(typeof y=="function")try{y(null)}catch(E){oi(c,d,E)}else y.current=null}function Lx(c,d,y){try{y()}catch(E){oi(c,d,E)}}var OT=!1;function FU(c,d){for(X(c.containerInfo),We=d;We!==null;)if(c=We,d=c.child,(c.subtreeFlags&1028)!==0&&d!==null)d.return=c,We=d;else for(;We!==null;){c=We;try{var y=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var E=y.memoizedProps,T=y.memoizedState,I=c.stateNode,$=I.getSnapshotBeforeUpdate(c.elementType===c.type?E:hs(c.type,E),T);I.__reactInternalSnapshotBeforeUpdate=$}break;case 3:Ce&&Pe(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(J){oi(c,c.return,J)}if(d=c.sibling,d!==null){d.return=c.return,We=d;break}We=c.return}return y=OT,OT=!1,y}function wl(c,d,y){var E=d.updateQueue;if(E=E!==null?E.lastEffect:null,E!==null){var T=E=E.next;do{if((T.tag&c)===c){var I=T.destroy;T.destroy=void 0,I!==void 0&&Lx(d,y,I)}T=T.next}while(T!==E)}}function xf(c,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var y=d=d.next;do{if((y.tag&c)===c){var E=y.create;y.destroy=E()}y=y.next}while(y!==d)}}function Dx(c){var d=c.ref;if(d!==null){var y=c.stateNode;switch(c.tag){case 5:c=Y(y);break;default:c=y}typeof d=="function"?d(c):d.current=c}}function kT(c,d,y){if(Fs&&typeof Fs.onCommitFiberUnmount=="function")try{Fs.onCommitFiberUnmount(cm,d)}catch{}switch(d.tag){case 0:case 11:case 14:case 15:if(c=d.updateQueue,c!==null&&(c=c.lastEffect,c!==null)){var E=c=c.next;do{var T=E,I=T.destroy;T=T.tag,I!==void 0&&(T&2||T&4)&&Lx(d,y,I),E=E.next}while(E!==c)}break;case 1:if(Nm(d,y),c=d.stateNode,typeof c.componentWillUnmount=="function")try{c.props=d.memoizedProps,c.state=d.memoizedState,c.componentWillUnmount()}catch($){oi(d,y,$)}break;case 5:Nm(d,y);break;case 4:Ce?HT(c,d,y):H&&H&&(d=d.stateNode.containerInfo,y=nt(d),Yt(d,y))}}function UT(c,d,y){for(var E=d;;)if(kT(c,E,y),E.child===null||Ce&&E.tag===4){if(E===d)break;for(;E.sibling===null;){if(E.return===null||E.return===d)return;E=E.return}E.sibling.return=E.return,E=E.sibling}else E.child.return=E,E=E.child}function FT(c){var d=c.alternate;d!==null&&(c.alternate=null,FT(d)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(d=c.stateNode,d!==null&&Xe(d)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function zT(c){return c.tag===5||c.tag===3||c.tag===4}function BT(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||zT(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function VT(c){if(Ce){e:{for(var d=c.return;d!==null;){if(zT(d))break e;d=d.return}throw Error(o(160))}var y=d;switch(y.tag){case 5:d=y.stateNode,y.flags&32&&(Se(d),y.flags&=-33),y=BT(c),Ox(c,y,d);break;case 3:case 4:d=y.stateNode.containerInfo,y=BT(c),Nx(c,y,d);break;default:throw Error(o(161))}}}function Nx(c,d,y){var E=c.tag;if(E===5||E===6)c=c.stateNode,d?it(y,c,d):mt(y,c);else if(E!==4&&(c=c.child,c!==null))for(Nx(c,d,y),c=c.sibling;c!==null;)Nx(c,d,y),c=c.sibling}function Ox(c,d,y){var E=c.tag;if(E===5||E===6)c=c.stateNode,d?ft(y,c,d):st(y,c);else if(E!==4&&(c=c.child,c!==null))for(Ox(c,d,y),c=c.sibling;c!==null;)Ox(c,d,y),c=c.sibling}function HT(c,d,y){for(var E=d,T=!1,I,$;;){if(!T){T=E.return;e:for(;;){if(T===null)throw Error(o(160));switch(I=T.stateNode,T.tag){case 5:$=!1;break e;case 3:I=I.containerInfo,$=!0;break e;case 4:I=I.containerInfo,$=!0;break e}T=T.return}T=!0}if(E.tag===5||E.tag===6)UT(c,E,y),$?Z(I,E.stateNode):Le(I,E.stateNode);else if(E.tag===18)$?ce(I,E.stateNode):fe(I,E.stateNode);else if(E.tag===4){if(E.child!==null){I=E.stateNode.containerInfo,$=!0,E.child.return=E,E=E.child;continue}}else if(kT(c,E,y),E.child!==null){E.child.return=E,E=E.child;continue}if(E===d)break;for(;E.sibling===null;){if(E.return===null||E.return===d)return;E=E.return,E.tag===4&&(T=!1)}E.sibling.return=E.return,E=E.sibling}}function kx(c,d){if(Ce){switch(d.tag){case 0:case 11:case 14:case 15:wl(3,d,d.return),xf(3,d),wl(5,d,d.return);return;case 1:return;case 5:var y=d.stateNode;if(y!=null){var E=d.memoizedProps;c=c!==null?c.memoizedProps:E;var T=d.type,I=d.updateQueue;d.updateQueue=null,I!==null&&wt(y,I,T,c,E,d)}return;case 6:if(d.stateNode===null)throw Error(o(162));y=d.memoizedProps,Ee(d.stateNode,c!==null?c.memoizedProps:y,y);return;case 3:xe&&c!==null&&c.memoizedState.isDehydrated&&oe(d.stateNode.containerInfo);return;case 12:return;case 13:Om(d);return;case 19:Om(d);return;case 17:return}throw Error(o(163))}switch(d.tag){case 0:case 11:case 14:case 15:wl(3,d,d.return),xf(3,d),wl(5,d,d.return);return;case 12:return;case 13:Om(d);return;case 19:Om(d);return;case 3:xe&&c!==null&&c.memoizedState.isDehydrated&&oe(d.stateNode.containerInfo);break;case 22:case 23:return}e:if(H){switch(d.tag){case 1:case 5:case 6:break e;case 3:case 4:d=d.stateNode,Yt(d.containerInfo,d.pendingChildren);break e}throw Error(o(163))}}function Om(c){var d=c.updateQueue;if(d!==null){c.updateQueue=null;var y=c.stateNode;y===null&&(y=c.stateNode=new UU),d.forEach(function(E){var T=qU.bind(null,c,E);y.has(E)||(y.add(E),E.then(T,T))})}}function zU(c,d){for(We=d;We!==null;){d=We;var y=d.deletions;if(y!==null)for(var E=0;E";case Um:return":has("+(zx(c)||"")+")";case Fm:return'[role="'+c.value+'"]';case Bm:return'"'+c.value+'"';case zm:return'[data-testname="'+c.value+'"]';default:throw Error(o(365))}}function XT(c,d){var y=[];c=[c,0];for(var E=0;ET&&(T=$),E&=~I}if(E=T,E=lr()-E,E=(120>E?120:480>E?480:1080>E?1080:1920>E?1920:3e3>E?3e3:4320>E?4320:1960*VU(E/1960))-E,10c?16:c,ca===null)var E=!1;else{if(c=ca,ca=null,Gm=0,Wt&6)throw Error(o(331));var T=Wt;for(Wt|=4,We=c.current;We!==null;){var I=We,$=I.child;if(We.flags&16){var J=I.deletions;if(J!==null){for(var me=0;melr()-$x?El(c,0):Hx|=y),si(c,d)}function nC(c,d){d===0&&(c.mode&1?(d=am,am<<=1,!(am&130023424)&&(am=4194304)):d=1);var y=Gr();c=qm(c,d),c!==null&&(of(c,d,y),si(c,y))}function XU(c){var d=c.memoizedState,y=0;d!==null&&(y=d.retryLane),nC(c,y)}function qU(c,d){var y=0;switch(c.tag){case 13:var E=c.stateNode,T=c.memoizedState;T!==null&&(y=T.retryLane);break;case 19:E=c.stateNode;break;default:throw Error(o(314))}E!==null&&E.delete(d),nC(c,y)}var rC;rC=function(c,d,y){if(c!==null)if(c.memoizedProps!==d.pendingProps||Nn.current)Si=!0;else{if(!(c.lanes&y)&&!(d.flags&128))return Si=!1,OU(c,d,y);Si=!!(c.flags&131072)}else Si=!1,wn&&d.flags&1048576&&$b(d,ym,d.index);switch(d.lanes=0,d.tag){case 2:var E=d.type;c!==null&&(c.alternate=null,d.alternate=null,d.flags|=2),c=d.pendingProps;var T=Vi(d,$t.current);qc(d,y),T=Sx(null,d,E,c,T,y);var I=wx();return d.flags|=1,typeof T=="object"&&T!==null&&typeof T.render=="function"&&T.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,ar(E)?(I=!0,vr(d)):I=!1,d.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,lx(d),T.updater=gm,d.stateNode=T,T._reactInternals=d,ux(d,E,c,y),d=Rx(null,d,E,!0,I,y)):(d.tag=0,wn&&I&&dx(d),Wr(null,d,T,y),d=d.child),d;case 16:E=d.elementType;e:{switch(c!==null&&(c.alternate=null,d.alternate=null,d.flags|=2),c=d.pendingProps,T=E._init,E=T(E._payload),d.type=E,T=d.tag=ZU(E),c=hs(E,c),T){case 0:d=Ax(null,d,E,c,y);break e;case 1:d=CT(null,d,E,c,y);break e;case 11:d=wT(null,d,E,c,y);break e;case 14:d=ET(null,d,E,hs(E.type,c),y);break e}throw Error(o(306,E,""))}return d;case 0:return E=d.type,T=d.pendingProps,T=d.elementType===E?T:hs(E,T),Ax(c,d,E,T,y);case 1:return E=d.type,T=d.pendingProps,T=d.elementType===E?T:hs(E,T),CT(c,d,E,T,y);case 3:e:{if(AT(d),c===null)throw Error(o(387));E=d.pendingProps,I=d.memoizedState,T=I.element,kb(c,d),mm(d,E,null,y);var $=d.memoizedState;if(E=$.element,xe&&I.isDehydrated)if(I={element:E,isDehydrated:!1,cache:$.cache,transitions:$.transitions},d.updateQueue.baseState=I,d.memoizedState=I,d.flags&256){T=Error(o(423)),d=RT(c,d,E,y,T);break e}else if(E!==T){T=Error(o(424)),d=RT(c,d,E,y,T);break e}else for(xe&&(_i=rm(d.stateNode.containerInfo),xi=d,wn=!0,ps=null,af=!1),y=Yb(d,null,E,y),d.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if(Kc(),E===T){d=So(c,d,y);break e}Wr(c,d,E,y)}d=d.child}return d;case 5:return Zb(d),c===null&&px(d),E=d.type,T=d.pendingProps,I=c!==null?c.memoizedProps:null,$=T.children,le(E,T)?$=null:I!==null&&le(E,I)&&(d.flags|=32),TT(c,d),Wr(c,d,$,y),d.child;case 6:return c===null&&px(d),null;case 13:return PT(c,d,y);case 4:return gx(d,d.stateNode.containerInfo),E=d.pendingProps,c===null?d.child=Qc(d,null,E,y):Wr(c,d,E,y),d.child;case 11:return E=d.type,T=d.pendingProps,T=d.elementType===E?T:hs(E,T),wT(c,d,E,T,y);case 7:return Wr(c,d,d.pendingProps,y),d.child;case 8:return Wr(c,d,d.pendingProps.children,y),d.child;case 12:return Wr(c,d,d.pendingProps.children,y),d.child;case 10:e:{if(E=d.type._context,T=d.pendingProps,I=d.memoizedProps,$=T.value,Ob(d,E,$),I!==null)if(zs(I.value,$)){if(I.children===T.children&&!Nn.current){d=So(c,d,y);break e}}else for(I=d.child,I!==null&&(I.return=d);I!==null;){var J=I.dependencies;if(J!==null){$=I.child;for(var me=J.firstContext;me!==null;){if(me.context===E){if(I.tag===1){me=vo(-1,y&-y),me.tag=2;var Ne=I.updateQueue;if(Ne!==null){Ne=Ne.shared;var tt=Ne.pending;tt===null?me.next=me:(me.next=tt.next,tt.next=me),Ne.pending=me}}I.lanes|=y,me=I.alternate,me!==null&&(me.lanes|=y),ax(I.return,y,d),J.lanes|=y;break}me=me.next}}else if(I.tag===10)$=I.type===d.type?null:I.child;else if(I.tag===18){if($=I.return,$===null)throw Error(o(341));$.lanes|=y,J=$.alternate,J!==null&&(J.lanes|=y),ax($,y,d),$=I.sibling}else $=I.child;if($!==null)$.return=I;else for($=I;$!==null;){if($===d){$=null;break}if(I=$.sibling,I!==null){I.return=$.return,$=I;break}$=$.return}I=$}Wr(c,d,T.children,y),d=d.child}return d;case 9:return T=d.type,E=d.pendingProps.children,qc(d,y),T=Hi(T),E=E(T),d.flags|=1,Wr(c,d,E,y),d.child;case 14:return E=d.type,T=hs(E,d.pendingProps),T=hs(E.type,T),ET(c,d,E,T,y);case 15:return MT(c,d,d.type,d.pendingProps,y);case 17:return E=d.type,T=d.pendingProps,T=d.elementType===E?T:hs(E,T),c!==null&&(c.alternate=null,d.alternate=null,d.flags|=2),d.tag=1,ar(E)?(c=!0,vr(d)):c=!1,qc(d,y),Vb(d,E,T),ux(d,E,T,y),Rx(null,d,E,!0,c,y);case 19:return NT(c,d,y);case 22:return bT(c,d,y)}throw Error(o(156,d.tag))};function iC(c,d){return ex(c,d)}function YU(c,d,y,E){this.tag=c,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=E,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qi(c,d,y,E){return new YU(c,d,y,E)}function Kx(c){return c=c.prototype,!(!c||!c.isReactComponent)}function ZU(c){if(typeof c=="function")return Kx(c)?1:0;if(c!=null){if(c=c.$$typeof,c===w)return 11;if(c===S)return 14}return 2}function fa(c,d){var y=c.alternate;return y===null?(y=qi(c.tag,d,c.key,c.mode),y.elementType=c.elementType,y.type=c.type,y.stateNode=c.stateNode,y.alternate=c,c.alternate=y):(y.pendingProps=d,y.type=c.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=c.flags&14680064,y.childLanes=c.childLanes,y.lanes=c.lanes,y.child=c.child,y.memoizedProps=c.memoizedProps,y.memoizedState=c.memoizedState,y.updateQueue=c.updateQueue,d=c.dependencies,y.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},y.sibling=c.sibling,y.index=c.index,y.ref=c.ref,y}function Zm(c,d,y,E,T,I){var $=2;if(E=c,typeof c=="function")Kx(c)&&($=1);else if(typeof c=="string")$=5;else e:switch(c){case f:return Tl(y.children,T,I,d);case h:$=8,T|=8;break;case p:return c=qi(12,y,d,T|2),c.elementType=p,c.lanes=I,c;case x:return c=qi(13,y,d,T),c.elementType=x,c.lanes=I,c;case g:return c=qi(19,y,d,T),c.elementType=g,c.lanes=I,c;case b:return Km(y,T,I,d);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case m:$=10;break e;case v:$=9;break e;case w:$=11;break e;case S:$=14;break e;case _:$=16,E=null;break e}throw Error(o(130,c==null?c:typeof c,""))}return d=qi($,y,d,T),d.elementType=c,d.type=E,d.lanes=I,d}function Tl(c,d,y,E){return c=qi(7,c,E,d),c.lanes=y,c}function Km(c,d,y,E){return c=qi(22,c,E,d),c.elementType=b,c.lanes=y,c.stateNode={},c}function Qx(c,d,y){return c=qi(6,c,null,d),c.lanes=y,c}function Jx(c,d,y){return d=qi(4,c.children!==null?c.children:[],c.key,d),d.lanes=y,d.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},d}function KU(c,d,y,E,T){this.tag=d,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=De,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Qy(0),this.expirationTimes=Qy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qy(0),this.identifierPrefix=E,this.onRecoverableError=T,xe&&(this.mutableSourceEagerHydrationData=null)}function sC(c,d,y,E,T,I,$,J,me){return c=new KU(c,d,y,J,me),d===1?(d=1,I===!0&&(d|=8)):d=0,I=qi(3,null,null,d),c.current=I,I.stateNode=c,I.memoizedState={element:E,isDehydrated:y,cache:null,transitions:null},lx(I),c}function oC(c){if(!c)return Bi;c=c._reactInternals;e:{if(V(c)!==c||c.tag!==1)throw Error(o(170));var d=c;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if(ar(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(o(171))}if(c.tag===1){var y=c.type;if(ar(y))return Gc(c,y,d)}return d}function aC(c){var d=c._reactInternals;if(d===void 0)throw typeof c.render=="function"?Error(o(188)):(c=Object.keys(c).join(","),Error(o(268,c)));return c=W(d),c===null?null:c.stateNode}function lC(c,d){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var y=c.retryLane;c.retryLane=y!==0&&y=Ne&&I>=It&&T<=tt&&$<=pt){c.splice(d,1);break}else if(E!==Ne||y.width!==me.width||pt$){if(!(I!==It||y.height!==me.height||ttT)){Ne>E&&(me.width+=Ne-E,me.x=E),ttI&&(me.height+=It-I,me.y=I),pt<$&&(me.height=$-It),c.splice(d,1);break}}}return c},t.findHostInstance=aC,t.findHostInstanceWithNoPortals=function(c){return c=L(c),c=c!==null?z(c):null,c===null?null:c.stateNode},t.findHostInstanceWithWarning=function(c){return aC(c)},t.flushControlled=function(c){var d=Wt;Wt|=1;var y=Hn.transition,E=en;try{Hn.transition=null,en=1,c()}finally{en=E,Hn.transition=y,Wt=d,Wt===0&&(iu(),Bs())}},t.flushPassiveEffects=bl,t.flushSync=ZT,t.focusWithin=function(c,d){if(!O)throw Error(o(363));for(c=Ux(c),d=XT(c,d),d=Array.from(d),c=0;cy&&(y=$)),$jx&&(d.flags|=128,E=!0,_f(T,!1),d.lanes=4194304)}else{if(!E)if(c=wm(I),c!==null){if(d.flags|=128,E=!0,c=c.updateQueue,c!==null&&(d.updateQueue=c,d.flags|=4),_f(T,!0),T.tail===null&&T.tailMode==="hidden"&&!I.alternate&&!En)return Ar(d),null}else 2*lr()-T.renderingStartTime>jx&&y!==1073741824&&(d.flags|=128,E=!0,_f(T,!1),d.lanes=4194304);T.isBackwards?(I.sibling=d.child,d.child=I):(c=T.last,c!==null?c.sibling=I:d.child=I,T.last=I)}return T.tail!==null?(d=T.tail,T.rendering=d,T.tail=d.sibling,T.renderingStartTime=lr(),d.sibling=null,c=Tn.current,et(Tn,E?c&1|2:c&1),d):(Ar(d),null);case 22:case 23:return Kx(),E=d.memoizedState!==null,c!==null&&c.memoizedState!==null!==E&&(d.flags|=8192),E&&d.mode&1?wi&1073741824&&(Ar(d),Ce&&d.subtreeFlags&6&&(d.flags|=8192)):Ar(d),null;case 24:return null;case 25:return null}throw Error(o(156,d.tag))}var BU=a.ReactCurrentOwner,Si=!1;function Wr(c,d,y,E){d.child=c===null?Yb(d,null,y,E):eu(d,c.child,y,E)}function wT(c,d,y,E,T){y=y.render;var I=d.ref;return Zc(d,T),E=Ex(c,d,y,E,I,T),y=Mx(),c!==null&&!Si?(d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~T,wo(c,d,T)):(En&&y&&hx(d),d.flags|=1,Wr(c,d,E,T),d.child)}function ET(c,d,y,E,T){if(c===null){var I=y.type;return typeof I=="function"&&!Jx(I)&&I.defaultProps===void 0&&y.compare===null&&y.defaultProps===void 0?(d.tag=15,d.type=I,MT(c,d,I,E,T)):(c=Qm(y.type,null,E,d,d.mode,T),c.ref=d.ref,c.return=d,d.child=c)}if(I=c.child,!(c.lanes&T)){var $=I.memoizedProps;if(y=y.compare,y=y!==null?y:hm,y($,E)&&c.ref===d.ref)return wo(c,d,T)}return d.flags|=1,c=ha(I,E),c.ref=d.ref,c.return=d,d.child=c}function MT(c,d,y,E,T){if(c!==null&&hm(c.memoizedProps,E)&&c.ref===d.ref)if(Si=!1,(c.lanes&T)!==0)c.flags&131072&&(Si=!0);else return d.lanes=c.lanes,wo(c,d,T);return Px(c,d,y,E,T)}function bT(c,d,y){var E=d.pendingProps,T=E.children,I=c!==null?c.memoizedState:null;if(E.mode==="hidden")if(!(d.mode&1))d.memoizedState={baseLanes:0,cachePool:null},et(iu,wi),wi|=y;else if(y&1073741824)d.memoizedState={baseLanes:0,cachePool:null},E=I!==null?I.baseLanes:y,et(iu,wi),wi|=E;else return c=I!==null?I.baseLanes|y:y,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:c,cachePool:null},d.updateQueue=null,et(iu,wi),wi|=c,null;else I!==null?(E=I.baseLanes|y,d.memoizedState=null):E=y,et(iu,wi),wi|=E;return Wr(c,d,T,y),d.child}function TT(c,d){var y=d.ref;(c===null&&y!==null||c!==null&&c.ref!==y)&&(d.flags|=512,d.flags|=2097152)}function Px(c,d,y,E,T){var I=ar(y)?Us:$t.current;return I=Vi(d,I),Zc(d,T),y=Ex(c,d,y,E,I,T),E=Mx(),c!==null&&!Si?(d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~T,wo(c,d,T)):(En&&E&&hx(d),d.flags|=1,Wr(c,d,y,T),d.child)}function CT(c,d,y,E,T){if(ar(y)){var I=!0;vr(d)}else I=!1;if(Zc(d,T),d.stateNode===null)c!==null&&(c.alternate=null,d.alternate=null,d.flags|=2),Vb(d,y,E),fx(d,y,E,T),E=!0;else if(c===null){var $=d.stateNode,J=d.memoizedProps;$.props=J;var me=$.context,Ne=y.contextType;typeof Ne=="object"&&Ne!==null?Ne=Hi(Ne):(Ne=ar(y)?Us:$t.current,Ne=Vi(d,Ne));var tt=y.getDerivedStateFromProps,It=typeof tt=="function"||typeof $.getSnapshotBeforeUpdate=="function";It||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(J!==E||me!==Ne)&&Hb(d,$,E,Ne),aa=!1;var pt=d.memoizedState;$.state=pt,vm(d,E,$,T),me=d.memoizedState,J!==E||pt!==me||Nn.current||aa?(typeof tt=="function"&&(dx(d,y,tt,E),me=d.memoizedState),(J=aa||Bb(d,y,J,E,pt,me,Ne))?(It||typeof $.UNSAFE_componentWillMount!="function"&&typeof $.componentWillMount!="function"||(typeof $.componentWillMount=="function"&&$.componentWillMount(),typeof $.UNSAFE_componentWillMount=="function"&&$.UNSAFE_componentWillMount()),typeof $.componentDidMount=="function"&&(d.flags|=4194308)):(typeof $.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=E,d.memoizedState=me),$.props=E,$.state=me,$.context=Ne,E=J):(typeof $.componentDidMount=="function"&&(d.flags|=4194308),E=!1)}else{$=d.stateNode,kb(c,d),J=d.memoizedProps,Ne=d.type===d.elementType?J:hs(d.type,J),$.props=Ne,It=d.pendingProps,pt=$.context,me=y.contextType,typeof me=="object"&&me!==null?me=Hi(me):(me=ar(y)?Us:$t.current,me=Vi(d,me));var un=y.getDerivedStateFromProps;(tt=typeof un=="function"||typeof $.getSnapshotBeforeUpdate=="function")||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(J!==It||pt!==me)&&Hb(d,$,E,me),aa=!1,pt=d.memoizedState,$.state=pt,vm(d,E,$,T);var dt=d.memoizedState;J!==It||pt!==dt||Nn.current||aa?(typeof un=="function"&&(dx(d,y,un,E),dt=d.memoizedState),(Ne=aa||Bb(d,y,Ne,E,pt,dt,me)||!1)?(tt||typeof $.UNSAFE_componentWillUpdate!="function"&&typeof $.componentWillUpdate!="function"||(typeof $.componentWillUpdate=="function"&&$.componentWillUpdate(E,dt,me),typeof $.UNSAFE_componentWillUpdate=="function"&&$.UNSAFE_componentWillUpdate(E,dt,me)),typeof $.componentDidUpdate=="function"&&(d.flags|=4),typeof $.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof $.componentDidUpdate!="function"||J===c.memoizedProps&&pt===c.memoizedState||(d.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||J===c.memoizedProps&&pt===c.memoizedState||(d.flags|=1024),d.memoizedProps=E,d.memoizedState=dt),$.props=E,$.state=dt,$.context=me,E=Ne):(typeof $.componentDidUpdate!="function"||J===c.memoizedProps&&pt===c.memoizedState||(d.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||J===c.memoizedProps&&pt===c.memoizedState||(d.flags|=1024),E=!1)}return Ix(c,d,y,E,I,T)}function Ix(c,d,y,E,T,I){TT(c,d);var $=(d.flags&128)!==0;if(!E&&!$)return T&&qc(d,y,!1),wo(c,d,I);E=d.stateNode,BU.current=d;var J=$&&typeof y.getDerivedStateFromError!="function"?null:E.render();return d.flags|=1,c!==null&&$?(d.child=eu(d,c.child,null,I),d.child=eu(d,null,J,I)):Wr(c,d,J,I),d.memoizedState=E.state,T&&qc(d,y,!0),d.child}function AT(c){var d=c.stateNode;d.pendingContext?Fs(c,d.pendingContext,d.pendingContext!==d.context):d.context&&Fs(c,d.context,!1),yx(c,d.containerInfo)}function RT(c,d,y,E,T){return Jc(),vx(T),d.flags|=256,Wr(c,d,y,E),d.child}var Lm={dehydrated:null,treeContext:null,retryLane:0};function Dm(c){return{baseLanes:c,cachePool:null}}function PT(c,d,y){var E=d.pendingProps,T=Tn.current,I=!1,$=(d.flags&128)!==0,J;if((J=$)||(J=c!==null&&c.memoizedState===null?!1:(T&2)!==0),J?(I=!0,d.flags&=-129):(c===null||c.memoizedState!==null)&&(T|=1),et(Tn,T&1),c===null)return gx(d),c=d.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(d.mode&1?of(c)?d.lanes=8:d.lanes=1073741824:d.lanes=1,null):(T=E.children,c=E.fallback,I?(E=d.mode,I=d.child,T={mode:"hidden",children:T},!(E&1)&&I!==null?(I.childLanes=0,I.pendingProps=T):I=Jm(T,E,0,null),c=Cl(c,E,y,null),I.return=d,c.return=d,I.sibling=c,d.child=I,d.child.memoizedState=Dm(y),d.memoizedState=Lm,c):Lx(d,T));if(T=c.memoizedState,T!==null){if(J=T.dehydrated,J!==null){if($)return d.flags&256?(d.flags&=-257,Nm(c,d,y,Error(o(422)))):d.memoizedState!==null?(d.child=c.child,d.flags|=128,null):(I=E.fallback,T=d.mode,E=Jm({mode:"visible",children:E.children},T,0,null),I=Cl(I,T,y,null),I.flags|=2,E.return=d,I.return=d,E.sibling=I,d.child=E,d.mode&1&&eu(d,c.child,null,y),d.child.memoizedState=Dm(y),d.memoizedState=Lm,I);if(!(d.mode&1))d=Nm(c,d,y,null);else if(of(J))d=Nm(c,d,y,Error(o(419)));else if(E=(y&c.childLanes)!==0,Si||E){if(E=Yn,E!==null){switch(y&-y){case 4:I=2;break;case 16:I=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:I=32;break;case 536870912:I=268435456;break;default:I=0}E=I&(E.suspendedLanes|y)?0:I,E!==0&&E!==T.retryLane&&(T.retryLane=E,Xi(c,E,-1))}Qx(),d=Nm(c,d,y,Error(o(421)))}else sf(J)?(d.flags|=128,d.child=c.child,d=JU.bind(null,c),Gc(J,d),d=null):(y=T.treeContext,xe&&(_i=om(J),xi=d,En=!0,ps=null,cf=!1,y!==null&&($i[Wi++]=xo,$i[Wi++]=_o,$i[Wi++]=xl,xo=y.id,_o=y.overflow,xl=d)),d=Lx(d,d.pendingProps.children),d.flags|=4096);return d}return I?(E=LT(c,d,E.children,E.fallback,y),I=d.child,T=c.child.memoizedState,I.memoizedState=T===null?Dm(y):{baseLanes:T.baseLanes|y,cachePool:null},I.childLanes=c.childLanes&~y,d.memoizedState=Lm,E):(y=IT(c,d,E.children,y),d.memoizedState=null,y)}return I?(E=LT(c,d,E.children,E.fallback,y),I=d.child,T=c.child.memoizedState,I.memoizedState=T===null?Dm(y):{baseLanes:T.baseLanes|y,cachePool:null},I.childLanes=c.childLanes&~y,d.memoizedState=Lm,E):(y=IT(c,d,E.children,y),d.memoizedState=null,y)}function Lx(c,d){return d=Jm({mode:"visible",children:d},c.mode,0,null),d.return=c,c.child=d}function IT(c,d,y,E){var T=c.child;return c=T.sibling,y=ha(T,{mode:"visible",children:y}),!(d.mode&1)&&(y.lanes=E),y.return=d,y.sibling=null,c!==null&&(E=d.deletions,E===null?(d.deletions=[c],d.flags|=16):E.push(c)),d.child=y}function LT(c,d,y,E,T){var I=d.mode;c=c.child;var $=c.sibling,J={mode:"hidden",children:y};return!(I&1)&&d.child!==c?(y=d.child,y.childLanes=0,y.pendingProps=J,d.deletions=null):(y=ha(c,J),y.subtreeFlags=c.subtreeFlags&14680064),$!==null?E=ha($,E):(E=Cl(E,I,T,null),E.flags|=2),E.return=d,y.return=d,y.sibling=E,d.child=y,E}function Nm(c,d,y,E){return E!==null&&vx(E),eu(d,c.child,null,y),c=Lx(d,d.pendingProps.children),c.flags|=2,d.memoizedState=null,c}function DT(c,d,y){c.lanes|=d;var E=c.alternate;E!==null&&(E.lanes|=d),cx(c.return,d,y)}function Dx(c,d,y,E,T){var I=c.memoizedState;I===null?c.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:E,tail:y,tailMode:T}:(I.isBackwards=d,I.rendering=null,I.renderingStartTime=0,I.last=E,I.tail=y,I.tailMode=T)}function NT(c,d,y){var E=d.pendingProps,T=E.revealOrder,I=E.tail;if(Wr(c,d,E.children,y),E=Tn.current,E&2)E=E&1|2,d.flags|=128;else{if(c!==null&&c.flags&128)e:for(c=d.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&DT(c,y,d);else if(c.tag===19)DT(c,y,d);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===d)break e;for(;c.sibling===null;){if(c.return===null||c.return===d)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}E&=1}if(et(Tn,E),!(d.mode&1))d.memoizedState=null;else switch(T){case"forwards":for(y=d.child,T=null;y!==null;)c=y.alternate,c!==null&&wm(c)===null&&(T=y),y=y.sibling;y=T,y===null?(T=d.child,d.child=null):(T=y.sibling,y.sibling=null),Dx(d,!1,T,y,I);break;case"backwards":for(y=null,T=d.child,d.child=null;T!==null;){if(c=T.alternate,c!==null&&wm(c)===null){d.child=T;break}c=T.sibling,T.sibling=y,y=T,T=c}Dx(d,!0,y,null,I);break;case"together":Dx(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function wo(c,d,y){if(c!==null&&(d.dependencies=c.dependencies),su|=d.lanes,!(y&d.childLanes))return null;if(c!==null&&d.child!==c.child)throw Error(o(153));if(d.child!==null){for(c=d.child,y=ha(c,c.pendingProps),d.child=y,y.return=d;c.sibling!==null;)c=c.sibling,y=y.sibling=ha(c,c.pendingProps),y.return=d;y.sibling=null}return d.child}function VU(c,d,y){switch(d.tag){case 3:AT(d),Jc();break;case 5:Zb(d);break;case 1:ar(d.type)&&vr(d);break;case 4:yx(d,d.stateNode.containerInfo);break;case 10:Ob(d,d.type._context,d.memoizedProps.value);break;case 13:var E=d.memoizedState;if(E!==null)return E.dehydrated!==null?(et(Tn,Tn.current&1),d.flags|=128,null):y&d.child.childLanes?PT(c,d,y):(et(Tn,Tn.current&1),c=wo(c,d,y),c!==null?c.sibling:null);et(Tn,Tn.current&1);break;case 19:if(E=(y&d.childLanes)!==0,c.flags&128){if(E)return NT(c,d,y);d.flags|=128}var T=d.memoizedState;if(T!==null&&(T.rendering=null,T.tail=null,T.lastEffect=null),et(Tn,Tn.current),E)break;return null;case 22:case 23:return d.lanes=0,bT(c,d,y)}return wo(c,d,y)}function HU(c,d){switch(px(d),d.tag){case 1:return ar(d.type)&&Vn(),c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 3:return nu(),yt(Nn),yt($t),Sx(),c=d.flags,c&65536&&!(c&128)?(d.flags=c&-65537|128,d):null;case 5:return xx(d),null;case 13:if(yt(Tn),c=d.memoizedState,c!==null&&c.dehydrated!==null){if(d.alternate===null)throw Error(o(340));Jc()}return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 19:return yt(Tn),null;case 4:return nu(),null;case 10:return lx(d.type._context),null;case 22:case 23:return Kx(),null;case 24:return null;default:return null}}var Om=!1,wl=!1,$U=typeof WeakSet=="function"?WeakSet:Set,We=null;function km(c,d){var y=c.ref;if(y!==null)if(typeof y=="function")try{y(null)}catch(E){oi(c,d,E)}else y.current=null}function Nx(c,d,y){try{y()}catch(E){oi(c,d,E)}}var OT=!1;function WU(c,d){for(X(c.containerInfo),We=d;We!==null;)if(c=We,d=c.child,(c.subtreeFlags&1028)!==0&&d!==null)d.return=c,We=d;else for(;We!==null;){c=We;try{var y=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var E=y.memoizedProps,T=y.memoizedState,I=c.stateNode,$=I.getSnapshotBeforeUpdate(c.elementType===c.type?E:hs(c.type,E),T);I.__reactInternalSnapshotBeforeUpdate=$}break;case 3:Ce&&Pe(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(J){oi(c,c.return,J)}if(d=c.sibling,d!==null){d.return=c.return,We=d;break}We=c.return}return y=OT,OT=!1,y}function El(c,d,y){var E=d.updateQueue;if(E=E!==null?E.lastEffect:null,E!==null){var T=E=E.next;do{if((T.tag&c)===c){var I=T.destroy;T.destroy=void 0,I!==void 0&&Nx(d,y,I)}T=T.next}while(T!==E)}}function Sf(c,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var y=d=d.next;do{if((y.tag&c)===c){var E=y.create;y.destroy=E()}y=y.next}while(y!==d)}}function Ox(c){var d=c.ref;if(d!==null){var y=c.stateNode;switch(c.tag){case 5:c=Y(y);break;default:c=y}typeof d=="function"?d(c):d.current=c}}function kT(c,d,y){if(zs&&typeof zs.onCommitFiberUnmount=="function")try{zs.onCommitFiberUnmount(dm,d)}catch{}switch(d.tag){case 0:case 11:case 14:case 15:if(c=d.updateQueue,c!==null&&(c=c.lastEffect,c!==null)){var E=c=c.next;do{var T=E,I=T.destroy;T=T.tag,I!==void 0&&(T&2||T&4)&&Nx(d,y,I),E=E.next}while(E!==c)}break;case 1:if(km(d,y),c=d.stateNode,typeof c.componentWillUnmount=="function")try{c.props=d.memoizedProps,c.state=d.memoizedState,c.componentWillUnmount()}catch($){oi(d,y,$)}break;case 5:km(d,y);break;case 4:Ce?HT(c,d,y):H&&H&&(d=d.stateNode.containerInfo,y=nt(d),Yt(d,y))}}function UT(c,d,y){for(var E=d;;)if(kT(c,E,y),E.child===null||Ce&&E.tag===4){if(E===d)break;for(;E.sibling===null;){if(E.return===null||E.return===d)return;E=E.return}E.sibling.return=E.return,E=E.sibling}else E.child.return=E,E=E.child}function FT(c){var d=c.alternate;d!==null&&(c.alternate=null,FT(d)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(d=c.stateNode,d!==null&&Xe(d)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function zT(c){return c.tag===5||c.tag===3||c.tag===4}function BT(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||zT(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function VT(c){if(Ce){e:{for(var d=c.return;d!==null;){if(zT(d))break e;d=d.return}throw Error(o(160))}var y=d;switch(y.tag){case 5:d=y.stateNode,y.flags&32&&(Se(d),y.flags&=-33),y=BT(c),Ux(c,y,d);break;case 3:case 4:d=y.stateNode.containerInfo,y=BT(c),kx(c,y,d);break;default:throw Error(o(161))}}}function kx(c,d,y){var E=c.tag;if(E===5||E===6)c=c.stateNode,d?it(y,c,d):mt(y,c);else if(E!==4&&(c=c.child,c!==null))for(kx(c,d,y),c=c.sibling;c!==null;)kx(c,d,y),c=c.sibling}function Ux(c,d,y){var E=c.tag;if(E===5||E===6)c=c.stateNode,d?ft(y,c,d):st(y,c);else if(E!==4&&(c=c.child,c!==null))for(Ux(c,d,y),c=c.sibling;c!==null;)Ux(c,d,y),c=c.sibling}function HT(c,d,y){for(var E=d,T=!1,I,$;;){if(!T){T=E.return;e:for(;;){if(T===null)throw Error(o(160));switch(I=T.stateNode,T.tag){case 5:$=!1;break e;case 3:I=I.containerInfo,$=!0;break e;case 4:I=I.containerInfo,$=!0;break e}T=T.return}T=!0}if(E.tag===5||E.tag===6)UT(c,E,y),$?Z(I,E.stateNode):Le(I,E.stateNode);else if(E.tag===18)$?ce(I,E.stateNode):fe(I,E.stateNode);else if(E.tag===4){if(E.child!==null){I=E.stateNode.containerInfo,$=!0,E.child.return=E,E=E.child;continue}}else if(kT(c,E,y),E.child!==null){E.child.return=E,E=E.child;continue}if(E===d)break;for(;E.sibling===null;){if(E.return===null||E.return===d)return;E=E.return,E.tag===4&&(T=!1)}E.sibling.return=E.return,E=E.sibling}}function Fx(c,d){if(Ce){switch(d.tag){case 0:case 11:case 14:case 15:El(3,d,d.return),Sf(3,d),El(5,d,d.return);return;case 1:return;case 5:var y=d.stateNode;if(y!=null){var E=d.memoizedProps;c=c!==null?c.memoizedProps:E;var T=d.type,I=d.updateQueue;d.updateQueue=null,I!==null&&wt(y,I,T,c,E,d)}return;case 6:if(d.stateNode===null)throw Error(o(162));y=d.memoizedProps,Ee(d.stateNode,c!==null?c.memoizedProps:y,y);return;case 3:xe&&c!==null&&c.memoizedState.isDehydrated&&oe(d.stateNode.containerInfo);return;case 12:return;case 13:Um(d);return;case 19:Um(d);return;case 17:return}throw Error(o(163))}switch(d.tag){case 0:case 11:case 14:case 15:El(3,d,d.return),Sf(3,d),El(5,d,d.return);return;case 12:return;case 13:Um(d);return;case 19:Um(d);return;case 3:xe&&c!==null&&c.memoizedState.isDehydrated&&oe(d.stateNode.containerInfo);break;case 22:case 23:return}e:if(H){switch(d.tag){case 1:case 5:case 6:break e;case 3:case 4:d=d.stateNode,Yt(d.containerInfo,d.pendingChildren);break e}throw Error(o(163))}}function Um(c){var d=c.updateQueue;if(d!==null){c.updateQueue=null;var y=c.stateNode;y===null&&(y=c.stateNode=new $U),d.forEach(function(E){var T=eF.bind(null,c,E);y.has(E)||(y.add(E),E.then(T,T))})}}function GU(c,d){for(We=d;We!==null;){d=We;var y=d.deletions;if(y!==null)for(var E=0;E";case zm:return":has("+(Vx(c)||"")+")";case Bm:return'[role="'+c.value+'"]';case Hm:return'"'+c.value+'"';case Vm:return'[data-testname="'+c.value+'"]';default:throw Error(o(365))}}function XT(c,d){var y=[];c=[c,0];for(var E=0;ET&&(T=$),E&=~I}if(E=T,E=lr()-E,E=(120>E?120:480>E?480:1080>E?1080:1920>E?1920:3e3>E?3e3:4320>E?4320:1960*XU(E/1960))-E,10c?16:c,ua===null)var E=!1;else{if(c=ua,ua=null,Xm=0,Wt&6)throw Error(o(331));var T=Wt;for(Wt|=4,We=c.current;We!==null;){var I=We,$=I.child;if(We.flags&16){var J=I.deletions;if(J!==null){for(var me=0;melr()-Gx?Ml(c,0):Wx|=y),si(c,d)}function nC(c,d){d===0&&(c.mode&1?(d=cm,cm<<=1,!(cm&130023424)&&(cm=4194304)):d=1);var y=Gr();c=Zm(c,d),c!==null&&(lf(c,d,y),si(c,y))}function JU(c){var d=c.memoizedState,y=0;d!==null&&(y=d.retryLane),nC(c,y)}function eF(c,d){var y=0;switch(c.tag){case 13:var E=c.stateNode,T=c.memoizedState;T!==null&&(y=T.retryLane);break;case 19:E=c.stateNode;break;default:throw Error(o(314))}E!==null&&E.delete(d),nC(c,y)}var rC;rC=function(c,d,y){if(c!==null)if(c.memoizedProps!==d.pendingProps||Nn.current)Si=!0;else{if(!(c.lanes&y)&&!(d.flags&128))return Si=!1,VU(c,d,y);Si=!!(c.flags&131072)}else Si=!1,En&&d.flags&1048576&&$b(d,_m,d.index);switch(d.lanes=0,d.tag){case 2:var E=d.type;c!==null&&(c.alternate=null,d.alternate=null,d.flags|=2),c=d.pendingProps;var T=Vi(d,$t.current);Zc(d,y),T=Ex(null,d,E,c,T,y);var I=Mx();return d.flags|=1,typeof T=="object"&&T!==null&&typeof T.render=="function"&&T.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,ar(E)?(I=!0,vr(d)):I=!1,d.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,ux(d),T.updater=ym,d.stateNode=T,T._reactInternals=d,fx(d,E,c,y),d=Ix(null,d,E,!0,I,y)):(d.tag=0,En&&I&&hx(d),Wr(null,d,T,y),d=d.child),d;case 16:E=d.elementType;e:{switch(c!==null&&(c.alternate=null,d.alternate=null,d.flags|=2),c=d.pendingProps,T=E._init,E=T(E._payload),d.type=E,T=d.tag=nF(E),c=hs(E,c),T){case 0:d=Px(null,d,E,c,y);break e;case 1:d=CT(null,d,E,c,y);break e;case 11:d=wT(null,d,E,c,y);break e;case 14:d=ET(null,d,E,hs(E.type,c),y);break e}throw Error(o(306,E,""))}return d;case 0:return E=d.type,T=d.pendingProps,T=d.elementType===E?T:hs(E,T),Px(c,d,E,T,y);case 1:return E=d.type,T=d.pendingProps,T=d.elementType===E?T:hs(E,T),CT(c,d,E,T,y);case 3:e:{if(AT(d),c===null)throw Error(o(387));E=d.pendingProps,I=d.memoizedState,T=I.element,kb(c,d),vm(d,E,null,y);var $=d.memoizedState;if(E=$.element,xe&&I.isDehydrated)if(I={element:E,isDehydrated:!1,cache:$.cache,transitions:$.transitions},d.updateQueue.baseState=I,d.memoizedState=I,d.flags&256){T=Error(o(423)),d=RT(c,d,E,y,T);break e}else if(E!==T){T=Error(o(424)),d=RT(c,d,E,y,T);break e}else for(xe&&(_i=sm(d.stateNode.containerInfo),xi=d,En=!0,ps=null,cf=!1),y=Yb(d,null,E,y),d.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if(Jc(),E===T){d=wo(c,d,y);break e}Wr(c,d,E,y)}d=d.child}return d;case 5:return Zb(d),c===null&&gx(d),E=d.type,T=d.pendingProps,I=c!==null?c.memoizedProps:null,$=T.children,le(E,T)?$=null:I!==null&&le(E,I)&&(d.flags|=32),TT(c,d),Wr(c,d,$,y),d.child;case 6:return c===null&&gx(d),null;case 13:return PT(c,d,y);case 4:return yx(d,d.stateNode.containerInfo),E=d.pendingProps,c===null?d.child=eu(d,null,E,y):Wr(c,d,E,y),d.child;case 11:return E=d.type,T=d.pendingProps,T=d.elementType===E?T:hs(E,T),wT(c,d,E,T,y);case 7:return Wr(c,d,d.pendingProps,y),d.child;case 8:return Wr(c,d,d.pendingProps.children,y),d.child;case 12:return Wr(c,d,d.pendingProps.children,y),d.child;case 10:e:{if(E=d.type._context,T=d.pendingProps,I=d.memoizedProps,$=T.value,Ob(d,E,$),I!==null)if(Bs(I.value,$)){if(I.children===T.children&&!Nn.current){d=wo(c,d,y);break e}}else for(I=d.child,I!==null&&(I.return=d);I!==null;){var J=I.dependencies;if(J!==null){$=I.child;for(var me=J.firstContext;me!==null;){if(me.context===E){if(I.tag===1){me=yo(-1,y&-y),me.tag=2;var Ne=I.updateQueue;if(Ne!==null){Ne=Ne.shared;var tt=Ne.pending;tt===null?me.next=me:(me.next=tt.next,tt.next=me),Ne.pending=me}}I.lanes|=y,me=I.alternate,me!==null&&(me.lanes|=y),cx(I.return,y,d),J.lanes|=y;break}me=me.next}}else if(I.tag===10)$=I.type===d.type?null:I.child;else if(I.tag===18){if($=I.return,$===null)throw Error(o(341));$.lanes|=y,J=$.alternate,J!==null&&(J.lanes|=y),cx($,y,d),$=I.sibling}else $=I.child;if($!==null)$.return=I;else for($=I;$!==null;){if($===d){$=null;break}if(I=$.sibling,I!==null){I.return=$.return,$=I;break}$=$.return}I=$}Wr(c,d,T.children,y),d=d.child}return d;case 9:return T=d.type,E=d.pendingProps.children,Zc(d,y),T=Hi(T),E=E(T),d.flags|=1,Wr(c,d,E,y),d.child;case 14:return E=d.type,T=hs(E,d.pendingProps),T=hs(E.type,T),ET(c,d,E,T,y);case 15:return MT(c,d,d.type,d.pendingProps,y);case 17:return E=d.type,T=d.pendingProps,T=d.elementType===E?T:hs(E,T),c!==null&&(c.alternate=null,d.alternate=null,d.flags|=2),d.tag=1,ar(E)?(c=!0,vr(d)):c=!1,Zc(d,y),Vb(d,E,T),fx(d,E,T,y),Ix(null,d,E,!0,c,y);case 19:return NT(c,d,y);case 22:return bT(c,d,y)}throw Error(o(156,d.tag))};function iC(c,d){return nx(c,d)}function tF(c,d,y,E){this.tag=c,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=E,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qi(c,d,y,E){return new tF(c,d,y,E)}function Jx(c){return c=c.prototype,!(!c||!c.isReactComponent)}function nF(c){if(typeof c=="function")return Jx(c)?1:0;if(c!=null){if(c=c.$$typeof,c===w)return 11;if(c===S)return 14}return 2}function ha(c,d){var y=c.alternate;return y===null?(y=qi(c.tag,d,c.key,c.mode),y.elementType=c.elementType,y.type=c.type,y.stateNode=c.stateNode,y.alternate=c,c.alternate=y):(y.pendingProps=d,y.type=c.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=c.flags&14680064,y.childLanes=c.childLanes,y.lanes=c.lanes,y.child=c.child,y.memoizedProps=c.memoizedProps,y.memoizedState=c.memoizedState,y.updateQueue=c.updateQueue,d=c.dependencies,y.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},y.sibling=c.sibling,y.index=c.index,y.ref=c.ref,y}function Qm(c,d,y,E,T,I){var $=2;if(E=c,typeof c=="function")Jx(c)&&($=1);else if(typeof c=="string")$=5;else e:switch(c){case f:return Cl(y.children,T,I,d);case h:$=8,T|=8;break;case p:return c=qi(12,y,d,T|2),c.elementType=p,c.lanes=I,c;case x:return c=qi(13,y,d,T),c.elementType=x,c.lanes=I,c;case g:return c=qi(19,y,d,T),c.elementType=g,c.lanes=I,c;case b:return Jm(y,T,I,d);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case m:$=10;break e;case v:$=9;break e;case w:$=11;break e;case S:$=14;break e;case _:$=16,E=null;break e}throw Error(o(130,c==null?c:typeof c,""))}return d=qi($,y,d,T),d.elementType=c,d.type=E,d.lanes=I,d}function Cl(c,d,y,E){return c=qi(7,c,E,d),c.lanes=y,c}function Jm(c,d,y,E){return c=qi(22,c,E,d),c.elementType=b,c.lanes=y,c.stateNode={},c}function e_(c,d,y){return c=qi(6,c,null,d),c.lanes=y,c}function t_(c,d,y){return d=qi(4,c.children!==null?c.children:[],c.key,d),d.lanes=y,d.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},d}function rF(c,d,y,E,T){this.tag=d,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=De,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ex(0),this.expirationTimes=ex(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ex(0),this.identifierPrefix=E,this.onRecoverableError=T,xe&&(this.mutableSourceEagerHydrationData=null)}function sC(c,d,y,E,T,I,$,J,me){return c=new rF(c,d,y,J,me),d===1?(d=1,I===!0&&(d|=8)):d=0,I=qi(3,null,null,d),c.current=I,I.stateNode=c,I.memoizedState={element:E,isDehydrated:y,cache:null,transitions:null},ux(I),c}function oC(c){if(!c)return Bi;c=c._reactInternals;e:{if(V(c)!==c||c.tag!==1)throw Error(o(170));var d=c;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if(ar(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(o(171))}if(c.tag===1){var y=c.type;if(ar(y))return Xc(c,y,d)}return d}function aC(c){var d=c._reactInternals;if(d===void 0)throw typeof c.render=="function"?Error(o(188)):(c=Object.keys(c).join(","),Error(o(268,c)));return c=W(d),c===null?null:c.stateNode}function lC(c,d){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var y=c.retryLane;c.retryLane=y!==0&&y=Ne&&I>=It&&T<=tt&&$<=pt){c.splice(d,1);break}else if(E!==Ne||y.width!==me.width||pt$){if(!(I!==It||y.height!==me.height||ttT)){Ne>E&&(me.width+=Ne-E,me.x=E),ttI&&(me.height+=It-I,me.y=I),pt<$&&(me.height=$-It),c.splice(d,1);break}}}return c},t.findHostInstance=aC,t.findHostInstanceWithNoPortals=function(c){return c=L(c),c=c!==null?z(c):null,c===null?null:c.stateNode},t.findHostInstanceWithWarning=function(c){return aC(c)},t.flushControlled=function(c){var d=Wt;Wt|=1;var y=Hn.transition,E=en;try{Hn.transition=null,en=1,c()}finally{en=E,Hn.transition=y,Wt=d,Wt===0&&(ou(),Vs())}},t.flushPassiveEffects=Tl,t.flushSync=ZT,t.focusWithin=function(c,d){if(!O)throw Error(o(363));for(c=zx(c),d=XT(c,d),d=Array.from(d),c=0;cy&&(y=$)),$ ")+` No matching component was found for: - `)+c.join(" > ")}return null},t.getPublicRootInstance=function(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return Y(c.child.stateNode);default:return c.child.stateNode}},t.injectIntoDevTools=function(c){if(c={bundleType:c.bundleType,version:c.version,rendererPackageName:c.rendererPackageName,rendererConfig:c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:QU,findFiberByHostInstance:c.findFiberByHostInstance||JU,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")c=!1;else{var d=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(d.isDisabled||!d.supportsFiber)c=!0;else{try{cm=d.inject(c),Fs=d}catch{}c=!!d.checkDCE}}return c},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(c,d,y,E){if(!O)throw Error(o(363));c=Bx(c,d);var T=He(c,y,E).disconnect;return{disconnect:function(){T()}}},t.registerMutableSourceForHydration=function(c,d){var y=d._getVersion;y=y(d._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[d,y]:c.mutableSourceEagerHydrationData.push(d,y)},t.runWithPriority=function(c,d){var y=en;try{return en=c,d()}finally{en=y}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(c,d,y,E){var T=d.current,I=Gr(),$=ua(T);return y=oC(y),d.context===null?d.context=y:d.pendingContext=y,d=vo(I,$),d.payload={element:c},E=E===void 0?null:E,E!==null&&(d.callback=E),aa(T,d),c=Xi(T,$,I),c!==null&&pm(c,T,$),$},t};OL.exports=bG;var TG=OL.exports;const CG=Dp(TG),fM={},FL=n=>void Object.assign(fM,n);function AG(n,e){function t(f,{args:h=[],attach:p,...m},v){let w=`${f[0].toUpperCase()}${f.slice(1)}`,x;if(f==="primitive"){if(m.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const g=m.object;x=Du(g,{type:f,root:v,attach:p,primitive:!0})}else{const g=fM[w];if(!g)throw new Error(`R3F: ${w} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(h))throw new Error("R3F: The args prop must be an array!");x=Du(new g(...h),{type:f,root:v,attach:p,memoizedProps:{args:h}})}return x.__r3f.attach===void 0&&(x instanceof Ut?x.__r3f.attach="geometry":x instanceof br&&(x.__r3f.attach="material")),w!=="inject"&&X_(x,m),x}function r(f,h){let p=!1;if(h){var m,v;(m=h.__r3f)!=null&&m.attach?j_(f,h,h.__r3f.attach):h.isObject3D&&f.isObject3D&&(f.add(h),p=!0),p||(v=f.__r3f)==null||v.objects.push(h),h.__r3f||Du(h,{}),h.__r3f.parent=f,q1(h),Nu(h)}}function i(f,h,p){let m=!1;if(h){var v,w;if((v=h.__r3f)!=null&&v.attach)j_(f,h,h.__r3f.attach);else if(h.isObject3D&&f.isObject3D){h.parent=f,h.dispatchEvent({type:"added"});const x=f.children.filter(S=>S!==h),g=x.indexOf(p);f.children=[...x.slice(0,g),h,...x.slice(g)],m=!0}m||(w=f.__r3f)==null||w.objects.push(h),h.__r3f||Du(h,{}),h.__r3f.parent=f,q1(h),Nu(h)}}function s(f,h,p=!1){f&&[...f].forEach(m=>o(h,m,p))}function o(f,h,p){if(h){var m,v,w;if(h.__r3f&&(h.__r3f.parent=null),(m=f.__r3f)!=null&&m.objects&&(f.__r3f.objects=f.__r3f.objects.filter(b=>b!==h)),(v=h.__r3f)!=null&&v.attach)d2(f,h,h.__r3f.attach);else if(h.isObject3D&&f.isObject3D){var x;f.remove(h),(x=h.__r3f)!=null&&x.root&&kG(Pv(h),h)}const S=(w=h.__r3f)==null?void 0:w.primitive,_=!S&&(p===void 0?h.dispose!==null:p);if(!S){var g;s((g=h.__r3f)==null?void 0:g.objects,h,_),s(h.children,h,_)}if(delete h.__r3f,_&&h.dispose&&h.type!=="Scene"){const b=()=>{try{h.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?j1.unstable_scheduleCallback(j1.unstable_IdlePriority,b):b()}Nu(f)}}function a(f,h,p,m){var v;const w=(v=f.__r3f)==null?void 0:v.parent;if(!w)return;const x=t(h,p,f.__r3f.root);if(f.children){for(const g of f.children)g.__r3f&&r(x,g);f.children=f.children.filter(g=>!g.__r3f)}f.__r3f.objects.forEach(g=>r(x,g)),f.__r3f.objects=[],f.__r3f.autoRemovedBeforeAppend||o(w,f),x.parent&&(x.__r3f.autoRemovedBeforeAppend=!0),r(w,x),x.raycast&&x.__r3f.eventCount&&Pv(x).getState().internal.interaction.push(x),[m,m.alternate].forEach(g=>{g!==null&&(g.stateNode=x,g.ref&&(typeof g.ref=="function"?g.ref(x):g.ref.current=x))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:CG({createInstance:t,removeChild:o,appendChild:r,appendInitialChild:r,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(f,h)=>{if(!h)return;const p=f.getState().scene;p.__r3f&&(p.__r3f.root=f,r(p,h))},removeChildFromContainer:(f,h)=>{h&&o(f.getState().scene,h)},insertInContainerBefore:(f,h,p)=>{if(!h||!p)return;const m=f.getState().scene;m.__r3f&&i(m,h,p)},getRootHostContext:()=>null,getChildHostContext:f=>f,finalizeInitialChildren(f){var h;return!!((h=f==null?void 0:f.__r3f)!=null?h:{}).handlers},prepareUpdate(f,h,p,m){var v;if(((v=f==null?void 0:f.__r3f)!=null?v:{}).primitive&&m.object&&m.object!==f)return[!0];{const{args:x=[],children:g,...S}=m,{args:_=[],children:b,...A}=p;if(!Array.isArray(x))throw new Error("R3F: the args prop must be an array!");if(x.some((P,D)=>P!==_[D]))return[!0];const R=GL(f,S,A,!0);return R.changes.length?[!1,R]:null}},commitUpdate(f,[h,p],m,v,w,x){h?a(f,m,w,x):X_(f,p)},commitMount(f,h,p,m){var v;const w=(v=f.__r3f)!=null?v:{};f.raycast&&w.handlers&&w.eventCount&&Pv(f).getState().internal.interaction.push(f)},getPublicInstance:f=>f,prepareForCommit:()=>null,preparePortalMount:f=>Du(f.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(f){var h;const{attach:p,parent:m}=(h=f.__r3f)!=null?h:{};p&&m&&d2(m,f,p),f.isObject3D&&(f.visible=!1),Nu(f)},unhideInstance(f,h){var p;const{attach:m,parent:v}=(p=f.__r3f)!=null?p:{};m&&v&&j_(v,f,m),(f.isObject3D&&h.visible==null||h.visible)&&(f.visible=!0),Nu(f)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():Bu.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&En.fun(performance.now)?performance.now:En.fun(Date.now)?Date.now:()=>0,scheduleTimeout:En.fun(setTimeout)?setTimeout:void 0,cancelTimeout:En.fun(clearTimeout)?clearTimeout:void 0}),applyProps:X_}}var a2,l2;const G_=n=>"colorSpace"in n||"outputColorSpace"in n,zL=()=>{var n;return(n=fM.ColorManagement)!=null?n:null},BL=n=>n&&n.isOrthographicCamera,RG=n=>n&&n.hasOwnProperty("current"),Zd=typeof window<"u"&&((a2=window.document)!=null&&a2.createElement||((l2=window.navigator)==null?void 0:l2.product)==="ReactNative")?M.useLayoutEffect:M.useEffect;function VL(n){const e=M.useRef(n);return Zd(()=>void(e.current=n),[n]),e}function PG({set:n}){return Zd(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class HL extends M.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}HL.getDerivedStateFromError=()=>({error:!0});const $L="__default",c2=new Map,IG=n=>n&&!!n.memoized&&!!n.changes;function WL(n){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}const Uf=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()};function Pv(n){let e=n.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const En={obj:n=>n===Object(n)&&!En.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:r="reference",strict:i=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(En.str(n)||En.num(n))return n===e;const s=En.obj(n);if(s&&r==="reference")return n===e;const o=En.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;if(s&&t==="shallow"&&r==="shallow"){for(a in i?e:n)if(!En.equ(n[a],e[a],{strict:i,objects:"reference"}))return!1}else for(a in i?e:n)if(n[a]!==e[a])return!1;if(En.und(a)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function LG(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function Du(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function X1(n,e){let t=n;if(e.includes("-")){const r=e.split("-"),i=r.pop();return t=r.reduce((s,o)=>s[o],n),{target:t,key:i}}else return{target:t,key:e}}const u2=/-\d+$/;function j_(n,e,t){if(En.str(t)){if(u2.test(t)){const s=t.replace(u2,""),{target:o,key:a}=X1(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:r,key:i}=X1(n,t);e.__r3f.previousAttach=r[i],r[i]=e}else e.__r3f.previousAttach=t(n,e)}function d2(n,e,t){var r,i;if(En.str(t)){const{target:s,key:o}=X1(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(n,e);(i=e.__r3f)==null||delete i.previousAttach}function GL(n,{children:e,key:t,ref:r,...i},{children:s,key:o,ref:a,...l}={},u=!1){var f;const h=(f=n==null?void 0:n.__r3f)!=null?f:{},p=Object.entries(i),m=[];if(u){const w=Object.keys(l);for(let x=0;x{var g;if((g=n.__r3f)!=null&&g.primitive&&w==="object"||En.equ(x,l[w]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(w))return m.push([w,x,!0,[]]);let S=[];w.includes("-")&&(S=w.split("-")),m.push([w,x,!1,S]);for(const _ in i){const b=i[_];_.startsWith(`${w}-`)&&m.push([_,b,!1,_.split("-")])}});const v={...i};return h.memoizedProps&&h.memoizedProps.args&&(v.args=h.memoizedProps.args),h.memoizedProps&&h.memoizedProps.attach&&(v.attach=h.memoizedProps.attach),{memoized:v,changes:m}}const DG=typeof process<"u"&&!1;function X_(n,e){var t,r,i;const s=(t=n.__r3f)!=null?t:{},o=s.root,a=(r=o==null||o.getState==null?void 0:o.getState())!=null?r:{},{memoized:l,changes:u}=IG(e)?e:GL(n,e),f=s.eventCount;n.__r3f&&(n.__r3f.memoizedProps=l);for(let p=0;p_[b],n),!(S&&S.set))){const[_,...b]=x.reverse();g=b.reverse().reduce((A,R)=>A[R],n),m=_}if(v===$L+"remove")if(g.constructor){let _=c2.get(g.constructor);_||(_=new g.constructor,c2.set(g.constructor,_)),v=_[m]}else v=0;if(w)v?s.handlers[m]=v:delete s.handlers[m],s.eventCount=Object.keys(s.handlers).length;else if(S&&S.set&&(S.copy||S instanceof uc)){if(Array.isArray(v))S.fromArray?S.fromArray(v):S.set(...v);else if(S.copy&&v&&v.constructor&&(DG?S.constructor.name===v.constructor.name:S.constructor===v.constructor))S.copy(v);else if(v!==void 0){const _=S instanceof Be;!_&&S.setScalar?S.setScalar(v):S instanceof uc&&v instanceof uc?S.mask=v.mask:S.set(v),!zL()&&!a.linear&&_&&S.convertSRGBToLinear()}}else if(g[m]=v,g[m]instanceof In&&g[m].format===Fr&&g[m].type===oo){const _=g[m];G_(_)&&G_(a.gl)?_.colorSpace=a.gl.outputColorSpace:_.encoding=a.gl.outputEncoding}Nu(n)}if(s.parent&&n.raycast&&f!==s.eventCount){const p=Pv(n).getState().internal,m=p.interaction.indexOf(n);m>-1&&p.interaction.splice(m,1),s.eventCount&&p.interaction.push(n)}return!(u.length===1&&u[0][0]==="onUpdate")&&u.length&&(i=n.__r3f)!=null&&i.parent&&q1(n),n}function Nu(n){var e,t;const r=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();r&&r.internal.frames===0&&r.invalidate()}function q1(n){n.onUpdate==null||n.onUpdate(n)}function NG(n,e){n.manual||(BL(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function jg(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function OG(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return Bu.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Bu.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Bu.ContinuousEventPriority;default:return Bu.DefaultEventPriority}}function jL(n,e,t,r){const i=t.get(e);i&&(t.delete(e),t.size===0&&(n.delete(r),i.target.releasePointerCapture(r)))}function kG(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(r=>r!==e),t.initialHits=t.initialHits.filter(r=>r!==e),t.hovered.forEach((r,i)=>{(r.eventObject===e||r.object===e)&&t.hovered.delete(i)}),t.capturedMap.forEach((r,i)=>{jL(t.capturedMap,e,r,i)})}function UG(n){function e(l){const{internal:u}=n.getState(),f=l.offsetX-u.initialClick[0],h=l.offsetY-u.initialClick[1];return Math.round(Math.sqrt(f*f+h*h))}function t(l){return l.filter(u=>["Move","Over","Enter","Out","Leave"].some(f=>{var h;return(h=u.__r3f)==null?void 0:h.handlers["onPointer"+f]}))}function r(l,u){const f=n.getState(),h=new Set,p=[],m=u?u(f.internal.interaction):f.internal.interaction;for(let g=0;g{const _=Uf(g.object),b=Uf(S.object);return!_||!b?g.distance-S.distance:b.events.priority-_.events.priority||g.distance-S.distance}).filter(g=>{const S=jg(g);return h.has(S)?!1:(h.add(S),!0)});f.events.filter&&(w=f.events.filter(w,f));for(const g of w){let S=g.object;for(;S;){var x;(x=S.__r3f)!=null&&x.eventCount&&p.push({...g,eventObject:S}),S=S.parent}}if("pointerId"in l&&f.internal.capturedMap.has(l.pointerId))for(let g of f.internal.capturedMap.get(l.pointerId).values())h.has(jg(g.intersection))||p.push(g.intersection);return p}function i(l,u,f,h){const p=n.getState();if(l.length){const m={stopped:!1};for(const v of l){const w=Uf(v.object)||p,{raycaster:x,pointer:g,camera:S,internal:_}=w,b=new F(g.x,g.y,0).unproject(S),A=C=>{var L,W;return(L=(W=_.capturedMap.get(C))==null?void 0:W.has(v.eventObject))!=null?L:!1},R=C=>{const L={intersection:v,target:u.target};_.capturedMap.has(C)?_.capturedMap.get(C).set(v.eventObject,L):_.capturedMap.set(C,new Map([[v.eventObject,L]])),u.target.setPointerCapture(C)},P=C=>{const L=_.capturedMap.get(C);L&&jL(_.capturedMap,v.eventObject,L,C)};let D={};for(let C in u){let L=u[C];typeof L!="function"&&(D[C]=L)}let V={...v,...D,pointer:g,intersections:l,stopped:m.stopped,delta:f,unprojectedPoint:b,ray:x.ray,camera:S,stopPropagation(){const C="pointerId"in u&&_.capturedMap.get(u.pointerId);if((!C||C.has(v.eventObject))&&(V.stopped=m.stopped=!0,_.hovered.size&&Array.from(_.hovered.values()).find(L=>L.eventObject===v.eventObject))){const L=l.slice(0,l.indexOf(v));s([...L,v])}},target:{hasPointerCapture:A,setPointerCapture:R,releasePointerCapture:P},currentTarget:{hasPointerCapture:A,setPointerCapture:R,releasePointerCapture:P},nativeEvent:u};if(h(V),m.stopped===!0)break}}return l}function s(l){const{internal:u}=n.getState();for(const f of u.hovered.values())if(!l.length||!l.find(h=>h.object===f.object&&h.index===f.index&&h.instanceId===f.instanceId)){const p=f.eventObject.__r3f,m=p==null?void 0:p.handlers;if(u.hovered.delete(jg(f)),p!=null&&p.eventCount){const v={...f,intersections:l};m.onPointerOut==null||m.onPointerOut(v),m.onPointerLeave==null||m.onPointerLeave(v)}}}function o(l,u){for(let f=0;fs([]);case"onLostPointerCapture":return u=>{const{internal:f}=n.getState();"pointerId"in u&&f.capturedMap.has(u.pointerId)&&requestAnimationFrame(()=>{f.capturedMap.has(u.pointerId)&&(f.capturedMap.delete(u.pointerId),s([]))})}}return function(f){const{onPointerMissed:h,internal:p}=n.getState();p.lastEvent.current=f;const m=l==="onPointerMove",v=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",x=r(f,m?t:void 0),g=v?e(f):0;l==="onPointerDown"&&(p.initialClick=[f.offsetX,f.offsetY],p.initialHits=x.map(_=>_.eventObject)),v&&!x.length&&g<=2&&(o(f,p.interaction),h&&h(f)),m&&s(x);function S(_){const b=_.eventObject,A=b.__r3f,R=A==null?void 0:A.handlers;if(A!=null&&A.eventCount)if(m){if(R.onPointerOver||R.onPointerEnter||R.onPointerOut||R.onPointerLeave){const P=jg(_),D=p.hovered.get(P);D?D.stopped&&_.stopPropagation():(p.hovered.set(P,_),R.onPointerOver==null||R.onPointerOver(_),R.onPointerEnter==null||R.onPointerEnter(_))}R.onPointerMove==null||R.onPointerMove(_)}else{const P=R[l];P?(!v||p.initialHits.includes(b))&&(o(f,p.interaction.filter(D=>!p.initialHits.includes(D))),P(_)):v&&p.initialHits.includes(b)&&o(f,p.interaction.filter(D=>!p.initialHits.includes(D)))}}i(x,f,g,S)}}return{handlePointer:a}}const XL=n=>!!(n!=null&&n.render),qL=M.createContext(null),FG=(n,e)=>{const t=MG((a,l)=>{const u=new F,f=new F,h=new F;function p(g=l().camera,S=f,_=l().size){const{width:b,height:A,top:R,left:P}=_,D=b/A;S instanceof F?h.copy(S):h.set(...S);const V=g.getWorldPosition(u).distanceTo(h);if(BL(g))return{width:b/g.zoom,height:A/g.zoom,top:R,left:P,factor:1,distance:V,aspect:D};{const C=g.fov*Math.PI/180,L=2*Math.tan(C/2)*V,W=L*(b/A);return{width:W,height:L,top:R,left:P,factor:b/W,distance:V,aspect:D}}}let m;const v=g=>a(S=>({performance:{...S.performance,current:g}})),w=new ge;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(g=1)=>n(l(),g),advance:(g,S)=>e(g,S,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new jp,pointer:w,mouse:w,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const g=l();m&&clearTimeout(m),g.performance.current!==g.performance.min&&v(g.performance.min),m=setTimeout(()=>v(l().performance.max),g.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:g=>a(S=>({...S,events:{...S.events,...g}})),setSize:(g,S,_,b,A)=>{const R=l().camera,P={width:g,height:S,top:b||0,left:A||0,updateStyle:_};a(D=>({size:P,viewport:{...D.viewport,...p(R,f,P)}}))},setDpr:g=>a(S=>{const _=WL(g);return{viewport:{...S.viewport,dpr:_,initialDpr:S.viewport.initialDpr||_}}}),setFrameloop:(g="always")=>{const S=l().clock;S.stop(),S.elapsedTime=0,g!=="never"&&(S.start(),S.elapsedTime=0),a(()=>({frameloop:g}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:M.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(g,S,_)=>{const b=l().internal;return b.priority=b.priority+(S>0?1:0),b.subscribers.push({ref:g,priority:S,store:_}),b.subscribers=b.subscribers.sort((A,R)=>A.priority-R.priority),()=>{const A=l().internal;A!=null&&A.subscribers&&(A.priority=A.priority-(S>0?1:0),A.subscribers=A.subscribers.filter(R=>R.ref!==g))}}}}}),r=t.getState();let i=r.size,s=r.viewport.dpr,o=r.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:u,gl:f,set:h}=t.getState();if(l.width!==i.width||l.height!==i.height||u.dpr!==s){var p;i=l,s=u.dpr,NG(a,l),f.setPixelRatio(u.dpr);const m=(p=l.updateStyle)!=null?p:typeof HTMLCanvasElement<"u"&&f.domElement instanceof HTMLCanvasElement;f.setSize(l.width,l.height,m)}a!==o&&(o=a,h(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let Xg,zG=new Set,BG=new Set,VG=new Set;function q_(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function Ff(n,e){switch(n){case"before":return q_(zG,e);case"after":return q_(BG,e);case"tail":return q_(VG,e)}}let Y_,Z_;function K_(n,e,t){let r=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(r=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),Y_=e.internal.subscribers,Xg=0;Xg0)&&!((u=i.gl.xr)!=null&&u.isPresenting)&&(t+=K_(l,i))}if(Ff("after",l),t===0)return Ff("tail",l),e=!1,cancelAnimationFrame(r)}function o(l,u=1){var f;if(!l)return n.forEach(h=>o(h.store.getState()),u);(f=l.gl.xr)!=null&&f.isPresenting||!l.internal.active||l.frameloop==="never"||(l.internal.frames=Math.min(60,l.internal.frames+u),e||(e=!0,requestAnimationFrame(s)))}function a(l,u=!0,f,h){if(u&&Ff("before",l),f)K_(l,f,h);else for(const p of n.values())K_(l,p.store.getState());u&&Ff("after",l)}return{loop:s,invalidate:o,advance:a}}function fee(n){const e=M.useRef(null);return Zd(()=>void(e.current=n.current.__r3f),[n]),e}function YL(){const n=M.useContext(qL);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function Ti(n=t=>t,e){return YL()(n,e)}function Fc(n,e=0){const t=YL(),r=t.getState().internal.subscribe,i=VL(n);return Zd(()=>r(i,e,t),[e,r,t]),null}const Pd=new Map,{invalidate:f2,advance:h2}=HG(Pd),{reconciler:u0,applyProps:Tu}=AG(Pd,OG),Cu={objects:"shallow",strict:!1},$G=(n,e)=>{const t=typeof n=="function"?n(e):n;return XL(t)?t:new RE({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function WG(n,e){const t=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(e){const{width:r,height:i,top:s,left:o,updateStyle:a=t}=e;return{width:r,height:i,top:s,left:o,updateStyle:a}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:r,height:i,top:s,left:o}=n.parentElement.getBoundingClientRect();return{width:r,height:i,top:s,left:o,updateStyle:t}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0,updateStyle:t};return{width:0,height:0,top:0,left:0}}function GG(n){const e=Pd.get(n),t=e==null?void 0:e.fiber,r=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const i=typeof reportError=="function"?reportError:console.error,s=r||FG(f2,h2),o=t||u0.createContainer(s,Bu.ConcurrentRoot,null,!1,null,"",i,null);e||Pd.set(n,{fiber:o,store:s});let a,l=!1,u;return{configure(f={}){let{gl:h,size:p,scene:m,events:v,onCreated:w,shadows:x=!1,linear:g=!1,flat:S=!1,legacy:_=!1,orthographic:b=!1,frameloop:A="always",dpr:R=[1,2],performance:P,raycaster:D,camera:V,onPointerMissed:C}=f,L=s.getState(),W=L.gl;L.gl||L.set({gl:W=$G(h,n)});let Q=L.raycaster;Q||L.set({raycaster:Q=new GI});const{params:z,...j}=D||{};if(En.equ(j,Q,Cu)||Tu(Q,{...j}),En.equ(z,Q.params,Cu)||Tu(Q,{params:{...Q.params,...z}}),!L.camera||L.camera===u&&!En.equ(u,V,Cu)){u=V;const se=V instanceof $d,ve=se?V:b?new Oo(0,0,0,0,.1,1e3):new Rn(75,0,.1,1e3);se||(ve.position.z=5,V&&Tu(ve,V),!L.camera&&!(V!=null&&V.rotation)&&ve.lookAt(0,0,0)),L.set({camera:ve}),Q.camera=ve}if(!L.scene){let se;m instanceof Ih?se=m:(se=new Ih,m&&Tu(se,m)),L.set({scene:Du(se)})}if(!L.xr){var Y;const se=(le,Me)=>{const pe=s.getState();pe.frameloop!=="never"&&h2(le,!0,pe,Me)},ve=()=>{const le=s.getState();le.gl.xr.enabled=le.gl.xr.isPresenting,le.gl.xr.setAnimationLoop(le.gl.xr.isPresenting?se:null),le.gl.xr.isPresenting||f2(le)},te={connect(){const le=s.getState().gl;le.xr.addEventListener("sessionstart",ve),le.xr.addEventListener("sessionend",ve)},disconnect(){const le=s.getState().gl;le.xr.removeEventListener("sessionstart",ve),le.xr.removeEventListener("sessionend",ve)}};typeof((Y=W.xr)==null?void 0:Y.addEventListener)=="function"&&te.connect(),L.set({xr:te})}if(W.shadowMap){const se=W.shadowMap.enabled,ve=W.shadowMap.type;if(W.shadowMap.enabled=!!x,En.boo(x))W.shadowMap.type=th;else if(En.str(x)){var re;const te={basic:kP,percentage:X0,soft:th,variance:_s};W.shadowMap.type=(re=te[x])!=null?re:th}else En.obj(x)&&Object.assign(W.shadowMap,x);(se!==W.shadowMap.enabled||ve!==W.shadowMap.type)&&(W.shadowMap.needsUpdate=!0)}const U=zL();U&&("enabled"in U?U.enabled=!_:"legacyMode"in U&&(U.legacyMode=_)),Tu(W,{outputEncoding:g?3e3:3001,toneMapping:S?so:uE}),L.legacy!==_&&L.set(()=>({legacy:_})),L.linear!==g&&L.set(()=>({linear:g})),L.flat!==S&&L.set(()=>({flat:S})),h&&!En.fun(h)&&!XL(h)&&!En.equ(h,W,Cu)&&Tu(W,h),v&&!L.events.handlers&&L.set({events:v(s)});const K=WG(n,p);return En.equ(K,L.size,Cu)||L.setSize(K.width,K.height,K.updateStyle,K.top,K.left),R&&L.viewport.dpr!==WL(R)&&L.setDpr(R),L.frameloop!==A&&L.setFrameloop(A),L.onPointerMissed||L.set({onPointerMissed:C}),P&&!En.equ(P,L.performance,Cu)&&L.set(se=>({performance:{...se.performance,...P}})),a=w,l=!0,this},render(f){return l||this.configure(),u0.updateContainer(M.createElement(jG,{store:s,children:f,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){ZL(n)}}}function jG({store:n,children:e,onCreated:t,rootElement:r}){return Zd(()=>{const i=n.getState();i.set(s=>({internal:{...s.internal,active:!0}})),t&&t(i),n.getState().events.connected||i.events.connect==null||i.events.connect(r)},[]),M.createElement(qL.Provider,{value:n},e)}function ZL(n,e){const t=Pd.get(n),r=t==null?void 0:t.fiber;if(r){const i=t==null?void 0:t.store.getState();i&&(i.internal.active=!1),u0.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{var s,o,a,l;i.events.disconnect==null||i.events.disconnect(),(s=i.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=i.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=i.gl)!=null&&l.xr&&i.xr.disconnect(),LG(i),Pd.delete(n),e&&e(n)}catch{}},500)})}}u0.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:M.version});function Ue(){return Ue=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0?r=setTimeout(l,e-f):(r=null,t||(a=n.apply(s,i),s=i=null))}var u=function(){s=this,i=arguments,o=Date.now();var f=t&&!r;return r||(r=setTimeout(l,e)),f&&(a=n.apply(s,i),s=i=null),a};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(a=n.apply(s,i),s=i=null,clearTimeout(r),r=null)},u}Y1.debounce=Y1;var XG=Y1;const p2=Dp(XG);function qG(n){let{debounce:e,scroll:t,polyfill:r,offsetSize:i}=n===void 0?{debounce:0,scroll:!1,offsetSize:!1}:n;const s=r||(typeof window>"u"?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,a]=M.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=M.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),u=e?typeof e=="number"?e:e.scroll:null,f=e?typeof e=="number"?e:e.resize:null,h=M.useRef(!1);M.useEffect(()=>(h.current=!0,()=>void(h.current=!1)));const[p,m,v]=M.useMemo(()=>{const S=()=>{if(!l.current.element)return;const{left:_,top:b,width:A,height:R,bottom:P,right:D,x:V,y:C}=l.current.element.getBoundingClientRect(),L={left:_,top:b,width:A,height:R,bottom:P,right:D,x:V,y:C};l.current.element instanceof HTMLElement&&i&&(L.height=l.current.element.offsetHeight,L.width=l.current.element.offsetWidth),Object.freeze(L),h.current&&!QG(l.current.lastBounds,L)&&a(l.current.lastBounds=L)};return[S,f?p2(S,f):S,u?p2(S,u):S]},[a,i,u,f]);function w(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(S=>S.removeEventListener("scroll",v,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function x(){l.current.element&&(l.current.resizeObserver=new s(v),l.current.resizeObserver.observe(l.current.element),t&&l.current.scrollContainers&&l.current.scrollContainers.forEach(S=>S.addEventListener("scroll",v,{capture:!0,passive:!0})))}const g=S=>{!S||S===l.current.element||(w(),l.current.element=S,l.current.scrollContainers=KL(S),x())};return ZG(v,!!t),YG(m),M.useEffect(()=>{w(),x()},[t,v,m]),M.useEffect(()=>w,[]),[g,o,p]}function YG(n){M.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function ZG(n,e){M.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function KL(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:r,overflowY:i}=window.getComputedStyle(n);return[t,r,i].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...KL(n.parentElement)]}const KG=["x","y","top","bottom","left","right","width","height"],QG=(n,e)=>KG.every(t=>n[t]===e[t]);var JG=Object.defineProperty,e9=Object.defineProperties,t9=Object.getOwnPropertyDescriptors,m2=Object.getOwnPropertySymbols,n9=Object.prototype.hasOwnProperty,r9=Object.prototype.propertyIsEnumerable,g2=(n,e,t)=>e in n?JG(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,v2=(n,e)=>{for(var t in e||(e={}))n9.call(e,t)&&g2(n,t,e[t]);if(m2)for(var t of m2(e))r9.call(e,t)&&g2(n,t,e[t]);return n},i9=(n,e)=>e9(n,t9(e));function QL(n,e,t){if(!n)return;if(t(n)===!0)return n;let r=e?n.return:n.child;for(;r;){const i=QL(r,e,t);if(i)return i;r=e?null:r.sibling}}function JL(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const hM=JL(M.createContext(null));class eD extends M.Component{render(){return M.createElement(hM.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:y2,ReactCurrentDispatcher:x2}=M.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function s9(){const n=M.useContext(hM);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=M.useId();return M.useMemo(()=>{for(const r of[y2==null?void 0:y2.current,n,n==null?void 0:n.alternate]){if(!r)continue;const i=QL(r,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(i)return i}},[n,e])}function o9(){var n,e;const t=s9(),[r]=M.useState(()=>new Map);r.clear();let i=t;for(;i;){const s=(n=i.type)==null?void 0:n._context;s&&s!==hM&&!r.has(s)&&r.set(s,(e=x2==null?void 0:x2.current)==null?void 0:e.readContext(JL(s))),i=i.return}return r}function a9(){const n=o9();return M.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>r=>M.createElement(e,null,M.createElement(t.Provider,i9(v2({},r),{value:n.get(t)}))),e=>M.createElement(eD,v2({},e))),[n])}const Q_={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function l9(n){const{handlePointer:e}=UG(n);return{priority:1,enabled:!0,compute(t,r,i){r.pointer.set(t.offsetX/r.size.width*2-1,-(t.offsetY/r.size.height)*2+1),r.raycaster.setFromCamera(r.pointer,r.camera)},connected:void 0,handlers:Object.keys(Q_).reduce((t,r)=>({...t,[r]:e(r)}),{}),update:()=>{var t;const{events:r,internal:i}=n.getState();(t=i.lastEvent)!=null&&t.current&&r.handlers&&r.handlers.onPointerMove(i.lastEvent.current)},connect:t=>{var r;const{set:i,events:s}=n.getState();s.disconnect==null||s.disconnect(),i(o=>({events:{...o.events,connected:t}})),Object.entries((r=s.handlers)!=null?r:[]).forEach(([o,a])=>{const[l,u]=Q_[o];t.addEventListener(l,a,{passive:u})})},disconnect:()=>{const{set:t,events:r}=n.getState();if(r.connected){var i;Object.entries((i=r.handlers)!=null?i:[]).forEach(([s,o])=>{if(r&&r.connected instanceof HTMLElement){const[a]=Q_[s];r.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}const c9=M.forwardRef(function({children:e,fallback:t,resize:r,style:i,gl:s,events:o=l9,eventSource:a,eventPrefix:l,shadows:u,linear:f,flat:h,legacy:p,orthographic:m,frameloop:v,dpr:w,performance:x,raycaster:g,camera:S,scene:_,onPointerMissed:b,onCreated:A,...R},P){M.useMemo(()=>FL(jH),[]);const D=a9(),[V,C]=qG({scroll:!0,debounce:{scroll:50,resize:0},...r}),L=M.useRef(null),W=M.useRef(null);M.useImperativeHandle(P,()=>L.current);const Q=VL(b),[z,j]=M.useState(!1),[Y,re]=M.useState(!1);if(z)throw z;if(Y)throw Y;const U=M.useRef(null);Zd(()=>{const q=L.current;C.width>0&&C.height>0&&q&&(U.current||(U.current=GG(q)),U.current.configure({gl:s,events:o,shadows:u,linear:f,flat:h,legacy:p,orthographic:m,frameloop:v,dpr:w,performance:x,raycaster:g,camera:S,scene:_,size:C,onPointerMissed:(...K)=>Q.current==null?void 0:Q.current(...K),onCreated:K=>{K.events.connect==null||K.events.connect(a?RG(a)?a.current:a:W.current),l&&K.setEvents({compute:(se,ve)=>{const te=se[l+"X"],le=se[l+"Y"];ve.pointer.set(te/ve.size.width*2-1,-(le/ve.size.height)*2+1),ve.raycaster.setFromCamera(ve.pointer,ve.camera)}}),A==null||A(K)}}),U.current.render(M.createElement(D,null,M.createElement(HL,{set:re},M.createElement(M.Suspense,{fallback:M.createElement(PG,{set:j})},e)))))}),M.useEffect(()=>{const q=L.current;if(q)return()=>ZL(q)},[]);const X=a?"none":"auto";return M.createElement("div",Ue({ref:W,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:X,...i}},R),M.createElement("div",{ref:V,style:{width:"100%",height:"100%"}},M.createElement("canvas",{ref:L,style:{display:"block"}},t)))}),tD=M.forwardRef(function(e,t){return M.createElement(eD,null,M.createElement(c9,Ue({},e,{ref:t})))}),u9=` + `)+c.join(" > ")}return null},t.getPublicRootInstance=function(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return Y(c.child.stateNode);default:return c.child.stateNode}},t.injectIntoDevTools=function(c){if(c={bundleType:c.bundleType,version:c.version,rendererPackageName:c.rendererPackageName,rendererConfig:c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:iF,findFiberByHostInstance:c.findFiberByHostInstance||sF,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")c=!1;else{var d=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(d.isDisabled||!d.supportsFiber)c=!0;else{try{dm=d.inject(c),zs=d}catch{}c=!!d.checkDCE}}return c},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(c,d,y,E){if(!O)throw Error(o(363));c=Hx(c,d);var T=He(c,y,E).disconnect;return{disconnect:function(){T()}}},t.registerMutableSourceForHydration=function(c,d){var y=d._getVersion;y=y(d._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[d,y]:c.mutableSourceEagerHydrationData.push(d,y)},t.runWithPriority=function(c,d){var y=en;try{return en=c,d()}finally{en=y}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(c,d,y,E){var T=d.current,I=Gr(),$=da(T);return y=oC(y),d.context===null?d.context=y:d.pendingContext=y,d=yo(I,$),d.payload={element:c},E=E===void 0?null:E,E!==null&&(d.callback=E),la(T,d),c=Xi(T,$,I),c!==null&&gm(c,T,$),$},t};UL.exports=IG;var LG=UL.exports;const DG=Op(LG),NG=n=>typeof n=="object"&&typeof n.then=="function",Kl=[];function BL(n,e,t=(r,i)=>r===i){if(n===e)return!0;if(!n||!e)return!1;const r=n.length;if(e.length!==r)return!1;for(let i=0;i0&&(s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(s.remove,r.lifespan)),s.response;if(!t)throw s.promise}const i={keys:e,equal:r.equal,remove:()=>{const s=Kl.indexOf(i);s!==-1&&Kl.splice(s,1)},promise:(NG(n)?n:n(...e)).then(s=>{i.response=s,r.lifespan&&r.lifespan>0&&(i.timeout=setTimeout(i.remove,r.lifespan))}).catch(s=>i.error=s)};if(Kl.push(i),!t)throw i.promise}const OG=(n,e,t)=>VL(n,e,!1,t),kG=(n,e,t)=>void VL(n,e,!0,t),UG=n=>{if(n===void 0||n.length===0)Kl.splice(0,Kl.length);else{const e=Kl.find(t=>BL(n,t.keys,t.equal));e&&e.remove()}},pM={},HL=n=>void Object.assign(pM,n);function FG(n,e){function t(f,{args:h=[],attach:p,...m},v){let w=`${f[0].toUpperCase()}${f.slice(1)}`,x;if(f==="primitive"){if(m.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const g=m.object;x=Ou(g,{type:f,root:v,attach:p,primitive:!0})}else{const g=pM[w];if(!g)throw new Error(`R3F: ${w} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(h))throw new Error("R3F: The args prop must be an array!");x=Ou(new g(...h),{type:f,root:v,attach:p,memoizedProps:{args:h}})}return x.__r3f.attach===void 0&&(x instanceof Ut?x.__r3f.attach="geometry":x instanceof br&&(x.__r3f.attach="material")),w!=="inject"&&Y_(x,m),x}function r(f,h){let p=!1;if(h){var m,v;(m=h.__r3f)!=null&&m.attach?q_(f,h,h.__r3f.attach):h.isObject3D&&f.isObject3D&&(f.add(h),p=!0),p||(v=f.__r3f)==null||v.objects.push(h),h.__r3f||Ou(h,{}),h.__r3f.parent=f,Z1(h),ku(h)}}function i(f,h,p){let m=!1;if(h){var v,w;if((v=h.__r3f)!=null&&v.attach)q_(f,h,h.__r3f.attach);else if(h.isObject3D&&f.isObject3D){h.parent=f,h.dispatchEvent({type:"added"});const x=f.children.filter(S=>S!==h),g=x.indexOf(p);f.children=[...x.slice(0,g),h,...x.slice(g)],m=!0}m||(w=f.__r3f)==null||w.objects.push(h),h.__r3f||Ou(h,{}),h.__r3f.parent=f,Z1(h),ku(h)}}function s(f,h,p=!1){f&&[...f].forEach(m=>o(h,m,p))}function o(f,h,p){if(h){var m,v,w;if(h.__r3f&&(h.__r3f.parent=null),(m=f.__r3f)!=null&&m.objects&&(f.__r3f.objects=f.__r3f.objects.filter(b=>b!==h)),(v=h.__r3f)!=null&&v.attach)d2(f,h,h.__r3f.attach);else if(h.isObject3D&&f.isObject3D){var x;f.remove(h),(x=h.__r3f)!=null&&x.root&&XG(Lv(h),h)}const S=(w=h.__r3f)==null?void 0:w.primitive,_=!S&&(p===void 0?h.dispose!==null:p);if(!S){var g;s((g=h.__r3f)==null?void 0:g.objects,h,_),s(h.children,h,_)}if(delete h.__r3f,_&&h.dispose&&h.type!=="Scene"){const b=()=>{try{h.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?q1.unstable_scheduleCallback(q1.unstable_IdlePriority,b):b()}ku(f)}}function a(f,h,p,m){var v;const w=(v=f.__r3f)==null?void 0:v.parent;if(!w)return;const x=t(h,p,f.__r3f.root);if(f.children){for(const g of f.children)g.__r3f&&r(x,g);f.children=f.children.filter(g=>!g.__r3f)}f.__r3f.objects.forEach(g=>r(x,g)),f.__r3f.objects=[],f.__r3f.autoRemovedBeforeAppend||o(w,f),x.parent&&(x.__r3f.autoRemovedBeforeAppend=!0),r(w,x),x.raycast&&x.__r3f.eventCount&&Lv(x).getState().internal.interaction.push(x),[m,m.alternate].forEach(g=>{g!==null&&(g.stateNode=x,g.ref&&(typeof g.ref=="function"?g.ref(x):g.ref.current=x))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:DG({createInstance:t,removeChild:o,appendChild:r,appendInitialChild:r,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(f,h)=>{if(!h)return;const p=f.getState().scene;p.__r3f&&(p.__r3f.root=f,r(p,h))},removeChildFromContainer:(f,h)=>{h&&o(f.getState().scene,h)},insertInContainerBefore:(f,h,p)=>{if(!h||!p)return;const m=f.getState().scene;m.__r3f&&i(m,h,p)},getRootHostContext:()=>null,getChildHostContext:f=>f,finalizeInitialChildren(f){var h;return!!((h=f==null?void 0:f.__r3f)!=null?h:{}).handlers},prepareUpdate(f,h,p,m){var v;if(((v=f==null?void 0:f.__r3f)!=null?v:{}).primitive&&m.object&&m.object!==f)return[!0];{const{args:x=[],children:g,...S}=m,{args:_=[],children:b,...A}=p;if(!Array.isArray(x))throw new Error("R3F: the args prop must be an array!");if(x.some((P,D)=>P!==_[D]))return[!0];const R=YL(f,S,A,!0);return R.changes.length?[!1,R]:null}},commitUpdate(f,[h,p],m,v,w,x){h?a(f,m,w,x):Y_(f,p)},commitMount(f,h,p,m){var v;const w=(v=f.__r3f)!=null?v:{};f.raycast&&w.handlers&&w.eventCount&&Lv(f).getState().internal.interaction.push(f)},getPublicInstance:f=>f,prepareForCommit:()=>null,preparePortalMount:f=>Ou(f.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(f){var h;const{attach:p,parent:m}=(h=f.__r3f)!=null?h:{};p&&m&&d2(m,f,p),f.isObject3D&&(f.visible=!1),ku(f)},unhideInstance(f,h){var p;const{attach:m,parent:v}=(p=f.__r3f)!=null?p:{};m&&v&&q_(v,f,m),(f.isObject3D&&h.visible==null||h.visible)&&(f.visible=!0),ku(f)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():Hu.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&Sn.fun(performance.now)?performance.now:Sn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:Sn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:Sn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:Y_}}var a2,l2;const X_=n=>"colorSpace"in n||"outputColorSpace"in n,$L=()=>{var n;return(n=pM.ColorManagement)!=null?n:null},WL=n=>n&&n.isOrthographicCamera,zG=n=>n&&n.hasOwnProperty("current"),Qd=typeof window<"u"&&((a2=window.document)!=null&&a2.createElement||((l2=window.navigator)==null?void 0:l2.product)==="ReactNative")?M.useLayoutEffect:M.useEffect;function GL(n){const e=M.useRef(n);return Qd(()=>void(e.current=n),[n]),e}function BG({set:n}){return Qd(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class jL extends M.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}jL.getDerivedStateFromError=()=>({error:!0});const XL="__default",c2=new Map,VG=n=>n&&!!n.memoized&&!!n.changes;function qL(n){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}const zf=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()};function Lv(n){let e=n.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const Sn={obj:n=>n===Object(n)&&!Sn.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:r="reference",strict:i=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(Sn.str(n)||Sn.num(n))return n===e;const s=Sn.obj(n);if(s&&r==="reference")return n===e;const o=Sn.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;if(s&&t==="shallow"&&r==="shallow"){for(a in i?e:n)if(!Sn.equ(n[a],e[a],{strict:i,objects:"reference"}))return!1}else for(a in i?e:n)if(n[a]!==e[a])return!1;if(Sn.und(a)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function HG(n){const e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function $G(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function Ou(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function Y1(n,e){let t=n;if(e.includes("-")){const r=e.split("-"),i=r.pop();return t=r.reduce((s,o)=>s[o],n),{target:t,key:i}}else return{target:t,key:e}}const u2=/-\d+$/;function q_(n,e,t){if(Sn.str(t)){if(u2.test(t)){const s=t.replace(u2,""),{target:o,key:a}=Y1(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:r,key:i}=Y1(n,t);e.__r3f.previousAttach=r[i],r[i]=e}else e.__r3f.previousAttach=t(n,e)}function d2(n,e,t){var r,i;if(Sn.str(t)){const{target:s,key:o}=Y1(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(n,e);(i=e.__r3f)==null||delete i.previousAttach}function YL(n,{children:e,key:t,ref:r,...i},{children:s,key:o,ref:a,...l}={},u=!1){var f;const h=(f=n==null?void 0:n.__r3f)!=null?f:{},p=Object.entries(i),m=[];if(u){const w=Object.keys(l);for(let x=0;x{var g;if((g=n.__r3f)!=null&&g.primitive&&w==="object"||Sn.equ(x,l[w]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(w))return m.push([w,x,!0,[]]);let S=[];w.includes("-")&&(S=w.split("-")),m.push([w,x,!1,S]);for(const _ in i){const b=i[_];_.startsWith(`${w}-`)&&m.push([_,b,!1,_.split("-")])}});const v={...i};return h.memoizedProps&&h.memoizedProps.args&&(v.args=h.memoizedProps.args),h.memoizedProps&&h.memoizedProps.attach&&(v.attach=h.memoizedProps.attach),{memoized:v,changes:m}}const WG=typeof process<"u"&&!1;function Y_(n,e){var t,r,i;const s=(t=n.__r3f)!=null?t:{},o=s.root,a=(r=o==null||o.getState==null?void 0:o.getState())!=null?r:{},{memoized:l,changes:u}=VG(e)?e:YL(n,e),f=s.eventCount;n.__r3f&&(n.__r3f.memoizedProps=l);for(let p=0;p_[b],n),!(S&&S.set))){const[_,...b]=x.reverse();g=b.reverse().reduce((A,R)=>A[R],n),m=_}if(v===XL+"remove")if(g.constructor){let _=c2.get(g.constructor);_||(_=new g.constructor,c2.set(g.constructor,_)),v=_[m]}else v=0;if(w)v?s.handlers[m]=v:delete s.handlers[m],s.eventCount=Object.keys(s.handlers).length;else if(S&&S.set&&(S.copy||S instanceof fc)){if(Array.isArray(v))S.fromArray?S.fromArray(v):S.set(...v);else if(S.copy&&v&&v.constructor&&(WG?S.constructor.name===v.constructor.name:S.constructor===v.constructor))S.copy(v);else if(v!==void 0){const _=S instanceof Be;!_&&S.setScalar?S.setScalar(v):S instanceof fc&&v instanceof fc?S.mask=v.mask:S.set(v),!$L()&&!a.linear&&_&&S.convertSRGBToLinear()}}else if(g[m]=v,g[m]instanceof In&&g[m].format===Fr&&g[m].type===ao){const _=g[m];X_(_)&&X_(a.gl)?_.colorSpace=a.gl.outputColorSpace:_.encoding=a.gl.outputEncoding}ku(n)}if(s.parent&&n.raycast&&f!==s.eventCount){const p=Lv(n).getState().internal,m=p.interaction.indexOf(n);m>-1&&p.interaction.splice(m,1),s.eventCount&&p.interaction.push(n)}return!(u.length===1&&u[0][0]==="onUpdate")&&u.length&&(i=n.__r3f)!=null&&i.parent&&Z1(n),n}function ku(n){var e,t;const r=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();r&&r.internal.frames===0&&r.invalidate()}function Z1(n){n.onUpdate==null||n.onUpdate(n)}function GG(n,e){n.manual||(WL(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function qg(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function jG(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return Hu.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Hu.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Hu.ContinuousEventPriority;default:return Hu.DefaultEventPriority}}function ZL(n,e,t,r){const i=t.get(e);i&&(t.delete(e),t.size===0&&(n.delete(r),i.target.releasePointerCapture(r)))}function XG(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(r=>r!==e),t.initialHits=t.initialHits.filter(r=>r!==e),t.hovered.forEach((r,i)=>{(r.eventObject===e||r.object===e)&&t.hovered.delete(i)}),t.capturedMap.forEach((r,i)=>{ZL(t.capturedMap,e,r,i)})}function qG(n){function e(l){const{internal:u}=n.getState(),f=l.offsetX-u.initialClick[0],h=l.offsetY-u.initialClick[1];return Math.round(Math.sqrt(f*f+h*h))}function t(l){return l.filter(u=>["Move","Over","Enter","Out","Leave"].some(f=>{var h;return(h=u.__r3f)==null?void 0:h.handlers["onPointer"+f]}))}function r(l,u){const f=n.getState(),h=new Set,p=[],m=u?u(f.internal.interaction):f.internal.interaction;for(let g=0;g{const _=zf(g.object),b=zf(S.object);return!_||!b?g.distance-S.distance:b.events.priority-_.events.priority||g.distance-S.distance}).filter(g=>{const S=qg(g);return h.has(S)?!1:(h.add(S),!0)});f.events.filter&&(w=f.events.filter(w,f));for(const g of w){let S=g.object;for(;S;){var x;(x=S.__r3f)!=null&&x.eventCount&&p.push({...g,eventObject:S}),S=S.parent}}if("pointerId"in l&&f.internal.capturedMap.has(l.pointerId))for(let g of f.internal.capturedMap.get(l.pointerId).values())h.has(qg(g.intersection))||p.push(g.intersection);return p}function i(l,u,f,h){const p=n.getState();if(l.length){const m={stopped:!1};for(const v of l){const w=zf(v.object)||p,{raycaster:x,pointer:g,camera:S,internal:_}=w,b=new F(g.x,g.y,0).unproject(S),A=C=>{var L,W;return(L=(W=_.capturedMap.get(C))==null?void 0:W.has(v.eventObject))!=null?L:!1},R=C=>{const L={intersection:v,target:u.target};_.capturedMap.has(C)?_.capturedMap.get(C).set(v.eventObject,L):_.capturedMap.set(C,new Map([[v.eventObject,L]])),u.target.setPointerCapture(C)},P=C=>{const L=_.capturedMap.get(C);L&&ZL(_.capturedMap,v.eventObject,L,C)};let D={};for(let C in u){let L=u[C];typeof L!="function"&&(D[C]=L)}let V={...v,...D,pointer:g,intersections:l,stopped:m.stopped,delta:f,unprojectedPoint:b,ray:x.ray,camera:S,stopPropagation(){const C="pointerId"in u&&_.capturedMap.get(u.pointerId);if((!C||C.has(v.eventObject))&&(V.stopped=m.stopped=!0,_.hovered.size&&Array.from(_.hovered.values()).find(L=>L.eventObject===v.eventObject))){const L=l.slice(0,l.indexOf(v));s([...L,v])}},target:{hasPointerCapture:A,setPointerCapture:R,releasePointerCapture:P},currentTarget:{hasPointerCapture:A,setPointerCapture:R,releasePointerCapture:P},nativeEvent:u};if(h(V),m.stopped===!0)break}}return l}function s(l){const{internal:u}=n.getState();for(const f of u.hovered.values())if(!l.length||!l.find(h=>h.object===f.object&&h.index===f.index&&h.instanceId===f.instanceId)){const p=f.eventObject.__r3f,m=p==null?void 0:p.handlers;if(u.hovered.delete(qg(f)),p!=null&&p.eventCount){const v={...f,intersections:l};m.onPointerOut==null||m.onPointerOut(v),m.onPointerLeave==null||m.onPointerLeave(v)}}}function o(l,u){for(let f=0;fs([]);case"onLostPointerCapture":return u=>{const{internal:f}=n.getState();"pointerId"in u&&f.capturedMap.has(u.pointerId)&&requestAnimationFrame(()=>{f.capturedMap.has(u.pointerId)&&(f.capturedMap.delete(u.pointerId),s([]))})}}return function(f){const{onPointerMissed:h,internal:p}=n.getState();p.lastEvent.current=f;const m=l==="onPointerMove",v=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",x=r(f,m?t:void 0),g=v?e(f):0;l==="onPointerDown"&&(p.initialClick=[f.offsetX,f.offsetY],p.initialHits=x.map(_=>_.eventObject)),v&&!x.length&&g<=2&&(o(f,p.interaction),h&&h(f)),m&&s(x);function S(_){const b=_.eventObject,A=b.__r3f,R=A==null?void 0:A.handlers;if(A!=null&&A.eventCount)if(m){if(R.onPointerOver||R.onPointerEnter||R.onPointerOut||R.onPointerLeave){const P=qg(_),D=p.hovered.get(P);D?D.stopped&&_.stopPropagation():(p.hovered.set(P,_),R.onPointerOver==null||R.onPointerOver(_),R.onPointerEnter==null||R.onPointerEnter(_))}R.onPointerMove==null||R.onPointerMove(_)}else{const P=R[l];P?(!v||p.initialHits.includes(b))&&(o(f,p.interaction.filter(D=>!p.initialHits.includes(D))),P(_)):v&&p.initialHits.includes(b)&&o(f,p.interaction.filter(D=>!p.initialHits.includes(D)))}}i(x,f,g,S)}}return{handlePointer:a}}const KL=n=>!!(n!=null&&n.render),QL=M.createContext(null),YG=(n,e)=>{const t=PG((a,l)=>{const u=new F,f=new F,h=new F;function p(g=l().camera,S=f,_=l().size){const{width:b,height:A,top:R,left:P}=_,D=b/A;S instanceof F?h.copy(S):h.set(...S);const V=g.getWorldPosition(u).distanceTo(h);if(WL(g))return{width:b/g.zoom,height:A/g.zoom,top:R,left:P,factor:1,distance:V,aspect:D};{const C=g.fov*Math.PI/180,L=2*Math.tan(C/2)*V,W=L*(b/A);return{width:W,height:L,top:R,left:P,factor:b/W,distance:V,aspect:D}}}let m;const v=g=>a(S=>({performance:{...S.performance,current:g}})),w=new ge;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(g=1)=>n(l(),g),advance:(g,S)=>e(g,S,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new qp,pointer:w,mouse:w,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const g=l();m&&clearTimeout(m),g.performance.current!==g.performance.min&&v(g.performance.min),m=setTimeout(()=>v(l().performance.max),g.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:g=>a(S=>({...S,events:{...S.events,...g}})),setSize:(g,S,_,b,A)=>{const R=l().camera,P={width:g,height:S,top:b||0,left:A||0,updateStyle:_};a(D=>({size:P,viewport:{...D.viewport,...p(R,f,P)}}))},setDpr:g=>a(S=>{const _=qL(g);return{viewport:{...S.viewport,dpr:_,initialDpr:S.viewport.initialDpr||_}}}),setFrameloop:(g="always")=>{const S=l().clock;S.stop(),S.elapsedTime=0,g!=="never"&&(S.start(),S.elapsedTime=0),a(()=>({frameloop:g}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:M.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(g,S,_)=>{const b=l().internal;return b.priority=b.priority+(S>0?1:0),b.subscribers.push({ref:g,priority:S,store:_}),b.subscribers=b.subscribers.sort((A,R)=>A.priority-R.priority),()=>{const A=l().internal;A!=null&&A.subscribers&&(A.priority=A.priority-(S>0?1:0),A.subscribers=A.subscribers.filter(R=>R.ref!==g))}}}}}),r=t.getState();let i=r.size,s=r.viewport.dpr,o=r.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:u,gl:f,set:h}=t.getState();if(l.width!==i.width||l.height!==i.height||u.dpr!==s){var p;i=l,s=u.dpr,GG(a,l),f.setPixelRatio(u.dpr);const m=(p=l.updateStyle)!=null?p:typeof HTMLCanvasElement<"u"&&f.domElement instanceof HTMLCanvasElement;f.setSize(l.width,l.height,m)}a!==o&&(o=a,h(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let Yg,ZG=new Set,KG=new Set,QG=new Set;function Z_(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function Bf(n,e){switch(n){case"before":return Z_(ZG,e);case"after":return Z_(KG,e);case"tail":return Z_(QG,e)}}let K_,Q_;function J_(n,e,t){let r=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(r=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),K_=e.internal.subscribers,Yg=0;Yg0)&&!((u=i.gl.xr)!=null&&u.isPresenting)&&(t+=J_(l,i))}if(Bf("after",l),t===0)return Bf("tail",l),e=!1,cancelAnimationFrame(r)}function o(l,u=1){var f;if(!l)return n.forEach(h=>o(h.store.getState()),u);(f=l.gl.xr)!=null&&f.isPresenting||!l.internal.active||l.frameloop==="never"||(l.internal.frames=Math.min(60,l.internal.frames+u),e||(e=!0,requestAnimationFrame(s)))}function a(l,u=!0,f,h){if(u&&Bf("before",l),f)J_(l,f,h);else for(const p of n.values())J_(l,p.store.getState());u&&Bf("after",l)}return{loop:s,invalidate:o,advance:a}}function Cee(n){const e=M.useRef(null);return Qd(()=>void(e.current=n.current.__r3f),[n]),e}function JL(){const n=M.useContext(QL);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function Ti(n=t=>t,e){return JL()(n,e)}function Bc(n,e=0){const t=JL(),r=t.getState().internal.subscribe,i=GL(n);return Qd(()=>r(i,e,t),[e,r,t]),null}const f2=new WeakMap;function eD(n,e){return function(t,...r){let i=f2.get(t);return i||(i=new t,f2.set(t,i)),n&&n(i),Promise.all(r.map(s=>new Promise((o,a)=>i.load(s,l=>{l.scene&&Object.assign(l,HG(l.scene)),o(l)},e,l=>a(new Error(`Could not load ${s}: ${l==null?void 0:l.message}`)))))).finally(()=>i.dispose==null?void 0:i.dispose())}}function tD(n,e,t,r){const i=Array.isArray(e)?e:[e],s=OG(eD(t,r),[n,...i],{equal:Sn.equ});return Array.isArray(e)?s:s[0]}tD.preload=function(n,e,t){const r=Array.isArray(e)?e:[e];return kG(eD(t),[n,...r])};tD.clear=function(n,e){const t=Array.isArray(e)?e:[e];return UG([n,...t])};const Ld=new Map,{invalidate:h2,advance:p2}=JG(Ld),{reconciler:f0,applyProps:Au}=FG(Ld,jG),Ru={objects:"shallow",strict:!1},e9=(n,e)=>{const t=typeof n=="function"?n(e):n;return KL(t)?t:new IE({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function t9(n,e){const t=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(e){const{width:r,height:i,top:s,left:o,updateStyle:a=t}=e;return{width:r,height:i,top:s,left:o,updateStyle:a}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:r,height:i,top:s,left:o}=n.parentElement.getBoundingClientRect();return{width:r,height:i,top:s,left:o,updateStyle:t}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0,updateStyle:t};return{width:0,height:0,top:0,left:0}}function n9(n){const e=Ld.get(n),t=e==null?void 0:e.fiber,r=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const i=typeof reportError=="function"?reportError:console.error,s=r||YG(h2,p2),o=t||f0.createContainer(s,Hu.ConcurrentRoot,null,!1,null,"",i,null);e||Ld.set(n,{fiber:o,store:s});let a,l=!1,u;return{configure(f={}){let{gl:h,size:p,scene:m,events:v,onCreated:w,shadows:x=!1,linear:g=!1,flat:S=!1,legacy:_=!1,orthographic:b=!1,frameloop:A="always",dpr:R=[1,2],performance:P,raycaster:D,camera:V,onPointerMissed:C}=f,L=s.getState(),W=L.gl;L.gl||L.set({gl:W=e9(h,n)});let Q=L.raycaster;Q||L.set({raycaster:Q=new jI});const{params:z,...j}=D||{};if(Sn.equ(j,Q,Ru)||Au(Q,{...j}),Sn.equ(z,Q.params,Ru)||Au(Q,{params:{...Q.params,...z}}),!L.camera||L.camera===u&&!Sn.equ(u,V,Ru)){u=V;const se=V instanceof Gd,ve=se?V:b?new ko(0,0,0,0,.1,1e3):new Rn(75,0,.1,1e3);se||(ve.position.z=5,V&&Au(ve,V),!L.camera&&!(V!=null&&V.rotation)&&ve.lookAt(0,0,0)),L.set({camera:ve}),Q.camera=ve}if(!L.scene){let se;m instanceof Dh?se=m:(se=new Dh,m&&Au(se,m)),L.set({scene:Ou(se)})}if(!L.xr){var Y;const se=(le,Me)=>{const pe=s.getState();pe.frameloop!=="never"&&p2(le,!0,pe,Me)},ve=()=>{const le=s.getState();le.gl.xr.enabled=le.gl.xr.isPresenting,le.gl.xr.setAnimationLoop(le.gl.xr.isPresenting?se:null),le.gl.xr.isPresenting||h2(le)},te={connect(){const le=s.getState().gl;le.xr.addEventListener("sessionstart",ve),le.xr.addEventListener("sessionend",ve)},disconnect(){const le=s.getState().gl;le.xr.removeEventListener("sessionstart",ve),le.xr.removeEventListener("sessionend",ve)}};typeof((Y=W.xr)==null?void 0:Y.addEventListener)=="function"&&te.connect(),L.set({xr:te})}if(W.shadowMap){const se=W.shadowMap.enabled,ve=W.shadowMap.type;if(W.shadowMap.enabled=!!x,Sn.boo(x))W.shadowMap.type=rh;else if(Sn.str(x)){var re;const te={basic:UP,percentage:Y0,soft:rh,variance:Ss};W.shadowMap.type=(re=te[x])!=null?re:rh}else Sn.obj(x)&&Object.assign(W.shadowMap,x);(se!==W.shadowMap.enabled||ve!==W.shadowMap.type)&&(W.shadowMap.needsUpdate=!0)}const U=$L();U&&("enabled"in U?U.enabled=!_:"legacyMode"in U&&(U.legacyMode=_)),Au(W,{outputEncoding:g?3e3:3001,toneMapping:S?oo:fE}),L.legacy!==_&&L.set(()=>({legacy:_})),L.linear!==g&&L.set(()=>({linear:g})),L.flat!==S&&L.set(()=>({flat:S})),h&&!Sn.fun(h)&&!KL(h)&&!Sn.equ(h,W,Ru)&&Au(W,h),v&&!L.events.handlers&&L.set({events:v(s)});const K=t9(n,p);return Sn.equ(K,L.size,Ru)||L.setSize(K.width,K.height,K.updateStyle,K.top,K.left),R&&L.viewport.dpr!==qL(R)&&L.setDpr(R),L.frameloop!==A&&L.setFrameloop(A),L.onPointerMissed||L.set({onPointerMissed:C}),P&&!Sn.equ(P,L.performance,Ru)&&L.set(se=>({performance:{...se.performance,...P}})),a=w,l=!0,this},render(f){return l||this.configure(),f0.updateContainer(M.createElement(r9,{store:s,children:f,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){nD(n)}}}function r9({store:n,children:e,onCreated:t,rootElement:r}){return Qd(()=>{const i=n.getState();i.set(s=>({internal:{...s.internal,active:!0}})),t&&t(i),n.getState().events.connected||i.events.connect==null||i.events.connect(r)},[]),M.createElement(QL.Provider,{value:n},e)}function nD(n,e){const t=Ld.get(n),r=t==null?void 0:t.fiber;if(r){const i=t==null?void 0:t.store.getState();i&&(i.internal.active=!1),f0.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{var s,o,a,l;i.events.disconnect==null||i.events.disconnect(),(s=i.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=i.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=i.gl)!=null&&l.xr&&i.xr.disconnect(),$G(i),Ld.delete(n),e&&e(n)}catch{}},500)})}}f0.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:M.version});function Ue(){return Ue=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0?r=setTimeout(l,e-f):(r=null,t||(a=n.apply(s,i),s=i=null))}var u=function(){s=this,i=arguments,o=Date.now();var f=t&&!r;return r||(r=setTimeout(l,e)),f&&(a=n.apply(s,i),s=i=null),a};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(a=n.apply(s,i),s=i=null,clearTimeout(r),r=null)},u}K1.debounce=K1;var i9=K1;const m2=Op(i9);function s9(n){let{debounce:e,scroll:t,polyfill:r,offsetSize:i}=n===void 0?{debounce:0,scroll:!1,offsetSize:!1}:n;const s=r||(typeof window>"u"?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,a]=M.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=M.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),u=e?typeof e=="number"?e:e.scroll:null,f=e?typeof e=="number"?e:e.resize:null,h=M.useRef(!1);M.useEffect(()=>(h.current=!0,()=>void(h.current=!1)));const[p,m,v]=M.useMemo(()=>{const S=()=>{if(!l.current.element)return;const{left:_,top:b,width:A,height:R,bottom:P,right:D,x:V,y:C}=l.current.element.getBoundingClientRect(),L={left:_,top:b,width:A,height:R,bottom:P,right:D,x:V,y:C};l.current.element instanceof HTMLElement&&i&&(L.height=l.current.element.offsetHeight,L.width=l.current.element.offsetWidth),Object.freeze(L),h.current&&!c9(l.current.lastBounds,L)&&a(l.current.lastBounds=L)};return[S,f?m2(S,f):S,u?m2(S,u):S]},[a,i,u,f]);function w(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(S=>S.removeEventListener("scroll",v,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function x(){l.current.element&&(l.current.resizeObserver=new s(v),l.current.resizeObserver.observe(l.current.element),t&&l.current.scrollContainers&&l.current.scrollContainers.forEach(S=>S.addEventListener("scroll",v,{capture:!0,passive:!0})))}const g=S=>{!S||S===l.current.element||(w(),l.current.element=S,l.current.scrollContainers=rD(S),x())};return a9(v,!!t),o9(m),M.useEffect(()=>{w(),x()},[t,v,m]),M.useEffect(()=>w,[]),[g,o,p]}function o9(n){M.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function a9(n,e){M.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function rD(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:r,overflowY:i}=window.getComputedStyle(n);return[t,r,i].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...rD(n.parentElement)]}const l9=["x","y","top","bottom","left","right","width","height"],c9=(n,e)=>l9.every(t=>n[t]===e[t]);var u9=Object.defineProperty,d9=Object.defineProperties,f9=Object.getOwnPropertyDescriptors,g2=Object.getOwnPropertySymbols,h9=Object.prototype.hasOwnProperty,p9=Object.prototype.propertyIsEnumerable,v2=(n,e,t)=>e in n?u9(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,y2=(n,e)=>{for(var t in e||(e={}))h9.call(e,t)&&v2(n,t,e[t]);if(g2)for(var t of g2(e))p9.call(e,t)&&v2(n,t,e[t]);return n},m9=(n,e)=>d9(n,f9(e));function iD(n,e,t){if(!n)return;if(t(n)===!0)return n;let r=e?n.return:n.child;for(;r;){const i=iD(r,e,t);if(i)return i;r=e?null:r.sibling}}function sD(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const mM=sD(M.createContext(null));class oD extends M.Component{render(){return M.createElement(mM.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:x2,ReactCurrentDispatcher:_2}=M.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g9(){const n=M.useContext(mM);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=M.useId();return M.useMemo(()=>{for(const r of[x2==null?void 0:x2.current,n,n==null?void 0:n.alternate]){if(!r)continue;const i=iD(r,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(i)return i}},[n,e])}function v9(){var n,e;const t=g9(),[r]=M.useState(()=>new Map);r.clear();let i=t;for(;i;){const s=(n=i.type)==null?void 0:n._context;s&&s!==mM&&!r.has(s)&&r.set(s,(e=_2==null?void 0:_2.current)==null?void 0:e.readContext(sD(s))),i=i.return}return r}function y9(){const n=v9();return M.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>r=>M.createElement(e,null,M.createElement(t.Provider,m9(y2({},r),{value:n.get(t)}))),e=>M.createElement(oD,y2({},e))),[n])}const eS={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function x9(n){const{handlePointer:e}=qG(n);return{priority:1,enabled:!0,compute(t,r,i){r.pointer.set(t.offsetX/r.size.width*2-1,-(t.offsetY/r.size.height)*2+1),r.raycaster.setFromCamera(r.pointer,r.camera)},connected:void 0,handlers:Object.keys(eS).reduce((t,r)=>({...t,[r]:e(r)}),{}),update:()=>{var t;const{events:r,internal:i}=n.getState();(t=i.lastEvent)!=null&&t.current&&r.handlers&&r.handlers.onPointerMove(i.lastEvent.current)},connect:t=>{var r;const{set:i,events:s}=n.getState();s.disconnect==null||s.disconnect(),i(o=>({events:{...o.events,connected:t}})),Object.entries((r=s.handlers)!=null?r:[]).forEach(([o,a])=>{const[l,u]=eS[o];t.addEventListener(l,a,{passive:u})})},disconnect:()=>{const{set:t,events:r}=n.getState();if(r.connected){var i;Object.entries((i=r.handlers)!=null?i:[]).forEach(([s,o])=>{if(r&&r.connected instanceof HTMLElement){const[a]=eS[s];r.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}const _9=M.forwardRef(function({children:e,fallback:t,resize:r,style:i,gl:s,events:o=x9,eventSource:a,eventPrefix:l,shadows:u,linear:f,flat:h,legacy:p,orthographic:m,frameloop:v,dpr:w,performance:x,raycaster:g,camera:S,scene:_,onPointerMissed:b,onCreated:A,...R},P){M.useMemo(()=>HL(QH),[]);const D=y9(),[V,C]=s9({scroll:!0,debounce:{scroll:50,resize:0},...r}),L=M.useRef(null),W=M.useRef(null);M.useImperativeHandle(P,()=>L.current);const Q=GL(b),[z,j]=M.useState(!1),[Y,re]=M.useState(!1);if(z)throw z;if(Y)throw Y;const U=M.useRef(null);Qd(()=>{const q=L.current;C.width>0&&C.height>0&&q&&(U.current||(U.current=n9(q)),U.current.configure({gl:s,events:o,shadows:u,linear:f,flat:h,legacy:p,orthographic:m,frameloop:v,dpr:w,performance:x,raycaster:g,camera:S,scene:_,size:C,onPointerMissed:(...K)=>Q.current==null?void 0:Q.current(...K),onCreated:K=>{K.events.connect==null||K.events.connect(a?zG(a)?a.current:a:W.current),l&&K.setEvents({compute:(se,ve)=>{const te=se[l+"X"],le=se[l+"Y"];ve.pointer.set(te/ve.size.width*2-1,-(le/ve.size.height)*2+1),ve.raycaster.setFromCamera(ve.pointer,ve.camera)}}),A==null||A(K)}}),U.current.render(M.createElement(D,null,M.createElement(jL,{set:re},M.createElement(M.Suspense,{fallback:M.createElement(BG,{set:j})},e)))))}),M.useEffect(()=>{const q=L.current;if(q)return()=>nD(q)},[]);const X=a?"none":"auto";return M.createElement("div",Ue({ref:W,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:X,...i}},R),M.createElement("div",{ref:V,style:{width:"100%",height:"100%"}},M.createElement("canvas",{ref:L,style:{display:"block"}},t)))}),aD=M.forwardRef(function(e,t){return M.createElement(oD,null,M.createElement(_9,Ue({},e,{ref:t})))}),S9=` precision mediump float; uniform vec3 color; void main() { gl_FragColor = vec4(color, 1.0); } -`,d9=` +`,w9=` precision mediump float; uniform float max_amplitude; @@ -4071,7 +4076,7 @@ void main() { // vec2 diff = next_pos - prev_pos; // // angle = ... } -`;class f9{constructor(e,t){at(this,"samplesX");at(this,"samplesY");at(this,"maxAmplitude",4);at(this,"M",4);if(e.length!=t.length)throw new Error("sample size mismatch");this.samplesX=e,this.samplesY=t}updateTextureData(e){let r,i,s;for(let o=0;o>8,e[r+1]=i&255,e[r+2]=s>>8,e[r+3]=s&255}generateSupportedTextureAndData(){const e=new Uint8Array(this.samplesX.length*this.M);return{tex:new Wa(e,this.samplesX.length,1,Fr),textureData:e}}}const h9=({textureMapper:n,nParticles:e=512,usePoints:t=!0,interpolate:r=!1,color:i=new Be("green")})=>{const{tex:s,textureData:o}=n.generateSupportedTextureAndData();s.needsUpdate=!0;const a=M.useRef(null),l=Ti(m=>m.size),u=M.useMemo(()=>new Float32Array(e).fill(0).map((m,v)=>v),[e]),f=M.useMemo(()=>new Float32Array(e*3).fill(0),[e]),h=M.useMemo(()=>({color:{value:new F},max_amplitude:{value:n.maxAmplitude},sample_scale:{value:new ge(e,1)},samples:{type:"t",value:s},resolution:{value:new ge(l.width,l.height)},b_should_interpolate:{value:r}}),[e,n,r,l,s]);Fc(()=>{n.updateTextureData(o),s.needsUpdate=!0,a.current.uniforms.max_amplitude.value=n.maxAmplitude,a.current.uniforms.samples.value=s}),M.useEffect(()=>{var m;(m=a.current)!=null&&m.uniforms&&(a.current.uniforms.resolution.value.x=l.width,a.current.uniforms.resolution.value.y=l.height)},[l]),M.useEffect(()=>{var m;(m=a.current)!=null&&m.uniforms&&(a.current.uniforms.b_should_interpolate.value=r,a.current.uniforms.color.value.x=i.r,a.current.uniforms.color.value.y=i.g,a.current.uniforms.color.value.z=i.b)},[r,i]),M.useEffect(()=>{var m;(m=a.current)!=null&&m.uniforms&&(a.current.uniforms.sample_scale.value.x=e,a.current.uniforms.sample_scale.value.y=1)},[e]);const p=N.jsxs(M.Fragment,{children:[N.jsxs("bufferGeometry",{children:[N.jsx("bufferAttribute",{attach:"attributes-position",count:e,array:f,itemSize:3}),N.jsx("bufferAttribute",{attach:"attributes-index",count:e,array:u,itemSize:1})]}),N.jsx("shaderMaterial",{ref:a,depthWrite:!1,fragmentShader:u9,vertexShader:d9,uniforms:h})]});return t?N.jsx("points",{children:p}):N.jsx("line",{children:p})},nD=({textureMapper:n})=>{const e=XE(),{setPalette:t}=Yd(),{setColorBackground:r}=dM(),i=Wn.getPalette(e).lerpColor(.5),s=!0;return M.useEffect(()=>{t("rainbow"),r(!1)},[t,r]),N.jsx(h9,{textureMapper:n,usePoints:s,interpolate:!1,color:i})},pM=Object.freeze(Object.defineProperty({__proto__:null,default:nD},Symbol.toStringTag,{value:"Module"})),p9=()=>{const n=Sy(),e=XI(),t=new f9(n,e);return N.jsx(M.Suspense,{fallback:null,children:N.jsx(nD,{textureMapper:t})})},m9=()=>N.jsxs(tD,{children:[N.jsx(DL,{}),N.jsx(p9,{})]}),g9="modulepreload",v9=function(n){return"/r3f-audio-visualizer/"+n},_2={},ln=function(e,t,r){if(!t||t.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(t.map(s=>{if(s=v9(s),s in _2)return;_2[s]=!0;const o=s.endsWith(".css"),a=o?'[rel="stylesheet"]':"";if(!!r)for(let f=i.length-1;f>=0;f--){const h=i[f];if(h.href===s&&(!o||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${a}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":g9,o||(u.as="script",u.crossOrigin=""),u.href=s,document.head.appendChild(u),o)return new Promise((f,h)=>{u.addEventListener("load",f),u.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})},mM=(n,e)=>{const t=n[e];return t?typeof t=="function"?t():Promise.resolve(t):new Promise((r,i)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(i.bind(null,new Error("Unknown variable dynamic import: "+e)))})},rD=2*Math.PI,ah=Math.hypot(.5,.5),iD=Math.hypot(.5,.5,.5),y9=()=>{let n=0,e=0;for(;n===0;)n=Math.random();for(;e===0;)e=Math.random();const t=Math.sqrt(-2*Math.log(n))*Math.cos(rD*e)/10+.5;return t>1||t<0?y9():t},gM=(n,e,t,r=1)=>n==0||n==1?Math.hypot(e-.5,t-.5)/ah:e==0||e==1?Math.hypot(n-.5,n-.5)/ah:t==0||t==1?Math.hypot(n-.5,e-.5)/ah:r,zf={CARTESIAN_1D:"Cartesian_1D",CARTESIAN_2D:"Cartesian_2D",CARTESIAN_3D:"Cartesian_3D",CARTESIAN_CUBE_FACES:"Cartesian_CubeFaces",POLAR:"Polar"};class vM{constructor(e=1){at(this,"amplitude");this.amplitude=e}map(e,t,r=0,i=0,s=0){switch(e){case zf.CARTESIAN_1D:return this.map_1D(t,s);case zf.CARTESIAN_2D:case zf.POLAR:return this.map_2D(t,r,s);case zf.CARTESIAN_3D:return this.map_3D(t,r,i,s);case zf.CARTESIAN_CUBE_FACES:return this.map_3DFaces(t,r,i,s);default:return e}}}class x9 extends vM{constructor(t=1,r){super(t);at(this,"data");this.data=r}interpolateValueForNormalizedCoord(t){if(this.data===void 0||!this.data||this.data.length===0)return 0;const r=t*(this.data.length-1),i=this.data[Math.floor(r)],s=this.data[Math.ceil(r)];return i+r%1*(s-i)}map_1D(t,r=0){return this.amplitude*this.interpolateValueForNormalizedCoord(t)}map_2D(t,r,i=0){const s=Math.hypot(t-.5,r-.5)/ah;return this.map_1D(s,i)}map_3D(t,r,i,s=0){const o=Math.hypot(t-.5,r-.5,i-.5)/iD;return this.map_1D(o,s)}map_3DFaces(t,r,i,s=0){const o=gM(t,r,i,1);return this.map_1D(o,s)}}class sD{constructor(e){at(this,"_energyInfo");this._energyInfo=e}getNormalizedValue(){return this._energyInfo.current}}const _9=({visual:n})=>{const e=Sy(),t=qE(),{amplitude:r}=cE(),i=new x9(r,e),s=new sD(t),o=M.useMemo(()=>M.lazy(async()=>await mM(Object.assign({"./audioScope/reactive.tsx":()=>ln(()=>Promise.resolve().then(()=>pM),void 0),"./boxes/reactive.tsx":()=>ln(()=>import("./reactive-113ac4c3.js"),[]),"./cube/reactive.tsx":()=>ln(()=>import("./reactive-0bb7cde1.js"),[]),"./diffusedRing/reactive.tsx":()=>ln(()=>import("./reactive-66e7642c.js"),["assets/reactive-66e7642c.js","assets/Noise-108969e2.js"]),"./dna/reactive.tsx":()=>ln(()=>import("./reactive-d6904db8.js"),["assets/reactive-d6904db8.js","assets/Noise-108969e2.js"]),"./grid/reactive.tsx":()=>ln(()=>import("./reactive-49d9d480.js"),[]),"./ribbons/reactive.tsx":()=>ln(()=>import("./reactive-8030d939.js"),[]),"./sphere/reactive.tsx":()=>ln(()=>import("./reactive-dcfb10cc.js"),[]),"./stencil/reactive.tsx":()=>ln(()=>import("./reactive-2fe6b979.js"),[]),"./swarm/reactive.tsx":()=>ln(()=>Promise.resolve().then(()=>ub),void 0)}),`./${n}/reactive.tsx`)),[n]);return N.jsx(M.Suspense,{fallback:null,children:N.jsx(o,{coordinateMapper:i,scalarTracker:s})})},yM=M.createContext(null),S9=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.amplitude)??1),[i,s]=M.useState((n==null?void 0:n.spatialScale)??2),[o,a]=M.useState((n==null?void 0:n.timeScale)??.5),[l,u]=M.useState((n==null?void 0:n.nIterations)??10);return N.jsx(yM.Provider,{value:{config:{amplitude:t,spatialScale:i,timeScale:o,nIterations:l},setters:{setAmplitude:r,setSpatialScale:s,setTimeScale:a,setNIterations:u,reset:()=>{r((n==null?void 0:n.amplitude)??1),s((n==null?void 0:n.spatialScale)??2),a((n==null?void 0:n.timeScale)??.5),u((n==null?void 0:n.nIterations)??10)}}},children:e})};function oD(){const n=M.useContext(yM);if(!n)throw new Error("useNoiseGeneratorContext must be used within a NoiseGeneratorContextProvider");return n.config}function w9(){const n=M.useContext(yM);if(!n)throw new Error("useNoiseGeneratorContext must be used within a NoiseGeneratorContextProvider");return n.setters}const E9=.5*(Math.sqrt(3)-1),Bf=(3-Math.sqrt(3))/6,M9=1/3,Gs=1/6,b9=(Math.sqrt(5)-1)/4,xr=(5-Math.sqrt(5))/20,Uo=n=>Math.floor(n)|0,S2=new Float64Array([1,1,-1,1,1,-1,-1,-1,1,0,-1,0,1,0,-1,0,0,1,0,-1,0,1,0,-1]),J_=new Float64Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),qg=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 T9(n=Math.random){const e=xM(n),t=new Float64Array(e).map(i=>S2[i%12*2]),r=new Float64Array(e).map(i=>S2[i%12*2+1]);return function(s,o){let a=0,l=0,u=0;const f=(s+o)*E9,h=Uo(s+f),p=Uo(o+f),m=(h+p)*Bf,v=h-m,w=p-m,x=s-v,g=o-w;let S,_;x>g?(S=1,_=0):(S=0,_=1);const b=x-S+Bf,A=g-_+Bf,R=x-1+2*Bf,P=g-1+2*Bf,D=h&255,V=p&255;let C=.5-x*x-g*g;if(C>=0){const Q=D+e[V],z=t[Q],j=r[Q];C*=C,a=C*C*(z*x+j*g)}let L=.5-b*b-A*A;if(L>=0){const Q=D+S+e[V+_],z=t[Q],j=r[Q];L*=L,l=L*L*(z*b+j*A)}let W=.5-R*R-P*P;if(W>=0){const Q=D+1+e[V+1],z=t[Q],j=r[Q];W*=W,u=W*W*(z*R+j*P)}return 70*(a+l+u)}}function aD(n=Math.random){const e=xM(n),t=new Float64Array(e).map(s=>J_[s%12*3]),r=new Float64Array(e).map(s=>J_[s%12*3+1]),i=new Float64Array(e).map(s=>J_[s%12*3+2]);return function(o,a,l){let u,f,h,p;const m=(o+a+l)*M9,v=Uo(o+m),w=Uo(a+m),x=Uo(l+m),g=(v+w+x)*Gs,S=v-g,_=w-g,b=x-g,A=o-S,R=a-_,P=l-b;let D,V,C,L,W,Q;A>=R?R>=P?(D=1,V=0,C=0,L=1,W=1,Q=0):A>=P?(D=1,V=0,C=0,L=1,W=0,Q=1):(D=0,V=0,C=1,L=1,W=0,Q=1):Rqg[o%32*4]),r=new Float64Array(e).map(o=>qg[o%32*4+1]),i=new Float64Array(e).map(o=>qg[o%32*4+2]),s=new Float64Array(e).map(o=>qg[o%32*4+3]);return function(a,l,u,f){let h,p,m,v,w;const x=(a+l+u+f)*b9,g=Uo(a+x),S=Uo(l+x),_=Uo(u+x),b=Uo(f+x),A=(g+S+_+b)*xr,R=g-A,P=S-A,D=_-A,V=b-A,C=a-R,L=l-P,W=u-D,Q=f-V;let z=0,j=0,Y=0,re=0;C>L?z++:j++,C>W?z++:Y++,C>Q?z++:re++,L>W?j++:Y++,L>Q?j++:re++,W>Q?Y++:re++;const U=z>=3?1:0,X=j>=3?1:0,q=Y>=3?1:0,K=re>=3?1:0,se=z>=2?1:0,ve=j>=2?1:0,te=Y>=2?1:0,le=re>=2?1:0,Me=z>=1?1:0,pe=j>=1?1:0,Ae=Y>=1?1:0,De=re>=1?1:0,Re=C-U+xr,Ce=L-X+xr,H=W-q+xr,xe=Q-K+xr,de=C-se+2*xr,Te=L-ve+2*xr,ye=W-te+2*xr,Xe=Q-le+2*xr,ze=C-Me+3*xr,k=L-pe+3*xr,O=W-Ae+3*xr,ie=Q-De+3*xr,be=C-1+4*xr,we=L-1+4*xr,_e=W-1+4*xr,Ke=Q-1+4*xr,Fe=g&255,He=S&255,st=_&255,mt=b&255;let Ee=.6-C*C-L*L-W*W-Q*Q;if(Ee<0)h=0;else{const Le=Fe+e[He+e[st+e[mt]]];Ee*=Ee,h=Ee*Ee*(t[Le]*C+r[Le]*L+i[Le]*W+s[Le]*Q)}let Nt=.6-Re*Re-Ce*Ce-H*H-xe*xe;if(Nt<0)p=0;else{const Le=Fe+U+e[He+X+e[st+q+e[mt+K]]];Nt*=Nt,p=Nt*Nt*(t[Le]*Re+r[Le]*Ce+i[Le]*H+s[Le]*xe)}let wt=.6-de*de-Te*Te-ye*ye-Xe*Xe;if(wt<0)m=0;else{const Le=Fe+se+e[He+ve+e[st+te+e[mt+le]]];wt*=wt,m=wt*wt*(t[Le]*de+r[Le]*Te+i[Le]*ye+s[Le]*Xe)}let ft=.6-ze*ze-k*k-O*O-ie*ie;if(ft<0)v=0;else{const Le=Fe+Me+e[He+pe+e[st+Ae+e[mt+De]]];ft*=ft,v=ft*ft*(t[Le]*ze+r[Le]*k+i[Le]*O+s[Le]*ie)}let it=.6-be*be-we*we-_e*_e-Ke*Ke;if(it<0)w=0;else{const Le=Fe+1+e[He+1+e[st+1+e[mt+1]]];it*=it,w=it*it*(t[Le]*be+r[Le]*we+i[Le]*_e+s[Le]*Ke)}return 27*(h+p+m+v+w)}}function xM(n){const t=new Uint8Array(512);for(let r=0;r<512/2;r++)t[r]=r;for(let r=0;r<512/2-1;r++){const i=r+~~(n()*(256-r)),s=t[r];t[r]=t[i],t[i]=s}for(let r=256;r<512;r++)t[r]=t[r-256];return t}class A9 extends vM{constructor(t=1,r=1,i=1,s=1,o=.5){super(t);at(this,"noise2D");at(this,"noise3D");at(this,"noise4D");at(this,"spatialScale");at(this,"timeScale");at(this,"nIterations");at(this,"persistence");this.spatialScale=r,this.timeScale=i,this.nIterations=s,this.persistence=o,this.noise2D=T9(),this.noise3D=aD(),this.noise4D=C9()}map_1D(t,r=0){let i=0,s=0,o=this.amplitude,a=this.spatialScale;const l=this.timeScale;for(let u=0;u1?i/s:i}map_2D(t,r,i=0){let s=0,o=0,a=this.amplitude,l=this.spatialScale;const u=this.timeScale;for(let f=0;f1?s/o:s}map_3D(t,r,i,s=0){let o=0,a=0,l=this.amplitude,u=this.spatialScale;const f=this.timeScale;for(let h=0;h1?o/a:o}map_3DFaces(t,r,i,s=0){const o=gM(t,r,i,1);return this.map_1D(o,s)}}const R9=({visual:n})=>{const e=M.useMemo(()=>M.lazy(async()=>await mM(Object.assign({"./audioScope/reactive.tsx":()=>ln(()=>Promise.resolve().then(()=>pM),void 0),"./boxes/reactive.tsx":()=>ln(()=>import("./reactive-113ac4c3.js"),[]),"./cube/reactive.tsx":()=>ln(()=>import("./reactive-0bb7cde1.js"),[]),"./diffusedRing/reactive.tsx":()=>ln(()=>import("./reactive-66e7642c.js"),["assets/reactive-66e7642c.js","assets/Noise-108969e2.js"]),"./dna/reactive.tsx":()=>ln(()=>import("./reactive-d6904db8.js"),["assets/reactive-d6904db8.js","assets/Noise-108969e2.js"]),"./grid/reactive.tsx":()=>ln(()=>import("./reactive-49d9d480.js"),[]),"./ribbons/reactive.tsx":()=>ln(()=>import("./reactive-8030d939.js"),[]),"./sphere/reactive.tsx":()=>ln(()=>import("./reactive-dcfb10cc.js"),[]),"./stencil/reactive.tsx":()=>ln(()=>import("./reactive-2fe6b979.js"),[]),"./swarm/reactive.tsx":()=>ln(()=>Promise.resolve().then(()=>ub),void 0)}),`./${n}/reactive.tsx`)),[n]),{amplitude:t,spatialScale:r,timeScale:i,nIterations:s}=oD(),o=new A9(t,r,i,s);return N.jsx(N.Fragment,{children:N.jsx(M.Suspense,{fallback:null,children:N.jsx(e,{coordinateMapper:o})})})};var lD={exports:{}},Ui={},cD={exports:{}},uD={};/** +`;class E9{constructor(e,t){at(this,"samplesX");at(this,"samplesY");at(this,"maxAmplitude",4);at(this,"M",4);if(e.length!=t.length)throw new Error("sample size mismatch");this.samplesX=e,this.samplesY=t}updateTextureData(e){let r,i,s;for(let o=0;o>8,e[r+1]=i&255,e[r+2]=s>>8,e[r+3]=s&255}generateSupportedTextureAndData(){const e=new Uint8Array(this.samplesX.length*this.M);return{tex:new Ga(e,this.samplesX.length,1,Fr),textureData:e}}}const M9=({textureMapper:n,nParticles:e=512,usePoints:t=!0,interpolate:r=!1,color:i=new Be("green")})=>{const{tex:s,textureData:o}=n.generateSupportedTextureAndData();s.needsUpdate=!0;const a=M.useRef(null),l=Ti(m=>m.size),u=M.useMemo(()=>new Float32Array(e).fill(0).map((m,v)=>v),[e]),f=M.useMemo(()=>new Float32Array(e*3).fill(0),[e]),h=M.useMemo(()=>({color:{value:new F},max_amplitude:{value:n.maxAmplitude},sample_scale:{value:new ge(e,1)},samples:{type:"t",value:s},resolution:{value:new ge(l.width,l.height)},b_should_interpolate:{value:r}}),[e,n,r,l,s]);Bc(()=>{n.updateTextureData(o),s.needsUpdate=!0,a.current.uniforms.max_amplitude.value=n.maxAmplitude,a.current.uniforms.samples.value=s}),M.useEffect(()=>{var m;(m=a.current)!=null&&m.uniforms&&(a.current.uniforms.resolution.value.x=l.width,a.current.uniforms.resolution.value.y=l.height)},[l]),M.useEffect(()=>{var m;(m=a.current)!=null&&m.uniforms&&(a.current.uniforms.b_should_interpolate.value=r,a.current.uniforms.color.value.x=i.r,a.current.uniforms.color.value.y=i.g,a.current.uniforms.color.value.z=i.b)},[r,i]),M.useEffect(()=>{var m;(m=a.current)!=null&&m.uniforms&&(a.current.uniforms.sample_scale.value.x=e,a.current.uniforms.sample_scale.value.y=1)},[e]);const p=N.jsxs(M.Fragment,{children:[N.jsxs("bufferGeometry",{children:[N.jsx("bufferAttribute",{attach:"attributes-position",count:e,array:f,itemSize:3}),N.jsx("bufferAttribute",{attach:"attributes-index",count:e,array:u,itemSize:1})]}),N.jsx("shaderMaterial",{ref:a,depthWrite:!1,fragmentShader:S9,vertexShader:w9,uniforms:h})]});return t?N.jsx("points",{children:p}):N.jsx("line",{children:p})},lD=({textureMapper:n})=>{const e=YE(),{setPalette:t}=Kd(),{setColorBackground:r}=hM(),i=Wn.getPalette(e).lerpColor(.5),s=!0;return M.useEffect(()=>{t("rainbow"),r(!1)},[t,r]),N.jsx(M9,{textureMapper:n,usePoints:s,interpolate:!1,color:i})},b9=Object.freeze(Object.defineProperty({__proto__:null,default:lD},Symbol.toStringTag,{value:"Module"})),T9=()=>{const n=Ey(),e=qI(),t=new E9(n,e);return N.jsx(M.Suspense,{fallback:null,children:N.jsx(lD,{textureMapper:t})})},C9=()=>N.jsxs(aD,{children:[N.jsx(OL,{}),N.jsx(T9,{})]}),cD=2*Math.PI,ch=Math.hypot(.5,.5),uD=Math.hypot(.5,.5,.5),A9=()=>{let n=0,e=0;for(;n===0;)n=Math.random();for(;e===0;)e=Math.random();const t=Math.sqrt(-2*Math.log(n))*Math.cos(cD*e)/10+.5;return t>1||t<0?A9():t},gM=(n,e,t,r=1)=>n==0||n==1?Math.hypot(e-.5,t-.5)/ch:e==0||e==1?Math.hypot(n-.5,n-.5)/ch:t==0||t==1?Math.hypot(n-.5,e-.5)/ch:r,Vf={CARTESIAN_1D:"Cartesian_1D",CARTESIAN_2D:"Cartesian_2D",CARTESIAN_3D:"Cartesian_3D",CARTESIAN_CUBE_FACES:"Cartesian_CubeFaces",POLAR:"Polar"};class vM{constructor(e=1){at(this,"amplitude");this.amplitude=e}map(e,t,r=0,i=0,s=0){switch(e){case Vf.CARTESIAN_1D:return this.map_1D(t,s);case Vf.CARTESIAN_2D:case Vf.POLAR:return this.map_2D(t,r,s);case Vf.CARTESIAN_3D:return this.map_3D(t,r,i,s);case Vf.CARTESIAN_CUBE_FACES:return this.map_3DFaces(t,r,i,s);default:return e}}}class R9 extends vM{constructor(t=1,r){super(t);at(this,"data");this.data=r}interpolateValueForNormalizedCoord(t){if(this.data===void 0||!this.data||this.data.length===0)return 0;const r=t*(this.data.length-1),i=this.data[Math.floor(r)],s=this.data[Math.ceil(r)];return i+r%1*(s-i)}map_1D(t,r=0){return this.amplitude*this.interpolateValueForNormalizedCoord(t)}map_2D(t,r,i=0){const s=Math.hypot(t-.5,r-.5)/ch;return this.map_1D(s,i)}map_3D(t,r,i,s=0){const o=Math.hypot(t-.5,r-.5,i-.5)/uD;return this.map_1D(o,s)}map_3DFaces(t,r,i,s=0){const o=gM(t,r,i,1);return this.map_1D(o,s)}}class dD{constructor(e){at(this,"_energyInfo");this._energyInfo=e}getNormalizedValue(){return this._energyInfo.current}}const P9="modulepreload",I9=function(n){return"/r3f-audio-visualizer/"+n},S2={},xs=function(e,t,r){if(!t||t.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(t.map(s=>{if(s=I9(s),s in S2)return;S2[s]=!0;const o=s.endsWith(".css"),a=o?'[rel="stylesheet"]':"";if(!!r)for(let f=i.length-1;f>=0;f--){const h=i[f];if(h.href===s&&(!o||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${a}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":P9,o||(u.as="script",u.crossOrigin=""),u.href=s,document.head.appendChild(u),o)return new Promise((f,h)=>{u.addEventListener("load",f),u.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})},L9=(n,e)=>{const t=n[e];return t?typeof t=="function"?t():Promise.resolve(t):new Promise((r,i)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(i.bind(null,new Error("Unknown variable dynamic import: "+e)))})},D9=n=>M.useMemo(()=>M.lazy(async()=>await L9(Object.assign({"../components/visualizers/audioScope/reactive.tsx":()=>xs(()=>Promise.resolve().then(()=>b9),void 0),"../components/visualizers/boxes/reactive.tsx":()=>xs(()=>import("./reactive-315566b5.js"),["assets/reactive-315566b5.js","assets/easing-a3fe9c65.js"]),"../components/visualizers/cube/reactive.tsx":()=>xs(()=>import("./reactive-b4f6023b.js"),[]),"../components/visualizers/diffusedRing/reactive.tsx":()=>xs(()=>import("./reactive-f52bc967.js"),["assets/reactive-f52bc967.js","assets/Noise-e2defa57.js"]),"../components/visualizers/dna/reactive.tsx":()=>xs(()=>import("./reactive-bd93b2f1.js"),["assets/reactive-bd93b2f1.js","assets/Noise-e2defa57.js"]),"../components/visualizers/grid/reactive.tsx":()=>xs(()=>import("./reactive-ebece92c.js"),[]),"../components/visualizers/ribbons/reactive.tsx":()=>xs(()=>import("./reactive-48384246.js"),[]),"../components/visualizers/sphere/reactive.tsx":()=>xs(()=>import("./reactive-8ad27c76.js"),[]),"../components/visualizers/stencil/reactive.tsx":()=>xs(()=>import("./reactive-6bccba52.js"),[]),"../components/visualizers/swarm/reactive.tsx":()=>xs(()=>Promise.resolve().then(()=>cq),void 0),"../components/visualizers/walk/reactive.tsx":()=>xs(()=>import("./reactive-f2d65ad9.js"),["assets/reactive-f2d65ad9.js","assets/easing-a3fe9c65.js"])}),`../components/visualizers/${n}/reactive.tsx`)),[n]),yM=({visual:n,coordinateMapper:e,scalarTracker:t})=>{const r=D9(n);return N.jsx(M.Suspense,{fallback:null,children:N.jsx(r,{coordinateMapper:e,scalarTracker:t})})},N9=({visual:n})=>{const e=Ey(),t=ZE(),{amplitude:r}=dE(),i=new R9(r,e),s=new dD(t);return N.jsx(yM,{visual:n,coordinateMapper:i,scalarTracker:s})},xM=M.createContext(null),O9=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.amplitude)??1),[i,s]=M.useState((n==null?void 0:n.spatialScale)??2),[o,a]=M.useState((n==null?void 0:n.timeScale)??.5),[l,u]=M.useState((n==null?void 0:n.nIterations)??10);return N.jsx(xM.Provider,{value:{config:{amplitude:t,spatialScale:i,timeScale:o,nIterations:l},setters:{setAmplitude:r,setSpatialScale:s,setTimeScale:a,setNIterations:u,reset:()=>{r((n==null?void 0:n.amplitude)??1),s((n==null?void 0:n.spatialScale)??2),a((n==null?void 0:n.timeScale)??.5),u((n==null?void 0:n.nIterations)??10)}}},children:e})};function fD(){const n=M.useContext(xM);if(!n)throw new Error("useNoiseGeneratorContext must be used within a NoiseGeneratorContextProvider");return n.config}function k9(){const n=M.useContext(xM);if(!n)throw new Error("useNoiseGeneratorContext must be used within a NoiseGeneratorContextProvider");return n.setters}const U9=.5*(Math.sqrt(3)-1),Hf=(3-Math.sqrt(3))/6,F9=1/3,js=1/6,z9=(Math.sqrt(5)-1)/4,xr=(5-Math.sqrt(5))/20,Fo=n=>Math.floor(n)|0,w2=new Float64Array([1,1,-1,1,1,-1,-1,-1,1,0,-1,0,1,0,-1,0,0,1,0,-1,0,1,0,-1]),tS=new Float64Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),Zg=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 B9(n=Math.random){const e=_M(n),t=new Float64Array(e).map(i=>w2[i%12*2]),r=new Float64Array(e).map(i=>w2[i%12*2+1]);return function(s,o){let a=0,l=0,u=0;const f=(s+o)*U9,h=Fo(s+f),p=Fo(o+f),m=(h+p)*Hf,v=h-m,w=p-m,x=s-v,g=o-w;let S,_;x>g?(S=1,_=0):(S=0,_=1);const b=x-S+Hf,A=g-_+Hf,R=x-1+2*Hf,P=g-1+2*Hf,D=h&255,V=p&255;let C=.5-x*x-g*g;if(C>=0){const Q=D+e[V],z=t[Q],j=r[Q];C*=C,a=C*C*(z*x+j*g)}let L=.5-b*b-A*A;if(L>=0){const Q=D+S+e[V+_],z=t[Q],j=r[Q];L*=L,l=L*L*(z*b+j*A)}let W=.5-R*R-P*P;if(W>=0){const Q=D+1+e[V+1],z=t[Q],j=r[Q];W*=W,u=W*W*(z*R+j*P)}return 70*(a+l+u)}}function hD(n=Math.random){const e=_M(n),t=new Float64Array(e).map(s=>tS[s%12*3]),r=new Float64Array(e).map(s=>tS[s%12*3+1]),i=new Float64Array(e).map(s=>tS[s%12*3+2]);return function(o,a,l){let u,f,h,p;const m=(o+a+l)*F9,v=Fo(o+m),w=Fo(a+m),x=Fo(l+m),g=(v+w+x)*js,S=v-g,_=w-g,b=x-g,A=o-S,R=a-_,P=l-b;let D,V,C,L,W,Q;A>=R?R>=P?(D=1,V=0,C=0,L=1,W=1,Q=0):A>=P?(D=1,V=0,C=0,L=1,W=0,Q=1):(D=0,V=0,C=1,L=1,W=0,Q=1):RZg[o%32*4]),r=new Float64Array(e).map(o=>Zg[o%32*4+1]),i=new Float64Array(e).map(o=>Zg[o%32*4+2]),s=new Float64Array(e).map(o=>Zg[o%32*4+3]);return function(a,l,u,f){let h,p,m,v,w;const x=(a+l+u+f)*z9,g=Fo(a+x),S=Fo(l+x),_=Fo(u+x),b=Fo(f+x),A=(g+S+_+b)*xr,R=g-A,P=S-A,D=_-A,V=b-A,C=a-R,L=l-P,W=u-D,Q=f-V;let z=0,j=0,Y=0,re=0;C>L?z++:j++,C>W?z++:Y++,C>Q?z++:re++,L>W?j++:Y++,L>Q?j++:re++,W>Q?Y++:re++;const U=z>=3?1:0,X=j>=3?1:0,q=Y>=3?1:0,K=re>=3?1:0,se=z>=2?1:0,ve=j>=2?1:0,te=Y>=2?1:0,le=re>=2?1:0,Me=z>=1?1:0,pe=j>=1?1:0,Ae=Y>=1?1:0,De=re>=1?1:0,Re=C-U+xr,Ce=L-X+xr,H=W-q+xr,xe=Q-K+xr,de=C-se+2*xr,Te=L-ve+2*xr,ye=W-te+2*xr,Xe=Q-le+2*xr,ze=C-Me+3*xr,k=L-pe+3*xr,O=W-Ae+3*xr,ie=Q-De+3*xr,be=C-1+4*xr,we=L-1+4*xr,_e=W-1+4*xr,Ke=Q-1+4*xr,Fe=g&255,He=S&255,st=_&255,mt=b&255;let Ee=.6-C*C-L*L-W*W-Q*Q;if(Ee<0)h=0;else{const Le=Fe+e[He+e[st+e[mt]]];Ee*=Ee,h=Ee*Ee*(t[Le]*C+r[Le]*L+i[Le]*W+s[Le]*Q)}let Nt=.6-Re*Re-Ce*Ce-H*H-xe*xe;if(Nt<0)p=0;else{const Le=Fe+U+e[He+X+e[st+q+e[mt+K]]];Nt*=Nt,p=Nt*Nt*(t[Le]*Re+r[Le]*Ce+i[Le]*H+s[Le]*xe)}let wt=.6-de*de-Te*Te-ye*ye-Xe*Xe;if(wt<0)m=0;else{const Le=Fe+se+e[He+ve+e[st+te+e[mt+le]]];wt*=wt,m=wt*wt*(t[Le]*de+r[Le]*Te+i[Le]*ye+s[Le]*Xe)}let ft=.6-ze*ze-k*k-O*O-ie*ie;if(ft<0)v=0;else{const Le=Fe+Me+e[He+pe+e[st+Ae+e[mt+De]]];ft*=ft,v=ft*ft*(t[Le]*ze+r[Le]*k+i[Le]*O+s[Le]*ie)}let it=.6-be*be-we*we-_e*_e-Ke*Ke;if(it<0)w=0;else{const Le=Fe+1+e[He+1+e[st+1+e[mt+1]]];it*=it,w=it*it*(t[Le]*be+r[Le]*we+i[Le]*_e+s[Le]*Ke)}return 27*(h+p+m+v+w)}}function _M(n){const t=new Uint8Array(512);for(let r=0;r<512/2;r++)t[r]=r;for(let r=0;r<512/2-1;r++){const i=r+~~(n()*(256-r)),s=t[r];t[r]=t[i],t[i]=s}for(let r=256;r<512;r++)t[r]=t[r-256];return t}class H9 extends vM{constructor(t=1,r=1,i=1,s=1,o=.5){super(t);at(this,"noise2D");at(this,"noise3D");at(this,"noise4D");at(this,"spatialScale");at(this,"timeScale");at(this,"nIterations");at(this,"persistence");this.spatialScale=r,this.timeScale=i,this.nIterations=s,this.persistence=o,this.noise2D=B9(),this.noise3D=hD(),this.noise4D=V9()}map_1D(t,r=0){let i=0,s=0,o=this.amplitude,a=this.spatialScale;const l=this.timeScale;for(let u=0;u1?i/s:i}map_2D(t,r,i=0){let s=0,o=0,a=this.amplitude,l=this.spatialScale;const u=this.timeScale;for(let f=0;f1?s/o:s}map_3D(t,r,i,s=0){let o=0,a=0,l=this.amplitude,u=this.spatialScale;const f=this.timeScale;for(let h=0;h1?o/a:o}map_3DFaces(t,r,i,s=0){const o=gM(t,r,i,1);return this.map_1D(o,s)}}const $9=({visual:n})=>{const{amplitude:e,spatialScale:t,timeScale:r,nIterations:i}=fD(),s=new H9(e,t,r,i);return N.jsx(yM,{visual:n,coordinateMapper:s})};var pD={exports:{}},Ui={},mD={exports:{}},gD={};/** * @license React * scheduler.production.min.js * @@ -4079,7 +4084,7 @@ void main() { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(n){function e(U,X){var q=U.length;U.push(X);e:for(;0>>1,se=U[K];if(0>>1;Ki(le,q))Mei(pe,le)?(U[K]=pe,U[Me]=q,K=Me):(U[K]=le,U[te]=q,K=te);else if(Mei(pe,q))U[K]=pe,U[Me]=q,K=Me;else break e}}return X}function i(U,X){var q=U.sortIndex-X.sortIndex;return q!==0?q:U.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],u=[],f=1,h=null,p=3,m=!1,v=!1,w=!1,x=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(U){for(var X=t(u);X!==null;){if(X.callback===null)r(u);else if(X.startTime<=U)r(u),X.sortIndex=X.expirationTime,e(l,X);else break;X=t(u)}}function b(U){if(w=!1,_(U),!v)if(t(l)!==null)v=!0,Y(A);else{var X=t(u);X!==null&&re(b,X.startTime-U)}}function A(U,X){v=!1,w&&(w=!1,g(D),D=-1),m=!0;var q=p;try{for(_(X),h=t(l);h!==null&&(!(h.expirationTime>X)||U&&!L());){var K=h.callback;if(typeof K=="function"){h.callback=null,p=h.priorityLevel;var se=K(h.expirationTime<=X);X=n.unstable_now(),typeof se=="function"?h.callback=se:h===t(l)&&r(l),_(X)}else r(l);h=t(l)}if(h!==null)var ve=!0;else{var te=t(u);te!==null&&re(b,te.startTime-X),ve=!1}return ve}finally{h=null,p=q,m=!1}}var R=!1,P=null,D=-1,V=5,C=-1;function L(){return!(n.unstable_now()-CU||125K?(U.sortIndex=q,e(u,U),t(l)===null&&U===t(u)&&(w?(g(D),D=-1):w=!0,re(b,q-K))):(U.sortIndex=se,e(l,U),v||m||(v=!0,Y(A))),U},n.unstable_shouldYield=L,n.unstable_wrapCallback=function(U){var X=p;return function(){var q=p;p=X;try{return U.apply(this,arguments)}finally{p=q}}}})(uD);cD.exports=uD;var P9=cD.exports;/** + */(function(n){function e(U,X){var q=U.length;U.push(X);e:for(;0>>1,se=U[K];if(0>>1;Ki(le,q))Mei(pe,le)?(U[K]=pe,U[Me]=q,K=Me):(U[K]=le,U[te]=q,K=te);else if(Mei(pe,q))U[K]=pe,U[Me]=q,K=Me;else break e}}return X}function i(U,X){var q=U.sortIndex-X.sortIndex;return q!==0?q:U.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],u=[],f=1,h=null,p=3,m=!1,v=!1,w=!1,x=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(U){for(var X=t(u);X!==null;){if(X.callback===null)r(u);else if(X.startTime<=U)r(u),X.sortIndex=X.expirationTime,e(l,X);else break;X=t(u)}}function b(U){if(w=!1,_(U),!v)if(t(l)!==null)v=!0,Y(A);else{var X=t(u);X!==null&&re(b,X.startTime-U)}}function A(U,X){v=!1,w&&(w=!1,g(D),D=-1),m=!0;var q=p;try{for(_(X),h=t(l);h!==null&&(!(h.expirationTime>X)||U&&!L());){var K=h.callback;if(typeof K=="function"){h.callback=null,p=h.priorityLevel;var se=K(h.expirationTime<=X);X=n.unstable_now(),typeof se=="function"?h.callback=se:h===t(l)&&r(l),_(X)}else r(l);h=t(l)}if(h!==null)var ve=!0;else{var te=t(u);te!==null&&re(b,te.startTime-X),ve=!1}return ve}finally{h=null,p=q,m=!1}}var R=!1,P=null,D=-1,V=5,C=-1;function L(){return!(n.unstable_now()-CU||125K?(U.sortIndex=q,e(u,U),t(l)===null&&U===t(u)&&(w?(g(D),D=-1):w=!0,re(b,q-K))):(U.sortIndex=se,e(l,U),v||m||(v=!0,Y(A))),U},n.unstable_shouldYield=L,n.unstable_wrapCallback=function(U){var X=p;return function(){var q=p;p=X;try{return U.apply(this,arguments)}finally{p=q}}}})(gD);mD.exports=gD;var W9=mD.exports;/** * @license React * react-dom.production.min.js * @@ -4087,14 +4092,14 @@ void main() { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var dD=M,ki=P9;function Ie(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Z1=Object.prototype.hasOwnProperty,I9=/^[: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]*$/,w2={},E2={};function L9(n){return Z1.call(E2,n)?!0:Z1.call(w2,n)?!1:I9.test(n)?E2[n]=!0:(w2[n]=!0,!1)}function D9(n,e,t,r){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function N9(n,e,t,r){if(e===null||typeof e>"u"||D9(n,e,t,r))return!0;if(r)return!1;if(t!==null)switch(t.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 ri(n,e,t,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Mr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Mr[n]=new ri(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];Mr[e]=new ri(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Mr[n]=new ri(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Mr[n]=new ri(n,2,!1,n,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(n){Mr[n]=new ri(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Mr[n]=new ri(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Mr[n]=new ri(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Mr[n]=new ri(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Mr[n]=new ri(n,5,!1,n.toLowerCase(),null,!1,!1)});var _M=/[\-:]([a-z])/g;function SM(n){return n[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(n){var e=n.replace(_M,SM);Mr[e]=new ri(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(_M,SM);Mr[e]=new ri(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(_M,SM);Mr[e]=new ri(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Mr[n]=new ri(n,1,!1,n.toLowerCase(),null,!1,!1)});Mr.xlinkHref=new ri("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Mr[n]=new ri(n,1,!1,n.toLowerCase(),null,!0,!0)});function wM(n,e,t,r){var i=Mr.hasOwnProperty(e)?Mr[e]:null;(i!==null?i.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Q1=Object.prototype.hasOwnProperty,G9=/^[: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]*$/,E2={},M2={};function j9(n){return Q1.call(M2,n)?!0:Q1.call(E2,n)?!1:G9.test(n)?M2[n]=!0:(E2[n]=!0,!1)}function X9(n,e,t,r){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function q9(n,e,t,r){if(e===null||typeof e>"u"||X9(n,e,t,r))return!0;if(r)return!1;if(t!==null)switch(t.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 ri(n,e,t,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Mr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Mr[n]=new ri(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];Mr[e]=new ri(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Mr[n]=new ri(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Mr[n]=new ri(n,2,!1,n,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(n){Mr[n]=new ri(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Mr[n]=new ri(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Mr[n]=new ri(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Mr[n]=new ri(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Mr[n]=new ri(n,5,!1,n.toLowerCase(),null,!1,!1)});var SM=/[\-:]([a-z])/g;function wM(n){return n[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(n){var e=n.replace(SM,wM);Mr[e]=new ri(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(SM,wM);Mr[e]=new ri(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(SM,wM);Mr[e]=new ri(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Mr[n]=new ri(n,1,!1,n.toLowerCase(),null,!1,!1)});Mr.xlinkHref=new ri("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Mr[n]=new ri(n,1,!1,n.toLowerCase(),null,!0,!0)});function EM(n,e,t,r){var i=Mr.hasOwnProperty(e)?Mr[e]:null;(i!==null?i.type!==0:r||!(2a||i[o]!==s[a]){var l=` -`+i[o].replace(" at new "," at ");return n.displayName&&l.includes("")&&(l=l.replace("",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{tS=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?Kf(n):""}function O9(n){switch(n.tag){case 5:return Kf(n.type);case 16:return Kf("Lazy");case 13:return Kf("Suspense");case 19:return Kf("SuspenseList");case 0:case 2:case 15:return n=nS(n.type,!1),n;case 11:return n=nS(n.type.render,!1),n;case 1:return n=nS(n.type,!0),n;default:return""}}function ew(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case Hu:return"Fragment";case Vu:return"Portal";case K1:return"Profiler";case EM:return"StrictMode";case Q1:return"Suspense";case J1:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case pD:return(n.displayName||"Context")+".Consumer";case hD:return(n._context.displayName||"Context")+".Provider";case MM:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case bM:return e=n.displayName||null,e!==null?e:ew(n.type)||"Memo";case Ca:e=n._payload,n=n._init;try{return ew(n(e))}catch{}}return null}function k9(n){var e=n.type;switch(n.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 n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ew(e);case 8:return e===EM?"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 ol(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function gD(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function U9(n){var e=gD(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),r=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var i=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function Zg(n){n._valueTracker||(n._valueTracker=U9(n))}function vD(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),r="";return n&&(r=gD(n)?n.checked?"true":"false":n.value),n=r,n!==t?(e.setValue(n),!0):!1}function d0(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function tw(n,e){var t=e.checked;return Dn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function b2(n,e){var t=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;t=ol(e.value!=null?e.value:t),n._wrapperState={initialChecked:r,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function yD(n,e){e=e.checked,e!=null&&wM(n,"checked",e,!1)}function nw(n,e){yD(n,e);var t=ol(e.value),r=e.type;if(t!=null)r==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(r==="submit"||r==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?rw(n,e.type,t):e.hasOwnProperty("defaultValue")&&rw(n,e.type,ol(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function T2(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function rw(n,e,t){(e!=="number"||d0(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var Qf=Array.isArray;function td(n,e,t,r){if(n=n.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Kg.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function tp(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var lh={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},F9=["Webkit","ms","Moz","O"];Object.keys(lh).forEach(function(n){F9.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),lh[e]=lh[n]})});function wD(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||lh.hasOwnProperty(n)&&lh[n]?(""+e).trim():e+"px"}function ED(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var r=t.indexOf("--")===0,i=wD(t,e[t],r);t==="float"&&(t="cssFloat"),r?n.setProperty(t,i):n[t]=i}}var z9=Dn({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 ow(n,e){if(e){if(z9[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Ie(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Ie(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Ie(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Ie(62))}}function aw(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){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 lw=null;function TM(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var cw=null,nd=null,rd=null;function R2(n){if(n=Kp(n)){if(typeof cw!="function")throw Error(Ie(280));var e=n.stateNode;e&&(e=Ay(e),cw(n.stateNode,n.type,e))}}function MD(n){nd?rd?rd.push(n):rd=[n]:nd=n}function bD(){if(nd){var n=nd,e=rd;if(rd=nd=null,R2(n),e)for(n=0;n>>=0,n===0?32:31-(Z9(n)/K9|0)|0}var Qg=64,Jg=4194304;function Jf(n){switch(n&-n){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 n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function m0(n,e){var t=n.pendingLanes;if(t===0)return 0;var r=0,i=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~i;a!==0?r=Jf(a):(s&=o,s!==0&&(r=Jf(s)))}else o=t&~i,o!==0?r=Jf(o):s!==0&&(r=Jf(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=r;0t;t++)e.push(n);return e}function Yp(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-Rs(e),n[e]=t}function tj(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var r=n.eventTimes;for(n=n.expirationTimes;0=uh),F2=String.fromCharCode(32),z2=!1;function GD(n,e){switch(n){case"keyup":return Rj.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jD(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var $u=!1;function Ij(n,e){switch(n){case"compositionend":return jD(e);case"keypress":return e.which!==32?null:(z2=!0,F2);case"textInput":return n=e.data,n===F2&&z2?null:n;default:return null}}function Lj(n,e){if($u)return n==="compositionend"||!NM&&GD(n,e)?(n=$D(),Lv=IM=Ba=null,$u=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=r}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=$2(t)}}function ZD(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?ZD(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function KD(){for(var n=window,e=d0();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=d0(n.document)}return e}function OM(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function Vj(n){var e=KD(),t=n.focusedElem,r=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&ZD(t.ownerDocument.documentElement,t)){if(r!==null&&OM(t)){if(e=r.start,n=r.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var i=t.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!n.extend&&s>r&&(i=r,r=s,s=i),i=W2(t,s);var o=W2(t,r);i&&o&&(n.rangeCount!==1||n.anchorNode!==i.node||n.anchorOffset!==i.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),n.removeAllRanges(),s>r?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,Wu=null,mw=null,fh=null,gw=!1;function G2(n,e,t){var r=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;gw||Wu==null||Wu!==d0(r)||(r=Wu,"selectionStart"in r&&OM(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),fh&&ap(fh,r)||(fh=r,r=y0(mw,"onSelect"),0Xu||(n.current=ww[Xu],ww[Xu]=null,Xu--)}function mn(n,e){Xu++,ww[Xu]=n.current,n.current=e}var al={},$r=gl(al),hi=gl(!1),wc=al;function Ld(n,e){var t=n.type.contextTypes;if(!t)return al;var r=n.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in t)i[s]=e[s];return r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=i),i}function pi(n){return n=n.childContextTypes,n!=null}function _0(){_n(hi),_n($r)}function Q2(n,e,t){if($r.current!==al)throw Error(Ie(168));mn($r,e),mn(hi,t)}function oN(n,e,t){var r=n.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return t;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(Ie(108,k9(n)||"Unknown",i));return Dn({},t,r)}function S0(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||al,wc=$r.current,mn($r,n),mn(hi,hi.current),!0}function J2(n,e,t){var r=n.stateNode;if(!r)throw Error(Ie(169));t?(n=oN(n,e,wc),r.__reactInternalMemoizedMergedChildContext=n,_n(hi),_n($r),mn($r,n)):_n(hi),mn(hi,t)}var Io=null,Ry=!1,gS=!1;function aN(n){Io===null?Io=[n]:Io.push(n)}function Jj(n){Ry=!0,aN(n)}function vl(){if(!gS&&Io!==null){gS=!0;var n=0,e=un;try{var t=Io;for(un=1;n>=o,i-=o,Fo=1<<32-Rs(e)+i|t<D?(V=P,P=null):V=P.sibling;var C=p(g,P,_[D],b);if(C===null){P===null&&(P=V);break}n&&P&&C.alternate===null&&e(g,P),S=s(C,S,D),R===null?A=C:R.sibling=C,R=C,P=V}if(D===_.length)return t(g,P),Mn&&Vl(g,D),A;if(P===null){for(;D<_.length;D++)P=h(g,_[D],b),P!==null&&(S=s(P,S,D),R===null?A=P:R.sibling=P,R=P);return Mn&&Vl(g,D),A}for(P=r(g,P);D<_.length;D++)V=m(P,g,D,_[D],b),V!==null&&(n&&V.alternate!==null&&P.delete(V.key===null?D:V.key),S=s(V,S,D),R===null?A=V:R.sibling=V,R=V);return n&&P.forEach(function(L){return e(g,L)}),Mn&&Vl(g,D),A}function w(g,S,_,b){var A=Vf(_);if(typeof A!="function")throw Error(Ie(150));if(_=A.call(_),_==null)throw Error(Ie(151));for(var R=A=null,P=S,D=S=0,V=null,C=_.next();P!==null&&!C.done;D++,C=_.next()){P.index>D?(V=P,P=null):V=P.sibling;var L=p(g,P,C.value,b);if(L===null){P===null&&(P=V);break}n&&P&&L.alternate===null&&e(g,P),S=s(L,S,D),R===null?A=L:R.sibling=L,R=L,P=V}if(C.done)return t(g,P),Mn&&Vl(g,D),A;if(P===null){for(;!C.done;D++,C=_.next())C=h(g,C.value,b),C!==null&&(S=s(C,S,D),R===null?A=C:R.sibling=C,R=C);return Mn&&Vl(g,D),A}for(P=r(g,P);!C.done;D++,C=_.next())C=m(P,g,D,C.value,b),C!==null&&(n&&C.alternate!==null&&P.delete(C.key===null?D:C.key),S=s(C,S,D),R===null?A=C:R.sibling=C,R=C);return n&&P.forEach(function(W){return e(g,W)}),Mn&&Vl(g,D),A}function x(g,S,_,b){if(typeof _=="object"&&_!==null&&_.type===Hu&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Yg:e:{for(var A=_.key,R=S;R!==null;){if(R.key===A){if(A=_.type,A===Hu){if(R.tag===7){t(g,R.sibling),S=i(R,_.props.children),S.return=g,g=S;break e}}else if(R.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Ca&&oR(A)===R.type){t(g,R.sibling),S=i(R,_.props),S.ref=jf(g,R,_),S.return=g,g=S;break e}t(g,R);break}else e(g,R);R=R.sibling}_.type===Hu?(S=pc(_.props.children,g.mode,b,_.key),S.return=g,g=S):(b=Bv(_.type,_.key,_.props,null,g.mode,b),b.ref=jf(g,S,_),b.return=g,g=b)}return o(g);case Vu:e:{for(R=_.key;S!==null;){if(S.key===R)if(S.tag===4&&S.stateNode.containerInfo===_.containerInfo&&S.stateNode.implementation===_.implementation){t(g,S.sibling),S=i(S,_.children||[]),S.return=g,g=S;break e}else{t(g,S);break}else e(g,S);S=S.sibling}S=MS(_,g.mode,b),S.return=g,g=S}return o(g);case Ca:return R=_._init,x(g,S,R(_._payload),b)}if(Qf(_))return v(g,S,_,b);if(Vf(_))return w(g,S,_,b);ov(g,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,S!==null&&S.tag===6?(t(g,S.sibling),S=i(S,_),S.return=g,g=S):(t(g,S),S=ES(_,g.mode,b),S.return=g,g=S),o(g)):t(g,S)}return x}var Nd=mN(!0),gN=mN(!1),Qp={},co=gl(Qp),dp=gl(Qp),fp=gl(Qp);function Ql(n){if(n===Qp)throw Error(Ie(174));return n}function WM(n,e){switch(mn(fp,e),mn(dp,n),mn(co,Qp),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:sw(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=sw(e,n)}_n(co),mn(co,e)}function Od(){_n(co),_n(dp),_n(fp)}function vN(n){Ql(fp.current);var e=Ql(co.current),t=sw(e,n.type);e!==t&&(mn(dp,n),mn(co,t))}function GM(n){dp.current===n&&(_n(co),_n(dp))}var An=gl(0);function C0(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var vS=[];function jM(){for(var n=0;nt?t:4,n(!0);var r=yS.transition;yS.transition={};try{n(!1),e()}finally{un=t,yS.transition=r}}function DN(){return cs().memoizedState}function rX(n,e,t){var r=Ka(n);if(t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},NN(n))ON(e,t);else if(t=dN(n,e,t,r),t!==null){var i=Jr();Ps(t,n,r,i),kN(t,e,r)}}function iX(n,e,t){var r=Ka(n),i={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(NN(n))ON(e,i);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);if(i.hasEagerState=!0,i.eagerState=a,Ls(a,o)){var l=e.interleaved;l===null?(i.next=i,HM(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}t=dN(n,e,i,r),t!==null&&(i=Jr(),Ps(t,n,r,i),kN(t,e,r))}}function NN(n){var e=n.alternate;return n===Ln||e!==null&&e===Ln}function ON(n,e){hh=A0=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function kN(n,e,t){if(t&4194240){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,AM(n,t)}}var R0={readContext:ls,useCallback:Dr,useContext:Dr,useEffect:Dr,useImperativeHandle:Dr,useInsertionEffect:Dr,useLayoutEffect:Dr,useMemo:Dr,useReducer:Dr,useRef:Dr,useState:Dr,useDebugValue:Dr,useDeferredValue:Dr,useTransition:Dr,useMutableSource:Dr,useSyncExternalStore:Dr,useId:Dr,unstable_isNewReconciler:!1},sX={readContext:ls,useCallback:function(n,e){return Xs().memoizedState=[n,e===void 0?null:e],n},useContext:ls,useEffect:lR,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,kv(4194308,4,AN.bind(null,e,n),t)},useLayoutEffect:function(n,e){return kv(4194308,4,n,e)},useInsertionEffect:function(n,e){return kv(4,2,n,e)},useMemo:function(n,e){var t=Xs();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var r=Xs();return e=t!==void 0?t(e):e,r.memoizedState=r.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},r.queue=n,n=n.dispatch=rX.bind(null,Ln,n),[r.memoizedState,n]},useRef:function(n){var e=Xs();return n={current:n},e.memoizedState=n},useState:aR,useDebugValue:KM,useDeferredValue:function(n){return Xs().memoizedState=n},useTransition:function(){var n=aR(!1),e=n[0];return n=nX.bind(null,n[1]),Xs().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var r=Ln,i=Xs();if(Mn){if(t===void 0)throw Error(Ie(407));t=t()}else{if(t=e(),pr===null)throw Error(Ie(349));Mc&30||_N(r,e,t)}i.memoizedState=t;var s={value:t,getSnapshot:e};return i.queue=s,lR(wN.bind(null,r,s,n),[n]),r.flags|=2048,mp(9,SN.bind(null,r,s,t,e),void 0,null),t},useId:function(){var n=Xs(),e=pr.identifierPrefix;if(Mn){var t=zo,r=Fo;t=(r&~(1<<32-Rs(r)-1)).toString(32)+t,e=":"+e+"R"+t,t=hp++,0")&&(l=l.replace("",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{rS=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?Jf(n):""}function Y9(n){switch(n.tag){case 5:return Jf(n.type);case 16:return Jf("Lazy");case 13:return Jf("Suspense");case 19:return Jf("SuspenseList");case 0:case 2:case 15:return n=iS(n.type,!1),n;case 11:return n=iS(n.type.render,!1),n;case 1:return n=iS(n.type,!0),n;default:return""}}function nw(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case Wu:return"Fragment";case $u:return"Portal";case J1:return"Profiler";case MM:return"StrictMode";case ew:return"Suspense";case tw:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case _D:return(n.displayName||"Context")+".Consumer";case xD:return(n._context.displayName||"Context")+".Provider";case bM:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case TM:return e=n.displayName||null,e!==null?e:nw(n.type)||"Memo";case Aa:e=n._payload,n=n._init;try{return nw(n(e))}catch{}}return null}function Z9(n){var e=n.type;switch(n.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 n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return nw(e);case 8:return e===MM?"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 al(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function wD(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function K9(n){var e=wD(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),r=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var i=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function Qg(n){n._valueTracker||(n._valueTracker=K9(n))}function ED(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),r="";return n&&(r=wD(n)?n.checked?"true":"false":n.value),n=r,n!==t?(e.setValue(n),!0):!1}function h0(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function rw(n,e){var t=e.checked;return Dn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function T2(n,e){var t=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;t=al(e.value!=null?e.value:t),n._wrapperState={initialChecked:r,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function MD(n,e){e=e.checked,e!=null&&EM(n,"checked",e,!1)}function iw(n,e){MD(n,e);var t=al(e.value),r=e.type;if(t!=null)r==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(r==="submit"||r==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?sw(n,e.type,t):e.hasOwnProperty("defaultValue")&&sw(n,e.type,al(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function C2(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function sw(n,e,t){(e!=="number"||h0(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var eh=Array.isArray;function rd(n,e,t,r){if(n=n.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Jg.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function rp(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var uh={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},Q9=["Webkit","ms","Moz","O"];Object.keys(uh).forEach(function(n){Q9.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),uh[e]=uh[n]})});function AD(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||uh.hasOwnProperty(n)&&uh[n]?(""+e).trim():e+"px"}function RD(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var r=t.indexOf("--")===0,i=AD(t,e[t],r);t==="float"&&(t="cssFloat"),r?n.setProperty(t,i):n[t]=i}}var J9=Dn({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 lw(n,e){if(e){if(J9[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Ie(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Ie(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Ie(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Ie(62))}}function cw(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){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 uw=null;function CM(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var dw=null,id=null,sd=null;function P2(n){if(n=Jp(n)){if(typeof dw!="function")throw Error(Ie(280));var e=n.stateNode;e&&(e=Py(e),dw(n.stateNode,n.type,e))}}function PD(n){id?sd?sd.push(n):sd=[n]:id=n}function ID(){if(id){var n=id,e=sd;if(sd=id=null,P2(n),e)for(n=0;n>>=0,n===0?32:31-(uj(n)/dj|0)|0}var ev=64,tv=4194304;function th(n){switch(n&-n){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 n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function v0(n,e){var t=n.pendingLanes;if(t===0)return 0;var r=0,i=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~i;a!==0?r=th(a):(s&=o,s!==0&&(r=th(s)))}else o=t&~i,o!==0?r=th(o):s!==0&&(r=th(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=r;0t;t++)e.push(n);return e}function Kp(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-Ps(e),n[e]=t}function mj(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var r=n.eventTimes;for(n=n.expirationTimes;0=fh),z2=String.fromCharCode(32),B2=!1;function KD(n,e){switch(n){case"keyup":return $j.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function QD(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Gu=!1;function Gj(n,e){switch(n){case"compositionend":return QD(e);case"keypress":return e.which!==32?null:(B2=!0,z2);case"textInput":return n=e.data,n===z2&&B2?null:n;default:return null}}function jj(n,e){if(Gu)return n==="compositionend"||!OM&&KD(n,e)?(n=YD(),Nv=LM=Va=null,Gu=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=r}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=W2(t)}}function nN(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?nN(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function rN(){for(var n=window,e=h0();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=h0(n.document)}return e}function kM(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function tX(n){var e=rN(),t=n.focusedElem,r=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&nN(t.ownerDocument.documentElement,t)){if(r!==null&&kM(t)){if(e=r.start,n=r.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var i=t.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!n.extend&&s>r&&(i=r,r=s,s=i),i=G2(t,s);var o=G2(t,r);i&&o&&(n.rangeCount!==1||n.anchorNode!==i.node||n.anchorOffset!==i.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),n.removeAllRanges(),s>r?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,ju=null,vw=null,ph=null,yw=!1;function j2(n,e,t){var r=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;yw||ju==null||ju!==h0(r)||(r=ju,"selectionStart"in r&&kM(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ph&&cp(ph,r)||(ph=r,r=_0(vw,"onSelect"),0Yu||(n.current=Mw[Yu],Mw[Yu]=null,Yu--)}function mn(n,e){Yu++,Mw[Yu]=n.current,n.current=e}var ll={},$r=vl(ll),hi=vl(!1),Mc=ll;function Nd(n,e){var t=n.type.contextTypes;if(!t)return ll;var r=n.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in t)i[s]=e[s];return r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=i),i}function pi(n){return n=n.childContextTypes,n!=null}function w0(){wn(hi),wn($r)}function J2(n,e,t){if($r.current!==ll)throw Error(Ie(168));mn($r,e),mn(hi,t)}function fN(n,e,t){var r=n.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return t;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(Ie(108,Z9(n)||"Unknown",i));return Dn({},t,r)}function E0(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||ll,Mc=$r.current,mn($r,n),mn(hi,hi.current),!0}function eR(n,e,t){var r=n.stateNode;if(!r)throw Error(Ie(169));t?(n=fN(n,e,Mc),r.__reactInternalMemoizedMergedChildContext=n,wn(hi),wn($r),mn($r,n)):wn(hi),mn(hi,t)}var Lo=null,Iy=!1,yS=!1;function hN(n){Lo===null?Lo=[n]:Lo.push(n)}function hX(n){Iy=!0,hN(n)}function yl(){if(!yS&&Lo!==null){yS=!0;var n=0,e=cn;try{var t=Lo;for(cn=1;n>=o,i-=o,zo=1<<32-Ps(e)+i|t<D?(V=P,P=null):V=P.sibling;var C=p(g,P,_[D],b);if(C===null){P===null&&(P=V);break}n&&P&&C.alternate===null&&e(g,P),S=s(C,S,D),R===null?A=C:R.sibling=C,R=C,P=V}if(D===_.length)return t(g,P),Mn&&Hl(g,D),A;if(P===null){for(;D<_.length;D++)P=h(g,_[D],b),P!==null&&(S=s(P,S,D),R===null?A=P:R.sibling=P,R=P);return Mn&&Hl(g,D),A}for(P=r(g,P);D<_.length;D++)V=m(P,g,D,_[D],b),V!==null&&(n&&V.alternate!==null&&P.delete(V.key===null?D:V.key),S=s(V,S,D),R===null?A=V:R.sibling=V,R=V);return n&&P.forEach(function(L){return e(g,L)}),Mn&&Hl(g,D),A}function w(g,S,_,b){var A=$f(_);if(typeof A!="function")throw Error(Ie(150));if(_=A.call(_),_==null)throw Error(Ie(151));for(var R=A=null,P=S,D=S=0,V=null,C=_.next();P!==null&&!C.done;D++,C=_.next()){P.index>D?(V=P,P=null):V=P.sibling;var L=p(g,P,C.value,b);if(L===null){P===null&&(P=V);break}n&&P&&L.alternate===null&&e(g,P),S=s(L,S,D),R===null?A=L:R.sibling=L,R=L,P=V}if(C.done)return t(g,P),Mn&&Hl(g,D),A;if(P===null){for(;!C.done;D++,C=_.next())C=h(g,C.value,b),C!==null&&(S=s(C,S,D),R===null?A=C:R.sibling=C,R=C);return Mn&&Hl(g,D),A}for(P=r(g,P);!C.done;D++,C=_.next())C=m(P,g,D,C.value,b),C!==null&&(n&&C.alternate!==null&&P.delete(C.key===null?D:C.key),S=s(C,S,D),R===null?A=C:R.sibling=C,R=C);return n&&P.forEach(function(W){return e(g,W)}),Mn&&Hl(g,D),A}function x(g,S,_,b){if(typeof _=="object"&&_!==null&&_.type===Wu&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Kg:e:{for(var A=_.key,R=S;R!==null;){if(R.key===A){if(A=_.type,A===Wu){if(R.tag===7){t(g,R.sibling),S=i(R,_.props.children),S.return=g,g=S;break e}}else if(R.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Aa&&aR(A)===R.type){t(g,R.sibling),S=i(R,_.props),S.ref=qf(g,R,_),S.return=g,g=S;break e}t(g,R);break}else e(g,R);R=R.sibling}_.type===Wu?(S=gc(_.props.children,g.mode,b,_.key),S.return=g,g=S):(b=Hv(_.type,_.key,_.props,null,g.mode,b),b.ref=qf(g,S,_),b.return=g,g=b)}return o(g);case $u:e:{for(R=_.key;S!==null;){if(S.key===R)if(S.tag===4&&S.stateNode.containerInfo===_.containerInfo&&S.stateNode.implementation===_.implementation){t(g,S.sibling),S=i(S,_.children||[]),S.return=g,g=S;break e}else{t(g,S);break}else e(g,S);S=S.sibling}S=TS(_,g.mode,b),S.return=g,g=S}return o(g);case Aa:return R=_._init,x(g,S,R(_._payload),b)}if(eh(_))return v(g,S,_,b);if($f(_))return w(g,S,_,b);lv(g,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,S!==null&&S.tag===6?(t(g,S.sibling),S=i(S,_),S.return=g,g=S):(t(g,S),S=bS(_,g.mode,b),S.return=g,g=S),o(g)):t(g,S)}return x}var kd=SN(!0),wN=SN(!1),em={},uo=vl(em),hp=vl(em),pp=vl(em);function ec(n){if(n===em)throw Error(Ie(174));return n}function GM(n,e){switch(mn(pp,e),mn(hp,n),mn(uo,em),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:aw(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=aw(e,n)}wn(uo),mn(uo,e)}function Ud(){wn(uo),wn(hp),wn(pp)}function EN(n){ec(pp.current);var e=ec(uo.current),t=aw(e,n.type);e!==t&&(mn(hp,n),mn(uo,t))}function jM(n){hp.current===n&&(wn(uo),wn(hp))}var An=vl(0);function R0(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var xS=[];function XM(){for(var n=0;nt?t:4,n(!0);var r=_S.transition;_S.transition={};try{n(!1),e()}finally{cn=t,_S.transition=r}}function zN(){return cs().memoizedState}function vX(n,e,t){var r=Qa(n);if(t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},BN(n))VN(e,t);else if(t=vN(n,e,t,r),t!==null){var i=Jr();Is(t,n,r,i),HN(t,e,r)}}function yX(n,e,t){var r=Qa(n),i={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(BN(n))VN(e,i);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);if(i.hasEagerState=!0,i.eagerState=a,Ds(a,o)){var l=e.interleaved;l===null?(i.next=i,$M(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}t=vN(n,e,i,r),t!==null&&(i=Jr(),Is(t,n,r,i),HN(t,e,r))}}function BN(n){var e=n.alternate;return n===Ln||e!==null&&e===Ln}function VN(n,e){mh=P0=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function HN(n,e,t){if(t&4194240){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,RM(n,t)}}var I0={readContext:ls,useCallback:Dr,useContext:Dr,useEffect:Dr,useImperativeHandle:Dr,useInsertionEffect:Dr,useLayoutEffect:Dr,useMemo:Dr,useReducer:Dr,useRef:Dr,useState:Dr,useDebugValue:Dr,useDeferredValue:Dr,useTransition:Dr,useMutableSource:Dr,useSyncExternalStore:Dr,useId:Dr,unstable_isNewReconciler:!1},xX={readContext:ls,useCallback:function(n,e){return qs().memoizedState=[n,e===void 0?null:e],n},useContext:ls,useEffect:cR,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,Fv(4194308,4,NN.bind(null,e,n),t)},useLayoutEffect:function(n,e){return Fv(4194308,4,n,e)},useInsertionEffect:function(n,e){return Fv(4,2,n,e)},useMemo:function(n,e){var t=qs();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var r=qs();return e=t!==void 0?t(e):e,r.memoizedState=r.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},r.queue=n,n=n.dispatch=vX.bind(null,Ln,n),[r.memoizedState,n]},useRef:function(n){var e=qs();return n={current:n},e.memoizedState=n},useState:lR,useDebugValue:QM,useDeferredValue:function(n){return qs().memoizedState=n},useTransition:function(){var n=lR(!1),e=n[0];return n=gX.bind(null,n[1]),qs().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var r=Ln,i=qs();if(Mn){if(t===void 0)throw Error(Ie(407));t=t()}else{if(t=e(),pr===null)throw Error(Ie(349));Tc&30||TN(r,e,t)}i.memoizedState=t;var s={value:t,getSnapshot:e};return i.queue=s,cR(AN.bind(null,r,s,n),[n]),r.flags|=2048,vp(9,CN.bind(null,r,s,t,e),void 0,null),t},useId:function(){var n=qs(),e=pr.identifierPrefix;if(Mn){var t=Bo,r=zo;t=(r&~(1<<32-Ps(r)-1)).toString(32)+t,e=":"+e+"R"+t,t=mp++,0<\/script>",n=n.removeChild(n.firstChild)):typeof r.is=="string"?n=o.createElement(t,{is:r.is}):(n=o.createElement(t),t==="select"&&(o=n,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):n=o.createElementNS(n,t),n[eo]=e,n[up]=r,GN(n,e,!1,!1),e.stateNode=n;e:{switch(o=aw(t,r),t){case"dialog":yn("cancel",n),yn("close",n),i=r;break;case"iframe":case"object":case"embed":yn("load",n),i=r;break;case"video":case"audio":for(i=0;iUd&&(e.flags|=128,r=!0,Xf(s,!1),e.lanes=4194304)}else{if(!r)if(n=C0(o),n!==null){if(e.flags|=128,r=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Xf(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Mn)return Nr(e),null}else 2*jn()-s.renderingStartTime>Ud&&t!==1073741824&&(e.flags|=128,r=!0,Xf(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=jn(),e.sibling=null,t=An.current,mn(An,r?t&1|2:t&1),e):(Nr(e),null);case 22:case 23:return rb(),r=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Ci&1073741824&&(Nr(e),e.subtreeFlags&6&&(e.flags|=8192)):Nr(e),null;case 24:return null;case 25:return null}throw Error(Ie(156,e.tag))}function hX(n,e){switch(UM(e),e.tag){case 1:return pi(e.type)&&_0(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Od(),_n(hi),_n($r),jM(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return GM(e),null;case 13:if(_n(An),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Ie(340));Dd()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return _n(An),null;case 4:return Od(),null;case 10:return VM(e.type._context),null;case 22:case 23:return rb(),null;case 24:return null;default:return null}}var lv=!1,kr=!1,pX=typeof WeakSet=="function"?WeakSet:Set,Je=null;function Ku(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(r){Un(n,e,r)}else t.current=null}function Nw(n,e,t){try{t()}catch(r){Un(n,e,r)}}var vR=!1;function mX(n,e){if(vw=g0,n=KD(),OM(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var r=t.getSelection&&t.getSelection();if(r&&r.rangeCount!==0){t=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,a=-1,l=-1,u=0,f=0,h=n,p=null;t:for(;;){for(var m;h!==t||i!==0&&h.nodeType!==3||(a=o+i),h!==s||r!==0&&h.nodeType!==3||(l=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(m=h.firstChild)!==null;)p=h,h=m;for(;;){if(h===n)break t;if(p===t&&++u===i&&(a=o),p===s&&++f===r&&(l=o),(m=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=m}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(yw={focusedElem:n,selectionRange:t},g0=!1,Je=e;Je!==null;)if(e=Je,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,Je=n;else for(;Je!==null;){e=Je;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var w=v.memoizedProps,x=v.memoizedState,g=e.stateNode,S=g.getSnapshotBeforeUpdate(e.elementType===e.type?w:Ss(e.type,w),x);g.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var _=e.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ie(163))}}catch(b){Un(e,e.return,b)}if(n=e.sibling,n!==null){n.return=e.return,Je=n;break}Je=e.return}return v=vR,vR=!1,v}function ph(n,e,t){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&n)===n){var s=i.destroy;i.destroy=void 0,s!==void 0&&Nw(e,t,s)}i=i.next}while(i!==r)}}function Ly(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var r=t.create;t.destroy=r()}t=t.next}while(t!==e)}}function Ow(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function qN(n){var e=n.alternate;e!==null&&(n.alternate=null,qN(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[eo],delete e[up],delete e[Sw],delete e[Kj],delete e[Qj])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function YN(n){return n.tag===5||n.tag===3||n.tag===4}function yR(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||YN(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function kw(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=x0));else if(r!==4&&(n=n.child,n!==null))for(kw(n,e,t),n=n.sibling;n!==null;)kw(n,e,t),n=n.sibling}function Uw(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(r!==4&&(n=n.child,n!==null))for(Uw(n,e,t),n=n.sibling;n!==null;)Uw(n,e,t),n=n.sibling}var _r=null,Es=!1;function Ea(n,e,t){for(t=t.child;t!==null;)ZN(n,e,t),t=t.sibling}function ZN(n,e,t){if(lo&&typeof lo.onCommitFiberUnmount=="function")try{lo.onCommitFiberUnmount(My,t)}catch{}switch(t.tag){case 5:kr||Ku(t,e);case 6:var r=_r,i=Es;_r=null,Ea(n,e,t),_r=r,Es=i,_r!==null&&(Es?(n=_r,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):_r.removeChild(t.stateNode));break;case 18:_r!==null&&(Es?(n=_r,t=t.stateNode,n.nodeType===8?mS(n.parentNode,t):n.nodeType===1&&mS(n,t),sp(n)):mS(_r,t.stateNode));break;case 4:r=_r,i=Es,_r=t.stateNode.containerInfo,Es=!0,Ea(n,e,t),_r=r,Es=i;break;case 0:case 11:case 14:case 15:if(!kr&&(r=t.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Nw(t,e,o),i=i.next}while(i!==r)}Ea(n,e,t);break;case 1:if(!kr&&(Ku(t,e),r=t.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(a){Un(t,e,a)}Ea(n,e,t);break;case 21:Ea(n,e,t);break;case 22:t.mode&1?(kr=(r=kr)||t.memoizedState!==null,Ea(n,e,t),kr=r):Ea(n,e,t);break;default:Ea(n,e,t)}}function xR(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new pX),e.forEach(function(r){var i=MX.bind(null,n,r);t.has(r)||(t.add(r),r.then(i,i))})}}function xs(n,e){var t=e.deletions;if(t!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=jn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*vX(r/1960))-r,10n?16:n,Va===null)var r=!1;else{if(n=Va,Va=null,L0=0,Jt&6)throw Error(Ie(331));var i=Jt;for(Jt|=4,Je=n.current;Je!==null;){var s=Je,o=s.child;if(Je.flags&16){var a=s.deletions;if(a!==null){for(var l=0;ljn()-tb?hc(n,0):eb|=t),mi(n,e)}function iO(n,e){e===0&&(n.mode&1?(e=Jg,Jg<<=1,!(Jg&130023424)&&(Jg=4194304)):e=1);var t=Jr();n=Yo(n,e),n!==null&&(Yp(n,e,t),mi(n,t))}function EX(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),iO(n,t)}function MX(n,e){var t=0;switch(n.tag){case 13:var r=n.stateNode,i=n.memoizedState;i!==null&&(t=i.retryLane);break;case 19:r=n.stateNode;break;default:throw Error(Ie(314))}r!==null&&r.delete(e),iO(n,t)}var sO;sO=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||hi.current)fi=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return fi=!1,dX(n,e,t);fi=!!(n.flags&131072)}else fi=!1,Mn&&e.flags&1048576&&lN(e,E0,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Uv(n,e),n=e.pendingProps;var i=Ld(e,$r.current);sd(e,t),i=qM(null,e,r,n,i,t);var s=YM();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,pi(r)?(s=!0,S0(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,$M(e),i.updater=Py,e.stateNode=i,i._reactInternals=e,Cw(e,r,n,t),e=Pw(null,e,r,!0,s,t)):(e.tag=0,Mn&&s&&kM(e),Yr(null,e,i,t),e=e.child),e;case 16:r=e.elementType;e:{switch(Uv(n,e),n=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=TX(r),n=Ss(r,n),i){case 0:e=Rw(null,e,r,n,t);break e;case 1:e=pR(null,e,r,n,t);break e;case 11:e=fR(null,e,r,n,t);break e;case 14:e=hR(null,e,r,Ss(r.type,n),t);break e}throw Error(Ie(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ss(r,i),Rw(n,e,r,i,t);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ss(r,i),pR(n,e,r,i,t);case 3:e:{if(HN(e),n===null)throw Error(Ie(387));r=e.pendingProps,s=e.memoizedState,i=s.element,fN(n,e),T0(e,r,null,t);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=kd(Error(Ie(423)),e),e=mR(n,e,r,t,i);break e}else if(r!==i){i=kd(Error(Ie(424)),e),e=mR(n,e,r,t,i);break e}else for(Ii=qa(e.stateNode.containerInfo.firstChild),Di=e,Mn=!0,bs=null,t=gN(e,null,r,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Dd(),r===i){e=Zo(n,e,t);break e}Yr(n,e,r,t)}e=e.child}return e;case 5:return vN(e),n===null&&Mw(e),r=e.type,i=e.pendingProps,s=n!==null?n.memoizedProps:null,o=i.children,xw(r,i)?o=null:s!==null&&xw(r,s)&&(e.flags|=32),VN(n,e),Yr(n,e,o,t),e.child;case 6:return n===null&&Mw(e),null;case 13:return $N(n,e,t);case 4:return WM(e,e.stateNode.containerInfo),r=e.pendingProps,n===null?e.child=Nd(e,null,r,t):Yr(n,e,r,t),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ss(r,i),fR(n,e,r,i,t);case 7:return Yr(n,e,e.pendingProps,t),e.child;case 8:return Yr(n,e,e.pendingProps.children,t),e.child;case 12:return Yr(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,mn(M0,r._currentValue),r._currentValue=o,s!==null)if(Ls(s.value,o)){if(s.children===i.children&&!hi.current){e=Zo(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=Ho(-1,t&-t),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),bw(s.return,t,e),a.lanes|=t;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Ie(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),bw(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Yr(n,e,i.children,t),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,sd(e,t),i=ls(i),r=r(i),e.flags|=1,Yr(n,e,r,t),e.child;case 14:return r=e.type,i=Ss(r,e.pendingProps),i=Ss(r.type,i),hR(n,e,r,i,t);case 15:return zN(n,e,e.type,e.pendingProps,t);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ss(r,i),Uv(n,e),e.tag=1,pi(r)?(n=!0,S0(e)):n=!1,sd(e,t),pN(e,r,i),Cw(e,r,i,t),Pw(null,e,r,!0,n,t);case 19:return WN(n,e,t);case 22:return BN(n,e,t)}throw Error(Ie(156,e.tag))};function oO(n,e){return LD(n,e)}function bX(n,e,t,r){this.tag=n,this.key=t,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ss(n,e,t,r){return new bX(n,e,t,r)}function sb(n){return n=n.prototype,!(!n||!n.isReactComponent)}function TX(n){if(typeof n=="function")return sb(n)?1:0;if(n!=null){if(n=n.$$typeof,n===MM)return 11;if(n===bM)return 14}return 2}function Qa(n,e){var t=n.alternate;return t===null?(t=ss(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function Bv(n,e,t,r,i,s){var o=2;if(r=n,typeof n=="function")sb(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case Hu:return pc(t.children,i,s,e);case EM:o=8,i|=8;break;case K1:return n=ss(12,t,e,i|2),n.elementType=K1,n.lanes=s,n;case Q1:return n=ss(13,t,e,i),n.elementType=Q1,n.lanes=s,n;case J1:return n=ss(19,t,e,i),n.elementType=J1,n.lanes=s,n;case mD:return Ny(t,i,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case hD:o=10;break e;case pD:o=9;break e;case MM:o=11;break e;case bM:o=14;break e;case Ca:o=16,r=null;break e}throw Error(Ie(130,n==null?n:typeof n,""))}return e=ss(o,t,e,i),e.elementType=n,e.type=r,e.lanes=s,e}function pc(n,e,t,r){return n=ss(7,n,r,e),n.lanes=t,n}function Ny(n,e,t,r){return n=ss(22,n,r,e),n.elementType=mD,n.lanes=t,n.stateNode={isHidden:!1},n}function ES(n,e,t){return n=ss(6,n,null,e),n.lanes=t,n}function MS(n,e,t){return e=ss(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function CX(n,e,t,r,i){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=iS(0),this.expirationTimes=iS(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=iS(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function ob(n,e,t,r,i,s,o,a,l){return n=new CX(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=ss(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},$M(s),n}function AX(n,e,t){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(uO)}catch(n){console.error(n)}}uO(),lD.exports=Ui;var Vc=lD.exports;const dO=Dp(Vc);var fO,CR=Vc;fO=CR.createRoot,CR.hydrateRoot;function DX(n){return function(e){n.forEach(function(t){typeof t=="function"?t(e):t!=null&&(t.current=e)})}}var NX=Object.defineProperty,OX=(n,e,t)=>e in n?NX(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Et=(n,e,t)=>(OX(n,typeof e!="symbol"?e+"":e,t),t);const dv=new Pc,AR=new Qs,kX=Math.cos(70*(Math.PI/180)),RR=(n,e)=>(n%e+e)%e;let UX=class extends po{constructor(e,t){super(),Et(this,"object"),Et(this,"domElement"),Et(this,"enabled",!0),Et(this,"target",new F),Et(this,"minDistance",0),Et(this,"maxDistance",1/0),Et(this,"minZoom",0),Et(this,"maxZoom",1/0),Et(this,"minPolarAngle",0),Et(this,"maxPolarAngle",Math.PI),Et(this,"minAzimuthAngle",-1/0),Et(this,"maxAzimuthAngle",1/0),Et(this,"enableDamping",!1),Et(this,"dampingFactor",.05),Et(this,"enableZoom",!0),Et(this,"zoomSpeed",1),Et(this,"enableRotate",!0),Et(this,"rotateSpeed",1),Et(this,"enablePan",!0),Et(this,"panSpeed",1),Et(this,"screenSpacePanning",!0),Et(this,"keyPanSpeed",7),Et(this,"zoomToCursor",!1),Et(this,"autoRotate",!1),Et(this,"autoRotateSpeed",2),Et(this,"reverseOrbit",!1),Et(this,"reverseHorizontalOrbit",!1),Et(this,"reverseVerticalOrbit",!1),Et(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Et(this,"mouseButtons",{LEFT:Ul.ROTATE,MIDDLE:Ul.DOLLY,RIGHT:Ul.PAN}),Et(this,"touches",{ONE:Fl.ROTATE,TWO:Fl.DOLLY_PAN}),Et(this,"target0"),Et(this,"position0"),Et(this,"zoom0"),Et(this,"_domElementKeyEvents",null),Et(this,"getPolarAngle"),Et(this,"getAzimuthalAngle"),Et(this,"setPolarAngle"),Et(this,"setAzimuthalAngle"),Et(this,"getDistance"),Et(this,"listenToKeyEvents"),Et(this,"stopListenToKeyEvents"),Et(this,"saveState"),Et(this,"reset"),Et(this,"update"),Et(this,"connect"),Et(this,"dispose"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>f.phi,this.getAzimuthalAngle=()=>f.theta,this.setPolarAngle=Z=>{let Se=RR(Z,2*Math.PI),$e=f.phi;$e<0&&($e+=2*Math.PI),Se<0&&(Se+=2*Math.PI);let je=Math.abs(Se-$e);2*Math.PI-je{let Se=RR(Z,2*Math.PI),$e=f.theta;$e<0&&($e+=2*Math.PI),Se<0&&(Se+=2*Math.PI);let je=Math.abs(Se-$e);2*Math.PI-jer.object.position.distanceTo(r.target),this.listenToKeyEvents=Z=>{Z.addEventListener("keydown",st),this._domElementKeyEvents=Z},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",st),this._domElementKeyEvents=null},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(i),r.update(),l=a.NONE},this.update=(()=>{const Z=new F,Se=new F(0,1,0),$e=new Br().setFromUnitVectors(e.up,Se),je=$e.clone().invert(),St=new F,G=new Br,Pe=2*Math.PI;return function(){const nt=r.object.position;$e.setFromUnitVectors(e.up,Se),je.copy($e).invert(),Z.copy(nt).sub(r.target),Z.applyQuaternion($e),f.setFromVector3(Z),r.autoRotate&&l===a.NONE&&z(W()),r.enableDamping?(f.theta+=h.theta*r.dampingFactor,f.phi+=h.phi*r.dampingFactor):(f.theta+=h.theta,f.phi+=h.phi);let rt=r.minAzimuthAngle,Ft=r.maxAzimuthAngle;isFinite(rt)&&isFinite(Ft)&&(rt<-Math.PI?rt+=Pe:rt>Math.PI&&(rt-=Pe),Ft<-Math.PI?Ft+=Pe:Ft>Math.PI&&(Ft-=Pe),rt<=Ft?f.theta=Math.max(rt,Math.min(Ft,f.theta)):f.theta=f.theta>(rt+Ft)/2?Math.max(rt,f.theta):Math.min(Ft,f.theta)),f.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,f.phi)),f.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(m,r.dampingFactor):r.target.add(m),r.zoomToCursor&&V||r.object.isOrthographicCamera?f.radius=se(f.radius):f.radius=se(f.radius*p),Z.setFromSpherical(f),Z.applyQuaternion(je),nt.copy(r.target).add(Z),r.object.matrixAutoUpdate||r.object.updateMatrix(),r.object.lookAt(r.target),r.enableDamping===!0?(h.theta*=1-r.dampingFactor,h.phi*=1-r.dampingFactor,m.multiplyScalar(1-r.dampingFactor)):(h.set(0,0,0),m.set(0,0,0));let Yt=!1;if(r.zoomToCursor&&V){let hn=null;if(r.object instanceof Rn&&r.object.isPerspectiveCamera){const Bn=Z.length();hn=se(Bn*p);const Kt=Bn-hn;r.object.position.addScaledVector(P,Kt),r.object.updateMatrixWorld()}else if(r.object.isOrthographicCamera){const Bn=new F(D.x,D.y,0);Bn.unproject(r.object),r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/p)),r.object.updateProjectionMatrix(),Yt=!0;const Kt=new F(D.x,D.y,0);Kt.unproject(r.object),r.object.position.sub(Kt).add(Bn),r.object.updateMatrixWorld(),hn=Z.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;hn!==null&&(r.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(hn).add(r.object.position):(dv.origin.copy(r.object.position),dv.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(dv.direction))u||8*(1-G.dot(r.object.quaternion))>u?(r.dispatchEvent(i),St.copy(r.object.position),G.copy(r.object.quaternion),Yt=!1,!0):!1}})(),this.connect=Z=>{Z===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),r.domElement=Z,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",Nt),r.domElement.addEventListener("pointerdown",ie),r.domElement.addEventListener("pointercancel",_e),r.domElement.addEventListener("wheel",He)},this.dispose=()=>{var Z,Se,$e,je,St,G;(Z=r.domElement)==null||Z.removeEventListener("contextmenu",Nt),(Se=r.domElement)==null||Se.removeEventListener("pointerdown",ie),($e=r.domElement)==null||$e.removeEventListener("pointercancel",_e),(je=r.domElement)==null||je.removeEventListener("wheel",He),(St=r.domElement)==null||St.ownerDocument.removeEventListener("pointermove",be),(G=r.domElement)==null||G.ownerDocument.removeEventListener("pointerup",we),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",st)};const r=this,i={type:"change"},s={type:"start"},o={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=a.NONE;const u=1e-6,f=new Zv,h=new Zv;let p=1;const m=new F,v=new ge,w=new ge,x=new ge,g=new ge,S=new ge,_=new ge,b=new ge,A=new ge,R=new ge,P=new F,D=new ge;let V=!1;const C=[],L={};function W(){return 2*Math.PI/60/60*r.autoRotateSpeed}function Q(){return Math.pow(.95,r.zoomSpeed)}function z(Z){r.reverseOrbit||r.reverseHorizontalOrbit?h.theta+=Z:h.theta-=Z}function j(Z){r.reverseOrbit||r.reverseVerticalOrbit?h.phi+=Z:h.phi-=Z}const Y=(()=>{const Z=new F;return function($e,je){Z.setFromMatrixColumn(je,0),Z.multiplyScalar(-$e),m.add(Z)}})(),re=(()=>{const Z=new F;return function($e,je){r.screenSpacePanning===!0?Z.setFromMatrixColumn(je,1):(Z.setFromMatrixColumn(je,0),Z.crossVectors(r.object.up,Z)),Z.multiplyScalar($e),m.add(Z)}})(),U=(()=>{const Z=new F;return function($e,je){const St=r.domElement;if(St&&r.object instanceof Rn&&r.object.isPerspectiveCamera){const G=r.object.position;Z.copy(G).sub(r.target);let Pe=Z.length();Pe*=Math.tan(r.object.fov/2*Math.PI/180),Y(2*$e*Pe/St.clientHeight,r.object.matrix),re(2*je*Pe/St.clientHeight,r.object.matrix)}else St&&r.object instanceof Oo&&r.object.isOrthographicCamera?(Y($e*(r.object.right-r.object.left)/r.object.zoom/St.clientWidth,r.object.matrix),re(je*(r.object.top-r.object.bottom)/r.object.zoom/St.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function X(Z){r.object instanceof Rn&&r.object.isPerspectiveCamera||r.object instanceof Oo&&r.object.isOrthographicCamera?p/=Z:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function q(Z){r.object instanceof Rn&&r.object.isPerspectiveCamera||r.object instanceof Oo&&r.object.isOrthographicCamera?p*=Z:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function K(Z){if(!r.zoomToCursor||!r.domElement)return;V=!0;const Se=r.domElement.getBoundingClientRect(),$e=Z.clientX-Se.left,je=Z.clientY-Se.top,St=Se.width,G=Se.height;D.x=$e/St*2-1,D.y=-(je/G)*2+1,P.set(D.x,D.y,1).unproject(r.object).sub(r.object.position).normalize()}function se(Z){return Math.max(r.minDistance,Math.min(r.maxDistance,Z))}function ve(Z){v.set(Z.clientX,Z.clientY)}function te(Z){K(Z),b.set(Z.clientX,Z.clientY)}function le(Z){g.set(Z.clientX,Z.clientY)}function Me(Z){w.set(Z.clientX,Z.clientY),x.subVectors(w,v).multiplyScalar(r.rotateSpeed);const Se=r.domElement;Se&&(z(2*Math.PI*x.x/Se.clientHeight),j(2*Math.PI*x.y/Se.clientHeight)),v.copy(w),r.update()}function pe(Z){A.set(Z.clientX,Z.clientY),R.subVectors(A,b),R.y>0?X(Q()):R.y<0&&q(Q()),b.copy(A),r.update()}function Ae(Z){S.set(Z.clientX,Z.clientY),_.subVectors(S,g).multiplyScalar(r.panSpeed),U(_.x,_.y),g.copy(S),r.update()}function De(Z){K(Z),Z.deltaY<0?q(Q()):Z.deltaY>0&&X(Q()),r.update()}function Re(Z){let Se=!1;switch(Z.code){case r.keys.UP:U(0,r.keyPanSpeed),Se=!0;break;case r.keys.BOTTOM:U(0,-r.keyPanSpeed),Se=!0;break;case r.keys.LEFT:U(r.keyPanSpeed,0),Se=!0;break;case r.keys.RIGHT:U(-r.keyPanSpeed,0),Se=!0;break}Se&&(Z.preventDefault(),r.update())}function Ce(){if(C.length==1)v.set(C[0].pageX,C[0].pageY);else{const Z=.5*(C[0].pageX+C[1].pageX),Se=.5*(C[0].pageY+C[1].pageY);v.set(Z,Se)}}function H(){if(C.length==1)g.set(C[0].pageX,C[0].pageY);else{const Z=.5*(C[0].pageX+C[1].pageX),Se=.5*(C[0].pageY+C[1].pageY);g.set(Z,Se)}}function xe(){const Z=C[0].pageX-C[1].pageX,Se=C[0].pageY-C[1].pageY,$e=Math.sqrt(Z*Z+Se*Se);b.set(0,$e)}function de(){r.enableZoom&&xe(),r.enablePan&&H()}function Te(){r.enableZoom&&xe(),r.enableRotate&&Ce()}function ye(Z){if(C.length==1)w.set(Z.pageX,Z.pageY);else{const $e=Le(Z),je=.5*(Z.pageX+$e.x),St=.5*(Z.pageY+$e.y);w.set(je,St)}x.subVectors(w,v).multiplyScalar(r.rotateSpeed);const Se=r.domElement;Se&&(z(2*Math.PI*x.x/Se.clientHeight),j(2*Math.PI*x.y/Se.clientHeight)),v.copy(w)}function Xe(Z){if(C.length==1)S.set(Z.pageX,Z.pageY);else{const Se=Le(Z),$e=.5*(Z.pageX+Se.x),je=.5*(Z.pageY+Se.y);S.set($e,je)}_.subVectors(S,g).multiplyScalar(r.panSpeed),U(_.x,_.y),g.copy(S)}function ze(Z){const Se=Le(Z),$e=Z.pageX-Se.x,je=Z.pageY-Se.y,St=Math.sqrt($e*$e+je*je);A.set(0,St),R.set(0,Math.pow(A.y/b.y,r.zoomSpeed)),X(R.y),b.copy(A)}function k(Z){r.enableZoom&&ze(Z),r.enablePan&&Xe(Z)}function O(Z){r.enableZoom&&ze(Z),r.enableRotate&&ye(Z)}function ie(Z){var Se,$e;r.enabled!==!1&&(C.length===0&&((Se=r.domElement)==null||Se.ownerDocument.addEventListener("pointermove",be),($e=r.domElement)==null||$e.ownerDocument.addEventListener("pointerup",we)),wt(Z),Z.pointerType==="touch"?mt(Z):Ke(Z))}function be(Z){r.enabled!==!1&&(Z.pointerType==="touch"?Ee(Z):Fe(Z))}function we(Z){var Se,$e,je;ft(Z),C.length===0&&((Se=r.domElement)==null||Se.releasePointerCapture(Z.pointerId),($e=r.domElement)==null||$e.ownerDocument.removeEventListener("pointermove",be),(je=r.domElement)==null||je.ownerDocument.removeEventListener("pointerup",we)),r.dispatchEvent(o),l=a.NONE}function _e(Z){ft(Z)}function Ke(Z){let Se;switch(Z.button){case 0:Se=r.mouseButtons.LEFT;break;case 1:Se=r.mouseButtons.MIDDLE;break;case 2:Se=r.mouseButtons.RIGHT;break;default:Se=-1}switch(Se){case Ul.DOLLY:if(r.enableZoom===!1)return;te(Z),l=a.DOLLY;break;case Ul.ROTATE:if(Z.ctrlKey||Z.metaKey||Z.shiftKey){if(r.enablePan===!1)return;le(Z),l=a.PAN}else{if(r.enableRotate===!1)return;ve(Z),l=a.ROTATE}break;case Ul.PAN:if(Z.ctrlKey||Z.metaKey||Z.shiftKey){if(r.enableRotate===!1)return;ve(Z),l=a.ROTATE}else{if(r.enablePan===!1)return;le(Z),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&r.dispatchEvent(s)}function Fe(Z){if(r.enabled!==!1)switch(l){case a.ROTATE:if(r.enableRotate===!1)return;Me(Z);break;case a.DOLLY:if(r.enableZoom===!1)return;pe(Z);break;case a.PAN:if(r.enablePan===!1)return;Ae(Z);break}}function He(Z){r.enabled===!1||r.enableZoom===!1||l!==a.NONE&&l!==a.ROTATE||(Z.preventDefault(),r.dispatchEvent(s),De(Z),r.dispatchEvent(o))}function st(Z){r.enabled===!1||r.enablePan===!1||Re(Z)}function mt(Z){switch(it(Z),C.length){case 1:switch(r.touches.ONE){case Fl.ROTATE:if(r.enableRotate===!1)return;Ce(),l=a.TOUCH_ROTATE;break;case Fl.PAN:if(r.enablePan===!1)return;H(),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(r.touches.TWO){case Fl.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;de(),l=a.TOUCH_DOLLY_PAN;break;case Fl.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;Te(),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&r.dispatchEvent(s)}function Ee(Z){switch(it(Z),l){case a.TOUCH_ROTATE:if(r.enableRotate===!1)return;ye(Z),r.update();break;case a.TOUCH_PAN:if(r.enablePan===!1)return;Xe(Z),r.update();break;case a.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;k(Z),r.update();break;case a.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;O(Z),r.update();break;default:l=a.NONE}}function Nt(Z){r.enabled!==!1&&Z.preventDefault()}function wt(Z){C.push(Z)}function ft(Z){delete L[Z.pointerId];for(let Se=0;SeparseInt(Op.replace(/\D+/g,"")),zX=FX(),BX=M.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:r,enableDamping:i=!0,keyEvents:s=!1,onChange:o,onStart:a,onEnd:l,...u},f)=>{const h=Ti(R=>R.invalidate),p=Ti(R=>R.camera),m=Ti(R=>R.gl),v=Ti(R=>R.events),w=Ti(R=>R.setEvents),x=Ti(R=>R.set),g=Ti(R=>R.get),S=Ti(R=>R.performance),_=e||p,b=r||v.connected||m.domElement,A=M.useMemo(()=>new UX(_),[_]);return Fc(()=>{A.enabled&&A.update()},-1),M.useEffect(()=>(s&&A.connect(s===!0?b:s),A.connect(b),()=>void A.dispose()),[s,b,t,A,h]),M.useEffect(()=>{const R=V=>{h(),t&&S.regress(),o&&o(V)},P=V=>{a&&a(V)},D=V=>{l&&l(V)};return A.addEventListener("change",R),A.addEventListener("start",P),A.addEventListener("end",D),()=>{A.removeEventListener("start",P),A.removeEventListener("end",D),A.removeEventListener("change",R)}},[o,a,l,A,h,w]),M.useEffect(()=>{if(n){const R=g().controls;return x({controls:A}),()=>x({controls:R})}},[n,A]),M.createElement("primitive",Ue({ref:f,object:A,enableDamping:i},u))});class VX extends as{constructor(e=new ge){super({uniforms:{inputBuffer:new Or(null),depthBuffer:new Or(null),resolution:new Or(new ge),texelSize:new Or(new ge),halfTexelSize:new Or(new ge),kernel:new Or(0),scale:new Or(1),cameraNear:new Or(0),cameraFar:new Or(1),minDepthThreshold:new Or(0),maxDepthThreshold:new Or(1),depthScale:new Or(0),depthToBlurRatioBias:new Or(.25)},fragmentShader:`#include +`+s.stack}return{value:n,source:e,stack:i,digest:null}}function ES(n,e,t){return{value:n,source:null,stack:t??null,digest:e??null}}function Pw(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var wX=typeof WeakMap=="function"?WeakMap:Map;function $N(n,e,t){t=$o(-1,t),t.tag=3,t.payload={element:null};var r=e.value;return t.callback=function(){D0||(D0=!0,Bw=r),Pw(n,e)},t}function WN(n,e,t){t=$o(-1,t),t.tag=3;var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;t.payload=function(){return r(i)},t.callback=function(){Pw(n,e)}}var s=n.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(t.callback=function(){Pw(n,e),typeof r!="function"&&(Ka===null?Ka=new Set([this]):Ka.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),t}function uR(n,e,t){var r=n.pingCache;if(r===null){r=n.pingCache=new wX;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(t)||(i.add(t),n=kX.bind(null,n,e,t),e.then(n,n))}function dR(n){do{var e;if((e=n.tag===13)&&(e=n.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return n;n=n.return}while(n!==null);return null}function fR(n,e,t,r,i){return n.mode&1?(n.flags|=65536,n.lanes=i,n):(n===e?n.flags|=65536:(n.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=$o(-1,1),e.tag=2,Za(t,e,1))),t.lanes|=1),n)}var EX=ta.ReactCurrentOwner,fi=!1;function Yr(n,e,t,r){e.child=n===null?wN(e,null,t,r):kd(e,n.child,t,r)}function hR(n,e,t,r,i){t=t.render;var s=e.ref;return ad(e,i),r=YM(n,e,t,r,s,i),t=ZM(),n!==null&&!fi?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~i,Ko(n,e,i)):(Mn&&t&&UM(e),e.flags|=1,Yr(n,e,r,i),e.child)}function pR(n,e,t,r,i){if(n===null){var s=t.type;return typeof s=="function"&&!ob(s)&&s.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=s,GN(n,e,s,r,i)):(n=Hv(t.type,null,r,e,e.mode,i),n.ref=e.ref,n.return=e,e.child=n)}if(s=n.child,!(n.lanes&i)){var o=s.memoizedProps;if(t=t.compare,t=t!==null?t:cp,t(o,r)&&n.ref===e.ref)return Ko(n,e,i)}return e.flags|=1,n=Ja(s,r),n.ref=e.ref,n.return=e,e.child=n}function GN(n,e,t,r,i){if(n!==null){var s=n.memoizedProps;if(cp(s,r)&&n.ref===e.ref)if(fi=!1,e.pendingProps=r=s,(n.lanes&i)!==0)n.flags&131072&&(fi=!0);else return e.lanes=n.lanes,Ko(n,e,i)}return Iw(n,e,t,r,i)}function jN(n,e,t){var r=e.pendingProps,i=r.children,s=n!==null?n.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},mn(ed,Ci),Ci|=t;else{if(!(t&1073741824))return n=s!==null?s.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:n,cachePool:null,transitions:null},e.updateQueue=null,mn(ed,Ci),Ci|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:t,mn(ed,Ci),Ci|=r}else s!==null?(r=s.baseLanes|t,e.memoizedState=null):r=t,mn(ed,Ci),Ci|=r;return Yr(n,e,i,t),e.child}function XN(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function Iw(n,e,t,r,i){var s=pi(t)?Mc:$r.current;return s=Nd(e,s),ad(e,i),t=YM(n,e,t,r,s,i),r=ZM(),n!==null&&!fi?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~i,Ko(n,e,i)):(Mn&&r&&UM(e),e.flags|=1,Yr(n,e,t,i),e.child)}function mR(n,e,t,r,i){if(pi(t)){var s=!0;E0(e)}else s=!1;if(ad(e,i),e.stateNode===null)zv(n,e),_N(e,t,r),Rw(e,t,r,i),r=!0;else if(n===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,u=t.contextType;typeof u=="object"&&u!==null?u=ls(u):(u=pi(t)?Mc:$r.current,u=Nd(e,u));var f=t.getDerivedStateFromProps,h=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==u)&&oR(e,o,r,u),Ra=!1;var p=e.memoizedState;o.state=p,A0(e,r,o,i),l=e.memoizedState,a!==r||p!==l||hi.current||Ra?(typeof f=="function"&&(Aw(e,t,f,r),l=e.memoizedState),(a=Ra||sR(e,t,a,r,p,l,u))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),o.props=r,o.state=l,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,yN(n,e),a=e.memoizedProps,u=e.type===e.elementType?a:ws(e.type,a),o.props=u,h=e.pendingProps,p=o.context,l=t.contextType,typeof l=="object"&&l!==null?l=ls(l):(l=pi(t)?Mc:$r.current,l=Nd(e,l));var m=t.getDerivedStateFromProps;(f=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==h||p!==l)&&oR(e,o,r,l),Ra=!1,p=e.memoizedState,o.state=p,A0(e,r,o,i);var v=e.memoizedState;a!==h||p!==v||hi.current||Ra?(typeof m=="function"&&(Aw(e,t,m,r),v=e.memoizedState),(u=Ra||sR(e,t,u,r,p,v,l)||!1)?(f||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,v,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,v,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=v),o.props=r,o.state=v,o.context=l,r=u):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=1024),r=!1)}return Lw(n,e,t,r,s,i)}function Lw(n,e,t,r,i,s){XN(n,e);var o=(e.flags&128)!==0;if(!r&&!o)return i&&eR(e,t,!1),Ko(n,e,s);r=e.stateNode,EX.current=e;var a=o&&typeof t.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,n!==null&&o?(e.child=kd(e,n.child,null,s),e.child=kd(e,null,a,s)):Yr(n,e,a,s),e.memoizedState=r.state,i&&eR(e,t,!0),e.child}function qN(n){var e=n.stateNode;e.pendingContext?J2(n,e.pendingContext,e.pendingContext!==e.context):e.context&&J2(n,e.context,!1),GM(n,e.containerInfo)}function gR(n,e,t,r,i){return Od(),zM(i),e.flags|=256,Yr(n,e,t,r),e.child}var Dw={dehydrated:null,treeContext:null,retryLane:0};function Nw(n){return{baseLanes:n,cachePool:null,transitions:null}}function YN(n,e,t){var r=e.pendingProps,i=An.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=n!==null&&n.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(n===null||n.memoizedState!==null)&&(i|=1),mn(An,i&1),n===null)return Tw(e),n=e.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?(e.mode&1?n.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=r.children,n=r.fallback,s?(r=e.mode,s=e.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=ky(o,r,0,null),n=gc(n,r,t,null),s.return=e,n.return=e,s.sibling=n,e.child=s,e.child.memoizedState=Nw(t),e.memoizedState=Dw,n):JM(e,o));if(i=n.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return MX(n,e,o,r,a,i,t);if(s){s=r.fallback,o=e.mode,i=n.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=Ja(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=Ja(a,s):(s=gc(s,o,t,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,o=n.child.memoizedState,o=o===null?Nw(t):{baseLanes:o.baseLanes|t,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=n.childLanes&~t,e.memoizedState=Dw,r}return s=n.child,n=s.sibling,r=Ja(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=t),r.return=e,r.sibling=null,n!==null&&(t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)),e.child=r,e.memoizedState=null,r}function JM(n,e){return e=ky({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function cv(n,e,t,r){return r!==null&&zM(r),kd(e,n.child,null,t),n=JM(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function MX(n,e,t,r,i,s,o){if(t)return e.flags&256?(e.flags&=-257,r=ES(Error(Ie(422))),cv(n,e,o,r)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=ky({mode:"visible",children:r.children},i,0,null),s=gc(s,i,o,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&kd(e,n.child,null,o),e.child.memoizedState=Nw(o),e.memoizedState=Dw,s);if(!(e.mode&1))return cv(n,e,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(Ie(419)),r=ES(s,r,void 0),cv(n,e,o,r)}if(a=(o&n.childLanes)!==0,fi||a){if(r=pr,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Zo(n,i),Is(r,n,i,-1))}return sb(),r=ES(Error(Ie(421))),cv(n,e,o,r)}return i.data==="$?"?(e.flags|=128,e.child=n.child,e=UX.bind(null,n),i._reactRetry=e,null):(n=s.treeContext,Ii=Ya(i.nextSibling),Di=e,Mn=!0,Ts=null,n!==null&&(ns[rs++]=zo,ns[rs++]=Bo,ns[rs++]=bc,zo=n.id,Bo=n.overflow,bc=e),e=JM(e,r.children),e.flags|=4096,e)}function vR(n,e,t){n.lanes|=e;var r=n.alternate;r!==null&&(r.lanes|=e),Cw(n.return,e,t)}function MS(n,e,t,r,i){var s=n.memoizedState;s===null?n.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:t,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=t,s.tailMode=i)}function ZN(n,e,t){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(Yr(n,e,r.children,t),r=An.current,r&2)r=r&1|2,e.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=e.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&vR(n,t,e);else if(n.tag===19)vR(n,t,e);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}r&=1}if(mn(An,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(t=e.child,i=null;t!==null;)n=t.alternate,n!==null&&R0(n)===null&&(i=t),t=t.sibling;t=i,t===null?(i=e.child,e.child=null):(i=t.sibling,t.sibling=null),MS(e,!1,i,t,s);break;case"backwards":for(t=null,i=e.child,e.child=null;i!==null;){if(n=i.alternate,n!==null&&R0(n)===null){e.child=i;break}n=i.sibling,i.sibling=t,t=i,i=n}MS(e,!0,t,null,s);break;case"together":MS(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function zv(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function Ko(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),Cc|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error(Ie(153));if(e.child!==null){for(n=e.child,t=Ja(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=Ja(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function bX(n,e,t){switch(e.tag){case 3:qN(e),Od();break;case 5:EN(e);break;case 1:pi(e.type)&&E0(e);break;case 4:GM(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;mn(T0,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(mn(An,An.current&1),e.flags|=128,null):t&e.child.childLanes?YN(n,e,t):(mn(An,An.current&1),n=Ko(n,e,t),n!==null?n.sibling:null);mn(An,An.current&1);break;case 19:if(r=(t&e.childLanes)!==0,n.flags&128){if(r)return ZN(n,e,t);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),mn(An,An.current),r)break;return null;case 22:case 23:return e.lanes=0,jN(n,e,t)}return Ko(n,e,t)}var KN,Ow,QN,JN;KN=function(n,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)n.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}};Ow=function(){};QN=function(n,e,t,r){var i=n.memoizedProps;if(i!==r){n=e.stateNode,ec(uo.current);var s=null;switch(t){case"input":i=rw(n,i),r=rw(n,r),s=[];break;case"select":i=Dn({},i,{value:void 0}),r=Dn({},r,{value:void 0}),s=[];break;case"textarea":i=ow(n,i),r=ow(n,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(n.onclick=S0)}lw(t,r);var o;t=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(o in a)a.hasOwnProperty(o)&&(t||(t={}),t[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(np.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var l=r[u];if(a=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(t||(t={}),t[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(t||(t={}),t[o]=l[o])}else t||(s||(s=[]),s.push(u,t)),t=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(np.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&xn("scroll",n),s||a===l||(s=[])):(s=s||[]).push(u,l))}t&&(s=s||[]).push("style",t);var u=s;(e.updateQueue=u)&&(e.flags|=4)}};JN=function(n,e,t,r){t!==r&&(e.flags|=4)};function Yf(n,e){if(!Mn)switch(n.tailMode){case"hidden":e=n.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?n.tail=null:t.sibling=null;break;case"collapsed":t=n.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e||n.tail===null?n.tail=null:n.tail.sibling=null:r.sibling=null}}function Nr(n){var e=n.alternate!==null&&n.alternate.child===n.child,t=0,r=0;if(e)for(var i=n.child;i!==null;)t|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=n,i=i.sibling;else for(i=n.child;i!==null;)t|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=n,i=i.sibling;return n.subtreeFlags|=r,n.childLanes=t,e}function TX(n,e,t){var r=e.pendingProps;switch(FM(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nr(e),null;case 1:return pi(e.type)&&w0(),Nr(e),null;case 3:return r=e.stateNode,Ud(),wn(hi),wn($r),XM(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(n===null||n.child===null)&&(av(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Ts!==null&&($w(Ts),Ts=null))),Ow(n,e),Nr(e),null;case 5:jM(e);var i=ec(pp.current);if(t=e.type,n!==null&&e.stateNode!=null)QN(n,e,t,r,i),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(Ie(166));return Nr(e),null}if(n=ec(uo.current),av(e)){r=e.stateNode,t=e.type;var s=e.memoizedProps;switch(r[to]=e,r[fp]=s,n=(e.mode&1)!==0,t){case"dialog":xn("cancel",r),xn("close",r);break;case"iframe":case"object":case"embed":xn("load",r);break;case"video":case"audio":for(i=0;i<\/script>",n=n.removeChild(n.firstChild)):typeof r.is=="string"?n=o.createElement(t,{is:r.is}):(n=o.createElement(t),t==="select"&&(o=n,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):n=o.createElementNS(n,t),n[to]=e,n[fp]=r,KN(n,e,!1,!1),e.stateNode=n;e:{switch(o=cw(t,r),t){case"dialog":xn("cancel",n),xn("close",n),i=r;break;case"iframe":case"object":case"embed":xn("load",n),i=r;break;case"video":case"audio":for(i=0;izd&&(e.flags|=128,r=!0,Yf(s,!1),e.lanes=4194304)}else{if(!r)if(n=R0(o),n!==null){if(e.flags|=128,r=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Yf(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Mn)return Nr(e),null}else 2*jn()-s.renderingStartTime>zd&&t!==1073741824&&(e.flags|=128,r=!0,Yf(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=jn(),e.sibling=null,t=An.current,mn(An,r?t&1|2:t&1),e):(Nr(e),null);case 22:case 23:return ib(),r=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Ci&1073741824&&(Nr(e),e.subtreeFlags&6&&(e.flags|=8192)):Nr(e),null;case 24:return null;case 25:return null}throw Error(Ie(156,e.tag))}function CX(n,e){switch(FM(e),e.tag){case 1:return pi(e.type)&&w0(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Ud(),wn(hi),wn($r),XM(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return jM(e),null;case 13:if(wn(An),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Ie(340));Od()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return wn(An),null;case 4:return Ud(),null;case 10:return HM(e.type._context),null;case 22:case 23:return ib(),null;case 24:return null;default:return null}}var uv=!1,kr=!1,AX=typeof WeakSet=="function"?WeakSet:Set,Je=null;function Ju(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(r){Un(n,e,r)}else t.current=null}function kw(n,e,t){try{t()}catch(r){Un(n,e,r)}}var yR=!1;function RX(n,e){if(xw=y0,n=rN(),kM(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var r=t.getSelection&&t.getSelection();if(r&&r.rangeCount!==0){t=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,a=-1,l=-1,u=0,f=0,h=n,p=null;t:for(;;){for(var m;h!==t||i!==0&&h.nodeType!==3||(a=o+i),h!==s||r!==0&&h.nodeType!==3||(l=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(m=h.firstChild)!==null;)p=h,h=m;for(;;){if(h===n)break t;if(p===t&&++u===i&&(a=o),p===s&&++f===r&&(l=o),(m=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=m}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(_w={focusedElem:n,selectionRange:t},y0=!1,Je=e;Je!==null;)if(e=Je,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,Je=n;else for(;Je!==null;){e=Je;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var w=v.memoizedProps,x=v.memoizedState,g=e.stateNode,S=g.getSnapshotBeforeUpdate(e.elementType===e.type?w:ws(e.type,w),x);g.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var _=e.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ie(163))}}catch(b){Un(e,e.return,b)}if(n=e.sibling,n!==null){n.return=e.return,Je=n;break}Je=e.return}return v=yR,yR=!1,v}function gh(n,e,t){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&n)===n){var s=i.destroy;i.destroy=void 0,s!==void 0&&kw(e,t,s)}i=i.next}while(i!==r)}}function Ny(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var r=t.create;t.destroy=r()}t=t.next}while(t!==e)}}function Uw(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function eO(n){var e=n.alternate;e!==null&&(n.alternate=null,eO(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[to],delete e[fp],delete e[Ew],delete e[dX],delete e[fX])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function tO(n){return n.tag===5||n.tag===3||n.tag===4}function xR(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||tO(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Fw(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=S0));else if(r!==4&&(n=n.child,n!==null))for(Fw(n,e,t),n=n.sibling;n!==null;)Fw(n,e,t),n=n.sibling}function zw(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(r!==4&&(n=n.child,n!==null))for(zw(n,e,t),n=n.sibling;n!==null;)zw(n,e,t),n=n.sibling}var _r=null,Ms=!1;function Ma(n,e,t){for(t=t.child;t!==null;)nO(n,e,t),t=t.sibling}function nO(n,e,t){if(co&&typeof co.onCommitFiberUnmount=="function")try{co.onCommitFiberUnmount(Ty,t)}catch{}switch(t.tag){case 5:kr||Ju(t,e);case 6:var r=_r,i=Ms;_r=null,Ma(n,e,t),_r=r,Ms=i,_r!==null&&(Ms?(n=_r,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):_r.removeChild(t.stateNode));break;case 18:_r!==null&&(Ms?(n=_r,t=t.stateNode,n.nodeType===8?vS(n.parentNode,t):n.nodeType===1&&vS(n,t),ap(n)):vS(_r,t.stateNode));break;case 4:r=_r,i=Ms,_r=t.stateNode.containerInfo,Ms=!0,Ma(n,e,t),_r=r,Ms=i;break;case 0:case 11:case 14:case 15:if(!kr&&(r=t.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&kw(t,e,o),i=i.next}while(i!==r)}Ma(n,e,t);break;case 1:if(!kr&&(Ju(t,e),r=t.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(a){Un(t,e,a)}Ma(n,e,t);break;case 21:Ma(n,e,t);break;case 22:t.mode&1?(kr=(r=kr)||t.memoizedState!==null,Ma(n,e,t),kr=r):Ma(n,e,t);break;default:Ma(n,e,t)}}function _R(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new AX),e.forEach(function(r){var i=FX.bind(null,n,r);t.has(r)||(t.add(r),r.then(i,i))})}}function _s(n,e){var t=e.deletions;if(t!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=jn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*IX(r/1960))-r,10n?16:n,Ha===null)var r=!1;else{if(n=Ha,Ha=null,N0=0,Jt&6)throw Error(Ie(331));var i=Jt;for(Jt|=4,Je=n.current;Je!==null;){var s=Je,o=s.child;if(Je.flags&16){var a=s.deletions;if(a!==null){for(var l=0;ljn()-nb?mc(n,0):tb|=t),mi(n,e)}function uO(n,e){e===0&&(n.mode&1?(e=tv,tv<<=1,!(tv&130023424)&&(tv=4194304)):e=1);var t=Jr();n=Zo(n,e),n!==null&&(Kp(n,e,t),mi(n,t))}function UX(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),uO(n,t)}function FX(n,e){var t=0;switch(n.tag){case 13:var r=n.stateNode,i=n.memoizedState;i!==null&&(t=i.retryLane);break;case 19:r=n.stateNode;break;default:throw Error(Ie(314))}r!==null&&r.delete(e),uO(n,t)}var dO;dO=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||hi.current)fi=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return fi=!1,bX(n,e,t);fi=!!(n.flags&131072)}else fi=!1,Mn&&e.flags&1048576&&pN(e,b0,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;zv(n,e),n=e.pendingProps;var i=Nd(e,$r.current);ad(e,t),i=YM(null,e,r,n,i,t);var s=ZM();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,pi(r)?(s=!0,E0(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,WM(e),i.updater=Ly,e.stateNode=i,i._reactInternals=e,Rw(e,r,n,t),e=Lw(null,e,r,!0,s,t)):(e.tag=0,Mn&&s&&UM(e),Yr(null,e,i,t),e=e.child),e;case 16:r=e.elementType;e:{switch(zv(n,e),n=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=BX(r),n=ws(r,n),i){case 0:e=Iw(null,e,r,n,t);break e;case 1:e=mR(null,e,r,n,t);break e;case 11:e=hR(null,e,r,n,t);break e;case 14:e=pR(null,e,r,ws(r.type,n),t);break e}throw Error(Ie(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ws(r,i),Iw(n,e,r,i,t);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ws(r,i),mR(n,e,r,i,t);case 3:e:{if(qN(e),n===null)throw Error(Ie(387));r=e.pendingProps,s=e.memoizedState,i=s.element,yN(n,e),A0(e,r,null,t);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Fd(Error(Ie(423)),e),e=gR(n,e,r,t,i);break e}else if(r!==i){i=Fd(Error(Ie(424)),e),e=gR(n,e,r,t,i);break e}else for(Ii=Ya(e.stateNode.containerInfo.firstChild),Di=e,Mn=!0,Ts=null,t=wN(e,null,r,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Od(),r===i){e=Ko(n,e,t);break e}Yr(n,e,r,t)}e=e.child}return e;case 5:return EN(e),n===null&&Tw(e),r=e.type,i=e.pendingProps,s=n!==null?n.memoizedProps:null,o=i.children,Sw(r,i)?o=null:s!==null&&Sw(r,s)&&(e.flags|=32),XN(n,e),Yr(n,e,o,t),e.child;case 6:return n===null&&Tw(e),null;case 13:return YN(n,e,t);case 4:return GM(e,e.stateNode.containerInfo),r=e.pendingProps,n===null?e.child=kd(e,null,r,t):Yr(n,e,r,t),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ws(r,i),hR(n,e,r,i,t);case 7:return Yr(n,e,e.pendingProps,t),e.child;case 8:return Yr(n,e,e.pendingProps.children,t),e.child;case 12:return Yr(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,mn(T0,r._currentValue),r._currentValue=o,s!==null)if(Ds(s.value,o)){if(s.children===i.children&&!hi.current){e=Ko(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=$o(-1,t&-t),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),Cw(s.return,t,e),a.lanes|=t;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Ie(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),Cw(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Yr(n,e,i.children,t),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,ad(e,t),i=ls(i),r=r(i),e.flags|=1,Yr(n,e,r,t),e.child;case 14:return r=e.type,i=ws(r,e.pendingProps),i=ws(r.type,i),pR(n,e,r,i,t);case 15:return GN(n,e,e.type,e.pendingProps,t);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ws(r,i),zv(n,e),e.tag=1,pi(r)?(n=!0,E0(e)):n=!1,ad(e,t),_N(e,r,i),Rw(e,r,i,t),Lw(null,e,r,!0,n,t);case 19:return ZN(n,e,t);case 22:return jN(n,e,t)}throw Error(Ie(156,e.tag))};function fO(n,e){return FD(n,e)}function zX(n,e,t,r){this.tag=n,this.key=t,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ss(n,e,t,r){return new zX(n,e,t,r)}function ob(n){return n=n.prototype,!(!n||!n.isReactComponent)}function BX(n){if(typeof n=="function")return ob(n)?1:0;if(n!=null){if(n=n.$$typeof,n===bM)return 11;if(n===TM)return 14}return 2}function Ja(n,e){var t=n.alternate;return t===null?(t=ss(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function Hv(n,e,t,r,i,s){var o=2;if(r=n,typeof n=="function")ob(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case Wu:return gc(t.children,i,s,e);case MM:o=8,i|=8;break;case J1:return n=ss(12,t,e,i|2),n.elementType=J1,n.lanes=s,n;case ew:return n=ss(13,t,e,i),n.elementType=ew,n.lanes=s,n;case tw:return n=ss(19,t,e,i),n.elementType=tw,n.lanes=s,n;case SD:return ky(t,i,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case xD:o=10;break e;case _D:o=9;break e;case bM:o=11;break e;case TM:o=14;break e;case Aa:o=16,r=null;break e}throw Error(Ie(130,n==null?n:typeof n,""))}return e=ss(o,t,e,i),e.elementType=n,e.type=r,e.lanes=s,e}function gc(n,e,t,r){return n=ss(7,n,r,e),n.lanes=t,n}function ky(n,e,t,r){return n=ss(22,n,r,e),n.elementType=SD,n.lanes=t,n.stateNode={isHidden:!1},n}function bS(n,e,t){return n=ss(6,n,null,e),n.lanes=t,n}function TS(n,e,t){return e=ss(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function VX(n,e,t,r,i){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=oS(0),this.expirationTimes=oS(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=oS(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function ab(n,e,t,r,i,s,o,a,l){return n=new VX(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=ss(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},WM(s),n}function HX(n,e,t){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(gO)}catch(n){console.error(n)}}gO(),pD.exports=Ui;var $c=pD.exports;const vO=Op($c);var yO,AR=$c;yO=AR.createRoot,AR.hydrateRoot;function XX(n){return function(e){n.forEach(function(t){typeof t=="function"?t(e):t!=null&&(t.current=e)})}}var qX=Object.defineProperty,YX=(n,e,t)=>e in n?qX(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Et=(n,e,t)=>(YX(n,typeof e!="symbol"?e+"":e,t),t);const hv=new Lc,RR=new Js,ZX=Math.cos(70*(Math.PI/180)),PR=(n,e)=>(n%e+e)%e;let KX=class extends mo{constructor(e,t){super(),Et(this,"object"),Et(this,"domElement"),Et(this,"enabled",!0),Et(this,"target",new F),Et(this,"minDistance",0),Et(this,"maxDistance",1/0),Et(this,"minZoom",0),Et(this,"maxZoom",1/0),Et(this,"minPolarAngle",0),Et(this,"maxPolarAngle",Math.PI),Et(this,"minAzimuthAngle",-1/0),Et(this,"maxAzimuthAngle",1/0),Et(this,"enableDamping",!1),Et(this,"dampingFactor",.05),Et(this,"enableZoom",!0),Et(this,"zoomSpeed",1),Et(this,"enableRotate",!0),Et(this,"rotateSpeed",1),Et(this,"enablePan",!0),Et(this,"panSpeed",1),Et(this,"screenSpacePanning",!0),Et(this,"keyPanSpeed",7),Et(this,"zoomToCursor",!1),Et(this,"autoRotate",!1),Et(this,"autoRotateSpeed",2),Et(this,"reverseOrbit",!1),Et(this,"reverseHorizontalOrbit",!1),Et(this,"reverseVerticalOrbit",!1),Et(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Et(this,"mouseButtons",{LEFT:Fl.ROTATE,MIDDLE:Fl.DOLLY,RIGHT:Fl.PAN}),Et(this,"touches",{ONE:zl.ROTATE,TWO:zl.DOLLY_PAN}),Et(this,"target0"),Et(this,"position0"),Et(this,"zoom0"),Et(this,"_domElementKeyEvents",null),Et(this,"getPolarAngle"),Et(this,"getAzimuthalAngle"),Et(this,"setPolarAngle"),Et(this,"setAzimuthalAngle"),Et(this,"getDistance"),Et(this,"listenToKeyEvents"),Et(this,"stopListenToKeyEvents"),Et(this,"saveState"),Et(this,"reset"),Et(this,"update"),Et(this,"connect"),Et(this,"dispose"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>f.phi,this.getAzimuthalAngle=()=>f.theta,this.setPolarAngle=Z=>{let Se=PR(Z,2*Math.PI),$e=f.phi;$e<0&&($e+=2*Math.PI),Se<0&&(Se+=2*Math.PI);let je=Math.abs(Se-$e);2*Math.PI-je{let Se=PR(Z,2*Math.PI),$e=f.theta;$e<0&&($e+=2*Math.PI),Se<0&&(Se+=2*Math.PI);let je=Math.abs(Se-$e);2*Math.PI-jer.object.position.distanceTo(r.target),this.listenToKeyEvents=Z=>{Z.addEventListener("keydown",st),this._domElementKeyEvents=Z},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",st),this._domElementKeyEvents=null},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(i),r.update(),l=a.NONE},this.update=(()=>{const Z=new F,Se=new F(0,1,0),$e=new Br().setFromUnitVectors(e.up,Se),je=$e.clone().invert(),St=new F,G=new Br,Pe=2*Math.PI;return function(){const nt=r.object.position;$e.setFromUnitVectors(e.up,Se),je.copy($e).invert(),Z.copy(nt).sub(r.target),Z.applyQuaternion($e),f.setFromVector3(Z),r.autoRotate&&l===a.NONE&&z(W()),r.enableDamping?(f.theta+=h.theta*r.dampingFactor,f.phi+=h.phi*r.dampingFactor):(f.theta+=h.theta,f.phi+=h.phi);let rt=r.minAzimuthAngle,Ft=r.maxAzimuthAngle;isFinite(rt)&&isFinite(Ft)&&(rt<-Math.PI?rt+=Pe:rt>Math.PI&&(rt-=Pe),Ft<-Math.PI?Ft+=Pe:Ft>Math.PI&&(Ft-=Pe),rt<=Ft?f.theta=Math.max(rt,Math.min(Ft,f.theta)):f.theta=f.theta>(rt+Ft)/2?Math.max(rt,f.theta):Math.min(Ft,f.theta)),f.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,f.phi)),f.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(m,r.dampingFactor):r.target.add(m),r.zoomToCursor&&V||r.object.isOrthographicCamera?f.radius=se(f.radius):f.radius=se(f.radius*p),Z.setFromSpherical(f),Z.applyQuaternion(je),nt.copy(r.target).add(Z),r.object.matrixAutoUpdate||r.object.updateMatrix(),r.object.lookAt(r.target),r.enableDamping===!0?(h.theta*=1-r.dampingFactor,h.phi*=1-r.dampingFactor,m.multiplyScalar(1-r.dampingFactor)):(h.set(0,0,0),m.set(0,0,0));let Yt=!1;if(r.zoomToCursor&&V){let fn=null;if(r.object instanceof Rn&&r.object.isPerspectiveCamera){const Bn=Z.length();fn=se(Bn*p);const Kt=Bn-fn;r.object.position.addScaledVector(P,Kt),r.object.updateMatrixWorld()}else if(r.object.isOrthographicCamera){const Bn=new F(D.x,D.y,0);Bn.unproject(r.object),r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/p)),r.object.updateProjectionMatrix(),Yt=!0;const Kt=new F(D.x,D.y,0);Kt.unproject(r.object),r.object.position.sub(Kt).add(Bn),r.object.updateMatrixWorld(),fn=Z.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;fn!==null&&(r.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(fn).add(r.object.position):(hv.origin.copy(r.object.position),hv.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(hv.direction))u||8*(1-G.dot(r.object.quaternion))>u?(r.dispatchEvent(i),St.copy(r.object.position),G.copy(r.object.quaternion),Yt=!1,!0):!1}})(),this.connect=Z=>{Z===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),r.domElement=Z,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",Nt),r.domElement.addEventListener("pointerdown",ie),r.domElement.addEventListener("pointercancel",_e),r.domElement.addEventListener("wheel",He)},this.dispose=()=>{var Z,Se,$e,je,St,G;(Z=r.domElement)==null||Z.removeEventListener("contextmenu",Nt),(Se=r.domElement)==null||Se.removeEventListener("pointerdown",ie),($e=r.domElement)==null||$e.removeEventListener("pointercancel",_e),(je=r.domElement)==null||je.removeEventListener("wheel",He),(St=r.domElement)==null||St.ownerDocument.removeEventListener("pointermove",be),(G=r.domElement)==null||G.ownerDocument.removeEventListener("pointerup",we),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",st)};const r=this,i={type:"change"},s={type:"start"},o={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=a.NONE;const u=1e-6,f=new Qv,h=new Qv;let p=1;const m=new F,v=new ge,w=new ge,x=new ge,g=new ge,S=new ge,_=new ge,b=new ge,A=new ge,R=new ge,P=new F,D=new ge;let V=!1;const C=[],L={};function W(){return 2*Math.PI/60/60*r.autoRotateSpeed}function Q(){return Math.pow(.95,r.zoomSpeed)}function z(Z){r.reverseOrbit||r.reverseHorizontalOrbit?h.theta+=Z:h.theta-=Z}function j(Z){r.reverseOrbit||r.reverseVerticalOrbit?h.phi+=Z:h.phi-=Z}const Y=(()=>{const Z=new F;return function($e,je){Z.setFromMatrixColumn(je,0),Z.multiplyScalar(-$e),m.add(Z)}})(),re=(()=>{const Z=new F;return function($e,je){r.screenSpacePanning===!0?Z.setFromMatrixColumn(je,1):(Z.setFromMatrixColumn(je,0),Z.crossVectors(r.object.up,Z)),Z.multiplyScalar($e),m.add(Z)}})(),U=(()=>{const Z=new F;return function($e,je){const St=r.domElement;if(St&&r.object instanceof Rn&&r.object.isPerspectiveCamera){const G=r.object.position;Z.copy(G).sub(r.target);let Pe=Z.length();Pe*=Math.tan(r.object.fov/2*Math.PI/180),Y(2*$e*Pe/St.clientHeight,r.object.matrix),re(2*je*Pe/St.clientHeight,r.object.matrix)}else St&&r.object instanceof ko&&r.object.isOrthographicCamera?(Y($e*(r.object.right-r.object.left)/r.object.zoom/St.clientWidth,r.object.matrix),re(je*(r.object.top-r.object.bottom)/r.object.zoom/St.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function X(Z){r.object instanceof Rn&&r.object.isPerspectiveCamera||r.object instanceof ko&&r.object.isOrthographicCamera?p/=Z:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function q(Z){r.object instanceof Rn&&r.object.isPerspectiveCamera||r.object instanceof ko&&r.object.isOrthographicCamera?p*=Z:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function K(Z){if(!r.zoomToCursor||!r.domElement)return;V=!0;const Se=r.domElement.getBoundingClientRect(),$e=Z.clientX-Se.left,je=Z.clientY-Se.top,St=Se.width,G=Se.height;D.x=$e/St*2-1,D.y=-(je/G)*2+1,P.set(D.x,D.y,1).unproject(r.object).sub(r.object.position).normalize()}function se(Z){return Math.max(r.minDistance,Math.min(r.maxDistance,Z))}function ve(Z){v.set(Z.clientX,Z.clientY)}function te(Z){K(Z),b.set(Z.clientX,Z.clientY)}function le(Z){g.set(Z.clientX,Z.clientY)}function Me(Z){w.set(Z.clientX,Z.clientY),x.subVectors(w,v).multiplyScalar(r.rotateSpeed);const Se=r.domElement;Se&&(z(2*Math.PI*x.x/Se.clientHeight),j(2*Math.PI*x.y/Se.clientHeight)),v.copy(w),r.update()}function pe(Z){A.set(Z.clientX,Z.clientY),R.subVectors(A,b),R.y>0?X(Q()):R.y<0&&q(Q()),b.copy(A),r.update()}function Ae(Z){S.set(Z.clientX,Z.clientY),_.subVectors(S,g).multiplyScalar(r.panSpeed),U(_.x,_.y),g.copy(S),r.update()}function De(Z){K(Z),Z.deltaY<0?q(Q()):Z.deltaY>0&&X(Q()),r.update()}function Re(Z){let Se=!1;switch(Z.code){case r.keys.UP:U(0,r.keyPanSpeed),Se=!0;break;case r.keys.BOTTOM:U(0,-r.keyPanSpeed),Se=!0;break;case r.keys.LEFT:U(r.keyPanSpeed,0),Se=!0;break;case r.keys.RIGHT:U(-r.keyPanSpeed,0),Se=!0;break}Se&&(Z.preventDefault(),r.update())}function Ce(){if(C.length==1)v.set(C[0].pageX,C[0].pageY);else{const Z=.5*(C[0].pageX+C[1].pageX),Se=.5*(C[0].pageY+C[1].pageY);v.set(Z,Se)}}function H(){if(C.length==1)g.set(C[0].pageX,C[0].pageY);else{const Z=.5*(C[0].pageX+C[1].pageX),Se=.5*(C[0].pageY+C[1].pageY);g.set(Z,Se)}}function xe(){const Z=C[0].pageX-C[1].pageX,Se=C[0].pageY-C[1].pageY,$e=Math.sqrt(Z*Z+Se*Se);b.set(0,$e)}function de(){r.enableZoom&&xe(),r.enablePan&&H()}function Te(){r.enableZoom&&xe(),r.enableRotate&&Ce()}function ye(Z){if(C.length==1)w.set(Z.pageX,Z.pageY);else{const $e=Le(Z),je=.5*(Z.pageX+$e.x),St=.5*(Z.pageY+$e.y);w.set(je,St)}x.subVectors(w,v).multiplyScalar(r.rotateSpeed);const Se=r.domElement;Se&&(z(2*Math.PI*x.x/Se.clientHeight),j(2*Math.PI*x.y/Se.clientHeight)),v.copy(w)}function Xe(Z){if(C.length==1)S.set(Z.pageX,Z.pageY);else{const Se=Le(Z),$e=.5*(Z.pageX+Se.x),je=.5*(Z.pageY+Se.y);S.set($e,je)}_.subVectors(S,g).multiplyScalar(r.panSpeed),U(_.x,_.y),g.copy(S)}function ze(Z){const Se=Le(Z),$e=Z.pageX-Se.x,je=Z.pageY-Se.y,St=Math.sqrt($e*$e+je*je);A.set(0,St),R.set(0,Math.pow(A.y/b.y,r.zoomSpeed)),X(R.y),b.copy(A)}function k(Z){r.enableZoom&&ze(Z),r.enablePan&&Xe(Z)}function O(Z){r.enableZoom&&ze(Z),r.enableRotate&&ye(Z)}function ie(Z){var Se,$e;r.enabled!==!1&&(C.length===0&&((Se=r.domElement)==null||Se.ownerDocument.addEventListener("pointermove",be),($e=r.domElement)==null||$e.ownerDocument.addEventListener("pointerup",we)),wt(Z),Z.pointerType==="touch"?mt(Z):Ke(Z))}function be(Z){r.enabled!==!1&&(Z.pointerType==="touch"?Ee(Z):Fe(Z))}function we(Z){var Se,$e,je;ft(Z),C.length===0&&((Se=r.domElement)==null||Se.releasePointerCapture(Z.pointerId),($e=r.domElement)==null||$e.ownerDocument.removeEventListener("pointermove",be),(je=r.domElement)==null||je.ownerDocument.removeEventListener("pointerup",we)),r.dispatchEvent(o),l=a.NONE}function _e(Z){ft(Z)}function Ke(Z){let Se;switch(Z.button){case 0:Se=r.mouseButtons.LEFT;break;case 1:Se=r.mouseButtons.MIDDLE;break;case 2:Se=r.mouseButtons.RIGHT;break;default:Se=-1}switch(Se){case Fl.DOLLY:if(r.enableZoom===!1)return;te(Z),l=a.DOLLY;break;case Fl.ROTATE:if(Z.ctrlKey||Z.metaKey||Z.shiftKey){if(r.enablePan===!1)return;le(Z),l=a.PAN}else{if(r.enableRotate===!1)return;ve(Z),l=a.ROTATE}break;case Fl.PAN:if(Z.ctrlKey||Z.metaKey||Z.shiftKey){if(r.enableRotate===!1)return;ve(Z),l=a.ROTATE}else{if(r.enablePan===!1)return;le(Z),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&r.dispatchEvent(s)}function Fe(Z){if(r.enabled!==!1)switch(l){case a.ROTATE:if(r.enableRotate===!1)return;Me(Z);break;case a.DOLLY:if(r.enableZoom===!1)return;pe(Z);break;case a.PAN:if(r.enablePan===!1)return;Ae(Z);break}}function He(Z){r.enabled===!1||r.enableZoom===!1||l!==a.NONE&&l!==a.ROTATE||(Z.preventDefault(),r.dispatchEvent(s),De(Z),r.dispatchEvent(o))}function st(Z){r.enabled===!1||r.enablePan===!1||Re(Z)}function mt(Z){switch(it(Z),C.length){case 1:switch(r.touches.ONE){case zl.ROTATE:if(r.enableRotate===!1)return;Ce(),l=a.TOUCH_ROTATE;break;case zl.PAN:if(r.enablePan===!1)return;H(),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(r.touches.TWO){case zl.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;de(),l=a.TOUCH_DOLLY_PAN;break;case zl.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;Te(),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&r.dispatchEvent(s)}function Ee(Z){switch(it(Z),l){case a.TOUCH_ROTATE:if(r.enableRotate===!1)return;ye(Z),r.update();break;case a.TOUCH_PAN:if(r.enablePan===!1)return;Xe(Z),r.update();break;case a.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;k(Z),r.update();break;case a.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;O(Z),r.update();break;default:l=a.NONE}}function Nt(Z){r.enabled!==!1&&Z.preventDefault()}function wt(Z){C.push(Z)}function ft(Z){delete L[Z.pointerId];for(let Se=0;SeparseInt(Up.replace(/\D+/g,"")),JX=QX(),eq=M.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:r,enableDamping:i=!0,keyEvents:s=!1,onChange:o,onStart:a,onEnd:l,...u},f)=>{const h=Ti(R=>R.invalidate),p=Ti(R=>R.camera),m=Ti(R=>R.gl),v=Ti(R=>R.events),w=Ti(R=>R.setEvents),x=Ti(R=>R.set),g=Ti(R=>R.get),S=Ti(R=>R.performance),_=e||p,b=r||v.connected||m.domElement,A=M.useMemo(()=>new KX(_),[_]);return Bc(()=>{A.enabled&&A.update()},-1),M.useEffect(()=>(s&&A.connect(s===!0?b:s),A.connect(b),()=>void A.dispose()),[s,b,t,A,h]),M.useEffect(()=>{const R=V=>{h(),t&&S.regress(),o&&o(V)},P=V=>{a&&a(V)},D=V=>{l&&l(V)};return A.addEventListener("change",R),A.addEventListener("start",P),A.addEventListener("end",D),()=>{A.removeEventListener("start",P),A.removeEventListener("end",D),A.removeEventListener("change",R)}},[o,a,l,A,h,w]),M.useEffect(()=>{if(n){const R=g().controls;return x({controls:A}),()=>x({controls:R})}},[n,A]),M.createElement("primitive",Ue({ref:f,object:A,enableDamping:i},u))});class tq extends as{constructor(e=new ge){super({uniforms:{inputBuffer:new Or(null),depthBuffer:new Or(null),resolution:new Or(new ge),texelSize:new Or(new ge),halfTexelSize:new Or(new ge),kernel:new Or(0),scale:new Or(1),cameraNear:new Or(0),cameraFar:new Or(1),minDepthThreshold:new Or(0),maxDepthThreshold:new Or(1),depthScale:new Or(0),depthToBlurRatioBias:new Or(.25)},fragmentShader:`#include #include uniform sampler2D inputBuffer; uniform sampler2D depthBuffer; @@ -4128,7 +4133,7 @@ Error generating stack: `+s.message+` #include #include - #include <${zX>=154?"colorspace_fragment":"encodings_fragment"}> + #include <${JX>=154?"colorspace_fragment":"encodings_fragment"}> }`,vertexShader:`uniform vec2 texelSize; uniform vec2 halfTexelSize; uniform float kernel; @@ -4150,7 +4155,7 @@ Error generating stack: `+s.message+` vUv3 = vec2(uv.x - dUv.x, uv.y - dUv.y); gl_Position = vec4(position.xy, 1.0, 1.0); - }`,blending:io,depthWrite:!1,depthTest:!1}),this.toneMapped=!1,this.setTexelSize(e.x,e.y),this.kernel=new Float32Array([0,1,2,2,3])}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t),this.uniforms.halfTexelSize.value.set(e,t).multiplyScalar(.5)}setResolution(e){this.uniforms.resolution.value.copy(e)}}class HX{constructor({gl:e,resolution:t,width:r=500,height:i=500,minDepthThreshold:s=0,maxDepthThreshold:o=1,depthScale:a=0,depthToBlurRatioBias:l=.25}){this.renderToScreen=!1,this.renderTargetA=new gi(t,t,{minFilter:fn,magFilter:fn,stencilBuffer:!1,depthBuffer:!1,type:tl}),this.renderTargetB=this.renderTargetA.clone(),this.convolutionMaterial=new VX,this.convolutionMaterial.setTexelSize(1/r,1/i),this.convolutionMaterial.setResolution(new ge(r,i)),this.scene=new Ih,this.camera=new $d,this.convolutionMaterial.uniforms.minDepthThreshold.value=s,this.convolutionMaterial.uniforms.maxDepthThreshold.value=o,this.convolutionMaterial.uniforms.depthScale.value=a,this.convolutionMaterial.uniforms.depthToBlurRatioBias.value=l,this.convolutionMaterial.defines.USE_DEPTH=a>0;const u=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),f=new Float32Array([0,0,2,0,0,2]),h=new Ut;h.setAttribute("position",new an(u,3)),h.setAttribute("uv",new an(f,2)),this.screen=new qn(h,this.convolutionMaterial),this.screen.frustumCulled=!1,this.scene.add(this.screen)}render(e,t,r){const i=this.scene,s=this.camera,o=this.renderTargetA,a=this.renderTargetB;let l=this.convolutionMaterial,u=l.uniforms;u.depthBuffer.value=t.depthTexture;const f=l.kernel;let h=t,p,m,v;for(m=0,v=f.length-1;m0;const u=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),f=new Float32Array([0,0,2,0,0,2]),h=new Ut;h.setAttribute("position",new an(u,3)),h.setAttribute("uv",new an(f,2)),this.screen=new qn(h,this.convolutionMaterial),this.screen.frustumCulled=!1,this.scene.add(this.screen)}render(e,t,r){const i=this.scene,s=this.camera,o=this.renderTargetA,a=this.renderTargetB;let l=this.convolutionMaterial,u=l.uniforms;u.depthBuffer.value=t.depthTexture;const f=l.kernel;let h=t,p,m,v;for(m=0,v=f.length-1;m",`#include @@ -4236,8 +4241,8 @@ Error generating stack: `+s.message+` newMerge.b = (merge.b - 0.5) * mixContrast + 0.5; diffuseColor.rgb = diffuseColor.rgb * ((1.0 - min(1.0, mirror)) + newMerge.rgb * mixStrength); - `)}get tDiffuse(){return this._tDiffuse.value}set tDiffuse(e){this._tDiffuse.value=e}get tDepth(){return this._tDepth.value}set tDepth(e){this._tDepth.value=e}get distortionMap(){return this._distortionMap.value}set distortionMap(e){this._distortionMap.value=e}get tDiffuseBlur(){return this._tDiffuseBlur.value}set tDiffuseBlur(e){this._tDiffuseBlur.value=e}get textureMatrix(){return this._textureMatrix.value}set textureMatrix(e){this._textureMatrix.value=e}get hasBlur(){return this._hasBlur.value}set hasBlur(e){this._hasBlur.value=e}get mirror(){return this._mirror.value}set mirror(e){this._mirror.value=e}get mixBlur(){return this._mixBlur.value}set mixBlur(e){this._mixBlur.value=e}get mixStrength(){return this._blurStrength.value}set mixStrength(e){this._blurStrength.value=e}get minDepthThreshold(){return this._minDepthThreshold.value}set minDepthThreshold(e){this._minDepthThreshold.value=e}get maxDepthThreshold(){return this._maxDepthThreshold.value}set maxDepthThreshold(e){this._maxDepthThreshold.value=e}get depthScale(){return this._depthScale.value}set depthScale(e){this._depthScale.value=e}get depthToBlurRatioBias(){return this._depthToBlurRatioBias.value}set depthToBlurRatioBias(e){this._depthToBlurRatioBias.value=e}get distortion(){return this._distortion.value}set distortion(e){this._distortion.value=e}get mixContrast(){return this._mixContrast.value}set mixContrast(e){this._mixContrast.value=e}};const WX=M.forwardRef(({mixBlur:n=0,mixStrength:e=1,resolution:t=256,blur:r=[0,0],minDepthThreshold:i=.9,maxDepthThreshold:s=1,depthScale:o=0,depthToBlurRatioBias:a=.25,mirror:l=0,distortion:u=1,mixContrast:f=1,distortionMap:h,reflectorOffset:p=0,...m},v)=>{FL({MeshReflectorMaterialImpl:$X});const w=Ti(({gl:K})=>K),x=Ti(({camera:K})=>K),g=Ti(({scene:K})=>K);r=Array.isArray(r)?r:[r,r];const S=r[0]+r[1]>0,_=M.useRef(null),[b]=M.useState(()=>new Qs),[A]=M.useState(()=>new F),[R]=M.useState(()=>new F),[P]=M.useState(()=>new F),[D]=M.useState(()=>new _t),[V]=M.useState(()=>new F(0,0,-1)),[C]=M.useState(()=>new on),[L]=M.useState(()=>new F),[W]=M.useState(()=>new F),[Q]=M.useState(()=>new on),[z]=M.useState(()=>new _t),[j]=M.useState(()=>new Rn),Y=M.useCallback(()=>{var K;const se=_.current.parent||((K=_.current)==null?void 0:K.__r3f.parent);if(!se||(R.setFromMatrixPosition(se.matrixWorld),P.setFromMatrixPosition(x.matrixWorld),D.extractRotation(se.matrixWorld),A.set(0,0,1),A.applyMatrix4(D),R.addScaledVector(A,p),L.subVectors(R,P),L.dot(A)>0))return;L.reflect(A).negate(),L.add(R),D.extractRotation(x.matrixWorld),V.set(0,0,-1),V.applyMatrix4(D),V.add(P),W.subVectors(R,V),W.reflect(A).negate(),W.add(R),j.position.copy(L),j.up.set(0,1,0),j.up.applyMatrix4(D),j.up.reflect(A),j.lookAt(W),j.far=x.far,j.updateMatrixWorld(),j.projectionMatrix.copy(x.projectionMatrix),z.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),z.multiply(j.projectionMatrix),z.multiply(j.matrixWorldInverse),z.multiply(se.matrixWorld),b.setFromNormalAndCoplanarPoint(A,R),b.applyMatrix4(j.matrixWorldInverse),C.set(b.normal.x,b.normal.y,b.normal.z,b.constant);const ve=j.projectionMatrix;Q.x=(Math.sign(C.x)+ve.elements[8])/ve.elements[0],Q.y=(Math.sign(C.y)+ve.elements[9])/ve.elements[5],Q.z=-1,Q.w=(1+ve.elements[10])/ve.elements[14],C.multiplyScalar(2/C.dot(Q)),ve.elements[2]=C.x,ve.elements[6]=C.y,ve.elements[10]=C.z+1,ve.elements[14]=C.w},[x,p]),[re,U,X,q]=M.useMemo(()=>{const K={minFilter:fn,magFilter:fn,type:tl},se=new gi(t,t,K);se.depthBuffer=!0,se.depthTexture=new Q0(t,t),se.depthTexture.format=Bo,se.depthTexture.type=Up;const ve=new gi(t,t,K),te=new HX({gl:w,resolution:t,width:r[0],height:r[1],minDepthThreshold:i,maxDepthThreshold:s,depthScale:o,depthToBlurRatioBias:a}),le={mirror:l,textureMatrix:z,mixBlur:n,tDiffuse:se.texture,tDepth:se.depthTexture,tDiffuseBlur:ve.texture,hasBlur:S,mixStrength:e,minDepthThreshold:i,maxDepthThreshold:s,depthScale:o,depthToBlurRatioBias:a,distortion:u,distortionMap:h,mixContrast:f,"defines-USE_BLUR":S?"":void 0,"defines-USE_DEPTH":o>0?"":void 0,"defines-USE_DISTORTION":h?"":void 0};return[se,ve,te,le]},[w,r,z,t,l,S,n,e,i,s,o,a,u,h,f]);return Fc(()=>{var K;const se=_.current.parent||((K=_.current)==null?void 0:K.__r3f.parent);if(!se)return;se.visible=!1;const ve=w.xr.enabled,te=w.shadowMap.autoUpdate;Y(),w.xr.enabled=!1,w.shadowMap.autoUpdate=!1,w.setRenderTarget(re),w.state.buffers.depth.setMask(!0),w.autoClear||w.clear(),w.render(g,j),S&&X.render(w,re,U),w.xr.enabled=ve,w.shadowMap.autoUpdate=te,se.visible=!0,w.setRenderTarget(null)}),M.createElement("meshReflectorMaterialImpl",Ue({attach:"material",key:"key"+q["defines-USE_BLUR"]+q["defines-USE_DEPTH"]+q["defines-USE_DISTORTION"],ref:DX([_,v])},q,m))}),GX=({size:n=250,...e})=>N.jsxs("mesh",{...e,children:[N.jsx("planeGeometry",{args:[n,n]}),N.jsx(WX,{mirror:1,blur:[500,100],resolution:1024,mixBlur:12,mixStrength:1.5,roughness:1,depthScale:1.2,minDepthThreshold:.4,maxDepthThreshold:1.4})]}),jX=M.createContext(null);function XX(){const n=M.useContext(jX);if(!n)throw new Error("useSwarmVisualConfigContext must be used within a SwarmVisualConfigContextProvider");return n.config}const qX=({motionMapper:n,maxPoints:e=1e3,pointSize:t=.2,maxDim:r=2,color:i="white"})=>{const s=Math.max(1,Math.floor(Math.cbrt(e))),o=Math.pow(s,3),a=M.useRef(null),l=M.useMemo(()=>new F,[]),u=M.useMemo(()=>new F,[]);return M.useEffect(()=>{const f=a.current.geometry.attributes.position,h=r/s;let p=0;for(let m=0;m{const p=f.getElapsedTime(),m=a.current.geometry.attributes.position;for(let v=0;v{const{maxDim:e,pointSize:t}=XX();return N.jsxs(N.Fragment,{children:[N.jsx(qX,{motionMapper:n,maxDim:e,pointSize:t}),N.jsx(GX,{position:new F(0,0,-1.5*e)})]})},ub=Object.freeze(Object.defineProperty({__proto__:null,default:hO},Symbol.toStringTag,{value:"Module"}));class YX{constructor(e=1,t=.5){at(this,"noise3D");at(this,"spatialScale");at(this,"curlAmount");at(this,"tmpVelocity");this.spatialScale=e,this.curlAmount=t,this.noise3D=aD(),this.tmpVelocity=new F}computeCurl(e,t,r,i){let o,a,l,u;o=this.noise3D(t,r+.001,i),a=this.noise3D(t,r-.001,i),l=(o-a)/(2*.001),o=this.noise3D(t,r,i+.001),a=this.noise3D(t,r,i-.001),u=(o-a)/(2*.001),e.x=l-u,o=this.noise3D(t,r,i+.001),a=this.noise3D(t,r,i-.001),l=(o-a)/(2*.001),o=this.noise3D(t+.001,r,i),a=this.noise3D(t-.001,r,i),u=(o-a)/(2*.001),e.y=l-u,o=this.noise3D(t+.001,r,i),a=this.noise3D(t-.001,r,i),l=(o-a)/(2*.001),o=this.noise3D(t,r+.001,i),a=this.noise3D(t,r-.001,i),u=(o-a)/(2*.001),e.z=l-u,e.normalize()}map(e,t,r,i=new F){return this.computeCurl(this.tmpVelocity,this.spatialScale*e.x,this.spatialScale*e.y,this.spatialScale*e.z),this.tmpVelocity.multiplyScalar(this.curlAmount*t),i.copy(e),i.add(this.tmpVelocity),i}}const ZX=()=>{const t=new YX(2,.5);return N.jsx(hO,{motionMapper:t})};class KX extends vM{constructor(t=1,r){super(t);at(this,"periodSec");at(this,"b");this.periodSec=1/r,this.b=rD/this.periodSec}map_1D(t,r=0){return this.amplitude*Math.sin(this.b*t+r)}map_2D(t,r,i=0){const s=Math.hypot(t-.5,r-.5)/ah;return this.amplitude*Math.sin(this.b*s+i)}map_3D(t,r,i,s=0){const o=Math.hypot(t-.5,r-.5,i-.5)/iD;return this.amplitude*Math.sin(this.b*o+s)}map_3DFaces(t,r,i,s=0){const o=gM(t,r,i,1);return this.amplitude*Math.sin(this.b*o+s)}}class QX{constructor(e,t=1,r=.75){at(this,"mappers");at(this,"amplitude");this.amplitude=t,this.mappers=[];for(let i=0;i=e.length-1?t:r*t;t-=s,this.mappers.push(new KX(s,e[i]))}}map(e,t,r=0,i=0,s=0){let o=0;for(const a of this.mappers)o+=a.map(e,t,r,i,s);return o}}const JX=({visual:n})=>{const e=M.useMemo(()=>M.lazy(async()=>await mM(Object.assign({"./audioScope/reactive.tsx":()=>ln(()=>Promise.resolve().then(()=>pM),void 0),"./boxes/reactive.tsx":()=>ln(()=>import("./reactive-113ac4c3.js"),[]),"./cube/reactive.tsx":()=>ln(()=>import("./reactive-0bb7cde1.js"),[]),"./diffusedRing/reactive.tsx":()=>ln(()=>import("./reactive-66e7642c.js"),["assets/reactive-66e7642c.js","assets/Noise-108969e2.js"]),"./dna/reactive.tsx":()=>ln(()=>import("./reactive-d6904db8.js"),["assets/reactive-d6904db8.js","assets/Noise-108969e2.js"]),"./grid/reactive.tsx":()=>ln(()=>import("./reactive-49d9d480.js"),[]),"./ribbons/reactive.tsx":()=>ln(()=>import("./reactive-8030d939.js"),[]),"./sphere/reactive.tsx":()=>ln(()=>import("./reactive-dcfb10cc.js"),[]),"./stencil/reactive.tsx":()=>ln(()=>import("./reactive-2fe6b979.js"),[]),"./swarm/reactive.tsx":()=>ln(()=>Promise.resolve().then(()=>ub),void 0)}),`./${n}/reactive.tsx`)),[n]),{maxAmplitude:t,waveformFrequenciesHz:r,amplitudeSplitRatio:i}=PL(),s=new QX(r,t,i);return N.jsx(M.Suspense,{fallback:null,children:N.jsx(e,{coordinateMapper:s})})},Lo={AUTO_ORBIT:"AUTO_ORBIT",ORBIT_CONTROLS:"ORBIT_CONTROLS"},db=M.createContext(null),eq=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.mode)??Lo.ORBIT_CONTROLS),[i,s]=M.useState((n==null?void 0:n.autoOrbitAfterSleepMs)??1e4);return N.jsx(db.Provider,{value:{config:{mode:t,autoOrbitAfterSleepMs:i},setters:{setMode:r,setAutoOrbitAfterSleepMs:s}},children:e})};function pO(){const n=M.useContext(db);if(!n)throw new Error("useCameraControlsContext must be used within a CameraControlsContextProvider");return n.config}function mO(){const n=M.useContext(db);if(!n)throw new Error("useCameraControlsContext must be used within a CameraControlsContextProvider");return n.setters}const tq=(n,e)=>{const t=Math.sin(e.phi)*e.radius;return n.x=t*Math.sin(e.theta),n.z=Math.cos(e.phi)*e.radius,n.y=t*Math.cos(e.theta),n},nq=()=>{const{visual:n}=kc();switch(n){case"ribbons":return{rMin:10,rMax:15,rSpeed:.1,thetaMin:Math.PI/8,thetaMax:2*Math.PI-Math.PI/8,thetaSpeed:.025,phiMin:Math.PI/3,phiMax:Math.PI/2.1,phiSpeed:.25};case"sphere":return{rMin:10,rMax:15,rSpeed:.1,thetaMin:0,thetaMax:2*Math.PI,thetaSpeed:.025,phiMin:Math.PI/3,phiMax:Math.PI/2,phiSpeed:.25};case"cube":return{rMin:12,rMax:20,rSpeed:.1,thetaMin:0,thetaMax:2*Math.PI,thetaSpeed:.025,phiMin:Math.PI/4,phiMax:Math.PI/2,phiSpeed:.25};case"diffusedRing":return{rMin:10,rMax:18,rSpeed:.1,thetaMin:0,thetaMax:2*Math.PI,thetaSpeed:.025,phiMin:Math.PI/8,phiMax:Math.PI/2.25,phiSpeed:.25};case"boxes":case"dna":case"grid":return{rMin:15,rMax:22,rSpeed:.1,thetaMin:0,thetaMax:2*Math.PI,thetaSpeed:.025,phiMin:Math.PI/3,phiMax:Math.PI/2,phiSpeed:.25};default:return n}},rq=()=>{const n=Ti(h=>h.camera),{rMin:e,rMax:t,rSpeed:r,thetaMin:i,thetaMax:s,thetaSpeed:o,phiMin:a,phiMax:l,phiSpeed:u}=nq(),f=new Zv;return Fc(({clock:h})=>{const p=h.elapsedTime,m=.5*(1+Math.sin(p*r)),v=e+m*(t-e),w=.5*(1+Math.cos(p*o)),x=i+w*(s-i),g=.5*(1+Math.cos(p*u)),S=a+g*(l-a);tq(n.position,f.set(v,S,x)),n.lookAt(0,0,0)}),null};class iq{constructor(e=.5,t=150,r=500){at(this,"clock",new jp(!0));at(this,"bufferSize",1e3);at(this,"lastEventElapsedMs",0);at(this,"buffer",Array.from({length:this.bufferSize}).map(e=>({value:0,elapsedTimeMs:0})));at(this,"threshold");at(this,"windowSizeMs");at(this,"cooldownMs");at(this,"observationCount",0);this.threshold=e,this.windowSizeMs=t,this.cooldownMs=r}get timeSinceLastEventMs(){return this.clock.elapsedTime*1e3-this.lastEventElapsedMs}getBufferAvg(e){const t=e-this.windowSizeMs,r=e,i=this.buffer.reduce((s,o)=>o.elapsedTimeMsr?s:{sum:s.sum+o.value,count:s.count+1},{sum:0,count:0});return i.count>0?i.sum/i.count:0}step(e){const t=this.clock.getElapsedTime()*1e3,r=this.observationCount%this.bufferSize;return this.buffer[r].value=e,this.buffer[r].elapsedTimeMs=t,this.observationCount++,this.timeSinceLastEventMsthis.threshold?(this.lastEventElapsedMs=t,!0):!1}}const sq=({scalarTracker:n})=>{const{paletteTrackEnergy:e}=kc(),t=new iq(.5,50,500),{nextPalette:r}=Yd();return Fc(()=>{e&&t.step(n.getNormalizedValue())&&r()}),N.jsx(N.Fragment,{})},oq=()=>{const n=qE(),e=new sD(n);return N.jsx(sq,{scalarTracker:e})},aq=({mode:n})=>{const{visual:e}=kc();switch(n){case Rt.WAVE_FORM:return N.jsx(JX,{visual:e});case Rt.NOISE:return N.jsx(R9,{visual:e});case Rt.PARTICLE_NOISE:return N.jsx(ZX,{});case Rt.AUDIO:return N.jsx(_9,{visual:e});default:return n}},lq=()=>{const{mode:n,autoOrbitAfterSleepMs:e}=pO(),{setMode:t}=mO(),{canvasInteractionEventTracker:r}=YH();switch(Fc(()=>{n===Lo.ORBIT_CONTROLS&&e>0&&r.msSinceLastEvent>e?t(Lo.AUTO_ORBIT):n===Lo.AUTO_ORBIT&&r.msSinceLastEventN.jsxs(tD,{camera:{fov:45,near:1,far:1e3,position:[-17,-6,6.5],up:[0,0,1]},linear:!0,children:[N.jsx(DL,{}),N.jsx("ambientLight",{intensity:Math.PI}),N.jsx(SG,{}),N.jsx(aq,{mode:n}),N.jsx(lq,{}),N.jsx(oq,{})]}),O0=M.forwardRef(({className:n,...e},t)=>N.jsx("div",{ref:t,className:jt("grid size-10 flex-none grow cursor-pointer snap-center place-items-center rounded-sm bg-gradient-to-b from-slate-700 to-black text-white shadow-inner duration-300 ease-in-out hover:scale-110 hover:from-slate-500 hover:to-slate-900 aria-selected:from-slate-100 aria-selected:to-slate-500 aria-selected:text-black",n),...e}));O0.displayName="DockItem";const gO=({className:n,children:e,...t})=>N.jsx("div",{className:jt("pointer-events-auto flex h-full w-full snap-x snap-mandatory flex-row items-center justify-start gap-4 overflow-auto rounded-xl bg-gradient-to-t from-white/10 to-white/0 p-4 shadow-inner",n),...t,children:e}),vO=({className:n,children:e,...t})=>N.jsx("div",{className:jt("max-w-4/5 sm:max-w-3/5 pointer-events-none h-fit overflow-hidden bg-transparent",n),...t,children:e}),uq=({visual:n})=>{switch(n){case"grid":return N.jsx(LW,{});case"cube":return N.jsx(EW,{});case"sphere":return N.jsx(IW,{});case"diffusedRing":return N.jsx(CW,{});case"dna":return N.jsx(AW,{});case"boxes":return N.jsx(MW,{});case"ribbons":return N.jsx(FW,{});default:return n}},dq=({...n})=>{const{visual:e}=kc(),{setVisual:t}=dM();return N.jsx(vO,{...n,children:N.jsx(gO,{children:AL.map(r=>N.jsx(O0,{"aria-selected":r===e,onClick:()=>t(r),children:N.jsx(uq,{visual:r})},`dock_item_${r}`))})})};function bt(n,e,{checkForDefaultPrevented:t=!0}={}){return function(i){if(n==null||n(i),t===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function fq(n,e){typeof n=="function"?n(e):n!=null&&(n.current=e)}function yO(...n){return e=>n.forEach(t=>fq(t,e))}function Zt(...n){return M.useCallback(yO(...n),n)}function ta(n,e=[]){let t=[];function r(s,o){const a=M.createContext(o),l=t.length;t=[...t,o];function u(h){const{scope:p,children:m,...v}=h,w=(p==null?void 0:p[n][l])||a,x=M.useMemo(()=>v,Object.values(v));return M.createElement(w.Provider,{value:x},m)}function f(h,p){const m=(p==null?void 0:p[n][l])||a,v=M.useContext(m);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,f]}const i=()=>{const s=t.map(o=>M.createContext(o));return function(a){const l=(a==null?void 0:a[n])||s;return M.useMemo(()=>({[`__scope${n}`]:{...a,[n]:l}}),[a,l])}};return i.scopeName=n,[r,hq(i,...e)]}function hq(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const h=l(s)[`__scope${u}`];return{...a,...h}},{});return M.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return t.scopeName=e.scopeName,t}function Xn(n){const e=M.useRef(n);return M.useEffect(()=>{e.current=n}),M.useMemo(()=>(...t)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...t)},[])}function Cc({prop:n,defaultProp:e,onChange:t=()=>{}}){const[r,i]=pq({defaultProp:e,onChange:t}),s=n!==void 0,o=s?n:r,a=Xn(t),l=M.useCallback(u=>{if(s){const h=typeof u=="function"?u(n):u;h!==n&&a(h)}else i(u)},[s,n,i,a]);return[o,l]}function pq({defaultProp:n,onChange:e}){const t=M.useState(n),[r]=t,i=M.useRef(r),s=Xn(e);return M.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),t}function fb(n){const e=M.useRef({value:n,previous:n});return M.useMemo(()=>(e.current.value!==n&&(e.current.previous=e.current.value,e.current.value=n),e.current.previous),[n])}const us=globalThis!=null&&globalThis.document?M.useLayoutEffect:()=>{};function hb(n){const[e,t]=M.useState(void 0);return us(()=>{if(n){t({width:n.offsetWidth,height:n.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=n.offsetWidth,a=n.offsetHeight;t({width:o,height:a})});return r.observe(n,{box:"border-box"}),()=>r.unobserve(n)}else t(void 0)},[n]),e}const Ac=M.forwardRef((n,e)=>{const{children:t,...r}=n,i=M.Children.toArray(t),s=i.find(gq);if(s){const o=s.props.children,a=i.map(l=>l===s?M.Children.count(o)>1?M.Children.only(null):M.isValidElement(o)?o.props.children:null:l);return M.createElement(Hw,Ue({},r,{ref:e}),M.isValidElement(o)?M.cloneElement(o,void 0,a):null)}return M.createElement(Hw,Ue({},r,{ref:e}),t)});Ac.displayName="Slot";const Hw=M.forwardRef((n,e)=>{const{children:t,...r}=n;return M.isValidElement(t)?M.cloneElement(t,{...vq(r,t.props),ref:e?yO(e,t.ref):t.ref}):M.Children.count(t)>1?M.Children.only(null):null});Hw.displayName="SlotClone";const mq=({children:n})=>M.createElement(M.Fragment,null,n);function gq(n){return M.isValidElement(n)&&n.type===mq}function vq(n,e){const t={...e};for(const r in e){const i=n[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?t[r]=(...a)=>{s(...a),i(...a)}:i&&(t[r]=i):r==="style"?t[r]={...i,...s}:r==="className"&&(t[r]=[i,s].filter(Boolean).join(" "))}return{...n,...t}}const yq=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Dt=yq.reduce((n,e)=>{const t=M.forwardRef((r,i)=>{const{asChild:s,...o}=r,a=s?Ac:e;return M.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),M.createElement(a,Ue({},o,{ref:i}))});return t.displayName=`Primitive.${e}`,{...n,[e]:t}},{});function xO(n,e){n&&Vc.flushSync(()=>n.dispatchEvent(e))}const _O="Switch",[xq,gee]=ta(_O),[_q,Sq]=xq(_O),wq=M.forwardRef((n,e)=>{const{__scopeSwitch:t,name:r,checked:i,defaultChecked:s,required:o,disabled:a,value:l="on",onCheckedChange:u,...f}=n,[h,p]=M.useState(null),m=Zt(e,S=>p(S)),v=M.useRef(!1),w=h?!!h.closest("form"):!0,[x=!1,g]=Cc({prop:i,defaultProp:s,onChange:u});return M.createElement(_q,{scope:t,checked:x,disabled:a},M.createElement(Dt.button,Ue({type:"button",role:"switch","aria-checked":x,"aria-required":o,"data-state":SO(x),"data-disabled":a?"":void 0,disabled:a,value:l},f,{ref:m,onClick:bt(n.onClick,S=>{g(_=>!_),w&&(v.current=S.isPropagationStopped(),v.current||S.stopPropagation())})})),w&&M.createElement(bq,{control:h,bubbles:!v.current,name:r,value:l,checked:x,required:o,disabled:a,style:{transform:"translateX(-100%)"}}))}),Eq="SwitchThumb",Mq=M.forwardRef((n,e)=>{const{__scopeSwitch:t,...r}=n,i=Sq(Eq,t);return M.createElement(Dt.span,Ue({"data-state":SO(i.checked),"data-disabled":i.disabled?"":void 0},r,{ref:e}))}),bq=n=>{const{control:e,checked:t,bubbles:r=!0,...i}=n,s=M.useRef(null),o=fb(t),a=hb(e);return M.useEffect(()=>{const l=s.current,u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"checked").set;if(o!==t&&h){const p=new Event("click",{bubbles:r});h.call(l,t),l.dispatchEvent(p)}},[o,t,r]),M.createElement("input",Ue({type:"checkbox","aria-hidden":!0,defaultChecked:t},i,{tabIndex:-1,ref:s,style:{...n.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function SO(n){return n?"checked":"unchecked"}const wO=wq,Tq=Mq,Ja=M.forwardRef(({className:n,...e},t)=>N.jsx(wO,{className:jt("peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",n),...e,ref:t,children:N.jsx(Tq,{className:jt("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Ja.displayName=wO.displayName;function vp(n,[e,t]){return Math.min(t,Math.max(e,n))}function pb(n){const e=n+"CollectionProvider",[t,r]=ta(e),[i,s]=t(e,{collectionRef:{current:null},itemMap:new Map}),o=m=>{const{scope:v,children:w}=m,x=Ki.useRef(null),g=Ki.useRef(new Map).current;return Ki.createElement(i,{scope:v,itemMap:g,collectionRef:x},w)},a=n+"CollectionSlot",l=Ki.forwardRef((m,v)=>{const{scope:w,children:x}=m,g=s(a,w),S=Zt(v,g.collectionRef);return Ki.createElement(Ac,{ref:S},x)}),u=n+"CollectionItemSlot",f="data-radix-collection-item",h=Ki.forwardRef((m,v)=>{const{scope:w,children:x,...g}=m,S=Ki.useRef(null),_=Zt(v,S),b=s(u,w);return Ki.useEffect(()=>(b.itemMap.set(S,{ref:S,...g}),()=>void b.itemMap.delete(S))),Ki.createElement(Ac,{[f]:"",ref:_},x)});function p(m){const v=s(n+"CollectionConsumer",m);return Ki.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const g=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((b,A)=>g.indexOf(b.ref.current)-g.indexOf(A.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:o,Slot:l,ItemSlot:h},p,r]}const Cq=M.createContext(void 0);function Jp(n){const e=M.useContext(Cq);return n||e||"ltr"}function EO(n,e=globalThis==null?void 0:globalThis.document){const t=Xn(n);M.useEffect(()=>{const r=i=>{i.key==="Escape"&&t(i)};return e.addEventListener("keydown",r),()=>e.removeEventListener("keydown",r)},[t,e])}const $w="dismissableLayer.update",Aq="dismissableLayer.pointerDownOutside",Rq="dismissableLayer.focusOutside";let PR;const Pq=M.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Iq=M.forwardRef((n,e)=>{var t;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...u}=n,f=M.useContext(Pq),[h,p]=M.useState(null),m=(t=h==null?void 0:h.ownerDocument)!==null&&t!==void 0?t:globalThis==null?void 0:globalThis.document,[,v]=M.useState({}),w=Zt(e,D=>p(D)),x=Array.from(f.layers),[g]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=x.indexOf(g),_=h?x.indexOf(h):-1,b=f.layersWithOutsidePointerEventsDisabled.size>0,A=_>=S,R=Lq(D=>{const V=D.target,C=[...f.branches].some(L=>L.contains(V));!A||C||(s==null||s(D),a==null||a(D),D.defaultPrevented||l==null||l())},m),P=Dq(D=>{const V=D.target;[...f.branches].some(L=>L.contains(V))||(o==null||o(D),a==null||a(D),D.defaultPrevented||l==null||l())},m);return EO(D=>{_===f.layers.size-1&&(i==null||i(D),!D.defaultPrevented&&l&&(D.preventDefault(),l()))},m),M.useEffect(()=>{if(h)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(PR=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),IR(),()=>{r&&f.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=PR)}},[h,m,r,f]),M.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),IR())},[h,f]),M.useEffect(()=>{const D=()=>v({});return document.addEventListener($w,D),()=>document.removeEventListener($w,D)},[]),M.createElement(Dt.div,Ue({},u,{ref:w,style:{pointerEvents:b?A?"auto":"none":void 0,...n.style},onFocusCapture:bt(n.onFocusCapture,P.onFocusCapture),onBlurCapture:bt(n.onBlurCapture,P.onBlurCapture),onPointerDownCapture:bt(n.onPointerDownCapture,R.onPointerDownCapture)}))});function Lq(n,e=globalThis==null?void 0:globalThis.document){const t=Xn(n),r=M.useRef(!1),i=M.useRef(()=>{});return M.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){MO(Aq,t,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=u,e.addEventListener("click",i.current,{once:!0})):u()}r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,t]),{onPointerDownCapture:()=>r.current=!0}}function Dq(n,e=globalThis==null?void 0:globalThis.document){const t=Xn(n),r=M.useRef(!1);return M.useEffect(()=>{const i=s=>{s.target&&!r.current&&MO(Rq,t,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,t]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function IR(){const n=new CustomEvent($w);document.dispatchEvent(n)}function MO(n,e,t,{discrete:r}){const i=t.originalEvent.target,s=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:t});e&&i.addEventListener(n,e,{once:!0}),r?xO(i,s):i.dispatchEvent(s)}let bS=0;function bO(){M.useEffect(()=>{var n,e;const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(n=t[0])!==null&&n!==void 0?n:LR()),document.body.insertAdjacentElement("beforeend",(e=t[1])!==null&&e!==void 0?e:LR()),bS++,()=>{bS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),bS--}},[])}function LR(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",n}const TS="focusScope.autoFocusOnMount",CS="focusScope.autoFocusOnUnmount",DR={bubbles:!1,cancelable:!0},Nq=M.forwardRef((n,e)=>{const{loop:t=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=n,[a,l]=M.useState(null),u=Xn(i),f=Xn(s),h=M.useRef(null),p=Zt(e,w=>l(w)),m=M.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;M.useEffect(()=>{if(r){let w=function(_){if(m.paused||!a)return;const b=_.target;a.contains(b)?h.current=b:ba(h.current,{select:!0})},x=function(_){if(m.paused||!a)return;const b=_.relatedTarget;b!==null&&(a.contains(b)||ba(h.current,{select:!0}))},g=function(_){const b=document.activeElement;for(const A of _)A.removedNodes.length>0&&(a!=null&&a.contains(b)||ba(a))};document.addEventListener("focusin",w),document.addEventListener("focusout",x);const S=new MutationObserver(g);return a&&S.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",x),S.disconnect()}}},[r,a,m.paused]),M.useEffect(()=>{if(a){OR.add(m);const w=document.activeElement;if(!a.contains(w)){const g=new CustomEvent(TS,DR);a.addEventListener(TS,u),a.dispatchEvent(g),g.defaultPrevented||(Oq(Bq(TO(a)),{select:!0}),document.activeElement===w&&ba(a))}return()=>{a.removeEventListener(TS,u),setTimeout(()=>{const g=new CustomEvent(CS,DR);a.addEventListener(CS,f),a.dispatchEvent(g),g.defaultPrevented||ba(w??document.body,{select:!0}),a.removeEventListener(CS,f),OR.remove(m)},0)}}},[a,u,f,m]);const v=M.useCallback(w=>{if(!t&&!r||m.paused)return;const x=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,g=document.activeElement;if(x&&g){const S=w.currentTarget,[_,b]=kq(S);_&&b?!w.shiftKey&&g===b?(w.preventDefault(),t&&ba(_,{select:!0})):w.shiftKey&&g===_&&(w.preventDefault(),t&&ba(b,{select:!0})):g===S&&w.preventDefault()}},[t,r,m.paused]);return M.createElement(Dt.div,Ue({tabIndex:-1},o,{ref:p,onKeyDown:v}))});function Oq(n,{select:e=!1}={}){const t=document.activeElement;for(const r of n)if(ba(r,{select:e}),document.activeElement!==t)return}function kq(n){const e=TO(n),t=NR(e,n),r=NR(e.reverse(),n);return[t,r]}function TO(n){const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function NR(n,e){for(const t of n)if(!Uq(t,{upTo:e}))return t}function Uq(n,{upTo:e}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e!==void 0&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}function Fq(n){return n instanceof HTMLInputElement&&"select"in n}function ba(n,{select:e=!1}={}){if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),n!==t&&Fq(n)&&e&&n.select()}}const OR=zq();function zq(){let n=[];return{add(e){const t=n[0];e!==t&&(t==null||t.pause()),n=kR(n,e),n.unshift(e)},remove(e){var t;n=kR(n,e),(t=n[0])===null||t===void 0||t.resume()}}}function kR(n,e){const t=[...n],r=t.indexOf(e);return r!==-1&&t.splice(r,1),t}function Bq(n){return n.filter(e=>e.tagName!=="A")}const Vq=xF["useId".toString()]||(()=>{});let Hq=0;function mc(n){const[e,t]=M.useState(Vq());return us(()=>{n||t(r=>r??String(Hq++))},[n]),n||(e?`radix-${e}`:"")}const $q=["top","right","bottom","left"],ll=Math.min,Ai=Math.max,k0=Math.round,fv=Math.floor,cl=n=>({x:n,y:n}),Wq={left:"right",right:"left",bottom:"top",top:"bottom"},Gq={start:"end",end:"start"};function Ww(n,e,t){return Ai(n,ll(e,t))}function Ko(n,e){return typeof n=="function"?n(e):n}function Qo(n){return n.split("-")[0]}function Jd(n){return n.split("-")[1]}function mb(n){return n==="x"?"y":"x"}function gb(n){return n==="y"?"height":"width"}function ef(n){return["top","bottom"].includes(Qo(n))?"y":"x"}function vb(n){return mb(ef(n))}function jq(n,e,t){t===void 0&&(t=!1);const r=Jd(n),i=vb(n),s=gb(i);let o=i==="x"?r===(t?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=U0(o)),[o,U0(o)]}function Xq(n){const e=U0(n);return[Gw(n),e,Gw(e)]}function Gw(n){return n.replace(/start|end/g,e=>Gq[e])}function qq(n,e,t){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(n){case"top":case"bottom":return t?e?i:r:e?r:i;case"left":case"right":return e?s:o;default:return[]}}function Yq(n,e,t,r){const i=Jd(n);let s=qq(Qo(n),t==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(Gw)))),s}function U0(n){return n.replace(/left|right|bottom|top/g,e=>Wq[e])}function Zq(n){return{top:0,right:0,bottom:0,left:0,...n}}function CO(n){return typeof n!="number"?Zq(n):{top:n,right:n,bottom:n,left:n}}function F0(n){return{...n,top:n.y,left:n.x,right:n.x+n.width,bottom:n.y+n.height}}function UR(n,e,t){let{reference:r,floating:i}=n;const s=ef(e),o=vb(e),a=gb(o),l=Qo(e),u=s==="y",f=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,p=r[a]/2-i[a]/2;let m;switch(l){case"top":m={x:f,y:r.y-i.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:h};break;case"left":m={x:r.x-i.width,y:h};break;default:m={x:r.x,y:r.y}}switch(Jd(e)){case"start":m[o]-=p*(t&&u?-1:1);break;case"end":m[o]+=p*(t&&u?-1:1);break}return m}const Kq=async(n,e,t)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=t,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:n,floating:e,strategy:i}),{x:f,y:h}=UR(u,r,l),p=r,m={},v=0;for(let w=0;w({name:"arrow",options:n,async fn(e){const{x:t,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:u,padding:f=0}=Ko(n,e)||{};if(u==null)return{};const h=CO(f),p={x:t,y:r},m=vb(i),v=gb(m),w=await o.getDimensions(u),x=m==="y",g=x?"top":"left",S=x?"bottom":"right",_=x?"clientHeight":"clientWidth",b=s.reference[v]+s.reference[m]-p[m]-s.floating[v],A=p[m]-s.reference[m],R=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let P=R?R[_]:0;(!P||!await(o.isElement==null?void 0:o.isElement(R)))&&(P=a.floating[_]||s.floating[v]);const D=b/2-A/2,V=P/2-w[v]/2-1,C=ll(h[g],V),L=ll(h[S],V),W=C,Q=P-w[v]-L,z=P/2-w[v]/2+D,j=Ww(W,z,Q),Y=!l.arrow&&Jd(i)!=null&&z!==j&&s.reference[v]/2-(zW<=0)){var V,C;const W=(((V=s.flip)==null?void 0:V.index)||0)+1,Q=A[W];if(Q)return{data:{index:W,overflows:D},reset:{placement:Q}};let z=(C=D.filter(j=>j.overflows[0]<=0).sort((j,Y)=>j.overflows[1]-Y.overflows[1])[0])==null?void 0:C.placement;if(!z)switch(m){case"bestFit":{var L;const j=(L=D.map(Y=>[Y.placement,Y.overflows.filter(re=>re>0).reduce((re,U)=>re+U,0)]).sort((Y,re)=>Y[1]-re[1])[0])==null?void 0:L[0];j&&(z=j);break}case"initialPlacement":z=a;break}if(i!==z)return{reset:{placement:z}}}return{}}}};function FR(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function zR(n){return $q.some(e=>n[e]>=0)}const eY=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t}=e,{strategy:r="referenceHidden",...i}=Ko(n,e);switch(r){case"referenceHidden":{const s=await yp(e,{...i,elementContext:"reference"}),o=FR(s,t.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:zR(o)}}}case"escaped":{const s=await yp(e,{...i,altBoundary:!0}),o=FR(s,t.floating);return{data:{escapedOffsets:o,escaped:zR(o)}}}default:return{}}}}};async function tY(n,e){const{placement:t,platform:r,elements:i}=n,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Qo(t),a=Jd(t),l=ef(t)==="y",u=["left","top"].includes(o)?-1:1,f=s&&l?-1:1,h=Ko(e,n);let{mainAxis:p,crossAxis:m,alignmentAxis:v}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...h};return a&&typeof v=="number"&&(m=a==="end"?v*-1:v),l?{x:m*f,y:p*u}:{x:p*u,y:m*f}}const nY=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,r;const{x:i,y:s,placement:o,middlewareData:a}=e,l=await tY(e,n);return o===((t=a.offset)==null?void 0:t.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},rY=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:x=>{let{x:g,y:S}=x;return{x:g,y:S}}},...l}=Ko(n,e),u={x:t,y:r},f=await yp(e,l),h=ef(Qo(i)),p=mb(h);let m=u[p],v=u[h];if(s){const x=p==="y"?"top":"left",g=p==="y"?"bottom":"right",S=m+f[x],_=m-f[g];m=Ww(S,m,_)}if(o){const x=h==="y"?"top":"left",g=h==="y"?"bottom":"right",S=v+f[x],_=v-f[g];v=Ww(S,v,_)}const w=a.fn({...e,[p]:m,[h]:v});return{...w,data:{x:w.x-t,y:w.y-r}}}}},iY=function(n){return n===void 0&&(n={}),{options:n,fn(e){const{x:t,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Ko(n,e),f={x:t,y:r},h=ef(i),p=mb(h);let m=f[p],v=f[h];const w=Ko(a,e),x=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(l){const _=p==="y"?"height":"width",b=s.reference[p]-s.floating[_]+x.mainAxis,A=s.reference[p]+s.reference[_]-x.mainAxis;mA&&(m=A)}if(u){var g,S;const _=p==="y"?"width":"height",b=["top","left"].includes(Qo(i)),A=s.reference[h]-s.floating[_]+(b&&((g=o.offset)==null?void 0:g[h])||0)+(b?0:x.crossAxis),R=s.reference[h]+s.reference[_]+(b?0:((S=o.offset)==null?void 0:S[h])||0)-(b?x.crossAxis:0);vR&&(v=R)}return{[p]:m,[h]:v}}}},sY=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){const{placement:t,rects:r,platform:i,elements:s}=e,{apply:o=()=>{},...a}=Ko(n,e),l=await yp(e,a),u=Qo(t),f=Jd(t),h=ef(t)==="y",{width:p,height:m}=r.floating;let v,w;u==="top"||u==="bottom"?(v=u,w=f===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(w=u,v=f==="end"?"top":"bottom");const x=m-l[v],g=p-l[w],S=!e.middlewareData.shift;let _=x,b=g;if(h){const R=p-l.left-l.right;b=f||S?ll(g,R):R}else{const R=m-l.top-l.bottom;_=f||S?ll(x,R):R}if(S&&!f){const R=Ai(l.left,0),P=Ai(l.right,0),D=Ai(l.top,0),V=Ai(l.bottom,0);h?b=p-2*(R!==0||P!==0?R+P:Ai(l.left,l.right)):_=m-2*(D!==0||V!==0?D+V:Ai(l.top,l.bottom))}await o({...e,availableWidth:b,availableHeight:_});const A=await i.getDimensions(s.floating);return p!==A.width||m!==A.height?{reset:{rects:!0}}:{}}}};function ul(n){return AO(n)?(n.nodeName||"").toLowerCase():"#document"}function Ni(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function na(n){var e;return(e=(AO(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function AO(n){return n instanceof Node||n instanceof Ni(n).Node}function Jo(n){return n instanceof Element||n instanceof Ni(n).Element}function ho(n){return n instanceof HTMLElement||n instanceof Ni(n).HTMLElement}function BR(n){return typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Ni(n).ShadowRoot}function em(n){const{overflow:e,overflowX:t,overflowY:r,display:i}=ds(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!["inline","contents"].includes(i)}function oY(n){return["table","td","th"].includes(ul(n))}function yb(n){const e=xb(),t=ds(n);return t.transform!=="none"||t.perspective!=="none"||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(t.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(t.contain||"").includes(r))}function RO(n){let e=Fd(n);for(;ho(e)&&!zy(e);){if(yb(e))return e;e=Fd(e)}return null}function xb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function zy(n){return["html","body","#document"].includes(ul(n))}function ds(n){return Ni(n).getComputedStyle(n)}function By(n){return Jo(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function Fd(n){if(ul(n)==="html")return n;const e=n.assignedSlot||n.parentNode||BR(n)&&n.host||na(n);return BR(e)?e.host:e}function PO(n){const e=Fd(n);return zy(e)?n.ownerDocument?n.ownerDocument.body:n.body:ho(e)&&em(e)?e:PO(e)}function xp(n,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);const i=PO(n),s=i===((r=n.ownerDocument)==null?void 0:r.body),o=Ni(i);return s?e.concat(o,o.visualViewport||[],em(i)?i:[],o.frameElement&&t?xp(o.frameElement):[]):e.concat(i,xp(i,[],t))}function IO(n){const e=ds(n);let t=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=ho(n),s=i?n.offsetWidth:t,o=i?n.offsetHeight:r,a=k0(t)!==s||k0(r)!==o;return a&&(t=s,r=o),{width:t,height:r,$:a}}function _b(n){return Jo(n)?n:n.contextElement}function ad(n){const e=_b(n);if(!ho(e))return cl(1);const t=e.getBoundingClientRect(),{width:r,height:i,$:s}=IO(e);let o=(s?k0(t.width):t.width)/r,a=(s?k0(t.height):t.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const aY=cl(0);function LO(n){const e=Ni(n);return!xb()||!e.visualViewport?aY:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function lY(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==Ni(n)?!1:e}function Rc(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=n.getBoundingClientRect(),s=_b(n);let o=cl(1);e&&(r?Jo(r)&&(o=ad(r)):o=ad(n));const a=lY(s,t,r)?LO(s):cl(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,f=i.width/o.x,h=i.height/o.y;if(s){const p=Ni(s),m=r&&Jo(r)?Ni(r):r;let v=p.frameElement;for(;v&&r&&m!==p;){const w=ad(v),x=v.getBoundingClientRect(),g=ds(v),S=x.left+(v.clientLeft+parseFloat(g.paddingLeft))*w.x,_=x.top+(v.clientTop+parseFloat(g.paddingTop))*w.y;l*=w.x,u*=w.y,f*=w.x,h*=w.y,l+=S,u+=_,v=Ni(v).frameElement}}return F0({width:f,height:h,x:l,y:u})}const cY=[":popover-open",":modal"];function DO(n){let e=!1,t=0,r=0;function i(s){try{e=e||n.matches(s)}catch{}}if(cY.forEach(s=>{i(s)}),e){const s=RO(n);if(s){const o=s.getBoundingClientRect();t=o.x,r=o.y}}return[e,t,r]}function uY(n){let{elements:e,rect:t,offsetParent:r,strategy:i}=n;const s=na(r),[o]=e?DO(e.floating):[!1];if(r===s||o)return t;let a={scrollLeft:0,scrollTop:0},l=cl(1);const u=cl(0),f=ho(r);if((f||!f&&i!=="fixed")&&((ul(r)!=="body"||em(s))&&(a=By(r)),ho(r))){const h=Rc(r);l=ad(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-a.scrollLeft*l.x+u.x,y:t.y*l.y-a.scrollTop*l.y+u.y}}function dY(n){return Array.from(n.getClientRects())}function NO(n){return Rc(na(n)).left+By(n).scrollLeft}function fY(n){const e=na(n),t=By(n),r=n.ownerDocument.body,i=Ai(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Ai(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-t.scrollLeft+NO(n);const a=-t.scrollTop;return ds(r).direction==="rtl"&&(o+=Ai(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function hY(n,e){const t=Ni(n),r=na(n),i=t.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const u=xb();(!u||u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function pY(n,e){const t=Rc(n,!0,e==="fixed"),r=t.top+n.clientTop,i=t.left+n.clientLeft,s=ho(n)?ad(n):cl(1),o=n.clientWidth*s.x,a=n.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function VR(n,e,t){let r;if(e==="viewport")r=hY(n,t);else if(e==="document")r=fY(na(n));else if(Jo(e))r=pY(e,t);else{const i=LO(n);r={...e,x:e.x-i.x,y:e.y-i.y}}return F0(r)}function OO(n,e){const t=Fd(n);return t===e||!Jo(t)||zy(t)?!1:ds(t).position==="fixed"||OO(t,e)}function mY(n,e){const t=e.get(n);if(t)return t;let r=xp(n,[],!1).filter(a=>Jo(a)&&ul(a)!=="body"),i=null;const s=ds(n).position==="fixed";let o=s?Fd(n):n;for(;Jo(o)&&!zy(o);){const a=ds(o),l=yb(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||em(o)&&!l&&OO(n,o))?r=r.filter(f=>f!==o):i=a,o=Fd(o)}return e.set(n,r),r}function gY(n){let{element:e,boundary:t,rootBoundary:r,strategy:i}=n;const o=[...t==="clippingAncestors"?mY(e,this._c):[].concat(t),r],a=o[0],l=o.reduce((u,f)=>{const h=VR(e,f,i);return u.top=Ai(h.top,u.top),u.right=ll(h.right,u.right),u.bottom=ll(h.bottom,u.bottom),u.left=Ai(h.left,u.left),u},VR(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function vY(n){const{width:e,height:t}=IO(n);return{width:e,height:t}}function yY(n,e,t,r){const i=ho(e),s=na(e),o=t==="fixed",a=Rc(n,!0,o,e);let l={scrollLeft:0,scrollTop:0};const u=cl(0);if(i||!i&&!o)if((ul(e)!=="body"||em(s))&&(l=By(e)),i){const w=Rc(e,!0,o,e);u.x=w.x+e.clientLeft,u.y=w.y+e.clientTop}else s&&(u.x=NO(s));let f=a.left+l.scrollLeft-u.x,h=a.top+l.scrollTop-u.y;const[p,m,v]=DO(r);return p&&(f+=m,h+=v,i&&(f+=e.clientLeft,h+=e.clientTop)),{x:f,y:h,width:a.width,height:a.height}}function HR(n,e){return!ho(n)||ds(n).position==="fixed"?null:e?e(n):n.offsetParent}function kO(n,e){const t=Ni(n);if(!ho(n))return t;let r=HR(n,e);for(;r&&oY(r)&&ds(r).position==="static";)r=HR(r,e);return r&&(ul(r)==="html"||ul(r)==="body"&&ds(r).position==="static"&&!yb(r))?t:r||RO(n)||t}const xY=async function(n){const e=this.getOffsetParent||kO,t=this.getDimensions;return{reference:yY(n.reference,await e(n.floating),n.strategy,n.floating),floating:{x:0,y:0,...await t(n.floating)}}};function _Y(n){return ds(n).direction==="rtl"}const SY={convertOffsetParentRelativeRectToViewportRelativeRect:uY,getDocumentElement:na,getClippingRect:gY,getOffsetParent:kO,getElementRects:xY,getClientRects:dY,getDimensions:vY,getScale:ad,isElement:Jo,isRTL:_Y};function wY(n,e){let t=null,r;const i=na(n);function s(){var a;clearTimeout(r),(a=t)==null||a.disconnect(),t=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:u,top:f,width:h,height:p}=n.getBoundingClientRect();if(a||e(),!h||!p)return;const m=fv(f),v=fv(i.clientWidth-(u+h)),w=fv(i.clientHeight-(f+p)),x=fv(u),S={rootMargin:-m+"px "+-v+"px "+-w+"px "+-x+"px",threshold:Ai(0,ll(1,l))||1};let _=!0;function b(A){const R=A[0].intersectionRatio;if(R!==l){if(!_)return o();R?o(!1,R):r=setTimeout(()=>{o(!1,1e-7)},100)}_=!1}try{t=new IntersectionObserver(b,{...S,root:i.ownerDocument})}catch{t=new IntersectionObserver(b,S)}t.observe(n)}return o(!0),s}function EY(n,e,t,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=_b(n),f=i||s?[...u?xp(u):[],...xp(e)]:[];f.forEach(g=>{i&&g.addEventListener("scroll",t,{passive:!0}),s&&g.addEventListener("resize",t)});const h=u&&a?wY(u,t):null;let p=-1,m=null;o&&(m=new ResizeObserver(g=>{let[S]=g;S&&S.target===u&&m&&(m.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var _;(_=m)==null||_.observe(e)})),t()}),u&&!l&&m.observe(u),m.observe(e));let v,w=l?Rc(n):null;l&&x();function x(){const g=Rc(n);w&&(g.x!==w.x||g.y!==w.y||g.width!==w.width||g.height!==w.height)&&t(),w=g,v=requestAnimationFrame(x)}return t(),()=>{var g;f.forEach(S=>{i&&S.removeEventListener("scroll",t),s&&S.removeEventListener("resize",t)}),h==null||h(),(g=m)==null||g.disconnect(),m=null,l&&cancelAnimationFrame(v)}}const MY=rY,bY=Jq,TY=sY,CY=eY,$R=Qq,AY=iY,RY=(n,e,t)=>{const r=new Map,i={platform:SY,...t},s={...i.platform,_c:r};return Kq(n,e,{...i,platform:s})},PY=n=>{function e(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:n,fn(t){const{element:r,padding:i}=typeof n=="function"?n(t):n;return r&&e(r)?r.current!=null?$R({element:r.current,padding:i}).fn(t):{}:r?$R({element:r,padding:i}).fn(t):{}}}};var Vv=typeof document<"u"?M.useLayoutEffect:M.useEffect;function z0(n,e){if(n===e)return!0;if(typeof n!=typeof e)return!1;if(typeof n=="function"&&n.toString()===e.toString())return!0;let t,r,i;if(n&&e&&typeof n=="object"){if(Array.isArray(n)){if(t=n.length,t!==e.length)return!1;for(r=t;r--!==0;)if(!z0(n[r],e[r]))return!1;return!0}if(i=Object.keys(n),t=i.length,t!==Object.keys(e).length)return!1;for(r=t;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=t;r--!==0;){const s=i[r];if(!(s==="_owner"&&n.$$typeof)&&!z0(n[s],e[s]))return!1}return!0}return n!==n&&e!==e}function UO(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function WR(n,e){const t=UO(n);return Math.round(e*t)/t}function GR(n){const e=M.useRef(n);return Vv(()=>{e.current=n}),e}function IY(n){n===void 0&&(n={});const{placement:e="bottom",strategy:t="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=n,[f,h]=M.useState({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[p,m]=M.useState(r);z0(p,r)||m(r);const[v,w]=M.useState(null),[x,g]=M.useState(null),S=M.useCallback(re=>{re!==R.current&&(R.current=re,w(re))},[]),_=M.useCallback(re=>{re!==P.current&&(P.current=re,g(re))},[]),b=s||v,A=o||x,R=M.useRef(null),P=M.useRef(null),D=M.useRef(f),V=l!=null,C=GR(l),L=GR(i),W=M.useCallback(()=>{if(!R.current||!P.current)return;const re={placement:e,strategy:t,middleware:p};L.current&&(re.platform=L.current),RY(R.current,P.current,re).then(U=>{const X={...U,isPositioned:!0};Q.current&&!z0(D.current,X)&&(D.current=X,Vc.flushSync(()=>{h(X)}))})},[p,e,t,L]);Vv(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,h(re=>({...re,isPositioned:!1})))},[u]);const Q=M.useRef(!1);Vv(()=>(Q.current=!0,()=>{Q.current=!1}),[]),Vv(()=>{if(b&&(R.current=b),A&&(P.current=A),b&&A){if(C.current)return C.current(b,A,W);W()}},[b,A,W,C,V]);const z=M.useMemo(()=>({reference:R,floating:P,setReference:S,setFloating:_}),[S,_]),j=M.useMemo(()=>({reference:b,floating:A}),[b,A]),Y=M.useMemo(()=>{const re={position:t,left:0,top:0};if(!j.floating)return re;const U=WR(j.floating,f.x),X=WR(j.floating,f.y);return a?{...re,transform:"translate("+U+"px, "+X+"px)",...UO(j.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:U,top:X}},[t,a,j.floating,f.x,f.y]);return M.useMemo(()=>({...f,update:W,refs:z,elements:j,floatingStyles:Y}),[f,W,z,j,Y])}const FO="Popper",[zO,BO]=ta(FO),[LY,VO]=zO(FO),DY=n=>{const{__scopePopper:e,children:t}=n,[r,i]=M.useState(null);return M.createElement(LY,{scope:e,anchor:r,onAnchorChange:i},t)},NY="PopperAnchor",OY=M.forwardRef((n,e)=>{const{__scopePopper:t,virtualRef:r,...i}=n,s=VO(NY,t),o=M.useRef(null),a=Zt(e,o);return M.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:M.createElement(Dt.div,Ue({},i,{ref:a}))}),HO="PopperContent",[kY,vee]=zO(HO),UY=M.forwardRef((n,e)=>{var t,r,i,s,o,a,l,u;const{__scopePopper:f,side:h="bottom",sideOffset:p=0,align:m="center",alignOffset:v=0,arrowPadding:w=0,collisionBoundary:x=[],collisionPadding:g=0,sticky:S="partial",hideWhenDetached:_=!1,avoidCollisions:b=!0,onPlaced:A,...R}=n,P=VO(HO,f),[D,V]=M.useState(null),C=Zt(e,de=>V(de)),[L,W]=M.useState(null),Q=hb(L),z=(t=Q==null?void 0:Q.width)!==null&&t!==void 0?t:0,j=(r=Q==null?void 0:Q.height)!==null&&r!==void 0?r:0,Y=h+(m!=="center"?"-"+m:""),re=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},U=Array.isArray(x)?x:[x],X=U.length>0,q={padding:re,boundary:U.filter(FY),altBoundary:X},{refs:K,floatingStyles:se,placement:ve,isPositioned:te,middlewareData:le}=IY({strategy:"fixed",placement:Y,whileElementsMounted:EY,elements:{reference:P.anchor},middleware:[nY({mainAxis:p+j,alignmentAxis:v}),b&&MY({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?AY():void 0,...q}),b&&bY({...q}),TY({...q,apply:({elements:de,rects:Te,availableWidth:ye,availableHeight:Xe})=>{const{width:ze,height:k}=Te.reference,O=de.floating.style;O.setProperty("--radix-popper-available-width",`${ye}px`),O.setProperty("--radix-popper-available-height",`${Xe}px`),O.setProperty("--radix-popper-anchor-width",`${ze}px`),O.setProperty("--radix-popper-anchor-height",`${k}px`)}}),L&&PY({element:L,padding:w}),zY({arrowWidth:z,arrowHeight:j}),_&&CY({strategy:"referenceHidden"})]}),[Me,pe]=$O(ve),Ae=Xn(A);us(()=>{te&&(Ae==null||Ae())},[te,Ae]);const De=(i=le.arrow)===null||i===void 0?void 0:i.x,Re=(s=le.arrow)===null||s===void 0?void 0:s.y,Ce=((o=le.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,[H,xe]=M.useState();return us(()=>{D&&xe(window.getComputedStyle(D).zIndex)},[D]),M.createElement("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...se,transform:te?se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[(a=le.transformOrigin)===null||a===void 0?void 0:a.x,(l=le.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:n.dir},M.createElement(kY,{scope:f,placedSide:Me,onArrowChange:W,arrowX:De,arrowY:Re,shouldHideArrow:Ce},M.createElement(Dt.div,Ue({"data-side":Me,"data-align":pe},R,{ref:C,style:{...R.style,animation:te?void 0:"none",opacity:(u=le.hide)!==null&&u!==void 0&&u.referenceHidden?0:void 0}}))))});function FY(n){return n!==null}const zY=n=>({name:"transformOrigin",options:n,fn(e){var t,r,i,s,o;const{placement:a,rects:l,middlewareData:u}=e,h=((t=u.arrow)===null||t===void 0?void 0:t.centerOffset)!==0,p=h?0:n.arrowWidth,m=h?0:n.arrowHeight,[v,w]=$O(a),x={start:"0%",center:"50%",end:"100%"}[w],g=((r=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+p/2,S=((s=(o=u.arrow)===null||o===void 0?void 0:o.y)!==null&&s!==void 0?s:0)+m/2;let _="",b="";return v==="bottom"?(_=h?x:`${g}px`,b=`${-m}px`):v==="top"?(_=h?x:`${g}px`,b=`${l.floating.height+m}px`):v==="right"?(_=`${-m}px`,b=h?x:`${S}px`):v==="left"&&(_=`${l.floating.width+m}px`,b=h?x:`${S}px`),{data:{x:_,y:b}}}});function $O(n){const[e,t="center"]=n.split("-");return[e,t]}const BY=DY,VY=OY,HY=UY,$Y=M.forwardRef((n,e)=>{var t;const{container:r=globalThis==null||(t=globalThis.document)===null||t===void 0?void 0:t.body,...i}=n;return r?dO.createPortal(M.createElement(Dt.div,Ue({},i,{ref:e})),r):null}),WY=M.forwardRef((n,e)=>M.createElement(Dt.span,Ue({},n,{ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...n.style}})));var GY=function(n){if(typeof document>"u")return null;var e=Array.isArray(n)?n[0]:n;return e.ownerDocument.body},Ru=new WeakMap,hv=new WeakMap,pv={},AS=0,WO=function(n){return n&&(n.host||WO(n.parentNode))},jY=function(n,e){return e.map(function(t){if(n.contains(t))return t;var r=WO(t);return r&&n.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",n,". Doing nothing"),null)}).filter(function(t){return!!t})},XY=function(n,e,t,r){var i=jY(e,Array.isArray(n)?n:[n]);pv[t]||(pv[t]=new WeakMap);var s=pv[t],o=[],a=new Set,l=new Set(i),u=function(h){!h||a.has(h)||(a.add(h),u(h.parentNode))};i.forEach(u);var f=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(p){if(a.has(p))f(p);else{var m=p.getAttribute(r),v=m!==null&&m!=="false",w=(Ru.get(p)||0)+1,x=(s.get(p)||0)+1;Ru.set(p,w),s.set(p,x),o.push(p),w===1&&v&&hv.set(p,!0),x===1&&p.setAttribute(t,"true"),v||p.setAttribute(r,"true")}})};return f(e),a.clear(),AS++,function(){o.forEach(function(h){var p=Ru.get(h)-1,m=s.get(h)-1;Ru.set(h,p),s.set(h,m),p||(hv.has(h)||h.removeAttribute(r),hv.delete(h)),m||h.removeAttribute(t)}),AS--,AS||(Ru=new WeakMap,Ru=new WeakMap,hv=new WeakMap,pv={})}},GO=function(n,e,t){t===void 0&&(t="data-aria-hidden");var r=Array.from(Array.isArray(n)?n:[n]),i=e||GY(n);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),XY(r,i,t,"aria-hidden")):function(){return null}},to=function(){return to=Object.assign||function(e){for(var t,r=1,i=arguments.length;r"u")return cZ;var e=uZ(n),t=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-t+e[2]-e[0])}},fZ=YO(),hZ=function(n,e,t,r){var i=n.left,s=n.top,o=n.right,a=n.gap;return t===void 0&&(t="margin"),` - .`.concat(YY,` { + `)}get tDiffuse(){return this._tDiffuse.value}set tDiffuse(e){this._tDiffuse.value=e}get tDepth(){return this._tDepth.value}set tDepth(e){this._tDepth.value=e}get distortionMap(){return this._distortionMap.value}set distortionMap(e){this._distortionMap.value=e}get tDiffuseBlur(){return this._tDiffuseBlur.value}set tDiffuseBlur(e){this._tDiffuseBlur.value=e}get textureMatrix(){return this._textureMatrix.value}set textureMatrix(e){this._textureMatrix.value=e}get hasBlur(){return this._hasBlur.value}set hasBlur(e){this._hasBlur.value=e}get mirror(){return this._mirror.value}set mirror(e){this._mirror.value=e}get mixBlur(){return this._mixBlur.value}set mixBlur(e){this._mixBlur.value=e}get mixStrength(){return this._blurStrength.value}set mixStrength(e){this._blurStrength.value=e}get minDepthThreshold(){return this._minDepthThreshold.value}set minDepthThreshold(e){this._minDepthThreshold.value=e}get maxDepthThreshold(){return this._maxDepthThreshold.value}set maxDepthThreshold(e){this._maxDepthThreshold.value=e}get depthScale(){return this._depthScale.value}set depthScale(e){this._depthScale.value=e}get depthToBlurRatioBias(){return this._depthToBlurRatioBias.value}set depthToBlurRatioBias(e){this._depthToBlurRatioBias.value=e}get distortion(){return this._distortion.value}set distortion(e){this._distortion.value=e}get mixContrast(){return this._mixContrast.value}set mixContrast(e){this._mixContrast.value=e}};const iq=M.forwardRef(({mixBlur:n=0,mixStrength:e=1,resolution:t=256,blur:r=[0,0],minDepthThreshold:i=.9,maxDepthThreshold:s=1,depthScale:o=0,depthToBlurRatioBias:a=.25,mirror:l=0,distortion:u=1,mixContrast:f=1,distortionMap:h,reflectorOffset:p=0,...m},v)=>{HL({MeshReflectorMaterialImpl:rq});const w=Ti(({gl:K})=>K),x=Ti(({camera:K})=>K),g=Ti(({scene:K})=>K);r=Array.isArray(r)?r:[r,r];const S=r[0]+r[1]>0,_=M.useRef(null),[b]=M.useState(()=>new Js),[A]=M.useState(()=>new F),[R]=M.useState(()=>new F),[P]=M.useState(()=>new F),[D]=M.useState(()=>new _t),[V]=M.useState(()=>new F(0,0,-1)),[C]=M.useState(()=>new on),[L]=M.useState(()=>new F),[W]=M.useState(()=>new F),[Q]=M.useState(()=>new on),[z]=M.useState(()=>new _t),[j]=M.useState(()=>new Rn),Y=M.useCallback(()=>{var K;const se=_.current.parent||((K=_.current)==null?void 0:K.__r3f.parent);if(!se||(R.setFromMatrixPosition(se.matrixWorld),P.setFromMatrixPosition(x.matrixWorld),D.extractRotation(se.matrixWorld),A.set(0,0,1),A.applyMatrix4(D),R.addScaledVector(A,p),L.subVectors(R,P),L.dot(A)>0))return;L.reflect(A).negate(),L.add(R),D.extractRotation(x.matrixWorld),V.set(0,0,-1),V.applyMatrix4(D),V.add(P),W.subVectors(R,V),W.reflect(A).negate(),W.add(R),j.position.copy(L),j.up.set(0,1,0),j.up.applyMatrix4(D),j.up.reflect(A),j.lookAt(W),j.far=x.far,j.updateMatrixWorld(),j.projectionMatrix.copy(x.projectionMatrix),z.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),z.multiply(j.projectionMatrix),z.multiply(j.matrixWorldInverse),z.multiply(se.matrixWorld),b.setFromNormalAndCoplanarPoint(A,R),b.applyMatrix4(j.matrixWorldInverse),C.set(b.normal.x,b.normal.y,b.normal.z,b.constant);const ve=j.projectionMatrix;Q.x=(Math.sign(C.x)+ve.elements[8])/ve.elements[0],Q.y=(Math.sign(C.y)+ve.elements[9])/ve.elements[5],Q.z=-1,Q.w=(1+ve.elements[10])/ve.elements[14],C.multiplyScalar(2/C.dot(Q)),ve.elements[2]=C.x,ve.elements[6]=C.y,ve.elements[10]=C.z+1,ve.elements[14]=C.w},[x,p]),[re,U,X,q]=M.useMemo(()=>{const K={minFilter:dn,magFilter:dn,type:nl},se=new gi(t,t,K);se.depthBuffer=!0,se.depthTexture=new ey(t,t),se.depthTexture.format=Vo,se.depthTexture.type=zp;const ve=new gi(t,t,K),te=new nq({gl:w,resolution:t,width:r[0],height:r[1],minDepthThreshold:i,maxDepthThreshold:s,depthScale:o,depthToBlurRatioBias:a}),le={mirror:l,textureMatrix:z,mixBlur:n,tDiffuse:se.texture,tDepth:se.depthTexture,tDiffuseBlur:ve.texture,hasBlur:S,mixStrength:e,minDepthThreshold:i,maxDepthThreshold:s,depthScale:o,depthToBlurRatioBias:a,distortion:u,distortionMap:h,mixContrast:f,"defines-USE_BLUR":S?"":void 0,"defines-USE_DEPTH":o>0?"":void 0,"defines-USE_DISTORTION":h?"":void 0};return[se,ve,te,le]},[w,r,z,t,l,S,n,e,i,s,o,a,u,h,f]);return Bc(()=>{var K;const se=_.current.parent||((K=_.current)==null?void 0:K.__r3f.parent);if(!se)return;se.visible=!1;const ve=w.xr.enabled,te=w.shadowMap.autoUpdate;Y(),w.xr.enabled=!1,w.shadowMap.autoUpdate=!1,w.setRenderTarget(re),w.state.buffers.depth.setMask(!0),w.autoClear||w.clear(),w.render(g,j),S&&X.render(w,re,U),w.xr.enabled=ve,w.shadowMap.autoUpdate=te,se.visible=!0,w.setRenderTarget(null)}),M.createElement("meshReflectorMaterialImpl",Ue({attach:"material",key:"key"+q["defines-USE_BLUR"]+q["defines-USE_DEPTH"]+q["defines-USE_DISTORTION"],ref:XX([_,v])},q,m))}),sq=({size:n=250,...e})=>N.jsxs("mesh",{...e,children:[N.jsx("planeGeometry",{args:[n,n]}),N.jsx(iq,{mirror:1,blur:[500,100],resolution:1024,mixBlur:12,mixStrength:1.5,roughness:1,depthScale:1.2,minDepthThreshold:.4,maxDepthThreshold:1.4})]}),oq=M.createContext(null);function aq(){const n=M.useContext(oq);if(!n)throw new Error("useSwarmVisualConfigContext must be used within a SwarmVisualConfigContextProvider");return n.config}const lq=({motionMapper:n,maxPoints:e=1e3,pointSize:t=.2,maxDim:r=2,color:i="white"})=>{const s=Math.max(1,Math.floor(Math.cbrt(e))),o=Math.pow(s,3),a=M.useRef(null),l=M.useMemo(()=>new F,[]),u=M.useMemo(()=>new F,[]);return M.useEffect(()=>{const f=a.current.geometry.attributes.position,h=r/s;let p=0;for(let m=0;m{const p=f.getElapsedTime(),m=a.current.geometry.attributes.position;for(let v=0;v{const{maxDim:e,pointSize:t}=aq();return N.jsxs(N.Fragment,{children:[N.jsx(lq,{motionMapper:n,maxDim:e,pointSize:t}),N.jsx(sq,{position:new F(0,0,-1.5*e)})]})},cq=Object.freeze(Object.defineProperty({__proto__:null,default:xO},Symbol.toStringTag,{value:"Module"}));class uq{constructor(e=1,t=.5){at(this,"noise3D");at(this,"spatialScale");at(this,"curlAmount");at(this,"tmpVelocity");this.spatialScale=e,this.curlAmount=t,this.noise3D=hD(),this.tmpVelocity=new F}computeCurl(e,t,r,i){let o,a,l,u;o=this.noise3D(t,r+.001,i),a=this.noise3D(t,r-.001,i),l=(o-a)/(2*.001),o=this.noise3D(t,r,i+.001),a=this.noise3D(t,r,i-.001),u=(o-a)/(2*.001),e.x=l-u,o=this.noise3D(t,r,i+.001),a=this.noise3D(t,r,i-.001),l=(o-a)/(2*.001),o=this.noise3D(t+.001,r,i),a=this.noise3D(t-.001,r,i),u=(o-a)/(2*.001),e.y=l-u,o=this.noise3D(t+.001,r,i),a=this.noise3D(t-.001,r,i),l=(o-a)/(2*.001),o=this.noise3D(t,r+.001,i),a=this.noise3D(t,r-.001,i),u=(o-a)/(2*.001),e.z=l-u,e.normalize()}map(e,t,r,i=new F){return this.computeCurl(this.tmpVelocity,this.spatialScale*e.x,this.spatialScale*e.y,this.spatialScale*e.z),this.tmpVelocity.multiplyScalar(this.curlAmount*t),i.copy(e),i.add(this.tmpVelocity),i}}const dq=()=>{const t=new uq(2,.5);return N.jsx(xO,{motionMapper:t})};class fq extends vM{constructor(t=1,r){super(t);at(this,"periodSec");at(this,"b");this.periodSec=1/r,this.b=cD/this.periodSec}map_1D(t,r=0){return this.amplitude*Math.sin(this.b*t+r)}map_2D(t,r,i=0){const s=Math.hypot(t-.5,r-.5)/ch;return this.amplitude*Math.sin(this.b*s+i)}map_3D(t,r,i,s=0){const o=Math.hypot(t-.5,r-.5,i-.5)/uD;return this.amplitude*Math.sin(this.b*o+s)}map_3DFaces(t,r,i,s=0){const o=gM(t,r,i,1);return this.amplitude*Math.sin(this.b*o+s)}}class hq{constructor(e,t=1,r=.75){at(this,"mappers");at(this,"amplitude");this.amplitude=t,this.mappers=[];for(let i=0;i=e.length-1?t:r*t;t-=s,this.mappers.push(new fq(s,e[i]))}}map(e,t,r=0,i=0,s=0){let o=0;for(const a of this.mappers)o+=a.map(e,t,r,i,s);return o}}const pq=({visual:n})=>{const{maxAmplitude:e,waveformFrequenciesHz:t,amplitudeSplitRatio:r}=LL(),i=new hq(t,e,r);return N.jsx(yM,{visual:n,coordinateMapper:i})},Do={AUTO_ORBIT:"AUTO_ORBIT",ORBIT_CONTROLS:"ORBIT_CONTROLS"},db=M.createContext(null),mq=({initial:n=void 0,children:e})=>{const[t,r]=M.useState((n==null?void 0:n.mode)??Do.ORBIT_CONTROLS),[i,s]=M.useState((n==null?void 0:n.autoOrbitAfterSleepMs)??1e4);return N.jsx(db.Provider,{value:{config:{mode:t,autoOrbitAfterSleepMs:i},setters:{setMode:r,setAutoOrbitAfterSleepMs:s}},children:e})};function _O(){const n=M.useContext(db);if(!n)throw new Error("useCameraControlsContext must be used within a CameraControlsContextProvider");return n.config}function SO(){const n=M.useContext(db);if(!n)throw new Error("useCameraControlsContext must be used within a CameraControlsContextProvider");return n.setters}const gq=(n,e)=>{const t=Math.sin(e.phi)*e.radius;return n.x=t*Math.sin(e.theta),n.z=Math.cos(e.phi)*e.radius,n.y=t*Math.cos(e.theta),n},vq=()=>{const{visual:n}=Fc();switch(n){case pn.RIBBONS:return{rMin:10,rMax:15,rSpeed:.1,thetaMin:Math.PI/8,thetaMax:2*Math.PI-Math.PI/8,thetaSpeed:.025,phiMin:Math.PI/3,phiMax:Math.PI/2.1,phiSpeed:.25};case pn.SPHERE:return{rMin:10,rMax:15,rSpeed:.1,thetaMin:0,thetaMax:2*Math.PI,thetaSpeed:.025,phiMin:Math.PI/3,phiMax:Math.PI/2,phiSpeed:.25};case pn.CUBE:return{rMin:12,rMax:20,rSpeed:.1,thetaMin:0,thetaMax:2*Math.PI,thetaSpeed:.025,phiMin:Math.PI/4,phiMax:Math.PI/2,phiSpeed:.25};case pn.DIFFUSED_RING:return{rMin:10,rMax:18,rSpeed:.1,thetaMin:0,thetaMax:2*Math.PI,thetaSpeed:.025,phiMin:Math.PI/8,phiMax:Math.PI/2.25,phiSpeed:.25};case pn.WALK:return{rMin:15,rMax:22,rSpeed:.1,thetaMin:0,thetaMax:2*Math.PI,thetaSpeed:.025,phiMin:Math.PI/3.5,phiMax:Math.PI/2.25,phiSpeed:.25};case pn.BOXES:case pn.DNA:case pn.GRID:return{rMin:15,rMax:22,rSpeed:.1,thetaMin:0,thetaMax:2*Math.PI,thetaSpeed:.025,phiMin:Math.PI/3,phiMax:Math.PI/2,phiSpeed:.25};default:return n}},yq=()=>{const n=Ti(h=>h.camera),{rMin:e,rMax:t,rSpeed:r,thetaMin:i,thetaMax:s,thetaSpeed:o,phiMin:a,phiMax:l,phiSpeed:u}=vq(),f=new Qv;return Bc(({clock:h})=>{const p=h.elapsedTime,m=.5*(1+Math.sin(p*r)),v=e+m*(t-e),w=.5*(1+Math.cos(p*o)),x=i+w*(s-i),g=.5*(1+Math.cos(p*u)),S=a+g*(l-a);gq(n.position,f.set(v,S,x)),n.lookAt(0,0,0)}),null};class xq{constructor(e=.5,t=150,r=500){at(this,"clock",new qp(!0));at(this,"bufferSize",1e3);at(this,"lastEventElapsedMs",0);at(this,"buffer",Array.from({length:this.bufferSize}).map(e=>({value:0,elapsedTimeMs:0})));at(this,"threshold");at(this,"windowSizeMs");at(this,"cooldownMs");at(this,"observationCount",0);this.threshold=e,this.windowSizeMs=t,this.cooldownMs=r}get timeSinceLastEventMs(){return this.clock.elapsedTime*1e3-this.lastEventElapsedMs}getBufferAvg(e){const t=e-this.windowSizeMs,r=e,i=this.buffer.reduce((s,o)=>o.elapsedTimeMsr?s:{sum:s.sum+o.value,count:s.count+1},{sum:0,count:0});return i.count>0?i.sum/i.count:0}step(e){const t=this.clock.getElapsedTime()*1e3,r=this.observationCount%this.bufferSize;return this.buffer[r].value=e,this.buffer[r].elapsedTimeMs=t,this.observationCount++,this.timeSinceLastEventMsthis.threshold?(this.lastEventElapsedMs=t,!0):!1}}const _q=({scalarTracker:n})=>{const{paletteTrackEnergy:e}=Fc(),t=new xq(.5,50,500),{nextPalette:r}=Kd();return Bc(()=>{e&&t.step(n.getNormalizedValue())&&r()}),N.jsx(N.Fragment,{})},Sq=()=>{const n=ZE(),e=new dD(n);return N.jsx(_q,{scalarTracker:e})},wq=({mode:n})=>{const{visual:e}=Fc();switch(n){case Rt.WAVE_FORM:return N.jsx(pq,{visual:e});case Rt.NOISE:return N.jsx($9,{visual:e});case Rt.PARTICLE_NOISE:return N.jsx(dq,{});case Rt.AUDIO:return N.jsx(N9,{visual:e});default:return n}},Eq=()=>{const{mode:n,autoOrbitAfterSleepMs:e}=_O(),{setMode:t}=SO(),{canvasInteractionEventTracker:r}=t$();switch(Bc(()=>{n===Do.ORBIT_CONTROLS&&e>0&&r.msSinceLastEvent>e?t(Do.AUTO_ORBIT):n===Do.AUTO_ORBIT&&r.msSinceLastEventN.jsxs(aD,{camera:{fov:45,near:1,far:1e3,position:[-17,-6,6.5],up:[0,0,1]},linear:!0,children:[N.jsx(OL,{}),N.jsx("ambientLight",{intensity:Math.PI}),N.jsx(CG,{}),N.jsx(wq,{mode:n}),N.jsx(Eq,{}),N.jsx(Sq,{})]}),U0=M.forwardRef(({className:n,...e},t)=>N.jsx("div",{ref:t,className:jt("grid size-10 flex-none grow cursor-pointer snap-center place-items-center rounded-sm bg-gradient-to-b from-slate-700 to-black text-white shadow-inner duration-300 ease-in-out hover:scale-110 hover:from-slate-500 hover:to-slate-900 aria-selected:from-slate-100 aria-selected:to-slate-500 aria-selected:text-black",n),...e}));U0.displayName="DockItem";const wO=({className:n,children:e,...t})=>N.jsx("div",{className:jt("pointer-events-auto flex h-full w-full snap-x snap-mandatory flex-row items-center justify-start gap-4 overflow-auto rounded-xl bg-gradient-to-t from-white/10 to-white/0 p-4 shadow-inner",n),...t,children:e}),EO=({className:n,children:e,...t})=>N.jsx("div",{className:jt("pointer-events-none h-fit overflow-hidden bg-transparent",n),...t,children:e}),bq=({visual:n})=>{switch(n){case pn.GRID:return N.jsx(zW,{});case pn.CUBE:return N.jsx(RW,{});case pn.SPHERE:return N.jsx(FW,{});case pn.DIFFUSED_RING:return N.jsx(DW,{});case pn.DNA:return N.jsx(NW,{});case pn.BOXES:return N.jsx(PW,{});case pn.RIBBONS:return N.jsx(WW,{});case pn.WALK:return N.jsx(UW,{});default:return N.jsx(ML,{})}},Tq=({...n})=>{const{visual:e}=Fc(),{setVisual:t}=hM();return N.jsx(EO,{...n,children:N.jsx(wO,{children:PL.map(r=>N.jsx(U0,{"aria-selected":r===e,onClick:()=>t(r),children:N.jsx(bq,{visual:r})},`dock_item_${r}`))})})};function bt(n,e,{checkForDefaultPrevented:t=!0}={}){return function(i){if(n==null||n(i),t===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function Cq(n,e){typeof n=="function"?n(e):n!=null&&(n.current=e)}function MO(...n){return e=>n.forEach(t=>Cq(t,e))}function Zt(...n){return M.useCallback(MO(...n),n)}function na(n,e=[]){let t=[];function r(s,o){const a=M.createContext(o),l=t.length;t=[...t,o];function u(h){const{scope:p,children:m,...v}=h,w=(p==null?void 0:p[n][l])||a,x=M.useMemo(()=>v,Object.values(v));return M.createElement(w.Provider,{value:x},m)}function f(h,p){const m=(p==null?void 0:p[n][l])||a,v=M.useContext(m);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,f]}const i=()=>{const s=t.map(o=>M.createContext(o));return function(a){const l=(a==null?void 0:a[n])||s;return M.useMemo(()=>({[`__scope${n}`]:{...a,[n]:l}}),[a,l])}};return i.scopeName=n,[r,Aq(i,...e)]}function Aq(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const h=l(s)[`__scope${u}`];return{...a,...h}},{});return M.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return t.scopeName=e.scopeName,t}function Xn(n){const e=M.useRef(n);return M.useEffect(()=>{e.current=n}),M.useMemo(()=>(...t)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...t)},[])}function Rc({prop:n,defaultProp:e,onChange:t=()=>{}}){const[r,i]=Rq({defaultProp:e,onChange:t}),s=n!==void 0,o=s?n:r,a=Xn(t),l=M.useCallback(u=>{if(s){const h=typeof u=="function"?u(n):u;h!==n&&a(h)}else i(u)},[s,n,i,a]);return[o,l]}function Rq({defaultProp:n,onChange:e}){const t=M.useState(n),[r]=t,i=M.useRef(r),s=Xn(e);return M.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),t}function fb(n){const e=M.useRef({value:n,previous:n});return M.useMemo(()=>(e.current.value!==n&&(e.current.previous=e.current.value,e.current.value=n),e.current.previous),[n])}const us=globalThis!=null&&globalThis.document?M.useLayoutEffect:()=>{};function hb(n){const[e,t]=M.useState(void 0);return us(()=>{if(n){t({width:n.offsetWidth,height:n.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=n.offsetWidth,a=n.offsetHeight;t({width:o,height:a})});return r.observe(n,{box:"border-box"}),()=>r.unobserve(n)}else t(void 0)},[n]),e}const Pc=M.forwardRef((n,e)=>{const{children:t,...r}=n,i=M.Children.toArray(t),s=i.find(Iq);if(s){const o=s.props.children,a=i.map(l=>l===s?M.Children.count(o)>1?M.Children.only(null):M.isValidElement(o)?o.props.children:null:l);return M.createElement(Ww,Ue({},r,{ref:e}),M.isValidElement(o)?M.cloneElement(o,void 0,a):null)}return M.createElement(Ww,Ue({},r,{ref:e}),t)});Pc.displayName="Slot";const Ww=M.forwardRef((n,e)=>{const{children:t,...r}=n;return M.isValidElement(t)?M.cloneElement(t,{...Lq(r,t.props),ref:e?MO(e,t.ref):t.ref}):M.Children.count(t)>1?M.Children.only(null):null});Ww.displayName="SlotClone";const Pq=({children:n})=>M.createElement(M.Fragment,null,n);function Iq(n){return M.isValidElement(n)&&n.type===Pq}function Lq(n,e){const t={...e};for(const r in e){const i=n[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?t[r]=(...a)=>{s(...a),i(...a)}:i&&(t[r]=i):r==="style"?t[r]={...i,...s}:r==="className"&&(t[r]=[i,s].filter(Boolean).join(" "))}return{...n,...t}}const Dq=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Dt=Dq.reduce((n,e)=>{const t=M.forwardRef((r,i)=>{const{asChild:s,...o}=r,a=s?Pc:e;return M.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),M.createElement(a,Ue({},o,{ref:i}))});return t.displayName=`Primitive.${e}`,{...n,[e]:t}},{});function bO(n,e){n&&$c.flushSync(()=>n.dispatchEvent(e))}const TO="Switch",[Nq,Iee]=na(TO),[Oq,kq]=Nq(TO),Uq=M.forwardRef((n,e)=>{const{__scopeSwitch:t,name:r,checked:i,defaultChecked:s,required:o,disabled:a,value:l="on",onCheckedChange:u,...f}=n,[h,p]=M.useState(null),m=Zt(e,S=>p(S)),v=M.useRef(!1),w=h?!!h.closest("form"):!0,[x=!1,g]=Rc({prop:i,defaultProp:s,onChange:u});return M.createElement(Oq,{scope:t,checked:x,disabled:a},M.createElement(Dt.button,Ue({type:"button",role:"switch","aria-checked":x,"aria-required":o,"data-state":CO(x),"data-disabled":a?"":void 0,disabled:a,value:l},f,{ref:m,onClick:bt(n.onClick,S=>{g(_=>!_),w&&(v.current=S.isPropagationStopped(),v.current||S.stopPropagation())})})),w&&M.createElement(Bq,{control:h,bubbles:!v.current,name:r,value:l,checked:x,required:o,disabled:a,style:{transform:"translateX(-100%)"}}))}),Fq="SwitchThumb",zq=M.forwardRef((n,e)=>{const{__scopeSwitch:t,...r}=n,i=kq(Fq,t);return M.createElement(Dt.span,Ue({"data-state":CO(i.checked),"data-disabled":i.disabled?"":void 0},r,{ref:e}))}),Bq=n=>{const{control:e,checked:t,bubbles:r=!0,...i}=n,s=M.useRef(null),o=fb(t),a=hb(e);return M.useEffect(()=>{const l=s.current,u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"checked").set;if(o!==t&&h){const p=new Event("click",{bubbles:r});h.call(l,t),l.dispatchEvent(p)}},[o,t,r]),M.createElement("input",Ue({type:"checkbox","aria-hidden":!0,defaultChecked:t},i,{tabIndex:-1,ref:s,style:{...n.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function CO(n){return n?"checked":"unchecked"}const AO=Uq,Vq=zq,el=M.forwardRef(({className:n,...e},t)=>N.jsx(AO,{className:jt("peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",n),...e,ref:t,children:N.jsx(Vq,{className:jt("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));el.displayName=AO.displayName;function xp(n,[e,t]){return Math.min(t,Math.max(e,n))}function pb(n){const e=n+"CollectionProvider",[t,r]=na(e),[i,s]=t(e,{collectionRef:{current:null},itemMap:new Map}),o=m=>{const{scope:v,children:w}=m,x=Ki.useRef(null),g=Ki.useRef(new Map).current;return Ki.createElement(i,{scope:v,itemMap:g,collectionRef:x},w)},a=n+"CollectionSlot",l=Ki.forwardRef((m,v)=>{const{scope:w,children:x}=m,g=s(a,w),S=Zt(v,g.collectionRef);return Ki.createElement(Pc,{ref:S},x)}),u=n+"CollectionItemSlot",f="data-radix-collection-item",h=Ki.forwardRef((m,v)=>{const{scope:w,children:x,...g}=m,S=Ki.useRef(null),_=Zt(v,S),b=s(u,w);return Ki.useEffect(()=>(b.itemMap.set(S,{ref:S,...g}),()=>void b.itemMap.delete(S))),Ki.createElement(Pc,{[f]:"",ref:_},x)});function p(m){const v=s(n+"CollectionConsumer",m);return Ki.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const g=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((b,A)=>g.indexOf(b.ref.current)-g.indexOf(A.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:o,Slot:l,ItemSlot:h},p,r]}const Hq=M.createContext(void 0);function tm(n){const e=M.useContext(Hq);return n||e||"ltr"}function RO(n,e=globalThis==null?void 0:globalThis.document){const t=Xn(n);M.useEffect(()=>{const r=i=>{i.key==="Escape"&&t(i)};return e.addEventListener("keydown",r),()=>e.removeEventListener("keydown",r)},[t,e])}const Gw="dismissableLayer.update",$q="dismissableLayer.pointerDownOutside",Wq="dismissableLayer.focusOutside";let IR;const Gq=M.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jq=M.forwardRef((n,e)=>{var t;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...u}=n,f=M.useContext(Gq),[h,p]=M.useState(null),m=(t=h==null?void 0:h.ownerDocument)!==null&&t!==void 0?t:globalThis==null?void 0:globalThis.document,[,v]=M.useState({}),w=Zt(e,D=>p(D)),x=Array.from(f.layers),[g]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=x.indexOf(g),_=h?x.indexOf(h):-1,b=f.layersWithOutsidePointerEventsDisabled.size>0,A=_>=S,R=Xq(D=>{const V=D.target,C=[...f.branches].some(L=>L.contains(V));!A||C||(s==null||s(D),a==null||a(D),D.defaultPrevented||l==null||l())},m),P=qq(D=>{const V=D.target;[...f.branches].some(L=>L.contains(V))||(o==null||o(D),a==null||a(D),D.defaultPrevented||l==null||l())},m);return RO(D=>{_===f.layers.size-1&&(i==null||i(D),!D.defaultPrevented&&l&&(D.preventDefault(),l()))},m),M.useEffect(()=>{if(h)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(IR=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),LR(),()=>{r&&f.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=IR)}},[h,m,r,f]),M.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),LR())},[h,f]),M.useEffect(()=>{const D=()=>v({});return document.addEventListener(Gw,D),()=>document.removeEventListener(Gw,D)},[]),M.createElement(Dt.div,Ue({},u,{ref:w,style:{pointerEvents:b?A?"auto":"none":void 0,...n.style},onFocusCapture:bt(n.onFocusCapture,P.onFocusCapture),onBlurCapture:bt(n.onBlurCapture,P.onBlurCapture),onPointerDownCapture:bt(n.onPointerDownCapture,R.onPointerDownCapture)}))});function Xq(n,e=globalThis==null?void 0:globalThis.document){const t=Xn(n),r=M.useRef(!1),i=M.useRef(()=>{});return M.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){PO($q,t,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=u,e.addEventListener("click",i.current,{once:!0})):u()}r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,t]),{onPointerDownCapture:()=>r.current=!0}}function qq(n,e=globalThis==null?void 0:globalThis.document){const t=Xn(n),r=M.useRef(!1);return M.useEffect(()=>{const i=s=>{s.target&&!r.current&&PO(Wq,t,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,t]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function LR(){const n=new CustomEvent(Gw);document.dispatchEvent(n)}function PO(n,e,t,{discrete:r}){const i=t.originalEvent.target,s=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:t});e&&i.addEventListener(n,e,{once:!0}),r?bO(i,s):i.dispatchEvent(s)}let CS=0;function IO(){M.useEffect(()=>{var n,e;const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(n=t[0])!==null&&n!==void 0?n:DR()),document.body.insertAdjacentElement("beforeend",(e=t[1])!==null&&e!==void 0?e:DR()),CS++,()=>{CS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),CS--}},[])}function DR(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",n}const AS="focusScope.autoFocusOnMount",RS="focusScope.autoFocusOnUnmount",NR={bubbles:!1,cancelable:!0},Yq=M.forwardRef((n,e)=>{const{loop:t=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=n,[a,l]=M.useState(null),u=Xn(i),f=Xn(s),h=M.useRef(null),p=Zt(e,w=>l(w)),m=M.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;M.useEffect(()=>{if(r){let w=function(_){if(m.paused||!a)return;const b=_.target;a.contains(b)?h.current=b:Ta(h.current,{select:!0})},x=function(_){if(m.paused||!a)return;const b=_.relatedTarget;b!==null&&(a.contains(b)||Ta(h.current,{select:!0}))},g=function(_){const b=document.activeElement;for(const A of _)A.removedNodes.length>0&&(a!=null&&a.contains(b)||Ta(a))};document.addEventListener("focusin",w),document.addEventListener("focusout",x);const S=new MutationObserver(g);return a&&S.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",x),S.disconnect()}}},[r,a,m.paused]),M.useEffect(()=>{if(a){kR.add(m);const w=document.activeElement;if(!a.contains(w)){const g=new CustomEvent(AS,NR);a.addEventListener(AS,u),a.dispatchEvent(g),g.defaultPrevented||(Zq(tY(LO(a)),{select:!0}),document.activeElement===w&&Ta(a))}return()=>{a.removeEventListener(AS,u),setTimeout(()=>{const g=new CustomEvent(RS,NR);a.addEventListener(RS,f),a.dispatchEvent(g),g.defaultPrevented||Ta(w??document.body,{select:!0}),a.removeEventListener(RS,f),kR.remove(m)},0)}}},[a,u,f,m]);const v=M.useCallback(w=>{if(!t&&!r||m.paused)return;const x=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,g=document.activeElement;if(x&&g){const S=w.currentTarget,[_,b]=Kq(S);_&&b?!w.shiftKey&&g===b?(w.preventDefault(),t&&Ta(_,{select:!0})):w.shiftKey&&g===_&&(w.preventDefault(),t&&Ta(b,{select:!0})):g===S&&w.preventDefault()}},[t,r,m.paused]);return M.createElement(Dt.div,Ue({tabIndex:-1},o,{ref:p,onKeyDown:v}))});function Zq(n,{select:e=!1}={}){const t=document.activeElement;for(const r of n)if(Ta(r,{select:e}),document.activeElement!==t)return}function Kq(n){const e=LO(n),t=OR(e,n),r=OR(e.reverse(),n);return[t,r]}function LO(n){const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function OR(n,e){for(const t of n)if(!Qq(t,{upTo:e}))return t}function Qq(n,{upTo:e}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e!==void 0&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}function Jq(n){return n instanceof HTMLInputElement&&"select"in n}function Ta(n,{select:e=!1}={}){if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),n!==t&&Jq(n)&&e&&n.select()}}const kR=eY();function eY(){let n=[];return{add(e){const t=n[0];e!==t&&(t==null||t.pause()),n=UR(n,e),n.unshift(e)},remove(e){var t;n=UR(n,e),(t=n[0])===null||t===void 0||t.resume()}}}function UR(n,e){const t=[...n],r=t.indexOf(e);return r!==-1&&t.splice(r,1),t}function tY(n){return n.filter(e=>e.tagName!=="A")}const nY=bF["useId".toString()]||(()=>{});let rY=0;function vc(n){const[e,t]=M.useState(nY());return us(()=>{n||t(r=>r??String(rY++))},[n]),n||(e?`radix-${e}`:"")}const iY=["top","right","bottom","left"],cl=Math.min,Ai=Math.max,F0=Math.round,pv=Math.floor,ul=n=>({x:n,y:n}),sY={left:"right",right:"left",bottom:"top",top:"bottom"},oY={start:"end",end:"start"};function jw(n,e,t){return Ai(n,cl(e,t))}function Qo(n,e){return typeof n=="function"?n(e):n}function Jo(n){return n.split("-")[0]}function tf(n){return n.split("-")[1]}function mb(n){return n==="x"?"y":"x"}function gb(n){return n==="y"?"height":"width"}function nf(n){return["top","bottom"].includes(Jo(n))?"y":"x"}function vb(n){return mb(nf(n))}function aY(n,e,t){t===void 0&&(t=!1);const r=tf(n),i=vb(n),s=gb(i);let o=i==="x"?r===(t?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=z0(o)),[o,z0(o)]}function lY(n){const e=z0(n);return[Xw(n),e,Xw(e)]}function Xw(n){return n.replace(/start|end/g,e=>oY[e])}function cY(n,e,t){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(n){case"top":case"bottom":return t?e?i:r:e?r:i;case"left":case"right":return e?s:o;default:return[]}}function uY(n,e,t,r){const i=tf(n);let s=cY(Jo(n),t==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(Xw)))),s}function z0(n){return n.replace(/left|right|bottom|top/g,e=>sY[e])}function dY(n){return{top:0,right:0,bottom:0,left:0,...n}}function DO(n){return typeof n!="number"?dY(n):{top:n,right:n,bottom:n,left:n}}function B0(n){return{...n,top:n.y,left:n.x,right:n.x+n.width,bottom:n.y+n.height}}function FR(n,e,t){let{reference:r,floating:i}=n;const s=nf(e),o=vb(e),a=gb(o),l=Jo(e),u=s==="y",f=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,p=r[a]/2-i[a]/2;let m;switch(l){case"top":m={x:f,y:r.y-i.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:h};break;case"left":m={x:r.x-i.width,y:h};break;default:m={x:r.x,y:r.y}}switch(tf(e)){case"start":m[o]-=p*(t&&u?-1:1);break;case"end":m[o]+=p*(t&&u?-1:1);break}return m}const fY=async(n,e,t)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=t,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:n,floating:e,strategy:i}),{x:f,y:h}=FR(u,r,l),p=r,m={},v=0;for(let w=0;w({name:"arrow",options:n,async fn(e){const{x:t,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:u,padding:f=0}=Qo(n,e)||{};if(u==null)return{};const h=DO(f),p={x:t,y:r},m=vb(i),v=gb(m),w=await o.getDimensions(u),x=m==="y",g=x?"top":"left",S=x?"bottom":"right",_=x?"clientHeight":"clientWidth",b=s.reference[v]+s.reference[m]-p[m]-s.floating[v],A=p[m]-s.reference[m],R=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let P=R?R[_]:0;(!P||!await(o.isElement==null?void 0:o.isElement(R)))&&(P=a.floating[_]||s.floating[v]);const D=b/2-A/2,V=P/2-w[v]/2-1,C=cl(h[g],V),L=cl(h[S],V),W=C,Q=P-w[v]-L,z=P/2-w[v]/2+D,j=jw(W,z,Q),Y=!l.arrow&&tf(i)!=null&&z!==j&&s.reference[v]/2-(zW<=0)){var V,C;const W=(((V=s.flip)==null?void 0:V.index)||0)+1,Q=A[W];if(Q)return{data:{index:W,overflows:D},reset:{placement:Q}};let z=(C=D.filter(j=>j.overflows[0]<=0).sort((j,Y)=>j.overflows[1]-Y.overflows[1])[0])==null?void 0:C.placement;if(!z)switch(m){case"bestFit":{var L;const j=(L=D.map(Y=>[Y.placement,Y.overflows.filter(re=>re>0).reduce((re,U)=>re+U,0)]).sort((Y,re)=>Y[1]-re[1])[0])==null?void 0:L[0];j&&(z=j);break}case"initialPlacement":z=a;break}if(i!==z)return{reset:{placement:z}}}return{}}}};function zR(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function BR(n){return iY.some(e=>n[e]>=0)}const mY=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t}=e,{strategy:r="referenceHidden",...i}=Qo(n,e);switch(r){case"referenceHidden":{const s=await _p(e,{...i,elementContext:"reference"}),o=zR(s,t.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:BR(o)}}}case"escaped":{const s=await _p(e,{...i,altBoundary:!0}),o=zR(s,t.floating);return{data:{escapedOffsets:o,escaped:BR(o)}}}default:return{}}}}};async function gY(n,e){const{placement:t,platform:r,elements:i}=n,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Jo(t),a=tf(t),l=nf(t)==="y",u=["left","top"].includes(o)?-1:1,f=s&&l?-1:1,h=Qo(e,n);let{mainAxis:p,crossAxis:m,alignmentAxis:v}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...h};return a&&typeof v=="number"&&(m=a==="end"?v*-1:v),l?{x:m*f,y:p*u}:{x:p*u,y:m*f}}const vY=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,r;const{x:i,y:s,placement:o,middlewareData:a}=e,l=await gY(e,n);return o===((t=a.offset)==null?void 0:t.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},yY=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:x=>{let{x:g,y:S}=x;return{x:g,y:S}}},...l}=Qo(n,e),u={x:t,y:r},f=await _p(e,l),h=nf(Jo(i)),p=mb(h);let m=u[p],v=u[h];if(s){const x=p==="y"?"top":"left",g=p==="y"?"bottom":"right",S=m+f[x],_=m-f[g];m=jw(S,m,_)}if(o){const x=h==="y"?"top":"left",g=h==="y"?"bottom":"right",S=v+f[x],_=v-f[g];v=jw(S,v,_)}const w=a.fn({...e,[p]:m,[h]:v});return{...w,data:{x:w.x-t,y:w.y-r}}}}},xY=function(n){return n===void 0&&(n={}),{options:n,fn(e){const{x:t,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Qo(n,e),f={x:t,y:r},h=nf(i),p=mb(h);let m=f[p],v=f[h];const w=Qo(a,e),x=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(l){const _=p==="y"?"height":"width",b=s.reference[p]-s.floating[_]+x.mainAxis,A=s.reference[p]+s.reference[_]-x.mainAxis;mA&&(m=A)}if(u){var g,S;const _=p==="y"?"width":"height",b=["top","left"].includes(Jo(i)),A=s.reference[h]-s.floating[_]+(b&&((g=o.offset)==null?void 0:g[h])||0)+(b?0:x.crossAxis),R=s.reference[h]+s.reference[_]+(b?0:((S=o.offset)==null?void 0:S[h])||0)-(b?x.crossAxis:0);vR&&(v=R)}return{[p]:m,[h]:v}}}},_Y=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){const{placement:t,rects:r,platform:i,elements:s}=e,{apply:o=()=>{},...a}=Qo(n,e),l=await _p(e,a),u=Jo(t),f=tf(t),h=nf(t)==="y",{width:p,height:m}=r.floating;let v,w;u==="top"||u==="bottom"?(v=u,w=f===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(w=u,v=f==="end"?"top":"bottom");const x=m-l[v],g=p-l[w],S=!e.middlewareData.shift;let _=x,b=g;if(h){const R=p-l.left-l.right;b=f||S?cl(g,R):R}else{const R=m-l.top-l.bottom;_=f||S?cl(x,R):R}if(S&&!f){const R=Ai(l.left,0),P=Ai(l.right,0),D=Ai(l.top,0),V=Ai(l.bottom,0);h?b=p-2*(R!==0||P!==0?R+P:Ai(l.left,l.right)):_=m-2*(D!==0||V!==0?D+V:Ai(l.top,l.bottom))}await o({...e,availableWidth:b,availableHeight:_});const A=await i.getDimensions(s.floating);return p!==A.width||m!==A.height?{reset:{rects:!0}}:{}}}};function dl(n){return NO(n)?(n.nodeName||"").toLowerCase():"#document"}function Ni(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function ra(n){var e;return(e=(NO(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function NO(n){return n instanceof Node||n instanceof Ni(n).Node}function ea(n){return n instanceof Element||n instanceof Ni(n).Element}function po(n){return n instanceof HTMLElement||n instanceof Ni(n).HTMLElement}function VR(n){return typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Ni(n).ShadowRoot}function nm(n){const{overflow:e,overflowX:t,overflowY:r,display:i}=ds(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!["inline","contents"].includes(i)}function SY(n){return["table","td","th"].includes(dl(n))}function yb(n){const e=xb(),t=ds(n);return t.transform!=="none"||t.perspective!=="none"||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(t.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(t.contain||"").includes(r))}function OO(n){let e=Bd(n);for(;po(e)&&!Vy(e);){if(yb(e))return e;e=Bd(e)}return null}function xb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Vy(n){return["html","body","#document"].includes(dl(n))}function ds(n){return Ni(n).getComputedStyle(n)}function Hy(n){return ea(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function Bd(n){if(dl(n)==="html")return n;const e=n.assignedSlot||n.parentNode||VR(n)&&n.host||ra(n);return VR(e)?e.host:e}function kO(n){const e=Bd(n);return Vy(e)?n.ownerDocument?n.ownerDocument.body:n.body:po(e)&&nm(e)?e:kO(e)}function Sp(n,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);const i=kO(n),s=i===((r=n.ownerDocument)==null?void 0:r.body),o=Ni(i);return s?e.concat(o,o.visualViewport||[],nm(i)?i:[],o.frameElement&&t?Sp(o.frameElement):[]):e.concat(i,Sp(i,[],t))}function UO(n){const e=ds(n);let t=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=po(n),s=i?n.offsetWidth:t,o=i?n.offsetHeight:r,a=F0(t)!==s||F0(r)!==o;return a&&(t=s,r=o),{width:t,height:r,$:a}}function _b(n){return ea(n)?n:n.contextElement}function cd(n){const e=_b(n);if(!po(e))return ul(1);const t=e.getBoundingClientRect(),{width:r,height:i,$:s}=UO(e);let o=(s?F0(t.width):t.width)/r,a=(s?F0(t.height):t.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const wY=ul(0);function FO(n){const e=Ni(n);return!xb()||!e.visualViewport?wY:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function EY(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==Ni(n)?!1:e}function Ic(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=n.getBoundingClientRect(),s=_b(n);let o=ul(1);e&&(r?ea(r)&&(o=cd(r)):o=cd(n));const a=EY(s,t,r)?FO(s):ul(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,f=i.width/o.x,h=i.height/o.y;if(s){const p=Ni(s),m=r&&ea(r)?Ni(r):r;let v=p.frameElement;for(;v&&r&&m!==p;){const w=cd(v),x=v.getBoundingClientRect(),g=ds(v),S=x.left+(v.clientLeft+parseFloat(g.paddingLeft))*w.x,_=x.top+(v.clientTop+parseFloat(g.paddingTop))*w.y;l*=w.x,u*=w.y,f*=w.x,h*=w.y,l+=S,u+=_,v=Ni(v).frameElement}}return B0({width:f,height:h,x:l,y:u})}const MY=[":popover-open",":modal"];function zO(n){let e=!1,t=0,r=0;function i(s){try{e=e||n.matches(s)}catch{}}if(MY.forEach(s=>{i(s)}),e){const s=OO(n);if(s){const o=s.getBoundingClientRect();t=o.x,r=o.y}}return[e,t,r]}function bY(n){let{elements:e,rect:t,offsetParent:r,strategy:i}=n;const s=ra(r),[o]=e?zO(e.floating):[!1];if(r===s||o)return t;let a={scrollLeft:0,scrollTop:0},l=ul(1);const u=ul(0),f=po(r);if((f||!f&&i!=="fixed")&&((dl(r)!=="body"||nm(s))&&(a=Hy(r)),po(r))){const h=Ic(r);l=cd(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-a.scrollLeft*l.x+u.x,y:t.y*l.y-a.scrollTop*l.y+u.y}}function TY(n){return Array.from(n.getClientRects())}function BO(n){return Ic(ra(n)).left+Hy(n).scrollLeft}function CY(n){const e=ra(n),t=Hy(n),r=n.ownerDocument.body,i=Ai(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Ai(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-t.scrollLeft+BO(n);const a=-t.scrollTop;return ds(r).direction==="rtl"&&(o+=Ai(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function AY(n,e){const t=Ni(n),r=ra(n),i=t.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const u=xb();(!u||u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function RY(n,e){const t=Ic(n,!0,e==="fixed"),r=t.top+n.clientTop,i=t.left+n.clientLeft,s=po(n)?cd(n):ul(1),o=n.clientWidth*s.x,a=n.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function HR(n,e,t){let r;if(e==="viewport")r=AY(n,t);else if(e==="document")r=CY(ra(n));else if(ea(e))r=RY(e,t);else{const i=FO(n);r={...e,x:e.x-i.x,y:e.y-i.y}}return B0(r)}function VO(n,e){const t=Bd(n);return t===e||!ea(t)||Vy(t)?!1:ds(t).position==="fixed"||VO(t,e)}function PY(n,e){const t=e.get(n);if(t)return t;let r=Sp(n,[],!1).filter(a=>ea(a)&&dl(a)!=="body"),i=null;const s=ds(n).position==="fixed";let o=s?Bd(n):n;for(;ea(o)&&!Vy(o);){const a=ds(o),l=yb(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||nm(o)&&!l&&VO(n,o))?r=r.filter(f=>f!==o):i=a,o=Bd(o)}return e.set(n,r),r}function IY(n){let{element:e,boundary:t,rootBoundary:r,strategy:i}=n;const o=[...t==="clippingAncestors"?PY(e,this._c):[].concat(t),r],a=o[0],l=o.reduce((u,f)=>{const h=HR(e,f,i);return u.top=Ai(h.top,u.top),u.right=cl(h.right,u.right),u.bottom=cl(h.bottom,u.bottom),u.left=Ai(h.left,u.left),u},HR(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function LY(n){const{width:e,height:t}=UO(n);return{width:e,height:t}}function DY(n,e,t,r){const i=po(e),s=ra(e),o=t==="fixed",a=Ic(n,!0,o,e);let l={scrollLeft:0,scrollTop:0};const u=ul(0);if(i||!i&&!o)if((dl(e)!=="body"||nm(s))&&(l=Hy(e)),i){const w=Ic(e,!0,o,e);u.x=w.x+e.clientLeft,u.y=w.y+e.clientTop}else s&&(u.x=BO(s));let f=a.left+l.scrollLeft-u.x,h=a.top+l.scrollTop-u.y;const[p,m,v]=zO(r);return p&&(f+=m,h+=v,i&&(f+=e.clientLeft,h+=e.clientTop)),{x:f,y:h,width:a.width,height:a.height}}function $R(n,e){return!po(n)||ds(n).position==="fixed"?null:e?e(n):n.offsetParent}function HO(n,e){const t=Ni(n);if(!po(n))return t;let r=$R(n,e);for(;r&&SY(r)&&ds(r).position==="static";)r=$R(r,e);return r&&(dl(r)==="html"||dl(r)==="body"&&ds(r).position==="static"&&!yb(r))?t:r||OO(n)||t}const NY=async function(n){const e=this.getOffsetParent||HO,t=this.getDimensions;return{reference:DY(n.reference,await e(n.floating),n.strategy,n.floating),floating:{x:0,y:0,...await t(n.floating)}}};function OY(n){return ds(n).direction==="rtl"}const kY={convertOffsetParentRelativeRectToViewportRelativeRect:bY,getDocumentElement:ra,getClippingRect:IY,getOffsetParent:HO,getElementRects:NY,getClientRects:TY,getDimensions:LY,getScale:cd,isElement:ea,isRTL:OY};function UY(n,e){let t=null,r;const i=ra(n);function s(){var a;clearTimeout(r),(a=t)==null||a.disconnect(),t=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:u,top:f,width:h,height:p}=n.getBoundingClientRect();if(a||e(),!h||!p)return;const m=pv(f),v=pv(i.clientWidth-(u+h)),w=pv(i.clientHeight-(f+p)),x=pv(u),S={rootMargin:-m+"px "+-v+"px "+-w+"px "+-x+"px",threshold:Ai(0,cl(1,l))||1};let _=!0;function b(A){const R=A[0].intersectionRatio;if(R!==l){if(!_)return o();R?o(!1,R):r=setTimeout(()=>{o(!1,1e-7)},100)}_=!1}try{t=new IntersectionObserver(b,{...S,root:i.ownerDocument})}catch{t=new IntersectionObserver(b,S)}t.observe(n)}return o(!0),s}function FY(n,e,t,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=_b(n),f=i||s?[...u?Sp(u):[],...Sp(e)]:[];f.forEach(g=>{i&&g.addEventListener("scroll",t,{passive:!0}),s&&g.addEventListener("resize",t)});const h=u&&a?UY(u,t):null;let p=-1,m=null;o&&(m=new ResizeObserver(g=>{let[S]=g;S&&S.target===u&&m&&(m.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var _;(_=m)==null||_.observe(e)})),t()}),u&&!l&&m.observe(u),m.observe(e));let v,w=l?Ic(n):null;l&&x();function x(){const g=Ic(n);w&&(g.x!==w.x||g.y!==w.y||g.width!==w.width||g.height!==w.height)&&t(),w=g,v=requestAnimationFrame(x)}return t(),()=>{var g;f.forEach(S=>{i&&S.removeEventListener("scroll",t),s&&S.removeEventListener("resize",t)}),h==null||h(),(g=m)==null||g.disconnect(),m=null,l&&cancelAnimationFrame(v)}}const zY=yY,BY=pY,VY=_Y,HY=mY,WR=hY,$Y=xY,WY=(n,e,t)=>{const r=new Map,i={platform:kY,...t},s={...i.platform,_c:r};return fY(n,e,{...i,platform:s})},GY=n=>{function e(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:n,fn(t){const{element:r,padding:i}=typeof n=="function"?n(t):n;return r&&e(r)?r.current!=null?WR({element:r.current,padding:i}).fn(t):{}:r?WR({element:r,padding:i}).fn(t):{}}}};var $v=typeof document<"u"?M.useLayoutEffect:M.useEffect;function V0(n,e){if(n===e)return!0;if(typeof n!=typeof e)return!1;if(typeof n=="function"&&n.toString()===e.toString())return!0;let t,r,i;if(n&&e&&typeof n=="object"){if(Array.isArray(n)){if(t=n.length,t!==e.length)return!1;for(r=t;r--!==0;)if(!V0(n[r],e[r]))return!1;return!0}if(i=Object.keys(n),t=i.length,t!==Object.keys(e).length)return!1;for(r=t;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=t;r--!==0;){const s=i[r];if(!(s==="_owner"&&n.$$typeof)&&!V0(n[s],e[s]))return!1}return!0}return n!==n&&e!==e}function $O(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function GR(n,e){const t=$O(n);return Math.round(e*t)/t}function jR(n){const e=M.useRef(n);return $v(()=>{e.current=n}),e}function jY(n){n===void 0&&(n={});const{placement:e="bottom",strategy:t="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=n,[f,h]=M.useState({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[p,m]=M.useState(r);V0(p,r)||m(r);const[v,w]=M.useState(null),[x,g]=M.useState(null),S=M.useCallback(re=>{re!==R.current&&(R.current=re,w(re))},[]),_=M.useCallback(re=>{re!==P.current&&(P.current=re,g(re))},[]),b=s||v,A=o||x,R=M.useRef(null),P=M.useRef(null),D=M.useRef(f),V=l!=null,C=jR(l),L=jR(i),W=M.useCallback(()=>{if(!R.current||!P.current)return;const re={placement:e,strategy:t,middleware:p};L.current&&(re.platform=L.current),WY(R.current,P.current,re).then(U=>{const X={...U,isPositioned:!0};Q.current&&!V0(D.current,X)&&(D.current=X,$c.flushSync(()=>{h(X)}))})},[p,e,t,L]);$v(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,h(re=>({...re,isPositioned:!1})))},[u]);const Q=M.useRef(!1);$v(()=>(Q.current=!0,()=>{Q.current=!1}),[]),$v(()=>{if(b&&(R.current=b),A&&(P.current=A),b&&A){if(C.current)return C.current(b,A,W);W()}},[b,A,W,C,V]);const z=M.useMemo(()=>({reference:R,floating:P,setReference:S,setFloating:_}),[S,_]),j=M.useMemo(()=>({reference:b,floating:A}),[b,A]),Y=M.useMemo(()=>{const re={position:t,left:0,top:0};if(!j.floating)return re;const U=GR(j.floating,f.x),X=GR(j.floating,f.y);return a?{...re,transform:"translate("+U+"px, "+X+"px)",...$O(j.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:U,top:X}},[t,a,j.floating,f.x,f.y]);return M.useMemo(()=>({...f,update:W,refs:z,elements:j,floatingStyles:Y}),[f,W,z,j,Y])}const WO="Popper",[GO,jO]=na(WO),[XY,XO]=GO(WO),qY=n=>{const{__scopePopper:e,children:t}=n,[r,i]=M.useState(null);return M.createElement(XY,{scope:e,anchor:r,onAnchorChange:i},t)},YY="PopperAnchor",ZY=M.forwardRef((n,e)=>{const{__scopePopper:t,virtualRef:r,...i}=n,s=XO(YY,t),o=M.useRef(null),a=Zt(e,o);return M.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:M.createElement(Dt.div,Ue({},i,{ref:a}))}),qO="PopperContent",[KY,Lee]=GO(qO),QY=M.forwardRef((n,e)=>{var t,r,i,s,o,a,l,u;const{__scopePopper:f,side:h="bottom",sideOffset:p=0,align:m="center",alignOffset:v=0,arrowPadding:w=0,collisionBoundary:x=[],collisionPadding:g=0,sticky:S="partial",hideWhenDetached:_=!1,avoidCollisions:b=!0,onPlaced:A,...R}=n,P=XO(qO,f),[D,V]=M.useState(null),C=Zt(e,de=>V(de)),[L,W]=M.useState(null),Q=hb(L),z=(t=Q==null?void 0:Q.width)!==null&&t!==void 0?t:0,j=(r=Q==null?void 0:Q.height)!==null&&r!==void 0?r:0,Y=h+(m!=="center"?"-"+m:""),re=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},U=Array.isArray(x)?x:[x],X=U.length>0,q={padding:re,boundary:U.filter(JY),altBoundary:X},{refs:K,floatingStyles:se,placement:ve,isPositioned:te,middlewareData:le}=jY({strategy:"fixed",placement:Y,whileElementsMounted:FY,elements:{reference:P.anchor},middleware:[vY({mainAxis:p+j,alignmentAxis:v}),b&&zY({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?$Y():void 0,...q}),b&&BY({...q}),VY({...q,apply:({elements:de,rects:Te,availableWidth:ye,availableHeight:Xe})=>{const{width:ze,height:k}=Te.reference,O=de.floating.style;O.setProperty("--radix-popper-available-width",`${ye}px`),O.setProperty("--radix-popper-available-height",`${Xe}px`),O.setProperty("--radix-popper-anchor-width",`${ze}px`),O.setProperty("--radix-popper-anchor-height",`${k}px`)}}),L&&GY({element:L,padding:w}),eZ({arrowWidth:z,arrowHeight:j}),_&&HY({strategy:"referenceHidden"})]}),[Me,pe]=YO(ve),Ae=Xn(A);us(()=>{te&&(Ae==null||Ae())},[te,Ae]);const De=(i=le.arrow)===null||i===void 0?void 0:i.x,Re=(s=le.arrow)===null||s===void 0?void 0:s.y,Ce=((o=le.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,[H,xe]=M.useState();return us(()=>{D&&xe(window.getComputedStyle(D).zIndex)},[D]),M.createElement("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...se,transform:te?se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[(a=le.transformOrigin)===null||a===void 0?void 0:a.x,(l=le.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:n.dir},M.createElement(KY,{scope:f,placedSide:Me,onArrowChange:W,arrowX:De,arrowY:Re,shouldHideArrow:Ce},M.createElement(Dt.div,Ue({"data-side":Me,"data-align":pe},R,{ref:C,style:{...R.style,animation:te?void 0:"none",opacity:(u=le.hide)!==null&&u!==void 0&&u.referenceHidden?0:void 0}}))))});function JY(n){return n!==null}const eZ=n=>({name:"transformOrigin",options:n,fn(e){var t,r,i,s,o;const{placement:a,rects:l,middlewareData:u}=e,h=((t=u.arrow)===null||t===void 0?void 0:t.centerOffset)!==0,p=h?0:n.arrowWidth,m=h?0:n.arrowHeight,[v,w]=YO(a),x={start:"0%",center:"50%",end:"100%"}[w],g=((r=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+p/2,S=((s=(o=u.arrow)===null||o===void 0?void 0:o.y)!==null&&s!==void 0?s:0)+m/2;let _="",b="";return v==="bottom"?(_=h?x:`${g}px`,b=`${-m}px`):v==="top"?(_=h?x:`${g}px`,b=`${l.floating.height+m}px`):v==="right"?(_=`${-m}px`,b=h?x:`${S}px`):v==="left"&&(_=`${l.floating.width+m}px`,b=h?x:`${S}px`),{data:{x:_,y:b}}}});function YO(n){const[e,t="center"]=n.split("-");return[e,t]}const tZ=qY,nZ=ZY,rZ=QY,iZ=M.forwardRef((n,e)=>{var t;const{container:r=globalThis==null||(t=globalThis.document)===null||t===void 0?void 0:t.body,...i}=n;return r?vO.createPortal(M.createElement(Dt.div,Ue({},i,{ref:e})),r):null}),sZ=M.forwardRef((n,e)=>M.createElement(Dt.span,Ue({},n,{ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...n.style}})));var oZ=function(n){if(typeof document>"u")return null;var e=Array.isArray(n)?n[0]:n;return e.ownerDocument.body},Iu=new WeakMap,mv=new WeakMap,gv={},PS=0,ZO=function(n){return n&&(n.host||ZO(n.parentNode))},aZ=function(n,e){return e.map(function(t){if(n.contains(t))return t;var r=ZO(t);return r&&n.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",n,". Doing nothing"),null)}).filter(function(t){return!!t})},lZ=function(n,e,t,r){var i=aZ(e,Array.isArray(n)?n:[n]);gv[t]||(gv[t]=new WeakMap);var s=gv[t],o=[],a=new Set,l=new Set(i),u=function(h){!h||a.has(h)||(a.add(h),u(h.parentNode))};i.forEach(u);var f=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(p){if(a.has(p))f(p);else{var m=p.getAttribute(r),v=m!==null&&m!=="false",w=(Iu.get(p)||0)+1,x=(s.get(p)||0)+1;Iu.set(p,w),s.set(p,x),o.push(p),w===1&&v&&mv.set(p,!0),x===1&&p.setAttribute(t,"true"),v||p.setAttribute(r,"true")}})};return f(e),a.clear(),PS++,function(){o.forEach(function(h){var p=Iu.get(h)-1,m=s.get(h)-1;Iu.set(h,p),s.set(h,m),p||(mv.has(h)||h.removeAttribute(r),mv.delete(h)),m||h.removeAttribute(t)}),PS--,PS||(Iu=new WeakMap,Iu=new WeakMap,mv=new WeakMap,gv={})}},KO=function(n,e,t){t===void 0&&(t="data-aria-hidden");var r=Array.from(Array.isArray(n)?n:[n]),i=e||oZ(n);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),lZ(r,i,t,"aria-hidden")):function(){return null}},no=function(){return no=Object.assign||function(e){for(var t,r=1,i=arguments.length;r"u")return MZ;var e=bZ(n),t=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-t+e[2]-e[0])}},CZ=tk(),AZ=function(n,e,t,r){var i=n.left,s=n.top,o=n.right,a=n.gap;return t===void 0&&(t="margin"),` + .`.concat(uZ,` { overflow: hidden `).concat(r,`; padding-right: `).concat(a,"px ").concat(r,`; } @@ -4254,30 +4259,30 @@ Error generating stack: `+s.message+` `),t==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` } - .`).concat(Hv,` { + .`).concat(Wv,` { right: `).concat(a,"px ").concat(r,`; } - .`).concat($v,` { + .`).concat(Gv,` { margin-right: `).concat(a,"px ").concat(r,`; } - .`).concat(Hv," .").concat(Hv,` { + .`).concat(Wv," .").concat(Wv,` { right: 0 `).concat(r,`; } - .`).concat($v," .").concat($v,` { + .`).concat(Gv," .").concat(Gv,` { margin-right: 0 `).concat(r,`; } body { - `).concat(ZY,": ").concat(a,`px; + `).concat(dZ,": ").concat(a,`px; } -`)},pZ=function(n){var e=n.noRelative,t=n.noImportant,r=n.gapMode,i=r===void 0?"margin":r,s=M.useMemo(function(){return dZ(i)},[i]);return M.createElement(fZ,{styles:hZ(s,!e,i,t?"":"!important")})},jw=!1;if(typeof window<"u")try{var mv=Object.defineProperty({},"passive",{get:function(){return jw=!0,!0}});window.addEventListener("test",mv,mv),window.removeEventListener("test",mv,mv)}catch{jw=!1}var Pu=jw?{passive:!1}:!1,mZ=function(n){return n.tagName==="TEXTAREA"},ZO=function(n,e){var t=window.getComputedStyle(n);return t[e]!=="hidden"&&!(t.overflowY===t.overflowX&&!mZ(n)&&t[e]==="visible")},gZ=function(n){return ZO(n,"overflowY")},vZ=function(n){return ZO(n,"overflowX")},qR=function(n,e){var t=e;do{typeof ShadowRoot<"u"&&t instanceof ShadowRoot&&(t=t.host);var r=KO(n,t);if(r){var i=QO(n,t),s=i[1],o=i[2];if(s>o)return!0}t=t.parentNode}while(t&&t!==document.body);return!1},yZ=function(n){var e=n.scrollTop,t=n.scrollHeight,r=n.clientHeight;return[e,t,r]},xZ=function(n){var e=n.scrollLeft,t=n.scrollWidth,r=n.clientWidth;return[e,t,r]},KO=function(n,e){return n==="v"?gZ(e):vZ(e)},QO=function(n,e){return n==="v"?yZ(e):xZ(e)},_Z=function(n,e){return n==="h"&&e==="rtl"?-1:1},SZ=function(n,e,t,r,i){var s=_Z(n,window.getComputedStyle(e).direction),o=s*r,a=t.target,l=e.contains(a),u=!1,f=o>0,h=0,p=0;do{var m=QO(n,a),v=m[0],w=m[1],x=m[2],g=w-x-s*v;(v||g)&&KO(n,a)&&(h+=g,p+=v),a=a.parentNode}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(f&&(i&&h===0||!i&&o>h)||!f&&(i&&p===0||!i&&-o>p))&&(u=!0),u},gv=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},YR=function(n){return[n.deltaX,n.deltaY]},ZR=function(n){return n&&"current"in n?n.current:n},wZ=function(n,e){return n[0]===e[0]&&n[1]===e[1]},EZ=function(n){return` +`)},RZ=function(n){var e=n.noRelative,t=n.noImportant,r=n.gapMode,i=r===void 0?"margin":r,s=M.useMemo(function(){return TZ(i)},[i]);return M.createElement(CZ,{styles:AZ(s,!e,i,t?"":"!important")})},qw=!1;if(typeof window<"u")try{var vv=Object.defineProperty({},"passive",{get:function(){return qw=!0,!0}});window.addEventListener("test",vv,vv),window.removeEventListener("test",vv,vv)}catch{qw=!1}var Lu=qw?{passive:!1}:!1,PZ=function(n){return n.tagName==="TEXTAREA"},nk=function(n,e){var t=window.getComputedStyle(n);return t[e]!=="hidden"&&!(t.overflowY===t.overflowX&&!PZ(n)&&t[e]==="visible")},IZ=function(n){return nk(n,"overflowY")},LZ=function(n){return nk(n,"overflowX")},YR=function(n,e){var t=e;do{typeof ShadowRoot<"u"&&t instanceof ShadowRoot&&(t=t.host);var r=rk(n,t);if(r){var i=ik(n,t),s=i[1],o=i[2];if(s>o)return!0}t=t.parentNode}while(t&&t!==document.body);return!1},DZ=function(n){var e=n.scrollTop,t=n.scrollHeight,r=n.clientHeight;return[e,t,r]},NZ=function(n){var e=n.scrollLeft,t=n.scrollWidth,r=n.clientWidth;return[e,t,r]},rk=function(n,e){return n==="v"?IZ(e):LZ(e)},ik=function(n,e){return n==="v"?DZ(e):NZ(e)},OZ=function(n,e){return n==="h"&&e==="rtl"?-1:1},kZ=function(n,e,t,r,i){var s=OZ(n,window.getComputedStyle(e).direction),o=s*r,a=t.target,l=e.contains(a),u=!1,f=o>0,h=0,p=0;do{var m=ik(n,a),v=m[0],w=m[1],x=m[2],g=w-x-s*v;(v||g)&&rk(n,a)&&(h+=g,p+=v),a=a.parentNode}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(f&&(i&&h===0||!i&&o>h)||!f&&(i&&p===0||!i&&-o>p))&&(u=!0),u},yv=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},ZR=function(n){return[n.deltaX,n.deltaY]},KR=function(n){return n&&"current"in n?n.current:n},UZ=function(n,e){return n[0]===e[0]&&n[1]===e[1]},FZ=function(n){return` .block-interactivity-`.concat(n,` {pointer-events: none;} .allow-interactivity-`).concat(n,` {pointer-events: all;} -`)},MZ=0,Iu=[];function bZ(n){var e=M.useRef([]),t=M.useRef([0,0]),r=M.useRef(),i=M.useState(MZ++)[0],s=M.useState(function(){return YO()})[0],o=M.useRef(n);M.useEffect(function(){o.current=n},[n]),M.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(i));var w=qY([n.lockRef.current],(n.shards||[]).map(ZR),!0).filter(Boolean);return w.forEach(function(x){return x.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(i))})}}},[n.inert,n.lockRef.current,n.shards]);var a=M.useCallback(function(w,x){if("touches"in w&&w.touches.length===2)return!o.current.allowPinchZoom;var g=gv(w),S=t.current,_="deltaX"in w?w.deltaX:S[0]-g[0],b="deltaY"in w?w.deltaY:S[1]-g[1],A,R=w.target,P=Math.abs(_)>Math.abs(b)?"h":"v";if("touches"in w&&P==="h"&&R.type==="range")return!1;var D=qR(P,R);if(!D)return!0;if(D?A=P:(A=P==="v"?"h":"v",D=qR(P,R)),!D)return!1;if(!r.current&&"changedTouches"in w&&(_||b)&&(r.current=A),!A)return!0;var V=r.current||A;return SZ(V,x,w,V==="h"?_:b,!0)},[]),l=M.useCallback(function(w){var x=w;if(!(!Iu.length||Iu[Iu.length-1]!==s)){var g="deltaY"in x?YR(x):gv(x),S=e.current.filter(function(A){return A.name===x.type&&A.target===x.target&&wZ(A.delta,g)})[0];if(S&&S.should){x.cancelable&&x.preventDefault();return}if(!S){var _=(o.current.shards||[]).map(ZR).filter(Boolean).filter(function(A){return A.contains(x.target)}),b=_.length>0?a(x,_[0]):!o.current.noIsolation;b&&x.cancelable&&x.preventDefault()}}},[]),u=M.useCallback(function(w,x,g,S){var _={name:w,delta:x,target:g,should:S};e.current.push(_),setTimeout(function(){e.current=e.current.filter(function(b){return b!==_})},1)},[]),f=M.useCallback(function(w){t.current=gv(w),r.current=void 0},[]),h=M.useCallback(function(w){u(w.type,YR(w),w.target,a(w,n.lockRef.current))},[]),p=M.useCallback(function(w){u(w.type,gv(w),w.target,a(w,n.lockRef.current))},[]);M.useEffect(function(){return Iu.push(s),n.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Pu),document.addEventListener("touchmove",l,Pu),document.addEventListener("touchstart",f,Pu),function(){Iu=Iu.filter(function(w){return w!==s}),document.removeEventListener("wheel",l,Pu),document.removeEventListener("touchmove",l,Pu),document.removeEventListener("touchstart",f,Pu)}},[]);var m=n.removeScrollBar,v=n.inert;return M.createElement(M.Fragment,null,v?M.createElement(s,{styles:EZ(i)}):null,m?M.createElement(pZ,{gapMode:"margin"}):null)}const TZ=nZ(qO,bZ);var JO=M.forwardRef(function(n,e){return M.createElement(Vy,to({},n,{ref:e,sideCar:TZ}))});JO.classNames=Vy.classNames;const ek=JO,CZ=[" ","Enter","ArrowUp","ArrowDown"],AZ=[" ","Enter"],Hy="Select",[$y,Sb,RZ]=pb(Hy),[tf,yee]=ta(Hy,[RZ,BO]),wb=BO(),[PZ,Hc]=tf(Hy),[IZ,LZ]=tf(Hy),DZ=n=>{const{__scopeSelect:e,children:t,open:r,defaultOpen:i,onOpenChange:s,value:o,defaultValue:a,onValueChange:l,dir:u,name:f,autoComplete:h,disabled:p,required:m}=n,v=wb(e),[w,x]=M.useState(null),[g,S]=M.useState(null),[_,b]=M.useState(!1),A=Jp(u),[R=!1,P]=Cc({prop:r,defaultProp:i,onChange:s}),[D,V]=Cc({prop:o,defaultProp:a,onChange:l}),C=M.useRef(null),L=w?!!w.closest("form"):!0,[W,Q]=M.useState(new Set),z=Array.from(W).map(j=>j.props.value).join(";");return M.createElement(BY,v,M.createElement(PZ,{required:m,scope:e,trigger:w,onTriggerChange:x,valueNode:g,onValueNodeChange:S,valueNodeHasChildren:_,onValueNodeHasChildrenChange:b,contentId:mc(),value:D,onValueChange:V,open:R,onOpenChange:P,dir:A,triggerPointerDownPosRef:C,disabled:p},M.createElement($y.Provider,{scope:e},M.createElement(IZ,{scope:n.__scopeSelect,onNativeOptionAdd:M.useCallback(j=>{Q(Y=>new Set(Y).add(j))},[]),onNativeOptionRemove:M.useCallback(j=>{Q(Y=>{const re=new Set(Y);return re.delete(j),re})},[])},t)),L?M.createElement(rk,{key:z,"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:h,value:D,onChange:j=>V(j.target.value),disabled:p},D===void 0?M.createElement("option",{value:""}):null,Array.from(W)):null))},NZ="SelectTrigger",OZ=M.forwardRef((n,e)=>{const{__scopeSelect:t,disabled:r=!1,...i}=n,s=wb(t),o=Hc(NZ,t),a=o.disabled||r,l=Zt(e,o.onTriggerChange),u=Sb(t),[f,h,p]=ik(v=>{const w=u().filter(S=>!S.disabled),x=w.find(S=>S.value===o.value),g=sk(w,v,x);g!==void 0&&o.onValueChange(g.value)}),m=()=>{a||(o.onOpenChange(!0),p())};return M.createElement(VY,Ue({asChild:!0},s),M.createElement(Dt.button,Ue({type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":o.value===void 0?"":void 0},i,{ref:l,onClick:bt(i.onClick,v=>{v.currentTarget.focus()}),onPointerDown:bt(i.onPointerDown,v=>{const w=v.target;w.hasPointerCapture(v.pointerId)&&w.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&(m(),o.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)},v.preventDefault())}),onKeyDown:bt(i.onKeyDown,v=>{const w=f.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&h(v.key),!(w&&v.key===" ")&&CZ.includes(v.key)&&(m(),v.preventDefault())})})))}),kZ="SelectValue",UZ=M.forwardRef((n,e)=>{const{__scopeSelect:t,className:r,style:i,children:s,placeholder:o,...a}=n,l=Hc(kZ,t),{onValueNodeHasChildrenChange:u}=l,f=s!==void 0,h=Zt(e,l.onValueNodeChange);return us(()=>{u(f)},[u,f]),M.createElement(Dt.span,Ue({},a,{ref:h,style:{pointerEvents:"none"}}),l.value===void 0&&o!==void 0?o:s)}),FZ=M.forwardRef((n,e)=>{const{__scopeSelect:t,children:r,...i}=n;return M.createElement(Dt.span,Ue({"aria-hidden":!0},i,{ref:e}),r||"▼")}),zZ=n=>M.createElement($Y,Ue({asChild:!0},n)),zd="SelectContent",BZ=M.forwardRef((n,e)=>{const t=Hc(zd,n.__scopeSelect),[r,i]=M.useState();if(us(()=>{i(new DocumentFragment)},[]),!t.open){const s=r;return s?Vc.createPortal(M.createElement(tk,{scope:n.__scopeSelect},M.createElement($y.Slot,{scope:n.__scopeSelect},M.createElement("div",null,n.children))),s):null}return M.createElement(VZ,Ue({},n,{ref:e}))}),Po=10,[tk,Wy]=tf(zd),VZ=M.forwardRef((n,e)=>{const{__scopeSelect:t,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:a,sideOffset:l,align:u,alignOffset:f,arrowPadding:h,collisionBoundary:p,collisionPadding:m,sticky:v,hideWhenDetached:w,avoidCollisions:x,...g}=n,S=Hc(zd,t),[_,b]=M.useState(null),[A,R]=M.useState(null),P=Zt(e,pe=>b(pe)),[D,V]=M.useState(null),[C,L]=M.useState(null),W=Sb(t),[Q,z]=M.useState(!1),j=M.useRef(!1);M.useEffect(()=>{if(_)return GO(_)},[_]),bO();const Y=M.useCallback(pe=>{const[Ae,...De]=W().map(H=>H.ref.current),[Re]=De.slice(-1),Ce=document.activeElement;for(const H of pe)if(H===Ce||(H==null||H.scrollIntoView({block:"nearest"}),H===Ae&&A&&(A.scrollTop=0),H===Re&&A&&(A.scrollTop=A.scrollHeight),H==null||H.focus(),document.activeElement!==Ce))return},[W,A]),re=M.useCallback(()=>Y([D,_]),[Y,D,_]);M.useEffect(()=>{Q&&re()},[Q,re]);const{onOpenChange:U,triggerPointerDownPosRef:X}=S;M.useEffect(()=>{if(_){let pe={x:0,y:0};const Ae=Re=>{var Ce,H,xe,de;pe={x:Math.abs(Math.round(Re.pageX)-((Ce=(H=X.current)===null||H===void 0?void 0:H.x)!==null&&Ce!==void 0?Ce:0)),y:Math.abs(Math.round(Re.pageY)-((xe=(de=X.current)===null||de===void 0?void 0:de.y)!==null&&xe!==void 0?xe:0))}},De=Re=>{pe.x<=10&&pe.y<=10?Re.preventDefault():_.contains(Re.target)||U(!1),document.removeEventListener("pointermove",Ae),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",Ae),document.addEventListener("pointerup",De,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ae),document.removeEventListener("pointerup",De,{capture:!0})}}},[_,U,X]),M.useEffect(()=>{const pe=()=>U(!1);return window.addEventListener("blur",pe),window.addEventListener("resize",pe),()=>{window.removeEventListener("blur",pe),window.removeEventListener("resize",pe)}},[U]);const[q,K]=ik(pe=>{const Ae=W().filter(Ce=>!Ce.disabled),De=Ae.find(Ce=>Ce.ref.current===document.activeElement),Re=sk(Ae,pe,De);Re&&setTimeout(()=>Re.ref.current.focus())}),se=M.useCallback((pe,Ae,De)=>{const Re=!j.current&&!De;(S.value!==void 0&&S.value===Ae||Re)&&(V(pe),Re&&(j.current=!0))},[S.value]),ve=M.useCallback(()=>_==null?void 0:_.focus(),[_]),te=M.useCallback((pe,Ae,De)=>{const Re=!j.current&&!De;(S.value!==void 0&&S.value===Ae||Re)&&L(pe)},[S.value]),le=r==="popper"?KR:HZ,Me=le===KR?{side:a,sideOffset:l,align:u,alignOffset:f,arrowPadding:h,collisionBoundary:p,collisionPadding:m,sticky:v,hideWhenDetached:w,avoidCollisions:x}:{};return M.createElement(tk,{scope:t,content:_,viewport:A,onViewportChange:R,itemRefCallback:se,selectedItem:D,onItemLeave:ve,itemTextRefCallback:te,focusSelectedItem:re,selectedItemText:C,position:r,isPositioned:Q,searchRef:q},M.createElement(ek,{as:Ac,allowPinchZoom:!0},M.createElement(Nq,{asChild:!0,trapped:S.open,onMountAutoFocus:pe=>{pe.preventDefault()},onUnmountAutoFocus:bt(i,pe=>{var Ae;(Ae=S.trigger)===null||Ae===void 0||Ae.focus({preventScroll:!0}),pe.preventDefault()})},M.createElement(Iq,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:pe=>pe.preventDefault(),onDismiss:()=>S.onOpenChange(!1)},M.createElement(le,Ue({role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:pe=>pe.preventDefault()},g,Me,{onPlaced:()=>z(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:bt(g.onKeyDown,pe=>{const Ae=pe.ctrlKey||pe.altKey||pe.metaKey;if(pe.key==="Tab"&&pe.preventDefault(),!Ae&&pe.key.length===1&&K(pe.key),["ArrowUp","ArrowDown","Home","End"].includes(pe.key)){let Re=W().filter(Ce=>!Ce.disabled).map(Ce=>Ce.ref.current);if(["ArrowUp","End"].includes(pe.key)&&(Re=Re.slice().reverse()),["ArrowUp","ArrowDown"].includes(pe.key)){const Ce=pe.target,H=Re.indexOf(Ce);Re=Re.slice(H+1)}setTimeout(()=>Y(Re)),pe.preventDefault()}})}))))))}),HZ=M.forwardRef((n,e)=>{const{__scopeSelect:t,onPlaced:r,...i}=n,s=Hc(zd,t),o=Wy(zd,t),[a,l]=M.useState(null),[u,f]=M.useState(null),h=Zt(e,P=>f(P)),p=Sb(t),m=M.useRef(!1),v=M.useRef(!0),{viewport:w,selectedItem:x,selectedItemText:g,focusSelectedItem:S}=o,_=M.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&u&&w&&x&&g){const P=s.trigger.getBoundingClientRect(),D=u.getBoundingClientRect(),V=s.valueNode.getBoundingClientRect(),C=g.getBoundingClientRect();if(s.dir!=="rtl"){const Ce=C.left-D.left,H=V.left-Ce,xe=P.left-H,de=P.width+xe,Te=Math.max(de,D.width),ye=window.innerWidth-Po,Xe=vp(H,[Po,ye-Te]);a.style.minWidth=de+"px",a.style.left=Xe+"px"}else{const Ce=D.right-C.right,H=window.innerWidth-V.right-Ce,xe=window.innerWidth-P.right-H,de=P.width+xe,Te=Math.max(de,D.width),ye=window.innerWidth-Po,Xe=vp(H,[Po,ye-Te]);a.style.minWidth=de+"px",a.style.right=Xe+"px"}const L=p(),W=window.innerHeight-Po*2,Q=w.scrollHeight,z=window.getComputedStyle(u),j=parseInt(z.borderTopWidth,10),Y=parseInt(z.paddingTop,10),re=parseInt(z.borderBottomWidth,10),U=parseInt(z.paddingBottom,10),X=j+Y+Q+U+re,q=Math.min(x.offsetHeight*5,X),K=window.getComputedStyle(w),se=parseInt(K.paddingTop,10),ve=parseInt(K.paddingBottom,10),te=P.top+P.height/2-Po,le=W-te,Me=x.offsetHeight/2,pe=x.offsetTop+Me,Ae=j+Y+pe,De=X-Ae;if(Ae<=te){const Ce=x===L[L.length-1].ref.current;a.style.bottom="0px";const H=u.clientHeight-w.offsetTop-w.offsetHeight,xe=Math.max(le,Me+(Ce?ve:0)+H+re),de=Ae+xe;a.style.height=de+"px"}else{const Ce=x===L[0].ref.current;a.style.top="0px";const xe=Math.max(te,j+w.offsetTop+(Ce?se:0)+Me)+De;a.style.height=xe+"px",w.scrollTop=Ae-te+w.offsetTop}a.style.margin=`${Po}px 0`,a.style.minHeight=q+"px",a.style.maxHeight=W+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[p,s.trigger,s.valueNode,a,u,w,x,g,s.dir,r]);us(()=>_(),[_]);const[b,A]=M.useState();us(()=>{u&&A(window.getComputedStyle(u).zIndex)},[u]);const R=M.useCallback(P=>{P&&v.current===!0&&(_(),S==null||S(),v.current=!1)},[_,S]);return M.createElement($Z,{scope:t,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:R},M.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b}},M.createElement(Dt.div,Ue({},i,{ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),KR=M.forwardRef((n,e)=>{const{__scopeSelect:t,align:r="start",collisionPadding:i=Po,...s}=n,o=wb(t);return M.createElement(HY,Ue({},o,s,{ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[$Z,WZ]=tf(zd,{}),QR="SelectViewport",GZ=M.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,i=Wy(QR,t),s=WZ(QR,t),o=Zt(e,i.onViewportChange),a=M.useRef(0);return M.createElement(M.Fragment,null,M.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),M.createElement($y.Slot,{scope:t},M.createElement(Dt.div,Ue({"data-radix-select-viewport":"",role:"presentation"},r,{ref:o,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:bt(r.onScroll,l=>{const u=l.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=s;if(h!=null&&h.current&&f){const p=Math.abs(a.current-u.scrollTop);if(p>0){const m=window.innerHeight-Po*2,v=parseFloat(f.style.minHeight),w=parseFloat(f.style.height),x=Math.max(v,w);if(x0?_:0,f.style.justifyContent="flex-end")}}}a.current=u.scrollTop})}))))}),jZ="SelectGroup",[xee,XZ]=tf(jZ),qZ="SelectLabel",YZ=M.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,i=XZ(qZ,t);return M.createElement(Dt.div,Ue({id:i.id},r,{ref:e}))}),Xw="SelectItem",[ZZ,nk]=tf(Xw),KZ=M.forwardRef((n,e)=>{const{__scopeSelect:t,value:r,disabled:i=!1,textValue:s,...o}=n,a=Hc(Xw,t),l=Wy(Xw,t),u=a.value===r,[f,h]=M.useState(s??""),[p,m]=M.useState(!1),v=Zt(e,g=>{var S;return(S=l.itemRefCallback)===null||S===void 0?void 0:S.call(l,g,r,i)}),w=mc(),x=()=>{i||(a.onValueChange(r),a.onOpenChange(!1))};return M.createElement(ZZ,{scope:t,value:r,disabled:i,textId:w,isSelected:u,onItemTextChange:M.useCallback(g=>{h(S=>{var _;return S||((_=g==null?void 0:g.textContent)!==null&&_!==void 0?_:"").trim()})},[])},M.createElement($y.ItemSlot,{scope:t,value:r,disabled:i,textValue:f},M.createElement(Dt.div,Ue({role:"option","aria-labelledby":w,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},o,{ref:v,onFocus:bt(o.onFocus,()=>m(!0)),onBlur:bt(o.onBlur,()=>m(!1)),onPointerUp:bt(o.onPointerUp,x),onPointerMove:bt(o.onPointerMove,g=>{if(i){var S;(S=l.onItemLeave)===null||S===void 0||S.call(l)}else g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:bt(o.onPointerLeave,g=>{if(g.currentTarget===document.activeElement){var S;(S=l.onItemLeave)===null||S===void 0||S.call(l)}}),onKeyDown:bt(o.onKeyDown,g=>{var S;((S=l.searchRef)===null||S===void 0?void 0:S.current)!==""&&g.key===" "||(AZ.includes(g.key)&&x(),g.key===" "&&g.preventDefault())})}))))}),vv="SelectItemText",QZ=M.forwardRef((n,e)=>{const{__scopeSelect:t,className:r,style:i,...s}=n,o=Hc(vv,t),a=Wy(vv,t),l=nk(vv,t),u=LZ(vv,t),[f,h]=M.useState(null),p=Zt(e,g=>h(g),l.onItemTextChange,g=>{var S;return(S=a.itemTextRefCallback)===null||S===void 0?void 0:S.call(a,g,l.value,l.disabled)}),m=f==null?void 0:f.textContent,v=M.useMemo(()=>M.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},m),[l.disabled,l.value,m]),{onNativeOptionAdd:w,onNativeOptionRemove:x}=u;return us(()=>(w(v),()=>x(v)),[w,x,v]),M.createElement(M.Fragment,null,M.createElement(Dt.span,Ue({id:l.textId},s,{ref:p})),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Vc.createPortal(s.children,o.valueNode):null)}),JZ="SelectItemIndicator",eK=M.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n;return nk(JZ,t).isSelected?M.createElement(Dt.span,Ue({"aria-hidden":!0},r,{ref:e})):null}),tK=M.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n;return M.createElement(Dt.div,Ue({"aria-hidden":!0},r,{ref:e}))}),rk=M.forwardRef((n,e)=>{const{value:t,...r}=n,i=M.useRef(null),s=Zt(e,i),o=fb(t);return M.useEffect(()=>{const a=i.current,l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==t&&f){const h=new Event("change",{bubbles:!0});f.call(a,t),a.dispatchEvent(h)}},[o,t]),M.createElement(WY,{asChild:!0},M.createElement("select",Ue({},r,{ref:s,defaultValue:t})))});rk.displayName="BubbleSelect";function ik(n){const e=Xn(n),t=M.useRef(""),r=M.useRef(0),i=M.useCallback(o=>{const a=t.current+o;e(a),function l(u){t.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[e]),s=M.useCallback(()=>{t.current="",window.clearTimeout(r.current)},[]);return M.useEffect(()=>()=>window.clearTimeout(r.current),[]),[t,i,s]}function sk(n,e,t){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=t?n.indexOf(t):-1;let o=nK(n,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==t));const l=o.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==t?l:void 0}function nK(n,e){return n.map((t,r)=>n[(e+r)%n.length])}const rK=DZ,ok=OZ,iK=UZ,sK=FZ,oK=zZ,ak=BZ,aK=GZ,lk=YZ,ck=KZ,lK=QZ,cK=eK,uk=tK,qw=rK,Yw=iK,B0=M.forwardRef(({className:n,children:e,...t},r)=>N.jsxs(ok,{ref:r,className:jt("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),...t,children:[e,N.jsx(sK,{asChild:!0,children:N.jsx(TW,{className:"h-4 w-4 opacity-50"})})]}));B0.displayName=ok.displayName;const V0=M.forwardRef(({className:n,children:e,position:t="popper",...r},i)=>N.jsx(oK,{children:N.jsx(ak,{ref:i,className:jt("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:t,...r,children:N.jsx(aK,{className:jt("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e})})}));V0.displayName=ak.displayName;const uK=M.forwardRef(({className:n,...e},t)=>N.jsx(lk,{ref:t,className:jt("py-1.5 pl-8 pr-2 text-sm font-semibold",n),...e}));uK.displayName=lk.displayName;const H0=M.forwardRef(({className:n,children:e,...t},r)=>N.jsxs(ck,{ref:r,className:jt("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50","cursor-pointer text-foreground/50 hover:text-foreground/80 aria-selected:text-foreground",n),...t,children:[N.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:N.jsx(cK,{children:N.jsx(bW,{className:"h-4 w-4"})})}),N.jsx(lK,{children:e})]}));H0.displayName=ck.displayName;const dK=M.forwardRef(({className:n,...e},t)=>N.jsx(uk,{ref:t,className:jt("-mx-1 my-1 h-px bg-muted",n),...e}));dK.displayName=uk.displayName;const Zw="horizontal",fK=["horizontal","vertical"],dk=M.forwardRef((n,e)=>{const{decorative:t,orientation:r=Zw,...i}=n,s=fk(r)?r:Zw,a=t?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return M.createElement(Dt.div,Ue({"data-orientation":s},a,i,{ref:e}))});dk.propTypes={orientation(n,e,t){const r=n[e],i=String(r);return r&&!fk(r)?new Error(hK(i,t)):null}};function hK(n,e){return`Invalid prop \`orientation\` of value \`${n}\` supplied to \`${e}\`, expected one of: +`)},zZ=0,Du=[];function BZ(n){var e=M.useRef([]),t=M.useRef([0,0]),r=M.useRef(),i=M.useState(zZ++)[0],s=M.useState(function(){return tk()})[0],o=M.useRef(n);M.useEffect(function(){o.current=n},[n]),M.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(i));var w=cZ([n.lockRef.current],(n.shards||[]).map(KR),!0).filter(Boolean);return w.forEach(function(x){return x.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(i))})}}},[n.inert,n.lockRef.current,n.shards]);var a=M.useCallback(function(w,x){if("touches"in w&&w.touches.length===2)return!o.current.allowPinchZoom;var g=yv(w),S=t.current,_="deltaX"in w?w.deltaX:S[0]-g[0],b="deltaY"in w?w.deltaY:S[1]-g[1],A,R=w.target,P=Math.abs(_)>Math.abs(b)?"h":"v";if("touches"in w&&P==="h"&&R.type==="range")return!1;var D=YR(P,R);if(!D)return!0;if(D?A=P:(A=P==="v"?"h":"v",D=YR(P,R)),!D)return!1;if(!r.current&&"changedTouches"in w&&(_||b)&&(r.current=A),!A)return!0;var V=r.current||A;return kZ(V,x,w,V==="h"?_:b,!0)},[]),l=M.useCallback(function(w){var x=w;if(!(!Du.length||Du[Du.length-1]!==s)){var g="deltaY"in x?ZR(x):yv(x),S=e.current.filter(function(A){return A.name===x.type&&A.target===x.target&&UZ(A.delta,g)})[0];if(S&&S.should){x.cancelable&&x.preventDefault();return}if(!S){var _=(o.current.shards||[]).map(KR).filter(Boolean).filter(function(A){return A.contains(x.target)}),b=_.length>0?a(x,_[0]):!o.current.noIsolation;b&&x.cancelable&&x.preventDefault()}}},[]),u=M.useCallback(function(w,x,g,S){var _={name:w,delta:x,target:g,should:S};e.current.push(_),setTimeout(function(){e.current=e.current.filter(function(b){return b!==_})},1)},[]),f=M.useCallback(function(w){t.current=yv(w),r.current=void 0},[]),h=M.useCallback(function(w){u(w.type,ZR(w),w.target,a(w,n.lockRef.current))},[]),p=M.useCallback(function(w){u(w.type,yv(w),w.target,a(w,n.lockRef.current))},[]);M.useEffect(function(){return Du.push(s),n.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Lu),document.addEventListener("touchmove",l,Lu),document.addEventListener("touchstart",f,Lu),function(){Du=Du.filter(function(w){return w!==s}),document.removeEventListener("wheel",l,Lu),document.removeEventListener("touchmove",l,Lu),document.removeEventListener("touchstart",f,Lu)}},[]);var m=n.removeScrollBar,v=n.inert;return M.createElement(M.Fragment,null,v?M.createElement(s,{styles:FZ(i)}):null,m?M.createElement(RZ,{gapMode:"margin"}):null)}const VZ=vZ(ek,BZ);var sk=M.forwardRef(function(n,e){return M.createElement($y,no({},n,{ref:e,sideCar:VZ}))});sk.classNames=$y.classNames;const ok=sk,HZ=[" ","Enter","ArrowUp","ArrowDown"],$Z=[" ","Enter"],Wy="Select",[Gy,Sb,WZ]=pb(Wy),[rf,Dee]=na(Wy,[WZ,jO]),wb=jO(),[GZ,Wc]=rf(Wy),[jZ,XZ]=rf(Wy),qZ=n=>{const{__scopeSelect:e,children:t,open:r,defaultOpen:i,onOpenChange:s,value:o,defaultValue:a,onValueChange:l,dir:u,name:f,autoComplete:h,disabled:p,required:m}=n,v=wb(e),[w,x]=M.useState(null),[g,S]=M.useState(null),[_,b]=M.useState(!1),A=tm(u),[R=!1,P]=Rc({prop:r,defaultProp:i,onChange:s}),[D,V]=Rc({prop:o,defaultProp:a,onChange:l}),C=M.useRef(null),L=w?!!w.closest("form"):!0,[W,Q]=M.useState(new Set),z=Array.from(W).map(j=>j.props.value).join(";");return M.createElement(tZ,v,M.createElement(GZ,{required:m,scope:e,trigger:w,onTriggerChange:x,valueNode:g,onValueNodeChange:S,valueNodeHasChildren:_,onValueNodeHasChildrenChange:b,contentId:vc(),value:D,onValueChange:V,open:R,onOpenChange:P,dir:A,triggerPointerDownPosRef:C,disabled:p},M.createElement(Gy.Provider,{scope:e},M.createElement(jZ,{scope:n.__scopeSelect,onNativeOptionAdd:M.useCallback(j=>{Q(Y=>new Set(Y).add(j))},[]),onNativeOptionRemove:M.useCallback(j=>{Q(Y=>{const re=new Set(Y);return re.delete(j),re})},[])},t)),L?M.createElement(ck,{key:z,"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:h,value:D,onChange:j=>V(j.target.value),disabled:p},D===void 0?M.createElement("option",{value:""}):null,Array.from(W)):null))},YZ="SelectTrigger",ZZ=M.forwardRef((n,e)=>{const{__scopeSelect:t,disabled:r=!1,...i}=n,s=wb(t),o=Wc(YZ,t),a=o.disabled||r,l=Zt(e,o.onTriggerChange),u=Sb(t),[f,h,p]=uk(v=>{const w=u().filter(S=>!S.disabled),x=w.find(S=>S.value===o.value),g=dk(w,v,x);g!==void 0&&o.onValueChange(g.value)}),m=()=>{a||(o.onOpenChange(!0),p())};return M.createElement(nZ,Ue({asChild:!0},s),M.createElement(Dt.button,Ue({type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":o.value===void 0?"":void 0},i,{ref:l,onClick:bt(i.onClick,v=>{v.currentTarget.focus()}),onPointerDown:bt(i.onPointerDown,v=>{const w=v.target;w.hasPointerCapture(v.pointerId)&&w.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&(m(),o.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)},v.preventDefault())}),onKeyDown:bt(i.onKeyDown,v=>{const w=f.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&h(v.key),!(w&&v.key===" ")&&HZ.includes(v.key)&&(m(),v.preventDefault())})})))}),KZ="SelectValue",QZ=M.forwardRef((n,e)=>{const{__scopeSelect:t,className:r,style:i,children:s,placeholder:o,...a}=n,l=Wc(KZ,t),{onValueNodeHasChildrenChange:u}=l,f=s!==void 0,h=Zt(e,l.onValueNodeChange);return us(()=>{u(f)},[u,f]),M.createElement(Dt.span,Ue({},a,{ref:h,style:{pointerEvents:"none"}}),l.value===void 0&&o!==void 0?o:s)}),JZ=M.forwardRef((n,e)=>{const{__scopeSelect:t,children:r,...i}=n;return M.createElement(Dt.span,Ue({"aria-hidden":!0},i,{ref:e}),r||"▼")}),eK=n=>M.createElement(iZ,Ue({asChild:!0},n)),Vd="SelectContent",tK=M.forwardRef((n,e)=>{const t=Wc(Vd,n.__scopeSelect),[r,i]=M.useState();if(us(()=>{i(new DocumentFragment)},[]),!t.open){const s=r;return s?$c.createPortal(M.createElement(ak,{scope:n.__scopeSelect},M.createElement(Gy.Slot,{scope:n.__scopeSelect},M.createElement("div",null,n.children))),s):null}return M.createElement(nK,Ue({},n,{ref:e}))}),Io=10,[ak,jy]=rf(Vd),nK=M.forwardRef((n,e)=>{const{__scopeSelect:t,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:a,sideOffset:l,align:u,alignOffset:f,arrowPadding:h,collisionBoundary:p,collisionPadding:m,sticky:v,hideWhenDetached:w,avoidCollisions:x,...g}=n,S=Wc(Vd,t),[_,b]=M.useState(null),[A,R]=M.useState(null),P=Zt(e,pe=>b(pe)),[D,V]=M.useState(null),[C,L]=M.useState(null),W=Sb(t),[Q,z]=M.useState(!1),j=M.useRef(!1);M.useEffect(()=>{if(_)return KO(_)},[_]),IO();const Y=M.useCallback(pe=>{const[Ae,...De]=W().map(H=>H.ref.current),[Re]=De.slice(-1),Ce=document.activeElement;for(const H of pe)if(H===Ce||(H==null||H.scrollIntoView({block:"nearest"}),H===Ae&&A&&(A.scrollTop=0),H===Re&&A&&(A.scrollTop=A.scrollHeight),H==null||H.focus(),document.activeElement!==Ce))return},[W,A]),re=M.useCallback(()=>Y([D,_]),[Y,D,_]);M.useEffect(()=>{Q&&re()},[Q,re]);const{onOpenChange:U,triggerPointerDownPosRef:X}=S;M.useEffect(()=>{if(_){let pe={x:0,y:0};const Ae=Re=>{var Ce,H,xe,de;pe={x:Math.abs(Math.round(Re.pageX)-((Ce=(H=X.current)===null||H===void 0?void 0:H.x)!==null&&Ce!==void 0?Ce:0)),y:Math.abs(Math.round(Re.pageY)-((xe=(de=X.current)===null||de===void 0?void 0:de.y)!==null&&xe!==void 0?xe:0))}},De=Re=>{pe.x<=10&&pe.y<=10?Re.preventDefault():_.contains(Re.target)||U(!1),document.removeEventListener("pointermove",Ae),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",Ae),document.addEventListener("pointerup",De,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ae),document.removeEventListener("pointerup",De,{capture:!0})}}},[_,U,X]),M.useEffect(()=>{const pe=()=>U(!1);return window.addEventListener("blur",pe),window.addEventListener("resize",pe),()=>{window.removeEventListener("blur",pe),window.removeEventListener("resize",pe)}},[U]);const[q,K]=uk(pe=>{const Ae=W().filter(Ce=>!Ce.disabled),De=Ae.find(Ce=>Ce.ref.current===document.activeElement),Re=dk(Ae,pe,De);Re&&setTimeout(()=>Re.ref.current.focus())}),se=M.useCallback((pe,Ae,De)=>{const Re=!j.current&&!De;(S.value!==void 0&&S.value===Ae||Re)&&(V(pe),Re&&(j.current=!0))},[S.value]),ve=M.useCallback(()=>_==null?void 0:_.focus(),[_]),te=M.useCallback((pe,Ae,De)=>{const Re=!j.current&&!De;(S.value!==void 0&&S.value===Ae||Re)&&L(pe)},[S.value]),le=r==="popper"?QR:rK,Me=le===QR?{side:a,sideOffset:l,align:u,alignOffset:f,arrowPadding:h,collisionBoundary:p,collisionPadding:m,sticky:v,hideWhenDetached:w,avoidCollisions:x}:{};return M.createElement(ak,{scope:t,content:_,viewport:A,onViewportChange:R,itemRefCallback:se,selectedItem:D,onItemLeave:ve,itemTextRefCallback:te,focusSelectedItem:re,selectedItemText:C,position:r,isPositioned:Q,searchRef:q},M.createElement(ok,{as:Pc,allowPinchZoom:!0},M.createElement(Yq,{asChild:!0,trapped:S.open,onMountAutoFocus:pe=>{pe.preventDefault()},onUnmountAutoFocus:bt(i,pe=>{var Ae;(Ae=S.trigger)===null||Ae===void 0||Ae.focus({preventScroll:!0}),pe.preventDefault()})},M.createElement(jq,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:pe=>pe.preventDefault(),onDismiss:()=>S.onOpenChange(!1)},M.createElement(le,Ue({role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:pe=>pe.preventDefault()},g,Me,{onPlaced:()=>z(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:bt(g.onKeyDown,pe=>{const Ae=pe.ctrlKey||pe.altKey||pe.metaKey;if(pe.key==="Tab"&&pe.preventDefault(),!Ae&&pe.key.length===1&&K(pe.key),["ArrowUp","ArrowDown","Home","End"].includes(pe.key)){let Re=W().filter(Ce=>!Ce.disabled).map(Ce=>Ce.ref.current);if(["ArrowUp","End"].includes(pe.key)&&(Re=Re.slice().reverse()),["ArrowUp","ArrowDown"].includes(pe.key)){const Ce=pe.target,H=Re.indexOf(Ce);Re=Re.slice(H+1)}setTimeout(()=>Y(Re)),pe.preventDefault()}})}))))))}),rK=M.forwardRef((n,e)=>{const{__scopeSelect:t,onPlaced:r,...i}=n,s=Wc(Vd,t),o=jy(Vd,t),[a,l]=M.useState(null),[u,f]=M.useState(null),h=Zt(e,P=>f(P)),p=Sb(t),m=M.useRef(!1),v=M.useRef(!0),{viewport:w,selectedItem:x,selectedItemText:g,focusSelectedItem:S}=o,_=M.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&u&&w&&x&&g){const P=s.trigger.getBoundingClientRect(),D=u.getBoundingClientRect(),V=s.valueNode.getBoundingClientRect(),C=g.getBoundingClientRect();if(s.dir!=="rtl"){const Ce=C.left-D.left,H=V.left-Ce,xe=P.left-H,de=P.width+xe,Te=Math.max(de,D.width),ye=window.innerWidth-Io,Xe=xp(H,[Io,ye-Te]);a.style.minWidth=de+"px",a.style.left=Xe+"px"}else{const Ce=D.right-C.right,H=window.innerWidth-V.right-Ce,xe=window.innerWidth-P.right-H,de=P.width+xe,Te=Math.max(de,D.width),ye=window.innerWidth-Io,Xe=xp(H,[Io,ye-Te]);a.style.minWidth=de+"px",a.style.right=Xe+"px"}const L=p(),W=window.innerHeight-Io*2,Q=w.scrollHeight,z=window.getComputedStyle(u),j=parseInt(z.borderTopWidth,10),Y=parseInt(z.paddingTop,10),re=parseInt(z.borderBottomWidth,10),U=parseInt(z.paddingBottom,10),X=j+Y+Q+U+re,q=Math.min(x.offsetHeight*5,X),K=window.getComputedStyle(w),se=parseInt(K.paddingTop,10),ve=parseInt(K.paddingBottom,10),te=P.top+P.height/2-Io,le=W-te,Me=x.offsetHeight/2,pe=x.offsetTop+Me,Ae=j+Y+pe,De=X-Ae;if(Ae<=te){const Ce=x===L[L.length-1].ref.current;a.style.bottom="0px";const H=u.clientHeight-w.offsetTop-w.offsetHeight,xe=Math.max(le,Me+(Ce?ve:0)+H+re),de=Ae+xe;a.style.height=de+"px"}else{const Ce=x===L[0].ref.current;a.style.top="0px";const xe=Math.max(te,j+w.offsetTop+(Ce?se:0)+Me)+De;a.style.height=xe+"px",w.scrollTop=Ae-te+w.offsetTop}a.style.margin=`${Io}px 0`,a.style.minHeight=q+"px",a.style.maxHeight=W+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[p,s.trigger,s.valueNode,a,u,w,x,g,s.dir,r]);us(()=>_(),[_]);const[b,A]=M.useState();us(()=>{u&&A(window.getComputedStyle(u).zIndex)},[u]);const R=M.useCallback(P=>{P&&v.current===!0&&(_(),S==null||S(),v.current=!1)},[_,S]);return M.createElement(iK,{scope:t,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:R},M.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b}},M.createElement(Dt.div,Ue({},i,{ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),QR=M.forwardRef((n,e)=>{const{__scopeSelect:t,align:r="start",collisionPadding:i=Io,...s}=n,o=wb(t);return M.createElement(rZ,Ue({},o,s,{ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[iK,sK]=rf(Vd,{}),JR="SelectViewport",oK=M.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,i=jy(JR,t),s=sK(JR,t),o=Zt(e,i.onViewportChange),a=M.useRef(0);return M.createElement(M.Fragment,null,M.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),M.createElement(Gy.Slot,{scope:t},M.createElement(Dt.div,Ue({"data-radix-select-viewport":"",role:"presentation"},r,{ref:o,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:bt(r.onScroll,l=>{const u=l.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=s;if(h!=null&&h.current&&f){const p=Math.abs(a.current-u.scrollTop);if(p>0){const m=window.innerHeight-Io*2,v=parseFloat(f.style.minHeight),w=parseFloat(f.style.height),x=Math.max(v,w);if(x0?_:0,f.style.justifyContent="flex-end")}}}a.current=u.scrollTop})}))))}),aK="SelectGroup",[Nee,lK]=rf(aK),cK="SelectLabel",uK=M.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n,i=lK(cK,t);return M.createElement(Dt.div,Ue({id:i.id},r,{ref:e}))}),Yw="SelectItem",[dK,lk]=rf(Yw),fK=M.forwardRef((n,e)=>{const{__scopeSelect:t,value:r,disabled:i=!1,textValue:s,...o}=n,a=Wc(Yw,t),l=jy(Yw,t),u=a.value===r,[f,h]=M.useState(s??""),[p,m]=M.useState(!1),v=Zt(e,g=>{var S;return(S=l.itemRefCallback)===null||S===void 0?void 0:S.call(l,g,r,i)}),w=vc(),x=()=>{i||(a.onValueChange(r),a.onOpenChange(!1))};return M.createElement(dK,{scope:t,value:r,disabled:i,textId:w,isSelected:u,onItemTextChange:M.useCallback(g=>{h(S=>{var _;return S||((_=g==null?void 0:g.textContent)!==null&&_!==void 0?_:"").trim()})},[])},M.createElement(Gy.ItemSlot,{scope:t,value:r,disabled:i,textValue:f},M.createElement(Dt.div,Ue({role:"option","aria-labelledby":w,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},o,{ref:v,onFocus:bt(o.onFocus,()=>m(!0)),onBlur:bt(o.onBlur,()=>m(!1)),onPointerUp:bt(o.onPointerUp,x),onPointerMove:bt(o.onPointerMove,g=>{if(i){var S;(S=l.onItemLeave)===null||S===void 0||S.call(l)}else g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:bt(o.onPointerLeave,g=>{if(g.currentTarget===document.activeElement){var S;(S=l.onItemLeave)===null||S===void 0||S.call(l)}}),onKeyDown:bt(o.onKeyDown,g=>{var S;((S=l.searchRef)===null||S===void 0?void 0:S.current)!==""&&g.key===" "||($Z.includes(g.key)&&x(),g.key===" "&&g.preventDefault())})}))))}),xv="SelectItemText",hK=M.forwardRef((n,e)=>{const{__scopeSelect:t,className:r,style:i,...s}=n,o=Wc(xv,t),a=jy(xv,t),l=lk(xv,t),u=XZ(xv,t),[f,h]=M.useState(null),p=Zt(e,g=>h(g),l.onItemTextChange,g=>{var S;return(S=a.itemTextRefCallback)===null||S===void 0?void 0:S.call(a,g,l.value,l.disabled)}),m=f==null?void 0:f.textContent,v=M.useMemo(()=>M.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},m),[l.disabled,l.value,m]),{onNativeOptionAdd:w,onNativeOptionRemove:x}=u;return us(()=>(w(v),()=>x(v)),[w,x,v]),M.createElement(M.Fragment,null,M.createElement(Dt.span,Ue({id:l.textId},s,{ref:p})),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?$c.createPortal(s.children,o.valueNode):null)}),pK="SelectItemIndicator",mK=M.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n;return lk(pK,t).isSelected?M.createElement(Dt.span,Ue({"aria-hidden":!0},r,{ref:e})):null}),gK=M.forwardRef((n,e)=>{const{__scopeSelect:t,...r}=n;return M.createElement(Dt.div,Ue({"aria-hidden":!0},r,{ref:e}))}),ck=M.forwardRef((n,e)=>{const{value:t,...r}=n,i=M.useRef(null),s=Zt(e,i),o=fb(t);return M.useEffect(()=>{const a=i.current,l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==t&&f){const h=new Event("change",{bubbles:!0});f.call(a,t),a.dispatchEvent(h)}},[o,t]),M.createElement(sZ,{asChild:!0},M.createElement("select",Ue({},r,{ref:s,defaultValue:t})))});ck.displayName="BubbleSelect";function uk(n){const e=Xn(n),t=M.useRef(""),r=M.useRef(0),i=M.useCallback(o=>{const a=t.current+o;e(a),function l(u){t.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[e]),s=M.useCallback(()=>{t.current="",window.clearTimeout(r.current)},[]);return M.useEffect(()=>()=>window.clearTimeout(r.current),[]),[t,i,s]}function dk(n,e,t){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=t?n.indexOf(t):-1;let o=vK(n,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==t));const l=o.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==t?l:void 0}function vK(n,e){return n.map((t,r)=>n[(e+r)%n.length])}const yK=qZ,fk=ZZ,xK=QZ,_K=JZ,SK=eK,hk=tK,wK=oK,pk=uK,mk=fK,EK=hK,MK=mK,gk=gK,Zw=yK,Kw=xK,H0=M.forwardRef(({className:n,children:e,...t},r)=>N.jsxs(fk,{ref:r,className:jt("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),...t,children:[e,N.jsx(_K,{asChild:!0,children:N.jsx(LW,{className:"h-4 w-4 opacity-50"})})]}));H0.displayName=fk.displayName;const $0=M.forwardRef(({className:n,children:e,position:t="popper",...r},i)=>N.jsx(SK,{children:N.jsx(hk,{ref:i,className:jt("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:t,...r,children:N.jsx(wK,{className:jt("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e})})}));$0.displayName=hk.displayName;const bK=M.forwardRef(({className:n,...e},t)=>N.jsx(pk,{ref:t,className:jt("py-1.5 pl-8 pr-2 text-sm font-semibold",n),...e}));bK.displayName=pk.displayName;const W0=M.forwardRef(({className:n,children:e,...t},r)=>N.jsxs(mk,{ref:r,className:jt("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50","cursor-pointer text-foreground/50 hover:text-foreground/80 aria-selected:text-foreground",n),...t,children:[N.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:N.jsx(MK,{children:N.jsx(IW,{className:"h-4 w-4"})})}),N.jsx(EK,{children:e})]}));W0.displayName=mk.displayName;const TK=M.forwardRef(({className:n,...e},t)=>N.jsx(gk,{ref:t,className:jt("-mx-1 my-1 h-px bg-muted",n),...e}));TK.displayName=gk.displayName;const Qw="horizontal",CK=["horizontal","vertical"],vk=M.forwardRef((n,e)=>{const{decorative:t,orientation:r=Qw,...i}=n,s=yk(r)?r:Qw,a=t?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return M.createElement(Dt.div,Ue({"data-orientation":s},a,i,{ref:e}))});vk.propTypes={orientation(n,e,t){const r=n[e],i=String(r);return r&&!yk(r)?new Error(AK(i,t)):null}};function AK(n,e){return`Invalid prop \`orientation\` of value \`${n}\` supplied to \`${e}\`, expected one of: - horizontal - vertical -Defaulting to \`${Zw}\`.`}function fk(n){return fK.includes(n)}const hk=dk,Eb=M.forwardRef(({className:n,orientation:e="horizontal",decorative:t=!0,...r},i)=>N.jsx(hk,{ref:i,decorative:t,orientation:e,className:jt("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",n),...r}));Eb.displayName=hk.displayName;const Kw="dismissableLayer.update",pK="dismissableLayer.pointerDownOutside",mK="dismissableLayer.focusOutside";let JR;const gK=M.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vK=M.forwardRef((n,e)=>{var t;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...u}=n,f=M.useContext(gK),[h,p]=M.useState(null),m=(t=h==null?void 0:h.ownerDocument)!==null&&t!==void 0?t:globalThis==null?void 0:globalThis.document,[,v]=M.useState({}),w=Zt(e,D=>p(D)),x=Array.from(f.layers),[g]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=x.indexOf(g),_=h?x.indexOf(h):-1,b=f.layersWithOutsidePointerEventsDisabled.size>0,A=_>=S,R=yK(D=>{const V=D.target,C=[...f.branches].some(L=>L.contains(V));!A||C||(s==null||s(D),a==null||a(D),D.defaultPrevented||l==null||l())},m),P=xK(D=>{const V=D.target;[...f.branches].some(L=>L.contains(V))||(o==null||o(D),a==null||a(D),D.defaultPrevented||l==null||l())},m);return EO(D=>{_===f.layers.size-1&&(i==null||i(D),!D.defaultPrevented&&l&&(D.preventDefault(),l()))},m),M.useEffect(()=>{if(h)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(JR=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),eP(),()=>{r&&f.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=JR)}},[h,m,r,f]),M.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),eP())},[h,f]),M.useEffect(()=>{const D=()=>v({});return document.addEventListener(Kw,D),()=>document.removeEventListener(Kw,D)},[]),M.createElement(Dt.div,Ue({},u,{ref:w,style:{pointerEvents:b?A?"auto":"none":void 0,...n.style},onFocusCapture:bt(n.onFocusCapture,P.onFocusCapture),onBlurCapture:bt(n.onBlurCapture,P.onBlurCapture),onPointerDownCapture:bt(n.onPointerDownCapture,R.onPointerDownCapture)}))});function yK(n,e=globalThis==null?void 0:globalThis.document){const t=Xn(n),r=M.useRef(!1),i=M.useRef(()=>{});return M.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){pk(pK,t,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=u,e.addEventListener("click",i.current,{once:!0})):u()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,t]),{onPointerDownCapture:()=>r.current=!0}}function xK(n,e=globalThis==null?void 0:globalThis.document){const t=Xn(n),r=M.useRef(!1);return M.useEffect(()=>{const i=s=>{s.target&&!r.current&&pk(mK,t,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,t]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function eP(){const n=new CustomEvent(Kw);document.dispatchEvent(n)}function pk(n,e,t,{discrete:r}){const i=t.originalEvent.target,s=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:t});e&&i.addEventListener(n,e,{once:!0}),r?xO(i,s):i.dispatchEvent(s)}const LS="focusScope.autoFocusOnMount",DS="focusScope.autoFocusOnUnmount",tP={bubbles:!1,cancelable:!0},_K=M.forwardRef((n,e)=>{const{loop:t=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=n,[a,l]=M.useState(null),u=Xn(i),f=Xn(s),h=M.useRef(null),p=Zt(e,w=>l(w)),m=M.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;M.useEffect(()=>{if(r){let w=function(_){if(m.paused||!a)return;const b=_.target;a.contains(b)?h.current=b:Ta(h.current,{select:!0})},x=function(_){if(m.paused||!a)return;const b=_.relatedTarget;b!==null&&(a.contains(b)||Ta(h.current,{select:!0}))},g=function(_){if(document.activeElement===document.body)for(const A of _)A.removedNodes.length>0&&Ta(a)};document.addEventListener("focusin",w),document.addEventListener("focusout",x);const S=new MutationObserver(g);return a&&S.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",x),S.disconnect()}}},[r,a,m.paused]),M.useEffect(()=>{if(a){rP.add(m);const w=document.activeElement;if(!a.contains(w)){const g=new CustomEvent(LS,tP);a.addEventListener(LS,u),a.dispatchEvent(g),g.defaultPrevented||(SK(TK(mk(a)),{select:!0}),document.activeElement===w&&Ta(a))}return()=>{a.removeEventListener(LS,u),setTimeout(()=>{const g=new CustomEvent(DS,tP);a.addEventListener(DS,f),a.dispatchEvent(g),g.defaultPrevented||Ta(w??document.body,{select:!0}),a.removeEventListener(DS,f),rP.remove(m)},0)}}},[a,u,f,m]);const v=M.useCallback(w=>{if(!t&&!r||m.paused)return;const x=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,g=document.activeElement;if(x&&g){const S=w.currentTarget,[_,b]=wK(S);_&&b?!w.shiftKey&&g===b?(w.preventDefault(),t&&Ta(_,{select:!0})):w.shiftKey&&g===_&&(w.preventDefault(),t&&Ta(b,{select:!0})):g===S&&w.preventDefault()}},[t,r,m.paused]);return M.createElement(Dt.div,Ue({tabIndex:-1},o,{ref:p,onKeyDown:v}))});function SK(n,{select:e=!1}={}){const t=document.activeElement;for(const r of n)if(Ta(r,{select:e}),document.activeElement!==t)return}function wK(n){const e=mk(n),t=nP(e,n),r=nP(e.reverse(),n);return[t,r]}function mk(n){const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function nP(n,e){for(const t of n)if(!EK(t,{upTo:e}))return t}function EK(n,{upTo:e}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e!==void 0&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}function MK(n){return n instanceof HTMLInputElement&&"select"in n}function Ta(n,{select:e=!1}={}){if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),n!==t&&MK(n)&&e&&n.select()}}const rP=bK();function bK(){let n=[];return{add(e){const t=n[0];e!==t&&(t==null||t.pause()),n=iP(n,e),n.unshift(e)},remove(e){var t;n=iP(n,e),(t=n[0])===null||t===void 0||t.resume()}}}function iP(n,e){const t=[...n],r=t.indexOf(e);return r!==-1&&t.splice(r,1),t}function TK(n){return n.filter(e=>e.tagName!=="A")}const CK=M.forwardRef((n,e)=>{var t;const{container:r=globalThis==null||(t=globalThis.document)===null||t===void 0?void 0:t.body,...i}=n;return r?dO.createPortal(M.createElement(Dt.div,Ue({},i,{ref:e})),r):null});function AK(n,e){return M.useReducer((t,r)=>{const i=e[t][r];return i??t},n)}const ra=n=>{const{present:e,children:t}=n,r=RK(e),i=typeof t=="function"?t({present:r.isPresent}):M.Children.only(t),s=Zt(r.ref,i.ref);return typeof t=="function"||r.isPresent?M.cloneElement(i,{ref:s}):null};ra.displayName="Presence";function RK(n){const[e,t]=M.useState(),r=M.useRef({}),i=M.useRef(n),s=M.useRef("none"),o=n?"mounted":"unmounted",[a,l]=AK(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return M.useEffect(()=>{const u=yv(r.current);s.current=a==="mounted"?u:"none"},[a]),us(()=>{const u=r.current,f=i.current;if(f!==n){const p=s.current,m=yv(u);n?l("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=n}},[n,l]),us(()=>{if(e){const u=h=>{const m=yv(r.current).includes(h.animationName);h.target===e&&m&&Vc.flushSync(()=>l("ANIMATION_END"))},f=h=>{h.target===e&&(s.current=yv(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",u),e.addEventListener("animationend",u),()=>{e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",u),e.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:M.useCallback(u=>{u&&(r.current=getComputedStyle(u)),t(u)},[])}}function yv(n){return(n==null?void 0:n.animationName)||"none"}const gk="Dialog",[vk,_ee]=ta(gk),[PK,Os]=vk(gk),IK=n=>{const{__scopeDialog:e,children:t,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=n,a=M.useRef(null),l=M.useRef(null),[u=!1,f]=Cc({prop:r,defaultProp:i,onChange:s});return M.createElement(PK,{scope:e,triggerRef:a,contentRef:l,contentId:mc(),titleId:mc(),descriptionId:mc(),open:u,onOpenChange:f,onOpenToggle:M.useCallback(()=>f(h=>!h),[f]),modal:o},t)},LK="DialogTrigger",DK=M.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=Os(LK,t),s=Zt(e,i.triggerRef);return M.createElement(Dt.button,Ue({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Mb(i.open)},r,{ref:s,onClick:bt(n.onClick,i.onOpenToggle)}))}),yk="DialogPortal",[NK,xk]=vk(yk,{forceMount:void 0}),OK=n=>{const{__scopeDialog:e,forceMount:t,children:r,container:i}=n,s=Os(yk,e);return M.createElement(NK,{scope:e,forceMount:t},M.Children.map(r,o=>M.createElement(ra,{present:t||s.open},M.createElement(CK,{asChild:!0,container:i},o))))},Qw="DialogOverlay",kK=M.forwardRef((n,e)=>{const t=xk(Qw,n.__scopeDialog),{forceMount:r=t.forceMount,...i}=n,s=Os(Qw,n.__scopeDialog);return s.modal?M.createElement(ra,{present:r||s.open},M.createElement(UK,Ue({},i,{ref:e}))):null}),UK=M.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=Os(Qw,t);return M.createElement(ek,{as:Ac,allowPinchZoom:!0,shards:[i.contentRef]},M.createElement(Dt.div,Ue({"data-state":Mb(i.open)},r,{ref:e,style:{pointerEvents:"auto",...r.style}})))}),_p="DialogContent",FK=M.forwardRef((n,e)=>{const t=xk(_p,n.__scopeDialog),{forceMount:r=t.forceMount,...i}=n,s=Os(_p,n.__scopeDialog);return M.createElement(ra,{present:r||s.open},s.modal?M.createElement(zK,Ue({},i,{ref:e})):M.createElement(BK,Ue({},i,{ref:e})))}),zK=M.forwardRef((n,e)=>{const t=Os(_p,n.__scopeDialog),r=M.useRef(null),i=Zt(e,t.contentRef,r);return M.useEffect(()=>{const s=r.current;if(s)return GO(s)},[]),M.createElement(_k,Ue({},n,{ref:i,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:bt(n.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=t.triggerRef.current)===null||o===void 0||o.focus()}),onPointerDownOutside:bt(n.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:bt(n.onFocusOutside,s=>s.preventDefault())}))}),BK=M.forwardRef((n,e)=>{const t=Os(_p,n.__scopeDialog),r=M.useRef(!1),i=M.useRef(!1);return M.createElement(_k,Ue({},n,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o;if((o=n.onCloseAutoFocus)===null||o===void 0||o.call(n,s),!s.defaultPrevented){var a;r.current||(a=t.triggerRef.current)===null||a===void 0||a.focus(),s.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=n.onInteractOutside)===null||o===void 0||o.call(n,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=s.target;((a=t.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}}))}),_k=M.forwardRef((n,e)=>{const{__scopeDialog:t,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=n,a=Os(_p,t),l=M.useRef(null),u=Zt(e,l);return bO(),M.createElement(M.Fragment,null,M.createElement(_K,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s},M.createElement(vK,Ue({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Mb(a.open)},o,{ref:u,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),VK="DialogTitle",HK=M.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=Os(VK,t);return M.createElement(Dt.h2,Ue({id:i.titleId},r,{ref:e}))}),$K="DialogDescription",WK=M.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=Os($K,t);return M.createElement(Dt.p,Ue({id:i.descriptionId},r,{ref:e}))}),GK="DialogClose",jK=M.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=Os(GK,t);return M.createElement(Dt.button,Ue({type:"button"},r,{ref:e,onClick:bt(n.onClick,()=>i.onOpenChange(!1))}))});function Mb(n){return n?"open":"closed"}const XK=IK,qK=DK,YK=OK,Sk=kK,wk=FK,Ek=HK,Mk=WK,ZK=jK;function KK(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,s;for(s=0;s=0)&&(t[i]=n[i]);return t}var QK=["color"],JK=M.forwardRef(function(n,e){var t=n.color,r=t===void 0?"currentColor":t,i=KK(n,QK);return M.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:e}),M.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});function bk(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n))for(e=0;etypeof n=="boolean"?"".concat(n):n===0?"0":n,oP=eQ,bb=(n,e)=>t=>{var r;if((e==null?void 0:e.variants)==null)return oP(n,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:i,defaultVariants:s}=e,o=Object.keys(i).map(u=>{const f=t==null?void 0:t[u],h=s==null?void 0:s[u];if(f===null)return null;const p=sP(f)||sP(h);return i[u][p]}),a=t&&Object.entries(t).reduce((u,f)=>{let[h,p]=f;return p===void 0||(u[h]=p),u},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,f)=>{let{class:h,className:p,...m}=f;return Object.entries(m).every(v=>{let[w,x]=v;return Array.isArray(x)?x.includes({...s,...a}[w]):{...s,...a}[w]===x})?[...u,h,p]:u},[]);return oP(n,o,l,t==null?void 0:t.class,t==null?void 0:t.className)},Tk=XK,Ck=qK,tQ=YK,Ak=M.forwardRef(({className:n,...e},t)=>N.jsx(Sk,{className:jt("fixed inset-0 z-50 bg-black/25 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...e,ref:t}));Ak.displayName=Sk.displayName;const nQ=bb("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Tb=M.forwardRef(({side:n="right",className:e,children:t,...r},i)=>N.jsxs(tQ,{children:[N.jsx(Ak,{}),N.jsxs(wk,{ref:i,className:jt(nQ({side:n}),e),...r,children:[t,N.jsxs(ZK,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[N.jsx(JK,{className:"h-4 w-4"}),N.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Tb.displayName=wk.displayName;const rQ=M.forwardRef(({className:n,...e},t)=>N.jsx(Ek,{ref:t,className:jt("text-lg font-semibold text-foreground",n),...e}));rQ.displayName=Ek.displayName;const iQ=M.forwardRef(({className:n,...e},t)=>N.jsx(Mk,{ref:t,className:jt("text-sm text-muted-foreground",n),...e}));iQ.displayName=Mk.displayName;const Rk=["PageUp","PageDown"],Pk=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ik={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},tm="Slider",[Jw,sQ,oQ]=pb(tm),[Lk,See]=ta(tm,[oQ]),[aQ,Gy]=Lk(tm),lQ=M.forwardRef((n,e)=>{const{name:t,min:r=0,max:i=100,step:s=1,orientation:o="horizontal",disabled:a=!1,minStepsBetweenThumbs:l=0,defaultValue:u=[r],value:f,onValueChange:h=()=>{},onValueCommit:p=()=>{},inverted:m=!1,...v}=n,[w,x]=M.useState(null),g=Zt(e,z=>x(z)),S=M.useRef(new Set),_=M.useRef(0),b=o==="horizontal",A=w?!!w.closest("form"):!0,R=b?cQ:uQ,[P=[],D]=Cc({prop:f,defaultProp:u,onChange:z=>{var j;(j=[...S.current][_.current])===null||j===void 0||j.focus(),h(z)}}),V=M.useRef(P);function C(z){const j=xQ(P,z);Q(z,j)}function L(z){Q(z,_.current)}function W(){const z=V.current[_.current];P[_.current]!==z&&p(P)}function Q(z,j,{commit:Y}={commit:!1}){const re=EQ(s),U=MQ(Math.round((z-r)/s)*s+r,re),X=vp(U,[r,i]);D((q=[])=>{const K=vQ(q,X,j);if(wQ(K,l*s)){_.current=K.indexOf(X);const se=String(K)!==String(q);return se&&Y&&p(K),se?K:q}else return q})}return M.createElement(aQ,{scope:n.__scopeSlider,disabled:a,min:r,max:i,valueIndexToChangeRef:_,thumbs:S.current,values:P,orientation:o},M.createElement(Jw.Provider,{scope:n.__scopeSlider},M.createElement(Jw.Slot,{scope:n.__scopeSlider},M.createElement(R,Ue({"aria-disabled":a,"data-disabled":a?"":void 0},v,{ref:g,onPointerDown:bt(v.onPointerDown,()=>{a||(V.current=P)}),min:r,max:i,inverted:m,onSlideStart:a?void 0:C,onSlideMove:a?void 0:L,onSlideEnd:a?void 0:W,onHomeKeyDown:()=>!a&&Q(r,0,{commit:!0}),onEndKeyDown:()=>!a&&Q(i,P.length-1,{commit:!0}),onStepKeyDown:({event:z,direction:j})=>{if(!a){const U=Rk.includes(z.key)||z.shiftKey&&Pk.includes(z.key)?10:1,X=_.current,q=P[X],K=s*U*j;Q(q+K,X,{commit:!0})}}})))),A&&P.map((z,j)=>M.createElement(gQ,{key:j,name:t?t+(P.length>1?"[]":""):void 0,value:z})))}),[Dk,Nk]=Lk(tm,{startEdge:"left",endEdge:"right",size:"width",direction:1}),cQ=M.forwardRef((n,e)=>{const{min:t,max:r,dir:i,inverted:s,onSlideStart:o,onSlideMove:a,onSlideEnd:l,onStepKeyDown:u,...f}=n,[h,p]=M.useState(null),m=Zt(e,_=>p(_)),v=M.useRef(),w=Jp(i),x=w==="ltr",g=x&&!s||!x&&s;function S(_){const b=v.current||h.getBoundingClientRect(),A=[0,b.width],P=Cb(A,g?[t,r]:[r,t]);return v.current=b,P(_-b.left)}return M.createElement(Dk,{scope:n.__scopeSlider,startEdge:g?"left":"right",endEdge:g?"right":"left",direction:g?1:-1,size:"width"},M.createElement(Ok,Ue({dir:w,"data-orientation":"horizontal"},f,{ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:_=>{const b=S(_.clientX);o==null||o(b)},onSlideMove:_=>{const b=S(_.clientX);a==null||a(b)},onSlideEnd:()=>{v.current=void 0,l==null||l()},onStepKeyDown:_=>{const A=Ik[g?"from-left":"from-right"].includes(_.key);u==null||u({event:_,direction:A?-1:1})}})))}),uQ=M.forwardRef((n,e)=>{const{min:t,max:r,inverted:i,onSlideStart:s,onSlideMove:o,onSlideEnd:a,onStepKeyDown:l,...u}=n,f=M.useRef(null),h=Zt(e,f),p=M.useRef(),m=!i;function v(w){const x=p.current||f.current.getBoundingClientRect(),g=[0,x.height],_=Cb(g,m?[r,t]:[t,r]);return p.current=x,_(w-x.top)}return M.createElement(Dk,{scope:n.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1},M.createElement(Ok,Ue({"data-orientation":"vertical"},u,{ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const x=v(w.clientY);s==null||s(x)},onSlideMove:w=>{const x=v(w.clientY);o==null||o(x)},onSlideEnd:()=>{p.current=void 0,a==null||a()},onStepKeyDown:w=>{const g=Ik[m?"from-bottom":"from-top"].includes(w.key);l==null||l({event:w,direction:g?-1:1})}})))}),Ok=M.forwardRef((n,e)=>{const{__scopeSlider:t,onSlideStart:r,onSlideMove:i,onSlideEnd:s,onHomeKeyDown:o,onEndKeyDown:a,onStepKeyDown:l,...u}=n,f=Gy(tm,t);return M.createElement(Dt.span,Ue({},u,{ref:e,onKeyDown:bt(n.onKeyDown,h=>{h.key==="Home"?(o(h),h.preventDefault()):h.key==="End"?(a(h),h.preventDefault()):Rk.concat(Pk).includes(h.key)&&(l(h),h.preventDefault())}),onPointerDown:bt(n.onPointerDown,h=>{const p=h.target;p.setPointerCapture(h.pointerId),h.preventDefault(),f.thumbs.has(p)?p.focus():r(h)}),onPointerMove:bt(n.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&i(h)}),onPointerUp:bt(n.onPointerUp,h=>{const p=h.target;p.hasPointerCapture(h.pointerId)&&(p.releasePointerCapture(h.pointerId),s(h))})}))}),dQ="SliderTrack",fQ=M.forwardRef((n,e)=>{const{__scopeSlider:t,...r}=n,i=Gy(dQ,t);return M.createElement(Dt.span,Ue({"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation},r,{ref:e}))}),aP="SliderRange",hQ=M.forwardRef((n,e)=>{const{__scopeSlider:t,...r}=n,i=Gy(aP,t),s=Nk(aP,t),o=M.useRef(null),a=Zt(e,o),l=i.values.length,u=i.values.map(p=>kk(p,i.min,i.max)),f=l>1?Math.min(...u):0,h=100-Math.max(...u);return M.createElement(Dt.span,Ue({"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0},r,{ref:a,style:{...n.style,[s.startEdge]:f+"%",[s.endEdge]:h+"%"}}))}),lP="SliderThumb",pQ=M.forwardRef((n,e)=>{const t=sQ(n.__scopeSlider),[r,i]=M.useState(null),s=Zt(e,a=>i(a)),o=M.useMemo(()=>r?t().findIndex(a=>a.ref.current===r):-1,[t,r]);return M.createElement(mQ,Ue({},n,{ref:s,index:o}))}),mQ=M.forwardRef((n,e)=>{const{__scopeSlider:t,index:r,...i}=n,s=Gy(lP,t),o=Nk(lP,t),[a,l]=M.useState(null),u=Zt(e,x=>l(x)),f=hb(a),h=s.values[r],p=h===void 0?0:kk(h,s.min,s.max),m=yQ(r,s.values.length),v=f==null?void 0:f[o.size],w=v?_Q(v,p,o.direction):0;return M.useEffect(()=>{if(a)return s.thumbs.add(a),()=>{s.thumbs.delete(a)}},[a,s.thumbs]),M.createElement("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${p}% + ${w}px)`}},M.createElement(Jw.ItemSlot,{scope:n.__scopeSlider},M.createElement(Dt.span,Ue({role:"slider","aria-label":n["aria-label"]||m,"aria-valuemin":s.min,"aria-valuenow":h,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0},i,{ref:u,style:h===void 0?{display:"none"}:n.style,onFocus:bt(n.onFocus,()=>{s.valueIndexToChangeRef.current=r})}))))}),gQ=n=>{const{value:e,...t}=n,r=M.useRef(null),i=fb(e);return M.useEffect(()=>{const s=r.current,o=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(o,"value").set;if(i!==e&&l){const u=new Event("input",{bubbles:!0});l.call(s,e),s.dispatchEvent(u)}},[i,e]),M.createElement("input",Ue({style:{display:"none"}},t,{ref:r,defaultValue:e}))};function vQ(n=[],e,t){const r=[...n];return r[t]=e,r.sort((i,s)=>i-s)}function kk(n,e,t){const s=100/(t-e)*(n-e);return vp(s,[0,100])}function yQ(n,e){return e>2?`Value ${n+1} of ${e}`:e===2?["Minimum","Maximum"][n]:void 0}function xQ(n,e){if(n.length===1)return 0;const t=n.map(i=>Math.abs(i-e)),r=Math.min(...t);return t.indexOf(r)}function _Q(n,e,t){const r=n/2,s=Cb([0,50],[0,r]);return(r-s(e)*t)*t}function SQ(n){return n.slice(0,-1).map((e,t)=>n[t+1]-e)}function wQ(n,e){if(e>0){const t=SQ(n);return Math.min(...t)>=e}return!0}function Cb(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(n[1]-n[0]);return e[0]+r*(t-n[0])}}function EQ(n){return(String(n).split(".")[1]||"").length}function MQ(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}const Uk=lQ,bQ=fQ,TQ=hQ,CQ=pQ,wr=M.forwardRef(({className:n,...e},t)=>N.jsxs(Uk,{ref:t,className:jt("relative flex w-full touch-none select-none items-center",n),...e,children:[N.jsx(bQ,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:N.jsx(TQ,{className:"absolute h-full bg-primary"})}),N.jsx(CQ,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));wr.displayName=Uk.displayName;const NS="rovingFocusGroup.onEntryFocus",AQ={bubbles:!1,cancelable:!0},Ab="RovingFocusGroup",[eE,Fk,RQ]=pb(Ab),[PQ,zk]=ta(Ab,[RQ]),[IQ,LQ]=PQ(Ab),DQ=M.forwardRef((n,e)=>M.createElement(eE.Provider,{scope:n.__scopeRovingFocusGroup},M.createElement(eE.Slot,{scope:n.__scopeRovingFocusGroup},M.createElement(NQ,Ue({},n,{ref:e}))))),NQ=M.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,...f}=n,h=M.useRef(null),p=Zt(e,h),m=Jp(s),[v=null,w]=Cc({prop:o,defaultProp:a,onChange:l}),[x,g]=M.useState(!1),S=Xn(u),_=Fk(t),b=M.useRef(!1),[A,R]=M.useState(0);return M.useEffect(()=>{const P=h.current;if(P)return P.addEventListener(NS,S),()=>P.removeEventListener(NS,S)},[S]),M.createElement(IQ,{scope:t,orientation:r,dir:m,loop:i,currentTabStopId:v,onItemFocus:M.useCallback(P=>w(P),[w]),onItemShiftTab:M.useCallback(()=>g(!0),[]),onFocusableItemAdd:M.useCallback(()=>R(P=>P+1),[]),onFocusableItemRemove:M.useCallback(()=>R(P=>P-1),[])},M.createElement(Dt.div,Ue({tabIndex:x||A===0?-1:0,"data-orientation":r},f,{ref:p,style:{outline:"none",...n.style},onMouseDown:bt(n.onMouseDown,()=>{b.current=!0}),onFocus:bt(n.onFocus,P=>{const D=!b.current;if(P.target===P.currentTarget&&D&&!x){const V=new CustomEvent(NS,AQ);if(P.currentTarget.dispatchEvent(V),!V.defaultPrevented){const C=_().filter(j=>j.focusable),L=C.find(j=>j.active),W=C.find(j=>j.id===v),z=[L,W,...C].filter(Boolean).map(j=>j.ref.current);Bk(z)}}b.current=!1}),onBlur:bt(n.onBlur,()=>g(!1))})))}),OQ="RovingFocusGroupItem",kQ=M.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,focusable:r=!0,active:i=!1,tabStopId:s,...o}=n,a=mc(),l=s||a,u=LQ(OQ,t),f=u.currentTabStopId===l,h=Fk(t),{onFocusableItemAdd:p,onFocusableItemRemove:m}=u;return M.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),M.createElement(eE.ItemSlot,{scope:t,id:l,focusable:r,active:i},M.createElement(Dt.span,Ue({tabIndex:f?0:-1,"data-orientation":u.orientation},o,{ref:e,onMouseDown:bt(n.onMouseDown,v=>{r?u.onItemFocus(l):v.preventDefault()}),onFocus:bt(n.onFocus,()=>u.onItemFocus(l)),onKeyDown:bt(n.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){u.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const w=zQ(v,u.orientation,u.dir);if(w!==void 0){v.preventDefault();let g=h().filter(S=>S.focusable).map(S=>S.ref.current);if(w==="last")g.reverse();else if(w==="prev"||w==="next"){w==="prev"&&g.reverse();const S=g.indexOf(v.currentTarget);g=u.loop?BQ(g,S+1):g.slice(S+1)}setTimeout(()=>Bk(g))}})})))}),UQ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function FQ(n,e){return e!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function zQ(n,e,t){const r=FQ(n.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return UQ[r]}function Bk(n){const e=document.activeElement;for(const t of n)if(t===e||(t.focus(),document.activeElement!==e))return}function BQ(n,e){return n.map((t,r)=>n[(e+r)%n.length])}const VQ=DQ,HQ=kQ,Vk="Tabs",[$Q,wee]=ta(Vk,[zk]),Hk=zk(),[WQ,Rb]=$Q(Vk),GQ=M.forwardRef((n,e)=>{const{__scopeTabs:t,value:r,onValueChange:i,defaultValue:s,orientation:o="horizontal",dir:a,activationMode:l="automatic",...u}=n,f=Jp(a),[h,p]=Cc({prop:r,onChange:i,defaultProp:s});return M.createElement(WQ,{scope:t,baseId:mc(),value:h,onValueChange:p,orientation:o,dir:f,activationMode:l},M.createElement(Dt.div,Ue({dir:f,"data-orientation":o},u,{ref:e})))}),jQ="TabsList",XQ=M.forwardRef((n,e)=>{const{__scopeTabs:t,loop:r=!0,...i}=n,s=Rb(jQ,t),o=Hk(t);return M.createElement(VQ,Ue({asChild:!0},o,{orientation:s.orientation,dir:s.dir,loop:r}),M.createElement(Dt.div,Ue({role:"tablist","aria-orientation":s.orientation},i,{ref:e})))}),qQ="TabsTrigger",YQ=M.forwardRef((n,e)=>{const{__scopeTabs:t,value:r,disabled:i=!1,...s}=n,o=Rb(qQ,t),a=Hk(t),l=$k(o.baseId,r),u=Wk(o.baseId,r),f=r===o.value;return M.createElement(HQ,Ue({asChild:!0},a,{focusable:!i,active:f}),M.createElement(Dt.button,Ue({type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l},s,{ref:e,onMouseDown:bt(n.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?o.onValueChange(r):h.preventDefault()}),onKeyDown:bt(n.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&o.onValueChange(r)}),onFocus:bt(n.onFocus,()=>{const h=o.activationMode!=="manual";!f&&!i&&h&&o.onValueChange(r)})})))}),ZQ="TabsContent",KQ=M.forwardRef((n,e)=>{const{__scopeTabs:t,value:r,forceMount:i,children:s,...o}=n,a=Rb(ZQ,t),l=$k(a.baseId,r),u=Wk(a.baseId,r),f=r===a.value,h=M.useRef(f);return M.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),M.createElement(ra,{present:i||f},({present:p})=>M.createElement(Dt.div,Ue({"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:u,tabIndex:0},o,{ref:e,style:{...n.style,animationDuration:h.current?"0s":void 0}}),p&&s))});function $k(n,e){return`${n}-trigger-${e}`}function Wk(n,e){return`${n}-content-${e}`}const QQ=GQ,Gk=XQ,jk=YQ,Xk=KQ,JQ=QQ,qk=M.forwardRef(({className:n,...e},t)=>N.jsx(Gk,{ref:t,className:jt("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",n),...e}));qk.displayName=Gk.displayName;const tE=M.forwardRef(({className:n,...e},t)=>N.jsx(jk,{ref:t,className:jt("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",n),...e}));tE.displayName=jk.displayName;const nE=M.forwardRef(({className:n,...e},t)=>N.jsx(Xk,{ref:t,className:jt("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n),...e}));nE.displayName=Xk.displayName;const eJ=M.forwardRef((n,e)=>M.createElement(Dt.label,Ue({},n,{ref:e,onMouseDown:t=>{var r;(r=n.onMouseDown)===null||r===void 0||r.call(n,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault()}}))),Yk=eJ,tJ=bb("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Oi=M.forwardRef(({className:n,...e},t)=>N.jsx(Yk,{ref:t,className:jt(tJ(),n),...e}));Oi.displayName=Yk.displayName;const nJ=()=>N.jsx(Oi,{children:"Not supported at this time."}),Pb=M.createContext(null),rJ=({initial:n=void 0,children:e})=>{const[t,r]=M.useState(n==null?void 0:n.query);return N.jsx(Pb.Provider,{value:{filters:{query:t},setters:{setQuery:r}},children:e})};function iJ(){const n=M.useContext(Pb);if(!n)throw new Error("useSearchFiltersContext must be used within a SearchFiltersContextProvider");return n.filters}function sJ(){const n=M.useContext(Pb);if(!n)throw new Error("useSearchFiltersContextSetters must be used within a SearchFiltersContextProvider");return n.setters}const oJ=(n,e=500)=>{const[t,r]=M.useState(n);return M.useEffect(()=>{const i=setTimeout(()=>r(n),e||500);return()=>{clearTimeout(i)}},[n,e]),t},aJ=({placeholder:n="Search...",...e})=>{const[t,r]=M.useState(""),i=oJ(t,500),{setQuery:s}=sJ();return M.useEffect(()=>{s(i)},[i,s]),N.jsxs("div",{className:"flex flex-row items-center justify-start gap-2 rounded-[6px] border-[#4E4E4E] bg-background px-2",children:[N.jsx(BW,{}),N.jsx("input",{id:"search-filter-input",type:"search",placeholder:n,onChange:o=>{r(o.target.value)},className:jt("search-cancel:appearance-none search-cancel:cursor-pointer flex-grow bg-transparent text-sm text-foreground outline-none placeholder:text-xs placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e.className)})]})};function lJ(n,e){return M.useReducer((t,r)=>{const i=e[t][r];return i??t},n)}const Zk="ScrollArea",[Kk,Eee]=ta(Zk),[cJ,fs]=Kk(Zk),uJ=M.forwardRef((n,e)=>{const{__scopeScrollArea:t,type:r="hover",dir:i,scrollHideDelay:s=600,...o}=n,[a,l]=M.useState(null),[u,f]=M.useState(null),[h,p]=M.useState(null),[m,v]=M.useState(null),[w,x]=M.useState(null),[g,S]=M.useState(0),[_,b]=M.useState(0),[A,R]=M.useState(!1),[P,D]=M.useState(!1),V=Zt(e,L=>l(L)),C=Jp(i);return M.createElement(cJ,{scope:t,type:r,dir:C,scrollHideDelay:s,scrollArea:a,viewport:u,onViewportChange:f,content:h,onContentChange:p,scrollbarX:m,onScrollbarXChange:v,scrollbarXEnabled:A,onScrollbarXEnabledChange:R,scrollbarY:w,onScrollbarYChange:x,scrollbarYEnabled:P,onScrollbarYEnabledChange:D,onCornerWidthChange:S,onCornerHeightChange:b},M.createElement(Dt.div,Ue({dir:C},o,{ref:V,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":_+"px",...n.style}})))}),dJ="ScrollAreaViewport",fJ=M.forwardRef((n,e)=>{const{__scopeScrollArea:t,children:r,...i}=n,s=fs(dJ,t),o=M.useRef(null),a=Zt(e,o,s.onViewportChange);return M.createElement(M.Fragment,null,M.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),M.createElement(Dt.div,Ue({"data-radix-scroll-area-viewport":""},i,{ref:a,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...n.style}}),M.createElement("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),ia="ScrollAreaScrollbar",Qk=M.forwardRef((n,e)=>{const{forceMount:t,...r}=n,i=fs(ia,n.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:o}=i,a=n.orientation==="horizontal";return M.useEffect(()=>(a?s(!0):o(!0),()=>{a?s(!1):o(!1)}),[a,s,o]),i.type==="hover"?M.createElement(hJ,Ue({},r,{ref:e,forceMount:t})):i.type==="scroll"?M.createElement(pJ,Ue({},r,{ref:e,forceMount:t})):i.type==="auto"?M.createElement(Jk,Ue({},r,{ref:e,forceMount:t})):i.type==="always"?M.createElement(Ib,Ue({},r,{ref:e})):null}),hJ=M.forwardRef((n,e)=>{const{forceMount:t,...r}=n,i=fs(ia,n.__scopeScrollArea),[s,o]=M.useState(!1);return M.useEffect(()=>{const a=i.scrollArea;let l=0;if(a){const u=()=>{window.clearTimeout(l),o(!0)},f=()=>{l=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",f),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",f)}}},[i.scrollArea,i.scrollHideDelay]),M.createElement(ra,{present:t||s},M.createElement(Jk,Ue({"data-state":s?"visible":"hidden"},r,{ref:e})))}),pJ=M.forwardRef((n,e)=>{const{forceMount:t,...r}=n,i=fs(ia,n.__scopeScrollArea),s=n.orientation==="horizontal",o=Xy(()=>l("SCROLL_END"),100),[a,l]=lJ("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return M.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>l("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,i.scrollHideDelay,l]),M.useEffect(()=>{const u=i.viewport,f=s?"scrollLeft":"scrollTop";if(u){let h=u[f];const p=()=>{const m=u[f];h!==m&&(l("SCROLL"),o()),h=m};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[i.viewport,s,l,o]),M.createElement(ra,{present:t||a!=="hidden"},M.createElement(Ib,Ue({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:e,onPointerEnter:bt(n.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:bt(n.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),Jk=M.forwardRef((n,e)=>{const t=fs(ia,n.__scopeScrollArea),{forceMount:r,...i}=n,[s,o]=M.useState(!1),a=n.orientation==="horizontal",l=Xy(()=>{if(t.viewport){const u=t.viewport.offsetWidth{const{orientation:t="vertical",...r}=n,i=fs(ia,n.__scopeScrollArea),s=M.useRef(null),o=M.useRef(0),[a,l]=M.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=rU(a.viewport,a.content),f={...r,sizes:a,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:p=>s.current=p,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:p=>o.current=p};function h(p,m){return wJ(p,o.current,a,m)}return t==="horizontal"?M.createElement(mJ,Ue({},f,{ref:e,onThumbPositionChange:()=>{if(i.viewport&&s.current){const p=i.viewport.scrollLeft,m=cP(p,a,i.dir);s.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollLeft=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollLeft=h(p,i.dir))}})):t==="vertical"?M.createElement(gJ,Ue({},f,{ref:e,onThumbPositionChange:()=>{if(i.viewport&&s.current){const p=i.viewport.scrollTop,m=cP(p,a);s.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollTop=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollTop=h(p))}})):null}),mJ=M.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...i}=n,s=fs(ia,n.__scopeScrollArea),[o,a]=M.useState(),l=M.useRef(null),u=Zt(e,l,s.onScrollbarXChange);return M.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),M.createElement(tU,Ue({"data-orientation":"horizontal"},i,{ref:u,sizes:t,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":jy(t)+"px",...n.style},onThumbPointerDown:f=>n.onThumbPointerDown(f.x),onDragScroll:f=>n.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(s.viewport){const p=s.viewport.scrollLeft+f.deltaX;n.onWheelScroll(p),sU(p,h)&&f.preventDefault()}},onResize:()=>{l.current&&s.viewport&&o&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:$0(o.paddingLeft),paddingEnd:$0(o.paddingRight)}})}}))}),gJ=M.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...i}=n,s=fs(ia,n.__scopeScrollArea),[o,a]=M.useState(),l=M.useRef(null),u=Zt(e,l,s.onScrollbarYChange);return M.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),M.createElement(tU,Ue({"data-orientation":"vertical"},i,{ref:u,sizes:t,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":jy(t)+"px",...n.style},onThumbPointerDown:f=>n.onThumbPointerDown(f.y),onDragScroll:f=>n.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(s.viewport){const p=s.viewport.scrollTop+f.deltaY;n.onWheelScroll(p),sU(p,h)&&f.preventDefault()}},onResize:()=>{l.current&&s.viewport&&o&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:$0(o.paddingTop),paddingEnd:$0(o.paddingBottom)}})}}))}),[vJ,eU]=Kk(ia),tU=M.forwardRef((n,e)=>{const{__scopeScrollArea:t,sizes:r,hasThumb:i,onThumbChange:s,onThumbPointerUp:o,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:f,onResize:h,...p}=n,m=fs(ia,t),[v,w]=M.useState(null),x=Zt(e,V=>w(V)),g=M.useRef(null),S=M.useRef(""),_=m.viewport,b=r.content-r.viewport,A=Xn(f),R=Xn(l),P=Xy(h,10);function D(V){if(g.current){const C=V.clientX-g.current.left,L=V.clientY-g.current.top;u({x:C,y:L})}}return M.useEffect(()=>{const V=C=>{const L=C.target;(v==null?void 0:v.contains(L))&&A(C,b)};return document.addEventListener("wheel",V,{passive:!1}),()=>document.removeEventListener("wheel",V,{passive:!1})},[_,v,b,A]),M.useEffect(R,[r,R]),Bd(v,P),Bd(m.content,P),M.createElement(vJ,{scope:t,scrollbar:v,hasThumb:i,onThumbChange:Xn(s),onThumbPointerUp:Xn(o),onThumbPositionChange:R,onThumbPointerDown:Xn(a)},M.createElement(Dt.div,Ue({},p,{ref:x,style:{position:"absolute",...p.style},onPointerDown:bt(n.onPointerDown,V=>{V.button===0&&(V.target.setPointerCapture(V.pointerId),g.current=v.getBoundingClientRect(),S.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),D(V))}),onPointerMove:bt(n.onPointerMove,D),onPointerUp:bt(n.onPointerUp,V=>{const C=V.target;C.hasPointerCapture(V.pointerId)&&C.releasePointerCapture(V.pointerId),document.body.style.webkitUserSelect=S.current,m.viewport&&(m.viewport.style.scrollBehavior=""),g.current=null})})))}),rE="ScrollAreaThumb",yJ=M.forwardRef((n,e)=>{const{forceMount:t,...r}=n,i=eU(rE,n.__scopeScrollArea);return M.createElement(ra,{present:t||i.hasThumb},M.createElement(xJ,Ue({ref:e},r)))}),xJ=M.forwardRef((n,e)=>{const{__scopeScrollArea:t,style:r,...i}=n,s=fs(rE,t),o=eU(rE,t),{onThumbPositionChange:a}=o,l=Zt(e,h=>o.onThumbChange(h)),u=M.useRef(),f=Xy(()=>{u.current&&(u.current(),u.current=void 0)},100);return M.useEffect(()=>{const h=s.viewport;if(h){const p=()=>{if(f(),!u.current){const m=EJ(h,a);u.current=m,a()}};return a(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[s.viewport,f,a]),M.createElement(Dt.div,Ue({"data-state":o.hasThumb?"visible":"hidden"},i,{ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:bt(n.onPointerDownCapture,h=>{const m=h.target.getBoundingClientRect(),v=h.clientX-m.left,w=h.clientY-m.top;o.onThumbPointerDown({x:v,y:w})}),onPointerUp:bt(n.onPointerUp,o.onThumbPointerUp)}))}),nU="ScrollAreaCorner",_J=M.forwardRef((n,e)=>{const t=fs(nU,n.__scopeScrollArea),r=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&r?M.createElement(SJ,Ue({},n,{ref:e})):null}),SJ=M.forwardRef((n,e)=>{const{__scopeScrollArea:t,...r}=n,i=fs(nU,t),[s,o]=M.useState(0),[a,l]=M.useState(0),u=!!(s&&a);return Bd(i.scrollbarX,()=>{var f;const h=((f=i.scrollbarX)===null||f===void 0?void 0:f.offsetHeight)||0;i.onCornerHeightChange(h),l(h)}),Bd(i.scrollbarY,()=>{var f;const h=((f=i.scrollbarY)===null||f===void 0?void 0:f.offsetWidth)||0;i.onCornerWidthChange(h),o(h)}),u?M.createElement(Dt.div,Ue({},r,{ref:e,style:{width:s,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...n.style}})):null});function $0(n){return n?parseInt(n,10):0}function rU(n,e){const t=n/e;return isNaN(t)?0:t}function jy(n){const e=rU(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,r=(n.scrollbar.size-t)*e;return Math.max(r,18)}function wJ(n,e,t,r="ltr"){const i=jy(t),s=i/2,o=e||s,a=i-o,l=t.scrollbar.paddingStart+o,u=t.scrollbar.size-t.scrollbar.paddingEnd-a,f=t.content-t.viewport,h=r==="ltr"?[0,f]:[f*-1,0];return iU([l,u],h)(n)}function cP(n,e,t="ltr"){const r=jy(e),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-i,o=e.content-e.viewport,a=s-r,l=t==="ltr"?[0,o]:[o*-1,0],u=vp(n,l);return iU([0,o],[0,a])(u)}function iU(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(n[1]-n[0]);return e[0]+r*(t-n[0])}}function sU(n,e){return n>0&&n{})=>{let t={left:n.scrollLeft,top:n.scrollTop},r=0;return function i(){const s={left:n.scrollLeft,top:n.scrollTop},o=t.left!==s.left,a=t.top!==s.top;(o||a)&&e(),t=s,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Xy(n,e){const t=Xn(n),r=M.useRef(0);return M.useEffect(()=>()=>window.clearTimeout(r.current),[]),M.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(t,e)},[t,e])}function Bd(n,e){const t=Xn(e);us(()=>{let r=0;if(n){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(t)});return i.observe(n),()=>{window.cancelAnimationFrame(r),i.unobserve(n)}}},[n,t])}const oU=uJ,MJ=fJ,bJ=_J,aU=M.forwardRef(({className:n,children:e,...t},r)=>N.jsxs(oU,{ref:r,className:jt("relative overflow-hidden",n),...t,children:[N.jsx(MJ,{className:"h-full w-full rounded-[inherit]",children:e}),N.jsx(lU,{}),N.jsx(bJ,{})]}));aU.displayName=oU.displayName;const lU=M.forwardRef(({className:n,orientation:e="vertical",...t},r)=>N.jsx(Qk,{ref:r,orientation:e,className:jt("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 border-t border-t-transparent p-[1px]",n),...t,children:N.jsx(yJ,{className:"relative flex-1 rounded-full bg-border"})}));lU.displayName=Qk.displayName;const TJ=({track:n,className:e,...t})=>N.jsxs("div",{className:jt("flex flex-row items-center justify-start gap-2 hover:scale-110",e),...t,children:[n.artwork_url?N.jsx("img",{src:n.artwork_url,className:"h-8 w-8 rounded-lg",alt:"Artwork"}):N.jsx(EL,{}),N.jsxs("div",{className:"flex flex-col items-start justify-center gap-1",children:[N.jsx("span",{className:"truncate text-xs text-foreground",children:n.title}),N.jsxs("span",{className:"truncate text-xs text-foreground/50",children:["playcount: ",n.playback_count]})]})]}),CJ=({tracks:n,onTrackSelected:e,className:t,...r})=>N.jsx(aU,{className:jt("no-scrollbar flex flex-col items-start justify-start gap-2",t),...r,children:n.map(i=>N.jsx(TJ,{track:i,onClick:()=>{e(i)}},i.id))}),AJ=({userId:n,limit:e=10,...t})=>{const{data:r}=nM({queryKey:["soundcloud-user-track-search",n],queryFn:async()=>await l7({userId:n,limit:e})});return N.jsx(CJ,{tracks:r,...t})},RJ=({user:n,className:e,...t})=>N.jsxs("div",{className:jt("flex w-12 flex-col items-center justify-start gap-1 hover:border hover:border-white aria-selected:animate-pulse aria-selected:border aria-selected:border-white",e),...t,children:[n.avatar_url?N.jsx("img",{src:n.avatar_url,className:"aspect-square w-full rounded-full",alt:"User avatar"}):N.jsx(EL,{}),N.jsx("span",{className:"w-full truncate text-xs text-foreground",children:n.username})]}),PJ=({users:n,selectedUserId:e=void 0,onUserSelected:t,className:r,...i})=>N.jsx("div",{className:jt("no-scrollbar flex w-full cursor-pointer flex-row items-center justify-start gap-2 overflow-x-scroll",r),...i,children:n==null?void 0:n.map(s=>N.jsx(RJ,{"aria-selected":e===s.id,user:s,onClick:()=>{t(s)}},s.id))}),IJ=({query:n})=>{const{data:e}=nM({queryKey:["soundcloud-user-search",n],queryFn:async()=>await a7({query:n,limit:20})}),[t,r]=M.useState(null),{setTrack:i}=s$();return N.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[N.jsx(PJ,{users:e.filter(s=>(s.track_count??0)>0),onUserSelected:r,selectedUserId:t==null?void 0:t.id}),t&&N.jsx(AJ,{userId:t.id,onTrackSelected:i})]})},LJ=()=>{const{query:n}=iJ();return n?N.jsx(M.Suspense,{fallback:N.jsx("span",{className:"text-foreground",children:"Searching..."}),children:N.jsx(IJ,{query:n})}):N.jsx("span",{className:"text-foreground",children:"No results..."})},DJ=()=>N.jsxs(rJ,{children:[N.jsx(aJ,{placeholder:"Search Soundcloud users..."}),N.jsx(LJ,{})]}),NJ=()=>N.jsx(DJ,{}),zr=({label:n,value:e,className:t,...r})=>N.jsxs("div",{className:jt("flex w-full items-center justify-between",t),...r,children:[N.jsx(Oi,{children:n}),N.jsx("span",{className:"w-12 px-2 py-0.5 text-right text-sm text-muted-foreground",children:e})]}),OJ=({audioSource:n,...e})=>{switch(n){case Jn.SOUNDCLOUD:return N.jsx(ML,{...e});case Jn.MICROPHONE:return N.jsx(NW,{...e});case Jn.SCREEN_SHARE:return N.jsx(zW,{...e});case Jn.FILE_UPLOAD:return N.jsx(PW,{...e});default:return n}},kJ=({className:n,...e})=>N.jsx("div",{className:jt("grid aspect-square w-full flex-none grow cursor-pointer place-content-center rounded-sm bg-gradient-to-b from-slate-700 to-black text-white shadow-inner duration-300 ease-in-out hover:scale-110 hover:from-slate-500 hover:to-slate-900 aria-selected:from-slate-100 aria-selected:to-slate-500 aria-selected:text-black",n),...e}),cU=({className:n,...e})=>{const{audioSource:t}=iM(),{setAudioSource:r}=ZW(),i=M.useMemo(()=>ZI(),[]);return N.jsx("div",{className:jt("grid w-full grid-cols-6 justify-items-stretch gap-2 sm:grid-cols-8",n),...e,children:i.map(s=>N.jsx(kJ,{onClick:()=>r(s),"aria-selected":t===s,children:N.jsx(OJ,{audioSource:s})},`grid_icon_${s}`))})},uU=()=>{const{audioSource:n}=iM();switch(n){case Jn.SOUNDCLOUD:return N.jsx(NJ,{});case Jn.FILE_UPLOAD:return N.jsx(nJ,{});case Jn.MICROPHONE:case Jn.SCREEN_SHARE:return null;default:return n}},UJ=()=>{const{amplitude:n,octaveBandMode:e,energyMeasure:t}=cE(),{setAmplitude:r,setOctaveBand:i,setEnergyMeasure:s}=CF();return N.jsxs("div",{className:"w-full space-y-4",children:[N.jsx(zr,{label:"Amplitude",value:n.toFixed(2)}),N.jsx(wr,{defaultValue:[n],value:[n],min:0,max:5,step:.01,onValueChange:o=>r(o[0])}),N.jsxs("div",{className:"flex w-full items-center justify-between",children:[N.jsx("span",{children:"Octave Band Mode"}),N.jsxs(qw,{onValueChange:o=>{i(Number(o))},children:[N.jsx(B0,{className:"max-w-1/2 w-[240px]",children:N.jsx(Yw,{placeholder:i2[e],defaultValue:e,className:"w-full"})}),N.jsx(V0,{className:"max-h-36",children:Object.entries(i2).map(o=>N.jsx(H0,{value:o[0],"aria-selected":o[0]===e.toString(),children:o[1]},o[1]))})]})]}),N.jsxs("div",{className:"flex w-full items-center justify-between",children:[N.jsx("span",{children:"Energy Measure"}),N.jsxs(qw,{onValueChange:o=>{s(o)},children:[N.jsx(B0,{className:"max-w-1/2 w-[240px]",children:N.jsx(Yw,{placeholder:t,defaultValue:t,className:"w-full"})}),N.jsx(V0,{className:"max-h-36",children:QW.map(o=>N.jsx(H0,{value:o,"aria-selected":o===t,children:o},o))})]})]})]})},FJ=()=>N.jsxs(JQ,{defaultValue:"source",className:"w-full",children:[N.jsxs(qk,{className:"w-full",children:[N.jsx(tE,{value:"source",className:"grow",children:"Audio Source"}),N.jsx(tE,{value:"analyzer",className:"grow",children:"Audio Analyzer"})]}),N.jsxs(nE,{value:"source",className:"space-y-4 p-4",children:[N.jsx(cU,{}),N.jsx(uU,{})]}),N.jsx(nE,{value:"analyzer",children:N.jsx(UJ,{})})]}),zJ=()=>N.jsxs("div",{className:"space-y-4 p-4",children:[N.jsx(cU,{}),N.jsx(uU,{})]}),BJ=()=>{const{amplitude:n,spatialScale:e,timeScale:t,nIterations:r}=oD(),{setAmplitude:i,setSpatialScale:s,setTimeScale:o,setNIterations:a,reset:l}=w9();return N.jsxs("div",{className:"flex w-full flex-col items-start justify-start gap-4",children:[N.jsxs("div",{className:"flex w-full items-center justify-between",children:[N.jsx("span",{children:"Noise"}),N.jsx(bL,{className:"pointer-events-auto cursor-pointer",onClick:()=>l()})]}),N.jsx(zr,{label:"Amplitude",value:n.toFixed(2)}),N.jsx(wr,{defaultValue:[n],value:[n],min:0,max:5,step:.01,onValueChange:u=>i(u[0])}),N.jsx(zr,{label:"Spatial Scale",value:e.toFixed(2)}),N.jsx(wr,{defaultValue:[e],value:[e],min:.1,max:5,step:.1,onValueChange:u=>s(u[0])}),N.jsx(zr,{label:"Time Scale",value:t.toFixed(2)}),N.jsx(wr,{defaultValue:[t],value:[t],min:.01,max:2,step:.01,onValueChange:u=>o(u[0])}),N.jsx(zr,{label:"Iteration Count",value:r}),N.jsx(wr,{defaultValue:[r],value:[r],min:1,max:16,step:1,onValueChange:u=>a(u[0])})]})},VJ=()=>{const{maxAmplitude:n,waveformFrequenciesHz:e}=PL(),{setMaxAmplitude:t,setWaveformFrequenciesHz:r,reset:i}=IL();return N.jsxs("div",{className:"flex w-full flex-col items-start justify-start gap-4",children:[N.jsxs("div",{className:"flex w-full items-center justify-between",children:[N.jsx("span",{children:"Wave Form"}),N.jsx(bL,{className:"pointer-events-auto cursor-pointer",onClick:()=>i()})]}),N.jsxs("div",{className:"flex w-full items-center justify-between",children:[N.jsx(Oi,{children:"Double"}),N.jsx(Ja,{defaultChecked:e.length>1,onCheckedChange:s=>{r(s?[2,10]:[2])}})]}),N.jsx(zr,{label:"Max Amplitude",value:n.toFixed(2)}),N.jsx(wr,{defaultValue:[n],min:0,max:5,step:.01,onValueChange:s=>t(s[0])}),[...e].map((s,o)=>N.jsxs("div",{className:"w-full space-y-4",children:[N.jsx(zr,{label:`Wave #${o+1} - Freq (hz)`,value:s.toFixed(2)}),N.jsx(wr,{defaultValue:[s],value:[s],min:2,max:o==0?10:30,step:.05,onValueChange:a=>r(l=>l.map((u,f)=>o==f?a[0]:u))},`slider_waveform_frequency_${o}`)]},`label_waveform_frequency_${o}`))]})},HJ=({mode:n})=>{switch(n){case"WAVE_FORM":return N.jsx(wW,{});case"NOISE":return N.jsx($W,{});case"AUDIO":return N.jsx(ML,{});case"AUDIO_SCOPE":return N.jsx(HW,{});case"PARTICLE_NOISE":return N.jsx(RW,{});default:return N.jsx(DW,{})}},uP=({mode:n})=>N.jsxs("div",{className:"flex w-full items-center justify-start gap-2",children:[N.jsx("div",{className:"w-4",children:JH(n)&&"🎧"}),N.jsx(HJ,{mode:n}),n]}),$J=()=>{const{mode:n}=Nc(),{setMode:e}=JI(),t=M.useMemo(()=>e$(),[]);return N.jsxs(qw,{onValueChange:r=>{e(r)},children:[N.jsx(B0,{children:N.jsx(Yw,{placeholder:N.jsx(uP,{mode:n}),defaultValue:n,className:"w-full"})}),N.jsx(V0,{children:t.map(r=>N.jsx(H0,{value:r,"aria-selected":r===n,children:N.jsx(uP,{mode:r})},`select_item_${r}`))})]})},WJ=({children:n})=>{const[e,t]=M.useState(!1),{mode:r}=Nc();return N.jsxs(Tk,{open:e,onOpenChange:t,children:[N.jsx(Ck,{asChild:!0,children:n}),N.jsxs(Tb,{side:"right",className:"no-scrollbar w-full max-w-full space-y-4 overflow-scroll bg-background/70 p-4 pt-16 sm:w-[540px] sm:max-w-[540px]",children:[N.jsxs("div",{className:"flex items-center justify-start gap-4",children:[N.jsx("span",{className:"text-xl font-bold",children:"MODE"}),N.jsx($J,{})]}),N.jsx(Eb,{}),r===Rt.WAVE_FORM&&N.jsx(VJ,{}),r===Rt.NOISE&&N.jsx(BJ,{}),r===Rt.AUDIO&&N.jsx(FJ,{}),r===Rt.AUDIO_SCOPE&&N.jsx(zJ,{})]})]})},GJ=bb("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),nm=M.forwardRef(({className:n,variant:e,size:t,asChild:r=!1,...i},s)=>{const o=r?Ac:"button";return N.jsx(o,{className:jt(GJ({variant:e,size:t,className:n})),ref:s,...i})});nm.displayName="Button";const OS=[{name:"default",nPerSide:10,unitSpacingScalar:.1,volume:!0},{name:"custom"}],jJ=()=>{const{nPerSide:n,unitSpacingScalar:e,volume:t}=sG(),{setNPerSide:r,setUnitSpacingScalar:i,setVolume:s}=oG(),[o,a]=M.useState(OS.find(l=>l.name!=="custom"&&l.nPerSide===n&&l.volume===t&&l.unitSpacingScalar===e)??OS[0]);return M.useEffect(()=>{o.name!=="custom"&&(r(o.nPerSide),i(o.unitSpacingScalar),s(o.volume))},[o,r,i,s]),N.jsxs("div",{className:"flex w-full flex-col items-start justify-start gap-4",children:[N.jsx(Oi,{children:"Cube Presets"}),N.jsx("div",{className:"flex w-full items-center justify-start gap-2",children:OS.map(l=>N.jsx(nm,{variant:"ghost","aria-selected":l===o,className:"p-2 aria-selected:bg-primary/20",onClick:()=>a(l),children:l.name},`cube_preset_${l.name}`))}),o.name==="custom"&&N.jsxs(N.Fragment,{children:[N.jsx(zr,{label:"N x Per Side",value:n}),N.jsx(wr,{defaultValue:[n],value:[n],min:3,max:20,step:1,onValueChange:l=>r(l[0])}),N.jsx(zr,{label:"Cube Spacing",value:e.toFixed(2)}),N.jsx(wr,{defaultValue:[e],value:[e],min:0,max:.5,step:.1,onValueChange:l=>i(l[0])}),N.jsxs("div",{className:"flex w-full items-center justify-between",children:[N.jsx(Oi,{children:"Volume"}),N.jsx(Ja,{defaultChecked:t,onCheckedChange:l=>{s(l)}})]})]})]})},kS=[{name:"default",radius:2,pointSize:.2,mirrorEffects:!1},{name:"custom"}],XJ=()=>{const{radius:n,pointSize:e,mirrorEffects:t}=lG(),{setRadius:r,setPointSize:i,setMirrorEffects:s}=cG(),[o,a]=M.useState(kS.find(l=>l.name!=="custom"&&l.pointSize===e&&l.radius===n&&l.mirrorEffects===t)??kS[0]);return M.useEffect(()=>{o.name!=="custom"&&(r(o.radius),i(o.pointSize),s(o.mirrorEffects))},[o,r,i,s]),N.jsxs("div",{className:"flex w-full flex-col items-start justify-start gap-4",children:[N.jsx(Oi,{children:"Diffused Ring Presets"}),N.jsx("div",{className:"flex w-full items-center justify-start gap-2",children:kS.map(l=>N.jsx(nm,{variant:"ghost","aria-selected":l===o,className:"p-2 aria-selected:bg-primary/20",onClick:()=>a(l),children:l.name},`sphere_preset_${l.name}`))}),o.name==="custom"&&N.jsxs(N.Fragment,{children:[N.jsx(zr,{label:"Radius",value:n.toFixed(2)}),N.jsx(wr,{defaultValue:[n],value:[n],min:.25,max:3,step:.25,onValueChange:l=>r(l[0])}),N.jsx(zr,{label:"Point Size",value:e.toFixed(2)}),N.jsx(wr,{defaultValue:[e],value:[e],min:.01,max:.25,step:.01,onValueChange:l=>i(l[0])}),N.jsxs("div",{className:"flex w-full items-center justify-between",children:[N.jsx(Oi,{children:"Mirror Effects"}),N.jsx(Ja,{defaultChecked:t,onCheckedChange:l=>{s(l)}})]})]})]})},US=[{name:"default",nRows:100,nCols:100,unitSpacingScalar:5},{name:"bands",nRows:5,nCols:200,unitSpacingScalar:1},{name:"custom"}],qJ=()=>{const{nCols:n,nRows:e,unitSpacingScalar:t}=fG(),{setNCols:r,setNRows:i,setUnitSpacingScalar:s}=hG(),[o,a]=M.useState(US.find(l=>l.name!=="custom"&&l.nRows===e&&l.nCols===n&&l.unitSpacingScalar===t)??US[0]);return M.useEffect(()=>{o.name!=="custom"&&(i(o.nRows),r(o.nCols),s(o.unitSpacingScalar))},[o,r,i,s]),N.jsxs("div",{className:"flex w-full flex-col items-start justify-start gap-4",children:[N.jsx(Oi,{children:"Grid Presets"}),N.jsx("div",{className:"flex w-full items-center justify-start gap-2",children:US.map(l=>N.jsx(nm,{variant:"ghost","aria-selected":l===o,className:"p-2 aria-selected:bg-primary/20",onClick:()=>a(l),children:l.name},`grid_preset_${l.name}`))}),o.name==="custom"&&N.jsxs(N.Fragment,{children:[N.jsx(zr,{label:"N x Rows",value:e}),N.jsx(wr,{defaultValue:[e],value:[e],min:5,max:200,step:5,onValueChange:l=>i(l[0])}),N.jsx(zr,{label:"N x Cols",value:n}),N.jsx(wr,{defaultValue:[n],value:[n],min:5,max:200,step:5,onValueChange:l=>r(l[0])}),N.jsx(zr,{label:"Grid Spacing",value:t.toFixed(2)}),N.jsx(wr,{defaultValue:[t],value:[t],min:1,max:6,step:.5,onValueChange:l=>s(l[0])})]})]})},FS=[{name:"default",radius:2,nPoints:800},{name:"custom"}],YJ=()=>{const{radius:n,nPoints:e}=vG(),{setRadius:t,setNPoints:r}=yG(),[i,s]=M.useState(FS.find(o=>o.name!=="custom"&&o.nPoints===e&&o.radius===n)??FS[0]);return M.useEffect(()=>{i.name!=="custom"&&(t(i.radius),r(i.nPoints))},[i,t,r]),N.jsxs("div",{className:"flex w-full flex-col items-start justify-start gap-4",children:[N.jsx(Oi,{children:"Sphere Presets"}),N.jsx("div",{className:"flex w-full items-center justify-start gap-2",children:FS.map(o=>N.jsx(nm,{variant:"ghost","aria-selected":o===i,className:"p-2 aria-selected:bg-primary/20",onClick:()=>s(o),children:o.name},`sphere_preset_${o.name}`))}),i.name==="custom"&&N.jsxs(N.Fragment,{children:[N.jsx(zr,{label:"Point Count",value:e}),N.jsx(wr,{defaultValue:[e],value:[e],min:100,max:2e3,step:25,onValueChange:o=>r(o[0])}),N.jsx(zr,{label:"Radius",value:n.toFixed(2)}),N.jsx(wr,{defaultValue:[n],value:[n],min:.25,max:3,step:.25,onValueChange:o=>t(o[0])})]})]})},ZJ=({palette:n,className:e,...t})=>{const r=Wn.getPalette(n);return N.jsx("div",{className:jt("h-8 w-full rounded-sm",e),style:{background:`linear-gradient(0.25turn, ${r.colors.join(",")})`},...t})},KJ=({palette:n,className:e,...t})=>{const r=Wn.getPalette(n);return N.jsx("div",{className:jt("aspect-square cursor-pointer rounded-full transition-all duration-200 ease-in-out hover:ring-2 hover:ring-primary aria-selected:animate-pulse aria-selected:ring-2 aria-selected:ring-primary",e),style:{background:`linear-gradient(45deg, ${r.colors.join(",")})`},...t})},QJ=()=>{const{visual:n}=kc();switch(n){case"cube":return jJ();case"grid":return qJ();case"sphere":return YJ();case"diffusedRing":return XJ();case"ribbons":case"dna":case"boxes":return null;default:return n}},JJ=({children:n})=>{const[e,t]=M.useState(!1),{mode:r}=Nc(),{colorBackground:i,paletteTrackEnergy:s}=kc(),{setColorBackground:o,setPaletteTrackEnergy:a}=dM(),l=XE(),{setPalette:u}=Yd(),{autoOrbitAfterSleepMs:f}=pO(),{setMode:h,setAutoOrbitAfterSleepMs:p}=mO();return N.jsxs(Tk,{open:e,onOpenChange:t,children:[N.jsx(Ck,{asChild:!0,children:n}),N.jsx(Tb,{side:"right",className:"no-scrollbar w-full max-w-full overflow-scroll bg-background/70 sm:w-[540px] sm:max-w-[540px]",children:N.jsxs("div",{className:"space-y-4",children:[N.jsxs("div",{className:"space-y-4",children:[N.jsxs("div",{className:"space-y-2",children:[N.jsx("div",{className:"",children:"Palette"}),N.jsx(ZJ,{palette:l}),N.jsx("div",{className:"grid w-full grid-cols-4 justify-items-stretch gap-2 sm:grid-cols-6",children:oh.map(m=>N.jsx(KJ,{palette:m,onClick:()=>u(m),"aria-selected":m===l},m))})]}),N.jsxs("div",{className:"flex items-center justify-between gap-2",children:[N.jsx(Oi,{children:"Color Background"}),N.jsx(Ja,{defaultChecked:i,onCheckedChange:m=>{o(m)}})]}),N.jsxs("div",{className:"flex items-center justify-between gap-2",children:[N.jsx(Oi,{children:"Colors Follow Music"}),N.jsx(Ja,{disabled:r!==Rt.AUDIO,defaultChecked:s,onCheckedChange:m=>{a(m)}})]}),N.jsxs("div",{className:"flex items-center justify-between gap-2",children:[N.jsx(Oi,{children:"Auto Orbit Camera"}),N.jsx(Ja,{disabled:!t$(r),defaultChecked:f>0,onCheckedChange:m=>{h(m?Lo.AUTO_ORBIT:Lo.ORBIT_CONTROLS),p(m?3500:0)}})]})]}),N.jsx(Eb,{}),N.jsx("div",{className:"space-y-4",children:N.jsx(QJ,{})})]})})]})},eee=({className:n,...e})=>N.jsx(vO,{...e,className:jt("max-h-4/5 w-fit sm:h-fit",n),children:N.jsxs(gO,{className:"snap-y flex-col bg-gradient-to-l sm:snap-x sm:flex-row sm:bg-gradient-to-t",children:[N.jsx(WJ,{children:N.jsx(O0,{className:"rounded-full",children:N.jsx(VW,{})})}),N.jsx(JJ,{children:N.jsx(O0,{className:"rounded-full",children:N.jsx(OW,{})})})]})}),tee=()=>{const{mode:n,showUI:e}=Nc(),{setShowUI:t}=JI();return N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"pointer-events-none absolute top-0 flex w-full flex-row items-center justify-end gap-2 p-4",children:N.jsx(Ja,{defaultChecked:e,className:"pointer-events-auto cursor-pointer",id:"controls-visible",onCheckedChange:r=>{t(r)}})}),e&&N.jsxs("div",{className:"pointer-events-none absolute bottom-0 flex w-full items-end justify-center gap-4 p-4",children:[n!==Rt.AUDIO_SCOPE&&N.jsx(dq,{}),N.jsx("div",{className:jt({"absolute bottom-24 right-0 sm:static sm:bottom-0":!0}),children:N.jsx(eee,{})})]})]})},nee=n=>{switch(n){case Rt.AUDIO:case Rt.AUDIO_SCOPE:return N.jsx(rG,{mode:n});case Rt.WAVE_FORM:case Rt.NOISE:case Rt.PARTICLE_NOISE:return null;default:return n}},ree=n=>{switch(n){case Rt.AUDIO_SCOPE:return N.jsx(m9,{});case Rt.WAVE_FORM:case Rt.NOISE:case Rt.AUDIO:case Rt.PARTICLE_NOISE:return N.jsx(cq,{mode:n});default:return n}},iee=()=>{const{mode:n}=Nc(),{noteCanvasInteraction:e}=Yd();return N.jsxs("main",{className:"relative h-[100dvh] w-[100dvw] bg-black",children:[N.jsx("div",{className:"absolute h-[100dvh] w-[100dvw]",onMouseDown:e,onTouchStart:e,children:N.jsx(M.Suspense,{fallback:N.jsx("span",{children:"loading..."}),children:ree(n)})}),N.jsx("div",{className:"pointer-events-none absolute h-[100dvh] w-[100dvw]",children:N.jsx(M.Suspense,{fallback:N.jsx("span",{children:"loading..."}),children:nee(n)})}),N.jsx(tee,{})]})};const see={theme:"system",setTheme:()=>null},oee=M.createContext(see);function aee({children:n,defaultTheme:e="dark",storageKey:t="vite-ui-theme",...r}){const[i,s]=M.useState(e);M.useEffect(()=>{const a=window.document.documentElement;a.classList.remove("light","dark"),a.classList.add(i)},[i]);const o={theme:i,setTheme:a=>{localStorage.setItem(t,a),s(a)}};return N.jsx(oee.Provider,{...r,value:o,children:n})}const lee=new tW;fO(document.getElementById("root")).render(N.jsx(M.StrictMode,{children:N.jsx(oW,{client:lee,children:N.jsx(aee,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:N.jsx(n$,{children:N.jsx(xG,{children:N.jsx(S9,{children:N.jsx(TF,{children:N.jsx(YW,{children:N.jsx(r$,{children:N.jsx(eq,{children:N.jsx(_G,{children:N.jsx(iee,{})})})})})})})})})})})}));export{Ut as $,io as A,Ic as B,Wn as C,Q0 as D,zp as E,is as F,GX as G,ah as H,Ih as I,qn as J,br as K,fn as L,_t as M,Gn as N,In as O,Rn as P,Br as Q,Op as R,iq as S,rD as T,oo as U,F as V,gi as W,xE as X,$a as Y,on as Z,$d as _,Fc as a,an as a0,Ki as a1,Ti as a2,fee as a3,tl as a4,FL as a5,fG as a6,Ue as a7,vG as a8,lI as a9,fl as b,zf as c,sG as d,lG as e,yy as f,y9 as g,Ds as h,O3 as i,N as j,dee as k,b3 as l,wI as m,Be as n,ge as o,gc as p,Ha as q,M as r,No as s,Kr as t,XE as u,Js as v,as as w,$o as x,po as y,Or as z}; +Defaulting to \`${Qw}\`.`}function yk(n){return CK.includes(n)}const xk=vk,Eb=M.forwardRef(({className:n,orientation:e="horizontal",decorative:t=!0,...r},i)=>N.jsx(xk,{ref:i,decorative:t,orientation:e,className:jt("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",n),...r}));Eb.displayName=xk.displayName;const Jw="dismissableLayer.update",RK="dismissableLayer.pointerDownOutside",PK="dismissableLayer.focusOutside";let eP;const IK=M.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),LK=M.forwardRef((n,e)=>{var t;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...u}=n,f=M.useContext(IK),[h,p]=M.useState(null),m=(t=h==null?void 0:h.ownerDocument)!==null&&t!==void 0?t:globalThis==null?void 0:globalThis.document,[,v]=M.useState({}),w=Zt(e,D=>p(D)),x=Array.from(f.layers),[g]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=x.indexOf(g),_=h?x.indexOf(h):-1,b=f.layersWithOutsidePointerEventsDisabled.size>0,A=_>=S,R=DK(D=>{const V=D.target,C=[...f.branches].some(L=>L.contains(V));!A||C||(s==null||s(D),a==null||a(D),D.defaultPrevented||l==null||l())},m),P=NK(D=>{const V=D.target;[...f.branches].some(L=>L.contains(V))||(o==null||o(D),a==null||a(D),D.defaultPrevented||l==null||l())},m);return RO(D=>{_===f.layers.size-1&&(i==null||i(D),!D.defaultPrevented&&l&&(D.preventDefault(),l()))},m),M.useEffect(()=>{if(h)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(eP=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),tP(),()=>{r&&f.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=eP)}},[h,m,r,f]),M.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),tP())},[h,f]),M.useEffect(()=>{const D=()=>v({});return document.addEventListener(Jw,D),()=>document.removeEventListener(Jw,D)},[]),M.createElement(Dt.div,Ue({},u,{ref:w,style:{pointerEvents:b?A?"auto":"none":void 0,...n.style},onFocusCapture:bt(n.onFocusCapture,P.onFocusCapture),onBlurCapture:bt(n.onBlurCapture,P.onBlurCapture),onPointerDownCapture:bt(n.onPointerDownCapture,R.onPointerDownCapture)}))});function DK(n,e=globalThis==null?void 0:globalThis.document){const t=Xn(n),r=M.useRef(!1),i=M.useRef(()=>{});return M.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let u=function(){_k(RK,t,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=u,e.addEventListener("click",i.current,{once:!0})):u()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,t]),{onPointerDownCapture:()=>r.current=!0}}function NK(n,e=globalThis==null?void 0:globalThis.document){const t=Xn(n),r=M.useRef(!1);return M.useEffect(()=>{const i=s=>{s.target&&!r.current&&_k(PK,t,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,t]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function tP(){const n=new CustomEvent(Jw);document.dispatchEvent(n)}function _k(n,e,t,{discrete:r}){const i=t.originalEvent.target,s=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:t});e&&i.addEventListener(n,e,{once:!0}),r?bO(i,s):i.dispatchEvent(s)}const NS="focusScope.autoFocusOnMount",OS="focusScope.autoFocusOnUnmount",nP={bubbles:!1,cancelable:!0},OK=M.forwardRef((n,e)=>{const{loop:t=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=n,[a,l]=M.useState(null),u=Xn(i),f=Xn(s),h=M.useRef(null),p=Zt(e,w=>l(w)),m=M.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;M.useEffect(()=>{if(r){let w=function(_){if(m.paused||!a)return;const b=_.target;a.contains(b)?h.current=b:Ca(h.current,{select:!0})},x=function(_){if(m.paused||!a)return;const b=_.relatedTarget;b!==null&&(a.contains(b)||Ca(h.current,{select:!0}))},g=function(_){if(document.activeElement===document.body)for(const A of _)A.removedNodes.length>0&&Ca(a)};document.addEventListener("focusin",w),document.addEventListener("focusout",x);const S=new MutationObserver(g);return a&&S.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",x),S.disconnect()}}},[r,a,m.paused]),M.useEffect(()=>{if(a){iP.add(m);const w=document.activeElement;if(!a.contains(w)){const g=new CustomEvent(NS,nP);a.addEventListener(NS,u),a.dispatchEvent(g),g.defaultPrevented||(kK(VK(Sk(a)),{select:!0}),document.activeElement===w&&Ca(a))}return()=>{a.removeEventListener(NS,u),setTimeout(()=>{const g=new CustomEvent(OS,nP);a.addEventListener(OS,f),a.dispatchEvent(g),g.defaultPrevented||Ca(w??document.body,{select:!0}),a.removeEventListener(OS,f),iP.remove(m)},0)}}},[a,u,f,m]);const v=M.useCallback(w=>{if(!t&&!r||m.paused)return;const x=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,g=document.activeElement;if(x&&g){const S=w.currentTarget,[_,b]=UK(S);_&&b?!w.shiftKey&&g===b?(w.preventDefault(),t&&Ca(_,{select:!0})):w.shiftKey&&g===_&&(w.preventDefault(),t&&Ca(b,{select:!0})):g===S&&w.preventDefault()}},[t,r,m.paused]);return M.createElement(Dt.div,Ue({tabIndex:-1},o,{ref:p,onKeyDown:v}))});function kK(n,{select:e=!1}={}){const t=document.activeElement;for(const r of n)if(Ca(r,{select:e}),document.activeElement!==t)return}function UK(n){const e=Sk(n),t=rP(e,n),r=rP(e.reverse(),n);return[t,r]}function Sk(n){const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function rP(n,e){for(const t of n)if(!FK(t,{upTo:e}))return t}function FK(n,{upTo:e}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e!==void 0&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}function zK(n){return n instanceof HTMLInputElement&&"select"in n}function Ca(n,{select:e=!1}={}){if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),n!==t&&zK(n)&&e&&n.select()}}const iP=BK();function BK(){let n=[];return{add(e){const t=n[0];e!==t&&(t==null||t.pause()),n=sP(n,e),n.unshift(e)},remove(e){var t;n=sP(n,e),(t=n[0])===null||t===void 0||t.resume()}}}function sP(n,e){const t=[...n],r=t.indexOf(e);return r!==-1&&t.splice(r,1),t}function VK(n){return n.filter(e=>e.tagName!=="A")}const HK=M.forwardRef((n,e)=>{var t;const{container:r=globalThis==null||(t=globalThis.document)===null||t===void 0?void 0:t.body,...i}=n;return r?vO.createPortal(M.createElement(Dt.div,Ue({},i,{ref:e})),r):null});function $K(n,e){return M.useReducer((t,r)=>{const i=e[t][r];return i??t},n)}const ia=n=>{const{present:e,children:t}=n,r=WK(e),i=typeof t=="function"?t({present:r.isPresent}):M.Children.only(t),s=Zt(r.ref,i.ref);return typeof t=="function"||r.isPresent?M.cloneElement(i,{ref:s}):null};ia.displayName="Presence";function WK(n){const[e,t]=M.useState(),r=M.useRef({}),i=M.useRef(n),s=M.useRef("none"),o=n?"mounted":"unmounted",[a,l]=$K(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return M.useEffect(()=>{const u=_v(r.current);s.current=a==="mounted"?u:"none"},[a]),us(()=>{const u=r.current,f=i.current;if(f!==n){const p=s.current,m=_v(u);n?l("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=n}},[n,l]),us(()=>{if(e){const u=h=>{const m=_v(r.current).includes(h.animationName);h.target===e&&m&&$c.flushSync(()=>l("ANIMATION_END"))},f=h=>{h.target===e&&(s.current=_v(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",u),e.addEventListener("animationend",u),()=>{e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",u),e.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:M.useCallback(u=>{u&&(r.current=getComputedStyle(u)),t(u)},[])}}function _v(n){return(n==null?void 0:n.animationName)||"none"}const wk="Dialog",[Ek,Oee]=na(wk),[GK,ks]=Ek(wk),jK=n=>{const{__scopeDialog:e,children:t,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=n,a=M.useRef(null),l=M.useRef(null),[u=!1,f]=Rc({prop:r,defaultProp:i,onChange:s});return M.createElement(GK,{scope:e,triggerRef:a,contentRef:l,contentId:vc(),titleId:vc(),descriptionId:vc(),open:u,onOpenChange:f,onOpenToggle:M.useCallback(()=>f(h=>!h),[f]),modal:o},t)},XK="DialogTrigger",qK=M.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=ks(XK,t),s=Zt(e,i.triggerRef);return M.createElement(Dt.button,Ue({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Mb(i.open)},r,{ref:s,onClick:bt(n.onClick,i.onOpenToggle)}))}),Mk="DialogPortal",[YK,bk]=Ek(Mk,{forceMount:void 0}),ZK=n=>{const{__scopeDialog:e,forceMount:t,children:r,container:i}=n,s=ks(Mk,e);return M.createElement(YK,{scope:e,forceMount:t},M.Children.map(r,o=>M.createElement(ia,{present:t||s.open},M.createElement(HK,{asChild:!0,container:i},o))))},eE="DialogOverlay",KK=M.forwardRef((n,e)=>{const t=bk(eE,n.__scopeDialog),{forceMount:r=t.forceMount,...i}=n,s=ks(eE,n.__scopeDialog);return s.modal?M.createElement(ia,{present:r||s.open},M.createElement(QK,Ue({},i,{ref:e}))):null}),QK=M.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=ks(eE,t);return M.createElement(ok,{as:Pc,allowPinchZoom:!0,shards:[i.contentRef]},M.createElement(Dt.div,Ue({"data-state":Mb(i.open)},r,{ref:e,style:{pointerEvents:"auto",...r.style}})))}),wp="DialogContent",JK=M.forwardRef((n,e)=>{const t=bk(wp,n.__scopeDialog),{forceMount:r=t.forceMount,...i}=n,s=ks(wp,n.__scopeDialog);return M.createElement(ia,{present:r||s.open},s.modal?M.createElement(eQ,Ue({},i,{ref:e})):M.createElement(tQ,Ue({},i,{ref:e})))}),eQ=M.forwardRef((n,e)=>{const t=ks(wp,n.__scopeDialog),r=M.useRef(null),i=Zt(e,t.contentRef,r);return M.useEffect(()=>{const s=r.current;if(s)return KO(s)},[]),M.createElement(Tk,Ue({},n,{ref:i,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:bt(n.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=t.triggerRef.current)===null||o===void 0||o.focus()}),onPointerDownOutside:bt(n.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:bt(n.onFocusOutside,s=>s.preventDefault())}))}),tQ=M.forwardRef((n,e)=>{const t=ks(wp,n.__scopeDialog),r=M.useRef(!1),i=M.useRef(!1);return M.createElement(Tk,Ue({},n,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o;if((o=n.onCloseAutoFocus)===null||o===void 0||o.call(n,s),!s.defaultPrevented){var a;r.current||(a=t.triggerRef.current)===null||a===void 0||a.focus(),s.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=n.onInteractOutside)===null||o===void 0||o.call(n,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=s.target;((a=t.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}}))}),Tk=M.forwardRef((n,e)=>{const{__scopeDialog:t,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=n,a=ks(wp,t),l=M.useRef(null),u=Zt(e,l);return IO(),M.createElement(M.Fragment,null,M.createElement(OK,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s},M.createElement(LK,Ue({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Mb(a.open)},o,{ref:u,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),nQ="DialogTitle",rQ=M.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=ks(nQ,t);return M.createElement(Dt.h2,Ue({id:i.titleId},r,{ref:e}))}),iQ="DialogDescription",sQ=M.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=ks(iQ,t);return M.createElement(Dt.p,Ue({id:i.descriptionId},r,{ref:e}))}),oQ="DialogClose",aQ=M.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=ks(oQ,t);return M.createElement(Dt.button,Ue({type:"button"},r,{ref:e,onClick:bt(n.onClick,()=>i.onOpenChange(!1))}))});function Mb(n){return n?"open":"closed"}const lQ=jK,cQ=qK,uQ=ZK,Ck=KK,Ak=JK,Rk=rQ,Pk=sQ,dQ=aQ;function fQ(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,s;for(s=0;s=0)&&(t[i]=n[i]);return t}var hQ=["color"],pQ=M.forwardRef(function(n,e){var t=n.color,r=t===void 0?"currentColor":t,i=fQ(n,hQ);return M.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:e}),M.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});function Ik(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n))for(e=0;etypeof n=="boolean"?"".concat(n):n===0?"0":n,aP=mQ,bb=(n,e)=>t=>{var r;if((e==null?void 0:e.variants)==null)return aP(n,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:i,defaultVariants:s}=e,o=Object.keys(i).map(u=>{const f=t==null?void 0:t[u],h=s==null?void 0:s[u];if(f===null)return null;const p=oP(f)||oP(h);return i[u][p]}),a=t&&Object.entries(t).reduce((u,f)=>{let[h,p]=f;return p===void 0||(u[h]=p),u},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,f)=>{let{class:h,className:p,...m}=f;return Object.entries(m).every(v=>{let[w,x]=v;return Array.isArray(x)?x.includes({...s,...a}[w]):{...s,...a}[w]===x})?[...u,h,p]:u},[]);return aP(n,o,l,t==null?void 0:t.class,t==null?void 0:t.className)},Lk=lQ,Dk=cQ,gQ=uQ,Nk=M.forwardRef(({className:n,...e},t)=>N.jsx(Ck,{className:jt("fixed inset-0 z-50 bg-black/25 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...e,ref:t}));Nk.displayName=Ck.displayName;const vQ=bb("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Tb=M.forwardRef(({side:n="right",className:e,children:t,...r},i)=>N.jsxs(gQ,{children:[N.jsx(Nk,{}),N.jsxs(Ak,{ref:i,className:jt(vQ({side:n}),e),...r,children:[t,N.jsxs(dQ,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[N.jsx(pQ,{className:"h-4 w-4"}),N.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Tb.displayName=Ak.displayName;const yQ=M.forwardRef(({className:n,...e},t)=>N.jsx(Rk,{ref:t,className:jt("text-lg font-semibold text-foreground",n),...e}));yQ.displayName=Rk.displayName;const xQ=M.forwardRef(({className:n,...e},t)=>N.jsx(Pk,{ref:t,className:jt("text-sm text-muted-foreground",n),...e}));xQ.displayName=Pk.displayName;const Ok=["PageUp","PageDown"],kk=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Uk={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},rm="Slider",[tE,_Q,SQ]=pb(rm),[Fk,kee]=na(rm,[SQ]),[wQ,Xy]=Fk(rm),EQ=M.forwardRef((n,e)=>{const{name:t,min:r=0,max:i=100,step:s=1,orientation:o="horizontal",disabled:a=!1,minStepsBetweenThumbs:l=0,defaultValue:u=[r],value:f,onValueChange:h=()=>{},onValueCommit:p=()=>{},inverted:m=!1,...v}=n,[w,x]=M.useState(null),g=Zt(e,z=>x(z)),S=M.useRef(new Set),_=M.useRef(0),b=o==="horizontal",A=w?!!w.closest("form"):!0,R=b?MQ:bQ,[P=[],D]=Rc({prop:f,defaultProp:u,onChange:z=>{var j;(j=[...S.current][_.current])===null||j===void 0||j.focus(),h(z)}}),V=M.useRef(P);function C(z){const j=NQ(P,z);Q(z,j)}function L(z){Q(z,_.current)}function W(){const z=V.current[_.current];P[_.current]!==z&&p(P)}function Q(z,j,{commit:Y}={commit:!1}){const re=FQ(s),U=zQ(Math.round((z-r)/s)*s+r,re),X=xp(U,[r,i]);D((q=[])=>{const K=LQ(q,X,j);if(UQ(K,l*s)){_.current=K.indexOf(X);const se=String(K)!==String(q);return se&&Y&&p(K),se?K:q}else return q})}return M.createElement(wQ,{scope:n.__scopeSlider,disabled:a,min:r,max:i,valueIndexToChangeRef:_,thumbs:S.current,values:P,orientation:o},M.createElement(tE.Provider,{scope:n.__scopeSlider},M.createElement(tE.Slot,{scope:n.__scopeSlider},M.createElement(R,Ue({"aria-disabled":a,"data-disabled":a?"":void 0},v,{ref:g,onPointerDown:bt(v.onPointerDown,()=>{a||(V.current=P)}),min:r,max:i,inverted:m,onSlideStart:a?void 0:C,onSlideMove:a?void 0:L,onSlideEnd:a?void 0:W,onHomeKeyDown:()=>!a&&Q(r,0,{commit:!0}),onEndKeyDown:()=>!a&&Q(i,P.length-1,{commit:!0}),onStepKeyDown:({event:z,direction:j})=>{if(!a){const U=Ok.includes(z.key)||z.shiftKey&&kk.includes(z.key)?10:1,X=_.current,q=P[X],K=s*U*j;Q(q+K,X,{commit:!0})}}})))),A&&P.map((z,j)=>M.createElement(IQ,{key:j,name:t?t+(P.length>1?"[]":""):void 0,value:z})))}),[zk,Bk]=Fk(rm,{startEdge:"left",endEdge:"right",size:"width",direction:1}),MQ=M.forwardRef((n,e)=>{const{min:t,max:r,dir:i,inverted:s,onSlideStart:o,onSlideMove:a,onSlideEnd:l,onStepKeyDown:u,...f}=n,[h,p]=M.useState(null),m=Zt(e,_=>p(_)),v=M.useRef(),w=tm(i),x=w==="ltr",g=x&&!s||!x&&s;function S(_){const b=v.current||h.getBoundingClientRect(),A=[0,b.width],P=Cb(A,g?[t,r]:[r,t]);return v.current=b,P(_-b.left)}return M.createElement(zk,{scope:n.__scopeSlider,startEdge:g?"left":"right",endEdge:g?"right":"left",direction:g?1:-1,size:"width"},M.createElement(Vk,Ue({dir:w,"data-orientation":"horizontal"},f,{ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:_=>{const b=S(_.clientX);o==null||o(b)},onSlideMove:_=>{const b=S(_.clientX);a==null||a(b)},onSlideEnd:()=>{v.current=void 0,l==null||l()},onStepKeyDown:_=>{const A=Uk[g?"from-left":"from-right"].includes(_.key);u==null||u({event:_,direction:A?-1:1})}})))}),bQ=M.forwardRef((n,e)=>{const{min:t,max:r,inverted:i,onSlideStart:s,onSlideMove:o,onSlideEnd:a,onStepKeyDown:l,...u}=n,f=M.useRef(null),h=Zt(e,f),p=M.useRef(),m=!i;function v(w){const x=p.current||f.current.getBoundingClientRect(),g=[0,x.height],_=Cb(g,m?[r,t]:[t,r]);return p.current=x,_(w-x.top)}return M.createElement(zk,{scope:n.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1},M.createElement(Vk,Ue({"data-orientation":"vertical"},u,{ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const x=v(w.clientY);s==null||s(x)},onSlideMove:w=>{const x=v(w.clientY);o==null||o(x)},onSlideEnd:()=>{p.current=void 0,a==null||a()},onStepKeyDown:w=>{const g=Uk[m?"from-bottom":"from-top"].includes(w.key);l==null||l({event:w,direction:g?-1:1})}})))}),Vk=M.forwardRef((n,e)=>{const{__scopeSlider:t,onSlideStart:r,onSlideMove:i,onSlideEnd:s,onHomeKeyDown:o,onEndKeyDown:a,onStepKeyDown:l,...u}=n,f=Xy(rm,t);return M.createElement(Dt.span,Ue({},u,{ref:e,onKeyDown:bt(n.onKeyDown,h=>{h.key==="Home"?(o(h),h.preventDefault()):h.key==="End"?(a(h),h.preventDefault()):Ok.concat(kk).includes(h.key)&&(l(h),h.preventDefault())}),onPointerDown:bt(n.onPointerDown,h=>{const p=h.target;p.setPointerCapture(h.pointerId),h.preventDefault(),f.thumbs.has(p)?p.focus():r(h)}),onPointerMove:bt(n.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&i(h)}),onPointerUp:bt(n.onPointerUp,h=>{const p=h.target;p.hasPointerCapture(h.pointerId)&&(p.releasePointerCapture(h.pointerId),s(h))})}))}),TQ="SliderTrack",CQ=M.forwardRef((n,e)=>{const{__scopeSlider:t,...r}=n,i=Xy(TQ,t);return M.createElement(Dt.span,Ue({"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation},r,{ref:e}))}),lP="SliderRange",AQ=M.forwardRef((n,e)=>{const{__scopeSlider:t,...r}=n,i=Xy(lP,t),s=Bk(lP,t),o=M.useRef(null),a=Zt(e,o),l=i.values.length,u=i.values.map(p=>Hk(p,i.min,i.max)),f=l>1?Math.min(...u):0,h=100-Math.max(...u);return M.createElement(Dt.span,Ue({"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0},r,{ref:a,style:{...n.style,[s.startEdge]:f+"%",[s.endEdge]:h+"%"}}))}),cP="SliderThumb",RQ=M.forwardRef((n,e)=>{const t=_Q(n.__scopeSlider),[r,i]=M.useState(null),s=Zt(e,a=>i(a)),o=M.useMemo(()=>r?t().findIndex(a=>a.ref.current===r):-1,[t,r]);return M.createElement(PQ,Ue({},n,{ref:s,index:o}))}),PQ=M.forwardRef((n,e)=>{const{__scopeSlider:t,index:r,...i}=n,s=Xy(cP,t),o=Bk(cP,t),[a,l]=M.useState(null),u=Zt(e,x=>l(x)),f=hb(a),h=s.values[r],p=h===void 0?0:Hk(h,s.min,s.max),m=DQ(r,s.values.length),v=f==null?void 0:f[o.size],w=v?OQ(v,p,o.direction):0;return M.useEffect(()=>{if(a)return s.thumbs.add(a),()=>{s.thumbs.delete(a)}},[a,s.thumbs]),M.createElement("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${p}% + ${w}px)`}},M.createElement(tE.ItemSlot,{scope:n.__scopeSlider},M.createElement(Dt.span,Ue({role:"slider","aria-label":n["aria-label"]||m,"aria-valuemin":s.min,"aria-valuenow":h,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0},i,{ref:u,style:h===void 0?{display:"none"}:n.style,onFocus:bt(n.onFocus,()=>{s.valueIndexToChangeRef.current=r})}))))}),IQ=n=>{const{value:e,...t}=n,r=M.useRef(null),i=fb(e);return M.useEffect(()=>{const s=r.current,o=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(o,"value").set;if(i!==e&&l){const u=new Event("input",{bubbles:!0});l.call(s,e),s.dispatchEvent(u)}},[i,e]),M.createElement("input",Ue({style:{display:"none"}},t,{ref:r,defaultValue:e}))};function LQ(n=[],e,t){const r=[...n];return r[t]=e,r.sort((i,s)=>i-s)}function Hk(n,e,t){const s=100/(t-e)*(n-e);return xp(s,[0,100])}function DQ(n,e){return e>2?`Value ${n+1} of ${e}`:e===2?["Minimum","Maximum"][n]:void 0}function NQ(n,e){if(n.length===1)return 0;const t=n.map(i=>Math.abs(i-e)),r=Math.min(...t);return t.indexOf(r)}function OQ(n,e,t){const r=n/2,s=Cb([0,50],[0,r]);return(r-s(e)*t)*t}function kQ(n){return n.slice(0,-1).map((e,t)=>n[t+1]-e)}function UQ(n,e){if(e>0){const t=kQ(n);return Math.min(...t)>=e}return!0}function Cb(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(n[1]-n[0]);return e[0]+r*(t-n[0])}}function FQ(n){return(String(n).split(".")[1]||"").length}function zQ(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}const $k=EQ,BQ=CQ,VQ=AQ,HQ=RQ,wr=M.forwardRef(({className:n,...e},t)=>N.jsxs($k,{ref:t,className:jt("relative flex w-full touch-none select-none items-center",n),...e,children:[N.jsx(BQ,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:N.jsx(VQ,{className:"absolute h-full bg-primary"})}),N.jsx(HQ,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));wr.displayName=$k.displayName;const kS="rovingFocusGroup.onEntryFocus",$Q={bubbles:!1,cancelable:!0},Ab="RovingFocusGroup",[nE,Wk,WQ]=pb(Ab),[GQ,Gk]=na(Ab,[WQ]),[jQ,XQ]=GQ(Ab),qQ=M.forwardRef((n,e)=>M.createElement(nE.Provider,{scope:n.__scopeRovingFocusGroup},M.createElement(nE.Slot,{scope:n.__scopeRovingFocusGroup},M.createElement(YQ,Ue({},n,{ref:e}))))),YQ=M.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,...f}=n,h=M.useRef(null),p=Zt(e,h),m=tm(s),[v=null,w]=Rc({prop:o,defaultProp:a,onChange:l}),[x,g]=M.useState(!1),S=Xn(u),_=Wk(t),b=M.useRef(!1),[A,R]=M.useState(0);return M.useEffect(()=>{const P=h.current;if(P)return P.addEventListener(kS,S),()=>P.removeEventListener(kS,S)},[S]),M.createElement(jQ,{scope:t,orientation:r,dir:m,loop:i,currentTabStopId:v,onItemFocus:M.useCallback(P=>w(P),[w]),onItemShiftTab:M.useCallback(()=>g(!0),[]),onFocusableItemAdd:M.useCallback(()=>R(P=>P+1),[]),onFocusableItemRemove:M.useCallback(()=>R(P=>P-1),[])},M.createElement(Dt.div,Ue({tabIndex:x||A===0?-1:0,"data-orientation":r},f,{ref:p,style:{outline:"none",...n.style},onMouseDown:bt(n.onMouseDown,()=>{b.current=!0}),onFocus:bt(n.onFocus,P=>{const D=!b.current;if(P.target===P.currentTarget&&D&&!x){const V=new CustomEvent(kS,$Q);if(P.currentTarget.dispatchEvent(V),!V.defaultPrevented){const C=_().filter(j=>j.focusable),L=C.find(j=>j.active),W=C.find(j=>j.id===v),z=[L,W,...C].filter(Boolean).map(j=>j.ref.current);jk(z)}}b.current=!1}),onBlur:bt(n.onBlur,()=>g(!1))})))}),ZQ="RovingFocusGroupItem",KQ=M.forwardRef((n,e)=>{const{__scopeRovingFocusGroup:t,focusable:r=!0,active:i=!1,tabStopId:s,...o}=n,a=vc(),l=s||a,u=XQ(ZQ,t),f=u.currentTabStopId===l,h=Wk(t),{onFocusableItemAdd:p,onFocusableItemRemove:m}=u;return M.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),M.createElement(nE.ItemSlot,{scope:t,id:l,focusable:r,active:i},M.createElement(Dt.span,Ue({tabIndex:f?0:-1,"data-orientation":u.orientation},o,{ref:e,onMouseDown:bt(n.onMouseDown,v=>{r?u.onItemFocus(l):v.preventDefault()}),onFocus:bt(n.onFocus,()=>u.onItemFocus(l)),onKeyDown:bt(n.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){u.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const w=eJ(v,u.orientation,u.dir);if(w!==void 0){v.preventDefault();let g=h().filter(S=>S.focusable).map(S=>S.ref.current);if(w==="last")g.reverse();else if(w==="prev"||w==="next"){w==="prev"&&g.reverse();const S=g.indexOf(v.currentTarget);g=u.loop?tJ(g,S+1):g.slice(S+1)}setTimeout(()=>jk(g))}})})))}),QQ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function JQ(n,e){return e!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function eJ(n,e,t){const r=JQ(n.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return QQ[r]}function jk(n){const e=document.activeElement;for(const t of n)if(t===e||(t.focus(),document.activeElement!==e))return}function tJ(n,e){return n.map((t,r)=>n[(e+r)%n.length])}const nJ=qQ,rJ=KQ,Xk="Tabs",[iJ,Uee]=na(Xk,[Gk]),qk=Gk(),[sJ,Rb]=iJ(Xk),oJ=M.forwardRef((n,e)=>{const{__scopeTabs:t,value:r,onValueChange:i,defaultValue:s,orientation:o="horizontal",dir:a,activationMode:l="automatic",...u}=n,f=tm(a),[h,p]=Rc({prop:r,onChange:i,defaultProp:s});return M.createElement(sJ,{scope:t,baseId:vc(),value:h,onValueChange:p,orientation:o,dir:f,activationMode:l},M.createElement(Dt.div,Ue({dir:f,"data-orientation":o},u,{ref:e})))}),aJ="TabsList",lJ=M.forwardRef((n,e)=>{const{__scopeTabs:t,loop:r=!0,...i}=n,s=Rb(aJ,t),o=qk(t);return M.createElement(nJ,Ue({asChild:!0},o,{orientation:s.orientation,dir:s.dir,loop:r}),M.createElement(Dt.div,Ue({role:"tablist","aria-orientation":s.orientation},i,{ref:e})))}),cJ="TabsTrigger",uJ=M.forwardRef((n,e)=>{const{__scopeTabs:t,value:r,disabled:i=!1,...s}=n,o=Rb(cJ,t),a=qk(t),l=Yk(o.baseId,r),u=Zk(o.baseId,r),f=r===o.value;return M.createElement(rJ,Ue({asChild:!0},a,{focusable:!i,active:f}),M.createElement(Dt.button,Ue({type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l},s,{ref:e,onMouseDown:bt(n.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?o.onValueChange(r):h.preventDefault()}),onKeyDown:bt(n.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&o.onValueChange(r)}),onFocus:bt(n.onFocus,()=>{const h=o.activationMode!=="manual";!f&&!i&&h&&o.onValueChange(r)})})))}),dJ="TabsContent",fJ=M.forwardRef((n,e)=>{const{__scopeTabs:t,value:r,forceMount:i,children:s,...o}=n,a=Rb(dJ,t),l=Yk(a.baseId,r),u=Zk(a.baseId,r),f=r===a.value,h=M.useRef(f);return M.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),M.createElement(ia,{present:i||f},({present:p})=>M.createElement(Dt.div,Ue({"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:u,tabIndex:0},o,{ref:e,style:{...n.style,animationDuration:h.current?"0s":void 0}}),p&&s))});function Yk(n,e){return`${n}-trigger-${e}`}function Zk(n,e){return`${n}-content-${e}`}const hJ=oJ,Kk=lJ,Qk=uJ,Jk=fJ,pJ=hJ,eU=M.forwardRef(({className:n,...e},t)=>N.jsx(Kk,{ref:t,className:jt("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",n),...e}));eU.displayName=Kk.displayName;const rE=M.forwardRef(({className:n,...e},t)=>N.jsx(Qk,{ref:t,className:jt("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",n),...e}));rE.displayName=Qk.displayName;const iE=M.forwardRef(({className:n,...e},t)=>N.jsx(Jk,{ref:t,className:jt("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n),...e}));iE.displayName=Jk.displayName;const mJ=M.forwardRef((n,e)=>M.createElement(Dt.label,Ue({},n,{ref:e,onMouseDown:t=>{var r;(r=n.onMouseDown)===null||r===void 0||r.call(n,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault()}}))),tU=mJ,gJ=bb("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Oi=M.forwardRef(({className:n,...e},t)=>N.jsx(tU,{ref:t,className:jt(gJ(),n),...e}));Oi.displayName=tU.displayName;const vJ=()=>N.jsx(Oi,{children:"Not supported at this time."}),Pb=M.createContext(null),yJ=({initial:n=void 0,children:e})=>{const[t,r]=M.useState(n==null?void 0:n.query);return N.jsx(Pb.Provider,{value:{filters:{query:t},setters:{setQuery:r}},children:e})};function xJ(){const n=M.useContext(Pb);if(!n)throw new Error("useSearchFiltersContext must be used within a SearchFiltersContextProvider");return n.filters}function _J(){const n=M.useContext(Pb);if(!n)throw new Error("useSearchFiltersContextSetters must be used within a SearchFiltersContextProvider");return n.setters}const SJ=(n,e=500)=>{const[t,r]=M.useState(n);return M.useEffect(()=>{const i=setTimeout(()=>r(n),e||500);return()=>{clearTimeout(i)}},[n,e]),t},wJ=({placeholder:n="Search...",...e})=>{const[t,r]=M.useState(""),i=SJ(t,500),{setQuery:s}=_J();return M.useEffect(()=>{s(i)},[i,s]),N.jsxs("div",{className:"flex flex-row items-center justify-start gap-2 rounded-[6px] border-[#4E4E4E] bg-background px-2",children:[N.jsx(jW,{}),N.jsx("input",{id:"search-filter-input",type:"search",placeholder:n,onChange:o=>{r(o.target.value)},className:jt("search-cancel:appearance-none search-cancel:cursor-pointer flex-grow bg-transparent text-sm text-foreground outline-none placeholder:text-xs placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e.className)})]})};function EJ(n,e){return M.useReducer((t,r)=>{const i=e[t][r];return i??t},n)}const nU="ScrollArea",[rU,Fee]=na(nU),[MJ,fs]=rU(nU),bJ=M.forwardRef((n,e)=>{const{__scopeScrollArea:t,type:r="hover",dir:i,scrollHideDelay:s=600,...o}=n,[a,l]=M.useState(null),[u,f]=M.useState(null),[h,p]=M.useState(null),[m,v]=M.useState(null),[w,x]=M.useState(null),[g,S]=M.useState(0),[_,b]=M.useState(0),[A,R]=M.useState(!1),[P,D]=M.useState(!1),V=Zt(e,L=>l(L)),C=tm(i);return M.createElement(MJ,{scope:t,type:r,dir:C,scrollHideDelay:s,scrollArea:a,viewport:u,onViewportChange:f,content:h,onContentChange:p,scrollbarX:m,onScrollbarXChange:v,scrollbarXEnabled:A,onScrollbarXEnabledChange:R,scrollbarY:w,onScrollbarYChange:x,scrollbarYEnabled:P,onScrollbarYEnabledChange:D,onCornerWidthChange:S,onCornerHeightChange:b},M.createElement(Dt.div,Ue({dir:C},o,{ref:V,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":_+"px",...n.style}})))}),TJ="ScrollAreaViewport",CJ=M.forwardRef((n,e)=>{const{__scopeScrollArea:t,children:r,...i}=n,s=fs(TJ,t),o=M.useRef(null),a=Zt(e,o,s.onViewportChange);return M.createElement(M.Fragment,null,M.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),M.createElement(Dt.div,Ue({"data-radix-scroll-area-viewport":""},i,{ref:a,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...n.style}}),M.createElement("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),sa="ScrollAreaScrollbar",iU=M.forwardRef((n,e)=>{const{forceMount:t,...r}=n,i=fs(sa,n.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:o}=i,a=n.orientation==="horizontal";return M.useEffect(()=>(a?s(!0):o(!0),()=>{a?s(!1):o(!1)}),[a,s,o]),i.type==="hover"?M.createElement(AJ,Ue({},r,{ref:e,forceMount:t})):i.type==="scroll"?M.createElement(RJ,Ue({},r,{ref:e,forceMount:t})):i.type==="auto"?M.createElement(sU,Ue({},r,{ref:e,forceMount:t})):i.type==="always"?M.createElement(Ib,Ue({},r,{ref:e})):null}),AJ=M.forwardRef((n,e)=>{const{forceMount:t,...r}=n,i=fs(sa,n.__scopeScrollArea),[s,o]=M.useState(!1);return M.useEffect(()=>{const a=i.scrollArea;let l=0;if(a){const u=()=>{window.clearTimeout(l),o(!0)},f=()=>{l=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",f),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",f)}}},[i.scrollArea,i.scrollHideDelay]),M.createElement(ia,{present:t||s},M.createElement(sU,Ue({"data-state":s?"visible":"hidden"},r,{ref:e})))}),RJ=M.forwardRef((n,e)=>{const{forceMount:t,...r}=n,i=fs(sa,n.__scopeScrollArea),s=n.orientation==="horizontal",o=Yy(()=>l("SCROLL_END"),100),[a,l]=EJ("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return M.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>l("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,i.scrollHideDelay,l]),M.useEffect(()=>{const u=i.viewport,f=s?"scrollLeft":"scrollTop";if(u){let h=u[f];const p=()=>{const m=u[f];h!==m&&(l("SCROLL"),o()),h=m};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[i.viewport,s,l,o]),M.createElement(ia,{present:t||a!=="hidden"},M.createElement(Ib,Ue({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:e,onPointerEnter:bt(n.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:bt(n.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),sU=M.forwardRef((n,e)=>{const t=fs(sa,n.__scopeScrollArea),{forceMount:r,...i}=n,[s,o]=M.useState(!1),a=n.orientation==="horizontal",l=Yy(()=>{if(t.viewport){const u=t.viewport.offsetWidth{const{orientation:t="vertical",...r}=n,i=fs(sa,n.__scopeScrollArea),s=M.useRef(null),o=M.useRef(0),[a,l]=M.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=cU(a.viewport,a.content),f={...r,sizes:a,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:p=>s.current=p,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:p=>o.current=p};function h(p,m){return UJ(p,o.current,a,m)}return t==="horizontal"?M.createElement(PJ,Ue({},f,{ref:e,onThumbPositionChange:()=>{if(i.viewport&&s.current){const p=i.viewport.scrollLeft,m=uP(p,a,i.dir);s.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollLeft=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollLeft=h(p,i.dir))}})):t==="vertical"?M.createElement(IJ,Ue({},f,{ref:e,onThumbPositionChange:()=>{if(i.viewport&&s.current){const p=i.viewport.scrollTop,m=uP(p,a);s.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollTop=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollTop=h(p))}})):null}),PJ=M.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...i}=n,s=fs(sa,n.__scopeScrollArea),[o,a]=M.useState(),l=M.useRef(null),u=Zt(e,l,s.onScrollbarXChange);return M.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),M.createElement(aU,Ue({"data-orientation":"horizontal"},i,{ref:u,sizes:t,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":qy(t)+"px",...n.style},onThumbPointerDown:f=>n.onThumbPointerDown(f.x),onDragScroll:f=>n.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(s.viewport){const p=s.viewport.scrollLeft+f.deltaX;n.onWheelScroll(p),dU(p,h)&&f.preventDefault()}},onResize:()=>{l.current&&s.viewport&&o&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:G0(o.paddingLeft),paddingEnd:G0(o.paddingRight)}})}}))}),IJ=M.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...i}=n,s=fs(sa,n.__scopeScrollArea),[o,a]=M.useState(),l=M.useRef(null),u=Zt(e,l,s.onScrollbarYChange);return M.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),M.createElement(aU,Ue({"data-orientation":"vertical"},i,{ref:u,sizes:t,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":qy(t)+"px",...n.style},onThumbPointerDown:f=>n.onThumbPointerDown(f.y),onDragScroll:f=>n.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(s.viewport){const p=s.viewport.scrollTop+f.deltaY;n.onWheelScroll(p),dU(p,h)&&f.preventDefault()}},onResize:()=>{l.current&&s.viewport&&o&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:G0(o.paddingTop),paddingEnd:G0(o.paddingBottom)}})}}))}),[LJ,oU]=rU(sa),aU=M.forwardRef((n,e)=>{const{__scopeScrollArea:t,sizes:r,hasThumb:i,onThumbChange:s,onThumbPointerUp:o,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:f,onResize:h,...p}=n,m=fs(sa,t),[v,w]=M.useState(null),x=Zt(e,V=>w(V)),g=M.useRef(null),S=M.useRef(""),_=m.viewport,b=r.content-r.viewport,A=Xn(f),R=Xn(l),P=Yy(h,10);function D(V){if(g.current){const C=V.clientX-g.current.left,L=V.clientY-g.current.top;u({x:C,y:L})}}return M.useEffect(()=>{const V=C=>{const L=C.target;(v==null?void 0:v.contains(L))&&A(C,b)};return document.addEventListener("wheel",V,{passive:!1}),()=>document.removeEventListener("wheel",V,{passive:!1})},[_,v,b,A]),M.useEffect(R,[r,R]),Hd(v,P),Hd(m.content,P),M.createElement(LJ,{scope:t,scrollbar:v,hasThumb:i,onThumbChange:Xn(s),onThumbPointerUp:Xn(o),onThumbPositionChange:R,onThumbPointerDown:Xn(a)},M.createElement(Dt.div,Ue({},p,{ref:x,style:{position:"absolute",...p.style},onPointerDown:bt(n.onPointerDown,V=>{V.button===0&&(V.target.setPointerCapture(V.pointerId),g.current=v.getBoundingClientRect(),S.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),D(V))}),onPointerMove:bt(n.onPointerMove,D),onPointerUp:bt(n.onPointerUp,V=>{const C=V.target;C.hasPointerCapture(V.pointerId)&&C.releasePointerCapture(V.pointerId),document.body.style.webkitUserSelect=S.current,m.viewport&&(m.viewport.style.scrollBehavior=""),g.current=null})})))}),sE="ScrollAreaThumb",DJ=M.forwardRef((n,e)=>{const{forceMount:t,...r}=n,i=oU(sE,n.__scopeScrollArea);return M.createElement(ia,{present:t||i.hasThumb},M.createElement(NJ,Ue({ref:e},r)))}),NJ=M.forwardRef((n,e)=>{const{__scopeScrollArea:t,style:r,...i}=n,s=fs(sE,t),o=oU(sE,t),{onThumbPositionChange:a}=o,l=Zt(e,h=>o.onThumbChange(h)),u=M.useRef(),f=Yy(()=>{u.current&&(u.current(),u.current=void 0)},100);return M.useEffect(()=>{const h=s.viewport;if(h){const p=()=>{if(f(),!u.current){const m=FJ(h,a);u.current=m,a()}};return a(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[s.viewport,f,a]),M.createElement(Dt.div,Ue({"data-state":o.hasThumb?"visible":"hidden"},i,{ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:bt(n.onPointerDownCapture,h=>{const m=h.target.getBoundingClientRect(),v=h.clientX-m.left,w=h.clientY-m.top;o.onThumbPointerDown({x:v,y:w})}),onPointerUp:bt(n.onPointerUp,o.onThumbPointerUp)}))}),lU="ScrollAreaCorner",OJ=M.forwardRef((n,e)=>{const t=fs(lU,n.__scopeScrollArea),r=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&r?M.createElement(kJ,Ue({},n,{ref:e})):null}),kJ=M.forwardRef((n,e)=>{const{__scopeScrollArea:t,...r}=n,i=fs(lU,t),[s,o]=M.useState(0),[a,l]=M.useState(0),u=!!(s&&a);return Hd(i.scrollbarX,()=>{var f;const h=((f=i.scrollbarX)===null||f===void 0?void 0:f.offsetHeight)||0;i.onCornerHeightChange(h),l(h)}),Hd(i.scrollbarY,()=>{var f;const h=((f=i.scrollbarY)===null||f===void 0?void 0:f.offsetWidth)||0;i.onCornerWidthChange(h),o(h)}),u?M.createElement(Dt.div,Ue({},r,{ref:e,style:{width:s,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...n.style}})):null});function G0(n){return n?parseInt(n,10):0}function cU(n,e){const t=n/e;return isNaN(t)?0:t}function qy(n){const e=cU(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,r=(n.scrollbar.size-t)*e;return Math.max(r,18)}function UJ(n,e,t,r="ltr"){const i=qy(t),s=i/2,o=e||s,a=i-o,l=t.scrollbar.paddingStart+o,u=t.scrollbar.size-t.scrollbar.paddingEnd-a,f=t.content-t.viewport,h=r==="ltr"?[0,f]:[f*-1,0];return uU([l,u],h)(n)}function uP(n,e,t="ltr"){const r=qy(e),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-i,o=e.content-e.viewport,a=s-r,l=t==="ltr"?[0,o]:[o*-1,0],u=xp(n,l);return uU([0,o],[0,a])(u)}function uU(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(n[1]-n[0]);return e[0]+r*(t-n[0])}}function dU(n,e){return n>0&&n{})=>{let t={left:n.scrollLeft,top:n.scrollTop},r=0;return function i(){const s={left:n.scrollLeft,top:n.scrollTop},o=t.left!==s.left,a=t.top!==s.top;(o||a)&&e(),t=s,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Yy(n,e){const t=Xn(n),r=M.useRef(0);return M.useEffect(()=>()=>window.clearTimeout(r.current),[]),M.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(t,e)},[t,e])}function Hd(n,e){const t=Xn(e);us(()=>{let r=0;if(n){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(t)});return i.observe(n),()=>{window.cancelAnimationFrame(r),i.unobserve(n)}}},[n,t])}const fU=bJ,zJ=CJ,BJ=OJ,hU=M.forwardRef(({className:n,children:e,...t},r)=>N.jsxs(fU,{ref:r,className:jt("relative overflow-hidden",n),...t,children:[N.jsx(zJ,{className:"h-full w-full rounded-[inherit]",children:e}),N.jsx(pU,{}),N.jsx(BJ,{})]}));hU.displayName=fU.displayName;const pU=M.forwardRef(({className:n,orientation:e="vertical",...t},r)=>N.jsx(iU,{ref:r,orientation:e,className:jt("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 border-t border-t-transparent p-[1px]",n),...t,children:N.jsx(DJ,{className:"relative flex-1 rounded-full bg-border"})}));pU.displayName=iU.displayName;const VJ=({track:n,className:e,...t})=>N.jsxs("div",{className:jt("flex flex-row items-center justify-start gap-2 hover:scale-110",e),...t,children:[n.artwork_url?N.jsx("img",{src:n.artwork_url,className:"h-8 w-8 rounded-lg",alt:"Artwork"}):N.jsx(bL,{}),N.jsxs("div",{className:"flex flex-col items-start justify-center gap-1",children:[N.jsx("span",{className:"truncate text-xs text-foreground",children:n.title}),N.jsxs("span",{className:"truncate text-xs text-foreground/50",children:["playcount: ",n.playback_count]})]})]}),HJ=({tracks:n,onTrackSelected:e,className:t,...r})=>N.jsx(hU,{className:jt("no-scrollbar flex flex-col items-start justify-start gap-2",t),...r,children:n.map(i=>N.jsx(VJ,{track:i,onClick:()=>{e(i)}},i.id))}),$J=({userId:n,limit:e=10,...t})=>{const{data:r}=iM({queryKey:["soundcloud-user-track-search",n],queryFn:async()=>await p7({userId:n,limit:e})});return N.jsx(HJ,{tracks:r,...t})},WJ=({user:n,className:e,...t})=>N.jsxs("div",{className:jt("flex w-12 flex-col items-center justify-start gap-1 hover:border hover:border-white aria-selected:animate-pulse aria-selected:border aria-selected:border-white",e),...t,children:[n.avatar_url?N.jsx("img",{src:n.avatar_url,className:"aspect-square w-full rounded-full",alt:"User avatar"}):N.jsx(bL,{}),N.jsx("span",{className:"w-full truncate text-xs text-foreground",children:n.username})]}),GJ=({users:n,selectedUserId:e=void 0,onUserSelected:t,className:r,...i})=>N.jsx("div",{className:jt("no-scrollbar flex w-full cursor-pointer flex-row items-center justify-start gap-2 overflow-x-scroll",r),...i,children:n==null?void 0:n.map(s=>N.jsx(WJ,{"aria-selected":e===s.id,user:s,onClick:()=>{t(s)}},s.id))}),jJ=({query:n})=>{const{data:e}=iM({queryKey:["soundcloud-user-search",n],queryFn:async()=>await h7({query:n,limit:20})}),[t,r]=M.useState(null),{setTrack:i}=d$();return N.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[N.jsx(GJ,{users:e.filter(s=>(s.track_count??0)>0),onUserSelected:r,selectedUserId:t==null?void 0:t.id}),t&&N.jsx($J,{userId:t.id,onTrackSelected:i})]})},XJ=()=>{const{query:n}=xJ();return n?N.jsx(M.Suspense,{fallback:N.jsx("span",{className:"text-foreground",children:"Searching..."}),children:N.jsx(jJ,{query:n})}):N.jsx("span",{className:"text-foreground",children:"No results..."})},qJ=()=>N.jsxs(yJ,{children:[N.jsx(wJ,{placeholder:"Search Soundcloud users..."}),N.jsx(XJ,{})]}),YJ=()=>N.jsx(qJ,{}),zr=({label:n,value:e,className:t,...r})=>N.jsxs("div",{className:jt("flex w-full items-center justify-between",t),...r,children:[N.jsx(Oi,{children:n}),N.jsx("span",{className:"w-12 px-2 py-0.5 text-right text-sm text-muted-foreground",children:e})]}),ZJ=({audioSource:n,...e})=>{switch(n){case Jn.SOUNDCLOUD:return N.jsx(TL,{...e});case Jn.MICROPHONE:return N.jsx(BW,{...e});case Jn.SCREEN_SHARE:return N.jsx(GW,{...e});case Jn.FILE_UPLOAD:return N.jsx(kW,{...e});default:return n}},KJ=({className:n,...e})=>N.jsx("div",{className:jt("grid aspect-square w-full flex-none grow cursor-pointer place-content-center rounded-sm bg-gradient-to-b from-slate-700 to-black text-white shadow-inner duration-300 ease-in-out hover:scale-110 hover:from-slate-500 hover:to-slate-900 aria-selected:from-slate-100 aria-selected:to-slate-500 aria-selected:text-black",n),...e}),mU=({className:n,...e})=>{const{audioSource:t}=oM(),{setAudioSource:r}=nG(),i=M.useMemo(()=>KI(),[]);return N.jsx("div",{className:jt("grid w-full grid-cols-6 justify-items-stretch gap-2 sm:grid-cols-8",n),...e,children:i.map(s=>N.jsx(KJ,{onClick:()=>r(s),"aria-selected":t===s,children:N.jsx(ZJ,{audioSource:s})},`grid_icon_${s}`))})},gU=()=>{const{audioSource:n}=oM();switch(n){case Jn.SOUNDCLOUD:return N.jsx(YJ,{});case Jn.FILE_UPLOAD:return N.jsx(vJ,{});case Jn.MICROPHONE:case Jn.SCREEN_SHARE:return null;default:return n}},QJ=()=>{const{amplitude:n,octaveBandMode:e,energyMeasure:t}=dE(),{setAmplitude:r,setOctaveBand:i,setEnergyMeasure:s}=DF();return N.jsxs("div",{className:"w-full space-y-4",children:[N.jsx(zr,{label:"Amplitude",value:n.toFixed(2)}),N.jsx(wr,{defaultValue:[n],value:[n],min:0,max:5,step:.01,onValueChange:o=>r(o[0])}),N.jsxs("div",{className:"flex w-full items-center justify-between",children:[N.jsx("span",{children:"Octave Band Mode"}),N.jsxs(Zw,{onValueChange:o=>{i(Number(o))},children:[N.jsx(H0,{className:"max-w-1/2 w-[240px]",children:N.jsx(Kw,{placeholder:i2[e],defaultValue:e,className:"w-full"})}),N.jsx($0,{className:"max-h-36",children:Object.entries(i2).map(o=>N.jsx(W0,{value:o[0],"aria-selected":o[0]===e.toString(),children:o[1]},o[1]))})]})]}),N.jsxs("div",{className:"flex w-full items-center justify-between",children:[N.jsx("span",{children:"Energy Measure"}),N.jsxs(Zw,{onValueChange:o=>{s(o)},children:[N.jsx(H0,{className:"max-w-1/2 w-[240px]",children:N.jsx(Kw,{placeholder:t,defaultValue:t,className:"w-full"})}),N.jsx($0,{className:"max-h-36",children:iG.map(o=>N.jsx(W0,{value:o,"aria-selected":o===t,children:o},o))})]})]})]})},JJ=()=>N.jsxs(pJ,{defaultValue:"source",className:"w-full",children:[N.jsxs(eU,{className:"w-full",children:[N.jsx(rE,{value:"source",className:"grow",children:"Audio Source"}),N.jsx(rE,{value:"analyzer",className:"grow",children:"Audio Analyzer"})]}),N.jsxs(iE,{value:"source",className:"space-y-4 p-4",children:[N.jsx(mU,{}),N.jsx(gU,{})]}),N.jsx(iE,{value:"analyzer",children:N.jsx(QJ,{})})]}),eee=()=>N.jsxs("div",{className:"space-y-4 p-4",children:[N.jsx(mU,{}),N.jsx(gU,{})]}),tee=()=>{const{amplitude:n,spatialScale:e,timeScale:t,nIterations:r}=fD(),{setAmplitude:i,setSpatialScale:s,setTimeScale:o,setNIterations:a,reset:l}=k9();return N.jsxs("div",{className:"flex w-full flex-col items-start justify-start gap-4",children:[N.jsxs("div",{className:"flex w-full items-center justify-between",children:[N.jsx("span",{children:"Noise"}),N.jsx(CL,{className:"pointer-events-auto cursor-pointer",onClick:()=>l()})]}),N.jsx(zr,{label:"Amplitude",value:n.toFixed(2)}),N.jsx(wr,{defaultValue:[n],value:[n],min:0,max:5,step:.01,onValueChange:u=>i(u[0])}),N.jsx(zr,{label:"Spatial Scale",value:e.toFixed(2)}),N.jsx(wr,{defaultValue:[e],value:[e],min:.1,max:5,step:.1,onValueChange:u=>s(u[0])}),N.jsx(zr,{label:"Time Scale",value:t.toFixed(2)}),N.jsx(wr,{defaultValue:[t],value:[t],min:.01,max:2,step:.01,onValueChange:u=>o(u[0])}),N.jsx(zr,{label:"Iteration Count",value:r}),N.jsx(wr,{defaultValue:[r],value:[r],min:1,max:16,step:1,onValueChange:u=>a(u[0])})]})},nee=()=>{const{maxAmplitude:n,waveformFrequenciesHz:e}=LL(),{setMaxAmplitude:t,setWaveformFrequenciesHz:r,reset:i}=DL();return N.jsxs("div",{className:"flex w-full flex-col items-start justify-start gap-4",children:[N.jsxs("div",{className:"flex w-full items-center justify-between",children:[N.jsx("span",{children:"Wave Form"}),N.jsx(CL,{className:"pointer-events-auto cursor-pointer",onClick:()=>i()})]}),N.jsxs("div",{className:"flex w-full items-center justify-between",children:[N.jsx(Oi,{children:"Double"}),N.jsx(el,{checked:e.length>1,defaultChecked:e.length>1,onCheckedChange:s=>{r(s?[2,10]:[2])}})]}),N.jsx(zr,{label:"Max Amplitude",value:n.toFixed(2)}),N.jsx(wr,{defaultValue:[n],min:0,max:5,step:.01,onValueChange:s=>t(s[0])}),[...e].map((s,o)=>N.jsxs("div",{className:"w-full space-y-4",children:[N.jsx(zr,{label:`Wave #${o+1} - Freq (hz)`,value:s.toFixed(2)}),N.jsx(wr,{defaultValue:[s],value:[s],min:2,max:o==0?10:30,step:.05,onValueChange:a=>r(l=>l.map((u,f)=>o==f?a[0]:u))},`slider_waveform_frequency_${o}`)]},`label_waveform_frequency_${o}`))]})},ree=({mode:n})=>{switch(n){case"WAVE_FORM":return N.jsx(AW,{});case"NOISE":return N.jsx(YW,{});case"AUDIO":return N.jsx(TL,{});case"AUDIO_SCOPE":return N.jsx(qW,{});case"PARTICLE_NOISE":return N.jsx(OW,{});default:return N.jsx(ML,{})}},dP=({mode:n})=>N.jsxs("div",{className:"flex w-full items-center justify-start gap-2",children:[N.jsx("div",{className:"w-4",children:s$(n)&&"🎧"}),N.jsx(ree,{mode:n}),n]}),iee=()=>{const{mode:n}=kc(),{setMode:e}=eL(),t=M.useMemo(()=>o$(),[]);return N.jsxs(Zw,{onValueChange:r=>{e(r)},children:[N.jsx(H0,{children:N.jsx(Kw,{placeholder:N.jsx(dP,{mode:n}),defaultValue:n,className:"w-full"})}),N.jsx($0,{children:t.map(r=>N.jsx(W0,{value:r,"aria-selected":r===n,children:N.jsx(dP,{mode:r})},`select_item_${r}`))})]})},see=({children:n})=>{const[e,t]=M.useState(!1),{mode:r}=kc();return N.jsxs(Lk,{open:e,onOpenChange:t,children:[N.jsx(Dk,{asChild:!0,children:n}),N.jsxs(Tb,{side:"right",className:"no-scrollbar w-full max-w-full space-y-4 overflow-scroll bg-background/70 p-4 pt-16 sm:w-[540px] sm:max-w-[540px]",children:[N.jsxs("div",{className:"flex items-center justify-start gap-4",children:[N.jsx("span",{className:"text-xl font-bold",children:"MODE"}),N.jsx(iee,{})]}),N.jsx(Eb,{}),r===Rt.WAVE_FORM&&N.jsx(nee,{}),r===Rt.NOISE&&N.jsx(tee,{}),r===Rt.AUDIO&&N.jsx(JJ,{}),r===Rt.AUDIO_SCOPE&&N.jsx(eee,{})]})]})},oee=bb("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),im=M.forwardRef(({className:n,variant:e,size:t,asChild:r=!1,...i},s)=>{const o=r?Pc:"button";return N.jsx(o,{className:jt(oee({variant:e,size:t,className:n})),ref:s,...i})});im.displayName="Button";const US=[{name:"default",nPerSide:10,unitSpacingScalar:.1,volume:!0},{name:"custom"}],aee=()=>{const{nPerSide:n,unitSpacingScalar:e,volume:t}=dG(),{setNPerSide:r,setUnitSpacingScalar:i,setVolume:s}=fG(),[o,a]=M.useState(US.find(l=>l.name!=="custom"&&l.nPerSide===n&&l.volume===t&&l.unitSpacingScalar===e)??US[0]);return M.useEffect(()=>{o.name!=="custom"&&(r(o.nPerSide),i(o.unitSpacingScalar),s(o.volume))},[o,r,i,s]),N.jsxs("div",{className:"flex w-full flex-col items-start justify-start gap-4",children:[N.jsx(Oi,{children:"Cube Presets"}),N.jsx("div",{className:"flex w-full items-center justify-start gap-2",children:US.map(l=>N.jsx(im,{variant:"ghost","aria-selected":l===o,className:"p-2 aria-selected:bg-primary/20",onClick:()=>a(l),children:l.name},`cube_preset_${l.name}`))}),o.name==="custom"&&N.jsxs(N.Fragment,{children:[N.jsx(zr,{label:"N x Per Side",value:n}),N.jsx(wr,{defaultValue:[n],value:[n],min:3,max:20,step:1,onValueChange:l=>r(l[0])}),N.jsx(zr,{label:"Cube Spacing",value:e.toFixed(2)}),N.jsx(wr,{defaultValue:[e],value:[e],min:0,max:.5,step:.1,onValueChange:l=>i(l[0])}),N.jsxs("div",{className:"flex w-full items-center justify-between",children:[N.jsx(Oi,{children:"Volume"}),N.jsx(el,{defaultChecked:t,onCheckedChange:l=>{s(l)}})]})]})]})},FS=[{name:"default",radius:2,pointSize:.2,mirrorEffects:!1},{name:"custom"}],lee=()=>{const{radius:n,pointSize:e,mirrorEffects:t}=pG(),{setRadius:r,setPointSize:i,setMirrorEffects:s}=mG(),[o,a]=M.useState(FS.find(l=>l.name!=="custom"&&l.pointSize===e&&l.radius===n&&l.mirrorEffects===t)??FS[0]);return M.useEffect(()=>{o.name!=="custom"&&(r(o.radius),i(o.pointSize),s(o.mirrorEffects))},[o,r,i,s]),N.jsxs("div",{className:"flex w-full flex-col items-start justify-start gap-4",children:[N.jsx(Oi,{children:"Diffused Ring Presets"}),N.jsx("div",{className:"flex w-full items-center justify-start gap-2",children:FS.map(l=>N.jsx(im,{variant:"ghost","aria-selected":l===o,className:"p-2 aria-selected:bg-primary/20",onClick:()=>a(l),children:l.name},`sphere_preset_${l.name}`))}),o.name==="custom"&&N.jsxs(N.Fragment,{children:[N.jsx(zr,{label:"Radius",value:n.toFixed(2)}),N.jsx(wr,{defaultValue:[n],value:[n],min:.25,max:3,step:.25,onValueChange:l=>r(l[0])}),N.jsx(zr,{label:"Point Size",value:e.toFixed(2)}),N.jsx(wr,{defaultValue:[e],value:[e],min:.01,max:.25,step:.01,onValueChange:l=>i(l[0])}),N.jsxs("div",{className:"flex w-full items-center justify-between",children:[N.jsx(Oi,{children:"Mirror Effects"}),N.jsx(el,{defaultChecked:t,onCheckedChange:l=>{s(l)}})]})]})]})},zS=[{name:"default",nRows:100,nCols:100,unitSpacingScalar:5},{name:"bands",nRows:5,nCols:200,unitSpacingScalar:1},{name:"custom"}],cee=()=>{const{nCols:n,nRows:e,unitSpacingScalar:t}=yG(),{setNCols:r,setNRows:i,setUnitSpacingScalar:s}=xG(),[o,a]=M.useState(zS.find(l=>l.name!=="custom"&&l.nRows===e&&l.nCols===n&&l.unitSpacingScalar===t)??zS[0]);return M.useEffect(()=>{o.name!=="custom"&&(i(o.nRows),r(o.nCols),s(o.unitSpacingScalar))},[o,r,i,s]),N.jsxs("div",{className:"flex w-full flex-col items-start justify-start gap-4",children:[N.jsx(Oi,{children:"Grid Presets"}),N.jsx("div",{className:"flex w-full items-center justify-start gap-2",children:zS.map(l=>N.jsx(im,{variant:"ghost","aria-selected":l===o,className:"p-2 aria-selected:bg-primary/20",onClick:()=>a(l),children:l.name},`grid_preset_${l.name}`))}),o.name==="custom"&&N.jsxs(N.Fragment,{children:[N.jsx(zr,{label:"N x Rows",value:e}),N.jsx(wr,{defaultValue:[e],value:[e],min:5,max:200,step:5,onValueChange:l=>i(l[0])}),N.jsx(zr,{label:"N x Cols",value:n}),N.jsx(wr,{defaultValue:[n],value:[n],min:5,max:200,step:5,onValueChange:l=>r(l[0])}),N.jsx(zr,{label:"Grid Spacing",value:t.toFixed(2)}),N.jsx(wr,{defaultValue:[t],value:[t],min:1,max:6,step:.5,onValueChange:l=>s(l[0])})]})]})},BS=[{name:"default",radius:2,nPoints:800},{name:"custom"}],uee=()=>{const{radius:n,nPoints:e}=EG(),{setRadius:t,setNPoints:r}=MG(),[i,s]=M.useState(BS.find(o=>o.name!=="custom"&&o.nPoints===e&&o.radius===n)??BS[0]);return M.useEffect(()=>{i.name!=="custom"&&(t(i.radius),r(i.nPoints))},[i,t,r]),N.jsxs("div",{className:"flex w-full flex-col items-start justify-start gap-4",children:[N.jsx(Oi,{children:"Sphere Presets"}),N.jsx("div",{className:"flex w-full items-center justify-start gap-2",children:BS.map(o=>N.jsx(im,{variant:"ghost","aria-selected":o===i,className:"p-2 aria-selected:bg-primary/20",onClick:()=>s(o),children:o.name},`sphere_preset_${o.name}`))}),i.name==="custom"&&N.jsxs(N.Fragment,{children:[N.jsx(zr,{label:"Point Count",value:e}),N.jsx(wr,{defaultValue:[e],value:[e],min:100,max:2e3,step:25,onValueChange:o=>r(o[0])}),N.jsx(zr,{label:"Radius",value:n.toFixed(2)}),N.jsx(wr,{defaultValue:[n],value:[n],min:.25,max:3,step:.25,onValueChange:o=>t(o[0])})]})]})},dee=({palette:n,className:e,...t})=>{const r=Wn.getPalette(n);return N.jsx("div",{className:jt("h-8 w-full rounded-sm",e),style:{background:`linear-gradient(0.25turn, ${r.colors.join(",")})`},...t})},fee=({palette:n,className:e,...t})=>{const r=Wn.getPalette(n);return N.jsx("div",{className:jt("aspect-square cursor-pointer rounded-full transition-all duration-200 ease-in-out hover:ring-2 hover:ring-primary aria-selected:animate-pulse aria-selected:ring-2 aria-selected:ring-primary",e),style:{background:`linear-gradient(45deg, ${r.colors.join(",")})`},...t})},hee=()=>{const{visual:n}=Fc();switch(n){case pn.CUBE:return aee();case pn.GRID:return cee();case pn.SPHERE:return uee();case pn.DIFFUSED_RING:return lee();case pn.RIBBONS:case pn.DNA:case pn.BOXES:case pn.WALK:return null;default:return n}},pee=({children:n})=>{const[e,t]=M.useState(!1),{mode:r}=kc(),{colorBackground:i,paletteTrackEnergy:s}=Fc(),{setColorBackground:o,setPaletteTrackEnergy:a}=hM(),l=YE(),{setPalette:u}=Kd(),{autoOrbitAfterSleepMs:f}=_O(),{setMode:h,setAutoOrbitAfterSleepMs:p}=SO();return N.jsxs(Lk,{open:e,onOpenChange:t,children:[N.jsx(Dk,{asChild:!0,children:n}),N.jsx(Tb,{side:"right",className:"no-scrollbar w-full max-w-full overflow-scroll bg-background/70 sm:w-[540px] sm:max-w-[540px]",children:N.jsxs("div",{className:"space-y-4",children:[N.jsxs("div",{className:"space-y-4",children:[N.jsxs("div",{className:"space-y-2",children:[N.jsx("div",{className:"",children:"Palette"}),N.jsx(dee,{palette:l}),N.jsx("div",{className:"grid w-full grid-cols-4 justify-items-stretch gap-2 sm:grid-cols-6",children:lh.map(m=>N.jsx(fee,{palette:m,onClick:()=>u(m),"aria-selected":m===l},m))})]}),N.jsxs("div",{className:"flex items-center justify-between gap-2",children:[N.jsx(Oi,{children:"Color Background"}),N.jsx(el,{defaultChecked:i,onCheckedChange:m=>{o(m)}})]}),N.jsxs("div",{className:"flex items-center justify-between gap-2",children:[N.jsx(Oi,{children:"Colors Follow Music"}),N.jsx(el,{disabled:r!==Rt.AUDIO,defaultChecked:s,onCheckedChange:m=>{a(m)}})]}),N.jsxs("div",{className:"flex items-center justify-between gap-2",children:[N.jsx(Oi,{children:"Auto Orbit Camera"}),N.jsx(el,{disabled:!a$(r),defaultChecked:f>0,onCheckedChange:m=>{h(m?Do.AUTO_ORBIT:Do.ORBIT_CONTROLS),p(m?3500:0)}})]})]}),N.jsx(Eb,{}),N.jsx("div",{className:"space-y-4",children:N.jsx(hee,{})})]})})]})},mee=({className:n,...e})=>N.jsx(EO,{...e,className:jt("max-h-4/5 w-fit sm:h-fit",n),children:N.jsxs(wO,{className:"snap-y flex-col bg-gradient-to-l sm:snap-x sm:flex-row sm:bg-gradient-to-t",children:[N.jsx(see,{children:N.jsx(U0,{className:"rounded-full",children:N.jsx(XW,{})})}),N.jsx(pee,{children:N.jsx(U0,{className:"rounded-full",children:N.jsx(VW,{})})})]})}),gee=()=>{const{mode:n,showUI:e}=kc(),{setShowUI:t}=eL();return N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"pointer-events-none absolute top-0 flex w-full flex-row items-center justify-end gap-2 p-4",children:N.jsx(el,{defaultChecked:e,className:"pointer-events-auto cursor-pointer",id:"controls-visible",onCheckedChange:r=>{t(r)}})}),e&&N.jsxs("div",{className:"pointer-events-none absolute bottom-0 flex w-full items-end justify-center gap-4 p-4",children:[n!==Rt.AUDIO_SCOPE&&N.jsx(Tq,{className:"sm:max-w-[60%]"}),N.jsx("div",{className:jt({"absolute bottom-24 right-0 sm:static sm:bottom-0":!0}),children:N.jsx(mee,{})})]})]})},vee=n=>{switch(n){case Rt.AUDIO:case Rt.AUDIO_SCOPE:return N.jsx(cG,{mode:n});case Rt.WAVE_FORM:case Rt.NOISE:case Rt.PARTICLE_NOISE:return null;default:return n}},yee=n=>{switch(n){case Rt.AUDIO_SCOPE:return N.jsx(C9,{});case Rt.WAVE_FORM:case Rt.NOISE:case Rt.AUDIO:case Rt.PARTICLE_NOISE:return N.jsx(Mq,{mode:n});default:return n}},xee=()=>{const{mode:n}=kc(),{noteCanvasInteraction:e}=Kd();return N.jsxs("main",{className:"relative h-[100dvh] w-[100dvw] bg-black",children:[N.jsx("div",{className:"absolute h-[100dvh] w-[100dvw]",onMouseDown:e,onTouchStart:e,children:N.jsx(M.Suspense,{fallback:N.jsx("span",{children:"loading..."}),children:yee(n)})}),N.jsx("div",{className:"pointer-events-none absolute h-[100dvh] w-[100dvw]",children:N.jsx(M.Suspense,{fallback:N.jsx("span",{children:"loading..."}),children:vee(n)})}),N.jsx(gee,{})]})};const _ee={theme:"system",setTheme:()=>null},See=M.createContext(_ee);function wee({children:n,defaultTheme:e="dark",storageKey:t="vite-ui-theme",...r}){const[i,s]=M.useState(e);M.useEffect(()=>{const a=window.document.documentElement;a.classList.remove("light","dark"),a.classList.add(i)},[i]);const o={theme:i,setTheme:a=>{localStorage.setItem(t,a),s(a)}};return N.jsx(See.Provider,{...r,value:o,children:n})}const Eee=new aW;yO(document.getElementById("root")).render(N.jsx(M.StrictMode,{children:N.jsx(fW,{client:Eee,children:N.jsx(wee,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:N.jsx(l$,{children:N.jsx(bG,{children:N.jsx(O9,{children:N.jsx(LF,{children:N.jsx(tG,{children:N.jsx(c$,{children:N.jsx(mq,{children:N.jsx(TG,{children:N.jsx(xee,{})})})})})})})})})})})}));export{Ut as $,so as A,Dc as B,Wn as C,ey as D,Vp as E,is as F,sq as G,ch as H,Dh as I,qn as J,br as K,dn as L,_t as M,Gn as N,In as O,Rn as P,Br as Q,Up as R,xq as S,cD as T,ao as U,F as V,gi as W,SE as X,Wa as Y,on as Z,Gd as _,Bc as a,an as a0,Ki as a1,Ti as a2,Cee as a3,nl as a4,HL as a5,yG as a6,Ue as a7,EG as a8,cI as a9,Bu as aA,ko as aB,sy as aC,bh as aD,Bh as aE,DE as aF,qv as aG,ih as aH,Wl as aI,Ur as aJ,Eh as aK,Mh as aL,xc as aM,zh as aN,Yd as aO,Fh as aP,Qr as aQ,Vr as aR,Xp as aS,tD as aT,RH as aU,d4 as aa,h4 as ab,f4 as ac,vi as ad,A1 as ae,jo as af,NI as ag,OI as ah,kI as ai,_I as aj,iI as ak,sn as al,iH as am,uH as an,iy as ao,ro as ap,wh as aq,NE as ar,ni as as,Sy as at,Qt as au,rI as av,go as aw,rl as ax,oI as ay,aI as az,hl as b,Vf as c,dG as d,pG as e,_y as f,A9 as g,k3 as h,Ns as i,N as j,Tee as k,T3 as l,EI as m,Be as n,ge as o,yc as p,$a as q,M as r,Oo as s,Kr as t,YE as u,eo as v,as as w,Wo as x,mo as y,Or as z}; diff --git a/assets/index-162604e9.css b/assets/index-e90e55c1.css similarity index 97% rename from assets/index-162604e9.css rename to assets/index-e90e55c1.css index 283b20cd..a6700485 100644 --- a/assets/index-162604e9.css +++ b/assets/index-e90e55c1.css @@ -1 +1 @@ -#info{position:absolute;pointer-events:none;z-index:10;padding:1.5em;color:#fff;text-shadow:1px 1px black;border-radius:1em}.contrast #info button{border-color:#000}.contrast #info button:hover{background-color:#505050;color:#fff}#info button{color:inherit;cursor:pointer;border:1px solid white;outline:none;background:none;border-radius:3px;padding:.5em 1em;margin-right:.5em;pointer-events:auto;text-shadow:1px 1px black;font-weight:700}#info button:hover{background-color:#b4b4b4;color:#000;text-shadow:none}#info a{pointer-events:auto}#info p:last-child{margin-bottom:0}.contrast #info *,.contrast footer *{text-shadow:none;color:#000}#info h1{font-family:Montserrat,sans-serif;margin-bottom:.5em;font-size:1.5rem}#info h2{font-family:Montserrat,sans-serif;font-size:1rem}#info p{margin-bottom:1em}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}:root{--background: 0 0% 100%;--foreground: 20 14.3% 4.1%;--card: 0 0% 100%;--card-foreground: 20 14.3% 4.1%;--popover: 0 0% 100%;--popover-foreground: 20 14.3% 4.1%;--primary: 24 9.8% 10%;--primary-foreground: 60 9.1% 97.8%;--secondary: 60 4.8% 95.9%;--secondary-foreground: 24 9.8% 10%;--muted: 60 4.8% 95.9%;--muted-foreground: 25 5.3% 44.7%;--accent: 60 4.8% 95.9%;--accent-foreground: 24 9.8% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 60 9.1% 97.8%;--border: 20 5.9% 90%;--input: 20 5.9% 90%;--ring: 20 14.3% 4.1%;--radius: .5rem}.dark{--background: 20 14.3% 4.1%;--foreground: 60 9.1% 97.8%;--card: 20 14.3% 4.1%;--card-foreground: 60 9.1% 97.8%;--popover: 20 14.3% 4.1%;--popover-foreground: 60 9.1% 97.8%;--primary: 60 9.1% 97.8%;--primary-foreground: 24 9.8% 10%;--secondary: 12 6.5% 15.1%;--secondary-foreground: 60 9.1% 97.8%;--muted: 12 6.5% 15.1%;--muted-foreground: 24 5.4% 63.9%;--accent: 12 6.5% 15.1%;--accent-foreground: 60 9.1% 97.8%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 60 9.1% 97.8%;--border: 12 6.5% 15.1%;--input: 12 6.5% 15.1%;--ring: 24 5.7% 82.9%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.bottom-24{bottom:6rem}.left-0{left:0}.left-2{left:.5rem}.right-0{right:0}.right-4{right:1rem}.top-0{top:0}.top-4{top:1rem}.z-50{z-index:50}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mt-2{margin-top:.5rem}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.contents{display:contents}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.size-10{width:2.5rem;height:2.5rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[100dvh\]{height:100dvh}.h-\[1px\]{height:1px}.h-\[24px\]{height:24px}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-px{height:1px}.max-h-36{max-height:9rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-4{width:1rem}.w-5{width:1.25rem}.w-64{width:16rem}.w-72{width:18rem}.w-8{width:2rem}.w-\[100dvw\]{width:100dvw}.w-\[1px\]{width:1px}.w-\[240px\]{width:240px}.w-\[44px\]{width:44px}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-64{max-width:16rem}.max-w-full{max-width:100%}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-none{flex:none}.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-y{scroll-snap-type:y var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness: mandatory}.snap-center{scroll-snap-align:center}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.place-content-center{place-content:center}.place-items-center{place-items:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-items-stretch{justify-items:stretch}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-scroll{overflow:scroll}.overflow-x-scroll{overflow-x:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.rounded-\[6px\]{border-radius:6px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-\[\#4E4E4E\]{--tw-border-opacity: 1;border-color:rgb(78 78 78 / var(--tw-border-opacity))}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.border-transparent{border-color:transparent}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-background{background-color:hsl(var(--background))}.bg-background\/70{background-color:hsl(var(--background) / .7)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-black\/25{background-color:#00000040}.bg-border{background-color:hsl(var(--border))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-transparent{background-color:transparent}.bg-white\/20{background-color:#fff3}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-l{background-image:linear-gradient(to left,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-slate-700{--tw-gradient-from: #334155 var(--tw-gradient-from-position);--tw-gradient-to: rgb(51 65 85 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-white\/10{--tw-gradient-from: rgb(255 255 255 / .1) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-black{--tw-gradient-to: #000 var(--tw-gradient-to-position)}.to-white\/0{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position)}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\[1px\]{padding:1px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pt-16{padding-top:4rem}.text-center{text-align:center}.text-right{text-align:right}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-none{line-height:1}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}@keyframes scale{0%{scale:.25}}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-xs::-moz-placeholder{font-size:.75rem;line-height:1rem}.placeholder\:text-xs::placeholder{font-size:.75rem;line-height:1rem}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-150:hover{--tw-scale-x: 1.5;--tw-scale-y: 1.5;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border:hover{border-width:1px}.hover\:border-white:hover{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-white\/50:hover{background-color:#ffffff80}.hover\:from-slate-500:hover{--tw-gradient-from: #64748b var(--tw-gradient-from-position);--tw-gradient-to: rgb(100 116 139 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-slate-900:hover{--tw-gradient-to: #0f172a var(--tw-gradient-to-position)}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground\/80:hover{color:hsl(var(--foreground) / .8)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:ring-2:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\:ring-primary:hover{--tw-ring-color: hsl(var(--primary))}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}@keyframes pulse{50%{opacity:.5}}.aria-selected\:animate-pulse[aria-selected=true]{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.aria-selected\:border[aria-selected=true]{border-width:1px}.aria-selected\:border-white[aria-selected=true]{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}.aria-selected\:bg-primary\/20[aria-selected=true]{background-color:hsl(var(--primary) / .2)}.aria-selected\:from-slate-100[aria-selected=true]{--tw-gradient-from: #f1f5f9 var(--tw-gradient-from-position);--tw-gradient-to: rgb(241 245 249 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.aria-selected\:to-slate-500[aria-selected=true]{--tw-gradient-to: #64748b var(--tw-gradient-to-position)}.aria-selected\:text-black[aria-selected=true]{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.aria-selected\:text-foreground[aria-selected=true]{color:hsl(var(--foreground))}.aria-selected\:ring-2[aria-selected=true]{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.aria-selected\:ring-primary[aria-selected=true]{--tw-ring-color: hsl(var(--primary))}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:hsl(var(--secondary))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[state\=closed\]\:duration-300[data-state=closed]{transition-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{transition-duration:.5s}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100%}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=closed\]\:duration-300[data-state=closed]{animation-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{animation-duration:.5s}@media (min-width: 640px){.sm\:static{position:static}.sm\:bottom-0{bottom:0}.sm\:flex{display:flex}.sm\:h-fit{height:-moz-fit-content;height:fit-content}.sm\:w-\[540px\]{width:540px}.sm\:max-w-\[540px\]{max-width:540px}.sm\:max-w-sm{max-width:24rem}.sm\:snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.sm\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.sm\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:bg-black\/25{background-color:#00000040}.sm\:bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.sm\:text-left{text-align:left}} +#info{position:absolute;pointer-events:none;z-index:10;padding:1.5em;color:#fff;text-shadow:1px 1px black;border-radius:1em}.contrast #info button{border-color:#000}.contrast #info button:hover{background-color:#505050;color:#fff}#info button{color:inherit;cursor:pointer;border:1px solid white;outline:none;background:none;border-radius:3px;padding:.5em 1em;margin-right:.5em;pointer-events:auto;text-shadow:1px 1px black;font-weight:700}#info button:hover{background-color:#b4b4b4;color:#000;text-shadow:none}#info a{pointer-events:auto}#info p:last-child{margin-bottom:0}.contrast #info *,.contrast footer *{text-shadow:none;color:#000}#info h1{font-family:Montserrat,sans-serif;margin-bottom:.5em;font-size:1.5rem}#info h2{font-family:Montserrat,sans-serif;font-size:1rem}#info p{margin-bottom:1em}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}:root{--background: 0 0% 100%;--foreground: 20 14.3% 4.1%;--card: 0 0% 100%;--card-foreground: 20 14.3% 4.1%;--popover: 0 0% 100%;--popover-foreground: 20 14.3% 4.1%;--primary: 24 9.8% 10%;--primary-foreground: 60 9.1% 97.8%;--secondary: 60 4.8% 95.9%;--secondary-foreground: 24 9.8% 10%;--muted: 60 4.8% 95.9%;--muted-foreground: 25 5.3% 44.7%;--accent: 60 4.8% 95.9%;--accent-foreground: 24 9.8% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 60 9.1% 97.8%;--border: 20 5.9% 90%;--input: 20 5.9% 90%;--ring: 20 14.3% 4.1%;--radius: .5rem}.dark{--background: 20 14.3% 4.1%;--foreground: 60 9.1% 97.8%;--card: 20 14.3% 4.1%;--card-foreground: 60 9.1% 97.8%;--popover: 20 14.3% 4.1%;--popover-foreground: 60 9.1% 97.8%;--primary: 60 9.1% 97.8%;--primary-foreground: 24 9.8% 10%;--secondary: 12 6.5% 15.1%;--secondary-foreground: 60 9.1% 97.8%;--muted: 12 6.5% 15.1%;--muted-foreground: 24 5.4% 63.9%;--accent: 12 6.5% 15.1%;--accent-foreground: 60 9.1% 97.8%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 60 9.1% 97.8%;--border: 12 6.5% 15.1%;--input: 12 6.5% 15.1%;--ring: 24 5.7% 82.9%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.bottom-24{bottom:6rem}.left-0{left:0}.left-2{left:.5rem}.right-0{right:0}.right-4{right:1rem}.top-0{top:0}.top-4{top:1rem}.z-50{z-index:50}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mt-2{margin-top:.5rem}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.contents{display:contents}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.size-10{width:2.5rem;height:2.5rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[100dvh\]{height:100dvh}.h-\[1px\]{height:1px}.h-\[24px\]{height:24px}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-px{height:1px}.max-h-36{max-height:9rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-4{width:1rem}.w-5{width:1.25rem}.w-64{width:16rem}.w-72{width:18rem}.w-8{width:2rem}.w-\[100dvw\]{width:100dvw}.w-\[1px\]{width:1px}.w-\[240px\]{width:240px}.w-\[44px\]{width:44px}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-64{max-width:16rem}.max-w-full{max-width:100%}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-none{flex:none}.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-y{scroll-snap-type:y var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness: mandatory}.snap-center{scroll-snap-align:center}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.place-content-center{place-content:center}.place-items-center{place-items:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-items-stretch{justify-items:stretch}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-scroll{overflow:scroll}.overflow-x-scroll{overflow-x:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.rounded-\[6px\]{border-radius:6px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-\[\#4E4E4E\]{--tw-border-opacity: 1;border-color:rgb(78 78 78 / var(--tw-border-opacity))}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.border-transparent{border-color:transparent}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-background{background-color:hsl(var(--background))}.bg-background\/70{background-color:hsl(var(--background) / .7)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-black\/25{background-color:#00000040}.bg-border{background-color:hsl(var(--border))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-transparent{background-color:transparent}.bg-white\/20{background-color:#fff3}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-l{background-image:linear-gradient(to left,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-slate-700{--tw-gradient-from: #334155 var(--tw-gradient-from-position);--tw-gradient-to: rgb(51 65 85 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-white\/10{--tw-gradient-from: rgb(255 255 255 / .1) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-black{--tw-gradient-to: #000 var(--tw-gradient-to-position)}.to-white\/0{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position)}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\[1px\]{padding:1px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pt-16{padding-top:4rem}.text-center{text-align:center}.text-right{text-align:right}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-none{line-height:1}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}@keyframes scale{0%{scale:.25}}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-xs::-moz-placeholder{font-size:.75rem;line-height:1rem}.placeholder\:text-xs::placeholder{font-size:.75rem;line-height:1rem}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-150:hover{--tw-scale-x: 1.5;--tw-scale-y: 1.5;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border:hover{border-width:1px}.hover\:border-white:hover{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-white\/50:hover{background-color:#ffffff80}.hover\:from-slate-500:hover{--tw-gradient-from: #64748b var(--tw-gradient-from-position);--tw-gradient-to: rgb(100 116 139 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-slate-900:hover{--tw-gradient-to: #0f172a var(--tw-gradient-to-position)}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground\/80:hover{color:hsl(var(--foreground) / .8)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:ring-2:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\:ring-primary:hover{--tw-ring-color: hsl(var(--primary))}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}@keyframes pulse{50%{opacity:.5}}.aria-selected\:animate-pulse[aria-selected=true]{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.aria-selected\:border[aria-selected=true]{border-width:1px}.aria-selected\:border-white[aria-selected=true]{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}.aria-selected\:bg-primary\/20[aria-selected=true]{background-color:hsl(var(--primary) / .2)}.aria-selected\:from-slate-100[aria-selected=true]{--tw-gradient-from: #f1f5f9 var(--tw-gradient-from-position);--tw-gradient-to: rgb(241 245 249 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.aria-selected\:to-slate-500[aria-selected=true]{--tw-gradient-to: #64748b var(--tw-gradient-to-position)}.aria-selected\:text-black[aria-selected=true]{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.aria-selected\:text-foreground[aria-selected=true]{color:hsl(var(--foreground))}.aria-selected\:ring-2[aria-selected=true]{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.aria-selected\:ring-primary[aria-selected=true]{--tw-ring-color: hsl(var(--primary))}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:hsl(var(--secondary))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[state\=closed\]\:duration-300[data-state=closed]{transition-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{transition-duration:.5s}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100%}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=closed\]\:duration-300[data-state=closed]{animation-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{animation-duration:.5s}@media (min-width: 640px){.sm\:static{position:static}.sm\:bottom-0{bottom:0}.sm\:flex{display:flex}.sm\:h-fit{height:-moz-fit-content;height:fit-content}.sm\:w-\[540px\]{width:540px}.sm\:max-w-\[540px\]{max-width:540px}.sm\:max-w-\[60\%\]{max-width:60%}.sm\:max-w-sm{max-width:24rem}.sm\:snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.sm\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.sm\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:bg-black\/25{background-color:#00000040}.sm\:bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.sm\:text-left{text-align:left}} diff --git a/assets/reactive-113ac4c3.js b/assets/reactive-113ac4c3.js deleted file mode 100644 index 75a50344..00000000 --- a/assets/reactive-113ac4c3.js +++ /dev/null @@ -1 +0,0 @@ -import{r as M,S as V,M as v,u as y,C as G,a as L,j as i,B as T,b as Z,G as F,V as Q}from"./index-cf06fcba.js";const S={LINEAR:"LINEAR",QUADRATIC:"QUADRATIC",BEZIER:"BEZIER",PARAMETRIC:"PARAMETRIC"},q=(t,e=S.BEZIER)=>{switch(e){case"LINEAR":return t;case"QUADRATIC":return t<=.5?2*t*t:2*(t-.5)*(1-(t-.5))+.5;case"BEZIER":return t*t*(3-2*t);case"PARAMETRIC":return t*t/(2*(t*t-t)+1);default:return e}},J=(t,e=0,s=1)=>Math.min(s,Math.max(e,t)),O=(t,e,s)=>t+s*(e-t),X=({scalarTracker:t,nBoxes:e=5,gridSize:s=10,cellSize:a=.25})=>{const h=s,m=s,I=M.useMemo(()=>new V(.65,150,2*250),[250]),u=M.useRef(null),R=M.useMemo(()=>new v,[]),D=y(),C=G.getPalette(D).buildLut(),r=M.useMemo(()=>Array.from({length:e},n=>{const c=Math.floor(h*Math.random()),l=Math.floor(m*Math.random());return{fromRow:c,fromCol:l,toRow:c,toCol:l}}),[e,h,m]);return M.useEffect(()=>{for(let n=0;n{if(I.step((t==null?void 0:t.getNormalizedValue())??0)){const[A,E]=Math.random()>.5?[!0,!1]:[!1,!0];for(let o=0;o.5?1:-1),E&&(r[o].toCol+=Math.random()>.5?1:-1)}const n=q(J(I.timeSinceLastEventMs/250)),c=O(Math.PI/4,3*Math.PI/4,n),l=-.5*a*Math.cos(c)/Math.sqrt(2),j=.5*a*Math.sin(c)/Math.sqrt(2);let w,x,p,g,P,d,f;r.forEach(({fromRow:A,fromCol:E,toRow:o,toCol:N},B)=>{d=o-A,f=N-E;const U=A+d*(l+.5),b=E+f*(l+.5);d!==0&&R.makeRotationY((c-Math.PI/4)*d),f!==0&&R.makeRotationX(-(c-Math.PI/4)*f),w=U/(h-1),x=b/(m-1),p=h*a*(w-.5),g=m*a*(x-.5),P=j-a/4,R.setPosition(p,g,P),u.current.setMatrixAt(B,R)}),u.current.instanceMatrix.needsUpdate=!0}),i.jsxs("instancedMesh",{ref:u,castShadow:!0,receiveShadow:!0,args:[new T,new Z,e],children:[i.jsx("boxGeometry",{attach:"geometry",args:[a,a,a,1]}),i.jsx("meshBasicMaterial",{attach:"material",color:"white",toneMapped:!1})]})},z=({scalarTracker:t})=>i.jsxs(i.Fragment,{children:[i.jsx(X,{scalarTracker:t??{getNormalizedValue:()=>Math.sin(.0025*Date.now())+1},nBoxes:200,gridSize:100,cellSize:1}),i.jsx(F,{position:new Q(0,0,-1/2)})]});export{z as default}; diff --git a/assets/reactive-315566b5.js b/assets/reactive-315566b5.js new file mode 100644 index 00000000..92b01185 --- /dev/null +++ b/assets/reactive-315566b5.js @@ -0,0 +1 @@ +import{r as u,S as G,M as B,u as U,C as q,a as F,j as n,B as J,b as L,G as N,V as S}from"./index-bce4be0d.js";import{e as X,c as Y,l as O}from"./easing-a3fe9c65.js";const _=({scalarTracker:i,nBoxes:e=5,gridSize:x=10,cellSize:o=.25})=>{const M=x,m=x,g=u.useMemo(()=>new G(.65,150,2*250),[250]),c=u.useRef(null),h=u.useMemo(()=>new B,[]),E=U(),C=q.getPalette(E).buildLut(),a=u.useMemo(()=>Array.from({length:e},s=>{const r=Math.floor(M*Math.random()),l=Math.floor(m*Math.random());return{fromRow:r,fromCol:l,toRow:r,toCol:l}}),[e,M,m]);return u.useEffect(()=>{for(let s=0;s{if(g.step((i==null?void 0:i.getNormalizedValue())??0)){const[w,p]=Math.random()>.5?[!0,!1]:[!1,!0];for(let t=0;t.5?1:-1),p&&(a[t].toCol+=Math.random()>.5?1:-1)}const s=X(Y(g.timeSinceLastEventMs/250)),r=O(Math.PI/4,3*Math.PI/4,s),l=-.5*o*Math.cos(r)/Math.sqrt(2),I=.5*o*Math.sin(r)/Math.sqrt(2);let R,j,P,b,D,d,f;a.forEach(({fromRow:w,fromCol:p,toRow:t,toCol:V},v)=>{d=t-w,f=V-p;const y=w+d*(l+.5),A=p+f*(l+.5);d!==0&&h.makeRotationY((r-Math.PI/4)*d),f!==0&&h.makeRotationX(-(r-Math.PI/4)*f),R=y/(M-1),j=A/(m-1),P=M*o*(R-.5),b=m*o*(j-.5),D=I-o/4,h.setPosition(P,b,D),c.current.setMatrixAt(v,h)}),c.current.instanceMatrix.needsUpdate=!0}),n.jsxs("instancedMesh",{ref:c,castShadow:!0,receiveShadow:!0,args:[new J,new L,e],children:[n.jsx("boxGeometry",{attach:"geometry",args:[o,o,o,1]}),n.jsx("meshBasicMaterial",{attach:"material",color:"white",toneMapped:!1})]})},Q=({scalarTracker:i})=>n.jsxs(n.Fragment,{children:[n.jsx(_,{scalarTracker:i??{getNormalizedValue:()=>Math.sin(.0025*Date.now())+1},nBoxes:200,gridSize:100,cellSize:1}),n.jsx(N,{position:new S(0,0,-1/2)})]});export{Q as default}; diff --git a/assets/reactive-8030d939.js b/assets/reactive-48384246.js similarity index 96% rename from assets/reactive-8030d939.js rename to assets/reactive-48384246.js index c8ca5f40..c061a679 100644 --- a/assets/reactive-8030d939.js +++ b/assets/reactive-48384246.js @@ -1 +1 @@ -import{r as s,a7 as M,V as _,u as D,C as F,j as e,v as L,a as V,c as z}from"./index-cf06fcba.js";function B(u,r){const h=u+"Geometry";return s.forwardRef(({args:i,children:a,...j},d)=>{const o=s.useRef(null);return s.useImperativeHandle(d,()=>o.current),s.useLayoutEffect(()=>void(r==null?void 0:r(o.current))),s.createElement("mesh",M({ref:o},j),s.createElement(h,{attach:"geometry",args:i}),a)})}const p=B("plane"),N=({coordinateMapper:u,ribbonWidth:r=1,ribbonHeight:h=10,ribbonWidthSegments:i=1,ribbonHeightSegments:a=64,zScale:j=2})=>{const d=[s.useRef(null),s.useRef(null),s.useRef(null),s.useRef(null),s.useRef(null)],o=d.length,w=r*o/2,n=h/2,T=Array.from({length:o}).map((m,l)=>new _(w-r*l-r/2,0,0)),A=D(),R=F.getPalette(A),f=s.useMemo(()=>e.jsx("meshStandardMaterial",{color:R.colorsHex[Math.floor(R.nColors/2)],roughness:.25,metalness:.25,side:L,flatShading:!1}),[R]);V(({clock:m})=>{const l=m.getElapsedTime();let x,c,E,g,v,S,P;d.forEach((y,I)=>{if(!y.current)return;const C=y.current.geometry.attributes.position;for(c=0;c<=a;c++)for(P=1-Math.abs(c-a/2)/(a/2),x=0;x<=i;x++)g=(I+.5)/o,v=(c+.5)/a,E=c*(i+1)+x,S=j*u.map(z.CARTESIAN_2D,g,v,0,l),C.setZ(E,S*P);C.needsUpdate=!0})});const t=250;return e.jsxs(e.Fragment,{children:[e.jsx("ambientLight",{}),e.jsx("pointLight",{position:[2,2,5],intensity:150}),e.jsx(p,{args:[t/2,t,1,1],position:[w+t/4,0,0],castShadow:!0,receiveShadow:!0,children:f}),e.jsx(p,{args:[t/2,t,1,1],position:[-w-t/4,0,0],castShadow:!0,receiveShadow:!0,children:f}),e.jsx(p,{args:[t/4,t/2-n,1,1],position:[0,-n-(t/2-n)/2,0],castShadow:!0,receiveShadow:!0,children:f}),e.jsx(p,{args:[t/4,t/2-n,1,1],position:[0,n+(t/2-n)/2,0],castShadow:!0,receiveShadow:!0,children:f}),d.map((m,l)=>e.jsx(p,{args:[r,h,i,a],ref:m,position:T[l],castShadow:!0,receiveShadow:!0,children:f},`ribbon-plane-${l}`))]})},Y=({coordinateMapper:u})=>e.jsx(e.Fragment,{children:e.jsx(N,{coordinateMapper:u})});export{Y as default}; +import{r as s,a7 as M,V as _,u as D,C as F,j as e,v as L,a as V,c as z}from"./index-bce4be0d.js";function B(u,r){const h=u+"Geometry";return s.forwardRef(({args:i,children:a,...j},d)=>{const o=s.useRef(null);return s.useImperativeHandle(d,()=>o.current),s.useLayoutEffect(()=>void(r==null?void 0:r(o.current))),s.createElement("mesh",M({ref:o},j),s.createElement(h,{attach:"geometry",args:i}),a)})}const p=B("plane"),N=({coordinateMapper:u,ribbonWidth:r=1,ribbonHeight:h=10,ribbonWidthSegments:i=1,ribbonHeightSegments:a=64,zScale:j=2})=>{const d=[s.useRef(null),s.useRef(null),s.useRef(null),s.useRef(null),s.useRef(null)],o=d.length,w=r*o/2,n=h/2,T=Array.from({length:o}).map((m,l)=>new _(w-r*l-r/2,0,0)),A=D(),R=F.getPalette(A),f=s.useMemo(()=>e.jsx("meshStandardMaterial",{color:R.colorsHex[Math.floor(R.nColors/2)],roughness:.25,metalness:.25,side:L,flatShading:!1}),[R]);V(({clock:m})=>{const l=m.getElapsedTime();let x,c,E,g,v,S,P;d.forEach((y,I)=>{if(!y.current)return;const C=y.current.geometry.attributes.position;for(c=0;c<=a;c++)for(P=1-Math.abs(c-a/2)/(a/2),x=0;x<=i;x++)g=(I+.5)/o,v=(c+.5)/a,E=c*(i+1)+x,S=j*u.map(z.CARTESIAN_2D,g,v,0,l),C.setZ(E,S*P);C.needsUpdate=!0})});const t=250;return e.jsxs(e.Fragment,{children:[e.jsx("ambientLight",{}),e.jsx("pointLight",{position:[2,2,5],intensity:150}),e.jsx(p,{args:[t/2,t,1,1],position:[w+t/4,0,0],castShadow:!0,receiveShadow:!0,children:f}),e.jsx(p,{args:[t/2,t,1,1],position:[-w-t/4,0,0],castShadow:!0,receiveShadow:!0,children:f}),e.jsx(p,{args:[t/4,t/2-n,1,1],position:[0,-n-(t/2-n)/2,0],castShadow:!0,receiveShadow:!0,children:f}),e.jsx(p,{args:[t/4,t/2-n,1,1],position:[0,n+(t/2-n)/2,0],castShadow:!0,receiveShadow:!0,children:f}),d.map((m,l)=>e.jsx(p,{args:[r,h,i,a],ref:m,position:T[l],castShadow:!0,receiveShadow:!0,children:f},`ribbon-plane-${l}`))]})},Y=({coordinateMapper:u})=>e.jsx(e.Fragment,{children:e.jsx(N,{coordinateMapper:u})});export{Y as default}; diff --git a/assets/reactive-2fe6b979.js b/assets/reactive-6bccba52.js similarity index 99% rename from assets/reactive-2fe6b979.js rename to assets/reactive-6bccba52.js index bfbdddac..658703a3 100644 --- a/assets/reactive-2fe6b979.js +++ b/assets/reactive-6bccba52.js @@ -1 +1 @@ -import{r as d,g as Y,a9 as O,V as P,o as C,a as X,c as Z,j as c,G as _}from"./index-cf06fcba.js";const L=d.createContext(null);function M(){const y=d.useContext(L);if(!y)throw new Error("useStencilVisualConfigContext must be used within a StencilVisualConfigContextProvider");return y.config}const U=(y,s=!1)=>{const t=y.length,o=new Array;for(let e=0;e{const D=Array.from({length:r}).map(Y),m=s.map(f=>new O(f.map(n=>new P(n.x,n.y,0).multiplyScalar(25)),!1,"catmullrom",0).getSpacedPoints(r)),B=m.map(f=>U(f.map(n=>new C(n.x,n.y)))),E=d.useRef(null),h=d.useRef(null);d.useLayoutEffect(()=>{h.current&&h.current.setFromPoints(m[0])},[h,m]);const z=l*s.length;return X(({clock:f})=>{const n=f.getElapsedTime(),G=n%z/z,p=Math.floor(G*s.length),V=p+1>=s.length?0:p+1,F=n%l/l,j=m[p],A=m[V],N=B[p],R=B[V];let i,w;const g=new P,b=new P,S=E.current.geometry.attributes.position;for(let x=0;xo){S.setXYZ(x,0,0,0);continue}i=a*y.map(Z.CARTESIAN_1D,(w-t)/Math.abs(o-t),0,0,n),e&&(i*=D[x]),g.set(j[x].x+i*N[x].x,j[x].y+i*N[x].y,j[x].z),p!==V&&(b.set(A[x].x+i*R[x].x,A[x].y+i*R[x].y,A[x].z),g.lerp(b,F)),S.setXYZ(x,g.x,g.y,g.z)}S.needsUpdate=!0}),c.jsxs("points",{ref:E,children:[c.jsx("bufferGeometry",{attach:"geometry",ref:h}),c.jsx("pointsMaterial",{attach:"material",size:u})]})},I=()=>[new C(-.5,.5),new C(.5,-.5)],k=[{x:0,y:0},{x:0,y:.6203703880310059},{x:.0029761905316263437,y:.6256613731384277},{x:0,y:.6289682388305664},{x:0,y:.6937830448150635},{x:.0034722222480922937,y:.6977513432502747},{x:0,y:.7017195820808411},{x:.004464285913854837,y:.7003968358039856},{x:.010416666977107525,y:.695105791091919},{x:.01686508022248745,y:.6957672238349915},{x:.0243055559694767,y:.7023809552192688},{x:.0252976194024086,y:.7109788656234741},{x:.0292658731341362,y:.7136243581771851},{x:.02976190485060215,y:.704365074634552},{x:.0272817462682724,y:.6990740895271301},{x:.03125,y:.6944444179534912},{x:.0396825410425663,y:.6944444179534912},{x:.0416666679084301,y:.6917989253997803},{x:.0520833320915699,y:.6911375522613525},{x:.0545634925365448,y:.695105791091919},{x:.0530753955245018,y:.6984127163887024},{x:.0565476194024086,y:.695105791091919},{x:.0615079365670681,y:.6970899701118469},{x:.0634920671582222,y:.6931216716766357},{x:.0620039664208889,y:.6904761791229248},{x:.0620039664208889,y:.6832010746002197},{x:.0634920671582222,y:.6812169551849365},{x:.0620039664208889,y:.6759259104728699},{x:.0694444477558136,y:.6712962985038757},{x:.0773809552192688,y:.6600528955459595},{x:.083829365670681,y:.6626983880996704},{x:.085317462682724,y:.6666666865348816},{x:.0868055522441864,y:.6560846567153931},{x:.092261902987957,y:.6554232835769653},{x:.09375,y:.6567460298538208},{x:.09375,y:.6607142686843872},{x:.0962301567196846,y:.6580687761306763},{x:.1011904776096344,y:.6600528955459595},{x:.1016865074634552,y:.6626983880996704},{x:.0997023805975914,y:.6660053133964539},{x:.105158731341362,y:.6646825671195984},{x:.1125992089509964,y:.6693121790885925},{x:.1160714253783226,y:.6567460298538208},{x:.1185515895485878,y:.6580687761306763},{x:.1200396791100502,y:.6560846567153931},{x:.1210317462682724,y:.6600528955459595},{x:.1240079328417778,y:.6560846567153931},{x:.1269841343164444,y:.6580687761306763},{x:.1269841343164444,y:.6620370149612427},{x:.1289682537317276,y:.6600528955459595},{x:.1324404776096344,y:.6626983880996704},{x:.1314484179019928,y:.670634925365448},{x:.133432537317276,y:.6732804179191589},{x:.133432537317276,y:.6785714030265808},{x:.1274801641702652,y:.6785714030265808},{x:.1269841343164444,y:.6805555820465088},{x:.1329365074634552,y:.6805555820465088},{x:.1339285671710968,y:.6792327761650085},{x:.1398809552192688,y:.679894208908081},{x:.1398809552192688,y:.6812169551849365},{x:.1408730149269104,y:.679894208908081},{x:.1453372985124588,y:.679894208908081},{x:.1512896865606308,y:.6759259104728699},{x:.153273805975914,y:.6792327761650085},{x:.15625,y:.6752645373344421},{x:.159226194024086,y:.679894208908081},{x:.16170634329319,y:.6792327761650085},{x:.164682537317276,y:.6818783283233643},{x:.1641865074634552,y:.6838624477386475},{x:.162202388048172,y:.6832010746002197},{x:.1631944477558136,y:.6878306865692139},{x:.16170634329319,y:.6898148059844971},{x:.1626984179019928,y:.6898148059844971},{x:.1666666716337204,y:.6832010746002197},{x:.1681547611951828,y:.682539701461792},{x:.1691468209028244,y:.6838624477386475},{x:.1656745970249176,y:.6898148059844971},{x:.1721230149269104,y:.6898148059844971},{x:.170634925365448,y:.695105791091919},{x:.1750992089509964,y:.6984127163887024},{x:.1746031790971756,y:.7017195820808411},{x:.176091268658638,y:.704365074634552},{x:.1770833283662796,y:.7017195820808411},{x:.179067462682724,y:.7003968358039856},{x:.181547611951828,y:.7010582089424133},{x:.1855158656835556,y:.6964285969734192},{x:.1870039701461792,y:.6970899701118469},{x:.1825396865606308,y:.7056878209114075},{x:.181547611951828,y:.7169312238693237},{x:.1865079402923584,y:.7142857313156128},{x:.1865079402923584,y:.7103174328804016},{x:.1884920597076416,y:.7103174328804016},{x:.1894841343164444,y:.7083333134651184},{x:.1969245970249176,y:.7096560597419739},{x:.1924603134393692,y:.7050264477729797},{x:.1884920597076416,y:.7050264477729797},{x:.1884920597076416,y:.7030423283576965},{x:.1914682537317276,y:.6984127163887024},{x:.1964285671710968,y:.6977513432502747},{x:.1979166716337204,y:.6990740895271301},{x:.2013888955116272,y:.6957672238349915},{x:.2063492089509964,y:.6851851940155029},{x:.2033730149269104,y:.6838624477386475},{x:.2003968209028244,y:.6865079402923584},{x:.1974206417798996,y:.6812169551849365},{x:.198908731341362,y:.6752645373344421},{x:.1924603134393692,y:.6699735522270203},{x:.1830357164144516,y:.6746031641960144},{x:.1830357164144516,y:.670634925365448},{x:.1894841343164444,y:.6653439402580261},{x:.181547611951828,y:.6666666865348816},{x:.18204365670681,y:.6633597612380981},{x:.1795634925365448,y:.6600528955459595},{x:.1795634925365448,y:.6567460298538208},{x:.1855158656835556,y:.6534391641616821},{x:.1855158656835556,y:.6461640000343323},{x:.1875,y:.6441798806190491},{x:.1884920597076416,y:.6382275223731995},{x:.195932537317276,y:.6296296119689941},{x:.2008928507566452,y:.6269841194152832},{x:.201884925365448,y:.6283068656921387},{x:.2038690447807312,y:.6256613731384277},{x:.2048611044883728,y:.6289682388305664},{x:.2063492089509964,y:.6243386268615723},{x:.210317462682724,y:.625},{x:.2118055522441864,y:.6309523582458496},{x:.2137896865606308,y:.6316137313842773},{x:.2147817462682724,y:.6256613731384277},{x:.2177579402923584,y:.6230158805847168},{x:.224702388048172,y:.625},{x:.224702388048172,y:.6230158805847168},{x:.2142857164144516,y:.6091269850730896},{x:.2147817462682724,y:.6071428656578064},{x:.2172619104385376,y:.6091269850730896},{x:.2172619104385376,y:.6071428656578064},{x:.2118055522441864,y:.5998677015304565},{x:.212797611951828,y:.5972222089767456},{x:.224702388048172,y:.5919312238693237},{x:.227182537317276,y:.5932539701461792},{x:.2286706417798996,y:.591269850730896},{x:.2321428507566452,y:.5972222089767456},{x:.2425595223903656,y:.5965608358383179},{x:.2480158656835556,y:.6025132536888123},{x:.2544642984867096,y:.60317462682724},{x:.2554563581943512,y:.6044973731040955},{x:.2539682686328888,y:.6183862686157227},{x:.255952388048172,y:.6177248954772949},{x:.2564484179019928,y:.6124338507652283},{x:.2599206268787384,y:.6097883582115173},{x:.2599206268787384,y:.6064814925193787},{x:.26091268658638,y:.6078042387962341},{x:.2633928656578064,y:.6071428656578064},{x:.2673611044883728,y:.6117724776268005},{x:.2713293731212616,y:.6058201193809509},{x:.2743055522441864,y:.6084656119346619},{x:.2738095223903656,y:.6150793433189392},{x:.2777777910232544,y:.6084656119346619},{x:.2802579402923584,y:.6071428656578064},{x:.2842261791229248,y:.6111111044883728},{x:.2876984179019928,y:.6117724776268005},{x:.2891865074634552,y:.6144179701805115},{x:.2881944477558136,y:.6164020895957947},{x:.29216268658638,y:.6137565970420837},{x:.293154776096344,y:.6097883582115173},{x:.2951388955116272,y:.6137565970420837},{x:.2976190447807312,y:.613095223903656},{x:.2986111044883728,y:.6150793433189392},{x:.3020833432674408,y:.6104497313499451},{x:.3055555522441864,y:.6144179701805115},{x:.304067462682724,y:.6177248954772949},{x:.3075396716594696,y:.6190476417541504},{x:.3090277910232544,y:.6111111044883728},{x:.3139880895614624,y:.6150793433189392},{x:.3199404776096344,y:.6084656119346619},{x:.3194444477558136,y:.6064814925193787},{x:.3164682686328888,y:.6044973731040955},{x:.314980149269104,y:.6051587462425232},{x:.3125,y:.6025132536888123},{x:.3115079402923584,y:.5992063283920288},{x:.3000991940498352,y:.5952380895614624},{x:.3010912835597992,y:.5939153432846069},{x:.3050595223903656,y:.5939153432846069},{x:.3020833432674408,y:.5853174328804016},{x:.3035714328289032,y:.5846560597419739},{x:.3050595223903656,y:.5873016119003296},{x:.3070436418056488,y:.5866402387619019},{x:.3090277910232544,y:.5767195820808411},{x:.3129960298538208,y:.5806878209114075},{x:.3144841194152832,y:.5773809552192688},{x:.3169642984867096,y:.5813491940498352},{x:.318452388048172,y:.5800264477729797},{x:.3224206268787384,y:.5853174328804016},{x:.3229166567325592,y:.5833333134651184},{x:.320932537317276,y:.5820105671882629},{x:.320932537317276,y:.5800264477729797},{x:.324404776096344,y:.579365074634552},{x:.3249008059501648,y:.5826719403266907},{x:.3253968358039856,y:.579365074634552},{x:.3239087164402008,y:.5773809552192688},{x:.3273809552192688,y:.5727513432502747},{x:.3308531641960144,y:.5753968358039856},{x:.3323412835597992,y:.5734127163887024},{x:.3373015820980072,y:.579365074634552},{x:.3417658805847168,y:.5780423283576965},{x:.346230149269104,y:.5833333134651184},{x:.349702388048172,y:.5800264477729797},{x:.349702388048172,y:.5740740895271301},{x:.3511904776096344,y:.5760582089424133},{x:.355654776096344,y:.5727513432502747},{x:.3571428656578064,y:.5767195820808411},{x:.358134925365448,y:.5734127163887024},{x:.3601190447807312,y:.5773809552192688},{x:.3596230149269104,y:.5826719403266907},{x:.3655754029750824,y:.5767195820808411},{x:.3685515820980072,y:.5773809552192688},{x:.3695436418056488,y:.579365074634552},{x:.3695436418056488,y:.5899471044540405},{x:.3660714328289032,y:.5952380895614624},{x:.3764880895614624,y:.5833333134651184},{x:.377480149269104,y:.5727513432502747},{x:.3794642984867096,y:.5720899701118469},{x:.3814484179019928,y:.5753968358039856},{x:.3854166567325592,y:.5727513432502747},{x:.3913690447807312,y:.5667989253997803},{x:.4007936418056488,y:.5529100298881531},{x:.4042658805847168,y:.5515872836112976},{x:.408730149269104,y:.5469576716423035},{x:.408730149269104,y:.5436508059501648},{x:.4032738208770752,y:.5416666865348816},{x:.4047619104385376,y:.5370370149612427},{x:.4112103283405304,y:.533730149269104},{x:.4201388955116272,y:.5343915224075317},{x:.44841268658638,y:.5026454925537109},{x:.4563491940498352,y:.4960317313671112},{x:.462797611951828,y:.48743385076522827},{x:.47966268658638,y:.47156083583831787},{x:.4766865074634552,y:.4642857015132904},{x:.4756944477558136,y:.43121692538261414},{x:.480654776096344,y:.4126984179019928},{x:.4801587164402008,y:.3968254029750824},{x:.4826388955116272,y:.39550265669822693},{x:.4866071343421936,y:.3988095223903656},{x:.4935515820980072,y:.3988095223903656},{x:.4990079402923584,y:.3948412835597992},{x:.4990079402923584,y:.41402116417884827},{x:.5029761791229248,y:.43716931343078613},{x:.5029761791229248,y:.454365074634552},{x:.5004960298538208,y:.47486773133277893},{x:.4955357015132904,y:.48544973134994507},{x:.4945436418056488,y:.49669313430786133},{x:.4925595223903656,y:.49933862686157227},{x:.4875991940498352,y:.49933862686157227},{x:.4846230149269104,y:.4841269850730896},{x:.480654776096344,y:.47883597016334534},{x:.4781745970249176,y:.4801587164402008},{x:.4751984179019928,y:.48478835821151733},{x:.474702388048172,y:.48875662684440613},{x:.4697420597076416,y:.4900793731212616},{x:.4702380895614624,y:.49867725372314453},{x:.4657738208770752,y:.5072751045227051},{x:.462797611951828,y:.5066137313842773},{x:.4613095223903656,y:.49933862686157227},{x:.4449404776096344,y:.5171957612037659},{x:.4449404776096344,y:.5224867463111877},{x:.4409722089767456,y:.5224867463111877},{x:.4379960298538208,y:.5244709253311157},{x:.42658731341362,y:.5370370149612427},{x:.4236111044883728,y:.5410053133964539},{x:.4236111044883728,y:.5462962985038757},{x:.4191468358039856,y:.5542327761650085},{x:.414682537317276,y:.5562169551849365},{x:.4126984179019928,y:.5535714030265808},{x:.4097222089767456,y:.5568783283233643},{x:.4092261791229248,y:.5641534328460693},{x:.4057539701461792,y:.5634920597076416},{x:.4027777910232544,y:.5661375522613525},{x:.4042658805847168,y:.5720899701118469},{x:.4027777910232544,y:.5853174328804016},{x:.4042658805847168,y:.5919312238693237},{x:.4032738208770752,y:.5992063283920288},{x:.4042658805847168,y:.5998677015304565},{x:.4057539701461792,y:.5978835821151733},{x:.4077380895614624,y:.6005290746688843},{x:.4032738208770752,y:.6025132536888123},{x:.4027777910232544,y:.6097883582115173},{x:.4052579402923584,y:.613095223903656},{x:.4022817313671112,y:.6164020895957947},{x:.4007936418056488,y:.6150793433189392},{x:.4012896716594696,y:.6117724776268005},{x:.3988095223903656,y:.6144179701805115},{x:.39533731341362,y:.6137565970420837},{x:.3983134925365448,y:.6111111044883728},{x:.3993055522441864,y:.6078042387962341},{x:.3983134925365448,y:.5925925970077515},{x:.4012896716594696,y:.5839946866035461},{x:.4007936418056488,y:.5687830448150635},{x:.391865074634552,y:.5787037014961243},{x:.3933531641960144,y:.5826719403266907},{x:.3923611044883728,y:.5873016119003296},{x:.39533731341362,y:.5879629850387573},{x:.394345223903656,y:.5939153432846069},{x:.391865074634552,y:.5952380895614624},{x:.3903769850730896,y:.60317462682724},{x:.3923611044883728,y:.6051587462425232},{x:.3928571343421936,y:.613095223903656},{x:.39533731341362,y:.6144179701805115},{x:.3938491940498352,y:.6157407164573669},{x:.39533731341362,y:.6216931343078613},{x:.397817462682724,y:.6256613731384277},{x:.4007936418056488,y:.6230158805847168},{x:.4027777910232544,y:.625},{x:.4007936418056488,y:.6283068656921387},{x:.4027777910232544,y:.6335979104042053},{x:.4052579402923584,y:.6316137313842773},{x:.4092261791229248,y:.6223545074462891},{x:.4156745970249176,y:.6236772537231445},{x:.41716268658638,y:.6296296119689941},{x:.418154776096344,y:.6269841194152832},{x:.4166666567325592,y:.6236772537231445},{x:.4201388955116272,y:.6183862686157227},{x:.4201388955116272,y:.6170634627342224},{x:.4196428656578064,y:.6164020895957947},{x:.4191468358039856,y:.6150793433189392},{x:.4191468358039856,y:.6170634627342224},{x:.41716268658638,y:.6170634627342224},{x:.4102182686328888,y:.6117724776268005},{x:.40625,y:.6124338507652283},{x:.4107142984867096,y:.6044973731040955},{x:.4102182686328888,y:.5992063283920288},{x:.4077380895614624,y:.5985449552536011},{x:.4072420597076416,y:.5965608358383179},{x:.4107142984867096,y:.5972222089767456},{x:.4131944477558136,y:.5958994626998901},{x:.4166666567325592,y:.5972222089767456},{x:.4201388955116272,y:.5932539701461792},{x:.423115074634552,y:.5925925970077515},{x:.4246031641960144,y:.5945767164230347},{x:.4241071343421936,y:.5972222089767456},{x:.42658731341362,y:.5965608358383179},{x:.4270833432674408,y:.5978835821151733},{x:.4260912835597992,y:.5992063283920288},{x:.4241071343421936,y:.5985449552536011},{x:.4226190447807312,y:.6025132536888123},{x:.4335317313671112,y:.6038359999656677},{x:.4414682686328888,y:.601190447807312},{x:.4479166567325592,y:.6038359999656677},{x:.4508928656578064,y:.6084656119346619},{x:.4533730149269104,y:.60317462682724},{x:.456845223903656,y:.6064814925193787},{x:.4618055522441864,y:.6078042387962341},{x:.4632936418056488,y:.6111111044883728},{x:.462797611951828,y:.6177248954772949},{x:.4598214328289032,y:.6203703880310059},{x:.4583333432674408,y:.625},{x:.462797611951828,y:.6197090148925781},{x:.4657738208770752,y:.6197090148925781},{x:.471230149269104,y:.6289682388305664},{x:.4707341194152832,y:.6302909851074219},{x:.4707341194152832,y:.6329365372657776},{x:.4717261791229248,y:.6302909851074219},{x:.474702388048172,y:.6309523582458496},{x:.4786706268787384,y:.6355820298194885},{x:.47966268658638,y:.6342592835426331},{x:.4836309552192688,y:.6355820298194885},{x:.4895833432674408,y:.6421957612037659},{x:.4895833432674408,y:.648809552192688},{x:.4841269850730896,y:.6547619104385376},{x:.4841269850730896,y:.6580687761306763},{x:.4875991940498352,y:.6554232835769653},{x:.48908731341362,y:.6560846567153931},{x:.4980158805847168,y:.6699735522270203},{x:.502480149269104,y:.6792327761650085},{x:.502480149269104,y:.6832010746002197},{x:.5054563283920288,y:.6871693134307861},{x:.507440447807312,y:.7010582089424133},{x:.5044642686843872,y:.7050264477729797},{x:.5039682388305664,y:.7103174328804016},{x:.5014880895614624,y:.7076719403266907},{x:.497519850730896,y:.7076719403266907},{x:.5009920597076416,y:.7142857313156128},{x:.5,y:.7175925970077515},{x:.4970238208770752,y:.7175925970077515},{x:.4965277910232544,y:.7189153432846069},{x:.4965277910232544,y:.7208994626998901},{x:.5004960298538208,y:.7248677015304565},{x:.4990079402923584,y:.7288359999656677},{x:.4960317313671112,y:.7301587462425232},{x:.497519850730896,y:.7400793433189392},{x:.494047611951828,y:.7453703880310059},{x:.488095223903656,y:.7466931343078613},{x:.4826388955116272,y:.7552909851074219},{x:.4826388955116272,y:.7572751045227051},{x:.488095223903656,y:.7566137313842773},{x:.4895833432674408,y:.761904776096344},{x:.4910714328289032,y:.7625661492347717},{x:.48908731341362,y:.7711640000343323},{x:.4905754029750824,y:.7843915224075317},{x:.4945436418056488,y:.7870370149612427},{x:.4955357015132904,y:.7923280596733093},{x:.497519850730896,y:.7936508059501648},{x:.5004960298538208,y:.8009259104728699},{x:.5004960298538208,y:.807539701461792},{x:.4960317313671112,y:.8134920597076416},{x:.4995039701461792,y:.8148148059844971},{x:.4990079402923584,y:.8220899701118469},{x:.5019841194152832,y:.8359788656234741},{x:.5,y:.8432539701461792},{x:.4905754029750824,y:.8406084775924683},{x:.4920634925365448,y:.8432539701461792},{x:.4925595223903656,y:.8518518805503845},{x:.4910714328289032,y:.8544973731040955},{x:.4920634925365448,y:.85317462682724},{x:.4930555522441864,y:.8544973731040955},{x:.494047611951828,y:.8650793433189392},{x:.4905754029750824,y:.8657407164573669},{x:.4900793731212616,y:.8697090148925781},{x:.4920634925365448,y:.8723545074462891},{x:.4851190447807312,y:.875},{x:.4846230149269104,y:.8776454925537109},{x:.4905754029750824,y:.8796296119689941},{x:.494047611951828,y:.8835979104042053},{x:.5,y:.8829365372657776},{x:.5009920597076416,y:.8842592835426331},{x:.502480149269104,y:.8822751045227051},{x:.504960298538208,y:.8829365372657776},{x:.5084325671195984,y:.8888888955116272},{x:.5104166865348816,y:.8862434029579163},{x:.5124008059501648,y:.886904776096344},{x:.5104166865348816,y:.8961640000343323},{x:.5114087462425232,y:.8974867463111877},{x:.5128968358039856,y:.8941798806190491},{x:.5133928656578064,y:.9001322984695435},{x:.5109127163887024,y:.9041005373001099},{x:.507440447807312,y:.9034391641616821},{x:.5054563283920288,y:.9120370149612427},{x:.50942462682724,y:.9093915224075317},{x:.5163690447807312,y:.8994709253311157},{x:.5188491940498352,y:.9034391641616821},{x:.5213293433189392,y:.8822751045227051},{x:.528769850730896,y:.8829365372657776},{x:.5277777910232544,y:.8849206566810608},{x:.5243055820465088,y:.8842592835426331},{x:.5233134627342224,y:.8855820298194885},{x:.5233134627342224,y:.8882275223731995},{x:.526289701461792,y:.8882275223731995},{x:.5252976417541504,y:.8908730149269104},{x:.528769850730896,y:.8888888955116272},{x:.5282738208770752,y:.8875661492347717},{x:.5302579402923584,y:.886904776096344},{x:.53125,y:.8835979104042053},{x:.5352182388305664,y:.8829365372657776},{x:.54067462682724,y:.8908730149269104},{x:.54067462682724,y:.8961640000343323},{x:.5426587462425232,y:.8935185074806213},{x:.5451388955116272,y:.8941798806190491},{x:.5500991940498352,y:.9027777910232544},{x:.5515872836112976,y:.9107142686843872},{x:.550595223903656,y:.9140211343765259},{x:.5515872836112976,y:.9120370149612427},{x:.5545634627342224,y:.9160053133964539},{x:.5610119104385376,y:.9153439402580261},{x:.5615079402923584,y:.9166666865348816},{x:.5634920597076416,y:.9140211343765259},{x:.5610119104385376,y:.9113756418228149},{x:.5615079402923584,y:.9093915224075317},{x:.5669642686843872,y:.9100528955459595},{x:.5689483880996704,y:.9133597612380981},{x:.5669642686843872,y:.9232804179191589},{x:.5724206566810608,y:.9272486567497253},{x:.5749008059501648,y:.9265872836112976},{x:.5778769850730896,y:.9318783283233643},{x:.579365074634552,y:.9305555820465088},{x:.5798611044883728,y:.9199735522270203},{x:.5828372836112976,y:.9219576716423035},{x:.58432537317276,y:.9193121790885925},{x:.5858134627342224,y:.9199735522270203},{x:.5882936716079712,y:.9179894328117371},{x:.5873016119003296,y:.9060846567153931},{x:.5932539701461792,y:.9041005373001099},{x:.5942460298538208,y:.9093915224075317},{x:.596230149269104,y:.9074074029922485},{x:.5967261791229248,y:.9107142686843872},{x:.598710298538208,y:.9113756418228149},{x:.5992063283920288,y:.9160053133964539},{x:.6016865372657776,y:.9133597612380981},{x:.6076388955116272,y:.9199735522270203},{x:.6061508059501648,y:.9226190447807312},{x:.6086309552192688,y:.9246031641960144},{x:.610615074634552,y:.9312169551849365},{x:.6061508059501648,y:.9398148059844971},{x:.6091269850730896,y:.9391534328460693},{x:.610615074634552,y:.9411375522613525},{x:.6160714030265808,y:.9384920597076416},{x:.6145833134651184,y:.9345238208770752},{x:.6160714030265808,y:.929894208908081},{x:.6254960298538208,y:.9332010746002197},{x:.625,y:.9259259104728699},{x:.627480149269104,y:.9259259104728699},{x:.6289682388305664,y:.9279100298881531},{x:.629960298538208,y:.9259259104728699},{x:.6319444179534912,y:.932539701461792},{x:.63442462682724,y:.9246031641960144},{x:.6364087462425232,y:.9232804179191589},{x:.636904776096344,y:.9285714030265808},{x:.6388888955116272,y:.9272486567497253},{x:.6423611044883728,y:.929894208908081},{x:.6438491940498352,y:.9292327761650085},{x:.6448412537574768,y:.9332010746002197},{x:.6473214030265808,y:.9305555820465088},{x:.6498016119003296,y:.9332010746002197},{x:.6493055820465088,y:.9365079402923584},{x:.6522817611694336,y:.9338624477386475},{x:.6602182388305664,y:.9384920597076416},{x:.6617063283920288,y:.9365079402923584},{x:.6641865372657776,y:.9378306865692139},{x:.6716269850730896,y:.9351851940155029},{x:.6770833134651184,y:.9411375522613525},{x:.6765872836112976,y:.9444444179534912},{x:.6830357313156128,y:.9417989253997803},{x:.685019850730896,y:.942460298538208},{x:.6815476417541504,y:.9378306865692139},{x:.6845238208770752,y:.9312169551849365},{x:.6860119104385376,y:.9312169551849365},{x:.6875,y:.9345238208770752},{x:.6884920597076416,y:.9338624477386475},{x:.6889880895614624,y:.9272486567497253},{x:.685019850730896,y:.9252645373344421},{x:.6865079402923584,y:.9239417910575867},{x:.685019850730896,y:.9199735522270203},{x:.6944444179534912,y:.9246031641960144},{x:.6944444179534912,y:.9212962985038757},{x:.69692462682724,y:.920634925365448},{x:.6974206566810608,y:.9226190447807312},{x:.6989087462425232,y:.9239417910575867},{x:.6954365372657776,y:.9153439402580261},{x:.6954365372657776,y:.9113756418228149},{x:.6989087462425232,y:.908730149269104},{x:.7033730149269104,y:.9100528955459595},{x:.7063491940498352,y:.9054232835769653},{x:.7058531641960144,y:.9014550447463989},{x:.7088293433189392,y:.8994709253311157},{x:.7132936716079712,y:.9007936716079712},{x:.7167658805847168,y:.8981481194496155},{x:.71875,y:.9054232835769653},{x:.721230149269104,y:.9007936716079712},{x:.726190447807312,y:.9067460298538208},{x:.7321428656578064,y:.9034391641616821},{x:.733134925365448,y:.9074074029922485},{x:.7351190447807312,y:.9074074029922485},{x:.7395833134651184,y:.9113756418228149},{x:.7385912537574768,y:.9160053133964539},{x:.74057537317276,y:.9133597612380981},{x:.742559552192688,y:.9160053133964539},{x:.7410714030265808,y:.9193121790885925},{x:.7435516119003296,y:.920634925365448},{x:.7435516119003296,y:.9259259104728699},{x:.7455357313156128,y:.9272486567497253},{x:.7465277910232544,y:.9318783283233643},{x:.7455357313156128,y:.9351851940155029},{x:.742559552192688,y:.9371693134307861},{x:.7470238208770752,y:.9404761791229248},{x:.7519841194152832,y:.9589946866035461},{x:.7495039701461792,y:.9748677015304565},{x:.75,y:.9808201193809509},{x:.747519850730896,y:.9821428656578064},{x:.7514880895614624,y:.9854497313499451},{x:.7504960298538208,y:.9933862686157227},{x:.752480149269104,y:.9947090148925781},{x:.7519841194152832,y:.9993386268615723},{x:.9995039701461792,y:.9993386268615723},{x:.9995039701461792,y:0},{x:0,y:0}],T=()=>k.map(y=>new C(y.x-.5,.5-y.y)),J=({coordinateMapper:y})=>{const{pointSize:s,power:t,bounds:o,transitionSpeed:a}=M(),e=[T(),I(),T(),I()];return c.jsxs(c.Fragment,{children:[c.jsx($,{coordinateMapper:y,polyStates:e,parametricMin:o[0],parametricMax:o[1],power:t,pointSize:s,transitionSpeedSec:a}),c.jsx(_,{position:new P(0,0,-1.5*y.amplitude)})]})};export{J as default}; +import{r as d,g as Y,a9 as O,V as P,o as C,a as X,c as Z,j as c,G as _}from"./index-bce4be0d.js";const L=d.createContext(null);function M(){const y=d.useContext(L);if(!y)throw new Error("useStencilVisualConfigContext must be used within a StencilVisualConfigContextProvider");return y.config}const U=(y,s=!1)=>{const t=y.length,o=new Array;for(let e=0;e{const D=Array.from({length:r}).map(Y),m=s.map(f=>new O(f.map(n=>new P(n.x,n.y,0).multiplyScalar(25)),!1,"catmullrom",0).getSpacedPoints(r)),B=m.map(f=>U(f.map(n=>new C(n.x,n.y)))),E=d.useRef(null),h=d.useRef(null);d.useLayoutEffect(()=>{h.current&&h.current.setFromPoints(m[0])},[h,m]);const z=l*s.length;return X(({clock:f})=>{const n=f.getElapsedTime(),G=n%z/z,p=Math.floor(G*s.length),V=p+1>=s.length?0:p+1,F=n%l/l,j=m[p],A=m[V],N=B[p],R=B[V];let i,w;const g=new P,b=new P,S=E.current.geometry.attributes.position;for(let x=0;xo){S.setXYZ(x,0,0,0);continue}i=a*y.map(Z.CARTESIAN_1D,(w-t)/Math.abs(o-t),0,0,n),e&&(i*=D[x]),g.set(j[x].x+i*N[x].x,j[x].y+i*N[x].y,j[x].z),p!==V&&(b.set(A[x].x+i*R[x].x,A[x].y+i*R[x].y,A[x].z),g.lerp(b,F)),S.setXYZ(x,g.x,g.y,g.z)}S.needsUpdate=!0}),c.jsxs("points",{ref:E,children:[c.jsx("bufferGeometry",{attach:"geometry",ref:h}),c.jsx("pointsMaterial",{attach:"material",size:u})]})},I=()=>[new C(-.5,.5),new C(.5,-.5)],k=[{x:0,y:0},{x:0,y:.6203703880310059},{x:.0029761905316263437,y:.6256613731384277},{x:0,y:.6289682388305664},{x:0,y:.6937830448150635},{x:.0034722222480922937,y:.6977513432502747},{x:0,y:.7017195820808411},{x:.004464285913854837,y:.7003968358039856},{x:.010416666977107525,y:.695105791091919},{x:.01686508022248745,y:.6957672238349915},{x:.0243055559694767,y:.7023809552192688},{x:.0252976194024086,y:.7109788656234741},{x:.0292658731341362,y:.7136243581771851},{x:.02976190485060215,y:.704365074634552},{x:.0272817462682724,y:.6990740895271301},{x:.03125,y:.6944444179534912},{x:.0396825410425663,y:.6944444179534912},{x:.0416666679084301,y:.6917989253997803},{x:.0520833320915699,y:.6911375522613525},{x:.0545634925365448,y:.695105791091919},{x:.0530753955245018,y:.6984127163887024},{x:.0565476194024086,y:.695105791091919},{x:.0615079365670681,y:.6970899701118469},{x:.0634920671582222,y:.6931216716766357},{x:.0620039664208889,y:.6904761791229248},{x:.0620039664208889,y:.6832010746002197},{x:.0634920671582222,y:.6812169551849365},{x:.0620039664208889,y:.6759259104728699},{x:.0694444477558136,y:.6712962985038757},{x:.0773809552192688,y:.6600528955459595},{x:.083829365670681,y:.6626983880996704},{x:.085317462682724,y:.6666666865348816},{x:.0868055522441864,y:.6560846567153931},{x:.092261902987957,y:.6554232835769653},{x:.09375,y:.6567460298538208},{x:.09375,y:.6607142686843872},{x:.0962301567196846,y:.6580687761306763},{x:.1011904776096344,y:.6600528955459595},{x:.1016865074634552,y:.6626983880996704},{x:.0997023805975914,y:.6660053133964539},{x:.105158731341362,y:.6646825671195984},{x:.1125992089509964,y:.6693121790885925},{x:.1160714253783226,y:.6567460298538208},{x:.1185515895485878,y:.6580687761306763},{x:.1200396791100502,y:.6560846567153931},{x:.1210317462682724,y:.6600528955459595},{x:.1240079328417778,y:.6560846567153931},{x:.1269841343164444,y:.6580687761306763},{x:.1269841343164444,y:.6620370149612427},{x:.1289682537317276,y:.6600528955459595},{x:.1324404776096344,y:.6626983880996704},{x:.1314484179019928,y:.670634925365448},{x:.133432537317276,y:.6732804179191589},{x:.133432537317276,y:.6785714030265808},{x:.1274801641702652,y:.6785714030265808},{x:.1269841343164444,y:.6805555820465088},{x:.1329365074634552,y:.6805555820465088},{x:.1339285671710968,y:.6792327761650085},{x:.1398809552192688,y:.679894208908081},{x:.1398809552192688,y:.6812169551849365},{x:.1408730149269104,y:.679894208908081},{x:.1453372985124588,y:.679894208908081},{x:.1512896865606308,y:.6759259104728699},{x:.153273805975914,y:.6792327761650085},{x:.15625,y:.6752645373344421},{x:.159226194024086,y:.679894208908081},{x:.16170634329319,y:.6792327761650085},{x:.164682537317276,y:.6818783283233643},{x:.1641865074634552,y:.6838624477386475},{x:.162202388048172,y:.6832010746002197},{x:.1631944477558136,y:.6878306865692139},{x:.16170634329319,y:.6898148059844971},{x:.1626984179019928,y:.6898148059844971},{x:.1666666716337204,y:.6832010746002197},{x:.1681547611951828,y:.682539701461792},{x:.1691468209028244,y:.6838624477386475},{x:.1656745970249176,y:.6898148059844971},{x:.1721230149269104,y:.6898148059844971},{x:.170634925365448,y:.695105791091919},{x:.1750992089509964,y:.6984127163887024},{x:.1746031790971756,y:.7017195820808411},{x:.176091268658638,y:.704365074634552},{x:.1770833283662796,y:.7017195820808411},{x:.179067462682724,y:.7003968358039856},{x:.181547611951828,y:.7010582089424133},{x:.1855158656835556,y:.6964285969734192},{x:.1870039701461792,y:.6970899701118469},{x:.1825396865606308,y:.7056878209114075},{x:.181547611951828,y:.7169312238693237},{x:.1865079402923584,y:.7142857313156128},{x:.1865079402923584,y:.7103174328804016},{x:.1884920597076416,y:.7103174328804016},{x:.1894841343164444,y:.7083333134651184},{x:.1969245970249176,y:.7096560597419739},{x:.1924603134393692,y:.7050264477729797},{x:.1884920597076416,y:.7050264477729797},{x:.1884920597076416,y:.7030423283576965},{x:.1914682537317276,y:.6984127163887024},{x:.1964285671710968,y:.6977513432502747},{x:.1979166716337204,y:.6990740895271301},{x:.2013888955116272,y:.6957672238349915},{x:.2063492089509964,y:.6851851940155029},{x:.2033730149269104,y:.6838624477386475},{x:.2003968209028244,y:.6865079402923584},{x:.1974206417798996,y:.6812169551849365},{x:.198908731341362,y:.6752645373344421},{x:.1924603134393692,y:.6699735522270203},{x:.1830357164144516,y:.6746031641960144},{x:.1830357164144516,y:.670634925365448},{x:.1894841343164444,y:.6653439402580261},{x:.181547611951828,y:.6666666865348816},{x:.18204365670681,y:.6633597612380981},{x:.1795634925365448,y:.6600528955459595},{x:.1795634925365448,y:.6567460298538208},{x:.1855158656835556,y:.6534391641616821},{x:.1855158656835556,y:.6461640000343323},{x:.1875,y:.6441798806190491},{x:.1884920597076416,y:.6382275223731995},{x:.195932537317276,y:.6296296119689941},{x:.2008928507566452,y:.6269841194152832},{x:.201884925365448,y:.6283068656921387},{x:.2038690447807312,y:.6256613731384277},{x:.2048611044883728,y:.6289682388305664},{x:.2063492089509964,y:.6243386268615723},{x:.210317462682724,y:.625},{x:.2118055522441864,y:.6309523582458496},{x:.2137896865606308,y:.6316137313842773},{x:.2147817462682724,y:.6256613731384277},{x:.2177579402923584,y:.6230158805847168},{x:.224702388048172,y:.625},{x:.224702388048172,y:.6230158805847168},{x:.2142857164144516,y:.6091269850730896},{x:.2147817462682724,y:.6071428656578064},{x:.2172619104385376,y:.6091269850730896},{x:.2172619104385376,y:.6071428656578064},{x:.2118055522441864,y:.5998677015304565},{x:.212797611951828,y:.5972222089767456},{x:.224702388048172,y:.5919312238693237},{x:.227182537317276,y:.5932539701461792},{x:.2286706417798996,y:.591269850730896},{x:.2321428507566452,y:.5972222089767456},{x:.2425595223903656,y:.5965608358383179},{x:.2480158656835556,y:.6025132536888123},{x:.2544642984867096,y:.60317462682724},{x:.2554563581943512,y:.6044973731040955},{x:.2539682686328888,y:.6183862686157227},{x:.255952388048172,y:.6177248954772949},{x:.2564484179019928,y:.6124338507652283},{x:.2599206268787384,y:.6097883582115173},{x:.2599206268787384,y:.6064814925193787},{x:.26091268658638,y:.6078042387962341},{x:.2633928656578064,y:.6071428656578064},{x:.2673611044883728,y:.6117724776268005},{x:.2713293731212616,y:.6058201193809509},{x:.2743055522441864,y:.6084656119346619},{x:.2738095223903656,y:.6150793433189392},{x:.2777777910232544,y:.6084656119346619},{x:.2802579402923584,y:.6071428656578064},{x:.2842261791229248,y:.6111111044883728},{x:.2876984179019928,y:.6117724776268005},{x:.2891865074634552,y:.6144179701805115},{x:.2881944477558136,y:.6164020895957947},{x:.29216268658638,y:.6137565970420837},{x:.293154776096344,y:.6097883582115173},{x:.2951388955116272,y:.6137565970420837},{x:.2976190447807312,y:.613095223903656},{x:.2986111044883728,y:.6150793433189392},{x:.3020833432674408,y:.6104497313499451},{x:.3055555522441864,y:.6144179701805115},{x:.304067462682724,y:.6177248954772949},{x:.3075396716594696,y:.6190476417541504},{x:.3090277910232544,y:.6111111044883728},{x:.3139880895614624,y:.6150793433189392},{x:.3199404776096344,y:.6084656119346619},{x:.3194444477558136,y:.6064814925193787},{x:.3164682686328888,y:.6044973731040955},{x:.314980149269104,y:.6051587462425232},{x:.3125,y:.6025132536888123},{x:.3115079402923584,y:.5992063283920288},{x:.3000991940498352,y:.5952380895614624},{x:.3010912835597992,y:.5939153432846069},{x:.3050595223903656,y:.5939153432846069},{x:.3020833432674408,y:.5853174328804016},{x:.3035714328289032,y:.5846560597419739},{x:.3050595223903656,y:.5873016119003296},{x:.3070436418056488,y:.5866402387619019},{x:.3090277910232544,y:.5767195820808411},{x:.3129960298538208,y:.5806878209114075},{x:.3144841194152832,y:.5773809552192688},{x:.3169642984867096,y:.5813491940498352},{x:.318452388048172,y:.5800264477729797},{x:.3224206268787384,y:.5853174328804016},{x:.3229166567325592,y:.5833333134651184},{x:.320932537317276,y:.5820105671882629},{x:.320932537317276,y:.5800264477729797},{x:.324404776096344,y:.579365074634552},{x:.3249008059501648,y:.5826719403266907},{x:.3253968358039856,y:.579365074634552},{x:.3239087164402008,y:.5773809552192688},{x:.3273809552192688,y:.5727513432502747},{x:.3308531641960144,y:.5753968358039856},{x:.3323412835597992,y:.5734127163887024},{x:.3373015820980072,y:.579365074634552},{x:.3417658805847168,y:.5780423283576965},{x:.346230149269104,y:.5833333134651184},{x:.349702388048172,y:.5800264477729797},{x:.349702388048172,y:.5740740895271301},{x:.3511904776096344,y:.5760582089424133},{x:.355654776096344,y:.5727513432502747},{x:.3571428656578064,y:.5767195820808411},{x:.358134925365448,y:.5734127163887024},{x:.3601190447807312,y:.5773809552192688},{x:.3596230149269104,y:.5826719403266907},{x:.3655754029750824,y:.5767195820808411},{x:.3685515820980072,y:.5773809552192688},{x:.3695436418056488,y:.579365074634552},{x:.3695436418056488,y:.5899471044540405},{x:.3660714328289032,y:.5952380895614624},{x:.3764880895614624,y:.5833333134651184},{x:.377480149269104,y:.5727513432502747},{x:.3794642984867096,y:.5720899701118469},{x:.3814484179019928,y:.5753968358039856},{x:.3854166567325592,y:.5727513432502747},{x:.3913690447807312,y:.5667989253997803},{x:.4007936418056488,y:.5529100298881531},{x:.4042658805847168,y:.5515872836112976},{x:.408730149269104,y:.5469576716423035},{x:.408730149269104,y:.5436508059501648},{x:.4032738208770752,y:.5416666865348816},{x:.4047619104385376,y:.5370370149612427},{x:.4112103283405304,y:.533730149269104},{x:.4201388955116272,y:.5343915224075317},{x:.44841268658638,y:.5026454925537109},{x:.4563491940498352,y:.4960317313671112},{x:.462797611951828,y:.48743385076522827},{x:.47966268658638,y:.47156083583831787},{x:.4766865074634552,y:.4642857015132904},{x:.4756944477558136,y:.43121692538261414},{x:.480654776096344,y:.4126984179019928},{x:.4801587164402008,y:.3968254029750824},{x:.4826388955116272,y:.39550265669822693},{x:.4866071343421936,y:.3988095223903656},{x:.4935515820980072,y:.3988095223903656},{x:.4990079402923584,y:.3948412835597992},{x:.4990079402923584,y:.41402116417884827},{x:.5029761791229248,y:.43716931343078613},{x:.5029761791229248,y:.454365074634552},{x:.5004960298538208,y:.47486773133277893},{x:.4955357015132904,y:.48544973134994507},{x:.4945436418056488,y:.49669313430786133},{x:.4925595223903656,y:.49933862686157227},{x:.4875991940498352,y:.49933862686157227},{x:.4846230149269104,y:.4841269850730896},{x:.480654776096344,y:.47883597016334534},{x:.4781745970249176,y:.4801587164402008},{x:.4751984179019928,y:.48478835821151733},{x:.474702388048172,y:.48875662684440613},{x:.4697420597076416,y:.4900793731212616},{x:.4702380895614624,y:.49867725372314453},{x:.4657738208770752,y:.5072751045227051},{x:.462797611951828,y:.5066137313842773},{x:.4613095223903656,y:.49933862686157227},{x:.4449404776096344,y:.5171957612037659},{x:.4449404776096344,y:.5224867463111877},{x:.4409722089767456,y:.5224867463111877},{x:.4379960298538208,y:.5244709253311157},{x:.42658731341362,y:.5370370149612427},{x:.4236111044883728,y:.5410053133964539},{x:.4236111044883728,y:.5462962985038757},{x:.4191468358039856,y:.5542327761650085},{x:.414682537317276,y:.5562169551849365},{x:.4126984179019928,y:.5535714030265808},{x:.4097222089767456,y:.5568783283233643},{x:.4092261791229248,y:.5641534328460693},{x:.4057539701461792,y:.5634920597076416},{x:.4027777910232544,y:.5661375522613525},{x:.4042658805847168,y:.5720899701118469},{x:.4027777910232544,y:.5853174328804016},{x:.4042658805847168,y:.5919312238693237},{x:.4032738208770752,y:.5992063283920288},{x:.4042658805847168,y:.5998677015304565},{x:.4057539701461792,y:.5978835821151733},{x:.4077380895614624,y:.6005290746688843},{x:.4032738208770752,y:.6025132536888123},{x:.4027777910232544,y:.6097883582115173},{x:.4052579402923584,y:.613095223903656},{x:.4022817313671112,y:.6164020895957947},{x:.4007936418056488,y:.6150793433189392},{x:.4012896716594696,y:.6117724776268005},{x:.3988095223903656,y:.6144179701805115},{x:.39533731341362,y:.6137565970420837},{x:.3983134925365448,y:.6111111044883728},{x:.3993055522441864,y:.6078042387962341},{x:.3983134925365448,y:.5925925970077515},{x:.4012896716594696,y:.5839946866035461},{x:.4007936418056488,y:.5687830448150635},{x:.391865074634552,y:.5787037014961243},{x:.3933531641960144,y:.5826719403266907},{x:.3923611044883728,y:.5873016119003296},{x:.39533731341362,y:.5879629850387573},{x:.394345223903656,y:.5939153432846069},{x:.391865074634552,y:.5952380895614624},{x:.3903769850730896,y:.60317462682724},{x:.3923611044883728,y:.6051587462425232},{x:.3928571343421936,y:.613095223903656},{x:.39533731341362,y:.6144179701805115},{x:.3938491940498352,y:.6157407164573669},{x:.39533731341362,y:.6216931343078613},{x:.397817462682724,y:.6256613731384277},{x:.4007936418056488,y:.6230158805847168},{x:.4027777910232544,y:.625},{x:.4007936418056488,y:.6283068656921387},{x:.4027777910232544,y:.6335979104042053},{x:.4052579402923584,y:.6316137313842773},{x:.4092261791229248,y:.6223545074462891},{x:.4156745970249176,y:.6236772537231445},{x:.41716268658638,y:.6296296119689941},{x:.418154776096344,y:.6269841194152832},{x:.4166666567325592,y:.6236772537231445},{x:.4201388955116272,y:.6183862686157227},{x:.4201388955116272,y:.6170634627342224},{x:.4196428656578064,y:.6164020895957947},{x:.4191468358039856,y:.6150793433189392},{x:.4191468358039856,y:.6170634627342224},{x:.41716268658638,y:.6170634627342224},{x:.4102182686328888,y:.6117724776268005},{x:.40625,y:.6124338507652283},{x:.4107142984867096,y:.6044973731040955},{x:.4102182686328888,y:.5992063283920288},{x:.4077380895614624,y:.5985449552536011},{x:.4072420597076416,y:.5965608358383179},{x:.4107142984867096,y:.5972222089767456},{x:.4131944477558136,y:.5958994626998901},{x:.4166666567325592,y:.5972222089767456},{x:.4201388955116272,y:.5932539701461792},{x:.423115074634552,y:.5925925970077515},{x:.4246031641960144,y:.5945767164230347},{x:.4241071343421936,y:.5972222089767456},{x:.42658731341362,y:.5965608358383179},{x:.4270833432674408,y:.5978835821151733},{x:.4260912835597992,y:.5992063283920288},{x:.4241071343421936,y:.5985449552536011},{x:.4226190447807312,y:.6025132536888123},{x:.4335317313671112,y:.6038359999656677},{x:.4414682686328888,y:.601190447807312},{x:.4479166567325592,y:.6038359999656677},{x:.4508928656578064,y:.6084656119346619},{x:.4533730149269104,y:.60317462682724},{x:.456845223903656,y:.6064814925193787},{x:.4618055522441864,y:.6078042387962341},{x:.4632936418056488,y:.6111111044883728},{x:.462797611951828,y:.6177248954772949},{x:.4598214328289032,y:.6203703880310059},{x:.4583333432674408,y:.625},{x:.462797611951828,y:.6197090148925781},{x:.4657738208770752,y:.6197090148925781},{x:.471230149269104,y:.6289682388305664},{x:.4707341194152832,y:.6302909851074219},{x:.4707341194152832,y:.6329365372657776},{x:.4717261791229248,y:.6302909851074219},{x:.474702388048172,y:.6309523582458496},{x:.4786706268787384,y:.6355820298194885},{x:.47966268658638,y:.6342592835426331},{x:.4836309552192688,y:.6355820298194885},{x:.4895833432674408,y:.6421957612037659},{x:.4895833432674408,y:.648809552192688},{x:.4841269850730896,y:.6547619104385376},{x:.4841269850730896,y:.6580687761306763},{x:.4875991940498352,y:.6554232835769653},{x:.48908731341362,y:.6560846567153931},{x:.4980158805847168,y:.6699735522270203},{x:.502480149269104,y:.6792327761650085},{x:.502480149269104,y:.6832010746002197},{x:.5054563283920288,y:.6871693134307861},{x:.507440447807312,y:.7010582089424133},{x:.5044642686843872,y:.7050264477729797},{x:.5039682388305664,y:.7103174328804016},{x:.5014880895614624,y:.7076719403266907},{x:.497519850730896,y:.7076719403266907},{x:.5009920597076416,y:.7142857313156128},{x:.5,y:.7175925970077515},{x:.4970238208770752,y:.7175925970077515},{x:.4965277910232544,y:.7189153432846069},{x:.4965277910232544,y:.7208994626998901},{x:.5004960298538208,y:.7248677015304565},{x:.4990079402923584,y:.7288359999656677},{x:.4960317313671112,y:.7301587462425232},{x:.497519850730896,y:.7400793433189392},{x:.494047611951828,y:.7453703880310059},{x:.488095223903656,y:.7466931343078613},{x:.4826388955116272,y:.7552909851074219},{x:.4826388955116272,y:.7572751045227051},{x:.488095223903656,y:.7566137313842773},{x:.4895833432674408,y:.761904776096344},{x:.4910714328289032,y:.7625661492347717},{x:.48908731341362,y:.7711640000343323},{x:.4905754029750824,y:.7843915224075317},{x:.4945436418056488,y:.7870370149612427},{x:.4955357015132904,y:.7923280596733093},{x:.497519850730896,y:.7936508059501648},{x:.5004960298538208,y:.8009259104728699},{x:.5004960298538208,y:.807539701461792},{x:.4960317313671112,y:.8134920597076416},{x:.4995039701461792,y:.8148148059844971},{x:.4990079402923584,y:.8220899701118469},{x:.5019841194152832,y:.8359788656234741},{x:.5,y:.8432539701461792},{x:.4905754029750824,y:.8406084775924683},{x:.4920634925365448,y:.8432539701461792},{x:.4925595223903656,y:.8518518805503845},{x:.4910714328289032,y:.8544973731040955},{x:.4920634925365448,y:.85317462682724},{x:.4930555522441864,y:.8544973731040955},{x:.494047611951828,y:.8650793433189392},{x:.4905754029750824,y:.8657407164573669},{x:.4900793731212616,y:.8697090148925781},{x:.4920634925365448,y:.8723545074462891},{x:.4851190447807312,y:.875},{x:.4846230149269104,y:.8776454925537109},{x:.4905754029750824,y:.8796296119689941},{x:.494047611951828,y:.8835979104042053},{x:.5,y:.8829365372657776},{x:.5009920597076416,y:.8842592835426331},{x:.502480149269104,y:.8822751045227051},{x:.504960298538208,y:.8829365372657776},{x:.5084325671195984,y:.8888888955116272},{x:.5104166865348816,y:.8862434029579163},{x:.5124008059501648,y:.886904776096344},{x:.5104166865348816,y:.8961640000343323},{x:.5114087462425232,y:.8974867463111877},{x:.5128968358039856,y:.8941798806190491},{x:.5133928656578064,y:.9001322984695435},{x:.5109127163887024,y:.9041005373001099},{x:.507440447807312,y:.9034391641616821},{x:.5054563283920288,y:.9120370149612427},{x:.50942462682724,y:.9093915224075317},{x:.5163690447807312,y:.8994709253311157},{x:.5188491940498352,y:.9034391641616821},{x:.5213293433189392,y:.8822751045227051},{x:.528769850730896,y:.8829365372657776},{x:.5277777910232544,y:.8849206566810608},{x:.5243055820465088,y:.8842592835426331},{x:.5233134627342224,y:.8855820298194885},{x:.5233134627342224,y:.8882275223731995},{x:.526289701461792,y:.8882275223731995},{x:.5252976417541504,y:.8908730149269104},{x:.528769850730896,y:.8888888955116272},{x:.5282738208770752,y:.8875661492347717},{x:.5302579402923584,y:.886904776096344},{x:.53125,y:.8835979104042053},{x:.5352182388305664,y:.8829365372657776},{x:.54067462682724,y:.8908730149269104},{x:.54067462682724,y:.8961640000343323},{x:.5426587462425232,y:.8935185074806213},{x:.5451388955116272,y:.8941798806190491},{x:.5500991940498352,y:.9027777910232544},{x:.5515872836112976,y:.9107142686843872},{x:.550595223903656,y:.9140211343765259},{x:.5515872836112976,y:.9120370149612427},{x:.5545634627342224,y:.9160053133964539},{x:.5610119104385376,y:.9153439402580261},{x:.5615079402923584,y:.9166666865348816},{x:.5634920597076416,y:.9140211343765259},{x:.5610119104385376,y:.9113756418228149},{x:.5615079402923584,y:.9093915224075317},{x:.5669642686843872,y:.9100528955459595},{x:.5689483880996704,y:.9133597612380981},{x:.5669642686843872,y:.9232804179191589},{x:.5724206566810608,y:.9272486567497253},{x:.5749008059501648,y:.9265872836112976},{x:.5778769850730896,y:.9318783283233643},{x:.579365074634552,y:.9305555820465088},{x:.5798611044883728,y:.9199735522270203},{x:.5828372836112976,y:.9219576716423035},{x:.58432537317276,y:.9193121790885925},{x:.5858134627342224,y:.9199735522270203},{x:.5882936716079712,y:.9179894328117371},{x:.5873016119003296,y:.9060846567153931},{x:.5932539701461792,y:.9041005373001099},{x:.5942460298538208,y:.9093915224075317},{x:.596230149269104,y:.9074074029922485},{x:.5967261791229248,y:.9107142686843872},{x:.598710298538208,y:.9113756418228149},{x:.5992063283920288,y:.9160053133964539},{x:.6016865372657776,y:.9133597612380981},{x:.6076388955116272,y:.9199735522270203},{x:.6061508059501648,y:.9226190447807312},{x:.6086309552192688,y:.9246031641960144},{x:.610615074634552,y:.9312169551849365},{x:.6061508059501648,y:.9398148059844971},{x:.6091269850730896,y:.9391534328460693},{x:.610615074634552,y:.9411375522613525},{x:.6160714030265808,y:.9384920597076416},{x:.6145833134651184,y:.9345238208770752},{x:.6160714030265808,y:.929894208908081},{x:.6254960298538208,y:.9332010746002197},{x:.625,y:.9259259104728699},{x:.627480149269104,y:.9259259104728699},{x:.6289682388305664,y:.9279100298881531},{x:.629960298538208,y:.9259259104728699},{x:.6319444179534912,y:.932539701461792},{x:.63442462682724,y:.9246031641960144},{x:.6364087462425232,y:.9232804179191589},{x:.636904776096344,y:.9285714030265808},{x:.6388888955116272,y:.9272486567497253},{x:.6423611044883728,y:.929894208908081},{x:.6438491940498352,y:.9292327761650085},{x:.6448412537574768,y:.9332010746002197},{x:.6473214030265808,y:.9305555820465088},{x:.6498016119003296,y:.9332010746002197},{x:.6493055820465088,y:.9365079402923584},{x:.6522817611694336,y:.9338624477386475},{x:.6602182388305664,y:.9384920597076416},{x:.6617063283920288,y:.9365079402923584},{x:.6641865372657776,y:.9378306865692139},{x:.6716269850730896,y:.9351851940155029},{x:.6770833134651184,y:.9411375522613525},{x:.6765872836112976,y:.9444444179534912},{x:.6830357313156128,y:.9417989253997803},{x:.685019850730896,y:.942460298538208},{x:.6815476417541504,y:.9378306865692139},{x:.6845238208770752,y:.9312169551849365},{x:.6860119104385376,y:.9312169551849365},{x:.6875,y:.9345238208770752},{x:.6884920597076416,y:.9338624477386475},{x:.6889880895614624,y:.9272486567497253},{x:.685019850730896,y:.9252645373344421},{x:.6865079402923584,y:.9239417910575867},{x:.685019850730896,y:.9199735522270203},{x:.6944444179534912,y:.9246031641960144},{x:.6944444179534912,y:.9212962985038757},{x:.69692462682724,y:.920634925365448},{x:.6974206566810608,y:.9226190447807312},{x:.6989087462425232,y:.9239417910575867},{x:.6954365372657776,y:.9153439402580261},{x:.6954365372657776,y:.9113756418228149},{x:.6989087462425232,y:.908730149269104},{x:.7033730149269104,y:.9100528955459595},{x:.7063491940498352,y:.9054232835769653},{x:.7058531641960144,y:.9014550447463989},{x:.7088293433189392,y:.8994709253311157},{x:.7132936716079712,y:.9007936716079712},{x:.7167658805847168,y:.8981481194496155},{x:.71875,y:.9054232835769653},{x:.721230149269104,y:.9007936716079712},{x:.726190447807312,y:.9067460298538208},{x:.7321428656578064,y:.9034391641616821},{x:.733134925365448,y:.9074074029922485},{x:.7351190447807312,y:.9074074029922485},{x:.7395833134651184,y:.9113756418228149},{x:.7385912537574768,y:.9160053133964539},{x:.74057537317276,y:.9133597612380981},{x:.742559552192688,y:.9160053133964539},{x:.7410714030265808,y:.9193121790885925},{x:.7435516119003296,y:.920634925365448},{x:.7435516119003296,y:.9259259104728699},{x:.7455357313156128,y:.9272486567497253},{x:.7465277910232544,y:.9318783283233643},{x:.7455357313156128,y:.9351851940155029},{x:.742559552192688,y:.9371693134307861},{x:.7470238208770752,y:.9404761791229248},{x:.7519841194152832,y:.9589946866035461},{x:.7495039701461792,y:.9748677015304565},{x:.75,y:.9808201193809509},{x:.747519850730896,y:.9821428656578064},{x:.7514880895614624,y:.9854497313499451},{x:.7504960298538208,y:.9933862686157227},{x:.752480149269104,y:.9947090148925781},{x:.7519841194152832,y:.9993386268615723},{x:.9995039701461792,y:.9993386268615723},{x:.9995039701461792,y:0},{x:0,y:0}],T=()=>k.map(y=>new C(y.x-.5,.5-y.y)),J=({coordinateMapper:y})=>{const{pointSize:s,power:t,bounds:o,transitionSpeed:a}=M(),e=[T(),I(),T(),I()];return c.jsxs(c.Fragment,{children:[c.jsx($,{coordinateMapper:y,polyStates:e,parametricMin:o[0],parametricMax:o[1],power:t,pointSize:s,transitionSpeedSec:a}),c.jsx(_,{position:new P(0,0,-1.5*y.amplitude)})]})};export{J as default}; diff --git a/assets/reactive-dcfb10cc.js b/assets/reactive-8ad27c76.js similarity index 94% rename from assets/reactive-dcfb10cc.js rename to assets/reactive-8ad27c76.js index 7ded1011..7eec8fe9 100644 --- a/assets/reactive-dcfb10cc.js +++ b/assets/reactive-8ad27c76.js @@ -1 +1 @@ -import{u as w,r as M,M as E,C as P,a as R,c as S,T as f,j as t,B as T,b as B,a8 as I,G as y,V as A}from"./index-cf06fcba.js";const G=({coordinateMapper:n,radius:r=2,nPoints:e=800,cubeSideLength:o=.05})=>{const g=w(),a=M.useRef(null),j=M.useMemo(()=>new E,[]),x=P.getPalette(g).buildLut();return M.useEffect(()=>{for(let s=0;s{const C=s.getElapsedTime();let h,i,c,m,p,d,l;for(let u=0;u{const{radius:r,nPoints:e,unitSideLength:o}=I();return t.jsxs(t.Fragment,{children:[t.jsx(G,{coordinateMapper:n,radius:r,nPoints:e,cubeSideLength:o}),t.jsx(y,{position:new A(0,0,-r*(1+.25*n.amplitude))})]})};export{V as default}; +import{u as w,r as M,M as E,C as P,a as R,c as S,T as f,j as t,B as T,b as B,a8 as I,G as y,V as A}from"./index-bce4be0d.js";const G=({coordinateMapper:n,radius:r=2,nPoints:e=800,cubeSideLength:o=.05})=>{const g=w(),a=M.useRef(null),j=M.useMemo(()=>new E,[]),x=P.getPalette(g).buildLut();return M.useEffect(()=>{for(let s=0;s{const C=s.getElapsedTime();let h,i,c,m,p,d,l;for(let u=0;u{const{radius:r,nPoints:e,unitSideLength:o}=I();return t.jsxs(t.Fragment,{children:[t.jsx(G,{coordinateMapper:n,radius:r,nPoints:e,cubeSideLength:o}),t.jsx(y,{position:new A(0,0,-r*(1+.25*n.amplitude))})]})};export{V as default}; diff --git a/assets/reactive-0bb7cde1.js b/assets/reactive-b4f6023b.js similarity index 95% rename from assets/reactive-0bb7cde1.js rename to assets/reactive-b4f6023b.js index 05ac9c05..68f53614 100644 --- a/assets/reactive-0bb7cde1.js +++ b/assets/reactive-b4f6023b.js @@ -1 +1 @@ -import{r as E,M as _,u as d,C as B,a as G,j as u,B as N,b as U,c as y,H as g,d as F,G as O,V}from"./index-cf06fcba.js";const z=({coordinateMapper:A,nPerSide:t=10,cubeSideLength:l=.5,cubeSpacingScalar:p=.1,volume:b=!0})=>{const m=E.useRef(null),i=E.useMemo(()=>new _,[]),R=b?y.CARTESIAN_3D:y.CARTESIAN_CUBE_FACES,T=d(),I=B.getPalette(T).buildLut();return E.useEffect(()=>{let C,n,e,a,s;for(let o=0;o{const n=C.getElapsedTime(),e=t*(1+p)*l;let a,s,o,r,c,w,j,f;for(let x=0;x{const{nPerSide:t,unitSideLength:l,unitSpacingScalar:p,volume:b}=F();return u.jsxs(u.Fragment,{children:[u.jsx(z,{coordinateMapper:A,nPerSide:t,cubeSideLength:l,cubeSpacingScalar:p,volume:b}),u.jsx(O,{position:new V(0,0,-.75*t*(1+p)*l)})]})};export{Y as default}; +import{r as E,M as _,u as d,C as B,a as G,j as u,B as N,b as U,c as y,H as g,d as F,G as O,V}from"./index-bce4be0d.js";const z=({coordinateMapper:A,nPerSide:t=10,cubeSideLength:l=.5,cubeSpacingScalar:p=.1,volume:b=!0})=>{const m=E.useRef(null),i=E.useMemo(()=>new _,[]),R=b?y.CARTESIAN_3D:y.CARTESIAN_CUBE_FACES,T=d(),I=B.getPalette(T).buildLut();return E.useEffect(()=>{let C,n,e,a,s;for(let o=0;o{const n=C.getElapsedTime(),e=t*(1+p)*l;let a,s,o,r,c,w,j,f;for(let x=0;x{const{nPerSide:t,unitSideLength:l,unitSpacingScalar:p,volume:b}=F();return u.jsxs(u.Fragment,{children:[u.jsx(z,{coordinateMapper:A,nPerSide:t,cubeSideLength:l,cubeSpacingScalar:p,volume:b}),u.jsx(O,{position:new V(0,0,-.75*t*(1+p)*l)})]})};export{Y as default}; diff --git a/assets/reactive-d6904db8.js b/assets/reactive-bd93b2f1.js similarity index 94% rename from assets/reactive-d6904db8.js rename to assets/reactive-bd93b2f1.js index 4a39b9da..b0247fe6 100644 --- a/assets/reactive-d6904db8.js +++ b/assets/reactive-bd93b2f1.js @@ -1 +1 @@ -var J=Object.defineProperty;var K=(s,e,n)=>e in s?J(s,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[e]=n;var V=(s,e,n)=>(K(s,typeof e!="symbol"?e+"":e,n),n);import{r as t,V as R,j as i,u as $,C as X,b as O,B as ee,f as Q,M as te,Q as se,a as Y,h as ne,i as j,c as oe,T,E as re,k as ae}from"./index-cf06fcba.js";import{a as ie,D as ce,M as le,w as ue,V as me,E as he,B as xe,N as pe}from"./Noise-108969e2.js";const fe=t.forwardRef(function({blendFunction:e,worldFocusDistance:n,worldFocusRange:c,focusDistance:r,focusRange:l,focalLength:o,bokehScale:x,resolutionScale:u,resolutionX:p,resolutionY:M,width:A,height:f,target:w,depthTexture:a,..._},L){const{camera:H}=t.useContext(ie),k=w!=null,b=t.useMemo(()=>{const B=new ce(H,{blendFunction:e,worldFocusDistance:n,worldFocusRange:c,focusDistance:r,focusRange:l,focalLength:o,bokehScale:x,resolutionScale:u,resolutionX:p,resolutionY:M,width:A,height:f});k&&(B.target=new R),a&&B.setDepthTexture(a.texture,a.packing);const N=B.maskPass;return N.maskFunction=le.MULTIPLY_RGB_SET_ALPHA,B},[H,e,n,c,r,l,o,x,u,p,M,A,f,k,a]);return t.useEffect(()=>()=>{b.dispose()},[b]),i.jsx("primitive",{..._,ref:L,object:b,target:w})}),ge=ue(me),de=s=>(s%T+T)%T;class Z extends ne{constructor(n,c,r,l=0){super();V(this,"helixLength");V(this,"helixRadius");V(this,"helixWindingSeparation");V(this,"helixStartingAngleRad");this.helixLength=n,this.helixRadius=c,this.helixWindingSeparation=r,this.helixStartingAngleRad=de(l)}getPoint(n,c=new R){n-=.5;const l=1/(this.helixLength/this.helixWindingSeparation),o=T*(n%l/l),x=this.helixRadius*Math.cos(o+this.helixStartingAngleRad),u=this.helixRadius*Math.sin(o+this.helixStartingAngleRad),p=this.helixLength*n;return c.set(x,u,p)}}const Me=(s,e)=>Math.hypot(s*Math.sin(e),s*Math.cos(e)-s),I=t.forwardRef(({coordinateMapper:s,helixLength:e=10,helixWindingSeparation:n=10,helixRadius:c=1,strandRadius:r=.1,baseSpacing:l=.35,strandOffsetRad:o=Math.PI/2,mirrorEffects:x=!0,fixedBaseGap:u=!0,...p},M)=>{const A=$(),f=X.getPalette(A).buildLut(),w=Math.floor(e/l),a=t.useRef(null),_=t.useMemo(()=>new O({color:"#606060"}),[]),L=t.useMemo(()=>{const m=.45*Me(c,o),d=new ee(r,r,m,1);for(let g=0;gnew O({color:f.getColor(.5)}),[f]),[B,N,U,q]=t.useMemo(()=>{const S=new Z(e,c,n,0),m=new Z(e,c,n,o);return[S,new Q(S,100,r,12,!1),m,new Q(m,100,r,12,!1)]},[e,c,n,r,o]),h=t.useMemo(()=>new te,[]),C=t.useMemo(()=>new R,[]),E=t.useMemo(()=>new R,[]),y=t.useMemo(()=>new R,[]),v=t.useMemo(()=>new se,[]),z=t.useMemo(()=>new R(0,0,1),[]);return t.useEffect(()=>{let S=0;for(let m=0;m{const m=S.getElapsedTime();let d=0,g=0,F=0,W=0;const D=.25,G=1;for(let P=0;P{const e=[t.useRef(null),t.useRef(null),t.useRef(null),t.useRef(null),t.useRef(null)],n=e.length,c=15,r=Array.from({length:n}).map((l,o)=>new R().fromArray(Array.from({length:3}).map((x,u)=>2*j.seededRandom(o+u)-1)).normalize().multiplyScalar(c));return Y(({clock:l})=>{const o=l.getElapsedTime(),x=5e-4,u=.05;let p,M=0;e.forEach((A,f)=>{A.current&&(p=r[f],M=Math.sin(u*(.5+.5*j.seededRandom(f))*o+j.seededRandom(f)/u),A.current.position.set(p.x*M,p.y*M,p.z*M),A.current.rotation.z+=x*Math.cos((.5+.5*j.seededRandom(f))*o),A.current.rotation.y+=x*Math.cos((.5+.5*j.seededRandom(f))*o))})}),i.jsx(i.Fragment,{children:e.map((l,o)=>i.jsx(I,{ref:l,position:r[o],rotation:new re(...Array.from({length:3}).map((x,u)=>Math.PI*(2*j.seededRandom(o+u)-1))),...s},o))})},we=({coordinateMapper:s})=>{const{multi:e,helixLength:n,helixRadius:c,helixWindingSeparation:r,strandRadius:l,baseSpacing:o,strandOffsetRad:x,mirrorEffects:u,fixedBaseGap:p}=ae();return e?i.jsx(Ae,{coordinateMapper:s,helixLength:n,helixRadius:c,helixWindingSeparation:r,strandRadius:l,baseSpacing:o,strandOffsetRad:x,mirrorEffects:u,fixedBaseGap:p}):i.jsx(I,{coordinateMapper:s,helixLength:n,helixRadius:c,helixWindingSeparation:r,strandRadius:l,baseSpacing:o,strandOffsetRad:x,mirrorEffects:u,fixedBaseGap:p})},Ee=({...s})=>i.jsxs(i.Fragment,{children:[i.jsx(we,{...s}),i.jsxs(he,{children:[i.jsx(fe,{focusDistance:0,focalLength:.02,bokehScale:3,height:480}),i.jsx(xe,{luminanceThreshold:0,luminanceSmoothing:.9,height:300}),i.jsx(pe,{opacity:.02}),i.jsx(ge,{eskil:!1,offset:.1,darkness:1.1})]})]});export{Ee as default}; +var J=Object.defineProperty;var K=(s,e,n)=>e in s?J(s,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[e]=n;var V=(s,e,n)=>(K(s,typeof e!="symbol"?e+"":e,n),n);import{r as t,V as R,j as i,u as $,C as X,b as O,B as ee,f as Q,M as te,Q as se,h as j,a as Y,c as ne,i as oe,T,E as re,k as ae}from"./index-bce4be0d.js";import{a as ie,D as ce,M as le,w as ue,V as me,E as he,B as xe,N as pe}from"./Noise-e2defa57.js";const fe=t.forwardRef(function({blendFunction:e,worldFocusDistance:n,worldFocusRange:c,focusDistance:r,focusRange:l,focalLength:o,bokehScale:x,resolutionScale:u,resolutionX:p,resolutionY:M,width:A,height:f,target:w,depthTexture:a,..._},L){const{camera:H}=t.useContext(ie),k=w!=null,b=t.useMemo(()=>{const B=new ce(H,{blendFunction:e,worldFocusDistance:n,worldFocusRange:c,focusDistance:r,focusRange:l,focalLength:o,bokehScale:x,resolutionScale:u,resolutionX:p,resolutionY:M,width:A,height:f});k&&(B.target=new R),a&&B.setDepthTexture(a.texture,a.packing);const N=B.maskPass;return N.maskFunction=le.MULTIPLY_RGB_SET_ALPHA,B},[H,e,n,c,r,l,o,x,u,p,M,A,f,k,a]);return t.useEffect(()=>()=>{b.dispose()},[b]),i.jsx("primitive",{..._,ref:L,object:b,target:w})}),ge=ue(me),de=s=>(s%T+T)%T;class Z extends oe{constructor(n,c,r,l=0){super();V(this,"helixLength");V(this,"helixRadius");V(this,"helixWindingSeparation");V(this,"helixStartingAngleRad");this.helixLength=n,this.helixRadius=c,this.helixWindingSeparation=r,this.helixStartingAngleRad=de(l)}getPoint(n,c=new R){n-=.5;const l=1/(this.helixLength/this.helixWindingSeparation),o=T*(n%l/l),x=this.helixRadius*Math.cos(o+this.helixStartingAngleRad),u=this.helixRadius*Math.sin(o+this.helixStartingAngleRad),p=this.helixLength*n;return c.set(x,u,p)}}const Me=(s,e)=>Math.hypot(s*Math.sin(e),s*Math.cos(e)-s),I=t.forwardRef(({coordinateMapper:s,helixLength:e=10,helixWindingSeparation:n=10,helixRadius:c=1,strandRadius:r=.1,baseSpacing:l=.35,strandOffsetRad:o=Math.PI/2,mirrorEffects:x=!0,fixedBaseGap:u=!0,...p},M)=>{const A=$(),f=X.getPalette(A).buildLut(),w=Math.floor(e/l),a=t.useRef(null),_=t.useMemo(()=>new O({color:"#606060"}),[]),L=t.useMemo(()=>{const m=.45*Me(c,o),d=new ee(r,r,m,1);for(let g=0;gnew O({color:f.getColor(.5)}),[f]),[B,N,U,q]=t.useMemo(()=>{const S=new Z(e,c,n,0),m=new Z(e,c,n,o);return[S,new Q(S,100,r,12,!1),m,new Q(m,100,r,12,!1)]},[e,c,n,r,o]),h=t.useMemo(()=>new te,[]),C=t.useMemo(()=>new R,[]),E=t.useMemo(()=>new R,[]),y=t.useMemo(()=>new R,[]),v=t.useMemo(()=>new se,[]),z=t.useMemo(()=>new R(0,0,1),[]);return t.useEffect(()=>{let S=0;for(let m=0;m{const m=S.getElapsedTime();let d=0,g=0,F=0,W=0;const D=.25,G=1;for(let P=0;P{const e=[t.useRef(null),t.useRef(null),t.useRef(null),t.useRef(null),t.useRef(null)],n=e.length,c=15,r=Array.from({length:n}).map((l,o)=>new R().fromArray(Array.from({length:3}).map((x,u)=>2*j.seededRandom(o+u)-1)).normalize().multiplyScalar(c));return Y(({clock:l})=>{const o=l.getElapsedTime(),x=5e-4,u=.05;let p,M=0;e.forEach((A,f)=>{A.current&&(p=r[f],M=Math.sin(u*(.5+.5*j.seededRandom(f))*o+j.seededRandom(f)/u),A.current.position.set(p.x*M,p.y*M,p.z*M),A.current.rotation.z+=x*Math.cos((.5+.5*j.seededRandom(f))*o),A.current.rotation.y+=x*Math.cos((.5+.5*j.seededRandom(f))*o))})}),i.jsx(i.Fragment,{children:e.map((l,o)=>i.jsx(I,{ref:l,position:r[o],rotation:new re(...Array.from({length:3}).map((x,u)=>Math.PI*(2*j.seededRandom(o+u)-1))),...s},o))})},we=({coordinateMapper:s})=>{const{multi:e,helixLength:n,helixRadius:c,helixWindingSeparation:r,strandRadius:l,baseSpacing:o,strandOffsetRad:x,mirrorEffects:u,fixedBaseGap:p}=ae();return e?i.jsx(Ae,{coordinateMapper:s,helixLength:n,helixRadius:c,helixWindingSeparation:r,strandRadius:l,baseSpacing:o,strandOffsetRad:x,mirrorEffects:u,fixedBaseGap:p}):i.jsx(I,{coordinateMapper:s,helixLength:n,helixRadius:c,helixWindingSeparation:r,strandRadius:l,baseSpacing:o,strandOffsetRad:x,mirrorEffects:u,fixedBaseGap:p})},Ee=({...s})=>i.jsxs(i.Fragment,{children:[i.jsx(we,{...s}),i.jsxs(he,{children:[i.jsx(fe,{focusDistance:0,focalLength:.02,bokehScale:3,height:480}),i.jsx(xe,{luminanceThreshold:0,luminanceSmoothing:.9,height:300}),i.jsx(pe,{opacity:.02}),i.jsx(ge,{eskil:!1,offset:.1,darkness:1.1})]})]});export{Ee as default}; diff --git a/assets/reactive-49d9d480.js b/assets/reactive-ebece92c.js similarity index 95% rename from assets/reactive-49d9d480.js rename to assets/reactive-ebece92c.js index 069dc2f0..8273b441 100644 --- a/assets/reactive-49d9d480.js +++ b/assets/reactive-ebece92c.js @@ -1 +1 @@ -import{r as h,M as P,u as S,C as A,a as T,c as B,j as o,B as C,b as I,a6 as V,G as Y,V as z}from"./index-cf06fcba.js";const O=({coordinateMapper:i,nGridRows:e=100,nGridCols:t=100,cubeSideLength:s=.025,cubeSpacingScalar:l=5})=>{const n=h.useRef(null),M=h.useMemo(()=>new P,[]),w=S(),g=A.getPalette(w).buildLut();return h.useEffect(()=>{if(!g)return;const f=Math.hypot(.5,.5);let u,m,x,c;for(let a=0;a{const u=f.getElapsedTime(),m=e*l*s,x=t*l*s;let c,a,r,j,y,E;for(let p=0;p{const{nRows:e,nCols:t,unitSideLength:s,unitSpacingScalar:l}=V();return o.jsxs(o.Fragment,{children:[o.jsx(O,{coordinateMapper:i,nGridRows:e,nGridCols:t,cubeSideLength:s,cubeSpacingScalar:l}),o.jsx(Y,{position:new z(0,0,-2.5*i.amplitude)})]})};export{X as default}; +import{r as h,M as P,u as S,C as A,a as T,c as B,j as o,B as C,b as I,a6 as V,G as Y,V as z}from"./index-bce4be0d.js";const O=({coordinateMapper:i,nGridRows:e=100,nGridCols:t=100,cubeSideLength:s=.025,cubeSpacingScalar:l=5})=>{const n=h.useRef(null),M=h.useMemo(()=>new P,[]),w=S(),g=A.getPalette(w).buildLut();return h.useEffect(()=>{if(!g)return;const f=Math.hypot(.5,.5);let u,m,x,c;for(let a=0;a{const u=f.getElapsedTime(),m=e*l*s,x=t*l*s;let c,a,r,j,y,E;for(let p=0;p{const{nRows:e,nCols:t,unitSideLength:s,unitSpacingScalar:l}=V();return o.jsxs(o.Fragment,{children:[o.jsx(O,{coordinateMapper:i,nGridRows:e,nGridCols:t,cubeSideLength:s,cubeSpacingScalar:l}),o.jsx(Y,{position:new z(0,0,-2.5*i.amplitude)})]})};export{X as default}; diff --git a/assets/reactive-f2d65ad9.js b/assets/reactive-f2d65ad9.js new file mode 100644 index 00000000..4d2eaaf1 --- /dev/null +++ b/assets/reactive-f2d65ad9.js @@ -0,0 +1,2 @@ +import{aa as xe,ab as oe,ac as Me,R as Ne,ad as Ie,ae as P,af as W,n as x,ag as we,ah as Qe,ai as _e,b as _,aj as K,o as De,M as k,V as L,ak as ve,al as V,am as ke,an as Xe,a0 as v,ao as je,L as Re,ap as ge,aq as ie,ar as Ye,K as z,as as Ze,at as ce,v as We,au as Ve,$ as Te,av as qe,J as ze,aw as $e,ax as et,ay as tt,az as st,aA as $,P as nt,h as rt,aB as ot,aC as it,aD as He,aE as at,aF as At,Q as Be,N as ct,aG as Bt,aH as Ct,aI as lt,aJ as ut,aK as ht,aL as dt,x as ft,aM as Ft,O as de,aN as Gt,aO as fe,aP as mt,aQ as Et,aR as pt,aS as Mt,aT as Ce,r as R,aU as It,a as le,u as Je,C as Le,j as g,a9 as Dt,c as Rt,B as gt}from"./index-bce4be0d.js";import{e as Tt,E as Ht}from"./easing-a3fe9c65.js";function Fe(C,e){if(e===xe)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),C;if(e===oe||e===Me){let t=C.getIndex();if(t===null){const r=[],a=C.getAttribute("position");if(a!==void 0){for(let i=0;i=2.0 are supported."));return}const i=new is(n,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});i.fileLoader.setRequestHeader(this.requestHeader);for(let A=0;A=0&&a[c]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+c+'".')}}i.setExtensions(r),i.setPlugins(a),i.parse(o,s)}parseAsync(e,t){const o=this;return new Promise(function(s,n){o.parse(e,t,s,n)})}}function Lt(){let C={};return{get:function(e){return C[e]},add:function(e,t){C[e]=t},remove:function(e){delete C[e]},removeAll:function(){C={}}}}const G={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class bt{constructor(e){this.parser=e,this.name=G.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let o=0,s=t.length;o=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,n.source,r)}}class vt{constructor(e){this.parser=e,this.name=G.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,o=this.parser,s=o.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;const r=n.extensions[t],a=s.images[r.source];let i=o.textureLoader;if(a.uri){const A=o.options.manager.getHandler(a.uri);A!==null&&(i=A)}return this.detectSupport().then(function(A){if(A)return o.loadTextureImage(e,r.source,i);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return o.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class kt{constructor(e){this.parser=e,this.name=G.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,o=this.parser,s=o.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;const r=n.extensions[t],a=s.images[r.source];let i=o.textureLoader;if(a.uri){const A=o.options.manager.getHandler(a.uri);A!==null&&(i=A)}return this.detectSupport().then(function(A){if(A)return o.loadTextureImage(e,r.source,i);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return o.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class Xt{constructor(e){this.name=G.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,o=t.bufferViews[e];if(o.extensions&&o.extensions[this.name]){const s=o.extensions[this.name],n=this.parser.getDependency("buffer",s.buffer),r=this.parser.options.meshoptDecoder;if(!r||!r.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return n.then(function(a){const i=s.byteOffset||0,A=s.byteLength||0,c=s.count,B=s.byteStride,l=new Uint8Array(a,i,A);return r.decodeGltfBufferAsync?r.decodeGltfBufferAsync(c,B,l,s.mode,s.filter).then(function(u){return u.buffer}):r.ready.then(function(){const u=new ArrayBuffer(c*B);return r.decodeGltfBuffer(new Uint8Array(u),c,B,l,s.mode,s.filter),u})})}else return null}}class jt{constructor(e){this.name=G.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,o=t.nodes[e];if(!o.extensions||!o.extensions[this.name]||o.mesh===void 0)return null;const s=t.meshes[o.mesh];for(const A of s.primitives)if(A.mode!==T.TRIANGLES&&A.mode!==T.TRIANGLE_STRIP&&A.mode!==T.TRIANGLE_FAN&&A.mode!==void 0)return null;const r=o.extensions[this.name].attributes,a=[],i={};for(const A in r)a.push(this.parser.getDependency("accessor",r[A]).then(c=>(i[A]=c,i[A])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(A=>{const c=A.pop(),B=c.isGroup?c.children:[c],l=A[0].count,u=[];for(const h of B){const d=new k,f=new L,F=new Be,p=new L(1,1,1),m=new ve(h.geometry,h.material,l);for(let E=0;E=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},S={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},$t={CUBICSPLINE:void 0,LINEAR:He,STEP:dt},te={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function es(C){return C.DefaultMaterial===void 0&&(C.DefaultMaterial=new ce({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:ft})),C.DefaultMaterial}function U(C,e,t){for(const o in t.extensions)C[o]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[o]=t.extensions[o])}function y(C,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(C.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function ts(C,e,t){let o=!1,s=!1,n=!1;for(let A=0,c=e.length;A0||C.search(/^data\:image\/jpeg/)===0?"image/jpeg":C.search(/\.webp($|\?)/i)>0||C.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const os=new k;class is{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Lt,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let o=!1,s=!1,n=-1;typeof navigator<"u"&&typeof navigator.userAgent<"u"&&(o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,s=navigator.userAgent.indexOf("Firefox")>-1,n=s?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||o||s&&n<98?this.textureLoader=new ke(this.options.manager):this.textureLoader=new Xe(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new W(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const o=this,s=this.json,n=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(r){return r._markDefs&&r._markDefs()}),Promise.all(this._invokeAll(function(r){return r.beforeRoot&&r.beforeRoot()})).then(function(){return Promise.all([o.getDependencies("scene"),o.getDependencies("animation"),o.getDependencies("camera")])}).then(function(r){const a={scene:r[0][s.scene||0],scenes:r[0],animations:r[1],cameras:r[2],asset:s.asset,parser:o,userData:{}};U(n,a,s),y(a,s),Promise.all(o._invokeAll(function(i){return i.afterRoot&&i.afterRoot(a)})).then(function(){e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],o=this.json.meshes||[];for(let s=0,n=t.length;s{const i=this.associations.get(r);i!=null&&this.associations.set(a,i);for(const[A,c]of r.children.entries())n(c,a.children[A])};return n(o,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let o=0;o=2&&f.setY(b,M[I*i+1]),i>=3&&f.setZ(b,M[I*i+2]),i>=4&&f.setW(b,M[I*i+3]),i>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return f})}loadTexture(e){const t=this.json,o=this.options,n=t.textures[e].source,r=t.images[n];let a=this.textureLoader;if(r.uri){const i=o.manager.getHandler(r.uri);i!==null&&(a=i)}return this.loadTextureImage(e,n,a)}loadTextureImage(e,t,o){const s=this,n=this.json,r=n.textures[e],a=n.images[t],i=(a.uri||a.bufferView)+":"+r.sampler;if(this.textureCache[i])return this.textureCache[i];const A=this.loadImageSource(t,o).then(function(c){c.flipY=!1,c.name=r.name||a.name||"",c.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(c.name=a.uri);const l=(n.samplers||{})[r.sampler]||{};return c.magFilter=me[l.magFilter]||Re,c.minFilter=me[l.minFilter]||ge,c.wrapS=Ee[l.wrapS]||ie,c.wrapT=Ee[l.wrapT]||ie,s.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[i]=A,A}loadImageSource(e,t){const o=this,s=this.json,n=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(B=>B.clone());const r=s.images[e],a=self.URL||self.webkitURL;let i=r.uri||"",A=!1;if(r.bufferView!==void 0)i=o.getDependency("bufferView",r.bufferView).then(function(B){A=!0;const l=new Blob([B],{type:r.mimeType});return i=a.createObjectURL(l),i});else if(r.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(i).then(function(B){return new Promise(function(l,u){let h=l;t.isImageBitmapLoader===!0&&(h=function(d){const f=new de(d);f.needsUpdate=!0,l(f)}),t.load(P.resolveURL(B,n.path),h,void 0,u)})}).then(function(B){return A===!0&&a.revokeObjectURL(i),B.userData.mimeType=r.mimeType||rs(r.uri),B}).catch(function(B){throw console.error("THREE.GLTFLoader: Couldn't load texture",i),B});return this.sourceCache[e]=c,c}assignTexture(e,t,o,s){const n=this;return this.getDependency("texture",o.index).then(function(r){if(!r)return null;if(o.texCoord!==void 0&&o.texCoord>0&&(r=r.clone(),r.channel=o.texCoord),n.extensions[G.KHR_TEXTURE_TRANSFORM]){const a=o.extensions!==void 0?o.extensions[G.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const i=n.associations.get(r);r=n.extensions[G.KHR_TEXTURE_TRANSFORM].extendTexture(r,a),n.associations.set(r,i)}}return s!==void 0&&("colorSpace"in r?r.colorSpace=s===3001?"srgb":"srgb-linear":r.encoding=s),e[t]=r,r})}assignFinalMaterial(e){const t=e.geometry;let o=e.material;const s=t.attributes.tangent===void 0,n=t.attributes.color!==void 0,r=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+o.uuid;let i=this.cache.get(a);i||(i=new Ye,z.prototype.copy.call(i,o),i.color.copy(o.color),i.map=o.map,i.sizeAttenuation=!1,this.cache.add(a,i)),o=i}else if(e.isLine){const a="LineBasicMaterial:"+o.uuid;let i=this.cache.get(a);i||(i=new Ze,z.prototype.copy.call(i,o),i.color.copy(o.color),i.map=o.map,this.cache.add(a,i)),o=i}if(s||n||r){let a="ClonedMaterial:"+o.uuid+":";s&&(a+="derivative-tangents:"),n&&(a+="vertex-colors:"),r&&(a+="flat-shading:");let i=this.cache.get(a);i||(i=o.clone(),n&&(i.vertexColors=!0),r&&(i.flatShading=!0),s&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),this.cache.add(a,i),this.associations.set(i,this.associations.get(o))),o=i}e.material=o}getMaterialType(){return ce}loadMaterial(e){const t=this,o=this.json,s=this.extensions,n=o.materials[e];let r;const a={},i=n.extensions||{},A=[];if(i[G.KHR_MATERIALS_UNLIT]){const B=s[G.KHR_MATERIALS_UNLIT];r=B.getMaterialType(),A.push(B.extendParams(a,n,t))}else{const B=n.pbrMetallicRoughness||{};if(a.color=new x(1,1,1),a.opacity=1,Array.isArray(B.baseColorFactor)){const l=B.baseColorFactor;a.color.fromArray(l),a.opacity=l[3]}B.baseColorTexture!==void 0&&A.push(t.assignTexture(a,"map",B.baseColorTexture,3001)),a.metalness=B.metallicFactor!==void 0?B.metallicFactor:1,a.roughness=B.roughnessFactor!==void 0?B.roughnessFactor:1,B.metallicRoughnessTexture!==void 0&&(A.push(t.assignTexture(a,"metalnessMap",B.metallicRoughnessTexture)),A.push(t.assignTexture(a,"roughnessMap",B.metallicRoughnessTexture))),r=this._invokeOne(function(l){return l.getMaterialType&&l.getMaterialType(e)}),A.push(Promise.all(this._invokeAll(function(l){return l.extendMaterialParams&&l.extendMaterialParams(e,a)})))}n.doubleSided===!0&&(a.side=We);const c=n.alphaMode||te.OPAQUE;if(c===te.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,c===te.MASK&&(a.alphaTest=n.alphaCutoff!==void 0?n.alphaCutoff:.5)),n.normalTexture!==void 0&&r!==_&&(A.push(t.assignTexture(a,"normalMap",n.normalTexture)),a.normalScale=new De(1,1),n.normalTexture.scale!==void 0)){const B=n.normalTexture.scale;a.normalScale.set(B,B)}return n.occlusionTexture!==void 0&&r!==_&&(A.push(t.assignTexture(a,"aoMap",n.occlusionTexture)),n.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=n.occlusionTexture.strength)),n.emissiveFactor!==void 0&&r!==_&&(a.emissive=new x().fromArray(n.emissiveFactor)),n.emissiveTexture!==void 0&&r!==_&&A.push(t.assignTexture(a,"emissiveMap",n.emissiveTexture,3001)),Promise.all(A).then(function(){const B=new r(a);return n.name&&(B.name=n.name),y(B,n),t.associations.set(B,{materials:e}),n.extensions&&U(s,B,n),B})}createUniqueName(e){const t=Ve.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,o=this.extensions,s=this.primitiveCache;function n(a){return o[G.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(i){return pe(i,a,t)})}const r=[];for(let a=0,i=e.length;a0&&ss(F,n),F.name=t.createUniqueName(n.name||"mesh_"+e),y(F,n),f.extensions&&U(s,F,f),t.assignFinalMaterial(F),B.push(F)}for(let u=0,h=B.length;u1?c=new $:A.length===1?c=A[0]:c=new V,c!==A[0])for(let B=0,l=A.length;B{const B=new Map;for(const[l,u]of s.associations)(l instanceof z||l instanceof de)&&B.set(l,u);return c.traverse(l=>{const u=s.associations.get(l);u!=null&&B.set(l,u)}),B};return s.associations=A(n),n})}}function as(C,e,t){const o=e.attributes,s=new Et;if(o.POSITION!==void 0){const a=t.json.accessors[o.POSITION],i=a.min,A=a.max;if(i!==void 0&&A!==void 0){if(s.set(new L(i[0],i[1],i[2]),new L(A[0],A[1],A[2])),a.normalized){const c=Ae(w[a.componentType]);s.min.multiplyScalar(c),s.max.multiplyScalar(c)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const n=e.targets;if(n!==void 0){const a=new L,i=new L;for(let A=0,c=n.length;A{const a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(r,a).then(t).catch(s)},o,s)}decodeDracoFile(e,t,o,s){const n={attributeIDs:o||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!o};this.decodeGeometry(e,n).then(t)}decodeGeometry(e,t){for(const i in t.attributeTypes){const A=t.attributeTypes[i];A.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[i]=A.name)}const o=JSON.stringify(t);if(ne.has(e)){const i=ne.get(e);if(i.key===o)return i.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let s;const n=this.workerNextTaskID++,r=e.byteLength,a=this._getWorker(n,r).then(i=>(s=i,new Promise((A,c)=>{s._callbacks[n]={resolve:A,reject:c},s.postMessage({type:"decode",id:n,taskConfig:t,buffer:e},[e])}))).then(i=>this._createGeometry(i.geometry));return a.catch(()=>!0).then(()=>{s&&n&&this._releaseTask(s,n)}),ne.set(e,{key:o,promise:a}),a}_createGeometry(e){const t=new Te;e.index&&t.setIndex(new v(e.index.array,1));for(let o=0;o{o.load(e,s,void 0,n)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(o=>{const s=o[0];e||(this.decoderConfig.wasmBinary=o[1]);const n=cs.toString(),r=["/* draco decoder */",s,"","/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join(` +`);this.workerSourceURL=URL.createObjectURL(new Blob([r]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengthn._taskLoad?-1:1});const o=this.workerPool[this.workerPool.length-1];return o._taskCosts[e]=t,o._taskLoad+=t,o})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{const B=c.draco,l=new B.Decoder,u=new B.DecoderBuffer;u.Init(new Int8Array(i),i.byteLength);try{const h=t(B,l,u,A),d=h.attributes.map(f=>f.array.buffer);h.index&&d.push(h.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:h},d)}catch(h){console.error(h),self.postMessage({type:"error",id:a.id,error:h.message})}finally{B.destroy(u),B.destroy(l)}});break}};function t(r,a,i,A){const c=A.attributeIDs,B=A.attributeTypes;let l,u;const h=a.GetEncodedGeometryType(i);if(h===r.TRIANGULAR_MESH)l=new r.Mesh,u=a.DecodeBufferToMesh(i,l);else if(h===r.POINT_CLOUD)l=new r.PointCloud,u=a.DecodeBufferToPointCloud(i,l);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!u.ok()||l.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+u.error_msg());const d={index:null,attributes:[]};for(const f in c){const F=self[B[f]];let p,m;if(A.useUniqueIDs)m=c[f],p=a.GetAttributeByUniqueId(l,m);else{if(m=a.GetAttributeId(l,r[c[f]]),m===-1)continue;p=a.GetAttribute(l,m)}d.attributes.push(s(r,a,l,f,F,p))}return h===r.TRIANGULAR_MESH&&(d.index=o(r,a,l)),r.destroy(l),d}function o(r,a,i){const c=i.num_faces()*3,B=c*4,l=r._malloc(B);a.GetTrianglesUInt32Array(i,B,l);const u=new Uint32Array(r.HEAPF32.buffer,l,c).slice();return r._free(l),{array:u,itemSize:1}}function s(r,a,i,A,c,B){const l=B.num_components(),h=i.num_points()*l,d=h*c.BYTES_PER_ELEMENT,f=n(r,c),F=r._malloc(d);a.GetAttributeDataArrayForAllPoints(i,B,f,d,F);const p=new c(r.HEAPF32.buffer,F,h).slice();return r._free(F),{name:A,array:p,itemSize:l}}function n(r,a){switch(a){case Float32Array:return r.DT_FLOAT32;case Int8Array:return r.DT_INT8;case Int16Array:return r.DT_INT16;case Int32Array:return r.DT_INT32;case Uint8Array:return r.DT_UINT8;case Uint16Array:return r.DT_UINT16;case Uint32Array:return r.DT_UINT32}}}let Y;const re=()=>{if(Y)return Y;const C="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",e="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),o=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!="object")return{supported:!1};let s=C;WebAssembly.validate(t)&&(s=e);let n;const r=WebAssembly.instantiate(a(s),{}).then(B=>{n=B.instance,n.exports.__wasm_call_ctors()});function a(B){const l=new Uint8Array(B.length);for(let h=0;h96?d-71:d>64?d-65:d>47?d+4:d>46?63:62}let u=0;for(let h=0;h{t&&t(o),C&&(Z||(Z=new As),Z.setDecoderPath(typeof C=="string"?C:Se),o.setDRACOLoader(Z)),e&&o.setMeshoptDecoder(typeof re=="function"?re():re)}}function q(C,e=!0,t=!0,o){return Ce(ue,C,ye(e,t,o))}q.preload=(C,e=!0,t=!0,o)=>Ce.preload(ue,C,ye(e,t,o));q.clear=C=>Ce.clear(ue,C);q.setDecoderPath=C=>{Se=C};function Bs(C,e){const t=R.useRef(),[o]=R.useState(()=>e?e instanceof V?{current:e}:e:t),[s]=R.useState(()=>new It(void 0));R.useLayoutEffect(()=>{e&&(o.current=e instanceof V?e:e.current),s._root=o.current});const n=R.useRef({}),r=R.useMemo(()=>{const a={};return C.forEach(i=>Object.defineProperty(a,i.name,{enumerable:!0,get(){if(o.current)return n.current[i.name]||(n.current[i.name]=s.clipAction(i,o.current))},configurable:!0})),{ref:o,clips:C,actions:a,names:C.map(i=>i.name),mixer:s}},[C]);return le((a,i)=>s.update(i)),R.useEffect(()=>{const a=o.current;return()=>{n.current={},s.stopAllAction(),Object.values(r.actions).forEach(i=>{a&&s.uncacheAction(i,a)})}},[C]),r}const Cs="/r3f-audio-visualizer/assets/horse-bebaa4a6.png",ls=C=>{const e=R.useRef(null),{nodes:t,animations:o}=q(Cs),s=Je(),n=Le.getPalette(s).buildLut(),r=R.useMemo(()=>g.jsx("meshStandardMaterial",{color:n.getColor(.5),flatShading:!0}),[n]),{actions:a}=Bs(o,e);return R.useEffect(()=>{var i;(i=a==null?void 0:a.horse_A_)==null||i.play()}),le(({clock:i})=>{var l;const A=i.getElapsedTime(),B=(Math.sin(.5*A)+1)/2;(l=a==null?void 0:a.horse_A_)==null||l.setEffectiveTimeScale(B)}),g.jsx("group",{ref:e,scale:[.025,.025,.025],rotation:[Math.PI/2,Math.PI,0],dispose:null,children:g.jsxs("group",{name:"AuxScene",children:[g.jsx("pointLight",{position:[10,100,200],intensity:100}),g.jsx("mesh",{name:"mesh_0",castShadow:!0,receiveShadow:!0,geometry:t.mesh_0.geometry,morphTargetDictionary:t.mesh_0.morphTargetDictionary,morphTargetInfluences:t.mesh_0.morphTargetInfluences,children:r})]})})},us=[[-1,1],[-.75,-.1],[-.6,0],[0,0],[.6,0],[.75,-.1],[1,1]],hs=({nStones:C=30,stoneWidth:e=5,stoneHeight:t=.1,stoneLength:o=1,coordinateMapper:s})=>{const n=R.useRef(null),[r,a,i,A]=R.useMemo(()=>[new k,new L,new Be,new L],[]),c=R.useMemo(()=>new Dt(us.map(h=>new L(0,h[0],h[1]).multiplyScalar(10)),!1,"catmullrom",.1),[]),B=Je(),l=Le.getPalette(B).buildLut();return R.useEffect(()=>{if(n.current){for(let u=0;u{if(!n.current)return;const h=u.getElapsedTime(),d=.025,f=.5,p=d*(h-Math.cos(f*h)/f)%1,m=1-Tt(p,Ht.LINEAR);for(let E=0;Eg.jsxs(g.Fragment,{children:[g.jsx(hs,{...C}),g.jsx(ls,{...C})]});export{Fs as default}; diff --git a/assets/reactive-66e7642c.js b/assets/reactive-f52bc967.js similarity index 89% rename from assets/reactive-66e7642c.js rename to assets/reactive-f52bc967.js index e72c3034..c628237a 100644 --- a/assets/reactive-66e7642c.js +++ b/assets/reactive-f52bc967.js @@ -1 +1 @@ -import{g as x,r as h,a as g,c as j,j as e,T as R,e as E,G as T,V as b}from"./index-cf06fcba.js";import{E as y,B as A,N as C}from"./Noise-108969e2.js";const D=({coordinateMapper:t,radius:i=2,pointSize:o=.2,nPoints:s=1e3,mirrorEffects:m=!1})=>{const l=Array.from({length:s}).map(x),f=h.useRef(null);return g(({clock:d})=>{const p=d.getElapsedTime();let n,r,u;const c=f.current.geometry.attributes.position;for(let a=0;a{const{radius:i,pointSize:o,mirrorEffects:s}=E();return e.jsxs(e.Fragment,{children:[e.jsx(D,{coordinateMapper:t,radius:i,pointSize:o,mirrorEffects:s}),e.jsx(T,{position:new b(0,0,-1.5*t.amplitude)})]})},F=({...t})=>e.jsxs(e.Fragment,{children:[e.jsx(S,{...t}),e.jsxs(y,{children:[e.jsx(A,{luminanceThreshold:.5,luminanceSmoothing:1,height:300}),e.jsx(C,{opacity:.05})]})]});export{F as default}; +import{g as x,r as h,a as g,c as j,j as e,T as R,e as E,G as T,V as b}from"./index-bce4be0d.js";import{E as y,B as A,N as C}from"./Noise-e2defa57.js";const D=({coordinateMapper:t,radius:i=2,pointSize:o=.2,nPoints:s=1e3,mirrorEffects:m=!1})=>{const l=Array.from({length:s}).map(x),f=h.useRef(null);return g(({clock:d})=>{const p=d.getElapsedTime();let n,r,u;const c=f.current.geometry.attributes.position;for(let a=0;a{const{radius:i,pointSize:o,mirrorEffects:s}=E();return e.jsxs(e.Fragment,{children:[e.jsx(D,{coordinateMapper:t,radius:i,pointSize:o,mirrorEffects:s}),e.jsx(T,{position:new b(0,0,-1.5*t.amplitude)})]})},F=({...t})=>e.jsxs(e.Fragment,{children:[e.jsx(S,{...t}),e.jsxs(y,{children:[e.jsx(A,{luminanceThreshold:.5,luminanceSmoothing:1,height:300}),e.jsx(C,{opacity:.05})]})]});export{F as default}; diff --git a/index.html b/index.html index 26732544..fbfee575 100644 --- a/index.html +++ b/index.html @@ -9,8 +9,8 @@ Interactive Audio Visualizer - - + +