tokentracker-cli 0.83.9 → 0.83.11
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/{AchievementBadge-X8YWBf82.js → AchievementBadge-Ddtn6vg2.js} +1 -1
- package/dashboard/dist/assets/AchievementsPage-AMo1Ib5I.js +2 -0
- package/dashboard/dist/assets/{AchievementsSection-Cquf4Guw.js → AchievementsSection-CUMjcYst.js} +1 -1
- package/dashboard/dist/assets/BadgeDetailModal-CA03iBRx.js +1 -0
- package/dashboard/dist/assets/{Card-D4zmc9F1.js → Card-DscI10IE.js} +1 -1
- package/dashboard/dist/assets/{ClawdAnimated-C71-Kl5E.js → ClawdAnimated-5cIXJ0NQ.js} +1 -1
- package/dashboard/dist/assets/CommandPalette-qCpUMoAO.js +1 -0
- package/dashboard/dist/assets/CommunityStatsModal-FT_T1UzH.js +1 -0
- package/dashboard/dist/assets/{ConfirmModal-CJvsJQEg.js → ConfirmModal-GI2RxzAE.js} +1 -1
- package/dashboard/dist/assets/DashboardPage-CkA3pfjj.js +1 -0
- package/dashboard/dist/assets/DevicePage-CdtlanVo.js +1 -0
- package/dashboard/dist/assets/DialogClose-cfdVTNyN.js +1 -0
- package/dashboard/dist/assets/DialogDescription-CKjbQpir.js +1 -0
- package/dashboard/dist/assets/DialogTitle-CtptgR8Z.js +1 -0
- package/dashboard/dist/assets/{FadeIn-DDStrEXn.js → FadeIn-CPpE5UGk.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-Dr148Pod.js → HeaderGithubStar-vN3e1w0o.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-_ZCkwB3u.js → IpCheckPage-BqJPwFGV.js} +1 -1
- package/dashboard/dist/assets/{LandingPage-DeF5OWD_.js → LandingPage-DrjAIdTL.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardAvatar-BASZL-2J.js → LeaderboardAvatar-BRWPXDZl.js} +1 -1
- package/dashboard/dist/assets/LeaderboardPage-Dy55Qbr0.js +2 -0
- package/dashboard/dist/assets/{LeaderboardProfileModal-Cfh5POl9.js → LeaderboardProfileModal-Dm5bW2pX.js} +4 -4
- package/dashboard/dist/assets/{LeaderboardProfilePage-DJhhDxj0.js → LeaderboardProfilePage-CWmLrKsM.js} +3 -3
- package/dashboard/dist/assets/{LimitsPage-DkG3SpxN.js → LimitsPage-B538PSle.js} +1 -1
- package/dashboard/dist/assets/{LocalOnlyNotice-CrU-jyFU.js → LocalOnlyNotice-Dso8I7Y4.js} +1 -1
- package/dashboard/dist/assets/LoginCard-CnghY3oG.js +1 -0
- package/dashboard/dist/assets/{LoginModal-DW85E_2P.js → LoginModal-B30O2N_x.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-DW9keM2l.js → LoginPage-DglsaA23.js} +1 -1
- package/dashboard/dist/assets/PetPage-C7-xrZix.js +1 -0
- package/dashboard/dist/assets/PopoverPopup-CTbuRUy2.js +1 -0
- package/dashboard/dist/assets/{ProviderIcon-VFnAt_kS.js → ProviderIcon-D-sr7Qko.js} +1 -1
- package/dashboard/dist/assets/{ResetPasswordPage-BBRVK154.js → ResetPasswordPage-CIbj5Hpp.js} +1 -1
- package/dashboard/dist/assets/SegmentedControl-dxer1vVZ.js +1 -0
- package/dashboard/dist/assets/Select-BSQkd3VW.js +1 -0
- package/dashboard/dist/assets/SelectItemText-EGKNiN7_.js +1 -0
- package/dashboard/dist/assets/SessionsPage-CugLdscs.js +1 -0
- package/dashboard/dist/assets/SettingsPage-3MQDH9bF.js +1 -0
- package/dashboard/dist/assets/SkillsPage-DZ8k3xK4.js +1 -0
- package/dashboard/dist/assets/{TokenGalaxy-DgsPNhDp.js → TokenGalaxy-B5q_U7lQ.js} +1 -1
- package/dashboard/dist/assets/ToolbarRootContext-DIy-0I9L.js +1 -0
- package/dashboard/dist/assets/TrendMonitor-Bj558t-a.js +19 -0
- package/dashboard/dist/assets/WidgetsPage-t9EgVnVK.js +1 -0
- package/dashboard/dist/assets/{WrappedPage-D8a9fYh6.js → WrappedPage-B-8f6-oI.js} +1 -1
- package/dashboard/dist/assets/__vite-browser-external-CvhQU1Bj.css +1 -0
- package/dashboard/dist/assets/{__vite-browser-external-CYtUwU4m.js → __vite-browser-external-DwFlHgQR.js} +50 -13
- package/dashboard/dist/assets/{agent-logos-p0jCcCWI.js → agent-logos-C6ooyoY_.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-B8MNUpWz.js → arrow-up-right-CWOhbEwU.js} +1 -1
- package/dashboard/dist/assets/{check-ZBAFoU5c.js → check-DqrkOjUC.js} +1 -1
- package/dashboard/dist/assets/chevron-right-DlP0Hiu-.js +1 -0
- package/dashboard/dist/assets/{copy-zeYTJLdQ.js → copy-Dh_ZalIb.js} +1 -1
- package/dashboard/dist/assets/{download-jr0xhYlc.js → download-fssIVO33.js} +1 -1
- package/dashboard/dist/assets/{flame-DwM_jWVy.js → flame-COf56i7e.js} +1 -1
- package/dashboard/dist/assets/{format-tokens-CPxOZc6P.js → format-tokens-DA4cG58O.js} +1 -1
- package/dashboard/dist/assets/{icons-znz72ccY.js → icons-DigJtAfR.js} +1 -1
- package/dashboard/dist/assets/{index-fbrQEDiP.js → index-BR90lSkB.js} +1 -1
- package/dashboard/dist/assets/{index-BpuHelI9.js → index-DIEScXsc.js} +1 -1
- package/dashboard/dist/assets/{index-BCzrBLRN.js → index-b_fO7MtI.js} +1 -1
- package/dashboard/dist/assets/{info-Bpr2n0ZO.js → info-mwER43h2.js} +1 -1
- package/dashboard/dist/assets/{limits-providers-BBWY18ZF.js → limits-providers-DyEdxJUi.js} +1 -1
- package/dashboard/dist/assets/{link-2-C4GpDmFn.js → link-2-Bfgtp0co.js} +1 -1
- package/dashboard/dist/assets/{loader-circle-DFQK2RMn.js → loader-circle-B8ASQdW3.js} +1 -1
- package/dashboard/dist/assets/maximize-2-88sF_sdM.js +1 -0
- package/dashboard/dist/assets/provider-display-CYWy8Wjh.js +42 -0
- package/dashboard/dist/assets/{react-DWYxtoLr.js → react-CcvGEOfz.js} +1 -1
- package/dashboard/dist/assets/search-C3gFd5W0.js +1 -0
- package/dashboard/dist/assets/skills-api-BkjJfFxG.js +1 -0
- package/dashboard/dist/assets/store-CGE8neJG.js +1 -0
- package/dashboard/dist/assets/terminal-CjoZ2jlv.js +1 -0
- package/dashboard/dist/assets/{trash-2-Bukxuw5l.js → trash-2-Buwry_AW.js} +1 -1
- package/dashboard/dist/assets/{use-community-stats-CGcWNgR6.js → use-community-stats-DZW_XQoS.js} +1 -1
- package/dashboard/dist/assets/{use-limits-display-prefs-BrwnPXaU.js → use-limits-display-prefs-BD0CXAYR.js} +1 -1
- package/dashboard/dist/assets/{use-native-settings-BfQ-YyVL.js → use-native-settings-CPVIdR4z.js} +1 -1
- package/dashboard/dist/assets/{use-ordered-list-UV8OTApC.js → use-ordered-list-_yETN2gW.js} +1 -1
- package/dashboard/dist/assets/use-reduced-motion-BOf4gJaX.js +1 -0
- package/dashboard/dist/assets/{use-session-efficiency-pref-ptb44SuH.js → use-session-efficiency-pref-mOQHAb6j.js} +1 -1
- package/dashboard/dist/assets/{use-transform-Czq10OHT.js → use-transform-CvmlOKm0.js} +1 -1
- package/dashboard/dist/assets/{use-usage-limits-wP4w5mei.js → use-usage-limits-9W0OuOdp.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-yGkGAfpB.js → useCurrency-BZVRsDTW.js} +1 -1
- package/dashboard/dist/assets/useScrollLock-Dw-jQnFB.js +1 -0
- package/dashboard/dist/assets/{useTokenFormat-myPlm960.js → useTokenFormat-BHw_Jkes.js} +1 -1
- package/dashboard/dist/assets/{zap-RGCJBL7C.js → zap-CeYmAnn-.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist/ip-check.html +2 -2
- package/dashboard/dist/leaderboard.html +2 -2
- package/dashboard/dist/share.html +2 -2
- package/package.json +1 -1
- package/src/commands/init.js +4 -2
- package/src/commands/status.js +2 -2
- package/src/commands/uninstall.js +8 -3
- package/src/lib/codex-config.js +18 -0
- package/src/lib/local-api.js +27 -0
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/src/lib/session-analytics.js +214 -6
- package/dashboard/dist/assets/AchievementsPage-IPRhV16E.js +0 -2
- package/dashboard/dist/assets/BadgeDetailModal-EO-f-kw5.js +0 -1
- package/dashboard/dist/assets/CommandPalette-CB5VZ4vS.js +0 -1
- package/dashboard/dist/assets/CommunityStatsModal-Blda5OsT.js +0 -1
- package/dashboard/dist/assets/DashboardPage-DMyu2wnD.js +0 -1
- package/dashboard/dist/assets/DevicePage-BttsYSQ-.js +0 -1
- package/dashboard/dist/assets/DialogClose-VrH-Z7vG.js +0 -1
- package/dashboard/dist/assets/DialogDescription-MAfXy8yJ.js +0 -1
- package/dashboard/dist/assets/DialogTitle-BjiS_5bA.js +0 -1
- package/dashboard/dist/assets/LeaderboardPage-NqEgsIk_.js +0 -2
- package/dashboard/dist/assets/LoginCard-CSfOJPpN.js +0 -1
- package/dashboard/dist/assets/PetPage-OL8YbusK.js +0 -1
- package/dashboard/dist/assets/PopoverPopup-Ds1h2_iH.js +0 -1
- package/dashboard/dist/assets/Select-BCP43fKb.js +0 -1
- package/dashboard/dist/assets/SelectItemText-CY-n8m9N.js +0 -1
- package/dashboard/dist/assets/SettingsPage-Bn6xZU72.js +0 -1
- package/dashboard/dist/assets/SkillsPage-BNoLm96g.js +0 -1
- package/dashboard/dist/assets/TrendMonitor-DSB2kwaQ.js +0 -19
- package/dashboard/dist/assets/WidgetsPage-BMsYJCl8.js +0 -1
- package/dashboard/dist/assets/__vite-browser-external-BEMfOISl.css +0 -1
- package/dashboard/dist/assets/provider-display-CqSazoQg.js +0 -42
- package/dashboard/dist/assets/skills-api-Bn_e1uWd.js +0 -1
- package/dashboard/dist/assets/terminal-BXaxyX4y.js +0 -1
- package/dashboard/dist/assets/use-reduced-motion-B4iythwk.js +0 -1
- package/dashboard/dist/assets/useScrollLock-C7zK-ZeS.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,c as a,M as I,N as R,r as u,p as $,R as E,d as M}from"./__vite-browser-external-CYtUwU4m.js";import{S as W}from"./Select-BCP43fKb.js";import{u as K,T as O}from"./use-native-settings-BfQ-YyVL.js";import{F as L,S as D,a as G}from"./FadeIn-DDStrEXn.js";import{A as z}from"./arrow-up-right-B8MNUpWz.js";import{D as H}from"./download-jr0xhYlc.js";import"./SelectItemText-CY-n8m9N.js";import"./useScrollLock-C7zK-ZeS.js";import"./check-ZBAFoU5c.js";import"./Card-D4zmc9F1.js";import"./react-DWYxtoLr.js";import"./use-reduced-motion-B4iythwk.js";const U=["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:"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 N(t,i=F,l=2){const s=new Set(i.map(n=>n.id)),o=new Set,r=Array.isArray(t)?t.filter(n=>!s.has(n)||o.has(n)?!1:(o.add(n),!0)):[];return(r.length>0?r:U).slice(0,Math.max(1,Number(l)||2))}const V=264,X=124,g="ui-rounded, -apple-system, system-ui",S=["#5A8CF2","#9973E6","#4DB8A6","#E68C59"],Y={claude:"#C77DFF",codex:"#34C759",cursor:"#FFCC00",gemini:"#0A84FF"};function Z(t){return t>=.9?"#E64D4D":t>=.7?"#D9A633":"#33B866"}function b({size:t="sm",children:i}){const l=t==="lg",s=l?560:264,o=l?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",l?"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:s,aspectRatio:`${V} / ${X}`,borderRadius:o},children:i})})}function q({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",l=`${i} L264,124 L0,124 Z`,s=`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:s,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:a("widgets.preview.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:a("widgets.preview.seven_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:l,fill:`url(#${s})`,stroke:"none"}),e.jsx("path",{d:i,fill:"none",stroke:"#0A84FF",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})})}const C=(()=>{const l=[];for(let s=0;s<26;s++)for(let o=0;o<7;o++){const r=Math.sin((s+1)*12.9898+(o+1)*78.233+17)*43758.5453,c=Math.floor(Math.abs(r-Math.floor(r))*100);l.push({w:s,d:o,v:c})}return l})();function _(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 J(){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:_(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:_(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:a("widgets.preview.heatmap_summary",{days:202})})]})})}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,l=28,s=14,o=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=l+c*i,h=S[c%S.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:s,y:n+4,width:o,height:"2.8",rx:"1.4",className:"fill-oai-gray-200 dark:fill-oai-gray-700"}),e.jsx("rect",{x:s,y:n+4,width:Math.max(o*(r.pct/100),4),height:"2.8",rx:"1.4",fill:h})]},r.name)})})})}function ee(){const t=[{label:`${a("limits.provider.claude")} · ${a("limits.label.claude_7d")}`,source:"claude",reset:a("widgets.preview.reset_days",{days:1}),pct:61},{label:`${a("limits.provider.claude")} · ${a("limits.label.claude_5h")}`,source:"claude",reset:a("widgets.preview.reset_hours_minutes",{hours:4,minutes:28}),pct:4},{label:a("limits.provider.cursor"),source:"cursor",reset:a("widgets.preview.reset_days",{days:25}),pct:51},{label:`${a("limits.provider.codex")} · ${a("limits.label.codex_7d")}`,source:"codex",reset:a("widgets.preview.reset_days",{days:1}),pct:32}],i=22,l=28,s=14,o=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=l+c*i,h=Y[r.source],y=Z(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:s,y:n+4,width:o,height:"2.8",rx:"1.4",className:"fill-oai-gray-200 dark:fill-oai-gray-700"}),e.jsx("rect",{x:s,y:n+4,width:Math.max(o*(r.pct/100),4),height:"2.8",rx:"1.4",fill:y})]},r.label)})})})}function te(t){switch(t.category){case"cost":return"$8.42";case"limits":return"62%";default:return t.id==="last7dTokens"?"1.8B":"203M"}}function ae(t,i){switch(t){case"todayTokens":return a("menubar.metric.today_tokens");case"todayCost":return a("menubar.metric.today_cost");case"last7dTokens":return a("menubar.metric.last_7d_tokens");case"totalTokens":return a("menubar.metric.total_tokens");case"totalCost":return a("menubar.metric.total_cost");case"claude5h":return a("menubar.metric.claude_5h");case"claude7d":return a("menubar.metric.claude_7d");case"codex5h":return a("menubar.metric.codex_5h");case"codex7d":return a("menubar.metric.codex_7d");case"codexCredits":return a("menubar.metric.codex_credits");case"codexSpark5h":return a("menubar.metric.codex_spark_5h");case"codexSpark7d":return a("menubar.metric.codex_spark_7d");default:return i}}function ie(t,i){const l=new Set(i.map(o=>o.id)),s=t.filter(o=>l.has(o));for(const o of i){if(s.length>=2)break;s.includes(o.id)||s.push(o.id)}return s.slice(0,2)}function se({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:l,item:s},o)=>e.jsxs(E.Fragment,{children:[o>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",o===0?"pl-1 pr-2":"px-2"),children:[e.jsx("span",{className:"text-[13px] font-semibold leading-none tabular-nums text-white",children:s?.previewValue||"--"}),e.jsx("span",{className:"mt-[2px] text-[6px] font-semibold uppercase leading-none text-white/75",children:s?.shortLabel||a("widgets.preview.metric")})]})]},l)):null]})})}function re({slot:t,value:i,options:l,disabled:s,onChange:o}){const r=t===0?a("menubar.slot.primary"):a("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(W,{value:i,disabled:s,ariaLabel:r,onValueChange:c=>o(t,c),options:l.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:i,checked:l,disabled:s,onChange:o}){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(O,{checked:l,disabled:s,onChange:o,ariaLabel:t})]})}function le({label:t,hint:i,value:l,options:s,disabled:o,onChange:r}){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(W,{value:l,disabled:o,ariaLabel:t,onValueChange:r,options:s,className:"shrink-0 px-3 py-2 text-sm font-medium"})]})}function oe(){const{available:t,settings:i,setSetting:l}=K(),s=u.useMemo(()=>(Array.isArray(i?.menuBarAvailableItems)?i.menuBarAvailableItems:F).map(m=>({...m,displayLabel:ae(m.id,m.label),previewValue:te(m)})),[i?.menuBarAvailableItems]),o=Number(i?.menuBarMaxItems)||2,r=u.useMemo(()=>N(i?.menuBarItems,s,o),[s,o,i?.menuBarItems]),c=u.useMemo(()=>ie(r,s),[s,r]),n=i?.showStats!==!1,h=d=>{l("menuBarItems",N(d,s,o))},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]||s[d]?.id||"",v=c[d===0?1:0],B=s.filter(f=>f.id===m||f.id!==v),P=s.find(f=>f.id===m);return{slot:d,currentValue:m,options:B,item:P}}),T=["clawd","cat","pet","static"].includes(i?.menuBarIconStyle)?i.menuBarIconStyle:"clawd",k=i?.toastOnReset!==!1,j=i?.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(se,{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(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:a("settings.menubar.showStats"),hint:t?a("settings.menubar.showStatsHint"):a("menubar.native_only"),checked:n,disabled:!t,onChange:()=>l("showStats",!n)}),e.jsx(le,{label:a("settings.menubar.iconStyle"),hint:a("settings.menubar.iconStyleHint"),value:T,disabled:!t,options:[{value:"clawd",label:a("settings.menubar.iconStyle.clawd")},{value:"cat",label:a("settings.menubar.iconStyle.cat")},{value:"pet",label:a("settings.menubar.iconStyle.pet")},{value:"static",label:a("settings.menubar.iconStyle.static")}],onChange:d=>l("menuBarIconStyle",d)}),e.jsx(p,{label:a("settings.menubar.toastOnReset"),hint:a("settings.menubar.toastOnResetHint"),checked:k,disabled:!t,onChange:()=>l("toastOnReset",!k)}),e.jsx(p,{label:a("settings.menubar.confettiOnReset"),hint:a("settings.menubar.confettiOnResetHint"),checked:j,disabled:!t,onChange:()=>l("confettiOnReset",!j)})]})]})}function ne(){const[t,i]=u.useState("loading");return u.useEffect(()=>{if(typeof window>"u")return;if($()){i("native");return}const l=(navigator.userAgent||"").toLowerCase(),s=/mac/.test(l)&&!/iphone|ipad/.test(l);i(s?"mac-web":"other")},[]),t}function ce(){const t=ne();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:[a("widgets.cta.open_gallery"),e.jsx(z,{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(H,{className:"h-4 w-4","aria-hidden":"true"}),a("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(R,{className:"h-4 w-4","aria-hidden":"true"}),a("widgets.cta.macos_only")]})}const de=[{id:"summary",Preview:q,nameKey:"widgets.summary.name",descKey:"widgets.summary.description"},{id:"heatmap",Preview:J,nameKey:"widgets.heatmap.name",descKey:"widgets.heatmap.description"},{id:"topModels",Preview:Q,nameKey:"widgets.topModels.name",descKey:"widgets.topModels.description"},{id:"limits",Preview:ee,nameKey:"widgets.limits.name",descKey:"widgets.limits.description"}];function me({Preview:t,nameKey:i,descKey:l}){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:a(i)}),e.jsx("p",{className:"mt-1.5 text-sm leading-relaxed text-oai-gray-500 dark:text-oai-gray-400",children:a(l)})]})]})}function A({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:a(t)})}function Ne(){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:a("widgets.page.title")}),e.jsx("div",{className:"shrink-0",children:e.jsx(ce,{})})]})}),e.jsx(L,{y:12,delay:.06,children:e.jsxs("section",{"aria-label":a("widgets.menubar.section.title"),className:"mb-12 sm:mb-14",children:[e.jsx(A,{titleKey:"widgets.menubar.section.title"}),e.jsx(oe,{})]})}),e.jsxs("section",{"aria-label":a("widgets.gallery.section.title"),children:[e.jsx(A,{titleKey:"widgets.gallery.section.title"}),e.jsx(D,{staggerDelay:.08,initialDelay:.04,children:e.jsx("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2 lg:gap-5",children:de.map(({id:t,Preview:i,nameKey:l,descKey:s})=>e.jsx(G,{children:e.jsx(me,{Preview:i,nameKey:l,descKey:s})},t))})})]})]})})})}export{Ne as WidgetsPage};
|