tokentracker-cli 0.37.0 → 0.38.0

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 (43) hide show
  1. package/dashboard/dist/assets/{ActivityHeatmap-CHyQx8kb.js → ActivityHeatmap-DN2mmuWt.js} +1 -1
  2. package/dashboard/dist/assets/{Card-DnFsEPmk.js → Card-eNDH0TxH.js} +1 -1
  3. package/dashboard/dist/assets/{DashboardPage-C7Ec-LrI.js → DashboardPage-CzS5TxMe.js} +1 -1
  4. package/dashboard/dist/assets/{DevicePage-DFp21WlU.js → DevicePage-DEVImOIW.js} +1 -1
  5. package/dashboard/dist/assets/{DialogTitle-C7CwLbYz.js → DialogTitle-BJKAi66j.js} +1 -1
  6. package/dashboard/dist/assets/{FadeIn-CmqK4vog.js → FadeIn-DFk4dbUG.js} +1 -1
  7. package/dashboard/dist/assets/{HeaderGithubStar-Cu0-A7WB.js → HeaderGithubStar-D-r1KB-R.js} +1 -1
  8. package/dashboard/dist/assets/{IpCheckPage-Ct9pgqbB.js → IpCheckPage-D4FmaQyH.js} +1 -1
  9. package/dashboard/dist/assets/{LandingPage-Bb4n4XoT.js → LandingPage-DLwmI1xA.js} +1 -1
  10. package/dashboard/dist/assets/{LeaderboardAvatar-snuxOX5K.js → LeaderboardAvatar-DDZO2W2u.js} +1 -1
  11. package/dashboard/dist/assets/{LeaderboardPage-B-kigZ8J.js → LeaderboardPage-DcdnX8ha.js} +3 -3
  12. package/dashboard/dist/assets/{LeaderboardProfileModal-OqodFCGv.js → LeaderboardProfileModal-D3PwKHWY.js} +1 -1
  13. package/dashboard/dist/assets/{LeaderboardProfilePage-BspW68Xd.js → LeaderboardProfilePage-CnAg45qs.js} +1 -1
  14. package/dashboard/dist/assets/{LimitsPage-CS2NBEIP.js → LimitsPage-onwdR9lM.js} +1 -1
  15. package/dashboard/dist/assets/{LocalOnlyNotice-D0XXnH8l.js → LocalOnlyNotice-CbVonMVs.js} +1 -1
  16. package/dashboard/dist/assets/{LoginPage-8S9O3Gsb.js → LoginPage-DZpN9E7q.js} +1 -1
  17. package/dashboard/dist/assets/{PopoverPopup-BJb6Du8x.js → PopoverPopup-DCGh4euQ.js} +1 -1
  18. package/dashboard/dist/assets/{Select-DksFSHRb.js → Select-aIEVSJVR.js} +1 -1
  19. package/dashboard/dist/assets/{SelectItemText-DmE9ZyEL.js → SelectItemText-BH_vsFMS.js} +1 -1
  20. package/dashboard/dist/assets/{SettingsPage-BDRMT04n.js → SettingsPage-D2jlgb1x.js} +1 -1
  21. package/dashboard/dist/assets/{SkillsPage-DPHemuRK.js → SkillsPage-CTVaKIo2.js} +1 -1
  22. package/dashboard/dist/assets/{WidgetsPage-BOX3tPr8.js → WidgetsPage-B67l27g8.js} +1 -1
  23. package/dashboard/dist/assets/{WrappedPage-DWVJ6uf1.js → WrappedPage-wY4L8E_D.js} +1 -1
  24. package/dashboard/dist/assets/{agent-logos-C2IT3yLV.js → agent-logos-Bfb8Gcna.js} +1 -1
  25. package/dashboard/dist/assets/{arrow-up-right-CnvG5D97.js → arrow-up-right-RH7MeYHL.js} +1 -1
  26. package/dashboard/dist/assets/{download-C1zysMDD.js → download-Ds1ViaQ9.js} +1 -1
  27. package/dashboard/dist/assets/{info-DnI8z26t.js → info-DD3Xh30V.js} +1 -1
  28. package/dashboard/dist/assets/{main-BpChBpB7.js → main-BZBATt4l.js} +2 -2
  29. package/dashboard/dist/assets/{use-limits-display-prefs-sb2nFpV_.js → use-limits-display-prefs-C9k19eUo.js} +1 -1
  30. package/dashboard/dist/assets/{use-native-settings-DWh-bpfp.js → use-native-settings-HjLLYUkn.js} +1 -1
  31. package/dashboard/dist/assets/{use-usage-limits-DLSUBzW9.js → use-usage-limits-iJ3HJWfz.js} +1 -1
  32. package/dashboard/dist/assets/{useCurrency-B1Aa7Unc.js → useCurrency-Cr1NSPgK.js} +1 -1
  33. package/dashboard/dist/assets/{useOpenInteractionType-2Q4xhr62.js → useOpenInteractionType-B65bQ4-n.js} +1 -1
  34. package/dashboard/dist/index.html +1 -1
  35. package/dashboard/dist/share.html +1 -1
  36. package/package.json +1 -1
  37. package/src/commands/init.js +3 -3
  38. package/src/commands/status.js +9 -4
  39. package/src/commands/sync.js +26 -0
  40. package/src/lib/pricing/curated-overrides.json +1 -0
  41. package/src/lib/pricing/seed-snapshot.json +1 -1
  42. package/src/lib/rollout.js +208 -0
  43. package/src/lib/usage-limits.js +15 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LimitsPage-CS2NBEIP.js","assets/use-usage-limits-DLSUBzW9.js","assets/use-limits-display-prefs-sb2nFpV_.js","assets/Card-DnFsEPmk.js","assets/FadeIn-CmqK4vog.js","assets/LocalOnlyNotice-D0XXnH8l.js","assets/arrow-up-right-CnvG5D97.js","assets/download-C1zysMDD.js","assets/LeaderboardPage-B-kigZ8J.js","assets/Select-DksFSHRb.js","assets/SelectItemText-DmE9ZyEL.js","assets/useOpenInteractionType-2Q4xhr62.js","assets/useCurrency-B1Aa7Unc.js","assets/LeaderboardAvatar-snuxOX5K.js","assets/DashboardPage-C7Ec-LrI.js","assets/ActivityHeatmap-CHyQx8kb.js","assets/info-DnI8z26t.js","assets/DialogTitle-C7CwLbYz.js","assets/agent-logos-C2IT3yLV.js","assets/PopoverPopup-BJb6Du8x.js","assets/LandingPage-Bb4n4XoT.js","assets/HeaderGithubStar-Cu0-A7WB.js","assets/LeaderboardProfilePage-BspW68Xd.js","assets/LeaderboardProfileModal-OqodFCGv.js","assets/SettingsPage-BDRMT04n.js","assets/use-native-settings-DWh-bpfp.js","assets/SkillsPage-DPHemuRK.js","assets/WidgetsPage-BOX3tPr8.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LimitsPage-onwdR9lM.js","assets/use-usage-limits-iJ3HJWfz.js","assets/use-limits-display-prefs-C9k19eUo.js","assets/Card-eNDH0TxH.js","assets/FadeIn-DFk4dbUG.js","assets/LocalOnlyNotice-CbVonMVs.js","assets/arrow-up-right-RH7MeYHL.js","assets/download-Ds1ViaQ9.js","assets/LeaderboardPage-DcdnX8ha.js","assets/Select-aIEVSJVR.js","assets/SelectItemText-BH_vsFMS.js","assets/useOpenInteractionType-B65bQ4-n.js","assets/useCurrency-Cr1NSPgK.js","assets/LeaderboardAvatar-DDZO2W2u.js","assets/DashboardPage-CzS5TxMe.js","assets/ActivityHeatmap-DN2mmuWt.js","assets/info-DD3Xh30V.js","assets/DialogTitle-BJKAi66j.js","assets/agent-logos-Bfb8Gcna.js","assets/PopoverPopup-DCGh4euQ.js","assets/LandingPage-DLwmI1xA.js","assets/HeaderGithubStar-D-r1KB-R.js","assets/LeaderboardProfilePage-CnAg45qs.js","assets/LeaderboardProfileModal-D3PwKHWY.js","assets/SettingsPage-D2jlgb1x.js","assets/use-native-settings-HjLLYUkn.js","assets/SkillsPage-CTVaKIo2.js","assets/WidgetsPage-B67l27g8.js"])))=>i.map(i=>d[i]);
2
2
  function HC(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const o in a)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(a,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>a[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function s0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function WC(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function a(){var o=!1;try{o=this instanceof a}catch{}return o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,o.get?o:{enumerable:!0,get:function(){return e[a]}})}),n}var af={exports:{}},Ls={},rf={exports:{}},Je={};var Qv;function GC(){if(Qv)return Je;Qv=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.iterator;function v(D){return D===null||typeof D!="object"?null:(D=y&&D[y]||D["@@iterator"],typeof D=="function"?D:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,S={};function C(D,W,pe){this.props=D,this.context=W,this.refs=S,this.updater=pe||_}C.prototype.isReactComponent={},C.prototype.setState=function(D,W){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,W,"setState")},C.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function R(){}R.prototype=C.prototype;function M(D,W,pe){this.props=D,this.context=W,this.refs=S,this.updater=pe||_}var E=M.prototype=new R;E.constructor=M,x(E,C.prototype),E.isPureReactComponent=!0;var A=Array.isArray,U=Object.prototype.hasOwnProperty,F={current:null},$={key:!0,ref:!0,__self:!0,__source:!0};function P(D,W,pe){var me,ge={},xe=null,ze=null;if(W!=null)for(me in W.ref!==void 0&&(ze=W.ref),W.key!==void 0&&(xe=""+W.key),W)U.call(W,me)&&!$.hasOwnProperty(me)&&(ge[me]=W[me]);var Ye=arguments.length-2;if(Ye===1)ge.children=pe;else if(1<Ye){for(var je=Array(Ye),Rt=0;Rt<Ye;Rt++)je[Rt]=arguments[Rt+2];ge.children=je}if(D&&D.defaultProps)for(me in Ye=D.defaultProps,Ye)ge[me]===void 0&&(ge[me]=Ye[me]);return{$$typeof:e,type:D,key:xe,ref:ze,props:ge,_owner:F.current}}function Z(D,W){return{$$typeof:e,type:D.type,key:W,ref:D.ref,props:D.props,_owner:D._owner}}function X(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function fe(D){var W={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(pe){return W[pe]})}var he=/\/+/g;function Q(D,W){return typeof D=="object"&&D!==null&&D.key!=null?fe(""+D.key):W.toString(36)}function ne(D,W,pe,me,ge){var xe=typeof D;(xe==="undefined"||xe==="boolean")&&(D=null);var ze=!1;if(D===null)ze=!0;else switch(xe){case"string":case"number":ze=!0;break;case"object":switch(D.$$typeof){case e:case t:ze=!0}}if(ze)return ze=D,ge=ge(ze),D=me===""?"."+Q(ze,0):me,A(ge)?(pe="",D!=null&&(pe=D.replace(he,"$&/")+"/"),ne(ge,W,pe,"",function(Rt){return Rt})):ge!=null&&(X(ge)&&(ge=Z(ge,pe+(!ge.key||ze&&ze.key===ge.key?"":(""+ge.key).replace(he,"$&/")+"/")+D)),W.push(ge)),1;if(ze=0,me=me===""?".":me+":",A(D))for(var Ye=0;Ye<D.length;Ye++){xe=D[Ye];var je=me+Q(xe,Ye);ze+=ne(xe,W,pe,je,ge)}else if(je=v(D),typeof je=="function")for(D=je.call(D),Ye=0;!(xe=D.next()).done;)xe=xe.value,je=me+Q(xe,Ye++),ze+=ne(xe,W,pe,je,ge);else if(xe==="object")throw W=String(D),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.");return ze}function J(D,W,pe){if(D==null)return D;var me=[],ge=0;return ne(D,me,"","",function(xe){return W.call(pe,xe,ge++)}),me}function ee(D){if(D._status===-1){var W=D._result;W=W(),W.then(function(pe){(D._status===0||D._status===-1)&&(D._status=1,D._result=pe)},function(pe){(D._status===0||D._status===-1)&&(D._status=2,D._result=pe)}),D._status===-1&&(D._status=0,D._result=W)}if(D._status===1)return D._result.default;throw D._result}var se={current:null},z={transition:null},q={ReactCurrentDispatcher:se,ReactCurrentBatchConfig:z,ReactCurrentOwner:F};function V(){throw Error("act(...) is not supported in production builds of React.")}return Je.Children={map:J,forEach:function(D,W,pe){J(D,function(){W.apply(this,arguments)},pe)},count:function(D){var W=0;return J(D,function(){W++}),W},toArray:function(D){return J(D,function(W){return W})||[]},only:function(D){if(!X(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},Je.Component=C,Je.Fragment=n,Je.Profiler=o,Je.PureComponent=M,Je.StrictMode=a,Je.Suspense=f,Je.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,Je.act=V,Je.cloneElement=function(D,W,pe){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var me=x({},D.props),ge=D.key,xe=D.ref,ze=D._owner;if(W!=null){if(W.ref!==void 0&&(xe=W.ref,ze=F.current),W.key!==void 0&&(ge=""+W.key),D.type&&D.type.defaultProps)var Ye=D.type.defaultProps;for(je in W)U.call(W,je)&&!$.hasOwnProperty(je)&&(me[je]=W[je]===void 0&&Ye!==void 0?Ye[je]:W[je])}var je=arguments.length-2;if(je===1)me.children=pe;else if(1<je){Ye=Array(je);for(var Rt=0;Rt<je;Rt++)Ye[Rt]=arguments[Rt+2];me.children=Ye}return{$$typeof:e,type:D.type,key:ge,ref:xe,props:me,_owner:ze}},Je.createContext=function(D){return D={$$typeof:l,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:s,_context:D},D.Consumer=D},Je.createElement=P,Je.createFactory=function(D){var W=P.bind(null,D);return W.type=D,W},Je.createRef=function(){return{current:null}},Je.forwardRef=function(D){return{$$typeof:u,render:D}},Je.isValidElement=X,Je.lazy=function(D){return{$$typeof:m,_payload:{_status:-1,_result:D},_init:ee}},Je.memo=function(D,W){return{$$typeof:h,type:D,compare:W===void 0?null:W}},Je.startTransition=function(D){var W=z.transition;z.transition={};try{D()}finally{z.transition=W}},Je.unstable_act=V,Je.useCallback=function(D,W){return se.current.useCallback(D,W)},Je.useContext=function(D){return se.current.useContext(D)},Je.useDebugValue=function(){},Je.useDeferredValue=function(D){return se.current.useDeferredValue(D)},Je.useEffect=function(D,W){return se.current.useEffect(D,W)},Je.useId=function(){return se.current.useId()},Je.useImperativeHandle=function(D,W,pe){return se.current.useImperativeHandle(D,W,pe)},Je.useInsertionEffect=function(D,W){return se.current.useInsertionEffect(D,W)},Je.useLayoutEffect=function(D,W){return se.current.useLayoutEffect(D,W)},Je.useMemo=function(D,W){return se.current.useMemo(D,W)},Je.useReducer=function(D,W,pe){return se.current.useReducer(D,W,pe)},Je.useRef=function(D){return se.current.useRef(D)},Je.useState=function(D){return se.current.useState(D)},Je.useSyncExternalStore=function(D,W,pe){return se.current.useSyncExternalStore(D,W,pe)},Je.useTransition=function(){return se.current.useTransition()},Je.version="18.3.1",Je}var Jv;function Jp(){return Jv||(Jv=1,rf.exports=GC()),rf.exports}var eb;function KC(){if(eb)return Ls;eb=1;var e=Jp(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function l(u,f,h){var m,y={},v=null,_=null;h!==void 0&&(v=""+h),f.key!==void 0&&(v=""+f.key),f.ref!==void 0&&(_=f.ref);for(m in f)a.call(f,m)&&!s.hasOwnProperty(m)&&(y[m]=f[m]);if(u&&u.defaultProps)for(m in f=u.defaultProps,f)y[m]===void 0&&(y[m]=f[m]);return{$$typeof:t,type:u,key:v,ref:_,props:y,_owner:o.current}}return Ls.Fragment=n,Ls.jsx=l,Ls.jsxs=l,Ls}var tb;function qC(){return tb||(tb=1,af.exports=KC()),af.exports}var T=qC(),k=Jp();const rl=s0(k),em=HC({__proto__:null,default:rl},[k]);var Bc={},of={exports:{}},En={},sf={exports:{}},lf={};var nb;function YC(){return nb||(nb=1,(function(e){function t(z,q){var V=z.length;z.push(q);e:for(;0<V;){var D=V-1>>>1,W=z[D];if(0<o(W,q))z[D]=q,z[V]=W,V=D;else break e}}function n(z){return z.length===0?null:z[0]}function a(z){if(z.length===0)return null;var q=z[0],V=z.pop();if(V!==q){z[0]=V;e:for(var D=0,W=z.length,pe=W>>>1;D<pe;){var me=2*(D+1)-1,ge=z[me],xe=me+1,ze=z[xe];if(0>o(ge,V))xe<W&&0>o(ze,ge)?(z[D]=ze,z[xe]=V,D=xe):(z[D]=ge,z[me]=V,D=me);else if(xe<W&&0>o(ze,V))z[D]=ze,z[xe]=V,D=xe;else break e}}return q}function o(z,q){var V=z.sortIndex-q.sortIndex;return V!==0?V:z.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var f=[],h=[],m=1,y=null,v=3,_=!1,x=!1,S=!1,C=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(z){for(var q=n(h);q!==null;){if(q.callback===null)a(h);else if(q.startTime<=z)a(h),q.sortIndex=q.expirationTime,t(f,q);else break;q=n(h)}}function A(z){if(S=!1,E(z),!x)if(n(f)!==null)x=!0,ee(U);else{var q=n(h);q!==null&&se(A,q.startTime-z)}}function U(z,q){x=!1,S&&(S=!1,R(P),P=-1),_=!0;var V=v;try{for(E(q),y=n(f);y!==null&&(!(y.expirationTime>q)||z&&!fe());){var D=y.callback;if(typeof D=="function"){y.callback=null,v=y.priorityLevel;var W=D(y.expirationTime<=q);q=e.unstable_now(),typeof W=="function"?y.callback=W:y===n(f)&&a(f),E(q)}else a(f);y=n(f)}if(y!==null)var pe=!0;else{var me=n(h);me!==null&&se(A,me.startTime-q),pe=!1}return pe}finally{y=null,v=V,_=!1}}var F=!1,$=null,P=-1,Z=5,X=-1;function fe(){return!(e.unstable_now()-X<Z)}function he(){if($!==null){var z=e.unstable_now();X=z;var q=!0;try{q=$(!0,z)}finally{q?Q():(F=!1,$=null)}}else F=!1}var Q;if(typeof M=="function")Q=function(){M(he)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,J=ne.port2;ne.port1.onmessage=he,Q=function(){J.postMessage(null)}}else Q=function(){C(he,0)};function ee(z){$=z,F||(F=!0,Q())}function se(z,q){P=C(function(){z(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_continueExecution=function(){x||_||(x=!0,ee(U))},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(z){switch(v){case 1:case 2:case 3:var q=3;break;default:q=v}var V=v;v=q;try{return z()}finally{v=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(z,q){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var V=v;v=z;try{return q()}finally{v=V}},e.unstable_scheduleCallback=function(z,q,V){var D=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?D+V:D):V=D,z){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=V+W,z={id:m++,callback:q,priorityLevel:z,startTime:V,expirationTime:W,sortIndex:-1},V>D?(z.sortIndex=V,t(h,z),n(f)===null&&z===n(h)&&(S?(R(P),P=-1):S=!0,se(A,V-D))):(z.sortIndex=W,t(f,z),x||_||(x=!0,ee(U))),z},e.unstable_shouldYield=fe,e.unstable_wrapCallback=function(z){var q=v;return function(){var V=v;v=q;try{return z.apply(this,arguments)}finally{v=V}}}})(lf)),lf}var ab;function ZC(){return ab||(ab=1,sf.exports=YC()),sf.exports}var rb;function XC(){if(rb)return En;rb=1;var e=Jp(),t=ZC();function n(r){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+r,c=1;c<arguments.length;c++)i+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,o={};function s(r,i){l(r,i),l(r+"Capture",i)}function l(r,i){for(o[r]=i,r=0;r<i.length;r++)a.add(i[r])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[: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]*$/,m={},y={};function v(r){return f.call(y,r)?!0:f.call(m,r)?!1:h.test(r)?y[r]=!0:(m[r]=!0,!1)}function _(r,i,c,d){if(c!==null&&c.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return d?!1:c!==null?!c.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function x(r,i,c,d){if(i===null||typeof i>"u"||_(r,i,c,d))return!0;if(d)return!1;if(c!==null)switch(c.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function S(r,i,c,d,p,g,w){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=d,this.attributeNamespace=p,this.mustUseProperty=c,this.propertyName=r,this.type=i,this.sanitizeURL=g,this.removeEmptyString=w}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){C[r]=new S(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var i=r[0];C[i]=new S(i,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){C[r]=new S(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){C[r]=new S(r,2,!1,r,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(r){C[r]=new S(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){C[r]=new S(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){C[r]=new S(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){C[r]=new S(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){C[r]=new S(r,5,!1,r.toLowerCase(),null,!1,!1)});var R=/[\-:]([a-z])/g;function M(r){return r[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(r){var i=r.replace(R,M);C[i]=new S(i,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var i=r.replace(R,M);C[i]=new S(i,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var i=r.replace(R,M);C[i]=new S(i,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){C[r]=new S(r,1,!1,r.toLowerCase(),null,!1,!1)}),C.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){C[r]=new S(r,1,!1,r.toLowerCase(),null,!0,!0)});function E(r,i,c,d){var p=C.hasOwnProperty(i)?C[i]:null;(p!==null?p.type!==0:d||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(x(i,c,p,d)&&(c=null),d||p===null?v(i)&&(c===null?r.removeAttribute(i):r.setAttribute(i,""+c)):p.mustUseProperty?r[p.propertyName]=c===null?p.type===3?!1:"":c:(i=p.attributeName,d=p.attributeNamespace,c===null?r.removeAttribute(i):(p=p.type,c=p===3||p===4&&c===!0?"":""+c,d?r.setAttributeNS(d,i,c):r.setAttribute(i,c))))}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,U=Symbol.for("react.element"),F=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),Z=Symbol.for("react.profiler"),X=Symbol.for("react.provider"),fe=Symbol.for("react.context"),he=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),ee=Symbol.for("react.lazy"),se=Symbol.for("react.offscreen"),z=Symbol.iterator;function q(r){return r===null||typeof r!="object"?null:(r=z&&r[z]||r["@@iterator"],typeof r=="function"?r:null)}var V=Object.assign,D;function W(r){if(D===void 0)try{throw Error()}catch(c){var i=c.stack.trim().match(/\n( *(at )?)/);D=i&&i[1]||""}return`
3
3
  `+D+r}var pe=!1;function me(r,i){if(!r||pe)return"";pe=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(Y){var d=Y}Reflect.construct(r,[],i)}else{try{i.call()}catch(Y){d=Y}r.call(i.prototype)}else{try{throw Error()}catch(Y){d=Y}r()}}catch(Y){if(Y&&d&&typeof Y.stack=="string"){for(var p=Y.stack.split(`
4
4
  `),g=d.stack.split(`
@@ -966,4 +966,4 @@ skills.usage.disclaimer,ui,SkillsPage,SkillDetailPanel,usage_disclaimer,"Counts
966
966
  ${M}px !important;
967
967
  ${E}px !important;
968
968
  }
969
- `),()=>{u.current?.removeAttribute("data-motion-pop-id"),U.contains(A)&&U.removeChild(A)}},[t]),T.jsx(jN,{isPresent:t,childRef:u,sizeRef:f,pop:s,children:s===!1?e:k.cloneElement(e,{ref:y})})}const BN=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:o,presenceAffectsLayout:s,mode:l,anchorX:u,anchorY:f,root:h})=>{const m=Bm(zN),y=k.useId();let v=!0,_=k.useMemo(()=>(v=!1,{id:y,initial:t,isPresent:n,custom:o,onExitComplete:x=>{m.set(x,!0);for(const S of m.values())if(!S)return;a&&a()},register:x=>(m.set(x,!1),()=>m.delete(x))}),[n,m,a]);return s&&v&&(_={..._}),k.useMemo(()=>{m.forEach((x,S)=>m.set(S,!1))},[n]),k.useEffect(()=>{!n&&!m.size&&a&&a()},[n]),e=T.jsx(UN,{pop:l==="popLayout",isPresent:n,anchorX:u,anchorY:f,root:h,children:e}),T.jsx(gd.Provider,{value:_,children:e})};function zN(){return new Map}function W1(e=!0){const t=k.useContext(gd);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:o}=t,s=k.useId();k.useEffect(()=>{if(e)return o(s)},[e]);const l=k.useCallback(()=>e&&a&&a(s),[s,a,e]);return!n&&a?[!1,l]:[!0]}const Yc=e=>e.key||"";function w_(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const G1=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:s="sync",propagate:l=!1,anchorX:u="left",anchorY:f="top",root:h})=>{const[m,y]=W1(l),v=k.useMemo(()=>w_(e),[e]),_=l&&!m?[]:v.map(Yc),x=k.useRef(!0),S=k.useRef(v),C=Bm(()=>new Map),R=k.useRef(new Set),[M,E]=k.useState(v),[A,U]=k.useState(v);vx(()=>{x.current=!1,S.current=v;for(let P=0;P<A.length;P++){const Z=Yc(A[P]);_.includes(Z)?(C.delete(Z),R.current.delete(Z)):C.get(Z)!==!0&&C.set(Z,!1)}},[A,_.length,_.join("-")]);const F=[];if(v!==M){let P=[...v];for(let Z=0;Z<A.length;Z++){const X=A[Z],fe=Yc(X);_.includes(fe)||(P.splice(Z,0,X),F.push(X))}return s==="wait"&&F.length&&(P=F),U(w_(P)),E(v),null}const{forceRender:$}=k.useContext(Um);return T.jsx(T.Fragment,{children:A.map(P=>{const Z=Yc(P),X=l&&!m?!1:v===A||_.includes(Z),fe=()=>{if(R.current.has(Z))return;if(C.has(Z))R.current.add(Z),C.set(Z,!0);else return;let he=!0;C.forEach(Q=>{Q||(he=!1)}),he&&($?.(),U(S.current),l&&y?.(),a&&a())};return T.jsx(BN,{isPresent:X,initial:!x.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:h,onExitComplete:X?void 0:fe,anchorX:u,anchorY:f,children:P},Z)})})},K1=k.createContext({strict:!1}),x_={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 P_=!1;function FN(){if(P_)return;const e={};for(const t in x_)e[t]={isEnabled:n=>x_[t].some(a=>!!n[a])};_1(e),P_=!0}function q1(){return FN(),S5()}function VN(e){const t=q1();for(const n in e)t[n]={...t[n],...e[n]};_1(t)}const $N=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 Qu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||$N.has(e)}let Y1=e=>!Qu(e);function HN(e){typeof e=="function"&&(Y1=t=>t.startsWith("on")?!Qu(t):e(t))}try{HN(require("@emotion/is-prop-valid").default)}catch{}function WN(e,t,n){const a={};for(const o in e)o==="values"&&typeof e.values=="object"||nn(e[o])||(Y1(o)||n===!0&&Qu(o)||!t&&!Qu(o)||e.draggable&&o.startsWith("onDrag"))&&(a[o]=e[o]);return a}const kd=k.createContext({});function GN(e,t){if(bd(e)){const{initial:n,animate:a}=e;return{initial:n===!1||fl(n)?n:void 0,animate:fl(a)?a:void 0}}return e.inherit!==!1?t:{}}function KN(e){const{initial:t,animate:n}=GN(e,k.useContext(kd));return k.useMemo(()=>({initial:t,animate:n}),[S_(t),S_(n)])}function S_(e){return Array.isArray(e)?e.join(" "):e}const hg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Z1(e,t,n){for(const a in t)!nn(t[a])&&!E1(a,n)&&(e[a]=t[a])}function qN({transformTemplate:e},t){return k.useMemo(()=>{const n=hg();return cg(n,t,e),Object.assign({},n.vars,n.style)},[t])}function YN(e,t){const n=e.style||{},a={};return Z1(a,n,e),Object.assign(a,qN(e,t)),a}function ZN(e,t){const n={},a=YN(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=a,n}const X1=()=>({...hg(),attrs:{}});function XN(e,t,n,a){const o=k.useMemo(()=>{const s=X1();return A1(s,t,L1(a),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Z1(s,e.style,e),o.style={...s,...o.style}}return o}const QN=["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 fg(e){return typeof e!="string"||e.includes("-")?!1:!!(QN.indexOf(e)>-1||/[A-Z]/u.test(e))}function JN(e,t,n,{latestValues:a},o,s=!1,l){const f=(l??fg(e)?XN:ZN)(t,a,o,e),h=WN(t,typeof e=="string",s),m=e!==k.Fragment?{...h,...f,ref:n}:{},{children:y}=t,v=k.useMemo(()=>nn(y)?y.get():y,[y]);return k.createElement(e,{...m,children:v})}function eO({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,o){return{latestValues:tO(n,a,o,e),renderState:t()}}function tO(e,t,n,a){const o={},s=a(e,{});for(const v in s)o[v]=wu(s[v]);let{initial:l,animate:u}=e;const f=bd(e),h=b1(e);t&&h&&!f&&e.inherit!==!1&&(l===void 0&&(l=t.initial),u===void 0&&(u=t.animate));let m=n?n.initial===!1:!1;m=m||l===!1;const y=m?u:l;if(y&&typeof y!="boolean"&&!vd(y)){const v=Array.isArray(y)?y:[y];for(let _=0;_<v.length;_++){const x=eg(e,v[_]);if(x){const{transitionEnd:S,transition:C,...R}=x;for(const M in R){let E=R[M];if(Array.isArray(E)){const A=m?E.length-1:0;E=E[A]}E!==null&&(o[M]=E)}for(const M in S)o[M]=S[M]}}}return o}const Q1=e=>(t,n)=>{const a=k.useContext(kd),o=k.useContext(gd),s=()=>eO(e,t,a,o);return n?s():Bm(s)},nO=Q1({scrapeMotionValuesFromProps:ug,createRenderState:hg}),aO=Q1({scrapeMotionValuesFromProps:D1,createRenderState:X1}),rO=Symbol.for("motionComponentSymbol");function iO(e,t,n){const a=k.useRef(n);k.useInsertionEffect(()=>{a.current=n});const o=k.useRef(null);return k.useCallback(s=>{s&&e.onMount?.(s);const l=a.current;if(typeof l=="function")if(s){const u=l(s);typeof u=="function"&&(o.current=u)}else o.current?(o.current(),o.current=null):l(s);else l&&(l.current=s);t&&(s?t.mount(s):t.unmount())},[t])}const J1=k.createContext({});function xo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function oO(e,t,n,a,o,s){const{visualElement:l}=k.useContext(kd),u=k.useContext(K1),f=k.useContext(gd),h=k.useContext(dg),m=h.reducedMotion,y=h.skipAnimations,v=k.useRef(null),_=k.useRef(!1);a=a||u.renderer,!v.current&&a&&(v.current=a(e,{visualState:t,parent:l,props:n,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:m,skipAnimations:y,isSVG:s}),_.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const x=v.current,S=k.useContext(J1);x&&!x.projection&&o&&(x.type==="html"||x.type==="svg")&&sO(v.current,n,o,S);const C=k.useRef(!1);k.useInsertionEffect(()=>{x&&C.current&&x.update(n,f)});const R=n[o1],M=k.useRef(!!R&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(R)&&window.MotionHasOptimisedAnimation?.(R));return vx(()=>{_.current=!0,x&&(C.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),M.current&&x.animationState&&x.animationState.animateChanges())}),k.useEffect(()=>{x&&(!M.current&&x.animationState&&x.animationState.animateChanges(),M.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(R)}),M.current=!1),x.enteringChildren=void 0)}),x}function sO(e,t,n,a){const{layoutId:o,layout:s,drag:l,dragConstraints:u,layoutScroll:f,layoutRoot:h,layoutAnchor:m,layoutCrossfade:y}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:eP(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!l||u&&xo(u),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:a,crossfade:y,layoutScroll:f,layoutRoot:h,layoutAnchor:m})}function eP(e){if(e)return e.options.allowProjection!==!1?e.projection:eP(e.parent)}function jf(e,{forwardMotionProps:t=!1,type:n}={},a,o){a&&VN(a);const s=n?n==="svg":fg(e),l=s?aO:nO;function u(h,m){let y;const v={...k.useContext(dg),...h,layoutId:lO(h)},{isStatic:_}=v,x=KN(h),S=l(h,_);if(!_&&typeof window<"u"){cO();const C=uO(v);y=C.MeasureLayout,x.visualElement=oO(e,S,v,o,C.ProjectionNode,s)}return T.jsxs(kd.Provider,{value:x,children:[y&&x.visualElement?T.jsx(y,{visualElement:x.visualElement,...v}):null,JN(e,h,iO(S,x.visualElement,m),S,_,t,s)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const f=k.forwardRef(u);return f[rO]=e,f}function lO({layoutId:e}){const t=k.useContext(Um).id;return t&&e!==void 0?t+"-"+e:e}function cO(e,t){k.useContext(K1).strict}function uO(e){const t=q1(),{drag:n,layout:a}=t;if(!n&&!a)return{};const o={...n,...a};return{MeasureLayout:n?.isEnabled(e)||a?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function dO(e,t){if(typeof Proxy>"u")return jf;const n=new Map,a=(s,l)=>jf(s,l,e,t),o=(s,l)=>a(s,l);return new Proxy(o,{get:(s,l)=>l==="create"?a:(n.has(l)||n.set(l,jf(l,void 0,e,t)),n.get(l))})}const hO=(e,t)=>t.isSVG??fg(e)?new V5(t):new O5(t,{allowProjection:e!==k.Fragment});class fO extends Xr{constructor(t){super(t),t.animationState||(t.animationState=K5(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();vd(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let pO=0;class mO extends Xr{constructor(){super(...arguments),this.id=pO++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===a)return;if(t&&a===!1){if(this.isExitComplete){const{initial:s,custom:l}=this.node.getProps();if(typeof s=="string"){const u=Ti(this.node,s,l);if(u){const{transition:f,transitionEnd:h,...m}=u;for(const y in m)this.node.getValue(y)?.jump(m[y])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const gO={animation:{Feature:fO},exit:{Feature:mO}};function Ll(e){return{point:{x:e.pageX,y:e.pageY}}}const yO=e=>t=>rg(t)&&e(t,Ll(t));function el(e,t,n,a){return pl(e,t,yO(n),a)}const tP=({current:e})=>e?e.ownerDocument.defaultView:null,C_=(e,t)=>Math.abs(e-t);function vO(e,t){const n=C_(e.x,t.x),a=C_(e.y,t.y);return Math.sqrt(n**2+a**2)}const T_=new Set(["auto","scroll"]);class nP{constructor(t,n,{transformPagePoint:a,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:l=3,element:u}={}){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=_=>{this.handleScroll(_.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Zc(this.lastRawMoveEventInfo,this.transformPagePoint));const _=Uf(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,S=vO(_.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!S)return;const{point:C}=_,{timestamp:R}=tn;this.history.push({...C,timestamp:R});const{onStart:M,onMove:E}=this.handlers;x||(M&&M(this.lastMoveEvent,_),this.startEvent=this.lastMoveEvent),E&&E(this.lastMoveEvent,_)},this.handlePointerMove=(_,x)=>{this.lastMoveEvent=_,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=Zc(x,this.transformPagePoint),gt.update(this.updatePoint,!0)},this.handlePointerUp=(_,x)=>{this.end();const{onEnd:S,onSessionEnd:C,resumeAnimation:R}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&R&&R(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const M=Uf(_.type==="pointercancel"?this.lastMoveEventInfo:Zc(x,this.transformPagePoint),this.history);this.startEvent&&S&&S(_,M),C&&C(_,M)},!rg(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=l,this.contextWindow=o||window;const f=Ll(t),h=Zc(f,this.transformPagePoint),{point:m}=h,{timestamp:y}=tn;this.history=[{...m,timestamp:y}];const{onSessionStart:v}=n;v&&v(t,Uf(h,this.history)),this.removeListeners=El(el(this.contextWindow,"pointermove",this.handlePointerMove),el(this.contextWindow,"pointerup",this.handlePointerUp),el(this.contextWindow,"pointercancel",this.handlePointerUp)),u&&this.startScrollTracking(u)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(T_.has(a.overflowX)||T_.has(a.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(t){const n=this.scrollPositions.get(t);if(!n)return;const a=t===window,o=a?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:o.x-n.x,y:o.y-n.y};s.x===0&&s.y===0||(a?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(t,o),gt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),qr(this.updatePoint)}}function Zc(e,t){return t?{point:t(e.point)}:e}function E_(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Uf({point:e},t){return{point:e,delta:E_(e,aP(t)),offset:E_(e,bO(t)),velocity:kO(t,.1)}}function bO(e){return e[0]}function aP(e){return e[e.length-1]}function kO(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const o=aP(e);for(;n>=0&&(a=e[n],!(o.timestamp-a.timestamp>zn(t)));)n--;if(!a)return{x:0,y:0};a===e[0]&&e.length>2&&o.timestamp-a.timestamp>zn(t)*2&&(a=e[1]);const s=Zn(o.timestamp-a.timestamp);if(s===0)return{x:0,y:0};const l={x:(o.x-a.x)/s,y:(o.y-a.y)/s};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function _O(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?Pt(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?Pt(n,e,a.max):Math.min(e,n)),e}function A_(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function wO(e,{top:t,left:n,bottom:a,right:o}){return{x:A_(e.x,n,o),y:A_(e.y,t,a)}}function R_(e,t){let n=t.min-e.min,a=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,a]=[a,n]),{min:n,max:a}}function xO(e,t){return{x:R_(e.x,t.x),y:R_(e.y,t.y)}}function PO(e,t){let n=.5;const a=vn(e),o=vn(t);return o>a?n=dl(t.min,t.max-a,e.min):a>o&&(n=dl(e.min,e.max-o,t.min)),ja(0,1,n)}function SO(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Up=.35;function CO(e=Up){return e===!1?e=0:e===!0&&(e=Up),{x:L_(e,"left","right"),y:L_(e,"top","bottom")}}function L_(e,t,n){return{min:D_(e,t),max:D_(e,n)}}function D_(e,t){return typeof e=="number"?e:e[t]||0}const TO=new WeakMap;class EO{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ht(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=y=>{n&&this.snapToCursor(Ll(y).point),this.stopAnimation()},l=(y,v)=>{const{drag:_,dragPropagation:x,onDragStart:S}=this.getProps();if(_&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=n5(_),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ea(R=>{let M=this.getAxisMotionValue(R).get()||0;if(Da.test(M)){const{projection:E}=this.visualElement;if(E&&E.layout){const A=E.layout.layoutBox[R];A&&(M=vn(A)*(parseFloat(M)/100))}}this.originPoint[R]=M}),S&&gt.update(()=>S(y,v),!1,!0),Rp(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},u=(y,v)=>{this.latestPointerEvent=y,this.latestPanInfo=v;const{dragPropagation:_,dragDirectionLock:x,onDirectionLock:S,onDrag:C}=this.getProps();if(!_&&!this.openDragLock)return;const{offset:R}=v;if(x&&this.currentDirection===null){this.currentDirection=RO(R),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",v.point,R),this.updateAxis("y",v.point,R),this.visualElement.render(),C&&gt.update(()=>C(y,v),!1,!0)},f=(y,v)=>{this.latestPointerEvent=y,this.latestPanInfo=v,this.stop(y,v),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>{const{dragSnapToOrigin:y}=this.getProps();(y||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new nP(t,{onSessionStart:s,onStart:l,onMove:u,onSessionEnd:f,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:a,contextWindow:tP(this.visualElement),element:this.visualElement.current})}stop(t,n){const a=t||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!a)return;const{velocity:l}=o;this.startAnimation(l);const{onDragEnd:u}=this.getProps();u&&gt.postRender(()=>u(a,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,a){const{drag:o}=this.getProps();if(!a||!Xc(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let l=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(l=_O(l,this.constraints[t],this.elastic[t])),s.set(l)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&xo(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=wO(a.layoutBox,t):this.constraints=!1,this.elastic=CO(n),o!==this.constraints&&!xo(t)&&a&&this.constraints&&!this.hasMutatedConstraints&&Ea(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=SO(a.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!xo(t))return!1;const a=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=R5(a,o.root,this.visualElement.getTransformPagePoint());let l=xO(o.layout.layoutBox,s);if(n){const u=n(T5(l));this.hasMutatedConstraints=!!u,u&&(l=x1(u))}return l}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:o,dragTransition:s,dragSnapToOrigin:l,onDragTransitionEnd:u}=this.getProps(),f=this.constraints||{},h=Ea(m=>{if(!Xc(m,n,this.currentDirection))return;let y=f&&f[m]||{};(l===!0||l===m)&&(y={min:0,max:0});const v=o?200:1e6,_=o?40:1e7,x={type:"inertia",velocity:a?t[m]:0,bounceStiffness:v,bounceDamping:_,timeConstant:750,restDelta:1,restSpeed:10,...s,...y};return this.startAxisValueAnimation(m,x)});return Promise.all(h).then(u)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return Rp(this.visualElement,t),a.start(Jm(t,a,0,n,this.visualElement,!1))}stopAnimation(){Ea(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps(),o=a[n];return o||this.visualElement.getValue(t,(a.initial?a.initial[t]:void 0)||0)}snapToCursor(t){Ea(n=>{const{drag:a}=this.getProps();if(!Xc(n,a,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:l,max:u}=o.layout.layoutBox[n],f=s.get()||0;s.set(t[n]-Pt(l,u,.5)+f)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!xo(n)||!a||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Ea(l=>{const u=this.getAxisMotionValue(l);if(u&&this.constraints!==!1){const f=u.get();o[l]=PO({min:f,max:f},this.constraints[l])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ea(l=>{if(!Xc(l,t,null))return;const u=this.getAxisMotionValue(l),{min:f,max:h}=this.constraints[l];u.set(Pt(f,h,o[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;TO.set(this.visualElement,this);const t=this.visualElement.current,n=el(t,"pointerdown",h=>{const{drag:m,dragListener:y=!0}=this.getProps(),v=h.target,_=v!==t&&l5(v);m&&y&&!_&&this.start(h)});let a;const o=()=>{const{dragConstraints:h}=this.getProps();xo(h)&&h.current&&(this.constraints=this.resolveRefConstraints(),a||(a=AO(t,h.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,l=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),gt.read(o);const u=pl(window,"resize",()=>this.scalePositionWithinConstraints()),f=s.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(Ea(y=>{const v=this.getAxisMotionValue(y);v&&(this.originPoint[y]+=h[y].translate,v.set(v.get()+h[y].translate))}),this.visualElement.render())}));return()=>{u(),n(),l(),f&&f(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:l=Up,dragMomentum:u=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:o,dragConstraints:s,dragElastic:l,dragMomentum:u}}}function I_(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function AO(e,t,n){const a=zk(e,I_(n)),o=zk(t,I_(n));return()=>{a(),o()}}function Xc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function RO(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class LO extends Xr{constructor(t){super(t),this.removeGroupControls=Xn,this.removeListeners=Xn,this.controls=new EO(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Xn}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Bf=e=>(t,n)=>{e&&gt.update(()=>e(t,n),!1,!0)};class DO extends Xr{constructor(){super(...arguments),this.removePointerDownListener=Xn}onPointerDown(t){this.session=new nP(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tP(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:o}=this.node.getProps();return{onSessionStart:Bf(t),onStart:Bf(n),onMove:Bf(a),onEnd:(s,l)=>{delete this.session,o&&gt.postRender(()=>o(s,l))}}}mount(){this.removePointerDownListener=el(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let zf=!1;class IO extends k.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a,layoutId:o}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),a&&a.register&&o&&a.register(s),zf&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),xu.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:o,isPresent:s}=this.props,{projection:l}=a;return l&&(l.isPresent=s,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),zf=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?l.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?l.promote():l.relegate()||gt.postRender(()=>{const u=l.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:a}=t;a&&(a.options.layoutAnchor=n,a.root.didUpdate(),ag.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:o}=t;zf=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),a&&a.deregister&&a.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function rP(e){const[t,n]=W1(),a=k.useContext(Um);return T.jsx(IO,{...e,layoutGroup:a,switchLayoutGroup:k.useContext(J1),isPresent:t,safeToRemove:n})}const MO={pan:{Feature:DO},drag:{Feature:LO,ProjectionNode:H1,MeasureLayout:rP}};function M_(e,t,n){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=a[o];s&&gt.postRender(()=>s(t,Ll(t)))}class NO extends Xr{mount(){const{current:t}=this.node;t&&(this.unmount=r5(t,(n,a)=>(M_(this.node,a,"Start"),o=>M_(this.node,o,"End"))))}unmount(){}}class OO extends Xr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=El(pl(this.node.current,"focus",()=>this.onFocus()),pl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function N_(e,t,n){const{props:a}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&a.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=a[o];s&&gt.postRender(()=>s(t,Ll(t)))}class jO extends Xr{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:a}=this.node.props;this.unmount=u5(t,(o,s)=>(N_(this.node,s,"Start"),(l,{success:u})=>N_(this.node,l,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:a?.tap===!1})}unmount(){}}const Bp=new WeakMap,Ff=new WeakMap,UO=e=>{const t=Bp.get(e.target);t&&t(e)},BO=e=>{e.forEach(UO)};function zO({root:e,...t}){const n=e||document;Ff.has(n)||Ff.set(n,{});const a=Ff.get(n),o=JSON.stringify(t);return a[o]||(a[o]=new IntersectionObserver(BO,{root:e,...t})),a[o]}function FO(e,t,n){const a=zO(t);return Bp.set(e,n),a.observe(e),()=>{Bp.delete(e),a.unobserve(e)}}const VO={some:0,all:1};class $O extends Xr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:n,margin:a,amount:o="some",once:s}=t,l={root:n?n.current:void 0,rootMargin:a,threshold:typeof o=="number"?o:VO[o]},u=f=>{const{isIntersecting:h}=f;if(this.isInView===h||(this.isInView=h,s&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:m,onViewportLeave:y}=this.node.getProps(),v=h?m:y;v&&v(f)};this.stopObserver=FO(this.node.current,l,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(HO(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function HO({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const WO={inView:{Feature:$O},tap:{Feature:jO},focus:{Feature:OO},hover:{Feature:NO}},GO={layout:{ProjectionNode:H1,MeasureLayout:rP}},KO={...gO,...WO,...MO,...GO},tl=dO(KO,hO);function qO(){!lg.current&&k1();const[e]=k.useState(qu.current);return e}function iP(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=iP(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function YO(){for(var e,t,n=0,a="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=iP(e))&&(a&&(a+=" "),a+=t);return a}const ZO=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},XO=(e,t)=>({classGroupId:e,validator:t}),oP=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ju="-",O_=[],QO="arbitrary..",JO=e=>{const t=t6(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return e6(l);const u=l.split(Ju),f=u[0]===""&&u.length>1?1:0;return sP(u,f,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const f=a[l],h=n[l];return f?h?ZO(h,f):f:h||O_}return n[l]||O_}}},sP=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const h=sP(e,t+1,s);if(h)return h}const l=n.validators;if(l===null)return;const u=t===0?e.join(Ju):e.slice(t).join(Ju),f=l.length;for(let h=0;h<f;h++){const m=l[h];if(m.validator(u))return m.classGroupId}},e6=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?QO+a:void 0})(),t6=e=>{const{theme:t,classGroups:n}=e;return n6(n,t)},n6=(e,t)=>{const n=oP();for(const a in e){const o=e[a];pg(o,n,a,t)}return n},pg=(e,t,n,a)=>{const o=e.length;for(let s=0;s<o;s++){const l=e[s];a6(l,t,n,a)}},a6=(e,t,n,a)=>{if(typeof e=="string"){r6(e,t,n);return}if(typeof e=="function"){i6(e,t,n,a);return}o6(e,t,n,a)},r6=(e,t,n)=>{const a=e===""?t:lP(t,e);a.classGroupId=n},i6=(e,t,n,a)=>{if(s6(e)){pg(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(XO(n,e))},o6=(e,t,n,a)=>{const o=Object.entries(e),s=o.length;for(let l=0;l<s;l++){const[u,f]=o[l];pg(f,lP(t,u),n,a)}},lP=(e,t)=>{let n=e;const a=t.split(Ju),o=a.length;for(let s=0;s<o;s++){const l=a[s];let u=n.nextPart.get(l);u||(u=oP(),n.nextPart.set(l,u)),n=u}return n},s6=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,l6=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const o=(s,l)=>{n[s]=l,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(s){let l=n[s];if(l!==void 0)return l;if((l=a[s])!==void 0)return o(s,l),l},set(s,l){s in n?n[s]=l:o(s,l)}}},zp="!",j_=":",c6=[],U_=(e,t,n,a,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:o}),u6=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=o=>{const s=[];let l=0,u=0,f=0,h;const m=o.length;for(let S=0;S<m;S++){const C=o[S];if(l===0&&u===0){if(C===j_){s.push(o.slice(f,S)),f=S+1;continue}if(C==="/"){h=S;continue}}C==="["?l++:C==="]"?l--:C==="("?u++:C===")"&&u--}const y=s.length===0?o:o.slice(f);let v=y,_=!1;y.endsWith(zp)?(v=y.slice(0,-1),_=!0):y.startsWith(zp)&&(v=y.slice(1),_=!0);const x=h&&h>f?h-f:void 0;return U_(s,_,v,x)};if(t){const o=t+j_,s=a;a=l=>l.startsWith(o)?s(l.slice(o.length)):U_(c6,!1,l,void 0,!0)}if(n){const o=a;a=s=>n({className:s,parseClassName:o})}return a},d6=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let o=[];for(let s=0;s<n.length;s++){const l=n[s],u=l[0]==="[",f=t.has(l);u||f?(o.length>0&&(o.sort(),a.push(...o),o=[]),a.push(l)):o.push(l)}return o.length>0&&(o.sort(),a.push(...o)),a}},h6=e=>({cache:l6(e.cacheSize),parseClassName:u6(e),sortModifiers:d6(e),...JO(e)}),f6=/\s+/,p6=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:o,sortModifiers:s}=t,l=[],u=e.trim().split(f6);let f="";for(let h=u.length-1;h>=0;h-=1){const m=u[h],{isExternal:y,modifiers:v,hasImportantModifier:_,baseClassName:x,maybePostfixModifierPosition:S}=n(m);if(y){f=m+(f.length>0?" "+f:f);continue}let C=!!S,R=a(C?x.substring(0,S):x);if(!R){if(!C){f=m+(f.length>0?" "+f:f);continue}if(R=a(x),!R){f=m+(f.length>0?" "+f:f);continue}C=!1}const M=v.length===0?"":v.length===1?v[0]:s(v).join(":"),E=_?M+zp:M,A=E+R;if(l.indexOf(A)>-1)continue;l.push(A);const U=o(R,C);for(let F=0;F<U.length;++F){const $=U[F];l.push(E+$)}f=m+(f.length>0?" "+f:f)}return f},m6=(...e)=>{let t=0,n,a,o="";for(;t<e.length;)(n=e[t++])&&(a=cP(n))&&(o&&(o+=" "),o+=a);return o},cP=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=cP(e[a]))&&(n&&(n+=" "),n+=t);return n},g6=(e,...t)=>{let n,a,o,s;const l=f=>{const h=t.reduce((m,y)=>y(m),e());return n=h6(h),a=n.cache.get,o=n.cache.set,s=u,u(f)},u=f=>{const h=a(f);if(h)return h;const m=p6(f,n);return o(f,m),m};return s=l,(...f)=>s(m6(...f))},y6=[],$t=e=>{const t=n=>n[e]||y6;return t.isThemeGetter=!0,t},uP=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,dP=/^\((?:(\w[\w-]*):)?(.+)\)$/i,v6=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,b6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,k6=/\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$/,_6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,w6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,x6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Mr=e=>v6.test(e),Xe=e=>!!e&&!Number.isNaN(Number(e)),Nr=e=>!!e&&Number.isInteger(Number(e)),Vf=e=>e.endsWith("%")&&Xe(e.slice(0,-1)),er=e=>b6.test(e),hP=()=>!0,P6=e=>k6.test(e)&&!_6.test(e),mg=()=>!1,S6=e=>w6.test(e),C6=e=>x6.test(e),T6=e=>!Se(e)&&!Te(e),E6=e=>Qr(e,mP,mg),Se=e=>uP.test(e),vi=e=>Qr(e,gP,P6),B_=e=>Qr(e,O6,Xe),A6=e=>Qr(e,vP,hP),R6=e=>Qr(e,yP,mg),z_=e=>Qr(e,fP,mg),L6=e=>Qr(e,pP,C6),Qc=e=>Qr(e,bP,S6),Te=e=>dP.test(e),js=e=>Bi(e,gP),D6=e=>Bi(e,yP),F_=e=>Bi(e,fP),I6=e=>Bi(e,mP),M6=e=>Bi(e,pP),Jc=e=>Bi(e,bP,!0),N6=e=>Bi(e,vP,!0),Qr=(e,t,n)=>{const a=uP.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},Bi=(e,t,n=!1)=>{const a=dP.exec(e);return a?a[1]?t(a[1]):n:!1},fP=e=>e==="position"||e==="percentage",pP=e=>e==="image"||e==="url",mP=e=>e==="length"||e==="size"||e==="bg-size",gP=e=>e==="length",O6=e=>e==="number",yP=e=>e==="family-name",vP=e=>e==="number"||e==="weight",bP=e=>e==="shadow",j6=()=>{const e=$t("color"),t=$t("font"),n=$t("text"),a=$t("font-weight"),o=$t("tracking"),s=$t("leading"),l=$t("breakpoint"),u=$t("container"),f=$t("spacing"),h=$t("radius"),m=$t("shadow"),y=$t("inset-shadow"),v=$t("text-shadow"),_=$t("drop-shadow"),x=$t("blur"),S=$t("perspective"),C=$t("aspect"),R=$t("ease"),M=$t("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],U=()=>[...A(),Te,Se],F=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],P=()=>[Te,Se,f],Z=()=>[Mr,"full","auto",...P()],X=()=>[Nr,"none","subgrid",Te,Se],fe=()=>["auto",{span:["full",Nr,Te,Se]},Nr,Te,Se],he=()=>[Nr,"auto",Te,Se],Q=()=>["auto","min","max","fr",Te,Se],ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],J=()=>["start","end","center","stretch","center-safe","end-safe"],ee=()=>["auto",...P()],se=()=>[Mr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],z=()=>[Mr,"screen","full","dvw","lvw","svw","min","max","fit",...P()],q=()=>[Mr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],V=()=>[e,Te,Se],D=()=>[...A(),F_,z_,{position:[Te,Se]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],pe=()=>["auto","cover","contain",I6,E6,{size:[Te,Se]}],me=()=>[Vf,js,vi],ge=()=>["","none","full",h,Te,Se],xe=()=>["",Xe,js,vi],ze=()=>["solid","dashed","dotted","double"],Ye=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],je=()=>[Xe,Vf,F_,z_],Rt=()=>["","none",x,Te,Se],Ln=()=>["none",Xe,Te,Se],wn=()=>["none",Xe,Te,Se],pt=()=>[Xe,Te,Se],Xt=()=>[Mr,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[er],breakpoint:[er],color:[hP],container:[er],"drop-shadow":[er],ease:["in","out","in-out"],font:[T6],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[er],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[er],shadow:[er],spacing:["px",Xe],text:[er],"text-shadow":[er],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Mr,Se,Te,C]}],container:["container"],columns:[{columns:[Xe,Se,Te,u]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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:U()}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Z()}],"inset-x":[{"inset-x":Z()}],"inset-y":[{"inset-y":Z()}],start:[{"inset-s":Z(),start:Z()}],end:[{"inset-e":Z(),end:Z()}],"inset-bs":[{"inset-bs":Z()}],"inset-be":[{"inset-be":Z()}],top:[{top:Z()}],right:[{right:Z()}],bottom:[{bottom:Z()}],left:[{left:Z()}],visibility:["visible","invisible","collapse"],z:[{z:[Nr,"auto",Te,Se]}],basis:[{basis:[Mr,"full","auto",u,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Xe,Mr,"auto","initial","none",Se]}],grow:[{grow:["",Xe,Te,Se]}],shrink:[{shrink:["",Xe,Te,Se]}],order:[{order:[Nr,"first","last","none",Te,Se]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:fe()}],"col-start":[{"col-start":he()}],"col-end":[{"col-end":he()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:fe()}],"row-start":[{"row-start":he()}],"row-end":[{"row-end":he()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Q()}],"auto-rows":[{"auto-rows":Q()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...ne(),"normal"]}],"justify-items":[{"justify-items":[...J(),"normal"]}],"justify-self":[{"justify-self":["auto",...J()]}],"align-content":[{content:["normal",...ne()]}],"align-items":[{items:[...J(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...J(),{baseline:["","last"]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...J(),"baseline"]}],"place-self":[{"place-self":["auto",...J()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:ee()}],mx:[{mx:ee()}],my:[{my:ee()}],ms:[{ms:ee()}],me:[{me:ee()}],mbs:[{mbs:ee()}],mbe:[{mbe:ee()}],mt:[{mt:ee()}],mr:[{mr:ee()}],mb:[{mb:ee()}],ml:[{ml:ee()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:se()}],"inline-size":[{inline:["auto",...z()]}],"min-inline-size":[{"min-inline":["auto",...z()]}],"max-inline-size":[{"max-inline":["none",...z()]}],"block-size":[{block:["auto",...q()]}],"min-block-size":[{"min-block":["auto",...q()]}],"max-block-size":[{"max-block":["none",...q()]}],w:[{w:[u,"screen",...se()]}],"min-w":[{"min-w":[u,"screen","none",...se()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...se()]}],h:[{h:["screen","lh",...se()]}],"min-h":[{"min-h":["screen","lh","none",...se()]}],"max-h":[{"max-h":["screen","lh",...se()]}],"font-size":[{text:["base",n,js,vi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,N6,A6]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Vf,Se]}],"font-family":[{font:[D6,R6,t]}],"font-features":[{"font-features":[Se]}],"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:[o,Te,Se]}],"line-clamp":[{"line-clamp":[Xe,"none",Te,B_]}],leading:[{leading:[s,...P()]}],"list-image":[{"list-image":["none",Te,Se]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Te,Se]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ze(),"wavy"]}],"text-decoration-thickness":[{decoration:[Xe,"from-font","auto",Te,vi]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[Xe,"auto",Te,Se]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Te,Se]}],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",Te,Se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:pe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Nr,Te,Se],radial:["",Te,Se],conic:[Nr,Te,Se]},M6,L6]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:me()}],"gradient-via-pos":[{via:me()}],"gradient-to-pos":[{to:me()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:ge()}],"rounded-s":[{"rounded-s":ge()}],"rounded-e":[{"rounded-e":ge()}],"rounded-t":[{"rounded-t":ge()}],"rounded-r":[{"rounded-r":ge()}],"rounded-b":[{"rounded-b":ge()}],"rounded-l":[{"rounded-l":ge()}],"rounded-ss":[{"rounded-ss":ge()}],"rounded-se":[{"rounded-se":ge()}],"rounded-ee":[{"rounded-ee":ge()}],"rounded-es":[{"rounded-es":ge()}],"rounded-tl":[{"rounded-tl":ge()}],"rounded-tr":[{"rounded-tr":ge()}],"rounded-br":[{"rounded-br":ge()}],"rounded-bl":[{"rounded-bl":ge()}],"border-w":[{border:xe()}],"border-w-x":[{"border-x":xe()}],"border-w-y":[{"border-y":xe()}],"border-w-s":[{"border-s":xe()}],"border-w-e":[{"border-e":xe()}],"border-w-bs":[{"border-bs":xe()}],"border-w-be":[{"border-be":xe()}],"border-w-t":[{"border-t":xe()}],"border-w-r":[{"border-r":xe()}],"border-w-b":[{"border-b":xe()}],"border-w-l":[{"border-l":xe()}],"divide-x":[{"divide-x":xe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":xe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ze(),"hidden","none"]}],"divide-style":[{divide:[...ze(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-bs":[{"border-bs":V()}],"border-color-be":[{"border-be":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...ze(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Xe,Te,Se]}],"outline-w":[{outline:["",Xe,js,vi]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",m,Jc,Qc]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",y,Jc,Qc]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:xe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[Xe,vi]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":xe()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",v,Jc,Qc]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[Xe,Te,Se]}],"mix-blend":[{"mix-blend":[...Ye(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ye()}],"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":[Xe]}],"mask-image-linear-from-pos":[{"mask-linear-from":je()}],"mask-image-linear-to-pos":[{"mask-linear-to":je()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":je()}],"mask-image-t-to-pos":[{"mask-t-to":je()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":je()}],"mask-image-r-to-pos":[{"mask-r-to":je()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":je()}],"mask-image-b-to-pos":[{"mask-b-to":je()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":je()}],"mask-image-l-to-pos":[{"mask-l-to":je()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":je()}],"mask-image-x-to-pos":[{"mask-x-to":je()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":je()}],"mask-image-y-to-pos":[{"mask-y-to":je()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[Te,Se]}],"mask-image-radial-from-pos":[{"mask-radial-from":je()}],"mask-image-radial-to-pos":[{"mask-radial-to":je()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"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":A()}],"mask-image-conic-pos":[{"mask-conic":[Xe]}],"mask-image-conic-from-pos":[{"mask-conic-from":je()}],"mask-image-conic-to-pos":[{"mask-conic-to":je()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:pe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Te,Se]}],filter:[{filter:["","none",Te,Se]}],blur:[{blur:Rt()}],brightness:[{brightness:[Xe,Te,Se]}],contrast:[{contrast:[Xe,Te,Se]}],"drop-shadow":[{"drop-shadow":["","none",_,Jc,Qc]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",Xe,Te,Se]}],"hue-rotate":[{"hue-rotate":[Xe,Te,Se]}],invert:[{invert:["",Xe,Te,Se]}],saturate:[{saturate:[Xe,Te,Se]}],sepia:[{sepia:["",Xe,Te,Se]}],"backdrop-filter":[{"backdrop-filter":["","none",Te,Se]}],"backdrop-blur":[{"backdrop-blur":Rt()}],"backdrop-brightness":[{"backdrop-brightness":[Xe,Te,Se]}],"backdrop-contrast":[{"backdrop-contrast":[Xe,Te,Se]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Xe,Te,Se]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xe,Te,Se]}],"backdrop-invert":[{"backdrop-invert":["",Xe,Te,Se]}],"backdrop-opacity":[{"backdrop-opacity":[Xe,Te,Se]}],"backdrop-saturate":[{"backdrop-saturate":[Xe,Te,Se]}],"backdrop-sepia":[{"backdrop-sepia":["",Xe,Te,Se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Te,Se]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Xe,"initial",Te,Se]}],ease:[{ease:["linear","initial",R,Te,Se]}],delay:[{delay:[Xe,Te,Se]}],animate:[{animate:["none",M,Te,Se]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Te,Se]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:Ln()}],"rotate-x":[{"rotate-x":Ln()}],"rotate-y":[{"rotate-y":Ln()}],"rotate-z":[{"rotate-z":Ln()}],scale:[{scale:wn()}],"scale-x":[{"scale-x":wn()}],"scale-y":[{"scale-y":wn()}],"scale-z":[{"scale-z":wn()}],"scale-3d":["scale-3d"],skew:[{skew:pt()}],"skew-x":[{"skew-x":pt()}],"skew-y":[{"skew-y":pt()}],transform:[{transform:[Te,Se,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Xt()}],"translate-x":[{"translate-x":Xt()}],"translate-y":[{"translate-y":Xt()}],"translate-z":[{"translate-z":Xt()}],"translate-none":["translate-none"],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"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",Te,Se]}],"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":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",Te,Se]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[Xe,js,vi,B_]}],stroke:[{stroke:["none",...V()]}],"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"]}},U6=g6(j6);function wt(...e){return U6(YO(e))}const B6=T.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[T.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"}),T.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"}),T.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"}),T.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"})]}),z6=T.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:T.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"})}),F6={google:B6,github:z6},V6={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",apple:"Apple"};function $6(e){return V6[e]||String(e||"").replace(/-/g," ")}function H6({title:e,subtitle:t,className:n="",onSuccess:a,hideLogo:o=!1}){Tl();const{enabled:s,signedIn:l,refreshUser:u,signInWithPassword:f,signUp:h,signInWithOAuth:m,getPublicAuthConfig:y}=$o(),[v,_]=k.useState("signin"),[x,S]=k.useState(""),[C,R]=k.useState(""),[M,E]=k.useState(""),[A,U]=k.useState(!1),[F,$]=k.useState(null),[P,Z]=k.useState(null),[X,fe]=k.useState(!1),[he,Q]=k.useState(!0),[ne,J]=k.useState([]),[ee,se]=k.useState(8);k.useEffect(()=>{if(!s)return;let D=!0;return Q(!0),(async()=>{const{data:W,error:pe}=await y();if(D){if(pe||!W)J(["google","github"]);else{const me=Array.isArray(W.oAuthProviders)?W.oAuthProviders:[],ge=Array.isArray(W.customOAuthProviders)?W.customOAuthProviders:[];J([...me,...ge]),typeof W.passwordMinLength=="number"&&W.passwordMinLength>0&&se(W.passwordMinLength)}Q(!1)}})(),()=>{D=!1}},[s,y]),k.useEffect(()=>{l&&a&&a()},[l,a]);const z=k.useMemo(()=>typeof window>"u"?"":!!window.webkit?.messageHandlers?.nativeOAuth?`${window.location.origin}/auth/callback`:`${window.location.origin}/`,[]),q=k.useCallback(async D=>{$(null),U(!0);try{const{error:W}=await m(D,z);W&&$(W.message||String(W))}finally{U(!1)}},[m,z]),V=k.useCallback(async D=>{D.preventDefault(),$(null),U(!0);try{if(v==="signup"){const{data:pe,error:me}=await h({email:x.trim(),password:C,name:M.trim()||void 0});if(me){$(me.message||String(me));return}if(pe?.requireEmailVerification){Z(De("login.verify_email_pending")),_("signin");return}await u();return}const{error:W}=await f({email:x.trim(),password:C});if(W){$(W.message||String(W));return}await u()}finally{U(!1)}},[v,x,C,M,h,f,u]);return s?T.jsxs("div",{className:wt("w-full bg-white dark:bg-oai-gray-950 p-6 transition-colors duration-200",n),children:[T.jsxs("div",{className:"text-center mb-6",children:[!o&&T.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[T.jsx("img",{src:"/app-icon.png",alt:"",width:28,height:28,className:"rounded-md"}),T.jsx("span",{className:"text-lg font-semibold text-oai-black dark:text-white font-oai tracking-tight",children:De("shared.app_name")})]}),T.jsx("h2",{className:wt("text-sm font-semibold text-oai-black dark:text-white tracking-tight mb-1",o&&"text-base font-bold md:text-lg"),children:e||De("login_modal.subtitle")}),t&&T.jsx("p",{className:"text-xs text-oai-gray-500 dark:text-oai-gray-400 mt-1.5 leading-relaxed max-w-[320px] mx-auto",children:t})]}),P&&T.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:P}),F&&T.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400 text-center",role:"alert",children:F}),T.jsx("div",{className:"space-y-2.5 mb-5",children:he?T.jsxs("div",{className:"space-y-2.5",children:[T.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"}),T.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"})]}):ne.map(D=>T.jsxs("button",{type:"button",disabled:A,onClick:()=>q(D),className:wt("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:[F6[D]||null,De("login.oauth.continue",{provider:$6(D)})]},D))}),X?T.jsxs(T.Fragment,{children:[T.jsxs("div",{className:"relative mb-5",children:[T.jsx("div",{className:"absolute inset-0 flex items-center",children:T.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),T.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:T.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:De("login_modal.divider_email")})})]}),T.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:[T.jsx("button",{type:"button",className:wt("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",v==="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:()=>{_("signin"),$(null)},children:De("login.tab.sign_in")}),T.jsx("button",{type:"button",className:wt("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",v==="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:()=>{_("signup"),$(null)},children:De("login.tab.sign_up")})]}),T.jsxs("form",{onSubmit:V,className:"space-y-3",children:[v==="signup"&&T.jsxs("div",{children:[T.jsx("label",{htmlFor:"card-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:De("login.field.name")}),T.jsx("input",{id:"card-name",type:"text",autoComplete:"name",value:M,onChange:D=>E(D.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:De("login.field.name_placeholder")})]}),T.jsxs("div",{children:[T.jsx("label",{htmlFor:"card-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:De("login.field.email")}),T.jsx("input",{id:"card-email",type:"email",autoComplete:"email",required:!0,value:x,onChange:D=>S(D.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"})]}),T.jsxs("div",{children:[T.jsx("label",{htmlFor:"card-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:De("login.field.password")}),T.jsx("input",{id:"card-password",type:"password",autoComplete:v==="signup"?"new-password":"current-password",required:!0,minLength:v==="signup"?ee:void 0,value:C,onChange:D=>R(D.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"}),v==="signup"&&T.jsx("p",{className:"mt-1 text-xs text-oai-gray-400 dark:text-oai-gray-600",children:De("login.password_hint",{min:String(ee)})})]}),T.jsx("button",{type:"submit",disabled:A,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:De(v==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]}):T.jsxs(T.Fragment,{children:[T.jsxs("div",{className:"relative mb-5",children:[T.jsx("div",{className:"absolute inset-0 flex items-center",children:T.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),T.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:T.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:De("login.divider")})})]}),T.jsxs("button",{type:"button",onClick:()=>fe(!0),className:wt("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:[T.jsx(SI,{className:"h-[18px] w-[18px] text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:1.75}),De("login_modal.continue_email")]})]})]}):null}function W6(){const{isOpen:e,closeLoginModal:t}=yx(),{enabled:n}=$o();return k.useEffect(()=>{if(!e)return;const a=o=>{o.key==="Escape"&&t()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,t]),n?T.jsx(G1,{children:e&&T.jsxs(tl.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:[T.jsx(tl.div,{className:"absolute inset-0 bg-black/40 dark:bg-black/60",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),T.jsxs(tl.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 shadow-2xl overflow-hidden",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:a=>a.stopPropagation(),children:[T.jsx("button",{type:"button",onClick:t,className:"absolute right-4 top-4 z-10 text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:T.jsx(jm,{className:"h-5 w-5"})}),T.jsx(H6,{onSuccess:t,className:"p-6 bg-transparent"})]})]})}):null}const G6={VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"},X9="https://tokentracker.statuspage.io/";function K6(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return"";const t=typeof import.meta<"u"?G6:void 0;return(t?.VITE_TOKENTRACKER_BACKEND_BASE_URL||t?.VITE_INSFORGE_BASE_URL||ir()).trim()}function q6(){return ir()}function Y6(e=""){if(typeof e!="string"||e.length===0)return!1;const t=new URLSearchParams(e),n=String(t.get("screenshot")||"").toLowerCase();return n==="1"||n==="true"}const Z6=300*1e3,X6=720*60*1e3;function gg(e){return typeof e=="string"&&/^https?:\/\//i.test(e.trim())}function Q6(e,t=Date.now()){if(!e?.token||!e?.deviceId||!e?.issuedAt)return!0;const n=Date.parse(e.issuedAt);return Number.isFinite(n)?n+X6<=t:!0}async function kP(e,t){const n=ir();if(!gg(n)||!e)return;const a=n.replace(/\/$/,""),o=xl(),s={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};o&&(s.apikey=o);try{await fetch(`${a}/functions/tokentracker-leaderboard-refresh`,{method:"POST",headers:s,body:JSON.stringify({period:"week",source:t})})}catch{}}async function J6(e){const t=ir();if(!gg(t)||!e)return null;const n=t.replace(/\/$/,""),a=xl(),o={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};a&&(o.apikey=a);const s=typeof navigator<"u"&&typeof navigator.platform=="string"?navigator.platform:"web",l=await fetch(`${n}/functions/tokentracker-device-token-issue`,{method:"POST",headers:o,body:JSON.stringify({device_name:"Token Tracker (dashboard)",platform:s})});if(!l.ok)return null;const u=await l.json().catch(()=>null),f=typeof u?.token=="string"?u.token:null,h=typeof u?.device_id=="string"?u.device_id:null;return!f||!h?null:{token:f,deviceId:h,issuedAt:typeof u?.created_at=="string"?u.created_at:new Date().toISOString()}}async function V_(e){const{deviceToken:t,insforgeBaseUrl:n}=e,a={deviceToken:t},o=n||ir();gg(o)&&(a.insforgeBaseUrl=o.trim());const s=await fd(),l=await fetch("/functions/tokentracker-local-sync",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...s},body:JSON.stringify(a)}),u=await l.json().catch(()=>({}));if(!l.ok){const f=typeof u.error=="string"?u.error:`HTTP ${l.status}`;throw new Error(f)}return u}async function $_(e){const t=await e();if(!t)return null;const n=Iw();if(n&&!Q6(n))return n;const a=await J6(t);return a?(rL(a),a):null}async function _P(e){let t=await e();if(!t)return null;let n=await $_(async()=>t);if(!n)return t;try{return await V_({deviceToken:n.token,insforgeBaseUrl:ir()}),t}catch(a){if(!Iw()||(Mw(),t=await e(),!t)||(n=await $_(async()=>t),!n))throw a;return await V_({deviceToken:n.token,insforgeBaseUrl:ir()}),t}}async function ej(e){const t=iL();if(Date.now()-t<Z6)return;const n=await _P(e);n&&(Nw(Date.now()),await kP(n,"cloud-sync-auto"))}async function Q9(e){const t=await _P(e);t&&(Nw(Date.now()),await kP(t,"cloud-sync-now"))}function tj(e){const t=e.replace(/\/+$/,"")||"/";return t==="/share"||t==="/share.html"||t.startsWith("/share/")}function nj(e){const t=e.replace(/\/+$/,"")||"/";return t==="/login"||t==="/landing"||tj(t)?!1:t==="/"||t==="/dashboard"||t.startsWith("/leaderboard")}function aj(){const e=ta(),t=$o(),n=k.useRef(!1);k.useEffect(()=>{if(!nL()||!nj(e.pathname||"/")||!t.enabled||!t.signedIn||t.loading||!aL())return;let a=!1;const o=window.setTimeout(()=>{(async()=>{if(!(a||n.current)){n.current=!0;try{await ej(()=>t.getAccessToken())}catch(s){console.warn("[tokentracker] cloud usage sync:",s)}finally{n.current=!1}}})()},2500);return()=>{a=!0,window.clearTimeout(o)}},[e.pathname,t.enabled,t.signedIn,t.loading,t.getAccessToken])}function rj(){const e=k.useContext(mx);if(e===null)throw new Error("useTheme must be used within a ThemeProvider");return e}function ij({prefersReducedMotion:e,screenshotCapture:t}){return!(t||e)}function oj(e){if(!e||typeof e!="object")return null;const t=e.user_metadata&&typeof e.user_metadata=="object"?e.user_metadata:{},n=e.profile&&typeof e.profile=="object"?e.profile:{},a=t.avatar_url||t.picture||n.avatar_url||e.avatar_url;return typeof a=="string"&&a.trim()?a.trim():null}function sj(e){return e?pd()?`/api/avatar-proxy?url=${encodeURIComponent(e)}`:e:null}function eu(e){const t=String(e||"").trim();if(!t)return"?";const n=t.split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():t.slice(0,2).toUpperCase()}function H_({className:e,variant:t="header",collapsed:n=!1,onAfterAction:a}){Tl();const o=t==="sidebar",{enabled:s,loading:l,signedIn:u,user:f,displayName:h}=$o(),{openLoginModal:m}=yx(),y=_l(),v=k.useMemo(()=>oj(f),[f]),_=k.useMemo(()=>sj(v),[v]),[x,S]=rl.useState(!1);if(rl.useEffect(()=>{S(!1)},[_]),!s)return null;if(l)return T.jsx("div",{className:wt("h-9 w-9 shrink-0 rounded-full bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse",e),"aria-hidden":!0});if(!u)return o?T.jsxs("button",{type:"button",onClick:()=>{m(),a?.()},className:wt("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",e),"aria-label":De("header.auth.sign_in_aria"),title:n?De("header.auth.sign_in_aria"):void 0,children:[T.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:T.jsx("img",{src:"/app-icon.png",alt:"",width:18,height:18,className:"h-[18px] w-[18px] rounded"})}),!n&&T.jsx("span",{className:"truncate flex-1 text-left",children:De("header.auth.sign_in_aria")})]}):T.jsx("button",{type:"button",onClick:m,className:wt("shrink-0 inline-flex h-9 items-center justify-center gap-1.5 rounded-md px-4 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",e),"aria-label":De("header.auth.sign_in_aria"),children:De("header.auth.sign_in_aria")});const C=()=>{y("/settings"),a?.()};return T.jsx("div",{className:wt(o?"relative flex w-full shrink-0 items-center":"relative flex shrink-0 items-center",e),children:T.jsxs("button",{type:"button",onClick:C,className:wt(o?wt("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-md 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":De("header.auth.open_settings"),title:o&&n?h:void 0,children:[o?T.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:_&&!x?T.jsx("img",{src:_,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",onError:()=>S(!0)}):eu(h)==="?"?T.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:T.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-3 h-3 opacity-80",children:T.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):T.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:eu(h)})}):_&&!x?T.jsx("img",{src:_,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",onError:()=>S(!0)}):eu(h)==="?"?T.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:T.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-4 h-4 opacity-80",children:T.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):T.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:eu(h)}),o?!n&&T.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:h}):T.jsx("span",{className:"hidden sm:inline truncate text-sm font-medium text-oai-gray-900 dark:text-oai-gray-200 max-w-[120px]",children:h})]})})}const Fp="tt.sidebarCollapsed";function wP(){return[{id:"general",label:De("nav.group.general"),items:[{id:"usage",to:"/dashboard",icon:mI,label:De("nav.usage")},{id:"limits",to:"/limits",icon:bI,label:De("nav.limits")},{id:"leaderboard",to:"/leaderboard",icon:$I,label:De("nav.leaderboard")}]},{id:"tools",label:De("nav.group.tools"),items:[{id:"widgets",to:"/widgets",icon:xI,label:De("nav.widgets")},{id:"skills",to:"/skills",icon:DI,label:De("nav.skills")},{id:"ip-check",to:"/ip-check",icon:_I,label:De("nav.ip_check")}]},{id:"account",label:De("nav.group.account"),items:[{id:"settings",to:"/settings",icon:UI,label:De("nav.settings")}]}]}function lj(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Fp)==="1"}catch{return!1}}function cj(){const[e,t]=k.useState(lj),n=k.useCallback(()=>{t(a=>{const o=!a;try{typeof window<"u"&&window.localStorage.setItem(Fp,o?"1":"0")}catch{}return o})},[]);return k.useEffect(()=>{if(typeof window>"u")return;const a=o=>{o.key===Fp&&t(o.newValue==="1")};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[]),{collapsed:e,toggle:n}}function uj(e,t){const n=e.replace(/\/+$/,"")||"/";return t==="/dashboard"?n==="/dashboard"||n==="/":t==="/leaderboard"?n==="/leaderboard"||n.startsWith("/leaderboard/"):n===t}function dj({label:e,collapsed:t,first:n}){return t?n?null:T.jsx("div",{className:"mx-2 my-2 h-px bg-oai-gray-200/70 dark:bg-oai-gray-800/70","aria-hidden":!0}):T.jsx("div",{className:wt("px-3 pb-1 text-[10px] uppercase tracking-wider text-oai-gray-500 dark:text-oai-gray-500",n?"pt-2":"pt-4"),children:e})}function hj({item:e,collapsed:t,active:n,onClick:a}){const o=e.icon;return T.jsxs(sd,{to:e.to,onClick:a,title:t?e.label:void 0,"aria-current":n?"page":void 0,className:wt("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] no-underline transition-colors",t&&"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:[T.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:T.jsx(o,{className:"h-[15px] w-[15px]","aria-hidden":!0})}),!t&&T.jsx("span",{className:"truncate",children:e.label})]})}function fj({as:e="button",title:t,onClick:n,href:a,children:o,className:s,...l}){const u=wt("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 e==="a"?T.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",title:t,"aria-label":t,className:u,...l,children:o}):T.jsx("button",{type:"button",title:t,"aria-label":t,onClick:n,className:u,...l,children:o})}function pj({repo:e="mm7894215/TokenTracker",glassChrome:t=!1}){const[n,a]=k.useState(null);return k.useEffect(()=>{if(typeof window>"u")return;const o=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;ij({prefersReducedMotion:o,screenshotCapture:!1})&&fetch(`https://api.github.com/repos/${e}`).then(s=>s.json()).then(s=>{s&&typeof s.stargazers_count=="number"&&a(s.stargazers_count)}).catch(()=>{})},[e]),T.jsxs("a",{href:`https://github.com/${e}`,target:"_blank",rel:"noopener noreferrer","aria-label":n!==null?`Star on GitHub (${n})`:"Star on GitHub",className:wt("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",t?"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:[T.jsx("svg",{height:"12",viewBox:"0 0 16 16",width:"12",className:"shrink-0 fill-current",children:T.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"})}),T.jsx("span",{children:"Star"}),n!==null&&T.jsx("span",{className:"text-[10px] text-oai-gray-500 dark:text-oai-gray-500 tabular-nums",children:n})]})}const mj=[{value:"light",label:"Light",Icon:px},{value:"dark",label:"Dark",Icon:fx},{value:"system",label:"System",Icon:AI}];function gj({theme:e,resolvedTheme:t,onSetTheme:n,glassChrome:a=!1}){const[o,s]=k.useState(!1),l=k.useRef(null),u=t==="dark"?fx:px;return k.useEffect(()=>{if(!o)return;const f=m=>{l.current&&!l.current.contains(m.target)&&s(!1)},h=m=>{m.key==="Escape"&&s(!1)};return document.addEventListener("mousedown",f),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",h)}},[o]),T.jsxs("div",{ref:l,className:"relative",children:[T.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":o,"aria-haspopup":"menu",title:"Theme",onClick:()=>s(f=>!f),className:wt("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",a?"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:T.jsx(u,{className:"h-3.5 w-3.5","aria-hidden":!0})}),o&&T.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:mj.map(({value:f,label:h,Icon:m})=>{const y=e===f;return T.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{n(f),s(!1)},className:wt("flex w-full items-center gap-2.5 px-3 py-1.5 text-[13px] transition-colors",y?"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:[T.jsx(m,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),T.jsx("span",{children:h})]},f)})})]})}function xP({collapsed:e,onToggleCollapsed:t,onItemClick:n,showCloseButton:a=!1,onClose:o,glassChrome:s=!1}){const u=ta()?.pathname||"/",{theme:f,resolvedTheme:h,setTheme:m}=rj(),{resolvedLocale:y}=Tl(),v=k.useMemo(()=>wP(),[y]);return T.jsxs(T.Fragment,{children:[T.jsx("div",{className:wt("px-2 pt-2 pb-2",e&&"flex justify-center"),children:a?T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("div",{className:"flex-1 min-w-0",children:T.jsx(H_,{variant:"sidebar",collapsed:e,onAfterAction:n})}),T.jsx("button",{type:"button",onClick:o,"aria-label":De("nav.close_menu"),title:De("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:T.jsx(jm,{className:"h-4 w-4",strokeWidth:1.75,"aria-hidden":!0})})]}):T.jsx(H_,{variant:"sidebar",collapsed:e,onAfterAction:n})}),T.jsx("nav",{"aria-label":De("nav.nav_label"),className:"flex-1 px-2 pb-2 flex flex-col overflow-y-auto",children:v.map((_,x)=>T.jsxs("div",{className:"flex flex-col",children:[T.jsx(dj,{label:_.label,collapsed:e,first:x===0}),T.jsx("div",{className:"flex flex-col gap-0.5",children:_.items.filter(S=>!(S.to==="/widgets"&&Im())).map(S=>T.jsx(hj,{item:S,collapsed:e,active:uj(u,S.to),onClick:n},S.id))})]},_.id))}),T.jsxs("div",{className:wt("flex items-center px-2 py-3",e?"flex-col justify-center gap-2":"justify-between gap-2"),children:[T.jsx(gj,{theme:f,resolvedTheme:h,onSetTheme:m,glassChrome:s}),T.jsx("div",{className:"flex items-center gap-1.5",children:!e&&T.jsx(pj,{glassChrome:s})})]})]})}function yj({collapsed:e,onToggleCollapsed:t}){const n=k.useMemo(()=>typeof window>"u"?!1:ma()||pd(),[]);return T.jsx("aside",{"aria-label":De("nav.aside_label"),className:wt("hidden lg:flex flex-col shrink-0 h-full min-h-0 transition-[width] duration-200",e?"w-[72px]":"w-[220px]"),children:T.jsx(xP,{collapsed:e,onToggleCollapsed:t,glassChrome:n})})}function vj({open:e,onClose:t}){return k.useEffect(()=>{if(!e)return;const n=a=>{a.key==="Escape"&&t()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e,t]),k.useEffect(()=>{if(!e)return;const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}},[e]),e?T.jsxs("div",{className:"lg:hidden fixed inset-0 z-[80] flex",children:[T.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:t,"aria-hidden":!0}),T.jsx("aside",{"aria-label":De("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:T.jsx(xP,{collapsed:!1,showCloseButton:!0,onClose:t,onItemClick:t})})]}):null}function bj({onOpenDrawer:e}){return T.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:[T.jsx(fj,{title:De("nav.menu"),onClick:e,children:T.jsx(TI,{className:"h-5 w-5","aria-hidden":!0})}),T.jsxs(sd,{to:"/landing",className:"flex items-center gap-2 no-underline hover:opacity-80 transition-opacity","aria-label":"Token Tracker",children:[T.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),T.jsx("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white",children:"Token Tracker"})]}),T.jsx("div",{className:"w-10 shrink-0","aria-hidden":!0})]})}function kj({children:e}){const{collapsed:t,toggle:n}=cj(),[a,o]=k.useState(!1),s=k.useCallback(()=>o(!0),[]),l=k.useCallback(()=>o(!1),[]),u=k.useMemo(()=>typeof window>"u"?!1:ma()||pd(),[]);return T.jsxs("div",{className:wt("fixed inset-0 flex flex-col text-oai-black dark:text-oai-white font-sans overflow-hidden",Im()&&"tt-native-glass-shell",u?"bg-transparent":"bg-oai-gray-100 dark:bg-oai-gray-950"),children:[u&&T.jsx("div",{className:"h-7 shrink-0",style:{WebkitAppRegion:"drag"},"aria-hidden":!0}),T.jsxs("div",{className:"flex-1 min-h-0 flex",children:[T.jsx(yj,{collapsed:t,onToggleCollapsed:n}),T.jsx(vj,{open:a,onClose:l}),T.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:T.jsxs("div",{className:wt("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",u?"tt-native-main-card":"rounded-2xl",!u&&"shadow-sm"),children:[T.jsx(bj,{onOpenDrawer:s}),T.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:e})]})})]})]})}function _j({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"})})}function wj({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:t,children:T.jsx("path",{d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"})})}function xj({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z"})})}function Pj({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"})})}function Sj({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"})})}function Cj({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 -1 22 28",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M4.125 20.149c-2.69 5.959 3.036 7.453 7.26 3.966 1.24 3.91 5.898.993 7.569-2.036 3.682-6.678 2.195-13.49 1.813-14.895-2.617-9.582-15.699-9.592-17.95.049-.526 1.687-.535 3.606-.833 5.598-.15 1.005-.256 1.646-.645 2.703-.223.607-.53 1.147-1.014 2.056-.75 1.412-.434 4.138 3.434 2.724v.001ZM11.895 11.332c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.395.9.395 1.578 0 1.283-.493 2.048-1.319 2.048Zm4.416 0c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.396.9.396 1.578 0 1.283-.494 2.048-1.32 2.048Z"})})}function Tj({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M16 6H8v12h8V6zm4 16H4V2h16v20z"})})}function Ej({size:e=16,className:t=""}){return T.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:[T.jsx("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"}),T.jsx("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"})]})}function Aj({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"})})}function Rj({size:e=16,className:t=""}){return T.jsxs("svg",{width:e,height:e,viewBox:"0 0 64 60",fill:"none",className:t,"aria-hidden":"true",children:[T.jsx("path",{fill:"currentColor",d:"M37.2114 3.75318C37.6821 3.33106 37.7106 3.31457 38.0558 3.29385C38.6149 3.2531 39.1272 3.52199 39.9989 4.31564C42.0356 6.16652 44.8714 9.97183 46.6346 13.2212L47.3163 14.4819L48.2782 14.9605C49.2072 15.4299 50.7308 16.3923 51.3672 16.9085C51.655 17.1464 51.6956 17.1508 51.9947 17.0344C53.3454 16.5084 55.2803 17.206 56.9869 18.8432C58.5231 20.3155 59.9943 22.8312 60.558 24.9308C60.6403 25.2687 60.7493 25.9952 60.7891 26.5362C60.9177 28.4358 60.3092 29.9532 59.1362 30.64C58.8965 30.7784 58.8801 30.8158 58.8868 31.4132C58.9409 34.2583 58.1741 37.0985 56.6335 39.8679C54.8946 42.9773 51.7981 46.1938 47.6074 49.2243C45.357 50.8619 40.0323 53.964 37.6248 55.0532C31.8578 57.6496 27.2346 58.646 23.2188 58.154C20.8236 57.8638 18.1124 56.9287 16.5082 55.8433C16.086 55.5515 16.0191 55.5329 15.6966 55.6251C13.9793 56.1185 11.73 55.1053 9.81931 52.9844C9.05725 52.1366 7.82714 50.0548 7.42839 48.9409C6.50606 46.3339 6.68976 43.9816 7.91836 42.5767C8.23573 42.2149 8.2453 42.1995 8.17598 41.5912C8.06148 40.5951 8.00971 39.1206 8.06202 38.1692L8.10361 37.2803L6.76977 34.9212C4.70378 31.2451 3.3912 28.1582 2.88489 25.7998C2.61762 24.5066 2.63385 23.9324 2.96214 23.5078C3.16198 23.2515 3.81796 22.9866 4.60785 22.8407C6.59665 22.4917 10.9334 22.8076 15.7581 23.6595L16.259 23.7458L17.3608 22.7713C19.1891 21.1519 20.4038 20.244 22.6429 18.8478C24.9768 17.3876 27.6108 16.1858 30.577 15.2346L31.5295 14.9294L32.0526 13.5561C33.9257 8.61146 35.8437 4.96584 37.2114 3.75318ZM21.5208 29.0919C19.404 30.314 18.3453 30.9251 17.5676 31.6099C14.4179 34.3835 13.2414 38.777 14.5823 42.7537C14.9135 43.7357 15.5247 44.7942 16.7469 46.9111C17.9691 49.0279 18.5801 50.0865 19.2649 50.8643C22.0385 54.014 26.4316 55.1918 30.4084 53.8509C31.3904 53.5198 32.4489 52.9085 34.5657 51.6863L46.7442 44.6551C48.8613 43.4328 49.9205 42.8214 50.6983 42.1365C53.8479 39.363 55.0245 34.9695 53.6835 30.9927C53.3524 30.0107 52.7412 28.9522 51.519 26.8354C50.2968 24.7185 49.6858 23.66 49.0009 22.8822C46.2274 19.7325 41.8342 18.5547 37.8575 19.8956C36.8754 20.2267 35.8163 20.8383 33.6993 22.0606L21.5208 29.0919Z"}),T.jsx("g",{transform:"rotate(-30 22.6953 37.6011)",children:T.jsx("rect",{x:"22.6953",y:"37.6011",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})}),T.jsx("g",{transform:"rotate(-30 35.6748 30.1074)",children:T.jsx("rect",{x:"35.6748",y:"30.1074",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})})]})}function Lj({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:t,children:T.jsx("path",{d:"M7 2h10a5 5 0 015 5v10a5 5 0 01-5 5H7a5 5 0 01-5-5V7a5 5 0 015-5zm0 4.5v11h2.35v-4.55h5.3V17.5H17v-11h-2.35v4.1h-5.3V6.5H7z"})})}function Dj({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:t,children:T.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})}function Ij({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:T.jsx("g",{transform:"translate(3.4502, 3)",fill:"#9570BE",children:T.jsx("path",{d:"M3.17890888,3.6 L3.17890888,0 L16,0 L16,3.6 L3.17890888,3.6 Z M9.642,7.2 L9.64218223,10.8 L0,10.8 L0,3.6 L16,3.6 L16,7.2 L9.642,7.2 Z M3.17890888,18 L3.178,14.4 L0,14.4 L0,10.8 L16,10.8 L16,18 L3.17890888,18 Z",fillRule:"nonzero"})})})}function Mj({size:e=16,className:t=""}){return T.jsxs("svg",{width:e,height:e,viewBox:"0 0 120 90",fill:"currentColor",className:t,children:[T.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),T.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),T.jsx("rect",{x:"75",y:"20",width:"12",height:"45",rx:"2"}),T.jsx("rect",{x:"71",y:"55",width:"20",height:"16",rx:"3"}),T.jsx("rect",{x:"76",y:"71",width:"3",height:"8",rx:"1"}),T.jsx("rect",{x:"82",y:"71",width:"3",height:"8",rx:"1"})]})}function Nj({size:e=16,className:t=""}){return T.jsxs("svg",{width:e,height:e,viewBox:"0 0 120 90",fill:"currentColor",className:t,children:[T.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),T.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),T.jsx("rect",{x:"83",y:"20",width:"12",height:"62",rx:"2"})]})}function Oj({size:e=16,className:t=""}){return T.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[T.jsx("path",{d:"M9 3v2"}),T.jsx("path",{d:"M15 3v2"}),T.jsx("rect",{x:"4",y:"6",width:"16",height:"13",rx:"3"}),T.jsx("circle",{cx:"9",cy:"13",r:"1.4",fill:"currentColor",stroke:"none"}),T.jsx("circle",{cx:"15",cy:"13",r:"1.4",fill:"currentColor",stroke:"none"}),T.jsx("path",{d:"M9 16h6"})]})}const jj={CLAUDE:_j,CODEBUDDY:Rj,CODEX:wj,COPILOT:Aj,CRAFT:Ij,CURSOR:xj,DROID:Oj,GEMINI:Pj,GITHUB:Dj,GROK:Sj,HERMES:Lj,KIMI:Ej,KIRO:Cj,OPENCODE:Tj,OMP:Mj,PI:Nj},Uj={ANTIGRAVITY:"/brand-logos/antigravity.svg",CLAUDE:"/brand-logos/claude-code.svg",CODEX:"/brand-logos/codex.svg",GEMINI:"/brand-logos/gemini.svg",HERMES:"/brand-logos/hermes.svg","KILO-CLI":"/brand-logos/kilo.svg","KILO-CODE":"/brand-logos/kilo.svg",OPENCLAW:"/brand-logos/openclaw.svg",OPENCODE:"/brand-logos/opencode.svg"};function Bj({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:T.jsx("circle",{cx:"12",cy:"12",r:"7.5",strokeDasharray:"3 3"})})}function zj({provider:e,size:t=16,color:n,className:a=""}){const o=e?.toUpperCase?.()||"",s=Uj[o];if(s)return T.jsx("img",{src:s,alt:"",width:t,height:t,className:a,style:{width:t,height:t,objectFit:"contain"},"aria-hidden":!0});const l=jj[o];return l?T.jsx(l,{size:t,className:a}):T.jsx(Bj,{size:t,className:`text-oai-gray-400 dark:text-oai-gray-500 shrink-0 ${a}`})}const PP="tokentracker-skills";async function zi(e){const t=new URL(`/functions/${PP}`,window.location.origin);if(e)for(const[o,s]of Object.entries(e))s!=null&&s!==""&&t.searchParams.set(o,String(s));const n=await fetch(t.toString(),{headers:{Accept:"application/json"},cache:"no-store"}),a=await n.json().catch(()=>null);if(!n.ok)throw new Error(a?.error||`Request failed with HTTP ${n.status}`);return a}async function Jr(e){const t=await fd(),n=await fetch(`/functions/${PP}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...t},cache:"no-store",body:JSON.stringify(e)}),a=await n.json().catch(()=>null);if(!n.ok||a?.ok===!1)throw new Error(a?.error||`Request failed with HTTP ${n.status}`);return a}function Fj(){return zi({mode:"installed"})}function J9(e={}){return zi({mode:"discover",...e.force?{force:1}:{}})}function e7(e,t=0,n=20){return zi({mode:"search",q:e,offset:t,limit:n})}function t7(){return zi({mode:"repos"})}function n7(e,t){return Jr({action:"install",skill:e,targets:t})}function a7(e){return Jr({action:"uninstall",id:e})}function r7(e){return Jr({action:"restore",id:e})}function i7(e,t){return Jr({action:"set_targets",id:e,targets:t})}function o7(e,t){return Jr({action:"import_local",directory:e,targets:t})}function s7(e,t){return Jr({action:"delete_local",directory:e,targets:t||[]})}function l7(e){return Jr({action:"add_repo",repo:e})}function c7(e,t){return Jr({action:"remove_repo",owner:e,name:t})}function u7(e={}){return zi({mode:"popular",...e.force?{force:1}:{}})}function d7(e={}){return zi({mode:"updates",...e.force?{force:1}:{}})}function h7(e={}){return zi({mode:"skill_usage",...e.force?{force:1}:{}})}const Vj=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");function $j(){const e=_l(),t=qO(),[n,a]=k.useState(!1),[o,s]=k.useState(""),[l,u]=k.useState(0),[f,h]=k.useState([]),m=k.useRef(null),y=k.useRef(null);k.useEffect(()=>{const E=A=>{(A.metaKey||A.ctrlKey)&&(A.key==="k"||A.key==="K")&&(A.preventDefault(),a(F=>!F))};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[]),k.useEffect(()=>{if(!n)return;s(""),u(0);const E=requestAnimationFrame(()=>m.current?.focus());return Vj&&!f.length&&Fj().then(A=>h(A?.skills||[])).catch(()=>h([])),()=>cancelAnimationFrame(E)},[n,f.length]);const v=k.useMemo(()=>{const E=wP().flatMap(U=>U.items.map(F=>({kind:"page",id:`page:${F.id}`,label:F.label,sub:De("cmdk.group.pages"),Icon:F.icon,run:()=>e(F.to)}))),A=(f||[]).map(U=>({kind:"skill",id:`skill:${U.id||U.directory}`,label:U.name||U.directory,sub:U.repoOwner&&U.repoName?`${U.repoOwner}/${U.repoName}`:De("cmdk.group.skills"),provider:(U.targets||[])[0]||"claude",run:()=>e(`/skills?skill=${encodeURIComponent(U.directory||U.id)}`)}));return[...E,...A]},[e,f]),_=k.useMemo(()=>{const E=o.trim().toLowerCase();return E?v.filter(A=>A.label.toLowerCase().includes(E)||String(A.sub||"").toLowerCase().includes(E)):v},[v,o]);k.useEffect(()=>{l>=_.length&&u(_.length?_.length-1:0)},[l,_.length]),k.useEffect(()=>{if(!n)return;y.current?.querySelector(`[data-cmdk-index="${l}"]`)?.scrollIntoView({block:"nearest"})},[l,n]);const x=k.useCallback(()=>a(!1),[]),S=k.useCallback(E=>{E&&(x(),E.run())},[x]),C=E=>{E.key==="ArrowDown"?(E.preventDefault(),u(A=>Math.min(A+1,Math.max(0,_.length-1)))):E.key==="ArrowUp"?(E.preventDefault(),u(A=>Math.max(A-1,0))):E.key==="Enter"?(E.preventDefault(),S(_[l])):E.key==="Escape"&&(E.preventDefault(),x())},R={duration:t?0:.12},M=t?{duration:0}:{type:"spring",stiffness:460,damping:34,mass:.6};return T.jsx(G1,{children:n?T.jsxs(tl.div,{className:"fixed inset-0 z-[120] flex items-start justify-center px-4 pt-[16vh]",initial:t?!1:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:R,children:[T.jsx("button",{type:"button","aria-label":De("cmdk.close"),onClick:x,className:"absolute inset-0 cursor-default bg-oai-black/40"}),T.jsxs(tl.div,{role:"dialog","aria-modal":"true","aria-label":De("cmdk.open_aria"),initial:t?!1:{opacity:0,y:-8,scale:.985},animate:{opacity:1,y:0,scale:1},exit:t?{opacity:0}:{opacity:0,y:-8,scale:.985},transition:M,className:"relative w-full max-w-xl overflow-hidden rounded-2xl border border-oai-gray-200 bg-oai-white shadow-2xl dark:border-oai-gray-800 dark:bg-oai-gray-950",children:[T.jsxs("div",{className:"flex items-center gap-2.5 border-b border-oai-gray-200 px-4 dark:border-oai-gray-800",children:[T.jsx(OI,{className:"h-4 w-4 shrink-0 text-oai-gray-400","aria-hidden":!0}),T.jsx("input",{ref:m,type:"text",value:o,onChange:E=>{s(E.target.value),u(0)},onKeyDown:C,"aria-label":De("cmdk.placeholder"),"aria-controls":"cmdk-listbox","aria-activedescendant":_[l]?`cmdk-opt-${l}`:void 0,role:"combobox","aria-expanded":"true",placeholder:De("cmdk.placeholder"),className:"h-12 w-full bg-transparent text-sm text-oai-black placeholder:text-oai-gray-400 focus:outline-none dark:text-white"})]}),T.jsx("div",{ref:y,id:"cmdk-listbox",role:"listbox",className:"max-h-[min(56vh,22rem)] overflow-y-auto p-1.5",children:_.length===0?T.jsx("div",{className:"px-3 py-8 text-center text-sm text-oai-gray-500 dark:text-oai-gray-400",children:De("cmdk.empty")}):_.map((E,A)=>{const U=A===l;return T.jsxs("button",{type:"button",role:"option",id:`cmdk-opt-${A}`,"data-cmdk-index":A,"aria-selected":U,onMouseMove:()=>u(A),onClick:()=>S(E),className:wt("flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-sm transition-colors",U?"bg-oai-gray-100 text-oai-black dark:bg-oai-gray-800/70 dark:text-white":"text-oai-gray-700 dark:text-oai-gray-200"),children:[T.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center text-oai-gray-500 dark:text-oai-gray-400",children:E.kind==="skill"?T.jsx(zj,{provider:E.provider,size:16}):T.jsx(E.Icon,{className:"h-4 w-4","aria-hidden":!0})}),T.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:E.label}),T.jsx("span",{className:"shrink-0 truncate text-xs text-oai-gray-400 dark:text-oai-gray-500",children:E.sub}),U?T.jsx(yI,{className:"h-3.5 w-3.5 shrink-0 text-oai-gray-400","aria-hidden":!0}):null]},E.id)})})]})]}):null})}function _d(){return typeof window<"u"}function yg(e){return vg(e)?(e.nodeName||"").toLowerCase():"#document"}function Yr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Hj(e){var t;return(t=(vg(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vg(e){return _d()?e instanceof Node||e instanceof Yr(e).Node:!1}function SP(e){return _d()?e instanceof Element||e instanceof Yr(e).Element:!1}function wd(e){return _d()?e instanceof HTMLElement||e instanceof Yr(e).HTMLElement:!1}function Vp(e){return!_d()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Yr(e).ShadowRoot}function CP(e){const{overflow:t,overflowX:n,overflowY:a,display:o}=EP(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&o!=="inline"&&o!=="contents"}function f7(e){return/^(table|td|th)$/.test(yg(e))}function Wj(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Gj=/transform|translate|scale|rotate|perspective|filter/,Kj=/paint|layout|strict|content/,bi=e=>!!e&&e!=="none";let $f;function qj(e){const t=SP(e)?EP(e):e;return bi(t.transform)||bi(t.translate)||bi(t.scale)||bi(t.rotate)||bi(t.perspective)||!Yj()&&(bi(t.backdropFilter)||bi(t.filter))||Gj.test(t.willChange||"")||Kj.test(t.contain||"")}function p7(e){let t=$p(e);for(;wd(t)&&!TP(t);){if(qj(t))return t;if(Wj(t))return null;t=$p(t)}return null}function Yj(){return $f==null&&($f=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),$f}function TP(e){return/^(html|body|#document)$/.test(yg(e))}function EP(e){return Yr(e).getComputedStyle(e)}function m7(e){return SP(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $p(e){if(yg(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Vp(e)&&e.host||Hj(e);return Vp(t)?t.host:t}function AP(e){const t=$p(e);return TP(t)?e.ownerDocument?e.ownerDocument.body:e.body:wd(t)&&CP(t)?t:AP(t)}function W_(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=AP(e),s=o===((a=e.ownerDocument)==null?void 0:a.body),l=Yr(o);if(s){const u=Zj(l);return t.concat(l,l.visualViewport||[],CP(o)?o:[],u&&n?W_(u):[])}else return t.concat(o,W_(o,[],n))}function Zj(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ao(e){return e?.ownerDocument||document}const G_={};function Dl(e,t){const n=k.useRef(G_);return n.current===G_&&(n.current=e(t)),n}const Hf=em[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Xj=Hf&&Hf!==k.useLayoutEffect?Hf:e=>e();function An(e){const t=Dl(Qj).current;return t.next=e,Xj(t.effect),t.trampoline}function Qj(){const e={next:void 0,callback:Jj,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Jj(){}let K_=0;function RP(e){return K_+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${K_}`}const e8=[];function LP(e){k.useEffect(e,e8)}const Us=0;class ml{static create(){return new ml}currentId=Us;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Us,n()},t)}isStarted(){return this.currentId!==Us}clear=()=>{this.currentId!==Us&&(clearTimeout(this.currentId),this.currentId=Us)};disposeEffect=()=>this.clear}function g7(){const e=Dl(ml.create).current;return LP(e.disposeEffect),e}const Ko=typeof navigator<"u",Wf=a8(),DP=i8(),IP=r8(),y7=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),v7=Wf.platform==="MacIntel"&&Wf.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Wf.platform),t8=Ko&&/apple/i.test(navigator.vendor),b7=Ko&&/android/i.test(DP)||/android/i.test(IP);Ko&&DP.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const n8=IP.includes("jsdom/");function a8(){if(!Ko)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function r8(){if(!Ko)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function i8(){if(!Ko)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const q_="data-base-ui-focusable",k7="active",_7="selected",o8="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",w7="ArrowLeft",x7="ArrowRight",P7="ArrowUp",S7="ArrowDown";function gl(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Ei(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Vp(n)){let a=t;for(;a;){if(e===a)return!0;a=a.parentNode||a.host}}return!1}function Hp(e){return"composedPath"in e?e.composedPath()[0]:e.target}function C7(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function T7(e){return e.matches("html,body")}function xd(e){return e?.ownerDocument||document}function s8(e){return wd(e)&&e.matches(o8)}function E7(e){return e?e.getAttribute("role")==="combobox"&&s8(e):!1}function Wp(e){if(!e||n8)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function A7(e){return e?e.hasAttribute(q_)?e:e.querySelector(`[${q_}]`)||e:null}function Il(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(a=>n.searchParams.append("args[]",a)),`Base UI error #${e}; visit ${n} for the full message.`}var l8=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],ed=l8.join(","),MP=typeof Element>"u",zo=MP?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,td=!MP&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},nd=function(t,n){var a;n===void 0&&(n=!0);var o=t==null||(a=t.getAttribute)===null||a===void 0?void 0:a.call(t,"inert"),s=o===""||o==="true",l=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):nd(t.parentNode));return l},c8=function(t){var n,a=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return a===""||a==="true"},NP=function(t,n,a){if(nd(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(ed));return n&&zo.call(t,ed)&&o.unshift(t),o=o.filter(a),o},ad=function(t,n,a){for(var o=[],s=Array.from(t);s.length;){var l=s.shift();if(!nd(l,!1))if(l.tagName==="SLOT"){var u=l.assignedElements(),f=u.length?u:l.children,h=ad(f,!0,a);a.flatten?o.push.apply(o,h):o.push({scopeParent:l,candidates:h})}else{var m=zo.call(l,ed);m&&a.filter(l)&&(n||!t.includes(l))&&o.push(l);var y=l.shadowRoot||typeof a.getShadowRoot=="function"&&a.getShadowRoot(l),v=!nd(y,!1)&&(!a.shadowRootFilter||a.shadowRootFilter(l));if(y&&v){var _=ad(y===!0?l.children:y.children,!0,a);a.flatten?o.push.apply(o,_):o.push({scopeParent:l,candidates:_})}else s.unshift.apply(s,l.children)}}return o},OP=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},jP=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||c8(t))&&!OP(t)?0:t.tabIndex},u8=function(t,n){var a=jP(t);return a<0&&n&&!OP(t)?0:a},d8=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},UP=function(t){return t.tagName==="INPUT"},h8=function(t){return UP(t)&&t.type==="hidden"},f8=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(a){return a.tagName==="SUMMARY"});return n},p8=function(t,n){for(var a=0;a<t.length;a++)if(t[a].checked&&t[a].form===n)return t[a]},m8=function(t){if(!t.name)return!0;var n=t.form||td(t),a=function(u){return n.querySelectorAll('input[type="radio"][name="'+u+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=a(window.CSS.escape(t.name));else try{o=a(t.name)}catch(l){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",l.message),!1}var s=p8(o,t.form);return!s||s===t},g8=function(t){return UP(t)&&t.type==="radio"},y8=function(t){return g8(t)&&!m8(t)},v8=function(t){var n,a=t&&td(t),o=(n=a)===null||n===void 0?void 0:n.host,s=!1;if(a&&a!==t){var l,u,f;for(s=!!((l=o)!==null&&l!==void 0&&(u=l.ownerDocument)!==null&&u!==void 0&&u.contains(o)||t!=null&&(f=t.ownerDocument)!==null&&f!==void 0&&f.contains(t));!s&&o;){var h,m,y;a=td(o),o=(h=a)===null||h===void 0?void 0:h.host,s=!!((m=o)!==null&&m!==void 0&&(y=m.ownerDocument)!==null&&y!==void 0&&y.contains(o))}}return s},Y_=function(t){var n=t.getBoundingClientRect(),a=n.width,o=n.height;return a===0&&o===0},b8=function(t,n){var a=n.displayCheck,o=n.getShadowRoot;if(a==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var l=zo.call(t,"details>summary:first-of-type"),u=l?t.parentElement:t;if(zo.call(u,"details:not([open]) *"))return!0;if(!a||a==="full"||a==="full-native"||a==="legacy-full"){if(typeof o=="function"){for(var f=t;t;){var h=t.parentElement,m=td(t);if(h&&!h.shadowRoot&&o(h)===!0)return Y_(t);t.assignedSlot?t=t.assignedSlot:!h&&m!==t.ownerDocument?t=m.host:t=h}t=f}if(v8(t))return!t.getClientRects().length;if(a!=="legacy-full")return!0}else if(a==="non-zero-area")return Y_(t);return!1},k8=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var a=0;a<n.children.length;a++){var o=n.children.item(a);if(o.tagName==="LEGEND")return zo.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Gp=function(t,n){return!(n.disabled||h8(n)||b8(n,t)||f8(n)||k8(n))},Kp=function(t,n){return!(y8(n)||jP(n)<0||!Gp(t,n))},_8=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},BP=function(t){var n=[],a=[];return t.forEach(function(o,s){var l=!!o.scopeParent,u=l?o.scopeParent:o,f=u8(u,l),h=l?BP(o.candidates):u;f===0?l?n.push.apply(n,h):n.push(u):a.push({documentOrder:s,tabIndex:f,item:o,isScope:l,content:h})}),a.sort(d8).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},bg=function(t,n){n=n||{};var a;return n.getShadowRoot?a=ad([t],n.includeContainer,{filter:Kp.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:_8}):a=NP(t,n.includeContainer,Kp.bind(null,n)),BP(a)},R7=function(t,n){n=n||{};var a;return n.getShadowRoot?a=ad([t],n.includeContainer,{filter:Gp.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):a=NP(t,n.includeContainer,Gp.bind(null,n)),a},L7=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return zo.call(t,ed)===!1?!1:Kp(n,t)};const kg=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function zP(e,t){const n=bg(e,kg()),a=n.length;if(a===0)return;const o=gl(xd(e)),s=n.indexOf(o),l=s===-1?t===1?0:a-1:s+t;return n[l]}function w8(e){return zP(xd(e).body,1)||e}function x8(e){return zP(xd(e).body,-1)||e}function FP(e,t){if(!e)return null;const n=bg(xd(e).body,kg()),a=n.length;if(a===0)return null;const o=n.indexOf(e);if(o===-1)return null;const s=(o+t+a)%a;return n[s]}function D7(e){return FP(e,1)}function I7(e){return FP(e,-1)}function Gf(e,t){const n=t||e.currentTarget,a=e.relatedTarget;return!a||!Ei(n,a)}function P8(e){bg(e,kg()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Z_(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const a=n.dataset.tabindex;delete n.dataset.tabindex,a?n.setAttribute("tabindex",a):n.removeAttribute("tabindex")})}const _g=k.createContext(void 0);function wg(){const e=k.useContext(_g);if(!e)throw new Error(Il(73));return e}function Kf(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}const S8=function(t){const{children:n,timeout:a=5e3,limit:o=3,toastManager:s}=t,[l,u]=k.useState([]),[f,h]=k.useState(!1),[m,y]=k.useState(!1),[v,_]=k.useState(null);l.length===0&&(f&&h(!1),m&&y(!1));const x=f||m,S=k.useRef(new Map),C=k.useRef(null),R=k.useRef(!0),M=k.useRef(!1);function E(Q){const ne=gl(Ao(C.current));if(!C.current||!Ei(C.current,ne)||!Wp(ne))return;const J=l.findIndex(z=>z.id===Q);let ee=null,se=J+1;for(;se<l.length;){if(l[se].transitionStatus!=="ending"){ee=l[se];break}se+=1}if(!ee)for(se=J-1;se>=0;){if(l[se].transitionStatus!=="ending"){ee=l[se];break}se-=1}ee?ee.ref?.current?.focus():v?.focus({preventScroll:!0})}const A=An(()=>{M.current||(M.current=!0,S.current.forEach(Q=>{if(Q.timeout){Q.timeout.clear();const ne=Date.now()-Q.start,J=Q.delay-ne;Q.remaining=J>0?J:0}}))}),U=An(()=>{M.current&&(M.current=!1,S.current.forEach((Q,ne)=>{Q.remaining=Q.remaining>0?Q.remaining:Q.delay,Q.timeout??=ml.create(),Q.timeout.start(Q.remaining,()=>{S.current.delete(ne),Q.callback()}),Q.start=Date.now()}))}),F=An(Q=>{u(ee=>{const se=ee.map(q=>q.id===Q?{...q,transitionStatus:"ending",height:0}:q),z=se.filter(q=>q.transitionStatus!=="ending");return se.map(q=>{if(q.transitionStatus==="ending")return q;const V=z.indexOf(q)>=o;return{...q,limited:V}})});const ne=S.current.get(Q);ne&&ne.timeout&&(ne.timeout.clear(),S.current.delete(Q)),l.find(ee=>ee.id===Q)?.onClose?.(),E(Q),l.length===1&&(h(!1),y(!1))}),$=An(Q=>{u(J=>J.filter(ee=>ee.id!==Q)),l.find(J=>J.id===Q)?.onRemove?.()}),P=An((Q,ne,J)=>{const ee=Date.now(),se=R.current&&!f&&!m,z=se?ml.create():void 0;z?.start(ne,()=>{S.current.delete(Q),J()}),S.current.set(Q,{timeout:z,start:se?ee:0,delay:ne,remaining:ne,callback:J})}),Z=An(Q=>{const ne=Q.id||RP("toast"),J={...Q,id:ne,transitionStatus:"starting"};u(se=>{const z=[J,...se],q=z.filter(V=>V.transitionStatus!=="ending");if(q.length>o){const V=q.length-o,D=q.slice(-V);return z.map(W=>D.some(pe=>pe.id===W.id)?{...W,limited:!0}:{...W,limited:!1})}return z.map(V=>({...V,limited:!1}))});const ee=J.timeout??a;return J.type!=="loading"&&ee>0&&P(ne,ee,()=>F(ne)),(f||m||!R.current)&&A(),ne}),X=An((Q,ne)=>{const J=l.find(me=>me.id===Q)??null,ee=J?{...J,...ne}:null;if(Oi.flushSync(()=>{u(me=>me.map(ge=>ge.id===Q?{...ge,...ne}:ge))}),!ee)return;const se=ee.timeout??a,z=J?.timeout??a,q=Object.hasOwn(ne,"timeout"),V=ee.transitionStatus!=="ending"&&ee.type!=="loading"&&se>0,D=S.current.has(Q),W=z!==se,pe=J?.type==="loading";if(!V&&D){S.current.get(Q)?.timeout?.clear(),S.current.delete(Q);return}if(V&&(!D||W||q||pe)){const me=S.current.get(Q);me&&(me.timeout?.clear(),S.current.delete(Q)),P(Q,se,()=>F(Q)),(f||m||!R.current)&&A()}}),fe=An((Q,ne)=>{const J=Kf(ne.loading),ee=Z({...J,type:"loading"}),se=Q.then(z=>{const q=Kf(ne.success,z);return X(ee,{...q,type:"success",timeout:q.timeout}),z}).catch(z=>{const q=Kf(ne.error,z);return X(ee,{...q,type:"error",timeout:q.timeout}),Promise.reject(z)});return{}.hasOwnProperty.call(ne,"setPromise")&&ne.setPromise(se),se});k.useEffect(function(){return s?s[" subscribe"](({action:J,options:ee})=>{const se=ee.id;J==="promise"&&ee.promise?fe(ee.promise,ee):J==="update"&&se?X(se,ee):J==="close"&&se?F(se):Z(ee)}):void 0},[Z,X,P,a,s,fe,F]);const he=k.useMemo(()=>({toasts:l,setToasts:u,hovering:f,setHovering:h,focused:m,setFocused:y,expanded:x,add:Z,close:F,remove:$,update:X,promise:fe,pauseTimers:A,resumeTimers:U,prevFocusElement:v,setPrevFocusElement:_,viewportRef:C,scheduleTimer:P,windowFocusedRef:R}),[Z,F,m,f,x,A,v,fe,$,U,P,l,X]);return T.jsx(_g.Provider,{value:he,children:n})},VP={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},$P={...VP,position:"fixed",top:0,left:0},M7={...VP,position:"absolute"},C8=()=>{},Ml=typeof document<"u"?k.useLayoutEffect:C8,nl=k.forwardRef(function(t,n){const[a,o]=k.useState();Ml(()=>{t8&&o("button")},[]);const s={tabIndex:0,role:a};return T.jsx("span",{...t,ref:n,style:$P,"aria-hidden":a?void 0:!0,...s,"data-base-ui-focus-guard":""})}),T8=k.createContext(void 0);function X_(e,t,n,a){const o=Dl(HP).current;return A8(o,e,t,n,a)&&WP(o,[e,t,n,a]),o.callback}function E8(e){const t=Dl(HP).current;return R8(t,e)&&WP(t,e),t.callback}function HP(){return{callback:null,cleanup:null,refs:[]}}function A8(e,t,n,a,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==a||e.refs[3]!==o}function R8(e,t){return e.refs.length!==t.length||e.refs.some((n,a)=>n!==t[a])}function WP(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const a=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const l=s(n);typeof l=="function"&&(a[o]=l);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const l=a[o];typeof l=="function"?l():s(null);break}case"object":{s.current=null;break}}}}}}}const L8=parseInt(k.version,10);function GP(e){return L8>=e}function Q_(e){if(!k.isValidElement(e))return null;const t=e,n=t.props;return(GP(19)?n?.ref:t.ref)??null}function qp(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function D8(e,t){const n={};for(const a in e){const o=e[a];if(t?.hasOwnProperty(a)){const s=t[a](o);s!=null&&Object.assign(n,s);continue}o===!0?n[`data-${a.toLowerCase()}`]="":o&&(n[`data-${a.toLowerCase()}`]=o.toString())}return n}function I8(e,t){return typeof e=="function"?e(t):e}function M8(e,t){return typeof e=="function"?e(t):e}const al={};function KP(e,t,n,a,o){let s={...Yp(e,al)};return t&&(s=Ws(s,t)),n&&(s=Ws(s,n)),a&&(s=Ws(s,a)),o&&(s=Ws(s,o)),s}function N8(e){if(e.length===0)return al;if(e.length===1)return Yp(e[0],al);let t={...Yp(e[0],al)};for(let n=1;n<e.length;n+=1)t=Ws(t,e[n]);return t}function Ws(e,t){return qP(t)?t(e):O8(e,t)}function O8(e,t){if(!t)return e;for(const n in t){const a=t[n];switch(n){case"style":{e[n]=qp(e.style,a);break}case"className":{e[n]=YP(e.className,a);break}default:j8(n,a)?e[n]=U8(e[n],a):e[n]=a}}return e}function j8(e,t){const n=e.charCodeAt(0),a=e.charCodeAt(1),o=e.charCodeAt(2);return n===111&&a===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function qP(e){return typeof e=="function"}function Yp(e,t){return qP(e)?e(t):e??al}function U8(e,t){return t?e?n=>{if(B8(n)){const o=n;Zp(o);const s=t(o);return o.baseUIHandlerPrevented||e?.(o),s}const a=t(n);return e?.(n),a}:t:e}function Zp(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function YP(e,t){return t?e?t+" "+e:t:e}function B8(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function N7(){}const O7=Object.freeze([]),Vr=Object.freeze({}),j7=500,U7={style:{transition:"none"}},B7="data-base-ui-click-trigger",z7={fallbackAxisSide:"none"},F7={fallbackAxisSide:"end"},z8={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Nl(e,t,n={}){const a=t.render,o=F8(t,n);if(n.enabled===!1)return null;const s=n.state??Vr;return V8(e,a,o,s)}function F8(e,t={}){const{className:n,style:a,render:o}=e,{state:s=Vr,ref:l,props:u,stateAttributesMapping:f,enabled:h=!0}=t,m=h?I8(n,s):void 0,y=h?M8(a,s):void 0,v=h?D8(s,f):Vr,_=h?qp(v,Array.isArray(u)?N8(u):u)??Vr:Vr;return typeof document<"u"&&(h?Array.isArray(l)?_.ref=E8([_.ref,Q_(o),...l]):_.ref=X_(_.ref,Q_(o),l):X_(null,null)),h?(m!==void 0&&(_.className=YP(_.className,m)),y!==void 0&&(_.style=qp(_.style,y)),_):Vr}function V8(e,t,n,a){if(t){if(typeof t=="function")return t(n,a);const o=KP(n,t.props);return o.ref=n.ref,k.cloneElement(t,o)}if(e&&typeof e=="string")return $8(e,n);throw new Error(Il(8))}function $8(e,t){return e==="button"?k.createElement("button",{type:"button",...t,key:t.key}):e==="img"?k.createElement("img",{alt:"",...t,key:t.key}):k.createElement(e,t)}let H8=(function(e){return e.frontmostHeight="--toast-frontmost-height",e})({});const W8=k.forwardRef(function(t,n){const{render:a,className:o,children:s,...l}=t,{toasts:u,pauseTimers:f,resumeTimers:h,setHovering:m,setFocused:y,viewportRef:v,windowFocusedRef:_,prevFocusElement:x,setPrevFocusElement:S,expanded:C,focused:R}=wg(),M=k.useRef(!1),E=k.useRef(!1),A=u.length,U=u[0]?.height??0,F=k.useMemo(()=>u.some(z=>z.transitionStatus==="ending"),[u]);k.useEffect(()=>{if(!v.current)return;function z(V){A!==0&&V.key==="F6"&&V.target!==v.current&&(V.preventDefault(),S(gl(Ao(v.current))),v.current?.focus({preventScroll:!0}),f(),y(!0))}const q=Yr(v.current);return q.addEventListener("keydown",z),()=>{q.removeEventListener("keydown",z)}},[f,y,S,A,v]),k.useEffect(()=>{if(!v.current||!A)return;const z=Yr(v.current);function q(D){D.target===z&&(_.current=!1,f())}function V(D){if(D.relatedTarget||D.target===z)return;const W=Hp(D),pe=gl(Ao(v.current));(!Ei(v.current,W)||!Wp(pe))&&h(),setTimeout(()=>{_.current=!0})}return z.addEventListener("blur",q,!0),z.addEventListener("focus",V,!0),()=>{z.removeEventListener("blur",q,!0),z.removeEventListener("focus",V,!0)}},[f,h,v,_,y,A]),k.useEffect(()=>{const z=v.current;if(!z||A===0)return;const q=Ao(z);function V(D){if(D.pointerType!=="touch")return;const W=Hp(D);Ei(z,W)||(h(),m(!1),y(!1))}return q.addEventListener("pointerdown",V,!0),()=>{q.removeEventListener("pointerdown",V,!0)}},[A,h,y,m,v]);function $(z){v.current&&(M.current=!0,z.relatedTarget===v.current?u[0]?.ref?.current?.focus():x?.focus({preventScroll:!0}))}function P(z){z.key==="Tab"&&z.shiftKey&&z.target===v.current&&(z.preventDefault(),x?.focus({preventScroll:!0}),h())}k.useEffect(()=>{!_.current||F||!E.current||(h(),m(!1),E.current=!1)},[F,h,m,_]);function Z(){f(),m(!0),E.current=!1}function X(){u.some(z=>z.transitionStatus==="ending")?E.current=!0:(h(),m(!1))}function fe(){if(M.current){M.current=!1;return}R||Wp(Ao(v.current).activeElement)&&(y(!0),f())}function he(z){!R||Ei(v.current,z.relatedTarget)||(y(!1),h())}const Q={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:Z,onMouseMove:Z,onMouseLeave:X,onFocus:fe,onBlur:he,onKeyDown:P,onClick:fe},ne=k.useMemo(()=>({expanded:C}),[C]),J=Nl("div",t,{ref:[n,v],state:ne,props:[Q,{style:{[H8.frontmostHeight]:U?`${U}px`:void 0}},l,{children:T.jsxs(k.Fragment,{children:[A>0&&x&&T.jsx(nl,{onFocus:$}),s,A>0&&x&&T.jsx(nl,{onFocus:$})]})}]}),ee=k.useMemo(()=>({viewportRef:v}),[v]),se=k.useMemo(()=>u.filter(z=>z.priority==="high"),[u]);return T.jsxs(T8.Provider,{value:ee,children:[A>0&&x&&T.jsx(nl,{onFocus:$}),J,!R&&se.length>0&&T.jsx("div",{style:$P,children:se.map(z=>T.jsxs("div",{role:"alert","aria-atomic":!0,children:[T.jsx("div",{children:z.title}),T.jsx("div",{children:z.description})]},z.id))})]})});function G8(e){return GP(19)?e:e?"true":void 0}const ZP=k.createContext(void 0);function Xp(){const e=k.useContext(ZP);if(!e)throw new Error(Il(66));return e}let xg=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const K8={[xg.startingStyle]:""},q8={[xg.endingStyle]:""},Y8={transitionStatus(e){return e==="starting"?K8:e==="ending"?q8:null}},tu=null;class Z8{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,a=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,a>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const nu=new Z8;class Pg{static create(){return new Pg}static request(t){return nu.request(t)}static cancel(t){return nu.cancel(t)}currentId=tu;request(t){this.cancel(),this.currentId=nu.request(()=>{this.currentId=tu,t()})}cancel=()=>{this.currentId!==tu&&(nu.cancel(this.currentId),this.currentId=tu)};disposeEffect=()=>this.cancel}function X8(){const e=Dl(Pg.create).current;return LP(e.disposeEffect),e}function Q8(e){return e==null?e:"current"in e?e.current:e}function J8(e,t=!1,n=!0){const a=X8();return An((o,s=null)=>{a.cancel();function l(){Oi.flushSync(o)}const u=Q8(e);if(u==null)return;const f=u;if(typeof f.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)o();else{let h=function(){const y=xg.startingStyle;if(!f.hasAttribute(y)){a.request(m);return}const v=new MutationObserver(()=>{f.hasAttribute(y)||(v.disconnect(),m())});v.observe(f,{attributes:!0,attributeFilter:[y]}),s?.addEventListener("abort",()=>v.disconnect(),{once:!0})},m=function(){Promise.all(f.getAnimations().map(y=>y.finished)).then(()=>{s?.aborted||l()}).catch(()=>{const y=f.getAnimations();if(n){if(s?.aborted)return;l()}else y.length>0&&y.some(v=>v.pending||v.playState!=="finished")&&m()})};if(t){h();return}a.request(m)}})}function eU(e){const{enabled:t=!0,open:n,ref:a,onComplete:o}=e,s=An(o),l=J8(a,n,!1);k.useEffect(()=>{if(!t)return;const u=new AbortController;return l(s,u.signal),()=>{u.abort()}},[t,n,s,l])}let ki=(function(e){return e.index="--toast-index",e.offsetY="--toast-offset-y",e.height="--toast-height",e.swipeMovementX="--toast-swipe-movement-x",e.swipeMovementY="--toast-swipe-movement-y",e})({});const tU={...Y8,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},Bs=40,nU=10,Or=.5,aU=1;function J_(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function rU(e){const n=window.getComputedStyle(e).transform;let a=0,o=0,s=1;if(n&&n!=="none"){const l=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(l){const u=l[1].split(", ").map(parseFloat);u.length===6?(a=u[4],o=u[5],s=Math.sqrt(u[0]*u[0]+u[1]*u[1])):u.length===16&&(a=u[12],o=u[13],s=u[0])}}return{x:a,y:o,scale:s}}const iU=k.forwardRef(function(t,n){const{toast:a,render:o,className:s,swipeDirection:l=["down","right"],...u}=t,f=a.positionerProps?.anchor!==void 0;let h=[];f||(h=Array.isArray(l)?l:[l]);const m=h.length>0,{toasts:y,focused:v,close:_,remove:x,setToasts:S,pauseTimers:C,expanded:R,setHovering:M}=wg(),[E,A]=k.useState(void 0),[U,F]=k.useState(!1),[$,P]=k.useState(!1),[Z,X]=k.useState(!1),[fe,he]=k.useState({x:0,y:0}),[Q,ne]=k.useState({x:0,y:0,scale:1}),[J,ee]=k.useState(),[se,z]=k.useState(),[q,V]=k.useState(null),D=k.useRef(null),W=k.useRef({x:0,y:0}),pe=k.useRef({x:0,y:0,scale:1}),me=k.useRef(void 0),ge=k.useRef(0),xe=k.useRef(!1),ze=k.useRef({x:0,y:0}),Ye=k.useRef(!1),je=k.useMemo(()=>y.indexOf(a),[a,y]),Rt=k.useMemo(()=>y.filter(Ke=>Ke.transitionStatus!=="ending").indexOf(a),[a,y]),Ln=k.useMemo(()=>y.slice(0,y.indexOf(a)).reduce((Ke,Ve)=>Ke+(Ve.height||0),0),[y,a]);eU({open:a.transitionStatus!=="ending",ref:D,onComplete(){a.transitionStatus==="ending"&&x(a.id)}});const wn=An((Ke=!1)=>{const Ve=D.current;if(!Ve)return;const ft=Ve.style.height;Ve.style.height="auto";const St=Ve.offsetHeight;Ve.style.height=ft;function Ot(){S(yt=>yt.map(dt=>dt.id===a.id?{...dt,ref:D,height:St,transitionStatus:void 0}:dt))}Ke?Oi.flushSync(Ot):Ot()});Ml(wn,[wn]);function pt(Ke,Ve){let ft=Ke,St=Ve;return!h.includes("left")&&!h.includes("right")?ft=Ke>0?Ke**Or:-(Math.abs(Ke)**Or):(!h.includes("right")&&Ke>0&&(ft=Ke**Or),!h.includes("left")&&Ke<0&&(ft=-(Math.abs(Ke)**Or))),!h.includes("up")&&!h.includes("down")?St=Ve>0?Ve**Or:-(Math.abs(Ve)**Or):(!h.includes("down")&&Ve>0&&(St=Ve**Or),!h.includes("up")&&Ve<0&&(St=-(Math.abs(Ve)**Or))),{x:ft,y:St}}function Xt(Ke){if(Ke.button!==0)return;Ke.pointerType==="touch"&&C();const Ve=Hp(Ke.nativeEvent);if(!(Ve&&Ve.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'))){if(xe.current=!1,me.current=void 0,ge.current=0,W.current={x:Ke.clientX,y:Ke.clientY},ze.current=W.current,D.current){const St=rU(D.current);pe.current=St,ne(St),he({x:St.x,y:St.y})}M(!0),F(!0),P(!1),V(null),Ye.current=!0,D.current?.setPointerCapture(Ke.pointerId)}}function ei(Ke){if(!U)return;Ke.preventDefault(),Ye.current&&(W.current={x:Ke.clientX,y:Ke.clientY},Ye.current=!1);const{clientY:Ve,clientX:ft,movementX:St,movementY:Ot}=Ke;(Ot<0&&Ve>ze.current.y||Ot>0&&Ve<ze.current.y)&&(ze.current={x:ze.current.x,y:Ve}),(St<0&&ft>ze.current.x||St>0&&ft<ze.current.x)&&(ze.current={x:ft,y:ze.current.y});const yt=ft-W.current.x,dt=Ve-W.current.y,ka=Ve-ze.current.y,qo=ft-ze.current.x;if(!$&&Math.sqrt(yt*yt+dt*dt)>=aU&&(P(!0),q===null)){const ra=h.includes("left")||h.includes("right"),ni=h.includes("up")||h.includes("down");if(ra&&ni){const cr=Math.abs(yt),In=Math.abs(dt);V(cr>In?"horizontal":"vertical")}}let Wt;if(!me.current)q==="vertical"?dt>0?Wt="down":dt<0&&(Wt="up"):q==="horizontal"?yt>0?Wt="right":yt<0&&(Wt="left"):Math.abs(yt)>=Math.abs(dt)?Wt=yt>0?"right":"left":Wt=dt>0?"down":"up",Wt&&h.includes(Wt)&&(me.current=Wt,ge.current=J_(Wt,yt,dt),A(Wt));else{const wa=me.current,ra=J_(wa,qo,ka);ra>Bs?(xe.current=!1,A(wa)):!(h.includes("left")&&h.includes("right"))&&!(h.includes("up")&&h.includes("down"))&&ge.current-ra>=nU&&(xe.current=!0)}const za=pt(yt,dt);let hn=pe.current.x,_a=pe.current.y;q==="horizontal"?(h.includes("left")||h.includes("right"))&&(hn+=za.x):(q==="vertical"||(h.includes("left")||h.includes("right"))&&(hn+=za.x),(h.includes("up")||h.includes("down"))&&(_a+=za.y)),he({x:hn,y:_a})}function Fi(Ke){if(!U)return;if(F(!1),P(!1),V(null),D.current?.releasePointerCapture(Ke.pointerId),xe.current){he({x:Q.x,y:Q.y}),A(void 0);return}let Ve=!1;const ft=fe.x-Q.x,St=fe.y-Q.y;let Ot;for(const yt of h){switch(yt){case"right":ft>Bs&&(Ve=!0,Ot="right");break;case"left":ft<-Bs&&(Ve=!0,Ot="left");break;case"down":St>Bs&&(Ve=!0,Ot="down");break;case"up":St<-Bs&&(Ve=!0,Ot="up");break}if(Ve)break}Ve?(A(Ot),X(!0),_(a.id)):(he({x:Q.x,y:Q.y}),A(void 0))}function Dn(Ke){if(Ke.key==="Escape"){if(!D.current||!Ei(D.current,gl(Ao(D.current))))return;_(a.id)}}k.useEffect(()=>{if(!m)return;const Ke=D.current;if(!Ke)return;function Ve(ft){Ei(Ke,ft.target)&&ft.preventDefault()}return Ke.addEventListener("touchmove",Ve,{passive:!1}),()=>{Ke.removeEventListener("touchmove",Ve)}},[m]);function Vi(){if(!U&&fe.x===Q.x&&fe.y===Q.y&&!Z)return{[ki.swipeMovementX]:"0px",[ki.swipeMovementY]:"0px"};const Ke=fe.x-Q.x,Ve=fe.y-Q.y;return{transition:U?"none":void 0,transform:U?`translateX(${fe.x}px) translateY(${fe.y}px) scale(${Q.scale})`:void 0,[ki.swipeMovementX]:`${Ke}px`,[ki.swipeMovementY]:`${Ve}px`}}const lr=a.priority==="high",ba={role:lr?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":J,"aria-describedby":se,"aria-hidden":lr&&!v?!0:void 0,onPointerDown:m?Xt:void 0,onPointerMove:m?ei:void 0,onPointerUp:m?Fi:void 0,onKeyDown:Dn,inert:G8(a.limited),style:{...Vi(),[ki.index]:a.transitionStatus==="ending"?je:Rt,[ki.offsetY]:`${Ln}px`,[ki.height]:a.height?`${a.height}px`:void 0}},dn=k.useMemo(()=>({rootRef:D,toast:a,titleId:J,setTitleId:ee,descriptionId:se,setDescriptionId:z,swiping:U,swipeDirection:E,recalculateHeight:wn,index:je,visibleIndex:Rt,expanded:R}),[a,J,se,U,E,wn,je,Rt,R]),ti=k.useMemo(()=>({transitionStatus:a.transitionStatus,expanded:R,limited:a.limited||!1,type:a.type,swiping:dn.swiping,swipeDirection:dn.swipeDirection}),[R,a.transitionStatus,a.limited,a.type,dn.swiping,dn.swipeDirection]),$i=Nl("div",t,{ref:[n,dn.rootRef],state:ti,stateAttributesMapping:tU,props:[ba,u]});return T.jsx(ZP.Provider,{value:dn,children:$i})}),oU={...em};let e0=0;function sU(e,t="mui"){const[n,a]=k.useState(e),o=e||n;return k.useEffect(()=>{n==null&&(e0+=1,a(`${t}-${e0}`))},[n,t]),o}const t0=oU.useId;function XP(e,t){if(t0!==void 0){const n=t0();return e??(t?`${t}-${n}`:n)}return sU(e,t)}const lU=k.forwardRef(function(t,n){const{render:a,className:o,id:s,children:l,...u}=t,{toast:f}=Xp(),h=l??f.title,m=!!h,y=XP(s),{setTitleId:v}=Xp();Ml(()=>{if(m)return v(y),()=>{v(void 0)}},[m,y,v]);const _=k.useMemo(()=>({type:f.type}),[f.type]),x=Nl("h2",t,{ref:n,state:_,props:{...u,id:y,children:h}});return m?x:null}),cU=k.createContext(void 0);function uU(e=!1){const t=k.useContext(cU);if(t===void 0&&!e)throw new Error(Il(16));return t}function dU(e){const{focusableWhenDisabled:t,disabled:n,composite:a=!1,tabIndex:o=0,isNativeButton:s}=e,l=a&&t!==!1,u=a&&t===!1;return{props:k.useMemo(()=>{const h={onKeyDown(m){n&&t&&m.key!=="Tab"&&m.preventDefault()}};return a||(h.tabIndex=o,!s&&n&&(h.tabIndex=t?o:-1)),(s&&(t||l)||!s&&n)&&(h["aria-disabled"]=n),s&&(!t||u)&&(h.disabled=n),h},[a,n,t,l,u,s,o])}}function hU(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:a=0,native:o=!0}=e,s=k.useRef(null),l=uU(!0)!==void 0,u=An(()=>{const v=s.current;return!!(v?.tagName==="A"&&v?.href)}),{props:f}=dU({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:a,isNativeButton:o}),h=k.useCallback(()=>{const v=s.current;fU(v)&&l&&t&&f.disabled===void 0&&v.disabled&&(v.disabled=!1)},[t,f.disabled,l]);Ml(h,[h]);const m=k.useCallback((v={})=>{const{onClick:_,onMouseDown:x,onKeyUp:S,onKeyDown:C,onPointerDown:R,...M}=v;return KP({type:o?"button":void 0,onClick(A){if(t){A.preventDefault();return}_?.(A)},onMouseDown(A){t||x?.(A)},onKeyDown(A){if(t||(Zp(A),C?.(A)),A.baseUIHandlerPrevented)return;const U=A.target===A.currentTarget&&!o&&!u()&&!t,F=A.key==="Enter",$=A.key===" ";U&&(($||F)&&A.preventDefault(),F&&_?.(A))},onKeyUp(A){t||(Zp(A),S?.(A)),!A.baseUIHandlerPrevented&&A.target===A.currentTarget&&!o&&!t&&A.key===" "&&_?.(A)},onPointerDown(A){if(t){A.preventDefault();return}R?.(A)}},o?void 0:{role:"button"},f,M)},[t,f,o,u]),y=An(v=>{s.current=v,h()});return{getButtonProps:m,buttonRef:y}}function fU(e){return wd(e)&&e.tagName==="BUTTON"}const pU=k.forwardRef(function(t,n){const{render:a,className:o,disabled:s,nativeButton:l=!0,...u}=t,{close:f,expanded:h}=wg(),{toast:m}=Xp(),[y,v]=k.useState(!1),{getButtonProps:_,buttonRef:x}=hU({disabled:s,native:l}),S=k.useMemo(()=>({type:m.type}),[m.type]);return Nl("button",t,{ref:[n,x],state:S,props:[{"aria-hidden":!h&&!y,onClick(){f(m.id)},onFocus(){v(!0)},onBlur(){v(!1)}},u,_]})}),V7="none",$7="trigger-press",H7="trigger-hover",W7="outside-press",G7="item-press",K7="close-press",mU="focus-out",q7="escape-key",Y7="list-navigation",Z7="cancel-open",X7="imperative-action",Q7="window-resize";function gU(e,t,n,a){let o=!1,s=!1;const l=Vr;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){s=!0},get isCanceled(){return o},get isPropagationAllowed(){return s},trigger:n,...l}}function yU(e){return`data-base-ui-${e}`}const QP=k.createContext(null),vU=()=>k.useContext(QP),bU=yU("portal");function JP(e={}){const{ref:t,container:n,componentProps:a=Vr,elementProps:o,elementState:s}=e,l=XP(),f=vU()?.portalNode,[h,m]=k.useState(null),[y,v]=k.useState(null),_=An(R=>{R!==null&&v(R)}),x=k.useRef(null);Ml(()=>{if(n===null){x.current&&(x.current=null,v(null),m(null));return}if(l==null)return;const R=(n&&(vg(n)?n:n.current))??f??document.body;if(R==null){x.current&&(x.current=null,v(null),m(null));return}x.current!==R&&(x.current=R,v(null),m(R))},[n,f,l]);const S=Nl("div",a,{ref:[t,_],state:s,props:[{id:l,[bU]:""},o]});return{portalNode:y,portalSubtree:h&&S?Oi.createPortal(S,h):null}}const J7=k.forwardRef(function(t,n){const{children:a,container:o,className:s,render:l,renderGuards:u,...f}=t,{portalNode:h,portalSubtree:m}=JP({container:o,ref:n,componentProps:t,elementProps:f}),y=k.useRef(null),v=k.useRef(null),_=k.useRef(null),x=k.useRef(null),[S,C]=k.useState(null),R=S?.modal,M=S?.open,E=typeof u=="boolean"?u:!!S&&!S.modal&&S.open&&!!h;k.useEffect(()=>{if(!h||R)return;function U(F){h&&F.relatedTarget&&Gf(F)&&(F.type==="focusin"?Z_:P8)(h)}return h.addEventListener("focusin",U,!0),h.addEventListener("focusout",U,!0),()=>{h.removeEventListener("focusin",U,!0),h.removeEventListener("focusout",U,!0)}},[h,R]),k.useEffect(()=>{!h||M||Z_(h)},[M,h]);const A=k.useMemo(()=>({beforeOutsideRef:y,afterOutsideRef:v,beforeInsideRef:_,afterInsideRef:x,portalNode:h,setFocusManagerState:C}),[h]);return T.jsxs(k.Fragment,{children:[m,T.jsxs(QP.Provider,{value:A,children:[E&&h&&T.jsx(nl,{"data-type":"outside",ref:y,onFocus:U=>{if(Gf(U,h))_.current?.focus();else{const F=S?S.domReference:null;x8(F)?.focus()}}}),E&&h&&T.jsx("span",{"aria-owns":h.id,style:z8}),h&&Oi.createPortal(a,h),E&&h&&T.jsx(nl,{"data-type":"outside",ref:v,onFocus:U=>{if(Gf(U,h))x.current?.focus();else{const F=S?S.domReference:null;w8(F)?.focus(),S?.closeOnFocusOut&&S?.onOpenChange(!1,gU(mU,U.nativeEvent))}}})]})]})}),kU=k.forwardRef(function(t,n){const{children:a,container:o,className:s,render:l,...u}=t,{portalNode:f,portalSubtree:h}=JP({container:o,ref:n,componentProps:t,elementProps:u});return!h&&!f?null:T.jsxs(k.Fragment,{children:[h,f&&Oi.createPortal(a,f)]})}),_U=kU;function wU(){const e=k.useContext(_g);if(!e)throw new Error(Il(73));const{toasts:t,add:n,close:a,update:o,promise:s}=e;return k.useMemo(()=>({toasts:t,add:n,close:a,update:o,promise:s}),[t,n,a,o,s])}function xU(){const e=[];function t(n){e.forEach(a=>a(n))}return{" subscribe":function(a){return e.push(a),()=>{const o=e.indexOf(a);o!==-1&&e.splice(o,1)}},add(n){const a=n.id||RP("toast"),o={...n,id:a,transitionStatus:"starting"};return t({action:"add",options:o}),a},close(n){t({action:"close",options:{id:n}})},update(n,a){t({action:"update",options:{...a,id:n}})},promise(n,a){let o=n;return t({action:"promise",options:{...a,promise:n,setPromise(s){o=s}}}),o}}}const Sg=xU();function eB(e){return Sg.add(e)}function PU({children:e}){return T.jsxs(S8,{toastManager:Sg,children:[e,T.jsx(_U,{children:T.jsx(W8,{className:"fixed inset-x-0 top-6 z-[100] mx-auto flex w-full max-w-sm flex-col items-center gap-2 px-4 outline-none",children:T.jsx(SU,{})})})]})}function SU(){const{toasts:e}=wU();return e.map(t=>{const n=t.data?.onUndo;return T.jsxs(iU,{toast:t,className:wt("pointer-events-auto flex w-full items-center gap-3 rounded-xl border border-oai-gray-200 bg-oai-white px-4 py-3 shadow-xl transition-all duration-200 ease-out","data-[starting-style]:-translate-y-3 data-[starting-style]:opacity-0","data-[ending-style]:-translate-y-3 data-[ending-style]:opacity-0","dark:border-oai-gray-800 dark:bg-oai-gray-900"),children:[T.jsx(lU,{className:"min-w-0 flex-1 text-sm font-medium text-oai-black dark:text-white"}),n?T.jsx("button",{type:"button",onClick:()=>{n(),Sg.close(t.id)},className:"shrink-0 rounded-md px-2 py-1 text-xs font-semibold text-oai-gray-600 transition-colors hover:bg-oai-gray-100 hover:text-oai-black focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800 dark:hover:text-white",children:De("shared.action.undo")}):null,T.jsx(pU,{"aria-label":De("shared.action.dismiss"),className:"-mr-1 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-oai-gray-400 transition-colors hover:bg-oai-gray-100 hover:text-oai-black focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:hover:bg-oai-gray-800 dark:hover:text-white",children:T.jsx(jm,{className:"h-3.5 w-3.5","aria-hidden":!0})})]},t.id)})}const Cg=Object.freeze(["limits","leaderboard"]),CU=Object.freeze({limits:"/limits",leaderboard:"/leaderboard"}),TU=Object.freeze({limits:()=>Rn(()=>import("./LimitsPage-CS2NBEIP.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])),leaderboard:()=>Rn(()=>import("./LeaderboardPage-B-kigZ8J.js"),__vite__mapDeps([8,9,10,11,12,13]))}),eS="total",tS=0,n0=20,EU=Object.freeze([10,20,50,100]),AU="tokentracker:leaderboard:pageSize",RU=20,LU=Object.freeze(["dashboard-existing","silent-preload","page-load","manual-refresh"]);let a0=0,Qn;class DU{constructor(t={}){this.limits=null,this.leaderboard=new Map,this.leaderboardMaxEntries=NU(t.leaderboardMaxEntries)}read(t,n){return Ol(t),t==="limits"?!this.limits||this.limits.contextKey!==n?null:Pu(this.limits):n?Pu(this.leaderboard.get(n)):null}write(t,n={}){if(t.targetKey==="limits"){this.limits=t;return}this.leaderboard.has(t.contextKey)&&this.leaderboard.delete(t.contextKey),this.leaderboard.set(t.contextKey,t),this.evictLeaderboardEntries(n.activeContextKey||t.contextKey)}evictLeaderboardEntries(t=null){for(;this.leaderboard.size>this.leaderboardMaxEntries;){const n=Array.from(this.leaderboard.keys()).find(a=>a!==t)||this.leaderboard.keys().next().value;this.leaderboard.delete(n)}}snapshot(){return{limits:Pu(this.limits),leaderboard:{maxEntries:this.leaderboardMaxEntries,size:this.leaderboard.size,keys:Array.from(this.leaderboard.keys())}}}}class IU{constructor(t={}){a0+=1,this.sessionId=`dashboard-preload-${a0}`,this.createdAt=Date.now(),this.completedAt=null,this.startedAfterMainContentVisible=!1,this.cache=new DU(t),this.targets={limits:r0("limits"),leaderboard:r0("leaderboard")}}}function r0(e){return{key:e,route:CU[e],resourceStatus:"idle",stateStatus:"idle",error:null,resourcePromise:null,resourceModule:null,resourceRequestId:0,statePromise:null,stateRequestId:0,pendingStateContextKey:null}}function MU(e={}){return new IU(e)}function NU(e){const t=Number(e);return!Number.isInteger(t)||t<1?RU:t}Qn=MU();function Ol(e){if(!Cg.includes(e))throw new Error(`Unknown dashboard preload target: ${e}`)}function nS(e){return e?typeof e=="string"?e:e.message||String(e):null}function OU(e,t){return LU.includes(e)?e:t}function jU(e){const t=Number(e);return Number.isFinite(t)?t:Date.now()}function Pu(e){return e?{...e}:null}function i0(){const e=Cg.every(t=>{const n=Qn.targets[t];return n.resourceStatus==="fulfilled"||n.resourceStatus==="rejected"});Qn.completedAt=e?Date.now():null}function UU(){Qn.startedAfterMainContentVisible=!0}function Tg(e,t={}){Ol(e);const n=Object.entries(t).filter(([,a])=>a!==void 0).sort(([a],[o])=>a.localeCompare(o)).map(([a,o])=>`${a}=${o===null?"null":String(o)}`);return`${e}:${n.join("|")}`}function BU(e,t={}){Ol(e);const n=Qn.targets[e];if(n.resourceStatus==="fulfilled")return Promise.resolve(n.resourceModule);if(n.resourceStatus==="pending"&&n.resourcePromise)return n.resourcePromise;const a=t.loader||TU[e],o=n.resourceRequestId+1;n.resourceRequestId=o,n.resourceStatus="pending",n.error=null;const s=Promise.resolve().then(()=>a()).then(l=>n.resourceRequestId!==o||n.resourcePromise!==s?null:(n.resourceStatus="fulfilled",n.resourceModule=l,n.error=null,i0(),l)).catch(l=>(n.resourceRequestId!==o||n.resourcePromise!==s||(n.resourceStatus="rejected",n.error=nS(l),i0()),null));return n.resourcePromise=s,s}function zU(e={}){const t=e.loaders||{};return Promise.all(Cg.map(n=>BU(n,{loader:t[n]})))}function aS(e,t){Ol(e);const n=Qn.targets[e],a=t?.status||"fulfilled",o={targetKey:e,status:a,data:t?.data??null,error:nS(t?.error),source:OU(t?.source,"silent-preload"),generatedAt:jU(t?.generatedAt),updatedAt:Date.now(),contextKey:t?.contextKey||Tg(e,t?.context||{})};return n.stateStatus=a,a==="rejected"||a==="skipped"?n.error=o.error:a==="fulfilled"&&(n.error=null,Qn.cache.write(o,{activeContextKey:t?.activeContextKey})),Pu(o)}function rS(e,t){return Ol(e),Qn.cache.read(e,t)}function tB(e,t={}){return aS("limits",{data:e,source:t.source||"dashboard-existing",contextKey:t.contextKey||iS(t.context||{}),generatedAt:t.generatedAt,status:t.status||"fulfilled",error:t.error})}function iS(e={}){return Tg("limits",{state:"current",...e})}function nB(e=iS()){return rS("limits",e)}function Qp(e,t={}){return aS("leaderboard",{activeContextKey:t.activeContextKey,data:e,source:t.source||"silent-preload",contextKey:t.contextKey||Eg(t.context||{}),generatedAt:t.generatedAt,status:t.status||"fulfilled",error:t.error})}function FU(e){return rS("leaderboard",e)}function oS(){if(typeof window>"u")return n0;try{const e=window.localStorage.getItem(AU),t=Number(e);if(EU.includes(t))return t}catch{}return n0}function sS(e={}){const t=e.userId;return t!==void 0?t||null:e.cloudUser?.id||null}function lS(e={}){return typeof e.accessMode=="string"&&e.accessMode.trim()?e.accessMode.trim():e.mockEnabled?"mock":e.baseUrl?"cloud":"unavailable"}function Eg(e={}){const t=!!e.mockEnabled,n=e.baseUrl??"";return Tg("leaderboard",{accessMode:lS({...e,baseUrl:n,mockEnabled:t}),baseUrl:n,mockEnabled:t,offset:e.offset??tS,pageSize:e.pageSize??oS(),period:e.period||eS,userId:sS(e)})}function au(e,t){const n=Qn.targets.leaderboard;return n.stateRequestId+=1,n.statePromise=null,n.pendingStateContextKey=null,Qp(null,{contextKey:t,status:"skipped",error:e})}function VU(e={}){const t=Qn,n=!!e.mockEnabled,a=e.baseUrl??"",o=lS({...e,baseUrl:a,mockEnabled:n}),s=e.period||eS,l=e.pageSize??oS(),u=e.offset??tS,f=sS(e),h=Eg({accessMode:o,baseUrl:a,mockEnabled:n,offset:u,pageSize:l,period:s,userId:f});if(!n&&e.authLoading)return Promise.resolve(au("auth-loading",h));if(!n&&!e.signedIn&&o!=="public")return Promise.resolve(au("not-signed-in",h));if(!n&&!a)return Promise.resolve(au("missing-base-url",h));if(!n&&o==="unavailable")return Promise.resolve(au("access-unavailable",h));const m=t.targets.leaderboard,y=FU(h);if(y)return Promise.resolve(y);if(m.stateStatus==="pending"&&m.statePromise&&m.pendingStateContextKey===h)return m.statePromise;const v=m.stateRequestId+1;m.stateRequestId=v,m.stateStatus="pending",m.pendingStateContextKey=h,m.error=null;const _=Promise.resolve().then(()=>qL({userId:f,period:s,limit:l,offset:u})).then(x=>Qn!==t||m.stateRequestId!==v||m.statePromise!==_?null:(m.pendingStateContextKey=null,Qp(x,{contextKey:h}))).catch(x=>(Qn!==t||m.stateRequestId!==v||m.statePromise!==_||(m.pendingStateContextKey=null,Qp(null,{contextKey:h,status:"rejected",error:x})),null));return m.statePromise=_,_}const $U=typeof window<"u"?window.location.search:"",o0=new URLSearchParams($U),ru=o0.get("insforge_code")||o0.get("code")||null,HU=typeof window<"u"&&!!window.webkit?.messageHandlers?.nativeOAuth;function WU(){Tl();const{loading:e,signedIn:t}=$o(),n=_l(),[a,o]=k.useState("processing"),[s,l]=k.useState(null),u=k.useRef(!1);k.useEffect(()=>{if(!(!ru||u.current)){if(u.current=!0,HU){l(!1);return}(async()=>{try{const m=await(await fetch("/api/auth-bridge/verifier")).json();l(!!m?.native)}catch{l(!1)}})()}},[]),k.useEffect(()=>{if(s!==!0||!ru)return;o("redirecting");const h=setTimeout(()=>{window.location.href=`tokentracker://auth/callback?insforge_code=${encodeURIComponent(ru)}`},200);return()=>clearTimeout(h)},[s]),k.useEffect(()=>{if(s!==!1||e)return;if(t){n("/dashboard",{replace:!0});return}const h=setTimeout(()=>{t||o("failed")},12e3);return()=>clearTimeout(h)},[s,e,t,n]),k.useEffect(()=>{if(!ru&&s===null){const h=setTimeout(()=>o("failed"),3e3);return()=>clearTimeout(h)}},[s]);const f=()=>{n("/dashboard",{replace:!0})};return a==="processing"&&s!==!0&&(s===null||s===!1&&e)?T.jsx("div",{className:"min-h-screen bg-oai-gray-950"}):T.jsx("div",{className:"min-h-screen bg-oai-gray-950 text-white font-oai antialiased dark flex items-center justify-center",children:T.jsxs("div",{className:"text-center space-y-4 max-w-sm px-4",children:[a==="processing"&&T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"w-8 h-8 border-2 border-oai-gray-600 border-t-white rounded-full animate-spin mx-auto"}),T.jsx("p",{className:"text-oai-gray-400 text-sm",children:De("auth.callback.processing")})]}),a==="redirecting"&&T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-green-500/15 flex items-center justify-center",children:T.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:T.jsx("path",{d:"M20 6 9 17l-5-5"})})}),T.jsx("p",{className:"text-white text-sm font-medium",children:De("auth.callback.success")}),T.jsx("p",{className:"text-oai-gray-500 text-xs",children:De("auth.callback.redirecting")})]}),a==="failed"&&T.jsxs("div",{className:"space-y-3",children:[T.jsx("p",{className:"text-oai-gray-300 text-sm",children:De("auth.callback.failed")}),T.jsx("button",{type:"button",onClick:f,className:"px-4 py-2 rounded-lg bg-oai-gray-800 text-sm text-white hover:bg-oai-gray-700 transition-colors",children:De("auth.callback.close")})]})]})})}const GU=k.lazy(()=>Rn(()=>import("./DashboardPage-C7Ec-LrI.js"),__vite__mapDeps([14,1,12,15,16,17,11,3,9,10,18,19,4])).then(e=>({default:e.DashboardPage}))),KU=k.lazy(()=>Rn(()=>import("./IpCheckPage-Ct9pgqbB.js"),[])),qU=k.lazy(()=>Rn(()=>import("./LandingPage-Bb4n4XoT.js"),__vite__mapDeps([20,21,18])).then(e=>({default:e.LandingPage}))),YU=k.lazy(()=>Rn(()=>import("./LeaderboardPage-B-kigZ8J.js"),__vite__mapDeps([8,9,10,11,12,13])).then(e=>({default:e.LeaderboardPage}))),ZU=k.lazy(()=>Rn(()=>import("./LeaderboardProfilePage-BspW68Xd.js"),__vite__mapDeps([22,12,21,23,13,15,16,6,11,17])).then(e=>({default:e.LeaderboardProfilePage}))),XU=k.lazy(()=>Rn(()=>import("./LimitsPage-CS2NBEIP.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])).then(e=>({default:e.LimitsPage}))),QU=k.lazy(()=>Rn(()=>import("./LoginPage-8S9O3Gsb.js"),[]).then(e=>({default:e.LoginPage}))),JU=k.lazy(()=>Rn(()=>import("./DevicePage-DFp21WlU.js"),[])),e9=k.lazy(()=>Rn(()=>import("./WrappedPage-DWVJ6uf1.js"),[])),t9=k.lazy(()=>Rn(()=>import("./SettingsPage-BDRMT04n.js"),__vite__mapDeps([24,2,25,3,11,12,9,10,16,7])).then(e=>({default:e.SettingsPage}))),n9=k.lazy(()=>Rn(()=>import("./SkillsPage-DPHemuRK.js"),__vite__mapDeps([26,5,6,7,3,17,11,16,12,19,10])).then(e=>({default:e.SkillsPage}))),a9=k.lazy(()=>Rn(()=>import("./WidgetsPage-BOX3tPr8.js"),__vite__mapDeps([27,9,10,11,25,3,4,6,7])).then(e=>({default:e.WidgetsPage})));function r9(){const{resolvedLocale:e}=Tl(),t=ta(),n=$o();aj();const a=k.useRef(!1),o=k.useRef(!1),s=k.useRef(new Set),l=_n(),u=k.useMemo(()=>typeof window>"u"?!1:Y6(window.location.search),[]),f=t?.pathname||"/",h=new URL(window.location.href),m=h.pathname.replace(/\/+$/,"")||"/",v=m.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,_=h.searchParams.get("token")||null,x=v||_,S=m==="/share"||m==="/share.html"||m.startsWith("/share/"),C=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),R=f.replace(/\/+$/,"")||"/",M=R==="/"||R==="/dashboard",E=R==="/leaderboard",A=R.match(/^\/u\/([^/]+)$/i),U=A?A[1]:null,F=!!(n.enabled&&n.signedIn),$=C||F,P=!1,Z=K6(),X=!$&&!l&&!C,fe=l?"mock":n.loading?"unavailable":F?"cloud":$?"local":"unavailable",he=k.useCallback(()=>{if(!a.current||!l&&n.loading||!l&&!$)return;const me={accessMode:fe,baseUrl:q6(),mockEnabled:l,signedIn:$,authLoading:!!n.loading,userId:F&&n.user?.id||null},ge=Eg(me);s.current.has(ge)||(s.current.add(ge),VU(me))},[F,n.loading,n.user?.id,fe,l,$]),Q=k.useCallback(()=>{M&&(a.current||(a.current=!0,UU()),o.current||(o.current=!0,zU()),he())},[M,he]);k.useEffect(()=>{he()},[he]);const ne=k.useMemo(()=>!n.enabled||!F?null:{getAccessToken:()=>n.getAccessToken(),name:n.displayName||"",userId:n.user?.id||null},[F,n]);let J=C||l||u?"dashboard":"landing";R==="/landing"&&(J="landing"),R==="/dashboard"&&(J="dashboard"),E&&(J="dashboard"),U&&(J="dashboard");const ee=R==="/limits",se=R==="/settings",z=R==="/skills",q=R==="/widgets",V=R==="/ip-check";(ee||se||z||q||V)&&(J="dashboard");let D=GU;U?D=ZU:R==="/leaderboard"?D=YU:ee?D=XU:se?D=t9:z?D=n9:q?D=a9:V&&(D=KU);const W=!S&&!X&&(R==="/dashboard"||R==="/"||E||ee||se||z||q||V);let pe=null;if(R==="/auth/callback"||R==="/auth/native-callback")pe=T.jsx(WU,{});else if(R==="/login")pe=T.jsx(QU,{});else if(R==="/device")pe=T.jsx(JU,{});else if(R==="/wrapped")pe=T.jsx(e9,{});else if(J==="landing")pe=T.jsx(qU,{signInUrl:"/login",signUpUrl:"/login"});else{const me=T.jsx(D,{baseUrl:Z,auth:ne,signedIn:$,sessionSoftExpired:P,signOut:()=>n.enabled?n.signOut():Promise.resolve(),publicMode:S,publicToken:x,userId:U,signInUrl:"/login",signUpUrl:"/login",onMainContentVisible:Q},e);W?pe=T.jsx(kj,{children:me}):pe=me}return T.jsx(GI,{children:T.jsx(YI,{children:T.jsx(PU,{children:T.jsxs(ZI,{children:[T.jsx(k.Suspense,{fallback:null,children:pe}),W?T.jsx($j,{}):null,T.jsx(W6,{}),T.jsx(ZD,{}),T.jsx(sI,{})]})})})})}const i9=dE([{path:"*",element:T.jsx(r9,{})}]);JC.createRoot(document.getElementById("root")).render(T.jsx(rl.StrictMode,{children:T.jsx(AD,{children:T.jsx(OD,{children:T.jsx(JL,{children:T.jsx(xE,{router:i9})})})})}));export{O9 as $,De as A,fu as B,T9 as C,C9 as D,cl as E,WI as F,Y9 as G,B9 as H,y9 as I,g9 as J,G1 as K,sd as L,rj as M,wt as N,yx as O,zj as P,$o as Q,rl as R,Im as S,H6 as T,x9 as U,qL as V,Tl as W,jm as X,Y6 as Y,Fr as Z,Rn as _,Nl as a,KP as a$,E9 as a0,pL as a1,v9 as a2,b9 as a3,tB as a4,j9 as a5,S9 as a6,w9 as a7,H_ as a8,X9 as a9,$9 as aA,o9 as aB,eL as aC,Um as aD,nL as aE,dk as aF,L9 as aG,px as aH,fx as aI,AI as aJ,P9 as aK,jo as aL,Uu as aM,nx as aN,ax as aO,rx as aP,ix as aQ,MI as aR,ma as aS,Zs as aT,q9 as aU,G9 as aV,Il as aW,An as aX,Ml as aY,N7 as aZ,X_ as a_,GM as aa,gt as ab,nn as ac,Ku as ad,Bm as ae,Bo as af,dg as ag,vx as ah,qr as ai,Mk as aj,Oi as ak,ta as al,_l as am,q6 as an,aL as ao,Eg as ap,FU as aq,Qp as ar,f9 as as,Q9 as at,p9 as au,D9 as av,$I as aw,ij as ax,nB as ay,UI as az,gU as b,Yr as b$,Vr as b0,M7 as b1,$P as b2,V7 as b3,eU as b4,Y8 as b5,Fj as b6,t7 as b7,J9 as b8,u7 as b9,Dl as bA,LP as bB,X7 as bC,B7 as bD,nl as bE,I7 as bF,Gf as bG,D7 as bH,w8 as bI,J7 as bJ,F7 as bK,J8 as bL,G8 as bM,wd as bN,ND as bO,Rm as bP,K9 as bQ,pd as bR,W9 as bS,P7 as bT,S7 as bU,w7 as bV,x7 as bW,X8 as bX,s8 as bY,W_ as bZ,Hj as b_,d7 as ba,h7 as bb,OI as bc,e7 as bd,n7 as be,eB as bf,a7 as bg,s7 as bh,r7 as bi,i7 as bj,o7 as bk,c7 as bl,l7 as bm,g7 as bn,yU as bo,o8 as bp,H7 as bq,xd as br,Hp as bs,SP as bt,Ei as bu,ml as bv,$7 as bw,q7 as bx,j7 as by,mU as bz,an as c,Zj as c0,EP as c1,Yj as c2,Wj as c3,$p as c4,TP as c5,f7 as c6,qj as c7,p7 as c8,yg as c9,C7 as cA,Jp as cB,GP as cC,Pg as cD,q_ as cE,k7 as cF,_7 as cG,xg as cH,v7 as cI,M9 as cJ,N9 as cK,I9 as cL,ir as cM,CP as ca,m7 as cb,XP as cc,A7 as cd,E7 as ce,gl as cf,Y7 as cg,O7 as ch,Ao as ci,W7 as cj,Z7 as ck,z7 as cl,U7 as cm,y7 as cn,Q7 as co,G7 as cp,b7 as cq,n8 as cr,vU as cs,bg as ct,kg as cu,Q8 as cv,x8 as cw,L7 as cx,R7 as cy,T7 as cz,K7 as d,qO as e,m9 as f,Kw as g,lL as h,_n as i,T as j,H9 as k,xL as l,tl as m,PL as n,z9 as o,_9 as p,R9 as q,k as r,F9 as s,V9 as t,hU as u,k9 as v,xt as w,A9 as x,U9 as y,Gw as z};
969
+ `),()=>{u.current?.removeAttribute("data-motion-pop-id"),U.contains(A)&&U.removeChild(A)}},[t]),T.jsx(jN,{isPresent:t,childRef:u,sizeRef:f,pop:s,children:s===!1?e:k.cloneElement(e,{ref:y})})}const BN=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:o,presenceAffectsLayout:s,mode:l,anchorX:u,anchorY:f,root:h})=>{const m=Bm(zN),y=k.useId();let v=!0,_=k.useMemo(()=>(v=!1,{id:y,initial:t,isPresent:n,custom:o,onExitComplete:x=>{m.set(x,!0);for(const S of m.values())if(!S)return;a&&a()},register:x=>(m.set(x,!1),()=>m.delete(x))}),[n,m,a]);return s&&v&&(_={..._}),k.useMemo(()=>{m.forEach((x,S)=>m.set(S,!1))},[n]),k.useEffect(()=>{!n&&!m.size&&a&&a()},[n]),e=T.jsx(UN,{pop:l==="popLayout",isPresent:n,anchorX:u,anchorY:f,root:h,children:e}),T.jsx(gd.Provider,{value:_,children:e})};function zN(){return new Map}function W1(e=!0){const t=k.useContext(gd);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:o}=t,s=k.useId();k.useEffect(()=>{if(e)return o(s)},[e]);const l=k.useCallback(()=>e&&a&&a(s),[s,a,e]);return!n&&a?[!1,l]:[!0]}const Yc=e=>e.key||"";function w_(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const G1=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:s="sync",propagate:l=!1,anchorX:u="left",anchorY:f="top",root:h})=>{const[m,y]=W1(l),v=k.useMemo(()=>w_(e),[e]),_=l&&!m?[]:v.map(Yc),x=k.useRef(!0),S=k.useRef(v),C=Bm(()=>new Map),R=k.useRef(new Set),[M,E]=k.useState(v),[A,U]=k.useState(v);vx(()=>{x.current=!1,S.current=v;for(let P=0;P<A.length;P++){const Z=Yc(A[P]);_.includes(Z)?(C.delete(Z),R.current.delete(Z)):C.get(Z)!==!0&&C.set(Z,!1)}},[A,_.length,_.join("-")]);const F=[];if(v!==M){let P=[...v];for(let Z=0;Z<A.length;Z++){const X=A[Z],fe=Yc(X);_.includes(fe)||(P.splice(Z,0,X),F.push(X))}return s==="wait"&&F.length&&(P=F),U(w_(P)),E(v),null}const{forceRender:$}=k.useContext(Um);return T.jsx(T.Fragment,{children:A.map(P=>{const Z=Yc(P),X=l&&!m?!1:v===A||_.includes(Z),fe=()=>{if(R.current.has(Z))return;if(C.has(Z))R.current.add(Z),C.set(Z,!0);else return;let he=!0;C.forEach(Q=>{Q||(he=!1)}),he&&($?.(),U(S.current),l&&y?.(),a&&a())};return T.jsx(BN,{isPresent:X,initial:!x.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:h,onExitComplete:X?void 0:fe,anchorX:u,anchorY:f,children:P},Z)})})},K1=k.createContext({strict:!1}),x_={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 P_=!1;function FN(){if(P_)return;const e={};for(const t in x_)e[t]={isEnabled:n=>x_[t].some(a=>!!n[a])};_1(e),P_=!0}function q1(){return FN(),S5()}function VN(e){const t=q1();for(const n in e)t[n]={...t[n],...e[n]};_1(t)}const $N=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 Qu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||$N.has(e)}let Y1=e=>!Qu(e);function HN(e){typeof e=="function"&&(Y1=t=>t.startsWith("on")?!Qu(t):e(t))}try{HN(require("@emotion/is-prop-valid").default)}catch{}function WN(e,t,n){const a={};for(const o in e)o==="values"&&typeof e.values=="object"||nn(e[o])||(Y1(o)||n===!0&&Qu(o)||!t&&!Qu(o)||e.draggable&&o.startsWith("onDrag"))&&(a[o]=e[o]);return a}const kd=k.createContext({});function GN(e,t){if(bd(e)){const{initial:n,animate:a}=e;return{initial:n===!1||fl(n)?n:void 0,animate:fl(a)?a:void 0}}return e.inherit!==!1?t:{}}function KN(e){const{initial:t,animate:n}=GN(e,k.useContext(kd));return k.useMemo(()=>({initial:t,animate:n}),[S_(t),S_(n)])}function S_(e){return Array.isArray(e)?e.join(" "):e}const hg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Z1(e,t,n){for(const a in t)!nn(t[a])&&!E1(a,n)&&(e[a]=t[a])}function qN({transformTemplate:e},t){return k.useMemo(()=>{const n=hg();return cg(n,t,e),Object.assign({},n.vars,n.style)},[t])}function YN(e,t){const n=e.style||{},a={};return Z1(a,n,e),Object.assign(a,qN(e,t)),a}function ZN(e,t){const n={},a=YN(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=a,n}const X1=()=>({...hg(),attrs:{}});function XN(e,t,n,a){const o=k.useMemo(()=>{const s=X1();return A1(s,t,L1(a),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Z1(s,e.style,e),o.style={...s,...o.style}}return o}const QN=["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 fg(e){return typeof e!="string"||e.includes("-")?!1:!!(QN.indexOf(e)>-1||/[A-Z]/u.test(e))}function JN(e,t,n,{latestValues:a},o,s=!1,l){const f=(l??fg(e)?XN:ZN)(t,a,o,e),h=WN(t,typeof e=="string",s),m=e!==k.Fragment?{...h,...f,ref:n}:{},{children:y}=t,v=k.useMemo(()=>nn(y)?y.get():y,[y]);return k.createElement(e,{...m,children:v})}function eO({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,o){return{latestValues:tO(n,a,o,e),renderState:t()}}function tO(e,t,n,a){const o={},s=a(e,{});for(const v in s)o[v]=wu(s[v]);let{initial:l,animate:u}=e;const f=bd(e),h=b1(e);t&&h&&!f&&e.inherit!==!1&&(l===void 0&&(l=t.initial),u===void 0&&(u=t.animate));let m=n?n.initial===!1:!1;m=m||l===!1;const y=m?u:l;if(y&&typeof y!="boolean"&&!vd(y)){const v=Array.isArray(y)?y:[y];for(let _=0;_<v.length;_++){const x=eg(e,v[_]);if(x){const{transitionEnd:S,transition:C,...R}=x;for(const M in R){let E=R[M];if(Array.isArray(E)){const A=m?E.length-1:0;E=E[A]}E!==null&&(o[M]=E)}for(const M in S)o[M]=S[M]}}}return o}const Q1=e=>(t,n)=>{const a=k.useContext(kd),o=k.useContext(gd),s=()=>eO(e,t,a,o);return n?s():Bm(s)},nO=Q1({scrapeMotionValuesFromProps:ug,createRenderState:hg}),aO=Q1({scrapeMotionValuesFromProps:D1,createRenderState:X1}),rO=Symbol.for("motionComponentSymbol");function iO(e,t,n){const a=k.useRef(n);k.useInsertionEffect(()=>{a.current=n});const o=k.useRef(null);return k.useCallback(s=>{s&&e.onMount?.(s);const l=a.current;if(typeof l=="function")if(s){const u=l(s);typeof u=="function"&&(o.current=u)}else o.current?(o.current(),o.current=null):l(s);else l&&(l.current=s);t&&(s?t.mount(s):t.unmount())},[t])}const J1=k.createContext({});function xo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function oO(e,t,n,a,o,s){const{visualElement:l}=k.useContext(kd),u=k.useContext(K1),f=k.useContext(gd),h=k.useContext(dg),m=h.reducedMotion,y=h.skipAnimations,v=k.useRef(null),_=k.useRef(!1);a=a||u.renderer,!v.current&&a&&(v.current=a(e,{visualState:t,parent:l,props:n,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:m,skipAnimations:y,isSVG:s}),_.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const x=v.current,S=k.useContext(J1);x&&!x.projection&&o&&(x.type==="html"||x.type==="svg")&&sO(v.current,n,o,S);const C=k.useRef(!1);k.useInsertionEffect(()=>{x&&C.current&&x.update(n,f)});const R=n[o1],M=k.useRef(!!R&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(R)&&window.MotionHasOptimisedAnimation?.(R));return vx(()=>{_.current=!0,x&&(C.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),M.current&&x.animationState&&x.animationState.animateChanges())}),k.useEffect(()=>{x&&(!M.current&&x.animationState&&x.animationState.animateChanges(),M.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(R)}),M.current=!1),x.enteringChildren=void 0)}),x}function sO(e,t,n,a){const{layoutId:o,layout:s,drag:l,dragConstraints:u,layoutScroll:f,layoutRoot:h,layoutAnchor:m,layoutCrossfade:y}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:eP(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!l||u&&xo(u),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:a,crossfade:y,layoutScroll:f,layoutRoot:h,layoutAnchor:m})}function eP(e){if(e)return e.options.allowProjection!==!1?e.projection:eP(e.parent)}function jf(e,{forwardMotionProps:t=!1,type:n}={},a,o){a&&VN(a);const s=n?n==="svg":fg(e),l=s?aO:nO;function u(h,m){let y;const v={...k.useContext(dg),...h,layoutId:lO(h)},{isStatic:_}=v,x=KN(h),S=l(h,_);if(!_&&typeof window<"u"){cO();const C=uO(v);y=C.MeasureLayout,x.visualElement=oO(e,S,v,o,C.ProjectionNode,s)}return T.jsxs(kd.Provider,{value:x,children:[y&&x.visualElement?T.jsx(y,{visualElement:x.visualElement,...v}):null,JN(e,h,iO(S,x.visualElement,m),S,_,t,s)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const f=k.forwardRef(u);return f[rO]=e,f}function lO({layoutId:e}){const t=k.useContext(Um).id;return t&&e!==void 0?t+"-"+e:e}function cO(e,t){k.useContext(K1).strict}function uO(e){const t=q1(),{drag:n,layout:a}=t;if(!n&&!a)return{};const o={...n,...a};return{MeasureLayout:n?.isEnabled(e)||a?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function dO(e,t){if(typeof Proxy>"u")return jf;const n=new Map,a=(s,l)=>jf(s,l,e,t),o=(s,l)=>a(s,l);return new Proxy(o,{get:(s,l)=>l==="create"?a:(n.has(l)||n.set(l,jf(l,void 0,e,t)),n.get(l))})}const hO=(e,t)=>t.isSVG??fg(e)?new V5(t):new O5(t,{allowProjection:e!==k.Fragment});class fO extends Xr{constructor(t){super(t),t.animationState||(t.animationState=K5(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();vd(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let pO=0;class mO extends Xr{constructor(){super(...arguments),this.id=pO++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===a)return;if(t&&a===!1){if(this.isExitComplete){const{initial:s,custom:l}=this.node.getProps();if(typeof s=="string"){const u=Ti(this.node,s,l);if(u){const{transition:f,transitionEnd:h,...m}=u;for(const y in m)this.node.getValue(y)?.jump(m[y])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const gO={animation:{Feature:fO},exit:{Feature:mO}};function Ll(e){return{point:{x:e.pageX,y:e.pageY}}}const yO=e=>t=>rg(t)&&e(t,Ll(t));function el(e,t,n,a){return pl(e,t,yO(n),a)}const tP=({current:e})=>e?e.ownerDocument.defaultView:null,C_=(e,t)=>Math.abs(e-t);function vO(e,t){const n=C_(e.x,t.x),a=C_(e.y,t.y);return Math.sqrt(n**2+a**2)}const T_=new Set(["auto","scroll"]);class nP{constructor(t,n,{transformPagePoint:a,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:l=3,element:u}={}){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=_=>{this.handleScroll(_.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Zc(this.lastRawMoveEventInfo,this.transformPagePoint));const _=Uf(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,S=vO(_.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!S)return;const{point:C}=_,{timestamp:R}=tn;this.history.push({...C,timestamp:R});const{onStart:M,onMove:E}=this.handlers;x||(M&&M(this.lastMoveEvent,_),this.startEvent=this.lastMoveEvent),E&&E(this.lastMoveEvent,_)},this.handlePointerMove=(_,x)=>{this.lastMoveEvent=_,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=Zc(x,this.transformPagePoint),gt.update(this.updatePoint,!0)},this.handlePointerUp=(_,x)=>{this.end();const{onEnd:S,onSessionEnd:C,resumeAnimation:R}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&R&&R(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const M=Uf(_.type==="pointercancel"?this.lastMoveEventInfo:Zc(x,this.transformPagePoint),this.history);this.startEvent&&S&&S(_,M),C&&C(_,M)},!rg(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=l,this.contextWindow=o||window;const f=Ll(t),h=Zc(f,this.transformPagePoint),{point:m}=h,{timestamp:y}=tn;this.history=[{...m,timestamp:y}];const{onSessionStart:v}=n;v&&v(t,Uf(h,this.history)),this.removeListeners=El(el(this.contextWindow,"pointermove",this.handlePointerMove),el(this.contextWindow,"pointerup",this.handlePointerUp),el(this.contextWindow,"pointercancel",this.handlePointerUp)),u&&this.startScrollTracking(u)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(T_.has(a.overflowX)||T_.has(a.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(t){const n=this.scrollPositions.get(t);if(!n)return;const a=t===window,o=a?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:o.x-n.x,y:o.y-n.y};s.x===0&&s.y===0||(a?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(t,o),gt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),qr(this.updatePoint)}}function Zc(e,t){return t?{point:t(e.point)}:e}function E_(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Uf({point:e},t){return{point:e,delta:E_(e,aP(t)),offset:E_(e,bO(t)),velocity:kO(t,.1)}}function bO(e){return e[0]}function aP(e){return e[e.length-1]}function kO(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const o=aP(e);for(;n>=0&&(a=e[n],!(o.timestamp-a.timestamp>zn(t)));)n--;if(!a)return{x:0,y:0};a===e[0]&&e.length>2&&o.timestamp-a.timestamp>zn(t)*2&&(a=e[1]);const s=Zn(o.timestamp-a.timestamp);if(s===0)return{x:0,y:0};const l={x:(o.x-a.x)/s,y:(o.y-a.y)/s};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function _O(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?Pt(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?Pt(n,e,a.max):Math.min(e,n)),e}function A_(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function wO(e,{top:t,left:n,bottom:a,right:o}){return{x:A_(e.x,n,o),y:A_(e.y,t,a)}}function R_(e,t){let n=t.min-e.min,a=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,a]=[a,n]),{min:n,max:a}}function xO(e,t){return{x:R_(e.x,t.x),y:R_(e.y,t.y)}}function PO(e,t){let n=.5;const a=vn(e),o=vn(t);return o>a?n=dl(t.min,t.max-a,e.min):a>o&&(n=dl(e.min,e.max-o,t.min)),ja(0,1,n)}function SO(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Up=.35;function CO(e=Up){return e===!1?e=0:e===!0&&(e=Up),{x:L_(e,"left","right"),y:L_(e,"top","bottom")}}function L_(e,t,n){return{min:D_(e,t),max:D_(e,n)}}function D_(e,t){return typeof e=="number"?e:e[t]||0}const TO=new WeakMap;class EO{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ht(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=y=>{n&&this.snapToCursor(Ll(y).point),this.stopAnimation()},l=(y,v)=>{const{drag:_,dragPropagation:x,onDragStart:S}=this.getProps();if(_&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=n5(_),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ea(R=>{let M=this.getAxisMotionValue(R).get()||0;if(Da.test(M)){const{projection:E}=this.visualElement;if(E&&E.layout){const A=E.layout.layoutBox[R];A&&(M=vn(A)*(parseFloat(M)/100))}}this.originPoint[R]=M}),S&&gt.update(()=>S(y,v),!1,!0),Rp(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},u=(y,v)=>{this.latestPointerEvent=y,this.latestPanInfo=v;const{dragPropagation:_,dragDirectionLock:x,onDirectionLock:S,onDrag:C}=this.getProps();if(!_&&!this.openDragLock)return;const{offset:R}=v;if(x&&this.currentDirection===null){this.currentDirection=RO(R),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",v.point,R),this.updateAxis("y",v.point,R),this.visualElement.render(),C&&gt.update(()=>C(y,v),!1,!0)},f=(y,v)=>{this.latestPointerEvent=y,this.latestPanInfo=v,this.stop(y,v),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>{const{dragSnapToOrigin:y}=this.getProps();(y||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new nP(t,{onSessionStart:s,onStart:l,onMove:u,onSessionEnd:f,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:a,contextWindow:tP(this.visualElement),element:this.visualElement.current})}stop(t,n){const a=t||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!a)return;const{velocity:l}=o;this.startAnimation(l);const{onDragEnd:u}=this.getProps();u&&gt.postRender(()=>u(a,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,a){const{drag:o}=this.getProps();if(!a||!Xc(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let l=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(l=_O(l,this.constraints[t],this.elastic[t])),s.set(l)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&xo(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=wO(a.layoutBox,t):this.constraints=!1,this.elastic=CO(n),o!==this.constraints&&!xo(t)&&a&&this.constraints&&!this.hasMutatedConstraints&&Ea(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=SO(a.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!xo(t))return!1;const a=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=R5(a,o.root,this.visualElement.getTransformPagePoint());let l=xO(o.layout.layoutBox,s);if(n){const u=n(T5(l));this.hasMutatedConstraints=!!u,u&&(l=x1(u))}return l}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:o,dragTransition:s,dragSnapToOrigin:l,onDragTransitionEnd:u}=this.getProps(),f=this.constraints||{},h=Ea(m=>{if(!Xc(m,n,this.currentDirection))return;let y=f&&f[m]||{};(l===!0||l===m)&&(y={min:0,max:0});const v=o?200:1e6,_=o?40:1e7,x={type:"inertia",velocity:a?t[m]:0,bounceStiffness:v,bounceDamping:_,timeConstant:750,restDelta:1,restSpeed:10,...s,...y};return this.startAxisValueAnimation(m,x)});return Promise.all(h).then(u)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return Rp(this.visualElement,t),a.start(Jm(t,a,0,n,this.visualElement,!1))}stopAnimation(){Ea(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps(),o=a[n];return o||this.visualElement.getValue(t,(a.initial?a.initial[t]:void 0)||0)}snapToCursor(t){Ea(n=>{const{drag:a}=this.getProps();if(!Xc(n,a,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:l,max:u}=o.layout.layoutBox[n],f=s.get()||0;s.set(t[n]-Pt(l,u,.5)+f)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!xo(n)||!a||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Ea(l=>{const u=this.getAxisMotionValue(l);if(u&&this.constraints!==!1){const f=u.get();o[l]=PO({min:f,max:f},this.constraints[l])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ea(l=>{if(!Xc(l,t,null))return;const u=this.getAxisMotionValue(l),{min:f,max:h}=this.constraints[l];u.set(Pt(f,h,o[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;TO.set(this.visualElement,this);const t=this.visualElement.current,n=el(t,"pointerdown",h=>{const{drag:m,dragListener:y=!0}=this.getProps(),v=h.target,_=v!==t&&l5(v);m&&y&&!_&&this.start(h)});let a;const o=()=>{const{dragConstraints:h}=this.getProps();xo(h)&&h.current&&(this.constraints=this.resolveRefConstraints(),a||(a=AO(t,h.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,l=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),gt.read(o);const u=pl(window,"resize",()=>this.scalePositionWithinConstraints()),f=s.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(Ea(y=>{const v=this.getAxisMotionValue(y);v&&(this.originPoint[y]+=h[y].translate,v.set(v.get()+h[y].translate))}),this.visualElement.render())}));return()=>{u(),n(),l(),f&&f(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:l=Up,dragMomentum:u=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:o,dragConstraints:s,dragElastic:l,dragMomentum:u}}}function I_(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function AO(e,t,n){const a=zk(e,I_(n)),o=zk(t,I_(n));return()=>{a(),o()}}function Xc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function RO(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class LO extends Xr{constructor(t){super(t),this.removeGroupControls=Xn,this.removeListeners=Xn,this.controls=new EO(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Xn}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Bf=e=>(t,n)=>{e&&gt.update(()=>e(t,n),!1,!0)};class DO extends Xr{constructor(){super(...arguments),this.removePointerDownListener=Xn}onPointerDown(t){this.session=new nP(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tP(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:o}=this.node.getProps();return{onSessionStart:Bf(t),onStart:Bf(n),onMove:Bf(a),onEnd:(s,l)=>{delete this.session,o&&gt.postRender(()=>o(s,l))}}}mount(){this.removePointerDownListener=el(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let zf=!1;class IO extends k.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a,layoutId:o}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),a&&a.register&&o&&a.register(s),zf&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),xu.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:o,isPresent:s}=this.props,{projection:l}=a;return l&&(l.isPresent=s,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),zf=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?l.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?l.promote():l.relegate()||gt.postRender(()=>{const u=l.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:a}=t;a&&(a.options.layoutAnchor=n,a.root.didUpdate(),ag.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:o}=t;zf=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),a&&a.deregister&&a.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function rP(e){const[t,n]=W1(),a=k.useContext(Um);return T.jsx(IO,{...e,layoutGroup:a,switchLayoutGroup:k.useContext(J1),isPresent:t,safeToRemove:n})}const MO={pan:{Feature:DO},drag:{Feature:LO,ProjectionNode:H1,MeasureLayout:rP}};function M_(e,t,n){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=a[o];s&&gt.postRender(()=>s(t,Ll(t)))}class NO extends Xr{mount(){const{current:t}=this.node;t&&(this.unmount=r5(t,(n,a)=>(M_(this.node,a,"Start"),o=>M_(this.node,o,"End"))))}unmount(){}}class OO extends Xr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=El(pl(this.node.current,"focus",()=>this.onFocus()),pl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function N_(e,t,n){const{props:a}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&a.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=a[o];s&&gt.postRender(()=>s(t,Ll(t)))}class jO extends Xr{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:a}=this.node.props;this.unmount=u5(t,(o,s)=>(N_(this.node,s,"Start"),(l,{success:u})=>N_(this.node,l,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:a?.tap===!1})}unmount(){}}const Bp=new WeakMap,Ff=new WeakMap,UO=e=>{const t=Bp.get(e.target);t&&t(e)},BO=e=>{e.forEach(UO)};function zO({root:e,...t}){const n=e||document;Ff.has(n)||Ff.set(n,{});const a=Ff.get(n),o=JSON.stringify(t);return a[o]||(a[o]=new IntersectionObserver(BO,{root:e,...t})),a[o]}function FO(e,t,n){const a=zO(t);return Bp.set(e,n),a.observe(e),()=>{Bp.delete(e),a.unobserve(e)}}const VO={some:0,all:1};class $O extends Xr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:n,margin:a,amount:o="some",once:s}=t,l={root:n?n.current:void 0,rootMargin:a,threshold:typeof o=="number"?o:VO[o]},u=f=>{const{isIntersecting:h}=f;if(this.isInView===h||(this.isInView=h,s&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:m,onViewportLeave:y}=this.node.getProps(),v=h?m:y;v&&v(f)};this.stopObserver=FO(this.node.current,l,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(HO(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function HO({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const WO={inView:{Feature:$O},tap:{Feature:jO},focus:{Feature:OO},hover:{Feature:NO}},GO={layout:{ProjectionNode:H1,MeasureLayout:rP}},KO={...gO,...WO,...MO,...GO},tl=dO(KO,hO);function qO(){!lg.current&&k1();const[e]=k.useState(qu.current);return e}function iP(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=iP(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function YO(){for(var e,t,n=0,a="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=iP(e))&&(a&&(a+=" "),a+=t);return a}const ZO=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},XO=(e,t)=>({classGroupId:e,validator:t}),oP=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ju="-",O_=[],QO="arbitrary..",JO=e=>{const t=t6(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return e6(l);const u=l.split(Ju),f=u[0]===""&&u.length>1?1:0;return sP(u,f,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const f=a[l],h=n[l];return f?h?ZO(h,f):f:h||O_}return n[l]||O_}}},sP=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const h=sP(e,t+1,s);if(h)return h}const l=n.validators;if(l===null)return;const u=t===0?e.join(Ju):e.slice(t).join(Ju),f=l.length;for(let h=0;h<f;h++){const m=l[h];if(m.validator(u))return m.classGroupId}},e6=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?QO+a:void 0})(),t6=e=>{const{theme:t,classGroups:n}=e;return n6(n,t)},n6=(e,t)=>{const n=oP();for(const a in e){const o=e[a];pg(o,n,a,t)}return n},pg=(e,t,n,a)=>{const o=e.length;for(let s=0;s<o;s++){const l=e[s];a6(l,t,n,a)}},a6=(e,t,n,a)=>{if(typeof e=="string"){r6(e,t,n);return}if(typeof e=="function"){i6(e,t,n,a);return}o6(e,t,n,a)},r6=(e,t,n)=>{const a=e===""?t:lP(t,e);a.classGroupId=n},i6=(e,t,n,a)=>{if(s6(e)){pg(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(XO(n,e))},o6=(e,t,n,a)=>{const o=Object.entries(e),s=o.length;for(let l=0;l<s;l++){const[u,f]=o[l];pg(f,lP(t,u),n,a)}},lP=(e,t)=>{let n=e;const a=t.split(Ju),o=a.length;for(let s=0;s<o;s++){const l=a[s];let u=n.nextPart.get(l);u||(u=oP(),n.nextPart.set(l,u)),n=u}return n},s6=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,l6=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const o=(s,l)=>{n[s]=l,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(s){let l=n[s];if(l!==void 0)return l;if((l=a[s])!==void 0)return o(s,l),l},set(s,l){s in n?n[s]=l:o(s,l)}}},zp="!",j_=":",c6=[],U_=(e,t,n,a,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:o}),u6=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=o=>{const s=[];let l=0,u=0,f=0,h;const m=o.length;for(let S=0;S<m;S++){const C=o[S];if(l===0&&u===0){if(C===j_){s.push(o.slice(f,S)),f=S+1;continue}if(C==="/"){h=S;continue}}C==="["?l++:C==="]"?l--:C==="("?u++:C===")"&&u--}const y=s.length===0?o:o.slice(f);let v=y,_=!1;y.endsWith(zp)?(v=y.slice(0,-1),_=!0):y.startsWith(zp)&&(v=y.slice(1),_=!0);const x=h&&h>f?h-f:void 0;return U_(s,_,v,x)};if(t){const o=t+j_,s=a;a=l=>l.startsWith(o)?s(l.slice(o.length)):U_(c6,!1,l,void 0,!0)}if(n){const o=a;a=s=>n({className:s,parseClassName:o})}return a},d6=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let o=[];for(let s=0;s<n.length;s++){const l=n[s],u=l[0]==="[",f=t.has(l);u||f?(o.length>0&&(o.sort(),a.push(...o),o=[]),a.push(l)):o.push(l)}return o.length>0&&(o.sort(),a.push(...o)),a}},h6=e=>({cache:l6(e.cacheSize),parseClassName:u6(e),sortModifiers:d6(e),...JO(e)}),f6=/\s+/,p6=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:o,sortModifiers:s}=t,l=[],u=e.trim().split(f6);let f="";for(let h=u.length-1;h>=0;h-=1){const m=u[h],{isExternal:y,modifiers:v,hasImportantModifier:_,baseClassName:x,maybePostfixModifierPosition:S}=n(m);if(y){f=m+(f.length>0?" "+f:f);continue}let C=!!S,R=a(C?x.substring(0,S):x);if(!R){if(!C){f=m+(f.length>0?" "+f:f);continue}if(R=a(x),!R){f=m+(f.length>0?" "+f:f);continue}C=!1}const M=v.length===0?"":v.length===1?v[0]:s(v).join(":"),E=_?M+zp:M,A=E+R;if(l.indexOf(A)>-1)continue;l.push(A);const U=o(R,C);for(let F=0;F<U.length;++F){const $=U[F];l.push(E+$)}f=m+(f.length>0?" "+f:f)}return f},m6=(...e)=>{let t=0,n,a,o="";for(;t<e.length;)(n=e[t++])&&(a=cP(n))&&(o&&(o+=" "),o+=a);return o},cP=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=cP(e[a]))&&(n&&(n+=" "),n+=t);return n},g6=(e,...t)=>{let n,a,o,s;const l=f=>{const h=t.reduce((m,y)=>y(m),e());return n=h6(h),a=n.cache.get,o=n.cache.set,s=u,u(f)},u=f=>{const h=a(f);if(h)return h;const m=p6(f,n);return o(f,m),m};return s=l,(...f)=>s(m6(...f))},y6=[],$t=e=>{const t=n=>n[e]||y6;return t.isThemeGetter=!0,t},uP=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,dP=/^\((?:(\w[\w-]*):)?(.+)\)$/i,v6=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,b6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,k6=/\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$/,_6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,w6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,x6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Mr=e=>v6.test(e),Xe=e=>!!e&&!Number.isNaN(Number(e)),Nr=e=>!!e&&Number.isInteger(Number(e)),Vf=e=>e.endsWith("%")&&Xe(e.slice(0,-1)),er=e=>b6.test(e),hP=()=>!0,P6=e=>k6.test(e)&&!_6.test(e),mg=()=>!1,S6=e=>w6.test(e),C6=e=>x6.test(e),T6=e=>!Se(e)&&!Te(e),E6=e=>Qr(e,mP,mg),Se=e=>uP.test(e),vi=e=>Qr(e,gP,P6),B_=e=>Qr(e,O6,Xe),A6=e=>Qr(e,vP,hP),R6=e=>Qr(e,yP,mg),z_=e=>Qr(e,fP,mg),L6=e=>Qr(e,pP,C6),Qc=e=>Qr(e,bP,S6),Te=e=>dP.test(e),js=e=>Bi(e,gP),D6=e=>Bi(e,yP),F_=e=>Bi(e,fP),I6=e=>Bi(e,mP),M6=e=>Bi(e,pP),Jc=e=>Bi(e,bP,!0),N6=e=>Bi(e,vP,!0),Qr=(e,t,n)=>{const a=uP.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},Bi=(e,t,n=!1)=>{const a=dP.exec(e);return a?a[1]?t(a[1]):n:!1},fP=e=>e==="position"||e==="percentage",pP=e=>e==="image"||e==="url",mP=e=>e==="length"||e==="size"||e==="bg-size",gP=e=>e==="length",O6=e=>e==="number",yP=e=>e==="family-name",vP=e=>e==="number"||e==="weight",bP=e=>e==="shadow",j6=()=>{const e=$t("color"),t=$t("font"),n=$t("text"),a=$t("font-weight"),o=$t("tracking"),s=$t("leading"),l=$t("breakpoint"),u=$t("container"),f=$t("spacing"),h=$t("radius"),m=$t("shadow"),y=$t("inset-shadow"),v=$t("text-shadow"),_=$t("drop-shadow"),x=$t("blur"),S=$t("perspective"),C=$t("aspect"),R=$t("ease"),M=$t("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],U=()=>[...A(),Te,Se],F=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],P=()=>[Te,Se,f],Z=()=>[Mr,"full","auto",...P()],X=()=>[Nr,"none","subgrid",Te,Se],fe=()=>["auto",{span:["full",Nr,Te,Se]},Nr,Te,Se],he=()=>[Nr,"auto",Te,Se],Q=()=>["auto","min","max","fr",Te,Se],ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],J=()=>["start","end","center","stretch","center-safe","end-safe"],ee=()=>["auto",...P()],se=()=>[Mr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],z=()=>[Mr,"screen","full","dvw","lvw","svw","min","max","fit",...P()],q=()=>[Mr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],V=()=>[e,Te,Se],D=()=>[...A(),F_,z_,{position:[Te,Se]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],pe=()=>["auto","cover","contain",I6,E6,{size:[Te,Se]}],me=()=>[Vf,js,vi],ge=()=>["","none","full",h,Te,Se],xe=()=>["",Xe,js,vi],ze=()=>["solid","dashed","dotted","double"],Ye=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],je=()=>[Xe,Vf,F_,z_],Rt=()=>["","none",x,Te,Se],Ln=()=>["none",Xe,Te,Se],wn=()=>["none",Xe,Te,Se],pt=()=>[Xe,Te,Se],Xt=()=>[Mr,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[er],breakpoint:[er],color:[hP],container:[er],"drop-shadow":[er],ease:["in","out","in-out"],font:[T6],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[er],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[er],shadow:[er],spacing:["px",Xe],text:[er],"text-shadow":[er],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Mr,Se,Te,C]}],container:["container"],columns:[{columns:[Xe,Se,Te,u]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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:U()}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Z()}],"inset-x":[{"inset-x":Z()}],"inset-y":[{"inset-y":Z()}],start:[{"inset-s":Z(),start:Z()}],end:[{"inset-e":Z(),end:Z()}],"inset-bs":[{"inset-bs":Z()}],"inset-be":[{"inset-be":Z()}],top:[{top:Z()}],right:[{right:Z()}],bottom:[{bottom:Z()}],left:[{left:Z()}],visibility:["visible","invisible","collapse"],z:[{z:[Nr,"auto",Te,Se]}],basis:[{basis:[Mr,"full","auto",u,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Xe,Mr,"auto","initial","none",Se]}],grow:[{grow:["",Xe,Te,Se]}],shrink:[{shrink:["",Xe,Te,Se]}],order:[{order:[Nr,"first","last","none",Te,Se]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:fe()}],"col-start":[{"col-start":he()}],"col-end":[{"col-end":he()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:fe()}],"row-start":[{"row-start":he()}],"row-end":[{"row-end":he()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Q()}],"auto-rows":[{"auto-rows":Q()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...ne(),"normal"]}],"justify-items":[{"justify-items":[...J(),"normal"]}],"justify-self":[{"justify-self":["auto",...J()]}],"align-content":[{content:["normal",...ne()]}],"align-items":[{items:[...J(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...J(),{baseline:["","last"]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...J(),"baseline"]}],"place-self":[{"place-self":["auto",...J()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:ee()}],mx:[{mx:ee()}],my:[{my:ee()}],ms:[{ms:ee()}],me:[{me:ee()}],mbs:[{mbs:ee()}],mbe:[{mbe:ee()}],mt:[{mt:ee()}],mr:[{mr:ee()}],mb:[{mb:ee()}],ml:[{ml:ee()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:se()}],"inline-size":[{inline:["auto",...z()]}],"min-inline-size":[{"min-inline":["auto",...z()]}],"max-inline-size":[{"max-inline":["none",...z()]}],"block-size":[{block:["auto",...q()]}],"min-block-size":[{"min-block":["auto",...q()]}],"max-block-size":[{"max-block":["none",...q()]}],w:[{w:[u,"screen",...se()]}],"min-w":[{"min-w":[u,"screen","none",...se()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...se()]}],h:[{h:["screen","lh",...se()]}],"min-h":[{"min-h":["screen","lh","none",...se()]}],"max-h":[{"max-h":["screen","lh",...se()]}],"font-size":[{text:["base",n,js,vi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,N6,A6]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Vf,Se]}],"font-family":[{font:[D6,R6,t]}],"font-features":[{"font-features":[Se]}],"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:[o,Te,Se]}],"line-clamp":[{"line-clamp":[Xe,"none",Te,B_]}],leading:[{leading:[s,...P()]}],"list-image":[{"list-image":["none",Te,Se]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Te,Se]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ze(),"wavy"]}],"text-decoration-thickness":[{decoration:[Xe,"from-font","auto",Te,vi]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[Xe,"auto",Te,Se]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Te,Se]}],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",Te,Se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:pe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Nr,Te,Se],radial:["",Te,Se],conic:[Nr,Te,Se]},M6,L6]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:me()}],"gradient-via-pos":[{via:me()}],"gradient-to-pos":[{to:me()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:ge()}],"rounded-s":[{"rounded-s":ge()}],"rounded-e":[{"rounded-e":ge()}],"rounded-t":[{"rounded-t":ge()}],"rounded-r":[{"rounded-r":ge()}],"rounded-b":[{"rounded-b":ge()}],"rounded-l":[{"rounded-l":ge()}],"rounded-ss":[{"rounded-ss":ge()}],"rounded-se":[{"rounded-se":ge()}],"rounded-ee":[{"rounded-ee":ge()}],"rounded-es":[{"rounded-es":ge()}],"rounded-tl":[{"rounded-tl":ge()}],"rounded-tr":[{"rounded-tr":ge()}],"rounded-br":[{"rounded-br":ge()}],"rounded-bl":[{"rounded-bl":ge()}],"border-w":[{border:xe()}],"border-w-x":[{"border-x":xe()}],"border-w-y":[{"border-y":xe()}],"border-w-s":[{"border-s":xe()}],"border-w-e":[{"border-e":xe()}],"border-w-bs":[{"border-bs":xe()}],"border-w-be":[{"border-be":xe()}],"border-w-t":[{"border-t":xe()}],"border-w-r":[{"border-r":xe()}],"border-w-b":[{"border-b":xe()}],"border-w-l":[{"border-l":xe()}],"divide-x":[{"divide-x":xe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":xe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ze(),"hidden","none"]}],"divide-style":[{divide:[...ze(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-bs":[{"border-bs":V()}],"border-color-be":[{"border-be":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...ze(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Xe,Te,Se]}],"outline-w":[{outline:["",Xe,js,vi]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",m,Jc,Qc]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",y,Jc,Qc]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:xe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[Xe,vi]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":xe()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",v,Jc,Qc]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[Xe,Te,Se]}],"mix-blend":[{"mix-blend":[...Ye(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ye()}],"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":[Xe]}],"mask-image-linear-from-pos":[{"mask-linear-from":je()}],"mask-image-linear-to-pos":[{"mask-linear-to":je()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":je()}],"mask-image-t-to-pos":[{"mask-t-to":je()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":je()}],"mask-image-r-to-pos":[{"mask-r-to":je()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":je()}],"mask-image-b-to-pos":[{"mask-b-to":je()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":je()}],"mask-image-l-to-pos":[{"mask-l-to":je()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":je()}],"mask-image-x-to-pos":[{"mask-x-to":je()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":je()}],"mask-image-y-to-pos":[{"mask-y-to":je()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[Te,Se]}],"mask-image-radial-from-pos":[{"mask-radial-from":je()}],"mask-image-radial-to-pos":[{"mask-radial-to":je()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"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":A()}],"mask-image-conic-pos":[{"mask-conic":[Xe]}],"mask-image-conic-from-pos":[{"mask-conic-from":je()}],"mask-image-conic-to-pos":[{"mask-conic-to":je()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:pe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Te,Se]}],filter:[{filter:["","none",Te,Se]}],blur:[{blur:Rt()}],brightness:[{brightness:[Xe,Te,Se]}],contrast:[{contrast:[Xe,Te,Se]}],"drop-shadow":[{"drop-shadow":["","none",_,Jc,Qc]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",Xe,Te,Se]}],"hue-rotate":[{"hue-rotate":[Xe,Te,Se]}],invert:[{invert:["",Xe,Te,Se]}],saturate:[{saturate:[Xe,Te,Se]}],sepia:[{sepia:["",Xe,Te,Se]}],"backdrop-filter":[{"backdrop-filter":["","none",Te,Se]}],"backdrop-blur":[{"backdrop-blur":Rt()}],"backdrop-brightness":[{"backdrop-brightness":[Xe,Te,Se]}],"backdrop-contrast":[{"backdrop-contrast":[Xe,Te,Se]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Xe,Te,Se]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xe,Te,Se]}],"backdrop-invert":[{"backdrop-invert":["",Xe,Te,Se]}],"backdrop-opacity":[{"backdrop-opacity":[Xe,Te,Se]}],"backdrop-saturate":[{"backdrop-saturate":[Xe,Te,Se]}],"backdrop-sepia":[{"backdrop-sepia":["",Xe,Te,Se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Te,Se]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Xe,"initial",Te,Se]}],ease:[{ease:["linear","initial",R,Te,Se]}],delay:[{delay:[Xe,Te,Se]}],animate:[{animate:["none",M,Te,Se]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Te,Se]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:Ln()}],"rotate-x":[{"rotate-x":Ln()}],"rotate-y":[{"rotate-y":Ln()}],"rotate-z":[{"rotate-z":Ln()}],scale:[{scale:wn()}],"scale-x":[{"scale-x":wn()}],"scale-y":[{"scale-y":wn()}],"scale-z":[{"scale-z":wn()}],"scale-3d":["scale-3d"],skew:[{skew:pt()}],"skew-x":[{"skew-x":pt()}],"skew-y":[{"skew-y":pt()}],transform:[{transform:[Te,Se,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Xt()}],"translate-x":[{"translate-x":Xt()}],"translate-y":[{"translate-y":Xt()}],"translate-z":[{"translate-z":Xt()}],"translate-none":["translate-none"],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"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",Te,Se]}],"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":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",Te,Se]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[Xe,js,vi,B_]}],stroke:[{stroke:["none",...V()]}],"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"]}},U6=g6(j6);function wt(...e){return U6(YO(e))}const B6=T.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[T.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"}),T.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"}),T.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"}),T.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"})]}),z6=T.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:T.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"})}),F6={google:B6,github:z6},V6={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",apple:"Apple"};function $6(e){return V6[e]||String(e||"").replace(/-/g," ")}function H6({title:e,subtitle:t,className:n="",onSuccess:a,hideLogo:o=!1}){Tl();const{enabled:s,signedIn:l,refreshUser:u,signInWithPassword:f,signUp:h,signInWithOAuth:m,getPublicAuthConfig:y}=$o(),[v,_]=k.useState("signin"),[x,S]=k.useState(""),[C,R]=k.useState(""),[M,E]=k.useState(""),[A,U]=k.useState(!1),[F,$]=k.useState(null),[P,Z]=k.useState(null),[X,fe]=k.useState(!1),[he,Q]=k.useState(!0),[ne,J]=k.useState([]),[ee,se]=k.useState(8);k.useEffect(()=>{if(!s)return;let D=!0;return Q(!0),(async()=>{const{data:W,error:pe}=await y();if(D){if(pe||!W)J(["google","github"]);else{const me=Array.isArray(W.oAuthProviders)?W.oAuthProviders:[],ge=Array.isArray(W.customOAuthProviders)?W.customOAuthProviders:[];J([...me,...ge]),typeof W.passwordMinLength=="number"&&W.passwordMinLength>0&&se(W.passwordMinLength)}Q(!1)}})(),()=>{D=!1}},[s,y]),k.useEffect(()=>{l&&a&&a()},[l,a]);const z=k.useMemo(()=>typeof window>"u"?"":!!window.webkit?.messageHandlers?.nativeOAuth?`${window.location.origin}/auth/callback`:`${window.location.origin}/`,[]),q=k.useCallback(async D=>{$(null),U(!0);try{const{error:W}=await m(D,z);W&&$(W.message||String(W))}finally{U(!1)}},[m,z]),V=k.useCallback(async D=>{D.preventDefault(),$(null),U(!0);try{if(v==="signup"){const{data:pe,error:me}=await h({email:x.trim(),password:C,name:M.trim()||void 0});if(me){$(me.message||String(me));return}if(pe?.requireEmailVerification){Z(De("login.verify_email_pending")),_("signin");return}await u();return}const{error:W}=await f({email:x.trim(),password:C});if(W){$(W.message||String(W));return}await u()}finally{U(!1)}},[v,x,C,M,h,f,u]);return s?T.jsxs("div",{className:wt("w-full bg-white dark:bg-oai-gray-950 p-6 transition-colors duration-200",n),children:[T.jsxs("div",{className:"text-center mb-6",children:[!o&&T.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[T.jsx("img",{src:"/app-icon.png",alt:"",width:28,height:28,className:"rounded-md"}),T.jsx("span",{className:"text-lg font-semibold text-oai-black dark:text-white font-oai tracking-tight",children:De("shared.app_name")})]}),T.jsx("h2",{className:wt("text-sm font-semibold text-oai-black dark:text-white tracking-tight mb-1",o&&"text-base font-bold md:text-lg"),children:e||De("login_modal.subtitle")}),t&&T.jsx("p",{className:"text-xs text-oai-gray-500 dark:text-oai-gray-400 mt-1.5 leading-relaxed max-w-[320px] mx-auto",children:t})]}),P&&T.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:P}),F&&T.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400 text-center",role:"alert",children:F}),T.jsx("div",{className:"space-y-2.5 mb-5",children:he?T.jsxs("div",{className:"space-y-2.5",children:[T.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"}),T.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"})]}):ne.map(D=>T.jsxs("button",{type:"button",disabled:A,onClick:()=>q(D),className:wt("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:[F6[D]||null,De("login.oauth.continue",{provider:$6(D)})]},D))}),X?T.jsxs(T.Fragment,{children:[T.jsxs("div",{className:"relative mb-5",children:[T.jsx("div",{className:"absolute inset-0 flex items-center",children:T.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),T.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:T.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:De("login_modal.divider_email")})})]}),T.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:[T.jsx("button",{type:"button",className:wt("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",v==="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:()=>{_("signin"),$(null)},children:De("login.tab.sign_in")}),T.jsx("button",{type:"button",className:wt("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",v==="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:()=>{_("signup"),$(null)},children:De("login.tab.sign_up")})]}),T.jsxs("form",{onSubmit:V,className:"space-y-3",children:[v==="signup"&&T.jsxs("div",{children:[T.jsx("label",{htmlFor:"card-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:De("login.field.name")}),T.jsx("input",{id:"card-name",type:"text",autoComplete:"name",value:M,onChange:D=>E(D.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:De("login.field.name_placeholder")})]}),T.jsxs("div",{children:[T.jsx("label",{htmlFor:"card-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:De("login.field.email")}),T.jsx("input",{id:"card-email",type:"email",autoComplete:"email",required:!0,value:x,onChange:D=>S(D.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"})]}),T.jsxs("div",{children:[T.jsx("label",{htmlFor:"card-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:De("login.field.password")}),T.jsx("input",{id:"card-password",type:"password",autoComplete:v==="signup"?"new-password":"current-password",required:!0,minLength:v==="signup"?ee:void 0,value:C,onChange:D=>R(D.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"}),v==="signup"&&T.jsx("p",{className:"mt-1 text-xs text-oai-gray-400 dark:text-oai-gray-600",children:De("login.password_hint",{min:String(ee)})})]}),T.jsx("button",{type:"submit",disabled:A,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:De(v==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]}):T.jsxs(T.Fragment,{children:[T.jsxs("div",{className:"relative mb-5",children:[T.jsx("div",{className:"absolute inset-0 flex items-center",children:T.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),T.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:T.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:De("login.divider")})})]}),T.jsxs("button",{type:"button",onClick:()=>fe(!0),className:wt("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:[T.jsx(SI,{className:"h-[18px] w-[18px] text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:1.75}),De("login_modal.continue_email")]})]})]}):null}function W6(){const{isOpen:e,closeLoginModal:t}=yx(),{enabled:n}=$o();return k.useEffect(()=>{if(!e)return;const a=o=>{o.key==="Escape"&&t()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,t]),n?T.jsx(G1,{children:e&&T.jsxs(tl.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:[T.jsx(tl.div,{className:"absolute inset-0 bg-black/40 dark:bg-black/60",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),T.jsxs(tl.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 shadow-2xl overflow-hidden",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:a=>a.stopPropagation(),children:[T.jsx("button",{type:"button",onClick:t,className:"absolute right-4 top-4 z-10 text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:T.jsx(jm,{className:"h-5 w-5"})}),T.jsx(H6,{onSuccess:t,className:"p-6 bg-transparent"})]})]})}):null}const G6={VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"},X9="https://tokentracker.statuspage.io/";function K6(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return"";const t=typeof import.meta<"u"?G6:void 0;return(t?.VITE_TOKENTRACKER_BACKEND_BASE_URL||t?.VITE_INSFORGE_BASE_URL||ir()).trim()}function q6(){return ir()}function Y6(e=""){if(typeof e!="string"||e.length===0)return!1;const t=new URLSearchParams(e),n=String(t.get("screenshot")||"").toLowerCase();return n==="1"||n==="true"}const Z6=300*1e3,X6=720*60*1e3;function gg(e){return typeof e=="string"&&/^https?:\/\//i.test(e.trim())}function Q6(e,t=Date.now()){if(!e?.token||!e?.deviceId||!e?.issuedAt)return!0;const n=Date.parse(e.issuedAt);return Number.isFinite(n)?n+X6<=t:!0}async function kP(e,t){const n=ir();if(!gg(n)||!e)return;const a=n.replace(/\/$/,""),o=xl(),s={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};o&&(s.apikey=o);try{await fetch(`${a}/functions/tokentracker-leaderboard-refresh`,{method:"POST",headers:s,body:JSON.stringify({period:"week",source:t})})}catch{}}async function J6(e){const t=ir();if(!gg(t)||!e)return null;const n=t.replace(/\/$/,""),a=xl(),o={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};a&&(o.apikey=a);const s=typeof navigator<"u"&&typeof navigator.platform=="string"?navigator.platform:"web",l=await fetch(`${n}/functions/tokentracker-device-token-issue`,{method:"POST",headers:o,body:JSON.stringify({device_name:"Token Tracker (dashboard)",platform:s})});if(!l.ok)return null;const u=await l.json().catch(()=>null),f=typeof u?.token=="string"?u.token:null,h=typeof u?.device_id=="string"?u.device_id:null;return!f||!h?null:{token:f,deviceId:h,issuedAt:typeof u?.created_at=="string"?u.created_at:new Date().toISOString()}}async function V_(e){const{deviceToken:t,insforgeBaseUrl:n}=e,a={deviceToken:t},o=n||ir();gg(o)&&(a.insforgeBaseUrl=o.trim());const s=await fd(),l=await fetch("/functions/tokentracker-local-sync",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...s},body:JSON.stringify(a)}),u=await l.json().catch(()=>({}));if(!l.ok){const f=typeof u.error=="string"?u.error:`HTTP ${l.status}`;throw new Error(f)}return u}async function $_(e){const t=await e();if(!t)return null;const n=Iw();if(n&&!Q6(n))return n;const a=await J6(t);return a?(rL(a),a):null}async function _P(e){let t=await e();if(!t)return null;let n=await $_(async()=>t);if(!n)return t;try{return await V_({deviceToken:n.token,insforgeBaseUrl:ir()}),t}catch(a){if(!Iw()||(Mw(),t=await e(),!t)||(n=await $_(async()=>t),!n))throw a;return await V_({deviceToken:n.token,insforgeBaseUrl:ir()}),t}}async function ej(e){const t=iL();if(Date.now()-t<Z6)return;const n=await _P(e);n&&(Nw(Date.now()),await kP(n,"cloud-sync-auto"))}async function Q9(e){const t=await _P(e);t&&(Nw(Date.now()),await kP(t,"cloud-sync-now"))}function tj(e){const t=e.replace(/\/+$/,"")||"/";return t==="/share"||t==="/share.html"||t.startsWith("/share/")}function nj(e){const t=e.replace(/\/+$/,"")||"/";return t==="/login"||t==="/landing"||tj(t)?!1:t==="/"||t==="/dashboard"||t.startsWith("/leaderboard")}function aj(){const e=ta(),t=$o(),n=k.useRef(!1);k.useEffect(()=>{if(!nL()||!nj(e.pathname||"/")||!t.enabled||!t.signedIn||t.loading||!aL())return;let a=!1;const o=window.setTimeout(()=>{(async()=>{if(!(a||n.current)){n.current=!0;try{await ej(()=>t.getAccessToken())}catch(s){console.warn("[tokentracker] cloud usage sync:",s)}finally{n.current=!1}}})()},2500);return()=>{a=!0,window.clearTimeout(o)}},[e.pathname,t.enabled,t.signedIn,t.loading,t.getAccessToken])}function rj(){const e=k.useContext(mx);if(e===null)throw new Error("useTheme must be used within a ThemeProvider");return e}function ij({prefersReducedMotion:e,screenshotCapture:t}){return!(t||e)}function oj(e){if(!e||typeof e!="object")return null;const t=e.user_metadata&&typeof e.user_metadata=="object"?e.user_metadata:{},n=e.profile&&typeof e.profile=="object"?e.profile:{},a=t.avatar_url||t.picture||n.avatar_url||e.avatar_url;return typeof a=="string"&&a.trim()?a.trim():null}function sj(e){return e?pd()?`/api/avatar-proxy?url=${encodeURIComponent(e)}`:e:null}function eu(e){const t=String(e||"").trim();if(!t)return"?";const n=t.split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():t.slice(0,2).toUpperCase()}function H_({className:e,variant:t="header",collapsed:n=!1,onAfterAction:a}){Tl();const o=t==="sidebar",{enabled:s,loading:l,signedIn:u,user:f,displayName:h}=$o(),{openLoginModal:m}=yx(),y=_l(),v=k.useMemo(()=>oj(f),[f]),_=k.useMemo(()=>sj(v),[v]),[x,S]=rl.useState(!1);if(rl.useEffect(()=>{S(!1)},[_]),!s)return null;if(l)return T.jsx("div",{className:wt("h-9 w-9 shrink-0 rounded-full bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse",e),"aria-hidden":!0});if(!u)return o?T.jsxs("button",{type:"button",onClick:()=>{m(),a?.()},className:wt("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",e),"aria-label":De("header.auth.sign_in_aria"),title:n?De("header.auth.sign_in_aria"):void 0,children:[T.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:T.jsx("img",{src:"/app-icon.png",alt:"",width:18,height:18,className:"h-[18px] w-[18px] rounded"})}),!n&&T.jsx("span",{className:"truncate flex-1 text-left",children:De("header.auth.sign_in_aria")})]}):T.jsx("button",{type:"button",onClick:m,className:wt("shrink-0 inline-flex h-9 items-center justify-center gap-1.5 rounded-md px-4 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",e),"aria-label":De("header.auth.sign_in_aria"),children:De("header.auth.sign_in_aria")});const C=()=>{y("/settings"),a?.()};return T.jsx("div",{className:wt(o?"relative flex w-full shrink-0 items-center":"relative flex shrink-0 items-center",e),children:T.jsxs("button",{type:"button",onClick:C,className:wt(o?wt("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-md 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":De("header.auth.open_settings"),title:o&&n?h:void 0,children:[o?T.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:_&&!x?T.jsx("img",{src:_,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",onError:()=>S(!0)}):eu(h)==="?"?T.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:T.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-3 h-3 opacity-80",children:T.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):T.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:eu(h)})}):_&&!x?T.jsx("img",{src:_,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",onError:()=>S(!0)}):eu(h)==="?"?T.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:T.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-4 h-4 opacity-80",children:T.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):T.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:eu(h)}),o?!n&&T.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:h}):T.jsx("span",{className:"hidden sm:inline truncate text-sm font-medium text-oai-gray-900 dark:text-oai-gray-200 max-w-[120px]",children:h})]})})}const Fp="tt.sidebarCollapsed";function wP(){return[{id:"general",label:De("nav.group.general"),items:[{id:"usage",to:"/dashboard",icon:mI,label:De("nav.usage")},{id:"limits",to:"/limits",icon:bI,label:De("nav.limits")},{id:"leaderboard",to:"/leaderboard",icon:$I,label:De("nav.leaderboard")}]},{id:"tools",label:De("nav.group.tools"),items:[{id:"widgets",to:"/widgets",icon:xI,label:De("nav.widgets")},{id:"skills",to:"/skills",icon:DI,label:De("nav.skills")},{id:"ip-check",to:"/ip-check",icon:_I,label:De("nav.ip_check")}]},{id:"account",label:De("nav.group.account"),items:[{id:"settings",to:"/settings",icon:UI,label:De("nav.settings")}]}]}function lj(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Fp)==="1"}catch{return!1}}function cj(){const[e,t]=k.useState(lj),n=k.useCallback(()=>{t(a=>{const o=!a;try{typeof window<"u"&&window.localStorage.setItem(Fp,o?"1":"0")}catch{}return o})},[]);return k.useEffect(()=>{if(typeof window>"u")return;const a=o=>{o.key===Fp&&t(o.newValue==="1")};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[]),{collapsed:e,toggle:n}}function uj(e,t){const n=e.replace(/\/+$/,"")||"/";return t==="/dashboard"?n==="/dashboard"||n==="/":t==="/leaderboard"?n==="/leaderboard"||n.startsWith("/leaderboard/"):n===t}function dj({label:e,collapsed:t,first:n}){return t?n?null:T.jsx("div",{className:"mx-2 my-2 h-px bg-oai-gray-200/70 dark:bg-oai-gray-800/70","aria-hidden":!0}):T.jsx("div",{className:wt("px-3 pb-1 text-[10px] uppercase tracking-wider text-oai-gray-500 dark:text-oai-gray-500",n?"pt-2":"pt-4"),children:e})}function hj({item:e,collapsed:t,active:n,onClick:a}){const o=e.icon;return T.jsxs(sd,{to:e.to,onClick:a,title:t?e.label:void 0,"aria-current":n?"page":void 0,className:wt("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] no-underline transition-colors",t&&"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:[T.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:T.jsx(o,{className:"h-[15px] w-[15px]","aria-hidden":!0})}),!t&&T.jsx("span",{className:"truncate",children:e.label})]})}function fj({as:e="button",title:t,onClick:n,href:a,children:o,className:s,...l}){const u=wt("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 e==="a"?T.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",title:t,"aria-label":t,className:u,...l,children:o}):T.jsx("button",{type:"button",title:t,"aria-label":t,onClick:n,className:u,...l,children:o})}function pj({repo:e="mm7894215/TokenTracker",glassChrome:t=!1}){const[n,a]=k.useState(null);return k.useEffect(()=>{if(typeof window>"u")return;const o=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;ij({prefersReducedMotion:o,screenshotCapture:!1})&&fetch(`https://api.github.com/repos/${e}`).then(s=>s.json()).then(s=>{s&&typeof s.stargazers_count=="number"&&a(s.stargazers_count)}).catch(()=>{})},[e]),T.jsxs("a",{href:`https://github.com/${e}`,target:"_blank",rel:"noopener noreferrer","aria-label":n!==null?`Star on GitHub (${n})`:"Star on GitHub",className:wt("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",t?"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:[T.jsx("svg",{height:"12",viewBox:"0 0 16 16",width:"12",className:"shrink-0 fill-current",children:T.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"})}),T.jsx("span",{children:"Star"}),n!==null&&T.jsx("span",{className:"text-[10px] text-oai-gray-500 dark:text-oai-gray-500 tabular-nums",children:n})]})}const mj=[{value:"light",label:"Light",Icon:px},{value:"dark",label:"Dark",Icon:fx},{value:"system",label:"System",Icon:AI}];function gj({theme:e,resolvedTheme:t,onSetTheme:n,glassChrome:a=!1}){const[o,s]=k.useState(!1),l=k.useRef(null),u=t==="dark"?fx:px;return k.useEffect(()=>{if(!o)return;const f=m=>{l.current&&!l.current.contains(m.target)&&s(!1)},h=m=>{m.key==="Escape"&&s(!1)};return document.addEventListener("mousedown",f),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",h)}},[o]),T.jsxs("div",{ref:l,className:"relative",children:[T.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":o,"aria-haspopup":"menu",title:"Theme",onClick:()=>s(f=>!f),className:wt("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",a?"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:T.jsx(u,{className:"h-3.5 w-3.5","aria-hidden":!0})}),o&&T.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:mj.map(({value:f,label:h,Icon:m})=>{const y=e===f;return T.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{n(f),s(!1)},className:wt("flex w-full items-center gap-2.5 px-3 py-1.5 text-[13px] transition-colors",y?"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:[T.jsx(m,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),T.jsx("span",{children:h})]},f)})})]})}function xP({collapsed:e,onToggleCollapsed:t,onItemClick:n,showCloseButton:a=!1,onClose:o,glassChrome:s=!1}){const u=ta()?.pathname||"/",{theme:f,resolvedTheme:h,setTheme:m}=rj(),{resolvedLocale:y}=Tl(),v=k.useMemo(()=>wP(),[y]);return T.jsxs(T.Fragment,{children:[T.jsx("div",{className:wt("px-2 pt-2 pb-2",e&&"flex justify-center"),children:a?T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("div",{className:"flex-1 min-w-0",children:T.jsx(H_,{variant:"sidebar",collapsed:e,onAfterAction:n})}),T.jsx("button",{type:"button",onClick:o,"aria-label":De("nav.close_menu"),title:De("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:T.jsx(jm,{className:"h-4 w-4",strokeWidth:1.75,"aria-hidden":!0})})]}):T.jsx(H_,{variant:"sidebar",collapsed:e,onAfterAction:n})}),T.jsx("nav",{"aria-label":De("nav.nav_label"),className:"flex-1 px-2 pb-2 flex flex-col overflow-y-auto",children:v.map((_,x)=>T.jsxs("div",{className:"flex flex-col",children:[T.jsx(dj,{label:_.label,collapsed:e,first:x===0}),T.jsx("div",{className:"flex flex-col gap-0.5",children:_.items.filter(S=>!(S.to==="/widgets"&&Im())).map(S=>T.jsx(hj,{item:S,collapsed:e,active:uj(u,S.to),onClick:n},S.id))})]},_.id))}),T.jsxs("div",{className:wt("flex items-center px-2 py-3",e?"flex-col justify-center gap-2":"justify-between gap-2"),children:[T.jsx(gj,{theme:f,resolvedTheme:h,onSetTheme:m,glassChrome:s}),T.jsx("div",{className:"flex items-center gap-1.5",children:!e&&T.jsx(pj,{glassChrome:s})})]})]})}function yj({collapsed:e,onToggleCollapsed:t}){const n=k.useMemo(()=>typeof window>"u"?!1:ma()||pd(),[]);return T.jsx("aside",{"aria-label":De("nav.aside_label"),className:wt("hidden lg:flex flex-col shrink-0 h-full min-h-0 transition-[width] duration-200",e?"w-[72px]":"w-[220px]"),children:T.jsx(xP,{collapsed:e,onToggleCollapsed:t,glassChrome:n})})}function vj({open:e,onClose:t}){return k.useEffect(()=>{if(!e)return;const n=a=>{a.key==="Escape"&&t()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e,t]),k.useEffect(()=>{if(!e)return;const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}},[e]),e?T.jsxs("div",{className:"lg:hidden fixed inset-0 z-[80] flex",children:[T.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:t,"aria-hidden":!0}),T.jsx("aside",{"aria-label":De("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:T.jsx(xP,{collapsed:!1,showCloseButton:!0,onClose:t,onItemClick:t})})]}):null}function bj({onOpenDrawer:e}){return T.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:[T.jsx(fj,{title:De("nav.menu"),onClick:e,children:T.jsx(TI,{className:"h-5 w-5","aria-hidden":!0})}),T.jsxs(sd,{to:"/landing",className:"flex items-center gap-2 no-underline hover:opacity-80 transition-opacity","aria-label":"Token Tracker",children:[T.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),T.jsx("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white",children:"Token Tracker"})]}),T.jsx("div",{className:"w-10 shrink-0","aria-hidden":!0})]})}function kj({children:e}){const{collapsed:t,toggle:n}=cj(),[a,o]=k.useState(!1),s=k.useCallback(()=>o(!0),[]),l=k.useCallback(()=>o(!1),[]),u=k.useMemo(()=>typeof window>"u"?!1:ma()||pd(),[]);return T.jsxs("div",{className:wt("fixed inset-0 flex flex-col text-oai-black dark:text-oai-white font-sans overflow-hidden",Im()&&"tt-native-glass-shell",u?"bg-transparent":"bg-oai-gray-100 dark:bg-oai-gray-950"),children:[u&&T.jsx("div",{className:"h-7 shrink-0",style:{WebkitAppRegion:"drag"},"aria-hidden":!0}),T.jsxs("div",{className:"flex-1 min-h-0 flex",children:[T.jsx(yj,{collapsed:t,onToggleCollapsed:n}),T.jsx(vj,{open:a,onClose:l}),T.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:T.jsxs("div",{className:wt("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",u?"tt-native-main-card":"rounded-2xl",!u&&"shadow-sm"),children:[T.jsx(bj,{onOpenDrawer:s}),T.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:e})]})})]})]})}function _j({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"})})}function wj({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:t,children:T.jsx("path",{d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"})})}function xj({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z"})})}function Pj({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"})})}function Sj({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"})})}function Cj({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 -1 22 28",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M4.125 20.149c-2.69 5.959 3.036 7.453 7.26 3.966 1.24 3.91 5.898.993 7.569-2.036 3.682-6.678 2.195-13.49 1.813-14.895-2.617-9.582-15.699-9.592-17.95.049-.526 1.687-.535 3.606-.833 5.598-.15 1.005-.256 1.646-.645 2.703-.223.607-.53 1.147-1.014 2.056-.75 1.412-.434 4.138 3.434 2.724v.001ZM11.895 11.332c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.395.9.395 1.578 0 1.283-.493 2.048-1.319 2.048Zm4.416 0c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.396.9.396 1.578 0 1.283-.494 2.048-1.32 2.048Z"})})}function Tj({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M16 6H8v12h8V6zm4 16H4V2h16v20z"})})}function Ej({size:e=16,className:t=""}){return T.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:[T.jsx("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"}),T.jsx("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"})]})}function Aj({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"})})}function Rj({size:e=16,className:t=""}){return T.jsxs("svg",{width:e,height:e,viewBox:"0 0 64 60",fill:"none",className:t,"aria-hidden":"true",children:[T.jsx("path",{fill:"currentColor",d:"M37.2114 3.75318C37.6821 3.33106 37.7106 3.31457 38.0558 3.29385C38.6149 3.2531 39.1272 3.52199 39.9989 4.31564C42.0356 6.16652 44.8714 9.97183 46.6346 13.2212L47.3163 14.4819L48.2782 14.9605C49.2072 15.4299 50.7308 16.3923 51.3672 16.9085C51.655 17.1464 51.6956 17.1508 51.9947 17.0344C53.3454 16.5084 55.2803 17.206 56.9869 18.8432C58.5231 20.3155 59.9943 22.8312 60.558 24.9308C60.6403 25.2687 60.7493 25.9952 60.7891 26.5362C60.9177 28.4358 60.3092 29.9532 59.1362 30.64C58.8965 30.7784 58.8801 30.8158 58.8868 31.4132C58.9409 34.2583 58.1741 37.0985 56.6335 39.8679C54.8946 42.9773 51.7981 46.1938 47.6074 49.2243C45.357 50.8619 40.0323 53.964 37.6248 55.0532C31.8578 57.6496 27.2346 58.646 23.2188 58.154C20.8236 57.8638 18.1124 56.9287 16.5082 55.8433C16.086 55.5515 16.0191 55.5329 15.6966 55.6251C13.9793 56.1185 11.73 55.1053 9.81931 52.9844C9.05725 52.1366 7.82714 50.0548 7.42839 48.9409C6.50606 46.3339 6.68976 43.9816 7.91836 42.5767C8.23573 42.2149 8.2453 42.1995 8.17598 41.5912C8.06148 40.5951 8.00971 39.1206 8.06202 38.1692L8.10361 37.2803L6.76977 34.9212C4.70378 31.2451 3.3912 28.1582 2.88489 25.7998C2.61762 24.5066 2.63385 23.9324 2.96214 23.5078C3.16198 23.2515 3.81796 22.9866 4.60785 22.8407C6.59665 22.4917 10.9334 22.8076 15.7581 23.6595L16.259 23.7458L17.3608 22.7713C19.1891 21.1519 20.4038 20.244 22.6429 18.8478C24.9768 17.3876 27.6108 16.1858 30.577 15.2346L31.5295 14.9294L32.0526 13.5561C33.9257 8.61146 35.8437 4.96584 37.2114 3.75318ZM21.5208 29.0919C19.404 30.314 18.3453 30.9251 17.5676 31.6099C14.4179 34.3835 13.2414 38.777 14.5823 42.7537C14.9135 43.7357 15.5247 44.7942 16.7469 46.9111C17.9691 49.0279 18.5801 50.0865 19.2649 50.8643C22.0385 54.014 26.4316 55.1918 30.4084 53.8509C31.3904 53.5198 32.4489 52.9085 34.5657 51.6863L46.7442 44.6551C48.8613 43.4328 49.9205 42.8214 50.6983 42.1365C53.8479 39.363 55.0245 34.9695 53.6835 30.9927C53.3524 30.0107 52.7412 28.9522 51.519 26.8354C50.2968 24.7185 49.6858 23.66 49.0009 22.8822C46.2274 19.7325 41.8342 18.5547 37.8575 19.8956C36.8754 20.2267 35.8163 20.8383 33.6993 22.0606L21.5208 29.0919Z"}),T.jsx("g",{transform:"rotate(-30 22.6953 37.6011)",children:T.jsx("rect",{x:"22.6953",y:"37.6011",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})}),T.jsx("g",{transform:"rotate(-30 35.6748 30.1074)",children:T.jsx("rect",{x:"35.6748",y:"30.1074",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})})]})}function Lj({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:t,children:T.jsx("path",{d:"M7 2h10a5 5 0 015 5v10a5 5 0 01-5 5H7a5 5 0 01-5-5V7a5 5 0 015-5zm0 4.5v11h2.35v-4.55h5.3V17.5H17v-11h-2.35v4.1h-5.3V6.5H7z"})})}function Dj({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:t,children:T.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})}function Ij({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:T.jsx("g",{transform:"translate(3.4502, 3)",fill:"#9570BE",children:T.jsx("path",{d:"M3.17890888,3.6 L3.17890888,0 L16,0 L16,3.6 L3.17890888,3.6 Z M9.642,7.2 L9.64218223,10.8 L0,10.8 L0,3.6 L16,3.6 L16,7.2 L9.642,7.2 Z M3.17890888,18 L3.178,14.4 L0,14.4 L0,10.8 L16,10.8 L16,18 L3.17890888,18 Z",fillRule:"nonzero"})})})}function Mj({size:e=16,className:t=""}){return T.jsxs("svg",{width:e,height:e,viewBox:"0 0 120 90",fill:"currentColor",className:t,children:[T.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),T.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),T.jsx("rect",{x:"75",y:"20",width:"12",height:"45",rx:"2"}),T.jsx("rect",{x:"71",y:"55",width:"20",height:"16",rx:"3"}),T.jsx("rect",{x:"76",y:"71",width:"3",height:"8",rx:"1"}),T.jsx("rect",{x:"82",y:"71",width:"3",height:"8",rx:"1"})]})}function Nj({size:e=16,className:t=""}){return T.jsxs("svg",{width:e,height:e,viewBox:"0 0 120 90",fill:"currentColor",className:t,children:[T.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),T.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),T.jsx("rect",{x:"83",y:"20",width:"12",height:"62",rx:"2"})]})}function Oj({size:e=16,className:t=""}){return T.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[T.jsx("path",{d:"M9 3v2"}),T.jsx("path",{d:"M15 3v2"}),T.jsx("rect",{x:"4",y:"6",width:"16",height:"13",rx:"3"}),T.jsx("circle",{cx:"9",cy:"13",r:"1.4",fill:"currentColor",stroke:"none"}),T.jsx("circle",{cx:"15",cy:"13",r:"1.4",fill:"currentColor",stroke:"none"}),T.jsx("path",{d:"M9 16h6"})]})}const jj={CLAUDE:_j,CODEBUDDY:Rj,CODEX:wj,COPILOT:Aj,CRAFT:Ij,CURSOR:xj,DROID:Oj,GEMINI:Pj,GITHUB:Dj,GROK:Sj,HERMES:Lj,KIMI:Ej,KIRO:Cj,OPENCODE:Tj,OMP:Mj,PI:Nj},Uj={ANTIGRAVITY:"/brand-logos/antigravity.svg",CLAUDE:"/brand-logos/claude-code.svg",CODEX:"/brand-logos/codex.svg",GEMINI:"/brand-logos/gemini.svg",HERMES:"/brand-logos/hermes.svg","KILO-CLI":"/brand-logos/kilo.svg","KILO-CODE":"/brand-logos/kilo.svg",OPENCLAW:"/brand-logos/openclaw.svg",OPENCODE:"/brand-logos/opencode.svg"};function Bj({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:T.jsx("circle",{cx:"12",cy:"12",r:"7.5",strokeDasharray:"3 3"})})}function zj({provider:e,size:t=16,color:n,className:a=""}){const o=e?.toUpperCase?.()||"",s=Uj[o];if(s)return T.jsx("img",{src:s,alt:"",width:t,height:t,className:a,style:{width:t,height:t,objectFit:"contain"},"aria-hidden":!0});const l=jj[o];return l?T.jsx(l,{size:t,className:a}):T.jsx(Bj,{size:t,className:`text-oai-gray-400 dark:text-oai-gray-500 shrink-0 ${a}`})}const PP="tokentracker-skills";async function zi(e){const t=new URL(`/functions/${PP}`,window.location.origin);if(e)for(const[o,s]of Object.entries(e))s!=null&&s!==""&&t.searchParams.set(o,String(s));const n=await fetch(t.toString(),{headers:{Accept:"application/json"},cache:"no-store"}),a=await n.json().catch(()=>null);if(!n.ok)throw new Error(a?.error||`Request failed with HTTP ${n.status}`);return a}async function Jr(e){const t=await fd(),n=await fetch(`/functions/${PP}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...t},cache:"no-store",body:JSON.stringify(e)}),a=await n.json().catch(()=>null);if(!n.ok||a?.ok===!1)throw new Error(a?.error||`Request failed with HTTP ${n.status}`);return a}function Fj(){return zi({mode:"installed"})}function J9(e={}){return zi({mode:"discover",...e.force?{force:1}:{}})}function e7(e,t=0,n=20){return zi({mode:"search",q:e,offset:t,limit:n})}function t7(){return zi({mode:"repos"})}function n7(e,t){return Jr({action:"install",skill:e,targets:t})}function a7(e){return Jr({action:"uninstall",id:e})}function r7(e){return Jr({action:"restore",id:e})}function i7(e,t){return Jr({action:"set_targets",id:e,targets:t})}function o7(e,t){return Jr({action:"import_local",directory:e,targets:t})}function s7(e,t){return Jr({action:"delete_local",directory:e,targets:t||[]})}function l7(e){return Jr({action:"add_repo",repo:e})}function c7(e,t){return Jr({action:"remove_repo",owner:e,name:t})}function u7(e={}){return zi({mode:"popular",...e.force?{force:1}:{}})}function d7(e={}){return zi({mode:"updates",...e.force?{force:1}:{}})}function h7(e={}){return zi({mode:"skill_usage",...e.force?{force:1}:{}})}const Vj=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");function $j(){const e=_l(),t=qO(),[n,a]=k.useState(!1),[o,s]=k.useState(""),[l,u]=k.useState(0),[f,h]=k.useState([]),m=k.useRef(null),y=k.useRef(null);k.useEffect(()=>{const E=A=>{(A.metaKey||A.ctrlKey)&&(A.key==="k"||A.key==="K")&&(A.preventDefault(),a(F=>!F))};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[]),k.useEffect(()=>{if(!n)return;s(""),u(0);const E=requestAnimationFrame(()=>m.current?.focus());return Vj&&!f.length&&Fj().then(A=>h(A?.skills||[])).catch(()=>h([])),()=>cancelAnimationFrame(E)},[n,f.length]);const v=k.useMemo(()=>{const E=wP().flatMap(U=>U.items.map(F=>({kind:"page",id:`page:${F.id}`,label:F.label,sub:De("cmdk.group.pages"),Icon:F.icon,run:()=>e(F.to)}))),A=(f||[]).map(U=>({kind:"skill",id:`skill:${U.id||U.directory}`,label:U.name||U.directory,sub:U.repoOwner&&U.repoName?`${U.repoOwner}/${U.repoName}`:De("cmdk.group.skills"),provider:(U.targets||[])[0]||"claude",run:()=>e(`/skills?skill=${encodeURIComponent(U.directory||U.id)}`)}));return[...E,...A]},[e,f]),_=k.useMemo(()=>{const E=o.trim().toLowerCase();return E?v.filter(A=>A.label.toLowerCase().includes(E)||String(A.sub||"").toLowerCase().includes(E)):v},[v,o]);k.useEffect(()=>{l>=_.length&&u(_.length?_.length-1:0)},[l,_.length]),k.useEffect(()=>{if(!n)return;y.current?.querySelector(`[data-cmdk-index="${l}"]`)?.scrollIntoView({block:"nearest"})},[l,n]);const x=k.useCallback(()=>a(!1),[]),S=k.useCallback(E=>{E&&(x(),E.run())},[x]),C=E=>{E.key==="ArrowDown"?(E.preventDefault(),u(A=>Math.min(A+1,Math.max(0,_.length-1)))):E.key==="ArrowUp"?(E.preventDefault(),u(A=>Math.max(A-1,0))):E.key==="Enter"?(E.preventDefault(),S(_[l])):E.key==="Escape"&&(E.preventDefault(),x())},R={duration:t?0:.12},M=t?{duration:0}:{type:"spring",stiffness:460,damping:34,mass:.6};return T.jsx(G1,{children:n?T.jsxs(tl.div,{className:"fixed inset-0 z-[120] flex items-start justify-center px-4 pt-[16vh]",initial:t?!1:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:R,children:[T.jsx("button",{type:"button","aria-label":De("cmdk.close"),onClick:x,className:"absolute inset-0 cursor-default bg-oai-black/40"}),T.jsxs(tl.div,{role:"dialog","aria-modal":"true","aria-label":De("cmdk.open_aria"),initial:t?!1:{opacity:0,y:-8,scale:.985},animate:{opacity:1,y:0,scale:1},exit:t?{opacity:0}:{opacity:0,y:-8,scale:.985},transition:M,className:"relative w-full max-w-xl overflow-hidden rounded-2xl border border-oai-gray-200 bg-oai-white shadow-2xl dark:border-oai-gray-800 dark:bg-oai-gray-950",children:[T.jsxs("div",{className:"flex items-center gap-2.5 border-b border-oai-gray-200 px-4 dark:border-oai-gray-800",children:[T.jsx(OI,{className:"h-4 w-4 shrink-0 text-oai-gray-400","aria-hidden":!0}),T.jsx("input",{ref:m,type:"text",value:o,onChange:E=>{s(E.target.value),u(0)},onKeyDown:C,"aria-label":De("cmdk.placeholder"),"aria-controls":"cmdk-listbox","aria-activedescendant":_[l]?`cmdk-opt-${l}`:void 0,role:"combobox","aria-expanded":"true",placeholder:De("cmdk.placeholder"),className:"h-12 w-full bg-transparent text-sm text-oai-black placeholder:text-oai-gray-400 focus:outline-none dark:text-white"})]}),T.jsx("div",{ref:y,id:"cmdk-listbox",role:"listbox",className:"max-h-[min(56vh,22rem)] overflow-y-auto p-1.5",children:_.length===0?T.jsx("div",{className:"px-3 py-8 text-center text-sm text-oai-gray-500 dark:text-oai-gray-400",children:De("cmdk.empty")}):_.map((E,A)=>{const U=A===l;return T.jsxs("button",{type:"button",role:"option",id:`cmdk-opt-${A}`,"data-cmdk-index":A,"aria-selected":U,onMouseMove:()=>u(A),onClick:()=>S(E),className:wt("flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-sm transition-colors",U?"bg-oai-gray-100 text-oai-black dark:bg-oai-gray-800/70 dark:text-white":"text-oai-gray-700 dark:text-oai-gray-200"),children:[T.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center text-oai-gray-500 dark:text-oai-gray-400",children:E.kind==="skill"?T.jsx(zj,{provider:E.provider,size:16}):T.jsx(E.Icon,{className:"h-4 w-4","aria-hidden":!0})}),T.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:E.label}),T.jsx("span",{className:"shrink-0 truncate text-xs text-oai-gray-400 dark:text-oai-gray-500",children:E.sub}),U?T.jsx(yI,{className:"h-3.5 w-3.5 shrink-0 text-oai-gray-400","aria-hidden":!0}):null]},E.id)})})]})]}):null})}function _d(){return typeof window<"u"}function yg(e){return vg(e)?(e.nodeName||"").toLowerCase():"#document"}function Yr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Hj(e){var t;return(t=(vg(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vg(e){return _d()?e instanceof Node||e instanceof Yr(e).Node:!1}function SP(e){return _d()?e instanceof Element||e instanceof Yr(e).Element:!1}function wd(e){return _d()?e instanceof HTMLElement||e instanceof Yr(e).HTMLElement:!1}function Vp(e){return!_d()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Yr(e).ShadowRoot}function CP(e){const{overflow:t,overflowX:n,overflowY:a,display:o}=EP(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&o!=="inline"&&o!=="contents"}function f7(e){return/^(table|td|th)$/.test(yg(e))}function Wj(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Gj=/transform|translate|scale|rotate|perspective|filter/,Kj=/paint|layout|strict|content/,bi=e=>!!e&&e!=="none";let $f;function qj(e){const t=SP(e)?EP(e):e;return bi(t.transform)||bi(t.translate)||bi(t.scale)||bi(t.rotate)||bi(t.perspective)||!Yj()&&(bi(t.backdropFilter)||bi(t.filter))||Gj.test(t.willChange||"")||Kj.test(t.contain||"")}function p7(e){let t=$p(e);for(;wd(t)&&!TP(t);){if(qj(t))return t;if(Wj(t))return null;t=$p(t)}return null}function Yj(){return $f==null&&($f=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),$f}function TP(e){return/^(html|body|#document)$/.test(yg(e))}function EP(e){return Yr(e).getComputedStyle(e)}function m7(e){return SP(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $p(e){if(yg(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Vp(e)&&e.host||Hj(e);return Vp(t)?t.host:t}function AP(e){const t=$p(e);return TP(t)?e.ownerDocument?e.ownerDocument.body:e.body:wd(t)&&CP(t)?t:AP(t)}function W_(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=AP(e),s=o===((a=e.ownerDocument)==null?void 0:a.body),l=Yr(o);if(s){const u=Zj(l);return t.concat(l,l.visualViewport||[],CP(o)?o:[],u&&n?W_(u):[])}else return t.concat(o,W_(o,[],n))}function Zj(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ao(e){return e?.ownerDocument||document}const G_={};function Dl(e,t){const n=k.useRef(G_);return n.current===G_&&(n.current=e(t)),n}const Hf=em[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Xj=Hf&&Hf!==k.useLayoutEffect?Hf:e=>e();function An(e){const t=Dl(Qj).current;return t.next=e,Xj(t.effect),t.trampoline}function Qj(){const e={next:void 0,callback:Jj,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Jj(){}let K_=0;function RP(e){return K_+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${K_}`}const e8=[];function LP(e){k.useEffect(e,e8)}const Us=0;class ml{static create(){return new ml}currentId=Us;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Us,n()},t)}isStarted(){return this.currentId!==Us}clear=()=>{this.currentId!==Us&&(clearTimeout(this.currentId),this.currentId=Us)};disposeEffect=()=>this.clear}function g7(){const e=Dl(ml.create).current;return LP(e.disposeEffect),e}const Ko=typeof navigator<"u",Wf=a8(),DP=i8(),IP=r8(),y7=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),v7=Wf.platform==="MacIntel"&&Wf.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Wf.platform),t8=Ko&&/apple/i.test(navigator.vendor),b7=Ko&&/android/i.test(DP)||/android/i.test(IP);Ko&&DP.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const n8=IP.includes("jsdom/");function a8(){if(!Ko)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function r8(){if(!Ko)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function i8(){if(!Ko)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const q_="data-base-ui-focusable",k7="active",_7="selected",o8="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",w7="ArrowLeft",x7="ArrowRight",P7="ArrowUp",S7="ArrowDown";function gl(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Ei(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Vp(n)){let a=t;for(;a;){if(e===a)return!0;a=a.parentNode||a.host}}return!1}function Hp(e){return"composedPath"in e?e.composedPath()[0]:e.target}function C7(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function T7(e){return e.matches("html,body")}function xd(e){return e?.ownerDocument||document}function s8(e){return wd(e)&&e.matches(o8)}function E7(e){return e?e.getAttribute("role")==="combobox"&&s8(e):!1}function Wp(e){if(!e||n8)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function A7(e){return e?e.hasAttribute(q_)?e:e.querySelector(`[${q_}]`)||e:null}function Il(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(a=>n.searchParams.append("args[]",a)),`Base UI error #${e}; visit ${n} for the full message.`}var l8=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],ed=l8.join(","),MP=typeof Element>"u",zo=MP?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,td=!MP&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},nd=function(t,n){var a;n===void 0&&(n=!0);var o=t==null||(a=t.getAttribute)===null||a===void 0?void 0:a.call(t,"inert"),s=o===""||o==="true",l=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):nd(t.parentNode));return l},c8=function(t){var n,a=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return a===""||a==="true"},NP=function(t,n,a){if(nd(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(ed));return n&&zo.call(t,ed)&&o.unshift(t),o=o.filter(a),o},ad=function(t,n,a){for(var o=[],s=Array.from(t);s.length;){var l=s.shift();if(!nd(l,!1))if(l.tagName==="SLOT"){var u=l.assignedElements(),f=u.length?u:l.children,h=ad(f,!0,a);a.flatten?o.push.apply(o,h):o.push({scopeParent:l,candidates:h})}else{var m=zo.call(l,ed);m&&a.filter(l)&&(n||!t.includes(l))&&o.push(l);var y=l.shadowRoot||typeof a.getShadowRoot=="function"&&a.getShadowRoot(l),v=!nd(y,!1)&&(!a.shadowRootFilter||a.shadowRootFilter(l));if(y&&v){var _=ad(y===!0?l.children:y.children,!0,a);a.flatten?o.push.apply(o,_):o.push({scopeParent:l,candidates:_})}else s.unshift.apply(s,l.children)}}return o},OP=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},jP=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||c8(t))&&!OP(t)?0:t.tabIndex},u8=function(t,n){var a=jP(t);return a<0&&n&&!OP(t)?0:a},d8=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},UP=function(t){return t.tagName==="INPUT"},h8=function(t){return UP(t)&&t.type==="hidden"},f8=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(a){return a.tagName==="SUMMARY"});return n},p8=function(t,n){for(var a=0;a<t.length;a++)if(t[a].checked&&t[a].form===n)return t[a]},m8=function(t){if(!t.name)return!0;var n=t.form||td(t),a=function(u){return n.querySelectorAll('input[type="radio"][name="'+u+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=a(window.CSS.escape(t.name));else try{o=a(t.name)}catch(l){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",l.message),!1}var s=p8(o,t.form);return!s||s===t},g8=function(t){return UP(t)&&t.type==="radio"},y8=function(t){return g8(t)&&!m8(t)},v8=function(t){var n,a=t&&td(t),o=(n=a)===null||n===void 0?void 0:n.host,s=!1;if(a&&a!==t){var l,u,f;for(s=!!((l=o)!==null&&l!==void 0&&(u=l.ownerDocument)!==null&&u!==void 0&&u.contains(o)||t!=null&&(f=t.ownerDocument)!==null&&f!==void 0&&f.contains(t));!s&&o;){var h,m,y;a=td(o),o=(h=a)===null||h===void 0?void 0:h.host,s=!!((m=o)!==null&&m!==void 0&&(y=m.ownerDocument)!==null&&y!==void 0&&y.contains(o))}}return s},Y_=function(t){var n=t.getBoundingClientRect(),a=n.width,o=n.height;return a===0&&o===0},b8=function(t,n){var a=n.displayCheck,o=n.getShadowRoot;if(a==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var l=zo.call(t,"details>summary:first-of-type"),u=l?t.parentElement:t;if(zo.call(u,"details:not([open]) *"))return!0;if(!a||a==="full"||a==="full-native"||a==="legacy-full"){if(typeof o=="function"){for(var f=t;t;){var h=t.parentElement,m=td(t);if(h&&!h.shadowRoot&&o(h)===!0)return Y_(t);t.assignedSlot?t=t.assignedSlot:!h&&m!==t.ownerDocument?t=m.host:t=h}t=f}if(v8(t))return!t.getClientRects().length;if(a!=="legacy-full")return!0}else if(a==="non-zero-area")return Y_(t);return!1},k8=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var a=0;a<n.children.length;a++){var o=n.children.item(a);if(o.tagName==="LEGEND")return zo.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Gp=function(t,n){return!(n.disabled||h8(n)||b8(n,t)||f8(n)||k8(n))},Kp=function(t,n){return!(y8(n)||jP(n)<0||!Gp(t,n))},_8=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},BP=function(t){var n=[],a=[];return t.forEach(function(o,s){var l=!!o.scopeParent,u=l?o.scopeParent:o,f=u8(u,l),h=l?BP(o.candidates):u;f===0?l?n.push.apply(n,h):n.push(u):a.push({documentOrder:s,tabIndex:f,item:o,isScope:l,content:h})}),a.sort(d8).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},bg=function(t,n){n=n||{};var a;return n.getShadowRoot?a=ad([t],n.includeContainer,{filter:Kp.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:_8}):a=NP(t,n.includeContainer,Kp.bind(null,n)),BP(a)},R7=function(t,n){n=n||{};var a;return n.getShadowRoot?a=ad([t],n.includeContainer,{filter:Gp.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):a=NP(t,n.includeContainer,Gp.bind(null,n)),a},L7=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return zo.call(t,ed)===!1?!1:Kp(n,t)};const kg=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function zP(e,t){const n=bg(e,kg()),a=n.length;if(a===0)return;const o=gl(xd(e)),s=n.indexOf(o),l=s===-1?t===1?0:a-1:s+t;return n[l]}function w8(e){return zP(xd(e).body,1)||e}function x8(e){return zP(xd(e).body,-1)||e}function FP(e,t){if(!e)return null;const n=bg(xd(e).body,kg()),a=n.length;if(a===0)return null;const o=n.indexOf(e);if(o===-1)return null;const s=(o+t+a)%a;return n[s]}function D7(e){return FP(e,1)}function I7(e){return FP(e,-1)}function Gf(e,t){const n=t||e.currentTarget,a=e.relatedTarget;return!a||!Ei(n,a)}function P8(e){bg(e,kg()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Z_(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const a=n.dataset.tabindex;delete n.dataset.tabindex,a?n.setAttribute("tabindex",a):n.removeAttribute("tabindex")})}const _g=k.createContext(void 0);function wg(){const e=k.useContext(_g);if(!e)throw new Error(Il(73));return e}function Kf(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}const S8=function(t){const{children:n,timeout:a=5e3,limit:o=3,toastManager:s}=t,[l,u]=k.useState([]),[f,h]=k.useState(!1),[m,y]=k.useState(!1),[v,_]=k.useState(null);l.length===0&&(f&&h(!1),m&&y(!1));const x=f||m,S=k.useRef(new Map),C=k.useRef(null),R=k.useRef(!0),M=k.useRef(!1);function E(Q){const ne=gl(Ao(C.current));if(!C.current||!Ei(C.current,ne)||!Wp(ne))return;const J=l.findIndex(z=>z.id===Q);let ee=null,se=J+1;for(;se<l.length;){if(l[se].transitionStatus!=="ending"){ee=l[se];break}se+=1}if(!ee)for(se=J-1;se>=0;){if(l[se].transitionStatus!=="ending"){ee=l[se];break}se-=1}ee?ee.ref?.current?.focus():v?.focus({preventScroll:!0})}const A=An(()=>{M.current||(M.current=!0,S.current.forEach(Q=>{if(Q.timeout){Q.timeout.clear();const ne=Date.now()-Q.start,J=Q.delay-ne;Q.remaining=J>0?J:0}}))}),U=An(()=>{M.current&&(M.current=!1,S.current.forEach((Q,ne)=>{Q.remaining=Q.remaining>0?Q.remaining:Q.delay,Q.timeout??=ml.create(),Q.timeout.start(Q.remaining,()=>{S.current.delete(ne),Q.callback()}),Q.start=Date.now()}))}),F=An(Q=>{u(ee=>{const se=ee.map(q=>q.id===Q?{...q,transitionStatus:"ending",height:0}:q),z=se.filter(q=>q.transitionStatus!=="ending");return se.map(q=>{if(q.transitionStatus==="ending")return q;const V=z.indexOf(q)>=o;return{...q,limited:V}})});const ne=S.current.get(Q);ne&&ne.timeout&&(ne.timeout.clear(),S.current.delete(Q)),l.find(ee=>ee.id===Q)?.onClose?.(),E(Q),l.length===1&&(h(!1),y(!1))}),$=An(Q=>{u(J=>J.filter(ee=>ee.id!==Q)),l.find(J=>J.id===Q)?.onRemove?.()}),P=An((Q,ne,J)=>{const ee=Date.now(),se=R.current&&!f&&!m,z=se?ml.create():void 0;z?.start(ne,()=>{S.current.delete(Q),J()}),S.current.set(Q,{timeout:z,start:se?ee:0,delay:ne,remaining:ne,callback:J})}),Z=An(Q=>{const ne=Q.id||RP("toast"),J={...Q,id:ne,transitionStatus:"starting"};u(se=>{const z=[J,...se],q=z.filter(V=>V.transitionStatus!=="ending");if(q.length>o){const V=q.length-o,D=q.slice(-V);return z.map(W=>D.some(pe=>pe.id===W.id)?{...W,limited:!0}:{...W,limited:!1})}return z.map(V=>({...V,limited:!1}))});const ee=J.timeout??a;return J.type!=="loading"&&ee>0&&P(ne,ee,()=>F(ne)),(f||m||!R.current)&&A(),ne}),X=An((Q,ne)=>{const J=l.find(me=>me.id===Q)??null,ee=J?{...J,...ne}:null;if(Oi.flushSync(()=>{u(me=>me.map(ge=>ge.id===Q?{...ge,...ne}:ge))}),!ee)return;const se=ee.timeout??a,z=J?.timeout??a,q=Object.hasOwn(ne,"timeout"),V=ee.transitionStatus!=="ending"&&ee.type!=="loading"&&se>0,D=S.current.has(Q),W=z!==se,pe=J?.type==="loading";if(!V&&D){S.current.get(Q)?.timeout?.clear(),S.current.delete(Q);return}if(V&&(!D||W||q||pe)){const me=S.current.get(Q);me&&(me.timeout?.clear(),S.current.delete(Q)),P(Q,se,()=>F(Q)),(f||m||!R.current)&&A()}}),fe=An((Q,ne)=>{const J=Kf(ne.loading),ee=Z({...J,type:"loading"}),se=Q.then(z=>{const q=Kf(ne.success,z);return X(ee,{...q,type:"success",timeout:q.timeout}),z}).catch(z=>{const q=Kf(ne.error,z);return X(ee,{...q,type:"error",timeout:q.timeout}),Promise.reject(z)});return{}.hasOwnProperty.call(ne,"setPromise")&&ne.setPromise(se),se});k.useEffect(function(){return s?s[" subscribe"](({action:J,options:ee})=>{const se=ee.id;J==="promise"&&ee.promise?fe(ee.promise,ee):J==="update"&&se?X(se,ee):J==="close"&&se?F(se):Z(ee)}):void 0},[Z,X,P,a,s,fe,F]);const he=k.useMemo(()=>({toasts:l,setToasts:u,hovering:f,setHovering:h,focused:m,setFocused:y,expanded:x,add:Z,close:F,remove:$,update:X,promise:fe,pauseTimers:A,resumeTimers:U,prevFocusElement:v,setPrevFocusElement:_,viewportRef:C,scheduleTimer:P,windowFocusedRef:R}),[Z,F,m,f,x,A,v,fe,$,U,P,l,X]);return T.jsx(_g.Provider,{value:he,children:n})},VP={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},$P={...VP,position:"fixed",top:0,left:0},M7={...VP,position:"absolute"},C8=()=>{},Ml=typeof document<"u"?k.useLayoutEffect:C8,nl=k.forwardRef(function(t,n){const[a,o]=k.useState();Ml(()=>{t8&&o("button")},[]);const s={tabIndex:0,role:a};return T.jsx("span",{...t,ref:n,style:$P,"aria-hidden":a?void 0:!0,...s,"data-base-ui-focus-guard":""})}),T8=k.createContext(void 0);function X_(e,t,n,a){const o=Dl(HP).current;return A8(o,e,t,n,a)&&WP(o,[e,t,n,a]),o.callback}function E8(e){const t=Dl(HP).current;return R8(t,e)&&WP(t,e),t.callback}function HP(){return{callback:null,cleanup:null,refs:[]}}function A8(e,t,n,a,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==a||e.refs[3]!==o}function R8(e,t){return e.refs.length!==t.length||e.refs.some((n,a)=>n!==t[a])}function WP(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const a=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const l=s(n);typeof l=="function"&&(a[o]=l);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const l=a[o];typeof l=="function"?l():s(null);break}case"object":{s.current=null;break}}}}}}}const L8=parseInt(k.version,10);function GP(e){return L8>=e}function Q_(e){if(!k.isValidElement(e))return null;const t=e,n=t.props;return(GP(19)?n?.ref:t.ref)??null}function qp(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function D8(e,t){const n={};for(const a in e){const o=e[a];if(t?.hasOwnProperty(a)){const s=t[a](o);s!=null&&Object.assign(n,s);continue}o===!0?n[`data-${a.toLowerCase()}`]="":o&&(n[`data-${a.toLowerCase()}`]=o.toString())}return n}function I8(e,t){return typeof e=="function"?e(t):e}function M8(e,t){return typeof e=="function"?e(t):e}const al={};function KP(e,t,n,a,o){let s={...Yp(e,al)};return t&&(s=Ws(s,t)),n&&(s=Ws(s,n)),a&&(s=Ws(s,a)),o&&(s=Ws(s,o)),s}function N8(e){if(e.length===0)return al;if(e.length===1)return Yp(e[0],al);let t={...Yp(e[0],al)};for(let n=1;n<e.length;n+=1)t=Ws(t,e[n]);return t}function Ws(e,t){return qP(t)?t(e):O8(e,t)}function O8(e,t){if(!t)return e;for(const n in t){const a=t[n];switch(n){case"style":{e[n]=qp(e.style,a);break}case"className":{e[n]=YP(e.className,a);break}default:j8(n,a)?e[n]=U8(e[n],a):e[n]=a}}return e}function j8(e,t){const n=e.charCodeAt(0),a=e.charCodeAt(1),o=e.charCodeAt(2);return n===111&&a===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function qP(e){return typeof e=="function"}function Yp(e,t){return qP(e)?e(t):e??al}function U8(e,t){return t?e?n=>{if(B8(n)){const o=n;Zp(o);const s=t(o);return o.baseUIHandlerPrevented||e?.(o),s}const a=t(n);return e?.(n),a}:t:e}function Zp(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function YP(e,t){return t?e?t+" "+e:t:e}function B8(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function N7(){}const O7=Object.freeze([]),Vr=Object.freeze({}),j7=500,U7={style:{transition:"none"}},B7="data-base-ui-click-trigger",z7={fallbackAxisSide:"none"},F7={fallbackAxisSide:"end"},z8={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Nl(e,t,n={}){const a=t.render,o=F8(t,n);if(n.enabled===!1)return null;const s=n.state??Vr;return V8(e,a,o,s)}function F8(e,t={}){const{className:n,style:a,render:o}=e,{state:s=Vr,ref:l,props:u,stateAttributesMapping:f,enabled:h=!0}=t,m=h?I8(n,s):void 0,y=h?M8(a,s):void 0,v=h?D8(s,f):Vr,_=h?qp(v,Array.isArray(u)?N8(u):u)??Vr:Vr;return typeof document<"u"&&(h?Array.isArray(l)?_.ref=E8([_.ref,Q_(o),...l]):_.ref=X_(_.ref,Q_(o),l):X_(null,null)),h?(m!==void 0&&(_.className=YP(_.className,m)),y!==void 0&&(_.style=qp(_.style,y)),_):Vr}function V8(e,t,n,a){if(t){if(typeof t=="function")return t(n,a);const o=KP(n,t.props);return o.ref=n.ref,k.cloneElement(t,o)}if(e&&typeof e=="string")return $8(e,n);throw new Error(Il(8))}function $8(e,t){return e==="button"?k.createElement("button",{type:"button",...t,key:t.key}):e==="img"?k.createElement("img",{alt:"",...t,key:t.key}):k.createElement(e,t)}let H8=(function(e){return e.frontmostHeight="--toast-frontmost-height",e})({});const W8=k.forwardRef(function(t,n){const{render:a,className:o,children:s,...l}=t,{toasts:u,pauseTimers:f,resumeTimers:h,setHovering:m,setFocused:y,viewportRef:v,windowFocusedRef:_,prevFocusElement:x,setPrevFocusElement:S,expanded:C,focused:R}=wg(),M=k.useRef(!1),E=k.useRef(!1),A=u.length,U=u[0]?.height??0,F=k.useMemo(()=>u.some(z=>z.transitionStatus==="ending"),[u]);k.useEffect(()=>{if(!v.current)return;function z(V){A!==0&&V.key==="F6"&&V.target!==v.current&&(V.preventDefault(),S(gl(Ao(v.current))),v.current?.focus({preventScroll:!0}),f(),y(!0))}const q=Yr(v.current);return q.addEventListener("keydown",z),()=>{q.removeEventListener("keydown",z)}},[f,y,S,A,v]),k.useEffect(()=>{if(!v.current||!A)return;const z=Yr(v.current);function q(D){D.target===z&&(_.current=!1,f())}function V(D){if(D.relatedTarget||D.target===z)return;const W=Hp(D),pe=gl(Ao(v.current));(!Ei(v.current,W)||!Wp(pe))&&h(),setTimeout(()=>{_.current=!0})}return z.addEventListener("blur",q,!0),z.addEventListener("focus",V,!0),()=>{z.removeEventListener("blur",q,!0),z.removeEventListener("focus",V,!0)}},[f,h,v,_,y,A]),k.useEffect(()=>{const z=v.current;if(!z||A===0)return;const q=Ao(z);function V(D){if(D.pointerType!=="touch")return;const W=Hp(D);Ei(z,W)||(h(),m(!1),y(!1))}return q.addEventListener("pointerdown",V,!0),()=>{q.removeEventListener("pointerdown",V,!0)}},[A,h,y,m,v]);function $(z){v.current&&(M.current=!0,z.relatedTarget===v.current?u[0]?.ref?.current?.focus():x?.focus({preventScroll:!0}))}function P(z){z.key==="Tab"&&z.shiftKey&&z.target===v.current&&(z.preventDefault(),x?.focus({preventScroll:!0}),h())}k.useEffect(()=>{!_.current||F||!E.current||(h(),m(!1),E.current=!1)},[F,h,m,_]);function Z(){f(),m(!0),E.current=!1}function X(){u.some(z=>z.transitionStatus==="ending")?E.current=!0:(h(),m(!1))}function fe(){if(M.current){M.current=!1;return}R||Wp(Ao(v.current).activeElement)&&(y(!0),f())}function he(z){!R||Ei(v.current,z.relatedTarget)||(y(!1),h())}const Q={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:Z,onMouseMove:Z,onMouseLeave:X,onFocus:fe,onBlur:he,onKeyDown:P,onClick:fe},ne=k.useMemo(()=>({expanded:C}),[C]),J=Nl("div",t,{ref:[n,v],state:ne,props:[Q,{style:{[H8.frontmostHeight]:U?`${U}px`:void 0}},l,{children:T.jsxs(k.Fragment,{children:[A>0&&x&&T.jsx(nl,{onFocus:$}),s,A>0&&x&&T.jsx(nl,{onFocus:$})]})}]}),ee=k.useMemo(()=>({viewportRef:v}),[v]),se=k.useMemo(()=>u.filter(z=>z.priority==="high"),[u]);return T.jsxs(T8.Provider,{value:ee,children:[A>0&&x&&T.jsx(nl,{onFocus:$}),J,!R&&se.length>0&&T.jsx("div",{style:$P,children:se.map(z=>T.jsxs("div",{role:"alert","aria-atomic":!0,children:[T.jsx("div",{children:z.title}),T.jsx("div",{children:z.description})]},z.id))})]})});function G8(e){return GP(19)?e:e?"true":void 0}const ZP=k.createContext(void 0);function Xp(){const e=k.useContext(ZP);if(!e)throw new Error(Il(66));return e}let xg=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const K8={[xg.startingStyle]:""},q8={[xg.endingStyle]:""},Y8={transitionStatus(e){return e==="starting"?K8:e==="ending"?q8:null}},tu=null;class Z8{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,a=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,a>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const nu=new Z8;class Pg{static create(){return new Pg}static request(t){return nu.request(t)}static cancel(t){return nu.cancel(t)}currentId=tu;request(t){this.cancel(),this.currentId=nu.request(()=>{this.currentId=tu,t()})}cancel=()=>{this.currentId!==tu&&(nu.cancel(this.currentId),this.currentId=tu)};disposeEffect=()=>this.cancel}function X8(){const e=Dl(Pg.create).current;return LP(e.disposeEffect),e}function Q8(e){return e==null?e:"current"in e?e.current:e}function J8(e,t=!1,n=!0){const a=X8();return An((o,s=null)=>{a.cancel();function l(){Oi.flushSync(o)}const u=Q8(e);if(u==null)return;const f=u;if(typeof f.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)o();else{let h=function(){const y=xg.startingStyle;if(!f.hasAttribute(y)){a.request(m);return}const v=new MutationObserver(()=>{f.hasAttribute(y)||(v.disconnect(),m())});v.observe(f,{attributes:!0,attributeFilter:[y]}),s?.addEventListener("abort",()=>v.disconnect(),{once:!0})},m=function(){Promise.all(f.getAnimations().map(y=>y.finished)).then(()=>{s?.aborted||l()}).catch(()=>{const y=f.getAnimations();if(n){if(s?.aborted)return;l()}else y.length>0&&y.some(v=>v.pending||v.playState!=="finished")&&m()})};if(t){h();return}a.request(m)}})}function eU(e){const{enabled:t=!0,open:n,ref:a,onComplete:o}=e,s=An(o),l=J8(a,n,!1);k.useEffect(()=>{if(!t)return;const u=new AbortController;return l(s,u.signal),()=>{u.abort()}},[t,n,s,l])}let ki=(function(e){return e.index="--toast-index",e.offsetY="--toast-offset-y",e.height="--toast-height",e.swipeMovementX="--toast-swipe-movement-x",e.swipeMovementY="--toast-swipe-movement-y",e})({});const tU={...Y8,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},Bs=40,nU=10,Or=.5,aU=1;function J_(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function rU(e){const n=window.getComputedStyle(e).transform;let a=0,o=0,s=1;if(n&&n!=="none"){const l=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(l){const u=l[1].split(", ").map(parseFloat);u.length===6?(a=u[4],o=u[5],s=Math.sqrt(u[0]*u[0]+u[1]*u[1])):u.length===16&&(a=u[12],o=u[13],s=u[0])}}return{x:a,y:o,scale:s}}const iU=k.forwardRef(function(t,n){const{toast:a,render:o,className:s,swipeDirection:l=["down","right"],...u}=t,f=a.positionerProps?.anchor!==void 0;let h=[];f||(h=Array.isArray(l)?l:[l]);const m=h.length>0,{toasts:y,focused:v,close:_,remove:x,setToasts:S,pauseTimers:C,expanded:R,setHovering:M}=wg(),[E,A]=k.useState(void 0),[U,F]=k.useState(!1),[$,P]=k.useState(!1),[Z,X]=k.useState(!1),[fe,he]=k.useState({x:0,y:0}),[Q,ne]=k.useState({x:0,y:0,scale:1}),[J,ee]=k.useState(),[se,z]=k.useState(),[q,V]=k.useState(null),D=k.useRef(null),W=k.useRef({x:0,y:0}),pe=k.useRef({x:0,y:0,scale:1}),me=k.useRef(void 0),ge=k.useRef(0),xe=k.useRef(!1),ze=k.useRef({x:0,y:0}),Ye=k.useRef(!1),je=k.useMemo(()=>y.indexOf(a),[a,y]),Rt=k.useMemo(()=>y.filter(Ke=>Ke.transitionStatus!=="ending").indexOf(a),[a,y]),Ln=k.useMemo(()=>y.slice(0,y.indexOf(a)).reduce((Ke,Ve)=>Ke+(Ve.height||0),0),[y,a]);eU({open:a.transitionStatus!=="ending",ref:D,onComplete(){a.transitionStatus==="ending"&&x(a.id)}});const wn=An((Ke=!1)=>{const Ve=D.current;if(!Ve)return;const ft=Ve.style.height;Ve.style.height="auto";const St=Ve.offsetHeight;Ve.style.height=ft;function Ot(){S(yt=>yt.map(dt=>dt.id===a.id?{...dt,ref:D,height:St,transitionStatus:void 0}:dt))}Ke?Oi.flushSync(Ot):Ot()});Ml(wn,[wn]);function pt(Ke,Ve){let ft=Ke,St=Ve;return!h.includes("left")&&!h.includes("right")?ft=Ke>0?Ke**Or:-(Math.abs(Ke)**Or):(!h.includes("right")&&Ke>0&&(ft=Ke**Or),!h.includes("left")&&Ke<0&&(ft=-(Math.abs(Ke)**Or))),!h.includes("up")&&!h.includes("down")?St=Ve>0?Ve**Or:-(Math.abs(Ve)**Or):(!h.includes("down")&&Ve>0&&(St=Ve**Or),!h.includes("up")&&Ve<0&&(St=-(Math.abs(Ve)**Or))),{x:ft,y:St}}function Xt(Ke){if(Ke.button!==0)return;Ke.pointerType==="touch"&&C();const Ve=Hp(Ke.nativeEvent);if(!(Ve&&Ve.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'))){if(xe.current=!1,me.current=void 0,ge.current=0,W.current={x:Ke.clientX,y:Ke.clientY},ze.current=W.current,D.current){const St=rU(D.current);pe.current=St,ne(St),he({x:St.x,y:St.y})}M(!0),F(!0),P(!1),V(null),Ye.current=!0,D.current?.setPointerCapture(Ke.pointerId)}}function ei(Ke){if(!U)return;Ke.preventDefault(),Ye.current&&(W.current={x:Ke.clientX,y:Ke.clientY},Ye.current=!1);const{clientY:Ve,clientX:ft,movementX:St,movementY:Ot}=Ke;(Ot<0&&Ve>ze.current.y||Ot>0&&Ve<ze.current.y)&&(ze.current={x:ze.current.x,y:Ve}),(St<0&&ft>ze.current.x||St>0&&ft<ze.current.x)&&(ze.current={x:ft,y:ze.current.y});const yt=ft-W.current.x,dt=Ve-W.current.y,ka=Ve-ze.current.y,qo=ft-ze.current.x;if(!$&&Math.sqrt(yt*yt+dt*dt)>=aU&&(P(!0),q===null)){const ra=h.includes("left")||h.includes("right"),ni=h.includes("up")||h.includes("down");if(ra&&ni){const cr=Math.abs(yt),In=Math.abs(dt);V(cr>In?"horizontal":"vertical")}}let Wt;if(!me.current)q==="vertical"?dt>0?Wt="down":dt<0&&(Wt="up"):q==="horizontal"?yt>0?Wt="right":yt<0&&(Wt="left"):Math.abs(yt)>=Math.abs(dt)?Wt=yt>0?"right":"left":Wt=dt>0?"down":"up",Wt&&h.includes(Wt)&&(me.current=Wt,ge.current=J_(Wt,yt,dt),A(Wt));else{const wa=me.current,ra=J_(wa,qo,ka);ra>Bs?(xe.current=!1,A(wa)):!(h.includes("left")&&h.includes("right"))&&!(h.includes("up")&&h.includes("down"))&&ge.current-ra>=nU&&(xe.current=!0)}const za=pt(yt,dt);let hn=pe.current.x,_a=pe.current.y;q==="horizontal"?(h.includes("left")||h.includes("right"))&&(hn+=za.x):(q==="vertical"||(h.includes("left")||h.includes("right"))&&(hn+=za.x),(h.includes("up")||h.includes("down"))&&(_a+=za.y)),he({x:hn,y:_a})}function Fi(Ke){if(!U)return;if(F(!1),P(!1),V(null),D.current?.releasePointerCapture(Ke.pointerId),xe.current){he({x:Q.x,y:Q.y}),A(void 0);return}let Ve=!1;const ft=fe.x-Q.x,St=fe.y-Q.y;let Ot;for(const yt of h){switch(yt){case"right":ft>Bs&&(Ve=!0,Ot="right");break;case"left":ft<-Bs&&(Ve=!0,Ot="left");break;case"down":St>Bs&&(Ve=!0,Ot="down");break;case"up":St<-Bs&&(Ve=!0,Ot="up");break}if(Ve)break}Ve?(A(Ot),X(!0),_(a.id)):(he({x:Q.x,y:Q.y}),A(void 0))}function Dn(Ke){if(Ke.key==="Escape"){if(!D.current||!Ei(D.current,gl(Ao(D.current))))return;_(a.id)}}k.useEffect(()=>{if(!m)return;const Ke=D.current;if(!Ke)return;function Ve(ft){Ei(Ke,ft.target)&&ft.preventDefault()}return Ke.addEventListener("touchmove",Ve,{passive:!1}),()=>{Ke.removeEventListener("touchmove",Ve)}},[m]);function Vi(){if(!U&&fe.x===Q.x&&fe.y===Q.y&&!Z)return{[ki.swipeMovementX]:"0px",[ki.swipeMovementY]:"0px"};const Ke=fe.x-Q.x,Ve=fe.y-Q.y;return{transition:U?"none":void 0,transform:U?`translateX(${fe.x}px) translateY(${fe.y}px) scale(${Q.scale})`:void 0,[ki.swipeMovementX]:`${Ke}px`,[ki.swipeMovementY]:`${Ve}px`}}const lr=a.priority==="high",ba={role:lr?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":J,"aria-describedby":se,"aria-hidden":lr&&!v?!0:void 0,onPointerDown:m?Xt:void 0,onPointerMove:m?ei:void 0,onPointerUp:m?Fi:void 0,onKeyDown:Dn,inert:G8(a.limited),style:{...Vi(),[ki.index]:a.transitionStatus==="ending"?je:Rt,[ki.offsetY]:`${Ln}px`,[ki.height]:a.height?`${a.height}px`:void 0}},dn=k.useMemo(()=>({rootRef:D,toast:a,titleId:J,setTitleId:ee,descriptionId:se,setDescriptionId:z,swiping:U,swipeDirection:E,recalculateHeight:wn,index:je,visibleIndex:Rt,expanded:R}),[a,J,se,U,E,wn,je,Rt,R]),ti=k.useMemo(()=>({transitionStatus:a.transitionStatus,expanded:R,limited:a.limited||!1,type:a.type,swiping:dn.swiping,swipeDirection:dn.swipeDirection}),[R,a.transitionStatus,a.limited,a.type,dn.swiping,dn.swipeDirection]),$i=Nl("div",t,{ref:[n,dn.rootRef],state:ti,stateAttributesMapping:tU,props:[ba,u]});return T.jsx(ZP.Provider,{value:dn,children:$i})}),oU={...em};let e0=0;function sU(e,t="mui"){const[n,a]=k.useState(e),o=e||n;return k.useEffect(()=>{n==null&&(e0+=1,a(`${t}-${e0}`))},[n,t]),o}const t0=oU.useId;function XP(e,t){if(t0!==void 0){const n=t0();return e??(t?`${t}-${n}`:n)}return sU(e,t)}const lU=k.forwardRef(function(t,n){const{render:a,className:o,id:s,children:l,...u}=t,{toast:f}=Xp(),h=l??f.title,m=!!h,y=XP(s),{setTitleId:v}=Xp();Ml(()=>{if(m)return v(y),()=>{v(void 0)}},[m,y,v]);const _=k.useMemo(()=>({type:f.type}),[f.type]),x=Nl("h2",t,{ref:n,state:_,props:{...u,id:y,children:h}});return m?x:null}),cU=k.createContext(void 0);function uU(e=!1){const t=k.useContext(cU);if(t===void 0&&!e)throw new Error(Il(16));return t}function dU(e){const{focusableWhenDisabled:t,disabled:n,composite:a=!1,tabIndex:o=0,isNativeButton:s}=e,l=a&&t!==!1,u=a&&t===!1;return{props:k.useMemo(()=>{const h={onKeyDown(m){n&&t&&m.key!=="Tab"&&m.preventDefault()}};return a||(h.tabIndex=o,!s&&n&&(h.tabIndex=t?o:-1)),(s&&(t||l)||!s&&n)&&(h["aria-disabled"]=n),s&&(!t||u)&&(h.disabled=n),h},[a,n,t,l,u,s,o])}}function hU(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:a=0,native:o=!0}=e,s=k.useRef(null),l=uU(!0)!==void 0,u=An(()=>{const v=s.current;return!!(v?.tagName==="A"&&v?.href)}),{props:f}=dU({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:a,isNativeButton:o}),h=k.useCallback(()=>{const v=s.current;fU(v)&&l&&t&&f.disabled===void 0&&v.disabled&&(v.disabled=!1)},[t,f.disabled,l]);Ml(h,[h]);const m=k.useCallback((v={})=>{const{onClick:_,onMouseDown:x,onKeyUp:S,onKeyDown:C,onPointerDown:R,...M}=v;return KP({type:o?"button":void 0,onClick(A){if(t){A.preventDefault();return}_?.(A)},onMouseDown(A){t||x?.(A)},onKeyDown(A){if(t||(Zp(A),C?.(A)),A.baseUIHandlerPrevented)return;const U=A.target===A.currentTarget&&!o&&!u()&&!t,F=A.key==="Enter",$=A.key===" ";U&&(($||F)&&A.preventDefault(),F&&_?.(A))},onKeyUp(A){t||(Zp(A),S?.(A)),!A.baseUIHandlerPrevented&&A.target===A.currentTarget&&!o&&!t&&A.key===" "&&_?.(A)},onPointerDown(A){if(t){A.preventDefault();return}R?.(A)}},o?void 0:{role:"button"},f,M)},[t,f,o,u]),y=An(v=>{s.current=v,h()});return{getButtonProps:m,buttonRef:y}}function fU(e){return wd(e)&&e.tagName==="BUTTON"}const pU=k.forwardRef(function(t,n){const{render:a,className:o,disabled:s,nativeButton:l=!0,...u}=t,{close:f,expanded:h}=wg(),{toast:m}=Xp(),[y,v]=k.useState(!1),{getButtonProps:_,buttonRef:x}=hU({disabled:s,native:l}),S=k.useMemo(()=>({type:m.type}),[m.type]);return Nl("button",t,{ref:[n,x],state:S,props:[{"aria-hidden":!h&&!y,onClick(){f(m.id)},onFocus(){v(!0)},onBlur(){v(!1)}},u,_]})}),V7="none",$7="trigger-press",H7="trigger-hover",W7="outside-press",G7="item-press",K7="close-press",mU="focus-out",q7="escape-key",Y7="list-navigation",Z7="cancel-open",X7="imperative-action",Q7="window-resize";function gU(e,t,n,a){let o=!1,s=!1;const l=Vr;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){s=!0},get isCanceled(){return o},get isPropagationAllowed(){return s},trigger:n,...l}}function yU(e){return`data-base-ui-${e}`}const QP=k.createContext(null),vU=()=>k.useContext(QP),bU=yU("portal");function JP(e={}){const{ref:t,container:n,componentProps:a=Vr,elementProps:o,elementState:s}=e,l=XP(),f=vU()?.portalNode,[h,m]=k.useState(null),[y,v]=k.useState(null),_=An(R=>{R!==null&&v(R)}),x=k.useRef(null);Ml(()=>{if(n===null){x.current&&(x.current=null,v(null),m(null));return}if(l==null)return;const R=(n&&(vg(n)?n:n.current))??f??document.body;if(R==null){x.current&&(x.current=null,v(null),m(null));return}x.current!==R&&(x.current=R,v(null),m(R))},[n,f,l]);const S=Nl("div",a,{ref:[t,_],state:s,props:[{id:l,[bU]:""},o]});return{portalNode:y,portalSubtree:h&&S?Oi.createPortal(S,h):null}}const J7=k.forwardRef(function(t,n){const{children:a,container:o,className:s,render:l,renderGuards:u,...f}=t,{portalNode:h,portalSubtree:m}=JP({container:o,ref:n,componentProps:t,elementProps:f}),y=k.useRef(null),v=k.useRef(null),_=k.useRef(null),x=k.useRef(null),[S,C]=k.useState(null),R=S?.modal,M=S?.open,E=typeof u=="boolean"?u:!!S&&!S.modal&&S.open&&!!h;k.useEffect(()=>{if(!h||R)return;function U(F){h&&F.relatedTarget&&Gf(F)&&(F.type==="focusin"?Z_:P8)(h)}return h.addEventListener("focusin",U,!0),h.addEventListener("focusout",U,!0),()=>{h.removeEventListener("focusin",U,!0),h.removeEventListener("focusout",U,!0)}},[h,R]),k.useEffect(()=>{!h||M||Z_(h)},[M,h]);const A=k.useMemo(()=>({beforeOutsideRef:y,afterOutsideRef:v,beforeInsideRef:_,afterInsideRef:x,portalNode:h,setFocusManagerState:C}),[h]);return T.jsxs(k.Fragment,{children:[m,T.jsxs(QP.Provider,{value:A,children:[E&&h&&T.jsx(nl,{"data-type":"outside",ref:y,onFocus:U=>{if(Gf(U,h))_.current?.focus();else{const F=S?S.domReference:null;x8(F)?.focus()}}}),E&&h&&T.jsx("span",{"aria-owns":h.id,style:z8}),h&&Oi.createPortal(a,h),E&&h&&T.jsx(nl,{"data-type":"outside",ref:v,onFocus:U=>{if(Gf(U,h))x.current?.focus();else{const F=S?S.domReference:null;w8(F)?.focus(),S?.closeOnFocusOut&&S?.onOpenChange(!1,gU(mU,U.nativeEvent))}}})]})]})}),kU=k.forwardRef(function(t,n){const{children:a,container:o,className:s,render:l,...u}=t,{portalNode:f,portalSubtree:h}=JP({container:o,ref:n,componentProps:t,elementProps:u});return!h&&!f?null:T.jsxs(k.Fragment,{children:[h,f&&Oi.createPortal(a,f)]})}),_U=kU;function wU(){const e=k.useContext(_g);if(!e)throw new Error(Il(73));const{toasts:t,add:n,close:a,update:o,promise:s}=e;return k.useMemo(()=>({toasts:t,add:n,close:a,update:o,promise:s}),[t,n,a,o,s])}function xU(){const e=[];function t(n){e.forEach(a=>a(n))}return{" subscribe":function(a){return e.push(a),()=>{const o=e.indexOf(a);o!==-1&&e.splice(o,1)}},add(n){const a=n.id||RP("toast"),o={...n,id:a,transitionStatus:"starting"};return t({action:"add",options:o}),a},close(n){t({action:"close",options:{id:n}})},update(n,a){t({action:"update",options:{...a,id:n}})},promise(n,a){let o=n;return t({action:"promise",options:{...a,promise:n,setPromise(s){o=s}}}),o}}}const Sg=xU();function eB(e){return Sg.add(e)}function PU({children:e}){return T.jsxs(S8,{toastManager:Sg,children:[e,T.jsx(_U,{children:T.jsx(W8,{className:"fixed inset-x-0 top-6 z-[100] mx-auto flex w-full max-w-sm flex-col items-center gap-2 px-4 outline-none",children:T.jsx(SU,{})})})]})}function SU(){const{toasts:e}=wU();return e.map(t=>{const n=t.data?.onUndo;return T.jsxs(iU,{toast:t,className:wt("pointer-events-auto flex w-full items-center gap-3 rounded-xl border border-oai-gray-200 bg-oai-white px-4 py-3 shadow-xl transition-all duration-200 ease-out","data-[starting-style]:-translate-y-3 data-[starting-style]:opacity-0","data-[ending-style]:-translate-y-3 data-[ending-style]:opacity-0","dark:border-oai-gray-800 dark:bg-oai-gray-900"),children:[T.jsx(lU,{className:"min-w-0 flex-1 text-sm font-medium text-oai-black dark:text-white"}),n?T.jsx("button",{type:"button",onClick:()=>{n(),Sg.close(t.id)},className:"shrink-0 rounded-md px-2 py-1 text-xs font-semibold text-oai-gray-600 transition-colors hover:bg-oai-gray-100 hover:text-oai-black focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800 dark:hover:text-white",children:De("shared.action.undo")}):null,T.jsx(pU,{"aria-label":De("shared.action.dismiss"),className:"-mr-1 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-oai-gray-400 transition-colors hover:bg-oai-gray-100 hover:text-oai-black focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:hover:bg-oai-gray-800 dark:hover:text-white",children:T.jsx(jm,{className:"h-3.5 w-3.5","aria-hidden":!0})})]},t.id)})}const Cg=Object.freeze(["limits","leaderboard"]),CU=Object.freeze({limits:"/limits",leaderboard:"/leaderboard"}),TU=Object.freeze({limits:()=>Rn(()=>import("./LimitsPage-onwdR9lM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])),leaderboard:()=>Rn(()=>import("./LeaderboardPage-DcdnX8ha.js"),__vite__mapDeps([8,9,10,11,12,13]))}),eS="total",tS=0,n0=20,EU=Object.freeze([10,20,50,100]),AU="tokentracker:leaderboard:pageSize",RU=20,LU=Object.freeze(["dashboard-existing","silent-preload","page-load","manual-refresh"]);let a0=0,Qn;class DU{constructor(t={}){this.limits=null,this.leaderboard=new Map,this.leaderboardMaxEntries=NU(t.leaderboardMaxEntries)}read(t,n){return Ol(t),t==="limits"?!this.limits||this.limits.contextKey!==n?null:Pu(this.limits):n?Pu(this.leaderboard.get(n)):null}write(t,n={}){if(t.targetKey==="limits"){this.limits=t;return}this.leaderboard.has(t.contextKey)&&this.leaderboard.delete(t.contextKey),this.leaderboard.set(t.contextKey,t),this.evictLeaderboardEntries(n.activeContextKey||t.contextKey)}evictLeaderboardEntries(t=null){for(;this.leaderboard.size>this.leaderboardMaxEntries;){const n=Array.from(this.leaderboard.keys()).find(a=>a!==t)||this.leaderboard.keys().next().value;this.leaderboard.delete(n)}}snapshot(){return{limits:Pu(this.limits),leaderboard:{maxEntries:this.leaderboardMaxEntries,size:this.leaderboard.size,keys:Array.from(this.leaderboard.keys())}}}}class IU{constructor(t={}){a0+=1,this.sessionId=`dashboard-preload-${a0}`,this.createdAt=Date.now(),this.completedAt=null,this.startedAfterMainContentVisible=!1,this.cache=new DU(t),this.targets={limits:r0("limits"),leaderboard:r0("leaderboard")}}}function r0(e){return{key:e,route:CU[e],resourceStatus:"idle",stateStatus:"idle",error:null,resourcePromise:null,resourceModule:null,resourceRequestId:0,statePromise:null,stateRequestId:0,pendingStateContextKey:null}}function MU(e={}){return new IU(e)}function NU(e){const t=Number(e);return!Number.isInteger(t)||t<1?RU:t}Qn=MU();function Ol(e){if(!Cg.includes(e))throw new Error(`Unknown dashboard preload target: ${e}`)}function nS(e){return e?typeof e=="string"?e:e.message||String(e):null}function OU(e,t){return LU.includes(e)?e:t}function jU(e){const t=Number(e);return Number.isFinite(t)?t:Date.now()}function Pu(e){return e?{...e}:null}function i0(){const e=Cg.every(t=>{const n=Qn.targets[t];return n.resourceStatus==="fulfilled"||n.resourceStatus==="rejected"});Qn.completedAt=e?Date.now():null}function UU(){Qn.startedAfterMainContentVisible=!0}function Tg(e,t={}){Ol(e);const n=Object.entries(t).filter(([,a])=>a!==void 0).sort(([a],[o])=>a.localeCompare(o)).map(([a,o])=>`${a}=${o===null?"null":String(o)}`);return`${e}:${n.join("|")}`}function BU(e,t={}){Ol(e);const n=Qn.targets[e];if(n.resourceStatus==="fulfilled")return Promise.resolve(n.resourceModule);if(n.resourceStatus==="pending"&&n.resourcePromise)return n.resourcePromise;const a=t.loader||TU[e],o=n.resourceRequestId+1;n.resourceRequestId=o,n.resourceStatus="pending",n.error=null;const s=Promise.resolve().then(()=>a()).then(l=>n.resourceRequestId!==o||n.resourcePromise!==s?null:(n.resourceStatus="fulfilled",n.resourceModule=l,n.error=null,i0(),l)).catch(l=>(n.resourceRequestId!==o||n.resourcePromise!==s||(n.resourceStatus="rejected",n.error=nS(l),i0()),null));return n.resourcePromise=s,s}function zU(e={}){const t=e.loaders||{};return Promise.all(Cg.map(n=>BU(n,{loader:t[n]})))}function aS(e,t){Ol(e);const n=Qn.targets[e],a=t?.status||"fulfilled",o={targetKey:e,status:a,data:t?.data??null,error:nS(t?.error),source:OU(t?.source,"silent-preload"),generatedAt:jU(t?.generatedAt),updatedAt:Date.now(),contextKey:t?.contextKey||Tg(e,t?.context||{})};return n.stateStatus=a,a==="rejected"||a==="skipped"?n.error=o.error:a==="fulfilled"&&(n.error=null,Qn.cache.write(o,{activeContextKey:t?.activeContextKey})),Pu(o)}function rS(e,t){return Ol(e),Qn.cache.read(e,t)}function tB(e,t={}){return aS("limits",{data:e,source:t.source||"dashboard-existing",contextKey:t.contextKey||iS(t.context||{}),generatedAt:t.generatedAt,status:t.status||"fulfilled",error:t.error})}function iS(e={}){return Tg("limits",{state:"current",...e})}function nB(e=iS()){return rS("limits",e)}function Qp(e,t={}){return aS("leaderboard",{activeContextKey:t.activeContextKey,data:e,source:t.source||"silent-preload",contextKey:t.contextKey||Eg(t.context||{}),generatedAt:t.generatedAt,status:t.status||"fulfilled",error:t.error})}function FU(e){return rS("leaderboard",e)}function oS(){if(typeof window>"u")return n0;try{const e=window.localStorage.getItem(AU),t=Number(e);if(EU.includes(t))return t}catch{}return n0}function sS(e={}){const t=e.userId;return t!==void 0?t||null:e.cloudUser?.id||null}function lS(e={}){return typeof e.accessMode=="string"&&e.accessMode.trim()?e.accessMode.trim():e.mockEnabled?"mock":e.baseUrl?"cloud":"unavailable"}function Eg(e={}){const t=!!e.mockEnabled,n=e.baseUrl??"";return Tg("leaderboard",{accessMode:lS({...e,baseUrl:n,mockEnabled:t}),baseUrl:n,mockEnabled:t,offset:e.offset??tS,pageSize:e.pageSize??oS(),period:e.period||eS,userId:sS(e)})}function au(e,t){const n=Qn.targets.leaderboard;return n.stateRequestId+=1,n.statePromise=null,n.pendingStateContextKey=null,Qp(null,{contextKey:t,status:"skipped",error:e})}function VU(e={}){const t=Qn,n=!!e.mockEnabled,a=e.baseUrl??"",o=lS({...e,baseUrl:a,mockEnabled:n}),s=e.period||eS,l=e.pageSize??oS(),u=e.offset??tS,f=sS(e),h=Eg({accessMode:o,baseUrl:a,mockEnabled:n,offset:u,pageSize:l,period:s,userId:f});if(!n&&e.authLoading)return Promise.resolve(au("auth-loading",h));if(!n&&!e.signedIn&&o!=="public")return Promise.resolve(au("not-signed-in",h));if(!n&&!a)return Promise.resolve(au("missing-base-url",h));if(!n&&o==="unavailable")return Promise.resolve(au("access-unavailable",h));const m=t.targets.leaderboard,y=FU(h);if(y)return Promise.resolve(y);if(m.stateStatus==="pending"&&m.statePromise&&m.pendingStateContextKey===h)return m.statePromise;const v=m.stateRequestId+1;m.stateRequestId=v,m.stateStatus="pending",m.pendingStateContextKey=h,m.error=null;const _=Promise.resolve().then(()=>qL({userId:f,period:s,limit:l,offset:u})).then(x=>Qn!==t||m.stateRequestId!==v||m.statePromise!==_?null:(m.pendingStateContextKey=null,Qp(x,{contextKey:h}))).catch(x=>(Qn!==t||m.stateRequestId!==v||m.statePromise!==_||(m.pendingStateContextKey=null,Qp(null,{contextKey:h,status:"rejected",error:x})),null));return m.statePromise=_,_}const $U=typeof window<"u"?window.location.search:"",o0=new URLSearchParams($U),ru=o0.get("insforge_code")||o0.get("code")||null,HU=typeof window<"u"&&!!window.webkit?.messageHandlers?.nativeOAuth;function WU(){Tl();const{loading:e,signedIn:t}=$o(),n=_l(),[a,o]=k.useState("processing"),[s,l]=k.useState(null),u=k.useRef(!1);k.useEffect(()=>{if(!(!ru||u.current)){if(u.current=!0,HU){l(!1);return}(async()=>{try{const m=await(await fetch("/api/auth-bridge/verifier")).json();l(!!m?.native)}catch{l(!1)}})()}},[]),k.useEffect(()=>{if(s!==!0||!ru)return;o("redirecting");const h=setTimeout(()=>{window.location.href=`tokentracker://auth/callback?insforge_code=${encodeURIComponent(ru)}`},200);return()=>clearTimeout(h)},[s]),k.useEffect(()=>{if(s!==!1||e)return;if(t){n("/dashboard",{replace:!0});return}const h=setTimeout(()=>{t||o("failed")},12e3);return()=>clearTimeout(h)},[s,e,t,n]),k.useEffect(()=>{if(!ru&&s===null){const h=setTimeout(()=>o("failed"),3e3);return()=>clearTimeout(h)}},[s]);const f=()=>{n("/dashboard",{replace:!0})};return a==="processing"&&s!==!0&&(s===null||s===!1&&e)?T.jsx("div",{className:"min-h-screen bg-oai-gray-950"}):T.jsx("div",{className:"min-h-screen bg-oai-gray-950 text-white font-oai antialiased dark flex items-center justify-center",children:T.jsxs("div",{className:"text-center space-y-4 max-w-sm px-4",children:[a==="processing"&&T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"w-8 h-8 border-2 border-oai-gray-600 border-t-white rounded-full animate-spin mx-auto"}),T.jsx("p",{className:"text-oai-gray-400 text-sm",children:De("auth.callback.processing")})]}),a==="redirecting"&&T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-green-500/15 flex items-center justify-center",children:T.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:T.jsx("path",{d:"M20 6 9 17l-5-5"})})}),T.jsx("p",{className:"text-white text-sm font-medium",children:De("auth.callback.success")}),T.jsx("p",{className:"text-oai-gray-500 text-xs",children:De("auth.callback.redirecting")})]}),a==="failed"&&T.jsxs("div",{className:"space-y-3",children:[T.jsx("p",{className:"text-oai-gray-300 text-sm",children:De("auth.callback.failed")}),T.jsx("button",{type:"button",onClick:f,className:"px-4 py-2 rounded-lg bg-oai-gray-800 text-sm text-white hover:bg-oai-gray-700 transition-colors",children:De("auth.callback.close")})]})]})})}const GU=k.lazy(()=>Rn(()=>import("./DashboardPage-CzS5TxMe.js"),__vite__mapDeps([14,1,12,15,16,17,11,3,9,10,18,19,4])).then(e=>({default:e.DashboardPage}))),KU=k.lazy(()=>Rn(()=>import("./IpCheckPage-D4FmaQyH.js"),[])),qU=k.lazy(()=>Rn(()=>import("./LandingPage-DLwmI1xA.js"),__vite__mapDeps([20,21,18])).then(e=>({default:e.LandingPage}))),YU=k.lazy(()=>Rn(()=>import("./LeaderboardPage-DcdnX8ha.js"),__vite__mapDeps([8,9,10,11,12,13])).then(e=>({default:e.LeaderboardPage}))),ZU=k.lazy(()=>Rn(()=>import("./LeaderboardProfilePage-CnAg45qs.js"),__vite__mapDeps([22,12,21,23,13,15,16,6,11,17])).then(e=>({default:e.LeaderboardProfilePage}))),XU=k.lazy(()=>Rn(()=>import("./LimitsPage-onwdR9lM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])).then(e=>({default:e.LimitsPage}))),QU=k.lazy(()=>Rn(()=>import("./LoginPage-DZpN9E7q.js"),[]).then(e=>({default:e.LoginPage}))),JU=k.lazy(()=>Rn(()=>import("./DevicePage-DEVImOIW.js"),[])),e9=k.lazy(()=>Rn(()=>import("./WrappedPage-wY4L8E_D.js"),[])),t9=k.lazy(()=>Rn(()=>import("./SettingsPage-D2jlgb1x.js"),__vite__mapDeps([24,2,25,3,11,12,9,10,16,7])).then(e=>({default:e.SettingsPage}))),n9=k.lazy(()=>Rn(()=>import("./SkillsPage-CTVaKIo2.js"),__vite__mapDeps([26,5,6,7,3,17,11,16,12,19,10])).then(e=>({default:e.SkillsPage}))),a9=k.lazy(()=>Rn(()=>import("./WidgetsPage-B67l27g8.js"),__vite__mapDeps([27,9,10,11,25,3,4,6,7])).then(e=>({default:e.WidgetsPage})));function r9(){const{resolvedLocale:e}=Tl(),t=ta(),n=$o();aj();const a=k.useRef(!1),o=k.useRef(!1),s=k.useRef(new Set),l=_n(),u=k.useMemo(()=>typeof window>"u"?!1:Y6(window.location.search),[]),f=t?.pathname||"/",h=new URL(window.location.href),m=h.pathname.replace(/\/+$/,"")||"/",v=m.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,_=h.searchParams.get("token")||null,x=v||_,S=m==="/share"||m==="/share.html"||m.startsWith("/share/"),C=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),R=f.replace(/\/+$/,"")||"/",M=R==="/"||R==="/dashboard",E=R==="/leaderboard",A=R.match(/^\/u\/([^/]+)$/i),U=A?A[1]:null,F=!!(n.enabled&&n.signedIn),$=C||F,P=!1,Z=K6(),X=!$&&!l&&!C,fe=l?"mock":n.loading?"unavailable":F?"cloud":$?"local":"unavailable",he=k.useCallback(()=>{if(!a.current||!l&&n.loading||!l&&!$)return;const me={accessMode:fe,baseUrl:q6(),mockEnabled:l,signedIn:$,authLoading:!!n.loading,userId:F&&n.user?.id||null},ge=Eg(me);s.current.has(ge)||(s.current.add(ge),VU(me))},[F,n.loading,n.user?.id,fe,l,$]),Q=k.useCallback(()=>{M&&(a.current||(a.current=!0,UU()),o.current||(o.current=!0,zU()),he())},[M,he]);k.useEffect(()=>{he()},[he]);const ne=k.useMemo(()=>!n.enabled||!F?null:{getAccessToken:()=>n.getAccessToken(),name:n.displayName||"",userId:n.user?.id||null},[F,n]);let J=C||l||u?"dashboard":"landing";R==="/landing"&&(J="landing"),R==="/dashboard"&&(J="dashboard"),E&&(J="dashboard"),U&&(J="dashboard");const ee=R==="/limits",se=R==="/settings",z=R==="/skills",q=R==="/widgets",V=R==="/ip-check";(ee||se||z||q||V)&&(J="dashboard");let D=GU;U?D=ZU:R==="/leaderboard"?D=YU:ee?D=XU:se?D=t9:z?D=n9:q?D=a9:V&&(D=KU);const W=!S&&!X&&(R==="/dashboard"||R==="/"||E||ee||se||z||q||V);let pe=null;if(R==="/auth/callback"||R==="/auth/native-callback")pe=T.jsx(WU,{});else if(R==="/login")pe=T.jsx(QU,{});else if(R==="/device")pe=T.jsx(JU,{});else if(R==="/wrapped")pe=T.jsx(e9,{});else if(J==="landing")pe=T.jsx(qU,{signInUrl:"/login",signUpUrl:"/login"});else{const me=T.jsx(D,{baseUrl:Z,auth:ne,signedIn:$,sessionSoftExpired:P,signOut:()=>n.enabled?n.signOut():Promise.resolve(),publicMode:S,publicToken:x,userId:U,signInUrl:"/login",signUpUrl:"/login",onMainContentVisible:Q},e);W?pe=T.jsx(kj,{children:me}):pe=me}return T.jsx(GI,{children:T.jsx(YI,{children:T.jsx(PU,{children:T.jsxs(ZI,{children:[T.jsx(k.Suspense,{fallback:null,children:pe}),W?T.jsx($j,{}):null,T.jsx(W6,{}),T.jsx(ZD,{}),T.jsx(sI,{})]})})})})}const i9=dE([{path:"*",element:T.jsx(r9,{})}]);JC.createRoot(document.getElementById("root")).render(T.jsx(rl.StrictMode,{children:T.jsx(AD,{children:T.jsx(OD,{children:T.jsx(JL,{children:T.jsx(xE,{router:i9})})})})}));export{O9 as $,De as A,fu as B,T9 as C,C9 as D,cl as E,WI as F,Y9 as G,B9 as H,y9 as I,g9 as J,G1 as K,sd as L,rj as M,wt as N,yx as O,zj as P,$o as Q,rl as R,Im as S,H6 as T,x9 as U,qL as V,Tl as W,jm as X,Y6 as Y,Fr as Z,Rn as _,Nl as a,KP as a$,E9 as a0,pL as a1,v9 as a2,b9 as a3,tB as a4,j9 as a5,S9 as a6,w9 as a7,H_ as a8,X9 as a9,$9 as aA,o9 as aB,eL as aC,Um as aD,nL as aE,dk as aF,L9 as aG,px as aH,fx as aI,AI as aJ,P9 as aK,jo as aL,Uu as aM,nx as aN,ax as aO,rx as aP,ix as aQ,MI as aR,ma as aS,Zs as aT,q9 as aU,G9 as aV,Il as aW,An as aX,Ml as aY,N7 as aZ,X_ as a_,GM as aa,gt as ab,nn as ac,Ku as ad,Bm as ae,Bo as af,dg as ag,vx as ah,qr as ai,Mk as aj,Oi as ak,ta as al,_l as am,q6 as an,aL as ao,Eg as ap,FU as aq,Qp as ar,f9 as as,Q9 as at,p9 as au,D9 as av,$I as aw,ij as ax,nB as ay,UI as az,gU as b,Yr as b$,Vr as b0,M7 as b1,$P as b2,V7 as b3,eU as b4,Y8 as b5,Fj as b6,t7 as b7,J9 as b8,u7 as b9,Dl as bA,LP as bB,X7 as bC,B7 as bD,nl as bE,I7 as bF,Gf as bG,D7 as bH,w8 as bI,J7 as bJ,F7 as bK,J8 as bL,G8 as bM,wd as bN,ND as bO,Rm as bP,K9 as bQ,pd as bR,W9 as bS,P7 as bT,S7 as bU,w7 as bV,x7 as bW,X8 as bX,s8 as bY,W_ as bZ,Hj as b_,d7 as ba,h7 as bb,OI as bc,e7 as bd,n7 as be,eB as bf,a7 as bg,s7 as bh,r7 as bi,i7 as bj,o7 as bk,c7 as bl,l7 as bm,g7 as bn,yU as bo,o8 as bp,H7 as bq,xd as br,Hp as bs,SP as bt,Ei as bu,ml as bv,$7 as bw,q7 as bx,j7 as by,mU as bz,an as c,Zj as c0,EP as c1,Yj as c2,Wj as c3,$p as c4,TP as c5,f7 as c6,qj as c7,p7 as c8,yg as c9,C7 as cA,Jp as cB,GP as cC,Pg as cD,q_ as cE,k7 as cF,_7 as cG,xg as cH,v7 as cI,M9 as cJ,N9 as cK,I9 as cL,ir as cM,CP as ca,m7 as cb,XP as cc,A7 as cd,E7 as ce,gl as cf,Y7 as cg,O7 as ch,Ao as ci,W7 as cj,Z7 as ck,z7 as cl,U7 as cm,y7 as cn,Q7 as co,G7 as cp,b7 as cq,n8 as cr,vU as cs,bg as ct,kg as cu,Q8 as cv,x8 as cw,L7 as cx,R7 as cy,T7 as cz,K7 as d,qO as e,m9 as f,Kw as g,lL as h,_n as i,T as j,H9 as k,xL as l,tl as m,PL as n,z9 as o,_9 as p,R9 as q,k as r,F9 as s,V9 as t,hU as u,k9 as v,xt as w,A9 as x,U9 as y,Gw as z};