tokentracker-cli 0.50.2 → 0.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dashboard/dist/assets/{ActivityHeatmap-BcnEI5Ct.js → ActivityHeatmap-BTHC4IUr.js} +1 -1
  2. package/dashboard/dist/assets/{Card-H6LsQDVa.js → Card-Cj0FwI4N.js} +1 -1
  3. package/dashboard/dist/assets/{DashboardPage-DNrFVaAv.js → DashboardPage-m5XShubD.js} +1 -1
  4. package/dashboard/dist/assets/{DevicePage-BoK6T_cF.js → DevicePage-CQUuRcnF.js} +1 -1
  5. package/dashboard/dist/assets/{DialogTitle-DhUeaBTV.js → DialogTitle-Da70g3B4.js} +1 -1
  6. package/dashboard/dist/assets/{FadeIn-CJOCXqQn.js → FadeIn-DBQT1nSH.js} +1 -1
  7. package/dashboard/dist/assets/{HeaderGithubStar-DqLMuUYQ.js → HeaderGithubStar-DBO7_c3m.js} +1 -1
  8. package/dashboard/dist/assets/{IpCheckPage-CGNHhErk.js → IpCheckPage-Chq55Tog.js} +1 -1
  9. package/dashboard/dist/assets/{LandingPage-D7TQOOkQ.js → LandingPage-yFuVcz9y.js} +1 -1
  10. package/dashboard/dist/assets/{LeaderboardAvatar-BNoc0dcY.js → LeaderboardAvatar-CjzcYpju.js} +1 -1
  11. package/dashboard/dist/assets/{LeaderboardPage-CM_KxUej.js → LeaderboardPage-DjiAwRea.js} +3 -3
  12. package/dashboard/dist/assets/{LeaderboardProfileModal-8Qp6wCjG.js → LeaderboardProfileModal-DlLFgoFU.js} +1 -1
  13. package/dashboard/dist/assets/{LeaderboardProfilePage-D72qwC4n.js → LeaderboardProfilePage-hd6cy7Iw.js} +1 -1
  14. package/dashboard/dist/assets/LimitsPage-BCvtqYjj.js +2 -0
  15. package/dashboard/dist/assets/{LocalOnlyNotice-CrApa6SR.js → LocalOnlyNotice-CEr0fjdW.js} +1 -1
  16. package/dashboard/dist/assets/{LoginPage-X-KQiaGk.js → LoginPage-CVkC4SeD.js} +1 -1
  17. package/dashboard/dist/assets/{PopoverPopup-DIYezdXE.js → PopoverPopup-Cyylx8_a.js} +1 -1
  18. package/dashboard/dist/assets/{ResetPasswordPage-BlNOEA29.js → ResetPasswordPage-aqTzLhlP.js} +1 -1
  19. package/dashboard/dist/assets/{Select-DpdVQLKY.js → Select-BvZg997I.js} +1 -1
  20. package/dashboard/dist/assets/{SelectItemText-BbIi_4at.js → SelectItemText-CFvmNsu6.js} +1 -1
  21. package/dashboard/dist/assets/{SettingsPage-iRXVq9Y6.js → SettingsPage-8bnyX8_2.js} +1 -1
  22. package/dashboard/dist/assets/{SkillsPage-D4SIEW9m.js → SkillsPage-BaSvupBX.js} +1 -1
  23. package/dashboard/dist/assets/WidgetsPage-_ylQ3MuQ.js +1 -0
  24. package/dashboard/dist/assets/{WrappedPage-cKp0An3Q.js → WrappedPage-BTwY6B_i.js} +1 -1
  25. package/dashboard/dist/assets/{agent-logos-D3ZXfswD.js → agent-logos-B3oZBY3c.js} +1 -1
  26. package/dashboard/dist/assets/{arrow-up-right-AaxaGzI0.js → arrow-up-right-TA6lNU5q.js} +1 -1
  27. package/dashboard/dist/assets/{download-C8lGIde6.js → download-zOlEh2Sz.js} +1 -1
  28. package/dashboard/dist/assets/{info-COj1pAlk.js → info-CFeNEvgT.js} +1 -1
  29. package/dashboard/dist/assets/{main-DabzSCdi.js → main-BWTATdTj.js} +10 -3
  30. package/dashboard/dist/assets/main-FbRB2jEx.css +1 -0
  31. package/dashboard/dist/assets/{use-limits-display-prefs-DQzHze6U.js → use-limits-display-prefs-CNTlQJqc.js} +1 -1
  32. package/dashboard/dist/assets/{use-native-settings-DR32FzgQ.js → use-native-settings-D9ahLphY.js} +1 -1
  33. package/dashboard/dist/assets/{use-usage-limits-D2-SO9r0.js → use-usage-limits-BU5H-HN1.js} +1 -1
  34. package/dashboard/dist/assets/{useCurrency-BkYIXXRi.js → useCurrency-pN-0qxLU.js} +1 -1
  35. package/dashboard/dist/assets/{useScrollLock-C71NmlhZ.js → useScrollLock-Mps8iGXL.js} +1 -1
  36. package/dashboard/dist/index.html +2 -2
  37. package/dashboard/dist/share.html +2 -2
  38. package/package.json +1 -1
  39. package/src/lib/local-api.js +76 -4
  40. package/src/lib/pricing/seed-snapshot.json +1 -1
  41. package/src/lib/rollout.js +80 -9
  42. package/src/lib/usage-limits.js +5 -1
  43. package/dashboard/dist/assets/LimitsPage-DJk9obPb.js +0 -2
  44. package/dashboard/dist/assets/WidgetsPage-wNuiAdKR.js +0 -1
  45. package/dashboard/dist/assets/main-B1lf1bLt.css +0 -1
@@ -7891,22 +7891,70 @@ function grokEventId(value, fallback) {
7891
7891
  return fallback;
7892
7892
  }
7893
7893
 
7894
- async function readGrokUpdateTokenEvents(updatesPath, fallbackTimestamp) {
7895
- if (!updatesPath) return { events: [], recordsProcessed: 0 };
7894
+ function grokFileEndsWithNewline(filePath, size) {
7895
+ if (!(size > 0)) return false;
7896
+ let fd;
7896
7897
  try {
7897
- const stat = fssync.statSync(updatesPath);
7898
- if (!stat.isFile()) return { events: [], recordsProcessed: 0 };
7898
+ fd = fssync.openSync(filePath, "r");
7899
+ const buf = Buffer.alloc(1);
7900
+ const read = fssync.readSync(fd, buf, 0, 1, size - 1);
7901
+ return read === 1 && buf[0] === 0x0a; // trailing "\n"
7899
7902
  } catch {
7900
- return { events: [], recordsProcessed: 0 };
7903
+ return false;
7904
+ } finally {
7905
+ if (fd !== undefined) {
7906
+ try {
7907
+ fssync.closeSync(fd);
7908
+ } catch {
7909
+ /* ignore close failure */
7910
+ }
7911
+ }
7901
7912
  }
7913
+ }
7914
+
7915
+ async function readGrokUpdateTokenEvents(updatesPath, fallbackTimestamp, prevOffsetEntry) {
7916
+ if (!updatesPath) return { events: [], offsetEntry: null };
7917
+ let stat;
7918
+ try {
7919
+ stat = fssync.statSync(updatesPath);
7920
+ if (!stat.isFile()) return { events: [], offsetEntry: null };
7921
+ } catch {
7922
+ return { events: [], offsetEntry: null };
7923
+ }
7924
+
7925
+ // updates.jsonl is append-only and carries cumulative totalTokens, deduped
7926
+ // by the session high-watermark, so resuming from the last consumed byte is
7927
+ // safe: re-read events stay below the watermark (no double count), and any
7928
+ // bytes a write race leaves unparsed are covered by the next event's
7929
+ // cumulative total. Re-read from 0 on truncation or inode change.
7930
+ const prevSize = Number(prevOffsetEntry?.size) || 0;
7931
+ const prevIno = prevOffsetEntry?.ino;
7932
+ const inodeChanged = typeof prevIno === "number" && prevIno !== stat.ino;
7933
+ const startOffset = stat.size < prevSize || inodeChanged ? 0 : prevSize;
7934
+ const baseOffset = { mtimeMs: stat.mtimeMs, ino: stat.ino };
7935
+ if (stat.size <= startOffset) {
7936
+ return { events: [], offsetEntry: { size: startOffset, ...baseOffset } };
7937
+ }
7938
+
7939
+ // Only advance the stored offset to the end of the last newline-terminated
7940
+ // line. If Grok is mid-write, the final JSONL line has no trailing "\n" yet;
7941
+ // its bytes are left unconsumed so the next scan re-reads the line once it is
7942
+ // complete instead of skipping it forever (which would undercount tokens).
7943
+ const endsWithNewline = grokFileEndsWithNewline(updatesPath, stat.size);
7902
7944
 
7903
7945
  const events = [];
7904
7946
  let lineIndex = 0;
7905
- const input = fssync.createReadStream(updatesPath, { encoding: "utf8" });
7947
+ let lastLine = "";
7948
+ const input = fssync.createReadStream(updatesPath, {
7949
+ encoding: "utf8",
7950
+ start: startOffset,
7951
+ end: stat.size - 1, // inclusive; bound the read to the stat'd size
7952
+ });
7906
7953
  const rl = readline.createInterface({ input, crlfDelay: Infinity });
7907
7954
  try {
7908
7955
  for await (const line of rl) {
7909
7956
  lineIndex++;
7957
+ lastLine = line;
7910
7958
  if (!line || !line.trim()) continue;
7911
7959
  let record;
7912
7960
  try {
@@ -7926,10 +7974,17 @@ async function readGrokUpdateTokenEvents(updatesPath, fallbackTimestamp) {
7926
7974
  });
7927
7975
  }
7928
7976
  } catch {
7929
- return { events, recordsProcessed: events.length };
7977
+ // Stream error mid-read: keep the events we got, but do not advance the
7978
+ // offset so the next sync retries the same range (watermark-safe).
7979
+ return { events, offsetEntry: prevOffsetEntry || null };
7930
7980
  }
7931
7981
 
7932
- return { events, recordsProcessed: events.length };
7982
+ // When the file does not end on a newline, the final emitted line is a
7983
+ // partial tail still being written. Exclude its bytes so the committed offset
7984
+ // stays on a complete-line boundary and the line is re-read once finished.
7985
+ const trailingPartialBytes = endsWithNewline ? 0 : Buffer.byteLength(lastLine, "utf8");
7986
+ const committedSize = Math.max(startOffset, stat.size - trailingPartialBytes);
7987
+ return { events, offsetEntry: { size: committedSize, ...baseOffset } };
7933
7988
  }
7934
7989
 
7935
7990
  function estimateGrokTokenDelta(totalTokens, conversationCount, options = {}) {
@@ -7962,6 +8017,13 @@ async function parseGrokBuildIncremental({
7962
8017
  const hourlyState = normalizeHourlyState(cursors?.hourly);
7963
8018
  const grokState = cursors.grok && typeof cursors.grok === "object" ? { ...cursors.grok } : {};
7964
8019
  let sessionSnapshots = normalizeGrokSessionSnapshots(grokState);
8020
+ const prevUpdateOffsets =
8021
+ grokState.updateOffsets && typeof grokState.updateOffsets === "object"
8022
+ ? grokState.updateOffsets
8023
+ : {};
8024
+ // Rebuilt from the sessions seen this scan, so entries for deleted session
8025
+ // dirs are pruned and the cursor stays bounded by the on-disk session count.
8026
+ const updateOffsets = {};
7965
8027
  const touchedBuckets = new Set();
7966
8028
 
7967
8029
  const sessionList = Array.isArray(sessions) && sessions.length > 0
@@ -8013,7 +8075,15 @@ async function parseGrokBuildIncremental({
8013
8075
  return true;
8014
8076
  };
8015
8077
 
8016
- const updates = await readGrokUpdateTokenEvents(grokUpdatesPathForSession(sess), lastActive);
8078
+ const updatesPath = grokUpdatesPathForSession(sess);
8079
+ const updates = await readGrokUpdateTokenEvents(
8080
+ updatesPath,
8081
+ lastActive,
8082
+ updatesPath ? prevUpdateOffsets[updatesPath] : null,
8083
+ );
8084
+ if (updatesPath && updates.offsetEntry) {
8085
+ updateOffsets[updatesPath] = updates.offsetEntry;
8086
+ }
8017
8087
  for (const event of updates.events) {
8018
8088
  observedTotal = Math.max(observedTotal, event.totalTokens);
8019
8089
  lastEventId = event.eventId || lastEventId;
@@ -8081,6 +8151,7 @@ async function parseGrokBuildIncremental({
8081
8151
  version: GROK_CURSOR_VERSION,
8082
8152
  sessionSnapshots,
8083
8153
  seenSessions: Object.keys(sessionSnapshots),
8154
+ updateOffsets,
8084
8155
  updatedAt: new Date().toISOString()
8085
8156
  };
8086
8157
 
@@ -2146,7 +2146,11 @@ async function fetchUsageLimitsUncached({
2146
2146
  claude: withPlanLabel(claude, claudePlanType, "Claude"),
2147
2147
  codex: withPlanLabel(codex, codex.plan_type, "Codex"),
2148
2148
  cursor: withPlanLabel(cursor, cursor.membership_type, "Cursor"),
2149
- kimi: withPlanLabel(kimi, kimi.subscription_type || kimi.membership_level, "Kimi"),
2149
+ // Kimi's subType (TYPE_PURCHASE/TYPE_EVENT) is the credit *source*, not a plan
2150
+ // tier, and membership.level is an opaque enum (LEVEL_INTERMEDIATE) with no
2151
+ // authoritative human-readable plan mapping. Both rendered as garbage like
2152
+ // "Kimi Type_event" (issue #130), so show the bare brand instead.
2153
+ kimi: withPlanLabel(kimi, null, "Kimi"),
2150
2154
  gemini: withPlanLabel(gemini, gemini.account_plan, "Gemini"),
2151
2155
  kiro: withPlanLabel(kiro, kiro.plan_name, "Kiro"),
2152
2156
  antigravity: withPlanLabel(antigravity, antigravity.account_plan, "Antigravity"),
@@ -1,2 +0,0 @@
1
- import{j as i,V as v,r as y,G as o,U as K,aG as R,i as M,L as T,aH as O}from"./main-DabzSCdi.js";import{u as C}from"./use-usage-limits-D2-SO9r0.js";import{L as c,a as A,l as h,b as D,u as F}from"./use-limits-display-prefs-DQzHze6U.js";import{C as N}from"./Card-H6LsQDVa.js";import{F as $}from"./FadeIn-CJOCXqQn.js";import{L as W}from"./LocalOnlyNotice-CrApa6SR.js";import"./arrow-up-right-AaxaGzI0.js";import"./download-C8lGIde6.js";const G=[3,2,3,3,2,2,3];function m({className:e}){return i.jsx("div",{className:v("rounded bg-oai-gray-200/70 dark:bg-oai-gray-800/70 animate-pulse",e)})}function H(){return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(m,{className:"h-3 w-12 shrink-0"}),i.jsx(m,{className:"flex-1 h-1.5 rounded-full min-w-0"}),i.jsx(m,{className:"h-3 w-[30px] shrink-0"}),i.jsx(m,{className:"h-3 w-6 shrink-0"})]})}function B({bars:e,index:t}){const r=t%3===0?"w-24":t%3===1?"w-20":"w-[4.5rem]";return i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(m,{className:"h-[14px] w-[14px] rounded shrink-0"}),i.jsx(m,{className:v("h-4",r)})]}),Array.from({length:e},(a,l)=>i.jsx(H,{},l))]})}function z(){return i.jsx(N,{children:i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsx(m,{className:"h-3.5 w-28"}),G.map((e,t)=>i.jsx(B,{bars:e,index:t},t))]})})}const L={claude:{windows(e){return[{key:"5h",labelKey:"limits.label.claude_5h",window:e.five_hour,pctField:"utilization",resetField:"resets_at"},{key:"7d",labelKey:"limits.label.claude_7d",window:e.seven_day,pctField:"utilization",resetField:"resets_at"},{key:"opus",labelKey:"limits.label.claude_opus",window:e.seven_day_opus,pctField:"utilization",resetField:"resets_at"}]}},codex:{windows(e){return[{key:"5h",labelKey:"limits.label.codex_5h",window:e.primary_window},{key:"7d",labelKey:"limits.label.codex_7d",window:e.secondary_window},{key:"spark-5h",labelKey:"limits.label.codex_spark_5h",window:e.spark_primary_window},{key:"spark-7d",labelKey:"limits.label.codex_spark_7d",window:e.spark_secondary_window}]}},cursor:{windows(e){return[{key:"plan",labelKey:"limits.label.cursor_plan",window:e.primary_window},{key:"auto",labelKey:"limits.label.cursor_auto",window:e.secondary_window},{key:"api",labelKey:"limits.label.cursor_api",window:e.tertiary_window}]}},gemini:{windows(e){return[{key:"pro",labelKey:"limits.label.gemini_pro",window:e.primary_window},{key:"flash",labelKey:"limits.label.gemini_flash",window:e.secondary_window},{key:"lite",labelKey:"limits.label.gemini_lite",window:e.tertiary_window}]}},kimi:{extra:"kimi_parallel",windows(e){return[{key:"weekly",labelKey:"limits.label.kimi_weekly",window:e.primary_window},{key:"5h",labelKey:"limits.label.kimi_5h",window:e.secondary_window},{key:"total",labelKey:"limits.label.kimi_total",window:e.tertiary_window}]}},kiro:{windows(e){return[{key:"month",labelKey:"limits.label.kiro_month",window:e.primary_window},{key:"bonus",labelKey:"limits.label.kiro_bonus",window:e.secondary_window}]}},grok:{windows(e){return[{key:"month",labelKey:"limits.label.grok_month",window:e.primary_window},{key:"ondemand",labelKey:"limits.label.grok_ondemand",window:e.secondary_window}]}},antigravity:{windows(e){return[{key:"claude",labelKey:"limits.label.antigravity_claude",window:e.primary_window},{key:"gpro",labelKey:"limits.label.antigravity_gpro",window:e.secondary_window},{key:"flash",labelKey:"limits.label.antigravity_flash",window:e.tertiary_window}]}},copilot:{extra:"copilot_otel",windows(e){return[{key:"premium",labelKey:"limits.label.copilot_premium",window:e.primary_window},{key:"chat",labelKey:"limits.label.copilot_chat",window:e.secondary_window}]}}},U="shrink-0 text-oai-black dark:text-oai-white";function V(e){if(!e)return null;const t=typeof e=="number"?e*1e3:Date.parse(e);if(!Number.isFinite(t))return null;const r=t-Date.now();if(r<=0)return o("shared.time.now");const a=Math.floor(r/6e4);if(a<60)return`${a}m`;const l=Math.floor(a/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`}function Y(e,t){const r=t===c.REMAINING?100-e:e;return r>=90?"bg-red-500":r>=70?"bg-amber-500":"bg-emerald-500"}function X({label:e,pct:t,reset:r,mode:a=c.USED}){const l=Math.max(0,Math.min(100,Number(t)||0)),n=a===c.REMAINING?100-l:l,d=Math.round(n),u=n>0&&d===0?Math.max(n,.35):n;let s=String(d);return n>0&&d===0&&(s=o("limits.bar.sub_one_percent")),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{"data-limit-label":"",className:"text-[11px] text-oai-gray-500 dark:text-oai-gray-400 shrink-0 whitespace-nowrap",style:{width:"var(--tt-limits-label-w)"},children:e}),i.jsx("div",{className:"flex-1 bg-oai-gray-100 dark:bg-oai-gray-700/50 rounded-full h-1.5 overflow-hidden",children:i.jsx("div",{className:`${Y(n,a)} rounded-full h-full transition-[width] duration-500 ease-out`,style:{width:`${u}%`,minWidth:n>0?"3px":0}})}),i.jsxs("span",{className:"text-[11px] tabular-nums text-oai-gray-500 dark:text-oai-gray-400 w-9 text-right shrink-0 whitespace-nowrap",children:[s,"%"]}),r&&i.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-500 w-6 text-right shrink-0",children:r})]})}function f({name:e,providerId:t,children:r}){const a=D(t);return i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[a?i.jsx(K,{provider:a,size:14,className:U}):null,i.jsx("span",{className:"text-sm font-medium text-oai-black dark:text-oai-white",children:e})]}),r]})}const q=A;function w({children:e,tone:t="neutral"}){const r=t==="error"?"text-red-600 dark:text-red-400":"text-oai-gray-500 dark:text-oai-gray-400";return i.jsx("div",{className:`text-[11px] leading-snug ${r}`,children:e})}function J(e,t="used_percent"){return e?t==="utilization"?e.utilization:e.used_percent:null}function Q(e,t="reset_at"){return e?t==="resets_at"?e.resets_at:e.reset_at:null}function Z(e,t){return e.filter(r=>r.window).map(r=>i.jsx(X,{label:o(r.labelKey),pct:J(r.window,r.pctField),reset:V(Q(r.window,r.resetField)),mode:t},r.key))}function ee({specs:e,mode:t,extra:r=null}){const a=Z(e,t),l=a.length===0&&!r;return i.jsxs(i.Fragment,{children:[a,l?i.jsx(w,{children:o("limits.status.no_data")}):null,r]})}function ie(e,t,r,a,l=null){return i.jsx(f,{name:t,providerId:e,children:i.jsx(ee,{mode:r,specs:a,extra:l})},e)}function te(e,t){return e==="kimi_parallel"&&t.parallel_limit?i.jsx(w,{children:o("limits.label.kimi_parallel",{count:t.parallel_limit})}):e==="copilot_otel"&&!t.otel_has_files&&!t.otel_enabled?i.jsx(ae,{defaultDir:t.otel_default_dir}):null}function re(e,t,r,a){const l=L[e];return l?ie(e,r,a,l.windows(t),te(l.extra,t)):null}function le(e,t,r){if(!L[e])return null;if(!t?.configured)return i.jsx(f,{name:h(e),providerId:e,children:i.jsx(w,{children:o("limits.status.not_connected")})},e);if(t.error)return i.jsx(f,{name:h(e),providerId:e,children:i.jsx(w,{tone:"error",children:o("shared.error.prefix",{error:t.error})})},e);const a=h(e),l=t.plan_label?`${a} ${t.plan_label}`:a;return re(e,t,l,r)}function ae({defaultDir:e}){const[t,r]=y.useState(!1),l=["export COPILOT_OTEL_ENABLED=true","export COPILOT_OTEL_EXPORTER_TYPE=file",`export COPILOT_OTEL_FILE_EXPORTER_PATH="${e||"$HOME/.copilot/otel"}/copilot-otel-$(date +%Y%m%d).jsonl"`].join(`
2
- `),n=async()=>{try{await navigator.clipboard.writeText(l),r(!0),setTimeout(()=>r(!1),1600)}catch{}};return i.jsxs("div",{className:"mt-1 rounded-md border border-amber-300/60 dark:border-amber-700/40 bg-amber-50/50 dark:bg-amber-900/10 px-2.5 py-2 text-[11px] text-oai-gray-600 dark:text-oai-gray-300",children:[i.jsx("div",{className:"font-medium text-oai-gray-700 dark:text-oai-gray-200",children:o("limits.copilot.otelHint.title")}),i.jsx("div",{className:"mt-0.5 leading-snug",children:o("limits.copilot.otelHint.body")}),i.jsx("pre",{className:"mt-1.5 overflow-x-auto rounded bg-oai-gray-100 dark:bg-oai-gray-900/60 px-2 py-1.5 font-mono text-[10.5px] leading-tight whitespace-pre",children:l}),i.jsx("button",{type:"button",onClick:n,className:"mt-1 inline-flex items-center gap-1 rounded border border-oai-gray-300 dark:border-oai-gray-700 px-1.5 py-0.5 text-[10.5px] text-oai-gray-700 dark:text-oai-gray-200 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 transition-colors",children:t?o("limits.copilot.otelHint.copied"):o("limits.copilot.otelHint.copy")})]})}function oe(e){const[t,r]=y.useState(0);return y.useLayoutEffect(()=>{const a=e.current;if(!a)return;const l=a.querySelectorAll("[data-limit-label]");let n=0;const d=l.length>0?document.createElement("canvas").getContext("2d"):null;if(d){const s=window.getComputedStyle(l[0]);d.font=`${s.fontStyle} ${s.fontWeight} ${s.fontSize} ${s.fontFamily}`;for(const x of l)n=Math.max(n,d.measureText(x.textContent).width)}const u=Math.ceil(n);r(s=>s===u?s:u)}),t}function ne({claude:e,codex:t,cursor:r,gemini:a,kimi:l,kiro:n,grok:d,antigravity:u,copilot:s,order:x,visibility:b,displayMode:I}){const E={claude:e,codex:t,cursor:r,gemini:a,kimi:l,kiro:n,grok:d,antigravity:u,copilot:s},g=y.useRef(null),_=oe(g),P=Array.isArray(x)&&x.length>0?x:q,k=I===c.REMAINING?c.REMAINING:c.USED,S=k===c.REMAINING?o("limits.settings.display_mode_remaining"):o("limits.settings.display_mode_used"),j=P.filter(p=>!b||b[p]!==!1).map(p=>le(p,E[p],k)).filter(Boolean);return i.jsx($,{delay:.15,children:i.jsx(N,{children:i.jsxs("div",{ref:g,className:"flex flex-col gap-3",style:_>0?{"--tt-limits-label-w":`${_}px`}:void 0,children:[i.jsxs("h3",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide",children:[o("limits.panel.title"),o("limits.panel.mode_separator"),S]}),j.length>0?j:i.jsx(w,{children:o("limits.status.all_hidden")})]})})})}const se=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");function he(){const e=R(),{data:t,error:r,isLoading:a}=C(e?{initialRefresh:!0,initialState:e,publishToPreloadCache:!0}:{initialRefresh:!0,publishToPreloadCache:!0}),l=F();return!se&&!M()?i.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:i.jsx(W,{})}):i.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:i.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:i.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[i.jsxs("div",{className:"flex flex-row items-start justify-between gap-4 mb-8",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:o("nav.limits")}),i.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:o("limits.page.subtitle")})]}),i.jsx(T,{to:"/settings","aria-label":o("limits.page.openSettings"),title:o("limits.page.openSettings"),className:"shrink-0 inline-flex h-9 w-9 items-center justify-center rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:i.jsx(O,{className:"h-4 w-4","aria-hidden":!0})})]}),a?i.jsx(z,{}):i.jsxs(i.Fragment,{children:[r?i.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",children:o("shared.error.prefix",{error:r})}):null,i.jsx(ne,{claude:t?.claude,codex:t?.codex,cursor:t?.cursor,gemini:t?.gemini,kimi:t?.kimi,kiro:t?.kiro,grok:t?.grok,antigravity:t?.antigravity,copilot:t?.copilot,order:l.order,visibility:l.visibility,displayMode:l.displayMode})]})]})})})}export{he as LimitsPage};
@@ -1 +0,0 @@
1
- import{j as e,G as o,c3 as T,aR as P,r as u,a_ as I,R as B,V as _}from"./main-DabzSCdi.js";import{S as D}from"./Select-DpdVQLKY.js";import{u as E,T as K}from"./use-native-settings-DR32FzgQ.js";import{F as j,S as G,a as $}from"./FadeIn-CJOCXqQn.js";import{A as z}from"./arrow-up-right-AaxaGzI0.js";import{D as R}from"./download-C8lGIde6.js";import"./SelectItemText-BbIi_4at.js";import"./useScrollLock-C71NmlhZ.js";import"./Card-H6LsQDVa.js";const H=["todayTokens","todayCost"],M=[{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:"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:"antigravityClaude",label:"Antigravity Claude Limit",shortLabel:"Ag Cl",category:"limits"},{id:"antigravityGPro",label:"Antigravity Gemini Pro Limit",shortLabel:"Ag GPro",category:"limits"},{id:"antigravityFlash",label:"Antigravity Flash Limit",shortLabel:"Ag Fl",category:"limits"}];function v(t,i=M,s=2){const a=new Set(i.map(n=>n.id)),l=new Set,r=Array.isArray(t)?t.filter(n=>!a.has(n)||l.has(n)?!1:(l.add(n),!0)):[];return(r.length>0?r:H).slice(0,Math.max(1,Number(s)||2))}const O=264,U=124,h="ui-rounded, -apple-system, system-ui",L=["#5A8CF2","#9973E6","#4DB8A6","#E68C59"],V={claude:"#C77DFF",codex:"#34C759",cursor:"#FFCC00",gemini:"#0A84FF"};function X(t){return t>=.9?"#E64D4D":t>=.7?"#D9A633":"#33B866"}function b({size:t="sm",children:i}){const s=t==="lg",a=s?560:264,l=s?32:22;return e.jsx("div",{className:_("flex w-full items-center justify-center rounded-xl bg-oai-gray-100 dark:bg-oai-gray-950/60",s?"py-10 sm:py-14 px-6":"py-6 px-4"),children:e.jsx("div",{className:"overflow-hidden bg-white dark:bg-oai-gray-800 shadow-oai-md dark:shadow-[0_2px_4px_rgba(0,0,0,0.4),0_8px_24px_rgba(0,0,0,0.5)]",style:{width:"100%",maxWidth:a,aspectRatio:`${O} / ${U}`,borderRadius:l},children:i})})}function Y({size:t="sm"}){const i="M0,104 L14,104 C26,98 34,100 44,96 S58,88 68,92 80,100 90,94 102,80 112,82 126,92 136,88 150,74 162,76 178,88 188,86 204,72 216,74 236,84 250,80 L264,80",s=`${i} L264,124 L0,124 Z`,a=`sparkArea-${t}`;return e.jsx(b,{size:t,children:e.jsxs("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:a,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#0A84FF",stopOpacity:"0.18"}),e.jsx("stop",{offset:"100%",stopColor:"#0A84FF",stopOpacity:"0"})]})}),e.jsx("text",{x:"14",y:"20",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"700",letterSpacing:"0.6",children:"TODAY"}),e.jsx("text",{x:"14",y:"46",className:"fill-oai-black dark:fill-white",fontSize:"22",fontWeight:"700",fontFamily:h,children:"203.2M"}),e.jsx("text",{x:"14",y:"60",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:h,children:"$129.56 ±0%"}),e.jsx("text",{x:"134",y:"20",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"700",letterSpacing:"0.6",children:"7 DAYS"}),e.jsx("text",{x:"134",y:"46",className:"fill-oai-black dark:fill-white",fontSize:"22",fontWeight:"700",fontFamily:h,children:"880.9M"}),e.jsx("text",{x:"134",y:"60",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:h,children:"$673.61"}),e.jsx("path",{d:s,fill:`url(#${a})`,stroke:"none"}),e.jsx("path",{d:i,fill:"none",stroke:"#0A84FF",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})})}const N=(()=>{const s=[];for(let a=0;a<26;a++)for(let l=0;l<7;l++){const r=Math.sin((a+1)*12.9898+(l+1)*78.233+17)*43758.5453,c=Math.floor(Math.abs(r-Math.floor(r))*100);s.push({w:a,d:l,v:c})}return s})();function C(t,i){return t<18?i?"#262626":"#e5e5e5":t<38?"rgba(10, 132, 255, 0.28)":t<58?"rgba(10, 132, 255, 0.50)":t<80?"rgba(10, 132, 255, 0.75)":"#0A84FF"}function Z(){return e.jsx(b,{children:e.jsxs("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:[e.jsx("g",{transform:`translate(${19.5}, 10)`,className:"hidden dark:inline",children:N.map(r=>e.jsx("rect",{x:r.w*(7.5+1.2),y:r.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:C(r.v,!0)},`d-${r.w}-${r.d}`))}),e.jsx("g",{transform:`translate(${19.5}, 10)`,className:"dark:hidden",children:N.map(r=>e.jsx("rect",{x:r.w*(7.5+1.2),y:r.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:C(r.v,!1)},`l-${r.w}-${r.d}`))}),e.jsx("text",{x:19.5,y:"102",className:"fill-oai-black dark:fill-white",fontSize:"10",fontWeight:"700",fontFamily:h,children:"10.3B"}),e.jsx("text",{x:19.5+30,y:"102",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"9",fontWeight:"500",children:"tokens · 202 active days"})]})})}function q(){const t=[{name:"claude-opus-4-6",value:"586.4M",pct:59},{name:"claude-sonnet-4-5-20250929",value:"218.7M",pct:22},{name:"gpt-5.4",value:"80.6M",pct:8},{name:"composer-2-fast",value:"52.1M",pct:5}],i=22,s=28,a=14,l=236;return e.jsx(b,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((r,c)=>{const n=s+c*i,g=L[c%L.length];return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:g}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:r.name}),e.jsx("text",{x:"218",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"9",fontWeight:"600",fontFamily:h,children:r.value}),e.jsxs("text",{x:"250",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"600",fontFamily:h,children:[r.pct,"%"]}),e.jsx("rect",{x:a,y:n+4,width:l,height:"2.8",rx:"1.4",className:"fill-oai-gray-200 dark:fill-oai-gray-700"}),e.jsx("rect",{x:a,y:n+4,width:Math.max(l*(r.pct/100),4),height:"2.8",rx:"1.4",fill:g})]},r.name)})})})}function J(){const t=[{label:"Claude · 7d",source:"claude",reset:"in 1d",pct:61},{label:"Claude · 5h",source:"claude",reset:"in 4h 28m",pct:4},{label:"Cursor",source:"cursor",reset:"in 25d",pct:51},{label:"Codex · weekly",source:"codex",reset:"in 1d",pct:32}],i=22,s=28,a=14,l=236;return e.jsx(b,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((r,c)=>{const n=s+c*i,g=V[r.source],y=X(r.pct/100);return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:g}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:r.label}),e.jsx("text",{x:"218",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:h,children:r.reset}),e.jsxs("text",{x:"250",y:n,textAnchor:"end",className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"700",fontFamily:h,children:[r.pct,"%"]}),e.jsx("rect",{x:a,y:n+4,width:l,height:"2.8",rx:"1.4",className:"fill-oai-gray-200 dark:fill-oai-gray-700"}),e.jsx("rect",{x:a,y:n+4,width:Math.max(l*(r.pct/100),4),height:"2.8",rx:"1.4",fill:y})]},r.label)})})})}function Q(t){switch(t.category){case"cost":return"$8.42";case"limits":return"62%";default:return t.id==="last7dTokens"?"1.8B":"203M"}}function ee(t,i){switch(t){case"todayTokens":return o("menubar.metric.today_tokens");case"todayCost":return o("menubar.metric.today_cost");case"last7dTokens":return o("menubar.metric.last_7d_tokens");case"totalTokens":return o("menubar.metric.total_tokens");case"totalCost":return o("menubar.metric.total_cost");case"claude5h":return o("menubar.metric.claude_5h");case"claude7d":return o("menubar.metric.claude_7d");case"codex5h":return o("menubar.metric.codex_5h");case"codex7d":return o("menubar.metric.codex_7d");case"codexSpark5h":return o("menubar.metric.codex_spark_5h");case"codexSpark7d":return o("menubar.metric.codex_spark_7d");default:return i}}function te(t,i){const s=new Set(i.map(l=>l.id)),a=t.filter(l=>s.has(l));for(const l of i){if(a.length>=2)break;a.includes(l.id)||a.push(l.id)}return a.slice(0,2)}function ae({slotConfigs:t,showStats:i}){return e.jsx("div",{className:"flex justify-center rounded-xl bg-gradient-to-b from-oai-gray-100 to-oai-gray-200 px-6 py-8 dark:from-oai-gray-950/80 dark:to-oai-gray-900/80",children:e.jsxs("div",{className:"inline-flex items-stretch rounded-md shadow-[0_1px_3px_rgba(0,0,0,0.18)] ring-1 ring-black/10 dark:ring-white/10 px-3",style:{background:"linear-gradient(180deg, #2c2c2e 0%, #1c1c1e 100%)"},children:[e.jsx("div",{className:"flex items-center pl-2 pr-1 py-2.5",children:e.jsx("img",{src:"/clawd/mini/idle-tight.svg",alt:"","aria-hidden":"true",className:"block shrink-0",style:{height:22,width:"auto"},draggable:"false"})}),i?t.map(({slot:s,item:a},l)=>e.jsxs(B.Fragment,{children:[l>0?e.jsx("span",{className:"my-1 w-px bg-white/20","aria-hidden":"true"}):null,e.jsxs("div",{className:_("flex min-w-[52px] flex-col items-center justify-center py-1.5",l===0?"pl-1 pr-2":"px-2"),children:[e.jsx("span",{className:"text-[13px] font-semibold leading-none tabular-nums text-white",children:a?.previewValue||"--"}),e.jsx("span",{className:"mt-[2px] text-[6px] font-semibold uppercase leading-none text-white/75",children:a?.shortLabel||"Metric"})]})]},s)):null]})})}function ie({slot:t,value:i,options:s,disabled:a,onChange:l}){const r=t===0?o("menubar.slot.primary"):o("menubar.slot.secondary");return e.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.08em] text-oai-gray-500 dark:text-oai-gray-400",children:r}),e.jsx(D,{value:i,disabled:a,ariaLabel:r,onValueChange:c=>l(t,c),options:s.map(c=>({value:c.id,label:c.displayLabel})),matchTriggerWidth:!0,className:"w-full px-3 py-2 text-sm font-medium"})]})}function S({label:t,hint:i,checked:s,disabled:a,onChange:l}){return e.jsxs("div",{className:"flex items-center justify-between gap-3 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-oai-black dark:text-white",children:t}),i?e.jsx("p",{className:"mt-0.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:i}):null]}),e.jsx(K,{checked:s,disabled:a,onChange:l,ariaLabel:t})]})}function re(){const{available:t,settings:i,setSetting:s}=E(),a=u.useMemo(()=>(Array.isArray(i?.menuBarAvailableItems)?i.menuBarAvailableItems:M).map(m=>({...m,displayLabel:ee(m.id,m.label),previewValue:Q(m)})),[i?.menuBarAvailableItems]),l=Number(i?.menuBarMaxItems)||2,r=u.useMemo(()=>v(i?.menuBarItems,a,l),[a,l,i?.menuBarItems]),c=u.useMemo(()=>te(r,a),[a,r]),n=i?.showStats!==!1,g=d=>{s("menuBarItems",v(d,a,l))},y=(d,m)=>{const x=[...c];x[d===0?1:0]!==m&&(x[d]=m,g(x))},p=[0,1].map(d=>{const m=c[d]||a[d]?.id||"",w=c[d===0?1:0],F=a.filter(f=>f.id===m||f.id!==w),W=a.find(f=>f.id===m);return{slot:d,currentValue:m,options:F,item:W}}),k=i?.animatedIcon!==!1;return e.jsxs("article",{className:"rounded-xl border border-oai-gray-200 bg-white p-5 transition-colors duration-200 dark:border-oai-gray-800 dark:bg-oai-gray-900 sm:p-6",children:[e.jsx(ae,{slotConfigs:p,showStats:n}),e.jsx("div",{className:"mt-5 grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4",children:p.map(({slot:d,currentValue:m,options:x})=>e.jsx(ie,{slot:d,value:m,options:x,disabled:!t||!n,onChange:y},d))}),e.jsxs("div",{className:"mt-5 divide-y divide-oai-gray-100 border-t border-oai-gray-100 dark:divide-oai-gray-800 dark:border-oai-gray-800",children:[e.jsx(S,{label:o("settings.menubar.showStats"),hint:t?o("settings.menubar.showStatsHint"):o("menubar.native_only"),checked:n,disabled:!t,onChange:()=>s("showStats",!n)}),e.jsx(S,{label:o("settings.menubar.animatedIcon"),hint:o("settings.menubar.animatedIconHint"),checked:k,disabled:!t,onChange:()=>s("animatedIcon",!k)})]})]})}function se(){const[t,i]=u.useState("loading");return u.useEffect(()=>{if(typeof window>"u")return;if(I()){i("native");return}const s=(navigator.userAgent||"").toLowerCase(),a=/mac/.test(s)&&!/iphone|ipad/.test(s);i(a?"mac-web":"other")},[]),t}function le(){const t=se();return t==="loading"?e.jsx("div",{className:"h-10 w-40","aria-hidden":"true"}):t==="native"?e.jsxs("button",{type:"button",onClick:()=>T("openWidgetGallery"),className:"inline-flex h-10 items-center gap-2 rounded-lg bg-oai-black px-4 text-sm font-medium text-white transition-colors hover:bg-oai-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:bg-white dark:text-oai-black dark:hover:bg-oai-gray-200",children:[o("widgets.cta.open_gallery"),e.jsx(z,{className:"h-4 w-4","aria-hidden":"true"})]}):t==="mac-web"?e.jsxs("a",{href:"https://github.com/mm7894215/TokenTracker/releases/latest",target:"_blank",rel:"noopener noreferrer",className:"inline-flex h-10 items-center gap-2 rounded-lg bg-oai-black px-4 text-sm font-medium text-white no-underline transition-colors hover:bg-oai-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:bg-white dark:text-oai-black dark:hover:bg-oai-gray-200",children:[e.jsx(R,{className:"h-4 w-4","aria-hidden":"true"}),o("widgets.cta.download")]}):e.jsxs("span",{className:"inline-flex h-10 items-center gap-2 rounded-lg border border-oai-gray-200 bg-oai-gray-50 px-4 text-sm font-medium text-oai-gray-500 dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-oai-gray-400",children:[e.jsx(P,{className:"h-4 w-4","aria-hidden":"true"}),o("widgets.cta.macos_only")]})}const oe=[{id:"summary",Preview:Y,nameKey:"widgets.summary.name",descKey:"widgets.summary.description"},{id:"heatmap",Preview:Z,nameKey:"widgets.heatmap.name",descKey:"widgets.heatmap.description"},{id:"topModels",Preview:q,nameKey:"widgets.topModels.name",descKey:"widgets.topModels.description"},{id:"limits",Preview:J,nameKey:"widgets.limits.name",descKey:"widgets.limits.description"}];function ne({Preview:t,nameKey:i,descKey:s}){return e.jsxs("article",{className:"flex h-full flex-col rounded-xl border border-oai-gray-200 bg-white p-4 transition-colors duration-200 dark:border-oai-gray-800 dark:bg-oai-gray-900 sm:p-5",children:[e.jsx(t,{}),e.jsxs("div",{className:"mt-4",children:[e.jsx("h3",{className:"text-[15px] font-semibold text-oai-black dark:text-white",children:o(i)}),e.jsx("p",{className:"mt-1.5 text-sm leading-relaxed text-oai-gray-500 dark:text-oai-gray-400",children:o(s)})]})]})}function A({titleKey:t}){return e.jsx("h2",{className:"mb-4 text-xl font-semibold tracking-tight text-oai-black dark:text-white sm:mb-5 sm:text-2xl",children:o(t)})}function ye(){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(j,{y:12,children:e.jsxs("header",{className:"mb-10 flex items-start justify-between gap-4 sm:mb-12",children:[e.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:text-4xl",children:o("widgets.page.title")}),e.jsx("div",{className:"shrink-0",children:e.jsx(le,{})})]})}),e.jsx(j,{y:12,delay:.06,children:e.jsxs("section",{"aria-label":o("widgets.menubar.section.title"),className:"mb-12 sm:mb-14",children:[e.jsx(A,{titleKey:"widgets.menubar.section.title"}),e.jsx(re,{})]})}),e.jsxs("section",{"aria-label":o("widgets.gallery.section.title"),children:[e.jsx(A,{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:oe.map(({id:t,Preview:i,nameKey:s,descKey:a})=>e.jsx($,{children:e.jsx(ne,{Preview:i,nameKey:s,descKey:a})},t))})})]})]})})})}export{ye as WidgetsPage};