tokentracker-cli 0.75.1 → 0.76.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 (64) hide show
  1. package/dashboard/dist/assets/{ActivityHeatmap-Dx4g4X43.js → ActivityHeatmap-Cc7rHzpc.js} +1 -1
  2. package/dashboard/dist/assets/{Card-8mPQHqFP.js → Card-i15i_EDL.js} +1 -1
  3. package/dashboard/dist/assets/ClawdAnimated-DMuZ5d5m.js +1 -0
  4. package/dashboard/dist/assets/{CommunityStatsModal-OEPzJpCJ.js → CommunityStatsModal-cKwxGEGB.js} +1 -1
  5. package/dashboard/dist/assets/{ConfirmModal-o-Hk4No5.js → ConfirmModal-Ck-ybj6p.js} +1 -1
  6. package/dashboard/dist/assets/Controls-CxmOdwJ3.js +1 -0
  7. package/dashboard/dist/assets/DashboardPage-ED4-b7kr.js +19 -0
  8. package/dashboard/dist/assets/{DevicePage-aFlIU4O7.js → DevicePage-DcKvkJNR.js} +1 -1
  9. package/dashboard/dist/assets/{DialogClose-CMgeGOpM.js → DialogClose-C6nuJJ_i.js} +1 -1
  10. package/dashboard/dist/assets/DialogDescription-C6z_szoN.js +1 -0
  11. package/dashboard/dist/assets/{DialogTitle-BBcDQEZI.js → DialogTitle-D0xEUAQD.js} +1 -1
  12. package/dashboard/dist/assets/{FadeIn-BwX09jrM.js → FadeIn-GWxxEiEG.js} +1 -1
  13. package/dashboard/dist/assets/{HeaderGithubStar-CSpmaWf9.js → HeaderGithubStar-BNs6lPrd.js} +1 -1
  14. package/dashboard/dist/assets/{IpCheckPage-C627Gvnb.js → IpCheckPage-BHEGYdwZ.js} +1 -1
  15. package/dashboard/dist/assets/{LandingPage-DVOk44rr.js → LandingPage-qCAwHW-r.js} +1 -1
  16. package/dashboard/dist/assets/{LeaderboardAvatar-BRS0gQdB.js → LeaderboardAvatar-aso6D7AA.js} +1 -1
  17. package/dashboard/dist/assets/{LeaderboardPage-BnHIc_QX.js → LeaderboardPage-BVDho0zN.js} +2 -2
  18. package/dashboard/dist/assets/{LeaderboardProfileModal-BAyhbx6f.js → LeaderboardProfileModal-D5qe822P.js} +1 -1
  19. package/dashboard/dist/assets/{LeaderboardProfilePage-DjLujfwX.js → LeaderboardProfilePage-BhfX0BP4.js} +1 -1
  20. package/dashboard/dist/assets/{LimitsPage-B8_yr0LZ.js → LimitsPage-BDld2Tw9.js} +1 -1
  21. package/dashboard/dist/assets/{LocalOnlyNotice-fRfGrV2e.js → LocalOnlyNotice-B7Ws4lUu.js} +1 -1
  22. package/dashboard/dist/assets/{LoginPage-C8Xq3qEl.js → LoginPage-D7OQrvP6.js} +1 -1
  23. package/dashboard/dist/assets/PetPage-DsCEXiJf.js +1 -0
  24. package/dashboard/dist/assets/{PopoverPopup-C8ba3A4U.js → PopoverPopup-MhHKPgtt.js} +1 -1
  25. package/dashboard/dist/assets/{ResetPasswordPage-B_gX3VXy.js → ResetPasswordPage-C3QmfXcI.js} +1 -1
  26. package/dashboard/dist/assets/{Select-BeOyk3KD.js → Select-B9zxyBF3.js} +1 -1
  27. package/dashboard/dist/assets/{SelectItemText-BsXsF9WO.js → SelectItemText-D-kCTY6-.js} +1 -1
  28. package/dashboard/dist/assets/SettingsPage-1NY7r1OL.js +1 -0
  29. package/dashboard/dist/assets/{SkillsPage-CkOETQXq.js → SkillsPage-B6dZnAvn.js} +1 -1
  30. package/dashboard/dist/assets/WidgetsPage-BY_51IWL.js +1 -0
  31. package/dashboard/dist/assets/{WrappedPage-DxCn-34E.js → WrappedPage-BNvs3dW4.js} +1 -1
  32. package/dashboard/dist/assets/{agent-logos-CuOgsibp.js → agent-logos-Cg92StIs.js} +1 -1
  33. package/dashboard/dist/assets/{arrow-up-right-xu1jmhXG.js → arrow-up-right-5jhx4tzl.js} +1 -1
  34. package/dashboard/dist/assets/check-DhneqxBx.js +1 -0
  35. package/dashboard/dist/assets/{copy-BWLLa-5r.js → copy-CcD9E3do.js} +1 -1
  36. package/dashboard/dist/assets/{download-BOHq4-mm.js → download-hUD-lQh8.js} +1 -1
  37. package/dashboard/dist/assets/{format-tokens-Re81ACgi.js → format-tokens-BPZCO1fQ.js} +1 -1
  38. package/dashboard/dist/assets/{info-DmBk4Qy4.js → info-4Bz63oh6.js} +1 -1
  39. package/dashboard/dist/assets/main-BI3jOnQS.css +1 -0
  40. package/dashboard/dist/assets/main-nNmpL8Cj.js +1161 -0
  41. package/dashboard/dist/assets/{use-community-stats-8qR2Kosj.js → use-community-stats-D6SkhwbZ.js} +1 -1
  42. package/dashboard/dist/assets/{use-limits-display-prefs-DtTz9ufb.js → use-limits-display-prefs-BAQYB-31.js} +1 -1
  43. package/dashboard/dist/assets/use-native-settings-xp2V6xfM.js +1 -0
  44. package/dashboard/dist/assets/{use-ordered-list-D3jsFDDd.js → use-ordered-list-C5_uGsrS.js} +1 -1
  45. package/dashboard/dist/assets/{use-quality-per-dollar-pref-DSr4qLnc.js → use-quality-per-dollar-pref-iQsn9WQp.js} +1 -1
  46. package/dashboard/dist/assets/{use-usage-limits-Ch5xLylt.js → use-usage-limits-6uexiute.js} +1 -1
  47. package/dashboard/dist/assets/{useCurrency-BYMe-8PE.js → useCurrency-CmVvLPhb.js} +1 -1
  48. package/dashboard/dist/assets/{useScrollLock-Pp7C7LT3.js → useScrollLock-C-uJaCDp.js} +1 -1
  49. package/dashboard/dist/index.html +2 -2
  50. package/dashboard/dist/pets/byte/spritesheet.webp +0 -0
  51. package/dashboard/dist/pets/ember/spritesheet.webp +0 -0
  52. package/dashboard/dist/pets/sprout/spritesheet.webp +0 -0
  53. package/dashboard/dist/share.html +2 -2
  54. package/package.json +1 -1
  55. package/src/commands/init.js +34 -1
  56. package/src/lib/pricing/seed-snapshot.json +1 -1
  57. package/dashboard/dist/assets/DashboardPage-BfpUjw-F.js +0 -19
  58. package/dashboard/dist/assets/DialogDescription-CJSAsc7K.js +0 -1
  59. package/dashboard/dist/assets/SettingsPage-DyUkIO2k.js +0 -1
  60. package/dashboard/dist/assets/WidgetsPage-vdb4fze1.js +0 -1
  61. package/dashboard/dist/assets/check-B_Mz8JQb.js +0 -1
  62. package/dashboard/dist/assets/main--nUrKVF3.css +0 -1
  63. package/dashboard/dist/assets/main-BROCryhX.js +0 -1133
  64. package/dashboard/dist/assets/use-native-settings-slktI0_m.js +0 -1
@@ -1 +0,0 @@
1
- import{r as n,b9 as a}from"./main-BROCryhX.js";import{u as p}from"./DialogTitle-BBcDQEZI.js";import{u as c}from"./useScrollLock-Pp7C7LT3.js";const x=n.forwardRef(function(e,r){const{render:l,className:u,style:m,id:s,...t}=e,{store:i}=p(),o=c(s);return i.useSyncedValueWithCleanup("descriptionElementId",o),a("p",e,{ref:r,props:[{id:o},t]})});export{x as D};
@@ -1 +0,0 @@
1
- import{c as w,r as c,b as te,f as ne,aQ as G,j as t,h as D,$ as ae,a0 as k,N as a,a2 as ie,ay as se,aR as oe,aC as re,aD as le,aE as T,aS as ce,aT as ue,a1 as de,R as C,Z as ge,_ as he,ab as U,aU as pe,aV as me,a7 as be,aW as fe,S as xe,aX as ye,aY as ve,aZ as je,a_ as ke,a$ as Ne,b0 as Se,b1 as we,b2 as Ce,au as Le,b3 as A}from"./main-BROCryhX.js";import{b as I,l as P,u as Ee,L as _}from"./use-limits-display-prefs-DtTz9ufb.js";import{S as N,T as j,a as x,b as M,u as R}from"./use-native-settings-slktI0_m.js";import{u as Ge,P as Ae}from"./use-quality-per-dollar-pref-DSr4qLnc.js";import{C as Ie}from"./check-B_Mz8JQb.js";import{C as Pe}from"./copy-BWLLa-5r.js";import{u as _e}from"./useCurrency-BYMe-8PE.js";import{S as F}from"./Select-BeOyk3KD.js";import{I as Oe}from"./info-DmBk4Qy4.js";import{C as De}from"./ConfirmModal-o-Hk4No5.js";import{D as Te}from"./download-BOHq4-mm.js";import"./Card-8mPQHqFP.js";import"./SelectItemText-BsXsF9WO.js";import"./useScrollLock-Pp7C7LT3.js";import"./DialogTitle-BBcDQEZI.js";import"./DialogDescription-CJSAsc7K.js";const Ue=[["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"}]],Me=w("activity",Ue);const Re=[["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"}]],Fe=w("grip-vertical",Re);const He=[["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"}]],$e=w("languages",He);const Ve=[["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"}]],Be=w("log-out",Ve),ze=e=>!e.isLayoutDirty&&e.willUpdate(!1);function O(){const e=new Set,n=new WeakMap,i=()=>e.forEach(ze);return{add:s=>{e.add(s),n.set(s,s.addEventListener("willUpdate",i))},remove:s=>{e.delete(s);const o=n.get(s);o&&(o(),n.delete(s)),i()},dirty:i}}const Ze=c.createContext(null);function We(){const e=c.useRef(!1);return te(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function qe(){const e=We(),[n,i]=c.useState(0),s=c.useCallback(()=>{e.current&&i(n+1)},[n]);return[c.useCallback(()=>ne.postRender(s),[s]),n]}const H=e=>e===!0,Ke=e=>H(e===!0)||e==="id",Ye=({children:e,id:n,inherit:i=!0})=>{const s=c.useContext(G),o=c.useContext(Ze),[r,l]=qe(),u=c.useRef(null),g=s.id||o;u.current===null&&(Ke(i)&&g&&(n=n?g+"-"+n:g),u.current={id:n,group:H(i)&&s.group||O()});const p=c.useMemo(()=>({...u.current,forceRender:r}),[l]);return t.jsx(G.Provider,{value:p,children:e})},Qe="shrink-0 text-oai-gray-900 dark:text-oai-gray-200";function Je({checked:e,onChange:n,ariaLabel:i}){return t.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":i,onClick:n,className:k("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:t.jsx("span",{className:k("inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",e?"translate-x-[18px]":"translate-x-[3px]")})})}function Xe({prefs:e}){const{order:n,visibility:i,toggle:s,moveToward:o}=e,[r,l]=c.useState(null),[u,g]=c.useState(null),p=d=>m=>{l(d),m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/plain",d)},b=d=>m=>{m.preventDefault(),m.dataTransfer.dropEffect="move",r&&r!==d&&u!==d&&(g(d),o(r,d))},f=()=>{l(null),g(null)},y=d=>{d.preventDefault(),l(null),g(null)};return t.jsx(Ye,{children:t.jsx("div",{className:"flex flex-col",children:n.map(d=>{const m=i[d]!==!1,h=r===d;return t.jsxs(D.div,{layout:!0,transition:{duration:.28,ease:[.22,1,.36,1]},draggable:!0,onDragStart:p(d),onDragOver:b(d),onDragEnd:f,onDrop:y,className:k("flex items-center gap-3 py-2 rounded-md","hover:bg-oai-gray-100/60 dark:hover:bg-oai-gray-800/60",h&&"opacity-40"),style:{cursor:h?"grabbing":"grab"},children:[t.jsx(Fe,{className:"h-4 w-4 shrink-0 text-oai-gray-400 dark:text-oai-gray-500",strokeWidth:1.75,"aria-hidden":!0}),I(d)?t.jsx(ae,{provider:I(d),size:18,className:k("pointer-events-none",Qe)}):null,t.jsx("span",{className:"flex-1 text-sm text-oai-gray-900 dark:text-oai-gray-200 select-none",children:P(d)}),t.jsx("div",{onMouseDown:v=>v.stopPropagation(),draggable:!1,children:t.jsx(Je,{checked:m,onChange:()=>s(d),ariaLabel:`${a("limits.settings.toggle_visible")}: ${P(d)}`})})]},d)})})})}function et(e){if(!e||typeof e!="object")return"";const n=e.user_metadata&&typeof e.user_metadata=="object"?e.user_metadata:{},i=e.profile&&typeof e.profile=="object"?e.profile:{},s=n.full_name||n.name||i.name||n.user_name||n.preferred_username;return typeof s=="string"&&s.trim()?s.trim():typeof e.email=="string"&&e.email.includes("@")?e.email.split("@")[0].trim()||e.email.trim():typeof e.email=="string"?e.email.trim():""}function tt(e){return!e||typeof e!="object"?"":typeof e.email=="string"?e.email.trim():""}function nt(e){const n=typeof e=="string"?e.trim():"";if(!n)return null;const i=n.match(/^@?([A-Za-z0-9][A-Za-z0-9-]{0,38})$/),s=n.match(/^https:\/\/github\.com\/([A-Za-z0-9][A-Za-z0-9-]{0,38})\/?$/i),o=i?.[1]||s?.[1];return o?`https://github.com/${o}`:null}function L(e,n){console.warn(`[tokentracker] settings ${e}:`,n)}function at(e,n,i){const[s,o]=c.useState(()=>se()),r=n&&i&&oe(),l=c.useCallback(async()=>{const u=!s;if(re(u),o(u),!!u)try{await le(()=>e())}catch(g){L("cloud sync",g)}},[s,e]);return{cloudSyncOn:s,handleCloudSyncToggle:l,showLocalCloudSync:r}}function it(e){const[n,i]=c.useState(!1),[s,o]=c.useState(!1),[r,l]=c.useState(!1),[u,g]=c.useState(!1),[p,b]=c.useState(null),[f,y]=c.useState(!1),[d,m]=c.useState(""),[h,v]=c.useState(!1),[S,E]=c.useState(""),[z,Z]=c.useState(""),[W,q]=c.useState(!1),[K,Y]=c.useState(null),Q=c.useMemo(()=>et(e),[e]),J=c.useMemo(()=>tt(e),[e]),X=c.useMemo(()=>typeof e?.id=="string"?e.id.trim():"",[e]),ee=c.useMemo(()=>({setAnonymousOn:o,setCustomDisplayName:b,setGithubUrl:E,setProfileLoading:l,setPublicProfileOn:i,setShowGithubOn:v}),[]);return{anonymousOn:s,customDisplayName:p,displayName:Q,editingGithub:W,editingName:f,email:J,githubError:K,githubInput:z,githubUrl:S,loadSetters:ee,nameInput:d,profileLoading:r,profileSaving:u,publicProfileOn:n,setAnonymousOn:o,setCustomDisplayName:b,setEditingGithub:q,setEditingName:y,setGithubError:Y,setGithubInput:Z,setGithubUrl:E,setNameInput:m,setProfileLoading:l,setProfileSaving:g,setPublicProfileOn:i,setShowGithubOn:v,showGithubOn:h,userId:X}}function st(e,n,i){c.useEffect(()=>{if(!n)return;let s=!0;return i.setProfileLoading(!0),(async()=>{try{const o=await T({getAccessToken:e});if(!s||!o)return;const r=await ce({accessToken:o});if(!s)return;i.setPublicProfileOn(!!r?.enabled),i.setAnonymousOn(!!r?.anonymous),r?.display_name&&i.setCustomDisplayName(r.display_name),i.setShowGithubOn(!!r?.show_github_url),i.setGithubUrl(r?.github_url||"")}catch(o){L("load public profile",o)}finally{s&&i.setProfileLoading(!1)}})(),()=>{s=!1}},[e,n,i])}function ot(e,n){return c.useCallback(async(i,{label:s,onError:o,onSuccess:r}={})=>{if(n.profileSaving)return!1;n.setProfileSaving(!0);try{const l=await T({getAccessToken:e});if(!l)return!1;const u=await ue({accessToken:l,...i});return r?.(u),!0}catch(l){return o?o(l):L(s||"mutate profile",l),!1}finally{n.setProfileSaving(!1)}},[e,n])}function rt(e,n){return{anonymousOn:e.anonymousOn,customDisplayName:e.customDisplayName,displayName:e.displayName,editingName:e.editingName,handleAnonymousToggle:n.handleAnonymousToggle,handleSaveName:n.handleSaveName,nameInput:e.nameInput,profileLoading:e.profileLoading,profileSaving:e.profileSaving,setEditingName:e.setEditingName,setNameInput:e.setNameInput,startEditingName:n.startEditingName}}function lt(e,n){return{editingGithub:e.editingGithub,githubError:e.githubError,githubInput:e.githubInput,githubUrl:e.githubUrl,handleSaveGithub:n.handleSaveGithub,handleShowGithubToggle:n.handleShowGithubToggle,profileLoading:e.profileLoading,profileSaving:e.profileSaving,setEditingGithub:e.setEditingGithub,setGithubError:e.setGithubError,setGithubInput:e.setGithubInput,showGithubOn:e.showGithubOn,startEditingGithub:n.startEditingGithub}}function ct(e,n){const i=c.useCallback(async()=>{const o=!e.publicProfileOn;await n({enabled:o},{label:"toggle public profile",onSuccess:()=>e.setPublicProfileOn(o)})},[n,e]);return{handleAnonymousToggle:c.useCallback(async()=>{const o=!e.anonymousOn;await n({anonymous:o},{label:"toggle anonymous",onSuccess:()=>e.setAnonymousOn(o)})},[n,e]),handlePublicProfileToggle:i}}function ut(e,n,i){const s=c.useCallback(async()=>{const r=e.nameInput.trim().slice(0,50);r&&await n({display_name:r},{label:"save display name",onSuccess:()=>{e.setCustomDisplayName(r),e.setEditingName(!1),i?.()}})},[n,e,i]),o=c.useCallback(()=>{e.setNameInput(e.customDisplayName||e.displayName),e.setEditingName(!0)},[e]);return{handleSaveName:s,startEditingName:o}}function dt(e,n){const i=c.useCallback(async()=>{if(!e.showGithubOn&&!e.githubUrl){e.setEditingGithub(!0),e.setGithubInput(""),e.setGithubError(null);return}const r=!e.showGithubOn;await n({show_github_url:r},{label:"toggle GitHub profile",onSuccess:()=>e.setShowGithubOn(r)})},[n,e]),s=c.useCallback(async()=>{const r=nt(e.githubInput);if(e.githubInput.trim()&&!r){e.setGithubError(a("settings.account.githubUrlInvalid"));return}e.setGithubError(null),await n({github_url:r,show_github_url:!!r},{label:"save GitHub profile",onError:l=>e.setGithubError(l?.message||a("settings.account.githubUrlInvalid")),onSuccess:l=>{e.setGithubUrl(l?.github_url||r||""),e.setShowGithubOn(!!r),e.setEditingGithub(!1)}})},[n,e]),o=c.useCallback(()=>{e.setGithubInput(e.githubUrl),e.setGithubError(null),e.setEditingGithub(!0)},[e]);return{handleSaveGithub:s,handleShowGithubToggle:i,startEditingGithub:o}}function gt(){const e=ie(),n=it(e.user),i=at(e.getAccessToken,e.enabled,e.signedIn);st(e.getAccessToken,e.signedIn,n.loadSetters);const s=ot(e.getAccessToken,n),o=ct(n,s),r=ut(n,s,e.refreshDisplayName),l=dt(n,s);return{...e,...i,email:n.email,handlePublicProfileToggle:o.handlePublicProfileToggle,userId:n.userId,name:rt(n,{...o,...r}),github:lt(n,l),profileLoading:n.profileLoading,profileSaving:n.profileSaving,publicProfileOn:n.publicProfileOn}}function $({disabled:e,onCancel:n,onSave:i,saveLabel:s=a("settings.account.save")}){return t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:i,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:s}),t.jsx("button",{type:"button",onClick:n,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:a("settings.account.cancel")})]})}function ht({nameInput:e,setEditingName:n,setNameInput:i,profileSaving:s,handleSaveName:o}){return t.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[t.jsx("input",{type:"text",value:e,onChange:r=>i(r.target.value),onKeyDown:r=>{r.key==="Enter"&&o(),r.key==="Escape"&&n(!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:a("settings.account.displayName")}),t.jsx($,{disabled:s||!e.trim(),onCancel:()=>n(!1),onSave:o,saveLabel:s?a("settings.account.saving"):void 0})]})}function pt({githubError:e,githubInput:n,handleSaveGithub:i,profileSaving:s,setEditingGithub:o,setGithubError:r,setGithubInput:l}){return t.jsxs("div",{className:"mt-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("input",{type:"text",value:n,onChange:u=>{l(u.target.value),e&&r(null)},onKeyDown:u=>{u.key==="Enter"&&i(),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:a("settings.account.githubUrlPlaceholder")}),t.jsx($,{disabled:s,onCancel:()=>{o(!1),r(null)},onSave:i,saveLabel:s?a("settings.account.saving"):void 0})]}),e?t.jsx("div",{className:"mt-1.5 text-xs text-red-600 dark:text-red-400",children:e}):null]})}function V({disabled:e=!1,label:n,onClick:i,title:s}){return t.jsxs("button",{type:"button",onClick:i,disabled:e,title:s,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:[t.jsx(Ae,{className:"h-3.5 w-3.5","aria-hidden":!0}),n]})}function B({actions:e,editing:n,editor:i,hint:s,label:o}){return t.jsx("div",{className:"py-3",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("div",{className:"text-sm text-oai-gray-900 dark:text-oai-gray-200",children:o}),n?i:t.jsx("div",{className:"mt-0.5 truncate text-xs text-oai-gray-500 dark:text-oai-gray-400",children:s})]}),n?null:e]})})}function mt({name:e}){const n=e.anonymousOn?a("settings.account.displayNameDisabledWhileAnon"):void 0;return t.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[t.jsx(V,{disabled:e.anonymousOn,label:a("settings.account.edit"),onClick:e.startEditingName,title:n}),t.jsx(j,{checked:!e.anonymousOn,onChange:e.handleAnonymousToggle,disabled:e.profileLoading||e.profileSaving,ariaLabel:a("settings.account.displayName")})]})}function bt({name:e}){const{anonymousOn:n,customDisplayName:i,displayName:s,editingName:o,handleAnonymousToggle:r,handleSaveName:l,nameInput:u,profileLoading:g,profileSaving:p,setEditingName:b,setNameInput:f,startEditingName:y}=e,d=n?a("settings.account.displayNameAnonymousHint"):i||s;return t.jsx(B,{label:a("settings.account.displayName"),editing:o,hint:d,editor:t.jsx(ht,{nameInput:u,setEditingName:b,setNameInput:f,profileSaving:p,handleSaveName:l}),actions:t.jsx(mt,{name:e})})}function ft({github:e}){const{editingGithub:n,githubError:i,githubInput:s,githubUrl:o,handleSaveGithub:r,handleShowGithubToggle:l,profileLoading:u,profileSaving:g,setEditingGithub:p,setGithubError:b,setGithubInput:f,showGithubOn:y,startEditingGithub:d}=e,{enabled:m,toggle:h}=Ge();return t.jsxs(t.Fragment,{children:[t.jsx(B,{label:a("settings.account.githubUrl"),editing:n,hint:o||a("settings.account.githubUrlHint"),editor:t.jsx(pt,{githubError:i,githubInput:s,handleSaveGithub:r,profileSaving:g,setEditingGithub:p,setGithubError:b,setGithubInput:f}),actions:t.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[t.jsx(V,{label:a("settings.account.edit"),onClick:d}),t.jsx(j,{checked:y,onChange:l,disabled:u||g,ariaLabel:a("settings.account.githubUrl")})]})}),o&&t.jsx(x,{label:t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{children:a("settings.labs.qpd.label")}),t.jsx("span",{className:"px-1.5 py-0.5 text-[8px] font-semibold tracking-wider text-oai-gray-500 bg-oai-gray-100 dark:text-oai-gray-400 dark:bg-oai-gray-800/80 rounded uppercase scale-90 origin-left",children:a("qpd.card.badge")})]}),hint:a("settings.labs.qpd.hint"),control:t.jsx(j,{checked:m,onChange:h,ariaLabel:a("settings.labs.qpd.aria")})})]})}function xt(){const{openLoginModal:e}=de();return t.jsx(N,{title:a("settings.section.account"),children:t.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[t.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("settings.account.signedOutHint")}),t.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:a("settings.account.signIn")})]})})}function yt({name:e,github:n}){return t.jsxs(t.Fragment,{children:[t.jsx(bt,{name:e}),t.jsx(ft,{github:n})]})}function vt(){const e=gt();return e.enabled?e.signedIn?t.jsxs(N,{title:a("settings.section.account"),subtitle:e.email||e.name.customDisplayName||e.name.displayName,action:t.jsx(kt,{onSignOut:e.signOut}),children:[t.jsx(jt,{userId:e.userId}),t.jsx(Nt,{settings:e}),t.jsx(St,{checked:e.publicProfileOn,disabled:e.profileLoading||e.profileSaving,onChange:e.handlePublicProfileToggle}),t.jsx(wt,{visible:e.publicProfileOn,name:e.name,github:e.github})]}):t.jsx(xt,{}):null}function jt({userId:e}){const[n,i]=C.useState(!1);if(!e)return null;const s=async()=>{try{if(typeof navigator>"u"||!navigator.clipboard?.writeText)return;await navigator.clipboard.writeText(e),i(!0),globalThis.setTimeout(()=>i(!1),1200)}catch{i(!1)}};return t.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("div",{className:"text-sm text-oai-gray-900 dark:text-oai-gray-200",children:a("settings.account.userId")}),t.jsx("div",{className:"mt-0.5 truncate font-mono text-xs text-oai-gray-500 dark:text-oai-gray-400",children:e})]}),t.jsxs("button",{type:"button",onClick:s,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":a("settings.account.copyUserId"),children:[n?t.jsx(Ie,{className:"h-3.5 w-3.5","aria-hidden":!0}):t.jsx(Pe,{className:"h-3.5 w-3.5","aria-hidden":!0}),n?a("settings.account.copied"):a("settings.account.copy")]})]})}function kt({onSignOut:e}){return t.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:[t.jsx(Be,{className:"h-3.5 w-3.5","aria-hidden":!0}),a("settings.account.signOut")]})}function Nt({settings:e}){return e.showLocalCloudSync?t.jsx(x,{label:a("settings.account.cloudSync"),hint:a("settings.account.cloudSyncHint"),control:t.jsx(j,{checked:e.cloudSyncOn,onChange:e.handleCloudSyncToggle,ariaLabel:a("settings.account.cloudSync")})}):null}function St({checked:e,disabled:n,onChange:i}){return t.jsx(x,{label:a("settings.account.publicProfile"),hint:a("settings.account.publicProfileHint"),control:t.jsx(j,{checked:e,onChange:i,disabled:n,ariaLabel:a("settings.account.publicProfile")})})}function wt({visible:e,name:n,github:i}){return t.jsx(ge,{initial:!1,children:e?t.jsx(D.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:t.jsx(yt,{name:n,github:i})},"public-profile-fields"):null})}function Ct(){return[{value:"light",label:a("settings.appearance.theme.light"),Icon:pe},{value:"dark",label:a("settings.appearance.theme.dark"),Icon:me},{value:"system",label:a("settings.appearance.theme.system"),Icon:be}]}function Lt(){return[{value:ye,label:a("settings.appearance.language.system")},{value:ve,label:a("settings.appearance.language.english")},{value:je,label:a("settings.appearance.language.chinese")},{value:ke,label:a("settings.appearance.language.traditional_chinese")},{value:Ne,label:a("settings.appearance.language.japanese")},{value:Se,label:a("settings.appearance.language.korean")},{value:we,label:a("settings.appearance.language.german")}]}function Et(e){if(!e)return null;try{const n=new Date(e);return Number.isNaN(n.getTime())?null:n.toLocaleString()}catch{return null}}function Gt(e,n){const i=a(`settings.appearance.currency.rate_source.${e}`),s=Et(n),o=s?a("settings.appearance.currency.rate_updated",{when:s}):a("settings.appearance.currency.rate_never");return`${i} · ${o}`}function At({locale:e,setLocale:n}){const i=Lt();return t.jsx(F,{value:e,onValueChange:n,options:i,ariaLabel:a("settings.appearance.language.label"),className:"px-2.5 py-1.5 text-xs font-medium",leadingIcon:t.jsx($e,{className:"h-3.5 w-3.5 text-oai-gray-500 dark:text-oai-gray-400","aria-hidden":!0})})}function It({currency:e,setCurrency:n}){const i=fe().map(s=>({value:s.code,label:a(s.labelKey)}));return t.jsx(F,{value:e,onValueChange:n,options:i,ariaLabel:a("settings.appearance.currency.label"),className:"px-3 py-1.5 text-xs font-medium"})}function Pt({currency:e,rate:n,rateSource:i,rateFetchedAt:s}){if(e===xe)return t.jsx(t.Fragment,{children:a("settings.appearance.currency.hint")});const o=Gt(i,s);return t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t.jsx("span",{children:`1 USD = ${n.toFixed(4)} ${e}`}),t.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:t.jsx(Oe,{className:"h-3.5 w-3.5","aria-hidden":!0})})]})}function _t(){const{theme:e,setTheme:n}=he(),{locale:i,setLocale:s}=U(),{currency:o,rate:r,rateSource:l,rateFetchedAt:u,setCurrency:g}=_e();return t.jsxs(N,{title:a("settings.section.appearance"),children:[t.jsx(x,{label:a("settings.appearance.theme.label"),hint:a("settings.appearance.theme.hint"),control:t.jsx(M,{options:Ct(),value:e,onChange:n})}),t.jsx(x,{label:a("settings.appearance.language.label"),hint:a("settings.appearance.language.hint"),control:t.jsx(At,{locale:i,setLocale:s})}),t.jsx(x,{label:a("settings.appearance.currency.label"),hint:t.jsx(Pt,{currency:o,rate:r,rateSource:l,rateFetchedAt:u}),control:t.jsx(It,{currency:o,setCurrency:g})})]})}function Ot(){const{available:e,settings:n,setSetting:i,runAction:s}=R();if(!e)return null;const o=!!n?.launchAtLogin,r=n?.launchAtLoginSupported!==!1,l=n?.updateStatus||null,u=!!n?.updateBusy,g=!!n?.isSyncing;return t.jsxs(N,{title:a("settings.section.menubar"),children:[r?t.jsx(x,{label:a("settings.menubar.launchAtLogin"),hint:a("settings.menubar.launchAtLoginHint"),control:t.jsx(j,{checked:o,onChange:()=>i("launchAtLogin",!o),ariaLabel:a("settings.menubar.launchAtLogin")})}):null,t.jsx(x,{label:a("settings.menubar.syncNow"),hint:a("settings.menubar.syncNowHint"),control:t.jsxs("button",{type:"button",onClick:()=>s("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:[t.jsx(Ce,{className:k("h-3.5 w-3.5",g&&"animate-spin"),"aria-hidden":!0}),g?a("settings.menubar.syncing"):a("settings.menubar.syncNow")]})}),t.jsx(x,{label:a("settings.menubar.updates"),hint:l||void 0,control:t.jsxs("button",{type:"button",onClick:()=>s("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:[t.jsx(Te,{className:"h-3.5 w-3.5","aria-hidden":!0}),a("settings.menubar.checkUpdates")]})})]})}function Dt(e,n){function i(r){return r.replace(/^v/,"").split(".").map(Number)}const s=i(e),o=i(n);for(let r=0;r<Math.max(s.length,o.length);r++){const l=s[r]||0,u=o[r]||0;if(l<u)return!0;if(l>u)return!1}return!1}function Tt(){const{available:e,settings:n,runAction:i}=R(),s=e&&n?.version,[o,r]=C.useState(!1),[l,u]=C.useState({open:!1,latestVersion:"",htmlUrl:""}),{resolvedLocale:g}=U(),p="0.75.1",b=async()=>{r(!0);try{const h=await fetch("https://api.github.com/repos/mm7894215/TokenTracker/releases/latest");if(!h.ok)throw new Error("Failed to fetch");const v=await h.json(),S=v.tag_name;Dt(p,S)?u({open:!0,latestVersion:S,htmlUrl:v.html_url}):A({title:a("settings.menubar.updates.upToDate")})}catch(h){console.error("Check updates failed:",h),A({title:a("settings.menubar.updates.failed")})}finally{r(!1)}},f=a("settings.menubar.updates.modalTitle"),y=a("settings.menubar.updates.modalDescription",{version:l.latestVersion}),d=a("settings.menubar.updates.modalConfirm"),m=a("settings.menubar.updates.modalCancel");return t.jsxs("div",{className:"mt-6 flex flex-col items-center justify-center gap-4 text-xs text-oai-gray-500 dark:text-oai-gray-500",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[s?t.jsxs(t.Fragment,{children:[t.jsx("span",{children:a("settings.menubar.updates.footerCombined",{barVersion:n.version,coreVersion:p})}),t.jsx("span",{"aria-hidden":!0,children:"·"}),t.jsx("button",{type:"button",onClick:()=>i("openAbout"),className:"underline-offset-2 transition-colors hover:text-oai-gray-700 hover:underline dark:hover:text-oai-gray-300",children:"GitHub"}),t.jsx("span",{"aria-hidden":!0,children:"·"})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{children:a("settings.menubar.updates.footerCore",{version:p})}),t.jsx("span",{"aria-hidden":!0,children:"·"}),t.jsx("button",{type:"button",onClick:b,disabled:o,className:"underline-offset-2 transition-colors hover:text-oai-gray-700 hover:underline dark:hover:text-oai-gray-300 disabled:opacity-50",children:o?a("settings.menubar.updates.checking"):a("settings.menubar.checkUpdates")}),t.jsx("span",{"aria-hidden":!0,children:"·"})]}),t.jsxs("a",{href:Le,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:[t.jsx(Me,{className:"h-3.5 w-3.5","aria-hidden":!0}),a("settings.footer.statusPage")]})]}),t.jsx(De,{open:l.open,title:f,description:y,confirmLabel:d,cancelLabel:m,onConfirm:()=>{window.open(l.htmlUrl,"_blank"),u(h=>({...h,open:!1}))},onCancel:()=>u(h=>({...h,open:!1}))})]})}function Ut({prefs:e}){return t.jsx(M,{options:[{value:_.USED,label:a("limits.settings.display_mode_used")},{value:_.REMAINING,label:a("limits.settings.display_mode_remaining")}],value:e.displayMode,onChange:e.setDisplayMode})}function en(){const e=Ee();return t.jsx("div",{className:"flex flex-1 flex-col font-oai text-oai-black antialiased dark:text-oai-white",children:t.jsx("main",{className:"flex-1 pb-12 pt-8 sm:pb-16 sm:pt-10",children:t.jsxs("div",{className:"mx-auto max-w-3xl px-4 sm:px-6",children:[t.jsxs("div",{className:"mb-8",children:[t.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:text-4xl",children:a("settings.page.title")}),t.jsx("p",{className:"mt-2 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("settings.page.subtitle")})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(_t,{}),t.jsx(Ot,{}),t.jsx(vt,{}),t.jsx(N,{title:a("settings.section.limits"),action:t.jsx(Ut,{prefs:e}),children:t.jsx(Xe,{prefs:e})})]}),t.jsx(Tt,{})]})})})}export{en as SettingsPage};
@@ -1 +0,0 @@
1
- import{j as e,N as o,cb as I,a7 as P,r as u,b4 as B,R as D,a0 as M}from"./main-BROCryhX.js";import{S as E}from"./Select-BeOyk3KD.js";import{u as K,T as G}from"./use-native-settings-slktI0_m.js";import{F as L,S as R,a as O}from"./FadeIn-BwX09jrM.js";import{A as $}from"./arrow-up-right-xu1jmhXG.js";import{D as z}from"./download-BOHq4-mm.js";import"./SelectItemText-BsXsF9WO.js";import"./useScrollLock-Pp7C7LT3.js";import"./check-B_Mz8JQb.js";import"./Card-8mPQHqFP.js";const H=["todayTokens","todayCost"],W=[{id:"todayTokens",label:"Today Tokens",shortLabel:"Tokens",category:"tokens"},{id:"todayCost",label:"Today Cost",shortLabel:"Cost",category:"cost"},{id:"last7dTokens",label:"Last 7 Days",shortLabel:"7d",category:"tokens"},{id:"totalTokens",label:"Total Tokens",shortLabel:"Total",category:"tokens"},{id:"totalCost",label:"Total Cost",shortLabel:"All $",category:"cost"},{id:"claude5h",label:"Claude 5h Limit",shortLabel:"Cl 5h",category:"limits"},{id:"claude7d",label:"Claude 7d Limit",shortLabel:"Cl 7d",category:"limits"},{id:"codex5h",label:"Codex 5h Limit",shortLabel:"Cx 5h",category:"limits"},{id:"codex7d",label:"Codex 7d Limit",shortLabel:"Cx 7d",category:"limits"},{id:"codexCredits",label:"Codex Credit Limit",shortLabel:"Cx Cred",category:"limits"},{id:"codexSpark5h",label:"Codex Spark 5h Limit",shortLabel:"Cx Spark 5h",category:"limits"},{id:"codexSpark7d",label:"Codex Spark 7d Limit",shortLabel:"Cx Spark 7d",category:"limits"},{id:"cursorPlan",label:"Cursor Plan Limit",shortLabel:"Cu Plan",category:"limits"},{id:"cursorAuto",label:"Cursor Auto Limit",shortLabel:"Cu Auto",category:"limits"},{id:"cursorAPI",label:"Cursor API Limit",shortLabel:"Cu API",category:"limits"},{id:"geminiPro",label:"Gemini Pro Limit",shortLabel:"Gm Pro",category:"limits"},{id:"geminiFlash",label:"Gemini Flash Limit",shortLabel:"Gm Flash",category:"limits"},{id:"geminiLite",label:"Gemini Lite Limit",shortLabel:"Gm Lite",category:"limits"},{id:"kimiWeekly",label:"Kimi Weekly Limit",shortLabel:"Km Wk",category:"limits"},{id:"kimi5h",label:"Kimi 5h Limit",shortLabel:"Km 5h",category:"limits"},{id:"kimiTotal",label:"Kimi Total Limit",shortLabel:"Km Tot",category:"limits"},{id:"kiroMonth",label:"Kiro Monthly Limit",shortLabel:"Kr Mo",category:"limits"},{id:"kiroBonus",label:"Kiro Bonus Limit",shortLabel:"Kr Bn",category:"limits"},{id:"copilotPremium",label:"Copilot Premium Limit",shortLabel:"Co Prem",category:"limits"},{id:"copilotChat",label:"Copilot Chat Limit",shortLabel:"Co Chat",category:"limits"},{id:"antigravityClaudeWeekly",label:"Antigravity Claude 7d Limit",shortLabel:"Ag Cl 7d",category:"limits"},{id:"antigravityClaude5h",label:"Antigravity Claude 5h Limit",shortLabel:"Ag Cl 5h",category:"limits"},{id:"antigravityGeminiWeekly",label:"Antigravity Gemini 7d Limit",shortLabel:"Ag Gm 7d",category:"limits"},{id:"antigravityGemini5h",label:"Antigravity Gemini 5h Limit",shortLabel:"Ag Gm 5h",category:"limits"}];function C(t,a=W,s=2){const i=new Set(a.map(n=>n.id)),l=new Set,r=Array.isArray(t)?t.filter(n=>!i.has(n)||l.has(n)?!1:(l.add(n),!0)):[];return(r.length>0?r:H).slice(0,Math.max(1,Number(s)||2))}const U=264,X=124,h="ui-rounded, -apple-system, system-ui",N=["#5A8CF2","#9973E6","#4DB8A6","#E68C59"],V={claude:"#C77DFF",codex:"#34C759",cursor:"#FFCC00",gemini:"#0A84FF"};function Y(t){return t>=.9?"#E64D4D":t>=.7?"#D9A633":"#33B866"}function b({size:t="sm",children:a}){const s=t==="lg",i=s?560:264,l=s?32:22;return e.jsx("div",{className:M("flex w-full items-center justify-center rounded-xl bg-oai-gray-100 dark:bg-oai-gray-950/60",s?"py-10 sm:py-14 px-6":"py-6 px-4"),children:e.jsx("div",{className:"overflow-hidden bg-white dark:bg-oai-gray-800 shadow-oai-md dark:shadow-[0_2px_4px_rgba(0,0,0,0.4),0_8px_24px_rgba(0,0,0,0.5)]",style:{width:"100%",maxWidth:i,aspectRatio:`${U} / ${X}`,borderRadius:l},children:a})})}function Z({size:t="sm"}){const a="M0,104 L14,104 C26,98 34,100 44,96 S58,88 68,92 80,100 90,94 102,80 112,82 126,92 136,88 150,74 162,76 178,88 188,86 204,72 216,74 236,84 250,80 L264,80",s=`${a} L264,124 L0,124 Z`,i=`sparkArea-${t}`;return e.jsx(b,{size:t,children:e.jsxs("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#0A84FF",stopOpacity:"0.18"}),e.jsx("stop",{offset:"100%",stopColor:"#0A84FF",stopOpacity:"0"})]})}),e.jsx("text",{x:"14",y:"20",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"700",letterSpacing:"0.6",children:"TODAY"}),e.jsx("text",{x:"14",y:"46",className:"fill-oai-black dark:fill-white",fontSize:"22",fontWeight:"700",fontFamily:h,children:"203.2M"}),e.jsx("text",{x:"14",y:"60",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:h,children:"$129.56 ±0%"}),e.jsx("text",{x:"134",y:"20",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"700",letterSpacing:"0.6",children:"7 DAYS"}),e.jsx("text",{x:"134",y:"46",className:"fill-oai-black dark:fill-white",fontSize:"22",fontWeight:"700",fontFamily:h,children:"880.9M"}),e.jsx("text",{x:"134",y:"60",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:h,children:"$673.61"}),e.jsx("path",{d:s,fill:`url(#${i})`,stroke:"none"}),e.jsx("path",{d:a,fill:"none",stroke:"#0A84FF",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})})}const S=(()=>{const s=[];for(let i=0;i<26;i++)for(let l=0;l<7;l++){const r=Math.sin((i+1)*12.9898+(l+1)*78.233+17)*43758.5453,c=Math.floor(Math.abs(r-Math.floor(r))*100);s.push({w:i,d:l,v:c})}return s})();function A(t,a){return t<18?a?"#262626":"#e5e5e5":t<38?"rgba(10, 132, 255, 0.28)":t<58?"rgba(10, 132, 255, 0.50)":t<80?"rgba(10, 132, 255, 0.75)":"#0A84FF"}function q(){return e.jsx(b,{children:e.jsxs("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:[e.jsx("g",{transform:`translate(${19.5}, 10)`,className:"hidden dark:inline",children:S.map(r=>e.jsx("rect",{x:r.w*(7.5+1.2),y:r.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:A(r.v,!0)},`d-${r.w}-${r.d}`))}),e.jsx("g",{transform:`translate(${19.5}, 10)`,className:"dark:hidden",children:S.map(r=>e.jsx("rect",{x:r.w*(7.5+1.2),y:r.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:A(r.v,!1)},`l-${r.w}-${r.d}`))}),e.jsx("text",{x:19.5,y:"102",className:"fill-oai-black dark:fill-white",fontSize:"10",fontWeight:"700",fontFamily:h,children:"10.3B"}),e.jsx("text",{x:19.5+30,y:"102",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"9",fontWeight:"500",children:"tokens · 202 active days"})]})})}function J(){const t=[{name:"claude-opus-4-6",value:"586.4M",pct:59},{name:"claude-sonnet-4-5-20250929",value:"218.7M",pct:22},{name:"gpt-5.4",value:"80.6M",pct:8},{name:"composer-2-fast",value:"52.1M",pct:5}],a=22,s=28,i=14,l=236;return e.jsx(b,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((r,c)=>{const n=s+c*a,g=N[c%N.length];return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:g}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:r.name}),e.jsx("text",{x:"218",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"9",fontWeight:"600",fontFamily:h,children:r.value}),e.jsxs("text",{x:"250",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"600",fontFamily:h,children:[r.pct,"%"]}),e.jsx("rect",{x:i,y:n+4,width:l,height:"2.8",rx:"1.4",className:"fill-oai-gray-200 dark:fill-oai-gray-700"}),e.jsx("rect",{x:i,y:n+4,width:Math.max(l*(r.pct/100),4),height:"2.8",rx:"1.4",fill:g})]},r.name)})})})}function Q(){const t=[{label:"Claude · 7d",source:"claude",reset:"in 1d",pct:61},{label:"Claude · 5h",source:"claude",reset:"in 4h 28m",pct:4},{label:"Cursor",source:"cursor",reset:"in 25d",pct:51},{label:"Codex · weekly",source:"codex",reset:"in 1d",pct:32}],a=22,s=28,i=14,l=236;return e.jsx(b,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((r,c)=>{const n=s+c*a,g=V[r.source],y=Y(r.pct/100);return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:g}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:r.label}),e.jsx("text",{x:"218",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:h,children:r.reset}),e.jsxs("text",{x:"250",y:n,textAnchor:"end",className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"700",fontFamily:h,children:[r.pct,"%"]}),e.jsx("rect",{x:i,y:n+4,width:l,height:"2.8",rx:"1.4",className:"fill-oai-gray-200 dark:fill-oai-gray-700"}),e.jsx("rect",{x:i,y:n+4,width:Math.max(l*(r.pct/100),4),height:"2.8",rx:"1.4",fill:y})]},r.label)})})})}function ee(t){switch(t.category){case"cost":return"$8.42";case"limits":return"62%";default:return t.id==="last7dTokens"?"1.8B":"203M"}}function te(t,a){switch(t){case"todayTokens":return o("menubar.metric.today_tokens");case"todayCost":return o("menubar.metric.today_cost");case"last7dTokens":return o("menubar.metric.last_7d_tokens");case"totalTokens":return o("menubar.metric.total_tokens");case"totalCost":return o("menubar.metric.total_cost");case"claude5h":return o("menubar.metric.claude_5h");case"claude7d":return o("menubar.metric.claude_7d");case"codex5h":return o("menubar.metric.codex_5h");case"codex7d":return o("menubar.metric.codex_7d");case"codexCredits":return o("menubar.metric.codex_credits");case"codexSpark5h":return o("menubar.metric.codex_spark_5h");case"codexSpark7d":return o("menubar.metric.codex_spark_7d");default:return a}}function ae(t,a){const s=new Set(a.map(l=>l.id)),i=t.filter(l=>s.has(l));for(const l of a){if(i.length>=2)break;i.includes(l.id)||i.push(l.id)}return i.slice(0,2)}function ie({slotConfigs:t,showStats:a}){return e.jsx("div",{className:"flex justify-center rounded-xl bg-gradient-to-b from-oai-gray-100 to-oai-gray-200 px-6 py-8 dark:from-oai-gray-950/80 dark:to-oai-gray-900/80",children:e.jsxs("div",{className:"inline-flex items-stretch rounded-md shadow-[0_1px_3px_rgba(0,0,0,0.18)] ring-1 ring-black/10 dark:ring-white/10 px-3",style:{background:"linear-gradient(180deg, #2c2c2e 0%, #1c1c1e 100%)"},children:[e.jsx("div",{className:"flex items-center pl-2 pr-1 py-2.5",children:e.jsx("img",{src:"/clawd/mini/idle-tight.svg",alt:"","aria-hidden":"true",className:"block shrink-0",style:{height:22,width:"auto"},draggable:"false"})}),a?t.map(({slot:s,item:i},l)=>e.jsxs(D.Fragment,{children:[l>0?e.jsx("span",{className:"my-1 w-px bg-white/20","aria-hidden":"true"}):null,e.jsxs("div",{className:M("flex min-w-[52px] flex-col items-center justify-center py-1.5",l===0?"pl-1 pr-2":"px-2"),children:[e.jsx("span",{className:"text-[13px] font-semibold leading-none tabular-nums text-white",children:i?.previewValue||"--"}),e.jsx("span",{className:"mt-[2px] text-[6px] font-semibold uppercase leading-none text-white/75",children:i?.shortLabel||"Metric"})]})]},s)):null]})})}function re({slot:t,value:a,options:s,disabled:i,onChange:l}){const r=t===0?o("menubar.slot.primary"):o("menubar.slot.secondary");return e.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.08em] text-oai-gray-500 dark:text-oai-gray-400",children:r}),e.jsx(E,{value:a,disabled:i,ariaLabel:r,onValueChange:c=>l(t,c),options:s.map(c=>({value:c.id,label:c.displayLabel})),matchTriggerWidth:!0,className:"w-full px-3 py-2 text-sm font-medium"})]})}function p({label:t,hint:a,checked:s,disabled:i,onChange:l}){return e.jsxs("div",{className:"flex items-center justify-between gap-3 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-oai-black dark:text-white",children:t}),a?e.jsx("p",{className:"mt-0.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:a}):null]}),e.jsx(G,{checked:s,disabled:i,onChange:l,ariaLabel:t})]})}function se(){const{available:t,settings:a,setSetting:s}=K(),i=u.useMemo(()=>(Array.isArray(a?.menuBarAvailableItems)?a.menuBarAvailableItems:W).map(m=>({...m,displayLabel:te(m.id,m.label),previewValue:ee(m)})),[a?.menuBarAvailableItems]),l=Number(a?.menuBarMaxItems)||2,r=u.useMemo(()=>C(a?.menuBarItems,i,l),[i,l,a?.menuBarItems]),c=u.useMemo(()=>ae(r,i),[i,r]),n=a?.showStats!==!1,g=d=>{s("menuBarItems",C(d,i,l))},y=(d,m)=>{const x=[...c];x[d===0?1:0]!==m&&(x[d]=m,g(x))},k=[0,1].map(d=>{const m=c[d]||i[d]?.id||"",v=c[d===0?1:0],T=i.filter(f=>f.id===m||f.id!==v),F=i.find(f=>f.id===m);return{slot:d,currentValue:m,options:T,item:F}}),w=a?.animatedIcon!==!1,j=a?.confettiOnReset!==!1;return e.jsxs("article",{className:"rounded-xl border border-oai-gray-200 bg-white p-5 transition-colors duration-200 dark:border-oai-gray-800 dark:bg-oai-gray-900 sm:p-6",children:[e.jsx(ie,{slotConfigs:k,showStats:n}),e.jsx("div",{className:"mt-5 grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4",children:k.map(({slot:d,currentValue:m,options:x})=>e.jsx(re,{slot:d,value:m,options:x,disabled:!t||!n,onChange:y},d))}),e.jsxs("div",{className:"mt-5 divide-y divide-oai-gray-100 border-t border-oai-gray-100 dark:divide-oai-gray-800 dark:border-oai-gray-800",children:[e.jsx(p,{label:o("settings.menubar.showStats"),hint:t?o("settings.menubar.showStatsHint"):o("menubar.native_only"),checked:n,disabled:!t,onChange:()=>s("showStats",!n)}),e.jsx(p,{label:o("settings.menubar.animatedIcon"),hint:o("settings.menubar.animatedIconHint"),checked:w,disabled:!t,onChange:()=>s("animatedIcon",!w)}),e.jsx(p,{label:o("settings.menubar.confettiOnReset"),hint:o("settings.menubar.confettiOnResetHint"),checked:j,disabled:!t,onChange:()=>s("confettiOnReset",!j)})]})]})}function le(){const[t,a]=u.useState("loading");return u.useEffect(()=>{if(typeof window>"u")return;if(B()){a("native");return}const s=(navigator.userAgent||"").toLowerCase(),i=/mac/.test(s)&&!/iphone|ipad/.test(s);a(i?"mac-web":"other")},[]),t}function oe(){const t=le();return t==="loading"?e.jsx("div",{className:"h-10 w-40","aria-hidden":"true"}):t==="native"?e.jsxs("button",{type:"button",onClick:()=>I("openWidgetGallery"),className:"inline-flex h-10 items-center gap-2 rounded-lg bg-oai-black px-4 text-sm font-medium text-white transition-colors hover:bg-oai-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:bg-white dark:text-oai-black dark:hover:bg-oai-gray-200",children:[o("widgets.cta.open_gallery"),e.jsx($,{className:"h-4 w-4","aria-hidden":"true"})]}):t==="mac-web"?e.jsxs("a",{href:"https://github.com/mm7894215/TokenTracker/releases/latest",target:"_blank",rel:"noopener noreferrer",className:"inline-flex h-10 items-center gap-2 rounded-lg bg-oai-black px-4 text-sm font-medium text-white no-underline transition-colors hover:bg-oai-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:bg-white dark:text-oai-black dark:hover:bg-oai-gray-200",children:[e.jsx(z,{className:"h-4 w-4","aria-hidden":"true"}),o("widgets.cta.download")]}):e.jsxs("span",{className:"inline-flex h-10 items-center gap-2 rounded-lg border border-oai-gray-200 bg-oai-gray-50 px-4 text-sm font-medium text-oai-gray-500 dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-oai-gray-400",children:[e.jsx(P,{className:"h-4 w-4","aria-hidden":"true"}),o("widgets.cta.macos_only")]})}const ne=[{id:"summary",Preview:Z,nameKey:"widgets.summary.name",descKey:"widgets.summary.description"},{id:"heatmap",Preview:q,nameKey:"widgets.heatmap.name",descKey:"widgets.heatmap.description"},{id:"topModels",Preview:J,nameKey:"widgets.topModels.name",descKey:"widgets.topModels.description"},{id:"limits",Preview:Q,nameKey:"widgets.limits.name",descKey:"widgets.limits.description"}];function ce({Preview:t,nameKey:a,descKey:s}){return e.jsxs("article",{className:"flex h-full flex-col rounded-xl border border-oai-gray-200 bg-white p-4 transition-colors duration-200 dark:border-oai-gray-800 dark:bg-oai-gray-900 sm:p-5",children:[e.jsx(t,{}),e.jsxs("div",{className:"mt-4",children:[e.jsx("h3",{className:"text-[15px] font-semibold text-oai-black dark:text-white",children:o(a)}),e.jsx("p",{className:"mt-1.5 text-sm leading-relaxed text-oai-gray-500 dark:text-oai-gray-400",children:o(s)})]})]})}function _({titleKey:t}){return e.jsx("h2",{className:"mb-4 text-xl font-semibold tracking-tight text-oai-black dark:text-white sm:mb-5 sm:text-2xl",children:o(t)})}function ke(){return e.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:e.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:e.jsxs("div",{className:"mx-auto max-w-5xl px-4 sm:px-6",children:[e.jsx(L,{y:12,children:e.jsxs("header",{className:"mb-10 flex items-start justify-between gap-4 sm:mb-12",children:[e.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:text-4xl",children:o("widgets.page.title")}),e.jsx("div",{className:"shrink-0",children:e.jsx(oe,{})})]})}),e.jsx(L,{y:12,delay:.06,children:e.jsxs("section",{"aria-label":o("widgets.menubar.section.title"),className:"mb-12 sm:mb-14",children:[e.jsx(_,{titleKey:"widgets.menubar.section.title"}),e.jsx(se,{})]})}),e.jsxs("section",{"aria-label":o("widgets.gallery.section.title"),children:[e.jsx(_,{titleKey:"widgets.gallery.section.title"}),e.jsx(R,{staggerDelay:.08,initialDelay:.04,children:e.jsx("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2 lg:gap-5",children:ne.map(({id:t,Preview:a,nameKey:s,descKey:i})=>e.jsx(O,{children:e.jsx(ce,{Preview:a,nameKey:s,descKey:i})},t))})})]})]})})})}export{ke as WidgetsPage};
@@ -1 +0,0 @@
1
- import{c}from"./main-BROCryhX.js";const e=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],t=c("check",e);export{t as C};