tokentracker-cli 0.5.67 → 0.5.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (18) hide show
  1. package/dashboard/dist/assets/{Card-CmQkSaLn.js → Card-ClNKd74W.js} +1 -1
  2. package/dashboard/dist/assets/{DashboardPage-BZt5y5gb.js → DashboardPage-DiUhik_k.js} +1 -1
  3. package/dashboard/dist/assets/{FadeIn-DuJxITM1.js → FadeIn-c2wFBL_u.js} +1 -1
  4. package/dashboard/dist/assets/{IpCheckPage-DseJuOvq.js → IpCheckPage-UPn-zQGB.js} +1 -1
  5. package/dashboard/dist/assets/{LeaderboardPage-CjgASqSw.js → LeaderboardPage-ZpuPopCf.js} +1 -1
  6. package/dashboard/dist/assets/{LeaderboardProfilePage-BTs27wAX.js → LeaderboardProfilePage-C62TdxVy.js} +1 -1
  7. package/dashboard/dist/assets/{LimitsPage-Drc8wTon.js → LimitsPage-CQEaB_b2.js} +1 -1
  8. package/dashboard/dist/assets/{SettingsPage-mCnpRVuo.js → SettingsPage-8RdfHCcA.js} +1 -1
  9. package/dashboard/dist/assets/{WidgetsPage-qlO-IWyq.js → WidgetsPage-DiKFOpFH.js} +1 -1
  10. package/dashboard/dist/assets/{download-Bk0FNyrl.js → download-BmThIfGZ.js} +1 -1
  11. package/dashboard/dist/assets/{leaderboard-columns-DH6pCqaP.js → leaderboard-columns-9wPbwNaz.js} +1 -1
  12. package/dashboard/dist/assets/{main-Cm7tlYw7.css → main-CNzfq4Ln.css} +1 -1
  13. package/dashboard/dist/assets/{main-B377b_ow.js → main-D49FUfq7.js} +3 -3
  14. package/dashboard/dist/assets/{use-limits-display-prefs-SzjCvEJq.js → use-limits-display-prefs-BHo0gzBa.js} +1 -1
  15. package/dashboard/dist/assets/{use-usage-limits-BHeInsQY.js → use-usage-limits-BGttWixw.js} +1 -1
  16. package/dashboard/dist/index.html +2 -2
  17. package/dashboard/dist/share.html +2 -2
  18. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-BZt5y5gb.js","assets/use-usage-limits-BHeInsQY.js","assets/Card-CmQkSaLn.js","assets/FadeIn-DuJxITM1.js","assets/LeaderboardPage-CjgASqSw.js","assets/leaderboard-columns-DH6pCqaP.js","assets/LeaderboardProfilePage-BTs27wAX.js","assets/LimitsPage-Drc8wTon.js","assets/use-limits-display-prefs-SzjCvEJq.js","assets/SettingsPage-mCnpRVuo.js","assets/download-Bk0FNyrl.js","assets/WidgetsPage-qlO-IWyq.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-DiUhik_k.js","assets/use-usage-limits-BGttWixw.js","assets/Card-ClNKd74W.js","assets/FadeIn-c2wFBL_u.js","assets/LeaderboardPage-ZpuPopCf.js","assets/leaderboard-columns-9wPbwNaz.js","assets/LeaderboardProfilePage-C62TdxVy.js","assets/LimitsPage-CQEaB_b2.js","assets/use-limits-display-prefs-BHo0gzBa.js","assets/SettingsPage-8RdfHCcA.js","assets/download-BmThIfGZ.js","assets/WidgetsPage-DiKFOpFH.js"])))=>i.map(i=>d[i]);
2
2
  function v2(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();function OE(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function y2(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function i(){var r=!1;try{r=this instanceof i}catch{}return r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return t[i]}})}),n}var Sm={exports:{}},Ic={},wm={exports:{}},Jt={};var Tb;function _2(){if(Tb)return Jt;Tb=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function m(z){return z===null||typeof z!="object"?null:(z=p&&z[p]||z["@@iterator"],typeof z=="function"?z:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,w={};function y(z,ie,Ee){this.props=z,this.context=ie,this.refs=w,this.updater=Ee||v}y.prototype.isReactComponent={},y.prototype.setState=function(z,ie){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,ie,"setState")},y.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function b(){}b.prototype=y.prototype;function T(z,ie,Ee){this.props=z,this.context=ie,this.refs=w,this.updater=Ee||v}var A=T.prototype=new b;A.constructor=T,_(A,y.prototype),A.isPureReactComponent=!0;var M=Array.isArray,I=Object.prototype.hasOwnProperty,k={current:null},U={key:!0,ref:!0,__self:!0,__source:!0};function S(z,ie,Ee){var ze,Se={},ne=null,ye=null;if(ie!=null)for(ze in ie.ref!==void 0&&(ye=ie.ref),ie.key!==void 0&&(ne=""+ie.key),ie)I.call(ie,ze)&&!U.hasOwnProperty(ze)&&(Se[ze]=ie[ze]);var be=arguments.length-2;if(be===1)Se.children=Ee;else if(1<be){for(var Ne=Array(be),et=0;et<be;et++)Ne[et]=arguments[et+2];Se.children=Ne}if(z&&z.defaultProps)for(ze in be=z.defaultProps,be)Se[ze]===void 0&&(Se[ze]=be[ze]);return{$$typeof:t,type:z,key:ne,ref:ye,props:Se,_owner:k.current}}function P(z,ie){return{$$typeof:t,type:z.type,key:ie,ref:z.ref,props:z.props,_owner:z._owner}}function V(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function O(z){var ie={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(Ee){return ie[Ee]})}var G=/\/+/g;function J(z,ie){return typeof z=="object"&&z!==null&&z.key!=null?O(""+z.key):ie.toString(36)}function H(z,ie,Ee,ze,Se){var ne=typeof z;(ne==="undefined"||ne==="boolean")&&(z=null);var ye=!1;if(z===null)ye=!0;else switch(ne){case"string":case"number":ye=!0;break;case"object":switch(z.$$typeof){case t:case e:ye=!0}}if(ye)return ye=z,Se=Se(ye),z=ze===""?"."+J(ye,0):ze,M(Se)?(Ee="",z!=null&&(Ee=z.replace(G,"$&/")+"/"),H(Se,ie,Ee,"",function(et){return et})):Se!=null&&(V(Se)&&(Se=P(Se,Ee+(!Se.key||ye&&ye.key===Se.key?"":(""+Se.key).replace(G,"$&/")+"/")+z)),ie.push(Se)),1;if(ye=0,ze=ze===""?".":ze+":",M(z))for(var be=0;be<z.length;be++){ne=z[be];var Ne=ze+J(ne,be);ye+=H(ne,ie,Ee,Ne,Se)}else if(Ne=m(z),typeof Ne=="function")for(z=Ne.call(z),be=0;!(ne=z.next()).done;)ne=ne.value,Ne=ze+J(ne,be++),ye+=H(ne,ie,Ee,Ne,Se);else if(ne==="object")throw ie=String(z),Error("Objects are not valid as a React child (found: "+(ie==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":ie)+"). If you meant to render a collection of children, use an array instead.");return ye}function X(z,ie,Ee){if(z==null)return z;var ze=[],Se=0;return H(z,ze,"","",function(ne){return ie.call(Ee,ne,Se++)}),ze}function K(z){if(z._status===-1){var ie=z._result;ie=ie(),ie.then(function(Ee){(z._status===0||z._status===-1)&&(z._status=1,z._result=Ee)},function(Ee){(z._status===0||z._status===-1)&&(z._status=2,z._result=Ee)}),z._status===-1&&(z._status=0,z._result=ie)}if(z._status===1)return z._result.default;throw z._result}var Q={current:null},W={transition:null},q={ReactCurrentDispatcher:Q,ReactCurrentBatchConfig:W,ReactCurrentOwner:k};function Z(){throw Error("act(...) is not supported in production builds of React.")}return Jt.Children={map:X,forEach:function(z,ie,Ee){X(z,function(){ie.apply(this,arguments)},Ee)},count:function(z){var ie=0;return X(z,function(){ie++}),ie},toArray:function(z){return X(z,function(ie){return ie})||[]},only:function(z){if(!V(z))throw Error("React.Children.only expected to receive a single React element child.");return z}},Jt.Component=y,Jt.Fragment=n,Jt.Profiler=r,Jt.PureComponent=T,Jt.StrictMode=i,Jt.Suspense=u,Jt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,Jt.act=Z,Jt.cloneElement=function(z,ie,Ee){if(z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+z+".");var ze=_({},z.props),Se=z.key,ne=z.ref,ye=z._owner;if(ie!=null){if(ie.ref!==void 0&&(ne=ie.ref,ye=k.current),ie.key!==void 0&&(Se=""+ie.key),z.type&&z.type.defaultProps)var be=z.type.defaultProps;for(Ne in ie)I.call(ie,Ne)&&!U.hasOwnProperty(Ne)&&(ze[Ne]=ie[Ne]===void 0&&be!==void 0?be[Ne]:ie[Ne])}var Ne=arguments.length-2;if(Ne===1)ze.children=Ee;else if(1<Ne){be=Array(Ne);for(var et=0;et<Ne;et++)be[et]=arguments[et+2];ze.children=be}return{$$typeof:t,type:z.type,key:Se,ref:ne,props:ze,_owner:ye}},Jt.createContext=function(z){return z={$$typeof:o,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},z.Provider={$$typeof:s,_context:z},z.Consumer=z},Jt.createElement=S,Jt.createFactory=function(z){var ie=S.bind(null,z);return ie.type=z,ie},Jt.createRef=function(){return{current:null}},Jt.forwardRef=function(z){return{$$typeof:c,render:z}},Jt.isValidElement=V,Jt.lazy=function(z){return{$$typeof:h,_payload:{_status:-1,_result:z},_init:K}},Jt.memo=function(z,ie){return{$$typeof:d,type:z,compare:ie===void 0?null:ie}},Jt.startTransition=function(z){var ie=W.transition;W.transition={};try{z()}finally{W.transition=ie}},Jt.unstable_act=Z,Jt.useCallback=function(z,ie){return Q.current.useCallback(z,ie)},Jt.useContext=function(z){return Q.current.useContext(z)},Jt.useDebugValue=function(){},Jt.useDeferredValue=function(z){return Q.current.useDeferredValue(z)},Jt.useEffect=function(z,ie){return Q.current.useEffect(z,ie)},Jt.useId=function(){return Q.current.useId()},Jt.useImperativeHandle=function(z,ie,Ee){return Q.current.useImperativeHandle(z,ie,Ee)},Jt.useInsertionEffect=function(z,ie){return Q.current.useInsertionEffect(z,ie)},Jt.useLayoutEffect=function(z,ie){return Q.current.useLayoutEffect(z,ie)},Jt.useMemo=function(z,ie){return Q.current.useMemo(z,ie)},Jt.useReducer=function(z,ie,Ee){return Q.current.useReducer(z,ie,Ee)},Jt.useRef=function(z){return Q.current.useRef(z)},Jt.useState=function(z){return Q.current.useState(z)},Jt.useSyncExternalStore=function(z,ie,Ee){return Q.current.useSyncExternalStore(z,ie,Ee)},Jt.useTransition=function(){return Q.current.useTransition()},Jt.version="18.3.1",Jt}var Ab;function Ov(){return Ab||(Ab=1,wm.exports=_2()),wm.exports}var Cb;function x2(){if(Cb)return Ic;Cb=1;var t=Ov(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,r=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(c,u,d){var h,p={},m=null,v=null;d!==void 0&&(m=""+d),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(v=u.ref);for(h in u)i.call(u,h)&&!s.hasOwnProperty(h)&&(p[h]=u[h]);if(c&&c.defaultProps)for(h in u=c.defaultProps,u)p[h]===void 0&&(p[h]=u[h]);return{$$typeof:e,type:c,key:m,ref:v,props:p,_owner:r.current}}return Ic.Fragment=n,Ic.jsx=o,Ic.jsxs=o,Ic}var Pb;function b2(){return Pb||(Pb=1,Sm.exports=x2()),Sm.exports}var F=b2(),L=Ov();const hs=OE(L),BE=v2({__proto__:null,default:hs},[L]);var zd={},Em={exports:{}},Vi={},Mm={exports:{}},Tm={};var Rb;function S2(){return Rb||(Rb=1,(function(t){function e(W,q){var Z=W.length;W.push(q);e:for(;0<Z;){var z=Z-1>>>1,ie=W[z];if(0<r(ie,q))W[z]=q,W[Z]=ie,Z=z;else break e}}function n(W){return W.length===0?null:W[0]}function i(W){if(W.length===0)return null;var q=W[0],Z=W.pop();if(Z!==q){W[0]=Z;e:for(var z=0,ie=W.length,Ee=ie>>>1;z<Ee;){var ze=2*(z+1)-1,Se=W[ze],ne=ze+1,ye=W[ne];if(0>r(Se,Z))ne<ie&&0>r(ye,Se)?(W[z]=ye,W[ne]=Z,z=ne):(W[z]=Se,W[ze]=Z,z=ze);else if(ne<ie&&0>r(ye,Z))W[z]=ye,W[ne]=Z,z=ne;else break e}}return q}function r(W,q){var Z=W.sortIndex-q.sortIndex;return Z!==0?Z:W.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,c=o.now();t.unstable_now=function(){return o.now()-c}}var u=[],d=[],h=1,p=null,m=3,v=!1,_=!1,w=!1,y=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(W){for(var q=n(d);q!==null;){if(q.callback===null)i(d);else if(q.startTime<=W)i(d),q.sortIndex=q.expirationTime,e(u,q);else break;q=n(d)}}function M(W){if(w=!1,A(W),!_)if(n(u)!==null)_=!0,K(I);else{var q=n(d);q!==null&&Q(M,q.startTime-W)}}function I(W,q){_=!1,w&&(w=!1,b(S),S=-1),v=!0;var Z=m;try{for(A(q),p=n(u);p!==null&&(!(p.expirationTime>q)||W&&!O());){var z=p.callback;if(typeof z=="function"){p.callback=null,m=p.priorityLevel;var ie=z(p.expirationTime<=q);q=t.unstable_now(),typeof ie=="function"?p.callback=ie:p===n(u)&&i(u),A(q)}else i(u);p=n(u)}if(p!==null)var Ee=!0;else{var ze=n(d);ze!==null&&Q(M,ze.startTime-q),Ee=!1}return Ee}finally{p=null,m=Z,v=!1}}var k=!1,U=null,S=-1,P=5,V=-1;function O(){return!(t.unstable_now()-V<P)}function G(){if(U!==null){var W=t.unstable_now();V=W;var q=!0;try{q=U(!0,W)}finally{q?J():(k=!1,U=null)}}else k=!1}var J;if(typeof T=="function")J=function(){T(G)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,X=H.port2;H.port1.onmessage=G,J=function(){X.postMessage(null)}}else J=function(){y(G,0)};function K(W){U=W,k||(k=!0,J())}function Q(W,q){S=y(function(){W(t.unstable_now())},q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(W){W.callback=null},t.unstable_continueExecution=function(){_||v||(_=!0,K(I))},t.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<W?Math.floor(1e3/W):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function(W){switch(m){case 1:case 2:case 3:var q=3;break;default:q=m}var Z=m;m=q;try{return W()}finally{m=Z}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(W,q){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var Z=m;m=W;try{return q()}finally{m=Z}},t.unstable_scheduleCallback=function(W,q,Z){var z=t.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?z+Z:z):Z=z,W){case 1:var ie=-1;break;case 2:ie=250;break;case 5:ie=1073741823;break;case 4:ie=1e4;break;default:ie=5e3}return ie=Z+ie,W={id:h++,callback:q,priorityLevel:W,startTime:Z,expirationTime:ie,sortIndex:-1},Z>z?(W.sortIndex=Z,e(d,W),n(u)===null&&W===n(d)&&(w?(b(S),S=-1):w=!0,Q(M,Z-z))):(W.sortIndex=ie,e(u,W),_||v||(_=!0,K(I))),W},t.unstable_shouldYield=O,t.unstable_wrapCallback=function(W){var q=m;return function(){var Z=m;m=q;try{return W.apply(this,arguments)}finally{m=Z}}}})(Tm)),Tm}var kb;function w2(){return kb||(kb=1,Mm.exports=S2()),Mm.exports}var Lb;function E2(){if(Lb)return Vi;Lb=1;var t=Ov(),e=w2();function n(a){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+a,f=1;f<arguments.length;f++)l+="&args[]="+encodeURIComponent(arguments[f]);return"Minified React error #"+a+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,r={};function s(a,l){o(a,l),o(a+"Capture",l)}function o(a,l){for(r[a]=l,a=0;a<l.length;a++)i.add(l[a])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[: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]*$/,h={},p={};function m(a){return u.call(p,a)?!0:u.call(h,a)?!1:d.test(a)?p[a]=!0:(h[a]=!0,!1)}function v(a,l,f,g){if(f!==null&&f.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return g?!1:f!==null?!f.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function _(a,l,f,g){if(l===null||typeof l>"u"||v(a,l,f,g))return!0;if(g)return!1;if(f!==null)switch(f.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function w(a,l,f,g,x,E,D){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=g,this.attributeNamespace=x,this.mustUseProperty=f,this.propertyName=a,this.type=l,this.sanitizeURL=E,this.removeEmptyString=D}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){y[a]=new w(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var l=a[0];y[l]=new w(l,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){y[a]=new w(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){y[a]=new w(a,2,!1,a,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(a){y[a]=new w(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){y[a]=new w(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){y[a]=new w(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){y[a]=new w(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){y[a]=new w(a,5,!1,a.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function T(a){return a[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(a){var l=a.replace(b,T);y[l]=new w(l,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var l=a.replace(b,T);y[l]=new w(l,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var l=a.replace(b,T);y[l]=new w(l,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){y[a]=new w(a,1,!1,a.toLowerCase(),null,!1,!1)}),y.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){y[a]=new w(a,1,!1,a.toLowerCase(),null,!0,!0)});function A(a,l,f,g){var x=y.hasOwnProperty(l)?y[l]:null;(x!==null?x.type!==0:g||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(_(l,f,x,g)&&(f=null),g||x===null?m(l)&&(f===null?a.removeAttribute(l):a.setAttribute(l,""+f)):x.mustUseProperty?a[x.propertyName]=f===null?x.type===3?!1:"":f:(l=x.attributeName,g=x.attributeNamespace,f===null?a.removeAttribute(l):(x=x.type,f=x===3||x===4&&f===!0?"":""+f,g?a.setAttributeNS(g,l,f):a.setAttribute(l,f))))}var M=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,I=Symbol.for("react.element"),k=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),V=Symbol.for("react.provider"),O=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),Q=Symbol.for("react.offscreen"),W=Symbol.iterator;function q(a){return a===null||typeof a!="object"?null:(a=W&&a[W]||a["@@iterator"],typeof a=="function"?a:null)}var Z=Object.assign,z;function ie(a){if(z===void 0)try{throw Error()}catch(f){var l=f.stack.trim().match(/\n( *(at )?)/);z=l&&l[1]||""}return`
3
3
  `+z+a}var Ee=!1;function ze(a,l){if(!a||Ee)return"";Ee=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(ge){var g=ge}Reflect.construct(a,[],l)}else{try{l.call()}catch(ge){g=ge}a.call(l.prototype)}else{try{throw Error()}catch(ge){g=ge}a()}}catch(ge){if(ge&&g&&typeof ge.stack=="string"){for(var x=ge.stack.split(`
4
4
  `),E=g.stack.split(`
@@ -607,7 +607,7 @@ share.toast.working,share,DashboardPage,ShareModal,toast_working,"Generating…"
607
607
  ${T}px !important;
608
608
  ${A}px !important;
609
609
  }
610
- `),()=>{c.current?.removeAttribute("data-motion-pop-id"),I.contains(M)&&I.removeChild(M)}},[e]),F.jsx(x5,{isPresent:e,childRef:c,sizeRef:u,pop:s,children:s===!1?t:L.cloneElement(t,{ref:p})})}const S5=({children:t,initial:e,isPresent:n,onExitComplete:i,custom:r,presenceAffectsLayout:s,mode:o,anchorX:c,anchorY:u,root:d})=>{const h=yy(w5),p=L.useId();let m=!0,v=L.useMemo(()=>(m=!1,{id:p,initial:e,isPresent:n,custom:r,onExitComplete:_=>{h.set(_,!0);for(const w of h.values())if(!w)return;i&&i()},register:_=>(h.set(_,!1),()=>h.delete(_))}),[n,h,i]);return s&&m&&(v={...v}),L.useMemo(()=>{h.forEach((_,w)=>h.set(w,!1))},[n]),L.useEffect(()=>{!n&&!h.size&&i&&i()},[n]),t=F.jsx(b5,{pop:o==="popLayout",isPresent:n,anchorX:c,anchorY:u,root:d,children:t}),F.jsx(Fh.Provider,{value:v,children:t})};function w5(){return new Map}function pC(t=!0){const e=L.useContext(Fh);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=e,s=L.useId();L.useEffect(()=>{if(t)return r(s)},[t]);const o=L.useCallback(()=>t&&i&&i(s),[s,i,t]);return!n&&i?[!1,o]:[!0]}const Kd=t=>t.key||"";function Qw(t){const e=[];return L.Children.forEach(t,n=>{L.isValidElement(n)&&e.push(n)}),e}const E5=({children:t,custom:e,initial:n=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:s="sync",propagate:o=!1,anchorX:c="left",anchorY:u="top",root:d})=>{const[h,p]=pC(o),m=L.useMemo(()=>Qw(t),[t]),v=o&&!h?[]:m.map(Kd),_=L.useRef(!0),w=L.useRef(m),y=yy(()=>new Map),b=L.useRef(new Set),[T,A]=L.useState(m),[M,I]=L.useState(m);VT(()=>{_.current=!1,w.current=m;for(let S=0;S<M.length;S++){const P=Kd(M[S]);v.includes(P)?(y.delete(P),b.current.delete(P)):y.get(P)!==!0&&y.set(P,!1)}},[M,v.length,v.join("-")]);const k=[];if(m!==T){let S=[...m];for(let P=0;P<M.length;P++){const V=M[P],O=Kd(V);v.includes(O)||(S.splice(P,0,V),k.push(V))}return s==="wait"&&k.length&&(S=k),I(Qw(S)),A(m),null}const{forceRender:U}=L.useContext(vy);return F.jsx(F.Fragment,{children:M.map(S=>{const P=Kd(S),V=o&&!h?!1:m===M||v.includes(P),O=()=>{if(b.current.has(P))return;if(y.has(P))b.current.add(P),y.set(P,!0);else return;let G=!0;y.forEach(J=>{J||(G=!1)}),G&&(U?.(),I(w.current),o&&p?.(),i&&i())};return F.jsx(S5,{isPresent:V,initial:!_.current||n?void 0:!1,custom:e,presenceAffectsLayout:r,mode:s,root:d,onExitComplete:V?void 0:O,anchorX:c,anchorY:u,children:S},P)})})},mC=L.createContext({strict:!1}),e1={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let t1=!1;function M5(){if(t1)return;const t={};for(const e in e1)t[e]={isEnabled:n=>e1[e].some(i=>!!n[i])};jA(t),t1=!0}function gC(){return M5(),l4()}function T5(t){const e=gC();for(const n in t)e[n]={...e[n],...t[n]};jA(e)}const A5=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function xh(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||A5.has(t)}let vC=t=>!xh(t);function C5(t){typeof t=="function"&&(vC=e=>e.startsWith("on")?!xh(e):t(e))}try{C5(require("@emotion/is-prop-valid").default)}catch{}function P5(t,e,n){const i={};for(const r in t)r==="values"&&typeof t.values=="object"||pi(t[r])||(vC(r)||n===!0&&xh(r)||!e&&!xh(r)||t.draggable&&r.startsWith("onDrag"))&&(i[r]=t[r]);return i}const Vh=L.createContext({});function R5(t,e){if(zh(t)){const{initial:n,animate:i}=t;return{initial:n===!1||yu(n)?n:void 0,animate:yu(i)?i:void 0}}return t.inherit!==!1?e:{}}function k5(t){const{initial:e,animate:n}=R5(t,L.useContext(Vh));return L.useMemo(()=>({initial:e,animate:n}),[n1(e),n1(n)])}function n1(t){return Array.isArray(t)?t.join(" "):t}const Wy=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function yC(t,e,n){for(const i in e)!pi(e[i])&&!ZA(i,n)&&(t[i]=e[i])}function L5({transformTemplate:t},e){return L.useMemo(()=>{const n=Wy();return Hy(n,e,t),Object.assign({},n.vars,n.style)},[e])}function D5(t,e){const n=t.style||{},i={};return yC(i,n,t),Object.assign(i,L5(t,e)),i}function N5(t,e){const n={},i=D5(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const _C=()=>({...Wy(),attrs:{}});function I5(t,e,n,i){const r=L.useMemo(()=>{const s=_C();return JA(s,e,eC(i),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};yC(s,t.style,t),r.style={...s,...r.style}}return r}const U5=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function $y(t){return typeof t!="string"||t.includes("-")?!1:!!(U5.indexOf(t)>-1||/[A-Z]/u.test(t))}function F5(t,e,n,{latestValues:i},r,s=!1,o){const u=(o??$y(t)?I5:N5)(e,i,r,t),d=P5(e,typeof t=="string",s),h=t!==L.Fragment?{...d,...u,ref:n}:{},{children:p}=e,m=L.useMemo(()=>pi(p)?p.get():p,[p]);return L.createElement(t,{...h,children:m})}function O5({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,r){return{latestValues:B5(n,i,r,t),renderState:e()}}function B5(t,e,n,i){const r={},s=i(t,{});for(const m in s)r[m]=Hf(s[m]);let{initial:o,animate:c}=t;const u=zh(t),d=HA(t);e&&d&&!u&&t.inherit!==!1&&(o===void 0&&(o=e.initial),c===void 0&&(c=e.animate));let h=n?n.initial===!1:!1;h=h||o===!1;const p=h?c:o;if(p&&typeof p!="boolean"&&!Bh(p)){const m=Array.isArray(p)?p:[p];for(let v=0;v<m.length;v++){const _=Dy(t,m[v]);if(_){const{transitionEnd:w,transition:y,...b}=_;for(const T in b){let A=b[T];if(Array.isArray(A)){const M=h?A.length-1:0;A=A[M]}A!==null&&(r[T]=A)}for(const T in w)r[T]=w[T]}}}return r}const xC=t=>(e,n)=>{const i=L.useContext(Vh),r=L.useContext(Fh),s=()=>O5(t,e,i,r);return n?s():yy(s)},z5=xC({scrapeMotionValuesFromProps:Gy,createRenderState:Wy}),V5=xC({scrapeMotionValuesFromProps:tC,createRenderState:_C}),H5=Symbol.for("motionComponentSymbol");function G5(t,e,n){const i=L.useRef(n);L.useInsertionEffect(()=>{i.current=n});const r=L.useRef(null);return L.useCallback(s=>{s&&t.onMount?.(s);const o=i.current;if(typeof o=="function")if(s){const c=o(s);typeof c=="function"&&(r.current=c)}else r.current?(r.current(),r.current=null):o(s);else o&&(o.current=s);e&&(s?e.mount(s):e.unmount())},[e])}const bC=L.createContext({});function Tl(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function j5(t,e,n,i,r,s){const{visualElement:o}=L.useContext(Vh),c=L.useContext(mC),u=L.useContext(Fh),d=L.useContext(jy),h=d.reducedMotion,p=d.skipAnimations,m=L.useRef(null),v=L.useRef(!1);i=i||c.renderer,!m.current&&i&&(m.current=i(t,{visualState:e,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:h,skipAnimations:p,isSVG:s}),v.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const _=m.current,w=L.useContext(bC);_&&!_.projection&&r&&(_.type==="html"||_.type==="svg")&&W5(m.current,n,r,w);const y=L.useRef(!1);L.useInsertionEffect(()=>{_&&y.current&&_.update(n,u)});const b=n[PA],T=L.useRef(!!b&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(b)&&window.MotionHasOptimisedAnimation?.(b));return VT(()=>{v.current=!0,_&&(y.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),_.scheduleRenderMicrotask(),T.current&&_.animationState&&_.animationState.animateChanges())}),L.useEffect(()=>{_&&(!T.current&&_.animationState&&_.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(b)}),T.current=!1),_.enteringChildren=void 0)}),_}function W5(t,e,n,i){const{layoutId:r,layout:s,drag:o,dragConstraints:c,layoutScroll:u,layoutRoot:d,layoutAnchor:h,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:SC(t.parent)),t.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!o||c&&Tl(c),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,crossfade:p,layoutScroll:u,layoutRoot:d,layoutAnchor:h})}function SC(t){if(t)return t.options.allowProjection!==!1?t.projection:SC(t.parent)}function tg(t,{forwardMotionProps:e=!1,type:n}={},i,r){i&&T5(i);const s=n?n==="svg":$y(t),o=s?V5:z5;function c(d,h){let p;const m={...L.useContext(jy),...d,layoutId:$5(d)},{isStatic:v}=m,_=k5(d),w=o(d,v);if(!v&&typeof window<"u"){X5();const y=q5(m);p=y.MeasureLayout,_.visualElement=j5(t,w,m,r,y.ProjectionNode,s)}return F.jsxs(Vh.Provider,{value:_,children:[p&&_.visualElement?F.jsx(p,{visualElement:_.visualElement,...m}):null,F5(t,d,G5(w,_.visualElement,h),w,v,e,s)]})}c.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=L.forwardRef(c);return u[H5]=t,u}function $5({layoutId:t}){const e=L.useContext(vy).id;return e&&t!==void 0?e+"-"+t:t}function X5(t,e){L.useContext(mC).strict}function q5(t){const e=gC(),{drag:n,layout:i}=e;if(!n&&!i)return{};const r={...n,...i};return{MeasureLayout:n?.isEnabled(t)||i?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Y5(t,e){if(typeof Proxy>"u")return tg;const n=new Map,i=(s,o)=>tg(s,o,t,e),r=(s,o)=>i(s,o);return new Proxy(r,{get:(s,o)=>o==="create"?i:(n.has(o)||n.set(o,tg(o,void 0,t,e)),n.get(o))})}const K5=(t,e)=>e.isSVG??$y(t)?new M4(e):new _4(e,{allowProjection:t!==L.Fragment});class Z5 extends Fa{constructor(e){super(e),e.animationState||(e.animationState=R4(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Bh(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let J5=0;class Q5 extends Fa{constructor(){super(...arguments),this.id=J5++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;if(e&&i===!1){if(this.isExitComplete){const{initial:s,custom:o}=this.node.getProps();if(typeof s=="string"){const c=yo(this.node,s,o);if(c){const{transition:u,transitionEnd:d,...h}=c;for(const p in h)this.node.getValue(p)?.jump(h[p])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const r=this.node.animationState.setActive("exit",!e);n&&!e&&r.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const ez={animation:{Feature:Z5},exit:{Feature:Q5}};function Uu(t){return{point:{x:t.pageX,y:t.pageY}}}const tz=t=>e=>Fy(e)&&t(e,Uu(e));function cu(t,e,n,i){return _u(t,e,tz(n),i)}const wC=({current:t})=>t?t.ownerDocument.defaultView:null,i1=(t,e)=>Math.abs(t-e);function nz(t,e){const n=i1(t.x,e.x),i=i1(t.y,e.y);return Math.sqrt(n**2+i**2)}const r1=new Set(["auto","scroll"]);class EC{constructor(e,n,{transformPagePoint:i,contextWindow:r=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:c}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=v=>{this.handleScroll(v.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Zd(this.lastRawMoveEventInfo,this.transformPagePoint));const v=ng(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,w=nz(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!w)return;const{point:y}=v,{timestamp:b}=hi;this.history.push({...y,timestamp:b});const{onStart:T,onMove:A}=this.handlers;_||(T&&T(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),A&&A(this.lastMoveEvent,v)},this.handlePointerMove=(v,_)=>{this.lastMoveEvent=v,this.lastRawMoveEventInfo=_,this.lastMoveEventInfo=Zd(_,this.transformPagePoint),An.update(this.updatePoint,!0)},this.handlePointerUp=(v,_)=>{this.end();const{onEnd:w,onSessionEnd:y,resumeAnimation:b}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=ng(v.type==="pointercancel"?this.lastMoveEventInfo:Zd(_,this.transformPagePoint),this.history);this.startEvent&&w&&w(v,T),y&&y(v,T)},!Fy(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=o,this.contextWindow=r||window;const u=Uu(e),d=Zd(u,this.transformPagePoint),{point:h}=d,{timestamp:p}=hi;this.history=[{...h,timestamp:p}];const{onSessionStart:m}=n;m&&m(e,ng(d,this.history)),this.removeListeners=Du(cu(this.contextWindow,"pointermove",this.handlePointerMove),cu(this.contextWindow,"pointerup",this.handlePointerUp),cu(this.contextWindow,"pointercancel",this.handlePointerUp)),c&&this.startScrollTracking(c)}startScrollTracking(e){let n=e.parentElement;for(;n;){const i=getComputedStyle(n);(r1.has(i.overflowX)||r1.has(i.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const i=e===window,r=i?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},s={x:r.x-n.x,y:r.y-n.y};s.x===0&&s.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(e,r),An.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ia(this.updatePoint)}}function Zd(t,e){return e?{point:e(t.point)}:t}function s1(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ng({point:t},e){return{point:t,delta:s1(t,MC(e)),offset:s1(t,iz(e)),velocity:rz(e,.1)}}function iz(t){return t[0]}function MC(t){return t[t.length-1]}function rz(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const r=MC(t);for(;n>=0&&(i=t[n],!(r.timestamp-i.timestamp>Qi(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&r.timestamp-i.timestamp>Qi(e)*2&&(i=t[1]);const s=hr(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function sz(t,{min:e,max:n},i){return e!==void 0&&t<e?t=i?Ln(e,t,i.min):Math.max(t,e):n!==void 0&&t>n&&(t=i?Ln(n,t,i.max):Math.min(t,n)),t}function a1(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function az(t,{top:e,left:n,bottom:i,right:r}){return{x:a1(t.x,n,r),y:a1(t.y,e,i)}}function o1(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}function oz(t,e){return{x:o1(t.x,e.x),y:o1(t.y,e.y)}}function lz(t,e){let n=.5;const i=Ri(t),r=Ri(e);return r>i?n=gu(e.min,e.max-i,t.min):i>r&&(n=gu(t.min,t.max-r,e.min)),cs(0,1,n)}function cz(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const B0=.35;function uz(t=B0){return t===!1?t=0:t===!0&&(t=B0),{x:l1(t,"left","right"),y:l1(t,"top","bottom")}}function l1(t,e,n){return{min:c1(t,e),max:c1(t,n)}}function c1(t,e){return typeof t=="number"?t:t[e]||0}const dz=new WeakMap;class fz{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ti(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=p=>{n&&this.snapToCursor(Uu(p).point),this.stopAnimation()},o=(p,m)=>{const{drag:v,dragPropagation:_,onDragStart:w}=this.getProps();if(v&&!_&&(this.openDragLock&&this.openDragLock(),this.openDragLock=BB(v),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Yr(b=>{let T=this.getAxisMotionValue(b).get()||0;if(ns.test(T)){const{projection:A}=this.visualElement;if(A&&A.layout){const M=A.layout.layoutBox[b];M&&(T=Ri(M)*(parseFloat(T)/100))}}this.originPoint[b]=T}),w&&An.update(()=>w(p,m),!1,!0),k0(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},c=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m;const{dragPropagation:v,dragDirectionLock:_,onDirectionLock:w,onDrag:y}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:b}=m;if(_&&this.currentDirection===null){this.currentDirection=pz(b),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",m.point,b),this.updateAxis("y",m.point,b),this.visualElement.render(),y&&An.update(()=>y(p,m),!1,!0)},u=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m,this.stop(p,m),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new EC(e,{onSessionStart:s,onStart:o,onMove:c,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:i,contextWindow:wC(this.visualElement),element:this.visualElement.current})}stop(e,n){const i=e||this.latestPointerEvent,r=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!r||!i)return;const{velocity:o}=r;this.startAnimation(o);const{onDragEnd:c}=this.getProps();c&&An.postRender(()=>c(i,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,i){const{drag:r}=this.getProps();if(!i||!Jd(e,r,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(o=sz(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Tl(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=az(i.layoutBox,e):this.constraints=!1,this.elastic=uz(n),r!==this.constraints&&!Tl(e)&&i&&this.constraints&&!this.hasMutatedConstraints&&Yr(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=cz(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Tl(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=h4(i,r.root,this.visualElement.getTransformPagePoint());let o=oz(r.layout.layoutBox,s);if(n){const c=n(u4(o));this.hasMutatedConstraints=!!c,c&&(o=$A(c))}return o}startAnimation(e){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:c}=this.getProps(),u=this.constraints||{},d=Yr(h=>{if(!Jd(h,n,this.currentDirection))return;let p=u&&u[h]||{};(o===!0||o===h)&&(p={min:0,max:0});const m=r?200:1e6,v=r?40:1e7,_={type:"inertia",velocity:i?e[h]:0,bounceStiffness:m,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...s,...p};return this.startAxisValueAnimation(h,_)});return Promise.all(d).then(c)}startAxisValueAnimation(e,n){const i=this.getAxisMotionValue(e);return k0(this.visualElement,e),i.start(Ly(e,i,0,n,this.visualElement,!1))}stopAnimation(){Yr(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps(),r=i[n];return r||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){Yr(n=>{const{drag:i}=this.getProps();if(!Jd(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(n);if(r&&r.layout){const{min:o,max:c}=r.layout.layoutBox[n],u=s.get()||0;s.set(e[n]-Ln(o,c,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Tl(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Yr(o=>{const c=this.getAxisMotionValue(o);if(c&&this.constraints!==!1){const u=c.get();r[o]=lz({min:u,max:u},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),Yr(o=>{if(!Jd(o,e,null))return;const c=this.getAxisMotionValue(o),{min:u,max:d}=this.constraints[o];c.set(Ln(u,d,r[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;dz.set(this.visualElement,this);const e=this.visualElement.current,n=cu(e,"pointerdown",d=>{const{drag:h,dragListener:p=!0}=this.getProps(),m=d.target,v=m!==e&&WB(m);h&&p&&!v&&this.start(d)});let i;const r=()=>{const{dragConstraints:d}=this.getProps();Tl(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),i||(i=hz(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),An.read(r);const c=_u(window,"resize",()=>this.scalePositionWithinConstraints()),u=s.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:h})=>{this.isDragging&&h&&(Yr(p=>{const m=this.getAxisMotionValue(p);m&&(this.originPoint[p]+=d[p].translate,m.set(m.get()+d[p].translate))}),this.visualElement.render())}));return()=>{c(),n(),o(),u&&u(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=B0,dragMomentum:c=!0}=e;return{...e,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:c}}}function u1(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function hz(t,e,n){const i=vw(t,u1(n)),r=vw(e,u1(n));return()=>{i(),r()}}function Jd(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function pz(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class mz extends Fa{constructor(e){super(e),this.removeGroupControls=pr,this.removeListeners=pr,this.controls=new fz(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||pr}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const ig=t=>(e,n)=>{t&&An.update(()=>t(e,n),!1,!0)};class gz extends Fa{constructor(){super(...arguments),this.removePointerDownListener=pr}onPointerDown(e){this.session=new EC(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:wC(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:ig(e),onStart:ig(n),onMove:ig(i),onEnd:(s,o)=>{delete this.session,r&&An.postRender(()=>r(s,o))}}}mount(){this.removePointerDownListener=cu(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let rg=!1;class vz extends L.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=e;s&&(n.group&&n.group.add(s),i&&i.register&&r&&i.register(s),rg&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Gf.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:i,drag:r,isPresent:s}=this.props,{projection:o}=i;return o&&(o.isPresent=s,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),rg=!0,r||e.layoutDependency!==n||n===void 0||e.isPresent!==s?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||An.postRender(()=>{const c=o.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:i}=e;i&&(i.options.layoutAnchor=n,i.root.didUpdate(),Uy.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=e;rg=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function TC(t){const[e,n]=pC(),i=L.useContext(vy);return F.jsx(vz,{...t,layoutGroup:i,switchLayoutGroup:L.useContext(bC),isPresent:e,safeToRemove:n})}const yz={pan:{Feature:gz},drag:{Feature:mz,ProjectionNode:hC,MeasureLayout:TC}};function d1(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,s=i[r];s&&An.postRender(()=>s(e,Uu(e)))}class _z extends Fa{mount(){const{current:e}=this.node;e&&(this.unmount=VB(e,(n,i)=>(d1(this.node,i,"Start"),r=>d1(this.node,r,"End"))))}unmount(){}}class xz extends Fa{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Du(_u(this.node.current,"focus",()=>this.onFocus()),_u(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function f1(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),s=i[r];s&&An.postRender(()=>s(e,Uu(e)))}class bz extends Fa{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=XB(e,(r,s)=>(f1(this.node,s,"Start"),(o,{success:c})=>f1(this.node,o,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:i?.tap===!1})}unmount(){}}const z0=new WeakMap,sg=new WeakMap,Sz=t=>{const e=z0.get(t.target);e&&e(t)},wz=t=>{t.forEach(Sz)};function Ez({root:t,...e}){const n=t||document;sg.has(n)||sg.set(n,{});const i=sg.get(n),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(wz,{root:t,...e})),i[r]}function Mz(t,e,n){const i=Ez(e);return z0.set(t,n),i.observe(t),()=>{z0.delete(t),i.unobserve(t)}}const Tz={some:0,all:1};class Az extends Fa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:s}=e,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:Tz[r]},c=u=>{const{isIntersecting:d}=u;if(this.isInView===d||(this.isInView=d,s&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:h,onViewportLeave:p}=this.node.getProps(),m=d?h:p;m&&m(u)};this.stopObserver=Mz(this.node.current,o,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Cz(e,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function Cz({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Pz={inView:{Feature:Az},tap:{Feature:bz},focus:{Feature:xz},hover:{Feature:_z}},Rz={layout:{ProjectionNode:hC,MeasureLayout:TC}},kz={...ez,...Pz,...yz,...Rz},Il=Y5(kz,K5);function Lz(){!Vy.current&&GA();const[t]=L.useState(gh.current);return t}const AC=(...t)=>t.filter((e,n,i)=>!!e&&e.trim()!==""&&i.indexOf(e)===n).join(" ").trim();const Dz=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Nz=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,i)=>i?i.toUpperCase():n.toLowerCase());const h1=t=>{const e=Nz(t);return e.charAt(0).toUpperCase()+e.slice(1)};var ag={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 Iz=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},Uz=L.createContext({}),Fz=()=>L.useContext(Uz),Oz=L.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:i,className:r="",children:s,iconNode:o,...c},u)=>{const{size:d=24,strokeWidth:h=2,absoluteStrokeWidth:p=!1,color:m="currentColor",className:v=""}=Fz()??{},_=i??p?Number(n??h)*24/Number(e??d):n??h;return L.createElement("svg",{ref:u,...ag,width:e??d??ag.width,height:e??d??ag.height,stroke:t??m,strokeWidth:_,className:AC("lucide",v,r),...!s&&!Iz(c)&&{"aria-hidden":"true"},...c},[...o.map(([w,y])=>L.createElement(w,y)),...Array.isArray(s)?s:[s]])});const br=(t,e)=>{const n=L.forwardRef(({className:i,...r},s)=>L.createElement(Oz,{ref:s,iconNode:e,className:AC(`lucide-${Dz(h1(t))}`,`lucide-${t}`,i),...r}));return n.displayName=h1(t),n};const Bz=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],zz=br("chart-column",Bz);const Vz=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Hz=br("gauge",Vz);const Gz=[["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"}]],jz=br("globe",Gz);const Wz=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],$z=br("layout-grid",Wz);const Xz=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],qz=br("mail",Xz);const Yz=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Kz=br("menu",Yz);const Zz=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Jz=br("monitor",Zz);const Qz=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],CC=br("moon",Qz);const eV=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],tV=br("settings",eV);const nV=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],PC=br("sun",nV);const iV=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],rV=br("trophy",iV);const sV=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],RC=br("x",sV);function kC(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(n=kC(t[e]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}function aV(){for(var t,e,n=0,i="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=kC(t))&&(i&&(i+=" "),i+=e);return i}const oV=(t,e)=>{const n=new Array(t.length+e.length);for(let i=0;i<t.length;i++)n[i]=t[i];for(let i=0;i<e.length;i++)n[t.length+i]=e[i];return n},lV=(t,e)=>({classGroupId:t,validator:e}),LC=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),bh="-",p1=[],cV="arbitrary..",uV=t=>{const e=fV(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return dV(o);const c=o.split(bh),u=c[0]===""&&c.length>1?1:0;return DC(c,u,e)},getConflictingClassGroupIds:(o,c)=>{if(c){const u=i[o],d=n[o];return u?d?oV(d,u):u:d||p1}return n[o]||p1}}},DC=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const r=t[e],s=n.nextPart.get(r);if(s){const d=DC(t,e+1,s);if(d)return d}const o=n.validators;if(o===null)return;const c=e===0?t.join(bh):t.slice(e).join(bh),u=o.length;for(let d=0;d<u;d++){const h=o[d];if(h.validator(c))return h.classGroupId}},dV=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),i=e.slice(0,n);return i?cV+i:void 0})(),fV=t=>{const{theme:e,classGroups:n}=t;return hV(n,e)},hV=(t,e)=>{const n=LC();for(const i in t){const r=t[i];Xy(r,n,i,e)}return n},Xy=(t,e,n,i)=>{const r=t.length;for(let s=0;s<r;s++){const o=t[s];pV(o,e,n,i)}},pV=(t,e,n,i)=>{if(typeof t=="string"){mV(t,e,n);return}if(typeof t=="function"){gV(t,e,n,i);return}vV(t,e,n,i)},mV=(t,e,n)=>{const i=t===""?e:NC(e,t);i.classGroupId=n},gV=(t,e,n,i)=>{if(yV(t)){Xy(t(i),e,n,i);return}e.validators===null&&(e.validators=[]),e.validators.push(lV(n,t))},vV=(t,e,n,i)=>{const r=Object.entries(t),s=r.length;for(let o=0;o<s;o++){const[c,u]=r[o];Xy(u,NC(e,c),n,i)}},NC=(t,e)=>{let n=t;const i=e.split(bh),r=i.length;for(let s=0;s<r;s++){const o=i[s];let c=n.nextPart.get(o);c||(c=LC(),n.nextPart.set(o,c)),n=c}return n},yV=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,_V=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),i=Object.create(null);const r=(s,o)=>{n[s]=o,e++,e>t&&(e=0,i=n,n=Object.create(null))};return{get(s){let o=n[s];if(o!==void 0)return o;if((o=i[s])!==void 0)return r(s,o),o},set(s,o){s in n?n[s]=o:r(s,o)}}},V0="!",m1=":",xV=[],g1=(t,e,n,i,r)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:i,isExternal:r}),bV=t=>{const{prefix:e,experimentalParseClassName:n}=t;let i=r=>{const s=[];let o=0,c=0,u=0,d;const h=r.length;for(let w=0;w<h;w++){const y=r[w];if(o===0&&c===0){if(y===m1){s.push(r.slice(u,w)),u=w+1;continue}if(y==="/"){d=w;continue}}y==="["?o++:y==="]"?o--:y==="("?c++:y===")"&&c--}const p=s.length===0?r:r.slice(u);let m=p,v=!1;p.endsWith(V0)?(m=p.slice(0,-1),v=!0):p.startsWith(V0)&&(m=p.slice(1),v=!0);const _=d&&d>u?d-u:void 0;return g1(s,v,m,_)};if(e){const r=e+m1,s=i;i=o=>o.startsWith(r)?s(o.slice(r.length)):g1(xV,!1,o,void 0,!0)}if(n){const r=i;i=s=>n({className:s,parseClassName:r})}return i},SV=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,i)=>{e.set(n,1e6+i)}),n=>{const i=[];let r=[];for(let s=0;s<n.length;s++){const o=n[s],c=o[0]==="[",u=e.has(o);c||u?(r.length>0&&(r.sort(),i.push(...r),r=[]),i.push(o)):r.push(o)}return r.length>0&&(r.sort(),i.push(...r)),i}},wV=t=>({cache:_V(t.cacheSize),parseClassName:bV(t),sortModifiers:SV(t),...uV(t)}),EV=/\s+/,MV=(t,e)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:r,sortModifiers:s}=e,o=[],c=t.trim().split(EV);let u="";for(let d=c.length-1;d>=0;d-=1){const h=c[d],{isExternal:p,modifiers:m,hasImportantModifier:v,baseClassName:_,maybePostfixModifierPosition:w}=n(h);if(p){u=h+(u.length>0?" "+u:u);continue}let y=!!w,b=i(y?_.substring(0,w):_);if(!b){if(!y){u=h+(u.length>0?" "+u:u);continue}if(b=i(_),!b){u=h+(u.length>0?" "+u:u);continue}y=!1}const T=m.length===0?"":m.length===1?m[0]:s(m).join(":"),A=v?T+V0:T,M=A+b;if(o.indexOf(M)>-1)continue;o.push(M);const I=r(b,y);for(let k=0;k<I.length;++k){const U=I[k];o.push(A+U)}u=h+(u.length>0?" "+u:u)}return u},TV=(...t)=>{let e=0,n,i,r="";for(;e<t.length;)(n=t[e++])&&(i=IC(n))&&(r&&(r+=" "),r+=i);return r},IC=t=>{if(typeof t=="string")return t;let e,n="";for(let i=0;i<t.length;i++)t[i]&&(e=IC(t[i]))&&(n&&(n+=" "),n+=e);return n},AV=(t,...e)=>{let n,i,r,s;const o=u=>{const d=e.reduce((h,p)=>p(h),t());return n=wV(d),i=n.cache.get,r=n.cache.set,s=c,c(u)},c=u=>{const d=i(u);if(d)return d;const h=MV(u,n);return r(u,h),h};return s=o,(...u)=>s(TV(...u))},CV=[],ei=t=>{const e=n=>n[t]||CV;return e.isThemeGetter=!0,e},UC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,FC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,PV=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,RV=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,kV=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,LV=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,DV=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,NV=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pa=t=>PV.test(t),qt=t=>!!t&&!Number.isNaN(Number(t)),ma=t=>!!t&&Number.isInteger(Number(t)),og=t=>t.endsWith("%")&&qt(t.slice(0,-1)),Ts=t=>RV.test(t),OC=()=>!0,IV=t=>kV.test(t)&&!LV.test(t),qy=()=>!1,UV=t=>DV.test(t),FV=t=>NV.test(t),OV=t=>!dt(t)&&!mt(t),BV=t=>Oa(t,VC,qy),dt=t=>UC.test(t),Qa=t=>Oa(t,HC,IV),v1=t=>Oa(t,XV,qt),zV=t=>Oa(t,jC,OC),VV=t=>Oa(t,GC,qy),y1=t=>Oa(t,BC,qy),HV=t=>Oa(t,zC,FV),Qd=t=>Oa(t,WC,UV),mt=t=>FC.test(t),Vc=t=>Io(t,HC),GV=t=>Io(t,GC),_1=t=>Io(t,BC),jV=t=>Io(t,VC),WV=t=>Io(t,zC),ef=t=>Io(t,WC,!0),$V=t=>Io(t,jC,!0),Oa=(t,e,n)=>{const i=UC.exec(t);return i?i[1]?e(i[1]):n(i[2]):!1},Io=(t,e,n=!1)=>{const i=FC.exec(t);return i?i[1]?e(i[1]):n:!1},BC=t=>t==="position"||t==="percentage",zC=t=>t==="image"||t==="url",VC=t=>t==="length"||t==="size"||t==="bg-size",HC=t=>t==="length",XV=t=>t==="number",GC=t=>t==="family-name",jC=t=>t==="number"||t==="weight",WC=t=>t==="shadow",qV=()=>{const t=ei("color"),e=ei("font"),n=ei("text"),i=ei("font-weight"),r=ei("tracking"),s=ei("leading"),o=ei("breakpoint"),c=ei("container"),u=ei("spacing"),d=ei("radius"),h=ei("shadow"),p=ei("inset-shadow"),m=ei("text-shadow"),v=ei("drop-shadow"),_=ei("blur"),w=ei("perspective"),y=ei("aspect"),b=ei("ease"),T=ei("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...M(),mt,dt],k=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto","contain","none"],S=()=>[mt,dt,u],P=()=>[pa,"full","auto",...S()],V=()=>[ma,"none","subgrid",mt,dt],O=()=>["auto",{span:["full",ma,mt,dt]},ma,mt,dt],G=()=>[ma,"auto",mt,dt],J=()=>["auto","min","max","fr",mt,dt],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],K=()=>["auto",...S()],Q=()=>[pa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],W=()=>[pa,"screen","full","dvw","lvw","svw","min","max","fit",...S()],q=()=>[pa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...S()],Z=()=>[t,mt,dt],z=()=>[...M(),_1,y1,{position:[mt,dt]}],ie=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Ee=()=>["auto","cover","contain",jV,BV,{size:[mt,dt]}],ze=()=>[og,Vc,Qa],Se=()=>["","none","full",d,mt,dt],ne=()=>["",qt,Vc,Qa],ye=()=>["solid","dashed","dotted","double"],be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ne=()=>[qt,og,_1,y1],et=()=>["","none",_,mt,dt],xt=()=>["none",qt,mt,dt],pn=()=>["none",qt,mt,dt],ht=()=>[qt,mt,dt],Ft=()=>[pa,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ts],breakpoint:[Ts],color:[OC],container:[Ts],"drop-shadow":[Ts],ease:["in","out","in-out"],font:[OV],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ts],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ts],shadow:[Ts],spacing:["px",qt],text:[Ts],"text-shadow":[Ts],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",pa,dt,mt,y]}],container:["container"],columns:[{columns:[qt,dt,mt,c]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:I()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{"inset-s":P(),start:P()}],end:[{"inset-e":P(),end:P()}],"inset-bs":[{"inset-bs":P()}],"inset-be":[{"inset-be":P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[ma,"auto",mt,dt]}],basis:[{basis:[pa,"full","auto",c,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qt,pa,"auto","initial","none",dt]}],grow:[{grow:["",qt,mt,dt]}],shrink:[{shrink:["",qt,mt,dt]}],order:[{order:[ma,"first","last","none",mt,dt]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:O()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:O()}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:K()}],mx:[{mx:K()}],my:[{my:K()}],ms:[{ms:K()}],me:[{me:K()}],mbs:[{mbs:K()}],mbe:[{mbe:K()}],mt:[{mt:K()}],mr:[{mr:K()}],mb:[{mb:K()}],ml:[{ml:K()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],"inline-size":[{inline:["auto",...W()]}],"min-inline-size":[{"min-inline":["auto",...W()]}],"max-inline-size":[{"max-inline":["none",...W()]}],"block-size":[{block:["auto",...q()]}],"min-block-size":[{"min-block":["auto",...q()]}],"max-block-size":[{"max-block":["none",...q()]}],w:[{w:[c,"screen",...Q()]}],"min-w":[{"min-w":[c,"screen","none",...Q()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh",...Q()]}],"font-size":[{text:["base",n,Vc,Qa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,$V,zV]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",og,dt]}],"font-family":[{font:[GV,VV,e]}],"font-features":[{"font-features":[dt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,mt,dt]}],"line-clamp":[{"line-clamp":[qt,"none",mt,v1]}],leading:[{leading:[s,...S()]}],"list-image":[{"list-image":["none",mt,dt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",mt,dt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Z()}],"text-color":[{text:Z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ye(),"wavy"]}],"text-decoration-thickness":[{decoration:[qt,"from-font","auto",mt,Qa]}],"text-decoration-color":[{decoration:Z()}],"underline-offset":[{"underline-offset":[qt,"auto",mt,dt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",mt,dt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",mt,dt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:Ee()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ma,mt,dt],radial:["",mt,dt],conic:[ma,mt,dt]},WV,HV]}],"bg-color":[{bg:Z()}],"gradient-from-pos":[{from:ze()}],"gradient-via-pos":[{via:ze()}],"gradient-to-pos":[{to:ze()}],"gradient-from":[{from:Z()}],"gradient-via":[{via:Z()}],"gradient-to":[{to:Z()}],rounded:[{rounded:Se()}],"rounded-s":[{"rounded-s":Se()}],"rounded-e":[{"rounded-e":Se()}],"rounded-t":[{"rounded-t":Se()}],"rounded-r":[{"rounded-r":Se()}],"rounded-b":[{"rounded-b":Se()}],"rounded-l":[{"rounded-l":Se()}],"rounded-ss":[{"rounded-ss":Se()}],"rounded-se":[{"rounded-se":Se()}],"rounded-ee":[{"rounded-ee":Se()}],"rounded-es":[{"rounded-es":Se()}],"rounded-tl":[{"rounded-tl":Se()}],"rounded-tr":[{"rounded-tr":Se()}],"rounded-br":[{"rounded-br":Se()}],"rounded-bl":[{"rounded-bl":Se()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ye(),"hidden","none"]}],"divide-style":[{divide:[...ye(),"hidden","none"]}],"border-color":[{border:Z()}],"border-color-x":[{"border-x":Z()}],"border-color-y":[{"border-y":Z()}],"border-color-s":[{"border-s":Z()}],"border-color-e":[{"border-e":Z()}],"border-color-bs":[{"border-bs":Z()}],"border-color-be":[{"border-be":Z()}],"border-color-t":[{"border-t":Z()}],"border-color-r":[{"border-r":Z()}],"border-color-b":[{"border-b":Z()}],"border-color-l":[{"border-l":Z()}],"divide-color":[{divide:Z()}],"outline-style":[{outline:[...ye(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qt,mt,dt]}],"outline-w":[{outline:["",qt,Vc,Qa]}],"outline-color":[{outline:Z()}],shadow:[{shadow:["","none",h,ef,Qd]}],"shadow-color":[{shadow:Z()}],"inset-shadow":[{"inset-shadow":["none",p,ef,Qd]}],"inset-shadow-color":[{"inset-shadow":Z()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Z()}],"ring-offset-w":[{"ring-offset":[qt,Qa]}],"ring-offset-color":[{"ring-offset":Z()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":Z()}],"text-shadow":[{"text-shadow":["none",m,ef,Qd]}],"text-shadow-color":[{"text-shadow":Z()}],opacity:[{opacity:[qt,mt,dt]}],"mix-blend":[{"mix-blend":[...be(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":be()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[qt]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ne()}],"mask-image-linear-from-color":[{"mask-linear-from":Z()}],"mask-image-linear-to-color":[{"mask-linear-to":Z()}],"mask-image-t-from-pos":[{"mask-t-from":Ne()}],"mask-image-t-to-pos":[{"mask-t-to":Ne()}],"mask-image-t-from-color":[{"mask-t-from":Z()}],"mask-image-t-to-color":[{"mask-t-to":Z()}],"mask-image-r-from-pos":[{"mask-r-from":Ne()}],"mask-image-r-to-pos":[{"mask-r-to":Ne()}],"mask-image-r-from-color":[{"mask-r-from":Z()}],"mask-image-r-to-color":[{"mask-r-to":Z()}],"mask-image-b-from-pos":[{"mask-b-from":Ne()}],"mask-image-b-to-pos":[{"mask-b-to":Ne()}],"mask-image-b-from-color":[{"mask-b-from":Z()}],"mask-image-b-to-color":[{"mask-b-to":Z()}],"mask-image-l-from-pos":[{"mask-l-from":Ne()}],"mask-image-l-to-pos":[{"mask-l-to":Ne()}],"mask-image-l-from-color":[{"mask-l-from":Z()}],"mask-image-l-to-color":[{"mask-l-to":Z()}],"mask-image-x-from-pos":[{"mask-x-from":Ne()}],"mask-image-x-to-pos":[{"mask-x-to":Ne()}],"mask-image-x-from-color":[{"mask-x-from":Z()}],"mask-image-x-to-color":[{"mask-x-to":Z()}],"mask-image-y-from-pos":[{"mask-y-from":Ne()}],"mask-image-y-to-pos":[{"mask-y-to":Ne()}],"mask-image-y-from-color":[{"mask-y-from":Z()}],"mask-image-y-to-color":[{"mask-y-to":Z()}],"mask-image-radial":[{"mask-radial":[mt,dt]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ne()}],"mask-image-radial-from-color":[{"mask-radial-from":Z()}],"mask-image-radial-to-color":[{"mask-radial-to":Z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[qt]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ne()}],"mask-image-conic-from-color":[{"mask-conic-from":Z()}],"mask-image-conic-to-color":[{"mask-conic-to":Z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:Ee()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",mt,dt]}],filter:[{filter:["","none",mt,dt]}],blur:[{blur:et()}],brightness:[{brightness:[qt,mt,dt]}],contrast:[{contrast:[qt,mt,dt]}],"drop-shadow":[{"drop-shadow":["","none",v,ef,Qd]}],"drop-shadow-color":[{"drop-shadow":Z()}],grayscale:[{grayscale:["",qt,mt,dt]}],"hue-rotate":[{"hue-rotate":[qt,mt,dt]}],invert:[{invert:["",qt,mt,dt]}],saturate:[{saturate:[qt,mt,dt]}],sepia:[{sepia:["",qt,mt,dt]}],"backdrop-filter":[{"backdrop-filter":["","none",mt,dt]}],"backdrop-blur":[{"backdrop-blur":et()}],"backdrop-brightness":[{"backdrop-brightness":[qt,mt,dt]}],"backdrop-contrast":[{"backdrop-contrast":[qt,mt,dt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qt,mt,dt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qt,mt,dt]}],"backdrop-invert":[{"backdrop-invert":["",qt,mt,dt]}],"backdrop-opacity":[{"backdrop-opacity":[qt,mt,dt]}],"backdrop-saturate":[{"backdrop-saturate":[qt,mt,dt]}],"backdrop-sepia":[{"backdrop-sepia":["",qt,mt,dt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",mt,dt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qt,"initial",mt,dt]}],ease:[{ease:["linear","initial",b,mt,dt]}],delay:[{delay:[qt,mt,dt]}],animate:[{animate:["none",T,mt,dt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,mt,dt]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:xt()}],"rotate-x":[{"rotate-x":xt()}],"rotate-y":[{"rotate-y":xt()}],"rotate-z":[{"rotate-z":xt()}],scale:[{scale:pn()}],"scale-x":[{"scale-x":pn()}],"scale-y":[{"scale-y":pn()}],"scale-z":[{"scale-z":pn()}],"scale-3d":["scale-3d"],skew:[{skew:ht()}],"skew-x":[{"skew-x":ht()}],"skew-y":[{"skew-y":ht()}],transform:[{transform:[mt,dt,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ft()}],"translate-x":[{"translate-x":Ft()}],"translate-y":[{"translate-y":Ft()}],"translate-z":[{"translate-z":Ft()}],"translate-none":["translate-none"],accent:[{accent:Z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",mt,dt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",mt,dt]}],fill:[{fill:["none",...Z()]}],"stroke-w":[{stroke:[qt,Vc,Qa,v1]}],stroke:[{stroke:["none",...Z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},YV=AV(qV);function Mn(...t){return YV(aV(t))}const KV=F.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[F.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1Z",fill:"#4285F4"}),F.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23Z",fill:"#34A853"}),F.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18A10.96 10.96 0 0 0 1 12c0 1.77.42 3.44 1.18 4.93l3.66-2.84Z",fill:"#FBBC05"}),F.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53Z",fill:"#EA4335"})]}),ZV=F.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:F.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12Z"})}),JV={google:KV,github:ZV},QV={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",apple:"Apple"};function eH(t){return QV[t]||String(t||"").replace(/-/g," ")}function tH(){const{isOpen:t,closeLoginModal:e}=zT(),{enabled:n,signedIn:i,refreshUser:r,signInWithPassword:s,signUp:o,signInWithOAuth:c,getPublicAuthConfig:u}=Do(),[d,h]=L.useState("signin"),[p,m]=L.useState(""),[v,_]=L.useState(""),[w,y]=L.useState(""),[b,T]=L.useState(!1),[A,M]=L.useState(null),[I,k]=L.useState(null),[U,S]=L.useState(!1),[P,V]=L.useState(!0),[O,G]=L.useState([]),[J,H]=L.useState(8);L.useEffect(()=>{t&&(M(null),k(null),h("signin"),m(""),_(""),y(""),S(!1))},[t]),L.useEffect(()=>{if(!t||!n){V(!1);return}let W=!0;return(async()=>{const{data:q,error:Z}=await u();if(W){if(Z||!q)G(["google","github"]);else{const z=Array.isArray(q.oAuthProviders)?q.oAuthProviders:[],ie=Array.isArray(q.customOAuthProviders)?q.customOAuthProviders:[];G([...z,...ie]),typeof q.passwordMinLength=="number"&&q.passwordMinLength>0&&H(q.passwordMinLength)}V(!1)}})(),()=>{W=!1}},[t,n,u]),L.useEffect(()=>{t&&i&&e()},[t,i,e]);const X=L.useMemo(()=>typeof window>"u"?"":window.location.origin+"/",[]),K=L.useCallback(async W=>{M(null),T(!0);try{const{error:q}=await c(W,X);q&&M(q.message||String(q))}finally{T(!1)}},[c,X]),Q=L.useCallback(async W=>{W.preventDefault(),M(null),T(!0);try{if(d==="signup"){const{data:Z,error:z}=await o({email:p.trim(),password:v,name:w.trim()||void 0});if(z){M(z.message||String(z));return}if(Z?.requireEmailVerification){k("Check your email for a verification link."),h("signin");return}await r();return}const{error:q}=await s({email:p.trim(),password:v});if(q){M(q.message||String(q));return}await r()}finally{T(!1)}},[d,p,v,w,o,s,r]);return L.useEffect(()=>{if(!t)return;const W=q=>{q.key==="Escape"&&e()};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[t,e]),n?F.jsx(E5,{children:t&&F.jsxs(Il.div,{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[F.jsx(Il.div,{className:"absolute inset-0 bg-black/40 dark:bg-black/60 ",onClick:e,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),F.jsxs(Il.div,{className:"relative w-full max-w-[420px] rounded-2xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 p-6 shadow-2xl",initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.2},onClick:W=>W.stopPropagation(),children:[F.jsx("button",{type:"button",onClick:e,className:"absolute right-4 top-4 text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:F.jsx(RC,{className:"h-5 w-5"})}),F.jsxs("div",{className:"text-center mb-6",children:[F.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[F.jsx("img",{src:"/app-icon.png",alt:"",width:28,height:28,className:"rounded-md"}),F.jsx("span",{className:"text-lg font-semibold text-oai-black dark:text-white",children:"Token Tracker"})]}),F.jsx("p",{className:"text-sm text-oai-gray-500",children:"Sign in to join the leaderboard"})]}),I&&F.jsx("div",{className:"mb-4 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900/50 px-3 py-2 text-xs text-oai-gray-700 dark:text-oai-gray-300",children:I}),A&&F.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",role:"alert",children:A}),F.jsx("div",{className:"space-y-2.5 mb-5",children:P?F.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900 animate-pulse"}):O.map(W=>F.jsxs("button",{type:"button",disabled:b,onClick:()=>K(W),className:Mn("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors disabled:opacity-50","flex items-center justify-center gap-2.5"),children:[JV[W]||null,"Continue with ",eH(W)]},W))}),U?F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:"relative mb-5",children:[F.jsx("div",{className:"absolute inset-0 flex items-center",children:F.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),F.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:F.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:"email"})})]}),F.jsxs("div",{className:"flex rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 p-0.5 bg-oai-gray-50 dark:bg-oai-gray-900/50 mb-4",children:[F.jsx("button",{type:"button",className:Mn("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",d==="signin"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{h("signin"),M(null)},children:"Sign In"}),F.jsx("button",{type:"button",className:Mn("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",d==="signup"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{h("signup"),M(null)},children:"Sign Up"})]}),F.jsxs("form",{onSubmit:Q,className:"space-y-3",children:[d==="signup"&&F.jsxs("div",{children:[F.jsx("label",{htmlFor:"modal-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:"Name"}),F.jsx("input",{id:"modal-name",type:"text",autoComplete:"name",value:w,onChange:W=>y(W.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:"Optional"})]}),F.jsxs("div",{children:[F.jsx("label",{htmlFor:"modal-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:"Email"}),F.jsx("input",{id:"modal-email",type:"email",autoComplete:"email",required:!0,value:p,onChange:W=>m(W.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),F.jsxs("div",{children:[F.jsx("label",{htmlFor:"modal-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:"Password"}),F.jsx("input",{id:"modal-password",type:"password",autoComplete:d==="signup"?"new-password":"current-password",required:!0,minLength:d==="signup"?J:void 0,value:v,onChange:W=>_(W.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),d==="signup"&&F.jsxs("p",{className:"mt-1 text-xs text-oai-gray-400 dark:text-oai-gray-600",children:["At least ",J," characters"]})]}),F.jsx("button",{type:"submit",disabled:b,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:d==="signup"?"Create Account":"Sign In"})]})]}):F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:"relative mb-5",children:[F.jsx("div",{className:"absolute inset-0 flex items-center",children:F.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),F.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:F.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:"or"})})]}),F.jsxs("button",{type:"button",onClick:()=>S(!0),className:Mn("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors","flex items-center justify-center gap-2.5"),children:[F.jsx(qz,{className:"h-[18px] w-[18px] text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:1.75}),"Continue with Email"]})]})]})]})}):null}const nH={VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"};function iH(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return"";const e=typeof import.meta<"u"?nH:void 0;return(e?.VITE_TOKENTRACKER_BACKEND_BASE_URL||e?.VITE_INSFORGE_BASE_URL||"").trim()}function kX(){return Ro()}function $C(t=""){if(typeof t!="string"||t.length===0)return!1;const e=new URLSearchParams(t),n=String(e.get("screenshot")||"").toLowerCase();return n==="1"||n==="true"}const rH=300*1e3;function Yy(t){return typeof t=="string"&&/^https?:\/\//i.test(t.trim())}async function XC(t){const e=Ro();if(!Yy(e)||!t)return;const n=e.replace(/\/$/,""),i=Nh(),r={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${t}`};i&&(r.apikey=i);try{await fetch(`${n}/functions/tokentracker-leaderboard-refresh`,{method:"POST",headers:r,body:"{}"})}catch{}}async function qC(t){const e=Ro();if(!Yy(e)||!t)return null;const n=e.replace(/\/$/,""),i=Nh(),r={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${t}`};i&&(r.apikey=i);const s=typeof navigator<"u"&&typeof navigator.platform=="string"?navigator.platform:"web",o=await fetch(`${n}/functions/tokentracker-device-token-issue`,{method:"POST",headers:r,body:JSON.stringify({device_name:"Token Tracker (dashboard)",platform:s})});if(!o.ok)return null;const c=await o.json().catch(()=>null),u=typeof c?.token=="string"?c.token:null,d=typeof c?.device_id=="string"?c.device_id:null;return!u||!d?null:{token:u,deviceId:d,issuedAt:typeof c?.created_at=="string"?c.created_at:new Date().toISOString()}}async function YC(t){const{deviceToken:e,insforgeBaseUrl:n}=t,i={deviceToken:e},r=n||Ro();Yy(r)&&(i.insforgeBaseUrl=r.trim());const s=await fetch("/functions/tokentracker-local-sync",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(i)}),o=await s.json().catch(()=>({}));if(!s.ok){const c=typeof o.error=="string"?o.error:`HTTP ${s.status}`;throw new Error(c)}return o}async function sH(t){const e=LI();if(Date.now()-e<rH)return;const n=await t();if(!n)return;let i=uT();if(!i){const r=await qC(n);if(!r)return;dT(r),i=r}await YC({deviceToken:i.token,insforgeBaseUrl:Ro()}),fT(Date.now()),await XC(n)}async function LX(t){const e=await t();if(!e)return;let n=uT();if(!n){const i=await qC(e);if(!i)return;dT(i),n=i}await YC({deviceToken:n.token,insforgeBaseUrl:Ro()}),fT(Date.now()),await XC(e)}function aH(t){const e=t.replace(/\/+$/,"")||"/";return e==="/share"||e==="/share.html"||e.startsWith("/share/")}function oH(t){const e=t.replace(/\/+$/,"")||"/";return e==="/login"||e==="/landing"||aH(e)?!1:e==="/"||e==="/dashboard"||e.startsWith("/leaderboard")}function lH(){const t=vr(),e=Do(),n=L.useRef(!1);L.useEffect(()=>{if(!PI()||!oH(t.pathname||"/")||!e.enabled||!e.signedIn||e.loading||!RI())return;let i=!1;const r=window.setTimeout(()=>{(async()=>{if(!(i||n.current)){n.current=!0;try{await sH(()=>e.getAccessToken())}catch(s){console.warn("[tokentracker] cloud usage sync:",s)}finally{n.current=!1}}})()},2500);return()=>{i=!0,window.clearTimeout(r)}},[t.pathname,e.enabled,e.signedIn,e.loading,e.getAccessToken])}function KC(){return typeof navigator>"u"?null:navigator.clipboard||null}function cH(){return typeof window>"u"?null:window.ClipboardItem||null}async function uH(t,{clipboard:e}={}){const n=e??KC();if(!n||typeof n.writeText!="function")return!1;try{return await n.writeText(t),!0}catch{return!1}}async function DX(t,{clipboard:e}={}){const n=e??KC(),i=cH();if(!t||!n||typeof n.write!="function"||!i)return!1;try{const r=t.type||"image/png",s=t.type&&t.type!==r?t.slice(0,t.size,r):t.type?t:t.slice(0,t.size,r),o=new i({[r]:s});return await n.write([o]),!0}catch{return!1}}function dH(){if(typeof window>"u")return!1;const t=window.location.hostname;return t==="localhost"||t==="127.0.0.1"||t==="::1"}function fH(){return dH()?"/":"/dashboard"}function ZC({prefersReducedMotion:t,screenshotCapture:e}){return!(e||t)}function hH({repo:t="mm7894215/TokenTracker"}){const[e,n]=L.useState(null);return L.useEffect(()=>{if(typeof window>"u")return;const i=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,r=typeof document<"u"&&(document.documentElement?.classList.contains("screenshot-capture")||document.body?.classList.contains("screenshot-capture"));ZC({prefersReducedMotion:i,screenshotCapture:r})&&fetch(`https://api.github.com/repos/${t}`).then(s=>s.json()).then(s=>{s&&typeof s.stargazers_count=="number"&&n(s.stargazers_count)}).catch(()=>{})},[t]),F.jsxs("a",{href:`https://github.com/${t}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-2 px-3 py-1.5 rounded-md border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-800 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-700 transition-colors no-underline",children:[F.jsx("svg",{height:"16",viewBox:"0 0 16 16",width:"16",className:"shrink-0 fill-oai-gray-700 dark:fill-oai-gray-300",children:F.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),F.jsx("span",{className:"text-xs font-medium text-oai-gray-700 dark:text-oai-gray-300 whitespace-nowrap",children:"Star"}),e!==null&&F.jsx("span",{className:"text-xs font-semibold text-oai-gray-900 dark:text-oai-white tabular-nums whitespace-nowrap",children:e})]})}function pH(t){if(!t||typeof t!="object")return null;const e=t.user_metadata&&typeof t.user_metadata=="object"?t.user_metadata:{},n=t.profile&&typeof t.profile=="object"?t.profile:{},i=e.avatar_url||e.picture||n.avatar_url||t.avatar_url;return typeof i=="string"&&i.trim()?i.trim():null}function x1(t){const e=String(t||"").trim();if(!e)return"?";const n=e.split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():e.slice(0,2).toUpperCase()}function H0({className:t,variant:e="header",collapsed:n=!1,onAfterAction:i}){const r=e==="sidebar",{enabled:s,loading:o,signedIn:c,user:u,displayName:d}=Do(),{openLoginModal:h}=zT(),p=Au(),m=L.useMemo(()=>pH(u),[u]);if(!s)return null;if(o)return F.jsx("div",{className:Mn("h-9 w-9 shrink-0 rounded-full bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse",t),"aria-hidden":!0});if(!c)return r?F.jsxs("button",{type:"button",onClick:()=>{h(),i?.()},className:Mn("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] font-medium text-oai-gray-700 dark:text-oai-gray-300 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 min-w-0",n?"h-8 w-8 justify-center px-0":"w-full",t),"aria-label":Ct("header.auth.sign_in_aria"),title:n?"Sign In":void 0,children:[F.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:F.jsx("img",{src:"/app-icon.png",alt:"",width:18,height:18,className:"h-[18px] w-[18px] rounded"})}),!n&&F.jsx("span",{className:"truncate flex-1 text-left",children:"Sign in"})]}):F.jsx("button",{type:"button",onClick:h,className:Mn("shrink-0 inline-flex h-9 items-center justify-center gap-1.5 rounded-full px-5 text-sm font-medium transition-colors duration-200 ease-out shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 text-white hover:bg-oai-gray-800 active:bg-oai-gray-950 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 dark:active:bg-oai-gray-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-oai-gray-950",t),"aria-label":Ct("header.auth.sign_in_aria"),children:"Sign In"});const v=()=>{p("/settings"),i?.()};return F.jsx("div",{className:Mn(r?"relative flex w-full shrink-0 items-center":"relative flex shrink-0 items-center",t),children:F.jsxs("button",{type:"button",onClick:v,className:Mn(r?Mn("flex w-full items-center gap-2 rounded-md px-2 py-1.5 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 transition-colors min-w-0",n&&"justify-center px-0 py-0 h-9 w-9"):"flex items-center gap-2 rounded-full pl-1 pr-2 py-1 border border-transparent hover:bg-oai-gray-100 dark:hover:bg-oai-gray-900/80 hover:border-oai-gray-200 dark:hover:border-oai-gray-800 transition-colors"),"aria-label":Ct("header.auth.open_settings"),title:r&&n?d:void 0,children:[r?F.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:m?F.jsx("img",{src:m,alt:"",width:20,height:20,className:"h-5 w-5 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700",referrerPolicy:"no-referrer"}):F.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600 text-[9px] font-semibold text-white ring-1 ring-oai-brand-500/50",children:x1(d)})}):m?F.jsx("img",{src:m,alt:"",width:32,height:32,className:"h-8 w-8 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700 shrink-0",referrerPolicy:"no-referrer"}):F.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600 text-xs font-semibold text-white ring-1 ring-oai-brand-500/50",children:x1(d)}),r?!n&&F.jsx("span",{className:"truncate text-[13px] font-medium text-oai-gray-900 dark:text-oai-gray-200 flex-1 text-left min-w-0",children:d}):F.jsx("span",{className:"hidden sm:inline truncate text-sm font-medium text-oai-gray-900 dark:text-oai-gray-200 max-w-[120px]",children:d})]})})}const Ky="183",mH=0,b1=1,gH=2,jf=1,vH=2,tu=3,Ua=0,Gi=1,Ns=2,Os=0,_o=1,S1=2,w1=3,E1=4,yH=5,lo=100,_H=101,xH=102,bH=103,SH=104,wH=200,EH=201,MH=202,TH=203,G0=204,j0=205,AH=206,CH=207,PH=208,RH=209,kH=210,LH=211,DH=212,NH=213,IH=214,W0=0,$0=1,X0=2,jl=3,q0=4,Y0=5,K0=6,Z0=7,JC=0,UH=1,FH=2,is=0,QC=1,eP=2,tP=3,nP=4,iP=5,rP=6,sP=7,aP=300,To=301,Wl=302,lg=303,cg=304,Hh=306,J0=1e3,Is=1001,Q0=1002,mi=1003,OH=1004,tf=1005,wi=1006,ug=1007,mo=1008,fr=1009,oP=1010,lP=1011,xu=1012,Zy=1013,us=1014,Qr=1015,Hs=1016,Jy=1017,Qy=1018,bu=1020,cP=35902,uP=35899,dP=1021,fP=1022,Fr=1023,Gs=1026,go=1027,hP=1028,e_=1029,$l=1030,t_=1031,n_=1033,Wf=33776,$f=33777,Xf=33778,qf=33779,ev=35840,tv=35841,nv=35842,iv=35843,rv=36196,sv=37492,av=37496,ov=37488,lv=37489,cv=37490,uv=37491,dv=37808,fv=37809,hv=37810,pv=37811,mv=37812,gv=37813,vv=37814,yv=37815,_v=37816,xv=37817,bv=37818,Sv=37819,wv=37820,Ev=37821,Mv=36492,Tv=36494,Av=36495,Cv=36283,Pv=36284,Rv=36285,kv=36286,BH=3200,zH=0,VH=1,Ca="",ur="srgb",Ao="srgb-linear",Sh="linear",wn="srgb",cl=7680,M1=519,HH=512,GH=513,jH=514,i_=515,WH=516,$H=517,r_=518,XH=519,T1=35044,A1="300 es",es=2e3,wh=2001;function qH(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function Eh(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function YH(){const t=Eh("canvas");return t.style.display="block",t}const C1={};function P1(...t){const e="THREE."+t.shift();console.log(e,...t)}function pP(t){const e=t[0];if(typeof e=="string"&&e.startsWith("TSL:")){const n=t[1];n&&n.isStackTrace?t[0]+=" "+n.getLocation():t[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return t}function Gt(...t){t=pP(t);const e="THREE."+t.shift();{const n=t[0];n&&n.isStackTrace?console.warn(n.getError(e)):console.warn(e,...t)}}function _n(...t){t=pP(t);const e="THREE."+t.shift();{const n=t[0];n&&n.isStackTrace?console.error(n.getError(e)):console.error(e,...t)}}function Mh(...t){const e=t.join(" ");e in C1||(C1[e]=!0,Gt(...t))}function KH(t,e,n){return new Promise(function(i,r){function s(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:r();break;case t.TIMEOUT_EXPIRED:setTimeout(s,n);break;default:i()}}setTimeout(s,n)})}const ZH={[W0]:$0,[X0]:K0,[q0]:Z0,[jl]:Y0,[$0]:W0,[K0]:X0,[Z0]:q0,[Y0]:jl};class ec{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(n)===-1&&i[e].push(n)}hasEventListener(e,n){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(n)!==-1}removeEventListener(e,n){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const n=this._listeners;if(n===void 0)return;const i=n[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s<o;s++)r[s].call(this,e);e.target=null}}}const xi=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],dg=Math.PI/180,Lv=180/Math.PI;function Fu(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(xi[t&255]+xi[t>>8&255]+xi[t>>16&255]+xi[t>>24&255]+"-"+xi[e&255]+xi[e>>8&255]+"-"+xi[e>>16&15|64]+xi[e>>24&255]+"-"+xi[n&63|128]+xi[n>>8&255]+"-"+xi[n>>16&255]+xi[n>>24&255]+xi[i&255]+xi[i>>8&255]+xi[i>>16&255]+xi[i>>24&255]).toLowerCase()}function ln(t,e,n){return Math.max(e,Math.min(n,t))}function JH(t,e){return(t%e+e)%e}function fg(t,e,n){return(1-n)*t+n*e}function Hc(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Hi(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}class bn{constructor(e=0,n=0){bn.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,i=this.y,r=e.elements;return this.x=r[0]*n+r[3]*i+r[6],this.y=r[1]*n+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=ln(this.x,e.x,n.x),this.y=ln(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=ln(this.x,e,n),this.y=ln(this.y,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ln(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(ln(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y;return n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const i=Math.cos(n),r=Math.sin(n),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class tc{constructor(e=0,n=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=i,this._w=r}static slerpFlat(e,n,i,r,s,o,c){let u=i[r+0],d=i[r+1],h=i[r+2],p=i[r+3],m=s[o+0],v=s[o+1],_=s[o+2],w=s[o+3];if(p!==w||u!==m||d!==v||h!==_){let y=u*m+d*v+h*_+p*w;y<0&&(m=-m,v=-v,_=-_,w=-w,y=-y);let b=1-c;if(y<.9995){const T=Math.acos(y),A=Math.sin(T);b=Math.sin(b*T)/A,c=Math.sin(c*T)/A,u=u*b+m*c,d=d*b+v*c,h=h*b+_*c,p=p*b+w*c}else{u=u*b+m*c,d=d*b+v*c,h=h*b+_*c,p=p*b+w*c;const T=1/Math.sqrt(u*u+d*d+h*h+p*p);u*=T,d*=T,h*=T,p*=T}}e[n]=u,e[n+1]=d,e[n+2]=h,e[n+3]=p}static multiplyQuaternionsFlat(e,n,i,r,s,o){const c=i[r],u=i[r+1],d=i[r+2],h=i[r+3],p=s[o],m=s[o+1],v=s[o+2],_=s[o+3];return e[n]=c*_+h*p+u*v-d*m,e[n+1]=u*_+h*m+d*p-c*v,e[n+2]=d*_+h*v+c*m-u*p,e[n+3]=h*_-c*p-u*m-d*v,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,i,r){return this._x=e,this._y=n,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const i=e._x,r=e._y,s=e._z,o=e._order,c=Math.cos,u=Math.sin,d=c(i/2),h=c(r/2),p=c(s/2),m=u(i/2),v=u(r/2),_=u(s/2);switch(o){case"XYZ":this._x=m*h*p+d*v*_,this._y=d*v*p-m*h*_,this._z=d*h*_+m*v*p,this._w=d*h*p-m*v*_;break;case"YXZ":this._x=m*h*p+d*v*_,this._y=d*v*p-m*h*_,this._z=d*h*_-m*v*p,this._w=d*h*p+m*v*_;break;case"ZXY":this._x=m*h*p-d*v*_,this._y=d*v*p+m*h*_,this._z=d*h*_+m*v*p,this._w=d*h*p-m*v*_;break;case"ZYX":this._x=m*h*p-d*v*_,this._y=d*v*p+m*h*_,this._z=d*h*_-m*v*p,this._w=d*h*p+m*v*_;break;case"YZX":this._x=m*h*p+d*v*_,this._y=d*v*p+m*h*_,this._z=d*h*_-m*v*p,this._w=d*h*p-m*v*_;break;case"XZY":this._x=m*h*p-d*v*_,this._y=d*v*p-m*h*_,this._z=d*h*_+m*v*p,this._w=d*h*p+m*v*_;break;default:Gt("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const i=n/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,i=n[0],r=n[4],s=n[8],o=n[1],c=n[5],u=n[9],d=n[2],h=n[6],p=n[10],m=i+c+p;if(m>0){const v=.5/Math.sqrt(m+1);this._w=.25/v,this._x=(h-u)*v,this._y=(s-d)*v,this._z=(o-r)*v}else if(i>c&&i>p){const v=2*Math.sqrt(1+i-c-p);this._w=(h-u)/v,this._x=.25*v,this._y=(r+o)/v,this._z=(s+d)/v}else if(c>p){const v=2*Math.sqrt(1+c-i-p);this._w=(s-d)/v,this._x=(r+o)/v,this._y=.25*v,this._z=(u+h)/v}else{const v=2*Math.sqrt(1+p-i-c);this._w=(o-r)/v,this._x=(s+d)/v,this._y=(u+h)/v,this._z=.25*v}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let i=e.dot(n)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ln(this.dot(e),-1,1)))}rotateTowards(e,n){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,n/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const i=e._x,r=e._y,s=e._z,o=e._w,c=n._x,u=n._y,d=n._z,h=n._w;return this._x=i*h+o*c+r*d-s*u,this._y=r*h+o*u+s*c-i*d,this._z=s*h+o*d+i*u-r*c,this._w=o*h-i*c-r*u-s*d,this._onChangeCallback(),this}slerp(e,n){let i=e._x,r=e._y,s=e._z,o=e._w,c=this.dot(e);c<0&&(i=-i,r=-r,s=-s,o=-o,c=-c);let u=1-n;if(c<.9995){const d=Math.acos(c),h=Math.sin(d);u=Math.sin(u*d)/h,n=Math.sin(n*d)/h,this._x=this._x*u+i*n,this._y=this._y*u+r*n,this._z=this._z*u+s*n,this._w=this._w*u+o*n,this._onChangeCallback()}else this._x=this._x*u+i*n,this._y=this._y*u+r*n,this._z=this._z*u+s*n,this._w=this._w*u+o*n,this.normalize();return this}slerpQuaternions(e,n,i){return this.copy(e).slerp(n,i)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(n),s*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class me{constructor(e=0,n=0,i=0){me.prototype.isVector3=!0,this.x=e,this.y=n,this.z=i}set(e,n,i){return i===void 0&&(i=this.z),this.x=e,this.y=n,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(R1.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(R1.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*n+s[3]*i+s[6]*r,this.y=s[1]*n+s[4]*i+s[7]*r,this.z=s[2]*n+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*n+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*n+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*n+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*n+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const n=this.x,i=this.y,r=this.z,s=e.x,o=e.y,c=e.z,u=e.w,d=2*(o*r-c*i),h=2*(c*n-s*r),p=2*(s*i-o*n);return this.x=n+u*d+o*p-c*h,this.y=i+u*h+c*d-s*p,this.z=r+u*p+s*h-o*d,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*n+s[4]*i+s[8]*r,this.y=s[1]*n+s[5]*i+s[9]*r,this.z=s[2]*n+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=ln(this.x,e.x,n.x),this.y=ln(this.y,e.y,n.y),this.z=ln(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=ln(this.x,e,n),this.y=ln(this.y,e,n),this.z=ln(this.z,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ln(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const i=e.x,r=e.y,s=e.z,o=n.x,c=n.y,u=n.z;return this.x=r*u-s*c,this.y=s*o-i*u,this.z=i*c-r*o,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const i=e.dot(this)/n;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return hg.copy(this).projectOnVector(e),this.sub(hg)}reflect(e){return this.sub(hg.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(ln(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return n*n+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,i){const r=Math.sin(n)*e;return this.x=r*Math.sin(i),this.y=Math.cos(n)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,i){return this.x=e*Math.sin(n),this.y=i,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=i,this.z=r,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,i=Math.sqrt(1-n*n);return this.x=i*Math.cos(e),this.y=n,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const hg=new me,R1=new tc;class Wt{constructor(e,n,i,r,s,o,c,u,d){Wt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,i,r,s,o,c,u,d)}set(e,n,i,r,s,o,c,u,d){const h=this.elements;return h[0]=e,h[1]=r,h[2]=c,h[3]=n,h[4]=s,h[5]=u,h[6]=i,h[7]=o,h[8]=d,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],this}extractBasis(e,n,i){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,s=this.elements,o=i[0],c=i[3],u=i[6],d=i[1],h=i[4],p=i[7],m=i[2],v=i[5],_=i[8],w=r[0],y=r[3],b=r[6],T=r[1],A=r[4],M=r[7],I=r[2],k=r[5],U=r[8];return s[0]=o*w+c*T+u*I,s[3]=o*y+c*A+u*k,s[6]=o*b+c*M+u*U,s[1]=d*w+h*T+p*I,s[4]=d*y+h*A+p*k,s[7]=d*b+h*M+p*U,s[2]=m*w+v*T+_*I,s[5]=m*y+v*A+_*k,s[8]=m*b+v*M+_*U,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],c=e[5],u=e[6],d=e[7],h=e[8];return n*o*h-n*c*d-i*s*h+i*c*u+r*s*d-r*o*u}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],c=e[5],u=e[6],d=e[7],h=e[8],p=h*o-c*d,m=c*u-h*s,v=d*s-o*u,_=n*p+i*m+r*v;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);const w=1/_;return e[0]=p*w,e[1]=(r*d-h*i)*w,e[2]=(c*i-r*o)*w,e[3]=m*w,e[4]=(h*n-r*u)*w,e[5]=(r*s-c*n)*w,e[6]=v*w,e[7]=(i*u-d*n)*w,e[8]=(o*n-i*s)*w,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,i,r,s,o,c){const u=Math.cos(s),d=Math.sin(s);return this.set(i*u,i*d,-i*(u*o+d*c)+o+e,-r*d,r*u,-r*(-d*o+u*c)+c+n,0,0,1),this}scale(e,n){return this.premultiply(pg.makeScale(e,n)),this}rotate(e){return this.premultiply(pg.makeRotation(-e)),this}translate(e,n){return this.premultiply(pg.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,i,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<9;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<9;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const pg=new Wt,k1=new Wt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),L1=new Wt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function QH(){const t={enabled:!0,workingColorSpace:Ao,spaces:{},convert:function(r,s,o){return this.enabled===!1||s===o||!s||!o||(this.spaces[s].transfer===wn&&(r.r=Bs(r.r),r.g=Bs(r.g),r.b=Bs(r.b)),this.spaces[s].primaries!==this.spaces[o].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===wn&&(r.r=Ul(r.r),r.g=Ul(r.g),r.b=Ul(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===Ca?Sh:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,o){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,s){return Mh("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return Mh("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],i=[.3127,.329];return t.define({[Ao]:{primaries:e,whitePoint:i,transfer:Sh,toXYZ:k1,fromXYZ:L1,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:ur},outputColorSpaceConfig:{drawingBufferColorSpace:ur}},[ur]:{primaries:e,whitePoint:i,transfer:wn,toXYZ:k1,fromXYZ:L1,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:ur}}}),t}const fn=QH();function Bs(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function Ul(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let ul;class e6{static getDataURL(e,n="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{ul===void 0&&(ul=Eh("canvas")),ul.width=e.width,ul.height=e.height;const r=ul.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=ul}return i.toDataURL(n)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=Eh("canvas");n.width=e.width,n.height=e.height;const i=n.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o<s.length;o++)s[o]=Bs(s[o]/255)*255;return i.putImageData(r,0,0),n}else if(e.data){const n=e.data.slice(0);for(let i=0;i<n.length;i++)n instanceof Uint8Array||n instanceof Uint8ClampedArray?n[i]=Math.floor(Bs(n[i]/255)*255):n[i]=Bs(n[i]);return{data:n,width:e.width,height:e.height}}else return Gt("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let t6=0;class s_{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:t6++}),this.uuid=Fu(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const n=this.data;return typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement?e.set(n.videoWidth,n.videoHeight,0):typeof VideoFrame<"u"&&n instanceof VideoFrame?e.set(n.displayHeight,n.displayWidth,0):n!==null?e.set(n.width,n.height,n.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let o=0,c=r.length;o<c;o++)r[o].isDataTexture?s.push(mg(r[o].image)):s.push(mg(r[o]))}else s=mg(r);i.url=s}return n||(e.images[this.uuid]=i),i}}function mg(t){return typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap?e6.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(Gt("Texture: Unable to serialize Texture."),{})}let n6=0;const gg=new me;class Li extends ec{constructor(e=Li.DEFAULT_IMAGE,n=Li.DEFAULT_MAPPING,i=Is,r=Is,s=wi,o=mo,c=Fr,u=fr,d=Li.DEFAULT_ANISOTROPY,h=Ca){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:n6++}),this.uuid=Fu(),this.name="",this.source=new s_(e),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=o,this.anisotropy=d,this.format=c,this.internalFormat=null,this.type=u,this.offset=new bn(0,0),this.repeat=new bn(1,1),this.center=new bn(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Wt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(gg).x}get height(){return this.source.getSize(gg).y}get depth(){return this.source.getSize(gg).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const n in e){const i=e[n];if(i===void 0){Gt(`Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){Gt(`Texture.setValues(): property '${n}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),n||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==aP)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case J0:e.x=e.x-Math.floor(e.x);break;case Is:e.x=e.x<0?0:1;break;case Q0: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 J0:e.y=e.y-Math.floor(e.y);break;case Is:e.y=e.y<0?0:1;break;case Q0: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)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Li.DEFAULT_IMAGE=null;Li.DEFAULT_MAPPING=aP;Li.DEFAULT_ANISOTROPY=1;class Vn{constructor(e=0,n=0,i=0,r=1){Vn.prototype.isVector4=!0,this.x=e,this.y=n,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,i,r){return this.x=e,this.y=n,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*n+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*n+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*n+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*n+o[7]*i+o[11]*r+o[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,i,r,s;const u=e.elements,d=u[0],h=u[4],p=u[8],m=u[1],v=u[5],_=u[9],w=u[2],y=u[6],b=u[10];if(Math.abs(h-m)<.01&&Math.abs(p-w)<.01&&Math.abs(_-y)<.01){if(Math.abs(h+m)<.1&&Math.abs(p+w)<.1&&Math.abs(_+y)<.1&&Math.abs(d+v+b-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const A=(d+1)/2,M=(v+1)/2,I=(b+1)/2,k=(h+m)/4,U=(p+w)/4,S=(_+y)/4;return A>M&&A>I?A<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(A),r=k/i,s=U/i):M>I?M<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(M),i=k/r,s=S/r):I<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(I),i=U/s,r=S/s),this.set(i,r,s,n),this}let T=Math.sqrt((y-_)*(y-_)+(p-w)*(p-w)+(m-h)*(m-h));return Math.abs(T)<.001&&(T=1),this.x=(y-_)/T,this.y=(p-w)/T,this.z=(m-h)/T,this.w=Math.acos((d+v+b-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=ln(this.x,e.x,n.x),this.y=ln(this.y,e.y,n.y),this.z=ln(this.z,e.z,n.z),this.w=ln(this.w,e.w,n.w),this}clampScalar(e,n){return this.x=ln(this.x,e,n),this.y=ln(this.y,e,n),this.z=ln(this.z,e,n),this.w=ln(this.w,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ln(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this.w=e.w+(n.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class i6 extends ec{constructor(e=1,n=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:wi,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=i.depth,this.scissor=new Vn(0,0,e,n),this.scissorTest=!1,this.viewport=new Vn(0,0,e,n),this.textures=[];const r={width:e,height:n,depth:i.depth},s=new Li(r),o=i.count;for(let c=0;c<o;c++)this.textures[c]=s.clone(),this.textures[c].isRenderTargetTexture=!0,this.textures[c].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview}_setTextureOptions(e={}){const n={minFilter:wi,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(n.mapping=e.mapping),e.wrapS!==void 0&&(n.wrapS=e.wrapS),e.wrapT!==void 0&&(n.wrapT=e.wrapT),e.wrapR!==void 0&&(n.wrapR=e.wrapR),e.magFilter!==void 0&&(n.magFilter=e.magFilter),e.minFilter!==void 0&&(n.minFilter=e.minFilter),e.format!==void 0&&(n.format=e.format),e.type!==void 0&&(n.type=e.type),e.anisotropy!==void 0&&(n.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(n.colorSpace=e.colorSpace),e.flipY!==void 0&&(n.flipY=e.flipY),e.generateMipmaps!==void 0&&(n.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(n.internalFormat=e.internalFormat);for(let i=0;i<this.textures.length;i++)this.textures[i].setValues(n)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,n,i=1){if(this.width!==e||this.height!==n||this.depth!==i){this.width=e,this.height=n,this.depth=i;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=n,this.textures[r].image.depth=i,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].image.depth>1);this.dispose()}this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,i=e.textures.length;n<i;n++){this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0,this.textures[n].renderTarget=this;const r=Object.assign({},e.textures[n].image);this.textures[n].source=new s_(r)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class rs extends i6{constructor(e=1,n=1,i={}){super(e,n,i),this.isWebGLRenderTarget=!0}}class mP extends Li{constructor(e=null,n=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:i,depth:r},this.magFilter=mi,this.minFilter=mi,this.wrapR=Is,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class r6 extends Li{constructor(e=null,n=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:i,depth:r},this.magFilter=mi,this.minFilter=mi,this.wrapR=Is,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Kn{constructor(e,n,i,r,s,o,c,u,d,h,p,m,v,_,w,y){Kn.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,i,r,s,o,c,u,d,h,p,m,v,_,w,y)}set(e,n,i,r,s,o,c,u,d,h,p,m,v,_,w,y){const b=this.elements;return b[0]=e,b[4]=n,b[8]=i,b[12]=r,b[1]=s,b[5]=o,b[9]=c,b[13]=u,b[2]=d,b[6]=h,b[10]=p,b[14]=m,b[3]=v,b[7]=_,b[11]=w,b[15]=y,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 Kn().fromArray(this.elements)}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],n[9]=i[9],n[10]=i[10],n[11]=i[11],n[12]=i[12],n[13]=i[13],n[14]=i[14],n[15]=i[15],this}copyPosition(e){const n=this.elements,i=e.elements;return n[12]=i[12],n[13]=i[13],n[14]=i[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,i){return this.determinant()===0?(e.set(1,0,0),n.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,n,i){return this.set(e.x,n.x,i.x,0,e.y,n.y,i.y,0,e.z,n.z,i.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const n=this.elements,i=e.elements,r=1/dl.setFromMatrixColumn(e,0).length(),s=1/dl.setFromMatrixColumn(e,1).length(),o=1/dl.setFromMatrixColumn(e,2).length();return n[0]=i[0]*r,n[1]=i[1]*r,n[2]=i[2]*r,n[3]=0,n[4]=i[4]*s,n[5]=i[5]*s,n[6]=i[6]*s,n[7]=0,n[8]=i[8]*o,n[9]=i[9]*o,n[10]=i[10]*o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),c=Math.sin(i),u=Math.cos(r),d=Math.sin(r),h=Math.cos(s),p=Math.sin(s);if(e.order==="XYZ"){const m=o*h,v=o*p,_=c*h,w=c*p;n[0]=u*h,n[4]=-u*p,n[8]=d,n[1]=v+_*d,n[5]=m-w*d,n[9]=-c*u,n[2]=w-m*d,n[6]=_+v*d,n[10]=o*u}else if(e.order==="YXZ"){const m=u*h,v=u*p,_=d*h,w=d*p;n[0]=m+w*c,n[4]=_*c-v,n[8]=o*d,n[1]=o*p,n[5]=o*h,n[9]=-c,n[2]=v*c-_,n[6]=w+m*c,n[10]=o*u}else if(e.order==="ZXY"){const m=u*h,v=u*p,_=d*h,w=d*p;n[0]=m-w*c,n[4]=-o*p,n[8]=_+v*c,n[1]=v+_*c,n[5]=o*h,n[9]=w-m*c,n[2]=-o*d,n[6]=c,n[10]=o*u}else if(e.order==="ZYX"){const m=o*h,v=o*p,_=c*h,w=c*p;n[0]=u*h,n[4]=_*d-v,n[8]=m*d+w,n[1]=u*p,n[5]=w*d+m,n[9]=v*d-_,n[2]=-d,n[6]=c*u,n[10]=o*u}else if(e.order==="YZX"){const m=o*u,v=o*d,_=c*u,w=c*d;n[0]=u*h,n[4]=w-m*p,n[8]=_*p+v,n[1]=p,n[5]=o*h,n[9]=-c*h,n[2]=-d*h,n[6]=v*p+_,n[10]=m-w*p}else if(e.order==="XZY"){const m=o*u,v=o*d,_=c*u,w=c*d;n[0]=u*h,n[4]=-p,n[8]=d*h,n[1]=m*p+w,n[5]=o*h,n[9]=v*p-_,n[2]=_*p-v,n[6]=c*h,n[10]=w*p+m}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(s6,e,a6)}lookAt(e,n,i){const r=this.elements;return Ki.subVectors(e,n),Ki.lengthSq()===0&&(Ki.z=1),Ki.normalize(),ga.crossVectors(i,Ki),ga.lengthSq()===0&&(Math.abs(i.z)===1?Ki.x+=1e-4:Ki.z+=1e-4,Ki.normalize(),ga.crossVectors(i,Ki)),ga.normalize(),nf.crossVectors(Ki,ga),r[0]=ga.x,r[4]=nf.x,r[8]=Ki.x,r[1]=ga.y,r[5]=nf.y,r[9]=Ki.y,r[2]=ga.z,r[6]=nf.z,r[10]=Ki.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,s=this.elements,o=i[0],c=i[4],u=i[8],d=i[12],h=i[1],p=i[5],m=i[9],v=i[13],_=i[2],w=i[6],y=i[10],b=i[14],T=i[3],A=i[7],M=i[11],I=i[15],k=r[0],U=r[4],S=r[8],P=r[12],V=r[1],O=r[5],G=r[9],J=r[13],H=r[2],X=r[6],K=r[10],Q=r[14],W=r[3],q=r[7],Z=r[11],z=r[15];return s[0]=o*k+c*V+u*H+d*W,s[4]=o*U+c*O+u*X+d*q,s[8]=o*S+c*G+u*K+d*Z,s[12]=o*P+c*J+u*Q+d*z,s[1]=h*k+p*V+m*H+v*W,s[5]=h*U+p*O+m*X+v*q,s[9]=h*S+p*G+m*K+v*Z,s[13]=h*P+p*J+m*Q+v*z,s[2]=_*k+w*V+y*H+b*W,s[6]=_*U+w*O+y*X+b*q,s[10]=_*S+w*G+y*K+b*Z,s[14]=_*P+w*J+y*Q+b*z,s[3]=T*k+A*V+M*H+I*W,s[7]=T*U+A*O+M*X+I*q,s[11]=T*S+A*G+M*K+I*Z,s[15]=T*P+A*J+M*Q+I*z,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[4],r=e[8],s=e[12],o=e[1],c=e[5],u=e[9],d=e[13],h=e[2],p=e[6],m=e[10],v=e[14],_=e[3],w=e[7],y=e[11],b=e[15],T=u*v-d*m,A=c*v-d*p,M=c*m-u*p,I=o*v-d*h,k=o*m-u*h,U=o*p-c*h;return n*(w*T-y*A+b*M)-i*(_*T-y*I+b*k)+r*(_*A-w*I+b*U)-s*(_*M-w*k+y*U)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=n,r[14]=i),this}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],c=e[5],u=e[6],d=e[7],h=e[8],p=e[9],m=e[10],v=e[11],_=e[12],w=e[13],y=e[14],b=e[15],T=n*c-i*o,A=n*u-r*o,M=n*d-s*o,I=i*u-r*c,k=i*d-s*c,U=r*d-s*u,S=h*w-p*_,P=h*y-m*_,V=h*b-v*_,O=p*y-m*w,G=p*b-v*w,J=m*b-v*y,H=T*J-A*G+M*O+I*V-k*P+U*S;if(H===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const X=1/H;return e[0]=(c*J-u*G+d*O)*X,e[1]=(r*G-i*J-s*O)*X,e[2]=(w*U-y*k+b*I)*X,e[3]=(m*k-p*U-v*I)*X,e[4]=(u*V-o*J-d*P)*X,e[5]=(n*J-r*V+s*P)*X,e[6]=(y*M-_*U-b*A)*X,e[7]=(h*U-m*M+v*A)*X,e[8]=(o*G-c*V+d*S)*X,e[9]=(i*V-n*G-s*S)*X,e[10]=(_*k-w*M+b*T)*X,e[11]=(p*M-h*k-v*T)*X,e[12]=(c*P-o*O-u*S)*X,e[13]=(n*O-i*P+r*S)*X,e[14]=(w*A-_*I-y*T)*X,e[15]=(h*I-p*A+m*T)*X,this}scale(e){const n=this.elements,i=e.x,r=e.y,s=e.z;return n[0]*=i,n[4]*=r,n[8]*=s,n[1]*=i,n[5]*=r,n[9]*=s,n[2]*=i,n[6]*=r,n[10]*=s,n[3]*=i,n[7]*=r,n[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,i,r))}makeTranslation(e,n,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,i,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const i=Math.cos(n),r=Math.sin(n),s=1-i,o=e.x,c=e.y,u=e.z,d=s*o,h=s*c;return this.set(d*o+i,d*c-r*u,d*u+r*c,0,d*c+r*u,h*c+i,h*u-r*o,0,d*u-r*c,h*u+r*o,s*u*u+i,0,0,0,0,1),this}makeScale(e,n,i){return this.set(e,0,0,0,0,n,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,n,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,n,r,1,0,0,0,0,1),this}compose(e,n,i){const r=this.elements,s=n._x,o=n._y,c=n._z,u=n._w,d=s+s,h=o+o,p=c+c,m=s*d,v=s*h,_=s*p,w=o*h,y=o*p,b=c*p,T=u*d,A=u*h,M=u*p,I=i.x,k=i.y,U=i.z;return r[0]=(1-(w+b))*I,r[1]=(v+M)*I,r[2]=(_-A)*I,r[3]=0,r[4]=(v-M)*k,r[5]=(1-(m+b))*k,r[6]=(y+T)*k,r[7]=0,r[8]=(_+A)*U,r[9]=(y-T)*U,r[10]=(1-(m+w))*U,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,n,i){const r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];const s=this.determinant();if(s===0)return i.set(1,1,1),n.identity(),this;let o=dl.set(r[0],r[1],r[2]).length();const c=dl.set(r[4],r[5],r[6]).length(),u=dl.set(r[8],r[9],r[10]).length();s<0&&(o=-o),kr.copy(this);const d=1/o,h=1/c,p=1/u;return kr.elements[0]*=d,kr.elements[1]*=d,kr.elements[2]*=d,kr.elements[4]*=h,kr.elements[5]*=h,kr.elements[6]*=h,kr.elements[8]*=p,kr.elements[9]*=p,kr.elements[10]*=p,n.setFromRotationMatrix(kr),i.x=o,i.y=c,i.z=u,this}makePerspective(e,n,i,r,s,o,c=es,u=!1){const d=this.elements,h=2*s/(n-e),p=2*s/(i-r),m=(n+e)/(n-e),v=(i+r)/(i-r);let _,w;if(u)_=s/(o-s),w=o*s/(o-s);else if(c===es)_=-(o+s)/(o-s),w=-2*o*s/(o-s);else if(c===wh)_=-o/(o-s),w=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return d[0]=h,d[4]=0,d[8]=m,d[12]=0,d[1]=0,d[5]=p,d[9]=v,d[13]=0,d[2]=0,d[6]=0,d[10]=_,d[14]=w,d[3]=0,d[7]=0,d[11]=-1,d[15]=0,this}makeOrthographic(e,n,i,r,s,o,c=es,u=!1){const d=this.elements,h=2/(n-e),p=2/(i-r),m=-(n+e)/(n-e),v=-(i+r)/(i-r);let _,w;if(u)_=1/(o-s),w=o/(o-s);else if(c===es)_=-2/(o-s),w=-(o+s)/(o-s);else if(c===wh)_=-1/(o-s),w=-s/(o-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return d[0]=h,d[4]=0,d[8]=0,d[12]=m,d[1]=0,d[5]=p,d[9]=0,d[13]=v,d[2]=0,d[6]=0,d[10]=_,d[14]=w,d[3]=0,d[7]=0,d[11]=0,d[15]=1,this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<16;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<16;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e[n+9]=i[9],e[n+10]=i[10],e[n+11]=i[11],e[n+12]=i[12],e[n+13]=i[13],e[n+14]=i[14],e[n+15]=i[15],e}}const dl=new me,kr=new Kn,s6=new me(0,0,0),a6=new me(1,1,1),ga=new me,nf=new me,Ki=new me,D1=new Kn,N1=new tc;let Co=class gP{constructor(e=0,n=0,i=0,r=gP.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,i,r=this._order){return this._x=e,this._y=n,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],c=r[8],u=r[1],d=r[5],h=r[9],p=r[2],m=r[6],v=r[10];switch(n){case"XYZ":this._y=Math.asin(ln(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,v),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(m,d),this._z=0);break;case"YXZ":this._x=Math.asin(-ln(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(c,v),this._z=Math.atan2(u,d)):(this._y=Math.atan2(-p,s),this._z=0);break;case"ZXY":this._x=Math.asin(ln(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-p,v),this._z=Math.atan2(-o,d)):(this._y=0,this._z=Math.atan2(u,s));break;case"ZYX":this._y=Math.asin(-ln(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(m,v),this._z=Math.atan2(u,s)):(this._x=0,this._z=Math.atan2(-o,d));break;case"YZX":this._z=Math.asin(ln(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-h,d),this._y=Math.atan2(-p,s)):(this._x=0,this._y=Math.atan2(c,v));break;case"XZY":this._z=Math.asin(-ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(m,d),this._y=Math.atan2(c,s)):(this._x=Math.atan2(-h,v),this._y=0);break;default:Gt("Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,i){return D1.makeRotationFromQuaternion(e),this.setFromRotationMatrix(D1,n,i)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return N1.setFromEuler(this),this.setFromQuaternion(N1,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Co.DEFAULT_ORDER="XYZ";class vP{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let o6=0;const I1=new me,fl=new tc,As=new Kn,rf=new me,Gc=new me,l6=new me,c6=new tc,U1=new me(1,0,0),F1=new me(0,1,0),O1=new me(0,0,1),B1={type:"added"},u6={type:"removed"},hl={type:"childadded",child:null},vg={type:"childremoved",child:null};class er extends ec{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:o6++}),this.uuid=Fu(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=er.DEFAULT_UP.clone();const e=new me,n=new Co,i=new tc,r=new me(1,1,1);function s(){i.setFromEuler(n,!1)}function o(){n.setFromQuaternion(i,void 0,!1)}n._onChange(s),i._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Kn},normalMatrix:{value:new Wt}}),this.matrix=new Kn,this.matrixWorld=new Kn,this.matrixAutoUpdate=er.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=er.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new vP,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,n){this.quaternion.setFromAxisAngle(e,n)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,n){return fl.setFromAxisAngle(e,n),this.quaternion.multiply(fl),this}rotateOnWorldAxis(e,n){return fl.setFromAxisAngle(e,n),this.quaternion.premultiply(fl),this}rotateX(e){return this.rotateOnAxis(U1,e)}rotateY(e){return this.rotateOnAxis(F1,e)}rotateZ(e){return this.rotateOnAxis(O1,e)}translateOnAxis(e,n){return I1.copy(e).applyQuaternion(this.quaternion),this.position.add(I1.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis(U1,e)}translateY(e){return this.translateOnAxis(F1,e)}translateZ(e){return this.translateOnAxis(O1,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(As.copy(this.matrixWorld).invert())}lookAt(e,n,i){e.isVector3?rf.copy(e):rf.set(e,n,i);const r=this.parent;this.updateWorldMatrix(!0,!1),Gc.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?As.lookAt(Gc,rf,this.up):As.lookAt(rf,Gc,this.up),this.quaternion.setFromRotationMatrix(As),r&&(As.extractRotation(r.matrixWorld),fl.setFromRotationMatrix(As),this.quaternion.premultiply(fl.invert()))}add(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return e===this?(_n("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(B1),hl.child=e,this.dispatchEvent(hl),hl.child=null):_n("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const n=this.children.indexOf(e);return n!==-1&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(u6),vg.child=e,this.dispatchEvent(vg),vg.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),As.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),As.multiply(e.parent.matrixWorld)),e.applyMatrix4(As),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(B1),hl.child=e,this.dispatchEvent(hl),hl.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,n){if(this[e]===n)return this;for(let i=0,r=this.children.length;i<r;i++){const o=this.children[i].getObjectByProperty(e,n);if(o!==void 0)return o}}getObjectsByProperty(e,n,i=[]){this[e]===n&&i.push(this);const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].getObjectsByProperty(e,n,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Gc,e,l6),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Gc,c6,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);const n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].traverseVisible(e)}traverseAncestors(e){const n=this.parent;n!==null&&(e(n),n.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(e!==null){const n=e.x,i=e.y,r=e.z,s=this.matrix.elements;s[12]+=n-s[0]*n-s[4]*i-s[8]*r,s[13]+=i-s[1]*n-s[5]*i-s[9]*r,s[14]+=r-s[2]*n-s[6]*i-s[10]*r}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].updateMatrixWorld(e)}updateWorldMatrix(e,n){const i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),n===!0){const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const n=e===void 0||typeof e=="string",i={};n&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),this.static!==!1&&(r.static=this.static),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(c=>({...c,boundingBox:c.boundingBox?c.boundingBox.toJSON():void 0,boundingSphere:c.boundingSphere?c.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(c=>({...c})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function s(c,u){return c[u.uuid]===void 0&&(c[u.uuid]=u.toJSON(e)),u.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){const u=c.shapes;if(Array.isArray(u))for(let d=0,h=u.length;d<h;d++){const p=u[d];s(e.shapes,p)}else s(e.shapes,u)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const c=[];for(let u=0,d=this.material.length;u<d;u++)c.push(s(e.materials,this.material[u]));r.material=c}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let c=0;c<this.children.length;c++)r.children.push(this.children[c].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let c=0;c<this.animations.length;c++){const u=this.animations[c];r.animations.push(s(e.animations,u))}}if(n){const c=o(e.geometries),u=o(e.materials),d=o(e.textures),h=o(e.images),p=o(e.shapes),m=o(e.skeletons),v=o(e.animations),_=o(e.nodes);c.length>0&&(i.geometries=c),u.length>0&&(i.materials=u),d.length>0&&(i.textures=d),h.length>0&&(i.images=h),p.length>0&&(i.shapes=p),m.length>0&&(i.skeletons=m),v.length>0&&(i.animations=v),_.length>0&&(i.nodes=_)}return i.object=r,i;function o(c){const u=[];for(const d in c){const h=c[d];delete h.metadata,u.push(h)}return u}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),e.pivot!==null&&(this.pivot=e.pivot.clone()),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.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}er.DEFAULT_UP=new me(0,1,0);er.DEFAULT_MATRIX_AUTO_UPDATE=!0;er.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class sf extends er{constructor(){super(),this.isGroup=!0,this.type="Group"}}const d6={type:"move"};class yg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new sf,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 sf,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new me,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new me),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new sf,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new me,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new me),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const i of e.hand.values())this._getHandJoint(n,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,i){let r=null,s=null,o=null;const c=this._targetRay,u=this._grip,d=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(d&&e.hand){o=!0;for(const w of e.hand.values()){const y=n.getJointPose(w,i),b=this._getHandJoint(d,w);y!==null&&(b.matrix.fromArray(y.transform.matrix),b.matrix.decompose(b.position,b.rotation,b.scale),b.matrixWorldNeedsUpdate=!0,b.jointRadius=y.radius),b.visible=y!==null}const h=d.joints["index-finger-tip"],p=d.joints["thumb-tip"],m=h.position.distanceTo(p.position),v=.02,_=.005;d.inputState.pinching&&m>v+_?(d.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!d.inputState.pinching&&m<=v-_&&(d.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else u!==null&&e.gripSpace&&(s=n.getPose(e.gripSpace,i),s!==null&&(u.matrix.fromArray(s.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,s.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(s.linearVelocity)):u.hasLinearVelocity=!1,s.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(s.angularVelocity)):u.hasAngularVelocity=!1));c!==null&&(r=n.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1,this.dispatchEvent(d6)))}return c!==null&&(c.visible=r!==null),u!==null&&(u.visible=s!==null),d!==null&&(d.visible=o!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const i=new sf;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[n.jointName]=i,e.add(i)}return e.joints[n.jointName]}}const yP={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},va={h:0,s:0,l:0},af={h:0,s:0,l:0};function _g(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}class Tn{constructor(e,n,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,i)}set(e,n,i){if(n===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,n,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=ur){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,fn.colorSpaceToWorking(this,n),this}setRGB(e,n,i,r=fn.workingColorSpace){return this.r=e,this.g=n,this.b=i,fn.colorSpaceToWorking(this,r),this}setHSL(e,n,i,r=fn.workingColorSpace){if(e=JH(e,1),n=ln(n,0,1),i=ln(i,0,1),n===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+n):i+n-i*n,o=2*i-s;this.r=_g(o,s,e+1/3),this.g=_g(o,s,e),this.b=_g(o,s,e-1/3)}return fn.colorSpaceToWorking(this,r),this}setStyle(e,n=ur){function i(s){s!==void 0&&parseFloat(s)<1&&Gt("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],c=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return i(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,n);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return i(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,n);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,n);break;default:Gt("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[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,n);if(o===6)return this.setHex(parseInt(s,16),n);Gt("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=ur){const i=yP[e.toLowerCase()];return i!==void 0?this.setHex(i,n):Gt("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=Bs(e.r),this.g=Bs(e.g),this.b=Bs(e.b),this}copyLinearToSRGB(e){return this.r=Ul(e.r),this.g=Ul(e.g),this.b=Ul(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=ur){return fn.workingToColorSpace(bi.copy(this),e),Math.round(ln(bi.r*255,0,255))*65536+Math.round(ln(bi.g*255,0,255))*256+Math.round(ln(bi.b*255,0,255))}getHexString(e=ur){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=fn.workingColorSpace){fn.workingToColorSpace(bi.copy(this),n);const i=bi.r,r=bi.g,s=bi.b,o=Math.max(i,r,s),c=Math.min(i,r,s);let u,d;const h=(c+o)/2;if(c===o)u=0,d=0;else{const p=o-c;switch(d=h<=.5?p/(o+c):p/(2-o-c),o){case i:u=(r-s)/p+(r<s?6:0);break;case r:u=(s-i)/p+2;break;case s:u=(i-r)/p+4;break}u/=6}return e.h=u,e.s=d,e.l=h,e}getRGB(e,n=fn.workingColorSpace){return fn.workingToColorSpace(bi.copy(this),n),e.r=bi.r,e.g=bi.g,e.b=bi.b,e}getStyle(e=ur){fn.workingToColorSpace(bi.copy(this),e);const n=bi.r,i=bi.g,r=bi.b;return e!==ur?`color(${e} ${n.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(n*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,n,i){return this.getHSL(va),this.setHSL(va.h+e,va.s+n,va.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,n){return this.r=e.r+n.r,this.g=e.g+n.g,this.b=e.b+n.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,n){return this.r+=(e.r-this.r)*n,this.g+=(e.g-this.g)*n,this.b+=(e.b-this.b)*n,this}lerpColors(e,n,i){return this.r=e.r+(n.r-e.r)*i,this.g=e.g+(n.g-e.g)*i,this.b=e.b+(n.b-e.b)*i,this}lerpHSL(e,n){this.getHSL(va),e.getHSL(af);const i=fg(va.h,af.h,n),r=fg(va.s,af.s,n),s=fg(va.l,af.l,n);return this.setHSL(i,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const n=this.r,i=this.g,r=this.b,s=e.elements;return this.r=s[0]*n+s[3]*i+s[6]*r,this.g=s[1]*n+s[4]*i+s[7]*r,this.b=s[2]*n+s[5]*i+s[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,n=0){return this.r=e[n],this.g=e[n+1],this.b=e[n+2],this}toArray(e=[],n=0){return e[n]=this.r,e[n+1]=this.g,e[n+2]=this.b,e}fromBufferAttribute(e,n){return this.r=e.getX(n),this.g=e.getY(n),this.b=e.getZ(n),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const bi=new Tn;Tn.NAMES=yP;class f6 extends er{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Co,this.environmentIntensity=1,this.environmentRotation=new Co,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}const Lr=new me,Cs=new me,xg=new me,Ps=new me,pl=new me,ml=new me,z1=new me,bg=new me,Sg=new me,wg=new me,Eg=new Vn,Mg=new Vn,Tg=new Vn;let jc=class Al{constructor(e=new me,n=new me,i=new me){this.a=e,this.b=n,this.c=i}static getNormal(e,n,i,r){r.subVectors(i,n),Lr.subVectors(e,n),r.cross(Lr);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,n,i,r,s){Lr.subVectors(r,n),Cs.subVectors(i,n),xg.subVectors(e,n);const o=Lr.dot(Lr),c=Lr.dot(Cs),u=Lr.dot(xg),d=Cs.dot(Cs),h=Cs.dot(xg),p=o*d-c*c;if(p===0)return s.set(0,0,0),null;const m=1/p,v=(d*u-c*h)*m,_=(o*h-c*u)*m;return s.set(1-v-_,_,v)}static containsPoint(e,n,i,r){return this.getBarycoord(e,n,i,r,Ps)===null?!1:Ps.x>=0&&Ps.y>=0&&Ps.x+Ps.y<=1}static getInterpolation(e,n,i,r,s,o,c,u){return this.getBarycoord(e,n,i,r,Ps)===null?(u.x=0,u.y=0,"z"in u&&(u.z=0),"w"in u&&(u.w=0),null):(u.setScalar(0),u.addScaledVector(s,Ps.x),u.addScaledVector(o,Ps.y),u.addScaledVector(c,Ps.z),u)}static getInterpolatedAttribute(e,n,i,r,s,o){return Eg.setScalar(0),Mg.setScalar(0),Tg.setScalar(0),Eg.fromBufferAttribute(e,n),Mg.fromBufferAttribute(e,i),Tg.fromBufferAttribute(e,r),o.setScalar(0),o.addScaledVector(Eg,s.x),o.addScaledVector(Mg,s.y),o.addScaledVector(Tg,s.z),o}static isFrontFacing(e,n,i,r){return Lr.subVectors(i,n),Cs.subVectors(e,n),Lr.cross(Cs).dot(r)<0}set(e,n,i){return this.a.copy(e),this.b.copy(n),this.c.copy(i),this}setFromPointsAndIndices(e,n,i,r){return this.a.copy(e[n]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,n,i,r){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Lr.subVectors(this.c,this.b),Cs.subVectors(this.a,this.b),Lr.cross(Cs).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Al.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Al.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,i,r,s){return Al.getInterpolation(e,this.a,this.b,this.c,n,i,r,s)}containsPoint(e){return Al.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Al.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const i=this.a,r=this.b,s=this.c;let o,c;pl.subVectors(r,i),ml.subVectors(s,i),bg.subVectors(e,i);const u=pl.dot(bg),d=ml.dot(bg);if(u<=0&&d<=0)return n.copy(i);Sg.subVectors(e,r);const h=pl.dot(Sg),p=ml.dot(Sg);if(h>=0&&p<=h)return n.copy(r);const m=u*p-h*d;if(m<=0&&u>=0&&h<=0)return o=u/(u-h),n.copy(i).addScaledVector(pl,o);wg.subVectors(e,s);const v=pl.dot(wg),_=ml.dot(wg);if(_>=0&&v<=_)return n.copy(s);const w=v*d-u*_;if(w<=0&&d>=0&&_<=0)return c=d/(d-_),n.copy(i).addScaledVector(ml,c);const y=h*_-v*p;if(y<=0&&p-h>=0&&v-_>=0)return z1.subVectors(s,r),c=(p-h)/(p-h+(v-_)),n.copy(r).addScaledVector(z1,c);const b=1/(y+w+m);return o=w*b,c=m*b,n.copy(i).addScaledVector(pl,o).addScaledVector(ml,c)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}};class Ou{constructor(e=new me(1/0,1/0,1/0),n=new me(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,i=e.length;n<i;n+=3)this.expandByPoint(Dr.fromArray(e,n));return this}setFromBufferAttribute(e){this.makeEmpty();for(let n=0,i=e.count;n<i;n++)this.expandByPoint(Dr.fromBufferAttribute(e,n));return this}setFromPoints(e){this.makeEmpty();for(let n=0,i=e.length;n<i;n++)this.expandByPoint(e[n]);return this}setFromCenterAndSize(e,n){const i=Dr.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,n=!1){return this.makeEmpty(),this.expandByObject(e,n)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,n=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const s=i.getAttribute("position");if(n===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,c=s.count;o<c;o++)e.isMesh===!0?e.getVertexPosition(o,Dr):Dr.fromBufferAttribute(s,o),Dr.applyMatrix4(e.matrixWorld),this.expandByPoint(Dr);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),of.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),of.copy(i.boundingBox)),of.applyMatrix4(e.matrixWorld),this.union(of)}const r=e.children;for(let s=0,o=r.length;s<o;s++)this.expandByObject(r[s],n);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Dr),Dr.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,i;return e.normal.x>0?(n=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),n<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Wc),lf.subVectors(this.max,Wc),gl.subVectors(e.a,Wc),vl.subVectors(e.b,Wc),yl.subVectors(e.c,Wc),ya.subVectors(vl,gl),_a.subVectors(yl,vl),eo.subVectors(gl,yl);let n=[0,-ya.z,ya.y,0,-_a.z,_a.y,0,-eo.z,eo.y,ya.z,0,-ya.x,_a.z,0,-_a.x,eo.z,0,-eo.x,-ya.y,ya.x,0,-_a.y,_a.x,0,-eo.y,eo.x,0];return!Ag(n,gl,vl,yl,lf)||(n=[1,0,0,0,1,0,0,0,1],!Ag(n,gl,vl,yl,lf))?!1:(cf.crossVectors(ya,_a),n=[cf.x,cf.y,cf.z],Ag(n,gl,vl,yl,lf))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Dr).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Dr).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:(Rs[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Rs[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Rs[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Rs[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Rs[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Rs[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Rs[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Rs[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Rs),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)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Rs=[new me,new me,new me,new me,new me,new me,new me,new me],Dr=new me,of=new Ou,gl=new me,vl=new me,yl=new me,ya=new me,_a=new me,eo=new me,Wc=new me,lf=new me,cf=new me,to=new me;function Ag(t,e,n,i,r){for(let s=0,o=t.length-3;s<=o;s+=3){to.fromArray(t,s);const c=r.x*Math.abs(to.x)+r.y*Math.abs(to.y)+r.z*Math.abs(to.z),u=e.dot(to),d=n.dot(to),h=i.dot(to);if(Math.max(-Math.max(u,d,h),Math.min(u,d,h))>c)return!1}return!0}const $n=new me,uf=new bn;let h6=0;class Vr{constructor(e,n,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:h6++}),this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=i,this.usage=T1,this.updateRanges=[],this.gpuType=Qr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,i){e*=this.itemSize,i*=n.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=n.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let n=0,i=this.count;n<i;n++)uf.fromBufferAttribute(this,n),uf.applyMatrix3(e),this.setXY(n,uf.x,uf.y);else if(this.itemSize===3)for(let n=0,i=this.count;n<i;n++)$n.fromBufferAttribute(this,n),$n.applyMatrix3(e),this.setXYZ(n,$n.x,$n.y,$n.z);return this}applyMatrix4(e){for(let n=0,i=this.count;n<i;n++)$n.fromBufferAttribute(this,n),$n.applyMatrix4(e),this.setXYZ(n,$n.x,$n.y,$n.z);return this}applyNormalMatrix(e){for(let n=0,i=this.count;n<i;n++)$n.fromBufferAttribute(this,n),$n.applyNormalMatrix(e),this.setXYZ(n,$n.x,$n.y,$n.z);return this}transformDirection(e){for(let n=0,i=this.count;n<i;n++)$n.fromBufferAttribute(this,n),$n.transformDirection(e),this.setXYZ(n,$n.x,$n.y,$n.z);return this}set(e,n=0){return this.array.set(e,n),this}getComponent(e,n){let i=this.array[e*this.itemSize+n];return this.normalized&&(i=Hc(i,this.array)),i}setComponent(e,n,i){return this.normalized&&(i=Hi(i,this.array)),this.array[e*this.itemSize+n]=i,this}getX(e){let n=this.array[e*this.itemSize];return this.normalized&&(n=Hc(n,this.array)),n}setX(e,n){return this.normalized&&(n=Hi(n,this.array)),this.array[e*this.itemSize]=n,this}getY(e){let n=this.array[e*this.itemSize+1];return this.normalized&&(n=Hc(n,this.array)),n}setY(e,n){return this.normalized&&(n=Hi(n,this.array)),this.array[e*this.itemSize+1]=n,this}getZ(e){let n=this.array[e*this.itemSize+2];return this.normalized&&(n=Hc(n,this.array)),n}setZ(e,n){return this.normalized&&(n=Hi(n,this.array)),this.array[e*this.itemSize+2]=n,this}getW(e){let n=this.array[e*this.itemSize+3];return this.normalized&&(n=Hc(n,this.array)),n}setW(e,n){return this.normalized&&(n=Hi(n,this.array)),this.array[e*this.itemSize+3]=n,this}setXY(e,n,i){return e*=this.itemSize,this.normalized&&(n=Hi(n,this.array),i=Hi(i,this.array)),this.array[e+0]=n,this.array[e+1]=i,this}setXYZ(e,n,i,r){return e*=this.itemSize,this.normalized&&(n=Hi(n,this.array),i=Hi(i,this.array),r=Hi(r,this.array)),this.array[e+0]=n,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,n,i,r,s){return e*=this.itemSize,this.normalized&&(n=Hi(n,this.array),i=Hi(i,this.array),r=Hi(r,this.array),s=Hi(s,this.array)),this.array[e+0]=n,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==T1&&(e.usage=this.usage),e}}class _P extends Vr{constructor(e,n,i){super(new Uint16Array(e),n,i)}}class xP extends Vr{constructor(e,n,i){super(new Uint32Array(e),n,i)}}class zs extends Vr{constructor(e,n,i){super(new Float32Array(e),n,i)}}const p6=new Ou,$c=new me,Cg=new me;class a_{constructor(e=new me,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const i=this.center;n!==void 0?i.copy(n):p6.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;s<o;s++)r=Math.max(r,i.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const n=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=n*n}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,n){const i=this.center.distanceToSquared(e);return n.copy(e),i>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;$c.subVectors(e,this.center);const n=$c.lengthSq();if(n>this.radius*this.radius){const i=Math.sqrt(n),r=(i-this.radius)*.5;this.center.addScaledVector($c,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Cg.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint($c.copy(e.center).add(Cg)),this.expandByPoint($c.copy(e.center).sub(Cg))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let m6=0;const lr=new Kn,Pg=new er,_l=new me,Zi=new Ou,Xc=new Ou,ci=new me;class gs extends ec{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:m6++}),this.uuid=Fu(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(qH(e)?xP:_P)(e,1):this.index=e,this}setIndirect(e,n=0){return this.indirect=e,this.indirectOffset=n,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,n){return this.attributes[e]=n,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,n,i=0){this.groups.push({start:e,count:n,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,n){this.drawRange.start=e,this.drawRange.count=n}applyMatrix4(e){const n=this.attributes.position;n!==void 0&&(n.applyMatrix4(e),n.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const s=new Wt().getNormalMatrix(e);i.applyNormalMatrix(s),i.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return lr.makeRotationFromQuaternion(e),this.applyMatrix4(lr),this}rotateX(e){return lr.makeRotationX(e),this.applyMatrix4(lr),this}rotateY(e){return lr.makeRotationY(e),this.applyMatrix4(lr),this}rotateZ(e){return lr.makeRotationZ(e),this.applyMatrix4(lr),this}translate(e,n,i){return lr.makeTranslation(e,n,i),this.applyMatrix4(lr),this}scale(e,n,i){return lr.makeScale(e,n,i),this.applyMatrix4(lr),this}lookAt(e){return Pg.lookAt(e),Pg.updateMatrix(),this.applyMatrix4(Pg.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(_l).negate(),this.translate(_l.x,_l.y,_l.z),this}setFromPoints(e){const n=this.getAttribute("position");if(n===void 0){const i=[];for(let r=0,s=e.length;r<s;r++){const o=e[r];i.push(o.x,o.y,o.z||0)}this.setAttribute("position",new zs(i,3))}else{const i=Math.min(e.length,n.count);for(let r=0;r<i;r++){const s=e[r];n.setXYZ(r,s.x,s.y,s.z||0)}e.length>n.count&&Gt("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ou);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){_n("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new me(-1/0,-1/0,-1/0),new me(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let i=0,r=n.length;i<r;i++){const s=n[i];Zi.setFromBufferAttribute(s),this.morphTargetsRelative?(ci.addVectors(this.boundingBox.min,Zi.min),this.boundingBox.expandByPoint(ci),ci.addVectors(this.boundingBox.max,Zi.max),this.boundingBox.expandByPoint(ci)):(this.boundingBox.expandByPoint(Zi.min),this.boundingBox.expandByPoint(Zi.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&_n('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new a_);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){_n("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new me,1/0);return}if(e){const i=this.boundingSphere.center;if(Zi.setFromBufferAttribute(e),n)for(let s=0,o=n.length;s<o;s++){const c=n[s];Xc.setFromBufferAttribute(c),this.morphTargetsRelative?(ci.addVectors(Zi.min,Xc.min),Zi.expandByPoint(ci),ci.addVectors(Zi.max,Xc.max),Zi.expandByPoint(ci)):(Zi.expandByPoint(Xc.min),Zi.expandByPoint(Xc.max))}Zi.getCenter(i);let r=0;for(let s=0,o=e.count;s<o;s++)ci.fromBufferAttribute(e,s),r=Math.max(r,i.distanceToSquared(ci));if(n)for(let s=0,o=n.length;s<o;s++){const c=n[s],u=this.morphTargetsRelative;for(let d=0,h=c.count;d<h;d++)ci.fromBufferAttribute(c,d),u&&(_l.fromBufferAttribute(e,d),ci.add(_l)),r=Math.max(r,i.distanceToSquared(ci))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&_n('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,n=this.attributes;if(e===null||n.position===void 0||n.normal===void 0||n.uv===void 0){_n("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=n.position,r=n.normal,s=n.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Vr(new Float32Array(4*i.count),4));const o=this.getAttribute("tangent"),c=[],u=[];for(let S=0;S<i.count;S++)c[S]=new me,u[S]=new me;const d=new me,h=new me,p=new me,m=new bn,v=new bn,_=new bn,w=new me,y=new me;function b(S,P,V){d.fromBufferAttribute(i,S),h.fromBufferAttribute(i,P),p.fromBufferAttribute(i,V),m.fromBufferAttribute(s,S),v.fromBufferAttribute(s,P),_.fromBufferAttribute(s,V),h.sub(d),p.sub(d),v.sub(m),_.sub(m);const O=1/(v.x*_.y-_.x*v.y);isFinite(O)&&(w.copy(h).multiplyScalar(_.y).addScaledVector(p,-v.y).multiplyScalar(O),y.copy(p).multiplyScalar(v.x).addScaledVector(h,-_.x).multiplyScalar(O),c[S].add(w),c[P].add(w),c[V].add(w),u[S].add(y),u[P].add(y),u[V].add(y))}let T=this.groups;T.length===0&&(T=[{start:0,count:e.count}]);for(let S=0,P=T.length;S<P;++S){const V=T[S],O=V.start,G=V.count;for(let J=O,H=O+G;J<H;J+=3)b(e.getX(J+0),e.getX(J+1),e.getX(J+2))}const A=new me,M=new me,I=new me,k=new me;function U(S){I.fromBufferAttribute(r,S),k.copy(I);const P=c[S];A.copy(P),A.sub(I.multiplyScalar(I.dot(P))).normalize(),M.crossVectors(k,P);const O=M.dot(u[S])<0?-1:1;o.setXYZW(S,A.x,A.y,A.z,O)}for(let S=0,P=T.length;S<P;++S){const V=T[S],O=V.start,G=V.count;for(let J=O,H=O+G;J<H;J+=3)U(e.getX(J+0)),U(e.getX(J+1)),U(e.getX(J+2))}}computeVertexNormals(){const e=this.index,n=this.getAttribute("position");if(n!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new Vr(new Float32Array(n.count*3),3),this.setAttribute("normal",i);else for(let m=0,v=i.count;m<v;m++)i.setXYZ(m,0,0,0);const r=new me,s=new me,o=new me,c=new me,u=new me,d=new me,h=new me,p=new me;if(e)for(let m=0,v=e.count;m<v;m+=3){const _=e.getX(m+0),w=e.getX(m+1),y=e.getX(m+2);r.fromBufferAttribute(n,_),s.fromBufferAttribute(n,w),o.fromBufferAttribute(n,y),h.subVectors(o,s),p.subVectors(r,s),h.cross(p),c.fromBufferAttribute(i,_),u.fromBufferAttribute(i,w),d.fromBufferAttribute(i,y),c.add(h),u.add(h),d.add(h),i.setXYZ(_,c.x,c.y,c.z),i.setXYZ(w,u.x,u.y,u.z),i.setXYZ(y,d.x,d.y,d.z)}else for(let m=0,v=n.count;m<v;m+=3)r.fromBufferAttribute(n,m+0),s.fromBufferAttribute(n,m+1),o.fromBufferAttribute(n,m+2),h.subVectors(o,s),p.subVectors(r,s),h.cross(p),i.setXYZ(m+0,h.x,h.y,h.z),i.setXYZ(m+1,h.x,h.y,h.z),i.setXYZ(m+2,h.x,h.y,h.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let n=0,i=e.count;n<i;n++)ci.fromBufferAttribute(e,n),ci.normalize(),e.setXYZ(n,ci.x,ci.y,ci.z)}toNonIndexed(){function e(c,u){const d=c.array,h=c.itemSize,p=c.normalized,m=new d.constructor(u.length*h);let v=0,_=0;for(let w=0,y=u.length;w<y;w++){c.isInterleavedBufferAttribute?v=u[w]*c.data.stride+c.offset:v=u[w]*h;for(let b=0;b<h;b++)m[_++]=d[v++]}return new Vr(m,h,p)}if(this.index===null)return Gt("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const n=new gs,i=this.index.array,r=this.attributes;for(const c in r){const u=r[c],d=e(u,i);n.setAttribute(c,d)}const s=this.morphAttributes;for(const c in s){const u=[],d=s[c];for(let h=0,p=d.length;h<p;h++){const m=d[h],v=e(m,i);u.push(v)}n.morphAttributes[c]=u}n.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let c=0,u=o.length;c<u;c++){const d=o[c];n.addGroup(d.start,d.count,d.materialIndex)}return n}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const u=this.parameters;for(const d in u)u[d]!==void 0&&(e[d]=u[d]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const i=this.attributes;for(const u in i){const d=i[u];e.data.attributes[u]=d.toJSON(e.data)}const r={};let s=!1;for(const u in this.morphAttributes){const d=this.morphAttributes[u],h=[];for(let p=0,m=d.length;p<m;p++){const v=d[p];h.push(v.toJSON(e.data))}h.length>0&&(r[u]=h,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const c=this.boundingSphere;return c!==null&&(e.data.boundingSphere=c.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const r=e.attributes;for(const d in r){const h=r[d];this.setAttribute(d,h.clone(n))}const s=e.morphAttributes;for(const d in s){const h=[],p=s[d];for(let m=0,v=p.length;m<v;m++)h.push(p[m].clone(n));this.morphAttributes[d]=h}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let d=0,h=o.length;d<h;d++){const p=o[d];this.addGroup(p.start,p.count,p.materialIndex)}const c=e.boundingBox;c!==null&&(this.boundingBox=c.clone());const u=e.boundingSphere;return u!==null&&(this.boundingSphere=u.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}let g6=0;class Gh extends ec{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:g6++}),this.uuid=Fu(),this.name="",this.type="Material",this.blending=_o,this.side=Ua,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=G0,this.blendDst=j0,this.blendEquation=lo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Tn(0,0,0),this.blendAlpha=0,this.depthFunc=jl,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=M1,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=cl,this.stencilZFail=cl,this.stencilZPass=cl,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const i=e[n];if(i===void 0){Gt(`Material: parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){Gt(`Material: '${n}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==_o&&(i.blending=this.blending),this.side!==Ua&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==G0&&(i.blendSrc=this.blendSrc),this.blendDst!==j0&&(i.blendDst=this.blendDst),this.blendEquation!==lo&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==jl&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==M1&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==cl&&(i.stencilFail=this.stencilFail),this.stencilZFail!==cl&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==cl&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.allowOverride===!1&&(i.allowOverride=!1),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const c in s){const u=s[c];delete u.metadata,o.push(u)}return o}if(n){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let i=null;if(n!==null){const r=n.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=n[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,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++}}const ks=new me,Rg=new me,df=new me,xa=new me,kg=new me,ff=new me,Lg=new me;class v6{constructor(e=new me,n=new me(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ks)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const i=n.dot(this.direction);return i<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=ks.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(ks.copy(this.origin).addScaledVector(this.direction,n),ks.distanceToSquared(e))}distanceSqToSegment(e,n,i,r){Rg.copy(e).add(n).multiplyScalar(.5),df.copy(n).sub(e).normalize(),xa.copy(this.origin).sub(Rg);const s=e.distanceTo(n)*.5,o=-this.direction.dot(df),c=xa.dot(this.direction),u=-xa.dot(df),d=xa.lengthSq(),h=Math.abs(1-o*o);let p,m,v,_;if(h>0)if(p=o*u-c,m=o*c-u,_=s*h,p>=0)if(m>=-_)if(m<=_){const w=1/h;p*=w,m*=w,v=p*(p+o*m+2*c)+m*(o*p+m+2*u)+d}else m=s,p=Math.max(0,-(o*m+c)),v=-p*p+m*(m+2*u)+d;else m=-s,p=Math.max(0,-(o*m+c)),v=-p*p+m*(m+2*u)+d;else m<=-_?(p=Math.max(0,-(-o*s+c)),m=p>0?-s:Math.min(Math.max(-s,-u),s),v=-p*p+m*(m+2*u)+d):m<=_?(p=0,m=Math.min(Math.max(-s,-u),s),v=m*(m+2*u)+d):(p=Math.max(0,-(o*s+c)),m=p>0?s:Math.min(Math.max(-s,-u),s),v=-p*p+m*(m+2*u)+d);else m=o>0?-s:s,p=Math.max(0,-(o*m+c)),v=-p*p+m*(m+2*u)+d;return i&&i.copy(this.origin).addScaledVector(this.direction,p),r&&r.copy(Rg).addScaledVector(df,m),v}intersectSphere(e,n){ks.subVectors(e.center,this.origin);const i=ks.dot(this.direction),r=ks.dot(ks)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),c=i-o,u=i+o;return u<0?null:c<0?this.at(u,n):this.at(c,n)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/n;return i>=0?i:null}intersectPlane(e,n){const i=this.distanceToPlane(e);return i===null?null:this.at(i,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let i,r,s,o,c,u;const d=1/this.direction.x,h=1/this.direction.y,p=1/this.direction.z,m=this.origin;return d>=0?(i=(e.min.x-m.x)*d,r=(e.max.x-m.x)*d):(i=(e.max.x-m.x)*d,r=(e.min.x-m.x)*d),h>=0?(s=(e.min.y-m.y)*h,o=(e.max.y-m.y)*h):(s=(e.max.y-m.y)*h,o=(e.min.y-m.y)*h),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o<r||isNaN(r))&&(r=o),p>=0?(c=(e.min.z-m.z)*p,u=(e.max.z-m.z)*p):(c=(e.max.z-m.z)*p,u=(e.min.z-m.z)*p),i>u||c>r)||((c>i||i!==i)&&(i=c),(u<r||r!==r)&&(r=u),r<0)?null:this.at(i>=0?i:r,n)}intersectsBox(e){return this.intersectBox(e,ks)!==null}intersectTriangle(e,n,i,r,s){kg.subVectors(n,e),ff.subVectors(i,e),Lg.crossVectors(kg,ff);let o=this.direction.dot(Lg),c;if(o>0){if(r)return null;c=1}else if(o<0)c=-1,o=-o;else return null;xa.subVectors(this.origin,e);const u=c*this.direction.dot(ff.crossVectors(xa,ff));if(u<0)return null;const d=c*this.direction.dot(kg.cross(xa));if(d<0||u+d>o)return null;const h=-c*xa.dot(Lg);return h<0?null:this.at(h/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 bP extends Gh{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Tn(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.envMapRotation=new Co,this.combine=JC,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.envMapRotation.copy(e.envMapRotation),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 V1=new Kn,no=new v6,hf=new a_,H1=new me,pf=new me,mf=new me,gf=new me,Dg=new me,vf=new me,G1=new me,yf=new me;let ds=class extends er{constructor(e=new gs,n=new bP){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const n=this.geometry.morphAttributes,i=Object.keys(n);if(i.length>0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const c=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[c]=s}}}}getVertexPosition(e,n){const i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,o=i.morphTargetsRelative;n.fromBufferAttribute(r,e);const c=this.morphTargetInfluences;if(s&&c){vf.set(0,0,0);for(let u=0,d=s.length;u<d;u++){const h=c[u],p=s[u];h!==0&&(Dg.fromBufferAttribute(p,e),o?vf.addScaledVector(Dg,h):vf.addScaledVector(Dg.sub(n),h))}n.add(vf)}return n}raycast(e,n){const i=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),hf.copy(i.boundingSphere),hf.applyMatrix4(s),no.copy(e.ray).recast(e.near),!(hf.containsPoint(no.origin)===!1&&(no.intersectSphere(hf,H1)===null||no.origin.distanceToSquared(H1)>(e.far-e.near)**2))&&(V1.copy(s).invert(),no.copy(e.ray).applyMatrix4(V1),!(i.boundingBox!==null&&no.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,n,no)))}_computeIntersections(e,n,i){let r;const s=this.geometry,o=this.material,c=s.index,u=s.attributes.position,d=s.attributes.uv,h=s.attributes.uv1,p=s.attributes.normal,m=s.groups,v=s.drawRange;if(c!==null)if(Array.isArray(o))for(let _=0,w=m.length;_<w;_++){const y=m[_],b=o[y.materialIndex],T=Math.max(y.start,v.start),A=Math.min(c.count,Math.min(y.start+y.count,v.start+v.count));for(let M=T,I=A;M<I;M+=3){const k=c.getX(M),U=c.getX(M+1),S=c.getX(M+2);r=_f(this,b,e,i,d,h,p,k,U,S),r&&(r.faceIndex=Math.floor(M/3),r.face.materialIndex=y.materialIndex,n.push(r))}}else{const _=Math.max(0,v.start),w=Math.min(c.count,v.start+v.count);for(let y=_,b=w;y<b;y+=3){const T=c.getX(y),A=c.getX(y+1),M=c.getX(y+2);r=_f(this,o,e,i,d,h,p,T,A,M),r&&(r.faceIndex=Math.floor(y/3),n.push(r))}}else if(u!==void 0)if(Array.isArray(o))for(let _=0,w=m.length;_<w;_++){const y=m[_],b=o[y.materialIndex],T=Math.max(y.start,v.start),A=Math.min(u.count,Math.min(y.start+y.count,v.start+v.count));for(let M=T,I=A;M<I;M+=3){const k=M,U=M+1,S=M+2;r=_f(this,b,e,i,d,h,p,k,U,S),r&&(r.faceIndex=Math.floor(M/3),r.face.materialIndex=y.materialIndex,n.push(r))}}else{const _=Math.max(0,v.start),w=Math.min(u.count,v.start+v.count);for(let y=_,b=w;y<b;y+=3){const T=y,A=y+1,M=y+2;r=_f(this,o,e,i,d,h,p,T,A,M),r&&(r.faceIndex=Math.floor(y/3),n.push(r))}}}};function y6(t,e,n,i,r,s,o,c){let u;if(e.side===Gi?u=i.intersectTriangle(o,s,r,!0,c):u=i.intersectTriangle(r,s,o,e.side===Ua,c),u===null)return null;yf.copy(c),yf.applyMatrix4(t.matrixWorld);const d=n.ray.origin.distanceTo(yf);return d<n.near||d>n.far?null:{distance:d,point:yf.clone(),object:t}}function _f(t,e,n,i,r,s,o,c,u,d){t.getVertexPosition(c,pf),t.getVertexPosition(u,mf),t.getVertexPosition(d,gf);const h=y6(t,e,n,i,pf,mf,gf,G1);if(h){const p=new me;jc.getBarycoord(G1,pf,mf,gf,p),r&&(h.uv=jc.getInterpolatedAttribute(r,c,u,d,p,new bn)),s&&(h.uv1=jc.getInterpolatedAttribute(s,c,u,d,p,new bn)),o&&(h.normal=jc.getInterpolatedAttribute(o,c,u,d,p,new me),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const m={a:c,b:u,c:d,normal:new me,materialIndex:0};jc.getNormal(pf,mf,gf,m.normal),h.face=m,h.barycoord=p}return h}class _6 extends Li{constructor(e=null,n=1,i=1,r,s,o,c,u,d=mi,h=mi,p,m){super(null,o,c,u,d,h,r,s,p,m),this.isDataTexture=!0,this.image={data:e,width:n,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Ng=new me,x6=new me,b6=new Wt;class oo{constructor(e=new me(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,i,r){return this.normal.set(e,n,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,i){const r=Ng.subVectors(i,n).cross(x6.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const i=e.delta(Ng),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:n.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const n=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return n<0&&i>0||i<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const i=n||b6.getNormalMatrix(e),r=this.coplanarPoint(Ng).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.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 io=new a_,S6=new bn(.5,.5),xf=new me;class SP{constructor(e=new oo,n=new oo,i=new oo,r=new oo,s=new oo,o=new oo){this.planes=[e,n,i,r,s,o]}set(e,n,i,r,s,o){const c=this.planes;return c[0].copy(e),c[1].copy(n),c[2].copy(i),c[3].copy(r),c[4].copy(s),c[5].copy(o),this}copy(e){const n=this.planes;for(let i=0;i<6;i++)n[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,n=es,i=!1){const r=this.planes,s=e.elements,o=s[0],c=s[1],u=s[2],d=s[3],h=s[4],p=s[5],m=s[6],v=s[7],_=s[8],w=s[9],y=s[10],b=s[11],T=s[12],A=s[13],M=s[14],I=s[15];if(r[0].setComponents(d-o,v-h,b-_,I-T).normalize(),r[1].setComponents(d+o,v+h,b+_,I+T).normalize(),r[2].setComponents(d+c,v+p,b+w,I+A).normalize(),r[3].setComponents(d-c,v-p,b-w,I-A).normalize(),i)r[4].setComponents(u,m,y,M).normalize(),r[5].setComponents(d-u,v-m,b-y,I-M).normalize();else if(r[4].setComponents(d-u,v-m,b-y,I-M).normalize(),n===es)r[5].setComponents(d+u,v+m,b+y,I+M).normalize();else if(n===wh)r[5].setComponents(u,m,y,M).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),io.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),io.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(io)}intersectsSprite(e){io.center.set(0,0,0);const n=S6.distanceTo(e.center);return io.radius=.7071067811865476+n,io.applyMatrix4(e.matrixWorld),this.intersectsSphere(io)}intersectsSphere(e){const n=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(n[s].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){const n=this.planes;for(let i=0;i<6;i++){const r=n[i];if(xf.x=r.normal.x>0?e.max.x:e.min.x,xf.y=r.normal.y>0?e.max.y:e.min.y,xf.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(xf)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let i=0;i<6;i++)if(n[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class wP extends Li{constructor(e=[],n=To,i,r,s,o,c,u,d,h){super(e,n,i,r,s,o,c,u,d,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Su extends Li{constructor(e,n,i=us,r,s,o,c=mi,u=mi,d,h=Gs,p=1){if(h!==Gs&&h!==go)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const m={width:e,height:n,depth:p};super(m,r,s,o,c,u,h,i,d),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new s_(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class w6 extends Su{constructor(e,n=us,i=To,r,s,o=mi,c=mi,u,d=Gs){const h={width:e,height:e,depth:1},p=[h,h,h,h,h,h];super(e,e,n,i,r,s,o,c,u,d),this.image=p,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class EP extends Li{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class Bu extends gs{constructor(e=1,n=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const c=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const u=[],d=[],h=[],p=[];let m=0,v=0;_("z","y","x",-1,-1,i,n,e,o,s,0),_("z","y","x",1,-1,i,n,-e,o,s,1),_("x","z","y",1,1,e,i,n,r,o,2),_("x","z","y",1,-1,e,i,-n,r,o,3),_("x","y","z",1,-1,e,n,i,r,s,4),_("x","y","z",-1,-1,e,n,-i,r,s,5),this.setIndex(u),this.setAttribute("position",new zs(d,3)),this.setAttribute("normal",new zs(h,3)),this.setAttribute("uv",new zs(p,2));function _(w,y,b,T,A,M,I,k,U,S,P){const V=M/U,O=I/S,G=M/2,J=I/2,H=k/2,X=U+1,K=S+1;let Q=0,W=0;const q=new me;for(let Z=0;Z<K;Z++){const z=Z*O-J;for(let ie=0;ie<X;ie++){const Ee=ie*V-G;q[w]=Ee*T,q[y]=z*A,q[b]=H,d.push(q.x,q.y,q.z),q[w]=0,q[y]=0,q[b]=k>0?1:-1,h.push(q.x,q.y,q.z),p.push(ie/U),p.push(1-Z/S),Q+=1}}for(let Z=0;Z<S;Z++)for(let z=0;z<U;z++){const ie=m+z+X*Z,Ee=m+z+X*(Z+1),ze=m+(z+1)+X*(Z+1),Se=m+(z+1)+X*Z;u.push(ie,Ee,Se),u.push(Ee,ze,Se),W+=6}c.addGroup(v,W,P),v+=W,m+=Q}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Bu(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class jh extends gs{constructor(e=1,n=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:n,widthSegments:i,heightSegments:r};const s=e/2,o=n/2,c=Math.floor(i),u=Math.floor(r),d=c+1,h=u+1,p=e/c,m=n/u,v=[],_=[],w=[],y=[];for(let b=0;b<h;b++){const T=b*m-o;for(let A=0;A<d;A++){const M=A*p-s;_.push(M,-T,0),w.push(0,0,1),y.push(A/c),y.push(1-b/u)}}for(let b=0;b<u;b++)for(let T=0;T<c;T++){const A=T+d*b,M=T+d*(b+1),I=T+1+d*(b+1),k=T+1+d*b;v.push(A,M,k),v.push(M,I,k)}this.setIndex(v),this.setAttribute("position",new zs(_,3)),this.setAttribute("normal",new zs(w,3)),this.setAttribute("uv",new zs(y,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new jh(e.width,e.height,e.widthSegments,e.heightSegments)}}function Xl(t){const e={};for(const n in t){e[n]={};for(const i in t[n]){const r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(Gt("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][i]=null):e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}}return e}function Ci(t){const e={};for(let n=0;n<t.length;n++){const i=Xl(t[n]);for(const r in i)e[r]=i[r]}return e}function E6(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}function MP(t){const e=t.getRenderTarget();return e===null?t.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:fn.workingColorSpace}const M6={clone:Xl,merge:Ci};var T6=`void main() {
610
+ `),()=>{c.current?.removeAttribute("data-motion-pop-id"),I.contains(M)&&I.removeChild(M)}},[e]),F.jsx(x5,{isPresent:e,childRef:c,sizeRef:u,pop:s,children:s===!1?t:L.cloneElement(t,{ref:p})})}const S5=({children:t,initial:e,isPresent:n,onExitComplete:i,custom:r,presenceAffectsLayout:s,mode:o,anchorX:c,anchorY:u,root:d})=>{const h=yy(w5),p=L.useId();let m=!0,v=L.useMemo(()=>(m=!1,{id:p,initial:e,isPresent:n,custom:r,onExitComplete:_=>{h.set(_,!0);for(const w of h.values())if(!w)return;i&&i()},register:_=>(h.set(_,!1),()=>h.delete(_))}),[n,h,i]);return s&&m&&(v={...v}),L.useMemo(()=>{h.forEach((_,w)=>h.set(w,!1))},[n]),L.useEffect(()=>{!n&&!h.size&&i&&i()},[n]),t=F.jsx(b5,{pop:o==="popLayout",isPresent:n,anchorX:c,anchorY:u,root:d,children:t}),F.jsx(Fh.Provider,{value:v,children:t})};function w5(){return new Map}function pC(t=!0){const e=L.useContext(Fh);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=e,s=L.useId();L.useEffect(()=>{if(t)return r(s)},[t]);const o=L.useCallback(()=>t&&i&&i(s),[s,i,t]);return!n&&i?[!1,o]:[!0]}const Kd=t=>t.key||"";function Qw(t){const e=[];return L.Children.forEach(t,n=>{L.isValidElement(n)&&e.push(n)}),e}const E5=({children:t,custom:e,initial:n=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:s="sync",propagate:o=!1,anchorX:c="left",anchorY:u="top",root:d})=>{const[h,p]=pC(o),m=L.useMemo(()=>Qw(t),[t]),v=o&&!h?[]:m.map(Kd),_=L.useRef(!0),w=L.useRef(m),y=yy(()=>new Map),b=L.useRef(new Set),[T,A]=L.useState(m),[M,I]=L.useState(m);VT(()=>{_.current=!1,w.current=m;for(let S=0;S<M.length;S++){const P=Kd(M[S]);v.includes(P)?(y.delete(P),b.current.delete(P)):y.get(P)!==!0&&y.set(P,!1)}},[M,v.length,v.join("-")]);const k=[];if(m!==T){let S=[...m];for(let P=0;P<M.length;P++){const V=M[P],O=Kd(V);v.includes(O)||(S.splice(P,0,V),k.push(V))}return s==="wait"&&k.length&&(S=k),I(Qw(S)),A(m),null}const{forceRender:U}=L.useContext(vy);return F.jsx(F.Fragment,{children:M.map(S=>{const P=Kd(S),V=o&&!h?!1:m===M||v.includes(P),O=()=>{if(b.current.has(P))return;if(y.has(P))b.current.add(P),y.set(P,!0);else return;let G=!0;y.forEach(J=>{J||(G=!1)}),G&&(U?.(),I(w.current),o&&p?.(),i&&i())};return F.jsx(S5,{isPresent:V,initial:!_.current||n?void 0:!1,custom:e,presenceAffectsLayout:r,mode:s,root:d,onExitComplete:V?void 0:O,anchorX:c,anchorY:u,children:S},P)})})},mC=L.createContext({strict:!1}),e1={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let t1=!1;function M5(){if(t1)return;const t={};for(const e in e1)t[e]={isEnabled:n=>e1[e].some(i=>!!n[i])};jA(t),t1=!0}function gC(){return M5(),l4()}function T5(t){const e=gC();for(const n in t)e[n]={...e[n],...t[n]};jA(e)}const A5=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function xh(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||A5.has(t)}let vC=t=>!xh(t);function C5(t){typeof t=="function"&&(vC=e=>e.startsWith("on")?!xh(e):t(e))}try{C5(require("@emotion/is-prop-valid").default)}catch{}function P5(t,e,n){const i={};for(const r in t)r==="values"&&typeof t.values=="object"||pi(t[r])||(vC(r)||n===!0&&xh(r)||!e&&!xh(r)||t.draggable&&r.startsWith("onDrag"))&&(i[r]=t[r]);return i}const Vh=L.createContext({});function R5(t,e){if(zh(t)){const{initial:n,animate:i}=t;return{initial:n===!1||yu(n)?n:void 0,animate:yu(i)?i:void 0}}return t.inherit!==!1?e:{}}function k5(t){const{initial:e,animate:n}=R5(t,L.useContext(Vh));return L.useMemo(()=>({initial:e,animate:n}),[n1(e),n1(n)])}function n1(t){return Array.isArray(t)?t.join(" "):t}const Wy=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function yC(t,e,n){for(const i in e)!pi(e[i])&&!ZA(i,n)&&(t[i]=e[i])}function L5({transformTemplate:t},e){return L.useMemo(()=>{const n=Wy();return Hy(n,e,t),Object.assign({},n.vars,n.style)},[e])}function D5(t,e){const n=t.style||{},i={};return yC(i,n,t),Object.assign(i,L5(t,e)),i}function N5(t,e){const n={},i=D5(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const _C=()=>({...Wy(),attrs:{}});function I5(t,e,n,i){const r=L.useMemo(()=>{const s=_C();return JA(s,e,eC(i),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};yC(s,t.style,t),r.style={...s,...r.style}}return r}const U5=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function $y(t){return typeof t!="string"||t.includes("-")?!1:!!(U5.indexOf(t)>-1||/[A-Z]/u.test(t))}function F5(t,e,n,{latestValues:i},r,s=!1,o){const u=(o??$y(t)?I5:N5)(e,i,r,t),d=P5(e,typeof t=="string",s),h=t!==L.Fragment?{...d,...u,ref:n}:{},{children:p}=e,m=L.useMemo(()=>pi(p)?p.get():p,[p]);return L.createElement(t,{...h,children:m})}function O5({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,r){return{latestValues:B5(n,i,r,t),renderState:e()}}function B5(t,e,n,i){const r={},s=i(t,{});for(const m in s)r[m]=Hf(s[m]);let{initial:o,animate:c}=t;const u=zh(t),d=HA(t);e&&d&&!u&&t.inherit!==!1&&(o===void 0&&(o=e.initial),c===void 0&&(c=e.animate));let h=n?n.initial===!1:!1;h=h||o===!1;const p=h?c:o;if(p&&typeof p!="boolean"&&!Bh(p)){const m=Array.isArray(p)?p:[p];for(let v=0;v<m.length;v++){const _=Dy(t,m[v]);if(_){const{transitionEnd:w,transition:y,...b}=_;for(const T in b){let A=b[T];if(Array.isArray(A)){const M=h?A.length-1:0;A=A[M]}A!==null&&(r[T]=A)}for(const T in w)r[T]=w[T]}}}return r}const xC=t=>(e,n)=>{const i=L.useContext(Vh),r=L.useContext(Fh),s=()=>O5(t,e,i,r);return n?s():yy(s)},z5=xC({scrapeMotionValuesFromProps:Gy,createRenderState:Wy}),V5=xC({scrapeMotionValuesFromProps:tC,createRenderState:_C}),H5=Symbol.for("motionComponentSymbol");function G5(t,e,n){const i=L.useRef(n);L.useInsertionEffect(()=>{i.current=n});const r=L.useRef(null);return L.useCallback(s=>{s&&t.onMount?.(s);const o=i.current;if(typeof o=="function")if(s){const c=o(s);typeof c=="function"&&(r.current=c)}else r.current?(r.current(),r.current=null):o(s);else o&&(o.current=s);e&&(s?e.mount(s):e.unmount())},[e])}const bC=L.createContext({});function Tl(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function j5(t,e,n,i,r,s){const{visualElement:o}=L.useContext(Vh),c=L.useContext(mC),u=L.useContext(Fh),d=L.useContext(jy),h=d.reducedMotion,p=d.skipAnimations,m=L.useRef(null),v=L.useRef(!1);i=i||c.renderer,!m.current&&i&&(m.current=i(t,{visualState:e,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:h,skipAnimations:p,isSVG:s}),v.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const _=m.current,w=L.useContext(bC);_&&!_.projection&&r&&(_.type==="html"||_.type==="svg")&&W5(m.current,n,r,w);const y=L.useRef(!1);L.useInsertionEffect(()=>{_&&y.current&&_.update(n,u)});const b=n[PA],T=L.useRef(!!b&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(b)&&window.MotionHasOptimisedAnimation?.(b));return VT(()=>{v.current=!0,_&&(y.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),_.scheduleRenderMicrotask(),T.current&&_.animationState&&_.animationState.animateChanges())}),L.useEffect(()=>{_&&(!T.current&&_.animationState&&_.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(b)}),T.current=!1),_.enteringChildren=void 0)}),_}function W5(t,e,n,i){const{layoutId:r,layout:s,drag:o,dragConstraints:c,layoutScroll:u,layoutRoot:d,layoutAnchor:h,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:SC(t.parent)),t.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!o||c&&Tl(c),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,crossfade:p,layoutScroll:u,layoutRoot:d,layoutAnchor:h})}function SC(t){if(t)return t.options.allowProjection!==!1?t.projection:SC(t.parent)}function tg(t,{forwardMotionProps:e=!1,type:n}={},i,r){i&&T5(i);const s=n?n==="svg":$y(t),o=s?V5:z5;function c(d,h){let p;const m={...L.useContext(jy),...d,layoutId:$5(d)},{isStatic:v}=m,_=k5(d),w=o(d,v);if(!v&&typeof window<"u"){X5();const y=q5(m);p=y.MeasureLayout,_.visualElement=j5(t,w,m,r,y.ProjectionNode,s)}return F.jsxs(Vh.Provider,{value:_,children:[p&&_.visualElement?F.jsx(p,{visualElement:_.visualElement,...m}):null,F5(t,d,G5(w,_.visualElement,h),w,v,e,s)]})}c.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=L.forwardRef(c);return u[H5]=t,u}function $5({layoutId:t}){const e=L.useContext(vy).id;return e&&t!==void 0?e+"-"+t:t}function X5(t,e){L.useContext(mC).strict}function q5(t){const e=gC(),{drag:n,layout:i}=e;if(!n&&!i)return{};const r={...n,...i};return{MeasureLayout:n?.isEnabled(t)||i?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Y5(t,e){if(typeof Proxy>"u")return tg;const n=new Map,i=(s,o)=>tg(s,o,t,e),r=(s,o)=>i(s,o);return new Proxy(r,{get:(s,o)=>o==="create"?i:(n.has(o)||n.set(o,tg(o,void 0,t,e)),n.get(o))})}const K5=(t,e)=>e.isSVG??$y(t)?new M4(e):new _4(e,{allowProjection:t!==L.Fragment});class Z5 extends Fa{constructor(e){super(e),e.animationState||(e.animationState=R4(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Bh(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let J5=0;class Q5 extends Fa{constructor(){super(...arguments),this.id=J5++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;if(e&&i===!1){if(this.isExitComplete){const{initial:s,custom:o}=this.node.getProps();if(typeof s=="string"){const c=yo(this.node,s,o);if(c){const{transition:u,transitionEnd:d,...h}=c;for(const p in h)this.node.getValue(p)?.jump(h[p])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const r=this.node.animationState.setActive("exit",!e);n&&!e&&r.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const ez={animation:{Feature:Z5},exit:{Feature:Q5}};function Uu(t){return{point:{x:t.pageX,y:t.pageY}}}const tz=t=>e=>Fy(e)&&t(e,Uu(e));function cu(t,e,n,i){return _u(t,e,tz(n),i)}const wC=({current:t})=>t?t.ownerDocument.defaultView:null,i1=(t,e)=>Math.abs(t-e);function nz(t,e){const n=i1(t.x,e.x),i=i1(t.y,e.y);return Math.sqrt(n**2+i**2)}const r1=new Set(["auto","scroll"]);class EC{constructor(e,n,{transformPagePoint:i,contextWindow:r=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:c}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=v=>{this.handleScroll(v.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Zd(this.lastRawMoveEventInfo,this.transformPagePoint));const v=ng(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,w=nz(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!w)return;const{point:y}=v,{timestamp:b}=hi;this.history.push({...y,timestamp:b});const{onStart:T,onMove:A}=this.handlers;_||(T&&T(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),A&&A(this.lastMoveEvent,v)},this.handlePointerMove=(v,_)=>{this.lastMoveEvent=v,this.lastRawMoveEventInfo=_,this.lastMoveEventInfo=Zd(_,this.transformPagePoint),An.update(this.updatePoint,!0)},this.handlePointerUp=(v,_)=>{this.end();const{onEnd:w,onSessionEnd:y,resumeAnimation:b}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=ng(v.type==="pointercancel"?this.lastMoveEventInfo:Zd(_,this.transformPagePoint),this.history);this.startEvent&&w&&w(v,T),y&&y(v,T)},!Fy(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=o,this.contextWindow=r||window;const u=Uu(e),d=Zd(u,this.transformPagePoint),{point:h}=d,{timestamp:p}=hi;this.history=[{...h,timestamp:p}];const{onSessionStart:m}=n;m&&m(e,ng(d,this.history)),this.removeListeners=Du(cu(this.contextWindow,"pointermove",this.handlePointerMove),cu(this.contextWindow,"pointerup",this.handlePointerUp),cu(this.contextWindow,"pointercancel",this.handlePointerUp)),c&&this.startScrollTracking(c)}startScrollTracking(e){let n=e.parentElement;for(;n;){const i=getComputedStyle(n);(r1.has(i.overflowX)||r1.has(i.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const i=e===window,r=i?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},s={x:r.x-n.x,y:r.y-n.y};s.x===0&&s.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(e,r),An.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ia(this.updatePoint)}}function Zd(t,e){return e?{point:e(t.point)}:t}function s1(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ng({point:t},e){return{point:t,delta:s1(t,MC(e)),offset:s1(t,iz(e)),velocity:rz(e,.1)}}function iz(t){return t[0]}function MC(t){return t[t.length-1]}function rz(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const r=MC(t);for(;n>=0&&(i=t[n],!(r.timestamp-i.timestamp>Qi(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&r.timestamp-i.timestamp>Qi(e)*2&&(i=t[1]);const s=hr(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function sz(t,{min:e,max:n},i){return e!==void 0&&t<e?t=i?Ln(e,t,i.min):Math.max(t,e):n!==void 0&&t>n&&(t=i?Ln(n,t,i.max):Math.min(t,n)),t}function a1(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function az(t,{top:e,left:n,bottom:i,right:r}){return{x:a1(t.x,n,r),y:a1(t.y,e,i)}}function o1(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}function oz(t,e){return{x:o1(t.x,e.x),y:o1(t.y,e.y)}}function lz(t,e){let n=.5;const i=Ri(t),r=Ri(e);return r>i?n=gu(e.min,e.max-i,t.min):i>r&&(n=gu(t.min,t.max-r,e.min)),cs(0,1,n)}function cz(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const B0=.35;function uz(t=B0){return t===!1?t=0:t===!0&&(t=B0),{x:l1(t,"left","right"),y:l1(t,"top","bottom")}}function l1(t,e,n){return{min:c1(t,e),max:c1(t,n)}}function c1(t,e){return typeof t=="number"?t:t[e]||0}const dz=new WeakMap;class fz{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ti(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=p=>{n&&this.snapToCursor(Uu(p).point),this.stopAnimation()},o=(p,m)=>{const{drag:v,dragPropagation:_,onDragStart:w}=this.getProps();if(v&&!_&&(this.openDragLock&&this.openDragLock(),this.openDragLock=BB(v),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Yr(b=>{let T=this.getAxisMotionValue(b).get()||0;if(ns.test(T)){const{projection:A}=this.visualElement;if(A&&A.layout){const M=A.layout.layoutBox[b];M&&(T=Ri(M)*(parseFloat(T)/100))}}this.originPoint[b]=T}),w&&An.update(()=>w(p,m),!1,!0),k0(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},c=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m;const{dragPropagation:v,dragDirectionLock:_,onDirectionLock:w,onDrag:y}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:b}=m;if(_&&this.currentDirection===null){this.currentDirection=pz(b),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",m.point,b),this.updateAxis("y",m.point,b),this.visualElement.render(),y&&An.update(()=>y(p,m),!1,!0)},u=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m,this.stop(p,m),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new EC(e,{onSessionStart:s,onStart:o,onMove:c,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:i,contextWindow:wC(this.visualElement),element:this.visualElement.current})}stop(e,n){const i=e||this.latestPointerEvent,r=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!r||!i)return;const{velocity:o}=r;this.startAnimation(o);const{onDragEnd:c}=this.getProps();c&&An.postRender(()=>c(i,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,i){const{drag:r}=this.getProps();if(!i||!Jd(e,r,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(o=sz(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Tl(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=az(i.layoutBox,e):this.constraints=!1,this.elastic=uz(n),r!==this.constraints&&!Tl(e)&&i&&this.constraints&&!this.hasMutatedConstraints&&Yr(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=cz(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Tl(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=h4(i,r.root,this.visualElement.getTransformPagePoint());let o=oz(r.layout.layoutBox,s);if(n){const c=n(u4(o));this.hasMutatedConstraints=!!c,c&&(o=$A(c))}return o}startAnimation(e){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:c}=this.getProps(),u=this.constraints||{},d=Yr(h=>{if(!Jd(h,n,this.currentDirection))return;let p=u&&u[h]||{};(o===!0||o===h)&&(p={min:0,max:0});const m=r?200:1e6,v=r?40:1e7,_={type:"inertia",velocity:i?e[h]:0,bounceStiffness:m,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...s,...p};return this.startAxisValueAnimation(h,_)});return Promise.all(d).then(c)}startAxisValueAnimation(e,n){const i=this.getAxisMotionValue(e);return k0(this.visualElement,e),i.start(Ly(e,i,0,n,this.visualElement,!1))}stopAnimation(){Yr(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps(),r=i[n];return r||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){Yr(n=>{const{drag:i}=this.getProps();if(!Jd(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(n);if(r&&r.layout){const{min:o,max:c}=r.layout.layoutBox[n],u=s.get()||0;s.set(e[n]-Ln(o,c,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Tl(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Yr(o=>{const c=this.getAxisMotionValue(o);if(c&&this.constraints!==!1){const u=c.get();r[o]=lz({min:u,max:u},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),Yr(o=>{if(!Jd(o,e,null))return;const c=this.getAxisMotionValue(o),{min:u,max:d}=this.constraints[o];c.set(Ln(u,d,r[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;dz.set(this.visualElement,this);const e=this.visualElement.current,n=cu(e,"pointerdown",d=>{const{drag:h,dragListener:p=!0}=this.getProps(),m=d.target,v=m!==e&&WB(m);h&&p&&!v&&this.start(d)});let i;const r=()=>{const{dragConstraints:d}=this.getProps();Tl(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),i||(i=hz(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),An.read(r);const c=_u(window,"resize",()=>this.scalePositionWithinConstraints()),u=s.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:h})=>{this.isDragging&&h&&(Yr(p=>{const m=this.getAxisMotionValue(p);m&&(this.originPoint[p]+=d[p].translate,m.set(m.get()+d[p].translate))}),this.visualElement.render())}));return()=>{c(),n(),o(),u&&u(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=B0,dragMomentum:c=!0}=e;return{...e,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:c}}}function u1(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function hz(t,e,n){const i=vw(t,u1(n)),r=vw(e,u1(n));return()=>{i(),r()}}function Jd(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function pz(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class mz extends Fa{constructor(e){super(e),this.removeGroupControls=pr,this.removeListeners=pr,this.controls=new fz(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||pr}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const ig=t=>(e,n)=>{t&&An.update(()=>t(e,n),!1,!0)};class gz extends Fa{constructor(){super(...arguments),this.removePointerDownListener=pr}onPointerDown(e){this.session=new EC(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:wC(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:ig(e),onStart:ig(n),onMove:ig(i),onEnd:(s,o)=>{delete this.session,r&&An.postRender(()=>r(s,o))}}}mount(){this.removePointerDownListener=cu(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let rg=!1;class vz extends L.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=e;s&&(n.group&&n.group.add(s),i&&i.register&&r&&i.register(s),rg&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Gf.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:i,drag:r,isPresent:s}=this.props,{projection:o}=i;return o&&(o.isPresent=s,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),rg=!0,r||e.layoutDependency!==n||n===void 0||e.isPresent!==s?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||An.postRender(()=>{const c=o.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:i}=e;i&&(i.options.layoutAnchor=n,i.root.didUpdate(),Uy.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=e;rg=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function TC(t){const[e,n]=pC(),i=L.useContext(vy);return F.jsx(vz,{...t,layoutGroup:i,switchLayoutGroup:L.useContext(bC),isPresent:e,safeToRemove:n})}const yz={pan:{Feature:gz},drag:{Feature:mz,ProjectionNode:hC,MeasureLayout:TC}};function d1(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,s=i[r];s&&An.postRender(()=>s(e,Uu(e)))}class _z extends Fa{mount(){const{current:e}=this.node;e&&(this.unmount=VB(e,(n,i)=>(d1(this.node,i,"Start"),r=>d1(this.node,r,"End"))))}unmount(){}}class xz extends Fa{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Du(_u(this.node.current,"focus",()=>this.onFocus()),_u(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function f1(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),s=i[r];s&&An.postRender(()=>s(e,Uu(e)))}class bz extends Fa{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=XB(e,(r,s)=>(f1(this.node,s,"Start"),(o,{success:c})=>f1(this.node,o,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:i?.tap===!1})}unmount(){}}const z0=new WeakMap,sg=new WeakMap,Sz=t=>{const e=z0.get(t.target);e&&e(t)},wz=t=>{t.forEach(Sz)};function Ez({root:t,...e}){const n=t||document;sg.has(n)||sg.set(n,{});const i=sg.get(n),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(wz,{root:t,...e})),i[r]}function Mz(t,e,n){const i=Ez(e);return z0.set(t,n),i.observe(t),()=>{z0.delete(t),i.unobserve(t)}}const Tz={some:0,all:1};class Az extends Fa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:s}=e,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:Tz[r]},c=u=>{const{isIntersecting:d}=u;if(this.isInView===d||(this.isInView=d,s&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:h,onViewportLeave:p}=this.node.getProps(),m=d?h:p;m&&m(u)};this.stopObserver=Mz(this.node.current,o,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Cz(e,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function Cz({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Pz={inView:{Feature:Az},tap:{Feature:bz},focus:{Feature:xz},hover:{Feature:_z}},Rz={layout:{ProjectionNode:hC,MeasureLayout:TC}},kz={...ez,...Pz,...yz,...Rz},Il=Y5(kz,K5);function Lz(){!Vy.current&&GA();const[t]=L.useState(gh.current);return t}const AC=(...t)=>t.filter((e,n,i)=>!!e&&e.trim()!==""&&i.indexOf(e)===n).join(" ").trim();const Dz=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Nz=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,i)=>i?i.toUpperCase():n.toLowerCase());const h1=t=>{const e=Nz(t);return e.charAt(0).toUpperCase()+e.slice(1)};var ag={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 Iz=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},Uz=L.createContext({}),Fz=()=>L.useContext(Uz),Oz=L.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:i,className:r="",children:s,iconNode:o,...c},u)=>{const{size:d=24,strokeWidth:h=2,absoluteStrokeWidth:p=!1,color:m="currentColor",className:v=""}=Fz()??{},_=i??p?Number(n??h)*24/Number(e??d):n??h;return L.createElement("svg",{ref:u,...ag,width:e??d??ag.width,height:e??d??ag.height,stroke:t??m,strokeWidth:_,className:AC("lucide",v,r),...!s&&!Iz(c)&&{"aria-hidden":"true"},...c},[...o.map(([w,y])=>L.createElement(w,y)),...Array.isArray(s)?s:[s]])});const br=(t,e)=>{const n=L.forwardRef(({className:i,...r},s)=>L.createElement(Oz,{ref:s,iconNode:e,className:AC(`lucide-${Dz(h1(t))}`,`lucide-${t}`,i),...r}));return n.displayName=h1(t),n};const Bz=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],zz=br("chart-column",Bz);const Vz=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Hz=br("gauge",Vz);const Gz=[["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"}]],jz=br("globe",Gz);const Wz=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],$z=br("layout-grid",Wz);const Xz=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],qz=br("mail",Xz);const Yz=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Kz=br("menu",Yz);const Zz=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Jz=br("monitor",Zz);const Qz=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],CC=br("moon",Qz);const eV=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],tV=br("settings",eV);const nV=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],PC=br("sun",nV);const iV=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],rV=br("trophy",iV);const sV=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],RC=br("x",sV);function kC(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(n=kC(t[e]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}function aV(){for(var t,e,n=0,i="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=kC(t))&&(i&&(i+=" "),i+=e);return i}const oV=(t,e)=>{const n=new Array(t.length+e.length);for(let i=0;i<t.length;i++)n[i]=t[i];for(let i=0;i<e.length;i++)n[t.length+i]=e[i];return n},lV=(t,e)=>({classGroupId:t,validator:e}),LC=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),bh="-",p1=[],cV="arbitrary..",uV=t=>{const e=fV(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return dV(o);const c=o.split(bh),u=c[0]===""&&c.length>1?1:0;return DC(c,u,e)},getConflictingClassGroupIds:(o,c)=>{if(c){const u=i[o],d=n[o];return u?d?oV(d,u):u:d||p1}return n[o]||p1}}},DC=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const r=t[e],s=n.nextPart.get(r);if(s){const d=DC(t,e+1,s);if(d)return d}const o=n.validators;if(o===null)return;const c=e===0?t.join(bh):t.slice(e).join(bh),u=o.length;for(let d=0;d<u;d++){const h=o[d];if(h.validator(c))return h.classGroupId}},dV=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),i=e.slice(0,n);return i?cV+i:void 0})(),fV=t=>{const{theme:e,classGroups:n}=t;return hV(n,e)},hV=(t,e)=>{const n=LC();for(const i in t){const r=t[i];Xy(r,n,i,e)}return n},Xy=(t,e,n,i)=>{const r=t.length;for(let s=0;s<r;s++){const o=t[s];pV(o,e,n,i)}},pV=(t,e,n,i)=>{if(typeof t=="string"){mV(t,e,n);return}if(typeof t=="function"){gV(t,e,n,i);return}vV(t,e,n,i)},mV=(t,e,n)=>{const i=t===""?e:NC(e,t);i.classGroupId=n},gV=(t,e,n,i)=>{if(yV(t)){Xy(t(i),e,n,i);return}e.validators===null&&(e.validators=[]),e.validators.push(lV(n,t))},vV=(t,e,n,i)=>{const r=Object.entries(t),s=r.length;for(let o=0;o<s;o++){const[c,u]=r[o];Xy(u,NC(e,c),n,i)}},NC=(t,e)=>{let n=t;const i=e.split(bh),r=i.length;for(let s=0;s<r;s++){const o=i[s];let c=n.nextPart.get(o);c||(c=LC(),n.nextPart.set(o,c)),n=c}return n},yV=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,_V=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),i=Object.create(null);const r=(s,o)=>{n[s]=o,e++,e>t&&(e=0,i=n,n=Object.create(null))};return{get(s){let o=n[s];if(o!==void 0)return o;if((o=i[s])!==void 0)return r(s,o),o},set(s,o){s in n?n[s]=o:r(s,o)}}},V0="!",m1=":",xV=[],g1=(t,e,n,i,r)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:i,isExternal:r}),bV=t=>{const{prefix:e,experimentalParseClassName:n}=t;let i=r=>{const s=[];let o=0,c=0,u=0,d;const h=r.length;for(let w=0;w<h;w++){const y=r[w];if(o===0&&c===0){if(y===m1){s.push(r.slice(u,w)),u=w+1;continue}if(y==="/"){d=w;continue}}y==="["?o++:y==="]"?o--:y==="("?c++:y===")"&&c--}const p=s.length===0?r:r.slice(u);let m=p,v=!1;p.endsWith(V0)?(m=p.slice(0,-1),v=!0):p.startsWith(V0)&&(m=p.slice(1),v=!0);const _=d&&d>u?d-u:void 0;return g1(s,v,m,_)};if(e){const r=e+m1,s=i;i=o=>o.startsWith(r)?s(o.slice(r.length)):g1(xV,!1,o,void 0,!0)}if(n){const r=i;i=s=>n({className:s,parseClassName:r})}return i},SV=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,i)=>{e.set(n,1e6+i)}),n=>{const i=[];let r=[];for(let s=0;s<n.length;s++){const o=n[s],c=o[0]==="[",u=e.has(o);c||u?(r.length>0&&(r.sort(),i.push(...r),r=[]),i.push(o)):r.push(o)}return r.length>0&&(r.sort(),i.push(...r)),i}},wV=t=>({cache:_V(t.cacheSize),parseClassName:bV(t),sortModifiers:SV(t),...uV(t)}),EV=/\s+/,MV=(t,e)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:r,sortModifiers:s}=e,o=[],c=t.trim().split(EV);let u="";for(let d=c.length-1;d>=0;d-=1){const h=c[d],{isExternal:p,modifiers:m,hasImportantModifier:v,baseClassName:_,maybePostfixModifierPosition:w}=n(h);if(p){u=h+(u.length>0?" "+u:u);continue}let y=!!w,b=i(y?_.substring(0,w):_);if(!b){if(!y){u=h+(u.length>0?" "+u:u);continue}if(b=i(_),!b){u=h+(u.length>0?" "+u:u);continue}y=!1}const T=m.length===0?"":m.length===1?m[0]:s(m).join(":"),A=v?T+V0:T,M=A+b;if(o.indexOf(M)>-1)continue;o.push(M);const I=r(b,y);for(let k=0;k<I.length;++k){const U=I[k];o.push(A+U)}u=h+(u.length>0?" "+u:u)}return u},TV=(...t)=>{let e=0,n,i,r="";for(;e<t.length;)(n=t[e++])&&(i=IC(n))&&(r&&(r+=" "),r+=i);return r},IC=t=>{if(typeof t=="string")return t;let e,n="";for(let i=0;i<t.length;i++)t[i]&&(e=IC(t[i]))&&(n&&(n+=" "),n+=e);return n},AV=(t,...e)=>{let n,i,r,s;const o=u=>{const d=e.reduce((h,p)=>p(h),t());return n=wV(d),i=n.cache.get,r=n.cache.set,s=c,c(u)},c=u=>{const d=i(u);if(d)return d;const h=MV(u,n);return r(u,h),h};return s=o,(...u)=>s(TV(...u))},CV=[],ei=t=>{const e=n=>n[t]||CV;return e.isThemeGetter=!0,e},UC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,FC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,PV=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,RV=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,kV=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,LV=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,DV=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,NV=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pa=t=>PV.test(t),qt=t=>!!t&&!Number.isNaN(Number(t)),ma=t=>!!t&&Number.isInteger(Number(t)),og=t=>t.endsWith("%")&&qt(t.slice(0,-1)),Ts=t=>RV.test(t),OC=()=>!0,IV=t=>kV.test(t)&&!LV.test(t),qy=()=>!1,UV=t=>DV.test(t),FV=t=>NV.test(t),OV=t=>!dt(t)&&!mt(t),BV=t=>Oa(t,VC,qy),dt=t=>UC.test(t),Qa=t=>Oa(t,HC,IV),v1=t=>Oa(t,XV,qt),zV=t=>Oa(t,jC,OC),VV=t=>Oa(t,GC,qy),y1=t=>Oa(t,BC,qy),HV=t=>Oa(t,zC,FV),Qd=t=>Oa(t,WC,UV),mt=t=>FC.test(t),Vc=t=>Io(t,HC),GV=t=>Io(t,GC),_1=t=>Io(t,BC),jV=t=>Io(t,VC),WV=t=>Io(t,zC),ef=t=>Io(t,WC,!0),$V=t=>Io(t,jC,!0),Oa=(t,e,n)=>{const i=UC.exec(t);return i?i[1]?e(i[1]):n(i[2]):!1},Io=(t,e,n=!1)=>{const i=FC.exec(t);return i?i[1]?e(i[1]):n:!1},BC=t=>t==="position"||t==="percentage",zC=t=>t==="image"||t==="url",VC=t=>t==="length"||t==="size"||t==="bg-size",HC=t=>t==="length",XV=t=>t==="number",GC=t=>t==="family-name",jC=t=>t==="number"||t==="weight",WC=t=>t==="shadow",qV=()=>{const t=ei("color"),e=ei("font"),n=ei("text"),i=ei("font-weight"),r=ei("tracking"),s=ei("leading"),o=ei("breakpoint"),c=ei("container"),u=ei("spacing"),d=ei("radius"),h=ei("shadow"),p=ei("inset-shadow"),m=ei("text-shadow"),v=ei("drop-shadow"),_=ei("blur"),w=ei("perspective"),y=ei("aspect"),b=ei("ease"),T=ei("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...M(),mt,dt],k=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto","contain","none"],S=()=>[mt,dt,u],P=()=>[pa,"full","auto",...S()],V=()=>[ma,"none","subgrid",mt,dt],O=()=>["auto",{span:["full",ma,mt,dt]},ma,mt,dt],G=()=>[ma,"auto",mt,dt],J=()=>["auto","min","max","fr",mt,dt],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],K=()=>["auto",...S()],Q=()=>[pa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],W=()=>[pa,"screen","full","dvw","lvw","svw","min","max","fit",...S()],q=()=>[pa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...S()],Z=()=>[t,mt,dt],z=()=>[...M(),_1,y1,{position:[mt,dt]}],ie=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Ee=()=>["auto","cover","contain",jV,BV,{size:[mt,dt]}],ze=()=>[og,Vc,Qa],Se=()=>["","none","full",d,mt,dt],ne=()=>["",qt,Vc,Qa],ye=()=>["solid","dashed","dotted","double"],be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ne=()=>[qt,og,_1,y1],et=()=>["","none",_,mt,dt],xt=()=>["none",qt,mt,dt],pn=()=>["none",qt,mt,dt],ht=()=>[qt,mt,dt],Ft=()=>[pa,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ts],breakpoint:[Ts],color:[OC],container:[Ts],"drop-shadow":[Ts],ease:["in","out","in-out"],font:[OV],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ts],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ts],shadow:[Ts],spacing:["px",qt],text:[Ts],"text-shadow":[Ts],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",pa,dt,mt,y]}],container:["container"],columns:[{columns:[qt,dt,mt,c]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:I()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{"inset-s":P(),start:P()}],end:[{"inset-e":P(),end:P()}],"inset-bs":[{"inset-bs":P()}],"inset-be":[{"inset-be":P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[ma,"auto",mt,dt]}],basis:[{basis:[pa,"full","auto",c,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qt,pa,"auto","initial","none",dt]}],grow:[{grow:["",qt,mt,dt]}],shrink:[{shrink:["",qt,mt,dt]}],order:[{order:[ma,"first","last","none",mt,dt]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:O()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:O()}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:K()}],mx:[{mx:K()}],my:[{my:K()}],ms:[{ms:K()}],me:[{me:K()}],mbs:[{mbs:K()}],mbe:[{mbe:K()}],mt:[{mt:K()}],mr:[{mr:K()}],mb:[{mb:K()}],ml:[{ml:K()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],"inline-size":[{inline:["auto",...W()]}],"min-inline-size":[{"min-inline":["auto",...W()]}],"max-inline-size":[{"max-inline":["none",...W()]}],"block-size":[{block:["auto",...q()]}],"min-block-size":[{"min-block":["auto",...q()]}],"max-block-size":[{"max-block":["none",...q()]}],w:[{w:[c,"screen",...Q()]}],"min-w":[{"min-w":[c,"screen","none",...Q()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh",...Q()]}],"font-size":[{text:["base",n,Vc,Qa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,$V,zV]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",og,dt]}],"font-family":[{font:[GV,VV,e]}],"font-features":[{"font-features":[dt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,mt,dt]}],"line-clamp":[{"line-clamp":[qt,"none",mt,v1]}],leading:[{leading:[s,...S()]}],"list-image":[{"list-image":["none",mt,dt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",mt,dt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Z()}],"text-color":[{text:Z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ye(),"wavy"]}],"text-decoration-thickness":[{decoration:[qt,"from-font","auto",mt,Qa]}],"text-decoration-color":[{decoration:Z()}],"underline-offset":[{"underline-offset":[qt,"auto",mt,dt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",mt,dt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",mt,dt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:Ee()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ma,mt,dt],radial:["",mt,dt],conic:[ma,mt,dt]},WV,HV]}],"bg-color":[{bg:Z()}],"gradient-from-pos":[{from:ze()}],"gradient-via-pos":[{via:ze()}],"gradient-to-pos":[{to:ze()}],"gradient-from":[{from:Z()}],"gradient-via":[{via:Z()}],"gradient-to":[{to:Z()}],rounded:[{rounded:Se()}],"rounded-s":[{"rounded-s":Se()}],"rounded-e":[{"rounded-e":Se()}],"rounded-t":[{"rounded-t":Se()}],"rounded-r":[{"rounded-r":Se()}],"rounded-b":[{"rounded-b":Se()}],"rounded-l":[{"rounded-l":Se()}],"rounded-ss":[{"rounded-ss":Se()}],"rounded-se":[{"rounded-se":Se()}],"rounded-ee":[{"rounded-ee":Se()}],"rounded-es":[{"rounded-es":Se()}],"rounded-tl":[{"rounded-tl":Se()}],"rounded-tr":[{"rounded-tr":Se()}],"rounded-br":[{"rounded-br":Se()}],"rounded-bl":[{"rounded-bl":Se()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ye(),"hidden","none"]}],"divide-style":[{divide:[...ye(),"hidden","none"]}],"border-color":[{border:Z()}],"border-color-x":[{"border-x":Z()}],"border-color-y":[{"border-y":Z()}],"border-color-s":[{"border-s":Z()}],"border-color-e":[{"border-e":Z()}],"border-color-bs":[{"border-bs":Z()}],"border-color-be":[{"border-be":Z()}],"border-color-t":[{"border-t":Z()}],"border-color-r":[{"border-r":Z()}],"border-color-b":[{"border-b":Z()}],"border-color-l":[{"border-l":Z()}],"divide-color":[{divide:Z()}],"outline-style":[{outline:[...ye(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qt,mt,dt]}],"outline-w":[{outline:["",qt,Vc,Qa]}],"outline-color":[{outline:Z()}],shadow:[{shadow:["","none",h,ef,Qd]}],"shadow-color":[{shadow:Z()}],"inset-shadow":[{"inset-shadow":["none",p,ef,Qd]}],"inset-shadow-color":[{"inset-shadow":Z()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Z()}],"ring-offset-w":[{"ring-offset":[qt,Qa]}],"ring-offset-color":[{"ring-offset":Z()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":Z()}],"text-shadow":[{"text-shadow":["none",m,ef,Qd]}],"text-shadow-color":[{"text-shadow":Z()}],opacity:[{opacity:[qt,mt,dt]}],"mix-blend":[{"mix-blend":[...be(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":be()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[qt]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ne()}],"mask-image-linear-from-color":[{"mask-linear-from":Z()}],"mask-image-linear-to-color":[{"mask-linear-to":Z()}],"mask-image-t-from-pos":[{"mask-t-from":Ne()}],"mask-image-t-to-pos":[{"mask-t-to":Ne()}],"mask-image-t-from-color":[{"mask-t-from":Z()}],"mask-image-t-to-color":[{"mask-t-to":Z()}],"mask-image-r-from-pos":[{"mask-r-from":Ne()}],"mask-image-r-to-pos":[{"mask-r-to":Ne()}],"mask-image-r-from-color":[{"mask-r-from":Z()}],"mask-image-r-to-color":[{"mask-r-to":Z()}],"mask-image-b-from-pos":[{"mask-b-from":Ne()}],"mask-image-b-to-pos":[{"mask-b-to":Ne()}],"mask-image-b-from-color":[{"mask-b-from":Z()}],"mask-image-b-to-color":[{"mask-b-to":Z()}],"mask-image-l-from-pos":[{"mask-l-from":Ne()}],"mask-image-l-to-pos":[{"mask-l-to":Ne()}],"mask-image-l-from-color":[{"mask-l-from":Z()}],"mask-image-l-to-color":[{"mask-l-to":Z()}],"mask-image-x-from-pos":[{"mask-x-from":Ne()}],"mask-image-x-to-pos":[{"mask-x-to":Ne()}],"mask-image-x-from-color":[{"mask-x-from":Z()}],"mask-image-x-to-color":[{"mask-x-to":Z()}],"mask-image-y-from-pos":[{"mask-y-from":Ne()}],"mask-image-y-to-pos":[{"mask-y-to":Ne()}],"mask-image-y-from-color":[{"mask-y-from":Z()}],"mask-image-y-to-color":[{"mask-y-to":Z()}],"mask-image-radial":[{"mask-radial":[mt,dt]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ne()}],"mask-image-radial-from-color":[{"mask-radial-from":Z()}],"mask-image-radial-to-color":[{"mask-radial-to":Z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[qt]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ne()}],"mask-image-conic-from-color":[{"mask-conic-from":Z()}],"mask-image-conic-to-color":[{"mask-conic-to":Z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:Ee()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",mt,dt]}],filter:[{filter:["","none",mt,dt]}],blur:[{blur:et()}],brightness:[{brightness:[qt,mt,dt]}],contrast:[{contrast:[qt,mt,dt]}],"drop-shadow":[{"drop-shadow":["","none",v,ef,Qd]}],"drop-shadow-color":[{"drop-shadow":Z()}],grayscale:[{grayscale:["",qt,mt,dt]}],"hue-rotate":[{"hue-rotate":[qt,mt,dt]}],invert:[{invert:["",qt,mt,dt]}],saturate:[{saturate:[qt,mt,dt]}],sepia:[{sepia:["",qt,mt,dt]}],"backdrop-filter":[{"backdrop-filter":["","none",mt,dt]}],"backdrop-blur":[{"backdrop-blur":et()}],"backdrop-brightness":[{"backdrop-brightness":[qt,mt,dt]}],"backdrop-contrast":[{"backdrop-contrast":[qt,mt,dt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qt,mt,dt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qt,mt,dt]}],"backdrop-invert":[{"backdrop-invert":["",qt,mt,dt]}],"backdrop-opacity":[{"backdrop-opacity":[qt,mt,dt]}],"backdrop-saturate":[{"backdrop-saturate":[qt,mt,dt]}],"backdrop-sepia":[{"backdrop-sepia":["",qt,mt,dt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",mt,dt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qt,"initial",mt,dt]}],ease:[{ease:["linear","initial",b,mt,dt]}],delay:[{delay:[qt,mt,dt]}],animate:[{animate:["none",T,mt,dt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,mt,dt]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:xt()}],"rotate-x":[{"rotate-x":xt()}],"rotate-y":[{"rotate-y":xt()}],"rotate-z":[{"rotate-z":xt()}],scale:[{scale:pn()}],"scale-x":[{"scale-x":pn()}],"scale-y":[{"scale-y":pn()}],"scale-z":[{"scale-z":pn()}],"scale-3d":["scale-3d"],skew:[{skew:ht()}],"skew-x":[{"skew-x":ht()}],"skew-y":[{"skew-y":ht()}],transform:[{transform:[mt,dt,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ft()}],"translate-x":[{"translate-x":Ft()}],"translate-y":[{"translate-y":Ft()}],"translate-z":[{"translate-z":Ft()}],"translate-none":["translate-none"],accent:[{accent:Z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",mt,dt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",mt,dt]}],fill:[{fill:["none",...Z()]}],"stroke-w":[{stroke:[qt,Vc,Qa,v1]}],stroke:[{stroke:["none",...Z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},YV=AV(qV);function Mn(...t){return YV(aV(t))}const KV=F.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[F.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1Z",fill:"#4285F4"}),F.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23Z",fill:"#34A853"}),F.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18A10.96 10.96 0 0 0 1 12c0 1.77.42 3.44 1.18 4.93l3.66-2.84Z",fill:"#FBBC05"}),F.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53Z",fill:"#EA4335"})]}),ZV=F.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:F.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12Z"})}),JV={google:KV,github:ZV},QV={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",apple:"Apple"};function eH(t){return QV[t]||String(t||"").replace(/-/g," ")}function tH(){const{isOpen:t,closeLoginModal:e}=zT(),{enabled:n,signedIn:i,refreshUser:r,signInWithPassword:s,signUp:o,signInWithOAuth:c,getPublicAuthConfig:u}=Do(),[d,h]=L.useState("signin"),[p,m]=L.useState(""),[v,_]=L.useState(""),[w,y]=L.useState(""),[b,T]=L.useState(!1),[A,M]=L.useState(null),[I,k]=L.useState(null),[U,S]=L.useState(!1),[P,V]=L.useState(!0),[O,G]=L.useState([]),[J,H]=L.useState(8);L.useEffect(()=>{t&&(M(null),k(null),h("signin"),m(""),_(""),y(""),S(!1))},[t]),L.useEffect(()=>{if(!t||!n){V(!1);return}let W=!0;return(async()=>{const{data:q,error:Z}=await u();if(W){if(Z||!q)G(["google","github"]);else{const z=Array.isArray(q.oAuthProviders)?q.oAuthProviders:[],ie=Array.isArray(q.customOAuthProviders)?q.customOAuthProviders:[];G([...z,...ie]),typeof q.passwordMinLength=="number"&&q.passwordMinLength>0&&H(q.passwordMinLength)}V(!1)}})(),()=>{W=!1}},[t,n,u]),L.useEffect(()=>{t&&i&&e()},[t,i,e]);const X=L.useMemo(()=>typeof window>"u"?"":!!window.webkit?.messageHandlers?.nativeOAuth?`${window.location.origin}/auth/callback`:`${window.location.origin}/`,[]),K=L.useCallback(async W=>{M(null),T(!0);try{const{error:q}=await c(W,X);q&&M(q.message||String(q))}finally{T(!1)}},[c,X]),Q=L.useCallback(async W=>{W.preventDefault(),M(null),T(!0);try{if(d==="signup"){const{data:Z,error:z}=await o({email:p.trim(),password:v,name:w.trim()||void 0});if(z){M(z.message||String(z));return}if(Z?.requireEmailVerification){k("Check your email for a verification link."),h("signin");return}await r();return}const{error:q}=await s({email:p.trim(),password:v});if(q){M(q.message||String(q));return}await r()}finally{T(!1)}},[d,p,v,w,o,s,r]);return L.useEffect(()=>{if(!t)return;const W=q=>{q.key==="Escape"&&e()};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[t,e]),n?F.jsx(E5,{children:t&&F.jsxs(Il.div,{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[F.jsx(Il.div,{className:"absolute inset-0 bg-black/40 dark:bg-black/60 ",onClick:e,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),F.jsxs(Il.div,{className:"relative w-full max-w-[420px] rounded-2xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 p-6 shadow-2xl",initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.2},onClick:W=>W.stopPropagation(),children:[F.jsx("button",{type:"button",onClick:e,className:"absolute right-4 top-4 text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:F.jsx(RC,{className:"h-5 w-5"})}),F.jsxs("div",{className:"text-center mb-6",children:[F.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[F.jsx("img",{src:"/app-icon.png",alt:"",width:28,height:28,className:"rounded-md"}),F.jsx("span",{className:"text-lg font-semibold text-oai-black dark:text-white",children:"Token Tracker"})]}),F.jsx("p",{className:"text-sm text-oai-gray-500",children:"Sign in to join the leaderboard"})]}),I&&F.jsx("div",{className:"mb-4 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900/50 px-3 py-2 text-xs text-oai-gray-700 dark:text-oai-gray-300",children:I}),A&&F.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",role:"alert",children:A}),F.jsx("div",{className:"space-y-2.5 mb-5",children:P?F.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900 animate-pulse"}):O.map(W=>F.jsxs("button",{type:"button",disabled:b,onClick:()=>K(W),className:Mn("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors disabled:opacity-50","flex items-center justify-center gap-2.5"),children:[JV[W]||null,"Continue with ",eH(W)]},W))}),U?F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:"relative mb-5",children:[F.jsx("div",{className:"absolute inset-0 flex items-center",children:F.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),F.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:F.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:"email"})})]}),F.jsxs("div",{className:"flex rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 p-0.5 bg-oai-gray-50 dark:bg-oai-gray-900/50 mb-4",children:[F.jsx("button",{type:"button",className:Mn("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",d==="signin"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{h("signin"),M(null)},children:"Sign In"}),F.jsx("button",{type:"button",className:Mn("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",d==="signup"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{h("signup"),M(null)},children:"Sign Up"})]}),F.jsxs("form",{onSubmit:Q,className:"space-y-3",children:[d==="signup"&&F.jsxs("div",{children:[F.jsx("label",{htmlFor:"modal-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:"Name"}),F.jsx("input",{id:"modal-name",type:"text",autoComplete:"name",value:w,onChange:W=>y(W.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:"Optional"})]}),F.jsxs("div",{children:[F.jsx("label",{htmlFor:"modal-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:"Email"}),F.jsx("input",{id:"modal-email",type:"email",autoComplete:"email",required:!0,value:p,onChange:W=>m(W.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),F.jsxs("div",{children:[F.jsx("label",{htmlFor:"modal-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:"Password"}),F.jsx("input",{id:"modal-password",type:"password",autoComplete:d==="signup"?"new-password":"current-password",required:!0,minLength:d==="signup"?J:void 0,value:v,onChange:W=>_(W.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),d==="signup"&&F.jsxs("p",{className:"mt-1 text-xs text-oai-gray-400 dark:text-oai-gray-600",children:["At least ",J," characters"]})]}),F.jsx("button",{type:"submit",disabled:b,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:d==="signup"?"Create Account":"Sign In"})]})]}):F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:"relative mb-5",children:[F.jsx("div",{className:"absolute inset-0 flex items-center",children:F.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),F.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:F.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:"or"})})]}),F.jsxs("button",{type:"button",onClick:()=>S(!0),className:Mn("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors","flex items-center justify-center gap-2.5"),children:[F.jsx(qz,{className:"h-[18px] w-[18px] text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:1.75}),"Continue with Email"]})]})]})]})}):null}const nH={VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"};function iH(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return"";const e=typeof import.meta<"u"?nH:void 0;return(e?.VITE_TOKENTRACKER_BACKEND_BASE_URL||e?.VITE_INSFORGE_BASE_URL||"").trim()}function kX(){return Ro()}function $C(t=""){if(typeof t!="string"||t.length===0)return!1;const e=new URLSearchParams(t),n=String(e.get("screenshot")||"").toLowerCase();return n==="1"||n==="true"}const rH=300*1e3;function Yy(t){return typeof t=="string"&&/^https?:\/\//i.test(t.trim())}async function XC(t){const e=Ro();if(!Yy(e)||!t)return;const n=e.replace(/\/$/,""),i=Nh(),r={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${t}`};i&&(r.apikey=i);try{await fetch(`${n}/functions/tokentracker-leaderboard-refresh`,{method:"POST",headers:r,body:JSON.stringify({period:"week"})})}catch{}}async function qC(t){const e=Ro();if(!Yy(e)||!t)return null;const n=e.replace(/\/$/,""),i=Nh(),r={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${t}`};i&&(r.apikey=i);const s=typeof navigator<"u"&&typeof navigator.platform=="string"?navigator.platform:"web",o=await fetch(`${n}/functions/tokentracker-device-token-issue`,{method:"POST",headers:r,body:JSON.stringify({device_name:"Token Tracker (dashboard)",platform:s})});if(!o.ok)return null;const c=await o.json().catch(()=>null),u=typeof c?.token=="string"?c.token:null,d=typeof c?.device_id=="string"?c.device_id:null;return!u||!d?null:{token:u,deviceId:d,issuedAt:typeof c?.created_at=="string"?c.created_at:new Date().toISOString()}}async function YC(t){const{deviceToken:e,insforgeBaseUrl:n}=t,i={deviceToken:e},r=n||Ro();Yy(r)&&(i.insforgeBaseUrl=r.trim());const s=await fetch("/functions/tokentracker-local-sync",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(i)}),o=await s.json().catch(()=>({}));if(!s.ok){const c=typeof o.error=="string"?o.error:`HTTP ${s.status}`;throw new Error(c)}return o}async function sH(t){const e=LI();if(Date.now()-e<rH)return;const n=await t();if(!n)return;let i=uT();if(!i){const r=await qC(n);if(!r)return;dT(r),i=r}await YC({deviceToken:i.token,insforgeBaseUrl:Ro()}),fT(Date.now()),await XC(n)}async function LX(t){const e=await t();if(!e)return;let n=uT();if(!n){const i=await qC(e);if(!i)return;dT(i),n=i}await YC({deviceToken:n.token,insforgeBaseUrl:Ro()}),fT(Date.now()),await XC(e)}function aH(t){const e=t.replace(/\/+$/,"")||"/";return e==="/share"||e==="/share.html"||e.startsWith("/share/")}function oH(t){const e=t.replace(/\/+$/,"")||"/";return e==="/login"||e==="/landing"||aH(e)?!1:e==="/"||e==="/dashboard"||e.startsWith("/leaderboard")}function lH(){const t=vr(),e=Do(),n=L.useRef(!1);L.useEffect(()=>{if(!PI()||!oH(t.pathname||"/")||!e.enabled||!e.signedIn||e.loading||!RI())return;let i=!1;const r=window.setTimeout(()=>{(async()=>{if(!(i||n.current)){n.current=!0;try{await sH(()=>e.getAccessToken())}catch(s){console.warn("[tokentracker] cloud usage sync:",s)}finally{n.current=!1}}})()},2500);return()=>{i=!0,window.clearTimeout(r)}},[t.pathname,e.enabled,e.signedIn,e.loading,e.getAccessToken])}function KC(){return typeof navigator>"u"?null:navigator.clipboard||null}function cH(){return typeof window>"u"?null:window.ClipboardItem||null}async function uH(t,{clipboard:e}={}){const n=e??KC();if(!n||typeof n.writeText!="function")return!1;try{return await n.writeText(t),!0}catch{return!1}}async function DX(t,{clipboard:e}={}){const n=e??KC(),i=cH();if(!t||!n||typeof n.write!="function"||!i)return!1;try{const r=t.type||"image/png",s=t.type&&t.type!==r?t.slice(0,t.size,r):t.type?t:t.slice(0,t.size,r),o=new i({[r]:s});return await n.write([o]),!0}catch{return!1}}function dH(){if(typeof window>"u")return!1;const t=window.location.hostname;return t==="localhost"||t==="127.0.0.1"||t==="::1"}function fH(){return dH()?"/":"/dashboard"}function ZC({prefersReducedMotion:t,screenshotCapture:e}){return!(e||t)}function hH({repo:t="mm7894215/TokenTracker"}){const[e,n]=L.useState(null);return L.useEffect(()=>{if(typeof window>"u")return;const i=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,r=typeof document<"u"&&(document.documentElement?.classList.contains("screenshot-capture")||document.body?.classList.contains("screenshot-capture"));ZC({prefersReducedMotion:i,screenshotCapture:r})&&fetch(`https://api.github.com/repos/${t}`).then(s=>s.json()).then(s=>{s&&typeof s.stargazers_count=="number"&&n(s.stargazers_count)}).catch(()=>{})},[t]),F.jsxs("a",{href:`https://github.com/${t}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-2 px-3 py-1.5 rounded-md border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-800 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-700 transition-colors no-underline",children:[F.jsx("svg",{height:"16",viewBox:"0 0 16 16",width:"16",className:"shrink-0 fill-oai-gray-700 dark:fill-oai-gray-300",children:F.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),F.jsx("span",{className:"text-xs font-medium text-oai-gray-700 dark:text-oai-gray-300 whitespace-nowrap",children:"Star"}),e!==null&&F.jsx("span",{className:"text-xs font-semibold text-oai-gray-900 dark:text-oai-white tabular-nums whitespace-nowrap",children:e})]})}function pH(t){if(!t||typeof t!="object")return null;const e=t.user_metadata&&typeof t.user_metadata=="object"?t.user_metadata:{},n=t.profile&&typeof t.profile=="object"?t.profile:{},i=e.avatar_url||e.picture||n.avatar_url||t.avatar_url;return typeof i=="string"&&i.trim()?i.trim():null}function x1(t){const e=String(t||"").trim();if(!e)return"?";const n=e.split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():e.slice(0,2).toUpperCase()}function H0({className:t,variant:e="header",collapsed:n=!1,onAfterAction:i}){const r=e==="sidebar",{enabled:s,loading:o,signedIn:c,user:u,displayName:d}=Do(),{openLoginModal:h}=zT(),p=Au(),m=L.useMemo(()=>pH(u),[u]);if(!s)return null;if(o)return F.jsx("div",{className:Mn("h-9 w-9 shrink-0 rounded-full bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse",t),"aria-hidden":!0});if(!c)return r?F.jsxs("button",{type:"button",onClick:()=>{h(),i?.()},className:Mn("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] font-medium text-oai-gray-700 dark:text-oai-gray-300 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 min-w-0",n?"h-8 w-8 justify-center px-0":"w-full",t),"aria-label":Ct("header.auth.sign_in_aria"),title:n?"Sign In":void 0,children:[F.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:F.jsx("img",{src:"/app-icon.png",alt:"",width:18,height:18,className:"h-[18px] w-[18px] rounded"})}),!n&&F.jsx("span",{className:"truncate flex-1 text-left",children:"Sign in"})]}):F.jsx("button",{type:"button",onClick:h,className:Mn("shrink-0 inline-flex h-9 items-center justify-center gap-1.5 rounded-full px-5 text-sm font-medium transition-colors duration-200 ease-out shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 text-white hover:bg-oai-gray-800 active:bg-oai-gray-950 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 dark:active:bg-oai-gray-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-oai-gray-950",t),"aria-label":Ct("header.auth.sign_in_aria"),children:"Sign In"});const v=()=>{p("/settings"),i?.()};return F.jsx("div",{className:Mn(r?"relative flex w-full shrink-0 items-center":"relative flex shrink-0 items-center",t),children:F.jsxs("button",{type:"button",onClick:v,className:Mn(r?Mn("flex w-full items-center gap-2 rounded-md px-2 py-1.5 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 transition-colors min-w-0",n&&"justify-center px-0 py-0 h-9 w-9"):"flex items-center gap-2 rounded-full pl-1 pr-2 py-1 border border-transparent hover:bg-oai-gray-100 dark:hover:bg-oai-gray-900/80 hover:border-oai-gray-200 dark:hover:border-oai-gray-800 transition-colors"),"aria-label":Ct("header.auth.open_settings"),title:r&&n?d:void 0,children:[r?F.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:m?F.jsx("img",{src:m,alt:"",width:20,height:20,className:"h-5 w-5 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700",referrerPolicy:"no-referrer"}):F.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600 text-[9px] font-semibold text-white ring-1 ring-oai-brand-500/50",children:x1(d)})}):m?F.jsx("img",{src:m,alt:"",width:32,height:32,className:"h-8 w-8 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700 shrink-0",referrerPolicy:"no-referrer"}):F.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600 text-xs font-semibold text-white ring-1 ring-oai-brand-500/50",children:x1(d)}),r?!n&&F.jsx("span",{className:"truncate text-[13px] font-medium text-oai-gray-900 dark:text-oai-gray-200 flex-1 text-left min-w-0",children:d}):F.jsx("span",{className:"hidden sm:inline truncate text-sm font-medium text-oai-gray-900 dark:text-oai-gray-200 max-w-[120px]",children:d})]})})}const Ky="183",mH=0,b1=1,gH=2,jf=1,vH=2,tu=3,Ua=0,Gi=1,Ns=2,Os=0,_o=1,S1=2,w1=3,E1=4,yH=5,lo=100,_H=101,xH=102,bH=103,SH=104,wH=200,EH=201,MH=202,TH=203,G0=204,j0=205,AH=206,CH=207,PH=208,RH=209,kH=210,LH=211,DH=212,NH=213,IH=214,W0=0,$0=1,X0=2,jl=3,q0=4,Y0=5,K0=6,Z0=7,JC=0,UH=1,FH=2,is=0,QC=1,eP=2,tP=3,nP=4,iP=5,rP=6,sP=7,aP=300,To=301,Wl=302,lg=303,cg=304,Hh=306,J0=1e3,Is=1001,Q0=1002,mi=1003,OH=1004,tf=1005,wi=1006,ug=1007,mo=1008,fr=1009,oP=1010,lP=1011,xu=1012,Zy=1013,us=1014,Qr=1015,Hs=1016,Jy=1017,Qy=1018,bu=1020,cP=35902,uP=35899,dP=1021,fP=1022,Fr=1023,Gs=1026,go=1027,hP=1028,e_=1029,$l=1030,t_=1031,n_=1033,Wf=33776,$f=33777,Xf=33778,qf=33779,ev=35840,tv=35841,nv=35842,iv=35843,rv=36196,sv=37492,av=37496,ov=37488,lv=37489,cv=37490,uv=37491,dv=37808,fv=37809,hv=37810,pv=37811,mv=37812,gv=37813,vv=37814,yv=37815,_v=37816,xv=37817,bv=37818,Sv=37819,wv=37820,Ev=37821,Mv=36492,Tv=36494,Av=36495,Cv=36283,Pv=36284,Rv=36285,kv=36286,BH=3200,zH=0,VH=1,Ca="",ur="srgb",Ao="srgb-linear",Sh="linear",wn="srgb",cl=7680,M1=519,HH=512,GH=513,jH=514,i_=515,WH=516,$H=517,r_=518,XH=519,T1=35044,A1="300 es",es=2e3,wh=2001;function qH(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function Eh(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function YH(){const t=Eh("canvas");return t.style.display="block",t}const C1={};function P1(...t){const e="THREE."+t.shift();console.log(e,...t)}function pP(t){const e=t[0];if(typeof e=="string"&&e.startsWith("TSL:")){const n=t[1];n&&n.isStackTrace?t[0]+=" "+n.getLocation():t[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return t}function Gt(...t){t=pP(t);const e="THREE."+t.shift();{const n=t[0];n&&n.isStackTrace?console.warn(n.getError(e)):console.warn(e,...t)}}function _n(...t){t=pP(t);const e="THREE."+t.shift();{const n=t[0];n&&n.isStackTrace?console.error(n.getError(e)):console.error(e,...t)}}function Mh(...t){const e=t.join(" ");e in C1||(C1[e]=!0,Gt(...t))}function KH(t,e,n){return new Promise(function(i,r){function s(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:r();break;case t.TIMEOUT_EXPIRED:setTimeout(s,n);break;default:i()}}setTimeout(s,n)})}const ZH={[W0]:$0,[X0]:K0,[q0]:Z0,[jl]:Y0,[$0]:W0,[K0]:X0,[Z0]:q0,[Y0]:jl};class ec{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(n)===-1&&i[e].push(n)}hasEventListener(e,n){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(n)!==-1}removeEventListener(e,n){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const n=this._listeners;if(n===void 0)return;const i=n[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s<o;s++)r[s].call(this,e);e.target=null}}}const xi=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],dg=Math.PI/180,Lv=180/Math.PI;function Fu(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(xi[t&255]+xi[t>>8&255]+xi[t>>16&255]+xi[t>>24&255]+"-"+xi[e&255]+xi[e>>8&255]+"-"+xi[e>>16&15|64]+xi[e>>24&255]+"-"+xi[n&63|128]+xi[n>>8&255]+"-"+xi[n>>16&255]+xi[n>>24&255]+xi[i&255]+xi[i>>8&255]+xi[i>>16&255]+xi[i>>24&255]).toLowerCase()}function ln(t,e,n){return Math.max(e,Math.min(n,t))}function JH(t,e){return(t%e+e)%e}function fg(t,e,n){return(1-n)*t+n*e}function Hc(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Hi(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}class bn{constructor(e=0,n=0){bn.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,i=this.y,r=e.elements;return this.x=r[0]*n+r[3]*i+r[6],this.y=r[1]*n+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=ln(this.x,e.x,n.x),this.y=ln(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=ln(this.x,e,n),this.y=ln(this.y,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ln(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(ln(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y;return n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const i=Math.cos(n),r=Math.sin(n),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class tc{constructor(e=0,n=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=i,this._w=r}static slerpFlat(e,n,i,r,s,o,c){let u=i[r+0],d=i[r+1],h=i[r+2],p=i[r+3],m=s[o+0],v=s[o+1],_=s[o+2],w=s[o+3];if(p!==w||u!==m||d!==v||h!==_){let y=u*m+d*v+h*_+p*w;y<0&&(m=-m,v=-v,_=-_,w=-w,y=-y);let b=1-c;if(y<.9995){const T=Math.acos(y),A=Math.sin(T);b=Math.sin(b*T)/A,c=Math.sin(c*T)/A,u=u*b+m*c,d=d*b+v*c,h=h*b+_*c,p=p*b+w*c}else{u=u*b+m*c,d=d*b+v*c,h=h*b+_*c,p=p*b+w*c;const T=1/Math.sqrt(u*u+d*d+h*h+p*p);u*=T,d*=T,h*=T,p*=T}}e[n]=u,e[n+1]=d,e[n+2]=h,e[n+3]=p}static multiplyQuaternionsFlat(e,n,i,r,s,o){const c=i[r],u=i[r+1],d=i[r+2],h=i[r+3],p=s[o],m=s[o+1],v=s[o+2],_=s[o+3];return e[n]=c*_+h*p+u*v-d*m,e[n+1]=u*_+h*m+d*p-c*v,e[n+2]=d*_+h*v+c*m-u*p,e[n+3]=h*_-c*p-u*m-d*v,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,i,r){return this._x=e,this._y=n,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const i=e._x,r=e._y,s=e._z,o=e._order,c=Math.cos,u=Math.sin,d=c(i/2),h=c(r/2),p=c(s/2),m=u(i/2),v=u(r/2),_=u(s/2);switch(o){case"XYZ":this._x=m*h*p+d*v*_,this._y=d*v*p-m*h*_,this._z=d*h*_+m*v*p,this._w=d*h*p-m*v*_;break;case"YXZ":this._x=m*h*p+d*v*_,this._y=d*v*p-m*h*_,this._z=d*h*_-m*v*p,this._w=d*h*p+m*v*_;break;case"ZXY":this._x=m*h*p-d*v*_,this._y=d*v*p+m*h*_,this._z=d*h*_+m*v*p,this._w=d*h*p-m*v*_;break;case"ZYX":this._x=m*h*p-d*v*_,this._y=d*v*p+m*h*_,this._z=d*h*_-m*v*p,this._w=d*h*p+m*v*_;break;case"YZX":this._x=m*h*p+d*v*_,this._y=d*v*p+m*h*_,this._z=d*h*_-m*v*p,this._w=d*h*p-m*v*_;break;case"XZY":this._x=m*h*p-d*v*_,this._y=d*v*p-m*h*_,this._z=d*h*_+m*v*p,this._w=d*h*p+m*v*_;break;default:Gt("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const i=n/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,i=n[0],r=n[4],s=n[8],o=n[1],c=n[5],u=n[9],d=n[2],h=n[6],p=n[10],m=i+c+p;if(m>0){const v=.5/Math.sqrt(m+1);this._w=.25/v,this._x=(h-u)*v,this._y=(s-d)*v,this._z=(o-r)*v}else if(i>c&&i>p){const v=2*Math.sqrt(1+i-c-p);this._w=(h-u)/v,this._x=.25*v,this._y=(r+o)/v,this._z=(s+d)/v}else if(c>p){const v=2*Math.sqrt(1+c-i-p);this._w=(s-d)/v,this._x=(r+o)/v,this._y=.25*v,this._z=(u+h)/v}else{const v=2*Math.sqrt(1+p-i-c);this._w=(o-r)/v,this._x=(s+d)/v,this._y=(u+h)/v,this._z=.25*v}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let i=e.dot(n)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ln(this.dot(e),-1,1)))}rotateTowards(e,n){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,n/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const i=e._x,r=e._y,s=e._z,o=e._w,c=n._x,u=n._y,d=n._z,h=n._w;return this._x=i*h+o*c+r*d-s*u,this._y=r*h+o*u+s*c-i*d,this._z=s*h+o*d+i*u-r*c,this._w=o*h-i*c-r*u-s*d,this._onChangeCallback(),this}slerp(e,n){let i=e._x,r=e._y,s=e._z,o=e._w,c=this.dot(e);c<0&&(i=-i,r=-r,s=-s,o=-o,c=-c);let u=1-n;if(c<.9995){const d=Math.acos(c),h=Math.sin(d);u=Math.sin(u*d)/h,n=Math.sin(n*d)/h,this._x=this._x*u+i*n,this._y=this._y*u+r*n,this._z=this._z*u+s*n,this._w=this._w*u+o*n,this._onChangeCallback()}else this._x=this._x*u+i*n,this._y=this._y*u+r*n,this._z=this._z*u+s*n,this._w=this._w*u+o*n,this.normalize();return this}slerpQuaternions(e,n,i){return this.copy(e).slerp(n,i)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(n),s*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class me{constructor(e=0,n=0,i=0){me.prototype.isVector3=!0,this.x=e,this.y=n,this.z=i}set(e,n,i){return i===void 0&&(i=this.z),this.x=e,this.y=n,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(R1.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(R1.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*n+s[3]*i+s[6]*r,this.y=s[1]*n+s[4]*i+s[7]*r,this.z=s[2]*n+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*n+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*n+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*n+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*n+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const n=this.x,i=this.y,r=this.z,s=e.x,o=e.y,c=e.z,u=e.w,d=2*(o*r-c*i),h=2*(c*n-s*r),p=2*(s*i-o*n);return this.x=n+u*d+o*p-c*h,this.y=i+u*h+c*d-s*p,this.z=r+u*p+s*h-o*d,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*n+s[4]*i+s[8]*r,this.y=s[1]*n+s[5]*i+s[9]*r,this.z=s[2]*n+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=ln(this.x,e.x,n.x),this.y=ln(this.y,e.y,n.y),this.z=ln(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=ln(this.x,e,n),this.y=ln(this.y,e,n),this.z=ln(this.z,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ln(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const i=e.x,r=e.y,s=e.z,o=n.x,c=n.y,u=n.z;return this.x=r*u-s*c,this.y=s*o-i*u,this.z=i*c-r*o,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const i=e.dot(this)/n;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return hg.copy(this).projectOnVector(e),this.sub(hg)}reflect(e){return this.sub(hg.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(ln(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return n*n+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,i){const r=Math.sin(n)*e;return this.x=r*Math.sin(i),this.y=Math.cos(n)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,i){return this.x=e*Math.sin(n),this.y=i,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=i,this.z=r,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,i=Math.sqrt(1-n*n);return this.x=i*Math.cos(e),this.y=n,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const hg=new me,R1=new tc;class Wt{constructor(e,n,i,r,s,o,c,u,d){Wt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,i,r,s,o,c,u,d)}set(e,n,i,r,s,o,c,u,d){const h=this.elements;return h[0]=e,h[1]=r,h[2]=c,h[3]=n,h[4]=s,h[5]=u,h[6]=i,h[7]=o,h[8]=d,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],this}extractBasis(e,n,i){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,s=this.elements,o=i[0],c=i[3],u=i[6],d=i[1],h=i[4],p=i[7],m=i[2],v=i[5],_=i[8],w=r[0],y=r[3],b=r[6],T=r[1],A=r[4],M=r[7],I=r[2],k=r[5],U=r[8];return s[0]=o*w+c*T+u*I,s[3]=o*y+c*A+u*k,s[6]=o*b+c*M+u*U,s[1]=d*w+h*T+p*I,s[4]=d*y+h*A+p*k,s[7]=d*b+h*M+p*U,s[2]=m*w+v*T+_*I,s[5]=m*y+v*A+_*k,s[8]=m*b+v*M+_*U,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],c=e[5],u=e[6],d=e[7],h=e[8];return n*o*h-n*c*d-i*s*h+i*c*u+r*s*d-r*o*u}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],c=e[5],u=e[6],d=e[7],h=e[8],p=h*o-c*d,m=c*u-h*s,v=d*s-o*u,_=n*p+i*m+r*v;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);const w=1/_;return e[0]=p*w,e[1]=(r*d-h*i)*w,e[2]=(c*i-r*o)*w,e[3]=m*w,e[4]=(h*n-r*u)*w,e[5]=(r*s-c*n)*w,e[6]=v*w,e[7]=(i*u-d*n)*w,e[8]=(o*n-i*s)*w,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,i,r,s,o,c){const u=Math.cos(s),d=Math.sin(s);return this.set(i*u,i*d,-i*(u*o+d*c)+o+e,-r*d,r*u,-r*(-d*o+u*c)+c+n,0,0,1),this}scale(e,n){return this.premultiply(pg.makeScale(e,n)),this}rotate(e){return this.premultiply(pg.makeRotation(-e)),this}translate(e,n){return this.premultiply(pg.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,i,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<9;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<9;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const pg=new Wt,k1=new Wt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),L1=new Wt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function QH(){const t={enabled:!0,workingColorSpace:Ao,spaces:{},convert:function(r,s,o){return this.enabled===!1||s===o||!s||!o||(this.spaces[s].transfer===wn&&(r.r=Bs(r.r),r.g=Bs(r.g),r.b=Bs(r.b)),this.spaces[s].primaries!==this.spaces[o].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===wn&&(r.r=Ul(r.r),r.g=Ul(r.g),r.b=Ul(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===Ca?Sh:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,o){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,s){return Mh("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return Mh("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],i=[.3127,.329];return t.define({[Ao]:{primaries:e,whitePoint:i,transfer:Sh,toXYZ:k1,fromXYZ:L1,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:ur},outputColorSpaceConfig:{drawingBufferColorSpace:ur}},[ur]:{primaries:e,whitePoint:i,transfer:wn,toXYZ:k1,fromXYZ:L1,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:ur}}}),t}const fn=QH();function Bs(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function Ul(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let ul;class e6{static getDataURL(e,n="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{ul===void 0&&(ul=Eh("canvas")),ul.width=e.width,ul.height=e.height;const r=ul.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=ul}return i.toDataURL(n)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=Eh("canvas");n.width=e.width,n.height=e.height;const i=n.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o<s.length;o++)s[o]=Bs(s[o]/255)*255;return i.putImageData(r,0,0),n}else if(e.data){const n=e.data.slice(0);for(let i=0;i<n.length;i++)n instanceof Uint8Array||n instanceof Uint8ClampedArray?n[i]=Math.floor(Bs(n[i]/255)*255):n[i]=Bs(n[i]);return{data:n,width:e.width,height:e.height}}else return Gt("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let t6=0;class s_{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:t6++}),this.uuid=Fu(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const n=this.data;return typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement?e.set(n.videoWidth,n.videoHeight,0):typeof VideoFrame<"u"&&n instanceof VideoFrame?e.set(n.displayHeight,n.displayWidth,0):n!==null?e.set(n.width,n.height,n.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let o=0,c=r.length;o<c;o++)r[o].isDataTexture?s.push(mg(r[o].image)):s.push(mg(r[o]))}else s=mg(r);i.url=s}return n||(e.images[this.uuid]=i),i}}function mg(t){return typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap?e6.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(Gt("Texture: Unable to serialize Texture."),{})}let n6=0;const gg=new me;class Li extends ec{constructor(e=Li.DEFAULT_IMAGE,n=Li.DEFAULT_MAPPING,i=Is,r=Is,s=wi,o=mo,c=Fr,u=fr,d=Li.DEFAULT_ANISOTROPY,h=Ca){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:n6++}),this.uuid=Fu(),this.name="",this.source=new s_(e),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=o,this.anisotropy=d,this.format=c,this.internalFormat=null,this.type=u,this.offset=new bn(0,0),this.repeat=new bn(1,1),this.center=new bn(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Wt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(gg).x}get height(){return this.source.getSize(gg).y}get depth(){return this.source.getSize(gg).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const n in e){const i=e[n];if(i===void 0){Gt(`Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){Gt(`Texture.setValues(): property '${n}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),n||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==aP)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case J0:e.x=e.x-Math.floor(e.x);break;case Is:e.x=e.x<0?0:1;break;case Q0: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 J0:e.y=e.y-Math.floor(e.y);break;case Is:e.y=e.y<0?0:1;break;case Q0: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)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Li.DEFAULT_IMAGE=null;Li.DEFAULT_MAPPING=aP;Li.DEFAULT_ANISOTROPY=1;class Vn{constructor(e=0,n=0,i=0,r=1){Vn.prototype.isVector4=!0,this.x=e,this.y=n,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,i,r){return this.x=e,this.y=n,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*n+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*n+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*n+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*n+o[7]*i+o[11]*r+o[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,i,r,s;const u=e.elements,d=u[0],h=u[4],p=u[8],m=u[1],v=u[5],_=u[9],w=u[2],y=u[6],b=u[10];if(Math.abs(h-m)<.01&&Math.abs(p-w)<.01&&Math.abs(_-y)<.01){if(Math.abs(h+m)<.1&&Math.abs(p+w)<.1&&Math.abs(_+y)<.1&&Math.abs(d+v+b-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const A=(d+1)/2,M=(v+1)/2,I=(b+1)/2,k=(h+m)/4,U=(p+w)/4,S=(_+y)/4;return A>M&&A>I?A<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(A),r=k/i,s=U/i):M>I?M<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(M),i=k/r,s=S/r):I<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(I),i=U/s,r=S/s),this.set(i,r,s,n),this}let T=Math.sqrt((y-_)*(y-_)+(p-w)*(p-w)+(m-h)*(m-h));return Math.abs(T)<.001&&(T=1),this.x=(y-_)/T,this.y=(p-w)/T,this.z=(m-h)/T,this.w=Math.acos((d+v+b-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=ln(this.x,e.x,n.x),this.y=ln(this.y,e.y,n.y),this.z=ln(this.z,e.z,n.z),this.w=ln(this.w,e.w,n.w),this}clampScalar(e,n){return this.x=ln(this.x,e,n),this.y=ln(this.y,e,n),this.z=ln(this.z,e,n),this.w=ln(this.w,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ln(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this.w=e.w+(n.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class i6 extends ec{constructor(e=1,n=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:wi,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=i.depth,this.scissor=new Vn(0,0,e,n),this.scissorTest=!1,this.viewport=new Vn(0,0,e,n),this.textures=[];const r={width:e,height:n,depth:i.depth},s=new Li(r),o=i.count;for(let c=0;c<o;c++)this.textures[c]=s.clone(),this.textures[c].isRenderTargetTexture=!0,this.textures[c].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview}_setTextureOptions(e={}){const n={minFilter:wi,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(n.mapping=e.mapping),e.wrapS!==void 0&&(n.wrapS=e.wrapS),e.wrapT!==void 0&&(n.wrapT=e.wrapT),e.wrapR!==void 0&&(n.wrapR=e.wrapR),e.magFilter!==void 0&&(n.magFilter=e.magFilter),e.minFilter!==void 0&&(n.minFilter=e.minFilter),e.format!==void 0&&(n.format=e.format),e.type!==void 0&&(n.type=e.type),e.anisotropy!==void 0&&(n.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(n.colorSpace=e.colorSpace),e.flipY!==void 0&&(n.flipY=e.flipY),e.generateMipmaps!==void 0&&(n.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(n.internalFormat=e.internalFormat);for(let i=0;i<this.textures.length;i++)this.textures[i].setValues(n)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,n,i=1){if(this.width!==e||this.height!==n||this.depth!==i){this.width=e,this.height=n,this.depth=i;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=n,this.textures[r].image.depth=i,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].image.depth>1);this.dispose()}this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,i=e.textures.length;n<i;n++){this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0,this.textures[n].renderTarget=this;const r=Object.assign({},e.textures[n].image);this.textures[n].source=new s_(r)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class rs extends i6{constructor(e=1,n=1,i={}){super(e,n,i),this.isWebGLRenderTarget=!0}}class mP extends Li{constructor(e=null,n=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:i,depth:r},this.magFilter=mi,this.minFilter=mi,this.wrapR=Is,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class r6 extends Li{constructor(e=null,n=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:i,depth:r},this.magFilter=mi,this.minFilter=mi,this.wrapR=Is,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Kn{constructor(e,n,i,r,s,o,c,u,d,h,p,m,v,_,w,y){Kn.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,i,r,s,o,c,u,d,h,p,m,v,_,w,y)}set(e,n,i,r,s,o,c,u,d,h,p,m,v,_,w,y){const b=this.elements;return b[0]=e,b[4]=n,b[8]=i,b[12]=r,b[1]=s,b[5]=o,b[9]=c,b[13]=u,b[2]=d,b[6]=h,b[10]=p,b[14]=m,b[3]=v,b[7]=_,b[11]=w,b[15]=y,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 Kn().fromArray(this.elements)}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],n[9]=i[9],n[10]=i[10],n[11]=i[11],n[12]=i[12],n[13]=i[13],n[14]=i[14],n[15]=i[15],this}copyPosition(e){const n=this.elements,i=e.elements;return n[12]=i[12],n[13]=i[13],n[14]=i[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,i){return this.determinant()===0?(e.set(1,0,0),n.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,n,i){return this.set(e.x,n.x,i.x,0,e.y,n.y,i.y,0,e.z,n.z,i.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const n=this.elements,i=e.elements,r=1/dl.setFromMatrixColumn(e,0).length(),s=1/dl.setFromMatrixColumn(e,1).length(),o=1/dl.setFromMatrixColumn(e,2).length();return n[0]=i[0]*r,n[1]=i[1]*r,n[2]=i[2]*r,n[3]=0,n[4]=i[4]*s,n[5]=i[5]*s,n[6]=i[6]*s,n[7]=0,n[8]=i[8]*o,n[9]=i[9]*o,n[10]=i[10]*o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),c=Math.sin(i),u=Math.cos(r),d=Math.sin(r),h=Math.cos(s),p=Math.sin(s);if(e.order==="XYZ"){const m=o*h,v=o*p,_=c*h,w=c*p;n[0]=u*h,n[4]=-u*p,n[8]=d,n[1]=v+_*d,n[5]=m-w*d,n[9]=-c*u,n[2]=w-m*d,n[6]=_+v*d,n[10]=o*u}else if(e.order==="YXZ"){const m=u*h,v=u*p,_=d*h,w=d*p;n[0]=m+w*c,n[4]=_*c-v,n[8]=o*d,n[1]=o*p,n[5]=o*h,n[9]=-c,n[2]=v*c-_,n[6]=w+m*c,n[10]=o*u}else if(e.order==="ZXY"){const m=u*h,v=u*p,_=d*h,w=d*p;n[0]=m-w*c,n[4]=-o*p,n[8]=_+v*c,n[1]=v+_*c,n[5]=o*h,n[9]=w-m*c,n[2]=-o*d,n[6]=c,n[10]=o*u}else if(e.order==="ZYX"){const m=o*h,v=o*p,_=c*h,w=c*p;n[0]=u*h,n[4]=_*d-v,n[8]=m*d+w,n[1]=u*p,n[5]=w*d+m,n[9]=v*d-_,n[2]=-d,n[6]=c*u,n[10]=o*u}else if(e.order==="YZX"){const m=o*u,v=o*d,_=c*u,w=c*d;n[0]=u*h,n[4]=w-m*p,n[8]=_*p+v,n[1]=p,n[5]=o*h,n[9]=-c*h,n[2]=-d*h,n[6]=v*p+_,n[10]=m-w*p}else if(e.order==="XZY"){const m=o*u,v=o*d,_=c*u,w=c*d;n[0]=u*h,n[4]=-p,n[8]=d*h,n[1]=m*p+w,n[5]=o*h,n[9]=v*p-_,n[2]=_*p-v,n[6]=c*h,n[10]=w*p+m}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(s6,e,a6)}lookAt(e,n,i){const r=this.elements;return Ki.subVectors(e,n),Ki.lengthSq()===0&&(Ki.z=1),Ki.normalize(),ga.crossVectors(i,Ki),ga.lengthSq()===0&&(Math.abs(i.z)===1?Ki.x+=1e-4:Ki.z+=1e-4,Ki.normalize(),ga.crossVectors(i,Ki)),ga.normalize(),nf.crossVectors(Ki,ga),r[0]=ga.x,r[4]=nf.x,r[8]=Ki.x,r[1]=ga.y,r[5]=nf.y,r[9]=Ki.y,r[2]=ga.z,r[6]=nf.z,r[10]=Ki.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,s=this.elements,o=i[0],c=i[4],u=i[8],d=i[12],h=i[1],p=i[5],m=i[9],v=i[13],_=i[2],w=i[6],y=i[10],b=i[14],T=i[3],A=i[7],M=i[11],I=i[15],k=r[0],U=r[4],S=r[8],P=r[12],V=r[1],O=r[5],G=r[9],J=r[13],H=r[2],X=r[6],K=r[10],Q=r[14],W=r[3],q=r[7],Z=r[11],z=r[15];return s[0]=o*k+c*V+u*H+d*W,s[4]=o*U+c*O+u*X+d*q,s[8]=o*S+c*G+u*K+d*Z,s[12]=o*P+c*J+u*Q+d*z,s[1]=h*k+p*V+m*H+v*W,s[5]=h*U+p*O+m*X+v*q,s[9]=h*S+p*G+m*K+v*Z,s[13]=h*P+p*J+m*Q+v*z,s[2]=_*k+w*V+y*H+b*W,s[6]=_*U+w*O+y*X+b*q,s[10]=_*S+w*G+y*K+b*Z,s[14]=_*P+w*J+y*Q+b*z,s[3]=T*k+A*V+M*H+I*W,s[7]=T*U+A*O+M*X+I*q,s[11]=T*S+A*G+M*K+I*Z,s[15]=T*P+A*J+M*Q+I*z,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[4],r=e[8],s=e[12],o=e[1],c=e[5],u=e[9],d=e[13],h=e[2],p=e[6],m=e[10],v=e[14],_=e[3],w=e[7],y=e[11],b=e[15],T=u*v-d*m,A=c*v-d*p,M=c*m-u*p,I=o*v-d*h,k=o*m-u*h,U=o*p-c*h;return n*(w*T-y*A+b*M)-i*(_*T-y*I+b*k)+r*(_*A-w*I+b*U)-s*(_*M-w*k+y*U)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=n,r[14]=i),this}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],c=e[5],u=e[6],d=e[7],h=e[8],p=e[9],m=e[10],v=e[11],_=e[12],w=e[13],y=e[14],b=e[15],T=n*c-i*o,A=n*u-r*o,M=n*d-s*o,I=i*u-r*c,k=i*d-s*c,U=r*d-s*u,S=h*w-p*_,P=h*y-m*_,V=h*b-v*_,O=p*y-m*w,G=p*b-v*w,J=m*b-v*y,H=T*J-A*G+M*O+I*V-k*P+U*S;if(H===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const X=1/H;return e[0]=(c*J-u*G+d*O)*X,e[1]=(r*G-i*J-s*O)*X,e[2]=(w*U-y*k+b*I)*X,e[3]=(m*k-p*U-v*I)*X,e[4]=(u*V-o*J-d*P)*X,e[5]=(n*J-r*V+s*P)*X,e[6]=(y*M-_*U-b*A)*X,e[7]=(h*U-m*M+v*A)*X,e[8]=(o*G-c*V+d*S)*X,e[9]=(i*V-n*G-s*S)*X,e[10]=(_*k-w*M+b*T)*X,e[11]=(p*M-h*k-v*T)*X,e[12]=(c*P-o*O-u*S)*X,e[13]=(n*O-i*P+r*S)*X,e[14]=(w*A-_*I-y*T)*X,e[15]=(h*I-p*A+m*T)*X,this}scale(e){const n=this.elements,i=e.x,r=e.y,s=e.z;return n[0]*=i,n[4]*=r,n[8]*=s,n[1]*=i,n[5]*=r,n[9]*=s,n[2]*=i,n[6]*=r,n[10]*=s,n[3]*=i,n[7]*=r,n[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,i,r))}makeTranslation(e,n,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,i,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const i=Math.cos(n),r=Math.sin(n),s=1-i,o=e.x,c=e.y,u=e.z,d=s*o,h=s*c;return this.set(d*o+i,d*c-r*u,d*u+r*c,0,d*c+r*u,h*c+i,h*u-r*o,0,d*u-r*c,h*u+r*o,s*u*u+i,0,0,0,0,1),this}makeScale(e,n,i){return this.set(e,0,0,0,0,n,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,n,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,n,r,1,0,0,0,0,1),this}compose(e,n,i){const r=this.elements,s=n._x,o=n._y,c=n._z,u=n._w,d=s+s,h=o+o,p=c+c,m=s*d,v=s*h,_=s*p,w=o*h,y=o*p,b=c*p,T=u*d,A=u*h,M=u*p,I=i.x,k=i.y,U=i.z;return r[0]=(1-(w+b))*I,r[1]=(v+M)*I,r[2]=(_-A)*I,r[3]=0,r[4]=(v-M)*k,r[5]=(1-(m+b))*k,r[6]=(y+T)*k,r[7]=0,r[8]=(_+A)*U,r[9]=(y-T)*U,r[10]=(1-(m+w))*U,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,n,i){const r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];const s=this.determinant();if(s===0)return i.set(1,1,1),n.identity(),this;let o=dl.set(r[0],r[1],r[2]).length();const c=dl.set(r[4],r[5],r[6]).length(),u=dl.set(r[8],r[9],r[10]).length();s<0&&(o=-o),kr.copy(this);const d=1/o,h=1/c,p=1/u;return kr.elements[0]*=d,kr.elements[1]*=d,kr.elements[2]*=d,kr.elements[4]*=h,kr.elements[5]*=h,kr.elements[6]*=h,kr.elements[8]*=p,kr.elements[9]*=p,kr.elements[10]*=p,n.setFromRotationMatrix(kr),i.x=o,i.y=c,i.z=u,this}makePerspective(e,n,i,r,s,o,c=es,u=!1){const d=this.elements,h=2*s/(n-e),p=2*s/(i-r),m=(n+e)/(n-e),v=(i+r)/(i-r);let _,w;if(u)_=s/(o-s),w=o*s/(o-s);else if(c===es)_=-(o+s)/(o-s),w=-2*o*s/(o-s);else if(c===wh)_=-o/(o-s),w=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return d[0]=h,d[4]=0,d[8]=m,d[12]=0,d[1]=0,d[5]=p,d[9]=v,d[13]=0,d[2]=0,d[6]=0,d[10]=_,d[14]=w,d[3]=0,d[7]=0,d[11]=-1,d[15]=0,this}makeOrthographic(e,n,i,r,s,o,c=es,u=!1){const d=this.elements,h=2/(n-e),p=2/(i-r),m=-(n+e)/(n-e),v=-(i+r)/(i-r);let _,w;if(u)_=1/(o-s),w=o/(o-s);else if(c===es)_=-2/(o-s),w=-(o+s)/(o-s);else if(c===wh)_=-1/(o-s),w=-s/(o-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return d[0]=h,d[4]=0,d[8]=0,d[12]=m,d[1]=0,d[5]=p,d[9]=0,d[13]=v,d[2]=0,d[6]=0,d[10]=_,d[14]=w,d[3]=0,d[7]=0,d[11]=0,d[15]=1,this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<16;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<16;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e[n+9]=i[9],e[n+10]=i[10],e[n+11]=i[11],e[n+12]=i[12],e[n+13]=i[13],e[n+14]=i[14],e[n+15]=i[15],e}}const dl=new me,kr=new Kn,s6=new me(0,0,0),a6=new me(1,1,1),ga=new me,nf=new me,Ki=new me,D1=new Kn,N1=new tc;let Co=class gP{constructor(e=0,n=0,i=0,r=gP.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,i,r=this._order){return this._x=e,this._y=n,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],c=r[8],u=r[1],d=r[5],h=r[9],p=r[2],m=r[6],v=r[10];switch(n){case"XYZ":this._y=Math.asin(ln(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,v),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(m,d),this._z=0);break;case"YXZ":this._x=Math.asin(-ln(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(c,v),this._z=Math.atan2(u,d)):(this._y=Math.atan2(-p,s),this._z=0);break;case"ZXY":this._x=Math.asin(ln(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-p,v),this._z=Math.atan2(-o,d)):(this._y=0,this._z=Math.atan2(u,s));break;case"ZYX":this._y=Math.asin(-ln(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(m,v),this._z=Math.atan2(u,s)):(this._x=0,this._z=Math.atan2(-o,d));break;case"YZX":this._z=Math.asin(ln(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-h,d),this._y=Math.atan2(-p,s)):(this._x=0,this._y=Math.atan2(c,v));break;case"XZY":this._z=Math.asin(-ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(m,d),this._y=Math.atan2(c,s)):(this._x=Math.atan2(-h,v),this._y=0);break;default:Gt("Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,i){return D1.makeRotationFromQuaternion(e),this.setFromRotationMatrix(D1,n,i)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return N1.setFromEuler(this),this.setFromQuaternion(N1,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Co.DEFAULT_ORDER="XYZ";class vP{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let o6=0;const I1=new me,fl=new tc,As=new Kn,rf=new me,Gc=new me,l6=new me,c6=new tc,U1=new me(1,0,0),F1=new me(0,1,0),O1=new me(0,0,1),B1={type:"added"},u6={type:"removed"},hl={type:"childadded",child:null},vg={type:"childremoved",child:null};class er extends ec{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:o6++}),this.uuid=Fu(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=er.DEFAULT_UP.clone();const e=new me,n=new Co,i=new tc,r=new me(1,1,1);function s(){i.setFromEuler(n,!1)}function o(){n.setFromQuaternion(i,void 0,!1)}n._onChange(s),i._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Kn},normalMatrix:{value:new Wt}}),this.matrix=new Kn,this.matrixWorld=new Kn,this.matrixAutoUpdate=er.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=er.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new vP,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,n){this.quaternion.setFromAxisAngle(e,n)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,n){return fl.setFromAxisAngle(e,n),this.quaternion.multiply(fl),this}rotateOnWorldAxis(e,n){return fl.setFromAxisAngle(e,n),this.quaternion.premultiply(fl),this}rotateX(e){return this.rotateOnAxis(U1,e)}rotateY(e){return this.rotateOnAxis(F1,e)}rotateZ(e){return this.rotateOnAxis(O1,e)}translateOnAxis(e,n){return I1.copy(e).applyQuaternion(this.quaternion),this.position.add(I1.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis(U1,e)}translateY(e){return this.translateOnAxis(F1,e)}translateZ(e){return this.translateOnAxis(O1,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(As.copy(this.matrixWorld).invert())}lookAt(e,n,i){e.isVector3?rf.copy(e):rf.set(e,n,i);const r=this.parent;this.updateWorldMatrix(!0,!1),Gc.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?As.lookAt(Gc,rf,this.up):As.lookAt(rf,Gc,this.up),this.quaternion.setFromRotationMatrix(As),r&&(As.extractRotation(r.matrixWorld),fl.setFromRotationMatrix(As),this.quaternion.premultiply(fl.invert()))}add(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return e===this?(_n("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(B1),hl.child=e,this.dispatchEvent(hl),hl.child=null):_n("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const n=this.children.indexOf(e);return n!==-1&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(u6),vg.child=e,this.dispatchEvent(vg),vg.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),As.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),As.multiply(e.parent.matrixWorld)),e.applyMatrix4(As),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(B1),hl.child=e,this.dispatchEvent(hl),hl.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,n){if(this[e]===n)return this;for(let i=0,r=this.children.length;i<r;i++){const o=this.children[i].getObjectByProperty(e,n);if(o!==void 0)return o}}getObjectsByProperty(e,n,i=[]){this[e]===n&&i.push(this);const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].getObjectsByProperty(e,n,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Gc,e,l6),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Gc,c6,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);const n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].traverseVisible(e)}traverseAncestors(e){const n=this.parent;n!==null&&(e(n),n.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(e!==null){const n=e.x,i=e.y,r=e.z,s=this.matrix.elements;s[12]+=n-s[0]*n-s[4]*i-s[8]*r,s[13]+=i-s[1]*n-s[5]*i-s[9]*r,s[14]+=r-s[2]*n-s[6]*i-s[10]*r}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].updateMatrixWorld(e)}updateWorldMatrix(e,n){const i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),n===!0){const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const n=e===void 0||typeof e=="string",i={};n&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),this.static!==!1&&(r.static=this.static),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(c=>({...c,boundingBox:c.boundingBox?c.boundingBox.toJSON():void 0,boundingSphere:c.boundingSphere?c.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(c=>({...c})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function s(c,u){return c[u.uuid]===void 0&&(c[u.uuid]=u.toJSON(e)),u.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){const u=c.shapes;if(Array.isArray(u))for(let d=0,h=u.length;d<h;d++){const p=u[d];s(e.shapes,p)}else s(e.shapes,u)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const c=[];for(let u=0,d=this.material.length;u<d;u++)c.push(s(e.materials,this.material[u]));r.material=c}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let c=0;c<this.children.length;c++)r.children.push(this.children[c].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let c=0;c<this.animations.length;c++){const u=this.animations[c];r.animations.push(s(e.animations,u))}}if(n){const c=o(e.geometries),u=o(e.materials),d=o(e.textures),h=o(e.images),p=o(e.shapes),m=o(e.skeletons),v=o(e.animations),_=o(e.nodes);c.length>0&&(i.geometries=c),u.length>0&&(i.materials=u),d.length>0&&(i.textures=d),h.length>0&&(i.images=h),p.length>0&&(i.shapes=p),m.length>0&&(i.skeletons=m),v.length>0&&(i.animations=v),_.length>0&&(i.nodes=_)}return i.object=r,i;function o(c){const u=[];for(const d in c){const h=c[d];delete h.metadata,u.push(h)}return u}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),e.pivot!==null&&(this.pivot=e.pivot.clone()),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.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}er.DEFAULT_UP=new me(0,1,0);er.DEFAULT_MATRIX_AUTO_UPDATE=!0;er.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class sf extends er{constructor(){super(),this.isGroup=!0,this.type="Group"}}const d6={type:"move"};class yg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new sf,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 sf,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new me,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new me),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new sf,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new me,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new me),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const i of e.hand.values())this._getHandJoint(n,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,i){let r=null,s=null,o=null;const c=this._targetRay,u=this._grip,d=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(d&&e.hand){o=!0;for(const w of e.hand.values()){const y=n.getJointPose(w,i),b=this._getHandJoint(d,w);y!==null&&(b.matrix.fromArray(y.transform.matrix),b.matrix.decompose(b.position,b.rotation,b.scale),b.matrixWorldNeedsUpdate=!0,b.jointRadius=y.radius),b.visible=y!==null}const h=d.joints["index-finger-tip"],p=d.joints["thumb-tip"],m=h.position.distanceTo(p.position),v=.02,_=.005;d.inputState.pinching&&m>v+_?(d.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!d.inputState.pinching&&m<=v-_&&(d.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else u!==null&&e.gripSpace&&(s=n.getPose(e.gripSpace,i),s!==null&&(u.matrix.fromArray(s.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,s.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(s.linearVelocity)):u.hasLinearVelocity=!1,s.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(s.angularVelocity)):u.hasAngularVelocity=!1));c!==null&&(r=n.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1,this.dispatchEvent(d6)))}return c!==null&&(c.visible=r!==null),u!==null&&(u.visible=s!==null),d!==null&&(d.visible=o!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const i=new sf;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[n.jointName]=i,e.add(i)}return e.joints[n.jointName]}}const yP={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},va={h:0,s:0,l:0},af={h:0,s:0,l:0};function _g(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}class Tn{constructor(e,n,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,i)}set(e,n,i){if(n===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,n,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=ur){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,fn.colorSpaceToWorking(this,n),this}setRGB(e,n,i,r=fn.workingColorSpace){return this.r=e,this.g=n,this.b=i,fn.colorSpaceToWorking(this,r),this}setHSL(e,n,i,r=fn.workingColorSpace){if(e=JH(e,1),n=ln(n,0,1),i=ln(i,0,1),n===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+n):i+n-i*n,o=2*i-s;this.r=_g(o,s,e+1/3),this.g=_g(o,s,e),this.b=_g(o,s,e-1/3)}return fn.colorSpaceToWorking(this,r),this}setStyle(e,n=ur){function i(s){s!==void 0&&parseFloat(s)<1&&Gt("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],c=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return i(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,n);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return i(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,n);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,n);break;default:Gt("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[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,n);if(o===6)return this.setHex(parseInt(s,16),n);Gt("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=ur){const i=yP[e.toLowerCase()];return i!==void 0?this.setHex(i,n):Gt("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=Bs(e.r),this.g=Bs(e.g),this.b=Bs(e.b),this}copyLinearToSRGB(e){return this.r=Ul(e.r),this.g=Ul(e.g),this.b=Ul(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=ur){return fn.workingToColorSpace(bi.copy(this),e),Math.round(ln(bi.r*255,0,255))*65536+Math.round(ln(bi.g*255,0,255))*256+Math.round(ln(bi.b*255,0,255))}getHexString(e=ur){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=fn.workingColorSpace){fn.workingToColorSpace(bi.copy(this),n);const i=bi.r,r=bi.g,s=bi.b,o=Math.max(i,r,s),c=Math.min(i,r,s);let u,d;const h=(c+o)/2;if(c===o)u=0,d=0;else{const p=o-c;switch(d=h<=.5?p/(o+c):p/(2-o-c),o){case i:u=(r-s)/p+(r<s?6:0);break;case r:u=(s-i)/p+2;break;case s:u=(i-r)/p+4;break}u/=6}return e.h=u,e.s=d,e.l=h,e}getRGB(e,n=fn.workingColorSpace){return fn.workingToColorSpace(bi.copy(this),n),e.r=bi.r,e.g=bi.g,e.b=bi.b,e}getStyle(e=ur){fn.workingToColorSpace(bi.copy(this),e);const n=bi.r,i=bi.g,r=bi.b;return e!==ur?`color(${e} ${n.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(n*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,n,i){return this.getHSL(va),this.setHSL(va.h+e,va.s+n,va.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,n){return this.r=e.r+n.r,this.g=e.g+n.g,this.b=e.b+n.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,n){return this.r+=(e.r-this.r)*n,this.g+=(e.g-this.g)*n,this.b+=(e.b-this.b)*n,this}lerpColors(e,n,i){return this.r=e.r+(n.r-e.r)*i,this.g=e.g+(n.g-e.g)*i,this.b=e.b+(n.b-e.b)*i,this}lerpHSL(e,n){this.getHSL(va),e.getHSL(af);const i=fg(va.h,af.h,n),r=fg(va.s,af.s,n),s=fg(va.l,af.l,n);return this.setHSL(i,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const n=this.r,i=this.g,r=this.b,s=e.elements;return this.r=s[0]*n+s[3]*i+s[6]*r,this.g=s[1]*n+s[4]*i+s[7]*r,this.b=s[2]*n+s[5]*i+s[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,n=0){return this.r=e[n],this.g=e[n+1],this.b=e[n+2],this}toArray(e=[],n=0){return e[n]=this.r,e[n+1]=this.g,e[n+2]=this.b,e}fromBufferAttribute(e,n){return this.r=e.getX(n),this.g=e.getY(n),this.b=e.getZ(n),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const bi=new Tn;Tn.NAMES=yP;class f6 extends er{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Co,this.environmentIntensity=1,this.environmentRotation=new Co,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}const Lr=new me,Cs=new me,xg=new me,Ps=new me,pl=new me,ml=new me,z1=new me,bg=new me,Sg=new me,wg=new me,Eg=new Vn,Mg=new Vn,Tg=new Vn;let jc=class Al{constructor(e=new me,n=new me,i=new me){this.a=e,this.b=n,this.c=i}static getNormal(e,n,i,r){r.subVectors(i,n),Lr.subVectors(e,n),r.cross(Lr);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,n,i,r,s){Lr.subVectors(r,n),Cs.subVectors(i,n),xg.subVectors(e,n);const o=Lr.dot(Lr),c=Lr.dot(Cs),u=Lr.dot(xg),d=Cs.dot(Cs),h=Cs.dot(xg),p=o*d-c*c;if(p===0)return s.set(0,0,0),null;const m=1/p,v=(d*u-c*h)*m,_=(o*h-c*u)*m;return s.set(1-v-_,_,v)}static containsPoint(e,n,i,r){return this.getBarycoord(e,n,i,r,Ps)===null?!1:Ps.x>=0&&Ps.y>=0&&Ps.x+Ps.y<=1}static getInterpolation(e,n,i,r,s,o,c,u){return this.getBarycoord(e,n,i,r,Ps)===null?(u.x=0,u.y=0,"z"in u&&(u.z=0),"w"in u&&(u.w=0),null):(u.setScalar(0),u.addScaledVector(s,Ps.x),u.addScaledVector(o,Ps.y),u.addScaledVector(c,Ps.z),u)}static getInterpolatedAttribute(e,n,i,r,s,o){return Eg.setScalar(0),Mg.setScalar(0),Tg.setScalar(0),Eg.fromBufferAttribute(e,n),Mg.fromBufferAttribute(e,i),Tg.fromBufferAttribute(e,r),o.setScalar(0),o.addScaledVector(Eg,s.x),o.addScaledVector(Mg,s.y),o.addScaledVector(Tg,s.z),o}static isFrontFacing(e,n,i,r){return Lr.subVectors(i,n),Cs.subVectors(e,n),Lr.cross(Cs).dot(r)<0}set(e,n,i){return this.a.copy(e),this.b.copy(n),this.c.copy(i),this}setFromPointsAndIndices(e,n,i,r){return this.a.copy(e[n]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,n,i,r){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Lr.subVectors(this.c,this.b),Cs.subVectors(this.a,this.b),Lr.cross(Cs).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Al.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Al.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,i,r,s){return Al.getInterpolation(e,this.a,this.b,this.c,n,i,r,s)}containsPoint(e){return Al.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Al.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const i=this.a,r=this.b,s=this.c;let o,c;pl.subVectors(r,i),ml.subVectors(s,i),bg.subVectors(e,i);const u=pl.dot(bg),d=ml.dot(bg);if(u<=0&&d<=0)return n.copy(i);Sg.subVectors(e,r);const h=pl.dot(Sg),p=ml.dot(Sg);if(h>=0&&p<=h)return n.copy(r);const m=u*p-h*d;if(m<=0&&u>=0&&h<=0)return o=u/(u-h),n.copy(i).addScaledVector(pl,o);wg.subVectors(e,s);const v=pl.dot(wg),_=ml.dot(wg);if(_>=0&&v<=_)return n.copy(s);const w=v*d-u*_;if(w<=0&&d>=0&&_<=0)return c=d/(d-_),n.copy(i).addScaledVector(ml,c);const y=h*_-v*p;if(y<=0&&p-h>=0&&v-_>=0)return z1.subVectors(s,r),c=(p-h)/(p-h+(v-_)),n.copy(r).addScaledVector(z1,c);const b=1/(y+w+m);return o=w*b,c=m*b,n.copy(i).addScaledVector(pl,o).addScaledVector(ml,c)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}};class Ou{constructor(e=new me(1/0,1/0,1/0),n=new me(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,i=e.length;n<i;n+=3)this.expandByPoint(Dr.fromArray(e,n));return this}setFromBufferAttribute(e){this.makeEmpty();for(let n=0,i=e.count;n<i;n++)this.expandByPoint(Dr.fromBufferAttribute(e,n));return this}setFromPoints(e){this.makeEmpty();for(let n=0,i=e.length;n<i;n++)this.expandByPoint(e[n]);return this}setFromCenterAndSize(e,n){const i=Dr.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,n=!1){return this.makeEmpty(),this.expandByObject(e,n)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,n=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const s=i.getAttribute("position");if(n===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,c=s.count;o<c;o++)e.isMesh===!0?e.getVertexPosition(o,Dr):Dr.fromBufferAttribute(s,o),Dr.applyMatrix4(e.matrixWorld),this.expandByPoint(Dr);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),of.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),of.copy(i.boundingBox)),of.applyMatrix4(e.matrixWorld),this.union(of)}const r=e.children;for(let s=0,o=r.length;s<o;s++)this.expandByObject(r[s],n);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Dr),Dr.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,i;return e.normal.x>0?(n=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),n<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Wc),lf.subVectors(this.max,Wc),gl.subVectors(e.a,Wc),vl.subVectors(e.b,Wc),yl.subVectors(e.c,Wc),ya.subVectors(vl,gl),_a.subVectors(yl,vl),eo.subVectors(gl,yl);let n=[0,-ya.z,ya.y,0,-_a.z,_a.y,0,-eo.z,eo.y,ya.z,0,-ya.x,_a.z,0,-_a.x,eo.z,0,-eo.x,-ya.y,ya.x,0,-_a.y,_a.x,0,-eo.y,eo.x,0];return!Ag(n,gl,vl,yl,lf)||(n=[1,0,0,0,1,0,0,0,1],!Ag(n,gl,vl,yl,lf))?!1:(cf.crossVectors(ya,_a),n=[cf.x,cf.y,cf.z],Ag(n,gl,vl,yl,lf))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Dr).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Dr).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:(Rs[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Rs[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Rs[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Rs[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Rs[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Rs[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Rs[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Rs[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Rs),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)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Rs=[new me,new me,new me,new me,new me,new me,new me,new me],Dr=new me,of=new Ou,gl=new me,vl=new me,yl=new me,ya=new me,_a=new me,eo=new me,Wc=new me,lf=new me,cf=new me,to=new me;function Ag(t,e,n,i,r){for(let s=0,o=t.length-3;s<=o;s+=3){to.fromArray(t,s);const c=r.x*Math.abs(to.x)+r.y*Math.abs(to.y)+r.z*Math.abs(to.z),u=e.dot(to),d=n.dot(to),h=i.dot(to);if(Math.max(-Math.max(u,d,h),Math.min(u,d,h))>c)return!1}return!0}const $n=new me,uf=new bn;let h6=0;class Vr{constructor(e,n,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:h6++}),this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=i,this.usage=T1,this.updateRanges=[],this.gpuType=Qr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,i){e*=this.itemSize,i*=n.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=n.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let n=0,i=this.count;n<i;n++)uf.fromBufferAttribute(this,n),uf.applyMatrix3(e),this.setXY(n,uf.x,uf.y);else if(this.itemSize===3)for(let n=0,i=this.count;n<i;n++)$n.fromBufferAttribute(this,n),$n.applyMatrix3(e),this.setXYZ(n,$n.x,$n.y,$n.z);return this}applyMatrix4(e){for(let n=0,i=this.count;n<i;n++)$n.fromBufferAttribute(this,n),$n.applyMatrix4(e),this.setXYZ(n,$n.x,$n.y,$n.z);return this}applyNormalMatrix(e){for(let n=0,i=this.count;n<i;n++)$n.fromBufferAttribute(this,n),$n.applyNormalMatrix(e),this.setXYZ(n,$n.x,$n.y,$n.z);return this}transformDirection(e){for(let n=0,i=this.count;n<i;n++)$n.fromBufferAttribute(this,n),$n.transformDirection(e),this.setXYZ(n,$n.x,$n.y,$n.z);return this}set(e,n=0){return this.array.set(e,n),this}getComponent(e,n){let i=this.array[e*this.itemSize+n];return this.normalized&&(i=Hc(i,this.array)),i}setComponent(e,n,i){return this.normalized&&(i=Hi(i,this.array)),this.array[e*this.itemSize+n]=i,this}getX(e){let n=this.array[e*this.itemSize];return this.normalized&&(n=Hc(n,this.array)),n}setX(e,n){return this.normalized&&(n=Hi(n,this.array)),this.array[e*this.itemSize]=n,this}getY(e){let n=this.array[e*this.itemSize+1];return this.normalized&&(n=Hc(n,this.array)),n}setY(e,n){return this.normalized&&(n=Hi(n,this.array)),this.array[e*this.itemSize+1]=n,this}getZ(e){let n=this.array[e*this.itemSize+2];return this.normalized&&(n=Hc(n,this.array)),n}setZ(e,n){return this.normalized&&(n=Hi(n,this.array)),this.array[e*this.itemSize+2]=n,this}getW(e){let n=this.array[e*this.itemSize+3];return this.normalized&&(n=Hc(n,this.array)),n}setW(e,n){return this.normalized&&(n=Hi(n,this.array)),this.array[e*this.itemSize+3]=n,this}setXY(e,n,i){return e*=this.itemSize,this.normalized&&(n=Hi(n,this.array),i=Hi(i,this.array)),this.array[e+0]=n,this.array[e+1]=i,this}setXYZ(e,n,i,r){return e*=this.itemSize,this.normalized&&(n=Hi(n,this.array),i=Hi(i,this.array),r=Hi(r,this.array)),this.array[e+0]=n,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,n,i,r,s){return e*=this.itemSize,this.normalized&&(n=Hi(n,this.array),i=Hi(i,this.array),r=Hi(r,this.array),s=Hi(s,this.array)),this.array[e+0]=n,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==T1&&(e.usage=this.usage),e}}class _P extends Vr{constructor(e,n,i){super(new Uint16Array(e),n,i)}}class xP extends Vr{constructor(e,n,i){super(new Uint32Array(e),n,i)}}class zs extends Vr{constructor(e,n,i){super(new Float32Array(e),n,i)}}const p6=new Ou,$c=new me,Cg=new me;class a_{constructor(e=new me,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const i=this.center;n!==void 0?i.copy(n):p6.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;s<o;s++)r=Math.max(r,i.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const n=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=n*n}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,n){const i=this.center.distanceToSquared(e);return n.copy(e),i>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;$c.subVectors(e,this.center);const n=$c.lengthSq();if(n>this.radius*this.radius){const i=Math.sqrt(n),r=(i-this.radius)*.5;this.center.addScaledVector($c,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Cg.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint($c.copy(e.center).add(Cg)),this.expandByPoint($c.copy(e.center).sub(Cg))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let m6=0;const lr=new Kn,Pg=new er,_l=new me,Zi=new Ou,Xc=new Ou,ci=new me;class gs extends ec{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:m6++}),this.uuid=Fu(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(qH(e)?xP:_P)(e,1):this.index=e,this}setIndirect(e,n=0){return this.indirect=e,this.indirectOffset=n,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,n){return this.attributes[e]=n,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,n,i=0){this.groups.push({start:e,count:n,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,n){this.drawRange.start=e,this.drawRange.count=n}applyMatrix4(e){const n=this.attributes.position;n!==void 0&&(n.applyMatrix4(e),n.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const s=new Wt().getNormalMatrix(e);i.applyNormalMatrix(s),i.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return lr.makeRotationFromQuaternion(e),this.applyMatrix4(lr),this}rotateX(e){return lr.makeRotationX(e),this.applyMatrix4(lr),this}rotateY(e){return lr.makeRotationY(e),this.applyMatrix4(lr),this}rotateZ(e){return lr.makeRotationZ(e),this.applyMatrix4(lr),this}translate(e,n,i){return lr.makeTranslation(e,n,i),this.applyMatrix4(lr),this}scale(e,n,i){return lr.makeScale(e,n,i),this.applyMatrix4(lr),this}lookAt(e){return Pg.lookAt(e),Pg.updateMatrix(),this.applyMatrix4(Pg.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(_l).negate(),this.translate(_l.x,_l.y,_l.z),this}setFromPoints(e){const n=this.getAttribute("position");if(n===void 0){const i=[];for(let r=0,s=e.length;r<s;r++){const o=e[r];i.push(o.x,o.y,o.z||0)}this.setAttribute("position",new zs(i,3))}else{const i=Math.min(e.length,n.count);for(let r=0;r<i;r++){const s=e[r];n.setXYZ(r,s.x,s.y,s.z||0)}e.length>n.count&&Gt("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ou);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){_n("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new me(-1/0,-1/0,-1/0),new me(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let i=0,r=n.length;i<r;i++){const s=n[i];Zi.setFromBufferAttribute(s),this.morphTargetsRelative?(ci.addVectors(this.boundingBox.min,Zi.min),this.boundingBox.expandByPoint(ci),ci.addVectors(this.boundingBox.max,Zi.max),this.boundingBox.expandByPoint(ci)):(this.boundingBox.expandByPoint(Zi.min),this.boundingBox.expandByPoint(Zi.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&_n('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new a_);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){_n("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new me,1/0);return}if(e){const i=this.boundingSphere.center;if(Zi.setFromBufferAttribute(e),n)for(let s=0,o=n.length;s<o;s++){const c=n[s];Xc.setFromBufferAttribute(c),this.morphTargetsRelative?(ci.addVectors(Zi.min,Xc.min),Zi.expandByPoint(ci),ci.addVectors(Zi.max,Xc.max),Zi.expandByPoint(ci)):(Zi.expandByPoint(Xc.min),Zi.expandByPoint(Xc.max))}Zi.getCenter(i);let r=0;for(let s=0,o=e.count;s<o;s++)ci.fromBufferAttribute(e,s),r=Math.max(r,i.distanceToSquared(ci));if(n)for(let s=0,o=n.length;s<o;s++){const c=n[s],u=this.morphTargetsRelative;for(let d=0,h=c.count;d<h;d++)ci.fromBufferAttribute(c,d),u&&(_l.fromBufferAttribute(e,d),ci.add(_l)),r=Math.max(r,i.distanceToSquared(ci))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&_n('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,n=this.attributes;if(e===null||n.position===void 0||n.normal===void 0||n.uv===void 0){_n("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=n.position,r=n.normal,s=n.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Vr(new Float32Array(4*i.count),4));const o=this.getAttribute("tangent"),c=[],u=[];for(let S=0;S<i.count;S++)c[S]=new me,u[S]=new me;const d=new me,h=new me,p=new me,m=new bn,v=new bn,_=new bn,w=new me,y=new me;function b(S,P,V){d.fromBufferAttribute(i,S),h.fromBufferAttribute(i,P),p.fromBufferAttribute(i,V),m.fromBufferAttribute(s,S),v.fromBufferAttribute(s,P),_.fromBufferAttribute(s,V),h.sub(d),p.sub(d),v.sub(m),_.sub(m);const O=1/(v.x*_.y-_.x*v.y);isFinite(O)&&(w.copy(h).multiplyScalar(_.y).addScaledVector(p,-v.y).multiplyScalar(O),y.copy(p).multiplyScalar(v.x).addScaledVector(h,-_.x).multiplyScalar(O),c[S].add(w),c[P].add(w),c[V].add(w),u[S].add(y),u[P].add(y),u[V].add(y))}let T=this.groups;T.length===0&&(T=[{start:0,count:e.count}]);for(let S=0,P=T.length;S<P;++S){const V=T[S],O=V.start,G=V.count;for(let J=O,H=O+G;J<H;J+=3)b(e.getX(J+0),e.getX(J+1),e.getX(J+2))}const A=new me,M=new me,I=new me,k=new me;function U(S){I.fromBufferAttribute(r,S),k.copy(I);const P=c[S];A.copy(P),A.sub(I.multiplyScalar(I.dot(P))).normalize(),M.crossVectors(k,P);const O=M.dot(u[S])<0?-1:1;o.setXYZW(S,A.x,A.y,A.z,O)}for(let S=0,P=T.length;S<P;++S){const V=T[S],O=V.start,G=V.count;for(let J=O,H=O+G;J<H;J+=3)U(e.getX(J+0)),U(e.getX(J+1)),U(e.getX(J+2))}}computeVertexNormals(){const e=this.index,n=this.getAttribute("position");if(n!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new Vr(new Float32Array(n.count*3),3),this.setAttribute("normal",i);else for(let m=0,v=i.count;m<v;m++)i.setXYZ(m,0,0,0);const r=new me,s=new me,o=new me,c=new me,u=new me,d=new me,h=new me,p=new me;if(e)for(let m=0,v=e.count;m<v;m+=3){const _=e.getX(m+0),w=e.getX(m+1),y=e.getX(m+2);r.fromBufferAttribute(n,_),s.fromBufferAttribute(n,w),o.fromBufferAttribute(n,y),h.subVectors(o,s),p.subVectors(r,s),h.cross(p),c.fromBufferAttribute(i,_),u.fromBufferAttribute(i,w),d.fromBufferAttribute(i,y),c.add(h),u.add(h),d.add(h),i.setXYZ(_,c.x,c.y,c.z),i.setXYZ(w,u.x,u.y,u.z),i.setXYZ(y,d.x,d.y,d.z)}else for(let m=0,v=n.count;m<v;m+=3)r.fromBufferAttribute(n,m+0),s.fromBufferAttribute(n,m+1),o.fromBufferAttribute(n,m+2),h.subVectors(o,s),p.subVectors(r,s),h.cross(p),i.setXYZ(m+0,h.x,h.y,h.z),i.setXYZ(m+1,h.x,h.y,h.z),i.setXYZ(m+2,h.x,h.y,h.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let n=0,i=e.count;n<i;n++)ci.fromBufferAttribute(e,n),ci.normalize(),e.setXYZ(n,ci.x,ci.y,ci.z)}toNonIndexed(){function e(c,u){const d=c.array,h=c.itemSize,p=c.normalized,m=new d.constructor(u.length*h);let v=0,_=0;for(let w=0,y=u.length;w<y;w++){c.isInterleavedBufferAttribute?v=u[w]*c.data.stride+c.offset:v=u[w]*h;for(let b=0;b<h;b++)m[_++]=d[v++]}return new Vr(m,h,p)}if(this.index===null)return Gt("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const n=new gs,i=this.index.array,r=this.attributes;for(const c in r){const u=r[c],d=e(u,i);n.setAttribute(c,d)}const s=this.morphAttributes;for(const c in s){const u=[],d=s[c];for(let h=0,p=d.length;h<p;h++){const m=d[h],v=e(m,i);u.push(v)}n.morphAttributes[c]=u}n.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let c=0,u=o.length;c<u;c++){const d=o[c];n.addGroup(d.start,d.count,d.materialIndex)}return n}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const u=this.parameters;for(const d in u)u[d]!==void 0&&(e[d]=u[d]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const i=this.attributes;for(const u in i){const d=i[u];e.data.attributes[u]=d.toJSON(e.data)}const r={};let s=!1;for(const u in this.morphAttributes){const d=this.morphAttributes[u],h=[];for(let p=0,m=d.length;p<m;p++){const v=d[p];h.push(v.toJSON(e.data))}h.length>0&&(r[u]=h,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const c=this.boundingSphere;return c!==null&&(e.data.boundingSphere=c.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const r=e.attributes;for(const d in r){const h=r[d];this.setAttribute(d,h.clone(n))}const s=e.morphAttributes;for(const d in s){const h=[],p=s[d];for(let m=0,v=p.length;m<v;m++)h.push(p[m].clone(n));this.morphAttributes[d]=h}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let d=0,h=o.length;d<h;d++){const p=o[d];this.addGroup(p.start,p.count,p.materialIndex)}const c=e.boundingBox;c!==null&&(this.boundingBox=c.clone());const u=e.boundingSphere;return u!==null&&(this.boundingSphere=u.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}let g6=0;class Gh extends ec{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:g6++}),this.uuid=Fu(),this.name="",this.type="Material",this.blending=_o,this.side=Ua,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=G0,this.blendDst=j0,this.blendEquation=lo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Tn(0,0,0),this.blendAlpha=0,this.depthFunc=jl,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=M1,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=cl,this.stencilZFail=cl,this.stencilZPass=cl,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const i=e[n];if(i===void 0){Gt(`Material: parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){Gt(`Material: '${n}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==_o&&(i.blending=this.blending),this.side!==Ua&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==G0&&(i.blendSrc=this.blendSrc),this.blendDst!==j0&&(i.blendDst=this.blendDst),this.blendEquation!==lo&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==jl&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==M1&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==cl&&(i.stencilFail=this.stencilFail),this.stencilZFail!==cl&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==cl&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.allowOverride===!1&&(i.allowOverride=!1),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const c in s){const u=s[c];delete u.metadata,o.push(u)}return o}if(n){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let i=null;if(n!==null){const r=n.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=n[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,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++}}const ks=new me,Rg=new me,df=new me,xa=new me,kg=new me,ff=new me,Lg=new me;class v6{constructor(e=new me,n=new me(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ks)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const i=n.dot(this.direction);return i<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=ks.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(ks.copy(this.origin).addScaledVector(this.direction,n),ks.distanceToSquared(e))}distanceSqToSegment(e,n,i,r){Rg.copy(e).add(n).multiplyScalar(.5),df.copy(n).sub(e).normalize(),xa.copy(this.origin).sub(Rg);const s=e.distanceTo(n)*.5,o=-this.direction.dot(df),c=xa.dot(this.direction),u=-xa.dot(df),d=xa.lengthSq(),h=Math.abs(1-o*o);let p,m,v,_;if(h>0)if(p=o*u-c,m=o*c-u,_=s*h,p>=0)if(m>=-_)if(m<=_){const w=1/h;p*=w,m*=w,v=p*(p+o*m+2*c)+m*(o*p+m+2*u)+d}else m=s,p=Math.max(0,-(o*m+c)),v=-p*p+m*(m+2*u)+d;else m=-s,p=Math.max(0,-(o*m+c)),v=-p*p+m*(m+2*u)+d;else m<=-_?(p=Math.max(0,-(-o*s+c)),m=p>0?-s:Math.min(Math.max(-s,-u),s),v=-p*p+m*(m+2*u)+d):m<=_?(p=0,m=Math.min(Math.max(-s,-u),s),v=m*(m+2*u)+d):(p=Math.max(0,-(o*s+c)),m=p>0?s:Math.min(Math.max(-s,-u),s),v=-p*p+m*(m+2*u)+d);else m=o>0?-s:s,p=Math.max(0,-(o*m+c)),v=-p*p+m*(m+2*u)+d;return i&&i.copy(this.origin).addScaledVector(this.direction,p),r&&r.copy(Rg).addScaledVector(df,m),v}intersectSphere(e,n){ks.subVectors(e.center,this.origin);const i=ks.dot(this.direction),r=ks.dot(ks)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),c=i-o,u=i+o;return u<0?null:c<0?this.at(u,n):this.at(c,n)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/n;return i>=0?i:null}intersectPlane(e,n){const i=this.distanceToPlane(e);return i===null?null:this.at(i,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let i,r,s,o,c,u;const d=1/this.direction.x,h=1/this.direction.y,p=1/this.direction.z,m=this.origin;return d>=0?(i=(e.min.x-m.x)*d,r=(e.max.x-m.x)*d):(i=(e.max.x-m.x)*d,r=(e.min.x-m.x)*d),h>=0?(s=(e.min.y-m.y)*h,o=(e.max.y-m.y)*h):(s=(e.max.y-m.y)*h,o=(e.min.y-m.y)*h),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o<r||isNaN(r))&&(r=o),p>=0?(c=(e.min.z-m.z)*p,u=(e.max.z-m.z)*p):(c=(e.max.z-m.z)*p,u=(e.min.z-m.z)*p),i>u||c>r)||((c>i||i!==i)&&(i=c),(u<r||r!==r)&&(r=u),r<0)?null:this.at(i>=0?i:r,n)}intersectsBox(e){return this.intersectBox(e,ks)!==null}intersectTriangle(e,n,i,r,s){kg.subVectors(n,e),ff.subVectors(i,e),Lg.crossVectors(kg,ff);let o=this.direction.dot(Lg),c;if(o>0){if(r)return null;c=1}else if(o<0)c=-1,o=-o;else return null;xa.subVectors(this.origin,e);const u=c*this.direction.dot(ff.crossVectors(xa,ff));if(u<0)return null;const d=c*this.direction.dot(kg.cross(xa));if(d<0||u+d>o)return null;const h=-c*xa.dot(Lg);return h<0?null:this.at(h/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 bP extends Gh{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Tn(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.envMapRotation=new Co,this.combine=JC,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.envMapRotation.copy(e.envMapRotation),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 V1=new Kn,no=new v6,hf=new a_,H1=new me,pf=new me,mf=new me,gf=new me,Dg=new me,vf=new me,G1=new me,yf=new me;let ds=class extends er{constructor(e=new gs,n=new bP){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const n=this.geometry.morphAttributes,i=Object.keys(n);if(i.length>0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const c=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[c]=s}}}}getVertexPosition(e,n){const i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,o=i.morphTargetsRelative;n.fromBufferAttribute(r,e);const c=this.morphTargetInfluences;if(s&&c){vf.set(0,0,0);for(let u=0,d=s.length;u<d;u++){const h=c[u],p=s[u];h!==0&&(Dg.fromBufferAttribute(p,e),o?vf.addScaledVector(Dg,h):vf.addScaledVector(Dg.sub(n),h))}n.add(vf)}return n}raycast(e,n){const i=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),hf.copy(i.boundingSphere),hf.applyMatrix4(s),no.copy(e.ray).recast(e.near),!(hf.containsPoint(no.origin)===!1&&(no.intersectSphere(hf,H1)===null||no.origin.distanceToSquared(H1)>(e.far-e.near)**2))&&(V1.copy(s).invert(),no.copy(e.ray).applyMatrix4(V1),!(i.boundingBox!==null&&no.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,n,no)))}_computeIntersections(e,n,i){let r;const s=this.geometry,o=this.material,c=s.index,u=s.attributes.position,d=s.attributes.uv,h=s.attributes.uv1,p=s.attributes.normal,m=s.groups,v=s.drawRange;if(c!==null)if(Array.isArray(o))for(let _=0,w=m.length;_<w;_++){const y=m[_],b=o[y.materialIndex],T=Math.max(y.start,v.start),A=Math.min(c.count,Math.min(y.start+y.count,v.start+v.count));for(let M=T,I=A;M<I;M+=3){const k=c.getX(M),U=c.getX(M+1),S=c.getX(M+2);r=_f(this,b,e,i,d,h,p,k,U,S),r&&(r.faceIndex=Math.floor(M/3),r.face.materialIndex=y.materialIndex,n.push(r))}}else{const _=Math.max(0,v.start),w=Math.min(c.count,v.start+v.count);for(let y=_,b=w;y<b;y+=3){const T=c.getX(y),A=c.getX(y+1),M=c.getX(y+2);r=_f(this,o,e,i,d,h,p,T,A,M),r&&(r.faceIndex=Math.floor(y/3),n.push(r))}}else if(u!==void 0)if(Array.isArray(o))for(let _=0,w=m.length;_<w;_++){const y=m[_],b=o[y.materialIndex],T=Math.max(y.start,v.start),A=Math.min(u.count,Math.min(y.start+y.count,v.start+v.count));for(let M=T,I=A;M<I;M+=3){const k=M,U=M+1,S=M+2;r=_f(this,b,e,i,d,h,p,k,U,S),r&&(r.faceIndex=Math.floor(M/3),r.face.materialIndex=y.materialIndex,n.push(r))}}else{const _=Math.max(0,v.start),w=Math.min(u.count,v.start+v.count);for(let y=_,b=w;y<b;y+=3){const T=y,A=y+1,M=y+2;r=_f(this,o,e,i,d,h,p,T,A,M),r&&(r.faceIndex=Math.floor(y/3),n.push(r))}}}};function y6(t,e,n,i,r,s,o,c){let u;if(e.side===Gi?u=i.intersectTriangle(o,s,r,!0,c):u=i.intersectTriangle(r,s,o,e.side===Ua,c),u===null)return null;yf.copy(c),yf.applyMatrix4(t.matrixWorld);const d=n.ray.origin.distanceTo(yf);return d<n.near||d>n.far?null:{distance:d,point:yf.clone(),object:t}}function _f(t,e,n,i,r,s,o,c,u,d){t.getVertexPosition(c,pf),t.getVertexPosition(u,mf),t.getVertexPosition(d,gf);const h=y6(t,e,n,i,pf,mf,gf,G1);if(h){const p=new me;jc.getBarycoord(G1,pf,mf,gf,p),r&&(h.uv=jc.getInterpolatedAttribute(r,c,u,d,p,new bn)),s&&(h.uv1=jc.getInterpolatedAttribute(s,c,u,d,p,new bn)),o&&(h.normal=jc.getInterpolatedAttribute(o,c,u,d,p,new me),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const m={a:c,b:u,c:d,normal:new me,materialIndex:0};jc.getNormal(pf,mf,gf,m.normal),h.face=m,h.barycoord=p}return h}class _6 extends Li{constructor(e=null,n=1,i=1,r,s,o,c,u,d=mi,h=mi,p,m){super(null,o,c,u,d,h,r,s,p,m),this.isDataTexture=!0,this.image={data:e,width:n,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Ng=new me,x6=new me,b6=new Wt;class oo{constructor(e=new me(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,i,r){return this.normal.set(e,n,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,i){const r=Ng.subVectors(i,n).cross(x6.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const i=e.delta(Ng),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:n.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const n=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return n<0&&i>0||i<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const i=n||b6.getNormalMatrix(e),r=this.coplanarPoint(Ng).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.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 io=new a_,S6=new bn(.5,.5),xf=new me;class SP{constructor(e=new oo,n=new oo,i=new oo,r=new oo,s=new oo,o=new oo){this.planes=[e,n,i,r,s,o]}set(e,n,i,r,s,o){const c=this.planes;return c[0].copy(e),c[1].copy(n),c[2].copy(i),c[3].copy(r),c[4].copy(s),c[5].copy(o),this}copy(e){const n=this.planes;for(let i=0;i<6;i++)n[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,n=es,i=!1){const r=this.planes,s=e.elements,o=s[0],c=s[1],u=s[2],d=s[3],h=s[4],p=s[5],m=s[6],v=s[7],_=s[8],w=s[9],y=s[10],b=s[11],T=s[12],A=s[13],M=s[14],I=s[15];if(r[0].setComponents(d-o,v-h,b-_,I-T).normalize(),r[1].setComponents(d+o,v+h,b+_,I+T).normalize(),r[2].setComponents(d+c,v+p,b+w,I+A).normalize(),r[3].setComponents(d-c,v-p,b-w,I-A).normalize(),i)r[4].setComponents(u,m,y,M).normalize(),r[5].setComponents(d-u,v-m,b-y,I-M).normalize();else if(r[4].setComponents(d-u,v-m,b-y,I-M).normalize(),n===es)r[5].setComponents(d+u,v+m,b+y,I+M).normalize();else if(n===wh)r[5].setComponents(u,m,y,M).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),io.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),io.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(io)}intersectsSprite(e){io.center.set(0,0,0);const n=S6.distanceTo(e.center);return io.radius=.7071067811865476+n,io.applyMatrix4(e.matrixWorld),this.intersectsSphere(io)}intersectsSphere(e){const n=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(n[s].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){const n=this.planes;for(let i=0;i<6;i++){const r=n[i];if(xf.x=r.normal.x>0?e.max.x:e.min.x,xf.y=r.normal.y>0?e.max.y:e.min.y,xf.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(xf)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let i=0;i<6;i++)if(n[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class wP extends Li{constructor(e=[],n=To,i,r,s,o,c,u,d,h){super(e,n,i,r,s,o,c,u,d,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Su extends Li{constructor(e,n,i=us,r,s,o,c=mi,u=mi,d,h=Gs,p=1){if(h!==Gs&&h!==go)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const m={width:e,height:n,depth:p};super(m,r,s,o,c,u,h,i,d),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new s_(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class w6 extends Su{constructor(e,n=us,i=To,r,s,o=mi,c=mi,u,d=Gs){const h={width:e,height:e,depth:1},p=[h,h,h,h,h,h];super(e,e,n,i,r,s,o,c,u,d),this.image=p,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class EP extends Li{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class Bu extends gs{constructor(e=1,n=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const c=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const u=[],d=[],h=[],p=[];let m=0,v=0;_("z","y","x",-1,-1,i,n,e,o,s,0),_("z","y","x",1,-1,i,n,-e,o,s,1),_("x","z","y",1,1,e,i,n,r,o,2),_("x","z","y",1,-1,e,i,-n,r,o,3),_("x","y","z",1,-1,e,n,i,r,s,4),_("x","y","z",-1,-1,e,n,-i,r,s,5),this.setIndex(u),this.setAttribute("position",new zs(d,3)),this.setAttribute("normal",new zs(h,3)),this.setAttribute("uv",new zs(p,2));function _(w,y,b,T,A,M,I,k,U,S,P){const V=M/U,O=I/S,G=M/2,J=I/2,H=k/2,X=U+1,K=S+1;let Q=0,W=0;const q=new me;for(let Z=0;Z<K;Z++){const z=Z*O-J;for(let ie=0;ie<X;ie++){const Ee=ie*V-G;q[w]=Ee*T,q[y]=z*A,q[b]=H,d.push(q.x,q.y,q.z),q[w]=0,q[y]=0,q[b]=k>0?1:-1,h.push(q.x,q.y,q.z),p.push(ie/U),p.push(1-Z/S),Q+=1}}for(let Z=0;Z<S;Z++)for(let z=0;z<U;z++){const ie=m+z+X*Z,Ee=m+z+X*(Z+1),ze=m+(z+1)+X*(Z+1),Se=m+(z+1)+X*Z;u.push(ie,Ee,Se),u.push(Ee,ze,Se),W+=6}c.addGroup(v,W,P),v+=W,m+=Q}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Bu(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class jh extends gs{constructor(e=1,n=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:n,widthSegments:i,heightSegments:r};const s=e/2,o=n/2,c=Math.floor(i),u=Math.floor(r),d=c+1,h=u+1,p=e/c,m=n/u,v=[],_=[],w=[],y=[];for(let b=0;b<h;b++){const T=b*m-o;for(let A=0;A<d;A++){const M=A*p-s;_.push(M,-T,0),w.push(0,0,1),y.push(A/c),y.push(1-b/u)}}for(let b=0;b<u;b++)for(let T=0;T<c;T++){const A=T+d*b,M=T+d*(b+1),I=T+1+d*(b+1),k=T+1+d*b;v.push(A,M,k),v.push(M,I,k)}this.setIndex(v),this.setAttribute("position",new zs(_,3)),this.setAttribute("normal",new zs(w,3)),this.setAttribute("uv",new zs(y,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new jh(e.width,e.height,e.widthSegments,e.heightSegments)}}function Xl(t){const e={};for(const n in t){e[n]={};for(const i in t[n]){const r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(Gt("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][i]=null):e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}}return e}function Ci(t){const e={};for(let n=0;n<t.length;n++){const i=Xl(t[n]);for(const r in i)e[r]=i[r]}return e}function E6(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}function MP(t){const e=t.getRenderTarget();return e===null?t.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:fn.workingColorSpace}const M6={clone:Xl,merge:Ci};var T6=`void main() {
611
611
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
612
612
  }`,A6=`void main() {
613
613
  gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
@@ -4962,4 +4962,4 @@ void main() {
4962
4962
  vec4 color;
4963
4963
  mainImage(color, gl_FragCoord.xy);
4964
4964
  gl_FragColor = color;
4965
- }`;function n$({raysOrigin:t="top-center",raysColor:e="#ffffff",raysSpeed:n=1,lightSpread:i=1,rayLength:r=2,pulsating:s=!1,fadeDistance:o=1,saturation:c=1,followMouse:u=!0,mouseInfluence:d=.1,noiseAmount:h=0,distortion:p=0,className:m=""}){const v=L.useRef(null),_=L.useRef(null),w=L.useRef(null),y=L.useRef({x:.5,y:.5}),b=L.useRef({x:.5,y:.5}),T=L.useRef(null),A=L.useRef(null),M=L.useRef(null),[I,k]=L.useState(!1),U=L.useRef(null);return L.useEffect(()=>{if(v.current)return U.current=new IntersectionObserver(S=>{k(S[0].isIntersecting)},{threshold:.1}),U.current.observe(v.current),()=>{U.current&&(U.current.disconnect(),U.current=null)}},[]),L.useEffect(()=>!I||!v.current?void 0:(M.current&&(M.current(),M.current=null),(async()=>{if(!v.current||(await new Promise(Q=>setTimeout(Q,10)),!v.current))return;const P=new e7({dpr:Math.min(window.devicePixelRatio,2),alpha:!0});w.current=P;const V=P.gl;for(V.canvas.style.width="100%",V.canvas.style.height="100%";v.current.firstChild;)v.current.removeChild(v.current.firstChild);v.current.appendChild(V.canvas);const O={iTime:{value:0},iResolution:{value:[1,1]},rayPos:{value:[0,0]},rayDir:{value:[0,1]},raysColor:{value:LE(e)},raysSpeed:{value:n},lightSpread:{value:i},rayLength:{value:r},pulsating:{value:s?1:0},fadeDistance:{value:o},saturation:{value:c},mousePos:{value:[.5,.5]},mouseInfluence:{value:d},noiseAmount:{value:h},distortion:{value:p}};_.current=O;const G=new Q7(V),J=new YW(V,{vertex:e$,fragment:t$,uniforms:O}),H=new J7(V,{geometry:G,program:J});A.current=H;const X=()=>{if(!v.current||!P)return;P.dpr=Math.min(window.devicePixelRatio,2);const{clientWidth:Q,clientHeight:W}=v.current;P.setSize(Q,W);const q=P.dpr,Z=Q*q,z=W*q;O.iResolution.value=[Z,z];const{anchor:ie,dir:Ee}=DE(t,Z,z);O.rayPos.value=ie,O.rayDir.value=Ee},K=Q=>{if(!(!w.current||!_.current||!A.current)){O.iTime.value=Q*.001,u&&d>0&&(b.current.x=b.current.x*.92+y.current.x*(1-.92),b.current.y=b.current.y*.92+y.current.y*(1-.92),O.mousePos.value=[b.current.x,b.current.y]);try{P.render({scene:H}),T.current=requestAnimationFrame(K)}catch(W){console.warn("WebGL rendering error:",W)}}};window.addEventListener("resize",X),X(),T.current=requestAnimationFrame(K),M.current=()=>{if(T.current&&(cancelAnimationFrame(T.current),T.current=null),window.removeEventListener("resize",X),P)try{const Q=P.gl.getExtension("WEBGL_lose_context");Q&&Q.loseContext();const W=P.gl.canvas;W&&W.parentNode&&W.parentNode.removeChild(W)}catch(Q){console.warn("Error during WebGL cleanup:",Q)}w.current=null,_.current=null,A.current=null}})(),()=>{M.current&&(M.current(),M.current=null)}),[I,t,e,n,i,r,s,o,c,u,d,h,p]),L.useEffect(()=>{if(!_.current||!v.current||!w.current)return;const S=_.current,P=w.current;S.raysColor.value=LE(e),S.raysSpeed.value=n,S.lightSpread.value=i,S.rayLength.value=r,S.pulsating.value=s?1:0,S.fadeDistance.value=o,S.saturation.value=c,S.mouseInfluence.value=d,S.noiseAmount.value=h,S.distortion.value=p;const{clientWidth:V,clientHeight:O}=v.current,G=P.dpr,{anchor:J,dir:H}=DE(t,V*G,O*G);S.rayPos.value=J,S.rayDir.value=H},[e,n,i,t,r,s,o,c,d,h,p]),L.useEffect(()=>{if(!u)return;const S=P=>{if(!v.current)return;const V=v.current.getBoundingClientRect();y.current={x:(P.clientX-V.left)/V.width,y:(P.clientY-V.top)/V.height}};return window.addEventListener("mousemove",S),()=>window.removeEventListener("mousemove",S)},[u]),F.jsx("div",{ref:v,className:`w-full h-full pointer-events-none z-[3] overflow-hidden relative ${m}`.trim()})}function i$({className:t}){return F.jsx("svg",{viewBox:"0 0 384 512",className:t,fill:"currentColor",children:F.jsx("path",{d:"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"})})}function r$({className:t}){return F.jsx("svg",{viewBox:"0 0 16 16",className:t,fill:"currentColor",children:F.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})})}function s$({className:t}){return F.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[F.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),F.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function a$({className:t}){return F.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:F.jsx("polyline",{points:"20 6 9 17 4 12"})})}const NE="https://github.com/mm7894215/TokenTracker",o$="https://github.com/mm7894215/TokenTracker/releases/latest";function l$(t="default",e="md",n){const i="inline-flex items-center justify-center rounded font-medium transition-colors duration-200 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-oai-gray-950",r={default:"bg-oai-gray-900 text-white hover:bg-oai-gray-800 active:bg-oai-gray-950 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 dark:active:bg-oai-gray-200",ghost:"text-oai-gray-600 hover:text-oai-gray-900 hover:bg-oai-gray-100 active:bg-oai-gray-200 dark:text-oai-gray-400 dark:hover:text-white dark:hover:bg-oai-gray-800 dark:active:bg-oai-gray-700"},s={sm:"h-9 px-4 text-sm",md:"h-11 px-6 text-sm",lg:"h-12 px-8 text-base"};return Mn(i,r[t],s[e],n)}function c$({copy:t,signInUrl:e,signUpUrl:n,installCommand:i,installCopied:r,onCopyInstallCommand:s}){const o=Lz(),[c,u]=L.useState(!1);L.useEffect(()=>{const w=()=>u(window.scrollY>10);return window.addEventListener("scroll",w,{passive:!0}),()=>window.removeEventListener("scroll",w)},[]);const d=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),{signedIn:h,loading:p}=Do(),m=L.useMemo(()=>({codex:t("landing.v2.models.agent.codex"),claude_code:t("landing.v2.models.agent.claude_code"),cursor:t("landing.v2.models.agent.cursor"),gemini:t("landing.v2.models.agent.gemini"),opencode:t("landing.v2.models.agent.opencode"),openclaw:t("landing.v2.models.agent.openclaw")}),[t]),v=L.useMemo(()=>[{id:"codex",icon:"/brand-logos/codex.svg"},{id:"claude_code",icon:"/brand-logos/claude-code.svg"},{id:"cursor",icon:"/brand-logos/cursor.svg"},{id:"gemini",icon:"/brand-logos/gemini.svg"},{id:"opencode",icon:"/brand-logos/opencode.svg"},{id:"openclaw",icon:"/brand-logos/openclaw.svg"}],[]),_=o?{duration:0}:void 0;return F.jsxs("div",{className:"relative min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark",children:[F.jsx("div",{className:"absolute inset-0 z-0 pointer-events-none",style:{height:"100vh"},children:F.jsx(n$,{raysOrigin:"top-center",raysColor:"#b8b3ff",raysSpeed:1,lightSpread:.5,rayLength:3,pulsating:!1,fadeDistance:1,saturation:1,followMouse:!0,mouseInfluence:.1,noiseAmount:0,distortion:0})}),F.jsx("header",{className:Mn("sticky top-0 z-50 transition-all duration-300",c?"bg-oai-gray-950/80 backdrop-blur-md border-b border-oai-gray-900":"bg-transparent border-b border-transparent"),children:F.jsxs("div",{className:"mx-auto flex h-14 max-w-7xl items-center justify-between px-4 sm:px-6",children:[F.jsxs("div",{className:"flex items-center gap-5",children:[F.jsxs(Us,{to:n||"/",className:"flex items-center gap-3 no-underline outline-none rounded focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:ring-offset-oai-gray-950 transition-opacity hover:opacity-80",children:[F.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),F.jsx("span",{className:"text-sm font-semibold tracking-wide text-white uppercase",children:"Token Tracker"})]}),F.jsx("div",{className:"hidden sm:block",children:F.jsx(hH,{})})]}),d&&F.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2 sm:gap-3",children:[F.jsxs(Us,{to:fH(),className:Mn(l$(h||p?"default":"ghost","sm"),"no-underline px-5 rounded-full group",h||p?"shadow-sm ring-1 ring-white/10":"ring-1 ring-oai-gray-700"),children:[t("landing.v2.cta.primary"),F.jsx("span",{className:"ml-2 inline-block transition-transform duration-200 group-hover:translate-x-0.5",children:"→"})]}),F.jsx(H0,{})]})]})}),F.jsxs("main",{children:[F.jsx("section",{className:"relative py-16 sm:py-24 lg:py-32 overflow-hidden",children:F.jsxs("div",{className:"relative z-10 mx-auto max-w-7xl px-4 sm:px-6 flex flex-col items-center text-center gap-20 lg:gap-36",children:[F.jsxs(Il.div,{initial:o?!1:{opacity:0,y:20},animate:{opacity:1,y:0},transition:_||{duration:.5},className:"w-full max-w-3xl relative z-20",children:[F.jsxs("h1",{className:"text-balance text-5xl font-semibold tracking-tight text-white sm:text-6xl lg:text-[4rem] lg:leading-[1.05]",children:[t("landing.v2.hero.title_line1"),F.jsx("br",{}),F.jsx("span",{className:"bg-gradient-to-b from-white via-oai-gray-200 to-oai-gray-500 bg-clip-text text-transparent font-bold tracking-tight",style:{WebkitTextStroke:"1px rgba(255, 255, 255, 0.15)"},children:t("landing.v2.hero.title_line2")})]}),F.jsx("p",{className:"mt-6 text-lg leading-relaxed text-oai-gray-400",children:t("landing.v2.hero.subtagline")}),F.jsxs("div",{className:"mt-8 w-full max-w-lg mx-auto",children:[F.jsxs(Il.div,{whileHover:{scale:1.01,y:-1},transition:{type:"spring",stiffness:400,damping:25},className:"group relative inline-block w-full overflow-hidden rounded-2xl",style:{padding:"1.5px 0"},children:[F.jsx("div",{className:"absolute w-[300%] h-[50%] opacity-70 bottom-[-11px] right-[-250%] rounded-full animate-star-movement-bottom z-0",style:{background:"radial-gradient(circle, #fbdfff, transparent 10%)",animationDuration:"6s"}}),F.jsx("div",{className:"absolute w-[300%] h-[50%] opacity-70 top-[-10px] left-[-250%] rounded-full animate-star-movement-top z-0",style:{background:"radial-gradient(circle, #fbdfff, transparent 10%)",animationDuration:"6s"}}),F.jsxs("div",{className:"relative z-[1] flex items-center justify-between w-full bg-[#0a0a0a] border border-oai-gray-800 rounded-2xl p-1.5 pl-5 shadow-2xl shadow-black/50",children:[F.jsxs("div",{className:"flex items-center gap-3 overflow-hidden",children:[F.jsx("span",{className:"text-oai-gray-600 font-mono select-none","aria-hidden":"true",children:"›"}),F.jsx("code",{className:"font-mono text-sm text-oai-gray-200 overflow-x-auto whitespace-nowrap py-2 [scrollbar-width:none]",children:i?i.split(" ").map((w,y)=>F.jsxs("span",{className:w==="npx"||w==="tokentracker-cli"?"text-white font-medium":w==="--yes"?"text-oai-gray-500":"text-oai-brand-400",children:[w," "]},y)):null})]}),F.jsx("button",{type:"button",onClick:s,"aria-label":t(r?"landing.install.action.copied":"landing.install.action.copy"),className:"shrink-0 flex h-9 w-9 items-center justify-center text-oai-gray-200 bg-oai-gray-900 border border-oai-gray-700 rounded-lg hover:bg-oai-gray-800 hover:text-white active:scale-95 transition-all duration-200 shadow-sm",children:r?F.jsx(a$,{className:"h-4 w-4 text-green-400","aria-hidden":!0}):F.jsx(s$,{className:"h-4 w-4 opacity-70","aria-hidden":!0})})]})]}),F.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-x-6 gap-y-4",children:[F.jsxs("a",{href:o$,target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-2 text-sm font-medium text-oai-gray-400 hover:text-white transition-colors",children:[F.jsx("div",{className:"flex items-center justify-center h-8 w-8 rounded-full bg-oai-gray-800 group-hover:bg-oai-gray-700 transition-colors",children:F.jsx(i$,{className:"h-4 w-4 text-oai-gray-400 group-hover:text-white"})}),t("landing.v2.install.mac_cta")]}),F.jsxs("a",{href:NE,target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-2 text-sm font-medium text-oai-gray-400 hover:text-white transition-colors",children:[F.jsx("div",{className:"flex items-center justify-center h-8 w-8 rounded-full bg-oai-gray-800 group-hover:bg-oai-gray-700 transition-colors",children:F.jsx(r$,{className:"h-4 w-4 text-oai-gray-400 group-hover:text-white"})}),t("landing.cta.secondary")]})]}),F.jsx("span",{className:"sr-only","aria-live":"polite",children:r?t("landing.install.action.copied"):""})]})]}),F.jsx("div",{className:"relative group w-full",children:F.jsxs(Il.div,{initial:o?!1:{opacity:0,y:24},animate:{opacity:1,y:0},transition:_||{duration:.6,delay:.1},className:"relative w-full",children:[F.jsx("div",{style:{position:"absolute",top:"-256px",left:0,right:0,height:"510px",zIndex:3,pointerEvents:"none"},children:F.jsx(PW,{color:"#8a7aff",wispDensity:2,flowSpeed:.28,verticalSizing:2.2,horizontalSizing:1.22,fogIntensity:4,fogScale:.1,wispSpeed:18,wispIntensity:10,flowStrength:.12,decay:1.1,falloffStart:1.1,fogFallSpeed:.5,horizontalBeamOffset:.22,verticalBeamOffset:0,style:{width:"100%",height:"100%"}})}),F.jsx("div",{className:"relative rounded-xl p-[1px] shadow-2xl bg-gradient-to-b from-[rgba(138,122,255,0.6)] via-[rgba(138,122,255,0.15)] to-[rgba(138,122,255,0.05)]",style:{position:"relative",zIndex:10,boxShadow:"0 20px 60px -10px rgba(138,122,255,0.15), 0 4px 20px rgba(0,0,0,0.4)"},children:F.jsxs("div",{className:"relative rounded-[11px] overflow-hidden bg-oai-gray-950",children:[F.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"180px",background:"linear-gradient(to bottom, rgba(138,122,255,0.35) 0%, rgba(138,122,255,0.12) 40%, transparent 100%)",mixBlendMode:"screen",zIndex:20,pointerEvents:"none"}}),F.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"1px",background:"linear-gradient(90deg, transparent 0%, rgba(138,122,255,0.9) 30%, rgba(180,168,255,1) 50%, rgba(138,122,255,0.9) 70%, transparent 100%)",zIndex:25,pointerEvents:"none"}}),F.jsx("img",{src:"/dashboard-dark.png",alt:t("landing.screenshot.alt"),className:"block h-auto w-full object-cover",style:{position:"relative",zIndex:10},loading:"eager",decoding:"async"})]})})]})})]})}),F.jsx("section",{className:"border-y border-oai-gray-900 bg-oai-gray-950/50 py-12 lg:py-16",children:F.jsx("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:F.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-8",children:[F.jsx("p",{className:"text-sm font-semibold uppercase tracking-wider text-oai-gray-400 shrink-0",children:t("landing.v2.models.title")}),F.jsx("div",{className:"flex flex-wrap items-center gap-x-8 gap-y-6 opacity-60 hover:opacity-100 transition-opacity duration-500 grayscale hover:grayscale-0",children:v.map(w=>F.jsxs("div",{className:"flex items-center gap-2.5 transition-transform hover:-translate-y-0.5 duration-300",children:[F.jsx("img",{src:w.icon,alt:"",width:20,height:20,className:`h-5 w-5 object-contain ${w.id==="cursor"?"dark:invert":""}`,loading:"lazy"}),F.jsx("span",{className:"text-sm font-medium text-oai-gray-300",children:m[w.id]})]},w.id))})]})})}),F.jsx("section",{className:"py-20 lg:py-32",children:F.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6 grid grid-cols-1 md:grid-cols-2 gap-16 lg:gap-24 items-start",children:[F.jsxs("div",{className:"max-w-md",children:[F.jsx("p",{className:"text-xs font-bold tracking-widest uppercase text-oai-brand-500 mb-4",children:t("landing.v2.compare.kicker")}),F.jsx("h2",{className:"text-3xl font-semibold tracking-tight text-white sm:text-4xl text-balance",children:t("landing.v2.compare.title")}),F.jsx("p",{className:"mt-6 text-lg leading-relaxed text-oai-gray-400",children:t("landing.v2.compare.subtitle")}),F.jsx("p",{className:"mt-6 text-base leading-relaxed text-oai-gray-500",children:t("landing.v2.distill.body")})]}),F.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-10",children:[F.jsxs("div",{className:"space-y-4",children:[F.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wider text-white border-b border-oai-gray-800 pb-3",children:t("landing.v2.compare.with.title")}),F.jsxs("ul",{className:"space-y-3 text-sm text-oai-gray-400",children:[F.jsxs("li",{className:"flex gap-2",children:[F.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),F.jsx("span",{children:t("landing.v2.compare.with.p1")})]}),F.jsxs("li",{className:"flex gap-2",children:[F.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),F.jsx("span",{children:t("landing.v2.compare.with.p2")})]}),F.jsxs("li",{className:"flex gap-2",children:[F.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),F.jsx("span",{children:t("landing.v2.compare.with.p3")})]})]})]}),F.jsxs("div",{className:"space-y-4",children:[F.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wider text-oai-gray-500 border-b border-oai-gray-800/50 pb-3",children:t("landing.v2.compare.without.title")}),F.jsxs("ul",{className:"space-y-3 text-sm text-oai-gray-500",children:[F.jsxs("li",{className:"flex gap-2",children:[F.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),F.jsx("span",{children:t("landing.v2.compare.without.p1")})]}),F.jsxs("li",{className:"flex gap-2",children:[F.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),F.jsx("span",{children:t("landing.v2.compare.without.p2")})]}),F.jsxs("li",{className:"flex gap-2",children:[F.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),F.jsx("span",{children:t("landing.v2.compare.without.p3")})]})]})]})]})]})})]}),F.jsx("footer",{className:"border-t border-oai-gray-900 bg-oai-gray-950 py-12",children:F.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col items-center justify-between gap-6 px-4 sm:px-6 text-sm text-oai-gray-400 sm:flex-row",children:[F.jsx("p",{children:t("landing.v2.footer.line")}),F.jsxs("div",{className:"flex items-center gap-6",children:[F.jsx("a",{href:NE,className:"font-medium text-oai-gray-400 hover:text-white transition-colors",target:"_blank",rel:"noopener noreferrer",children:t("landing.v2.nav.github")}),d&&F.jsxs(Us,{to:e,className:"font-medium text-oai-brand-500 hover:text-oai-brand-400 transition-colors",children:[t("landing.cta.primary")," →"]})]})]})})]})}function u$({prefersReducedMotion:t,screenshotMode:e}){return!(e||t)}function d$(){return L.useMemo(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,[])}function f$(t=0,e=!0){const[n,i]=L.useState(()=>!e);return L.useEffect(()=>{if(!e){i(!0);return}let r=null,s=null;const o=()=>i(!0);return typeof window<"u"&&"requestIdleCallback"in window?(s=window.requestIdleCallback(o,{timeout:t||200}),()=>{typeof window.cancelIdleCallback=="function"&&s!=null&&window.cancelIdleCallback(s)}):(r=window.setTimeout(o,t),()=>{r!=null&&window.clearTimeout(r)})},[t,e]),n}function h$({signInUrl:t,signUpUrl:e}){const n=Ct("landing.handle.special"),i=Ct("landing.handle.default");Ct("landing.nav.login"),Ct("landing.nav.signup");const[r,s]=L.useState(i),o=d$(),c=L.useMemo(()=>typeof window>"u"?!1:$C(window.location.search),[]),u=u$({prefersReducedMotion:o,screenshotMode:c});f$(250,u);const d="tokentracker.dashboard.from_landing.v1";L.useEffect(()=>{if(!(typeof window>"u"))try{window.sessionStorage.setItem(d,"1")}catch{}},[d]),L.useMemo(()=>Ct("landing.handle.placeholder",{handle:n}),[n]),L.useMemo(()=>{const _=Ct(r===n?"landing.rank.singularity":"landing.rank.unranked");return Ct("landing.rank.expectation",{rank:_})},[r,n]);const h=Ct("landing.install.command"),[p,m]=L.useState(!1),v=async()=>{await uH(h)&&(m(!0),window.setTimeout(()=>m(!1),2e3))};return F.jsx(c$,{copy:Ct,reduceMotion:o,signInUrl:t,signUpUrl:e,installCommand:h,installCopied:p,onCopyInstallCommand:v})}function p$(t){const e=new URLSearchParams(t).get("next");return typeof e!="string"||e.length===0||!e.startsWith("/")||e.startsWith("//")?"/dashboard":e}const IE={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",linkedin:"LinkedIn",facebook:"Facebook",instagram:"Instagram",tiktok:"TikTok",apple:"Apple",x:"X",spotify:"Spotify"};function UE(t){const e=String(t||"").trim();return IE[e]?IE[e]:e.replace(/-/g," ")}function m$(){const t=Au(),[e,n]=WL(),{enabled:i,loading:r,signedIn:s,refreshUser:o,signInWithPassword:c,signUp:u,signInWithOAuth:d,getPublicAuthConfig:h}=Do(),p=L.useMemo(()=>p$(e.toString()),[e]),[m,v]=L.useState("signin"),[_,w]=L.useState(""),[y,b]=L.useState(""),[T,A]=L.useState(""),[M,I]=L.useState(!1),[k,U]=L.useState(null),[S,P]=L.useState(null),[V,O]=L.useState(!0),[G,J]=L.useState([]),[H,X]=L.useState([]),[K,Q]=L.useState(8);L.useEffect(()=>{const Se=e.get("insforge_status"),ne=e.get("insforge_type"),ye=e.get("insforge_error");Se==="success"&&ne==="verify_email"?P(Ct("login.verify_email_success")):Se==="error"&&ne==="verify_email"&&ye&&P(Ct("shared.error.prefix",{error:ye}))},[e]),L.useEffect(()=>{if(!i){O(!1);return}let Se=!0;return(async()=>{const{data:ne,error:ye}=await h();Se&&(ye||!ne?(J(["google","github"]),X([])):(J(Array.isArray(ne.oAuthProviders)?ne.oAuthProviders:[]),X(Array.isArray(ne.customOAuthProviders)?ne.customOAuthProviders:[]),typeof ne.passwordMinLength=="number"&&ne.passwordMinLength>0&&Q(ne.passwordMinLength)),O(!1))})(),()=>{Se=!1}},[i,h]),L.useEffect(()=>{if(!(!i||r)&&s){if(W){window.location.href="/auth/native-callback";return}t(p,{replace:!0})}},[i,r,s,t,p,W]),L.useEffect(()=>{i&&o()},[i,o]);const W=L.useMemo(()=>e.get("native")==="1",[e]),q=L.useMemo(()=>e.get("provider")||null,[e]),Z=L.useMemo(()=>typeof window>"u"||W?"":`${window.location.origin}/`,[W]),z=L.useMemo(()=>typeof window>"u"?"":`${window.location.origin}/`,[]),ie=L.useCallback(async Se=>{Se.preventDefault(),U(null),I(!0);try{if(m==="signup"){const{data:ye,error:be}=await u({email:_.trim(),password:y,name:T.trim()||void 0,redirectTo:z});if(be){U(be.message||String(be));return}if(ye?.requireEmailVerification){P(Ct("login.verify_email_pending")),v("signin");return}t(p,{replace:!0});return}const{error:ne}=await c({email:_.trim(),password:y});if(ne){U(ne.message||String(ne));return}t(p,{replace:!0})}finally{I(!1)}},[m,_,y,T,u,c,t,p,z]),Ee=L.useCallback(async Se=>{U(null),I(!0);try{const{error:ne}=await d(Se,Z);ne&&U(ne.message||String(ne))}finally{I(!1)}},[d,Z]);L.useEffect(()=>{if(W&&typeof window<"u")try{window.sessionStorage.setItem("tokentracker_native_login","1")}catch{}},[W]),L.useEffect(()=>{if(!i||r||s||V||!W||!q)return;[...G,...H].includes(q)&&Ee(q)},[i,r,s,V,W,q,G,H,Ee]);const ze=L.useCallback(()=>{n(Se=>{const ne=new URLSearchParams(Se);return ne.delete("insforge_status"),ne.delete("insforge_type"),ne.delete("insforge_error"),ne},{replace:!0}),P(null)},[n]);return i?F.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[F.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 h-16 flex items-center justify-between",children:F.jsx(Us,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 rounded",children:Ct("login.back_home")})}),F.jsx("main",{className:"flex-1 flex items-center justify-center px-4 py-12",children:F.jsxs("div",{className:"w-full max-w-md space-y-8",children:[F.jsxs("div",{className:"text-center",children:[F.jsx("h1",{className:"text-2xl font-semibold text-white tracking-tight",children:Ct("login.title")}),F.jsx("p",{className:"mt-2 text-sm text-oai-gray-500",children:Ct("login.subtitle")})]}),S?F.jsxs("div",{className:"rounded-lg border border-oai-gray-800 bg-oai-gray-900/50 px-4 py-3 text-sm text-oai-gray-300 flex justify-between gap-3 items-start",role:"status",children:[F.jsx("span",{children:S}),F.jsx("button",{type:"button",onClick:ze,className:"shrink-0 text-oai-gray-500 hover:text-white text-xs",children:Ct("login.dismiss")})]}):null,k?F.jsx("p",{className:"text-sm text-red-400",role:"alert",children:Ct("shared.error.prefix",{error:k})}):null,F.jsx("div",{className:"space-y-3",children:V?F.jsx("div",{className:"h-11 rounded-lg bg-oai-gray-900 animate-pulse","aria-hidden":!0}):F.jsxs(F.Fragment,{children:[G.map(Se=>F.jsx("button",{type:"button",disabled:M,onClick:()=>Ee(Se),className:Mn("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:Ct("login.oauth.continue",{provider:UE(Se)})},Se)),H.map(Se=>F.jsx("button",{type:"button",disabled:M,onClick:()=>Ee(Se),className:Mn("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:Ct("login.oauth.continue",{provider:UE(Se)})},Se))]})}),F.jsxs("div",{className:"relative",children:[F.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":!0,children:F.jsx("span",{className:"w-full border-t border-oai-gray-800"})}),F.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:F.jsx("span",{className:"bg-oai-gray-950 px-3 text-oai-gray-600",children:Ct("login.divider")})})]}),F.jsxs("div",{className:"flex rounded-lg border border-oai-gray-800 p-0.5 bg-oai-gray-900/50",children:[F.jsx("button",{type:"button",className:Mn("flex-1 py-2 text-sm font-medium rounded-md transition-colors",m==="signin"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{v("signin"),U(null)},children:Ct("login.tab.sign_in")}),F.jsx("button",{type:"button",className:Mn("flex-1 py-2 text-sm font-medium rounded-md transition-colors",m==="signup"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{v("signup"),U(null)},children:Ct("login.tab.sign_up")})]}),F.jsxs("form",{onSubmit:ie,className:"space-y-4",children:[m==="signup"?F.jsxs("div",{children:[F.jsx("label",{htmlFor:"login-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Ct("login.field.name")}),F.jsx("input",{id:"login-name",type:"text",autoComplete:"name",value:T,onChange:Se=>A(Se.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:Ct("login.field.name_placeholder")})]}):null,F.jsxs("div",{children:[F.jsx("label",{htmlFor:"login-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Ct("login.field.email")}),F.jsx("input",{id:"login-email",type:"email",autoComplete:"email",required:!0,value:_,onChange:Se=>w(Se.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),F.jsxs("div",{children:[F.jsx("label",{htmlFor:"login-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Ct("login.field.password")}),F.jsx("input",{id:"login-password",type:"password",autoComplete:m==="signup"?"new-password":"current-password",required:!0,minLength:m==="signup"?K:void 0,value:y,onChange:Se=>b(Se.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),m==="signup"?F.jsx("p",{className:"mt-1 text-xs text-oai-gray-600",children:Ct("login.password_hint",{min:String(K)})}):null]}),F.jsx("button",{type:"submit",disabled:M||r,className:"w-full h-11 rounded-lg bg-white text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:Ct(m==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]})})]}):F.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[F.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 py-4",children:F.jsx(Us,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline",children:Ct("login.back_home")})}),F.jsx("main",{className:"flex-1 flex items-center justify-center px-4",children:F.jsx("p",{className:"text-oai-gray-400 text-center max-w-md",children:Ct("login.cloud_only")})})]})}const g$=typeof window<"u"?window.location.search:"",FE=new URLSearchParams(g$),Mf=FE.get("insforge_code")||FE.get("code")||null;function v$(){const{loading:t,signedIn:e}=Do(),n=Au(),[i,r]=L.useState("processing"),[s,o]=L.useState(null),c=L.useRef(!1);return L.useEffect(()=>{!Mf||c.current||(c.current=!0,(async()=>{try{const d=await(await fetch("/api/auth-bridge/verifier")).json();o(!!d?.native)}catch{o(!1)}})())},[]),L.useEffect(()=>{if(s!==!0||!Mf)return;r("redirecting");const u=setTimeout(()=>{window.location.href=`tokentracker://auth/callback?insforge_code=${encodeURIComponent(Mf)}`},200);return()=>clearTimeout(u)},[s]),L.useEffect(()=>{if(s!==!1||t)return;if(e){n("/dashboard",{replace:!0});return}const u=setTimeout(()=>{e||r("failed")},5e3);return()=>clearTimeout(u)},[s,t,e,n]),L.useEffect(()=>{if(!Mf&&s===null){const u=setTimeout(()=>r("failed"),3e3);return()=>clearTimeout(u)}},[s]),i==="processing"&&s!==!0&&(s===null||s===!1&&t)?F.jsx("div",{className:"min-h-screen bg-oai-gray-950"}):F.jsx("div",{className:"min-h-screen bg-oai-gray-950 text-white font-oai antialiased dark flex items-center justify-center",children:F.jsxs("div",{className:"text-center space-y-4 max-w-sm px-4",children:[i==="processing"&&F.jsxs(F.Fragment,{children:[F.jsx("div",{className:"w-8 h-8 border-2 border-oai-gray-600 border-t-white rounded-full animate-spin mx-auto"}),F.jsx("p",{className:"text-oai-gray-400 text-sm",children:"Processing…"})]}),i==="redirecting"&&F.jsxs(F.Fragment,{children:[F.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-green-500/15 flex items-center justify-center",children:F.jsx("svg",{className:"w-6 h-6 text-green-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:F.jsx("path",{d:"M20 6 9 17l-5-5"})})}),F.jsx("p",{className:"text-white text-sm font-medium",children:"Signed in successfully"}),F.jsx("p",{className:"text-oai-gray-500 text-xs",children:"Returning to TokenTracker…"})]}),i==="failed"&&F.jsxs("div",{className:"space-y-3",children:[F.jsx("p",{className:"text-oai-gray-300 text-sm",children:"Sign-in incomplete. Please try again."}),F.jsx("button",{type:"button",onClick:()=>window.close(),className:"px-4 py-2 rounded-lg bg-oai-gray-800 text-sm text-white hover:bg-oai-gray-700 transition-colors",children:"Close this page"})]})]})})}function y$(){const t=L.useContext(OT);if(t===null)throw new Error("useTheme must be used within a ThemeProvider");return t}const Fv="tt.sidebarCollapsed";function _$(){return[{id:"general",label:Ct("nav.group.general"),items:[{id:"usage",to:"/dashboard",icon:zz,label:Ct("nav.usage")},{id:"limits",to:"/limits",icon:Hz,label:Ct("nav.limits")},{id:"leaderboard",to:"/leaderboard",icon:rV,label:Ct("nav.leaderboard")}]},{id:"tools",label:Ct("nav.group.tools"),items:[{id:"widgets",to:"/widgets",icon:$z,label:Ct("nav.widgets")},{id:"ip-check",to:"/ip-check",icon:jz,label:"Claude IP Check"}]},{id:"account",label:Ct("nav.group.account"),items:[{id:"settings",to:"/settings",icon:tV,label:Ct("nav.settings")}]}]}function x$(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Fv)==="1"}catch{return!1}}function b$(){const[t,e]=L.useState(x$),n=L.useCallback(()=>{e(i=>{const r=!i;try{typeof window<"u"&&window.localStorage.setItem(Fv,r?"1":"0")}catch{}return r})},[]);return L.useEffect(()=>{if(typeof window>"u")return;const i=r=>{r.key===Fv&&e(r.newValue==="1")};return window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)},[]),{collapsed:t,toggle:n}}function S$(t,e){const n=t.replace(/\/+$/,"")||"/";return e==="/dashboard"?n==="/dashboard"||n==="/":e==="/leaderboard"?n==="/leaderboard"||n.startsWith("/leaderboard/"):n===e}function w$({label:t,collapsed:e,first:n}){return e?n?null:F.jsx("div",{className:"mx-2 my-2 h-px bg-oai-gray-200/70 dark:bg-oai-gray-800/70","aria-hidden":!0}):F.jsx("div",{className:Mn("px-3 pb-1 text-[10px] uppercase tracking-wider text-oai-gray-500 dark:text-oai-gray-500",n?"pt-2":"pt-4"),children:t})}function E$({item:t,collapsed:e,active:n,onClick:i}){const r=t.icon;return F.jsxs(Us,{to:t.to,onClick:i,title:e?t.label:void 0,"aria-current":n?"page":void 0,className:Mn("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] no-underline transition-colors",e&&"justify-center px-0 py-2",n?"bg-oai-gray-200/70 text-oai-black font-medium dark:bg-oai-gray-800 dark:text-white":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/50 hover:text-oai-black dark:hover:bg-oai-gray-800/60 dark:hover:text-white"),children:[F.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:F.jsx(r,{className:"h-[15px] w-[15px]","aria-hidden":!0})}),!e&&F.jsx("span",{className:"truncate",children:t.label})]})}function M$({as:t="button",title:e,onClick:n,href:i,children:r,className:s,...o}){const c=Mn("flex h-10 w-10 items-center justify-center rounded-lg text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",s);return t==="a"?F.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",title:e,"aria-label":e,className:c,...o,children:r}):F.jsx("button",{type:"button",title:e,"aria-label":e,onClick:n,className:c,...o,children:r})}function T$({repo:t="mm7894215/TokenTracker",glassChrome:e=!1}){const[n,i]=L.useState(null);return L.useEffect(()=>{if(typeof window>"u")return;const r=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;ZC({prefersReducedMotion:r,screenshotCapture:!1})&&fetch(`https://api.github.com/repos/${t}`).then(s=>s.json()).then(s=>{s&&typeof s.stargazers_count=="number"&&i(s.stargazers_count)}).catch(()=>{})},[t]),F.jsxs("a",{href:`https://github.com/${t}`,target:"_blank",rel:"noopener noreferrer","aria-label":n!==null?`Star on GitHub (${n})`:"Star on GitHub",className:Mn("inline-flex h-7 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",e?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:[F.jsx("svg",{height:"12",viewBox:"0 0 16 16",width:"12",className:"shrink-0 fill-current",children:F.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),F.jsx("span",{children:"Star"}),n!==null&&F.jsx("span",{className:"text-[10px] text-oai-gray-500 dark:text-oai-gray-500 tabular-nums",children:n})]})}const A$=[{value:"light",label:"Light",Icon:PC},{value:"dark",label:"Dark",Icon:CC},{value:"system",label:"System",Icon:Jz}];function C$({theme:t,resolvedTheme:e,onSetTheme:n,glassChrome:i=!1}){const[r,s]=L.useState(!1),o=L.useRef(null),c=e==="dark"?CC:PC;return L.useEffect(()=>{if(!r)return;const u=h=>{o.current&&!o.current.contains(h.target)&&s(!1)},d=h=>{h.key==="Escape"&&s(!1)};return document.addEventListener("mousedown",u),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",d)}},[r]),F.jsxs("div",{ref:o,className:"relative",children:[F.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":r,"aria-haspopup":"menu",title:"Theme",onClick:()=>s(u=>!u),className:Mn("inline-flex h-7 w-7 items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",i?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:F.jsx(c,{className:"h-3.5 w-3.5","aria-hidden":!0})}),r&&F.jsx("div",{role:"menu",className:"absolute bottom-full left-0 mb-2 z-50 min-w-[140px] py-1 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 shadow-lg",children:A$.map(({value:u,label:d,Icon:h})=>{const p=t===u;return F.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{n(u),s(!1)},className:Mn("flex w-full items-center gap-2.5 px-3 py-1.5 text-[13px] transition-colors",p?"text-oai-black dark:text-white bg-oai-gray-100 dark:bg-oai-gray-800":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800/60 hover:text-oai-black dark:hover:text-white"),children:[F.jsx(h,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),F.jsx("span",{children:d})]},u)})})]})}function OP({collapsed:t,onToggleCollapsed:e,onItemClick:n,showCloseButton:i=!1,onClose:r,glassChrome:s=!1}){const c=vr()?.pathname||"/",{theme:u,resolvedTheme:d,setTheme:h}=y$(),p=L.useMemo(()=>_$(),[]);return F.jsxs(F.Fragment,{children:[F.jsx("div",{className:Mn("px-2 pt-2 pb-2",t&&"flex justify-center"),children:i?F.jsxs("div",{className:"flex items-center gap-2",children:[F.jsx("div",{className:"flex-1 min-w-0",children:F.jsx(H0,{variant:"sidebar",collapsed:t,onAfterAction:n})}),F.jsx("button",{type:"button",onClick:r,"aria-label":Ct("nav.close_menu"),title:Ct("nav.close_menu"),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-oai-gray-500 dark:text-oai-gray-500 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-gray-900 dark:hover:text-oai-gray-200 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:F.jsx(RC,{className:"h-4 w-4",strokeWidth:1.75,"aria-hidden":!0})})]}):F.jsx(H0,{variant:"sidebar",collapsed:t,onAfterAction:n})}),F.jsx("nav",{"aria-label":Ct("nav.nav_label"),className:"flex-1 px-2 pb-2 flex flex-col overflow-y-auto",children:p.map((m,v)=>F.jsxs("div",{className:"flex flex-col",children:[F.jsx(w$,{label:m.label,collapsed:t,first:v===0}),F.jsx("div",{className:"flex flex-col gap-0.5",children:m.items.map(_=>F.jsx(E$,{item:_,collapsed:t,active:S$(c,_.to),onClick:n},_.id))})]},m.id))}),F.jsxs("div",{className:Mn("flex items-center px-2 py-3",t?"flex-col justify-center gap-2":"justify-between gap-2"),children:[F.jsx(C$,{theme:u,resolvedTheme:d,onSetTheme:h,glassChrome:s}),F.jsx("div",{className:"flex items-center gap-1.5",children:!t&&F.jsx(T$,{glassChrome:s})})]})]})}function P$({collapsed:t,onToggleCollapsed:e}){const n=L.useMemo(()=>typeof window>"u"?!1:Aa()||UT(),[]);return F.jsx("aside",{"aria-label":Ct("nav.aside_label"),className:Mn("hidden lg:flex flex-col shrink-0 h-full min-h-0 transition-[width] duration-200",t?"w-[72px]":"w-[220px]"),children:F.jsx(OP,{collapsed:t,onToggleCollapsed:e,glassChrome:n})})}function R$({open:t,onClose:e}){return L.useEffect(()=>{if(!t)return;const n=i=>{i.key==="Escape"&&e()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t,e]),L.useEffect(()=>{if(!t)return;const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}},[t]),t?F.jsxs("div",{className:"lg:hidden fixed inset-0 z-[80] flex",children:[F.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:e,"aria-hidden":!0}),F.jsx("aside",{"aria-label":Ct("nav.aside_label"),className:"relative w-[260px] max-w-[80vw] flex flex-col bg-oai-white dark:bg-oai-gray-900 border-r border-oai-gray-200 dark:border-oai-gray-800 shadow-2xl",children:F.jsx(OP,{collapsed:!1,showCloseButton:!0,onClose:e,onItemClick:e})})]}):null}function k$({onOpenDrawer:t}){return F.jsxs("div",{className:"lg:hidden flex items-center justify-between gap-2 px-3 h-14 border-b border-oai-gray-200 dark:border-oai-gray-800",children:[F.jsx(M$,{title:Ct("nav.menu"),onClick:t,children:F.jsx(Kz,{className:"h-5 w-5","aria-hidden":!0})}),F.jsxs(Us,{to:"/landing",className:"flex items-center gap-2 no-underline hover:opacity-80 transition-opacity","aria-label":"Token Tracker",children:[F.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),F.jsx("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white",children:"Token Tracker"})]}),F.jsx("div",{className:"w-10 shrink-0","aria-hidden":!0})]})}function L$({children:t}){const{collapsed:e,toggle:n}=b$(),[i,r]=L.useState(!1),s=L.useCallback(()=>r(!0),[]),o=L.useCallback(()=>r(!1),[]),c=L.useMemo(()=>typeof window>"u"?!1:Aa()||UT(),[]);return F.jsxs("div",{className:Mn("fixed inset-0 flex flex-col text-oai-black dark:text-oai-white font-sans overflow-hidden",c?"bg-transparent":"bg-oai-gray-100 dark:bg-oai-gray-950"),children:[c&&F.jsx("div",{className:"h-7 shrink-0",style:{WebkitAppRegion:"drag"},"aria-hidden":!0}),F.jsxs("div",{className:"flex-1 min-h-0 flex",children:[F.jsx(P$,{collapsed:e,onToggleCollapsed:n}),F.jsx(R$,{open:i,onClose:o}),F.jsx("div",{className:"flex-1 min-w-0 min-h-0 p-2 lg:pl-0 lg:pr-3 lg:pb-3 flex flex-col",children:F.jsxs("div",{className:Mn("flex-1 min-h-0 flex flex-col bg-oai-white dark:bg-oai-gray-900 border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",c?"tt-native-main-card":"rounded-2xl",!c&&"shadow-sm"),children:[F.jsx(k$,{onOpenDrawer:s}),F.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:t})]})})]})]})}const D$=hs.lazy(()=>No(()=>import("./DashboardPage-BZt5y5gb.js"),__vite__mapDeps([0,1,2,3])).then(t=>({default:t.DashboardPage}))),N$=hs.lazy(()=>No(()=>import("./LeaderboardPage-CjgASqSw.js"),__vite__mapDeps([4,5])).then(t=>({default:t.LeaderboardPage}))),I$=hs.lazy(()=>No(()=>import("./LeaderboardProfilePage-BTs27wAX.js"),__vite__mapDeps([6,5])).then(t=>({default:t.LeaderboardProfilePage}))),U$=hs.lazy(()=>No(()=>import("./LimitsPage-Drc8wTon.js"),__vite__mapDeps([7,1,8,2,3])).then(t=>({default:t.LimitsPage}))),F$=hs.lazy(()=>No(()=>import("./SettingsPage-mCnpRVuo.js"),__vite__mapDeps([9,8,2,10])).then(t=>({default:t.SettingsPage}))),O$=hs.lazy(()=>No(()=>import("./WidgetsPage-qlO-IWyq.js"),__vite__mapDeps([11,3,10])).then(t=>({default:t.WidgetsPage}))),B$=hs.lazy(()=>No(()=>import("./IpCheckPage-DseJuOvq.js"),[]));function z$(){const t=vr(),e=Do();lH();const n=xr(),i=L.useMemo(()=>typeof window>"u"?!1:$C(window.location.search),[]),r=t?.pathname||"/",s=new URL(window.location.href),o=s.pathname.replace(/\/+$/,"")||"/",u=o.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,d=s.searchParams.get("token")||null,h=u||d,p=o==="/share"||o==="/share.html"||o.startsWith("/share/"),m=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),v=r.replace(/\/+$/,"")||"/",_=v.match(/^\/leaderboard\/u\/([^/]+)$/i),w=_?_[1]:null,y=v==="/leaderboard"||!!w,b=!!(e.enabled&&e.signedIn),T=m||b,A=!1,M=iH(),I=L.useMemo(()=>!e.enabled||!b?null:{getAccessToken:()=>e.getAccessToken(),name:e.displayName||"",userId:e.user?.id||null},[e,b]);let k=m||n||i?"dashboard":"landing";v==="/landing"&&(k="landing"),v==="/dashboard"&&(k="dashboard"),y&&(k="dashboard");const U=v==="/limits";U&&(k="dashboard");const S=v==="/settings";S&&(k="dashboard");const P=v==="/widgets";P&&(k="dashboard");const V=v==="/ip-check";V&&(k="dashboard");const O=w?I$:v==="/leaderboard"?N$:U?U$:S?F$:P?O$:V?B$:D$,J=!p&&(v==="/dashboard"||v==="/"||v==="/leaderboard"||U||S||P||V),H=F.jsx("div",{className:"min-h-screen bg-oai-white dark:bg-[#050505]"});let X=null;if(v==="/auth/callback"||v==="/auth/native-callback")X=F.jsx(v$,{});else if(v==="/login")X=F.jsx(m$,{});else if(k==="landing")X=F.jsx(h$,{signInUrl:"/login",signUpUrl:"/login"});else{const K=F.jsx(L.Suspense,{fallback:H,children:F.jsx(O,{baseUrl:M,auth:I,signedIn:T,sessionSoftExpired:A,signOut:()=>e.enabled?e.signOut():Promise.resolve(),publicMode:p,publicToken:h,userId:w,signInUrl:"/login",signUpUrl:"/login"})});X=J?F.jsx(L$,{children:K}):K}return F.jsx(TF,{children:F.jsx(LF,{children:F.jsxs(DF,{children:[X,F.jsx(tH,{}),F.jsx(TU,{}),F.jsx(FU,{})]})})})}const V$=OL([{path:"*",element:F.jsx(z$,{})}]);T2.createRoot(document.getElementById("root")).render(F.jsx(hs.StrictMode,{children:F.jsx(fU,{children:F.jsx(JL,{router:V$})})}));export{jU as $,pT as A,Ct as B,y$ as C,F as D,gy as E,YU as F,LT as G,Ov as H,uF as I,mh as J,WS as K,HS as L,jy as M,EX as N,my as O,Ml as P,py as Q,BE as R,ZL as S,wT as T,pF as U,$S as V,Kl as W,AT as X,GS as Y,ET as Z,OU as _,pi as a,GU as a0,BU as a1,f0 as a2,TT as a3,bX as a4,HU as a5,SX as a6,MT as a7,wX as a8,Us as a9,vr as aA,Au as aB,kX as aC,RI as aD,Y$ as aE,LX as aF,dX as aG,q$ as aH,fX as aI,hH as aJ,H0 as aK,tV as aL,_X as aM,vy as aN,UT as aO,MX as aP,PX as aQ,TX as aR,AX as aS,CX as aT,PC as aU,CC as aV,Jz as aW,BS as aX,uX as aY,PI as aZ,Aa as a_,Lz as aa,Il as ab,rF as ac,hs as ad,RC as ae,sX as af,rX as ag,zT as ah,Do as ai,E5 as aj,No as ak,DX as al,cX as am,$C as an,Ta as ao,hX as ap,Z$ as aq,J$ as ar,aX as as,HI as at,Q$ as au,eX as av,pX as aw,iX as ax,uH as ay,Mn as az,VT as b,Ia as c,dw as d,br as e,An as f,mT as g,xr as h,PO as i,K$ as j,UI as k,xX as l,Gl as m,WI as n,$I as o,gX as p,nX as q,L as r,lX as s,vX as t,yy as u,yX as v,tX as w,kn as x,oX as y,mX as z};
4965
+ }`;function n$({raysOrigin:t="top-center",raysColor:e="#ffffff",raysSpeed:n=1,lightSpread:i=1,rayLength:r=2,pulsating:s=!1,fadeDistance:o=1,saturation:c=1,followMouse:u=!0,mouseInfluence:d=.1,noiseAmount:h=0,distortion:p=0,className:m=""}){const v=L.useRef(null),_=L.useRef(null),w=L.useRef(null),y=L.useRef({x:.5,y:.5}),b=L.useRef({x:.5,y:.5}),T=L.useRef(null),A=L.useRef(null),M=L.useRef(null),[I,k]=L.useState(!1),U=L.useRef(null);return L.useEffect(()=>{if(v.current)return U.current=new IntersectionObserver(S=>{k(S[0].isIntersecting)},{threshold:.1}),U.current.observe(v.current),()=>{U.current&&(U.current.disconnect(),U.current=null)}},[]),L.useEffect(()=>!I||!v.current?void 0:(M.current&&(M.current(),M.current=null),(async()=>{if(!v.current||(await new Promise(Q=>setTimeout(Q,10)),!v.current))return;const P=new e7({dpr:Math.min(window.devicePixelRatio,2),alpha:!0});w.current=P;const V=P.gl;for(V.canvas.style.width="100%",V.canvas.style.height="100%";v.current.firstChild;)v.current.removeChild(v.current.firstChild);v.current.appendChild(V.canvas);const O={iTime:{value:0},iResolution:{value:[1,1]},rayPos:{value:[0,0]},rayDir:{value:[0,1]},raysColor:{value:LE(e)},raysSpeed:{value:n},lightSpread:{value:i},rayLength:{value:r},pulsating:{value:s?1:0},fadeDistance:{value:o},saturation:{value:c},mousePos:{value:[.5,.5]},mouseInfluence:{value:d},noiseAmount:{value:h},distortion:{value:p}};_.current=O;const G=new Q7(V),J=new YW(V,{vertex:e$,fragment:t$,uniforms:O}),H=new J7(V,{geometry:G,program:J});A.current=H;const X=()=>{if(!v.current||!P)return;P.dpr=Math.min(window.devicePixelRatio,2);const{clientWidth:Q,clientHeight:W}=v.current;P.setSize(Q,W);const q=P.dpr,Z=Q*q,z=W*q;O.iResolution.value=[Z,z];const{anchor:ie,dir:Ee}=DE(t,Z,z);O.rayPos.value=ie,O.rayDir.value=Ee},K=Q=>{if(!(!w.current||!_.current||!A.current)){O.iTime.value=Q*.001,u&&d>0&&(b.current.x=b.current.x*.92+y.current.x*(1-.92),b.current.y=b.current.y*.92+y.current.y*(1-.92),O.mousePos.value=[b.current.x,b.current.y]);try{P.render({scene:H}),T.current=requestAnimationFrame(K)}catch(W){console.warn("WebGL rendering error:",W)}}};window.addEventListener("resize",X),X(),T.current=requestAnimationFrame(K),M.current=()=>{if(T.current&&(cancelAnimationFrame(T.current),T.current=null),window.removeEventListener("resize",X),P)try{const Q=P.gl.getExtension("WEBGL_lose_context");Q&&Q.loseContext();const W=P.gl.canvas;W&&W.parentNode&&W.parentNode.removeChild(W)}catch(Q){console.warn("Error during WebGL cleanup:",Q)}w.current=null,_.current=null,A.current=null}})(),()=>{M.current&&(M.current(),M.current=null)}),[I,t,e,n,i,r,s,o,c,u,d,h,p]),L.useEffect(()=>{if(!_.current||!v.current||!w.current)return;const S=_.current,P=w.current;S.raysColor.value=LE(e),S.raysSpeed.value=n,S.lightSpread.value=i,S.rayLength.value=r,S.pulsating.value=s?1:0,S.fadeDistance.value=o,S.saturation.value=c,S.mouseInfluence.value=d,S.noiseAmount.value=h,S.distortion.value=p;const{clientWidth:V,clientHeight:O}=v.current,G=P.dpr,{anchor:J,dir:H}=DE(t,V*G,O*G);S.rayPos.value=J,S.rayDir.value=H},[e,n,i,t,r,s,o,c,d,h,p]),L.useEffect(()=>{if(!u)return;const S=P=>{if(!v.current)return;const V=v.current.getBoundingClientRect();y.current={x:(P.clientX-V.left)/V.width,y:(P.clientY-V.top)/V.height}};return window.addEventListener("mousemove",S),()=>window.removeEventListener("mousemove",S)},[u]),F.jsx("div",{ref:v,className:`w-full h-full pointer-events-none z-[3] overflow-hidden relative ${m}`.trim()})}function i$({className:t}){return F.jsx("svg",{viewBox:"0 0 384 512",className:t,fill:"currentColor",children:F.jsx("path",{d:"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"})})}function r$({className:t}){return F.jsx("svg",{viewBox:"0 0 16 16",className:t,fill:"currentColor",children:F.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})})}function s$({className:t}){return F.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[F.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),F.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function a$({className:t}){return F.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:F.jsx("polyline",{points:"20 6 9 17 4 12"})})}const NE="https://github.com/mm7894215/TokenTracker",o$="https://github.com/mm7894215/TokenTracker/releases/latest";function l$(t="default",e="md",n){const i="inline-flex items-center justify-center rounded font-medium transition-colors duration-200 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-oai-gray-950",r={default:"bg-oai-gray-900 text-white hover:bg-oai-gray-800 active:bg-oai-gray-950 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 dark:active:bg-oai-gray-200",ghost:"text-oai-gray-600 hover:text-oai-gray-900 hover:bg-oai-gray-100 active:bg-oai-gray-200 dark:text-oai-gray-400 dark:hover:text-white dark:hover:bg-oai-gray-800 dark:active:bg-oai-gray-700"},s={sm:"h-9 px-4 text-sm",md:"h-11 px-6 text-sm",lg:"h-12 px-8 text-base"};return Mn(i,r[t],s[e],n)}function c$({copy:t,signInUrl:e,signUpUrl:n,installCommand:i,installCopied:r,onCopyInstallCommand:s}){const o=Lz(),[c,u]=L.useState(!1);L.useEffect(()=>{const w=()=>u(window.scrollY>10);return window.addEventListener("scroll",w,{passive:!0}),()=>window.removeEventListener("scroll",w)},[]);const d=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),{signedIn:h,loading:p}=Do(),m=L.useMemo(()=>({codex:t("landing.v2.models.agent.codex"),claude_code:t("landing.v2.models.agent.claude_code"),cursor:t("landing.v2.models.agent.cursor"),gemini:t("landing.v2.models.agent.gemini"),opencode:t("landing.v2.models.agent.opencode"),openclaw:t("landing.v2.models.agent.openclaw")}),[t]),v=L.useMemo(()=>[{id:"codex",icon:"/brand-logos/codex.svg"},{id:"claude_code",icon:"/brand-logos/claude-code.svg"},{id:"cursor",icon:"/brand-logos/cursor.svg"},{id:"gemini",icon:"/brand-logos/gemini.svg"},{id:"opencode",icon:"/brand-logos/opencode.svg"},{id:"openclaw",icon:"/brand-logos/openclaw.svg"}],[]),_=o?{duration:0}:void 0;return F.jsxs("div",{className:"relative min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark",children:[F.jsx("div",{className:"absolute inset-0 z-0 pointer-events-none",style:{height:"100vh"},children:F.jsx(n$,{raysOrigin:"top-center",raysColor:"#b8b3ff",raysSpeed:1,lightSpread:.5,rayLength:3,pulsating:!1,fadeDistance:1,saturation:1,followMouse:!0,mouseInfluence:.1,noiseAmount:0,distortion:0})}),F.jsx("header",{className:Mn("sticky top-0 z-50 transition-all duration-300",c?"bg-oai-gray-950/80 backdrop-blur-md border-b border-oai-gray-900":"bg-transparent border-b border-transparent"),children:F.jsxs("div",{className:"mx-auto flex h-14 max-w-7xl items-center justify-between px-4 sm:px-6",children:[F.jsxs("div",{className:"flex items-center gap-5",children:[F.jsxs(Us,{to:n||"/",className:"flex items-center gap-3 no-underline outline-none rounded focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:ring-offset-oai-gray-950 transition-opacity hover:opacity-80",children:[F.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),F.jsx("span",{className:"text-sm font-semibold tracking-wide text-white uppercase",children:"Token Tracker"})]}),F.jsx("div",{className:"hidden sm:block",children:F.jsx(hH,{})})]}),d&&F.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2 sm:gap-3",children:[F.jsxs(Us,{to:fH(),className:Mn(l$(h||p?"default":"ghost","sm"),"no-underline px-5 rounded-full group",h||p?"shadow-sm ring-1 ring-white/10":"ring-1 ring-oai-gray-700"),children:[t("landing.v2.cta.primary"),F.jsx("span",{className:"ml-2 inline-block transition-transform duration-200 group-hover:translate-x-0.5",children:"→"})]}),F.jsx(H0,{})]})]})}),F.jsxs("main",{children:[F.jsx("section",{className:"relative py-16 sm:py-24 lg:py-32 overflow-hidden",children:F.jsxs("div",{className:"relative z-10 mx-auto max-w-7xl px-4 sm:px-6 flex flex-col items-center text-center gap-20 lg:gap-36",children:[F.jsxs(Il.div,{initial:o?!1:{opacity:0,y:20},animate:{opacity:1,y:0},transition:_||{duration:.5},className:"w-full max-w-3xl relative z-20",children:[F.jsxs("h1",{className:"text-balance text-5xl font-semibold tracking-tight text-white sm:text-6xl lg:text-[4rem] lg:leading-[1.05]",children:[t("landing.v2.hero.title_line1"),F.jsx("br",{}),F.jsx("span",{className:"bg-gradient-to-b from-white via-oai-gray-200 to-oai-gray-500 bg-clip-text text-transparent font-bold tracking-tight",style:{WebkitTextStroke:"1px rgba(255, 255, 255, 0.15)"},children:t("landing.v2.hero.title_line2")})]}),F.jsx("p",{className:"mt-6 text-lg leading-relaxed text-oai-gray-400",children:t("landing.v2.hero.subtagline")}),F.jsxs("div",{className:"mt-8 w-full max-w-lg mx-auto",children:[F.jsxs(Il.div,{whileHover:{scale:1.01,y:-1},transition:{type:"spring",stiffness:400,damping:25},className:"group relative inline-block w-full overflow-hidden rounded-2xl",style:{padding:"1.5px 0"},children:[F.jsx("div",{className:"absolute w-[300%] h-[50%] opacity-70 bottom-[-11px] right-[-250%] rounded-full animate-star-movement-bottom z-0",style:{background:"radial-gradient(circle, #fbdfff, transparent 10%)",animationDuration:"6s"}}),F.jsx("div",{className:"absolute w-[300%] h-[50%] opacity-70 top-[-10px] left-[-250%] rounded-full animate-star-movement-top z-0",style:{background:"radial-gradient(circle, #fbdfff, transparent 10%)",animationDuration:"6s"}}),F.jsxs("div",{className:"relative z-[1] flex items-center justify-between w-full bg-[#0a0a0a] border border-oai-gray-800 rounded-2xl p-1.5 pl-5 shadow-2xl shadow-black/50",children:[F.jsxs("div",{className:"flex items-center gap-3 overflow-hidden",children:[F.jsx("span",{className:"text-oai-gray-600 font-mono select-none","aria-hidden":"true",children:"›"}),F.jsx("code",{className:"font-mono text-sm text-oai-gray-200 overflow-x-auto whitespace-nowrap py-2 [scrollbar-width:none]",children:i?i.split(" ").map((w,y)=>F.jsxs("span",{className:w==="npx"||w==="tokentracker-cli"?"text-white font-medium":w==="--yes"?"text-oai-gray-500":"text-oai-brand-400",children:[w," "]},y)):null})]}),F.jsx("button",{type:"button",onClick:s,"aria-label":t(r?"landing.install.action.copied":"landing.install.action.copy"),className:"shrink-0 flex h-9 w-9 items-center justify-center text-oai-gray-200 bg-oai-gray-900 border border-oai-gray-700 rounded-lg hover:bg-oai-gray-800 hover:text-white active:scale-95 transition-all duration-200 shadow-sm",children:r?F.jsx(a$,{className:"h-4 w-4 text-green-400","aria-hidden":!0}):F.jsx(s$,{className:"h-4 w-4 opacity-70","aria-hidden":!0})})]})]}),F.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-x-6 gap-y-4",children:[F.jsxs("a",{href:o$,target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-2 text-sm font-medium text-oai-gray-400 hover:text-white transition-colors",children:[F.jsx("div",{className:"flex items-center justify-center h-8 w-8 rounded-full bg-oai-gray-800 group-hover:bg-oai-gray-700 transition-colors",children:F.jsx(i$,{className:"h-4 w-4 text-oai-gray-400 group-hover:text-white"})}),t("landing.v2.install.mac_cta")]}),F.jsxs("a",{href:NE,target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-2 text-sm font-medium text-oai-gray-400 hover:text-white transition-colors",children:[F.jsx("div",{className:"flex items-center justify-center h-8 w-8 rounded-full bg-oai-gray-800 group-hover:bg-oai-gray-700 transition-colors",children:F.jsx(r$,{className:"h-4 w-4 text-oai-gray-400 group-hover:text-white"})}),t("landing.cta.secondary")]})]}),F.jsx("span",{className:"sr-only","aria-live":"polite",children:r?t("landing.install.action.copied"):""})]})]}),F.jsx("div",{className:"relative group w-full",children:F.jsxs(Il.div,{initial:o?!1:{opacity:0,y:24},animate:{opacity:1,y:0},transition:_||{duration:.6,delay:.1},className:"relative w-full",children:[F.jsx("div",{style:{position:"absolute",top:"-256px",left:0,right:0,height:"510px",zIndex:3,pointerEvents:"none"},children:F.jsx(PW,{color:"#8a7aff",wispDensity:2,flowSpeed:.28,verticalSizing:2.2,horizontalSizing:1.22,fogIntensity:4,fogScale:.1,wispSpeed:18,wispIntensity:10,flowStrength:.12,decay:1.1,falloffStart:1.1,fogFallSpeed:.5,horizontalBeamOffset:.22,verticalBeamOffset:0,style:{width:"100%",height:"100%"}})}),F.jsx("div",{className:"relative rounded-xl p-[1px] shadow-2xl bg-gradient-to-b from-[rgba(138,122,255,0.6)] via-[rgba(138,122,255,0.15)] to-[rgba(138,122,255,0.05)]",style:{position:"relative",zIndex:10,boxShadow:"0 20px 60px -10px rgba(138,122,255,0.15), 0 4px 20px rgba(0,0,0,0.4)"},children:F.jsxs("div",{className:"relative rounded-[11px] overflow-hidden bg-oai-gray-950",children:[F.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"180px",background:"linear-gradient(to bottom, rgba(138,122,255,0.35) 0%, rgba(138,122,255,0.12) 40%, transparent 100%)",mixBlendMode:"screen",zIndex:20,pointerEvents:"none"}}),F.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"1px",background:"linear-gradient(90deg, transparent 0%, rgba(138,122,255,0.9) 30%, rgba(180,168,255,1) 50%, rgba(138,122,255,0.9) 70%, transparent 100%)",zIndex:25,pointerEvents:"none"}}),F.jsx("img",{src:"/dashboard-dark.png",alt:t("landing.screenshot.alt"),className:"block h-auto w-full object-cover",style:{position:"relative",zIndex:10},loading:"eager",decoding:"async"})]})})]})})]})}),F.jsx("section",{className:"border-y border-oai-gray-900 bg-oai-gray-950/50 py-12 lg:py-16",children:F.jsx("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:F.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-8",children:[F.jsx("p",{className:"text-sm font-semibold uppercase tracking-wider text-oai-gray-400 shrink-0",children:t("landing.v2.models.title")}),F.jsx("div",{className:"flex flex-wrap items-center gap-x-8 gap-y-6 opacity-60 hover:opacity-100 transition-opacity duration-500 grayscale hover:grayscale-0",children:v.map(w=>F.jsxs("div",{className:"flex items-center gap-2.5 transition-transform hover:-translate-y-0.5 duration-300",children:[F.jsx("img",{src:w.icon,alt:"",width:20,height:20,className:`h-5 w-5 object-contain ${w.id==="cursor"?"dark:invert":""}`,loading:"lazy"}),F.jsx("span",{className:"text-sm font-medium text-oai-gray-300",children:m[w.id]})]},w.id))})]})})}),F.jsx("section",{className:"py-20 lg:py-32",children:F.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6 grid grid-cols-1 md:grid-cols-2 gap-16 lg:gap-24 items-start",children:[F.jsxs("div",{className:"max-w-md",children:[F.jsx("p",{className:"text-xs font-bold tracking-widest uppercase text-oai-brand-500 mb-4",children:t("landing.v2.compare.kicker")}),F.jsx("h2",{className:"text-3xl font-semibold tracking-tight text-white sm:text-4xl text-balance",children:t("landing.v2.compare.title")}),F.jsx("p",{className:"mt-6 text-lg leading-relaxed text-oai-gray-400",children:t("landing.v2.compare.subtitle")}),F.jsx("p",{className:"mt-6 text-base leading-relaxed text-oai-gray-500",children:t("landing.v2.distill.body")})]}),F.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-10",children:[F.jsxs("div",{className:"space-y-4",children:[F.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wider text-white border-b border-oai-gray-800 pb-3",children:t("landing.v2.compare.with.title")}),F.jsxs("ul",{className:"space-y-3 text-sm text-oai-gray-400",children:[F.jsxs("li",{className:"flex gap-2",children:[F.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),F.jsx("span",{children:t("landing.v2.compare.with.p1")})]}),F.jsxs("li",{className:"flex gap-2",children:[F.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),F.jsx("span",{children:t("landing.v2.compare.with.p2")})]}),F.jsxs("li",{className:"flex gap-2",children:[F.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),F.jsx("span",{children:t("landing.v2.compare.with.p3")})]})]})]}),F.jsxs("div",{className:"space-y-4",children:[F.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wider text-oai-gray-500 border-b border-oai-gray-800/50 pb-3",children:t("landing.v2.compare.without.title")}),F.jsxs("ul",{className:"space-y-3 text-sm text-oai-gray-500",children:[F.jsxs("li",{className:"flex gap-2",children:[F.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),F.jsx("span",{children:t("landing.v2.compare.without.p1")})]}),F.jsxs("li",{className:"flex gap-2",children:[F.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),F.jsx("span",{children:t("landing.v2.compare.without.p2")})]}),F.jsxs("li",{className:"flex gap-2",children:[F.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),F.jsx("span",{children:t("landing.v2.compare.without.p3")})]})]})]})]})]})})]}),F.jsx("footer",{className:"border-t border-oai-gray-900 bg-oai-gray-950 py-12",children:F.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col items-center justify-between gap-6 px-4 sm:px-6 text-sm text-oai-gray-400 sm:flex-row",children:[F.jsx("p",{children:t("landing.v2.footer.line")}),F.jsxs("div",{className:"flex items-center gap-6",children:[F.jsx("a",{href:NE,className:"font-medium text-oai-gray-400 hover:text-white transition-colors",target:"_blank",rel:"noopener noreferrer",children:t("landing.v2.nav.github")}),d&&F.jsxs(Us,{to:e,className:"font-medium text-oai-brand-500 hover:text-oai-brand-400 transition-colors",children:[t("landing.cta.primary")," →"]})]})]})})]})}function u$({prefersReducedMotion:t,screenshotMode:e}){return!(e||t)}function d$(){return L.useMemo(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,[])}function f$(t=0,e=!0){const[n,i]=L.useState(()=>!e);return L.useEffect(()=>{if(!e){i(!0);return}let r=null,s=null;const o=()=>i(!0);return typeof window<"u"&&"requestIdleCallback"in window?(s=window.requestIdleCallback(o,{timeout:t||200}),()=>{typeof window.cancelIdleCallback=="function"&&s!=null&&window.cancelIdleCallback(s)}):(r=window.setTimeout(o,t),()=>{r!=null&&window.clearTimeout(r)})},[t,e]),n}function h$({signInUrl:t,signUpUrl:e}){const n=Ct("landing.handle.special"),i=Ct("landing.handle.default");Ct("landing.nav.login"),Ct("landing.nav.signup");const[r,s]=L.useState(i),o=d$(),c=L.useMemo(()=>typeof window>"u"?!1:$C(window.location.search),[]),u=u$({prefersReducedMotion:o,screenshotMode:c});f$(250,u);const d="tokentracker.dashboard.from_landing.v1";L.useEffect(()=>{if(!(typeof window>"u"))try{window.sessionStorage.setItem(d,"1")}catch{}},[d]),L.useMemo(()=>Ct("landing.handle.placeholder",{handle:n}),[n]),L.useMemo(()=>{const _=Ct(r===n?"landing.rank.singularity":"landing.rank.unranked");return Ct("landing.rank.expectation",{rank:_})},[r,n]);const h=Ct("landing.install.command"),[p,m]=L.useState(!1),v=async()=>{await uH(h)&&(m(!0),window.setTimeout(()=>m(!1),2e3))};return F.jsx(c$,{copy:Ct,reduceMotion:o,signInUrl:t,signUpUrl:e,installCommand:h,installCopied:p,onCopyInstallCommand:v})}function p$(t){const e=new URLSearchParams(t).get("next");return typeof e!="string"||e.length===0||!e.startsWith("/")||e.startsWith("//")?"/dashboard":e}const IE={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",linkedin:"LinkedIn",facebook:"Facebook",instagram:"Instagram",tiktok:"TikTok",apple:"Apple",x:"X",spotify:"Spotify"};function UE(t){const e=String(t||"").trim();return IE[e]?IE[e]:e.replace(/-/g," ")}function m$(){const t=Au(),[e,n]=WL(),{enabled:i,loading:r,signedIn:s,refreshUser:o,signInWithPassword:c,signUp:u,signInWithOAuth:d,getPublicAuthConfig:h}=Do(),p=L.useMemo(()=>p$(e.toString()),[e]),[m,v]=L.useState("signin"),[_,w]=L.useState(""),[y,b]=L.useState(""),[T,A]=L.useState(""),[M,I]=L.useState(!1),[k,U]=L.useState(null),[S,P]=L.useState(null),[V,O]=L.useState(!0),[G,J]=L.useState([]),[H,X]=L.useState([]),[K,Q]=L.useState(8);L.useEffect(()=>{const Se=e.get("insforge_status"),ne=e.get("insforge_type"),ye=e.get("insforge_error");Se==="success"&&ne==="verify_email"?P(Ct("login.verify_email_success")):Se==="error"&&ne==="verify_email"&&ye&&P(Ct("shared.error.prefix",{error:ye}))},[e]),L.useEffect(()=>{if(!i){O(!1);return}let Se=!0;return(async()=>{const{data:ne,error:ye}=await h();Se&&(ye||!ne?(J(["google","github"]),X([])):(J(Array.isArray(ne.oAuthProviders)?ne.oAuthProviders:[]),X(Array.isArray(ne.customOAuthProviders)?ne.customOAuthProviders:[]),typeof ne.passwordMinLength=="number"&&ne.passwordMinLength>0&&Q(ne.passwordMinLength)),O(!1))})(),()=>{Se=!1}},[i,h]),L.useEffect(()=>{if(!(!i||r)&&s){if(W){window.location.href="/auth/native-callback";return}t(p,{replace:!0})}},[i,r,s,t,p,W]),L.useEffect(()=>{i&&o()},[i,o]);const W=L.useMemo(()=>e.get("native")==="1",[e]),q=L.useMemo(()=>e.get("provider")||null,[e]),Z=L.useMemo(()=>typeof window>"u"||W?"":`${window.location.origin}/`,[W]),z=L.useMemo(()=>typeof window>"u"?"":`${window.location.origin}/`,[]),ie=L.useCallback(async Se=>{Se.preventDefault(),U(null),I(!0);try{if(m==="signup"){const{data:ye,error:be}=await u({email:_.trim(),password:y,name:T.trim()||void 0,redirectTo:z});if(be){U(be.message||String(be));return}if(ye?.requireEmailVerification){P(Ct("login.verify_email_pending")),v("signin");return}t(p,{replace:!0});return}const{error:ne}=await c({email:_.trim(),password:y});if(ne){U(ne.message||String(ne));return}t(p,{replace:!0})}finally{I(!1)}},[m,_,y,T,u,c,t,p,z]),Ee=L.useCallback(async Se=>{U(null),I(!0);try{const{error:ne}=await d(Se,Z);ne&&U(ne.message||String(ne))}finally{I(!1)}},[d,Z]);L.useEffect(()=>{if(W&&typeof window<"u")try{window.sessionStorage.setItem("tokentracker_native_login","1")}catch{}},[W]),L.useEffect(()=>{if(!i||r||s||V||!W||!q)return;[...G,...H].includes(q)&&Ee(q)},[i,r,s,V,W,q,G,H,Ee]);const ze=L.useCallback(()=>{n(Se=>{const ne=new URLSearchParams(Se);return ne.delete("insforge_status"),ne.delete("insforge_type"),ne.delete("insforge_error"),ne},{replace:!0}),P(null)},[n]);return i?F.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[F.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 h-16 flex items-center justify-between",children:F.jsx(Us,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 rounded",children:Ct("login.back_home")})}),F.jsx("main",{className:"flex-1 flex items-center justify-center px-4 py-12",children:F.jsxs("div",{className:"w-full max-w-md space-y-8",children:[F.jsxs("div",{className:"text-center",children:[F.jsx("h1",{className:"text-2xl font-semibold text-white tracking-tight",children:Ct("login.title")}),F.jsx("p",{className:"mt-2 text-sm text-oai-gray-500",children:Ct("login.subtitle")})]}),S?F.jsxs("div",{className:"rounded-lg border border-oai-gray-800 bg-oai-gray-900/50 px-4 py-3 text-sm text-oai-gray-300 flex justify-between gap-3 items-start",role:"status",children:[F.jsx("span",{children:S}),F.jsx("button",{type:"button",onClick:ze,className:"shrink-0 text-oai-gray-500 hover:text-white text-xs",children:Ct("login.dismiss")})]}):null,k?F.jsx("p",{className:"text-sm text-red-400",role:"alert",children:Ct("shared.error.prefix",{error:k})}):null,F.jsx("div",{className:"space-y-3",children:V?F.jsx("div",{className:"h-11 rounded-lg bg-oai-gray-900 animate-pulse","aria-hidden":!0}):F.jsxs(F.Fragment,{children:[G.map(Se=>F.jsx("button",{type:"button",disabled:M,onClick:()=>Ee(Se),className:Mn("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:Ct("login.oauth.continue",{provider:UE(Se)})},Se)),H.map(Se=>F.jsx("button",{type:"button",disabled:M,onClick:()=>Ee(Se),className:Mn("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:Ct("login.oauth.continue",{provider:UE(Se)})},Se))]})}),F.jsxs("div",{className:"relative",children:[F.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":!0,children:F.jsx("span",{className:"w-full border-t border-oai-gray-800"})}),F.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:F.jsx("span",{className:"bg-oai-gray-950 px-3 text-oai-gray-600",children:Ct("login.divider")})})]}),F.jsxs("div",{className:"flex rounded-lg border border-oai-gray-800 p-0.5 bg-oai-gray-900/50",children:[F.jsx("button",{type:"button",className:Mn("flex-1 py-2 text-sm font-medium rounded-md transition-colors",m==="signin"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{v("signin"),U(null)},children:Ct("login.tab.sign_in")}),F.jsx("button",{type:"button",className:Mn("flex-1 py-2 text-sm font-medium rounded-md transition-colors",m==="signup"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{v("signup"),U(null)},children:Ct("login.tab.sign_up")})]}),F.jsxs("form",{onSubmit:ie,className:"space-y-4",children:[m==="signup"?F.jsxs("div",{children:[F.jsx("label",{htmlFor:"login-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Ct("login.field.name")}),F.jsx("input",{id:"login-name",type:"text",autoComplete:"name",value:T,onChange:Se=>A(Se.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:Ct("login.field.name_placeholder")})]}):null,F.jsxs("div",{children:[F.jsx("label",{htmlFor:"login-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Ct("login.field.email")}),F.jsx("input",{id:"login-email",type:"email",autoComplete:"email",required:!0,value:_,onChange:Se=>w(Se.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),F.jsxs("div",{children:[F.jsx("label",{htmlFor:"login-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Ct("login.field.password")}),F.jsx("input",{id:"login-password",type:"password",autoComplete:m==="signup"?"new-password":"current-password",required:!0,minLength:m==="signup"?K:void 0,value:y,onChange:Se=>b(Se.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),m==="signup"?F.jsx("p",{className:"mt-1 text-xs text-oai-gray-600",children:Ct("login.password_hint",{min:String(K)})}):null]}),F.jsx("button",{type:"submit",disabled:M||r,className:"w-full h-11 rounded-lg bg-white text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:Ct(m==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]})})]}):F.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[F.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 py-4",children:F.jsx(Us,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline",children:Ct("login.back_home")})}),F.jsx("main",{className:"flex-1 flex items-center justify-center px-4",children:F.jsx("p",{className:"text-oai-gray-400 text-center max-w-md",children:Ct("login.cloud_only")})})]})}const g$=typeof window<"u"?window.location.search:"",FE=new URLSearchParams(g$),Mf=FE.get("insforge_code")||FE.get("code")||null;function v$(){const{loading:t,signedIn:e}=Do(),n=Au(),[i,r]=L.useState("processing"),[s,o]=L.useState(null),c=L.useRef(!1);return L.useEffect(()=>{!Mf||c.current||(c.current=!0,(async()=>{try{const d=await(await fetch("/api/auth-bridge/verifier")).json();o(!!d?.native)}catch{o(!1)}})())},[]),L.useEffect(()=>{if(s!==!0||!Mf)return;r("redirecting");const u=setTimeout(()=>{window.location.href=`tokentracker://auth/callback?insforge_code=${encodeURIComponent(Mf)}`},200);return()=>clearTimeout(u)},[s]),L.useEffect(()=>{if(s!==!1||t)return;if(e){n("/dashboard",{replace:!0});return}const u=setTimeout(()=>{e||r("failed")},5e3);return()=>clearTimeout(u)},[s,t,e,n]),L.useEffect(()=>{if(!Mf&&s===null){const u=setTimeout(()=>r("failed"),3e3);return()=>clearTimeout(u)}},[s]),i==="processing"&&s!==!0&&(s===null||s===!1&&t)?F.jsx("div",{className:"min-h-screen bg-oai-gray-950"}):F.jsx("div",{className:"min-h-screen bg-oai-gray-950 text-white font-oai antialiased dark flex items-center justify-center",children:F.jsxs("div",{className:"text-center space-y-4 max-w-sm px-4",children:[i==="processing"&&F.jsxs(F.Fragment,{children:[F.jsx("div",{className:"w-8 h-8 border-2 border-oai-gray-600 border-t-white rounded-full animate-spin mx-auto"}),F.jsx("p",{className:"text-oai-gray-400 text-sm",children:"Processing…"})]}),i==="redirecting"&&F.jsxs(F.Fragment,{children:[F.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-green-500/15 flex items-center justify-center",children:F.jsx("svg",{className:"w-6 h-6 text-green-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:F.jsx("path",{d:"M20 6 9 17l-5-5"})})}),F.jsx("p",{className:"text-white text-sm font-medium",children:"Signed in successfully"}),F.jsx("p",{className:"text-oai-gray-500 text-xs",children:"Returning to TokenTracker…"})]}),i==="failed"&&F.jsxs("div",{className:"space-y-3",children:[F.jsx("p",{className:"text-oai-gray-300 text-sm",children:"Sign-in incomplete. Please try again."}),F.jsx("button",{type:"button",onClick:()=>window.close(),className:"px-4 py-2 rounded-lg bg-oai-gray-800 text-sm text-white hover:bg-oai-gray-700 transition-colors",children:"Close this page"})]})]})})}function y$(){const t=L.useContext(OT);if(t===null)throw new Error("useTheme must be used within a ThemeProvider");return t}const Fv="tt.sidebarCollapsed";function _$(){return[{id:"general",label:Ct("nav.group.general"),items:[{id:"usage",to:"/dashboard",icon:zz,label:Ct("nav.usage")},{id:"limits",to:"/limits",icon:Hz,label:Ct("nav.limits")},{id:"leaderboard",to:"/leaderboard",icon:rV,label:Ct("nav.leaderboard")}]},{id:"tools",label:Ct("nav.group.tools"),items:[{id:"widgets",to:"/widgets",icon:$z,label:Ct("nav.widgets")},{id:"ip-check",to:"/ip-check",icon:jz,label:"Claude IP Check"}]},{id:"account",label:Ct("nav.group.account"),items:[{id:"settings",to:"/settings",icon:tV,label:Ct("nav.settings")}]}]}function x$(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Fv)==="1"}catch{return!1}}function b$(){const[t,e]=L.useState(x$),n=L.useCallback(()=>{e(i=>{const r=!i;try{typeof window<"u"&&window.localStorage.setItem(Fv,r?"1":"0")}catch{}return r})},[]);return L.useEffect(()=>{if(typeof window>"u")return;const i=r=>{r.key===Fv&&e(r.newValue==="1")};return window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)},[]),{collapsed:t,toggle:n}}function S$(t,e){const n=t.replace(/\/+$/,"")||"/";return e==="/dashboard"?n==="/dashboard"||n==="/":e==="/leaderboard"?n==="/leaderboard"||n.startsWith("/leaderboard/"):n===e}function w$({label:t,collapsed:e,first:n}){return e?n?null:F.jsx("div",{className:"mx-2 my-2 h-px bg-oai-gray-200/70 dark:bg-oai-gray-800/70","aria-hidden":!0}):F.jsx("div",{className:Mn("px-3 pb-1 text-[10px] uppercase tracking-wider text-oai-gray-500 dark:text-oai-gray-500",n?"pt-2":"pt-4"),children:t})}function E$({item:t,collapsed:e,active:n,onClick:i}){const r=t.icon;return F.jsxs(Us,{to:t.to,onClick:i,title:e?t.label:void 0,"aria-current":n?"page":void 0,className:Mn("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] no-underline transition-colors",e&&"justify-center px-0 py-2",n?"bg-oai-gray-200/70 text-oai-black font-medium dark:bg-oai-gray-800 dark:text-white":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/50 hover:text-oai-black dark:hover:bg-oai-gray-800/60 dark:hover:text-white"),children:[F.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:F.jsx(r,{className:"h-[15px] w-[15px]","aria-hidden":!0})}),!e&&F.jsx("span",{className:"truncate",children:t.label})]})}function M$({as:t="button",title:e,onClick:n,href:i,children:r,className:s,...o}){const c=Mn("flex h-10 w-10 items-center justify-center rounded-lg text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",s);return t==="a"?F.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",title:e,"aria-label":e,className:c,...o,children:r}):F.jsx("button",{type:"button",title:e,"aria-label":e,onClick:n,className:c,...o,children:r})}function T$({repo:t="mm7894215/TokenTracker",glassChrome:e=!1}){const[n,i]=L.useState(null);return L.useEffect(()=>{if(typeof window>"u")return;const r=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;ZC({prefersReducedMotion:r,screenshotCapture:!1})&&fetch(`https://api.github.com/repos/${t}`).then(s=>s.json()).then(s=>{s&&typeof s.stargazers_count=="number"&&i(s.stargazers_count)}).catch(()=>{})},[t]),F.jsxs("a",{href:`https://github.com/${t}`,target:"_blank",rel:"noopener noreferrer","aria-label":n!==null?`Star on GitHub (${n})`:"Star on GitHub",className:Mn("inline-flex h-7 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",e?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:[F.jsx("svg",{height:"12",viewBox:"0 0 16 16",width:"12",className:"shrink-0 fill-current",children:F.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),F.jsx("span",{children:"Star"}),n!==null&&F.jsx("span",{className:"text-[10px] text-oai-gray-500 dark:text-oai-gray-500 tabular-nums",children:n})]})}const A$=[{value:"light",label:"Light",Icon:PC},{value:"dark",label:"Dark",Icon:CC},{value:"system",label:"System",Icon:Jz}];function C$({theme:t,resolvedTheme:e,onSetTheme:n,glassChrome:i=!1}){const[r,s]=L.useState(!1),o=L.useRef(null),c=e==="dark"?CC:PC;return L.useEffect(()=>{if(!r)return;const u=h=>{o.current&&!o.current.contains(h.target)&&s(!1)},d=h=>{h.key==="Escape"&&s(!1)};return document.addEventListener("mousedown",u),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",d)}},[r]),F.jsxs("div",{ref:o,className:"relative",children:[F.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":r,"aria-haspopup":"menu",title:"Theme",onClick:()=>s(u=>!u),className:Mn("inline-flex h-7 w-7 items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",i?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:F.jsx(c,{className:"h-3.5 w-3.5","aria-hidden":!0})}),r&&F.jsx("div",{role:"menu",className:"absolute bottom-full left-0 mb-2 z-50 min-w-[140px] py-1 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 shadow-lg",children:A$.map(({value:u,label:d,Icon:h})=>{const p=t===u;return F.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{n(u),s(!1)},className:Mn("flex w-full items-center gap-2.5 px-3 py-1.5 text-[13px] transition-colors",p?"text-oai-black dark:text-white bg-oai-gray-100 dark:bg-oai-gray-800":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800/60 hover:text-oai-black dark:hover:text-white"),children:[F.jsx(h,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),F.jsx("span",{children:d})]},u)})})]})}function OP({collapsed:t,onToggleCollapsed:e,onItemClick:n,showCloseButton:i=!1,onClose:r,glassChrome:s=!1}){const c=vr()?.pathname||"/",{theme:u,resolvedTheme:d,setTheme:h}=y$(),p=L.useMemo(()=>_$(),[]);return F.jsxs(F.Fragment,{children:[F.jsx("div",{className:Mn("px-2 pt-2 pb-2",t&&"flex justify-center"),children:i?F.jsxs("div",{className:"flex items-center gap-2",children:[F.jsx("div",{className:"flex-1 min-w-0",children:F.jsx(H0,{variant:"sidebar",collapsed:t,onAfterAction:n})}),F.jsx("button",{type:"button",onClick:r,"aria-label":Ct("nav.close_menu"),title:Ct("nav.close_menu"),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-oai-gray-500 dark:text-oai-gray-500 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-gray-900 dark:hover:text-oai-gray-200 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:F.jsx(RC,{className:"h-4 w-4",strokeWidth:1.75,"aria-hidden":!0})})]}):F.jsx(H0,{variant:"sidebar",collapsed:t,onAfterAction:n})}),F.jsx("nav",{"aria-label":Ct("nav.nav_label"),className:"flex-1 px-2 pb-2 flex flex-col overflow-y-auto",children:p.map((m,v)=>F.jsxs("div",{className:"flex flex-col",children:[F.jsx(w$,{label:m.label,collapsed:t,first:v===0}),F.jsx("div",{className:"flex flex-col gap-0.5",children:m.items.map(_=>F.jsx(E$,{item:_,collapsed:t,active:S$(c,_.to),onClick:n},_.id))})]},m.id))}),F.jsxs("div",{className:Mn("flex items-center px-2 py-3",t?"flex-col justify-center gap-2":"justify-between gap-2"),children:[F.jsx(C$,{theme:u,resolvedTheme:d,onSetTheme:h,glassChrome:s}),F.jsx("div",{className:"flex items-center gap-1.5",children:!t&&F.jsx(T$,{glassChrome:s})})]})]})}function P$({collapsed:t,onToggleCollapsed:e}){const n=L.useMemo(()=>typeof window>"u"?!1:Aa()||UT(),[]);return F.jsx("aside",{"aria-label":Ct("nav.aside_label"),className:Mn("hidden lg:flex flex-col shrink-0 h-full min-h-0 transition-[width] duration-200",t?"w-[72px]":"w-[220px]"),children:F.jsx(OP,{collapsed:t,onToggleCollapsed:e,glassChrome:n})})}function R$({open:t,onClose:e}){return L.useEffect(()=>{if(!t)return;const n=i=>{i.key==="Escape"&&e()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t,e]),L.useEffect(()=>{if(!t)return;const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}},[t]),t?F.jsxs("div",{className:"lg:hidden fixed inset-0 z-[80] flex",children:[F.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:e,"aria-hidden":!0}),F.jsx("aside",{"aria-label":Ct("nav.aside_label"),className:"relative w-[260px] max-w-[80vw] flex flex-col bg-oai-white dark:bg-oai-gray-900 border-r border-oai-gray-200 dark:border-oai-gray-800 shadow-2xl",children:F.jsx(OP,{collapsed:!1,showCloseButton:!0,onClose:e,onItemClick:e})})]}):null}function k$({onOpenDrawer:t}){return F.jsxs("div",{className:"lg:hidden flex items-center justify-between gap-2 px-3 h-14 border-b border-oai-gray-200 dark:border-oai-gray-800",children:[F.jsx(M$,{title:Ct("nav.menu"),onClick:t,children:F.jsx(Kz,{className:"h-5 w-5","aria-hidden":!0})}),F.jsxs(Us,{to:"/landing",className:"flex items-center gap-2 no-underline hover:opacity-80 transition-opacity","aria-label":"Token Tracker",children:[F.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),F.jsx("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white",children:"Token Tracker"})]}),F.jsx("div",{className:"w-10 shrink-0","aria-hidden":!0})]})}function L$({children:t}){const{collapsed:e,toggle:n}=b$(),[i,r]=L.useState(!1),s=L.useCallback(()=>r(!0),[]),o=L.useCallback(()=>r(!1),[]),c=L.useMemo(()=>typeof window>"u"?!1:Aa()||UT(),[]);return F.jsxs("div",{className:Mn("fixed inset-0 flex flex-col text-oai-black dark:text-oai-white font-sans overflow-hidden",c?"bg-transparent":"bg-oai-gray-100 dark:bg-oai-gray-950"),children:[c&&F.jsx("div",{className:"h-7 shrink-0",style:{WebkitAppRegion:"drag"},"aria-hidden":!0}),F.jsxs("div",{className:"flex-1 min-h-0 flex",children:[F.jsx(P$,{collapsed:e,onToggleCollapsed:n}),F.jsx(R$,{open:i,onClose:o}),F.jsx("div",{className:"flex-1 min-w-0 min-h-0 p-2 lg:pl-0 lg:pr-3 lg:pb-3 flex flex-col",children:F.jsxs("div",{className:Mn("flex-1 min-h-0 flex flex-col bg-oai-white dark:bg-oai-gray-900 border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",c?"tt-native-main-card":"rounded-2xl",!c&&"shadow-sm"),children:[F.jsx(k$,{onOpenDrawer:s}),F.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:t})]})})]})]})}const D$=hs.lazy(()=>No(()=>import("./DashboardPage-DiUhik_k.js"),__vite__mapDeps([0,1,2,3])).then(t=>({default:t.DashboardPage}))),N$=hs.lazy(()=>No(()=>import("./LeaderboardPage-ZpuPopCf.js"),__vite__mapDeps([4,5])).then(t=>({default:t.LeaderboardPage}))),I$=hs.lazy(()=>No(()=>import("./LeaderboardProfilePage-C62TdxVy.js"),__vite__mapDeps([6,5])).then(t=>({default:t.LeaderboardProfilePage}))),U$=hs.lazy(()=>No(()=>import("./LimitsPage-CQEaB_b2.js"),__vite__mapDeps([7,1,8,2,3])).then(t=>({default:t.LimitsPage}))),F$=hs.lazy(()=>No(()=>import("./SettingsPage-8RdfHCcA.js"),__vite__mapDeps([9,8,2,10])).then(t=>({default:t.SettingsPage}))),O$=hs.lazy(()=>No(()=>import("./WidgetsPage-DiKFOpFH.js"),__vite__mapDeps([11,3,10])).then(t=>({default:t.WidgetsPage}))),B$=hs.lazy(()=>No(()=>import("./IpCheckPage-UPn-zQGB.js"),[]));function z$(){const t=vr(),e=Do();lH();const n=xr(),i=L.useMemo(()=>typeof window>"u"?!1:$C(window.location.search),[]),r=t?.pathname||"/",s=new URL(window.location.href),o=s.pathname.replace(/\/+$/,"")||"/",u=o.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,d=s.searchParams.get("token")||null,h=u||d,p=o==="/share"||o==="/share.html"||o.startsWith("/share/"),m=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),v=r.replace(/\/+$/,"")||"/",_=v.match(/^\/leaderboard\/u\/([^/]+)$/i),w=_?_[1]:null,y=v==="/leaderboard"||!!w,b=!!(e.enabled&&e.signedIn),T=m||b,A=!1,M=iH(),I=L.useMemo(()=>!e.enabled||!b?null:{getAccessToken:()=>e.getAccessToken(),name:e.displayName||"",userId:e.user?.id||null},[e,b]);let k=m||n||i?"dashboard":"landing";v==="/landing"&&(k="landing"),v==="/dashboard"&&(k="dashboard"),y&&(k="dashboard");const U=v==="/limits";U&&(k="dashboard");const S=v==="/settings";S&&(k="dashboard");const P=v==="/widgets";P&&(k="dashboard");const V=v==="/ip-check";V&&(k="dashboard");const O=w?I$:v==="/leaderboard"?N$:U?U$:S?F$:P?O$:V?B$:D$,J=!p&&(v==="/dashboard"||v==="/"||v==="/leaderboard"||U||S||P||V),H=F.jsx("div",{className:"min-h-screen bg-oai-white dark:bg-[#050505]"});let X=null;if(v==="/auth/callback"||v==="/auth/native-callback")X=F.jsx(v$,{});else if(v==="/login")X=F.jsx(m$,{});else if(k==="landing")X=F.jsx(h$,{signInUrl:"/login",signUpUrl:"/login"});else{const K=F.jsx(L.Suspense,{fallback:H,children:F.jsx(O,{baseUrl:M,auth:I,signedIn:T,sessionSoftExpired:A,signOut:()=>e.enabled?e.signOut():Promise.resolve(),publicMode:p,publicToken:h,userId:w,signInUrl:"/login",signUpUrl:"/login"})});X=J?F.jsx(L$,{children:K}):K}return F.jsx(TF,{children:F.jsx(LF,{children:F.jsxs(DF,{children:[X,F.jsx(tH,{}),F.jsx(TU,{}),F.jsx(FU,{})]})})})}const V$=OL([{path:"*",element:F.jsx(z$,{})}]);T2.createRoot(document.getElementById("root")).render(F.jsx(hs.StrictMode,{children:F.jsx(fU,{children:F.jsx(JL,{router:V$})})}));export{jU as $,pT as A,Ct as B,y$ as C,F as D,gy as E,YU as F,LT as G,Ov as H,uF as I,mh as J,WS as K,HS as L,jy as M,EX as N,my as O,Ml as P,py as Q,BE as R,ZL as S,wT as T,pF as U,$S as V,Kl as W,AT as X,GS as Y,ET as Z,OU as _,pi as a,GU as a0,BU as a1,f0 as a2,TT as a3,bX as a4,HU as a5,SX as a6,MT as a7,wX as a8,Us as a9,vr as aA,Au as aB,kX as aC,RI as aD,Y$ as aE,LX as aF,dX as aG,q$ as aH,fX as aI,hH as aJ,H0 as aK,tV as aL,_X as aM,vy as aN,UT as aO,MX as aP,PX as aQ,TX as aR,AX as aS,CX as aT,PC as aU,CC as aV,Jz as aW,BS as aX,uX as aY,PI as aZ,Aa as a_,Lz as aa,Il as ab,rF as ac,hs as ad,RC as ae,sX as af,rX as ag,zT as ah,Do as ai,E5 as aj,No as ak,DX as al,cX as am,$C as an,Ta as ao,hX as ap,Z$ as aq,J$ as ar,aX as as,HI as at,Q$ as au,eX as av,pX as aw,iX as ax,uH as ay,Mn as az,VT as b,Ia as c,dw as d,br as e,An as f,mT as g,xr as h,PO as i,K$ as j,UI as k,xX as l,Gl as m,WI as n,$I as o,gX as p,nX as q,L as r,lX as s,vX as t,yy as u,yX as v,tX as w,kn as x,oX as y,mX as z};