@ipv9/tokentracker-cli 0.39.0 → 0.39.2
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.
- package/README.md +22 -139
- package/dashboard/dist/assets/{ActivityHeatmap-BxBGHY1z.js → ActivityHeatmap-COavTMVP.js} +1 -1
- package/dashboard/dist/assets/{Card-GROxUc_6.js → Card-BblP5ok2.js} +1 -1
- package/dashboard/dist/assets/DashboardPage-BPavH2-4.js +19 -0
- package/dashboard/dist/assets/{DevicePage-CQts7ivB.js → DevicePage-DG0T2vaG.js} +1 -1
- package/dashboard/dist/assets/{DialogTitle-DqFsk26U.js → DialogTitle-1y4WEerV.js} +1 -1
- package/dashboard/dist/assets/{FadeIn-HBBXW_3q.js → FadeIn-jKUQWO7U.js} +1 -1
- package/dashboard/dist/assets/InsforgeUserHeaderControls-IDtiw2Wd.js +1 -0
- package/dashboard/dist/assets/{IpCheckPage-Cn0l8-BQ.js → IpCheckPage-BPDbZ-Os.js} +1 -1
- package/dashboard/dist/assets/{LandingPage-CmV1BMU4.js → LandingPage-DdhGPdVl.js} +177 -177
- package/dashboard/dist/assets/{LeaderboardAvatar-CiIpWZwb.js → LeaderboardAvatar-BJhQZmam.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardPage-BU0mlR3g.js → LeaderboardPage-CWL3PHJa.js} +3 -3
- package/dashboard/dist/assets/{LeaderboardProfileModal-C49_3Xm9.js → LeaderboardProfileModal-CeJVFnE_.js} +3 -3
- package/dashboard/dist/assets/LeaderboardProfilePage-BHkeWk6I.js +1 -0
- package/dashboard/dist/assets/{LimitsPage-fZAmwLWT.js → LimitsPage-DQ7MqbRV.js} +2 -2
- package/dashboard/dist/assets/{LocalOnlyNotice-D3rQdA-P.js → LocalOnlyNotice-Bs4XyBee.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-enO4XP-c.js → LoginPage-Bkwx4LK-.js} +1 -1
- package/dashboard/dist/assets/PopoverPopup-WfaurCS6.js +1 -0
- package/dashboard/dist/assets/{Select-tT9x4ntD.js → Select-C3Uz7WKE.js} +1 -1
- package/dashboard/dist/assets/{SelectItemText-C7F7eIm0.js → SelectItemText-6pJJg6UW.js} +1 -1
- package/dashboard/dist/assets/SettingsPage-CofXaEmG.js +1 -0
- package/dashboard/dist/assets/{SkillsPage-DEu7FY-2.js → SkillsPage-BAJT9ekc.js} +1 -1
- package/dashboard/dist/assets/{WidgetsPage-DGcO7rbp.js → WidgetsPage-Be8VGxtC.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-D_1ID213.js → WrappedPage-ByYPGIH0.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-DNLo92Ba.js → arrow-up-right-D-qqGuaL.js} +1 -1
- package/dashboard/dist/assets/{download-DbBBBpJF.js → download-CioezpA9.js} +1 -1
- package/dashboard/dist/assets/{info-Bh5qTz6k.js → info-DEPCiLwq.js} +1 -1
- package/dashboard/dist/assets/main-BIMrhne9.js +971 -0
- package/dashboard/dist/assets/main-BWDGptcQ.css +1 -0
- package/dashboard/dist/assets/{use-limits-display-prefs-B4iJ-bBc.js → use-limits-display-prefs-718ayTOP.js} +1 -1
- package/dashboard/dist/assets/{use-native-settings-DHjPFDv8.js → use-native-settings-CYvlJmCL.js} +1 -1
- package/dashboard/dist/assets/use-spring-CjxUbIJ2.js +1 -0
- package/dashboard/dist/assets/{use-usage-limits-odqe9OY7.js → use-usage-limits-DuxnBkoi.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-BsSZiZMP.js → useCurrency-B7JRWfUs.js} +1 -1
- package/dashboard/dist/assets/{useOpenInteractionType-BQhgq4rv.js → useOpenInteractionType-BeY2HQjO.js} +2 -2
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist/share.html +2 -2
- package/package.json +15 -7
- package/scripts/install-local-service.sh +2 -1
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/dashboard/dist/assets/DashboardPage-BZ5VFoBk.js +0 -19
- package/dashboard/dist/assets/HeaderGithubStar-COD2HfaF.js +0 -1
- package/dashboard/dist/assets/LeaderboardProfilePage-Bh1n0BAM.js +0 -1
- package/dashboard/dist/assets/PopoverPopup-pitJEpN1.js +0 -1
- package/dashboard/dist/assets/SettingsPage-pDasZNU2.js +0 -1
- package/dashboard/dist/assets/agent-logos-DXQVg1xy.js +0 -1
- package/dashboard/dist/assets/main-BIY3Nj6I.js +0 -969
- package/dashboard/dist/assets/main-G_F9Iu_x.css +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,ay as c,j as t}from"./main-BIY3Nj6I.js";function u({repo:r="mm7894215/TokenTracker"}){const[a,o]=s.useState(null);return s.useEffect(()=>{if(typeof window>"u")return;const n=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,i=typeof document<"u"&&(document.documentElement?.classList.contains("screenshot-capture")||document.body?.classList.contains("screenshot-capture"));c({prefersReducedMotion:n,screenshotCapture:i})&&fetch(`https://api.github.com/repos/${r}`).then(e=>e.json()).then(e=>{e&&typeof e.stargazers_count=="number"&&o(e.stargazers_count)}).catch(()=>{})},[r]),t.jsxs("a",{href:`https://github.com/${r}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-2 px-3 py-1.5 rounded-md border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-800 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-700 transition-colors no-underline",children:[t.jsx("svg",{height:"16",viewBox:"0 0 16 16",width:"16",className:"shrink-0 fill-oai-gray-700 dark:fill-oai-gray-300",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",{className:"text-xs font-medium text-oai-gray-700 dark:text-oai-gray-300 whitespace-nowrap",children:"Star"}),a!==null&&t.jsx("span",{className:"text-xs font-semibold text-oai-gray-900 dark:text-oai-white tabular-nums whitespace-nowrap",children:a})]})}export{u as H};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as d,j as e,M as j,O as w,Q as N,L as k,ax as L,A as s,a8 as I}from"./main-BIY3Nj6I.js";import{u as M}from"./useCurrency-BsSZiZMP.js";import{H as T}from"./HeaderGithubStar-COD2HfaF.js";import{useLeaderboardProfileData as C,ProfileSkeleton as _,ProfileContent as E}from"./LeaderboardProfileModal-C49_3Xm9.js";import"./LeaderboardAvatar-CiIpWZwb.js";import"./ActivityHeatmap-BxBGHY1z.js";import"./info-Bh5qTz6k.js";import"./arrow-up-right-DNLo92Ba.js";import"./useOpenInteractionType-BQhgq4rv.js";import"./DialogTitle-DqFsk26U.js";const l=18;function y(){return e.jsxs("svg",{"aria-hidden":!0,width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"4"}),e.jsx("path",{d:"M12 2v2"}),e.jsx("path",{d:"M12 20v2"}),e.jsx("path",{d:"m4.93 4.93 1.41 1.41"}),e.jsx("path",{d:"m17.66 17.66 1.41 1.41"}),e.jsx("path",{d:"M2 12h2"}),e.jsx("path",{d:"M20 12h2"}),e.jsx("path",{d:"m6.34 17.66-1.41 1.41"}),e.jsx("path",{d:"m19.07 4.93-1.41 1.41"})]})}function v(){return e.jsx("svg",{"aria-hidden":!0,width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})}function S(){return e.jsxs("svg",{"aria-hidden":!0,width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),e.jsx("path",{d:"M8 21h8"}),e.jsx("path",{d:"M12 17v4"})]})}const P=[{value:"light",label:"Light",Icon:y},{value:"dark",label:"Dark",Icon:v},{value:"system",label:"System",Icon:S}];function O(a){return a==="dark"?v:y}function A({theme:a,resolvedTheme:h,onSetTheme:g,className:m="",direction:u="down",align:p="right"}){const[o,x]=d.useState(!1),c=d.useRef(null),n=d.useCallback(()=>x(!1),[]);d.useEffect(()=>{if(!o)return;const r=i=>{c.current&&!c.current.contains(i.target)&&n()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[o,n]),d.useEffect(()=>{if(!o)return;const r=i=>{i.key==="Escape"&&n()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[o,n]);const b=O(h);return e.jsxs("div",{ref:c,className:`relative ${m}`,children:[e.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":o,onClick:()=>x(r=>!r),className:"flex items-center justify-center w-9 h-9 rounded-lg text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors",children:e.jsx(b,{})}),o&&e.jsx("div",{className:`absolute 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 ${u==="up"?"bottom-full mb-1":"top-full mt-1"} ${p==="left"?"left-0":"right-0"}`,children:P.map(({value:r,label:i,Icon:f})=>{const t=a===r;return e.jsxs("button",{type:"button",onClick:()=>{g(r),n()},className:`flex w-full items-center gap-2.5 px-3 py-2 text-sm transition-colors ${t?"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:[e.jsx(f,{}),e.jsx("span",{children:i})]},r)})})]})}function U({auth:a,signedIn:h,sessionSoftExpired:g,userId:m}){const{currency:u,rate:p}=M(),{theme:o,resolvedTheme:x,setTheme:c}=j(),{openLoginModal:n}=w(),{signedIn:b,loading:r}=N(),i=h&&!g,f=d.useMemo(()=>i&&(typeof a=="function"||typeof a=="string"||a&&typeof a=="object")?a:null,[a,i]),t=C({userId:m,period:"total",accessToken:f});return e.jsxs("div",{className:"flex flex-col min-h-screen bg-oai-gray-50 dark:bg-oai-gray-950 text-oai-black dark:text-oai-white font-oai antialiased transition-colors duration-200",children:[e.jsx("header",{className:"sticky top-0 z-50 w-full px-4 pt-4 pb-2 transition-all duration-300 pointer-events-none",children:e.jsxs("div",{className:"mx-auto max-w-3xl rounded-2xl border border-oai-gray-200/50 dark:border-white/10 bg-white/75 dark:bg-oai-gray-950/60 backdrop-blur-xl shadow-[0_8px_30px_rgb(0,0,0,0.04)] dark:shadow-[0_8px_30px_rgb(0,0,0,0.3)] flex h-14 items-center justify-between px-3 sm:px-4 pointer-events-auto transition-all duration-300",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(k,{to:"/",className:"flex items-center gap-3 no-underline outline-none rounded-md focus-visible:ring-2 focus-visible:ring-indigo-500 transition-opacity hover:opacity-80 active:scale-95",children:[e.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),e.jsx("span",{className:"text-sm font-semibold tracking-wide text-oai-black dark:text-white uppercase",children:"Token Tracker"})]}),e.jsx("div",{className:"hidden sm:block scale-90 origin-left opacity-90 hover:opacity-100 transition-opacity",children:e.jsx(T,{})})]}),e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[e.jsxs(k,{to:"/leaderboard",className:"group no-underline inline-flex items-center gap-1.5 h-8 px-3 text-xs font-bold rounded-lg border border-oai-gray-200 dark:border-white/10 bg-transparent text-oai-gray-700 dark:text-oai-gray-300 hover:bg-oai-gray-100 dark:hover:bg-white/5 hover:text-oai-black dark:hover:text-white transition-all duration-200 active:scale-95 shadow-sm",children:[e.jsx(L,{size:13,strokeWidth:2.5,"aria-hidden":!0,className:"transition-transform duration-150 ease-out group-hover:scale-110 group-hover:rotate-6"}),e.jsx("span",{children:s("leaderboard.profile.nav.back")})]}),r?e.jsx("div",{className:"h-8 w-16 animate-pulse rounded-lg bg-oai-gray-200 dark:bg-white/10","aria-hidden":!0}):b?e.jsx(I,{}):e.jsx("button",{type:"button",onClick:n,className:"inline-flex h-8 min-w-[76px] items-center justify-center rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-all duration-200 active:scale-[0.98] select-none text-xs font-bold shadow-sm",children:s("header.auth.sign_in_aria")})]})]})}),e.jsx("main",{className:"flex-1 pt-4 pb-10 sm:pt-6 sm:pb-16",children:e.jsx("div",{className:"mx-auto max-w-2xl px-4 sm:px-6",children:e.jsxs("div",{className:"rounded-2xl bg-white dark:bg-oai-gray-950 ring-1 ring-oai-gray-200 dark:ring-oai-gray-800 overflow-hidden shadow-sm dark:shadow-none",children:[t.loading&&e.jsx(_,{variant:"page"}),!t.loading&&t.error&&e.jsx("div",{className:"px-6 py-16 text-center",children:e.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:s("leaderboard.profile_modal.error")})}),!t.loading&&!t.error&&!t.data&&e.jsx("div",{className:"px-6 py-16 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:s("leaderboard.profile_modal.empty")})}),!t.loading&&!t.error&&t.data&&e.jsx(E,{data:t.data,currency:u,rate:p,variant:"page"})]})})}),e.jsx("footer",{className:"border-t border-oai-gray-200 dark:border-oai-gray-900 py-8 transition-colors duration-200",children:e.jsxs("div",{className:"mx-auto flex max-w-2xl items-center justify-between px-4 sm:px-6 text-sm text-oai-gray-400 dark:text-oai-gray-500",children:[e.jsx("p",{children:s("landing.v2.footer.line")}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(A,{theme:o,resolvedTheme:x,onSetTheme:c,direction:"up",align:"right"}),e.jsx(k,{to:"/leaderboard",className:"text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:s("leaderboard.profile.nav.back")})]})]})})]})}export{U as LeaderboardProfilePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as ve,r,bn as me,bo as Fe,bp as we,aX as $,b as W,bq as U,br as te,bs as Re,aY as ae,bt as de,bu as Q,ak as ne,bv as Te,aW as re,bw as ue,bx as Le,by as Ae,bz as le,bA as He,bB as je,j as V,bC as Be,u as De,a as pe,bD as Ne,bE as he,bF as _e,bG as Ye,bH as Ge,bI as Ve,bJ as Xe,bK as Ke,bL as Ue,bM as qe,b4 as We,bN as $e,b5 as ze}from"./main-BIY3Nj6I.js";import{i as oe,c as Ce,d as Pe,e as se,g as Je,R as Qe,P as Ze,f as q,F as et,h as tt,j as nt,k as ot,l as Se,u as rt,p as st,t as it,m as ct,I as at,n as ut,o as Oe,q as lt,r as ft}from"./useOpenInteractionType-BQhgq4rv.js";import{p as dt,f as pt,g as gt,h as mt,i as ht,j as Et,k as bt}from"./DialogTitle-DqFsk26U.js";import{p as vt,q as Rt,r as ye,t as Tt,v as Ct}from"./SelectItemText-C7F7eIm0.js";const Pt=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Xt=ve("chevron-right",Pt);const St=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Kt=ve("loader-circle",St);function ie(o,e,t){if(t&&!oe(t))return 0;if(typeof o=="number")return o;if(typeof o=="function"){const l=o();return typeof l=="number"?l:l?.[e]}return o?.[e]}const fe=Fe("safe-polygon"),Ot=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${we}`;function yt(o){return o?!!o.closest(Ot):!1}function Ie(o){const e=r.useRef(void 0),t=r.useRef(!1),l=r.useRef(void 0),E=r.useRef(!0),g=r.useRef(!1),v=r.useRef(()=>{}),k=r.useRef(!1),s=me(),P=me(),i=r.useRef(void 0);return r.useMemo(()=>{const a=o.context.dataRef.current;return a.hoverInteractionState||(a.hoverInteractionState={pointerTypeRef:e,interactedInsideRef:t,handlerRef:l,blockMouseMoveRef:E,performedPointerEventsMutationRef:g,unbindMouseMoveRef:v,restTimeoutPendingRef:k,openChangeTimeout:s,restTimeout:P,handleCloseOptionsRef:i}),a.hoverInteractionState},[o,e,t,l,E,g,v,k,s,P,i])}const It=new Set(["click","mousedown"]);function Mt(o,e={}){const t="rootStore"in o?o.rootStore:o,l=t.useState("open"),E=t.useState("floatingElement"),g=t.useState("domReferenceElement"),{dataRef:v}=t.context,{enabled:k=!0,closeDelay:s=0,externalTree:P}=e,{pointerTypeRef:i,interactedInsideRef:a,handlerRef:L,performedPointerEventsMutationRef:H,unbindMouseMoveRef:F,restTimeoutPendingRef:u,openChangeTimeout:I,handleCloseOptionsRef:D}=Ie(t),f=Ce(P),B=Pe(),M=$(()=>a.current?!0:v.current.openEvent?It.has(v.current.openEvent.type):!1),x=$(()=>{const m=v.current.openEvent?.type;return m?.includes("mouse")&&m!=="mousedown"}),O=r.useCallback((m,w=!0)=>{const c=xt(s,i.current);c&&!L.current?I.start(c,()=>t.setOpen(!1,W(U,m))):w&&(I.clear(),t.setOpen(!1,W(U,m)))},[s,L,t,i,I]),T=$(()=>{F.current(),L.current=void 0}),_=$(()=>{if(H.current){const m=te(E).body;m.style.pointerEvents="",m.removeAttribute(fe),H.current=!1}}),N=$(m=>{const w=Re(m);if(!yt(w)){a.current=!1;return}a.current=!0});ae(()=>{l||(i.current=void 0,u.current=!1,a.current=!1,T(),_())},[l,i,u,a,T,_]),r.useEffect(()=>()=>{T()},[T]),r.useEffect(()=>_,[_]),ae(()=>{if(k&&l&&D.current?.blockPointerEvents&&x()&&de(g)&&E){H.current=!0;const m=te(E).body;m.setAttribute(fe,"");const w=g,c=E,n=f?.nodesRef.current.find(y=>y.id===B)?.context?.elements.floating;return n&&(n.style.pointerEvents=""),m.style.pointerEvents="none",w.style.pointerEvents="auto",c.style.pointerEvents="auto",()=>{m.style.pointerEvents="",w.style.pointerEvents="",c.style.pointerEvents=""}}},[k,l,g,E,D,x,f,B,H]),r.useEffect(()=>{if(!k)return;function m(y){if(M()||!v.current.floatingContext||!t.select("open"))return;const S=t.context.triggerElements;y.relatedTarget&&S.hasElement(y.relatedTarget)||(_(),T(),M()||O(y))}function w(y){I.clear(),_(),L.current?.(y),T()}function c(y){M()||O(y,!1)}const n=E;return n&&(n.addEventListener("mouseleave",m),n.addEventListener("mouseenter",w),n.addEventListener("mouseleave",c),n.addEventListener("pointerdown",N,!0)),()=>{n&&(n.removeEventListener("mouseleave",m),n.removeEventListener("mouseenter",w),n.removeEventListener("mouseleave",c),n.removeEventListener("pointerdown",N,!0))}})}function xt(o,e){return e&&!oe(e)?0:typeof o=="function"?o():o}function ce(o){return typeof o=="function"?o():o}const kt={current:null};function Ft(o,e={}){const t="rootStore"in o?o.rootStore:o,{dataRef:l,events:E}=t.context,{enabled:g=!0,delay:v=0,handleClose:k=null,mouseOnly:s=!1,restMs:P=0,move:i=!0,triggerElementRef:a=kt,externalTree:L,isActiveTrigger:H=!0}=e,F=Ce(L),{pointerTypeRef:u,interactedInsideRef:I,handlerRef:D,blockMouseMoveRef:f,performedPointerEventsMutationRef:B,unbindMouseMoveRef:M,restTimeoutPendingRef:x,openChangeTimeout:O,restTimeout:T,handleCloseOptionsRef:_}=Ie(t),N=se(k),m=se(v),w=se(P);H&&(_.current=N.current?.__options);const c=$(()=>I.current?!0:l.current.openEvent?["click","mousedown"].includes(l.current.openEvent.type):!1),n=r.useCallback((d,p=!0)=>{const R=ie(m.current,"close",u.current);R&&!D.current?O.start(R,()=>t.setOpen(!1,W(U,d))):p&&(O.clear(),t.setOpen(!1,W(U,d)))},[m,D,t,u,O]),y=$(()=>{M.current(),D.current=void 0}),S=$(()=>{if(B.current){const d=te(t.select("domReferenceElement")).body;d.style.pointerEvents="",d.removeAttribute(fe),B.current=!1}});r.useEffect(()=>{if(!g)return;function d(p){p.open||(O.clear(),T.clear(),f.current=!0,x.current=!1)}return E.on("openchange",d),()=>{E.off("openchange",d)}},[g,E,O,T,f,x]);const G=$(d=>{if(c()||!l.current.floatingContext)return;const p=t.context.triggerElements;if(d.relatedTarget&&p.hasElement(d.relatedTarget))return;const R=a.current;N.current?.({...l.current.floatingContext,tree:F,x:d.clientX,y:d.clientY,onClose(){S(),y(),!c()&&R===t.select("domReferenceElement")&&n(d)}})(d)});return r.useEffect(()=>{if(!g)return;const d=a.current??(H?t.select("domReferenceElement"):null);if(!de(d))return;function p(C){if(O.clear(),f.current=!1,s&&!oe(u.current)||ce(w.current)>0&&!ie(m.current,"open"))return;const A=ie(m.current,"open",u.current),Y=t.select("domReferenceElement"),b=t.context.triggerElements,K=(b.hasElement(C.target)||b.hasMatchingElement(J=>Q(J,C.target)))&&(!Y||!Q(Y,C.target)),h=C.currentTarget??null,j=t.select("open"),z=!j||K;K&&j?t.setOpen(!0,W(U,C,h)):A?O.start(A,()=>{z&&t.setOpen(!0,W(U,C,h))}):z&&t.setOpen(!0,W(U,C,h))}function R(C){if(c()){S();return}M.current();const A=t.select("domReferenceElement"),Y=te(A);T.clear(),x.current=!1;const b=t.context.triggerElements;if(C.relatedTarget&&b.hasElement(C.relatedTarget))return;if(N.current&&l.current.floatingContext){t.select("open")||O.clear();const h=a.current;D.current=N.current({...l.current.floatingContext,tree:F,x:C.clientX,y:C.clientY,onClose(){S(),y(),!c()&&h===t.select("domReferenceElement")&&n(C,!0)}});const j=D.current;j(C),Y.addEventListener("mousemove",j),M.current=()=>{Y.removeEventListener("mousemove",j)};return}(u.current!=="touch"||!Q(t.select("floatingElement"),C.relatedTarget))&&n(C)}function X(C){G(C)}return t.select("open")&&d.addEventListener("mouseleave",X),i&&d.addEventListener("mousemove",p,{once:!0}),d.addEventListener("mouseenter",p),d.addEventListener("mouseleave",R),()=>{d.removeEventListener("mouseleave",X),i&&d.removeEventListener("mousemove",p),d.removeEventListener("mouseenter",p),d.removeEventListener("mouseleave",R)}},[y,S,f,l,m,n,t,g,N,G,H,c,s,i,u,w,T,x,O,a,F,M,D]),r.useMemo(()=>{function d(p){u.current=p.pointerType}return{onPointerDown:d,onPointerEnter:d,onMouseMove(p){const{nativeEvent:R}=p,X=p.currentTarget,C=t.select("domReferenceElement"),A=t.context.triggerElements,Y=t.select("open"),b=(A.hasElement(p.target)||A.hasMatchingElement(h=>Q(h,p.target)))&&(!C||!Q(C,p.target));if(s&&!oe(u.current)||Y&&!b||ce(w.current)===0||!b&&x.current&&p.movementX**2+p.movementY**2<2)return;T.clear();function K(){if(x.current=!1,c())return;const h=t.select("open");!f.current&&(!h||b)&&t.setOpen(!0,W(U,R,X))}u.current==="touch"?ne.flushSync(()=>{K()}):b&&Y?K():(x.current=!0,T.start(ce(w.current),K))}}},[f,c,s,t,u,w,T,x])}function Ee(o,e){const[t,l]=o;let E=!1;const g=e.length;for(let v=0,k=g-1;v<g;k=v++){const[s,P]=e[v]||[0,0],[i,a]=e[k]||[0,0];P>=l!=a>=l&&t<=(i-s)*(l-P)/(a-P)+s&&(E=!E)}return E}function wt(o,e){return o[0]>=e.x&&o[0]<=e.x+e.width&&o[1]>=e.y&&o[1]<=e.y+e.height}function Lt(o={}){const{buffer:e=.5,blockPointerEvents:t=!1,requireIntent:l=!0}=o,E=new Te;let g=!1,v=null,k=null,s=typeof performance<"u"?performance.now():0;function P(a,L){const H=performance.now(),F=H-s;if(v===null||k===null||F===0)return v=a,k=L,s=H,null;const u=a-v,I=L-k,f=Math.sqrt(u*u+I*I)/F;return v=a,k=L,s=H,f}const i=({x:a,y:L,placement:H,elements:F,onClose:u,nodeId:I,tree:D})=>function(B){function M(){E.clear(),u()}if(E.clear(),!F.domReference||!F.floating||H==null||a==null||L==null)return;const{clientX:x,clientY:O}=B,T=[x,O],_=Re(B),N=B.type==="mouseleave",m=Q(F.floating,_),w=Q(F.domReference,_),c=F.domReference.getBoundingClientRect(),n=F.floating.getBoundingClientRect(),y=H.split("-")[0],S=a>n.right-n.width/2,G=L>n.bottom-n.height/2,d=wt(T,c),p=n.width>c.width,R=n.height>c.height,X=(p?c:n).left,C=(p?c:n).right,A=(R?c:n).top,Y=(R?c:n).bottom;if(m&&(g=!0,!N))return;if(w&&(g=!1),w&&!N){g=!0;return}if(N&&de(B.relatedTarget)&&Q(F.floating,B.relatedTarget)||D&&Je(D.nodesRef.current,I).some(({context:h})=>h?.open))return;if(y==="top"&&L>=c.bottom-1||y==="bottom"&&L<=c.top+1||y==="left"&&a>=c.right-1||y==="right"&&a<=c.left+1)return M();let b=[];switch(y){case"top":b=[[X,c.top+1],[X,n.bottom-1],[C,n.bottom-1],[C,c.top+1]];break;case"bottom":b=[[X,n.top+1],[X,c.bottom-1],[C,c.bottom-1],[C,n.top+1]];break;case"left":b=[[n.right-1,Y],[n.right-1,A],[c.left+1,A],[c.left+1,Y]];break;case"right":b=[[c.right-1,Y],[c.right-1,A],[n.left+1,A],[n.left+1,Y]];break}function K([h,j]){switch(y){case"top":{const z=[p?h+e/2:S?h+e*4:h-e*4,j+e+1],J=[p?h-e/2:S?h+e*4:h-e*4,j+e+1],Z=[[n.left,S||p?n.bottom-e:n.top],[n.right,S?p?n.bottom-e:n.top:n.bottom-e]];return[z,J,...Z]}case"bottom":{const z=[p?h+e/2:S?h+e*4:h-e*4,j-e],J=[p?h-e/2:S?h+e*4:h-e*4,j-e],Z=[[n.left,S||p?n.top+e:n.bottom],[n.right,S?p?n.top+e:n.bottom:n.top+e]];return[z,J,...Z]}case"left":{const z=[h+e+1,R?j+e/2:G?j+e*4:j-e*4],J=[h+e+1,R?j-e/2:G?j+e*4:j-e*4];return[...[[G||R?n.right-e:n.left,n.top],[G?R?n.right-e:n.left:n.right-e,n.bottom]],z,J]}case"right":{const z=[h-e,R?j+e/2:G?j+e*4:j-e*4],J=[h-e,R?j-e/2:G?j+e*4:j-e*4],Z=[[G||R?n.left+e:n.right,n.top],[G?R?n.left+e:n.right:n.left+e,n.bottom]];return[z,J,...Z]}default:return[]}}if(!Ee([x,O],b)){if(g&&!d)return M();if(!N&&l){const h=P(B.clientX,B.clientY);if(h!==null&&h<.1)return M()}Ee([x,O],K([a,L]))?!g&&l&&E.start(40,M):M()}};return i.__options={blockPointerEvents:t},i}const Me=r.createContext(void 0);function ee(o){const e=r.useContext(Me);if(e===void 0&&!o)throw new Error(re(47));return e}function At(){return{...pt(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}const Ht={...dt,disabled:q(o=>o.disabled),instantType:q(o=>o.instantType),openMethod:q(o=>o.openMethod),openChangeReason:q(o=>o.openChangeReason),modal:q(o=>o.modal),stickIfOpen:q(o=>o.stickIfOpen),titleElementId:q(o=>o.titleElementId),descriptionElementId:q(o=>o.descriptionElementId),openOnHover:q(o=>o.openOnHover),closeDelay:q(o=>o.closeDelay),hasViewport:q(o=>o.hasViewport)};class ge extends Qe{constructor(e){const t={...At(),...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:r.createRef(),backdropRef:r.createRef(),internalBackdropRef:r.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:r.createRef(),beforeContentFocusGuardRef:r.createRef(),stickIfOpenTimeout:new Te,triggerElements:new Ze},Ht)}setOpen=(e,t)=>{const l=t.reason===U,E=t.reason===ue&&t.event.detail===0,g=!e&&(t.reason===Le||t.reason==null);if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;const v={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested,triggerElement:t.trigger};this.state.floatingRootContext.context.events?.emit("openchange",v);const s=()=>{const P={open:e,openChangeReason:t.reason},i=t.trigger?.id??null;(i||e)&&(P.activeTriggerId=i,P.activeTriggerElement=t.trigger??null),this.update(P)};l?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Ae,()=>{this.set("stickIfOpen",!1)}),ne.flushSync(s)):s(),E||g?this.set("instantType",E?"click":"dismiss"):t.reason===le?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(e,t){const l=He(()=>new ge(t)).current,E=e??l;return je(l.disposeEffect),E}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}function be({props:o}){const{children:e,open:t,defaultOpen:l=!1,onOpenChange:E,onOpenChangeComplete:g,modal:v=!1,handle:k,triggerId:s,defaultTriggerId:P=null}=o,i=ge.useStore(k?.store,{open:t??l,modal:v,activeTriggerId:s!==void 0?s:P});i.useControlledProp("open",t,l),i.useControlledProp("activeTriggerId",s,P);const a=i.useState("open"),L=i.useState("positionerElement"),H=i.useState("payload"),F=i.useState("openChangeReason");i.useContextCallback("onOpenChange",E),i.useContextCallback("onOpenChangeComplete",g);const{openMethod:u,triggerProps:I,reset:D}=tt(a);gt(i);const{forceUnmount:f}=mt(a,i,()=>{i.update({stickIfOpen:!0,openChangeReason:null}),D()});nt(a&&v===!0&&F!==U&&u!=="touch",L),r.useEffect(()=>{a||i.context.stickIfOpenTimeout.clear()},[i,a]);const B=r.useCallback(S=>{const G=W(S);return G.preventUnmountOnClose=()=>{i.set("preventUnmountingOnClose",!0)},G},[i]),M=r.useCallback(()=>{i.setOpen(!1,B(Be))},[i,B]);r.useImperativeHandle(o.actionsRef,()=>({unmount:f,close:M}),[f,M]);const x=ht({popupStore:i,onOpenChange:i.setOpen}),O=ot(x,{outsidePressEvent:{mouse:v==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),T=Et(x),{getReferenceProps:_,getFloatingProps:N,getTriggerProps:m}=Se([O,T]),w=r.useMemo(()=>_(I),[_,I]),c=r.useMemo(()=>m(I),[m,I]),n=r.useMemo(()=>N(),[N]);i.useSyncedValues({modal:v,openMethod:u,activeTriggerProps:w,inactiveTriggerProps:c,popupProps:n,floatingRootContext:x,nested:Pe()!=null});const y=r.useMemo(()=>({store:i}),[i]);return V.jsx(Me.Provider,{value:y,children:typeof e=="function"?e({payload:H}):e})}function Ut(o){return ee(!0)?V.jsx(be,{props:o}):V.jsx(et,{children:V.jsx(be,{props:o})})}const jt=300,qt=r.forwardRef(function(e,t){const{render:l,className:E,disabled:g=!1,nativeButton:v=!0,handle:k,payload:s,openOnHover:P=!1,delay:i=jt,closeDelay:a=0,id:L,...H}=e,F=ee(!0),u=k?.store??F?.store;if(!u)throw new Error(re(74));const I=rt(L),D=u.useState("isTriggerActive",I),f=u.useState("floatingRootContext"),B=u.useState("isOpenedByTrigger",I),M=r.useRef(null),{registerTrigger:x,isMountedByThisTrigger:O}=bt(I,M,u,{payload:s,disabled:g,openOnHover:P,closeDelay:a}),T=u.useState("openChangeReason"),_=u.useState("stickIfOpen"),N=u.useState("openMethod"),m=Ft(f,{enabled:f!=null&&P&&(N!=="touch"||T!==ue),mouseOnly:!0,move:!1,handleClose:Lt(),restMs:i,delay:{close:a},triggerElementRef:M,isActiveTrigger:D}),w=vt(f,{enabled:f!=null,stickIfOpen:_}),c=Se([w]),n=u.useState("triggerProps",O),y=r.useMemo(()=>({disabled:g,open:B}),[g,B]),{getButtonProps:S,buttonRef:G}=De({disabled:g,native:v}),d=r.useMemo(()=>({open(A){return A&&T===ue?st.open(A):it.open(A)}}),[T]),p=pe("button",e,{state:y,ref:[G,t,x,M],props:[c.getReferenceProps(),m,n,{[Ne]:"",id:I},H,S],stateAttributesMapping:d}),R=r.useRef(null),X=$(A=>{ne.flushSync(()=>{u.setOpen(!1,W(le,A.nativeEvent,A.currentTarget))}),_e(R.current)?.focus()}),C=$(A=>{const Y=u.select("positionerElement");if(Y&&Ye(A,Y))u.context.beforeContentFocusGuardRef.current?.focus();else{ne.flushSync(()=>{u.setOpen(!1,W(le,A.nativeEvent,A.currentTarget))});let b=Ge(u.context.triggerFocusTargetRef.current||M.current);for(;b!==null&&Q(Y,b);){const K=b;if(b=Ve(b),b===K)break}b?.focus()}});return D?V.jsxs(r.Fragment,{children:[V.jsx(he,{ref:R,onFocus:X}),V.jsx(r.Fragment,{children:p},I),V.jsx(he,{ref:u.context.triggerFocusTargetRef,onFocus:C})]}):V.jsx(r.Fragment,{children:p},I)}),xe=r.createContext(void 0);function Bt(){const o=r.useContext(xe);if(o===void 0)throw new Error(re(45));return o}const Wt=r.forwardRef(function(e,t){const{keepMounted:l=!1,...E}=e,{store:g}=ee();return g.useState("mounted")||l?V.jsx(xe.Provider,{value:l,children:V.jsx(Xe,{ref:t,...E,renderGuards:!1})}):null}),ke=r.createContext(void 0);function Dt(){const o=r.useContext(ke);if(!o)throw new Error(re(46));return o}const $t=r.forwardRef(function(e,t){const{render:l,className:E,anchor:g,positionMethod:v="absolute",side:k="bottom",align:s="center",sideOffset:P=0,alignOffset:i=0,collisionBoundary:a="clipping-ancestors",collisionPadding:L=5,arrowPadding:H=5,sticky:F=!1,disableAnchorTracking:u=!1,collisionAvoidance:I=Ke,...D}=e,{store:f}=ee(),B=Bt(),M=ct(),x=f.useState("floatingRootContext"),O=f.useState("mounted"),T=f.useState("open"),_=f.useState("openChangeReason"),N=f.useState("activeTriggerElement"),m=f.useState("modal"),w=f.useState("positionerElement"),c=f.useState("instantType"),n=f.useState("transitionStatus"),y=f.useState("hasViewport"),S=r.useRef(null),G=Ue(w,!1,!1),d=Rt({anchor:g,floatingRootContext:x,positionMethod:v,mounted:O,side:k,sideOffset:P,align:s,alignOffset:i,arrowPadding:H,collisionBoundary:a,collisionPadding:L,sticky:F,disableAnchorTracking:u,keepMounted:B,nodeId:M,collisionAvoidance:I,adaptiveOrigin:y?Tt:void 0}),p=r.useMemo(()=>{const b={};return T||(b.pointerEvents="none"),{role:"presentation",hidden:!O,style:{...d.positionerStyles,...b}}},[T,O,d.positionerStyles]),R=r.useMemo(()=>({props:p,...d}),[p,d]),X=x?.select("domReferenceElement");ae(()=>{const b=X,K=S.current;if(b&&(S.current=b),K&&b&&b!==K){f.set("instantType",void 0);const h=new AbortController;return G(()=>{f.set("instantType","trigger-change")},h.signal),()=>{h.abort()}}},[X,G,f]);const C=r.useMemo(()=>({open:T,side:R.side,align:R.align,anchorHidden:R.anchorHidden,instant:c}),[T,R.side,R.align,R.anchorHidden,c]),A=r.useCallback(b=>{f.set("positionerElement",b)},[f]),Y=pe("div",e,{state:C,props:[R.props,ye(n),D],ref:[t,A],stateAttributesMapping:Oe});return V.jsxs(ke.Provider,{value:R,children:[O&&m===!0&&_!==U&&V.jsx(at,{ref:f.context.internalBackdropRef,inert:qe(!T),cutout:N}),V.jsx(ut,{id:M,children:Y})]})}),Nt={...Oe,...ze},zt=r.forwardRef(function(e,t){const{className:l,render:E,initialFocus:g,finalFocus:v,...k}=e,{store:s}=ee(),P=Dt(),i=Ct()!=null,a=s.useState("open"),L=s.useState("openMethod"),H=s.useState("instantType"),F=s.useState("transitionStatus"),u=s.useState("popupProps"),I=s.useState("titleElementId"),D=s.useState("descriptionElementId"),f=s.useState("modal"),B=s.useState("mounted"),M=s.useState("openChangeReason"),x=s.useState("activeTriggerElement"),O=s.useState("floatingRootContext");We({open:a,ref:s.context.popupRef,onComplete(){a&&s.context.onOpenChangeComplete?.(!0)}});const T=s.useState("disabled"),_=s.useState("openOnHover"),N=s.useState("closeDelay");Mt(O,{enabled:_&&!T,closeDelay:N});function m(S){return S==="touch"?s.context.popupRef.current:!0}const w=g===void 0?m:g,c=r.useMemo(()=>({open:a,side:P.side,align:P.align,instant:H,transitionStatus:F}),[a,P.side,P.align,H,F]),n=r.useCallback(S=>{s.set("popupElement",S)},[s]),y=pe("div",e,{state:c,ref:[t,s.context.popupRef,n],props:[u,{"aria-labelledby":I,"aria-describedby":D,onKeyDown(S){i&&ft.has(S.key)&&S.stopPropagation()}},ye(F),k],stateAttributesMapping:Nt});return V.jsx(lt,{context:O,openInteractionType:L,modal:f==="trap-focus",disabled:!B||M===U,initialFocus:w,returnFocus:v,restoreFocus:"popup",previousFocusableElement:$e(x)?x:void 0,nextFocusableElement:s.context.triggerFocusTargetRef,beforeContentFocusGuardRef:s.context.beforeContentFocusGuardRef,children:y})});export{Xt as C,Kt as L,Ut as P,qt as a,Wt as b,$t as c,zt as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as y,r as l,ah as Q,ab as q,aE as L,j as n,m as A,N as v,A as s,Q as X,ao as ee,at as te,au as ne,av as O,aF as ae,aG as ie,as as se,O as oe,R as re,K as le,M as ce,W as ue,aH as de,aI as ge,aJ as he,aK as pe,E as me,aL as be,aM as fe,aN as xe,aO as ye,aP as ve,aQ as je,aR as ke,a9 as Ne}from"./main-BIY3Nj6I.js";import{a as Se,b as E,u as we,L as G}from"./use-limits-display-prefs-B4iJ-bBc.js";import{S as j,T as k,a as b,b as _,u as P}from"./use-native-settings-DHjPFDv8.js";import{C as Ce}from"./useOpenInteractionType-BQhgq4rv.js";import{u as Le}from"./useCurrency-BsSZiZMP.js";import{S as D}from"./Select-tT9x4ntD.js";import{I as Ee}from"./info-Bh5qTz6k.js";import{D as Ge}from"./download-DbBBBpJF.js";import"./Card-GROxUc_6.js";import"./SelectItemText-C7F7eIm0.js";const Ie=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Ae=y("activity",Ie);const Oe=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],_e=y("copy",Oe);const Pe=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],De=y("grip-vertical",Pe);const Te=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],Me=y("languages",Te);const Ue=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Re=y("log-out",Ue);const Fe=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],He=y("pencil",Fe),$e=e=>!e.isLayoutDirty&&e.willUpdate(!1);function I(){const e=new Set,t=new WeakMap,a=()=>e.forEach($e);return{add:i=>{e.add(i),t.set(i,i.addEventListener("willUpdate",a))},remove:i=>{e.delete(i);const o=t.get(i);o&&(o(),t.delete(i)),a()},dirty:a}}const Be=l.createContext(null);function ze(){const e=l.useRef(!1);return Q(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Ve(){const e=ze(),[t,a]=l.useState(0),i=l.useCallback(()=>{e.current&&a(t+1)},[t]);return[l.useCallback(()=>q.postRender(i),[i]),t]}const T=e=>e===!0,Ke=e=>T(e===!0)||e==="id",We=({children:e,id:t,inherit:a=!0})=>{const i=l.useContext(L),o=l.useContext(Be),[r,c]=Ve(),u=l.useRef(null),g=i.id||o;u.current===null&&(Ke(a)&&g&&(t=t?g+"-"+t:g),u.current={id:t,group:T(a)&&i.group||I()});const h=l.useMemo(()=>({...u.current,forceRender:r}),[c]);return n.jsx(L.Provider,{value:h,children:e})},Ze=new Set(["cursor","kiro","copilot","kimi"]);function Ye({checked:e,onChange:t,ariaLabel:a}){return n.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":a,onClick:t,className:v("relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",e?"bg-oai-brand-500":"bg-oai-gray-300 dark:bg-oai-gray-700"),children:n.jsx("span",{className:v("inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",e?"translate-x-[18px]":"translate-x-[3px]")})})}function Je({prefs:e}){const{order:t,visibility:a,toggle:i,moveToward:o}=e,[r,c]=l.useState(null),[u,g]=l.useState(null),h=d=>p=>{c(d),p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/plain",d)},m=d=>p=>{p.preventDefault(),p.dataTransfer.dropEffect="move",r&&r!==d&&u!==d&&(g(d),o(r,d))},f=()=>{c(null),g(null)},x=d=>{d.preventDefault(),c(null),g(null)};return n.jsx(We,{children:n.jsx("div",{className:"flex flex-col",children:t.map(d=>{const p=a[d]!==!1,N=r===d;return n.jsxs(A.div,{layout:!0,transition:{duration:.28,ease:[.22,1,.36,1]},draggable:!0,onDragStart:h(d),onDragOver:m(d),onDragEnd:f,onDrop:x,className:v("flex items-center gap-3 py-2 rounded-md","hover:bg-oai-gray-100/60 dark:hover:bg-oai-gray-800/60",N&&"opacity-40"),style:{cursor:N?"grabbing":"grab"},children:[n.jsx(De,{className:"h-4 w-4 shrink-0 text-oai-gray-400 dark:text-oai-gray-500",strokeWidth:1.75,"aria-hidden":!0}),n.jsx("img",{src:Se[d],alt:"",width:18,height:18,className:v("h-[18px] w-[18px] shrink-0 pointer-events-none",Ze.has(d)&&"dark:invert"),draggable:!1}),n.jsx("span",{className:"flex-1 text-sm text-oai-gray-900 dark:text-oai-gray-200 select-none",children:E[d]}),n.jsx("div",{onMouseDown:S=>S.stopPropagation(),draggable:!1,children:n.jsx(Ye,{checked:p,onChange:()=>i(d),ariaLabel:`${s("limits.settings.toggle_visible")}: ${E[d]}`})})]},d)})})})}function Qe(e){if(!e||typeof e!="object")return"";const t=e.user_metadata&&typeof e.user_metadata=="object"?e.user_metadata:{},a=e.profile&&typeof e.profile=="object"?e.profile:{},i=t.full_name||t.name||a.name||t.user_name||t.preferred_username;return typeof i=="string"&&i.trim()?i.trim():typeof e.email=="string"&&e.email.includes("@")?e.email.split("@")[0].trim()||e.email.trim():typeof e.email=="string"?e.email.trim():""}function qe(e){return!e||typeof e!="object"?"":typeof e.email=="string"?e.email.trim():""}function Xe(e){const t=typeof e=="string"?e.trim():"";if(!t)return null;const a=t.match(/^@?([A-Za-z0-9][A-Za-z0-9-]{0,38})$/),i=t.match(/^https:\/\/github\.com\/([A-Za-z0-9][A-Za-z0-9-]{0,38})\/?$/i),o=a?.[1]||i?.[1];return o?`https://github.com/${o}`:null}function w(e,t){console.warn(`[tokentracker] settings ${e}:`,t)}function et(e,t,a){const[i,o]=l.useState(()=>ee()),r=t&&a&&se(),c=l.useCallback(async()=>{const u=!i;if(te(u),o(u),!!u)try{await ne(()=>e())}catch(g){w("cloud sync",g)}},[i,e]);return{cloudSyncOn:i,handleCloudSyncToggle:c,showLocalCloudSync:r}}function tt(e){const[t,a]=l.useState(!1),[i,o]=l.useState(!1),[r,c]=l.useState(!1),[u,g]=l.useState(!1),[h,m]=l.useState(null),[f,x]=l.useState(!1),[d,p]=l.useState(""),[N,S]=l.useState(!1),[F,C]=l.useState(""),[H,$]=l.useState(""),[B,z]=l.useState(!1),[V,K]=l.useState(null),W=l.useMemo(()=>Qe(e),[e]),Z=l.useMemo(()=>qe(e),[e]),Y=l.useMemo(()=>typeof e?.id=="string"?e.id.trim():"",[e]),J=l.useMemo(()=>({setAnonymousOn:o,setCustomDisplayName:m,setGithubUrl:C,setProfileLoading:c,setPublicProfileOn:a,setShowGithubOn:S}),[]);return{anonymousOn:i,customDisplayName:h,displayName:W,editingGithub:B,editingName:f,email:Z,githubError:V,githubInput:H,githubUrl:F,loadSetters:J,nameInput:d,profileLoading:r,profileSaving:u,publicProfileOn:t,setAnonymousOn:o,setCustomDisplayName:m,setEditingGithub:z,setEditingName:x,setGithubError:K,setGithubInput:$,setGithubUrl:C,setNameInput:p,setProfileLoading:c,setProfileSaving:g,setPublicProfileOn:a,setShowGithubOn:S,showGithubOn:N,userId:Y}}function nt(e,t,a){l.useEffect(()=>{if(!t)return;let i=!0;return a.setProfileLoading(!0),(async()=>{try{const o=await O({getAccessToken:e});if(!i||!o)return;const r=await ae({accessToken:o});if(!i)return;a.setPublicProfileOn(!!r?.enabled),a.setAnonymousOn(!!r?.anonymous),r?.display_name&&a.setCustomDisplayName(r.display_name),a.setShowGithubOn(!!r?.show_github_url),a.setGithubUrl(r?.github_url||"")}catch(o){w("load public profile",o)}finally{i&&a.setProfileLoading(!1)}})(),()=>{i=!1}},[e,t,a])}function at(e,t){return l.useCallback(async(a,{label:i,onError:o,onSuccess:r}={})=>{if(t.profileSaving)return!1;t.setProfileSaving(!0);try{const c=await O({getAccessToken:e});if(!c)return!1;const u=await ie({accessToken:c,...a});return r?.(u),!0}catch(c){return o?o(c):w(i||"mutate profile",c),!1}finally{t.setProfileSaving(!1)}},[e,t])}function it(e,t){return{anonymousOn:e.anonymousOn,customDisplayName:e.customDisplayName,displayName:e.displayName,editingName:e.editingName,handleAnonymousToggle:t.handleAnonymousToggle,handleSaveName:t.handleSaveName,nameInput:e.nameInput,profileLoading:e.profileLoading,profileSaving:e.profileSaving,setEditingName:e.setEditingName,setNameInput:e.setNameInput,startEditingName:t.startEditingName}}function st(e,t){return{editingGithub:e.editingGithub,githubError:e.githubError,githubInput:e.githubInput,githubUrl:e.githubUrl,handleSaveGithub:t.handleSaveGithub,handleShowGithubToggle:t.handleShowGithubToggle,profileLoading:e.profileLoading,profileSaving:e.profileSaving,setEditingGithub:e.setEditingGithub,setGithubError:e.setGithubError,setGithubInput:e.setGithubInput,showGithubOn:e.showGithubOn,startEditingGithub:t.startEditingGithub}}function ot(e,t){const a=l.useCallback(async()=>{const o=!e.publicProfileOn;await t({enabled:o},{label:"toggle public profile",onSuccess:()=>e.setPublicProfileOn(o)})},[t,e]);return{handleAnonymousToggle:l.useCallback(async()=>{const o=!e.anonymousOn;await t({anonymous:o},{label:"toggle anonymous",onSuccess:()=>e.setAnonymousOn(o)})},[t,e]),handlePublicProfileToggle:a}}function rt(e,t,a){const i=l.useCallback(async()=>{const r=e.nameInput.trim().slice(0,50);r&&await t({display_name:r},{label:"save display name",onSuccess:()=>{e.setCustomDisplayName(r),e.setEditingName(!1),a?.()}})},[t,e,a]),o=l.useCallback(()=>{e.setNameInput(e.customDisplayName||e.displayName),e.setEditingName(!0)},[e]);return{handleSaveName:i,startEditingName:o}}function lt(e,t){const a=l.useCallback(async()=>{if(!e.showGithubOn&&!e.githubUrl){e.setEditingGithub(!0),e.setGithubInput(""),e.setGithubError(null);return}const r=!e.showGithubOn;await t({show_github_url:r},{label:"toggle GitHub profile",onSuccess:()=>e.setShowGithubOn(r)})},[t,e]),i=l.useCallback(async()=>{const r=Xe(e.githubInput);if(e.githubInput.trim()&&!r){e.setGithubError(s("settings.account.githubUrlInvalid"));return}e.setGithubError(null),await t({github_url:r,show_github_url:!!r},{label:"save GitHub profile",onError:c=>e.setGithubError(c?.message||s("settings.account.githubUrlInvalid")),onSuccess:c=>{e.setGithubUrl(c?.github_url||r||""),e.setShowGithubOn(!!r),e.setEditingGithub(!1)}})},[t,e]),o=l.useCallback(()=>{e.setGithubInput(e.githubUrl),e.setGithubError(null),e.setEditingGithub(!0)},[e]);return{handleSaveGithub:i,handleShowGithubToggle:a,startEditingGithub:o}}function ct(){const e=X(),t=tt(e.user),a=et(e.getAccessToken,e.enabled,e.signedIn);nt(e.getAccessToken,e.signedIn,t.loadSetters);const i=at(e.getAccessToken,t),o=ot(t,i),r=rt(t,i,e.refreshDisplayName),c=lt(t,i);return{...e,...a,email:t.email,handlePublicProfileToggle:o.handlePublicProfileToggle,userId:t.userId,name:it(t,{...o,...r}),github:st(t,c),profileLoading:t.profileLoading,profileSaving:t.profileSaving,publicProfileOn:t.publicProfileOn}}function M({disabled:e,onCancel:t,onSave:a,saveLabel:i=s("settings.account.save")}){return n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",onClick:a,disabled:e,className:"rounded-md bg-oai-brand-500 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-oai-brand-600 disabled:opacity-50",children:i}),n.jsx("button",{type:"button",onClick:t,className:"rounded-md px-2 py-1.5 text-xs text-oai-gray-500 transition-colors hover:text-oai-gray-700 dark:hover:text-oai-gray-300",children:s("settings.account.cancel")})]})}function ut({nameInput:e,setEditingName:t,setNameInput:a,profileSaving:i,handleSaveName:o}){return n.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[n.jsx("input",{type:"text",value:e,onChange:r=>a(r.target.value),onKeyDown:r=>{r.key==="Enter"&&o(),r.key==="Escape"&&t(!1)},maxLength:50,autoFocus:!0,className:"flex-1 rounded-md border border-oai-gray-300 bg-transparent px-2.5 py-1.5 text-sm text-oai-black outline-none focus:border-oai-brand-500 focus:ring-1 focus:ring-inset focus:ring-oai-brand-500 dark:border-oai-gray-700 dark:text-white",placeholder:s("settings.account.displayName")}),n.jsx(M,{disabled:i||!e.trim(),onCancel:()=>t(!1),onSave:o,saveLabel:i?s("settings.account.saving"):void 0})]})}function dt({githubError:e,githubInput:t,handleSaveGithub:a,profileSaving:i,setEditingGithub:o,setGithubError:r,setGithubInput:c}){return n.jsxs("div",{className:"mt-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"text",value:t,onChange:u=>{c(u.target.value),e&&r(null)},onKeyDown:u=>{u.key==="Enter"&&a(),u.key==="Escape"&&(o(!1),r(null))},maxLength:100,autoFocus:!0,className:"flex-1 rounded-md border border-oai-gray-300 bg-transparent px-2.5 py-1.5 text-sm text-oai-black outline-none focus:border-oai-brand-500 focus:ring-1 focus:ring-inset focus:ring-oai-brand-500 dark:border-oai-gray-700 dark:text-white",placeholder:s("settings.account.githubUrlPlaceholder")}),n.jsx(M,{disabled:i,onCancel:()=>{o(!1),r(null)},onSave:a,saveLabel:i?s("settings.account.saving"):void 0})]}),e?n.jsx("div",{className:"mt-1.5 text-xs text-red-600 dark:text-red-400",children:e}):null]})}function U({disabled:e=!1,label:t,onClick:a,title:i}){return n.jsxs("button",{type:"button",onClick:a,disabled:e,title:i,className:"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 disabled:cursor-not-allowed disabled:opacity-40 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:[n.jsx(He,{className:"h-3.5 w-3.5","aria-hidden":!0}),t]})}function R({actions:e,editing:t,editor:a,hint:i,label:o}){return n.jsx("div",{className:"py-3",children:n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"text-sm text-oai-gray-900 dark:text-oai-gray-200",children:o}),t?a:n.jsx("div",{className:"mt-0.5 truncate text-xs text-oai-gray-500 dark:text-oai-gray-400",children:i})]}),t?null:e]})})}function gt({name:e}){const t=e.anonymousOn?s("settings.account.displayNameDisabledWhileAnon"):void 0;return n.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[n.jsx(U,{disabled:e.anonymousOn,label:s("settings.account.edit"),onClick:e.startEditingName,title:t}),n.jsx(k,{checked:!e.anonymousOn,onChange:e.handleAnonymousToggle,disabled:e.profileLoading||e.profileSaving,ariaLabel:s("settings.account.displayName")})]})}function ht({name:e}){const{anonymousOn:t,customDisplayName:a,displayName:i,editingName:o,handleAnonymousToggle:r,handleSaveName:c,nameInput:u,profileLoading:g,profileSaving:h,setEditingName:m,setNameInput:f,startEditingName:x}=e,d=t?s("settings.account.displayNameAnonymousHint"):a||i;return n.jsx(R,{label:s("settings.account.displayName"),editing:o,hint:d,editor:n.jsx(ut,{nameInput:u,setEditingName:m,setNameInput:f,profileSaving:h,handleSaveName:c}),actions:n.jsx(gt,{name:e})})}function pt({github:e}){const{editingGithub:t,githubError:a,githubInput:i,githubUrl:o,handleSaveGithub:r,handleShowGithubToggle:c,profileLoading:u,profileSaving:g,setEditingGithub:h,setGithubError:m,setGithubInput:f,showGithubOn:x,startEditingGithub:d}=e;return n.jsx(R,{label:s("settings.account.githubUrl"),editing:t,hint:o||s("settings.account.githubUrlHint"),editor:n.jsx(dt,{githubError:a,githubInput:i,handleSaveGithub:r,profileSaving:g,setEditingGithub:h,setGithubError:m,setGithubInput:f}),actions:n.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[n.jsx(U,{label:s("settings.account.edit"),onClick:d}),n.jsx(k,{checked:x,onChange:c,disabled:u||g,ariaLabel:s("settings.account.githubUrl")})]})})}function mt(){const{openLoginModal:e}=oe();return n.jsx(j,{title:s("settings.section.account"),children:n.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[n.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:s("settings.account.signedOutHint")}),n.jsx("button",{type:"button",onClick:e,className:"inline-flex h-8 shrink-0 items-center justify-center rounded-md bg-oai-gray-900 px-4 text-xs font-medium text-white transition-colors hover:bg-oai-gray-800 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100",children:s("settings.account.signIn")})]})})}function bt({name:e,github:t}){return n.jsxs(n.Fragment,{children:[n.jsx(ht,{name:e}),n.jsx(pt,{github:t})]})}function ft(){const e=ct();return e.enabled?e.signedIn?n.jsxs(j,{title:s("settings.section.account"),subtitle:e.email||e.name.customDisplayName||e.name.displayName,action:n.jsx(yt,{onSignOut:e.signOut}),children:[n.jsx(xt,{userId:e.userId}),n.jsx(vt,{settings:e}),n.jsx(jt,{checked:e.publicProfileOn,disabled:e.profileLoading||e.profileSaving,onChange:e.handlePublicProfileToggle}),n.jsx(kt,{visible:e.publicProfileOn,name:e.name,github:e.github})]}):n.jsx(mt,{}):null}function xt({userId:e}){const[t,a]=re.useState(!1);if(!e)return null;const i=async()=>{try{if(typeof navigator>"u"||!navigator.clipboard?.writeText)return;await navigator.clipboard.writeText(e),a(!0),globalThis.setTimeout(()=>a(!1),1200)}catch{a(!1)}};return n.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"text-sm text-oai-gray-900 dark:text-oai-gray-200",children:s("settings.account.userId")}),n.jsx("div",{className:"mt-0.5 truncate font-mono text-xs text-oai-gray-500 dark:text-oai-gray-400",children:e})]}),n.jsxs("button",{type:"button",onClick:i,className:"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800","aria-label":s("settings.account.copyUserId"),children:[t?n.jsx(Ce,{className:"h-3.5 w-3.5","aria-hidden":!0}):n.jsx(_e,{className:"h-3.5 w-3.5","aria-hidden":!0}),t?s("settings.account.copied"):s("settings.account.copy")]})]})}function yt({onSignOut:e}){return n.jsxs("button",{type:"button",onClick:()=>e(),className:"inline-flex h-7 items-center gap-1.5 text-xs font-medium text-oai-gray-500 transition-colors hover:text-oai-gray-700 dark:hover:text-oai-gray-300",children:[n.jsx(Re,{className:"h-3.5 w-3.5","aria-hidden":!0}),s("settings.account.signOut")]})}function vt({settings:e}){return e.showLocalCloudSync?n.jsx(b,{label:s("settings.account.cloudSync"),hint:s("settings.account.cloudSyncHint"),control:n.jsx(k,{checked:e.cloudSyncOn,onChange:e.handleCloudSyncToggle,ariaLabel:s("settings.account.cloudSync")})}):null}function jt({checked:e,disabled:t,onChange:a}){return n.jsx(b,{label:s("settings.account.publicProfile"),hint:s("settings.account.publicProfileHint"),control:n.jsx(k,{checked:e,onChange:a,disabled:t,ariaLabel:s("settings.account.publicProfile")})})}function kt({visible:e,name:t,github:a}){return n.jsx(le,{initial:!1,children:e?n.jsx(A.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{height:{duration:.28,ease:[.22,1,.36,1]},opacity:{duration:.2,ease:[.22,1,.36,1]}},style:{overflow:"hidden"},className:"divide-y divide-oai-gray-200/60 dark:divide-oai-gray-800/60",children:n.jsx(bt,{name:t,github:a})},"public-profile-fields"):null})}function Nt(){return[{value:"light",label:s("settings.appearance.theme.light"),Icon:de},{value:"dark",label:s("settings.appearance.theme.dark"),Icon:ge},{value:"system",label:s("settings.appearance.theme.system"),Icon:he}]}function St(){return[{value:be,label:s("settings.appearance.language.system")},{value:fe,label:s("settings.appearance.language.english")},{value:xe,label:s("settings.appearance.language.chinese")},{value:ye,label:s("settings.appearance.language.traditional_chinese")},{value:ve,label:s("settings.appearance.language.japanese")},{value:je,label:s("settings.appearance.language.korean")}]}function wt(e){if(!e)return null;try{const t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleString()}catch{return null}}function Ct(e,t){const a=s(`settings.appearance.currency.rate_source.${e}`),i=wt(t),o=i?s("settings.appearance.currency.rate_updated",{when:i}):s("settings.appearance.currency.rate_never");return`${a} · ${o}`}function Lt({locale:e,setLocale:t}){const a=St();return n.jsx(D,{value:e,onValueChange:t,options:a,ariaLabel:s("settings.appearance.language.label"),className:"px-2.5 py-1.5 text-xs font-medium",leadingIcon:n.jsx(Me,{className:"h-3.5 w-3.5 text-oai-gray-500 dark:text-oai-gray-400","aria-hidden":!0})})}function Et({currency:e,setCurrency:t}){const a=pe().map(i=>({value:i.code,label:s(i.labelKey)}));return n.jsx(D,{value:e,onValueChange:t,options:a,ariaLabel:s("settings.appearance.currency.label"),className:"px-3 py-1.5 text-xs font-medium"})}function Gt({currency:e,rate:t,rateSource:a,rateFetchedAt:i}){if(e===me)return n.jsx(n.Fragment,{children:s("settings.appearance.currency.hint")});const o=Ct(a,i);return n.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[n.jsx("span",{children:`1 USD = ${t.toFixed(4)} ${e}`}),n.jsx("span",{role:"img","aria-label":o,title:o,className:"inline-flex h-4 w-4 cursor-help items-center justify-center text-oai-gray-400 hover:text-oai-gray-600 dark:text-oai-gray-500 dark:hover:text-oai-gray-300",children:n.jsx(Ee,{className:"h-3.5 w-3.5","aria-hidden":!0})})]})}function It(){const{theme:e,setTheme:t}=ce(),{locale:a,setLocale:i}=ue(),{currency:o,rate:r,rateSource:c,rateFetchedAt:u,setCurrency:g}=Le();return n.jsxs(j,{title:s("settings.section.appearance"),children:[n.jsx(b,{label:s("settings.appearance.theme.label"),hint:s("settings.appearance.theme.hint"),control:n.jsx(_,{options:Nt(),value:e,onChange:t})}),n.jsx(b,{label:s("settings.appearance.language.label"),hint:s("settings.appearance.language.hint"),control:n.jsx(Lt,{locale:a,setLocale:i})}),n.jsx(b,{label:s("settings.appearance.currency.label"),hint:n.jsx(Gt,{currency:o,rate:r,rateSource:c,rateFetchedAt:u}),control:n.jsx(Et,{currency:o,setCurrency:g})})]})}function At(){const{available:e,settings:t,setSetting:a,runAction:i}=P();if(!e)return null;const o=!!t?.launchAtLogin,r=t?.launchAtLoginSupported!==!1,c=t?.updateStatus||null,u=!!t?.updateBusy,g=!!t?.isSyncing;return n.jsxs(j,{title:s("settings.section.menubar"),children:[r?n.jsx(b,{label:s("settings.menubar.launchAtLogin"),hint:s("settings.menubar.launchAtLoginHint"),control:n.jsx(k,{checked:o,onChange:()=>a("launchAtLogin",!o),ariaLabel:s("settings.menubar.launchAtLogin")})}):null,n.jsx(b,{label:s("settings.menubar.syncNow"),hint:s("settings.menubar.syncNowHint"),control:n.jsxs("button",{type:"button",onClick:()=>i("syncNow"),disabled:g,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:[n.jsx(ke,{className:v("h-3.5 w-3.5",g&&"animate-spin"),"aria-hidden":!0}),g?s("settings.menubar.syncing"):s("settings.menubar.syncNow")]})}),n.jsx(b,{label:s("settings.menubar.updates"),hint:c||void 0,control:n.jsxs("button",{type:"button",onClick:()=>i("checkForUpdates"),disabled:u,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:[n.jsx(Ge,{className:"h-3.5 w-3.5","aria-hidden":!0}),s("settings.menubar.checkUpdates")]})})]})}function Ot(){const{available:e,settings:t,runAction:a}=P(),i=e&&t?.version;return n.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-2 text-xs text-oai-gray-500 dark:text-oai-gray-500",children:[i?n.jsxs(n.Fragment,{children:[n.jsxs("span",{children:["TokenTrackerBar v",t.version]}),n.jsx("span",{"aria-hidden":!0,children:"·"}),n.jsx("button",{type:"button",onClick:()=>a("openAbout"),className:"underline-offset-2 transition-colors hover:text-oai-gray-700 hover:underline dark:hover:text-oai-gray-300",children:"GitHub"}),n.jsx("span",{"aria-hidden":!0,children:"·"})]}):null,n.jsxs("a",{href:Ne,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 underline-offset-2 transition-colors hover:text-oai-gray-700 hover:underline dark:hover:text-oai-gray-300",children:[n.jsx(Ae,{className:"h-3.5 w-3.5","aria-hidden":!0}),s("settings.footer.statusPage")]})]})}function _t({prefs:e}){return n.jsx(_,{options:[{value:G.USED,label:s("limits.settings.display_mode_used")},{value:G.REMAINING,label:s("limits.settings.display_mode_remaining")}],value:e.displayMode,onChange:e.setDisplayMode})}function zt(){const e=we();return n.jsx("div",{className:"flex flex-1 flex-col font-oai text-oai-black antialiased dark:text-oai-white",children:n.jsx("main",{className:"flex-1 pb-12 pt-8 sm:pb-16 sm:pt-10",children:n.jsxs("div",{className:"mx-auto max-w-3xl px-4 sm:px-6",children:[n.jsxs("div",{className:"mb-8",children:[n.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:text-4xl",children:s("settings.page.title")}),n.jsx("p",{className:"mt-2 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:s("settings.page.subtitle")})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx(It,{}),n.jsx(At,{}),n.jsx(ft,{}),n.jsx(j,{title:s("settings.section.limits"),action:n.jsx(_t,{prefs:e}),children:n.jsx(Je,{prefs:e})})]}),n.jsx(Ot,{})]})})})}export{zt as SettingsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aa as I,ab as S,ac as w,ad as M,ae as h,af as N,r as u,ag as V,ah as G,ai as H,aj as g,j as p,R as F,m as v,K as C,P}from"./main-BIY3Nj6I.js";function D(...e){const t=!Array.isArray(e[0]),n=t?0:-1,o=e[0+n],r=e[1+n],i=e[2+n],a=e[3+n],s=I(r,i,a);return t?s(o):s}function K(e,t,n={}){const o=e.get();let r=null,i=o,a;const s=typeof o=="string"?o.replace(/[\d.-]/g,""):void 0,c=()=>{r&&(r.stop(),r=null),e.animation=void 0},d=()=>{const l=b(e.get()),f=b(i);if(l===f){c();return}const y=r?r.getGeneratorVelocity():e.getVelocity();c(),r=new M({keyframes:[l,f],velocity:y,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:a})},m=()=>{d(),e.animation=r??void 0,e.events.animationStart?.notify(),r?.then(()=>{e.animation=void 0,e.events.animationComplete?.notify()})};if(e.attach((l,f)=>{i=l,a=y=>f(x(y,s)),S.postRender(m)},c),w(t)){let l=n.skipInitialAnimation===!0;const f=t.on("change",A=>{l?(l=!1,e.jump(x(A,s),!1)):e.set(x(A,s))}),y=e.on("destroy",f);return()=>{f(),y()}}return c}function x(e,t){return t?e+t:e}function b(e){return typeof e=="number"?e:parseFloat(e)}function k(e){const t=h(()=>N(e)),{isStatic:n}=u.useContext(V);if(n){const[,o]=u.useState(e);u.useEffect(()=>t.on("change",o),[])}return t}function E(e,t){const n=k(t()),o=()=>n.set(t());return o(),G(()=>{const r=()=>S.preRender(o,!1,!0),i=e.map(a=>a.on("change",r));return()=>{i.forEach(a=>a()),H(o)}}),n}function T(e){g.current=[],e();const t=E(g.current,e);return g.current=void 0,t}function L(e,t,n,o){if(typeof e=="function")return T(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!="function")return z(e,t,n,o);const a=typeof t=="function"?t:D(t,n,o),s=Array.isArray(e)?j(e,a):j([e],([d])=>a(d)),c=Array.isArray(e)?void 0:e.accelerate;return c&&!c.isTransformed&&typeof t!="function"&&Array.isArray(n)&&o?.clamp!==!1&&(s.accelerate={...c,times:t,keyframes:n,isTransformed:!0}),s}function j(e,t){const n=h(()=>[]);return E(e,()=>{n.length=0;const o=e.length;for(let r=0;r<o;r++)n[r]=e[r].get();return t(n)})}function z(e,t,n,o){const r=h(()=>Object.keys(n)),i=h(()=>({}));for(const a of r)i[a]=L(e,t,n[a],o);return i}function J(e,t={}){const{isStatic:n}=u.useContext(V),o=()=>w(e)?e.get():e;if(n)return L(o);const r=k(o());return u.useInsertionEffect(()=>K(r,e,t),[r,JSON.stringify(t)]),r}function _(e,t={}){return J(e,{type:"spring",...t})}function U(e){const t=[...e];for(let n=t.length-1;n>0;n--){const o=Math.floor(Math.random()*(n+1));[t[n],t[o]]=[t[o],t[n]]}return t}function $(e,t){const n=U(e),o=Array.from({length:t},()=>[]);n.forEach((i,a)=>{o[a%t].push(i)});const r=Math.max(...o.map(i=>i.length));return o.forEach(i=>{for(;i.length<r;)i.push(n[Math.floor(Math.random()*n.length)])}),o}const B=F.memo(function({logos:t,index:n,currentTime:o,onHoverChange:r}){const[i,a]=u.useState(!1),s=4e3,c=n*400,d=(o+c)%(s*t.length),m=Math.floor(d/s),l=t[m],f=y=>{a(y),r(y)};return p.jsxs("div",{className:"relative flex flex-col items-center",onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:[p.jsx(v.div,{className:"relative h-8 w-8 sm:h-10 sm:w-10 md:h-12 md:w-12 overflow-hidden",initial:{opacity:0,y:50},animate:{opacity:1,y:0},transition:{delay:n*.1,duration:.5,ease:"easeOut"},children:p.jsx(C,{mode:"wait",children:p.jsx(v.div,{className:"absolute inset-0 flex items-center justify-center",initial:{y:"18%",opacity:0,filter:"blur(4px)"},animate:{y:"0%",opacity:1,filter:"blur(0px)",transition:{type:"tween",ease:[.22,1,.36,1],duration:.9}},exit:{y:"-18%",opacity:0,filter:"blur(4px)",transition:{type:"tween",ease:[.4,0,1,1],duration:.55}},children:p.jsx(P,{provider:l.provider,size:24,className:"object-contain"})},`${l.id}-${m}`)})}),p.jsx(C,{children:i&&p.jsx(v.span,{className:"pointer-events-none absolute -bottom-7 z-10 whitespace-nowrap rounded bg-oai-gray-800 px-2 py-0.5 text-xs font-medium text-oai-gray-100 shadow-lg ring-1 ring-oai-gray-700",initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:l.name})})]})});function q({logos:e,columnCount:t=2}){const[n,o]=u.useState([]),[r,i]=u.useState(0),[a,s]=u.useState(!1);u.useEffect(()=>{o($(e,t))},[e,t]),u.useEffect(()=>{if(a)return;const d=setInterval(()=>i(m=>m+100),100);return()=>clearInterval(d)},[a]);const c=u.useCallback(d=>{s(d)},[]);return p.jsx("div",{className:"flex gap-2.5 sm:gap-4 text-oai-gray-200",children:n.map((d,m)=>p.jsx(B,{logos:d,index:m,currentTime:r,onHoverChange:c},m))})}const Q=[{id:1,name:"Claude Code",provider:"claude"},{id:2,name:"Codex",provider:"codex"},{id:3,name:"Cursor",provider:"cursor"},{id:4,name:"Gemini",provider:"gemini"},{id:5,name:"OpenCode",provider:"opencode"},{id:6,name:"OpenClaw",provider:"openclaw"},{id:7,name:"Antigravity",provider:"antigravity"},{id:8,name:"Kiro",provider:"kiro"},{id:9,name:"Hermes",provider:"hermes"},{id:10,name:"GitHub Copilot",provider:"copilot"},{id:11,name:"Kimi",provider:"kimi"},{id:12,name:"oh-my-pi",provider:"omp"},{id:13,name:"Pi",provider:"pi"},{id:14,name:"CodeBuddy",provider:"codebuddy"},{id:15,name:"Grok",provider:"grok"},{id:16,name:"Kilo",provider:"kilo-cli"},{id:17,name:"Craft",provider:"craft"},{id:18,name:"Droid",provider:"droid"},{id:19,name:"GitHub",provider:"github"}];export{Q as A,q as L,_ as a,L as b,k as u};
|