tokentracker-cli 1.4.2 → 1.4.3

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 (108) hide show
  1. package/dashboard/dist/assets/{AchievementBadge-WGbdoboF.js → AchievementBadge-3IYidbrI.js} +1 -1
  2. package/dashboard/dist/assets/{AchievementsPage-BvybbsXv.js → AchievementsPage-DmZ_ojyM.js} +2 -2
  3. package/dashboard/dist/assets/{AchievementsSection-ChNzTFSR.js → AchievementsSection-DIYrrzhw.js} +1 -1
  4. package/dashboard/dist/assets/{BadgeDetailModal-DhI9Ejz3.js → BadgeDetailModal-DMMExCe4.js} +1 -1
  5. package/dashboard/dist/assets/{BotAnimated-Bch0Yxej.js → BotAnimated-y6vZNRvC.js} +1 -1
  6. package/dashboard/dist/assets/{Card-DWdL7d1T.js → Card-LJX3G3zo.js} +1 -1
  7. package/dashboard/dist/assets/{CloudCheckoutPage-BjGoOz6P.js → CloudCheckoutPage-BGBgSXNE.js} +1 -1
  8. package/dashboard/dist/assets/{CloudPage-Btb6a97x.js → CloudPage-Dij2GTXi.js} +2 -2
  9. package/dashboard/dist/assets/{CommandPalette-DwP3k7LE.js → CommandPalette-BIky6Fk0.js} +1 -1
  10. package/dashboard/dist/assets/{CommunityStatsModal-mzqLxpwE.js → CommunityStatsModal-DbM99i0s.js} +1 -1
  11. package/dashboard/dist/assets/{ConfirmModal-Dm76q4EX.js → ConfirmModal-C_NH8vgO.js} +1 -1
  12. package/dashboard/dist/assets/{Controls-ClZjOBoD.js → Controls-BEAj_kvr.js} +1 -1
  13. package/dashboard/dist/assets/{DashboardPage-Doc8f4NL.js → DashboardPage-DO7h2dfu.js} +1 -1
  14. package/dashboard/dist/assets/{DateRangePopover-vfTUePPg.js → DateRangePopover-PQXB8v0k.js} +1 -1
  15. package/dashboard/dist/assets/{DevicePage-Jjg5q0C2.js → DevicePage-0JZ3OIWZ.js} +1 -1
  16. package/dashboard/dist/assets/{DialogClose-Ci5mPZ6X.js → DialogClose-BpWoD5h9.js} +1 -1
  17. package/dashboard/dist/assets/DialogDescription-ne_rYSD7.js +1 -0
  18. package/dashboard/dist/assets/{DialogTitle-DI21oZxH.js → DialogTitle-DoQgdh5w.js} +1 -1
  19. package/dashboard/dist/assets/{ElectricLogo-DfeZBwPZ.js → ElectricLogo-0O87VjKv.js} +1 -1
  20. package/dashboard/dist/assets/{FadeIn-C7SIILTc.js → FadeIn-9ph1h_AG.js} +1 -1
  21. package/dashboard/dist/assets/{HeaderGithubStar-RStLbadn.js → HeaderGithubStar-DCZ92xbH.js} +1 -1
  22. package/dashboard/dist/assets/{HoverTooltip-DI7uAp1_.js → HoverTooltip-CCKdmuOP.js} +1 -1
  23. package/dashboard/dist/assets/{IpCheckPage-DTZNTJVh.js → IpCheckPage-CpyhpmdS.js} +1 -1
  24. package/dashboard/dist/assets/{LandingPage-Df5scNlw.js → LandingPage-spvsPkYy.js} +2 -2
  25. package/dashboard/dist/assets/{LeaderboardPage-Ck3SqtnI.js → LeaderboardPage-2nJ08ohw.js} +2 -2
  26. package/dashboard/dist/assets/{LeaderboardProBadge-CGx6m7R6.js → LeaderboardProBadge-D6FSL3Qy.js} +1 -1
  27. package/dashboard/dist/assets/{LeaderboardProfileModal-DuP7rgfv.js → LeaderboardProfileModal-DD1jX-rD.js} +3 -3
  28. package/dashboard/dist/assets/{LeaderboardProfilePage-B5qUJkZX.js → LeaderboardProfilePage-DYqRrntL.js} +1 -1
  29. package/dashboard/dist/assets/{LimitsPage-Bv_Lcvcz.js → LimitsPage-DXHikunk.js} +1 -1
  30. package/dashboard/dist/assets/{LocalOnlyNotice-Cg4y02JM.js → LocalOnlyNotice-BURiQAtP.js} +1 -1
  31. package/dashboard/dist/assets/{LoginCard-Wz0uJKXx.js → LoginCard-Cv2ijoJx.js} +1 -1
  32. package/dashboard/dist/assets/{LoginModal-C13v_Gs0.js → LoginModal-DyOideDA.js} +1 -1
  33. package/dashboard/dist/assets/{LoginPage-COH9xXtd.js → LoginPage-BKNvqvYi.js} +1 -1
  34. package/dashboard/dist/assets/{PetPage-BWCnURub.js → PetPage-BBmozE0L.js} +2 -2
  35. package/dashboard/dist/assets/{PopoverPopup-Dw811N-_.js → PopoverPopup-DDnISLKM.js} +1 -1
  36. package/dashboard/dist/assets/{ProviderIcon-CHxhYzK-.js → ProviderIcon-Da90GDcM.js} +1 -1
  37. package/dashboard/dist/assets/{ResetPasswordPage-Ll6jshqg.js → ResetPasswordPage-DsETr50j.js} +1 -1
  38. package/dashboard/dist/assets/{Select-BbooQ3sa.js → Select-pZDawyxt.js} +1 -1
  39. package/dashboard/dist/assets/{SelectItemText-DBiW70wi.js → SelectItemText-D5wuuN7G.js} +1 -1
  40. package/dashboard/dist/assets/{SelfHostPage-BMHJxz5q.js → SelfHostPage-sm-PARYj.js} +1 -1
  41. package/dashboard/dist/assets/{ServiceStatusPage-D6LH0ac-.js → ServiceStatusPage-D4f8h0sL.js} +1 -1
  42. package/dashboard/dist/assets/{SessionsPage-Mrer6v17.js → SessionsPage-xVLsTN4m.js} +1 -1
  43. package/dashboard/dist/assets/{SettingsPage-D_7P_y_l.js → SettingsPage-Dt9iFheY.js} +3 -3
  44. package/dashboard/dist/assets/{SkillsPage-Ka7xm-1v.js → SkillsPage-BdWalPpd.js} +1 -1
  45. package/dashboard/dist/assets/{TokenGalaxy-BEURDPFq.js → TokenGalaxy-d2_ml0tE.js} +1 -1
  46. package/dashboard/dist/assets/{TooltipPopup-ZiuFFARC.js → TooltipPopup-B4masxDW.js} +1 -1
  47. package/dashboard/dist/assets/{TrendMonitor-H73lyGEf.js → TrendMonitor-CceYpa2O.js} +1 -1
  48. package/dashboard/dist/assets/{WidgetsPage-_7iCvyTk.js → WidgetsPage-CSN0829H.js} +1 -1
  49. package/dashboard/dist/assets/{WrappedPage-DEXNb6-k.js → WrappedPage-gP4WfO_m.js} +1 -1
  50. package/dashboard/dist/assets/{__vite-browser-external-BkNP5Ecj.js → __vite-browser-external-BtJVmciH.js} +2 -2
  51. package/dashboard/dist/assets/{agent-logos-OVBc_0cF.js → agent-logos-wxccxfWz.js} +1 -1
  52. package/dashboard/dist/assets/{arrow-left-DDphsclm.js → arrow-left-Bd5C77R2.js} +1 -1
  53. package/dashboard/dist/assets/{arrow-right-B1aNq0Ki.js → arrow-right-C1RqrK4A.js} +1 -1
  54. package/dashboard/dist/assets/{arrow-up-right-yTM9azz_.js → arrow-up-right-B_b2i8hn.js} +1 -1
  55. package/dashboard/dist/assets/{calendar-days-D22ithNF.js → calendar-days-C8eYygme.js} +1 -1
  56. package/dashboard/dist/assets/{check-Dk7tknvE.js → check-BlBHefQ7.js} +1 -1
  57. package/dashboard/dist/assets/{chevron-down-DdyEzQ4f.js → chevron-down-mjUspqZv.js} +1 -1
  58. package/dashboard/dist/assets/{cloud-checkout-BJjbipnH.js → cloud-checkout-CEkMnWXf.js} +1 -1
  59. package/dashboard/dist/assets/{composite-DEqP00XV.js → composite-CzXFY9IC.js} +1 -1
  60. package/dashboard/dist/assets/{download-C9ixNyzn.js → download-CQvg59w1.js} +1 -1
  61. package/dashboard/dist/assets/{external-link-DL4HSsLw.js → external-link-CDYfIZ3Z.js} +1 -1
  62. package/dashboard/dist/assets/{flame-DqNH65nB.js → flame-C9NXQRil.js} +1 -1
  63. package/dashboard/dist/assets/{format-tokens-CyVjKz4I.js → format-tokens-fKy_3qpW.js} +1 -1
  64. package/dashboard/dist/assets/{gift-ChJQQe_G.js → gift-WmV4SBGR.js} +1 -1
  65. package/dashboard/dist/assets/{host-mode-DpUDpoOz.js → host-mode-C5MvZ7SV.js} +1 -1
  66. package/dashboard/dist/assets/{icons-CJiHeOaU.js → icons-B1EtsaZs.js} +1 -1
  67. package/dashboard/dist/assets/{index-72LQsAaf.js → index-9EZ3o2RV.js} +1 -1
  68. package/dashboard/dist/assets/{index-CrFlTSra.js → index-BEecBW06.js} +1 -1
  69. package/dashboard/dist/assets/{index-BucEg3fu.js → index-DXNwBFNi.js} +1 -1
  70. package/dashboard/dist/assets/{info-DReYqxC7.js → info-CWDhggIW.js} +1 -1
  71. package/dashboard/dist/assets/{link-2-kIZbhK2S.js → link-2-DEWNkK7s.js} +1 -1
  72. package/dashboard/dist/assets/{loader-circle-1An-X85y.js → loader-circle-DotT5gVp.js} +1 -1
  73. package/dashboard/dist/assets/{modifiers.esm-FoVheEKT.js → modifiers.esm-qZnGgJAz.js} +1 -1
  74. package/dashboard/dist/assets/{monitor-smartphone-Ch6lr_P2.js → monitor-smartphone-DOP5eqBD.js} +1 -1
  75. package/dashboard/dist/assets/{play-CbJ6ZF1K.js → play-BUsybi9m.js} +1 -1
  76. package/dashboard/dist/assets/{plus-C-5ID3a9.js → plus-DAjojh_m.js} +1 -1
  77. package/dashboard/dist/assets/{provider-display-BFzRtoL2.js → provider-display-BCQQYPWD.js} +1 -1
  78. package/dashboard/dist/assets/{react-D4CR_fLQ.js → react-BgpqhoCj.js} +1 -1
  79. package/dashboard/dist/assets/{safePolygon-DP21Ibqj.js → safePolygon-C-PFpZSA.js} +1 -1
  80. package/dashboard/dist/assets/{search-CaznkY7U.js → search-W1A-6ugo.js} +1 -1
  81. package/dashboard/dist/assets/{server-CUOmC6xZ.js → server-CE7pFjDr.js} +1 -1
  82. package/dashboard/dist/assets/{shield-check-Dr2KBMmA.js → shield-check-KL5xc2FR.js} +1 -1
  83. package/dashboard/dist/assets/{skills-api-BAz_fblS.js → skills-api-DL_zLjKA.js} +1 -1
  84. package/dashboard/dist/assets/{sortable.esm-knEfm5hE.js → sortable.esm-CehJQvFH.js} +1 -1
  85. package/dashboard/dist/assets/{store-CL97jcij.js → store-BHAXkHPR.js} +1 -1
  86. package/dashboard/dist/assets/{terminal-EjFyreWj.js → terminal-Br5vyD6Q.js} +1 -1
  87. package/dashboard/dist/assets/{trash-ByqaZXkQ.js → trash-CzaCJP6G.js} +1 -1
  88. package/dashboard/dist/assets/{use-community-stats-Bs4RDJZE.js → use-community-stats-DbJrecQw.js} +1 -1
  89. package/dashboard/dist/assets/{use-latest-request-guard-CG3Ir1cP.js → use-latest-request-guard-DGhwmlX8.js} +1 -1
  90. package/dashboard/dist/assets/{use-limits-display-prefs-tACgCxeR.js → use-limits-display-prefs-T7KWAWZ6.js} +1 -1
  91. package/dashboard/dist/assets/{use-native-settings-CWjXyJXi.js → use-native-settings-MZJhS328.js} +1 -1
  92. package/dashboard/dist/assets/{use-ordered-list-DsuC9JQa.js → use-ordered-list-BDN24weA.js} +1 -1
  93. package/dashboard/dist/assets/use-reduced-motion-CfCY-K-a.js +1 -0
  94. package/dashboard/dist/assets/{use-session-efficiency-pref-NeoJE8BL.js → use-session-efficiency-pref-DUu16y8Z.js} +1 -1
  95. package/dashboard/dist/assets/{use-transform-BWGKOsya.js → use-transform-BczE46xm.js} +1 -1
  96. package/dashboard/dist/assets/{use-usage-limits-CFWFNwHS.js → use-usage-limits-CjyDfH-M.js} +1 -1
  97. package/dashboard/dist/assets/{useCurrency-B_C4_P5x.js → useCurrency-BgZmWbkx.js} +1 -1
  98. package/dashboard/dist/assets/{usePositioner-B0L5_o38.js → usePositioner-dWENyY8z.js} +1 -1
  99. package/dashboard/dist/assets/{useTokenFormat-DH1GWHSU.js → useTokenFormat-D7s1-Zuk.js} +1 -1
  100. package/dashboard/dist/assets/{zap-Chv1p7pS.js → zap-Dr__bKlq.js} +1 -1
  101. package/dashboard/dist/index.html +1 -1
  102. package/dashboard/dist/ip-check.html +1 -1
  103. package/dashboard/dist/leaderboard.html +1 -1
  104. package/dashboard/dist/share.html +1 -1
  105. package/package.json +1 -1
  106. package/src/lib/pricing/seed-snapshot.json +1 -1
  107. package/dashboard/dist/assets/DialogDescription-Di5ev5K6.js +0 -1
  108. package/dashboard/dist/assets/use-reduced-motion-CwFguzkm.js +0 -1
@@ -1 +1 @@
1
- import{r as i,a$ as ee,b1 as D,j as w,a_ as ke,N as I,bW as Te,b0 as J,bq as me,b6 as V,b8 as te,bb as _,b5 as we,bX as Ae,bY as He,b2 as X,bZ as Fe,b_ as ue,b3 as le,ba as pe,b$ as z,c0 as Le,c1 as Be,bo as Ne,bG as Re,bH as je,bE as $,bF as _e,bK as Ue,c2 as Ye,J as Ge,c3 as Ve,bL as Xe,bO as Ke,K as Pe,c4 as $e,b4 as We,b7 as Z,c5 as qe,bT as Je,bV as ze}from"./__vite-browser-external-BkNP5Ecj.js";import{i as be,A as Ze,P as Qe,m as et,j as tt,k as nt,l as ot,n as st,o as rt,u as it,q as at,c as ct,t as ut,y as lt,z as pt}from"./composite-DEqP00XV.js";import{p as ft,c as dt}from"./store-CL97jcij.js";import{g as K,u as gt,c as Tt,a as mt,s as Rt,b as Pt}from"./safePolygon-DP21Ibqj.js";import{u as bt,a as ht,g as vt}from"./usePositioner-B0L5_o38.js";const he=i.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new ke,currentIdRef:{current:null},currentContextRef:{current:null}});function Ct(e,n){e.current=n.current}function Vt(e){const{children:n,delay:t,timeoutMs:u=0}=e,f=i.useRef(t),r=i.useRef(t),a=i.useRef(null),c=i.useRef(null),m=ee();return D(()=>{if(r.current=t,!a.current){f.current=t;return}f.current={open:K(f.current,"open"),close:K(t,"close")}},[t,a,f,r]),w.jsx(he.Provider,{value:i.useMemo(()=>({hasProvider:!0,delayRef:f,initialDelayRef:r,currentIdRef:a,timeoutMs:u,currentContextRef:c,timeout:m}),[u,m]),children:n})}function yt(e,n={open:!1}){const{open:t}=n,u=e.useState("floatingId"),f=i.useContext(he),{currentIdRef:r,delayRef:a,timeoutMs:c,initialDelayRef:m,currentContextRef:T,hasProvider:R,timeout:l}=f,[p,g]=i.useState(!1),s=i.useRef(t);return D(()=>{s.current=t},[t]),D(()=>{function P(){T.current?.setIsInstantPhase(!1),r.current=null,T.current=null,a.current=m.current,l.clear()}if(r.current&&!t&&r.current===u){if(g(!1),c){const o=u;return l.start(c,()=>{e.select("open")||r.current&&r.current!==o||P()}),()=>{(s.current||r.current!==o)&&l.clear()}}P()}},[t,u,r,a,c,m,T,l,e]),D(()=>{if(!t)return;const P=T.current,o=r.current;l.clear(),T.current={onOpenChange:e.setOpen,setIsInstantPhase:g},r.current=u,a.current={open:0,close:K(m.current,"close")},o!==null&&o!==u?(g(!0),P?.setIsInstantPhase(!0),P?.onOpenChange(!1,I(Te))):(g(!1),P?.setIsInstantPhase(!1))},[t,u,e,r,a,m,T,l]),D(()=>()=>{if(r.current===u){if(T.current=null,!s.current)return;r.current=null,Ct(a,m),l.clear()}},[T,r,a,u,m,l]),i.useMemo(()=>({activeIdRef:r,hasProvider:R,delayRef:a,isInstantPhase:p}),[r,R,a,p])}function xt(e,n){let t=null,u=null,f=!1;return{contextElement:e||void 0,getBoundingClientRect(){const r=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},a=n.axis==="x"||n.axis==="both",c=n.axis==="y"||n.axis==="both",m=["mouseenter","mousemove"].includes(n.dataRef.current.openEvent?.type||"")&&n.pointerType!=="touch",T=n.axis==="y"?r.width:0,R=n.axis==="x"?r.height:0;let l=r.x,p=r.y;return t==null&&n.x&&a&&(t=r.x-n.x),u==null&&n.y&&c&&(u=r.y-n.y),l-=t||0,p-=u||0,(!f||m)&&(l=a&&n.x!=null?n.x:l,p=c&&n.y!=null?n.y:p),f=!0,{width:T,height:R,x:l,y:p,top:p,right:l+T,bottom:p+R,left:l}}}}function fe(e){return e!=null&&e.clientX!=null}function St(e,n={}){const{enabled:t=!0,axis:u="both"}=n,f=e.useState("open"),r=e.useState("floatingElement"),a=e.useState("domReferenceElement"),c=e.context.dataRef,m=i.useRef(!1),T=i.useRef(null),[R,l]=i.useState(),[p,g]=i.useState([]),s=J(d=>{e.set("positionReference",d)}),P=J((d,C,v)=>{m.current||c.current.openEvent&&!fe(c.current.openEvent)||e.set("positionReference",xt(v??a,{x:d,y:C,axis:u,dataRef:c,pointerType:R}))}),o=J(d=>{f?T.current||(P(d.clientX,d.clientY,d.currentTarget),g([])):P(d.clientX,d.clientY,d.currentTarget)}),b=be(R)?r:f;i.useEffect(()=>{if(!t){s(a);return}if(!b)return;function d(){T.current?.(),T.current=null}const C=me(r);function v(y){const S=te(y);_(r,S)?d():P(y.clientX,y.clientY)}return!c.current.openEvent||fe(c.current.openEvent)?T.current=V(C,"mousemove",v):s(a),d},[b,t,r,c,a,e,P,s,p]),i.useEffect(()=>()=>{e.set("positionReference",null)},[e]),i.useEffect(()=>{t&&!r&&(m.current=!1)},[t,r]),i.useEffect(()=>{!t&&f&&(m.current=!0)},[t,f]);const x=i.useMemo(()=>{function d(C){l(C.pointerType)}return{onPointerDown:d,onPointerEnter:d,onMouseMove:o,onMouseEnter:o}},[o]);return i.useMemo(()=>t?{reference:x,trigger:x}:{},[t,x])}const Q=Ae&&He;function Et(e,n={}){const{enabled:t=!0,delay:u}=n,{events:f,dataRef:r}=e.context,a=i.useRef(!1),c=i.useRef(null),m=i.useRef(!0),T=ee();i.useEffect(()=>{const l=e.select("domReferenceElement");if(!t)return;const p=me(l);function g(){const o=e.select("domReferenceElement");!e.select("open")&&Ne(o)&&o===ue(le(o))&&(a.current=!0,c.current=o)}function s(){m.current=!0}function P(){m.current=!1}return we(V(p,"blur",g),Q&&V(p,"keydown",s,!0),Q&&V(p,"pointerdown",P,!0))},[e,t]),i.useEffect(()=>{if(!t)return;function l(p){if(p.reason===Re||p.reason===je){const g=e.select("domReferenceElement");X(g)&&(c.current=g,a.current=!0)}}return f.on("openchange",l),()=>{f.off("openchange",l)}},[f,t,e]);const R=i.useMemo(()=>{function l(){a.current=!1,c.current=null}return{onMouseLeave(){l()},onFocus(p){const g=p.currentTarget;if(a.current){if(c.current===g)return;l()}const s=te(p.nativeEvent);if(X(s)){if(Q&&!p.relatedTarget){if(!m.current&&!Le(s))return}else if(!Be(s))return}const P=pe(p.relatedTarget,e.context.triggerElements),{nativeEvent:o,currentTarget:b}=p;if(e.select("open")&&P||!u){e.setOpen(!0,I(z,o,b));return}T.start(u,()=>{a.current||e.setOpen(!0,I(z,o,b))})},onBlur(p){l();const g=p.relatedTarget,s=p.nativeEvent,P=X(g)&&g.hasAttribute(Fe("focus-guard"))&&g.getAttribute("data-type")==="outside";T.start(0,()=>{const o=e.select("domReferenceElement"),b=ue(le(o));!g&&b===o||_(r.current.floatingContext?.refs.floating.current,b)||_(o,b)||P||pe(g??b,e.context.triggerElements)||e.setOpen(!1,I(z,s))})}}},[r,u,e,T]);return i.useMemo(()=>t?{reference:R,trigger:R}:{},[t,R])}const ve=i.createContext(void 0);function W(e){const n=i.useContext(ve);if(n===void 0&&!e)throw new Error($(72));return n}const Ot={...ft,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,n)=>n?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class It extends _e{constructor(n,t,u){const f=new Qe;super(Mt(n,f,t,u),Dt(f),Ot)}setOpen=(n,t)=>{Ze(this,n,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(n){this.state.floatingRootContext.dispatchOpenChange(!1,I(Re,n))}}function Mt(e,n,t,u=!1){return{...dt(n,t,u),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function Dt(e){return{popupRef:i.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const Xt=Ue(function(n){const{disabled:t=!1,defaultOpen:u=!1,open:f,disableHoverablePopup:r=!1,trackCursorAxis:a="none",actionsRef:c,onOpenChange:m,onOpenChangeComplete:T,handle:R,triggerId:l,defaultTriggerId:p=null,children:g}=n,s=et((F,L)=>new It({open:u,openProp:f,activeTriggerId:p,triggerIdProp:l},F,L));s.useControlledProp("openProp",f),s.useControlledProp("triggerIdProp",l),s.useContextCallback("onOpenChange",m),s.useContextCallback("onOpenChangeComplete",T);const P=s.useState("open"),o=!t&&P,b=s.useState("activeTriggerId"),x=s.useState("mounted"),d=s.useState("payload");s.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:r,disabled:t}),tt(s,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:C,transitionStatus:v}=nt(o,s),y=s.useState("isInstantPhase"),S=s.useState("instantType"),A=s.useState("lastOpenChangeReason"),M=i.useRef(null);D(()=>{P&&t&&s.setOpen(!1,I(Ve))},[P,t,s]),D(()=>{v==="ending"&&A===Te||v!=="ending"&&y?(S!=="delay"&&(M.current=S),s.set("instantType","delay")):M.current!==null&&(s.set("instantType",M.current),M.current=null)},[v,y,A,S,s]),D(()=>{o&&b==null&&s.set("payload",void 0)},[s,b,o]),i.useImperativeHandle(c,()=>({unmount:C,close:()=>s.setOpen(!1,I(Xe))}),[C,s]);const H=o||x||!t&&a!=="none";return w.jsxs(ve.Provider,{value:s,children:[R&&w.jsx(ot,{handle:R,store:s}),H&&w.jsx(kt,{store:s,disabled:t,trackCursorAxis:a}),typeof g=="function"?g({payload:d}):g]})});function kt({store:e,disabled:n,trackCursorAxis:t}){const u=e.useState("floatingRootContext"),f=st(u,{enabled:!n,referencePress:()=>e.select("closeOnClick")}),r=St(u,{enabled:!n&&t!=="none",axis:t==="none"?void 0:t}),a=i.useMemo(()=>Ye(r.reference,f.reference),[r.reference,f.reference]);return rt(e,{activeTriggerProps:a,inactiveTriggerProps:a,popupProps:f.floating??Ge}),null}const wt=i.createContext(void 0);function At(){return i.useContext(wt)}const Ht=600,de="data-base-ui-tooltip-trigger";function ge(e){const n=te(e);return X(n)?n:null}const Kt=Ke(function(n,t){const{render:u,className:f,style:r,handle:a,payload:c,disabled:m,delay:T,closeOnClick:R=!0,closeDelay:l,id:p,...g}=n,s=W(!0),o=gt(a)??s;if(!o)throw new Error($(82));const b=it(p),x=o.useState("isTriggerActive",b),d=o.useState("isOpenedByTrigger",b),C=o.useState("floatingRootContext"),v=i.useRef(null),y=l??0,{registerTrigger:S,isMountedByThisTrigger:A}=at(b,v,o,{payload:c,closeOnClick:R,closeDelay:y}),M=At(),{activeIdRef:H,delayRef:F,isInstantPhase:L,hasProvider:E}=yt(C,{open:d}),B=Tt(C);o.useSyncedValue("isInstantPhase",L);const q=o.useState("disabled"),N=m??q,ne=ct(N),oe=o.useState("trackCursorAxis"),xe=o.useState("disableHoverablePopup"),j=i.useRef(!1),U=ee(),Y=i.useRef(void 0);function se(){return E&&H.current!=null?0:T??M??Ht}function re(h){const O=v.current;if(!O||!h)return!1;const k=We(h,`[${de}]`);return k!==null&&k!==O&&_(O,k)}function Se(h){const O=re(h);return j.current=O,O&&(B.openChangeTimeout.clear(),B.restTimeout.clear(),B.restTimeoutPending=!1,U.clear()),O}const Ee=mt(C,{enabled:!N,mouseOnly:!0,move:!1,handleClose:!xe&&oe!=="both"?Rt():null,restMs:se,delay(){return l==null&&E?{close:K(F.current,"close")}:{close:y}},triggerElementRef:v,isActiveTrigger:x,isClosing:()=>o.select("transitionStatus")==="ending",shouldOpen(){return!j.current}}),Oe=Et(C,{enabled:!N}).reference,Ie=h=>{const O=j.current,k=ge(h),ie=Se(k),G=v.current,De=G&&k&&_(G,k);if(ie&&o.select("open")&&o.select("lastOpenChangeReason")===Z){o.setOpen(!1,I(Z,h));return}if(O&&!ie&&De&&!ne.current&&!o.select("open")&&G&&be(Y.current)){const ae=()=>{!j.current&&!ne.current&&!o.select("open")&&o.setOpen(!0,I(Z,h,G))},ce=se();ce===0?(U.clear(),ae()):U.start(ce,ae)}},Me=o.useState("appliedTriggerProps",A||oe!=="none");return Pe("button",n,{state:{open:d},ref:[t,S,v],props:[Ee,Oe,Me,{onMouseOver(h){Ie(h.nativeEvent)},onFocus(h){re(ge(h.nativeEvent))&&h.preventBaseUIHandler()},onMouseLeave(){j.current=!1,U.clear(),Y.current=void 0},onPointerEnter(h){Y.current=h.pointerType},onPointerDown(h){Y.current=h.pointerType,o.set("closeOnClick",R),R&&!o.select("open")&&o.cancelPendingOpen(h.nativeEvent)},onClick(h){R&&!o.select("open")&&o.cancelPendingOpen(h.nativeEvent)},id:b,[$e]:N?"":void 0,[de]:N?void 0:""},g],stateAttributesMapping:ut})}),Ce=i.createContext(void 0);function Ft(){const e=i.useContext(Ce);if(e===void 0)throw new Error($(70));return e}const $t=i.forwardRef(function(n,t){const{keepMounted:u=!1,...f}=n;return W().useState("mounted")||u?w.jsx(Ce.Provider,{value:u,children:w.jsx(qe,{ref:t,...f})}):null}),ye=i.createContext(void 0);function Lt(){const e=i.useContext(ye);if(e===void 0)throw new Error($(71));return e}const Wt=i.forwardRef(function(n,t){const{render:u,className:f,anchor:r,positionMethod:a="absolute",side:c="top",align:m="center",sideOffset:T=0,alignOffset:R=0,collisionBoundary:l="clipping-ancestors",collisionPadding:p=5,arrowPadding:g=5,sticky:s=!1,disableAnchorTracking:P=!1,collisionAvoidance:o=Je,style:b,...x}=n,d=W(),C=Ft(),v=d.useState("open"),y=d.useState("mounted"),S=d.useState("trackCursorAxis"),A=d.useState("disableHoverablePopup"),M=d.useState("floatingRootContext"),H=d.useState("instantType"),F=d.useState("transitionStatus"),L=d.useState("adaptiveOrigin"),E=bt({anchor:r,positionMethod:a,floatingRootContext:M,mounted:y,side:c,sideOffset:T,align:m,alignOffset:R,collisionBoundary:l,collisionPadding:p,sticky:s,arrowPadding:g,disableAnchorTracking:P,keepMounted:C,collisionAvoidance:o,adaptiveOrigin:L}),B=i.useMemo(()=>({open:v,side:E.side,align:E.align,anchorHidden:E.anchorHidden,instant:S!=="none"?"tracking-cursor":H}),[v,E.side,E.align,E.anchorHidden,S,H]),q=ht(n,B,{styles:E.positionerStyles,transitionStatus:F,props:x,refs:[t,d.useStateSetter("positionerElement")],hidden:!y,inert:!v||S==="both"||A});return w.jsx(ye.Provider,{value:E,children:q})}),qt=i.forwardRef(function(n,t){const{render:u,className:f,style:r,...a}=n,c=W(),{side:m,align:T}=Lt(),R=c.useState("open"),l=c.useState("instantType"),p=c.useState("transitionStatus"),g=c.useState("popupProps"),s=c.useState("floatingRootContext"),P=c.useState("disabled"),o=c.useState("closeDelay");ze({open:R,ref:c.context.popupRef,onComplete(){R&&c.context.onOpenChangeComplete?.(!0)}}),Pt(s,{enabled:!P,closeDelay:o});const b=c.useStateSetter("popupElement");return Pe("div",n,{state:{open:R,side:m,align:T,instant:l,transitionStatus:p},ref:[t,c.context.popupRef,b],props:[lt,g,vt(p),a],stateAttributesMapping:pt})});export{Vt as F,wt as T,Xt as a,Kt as b,$t as c,Wt as d,qt as e};
1
+ import{r as i,a$ as ee,b1 as D,j as w,a_ as ke,N as I,bW as Te,b0 as J,bq as me,b6 as V,b8 as te,bb as _,b5 as we,bX as Ae,bY as He,b2 as X,bZ as Fe,b_ as ue,b3 as le,ba as pe,b$ as z,c0 as Le,c1 as Be,bo as Ne,bG as Re,bH as je,bE as $,bF as _e,bK as Ue,c2 as Ye,J as Ge,c3 as Ve,bL as Xe,bO as Ke,K as Pe,c4 as $e,b4 as We,b7 as Z,c5 as qe,bT as Je,bV as ze}from"./__vite-browser-external-BtJVmciH.js";import{i as be,A as Ze,P as Qe,m as et,j as tt,k as nt,l as ot,n as st,o as rt,u as it,q as at,c as ct,t as ut,y as lt,z as pt}from"./composite-CzXFY9IC.js";import{p as ft,c as dt}from"./store-BHAXkHPR.js";import{g as K,u as gt,c as Tt,a as mt,s as Rt,b as Pt}from"./safePolygon-C-PFpZSA.js";import{u as bt,a as ht,g as vt}from"./usePositioner-dWENyY8z.js";const he=i.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new ke,currentIdRef:{current:null},currentContextRef:{current:null}});function Ct(e,n){e.current=n.current}function Vt(e){const{children:n,delay:t,timeoutMs:u=0}=e,f=i.useRef(t),r=i.useRef(t),a=i.useRef(null),c=i.useRef(null),m=ee();return D(()=>{if(r.current=t,!a.current){f.current=t;return}f.current={open:K(f.current,"open"),close:K(t,"close")}},[t,a,f,r]),w.jsx(he.Provider,{value:i.useMemo(()=>({hasProvider:!0,delayRef:f,initialDelayRef:r,currentIdRef:a,timeoutMs:u,currentContextRef:c,timeout:m}),[u,m]),children:n})}function yt(e,n={open:!1}){const{open:t}=n,u=e.useState("floatingId"),f=i.useContext(he),{currentIdRef:r,delayRef:a,timeoutMs:c,initialDelayRef:m,currentContextRef:T,hasProvider:R,timeout:l}=f,[p,g]=i.useState(!1),s=i.useRef(t);return D(()=>{s.current=t},[t]),D(()=>{function P(){T.current?.setIsInstantPhase(!1),r.current=null,T.current=null,a.current=m.current,l.clear()}if(r.current&&!t&&r.current===u){if(g(!1),c){const o=u;return l.start(c,()=>{e.select("open")||r.current&&r.current!==o||P()}),()=>{(s.current||r.current!==o)&&l.clear()}}P()}},[t,u,r,a,c,m,T,l,e]),D(()=>{if(!t)return;const P=T.current,o=r.current;l.clear(),T.current={onOpenChange:e.setOpen,setIsInstantPhase:g},r.current=u,a.current={open:0,close:K(m.current,"close")},o!==null&&o!==u?(g(!0),P?.setIsInstantPhase(!0),P?.onOpenChange(!1,I(Te))):(g(!1),P?.setIsInstantPhase(!1))},[t,u,e,r,a,m,T,l]),D(()=>()=>{if(r.current===u){if(T.current=null,!s.current)return;r.current=null,Ct(a,m),l.clear()}},[T,r,a,u,m,l]),i.useMemo(()=>({activeIdRef:r,hasProvider:R,delayRef:a,isInstantPhase:p}),[r,R,a,p])}function xt(e,n){let t=null,u=null,f=!1;return{contextElement:e||void 0,getBoundingClientRect(){const r=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},a=n.axis==="x"||n.axis==="both",c=n.axis==="y"||n.axis==="both",m=["mouseenter","mousemove"].includes(n.dataRef.current.openEvent?.type||"")&&n.pointerType!=="touch",T=n.axis==="y"?r.width:0,R=n.axis==="x"?r.height:0;let l=r.x,p=r.y;return t==null&&n.x&&a&&(t=r.x-n.x),u==null&&n.y&&c&&(u=r.y-n.y),l-=t||0,p-=u||0,(!f||m)&&(l=a&&n.x!=null?n.x:l,p=c&&n.y!=null?n.y:p),f=!0,{width:T,height:R,x:l,y:p,top:p,right:l+T,bottom:p+R,left:l}}}}function fe(e){return e!=null&&e.clientX!=null}function St(e,n={}){const{enabled:t=!0,axis:u="both"}=n,f=e.useState("open"),r=e.useState("floatingElement"),a=e.useState("domReferenceElement"),c=e.context.dataRef,m=i.useRef(!1),T=i.useRef(null),[R,l]=i.useState(),[p,g]=i.useState([]),s=J(d=>{e.set("positionReference",d)}),P=J((d,C,v)=>{m.current||c.current.openEvent&&!fe(c.current.openEvent)||e.set("positionReference",xt(v??a,{x:d,y:C,axis:u,dataRef:c,pointerType:R}))}),o=J(d=>{f?T.current||(P(d.clientX,d.clientY,d.currentTarget),g([])):P(d.clientX,d.clientY,d.currentTarget)}),b=be(R)?r:f;i.useEffect(()=>{if(!t){s(a);return}if(!b)return;function d(){T.current?.(),T.current=null}const C=me(r);function v(y){const S=te(y);_(r,S)?d():P(y.clientX,y.clientY)}return!c.current.openEvent||fe(c.current.openEvent)?T.current=V(C,"mousemove",v):s(a),d},[b,t,r,c,a,e,P,s,p]),i.useEffect(()=>()=>{e.set("positionReference",null)},[e]),i.useEffect(()=>{t&&!r&&(m.current=!1)},[t,r]),i.useEffect(()=>{!t&&f&&(m.current=!0)},[t,f]);const x=i.useMemo(()=>{function d(C){l(C.pointerType)}return{onPointerDown:d,onPointerEnter:d,onMouseMove:o,onMouseEnter:o}},[o]);return i.useMemo(()=>t?{reference:x,trigger:x}:{},[t,x])}const Q=Ae&&He;function Et(e,n={}){const{enabled:t=!0,delay:u}=n,{events:f,dataRef:r}=e.context,a=i.useRef(!1),c=i.useRef(null),m=i.useRef(!0),T=ee();i.useEffect(()=>{const l=e.select("domReferenceElement");if(!t)return;const p=me(l);function g(){const o=e.select("domReferenceElement");!e.select("open")&&Ne(o)&&o===ue(le(o))&&(a.current=!0,c.current=o)}function s(){m.current=!0}function P(){m.current=!1}return we(V(p,"blur",g),Q&&V(p,"keydown",s,!0),Q&&V(p,"pointerdown",P,!0))},[e,t]),i.useEffect(()=>{if(!t)return;function l(p){if(p.reason===Re||p.reason===je){const g=e.select("domReferenceElement");X(g)&&(c.current=g,a.current=!0)}}return f.on("openchange",l),()=>{f.off("openchange",l)}},[f,t,e]);const R=i.useMemo(()=>{function l(){a.current=!1,c.current=null}return{onMouseLeave(){l()},onFocus(p){const g=p.currentTarget;if(a.current){if(c.current===g)return;l()}const s=te(p.nativeEvent);if(X(s)){if(Q&&!p.relatedTarget){if(!m.current&&!Le(s))return}else if(!Be(s))return}const P=pe(p.relatedTarget,e.context.triggerElements),{nativeEvent:o,currentTarget:b}=p;if(e.select("open")&&P||!u){e.setOpen(!0,I(z,o,b));return}T.start(u,()=>{a.current||e.setOpen(!0,I(z,o,b))})},onBlur(p){l();const g=p.relatedTarget,s=p.nativeEvent,P=X(g)&&g.hasAttribute(Fe("focus-guard"))&&g.getAttribute("data-type")==="outside";T.start(0,()=>{const o=e.select("domReferenceElement"),b=ue(le(o));!g&&b===o||_(r.current.floatingContext?.refs.floating.current,b)||_(o,b)||P||pe(g??b,e.context.triggerElements)||e.setOpen(!1,I(z,s))})}}},[r,u,e,T]);return i.useMemo(()=>t?{reference:R,trigger:R}:{},[t,R])}const ve=i.createContext(void 0);function W(e){const n=i.useContext(ve);if(n===void 0&&!e)throw new Error($(72));return n}const Ot={...ft,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,n)=>n?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class It extends _e{constructor(n,t,u){const f=new Qe;super(Mt(n,f,t,u),Dt(f),Ot)}setOpen=(n,t)=>{Ze(this,n,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(n){this.state.floatingRootContext.dispatchOpenChange(!1,I(Re,n))}}function Mt(e,n,t,u=!1){return{...dt(n,t,u),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function Dt(e){return{popupRef:i.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const Xt=Ue(function(n){const{disabled:t=!1,defaultOpen:u=!1,open:f,disableHoverablePopup:r=!1,trackCursorAxis:a="none",actionsRef:c,onOpenChange:m,onOpenChangeComplete:T,handle:R,triggerId:l,defaultTriggerId:p=null,children:g}=n,s=et((F,L)=>new It({open:u,openProp:f,activeTriggerId:p,triggerIdProp:l},F,L));s.useControlledProp("openProp",f),s.useControlledProp("triggerIdProp",l),s.useContextCallback("onOpenChange",m),s.useContextCallback("onOpenChangeComplete",T);const P=s.useState("open"),o=!t&&P,b=s.useState("activeTriggerId"),x=s.useState("mounted"),d=s.useState("payload");s.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:r,disabled:t}),tt(s,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:C,transitionStatus:v}=nt(o,s),y=s.useState("isInstantPhase"),S=s.useState("instantType"),A=s.useState("lastOpenChangeReason"),M=i.useRef(null);D(()=>{P&&t&&s.setOpen(!1,I(Ve))},[P,t,s]),D(()=>{v==="ending"&&A===Te||v!=="ending"&&y?(S!=="delay"&&(M.current=S),s.set("instantType","delay")):M.current!==null&&(s.set("instantType",M.current),M.current=null)},[v,y,A,S,s]),D(()=>{o&&b==null&&s.set("payload",void 0)},[s,b,o]),i.useImperativeHandle(c,()=>({unmount:C,close:()=>s.setOpen(!1,I(Xe))}),[C,s]);const H=o||x||!t&&a!=="none";return w.jsxs(ve.Provider,{value:s,children:[R&&w.jsx(ot,{handle:R,store:s}),H&&w.jsx(kt,{store:s,disabled:t,trackCursorAxis:a}),typeof g=="function"?g({payload:d}):g]})});function kt({store:e,disabled:n,trackCursorAxis:t}){const u=e.useState("floatingRootContext"),f=st(u,{enabled:!n,referencePress:()=>e.select("closeOnClick")}),r=St(u,{enabled:!n&&t!=="none",axis:t==="none"?void 0:t}),a=i.useMemo(()=>Ye(r.reference,f.reference),[r.reference,f.reference]);return rt(e,{activeTriggerProps:a,inactiveTriggerProps:a,popupProps:f.floating??Ge}),null}const wt=i.createContext(void 0);function At(){return i.useContext(wt)}const Ht=600,de="data-base-ui-tooltip-trigger";function ge(e){const n=te(e);return X(n)?n:null}const Kt=Ke(function(n,t){const{render:u,className:f,style:r,handle:a,payload:c,disabled:m,delay:T,closeOnClick:R=!0,closeDelay:l,id:p,...g}=n,s=W(!0),o=gt(a)??s;if(!o)throw new Error($(82));const b=it(p),x=o.useState("isTriggerActive",b),d=o.useState("isOpenedByTrigger",b),C=o.useState("floatingRootContext"),v=i.useRef(null),y=l??0,{registerTrigger:S,isMountedByThisTrigger:A}=at(b,v,o,{payload:c,closeOnClick:R,closeDelay:y}),M=At(),{activeIdRef:H,delayRef:F,isInstantPhase:L,hasProvider:E}=yt(C,{open:d}),B=Tt(C);o.useSyncedValue("isInstantPhase",L);const q=o.useState("disabled"),N=m??q,ne=ct(N),oe=o.useState("trackCursorAxis"),xe=o.useState("disableHoverablePopup"),j=i.useRef(!1),U=ee(),Y=i.useRef(void 0);function se(){return E&&H.current!=null?0:T??M??Ht}function re(h){const O=v.current;if(!O||!h)return!1;const k=We(h,`[${de}]`);return k!==null&&k!==O&&_(O,k)}function Se(h){const O=re(h);return j.current=O,O&&(B.openChangeTimeout.clear(),B.restTimeout.clear(),B.restTimeoutPending=!1,U.clear()),O}const Ee=mt(C,{enabled:!N,mouseOnly:!0,move:!1,handleClose:!xe&&oe!=="both"?Rt():null,restMs:se,delay(){return l==null&&E?{close:K(F.current,"close")}:{close:y}},triggerElementRef:v,isActiveTrigger:x,isClosing:()=>o.select("transitionStatus")==="ending",shouldOpen(){return!j.current}}),Oe=Et(C,{enabled:!N}).reference,Ie=h=>{const O=j.current,k=ge(h),ie=Se(k),G=v.current,De=G&&k&&_(G,k);if(ie&&o.select("open")&&o.select("lastOpenChangeReason")===Z){o.setOpen(!1,I(Z,h));return}if(O&&!ie&&De&&!ne.current&&!o.select("open")&&G&&be(Y.current)){const ae=()=>{!j.current&&!ne.current&&!o.select("open")&&o.setOpen(!0,I(Z,h,G))},ce=se();ce===0?(U.clear(),ae()):U.start(ce,ae)}},Me=o.useState("appliedTriggerProps",A||oe!=="none");return Pe("button",n,{state:{open:d},ref:[t,S,v],props:[Ee,Oe,Me,{onMouseOver(h){Ie(h.nativeEvent)},onFocus(h){re(ge(h.nativeEvent))&&h.preventBaseUIHandler()},onMouseLeave(){j.current=!1,U.clear(),Y.current=void 0},onPointerEnter(h){Y.current=h.pointerType},onPointerDown(h){Y.current=h.pointerType,o.set("closeOnClick",R),R&&!o.select("open")&&o.cancelPendingOpen(h.nativeEvent)},onClick(h){R&&!o.select("open")&&o.cancelPendingOpen(h.nativeEvent)},id:b,[$e]:N?"":void 0,[de]:N?void 0:""},g],stateAttributesMapping:ut})}),Ce=i.createContext(void 0);function Ft(){const e=i.useContext(Ce);if(e===void 0)throw new Error($(70));return e}const $t=i.forwardRef(function(n,t){const{keepMounted:u=!1,...f}=n;return W().useState("mounted")||u?w.jsx(Ce.Provider,{value:u,children:w.jsx(qe,{ref:t,...f})}):null}),ye=i.createContext(void 0);function Lt(){const e=i.useContext(ye);if(e===void 0)throw new Error($(71));return e}const Wt=i.forwardRef(function(n,t){const{render:u,className:f,anchor:r,positionMethod:a="absolute",side:c="top",align:m="center",sideOffset:T=0,alignOffset:R=0,collisionBoundary:l="clipping-ancestors",collisionPadding:p=5,arrowPadding:g=5,sticky:s=!1,disableAnchorTracking:P=!1,collisionAvoidance:o=Je,style:b,...x}=n,d=W(),C=Ft(),v=d.useState("open"),y=d.useState("mounted"),S=d.useState("trackCursorAxis"),A=d.useState("disableHoverablePopup"),M=d.useState("floatingRootContext"),H=d.useState("instantType"),F=d.useState("transitionStatus"),L=d.useState("adaptiveOrigin"),E=bt({anchor:r,positionMethod:a,floatingRootContext:M,mounted:y,side:c,sideOffset:T,align:m,alignOffset:R,collisionBoundary:l,collisionPadding:p,sticky:s,arrowPadding:g,disableAnchorTracking:P,keepMounted:C,collisionAvoidance:o,adaptiveOrigin:L}),B=i.useMemo(()=>({open:v,side:E.side,align:E.align,anchorHidden:E.anchorHidden,instant:S!=="none"?"tracking-cursor":H}),[v,E.side,E.align,E.anchorHidden,S,H]),q=ht(n,B,{styles:E.positionerStyles,transitionStatus:F,props:x,refs:[t,d.useStateSetter("positionerElement")],hidden:!y,inert:!v||S==="both"||A});return w.jsx(ye.Provider,{value:E,children:q})}),qt=i.forwardRef(function(n,t){const{render:u,className:f,style:r,...a}=n,c=W(),{side:m,align:T}=Lt(),R=c.useState("open"),l=c.useState("instantType"),p=c.useState("transitionStatus"),g=c.useState("popupProps"),s=c.useState("floatingRootContext"),P=c.useState("disabled"),o=c.useState("closeDelay");ze({open:R,ref:c.context.popupRef,onComplete(){R&&c.context.onOpenChangeComplete?.(!0)}}),Pt(s,{enabled:!P,closeDelay:o});const b=c.useStateSetter("popupElement");return Pe("div",n,{state:{open:R,side:m,align:T,instant:l,transitionStatus:p},ref:[t,c.context.popupRef,b],props:[lt,g,vt(p),a],stateAttributesMapping:pt})});export{Vt as F,wt as T,Xt as a,Kt as b,$t as c,Wt as d,qt as e};
@@ -1,4 +1,4 @@
1
- import{r as K,W as lt,aA as ct,aB as Me,aC as ut,aD as dt,aE as ft,aF as mt,aG as gt,aH as yt,aI as ht,aJ as _e,aK as qe,V as v,az as Je,j as s,X as pt,c as T,y as V,aL as xt,aM as bt,n as kt,h as Nt}from"./__vite-browser-external-BkNP5Ecj.js";import{m as vt}from"./react-D4CR_fLQ.js";import{u as Qe}from"./useCurrency-B_C4_P5x.js";import{u as Ve}from"./useTokenFormat-DH1GWHSU.js";import{D as De}from"./DateRangePopover-vfTUePPg.js";import{u as wt}from"./use-latest-request-guard-CG3Ir1cP.js";import{T as jt,M as Tt}from"./terminal-EjFyreWj.js";import{P as $e,a as Ee,b as Fe,c as Ae,d as Re}from"./PopoverPopup-Dw811N-_.js";import{u as _t}from"./use-reduced-motion-CwFguzkm.js";function ze(e,r,t){if(!(typeof window>"u"))try{const a=window.localStorage.getItem(e),n=a?JSON.parse(a):[],o=Array.isArray(n)?n.filter(c=>typeof c=="string"&&c!==e):[],i=[r,...o.filter(c=>c!==r)],l=i.splice(t);for(const c of l)window.localStorage.removeItem(c);window.localStorage.setItem(e,JSON.stringify(i))}catch{}}const Ct=24,Pe="tokentracker.trend-cache-index",Ue=24;function St({baseUrl:e,accessToken:r,guestAllowed:t=!1,period:a,from:n,to:o,months:i=Ct,cacheKey:l,timeZone:c,tzOffsetMinutes:f,now:d,sharedRows:y,sharedRange:u,accountView:x=!1,accountAccessToken:m=null,accountRevision:k=0,accountViewResolving:h=!1,deviceId:_=null}={}){const C=!!(x&&m),M=C?"cloud":"local",[D,j]=K.useState([]),[P,R]=K.useState(()=>({from:n,to:o})),[w,F]=K.useState("edge"),[W,U]=K.useState(null),[z,L]=K.useState(!1),[ae,H]=K.useState(null),$=lt(),q=ct(r),Y=!t&&!$,re=Array.isArray(y),Z=u?.from||n,Q=u?.to||o,te=K.useRef({sharedEnabled:re,sharedRows:y,sharedFrom:Z,sharedTo:Q});te.current={sharedEnabled:re,sharedRows:y,sharedFrom:Z,sharedTo:Q};const g=K.useMemo(()=>a==="day"?"hourly":a==="total"?"monthly":"daily",[a]),I=(()=>{if(!l)return null;const N=Mt(e)||"default",E=ht({timeZone:c,offsetMinutes:f}),B=_||"all";if(g==="hourly")return`tokentracker.trend.${l}.${M}.${N}.hourly.${o||n||"day"}.${E}.${B}`;if(g==="monthly")return`tokentracker.trend.${l}.${M}.${N}.monthly.${i}.${o||"today"}.${E}.${B}`;const oe=`${n||""}.${o||""}`;return`tokentracker.trend.${l}.${M}.${N}.daily.${oe}.${E}.${B}`})(),ie=K.useCallback(()=>{if(!I||typeof window>"u")return null;try{const N=window.localStorage.getItem(I);if(!N)return null;const E=JSON.parse(N);return!E||!Array.isArray(E.rows)?null:(ze(Pe,I,Ue),E)}catch{return null}},[I]),fe=K.useCallback(N=>{if(!(!I||typeof window>"u"))try{window.localStorage.setItem(I,JSON.stringify(N)),ze(Pe,I,Ue)}catch{}},[I]),p=K.useCallback(()=>{if(!(!I||typeof window>"u"))try{window.localStorage.removeItem(I)}catch{}},[I]),b=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),A=wt([e,g,n,o,i,M,r,m,k,_,c,f,re,y,Z,Q,t,$,Y,h,q,b]),G=K.useRef(M);K.useEffect(()=>{G.current!==M&&(G.current=M,j([]),R({from:n,to:o}),F("edge"),U(null),H(null),L(!0))},[M]);const O=K.useCallback(async()=>{const N=A(),{sharedEnabled:E,sharedRows:B,sharedFrom:oe,sharedTo:le}=te.current;if(E){j(Array.isArray(B)?B:[]),R({from:oe,to:le}),F("shared"),U(null),L(!1),H(null);return}const me=await Me(r),Ce=C?await Me(m):null;if(!N()||!me&&!$&&!b&&!C)return;if(C&&!Ce){H("Your session expired. Please sign in again to view account data."),L(!1);return}const be=C?Ce:me,ot=C?ut:dt,st=C?ft:mt,it=C?gt:yt;L(!0),H(null);try{let J;g==="hourly"?J=await ot({baseUrl:e,accessToken:be,day:o||n,device:_,timeZone:c,tzOffsetMinutes:f}):g==="monthly"?J=await st({baseUrl:e,accessToken:be,months:i,to:o,device:_,timeZone:c,tzOffsetMinutes:f}):J=await it({baseUrl:e,accessToken:be,from:n,to:o,device:_,timeZone:c,tzOffsetMinutes:f});let S=J?.from||n||J?.day||null;const X=J?.to||o||J?.day||null;g==="monthly"&&!S&&(S=de(X,i));let ne=Array.isArray(J?.data)?J.data:[];g==="daily"?ne=ke(ne,S||n,X||o,{timeZone:c,offsetMinutes:f,now:d}):g==="hourly"?(ne=Ne(ne,S||n||J?.day,{timeZone:c,offsetMinutes:f,now:d}),ne=ve(ne,{timeZone:c,offsetMinutes:f,now:d})):g==="monthly"&&(ne=we(ne,S||n,X||o,{timeZone:c,offsetMinutes:f,now:d}));const Se=new Date().toISOString();if(!N())return;j(ne),R({from:S,to:X}),F("edge"),U(Se),Y?fe({rows:ne,from:S,to:X,mode:g,fetchedAt:Se}):p()}catch(J){if(!N())return;if(Y){const S=ie();if(S?.rows){let X=g==="daily"?ke(S.rows||[],S.from||n,S.to||o,{timeZone:c,offsetMinutes:f,now:d}):g==="hourly"?Ne(S.rows||[],S.from||n||S.day||o,{timeZone:c,offsetMinutes:f,now:d}):Array.isArray(S.rows)?S.rows:[];g==="hourly"?X=ve(X,{timeZone:c,offsetMinutes:f,now:d}):g==="monthly"&&(X=we(X,S.from||n||de(S.to||o,i),S.to||o,{timeZone:c,offsetMinutes:f,now:d})),j(X),R({from:S.from||n||(g==="monthly"?de(S.to||o,i):n),to:S.to||o}),F("cache"),U(S.fetchedAt||null),H(null)}else{j([]),R({from:n,to:o}),F("edge"),U(null);const X=J;H(X?.message||String(X))}}else{j([]),R({from:n,to:o}),F("edge"),U(null);const S=J;H(S?.message||String(S))}}finally{N()&&L(!1)}},[r,e,n,$,t,Y,g,i,ie,q,c,o,f,d,p,fe,b,C,m,k,_,A]);K.useEffect(()=>{if(h){L(!0);return}if(re){j(Array.isArray(y)?y:[]),R({from:Z,to:Q}),F("shared"),U(null),L(!1),H(null);return}if(!q&&!t&&!$&&!b&&!C){j([]),R({from:n,to:o}),H(null),L(!1),F("edge"),U(null);return}if(!Y)p(),j([]),R({from:n,to:o}),H(null),F("edge"),U(null);else{const N=ie();if(N?.rows){let E=g==="daily"?ke(N.rows||[],N.from||n,N.to||o,{timeZone:c,offsetMinutes:f,now:d}):g==="hourly"?Ne(N.rows||[],N.from||n||N.day||o,{timeZone:c,offsetMinutes:f,now:d}):Array.isArray(N.rows)?N.rows:[];g==="hourly"?E=ve(E,{timeZone:c,offsetMinutes:f,now:d}):g==="monthly"&&(E=we(E,N.from||n||de(N.to||o,i),N.to||o,{timeZone:c,offsetMinutes:f,now:d})),j(E),R({from:N.from||n||(g==="monthly"?de(N.to||o,i):n),to:N.to||o}),F("cache"),U(N.fetchedAt||null),H(null)}else j([]),R({from:n,to:o}),F("edge"),U(null),H(null)}L(!0),O()},[r,$,ie,O,re,Z,y,Q,q,t,Y,p,b,h]);const ee=$?"mock":w;return{rows:D,from:P.from||n,to:P.to||o,source:ee,fetchedAt:W,loading:z,error:ae,refresh:O}}function Mt(e){try{return new URL(e).host}catch{return null}}function ye(e){if(!e)return null;const r=String(e).trim(),t=r.split("-");if(t.length!==3)return null;const a=Number(t[0]),n=Number(t[1])-1,o=Number(t[2]);if(!Number.isFinite(a)||!Number.isFinite(n)||!Number.isFinite(o))return null;const i=new Date(Date.UTC(a,n,o));return Number.isFinite(i.getTime())&&_e(i)===r?i:null}function Ze(e,r){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+r))}const et=["total_tokens","billable_total_tokens","input_tokens","cached_input_tokens","cache_creation_input_tokens","output_tokens","reasoning_output_tokens","conversation_count"];function ke(e,r,t,{timeZone:a,offsetMinutes:n,now:o}={}){const i=ye(r),l=ye(t);if(!i||!l||l<i)return Array.isArray(e)?e:[];const c=o instanceof Date&&Number.isFinite(o.getTime())?o:new Date,f=qe({timeZone:a,offsetMinutes:n,date:c}),d=ye(f),y=d?d.getTime():c.getTime(),u=new Map;for(const m of e||[])m?.day&&u.set(m.day,m);const x=[];for(let m=i;m<=l;m=Ze(m,1)){const k=_e(m),h=u.get(k),_=m.getTime()>y;if(h){x.push({...h,missing:!1,future:_});continue}x.push({day:k,total_tokens:null,billable_total_tokens:null,input_tokens:null,cached_input_tokens:null,output_tokens:null,reasoning_output_tokens:null,missing:!_,future:_})}return x}function Dt(e,r){const t=r?null:0;return{hour:e,total_tokens:t,billable_total_tokens:t,input_tokens:t,cached_input_tokens:t,cache_creation_input_tokens:t,output_tokens:t,reasoning_output_tokens:t,conversation_count:t,missing:!1,future:r}}function $t(e){if(!e||typeof e!="object")return!1;const r=e.models;return r&&typeof r=="object"&&Object.keys(r).length>0?!1:et.every(t=>e[t]==null)}function Et(e,r,t){const a={...e,hour:r,missing:!1,future:t};if(!t&&$t(e))for(const n of et)a[n]=0;return a}function Ft(e,r){const t=r===30?48:24,a=[];for(let n=0;n<t;n++){const o=Math.floor(n*r/60),i=n*r%60;a.push(`${e}T${String(o).padStart(2,"0")}:${String(i).padStart(2,"0")}:00`)}return a}function At(e,r,{timeZone:t,offsetMinutes:a}={}){const n=Ft(e,r);if(!t||typeof Intl>"u"||!Intl.DateTimeFormat)return n;const o=ye(e);if(!o)return n;const i=o.getUTCFullYear()*1e4+(o.getUTCMonth()+1)*100+o.getUTCDate(),l=o.getTime()-2160*60*1e3,c=Ze(o,2).getTime()+2160*60*1e3,f=[],d=new Set;for(let y=l;y<=c;y+=1800*1e3){const u=xe({timeZone:t,offsetMinutes:a,now:new Date(y)});if(!u||u.dayNum!==i||r===60&&u.minute!==0||r===30&&u.minute!==0&&u.minute!==30)continue;const x=`${e}T${String(u.hour).padStart(2,"0")}:${String(u.minute).padStart(2,"0")}:00`;d.has(x)||(d.add(x),f.push(x))}return f.length>0?f:n}function Ne(e,r,{timeZone:t,offsetMinutes:a,now:n}={}){if(!r)return Array.isArray(e)?e:[];const o=r.trim().slice(0,10),i=xe({timeZone:t,offsetMinutes:a,now:n}),l=i?i.dayNum:void 0;let c=!1;for(const x of e||[]){const m=x?.hour||x?.label||"",k=he(m,l);if(k&&k.slot%2!==0){c=!0;break}}const f=c?30:60,d=new Map;for(const x of e||[]){const m=x?.hour||x?.label||"",k=he(m,l);k&&d.set(k.slot,x)}const y=[],u=At(o,f,{timeZone:t,offsetMinutes:a});for(let x=0;x<u.length;x++){const m=u[x],k=he(m,l),h=k?k.slot:c?x:x*2,_=d.get(h);let C=!1;if(i){const M=i.year*1e4+i.month*100+i.day,D=k?.dayNum??Number(o.replace(/-/g,""));if(D>M)C=!0;else if(D===M){const j=i.hour*2+(i.minute>=30?1:0);C=h>j}}_?y.push(Et(_,m,C)):y.push(Dt(m,C))}return y}function ve(e,{timeZone:r,offsetMinutes:t,now:a}={}){if(!Array.isArray(e))return[];const n=xe({timeZone:r,offsetMinutes:t,now:a});return n?e.map(o=>{const i=o?.hour||o?.label||"",l=he(i,n.dayNum);if(!l)return{...o,future:!1};const c=l.dayNum!==null&&l.dayNum>n.dayNum||(l.dayNum===null||l.dayNum===n.dayNum)&&l.slot>n.slot;return{...o,future:!!c}}):e}function de(e,r){const t=je(String(e||"").slice(0,7));return t?_e(new Date(Date.UTC(t.year,t.month-r,1))):null}function we(e,r,t,a={}){const n=je(String(r||"").slice(0,7)),o=je(String(t||"").slice(0,7));if(!n||!o)return Array.isArray(e)?e:[];const i=n.year*12+n.month-1,l=o.year*12+o.month-1;if(l<i)return Array.isArray(e)?e:[];const c=xe(a),f=c.year*12+c.month-1,d=new Map((e||[]).map(u=>[u?.month,u])),y=[];for(let u=i;u<=l;u++){const x=`${Math.floor(u/12)}-${String(u%12+1).padStart(2,"0")}`,m=u>f,k=d.get(x);if(k&&!(k.future&&k.total_tokens==null))y.push({...k,missing:!1,future:m});else{const h=m?null:0;y.push({month:x,total_tokens:h,billable_total_tokens:h,input_tokens:h,cached_input_tokens:h,cache_creation_input_tokens:h,output_tokens:h,reasoning_output_tokens:h,conversation_count:h,missing:!1,future:m})}}return y}function xe({timeZone:e,offsetMinutes:r,now:t}={}){const a=t instanceof Date&&Number.isFinite(t.getTime())?t:new Date;if(e&&typeof Intl<"u"&&Intl.DateTimeFormat)try{const u=new Intl.DateTimeFormat("en-CA",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).formatToParts(a).reduce((C,M)=>(M.type&&M.value&&(C[M.type]=M.value),C),{}),x=Number(u.year),m=Number(u.month),k=Number(u.day),h=Number(u.hour),_=Number(u.minute);if(Number.isFinite(x)&&Number.isFinite(m)&&Number.isFinite(k)&&Number.isFinite(h)&&Number.isFinite(_)){const C=h*2+(_>=30?1:0);return{year:x,month:m,day:k,hour:h,minute:_,dayNum:x*1e4+m*100+k,slot:C}}}catch{}if(Number.isFinite(r)){const d=new Date(a.getTime()+r*60*1e3),y=d.getUTCFullYear(),u=d.getUTCMonth()+1,x=d.getUTCDate(),m=d.getUTCHours(),k=d.getUTCMinutes(),h=m*2+(k>=30?1:0);return{year:y,month:u,day:x,hour:m,minute:k,dayNum:y*1e4+u*100+x,slot:h}}const n=a.getFullYear(),o=a.getMonth()+1,i=a.getDate(),l=a.getHours(),c=a.getMinutes(),f=l*2+(c>=30?1:0);return{year:n,month:o,day:i,hour:l,minute:c,dayNum:n*1e4+o*100+i,slot:f}}function he(e,r){if(!e)return null;const t=String(e).trim();if(t.includes("T")){const[a,n]=t.split("T");if(!a||!n)return null;const o=a.split("-");if(o.length!==3)return null;const i=Number(o[0]),l=Number(o[1]),c=Number(o[2]);if(!Number.isFinite(i)||!Number.isFinite(l)||!Number.isFinite(c))return null;const f=n.split(":"),d=Number(f[0]),y=Number(f[1]);if(!Number.isFinite(d)||d<0||d>23||!Number.isFinite(y)||y<0||y>59)return null;const u=d*2+(y>=30?1:0);return{dayNum:i*1e4+l*100+c,slot:u}}else{let a=NaN,n=0;if(/^\d{1,2}$/.test(t))a=Number(t);else if(/^\d{1,2}:\d{2}(:\d{2})?$/.test(t)){const i=t.split(":");a=Number(i[0]),n=Number(i[1])}if(!Number.isFinite(a)||a<0||a>23||!Number.isFinite(n)||n<0||n>59)return null;const o=a*2+(n>=30?1:0);return{dayNum:r||null,slot:o}}}function je(e){if(!e)return null;const t=String(e).trim().split("-");if(t.length!==2)return null;const a=Number(t[0]),n=Number(t[1]);return!Number.isFinite(a)||!Number.isFinite(n)||n<1||n>12?null:{year:a,month:n}}function Rt(e){return e==="day"?"hourly":e==="total"?"monthly":"daily"}function zt(e){return!!e&&!e.missing&&!e.future}function Pt(e){const r=e?.billable_total_tokens??e?.total_tokens??e?.value,t=Number(r);return Number.isFinite(t)&&t>=0?t:0}function Ut(e){const r=e?.total_tokens??e?.billable_total_tokens??e?.value,t=Number(r);return Number.isFinite(t)&&t>=0?t:0}function Lt(e){const r=Array.isArray(e)?e.filter(zt):[];let t=0,a=0,n=0,o=0,i=!1,l=0,c=-1,f=null;for(const d of r){const y=Ut(d),u=Pt(d);t+=y,a+=u;const x=Number(d?.conversation_count);Number.isFinite(x)&&x>0&&(n+=x);const m=Number(d?.total_cost_usd);Number.isFinite(m)&&(i=!0,o+=m),u>0&&(l+=1),u>c&&(c=u,f=d)}return{totalTokens:t,billableTokens:a,conversationCount:n,totalCostUsd:i?o:null,bucketCount:r.length,activeBuckets:l,peak:f&&c>0?{value:c,label:f.hour||f.day||f.month||""}:null}}function ue(e){return String(e).padStart(2,"0")}function tt(e){return typeof e=="string"&&e.trim()?e:"en-US"}function nt(e){const r=String(e||""),t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(r);if(!t)return null;const[,a,n,o]=t,i=new Date(Date.UTC(Number(a),Number(n)-1,Number(o)));return i.getUTCFullYear()!==Number(a)||i.getUTCMonth()+1!==Number(n)||i.getUTCDate()!==Number(o)?null:i}function se(e,r,t=!0){const a=nt(e);if(!a||typeof Intl>"u"||!Intl.DateTimeFormat)return String(e||"");try{return new Intl.DateTimeFormat(tt(r),{...t?{year:"numeric"}:{},month:"short",day:"numeric",timeZone:"UTC"}).format(a)}catch{return String(e||"")}}function pe(e,r){const t=String(e||""),a=/^(\d{4})-(\d{2})(?:-\d{2})?$/.exec(t);if(!a)return t;const n=new Date(Date.UTC(Number(a[1]),Number(a[2])-1,1));if(n.getUTCFullYear()!==Number(a[1])||n.getUTCMonth()+1!==Number(a[2]))return t;try{return new Intl.DateTimeFormat(tt(r),{year:"numeric",month:"short",timeZone:"UTC"}).format(n)}catch{return t}}function Ht(e,r){const t=nt(e);return t?(t.setUTCDate(t.getUTCDate()+r),`${t.getUTCFullYear()}-${ue(t.getUTCMonth()+1)}-${ue(t.getUTCDate())}`):e}function Le(e,r,t){if(!e)return"";if(r==="hourly"){const n=String(e.hour||e.label||""),o=/^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})/.exec(n);if(!o)return n;const[,i,l,c]=o,d=Number(l)*60+Number(c)+30,y=Math.floor(d/60)%24,u=d%60,x=se(i,t);if(d>=1440){const m=se(Ht(i,1),t);return`${x} ${l}:${c}–${m} ${ue(y)}:${ue(u)}`}return`${x} ${l}:${c}–${ue(y)}:${ue(u)}`}if(r==="monthly"){const n=String(e.month||e.label||"");return pe(n,t)}const a=String(e.day||e.label||"");return se(a,t)}function It(e,r,t,a){if(!e||!r)return null;const n=String(e),o=String(r);return t==="hourly"&&n===o?{start:`${se(n,a)} · 00:00`,end:"24:00"}:t==="monthly"?{start:pe(n,a),end:pe(o,a)}:{start:se(n,a),end:se(o,a)}}function Bt(e){if(!e||e.activeBuckets===0)return"trend.zoom.insight.empty";const r=e.totalTokens||0;return r<1e7?"trend.zoom.insight.calm":r<5e8?"trend.zoom.insight.steady":r<5e9?"trend.zoom.insight.heavy":"trend.zoom.insight.massive"}function Ot(e,r,t){if(!e)return"";if(r==="hourly"){const n=/T(\d{2}:\d{2})/.exec(String(e.hour||e.label||""));return n?n[1]:""}if(r==="monthly")return pe(String(e.month||e.label||""),t);const a=String(e.day||e.label||"");return se(a,t,!1)}const Yt=[{period:"day",labelKey:"trend.zoom.gran.30min"},{period:"month",labelKey:"trend.zoom.gran.day"},{period:"total",labelKey:"trend.zoom.gran.month"}],Kt=24,ce="#10b981";function He(e){return e==="day"?"day":e==="total"?"total":"month"}function Te(e,r){const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(String(e||""));if(!t)return e;const a=new Date(Date.UTC(Number(t[1]),Number(t[2])-1,Number(t[3])));a.setUTCDate(a.getUTCDate()+r);const n=a.getUTCFullYear(),o=String(a.getUTCMonth()+1).padStart(2,"0"),i=String(a.getUTCDate()).padStart(2,"0");return`${n}-${o}-${i}`}function Gt(e,r){const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(String(e||""));if(!t)return e;const a=new Date(Date.UTC(Number(t[1]),Number(t[2])-1+r,Number(t[3]))),n=a.getUTCFullYear(),o=String(a.getUTCMonth()+1).padStart(2,"0"),i=String(a.getUTCDate()).padStart(2,"0");return`${n}-${o}-${i}`}function Xt(e,r){const t=/^(\d{4})-(\d{2})/.exec(String(e||"")),a=/^(\d{4})-(\d{2})/.exec(String(r||""));if(!t||!a)return Kt;const n=Number(a[1])*12+Number(a[2])-(Number(t[1])*12+Number(t[2]))+1;return Math.max(1,n)}function Ie(e,r){return r?e==="total"?{from:Gt(r,-23),to:r}:{from:Te(r,-29),to:r}:{from:null,to:null}}function Wt(e){const r=/^\d{4}-(\d{2}-\d{2})T(\d{2}:\d{2})/.exec(String(e||""));return r?`${r[1]} ${r[2]}`:e||""}function ge({label:e,value:r,sub:t,title:a}){return s.jsxs("div",{className:"flex flex-col gap-1.5 group",children:[s.jsx("span",{className:"text-[9px] font-bold uppercase tracking-widest font-mono text-zinc-400 dark:text-zinc-500",children:e}),s.jsx("span",{title:a,className:"text-xl font-black font-mono text-zinc-900 dark:text-zinc-50 tracking-tight leading-none tabular-nums transition-transform duration-200 group-hover:-translate-y-[1px]",children:r}),t?s.jsx("span",{className:"text-[10px] font-bold text-zinc-400 dark:text-zinc-500 font-mono tabular-nums",children:t}):null]})}function qt({zoomConfig:e,period:r,from:t,to:a,timeZoneLabel:n,onClose:o,renderChart:i}){const{currency:l,rate:c}=Qe(),{formatTokensTooltip:f}=Ve(),d=g=>kt(g),y=v.useMemo(()=>qe({timeZone:e?.timeZone,offsetMinutes:e?.tzOffsetMinutes,date:e?.now||new Date})||a||t||null,[e?.timeZone,e?.tzOffsetMinutes,e?.now,a,t]),[u,x]=v.useState(()=>He(r)),[m,k]=v.useState(y),[h,_]=v.useState(()=>Ie(He(r),y)),[C,M]=v.useState(!1),[D,j]=v.useState(!1),[P,R]=v.useState(!1),w=v.useRef(!1),F=y,W=g=>{x(g),g!=="day"&&_(Ie(g,y))},U=v.useMemo(()=>u==="day"?{from:m,to:m,months:void 0}:u==="total"?{from:void 0,to:h.to,months:Xt(h.from,h.to)}:{from:h.from,to:h.to,months:void 0},[u,m,h]),{rows:z,from:L,to:ae,loading:H}=St({...e,period:u,from:U.from,to:U.to,months:U.months}),$=v.useMemo(()=>Lt(z),[z]),q=v.useCallback(()=>{w.current||(w.current=!0,o())},[o]),Y=v.useCallback(()=>R(!0),[]),re=g=>{g.target===g.currentTarget&&P&&q()};if(v.useEffect(()=>{if(!P)return;const g=window.setTimeout(q,250);return()=>window.clearTimeout(g)},[q,P]),v.useEffect(()=>{const g=I=>{I.key==="Escape"&&Y()};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[Y]),typeof document>"u")return null;const Z=u==="day"&&!!m,Q=u==="day"&&!!m&&(!F||m<F),te=$.totalCostUsd!=null?Je($.totalCostUsd,{currency:l,rate:c}):null;return s.jsxs("div",{onAnimationEnd:re,onClick:g=>{g.target===g.currentTarget&&Y()},className:V("fixed inset-0 z-50 flex items-center justify-center p-3 md:p-6 backdrop-blur-md bg-black/15 dark:bg-black/40",P?"animate-tt-fade-out":"animate-tt-fade-in"),children:[s.jsx("style",{children:`
1
+ import{r as K,W as lt,aA as ct,aB as Me,aC as ut,aD as dt,aE as ft,aF as mt,aG as gt,aH as yt,aI as ht,aJ as _e,aK as qe,V as v,az as Je,j as s,X as pt,c as T,y as V,aL as xt,aM as bt,n as kt,h as Nt}from"./__vite-browser-external-BtJVmciH.js";import{m as vt}from"./react-BgpqhoCj.js";import{u as Qe}from"./useCurrency-BgZmWbkx.js";import{u as Ve}from"./useTokenFormat-D7s1-Zuk.js";import{D as De}from"./DateRangePopover-PQXB8v0k.js";import{u as wt}from"./use-latest-request-guard-DGhwmlX8.js";import{T as jt,M as Tt}from"./terminal-Br5vyD6Q.js";import{P as $e,a as Ee,b as Fe,c as Ae,d as Re}from"./PopoverPopup-DDnISLKM.js";import{u as _t}from"./use-reduced-motion-CfCY-K-a.js";function ze(e,r,t){if(!(typeof window>"u"))try{const a=window.localStorage.getItem(e),n=a?JSON.parse(a):[],o=Array.isArray(n)?n.filter(c=>typeof c=="string"&&c!==e):[],i=[r,...o.filter(c=>c!==r)],l=i.splice(t);for(const c of l)window.localStorage.removeItem(c);window.localStorage.setItem(e,JSON.stringify(i))}catch{}}const Ct=24,Pe="tokentracker.trend-cache-index",Ue=24;function St({baseUrl:e,accessToken:r,guestAllowed:t=!1,period:a,from:n,to:o,months:i=Ct,cacheKey:l,timeZone:c,tzOffsetMinutes:f,now:d,sharedRows:y,sharedRange:u,accountView:x=!1,accountAccessToken:m=null,accountRevision:k=0,accountViewResolving:h=!1,deviceId:_=null}={}){const C=!!(x&&m),M=C?"cloud":"local",[D,j]=K.useState([]),[P,R]=K.useState(()=>({from:n,to:o})),[w,F]=K.useState("edge"),[W,U]=K.useState(null),[z,L]=K.useState(!1),[ae,H]=K.useState(null),$=lt(),q=ct(r),Y=!t&&!$,re=Array.isArray(y),Z=u?.from||n,Q=u?.to||o,te=K.useRef({sharedEnabled:re,sharedRows:y,sharedFrom:Z,sharedTo:Q});te.current={sharedEnabled:re,sharedRows:y,sharedFrom:Z,sharedTo:Q};const g=K.useMemo(()=>a==="day"?"hourly":a==="total"?"monthly":"daily",[a]),I=(()=>{if(!l)return null;const N=Mt(e)||"default",E=ht({timeZone:c,offsetMinutes:f}),B=_||"all";if(g==="hourly")return`tokentracker.trend.${l}.${M}.${N}.hourly.${o||n||"day"}.${E}.${B}`;if(g==="monthly")return`tokentracker.trend.${l}.${M}.${N}.monthly.${i}.${o||"today"}.${E}.${B}`;const oe=`${n||""}.${o||""}`;return`tokentracker.trend.${l}.${M}.${N}.daily.${oe}.${E}.${B}`})(),ie=K.useCallback(()=>{if(!I||typeof window>"u")return null;try{const N=window.localStorage.getItem(I);if(!N)return null;const E=JSON.parse(N);return!E||!Array.isArray(E.rows)?null:(ze(Pe,I,Ue),E)}catch{return null}},[I]),fe=K.useCallback(N=>{if(!(!I||typeof window>"u"))try{window.localStorage.setItem(I,JSON.stringify(N)),ze(Pe,I,Ue)}catch{}},[I]),p=K.useCallback(()=>{if(!(!I||typeof window>"u"))try{window.localStorage.removeItem(I)}catch{}},[I]),b=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),A=wt([e,g,n,o,i,M,r,m,k,_,c,f,re,y,Z,Q,t,$,Y,h,q,b]),G=K.useRef(M);K.useEffect(()=>{G.current!==M&&(G.current=M,j([]),R({from:n,to:o}),F("edge"),U(null),H(null),L(!0))},[M]);const O=K.useCallback(async()=>{const N=A(),{sharedEnabled:E,sharedRows:B,sharedFrom:oe,sharedTo:le}=te.current;if(E){j(Array.isArray(B)?B:[]),R({from:oe,to:le}),F("shared"),U(null),L(!1),H(null);return}const me=await Me(r),Ce=C?await Me(m):null;if(!N()||!me&&!$&&!b&&!C)return;if(C&&!Ce){H("Your session expired. Please sign in again to view account data."),L(!1);return}const be=C?Ce:me,ot=C?ut:dt,st=C?ft:mt,it=C?gt:yt;L(!0),H(null);try{let J;g==="hourly"?J=await ot({baseUrl:e,accessToken:be,day:o||n,device:_,timeZone:c,tzOffsetMinutes:f}):g==="monthly"?J=await st({baseUrl:e,accessToken:be,months:i,to:o,device:_,timeZone:c,tzOffsetMinutes:f}):J=await it({baseUrl:e,accessToken:be,from:n,to:o,device:_,timeZone:c,tzOffsetMinutes:f});let S=J?.from||n||J?.day||null;const X=J?.to||o||J?.day||null;g==="monthly"&&!S&&(S=de(X,i));let ne=Array.isArray(J?.data)?J.data:[];g==="daily"?ne=ke(ne,S||n,X||o,{timeZone:c,offsetMinutes:f,now:d}):g==="hourly"?(ne=Ne(ne,S||n||J?.day,{timeZone:c,offsetMinutes:f,now:d}),ne=ve(ne,{timeZone:c,offsetMinutes:f,now:d})):g==="monthly"&&(ne=we(ne,S||n,X||o,{timeZone:c,offsetMinutes:f,now:d}));const Se=new Date().toISOString();if(!N())return;j(ne),R({from:S,to:X}),F("edge"),U(Se),Y?fe({rows:ne,from:S,to:X,mode:g,fetchedAt:Se}):p()}catch(J){if(!N())return;if(Y){const S=ie();if(S?.rows){let X=g==="daily"?ke(S.rows||[],S.from||n,S.to||o,{timeZone:c,offsetMinutes:f,now:d}):g==="hourly"?Ne(S.rows||[],S.from||n||S.day||o,{timeZone:c,offsetMinutes:f,now:d}):Array.isArray(S.rows)?S.rows:[];g==="hourly"?X=ve(X,{timeZone:c,offsetMinutes:f,now:d}):g==="monthly"&&(X=we(X,S.from||n||de(S.to||o,i),S.to||o,{timeZone:c,offsetMinutes:f,now:d})),j(X),R({from:S.from||n||(g==="monthly"?de(S.to||o,i):n),to:S.to||o}),F("cache"),U(S.fetchedAt||null),H(null)}else{j([]),R({from:n,to:o}),F("edge"),U(null);const X=J;H(X?.message||String(X))}}else{j([]),R({from:n,to:o}),F("edge"),U(null);const S=J;H(S?.message||String(S))}}finally{N()&&L(!1)}},[r,e,n,$,t,Y,g,i,ie,q,c,o,f,d,p,fe,b,C,m,k,_,A]);K.useEffect(()=>{if(h){L(!0);return}if(re){j(Array.isArray(y)?y:[]),R({from:Z,to:Q}),F("shared"),U(null),L(!1),H(null);return}if(!q&&!t&&!$&&!b&&!C){j([]),R({from:n,to:o}),H(null),L(!1),F("edge"),U(null);return}if(!Y)p(),j([]),R({from:n,to:o}),H(null),F("edge"),U(null);else{const N=ie();if(N?.rows){let E=g==="daily"?ke(N.rows||[],N.from||n,N.to||o,{timeZone:c,offsetMinutes:f,now:d}):g==="hourly"?Ne(N.rows||[],N.from||n||N.day||o,{timeZone:c,offsetMinutes:f,now:d}):Array.isArray(N.rows)?N.rows:[];g==="hourly"?E=ve(E,{timeZone:c,offsetMinutes:f,now:d}):g==="monthly"&&(E=we(E,N.from||n||de(N.to||o,i),N.to||o,{timeZone:c,offsetMinutes:f,now:d})),j(E),R({from:N.from||n||(g==="monthly"?de(N.to||o,i):n),to:N.to||o}),F("cache"),U(N.fetchedAt||null),H(null)}else j([]),R({from:n,to:o}),F("edge"),U(null),H(null)}L(!0),O()},[r,$,ie,O,re,Z,y,Q,q,t,Y,p,b,h]);const ee=$?"mock":w;return{rows:D,from:P.from||n,to:P.to||o,source:ee,fetchedAt:W,loading:z,error:ae,refresh:O}}function Mt(e){try{return new URL(e).host}catch{return null}}function ye(e){if(!e)return null;const r=String(e).trim(),t=r.split("-");if(t.length!==3)return null;const a=Number(t[0]),n=Number(t[1])-1,o=Number(t[2]);if(!Number.isFinite(a)||!Number.isFinite(n)||!Number.isFinite(o))return null;const i=new Date(Date.UTC(a,n,o));return Number.isFinite(i.getTime())&&_e(i)===r?i:null}function Ze(e,r){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+r))}const et=["total_tokens","billable_total_tokens","input_tokens","cached_input_tokens","cache_creation_input_tokens","output_tokens","reasoning_output_tokens","conversation_count"];function ke(e,r,t,{timeZone:a,offsetMinutes:n,now:o}={}){const i=ye(r),l=ye(t);if(!i||!l||l<i)return Array.isArray(e)?e:[];const c=o instanceof Date&&Number.isFinite(o.getTime())?o:new Date,f=qe({timeZone:a,offsetMinutes:n,date:c}),d=ye(f),y=d?d.getTime():c.getTime(),u=new Map;for(const m of e||[])m?.day&&u.set(m.day,m);const x=[];for(let m=i;m<=l;m=Ze(m,1)){const k=_e(m),h=u.get(k),_=m.getTime()>y;if(h){x.push({...h,missing:!1,future:_});continue}x.push({day:k,total_tokens:null,billable_total_tokens:null,input_tokens:null,cached_input_tokens:null,output_tokens:null,reasoning_output_tokens:null,missing:!_,future:_})}return x}function Dt(e,r){const t=r?null:0;return{hour:e,total_tokens:t,billable_total_tokens:t,input_tokens:t,cached_input_tokens:t,cache_creation_input_tokens:t,output_tokens:t,reasoning_output_tokens:t,conversation_count:t,missing:!1,future:r}}function $t(e){if(!e||typeof e!="object")return!1;const r=e.models;return r&&typeof r=="object"&&Object.keys(r).length>0?!1:et.every(t=>e[t]==null)}function Et(e,r,t){const a={...e,hour:r,missing:!1,future:t};if(!t&&$t(e))for(const n of et)a[n]=0;return a}function Ft(e,r){const t=r===30?48:24,a=[];for(let n=0;n<t;n++){const o=Math.floor(n*r/60),i=n*r%60;a.push(`${e}T${String(o).padStart(2,"0")}:${String(i).padStart(2,"0")}:00`)}return a}function At(e,r,{timeZone:t,offsetMinutes:a}={}){const n=Ft(e,r);if(!t||typeof Intl>"u"||!Intl.DateTimeFormat)return n;const o=ye(e);if(!o)return n;const i=o.getUTCFullYear()*1e4+(o.getUTCMonth()+1)*100+o.getUTCDate(),l=o.getTime()-2160*60*1e3,c=Ze(o,2).getTime()+2160*60*1e3,f=[],d=new Set;for(let y=l;y<=c;y+=1800*1e3){const u=xe({timeZone:t,offsetMinutes:a,now:new Date(y)});if(!u||u.dayNum!==i||r===60&&u.minute!==0||r===30&&u.minute!==0&&u.minute!==30)continue;const x=`${e}T${String(u.hour).padStart(2,"0")}:${String(u.minute).padStart(2,"0")}:00`;d.has(x)||(d.add(x),f.push(x))}return f.length>0?f:n}function Ne(e,r,{timeZone:t,offsetMinutes:a,now:n}={}){if(!r)return Array.isArray(e)?e:[];const o=r.trim().slice(0,10),i=xe({timeZone:t,offsetMinutes:a,now:n}),l=i?i.dayNum:void 0;let c=!1;for(const x of e||[]){const m=x?.hour||x?.label||"",k=he(m,l);if(k&&k.slot%2!==0){c=!0;break}}const f=c?30:60,d=new Map;for(const x of e||[]){const m=x?.hour||x?.label||"",k=he(m,l);k&&d.set(k.slot,x)}const y=[],u=At(o,f,{timeZone:t,offsetMinutes:a});for(let x=0;x<u.length;x++){const m=u[x],k=he(m,l),h=k?k.slot:c?x:x*2,_=d.get(h);let C=!1;if(i){const M=i.year*1e4+i.month*100+i.day,D=k?.dayNum??Number(o.replace(/-/g,""));if(D>M)C=!0;else if(D===M){const j=i.hour*2+(i.minute>=30?1:0);C=h>j}}_?y.push(Et(_,m,C)):y.push(Dt(m,C))}return y}function ve(e,{timeZone:r,offsetMinutes:t,now:a}={}){if(!Array.isArray(e))return[];const n=xe({timeZone:r,offsetMinutes:t,now:a});return n?e.map(o=>{const i=o?.hour||o?.label||"",l=he(i,n.dayNum);if(!l)return{...o,future:!1};const c=l.dayNum!==null&&l.dayNum>n.dayNum||(l.dayNum===null||l.dayNum===n.dayNum)&&l.slot>n.slot;return{...o,future:!!c}}):e}function de(e,r){const t=je(String(e||"").slice(0,7));return t?_e(new Date(Date.UTC(t.year,t.month-r,1))):null}function we(e,r,t,a={}){const n=je(String(r||"").slice(0,7)),o=je(String(t||"").slice(0,7));if(!n||!o)return Array.isArray(e)?e:[];const i=n.year*12+n.month-1,l=o.year*12+o.month-1;if(l<i)return Array.isArray(e)?e:[];const c=xe(a),f=c.year*12+c.month-1,d=new Map((e||[]).map(u=>[u?.month,u])),y=[];for(let u=i;u<=l;u++){const x=`${Math.floor(u/12)}-${String(u%12+1).padStart(2,"0")}`,m=u>f,k=d.get(x);if(k&&!(k.future&&k.total_tokens==null))y.push({...k,missing:!1,future:m});else{const h=m?null:0;y.push({month:x,total_tokens:h,billable_total_tokens:h,input_tokens:h,cached_input_tokens:h,cache_creation_input_tokens:h,output_tokens:h,reasoning_output_tokens:h,conversation_count:h,missing:!1,future:m})}}return y}function xe({timeZone:e,offsetMinutes:r,now:t}={}){const a=t instanceof Date&&Number.isFinite(t.getTime())?t:new Date;if(e&&typeof Intl<"u"&&Intl.DateTimeFormat)try{const u=new Intl.DateTimeFormat("en-CA",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).formatToParts(a).reduce((C,M)=>(M.type&&M.value&&(C[M.type]=M.value),C),{}),x=Number(u.year),m=Number(u.month),k=Number(u.day),h=Number(u.hour),_=Number(u.minute);if(Number.isFinite(x)&&Number.isFinite(m)&&Number.isFinite(k)&&Number.isFinite(h)&&Number.isFinite(_)){const C=h*2+(_>=30?1:0);return{year:x,month:m,day:k,hour:h,minute:_,dayNum:x*1e4+m*100+k,slot:C}}}catch{}if(Number.isFinite(r)){const d=new Date(a.getTime()+r*60*1e3),y=d.getUTCFullYear(),u=d.getUTCMonth()+1,x=d.getUTCDate(),m=d.getUTCHours(),k=d.getUTCMinutes(),h=m*2+(k>=30?1:0);return{year:y,month:u,day:x,hour:m,minute:k,dayNum:y*1e4+u*100+x,slot:h}}const n=a.getFullYear(),o=a.getMonth()+1,i=a.getDate(),l=a.getHours(),c=a.getMinutes(),f=l*2+(c>=30?1:0);return{year:n,month:o,day:i,hour:l,minute:c,dayNum:n*1e4+o*100+i,slot:f}}function he(e,r){if(!e)return null;const t=String(e).trim();if(t.includes("T")){const[a,n]=t.split("T");if(!a||!n)return null;const o=a.split("-");if(o.length!==3)return null;const i=Number(o[0]),l=Number(o[1]),c=Number(o[2]);if(!Number.isFinite(i)||!Number.isFinite(l)||!Number.isFinite(c))return null;const f=n.split(":"),d=Number(f[0]),y=Number(f[1]);if(!Number.isFinite(d)||d<0||d>23||!Number.isFinite(y)||y<0||y>59)return null;const u=d*2+(y>=30?1:0);return{dayNum:i*1e4+l*100+c,slot:u}}else{let a=NaN,n=0;if(/^\d{1,2}$/.test(t))a=Number(t);else if(/^\d{1,2}:\d{2}(:\d{2})?$/.test(t)){const i=t.split(":");a=Number(i[0]),n=Number(i[1])}if(!Number.isFinite(a)||a<0||a>23||!Number.isFinite(n)||n<0||n>59)return null;const o=a*2+(n>=30?1:0);return{dayNum:r||null,slot:o}}}function je(e){if(!e)return null;const t=String(e).trim().split("-");if(t.length!==2)return null;const a=Number(t[0]),n=Number(t[1]);return!Number.isFinite(a)||!Number.isFinite(n)||n<1||n>12?null:{year:a,month:n}}function Rt(e){return e==="day"?"hourly":e==="total"?"monthly":"daily"}function zt(e){return!!e&&!e.missing&&!e.future}function Pt(e){const r=e?.billable_total_tokens??e?.total_tokens??e?.value,t=Number(r);return Number.isFinite(t)&&t>=0?t:0}function Ut(e){const r=e?.total_tokens??e?.billable_total_tokens??e?.value,t=Number(r);return Number.isFinite(t)&&t>=0?t:0}function Lt(e){const r=Array.isArray(e)?e.filter(zt):[];let t=0,a=0,n=0,o=0,i=!1,l=0,c=-1,f=null;for(const d of r){const y=Ut(d),u=Pt(d);t+=y,a+=u;const x=Number(d?.conversation_count);Number.isFinite(x)&&x>0&&(n+=x);const m=Number(d?.total_cost_usd);Number.isFinite(m)&&(i=!0,o+=m),u>0&&(l+=1),u>c&&(c=u,f=d)}return{totalTokens:t,billableTokens:a,conversationCount:n,totalCostUsd:i?o:null,bucketCount:r.length,activeBuckets:l,peak:f&&c>0?{value:c,label:f.hour||f.day||f.month||""}:null}}function ue(e){return String(e).padStart(2,"0")}function tt(e){return typeof e=="string"&&e.trim()?e:"en-US"}function nt(e){const r=String(e||""),t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(r);if(!t)return null;const[,a,n,o]=t,i=new Date(Date.UTC(Number(a),Number(n)-1,Number(o)));return i.getUTCFullYear()!==Number(a)||i.getUTCMonth()+1!==Number(n)||i.getUTCDate()!==Number(o)?null:i}function se(e,r,t=!0){const a=nt(e);if(!a||typeof Intl>"u"||!Intl.DateTimeFormat)return String(e||"");try{return new Intl.DateTimeFormat(tt(r),{...t?{year:"numeric"}:{},month:"short",day:"numeric",timeZone:"UTC"}).format(a)}catch{return String(e||"")}}function pe(e,r){const t=String(e||""),a=/^(\d{4})-(\d{2})(?:-\d{2})?$/.exec(t);if(!a)return t;const n=new Date(Date.UTC(Number(a[1]),Number(a[2])-1,1));if(n.getUTCFullYear()!==Number(a[1])||n.getUTCMonth()+1!==Number(a[2]))return t;try{return new Intl.DateTimeFormat(tt(r),{year:"numeric",month:"short",timeZone:"UTC"}).format(n)}catch{return t}}function Ht(e,r){const t=nt(e);return t?(t.setUTCDate(t.getUTCDate()+r),`${t.getUTCFullYear()}-${ue(t.getUTCMonth()+1)}-${ue(t.getUTCDate())}`):e}function Le(e,r,t){if(!e)return"";if(r==="hourly"){const n=String(e.hour||e.label||""),o=/^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})/.exec(n);if(!o)return n;const[,i,l,c]=o,d=Number(l)*60+Number(c)+30,y=Math.floor(d/60)%24,u=d%60,x=se(i,t);if(d>=1440){const m=se(Ht(i,1),t);return`${x} ${l}:${c}–${m} ${ue(y)}:${ue(u)}`}return`${x} ${l}:${c}–${ue(y)}:${ue(u)}`}if(r==="monthly"){const n=String(e.month||e.label||"");return pe(n,t)}const a=String(e.day||e.label||"");return se(a,t)}function It(e,r,t,a){if(!e||!r)return null;const n=String(e),o=String(r);return t==="hourly"&&n===o?{start:`${se(n,a)} · 00:00`,end:"24:00"}:t==="monthly"?{start:pe(n,a),end:pe(o,a)}:{start:se(n,a),end:se(o,a)}}function Bt(e){if(!e||e.activeBuckets===0)return"trend.zoom.insight.empty";const r=e.totalTokens||0;return r<1e7?"trend.zoom.insight.calm":r<5e8?"trend.zoom.insight.steady":r<5e9?"trend.zoom.insight.heavy":"trend.zoom.insight.massive"}function Ot(e,r,t){if(!e)return"";if(r==="hourly"){const n=/T(\d{2}:\d{2})/.exec(String(e.hour||e.label||""));return n?n[1]:""}if(r==="monthly")return pe(String(e.month||e.label||""),t);const a=String(e.day||e.label||"");return se(a,t,!1)}const Yt=[{period:"day",labelKey:"trend.zoom.gran.30min"},{period:"month",labelKey:"trend.zoom.gran.day"},{period:"total",labelKey:"trend.zoom.gran.month"}],Kt=24,ce="#10b981";function He(e){return e==="day"?"day":e==="total"?"total":"month"}function Te(e,r){const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(String(e||""));if(!t)return e;const a=new Date(Date.UTC(Number(t[1]),Number(t[2])-1,Number(t[3])));a.setUTCDate(a.getUTCDate()+r);const n=a.getUTCFullYear(),o=String(a.getUTCMonth()+1).padStart(2,"0"),i=String(a.getUTCDate()).padStart(2,"0");return`${n}-${o}-${i}`}function Gt(e,r){const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(String(e||""));if(!t)return e;const a=new Date(Date.UTC(Number(t[1]),Number(t[2])-1+r,Number(t[3]))),n=a.getUTCFullYear(),o=String(a.getUTCMonth()+1).padStart(2,"0"),i=String(a.getUTCDate()).padStart(2,"0");return`${n}-${o}-${i}`}function Xt(e,r){const t=/^(\d{4})-(\d{2})/.exec(String(e||"")),a=/^(\d{4})-(\d{2})/.exec(String(r||""));if(!t||!a)return Kt;const n=Number(a[1])*12+Number(a[2])-(Number(t[1])*12+Number(t[2]))+1;return Math.max(1,n)}function Ie(e,r){return r?e==="total"?{from:Gt(r,-23),to:r}:{from:Te(r,-29),to:r}:{from:null,to:null}}function Wt(e){const r=/^\d{4}-(\d{2}-\d{2})T(\d{2}:\d{2})/.exec(String(e||""));return r?`${r[1]} ${r[2]}`:e||""}function ge({label:e,value:r,sub:t,title:a}){return s.jsxs("div",{className:"flex flex-col gap-1.5 group",children:[s.jsx("span",{className:"text-[9px] font-bold uppercase tracking-widest font-mono text-zinc-400 dark:text-zinc-500",children:e}),s.jsx("span",{title:a,className:"text-xl font-black font-mono text-zinc-900 dark:text-zinc-50 tracking-tight leading-none tabular-nums transition-transform duration-200 group-hover:-translate-y-[1px]",children:r}),t?s.jsx("span",{className:"text-[10px] font-bold text-zinc-400 dark:text-zinc-500 font-mono tabular-nums",children:t}):null]})}function qt({zoomConfig:e,period:r,from:t,to:a,timeZoneLabel:n,onClose:o,renderChart:i}){const{currency:l,rate:c}=Qe(),{formatTokensTooltip:f}=Ve(),d=g=>kt(g),y=v.useMemo(()=>qe({timeZone:e?.timeZone,offsetMinutes:e?.tzOffsetMinutes,date:e?.now||new Date})||a||t||null,[e?.timeZone,e?.tzOffsetMinutes,e?.now,a,t]),[u,x]=v.useState(()=>He(r)),[m,k]=v.useState(y),[h,_]=v.useState(()=>Ie(He(r),y)),[C,M]=v.useState(!1),[D,j]=v.useState(!1),[P,R]=v.useState(!1),w=v.useRef(!1),F=y,W=g=>{x(g),g!=="day"&&_(Ie(g,y))},U=v.useMemo(()=>u==="day"?{from:m,to:m,months:void 0}:u==="total"?{from:void 0,to:h.to,months:Xt(h.from,h.to)}:{from:h.from,to:h.to,months:void 0},[u,m,h]),{rows:z,from:L,to:ae,loading:H}=St({...e,period:u,from:U.from,to:U.to,months:U.months}),$=v.useMemo(()=>Lt(z),[z]),q=v.useCallback(()=>{w.current||(w.current=!0,o())},[o]),Y=v.useCallback(()=>R(!0),[]),re=g=>{g.target===g.currentTarget&&P&&q()};if(v.useEffect(()=>{if(!P)return;const g=window.setTimeout(q,250);return()=>window.clearTimeout(g)},[q,P]),v.useEffect(()=>{const g=I=>{I.key==="Escape"&&Y()};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[Y]),typeof document>"u")return null;const Z=u==="day"&&!!m,Q=u==="day"&&!!m&&(!F||m<F),te=$.totalCostUsd!=null?Je($.totalCostUsd,{currency:l,rate:c}):null;return s.jsxs("div",{onAnimationEnd:re,onClick:g=>{g.target===g.currentTarget&&Y()},className:V("fixed inset-0 z-50 flex items-center justify-center p-3 md:p-6 backdrop-blur-md bg-black/15 dark:bg-black/40",P?"animate-tt-fade-out":"animate-tt-fade-in"),children:[s.jsx("style",{children:`
2
2
  @keyframes tt-fade-in { from { opacity: 0; } to { opacity: 1; } }
3
3
  @keyframes tt-fade-out { from { opacity: 1; } to { opacity: 0; } }
4
4
  @keyframes tt-modal-entrance {
@@ -1 +1 @@
1
- import{j as e,c as a,I as R,am as E,r as b,t as $,V as O,y as W}from"./__vite-browser-external-BkNP5Ecj.js";import{S as F}from"./Select-BbooQ3sa.js";import{u as K}from"./use-native-settings-CWjXyJXi.js";import{T as D}from"./Controls-ClZjOBoD.js";import{F as N,S as G,a as z}from"./FadeIn-C7SIILTc.js";import{A as H}from"./arrow-up-right-yTM9azz_.js";import{D as U}from"./download-C9ixNyzn.js";import"./chevron-down-DdyEzQ4f.js";import"./check-Dk7tknvE.js";import"./SelectItemText-DBiW70wi.js";import"./composite-DEqP00XV.js";import"./usePositioner-B0L5_o38.js";import"./Card-DWdL7d1T.js";import"./react-D4CR_fLQ.js";import"./use-reduced-motion-CwFguzkm.js";const V=["todayTokens","todayCost"],x="none",T=[{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 S(t,i=T,r=2){const s=new Set(i.map(n=>n.id)),o=new Set,l=Array.isArray(t)?t.filter(n=>n===x?!0:!s.has(n)||o.has(n)?!1:(o.add(n),!0)):[];return(l.length>0?l:V).slice(0,Math.max(1,Number(r)||2))}const X=264,Y=124,g="ui-rounded, -apple-system, system-ui",C=["#5A8CF2","#9973E6","#4DB8A6","#E68C59"],Z={claude:"#C77DFF",codex:"#34C759",cursor:"#FFCC00",gemini:"#0A84FF"};function q(t){return t>=.9?"#E64D4D":t>=.7?"#D9A633":"#33B866"}function y({size:t="sm",children:i}){const r=t==="lg",s=r?560:264,o=r?32:22;return e.jsx("div",{className:W("flex w-full items-center justify-center rounded-xl bg-oai-gray-100 dark:bg-oai-gray-950/60",r?"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:`${X} / ${Y}`,borderRadius:o},children:i})})}function J({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",r=`${i} L264,124 L0,124 Z`,s=`sparkArea-${t}`;return e.jsx(y,{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:r,fill:`url(#${s})`,stroke:"none"}),e.jsx("path",{d:i,fill:"none",stroke:"#0A84FF",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})})}const _=(()=>{const r=[];for(let s=0;s<26;s++)for(let o=0;o<7;o++){const l=Math.sin((s+1)*12.9898+(o+1)*78.233+17)*43758.5453,c=Math.floor(Math.abs(l-Math.floor(l))*100);r.push({w:s,d:o,v:c})}return r})();function A(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 Q(){return e.jsx(y,{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:_.map(l=>e.jsx("rect",{x:l.w*(7.5+1.2),y:l.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:A(l.v,!0)},`d-${l.w}-${l.d}`))}),e.jsx("g",{transform:`translate(${19.5}, 10)`,className:"dark:hidden",children:_.map(l=>e.jsx("rect",{x:l.w*(7.5+1.2),y:l.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:A(l.v,!1)},`l-${l.w}-${l.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 ee(){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,r=28,s=14,o=236;return e.jsx(y,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((l,c)=>{const n=r+c*i,u=C[c%C.length];return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:u}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:l.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:l.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:[l.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*(l.pct/100),4),height:"2.8",rx:"1.4",fill:u})]},l.name)})})})}function te(){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,r=28,s=14,o=236;return e.jsx(y,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((l,c)=>{const n=r+c*i,u=Z[l.source],p=q(l.pct/100);return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:u}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:l.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:l.reset}),e.jsxs("text",{x:"250",y:n,textAnchor:"end",className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"700",fontFamily:g,children:[l.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*(l.pct/100),4),height:"2.8",rx:"1.4",fill:p})]},l.label)})})})}function ae(t){switch(t.category){case"none":return"";case"cost":return"$8.42";case"limits":return"62%";default:return t.id==="last7dTokens"?"1.8B":"203M"}}function ie(t,i){switch(t){case x:return a("menubar.metric.none");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 se(t,i){const r=new Set(i.map(o=>o.id)),s=t.filter(o=>o===x||r.has(o));for(const o of i){if(s.length>=2)break;o.id!==x&&(s.includes(o.id)||s.push(o.id))}return s.slice(0,2)}function re({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.filter(({item:r})=>r?.category!=="none").map(({slot:r,item:s},o)=>e.jsxs(O.Fragment,{children:[o>0?e.jsx("span",{className:"my-1 w-px bg-white/20","aria-hidden":"true"}):null,e.jsxs("div",{className:W("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")})]})]},r)):null]})})}function le({slot:t,value:i,options:r,disabled:s,onChange:o}){const l=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:l}),e.jsx(F,{value:i,disabled:s,ariaLabel:l,onValueChange:c=>o(t,c),options:r.map(c=>({value:c.id,label:c.displayLabel})),matchTriggerWidth:!0,className:"w-full px-3 py-2 text-sm font-medium"})]})}function w({label:t,hint:i,checked:r,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(D,{checked:r,disabled:s,onChange:o,ariaLabel:t})]})}function oe({label:t,hint:i,value:r,options:s,disabled:o,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(F,{value:r,disabled:o,ariaLabel:t,onValueChange:l,options:s,className:"shrink-0 px-3 py-2 text-sm font-medium"})]})}function ne(){const{available:t,settings:i,setSetting:r}=K(),s=b.useMemo(()=>(Array.isArray(i?.menuBarAvailableItems)?i.menuBarAvailableItems:T).map(m=>({...m,displayLabel:ie(m.id,m.label),previewValue:ae(m)})),[i?.menuBarAvailableItems]),o=Number(i?.menuBarMaxItems)||2,l=b.useMemo(()=>S(i?.menuBarItems,s,o),[s,o,i?.menuBarItems]),c=b.useMemo(()=>se(l,s),[s,l]),n=i?.showStats!==!1,u=d=>{r("menuBarItems",S(d,s,o))},p=(d,m)=>{const h=[...c];m!==x&&h[d===0?1:0]===m||(h[d]=m,u(h))},k=[0,1].map(d=>{const m=c[d]||s[d]?.id||"",L=c[d===0?1:0],I=s.filter(f=>f.id===x||f.id===m||f.id!==L),P=s.find(f=>f.id===m);return{slot:d,currentValue:m,options:I,item:P}}),B=["clawd","bot","cat","pet","static"].includes(i?.menuBarIconStyle)?i.menuBarIconStyle:"clawd",j=i?.toastOnReset!==!1,v=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(re,{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:h})=>e.jsx(le,{slot:d,value:m,options:h,disabled:!t||!n,onChange:p},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(w,{label:a("settings.menubar.showStats"),hint:t?a("settings.menubar.showStatsHint"):a("menubar.native_only"),checked:n,disabled:!t,onChange:()=>r("showStats",!n)}),e.jsx(oe,{label:a("settings.menubar.iconStyle"),hint:a("settings.menubar.iconStyleHint"),value:B,disabled:!t,options:[{value:"clawd",label:a("settings.menubar.iconStyle.clawd")},{value:"bot",label:a("settings.menubar.iconStyle.bot")},{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=>r("menuBarIconStyle",d)}),e.jsx(w,{label:a("settings.menubar.toastOnReset"),hint:a("settings.menubar.toastOnResetHint"),checked:j,disabled:!t,onChange:()=>r("toastOnReset",!j)}),e.jsx(w,{label:a("settings.menubar.confettiOnReset"),hint:a("settings.menubar.confettiOnResetHint"),checked:v,disabled:!t,onChange:()=>r("confettiOnReset",!v)})]})]})}function ce(){const[t,i]=b.useState("loading");return b.useEffect(()=>{if(typeof window>"u")return;if($()){i("native");return}const r=(navigator.userAgent||"").toLowerCase(),s=/mac/.test(r)&&!/iphone|ipad/.test(r);i(s?"mac-web":"other")},[]),t}function de(){const t=ce();return t==="loading"?e.jsx("div",{className:"h-10 w-40","aria-hidden":"true"}):t==="native"?e.jsxs("button",{type:"button",onClick:()=>R("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(H,{className:"h-4 w-4","aria-hidden":"true"})]}):t==="mac-web"?e.jsxs("a",{href:"https://github.com/xiufengsun/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(U,{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(E,{className:"h-4 w-4","aria-hidden":"true"}),a("widgets.cta.macos_only")]})}const me=[{id:"summary",Preview:J,nameKey:"widgets.summary.name",descKey:"widgets.summary.description"},{id:"heatmap",Preview:Q,nameKey:"widgets.heatmap.name",descKey:"widgets.heatmap.description"},{id:"topModels",Preview:ee,nameKey:"widgets.topModels.name",descKey:"widgets.topModels.description"},{id:"limits",Preview:te,nameKey:"widgets.limits.name",descKey:"widgets.limits.description"}];function ge({Preview:t,nameKey:i,descKey:r}){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(r)})]})]})}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:a(t)})}function Ae(){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(N,{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(de,{})})]})}),e.jsx(N,{y:12,delay:.06,children:e.jsxs("section",{"aria-label":a("widgets.menubar.section.title"),className:"mb-12 sm:mb-14",children:[e.jsx(M,{titleKey:"widgets.menubar.section.title"}),e.jsx(ne,{})]})}),e.jsxs("section",{"aria-label":a("widgets.gallery.section.title"),children:[e.jsx(M,{titleKey:"widgets.gallery.section.title"}),e.jsx(G,{staggerDelay:.08,initialDelay:.04,children:e.jsx("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2 lg:gap-5",children:me.map(({id:t,Preview:i,nameKey:r,descKey:s})=>e.jsx(z,{children:e.jsx(ge,{Preview:i,nameKey:r,descKey:s})},t))})})]})]})})})}export{Ae as WidgetsPage};
1
+ import{j as e,c as a,I as R,am as E,r as b,t as $,V as O,y as W}from"./__vite-browser-external-BtJVmciH.js";import{S as F}from"./Select-pZDawyxt.js";import{u as K}from"./use-native-settings-MZJhS328.js";import{T as D}from"./Controls-BEAj_kvr.js";import{F as N,S as G,a as z}from"./FadeIn-9ph1h_AG.js";import{A as H}from"./arrow-up-right-B_b2i8hn.js";import{D as U}from"./download-CQvg59w1.js";import"./chevron-down-mjUspqZv.js";import"./check-BlBHefQ7.js";import"./SelectItemText-D5wuuN7G.js";import"./composite-CzXFY9IC.js";import"./usePositioner-dWENyY8z.js";import"./Card-LJX3G3zo.js";import"./react-BgpqhoCj.js";import"./use-reduced-motion-CfCY-K-a.js";const V=["todayTokens","todayCost"],x="none",T=[{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 S(t,i=T,r=2){const s=new Set(i.map(n=>n.id)),o=new Set,l=Array.isArray(t)?t.filter(n=>n===x?!0:!s.has(n)||o.has(n)?!1:(o.add(n),!0)):[];return(l.length>0?l:V).slice(0,Math.max(1,Number(r)||2))}const X=264,Y=124,g="ui-rounded, -apple-system, system-ui",C=["#5A8CF2","#9973E6","#4DB8A6","#E68C59"],Z={claude:"#C77DFF",codex:"#34C759",cursor:"#FFCC00",gemini:"#0A84FF"};function q(t){return t>=.9?"#E64D4D":t>=.7?"#D9A633":"#33B866"}function y({size:t="sm",children:i}){const r=t==="lg",s=r?560:264,o=r?32:22;return e.jsx("div",{className:W("flex w-full items-center justify-center rounded-xl bg-oai-gray-100 dark:bg-oai-gray-950/60",r?"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:`${X} / ${Y}`,borderRadius:o},children:i})})}function J({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",r=`${i} L264,124 L0,124 Z`,s=`sparkArea-${t}`;return e.jsx(y,{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:r,fill:`url(#${s})`,stroke:"none"}),e.jsx("path",{d:i,fill:"none",stroke:"#0A84FF",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})})}const _=(()=>{const r=[];for(let s=0;s<26;s++)for(let o=0;o<7;o++){const l=Math.sin((s+1)*12.9898+(o+1)*78.233+17)*43758.5453,c=Math.floor(Math.abs(l-Math.floor(l))*100);r.push({w:s,d:o,v:c})}return r})();function A(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 Q(){return e.jsx(y,{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:_.map(l=>e.jsx("rect",{x:l.w*(7.5+1.2),y:l.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:A(l.v,!0)},`d-${l.w}-${l.d}`))}),e.jsx("g",{transform:`translate(${19.5}, 10)`,className:"dark:hidden",children:_.map(l=>e.jsx("rect",{x:l.w*(7.5+1.2),y:l.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:A(l.v,!1)},`l-${l.w}-${l.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 ee(){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,r=28,s=14,o=236;return e.jsx(y,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((l,c)=>{const n=r+c*i,u=C[c%C.length];return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:u}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:l.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:l.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:[l.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*(l.pct/100),4),height:"2.8",rx:"1.4",fill:u})]},l.name)})})})}function te(){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,r=28,s=14,o=236;return e.jsx(y,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((l,c)=>{const n=r+c*i,u=Z[l.source],p=q(l.pct/100);return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:u}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:l.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:l.reset}),e.jsxs("text",{x:"250",y:n,textAnchor:"end",className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"700",fontFamily:g,children:[l.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*(l.pct/100),4),height:"2.8",rx:"1.4",fill:p})]},l.label)})})})}function ae(t){switch(t.category){case"none":return"";case"cost":return"$8.42";case"limits":return"62%";default:return t.id==="last7dTokens"?"1.8B":"203M"}}function ie(t,i){switch(t){case x:return a("menubar.metric.none");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 se(t,i){const r=new Set(i.map(o=>o.id)),s=t.filter(o=>o===x||r.has(o));for(const o of i){if(s.length>=2)break;o.id!==x&&(s.includes(o.id)||s.push(o.id))}return s.slice(0,2)}function re({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.filter(({item:r})=>r?.category!=="none").map(({slot:r,item:s},o)=>e.jsxs(O.Fragment,{children:[o>0?e.jsx("span",{className:"my-1 w-px bg-white/20","aria-hidden":"true"}):null,e.jsxs("div",{className:W("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")})]})]},r)):null]})})}function le({slot:t,value:i,options:r,disabled:s,onChange:o}){const l=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:l}),e.jsx(F,{value:i,disabled:s,ariaLabel:l,onValueChange:c=>o(t,c),options:r.map(c=>({value:c.id,label:c.displayLabel})),matchTriggerWidth:!0,className:"w-full px-3 py-2 text-sm font-medium"})]})}function w({label:t,hint:i,checked:r,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(D,{checked:r,disabled:s,onChange:o,ariaLabel:t})]})}function oe({label:t,hint:i,value:r,options:s,disabled:o,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(F,{value:r,disabled:o,ariaLabel:t,onValueChange:l,options:s,className:"shrink-0 px-3 py-2 text-sm font-medium"})]})}function ne(){const{available:t,settings:i,setSetting:r}=K(),s=b.useMemo(()=>(Array.isArray(i?.menuBarAvailableItems)?i.menuBarAvailableItems:T).map(m=>({...m,displayLabel:ie(m.id,m.label),previewValue:ae(m)})),[i?.menuBarAvailableItems]),o=Number(i?.menuBarMaxItems)||2,l=b.useMemo(()=>S(i?.menuBarItems,s,o),[s,o,i?.menuBarItems]),c=b.useMemo(()=>se(l,s),[s,l]),n=i?.showStats!==!1,u=d=>{r("menuBarItems",S(d,s,o))},p=(d,m)=>{const h=[...c];m!==x&&h[d===0?1:0]===m||(h[d]=m,u(h))},k=[0,1].map(d=>{const m=c[d]||s[d]?.id||"",L=c[d===0?1:0],I=s.filter(f=>f.id===x||f.id===m||f.id!==L),P=s.find(f=>f.id===m);return{slot:d,currentValue:m,options:I,item:P}}),B=["clawd","bot","cat","pet","static"].includes(i?.menuBarIconStyle)?i.menuBarIconStyle:"clawd",j=i?.toastOnReset!==!1,v=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(re,{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:h})=>e.jsx(le,{slot:d,value:m,options:h,disabled:!t||!n,onChange:p},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(w,{label:a("settings.menubar.showStats"),hint:t?a("settings.menubar.showStatsHint"):a("menubar.native_only"),checked:n,disabled:!t,onChange:()=>r("showStats",!n)}),e.jsx(oe,{label:a("settings.menubar.iconStyle"),hint:a("settings.menubar.iconStyleHint"),value:B,disabled:!t,options:[{value:"clawd",label:a("settings.menubar.iconStyle.clawd")},{value:"bot",label:a("settings.menubar.iconStyle.bot")},{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=>r("menuBarIconStyle",d)}),e.jsx(w,{label:a("settings.menubar.toastOnReset"),hint:a("settings.menubar.toastOnResetHint"),checked:j,disabled:!t,onChange:()=>r("toastOnReset",!j)}),e.jsx(w,{label:a("settings.menubar.confettiOnReset"),hint:a("settings.menubar.confettiOnResetHint"),checked:v,disabled:!t,onChange:()=>r("confettiOnReset",!v)})]})]})}function ce(){const[t,i]=b.useState("loading");return b.useEffect(()=>{if(typeof window>"u")return;if($()){i("native");return}const r=(navigator.userAgent||"").toLowerCase(),s=/mac/.test(r)&&!/iphone|ipad/.test(r);i(s?"mac-web":"other")},[]),t}function de(){const t=ce();return t==="loading"?e.jsx("div",{className:"h-10 w-40","aria-hidden":"true"}):t==="native"?e.jsxs("button",{type:"button",onClick:()=>R("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(H,{className:"h-4 w-4","aria-hidden":"true"})]}):t==="mac-web"?e.jsxs("a",{href:"https://github.com/xiufengsun/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(U,{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(E,{className:"h-4 w-4","aria-hidden":"true"}),a("widgets.cta.macos_only")]})}const me=[{id:"summary",Preview:J,nameKey:"widgets.summary.name",descKey:"widgets.summary.description"},{id:"heatmap",Preview:Q,nameKey:"widgets.heatmap.name",descKey:"widgets.heatmap.description"},{id:"topModels",Preview:ee,nameKey:"widgets.topModels.name",descKey:"widgets.topModels.description"},{id:"limits",Preview:te,nameKey:"widgets.limits.name",descKey:"widgets.limits.description"}];function ge({Preview:t,nameKey:i,descKey:r}){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(r)})]})]})}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:a(t)})}function Ae(){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(N,{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(de,{})})]})}),e.jsx(N,{y:12,delay:.06,children:e.jsxs("section",{"aria-label":a("widgets.menubar.section.title"),className:"mb-12 sm:mb-14",children:[e.jsx(M,{titleKey:"widgets.menubar.section.title"}),e.jsx(ne,{})]})}),e.jsxs("section",{"aria-label":a("widgets.gallery.section.title"),children:[e.jsx(M,{titleKey:"widgets.gallery.section.title"}),e.jsx(G,{staggerDelay:.08,initialDelay:.04,children:e.jsx("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2 lg:gap-5",children:me.map(({id:t,Preview:i,nameKey:r,descKey:s})=>e.jsx(z,{children:e.jsx(ge,{Preview:i,nameKey:r,descKey:s})},t))})})]})]})})})}export{Ae as WidgetsPage};
@@ -1 +1 @@
1
- import{r as x,j as e,c as s,h as j,i as f}from"./__vite-browser-external-BkNP5Ecj.js";function c(a){return Number.isFinite(a)?Math.abs(a)>=1e12?(a/1e12).toFixed(2).replace(/\.?0+$/,"")+"T":f(a,{decimals:2}):"0"}function o({children:a,accent:d=!1,className:n=""}){const l="rounded-2xl border border-oai-gray-200 dark:border-oai-gray-800 p-6 bg-white dark:bg-oai-gray-900",p=d?"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:`${l} ${p} ${n}`,children:a})}function N(){const[a,d]=x.useState(null),[n,l]=x.useState("loading"),[p,y]=x.useState("");if(x.useEffect(()=>{let t=!1;const g=new URLSearchParams(window.location.search).get("year"),k=g?`/functions/tokentracker-wrapped?year=${encodeURIComponent(g)}`:"/functions/tokentracker-wrapped";return fetch(k).then(async r=>{if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.json()}).then(r=>{t||(d(r),l(r.totals&&r.totals.tokens>0?"ready":"empty"))}).catch(r=>{t||(y(String(r?.message||r)),l("error"))}),()=>{t=!0}},[]),n==="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:s("wrapped.loading")})});if(n==="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(o,{children:e.jsx("p",{className:"text-red-600 dark:text-red-300",children:s("wrapped.error",{error:p})})})});if(n==="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(o,{children:e.jsx("p",{className:"text-oai-gray-500",children:s("wrapped.empty",{command:"tracker sync"})})})});const m=t=>`${(t*100).toFixed(0)}%`,u=j(),i=[];if(a.top.models.length>0){const t=a.top.models[0];i.push(s("wrapped.highlight.model",{model:t.model,percent:(t.share*100).toFixed(0)}))}if(a.top.days.length>0){const t=a.top.days[0];i.push(s("wrapped.highlight.day",{day:t.day,tokens:c(t.tokens)}))}return a.peak_hour&&i.push(s("wrapped.highlight.hour",{hour:String(a.peak_hour.hour).padStart(2,"0")})),a.longest_streak?.days>=2&&i.push(s("wrapped.highlight.streak",{days:a.longest_streak.days})),a.totals.sources>=4&&i.push(s("wrapped.highlight.tools",{count:a.totals.sources})),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:s("wrapped.kicker")}),e.jsx("h1",{className:"text-6xl font-bold text-oai-gray-900 dark:text-white mt-2",children:a.year})]}),e.jsxs(o,{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:s("wrapped.total_tokens")}),e.jsx("p",{className:"text-7xl font-bold text-emerald-700 dark:text-emerald-300 mt-2",children:c(a.totals.tokens)}),e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400 mt-4",children:s("wrapped.summary",{conversations:a.totals.conversations.toLocaleString(u),days:a.totals.active_days,tools:a.totals.sources})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs(o,{children:[e.jsx("h3",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400 mb-4",children:s("wrapped.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:[c(t.tokens)," · ",m(t.share)]})]},t.source))})]}),e.jsxs(o,{children:[e.jsx("h3",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400 mb-4",children:s("wrapped.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:[c(t.tokens)," · ",m(t.share)]})]},t.model))})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.peak_hour&&e.jsxs(o,{children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400",children:s("wrapped.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.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400 mt-1",children:s("wrapped.tokens",{count:c(a.peak_hour.tokens)})})]}),a.longest_streak&&a.longest_streak.days>0&&e.jsxs(o,{children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400",children:s("wrapped.longest_streak")}),e.jsx("p",{className:"text-4xl font-semibold text-oai-gray-900 dark:text-white mt-2",children:s("wrapped.days",{count:a.longest_streak.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(o,{children:[e.jsx("h3",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400 mb-4",children:s("wrapped.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:c(t.tokens)})]},t.day))})]}),i.length>0&&e.jsxs(o,{accent:!0,children:[e.jsx("h3",{className:"text-xs uppercase tracking-widest text-oai-gray-600 dark:text-oai-gray-300 mb-3",children:s("wrapped.highlights")}),e.jsx("ul",{className:"space-y-2 text-oai-gray-800 dark:text-oai-gray-200",children:i.map((t,h)=>e.jsxs("li",{className:"text-base",children:["· ",t]},h))})]}),e.jsx("footer",{className:"text-center text-xs text-oai-gray-400 dark:text-oai-gray-500 pt-6",children:s("wrapped.footer",{command:"tracker wrapped --json"})})]})})}export{N as default};
1
+ import{r as x,j as e,c as s,h as j,i as f}from"./__vite-browser-external-BtJVmciH.js";function c(a){return Number.isFinite(a)?Math.abs(a)>=1e12?(a/1e12).toFixed(2).replace(/\.?0+$/,"")+"T":f(a,{decimals:2}):"0"}function o({children:a,accent:d=!1,className:n=""}){const l="rounded-2xl border border-oai-gray-200 dark:border-oai-gray-800 p-6 bg-white dark:bg-oai-gray-900",p=d?"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:`${l} ${p} ${n}`,children:a})}function N(){const[a,d]=x.useState(null),[n,l]=x.useState("loading"),[p,y]=x.useState("");if(x.useEffect(()=>{let t=!1;const g=new URLSearchParams(window.location.search).get("year"),k=g?`/functions/tokentracker-wrapped?year=${encodeURIComponent(g)}`:"/functions/tokentracker-wrapped";return fetch(k).then(async r=>{if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.json()}).then(r=>{t||(d(r),l(r.totals&&r.totals.tokens>0?"ready":"empty"))}).catch(r=>{t||(y(String(r?.message||r)),l("error"))}),()=>{t=!0}},[]),n==="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:s("wrapped.loading")})});if(n==="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(o,{children:e.jsx("p",{className:"text-red-600 dark:text-red-300",children:s("wrapped.error",{error:p})})})});if(n==="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(o,{children:e.jsx("p",{className:"text-oai-gray-500",children:s("wrapped.empty",{command:"tracker sync"})})})});const m=t=>`${(t*100).toFixed(0)}%`,u=j(),i=[];if(a.top.models.length>0){const t=a.top.models[0];i.push(s("wrapped.highlight.model",{model:t.model,percent:(t.share*100).toFixed(0)}))}if(a.top.days.length>0){const t=a.top.days[0];i.push(s("wrapped.highlight.day",{day:t.day,tokens:c(t.tokens)}))}return a.peak_hour&&i.push(s("wrapped.highlight.hour",{hour:String(a.peak_hour.hour).padStart(2,"0")})),a.longest_streak?.days>=2&&i.push(s("wrapped.highlight.streak",{days:a.longest_streak.days})),a.totals.sources>=4&&i.push(s("wrapped.highlight.tools",{count:a.totals.sources})),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:s("wrapped.kicker")}),e.jsx("h1",{className:"text-6xl font-bold text-oai-gray-900 dark:text-white mt-2",children:a.year})]}),e.jsxs(o,{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:s("wrapped.total_tokens")}),e.jsx("p",{className:"text-7xl font-bold text-emerald-700 dark:text-emerald-300 mt-2",children:c(a.totals.tokens)}),e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400 mt-4",children:s("wrapped.summary",{conversations:a.totals.conversations.toLocaleString(u),days:a.totals.active_days,tools:a.totals.sources})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs(o,{children:[e.jsx("h3",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400 mb-4",children:s("wrapped.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:[c(t.tokens)," · ",m(t.share)]})]},t.source))})]}),e.jsxs(o,{children:[e.jsx("h3",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400 mb-4",children:s("wrapped.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:[c(t.tokens)," · ",m(t.share)]})]},t.model))})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.peak_hour&&e.jsxs(o,{children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400",children:s("wrapped.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.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400 mt-1",children:s("wrapped.tokens",{count:c(a.peak_hour.tokens)})})]}),a.longest_streak&&a.longest_streak.days>0&&e.jsxs(o,{children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400",children:s("wrapped.longest_streak")}),e.jsx("p",{className:"text-4xl font-semibold text-oai-gray-900 dark:text-white mt-2",children:s("wrapped.days",{count:a.longest_streak.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(o,{children:[e.jsx("h3",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400 mb-4",children:s("wrapped.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:c(t.tokens)})]},t.day))})]}),i.length>0&&e.jsxs(o,{accent:!0,children:[e.jsx("h3",{className:"text-xs uppercase tracking-widest text-oai-gray-600 dark:text-oai-gray-300 mb-3",children:s("wrapped.highlights")}),e.jsx("ul",{className:"space-y-2 text-oai-gray-800 dark:text-oai-gray-200",children:i.map((t,h)=>e.jsxs("li",{className:"text-base",children:["· ",t]},h))})]}),e.jsx("footer",{className:"text-center text-xs text-oai-gray-400 dark:text-oai-gray-500 pt-6",children:s("wrapped.footer",{command:"tracker wrapped --json"})})]})})}export{N as default};