tokentracker-cli 0.34.0 → 0.35.1
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/dashboard/dist/assets/ActivityHeatmap-HUG2wf_9.js +42 -0
- package/dashboard/dist/assets/{Card-aIQklHHp.js → Card-BRdnq8-k.js} +1 -1
- package/dashboard/dist/assets/DashboardPage-DJBZEynG.js +19 -0
- package/dashboard/dist/assets/{DevicePage-CuqXAWeG.js → DevicePage-BxCHzyu5.js} +1 -1
- package/dashboard/dist/assets/{DialogTitle-CNeoqAUd.js → DialogTitle-BF41YVn6.js} +1 -1
- package/dashboard/dist/assets/{FadeIn-DLCqO2k7.js → FadeIn-CsYsRptR.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-syBp0TMv.js → HeaderGithubStar-ZoIWfFe6.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-DSp8Gu3p.js → IpCheckPage-CXPYYQEu.js} +1 -1
- package/dashboard/dist/assets/{LandingPage-CdUYfJX9.js → LandingPage-BfcwouBK.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardAvatar-3zGkgsNt.js → LeaderboardAvatar-CGyaSA7g.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardPage-QWHc3NdM.js → LeaderboardPage-BOQMyVRl.js} +3 -3
- package/dashboard/dist/assets/{LeaderboardProfileModal-D0ylKDm1.js → LeaderboardProfileModal-CNWb6GZA.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardProfilePage-CIRXEzq9.js → LeaderboardProfilePage-BrkGee7P.js} +1 -1
- package/dashboard/dist/assets/{LimitsPage-BI6OZJ6Z.js → LimitsPage-DYzx9pp5.js} +1 -1
- package/dashboard/dist/assets/{LocalOnlyNotice-mpL0e0Yx.js → LocalOnlyNotice-BSlFMNhI.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-DKq55UDn.js → LoginPage-DTCO8G60.js} +1 -1
- package/dashboard/dist/assets/PopoverPopup-CAjthIuS.js +1 -0
- package/dashboard/dist/assets/{SettingsPage-SW_MynVy.js → SettingsPage-DDlD8qd9.js} +1 -1
- package/dashboard/dist/assets/SkillsPage-Cv0CQpGB.js +1 -0
- package/dashboard/dist/assets/{WidgetsPage-Bdz7-e2F.js → WidgetsPage-B56qFEsR.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-BuSh90dQ.js → WrappedPage-C9D-6P-R.js} +1 -1
- package/dashboard/dist/assets/{agent-logos-gEURrAhk.js → agent-logos-CJ4CQ0HE.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-DnzcfcLH.js → arrow-up-right-OHDkhx-y.js} +1 -1
- package/dashboard/dist/assets/check-BcU6hhFb.js +1 -0
- package/dashboard/dist/assets/{chevron-down-A-Yd61uD.js → chevron-down-BVozhieG.js} +1 -1
- package/dashboard/dist/assets/{download-LO8eYKuM.js → download-BOwIFon2.js} +1 -1
- package/dashboard/dist/assets/{info-C4MiVPvD.js → info-BNlH8ZDr.js} +1 -1
- package/dashboard/dist/assets/{main-CmNjwZqb.js → main-BHU0hIWS.js} +2 -2
- package/dashboard/dist/assets/{use-limits-display-prefs-DWRnMoYm.js → use-limits-display-prefs-mPyTqsYR.js} +1 -1
- package/dashboard/dist/assets/{use-native-settings-6QINkSUb.js → use-native-settings-DbaL1Woo.js} +1 -1
- package/dashboard/dist/assets/{use-usage-limits-DRceo1gm.js → use-usage-limits-CUlVKjou.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-OWcFD7bX.js → useCurrency-B70A0cjV.js} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/dashboard/dist/share.html +1 -1
- package/package.json +1 -1
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/dashboard/dist/assets/ActivityHeatmap-B4zB8pSl.js +0 -42
- package/dashboard/dist/assets/DashboardPage-Cgy94Hkz.js +0 -19
- package/dashboard/dist/assets/PopoverPopup-hv91V5bk.js +0 -1
- package/dashboard/dist/assets/SkillsPage-DteFqehH.js +0 -1
- package/dashboard/dist/assets/check-CGdPUCWD.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,A as o,ci as _,aI as P,r as u,cj as I,R as B,N as p}from"./main-CmNjwZqb.js";import{u as D,T as E}from"./use-native-settings-6QINkSUb.js";import{F as v,S as K,a as $}from"./FadeIn-DLCqO2k7.js";import{A as G}from"./arrow-up-right-DnzcfcLH.js";import{D as z}from"./download-LO8eYKuM.js";import{C as R}from"./chevron-down-A-Yd61uD.js";import"./Card-aIQklHHp.js";const H=["todayTokens","todayCost"],F=[{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:"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:"antigravityClaude",label:"Antigravity Claude Limit",shortLabel:"Ag Cl",category:"limits"},{id:"antigravityGPro",label:"Antigravity Gemini Pro Limit",shortLabel:"Ag GPro",category:"limits"},{id:"antigravityFlash",label:"Antigravity Flash Limit",shortLabel:"Ag Fl",category:"limits"}];function N(t,i=F,s=2){const a=new Set(i.map(n=>n.id)),l=new Set,r=Array.isArray(t)?t.filter(n=>!a.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 O=264,U=124,g="ui-rounded, -apple-system, system-ui",L=["#5A8CF2","#9973E6","#4DB8A6","#E68C59"],X={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:i}){const s=t==="lg",a=s?560:264,l=s?32:22;return e.jsx("div",{className:p("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:a,aspectRatio:`${O} / ${U}`,borderRadius:l},children:i})})}function V({size:t="sm"}){const i="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=`${i} L264,124 L0,124 Z`,a=`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:a,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:g,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:g,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:g,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:g,children:"$673.61"}),e.jsx("path",{d:s,fill:`url(#${a})`,stroke:"none"}),e.jsx("path",{d:i,fill:"none",stroke:"#0A84FF",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})})}const C=(()=>{const s=[];for(let a=0;a<26;a++)for(let l=0;l<7;l++){const r=Math.sin((a+1)*12.9898+(l+1)*78.233+17)*43758.5453,c=Math.floor(Math.abs(r-Math.floor(r))*100);s.push({w:a,d:l,v:c})}return s})();function S(t,i){return t<18?i?"#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 Z(){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:C.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:S(r.v,!0)},`d-${r.w}-${r.d}`))}),e.jsx("g",{transform:`translate(${19.5}, 10)`,className:"dark:hidden",children:C.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:S(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:g,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 q(){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}],i=22,s=28,a=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*i,h=L[c%L.length];return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:h}),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:g,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:g,children:[r.pct,"%"]}),e.jsx("rect",{x:a,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:a,y:n+4,width:Math.max(l*(r.pct/100),4),height:"2.8",rx:"1.4",fill:h})]},r.name)})})})}function J(){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}],i=22,s=28,a=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*i,h=X[r.source],y=Y(r.pct/100);return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:h}),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:g,children:r.reset}),e.jsxs("text",{x:"250",y:n,textAnchor:"end",className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"700",fontFamily:g,children:[r.pct,"%"]}),e.jsx("rect",{x:a,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:a,y:n+4,width:Math.max(l*(r.pct/100),4),height:"2.8",rx:"1.4",fill:y})]},r.label)})})})}function Q(t){switch(t.category){case"cost":return"$8.42";case"limits":return"62%";default:return t.id==="last7dTokens"?"1.8B":"203M"}}function ee(t,i){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");default:return i}}function te(t,i){const s=new Set(i.map(l=>l.id)),a=t.filter(l=>s.has(l));for(const l of i){if(a.length>=2)break;a.includes(l.id)||a.push(l.id)}return a.slice(0,2)}function ae({slotConfigs:t,showStats:i}){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"})}),i?t.map(({slot:s,item:a},l)=>e.jsxs(B.Fragment,{children:[l>0?e.jsx("span",{className:"my-1 w-px bg-white/20","aria-hidden":"true"}):null,e.jsxs("div",{className:p("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:a?.previewValue||"--"}),e.jsx("span",{className:"mt-[2px] text-[6px] font-semibold uppercase leading-none text-white/75",children:a?.shortLabel||"Metric"})]})]},s)):null]})})}function ie({slot:t,value:i,options:s,disabled:a,onChange:l}){const r=t===0?o("menubar.slot.primary"):o("menubar.slot.secondary");return e.jsxs("label",{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.jsxs("div",{className:"relative",children:[e.jsx("select",{value:i,disabled:a,"aria-label":r,onChange:c=>l(t,c.target.value),className:p("w-full appearance-none rounded-lg border border-oai-gray-200 bg-white px-3 py-2 pr-9 text-sm font-medium text-oai-black transition-colors hover:border-oai-gray-300 dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-white dark:hover:border-oai-gray-700",a&&"cursor-not-allowed opacity-50 hover:border-oai-gray-200 dark:hover:border-oai-gray-800"),children:s.map(c=>e.jsx("option",{value:c.id,children:c.displayLabel},c.id))}),e.jsx(R,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-oai-gray-400","aria-hidden":"true"})]})]})}function A({label:t,hint:i,checked:s,disabled:a,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}),i?e.jsx("p",{className:"mt-0.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:i}):null]}),e.jsx(E,{checked:s,disabled:a,onChange:l,ariaLabel:t})]})}function re(){const{available:t,settings:i,setSetting:s}=D(),a=u.useMemo(()=>(Array.isArray(i?.menuBarAvailableItems)?i.menuBarAvailableItems:F).map(m=>({...m,displayLabel:ee(m.id,m.label),previewValue:Q(m)})),[i?.menuBarAvailableItems]),l=Number(i?.menuBarMaxItems)||2,r=u.useMemo(()=>N(i?.menuBarItems,a,l),[a,l,i?.menuBarItems]),c=u.useMemo(()=>te(r,a),[a,r]),n=i?.showStats!==!1,h=d=>{s("menuBarItems",N(d,a,l))},y=(d,m)=>{const x=[...c];x[d===0?1:0]!==m&&(x[d]=m,h(x))},w=[0,1].map(d=>{const m=c[d]||a[d]?.id||"",j=c[d===0?1:0],W=a.filter(f=>f.id===m||f.id!==j),T=a.find(f=>f.id===m);return{slot:d,currentValue:m,options:W,item:T}}),k=i?.animatedIcon!==!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(ae,{slotConfigs:w,showStats:n}),e.jsx("div",{className:"mt-5 grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4",children:w.map(({slot:d,currentValue:m,options:x})=>e.jsx(ie,{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(A,{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(A,{label:o("settings.menubar.animatedIcon"),hint:o("settings.menubar.animatedIconHint"),checked:k,disabled:!t,onChange:()=>s("animatedIcon",!k)})]})]})}function se(){const[t,i]=u.useState("loading");return u.useEffect(()=>{if(typeof window>"u")return;if(I()){i("native");return}const s=(navigator.userAgent||"").toLowerCase(),a=/mac/.test(s)&&!/iphone|ipad/.test(s);i(a?"mac-web":"other")},[]),t}function le(){const t=se();return t==="loading"?e.jsx("div",{className:"h-10 w-40","aria-hidden":"true"}):t==="native"?e.jsxs("button",{type:"button",onClick:()=>_("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(G,{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 oe=[{id:"summary",Preview:V,nameKey:"widgets.summary.name",descKey:"widgets.summary.description"},{id:"heatmap",Preview:Z,nameKey:"widgets.heatmap.name",descKey:"widgets.heatmap.description"},{id:"topModels",Preview:q,nameKey:"widgets.topModels.name",descKey:"widgets.topModels.description"},{id:"limits",Preview:J,nameKey:"widgets.limits.name",descKey:"widgets.limits.description"}];function ne({Preview:t,nameKey:i,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(i)}),e.jsx("p",{className:"mt-1.5 text-sm leading-relaxed text-oai-gray-500 dark:text-oai-gray-400",children:o(s)})]})]})}function M({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 fe(){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(v,{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(le,{})})]})}),e.jsx(v,{y:12,delay:.06,children:e.jsxs("section",{"aria-label":o("widgets.menubar.section.title"),className:"mb-12 sm:mb-14",children:[e.jsx(M,{titleKey:"widgets.menubar.section.title"}),e.jsx(re,{})]})}),e.jsxs("section",{"aria-label":o("widgets.gallery.section.title"),children:[e.jsx(M,{titleKey:"widgets.gallery.section.title"}),e.jsx(K,{staggerDelay:.08,initialDelay:.04,children:e.jsx("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2 lg:gap-5",children:oe.map(({id:t,Preview:i,nameKey:s,descKey:a})=>e.jsx($,{children:e.jsx(ne,{Preview:i,nameKey:s,descKey:a})},t))})})]})]})})})}export{fe as WidgetsPage};
|
|
1
|
+
import{j as e,A as o,ci as _,aI as P,r as u,cj as I,R as B,M as p}from"./main-BHU0hIWS.js";import{u as D,T as E}from"./use-native-settings-DbaL1Woo.js";import{F as v,S as K,a as $}from"./FadeIn-CsYsRptR.js";import{A as G}from"./arrow-up-right-OHDkhx-y.js";import{D as z}from"./download-BOwIFon2.js";import{C as R}from"./chevron-down-BVozhieG.js";import"./Card-BRdnq8-k.js";const H=["todayTokens","todayCost"],F=[{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:"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:"antigravityClaude",label:"Antigravity Claude Limit",shortLabel:"Ag Cl",category:"limits"},{id:"antigravityGPro",label:"Antigravity Gemini Pro Limit",shortLabel:"Ag GPro",category:"limits"},{id:"antigravityFlash",label:"Antigravity Flash Limit",shortLabel:"Ag Fl",category:"limits"}];function N(t,i=F,s=2){const a=new Set(i.map(n=>n.id)),l=new Set,r=Array.isArray(t)?t.filter(n=>!a.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 O=264,U=124,g="ui-rounded, -apple-system, system-ui",L=["#5A8CF2","#9973E6","#4DB8A6","#E68C59"],X={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:i}){const s=t==="lg",a=s?560:264,l=s?32:22;return e.jsx("div",{className:p("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:a,aspectRatio:`${O} / ${U}`,borderRadius:l},children:i})})}function V({size:t="sm"}){const i="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=`${i} L264,124 L0,124 Z`,a=`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:a,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:g,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:g,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:g,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:g,children:"$673.61"}),e.jsx("path",{d:s,fill:`url(#${a})`,stroke:"none"}),e.jsx("path",{d:i,fill:"none",stroke:"#0A84FF",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})})}const C=(()=>{const s=[];for(let a=0;a<26;a++)for(let l=0;l<7;l++){const r=Math.sin((a+1)*12.9898+(l+1)*78.233+17)*43758.5453,c=Math.floor(Math.abs(r-Math.floor(r))*100);s.push({w:a,d:l,v:c})}return s})();function S(t,i){return t<18?i?"#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 Z(){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:C.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:S(r.v,!0)},`d-${r.w}-${r.d}`))}),e.jsx("g",{transform:`translate(${19.5}, 10)`,className:"dark:hidden",children:C.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:S(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:g,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 q(){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}],i=22,s=28,a=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*i,h=L[c%L.length];return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:h}),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:g,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:g,children:[r.pct,"%"]}),e.jsx("rect",{x:a,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:a,y:n+4,width:Math.max(l*(r.pct/100),4),height:"2.8",rx:"1.4",fill:h})]},r.name)})})})}function J(){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}],i=22,s=28,a=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*i,h=X[r.source],y=Y(r.pct/100);return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:h}),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:g,children:r.reset}),e.jsxs("text",{x:"250",y:n,textAnchor:"end",className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"700",fontFamily:g,children:[r.pct,"%"]}),e.jsx("rect",{x:a,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:a,y:n+4,width:Math.max(l*(r.pct/100),4),height:"2.8",rx:"1.4",fill:y})]},r.label)})})})}function Q(t){switch(t.category){case"cost":return"$8.42";case"limits":return"62%";default:return t.id==="last7dTokens"?"1.8B":"203M"}}function ee(t,i){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");default:return i}}function te(t,i){const s=new Set(i.map(l=>l.id)),a=t.filter(l=>s.has(l));for(const l of i){if(a.length>=2)break;a.includes(l.id)||a.push(l.id)}return a.slice(0,2)}function ae({slotConfigs:t,showStats:i}){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"})}),i?t.map(({slot:s,item:a},l)=>e.jsxs(B.Fragment,{children:[l>0?e.jsx("span",{className:"my-1 w-px bg-white/20","aria-hidden":"true"}):null,e.jsxs("div",{className:p("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:a?.previewValue||"--"}),e.jsx("span",{className:"mt-[2px] text-[6px] font-semibold uppercase leading-none text-white/75",children:a?.shortLabel||"Metric"})]})]},s)):null]})})}function ie({slot:t,value:i,options:s,disabled:a,onChange:l}){const r=t===0?o("menubar.slot.primary"):o("menubar.slot.secondary");return e.jsxs("label",{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.jsxs("div",{className:"relative",children:[e.jsx("select",{value:i,disabled:a,"aria-label":r,onChange:c=>l(t,c.target.value),className:p("w-full appearance-none rounded-lg border border-oai-gray-200 bg-white px-3 py-2 pr-9 text-sm font-medium text-oai-black transition-colors hover:border-oai-gray-300 dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-white dark:hover:border-oai-gray-700",a&&"cursor-not-allowed opacity-50 hover:border-oai-gray-200 dark:hover:border-oai-gray-800"),children:s.map(c=>e.jsx("option",{value:c.id,children:c.displayLabel},c.id))}),e.jsx(R,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-oai-gray-400","aria-hidden":"true"})]})]})}function A({label:t,hint:i,checked:s,disabled:a,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}),i?e.jsx("p",{className:"mt-0.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:i}):null]}),e.jsx(E,{checked:s,disabled:a,onChange:l,ariaLabel:t})]})}function re(){const{available:t,settings:i,setSetting:s}=D(),a=u.useMemo(()=>(Array.isArray(i?.menuBarAvailableItems)?i.menuBarAvailableItems:F).map(m=>({...m,displayLabel:ee(m.id,m.label),previewValue:Q(m)})),[i?.menuBarAvailableItems]),l=Number(i?.menuBarMaxItems)||2,r=u.useMemo(()=>N(i?.menuBarItems,a,l),[a,l,i?.menuBarItems]),c=u.useMemo(()=>te(r,a),[a,r]),n=i?.showStats!==!1,h=d=>{s("menuBarItems",N(d,a,l))},y=(d,m)=>{const x=[...c];x[d===0?1:0]!==m&&(x[d]=m,h(x))},w=[0,1].map(d=>{const m=c[d]||a[d]?.id||"",j=c[d===0?1:0],W=a.filter(f=>f.id===m||f.id!==j),T=a.find(f=>f.id===m);return{slot:d,currentValue:m,options:W,item:T}}),k=i?.animatedIcon!==!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(ae,{slotConfigs:w,showStats:n}),e.jsx("div",{className:"mt-5 grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4",children:w.map(({slot:d,currentValue:m,options:x})=>e.jsx(ie,{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(A,{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(A,{label:o("settings.menubar.animatedIcon"),hint:o("settings.menubar.animatedIconHint"),checked:k,disabled:!t,onChange:()=>s("animatedIcon",!k)})]})]})}function se(){const[t,i]=u.useState("loading");return u.useEffect(()=>{if(typeof window>"u")return;if(I()){i("native");return}const s=(navigator.userAgent||"").toLowerCase(),a=/mac/.test(s)&&!/iphone|ipad/.test(s);i(a?"mac-web":"other")},[]),t}function le(){const t=se();return t==="loading"?e.jsx("div",{className:"h-10 w-40","aria-hidden":"true"}):t==="native"?e.jsxs("button",{type:"button",onClick:()=>_("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(G,{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 oe=[{id:"summary",Preview:V,nameKey:"widgets.summary.name",descKey:"widgets.summary.description"},{id:"heatmap",Preview:Z,nameKey:"widgets.heatmap.name",descKey:"widgets.heatmap.description"},{id:"topModels",Preview:q,nameKey:"widgets.topModels.name",descKey:"widgets.topModels.description"},{id:"limits",Preview:J,nameKey:"widgets.limits.name",descKey:"widgets.limits.description"}];function ne({Preview:t,nameKey:i,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(i)}),e.jsx("p",{className:"mt-1.5 text-sm leading-relaxed text-oai-gray-500 dark:text-oai-gray-400",children:o(s)})]})]})}function M({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 fe(){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(v,{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(le,{})})]})}),e.jsx(v,{y:12,delay:.06,children:e.jsxs("section",{"aria-label":o("widgets.menubar.section.title"),className:"mb-12 sm:mb-14",children:[e.jsx(M,{titleKey:"widgets.menubar.section.title"}),e.jsx(re,{})]})}),e.jsxs("section",{"aria-label":o("widgets.gallery.section.title"),children:[e.jsx(M,{titleKey:"widgets.gallery.section.title"}),e.jsx(K,{staggerDelay:.08,initialDelay:.04,children:e.jsx("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2 lg:gap-5",children:oe.map(({id:t,Preview:i,nameKey:s,descKey:a})=>e.jsx($,{children:e.jsx(ne,{Preview:i,nameKey:s,descKey:a})},t))})})]})]})})})}export{fe as WidgetsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,j as e,D as y}from"./main-
|
|
1
|
+
import{r as l,j as e,D as y}from"./main-BHU0hIWS.js";function o(a){return Number.isFinite(a)?Math.abs(a)>=1e12?(a/1e12).toFixed(2).replace(/\.?0+$/,"")+"T":y(a,{decimals:2}):"0"}function r({children:a,accent:n=!1,className:i=""}){const c="rounded-2xl border border-oai-gray-200 dark:border-oai-gray-800 p-6 bg-white dark:bg-oai-gray-900",d=n?"bg-gradient-to-br from-emerald-50 to-cyan-50 dark:from-emerald-900/30 dark:to-cyan-900/30 border-transparent":"";return e.jsx("div",{className:`${c} ${d} ${i}`,children:a})}function u(){const[a,n]=l.useState(null),[i,c]=l.useState("loading"),[d,g]=l.useState("");if(l.useEffect(()=>{let t=!1;const h=new URLSearchParams(window.location.search).get("year"),p=h?`/functions/tokentracker-wrapped?year=${encodeURIComponent(h)}`:"/functions/tokentracker-wrapped";return fetch(p).then(async s=>{if(!s.ok)throw new Error(`HTTP ${s.status}`);return s.json()}).then(s=>{t||(n(s),c(s.totals&&s.totals.tokens>0?"ready":"empty"))}).catch(s=>{t||(g(String(s?.message||s)),c("error"))}),()=>{t=!0}},[]),i==="loading")return e.jsx("div",{className:"min-h-screen bg-white dark:bg-oai-gray-950 flex items-center justify-center",children:e.jsx("p",{className:"text-oai-gray-500",children:"Loading…"})});if(i==="error")return e.jsx("div",{className:"min-h-screen bg-white dark:bg-oai-gray-950 flex items-center justify-center px-6",children:e.jsx(r,{children:e.jsxs("p",{className:"text-red-600 dark:text-red-300",children:["Couldn't load Wrapped: ",d]})})});if(i==="empty"||!a)return e.jsx("div",{className:"min-h-screen bg-white dark:bg-oai-gray-950 flex items-center justify-center px-6",children:e.jsx(r,{children:e.jsxs("p",{className:"text-oai-gray-500",children:["No data for that year yet. Run ",e.jsx("code",{children:"tracker sync"})," first."]})})});const x=t=>`${(t*100).toFixed(0)}%`;return e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-white to-oai-gray-50 dark:from-oai-gray-950 dark:to-oai-gray-900 px-6 py-12",children:e.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[e.jsxs("header",{className:"text-center pb-6",children:[e.jsx("p",{className:"text-sm uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400",children:"TokenTracker Wrapped"}),e.jsx("h1",{className:"text-6xl font-bold text-oai-gray-900 dark:text-white mt-2",children:a.year})]}),e.jsxs(r,{accent:!0,className:"text-center",children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-oai-gray-600 dark:text-oai-gray-300",children:"Total tokens"}),e.jsx("p",{className:"text-7xl font-bold text-emerald-700 dark:text-emerald-300 mt-2",children:o(a.totals.tokens)}),e.jsxs("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400 mt-4",children:["across ",e.jsx("strong",{children:a.totals.conversations.toLocaleString("en-US")})," conversations,"," ",e.jsx("strong",{children:a.totals.active_days})," active days, and"," ",e.jsx("strong",{children:a.totals.sources})," tools"]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs(r,{children:[e.jsx("h3",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400 mb-4",children:"Top tools"}),e.jsx("ul",{className:"space-y-3",children:a.top.sources.slice(0,5).map(t=>e.jsxs("li",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"text-oai-gray-900 dark:text-white",children:t.source}),e.jsxs("span",{className:"text-oai-gray-500 dark:text-oai-gray-400 font-mono text-sm",children:[o(t.tokens)," · ",x(t.share)]})]},t.source))})]}),e.jsxs(r,{children:[e.jsx("h3",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400 mb-4",children:"Top models"}),e.jsx("ul",{className:"space-y-3",children:a.top.models.slice(0,5).map(t=>e.jsxs("li",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"text-oai-gray-900 dark:text-white truncate pr-3",children:t.model}),e.jsxs("span",{className:"text-oai-gray-500 dark:text-oai-gray-400 font-mono text-sm whitespace-nowrap",children:[o(t.tokens)," · ",x(t.share)]})]},t.model))})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.peak_hour&&e.jsxs(r,{children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400",children:"Peak hour"}),e.jsxs("p",{className:"text-4xl font-semibold text-oai-gray-900 dark:text-white mt-2",children:[String(a.peak_hour.hour).padStart(2,"0"),":00 UTC"]}),e.jsxs("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400 mt-1",children:[o(a.peak_hour.tokens)," tokens"]})]}),a.longest_streak&&a.longest_streak.days>0&&e.jsxs(r,{children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400",children:"Longest streak"}),e.jsxs("p",{className:"text-4xl font-semibold text-oai-gray-900 dark:text-white mt-2",children:[a.longest_streak.days," days"]}),e.jsxs("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400 mt-1",children:[a.longest_streak.from," → ",a.longest_streak.to]})]})]}),a.top.days.length>0&&e.jsxs(r,{children:[e.jsx("h3",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400 mb-4",children:"Top days"}),e.jsx("ul",{className:"space-y-2",children:a.top.days.slice(0,5).map(t=>e.jsxs("li",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"text-oai-gray-900 dark:text-white font-mono text-sm",children:t.day}),e.jsx("span",{className:"text-oai-gray-500 dark:text-oai-gray-400 font-mono text-sm",children:o(t.tokens)})]},t.day))})]}),a.highlights.length>0&&e.jsxs(r,{accent:!0,children:[e.jsx("h3",{className:"text-xs uppercase tracking-widest text-oai-gray-600 dark:text-oai-gray-300 mb-3",children:"Highlights"}),e.jsx("ul",{className:"space-y-2 text-oai-gray-800 dark:text-oai-gray-200",children:a.highlights.map((t,m)=>e.jsxs("li",{className:"text-base",children:["· ",t]},m))})]}),e.jsxs("footer",{className:"text-center text-xs text-oai-gray-400 dark:text-oai-gray-500 pt-6",children:["Generated from local queue.jsonl · share with"," ",e.jsx("code",{className:"font-mono",children:"tracker wrapped --json"})]})]})})}export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a9 as I,aa as j,ab as w,ac as M,ad as h,ae as N,r as u,af as V,ag as G,ah as H,ai as g,j as p,R as F,m as v,J as C,P}from"./main-BHU0hIWS.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 J(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)),j.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=()=>j.preRender(o,!1,!0),i=e.map(a=>a.on("change",r));return()=>{i.forEach(a=>a()),H(o)}}),n}function K(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 K(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!="function")return T(e,t,n,o);const a=typeof t=="function"?t:D(t,n,o),s=Array.isArray(e)?S(e,a):S([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 S(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 T(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 z(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(()=>J(r,e,t),[r,JSON.stringify(t)]),r}function _(e,t={}){return z(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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o}from"./main-
|
|
1
|
+
import{c as o}from"./main-BHU0hIWS.js";const t=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],a=o("arrow-up-right",t);export{a as A};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c}from"./main-BHU0hIWS.js";const e=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],t=c("check",e);export{t as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o}from"./main-
|
|
1
|
+
import{c as o}from"./main-BHU0hIWS.js";const n=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],e=o("chevron-down",n);export{e as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o}from"./main-
|
|
1
|
+
import{c as o}from"./main-BHU0hIWS.js";const a=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],e=o("download",a);export{e as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c}from"./main-
|
|
1
|
+
import{c}from"./main-BHU0hIWS.js";const o=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],t=c("info",o);export{t as I};
|